@depict-ai/ui 3.0.18 → 3.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/latest/index.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 = "3.0.18";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "3.0.20";
11
11
  const $fbbadcb080ad1d4a$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0"fill=#0f0f0f>`);
12
12
  function $fbbadcb080ad1d4a$export$8be2714ec7f169ee(props = {}) {
13
13
  return (() => {
@@ -2046,7 +2046,8 @@ function $c4492d24952ed731$export$d41d19e89346fa2({
2046
2046
  disable_fading_: true,
2047
2047
  slider_ref_: slider => {
2048
2048
  const {
2049
- insert_here: insert_here
2049
+ insert_here: insert_here,
2050
+ container: container
2050
2051
  } = slider;
2051
2052
  const Layout = props => $c8d5ff4524619fcd$export$445d8d3f5f706a40(props, insert_here, true);
2052
2053
  // Do like this, so we don't have to call mergeProps ourselves
@@ -2056,6 +2057,7 @@ function $c4492d24952ed731$export$d41d19e89346fa2({
2056
2057
  }, layout_options_));
2057
2058
  $9HbP8$slider_fractional_factory(0, 0.75).constructor_plugin.call(slider, {}); // enable fractional scrolling
2058
2059
  insert_here.before($a458486f22b22f63$export$a2cc176055f8f08());
2060
+ container.classList.add("products");
2059
2061
  },
2060
2062
  get children() {
2061
2063
  return $9HbP8$createComponent((0, $9HbP8$Suspense), {
@@ -5846,7 +5848,8 @@ function $6db49ca163afa2c3$export$83fd5de5504a7a67({
5846
5848
  of_: of_
5847
5849
  },
5848
5850
  get_scroll_position_ = () => scrollY,
5849
- listen_to_scroll_on_: listen_to_scroll_on_
5851
+ listen_to_scroll_on_: listen_to_scroll_on_,
5852
+ velocity_too_fast_ = 1.5
5850
5853
  }) {
5851
5854
  if (0, $9HbP8$isServer) return; // won't show in initial render and need scroll position
5852
5855
  const [first_to_show, set_first_to_show] = $9HbP8$createSignal(0);
@@ -5854,6 +5857,7 @@ function $6db49ca163afa2c3$export$83fd5de5504a7a67({
5854
5857
  const [count_to_show, set_count_to_show] = $9HbP8$createSignal("");
5855
5858
  const [permitted_to_show, set_permitted_to_show] = $9HbP8$createSignal(false); // due to scroll speed
5856
5859
  const [show_triggered, set_show_triggered] = $9HbP8$createSignal(false); // signal to just switch between true/false to trigger a new animation which will persist the indicator
5860
+ const [times_too_fast, set_times_too_fast] = $9HbP8$createSignal(0);
5857
5861
  const modified_price_formatting_ = $9HbP8$createMemo(() => ({
5858
5862
  ...price_formatting_(),
5859
5863
  places_after_comma_: 0
@@ -5863,25 +5867,27 @@ function $6db49ca163afa2c3$export$83fd5de5504a7a67({
5863
5867
  let last_pos_time = +new Date();
5864
5868
  let last_pos = get_scroll_position_();
5865
5869
  let unpermit_when_possible = false;
5866
- let times_too_fast = 0;
5867
5870
  const handle_scrollpos_change = () => {
5868
5871
  if (animation) set_show_triggered(prev => !prev); // make sure that once we've decided to show the indicator it doesn't disappear before we stop scrolling
5869
5872
  const distance_travelled = Math.abs(get_scroll_position_() - last_pos);
5870
5873
  const now = +new Date();
5871
5874
  const age_of_distance = now - last_pos_time;
5872
5875
  const velocity = distance_travelled / age_of_distance; // pixels per millisecond
5873
- if (velocity > 1.5) {
5874
- times_too_fast++;
5875
- setTimeout(() => times_too_fast--, 1000);
5876
+ if (velocity > velocity_too_fast_) {
5877
+ set_times_too_fast(prev => prev + 1);
5878
+ setTimeout(() => set_times_too_fast(prev => prev - 1), 1000);
5876
5879
  }
5877
- if (times_too_fast > 10) {
5878
- set_permitted_to_show(true);
5879
- unpermit_when_possible = false;
5880
- } else if (animation) unpermit_when_possible = true;else set_permitted_to_show(false);
5881
5880
  last_pos_time = now;
5882
5881
  last_pos = get_scroll_position_();
5883
5882
  };
5884
5883
  $8f9120a1ca151e6a$export$205efb947c7ffd78(handle_scrollpos_change, undefined, listen_to_scroll_on_);
5884
+ $9HbP8$createComputed(() => {
5885
+ // We need to set this reactively to ensure that it's forbidden to show even when times_too_fast has tapered off after a few seconds, see https://github.com/depict-org/depict/pull/82
5886
+ if (times_too_fast() > 10) {
5887
+ set_permitted_to_show(true);
5888
+ unpermit_when_possible = false;
5889
+ } else if (animation) unpermit_when_possible = true;else set_permitted_to_show(false);
5890
+ });
5885
5891
  $9HbP8$createEffect(() => {
5886
5892
  show_triggered();
5887
5893
  const first = get_first_result_in_viewport();
@@ -6729,6 +6735,7 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
6729
6735
  }
6730
6736
  }));
6731
6737
  insert_here.classList.add("generated-spacing");
6738
+ container.classList.add("products");
6732
6739
  $9HbP8$createEffect(
6733
6740
  // @ts-ignore
6734
6741
  $9HbP8$on(query_base_, () => insert_here.scrollTo({
@@ -6742,13 +6749,13 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
6742
6749
  // Put scroll status into slider container, so it's centered relatively to the products
6743
6750
  const rendered_scroll_status = ConfiguredScrollStatus({
6744
6751
  get_scroll_position_: () => insert_here.scrollLeft,
6745
- listen_to_scroll_on_: insert_here
6752
+ listen_to_scroll_on_: insert_here,
6753
+ velocity_too_fast_: 3 // Require twice as hard scrolling to show ScrollStatus in slider since it's easier to scroll fast there
6746
6754
  });
6747
- const {
6748
- childNodes: childNodes
6749
- } = container;
6755
+
6756
+ const non_solid_nodes = [...container.childNodes];
6750
6757
  // We have to use `insert` over Element.append, because ConfiguredScrollStatus is in an ErrorBoundary and therefore returns a function. `insert` will wipe all children, therefore save them first and then tell insert that the element should contain these elements + whatever ScrollStatus returns
6751
- $9HbP8$insert(container, $9HbP8$createMemo(() => [...childNodes, rendered_scroll_status]));
6758
+ $9HbP8$insert(container, $9HbP8$createMemo(() => [...non_solid_nodes, rendered_scroll_status]));
6752
6759
  }
6753
6760
  },
6754
6761
  children: listing_contents
@@ -8286,7 +8293,7 @@ function $2ab89d64b7f1d5ef$export$d31a1a1a83ad9413(plp_results_, [get_selected_f
8286
8293
  const $df5d81d0fe61ff21$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=product-count><!$><!/> <!$><!/>`),
8287
8294
  $df5d81d0fe61ff21$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<div>`),
8288
8295
  $df5d81d0fe61ff21$var$_tmpl$3 = /*#__PURE__*/$9HbP8$template(`<div class=filter-results-for-one-row><!$><!/><!$><!/>`),
8289
- $df5d81d0fe61ff21$var$_tmpl$4 = /*#__PURE__*/$9HbP8$template(`<div class="depict plp category"><div class=listing-page><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/></div><!$><!/><!$><!/>`);
8296
+ $df5d81d0fe61ff21$var$_tmpl$4 = /*#__PURE__*/$9HbP8$template(`<div class="depict plp category"><div class=listing-page><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/></div><!$><!/>`);
8290
8297
  function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
8291
8298
  depict_api_: depict_api_,
8292
8299
  id_to_query_for_: id_to_query_for_,
@@ -8557,9 +8564,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
8557
8564
  _el$25 = _el$24.nextSibling,
8558
8565
  [_el$26, _co$10] = $9HbP8$getNextMarker(_el$25.nextSibling),
8559
8566
  _el$27 = _el$14.nextSibling,
8560
- [_el$28, _co$11] = $9HbP8$getNextMarker(_el$27.nextSibling),
8561
- _el$29 = _el$28.nextSibling,
8562
- [_el$30, _co$12] = $9HbP8$getNextMarker(_el$29.nextSibling);
8567
+ [_el$28, _co$11] = $9HbP8$getNextMarker(_el$27.nextSibling);
8563
8568
  $9HbP8$use(el => process.env.NODE_ENV === "development" && $cc6f5b69378cd164$export$7af06a63c5a976c9(el, id_to_query_for_, i18n_), _el$13);
8564
8569
  $9HbP8$insert(_el$14, $9HbP8$createComponent((0, $9HbP8$Show), {
8565
8570
  get when() {
@@ -8652,25 +8657,24 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
8652
8657
  }), _el$26, _co$10);
8653
8658
  $9HbP8$insert(_el$13, $9HbP8$createComponent((0, $9HbP8$Show), {
8654
8659
  get when() {
8655
- return layout_options_().layout === "grid";
8660
+ return !layout_options_().layout?.startsWith("slider");
8656
8661
  },
8657
8662
  get children() {
8658
- return $9HbP8$createComponent(ConfiguredScrollStatus, {});
8663
+ return [$9HbP8$createComponent(ConfiguredScrollStatus, {}), $9HbP8$createComponent((0, $b7436a6d1fd64e3b$export$b69d0d92862de18b), {
8664
+ severity_: "error",
8665
+ message_: "Floating buttons failed",
8666
+ get children() {
8667
+ return $0b0380f75d729d63$export$b23abd26de154ede({
8668
+ search_filters_open_: category_filters_open_,
8669
+ search_sorting_open_: category_sorting_open_,
8670
+ current_sorting_: current_sorting_,
8671
+ sort_and_filter_element_: sort_and_filter_element_,
8672
+ i18n_: i18n_
8673
+ });
8674
+ }
8675
+ })];
8659
8676
  }
8660
8677
  }), _el$28, _co$11);
8661
- $9HbP8$insert(_el$13, $9HbP8$createComponent((0, $b7436a6d1fd64e3b$export$b69d0d92862de18b), {
8662
- severity_: "error",
8663
- message_: "Floating buttons failed",
8664
- get children() {
8665
- return $0b0380f75d729d63$export$b23abd26de154ede({
8666
- search_filters_open_: category_filters_open_,
8667
- search_sorting_open_: category_sorting_open_,
8668
- current_sorting_: current_sorting_,
8669
- sort_and_filter_element_: sort_and_filter_element_,
8670
- i18n_: i18n_
8671
- });
8672
- }
8673
- }), _el$30, _co$12);
8674
8678
  $9HbP8$effect(() => $9HbP8$setAttribute(_el$13, "id", (0, $f86ba724282f6690$export$44dad306455dddf).PLP_CATEGORY));
8675
8679
  return _el$13;
8676
8680
  })()];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "3.0.18",
3
+ "version": "3.0.20",
4
4
  "description": "Base package containing the actual UI of Depict UI along with translations, with a not-simplified API. We recommend using @depict-ai/js-ui or @depict-ai/react-ui instead.",
5
5
  "packageManager": "yarn@3.2.2",
6
6
  "sass": "styles.scss",
@@ -236,9 +236,9 @@
236
236
  "@babel/plugin-transform-typescript": "^7.22.9",
237
237
  "@babel/runtime": "latest",
238
238
  "@babel/runtime-corejs3": "^7.22.6",
239
- "@depict-ai/plp-styling": "^2.0.3",
240
- "@depict-ai/types": "^5.0.2",
241
- "@depict-ai/utilishared": "^2.0.6",
239
+ "@depict-ai/plp-styling": "^2.0.4",
240
+ "@depict-ai/types": "^5.0.3",
241
+ "@depict-ai/utilishared": "^2.0.7",
242
242
  "solid-js": "^1.8.1"
243
243
  },
244
244
  "type": "module",
@@ -83,7 +83,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $33eed84f447aa0c0$expo
83
83
  $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447aa0c0$export$7bf543b9d9be2c22);
84
84
  $parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
85
85
  /*! Depict.ai search and product listing SDK */
86
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "3.0.18";
86
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "3.0.20";
87
87
  const $9d19451330d04c3c$var$_tmpl$ = ["<svg", ' xmlns="http://www.w3.org/2000/svg"', ' viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0" fill="#0f0f0f"></path></svg>'];
88
88
  function $9d19451330d04c3c$export$8be2714ec7f169ee() {
89
89
  var _$escape2, _$escape3;
@@ -1985,7 +1985,8 @@ function $236a257ee52e5414$export$d41d19e89346fa2(_ref) {
1985
1985
  disable_fading_: true,
1986
1986
  slider_ref_: slider => {
1987
1987
  const {
1988
- insert_here: insert_here
1988
+ insert_here: insert_here,
1989
+ container: container
1989
1990
  } = slider;
1990
1991
  const Layout = props => $6c2c739b113a8ddf$export$445d8d3f5f706a40(props, insert_here, true);
1991
1992
  // Do like this, so we don't have to call mergeProps ourselves
@@ -1995,6 +1996,7 @@ function $236a257ee52e5414$export$d41d19e89346fa2(_ref) {
1995
1996
  }, layout_options_));
1996
1997
  $3hooq$depictaiutilishared.slider_fractional_factory(0, 0.75).constructor_plugin.call(slider, {}); // enable fractional scrolling
1997
1998
  insert_here.before($8edd3cf30d1fd8b4$export$a2cc176055f8f08());
1999
+ container.classList.add("products");
1998
2000
  },
1999
2001
  get children() {
2000
2002
  return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Suspense), {
@@ -5240,7 +5242,8 @@ function $e03dec587b6e91e3$export$83fd5de5504a7a67(_ref) {
5240
5242
  of_: of_
5241
5243
  },
5242
5244
  get_scroll_position_ = () => scrollY,
5243
- listen_to_scroll_on_: listen_to_scroll_on_
5245
+ listen_to_scroll_on_: listen_to_scroll_on_,
5246
+ velocity_too_fast_ = 1.5
5244
5247
  } = _ref;
5245
5248
  if (0, $3hooq$solidjsweb.isServer) return; // won't show in initial render and need scroll position
5246
5249
  const [first_to_show, set_first_to_show] = $3hooq$solidjs.createSignal(0);
@@ -5248,6 +5251,7 @@ function $e03dec587b6e91e3$export$83fd5de5504a7a67(_ref) {
5248
5251
  const [count_to_show, set_count_to_show] = $3hooq$solidjs.createSignal("");
5249
5252
  const [permitted_to_show, set_permitted_to_show] = $3hooq$solidjs.createSignal(false); // due to scroll speed
5250
5253
  const [show_triggered, set_show_triggered] = $3hooq$solidjs.createSignal(false); // signal to just switch between true/false to trigger a new animation which will persist the indicator
5254
+ const [times_too_fast, set_times_too_fast] = $3hooq$solidjs.createSignal(0);
5251
5255
  const modified_price_formatting_ = $3hooq$solidjs.createMemo(() => ({
5252
5256
  ...price_formatting_(),
5253
5257
  places_after_comma_: 0
@@ -5257,25 +5261,27 @@ function $e03dec587b6e91e3$export$83fd5de5504a7a67(_ref) {
5257
5261
  let last_pos_time = +new Date();
5258
5262
  let last_pos = get_scroll_position_();
5259
5263
  let unpermit_when_possible = false;
5260
- let times_too_fast = 0;
5261
5264
  const handle_scrollpos_change = () => {
5262
5265
  if (animation) set_show_triggered(prev => !prev); // make sure that once we've decided to show the indicator it doesn't disappear before we stop scrolling
5263
5266
  const distance_travelled = Math.abs(get_scroll_position_() - last_pos);
5264
5267
  const now = +new Date();
5265
5268
  const age_of_distance = now - last_pos_time;
5266
5269
  const velocity = distance_travelled / age_of_distance; // pixels per millisecond
5267
- if (velocity > 1.5) {
5268
- times_too_fast++;
5269
- setTimeout(() => times_too_fast--, 1000);
5270
+ if (velocity > velocity_too_fast_) {
5271
+ set_times_too_fast(prev => prev + 1);
5272
+ setTimeout(() => set_times_too_fast(prev => prev - 1), 1000);
5270
5273
  }
5271
- if (times_too_fast > 10) {
5272
- set_permitted_to_show(true);
5273
- unpermit_when_possible = false;
5274
- } else if (animation) unpermit_when_possible = true;else set_permitted_to_show(false);
5275
5274
  last_pos_time = now;
5276
5275
  last_pos = get_scroll_position_();
5277
5276
  };
5278
5277
  $1689794f03ba2554$export$205efb947c7ffd78(handle_scrollpos_change, undefined, listen_to_scroll_on_);
5278
+ $3hooq$solidjs.createComputed(() => {
5279
+ // We need to set this reactively to ensure that it's forbidden to show even when times_too_fast has tapered off after a few seconds, see https://github.com/depict-org/depict/pull/82
5280
+ if (times_too_fast() > 10) {
5281
+ set_permitted_to_show(true);
5282
+ unpermit_when_possible = false;
5283
+ } else if (animation) unpermit_when_possible = true;else set_permitted_to_show(false);
5284
+ });
5279
5285
  $3hooq$solidjs.createEffect(() => {
5280
5286
  show_triggered();
5281
5287
  const first = get_first_result_in_viewport();
@@ -6086,6 +6092,7 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
6086
6092
  }
6087
6093
  }));
6088
6094
  insert_here.classList.add("generated-spacing");
6095
+ container.classList.add("products");
6089
6096
  $3hooq$solidjs.createEffect(
6090
6097
  // @ts-ignore
6091
6098
  $3hooq$solidjs.on(query_base_, () => insert_here.scrollTo({
@@ -6099,13 +6106,13 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
6099
6106
  // Put scroll status into slider container, so it's centered relatively to the products
6100
6107
  const rendered_scroll_status = ConfiguredScrollStatus({
6101
6108
  get_scroll_position_: () => insert_here.scrollLeft,
6102
- listen_to_scroll_on_: insert_here
6109
+ listen_to_scroll_on_: insert_here,
6110
+ velocity_too_fast_: 3 // Require twice as hard scrolling to show ScrollStatus in slider since it's easier to scroll fast there
6103
6111
  });
6104
- const {
6105
- childNodes: childNodes
6106
- } = container;
6112
+
6113
+ const non_solid_nodes = [...container.childNodes];
6107
6114
  // We have to use `insert` over Element.append, because ConfiguredScrollStatus is in an ErrorBoundary and therefore returns a function. `insert` will wipe all children, therefore save them first and then tell insert that the element should contain these elements + whatever ScrollStatus returns
6108
- $3hooq$solidjsweb.insert(container, $3hooq$solidjs.createMemo(() => [...childNodes, rendered_scroll_status]));
6115
+ $3hooq$solidjsweb.insert(container, $3hooq$solidjs.createMemo(() => [...non_solid_nodes, rendered_scroll_status]));
6109
6116
  }
6110
6117
  },
6111
6118
  children: listing_contents
@@ -7369,7 +7376,7 @@ function $eef41d50f07bf19a$export$d31a1a1a83ad9413(plp_results_, _ref) {
7369
7376
  const $ede6c70ecdca46fe$var$_tmpl$ = ["<div", ' class="product-count"><!--$-->', "<!--/--> <!--$-->", "<!--/--></div>"],
7370
7377
  $ede6c70ecdca46fe$var$_tmpl$2 = ["<div", "></div>"],
7371
7378
  $ede6c70ecdca46fe$var$_tmpl$3 = ["<div", ' class="filter-results-for-one-row"><!--$-->', "<!--/--><!--$-->", "<!--/--></div>"],
7372
- $ede6c70ecdca46fe$var$_tmpl$4 = ["<div", ' class="depict plp category"><div class="listing-page"><!--$-->', "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--></div><!--$-->", "<!--/--><!--$-->", "<!--/--></div>"];
7379
+ $ede6c70ecdca46fe$var$_tmpl$4 = ["<div", ' class="depict plp category"><div class="listing-page"><!--$-->', "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div>"];
7373
7380
  function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
7374
7381
  let {
7375
7382
  depict_api_: depict_api_,
@@ -7719,22 +7726,23 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
7719
7726
  }
7720
7727
  })), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
7721
7728
  get when() {
7722
- return layout_options_().layout === "grid";
7729
+ var _layout_options_$layo;
7730
+ return !((_layout_options_$layo = layout_options_().layout) !== null && _layout_options_$layo !== void 0 && _layout_options_$layo.startsWith("slider"));
7723
7731
  },
7724
7732
  get children() {
7725
- return $3hooq$solidjsweb.createComponent(ConfiguredScrollStatus, {});
7726
- }
7727
- })), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $1b3cf201cdd38687$export$b69d0d92862de18b), {
7728
- severity_: "error",
7729
- message_: "Floating buttons failed",
7730
- get children() {
7731
- return $b7cbae23560f11b9$export$b23abd26de154ede({
7732
- search_filters_open_: category_filters_open_,
7733
- search_sorting_open_: category_sorting_open_,
7734
- current_sorting_: current_sorting_,
7735
- sort_and_filter_element_: sort_and_filter_element_,
7736
- i18n_: i18n_
7737
- });
7733
+ return [$3hooq$solidjsweb.createComponent(ConfiguredScrollStatus, {}), $3hooq$solidjsweb.createComponent((0, $1b3cf201cdd38687$export$b69d0d92862de18b), {
7734
+ severity_: "error",
7735
+ message_: "Floating buttons failed",
7736
+ get children() {
7737
+ return $b7cbae23560f11b9$export$b23abd26de154ede({
7738
+ search_filters_open_: category_filters_open_,
7739
+ search_sorting_open_: category_sorting_open_,
7740
+ current_sorting_: current_sorting_,
7741
+ sort_and_filter_element_: sort_and_filter_element_,
7742
+ i18n_: i18n_
7743
+ });
7744
+ }
7745
+ })];
7738
7746
  }
7739
7747
  })))];
7740
7748
  }
@@ -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 _SearchFilter2 } from "@depict-ai/types/api/SearchRequestV2";
13
- export const version = "3.0.18";
13
+ export const version = "3.0.20";
14
14
  export type SDKColsAtSize = [number, number?][];
15
15
  /**
16
16
  * Transform SDK ColsAtSize into valid Layout ColsAtSize
@@ -10,7 +10,7 @@ import { createStore as $b8hua$createStore, reconcile as $b8hua$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 = "3.0.18";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "3.0.20";
14
14
  const $ca6ab5f08bd28bca$var$_tmpl$ = ["<svg", ' xmlns="http://www.w3.org/2000/svg"', ' viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0" fill="#0f0f0f"></path></svg>'];
15
15
  function $ca6ab5f08bd28bca$export$8be2714ec7f169ee() {
16
16
  var _$escape2, _$escape3;
@@ -1912,7 +1912,8 @@ function $39ddb986053fb759$export$d41d19e89346fa2(_ref) {
1912
1912
  disable_fading_: true,
1913
1913
  slider_ref_: slider => {
1914
1914
  const {
1915
- insert_here: insert_here
1915
+ insert_here: insert_here,
1916
+ container: container
1916
1917
  } = slider;
1917
1918
  const Layout = props => $63f1f8dbcd07d3b0$export$445d8d3f5f706a40(props, insert_here, true);
1918
1919
  // Do like this, so we don't have to call mergeProps ourselves
@@ -1922,6 +1923,7 @@ function $39ddb986053fb759$export$d41d19e89346fa2(_ref) {
1922
1923
  }, layout_options_));
1923
1924
  $b8hua$slider_fractional_factory(0, 0.75).constructor_plugin.call(slider, {}); // enable fractional scrolling
1924
1925
  insert_here.before($ca55612a53dbbdd2$export$a2cc176055f8f08());
1926
+ container.classList.add("products");
1925
1927
  },
1926
1928
  get children() {
1927
1929
  return $b8hua$createComponent((0, $b8hua$Suspense), {
@@ -5167,7 +5169,8 @@ function $b69740fc6de9f17e$export$83fd5de5504a7a67(_ref) {
5167
5169
  of_: of_
5168
5170
  },
5169
5171
  get_scroll_position_ = () => scrollY,
5170
- listen_to_scroll_on_: listen_to_scroll_on_
5172
+ listen_to_scroll_on_: listen_to_scroll_on_,
5173
+ velocity_too_fast_ = 1.5
5171
5174
  } = _ref;
5172
5175
  if (0, $b8hua$isServer) return; // won't show in initial render and need scroll position
5173
5176
  const [first_to_show, set_first_to_show] = $b8hua$createSignal(0);
@@ -5175,6 +5178,7 @@ function $b69740fc6de9f17e$export$83fd5de5504a7a67(_ref) {
5175
5178
  const [count_to_show, set_count_to_show] = $b8hua$createSignal("");
5176
5179
  const [permitted_to_show, set_permitted_to_show] = $b8hua$createSignal(false); // due to scroll speed
5177
5180
  const [show_triggered, set_show_triggered] = $b8hua$createSignal(false); // signal to just switch between true/false to trigger a new animation which will persist the indicator
5181
+ const [times_too_fast, set_times_too_fast] = $b8hua$createSignal(0);
5178
5182
  const modified_price_formatting_ = $b8hua$createMemo(() => ({
5179
5183
  ...price_formatting_(),
5180
5184
  places_after_comma_: 0
@@ -5184,25 +5188,27 @@ function $b69740fc6de9f17e$export$83fd5de5504a7a67(_ref) {
5184
5188
  let last_pos_time = +new Date();
5185
5189
  let last_pos = get_scroll_position_();
5186
5190
  let unpermit_when_possible = false;
5187
- let times_too_fast = 0;
5188
5191
  const handle_scrollpos_change = () => {
5189
5192
  if (animation) set_show_triggered(prev => !prev); // make sure that once we've decided to show the indicator it doesn't disappear before we stop scrolling
5190
5193
  const distance_travelled = Math.abs(get_scroll_position_() - last_pos);
5191
5194
  const now = +new Date();
5192
5195
  const age_of_distance = now - last_pos_time;
5193
5196
  const velocity = distance_travelled / age_of_distance; // pixels per millisecond
5194
- if (velocity > 1.5) {
5195
- times_too_fast++;
5196
- setTimeout(() => times_too_fast--, 1000);
5197
+ if (velocity > velocity_too_fast_) {
5198
+ set_times_too_fast(prev => prev + 1);
5199
+ setTimeout(() => set_times_too_fast(prev => prev - 1), 1000);
5197
5200
  }
5198
- if (times_too_fast > 10) {
5199
- set_permitted_to_show(true);
5200
- unpermit_when_possible = false;
5201
- } else if (animation) unpermit_when_possible = true;else set_permitted_to_show(false);
5202
5201
  last_pos_time = now;
5203
5202
  last_pos = get_scroll_position_();
5204
5203
  };
5205
5204
  $33e7d1906c93db7d$export$205efb947c7ffd78(handle_scrollpos_change, undefined, listen_to_scroll_on_);
5205
+ $b8hua$createComputed(() => {
5206
+ // We need to set this reactively to ensure that it's forbidden to show even when times_too_fast has tapered off after a few seconds, see https://github.com/depict-org/depict/pull/82
5207
+ if (times_too_fast() > 10) {
5208
+ set_permitted_to_show(true);
5209
+ unpermit_when_possible = false;
5210
+ } else if (animation) unpermit_when_possible = true;else set_permitted_to_show(false);
5211
+ });
5206
5212
  $b8hua$createEffect(() => {
5207
5213
  show_triggered();
5208
5214
  const first = get_first_result_in_viewport();
@@ -6013,6 +6019,7 @@ function $7faea0096f14b59b$export$3925f87b1545cfc6(_ref) {
6013
6019
  }
6014
6020
  }));
6015
6021
  insert_here.classList.add("generated-spacing");
6022
+ container.classList.add("products");
6016
6023
  $b8hua$createEffect(
6017
6024
  // @ts-ignore
6018
6025
  $b8hua$on(query_base_, () => insert_here.scrollTo({
@@ -6026,13 +6033,13 @@ function $7faea0096f14b59b$export$3925f87b1545cfc6(_ref) {
6026
6033
  // Put scroll status into slider container, so it's centered relatively to the products
6027
6034
  const rendered_scroll_status = ConfiguredScrollStatus({
6028
6035
  get_scroll_position_: () => insert_here.scrollLeft,
6029
- listen_to_scroll_on_: insert_here
6036
+ listen_to_scroll_on_: insert_here,
6037
+ velocity_too_fast_: 3 // Require twice as hard scrolling to show ScrollStatus in slider since it's easier to scroll fast there
6030
6038
  });
6031
- const {
6032
- childNodes: childNodes
6033
- } = container;
6039
+
6040
+ const non_solid_nodes = [...container.childNodes];
6034
6041
  // We have to use `insert` over Element.append, because ConfiguredScrollStatus is in an ErrorBoundary and therefore returns a function. `insert` will wipe all children, therefore save them first and then tell insert that the element should contain these elements + whatever ScrollStatus returns
6035
- $b8hua$insert(container, $b8hua$createMemo(() => [...childNodes, rendered_scroll_status]));
6042
+ $b8hua$insert(container, $b8hua$createMemo(() => [...non_solid_nodes, rendered_scroll_status]));
6036
6043
  }
6037
6044
  },
6038
6045
  children: listing_contents
@@ -7296,7 +7303,7 @@ function $3a2bed57c9a57e21$export$d31a1a1a83ad9413(plp_results_, _ref) {
7296
7303
  const $4b4b262708b516ee$var$_tmpl$ = ["<div", ' class="product-count"><!--$-->', "<!--/--> <!--$-->", "<!--/--></div>"],
7297
7304
  $4b4b262708b516ee$var$_tmpl$2 = ["<div", "></div>"],
7298
7305
  $4b4b262708b516ee$var$_tmpl$3 = ["<div", ' class="filter-results-for-one-row"><!--$-->', "<!--/--><!--$-->", "<!--/--></div>"],
7299
- $4b4b262708b516ee$var$_tmpl$4 = ["<div", ' class="depict plp category"><div class="listing-page"><!--$-->', "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--></div><!--$-->", "<!--/--><!--$-->", "<!--/--></div>"];
7306
+ $4b4b262708b516ee$var$_tmpl$4 = ["<div", ' class="depict plp category"><div class="listing-page"><!--$-->', "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div>"];
7300
7307
  function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
7301
7308
  let {
7302
7309
  depict_api_: depict_api_,
@@ -7646,22 +7653,23 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
7646
7653
  }
7647
7654
  })), $b8hua$escape($b8hua$createComponent((0, $b8hua$Show), {
7648
7655
  get when() {
7649
- return layout_options_().layout === "grid";
7656
+ var _layout_options_$layo;
7657
+ return !((_layout_options_$layo = layout_options_().layout) !== null && _layout_options_$layo !== void 0 && _layout_options_$layo.startsWith("slider"));
7650
7658
  },
7651
7659
  get children() {
7652
- return $b8hua$createComponent(ConfiguredScrollStatus, {});
7653
- }
7654
- })), $b8hua$escape($b8hua$createComponent((0, $74777e8fe65b3dcb$export$b69d0d92862de18b), {
7655
- severity_: "error",
7656
- message_: "Floating buttons failed",
7657
- get children() {
7658
- return $6a16b21155984cef$export$b23abd26de154ede({
7659
- search_filters_open_: category_filters_open_,
7660
- search_sorting_open_: category_sorting_open_,
7661
- current_sorting_: current_sorting_,
7662
- sort_and_filter_element_: sort_and_filter_element_,
7663
- i18n_: i18n_
7664
- });
7660
+ return [$b8hua$createComponent(ConfiguredScrollStatus, {}), $b8hua$createComponent((0, $74777e8fe65b3dcb$export$b69d0d92862de18b), {
7661
+ severity_: "error",
7662
+ message_: "Floating buttons failed",
7663
+ get children() {
7664
+ return $6a16b21155984cef$export$b23abd26de154ede({
7665
+ search_filters_open_: category_filters_open_,
7666
+ search_sorting_open_: category_sorting_open_,
7667
+ current_sorting_: current_sorting_,
7668
+ sort_and_filter_element_: sort_and_filter_element_,
7669
+ i18n_: i18n_
7670
+ });
7671
+ }
7672
+ })];
7665
7673
  }
7666
7674
  })))];
7667
7675
  }