@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 +178 -40
- package/ES10/index.d.ts +12 -3
- package/ES10/index.js +178 -40
- package/latest/index.cjs +169 -40
- package/latest/index.d.ts +12 -3
- package/latest/index.js +169 -40
- package/package.json +4 -4
- package/server/ES10/index.cjs +177 -39
- package/server/ES10/index.d.ts +12 -3
- package/server/ES10/index.js +177 -39
- package/server/latest/index.cjs +168 -39
- package/server/latest/index.d.ts +12 -3
- package/server/latest/index.js +168 -39
package/latest/index.cjs
CHANGED
|
@@ -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.
|
|
112
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.10.20";
|
|
113
113
|
function $b54e6192d0caa293$export$d9f36cf74e24d595(media_query) {
|
|
114
114
|
const signal = $gVhhF$solidjs.createSignal(false);
|
|
115
115
|
$gVhhF$solidjs.onCleanup($gVhhF$depictaiutilishared.javascript_media_query(media_query, ({
|
|
@@ -2593,6 +2593,7 @@ async function $9abb0a35d4b60ed3$export$79b1565500412d9b(search_modal, modal_fn_
|
|
|
2593
2593
|
const modal_els = $gVhhF$solidjs.createRoot(dispose => {
|
|
2594
2594
|
let closing_animation;
|
|
2595
2595
|
let animation_started;
|
|
2596
|
+
let focus_target_after_close;
|
|
2596
2597
|
dispose_and_remove = () => {
|
|
2597
2598
|
const actually_close = () => {
|
|
2598
2599
|
dispose();
|
|
@@ -2611,11 +2612,19 @@ async function $9abb0a35d4b60ed3$export$79b1565500412d9b(search_modal, modal_fn_
|
|
|
2611
2612
|
activeElement?.blur?.();
|
|
2612
2613
|
el.remove();
|
|
2613
2614
|
});
|
|
2614
|
-
|
|
2615
|
+
const requested_focus_target = focus_target_after_close?.();
|
|
2616
|
+
if (should_restore_focus && (requested_focus_target?.isConnected || element_focused_before_open?.isConnected)) {
|
|
2615
2617
|
restoring_focus = true;
|
|
2616
2618
|
try {
|
|
2617
2619
|
// preventScroll so this can't re-introduce the safari page-jump the blur() above works around
|
|
2618
|
-
|
|
2620
|
+
let focused = false;
|
|
2621
|
+
if (requested_focus_target?.isConnected) {
|
|
2622
|
+
requested_focus_target.focus({
|
|
2623
|
+
preventScroll: true
|
|
2624
|
+
});
|
|
2625
|
+
focused = requested_focus_target.getRootNode().activeElement === requested_focus_target;
|
|
2626
|
+
}
|
|
2627
|
+
if (!focused && element_focused_before_open?.isConnected) element_focused_before_open.focus({
|
|
2619
2628
|
preventScroll: true
|
|
2620
2629
|
});
|
|
2621
2630
|
} finally {
|
|
@@ -2636,7 +2645,8 @@ async function $9abb0a35d4b60ed3$export$79b1565500412d9b(search_modal, modal_fn_
|
|
|
2636
2645
|
...extra_options_for_modal,
|
|
2637
2646
|
close_modal_: close_modal_,
|
|
2638
2647
|
open_modal_: open_modal_,
|
|
2639
|
-
register_closing_animation_: animation => closing_animation = animation
|
|
2648
|
+
register_closing_animation_: animation => closing_animation = animation,
|
|
2649
|
+
set_focus_target_after_close_: get_target => focus_target_after_close = get_target
|
|
2640
2650
|
});
|
|
2641
2651
|
});
|
|
2642
2652
|
body.append(...modal_els);
|
|
@@ -10808,6 +10818,7 @@ var $66b8b9a9613c141d$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<but
|
|
|
10808
10818
|
$66b8b9a9613c141d$var$_tmpl$3 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class=spacer>`),
|
|
10809
10819
|
$66b8b9a9613c141d$var$_tmpl$4 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<button class="submit major"type=button>`),
|
|
10810
10820
|
$66b8b9a9613c141d$var$_tmpl$5 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div><!$><!/><!$><!/><div class=field><!$><!/><input class=query tabindex=0 enterkeyhint=search><!$><!/></div><!$><!/><!$><!/>`);
|
|
10821
|
+
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"]);
|
|
10811
10822
|
function $66b8b9a9613c141d$export$b94867ecbd698f21({
|
|
10812
10823
|
search_field_value_: [searchFieldValue, setSearchFieldValue],
|
|
10813
10824
|
input_field_ref_: input_field_ref_,
|
|
@@ -10985,7 +10996,7 @@ function $66b8b9a9613c141d$export$b94867ecbd698f21({
|
|
|
10985
10996
|
get onKeyDown() {
|
|
10986
10997
|
return $gVhhF$depictaiutilishared.catchify(e => {
|
|
10987
10998
|
if (disabled_) {
|
|
10988
|
-
if (e.key
|
|
10999
|
+
if (!$66b8b9a9613c141d$var$keys_not_opening_modal.has(e.key) && !/^F\d{1,2}$/.test(e.key))
|
|
10989
11000
|
// 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
|
|
10990
11001
|
input_element.click();
|
|
10991
11002
|
} else if (e.key === "Enter") {
|
|
@@ -11088,6 +11099,31 @@ function $eb3039a27db40508$export$93d9bfd0c9c1a5b8(close_modal, search_query_url
|
|
|
11088
11099
|
}
|
|
11089
11100
|
})();
|
|
11090
11101
|
}
|
|
11102
|
+
function $5f9dc76a99175920$export$9e9e2ae069cf2fe1({
|
|
11103
|
+
props_search_field_value_: props_search_field_value_,
|
|
11104
|
+
props_submit_query_: props_submit_query_,
|
|
11105
|
+
dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_,
|
|
11106
|
+
set_focus_target_after_close_: set_focus_target_after_close_,
|
|
11107
|
+
get_search_page_input_element_: get_search_page_input_element_
|
|
11108
|
+
}) {
|
|
11109
|
+
const search_field_value_ = dont_sync_search_field_value_except_on_submit_ ? $gVhhF$solidjs.createSignal("") : props_search_field_value_;
|
|
11110
|
+
let submits_in_flight = 0;
|
|
11111
|
+
const submit_query_ = async (new_query = $gVhhF$solidjs.untrack(search_field_value_[0])) => {
|
|
11112
|
+
submits_in_flight++;
|
|
11113
|
+
try {
|
|
11114
|
+
return await props_submit_query_(new_query, () => set_focus_target_after_close_(get_search_page_input_element_));
|
|
11115
|
+
} finally {
|
|
11116
|
+
submits_in_flight--;
|
|
11117
|
+
}
|
|
11118
|
+
};
|
|
11119
|
+
if (dont_sync_search_field_value_except_on_submit_) $gVhhF$solidjs.createEffect($gVhhF$solidjs.on(search_field_value_[0], value => submits_in_flight > 0 && props_search_field_value_[1](value), {
|
|
11120
|
+
defer: true
|
|
11121
|
+
}));
|
|
11122
|
+
return {
|
|
11123
|
+
search_field_value_: search_field_value_,
|
|
11124
|
+
submit_query_: submit_query_
|
|
11125
|
+
};
|
|
11126
|
+
}
|
|
11091
11127
|
var $44f0b2e312a9b710$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class=discover-more><button class=major type=button>`),
|
|
11092
11128
|
$44f0b2e312a9b710$var$_tmpl$2 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<b>`),
|
|
11093
11129
|
$44f0b2e312a9b710$var$_tmpl$3 = /*#__PURE__*/$gVhhF$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><!$><!/>`),
|
|
@@ -11101,6 +11137,8 @@ function $44f0b2e312a9b710$var$RawClassicSearchModal({
|
|
|
11101
11137
|
search_query_url_param_name_: search_query_url_param_name_,
|
|
11102
11138
|
previous_searches_: previous_searches_,
|
|
11103
11139
|
close_modal_: close_modal_,
|
|
11140
|
+
set_focus_target_after_close_: set_focus_target_after_close_,
|
|
11141
|
+
get_search_page_input_element_: get_search_page_input_element_,
|
|
11104
11142
|
depict_api_: depict_api_,
|
|
11105
11143
|
merchant_: merchant_,
|
|
11106
11144
|
market_: market_,
|
|
@@ -11125,15 +11163,16 @@ function $44f0b2e312a9b710$var$RawClassicSearchModal({
|
|
|
11125
11163
|
// 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.
|
|
11126
11164
|
// 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
|
|
11127
11165
|
// Basically the UI signals that the button that opens the modal starts a new search.
|
|
11128
|
-
const
|
|
11129
|
-
|
|
11130
|
-
|
|
11131
|
-
|
|
11132
|
-
|
|
11133
|
-
|
|
11134
|
-
|
|
11135
|
-
|
|
11136
|
-
|
|
11166
|
+
const {
|
|
11167
|
+
search_field_value_: search_field_value_,
|
|
11168
|
+
submit_query_: submit_query_
|
|
11169
|
+
} = $5f9dc76a99175920$export$9e9e2ae069cf2fe1({
|
|
11170
|
+
props_search_field_value_: props_search_field_value,
|
|
11171
|
+
props_submit_query_: props_submit_query,
|
|
11172
|
+
dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_,
|
|
11173
|
+
set_focus_target_after_close_: set_focus_target_after_close_,
|
|
11174
|
+
get_search_page_input_element_: get_search_page_input_element_
|
|
11175
|
+
});
|
|
11137
11176
|
const [input_field, set_input_field] = $gVhhF$solidjs.createSignal();
|
|
11138
11177
|
const [get_search_field_value_] = search_field_value_;
|
|
11139
11178
|
// Search field alignment unused in ClassicSearchModal since the search field spans the whole modal
|
|
@@ -11928,6 +11967,8 @@ function $11597ae03e703a47$var$RawSearchModalV2({
|
|
|
11928
11967
|
search_query_url_param_name_: search_query_url_param_name_,
|
|
11929
11968
|
previous_searches_: previous_searches_,
|
|
11930
11969
|
close_modal_: close_modal_,
|
|
11970
|
+
set_focus_target_after_close_: set_focus_target_after_close_,
|
|
11971
|
+
get_search_page_input_element_: get_search_page_input_element_,
|
|
11931
11972
|
alignmentSignals_: alignmentSignals_,
|
|
11932
11973
|
depict_api_: depict_api_,
|
|
11933
11974
|
merchant_: merchant_,
|
|
@@ -11958,15 +11999,16 @@ function $11597ae03e703a47$var$RawSearchModalV2({
|
|
|
11958
11999
|
// 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.
|
|
11959
12000
|
// 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
|
|
11960
12001
|
// Basically the UI signals that the button that opens the modal starts a new search.
|
|
11961
|
-
const
|
|
11962
|
-
|
|
11963
|
-
|
|
11964
|
-
|
|
11965
|
-
|
|
11966
|
-
|
|
11967
|
-
|
|
11968
|
-
|
|
11969
|
-
|
|
12002
|
+
const {
|
|
12003
|
+
search_field_value_: search_field_value_,
|
|
12004
|
+
submit_query_: submit_query_
|
|
12005
|
+
} = $5f9dc76a99175920$export$9e9e2ae069cf2fe1({
|
|
12006
|
+
props_search_field_value_: props_search_field_value,
|
|
12007
|
+
props_submit_query_: props_submit_query,
|
|
12008
|
+
dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_,
|
|
12009
|
+
set_focus_target_after_close_: set_focus_target_after_close_,
|
|
12010
|
+
get_search_page_input_element_: get_search_page_input_element_
|
|
12011
|
+
});
|
|
11970
12012
|
const [input_field, set_input_field] = $gVhhF$solidjs.createSignal();
|
|
11971
12013
|
const [searching_for_value_, set_searching_for_value_] = $gVhhF$solidjs.createSignal();
|
|
11972
12014
|
const [show_stale_content_results_, set_show_stale_content_results_] = $gVhhF$solidjs.createSignal(false);
|
|
@@ -14097,11 +14139,12 @@ function $2b7a005a65221045$export$84bba84a7b837187(read_search_query) {
|
|
|
14097
14139
|
async function $f328bd45f8ede33c$export$e16630ecb9644a1c({
|
|
14098
14140
|
on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
|
|
14099
14141
|
search_param_name_: search_param_name_,
|
|
14100
|
-
|
|
14142
|
+
search_field_value_: search_field_value_,
|
|
14101
14143
|
get_search_query_: get_search_query_,
|
|
14102
14144
|
url_transformer_: url_transformer_,
|
|
14103
14145
|
router_: router_,
|
|
14104
14146
|
after_submit_: after_submit_,
|
|
14147
|
+
before_navigate_: before_navigate_,
|
|
14105
14148
|
get_new_query: get_new_query
|
|
14106
14149
|
}) {
|
|
14107
14150
|
const new_search_query = get_new_query();
|
|
@@ -14109,21 +14152,89 @@ async function $f328bd45f8ede33c$export$e16630ecb9644a1c({
|
|
|
14109
14152
|
if (previous_query === new_search_query && new URLSearchParams(location.search).has(search_param_name_)) {
|
|
14110
14153
|
// don't push a history entry / re-search if someone submits a search again
|
|
14111
14154
|
// do close the modal though
|
|
14155
|
+
search_field_value_.settle_(new_search_query);
|
|
14112
14156
|
on_submit_with_unchanged_value_?.();
|
|
14113
|
-
return;
|
|
14157
|
+
return false;
|
|
14114
14158
|
}
|
|
14115
|
-
set_search_field_value_(previous_query); // restore the value to the previous query since this one goes to the new history entry
|
|
14116
14159
|
const target_url = new URL(location.href);
|
|
14117
14160
|
url_transformer_?.(target_url);
|
|
14118
14161
|
target_url.searchParams.set(search_param_name_, new_search_query);
|
|
14119
|
-
|
|
14120
|
-
|
|
14121
|
-
|
|
14122
|
-
|
|
14123
|
-
|
|
14124
|
-
|
|
14162
|
+
const end_submit = search_field_value_.begin_submit_(new_search_query, previous_query);
|
|
14163
|
+
before_navigate_?.();
|
|
14164
|
+
let landed;
|
|
14165
|
+
try {
|
|
14166
|
+
await router_.navigate_.go_to_({
|
|
14167
|
+
new_url_: target_url,
|
|
14168
|
+
is_replace_: false,
|
|
14169
|
+
force_spa_navigation_: true
|
|
14170
|
+
});
|
|
14171
|
+
} finally {
|
|
14172
|
+
landed = end_submit();
|
|
14173
|
+
}
|
|
14174
|
+
if (!landed) return false;
|
|
14125
14175
|
scrollTo(0, 0);
|
|
14126
14176
|
after_submit_?.();
|
|
14177
|
+
return true;
|
|
14178
|
+
}
|
|
14179
|
+
function $380b434363eee5f6$export$d13a185c53aa5edf(persisted_, get_search_query_) {
|
|
14180
|
+
const [get_persisted, set_persisted] = persisted_;
|
|
14181
|
+
const [get_submitting, set_submitting] = $gVhhF$solidjs.createSignal();
|
|
14182
|
+
const get_value = $gVhhF$solidjs.createMemo(() => get_submitting() ?? get_persisted());
|
|
14183
|
+
const set_value = value => {
|
|
14184
|
+
const new_value = typeof value === "function" ? value($gVhhF$solidjs.untrack(get_value)) : value;
|
|
14185
|
+
if ($gVhhF$solidjs.untrack(get_submitting) === undefined) set_persisted(new_value);else set_submitting(new_value);
|
|
14186
|
+
return new_value;
|
|
14187
|
+
};
|
|
14188
|
+
let current_submit;
|
|
14189
|
+
const end_submit = landed => {
|
|
14190
|
+
current_submit.landed_ = landed;
|
|
14191
|
+
current_submit = undefined;
|
|
14192
|
+
$gVhhF$solidjs.batch(() => {
|
|
14193
|
+
const submitting = $gVhhF$solidjs.untrack(get_submitting);
|
|
14194
|
+
set_submitting(undefined);
|
|
14195
|
+
if (landed && submitting !== undefined) set_persisted(submitting);
|
|
14196
|
+
});
|
|
14197
|
+
};
|
|
14198
|
+
const abort_on_popstate = what_happened => {
|
|
14199
|
+
if (what_happened === "popstate" && current_submit) end_submit(false);
|
|
14200
|
+
};
|
|
14201
|
+
(0, $gVhhF$depictaiutilishared.instant_exec_on_suspect_history_change).add(abort_on_popstate);
|
|
14202
|
+
$gVhhF$solidjs.onCleanup(() => (0, $gVhhF$depictaiutilishared.instant_exec_on_suspect_history_change).delete(abort_on_popstate));
|
|
14203
|
+
$gVhhF$solidjs.createEffect($gVhhF$solidjs.on(get_search_query_, query => {
|
|
14204
|
+
const token = current_submit;
|
|
14205
|
+
if (!token || query !== token.query_) return;
|
|
14206
|
+
queueMicrotask(() => {
|
|
14207
|
+
if (current_submit === token) end_submit(true);
|
|
14208
|
+
});
|
|
14209
|
+
}, {
|
|
14210
|
+
defer: true
|
|
14211
|
+
}));
|
|
14212
|
+
const begin_submit_ = (submitted_query, query_of_current_history_entry) => {
|
|
14213
|
+
const token = current_submit = {
|
|
14214
|
+
query_: submitted_query,
|
|
14215
|
+
landed_: false
|
|
14216
|
+
};
|
|
14217
|
+
$gVhhF$solidjs.batch(() => {
|
|
14218
|
+
set_submitting(submitted_query);
|
|
14219
|
+
set_persisted(query_of_current_history_entry);
|
|
14220
|
+
});
|
|
14221
|
+
return () => {
|
|
14222
|
+
if (current_submit === token) end_submit(true);
|
|
14223
|
+
return token.landed_;
|
|
14224
|
+
};
|
|
14225
|
+
};
|
|
14226
|
+
const settle_ = query => {
|
|
14227
|
+
if (current_submit) return;
|
|
14228
|
+
$gVhhF$solidjs.batch(() => {
|
|
14229
|
+
set_submitting(undefined);
|
|
14230
|
+
set_persisted(query);
|
|
14231
|
+
});
|
|
14232
|
+
};
|
|
14233
|
+
return {
|
|
14234
|
+
value_: [get_value, set_value],
|
|
14235
|
+
begin_submit_: begin_submit_,
|
|
14236
|
+
settle_: settle_
|
|
14237
|
+
};
|
|
14127
14238
|
}
|
|
14128
14239
|
function $331c7a65de274e6c$export$181cceed5c91919e(callback, alsoRaF, passiveListener) {
|
|
14129
14240
|
let aligned_this_microtask = false;
|
|
@@ -14827,6 +14938,7 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
|
|
|
14827
14938
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
14828
14939
|
product_card_template_: product_card_template_,
|
|
14829
14940
|
modalAlignmentSignalsRef_: modalAlignmentSignalsRef_,
|
|
14941
|
+
inputFieldRef_: inputFieldRef_,
|
|
14830
14942
|
router_: router_,
|
|
14831
14943
|
content_results_rows_: content_results_rows_,
|
|
14832
14944
|
content_layout_options_: content_layout_options_,
|
|
@@ -15015,6 +15127,8 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
|
|
|
15015
15127
|
if (!search_field) break add_input_field;
|
|
15016
15128
|
setModalBodyStyle({});
|
|
15017
15129
|
modalAlignmentSignalsRef_?.(alignmentSignals_);
|
|
15130
|
+
inputFieldRef_?.(input_element);
|
|
15131
|
+
$gVhhF$solidjs.onCleanup(() => inputFieldRef_?.(undefined));
|
|
15018
15132
|
const [pollAlignment, setPollAlignment_] = $gVhhF$solidjs.createSignal(false);
|
|
15019
15133
|
const align_position = $gVhhF$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);
|
|
15020
15134
|
div_with_field_class.addEventListener("click", $gVhhF$depictaiutilishared.catchify(e => {
|
|
@@ -15357,14 +15471,16 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
|
|
|
15357
15471
|
set_search_content_results_rows((0, $3716b8caf7f959e2$export$70ceae36059a1036));
|
|
15358
15472
|
}; // do this every time after we have submitted a new query - otherwise there might already be a saved number of rows in the state
|
|
15359
15473
|
const on_submit_with_unchanged_value_ = () => this.modal_open = false;
|
|
15360
|
-
const
|
|
15361
|
-
const
|
|
15474
|
+
const search_field_value_ = $380b434363eee5f6$export$d13a185c53aa5edf(state_.field_value, get_search_query_);
|
|
15475
|
+
const [get_search_field_value_] = search_field_value_.value_;
|
|
15476
|
+
const configured_submit_query_ = (new_query, before_navigate_) => $f328bd45f8ede33c$export$e16630ecb9644a1c({
|
|
15362
15477
|
on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
|
|
15363
|
-
|
|
15478
|
+
search_field_value_: search_field_value_,
|
|
15364
15479
|
get_search_query_: get_search_query_,
|
|
15365
15480
|
search_param_name_: search_query_url_param_name_,
|
|
15366
15481
|
after_submit_: after_submit_,
|
|
15367
|
-
|
|
15482
|
+
before_navigate_: before_navigate_,
|
|
15483
|
+
get_new_query: () => new_query ?? $gVhhF$solidjs.untrack(get_search_field_value_),
|
|
15368
15484
|
url_transformer_: url_transformer,
|
|
15369
15485
|
router_: this.#router
|
|
15370
15486
|
});
|
|
@@ -15383,6 +15499,7 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
|
|
|
15383
15499
|
search_query_url_param_name_: search_query_url_param_name_,
|
|
15384
15500
|
reset_history_state_: reset_history_state_,
|
|
15385
15501
|
state_: state_,
|
|
15502
|
+
search_field_value_: search_field_value_.value_,
|
|
15386
15503
|
router_: this.#router,
|
|
15387
15504
|
url_transformer_: url_transformer,
|
|
15388
15505
|
depict_api_: depict_api_,
|
|
@@ -15406,7 +15523,8 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
|
|
|
15406
15523
|
$gVhhF$solidjs.onCleanup(() => this.modal_open = false);
|
|
15407
15524
|
return searchModalComponent(...args);
|
|
15408
15525
|
}, {
|
|
15409
|
-
search_field_value_:
|
|
15526
|
+
search_field_value_: search_field_value_.value_,
|
|
15527
|
+
get_search_page_input_element_: () => $2c61e4cd8229c49a$export$dde08b2dca8cc1ce.get(this)?.search_page_input_element_,
|
|
15410
15528
|
get_search_query_: get_search_query_,
|
|
15411
15529
|
search_query_url_param_name_: search_query_url_param_name_,
|
|
15412
15530
|
previous_searches_: previous_searches,
|
|
@@ -15554,6 +15672,7 @@ function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
|
|
|
15554
15672
|
const {
|
|
15555
15673
|
state_: state_
|
|
15556
15674
|
} = shared_properties;
|
|
15675
|
+
let registered_input_element;
|
|
15557
15676
|
const grid_spacing_override = $gVhhF$solidjs.createMemo(() => {
|
|
15558
15677
|
const {
|
|
15559
15678
|
grid_spacing: grid_spacing
|
|
@@ -15582,7 +15701,7 @@ function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
|
|
|
15582
15701
|
min_products_to_fetch_: $2c61e4cd8229c49a$var$min_products_to_fetch_,
|
|
15583
15702
|
local_filter_cache_: state_.local_filter_cache,
|
|
15584
15703
|
content_search_enabled_: () => depict_search.enable_content_search ?? $2c61e4cd8229c49a$var$content_search_default,
|
|
15585
|
-
search_field_value_:
|
|
15704
|
+
search_field_value_: shared_properties.search_field_value_,
|
|
15586
15705
|
get_search_query_: shared_properties.get_search_query_,
|
|
15587
15706
|
clear_filters_on_next_submit_: shared_properties.clear_filters_on_next_submit_,
|
|
15588
15707
|
open_modal_: (...args) => depict_search.modal_open = args,
|
|
@@ -15590,6 +15709,16 @@ function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
|
|
|
15590
15709
|
modalVersionUsed_: shared_properties.modalVersionUsed_,
|
|
15591
15710
|
showSliderArrow_: () => props.showSliderArrow_,
|
|
15592
15711
|
i18n_: shared_properties.i18n_,
|
|
15712
|
+
inputFieldRef_: input_element => {
|
|
15713
|
+
const shared_info_right_now = $2c61e4cd8229c49a$export$dde08b2dca8cc1ce.get(depict_search);
|
|
15714
|
+
if (!shared_info_right_now) return;
|
|
15715
|
+
if (input_element === undefined && shared_info_right_now.search_page_input_element_ !== registered_input_element) return;
|
|
15716
|
+
registered_input_element = input_element;
|
|
15717
|
+
$2c61e4cd8229c49a$export$dde08b2dca8cc1ce.set(depict_search, {
|
|
15718
|
+
...shared_info_right_now,
|
|
15719
|
+
search_page_input_element_: input_element
|
|
15720
|
+
});
|
|
15721
|
+
},
|
|
15593
15722
|
modalAlignmentSignalsRef_: style => {
|
|
15594
15723
|
const shared_info_right_now = $2c61e4cd8229c49a$export$dde08b2dca8cc1ce.get(depict_search);
|
|
15595
15724
|
if (!shared_info_right_now) return;
|
|
@@ -15940,7 +16069,7 @@ function $c0a0659cf97e8eb2$export$316f6f283ae64765(props) {
|
|
|
15940
16069
|
return shared_properties.BackIcon_;
|
|
15941
16070
|
},
|
|
15942
16071
|
get search_field_value_() {
|
|
15943
|
-
return shared_properties.
|
|
16072
|
+
return shared_properties.search_field_value_;
|
|
15944
16073
|
},
|
|
15945
16074
|
get submit_query_() {
|
|
15946
16075
|
return shared_properties.configured_submit_query_;
|
|
@@ -15983,7 +16112,7 @@ function $c0a0659cf97e8eb2$export$316f6f283ae64765(props) {
|
|
|
15983
16112
|
return shared_properties.BackIcon_;
|
|
15984
16113
|
},
|
|
15985
16114
|
get search_field_value_() {
|
|
15986
|
-
return shared_properties.
|
|
16115
|
+
return shared_properties.search_field_value_;
|
|
15987
16116
|
},
|
|
15988
16117
|
get submit_query_() {
|
|
15989
16118
|
return shared_properties.configured_submit_query_;
|
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.10.
|
|
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) =>
|
|
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) =>
|
|
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;
|