@depict-ai/ui 4.10.18 → 4.10.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.
@@ -109,7 +109,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $1f4925833f07df29$export$5b7
109
109
  $parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de035477d6fef996);
110
110
  $parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
111
111
  /*! Depict.ai search and product listing SDK */
112
- const $b757f75811f3261f$export$83d89fbfd8236492 = "4.10.18";
112
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "4.10.20";
113
113
  function $b54e6192d0caa293$export$d9f36cf74e24d595(media_query) {
114
114
  const signal = $5vyXB$solidjs.createSignal(false);
115
115
  $5vyXB$solidjs.onCleanup($5vyXB$depictaiutilishared.javascript_media_query(media_query, ({
@@ -2151,6 +2151,7 @@ async function $9abb0a35d4b60ed3$export$79b1565500412d9b(search_modal, modal_fn_
2151
2151
  const modal_els = $5vyXB$solidjs.createRoot(dispose => {
2152
2152
  let closing_animation;
2153
2153
  let animation_started;
2154
+ let focus_target_after_close;
2154
2155
  dispose_and_remove = () => {
2155
2156
  const actually_close = () => {
2156
2157
  dispose();
@@ -2169,11 +2170,19 @@ async function $9abb0a35d4b60ed3$export$79b1565500412d9b(search_modal, modal_fn_
2169
2170
  activeElement?.blur?.();
2170
2171
  el.remove();
2171
2172
  });
2172
- if (should_restore_focus && element_focused_before_open?.isConnected) {
2173
+ const requested_focus_target = focus_target_after_close?.();
2174
+ if (should_restore_focus && (requested_focus_target?.isConnected || element_focused_before_open?.isConnected)) {
2173
2175
  restoring_focus = true;
2174
2176
  try {
2175
2177
  // preventScroll so this can't re-introduce the safari page-jump the blur() above works around
2176
- element_focused_before_open.focus({
2178
+ let focused = false;
2179
+ if (requested_focus_target?.isConnected) {
2180
+ requested_focus_target.focus({
2181
+ preventScroll: true
2182
+ });
2183
+ focused = requested_focus_target.getRootNode().activeElement === requested_focus_target;
2184
+ }
2185
+ if (!focused && element_focused_before_open?.isConnected) element_focused_before_open.focus({
2177
2186
  preventScroll: true
2178
2187
  });
2179
2188
  } finally {
@@ -2194,7 +2203,8 @@ async function $9abb0a35d4b60ed3$export$79b1565500412d9b(search_modal, modal_fn_
2194
2203
  ...extra_options_for_modal,
2195
2204
  close_modal_: close_modal_,
2196
2205
  open_modal_: open_modal_,
2197
- register_closing_animation_: animation => closing_animation = animation
2206
+ register_closing_animation_: animation => closing_animation = animation,
2207
+ set_focus_target_after_close_: get_target => focus_target_after_close = get_target
2198
2208
  });
2199
2209
  });
2200
2210
  body.append(...modal_els);
@@ -6363,7 +6373,8 @@ function $d212a67662c5cf38$export$140423fa4bfb6d63(props) {
6363
6373
  }));
6364
6374
  }
6365
6375
  var $32c662f618f5d80d$var$_tmpl$ = ["<video", ' disablepictureinpicture="true" class="d-standard-content"></video>'],
6366
- $32c662f618f5d80d$var$_tmpl$2 = ["<span", ' class="d-standard-content-text"', ">", "</span>"];
6376
+ $32c662f618f5d80d$var$_tmpl$2 = ["<div", ' class="d-standard-content-text-group"', '><span class="d-standard-content-text"', ">", '</span><span class="d-standard-content-cta"', ">", "</span></div>"],
6377
+ $32c662f618f5d80d$var$_tmpl$3 = ["<span", ' class="d-standard-content-text"', ">", "</span>"];
6367
6378
  function $32c662f618f5d80d$export$780a853d15174484({
6368
6379
  link_: link_,
6369
6380
  type_: type_,
@@ -6373,7 +6384,8 @@ function $32c662f618f5d80d$export$780a853d15174484({
6373
6384
  aspectRatioWhenAloneInRow_: aspectRatioWhenAloneInRow_,
6374
6385
  imageResizer_: imageResizer_,
6375
6386
  text_: text_,
6376
- textPosition_: textPosition_
6387
+ textPosition_: textPosition_,
6388
+ cta_: cta_
6377
6389
  }) {
6378
6390
  let wroteAspectRatioToContainer = false; // Only write this once so we don't get into a aspect ratio changed -> size changed -> image source changed -> aspect ratio slightly changed infinite loop
6379
6391
  const [wrapperSize, setWrapperSize] = $5vyXB$solidjs.createSignal();
@@ -6435,12 +6447,31 @@ function $32c662f618f5d80d$export$780a853d15174484({
6435
6447
  }), $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
6436
6448
  when: text_,
6437
6449
  get children() {
6438
- return $5vyXB$solidjsweb.ssr($32c662f618f5d80d$var$_tmpl$2, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.ssrAttribute("data-position", $5vyXB$solidjsweb.escape(textPosition_, true) || "bottom-center", false), $5vyXB$solidjsweb.escape(text_));
6450
+ return $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
6451
+ when: cta_,
6452
+ get fallback() {
6453
+ return $5vyXB$solidjsweb.ssr($32c662f618f5d80d$var$_tmpl$3, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.ssrAttribute("data-position", $5vyXB$solidjsweb.escape(textPosition_, true) || "bottom-center", false), $5vyXB$solidjsweb.escape(text_));
6454
+ },
6455
+ get children() {
6456
+ return $5vyXB$solidjsweb.ssr($32c662f618f5d80d$var$_tmpl$2, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.ssrAttribute("data-position", $5vyXB$solidjsweb.escape(textPosition_, true) || "bottom-center", false), $5vyXB$solidjsweb.ssrAttribute("data-position", $5vyXB$solidjsweb.escape(textPosition_, true) || "bottom-center", false), $5vyXB$solidjsweb.escape(text_), $5vyXB$solidjsweb.ssrAttribute("data-position", $5vyXB$solidjsweb.escape(textPosition_, true) || "bottom-center", false), $5vyXB$solidjsweb.escape(cta_));
6457
+ }
6458
+ });
6439
6459
  }
6440
6460
  })];
6441
6461
  }
6442
6462
  }));
6443
6463
  }
6464
+ const $0a80939bf0a1e9cc$export$af2c67164f68e9e9 = content => {
6465
+ const {
6466
+ link: link,
6467
+ type: type,
6468
+ url: url,
6469
+ text: text,
6470
+ text_position: text_position,
6471
+ cta: cta
6472
+ } = content;
6473
+ return JSON.stringify([link, type, url, text ?? null, text_position ?? null, cta ?? null]);
6474
+ };
6444
6475
  function $0a80939bf0a1e9cc$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_, products_request_loading_, imageResizer_) {
6445
6476
  let hasSeenContentBlock = false;
6446
6477
  const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
@@ -6477,13 +6508,11 @@ function $0a80939bf0a1e9cc$export$7a92d995f1bf3592(history_content_blocks_, plp_
6477
6508
  type: type,
6478
6509
  url: url,
6479
6510
  text: text,
6480
- text_position: text_position
6511
+ text_position: text_position,
6512
+ cta: cta
6481
6513
  }
6482
6514
  } = row;
