@depict-ai/ui 4.8.5 → 4.8.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/ES10/index.cjs CHANGED
@@ -114,7 +114,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
114
114
  $parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
115
115
  $parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
116
116
  /*! Depict.ai search and product listing SDK */
117
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.8.5";
117
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.8.6";
118
118
  function $054b1113e4897051$export$54c6d6ff54e72743(whatToWatch) {
119
119
  const [width, setWidth] = $52FdA$solidjs.createSignal(0);
120
120
  const [height, setHeight] = $52FdA$solidjs.createSignal(0);
@@ -4350,7 +4350,8 @@ function $29e5dbeb69da7a36$export$b94867ecbd698f21(_ref) {
4350
4350
  });
4351
4351
  }
4352
4352
  }, () => searchFieldEmpty() ? {
4353
- "aria-hidden": "true"
4353
+ "aria-hidden": "true",
4354
+ tabIndex: -1
4354
4355
  } : {
4355
4356
  title: i18n_.clear_filters_query_sorting_after_submit_()
4356
4357
  }), false, true);
@@ -6335,6 +6336,7 @@ async function $4cf7d9829d60d844$export$79b1565500412d9b(search_modal, modal_fn_
6335
6336
  close_modal_: close_modal_
6336
6337
  };
6337
6338
  }
6339
+ let $367b536a2a94d24e$export$68620bd6d5c6bb86;
6338
6340
  function $367b536a2a94d24e$export$e183a13865960371(params_to_default_value, router_) {
6339
6341
  const signals = {};
6340
6342
  const entries = Object.entries(params_to_default_value);
@@ -6367,6 +6369,10 @@ function $367b536a2a94d24e$export$e183a13865960371(params_to_default_value, rout
6367
6369
  }
6368
6370
  }
6369
6371
  if (signal_changed) router_.navigate_.replace_state_(state);
6372
+ $52FdA$solidjs.onCleanup(() => $367b536a2a94d24e$export$68620bd6d5c6bb86 = {
6373
+ time: new Date().toISOString(),
6374
+ stack: new Error().stack
6375
+ });
6370
6376
  });
6371
6377
  // history_dot_state_to_state needs to update after its signals after url_state does BUT in the same task (might even have to be in the same tick in the microtask queue). If we'd use window.addEventListener("popstate") it would be guaranteed to be too late since each event listener has its own task
6372
6378
  (0, $52FdA$depictaiutilishared.instant_exec_on_suspect_history_change).add(event_handler);
@@ -10090,8 +10096,16 @@ function $a162c9a08dc208c2$export$b288c38ae3fddb56(_ref) {
10090
10096
  selected_filters_: [read_selected_filters]
10091
10097
  } = _ref;
10092
10098
  let last_remote_state;
10099
+ let executions = 0;
10100
+ let oneSecondInfiniteLoopPreventionTimeout;
10093
10101
  $52FdA$solidjs.createComputed(() => {
10094
10102
  var _available_filters_;
10103
+ // Sometimes (24 events in sentry, https://depictai-0o.sentry.io/issues/?project=5476183&query=is%3Aunresolved+filters+failed&referrer=issue-list&statsPeriod=14d), for some inexplicable reason, this computation infinite loops
10104
+ // I spent a 1h17min debug session with MadePeople in a tab where they could reproduce
10105
+ // Observations were that of the signal read_local_cache the observers at some point randomly started having this computation first instead of the effect that writes the value to the history
10106
+ // It's VERY HARD to get a tab in a state where it can be reproduced, like with the exact same circumstances it happens "once a day" for them and there's no noticable pattern. But when a tab is found, it can be reliably reproduced by going backwards/forwards.
10107
+ // Also we reliably clean up and dispose of the search page and the effect of history_dot_state_to_state stays in the signals' observers, but for some reason it disappears when the bug happens (onCleanup doesn't get called then either, if I debugged that correctly)
10108
+ // As a value first workaround, we just recognise when the computation has been executed "too often" and just start not doing anything after that
10095
10109
  const remote_filters = Object.fromEntries(((_available_filters_ = available_filters_()) === null || _available_filters_ === void 0 ? void 0 : _available_filters_.map(filter => {
10096
10110
  var _filter$meta;
10097
10111
  return [JSON.stringify([filter.field, filter.op, filter === null || filter === void 0 ? void 0 : (_filter$meta = filter.meta) === null || _filter$meta === void 0 ? void 0 : _filter$meta.type]), filter];
@@ -10198,9 +10212,36 @@ function $a162c9a08dc208c2$export$b288c38ae3fddb56(_ref) {
10198
10212
  }
10199
10213
  if (last_remote_state !== available_filters_() ||
10200
10214
  // we HAVE to update the local filter state (it can contain same info but needs to be different object reference) every time the API state changes, otherwise the CheckboxHierarchicalFilter component doesn't update
10201
- JSON.stringify(new_local_filter_state) !== JSON.stringify(read_local_cache()))
10202
- // Sorry……… They're not that big
10215
+ // Sorry……… They're not that big
10216
+ JSON.stringify(new_local_filter_state) !== JSON.stringify(read_local_cache())) {
10217
+ var _sources, _sources$find;
10218
+ const owner = $52FdA$solidjs.getOwner();
10219
+ const signal = owner === null || owner === void 0 ? void 0 : (_sources = owner.sources) === null || _sources === void 0 ? void 0 : (_sources$find = _sources.find) === null || _sources$find === void 0 ? void 0 : _sources$find.call(_sources, source => source.value === read_local_cache());
10220
+ if (executions > 30) {
10221
+ var _signal$observers, _signal$observers$map;
10222
+ // We're probably in an infinite loop, let's just stop
10223
+ $52FdA$depictaiutilishared.report(new Error("Infinite loop detected in create_modified_filters"), "error", {
10224
+ executions: executions,
10225
+ new_local_filter_state: new_local_filter_state,
10226
+ available_filters: available_filters_(),
10227
+ last_remote_state: last_remote_state,
10228
+ history_length: history.length,
10229
+ location: location.href,
10230
+ foundSignal: !!signal,
10231
+ observerSlots: signal === null || signal === void 0 ? void 0 : signal.observerSlots,
10232
+ observers: signal === null || signal === void 0 ? void 0 : (_signal$observers = signal.observers) === null || _signal$observers === void 0 ? void 0 : (_signal$observers$map = _signal$observers.map) === null || _signal$observers$map === void 0 ? void 0 : _signal$observers$map.call(_signal$observers, o => (o === null || o === void 0 ? void 0 : o.fn) + ""),
10233
+ lastHistoryDotStateToStateCleanupInfo: $367b536a2a94d24e$export$68620bd6d5c6bb86
10234
+ });
10235
+ return;
10236
+ }
10203
10237
  write_local_cache(new_local_filter_state);
10238
+ // Keep track how many times we wrote this signal
10239
+ executions++;
10240
+ oneSecondInfiniteLoopPreventionTimeout || (oneSecondInfiniteLoopPreventionTimeout = setTimeout($52FdA$depictaiutilishared.catchify(() => {
10241
+ executions = 0;
10242
+ oneSecondInfiniteLoopPreventionTimeout = undefined;
10243
+ }), 1000));
10244
+ }
10204
10245
  last_remote_state = available_filters_();
10205
10246
  });
10206
10247
  }
package/ES10/index.d.ts CHANGED
@@ -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.8.5";
14
+ export const version = "4.8.6";
15
15
  /**
16
16
  * Returns two accessors (one width and one height) that will update when the size of the provided element changes, to be used with ResponsiveImg
17
17
  */
@@ -1506,7 +1506,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
1506
1506
  * Open the modal with support for alignment.
1507
1507
  * @returns {void}
1508
1508
  */
1509
- export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1509
+ export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1510
1510
  export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
1511
1511
  export interface PageReplacer {
1512
1512
  readonly render_: () => Node_Array;
@@ -1585,5 +1585,5 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
1585
1585
  content_blocks_by_row?: ContentBlocksByRow;
1586
1586
  layout?: PossibleLayout;
1587
1587
  filterModalParent_?: HTMLElement | ShadowRoot;
1588
- }): import("@depict-ai/utilishared/latest").Node_Array;
1588
+ }): import("@depict-ai/utilishared").Node_Array;
1589
1589
  export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";
