@depict-ai/ui 4.8.29 → 4.9.0
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 +90 -51
- package/ES10/index.d.ts +4 -3
- package/ES10/index.js +90 -51
- package/latest/index.cjs +89 -50
- package/latest/index.d.ts +4 -3
- package/latest/index.js +89 -50
- package/locales/ES10/index.cjs +25 -12
- package/locales/ES10/index.d.ts +1 -0
- package/locales/ES10/index.js +25 -12
- package/locales/latest/index.cjs +25 -12
- package/locales/latest/index.d.ts +1 -0
- package/locales/latest/index.js +25 -12
- package/package.json +4 -4
- package/server/ES10/index.cjs +82 -37
- package/server/ES10/index.d.ts +4 -3
- package/server/ES10/index.js +82 -37
- package/server/latest/index.cjs +81 -36
- package/server/latest/index.d.ts +4 -3
- package/server/latest/index.js +81 -36
package/ES10/index.cjs
CHANGED
|
@@ -115,7 +115,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
|
|
|
115
115
|
$parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
|
|
116
116
|
$parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
|
|
117
117
|
/*! Depict.ai search and product listing SDK */
|
|
118
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.
|
|
118
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.9.0";
|
|
119
119
|
function $3e17e871e9d0911d$export$d9f36cf74e24d595(media_query) {
|
|
120
120
|
const signal = $52FdA$solidjs.createSignal(false);
|
|
121
121
|
$52FdA$solidjs.onCleanup($52FdA$depictaiutilishared.javascript_media_query(media_query, _ref => {
|
|
@@ -8242,6 +8242,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
8242
8242
|
const first_result_in_viewport_ = $52FdA$solidjs.createSignal();
|
|
8243
8243
|
const last_result_in_viewport_ = $52FdA$solidjs.createSignal();
|
|
8244
8244
|
const all_products_loaded_ = $52FdA$solidjs.createSignal(false);
|
|
8245
|
+
const [, setAllProductsLoaded] = all_products_loaded_;
|
|
8245
8246
|
const [currentlyLoadedDisplays, setCurrentlyLoadedDisplays_] = $52FdA$solidjs.createSignal(0);
|
|
8246
8247
|
const [can_write_scroll_restoration_, set_can_write_scroll_restoration] = $52FdA$solidjs.createSignal(false);
|
|
8247
8248
|
const owner = $52FdA$solidjs.getOwner();
|
|
@@ -8271,31 +8272,34 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
8271
8272
|
// Make "Get products in listing" request to get products in listing
|
|
8272
8273
|
const [plp_products_] = $52FdA$solidjs.createResource(products_query_base_,
|
|
8273
8274
|
// only first page of results, unless the history state says we should load more (can't do that in load more thing, I tested, they need to be added at once for the browser to not give up scroll restoration)
|
|
8274
|
-
$52FdA$depictaiutilisharedlatest.catchify(base_query =>
|
|
8275
|
-
|
|
8276
|
-
|
|
8277
|
-
|
|
8278
|
-
|
|
8279
|
-
|
|
8280
|
-
|
|
8281
|
-
|
|
8282
|
-
|
|
8283
|
-
|
|
8284
|
-
|
|
8285
|
-
|
|
8286
|
-
|
|
8287
|
-
|
|
8288
|
-
|
|
8289
|
-
|
|
8290
|
-
|
|
8291
|
-
|
|
8292
|
-
|
|
8293
|
-
|
|
8294
|
-
|
|
8295
|
-
|
|
8296
|
-
|
|
8297
|
-
|
|
8298
|
-
|
|
8275
|
+
$52FdA$depictaiutilisharedlatest.catchify(base_query => {
|
|
8276
|
+
setAllProductsLoaded(false);
|
|
8277
|
+
return $fef4890f1f8e0544$export$cc42dd29bf655ab6({
|
|
8278
|
+
id_: $52FdA$solidjs.untrack(id_to_query_for_),
|
|
8279
|
+
scroll_restoration_data_: scroll_restoration_data_,
|
|
8280
|
+
min_products_to_fetch_: min_products_to_fetch_,
|
|
8281
|
+
make_request_: (limit, cursor) => depict_api_.get_listing_products({
|
|
8282
|
+
...base_query,
|
|
8283
|
+
limit: limit,
|
|
8284
|
+
...(cursor ? {
|
|
8285
|
+
cursor: cursor
|
|
8286
|
+
} : {}),
|
|
8287
|
+
// This gets exposed to the products display transformer and gives it information about the listing the products are in
|
|
8288
|
+
// It's very hard to implement tracking that uses the collection title without this information
|
|
8289
|
+
currentListingForTransformer_: new Promise(resolve => $52FdA$solidjs.createRoot(dispose => {
|
|
8290
|
+
$52FdA$solidjs.createEffect($52FdA$depictaiutilisharedlatest.catchify(() => {
|
|
8291
|
+
const key = base_query.id_type_ + base_query.id_to_query_for_;
|
|
8292
|
+
const metaResponsePromise = metaRequestsForQuery().get(key);
|
|
8293
|
+
if (!metaResponsePromise) return;
|
|
8294
|
+
resolve(metaResponsePromise);
|
|
8295
|
+
dispose();
|
|
8296
|
+
setMetaRequestsForQuery(prev => (prev.delete(key), prev));
|
|
8297
|
+
}));
|
|
8298
|
+
$52FdA$solidjs.runWithOwner(owner, () => $52FdA$solidjs.onCleanup(dispose));
|
|
8299
|
+
}))
|
|
8300
|
+
})
|
|
8301
|
+
});
|
|
8302
|
+
}));
|
|
8299
8303
|
const meta_query_base = $e4bc31358c414b18$export$210f130a61ac1e8d(() => ({
|
|
8300
8304
|
merchant: merchant_(),
|
|
8301
8305
|
market: market_(),
|
|
@@ -11415,15 +11419,16 @@ function $9035b24c2dbd3f36$var$RawClassicSearchModal(_ref) {
|
|
|
11415
11419
|
if (key === "Escape") close_modal_();
|
|
11416
11420
|
});
|
|
11417
11421
|
// total number of results = content results + product results
|
|
11418
|
-
const
|
|
11419
|
-
|
|
11420
|
-
|
|
11421
|
-
|
|
11422
|
-
|
|
11423
|
-
|
|
11424
|
-
|
|
11425
|
-
|
|
11426
|
-
|
|
11422
|
+
const totalNumberOfResults = $52FdA$solidjs.createMemo(() => {
|
|
11423
|
+
var _get_modal_search_res, _results$content_sear;
|
|
11424
|
+
const results = (_get_modal_search_res = get_modal_search_results()) === null || _get_modal_search_res === void 0 ? void 0 : _get_modal_search_res();
|
|
11425
|
+
const hits = results === null || results === void 0 ? void 0 : results.n_hits;
|
|
11426
|
+
const content_results = results === null || results === void 0 ? void 0 : (_results$content_sear = results.content_search_links) === null || _results$content_sear === void 0 ? void 0 : _results$content_sear.length;
|
|
11427
|
+
if (!content_results || !content_search_enabled_()) return hits;
|
|
11428
|
+
return (hits !== null && hits !== void 0 ? hits : 0) + content_results;
|
|
11429
|
+
});
|
|
11430
|
+
const formattedTotalNumberResults = $068bde7fa83ac02c$export$92f2da32c6e7e7ee({
|
|
11431
|
+
number_: totalNumberOfResults,
|
|
11427
11432
|
i18n_: i18n_
|
|
11428
11433
|
});
|
|
11429
11434
|
const selected_index = $52FdA$solidjs.createSignal();
|
|
@@ -11435,14 +11440,31 @@ function $9035b24c2dbd3f36$var$RawClassicSearchModal(_ref) {
|
|
|
11435
11440
|
var _el$ = $52FdA$solidjsweb.getNextElement($9035b24c2dbd3f36$var$_tmpl$),
|
|
11436
11441
|
_el$2 = _el$.firstChild;
|
|
11437
11442
|
$52FdA$solidjsweb.addEventListener(_el$2, "click", $52FdA$depictaiutilishared.catchify(() => submit_query_()), true);
|
|
11438
|
-
$52FdA$solidjsweb.insert(_el$2, (()
|
|
11439
|
-
|
|
11440
|
-
|
|
11441
|
-
|
|
11442
|
-
|
|
11443
|
-
return
|
|
11444
|
-
}
|
|
11445
|
-
|
|
11443
|
+
$52FdA$solidjsweb.insert(_el$2, $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
|
|
11444
|
+
get when() {
|
|
11445
|
+
return get_search_field_value_();
|
|
11446
|
+
},
|
|
11447
|
+
get fallback() {
|
|
11448
|
+
return i18n_.modal_discover_more_();
|
|
11449
|
+
},
|
|
11450
|
+
get children() {
|
|
11451
|
+
return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
|
|
11452
|
+
get when() {
|
|
11453
|
+
return totalNumberOfResults();
|
|
11454
|
+
},
|
|
11455
|
+
get fallback() {
|
|
11456
|
+
return i18n_.modal_view_all_no_results_();
|
|
11457
|
+
},
|
|
11458
|
+
get children() {
|
|
11459
|
+
return i18n_.modal_view_all_results_()((() => {
|
|
11460
|
+
var _el$3 = $52FdA$solidjsweb.getNextElement($9035b24c2dbd3f36$var$_tmpl$2);
|
|
11461
|
+
$52FdA$solidjsweb.insert(_el$3, formattedTotalNumberResults);
|
|
11462
|
+
return _el$3;
|
|
11463
|
+
})());
|
|
11464
|
+
}
|
|
11465
|
+
});
|
|
11466
|
+
}
|
|
11467
|
+
}));
|
|
11446
11468
|
$52FdA$solidjsweb.runHydrationEvents();
|
|
11447
11469
|
return _el$;
|
|
11448
11470
|
})();
|
|
@@ -12484,14 +12506,31 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
|
|
|
12484
12506
|
var _el$7 = $52FdA$solidjsweb.getNextElement($43600b30502feeda$var$_tmpl$4),
|
|
12485
12507
|
_el$8 = _el$7.firstChild;
|
|
12486
12508
|
$52FdA$solidjsweb.addEventListener(_el$8, "click", $52FdA$depictaiutilishared.catchify(() => submit_query_()), true);
|
|
12487
|
-
$52FdA$solidjsweb.insert(_el$8, (()
|
|
12488
|
-
|
|
12489
|
-
|
|
12490
|
-
|
|
12491
|
-
|
|
12492
|
-
return
|
|
12493
|
-
}
|
|
12494
|
-
|
|
12509
|
+
$52FdA$solidjsweb.insert(_el$8, $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
|
|
12510
|
+
get when() {
|
|
12511
|
+
return get_search_field_value_();
|
|
12512
|
+
},
|
|
12513
|
+
get fallback() {
|
|
12514
|
+
return i18n_.modal_discover_more_();
|
|
12515
|
+
},
|
|
12516
|
+
get children() {
|
|
12517
|
+
return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
|
|
12518
|
+
get when() {
|
|
12519
|
+
return totalNumberResults();
|
|
12520
|
+
},
|
|
12521
|
+
get fallback() {
|
|
12522
|
+
return i18n_.modal_view_all_no_results_();
|
|
12523
|
+
},
|
|
12524
|
+
get children() {
|
|
12525
|
+
return i18n_.modal_view_all_results_()((() => {
|
|
12526
|
+
var _el$9 = $52FdA$solidjsweb.getNextElement($43600b30502feeda$var$_tmpl$5);
|
|
12527
|
+
$52FdA$solidjsweb.insert(_el$9, formattedTotalNumberResults);
|
|
12528
|
+
return _el$9;
|
|
12529
|
+
})());
|
|
12530
|
+
}
|
|
12531
|
+
});
|
|
12532
|
+
}
|
|
12533
|
+
}));
|
|
12495
12534
|
$52FdA$solidjsweb.runHydrationEvents();
|
|
12496
12535
|
return _el$7;
|
|
12497
12536
|
})();
|
package/ES10/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
|
|
13
13
|
import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
|
|
14
|
-
export const version = "4.
|
|
14
|
+
export const version = "4.9.0";
|
|
15
15
|
/**
|
|
16
16
|
* Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
|
|
17
17
|
*/
|
|
@@ -110,6 +110,7 @@ interface search_i18n extends plp_shared_i18n {
|
|
|
110
110
|
previous_: string;
|
|
111
111
|
popular_: string;
|
|
112
112
|
products_: string;
|
|
113
|
+
modal_view_all_no_results_: string;
|
|
113
114
|
}
|
|
114
115
|
/**
|
|
115
116
|
* Category internationalisation
|
|
@@ -1538,7 +1539,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
|
|
|
1538
1539
|
* Open the modal with support for alignment.
|
|
1539
1540
|
* @returns {void}
|
|
1540
1541
|
*/
|
|
1541
|
-
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends
|
|
1542
|
+
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
|
|
1542
1543
|
export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
|
|
1543
1544
|
export interface PageReplacer {
|
|
1544
1545
|
readonly render_: () => Node_Array;
|
|
@@ -1618,5 +1619,5 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
|
|
|
1618
1619
|
layout?: PossibleLayout;
|
|
1619
1620
|
filterModalParent_?: HTMLElement | ShadowRoot;
|
|
1620
1621
|
showSliderArrow_?: boolean;
|
|
1621
|
-
}): import("@depict-ai/utilishared").Node_Array;
|
|
1622
|
+
}): import("@depict-ai/utilishared/latest").Node_Array;
|
|
1622
1623
|
export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";
|
package/ES10/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import $8tj43$babelruntimehelpersclassPrivateFieldGet from "@babel/runtime/helpe
|
|
|
10
10
|
/*! Depict.ai search and product listing SDK */
|
|
11
11
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
12
12
|
register_es_version("ui", "ES10");
|
|
13
|
-
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.9.0";
|
|
14
14
|
function $00a5b94f0c11efbb$export$d9f36cf74e24d595(media_query) {
|
|
15
15
|
const signal = $8tj43$createSignal(false);
|
|
16
16
|
$8tj43$onCleanup($8tj43$javascript_media_query(media_query, _ref => {
|
|
@@ -8137,6 +8137,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
8137
8137
|
const first_result_in_viewport_ = $8tj43$createSignal();
|
|
8138
8138
|
const last_result_in_viewport_ = $8tj43$createSignal();
|
|
8139
8139
|
const all_products_loaded_ = $8tj43$createSignal(false);
|
|
8140
|
+
const [, setAllProductsLoaded] = all_products_loaded_;
|
|
8140
8141
|
const [currentlyLoadedDisplays, setCurrentlyLoadedDisplays_] = $8tj43$createSignal(0);
|
|
8141
8142
|
const [can_write_scroll_restoration_, set_can_write_scroll_restoration] = $8tj43$createSignal(false);
|
|
8142
8143
|
const owner = $8tj43$getOwner();
|
|
@@ -8166,31 +8167,34 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
8166
8167
|
// Make "Get products in listing" request to get products in listing
|
|
8167
8168
|
const [plp_products_] = $8tj43$createResource(products_query_base_,
|
|
8168
8169
|
// only first page of results, unless the history state says we should load more (can't do that in load more thing, I tested, they need to be added at once for the browser to not give up scroll restoration)
|
|
8169
|
-
$8tj43$catchify(base_query =>
|
|
8170
|
-
|
|
8171
|
-
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
|
|
8177
|
-
|
|
8178
|
-
|
|
8179
|
-
|
|
8180
|
-
|
|
8181
|
-
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
|
|
8187
|
-
|
|
8188
|
-
|
|
8189
|
-
|
|
8190
|
-
|
|
8191
|
-
|
|
8192
|
-
|
|
8193
|
-
|
|
8170
|
+
$8tj43$catchify(base_query => {
|
|
8171
|
+
setAllProductsLoaded(false);
|
|
8172
|
+
return $5e6abec0dab4e610$export$cc42dd29bf655ab6({
|
|
8173
|
+
id_: $8tj43$untrack(id_to_query_for_),
|
|
8174
|
+
scroll_restoration_data_: scroll_restoration_data_,
|
|
8175
|
+
min_products_to_fetch_: min_products_to_fetch_,
|
|
8176
|
+
make_request_: (limit, cursor) => depict_api_.get_listing_products({
|
|
8177
|
+
...base_query,
|
|
8178
|
+
limit: limit,
|
|
8179
|
+
...(cursor ? {
|
|
8180
|
+
cursor: cursor
|
|
8181
|
+
} : {}),
|
|
8182
|
+
// This gets exposed to the products display transformer and gives it information about the listing the products are in
|
|
8183
|
+
// It's very hard to implement tracking that uses the collection title without this information
|
|
8184
|
+
currentListingForTransformer_: new Promise(resolve => $8tj43$createRoot(dispose => {
|
|
8185
|
+
$8tj43$createEffect($8tj43$catchify(() => {
|
|
8186
|
+
const key = base_query.id_type_ + base_query.id_to_query_for_;
|
|
8187
|
+
const metaResponsePromise = metaRequestsForQuery().get(key);
|
|
8188
|
+
if (!metaResponsePromise) return;
|
|
8189
|
+
resolve(metaResponsePromise);
|
|
8190
|
+
dispose();
|
|
8191
|
+
setMetaRequestsForQuery(prev => (prev.delete(key), prev));
|
|
8192
|
+
}));
|
|
8193
|
+
$8tj43$runWithOwner(owner, () => $8tj43$onCleanup(dispose));
|
|
8194
|
+
}))
|
|
8195
|
+
})
|
|
8196
|
+
});
|
|
8197
|
+
}));
|
|
8194
8198
|
const meta_query_base = $ec225bf1f1627ea8$export$210f130a61ac1e8d(() => ({
|
|
8195
8199
|
merchant: merchant_(),
|
|
8196
8200
|
market: market_(),
|
|
@@ -11310,15 +11314,16 @@ function $40411f2ec772c376$var$RawClassicSearchModal(_ref) {
|
|
|
11310
11314
|
if (key === "Escape") close_modal_();
|
|
11311
11315
|
});
|
|
11312
11316
|
// total number of results = content results + product results
|
|
11313
|
-
const
|
|
11314
|
-
|
|
11315
|
-
|
|
11316
|
-
|
|
11317
|
-
|
|
11318
|
-
|
|
11319
|
-
|
|
11320
|
-
|
|
11321
|
-
|
|
11317
|
+
const totalNumberOfResults = $8tj43$createMemo(() => {
|
|
11318
|
+
var _get_modal_search_res, _results$content_sear;
|
|
11319
|
+
const results = (_get_modal_search_res = get_modal_search_results()) === null || _get_modal_search_res === void 0 ? void 0 : _get_modal_search_res();
|
|
11320
|
+
const hits = results === null || results === void 0 ? void 0 : results.n_hits;
|
|
11321
|
+
const content_results = results === null || results === void 0 ? void 0 : (_results$content_sear = results.content_search_links) === null || _results$content_sear === void 0 ? void 0 : _results$content_sear.length;
|
|
11322
|
+
if (!content_results || !content_search_enabled_()) return hits;
|
|
11323
|
+
return (hits !== null && hits !== void 0 ? hits : 0) + content_results;
|
|
11324
|
+
});
|
|
11325
|
+
const formattedTotalNumberResults = $43fbdca0f726a34b$export$92f2da32c6e7e7ee({
|
|
11326
|
+
number_: totalNumberOfResults,
|
|
11322
11327
|
i18n_: i18n_
|
|
11323
11328
|
});
|
|
11324
11329
|
const selected_index = $8tj43$createSignal();
|
|
@@ -11330,14 +11335,31 @@ function $40411f2ec772c376$var$RawClassicSearchModal(_ref) {
|
|
|
11330
11335
|
var _el$ = $8tj43$getNextElement($40411f2ec772c376$var$_tmpl$),
|
|
11331
11336
|
_el$2 = _el$.firstChild;
|
|
11332
11337
|
$8tj43$addEventListener(_el$2, "click", $8tj43$catchify1(() => submit_query_()), true);
|
|
11333
|
-
$8tj43$insert(_el$2, (()
|
|
11334
|
-
|
|
11335
|
-
|
|
11336
|
-
|
|
11337
|
-
|
|
11338
|
-
return
|
|
11339
|
-
}
|
|
11340
|
-
|
|
11338
|
+
$8tj43$insert(_el$2, $8tj43$createComponent((0, $8tj43$Show), {
|
|
11339
|
+
get when() {
|
|
11340
|
+
return get_search_field_value_();
|
|
11341
|
+
},
|
|
11342
|
+
get fallback() {
|
|
11343
|
+
return i18n_.modal_discover_more_();
|
|
11344
|
+
},
|
|
11345
|
+
get children() {
|
|
11346
|
+
return $8tj43$createComponent((0, $8tj43$Show), {
|
|
11347
|
+
get when() {
|
|
11348
|
+
return totalNumberOfResults();
|
|
11349
|
+
},
|
|
11350
|
+
get fallback() {
|
|
11351
|
+
return i18n_.modal_view_all_no_results_();
|
|
11352
|
+
},
|
|
11353
|
+
get children() {
|
|
11354
|
+
return i18n_.modal_view_all_results_()((() => {
|
|
11355
|
+
var _el$3 = $8tj43$getNextElement($40411f2ec772c376$var$_tmpl$2);
|
|
11356
|
+
$8tj43$insert(_el$3, formattedTotalNumberResults);
|
|
11357
|
+
return _el$3;
|
|
11358
|
+
})());
|
|
11359
|
+
}
|
|
11360
|
+
});
|
|
11361
|
+
}
|
|
11362
|
+
}));
|
|
11341
11363
|
$8tj43$runHydrationEvents();
|
|
11342
11364
|
return _el$;
|
|
11343
11365
|
})();
|
|
@@ -12379,14 +12401,31 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
|
|
|
12379
12401
|
var _el$7 = $8tj43$getNextElement($06fcd2a345efd24d$var$_tmpl$4),
|
|
12380
12402
|
_el$8 = _el$7.firstChild;
|
|
12381
12403
|
$8tj43$addEventListener(_el$8, "click", $8tj43$catchify1(() => submit_query_()), true);
|
|
12382
|
-
$8tj43$insert(_el$8, (()
|
|
12383
|
-
|
|
12384
|
-
|
|
12385
|
-
|
|
12386
|
-
|
|
12387
|
-
return
|
|
12388
|
-
}
|
|
12389
|
-
|
|
12404
|
+
$8tj43$insert(_el$8, $8tj43$createComponent((0, $8tj43$Show), {
|
|
12405
|
+
get when() {
|
|
12406
|
+
return get_search_field_value_();
|
|
12407
|
+
},
|
|
12408
|
+
get fallback() {
|
|
12409
|
+
return i18n_.modal_discover_more_();
|
|
12410
|
+
},
|
|
12411
|
+
get children() {
|
|
12412
|
+
return $8tj43$createComponent((0, $8tj43$Show), {
|
|
12413
|
+
get when() {
|
|
12414
|
+
return totalNumberResults();
|
|
12415
|
+
},
|
|
12416
|
+
get fallback() {
|
|
12417
|
+
return i18n_.modal_view_all_no_results_();
|
|
12418
|
+
},
|
|
12419
|
+
get children() {
|
|
12420
|
+
return i18n_.modal_view_all_results_()((() => {
|
|
12421
|
+
var _el$9 = $8tj43$getNextElement($06fcd2a345efd24d$var$_tmpl$5);
|
|
12422
|
+
$8tj43$insert(_el$9, formattedTotalNumberResults);
|
|
12423
|
+
return _el$9;
|
|
12424
|
+
})());
|
|
12425
|
+
}
|
|
12426
|
+
});
|
|
12427
|
+
}
|
|
12428
|
+
}));
|
|
12390
12429
|
$8tj43$runHydrationEvents();
|
|
12391
12430
|
return _el$7;
|
|
12392
12431
|
})();
|
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.
|
|
112
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.9.0";
|
|
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, ({
|
|
@@ -7800,6 +7800,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
|
|
|
7800
7800
|
const first_result_in_viewport_ = $gVhhF$solidjs.createSignal();
|
|
7801
7801
|
const last_result_in_viewport_ = $gVhhF$solidjs.createSignal();
|
|
7802
7802
|
const all_products_loaded_ = $gVhhF$solidjs.createSignal(false);
|
|
7803
|
+
const [, setAllProductsLoaded] = all_products_loaded_;
|
|
7803
7804
|
const [currentlyLoadedDisplays, setCurrentlyLoadedDisplays_] = $gVhhF$solidjs.createSignal(0);
|
|
7804
7805
|
const [can_write_scroll_restoration_, set_can_write_scroll_restoration] = $gVhhF$solidjs.createSignal(false);
|
|
7805
7806
|
const owner = $gVhhF$solidjs.getOwner();
|
|
@@ -7829,31 +7830,34 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
|
|
|
7829
7830
|
// Make "Get products in listing" request to get products in listing
|
|
7830
7831
|
const [plp_products_] = $gVhhF$solidjs.createResource(products_query_base_,
|
|
7831
7832
|
// only first page of results, unless the history state says we should load more (can't do that in load more thing, I tested, they need to be added at once for the browser to not give up scroll restoration)
|
|
7832
|
-
$gVhhF$depictaiutilisharedlatest.catchify(base_query =>
|
|
7833
|
-
|
|
7834
|
-
|
|
7835
|
-
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
7839
|
-
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7833
|
+
$gVhhF$depictaiutilisharedlatest.catchify(base_query => {
|
|
7834
|
+
setAllProductsLoaded(false);
|
|
7835
|
+
return $276380e4607fb9fb$export$cc42dd29bf655ab6({
|
|
7836
|
+
id_: $gVhhF$solidjs.untrack(id_to_query_for_),
|
|
7837
|
+
scroll_restoration_data_: scroll_restoration_data_,
|
|
7838
|
+
min_products_to_fetch_: min_products_to_fetch_,
|
|
7839
|
+
make_request_: (limit, cursor) => depict_api_.get_listing_products({
|
|
7840
|
+
...base_query,
|
|
7841
|
+
limit: limit,
|
|
7842
|
+
...(cursor ? {
|
|
7843
|
+
cursor: cursor
|
|
7844
|
+
} : {}),
|
|
7845
|
+
// This gets exposed to the products display transformer and gives it information about the listing the products are in
|
|
7846
|
+
// It's very hard to implement tracking that uses the collection title without this information
|
|
7847
|
+
currentListingForTransformer_: new Promise(resolve => $gVhhF$solidjs.createRoot(dispose => {
|
|
7848
|
+
$gVhhF$solidjs.createEffect($gVhhF$depictaiutilisharedlatest.catchify(() => {
|
|
7849
|
+
const key = base_query.id_type_ + base_query.id_to_query_for_;
|
|
7850
|
+
const metaResponsePromise = metaRequestsForQuery().get(key);
|
|
7851
|
+
if (!metaResponsePromise) return;
|
|
7852
|
+
resolve(metaResponsePromise);
|
|
7853
|
+
dispose();
|
|
7854
|
+
setMetaRequestsForQuery(prev => (prev.delete(key), prev));
|
|
7855
|
+
}));
|
|
7856
|
+
$gVhhF$solidjs.runWithOwner(owner, () => $gVhhF$solidjs.onCleanup(dispose));
|
|
7857
|
+
}))
|
|
7858
|
+
})
|
|
7859
|
+
});
|
|
7860
|
+
}));
|
|
7857
7861
|
const meta_query_base = $8cd545330f2674dc$export$210f130a61ac1e8d(() => ({
|
|
7858
7862
|
merchant: merchant_(),
|
|
7859
7863
|
market: market_(),
|
|
@@ -10798,14 +10802,15 @@ function $44f0b2e312a9b710$var$RawClassicSearchModal({
|
|
|
10798
10802
|
if (key === "Escape") close_modal_();
|
|
10799
10803
|
});
|
|
10800
10804
|
// total number of results = content results + product results
|
|
10801
|
-
const
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
|
|
10805
|
+
const totalNumberOfResults = $gVhhF$solidjs.createMemo(() => {
|
|
10806
|
+
const results = get_modal_search_results()?.();
|
|
10807
|
+
const hits = results?.n_hits;
|
|
10808
|
+
const content_results = results?.content_search_links?.length;
|
|
10809
|
+
if (!content_results || !content_search_enabled_()) return hits;
|
|
10810
|
+
return (hits ?? 0) + content_results;
|
|
10811
|
+
});
|
|
10812
|
+
const formattedTotalNumberResults = $0f400c3f7248d5f1$export$92f2da32c6e7e7ee({
|
|
10813
|
+
number_: totalNumberOfResults,
|
|
10809
10814
|
i18n_: i18n_
|
|
10810
10815
|
});
|
|
10811
10816
|
const selected_index = $gVhhF$solidjs.createSignal();
|
|
@@ -10817,14 +10822,31 @@ function $44f0b2e312a9b710$var$RawClassicSearchModal({
|
|
|
10817
10822
|
var _el$ = $gVhhF$solidjsweb.getNextElement($44f0b2e312a9b710$var$_tmpl$),
|
|
10818
10823
|
_el$2 = _el$.firstChild;
|
|
10819
10824
|
$gVhhF$solidjsweb.addEventListener(_el$2, "click", $gVhhF$depictaiutilishared.catchify(() => submit_query_()), true);
|
|
10820
|
-
$gVhhF$solidjsweb.insert(_el$2, (()
|
|
10821
|
-
|
|
10822
|
-
|
|
10823
|
-
|
|
10824
|
-
|
|
10825
|
-
return
|
|
10826
|
-
}
|
|
10827
|
-
|
|
10825
|
+
$gVhhF$solidjsweb.insert(_el$2, $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
|
|
10826
|
+
get when() {
|
|
10827
|
+
return get_search_field_value_();
|
|
10828
|
+
},
|
|
10829
|
+
get fallback() {
|
|
10830
|
+
return i18n_.modal_discover_more_();
|
|
10831
|
+
},
|
|
10832
|
+
get children() {
|
|
10833
|
+
return $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
|
|
10834
|
+
get when() {
|
|
10835
|
+
return totalNumberOfResults();
|
|
10836
|
+
},
|
|
10837
|
+
get fallback() {
|
|
10838
|
+
return i18n_.modal_view_all_no_results_();
|
|
10839
|
+
},
|
|
10840
|
+
get children() {
|
|
10841
|
+
return i18n_.modal_view_all_results_()((() => {
|
|
10842
|
+
var _el$3 = $gVhhF$solidjsweb.getNextElement($44f0b2e312a9b710$var$_tmpl$2);
|
|
10843
|
+
$gVhhF$solidjsweb.insert(_el$3, formattedTotalNumberResults);
|
|
10844
|
+
return _el$3;
|
|
10845
|
+
})());
|
|
10846
|
+
}
|
|
10847
|
+
});
|
|
10848
|
+
}
|
|
10849
|
+
}));
|
|
10828
10850
|
$gVhhF$solidjsweb.runHydrationEvents();
|
|
10829
10851
|
return _el$;
|
|
10830
10852
|
})();
|
|
@@ -11827,14 +11849,31 @@ function $11597ae03e703a47$var$RawSearchModalV2({
|
|
|
11827
11849
|
var _el$7 = $gVhhF$solidjsweb.getNextElement($11597ae03e703a47$var$_tmpl$4),
|
|
11828
11850
|
_el$8 = _el$7.firstChild;
|
|
11829
11851
|
$gVhhF$solidjsweb.addEventListener(_el$8, "click", $gVhhF$depictaiutilishared.catchify(() => submit_query_()), true);
|
|
11830
|
-
$gVhhF$solidjsweb.insert(_el$8, (()
|
|
11831
|
-
|
|
11832
|
-
|
|
11833
|
-
|
|
11834
|
-
|
|
11835
|
-
return
|
|
11836
|
-
}
|
|
11837
|
-
|
|
11852
|
+
$gVhhF$solidjsweb.insert(_el$8, $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
|
|
11853
|
+
get when() {
|
|
11854
|
+
return get_search_field_value_();
|
|
11855
|
+
},
|
|
11856
|
+
get fallback() {
|
|
11857
|
+
return i18n_.modal_discover_more_();
|
|
11858
|
+
},
|
|
11859
|
+
get children() {
|
|
11860
|
+
return $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
|
|
11861
|
+
get when() {
|
|
11862
|
+
return totalNumberResults();
|
|
11863
|
+
},
|
|
11864
|
+
get fallback() {
|
|
11865
|
+
return i18n_.modal_view_all_no_results_();
|
|
11866
|
+
},
|
|
11867
|
+
get children() {
|
|
11868
|
+
return i18n_.modal_view_all_results_()((() => {
|
|
11869
|
+
var _el$9 = $gVhhF$solidjsweb.getNextElement($11597ae03e703a47$var$_tmpl$5);
|
|
11870
|
+
$gVhhF$solidjsweb.insert(_el$9, formattedTotalNumberResults);
|
|
11871
|
+
return _el$9;
|
|
11872
|
+
})());
|
|
11873
|
+
}
|
|
11874
|
+
});
|
|
11875
|
+
}
|
|
11876
|
+
}));
|
|
11838
11877
|
$gVhhF$solidjsweb.runHydrationEvents();
|
|
11839
11878
|
return _el$7;
|
|
11840
11879
|
})();
|
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.
|
|
14
|
+
export const version = "4.9.0";
|
|
15
15
|
/**
|
|
16
16
|
* Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
|
|
17
17
|
*/
|
|
@@ -110,6 +110,7 @@ interface search_i18n extends plp_shared_i18n {
|
|
|
110
110
|
previous_: string;
|
|
111
111
|
popular_: string;
|
|
112
112
|
products_: string;
|
|
113
|
+
modal_view_all_no_results_: string;
|
|
113
114
|
}
|
|
114
115
|
/**
|
|
115
116
|
* Category internationalisation
|
|
@@ -1538,7 +1539,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
|
|
|
1538
1539
|
* Open the modal with support for alignment.
|
|
1539
1540
|
* @returns {void}
|
|
1540
1541
|
*/
|
|
1541
|
-
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends
|
|
1542
|
+
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
|
|
1542
1543
|
export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
|
|
1543
1544
|
export interface PageReplacer {
|
|
1544
1545
|
readonly render_: () => Node_Array;
|
|
@@ -1618,5 +1619,5 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
|
|
|
1618
1619
|
layout?: PossibleLayout;
|
|
1619
1620
|
filterModalParent_?: HTMLElement | ShadowRoot;
|
|
1620
1621
|
showSliderArrow_?: boolean;
|
|
1621
|
-
}): import("@depict-ai/utilishared").Node_Array;
|
|
1622
|
+
}): import("@depict-ai/utilishared/latest").Node_Array;
|
|
1622
1623
|
export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";
|