@depict-ai/ui 4.10.19 → 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.
package/ES10/index.cjs CHANGED
@@ -115,7 +115,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
115
115
  $parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
116
116
  $parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
117
117
  /*! Depict.ai search and product listing SDK */
118
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.10.19";
118
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.10.20";
119
119
  function $3e17e871e9d0911d$export$d9f36cf74e24d595(media_query) {
120
120
  const signal = $52FdA$solidjs.createSignal(false);
121
121
  $52FdA$solidjs.onCleanup($52FdA$depictaiutilishared.javascript_media_query(media_query, _ref => {
@@ -2709,8 +2709,10 @@ async function $4cf7d9829d60d844$export$79b1565500412d9b(search_modal, modal_fn_
2709
2709
  const modal_els = $52FdA$solidjs.createRoot(dispose => {
2710
2710
  let closing_animation;
2711
2711
  let animation_started;
2712
+ let focus_target_after_close;
2712
2713
  dispose_and_remove = () => {
2713
2714
  const actually_close = () => {
2715
+ var _focus_target_after_c;
2714
2716
  dispose();
2715
2717
  on_dispose === null || on_dispose === void 0 || on_dispose();
2716
2718
  const {
@@ -2729,11 +2731,19 @@ async function $4cf7d9829d60d844$export$79b1565500412d9b(search_modal, modal_fn_
2729
2731
  }
2730
2732
  el.remove();
2731
2733
  });
2732
- if (should_restore_focus && element_focused_before_open !== null && element_focused_before_open !== void 0 && element_focused_before_open.isConnected) {
2734
+ const requested_focus_target = (_focus_target_after_c = focus_target_after_close) === null || _focus_target_after_c === void 0 ? void 0 : _focus_target_after_c();
2735
+ if (should_restore_focus && (requested_focus_target !== null && requested_focus_target !== void 0 && requested_focus_target.isConnected || element_focused_before_open !== null && element_focused_before_open !== void 0 && element_focused_before_open.isConnected)) {
2733
2736
  restoring_focus = true;
2734
2737
  try {
2735
2738
  // preventScroll so this can't re-introduce the safari page-jump the blur() above works around
2736
- element_focused_before_open.focus({
2739
+ let focused = false;
2740
+ if (requested_focus_target !== null && requested_focus_target !== void 0 && requested_focus_target.isConnected) {
2741
+ requested_focus_target.focus({
2742
+ preventScroll: true
2743
+ });
2744
+ focused = requested_focus_target.getRootNode().activeElement === requested_focus_target;
2745
+ }
2746
+ if (!focused && element_focused_before_open !== null && element_focused_before_open !== void 0 && element_focused_before_open.isConnected) element_focused_before_open.focus({
2737
2747
  preventScroll: true
2738
2748
  });
2739
2749
  } finally {
@@ -2755,7 +2765,8 @@ async function $4cf7d9829d60d844$export$79b1565500412d9b(search_modal, modal_fn_
2755
2765
  ...extra_options_for_modal,
2756
2766
  close_modal_: close_modal_,
2757
2767
  open_modal_: open_modal_,
2758
- register_closing_animation_: animation => closing_animation = animation
2768
+ register_closing_animation_: animation => closing_animation = animation,
2769
+ set_focus_target_after_close_: get_target => focus_target_after_close = get_target
2759
2770
  });
2760
2771
  });
2761
2772
  body.append(...modal_els);
@@ -11422,6 +11433,7 @@ var $29e5dbeb69da7a36$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<but
11422
11433
  $29e5dbeb69da7a36$var$_tmpl$3 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=spacer>`),
11423
11434
  $29e5dbeb69da7a36$var$_tmpl$4 = /*#__PURE__*/$52FdA$solidjsweb.template(`<button class="submit major"type=button>`),
11424
11435
  $29e5dbeb69da7a36$var$_tmpl$5 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div><!$><!/><!$><!/><div class=field><!$><!/><input class=query tabindex=0 enterkeyhint=search><!$><!/></div><!$><!/><!$><!/>`);
11436
+ const $29e5dbeb69da7a36$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"]);
11425
11437
  function $29e5dbeb69da7a36$export$b94867ecbd698f21(_ref) {
11426
11438
  let {
11427
11439
  search_field_value_: [searchFieldValue, setSearchFieldValue],
@@ -11604,7 +11616,7 @@ function $29e5dbeb69da7a36$export$b94867ecbd698f21(_ref) {
11604
11616
  get onKeyDown() {
11605
11617
  return $52FdA$depictaiutilishared.catchify(e => {
11606
11618
  if (disabled_) {
11607
- if (e.key !== "Tab" && e.key !== "Shift")
11619
+ if (!$29e5dbeb69da7a36$var$keys_not_opening_modal.has(e.key) && !/^F\d{1,2}$/.test(e.key))
11608
11620
  // alow tab-selecting the input field and then open the modal when the user start writing but also to move past the field with tab
11609
11621
  input_element.click();
11610
11622
  } else if (e.key === "Enter") {
@@ -11709,6 +11721,33 @@ function $4b71b4fabdee5753$export$93d9bfd0c9c1a5b8(close_modal, search_query_url
11709
11721
  }
11710
11722
  })();
11711
11723
  }
11724
+ function $9ccac7b807fe6451$export$9e9e2ae069cf2fe1(_ref) {
11725
+ let {
11726
+ props_search_field_value_: props_search_field_value_,
11727
+ props_submit_query_: props_submit_query_,
11728
+ dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_,
11729
+ set_focus_target_after_close_: set_focus_target_after_close_,
11730
+ get_search_page_input_element_: get_search_page_input_element_
11731
+ } = _ref;
11732
+ const search_field_value_ = dont_sync_search_field_value_except_on_submit_ ? $52FdA$solidjs.createSignal("") : props_search_field_value_;
11733
+ let submits_in_flight = 0;
11734
+ const submit_query_ = async function () {
11735
+ let new_query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $52FdA$solidjs.untrack(search_field_value_[0]);
11736
+ submits_in_flight++;
11737
+ try {
11738
+ return await props_submit_query_(new_query, () => set_focus_target_after_close_(get_search_page_input_element_));
11739
+ } finally {
11740
+ submits_in_flight--;
11741
+ }
11742
+ };
11743
+ if (dont_sync_search_field_value_except_on_submit_) $52FdA$solidjs.createEffect($52FdA$solidjs.on(search_field_value_[0], value => submits_in_flight > 0 && props_search_field_value_[1](value), {
11744
+ defer: true
11745
+ }));
11746
+ return {
11747
+ search_field_value_: search_field_value_,
11748
+ submit_query_: submit_query_
11749
+ };
11750
+ }
11712
11751
  var $9035b24c2dbd3f36$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=discover-more><button class=major type=button>`),
11713
11752
  $9035b24c2dbd3f36$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<b>`),
11714
11753
  $9035b24c2dbd3f36$var$_tmpl$3 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=depict-search-modal><div class=body 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><!$><!/>`),
@@ -11723,6 +11762,8 @@ function $9035b24c2dbd3f36$var$RawClassicSearchModal(_ref) {
11723
11762
  search_query_url_param_name_: search_query_url_param_name_,
11724
11763
  previous_searches_: previous_searches_,
11725
11764
  close_modal_: close_modal_,
11765
+ set_focus_target_after_close_: set_focus_target_after_close_,
11766
+ get_search_page_input_element_: get_search_page_input_element_,
11726
11767
  depict_api_: depict_api_,
11727
11768
  merchant_: merchant_,
11728
11769
  market_: market_,
@@ -11747,15 +11788,16 @@ function $9035b24c2dbd3f36$var$RawClassicSearchModal(_ref) {
11747
11788
  // 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.
11748
11789
  // 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
11749
11790
  // Basically the UI signals that the button that opens the modal starts a new search.
11750
- const search_field_value_ = dont_sync_search_field_value_except_on_submit_ ? $52FdA$solidjs.createSignal("") : props_search_field_value;
11751
- const propagate_search_field_value_back = dont_sync_search_field_value_except_on_submit_ ? () => props_search_field_value[1]($52FdA$solidjs.untrack(search_field_value_[0])) // Set actual search field value to the throwaway internal one before submitting
11752
- : undefined;
11753
- const submit_query_ = function () {
11754
- // 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
11755
- // It will write the old one back and then write the new one after submit
11756
- propagate_search_field_value_back === null || propagate_search_field_value_back === void 0 || propagate_search_field_value_back();
11757
- return props_submit_query(...arguments);
11758
- };
11791
+ const {
11792
+ search_field_value_: search_field_value_,
11793
+ submit_query_: submit_query_
11794
+ } = $9ccac7b807fe6451$export$9e9e2ae069cf2fe1({
11795
+ props_search_field_value_: props_search_field_value,
11796
+ props_submit_query_: props_submit_query,
11797
+ dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_,
11798
+ set_focus_target_after_close_: set_focus_target_after_close_,
11799
+ get_search_page_input_element_: get_search_page_input_element_
11800
+ });
11759
11801
  const [input_field, set_input_field] = $52FdA$solidjs.createSignal();
11760
11802
  const [get_search_field_value_] = search_field_value_;
11761
11803
  // Search field alignment unused in ClassicSearchModal since the search field spans the whole modal
@@ -12587,6 +12629,8 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
12587
12629
  search_query_url_param_name_: search_query_url_param_name_,
12588
12630
  previous_searches_: previous_searches_,
12589
12631
  close_modal_: close_modal_,
12632
+ set_focus_target_after_close_: set_focus_target_after_close_,
12633
+ get_search_page_input_element_: get_search_page_input_element_,
12590
12634
  alignmentSignals_: alignmentSignals_,
12591
12635
  depict_api_: depict_api_,
12592
12636
  merchant_: merchant_,
@@ -12617,15 +12661,16 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
12617
12661
  // 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.
12618
12662
  // 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
12619
12663
  // Basically the UI signals that the button that opens the modal starts a new search.
12620
- const search_field_value_ = dont_sync_search_field_value_except_on_submit_ ? $52FdA$solidjs.createSignal("") : props_search_field_value;
12621
- const propagate_search_field_value_back = dont_sync_search_field_value_except_on_submit_ ? () => props_search_field_value[1]($52FdA$solidjs.untrack(search_field_value_[0])) // Set actual search field value to the throwaway internal one before submitting
12622
- : undefined;
12623
- const submit_query_ = function () {
12624
- // 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
12625
- // It will write the old one back and then write the new one after submit
12626
- propagate_search_field_value_back === null || propagate_search_field_value_back === void 0 || propagate_search_field_value_back();
12627
- return props_submit_query(...arguments);
12628
- };
12664
+ const {
12665
+ search_field_value_: search_field_value_,
12666
+ submit_query_: submit_query_
12667
+ } = $9ccac7b807fe6451$export$9e9e2ae069cf2fe1({
12668
+ props_search_field_value_: props_search_field_value,
12669
+ props_submit_query_: props_submit_query,
12670
+ dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_,
12671
+ set_focus_target_after_close_: set_focus_target_after_close_,
12672
+ get_search_page_input_element_: get_search_page_input_element_
12673
+ });
12629
12674
  const [input_field, set_input_field] = $52FdA$solidjs.createSignal();
12630
12675
  const [searching_for_value_, set_searching_for_value_] = $52FdA$solidjs.createSignal();
12631
12676
  const [show_stale_content_results_, set_show_stale_content_results_] = $52FdA$solidjs.createSignal(false);
@@ -14943,11 +14988,12 @@ async function $7f680455a2aa1079$export$e16630ecb9644a1c(_ref) {
14943
14988
  let {
14944
14989
  on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
14945
14990
  search_param_name_: search_param_name_,
14946
- set_search_field_value_: set_search_field_value_,
14991
+ search_field_value_: search_field_value_,
14947
14992
  get_search_query_: get_search_query_,
14948
14993
  url_transformer_: url_transformer_,
14949
14994
  router_: router_,
14950
14995
  after_submit_: after_submit_,
14996
+ before_navigate_: before_navigate_,
14951
14997
  get_new_query: get_new_query
14952
14998
  } = _ref;
14953
14999
  const new_search_query = get_new_query();
@@ -14955,21 +15001,92 @@ async function $7f680455a2aa1079$export$e16630ecb9644a1c(_ref) {
14955
15001
  if (previous_query === new_search_query && new URLSearchParams(location.search).has(search_param_name_)) {
14956
15002
  // don't push a history entry / re-search if someone submits a search again
14957
15003
  // do close the modal though
15004
+ search_field_value_.settle_(new_search_query);
14958
15005
  on_submit_with_unchanged_value_ === null || on_submit_with_unchanged_value_ === void 0 || on_submit_with_unchanged_value_();
14959
- return;
15006
+ return false;
14960
15007
  }
14961
- set_search_field_value_(previous_query); // restore the value to the previous query since this one goes to the new history entry
14962
15008
  const target_url = new URL(location.href);
14963
15009
  url_transformer_ === null || url_transformer_ === void 0 || url_transformer_(target_url);
14964
15010
  target_url.searchParams.set(search_param_name_, new_search_query);
14965
- await router_.navigate_.go_to_({
14966
- new_url_: target_url,
14967
- is_replace_: false,
14968
- force_spa_navigation_: true
14969
- });
14970
- set_search_field_value_(new_search_query);
15011
+ const end_submit = search_field_value_.begin_submit_(new_search_query, previous_query);
15012
+ before_navigate_ === null || before_navigate_ === void 0 || before_navigate_();
15013
+ let landed;
15014
+ try {
15015
+ await router_.navigate_.go_to_({
15016
+ new_url_: target_url,
15017
+ is_replace_: false,
15018
+ force_spa_navigation_: true
15019
+ });
15020
+ } finally {
15021
+ landed = end_submit();
15022
+ }
15023
+ if (!landed) return false;
14971
15024
  scrollTo(0, 0);
14972
15025
  after_submit_ === null || after_submit_ === void 0 || after_submit_();
15026
+ return true;
15027
+ }
15028
+ function $24f1a81b790e371c$export$d13a185c53aa5edf(persisted_, get_search_query_) {
15029
+ const [get_persisted, set_persisted] = persisted_;
15030
+ const [get_submitting, set_submitting] = $52FdA$solidjs.createSignal();
15031
+ const get_value = $52FdA$solidjs.createMemo(() => {
15032
+ var _get_submitting;
15033
+ return (_get_submitting = get_submitting()) !== null && _get_submitting !== void 0 ? _get_submitting : get_persisted();
15034
+ });
15035
+ const set_value = value => {
15036
+ const new_value = typeof value === "function" ? value($52FdA$solidjs.untrack(get_value)) : value;
15037
+ if ($52FdA$solidjs.untrack(get_submitting) === undefined) set_persisted(new_value);else set_submitting(new_value);
15038
+ return new_value;
15039
+ };
15040
+ let current_submit;
15041
+ const end_submit = landed => {
15042
+ current_submit.landed_ = landed;
15043
+ current_submit = undefined;
15044
+ $52FdA$solidjs.batch(() => {
15045
+ const submitting = $52FdA$solidjs.untrack(get_submitting);
15046
+ set_submitting(undefined);
15047
+ if (landed && submitting !== undefined) set_persisted(submitting);
15048
+ });
15049
+ };
15050
+ const abort_on_popstate = what_happened => {
15051
+ if (what_happened === "popstate" && current_submit) end_submit(false);
15052
+ };
15053
+ (0, $52FdA$depictaiutilishared.instant_exec_on_suspect_history_change).add(abort_on_popstate);
15054
+ $52FdA$solidjs.onCleanup(() => (0, $52FdA$depictaiutilishared.instant_exec_on_suspect_history_change).delete(abort_on_popstate));
15055
+ $52FdA$solidjs.createEffect($52FdA$solidjs.on(get_search_query_, query => {
15056
+ const token = current_submit;
15057
+ if (!token || query !== token.query_) return;
15058
+ queueMicrotask(() => {
15059
+ if (current_submit === token) end_submit(true);
15060
+ });
15061
+ }, {
15062
+ defer: true
15063
+ }));
15064
+ const begin_submit_ = (submitted_query, query_of_current_history_entry) => {
15065
+ const token = current_submit = {
15066
+ query_: submitted_query,
15067
+ landed_: false
15068
+ };
15069
+ $52FdA$solidjs.batch(() => {
15070
+ set_submitting(submitted_query);
15071
+ set_persisted(query_of_current_history_entry);
15072
+ });
15073
+ return () => {
15074
+ if (current_submit === token) end_submit(true);
15075
+ return token.landed_;
15076
+ };
15077
+ };
15078
+ const settle_ = query => {
15079
+ if (current_submit) return;
15080
+ $52FdA$solidjs.batch(() => {
15081
+ set_submitting(undefined);
15082
+ set_persisted(query);
15083
+ });
15084
+ };
15085
+ return {
15086
+ value_: [get_value, set_value],
15087
+ begin_submit_: begin_submit_,
15088
+ settle_: settle_
15089
+ };
14973
15090
  }
14974
15091
  function $7a8e55af4ef13fae$export$181cceed5c91919e(callback, alsoRaF, passiveListener) {
14975
15092
  let aligned_this_microtask = false;
@@ -15713,6 +15830,7 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
15713
15830
  scroll_restoration_data_: scroll_restoration_data_,
15714
15831
  product_card_template_: product_card_template_,
15715
15832
  modalAlignmentSignalsRef_: modalAlignmentSignalsRef_,
15833
+ inputFieldRef_: inputFieldRef_,
15716
15834
  router_: router_,
15717
15835
  content_results_rows_: content_results_rows_,
15718
15836
  content_layout_options_: content_layout_options_,
@@ -15917,6 +16035,8 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
15917
16035
  if (!search_field) break add_input_field;
15918
16036
  setModalBodyStyle({});
15919
16037
  modalAlignmentSignalsRef_ === null || modalAlignmentSignalsRef_ === void 0 || modalAlignmentSignalsRef_(alignmentSignals_);
16038
+ inputFieldRef_ === null || inputFieldRef_ === void 0 || inputFieldRef_(input_element);
16039
+ $52FdA$solidjs.onCleanup(() => inputFieldRef_ === null || inputFieldRef_ === void 0 ? void 0 : inputFieldRef_(undefined));
15920
16040
  const [pollAlignment, setPollAlignment_] = $52FdA$solidjs.createSignal(false);
15921
16041
  const align_position = $52FdA$depictaiutilishared.catchify((0, $d6ed4dbb6507996d$export$b3ad617e9036868))(alignmentSignals_, search_field, (0, $d6ed4dbb6507996d$export$3f238c96c45e6cc6) | (0, $d6ed4dbb6507996d$export$7895aadd1956b1c7) | (modalVersionUsed_ === 1 ? (0, $d6ed4dbb6507996d$export$902f8b4a7dae5d78) : (0, $d6ed4dbb6507996d$export$6060bc6bee850eb6) | (0, $d6ed4dbb6507996d$export$5097308c5200105a)), true, pollAlignment);
15922
16042
  div_with_field_class.addEventListener("click", $52FdA$depictaiutilishared.catchify(e => {
@@ -16326,14 +16446,16 @@ class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
16326
16446
  set_search_content_results_rows((0, $eab939d0b95b75ee$export$70ceae36059a1036));
16327
16447
  }; // do this every time after we have submitted a new query - otherwise there might already be a saved number of rows in the state
16328
16448
  const on_submit_with_unchanged_value_ = () => this.modal_open = false;
16329
- const [get_search_field_value_, set_search_field_value_] = state_.field_value;
16330
- const configured_submit_query_ = new_query => $7f680455a2aa1079$export$e16630ecb9644a1c({
16449
+ const search_field_value_ = $24f1a81b790e371c$export$d13a185c53aa5edf(state_.field_value, get_search_query_);
16450
+ const [get_search_field_value_] = search_field_value_.value_;
16451
+ const configured_submit_query_ = (new_query, before_navigate_) => $7f680455a2aa1079$export$e16630ecb9644a1c({
16331
16452
  on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
16332
- set_search_field_value_: set_search_field_value_,
16453
+ search_field_value_: search_field_value_,
16333
16454
  get_search_query_: get_search_query_,
16334
16455
  search_param_name_: search_query_url_param_name_,
16335
16456
  after_submit_: after_submit_,
16336
- get_new_query: () => new_query || $52FdA$solidjs.untrack(get_search_field_value_),
16457
+ before_navigate_: before_navigate_,
16458
+ get_new_query: () => new_query !== null && new_query !== void 0 ? new_query : $52FdA$solidjs.untrack(get_search_field_value_),
16337
16459
  url_transformer_: url_transformer,
16338
16460
  router_: $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet)(this, $ddd39c5f36f49703$var$_router)
16339
16461
  });
@@ -16352,6 +16474,7 @@ class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
16352
16474
  search_query_url_param_name_: search_query_url_param_name_,
16353
16475
  reset_history_state_: reset_history_state_,
16354
16476
  state_: state_,
16477
+ search_field_value_: search_field_value_.value_,
16355
16478
  router_: $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet)(this, $ddd39c5f36f49703$var$_router),
16356
16479
  url_transformer_: url_transformer,
16357
16480
  depict_api_: depict_api_,
@@ -16375,7 +16498,11 @@ class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
16375
16498
  $52FdA$solidjs.onCleanup(() => _this.modal_open = false);
16376
16499
  return searchModalComponent(...arguments);
16377
16500
  }, {
16378
- search_field_value_: state_.field_value,
16501
+ search_field_value_: search_field_value_.value_,
16502
+ get_search_page_input_element_: () => {
16503
+ var _privately_shared_pro2;
16504
+ return (_privately_shared_pro2 = $ddd39c5f36f49703$export$dde08b2dca8cc1ce.get(this)) === null || _privately_shared_pro2 === void 0 ? void 0 : _privately_shared_pro2.search_page_input_element_;
16505
+ },
16379
16506
  get_search_query_: get_search_query_,
16380
16507
  search_query_url_param_name_: search_query_url_param_name_,
16381
16508
  previous_searches_: previous_searches,
@@ -16540,6 +16667,7 @@ function $ddd39c5f36f49703$export$f2dc7e4e4aa11abb(props) {
16540
16667
  const {
16541
16668
  state_: state_
16542
16669
  } = shared_properties;
16670
+ let registered_input_element;
16543
16671
  const grid_spacing_override = $52FdA$solidjs.createMemo(() => {
16544
16672
  const {
16545
16673
  grid_spacing: grid_spacing
@@ -16571,7 +16699,7 @@ function $ddd39c5f36f49703$export$f2dc7e4e4aa11abb(props) {
16571
16699
  var _depict_search$enable;
16572
16700
  return (_depict_search$enable = depict_search.enable_content_search) !== null && _depict_search$enable !== void 0 ? _depict_search$enable : $ddd39c5f36f49703$var$content_search_default;
16573
16701
  },
16574
- search_field_value_: state_.field_value,
16702
+ search_field_value_: shared_properties.search_field_value_,
16575
16703
  get_search_query_: shared_properties.get_search_query_,
16576
16704
  clear_filters_on_next_submit_: shared_properties.clear_filters_on_next_submit_,
16577
16705
  open_modal_: function () {
@@ -16582,6 +16710,16 @@ function $ddd39c5f36f49703$export$f2dc7e4e4aa11abb(props) {
16582
16710
  modalVersionUsed_: shared_properties.modalVersionUsed_,
16583
16711
  showSliderArrow_: () => props.showSliderArrow_,
16584
16712
  i18n_: shared_properties.i18n_,
16713
+ inputFieldRef_: input_element => {
16714
+ const shared_info_right_now = $ddd39c5f36f49703$export$dde08b2dca8cc1ce.get(depict_search);
16715
+ if (!shared_info_right_now) return;
16716
+ if (input_element === undefined && shared_info_right_now.search_page_input_element_ !== registered_input_element) return;
16717
+ registered_input_element = input_element;
16718
+ $ddd39c5f36f49703$export$dde08b2dca8cc1ce.set(depict_search, {
16719
+ ...shared_info_right_now,
16720
+ search_page_input_element_: input_element
16721
+ });
16722
+ },
16585
16723
  modalAlignmentSignalsRef_: style => {
16586
16724
  const shared_info_right_now = $ddd39c5f36f49703$export$dde08b2dca8cc1ce.get(depict_search);
16587
16725
  if (!shared_info_right_now) return;
@@ -17028,7 +17166,7 @@ function $98aef9965764903d$export$316f6f283ae64765(props) {
17028
17166
  return shared_properties.BackIcon_;
17029
17167
  },
17030
17168
  get search_field_value_() {
17031
- return shared_properties.state_.field_value;
17169
+ return shared_properties.search_field_value_;
17032
17170
  },
17033
17171
  get submit_query_() {
17034
17172
  return shared_properties.configured_submit_query_;
@@ -17071,7 +17209,7 @@ function $98aef9965764903d$export$316f6f283ae64765(props) {
17071
17209
  return shared_properties.BackIcon_;
17072
17210
  },
17073
17211
  get search_field_value_() {
17074
- return shared_properties.state_.field_value;
17212
+ return shared_properties.search_field_value_;
17075
17213
  },
17076
17214
  get submit_query_() {
17077
17215
  return shared_properties.configured_submit_query_;
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.10.19";
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;