package/ES10/index.js CHANGED
@@ -10,7 +10,7 @@ import $8tj43$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.8.5";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "4.8.6";
14
14
  function $4be619ec2cd7bba3$export$54c6d6ff54e72743(whatToWatch) {
15
15
  const [width, setWidth] = $8tj43$createSignal(0);
16
16
  const [height, setHeight] = $8tj43$createSignal(0);
@@ -4246,7 +4246,8 @@ function $584c06c09cf4609d$export$b94867ecbd698f21(_ref) {
4246
4246
  });
4247
4247
  }
4248
4248
  }, () => searchFieldEmpty() ? {
4249
- "aria-hidden": "true"
4249
+ "aria-hidden": "true",
4250
+ tabIndex: -1
4250
4251
  } : {
4251
4252
  title: i18n_.clear_filters_query_sorting_after_submit_()
4252
4253
  }), false, true);
@@ -6231,6 +6232,7 @@ async function $d5f1e6a0f9117286$export$79b1565500412d9b(search_modal, modal_fn_
6231
6232
  close_modal_: close_modal_
6232
6233
  };
6233
6234
  }
6235
+ let $972f6bce0f9d61be$export$68620bd6d5c6bb86;
6234
6236
  function $972f6bce0f9d61be$export$e183a13865960371(params_to_default_value, router_) {
6235
6237
  const signals = {};
6236
6238
  const entries = Object.entries(params_to_default_value);
@@ -6263,6 +6265,10 @@ function $972f6bce0f9d61be$export$e183a13865960371(params_to_default_value, rout
6263
6265
  }
6264
6266
  }
6265
6267
  if (signal_changed) router_.navigate_.replace_state_(state);
6268
+ $8tj43$onCleanup(() => $972f6bce0f9d61be$export$68620bd6d5c6bb86 = {
6269
+ time: new Date().toISOString(),
6270
+ stack: new Error().stack
6271
+ });
6266
6272
  });
6267
6273
  // history_dot_state_to_state needs to update after its signals after url_state does BUT in the same task (might even have to be in the same tick in the microtask queue). If we'd use window.addEventListener("popstate") it would be guaranteed to be too late since each event listener has its own task
6268
6274
  (0, $8tj43$instant_exec_on_suspect_history_change).add(event_handler);
@@ -9986,8 +9992,16 @@ function $44aa24b1bb793549$export$b288c38ae3fddb56(_ref) {
9986
9992
  selected_filters_: [read_selected_filters]
9987
9993
  } = _ref;
9988
9994
  let last_remote_state;
9995
+ let executions = 0;
9996
+ let oneSecondInfiniteLoopPreventionTimeout;
9989
9997
  $8tj43$createComputed(() => {
9990
9998
  var _available_filters_;
9999
+ // Sometimes (24 events in sentry, https://depictai-0o.sentry.io/issues/?project=5476183&query=is%3Aunresolved+filters+failed&referrer=issue-list&statsPeriod=14d), for some inexplicable reason, this computation infinite loops
10000
+ // I spent a 1h17min debug session with MadePeople in a tab where they could reproduce
10001
+ // Observations were that of the signal read_local_cache the observers at some point randomly started having this computation first instead of the effect that writes the value to the history
10002
+ // It's VERY HARD to get a tab in a state where it can be reproduced, like with the exact same circumstances it happens "once a day" for them and there's no noticable pattern. But when a tab is found, it can be reliably reproduced by going backwards/forwards.
10003
+ // Also we reliably clean up and dispose of the search page and the effect of history_dot_state_to_state stays in the signals' observers, but for some reason it disappears when the bug happens (onCleanup doesn't get called then either, if I debugged that correctly)
10004
+ // As a value first workaround, we just recognise when the computation has been executed "too often" and just start not doing anything after that
9991
10005
  const remote_filters = Object.fromEntries(((_available_filters_ = available_filters_()) === null || _available_filters_ === void 0 ? void 0 : _available_filters_.map(filter => {
9992
10006
  var _filter$meta;
9993
10007
  return [JSON.stringify([filter.field, filter.op, filter === null || filter === void 0 ? void 0 : (_filter$meta = filter.meta) === null || _filter$meta === void 0 ? void 0 : _filter$meta.type]), filter];
@@ -10094,9 +10108,36 @@ function $44aa24b1bb793549$export$b288c38ae3fddb56(_ref) {
10094
10108
  }
10095
10109
  if (last_remote_state !== available_filters_() ||
10096
10110
  // we HAVE to update the local filter state (it can contain same info but needs to be different object reference) every time the API state changes, otherwise the CheckboxHierarchicalFilter component doesn't update
10097
- JSON.stringify(new_local_filter_state) !== JSON.stringify(read_local_cache()))
10098
- // Sorry……… They're not that big
10111
+ // Sorry……… They're not that big
10112
+ JSON.stringify(new_local_filter_state) !== JSON.stringify(read_local_cache())) {
10113
+ var _sources, _sources$find;
10114
+ const owner = $8tj43$getOwner();
10115
+ const signal = owner === null || owner === void 0 ? void 0 : (_sources = owner.sources) === null || _sources === void 0 ? void 0 : (_sources$find = _sources.find) === null || _sources$find === void 0 ? void 0 : _sources$find.call(_sources, source => source.value === read_local_cache());
10116
+ if (executions > 30) {
10117
+ var _signal$observers, _signal$observers$map;
10118
+ // We're probably in an infinite loop, let's just stop
10119
+ $8tj43$report(new Error("Infinite loop detected in create_modified_filters"), "error", {
10120
+ executions: executions,
10121
+ new_local_filter_state: new_local_filter_state,
10122
+ available_filters: available_filters_(),
10123
+ last_remote_state: last_remote_state,
10124
+ history_length: history.length,
10125
+ location: location.href,
10126
+ foundSignal: !!signal,
10127
+ observerSlots: signal === null || signal === void 0 ? void 0 : signal.observerSlots,
10128
+ observers: signal === null || signal === void 0 ? void 0 : (_signal$observers = signal.observers) === null || _signal$observers === void 0 ? void 0 : (_signal$observers$map = _signal$observers.map) === null || _signal$observers$map === void 0 ? void 0 : _signal$observers$map.call(_signal$observers, o => (o === null || o === void 0 ? void 0 : o.fn) + ""),
10129
+ lastHistoryDotStateToStateCleanupInfo: $972f6bce0f9d61be$export$68620bd6d5c6bb86
10130
+ });
10131
+ return;
10132
+ }
10099
10133
  write_local_cache(new_local_filter_state);
10134
+ // Keep track how many times we wrote this signal
10135
+ executions++;
10136
+ oneSecondInfiniteLoopPreventionTimeout || (oneSecondInfiniteLoopPreventionTimeout = setTimeout($8tj43$catchify(() => {
10137
+ executions = 0;
10138
+ oneSecondInfiniteLoopPreventionTimeout = undefined;
10139
+ }), 1000));
10140
+ }
10100
10141
  last_remote_state = available_filters_();
10101
10142
  });
10102
10143
  }
package/latest/index.cjs CHANGED
@@ -108,7 +108,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $1f4925833f07df29$export$5b7
108
108
  $parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de035477d6fef996);
109
109
  $parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
110
110
  /*! Depict.ai search and product listing SDK */
111
- const $b757f75811f3261f$export$83d89fbfd8236492 = "4.8.5";
111
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "4.8.6";
112
112
  function $128302ab61dab8f1$export$54c6d6ff54e72743(whatToWatch) {
113
113
  const [width, setWidth] = $gVhhF$solidjs.createSignal(0);
114
114
  const [height, setHeight] = $gVhhF$solidjs.createSignal(0);
@@ -4128,7 +4128,8 @@ function $66b8b9a9613c141d$export$b94867ecbd698f21({
4128
4128
  });
4129
4129
  }
4130
4130
  }, () => searchFieldEmpty() ? {
4131
- "aria-hidden": "true"
4131
+ "aria-hidden": "true",
4132
+ tabIndex: -1
4132
4133
  } : {
4133
4134
  title: i18n_.clear_filters_query_sorting_after_submit_()
4134
4135
  }), false, true);
