@depict-ai/ui 4.7.18 → 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/latest/index.cjs CHANGED
@@ -13,6 +13,7 @@ function $parcel$export(e, n, v, s) {
13
13
  });
14
14
  }
15
15
  $parcel$export(module.exports, "useProductCardIsVisible", () => $67155e1aeb7073f6$export$80bb7300ce6a8be3);
16
+ $parcel$export(module.exports, "CurrentlyIntersectingContext", () => $67155e1aeb7073f6$export$f223d69ed12f5fb7);
16
17
  $parcel$export(module.exports, "useExpandingContainerReactive", () => $4b455f60dadde8b8$export$5bad61ecde080b1f);
17
18
  $parcel$export(module.exports, "LooksSliderOrGrid", () => $a3bbfa5fdaa39f3a$export$2c9f9bf2092486aa);
18
19
  $parcel$export(module.exports, "LookCard", () => $ad882bbe664dbd53$export$44809a8a3e867e30);
@@ -99,7 +100,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $1f4925833f07df29$export$5b7
99
100
  $parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de035477d6fef996);
100
101
  $parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
101
102
  /*! Depict.ai search and product listing SDK */
102
- const $b757f75811f3261f$export$83d89fbfd8236492 = "4.7.18";
103
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "4.7.20";
103
104
 
104
105
  /**
105
106
  * Gets product_id (the thing we key the rendering on) from a display
@@ -337,7 +338,7 @@ function $a73063cc642f3e5f$var$deep_equal(obj1, obj2) {
337
338
  }
338
339
  return true;
339
340
  }
340
- const $67155e1aeb7073f6$var$CurrentlyIntersectingContext = /*@__PURE__*/$gVhhF$solidjs.createContext();
341
+ const $67155e1aeb7073f6$export$f223d69ed12f5fb7 = /*@__PURE__*/$gVhhF$solidjs.createContext();
341
342
  function $67155e1aeb7073f6$export$4a14175d33d81a96({
342
343
  displays_by_key_: displays_by_key_,
343
344
  product_card_template_: product_card_template_,
@@ -378,7 +379,7 @@ function $67155e1aeb7073f6$export$4a14175d33d81a96({
378
379
  }
379
380
  setCurrentlyIntersecting(intersectingValue);
380
381
  }, "renderDisplays IO failed"));
