@depict-ai/ui 4.3.11 → 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.11";
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
  }
@@ -1972,7 +1976,8 @@ function $2c920813c92d6987$export$7da560f849543dff(_ref) {
1972
1976
  layout_options_: layout_options_,
1973
1977
  title_: title_,
1974
1978
  max_rows_: max_rows_,
1975
- view_more_button_: view_more_button_
1979
+ view_more_button_: view_more_button_,
1980
+ NoResultsFallback_: NoResultsFallback_
1976
1981
  } = _ref;
1977
1982
  const rows_object_ = $52FdA$solidjs.createMemo(() => {
1978
1983
  var _view_more_button$row;
@@ -2053,6 +2058,9 @@ function $2c920813c92d6987$export$7da560f849543dff(_ref) {
2053
2058
  get when() {
2054
2059
  return is_showing_something();
2055
2060
  },
2061
+ get fallback() {
2062
+ return NoResultsFallback_ === null || NoResultsFallback_ === void 0 ? void 0 : NoResultsFallback_();
2063
+ },
2056
2064
  children: elements
2057
2065
  });
2058
2066
  }
@@ -2122,7 +2130,8 @@ function $e57cd46536ad992e$export$2c9f9bf2092486aa(props) {
2122
2130
  layout_options_: $52FdA$solidjs.createMemo(() => ({
2123
2131
  cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(props.columnsAtSize_),
2124
2132
  ...grid_spacing_override()
2125
- }))
2133
+ })),
2134
+ NoResultsFallback_: () => props.NoResultsFallback_
2126
2135
  };
2127
2136
  $52FdA$solidjs.createEffect(() => {
2128
2137
  const {
@@ -7493,44 +7502,20 @@ function $ac040bdfeed58ee4$export$e5c2828934226505(_ref) {
7493
7502
  expanded_: expanded_,
7494
7503
  i18n_: i18n_
7495
7504
  } = _ref;
7496
- let first_span;
7497
- let second_span;
7498
- const animation_options = {
7499
- fill: "forwards",
7500
- duration: 200
7501
- };
7502
- const outer_div = (() => {
7503
- var _el$ = $52FdA$solidjsweb.getNextElement($ac040bdfeed58ee4$var$_tmpl$),
7504
- _el$2 = _el$.firstChild,
7505
- _el$3 = _el$2.nextSibling;
7506
- var _ref$ = first_span;
7507
- typeof _ref$ === "function" ? $52FdA$solidjsweb.use(_ref$, _el$2) : first_span = _el$2;
7508
- var _ref$2 = second_span;
7509
- typeof _ref$2 === "function" ? $52FdA$solidjsweb.use(_ref$2, _el$3) : second_span = _el$3;
7510
- $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
+ });
7511
7517
  return _el$;
7512
7518
  })();
7513
- const [is_in_dom, set_is_in_dom] = $52FdA$solidjs.createSignal(false);
7514
- (0, $52FdA$depictaiutilishared.observer).wait_for_element(outer_div).then($52FdA$depictaiutilishared.catchify(() => set_is_in_dom(true)));
7515
- $52FdA$solidjs.createEffect(() => {
7516
- if (!is_in_dom())
7517
- // wait for us to being in DOM as animations don't work otherwise
7518
- return;
7519
- try {
7520
- const expanded = expanded_();
7521
- for (const span of [first_span, second_span]) span.animate([{
7522
- transform: "rotate(".concat(expanded ? 90 : "0", "deg)")
7523
- }], animation_options);
7524
- const percentage_value = "".concat(expanded ? 50 : 25, "%");
7525
- second_span.animate([{
7526
- left: percentage_value,
7527
- right: percentage_value
7528
- }], animation_options);
7529
- } catch (e) {
7530
- $52FdA$depictaiutilishared.dlog("partial keyframes probably not supported", e);
7531
- }
7532
- });
7533
- return outer_div;
7534
7519
  }
