@depict-ai/ui 4.10.4 → 4.10.6

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.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.10.4";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "4.10.6";
11
11
  function $dc9262ef6f786812$export$d9f36cf74e24d595(media_query) {
12
12
  const signal = $9HbP8$createSignal(false);
13
13
  $9HbP8$onCleanup($9HbP8$javascript_media_query(media_query, ({
@@ -5844,7 +5844,8 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
5844
5844
  get_extra_filters_button_: get_extra_filters_button_,
5845
5845
  get_extra_sorting_button_: get_extra_sorting_button_,
5846
5846
  filterModalParent_: filterModalParent_,
5847
- hideCount0FilterOptions_: hideCount0FilterOptions_
5847
+ hideCount0FilterOptions_: hideCount0FilterOptions_,
5848
+ switchToFiltersDrawerBreakpoint_: switchToFiltersDrawerBreakpoint_
5848
5849
  }) {
5849
5850
  const Self = () => {
5850
5851
  // This could technically be in SearchPage and CategoryPage and would be better suited there since it writes into local_filter_cache_ which i.e. SelectedFilters uses, but it's better suited here IMO due to DRY and being inside the correct error boundary here
@@ -5853,11 +5854,10 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
5853
5854
  selected_filters_: selected_filters_,
5854
5855
  local_filter_cache_: local_filter_cache_
5855
5856
  });
5856
- const cleanup_promise = new Promise(r => $9HbP8$onCleanup(r));
5857
5857
  const [filters_open, set_filters_open] = search_filters_open_;
5858
5858
  const [sorting_open, set_sorting_open] = search_sorting_open_;
5859
5859
  const [get_current_sorting_] = current_sorting_;
5860
- const [is_small, set_is_small] = $9HbP8$createSignal(false);
5860
+ const isSmall = $9HbP8$createMemo(() => $dc9262ef6f786812$export$d9f36cf74e24d595(`(max-width:${switchToFiltersDrawerBreakpoint_() ?? 651}px)`));
5861
5861
  const dismiss_modal_ = $9HbP8$catchify1(() => {
5862
5862
  set_filters_open(false);
5863
5863
  set_sorting_open(false);
@@ -5909,7 +5909,7 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
5909
5909
  $9HbP8$createComputed(() => {
5910
5910
  const fi_o = filters_open();
5911
5911
  const so_o = sorting_open();
5912
- const i_s = is_small();
5912
+ const i_s = isSmall()();
5913
5913
  // we need to always read all the signal if we have them in the if-statement the value of it changes when the computation runs
5914
5914
  if ((fi_o || so_o) && !i_s) {
5915
5915
  if (!grid_is_in_original_state) return;
@@ -5924,7 +5924,7 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
5924
5924
  if (!filters_open() && !sorting_open()) {
5925
5925
  close_modal_?.();
5926
5926
  set_extra_els_in_results_container_("");
5927
- } else if (is_small()) {
5927
+ } else if (isSmall()()) {
5928
5928
  if ($9HbP8$untrack(() => input_modal_open_?.())) {
5929
5929
  // we don't want to shove another modal into the users face, silently close the filters for them
5930
5930
  set_filters_open(false);
@@ -5966,12 +5966,6 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
5966
5966
  dismiss_modal_: dismiss_modal_,
5967
5967
  i18n_: i18n_
5968
5968
  }, filterModalParent_));
5969
- const {
5970
- remove: remove
5971
- } = $9HbP8$javascript_media_query("(max-width:651px)", ({
5972
- matches: matches
5973
- }) => set_is_small(matches));
5974
- cleanup_promise.then(remove);
5975
5969
  })();
5976
5970
  get_extra_filters_button_?.(make_open_filters_button());
5977
5971
  get_extra_sorting_button_?.(make_open_sorting_button());
@@ -7627,12 +7621,17 @@ function $f916989c4b1be9f7$export$780a853d15174484({
7627
7621
  }
7628
7622
  }));
7629
7623
  }
7630
- function $486360b09f0d5729$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_) {
7624
+ function $486360b09f0d5729$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_, products_request_loading_) {
7631
7625
  let hasSeenContentBlock = false;
7632
7626
  const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
7633
7627
  const contentComponents = new Map();
7628
+ const delayedServerBlocks = $9HbP8$createMemo(prev => {
7629
+ // Do not update the server blocks while the products request is loading, to avoid this: https://depictaiworkspace.slack.com/archives/C01JB6E7K7G/p1750861454651319
7630
+ if (products_request_loading_()) return prev;
7631
+ return plp_meta()?.content_blocks;
7632
+ });
7634
7633
  $9HbP8$createEffect(() => {
7635
- const serverContentBlock = plp_meta()?.content_blocks;
7634
+ const serverContentBlock = delayedServerBlocks();
7636
7635
  const currentHistory = $9HbP8$untrack(historyContentBlocks);
7637
7636
  // Only write to the history if the content blocks have changed when a new backend results arrives (we have them in history so scroll restoration works when going back, even when running shopify without single page navigations where our script dies inbetween pages).
7638
7637
  if (serverContentBlock && JSON.stringify(serverContentBlock) !== JSON.stringify(currentHistory.blocks)) setHistoryContentBlocks({
@@ -7738,7 +7737,8 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
7738
7737
  content_blocks_by_row_: content_blocks_by_row_,
7739
7738
  filterModalParent_: filterModalParent_,
7740
7739
  showSliderArrow_: showSliderArrow_,
7741
- hideCount0FilterOptions_: hideCount0FilterOptions_
7740
+ hideCount0FilterOptions_: hideCount0FilterOptions_,
7741
+ switchToFiltersDrawerBreakpoint_: switchToFiltersDrawerBreakpoint_
7742
7742
  }) {
7743
7743
  let results_for;
7744
7744
  let only_show_filters_opener_;
@@ -7834,7 +7834,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
7834
7834
  setMetaRequestsForQuery(prev => prev.set(query.id_type_ + query.id_to_query_for_, listing));
7835
7835
  return result;
7836
7836
  }));
7837
- const contentBlocksByRow = $486360b09f0d5729$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_);
7837
+ const contentBlocksByRow = $486360b09f0d5729$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_, () => plp_products_.loading);
7838
7838
  const countOfProductsForUI = $3ef0154d1cf118ed$export$a86bc18439445599(plp_products_, all_products_loaded_, currentlyLoadedDisplays);
