@depict-ai/ui 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -4
- package/dist/index.d.ts +8 -5
- package/dist/main.js +102 -56
- package/dist/module.js +102 -58
- package/dist/typescript_schema/BaseSearchRequest.d.ts +197 -0
- package/dist/typescript_schema/ProductListingQueriesRequest.d.ts +14 -0
- package/dist/typescript_schema/ProductListingQueriesResponse.d.ts +10 -0
- package/dist/typescript_schema/ProductListingRequest.d.ts +221 -0
- package/dist/typescript_schema/ProductListingResponse.d.ts +232 -0
- package/dist/typescript_schema/RecommendResponse.d.ts +15 -0
- package/dist/typescript_schema/SearchRequest.d.ts +213 -0
- package/dist/typescript_schema/SearchResponse.d.ts +192 -0
- package/dist/typescript_schema/SearchSuggestionsRequest.d.ts +18 -0
- package/dist/typescript_schema/SearchSuggestionsResponse.d.ts +182 -0
- package/dist/typescript_schema/TrackV2Request.d.ts +115 -0
- package/jest.setup.js +7 -0
- package/locales/index.d.ts +1 -0
- package/locales/index.js +2 -1
- package/locales/require.js +2 -0
- package/package.json +10 -58
- package/ssr/client/{require.js → main.js} +36 -56
- package/ssr/client/{index.js → module.js} +40 -59
- package/ssr/{client/index.d.ts → index.d.ts} +1 -4
- package/ssr/server/{require.js → main.js} +36 -55
- package/ssr/server/{index.js → module.js} +40 -58
- package/tsconfig.json +8 -0
- package/ssr/server/index.d.ts +0 -539
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -7,10 +7,7 @@ import { SearchSuggestionsResponse, CategorySuggestion } from "@depict-ai/types/
|
|
|
7
7
|
import { SearchSuggestionsRequest } from "@depict-ai/types/api/SearchSuggestionsRequest";
|
|
8
8
|
import { ProductListingRequest } from "@depict-ai/types/api/ProductListingRequest";
|
|
9
9
|
import { ProductListingResponse } from "@depict-ai/types/api/ProductListingResponse";
|
|
10
|
-
export const version = "1.0.
|
|
11
|
-
export function SSRTestComponent({ start_at }: {
|
|
12
|
-
start_at: number;
|
|
13
|
-
}): HTMLElement;
|
|
10
|
+
export const version = "1.0.6";
|
|
14
11
|
export type OnNavigation = ((options: {
|
|
15
12
|
is_replace: boolean;
|
|
16
13
|
new_url: URL;
|
|
@@ -353,7 +350,7 @@ export class DepictSearch<T extends Display> {
|
|
|
353
350
|
set merchant(tenant: string);
|
|
354
351
|
get market(): string;
|
|
355
352
|
set market(market: string);
|
|
356
|
-
fetchSearchResults(query: string, filters?: SearchFilter[]): Promise<T[]>;
|
|
353
|
+
fetchSearchResults(query: string, filters?: SearchFilter[], limit?: number): Promise<T[]>;
|
|
357
354
|
}
|
|
358
355
|
export function SearchPage<T extends Display>({ depict_search, include_input_field, grid_spacing, cols_at_size, product_card_template, extra_depict_options, }: {
|
|
359
356
|
depict_search: DepictSearch<T>;
|
|
@@ -536,4 +533,10 @@ export class PageReplacer extends EventTarget {
|
|
|
536
533
|
* makes so that links to the previous page close the search instead of closing the search and reloading the page (to be used with non-spas)
|
|
537
534
|
*/
|
|
538
535
|
export function setup_fast_leave(pr: PageReplacer): void;
|
|
536
|
+
export const defaultColsAtSize: SDKColsAtSize;
|
|
537
|
+
export const defaultGridSpacing = "2%";
|
|
538
|
+
export const defaultCategoryTitlePlugin: ({ category_title_, product_count_, }: {
|
|
539
|
+
category_title_: import("solid-js").Accessor<string | undefined>;
|
|
540
|
+
product_count_: import("solid-js").JSX.Element;
|
|
541
|
+
}) => HTMLElement;
|
|
539
542
|
export type { SearchFilter } from "@depict-ai/types/api/SearchRequest";
|
package/dist/main.js
CHANGED
|
@@ -6,7 +6,6 @@ function $parcel$export(e, n, v, s) {
|
|
|
6
6
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
$parcel$export(module.exports, "SSRTestComponent", () => $33c5fcea480a2ddd$export$4f6abd76125ba82f);
|
|
10
9
|
$parcel$export(module.exports, "fetchDepictRecommendations", () => $bc91d938b8c601b4$export$58e808b1db15d3bc);
|
|
11
10
|
$parcel$export(module.exports, "QuickLinks", () => $48567ac5b39bac56$export$de035477d6fef996);
|
|
12
11
|
$parcel$export(module.exports, "BreadCrumbs", () => $48567ac5b39bac56$export$5b7c3ce0ebe51f86);
|
|
@@ -34,36 +33,15 @@ $parcel$export(module.exports, "show_toast", () => $ee498ec5e7dc2bba$export$5196
|
|
|
34
33
|
$parcel$export(module.exports, "SolidFormatPrice", () => $d659702496cb72ea$export$a71e92cfbb498adc);
|
|
35
34
|
$parcel$export(module.exports, "connect_search_field_height_to_aligner_height", () => $d8e94ea381ab57fa$export$828dcdd425fd3231);
|
|
36
35
|
$parcel$export(module.exports, "PageReplacer", () => $0a6acf31d1eae57c$export$3ccaa27d81dd8556);
|
|
36
|
+
$parcel$export(module.exports, "defaultGridSpacing", () => $a3280f0aad997933$export$864d304a0bc46829);
|
|
37
|
+
$parcel$export(module.exports, "defaultColsAtSize", () => $a3280f0aad997933$export$c3834fa86c616831);
|
|
38
|
+
$parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad997933$export$7bf543b9d9be2c22);
|
|
37
39
|
$parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
|
|
38
|
-
/*! Depict.ai search and product listing SDK */ const $b757f75811f3261f$export$83d89fbfd8236492 = "1.0.
|
|
40
|
+
/*! Depict.ai search and product listing SDK */ const $b757f75811f3261f$export$83d89fbfd8236492 = "1.0.6";
|
|
39
41
|
|
|
40
42
|
|
|
41
43
|
|
|
42
44
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const $33c5fcea480a2ddd$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div>count: </div>`, 2), $33c5fcea480a2ddd$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<p>Here's a paragraph. And some <b>bold</b> text. BTW, count is <!>. And 10x:ed it's </p>`, 5);
|
|
46
|
-
function $33c5fcea480a2ddd$export$4f6abd76125ba82f({ start_at: start_at }) {
|
|
47
|
-
const [count, setCount] = (0, $iBTHO$solidjs.createSignal)(start_at ?? 0);
|
|
48
|
-
const interval = setInterval(()=>setCount((old)=>old + 1), 1000);
|
|
49
|
-
(0, $iBTHO$solidjs.onCleanup)(()=>clearInterval(interval));
|
|
50
|
-
return [
|
|
51
|
-
(()=>{
|
|
52
|
-
const _el$ = $33c5fcea480a2ddd$var$_tmpl$.cloneNode(true), _el$2 = _el$.firstChild;
|
|
53
|
-
(0, $iBTHO$solidjsweb.insert)(_el$, count, null);
|
|
54
|
-
return _el$;
|
|
55
|
-
})(),
|
|
56
|
-
(()=>{
|
|
57
|
-
const _el$3 = $33c5fcea480a2ddd$var$_tmpl$2.cloneNode(true), _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$5.nextSibling, _el$8 = _el$6.nextSibling, _el$7 = _el$8.nextSibling;
|
|
58
|
-
(0, $iBTHO$solidjsweb.insert)(_el$3, count, _el$8);
|
|
59
|
-
(0, $iBTHO$solidjsweb.insert)(_el$3, ()=>count() * 10, null);
|
|
60
|
-
return _el$3;
|
|
61
|
-
})()
|
|
62
|
-
];
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
45
|
async function $bc91d938b8c601b4$export$58e808b1db15d3bc({ merchant: merchant , market: market , headers: headers , ...fetch_recs_options }) {
|
|
68
46
|
return await (0, $iBTHO$depictaiutilishared.fetch_recs)({
|
|
69
47
|
tenant: merchant,
|
|
@@ -264,6 +242,7 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
264
242
|
|
|
265
243
|
|
|
266
244
|
|
|
245
|
+
|
|
267
246
|
function $b54e6192d0caa293$export$d9f36cf74e24d595(media_query) {
|
|
268
247
|
const signal = (0, $iBTHO$solidjs.createSignal)(false);
|
|
269
248
|
(0, $iBTHO$solidjs.onCleanup)((0, $iBTHO$depictaiutilishared.javascript_media_query)(media_query, ({ matches: matches })=>signal[1](matches)).remove);
|
|
@@ -359,6 +338,32 @@ function $d659702496cb72ea$export$a71e92cfbb498adc(props) {
|
|
|
359
338
|
}
|
|
360
339
|
|
|
361
340
|
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
function $76b6ac05693f5c71$export$205efb947c7ffd78(handler, passive = true) {
|
|
344
|
+
const catchified_handler = (0, $iBTHO$depictaiutilishared.catchify)(handler);
|
|
345
|
+
// Some customers (e.g. equestrian) have `height: 100%` and/or `overflow-x: hidden` on the body, which means that scroll events won't get dispatched on `window`. The pages who get it on <body> won't get it on `window` and vice-versa, so there shouldn't be a worry about duplicate calling of the handler.
|
|
346
|
+
// Use observer in case that this gets called before body exists
|
|
347
|
+
const disconnect = (0, $iBTHO$depictaiutilishared.observer).onexists("body", ({ element: element })=>{
|
|
348
|
+
element.addEventListener("scroll", catchified_handler, {
|
|
349
|
+
passive: passive
|
|
350
|
+
});
|
|
351
|
+
(0, $iBTHO$solidjs.onCleanup)(()=>element.removeEventListener("scroll", catchified_handler));
|
|
352
|
+
});
|
|
353
|
+
(0, $iBTHO$solidjs.onCleanup)(disconnect);
|
|
354
|
+
for (const event of [
|
|
355
|
+
"resize",
|
|
356
|
+
"orientationchange",
|
|
357
|
+
"scroll"
|
|
358
|
+
]){
|
|
359
|
+
addEventListener(event, catchified_handler, {
|
|
360
|
+
passive: passive
|
|
361
|
+
});
|
|
362
|
+
(0, $iBTHO$solidjs.onCleanup)(()=>removeEventListener(event, catchified_handler));
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
|
|
362
367
|
const $401aee5f33dca9e2$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div class="scroll-status" style="display:none"><span class="text"><b></b> – <b></b> <!> <b></b></span></div>`, 11);
|
|
363
368
|
function $401aee5f33dca9e2$export$83fd5de5504a7a67({ formatted_number_of_results_: formatted_number_of_results_ , first_result_in_viewport_: [get_first_result_in_viewport] , last_result_in_viewport_: [get_last_result_in_viewport] , number_of_results_: number_of_results_ , i18n_: { price_formatting_: price_formatting_ , of_: of_ } }) {
|
|
364
369
|
const [first_to_show, set_first_to_show] = (0, $iBTHO$solidjs.createSignal)(0);
|
|
@@ -376,7 +381,7 @@ function $401aee5f33dca9e2$export$83fd5de5504a7a67({ formatted_number_of_results
|
|
|
376
381
|
let last_pos = scrollY;
|
|
377
382
|
let unpermit_when_possible = false;
|
|
378
383
|
let times_too_fast = 0;
|
|
379
|
-
const handle_scrollpos_change = (
|
|
384
|
+
const handle_scrollpos_change = ()=>{
|
|
380
385
|
if (animation) set_show_triggered((prev)=>!prev); // make sure that once we've decided to show the indicator it doesn't disappear before we stop scrolling
|
|
381
386
|
const distance_travelled = Math.abs(scrollY - last_pos);
|
|
382
387
|
const now = +new Date();
|
|
@@ -393,17 +398,8 @@ function $401aee5f33dca9e2$export$83fd5de5504a7a67({ formatted_number_of_results
|
|
|
393
398
|
else set_permitted_to_show(false);
|
|
394
399
|
last_pos_time = now;
|
|
395
400
|
last_pos = scrollY;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
"resize",
|
|
399
|
-
"orientationchange",
|
|
400
|
-
"scroll"
|
|
401
|
-
]){
|
|
402
|
-
addEventListener(event, handle_scrollpos_change, {
|
|
403
|
-
passive: true
|
|
404
|
-
});
|
|
405
|
-
(0, $iBTHO$solidjs.onCleanup)(()=>removeEventListener(event, handle_scrollpos_change));
|
|
406
|
-
}
|
|
401
|
+
};
|
|
402
|
+
(0, $76b6ac05693f5c71$export$205efb947c7ffd78)(handle_scrollpos_change);
|
|
407
403
|
(0, $iBTHO$solidjs.createEffect)(()=>{
|
|
408
404
|
show_triggered();
|
|
409
405
|
const first = get_first_result_in_viewport();
|
|
@@ -4245,6 +4241,7 @@ function $f8f64d05c525825b$var$OpenSortingButton({ i18n_: i18n_ , get_current_so
|
|
|
4245
4241
|
|
|
4246
4242
|
|
|
4247
4243
|
|
|
4244
|
+
|
|
4248
4245
|
const $2fb324fbcc7b4a7b$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div class="floating-buttons"><button class="filter"><div></div></button><button class="sort"><div></div></button><button class="up"><div></div></button></div>`, 14);
|
|
4249
4246
|
function $2fb324fbcc7b4a7b$export$b23abd26de154ede(props) {
|
|
4250
4247
|
const [is_small, set_is_small] = (0, $iBTHO$solidjs.createSignal)(true);
|
|
@@ -4271,7 +4268,7 @@ function $2fb324fbcc7b4a7b$var$ActualFloatingButtons({ search_filters_open_: [ge
|
|
|
4271
4268
|
const [get_is_showing_toast] = (0, $ee498ec5e7dc2bba$export$22970a0140fc759c);
|
|
4272
4269
|
const [modal_is_closed, set_if_modal_is_closed] = (0, $iBTHO$solidjs.createSignal)(!(0, $iBTHO$solidjs.untrack)(get_search_filters_open_) && !(0, $iBTHO$solidjs.untrack)(get_search_sorting_open_));
|
|
4273
4270
|
const [regular_buttons_are_in_view, set_regular_buttons_are_in_view] = (0, $iBTHO$solidjs.createSignal)(false);
|
|
4274
|
-
const handle_scrollpos_change = (
|
|
4271
|
+
const handle_scrollpos_change = ()=>(0, $iBTHO$solidjs.untrack)(()=>{
|
|
4275
4272
|
const new_pos = scrollY;
|
|
4276
4273
|
if (modal_is_closed()) {
|
|
4277
4274
|
const diff = new_pos - old_pos;
|
|
@@ -4286,7 +4283,7 @@ function $2fb324fbcc7b4a7b$var$ActualFloatingButtons({ search_filters_open_: [ge
|
|
|
4286
4283
|
else if (diff_over_second_or_touch > 30) set_is_scrolling_upwards(false);
|
|
4287
4284
|
}
|
|
4288
4285
|
old_pos = new_pos;
|
|
4289
|
-
})
|
|
4286
|
+
});
|
|
4290
4287
|
const touchstart_handler = (0, $iBTHO$depictaiutilishared.catchify)((e)=>{
|
|
4291
4288
|
is_in_touch_scroll = true;
|
|
4292
4289
|
if (e.touches.length === 1) {
|
|
@@ -4309,16 +4306,7 @@ function $2fb324fbcc7b4a7b$var$ActualFloatingButtons({ search_filters_open_: [ge
|
|
|
4309
4306
|
removeEventListener("touchstart", touchstart_handler);
|
|
4310
4307
|
removeEventListener("touchend", touchend_handler);
|
|
4311
4308
|
});
|
|
4312
|
-
|
|
4313
|
-
"resize",
|
|
4314
|
-
"orientationchange",
|
|
4315
|
-
"scroll"
|
|
4316
|
-
]){
|
|
4317
|
-
addEventListener(event, handle_scrollpos_change, {
|
|
4318
|
-
passive: true
|
|
4319
|
-
});
|
|
4320
|
-
(0, $iBTHO$solidjs.onCleanup)(()=>removeEventListener(event, handle_scrollpos_change));
|
|
4321
|
-
}
|
|
4309
|
+
(0, $76b6ac05693f5c71$export$205efb947c7ffd78)(handle_scrollpos_change);
|
|
4322
4310
|
(0, $iBTHO$solidjs.onCleanup)(resolve_cleanup_promise);
|
|
4323
4311
|
(0, $iBTHO$solidjs.createComputed)(()=>{
|
|
4324
4312
|
clearTimeout(timeout);
|
|
@@ -4982,6 +4970,46 @@ function $cc7c480116d2eba0$var$clear_if_opened_new_tab_with_sideways_url_params_
|
|
|
4982
4970
|
}
|
|
4983
4971
|
|
|
4984
4972
|
|
|
4973
|
+
|
|
4974
|
+
|
|
4975
|
+
|
|
4976
|
+
|
|
4977
|
+
|
|
4978
|
+
|
|
4979
|
+
const $cafad5eca9f09cb5$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div class="statement">No category ID specified, this is probably unintentional. Make sure to first create (and insert) the SearchPage once you have told the SDK about a category ID.</div>`, 2), $cafad5eca9f09cb5$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div class="buttons"><button class="ok major"></button></div>`, 4);
|
|
4980
|
+
function $cafad5eca9f09cb5$export$d4fc5c0e68a52116(el, query_id_, i18n_) {
|
|
4981
|
+
if (!(0, $iBTHO$depictaiutilishared.is_debug)) return; // Just to make sure we don't show this in production
|
|
4982
|
+
const owner = (0, $iBTHO$solidjs.getOwner)();
|
|
4983
|
+
const disconnect = (0, $iBTHO$depictaiutilishared.observer).onexists(el, ({ element: element })=>(0, $iBTHO$solidjs.runWithOwner)(owner, ()=>(0, $iBTHO$solidjs.createEffect)(()=>{
|
|
4984
|
+
if (!document.documentElement.contains(element)) return;
|
|
4985
|
+
if (!query_id_()) {
|
|
4986
|
+
const warning = "No category ID specified, this is probably unintentional. Make sure to first create (and insert) the SearchPage once you have told the SDK about a category ID.";
|
|
4987
|
+
(0, $iBTHO$depictaiutilishared.dwarn)(warning);
|
|
4988
|
+
const { close_toast_: close_toast_ } = (0, $ee498ec5e7dc2bba$export$5196e4c01fa56fcb)({
|
|
4989
|
+
class: "warning",
|
|
4990
|
+
close_after_: 120000,
|
|
4991
|
+
style: {
|
|
4992
|
+
background: "#ffb830"
|
|
4993
|
+
},
|
|
4994
|
+
children: [
|
|
4995
|
+
$cafad5eca9f09cb5$var$_tmpl$.cloneNode(true),
|
|
4996
|
+
(()=>{
|
|
4997
|
+
const _el$2 = $cafad5eca9f09cb5$var$_tmpl$2.cloneNode(true), _el$3 = _el$2.firstChild;
|
|
4998
|
+
_el$3.$$click = ()=>close_toast_() /* We have to wait for close_toast_ to get defined after the call to show_toast */ ;
|
|
4999
|
+
(0, $iBTHO$solidjsweb.insert)(_el$3, ()=>i18n_.ok_());
|
|
5000
|
+
return _el$2;
|
|
5001
|
+
})()
|
|
5002
|
+
]
|
|
5003
|
+
});
|
|
5004
|
+
}
|
|
5005
|
+
})));
|
|
5006
|
+
(0, $iBTHO$solidjs.onCleanup)(disconnect);
|
|
5007
|
+
}
|
|
5008
|
+
(0, $iBTHO$solidjsweb.delegateEvents)([
|
|
5009
|
+
"click"
|
|
5010
|
+
]);
|
|
5011
|
+
|
|
5012
|
+
|
|
4985
5013
|
const $840d88a04b2d22a7$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div class="product-count"> </div>`, 2), $840d88a04b2d22a7$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div></div>`, 2), $840d88a04b2d22a7$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div class="filter-results-for-one-row"></div>`, 2), $840d88a04b2d22a7$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div class="depict plp category"><div class="listing-page"></div></div>`, 4);
|
|
4986
5014
|
function $840d88a04b2d22a7$export$f7d2f673fc2f091d({ depict_api_: depict_api_ , query_id_: query_id_ , current_sorting_: current_sorting_ , min_products_to_fetch_: min_products_to_fetch_ , category_filters_open_: category_filters_open_ , category_sorting_open_: category_sorting_open_ , expanded_filters_: expanded_filters_ , selected_filters_: selected_filters_ , get_quicklinks_accessor_: get_quicklinks_accessor_ , i18n_: incoming_i18n , get_breadcrumb_accessor_: get_breadcrumb_accessor_ , slider_arrow_button_: slider_arrow_button_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , local_filter_cache_: local_filter_cache_ , tenant_: tenant_ , market_: market_ , router_: router_ , show_quicklinks_: show_quicklinks_ , category_title_: category_title_ , show_breadcrumbs_: show_breadcrumbs_ , layout_options_: layout_options_ , scroll_restoration_data_: scroll_restoration_data_ , product_card_template_: product_card_template_ , sideways_filter_clearing_flag_: sideways_filter_clearing_flag_ }) {
|
|
4987
5015
|
let results_for;
|
|
@@ -5167,6 +5195,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
5167
5195
|
document.createComment("Category page based on Depict SDK"),
|
|
5168
5196
|
(()=>{
|
|
5169
5197
|
const _el$5 = $840d88a04b2d22a7$var$_tmpl$4.cloneNode(true), _el$6 = _el$5.firstChild;
|
|
5198
|
+
(0, $iBTHO$solidjsweb.use)((el)=>process.env.NODE_ENV === "development" && (0, $cafad5eca9f09cb5$export$d4fc5c0e68a52116)(el, query_id_, i18n_), _el$5);
|
|
5170
5199
|
(0, $iBTHO$solidjsweb.insert)(_el$6, (0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$solidjs.Show), {
|
|
5171
5200
|
when: show_breadcrumbs_,
|
|
5172
5201
|
get children () {
|
|
@@ -6217,6 +6246,7 @@ function $fb29c6201c369e39$var$make_state_saved_rows([get_showing_recommendation
|
|
|
6217
6246
|
|
|
6218
6247
|
|
|
6219
6248
|
|
|
6249
|
+
|
|
6220
6250
|
function $fd463ff0edb29915$export$b3ad617e9036868(modal_body_style, input_field, width_transformer, includeScroll, one_axies_only) {
|
|
6221
6251
|
let aligned_this_microtask = false;
|
|
6222
6252
|
const align_position = ()=>{
|
|
@@ -6249,8 +6279,7 @@ function $fd463ff0edb29915$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
6249
6279
|
}));
|
|
6250
6280
|
ro.observe(input_field);
|
|
6251
6281
|
}
|
|
6252
|
-
|
|
6253
|
-
window.addEventListener("orientationchange", align_position);
|
|
6282
|
+
(0, $76b6ac05693f5c71$export$205efb947c7ffd78)(align_position);
|
|
6254
6283
|
// "resize" doesn't fire sometimes when it should, also it doesn't when showing/hiding scrollbars which disabling scrolling does
|
|
6255
6284
|
// this works
|
|
6256
6285
|
// keeping resize just in case
|
|
@@ -6260,8 +6289,6 @@ function $fd463ff0edb29915$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
6260
6289
|
(0, $iBTHO$solidjs.onCleanup)((0, $iBTHO$depictaiutilishared.catchify)(()=>{
|
|
6261
6290
|
ro?.disconnect();
|
|
6262
6291
|
resize_resize_observer.disconnect();
|
|
6263
|
-
window.removeEventListener("resize", align_position);
|
|
6264
|
-
window.removeEventListener("orientationchange", align_position);
|
|
6265
6292
|
}));
|
|
6266
6293
|
return align_position;
|
|
6267
6294
|
}
|
|
@@ -8121,13 +8148,14 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
|
|
|
8121
8148
|
set market(market) {
|
|
8122
8149
|
this.#market_signal[1](market);
|
|
8123
8150
|
}
|
|
8124
|
-
async fetchSearchResults(query, filters) {
|
|
8151
|
+
async fetchSearchResults(query, filters, limit = 50) {
|
|
8125
8152
|
const { depict_api_: depict_api_ } = $2c61e4cd8229c49a$var$privately_shared_properties.get(this);
|
|
8126
8153
|
const result = await depict_api_.query({
|
|
8127
8154
|
tenant: this.merchant,
|
|
8128
8155
|
market: this.market,
|
|
8129
8156
|
query: query,
|
|
8130
|
-
filters: filters
|
|
8157
|
+
filters: filters,
|
|
8158
|
+
limit: limit
|
|
8131
8159
|
});
|
|
8132
8160
|
if (result.failed) throw new Error("Failed to fetch search results");
|
|
8133
8161
|
return result.displays;
|
|
@@ -8554,6 +8582,24 @@ class $0a6acf31d1eae57c$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
8554
8582
|
}
|
|
8555
8583
|
|
|
8556
8584
|
|
|
8585
|
+
|
|
8586
|
+
const $a3280f0aad997933$export$c3834fa86c616831 = [
|
|
8587
|
+
[
|
|
8588
|
+
4
|
|
8589
|
+
],
|
|
8590
|
+
[
|
|
8591
|
+
3,
|
|
8592
|
+
1024
|
|
8593
|
+
],
|
|
8594
|
+
[
|
|
8595
|
+
2,
|
|
8596
|
+
901
|
|
8597
|
+
]
|
|
8598
|
+
];
|
|
8599
|
+
const $a3280f0aad997933$export$864d304a0bc46829 = "2%";
|
|
8600
|
+
const $a3280f0aad997933$export$7bf543b9d9be2c22 = (0, $0b23bfd073d9a4e8$export$b91cec6bdc6b32a1);
|
|
8601
|
+
|
|
8602
|
+
|
|
8557
8603
|
(0, $iBTHO$depictaiutilishared.add_to_version_info)("ui", (0, $b757f75811f3261f$export$83d89fbfd8236492));
|
|
8558
8604
|
|
|
8559
8605
|
|
package/dist/module.js
CHANGED
|
@@ -1,36 +1,12 @@
|
|
|
1
|
-
import {add_to_version_info as $kyEB6$add_to_version_info, fetch_recs as $kyEB6$fetch_recs, snakeCasifyObject as $kyEB6$snakeCasifyObject, GenericSliderArrowButton as $kyEB6$GenericSliderArrowButton, catchify as $kyEB6$catchify, instant_exec_on_suspect_history_change as $kyEB6$instant_exec_on_suspect_history_change, base_url as $kyEB6$base_url, dlog as $kyEB6$dlog, get_depict_id as $kyEB6$get_depict_id, get_user_id as $kyEB6$get_user_id, get_session_id as $kyEB6$get_session_id, make_url_with_query_params as $kyEB6$make_url_with_query_params, fetch_retry as $kyEB6$fetch_retry, add_version_query_params as $kyEB6$add_version_query_params, sort_obj as $kyEB6$sort_obj, Placeholder as $kyEB6$Placeholder, report as $kyEB6$report, javascript_media_query as $kyEB6$javascript_media_query, standard_price_format as $kyEB6$standard_price_format,
|
|
1
|
+
import {add_to_version_info as $kyEB6$add_to_version_info, fetch_recs as $kyEB6$fetch_recs, snakeCasifyObject as $kyEB6$snakeCasifyObject, GenericSliderArrowButton as $kyEB6$GenericSliderArrowButton, catchify as $kyEB6$catchify, instant_exec_on_suspect_history_change as $kyEB6$instant_exec_on_suspect_history_change, base_url as $kyEB6$base_url, dlog as $kyEB6$dlog, get_depict_id as $kyEB6$get_depict_id, get_user_id as $kyEB6$get_user_id, get_session_id as $kyEB6$get_session_id, make_url_with_query_params as $kyEB6$make_url_with_query_params, fetch_retry as $kyEB6$fetch_retry, add_version_query_params as $kyEB6$add_version_query_params, sort_obj as $kyEB6$sort_obj, Placeholder as $kyEB6$Placeholder, report as $kyEB6$report, javascript_media_query as $kyEB6$javascript_media_query, standard_price_format as $kyEB6$standard_price_format, observer as $kyEB6$observer, make_random_classname as $kyEB6$make_random_classname, n_col_styling_with_dist as $kyEB6$n_col_styling_with_dist, CrossIcon as $kyEB6$CrossIcon, useExpandingContainer as $kyEB6$useExpandingContainer, Amazing_Slider as $kyEB6$Amazing_Slider, slider_snap_css as $kyEB6$slider_snap_css, slider_fading_factory as $kyEB6$slider_fading_factory, MinusIcon as $kyEB6$MinusIcon, FilterIcon as $kyEB6$FilterIcon, SortIconAsc as $kyEB6$SortIconAsc, SortIconDesc as $kyEB6$SortIconDesc, PlusIcon as $kyEB6$PlusIcon, hsl_to_rgb as $kyEB6$hsl_to_rgb, relative_luminance_from_rgb as $kyEB6$relative_luminance_from_rgb, TickIcon as $kyEB6$TickIcon, ArrowUp as $kyEB6$ArrowUp, base64_encode_unicode as $kyEB6$base64_encode_unicode, base64_decode_unicode as $kyEB6$base64_decode_unicode, queueMacroTask as $kyEB6$queueMacroTask, is_debug as $kyEB6$is_debug, dwarn as $kyEB6$dwarn, ContainedPlaceholderImage as $kyEB6$ContainedPlaceholderImage, BackIcon as $kyEB6$BackIcon, SearchIcon as $kyEB6$SearchIcon, Layout as $kyEB6$Layout, async_iterable_ipns as $kyEB6$async_iterable_ipns, make_asyncIterable_exiter as $kyEB6$make_asyncIterable_exiter, href_change_ipns as $kyEB6$href_change_ipns, ContainedImage as $kyEB6$ContainedImage, buildThresholdList as $kyEB6$buildThresholdList, deparallelize_no_drop as $kyEB6$deparallelize_no_drop, PreviousSearchIcon as $kyEB6$PreviousSearchIcon, insert_surfaces as $kyEB6$insert_surfaces} from "@depict-ai/utilishared";
|
|
2
2
|
import {template as $kyEB6$template, insert as $kyEB6$insert, effect as $kyEB6$effect, setAttribute as $kyEB6$setAttribute, createComponent as $kyEB6$createComponent, use as $kyEB6$use, memo as $kyEB6$memo, addEventListener as $kyEB6$addEventListener, delegateEvents as $kyEB6$delegateEvents, spread as $kyEB6$spread, classList as $kyEB6$classList, style as $kyEB6$style, Dynamic as $kyEB6$Dynamic, mergeProps as $kyEB6$mergeProps, className as $kyEB6$className} from "solid-js/web";
|
|
3
|
-
import {createSignal as $kyEB6$createSignal,
|
|
3
|
+
import {createSignal as $kyEB6$createSignal, getOwner as $kyEB6$getOwner, createRoot as $kyEB6$createRoot, runWithOwner as $kyEB6$runWithOwner, onCleanup as $kyEB6$onCleanup, createComputed as $kyEB6$createComputed, createRenderEffect as $kyEB6$createRenderEffect, createEffect as $kyEB6$createEffect, untrack as $kyEB6$untrack, batch as $kyEB6$batch, createResource as $kyEB6$createResource, createMemo as $kyEB6$createMemo, Show as $kyEB6$Show, createReaction as $kyEB6$createReaction, Suspense as $kyEB6$Suspense, on as $kyEB6$on, ErrorBoundary as $kyEB6$ErrorBoundary, For as $kyEB6$For, Index as $kyEB6$Index} from "solid-js";
|
|
4
4
|
|
|
5
|
-
/*! Depict.ai search and product listing SDK */ const $ec291e0010116877$export$83d89fbfd8236492 = "1.0.
|
|
5
|
+
/*! Depict.ai search and product listing SDK */ const $ec291e0010116877$export$83d89fbfd8236492 = "1.0.6";
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const $23d09820c60b7015$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$kyEB6$template)(`<div>count: </div>`, 2), $23d09820c60b7015$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$kyEB6$template)(`<p>Here's a paragraph. And some <b>bold</b> text. BTW, count is <!>. And 10x:ed it's </p>`, 5);
|
|
13
|
-
function $23d09820c60b7015$export$4f6abd76125ba82f({ start_at: start_at }) {
|
|
14
|
-
const [count, setCount] = (0, $kyEB6$createSignal)(start_at ?? 0);
|
|
15
|
-
const interval = setInterval(()=>setCount((old)=>old + 1), 1000);
|
|
16
|
-
(0, $kyEB6$onCleanup)(()=>clearInterval(interval));
|
|
17
|
-
return [
|
|
18
|
-
(()=>{
|
|
19
|
-
const _el$ = $23d09820c60b7015$var$_tmpl$.cloneNode(true), _el$2 = _el$.firstChild;
|
|
20
|
-
(0, $kyEB6$insert)(_el$, count, null);
|
|
21
|
-
return _el$;
|
|
22
|
-
})(),
|
|
23
|
-
(()=>{
|
|
24
|
-
const _el$3 = $23d09820c60b7015$var$_tmpl$2.cloneNode(true), _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$5.nextSibling, _el$8 = _el$6.nextSibling, _el$7 = _el$8.nextSibling;
|
|
25
|
-
(0, $kyEB6$insert)(_el$3, count, _el$8);
|
|
26
|
-
(0, $kyEB6$insert)(_el$3, ()=>count() * 10, null);
|
|
27
|
-
return _el$3;
|
|
28
|
-
})()
|
|
29
|
-
];
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
10
|
async function $c58717f39bf51647$export$58e808b1db15d3bc({ merchant: merchant , market: market , headers: headers , ...fetch_recs_options }) {
|
|
35
11
|
return await (0, $kyEB6$fetch_recs)({
|
|
36
12
|
tenant: merchant,
|
|
@@ -231,6 +207,7 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
231
207
|
|
|
232
208
|
|
|
233
209
|
|
|
210
|
+
|
|
234
211
|
function $dc9262ef6f786812$export$d9f36cf74e24d595(media_query) {
|
|
235
212
|
const signal = (0, $kyEB6$createSignal)(false);
|
|
236
213
|
(0, $kyEB6$onCleanup)((0, $kyEB6$javascript_media_query)(media_query, ({ matches: matches })=>signal[1](matches)).remove);
|
|
@@ -326,6 +303,32 @@ function $8c0f86cb3e266eeb$export$a71e92cfbb498adc(props) {
|
|
|
326
303
|
}
|
|
327
304
|
|
|
328
305
|
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
function $8f9120a1ca151e6a$export$205efb947c7ffd78(handler, passive = true) {
|
|
309
|
+
const catchified_handler = (0, $kyEB6$catchify)(handler);
|
|
310
|
+
// Some customers (e.g. equestrian) have `height: 100%` and/or `overflow-x: hidden` on the body, which means that scroll events won't get dispatched on `window`. The pages who get it on <body> won't get it on `window` and vice-versa, so there shouldn't be a worry about duplicate calling of the handler.
|
|
311
|
+
// Use observer in case that this gets called before body exists
|
|
312
|
+
const disconnect = (0, $kyEB6$observer).onexists("body", ({ element: element })=>{
|
|
313
|
+
element.addEventListener("scroll", catchified_handler, {
|
|
314
|
+
passive: passive
|
|
315
|
+
});
|
|
316
|
+
(0, $kyEB6$onCleanup)(()=>element.removeEventListener("scroll", catchified_handler));
|
|
317
|
+
});
|
|
318
|
+
(0, $kyEB6$onCleanup)(disconnect);
|
|
319
|
+
for (const event of [
|
|
320
|
+
"resize",
|
|
321
|
+
"orientationchange",
|
|
322
|
+
"scroll"
|
|
323
|
+
]){
|
|
324
|
+
addEventListener(event, catchified_handler, {
|
|
325
|
+
passive: passive
|
|
326
|
+
});
|
|
327
|
+
(0, $kyEB6$onCleanup)(()=>removeEventListener(event, catchified_handler));
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
|
|
329
332
|
const $6db49ca163afa2c3$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$kyEB6$template)(`<div class="scroll-status" style="display:none"><span class="text"><b></b> – <b></b> <!> <b></b></span></div>`, 11);
|
|
330
333
|
function $6db49ca163afa2c3$export$83fd5de5504a7a67({ formatted_number_of_results_: formatted_number_of_results_ , first_result_in_viewport_: [get_first_result_in_viewport] , last_result_in_viewport_: [get_last_result_in_viewport] , number_of_results_: number_of_results_ , i18n_: { price_formatting_: price_formatting_ , of_: of_ } }) {
|
|
331
334
|
const [first_to_show, set_first_to_show] = (0, $kyEB6$createSignal)(0);
|
|
@@ -343,7 +346,7 @@ function $6db49ca163afa2c3$export$83fd5de5504a7a67({ formatted_number_of_results
|
|
|
343
346
|
let last_pos = scrollY;
|
|
344
347
|
let unpermit_when_possible = false;
|
|
345
348
|
let times_too_fast = 0;
|
|
346
|
-
const handle_scrollpos_change = (
|
|
349
|
+
const handle_scrollpos_change = ()=>{
|
|
347
350
|
if (animation) set_show_triggered((prev)=>!prev); // make sure that once we've decided to show the indicator it doesn't disappear before we stop scrolling
|
|
348
351
|
const distance_travelled = Math.abs(scrollY - last_pos);
|
|
349
352
|
const now = +new Date();
|
|
@@ -360,17 +363,8 @@ function $6db49ca163afa2c3$export$83fd5de5504a7a67({ formatted_number_of_results
|
|
|
360
363
|
else set_permitted_to_show(false);
|
|
361
364
|
last_pos_time = now;
|
|
362
365
|
last_pos = scrollY;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
"resize",
|
|
366
|
-
"orientationchange",
|
|
367
|
-
"scroll"
|
|
368
|
-
]){
|
|
369
|
-
addEventListener(event, handle_scrollpos_change, {
|
|
370
|
-
passive: true
|
|
371
|
-
});
|
|
372
|
-
(0, $kyEB6$onCleanup)(()=>removeEventListener(event, handle_scrollpos_change));
|
|
373
|
-
}
|
|
366
|
+
};
|
|
367
|
+
(0, $8f9120a1ca151e6a$export$205efb947c7ffd78)(handle_scrollpos_change);
|
|
374
368
|
(0, $kyEB6$createEffect)(()=>{
|
|
375
369
|
show_triggered();
|
|
376
370
|
const first = get_first_result_in_viewport();
|
|
@@ -4212,6 +4206,7 @@ function $cdea4cf8c5c071ef$var$OpenSortingButton({ i18n_: i18n_ , get_current_so
|
|
|
4212
4206
|
|
|
4213
4207
|
|
|
4214
4208
|
|
|
4209
|
+
|
|
4215
4210
|
const $0b0380f75d729d63$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$kyEB6$template)(`<div class="floating-buttons"><button class="filter"><div></div></button><button class="sort"><div></div></button><button class="up"><div></div></button></div>`, 14);
|
|
4216
4211
|
function $0b0380f75d729d63$export$b23abd26de154ede(props) {
|
|
4217
4212
|
const [is_small, set_is_small] = (0, $kyEB6$createSignal)(true);
|
|
@@ -4238,7 +4233,7 @@ function $0b0380f75d729d63$var$ActualFloatingButtons({ search_filters_open_: [ge
|
|
|
4238
4233
|
const [get_is_showing_toast] = (0, $bf52d9f9eebd1938$export$22970a0140fc759c);
|
|
4239
4234
|
const [modal_is_closed, set_if_modal_is_closed] = (0, $kyEB6$createSignal)(!(0, $kyEB6$untrack)(get_search_filters_open_) && !(0, $kyEB6$untrack)(get_search_sorting_open_));
|
|
4240
4235
|
const [regular_buttons_are_in_view, set_regular_buttons_are_in_view] = (0, $kyEB6$createSignal)(false);
|
|
4241
|
-
const handle_scrollpos_change = (
|
|
4236
|
+
const handle_scrollpos_change = ()=>(0, $kyEB6$untrack)(()=>{
|
|
4242
4237
|
const new_pos = scrollY;
|
|
4243
4238
|
if (modal_is_closed()) {
|
|
4244
4239
|
const diff = new_pos - old_pos;
|
|
@@ -4253,7 +4248,7 @@ function $0b0380f75d729d63$var$ActualFloatingButtons({ search_filters_open_: [ge
|
|
|
4253
4248
|
else if (diff_over_second_or_touch > 30) set_is_scrolling_upwards(false);
|
|
4254
4249
|
}
|
|
4255
4250
|
old_pos = new_pos;
|
|
4256
|
-
})
|
|
4251
|
+
});
|
|
4257
4252
|
const touchstart_handler = (0, $kyEB6$catchify)((e)=>{
|
|
4258
4253
|
is_in_touch_scroll = true;
|
|
4259
4254
|
if (e.touches.length === 1) {
|
|
@@ -4276,16 +4271,7 @@ function $0b0380f75d729d63$var$ActualFloatingButtons({ search_filters_open_: [ge
|
|
|
4276
4271
|
removeEventListener("touchstart", touchstart_handler);
|
|
4277
4272
|
removeEventListener("touchend", touchend_handler);
|
|
4278
4273
|
});
|
|
4279
|
-
|
|
4280
|
-
"resize",
|
|
4281
|
-
"orientationchange",
|
|
4282
|
-
"scroll"
|
|
4283
|
-
]){
|
|
4284
|
-
addEventListener(event, handle_scrollpos_change, {
|
|
4285
|
-
passive: true
|
|
4286
|
-
});
|
|
4287
|
-
(0, $kyEB6$onCleanup)(()=>removeEventListener(event, handle_scrollpos_change));
|
|
4288
|
-
}
|
|
4274
|
+
(0, $8f9120a1ca151e6a$export$205efb947c7ffd78)(handle_scrollpos_change);
|
|
4289
4275
|
(0, $kyEB6$onCleanup)(resolve_cleanup_promise);
|
|
4290
4276
|
(0, $kyEB6$createComputed)(()=>{
|
|
4291
4277
|
clearTimeout(timeout);
|
|
@@ -4949,6 +4935,46 @@ function $a1c4da51ff91dd01$var$clear_if_opened_new_tab_with_sideways_url_params_
|
|
|
4949
4935
|
}
|
|
4950
4936
|
|
|
4951
4937
|
|
|
4938
|
+
|
|
4939
|
+
|
|
4940
|
+
|
|
4941
|
+
|
|
4942
|
+
|
|
4943
|
+
|
|
4944
|
+
const $eb9ba2e49ab3dcc2$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$kyEB6$template)(`<div class="statement">No category ID specified, this is probably unintentional. Make sure to first create (and insert) the SearchPage once you have told the SDK about a category ID.</div>`, 2), $eb9ba2e49ab3dcc2$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$kyEB6$template)(`<div class="buttons"><button class="ok major"></button></div>`, 4);
|
|
4945
|
+
function $eb9ba2e49ab3dcc2$export$d4fc5c0e68a52116(el, query_id_, i18n_) {
|
|
4946
|
+
if (!(0, $kyEB6$is_debug)) return; // Just to make sure we don't show this in production
|
|
4947
|
+
const owner = (0, $kyEB6$getOwner)();
|
|
4948
|
+
const disconnect = (0, $kyEB6$observer).onexists(el, ({ element: element })=>(0, $kyEB6$runWithOwner)(owner, ()=>(0, $kyEB6$createEffect)(()=>{
|
|
4949
|
+
if (!document.documentElement.contains(element)) return;
|
|
4950
|
+
if (!query_id_()) {
|
|
4951
|
+
const warning = "No category ID specified, this is probably unintentional. Make sure to first create (and insert) the SearchPage once you have told the SDK about a category ID.";
|
|
4952
|
+
(0, $kyEB6$dwarn)(warning);
|
|
4953
|
+
const { close_toast_: close_toast_ } = (0, $bf52d9f9eebd1938$export$5196e4c01fa56fcb)({
|
|
4954
|
+
class: "warning",
|
|
4955
|
+
close_after_: 120000,
|
|
4956
|
+
style: {
|
|
4957
|
+
background: "#ffb830"
|
|
4958
|
+
},
|
|
4959
|
+
children: [
|
|
4960
|
+
$eb9ba2e49ab3dcc2$var$_tmpl$.cloneNode(true),
|
|
4961
|
+
(()=>{
|
|
4962
|
+
const _el$2 = $eb9ba2e49ab3dcc2$var$_tmpl$2.cloneNode(true), _el$3 = _el$2.firstChild;
|
|
4963
|
+
_el$3.$$click = ()=>close_toast_() /* We have to wait for close_toast_ to get defined after the call to show_toast */ ;
|
|
4964
|
+
(0, $kyEB6$insert)(_el$3, ()=>i18n_.ok_());
|
|
4965
|
+
return _el$2;
|
|
4966
|
+
})()
|
|
4967
|
+
]
|
|
4968
|
+
});
|
|
4969
|
+
}
|
|
4970
|
+
})));
|
|
4971
|
+
(0, $kyEB6$onCleanup)(disconnect);
|
|
4972
|
+
}
|
|
4973
|
+
(0, $kyEB6$delegateEvents)([
|
|
4974
|
+
"click"
|
|
4975
|
+
]);
|
|
4976
|
+
|
|
4977
|
+
|
|
4952
4978
|
const $df5d81d0fe61ff21$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$kyEB6$template)(`<div class="product-count"> </div>`, 2), $df5d81d0fe61ff21$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$kyEB6$template)(`<div></div>`, 2), $df5d81d0fe61ff21$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$kyEB6$template)(`<div class="filter-results-for-one-row"></div>`, 2), $df5d81d0fe61ff21$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$kyEB6$template)(`<div class="depict plp category"><div class="listing-page"></div></div>`, 4);
|
|
4953
4979
|
function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({ depict_api_: depict_api_ , query_id_: query_id_ , current_sorting_: current_sorting_ , min_products_to_fetch_: min_products_to_fetch_ , category_filters_open_: category_filters_open_ , category_sorting_open_: category_sorting_open_ , expanded_filters_: expanded_filters_ , selected_filters_: selected_filters_ , get_quicklinks_accessor_: get_quicklinks_accessor_ , i18n_: incoming_i18n , get_breadcrumb_accessor_: get_breadcrumb_accessor_ , slider_arrow_button_: slider_arrow_button_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , local_filter_cache_: local_filter_cache_ , tenant_: tenant_ , market_: market_ , router_: router_ , show_quicklinks_: show_quicklinks_ , category_title_: category_title_ , show_breadcrumbs_: show_breadcrumbs_ , layout_options_: layout_options_ , scroll_restoration_data_: scroll_restoration_data_ , product_card_template_: product_card_template_ , sideways_filter_clearing_flag_: sideways_filter_clearing_flag_ }) {
|
|
4954
4980
|
let results_for;
|
|
@@ -5134,6 +5160,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
5134
5160
|
document.createComment("Category page based on Depict SDK"),
|
|
5135
5161
|
(()=>{
|
|
5136
5162
|
const _el$5 = $df5d81d0fe61ff21$var$_tmpl$4.cloneNode(true), _el$6 = _el$5.firstChild;
|
|
5163
|
+
(0, $kyEB6$use)((el)=>process.env.NODE_ENV === "development" && (0, $eb9ba2e49ab3dcc2$export$d4fc5c0e68a52116)(el, query_id_, i18n_), _el$5);
|
|
5137
5164
|
(0, $kyEB6$insert)(_el$6, (0, $kyEB6$createComponent)((0, $kyEB6$Show), {
|
|
5138
5165
|
when: show_breadcrumbs_,
|
|
5139
5166
|
get children () {
|
|
@@ -6184,6 +6211,7 @@ function $172e1b898d457050$var$make_state_saved_rows([get_showing_recommendation
|
|
|
6184
6211
|
|
|
6185
6212
|
|
|
6186
6213
|
|
|
6214
|
+
|
|
6187
6215
|
function $b6d5529b253681aa$export$b3ad617e9036868(modal_body_style, input_field, width_transformer, includeScroll, one_axies_only) {
|
|
6188
6216
|
let aligned_this_microtask = false;
|
|
6189
6217
|
const align_position = ()=>{
|
|
@@ -6216,8 +6244,7 @@ function $b6d5529b253681aa$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
6216
6244
|
}));
|
|
6217
6245
|
ro.observe(input_field);
|
|
6218
6246
|
}
|
|
6219
|
-
|
|
6220
|
-
window.addEventListener("orientationchange", align_position);
|
|
6247
|
+
(0, $8f9120a1ca151e6a$export$205efb947c7ffd78)(align_position);
|
|
6221
6248
|
// "resize" doesn't fire sometimes when it should, also it doesn't when showing/hiding scrollbars which disabling scrolling does
|
|
6222
6249
|
// this works
|
|
6223
6250
|
// keeping resize just in case
|
|
@@ -6227,8 +6254,6 @@ function $b6d5529b253681aa$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
6227
6254
|
(0, $kyEB6$onCleanup)((0, $kyEB6$catchify)(()=>{
|
|
6228
6255
|
ro?.disconnect();
|
|
6229
6256
|
resize_resize_observer.disconnect();
|
|
6230
|
-
window.removeEventListener("resize", align_position);
|
|
6231
|
-
window.removeEventListener("orientationchange", align_position);
|
|
6232
6257
|
}));
|
|
6233
6258
|
return align_position;
|
|
6234
6259
|
}
|
|
@@ -8088,13 +8113,14 @@ class $806c97b931758897$export$ac6237957a15b3f0 {
|
|
|
8088
8113
|
set market(market) {
|
|
8089
8114
|
this.#market_signal[1](market);
|
|
8090
8115
|
}
|
|
8091
|
-
async fetchSearchResults(query, filters) {
|
|
8116
|
+
async fetchSearchResults(query, filters, limit = 50) {
|
|
8092
8117
|
const { depict_api_: depict_api_ } = $806c97b931758897$var$privately_shared_properties.get(this);
|
|
8093
8118
|
const result = await depict_api_.query({
|
|
8094
8119
|
tenant: this.merchant,
|
|
8095
8120
|
market: this.market,
|
|
8096
8121
|
query: query,
|
|
8097
|
-
filters: filters
|
|
8122
|
+
filters: filters,
|
|
8123
|
+
limit: limit
|
|
8098
8124
|
});
|
|
8099
8125
|
if (result.failed) throw new Error("Failed to fetch search results");
|
|
8100
8126
|
return result.displays;
|
|
@@ -8521,7 +8547,25 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
8521
8547
|
}
|
|
8522
8548
|
|
|
8523
8549
|
|
|
8550
|
+
|
|
8551
|
+
const $4690a06c8489dcd0$export$c3834fa86c616831 = [
|
|
8552
|
+
[
|
|
8553
|
+
4
|
|
8554
|
+
],
|
|
8555
|
+
[
|
|
8556
|
+
3,
|
|
8557
|
+
1024
|
|
8558
|
+
],
|
|
8559
|
+
[
|
|
8560
|
+
2,
|
|
8561
|
+
901
|
|
8562
|
+
]
|
|
8563
|
+
];
|
|
8564
|
+
const $4690a06c8489dcd0$export$864d304a0bc46829 = "2%";
|
|
8565
|
+
const $4690a06c8489dcd0$export$7bf543b9d9be2c22 = (0, $e4615ecd1849548f$export$b91cec6bdc6b32a1);
|
|
8566
|
+
|
|
8567
|
+
|
|
8524
8568
|
(0, $kyEB6$add_to_version_info)("ui", (0, $ec291e0010116877$export$83d89fbfd8236492));
|
|
8525
8569
|
|
|
8526
8570
|
|
|
8527
|
-
export {$
|
|
8571
|
+
export {$c58717f39bf51647$export$58e808b1db15d3bc as fetchDepictRecommendations, $961b5c64bef4662f$export$de035477d6fef996 as QuickLinks, $961b5c64bef4662f$export$5b7c3ce0ebe51f86 as BreadCrumbs, $e4615ecd1849548f$export$b91cec6bdc6b32a1 as CategoryTitle, $a79d86d64fb64e8e$export$824dde41348efed1 as embedded_num_products, $5c5f95951393e5d1$export$643598a327b5833e as get_categories, $961b5c64bef4662f$export$f34314aa9505732e as DepictCategory, $961b5c64bef4662f$export$e2bf8ce7779e827e as CategoryPage, $806c97b931758897$export$ac6237957a15b3f0 as DepictSearch, $806c97b931758897$export$bde3eb976dfded9 as get_search_query_updating_blocked_signal, $806c97b931758897$export$f2dc7e4e4aa11abb as SearchPage, $806c97b931758897$export$316f6f283ae64765 as SearchField, $4fd48cb976bf1789$export$aa14a9f43128f61f as ProductCardError, $6891c018a834cfdd$export$d86a33413558014e as open_modal_with_alignment, $bb15dfb548a7666e$export$ee1733d9a8495996 as DefaultInstantCardPlaceholder, $b6d5529b253681aa$export$b3ad617e9036868 as align_field, $b5cccc8ee7d24677$export$6daf8749b65a1b77 as convert_sdk_cols_at_size_to_layout, $926b1b5ba2239356$export$1233ca167bf71f9a as styles_to_valid_css_string, $aea1edf92433e81e$export$fe334901e8bebd57 as disable_scrolling, $6e8944558258054f$export$d0596b5cae35ad4 as open_search_with_shift_slash, $7fa23e2a0079eca4$export$e015ed2f2950f2e3 as DepictAPI, $dc9262ef6f786812$export$d9f36cf74e24d595 as media_query_to_accessor, $6936724b9e0b98d5$export$689e204eadb33baf as setup_fast_leave, $bf52d9f9eebd1938$export$5196e4c01fa56fcb as show_toast, $8c0f86cb3e266eeb$export$a71e92cfbb498adc as SolidFormatPrice, $4ca91518c9a35379$export$828dcdd425fd3231 as connect_search_field_height_to_aligner_height, $753e9b2889a47c89$export$3ccaa27d81dd8556 as PageReplacer, $4690a06c8489dcd0$export$864d304a0bc46829 as defaultGridSpacing, $4690a06c8489dcd0$export$c3834fa86c616831 as defaultColsAtSize, $4690a06c8489dcd0$export$7bf543b9d9be2c22 as defaultCategoryTitlePlugin, $ec291e0010116877$export$83d89fbfd8236492 as version};
|