7535
7520
  var $99472afa7112c427$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<span class=highlighted-part>`);
7536
7521
  const $99472afa7112c427$var$dont_cut_in_between_less_than_characters = 30;
@@ -13291,7 +13276,7 @@ function $bf4a8d57aa8dd1c8$export$9ff751cd77687edc(_ref) {
13291
13276
  let {
13292
13277
  search_results_: search_results_,
13293
13278
  router_: router_,
13294
- queries_without_content_results_: queries_without_content_results_,
13279
+ setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
13295
13280
  get_search_query_: get_search_query_
13296
13281
  } = _ref;
13297
13282
  const content_results = $52FdA$solidjs.createMemo(() => {
@@ -13310,7 +13295,11 @@ function $bf4a8d57aa8dd1c8$export$9ff751cd77687edc(_ref) {
13310
13295
  });
13311
13296
  $52FdA$solidjs.createEffect(() => {
13312
13297
  const results = content_results();
13313
- 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
+ });
13314
13303
  });
13315
13304
  return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.For), {
13316
13305
  get each() {
@@ -13328,7 +13317,8 @@ function $bf4a8d57aa8dd1c8$export$9ff751cd77687edc(_ref) {
13328
13317
  function $05f255c0a94b9ca1$export$4405d077f0a20494(_ref) {
13329
13318
  let {
13330
13319
  content_results_rows_: [get_history_state_content_results_rows],
13331
- cols_at_size_: cols_at_size_
13320
+ cols_at_size_: cols_at_size_,
13321
+ overrideAmount_: overrideAmount_
13332
13322
  } = _ref;
13333
13323
  const colsShowingNow = $478e5a09664da64c$export$a79e666719b3647c(cols_at_size_);
13334
13324
  const largest_column = $52FdA$solidjs.createMemo(() => {
@@ -13341,10 +13331,10 @@ function $05f255c0a94b9ca1$export$4405d077f0a20494(_ref) {
13341
13331
  });
13342
13332
  const num_placeholders = $52FdA$solidjs.createMemo(() => {
13343
13333
  var _get_history_state_co;
13344
- return (
13345
- // 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
13346
- ((_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())
13347
- );
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());
13348
13338
  });
13349
13339
  return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Index), {
13350
13340
  get each() {
@@ -13382,15 +13372,13 @@ function $eab939d0b95b75ee$export$6d0c9c22f6652669(_ref) {
13382
13372
  number_: num_results,
13383
13373
  i18n_: i18n_
13384
13374
  });
13385
- const queries_without_content_results_ = new (0, $52FdA$depictaiutilishared.ListenableSet)();
13386
- const [check_query, set_check_query] = $52FdA$solidjs.createSignal(false);
13387
- const placeholders_enabled = $52FdA$solidjs.createMemo(() => {
13388
- // don't show placeholders when the user toggles filters
13389
- check_query();
13390
- return !queries_without_content_results_.has(get_search_query_());
13375
+ const [numberContentResultsPerQuery, setNumberContentResultsPerQuery_] = $52FdA$solidjs.createSignal(new Map(), {
13376
+ equals: false
13391
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);
13392
13381
  const rows_object = $eab939d0b95b75ee$var$make_state_saved_rows(content_results_rows_, i18n_);
13393
- for (const ev of ["add", "delete"]) queries_without_content_results_.addEventListener(ev, () => set_check_query(prev => !prev));
13394
13382
  return (() => {
13395
13383
  var _el$ = $52FdA$solidjsweb.getNextElement($eab939d0b95b75ee$var$_tmpl$),
13396
13384
  _el$2 = _el$.firstChild,
@@ -13420,14 +13408,15 @@ function $eab939d0b95b75ee$export$6d0c9c22f6652669(_ref) {
13420
13408
  content_results_rows_: content_results_rows_,
13421
13409
  get cols_at_size_() {
13422
13410
  return $52FdA$solidjs.createMemo(() => layout_options_().cols_at_size);
13423
- }
13411
+ },
13412
+ overrideAmount_: contentResultsForCurrentQuery
13424
13413
  });
13425
13414
  },
13426
13415
  get children() {
13427
13416
  return $52FdA$solidjsweb.createComponent((0, $bf4a8d57aa8dd1c8$export$9ff751cd77687edc), {
13428
13417
  router_: router_,
13429
13418
  search_results_: search_results_,
13430
- queries_without_content_results_: queries_without_content_results_,
13419
+ setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
13431
13420
  get_search_query_: get_search_query_
13432
13421
  });
13433
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.11";
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.11";
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
  }
@@ -1882,7 +1886,8 @@ function $e3efeb558d952696$export$7da560f849543dff(_ref) {
1882
1886
  layout_options_: layout_options_,
1883
1887
  title_: title_,
1884
1888
  max_rows_: max_rows_,
1885
- view_more_button_: view_more_button_
1889
+ view_more_button_: view_more_button_,
1890
+ NoResultsFallback_: NoResultsFallback_
1886
1891
  } = _ref;
1887
1892
  const rows_object_ = $8tj43$createMemo(() => {
1888
1893
  var _view_more_button$row;
@@ -1963,6 +1968,9 @@ function $e3efeb558d952696$export$7da560f849543dff(_ref) {
1963
1968
  get when() {
1964
1969
  return is_showing_something();
1965
1970
  },
1971
+ get fallback() {
1972
+ return NoResultsFallback_ === null || NoResultsFallback_ === void 0 ? void 0 : NoResultsFallback_();
1973
+ },
1966
1974
  children: elements
1967
1975
  });
1968
1976
  }
@@ -2032,7 +2040,8 @@ function $bb34cd283e904784$export$2c9f9bf2092486aa(props) {
2032
2040
  layout_options_: $8tj43$createMemo(() => ({
2033
2041
  cols_at_size: $a9c7ba6087881ac2$export$6daf8749b65a1b77(props.columnsAtSize_),
2034
2042
  ...grid_spacing_override()
2035
- }))
2043
+ })),
2044
+ NoResultsFallback_: () => props.NoResultsFallback_
2036
2045
  };
2037
2046
  $8tj43$createEffect(() => {
2038
2047
  const {
@@ -7403,44 +7412,20 @@ function $457279ff15864cb9$export$e5c2828934226505(_ref) {
7403
7412
  expanded_: expanded_,
7404
7413
  i18n_: i18n_
7405
7414
  } = _ref;
7406
- let first_span;
7407
- let second_span;
7408
- const animation_options = {
7409
- fill: "forwards",
7410
- duration: 200
7411
- };
7412
- const outer_div = (() => {
7413
- var _el$ = $8tj43$getNextElement($457279ff15864cb9$var$_tmpl$),
7414
- _el$2 = _el$.firstChild,
7415
- _el$3 = _el$2.nextSibling;
7416
- var _ref$ = first_span;
7417
- typeof _ref$ === "function" ? $8tj43$use(_ref$, _el$2) : first_span = _el$2;
7418
- var _ref$2 = second_span;
7419
- typeof _ref$2 === "function" ? $8tj43$use(_ref$2, _el$3) : second_span = _el$3;
7420
- $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
+ });
7421
7427
  return _el$;
7422
7428
  })();
7423
- const [is_in_dom, set_is_in_dom] = $8tj43$createSignal(false);
7424
- (0, $8tj43$observer).wait_for_element(outer_div).then($8tj43$catchify(() => set_is_in_dom(true)));
7425
- $8tj43$createEffect(() => {
7426
- if (!is_in_dom())
7427
- // wait for us to being in DOM as animations don't work otherwise
7428
- return;
7429
- try {
7430
- const expanded = expanded_();
7431
- for (const span of [first_span, second_span]) span.animate([{
7432
- transform: "rotate(".concat(expanded ? 90 : "0", "deg)")
7433
- }], animation_options);
7434
- const percentage_value = "".concat(expanded ? 50 : 25, "%");
7435
- second_span.animate([{
7436
- left: percentage_value,
7437
- right: percentage_value
7438
- }], animation_options);
7439
- } catch (e) {
7440
- $8tj43$dlog("partial keyframes probably not supported", e);
7441
- }
7442
- });
7443
- return outer_div;
7444
7429
  }
7445
7430
  var $f3a159279dc1a8fb$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<span class=highlighted-part>`);
