@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.
- package/ES10/index.cjs +220 -52
- package/ES10/index.d.ts +12 -3
- package/ES10/index.js +220 -52
- package/latest/index.cjs +211 -52
- package/latest/index.d.ts +12 -3
- package/latest/index.js +211 -52
- package/package.json +4 -4
- package/server/ES10/index.cjs +206 -48
- package/server/ES10/index.d.ts +12 -3
- package/server/ES10/index.js +206 -48
- package/server/latest/index.cjs +197 -48
- package/server/latest/index.d.ts +12 -3
- package/server/latest/index.js +197 -48
package/server/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.
|
|
118
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.10.20";
|
|
119
119
|
function $3e17e871e9d0911d$export$d9f36cf74e24d595(media_query) {
|
|
120
120
|
const signal = $3hooq$solidjs.createSignal(false);
|
|
121
121
|
$3hooq$solidjs.onCleanup($3hooq$depictaiutilishared.javascript_media_query(media_query, _ref => {
|
|
@@ -2249,8 +2249,10 @@ async function $4cf7d9829d60d844$export$79b1565500412d9b(search_modal, modal_fn_
|
|
|
2249
2249
|
const modal_els = $3hooq$solidjs.createRoot(dispose => {
|
|
2250
2250
|
let closing_animation;
|
|
2251
2251
|
let animation_started;
|
|
2252
|
+
let focus_target_after_close;
|
|
2252
2253
|
dispose_and_remove = () => {
|
|
2253
2254
|
const actually_close = () => {
|
|
2255
|
+
var _focus_target_after_c;
|
|
2254
2256
|
dispose();
|
|
2255
2257
|
on_dispose === null || on_dispose === void 0 || on_dispose();
|
|
2256
2258
|
const {
|
|
@@ -2269,11 +2271,19 @@ async function $4cf7d9829d60d844$export$79b1565500412d9b(search_modal, modal_fn_
|
|
|
2269
2271
|
}
|
|
2270
2272
|
el.remove();
|
|
2271
2273
|
});
|
|
2272
|
-
|
|
2274
|
+
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();
|
|
2275
|
+
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)) {
|
|
2273
2276
|
restoring_focus = true;
|
|
2274
2277
|
try {
|
|
2275
2278
|
// preventScroll so this can't re-introduce the safari page-jump the blur() above works around
|
|
2276
|
-
|
|
2279
|
+
let focused = false;
|
|
2280
|
+
if (requested_focus_target !== null && requested_focus_target !== void 0 && requested_focus_target.isConnected) {
|
|
2281
|
+
requested_focus_target.focus({
|
|
2282
|
+
preventScroll: true
|
|
2283
|
+
});
|
|
2284
|
+
focused = requested_focus_target.getRootNode().activeElement === requested_focus_target;
|
|
2285
|
+
}
|
|
2286
|
+
if (!focused && element_focused_before_open !== null && element_focused_before_open !== void 0 && element_focused_before_open.isConnected) element_focused_before_open.focus({
|
|
2277
2287
|
preventScroll: true
|
|
2278
2288
|
});
|
|
2279
2289
|
} finally {
|
|
@@ -2295,7 +2305,8 @@ async function $4cf7d9829d60d844$export$79b1565500412d9b(search_modal, modal_fn_
|
|
|
2295
2305
|
...extra_options_for_modal,
|
|
2296
2306
|
close_modal_: close_modal_,
|
|
2297
2307
|
open_modal_: open_modal_,
|
|
2298
|
-
register_closing_animation_: animation => closing_animation = animation
|
|
2308
|
+
register_closing_animation_: animation => closing_animation = animation,
|
|
2309
|
+
set_focus_target_after_close_: get_target => focus_target_after_close = get_target
|
|
2299
2310
|
});
|
|
2300
2311
|
});
|
|
2301
2312
|
body.append(...modal_els);
|
|
@@ -6744,7 +6755,8 @@ function $f3db423dc84bc35d$export$140423fa4bfb6d63(props) {
|
|
|
6744
6755
|
}));
|
|
6745
6756
|
}
|
|
6746
6757
|
var $c19709057a32b2e7$var$_tmpl$ = ["<video", ' disablepictureinpicture="true" class="d-standard-content"></video>'],
|
|
6747
|
-
$c19709057a32b2e7$var$_tmpl$2 = ["<
|
|
6758
|
+
$c19709057a32b2e7$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>"],
|
|
6759
|
+
$c19709057a32b2e7$var$_tmpl$3 = ["<span", ' class="d-standard-content-text"', ">", "</span>"];
|
|
6748
6760
|
function $c19709057a32b2e7$export$780a853d15174484(_ref) {
|
|
6749
6761
|
let {
|
|
6750
6762
|
link_: link_,
|
|
@@ -6755,7 +6767,8 @@ function $c19709057a32b2e7$export$780a853d15174484(_ref) {
|
|
|
6755
6767
|
aspectRatioWhenAloneInRow_: aspectRatioWhenAloneInRow_,
|
|
6756
6768
|
imageResizer_: imageResizer_,
|
|
6757
6769
|
text_: text_,
|
|
6758
|
-
textPosition_: textPosition_
|
|
6770
|
+
textPosition_: textPosition_,
|
|
6771
|
+
cta_: cta_
|
|
6759
6772
|
} = _ref;
|
|
6760
6773
|
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
|
|
6761
6774
|
const [wrapperSize, setWrapperSize] = $3hooq$solidjs.createSignal();
|
|
@@ -6823,12 +6836,31 @@ function $c19709057a32b2e7$export$780a853d15174484(_ref) {
|
|
|
6823
6836
|
}), $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
6824
6837
|
when: text_,
|
|
6825
6838
|
get children() {
|
|
6826
|
-
return $3hooq$solidjsweb.
|
|
6839
|
+
return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
6840
|
+
when: cta_,
|
|
6841
|
+
get fallback() {
|
|
6842
|
+
return $3hooq$solidjsweb.ssr($c19709057a32b2e7$var$_tmpl$3, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.ssrAttribute("data-position", $3hooq$solidjsweb.escape(textPosition_, true) || "bottom-center", false), $3hooq$solidjsweb.escape(text_));
|
|
6843
|
+
},
|
|
6844
|
+
get children() {
|
|
6845
|
+
return $3hooq$solidjsweb.ssr($c19709057a32b2e7$var$_tmpl$2, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.ssrAttribute("data-position", $3hooq$solidjsweb.escape(textPosition_, true) || "bottom-center", false), $3hooq$solidjsweb.ssrAttribute("data-position", $3hooq$solidjsweb.escape(textPosition_, true) || "bottom-center", false), $3hooq$solidjsweb.escape(text_), $3hooq$solidjsweb.ssrAttribute("data-position", $3hooq$solidjsweb.escape(textPosition_, true) || "bottom-center", false), $3hooq$solidjsweb.escape(cta_));
|
|
6846
|
+
}
|
|
6847
|
+
});
|
|
6827
6848
|
}
|
|
6828
6849
|
})];
|
|
6829
6850
|
}
|
|
6830
6851
|
}));
|
|
6831
6852
|
}
|
|
6853
|
+
const $0c035bbe7e30b438$export$af2c67164f68e9e9 = content => {
|
|
6854
|
+
const {
|
|
6855
|
+
link: link,
|
|
6856
|
+
type: type,
|
|
6857
|
+
url: url,
|
|
6858
|
+
text: text,
|
|
6859
|
+
text_position: text_position,
|
|
6860
|
+
cta: cta
|
|
6861
|
+
} = content;
|
|
6862
|
+
return JSON.stringify([link, type, url, text !== null && text !== void 0 ? text : null, text_position !== null && text_position !== void 0 ? text_position : null, cta !== null && cta !== void 0 ? cta : null]);
|
|
6863
|
+
};
|
|
6832
6864
|
function $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_, products_request_loading_, imageResizer_) {
|
|
6833
6865
|
let hasSeenContentBlock = false;
|
|
6834
6866
|
const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
|
|
@@ -6866,13 +6898,11 @@ function $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_
|
|
|
6866
6898
|
type: type,
|
|
6867
6899
|
url: url,
|
|
6868
6900
|
text: text,
|
|
6869
|
-
text_position: text_position
|
|
6901
|
+
text_position: text_position,
|
|
6902
|
+
cta: cta
|
|
6870
6903
|
}
|
|
6871
6904
|
} = row;
|
|
6872
|
-
|
|
6873
|
-
// This makes the block not flicker when going backwards/forwards if the content is the same on both pages
|
|
6874
|
-
// Also it lets us rewrite the blocks state in the history based on the block aspect ratio without infinite looping
|
|
6875
|
-
const componentCacheKey = JSON.stringify([link, type, url, text !== null && text !== void 0 ? text : null, text_position !== null && text_position !== void 0 ? text_position : null]);
|
|
6905
|
+
const componentCacheKey = $0c035bbe7e30b438$export$af2c67164f68e9e9(row.content);
|
|
6876
6906
|
// 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
|
|
6877
6907
|
const mediaCacheKey = JSON.stringify([link, type, url]);
|
|
6878
6908
|
let component = contentComponents.get(componentCacheKey);
|
|
@@ -6892,7 +6922,8 @@ function $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_
|
|
|
6892
6922
|
})),
|
|
6893
6923
|
imageResizer_: imageResizer_,
|
|
6894
6924
|
text_: text,
|
|
6895
|
-
textPosition_: text_position
|
|
6925
|
+
textPosition_: text_position,
|
|
6926
|
+
cta_: cta
|
|
6896
6927
|
});
|
|
6897
6928
|
contentComponents.set(componentCacheKey, component);
|
|
6898
6929
|
}
|
|
@@ -9363,6 +9394,7 @@ function $34934309832515dc$export$f7658c347b037c3f() {
|
|
|
9363
9394
|
var $29e5dbeb69da7a36$var$_tmpl$ = ["<div", ' style="', '" class="spacer"></div>'],
|
|
9364
9395
|
$29e5dbeb69da7a36$var$_tmpl$2 = ['<div class="field"><!--$-->', "<!--/-->", "<!--$-->", "<!--/--></div>"],
|
|
9365
9396
|
$29e5dbeb69da7a36$var$_tmpl$3 = ["<button", ' class="submit major" type="button"', ">", "</button>"];
|
|
9397
|
+
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"]);
|
|
9366
9398
|
function $29e5dbeb69da7a36$export$b94867ecbd698f21(_ref) {
|
|
9367
9399
|
let {
|
|
9368
9400
|
search_field_value_: [searchFieldValue, setSearchFieldValue],
|
|
@@ -9508,6 +9540,33 @@ function $4b71b4fabdee5753$export$93d9bfd0c9c1a5b8(close_modal, search_query_url
|
|
|
9508
9540
|
}
|
|
9509
9541
|
})();
|
|
9510
9542
|
}
|
|
9543
|
+
function $9ccac7b807fe6451$export$9e9e2ae069cf2fe1(_ref) {
|
|
9544
|
+
let {
|
|
9545
|
+
props_search_field_value_: props_search_field_value_,
|
|
9546
|
+
props_submit_query_: props_submit_query_,
|
|
9547
|
+
dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_,
|
|
9548
|
+
set_focus_target_after_close_: set_focus_target_after_close_,
|
|
9549
|
+
get_search_page_input_element_: get_search_page_input_element_
|
|
9550
|
+
} = _ref;
|
|
9551
|
+
const search_field_value_ = dont_sync_search_field_value_except_on_submit_ ? $3hooq$solidjs.createSignal("") : props_search_field_value_;
|
|
9552
|
+
let submits_in_flight = 0;
|
|
9553
|
+
const submit_query_ = async function () {
|
|
9554
|
+
let new_query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $3hooq$solidjs.untrack(search_field_value_[0]);
|
|
9555
|
+
submits_in_flight++;
|
|
9556
|
+
try {
|
|
9557
|
+
return await props_submit_query_(new_query, () => set_focus_target_after_close_(get_search_page_input_element_));
|
|
9558
|
+
} finally {
|
|
9559
|
+
submits_in_flight--;
|
|
9560
|
+
}
|
|
9561
|
+
};
|
|
9562
|
+
if (dont_sync_search_field_value_except_on_submit_) $3hooq$solidjs.createEffect($3hooq$solidjs.on(search_field_value_[0], value => submits_in_flight > 0 && props_search_field_value_[1](value), {
|
|
9563
|
+
defer: true
|
|
9564
|
+
}));
|
|
9565
|
+
return {
|
|
9566
|
+
search_field_value_: search_field_value_,
|
|
9567
|
+
submit_query_: submit_query_
|
|
9568
|
+
};
|
|
9569
|
+
}
|
|
9511
9570
|
var $9035b24c2dbd3f36$var$_tmpl$ = ["<div", ' class="discover-more"><button class="major" type="button">', "</button></div>"],
|
|
9512
9571
|
$9035b24c2dbd3f36$var$_tmpl$2 = ["<b", ">", "</b>"],
|
|
9513
9572
|
$9035b24c2dbd3f36$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>"],
|
|
@@ -9522,6 +9581,8 @@ function $9035b24c2dbd3f36$var$RawClassicSearchModal(_ref) {
|
|
|
9522
9581
|
search_query_url_param_name_: search_query_url_param_name_,
|
|
9523
9582
|
previous_searches_: previous_searches_,
|
|
9524
9583
|
close_modal_: close_modal_,
|
|
9584
|
+
set_focus_target_after_close_: set_focus_target_after_close_,
|
|
9585
|
+
get_search_page_input_element_: get_search_page_input_element_,
|
|
9525
9586
|
depict_api_: depict_api_,
|
|
9526
9587
|
merchant_: merchant_,
|
|
9527
9588
|
market_: market_,
|
|
@@ -9546,15 +9607,16 @@ function $9035b24c2dbd3f36$var$RawClassicSearchModal(_ref) {
|
|
|
9546
9607
|
// 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.
|
|
9547
9608
|
// 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
|
|
9548
9609
|
// Basically the UI signals that the button that opens the modal starts a new search.
|
|
9549
|
-
const
|
|
9550
|
-
|
|
9551
|
-
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
|
|
9610
|
+
const {
|
|
9611
|
+
search_field_value_: search_field_value_,
|
|
9612
|
+
submit_query_: submit_query_
|
|
9613
|
+
} = $9ccac7b807fe6451$export$9e9e2ae069cf2fe1({
|
|
9614
|
+
props_search_field_value_: props_search_field_value,
|
|
9615
|
+
props_submit_query_: props_submit_query,
|
|
9616
|
+
dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_,
|
|
9617
|
+
set_focus_target_after_close_: set_focus_target_after_close_,
|
|
9618
|
+
get_search_page_input_element_: get_search_page_input_element_
|
|
9619
|
+
});
|
|
9558
9620
|
const [input_field, set_input_field] = $3hooq$solidjs.createSignal();
|
|
9559
9621
|
const [get_search_field_value_] = search_field_value_;
|
|
9560
9622
|
// Search field alignment unused in ClassicSearchModal since the search field spans the whole modal
|
|
@@ -10187,6 +10249,8 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
|
|
|
10187
10249
|
search_query_url_param_name_: search_query_url_param_name_,
|
|
10188
10250
|
previous_searches_: previous_searches_,
|
|
10189
10251
|
close_modal_: close_modal_,
|
|
10252
|
+
set_focus_target_after_close_: set_focus_target_after_close_,
|
|
10253
|
+
get_search_page_input_element_: get_search_page_input_element_,
|
|
10190
10254
|
alignmentSignals_: alignmentSignals_,
|
|
10191
10255
|
depict_api_: depict_api_,
|
|
10192
10256
|
merchant_: merchant_,
|
|
@@ -10217,15 +10281,16 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
|
|
|
10217
10281
|
// 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.
|
|
10218
10282
|
// 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
|
|
10219
10283
|
// Basically the UI signals that the button that opens the modal starts a new search.
|
|
10220
|
-
const
|
|
10221
|
-
|
|
10222
|
-
|
|
10223
|
-
|
|
10224
|
-
|
|
10225
|
-
|
|
10226
|
-
|
|
10227
|
-
|
|
10228
|
-
|
|
10284
|
+
const {
|
|
10285
|
+
search_field_value_: search_field_value_,
|
|
10286
|
+
submit_query_: submit_query_
|
|
10287
|
+
} = $9ccac7b807fe6451$export$9e9e2ae069cf2fe1({
|
|
10288
|
+
props_search_field_value_: props_search_field_value,
|
|
10289
|
+
props_submit_query_: props_submit_query,
|
|
10290
|
+
dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_,
|
|
10291
|
+
set_focus_target_after_close_: set_focus_target_after_close_,
|
|
10292
|
+
get_search_page_input_element_: get_search_page_input_element_
|
|
10293
|
+
});
|
|
10229
10294
|
const [input_field, set_input_field] = $3hooq$solidjs.createSignal();
|
|
10230
10295
|
const [searching_for_value_, set_searching_for_value_] = $3hooq$solidjs.createSignal();
|
|
10231
10296
|
const [show_stale_content_results_, set_show_stale_content_results_] = $3hooq$solidjs.createSignal(false);
|
|
@@ -12234,11 +12299,12 @@ async function $7f680455a2aa1079$export$e16630ecb9644a1c(_ref) {
|
|
|
12234
12299
|
let {
|
|
12235
12300
|
on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
|
|
12236
12301
|
search_param_name_: search_param_name_,
|
|
12237
|
-
|
|
12302
|
+
search_field_value_: search_field_value_,
|
|
12238
12303
|
get_search_query_: get_search_query_,
|
|
12239
12304
|
url_transformer_: url_transformer_,
|
|
12240
12305
|
router_: router_,
|
|
12241
12306
|
after_submit_: after_submit_,
|
|
12307
|
+
before_navigate_: before_navigate_,
|
|
12242
12308
|
get_new_query: get_new_query
|
|
12243
12309
|
} = _ref;
|
|
12244
12310
|
const new_search_query = get_new_query();
|
|
@@ -12246,21 +12312,92 @@ async function $7f680455a2aa1079$export$e16630ecb9644a1c(_ref) {
|
|
|
12246
12312
|
if (previous_query === new_search_query && new URLSearchParams(location.search).has(search_param_name_)) {
|
|
12247
12313
|
// don't push a history entry / re-search if someone submits a search again
|
|
12248
12314
|
// do close the modal though
|
|
12315
|
+
search_field_value_.settle_(new_search_query);
|
|
12249
12316
|
on_submit_with_unchanged_value_ === null || on_submit_with_unchanged_value_ === void 0 || on_submit_with_unchanged_value_();
|
|
12250
|
-
return;
|
|
12317
|
+
return false;
|
|
12251
12318
|
}
|
|
12252
|
-
set_search_field_value_(previous_query); // restore the value to the previous query since this one goes to the new history entry
|
|
12253
12319
|
const target_url = new URL(location.href);
|
|
12254
12320
|
url_transformer_ === null || url_transformer_ === void 0 || url_transformer_(target_url);
|
|
12255
12321
|
target_url.searchParams.set(search_param_name_, new_search_query);
|
|
12256
|
-
|
|
12257
|
-
|
|
12258
|
-
|
|
12259
|
-
|
|
12260
|
-
|
|
12261
|
-
|
|
12322
|
+
const end_submit = search_field_value_.begin_submit_(new_search_query, previous_query);
|
|
12323
|
+
before_navigate_ === null || before_navigate_ === void 0 || before_navigate_();
|
|
12324
|
+
let landed;
|
|
12325
|
+
try {
|
|
12326
|
+
await router_.navigate_.go_to_({
|
|
12327
|
+
new_url_: target_url,
|
|
12328
|
+
is_replace_: false,
|
|
12329
|
+
force_spa_navigation_: true
|
|
12330
|
+
});
|
|
12331
|
+
} finally {
|
|
12332
|
+
landed = end_submit();
|
|
12333
|
+
}
|
|
12334
|
+
if (!landed) return false;
|
|
12262
12335
|
scrollTo(0, 0);
|
|
12263
12336
|
after_submit_ === null || after_submit_ === void 0 || after_submit_();
|
|
12337
|
+
return true;
|
|
12338
|
+
}
|
|
12339
|
+
function $24f1a81b790e371c$export$d13a185c53aa5edf(persisted_, get_search_query_) {
|
|
12340
|
+
const [get_persisted, set_persisted] = persisted_;
|
|
12341
|
+
const [get_submitting, set_submitting] = $3hooq$solidjs.createSignal();
|
|
12342
|
+
const get_value = $3hooq$solidjs.createMemo(() => {
|
|
12343
|
+
var _get_submitting;
|
|
12344
|
+
return (_get_submitting = get_submitting()) !== null && _get_submitting !== void 0 ? _get_submitting : get_persisted();
|
|
12345
|
+
});
|
|
12346
|
+
const set_value = value => {
|
|
12347
|
+
const new_value = typeof value === "function" ? value($3hooq$solidjs.untrack(get_value)) : value;
|
|
12348
|
+
if ($3hooq$solidjs.untrack(get_submitting) === undefined) set_persisted(new_value);else set_submitting(new_value);
|
|
12349
|
+
return new_value;
|
|
12350
|
+
};
|
|
12351
|
+
let current_submit;
|
|
12352
|
+
const end_submit = landed => {
|
|
12353
|
+
current_submit.landed_ = landed;
|
|
12354
|
+
current_submit = undefined;
|
|
12355
|
+
$3hooq$solidjs.batch(() => {
|
|
12356
|
+
const submitting = $3hooq$solidjs.untrack(get_submitting);
|
|
12357
|
+
set_submitting(undefined);
|
|
12358
|
+
if (landed && submitting !== undefined) set_persisted(submitting);
|
|
12359
|
+
});
|
|
12360
|
+
};
|
|
12361
|
+
const abort_on_popstate = what_happened => {
|
|
12362
|
+
if (what_happened === "popstate" && current_submit) end_submit(false);
|
|
12363
|
+
};
|
|
12364
|
+
(0, $3hooq$depictaiutilishared.instant_exec_on_suspect_history_change).add(abort_on_popstate);
|
|
12365
|
+
$3hooq$solidjs.onCleanup(() => (0, $3hooq$depictaiutilishared.instant_exec_on_suspect_history_change).delete(abort_on_popstate));
|
|
12366
|
+
$3hooq$solidjs.createEffect($3hooq$solidjs.on(get_search_query_, query => {
|
|
12367
|
+
const token = current_submit;
|
|
12368
|
+
if (!token || query !== token.query_) return;
|
|
12369
|
+
queueMicrotask(() => {
|
|
12370
|
+
if (current_submit === token) end_submit(true);
|
|
12371
|
+
});
|
|
12372
|
+
}, {
|
|
12373
|
+
defer: true
|
|
12374
|
+
}));
|
|
12375
|
+
const begin_submit_ = (submitted_query, query_of_current_history_entry) => {
|
|
12376
|
+
const token = current_submit = {
|
|
12377
|
+
query_: submitted_query,
|
|
12378
|
+
landed_: false
|
|
12379
|
+
};
|
|
12380
|
+
$3hooq$solidjs.batch(() => {
|
|
12381
|
+
set_submitting(submitted_query);
|
|
12382
|
+
set_persisted(query_of_current_history_entry);
|
|
12383
|
+
});
|
|
12384
|
+
return () => {
|
|
12385
|
+
if (current_submit === token) end_submit(true);
|
|
12386
|
+
return token.landed_;
|
|
12387
|
+
};
|
|
12388
|
+
};
|
|
12389
|
+
const settle_ = query => {
|
|
12390
|
+
if (current_submit) return;
|
|
12391
|
+
$3hooq$solidjs.batch(() => {
|
|
12392
|
+
set_submitting(undefined);
|
|
12393
|
+
set_persisted(query);
|
|
12394
|
+
});
|
|
12395
|
+
};
|
|
12396
|
+
return {
|
|
12397
|
+
value_: [get_value, set_value],
|
|
12398
|
+
begin_submit_: begin_submit_,
|
|
12399
|
+
settle_: settle_
|
|
12400
|
+
};
|
|
12264
12401
|
}
|
|
12265
12402
|
function $7a8e55af4ef13fae$export$181cceed5c91919e(callback, alsoRaF, passiveListener) {
|
|
12266
12403
|
let aligned_this_microtask = false;
|
|
@@ -12934,6 +13071,7 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
12934
13071
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
12935
13072
|
product_card_template_: product_card_template_,
|
|
12936
13073
|
modalAlignmentSignalsRef_: modalAlignmentSignalsRef_,
|
|
13074
|
+
inputFieldRef_: inputFieldRef_,
|
|
12937
13075
|
router_: router_,
|
|
12938
13076
|
content_results_rows_: content_results_rows_,
|
|
12939
13077
|
content_layout_options_: content_layout_options_,
|
|
@@ -13129,6 +13267,8 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
13129
13267
|
if (!search_field) break add_input_field;
|
|
13130
13268
|
setModalBodyStyle({});
|
|
13131
13269
|
modalAlignmentSignalsRef_ === null || modalAlignmentSignalsRef_ === void 0 || modalAlignmentSignalsRef_(alignmentSignals_);
|
|
13270
|
+
inputFieldRef_ === null || inputFieldRef_ === void 0 || inputFieldRef_(input_element);
|
|
13271
|
+
$3hooq$solidjs.onCleanup(() => inputFieldRef_ === null || inputFieldRef_ === void 0 ? void 0 : inputFieldRef_(undefined));
|
|
13132
13272
|
const [pollAlignment, setPollAlignment_] = $3hooq$solidjs.createSignal(false);
|
|
13133
13273
|
const align_position = $3hooq$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);
|
|
13134
13274
|
div_with_field_class.addEventListener("click", $3hooq$depictaiutilishared.catchify(e => {
|
|
@@ -13497,14 +13637,16 @@ class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
|
|
|
13497
13637
|
set_search_content_results_rows((0, $eab939d0b95b75ee$export$70ceae36059a1036));
|
|
13498
13638
|
}; // do this every time after we have submitted a new query - otherwise there might already be a saved number of rows in the state
|
|
13499
13639
|
const on_submit_with_unchanged_value_ = () => this.modal_open = false;
|
|
13500
|
-
const
|
|
13501
|
-
const
|
|
13640
|
+
const search_field_value_ = $24f1a81b790e371c$export$d13a185c53aa5edf(state_.field_value, get_search_query_);
|
|
13641
|
+
const [get_search_field_value_] = search_field_value_.value_;
|
|
13642
|
+
const configured_submit_query_ = (new_query, before_navigate_) => $7f680455a2aa1079$export$e16630ecb9644a1c({
|
|
13502
13643
|
on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
|
|
13503
|
-
|
|
13644
|
+
search_field_value_: search_field_value_,
|
|
13504
13645
|
get_search_query_: get_search_query_,
|
|
13505
13646
|
search_param_name_: search_query_url_param_name_,
|
|
13506
13647
|
after_submit_: after_submit_,
|
|
13507
|
-
|
|
13648
|
+
before_navigate_: before_navigate_,
|
|
13649
|
+
get_new_query: () => new_query !== null && new_query !== void 0 ? new_query : $3hooq$solidjs.untrack(get_search_field_value_),
|
|
13508
13650
|
url_transformer_: url_transformer,
|
|
13509
13651
|
router_: $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet)(this, $ddd39c5f36f49703$var$_router)
|
|
13510
13652
|
});
|
|
@@ -13523,6 +13665,7 @@ class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
|
|
|
13523
13665
|
search_query_url_param_name_: search_query_url_param_name_,
|
|
13524
13666
|
reset_history_state_: reset_history_state_,
|
|
13525
13667
|
state_: state_,
|
|
13668
|
+
search_field_value_: search_field_value_.value_,
|
|
13526
13669
|
router_: $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet)(this, $ddd39c5f36f49703$var$_router),
|
|
13527
13670
|
url_transformer_: url_transformer,
|
|
13528
13671
|
depict_api_: depict_api_,
|
|
@@ -13546,7 +13689,11 @@ class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
|
|
|
13546
13689
|
$3hooq$solidjs.onCleanup(() => _this.modal_open = false);
|
|
13547
13690
|
return searchModalComponent(...arguments);
|
|
13548
13691
|
}, {
|
|
13549
|
-
search_field_value_:
|
|
13692
|
+
search_field_value_: search_field_value_.value_,
|
|
13693
|
+
get_search_page_input_element_: () => {
|
|
13694
|
+
var _privately_shared_pro2;
|
|
13695
|
+
return (_privately_shared_pro2 = $ddd39c5f36f49703$export$dde08b2dca8cc1ce.get(this)) === null || _privately_shared_pro2 === void 0 ? void 0 : _privately_shared_pro2.search_page_input_element_;
|
|
13696
|
+
},
|
|
13550
13697
|
get_search_query_: get_search_query_,
|
|
13551
13698
|
search_query_url_param_name_: search_query_url_param_name_,
|
|
13552
13699
|
previous_searches_: previous_searches,
|
|
@@ -13711,6 +13858,7 @@ function $ddd39c5f36f49703$export$f2dc7e4e4aa11abb(props) {
|
|
|
13711
13858
|
const {
|
|
13712
13859
|
state_: state_
|
|
13713
13860
|
} = shared_properties;
|
|
13861
|
+
let registered_input_element;
|
|
13714
13862
|
const grid_spacing_override = $3hooq$solidjs.createMemo(() => {
|
|
13715
13863
|
const {
|
|
13716
13864
|
grid_spacing: grid_spacing
|
|
@@ -13742,7 +13890,7 @@ function $ddd39c5f36f49703$export$f2dc7e4e4aa11abb(props) {
|
|
|
13742
13890
|
var _depict_search$enable;
|
|
13743
13891
|
return (_depict_search$enable = depict_search.enable_content_search) !== null && _depict_search$enable !== void 0 ? _depict_search$enable : $ddd39c5f36f49703$var$content_search_default;
|
|
13744
13892
|
},
|
|
13745
|
-
search_field_value_:
|
|
13893
|
+
search_field_value_: shared_properties.search_field_value_,
|
|
13746
13894
|
get_search_query_: shared_properties.get_search_query_,
|
|
13747
13895
|
clear_filters_on_next_submit_: shared_properties.clear_filters_on_next_submit_,
|
|
13748
13896
|
open_modal_: function () {
|
|
@@ -13753,6 +13901,16 @@ function $ddd39c5f36f49703$export$f2dc7e4e4aa11abb(props) {
|
|
|
13753
13901
|
modalVersionUsed_: shared_properties.modalVersionUsed_,
|
|
13754
13902
|
showSliderArrow_: () => props.showSliderArrow_,
|
|
13755
13903
|
i18n_: shared_properties.i18n_,
|
|
13904
|
+
inputFieldRef_: input_element => {
|
|
13905
|
+
const shared_info_right_now = $ddd39c5f36f49703$export$dde08b2dca8cc1ce.get(depict_search);
|
|
13906
|
+
if (!shared_info_right_now) return;
|
|
13907
|
+
if (input_element === undefined && shared_info_right_now.search_page_input_element_ !== registered_input_element) return;
|
|
13908
|
+
registered_input_element = input_element;
|
|
13909
|
+
$ddd39c5f36f49703$export$dde08b2dca8cc1ce.set(depict_search, {
|
|
13910
|
+
...shared_info_right_now,
|
|
13911
|
+
search_page_input_element_: input_element
|
|
13912
|
+
});
|
|
13913
|
+
},
|
|
13756
13914
|
modalAlignmentSignalsRef_: style => {
|
|
13757
13915
|
const shared_info_right_now = $ddd39c5f36f49703$export$dde08b2dca8cc1ce.get(depict_search);
|
|
13758
13916
|
if (!shared_info_right_now) return;
|
|
@@ -14199,7 +14357,7 @@ function $98aef9965764903d$export$316f6f283ae64765(props) {
|
|
|
14199
14357
|
return shared_properties.BackIcon_;
|
|
14200
14358
|
},
|
|
14201
14359
|
get search_field_value_() {
|
|
14202
|
-
return shared_properties.
|
|
14360
|
+
return shared_properties.search_field_value_;
|
|
14203
14361
|
},
|
|
14204
14362
|
get submit_query_() {
|
|
14205
14363
|
return shared_properties.configured_submit_query_;
|
|
@@ -14242,7 +14400,7 @@ function $98aef9965764903d$export$316f6f283ae64765(props) {
|
|
|
14242
14400
|
return shared_properties.BackIcon_;
|
|
14243
14401
|
},
|
|
14244
14402
|
get search_field_value_() {
|
|
14245
|
-
return shared_properties.
|
|
14403
|
+
return shared_properties.search_field_value_;
|
|
14246
14404
|
},
|
|
14247
14405
|
get submit_query_() {
|
|
14248
14406
|
return shared_properties.configured_submit_query_;
|
package/server/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.
|
|
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;
|