@depict-ai/ui 1.0.16 → 1.0.18
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.js +79 -89
- package/dist/client/module.js +80 -90
- package/dist/index.d.ts +8 -2
- package/dist/main.js +8605 -0
- package/dist/module.js +8571 -0
- package/dist/server/main.js +54 -66
- package/dist/server/module.js +54 -66
- package/package.json +4 -4
package/dist/server/module.js
CHANGED
|
@@ -2,7 +2,7 @@ import {add_to_version_info as $cV3wj$add_to_version_info, fetch_recs as $cV3wj$
|
|
|
2
2
|
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";
|
|
3
3
|
import {createSignal as $cV3wj$createSignal, getOwner as $cV3wj$getOwner, createRoot as $cV3wj$createRoot, 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";
|
|
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.18";
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
@@ -501,6 +501,7 @@ const $598245ecfe38f34b$var$_tmpl$ = [
|
|
|
501
501
|
"<!--/--></div>"
|
|
502
502
|
];
|
|
503
503
|
function $598245ecfe38f34b$export$ef6006467f04ee41({ i18n_: i18n_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , selected_filters_: selected_filters_ , local_filter_cache_: local_filter_cache_ }) {
|
|
504
|
+
const root = (0, $cV3wj$getOwner)();
|
|
504
505
|
return [
|
|
505
506
|
(0, $cV3wj$ssr)($598245ecfe38f34b$var$_tmpl$2, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$escape)(i18n_.no_results_text_()), (0, $cV3wj$escape)((0, $cV3wj$createComponent)((0, $cV3wj$Show), {
|
|
506
507
|
get when () {
|
|
@@ -588,11 +589,20 @@ function $a52235d12ccf9c88$var$unwrapping_helper(elements) {
|
|
|
588
589
|
}
|
|
589
590
|
|
|
590
591
|
|
|
592
|
+
|
|
591
593
|
let $6e41f1fde994db72$var$cached_placeholder_element;
|
|
592
594
|
let $6e41f1fde994db72$var$rendering_cached_placeholder_element;
|
|
593
595
|
function $6e41f1fde994db72$export$f33414a4df0afd3f({ product_card_template_: product_card_template_ , num_placeholders_: num_placeholders_ }) {
|
|
594
596
|
const [get_elements, set_elements] = (0, $cV3wj$createSignal)([]);
|
|
595
597
|
let existing_num = 0;
|
|
598
|
+
if (0, $cV3wj$isServer) // want to render simple placeholders on server, effects don't run there
|
|
599
|
+
return (0, $cV3wj$createMemo)(()=>Array.from({
|
|
600
|
+
length: num_placeholders_()
|
|
601
|
+
}).map(()=>{
|
|
602
|
+
const template_result = product_card_template_(null, undefined);
|
|
603
|
+
// @ts-ignore
|
|
604
|
+
if (typeof template_result?.then !== "function") return template_result;
|
|
605
|
+
}));
|
|
596
606
|
(0, $cV3wj$createRenderEffect)(()=>{
|
|
597
607
|
const to_add = num_placeholders_() - existing_num;
|
|
598
608
|
if (to_add <= 0) return;
|
|
@@ -785,22 +795,17 @@ function $29ec7cddbe1d3484$export$43f0fb951fcb0c54({ displays_by_key_: displays_
|
|
|
785
795
|
];
|
|
786
796
|
},
|
|
787
797
|
children: (product_id, index)=>{
|
|
788
|
-
// We're using `untrack` here since we don't want to react in here to displays_by_key changing
|
|
789
|
-
// As long as our key stays the same we assume that the display hasn't changed, so we don't want to rerender
|
|
790
|
-
// If the key gets removed, <For> will remove us
|
|
791
798
|
const owner = (0, $cV3wj$getOwner)();
|
|
792
799
|
const display_accessor = (0, $cV3wj$createMemo)(()=>displays_by_key_().get(product_id));
|
|
793
|
-
const [product_card_resource] = (0, $cV3wj$createResource)(
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
]), // re-render when merchant or market changes
|
|
797
|
-
([merchant, market])=>{
|
|
800
|
+
const [product_card_resource] = (0, $cV3wj$createResource)(display_accessor, // re-render when the reference to the display object changes
|
|
801
|
+
// this should only be the case when the merchant or market changes and the new request has completed
|
|
802
|
+
(display)=>{
|
|
798
803
|
// get display in the function that re-runs when merchant or market have changed, since the display may have changed but product_id not
|
|
799
|
-
const display = (0, $cV3wj$untrack)(display_accessor);
|
|
800
804
|
return product_card_template_(display, {
|
|
801
805
|
set_on_index_change: (fn)=>(0, $cV3wj$runWithOwner)(owner, ()=>(0, $cV3wj$createEffect)(()=>fn(index()))),
|
|
802
|
-
merchant:
|
|
803
|
-
market
|
|
806
|
+
merchant: (0, $cV3wj$untrack)(merchant_),
|
|
807
|
+
// this means that the merchant and market provided to the template is wrong while we do another fetch, but I don't see how anyone would need to know the correct market there
|
|
808
|
+
market: (0, $cV3wj$untrack)(market_)
|
|
804
809
|
});
|
|
805
810
|
});
|
|
806
811
|
const node_accessor = (0, $a52235d12ccf9c88$export$2f0cbfbb4354bb52)(product_card_resource);
|
|
@@ -956,7 +961,7 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
956
961
|
const random_id = (0, $cV3wj$make_random_classname)();
|
|
957
962
|
const selector_beginning_ = `.depict.plp #${random_id}>`;
|
|
958
963
|
const [get_styling, set_styling_] = (0, $cV3wj$createSignal)("");
|
|
959
|
-
const [get_should_have_placeholders_rendered, set_should_have_placeholders_rendered] = (0, $cV3wj$createSignal)(
|
|
964
|
+
const [get_should_have_placeholders_rendered, set_should_have_placeholders_rendered] = (0, $cV3wj$createSignal)(true);
|
|
960
965
|
const rendered_placeholders = (0, $cV3wj$createMemo)(()=>get_should_have_placeholders_rendered() ? (0, $6e41f1fde994db72$export$f33414a4df0afd3f)({
|
|
961
966
|
product_card_template_: product_card_template_,
|
|
962
967
|
num_placeholders_: (0, $cV3wj$createMemo)(()=>{
|
|
@@ -1194,25 +1199,21 @@ function $6bb0a0c563dff4bb$export$e13dddbb31c3a42f() {
|
|
|
1194
1199
|
|
|
1195
1200
|
|
|
1196
1201
|
|
|
1202
|
+
|
|
1203
|
+
|
|
1197
1204
|
const $f32e14878e75af51$var$_tmpl$ = [
|
|
1198
|
-
"<div",
|
|
1199
|
-
' class="depict-slider depict"><div class="sliding ">',
|
|
1200
|
-
"</div></div>"
|
|
1201
|
-
], $f32e14878e75af51$var$_tmpl$2 = [
|
|
1202
1205
|
"<div",
|
|
1203
1206
|
">",
|
|
1204
1207
|
"</div>"
|
|
1205
1208
|
];
|
|
1206
|
-
function $f32e14878e75af51$export$6649caad96ef8870({ children: children ,
|
|
1207
|
-
// TODO: Actual SSR:able slider
|
|
1208
|
-
if (0, $cV3wj$isServer) return (0, $cV3wj$ssr)($f32e14878e75af51$var$_tmpl$, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$escape)(children));
|
|
1209
|
+
function $f32e14878e75af51$export$6649caad96ef8870({ children: children , slider_ref_: slider_ref_ , faded_opacity_: faded_opacity_ = 0.7 , mutation_plugins_: mutation_plugins_ = [] }) {
|
|
1209
1210
|
const slider = new (0, $cV3wj$Amazing_Slider)({
|
|
1210
1211
|
button_contents: {
|
|
1211
1212
|
left: [
|
|
1212
|
-
(0, $cV3wj$ssr)($f32e14878e75af51$var$_tmpl
|
|
1213
|
+
(0, $cV3wj$ssr)($f32e14878e75af51$var$_tmpl$, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$escape)((0, $cV3wj$createComponent)((0, $fbbadcb080ad1d4a$export$8be2714ec7f169ee), {})))
|
|
1213
1214
|
],
|
|
1214
1215
|
right: [
|
|
1215
|
-
(0, $cV3wj$ssr)($f32e14878e75af51$var$_tmpl
|
|
1216
|
+
(0, $cV3wj$ssr)($f32e14878e75af51$var$_tmpl$, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$escape)((0, $cV3wj$createComponent)((0, $fbbadcb080ad1d4a$export$8be2714ec7f169ee), {})))
|
|
1216
1217
|
]
|
|
1217
1218
|
},
|
|
1218
1219
|
constructor_plugins: [
|
|
@@ -1259,7 +1260,7 @@ const $1adfe60f3a14a1d7$var$_tmpl$ = [
|
|
|
1259
1260
|
"<!--/--><span>",
|
|
1260
1261
|
"</span></button>"
|
|
1261
1262
|
];
|
|
1262
|
-
function $1adfe60f3a14a1d7$export$fecbb157621501bd({ number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_ , i18n_: i18n_ , selected_filters_: selected_filters_ , local_filter_cache_: [read_local_filter_cache] , search_filters_open_: [read_search_filters_open] , search_sorting_open_: [read_search_sorting_open] ,
|
|
1263
|
+
function $1adfe60f3a14a1d7$export$fecbb157621501bd({ number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_ , i18n_: i18n_ , selected_filters_: selected_filters_ , local_filter_cache_: [read_local_filter_cache] , search_filters_open_: [read_search_filters_open] , search_sorting_open_: [read_search_sorting_open] , local_filter_cache_: local_filter_cache_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ }) {
|
|
1263
1264
|
const { price_formatting_: price_formatting_ } = i18n_;
|
|
1264
1265
|
const [read_selected_filters, write_selected_filters] = selected_filters_;
|
|
1265
1266
|
const { collapse: collapse , expand: expand , ExpandingContainer: ExpandingContainer } = (0, $24e27fab9c821b86$export$5bad61ecde080b1f)({
|
|
@@ -1274,7 +1275,6 @@ function $1adfe60f3a14a1d7$export$fecbb157621501bd({ number_of_rendered_selected
|
|
|
1274
1275
|
},
|
|
1275
1276
|
get children () {
|
|
1276
1277
|
return (0, $cV3wj$ssr)($1adfe60f3a14a1d7$var$_tmpl$2, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$escape)(i18n_.selected_filters_title_()), (0, $cV3wj$escape)((0, $cV3wj$createComponent)((0, $f32e14878e75af51$export$6649caad96ef8870), {
|
|
1277
|
-
button_: slider_arrow_button_,
|
|
1278
1278
|
slider_ref_: (slider)=>slider.container.classList.add("filter-crumbs"),
|
|
1279
1279
|
get children () {
|
|
1280
1280
|
return [
|
|
@@ -3460,6 +3460,7 @@ function $11d594c749b76228$export$cb808a3c41736d8e() {
|
|
|
3460
3460
|
|
|
3461
3461
|
|
|
3462
3462
|
|
|
3463
|
+
|
|
3463
3464
|
const $cdea4cf8c5c071ef$var$_tmpl$ = [
|
|
3464
3465
|
"<div",
|
|
3465
3466
|
' class="filters"><div class="body">',
|
|
@@ -3618,7 +3619,7 @@ function $cdea4cf8c5c071ef$var$OpenFiltersButton({ i18n_: i18n_ , search_filters
|
|
|
3618
3619
|
get children () {
|
|
3619
3620
|
return (0, $cV3wj$ssr)($cdea4cf8c5c071ef$var$_tmpl$4, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$ssrStyle)(filters_closed() ? `` : `opacity:0`), (0, $cV3wj$escape)(num_selected_filters()));
|
|
3620
3621
|
}
|
|
3621
|
-
})), (0, $cV3wj$ssrAttribute)("tabindex", (0, $cV3wj$escape)(tabindex_, true), false), `${!filters_closed() ? "major" : ""} ${filters_closed() ? "minor" : ""}${"filter toggle-button major-minor-transition"}`, (0, $cV3wj$ssrAttribute)("aria-label", (0, $cV3wj$escape)((filters_closed() ? i18n_.open_filters_ : i18n_.close_filters_)(), true), false), (0, $cV3wj$ssrStyle)(filter_button_width_?.() ? {
|
|
3622
|
+
})), (0, $cV3wj$ssrAttribute)("tabindex", (0, $cV3wj$escape)(tabindex_, true), false), `${!filters_closed() ? "major" : ""} ${filters_closed() ? "minor" : ""}${"filter toggle-button major-minor-transition" + ((0, $cV3wj$isServer) ? " minor" : "")}`, (0, $cV3wj$ssrAttribute)("aria-label", (0, $cV3wj$escape)((filters_closed() ? i18n_.open_filters_ : i18n_.close_filters_)(), true), false), (0, $cV3wj$ssrStyle)(filter_button_width_?.() ? {
|
|
3622
3623
|
width: filter_button_width_() + "px"
|
|
3623
3624
|
} : {}), (0, $cV3wj$escape)((0, $cV3wj$createComponent)((0, $cV3wj$Show), {
|
|
3624
3625
|
get when () {
|
|
@@ -4124,7 +4125,7 @@ const $06edf3aec9073663$var$_tmpl$ = [
|
|
|
4124
4125
|
">",
|
|
4125
4126
|
"</a>"
|
|
4126
4127
|
];
|
|
4127
|
-
function $06edf3aec9073663$export$466cdc317043f6cb({ quicklinks_data_: quicklinks_data_ , router_: router_ , current_query_id_: current_query_id_ ,
|
|
4128
|
+
function $06edf3aec9073663$export$466cdc317043f6cb({ quicklinks_data_: quicklinks_data_ , router_: router_ , current_query_id_: current_query_id_ , breadcrumb_data_: breadcrumb_data_ , i18n_: i18n_ }) {
|
|
4128
4129
|
let scrolling_logic_ran_for_query_id = false;
|
|
4129
4130
|
let last_scroll_position;
|
|
4130
4131
|
let scroll_to_element_on_dom_insertion;
|
|
@@ -4180,7 +4181,6 @@ function $06edf3aec9073663$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
4180
4181
|
get children () {
|
|
4181
4182
|
return (0, $cV3wj$ssr)($06edf3aec9073663$var$_tmpl$, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$ssrAttribute)("aria-label", (0, $cV3wj$escape)(i18n_.quicklinks_aria_label_(), true), false), (0, $cV3wj$escape)((0, $cV3wj$createComponent)((0, $f32e14878e75af51$export$6649caad96ef8870), {
|
|
4182
4183
|
faded_opacity_: 0.5,
|
|
4183
|
-
button_: slider_arrow_button_,
|
|
4184
4184
|
mutation_plugins_: mutation_plugins,
|
|
4185
4185
|
slider_ref_: (slider)=>{
|
|
4186
4186
|
const { insert_here: insert_here , intersecting_items_object: intersecting_items_object } = slider;
|
|
@@ -4553,7 +4553,7 @@ const $df5d81d0fe61ff21$var$_tmpl$ = [
|
|
|
4553
4553
|
"<!--/--><!--#-->",
|
|
4554
4554
|
"<!--/--></div>"
|
|
4555
4555
|
];
|
|
4556
|
-
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_ ,
|
|
4556
|
+
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_ , 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_ }) {
|
|
4557
4557
|
let results_for;
|
|
4558
4558
|
let only_show_filters_opener_;
|
|
4559
4559
|
let middle_elements_;
|
|
@@ -4700,12 +4700,13 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
4700
4700
|
(0, $cV3wj$createRenderEffect)((0, $cV3wj$catchify)(async ()=>{
|
|
4701
4701
|
const slim = is_slim_();
|
|
4702
4702
|
const only_show_filters_opener = only_show_filters_opener_?.();
|
|
4703
|
+
const owner = (0, $cV3wj$getOwner)();
|
|
4703
4704
|
await set_results_filters(); // remove elements, wait one microtask for updates to have been committed to the DOM, otherwise we'd try to do illegal DOM operations
|
|
4704
4705
|
// signals can't be read reactively anymore after the await FYI
|
|
4705
|
-
set_results_filters(slim ? only_show_filters_opener ? filters_opener : [
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4706
|
+
(0, $cV3wj$runWithOwner)(owner, ()=>set_results_filters(slim ? only_show_filters_opener ? filters_opener : [
|
|
4707
|
+
results_for,
|
|
4708
|
+
filters_opener
|
|
4709
|
+
] : (0, $cV3wj$ssr)($df5d81d0fe61ff21$var$_tmpl$3, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$escape)(results_for), (0, $cV3wj$escape)(filters_opener))));
|
|
4709
4710
|
}));
|
|
4710
4711
|
(0, $fc5a12f3a857ca30$export$e702733a056c40d6)({
|
|
4711
4712
|
selected_filters_: selected_filters_,
|
|
@@ -4741,7 +4742,6 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
4741
4742
|
quicklinks_data_: quicklinks_data_,
|
|
4742
4743
|
current_query_id_: query_id_,
|
|
4743
4744
|
router_: router_,
|
|
4744
|
-
slider_arrow_button_: slider_arrow_button_,
|
|
4745
4745
|
breadcrumb_data_: crumb_data_,
|
|
4746
4746
|
i18n_: i18n_
|
|
4747
4747
|
});
|
|
@@ -4759,7 +4759,6 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
4759
4759
|
i18n_: i18n_,
|
|
4760
4760
|
selected_filters_: selected_filters_,
|
|
4761
4761
|
local_filter_cache_: local_filter_cache_,
|
|
4762
|
-
slider_arrow_button_: slider_arrow_button_,
|
|
4763
4762
|
search_filters_open_: category_filters_open_,
|
|
4764
4763
|
search_sorting_open_: category_sorting_open_,
|
|
4765
4764
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
@@ -5154,7 +5153,6 @@ class $4fd2ba03703a7d92$export$7e1297a3a19f10d8 {
|
|
|
5154
5153
|
|
|
5155
5154
|
|
|
5156
5155
|
|
|
5157
|
-
|
|
5158
5156
|
const $961b5c64bef4662f$var$_tmpl$ = [
|
|
5159
5157
|
"<div",
|
|
5160
5158
|
' class="depict plp category">',
|
|
@@ -5234,11 +5232,7 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
5234
5232
|
router_: this.#router,
|
|
5235
5233
|
selected_filters_: selected_filters_,
|
|
5236
5234
|
current_sorting_: current_sorting_,
|
|
5237
|
-
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
5238
|
-
slider_arrow_button_: (0, $fbbadcb080ad1d4a$export$8be2714ec7f169ee)({
|
|
5239
|
-
height_: 12,
|
|
5240
|
-
width_: 6.46
|
|
5241
|
-
})
|
|
5235
|
+
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
5242
5236
|
});
|
|
5243
5237
|
});
|
|
5244
5238
|
}
|
|
@@ -5252,7 +5246,7 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e({ depict_category: depict_cat
|
|
|
5252
5246
|
grid_spacing: grid_spacing.horizontal
|
|
5253
5247
|
};
|
|
5254
5248
|
return (0, $16b52438165aafe2$export$23fca46f3143581f)(()=>{
|
|
5255
|
-
const { state_: { category_local_filter_cache: local_filter_cache_ , category_filters_open: category_filters_open_ , category_sorting_open: category_sorting_open_ , category_expanded_filters: expanded_filters_ , category_expanded_hierarchical_filters: expanded_hierarchical_filters_ , category_scroll_restoration_data: scroll_restoration_data_ } , current_sorting_: current_sorting_ , selected_filters_: selected_filters_ , reset_history_state_: reset_history_state_ , depict_api_: depict_api_ , i18n_: i18n_ , router_: router_ , breadcrumb_signal_: breadcrumb_signal_ , quicklinks_signal_: quicklinks_signal_ ,
|
|
5249
|
+
const { state_: { category_local_filter_cache: local_filter_cache_ , category_filters_open: category_filters_open_ , category_sorting_open: category_sorting_open_ , category_expanded_filters: expanded_filters_ , category_expanded_hierarchical_filters: expanded_hierarchical_filters_ , category_scroll_restoration_data: scroll_restoration_data_ } , current_sorting_: current_sorting_ , selected_filters_: selected_filters_ , reset_history_state_: reset_history_state_ , depict_api_: depict_api_ , i18n_: i18n_ , router_: router_ , breadcrumb_signal_: breadcrumb_signal_ , quicklinks_signal_: quicklinks_signal_ , sideways_filter_clearing_flag_: sideways_filter_clearing_flag_ } = shared_properties;
|
|
5256
5250
|
(0, $cV3wj$onCleanup)(reset_history_state_);
|
|
5257
5251
|
return (0, $df5d81d0fe61ff21$export$f7d2f673fc2f091d)({
|
|
5258
5252
|
tenant_: ()=>depict_category.merchant,
|
|
@@ -5271,7 +5265,6 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e({ depict_category: depict_cat
|
|
|
5271
5265
|
get_quicklinks_accessor_: (accessor)=>(0, $cV3wj$createComputed)(()=>quicklinks_signal_[1](accessor())),
|
|
5272
5266
|
category_filters_open_: category_filters_open_,
|
|
5273
5267
|
category_sorting_open_: category_sorting_open_,
|
|
5274
|
-
slider_arrow_button_: slider_arrow_button_,
|
|
5275
5268
|
expanded_filters_: expanded_filters_,
|
|
5276
5269
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
5277
5270
|
selected_filters_: selected_filters_,
|
|
@@ -5298,7 +5291,7 @@ function $961b5c64bef4662f$export$5b7c3ce0ebe51f86({ depict_category: depict_cat
|
|
|
5298
5291
|
});
|
|
5299
5292
|
}
|
|
5300
5293
|
function $961b5c64bef4662f$export$de035477d6fef996({ depict_category: depict_category }) {
|
|
5301
|
-
const { i18n_: i18n_ , quicklinks_signal_: [quicklinks_data_] , breadcrumb_signal_: [breadcrumb_data_] , router_: router_
|
|
5294
|
+
const { i18n_: i18n_ , quicklinks_signal_: [quicklinks_data_] , breadcrumb_signal_: [breadcrumb_data_] , router_: router_ } = $961b5c64bef4662f$var$get_shared_properties(depict_category);
|
|
5302
5295
|
return (0, $cV3wj$createComponent)($961b5c64bef4662f$var$InExternalAreaDiv, {
|
|
5303
5296
|
get children () {
|
|
5304
5297
|
return (0, $06edf3aec9073663$export$466cdc317043f6cb)({
|
|
@@ -5306,7 +5299,6 @@ function $961b5c64bef4662f$export$de035477d6fef996({ depict_category: depict_cat
|
|
|
5306
5299
|
quicklinks_data_: quicklinks_data_,
|
|
5307
5300
|
router_: router_,
|
|
5308
5301
|
current_query_id_: ()=>depict_category.category_id,
|
|
5309
|
-
slider_arrow_button_: slider_arrow_button_,
|
|
5310
5302
|
breadcrumb_data_: breadcrumb_data_
|
|
5311
5303
|
});
|
|
5312
5304
|
}
|
|
@@ -5438,9 +5430,9 @@ const $a79d86d64fb64e8e$export$824dde41348efed1 = /*@__PURE__*/ (()=>{
|
|
|
5438
5430
|
|
|
5439
5431
|
const $5c5f95951393e5d1$var$TEN_MINUTES = 600000;
|
|
5440
5432
|
const $5c5f95951393e5d1$var$TWENTY_FOUR_HOURS = 86400000;
|
|
5441
|
-
async function $5c5f95951393e5d1$export$643598a327b5833e(tenant, market) {
|
|
5433
|
+
async function $5c5f95951393e5d1$export$643598a327b5833e(tenant, market, type) {
|
|
5442
5434
|
let localstorage_value;
|
|
5443
|
-
const localstorage_key = `
|
|
5435
|
+
const localstorage_key = `depict_${tenant}_${type ?? "categories"}_` + market;
|
|
5444
5436
|
try {
|
|
5445
5437
|
const in_ls = localStorage[localstorage_key];
|
|
5446
5438
|
if (in_ls) localstorage_value = JSON.parse(in_ls);
|
|
@@ -5456,7 +5448,7 @@ async function $5c5f95951393e5d1$export$643598a327b5833e(tenant, market) {
|
|
|
5456
5448
|
return stored_queries;
|
|
5457
5449
|
else if (age < $5c5f95951393e5d1$var$TWENTY_FOUR_HOURS) {
|
|
5458
5450
|
// 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)
|
|
5459
|
-
$5c5f95951393e5d1$var$fetch_and_store_categories(tenant, market, localstorage_key).catch((e)=>(0, $cV3wj$report)([
|
|
5451
|
+
$5c5f95951393e5d1$var$fetch_and_store_categories(tenant, market, localstorage_key, type).catch((e)=>(0, $cV3wj$report)([
|
|
5460
5452
|
e,
|
|
5461
5453
|
"couldn't fetch categories"
|
|
5462
5454
|
], "warning"));
|
|
@@ -5464,10 +5456,10 @@ async function $5c5f95951393e5d1$export$643598a327b5833e(tenant, market) {
|
|
|
5464
5456
|
}
|
|
5465
5457
|
// else: we are older and just fetch, store and return new queries
|
|
5466
5458
|
}
|
|
5467
|
-
return await $5c5f95951393e5d1$var$fetch_and_store_categories(tenant, market, localstorage_key);
|
|
5459
|
+
return await $5c5f95951393e5d1$var$fetch_and_store_categories(tenant, market, localstorage_key, type);
|
|
5468
5460
|
}
|
|
5469
|
-
async function $5c5f95951393e5d1$var$fetch_and_store_categories(tenant, market, localstorage_key) {
|
|
5470
|
-
const new_categories = await $5c5f95951393e5d1$var$download_categories(tenant, market);
|
|
5461
|
+
async function $5c5f95951393e5d1$var$fetch_and_store_categories(tenant, market, localstorage_key, type) {
|
|
5462
|
+
const new_categories = await $5c5f95951393e5d1$var$download_categories(tenant, market, type);
|
|
5471
5463
|
try {
|
|
5472
5464
|
localStorage[localstorage_key] = JSON.stringify({
|
|
5473
5465
|
updated: +new Date(),
|
|
@@ -5481,12 +5473,15 @@ async function $5c5f95951393e5d1$var$fetch_and_store_categories(tenant, market,
|
|
|
5481
5473
|
}
|
|
5482
5474
|
return new_categories;
|
|
5483
5475
|
}
|
|
5484
|
-
async function $5c5f95951393e5d1$var$download_categories(tenant, market) {
|
|
5476
|
+
async function $5c5f95951393e5d1$var$download_categories(tenant, market, type) {
|
|
5485
5477
|
const fetched = await (0, $cV3wj$fetch_retry)((0, $cV3wj$base_url) + "/v2/product-listing/queries", {
|
|
5486
5478
|
method: "POST",
|
|
5487
5479
|
body: JSON.stringify({
|
|
5488
5480
|
tenant: tenant,
|
|
5489
|
-
market: market
|
|
5481
|
+
market: market,
|
|
5482
|
+
...type ? {
|
|
5483
|
+
type: type
|
|
5484
|
+
} : {}
|
|
5490
5485
|
})
|
|
5491
5486
|
});
|
|
5492
5487
|
if (!fetched) return [];
|
|
@@ -6932,7 +6927,7 @@ const $793905995512612d$var$_tmpl$ = [
|
|
|
6932
6927
|
' class="category-suggestion">',
|
|
6933
6928
|
"</div>"
|
|
6934
6929
|
];
|
|
6935
|
-
function $793905995512612d$export$c05a196222ba1302({ suggestions_: suggestions_ , children: children
|
|
6930
|
+
function $793905995512612d$export$c05a196222ba1302({ suggestions_: suggestions_ , children: children }) {
|
|
6936
6931
|
const category_suggestions_ = (0, $cV3wj$createMemo)(()=>suggestions_()?.suggestions.filter((s)=>s.type === "category"));
|
|
6937
6932
|
return (0, $cV3wj$createComponent)((0, $cV3wj$Show), {
|
|
6938
6933
|
get when () {
|
|
@@ -6940,7 +6935,6 @@ function $793905995512612d$export$c05a196222ba1302({ suggestions_: suggestions_
|
|
|
6940
6935
|
},
|
|
6941
6936
|
get children () {
|
|
6942
6937
|
return (0, $cV3wj$ssr)($793905995512612d$var$_tmpl$, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$escape)((0, $cV3wj$createComponent)((0, $f32e14878e75af51$export$6649caad96ef8870), {
|
|
6943
|
-
button_: slider_arrow_button_,
|
|
6944
6938
|
faded_opacity_: 0.7,
|
|
6945
6939
|
get children () {
|
|
6946
6940
|
return (0, $cV3wj$createComponent)((0, $cV3wj$Show), {
|
|
@@ -7023,7 +7017,7 @@ const $7097477c78a89208$var$_tmpl$ = [
|
|
|
7023
7017
|
"<!--/--></div>"
|
|
7024
7018
|
];
|
|
7025
7019
|
function $7097477c78a89208$export$a54ec244c8863715(opts) {
|
|
7026
|
-
const { depict_api_: depict_api_ , search_field_value_: search_field_value_ , get_search_query_: get_search_query_ , open_modal_: open_modal_ , submit_query_: submit_query_ , current_sorting_: current_sorting_ , min_products_to_fetch_: min_products_to_fetch_ , search_filters_open_: search_filters_open_ , search_sorting_open_: search_sorting_open_ , expanded_filters_: expanded_filters_ , input_modal_open_: input_modal_open_ , selected_filters_: selected_filters_ , i18n_: i18n_ ,
|
|
7020
|
+
const { depict_api_: depict_api_ , search_field_value_: search_field_value_ , get_search_query_: get_search_query_ , open_modal_: open_modal_ , submit_query_: submit_query_ , current_sorting_: current_sorting_ , min_products_to_fetch_: min_products_to_fetch_ , search_filters_open_: search_filters_open_ , search_sorting_open_: search_sorting_open_ , expanded_filters_: expanded_filters_ , input_modal_open_: input_modal_open_ , selected_filters_: selected_filters_ , i18n_: i18n_ , make_category_suggestion_card_: make_category_suggestion_card_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , clear_filters_on_next_submit_: clear_filters_on_next_submit_ , local_filter_cache_: local_filter_cache_ , include_input_field_: include_input_field_ , tenant_: tenant_ , market_: market_ , showing_recommendation_rows_: showing_recommendation_rows_ , search_recs_view_more_: search_recs_view_more_ , disable_search_recommendations_: disable_search_recommendations_ , layout_options_: layout_options_ , recommendations_layout_options_: recommendations_layout_options_ = layout_options_ , scroll_restoration_data_: scroll_restoration_data_ , product_card_template_: product_card_template_ } = opts;
|
|
7027
7021
|
const [get_sorting] = current_sorting_;
|
|
7028
7022
|
const all_products_loaded_ = (0, $cV3wj$createSignal)(false);
|
|
7029
7023
|
const [get_all_products_loaded, set_all_products_loaded] = all_products_loaded_;
|
|
@@ -7143,13 +7137,14 @@ function $7097477c78a89208$export$a54ec244c8863715(opts) {
|
|
|
7143
7137
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_
|
|
7144
7138
|
});
|
|
7145
7139
|
const results_filters = (0, $cV3wj$createSignal)();
|
|
7140
|
+
const owner = (0, $cV3wj$getOwner)();
|
|
7146
7141
|
(0, $cV3wj$onCleanup)((0, $cV3wj$javascript_media_query)("(max-width:600px)", async ({ matches: matches })=>{
|
|
7147
7142
|
results_filters[1]();
|
|
7148
7143
|
await new Promise((r)=>queueMicrotask(r));
|
|
7149
|
-
results_filters[1](matches ? [
|
|
7150
|
-
|
|
7151
|
-
|
|
7152
|
-
|
|
7144
|
+
(0, $cV3wj$runWithOwner)(owner, ()=>results_filters[1](matches ? [
|
|
7145
|
+
results_for,
|
|
7146
|
+
filters_opener
|
|
7147
|
+
] : (0, $cV3wj$ssr)($7097477c78a89208$var$_tmpl$, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$escape)(results_for), (0, $cV3wj$escape)(filters_opener))));
|
|
7153
7148
|
}).remove);
|
|
7154
7149
|
(0, $cV3wj$catchify)((0, $641bba2917fe862b$export$6e49da55e449af7c))({
|
|
7155
7150
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
@@ -7178,7 +7173,6 @@ function $7097477c78a89208$export$a54ec244c8863715(opts) {
|
|
|
7178
7173
|
get children () {
|
|
7179
7174
|
return (0, $cV3wj$createComponent)((0, $793905995512612d$export$c05a196222ba1302), {
|
|
7180
7175
|
suggestions_: suggestions,
|
|
7181
|
-
slider_arrow_button_: slider_arrow_button_,
|
|
7182
7176
|
children: make_category_suggestion_card_
|
|
7183
7177
|
});
|
|
7184
7178
|
}
|
|
@@ -7196,7 +7190,6 @@ function $7097477c78a89208$export$a54ec244c8863715(opts) {
|
|
|
7196
7190
|
i18n_: i18n_,
|
|
7197
7191
|
selected_filters_: selected_filters_,
|
|
7198
7192
|
local_filter_cache_: local_filter_cache_,
|
|
7199
|
-
slider_arrow_button_: slider_arrow_button_,
|
|
7200
7193
|
search_filters_open_: search_filters_open_,
|
|
7201
7194
|
search_sorting_open_: search_sorting_open_,
|
|
7202
7195
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
@@ -7316,7 +7309,6 @@ function $4ca91518c9a35379$export$828dcdd425fd3231(aligner) {
|
|
|
7316
7309
|
|
|
7317
7310
|
|
|
7318
7311
|
|
|
7319
|
-
|
|
7320
7312
|
const $806c97b931758897$var$_tmpl$ = [
|
|
7321
7313
|
"<div",
|
|
7322
7314
|
' class="depict plp search">',
|
|
@@ -7606,10 +7598,6 @@ function $806c97b931758897$export$f2dc7e4e4aa11abb({ depict_search: depict_searc
|
|
|
7606
7598
|
cols_at_size: (0, $b5cccc8ee7d24677$export$6daf8749b65a1b77)(extra_depict_options.recommendations_cols_at_size),
|
|
7607
7599
|
...grid_spacing_override
|
|
7608
7600
|
} : undefined,
|
|
7609
|
-
slider_arrow_button_: (0, $fbbadcb080ad1d4a$export$8be2714ec7f169ee)({
|
|
7610
|
-
height_: 12,
|
|
7611
|
-
width_: 6.46
|
|
7612
|
-
}),
|
|
7613
7601
|
product_card_template_: product_card_template
|
|
7614
7602
|
});
|
|
7615
7603
|
}, "Entire SearchPage failed");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"description": "Base package containing the actual UI of Depict UI along with translations, with a not-simplified API. We recommend using @depict-ai/js-ui or @depict-ai/react-ui instead.",
|
|
5
5
|
"packageManager": "yarn@3.2.2",
|
|
6
6
|
"main": "dist/client/main.js",
|
|
@@ -124,9 +124,9 @@
|
|
|
124
124
|
"ts-jest": "^29.0.3"
|
|
125
125
|
},
|
|
126
126
|
"dependencies": {
|
|
127
|
-
"@depict-ai/plp-styling": "^1.0.
|
|
128
|
-
"@depict-ai/types": "^1.0.
|
|
129
|
-
"@depict-ai/utilishared": "^1.0.
|
|
127
|
+
"@depict-ai/plp-styling": "^1.0.16",
|
|
128
|
+
"@depict-ai/types": "^1.0.19",
|
|
129
|
+
"@depict-ai/utilishared": "^1.0.15",
|
|
130
130
|
"solid-js": "^1.7.3"
|
|
131
131
|
},
|
|
132
132
|
"types": "dist/index.d.ts",
|