@depict-ai/ui 1.2.1 → 1.2.3
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/dist/client/main.cjs +39 -45
- package/dist/client/main.js +9063 -0
- package/dist/client/module.js +38 -44
- package/dist/index.d.ts +2 -2
- package/dist/main.js +8692 -0
- package/dist/module.js +8743 -0
- package/dist/server/main.cjs +34 -40
- package/dist/server/main.js +8058 -0
- package/dist/server/module.js +33 -39
- package/locales/require.js +1154 -0
- package/package.json +4 -4
- package/dist/tsconfig2.tsbuildinfo +0 -1
package/dist/client/module.js
CHANGED
|
@@ -2,7 +2,7 @@ import {add_to_version_info as $gco9i$add_to_version_info, observer as $gco9i$ob
|
|
|
2
2
|
import {createRoot as $gco9i$createRoot, createSignal as $gco9i$createSignal, getOwner as $gco9i$getOwner, runWithOwner as $gco9i$runWithOwner, onCleanup as $gco9i$onCleanup, createComputed as $gco9i$createComputed, createRenderEffect as $gco9i$createRenderEffect, createEffect as $gco9i$createEffect, untrack as $gco9i$untrack, batch as $gco9i$batch, createResource as $gco9i$createResource, createMemo as $gco9i$createMemo, Show as $gco9i$Show, createReaction as $gco9i$createReaction, Suspense as $gco9i$Suspense, on as $gco9i$on, ErrorBoundary as $gco9i$ErrorBoundary, For as $gco9i$For, Index as $gco9i$Index} from "solid-js";
|
|
3
3
|
import {template as $gco9i$template, getNextElement as $gco9i$getNextElement, spread as $gco9i$spread, mergeProps as $gco9i$mergeProps, runHydrationEvents as $gco9i$runHydrationEvents, effect as $gco9i$effect, setAttribute as $gco9i$setAttribute, insert as $gco9i$insert, isServer as $gco9i$isServer, createComponent as $gco9i$createComponent, getNextMarker as $gco9i$getNextMarker, use as $gco9i$use, memo as $gco9i$memo, addEventListener as $gco9i$addEventListener, delegateEvents as $gco9i$delegateEvents, classList as $gco9i$classList, style as $gco9i$style, className as $gco9i$className, Dynamic as $gco9i$Dynamic} from "solid-js/web";
|
|
4
4
|
|
|
5
|
-
/*! Depict.ai search and product listing SDK */ const $ec291e0010116877$export$83d89fbfd8236492 = "1.2.
|
|
5
|
+
/*! Depict.ai search and product listing SDK */ const $ec291e0010116877$export$83d89fbfd8236492 = "1.2.3";
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
@@ -290,23 +290,10 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
290
290
|
let resolve_in_progress;
|
|
291
291
|
cache_obj.in_progress_[body] = new Promise((r)=>resolve_in_progress = r);
|
|
292
292
|
try {
|
|
293
|
-
|
|
293
|
+
const api_response = await (0, $gco9i$fetch_retry)((0, $gco9i$add_version_query_params)(endpoint1), {
|
|
294
294
|
method: "POST",
|
|
295
295
|
body: body
|
|
296
296
|
});
|
|
297
|
-
if ("query_id" in request && request.type === "collection") // FIXME: Remove. Backwards compatibility layer
|
|
298
|
-
// This will retry the request without the collection type if the first request fails
|
|
299
|
-
{
|
|
300
|
-
if (!api_response || api_response?.status === 404) {
|
|
301
|
-
(0, $gco9i$dlog)("Fallback request for collections due to failure");
|
|
302
|
-
const fallback_body = JSON.parse(body);
|
|
303
|
-
delete fallback_body.type;
|
|
304
|
-
api_response = await (0, $gco9i$fetch_retry)((0, $gco9i$add_version_query_params)(endpoint1), {
|
|
305
|
-
method: "POST",
|
|
306
|
-
body: JSON.stringify(fallback_body)
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
297
|
return_successfully: {
|
|
311
298
|
if (!api_response || api_response.status !== 200) break return_successfully;
|
|
312
299
|
let result;
|
|
@@ -2225,10 +2212,10 @@ function $eb8d9bf3b5700c26$export$430444115f70a734({ selected_filters_: selected
|
|
|
2225
2212
|
}), _el$10, _co$2);
|
|
2226
2213
|
(0, $gco9i$effect)(()=>_el$2.classList.toggle("count-0", !!(count() === 0)));
|
|
2227
2214
|
(0, $gco9i$effect)(()=>_el$4.checked = (0, $gco9i$createMemo)(()=>{
|
|
2215
|
+
const v = value();
|
|
2228
2216
|
const data = existing_filter()?.data;
|
|
2229
|
-
if (data ===
|
|
2230
|
-
|
|
2231
|
-
return false;
|
|
2217
|
+
if (data === v) return true;
|
|
2218
|
+
return Array.isArray(data) && data.every((item, index)=>item === v[index]);
|
|
2232
2219
|
})());
|
|
2233
2220
|
return _el$2;
|
|
2234
2221
|
})();
|
|
@@ -5259,9 +5246,9 @@ let $f86ba724282f6690$export$44dad306455dddf;
|
|
|
5259
5246
|
|
|
5260
5247
|
|
|
5261
5248
|
|
|
5262
|
-
function $
|
|
5249
|
+
function $e7fce80abe608e01$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ , query_id_: query_id_ , i18n_: i18n_ , selected_filters_: selected_filters_ , local_filter_cache_: local_filter_cache_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , plp_results_: plp_results_ , sideways_filter_clearing_flag_: sideways_filter_clearing_flag_ }) {
|
|
5263
5250
|
// If we just got opened in a new tab, clear filters instantly and remove the flag
|
|
5264
|
-
$
|
|
5251
|
+
$e7fce80abe608e01$var$clear_if_opened_new_tab_with_sideways_url_params_flag({
|
|
5265
5252
|
plp_results_: plp_results_,
|
|
5266
5253
|
local_filter_cache_: local_filter_cache_,
|
|
5267
5254
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
@@ -5305,7 +5292,7 @@ function $a1c4da51ff91dd01$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ ,
|
|
|
5305
5292
|
if (!allow_filter_clearing) allow_filter_clearing = true;
|
|
5306
5293
|
})));
|
|
5307
5294
|
}
|
|
5308
|
-
function $
|
|
5295
|
+
function $e7fce80abe608e01$var$clear_if_opened_new_tab_with_sideways_url_params_flag({ plp_results_: plp_results_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , i18n_: i18n_ , selected_filters_: selected_filters_ , local_filter_cache_: local_filter_cache_ , sideways_filter_clearing_flag_: [get_sideways_filter_clearing_flag_, set_sideways_filter_clearing_flag_] }) {
|
|
5309
5296
|
const tracking_function_for_plp_results = (0, $gco9i$createReaction)(()=>{
|
|
5310
5297
|
// On first rendering of the CategoryPage (after we have results), check if we got to this URL by going sideways in QuickLinks and clear filters with toast if so
|
|
5311
5298
|
if (!(0, $gco9i$untrack)(get_sideways_filter_clearing_flag_)) return;
|
|
@@ -5335,8 +5322,8 @@ function $a1c4da51ff91dd01$var$clear_if_opened_new_tab_with_sideways_url_params_
|
|
|
5335
5322
|
|
|
5336
5323
|
|
|
5337
5324
|
|
|
5338
|
-
const $
|
|
5339
|
-
function $
|
|
5325
|
+
const $9f5cb586f34c14e6$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="statement">No category ID specified, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a category ID in your Depict Provider.</div>`, 2), $9f5cb586f34c14e6$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="buttons"><button class="ok major"></button></div>`, 4);
|
|
5326
|
+
function $9f5cb586f34c14e6$export$d4fc5c0e68a52116(el, query_id_, i18n_) {
|
|
5340
5327
|
if (!(0, $gco9i$is_debug)) return; // Just to make sure we don't show this in production
|
|
5341
5328
|
const owner = (0, $gco9i$getOwner)();
|
|
5342
5329
|
const disconnect = (0, $gco9i$observer).onexists(el, ({ element: element })=>(0, $gco9i$runWithOwner)(owner, ()=>(0, $gco9i$createEffect)(()=>{
|
|
@@ -5351,9 +5338,9 @@ function $eb9ba2e49ab3dcc2$export$d4fc5c0e68a52116(el, query_id_, i18n_) {
|
|
|
5351
5338
|
background: "#ffb830"
|
|
5352
5339
|
},
|
|
5353
5340
|
children: [
|
|
5354
|
-
(0, $gco9i$getNextElement)($
|
|
5341
|
+
(0, $gco9i$getNextElement)($9f5cb586f34c14e6$var$_tmpl$),
|
|
5355
5342
|
(()=>{
|
|
5356
|
-
const _el$2 = (0, $gco9i$getNextElement)($
|
|
5343
|
+
const _el$2 = (0, $gco9i$getNextElement)($9f5cb586f34c14e6$var$_tmpl$2), _el$3 = _el$2.firstChild;
|
|
5357
5344
|
_el$3.$$click = ()=>close_toast_() /* We have to wait for close_toast_ to get defined after the call to show_toast */ ;
|
|
5358
5345
|
(0, $gco9i$insert)(_el$3, ()=>i18n_.ok_());
|
|
5359
5346
|
(0, $gco9i$runHydrationEvents)();
|
|
@@ -5372,6 +5359,9 @@ function $eb9ba2e49ab3dcc2$export$d4fc5c0e68a52116(el, query_id_, i18n_) {
|
|
|
5372
5359
|
|
|
5373
5360
|
|
|
5374
5361
|
|
|
5362
|
+
const $4fb3a1cf207a7d5c$export$5c28802497c8a83c = /*@__PURE__*/ Symbol("category_title_type");
|
|
5363
|
+
|
|
5364
|
+
|
|
5375
5365
|
const $df5d81d0fe61ff21$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="product-count"><!#><!/> <!#><!/></div>`, 6), $df5d81d0fe61ff21$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div></div>`, 2), $df5d81d0fe61ff21$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="filter-results-for-one-row"><!#><!/><!#><!/></div>`, 6), $df5d81d0fe61ff21$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="depict plp category"><div class="listing-page"><!#><!/><!#><!/><!#><!/><!#><!/><!#><!/><!#><!/></div><!#><!/><!#><!/></div>`, 20);
|
|
5376
5366
|
function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({ depict_api_: depict_api_ , query_id_: query_id_ , listing_type_: listing_type_ , 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_ , 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_ }) {
|
|
5377
5367
|
let results_for;
|
|
@@ -5437,7 +5427,8 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
5437
5427
|
const [results_filters, set_results_filters] = (0, $gco9i$createSignal)();
|
|
5438
5428
|
const [observed_results_filters_elements, set_observed_results_filters_elements_] = (0, $gco9i$createSignal)();
|
|
5439
5429
|
const is_slim_ = (0, $dc9262ef6f786812$export$d9f36cf74e24d595)("(max-width:600px)");
|
|
5440
|
-
|
|
5430
|
+
// @ts-ignore - there's no type error here when writing the code, but parcel can't generate types that include the symbol, so we need to suppress the error that creates in our pipelines
|
|
5431
|
+
const category_title_type = category_title_[0, $4fb3a1cf207a7d5c$export$5c28802497c8a83c];
|
|
5441
5432
|
const extra_sort_and_filter_args_ = {};
|
|
5442
5433
|
const make_product_count_ = ()=>(()=>{
|
|
5443
5434
|
const _el$ = (0, $gco9i$getNextElement)($df5d81d0fe61ff21$var$_tmpl$), _el$3 = _el$.firstChild, [_el$4, _co$] = (0, $gco9i$getNextMarker)(_el$3.nextSibling), _el$2 = _el$4.nextSibling, _el$5 = _el$2.nextSibling, [_el$6, _co$2] = (0, $gco9i$getNextMarker)(_el$5.nextSibling);
|
|
@@ -5543,7 +5534,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
5543
5534
|
selected_filters_: selected_filters_,
|
|
5544
5535
|
available_filters_: available_filters_
|
|
5545
5536
|
});
|
|
5546
|
-
(0, $
|
|
5537
|
+
(0, $e7fce80abe608e01$export$3945d6db2dfd3d12)({
|
|
5547
5538
|
query_id_: query_id_,
|
|
5548
5539
|
crumb_data_: crumb_data_,
|
|
5549
5540
|
i18n_: i18n_,
|
|
@@ -5559,7 +5550,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
5559
5550
|
(0, $gco9i$isServer) ? "<!-- Category page based on Depict SDK -->" : document.createComment("Category page based on Depict SDK"),
|
|
5560
5551
|
(()=>{
|
|
5561
5552
|
const _el$13 = (0, $gco9i$getNextElement)($df5d81d0fe61ff21$var$_tmpl$4), _el$14 = _el$13.firstChild, _el$15 = _el$14.firstChild, [_el$16, _co$5] = (0, $gco9i$getNextMarker)(_el$15.nextSibling), _el$17 = _el$16.nextSibling, [_el$18, _co$6] = (0, $gco9i$getNextMarker)(_el$17.nextSibling), _el$19 = _el$18.nextSibling, [_el$20, _co$7] = (0, $gco9i$getNextMarker)(_el$19.nextSibling), _el$21 = _el$20.nextSibling, [_el$22, _co$8] = (0, $gco9i$getNextMarker)(_el$21.nextSibling), _el$23 = _el$22.nextSibling, [_el$24, _co$9] = (0, $gco9i$getNextMarker)(_el$23.nextSibling), _el$25 = _el$24.nextSibling, [_el$26, _co$10] = (0, $gco9i$getNextMarker)(_el$25.nextSibling), _el$27 = _el$14.nextSibling, [_el$28, _co$11] = (0, $gco9i$getNextMarker)(_el$27.nextSibling), _el$29 = _el$28.nextSibling, [_el$30, _co$12] = (0, $gco9i$getNextMarker)(_el$29.nextSibling);
|
|
5562
|
-
(0, $gco9i$use)((el)=>process.env.NODE_ENV === "development" && (0, $
|
|
5553
|
+
(0, $gco9i$use)((el)=>process.env.NODE_ENV === "development" && (0, $9f5cb586f34c14e6$export$d4fc5c0e68a52116)(el, query_id_, i18n_), _el$13);
|
|
5563
5554
|
(0, $gco9i$insert)(_el$14, (0, $gco9i$createComponent)((0, $gco9i$Show), {
|
|
5564
5555
|
when: show_breadcrumbs_,
|
|
5565
5556
|
get children () {
|
|
@@ -6175,6 +6166,7 @@ function $961b5c64bef4662f$var$get_shared_properties(depict_category) {
|
|
|
6175
6166
|
|
|
6176
6167
|
|
|
6177
6168
|
|
|
6169
|
+
|
|
6178
6170
|
const $e4615ecd1849548f$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="category-title"><h1 class="title"></h1><span class="explanation"> — <!#><!/></span></div>`, 8);
|
|
6179
6171
|
const $e4615ecd1849548f$export$b91cec6bdc6b32a1 = /*@__PURE__*/ (()=>{
|
|
6180
6172
|
const actual_function = ({ category_title_: category_title_ , product_count_: product_count_ })=>{
|
|
@@ -6188,7 +6180,8 @@ const $e4615ecd1849548f$export$b91cec6bdc6b32a1 = /*@__PURE__*/ (()=>{
|
|
|
6188
6180
|
return _el$;
|
|
6189
6181
|
})();
|
|
6190
6182
|
};
|
|
6191
|
-
|
|
6183
|
+
// This is wrong but parcel can't build correctly, it says unexpected undefined
|
|
6184
|
+
actual_function[0, $4fb3a1cf207a7d5c$export$5c28802497c8a83c] = "simple";
|
|
6192
6185
|
return actual_function;
|
|
6193
6186
|
})();
|
|
6194
6187
|
|
|
@@ -6199,8 +6192,9 @@ const $e4615ecd1849548f$export$b91cec6bdc6b32a1 = /*@__PURE__*/ (()=>{
|
|
|
6199
6192
|
|
|
6200
6193
|
|
|
6201
6194
|
|
|
6202
|
-
|
|
6203
|
-
const $
|
|
6195
|
+
|
|
6196
|
+
const $a6e23a834336fc19$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="sort-and-filter-buttons fake" aria-hidden="true" style="position:absolute;z-index:-1;pointer-events:none;opacity:0"><div class="outer"><div class="inner"><!#><!/><!#><!/><!#><!/></div></div></div>`, 12);
|
|
6197
|
+
const $a6e23a834336fc19$export$824dde41348efed1 = /*@__PURE__*/ (()=>{
|
|
6204
6198
|
const actual_function = ({ make_product_count_: make_product_count_ , set_observed_results_filters_elements_: set_observed_results_filters_elements_ , is_slim_: is_slim_ , sort_and_filter_element_: sort_and_filter_element_ , extra_sort_and_filter_args_: extra_sort_and_filter_args_ })=>{
|
|
6205
6199
|
// this does two things: make the sorting and filters button the same width and move the number of products out of the SortAndFilter middle_elements_ if it doesn't fit
|
|
6206
6200
|
let extra_sort_button_;
|
|
@@ -6222,7 +6216,7 @@ const $a79d86d64fb64e8e$export$824dde41348efed1 = /*@__PURE__*/ (()=>{
|
|
|
6222
6216
|
const on_filters_constructed_ = ()=>{
|
|
6223
6217
|
const active_sort_and_filter_element = (0, $gco9i$untrack)(sort_and_filter_element_); // We assume that this doesn't change which it currently doesn't after the filters have been constructed
|
|
6224
6218
|
const extra_sort_and_filter_container_ = (()=>{
|
|
6225
|
-
const _el$ = (0, $gco9i$getNextElement)($
|
|
6219
|
+
const _el$ = (0, $gco9i$getNextElement)($a6e23a834336fc19$var$_tmpl$), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, [_el$5, _co$] = (0, $gco9i$getNextMarker)(_el$4.nextSibling), _el$6 = _el$5.nextSibling, [_el$7, _co$2] = (0, $gco9i$getNextMarker)(_el$6.nextSibling), _el$8 = _el$7.nextSibling, [_el$9, _co$3] = (0, $gco9i$getNextMarker)(_el$8.nextSibling);
|
|
6226
6220
|
(0, $gco9i$insert)(_el$3, extra_filter_button_, _el$5, _co$);
|
|
6227
6221
|
(0, $gco9i$insert)(_el$3, extra_count, _el$7, _co$2);
|
|
6228
6222
|
(0, $gco9i$insert)(_el$3, extra_sort_button_, _el$9, _co$3);
|
|
@@ -6281,15 +6275,15 @@ const $a79d86d64fb64e8e$export$824dde41348efed1 = /*@__PURE__*/ (()=>{
|
|
|
6281
6275
|
on_filters_constructed_: on_filters_constructed_
|
|
6282
6276
|
};
|
|
6283
6277
|
};
|
|
6284
|
-
actual_function[
|
|
6278
|
+
actual_function[0, $4fb3a1cf207a7d5c$export$5c28802497c8a83c] = "interactive";
|
|
6285
6279
|
return actual_function;
|
|
6286
6280
|
})();
|
|
6287
6281
|
|
|
6288
6282
|
|
|
6289
6283
|
|
|
6290
|
-
const $
|
|
6291
|
-
const $
|
|
6292
|
-
async function $
|
|
6284
|
+
const $c9312089e8983364$var$TEN_MINUTES = 600000;
|
|
6285
|
+
const $c9312089e8983364$var$TWENTY_FOUR_HOURS = 86400000;
|
|
6286
|
+
async function $c9312089e8983364$export$643598a327b5833e(tenant, market, type) {
|
|
6293
6287
|
let localstorage_value;
|
|
6294
6288
|
const localstorage_key = `depict_${tenant}_${type ?? "categories"}_` + market;
|
|
6295
6289
|
try {
|
|
@@ -6303,11 +6297,11 @@ async function $5c5f95951393e5d1$export$643598a327b5833e(tenant, market, type) {
|
|
|
6303
6297
|
const stored_queries = localstorage_value?.queries;
|
|
6304
6298
|
if (Array.isArray(stored_queries) && typeof updated === "number") {
|
|
6305
6299
|
const age = now - updated;
|
|
6306
|
-
if (stored_queries.length && age < $
|
|
6300
|
+
if (stored_queries.length && age < $c9312089e8983364$var$TEN_MINUTES) // if younger than 10 minutes and probably valid data, just return stored value
|
|
6307
6301
|
return stored_queries;
|
|
6308
|
-
else if (age < $
|
|
6302
|
+
else if (age < $c9312089e8983364$var$TWENTY_FOUR_HOURS) {
|
|
6309
6303
|
// if younger than a day, return stored value but still trigger re-fetch, so we have fresh data next page load (stale data this one but never a delay)
|
|
6310
|
-
$
|
|
6304
|
+
$c9312089e8983364$var$fetch_and_store_categories(tenant, market, localstorage_key, type).catch((e)=>(0, $gco9i$report)([
|
|
6311
6305
|
e,
|
|
6312
6306
|
"couldn't fetch categories"
|
|
6313
6307
|
], "warning"));
|
|
@@ -6315,10 +6309,10 @@ async function $5c5f95951393e5d1$export$643598a327b5833e(tenant, market, type) {
|
|
|
6315
6309
|
}
|
|
6316
6310
|
// else: we are older and just fetch, store and return new queries
|
|
6317
6311
|
}
|
|
6318
|
-
return await $
|
|
6312
|
+
return await $c9312089e8983364$var$fetch_and_store_categories(tenant, market, localstorage_key, type);
|
|
6319
6313
|
}
|
|
6320
|
-
async function $
|
|
6321
|
-
const new_categories = await $
|
|
6314
|
+
async function $c9312089e8983364$var$fetch_and_store_categories(tenant, market, localstorage_key, type) {
|
|
6315
|
+
const new_categories = await $c9312089e8983364$var$download_categories(tenant, market, type);
|
|
6322
6316
|
try {
|
|
6323
6317
|
localStorage[localstorage_key] = JSON.stringify({
|
|
6324
6318
|
updated: +new Date(),
|
|
@@ -6332,7 +6326,7 @@ async function $5c5f95951393e5d1$var$fetch_and_store_categories(tenant, market,
|
|
|
6332
6326
|
}
|
|
6333
6327
|
return new_categories;
|
|
6334
6328
|
}
|
|
6335
|
-
async function $
|
|
6329
|
+
async function $c9312089e8983364$var$download_categories(tenant, market, type) {
|
|
6336
6330
|
const fetched = await (0, $gco9i$fetch_retry)((0, $gco9i$base_url) + "/v2/product-listing/queries", {
|
|
6337
6331
|
method: "POST",
|
|
6338
6332
|
body: JSON.stringify({
|
|
@@ -9122,4 +9116,4 @@ const $4690a06c8489dcd0$export$7bf543b9d9be2c22 = (0, $e4615ecd1849548f$export$b
|
|
|
9122
9116
|
(0, $gco9i$add_to_version_info)("ui", (0, $ec291e0010116877$export$83d89fbfd8236492));
|
|
9123
9117
|
|
|
9124
9118
|
|
|
9125
|
-
export {$194bd6b8e4c59830$export$79b1565500412d9b as general_modal_abstraction, $19976a74d273070d$export$3b621d86b1566b2 as CrossIcon, $fbbadcb080ad1d4a$export$8be2714ec7f169ee as GenericSliderArrowButton, $c58717f39bf51647$export$58e808b1db15d3bc as fetchDepictRecommendations, $961b5c64bef4662f$export$de035477d6fef996 as QuickLinks, $961b5c64bef4662f$export$5b7c3ce0ebe51f86 as BreadCrumbs, $e4615ecd1849548f$export$b91cec6bdc6b32a1 as CategoryTitle, $
|
|
9119
|
+
export {$194bd6b8e4c59830$export$79b1565500412d9b as general_modal_abstraction, $19976a74d273070d$export$3b621d86b1566b2 as CrossIcon, $fbbadcb080ad1d4a$export$8be2714ec7f169ee as GenericSliderArrowButton, $c58717f39bf51647$export$58e808b1db15d3bc as fetchDepictRecommendations, $961b5c64bef4662f$export$de035477d6fef996 as QuickLinks, $961b5c64bef4662f$export$5b7c3ce0ebe51f86 as BreadCrumbs, $e4615ecd1849548f$export$b91cec6bdc6b32a1 as CategoryTitle, $a6e23a834336fc19$export$824dde41348efed1 as embedded_num_products, $c9312089e8983364$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, $d20eff0aadc28983$export$acb3eaade4b23afd as BasePlaceholder, $d134eae24341b4a1$export$89c6019e4baa40b1 as TextPlaceholder, $7f60f09116a3fe61$export$3f37af283f8fb843 as ImagePlaceholder, $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};
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { SearchRequest, SearchFilter } from "@depict-ai/types/api/SearchRequest"
|
|
|
7
7
|
import { BaseSearchRequest } from "@depict-ai/types/api/BaseSearchRequest";
|
|
8
8
|
import { SearchSuggestionsRequest } from "@depict-ai/types/api/SearchSuggestionsRequest";
|
|
9
9
|
import { ProductListingRequest } from "@depict-ai/types/api/ProductListingRequest";
|
|
10
|
-
export const version = "1.2.
|
|
10
|
+
export const version = "1.2.3";
|
|
11
11
|
type PageURLCreatorAlwaysThereData = {
|
|
12
12
|
merchant: string;
|
|
13
13
|
market: string;
|
|
@@ -26,13 +26,13 @@ export type ModernDisplayWithPageUrl<T extends ModernDisplay> = {
|
|
|
26
26
|
page_url: string;
|
|
27
27
|
})[] : T[K];
|
|
28
28
|
};
|
|
29
|
+
type PageURLCreatorOptions<InputDisplay extends ModernDisplay> = (PageURLCreatorAlwaysThereData & PageURLCreatorCategoryData) | (PageURLCreatorAlwaysThereData & PageURLCreatorProductData<InputDisplay>);
|
|
29
30
|
/**
|
|
30
31
|
* PageUrlCreator is, in its most basic form, a function that takes in a list of categories or products and returns a list of page_urls for the provided categories or products.
|
|
31
32
|
* It's main use case is to allow for the creation of links to the product or category pages on the merchant's site.
|
|
32
33
|
* It can also be used for the depict customers which already have links to change those links (i.e. for staging sites).
|
|
33
34
|
* Also, it can be used to enrich the data for each product card in a batched way, which is why it can be an async function and return a whole display in the case of products.
|
|
34
35
|
*/
|
|
35
|
-
type PageURLCreatorOptions<InputDisplay extends ModernDisplay> = (PageURLCreatorAlwaysThereData & PageURLCreatorCategoryData) | (PageURLCreatorAlwaysThereData & PageURLCreatorProductData<InputDisplay>);
|
|
36
36
|
export type PageURLCreator<InputDisplay extends ModernDisplay, OutputDisplay extends ModernDisplay | never> = (options: PageURLCreatorOptions<InputDisplay>) => (typeof options)["type"] extends "categories" ? CanBePromiseWrapped<{
|
|
37
37
|
page_url: string;
|
|
38
38
|
}[]> : CanBePromiseWrapped<{
|