7446
7431
  const $f3a159279dc1a8fb$var$dont_cut_in_between_less_than_characters = 30;
@@ -13201,7 +13186,7 @@ function $881e8953a9103f10$export$9ff751cd77687edc(_ref) {
13201
13186
  let {
13202
13187
  search_results_: search_results_,
13203
13188
  router_: router_,
13204
- queries_without_content_results_: queries_without_content_results_,
13189
+ setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
13205
13190
  get_search_query_: get_search_query_
13206
13191
  } = _ref;
13207
13192
  const content_results = $8tj43$createMemo(() => {
@@ -13220,7 +13205,11 @@ function $881e8953a9103f10$export$9ff751cd77687edc(_ref) {
13220
13205
  });
13221
13206
  $8tj43$createEffect(() => {
13222
13207
  const results = content_results();
13223
- 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
+ });
13224
13213
  });
13225
13214
  return $8tj43$createComponent((0, $8tj43$For), {
13226
13215
  get each() {
@@ -13238,7 +13227,8 @@ function $881e8953a9103f10$export$9ff751cd77687edc(_ref) {
13238
13227
  function $ad4f3c9872fbeb48$export$4405d077f0a20494(_ref) {
13239
13228
  let {
13240
13229
  content_results_rows_: [get_history_state_content_results_rows],
13241
- cols_at_size_: cols_at_size_
13230
+ cols_at_size_: cols_at_size_,
13231
+ overrideAmount_: overrideAmount_
13242
13232
  } = _ref;
13243
13233
  const colsShowingNow = $40e2fa435715a1a0$export$a79e666719b3647c(cols_at_size_);
13244
13234
  const largest_column = $8tj43$createMemo(() => {
@@ -13251,10 +13241,10 @@ function $ad4f3c9872fbeb48$export$4405d077f0a20494(_ref) {
13251
13241
  });
13252
13242
  const num_placeholders = $8tj43$createMemo(() => {
13253
13243
  var _get_history_state_co;
13254
- return (
13255
- // 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
13256
- ((_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())
13257
- );
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());
13258
13248
  });
13259
13249
  return $8tj43$createComponent((0, $8tj43$Index), {
13260
13250
  get each() {
@@ -13292,15 +13282,13 @@ function $d53ebed6f63304e4$export$6d0c9c22f6652669(_ref) {
13292
13282
  number_: num_results,
13293
13283
  i18n_: i18n_
13294
13284
  });
13295
- const queries_without_content_results_ = new (0, $8tj43$ListenableSet1)();
13296
- const [check_query, set_check_query] = $8tj43$createSignal(false);
13297
- const placeholders_enabled = $8tj43$createMemo(() => {
13298
- // don't show placeholders when the user toggles filters
13299
- check_query();
13300
- return !queries_without_content_results_.has(get_search_query_());
13285
+ const [numberContentResultsPerQuery, setNumberContentResultsPerQuery_] = $8tj43$createSignal(new Map(), {
13286
+ equals: false
13301
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);
13302
13291
  const rows_object = $d53ebed6f63304e4$var$make_state_saved_rows(content_results_rows_, i18n_);
13303
- for (const ev of ["add", "delete"]) queries_without_content_results_.addEventListener(ev, () => set_check_query(prev => !prev));
13304
13292
  return (() => {
13305
13293
  var _el$ = $8tj43$getNextElement($d53ebed6f63304e4$var$_tmpl$),
13306
13294
  _el$2 = _el$.firstChild,
@@ -13330,14 +13318,15 @@ function $d53ebed6f63304e4$export$6d0c9c22f6652669(_ref) {
13330
13318
  content_results_rows_: content_results_rows_,
13331
13319
  get cols_at_size_() {
13332
13320
  return $8tj43$createMemo(() => layout_options_().cols_at_size);
13333
- }
13321
+ },
13322
+ overrideAmount_: contentResultsForCurrentQuery
13334
13323
  });
13335
13324
  },
13336
13325
  get children() {
13337
13326
  return $8tj43$createComponent((0, $881e8953a9103f10$export$9ff751cd77687edc), {
13338
13327
  router_: router_,
13339
13328
  search_results_: search_results_,
13340
- queries_without_content_results_: queries_without_content_results_,
13329
+ setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
13341
13330
  get_search_query_: get_search_query_
13342
13331
  });
13343
13332
  }
package/latest/index.cjs CHANGED
@@ -94,7 +94,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $1f4925833f07df29$export$5b7
94
94
  $parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de035477d6fef996);
95
95
  $parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
96
96
  /*! Depict.ai search and product listing SDK */
97
- const $b757f75811f3261f$export$83d89fbfd8236492 = "4.3.11";
97
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "4.3.12";
98
98
  const $4e04be41243c3d80$var$transform_elements = sorted_cols_at_size => {
99
99
  const cols_at_size = [];
100
100
  for (let i = 0; i < sorted_cols_at_size.length; i++) {
@@ -731,7 +731,8 @@ function $363ce4d1d71041aa$export$d41d19e89346fa2({
731
731
  recommendations_resource_: recommendations_resource_,
732
732
  product_card_template_: product_card_template_,
733
733
  layout_options_: layout_options_,
734
- title_: title_
734
+ title_: title_,
735
+ NoResultsFallback_: NoResultsFallback_
735
736
  }) {
736
737
  const is_showing_something = $gVhhF$solidjs.createMemo(() => recommendations_resource_.loading || recommendations_resource_()?.length);
737
738
  const title = $gVhhF$solidjs.createMemo(() => title_?.()); // In case getter/accessor creates elements, don't create them twice
@@ -789,6 +790,9 @@ function $363ce4d1d71041aa$export$d41d19e89346fa2({
789
790
  get when() {
790
791
  return is_showing_something();
791
792
  },
793
+ get fallback() {
794
+ return NoResultsFallback_?.();
795
+ },
792
796
  children: slider
793
797
  });
794
798
  }
@@ -1870,7 +1874,8 @@ function $b8e79813f4f7ebe4$export$7da560f849543dff({
1870
1874
  layout_options_: layout_options_,
1871
1875
  title_: title_,
1872
1876
  max_rows_: max_rows_,
1873
- view_more_button_: view_more_button_
1877
+ view_more_button_: view_more_button_,
1878
+ NoResultsFallback_: NoResultsFallback_
1874
1879
  }) {
1875
1880
  const rows_object_ = $gVhhF$solidjs.createMemo(() => {
1876
1881
  const view_more_button = view_more_button_?.();
@@ -1947,6 +1952,9 @@ function $b8e79813f4f7ebe4$export$7da560f849543dff({
1947
1952
  get when() {
1948
1953
  return is_showing_something();
1949
1954
  },
1955
+ get fallback() {
1956
+ return NoResultsFallback_?.();
1957
+ },
1950
1958
  children: elements
1951
1959
  });
1952
1960
  }
@@ -2014,7 +2022,8 @@ function $a3bbfa5fdaa39f3a$export$2c9f9bf2092486aa(props) {
2014
2022
  layout_options_: $gVhhF$solidjs.createMemo(() => ({
2015
2023
  cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(props.columnsAtSize_),
2016
2024
  ...grid_spacing_override()
2017
- }))
2025
+ })),
2026
+ NoResultsFallback_: () => props.NoResultsFallback_
2018
2027
  };
2019
2028
  $gVhhF$solidjs.createEffect(() => {
2020
2029
  const {
@@ -7153,44 +7162,20 @@ function $7567511a7c3e4bd7$export$e5c2828934226505({
7153
7162
  expanded_: expanded_,
7154
7163
  i18n_: i18n_
7155
7164
  }) {
7156
- let first_span;
7157
- let second_span;
7158
- const animation_options = {
7159
- fill: "forwards",
7160
- duration: 200
7161
- };
7162
- const outer_div = (() => {
7163
- var _el$ = $gVhhF$solidjsweb.getNextElement($7567511a7c3e4bd7$var$_tmpl$),
7164
- _el$2 = _el$.firstChild,
7165
- _el$3 = _el$2.nextSibling;
7166
- var _ref$ = first_span;
7167
- typeof _ref$ === "function" ? $gVhhF$solidjsweb.use(_ref$, _el$2) : first_span = _el$2;
7168
- var _ref$2 = second_span;
7169
- typeof _ref$2 === "function" ? $gVhhF$solidjsweb.use(_ref$2, _el$3) : second_span = _el$3;
7170
- $gVhhF$solidjsweb.effect(() => $gVhhF$solidjsweb.setAttribute(_el$, "aria-label", expanded_() ? i18n_.morphing_sign_expanded_aria_label_() : i18n_.morphing_sign_collapsed_aria_label_()));
7165
+ return (() => {
7166
+ var _el$ = $gVhhF$solidjsweb.getNextElement($7567511a7c3e4bd7$var$_tmpl$);
7167
+ $gVhhF$solidjsweb.effect(_p$ => {
7168
+ var _v$ = !!expanded_(),
7169
+ _v$2 = expanded_() ? i18n_.morphing_sign_expanded_aria_label_() : i18n_.morphing_sign_collapsed_aria_label_();
7170
+ _v$ !== _p$.e && _el$.classList.toggle("expanded", _p$.e = _v$);
7171
+ _v$2 !== _p$.t && $gVhhF$solidjsweb.setAttribute(_el$, "aria-label", _p$.t = _v$2);
7172
+ return _p$;
7173
+ }, {
7174
+ e: undefined,
7175
+ t: undefined
7176
+ });
7171
7177
  return _el$;
7172
7178
  })();
7173
- const [is_in_dom, set_is_in_dom] = $gVhhF$solidjs.createSignal(false);
7174
- (0, $gVhhF$depictaiutilishared.observer).wait_for_element(outer_div).then($gVhhF$depictaiutilishared.catchify(() => set_is_in_dom(true)));
7175
- $gVhhF$solidjs.createEffect(() => {
7176
- if (!is_in_dom())
7177
- // wait for us to being in DOM as animations don't work otherwise
7178
- return;
7179
- try {
7180
- const expanded = expanded_();
7181
- for (const span of [first_span, second_span]) span.animate([{
7182
- transform: `rotate(${expanded ? 90 : "0"}deg)`
7183
- }], animation_options);
7184
- const percentage_value = `${expanded ? 50 : 25}%`;
7185
- second_span.animate([{
7186
- left: percentage_value,
7187
- right: percentage_value
7188
- }], animation_options);
7189
- } catch (e) {
7190
- $gVhhF$depictaiutilishared.dlog("partial keyframes probably not supported", e);
7191
- }
7192
- });
7193
- return outer_div;
7194
7179
  }
7195
7180
  var $5ea5a82e398f6f44$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<span class=highlighted-part>`);
7196
7181
  const $5ea5a82e398f6f44$var$dont_cut_in_between_less_than_characters = 30;
@@ -12531,7 +12516,7 @@ function $76227de40be817e5$export$f631859cab12b342({
12531
12516
  function $8781fcec27b20709$export$9ff751cd77687edc({
12532
12517
  search_results_: search_results_,
12533
12518
  router_: router_,
12534
- queries_without_content_results_: queries_without_content_results_,
12519
+ setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
12535
12520
  get_search_query_: get_search_query_
12536
12521
  }) {
12537
12522
  const content_results = $gVhhF$solidjs.createMemo(() => search_results_()?.content_search_links);
@@ -12547,7 +12532,11 @@ function $8781fcec27b20709$export$9ff751cd77687edc({
12547
12532
  });
12548
12533
  $gVhhF$solidjs.createEffect(() => {
12549
12534
  const results = content_results();
12550
- if (Array.isArray(results) && results.length === 0) queries_without_content_results_.add($gVhhF$solidjs.untrack(get_search_query_));
12535
+ const numberResults = Array.isArray(results) ? results.length : 0;
12536
+ setNumberContentResultsPerQuery_(prev => {
12537
+ prev.set($gVhhF$solidjs.untrack(get_search_query_), numberResults);
12538
+ return prev;
12539
+ });
12551
12540
  });
12552
12541
  return $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.For), {
12553
12542
  get each() {
@@ -12564,7 +12553,8 @@ function $8781fcec27b20709$export$9ff751cd77687edc({
12564
12553
  }
12565
12554
  function $c2f92eb265a14529$export$4405d077f0a20494({
12566
12555
  content_results_rows_: [get_history_state_content_results_rows],
12567
- cols_at_size_: cols_at_size_
12556
+ cols_at_size_: cols_at_size_,
12557
+ overrideAmount_: overrideAmount_
12568
12558
  }) {
12569
12559
  const colsShowingNow = $17d06b3bcb035500$export$a79e666719b3647c(cols_at_size_);
12570
12560
  const largest_column = $gVhhF$solidjs.createMemo(() => {
@@ -12572,9 +12562,12 @@ function $c2f92eb265a14529$export$4405d077f0a20494({
12572
12562
  if (isNaN(largest_in_cols_at_size) || Math.abs(largest_in_cols_at_size) === Infinity) return 4; // fallback to something big so we always have the right amount of placeholders
12573
12563
  return largest_in_cols_at_size;
12574
12564
  });
12575
- const num_placeholders = $gVhhF$solidjs.createMemo(() =>
12576
- // 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
12577
- (get_history_state_content_results_rows() ?? (0, $3716b8caf7f959e2$export$70ceae36059a1036)) * (colsShowingNow() || largest_column()));
12565
+ const num_placeholders = $gVhhF$solidjs.createMemo(() => {
12566
+ const override = overrideAmount_();
12567
+ if (override !== undefined) return override;
12568
+ // 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
12569
+ return (get_history_state_content_results_rows() ?? (0, $3716b8caf7f959e2$export$70ceae36059a1036)) * (colsShowingNow() || largest_column());
12570
+ });
12578
12571
  return $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Index), {
12579
12572
  get each() {
12580
12573
  return Array.from({
@@ -12604,15 +12597,13 @@ function $3716b8caf7f959e2$export$6d0c9c22f6652669({
12604
12597
  number_: num_results,
12605
12598
  i18n_: i18n_
12606
12599
  });
12607
- const queries_without_content_results_ = new (0, $gVhhF$depictaiutilishared.ListenableSet)();
12608
- const [check_query, set_check_query] = $gVhhF$solidjs.createSignal(false);
12609
- const placeholders_enabled = $gVhhF$solidjs.createMemo(() => {
12610
- // don't show placeholders when the user toggles filters
12611
- check_query();
12612
- return !queries_without_content_results_.has(get_search_query_());
12600
+ const [numberContentResultsPerQuery, setNumberContentResultsPerQuery_] = $gVhhF$solidjs.createSignal(new Map(), {
12601
+ equals: false
12613
12602
  });
12603
+ const contentResultsForCurrentQuery = $gVhhF$solidjs.createMemo(() => numberContentResultsPerQuery().get(get_search_query_()));
12604
+ // Don't show placeholder if we know there will not be any content results and someone is just toggling filters
12605
+ const placeholders_enabled = $gVhhF$solidjs.createMemo(() => contentResultsForCurrentQuery() !== 0);
12614
12606
  const rows_object = $3716b8caf7f959e2$var$make_state_saved_rows(content_results_rows_, i18n_);
12615
- for (const ev of ["add", "delete"]) queries_without_content_results_.addEventListener(ev, () => set_check_query(prev => !prev));
12616
12607
  return (() => {
12617
12608
  var _el$ = $gVhhF$solidjsweb.getNextElement($3716b8caf7f959e2$var$_tmpl$),
12618
12609
  _el$2 = _el$.firstChild,
@@ -12642,14 +12633,15 @@ function $3716b8caf7f959e2$export$6d0c9c22f6652669({
12642
12633
  content_results_rows_: content_results_rows_,
12643
12634
  get cols_at_size_() {
12644
12635
  return $gVhhF$solidjs.createMemo(() => layout_options_().cols_at_size);
12645
- }
12636
+ },
12637
+ overrideAmount_: contentResultsForCurrentQuery
12646
12638
  });
12647
12639
  },
12648
12640
  get children() {
12649
12641
  return $gVhhF$solidjsweb.createComponent((0, $8781fcec27b20709$export$9ff751cd77687edc), {
12650
12642
  router_: router_,
12651
12643
  search_results_: search_results_,
12652
- queries_without_content_results_: queries_without_content_results_,
12644
+ setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
12653
12645
  get_search_query_: get_search_query_
12654
12646
  });
12655
12647
  }