381
- const renderedDisplays_ = $gVhhF$solidjsweb.createComponent($67155e1aeb7073f6$var$CurrentlyIntersectingContext.Provider, {
382
+ const renderedDisplays_ = $gVhhF$solidjsweb.createComponent($67155e1aeb7073f6$export$f223d69ed12f5fb7.Provider, {
382
383
  value: {
383
384
  currentlyIntersecting_: currentlyIntersecting,
384
385
  setIsListening_: setListenersForIntersecting
@@ -423,7 +424,7 @@ function $67155e1aeb7073f6$export$80bb7300ce6a8be3() {
423
424
  const {
424
425
  setIsListening_: setIsListening_,
425
426
  currentlyIntersecting_: currentlyIntersecting_
426
- } = $gVhhF$solidjs.useContext($67155e1aeb7073f6$var$CurrentlyIntersectingContext) || {};
427
+ } = $gVhhF$solidjs.useContext($67155e1aeb7073f6$export$f223d69ed12f5fb7) || {};
427
428
  const getOurIndex = $129b9b9c010039d0$export$e3faf4d95300054f();
428
429
  const isVisible = $gVhhF$solidjs.createMemo(() => currentlyIntersecting_?.().has(getOurIndex?.()));
429
430
  setIsListening_?.(prev => prev + 1);
@@ -495,12 +496,14 @@ function $fc23d7668ae0011d$export$a2cc176055f8f08(what = "grid") {
495
496
  t: `<!-- ${text} -->`
496
497
  } : document.createComment(text);
497
498
  }
498
- let $0caf87eaa19079da$var$cached_placeholder_element;
499
- let $0caf87eaa19079da$var$rendering_cached_placeholder_element;
499
+ const $0caf87eaa19079da$var$defaultCacheKey = /*@__PURE__*/Symbol();
500
+ const $0caf87eaa19079da$var$cachedPlaceholderElements = {};
501
+ const $0caf87eaa19079da$var$renderingCachedPlaceholderElement = {};
500
502
  function $0caf87eaa19079da$export$f33414a4df0afd3f({
501
503
  product_card_template_: product_card_template_,
502
504
  num_placeholders_: num_placeholders_,
503
- content_blocks_: content_blocks_
505
+ content_blocks_: content_blocks_,
506
+ placeholderCacheKey_: placeholderCacheKey_
504
507
  }) {
505
508
  const [num_to_actually_show, set_num_to_actually_show] = $gVhhF$solidjs.createSignal($gVhhF$solidjs.untrack(num_placeholders_));
506
509
  if (0, $gVhhF$solidjsweb.isServer)
@@ -534,7 +537,8 @@ function $0caf87eaa19079da$export$f33414a4df0afd3f({
534
537
  const possible_content_block = $gVhhF$solidjs.createMemo(() => content_blocks_?.()?.()?.[index]);
535
538
  // Show content block before product card, so it's *at* that index
536
539
  return [possible_content_block, $0caf87eaa19079da$var$Placeholder({
537
- product_card_template_: product_card_template_
540
+ product_card_template_: product_card_template_,
541
+ placeholderCacheKey_: placeholderCacheKey_
538
542
  })]; // https://github.com/solidjs/solid/releases/tag/v1.7.0
539
543
  }
540
544
  });
@@ -543,20 +547,22 @@ function $0caf87eaa19079da$export$f33414a4df0afd3f({
543
547
  * Get one placeholder element. It will be cloned for each placeholder for ultimate performance even when solid-js isn't rendering the placeholders.
544
548
  */
545
549
  function $0caf87eaa19079da$var$Placeholder({
546
- product_card_template_: product_card_template_
550
+ product_card_template_: product_card_template_,
551
+ placeholderCacheKey_ = $0caf87eaa19079da$var$defaultCacheKey
547
552
  }) {
548
- const get_cloned_placeholders = (element_to_clone = $0caf87eaa19079da$var$cached_placeholder_element) => Array.isArray(element_to_clone) ? element_to_clone.map(el => el instanceof Node ? el.cloneNode(true) : el) : element_to_clone;
549
- if ($0caf87eaa19079da$var$cached_placeholder_element) return get_cloned_placeholders();
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();
550
555
  let dispose_original_copy;
551
556
  const get_unwrapped_element = $gVhhF$solidjs.createRoot(dispose => {
552
557
  dispose_original_copy = dispose;
553
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
554
559
  const [resource] = $gVhhF$solidjs.createResource(() => {
555
- if ($0caf87eaa19079da$var$rendering_cached_placeholder_element) return $0caf87eaa19079da$var$rendering_cached_placeholder_element;
560
+ const rendering_cached_placeholder_element = $0caf87eaa19079da$var$renderingCachedPlaceholderElement[placeholderCacheKey_];
561
+ if (rendering_cached_placeholder_element) return rendering_cached_placeholder_element;
556
562
  const return_value = product_card_template_(null, undefined);
557
563
  if (typeof return_value === "object" && typeof return_value?.then === "function")
558
564
  // Is Promise or promise-like object
559
- $0caf87eaa19079da$var$rendering_cached_placeholder_element = return_value;
565
+ $0caf87eaa19079da$var$renderingCachedPlaceholderElement[placeholderCacheKey_] = return_value;
560
566
  return return_value;
561
567
  });
562
568
  return $gVhhF$solidjs.createMemo(() => {
@@ -565,13 +571,14 @@ function $0caf87eaa19079da$var$Placeholder({
565
571
  });
566
572
  });
567
573
  $gVhhF$solidjs.onCleanup(() => {
568
- if ($0caf87eaa19079da$var$rendering_cached_placeholder_element) {
574
+ const rendering = $0caf87eaa19079da$var$renderingCachedPlaceholderElement[placeholderCacheKey_];
575
+ if (rendering) {
569
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
570
577
  const unset_current_rendering = () => {
571
578
  dispose_original_copy();
572
- $0caf87eaa19079da$var$rendering_cached_placeholder_element = undefined;
579
+ $0caf87eaa19079da$var$renderingCachedPlaceholderElement[placeholderCacheKey_] = undefined;
573
580
  };
574
- $0caf87eaa19079da$var$rendering_cached_placeholder_element?.then(unset_current_rendering, unset_current_rendering);
581
+ rendering?.then(unset_current_rendering, unset_current_rendering);
575
582
  } else
576
583
  // Otherwise, just make sure we've disposed our root
577
584
  dispose_original_copy();
@@ -583,8 +590,8 @@ function $0caf87eaa19079da$var$Placeholder({
583
590
  return;
584
591
  // placeholders have finished rendering, freeze the elements
585
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
586
- $0caf87eaa19079da$var$cached_placeholder_element ||= 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
587
- $0caf87eaa19079da$var$rendering_cached_placeholder_element = undefined;
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;
588
595
  dispose_original_copy(); // So that this memo will never re-run and the placeholder rendering function can clean up
589
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
590
597
  });
@@ -881,7 +888,8 @@ function $363ce4d1d71041aa$export$d41d19e89346fa2({
881
888
  product_card_template_: product_card_template_,
882
889
  layout_options_: layout_options_,
883
890
  title_: title_,
884
- NoResultsFallback_: NoResultsFallback_
891
+ NoResultsFallback_: NoResultsFallback_,
892
+ placeholderCacheKey_: placeholderCacheKey_
885
893
  }) {
886
894
  const is_showing_something = $gVhhF$solidjs.createMemo(() => recommendations_resource_.loading || recommendations_resource_()?.length);
887
895
  const title = $gVhhF$solidjs.createMemo(() => title_?.()); // In case getter/accessor creates elements, don't create them twice
@@ -919,7 +927,8 @@ function $363ce4d1d71041aa$export$d41d19e89346fa2({
919
927
  get fallback() {
920
928
  return $0caf87eaa19079da$export$f33414a4df0afd3f({
921
929
  num_placeholders_: num_placeholders_,
922
- product_card_template_: product_card_template_
930
+ product_card_template_: product_card_template_,
931
+ placeholderCacheKey_: placeholderCacheKey_
923
932
  });
924
933
  },
925
934
  get children() {
@@ -1881,7 +1890,6 @@ function $ad882bbe664dbd53$export$44809a8a3e867e30({
1881
1890
  ro.observe(el);
1882
1891
  $gVhhF$solidjs.onCleanup(() => ro.disconnect());
1883
1892
  }, _el$);
1884
- _el$.classList.toggle("placeholder", !!!display_);
1885
1893
  $gVhhF$solidjsweb.insert(_el$, $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
1886
1894
  get when() {
1887
1895
  return display_();
@@ -1912,6 +1920,7 @@ function $ad882bbe664dbd53$export$44809a8a3e867e30({
1912
1920
  pseudoRouter_: pseudoRouter_,
1913
1921
  containerHeight_: containerHeight_
1914
1922
  }), _el$5, _co$2);
1923
+ $gVhhF$solidjsweb.effect(() => _el$.classList.toggle("placeholder", !display_()));
1915
1924
  $gVhhF$solidjsweb.runHydrationEvents();
1916
1925
  return _el$;
1917
1926
  })();
@@ -2039,7 +2048,8 @@ function $b8e79813f4f7ebe4$export$7da560f849543dff({
2039
2048
  title_: title_,
2040
2049
  max_rows_: max_rows_,
2041
2050
  view_more_button_: view_more_button_,
2042
- NoResultsFallback_: NoResultsFallback_
2051
+ NoResultsFallback_: NoResultsFallback_,
2052
+ placeholderCacheKey_: placeholderCacheKey_
2043
2053
  }) {
2044
2054
  const rows_object_ = $gVhhF$solidjs.createMemo(() => {
2045
2055
  const view_more_button = view_more_button_?.();
@@ -2094,7 +2104,8 @@ function $b8e79813f4f7ebe4$export$7da560f849543dff({
2094
2104
  get fallback() {
2095
2105
  return $0caf87eaa19079da$export$f33414a4df0afd3f({
2096
2106
  num_placeholders_: num_placeholders_,
2097
- product_card_template_: product_card_template_
2107
+ product_card_template_: product_card_template_,
2108
+ placeholderCacheKey_: placeholderCacheKey_
2098
2109
  });
2099
2110
  },
2100
2111
  get children() {
@@ -2127,6 +2138,7 @@ function $b8e79813f4f7ebe4$export$7da560f849543dff({
2127
2138
  }
2128
2139
  var $a3bbfa5fdaa39f3a$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div style=--animation-duration:240ms>`);
2129
2140
  let $a3bbfa5fdaa39f3a$var$expandedLooksSignal_;
2141
+ const $a3bbfa5fdaa39f3a$var$placeholderCacheKey_ = /*@__PURE__*/Symbol("Looks");
2130
2142
  function $a3bbfa5fdaa39f3a$export$2c9f9bf2092486aa(props) {
2131
2143
  return $95837413165cc2df$export$23fca46f3143581f(() => {
2132
2144
  $a3bbfa5fdaa39f3a$var$expandedLooksSignal_ ||= $gVhhF$solidjs.createSignal(new Set(), {
@@ -2190,7 +2202,8 @@ function $a3bbfa5fdaa39f3a$export$2c9f9bf2092486aa(props) {
2190
2202
  cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(props.columnsAtSize_),
2191
2203
  ...grid_spacing_override()
2192
2204
  })),
2193
- NoResultsFallback_: () => props.NoResultsFallback_
2205
+ NoResultsFallback_: () => props.NoResultsFallback_,
2206
+ placeholderCacheKey_: $a3bbfa5fdaa39f3a$var$placeholderCacheKey_
2194
2207
  };
2195
2208
  $gVhhF$solidjs.createEffect(() => {
2196
2209
  const {
package/latest/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { JSX, Accessor, Signal, Setter } from "solid-js";
1
+ import { JSX, Accessor, Setter, Signal } from "solid-js";
2
2
  import { Display, useExpandingContainer, ColsAtSize, report, Amazing_Slider, Elem, ModernDisplay, Node_Array } from "@depict-ai/utilishared/latest";
3
3
  import { SearchFilter, SearchRequestV3, SortModel } from "@depict-ai/types/api/SearchRequestV3";
4
4
  import { ContentLink, SearchResponse, SearchFilter as _SearchFilter1 } from "@depict-ai/types/api/SearchResponse";
@@ -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.18";
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 = {
@@ -52,6 +52,10 @@ export function useProductCardIndex(): Accessor<number> | undefined;
52
52
  * @param obj Anything to clone
53
53
  */
54
54
  export function promiseSafeStructuredClone<T>(obj: T): T;
55
+ export const CurrentlyIntersectingContext: import("solid-js").Context<{
56
+ currentlyIntersecting_: Accessor<Set<number>>;
57
+ setIsListening_: Setter<number>;
58
+ } | undefined>;
55
59
  /**
56
60
  * Returns an accessor that says if said product card is in the viewport or not, when ran within a product card. Throws if not ran within a product card.
57
61
  */
@@ -1436,7 +1440,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
1436
1440
  * Open the modal with support for alignment.
1437
1441
  * @returns {void}
1438
1442
  */
1439
- export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1443
+ export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1440
1444
  export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
1441
1445
  export interface PageReplacer {
1442
1446
  readonly render_: () => Node_Array;
@@ -1515,5 +1519,5 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
1515
1519
  content_blocks_by_row?: ContentBlocksByRow;
1516
1520
  layout?: PossibleLayout;
1517
1521
  filterModalParent_?: HTMLElement | ShadowRoot;
1518
- }): import("@depict-ai/utilishared/latest").Node_Array;
1522
+ }): import("@depict-ai/utilishared").Node_Array;
1519
1523
  export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";
package/latest/index.js CHANGED
@@ -7,7 +7,7 @@ import { createStore as $9HbP8$createStore, reconcile as $9HbP8$reconcile } from
7
7
  /*! Depict.ai search and product listing SDK */
8
8
  import { register_es_version } from "../multi_import_deduplicator.mjs";
9
9
  register_es_version("ui", "latest");
10
- const $ec291e0010116877$export$83d89fbfd8236492 = "4.7.18";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "4.7.20";
11
11
 
12
12
  /**
13
13
  * Gets product_id (the thing we key the rendering on) from a display
@@ -245,7 +245,7 @@ function $29ec7cddbe1d3484$var$deep_equal(obj1, obj2) {
245
245
  }
246
246
  return true;
247
247
  }
248
- const $f091294da861020c$var$CurrentlyIntersectingContext = /*@__PURE__*/$9HbP8$createContext();
248
+ const $f091294da861020c$export$f223d69ed12f5fb7 = /*@__PURE__*/$9HbP8$createContext();
249
249
  function $f091294da861020c$export$4a14175d33d81a96({
250
250
  displays_by_key_: displays_by_key_,
251
251
  product_card_template_: product_card_template_,
@@ -286,7 +286,7 @@ function $f091294da861020c$export$4a14175d33d81a96({
286
286
  }
287
287
  setCurrentlyIntersecting(intersectingValue);
288
288
  }, "renderDisplays IO failed"));
289
- const renderedDisplays_ = $9HbP8$createComponent($f091294da861020c$var$CurrentlyIntersectingContext.Provider, {
289
+ const renderedDisplays_ = $9HbP8$createComponent($f091294da861020c$export$f223d69ed12f5fb7.Provider, {
290
290
  value: {
291
291
  currentlyIntersecting_: currentlyIntersecting,
292
292
  setIsListening_: setListenersForIntersecting
@@ -331,7 +331,7 @@ function $f091294da861020c$export$80bb7300ce6a8be3() {
331
331
  const {
332
332
  setIsListening_: setIsListening_,
333
333
  currentlyIntersecting_: currentlyIntersecting_
334
- } = $9HbP8$useContext($f091294da861020c$var$CurrentlyIntersectingContext) || {};
334
+ } = $9HbP8$useContext($f091294da861020c$export$f223d69ed12f5fb7) || {};
335
335
  const getOurIndex = $b6440e72ed83671a$export$e3faf4d95300054f();
336
336
  const isVisible = $9HbP8$createMemo(() => currentlyIntersecting_?.().has(getOurIndex?.()));
337
337
  setIsListening_?.(prev => prev + 1);
@@ -403,12 +403,14 @@ function $a458486f22b22f63$export$a2cc176055f8f08(what = "grid") {
403
403
  t: `<!-- ${text} -->`
404
404
  } : document.createComment(text);
405
405
  }
406
- let $6e41f1fde994db72$var$cached_placeholder_element;
407
- let $6e41f1fde994db72$var$rendering_cached_placeholder_element;
406
+ const $6e41f1fde994db72$var$defaultCacheKey = /*@__PURE__*/Symbol();
407
+ const $6e41f1fde994db72$var$cachedPlaceholderElements = {};
408
+ const $6e41f1fde994db72$var$renderingCachedPlaceholderElement = {};
408
409
  function $6e41f1fde994db72$export$f33414a4df0afd3f({
409
410
  product_card_template_: product_card_template_,
410
411
  num_placeholders_: num_placeholders_,
411
- content_blocks_: content_blocks_
412
+ content_blocks_: content_blocks_,
413
+ placeholderCacheKey_: placeholderCacheKey_
412
414
  }) {
413
415
  const [num_to_actually_show, set_num_to_actually_show] = $9HbP8$createSignal($9HbP8$untrack(num_placeholders_));
414
416
  if (0, $9HbP8$isServer)
@@ -442,7 +444,8 @@ function $6e41f1fde994db72$export$f33414a4df0afd3f({
442
444
  const possible_content_block = $9HbP8$createMemo(() => content_blocks_?.()?.()?.[index]);
443
445
  // Show content block before product card, so it's *at* that index
444
446
  return [possible_content_block, $6e41f1fde994db72$var$Placeholder({
445
- product_card_template_: product_card_template_
447
+ product_card_template_: product_card_template_,
448
+ placeholderCacheKey_: placeholderCacheKey_
446
449
  })]; // https://github.com/solidjs/solid/releases/tag/v1.7.0
447
450
  }
448
451
  });
@@ -451,20 +454,22 @@ function $6e41f1fde994db72$export$f33414a4df0afd3f({
451
454
  * Get one placeholder element. It will be cloned for each placeholder for ultimate performance even when solid-js isn't rendering the placeholders.
452
455
  */
453
456
  function $6e41f1fde994db72$var$Placeholder({
454
- product_card_template_: product_card_template_
457
+ product_card_template_: product_card_template_,
458
+ placeholderCacheKey_ = $6e41f1fde994db72$var$defaultCacheKey
455
459
  }) {
456
- const get_cloned_placeholders = (element_to_clone = $6e41f1fde994db72$var$cached_placeholder_element) => Array.isArray(element_to_clone) ? element_to_clone.map(el => el instanceof Node ? el.cloneNode(true) : el) : element_to_clone;
457
- if ($6e41f1fde994db72$var$cached_placeholder_element) return get_cloned_placeholders();
460
+ const get_cloned_placeholders = (element_to_clone = $6e41f1fde994db72$var$cachedPlaceholderElements[placeholderCacheKey_]) => Array.isArray(element_to_clone) ? element_to_clone.map(el => el instanceof Node ? el.cloneNode(true) : el) : element_to_clone;
461
+ if ($6e41f1fde994db72$var$cachedPlaceholderElements[placeholderCacheKey_]) return get_cloned_placeholders();
458
462
  let dispose_original_copy;
459
463
  const get_unwrapped_element = $9HbP8$createRoot(dispose => {
460
464
  dispose_original_copy = dispose;
461
465
  // if product_card_template_ is async and rejects the resource will take care of throwing upwards here in the solid-js error handling system
462
466
  const [resource] = $9HbP8$createResource(() => {
463
- if ($6e41f1fde994db72$var$rendering_cached_placeholder_element) return $6e41f1fde994db72$var$rendering_cached_placeholder_element;
467
+ const rendering_cached_placeholder_element = $6e41f1fde994db72$var$renderingCachedPlaceholderElement[placeholderCacheKey_];
468
+ if (rendering_cached_placeholder_element) return rendering_cached_placeholder_element;
464
469
  const return_value = product_card_template_(null, undefined);
465
470
  if (typeof return_value === "object" && typeof return_value?.then === "function")
466
471
  // Is Promise or promise-like object
467
- $6e41f1fde994db72$var$rendering_cached_placeholder_element = return_value;
472
+ $6e41f1fde994db72$var$renderingCachedPlaceholderElement[placeholderCacheKey_] = return_value;
468
473
  return return_value;
469
474
  });
470
475
  return $9HbP8$createMemo(() => {
@@ -473,13 +478,14 @@ function $6e41f1fde994db72$var$Placeholder({
473
478
  });
474
479
  });
475
480
  $9HbP8$onCleanup(() => {
476
- if ($6e41f1fde994db72$var$rendering_cached_placeholder_element) {
481
+ const rendering = $6e41f1fde994db72$var$renderingCachedPlaceholderElement[placeholderCacheKey_];
482
+ if (rendering) {
477
483
  // 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
478
484
  const unset_current_rendering = () => {
479
485
  dispose_original_copy();
480
- $6e41f1fde994db72$var$rendering_cached_placeholder_element = undefined;
486
+ $6e41f1fde994db72$var$renderingCachedPlaceholderElement[placeholderCacheKey_] = undefined;
481
487
  };
482
- $6e41f1fde994db72$var$rendering_cached_placeholder_element?.then(unset_current_rendering, unset_current_rendering);
488
+ rendering?.then(unset_current_rendering, unset_current_rendering);
483
489
  } else
484
490
  // Otherwise, just make sure we've disposed our root
485
491
  dispose_original_copy();
@@ -491,8 +497,8 @@ function $6e41f1fde994db72$var$Placeholder({
491
497
  return;
492
498
  // placeholders have finished rendering, freeze the elements
493
499
  // 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
494
- $6e41f1fde994db72$var$cached_placeholder_element ||= 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
495
- $6e41f1fde994db72$var$rendering_cached_placeholder_element = undefined;
500
+ $6e41f1fde994db72$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
501
+ $6e41f1fde994db72$var$renderingCachedPlaceholderElement[placeholderCacheKey_] = undefined;
496
502
  dispose_original_copy(); // So that this memo will never re-run and the placeholder rendering function can clean up
497
503
  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
498
504
  });
@@ -789,7 +795,8 @@ function $c4492d24952ed731$export$d41d19e89346fa2({
789
795
  product_card_template_: product_card_template_,
790
796
  layout_options_: layout_options_,
791
797
  title_: title_,
792
- NoResultsFallback_: NoResultsFallback_
798
+ NoResultsFallback_: NoResultsFallback_,
799
+ placeholderCacheKey_: placeholderCacheKey_
793
800
  }) {
794
801
  const is_showing_something = $9HbP8$createMemo(() => recommendations_resource_.loading || recommendations_resource_()?.length);
795
802
  const title = $9HbP8$createMemo(() => title_?.()); // In case getter/accessor creates elements, don't create them twice
@@ -827,7 +834,8 @@ function $c4492d24952ed731$export$d41d19e89346fa2({
827
834
  get fallback() {
828
835
  return $6e41f1fde994db72$export$f33414a4df0afd3f({
829
836
  num_placeholders_: num_placeholders_,
830
- product_card_template_: product_card_template_
837
+ product_card_template_: product_card_template_,
838
+ placeholderCacheKey_: placeholderCacheKey_
831
839
  });
832
840
  },
833
841
  get children() {
@@ -1789,7 +1797,6 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
1789
1797
  ro.observe(el);
1790
1798
  $9HbP8$onCleanup(() => ro.disconnect());
1791
1799
  }, _el$);
1792
- _el$.classList.toggle("placeholder", !!!display_);
1793
1800
  $9HbP8$insert(_el$, $9HbP8$createComponent((0, $9HbP8$Show), {
1794
1801
  get when() {
1795
1802
  return display_();
@@ -1820,6 +1827,7 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
1820
1827
  pseudoRouter_: pseudoRouter_,
1821
1828
  containerHeight_: containerHeight_
1822
1829
  }), _el$5, _co$2);
1830
+ $9HbP8$effect(() => _el$.classList.toggle("placeholder", !display_()));
1823
1831
  $9HbP8$runHydrationEvents();
1824
1832
  return _el$;
1825
1833
  })();
@@ -1947,7 +1955,8 @@ function $3da8afe3ed57cf34$export$7da560f849543dff({
1947
1955
  title_: title_,
1948
1956
  max_rows_: max_rows_,
1949
1957
  view_more_button_: view_more_button_,
1950
- NoResultsFallback_: NoResultsFallback_
1958
+ NoResultsFallback_: NoResultsFallback_,
1959
+ placeholderCacheKey_: placeholderCacheKey_
1951
1960
  }) {
1952
1961
  const rows_object_ = $9HbP8$createMemo(() => {
1953
1962
  const view_more_button = view_more_button_?.();
@@ -2002,7 +2011,8 @@ function $3da8afe3ed57cf34$export$7da560f849543dff({
2002
2011
  get fallback() {
2003
2012
  return $6e41f1fde994db72$export$f33414a4df0afd3f({
2004
2013
  num_placeholders_: num_placeholders_,
2005
- product_card_template_: product_card_template_
2014
+ product_card_template_: product_card_template_,
2015
+ placeholderCacheKey_: placeholderCacheKey_
2006
2016
  });
2007
2017
  },
2008
2018
  get children() {
@@ -2035,6 +2045,7 @@ function $3da8afe3ed57cf34$export$7da560f849543dff({
2035
2045
  }
2036
2046
  var $07ef910e8ef6b783$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div style=--animation-duration:240ms>`);
2037
2047
  let $07ef910e8ef6b783$var$expandedLooksSignal_;
2048
+ const $07ef910e8ef6b783$var$placeholderCacheKey_ = /*@__PURE__*/Symbol("Looks");
2038
2049
  function $07ef910e8ef6b783$export$2c9f9bf2092486aa(props) {
2039
2050
  return $16b52438165aafe2$export$23fca46f3143581f(() => {
2040
2051
  $07ef910e8ef6b783$var$expandedLooksSignal_ ||= $9HbP8$createSignal(new Set(), {
@@ -2098,7 +2109,8 @@ function $07ef910e8ef6b783$export$2c9f9bf2092486aa(props) {
2098
2109
  cols_at_size: $b5cccc8ee7d24677$export$6daf8749b65a1b77(props.columnsAtSize_),
2099
2110
  ...grid_spacing_override()
2100
2111
  })),
2101
- NoResultsFallback_: () => props.NoResultsFallback_
2112
+ NoResultsFallback_: () => props.NoResultsFallback_,
2113
+ placeholderCacheKey_: $07ef910e8ef6b783$var$placeholderCacheKey_
2102
2114
  };
2103
2115
  $9HbP8$createEffect(() => {
2104
2116
  const {
@@ -15200,4 +15212,4 @@ function $442f32a4d80abbde$export$e2bf8ce7779e827e(props) {
15200
15212
  }, "Entire CategoryPage failed");
15201
15213
  }
15202
15214
  $9HbP8$add_to_version_info("ui", (0, $ec291e0010116877$export$83d89fbfd8236492));
15203
- export { $f091294da861020c$export$80bb7300ce6a8be3 as useProductCardIsVisible, $24e27fab9c821b86$export$5bad61ecde080b1f as useExpandingContainerReactive, $07ef910e8ef6b783$export$2c9f9bf2092486aa as LooksSliderOrGrid, $28ee4f7db3cc44b8$export$44809a8a3e867e30 as LookCard, $4fd2ba03703a7d92$export$7e1297a3a19f10d8 as PseudoRouter, $de6ccd37192b5fc2$export$83bb9af5671e1dbe as promiseSafeStructuredClone, $90980bd87c9960f9$export$5162a71f252e6122 as preserve_items_in_history_dot_state, $90980bd87c9960f9$export$3064e1e8c6513da3 as prefixes_to_preserve_in_history_dot_state, $a281666e5c15c2ec$export$29d28dadc2d6b631 as allowNativeNavigation, $66db7a014e20802e$export$1ea76ea778b880dd as modalVersionSymbol, $136f1d4d6c7ba6ac$export$e417c49320921907 as createDeparallelizedNoDropResource, $d8dbf52fea1773e2$export$f50b88e2a00918b5 as throw_globally, $42912431795f188e$export$9265e66f26f8e383 as ClassicSearchModal, $500a16dd18ee5a71$export$b0c55aa2e87c4be7 as SearchModalV2, $70bb27cc6be01fc7$export$9d4a4b669b1929ab as ModernResponsiveContainedImage, $024fbc0a2d796fad$export$3e41faf802a29e71 as Tab, $024fbc0a2d796fad$export$b2539bed5023c21c as Tabs, $8560c919ff763930$export$d4973c31938cbfd1 as ShopTheLookButton, $ca6f574bd8772184$export$e183a13865960371 as history_dot_state_to_state, $4147651646da990a$export$916e6850778505f6 as strip_encoded_filter_and_sort, $4147651646da990a$export$58aa3f171519b6d7 as encode_filters, $4147651646da990a$export$f934fa24c3a86811 as decode_filters, $4147651646da990a$export$62acb285a7579555 as encode_sorting, $4147651646da990a$export$766e9676e74997d3 as decode_sorting, $660070e2a394b3c3$export$d7b7ab832c20e2f4 as shopifyContainedImageContextSymbol, $011607bdf658f807$export$e68cff63f76bd15b as ListingProvider, $011607bdf658f807$export$8d0c4fdbb05a2f2e as useListing, $b6440e72ed83671a$export$11354f017ddc9790 as ProductCardIndexProvider, $b6440e72ed83671a$export$e3faf4d95300054f as useProductCardIndex, $660070e2a394b3c3$export$e4b984597b71e989 as ShopifyContainedImage, $f32e14878e75af51$export$6649caad96ef8870 as SlidableItems, $2449872a62a75a20$export$ebdc3711f7e02ccd as make_accurate_width_accessor, $ee116da074deb002$export$9574e176201e5e8d as RecommendationSlider, $9ea5383493360761$export$9756467d34d91cdb as RecommendationGrid, $e8ffe11ed01df0fe$export$6e5611bc7e57e477 as ShopifyResponsiveImg, $e8ffe11ed01df0fe$export$e6fffe67d4cdd848 as makeSizeAccessor, $f18d425032111270$export$94026ee33dbabc26 as ImageContainer, $b7436a6d1fd64e3b$export$b69d0d92862de18b as SentryErrorBoundary, $b7436a6d1fd64e3b$export$240ecf5363d76c0f as ExtraSentryContextProvider, $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d as ExpandingDetails, $c16e74cfe125bb05$export$f091cbac892643a4 as accessor_of_object_to_object_with_accessor_values, $1adfe60f3a14a1d7$export$fecbb157621501bd as SelectedFilters, $fab07f52c9861732$export$3f1a388cc0d8fed7 as FilterBody, $5efb5894079b220e$export$b288c38ae3fddb56 as create_modified_filters, $c8d5ff4524619fcd$export$d21e32dfedac04be as SolidLayout, $194bd6b8e4c59830$export$79b1565500412d9b as general_modal_abstraction, $19976a74d273070d$export$3b621d86b1566b2 as CrossIcon, $fbbadcb080ad1d4a$export$8be2714ec7f169ee as GenericSliderArrowButton, $a0f0e923bad68a9b$export$58e808b1db15d3bc as fetchDepictRecommendations, $e4615ecd1849548f$export$b91cec6bdc6b32a1 as CategoryTitle, $a6e23a834336fc19$export$824dde41348efed1 as embedded_num_products, $4b2134398dfa83fa$export$c1a6b039e689a58e as get_listings, $961b5c64bef4662f$export$f34314aa9505732e as DepictCategory, $806c97b931758897$export$ac6237957a15b3f0 as DepictSearch, $806c97b931758897$export$bde3eb976dfded9 as get_search_query_updating_blocked_signal, $806c97b931758897$export$f2dc7e4e4aa11abb as SearchPage, $4fd48cb976bf1789$export$aa14a9f43128f61f as ProductCardError, $6891c018a834cfdd$export$d86a33413558014e as open_modal_with_alignment, $bb15dfb548a7666e$export$ee1733d9a8495996 as DefaultInstantCardPlaceholder, $b6d5529b253681aa$export$b3ad617e9036868 as align_field, $b6d5529b253681aa$export$3f238c96c45e6cc6 as ALIGN_TOP, $b6d5529b253681aa$export$902f8b4a7dae5d78 as ALIGN_WIDTH_ON_MODAL, $b6d5529b253681aa$export$7895aadd1956b1c7 as ALIGN_LEFT, $b6d5529b253681aa$export$6060bc6bee850eb6 as SET_CENTERED_LEFT, $b5cccc8ee7d24677$export$6daf8749b65a1b77 as convert_sdk_cols_at_size_to_layout, $926b1b5ba2239356$export$1233ca167bf71f9a as styles_to_valid_css_string, $aea1edf92433e81e$export$fe334901e8bebd57 as disable_scrolling, $6e8944558258054f$export$d0596b5cae35ad4 as open_search_with_shift_slash, $7fa23e2a0079eca4$export$e015ed2f2950f2e3 as DepictAPI, $dc9262ef6f786812$export$d9f36cf74e24d595 as media_query_to_accessor, $6936724b9e0b98d5$export$689e204eadb33baf as setup_fast_leave, $bf52d9f9eebd1938$export$5196e4c01fa56fcb as show_toast, $8c0f86cb3e266eeb$export$a71e92cfbb498adc as SolidFormatPrice, $4ca91518c9a35379$export$828dcdd425fd3231 as connect_search_field_height_to_aligner_height, $d20eff0aadc28983$export$acb3eaade4b23afd as BasePlaceholder, $d134eae24341b4a1$export$89c6019e4baa40b1 as TextPlaceholder, $7f60f09116a3fe61$export$3f37af283f8fb843 as ImagePlaceholder, $753e9b2889a47c89$export$3ccaa27d81dd8556 as PageReplacer, $4690a06c8489dcd0$export$864d304a0bc46829 as defaultGridSpacing, $4690a06c8489dcd0$export$c3834fa86c616831 as defaultColsAtSize, $4690a06c8489dcd0$export$7bf543b9d9be2c22 as defaultCategoryTitlePlugin, $ec291e0010116877$export$83d89fbfd8236492 as version, $58b3487626e85ece$export$316f6f283ae64765 as SearchField, $feffae76d8dc0135$export$5b7c3ce0ebe51f86 as BreadCrumbs, $feffae76d8dc0135$export$de035477d6fef996 as QuickLinks, $442f32a4d80abbde$export$e2bf8ce7779e827e as CategoryPage };
15215
+ export { $f091294da861020c$export$80bb7300ce6a8be3 as useProductCardIsVisible, $f091294da861020c$export$f223d69ed12f5fb7 as CurrentlyIntersectingContext, $24e27fab9c821b86$export$5bad61ecde080b1f as useExpandingContainerReactive, $07ef910e8ef6b783$export$2c9f9bf2092486aa as LooksSliderOrGrid, $28ee4f7db3cc44b8$export$44809a8a3e867e30 as LookCard, $4fd2ba03703a7d92$export$7e1297a3a19f10d8 as PseudoRouter, $de6ccd37192b5fc2$export$83bb9af5671e1dbe as promiseSafeStructuredClone, $90980bd87c9960f9$export$5162a71f252e6122 as preserve_items_in_history_dot_state, $90980bd87c9960f9$export$3064e1e8c6513da3 as prefixes_to_preserve_in_history_dot_state, $a281666e5c15c2ec$export$29d28dadc2d6b631 as allowNativeNavigation, $66db7a014e20802e$export$1ea76ea778b880dd as modalVersionSymbol, $136f1d4d6c7ba6ac$export$e417c49320921907 as createDeparallelizedNoDropResource, $d8dbf52fea1773e2$export$f50b88e2a00918b5 as throw_globally, $42912431795f188e$export$9265e66f26f8e383 as ClassicSearchModal, $500a16dd18ee5a71$export$b0c55aa2e87c4be7 as SearchModalV2, $70bb27cc6be01fc7$export$9d4a4b669b1929ab as ModernResponsiveContainedImage, $024fbc0a2d796fad$export$3e41faf802a29e71 as Tab, $024fbc0a2d796fad$export$b2539bed5023c21c as Tabs, $8560c919ff763930$export$d4973c31938cbfd1 as ShopTheLookButton, $ca6f574bd8772184$export$e183a13865960371 as history_dot_state_to_state, $4147651646da990a$export$916e6850778505f6 as strip_encoded_filter_and_sort, $4147651646da990a$export$58aa3f171519b6d7 as encode_filters, $4147651646da990a$export$f934fa24c3a86811 as decode_filters, $4147651646da990a$export$62acb285a7579555 as encode_sorting, $4147651646da990a$export$766e9676e74997d3 as decode_sorting, $660070e2a394b3c3$export$d7b7ab832c20e2f4 as shopifyContainedImageContextSymbol, $011607bdf658f807$export$e68cff63f76bd15b as ListingProvider, $011607bdf658f807$export$8d0c4fdbb05a2f2e as useListing, $b6440e72ed83671a$export$11354f017ddc9790 as ProductCardIndexProvider, $b6440e72ed83671a$export$e3faf4d95300054f as useProductCardIndex, $660070e2a394b3c3$export$e4b984597b71e989 as ShopifyContainedImage, $f32e14878e75af51$export$6649caad96ef8870 as SlidableItems, $2449872a62a75a20$export$ebdc3711f7e02ccd as make_accurate_width_accessor, $ee116da074deb002$export$9574e176201e5e8d as RecommendationSlider, $9ea5383493360761$export$9756467d34d91cdb as RecommendationGrid, $e8ffe11ed01df0fe$export$6e5611bc7e57e477 as ShopifyResponsiveImg, $e8ffe11ed01df0fe$export$e6fffe67d4cdd848 as makeSizeAccessor, $f18d425032111270$export$94026ee33dbabc26 as ImageContainer, $b7436a6d1fd64e3b$export$b69d0d92862de18b as SentryErrorBoundary, $b7436a6d1fd64e3b$export$240ecf5363d76c0f as ExtraSentryContextProvider, $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d as ExpandingDetails, $c16e74cfe125bb05$export$f091cbac892643a4 as accessor_of_object_to_object_with_accessor_values, $1adfe60f3a14a1d7$export$fecbb157621501bd as SelectedFilters, $fab07f52c9861732$export$3f1a388cc0d8fed7 as FilterBody, $5efb5894079b220e$export$b288c38ae3fddb56 as create_modified_filters, $c8d5ff4524619fcd$export$d21e32dfedac04be as SolidLayout, $194bd6b8e4c59830$export$79b1565500412d9b as general_modal_abstraction, $19976a74d273070d$export$3b621d86b1566b2 as CrossIcon, $fbbadcb080ad1d4a$export$8be2714ec7f169ee as GenericSliderArrowButton, $a0f0e923bad68a9b$export$58e808b1db15d3bc as fetchDepictRecommendations, $e4615ecd1849548f$export$b91cec6bdc6b32a1 as CategoryTitle, $a6e23a834336fc19$export$824dde41348efed1 as embedded_num_products, $4b2134398dfa83fa$export$c1a6b039e689a58e as get_listings, $961b5c64bef4662f$export$f34314aa9505732e as DepictCategory, $806c97b931758897$export$ac6237957a15b3f0 as DepictSearch, $806c97b931758897$export$bde3eb976dfded9 as get_search_query_updating_blocked_signal, $806c97b931758897$export$f2dc7e4e4aa11abb as SearchPage, $4fd48cb976bf1789$export$aa14a9f43128f61f as ProductCardError, $6891c018a834cfdd$export$d86a33413558014e as open_modal_with_alignment, $bb15dfb548a7666e$export$ee1733d9a8495996 as DefaultInstantCardPlaceholder, $b6d5529b253681aa$export$b3ad617e9036868 as align_field, $b6d5529b253681aa$export$3f238c96c45e6cc6 as ALIGN_TOP, $b6d5529b253681aa$export$902f8b4a7dae5d78 as ALIGN_WIDTH_ON_MODAL, $b6d5529b253681aa$export$7895aadd1956b1c7 as ALIGN_LEFT, $b6d5529b253681aa$export$6060bc6bee850eb6 as SET_CENTERED_LEFT, $b5cccc8ee7d24677$export$6daf8749b65a1b77 as convert_sdk_cols_at_size_to_layout, $926b1b5ba2239356$export$1233ca167bf71f9a as styles_to_valid_css_string, $aea1edf92433e81e$export$fe334901e8bebd57 as disable_scrolling, $6e8944558258054f$export$d0596b5cae35ad4 as open_search_with_shift_slash, $7fa23e2a0079eca4$export$e015ed2f2950f2e3 as DepictAPI, $dc9262ef6f786812$export$d9f36cf74e24d595 as media_query_to_accessor, $6936724b9e0b98d5$export$689e204eadb33baf as setup_fast_leave, $bf52d9f9eebd1938$export$5196e4c01fa56fcb as show_toast, $8c0f86cb3e266eeb$export$a71e92cfbb498adc as SolidFormatPrice, $4ca91518c9a35379$export$828dcdd425fd3231 as connect_search_field_height_to_aligner_height, $d20eff0aadc28983$export$acb3eaade4b23afd as BasePlaceholder, $d134eae24341b4a1$export$89c6019e4baa40b1 as TextPlaceholder, $7f60f09116a3fe61$export$3f37af283f8fb843 as ImagePlaceholder, $753e9b2889a47c89$export$3ccaa27d81dd8556 as PageReplacer, $4690a06c8489dcd0$export$864d304a0bc46829 as defaultGridSpacing, $4690a06c8489dcd0$export$c3834fa86c616831 as defaultColsAtSize, $4690a06c8489dcd0$export$7bf543b9d9be2c22 as defaultCategoryTitlePlugin, $ec291e0010116877$export$83d89fbfd8236492 as version, $58b3487626e85ece$export$316f6f283ae64765 as SearchField, $feffae76d8dc0135$export$5b7c3ce0ebe51f86 as BreadCrumbs, $feffae76d8dc0135$export$de035477d6fef996 as QuickLinks, $442f32a4d80abbde$export$e2bf8ce7779e827e as CategoryPage };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "4.7.18",
3
+ "version": "4.7.20",
4
4
  "description": "Base package containing the actual UI of Depict UI along with translations, with a not-simplified API. We recommend using @depict-ai/js-ui or @depict-ai/react-ui instead.",
5
5
  "packageManager": "yarn@3.2.2",
6
6
  "sass": "styles.scss",