7839
7839
  const available_sortings_ = $9HbP8$createMemo(() => plp_products_()?.sorts?.map(sort => ({
7840
7840
  ...sort,
@@ -7953,6 +7953,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
7953
7953
  sort_and_filter_disabled_: sort_and_filter_disabled_,
7954
7954
  filterModalParent_: filterModalParent_,
7955
7955
  hideCount0FilterOptions_: hideCount0FilterOptions_,
7956
+ switchToFiltersDrawerBreakpoint_: switchToFiltersDrawerBreakpoint_,
7956
7957
  ...extra_sort_and_filter_args_
7957
7958
  });
7958
7959
  $9HbP8$catchify((0, $641bba2917fe862b$export$6e49da55e449af7c))({
@@ -14460,7 +14461,8 @@ function $7097477c78a89208$export$a54ec244c8863715({
14460
14461
  filterModalParent_: filterModalParent_,
14461
14462
  class_: class_,
14462
14463
  showSliderArrow_: showSliderArrow_,
14463
- hideCount0FilterOptions_: hideCount0FilterOptions_
14464
+ hideCount0FilterOptions_: hideCount0FilterOptions_,
14465
+ switchToFiltersDrawerBreakpoint_: switchToFiltersDrawerBreakpoint_
14464
14466
  }) {
14465
14467
  const [get_sorting] = current_sorting_;
14466
14468
  const all_products_loaded_ = $9HbP8$createSignal(false);
@@ -14569,7 +14571,8 @@ function $7097477c78a89208$export$a54ec244c8863715({
14569
14571
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
14570
14572
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
14571
14573
  filterModalParent_: filterModalParent_,
14572
- hideCount0FilterOptions_: hideCount0FilterOptions_
14574
+ hideCount0FilterOptions_: hideCount0FilterOptions_,
14575
+ switchToFiltersDrawerBreakpoint_: switchToFiltersDrawerBreakpoint_
14573
14576
  });
14574
14577
  const results_filters = $9HbP8$createSignal();
14575
14578
  const shouldActuallyShowInputField = $9HbP8$createMemo(() => include_input_field_?.() ?? true); // default to showing input field
@@ -15230,6 +15233,7 @@ function $806c97b931758897$export$f2dc7e4e4aa11abb(props) {
15230
15233
  search_sorting_open_: state_.sorting_open,
15231
15234
  expanded_filters_: state_.expanded_filters,
15232
15235
  content_results_rows_: state_.content_results_rows,
15236
+ switchToFiltersDrawerBreakpoint_: () => props.switchToFiltersDrawerBreakpoint_,
15233
15237
  content_blocks_by_row_: () => props.content_blocks_by_row,
15234
15238
  router_: shared_properties.router_,
15235
15239
  make_category_suggestion_card_: shared_properties.enable_category_suggestions_ ? category_suggestion_ => {
@@ -15827,7 +15831,8 @@ function $442f32a4d80abbde$export$e2bf8ce7779e827e(props) {
15827
15831
  })),
15828
15832
  product_card_template_: product_card_template,
15829
15833
  sorting_query_param_: sorting_query_param_,
15830
- filter_query_param_prefix_: filter_query_param_prefix_
15834
+ filter_query_param_prefix_: filter_query_param_prefix_,
15835
+ switchToFiltersDrawerBreakpoint_: () => props.switchToFiltersDrawerBreakpoint_
15831
15836
  });
15832
15837
  }, "Entire CategoryPage failed");
15833
15838
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "4.10.4",
3
+ "version": "4.10.6",
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",
@@ -115,7 +115,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
115
115
  $parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
116
116
  $parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
117
117
  /*! Depict.ai search and product listing SDK */
118
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.10.4";
118
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.10.6";
119
119
  function $3e17e871e9d0911d$export$d9f36cf74e24d595(media_query) {
120
120
  const signal = $3hooq$solidjs.createSignal(false);
121
121
  $3hooq$solidjs.onCleanup($3hooq$depictaiutilishared.javascript_media_query(media_query, _ref => {
@@ -5007,7 +5007,8 @@ function $f70cc6dfcadf0fd5$export$d7841e452f2e59a8(_ref) {
5007
5007
  get_extra_filters_button_: get_extra_filters_button_,
5008
5008
  get_extra_sorting_button_: get_extra_sorting_button_,
5009
5009
  filterModalParent_: filterModalParent_,
5010
- hideCount0FilterOptions_: hideCount0FilterOptions_
5010
+ hideCount0FilterOptions_: hideCount0FilterOptions_,
5011
+ switchToFiltersDrawerBreakpoint_: switchToFiltersDrawerBreakpoint_
5011
5012
  } = _ref;
5012
5013
  const Self = () => {
5013
5014
  // This could technically be in SearchPage and CategoryPage and would be better suited there since it writes into local_filter_cache_ which i.e. SelectedFilters uses, but it's better suited here IMO due to DRY and being inside the correct error boundary here
@@ -5016,11 +5017,13 @@ function $f70cc6dfcadf0fd5$export$d7841e452f2e59a8(_ref) {
5016
5017
  selected_filters_: selected_filters_,
5017
5018
  local_filter_cache_: local_filter_cache_
5018
5019
  });
5019
- const cleanup_promise = new Promise(r => $3hooq$solidjs.onCleanup(r));
5020
5020
  const [filters_open, set_filters_open] = search_filters_open_;
5021
5021
  const [sorting_open, set_sorting_open] = search_sorting_open_;
5022
5022
  const [get_current_sorting_] = current_sorting_;
5023
- const [is_small, set_is_small] = $3hooq$solidjs.createSignal(false);
5023
+ const isSmall = $3hooq$solidjs.createMemo(() => {
5024
+ var _switchToFiltersDrawe;
5025
+ return $3e17e871e9d0911d$export$d9f36cf74e24d595("(max-width:".concat((_switchToFiltersDrawe = switchToFiltersDrawerBreakpoint_()) !== null && _switchToFiltersDrawe !== void 0 ? _switchToFiltersDrawe : 651, "px)"));
5026
+ });
5024
5027
  const dismiss_modal_ = $3hooq$depictaiutilishared.catchify(() => {
5025
5028
  set_filters_open(false);
5026
5029
  set_sorting_open(false);
@@ -5084,7 +5087,7 @@ function $f70cc6dfcadf0fd5$export$d7841e452f2e59a8(_ref) {
5084
5087
  $3hooq$solidjs.createComputed(() => {
5085
5088
  const fi_o = filters_open();
5086
5089
  const so_o = sorting_open();
5087
- const i_s = is_small();
5090
+ const i_s = isSmall()();
5088
5091
  // we need to always read all the signal if we have them in the if-statement the value of it changes when the computation runs
5089
5092
  if ((fi_o || so_o) && !i_s) {
5090
5093
  if (!grid_is_in_original_state) return;
@@ -5100,7 +5103,7 @@ function $f70cc6dfcadf0fd5$export$d7841e452f2e59a8(_ref) {
5100
5103
  var _close_modal_;
5101
5104
  (_close_modal_ = close_modal_) === null || _close_modal_ === void 0 || _close_modal_();
5102
5105
  set_extra_els_in_results_container_("");
5103
- } else if (is_small()) {
5106
+ } else if (isSmall()()) {
5104
5107
  var _open_modal_;
5105
5108
  if ($3hooq$solidjs.untrack(() => input_modal_open_ === null || input_modal_open_ === void 0 ? void 0 : input_modal_open_())) {
5106
5109
  // we don't want to shove another modal into the users face, silently close the filters for them
@@ -5136,15 +5139,6 @@ function $f70cc6dfcadf0fd5$export$d7841e452f2e59a8(_ref) {
5136
5139
  dismiss_modal_: dismiss_modal_,
5137
5140
  i18n_: i18n_
5138
5141
  }, filterModalParent_));
5139
- const {
5140
- remove: remove
5141
- } = $3hooq$depictaiutilishared.javascript_media_query("(max-width:651px)", _ref3 => {
5142
- let {
5143
- matches: matches
5144
- } = _ref3;
5145
- return set_is_small(matches);
5146
- });
5147
- cleanup_promise.then(remove);
5148
5142
  })();
5149
5143
  get_extra_filters_button_ === null || get_extra_filters_button_ === void 0 || get_extra_filters_button_(make_open_filters_button());
5150
5144
  get_extra_sorting_button_ === null || get_extra_sorting_button_ === void 0 || get_extra_sorting_button_(make_open_sorting_button());
@@ -5172,7 +5166,7 @@ function $f70cc6dfcadf0fd5$export$d7841e452f2e59a8(_ref) {
5172
5166
  }
5173
5167
  });
5174
5168
  }
5175
- function $f70cc6dfcadf0fd5$var$OpenFiltersButton(_ref4) {
5169
+ function $f70cc6dfcadf0fd5$var$OpenFiltersButton(_ref3) {
5176
5170
  let {
5177
5171
  i18n_: i18n_,
5178
5172
  search_filters_open_: search_filters_open_,
@@ -5181,7 +5175,7 @@ function $f70cc6dfcadf0fd5$var$OpenFiltersButton(_ref4) {
5181
5175
  tabindex_: tabindex_,
5182
5176
  number_of_rendered_selected_filters_items_: [num_selected_filters],
5183
5177
  hide_button_: hide_button_
5184
- } = _ref4;
5178
+ } = _ref3;
5185
5179
  const filters_closed = $3hooq$solidjs.createMemo(() => !search_filters_open_[0]());
5186
5180
  // We assume in embedded_num_products that this is a single HTMLElement so pls change there if you change it here
5187
5181
  return $3hooq$solidjsweb.ssr($f70cc6dfcadf0fd5$var$_tmpl$5, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.ssrStyle(hide_button_() ? {
@@ -5207,7 +5201,7 @@ function $f70cc6dfcadf0fd5$var$OpenFiltersButton(_ref4) {
5207
5201
  }
5208
5202
  })), $3hooq$solidjsweb.escape(i18n_.filter_text_()));
5209
5203
  }
5210
- function $f70cc6dfcadf0fd5$var$OpenSortingButton(_ref5) {
5204
+ function $f70cc6dfcadf0fd5$var$OpenSortingButton(_ref4) {
5211
5205
  var _meta_of_currently_se;
5212
5206
  let {
5213
5207
  i18n_: i18n_,
@@ -5218,7 +5212,7 @@ function $f70cc6dfcadf0fd5$var$OpenSortingButton(_ref5) {
5218
5212
  sort_button_width_: sort_button_width_,
5219
5213
  tabindex_: tabindex_,
5220
5214
  meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_
5221
- } = _ref5;
5215
+ } = _ref4;
5222
5216
  const sorting_closed = $3hooq$solidjs.createMemo(() => !search_sorting_open_[0]());
5223
5217
  // We assume in embedded_num_products that this is a single HTMLElement so pls change there if you change it here
5224
5218
  return $3hooq$solidjsweb.ssr($f70cc6dfcadf0fd5$var$_tmpl$6, $3hooq$solidjsweb.ssrHydrationKey(), "".concat(!sorting_closed() ? "major" : "", " ").concat(sorting_closed() ? "minor" : "", " toggle-button for-sorting major-minor-transition"), $3hooq$solidjsweb.ssrAttribute("tabindex", $3hooq$solidjsweb.escape(tabindex_, true), false) + $3hooq$solidjsweb.ssrAttribute("aria-label", $3hooq$solidjsweb.escape((sorting_closed() ? i18n_.open_sorting_ : i18n_.close_sorting_)(), true), false), $3hooq$solidjsweb.ssrStyle(sort_button_width_ !== null && sort_button_width_ !== void 0 && sort_button_width_() ? {
@@ -6687,13 +6681,18 @@ function $c19709057a32b2e7$export$780a853d15174484(_ref) {
6687
6681
  }
6688
6682
  }));
6689
6683
  }
6690
- function $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_) {
6684
+ function $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_, products_request_loading_) {
6691
6685
  let hasSeenContentBlock = false;
6692
6686
  const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
6693
6687
  const contentComponents = new Map();
6694
- $3hooq$solidjs.createEffect(() => {
6688
+ const delayedServerBlocks = $3hooq$solidjs.createMemo(prev => {
6695
6689
  var _plp_meta;
6696
- const serverContentBlock = (_plp_meta = plp_meta()) === null || _plp_meta === void 0 ? void 0 : _plp_meta.content_blocks;
6690
+ // Do not update the server blocks while the products request is loading, to avoid this: https://depictaiworkspace.slack.com/archives/C01JB6E7K7G/p1750861454651319
6691
+ if (products_request_loading_()) return prev;
6692
+ return (_plp_meta = plp_meta()) === null || _plp_meta === void 0 ? void 0 : _plp_meta.content_blocks;
6693
+ });
6694
+ $3hooq$solidjs.createEffect(() => {
6695
+ const serverContentBlock = delayedServerBlocks();
6697
6696
  const currentHistory = $3hooq$solidjs.untrack(historyContentBlocks);
6698
6697
  // Only write to the history if the content blocks have changed when a new backend results arrives (we have them in history so scroll restoration works when going back, even when running shopify without single page navigations where our script dies inbetween pages).
6699
6698
  if (serverContentBlock && JSON.stringify(serverContentBlock) !== JSON.stringify(currentHistory.blocks)) setHistoryContentBlocks({
@@ -6802,7 +6801,8 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
6802
6801
  content_blocks_by_row_: content_blocks_by_row_,
6803
6802
  filterModalParent_: filterModalParent_,
6804
6803
  showSliderArrow_: showSliderArrow_,
6805
- hideCount0FilterOptions_: hideCount0FilterOptions_
6804
+ hideCount0FilterOptions_: hideCount0FilterOptions_,
6805
+ switchToFiltersDrawerBreakpoint_: switchToFiltersDrawerBreakpoint_
6806
6806
  } = _ref;
6807
6807
  let results_for;
6808
6808
  let only_show_filters_opener_;
@@ -6898,7 +6898,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
6898
6898
  setMetaRequestsForQuery(prev => prev.set(query.id_type_ + query.id_to_query_for_, listing));
6899
6899
  return result;
6900
6900
  }));
6901
- const contentBlocksByRow = $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_);
6901
+ const contentBlocksByRow = $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_, () => plp_products_.loading);
6902
6902
  const countOfProductsForUI = $e335e2ff536c1a0b$export$a86bc18439445599(plp_products_, all_products_loaded_, currentlyLoadedDisplays);
6903
6903
  const available_sortings_ = $3hooq$solidjs.createMemo(() => {
6904
6904
  var _plp_products_, _plp_products_$sorts;
@@ -7025,6 +7025,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
7025
7025
  sort_and_filter_disabled_: sort_and_filter_disabled_,
7026
7026
  filterModalParent_: filterModalParent_,
7027
7027
  hideCount0FilterOptions_: hideCount0FilterOptions_,
7028
+ switchToFiltersDrawerBreakpoint_: switchToFiltersDrawerBreakpoint_,
7028
7029
  ...extra_sort_and_filter_args_
7029
7030
  });
7030
7031
  $3hooq$depictaiutilisharedlatest.catchify((0, $fef4890f1f8e0544$export$6e49da55e449af7c))({
@@ -12760,7 +12761,8 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
12760
12761
  filterModalParent_: filterModalParent_,
12761
12762
  class_: class_,
12762
12763
  showSliderArrow_: showSliderArrow_,
12763
- hideCount0FilterOptions_: hideCount0FilterOptions_
12764
+ hideCount0FilterOptions_: hideCount0FilterOptions_,
12765
+ switchToFiltersDrawerBreakpoint_: switchToFiltersDrawerBreakpoint_
12764
12766
  } = _ref;
12765
12767
  const [get_sorting] = current_sorting_;
12766
12768
  const all_products_loaded_ = $3hooq$solidjs.createSignal(false);
@@ -12881,7 +12883,8 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
12881
12883
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
12882
12884
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
12883
12885
  filterModalParent_: filterModalParent_,
12884
- hideCount0FilterOptions_: hideCount0FilterOptions_
12886
+ hideCount0FilterOptions_: hideCount0FilterOptions_,
12887
+ switchToFiltersDrawerBreakpoint_: switchToFiltersDrawerBreakpoint_
12885
12888
  });
12886
12889
  const results_filters = $3hooq$solidjs.createSignal();
12887
12890
  const shouldActuallyShowInputField = $3hooq$solidjs.createMemo(() => {
@@ -13586,6 +13589,7 @@ function $ddd39c5f36f49703$export$f2dc7e4e4aa11abb(props) {
13586
13589
  search_sorting_open_: state_.sorting_open,
13587
13590
  expanded_filters_: state_.expanded_filters,
13588
13591
  content_results_rows_: state_.content_results_rows,
13592
+ switchToFiltersDrawerBreakpoint_: () => props.switchToFiltersDrawerBreakpoint_,
13589
13593
  content_blocks_by_row_: () => props.content_blocks_by_row,
13590
13594
  router_: shared_properties.router_,
13591
13595
  make_category_suggestion_card_: shared_properties.enable_category_suggestions_ ? category_suggestion_ => {
@@ -14284,7 +14288,8 @@ function $c10e33c4681f8c9b$export$e2bf8ce7779e827e(props) {
14284
14288
  })),
14285
14289
  product_card_template_: product_card_template,
14286
14290
  sorting_query_param_: sorting_query_param_,
14287
- filter_query_param_prefix_: filter_query_param_prefix_
14291
+ filter_query_param_prefix_: filter_query_param_prefix_,
14292
+ switchToFiltersDrawerBreakpoint_: () => props.switchToFiltersDrawerBreakpoint_
14288
14293
  });
14289
14294
  }, "Entire CategoryPage failed");
14290
14295
  }
@@ -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.10.4";
14
+ export const version = "4.10.6";
15
15
  /**
16
16
  * Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
17
17
  */
@@ -1318,7 +1318,6 @@ type RecsAPIWrapperOptions = {
1318
1318
  * @param market The market to fetch recs for. Depict will provide this to you. (Example: "sv" or "sv-se".)
1319
1319
  * @param locale The locale to fetch for.
1320
1320
  * @param type The type of the recommendations, e.g. `front_page`, `after_basket, `related`, etc. Ask Depict for this.
1321
- * @param categoryId When requesting recommendations for a category page, pass the id of the category page as `categoryId`.
1322
1321
  * @param productId When requesting recommendations for a single product, e.g. on a product detail page, pass the id of the product as `productId`.
1323
1322
  * @param productIds When requesting recommendations that should take multiple products into account, i.e. the contents of the basket/cart, pass an array of product ids as `productIds`
1324
1323
  * @param sessionId Optional unique identifier of the current session. Only necessary when performing server side requests to Depict.
@@ -1502,6 +1501,7 @@ export function SearchPage<OriginalDisplay extends Display, TransformedDisplay e
1502
1501
  class?: string;
1503
1502
  showSliderArrow_?: boolean;
1504
1503
  hideCount0FilterOptions_?: boolean;
1504
+ switchToFiltersDrawerBreakpoint_?: number | undefined;
1505
1505
  }): import("@depict-ai/utilishared").Node_Array;
1506
1506
  /**
1507
1507
  * Connects the height of the search field to the height of the aligner.
@@ -1541,7 +1541,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
1541
1541
  * Open the modal with support for alignment.
1542
1542
  * @returns {void}
1543
1543
  */
1544
- export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1544
+ export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1545
1545
  export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
1546
1546
  export interface PageReplacer {
1547
1547
  readonly render_: () => Node_Array;
@@ -1613,6 +1613,7 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
1613
1613
  grid_spacing: SDKGridSpacing;
1614
1614
  cols_at_size: SDKColsAtSize;
1615
1615
  product_card_template: ProductCardTemplate<[OutputDisplay] extends [never] ? OriginalDisplay : ModernDisplayWithPageUrl<OutputDisplay>>;
1616
+ switchToFiltersDrawerBreakpoint_?: number | undefined;
1616
1617
  show_quicklinks?: boolean;
1617
1618
  show_breadcrumbs?: boolean;
1618
1619
  category_title: typeof CategoryTitle | typeof embedded_num_products;
@@ -1622,5 +1623,5 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
1622
1623
  filterModalParent_?: HTMLElement | ShadowRoot;
1623
1624
  showSliderArrow_?: boolean;
1624
1625
  hideCount0FilterOptions_?: boolean;
1625
- }): import("@depict-ai/utilishared/latest").Node_Array;
1626
+ }): import("@depict-ai/utilishared").Node_Array;
1626
1627
  export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";
@@ -10,7 +10,7 @@ import $b8hua$babelruntimehelpersclassPrivateFieldGet from "@babel/runtime/helpe
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.10.4";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "4.10.6";
14
14
  function $00a5b94f0c11efbb$export$d9f36cf74e24d595(media_query) {
15
15
  const signal = $b8hua$createSignal(false);
16
16
  $b8hua$onCleanup($b8hua$javascript_media_query(media_query, _ref => {
@@ -4902,7 +4902,8 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
4902
4902
  get_extra_filters_button_: get_extra_filters_button_,
4903
4903
  get_extra_sorting_button_: get_extra_sorting_button_,
4904
4904
  filterModalParent_: filterModalParent_,
4905
- hideCount0FilterOptions_: hideCount0FilterOptions_
4905
+ hideCount0FilterOptions_: hideCount0FilterOptions_,
4906
+ switchToFiltersDrawerBreakpoint_: switchToFiltersDrawerBreakpoint_
4906
4907
  } = _ref;
4907
4908
  const Self = () => {
4908
4909
  // This could technically be in SearchPage and CategoryPage and would be better suited there since it writes into local_filter_cache_ which i.e. SelectedFilters uses, but it's better suited here IMO due to DRY and being inside the correct error boundary here
@@ -4911,11 +4912,13 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
4911
4912
  selected_filters_: selected_filters_,
4912
4913
  local_filter_cache_: local_filter_cache_
4913
4914
  });
4914
- const cleanup_promise = new Promise(r => $b8hua$onCleanup(r));
4915
4915
  const [filters_open, set_filters_open] = search_filters_open_;
4916
4916
  const [sorting_open, set_sorting_open] = search_sorting_open_;
4917
4917
  const [get_current_sorting_] = current_sorting_;
4918
- const [is_small, set_is_small] = $b8hua$createSignal(false);
4918
+ const isSmall = $b8hua$createMemo(() => {
4919
+ var _switchToFiltersDrawe;
4920
+ return $00a5b94f0c11efbb$export$d9f36cf74e24d595("(max-width:".concat((_switchToFiltersDrawe = switchToFiltersDrawerBreakpoint_()) !== null && _switchToFiltersDrawe !== void 0 ? _switchToFiltersDrawe : 651, "px)"));
4921
+ });
4919
4922
  const dismiss_modal_ = $b8hua$catchify1(() => {
4920
4923
  set_filters_open(false);
4921
4924
  set_sorting_open(false);
@@ -4979,7 +4982,7 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
4979
4982
  $b8hua$createComputed(() => {
4980
4983
  const fi_o = filters_open();
4981
4984
  const so_o = sorting_open();
4982
- const i_s = is_small();
4985
+ const i_s = isSmall()();
4983
4986
  // we need to always read all the signal if we have them in the if-statement the value of it changes when the computation runs
4984
4987
  if ((fi_o || so_o) && !i_s) {
4985
4988
  if (!grid_is_in_original_state) return;
@@ -4995,7 +4998,7 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
4995
4998
  var _close_modal_;
4996
4999
  (_close_modal_ = close_modal_) === null || _close_modal_ === void 0 || _close_modal_();
4997
5000
  set_extra_els_in_results_container_("");
4998
- } else if (is_small()) {
5001
+ } else if (isSmall()()) {
4999
5002
  var _open_modal_;
5000
5003
  if ($b8hua$untrack(() => input_modal_open_ === null || input_modal_open_ === void 0 ? void 0 : input_modal_open_())) {
5001
5004
  // we don't want to shove another modal into the users face, silently close the filters for them
@@ -5031,15 +5034,6 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
5031
5034
  dismiss_modal_: dismiss_modal_,
5032
5035
  i18n_: i18n_
5033
5036
  }, filterModalParent_));
5034
- const {
5035
- remove: remove
5036
- } = $b8hua$javascript_media_query("(max-width:651px)", _ref3 => {
5037
- let {
5038
- matches: matches
5039
- } = _ref3;
5040
- return set_is_small(matches);
5041
- });
5042
- cleanup_promise.then(remove);
5043
5037
  })();
5044
5038
  get_extra_filters_button_ === null || get_extra_filters_button_ === void 0 || get_extra_filters_button_(make_open_filters_button());
5045
5039
  get_extra_sorting_button_ === null || get_extra_sorting_button_ === void 0 || get_extra_sorting_button_(make_open_sorting_button());
@@ -5067,7 +5061,7 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
5067
5061
  }
5068
5062
  });
5069
5063
  }
5070
- function $7396052a1484264f$var$OpenFiltersButton(_ref4) {
5064
+ function $7396052a1484264f$var$OpenFiltersButton(_ref3) {
5071
5065
  let {
5072
5066
  i18n_: i18n_,
5073
5067
  search_filters_open_: search_filters_open_,
@@ -5076,7 +5070,7 @@ function $7396052a1484264f$var$OpenFiltersButton(_ref4) {
5076
5070
  tabindex_: tabindex_,
5077
5071
  number_of_rendered_selected_filters_items_: [num_selected_filters],
5078
5072
  hide_button_: hide_button_
5079
- } = _ref4;
5073
+ } = _ref3;
5080
5074
  const filters_closed = $b8hua$createMemo(() => !search_filters_open_[0]());
5081
5075
  // We assume in embedded_num_products that this is a single HTMLElement so pls change there if you change it here
5082
5076
  return $b8hua$ssr($7396052a1484264f$var$_tmpl$5, $b8hua$ssrHydrationKey(), $b8hua$ssrStyle(hide_button_() ? {
@@ -5102,7 +5096,7 @@ function $7396052a1484264f$var$OpenFiltersButton(_ref4) {
5102
5096
  }
5103
5097
  })), $b8hua$escape(i18n_.filter_text_()));
5104
5098
  }
5105
- function $7396052a1484264f$var$OpenSortingButton(_ref5) {
5099
+ function $7396052a1484264f$var$OpenSortingButton(_ref4) {
5106
5100
  var _meta_of_currently_se;
5107
5101
  let {
5108
5102
  i18n_: i18n_,
@@ -5113,7 +5107,7 @@ function $7396052a1484264f$var$OpenSortingButton(_ref5) {
5113
5107
  sort_button_width_: sort_button_width_,
5114
5108
  tabindex_: tabindex_,
5115
5109
  meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_
5116
- } = _ref5;
5110
+ } = _ref4;
5117
5111
  const sorting_closed = $b8hua$createMemo(() => !search_sorting_open_[0]());
5118
5112
  // We assume in embedded_num_products that this is a single HTMLElement so pls change there if you change it here
5119
5113
  return $b8hua$ssr($7396052a1484264f$var$_tmpl$6, $b8hua$ssrHydrationKey(), "".concat(!sorting_closed() ? "major" : "", " ").concat(sorting_closed() ? "minor" : "", " toggle-button for-sorting major-minor-transition"), $b8hua$ssrAttribute("tabindex", $b8hua$escape(tabindex_, true), false) + $b8hua$ssrAttribute("aria-label", $b8hua$escape((sorting_closed() ? i18n_.open_sorting_ : i18n_.close_sorting_)(), true), false), $b8hua$ssrStyle(sort_button_width_ !== null && sort_button_width_ !== void 0 && sort_button_width_() ? {
@@ -6582,13 +6576,18 @@ function $3b772ef9a35560fe$export$780a853d15174484(_ref) {
6582
6576
  }
6583
6577
  }));
6584
6578
  }
6585
- function $12ff24fdc4b26d88$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_) {
6579
+ function $12ff24fdc4b26d88$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_, products_request_loading_) {
6586
6580
  let hasSeenContentBlock = false;
6587
6581
  const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
6588
6582
  const contentComponents = new Map();
6589
- $b8hua$createEffect(() => {
6583
+ const delayedServerBlocks = $b8hua$createMemo(prev => {
6590
6584
  var _plp_meta;
6591
- const serverContentBlock = (_plp_meta = plp_meta()) === null || _plp_meta === void 0 ? void 0 : _plp_meta.content_blocks;
6585
+ // Do not update the server blocks while the products request is loading, to avoid this: https://depictaiworkspace.slack.com/archives/C01JB6E7K7G/p1750861454651319
6586
+ if (products_request_loading_()) return prev;
6587
+ return (_plp_meta = plp_meta()) === null || _plp_meta === void 0 ? void 0 : _plp_meta.content_blocks;
6588
+ });
6589
+ $b8hua$createEffect(() => {
6590
+ const serverContentBlock = delayedServerBlocks();
6592
6591
  const currentHistory = $b8hua$untrack(historyContentBlocks);
6593
6592
  // Only write to the history if the content blocks have changed when a new backend results arrives (we have them in history so scroll restoration works when going back, even when running shopify without single page navigations where our script dies inbetween pages).
6594
6593
  if (serverContentBlock && JSON.stringify(serverContentBlock) !== JSON.stringify(currentHistory.blocks)) setHistoryContentBlocks({
@@ -6697,7 +6696,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
6697
6696
  content_blocks_by_row_: content_blocks_by_row_,
6698
6697
  filterModalParent_: filterModalParent_,
6699
6698
  showSliderArrow_: showSliderArrow_,
6700
- hideCount0FilterOptions_: hideCount0FilterOptions_
6699
+ hideCount0FilterOptions_: hideCount0FilterOptions_,
6700
+ switchToFiltersDrawerBreakpoint_: switchToFiltersDrawerBreakpoint_
6701
6701
  } = _ref;
6702
6702
  let results_for;
6703
6703
  let only_show_filters_opener_;
@@ -6793,7 +6793,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
6793
6793
  setMetaRequestsForQuery(prev => prev.set(query.id_type_ + query.id_to_query_for_, listing));
6794
6794
  return result;
6795
6795
  }));
6796
- const contentBlocksByRow = $12ff24fdc4b26d88$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_);
6796
+ const contentBlocksByRow = $12ff24fdc4b26d88$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_, () => plp_products_.loading);
6797
6797
  const countOfProductsForUI = $0728458b46ee9d32$export$a86bc18439445599(plp_products_, all_products_loaded_, currentlyLoadedDisplays);
6798
6798
  const available_sortings_ = $b8hua$createMemo(() => {
6799
6799
  var _plp_products_, _plp_products_$sorts;
@@ -6920,6 +6920,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
6920
6920
  sort_and_filter_disabled_: sort_and_filter_disabled_,
6921
6921
  filterModalParent_: filterModalParent_,
6922
6922
  hideCount0FilterOptions_: hideCount0FilterOptions_,
6923
+ switchToFiltersDrawerBreakpoint_: switchToFiltersDrawerBreakpoint_,
6923
6924
  ...extra_sort_and_filter_args_
6924
6925
  });
6925
6926
  $b8hua$catchify((0, $5e6abec0dab4e610$export$6e49da55e449af7c))({
@@ -12655,7 +12656,8 @@ function $da279c5a540c6846$export$a54ec244c8863715(_ref) {
12655
12656
  filterModalParent_: filterModalParent_,
12656
12657
  class_: class_,
12657
12658
  showSliderArrow_: showSliderArrow_,
12658
- hideCount0FilterOptions_: hideCount0FilterOptions_
12659
+ hideCount0FilterOptions_: hideCount0FilterOptions_,
12660
+ switchToFiltersDrawerBreakpoint_: switchToFiltersDrawerBreakpoint_
12659
12661
  } = _ref;
12660
12662
  const [get_sorting] = current_sorting_;
12661
12663
  const all_products_loaded_ = $b8hua$createSignal(false);
@@ -12776,7 +12778,8 @@ function $da279c5a540c6846$export$a54ec244c8863715(_ref) {
12776
12778
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
12777
12779
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
12778
12780
  filterModalParent_: filterModalParent_,
12779
- hideCount0FilterOptions_: hideCount0FilterOptions_
12781
+ hideCount0FilterOptions_: hideCount0FilterOptions_,
12782
+ switchToFiltersDrawerBreakpoint_: switchToFiltersDrawerBreakpoint_
12780
12783
  });
12781
12784
  const results_filters = $b8hua$createSignal();
12782
12785
  const shouldActuallyShowInputField = $b8hua$createMemo(() => {
@@ -13481,6 +13484,7 @@ function $eb064bc3350276c1$export$f2dc7e4e4aa11abb(props) {
13481
13484
  search_sorting_open_: state_.sorting_open,
13482
13485
  expanded_filters_: state_.expanded_filters,
13483
13486
  content_results_rows_: state_.content_results_rows,
13487
+ switchToFiltersDrawerBreakpoint_: () => props.switchToFiltersDrawerBreakpoint_,
13484
13488
  content_blocks_by_row_: () => props.content_blocks_by_row,
13485
13489
  router_: shared_properties.router_,
13486
13490
  make_category_suggestion_card_: shared_properties.enable_category_suggestions_ ? category_suggestion_ => {
@@ -14179,7 +14183,8 @@ function $8821a19349c36651$export$e2bf8ce7779e827e(props) {
14179
14183
  })),
14180
14184
  product_card_template_: product_card_template,
14181
14185
  sorting_query_param_: sorting_query_param_,
14182
- filter_query_param_prefix_: filter_query_param_prefix_
14186
+ filter_query_param_prefix_: filter_query_param_prefix_,
14187
+ switchToFiltersDrawerBreakpoint_: () => props.switchToFiltersDrawerBreakpoint_
14183
14188
  });
14184
14189
  }, "Entire CategoryPage failed");
14185
14190
  }