@@ -6045,6 +6046,7 @@ async function $9abb0a35d4b60ed3$export$79b1565500412d9b(search_modal, modal_fn_
6045
6046
  close_modal_: close_modal_
6046
6047
  };
6047
6048
  }
6049
+ let $6e22b5314fb52f4c$export$68620bd6d5c6bb86;
6048
6050
  function $6e22b5314fb52f4c$export$e183a13865960371(params_to_default_value, router_) {
6049
6051
  const signals = {};
6050
6052
  const entries = Object.entries(params_to_default_value);
@@ -6076,6 +6078,10 @@ function $6e22b5314fb52f4c$export$e183a13865960371(params_to_default_value, rout
6076
6078
  }
6077
6079
  }
6078
6080
  if (signal_changed) router_.navigate_.replace_state_(state);
6081
+ $gVhhF$solidjs.onCleanup(() => $6e22b5314fb52f4c$export$68620bd6d5c6bb86 = {
6082
+ time: new Date().toISOString(),
6083
+ stack: new Error().stack
6084
+ });
6079
6085
  });
6080
6086
  // history_dot_state_to_state needs to update after its signals after url_state does BUT in the same task (might even have to be in the same tick in the microtask queue). If we'd use window.addEventListener("popstate") it would be guaranteed to be too late since each event listener has its own task
6081
6087
  (0, $gVhhF$depictaiutilishared.instant_exec_on_suspect_history_change).add(event_handler);
@@ -9590,7 +9596,15 @@ function $70482f04605572e2$export$b288c38ae3fddb56({
9590
9596
  selected_filters_: [read_selected_filters]
9591
9597
  }) {
9592
9598
  let last_remote_state;
9599
+ let executions = 0;
9600
+ let oneSecondInfiniteLoopPreventionTimeout;
9593
9601
  $gVhhF$solidjs.createComputed(() => {
9602
+ // Sometimes (24 events in sentry, https://depictai-0o.sentry.io/issues/?project=5476183&query=is%3Aunresolved+filters+failed&referrer=issue-list&statsPeriod=14d), for some inexplicable reason, this computation infinite loops
9603
+ // I spent a 1h17min debug session with MadePeople in a tab where they could reproduce
9604
+ // Observations were that of the signal read_local_cache the observers at some point randomly started having this computation first instead of the effect that writes the value to the history
9605
+ // It's VERY HARD to get a tab in a state where it can be reproduced, like with the exact same circumstances it happens "once a day" for them and there's no noticable pattern. But when a tab is found, it can be reliably reproduced by going backwards/forwards.
9606
+ // Also we reliably clean up and dispose of the search page and the effect of history_dot_state_to_state stays in the signals' observers, but for some reason it disappears when the bug happens (onCleanup doesn't get called then either, if I debugged that correctly)
9607
+ // As a value first workaround, we just recognise when the computation has been executed "too often" and just start not doing anything after that
9594
9608
  const remote_filters = Object.fromEntries(available_filters_()?.map(filter => [JSON.stringify([filter.field, filter.op, filter?.meta?.type]), filter]) || []);
9595
9609
  const local_filters = Object.fromEntries(read_local_cache().map(filter => [JSON.stringify([filter.field, filter.op, filter?.meta?.type]), filter]));
9596
9610
  const selected_filters = Object.fromEntries(read_selected_filters().map(filter_obj => [JSON.stringify([filter_obj.field, filter_obj.op]), filter_obj]));
@@ -9673,9 +9687,34 @@ function $70482f04605572e2$export$b288c38ae3fddb56({
9673
9687
  }
9674
9688
  if (last_remote_state !== available_filters_() ||
9675
9689
  // we HAVE to update the local filter state (it can contain same info but needs to be different object reference) every time the API state changes, otherwise the CheckboxHierarchicalFilter component doesn't update
9676
- JSON.stringify(new_local_filter_state) !== JSON.stringify(read_local_cache()))
9677
- // Sorry……… They're not that big
9690
+ // Sorry……… They're not that big
9691
+ JSON.stringify(new_local_filter_state) !== JSON.stringify(read_local_cache())) {
9692
+ const owner = $gVhhF$solidjs.getOwner();
9693
+ const signal = owner?.sources?.find?.(source => source.value === read_local_cache());
9694
+ if (executions > 30) {
9695
+ // We're probably in an infinite loop, let's just stop
9696
+ $gVhhF$depictaiutilishared.report(new Error("Infinite loop detected in create_modified_filters"), "error", {
9697
+ executions: executions,
9698
+ new_local_filter_state: new_local_filter_state,
9699
+ available_filters: available_filters_(),
9700
+ last_remote_state: last_remote_state,
9701
+ history_length: history.length,
9702
+ location: location.href,
9703
+ foundSignal: !!signal,
9704
+ observerSlots: signal?.observerSlots,
9705
+ observers: signal?.observers?.map?.(o => o?.fn + ""),
9706
+ lastHistoryDotStateToStateCleanupInfo: $6e22b5314fb52f4c$export$68620bd6d5c6bb86
9707
+ });
9708
+ return;
9709
+ }
9678
9710
  write_local_cache(new_local_filter_state);
9711
+ // Keep track how many times we wrote this signal
9712
+ executions++;
9713
+ oneSecondInfiniteLoopPreventionTimeout ||= setTimeout($gVhhF$depictaiutilishared.catchify(() => {
9714
+ executions = 0;
9715
+ oneSecondInfiniteLoopPreventionTimeout = undefined;
9716
+ }), 1000);
9717
+ }
9679
9718
  last_remote_state = available_filters_();
9680
9719
  });
9681
9720
  }
