@depict-ai/ui 4.3.10 → 4.3.12

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 CHANGED
@@ -100,7 +100,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
100
100
  $parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
101
101
  $parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
102
102
  /*! Depict.ai search and product listing SDK */
103
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.3.10";
103
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.3.12";
104
104
  const $5401a6698b0c0658$var$transform_elements = sorted_cols_at_size => {
105
105
  const cols_at_size = [];
106
106
  for (let i = 0; i < sorted_cols_at_size.length; i++) {
@@ -776,7 +776,8 @@ function $236a257ee52e5414$export$d41d19e89346fa2(_ref) {
776
776
  recommendations_resource_: recommendations_resource_,
777
777
  product_card_template_: product_card_template_,
778
778
  layout_options_: layout_options_,
779
- title_: title_
779
+ title_: title_,
780
+ NoResultsFallback_: NoResultsFallback_
780
781
  } = _ref;
781
782
  const is_showing_something = $52FdA$solidjs.createMemo(() => {
782
783
  var _recommendations_reso;
@@ -837,6 +838,9 @@ function $236a257ee52e5414$export$d41d19e89346fa2(_ref) {
837
838
  get when() {
838
839
  return is_showing_something();
839
840
  },
841
+ get fallback() {
842
+ return NoResultsFallback_ === null || NoResultsFallback_ === void 0 ? void 0 : NoResultsFallback_();
843
+ },
840
844
  children: slider
841
845
  });
842
846
  }
@@ -1393,6 +1397,10 @@ function $d66c35b5a6d6d926$export$b73ed90f0ee50dc3(_ref) {
1393
1397
  return (_variantToUse4 = variantToUse()) === null || _variantToUse4 === void 0 ? void 0 : _variantToUse4.page_url;
1394
1398
  });
1395
1399
  const FavoriteButton = FavoriteButton_; // Just to get rid of the type error - TS doesn't understand <Show>
1400
+ const title = $52FdA$solidjs.createMemo(() => {
1401
+ var _variantToUse5;
1402
+ return (_variantToUse5 = variantToUse()) === null || _variantToUse5 === void 0 ? void 0 : _variantToUse5.title;
1403
+ });
1396
1404
  return (() => {
1397
1405
  var _el$ = $52FdA$solidjsweb.getNextElement($d66c35b5a6d6d926$var$_tmpl$4),
1398
1406
  _el$12 = _el$.firstChild,
@@ -1503,9 +1511,12 @@ function $d66c35b5a6d6d926$export$b73ed90f0ee50dc3(_ref) {
1503
1511
  disconnector();
1504
1512
  }));
1505
1513
  }, _el$3);
1514
+ $52FdA$solidjsweb.spread(_el$5, $52FdA$solidjsweb.mergeProps(() => title() && {
1515
+ title: title()
1516
+ }), false, true);
1506
1517
  $52FdA$solidjsweb.insert(_el$5, () => {
1507
- var _variantToUse$title, _variantToUse5;
1508
- return (_variantToUse$title = (_variantToUse5 = variantToUse()) === null || _variantToUse5 === void 0 ? void 0 : _variantToUse5.title) !== null && _variantToUse$title !== void 0 ? _variantToUse$title : $52FdA$solidjsweb.createComponent((0, $a7f7d416e6f61504$export$89c6019e4baa40b1), {
1518
+ var _title;
1519
+ return (_title = title()) !== null && _title !== void 0 ? _title : $52FdA$solidjsweb.createComponent((0, $a7f7d416e6f61504$export$89c6019e4baa40b1), {
1509
1520
  height: "1em",
1510
1521
  width: "20ch"
1511
1522
  });
@@ -1584,6 +1595,7 @@ function $d66c35b5a6d6d926$export$b73ed90f0ee50dc3(_ref) {
1584
1595
  }
1585
1596
  }), _el$11, _co$2);
1586
1597
  $52FdA$solidjsweb.effect(() => _el$6.classList.toggle("sale", !!isOnSale()));
1598
+ $52FdA$solidjsweb.runHydrationEvents();
1587
1599
  return _el$3;
1588
1600
  }
1589
1601
  }), _el$15, _co$4);
@@ -1964,7 +1976,8 @@ function $2c920813c92d6987$export$7da560f849543dff(_ref) {
1964
1976
  layout_options_: layout_options_,
1965
1977
  title_: title_,
1966
1978
  max_rows_: max_rows_,
1967
- view_more_button_: view_more_button_
1979
+ view_more_button_: view_more_button_,
1980
+ NoResultsFallback_: NoResultsFallback_
1968
1981
  } = _ref;