6483
- // Key the "content"-component by its rendered inputs, so we can reuse the component (and later downstream the block elements) if it's the same
6484
- // This makes the block not flicker when going backwards/forwards if the content is the same on both pages
6485
- // Also it lets us rewrite the blocks state in the history based on the block aspect ratio without infinite looping
6486
- const componentCacheKey = JSON.stringify([link, type, url, text ?? null, text_position ?? null]);
6515
+ const componentCacheKey = $0a80939bf0a1e9cc$export$af2c67164f68e9e9(row.content);
6487
6516
  // The aspect ratio depends only on the media, so its history key must stay the pre-text 3-element shape — widening it would orphan every ratio already persisted in history.state
6488
6517
  const mediaCacheKey = JSON.stringify([link, type, url]);
6489
6518
  let component = contentComponents.get(componentCacheKey);
@@ -6503,7 +6532,8 @@ function $0a80939bf0a1e9cc$export$7a92d995f1bf3592(history_content_blocks_, plp_
6503
6532
  })),
6504
6533
  imageResizer_: imageResizer_,
6505
6534
  text_: text,
6506
- textPosition_: text_position
6535
+ textPosition_: text_position,
6536
+ cta_: cta
6507
6537
  });
6508
6538
  contentComponents.set(componentCacheKey, component);