package/latest/index.d.ts CHANGED
@@ -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.8.5";
14
+ export const version = "4.8.6";
15
15
  /**
16
16
  * Returns two accessors (one width and one height) that will update when the size of the provided element changes, to be used with ResponsiveImg
17
17
  */
@@ -1506,7 +1506,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
1506
1506
  * Open the modal with support for alignment.
1507
1507
  * @returns {void}
1508
1508
  */
1509
- export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1509
+ export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1510
1510
  export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
1511
1511
  export interface PageReplacer {
1512
1512
  readonly render_: () => Node_Array;
@@ -1585,5 +1585,5 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
1585
1585
  content_blocks_by_row?: ContentBlocksByRow;
1586
1586
  layout?: PossibleLayout;
1587
1587
  filterModalParent_?: HTMLElement | ShadowRoot;
1588
- }): import("@depict-ai/utilishared/latest").Node_Array;
1588
+ }): import("@depict-ai/utilishared").Node_Array;
1589
1589
  export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";
package/latest/index.js CHANGED
@@ -7,7 +7,7 @@ import { dlog as $9HbP8$dlog, catchify as $9HbP8$catchify1, ListenableSet as $9H
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.8.5";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "4.8.6";
11
11
  function $a444a52bafa0dacc$export$54c6d6ff54e72743(whatToWatch) {
12
12
  const [width, setWidth] = $9HbP8$createSignal(0);
13
13
  const [height, setHeight] = $9HbP8$createSignal(0);
@@ -4027,7 +4027,8 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({
4027
4027
  });
4028
4028
  }
4029
4029
  }, () => searchFieldEmpty() ? {
4030
- "aria-hidden": "true"
4030
+ "aria-hidden": "true",
4031
+ tabIndex: -1
4031
4032
  } : {
4032
4033
  title: i18n_.clear_filters_query_sorting_after_submit_()
4033
4034
  }), false, true);
@@ -5944,6 +5945,7 @@ async function $194bd6b8e4c59830$export$79b1565500412d9b(search_modal, modal_fn_
5944
5945
  close_modal_: close_modal_
5945
5946
  };
5946
5947
  }
5948
+ let $ca6f574bd8772184$export$68620bd6d5c6bb86;
5947
5949
  function $ca6f574bd8772184$export$e183a13865960371(params_to_default_value, router_) {
5948
5950
  const signals = {};
5949
5951
  const entries = Object.entries(params_to_default_value);
@@ -5975,6 +5977,10 @@ function $ca6f574bd8772184$export$e183a13865960371(params_to_default_value, rout
5975
5977
  }
5976
5978
  }
5977
5979
  if (signal_changed) router_.navigate_.replace_state_(state);
5980
+ $9HbP8$onCleanup(() => $ca6f574bd8772184$export$68620bd6d5c6bb86 = {
5981
+ time: new Date().toISOString(),
5982
+ stack: new Error().stack
5983
+ });
5978
5984
  });
5979
5985
  // history_dot_state_to_state needs to update after its signals after url_state does BUT in the same task (might even have to be in the same tick in the microtask queue). If we'd use window.addEventListener("popstate") it would be guaranteed to be too late since each event listener has its own task
5980
5986
  (0, $9HbP8$instant_exec_on_suspect_history_change).add(event_handler);
@@ -9489,7 +9495,15 @@ function $5efb5894079b220e$export$b288c38ae3fddb56({
9489
9495
  selected_filters_: [read_selected_filters]
9490
9496
  }) {
9491
9497
  let last_remote_state;
9498
+ let executions = 0;
9499
+ let oneSecondInfiniteLoopPreventionTimeout;
9492
9500
  $9HbP8$createComputed(() => {
9501
+ // Sometimes (24 events in sentry, https://depictai-0o.sentry.io/issues/?project=5476183&query=is%3Aunresolved+filters+failed&referrer=issue-list&statsPeriod=14d), for some inexplicable reason, this computation infinite loops
9502
+ // I spent a 1h17min debug session with MadePeople in a tab where they could reproduce
9503
+ // Observations were that of the signal read_local_cache the observers at some point randomly started having this computation first instead of the effect that writes the value to the history
9504
+ // It's VERY HARD to get a tab in a state where it can be reproduced, like with the exact same circumstances it happens "once a day" for them and there's no noticable pattern. But when a tab is found, it can be reliably reproduced by going backwards/forwards.
9505
+ // Also we reliably clean up and dispose of the search page and the effect of history_dot_state_to_state stays in the signals' observers, but for some reason it disappears when the bug happens (onCleanup doesn't get called then either, if I debugged that correctly)
9506
+ // As a value first workaround, we just recognise when the computation has been executed "too often" and just start not doing anything after that
9493
9507
  const remote_filters = Object.fromEntries(available_filters_()?.map(filter => [JSON.stringify([filter.field, filter.op, filter?.meta?.type]), filter]) || []);
9494
9508
  const local_filters = Object.fromEntries(read_local_cache().map(filter => [JSON.stringify([filter.field, filter.op, filter?.meta?.type]), filter]));
9495
9509
  const selected_filters = Object.fromEntries(read_selected_filters().map(filter_obj => [JSON.stringify([filter_obj.field, filter_obj.op]), filter_obj]));
@@ -9572,9 +9586,34 @@ function $5efb5894079b220e$export$b288c38ae3fddb56({
9572
9586
  }
9573
9587
  if (last_remote_state !== available_filters_() ||
9574
9588
  // we HAVE to update the local filter state (it can contain same info but needs to be different object reference) every time the API state changes, otherwise the CheckboxHierarchicalFilter component doesn't update
9575
- JSON.stringify(new_local_filter_state) !== JSON.stringify(read_local_cache()))
9576
- // Sorry……… They're not that big
9589
+ // Sorry……… They're not that big
9590
+ JSON.stringify(new_local_filter_state) !== JSON.stringify(read_local_cache())) {
9591
+ const owner = $9HbP8$getOwner();
9592
+ const signal = owner?.sources?.find?.(source => source.value === read_local_cache());
9593
+ if (executions > 30) {
9594
+ // We're probably in an infinite loop, let's just stop
9595
+ $9HbP8$report(new Error("Infinite loop detected in create_modified_filters"), "error", {
9596
+ executions: executions,
9597
+ new_local_filter_state: new_local_filter_state,
9598
+ available_filters: available_filters_(),
9599
+ last_remote_state: last_remote_state,
9600
+ history_length: history.length,
9601
+ location: location.href,
9602
+ foundSignal: !!signal,
9603
+ observerSlots: signal?.observerSlots,
9604
+ observers: signal?.observers?.map?.(o => o?.fn + ""),
9605
+ lastHistoryDotStateToStateCleanupInfo: $ca6f574bd8772184$export$68620bd6d5c6bb86
9606
+ });
9607
+ return;
9608
+ }
9577
9609
  write_local_cache(new_local_filter_state);
9610
+ // Keep track how many times we wrote this signal
9611
+ executions++;
9612
+ oneSecondInfiniteLoopPreventionTimeout ||= setTimeout($9HbP8$catchify(() => {
9613
+ executions = 0;
9614
+ oneSecondInfiniteLoopPreventionTimeout = undefined;
9615
+ }), 1000);
9616
+ }
9578
9617
  last_remote_state = available_filters_();
9579
9618
  });
9580
9619
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "4.8.5",
3
+ "version": "4.8.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",
@@ -114,7 +114,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
114
114
  $parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
115
115
  $parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
116
116
  /*! Depict.ai search and product listing SDK */
117
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.8.5";
117
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.8.6";
118
118
  function $054b1113e4897051$export$54c6d6ff54e72743(whatToWatch) {
119
119
  const [width, setWidth] = $3hooq$solidjs.createSignal(0);
120
120
  const [height, setHeight] = $3hooq$solidjs.createSignal(0);
@@ -3630,7 +3630,8 @@ function $29e5dbeb69da7a36$export$b94867ecbd698f21(_ref) {
3630
3630
  return isNewModal || !searchFieldEmpty() ? "" : "display: none";
3631
3631
  }
3632
3632
  }, () => searchFieldEmpty() ? {
3633
- "aria-hidden": "true"
3633
+ "aria-hidden": "true",
3634
+ tabIndex: -1
3634
3635
  } : {
3635
3636
  title: i18n_.clear_filters_query_sorting_after_submit_()
3636
3637
  }), () => isNewModal ? $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
