@depict-ai/ui 4.7.19 → 4.7.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ES10/index.cjs +33 -22
- package/ES10/index.d.ts +3 -3
- package/ES10/index.js +33 -22
- package/latest/index.cjs +33 -21
- package/latest/index.d.ts +3 -3
- package/latest/index.js +33 -21
- package/package.json +1 -1
- package/server/ES10/index.cjs +37 -25
- package/server/ES10/index.d.ts +8 -4
- package/server/ES10/index.js +37 -26
- package/server/latest/index.cjs +37 -24
- package/server/latest/index.d.ts +8 -4
- package/server/latest/index.js +37 -25
package/ES10/index.cjs
CHANGED
|
@@ -106,7 +106,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
|
|
|
106
106
|
$parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
|
|
107
107
|
$parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
|
|
108
108
|
/*! Depict.ai search and product listing SDK */
|
|
109
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.7.
|
|
109
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.7.20";
|
|
110
110
|
|
|
111
111
|
/**
|
|
112
112
|
* Gets product_id (the thing we key the rendering on) from a display
|
|
@@ -514,13 +514,15 @@ function $8edd3cf30d1fd8b4$export$a2cc176055f8f08() {
|
|
|
514
514
|
t: "<!-- ".concat(text, " -->")
|
|
515
515
|
} : document.createComment(text);
|
|
516
516
|
}
|
|
517
|
-
|
|
518
|
-
|
|
517
|
+
const $e3915574cfd3466c$var$defaultCacheKey = /*@__PURE__*/Symbol();
|
|
518
|
+
const $e3915574cfd3466c$var$cachedPlaceholderElements = {};
|
|
519
|
+
const $e3915574cfd3466c$var$renderingCachedPlaceholderElement = {};
|
|
519
520
|
function $e3915574cfd3466c$export$f33414a4df0afd3f(_ref) {
|
|
520
521
|
let {
|
|
521
522
|
product_card_template_: product_card_template_,
|
|
522
523
|
num_placeholders_: num_placeholders_,
|
|
523
|
-
content_blocks_: content_blocks_
|
|
524
|
+
content_blocks_: content_blocks_,
|
|
525
|
+
placeholderCacheKey_: placeholderCacheKey_
|
|
524
526
|
} = _ref;
|
|
525
527
|
const [num_to_actually_show, set_num_to_actually_show] = $52FdA$solidjs.createSignal($52FdA$solidjs.untrack(num_placeholders_));
|
|
526
528
|
if (0, $52FdA$solidjsweb.isServer)
|
|
@@ -557,7 +559,8 @@ function $e3915574cfd3466c$export$f33414a4df0afd3f(_ref) {
|
|
|
557
559
|
});
|
|
558
560
|
// Show content block before product card, so it's *at* that index
|
|
559
561
|
return [possible_content_block, $e3915574cfd3466c$var$Placeholder({
|
|
560
|
-
product_card_template_: product_card_template_
|
|
562
|
+
product_card_template_: product_card_template_,
|
|
563
|
+
placeholderCacheKey_: placeholderCacheKey_
|
|
561
564
|
})]; // https://github.com/solidjs/solid/releases/tag/v1.7.0
|
|
562
565
|
}
|
|
563
566
|
});
|
|
@@ -567,23 +570,25 @@ function $e3915574cfd3466c$export$f33414a4df0afd3f(_ref) {
|
|
|
567
570
|
*/
|
|
568
571
|
function $e3915574cfd3466c$var$Placeholder(_ref2) {
|
|
569
572
|
let {
|
|
570
|
-
product_card_template_: product_card_template_
|
|
573
|
+
product_card_template_: product_card_template_,
|
|
574
|
+
placeholderCacheKey_ = $e3915574cfd3466c$var$defaultCacheKey
|
|
571
575
|
} = _ref2;
|
|
572
576
|
const get_cloned_placeholders = function () {
|
|
573
|
-
let element_to_clone = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $e3915574cfd3466c$var$
|
|
577
|
+
let element_to_clone = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $e3915574cfd3466c$var$cachedPlaceholderElements[placeholderCacheKey_];
|
|
574
578
|
return Array.isArray(element_to_clone) ? element_to_clone.map(el => el instanceof Node ? el.cloneNode(true) : el) : element_to_clone;
|
|
575
579
|
};
|
|
576
|
-
if ($e3915574cfd3466c$var$
|
|
580
|
+
if ($e3915574cfd3466c$var$cachedPlaceholderElements[placeholderCacheKey_]) return get_cloned_placeholders();
|
|
577
581
|
let dispose_original_copy;
|
|
578
582
|
const get_unwrapped_element = $52FdA$solidjs.createRoot(dispose => {
|
|
579
583
|
dispose_original_copy = dispose;
|
|
580
584
|
// if product_card_template_ is async and rejects the resource will take care of throwing upwards here in the solid-js error handling system
|
|
581
585
|
const [resource] = $52FdA$solidjs.createResource(() => {
|
|
582
|
-
|
|
586
|
+
const rendering_cached_placeholder_element = $e3915574cfd3466c$var$renderingCachedPlaceholderElement[placeholderCacheKey_];
|
|
587
|
+
if (rendering_cached_placeholder_element) return rendering_cached_placeholder_element;
|
|
583
588
|
const return_value = product_card_template_(null, undefined);
|
|
584
589
|
if (typeof return_value === "object" && typeof (return_value === null || return_value === void 0 ? void 0 : return_value.then) === "function")
|
|
585
590
|
// Is Promise or promise-like object
|
|
586
|
-
$e3915574cfd3466c$var$
|
|
591
|
+
$e3915574cfd3466c$var$renderingCachedPlaceholderElement[placeholderCacheKey_] = return_value;
|
|
587
592
|
return return_value;
|
|
588
593
|
});
|
|
589
594
|
return $52FdA$solidjs.createMemo(() => {
|
|
@@ -592,14 +597,14 @@ function $e3915574cfd3466c$var$Placeholder(_ref2) {
|
|
|
592
597
|
});
|
|
593
598
|
});
|
|
594
599
|
$52FdA$solidjs.onCleanup(() => {
|
|
595
|
-
|
|
596
|
-
|
|
600
|
+
const rendering = $e3915574cfd3466c$var$renderingCachedPlaceholderElement[placeholderCacheKey_];
|
|
601
|
+
if (rendering) {
|
|
597
602
|
// If we're still rendering in our separate root, let the rendering finish or other <Placeholder> components waiting for it might get an incomplete result
|
|
598
603
|
const unset_current_rendering = () => {
|
|
599
604
|
dispose_original_copy();
|
|
600
|
-
$e3915574cfd3466c$var$
|
|
605
|
+
$e3915574cfd3466c$var$renderingCachedPlaceholderElement[placeholderCacheKey_] = undefined;
|
|
601
606
|
};
|
|
602
|
-
|
|
607
|
+
rendering === null || rendering === void 0 || rendering.then(unset_current_rendering, unset_current_rendering);
|
|
603
608
|
} else
|
|
604
609
|
// Otherwise, just make sure we've disposed our root
|
|
605
610
|
dispose_original_copy();
|
|
@@ -611,8 +616,8 @@ function $e3915574cfd3466c$var$Placeholder(_ref2) {
|
|
|
611
616
|
return;
|
|
612
617
|
// placeholders have finished rendering, freeze the elements
|
|
613
618
|
// here we might receive the result of a promise that has already been received, tore down and put into cached_placeholder_element, so don't overwrite that more valid result if it's already set
|
|
614
|
-
$e3915574cfd3466c$var$
|
|
615
|
-
$e3915574cfd3466c$var$
|
|
619
|
+
$e3915574cfd3466c$var$cachedPlaceholderElements[placeholderCacheKey_] || ($e3915574cfd3466c$var$cachedPlaceholderElements[placeholderCacheKey_] = get_cloned_placeholders(unwrapped_array)); // Clone initial return value so that who gave us the elements can't mutate them, which has caused issues before with react
|
|
620
|
+
$e3915574cfd3466c$var$renderingCachedPlaceholderElement[placeholderCacheKey_] = undefined;
|
|
616
621
|
dispose_original_copy(); // So that this memo will never re-run and the placeholder rendering function can clean up
|
|
617
622
|
return get_cloned_placeholders(); // clone, just in case. If we wouldn't, someone could modify the copy in the DOM, and it would affect the cached version
|
|
618
623
|
});
|
|
@@ -929,7 +934,8 @@ function $236a257ee52e5414$export$d41d19e89346fa2(_ref) {
|
|
|
929
934
|
product_card_template_: product_card_template_,
|
|
930
935
|
layout_options_: layout_options_,
|
|
931
936
|
title_: title_,
|
|
932
|
-
NoResultsFallback_: NoResultsFallback_
|
|
937
|
+
NoResultsFallback_: NoResultsFallback_,
|
|
938
|
+
placeholderCacheKey_: placeholderCacheKey_
|
|
933
939
|
} = _ref;
|
|
934
940
|
const is_showing_something = $52FdA$solidjs.createMemo(() => {
|
|
935
941
|
var _recommendations_reso;
|
|
@@ -970,7 +976,8 @@ function $236a257ee52e5414$export$d41d19e89346fa2(_ref) {
|
|
|
970
976
|
get fallback() {
|
|
971
977
|
return $e3915574cfd3466c$export$f33414a4df0afd3f({
|
|
972
978
|
num_placeholders_: num_placeholders_,
|
|
973
|
-
product_card_template_: product_card_template_
|
|
979
|
+
product_card_template_: product_card_template_,
|
|
980
|
+
placeholderCacheKey_: placeholderCacheKey_
|
|
974
981
|
});
|
|
975
982
|
},
|
|
976
983
|
get children() {
|
|
@@ -1970,7 +1977,6 @@ function $47e3c3102c78121b$export$44809a8a3e867e30(_ref) {
|
|
|
1970
1977
|
ro.observe(el);
|
|
1971
1978
|
$52FdA$solidjs.onCleanup(() => ro.disconnect());
|
|
1972
1979
|
}, _el$);
|
|
1973
|
-
_el$.classList.toggle("placeholder", !!!display_);
|
|
1974
1980
|
$52FdA$solidjsweb.insert(_el$, $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
|
|
1975
1981
|
get when() {
|
|
1976
1982
|
return display_();
|
|
@@ -2005,6 +2011,7 @@ function $47e3c3102c78121b$export$44809a8a3e867e30(_ref) {
|
|
|
2005
2011
|
pseudoRouter_: pseudoRouter_,
|
|
2006
2012
|
containerHeight_: containerHeight_
|
|
2007
2013
|
}), _el$5, _co$2);
|
|
2014
|
+
$52FdA$solidjsweb.effect(() => _el$.classList.toggle("placeholder", !display_()));
|
|
2008
2015
|
$52FdA$solidjsweb.runHydrationEvents();
|
|
2009
2016
|
return _el$;
|
|
2010
2017
|
})();
|
|
@@ -2145,7 +2152,8 @@ function $2c920813c92d6987$export$7da560f849543dff(_ref) {
|
|
|
2145
2152
|
title_: title_,
|
|
2146
2153
|
max_rows_: max_rows_,
|
|
2147
2154
|
view_more_button_: view_more_button_,
|
|
2148
|
-
NoResultsFallback_: NoResultsFallback_
|
|
2155
|
+
NoResultsFallback_: NoResultsFallback_,
|
|
2156
|
+
placeholderCacheKey_: placeholderCacheKey_
|
|
2149
2157
|
} = _ref;
|
|
2150
2158
|
const rows_object_ = $52FdA$solidjs.createMemo(() => {
|
|
2151
2159
|
var _view_more_button$row;
|
|
@@ -2204,7 +2212,8 @@ function $2c920813c92d6987$export$7da560f849543dff(_ref) {
|
|
|
2204
2212
|
get fallback() {
|
|
2205
2213
|
return $e3915574cfd3466c$export$f33414a4df0afd3f({
|
|
2206
2214
|
num_placeholders_: num_placeholders_,
|
|
2207
|
-
product_card_template_: product_card_template_
|
|
2215
|
+
product_card_template_: product_card_template_,
|
|
2216
|
+
placeholderCacheKey_: placeholderCacheKey_
|
|
2208
2217
|
});
|
|
2209
2218
|
},
|
|
2210
2219
|
get children() {
|
|
@@ -2237,6 +2246,7 @@ function $2c920813c92d6987$export$7da560f849543dff(_ref) {
|
|
|
2237
2246
|
}
|
|
2238
2247
|
var $e57cd46536ad992e$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div style=--animation-duration:240ms>`);
|
|
2239
2248
|
let $e57cd46536ad992e$var$expandedLooksSignal_;
|
|
2249
|
+
const $e57cd46536ad992e$var$placeholderCacheKey_ = /*@__PURE__*/Symbol("Looks");
|
|
2240
2250
|
function $e57cd46536ad992e$export$2c9f9bf2092486aa(props) {
|
|
2241
2251
|
return $d05611ff6b8c8357$export$23fca46f3143581f(() => {
|
|
2242
2252
|
$e57cd46536ad992e$var$expandedLooksSignal_ || ($e57cd46536ad992e$var$expandedLooksSignal_ = $52FdA$solidjs.createSignal(new Set(), {
|
|
@@ -2302,7 +2312,8 @@ function $e57cd46536ad992e$export$2c9f9bf2092486aa(props) {
|
|
|
2302
2312
|
cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(props.columnsAtSize_),
|
|
2303
2313
|
...grid_spacing_override()
|
|
2304
2314
|
})),
|
|
2305
|
-
NoResultsFallback_: () => props.NoResultsFallback_
|
|
2315
|
+
NoResultsFallback_: () => props.NoResultsFallback_,
|
|
2316
|
+
placeholderCacheKey_: $e57cd46536ad992e$var$placeholderCacheKey_
|
|
2306
2317
|
};
|
|
2307
2318
|
$52FdA$solidjs.createEffect(() => {
|
|
2308
2319
|
const {
|
package/ES10/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
|
|
13
13
|
import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
|
|
14
|
-
export const version = "4.7.
|
|
14
|
+
export const version = "4.7.20";
|
|
15
15
|
declare const LISTING_ID = "listingId";
|
|
16
16
|
declare const EXTERNAL_ID = "externalId";
|
|
17
17
|
type ScrollRestorationData = {
|
|
@@ -1440,7 +1440,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
|
|
|
1440
1440
|
* Open the modal with support for alignment.
|
|
1441
1441
|
* @returns {void}
|
|
1442
1442
|
*/
|
|
1443
|
-
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends
|
|
1443
|
+
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
|
|
1444
1444
|
export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
|
|
1445
1445
|
export interface PageReplacer {
|
|
1446
1446
|
readonly render_: () => Node_Array;
|
|
@@ -1519,5 +1519,5 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
|
|
|
1519
1519
|
content_blocks_by_row?: ContentBlocksByRow;
|
|
1520
1520
|
layout?: PossibleLayout;
|
|
1521
1521
|
filterModalParent_?: HTMLElement | ShadowRoot;
|
|
1522
|
-
}): import("@depict-ai/utilishared
|
|
1522
|
+
}): import("@depict-ai/utilishared").Node_Array;
|
|
1523
1523
|
export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";
|
package/ES10/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { createStore as $8tj43$createStore, reconcile as $8tj43$reconcile } from
|
|
|
10
10
|
/*! Depict.ai search and product listing SDK */
|
|
11
11
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
12
12
|
register_es_version("ui", "ES10");
|
|
13
|
-
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.7.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.7.20";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Gets product_id (the thing we key the rendering on) from a display
|
|
@@ -418,13 +418,15 @@ function $ca55612a53dbbdd2$export$a2cc176055f8f08() {
|
|
|
418
418
|
t: "<!-- ".concat(text, " -->")
|
|
419
419
|
} : document.createComment(text);
|
|
420
420
|
}
|
|
421
|
-
|
|
422
|
-
|
|
421
|
+
const $bdd80c7862246dc2$var$defaultCacheKey = /*@__PURE__*/Symbol();
|
|
422
|
+
const $bdd80c7862246dc2$var$cachedPlaceholderElements = {};
|
|
423
|
+
const $bdd80c7862246dc2$var$renderingCachedPlaceholderElement = {};
|
|
423
424
|
function $bdd80c7862246dc2$export$f33414a4df0afd3f(_ref) {
|
|
424
425
|
let {
|
|
425
426
|
product_card_template_: product_card_template_,
|
|
426
427
|
num_placeholders_: num_placeholders_,
|
|
427
|
-
content_blocks_: content_blocks_
|
|
428
|
+
content_blocks_: content_blocks_,
|
|
429
|
+
placeholderCacheKey_: placeholderCacheKey_
|
|
428
430
|
} = _ref;
|
|
429
431
|
const [num_to_actually_show, set_num_to_actually_show] = $8tj43$createSignal($8tj43$untrack(num_placeholders_));
|
|
430
432
|
if (0, $8tj43$isServer)
|
|
@@ -461,7 +463,8 @@ function $bdd80c7862246dc2$export$f33414a4df0afd3f(_ref) {
|
|
|
461
463
|
});
|
|
462
464
|
// Show content block before product card, so it's *at* that index
|
|
463
465
|
return [possible_content_block, $bdd80c7862246dc2$var$Placeholder({
|
|
464
|
-
product_card_template_: product_card_template_
|
|
466
|
+
product_card_template_: product_card_template_,
|
|
467
|
+
placeholderCacheKey_: placeholderCacheKey_
|
|
465
468
|
})]; // https://github.com/solidjs/solid/releases/tag/v1.7.0
|
|
466
469
|
}
|
|
467
470
|
});
|
|
@@ -471,23 +474,25 @@ function $bdd80c7862246dc2$export$f33414a4df0afd3f(_ref) {
|
|
|
471
474
|
*/
|
|
472
475
|
function $bdd80c7862246dc2$var$Placeholder(_ref2) {
|
|
473
476
|
let {
|
|
474
|
-
product_card_template_: product_card_template_
|
|
477
|
+
product_card_template_: product_card_template_,
|
|
478
|
+
placeholderCacheKey_ = $bdd80c7862246dc2$var$defaultCacheKey
|
|
475
479
|
} = _ref2;
|
|
476
480
|
const get_cloned_placeholders = function () {
|
|
477
|
-
let element_to_clone = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $bdd80c7862246dc2$var$
|
|
481
|
+
let element_to_clone = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $bdd80c7862246dc2$var$cachedPlaceholderElements[placeholderCacheKey_];
|
|
478
482
|
return Array.isArray(element_to_clone) ? element_to_clone.map(el => el instanceof Node ? el.cloneNode(true) : el) : element_to_clone;
|
|
479
483
|
};
|
|
480
|
-
if ($bdd80c7862246dc2$var$
|
|
484
|
+
if ($bdd80c7862246dc2$var$cachedPlaceholderElements[placeholderCacheKey_]) return get_cloned_placeholders();
|
|
481
485
|
let dispose_original_copy;
|
|
482
486
|
const get_unwrapped_element = $8tj43$createRoot(dispose => {
|
|
483
487
|
dispose_original_copy = dispose;
|
|
484
488
|
// if product_card_template_ is async and rejects the resource will take care of throwing upwards here in the solid-js error handling system
|
|
485
489
|
const [resource] = $8tj43$createResource(() => {
|
|
486
|
-
|
|
490
|
+
const rendering_cached_placeholder_element = $bdd80c7862246dc2$var$renderingCachedPlaceholderElement[placeholderCacheKey_];
|
|
491
|
+
if (rendering_cached_placeholder_element) return rendering_cached_placeholder_element;
|
|
487
492
|
const return_value = product_card_template_(null, undefined);
|
|
488
493
|
if (typeof return_value === "object" && typeof (return_value === null || return_value === void 0 ? void 0 : return_value.then) === "function")
|
|
489
494
|
// Is Promise or promise-like object
|
|
490
|
-
$bdd80c7862246dc2$var$
|
|
495
|
+
$bdd80c7862246dc2$var$renderingCachedPlaceholderElement[placeholderCacheKey_] = return_value;
|
|
491
496
|
return return_value;
|
|
492
497
|
});
|
|
493
498
|
return $8tj43$createMemo(() => {
|
|
@@ -496,14 +501,14 @@ function $bdd80c7862246dc2$var$Placeholder(_ref2) {
|
|
|
496
501
|
});
|
|
497
502
|
});
|
|
498
503
|
$8tj43$onCleanup(() => {
|
|
499
|
-
|
|
500
|
-
|
|
504
|
+
const rendering = $bdd80c7862246dc2$var$renderingCachedPlaceholderElement[placeholderCacheKey_];
|
|
505
|
+
if (rendering) {
|
|
501
506
|
// If we're still rendering in our separate root, let the rendering finish or other <Placeholder> components waiting for it might get an incomplete result
|
|
502
507
|
const unset_current_rendering = () => {
|
|
503
508
|
dispose_original_copy();
|
|
504
|
-
$bdd80c7862246dc2$var$
|
|
509
|
+
$bdd80c7862246dc2$var$renderingCachedPlaceholderElement[placeholderCacheKey_] = undefined;
|
|
505
510
|
};
|
|
506
|
-
|
|
511
|
+
rendering === null || rendering === void 0 || rendering.then(unset_current_rendering, unset_current_rendering);
|
|
507
512
|
} else
|
|
508
513
|
// Otherwise, just make sure we've disposed our root
|
|
509
514
|
dispose_original_copy();
|
|
@@ -515,8 +520,8 @@ function $bdd80c7862246dc2$var$Placeholder(_ref2) {
|
|
|
515
520
|
return;
|
|
516
521
|
// placeholders have finished rendering, freeze the elements
|
|
517
522
|
// here we might receive the result of a promise that has already been received, tore down and put into cached_placeholder_element, so don't overwrite that more valid result if it's already set
|
|
518
|
-
$bdd80c7862246dc2$var$
|
|
519
|
-
$bdd80c7862246dc2$var$
|
|
523
|
+
$bdd80c7862246dc2$var$cachedPlaceholderElements[placeholderCacheKey_] || ($bdd80c7862246dc2$var$cachedPlaceholderElements[placeholderCacheKey_] = get_cloned_placeholders(unwrapped_array)); // Clone initial return value so that who gave us the elements can't mutate them, which has caused issues before with react
|
|
524
|
+
$bdd80c7862246dc2$var$renderingCachedPlaceholderElement[placeholderCacheKey_] = undefined;
|
|
520
525
|
dispose_original_copy(); // So that this memo will never re-run and the placeholder rendering function can clean up
|
|
521
526
|
return get_cloned_placeholders(); // clone, just in case. If we wouldn't, someone could modify the copy in the DOM, and it would affect the cached version
|
|
522
527
|
});
|
|
@@ -833,7 +838,8 @@ function $39ddb986053fb759$export$d41d19e89346fa2(_ref) {
|
|
|
833
838
|
product_card_template_: product_card_template_,
|
|
834
839
|
layout_options_: layout_options_,
|
|
835
840
|
title_: title_,
|
|
836
|
-
NoResultsFallback_: NoResultsFallback_
|
|
841
|
+
NoResultsFallback_: NoResultsFallback_,
|
|
842
|
+
placeholderCacheKey_: placeholderCacheKey_
|
|
837
843
|
} = _ref;
|
|
838
844
|
const is_showing_something = $8tj43$createMemo(() => {
|
|
839
845
|
var _recommendations_reso;
|
|
@@ -874,7 +880,8 @@ function $39ddb986053fb759$export$d41d19e89346fa2(_ref) {
|
|
|
874
880
|
get fallback() {
|
|
875
881
|
return $bdd80c7862246dc2$export$f33414a4df0afd3f({
|
|
876
882
|
num_placeholders_: num_placeholders_,
|
|
877
|
-
product_card_template_: product_card_template_
|
|
883
|
+
product_card_template_: product_card_template_,
|
|
884
|
+
placeholderCacheKey_: placeholderCacheKey_
|
|
878
885
|
});
|
|
879
886
|
},
|
|
880
887
|
get children() {
|
|
@@ -1874,7 +1881,6 @@ function $697d8713dc82b9ab$export$44809a8a3e867e30(_ref) {
|
|
|
1874
1881
|
ro.observe(el);
|
|
1875
1882
|
$8tj43$onCleanup(() => ro.disconnect());
|
|
1876
1883
|
}, _el$);
|
|
1877
|
-
_el$.classList.toggle("placeholder", !!!display_);
|
|
1878
1884
|
$8tj43$insert(_el$, $8tj43$createComponent((0, $8tj43$Show), {
|
|
1879
1885
|
get when() {
|
|
1880
1886
|
return display_();
|
|
@@ -1909,6 +1915,7 @@ function $697d8713dc82b9ab$export$44809a8a3e867e30(_ref) {
|
|
|
1909
1915
|
pseudoRouter_: pseudoRouter_,
|
|
1910
1916
|
containerHeight_: containerHeight_
|
|
1911
1917
|
}), _el$5, _co$2);
|
|
1918
|
+
$8tj43$effect(() => _el$.classList.toggle("placeholder", !display_()));
|
|
1912
1919
|
$8tj43$runHydrationEvents();
|
|
1913
1920
|
return _el$;
|
|
1914
1921
|
})();
|
|
@@ -2049,7 +2056,8 @@ function $e3efeb558d952696$export$7da560f849543dff(_ref) {
|
|
|
2049
2056
|
title_: title_,
|
|
2050
2057
|
max_rows_: max_rows_,
|
|
2051
2058
|
view_more_button_: view_more_button_,
|
|
2052
|
-
NoResultsFallback_: NoResultsFallback_
|
|
2059
|
+
NoResultsFallback_: NoResultsFallback_,
|
|
2060
|
+
placeholderCacheKey_: placeholderCacheKey_
|
|
2053
2061
|
} = _ref;
|
|
2054
2062
|
const rows_object_ = $8tj43$createMemo(() => {
|
|
2055
2063
|
var _view_more_button$row;
|
|
@@ -2108,7 +2116,8 @@ function $e3efeb558d952696$export$7da560f849543dff(_ref) {
|
|
|
2108
2116
|
get fallback() {
|
|
2109
2117
|
return $bdd80c7862246dc2$export$f33414a4df0afd3f({
|
|
2110
2118
|
num_placeholders_: num_placeholders_,
|
|
2111
|
-
product_card_template_: product_card_template_
|
|
2119
|
+
product_card_template_: product_card_template_,
|
|
2120
|
+
placeholderCacheKey_: placeholderCacheKey_
|
|
2112
2121
|
});
|
|
2113
2122
|
},
|
|
2114
2123
|
get children() {
|
|
@@ -2141,6 +2150,7 @@ function $e3efeb558d952696$export$7da560f849543dff(_ref) {
|
|
|
2141
2150
|
}
|
|
2142
2151
|
var $bb34cd283e904784$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<div style=--animation-duration:240ms>`);
|
|
2143
2152
|
let $bb34cd283e904784$var$expandedLooksSignal_;
|
|
2153
|
+
const $bb34cd283e904784$var$placeholderCacheKey_ = /*@__PURE__*/Symbol("Looks");
|
|
2144
2154
|
function $bb34cd283e904784$export$2c9f9bf2092486aa(props) {
|
|
2145
2155
|
return $83e8cf2c0b87a58a$export$23fca46f3143581f(() => {
|
|
2146
2156
|
$bb34cd283e904784$var$expandedLooksSignal_ || ($bb34cd283e904784$var$expandedLooksSignal_ = $8tj43$createSignal(new Set(), {
|
|
@@ -2206,7 +2216,8 @@ function $bb34cd283e904784$export$2c9f9bf2092486aa(props) {
|
|
|
2206
2216
|
cols_at_size: $a9c7ba6087881ac2$export$6daf8749b65a1b77(props.columnsAtSize_),
|
|
2207
2217
|
...grid_spacing_override()
|
|
2208
2218
|
})),
|
|
2209
|
-
NoResultsFallback_: () => props.NoResultsFallback_
|
|
2219
|
+
NoResultsFallback_: () => props.NoResultsFallback_,
|
|
2220
|
+
placeholderCacheKey_: $bb34cd283e904784$var$placeholderCacheKey_
|
|
2210
2221
|
};
|
|
2211
2222
|
$8tj43$createEffect(() => {
|
|
2212
2223
|
const {
|
package/latest/index.cjs
CHANGED
|
@@ -100,7 +100,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $1f4925833f07df29$export$5b7
|
|
|
100
100
|
$parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de035477d6fef996);
|
|
101
101
|
$parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
|
|
102
102
|
/*! Depict.ai search and product listing SDK */
|
|
103
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.7.
|
|
103
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.7.20";
|
|
104
104
|
|
|
105
105
|
/**
|
|
106
106
|
* Gets product_id (the thing we key the rendering on) from a display
|
|
@@ -496,12 +496,14 @@ function $fc23d7668ae0011d$export$a2cc176055f8f08(what = "grid") {
|
|
|
496
496
|
t: `<!-- ${text} -->`
|
|
497
497
|
} : document.createComment(text);
|
|
498
498
|
}
|
|
499
|
-
|
|
500
|
-
|
|
499
|
+
const $0caf87eaa19079da$var$defaultCacheKey = /*@__PURE__*/Symbol();
|
|
500
|
+
const $0caf87eaa19079da$var$cachedPlaceholderElements = {};
|
|
501
|
+
const $0caf87eaa19079da$var$renderingCachedPlaceholderElement = {};
|
|
501
502
|
function $0caf87eaa19079da$export$f33414a4df0afd3f({
|
|
502
503
|
product_card_template_: product_card_template_,
|
|
503
504
|
num_placeholders_: num_placeholders_,
|
|
504
|
-
content_blocks_: content_blocks_
|
|
505
|
+
content_blocks_: content_blocks_,
|
|
506
|
+
placeholderCacheKey_: placeholderCacheKey_
|
|
505
507
|
}) {
|
|
506
508
|
const [num_to_actually_show, set_num_to_actually_show] = $gVhhF$solidjs.createSignal($gVhhF$solidjs.untrack(num_placeholders_));
|
|
507
509
|
if (0, $gVhhF$solidjsweb.isServer)
|
|
@@ -535,7 +537,8 @@ function $0caf87eaa19079da$export$f33414a4df0afd3f({
|
|
|
535
537
|
const possible_content_block = $gVhhF$solidjs.createMemo(() => content_blocks_?.()?.()?.[index]);
|
|
536
538
|
// Show content block before product card, so it's *at* that index
|
|
537
539
|
return [possible_content_block, $0caf87eaa19079da$var$Placeholder({
|
|
538
|
-
product_card_template_: product_card_template_
|
|
540
|
+
product_card_template_: product_card_template_,
|
|
541
|
+
placeholderCacheKey_: placeholderCacheKey_
|
|
539
542
|
})]; // https://github.com/solidjs/solid/releases/tag/v1.7.0
|
|
540
543
|
}
|
|
541
544
|
});
|
|
@@ -544,20 +547,22 @@ function $0caf87eaa19079da$export$f33414a4df0afd3f({
|
|
|
544
547
|
* Get one placeholder element. It will be cloned for each placeholder for ultimate performance even when solid-js isn't rendering the placeholders.
|
|
545
548
|
*/
|
|
546
549
|
function $0caf87eaa19079da$var$Placeholder({
|
|
547
|
-
product_card_template_: product_card_template_
|
|
550
|
+
product_card_template_: product_card_template_,
|
|
551
|
+
placeholderCacheKey_ = $0caf87eaa19079da$var$defaultCacheKey
|
|
548
552
|
}) {
|
|
549
|
-
const get_cloned_placeholders = (element_to_clone = $0caf87eaa19079da$var$
|
|
550
|
-
if ($0caf87eaa19079da$var$
|
|
553
|
+
const get_cloned_placeholders = (element_to_clone = $0caf87eaa19079da$var$cachedPlaceholderElements[placeholderCacheKey_]) => Array.isArray(element_to_clone) ? element_to_clone.map(el => el instanceof Node ? el.cloneNode(true) : el) : element_to_clone;
|
|
554
|
+
if ($0caf87eaa19079da$var$cachedPlaceholderElements[placeholderCacheKey_]) return get_cloned_placeholders();
|
|
551
555
|
let dispose_original_copy;
|
|
552
556
|
const get_unwrapped_element = $gVhhF$solidjs.createRoot(dispose => {
|
|
553
557
|
dispose_original_copy = dispose;
|
|
554
558
|
// if product_card_template_ is async and rejects the resource will take care of throwing upwards here in the solid-js error handling system
|
|
555
559
|
const [resource] = $gVhhF$solidjs.createResource(() => {
|
|
556
|
-
|
|
560
|
+
const rendering_cached_placeholder_element = $0caf87eaa19079da$var$renderingCachedPlaceholderElement[placeholderCacheKey_];
|
|
561
|
+
if (rendering_cached_placeholder_element) return rendering_cached_placeholder_element;
|
|
557
562
|
const return_value = product_card_template_(null, undefined);
|
|
558
563
|
if (typeof return_value === "object" && typeof return_value?.then === "function")
|
|
559
564
|
// Is Promise or promise-like object
|
|
560
|
-
$0caf87eaa19079da$var$
|
|
565
|
+
$0caf87eaa19079da$var$renderingCachedPlaceholderElement[placeholderCacheKey_] = return_value;
|
|
561
566
|
return return_value;
|
|
562
567
|
});
|
|
563
568
|
return $gVhhF$solidjs.createMemo(() => {
|
|
@@ -566,13 +571,14 @@ function $0caf87eaa19079da$var$Placeholder({
|
|
|
566
571
|
});
|
|
567
572
|
});
|
|
568
573
|
$gVhhF$solidjs.onCleanup(() => {
|
|
569
|
-
|
|
574
|
+
const rendering = $0caf87eaa19079da$var$renderingCachedPlaceholderElement[placeholderCacheKey_];
|
|
575
|
+
if (rendering) {
|
|
570
576
|
// If we're still rendering in our separate root, let the rendering finish or other <Placeholder> components waiting for it might get an incomplete result
|
|
571
577
|
const unset_current_rendering = () => {
|
|
572
578
|
dispose_original_copy();
|
|
573
|
-
$0caf87eaa19079da$var$
|
|
579
|
+
$0caf87eaa19079da$var$renderingCachedPlaceholderElement[placeholderCacheKey_] = undefined;
|
|
574
580
|
};
|
|
575
|
-
|
|
581
|
+
rendering?.then(unset_current_rendering, unset_current_rendering);
|
|
576
582
|
} else
|
|
577
583
|
// Otherwise, just make sure we've disposed our root
|
|
578
584
|
dispose_original_copy();
|
|
@@ -584,8 +590,8 @@ function $0caf87eaa19079da$var$Placeholder({
|
|
|
584
590
|
return;
|
|
585
591
|
// placeholders have finished rendering, freeze the elements
|
|
586
592
|
// here we might receive the result of a promise that has already been received, tore down and put into cached_placeholder_element, so don't overwrite that more valid result if it's already set
|
|
587
|
-
$0caf87eaa19079da$var$
|
|
588
|
-
$0caf87eaa19079da$var$
|
|
593
|
+
$0caf87eaa19079da$var$cachedPlaceholderElements[placeholderCacheKey_] ||= get_cloned_placeholders(unwrapped_array); // Clone initial return value so that who gave us the elements can't mutate them, which has caused issues before with react
|
|
594
|
+
$0caf87eaa19079da$var$renderingCachedPlaceholderElement[placeholderCacheKey_] = undefined;
|
|
589
595
|
dispose_original_copy(); // So that this memo will never re-run and the placeholder rendering function can clean up
|
|
590
596
|
return get_cloned_placeholders(); // clone, just in case. If we wouldn't, someone could modify the copy in the DOM, and it would affect the cached version
|
|
591
597
|
});
|
|
@@ -882,7 +888,8 @@ function $363ce4d1d71041aa$export$d41d19e89346fa2({
|
|
|
882
888
|
product_card_template_: product_card_template_,
|
|
883
889
|
layout_options_: layout_options_,
|
|
884
890
|
title_: title_,
|
|
885
|
-
NoResultsFallback_: NoResultsFallback_
|
|
891
|
+
NoResultsFallback_: NoResultsFallback_,
|
|
892
|
+
placeholderCacheKey_: placeholderCacheKey_
|
|
886
893
|
}) {
|
|
887
894
|
const is_showing_something = $gVhhF$solidjs.createMemo(() => recommendations_resource_.loading || recommendations_resource_()?.length);
|
|
888
895
|
const title = $gVhhF$solidjs.createMemo(() => title_?.()); // In case getter/accessor creates elements, don't create them twice
|
|
@@ -920,7 +927,8 @@ function $363ce4d1d71041aa$export$d41d19e89346fa2({
|
|
|
920
927
|
get fallback() {
|
|
921
928
|
return $0caf87eaa19079da$export$f33414a4df0afd3f({
|
|
922
929
|
num_placeholders_: num_placeholders_,
|
|
923
|
-
product_card_template_: product_card_template_
|
|
930
|
+
product_card_template_: product_card_template_,
|
|
931
|
+
placeholderCacheKey_: placeholderCacheKey_
|
|
924
932
|
});
|
|
925
933
|
},
|
|
926
934
|
get children() {
|
|
@@ -1882,7 +1890,6 @@ function $ad882bbe664dbd53$export$44809a8a3e867e30({
|
|
|
1882
1890
|
ro.observe(el);
|
|
1883
1891
|
$gVhhF$solidjs.onCleanup(() => ro.disconnect());
|
|
1884
1892
|
}, _el$);
|
|
1885
|
-
_el$.classList.toggle("placeholder", !!!display_);
|
|
1886
1893
|
$gVhhF$solidjsweb.insert(_el$, $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
|
|
1887
1894
|
get when() {
|
|
1888
1895
|
return display_();
|
|
@@ -1913,6 +1920,7 @@ function $ad882bbe664dbd53$export$44809a8a3e867e30({
|
|
|
1913
1920
|
pseudoRouter_: pseudoRouter_,
|
|
1914
1921
|
containerHeight_: containerHeight_
|
|
1915
1922
|
}), _el$5, _co$2);
|
|
1923
|
+
$gVhhF$solidjsweb.effect(() => _el$.classList.toggle("placeholder", !display_()));
|
|
1916
1924
|
$gVhhF$solidjsweb.runHydrationEvents();
|
|
1917
1925
|
return _el$;
|
|
1918
1926
|
})();
|
|
@@ -2040,7 +2048,8 @@ function $b8e79813f4f7ebe4$export$7da560f849543dff({
|
|
|
2040
2048
|
title_: title_,
|
|
2041
2049
|
max_rows_: max_rows_,
|
|
2042
2050
|
view_more_button_: view_more_button_,
|
|
2043
|
-
NoResultsFallback_: NoResultsFallback_
|
|
2051
|
+
NoResultsFallback_: NoResultsFallback_,
|
|
2052
|
+
placeholderCacheKey_: placeholderCacheKey_
|
|
2044
2053
|
}) {
|
|
2045
2054
|
const rows_object_ = $gVhhF$solidjs.createMemo(() => {
|
|
2046
2055
|
const view_more_button = view_more_button_?.();
|
|
@@ -2095,7 +2104,8 @@ function $b8e79813f4f7ebe4$export$7da560f849543dff({
|
|
|
2095
2104
|
get fallback() {
|
|
2096
2105
|
return $0caf87eaa19079da$export$f33414a4df0afd3f({
|
|
2097
2106
|
num_placeholders_: num_placeholders_,
|
|
2098
|
-
product_card_template_: product_card_template_
|
|
2107
|
+
product_card_template_: product_card_template_,
|
|
2108
|
+
placeholderCacheKey_: placeholderCacheKey_
|
|
2099
2109
|
});
|
|
2100
2110
|
},
|
|
2101
2111
|
get children() {
|
|
@@ -2128,6 +2138,7 @@ function $b8e79813f4f7ebe4$export$7da560f849543dff({
|
|
|
2128
2138
|
}
|
|
2129
2139
|
var $a3bbfa5fdaa39f3a$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div style=--animation-duration:240ms>`);
|
|
2130
2140
|
let $a3bbfa5fdaa39f3a$var$expandedLooksSignal_;
|
|
2141
|
+
const $a3bbfa5fdaa39f3a$var$placeholderCacheKey_ = /*@__PURE__*/Symbol("Looks");
|
|
2131
2142
|
function $a3bbfa5fdaa39f3a$export$2c9f9bf2092486aa(props) {
|
|
2132
2143
|
return $95837413165cc2df$export$23fca46f3143581f(() => {
|
|
2133
2144
|
$a3bbfa5fdaa39f3a$var$expandedLooksSignal_ ||= $gVhhF$solidjs.createSignal(new Set(), {
|
|
@@ -2191,7 +2202,8 @@ function $a3bbfa5fdaa39f3a$export$2c9f9bf2092486aa(props) {
|
|
|
2191
2202
|
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(props.columnsAtSize_),
|
|
2192
2203
|
...grid_spacing_override()
|
|
2193
2204
|
})),
|
|
2194
|
-
NoResultsFallback_: () => props.NoResultsFallback_
|
|
2205
|
+
NoResultsFallback_: () => props.NoResultsFallback_,
|
|
2206
|
+
placeholderCacheKey_: $a3bbfa5fdaa39f3a$var$placeholderCacheKey_
|
|
2195
2207
|
};
|
|
2196
2208
|
$gVhhF$solidjs.createEffect(() => {
|
|
2197
2209
|
const {
|
package/latest/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
|
|
13
13
|
import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
|
|
14
|
-
export const version = "4.7.
|
|
14
|
+
export const version = "4.7.20";
|
|
15
15
|
declare const LISTING_ID = "listingId";
|
|
16
16
|
declare const EXTERNAL_ID = "externalId";
|
|
17
17
|
type ScrollRestorationData = {
|
|
@@ -1440,7 +1440,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
|
|
|
1440
1440
|
* Open the modal with support for alignment.
|
|
1441
1441
|
* @returns {void}
|
|
1442
1442
|
*/
|
|
1443
|
-
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends
|
|
1443
|
+
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
|
|
1444
1444
|
export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
|
|
1445
1445
|
export interface PageReplacer {
|
|
1446
1446
|
readonly render_: () => Node_Array;
|
|
@@ -1519,5 +1519,5 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
|
|
|
1519
1519
|
content_blocks_by_row?: ContentBlocksByRow;
|
|
1520
1520
|
layout?: PossibleLayout;
|
|
1521
1521
|
filterModalParent_?: HTMLElement | ShadowRoot;
|
|
1522
|
-
}): import("@depict-ai/utilishared
|
|
1522
|
+
}): import("@depict-ai/utilishared").Node_Array;
|
|
1523
1523
|
export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";
|