1969
1982
  const rows_object_ = $52FdA$solidjs.createMemo(() => {
1970
1983
  var _view_more_button$row;
@@ -2045,6 +2058,9 @@ function $2c920813c92d6987$export$7da560f849543dff(_ref) {
2045
2058
  get when() {
2046
2059
  return is_showing_something();
2047
2060
  },
2061
+ get fallback() {
2062
+ return NoResultsFallback_ === null || NoResultsFallback_ === void 0 ? void 0 : NoResultsFallback_();
2063
+ },
2048
2064
  children: elements
2049
2065
  });
2050
2066
  }
@@ -2114,7 +2130,8 @@ function $e57cd46536ad992e$export$2c9f9bf2092486aa(props) {
2114
2130
  layout_options_: $52FdA$solidjs.createMemo(() => ({
2115
2131
  cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(props.columnsAtSize_),
2116
2132
  ...grid_spacing_override()
2117
- }))
2133
+ })),
2134
+ NoResultsFallback_: () => props.NoResultsFallback_
2118
2135
  };
2119
2136
  $52FdA$solidjs.createEffect(() => {
2120
2137
  const {
@@ -7485,44 +7502,20 @@ function $ac040bdfeed58ee4$export$e5c2828934226505(_ref) {
7485
7502
  expanded_: expanded_,
7486
7503
  i18n_: i18n_
7487
7504
  } = _ref;
7488
- let first_span;
7489
- let second_span;
7490
- const animation_options = {
7491
- fill: "forwards",
7492
- duration: 200
7493
- };
7494
- const outer_div = (() => {
7495
- var _el$ = $52FdA$solidjsweb.getNextElement($ac040bdfeed58ee4$var$_tmpl$),
7496
- _el$2 = _el$.firstChild,
7497
- _el$3 = _el$2.nextSibling;
7498
- var _ref$ = first_span;
7499
- typeof _ref$ === "function" ? $52FdA$solidjsweb.use(_ref$, _el$2) : first_span = _el$2;
7500
- var _ref$2 = second_span;
7501
- typeof _ref$2 === "function" ? $52FdA$solidjsweb.use(_ref$2, _el$3) : second_span = _el$3;
7502
- $52FdA$solidjsweb.effect(() => $52FdA$solidjsweb.setAttribute(_el$, "aria-label", expanded_() ? i18n_.morphing_sign_expanded_aria_label_() : i18n_.morphing_sign_collapsed_aria_label_()));
7505
+ return (() => {
7506
+ var _el$ = $52FdA$solidjsweb.getNextElement($ac040bdfeed58ee4$var$_tmpl$);
7507
+ $52FdA$solidjsweb.effect(_p$ => {
7508
+ var _v$ = !!expanded_(),
7509
+ _v$2 = expanded_() ? i18n_.morphing_sign_expanded_aria_label_() : i18n_.morphing_sign_collapsed_aria_label_();
7510
+ _v$ !== _p$.e && _el$.classList.toggle("expanded", _p$.e = _v$);
7511
+ _v$2 !== _p$.t && $52FdA$solidjsweb.setAttribute(_el$, "aria-label", _p$.t = _v$2);
7512
+ return _p$;
7513
+ }, {
7514
+ e: undefined,
7515
+ t: undefined
7516
+ });
7503
7517
  return _el$;
7504
7518
  })();
7505
- const [is_in_dom, set_is_in_dom] = $52FdA$solidjs.createSignal(false);
7506
- (0, $52FdA$depictaiutilishared.observer).wait_for_element(outer_div).then($52FdA$depictaiutilishared.catchify(() => set_is_in_dom(true)));
7507
- $52FdA$solidjs.createEffect(() => {
7508
- if (!is_in_dom())
7509
- // wait for us to being in DOM as animations don't work otherwise
7510
- return;
7511
- try {
7512
- const expanded = expanded_();
7513
- for (const span of [first_span, second_span]) span.animate([{
7514
- transform: "rotate(".concat(expanded ? 90 : "0", "deg)")
7515
- }], animation_options);
7516
- const percentage_value = "".concat(expanded ? 50 : 25, "%");
7517
- second_span.animate([{
7518
- left: percentage_value,
7519
- right: percentage_value
7520
- }], animation_options);
7521
- } catch (e) {
7522
- $52FdA$depictaiutilishared.dlog("partial keyframes probably not supported", e);
7523
- }
7524
- });
7525
- return outer_div;
7526
7519
  }
7527
7520
  var $99472afa7112c427$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<span class=highlighted-part>`);
7528
7521
  const $99472afa7112c427$var$dont_cut_in_between_less_than_characters = 30;
@@ -13283,7 +13276,7 @@ function $bf4a8d57aa8dd1c8$export$9ff751cd77687edc(_ref) {
13283
13276
  let {
13284
13277
  search_results_: search_results_,
13285
13278
  router_: router_,
13286
- queries_without_content_results_: queries_without_content_results_,
13279
+ setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
13287
13280
  get_search_query_: get_search_query_
13288
13281
  } = _ref;
13289
13282
  const content_results = $52FdA$solidjs.createMemo(() => {
@@ -13302,7 +13295,11 @@ function $bf4a8d57aa8dd1c8$export$9ff751cd77687edc(_ref) {
13302
13295
  });
13303
13296
  $52FdA$solidjs.createEffect(() => {
13304
13297
  const results = content_results();
13305
- if (Array.isArray(results) && results.length === 0) queries_without_content_results_.add($52FdA$solidjs.untrack(get_search_query_));
13298
+ const numberResults = Array.isArray(results) ? results.length : 0;
13299
+ setNumberContentResultsPerQuery_(prev => {
13300
+ prev.set($52FdA$solidjs.untrack(get_search_query_), numberResults);
13301
+ return prev;
13302
+ });
13306
13303
  });
13307
13304
  return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.For), {
13308
13305
  get each() {
@@ -13320,7 +13317,8 @@ function $bf4a8d57aa8dd1c8$export$9ff751cd77687edc(_ref) {
13320
13317
  function $05f255c0a94b9ca1$export$4405d077f0a20494(_ref) {
13321
13318
  let {
13322
13319
  content_results_rows_: [get_history_state_content_results_rows],
13323
- cols_at_size_: cols_at_size_
13320
+ cols_at_size_: cols_at_size_,
13321
+ overrideAmount_: overrideAmount_
13324
13322
  } = _ref;
13325
13323
  const colsShowingNow = $478e5a09664da64c$export$a79e666719b3647c(cols_at_size_);
13326
13324
  const largest_column = $52FdA$solidjs.createMemo(() => {
@@ -13333,10 +13331,10 @@ function $05f255c0a94b9ca1$export$4405d077f0a20494(_ref) {
13333
13331
  });
13334
13332
  const num_placeholders = $52FdA$solidjs.createMemo(() => {
13335
13333
  var _get_history_state_co;
13336
- return (
13337
- // Use how many columns we're actually showing, if available, so that we're showing exactly as many placeholders as we'd show content, so that the view more button doesn't appear/disappear and makes the layout shift
13338
- ((_get_history_state_co = get_history_state_content_results_rows()) !== null && _get_history_state_co !== void 0 ? _get_history_state_co : (0, $eab939d0b95b75ee$export$70ceae36059a1036)) * (colsShowingNow() || largest_column())
13339
- );
13334
+ const override = overrideAmount_();
13335
+ if (override !== undefined) return override;
13336
+ // Use how many columns we're actually showing, if available, so that we're showing exactly as many placeholders as we'd show content, so that the view more button doesn't appear/disappear and makes the layout shift
13337
+ return ((_get_history_state_co = get_history_state_content_results_rows()) !== null && _get_history_state_co !== void 0 ? _get_history_state_co : (0, $eab939d0b95b75ee$export$70ceae36059a1036)) * (colsShowingNow() || largest_column());
13340
13338
  });
13341
13339
  return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Index), {
13342
13340
  get each() {
@@ -13374,15 +13372,13 @@ function $eab939d0b95b75ee$export$6d0c9c22f6652669(_ref) {
13374
13372
  number_: num_results,
13375
13373
  i18n_: i18n_
13376
13374
  });
13377
- const queries_without_content_results_ = new (0, $52FdA$depictaiutilishared.ListenableSet)();
13378
- const [check_query, set_check_query] = $52FdA$solidjs.createSignal(false);
13379
- const placeholders_enabled = $52FdA$solidjs.createMemo(() => {
13380
- // don't show placeholders when the user toggles filters
13381
- check_query();
13382
- return !queries_without_content_results_.has(get_search_query_());
13375
+ const [numberContentResultsPerQuery, setNumberContentResultsPerQuery_] = $52FdA$solidjs.createSignal(new Map(), {
13376
+ equals: false
13383
13377
  });
13378
+ const contentResultsForCurrentQuery = $52FdA$solidjs.createMemo(() => numberContentResultsPerQuery().get(get_search_query_()));
13379
+ // Don't show placeholder if we know there will not be any content results and someone is just toggling filters
13380
+ const placeholders_enabled = $52FdA$solidjs.createMemo(() => contentResultsForCurrentQuery() !== 0);
13384
13381
  const rows_object = $eab939d0b95b75ee$var$make_state_saved_rows(content_results_rows_, i18n_);
13385
- for (const ev of ["add", "delete"]) queries_without_content_results_.addEventListener(ev, () => set_check_query(prev => !prev));
13386
13382
  return (() => {
13387
13383
  var _el$ = $52FdA$solidjsweb.getNextElement($eab939d0b95b75ee$var$_tmpl$),
13388
13384
  _el$2 = _el$.firstChild,
@@ -13412,14 +13408,15 @@ function $eab939d0b95b75ee$export$6d0c9c22f6652669(_ref) {
13412
13408
  content_results_rows_: content_results_rows_,
13413
13409
  get cols_at_size_() {
13414
13410
  return $52FdA$solidjs.createMemo(() => layout_options_().cols_at_size);
13415
- }
13411
+ },
13412
+ overrideAmount_: contentResultsForCurrentQuery
13416
13413
  });
13417
13414
  },
13418
13415
  get children() {
13419
13416
  return $52FdA$solidjsweb.createComponent((0, $bf4a8d57aa8dd1c8$export$9ff751cd77687edc), {
13420
13417
  router_: router_,
13421
13418
  search_results_: search_results_,
13422
- queries_without_content_results_: queries_without_content_results_,
13419
+ setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
13423
13420
  get_search_query_: get_search_query_
13424
13421
  });
13425
13422
  }
package/ES10/index.d.ts CHANGED
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
10
10
  import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
11
11
  import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
12
12
  import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
13
- export const version = "4.3.10";
13
+ export const version = "4.3.12";
14
14
  declare const LISTING_ID = "listingId";
15
15
  declare const EXTERNAL_ID = "externalId";
16
16
  type ScrollRestorationData = {
@@ -877,6 +877,7 @@ export function LooksSliderOrGrid(props: {
877
877
  FavoriteButton_?: (props: {
878
878
  display_: Accessor<ModernDisplay | null | undefined>;
879
879
  }) => JSX.Element;
880
+ NoResultsFallback_?: () => JSX.Element;
880
881
  displayTransformers_?: DisplayTransformers<ModernDisplay, ModernDisplayWithPageUrl<ModernDisplay>>;
881
882
  /**
882
883
  * If provided, will render as grid instead of slider
@@ -1398,7 +1399,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
1398
1399
  * Open the modal with support for alignment.
1399
1400
  * @returns {void}
1400
1401
  */
1401
- export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1402
+ export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1402
1403
  export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
1403
1404
  export interface PageReplacer {
1404
1405
  readonly render_: () => Node_Array;
@@ -1476,5 +1477,5 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
1476
1477
  content_blocks_by_row?: ContentBlocksByRow;
1477
1478
  layout?: PossibleLayout;
1478
1479
  filterModalParent_?: HTMLElement | ShadowRoot;
1479
- }): import("@depict-ai/utilishared").Node_Array;
1480
+ }): import("@depict-ai/utilishared/latest").Node_Array;
1480
1481
  export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";
package/ES10/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { add_to_version_info as $8tj43$add_to_version_info, fetch_retry as $8tj43$fetch_retry, base_url as $8tj43$base_url, dwarn as $8tj43$dwarn, slider_fractional_factory as $8tj43$slider_fractional_factory, dlog as $8tj43$dlog, camelCasifyObject as $8tj43$camelCasifyObject, make_random_classname as $8tj43$make_random_classname, n_col_styling_with_dist as $8tj43$n_col_styling_with_dist, catchify as $8tj43$catchify, layout_get_visible_recs_without_partial_rows as $8tj43$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $8tj43$layout_get_total_rec_amount_for_row, layout_media_query_header as $8tj43$layout_media_query_header, report as $8tj43$report, slider_fading_factory as $8tj43$slider_fading_factory, Amazing_Slider as $8tj43$Amazing_Slider, slider_snap_css as $8tj43$slider_snap_css, observer as $8tj43$observer, javascript_media_query as $8tj43$javascript_media_query, queueMacroTask as $8tj43$queueMacroTask, findMostFrequentItem as $8tj43$findMostFrequentItem, standard_price_format as $8tj43$standard_price_format, instant_exec_on_suspect_history_change as $8tj43$instant_exec_on_suspect_history_change, deparallelize_no_drop as $8tj43$deparallelize_no_drop, ContainedImage as $8tj43$ContainedImage, buildThresholdList as $8tj43$buildThresholdList, make_asyncIterable_exiter as $8tj43$make_asyncIterable_exiter, href_change_ipns as $8tj43$href_change_ipns, base64_encode_unicode as $8tj43$base64_encode_unicode, base64_decode_unicode as $8tj43$base64_decode_unicode, use_href_accessor as $8tj43$use_href_accessor, get_session_id as $8tj43$get_session_id, add_version_query_params as $8tj43$add_version_query_params, useExpandingContainer as $8tj43$useExpandingContainer, hex_to_rgb as $8tj43$hex_to_rgb, relative_luminance_from_rgb as $8tj43$relative_luminance_from_rgb, snakeCasifyObject as $8tj43$snakeCasifyObject, make_url_with_query_params as $8tj43$make_url_with_query_params, sort_obj as $8tj43$sort_obj, ListenableSet as $8tj43$ListenableSet1, insert_surfaces as $8tj43$insert_surfaces, is_debug as $8tj43$is_debug } from "@depict-ai/utilishared/ES10";
1
+ import { add_to_version_info as $8tj43$add_to_version_info, fetch_retry as $8tj43$fetch_retry, base_url as $8tj43$base_url, dwarn as $8tj43$dwarn, slider_fractional_factory as $8tj43$slider_fractional_factory, dlog as $8tj43$dlog, camelCasifyObject as $8tj43$camelCasifyObject, make_random_classname as $8tj43$make_random_classname, n_col_styling_with_dist as $8tj43$n_col_styling_with_dist, catchify as $8tj43$catchify, layout_get_visible_recs_without_partial_rows as $8tj43$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $8tj43$layout_get_total_rec_amount_for_row, layout_media_query_header as $8tj43$layout_media_query_header, report as $8tj43$report, slider_fading_factory as $8tj43$slider_fading_factory, Amazing_Slider as $8tj43$Amazing_Slider, slider_snap_css as $8tj43$slider_snap_css, observer as $8tj43$observer, javascript_media_query as $8tj43$javascript_media_query, queueMacroTask as $8tj43$queueMacroTask, findMostFrequentItem as $8tj43$findMostFrequentItem, standard_price_format as $8tj43$standard_price_format, instant_exec_on_suspect_history_change as $8tj43$instant_exec_on_suspect_history_change, deparallelize_no_drop as $8tj43$deparallelize_no_drop, ContainedImage as $8tj43$ContainedImage, buildThresholdList as $8tj43$buildThresholdList, make_asyncIterable_exiter as $8tj43$make_asyncIterable_exiter, href_change_ipns as $8tj43$href_change_ipns, base64_encode_unicode as $8tj43$base64_encode_unicode, base64_decode_unicode as $8tj43$base64_decode_unicode, use_href_accessor as $8tj43$use_href_accessor, get_session_id as $8tj43$get_session_id, add_version_query_params as $8tj43$add_version_query_params, useExpandingContainer as $8tj43$useExpandingContainer, hex_to_rgb as $8tj43$hex_to_rgb, relative_luminance_from_rgb as $8tj43$relative_luminance_from_rgb, snakeCasifyObject as $8tj43$snakeCasifyObject, make_url_with_query_params as $8tj43$make_url_with_query_params, sort_obj as $8tj43$sort_obj, insert_surfaces as $8tj43$insert_surfaces, is_debug as $8tj43$is_debug } from "@depict-ai/utilishared/ES10";
2
2
  import { template as $8tj43$template, getNextElement as $8tj43$getNextElement, insert as $8tj43$insert, createComponent as $8tj43$createComponent, mergeProps as $8tj43$mergeProps, effect as $8tj43$effect, className as $8tj43$className, isServer as $8tj43$isServer, spread as $8tj43$spread, runHydrationEvents as $8tj43$runHydrationEvents, addEventListener as $8tj43$addEventListener, memo as $8tj43$memo, delegateEvents as $8tj43$delegateEvents, getNextMarker as $8tj43$getNextMarker, classList as $8tj43$classList, setAttribute as $8tj43$setAttribute, style as $8tj43$style, use as $8tj43$use, setProperty as $8tj43$setProperty, Dynamic as $8tj43$Dynamic } from "solid-js/web";
3
3
  import { createSignal as $8tj43$createSignal, createMemo as $8tj43$createMemo, createResource as $8tj43$createResource, createEffect as $8tj43$createEffect, Show as $8tj43$Show, mergeProps as $8tj43$mergeProps1, Suspense as $8tj43$Suspense, untrack as $8tj43$untrack, createRenderEffect as $8tj43$createRenderEffect, Index as $8tj43$Index, createRoot as $8tj43$createRoot, onCleanup as $8tj43$onCleanup, For as $8tj43$For, getOwner as $8tj43$getOwner, runWithOwner as $8tj43$runWithOwner, createContext as $8tj43$createContext, useContext as $8tj43$useContext, createUniqueId as $8tj43$createUniqueId, createComputed as $8tj43$createComputed, ErrorBoundary as $8tj43$ErrorBoundary, splitProps as $8tj43$splitProps, on as $8tj43$on, batch as $8tj43$batch, createSelector as $8tj43$createSelector, children as $8tj43$children, createReaction as $8tj43$createReaction, mapArray as $8tj43$mapArray } from "solid-js";
4
4
  import $8tj43$babelruntimehelpersdefineProperty from "@babel/runtime/helpers/defineProperty";
@@ -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.3.10";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "4.3.12";
14
14
  const $a9c7ba6087881ac2$var$transform_elements = sorted_cols_at_size => {
15
15
  const cols_at_size = [];
16
16
  for (let i = 0; i < sorted_cols_at_size.length; i++) {
@@ -686,7 +686,8 @@ function $39ddb986053fb759$export$d41d19e89346fa2(_ref) {
686
686
  recommendations_resource_: recommendations_resource_,
687
687
  product_card_template_: product_card_template_,
688
688
  layout_options_: layout_options_,
689
- title_: title_
689
+ title_: title_,
690
+ NoResultsFallback_: NoResultsFallback_
690
691
  } = _ref;
691
692
  const is_showing_something = $8tj43$createMemo(() => {
692
693
  var _recommendations_reso;
@@ -747,6 +748,9 @@ function $39ddb986053fb759$export$d41d19e89346fa2(_ref) {
747
748
  get when() {
748
749
  return is_showing_something();
749
750
  },
751
+ get fallback() {
752
+ return NoResultsFallback_ === null || NoResultsFallback_ === void 0 ? void 0 : NoResultsFallback_();
753
+ },
750
754
  children: slider
751
755
  });
752
756
  }
@@ -1303,6 +1307,10 @@ function $0c5b1686f971e5e7$export$b73ed90f0ee50dc3(_ref) {
1303
1307
  return (_variantToUse4 = variantToUse()) === null || _variantToUse4 === void 0 ? void 0 : _variantToUse4.page_url;
1304
1308
  });
1305
1309
  const FavoriteButton = FavoriteButton_; // Just to get rid of the type error - TS doesn't understand <Show>
1310
+ const title = $8tj43$createMemo(() => {
1311
+ var _variantToUse5;
1312
+ return (_variantToUse5 = variantToUse()) === null || _variantToUse5 === void 0 ? void 0 : _variantToUse5.title;
1313
+ });
1306
1314
  return (() => {
1307
1315
  var _el$ = $8tj43$getNextElement($0c5b1686f971e5e7$var$_tmpl$4),
1308
1316
  _el$12 = _el$.firstChild,
@@ -1413,9 +1421,12 @@ function $0c5b1686f971e5e7$export$b73ed90f0ee50dc3(_ref) {
1413
1421
  disconnector();
1414
1422
  }));
1415
1423
  }, _el$3);
1424
+ $8tj43$spread(_el$5, $8tj43$mergeProps(() => title() && {
1425
+ title: title()
1426
+ }), false, true);
1416
1427
  $8tj43$insert(_el$5, () => {
1417
- var _variantToUse$title, _variantToUse5;
1418
- return (_variantToUse$title = (_variantToUse5 = variantToUse()) === null || _variantToUse5 === void 0 ? void 0 : _variantToUse5.title) !== null && _variantToUse$title !== void 0 ? _variantToUse$title : $8tj43$createComponent((0, $ceafb6fb91c6f394$export$89c6019e4baa40b1), {
1428
+ var _title;
1429
+ return (_title = title()) !== null && _title !== void 0 ? _title : $8tj43$createComponent((0, $ceafb6fb91c6f394$export$89c6019e4baa40b1), {
1419
1430
  height: "1em",
1420
1431
  width: "20ch"
1421
1432
  });
@@ -1494,6 +1505,7 @@ function $0c5b1686f971e5e7$export$b73ed90f0ee50dc3(_ref) {
1494
1505
  }
1495
1506
  }), _el$11, _co$2);
1496
1507
  $8tj43$effect(() => _el$6.classList.toggle("sale", !!isOnSale()));
1508
+ $8tj43$runHydrationEvents();
1497
1509
  return _el$3;
1498
1510
  }
1499
1511
  }), _el$15, _co$4);
@@ -1874,7 +1886,8 @@ function $e3efeb558d952696$export$7da560f849543dff(_ref) {
1874
1886
  layout_options_: layout_options_,
1875
1887
  title_: title_,
1876
1888
  max_rows_: max_rows_,
1877
- view_more_button_: view_more_button_
1889
+ view_more_button_: view_more_button_,
1890
+ NoResultsFallback_: NoResultsFallback_
1878
1891
  } = _ref;
1879
1892
  const rows_object_ = $8tj43$createMemo(() => {
1880
1893
  var _view_more_button$row;
@@ -1955,6 +1968,9 @@ function $e3efeb558d952696$export$7da560f849543dff(_ref) {
1955
1968
  get when() {
1956
1969
  return is_showing_something();
1957
1970
  },
1971
+ get fallback() {
1972
+ return NoResultsFallback_ === null || NoResultsFallback_ === void 0 ? void 0 : NoResultsFallback_();
1973
+ },
1958
1974
  children: elements
1959
1975
  });
1960
1976
  }
@@ -2024,7 +2040,8 @@ function $bb34cd283e904784$export$2c9f9bf2092486aa(props) {
2024
2040
  layout_options_: $8tj43$createMemo(() => ({
2025
2041
  cols_at_size: $a9c7ba6087881ac2$export$6daf8749b65a1b77(props.columnsAtSize_),
2026
2042
  ...grid_spacing_override()
2027
- }))
2043
+ })),
2044
+ NoResultsFallback_: () => props.NoResultsFallback_
2028
2045
  };
2029
2046
  $8tj43$createEffect(() => {
2030
2047
  const {
@@ -7395,44 +7412,20 @@ function $457279ff15864cb9$export$e5c2828934226505(_ref) {
7395
7412
  expanded_: expanded_,
7396
7413
  i18n_: i18n_
7397
7414
  } = _ref;
7398
- let first_span;
7399
- let second_span;
7400
- const animation_options = {
7401
- fill: "forwards",
7402
- duration: 200
7403
- };
7404
- const outer_div = (() => {
7405
- var _el$ = $8tj43$getNextElement($457279ff15864cb9$var$_tmpl$),
7406
- _el$2 = _el$.firstChild,
7407
- _el$3 = _el$2.nextSibling;
7408
- var _ref$ = first_span;
7409
- typeof _ref$ === "function" ? $8tj43$use(_ref$, _el$2) : first_span = _el$2;
7410
- var _ref$2 = second_span;
7411
- typeof _ref$2 === "function" ? $8tj43$use(_ref$2, _el$3) : second_span = _el$3;
7412
- $8tj43$effect(() => $8tj43$setAttribute(_el$, "aria-label", expanded_() ? i18n_.morphing_sign_expanded_aria_label_() : i18n_.morphing_sign_collapsed_aria_label_()));
7415
+ return (() => {
7416
+ var _el$ = $8tj43$getNextElement($457279ff15864cb9$var$_tmpl$);
7417
+ $8tj43$effect(_p$ => {
7418
+ var _v$ = !!expanded_(),
7419
+ _v$2 = expanded_() ? i18n_.morphing_sign_expanded_aria_label_() : i18n_.morphing_sign_collapsed_aria_label_();
7420
+ _v$ !== _p$.e && _el$.classList.toggle("expanded", _p$.e = _v$);
7421
+ _v$2 !== _p$.t && $8tj43$setAttribute(_el$, "aria-label", _p$.t = _v$2);
7422
+ return _p$;
7423
+ }, {
7424
+ e: undefined,
7425
+ t: undefined
7426
+ });
7413
7427
  return _el$;
7414
7428
  })();
7415
- const [is_in_dom, set_is_in_dom] = $8tj43$createSignal(false);
7416
- (0, $8tj43$observer).wait_for_element(outer_div).then($8tj43$catchify(() => set_is_in_dom(true)));
7417
- $8tj43$createEffect(() => {
7418
- if (!is_in_dom())
7419
- // wait for us to being in DOM as animations don't work otherwise
7420
- return;
7421
- try {
7422
- const expanded = expanded_();
7423
- for (const span of [first_span, second_span]) span.animate([{
7424
- transform: "rotate(".concat(expanded ? 90 : "0", "deg)")
7425
- }], animation_options);
7426
- const percentage_value = "".concat(expanded ? 50 : 25, "%");
7427
- second_span.animate([{
7428
- left: percentage_value,
7429
- right: percentage_value
7430
- }], animation_options);
7431
- } catch (e) {
7432
- $8tj43$dlog("partial keyframes probably not supported", e);
7433
- }
7434
- });
7435
- return outer_div;
7436
7429
  }
7437
7430
  var $f3a159279dc1a8fb$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<span class=highlighted-part>`);
7438
7431
  const $f3a159279dc1a8fb$var$dont_cut_in_between_less_than_characters = 30;
@@ -13193,7 +13186,7 @@ function $881e8953a9103f10$export$9ff751cd77687edc(_ref) {
13193
13186
  let {
13194
13187
  search_results_: search_results_,
13195
13188
  router_: router_,
13196
- queries_without_content_results_: queries_without_content_results_,
13189
+ setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
13197
13190
  get_search_query_: get_search_query_
13198
13191
  } = _ref;
13199
13192
  const content_results = $8tj43$createMemo(() => {
@@ -13212,7 +13205,11 @@ function $881e8953a9103f10$export$9ff751cd77687edc(_ref) {
13212
13205
  });
13213
13206
  $8tj43$createEffect(() => {
13214
13207
  const results = content_results();
13215
- if (Array.isArray(results) && results.length === 0) queries_without_content_results_.add($8tj43$untrack(get_search_query_));
13208
+ const numberResults = Array.isArray(results) ? results.length : 0;
13209
+ setNumberContentResultsPerQuery_(prev => {
13210
+ prev.set($8tj43$untrack(get_search_query_), numberResults);
13211
+ return prev;
13212
+ });
13216
13213
  });
13217
13214
  return $8tj43$createComponent((0, $8tj43$For), {
13218
13215
  get each() {
@@ -13230,7 +13227,8 @@ function $881e8953a9103f10$export$9ff751cd77687edc(_ref) {
13230
13227
  function $ad4f3c9872fbeb48$export$4405d077f0a20494(_ref) {
13231
13228
  let {
13232
13229
  content_results_rows_: [get_history_state_content_results_rows],
13233
- cols_at_size_: cols_at_size_
13230
+ cols_at_size_: cols_at_size_,
13231
+ overrideAmount_: overrideAmount_
13234
13232
  } = _ref;
13235
13233
  const colsShowingNow = $40e2fa435715a1a0$export$a79e666719b3647c(cols_at_size_);
13236
13234
  const largest_column = $8tj43$createMemo(() => {
@@ -13243,10 +13241,10 @@ function $ad4f3c9872fbeb48$export$4405d077f0a20494(_ref) {
13243
13241
  });
13244
13242
  const num_placeholders = $8tj43$createMemo(() => {
13245
13243
  var _get_history_state_co;
13246
- return (
13247
- // Use how many columns we're actually showing, if available, so that we're showing exactly as many placeholders as we'd show content, so that the view more button doesn't appear/disappear and makes the layout shift
13248
- ((_get_history_state_co = get_history_state_content_results_rows()) !== null && _get_history_state_co !== void 0 ? _get_history_state_co : (0, $d53ebed6f63304e4$export$70ceae36059a1036)) * (colsShowingNow() || largest_column())
13249
- );
13244
+ const override = overrideAmount_();
13245
+ if (override !== undefined) return override;
13246
+ // Use how many columns we're actually showing, if available, so that we're showing exactly as many placeholders as we'd show content, so that the view more button doesn't appear/disappear and makes the layout shift
13247
+ return ((_get_history_state_co = get_history_state_content_results_rows()) !== null && _get_history_state_co !== void 0 ? _get_history_state_co : (0, $d53ebed6f63304e4$export$70ceae36059a1036)) * (colsShowingNow() || largest_column());
13250
13248
  });
13251
13249
  return $8tj43$createComponent((0, $8tj43$Index), {
13252
13250
  get each() {
@@ -13284,15 +13282,13 @@ function $d53ebed6f63304e4$export$6d0c9c22f6652669(_ref) {
13284
13282
  number_: num_results,
13285
13283
  i18n_: i18n_
13286
13284
  });
13287
- const queries_without_content_results_ = new (0, $8tj43$ListenableSet1)();
13288
- const [check_query, set_check_query] = $8tj43$createSignal(false);
13289
- const placeholders_enabled = $8tj43$createMemo(() => {
13290
- // don't show placeholders when the user toggles filters
13291
- check_query();
13292
- return !queries_without_content_results_.has(get_search_query_());
13285
+ const [numberContentResultsPerQuery, setNumberContentResultsPerQuery_] = $8tj43$createSignal(new Map(), {
13286
+ equals: false
13293
13287
  });
13288
+ const contentResultsForCurrentQuery = $8tj43$createMemo(() => numberContentResultsPerQuery().get(get_search_query_()));
13289
+ // Don't show placeholder if we know there will not be any content results and someone is just toggling filters
13290
+ const placeholders_enabled = $8tj43$createMemo(() => contentResultsForCurrentQuery() !== 0);
13294
13291
  const rows_object = $d53ebed6f63304e4$var$make_state_saved_rows(content_results_rows_, i18n_);
13295
- for (const ev of ["add", "delete"]) queries_without_content_results_.addEventListener(ev, () => set_check_query(prev => !prev));
13296
13292
  return (() => {
13297
13293
  var _el$ = $8tj43$getNextElement($d53ebed6f63304e4$var$_tmpl$),
13298
13294
  _el$2 = _el$.firstChild,
@@ -13322,14 +13318,15 @@ function $d53ebed6f63304e4$export$6d0c9c22f6652669(_ref) {
13322
13318
  content_results_rows_: content_results_rows_,
13323
13319
  get cols_at_size_() {
13324
13320
  return $8tj43$createMemo(() => layout_options_().cols_at_size);
13325
- }
13321
+ },
13322
+ overrideAmount_: contentResultsForCurrentQuery
13326
13323
  });
13327
13324
  },
13328
13325
  get children() {
13329
13326
  return $8tj43$createComponent((0, $881e8953a9103f10$export$9ff751cd77687edc), {
13330
13327
  router_: router_,
13331
13328
  search_results_: search_results_,
13332
- queries_without_content_results_: queries_without_content_results_,
13329
+ setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
13333
13330
  get_search_query_: get_search_query_
13334
13331
  });
13335
13332
  }