@@ -5123,6 +5124,7 @@ async function $4cf7d9829d60d844$export$79b1565500412d9b(search_modal, modal_fn_
5123
5124
  close_modal_: close_modal_
5124
5125
  };
5125
5126
  }
5127
+ let $367b536a2a94d24e$export$68620bd6d5c6bb86;
5126
5128
  function $367b536a2a94d24e$export$e183a13865960371(params_to_default_value, router_) {
5127
5129
  const signals = {};
5128
5130
  const entries = Object.entries(params_to_default_value);
@@ -5155,6 +5157,10 @@ function $367b536a2a94d24e$export$e183a13865960371(params_to_default_value, rout
5155
5157
  }
5156
5158
  }
5157
5159
  if (signal_changed) router_.navigate_.replace_state_(state);
5160
+ $3hooq$solidjs.onCleanup(() => $367b536a2a94d24e$export$68620bd6d5c6bb86 = {
5161
+ time: new Date().toISOString(),
5162
+ stack: new Error().stack
5163
+ });
5158
5164
  });
5159
5165
  // history_dot_state_to_state needs to update after its signals after url_state does BUT in the same task (might even have to be in the same tick in the microtask queue). If we'd use window.addEventListener("popstate") it would be guaranteed to be too late since each event listener has its own task
5160
5166
  (0, $3hooq$depictaiutilishared.instant_exec_on_suspect_history_change).add(event_handler);
@@ -7929,8 +7935,16 @@ function $a162c9a08dc208c2$export$b288c38ae3fddb56(_ref) {
7929
7935
  selected_filters_: [read_selected_filters]
7930
7936
  } = _ref;
7931
7937
  let last_remote_state;
7938
+ let executions = 0;
7939
+ let oneSecondInfiniteLoopPreventionTimeout;
7932
7940
  $3hooq$solidjs.createComputed(() => {
7933
7941
  var _available_filters_;
7942
+ // Sometimes (24 events in sentry, https://depictai-0o.sentry.io/issues/?project=5476183&query=is%3Aunresolved+filters+failed&referrer=issue-list&statsPeriod=14d), for some inexplicable reason, this computation infinite loops
7943
+ // I spent a 1h17min debug session with MadePeople in a tab where they could reproduce
7944
+ // Observations were that of the signal read_local_cache the observers at some point randomly started having this computation first instead of the effect that writes the value to the history
7945
+ // It's VERY HARD to get a tab in a state where it can be reproduced, like with the exact same circumstances it happens "once a day" for them and there's no noticable pattern. But when a tab is found, it can be reliably reproduced by going backwards/forwards.
7946
+ // Also we reliably clean up and dispose of the search page and the effect of history_dot_state_to_state stays in the signals' observers, but for some reason it disappears when the bug happens (onCleanup doesn't get called then either, if I debugged that correctly)
7947
+ // As a value first workaround, we just recognise when the computation has been executed "too often" and just start not doing anything after that
7934
7948
  const remote_filters = Object.fromEntries(((_available_filters_ = available_filters_()) === null || _available_filters_ === void 0 ? void 0 : _available_filters_.map(filter => {
7935
7949
  var _filter$meta;
7936
7950
  return [JSON.stringify([filter.field, filter.op, filter === null || filter === void 0 ? void 0 : (_filter$meta = filter.meta) === null || _filter$meta === void 0 ? void 0 : _filter$meta.type]), filter];
@@ -8037,9 +8051,36 @@ function $a162c9a08dc208c2$export$b288c38ae3fddb56(_ref) {
8037
8051
  }
8038
8052
  if (last_remote_state !== available_filters_() ||
8039
8053
  // we HAVE to update the local filter state (it can contain same info but needs to be different object reference) every time the API state changes, otherwise the CheckboxHierarchicalFilter component doesn't update
8040
- JSON.stringify(new_local_filter_state) !== JSON.stringify(read_local_cache()))
8041
- // Sorry……… They're not that big
8054
+ // Sorry……… They're not that big
8055
+ JSON.stringify(new_local_filter_state) !== JSON.stringify(read_local_cache())) {
8056
+ var _sources, _sources$find;
8057
+ const owner = $3hooq$solidjs.getOwner();
8058
+ const signal = owner === null || owner === void 0 ? void 0 : (_sources = owner.sources) === null || _sources === void 0 ? void 0 : (_sources$find = _sources.find) === null || _sources$find === void 0 ? void 0 : _sources$find.call(_sources, source => source.value === read_local_cache());
8059
+ if (executions > 30) {
8060
+ var _signal$observers, _signal$observers$map;
8061
+ // We're probably in an infinite loop, let's just stop
8062
+ $3hooq$depictaiutilishared.report(new Error("Infinite loop detected in create_modified_filters"), "error", {
8063
+ executions: executions,
8064
+ new_local_filter_state: new_local_filter_state,
8065
+ available_filters: available_filters_(),
8066
+ last_remote_state: last_remote_state,
8067
+ history_length: history.length,
8068
+ location: location.href,
8069
+ foundSignal: !!signal,
8070
+ observerSlots: signal === null || signal === void 0 ? void 0 : signal.observerSlots,
8071
+ observers: signal === null || signal === void 0 ? void 0 : (_signal$observers = signal.observers) === null || _signal$observers === void 0 ? void 0 : (_signal$observers$map = _signal$observers.map) === null || _signal$observers$map === void 0 ? void 0 : _signal$observers$map.call(_signal$observers, o => (o === null || o === void 0 ? void 0 : o.fn) + ""),
8072
+ lastHistoryDotStateToStateCleanupInfo: $367b536a2a94d24e$export$68620bd6d5c6bb86
8073
+ });
8074
+ return;
8075
+ }
8042
8076
  write_local_cache(new_local_filter_state);
8077
+ // Keep track how many times we wrote this signal
8078
+ executions++;
8079
+ oneSecondInfiniteLoopPreventionTimeout || (oneSecondInfiniteLoopPreventionTimeout = setTimeout($3hooq$depictaiutilishared.catchify(() => {
8080
+ executions = 0;
8081
+ oneSecondInfiniteLoopPreventionTimeout = undefined;
8082
+ }), 1000));
8083
+ }
8043
8084
  last_remote_state = available_filters_();
8044
8085
  });
8045
8086
  }
@@ -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.8.5";
14
+ export const version = "4.8.6";
15
15
  /**
16
16
  * Returns two accessors (one width and one height) that will update when the size of the provided element changes, to be used with ResponsiveImg
17
17
  */
@@ -1506,7 +1506,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
1506
1506
  * Open the modal with support for alignment.
1507
1507
  * @returns {void}
1508
1508
  */
1509
- export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1509
+ export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1510
1510
  export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
1511
1511
  export interface PageReplacer {
1512
1512
  readonly render_: () => Node_Array;
@@ -1585,5 +1585,5 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
1585
1585
  content_blocks_by_row?: ContentBlocksByRow;
1586
1586
  layout?: PossibleLayout;
1587
1587
  filterModalParent_?: HTMLElement | ShadowRoot;
1588
- }): import("@depict-ai/utilishared/latest").Node_Array;
1588
+ }): import("@depict-ai/utilishared").Node_Array;
1589
1589
  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.8.5";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "4.8.6";