6509
6539
  }
@@ -8820,6 +8850,7 @@ function $0175183387c8923a$export$f7658c347b037c3f(props = {}) {
8820
8850
  var $66b8b9a9613c141d$var$_tmpl$ = ["<div", ' style="', '" class="spacer"></div>'],
8821
8851
  $66b8b9a9613c141d$var$_tmpl$2 = ['<div class="field"><!--$-->', "<!--/-->", "<!--$-->", "<!--/--></div>"],
8822
8852
  $66b8b9a9613c141d$var$_tmpl$3 = ["<button", ' class="submit major" type="button"', ">", "</button>"];
8853
+ const $66b8b9a9613c141d$var$keys_not_opening_modal = new Set(["Tab", "Shift", "Control", "Alt", "AltGraph", "Meta", "CapsLock", "Escape", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Home", "End", "Insert", "ContextMenu", "NumLock", "ScrollLock", "Pause", "PrintScreen"]);
8823
8854
  function $66b8b9a9613c141d$export$b94867ecbd698f21({
8824
8855
  search_field_value_: [searchFieldValue, setSearchFieldValue],
8825
8856
  input_field_ref_: input_field_ref_,
@@ -8961,6 +8992,31 @@ function $eb3039a27db40508$export$93d9bfd0c9c1a5b8(close_modal, search_query_url
8961
8992
  }
8962
8993
  })();
8963
8994
  }
8995
+ function $5f9dc76a99175920$export$9e9e2ae069cf2fe1({
8996
+ props_search_field_value_: props_search_field_value_,
8997
+ props_submit_query_: props_submit_query_,
8998
+ dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_,
8999
+ set_focus_target_after_close_: set_focus_target_after_close_,
9000
+ get_search_page_input_element_: get_search_page_input_element_
9001
+ }) {
9002
+ const search_field_value_ = dont_sync_search_field_value_except_on_submit_ ? $5vyXB$solidjs.createSignal("") : props_search_field_value_;
9003
+ let submits_in_flight = 0;
9004
+ const submit_query_ = async (new_query = $5vyXB$solidjs.untrack(search_field_value_[0])) => {
9005
+ submits_in_flight++;
9006
+ try {
9007
+ return await props_submit_query_(new_query, () => set_focus_target_after_close_(get_search_page_input_element_));
9008
+ } finally {
9009
+ submits_in_flight--;
9010
+ }
9011
+ };
9012
+ if (dont_sync_search_field_value_except_on_submit_) $5vyXB$solidjs.createEffect($5vyXB$solidjs.on(search_field_value_[0], value => submits_in_flight > 0 && props_search_field_value_[1](value), {
9013
+ defer: true
9014
+ }));
9015
+ return {
9016
+ search_field_value_: search_field_value_,
9017
+ submit_query_: submit_query_
9018
+ };
9019
+ }
8964
9020
  var $44f0b2e312a9b710$var$_tmpl$ = ["<div", ' class="discover-more"><button class="major" type="button">', "</button></div>"],
8965
9021
  $44f0b2e312a9b710$var$_tmpl$2 = ["<b", ">", "</b>"],
8966
9022
  $44f0b2e312a9b710$var$_tmpl$3 = ["<div", ' class="', '"><div class="', '" role="search" aria-label="Search modal with search field, query suggestions and result preview"><!--$-->', '<!--/--><div id="depict-suggestions-and-result-preview" class="padded"><!--$-->', "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div>"],
@@ -8974,6 +9030,8 @@ function $44f0b2e312a9b710$var$RawClassicSearchModal({
8974
9030
  search_query_url_param_name_: search_query_url_param_name_,
8975
9031
  previous_searches_: previous_searches_,
8976
9032
  close_modal_: close_modal_,
9033
+ set_focus_target_after_close_: set_focus_target_after_close_,
9034
+ get_search_page_input_element_: get_search_page_input_element_,
8977
9035
  depict_api_: depict_api_,
8978
9036
  merchant_: merchant_,
8979
9037
  market_: market_,
@@ -8998,15 +9056,16 @@ function $44f0b2e312a9b710$var$RawClassicSearchModal({
8998
9056
  // As per feedback from stronger we sometimes want a modal with the search field value disconnected from the one in the rest of the UI, see https://depictaiworkspace.slack.com/archives/C02J16R9XEH/p1679065878487709.
8999
9057
  // This is desired for when the modal is opened from a UI element that visually does not look connected with the search page or current query
9000
9058
  // Basically the UI signals that the button that opens the modal starts a new search.
9001
- const search_field_value_ = dont_sync_search_field_value_except_on_submit_ ? $5vyXB$solidjs.createSignal("") : props_search_field_value;
9002
- const propagate_search_field_value_back = dont_sync_search_field_value_except_on_submit_ ? () => props_search_field_value[1]($5vyXB$solidjs.untrack(search_field_value_[0])) // Set actual search field value to the throwaway internal one before submitting
9003
- : undefined;
9004
- const submit_query_ = (...args) => {
9005
- // submit_query expects to read the current search field value which is why we have to write the current one to the signal before calling it
9006
- // It will write the old one back and then write the new one after submit
9007
- propagate_search_field_value_back?.();
9008
- return props_submit_query(...args);
9009
- };
9059
+ const {
9060
+ search_field_value_: search_field_value_,
9061
+ submit_query_: submit_query_
9062
+ } = $5f9dc76a99175920$export$9e9e2ae069cf2fe1({
9063
+ props_search_field_value_: props_search_field_value,
9064
+ props_submit_query_: props_submit_query,
9065
+ dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_,
9066
+ set_focus_target_after_close_: set_focus_target_after_close_,
9067
+ get_search_page_input_element_: get_search_page_input_element_
9068
+ });
9010
9069
  const [input_field, set_input_field] = $5vyXB$solidjs.createSignal();
9011
9070
  const [get_search_field_value_] = search_field_value_;
9012
9071
  // Search field alignment unused in ClassicSearchModal since the search field spans the whole modal
@@ -9604,6 +9663,8 @@ function $11597ae03e703a47$var$RawSearchModalV2({
9604
9663
  search_query_url_param_name_: search_query_url_param_name_,
9605
9664
  previous_searches_: previous_searches_,
9606
9665
  close_modal_: close_modal_,
9666
+ set_focus_target_after_close_: set_focus_target_after_close_,
9667
+ get_search_page_input_element_: get_search_page_input_element_,
9607
9668
  alignmentSignals_: alignmentSignals_,
9608
9669
  depict_api_: depict_api_,
9609
9670
  merchant_: merchant_,
@@ -9634,15 +9695,16 @@ function $11597ae03e703a47$var$RawSearchModalV2({
9634
9695
  // As per feedback from stronger we sometimes want a modal with the search field value disconnected from the one in the rest of the UI, see https://depictaiworkspace.slack.com/archives/C02J16R9XEH/p1679065878487709.
9635
9696
  // This is desired for when the modal is opened from a UI element that visually does not look connected with the search page or current query
9636
9697
  // Basically the UI signals that the button that opens the modal starts a new search.
9637
- const search_field_value_ = dont_sync_search_field_value_except_on_submit_ ? $5vyXB$solidjs.createSignal("") : props_search_field_value;
9638
- const propagate_search_field_value_back = dont_sync_search_field_value_except_on_submit_ ? () => props_search_field_value[1]($5vyXB$solidjs.untrack(search_field_value_[0])) // Set actual search field value to the throwaway internal one before submitting
9639
- : undefined;
9640
- const submit_query_ = (...args) => {
9641
- // submit_query expects to read the current search field value which is why we have to write the current one to the signal before calling it
9642
- // It will write the old one back and then write the new one after submit
9643
- propagate_search_field_value_back?.();
9644
- return props_submit_query(...args);
9645
- };
9698
+ const {
9699
+ search_field_value_: search_field_value_,
9700
+ submit_query_: submit_query_
9701
+ } = $5f9dc76a99175920$export$9e9e2ae069cf2fe1({
9702
+ props_search_field_value_: props_search_field_value,
9703
+ props_submit_query_: props_submit_query,
9704
+ dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_,
9705
+ set_focus_target_after_close_: set_focus_target_after_close_,
9706
+ get_search_page_input_element_: get_search_page_input_element_
9707
+ });
9646
9708
  const [input_field, set_input_field] = $5vyXB$solidjs.createSignal();
9647
9709
  const [searching_for_value_, set_searching_for_value_] = $5vyXB$solidjs.createSignal();
9648
9710
  const [show_stale_content_results_, set_show_stale_content_results_] = $5vyXB$solidjs.createSignal(false);
@@ -11470,11 +11532,12 @@ function $2b7a005a65221045$export$84bba84a7b837187(read_search_query) {
11470
11532
  async function $f328bd45f8ede33c$export$e16630ecb9644a1c({
11471
11533
  on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
11472
11534
  search_param_name_: search_param_name_,
11473
- set_search_field_value_: set_search_field_value_,
11535
+ search_field_value_: search_field_value_,
11474
11536
  get_search_query_: get_search_query_,
11475
11537
  url_transformer_: url_transformer_,
11476
11538
  router_: router_,
11477
11539
  after_submit_: after_submit_,
11540
+ before_navigate_: before_navigate_,
11478
11541
  get_new_query: get_new_query
11479
11542
  }) {
11480
11543
  const new_search_query = get_new_query();
@@ -11482,21 +11545,89 @@ async function $f328bd45f8ede33c$export$e16630ecb9644a1c({
11482
11545
  if (previous_query === new_search_query && new URLSearchParams(location.search).has(search_param_name_)) {
11483
11546
  // don't push a history entry / re-search if someone submits a search again
11484
11547
  // do close the modal though
11548
+ search_field_value_.settle_(new_search_query);
11485
11549
  on_submit_with_unchanged_value_?.();
11486
- return;
11550
+ return false;
11487
11551
  }
11488
- set_search_field_value_(previous_query); // restore the value to the previous query since this one goes to the new history entry
11489
11552
  const target_url = new URL(location.href);
11490
11553
  url_transformer_?.(target_url);
11491
11554
  target_url.searchParams.set(search_param_name_, new_search_query);
11492
- await router_.navigate_.go_to_({
11493
- new_url_: target_url,
11494
- is_replace_: false,
11495
- force_spa_navigation_: true
11496
- });
11497
- set_search_field_value_(new_search_query);
11555
+ const end_submit = search_field_value_.begin_submit_(new_search_query, previous_query);
11556
+ before_navigate_?.();
11557
+ let landed;
11558
+ try {
11559
+ await router_.navigate_.go_to_({
11560
+ new_url_: target_url,
11561
+ is_replace_: false,
11562
+ force_spa_navigation_: true
11563
+ });
11564
+ } finally {
11565
+ landed = end_submit();
11566
+ }
11567
+ if (!landed) return false;
11498
11568
  scrollTo(0, 0);
11499
11569
  after_submit_?.();
11570
+ return true;
11571
+ }
11572
+ function $380b434363eee5f6$export$d13a185c53aa5edf(persisted_, get_search_query_) {
11573
+ const [get_persisted, set_persisted] = persisted_;
11574
+ const [get_submitting, set_submitting] = $5vyXB$solidjs.createSignal();
11575
+ const get_value = $5vyXB$solidjs.createMemo(() => get_submitting() ?? get_persisted());
11576
+ const set_value = value => {
11577
+ const new_value = typeof value === "function" ? value($5vyXB$solidjs.untrack(get_value)) : value;
11578
+ if ($5vyXB$solidjs.untrack(get_submitting) === undefined) set_persisted(new_value);else set_submitting(new_value);
11579
+ return new_value;
11580
+ };
11581
+ let current_submit;
11582
+ const end_submit = landed => {
11583
+ current_submit.landed_ = landed;
11584
+ current_submit = undefined;
11585
+ $5vyXB$solidjs.batch(() => {
11586
+ const submitting = $5vyXB$solidjs.untrack(get_submitting);
11587
+ set_submitting(undefined);
11588
+ if (landed && submitting !== undefined) set_persisted(submitting);
11589
+ });
11590
+ };
11591
+ const abort_on_popstate = what_happened => {
11592
+ if (what_happened === "popstate" && current_submit) end_submit(false);
11593
+ };
11594
+ (0, $5vyXB$depictaiutilishared.instant_exec_on_suspect_history_change).add(abort_on_popstate);
11595
+ $5vyXB$solidjs.onCleanup(() => (0, $5vyXB$depictaiutilishared.instant_exec_on_suspect_history_change).delete(abort_on_popstate));
11596
+ $5vyXB$solidjs.createEffect($5vyXB$solidjs.on(get_search_query_, query => {
11597
+ const token = current_submit;
11598
+ if (!token || query !== token.query_) return;
11599
+ queueMicrotask(() => {
11600
+ if (current_submit === token) end_submit(true);
11601
+ });
11602
+ }, {
11603
+ defer: true
11604
+ }));
11605
+ const begin_submit_ = (submitted_query, query_of_current_history_entry) => {
11606
+ const token = current_submit = {
11607
+ query_: submitted_query,
11608
+ landed_: false
11609
+ };
11610
+ $5vyXB$solidjs.batch(() => {
11611
+ set_submitting(submitted_query);
11612
+ set_persisted(query_of_current_history_entry);
11613
+ });
11614
+ return () => {
11615
+ if (current_submit === token) end_submit(true);
11616
+ return token.landed_;
11617
+ };
11618
+ };
11619
+ const settle_ = query => {
11620
+ if (current_submit) return;
11621
+ $5vyXB$solidjs.batch(() => {
11622
+ set_submitting(undefined);
11623
+ set_persisted(query);
11624
+ });
11625
+ };
11626
+ return {
11627
+ value_: [get_value, set_value],
11628
+ begin_submit_: begin_submit_,
11629
+ settle_: settle_
11630
+ };
11500
11631
  }
11501
11632
  function $331c7a65de274e6c$export$181cceed5c91919e(callback, alsoRaF, passiveListener) {
11502
11633
  let aligned_this_microtask = false;
@@ -12132,6 +12263,7 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
12132
12263
  scroll_restoration_data_: scroll_restoration_data_,
12133
12264
  product_card_template_: product_card_template_,
12134
12265
  modalAlignmentSignalsRef_: modalAlignmentSignalsRef_,
12266
+ inputFieldRef_: inputFieldRef_,
12135
12267
  router_: router_,
12136
12268
  content_results_rows_: content_results_rows_,
12137
12269
  content_layout_options_: content_layout_options_,
@@ -12311,6 +12443,8 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
12311
12443
  if (!search_field) break add_input_field;
12312
12444
  setModalBodyStyle({});
12313
12445
  modalAlignmentSignalsRef_?.(alignmentSignals_);
12446
+ inputFieldRef_?.(input_element);
12447
+ $5vyXB$solidjs.onCleanup(() => inputFieldRef_?.(undefined));
12314
12448
  const [pollAlignment, setPollAlignment_] = $5vyXB$solidjs.createSignal(false);
12315
12449
  const align_position = $5vyXB$depictaiutilishared.catchify((0, $fd463ff0edb29915$export$b3ad617e9036868))(alignmentSignals_, search_field, (0, $fd463ff0edb29915$export$3f238c96c45e6cc6) | (0, $fd463ff0edb29915$export$7895aadd1956b1c7) | (modalVersionUsed_ === 1 ? (0, $fd463ff0edb29915$export$902f8b4a7dae5d78) : (0, $fd463ff0edb29915$export$6060bc6bee850eb6) | (0, $fd463ff0edb29915$export$5097308c5200105a)), true, pollAlignment);
12316
12450
  div_with_field_class.addEventListener("click", $5vyXB$depictaiutilishared.catchify(e => {
@@ -12612,14 +12746,16 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
12612
12746
  set_search_content_results_rows((0, $3716b8caf7f959e2$export$70ceae36059a1036));
12613
12747
  }; // do this every time after we have submitted a new query - otherwise there might already be a saved number of rows in the state
12614
12748
  const on_submit_with_unchanged_value_ = () => this.modal_open = false;
12615
- const [get_search_field_value_, set_search_field_value_] = state_.field_value;
12616
- const configured_submit_query_ = new_query => $f328bd45f8ede33c$export$e16630ecb9644a1c({
12749
+ const search_field_value_ = $380b434363eee5f6$export$d13a185c53aa5edf(state_.field_value, get_search_query_);
12750
+ const [get_search_field_value_] = search_field_value_.value_;
12751
+ const configured_submit_query_ = (new_query, before_navigate_) => $f328bd45f8ede33c$export$e16630ecb9644a1c({
12617
12752
  on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
12618
- set_search_field_value_: set_search_field_value_,
12753
+ search_field_value_: search_field_value_,
12619
12754
  get_search_query_: get_search_query_,
12620
12755
  search_param_name_: search_query_url_param_name_,
12621
12756
  after_submit_: after_submit_,
12622
- get_new_query: () => new_query || $5vyXB$solidjs.untrack(get_search_field_value_),
12757
+ before_navigate_: before_navigate_,
12758
+ get_new_query: () => new_query ?? $5vyXB$solidjs.untrack(get_search_field_value_),
12623
12759
  url_transformer_: url_transformer,
12624
12760
  router_: this.#router
12625
12761
  });
@@ -12638,6 +12774,7 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
12638
12774
  search_query_url_param_name_: search_query_url_param_name_,
12639
12775
  reset_history_state_: reset_history_state_,
12640
12776
  state_: state_,
12777
+ search_field_value_: search_field_value_.value_,
12641
12778
  router_: this.#router,
12642
12779
  url_transformer_: url_transformer,
12643
12780
  depict_api_: depict_api_,
@@ -12661,7 +12798,8 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
12661
12798
  $5vyXB$solidjs.onCleanup(() => this.modal_open = false);
12662
12799
  return searchModalComponent(...args);
12663
12800
  }, {
12664
- search_field_value_: state_.field_value,
12801
+ search_field_value_: search_field_value_.value_,
12802
+ get_search_page_input_element_: () => $2c61e4cd8229c49a$export$dde08b2dca8cc1ce.get(this)?.search_page_input_element_,
12665
12803
  get_search_query_: get_search_query_,
12666
12804
  search_query_url_param_name_: search_query_url_param_name_,
12667
12805
  previous_searches_: previous_searches,
@@ -12809,6 +12947,7 @@ function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
12809
12947
  const {
12810
12948
  state_: state_
12811
12949
  } = shared_properties;
12950
+ let registered_input_element;
12812
12951
  const grid_spacing_override = $5vyXB$solidjs.createMemo(() => {
12813
12952
  const {
12814
12953
  grid_spacing: grid_spacing
@@ -12837,7 +12976,7 @@ function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
12837
12976
  min_products_to_fetch_: $2c61e4cd8229c49a$var$min_products_to_fetch_,
12838
12977
  local_filter_cache_: state_.local_filter_cache,
12839
12978
  content_search_enabled_: () => depict_search.enable_content_search ?? $2c61e4cd8229c49a$var$content_search_default,
12840
- search_field_value_: state_.field_value,
12979
+ search_field_value_: shared_properties.search_field_value_,
12841
12980
  get_search_query_: shared_properties.get_search_query_,
12842
12981
  clear_filters_on_next_submit_: shared_properties.clear_filters_on_next_submit_,
12843
12982
  open_modal_: (...args) => depict_search.modal_open = args,
@@ -12845,6 +12984,16 @@ function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
12845
12984
  modalVersionUsed_: shared_properties.modalVersionUsed_,
12846
12985
  showSliderArrow_: () => props.showSliderArrow_,
12847
12986
  i18n_: shared_properties.i18n_,
12987
+ inputFieldRef_: input_element => {
12988
+ const shared_info_right_now = $2c61e4cd8229c49a$export$dde08b2dca8cc1ce.get(depict_search);
12989
+ if (!shared_info_right_now) return;
12990
+ if (input_element === undefined && shared_info_right_now.search_page_input_element_ !== registered_input_element) return;
12991
+ registered_input_element = input_element;
12992
+ $2c61e4cd8229c49a$export$dde08b2dca8cc1ce.set(depict_search, {
12993
+ ...shared_info_right_now,
12994
+ search_page_input_element_: input_element
12995
+ });
12996
+ },
12848
12997
  modalAlignmentSignalsRef_: style => {
12849
12998
  const shared_info_right_now = $2c61e4cd8229c49a$export$dde08b2dca8cc1ce.get(depict_search);
12850
12999
  if (!shared_info_right_now) return;
@@ -13195,7 +13344,7 @@ function $c0a0659cf97e8eb2$export$316f6f283ae64765(props) {
13195
13344
  return shared_properties.BackIcon_;
13196
13345
  },
13197
13346
  get search_field_value_() {
13198
- return shared_properties.state_.field_value;
13347
+ return shared_properties.search_field_value_;
13199
13348
  },
13200
13349
  get submit_query_() {
13201
13350
  return shared_properties.configured_submit_query_;
@@ -13238,7 +13387,7 @@ function $c0a0659cf97e8eb2$export$316f6f283ae64765(props) {
13238
13387
  return shared_properties.BackIcon_;
13239
13388
  },
13240
13389
  get search_field_value_() {
13241
- return shared_properties.state_.field_value;
13390
+ return shared_properties.search_field_value_;
13242
13391
  },
13243
13392
  get submit_query_() {
13244
13393
  return shared_properties.configured_submit_query_;
@@ -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.18";
14
+ export const version = "4.10.20";
15
15
  /**
16
16
  * Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
17
17
  */
@@ -713,6 +713,8 @@ declare function RawSearchModalV2<InputDisplay extends Display, OutputDisplay ex
713
713
  search_query_url_param_name_,
714
714
  previous_searches_,
715
715
  close_modal_,
716
+ set_focus_target_after_close_,
717
+ get_search_page_input_element_,
716
718
  alignmentSignals_,
717
719
  depict_api_,
718
720
  merchant_,
@@ -743,12 +745,14 @@ declare function RawSearchModalV2<InputDisplay extends Display, OutputDisplay ex
743
745
  search_query_url_param_name_: string;
744
746
  previous_searches_: Signal<string[]>;
745
747
  close_modal_: VoidFunction;
748
+ set_focus_target_after_close_: (get_target: (() => HTMLElement | undefined) | undefined) => void;
749
+ get_search_page_input_element_: () => HTMLInputElement | undefined;
746
750
  alignmentSignals_?: ModalAlignmentSignals;
747
751
  depict_api_: DepictAPI<InputDisplay, OutputDisplay>;
748
752
  clear_filters_: (user_triggered: boolean) => void;
749
753
  merchant_: Accessor<string>;
750
754
  market_: Accessor<string>;
751
- submit_query_: (new_query?: string) => void;
755
+ submit_query_: (new_query?: string, before_navigate_?: VoidFunction) => Promise<boolean>;
752
756
  class_list_?: Accessor<Record<string, boolean>>;
753
757
  url_transformer_?: (url_object: URL) => unknown;
754
758
  disable_scrolling_?: boolean;
@@ -785,6 +789,8 @@ declare function RawClassicSearchModal({
785
789
  search_query_url_param_name_,
786
790
  previous_searches_,
787
791
  close_modal_,
792
+ set_focus_target_after_close_,
793
+ get_search_page_input_element_,
788
794
  depict_api_,
789
795
  merchant_,
790
796
  market_,
@@ -810,11 +816,13 @@ declare function RawClassicSearchModal({
810
816
  search_query_url_param_name_: string;
811
817
  previous_searches_: Signal<string[]>;
812
818
  close_modal_: VoidFunction;
819
+ set_focus_target_after_close_: (get_target: (() => HTMLElement | undefined) | undefined) => void;
820
+ get_search_page_input_element_: () => HTMLInputElement | undefined;
813
821
  depict_api_: DepictAPI<any>;
814
822
  clear_filters_: (user_triggered: boolean) => void;
815
823
  merchant_: Accessor<string>;
816
824
  market_: Accessor<string>;
817
- submit_query_: (new_query?: string) => void;
825
+ submit_query_: (new_query?: string, before_navigate_?: VoidFunction) => Promise<boolean>;
818
826
  class_list_?: Accessor<Record<string, boolean>>;
819
827
  url_transformer_?: (url_object: URL) => unknown;
820
828
  disable_scrolling_?: boolean;
@@ -1038,6 +1046,7 @@ export function general_modal_abstraction<StaticOptions extends {
1038
1046
  close_modal_: VoidFunction;
1039
1047
  open_modal_: (extra_options_for_modal?: ExtraOptionsProvidedOnOpen, on_dispose?: VoidFunction) => void;
1040
1048
  register_closing_animation_: (animation: () => Promise<any>) => void;
1049
+ set_focus_target_after_close_: (get_target: (() => HTMLElement | undefined) | undefined) => void;
1041
1050
  }) => Node_Array, modal_fn_opts: StaticOptions, parent?: HTMLElement | ShadowRoot): Promise<{
1042
1051
  open_modal_: (extra_options_for_modal?: any, on_dispose?: VoidFunction | undefined) => Promise<void | undefined>;
1043
1052
  close_modal_: () => void | undefined;