@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/server/module.js
CHANGED
|
@@ -2,7 +2,7 @@ import {add_to_version_info as $cV3wj$add_to_version_info, observer as $cV3wj$ob
|
|
|
2
2
|
import {createRoot as $cV3wj$createRoot, createSignal as $cV3wj$createSignal, getOwner as $cV3wj$getOwner, runWithOwner as $cV3wj$runWithOwner, onCleanup as $cV3wj$onCleanup, createComputed as $cV3wj$createComputed, createRenderEffect as $cV3wj$createRenderEffect, createEffect as $cV3wj$createEffect, untrack as $cV3wj$untrack, batch as $cV3wj$batch, createResource as $cV3wj$createResource, createMemo as $cV3wj$createMemo, Show as $cV3wj$Show, createReaction as $cV3wj$createReaction, Suspense as $cV3wj$Suspense, on as $cV3wj$on, ErrorBoundary as $cV3wj$ErrorBoundary, For as $cV3wj$For, Index as $cV3wj$Index} from "solid-js";
|
|
3
3
|
import {ssrElement as $cV3wj$ssrElement, ssr as $cV3wj$ssr, ssrHydrationKey as $cV3wj$ssrHydrationKey, ssrAttribute as $cV3wj$ssrAttribute, escape as $cV3wj$escape, isServer as $cV3wj$isServer, createComponent as $cV3wj$createComponent, ssrClassList as $cV3wj$ssrClassList, insert as $cV3wj$insert, ssrStyle as $cV3wj$ssrStyle, Dynamic as $cV3wj$Dynamic, mergeProps as $cV3wj$mergeProps} 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
|
|
|
@@ -274,23 +274,10 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
274
274
|
let resolve_in_progress;
|
|
275
275
|
cache_obj.in_progress_[body] = new Promise((r)=>resolve_in_progress = r);
|
|
276
276
|
try {
|
|
277
|
-
|
|
277
|
+
const api_response = await (0, $cV3wj$fetch_retry)((0, $cV3wj$add_version_query_params)(endpoint1), {
|
|
278
278
|
method: "POST",
|
|
279
279
|
body: body
|
|
280
280
|
});
|
|
281
|
-
if ("query_id" in request && request.type === "collection") // FIXME: Remove. Backwards compatibility layer
|
|
282
|
-
// This will retry the request without the collection type if the first request fails
|
|
283
|
-
{
|
|
284
|
-
if (!api_response || api_response?.status === 404) {
|
|
285
|
-
(0, $cV3wj$dlog)("Fallback request for collections due to failure");
|
|
286
|
-
const fallback_body = JSON.parse(body);
|
|
287
|
-
delete fallback_body.type;
|
|
288
|
-
api_response = await (0, $cV3wj$fetch_retry)((0, $cV3wj$add_version_query_params)(endpoint1), {
|
|
289
|
-
method: "POST",
|
|
290
|
-
body: JSON.stringify(fallback_body)
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
281
|
return_successfully: {
|
|
295
282
|
if (!api_response || api_response.status !== 200) break return_successfully;
|
|
296
283
|
let result;
|
|
@@ -1811,10 +1798,10 @@ function $eb8d9bf3b5700c26$export$430444115f70a734({ selected_filters_: selected
|
|
|
1811
1798
|
const random_selector = (0, $cV3wj$make_random_classname)();
|
|
1812
1799
|
const count = (0, $cV3wj$createMemo)(()=>filter_().meta.counts?.[index]);
|
|
1813
1800
|
return (0, $cV3wj$ssr)($eb8d9bf3b5700c26$var$_tmpl$3, (0, $cV3wj$ssrHydrationKey)(), `input-row ${count() === 0 ? "count-0" : ""}`, (0, $cV3wj$ssrAttribute)("for", (0, $cV3wj$escape)(random_selector, true), false), (0, $cV3wj$ssrAttribute)("id", (0, $cV3wj$escape)(random_selector, true), false) + (0, $cV3wj$ssrAttribute)("name", (0, $cV3wj$escape)(radio_name, true), false), (0, $cV3wj$ssrAttribute)("checked", (0, $cV3wj$createMemo)(()=>{
|
|
1801
|
+
const v = value();
|
|
1814
1802
|
const data = existing_filter()?.data;
|
|
1815
|
-
if (data ===
|
|
1816
|
-
|
|
1817
|
-
return false;
|
|
1803
|
+
if (data === v) return true;
|
|
1804
|
+
return Array.isArray(data) && data.every((item, index)=>item === v[index]);
|
|
1818
1805
|
})(), true), (0, $cV3wj$escape)((0, $cV3wj$createMemo)(()=>{
|
|
1819
1806
|
const name = filter_().meta?.names?.[index];
|
|
1820
1807
|
if (name) return name;
|
|
@@ -4565,9 +4552,9 @@ function $e9342fb3ac73a54a$export$8895d39404bd2bb1(props) {
|
|
|
4565
4552
|
}
|
|
4566
4553
|
|
|
4567
4554
|
|
|
4568
|
-
function $
|
|
4555
|
+
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_ }) {
|
|
4569
4556
|
// If we just got opened in a new tab, clear filters instantly and remove the flag
|
|
4570
|
-
$
|
|
4557
|
+
$e7fce80abe608e01$var$clear_if_opened_new_tab_with_sideways_url_params_flag({
|
|
4571
4558
|
plp_results_: plp_results_,
|
|
4572
4559
|
local_filter_cache_: local_filter_cache_,
|
|
4573
4560
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
@@ -4611,7 +4598,7 @@ function $a1c4da51ff91dd01$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ ,
|
|
|
4611
4598
|
if (!allow_filter_clearing) allow_filter_clearing = true;
|
|
4612
4599
|
})));
|
|
4613
4600
|
}
|
|
4614
|
-
function $
|
|
4601
|
+
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_] }) {
|
|
4615
4602
|
const tracking_function_for_plp_results = (0, $cV3wj$createReaction)(()=>{
|
|
4616
4603
|
// 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
|
|
4617
4604
|
if (!(0, $cV3wj$untrack)(get_sideways_filter_clearing_flag_)) return;
|
|
@@ -4635,6 +4622,9 @@ function $a1c4da51ff91dd01$var$clear_if_opened_new_tab_with_sideways_url_params_
|
|
|
4635
4622
|
|
|
4636
4623
|
|
|
4637
4624
|
|
|
4625
|
+
const $4fb3a1cf207a7d5c$export$5c28802497c8a83c = /*@__PURE__*/ Symbol("category_title_type");
|
|
4626
|
+
|
|
4627
|
+
|
|
4638
4628
|
const $df5d81d0fe61ff21$var$_tmpl$ = [
|
|
4639
4629
|
"<div",
|
|
4640
4630
|
' class="product-count"><!--#-->',
|
|
@@ -4724,7 +4714,8 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
4724
4714
|
const [results_filters, set_results_filters] = (0, $cV3wj$createSignal)();
|
|
4725
4715
|
const [observed_results_filters_elements, set_observed_results_filters_elements_] = (0, $cV3wj$createSignal)();
|
|
4726
4716
|
const is_slim_ = (0, $dc9262ef6f786812$export$d9f36cf74e24d595)("(max-width:600px)");
|
|
4727
|
-
|
|
4717
|
+
// @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
|
|
4718
|
+
const category_title_type = category_title_[0, $4fb3a1cf207a7d5c$export$5c28802497c8a83c];
|
|
4728
4719
|
const extra_sort_and_filter_args_ = {};
|
|
4729
4720
|
const make_product_count_ = ()=>(0, $cV3wj$ssr)($df5d81d0fe61ff21$var$_tmpl$, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$escape)((0, $cV3wj$createComponent)((0, $cV3wj$Show), {
|
|
4730
4721
|
get when () {
|
|
@@ -4820,7 +4811,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
4820
4811
|
selected_filters_: selected_filters_,
|
|
4821
4812
|
available_filters_: available_filters_
|
|
4822
4813
|
});
|
|
4823
|
-
(0, $
|
|
4814
|
+
(0, $e7fce80abe608e01$export$3945d6db2dfd3d12)({
|
|
4824
4815
|
query_id_: query_id_,
|
|
4825
4816
|
crumb_data_: crumb_data_,
|
|
4826
4817
|
i18n_: i18n_,
|
|
@@ -5437,6 +5428,7 @@ function $961b5c64bef4662f$var$get_shared_properties(depict_category) {
|
|
|
5437
5428
|
|
|
5438
5429
|
|
|
5439
5430
|
|
|
5431
|
+
|
|
5440
5432
|
const $e4615ecd1849548f$var$_tmpl$ = [
|
|
5441
5433
|
"<div",
|
|
5442
5434
|
' class="category-title"><h1 class="title">',
|
|
@@ -5450,7 +5442,8 @@ const $e4615ecd1849548f$export$b91cec6bdc6b32a1 = /*@__PURE__*/ (()=>{
|
|
|
5450
5442
|
width: "10ch"
|
|
5451
5443
|
})), (0, $cV3wj$escape)(product_count_));
|
|
5452
5444
|
};
|
|
5453
|
-
|
|
5445
|
+
// This is wrong but parcel can't build correctly, it says unexpected undefined
|
|
5446
|
+
actual_function[0, $4fb3a1cf207a7d5c$export$5c28802497c8a83c] = "simple";
|
|
5454
5447
|
return actual_function;
|
|
5455
5448
|
})();
|
|
5456
5449
|
|
|
@@ -5460,14 +5453,15 @@ const $e4615ecd1849548f$export$b91cec6bdc6b32a1 = /*@__PURE__*/ (()=>{
|
|
|
5460
5453
|
|
|
5461
5454
|
|
|
5462
5455
|
|
|
5463
|
-
|
|
5456
|
+
|
|
5457
|
+
const $a6e23a834336fc19$var$_tmpl$ = [
|
|
5464
5458
|
"<div",
|
|
5465
5459
|
' 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"><!--#-->',
|
|
5466
5460
|
"<!--/--><!--#-->",
|
|
5467
5461
|
"<!--/--><!--#-->",
|
|
5468
5462
|
"<!--/--></div></div></div>"
|
|
5469
5463
|
];
|
|
5470
|
-
const $
|
|
5464
|
+
const $a6e23a834336fc19$export$824dde41348efed1 = /*@__PURE__*/ (()=>{
|
|
5471
5465
|
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_ })=>{
|
|
5472
5466
|
// 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
|
|
5473
5467
|
let extra_sort_button_;
|
|
@@ -5488,7 +5482,7 @@ const $a79d86d64fb64e8e$export$824dde41348efed1 = /*@__PURE__*/ (()=>{
|
|
|
5488
5482
|
extra_sort_and_filter_args_.sort_button_width_ = sort_button_width_;
|
|
5489
5483
|
const on_filters_constructed_ = ()=>{
|
|
5490
5484
|
const active_sort_and_filter_element = (0, $cV3wj$untrack)(sort_and_filter_element_); // We assume that this doesn't change which it currently doesn't after the filters have been constructed
|
|
5491
|
-
const extra_sort_and_filter_container_ = (0, $cV3wj$ssr)($
|
|
5485
|
+
const extra_sort_and_filter_container_ = (0, $cV3wj$ssr)($a6e23a834336fc19$var$_tmpl$, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$escape)(extra_filter_button_), (0, $cV3wj$escape)(extra_count), (0, $cV3wj$escape)(extra_sort_button_));
|
|
5492
5486
|
set_observed_results_filters_elements_(extra_sort_and_filter_container_);
|
|
5493
5487
|
const [total_available_width, set_total_available_width] = (0, $cV3wj$createSignal)();
|
|
5494
5488
|
const [filter_button_required_width, set_filter_button_required_width] = (0, $cV3wj$createSignal)();
|
|
@@ -5542,15 +5536,15 @@ const $a79d86d64fb64e8e$export$824dde41348efed1 = /*@__PURE__*/ (()=>{
|
|
|
5542
5536
|
on_filters_constructed_: on_filters_constructed_
|
|
5543
5537
|
};
|
|
5544
5538
|
};
|
|
5545
|
-
actual_function[
|
|
5539
|
+
actual_function[0, $4fb3a1cf207a7d5c$export$5c28802497c8a83c] = "interactive";
|
|
5546
5540
|
return actual_function;
|
|
5547
5541
|
})();
|
|
5548
5542
|
|
|
5549
5543
|
|
|
5550
5544
|
|
|
5551
|
-
const $
|
|
5552
|
-
const $
|
|
5553
|
-
async function $
|
|
5545
|
+
const $c9312089e8983364$var$TEN_MINUTES = 600000;
|
|
5546
|
+
const $c9312089e8983364$var$TWENTY_FOUR_HOURS = 86400000;
|
|
5547
|
+
async function $c9312089e8983364$export$643598a327b5833e(tenant, market, type) {
|
|
5554
5548
|
let localstorage_value;
|
|
5555
5549
|
const localstorage_key = `depict_${tenant}_${type ?? "categories"}_` + market;
|
|
5556
5550
|
try {
|
|
@@ -5564,11 +5558,11 @@ async function $5c5f95951393e5d1$export$643598a327b5833e(tenant, market, type) {
|
|
|
5564
5558
|
const stored_queries = localstorage_value?.queries;
|
|
5565
5559
|
if (Array.isArray(stored_queries) && typeof updated === "number") {
|
|
5566
5560
|
const age = now - updated;
|
|
5567
|
-
if (stored_queries.length && age < $
|
|
5561
|
+
if (stored_queries.length && age < $c9312089e8983364$var$TEN_MINUTES) // if younger than 10 minutes and probably valid data, just return stored value
|
|
5568
5562
|
return stored_queries;
|
|
5569
|
-
else if (age < $
|
|
5563
|
+
else if (age < $c9312089e8983364$var$TWENTY_FOUR_HOURS) {
|
|
5570
5564
|
// 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)
|
|
5571
|
-
$
|
|
5565
|
+
$c9312089e8983364$var$fetch_and_store_categories(tenant, market, localstorage_key, type).catch((e)=>(0, $cV3wj$report)([
|
|
5572
5566
|
e,
|
|
5573
5567
|
"couldn't fetch categories"
|
|
5574
5568
|
], "warning"));
|
|
@@ -5576,10 +5570,10 @@ async function $5c5f95951393e5d1$export$643598a327b5833e(tenant, market, type) {
|
|
|
5576
5570
|
}
|
|
5577
5571
|
// else: we are older and just fetch, store and return new queries
|
|
5578
5572
|
}
|
|
5579
|
-
return await $
|
|
5573
|
+
return await $c9312089e8983364$var$fetch_and_store_categories(tenant, market, localstorage_key, type);
|
|
5580
5574
|
}
|
|
5581
|
-
async function $
|
|
5582
|
-
const new_categories = await $
|
|
5575
|
+
async function $c9312089e8983364$var$fetch_and_store_categories(tenant, market, localstorage_key, type) {
|
|
5576
|
+
const new_categories = await $c9312089e8983364$var$download_categories(tenant, market, type);
|
|
5583
5577
|
try {
|
|
5584
5578
|
localStorage[localstorage_key] = JSON.stringify({
|
|
5585
5579
|
updated: +new Date(),
|
|
@@ -5593,7 +5587,7 @@ async function $5c5f95951393e5d1$var$fetch_and_store_categories(tenant, market,
|
|
|
5593
5587
|
}
|
|
5594
5588
|
return new_categories;
|
|
5595
5589
|
}
|
|
5596
|
-
async function $
|
|
5590
|
+
async function $c9312089e8983364$var$download_categories(tenant, market, type) {
|
|
5597
5591
|
const fetched = await (0, $cV3wj$fetch_retry)((0, $cV3wj$base_url) + "/v2/product-listing/queries", {
|
|
5598
5592
|
method: "POST",
|
|
5599
5593
|
body: JSON.stringify({
|
|
@@ -8117,4 +8111,4 @@ const $4690a06c8489dcd0$export$7bf543b9d9be2c22 = (0, $e4615ecd1849548f$export$b
|
|
|
8117
8111
|
(0, $cV3wj$add_to_version_info)("ui", (0, $ec291e0010116877$export$83d89fbfd8236492));
|
|
8118
8112
|
|
|
8119
8113
|
|
|
8120
|
-
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, $
|
|
8114
|
+
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};
|