14
14
  function $4be619ec2cd7bba3$export$54c6d6ff54e72743(whatToWatch) {
15
15
  const [width, setWidth] = $b8hua$createSignal(0);
16
16
  const [height, setHeight] = $b8hua$createSignal(0);
@@ -3526,7 +3526,8 @@ function $584c06c09cf4609d$export$b94867ecbd698f21(_ref) {
3526
3526
  return isNewModal || !searchFieldEmpty() ? "" : "display: none";
3527
3527
  }
3528
3528
  }, () => searchFieldEmpty() ? {
3529
- "aria-hidden": "true"
3529
+ "aria-hidden": "true",
3530
+ tabIndex: -1
3530
3531
  } : {
3531
3532
  title: i18n_.clear_filters_query_sorting_after_submit_()
3532
3533
  }), () => isNewModal ? $b8hua$escape($b8hua$createComponent((0, $b8hua$Show), {
@@ -5019,6 +5020,7 @@ async function $d5f1e6a0f9117286$export$79b1565500412d9b(search_modal, modal_fn_
5019
5020
  close_modal_: close_modal_
5020
5021
  };
5021
5022
  }
5023
+ let $972f6bce0f9d61be$export$68620bd6d5c6bb86;
5022
5024
  function $972f6bce0f9d61be$export$e183a13865960371(params_to_default_value, router_) {
5023
5025
  const signals = {};
5024
5026
  const entries = Object.entries(params_to_default_value);
@@ -5051,6 +5053,10 @@ function $972f6bce0f9d61be$export$e183a13865960371(params_to_default_value, rout
5051
5053
  }
5052
5054
  }
5053
5055
  if (signal_changed) router_.navigate_.replace_state_(state);
5056
+ $b8hua$onCleanup(() => $972f6bce0f9d61be$export$68620bd6d5c6bb86 = {
5057
+ time: new Date().toISOString(),
5058
+ stack: new Error().stack
5059
+ });
5054
5060
  });
5055
5061
  // history_dot_state_to_state needs to update after its signals after url_state does BUT in the same task (might even have to be in the same tick in the microtask queue). If we'd use window.addEventListener("popstate") it would be guaranteed to be too late since each event listener has its own task
5056
5062
  (0, $b8hua$instant_exec_on_suspect_history_change).add(event_handler);
@@ -7825,8 +7831,16 @@ function $44aa24b1bb793549$export$b288c38ae3fddb56(_ref) {
7825
7831
  selected_filters_: [read_selected_filters]
7826
7832
  } = _ref;
7827
7833
  let last_remote_state;
7834
+ let executions = 0;
7835
+ let oneSecondInfiniteLoopPreventionTimeout;
7828
7836
  $b8hua$createComputed(() => {
7829
7837
  var _available_filters_;
7838
+ // Sometimes (24 events in sentry, https://depictai-0o.sentry.io/issues/?project=5476183&query=is%3Aunresolved+filters+failed&referrer=issue-list&statsPeriod=14d), for some inexplicable reason, this computation infinite loops
7839
+ // I spent a 1h17min debug session with MadePeople in a tab where they could reproduce
7840
+ // Observations were that of the signal read_local_cache the observers at some point randomly started having this computation first instead of the effect that writes the value to the history
7841
+ // It's VERY HARD to get a tab in a state where it can be reproduced, like with the exact same circumstances it happens "once a day" for them and there's no noticable pattern. But when a tab is found, it can be reliably reproduced by going backwards/forwards.
7842
+ // Also we reliably clean up and dispose of the search page and the effect of history_dot_state_to_state stays in the signals' observers, but for some reason it disappears when the bug happens (onCleanup doesn't get called then either, if I debugged that correctly)
7843
+ // As a value first workaround, we just recognise when the computation has been executed "too often" and just start not doing anything after that
7830
7844
  const remote_filters = Object.fromEntries(((_available_filters_ = available_filters_()) === null || _available_filters_ === void 0 ? void 0 : _available_filters_.map(filter => {
7831
7845
  var _filter$meta;
7832
7846
  return [JSON.stringify([filter.field, filter.op, filter === null || filter === void 0 ? void 0 : (_filter$meta = filter.meta) === null || _filter$meta === void 0 ? void 0 : _filter$meta.type]), filter];
@@ -7933,9 +7947,36 @@ function $44aa24b1bb793549$export$b288c38ae3fddb56(_ref) {
7933
7947
  }
7934
7948
  if (last_remote_state !== available_filters_() ||
7935
7949
  // we HAVE to update the local filter state (it can contain same info but needs to be different object reference) every time the API state changes, otherwise the CheckboxHierarchicalFilter component doesn't update
7936
- JSON.stringify(new_local_filter_state) !== JSON.stringify(read_local_cache()))
7937
- // Sorry……… They're not that big
7950
+ // Sorry……… They're not that big
7951
+ JSON.stringify(new_local_filter_state) !== JSON.stringify(read_local_cache())) {
7952
+ var _sources, _sources$find;
7953
+ const owner = $b8hua$getOwner();
7954
+ const signal = owner === null || owner === void 0 ? void 0 : (_sources = owner.sources) === null || _sources === void 0 ? void 0 : (_sources$find = _sources.find) === null || _sources$find === void 0 ? void 0 : _sources$find.call(_sources, source => source.value === read_local_cache());
7955
+ if (executions > 30) {
7956
+ var _signal$observers, _signal$observers$map;
7957
+ // We're probably in an infinite loop, let's just stop
7958
+ $b8hua$report(new Error("Infinite loop detected in create_modified_filters"), "error", {
7959
+ executions: executions,
7960
+ new_local_filter_state: new_local_filter_state,
7961
+ available_filters: available_filters_(),
7962
+ last_remote_state: last_remote_state,
7963
+ history_length: history.length,
7964
+ location: location.href,
7965
+ foundSignal: !!signal,
7966
+ observerSlots: signal === null || signal === void 0 ? void 0 : signal.observerSlots,
7967
+ observers: signal === null || signal === void 0 ? void 0 : (_signal$observers = signal.observers) === null || _signal$observers === void 0 ? void 0 : (_signal$observers$map = _signal$observers.map) === null || _signal$observers$map === void 0 ? void 0 : _signal$observers$map.call(_signal$observers, o => (o === null || o === void 0 ? void 0 : o.fn) + ""),
7968
+ lastHistoryDotStateToStateCleanupInfo: $972f6bce0f9d61be$export$68620bd6d5c6bb86
7969
+ });
7970
+ return;
7971
+ }
7938
7972
  write_local_cache(new_local_filter_state);
7973
+ // Keep track how many times we wrote this signal
7974
+ executions++;
7975
+ oneSecondInfiniteLoopPreventionTimeout || (oneSecondInfiniteLoopPreventionTimeout = setTimeout($b8hua$catchify(() => {
7976
+ executions = 0;
7977
+ oneSecondInfiniteLoopPreventionTimeout = undefined;
7978
+ }), 1000));
7979
+ }
7939
7980
  last_remote_state = available_filters_();
7940
7981
  });
7941
7982
  }
@@ -108,7 +108,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $1f4925833f07df29$export$5b7
108
108
  $parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de035477d6fef996);
109
109
  $parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
110
110
  /*! Depict.ai search and product listing SDK */
111
- const $b757f75811f3261f$export$83d89fbfd8236492 = "4.8.5";
111
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "4.8.6";
112
112
  function $128302ab61dab8f1$export$54c6d6ff54e72743(whatToWatch) {
113
113
  const [width, setWidth] = $5vyXB$solidjs.createSignal(0);
114
114
  const [height, setHeight] = $5vyXB$solidjs.createSignal(0);
@@ -3431,7 +3431,8 @@ function $66b8b9a9613c141d$export$b94867ecbd698f21({
3431
3431
  return isNewModal || !searchFieldEmpty() ? "" : "display: none";
3432
3432
  }
3433
3433
  }, () => searchFieldEmpty() ? {
3434
- "aria-hidden": "true"
3434
+ "aria-hidden": "true",
3435
+ tabIndex: -1
3435
3436
  } : {
3436
3437
  title: i18n_.clear_filters_query_sorting_after_submit_()
3437
3438
  }), () => isNewModal ? $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
@@ -4863,6 +4864,7 @@ async function $9abb0a35d4b60ed3$export$79b1565500412d9b(search_modal, modal_fn_
4863
4864
  close_modal_: close_modal_
4864
4865
  };
4865
4866
  }
4867
+ let $6e22b5314fb52f4c$export$68620bd6d5c6bb86;
4866
4868
  function $6e22b5314fb52f4c$export$e183a13865960371(params_to_default_value, router_) {
4867
4869
  const signals = {};
4868
4870
  const entries = Object.entries(params_to_default_value);
@@ -4894,6 +4896,10 @@ function $6e22b5314fb52f4c$export$e183a13865960371(params_to_default_value, rout
4894
4896
  }
4895
4897
  }
4896
4898
  if (signal_changed) router_.navigate_.replace_state_(state);
4899
+ $5vyXB$solidjs.onCleanup(() => $6e22b5314fb52f4c$export$68620bd6d5c6bb86 = {
4900
+ time: new Date().toISOString(),
4901
+ stack: new Error().stack
4902
+ });
4897
4903
  });
4898
4904
  // history_dot_state_to_state needs to update after its signals after url_state does BUT in the same task (might even have to be in the same tick in the microtask queue). If we'd use window.addEventListener("popstate") it would be guaranteed to be too late since each event listener has its own task
4899
4905
  (0, $5vyXB$depictaiutilishared.instant_exec_on_suspect_history_change).add(event_handler);
@@ -7496,7 +7502,15 @@ function $70482f04605572e2$export$b288c38ae3fddb56({
7496
7502
  selected_filters_: [read_selected_filters]
7497
7503
  }) {
7498
7504
  let last_remote_state;
7505
+ let executions = 0;
7506
+ let oneSecondInfiniteLoopPreventionTimeout;
7499
7507
  $5vyXB$solidjs.createComputed(() => {
7508
+ // Sometimes (24 events in sentry, https://depictai-0o.sentry.io/issues/?project=5476183&query=is%3Aunresolved+filters+failed&referrer=issue-list&statsPeriod=14d), for some inexplicable reason, this computation infinite loops
7509
+ // I spent a 1h17min debug session with MadePeople in a tab where they could reproduce
7510
+ // Observations were that of the signal read_local_cache the observers at some point randomly started having this computation first instead of the effect that writes the value to the history
7511
+ // It's VERY HARD to get a tab in a state where it can be reproduced, like with the exact same circumstances it happens "once a day" for them and there's no noticable pattern. But when a tab is found, it can be reliably reproduced by going backwards/forwards.
7512
+ // Also we reliably clean up and dispose of the search page and the effect of history_dot_state_to_state stays in the signals' observers, but for some reason it disappears when the bug happens (onCleanup doesn't get called then either, if I debugged that correctly)
7513
+ // As a value first workaround, we just recognise when the computation has been executed "too often" and just start not doing anything after that
7500
7514
  const remote_filters = Object.fromEntries(available_filters_()?.map(filter => [JSON.stringify([filter.field, filter.op, filter?.meta?.type]), filter]) || []);
7501
7515
  const local_filters = Object.fromEntries(read_local_cache().map(filter => [JSON.stringify([filter.field, filter.op, filter?.meta?.type]), filter]));
7502
7516
  const selected_filters = Object.fromEntries(read_selected_filters().map(filter_obj => [JSON.stringify([filter_obj.field, filter_obj.op]), filter_obj]));
@@ -7579,9 +7593,34 @@ function $70482f04605572e2$export$b288c38ae3fddb56({
7579
7593
  }
7580
7594
  if (last_remote_state !== available_filters_() ||
7581
7595
  // we HAVE to update the local filter state (it can contain same info but needs to be different object reference) every time the API state changes, otherwise the CheckboxHierarchicalFilter component doesn't update
7582
- JSON.stringify(new_local_filter_state) !== JSON.stringify(read_local_cache()))
7583
- // Sorry……… They're not that big
7596
+ // Sorry……… They're not that big
7597
+ JSON.stringify(new_local_filter_state) !== JSON.stringify(read_local_cache())) {
7598
+ const owner = $5vyXB$solidjs.getOwner();
7599
+ const signal = owner?.sources?.find?.(source => source.value === read_local_cache());
7600
+ if (executions > 30) {
7601
+ // We're probably in an infinite loop, let's just stop
7602
+ $5vyXB$depictaiutilishared.report(new Error("Infinite loop detected in create_modified_filters"), "error", {
7603
+ executions: executions,
7604
+ new_local_filter_state: new_local_filter_state,
7605
+ available_filters: available_filters_(),
7606
+ last_remote_state: last_remote_state,
7607
+ history_length: history.length,
7608
+ location: location.href,
7609
+ foundSignal: !!signal,
7610
+ observerSlots: signal?.observerSlots,
7611
+ observers: signal?.observers?.map?.(o => o?.fn + ""),
7612
+ lastHistoryDotStateToStateCleanupInfo: $6e22b5314fb52f4c$export$68620bd6d5c6bb86
7613
+ });
7614
+ return;
7615
+ }
7584
7616
  write_local_cache(new_local_filter_state);
7617
+ // Keep track how many times we wrote this signal
7618
+ executions++;
7619
+ oneSecondInfiniteLoopPreventionTimeout ||= setTimeout($5vyXB$depictaiutilishared.catchify(() => {
7620
+ executions = 0;
7621
+ oneSecondInfiniteLoopPreventionTimeout = undefined;
7622
+ }), 1000);
7623
+ }
7585
7624
  last_remote_state = available_filters_();
7586
7625
  });
7587
7626
  }
@@ -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.8.5";
14
+ export const version = "4.8.6";
15
15
  /**
16
16
  * Returns two accessors (one width and one height) that will update when the size of the provided element changes, to be used with ResponsiveImg
17
17
  */
@@ -1506,7 +1506,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
1506
1506
  * Open the modal with support for alignment.
1507
1507
  * @returns {void}
1508
1508
  */
1509
- export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1509
+ export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1510
1510
  export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
1511
1511
  export interface PageReplacer {
1512
1512
  readonly render_: () => Node_Array;
@@ -1585,5 +1585,5 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
1585
1585
  content_blocks_by_row?: ContentBlocksByRow;
1586
1586
  layout?: PossibleLayout;
1587
1587
  filterModalParent_?: HTMLElement | ShadowRoot;
1588
- }): import("@depict-ai/utilishared/latest").Node_Array;
1588
+ }): import("@depict-ai/utilishared").Node_Array;
1589
1589
  export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";
@@ -7,7 +7,7 @@ import { dlog as $i7OB2$dlog, catchify as $i7OB2$catchify1, ListenableSet as $i7
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.8.5";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "4.8.6";
11
11
  function $a444a52bafa0dacc$export$54c6d6ff54e72743(whatToWatch) {
12
12
  const [width, setWidth] = $i7OB2$createSignal(0);
13
13
  const [height, setHeight] = $i7OB2$createSignal(0);
@@ -3330,7 +3330,8 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({
3330
3330
  return isNewModal || !searchFieldEmpty() ? "" : "display: none";
3331
3331
  }
3332
3332
  }, () => searchFieldEmpty() ? {
3333
- "aria-hidden": "true"
3333
+ "aria-hidden": "true",
3334
+ tabIndex: -1
3334
3335
  } : {
3335
3336
  title: i18n_.clear_filters_query_sorting_after_submit_()
3336
3337
  }), () => isNewModal ? $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
@@ -4762,6 +4763,7 @@ async function $194bd6b8e4c59830$export$79b1565500412d9b(search_modal, modal_fn_
4762
4763
  close_modal_: close_modal_
4763
4764
  };
4764
4765
  }
4766
+ let $ca6f574bd8772184$export$68620bd6d5c6bb86;
4765
4767
  function $ca6f574bd8772184$export$e183a13865960371(params_to_default_value, router_) {
4766
4768
  const signals = {};
4767
4769
  const entries = Object.entries(params_to_default_value);
@@ -4793,6 +4795,10 @@ function $ca6f574bd8772184$export$e183a13865960371(params_to_default_value, rout
4793
4795
  }
4794
4796
  }
4795
4797
  if (signal_changed) router_.navigate_.replace_state_(state);
4798
+ $i7OB2$onCleanup(() => $ca6f574bd8772184$export$68620bd6d5c6bb86 = {
4799
+ time: new Date().toISOString(),
4800
+ stack: new Error().stack
4801
+ });
4796
4802
  });
4797
4803
  // history_dot_state_to_state needs to update after its signals after url_state does BUT in the same task (might even have to be in the same tick in the microtask queue). If we'd use window.addEventListener("popstate") it would be guaranteed to be too late since each event listener has its own task
4798
4804
  (0, $i7OB2$instant_exec_on_suspect_history_change).add(event_handler);
@@ -7395,7 +7401,15 @@ function $5efb5894079b220e$export$b288c38ae3fddb56({
7395
7401
  selected_filters_: [read_selected_filters]
7396
7402
  }) {
7397
7403
  let last_remote_state;
7404
+ let executions = 0;
7405
+ let oneSecondInfiniteLoopPreventionTimeout;
7398
7406
  $i7OB2$createComputed(() => {
7407
+ // Sometimes (24 events in sentry, https://depictai-0o.sentry.io/issues/?project=5476183&query=is%3Aunresolved+filters+failed&referrer=issue-list&statsPeriod=14d), for some inexplicable reason, this computation infinite loops
7408
+ // I spent a 1h17min debug session with MadePeople in a tab where they could reproduce
7409
+ // Observations were that of the signal read_local_cache the observers at some point randomly started having this computation first instead of the effect that writes the value to the history
7410
+ // It's VERY HARD to get a tab in a state where it can be reproduced, like with the exact same circumstances it happens "once a day" for them and there's no noticable pattern. But when a tab is found, it can be reliably reproduced by going backwards/forwards.
7411
+ // Also we reliably clean up and dispose of the search page and the effect of history_dot_state_to_state stays in the signals' observers, but for some reason it disappears when the bug happens (onCleanup doesn't get called then either, if I debugged that correctly)
7412
+ // As a value first workaround, we just recognise when the computation has been executed "too often" and just start not doing anything after that
7399
7413
  const remote_filters = Object.fromEntries(available_filters_()?.map(filter => [JSON.stringify([filter.field, filter.op, filter?.meta?.type]), filter]) || []);
7400
7414
  const local_filters = Object.fromEntries(read_local_cache().map(filter => [JSON.stringify([filter.field, filter.op, filter?.meta?.type]), filter]));
7401
7415
  const selected_filters = Object.fromEntries(read_selected_filters().map(filter_obj => [JSON.stringify([filter_obj.field, filter_obj.op]), filter_obj]));
@@ -7478,9 +7492,34 @@ function $5efb5894079b220e$export$b288c38ae3fddb56({
7478
7492
  }
7479
7493
  if (last_remote_state !== available_filters_() ||
7480
7494
  // we HAVE to update the local filter state (it can contain same info but needs to be different object reference) every time the API state changes, otherwise the CheckboxHierarchicalFilter component doesn't update
7481
- JSON.stringify(new_local_filter_state) !== JSON.stringify(read_local_cache()))
7482
- // Sorry……… They're not that big
7495
+ // Sorry……… They're not that big
7496
+ JSON.stringify(new_local_filter_state) !== JSON.stringify(read_local_cache())) {
7497
+ const owner = $i7OB2$getOwner();
7498
+ const signal = owner?.sources?.find?.(source => source.value === read_local_cache());
7499
+ if (executions > 30) {
7500
+ // We're probably in an infinite loop, let's just stop
7501
+ $i7OB2$report(new Error("Infinite loop detected in create_modified_filters"), "error", {
7502
+ executions: executions,
7503
+ new_local_filter_state: new_local_filter_state,
7504
+ available_filters: available_filters_(),
7505
+ last_remote_state: last_remote_state,
7506
+ history_length: history.length,
7507
+ location: location.href,
7508
+ foundSignal: !!signal,
7509
+ observerSlots: signal?.observerSlots,
7510
+ observers: signal?.observers?.map?.(o => o?.fn + ""),
7511
+ lastHistoryDotStateToStateCleanupInfo: $ca6f574bd8772184$export$68620bd6d5c6bb86
7512
+ });
7513
+ return;
7514
+ }
7483
7515
  write_local_cache(new_local_filter_state);
7516
+ // Keep track how many times we wrote this signal
7517
+ executions++;
7518
+ oneSecondInfiniteLoopPreventionTimeout ||= setTimeout($i7OB2$catchify(() => {
7519
+ executions = 0;
7520
+ oneSecondInfiniteLoopPreventionTimeout = undefined;
7521
+ }), 1000);
7522
+ }
7484
7523
  last_remote_state = available_filters_();
7485
7524
  });
7486
7525
  }