@depict-ai/ui 1.3.2 → 1.3.4
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 +370 -248
- package/dist/client/module.js +372 -251
- package/dist/index.d.ts +36 -10
- package/dist/server/main.cjs +341 -234
- package/dist/server/module.js +343 -237
- package/package.json +4 -4
package/dist/server/main.cjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
var $diwD4$depictaiutilishared = require("@depict-ai/utilishared");
|
|
2
|
-
var $diwD4$solidjs = require("solid-js");
|
|
3
2
|
var $diwD4$solidjsweb = require("solid-js/web");
|
|
3
|
+
var $diwD4$solidjs = require("solid-js");
|
|
4
4
|
|
|
5
5
|
function $parcel$export(e, n, v, s) {
|
|
6
6
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
$parcel$export(module.exports, "SolidLayout", () => $f48d0fbb00835aaa$export$d21e32dfedac04be);
|
|
9
10
|
$parcel$export(module.exports, "general_modal_abstraction", () => $9abb0a35d4b60ed3$export$79b1565500412d9b);
|
|
10
11
|
$parcel$export(module.exports, "CrossIcon", () => $c77c68e559a1506c$export$3b621d86b1566b2);
|
|
11
12
|
$parcel$export(module.exports, "GenericSliderArrowButton", () => $0f313083912e447a$export$8be2714ec7f169ee);
|
|
@@ -43,11 +44,179 @@ $parcel$export(module.exports, "defaultGridSpacing", () => $a3280f0aad997933$exp
|
|
|
43
44
|
$parcel$export(module.exports, "defaultColsAtSize", () => $a3280f0aad997933$export$c3834fa86c616831);
|
|
44
45
|
$parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad997933$export$7bf543b9d9be2c22);
|
|
45
46
|
$parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
|
|
46
|
-
/*! Depict.ai search and product listing SDK */ const $b757f75811f3261f$export$83d89fbfd8236492 = "1.3.
|
|
47
|
+
/*! Depict.ai search and product listing SDK */ const $b757f75811f3261f$export$83d89fbfd8236492 = "1.3.4";
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
47
55
|
|
|
48
56
|
|
|
49
57
|
|
|
50
58
|
|
|
59
|
+
function $5f7d55c710fd1bc2$export$2f0cbfbb4354bb52(elements) {
|
|
60
|
+
// FYI this probably doesn't work on hugely deep nestings or large amount of elements
|
|
61
|
+
return (0, $diwD4$solidjs.createMemo)(()=>$5f7d55c710fd1bc2$var$unwrapping_helper(elements));
|
|
62
|
+
}
|
|
63
|
+
function $5f7d55c710fd1bc2$var$unwrapping_helper(elements) {
|
|
64
|
+
const result = [];
|
|
65
|
+
if (Array.isArray(elements)) for(let i = 0; i < elements.length; i++){
|
|
66
|
+
const element = elements[i];
|
|
67
|
+
result.push(...$5f7d55c710fd1bc2$var$unwrapping_helper(element));
|
|
68
|
+
}
|
|
69
|
+
else if (typeof elements == "function") result.push(...$5f7d55c710fd1bc2$var$unwrapping_helper(elements()));
|
|
70
|
+
else if (elements != undefined && typeof elements != "boolean") result.push(elements);
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
// Errors caused by SDK consuming code interfacing with the SDK, not the SDK itself or other Depict packages
|
|
82
|
+
class $7dd1edb2ee2b43ad$export$e1d52e4f0c7557a1 extends Error {
|
|
83
|
+
}
|
|
84
|
+
class $7dd1edb2ee2b43ad$export$aa14a9f43128f61f extends $7dd1edb2ee2b43ad$export$e1d52e4f0c7557a1 {
|
|
85
|
+
constructor(templateError){
|
|
86
|
+
super("Uncaught error in product card template", {
|
|
87
|
+
cause: templateError
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
const $edafe91daf3091d7$var$_tmpl$ = [
|
|
94
|
+
"<div",
|
|
95
|
+
' class="',
|
|
96
|
+
'">',
|
|
97
|
+
"</div>"
|
|
98
|
+
];
|
|
99
|
+
function $edafe91daf3091d7$export$b69d0d92862de18b(props) {
|
|
100
|
+
return (0, $diwD4$solidjs.ErrorBoundary)({
|
|
101
|
+
fallback (err, retry) {
|
|
102
|
+
const { message_: message_ , severity_: severity_ } = props;
|
|
103
|
+
let message = message_;
|
|
104
|
+
if (err instanceof (0, $7dd1edb2ee2b43ad$export$aa14a9f43128f61f)) {
|
|
105
|
+
console.error(err.cause);
|
|
106
|
+
message = `${message}: ${err.message}`;
|
|
107
|
+
} else (0, $diwD4$depictaiutilishared.report)([
|
|
108
|
+
err,
|
|
109
|
+
message_
|
|
110
|
+
], severity_);
|
|
111
|
+
props.on_error_?.(retry);
|
|
112
|
+
return (0, $diwD4$solidjsweb.ssr)($edafe91daf3091d7$var$_tmpl$, (0, $diwD4$solidjsweb.ssrHydrationKey)(), (0, $diwD4$solidjsweb.ssrClassList)(Object.fromEntries(props.class_list_?.map((c)=>[
|
|
113
|
+
c,
|
|
114
|
+
true
|
|
115
|
+
]) || [])), (0, $diwD4$solidjsweb.escape)(message));
|
|
116
|
+
},
|
|
117
|
+
get children () {
|
|
118
|
+
return props.children;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
const $f48d0fbb00835aaa$var$_tmpl$ = [
|
|
125
|
+
"<div",
|
|
126
|
+
' class="',
|
|
127
|
+
'">',
|
|
128
|
+
"</div>"
|
|
129
|
+
], $f48d0fbb00835aaa$var$_tmpl$2 = [
|
|
130
|
+
"<style",
|
|
131
|
+
' type="text/css">',
|
|
132
|
+
"</style>"
|
|
133
|
+
];
|
|
134
|
+
function $f48d0fbb00835aaa$export$d21e32dfedac04be(props) {
|
|
135
|
+
return (0, $diwD4$solidjsweb.createComponent)((0, $edafe91daf3091d7$export$b69d0d92862de18b), {
|
|
136
|
+
get message_ () {
|
|
137
|
+
return "Failed calculating " + props.layout + " layout";
|
|
138
|
+
},
|
|
139
|
+
severity_: "error",
|
|
140
|
+
get children () {
|
|
141
|
+
return $f48d0fbb00835aaa$var$ActualSolidLayout(props);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
function $f48d0fbb00835aaa$var$ActualSolidLayout(props) {
|
|
146
|
+
// Copy of Layout from utilishared but using solid-js signals instead of async iterable IPNS
|
|
147
|
+
const show_all_rows = (0, $diwD4$solidjs.createMemo)(()=>props.rows === "all");
|
|
148
|
+
const rows_or_empty_object = (0, $diwD4$solidjs.createMemo)(()=>show_all_rows() ? {} : props.rows);
|
|
149
|
+
const button_elements = (0, $5f7d55c710fd1bc2$export$2f0cbfbb4354bb52)((0, $diwD4$solidjs.createMemo)(()=>rows_or_empty_object().button));
|
|
150
|
+
const have_a_button = (0, $diwD4$solidjs.createMemo)(()=>{
|
|
151
|
+
const button = button_elements();
|
|
152
|
+
return !(!button || Array.isArray(button) && !button.length);
|
|
153
|
+
});
|
|
154
|
+
const [get_styling, set_styling] = (0, $diwD4$solidjs.createSignal)();
|
|
155
|
+
const container_class = (0, $diwD4$depictaiutilishared.make_random_classname)();
|
|
156
|
+
const selector_beginning = `.depict .${container_class}>`; // class so ppl can have id if needed
|
|
157
|
+
const container_element = (0, $diwD4$solidjsweb.ssrElement)("div", props.element_attributes, ()=>(0, $diwD4$solidjsweb.escape)(props.children), true);
|
|
158
|
+
const [get_children_count, set_children_count] = (0, $diwD4$solidjs.createSignal)(0);
|
|
159
|
+
const update_children_count = ()=>set_children_count(container_element.children.length);
|
|
160
|
+
const col_styling = (0, $diwD4$solidjs.createMemo)(()=>(0, $diwD4$depictaiutilishared.n_col_styling_with_dist)(selector_beginning, props.grid_spacing, props.cols_at_size, props.layout, props.override_vertical_spacing));
|
|
161
|
+
const default_currently_visible_signal = (0, $diwD4$solidjs.createSignal)(0); // Keep this signal here so it doesn't change when rows_or_empty_object and I think it's to be expected that the "internal default signal" stays the same
|
|
162
|
+
const rows_visible_signal = (0, $diwD4$solidjs.createMemo)(()=>rows_or_empty_object().currently_visible || default_currently_visible_signal);
|
|
163
|
+
const get_rows_visible = (0, $diwD4$solidjs.createMemo)(()=>rows_visible_signal()[0]());
|
|
164
|
+
const set_rows_visible = (0, $diwD4$solidjs.createMemo)(()=>rows_visible_signal()[1]);
|
|
165
|
+
const button_class = (0, $diwD4$depictaiutilishared.make_random_classname)();
|
|
166
|
+
const button_container = (0, $diwD4$solidjs.createMemo)(()=>have_a_button() && (0, $diwD4$solidjsweb.ssr)($f48d0fbb00835aaa$var$_tmpl$, (0, $diwD4$solidjsweb.ssrHydrationKey)(), "load-more-container " + (0, $diwD4$solidjsweb.escape)(button_class, true), (0, $diwD4$solidjsweb.escape)(rows_or_empty_object().button)));
|
|
167
|
+
container_element.classList.add(container_class);
|
|
168
|
+
(0, $diwD4$solidjs.createComputed)(()=>{
|
|
169
|
+
// Make sure we don't have more rows visible than max_rows (this could happen by max_rows being decreased)
|
|
170
|
+
const rows_visible = get_rows_visible();
|
|
171
|
+
const max_rows = rows_or_empty_object().max_rows;
|
|
172
|
+
if (!isNaN(max_rows) && max_rows >= 0 && rows_visible > max_rows) set_rows_visible()(max_rows);
|
|
173
|
+
});
|
|
174
|
+
(0, $diwD4$solidjs.createRenderEffect)(()=>{
|
|
175
|
+
// Be careful to only read show_all_rows in here (ofc doesn't apply to nested effects)
|
|
176
|
+
if (show_all_rows()) {
|
|
177
|
+
// no view more functionality requested
|
|
178
|
+
set_styling(()=>col_styling);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
(0, $diwD4$solidjs.untrack)(()=>set_rows_visible()(rows_or_empty_object().start_rows ?? 1));
|
|
182
|
+
update_children_count();
|
|
183
|
+
const mutation_observer = new MutationObserver((0, $diwD4$depictaiutilishared.catchify)(update_children_count));
|
|
184
|
+
mutation_observer.observe(container_element, {
|
|
185
|
+
childList: true
|
|
186
|
+
});
|
|
187
|
+
(0, $diwD4$solidjs.onCleanup)(()=>mutation_observer.disconnect());
|
|
188
|
+
set_styling(// this is needed because solid will think that the memo-accessor is a setter function otherwise
|
|
189
|
+
()=>(0, $diwD4$solidjs.createMemo)(()=>{
|
|
190
|
+
const { rows_per_click: rows_per_click , max_rows: max_rows = -1 } = rows_or_empty_object();
|
|
191
|
+
const rows_visible = get_rows_visible();
|
|
192
|
+
const children_count = get_children_count();
|
|
193
|
+
return col_styling() + props.cols_at_size.map((options)=>{
|
|
194
|
+
const [, min, max] = options;
|
|
195
|
+
let should_hide_button;
|
|
196
|
+
let visible_recs;
|
|
197
|
+
if (props.disable_partial_rows) {
|
|
198
|
+
visible_recs = (0, $diwD4$depictaiutilishared.layout_get_visible_recs_without_partial_rows)(rows_visible, children_count, options);
|
|
199
|
+
const visible_recs_next_show_more = (0, $diwD4$depictaiutilishared.layout_get_visible_recs_without_partial_rows)(rows_visible + (rows_per_click || 0), // Should this really be zero when we default rows_per_click to 1?
|
|
200
|
+
children_count, options);
|
|
201
|
+
should_hide_button = visible_recs === visible_recs_next_show_more;
|
|
202
|
+
} else {
|
|
203
|
+
visible_recs = (0, $diwD4$depictaiutilishared.layout_get_total_rec_amount_for_row)(rows_visible, options);
|
|
204
|
+
should_hide_button = visible_recs >= children_count;
|
|
205
|
+
}
|
|
206
|
+
const should_hide_button_final = button_class && (should_hide_button || max_rows !== -1 && rows_visible >= max_rows);
|
|
207
|
+
return `${(0, $diwD4$depictaiutilishared.layout_media_query_header)(min, max)}{${selector_beginning}:nth-child(n+${visible_recs + 1}){display:none}${props.layout == "slider" ? `${selector_beginning}:nth-child(n+${visible_recs}){margin-right:0}` : ""}${should_hide_button_final ? `.depict .${button_class}{display:none!important}` : ``}}`;
|
|
208
|
+
}).join("");
|
|
209
|
+
}));
|
|
210
|
+
});
|
|
211
|
+
return [
|
|
212
|
+
container_element,
|
|
213
|
+
button_container(),
|
|
214
|
+
(0, $diwD4$solidjsweb.ssr)($f48d0fbb00835aaa$var$_tmpl$2, (0, $diwD4$solidjsweb.ssrHydrationKey)(), get_styling)
|
|
215
|
+
];
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
51
220
|
|
|
52
221
|
async function $9abb0a35d4b60ed3$export$79b1565500412d9b(search_modal, modal_fn_opts) {
|
|
53
222
|
const body = await (0, $diwD4$depictaiutilishared.observer).wait_for_element("body");
|
|
@@ -669,8 +838,6 @@ function $401aee5f33dca9e2$export$83fd5de5504a7a67({ formatted_number_of_results
|
|
|
669
838
|
|
|
670
839
|
|
|
671
840
|
|
|
672
|
-
|
|
673
|
-
|
|
674
841
|
const $0d0b172488865048$var$_tmpl$ = [
|
|
675
842
|
"<a",
|
|
676
843
|
' class="hint" href="javascript:void(0)">',
|
|
@@ -707,70 +874,6 @@ function $fc23d7668ae0011d$export$a2cc176055f8f08() {
|
|
|
707
874
|
|
|
708
875
|
|
|
709
876
|
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
// Errors caused by SDK consuming code interfacing with the SDK, not the SDK itself or other Depict packages
|
|
713
|
-
class $7dd1edb2ee2b43ad$export$e1d52e4f0c7557a1 extends Error {
|
|
714
|
-
}
|
|
715
|
-
class $7dd1edb2ee2b43ad$export$aa14a9f43128f61f extends $7dd1edb2ee2b43ad$export$e1d52e4f0c7557a1 {
|
|
716
|
-
constructor(templateError){
|
|
717
|
-
super("Uncaught error in product card template", {
|
|
718
|
-
cause: templateError
|
|
719
|
-
});
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
const $edafe91daf3091d7$var$_tmpl$ = [
|
|
725
|
-
"<div",
|
|
726
|
-
' class="',
|
|
727
|
-
'">',
|
|
728
|
-
"</div>"
|
|
729
|
-
];
|
|
730
|
-
function $edafe91daf3091d7$export$b69d0d92862de18b(props) {
|
|
731
|
-
return (0, $diwD4$solidjs.ErrorBoundary)({
|
|
732
|
-
fallback (err, retry) {
|
|
733
|
-
const { message_: message_ , severity_: severity_ } = props;
|
|
734
|
-
let message = message_;
|
|
735
|
-
if (err instanceof (0, $7dd1edb2ee2b43ad$export$aa14a9f43128f61f)) {
|
|
736
|
-
console.error(err.cause);
|
|
737
|
-
message = `${message}: ${err.message}`;
|
|
738
|
-
} else (0, $diwD4$depictaiutilishared.report)([
|
|
739
|
-
err,
|
|
740
|
-
message_
|
|
741
|
-
], severity_);
|
|
742
|
-
props.on_error_?.(retry);
|
|
743
|
-
return (0, $diwD4$solidjsweb.ssr)($edafe91daf3091d7$var$_tmpl$, (0, $diwD4$solidjsweb.ssrHydrationKey)(), (0, $diwD4$solidjsweb.ssrClassList)(Object.fromEntries(props.class_list_?.map((c)=>[
|
|
744
|
-
c,
|
|
745
|
-
true
|
|
746
|
-
]) || [])), (0, $diwD4$solidjsweb.escape)(message));
|
|
747
|
-
},
|
|
748
|
-
get children () {
|
|
749
|
-
return props.children;
|
|
750
|
-
}
|
|
751
|
-
});
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
function $5f7d55c710fd1bc2$export$2f0cbfbb4354bb52(elements) {
|
|
758
|
-
// FYI this probably doesn't work on hugely deep nestings or large amount of elements
|
|
759
|
-
return (0, $diwD4$solidjs.createMemo)(()=>$5f7d55c710fd1bc2$var$unwrapping_helper(elements));
|
|
760
|
-
}
|
|
761
|
-
function $5f7d55c710fd1bc2$var$unwrapping_helper(elements) {
|
|
762
|
-
const result = [];
|
|
763
|
-
if (Array.isArray(elements)) for(let i = 0; i < elements.length; i++){
|
|
764
|
-
const element = elements[i];
|
|
765
|
-
result.push(...$5f7d55c710fd1bc2$var$unwrapping_helper(element));
|
|
766
|
-
}
|
|
767
|
-
else if (typeof elements == "function") result.push(...$5f7d55c710fd1bc2$var$unwrapping_helper(elements()));
|
|
768
|
-
else if (elements != undefined && typeof elements != "boolean") result.push(elements);
|
|
769
|
-
return result;
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
877
|
let $0caf87eaa19079da$var$cached_placeholder_element;
|
|
775
878
|
let $0caf87eaa19079da$var$rendering_cached_placeholder_element;
|
|
776
879
|
function $0caf87eaa19079da$export$f33414a4df0afd3f({ product_card_template_: product_card_template_ , num_placeholders_: num_placeholders_ }) {
|
|
@@ -1084,21 +1187,13 @@ function $ac167f6af6a48fc3$export$a1fd619a4743ca08({ plp_results_: plp_results_
|
|
|
1084
1187
|
}
|
|
1085
1188
|
|
|
1086
1189
|
|
|
1190
|
+
|
|
1087
1191
|
const $fe76fb463cc60b89$var$_tmpl$ = [
|
|
1088
1192
|
"<div",
|
|
1089
1193
|
' class="',
|
|
1090
1194
|
'"><!--#-->',
|
|
1091
1195
|
"<!--/--><!--#-->",
|
|
1092
1196
|
"<!--/--></div>"
|
|
1093
|
-
], $fe76fb463cc60b89$var$_tmpl$2 = [
|
|
1094
|
-
"<div",
|
|
1095
|
-
' class="cards"',
|
|
1096
|
-
">",
|
|
1097
|
-
"</div>"
|
|
1098
|
-
], $fe76fb463cc60b89$var$_tmpl$3 = [
|
|
1099
|
-
"<style",
|
|
1100
|
-
">",
|
|
1101
|
-
"</style>"
|
|
1102
1197
|
];
|
|
1103
1198
|
function $fe76fb463cc60b89$export$3925f87b1545cfc6({ plp_results_: plp_results_ , depict_api_: depict_api_ , all_products_loaded_: all_products_loaded_ , min_products_to_fetch_: min_products_to_fetch_ , query_base_: query_base_ , first_result_in_viewport_: first_result_in_viewport_ , last_result_in_viewport_: last_result_in_viewport_ , scroll_restoration_data_: [get_scroll_restoration_data] , no_results_options_: no_results_options_ , desktop_filter_elements_: desktop_filter_elements_ , sort_or_filter_open_: sort_or_filter_open_ , product_card_template_: product_card_template_ , layout_options_: layout_options_ , id_currently_querying_for_: id_currently_querying_for_ }) {
|
|
1104
1199
|
// The plp_results_ resource will be delayed because we're using createBatchedMemo to not make triplicate API requests, but we need to show the placeholders before already to match Chrome and Firefox's "content has to be there, ready for scroll restoration, before all popstate tasks have been completed"-requirement
|
|
@@ -1140,9 +1235,6 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
1140
1235
|
let suspense_contents;
|
|
1141
1236
|
let is_just_after_plp_results_update = false;
|
|
1142
1237
|
let fallback_is_alive = false;
|
|
1143
|
-
const random_id = (0, $diwD4$depictaiutilishared.make_random_classname)();
|
|
1144
|
-
const selector_beginning_ = `.depict.plp #${random_id}>`;
|
|
1145
|
-
const [get_styling, set_styling_] = (0, $diwD4$solidjs.createSignal)("");
|
|
1146
1238
|
const [get_should_have_placeholders_rendered, set_should_have_placeholders_rendered] = (0, $diwD4$solidjs.createSignal)(true);
|
|
1147
1239
|
const rendered_placeholders = (0, $diwD4$solidjs.createMemo)(()=>get_should_have_placeholders_rendered() ? (0, $0caf87eaa19079da$export$f33414a4df0afd3f)({
|
|
1148
1240
|
product_card_template_: product_card_template_,
|
|
@@ -1152,64 +1244,22 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
1152
1244
|
})
|
|
1153
1245
|
}) : undefined);
|
|
1154
1246
|
const [get_suspense_is_blocked, set_suspense_is_blocked] = (0, $diwD4$solidjs.createSignal)(false);
|
|
1247
|
+
const modified_cols_at_size = $fe76fb463cc60b89$var$make_modified_cols_at_size({
|
|
1248
|
+
layout_options_: layout_options_,
|
|
1249
|
+
sort_or_filter_open_: sort_or_filter_open_
|
|
1250
|
+
});
|
|
1155
1251
|
(0, $diwD4$solidjs.createComputed)(()=>{
|
|
1156
1252
|
if (!is_loading_()) return;
|
|
1157
1253
|
set_should_have_placeholders_rendered(true);
|
|
1158
1254
|
set_suspense_is_blocked(false);
|
|
1159
1255
|
is_just_after_plp_results_update = true;
|
|
1160
1256
|
});
|
|
1161
|
-
$fe76fb463cc60b89$var$results_grid_styling_generator({
|
|
1162
|
-
layout_options_: layout_options_,
|
|
1163
|
-
set_styling_: set_styling_,
|
|
1164
|
-
sort_or_filter_open_: sort_or_filter_open_,
|
|
1165
|
-
selector_beginning_: selector_beginning_
|
|
1166
|
-
});
|
|
1167
|
-
const has_at_least_one_display = (0, $diwD4$solidjs.createMemo)(()=>!!plp_results_()?.displays?.length); // Only de-construct below stuff if we get 0 displays. Important that this returns boolean so that below Suspense only gets re-created if it actually changes
|
|
1168
1257
|
const block_suspense_if_needed = ()=>{
|
|
1169
1258
|
if (!is_just_after_plp_results_update) return;
|
|
1170
1259
|
is_just_after_plp_results_update = false;
|
|
1171
1260
|
fallback_is_alive = false;
|
|
1172
1261
|
set_suspense_is_blocked(true);
|
|
1173
1262
|
};
|
|
1174
|
-
const non_placeholder_product_cards = (0, $diwD4$solidjs.createMemo)(()=>has_at_least_one_display() && // This suspense ensures that if someone has async templates, we still show placeholders until the product cards actually have finished rendering (automagically since they're createResource's)
|
|
1175
|
-
// We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
|
|
1176
|
-
// (For the whole idea of the displays being cached to work we can't tear down and re-run ProductCards for every new result.
|
|
1177
|
-
// We have to keep ProductCards alive, but hidden, and feed them new data as soon as we had it)
|
|
1178
|
-
(0, $diwD4$solidjsweb.createComponent)((0, $diwD4$solidjs.Suspense), {
|
|
1179
|
-
get fallback () {
|
|
1180
|
-
return (()=>{
|
|
1181
|
-
fallback_is_alive = true;
|
|
1182
|
-
(0, $diwD4$solidjs.onCleanup)(block_suspense_if_needed); // Block suspense after initial run every time after we fetch
|
|
1183
|
-
return (0, $diwD4$solidjs.createMemo)(()=>{
|
|
1184
|
-
// We need to be able to block the suspense since when async product cards are *rendering* we want to show the placeholders on initial load but not when loading more
|
|
1185
|
-
// In future we could have individual suspense's for each product card, but that's too much for now
|
|
1186
|
-
if (get_suspense_is_blocked()) return suspense_contents;
|
|
1187
|
-
set_should_have_placeholders_rendered(true); // just in case
|
|
1188
|
-
(0, $diwD4$solidjs.onCleanup)(()=>set_should_have_placeholders_rendered(false));
|
|
1189
|
-
return rendered_placeholders; // I lifted the placeholders into the memo since we don't want to re-render them when switching from <Show> to <Suspense>
|
|
1190
|
-
});
|
|
1191
|
-
})();
|
|
1192
|
-
},
|
|
1193
|
-
get children () {
|
|
1194
|
-
return (()=>{
|
|
1195
|
-
suspense_contents = (0, $ac167f6af6a48fc3$export$a1fd619a4743ca08)({
|
|
1196
|
-
product_card_template_: product_card_template_,
|
|
1197
|
-
plp_results_: plp_results_,
|
|
1198
|
-
last_result_in_viewport_: last_result_in_viewport_,
|
|
1199
|
-
first_result_in_viewport_: first_result_in_viewport_,
|
|
1200
|
-
market_: market_,
|
|
1201
|
-
merchant_: merchant_,
|
|
1202
|
-
all_products_loaded_: all_products_loaded_,
|
|
1203
|
-
min_products_to_fetch_: min_products_to_fetch_,
|
|
1204
|
-
query_base_: query_base_,
|
|
1205
|
-
depict_api_: depict_api_,
|
|
1206
|
-
is_loading_: is_loading_
|
|
1207
|
-
});
|
|
1208
|
-
(0, $diwD4$solidjs.onCleanup)(()=>suspense_contents = undefined);
|
|
1209
|
-
return suspense_contents;
|
|
1210
|
-
})();
|
|
1211
|
-
}
|
|
1212
|
-
}));
|
|
1213
1263
|
(0, $diwD4$solidjs.createEffect)((0, $diwD4$solidjs.on)(plp_results_, ()=>{
|
|
1214
1264
|
if (!fallback_is_alive) {
|
|
1215
1265
|
// if all product card rendering functions after the initial rendering are synchronous the suspense boundary will never go into the fallback, so we don't know when they have finished rendering, and we can't block the suspense. Therefore, we're just doing it with this effect
|
|
@@ -1221,18 +1271,69 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
1221
1271
|
}));
|
|
1222
1272
|
return [
|
|
1223
1273
|
(0, $fc23d7668ae0011d$export$a2cc176055f8f08)(),
|
|
1224
|
-
(0, $diwD4$solidjsweb.
|
|
1225
|
-
get
|
|
1226
|
-
return
|
|
1274
|
+
(0, $diwD4$solidjsweb.createComponent)((0, $f48d0fbb00835aaa$export$d21e32dfedac04be), {
|
|
1275
|
+
get cols_at_size () {
|
|
1276
|
+
return modified_cols_at_size();
|
|
1227
1277
|
},
|
|
1228
|
-
get
|
|
1229
|
-
return
|
|
1278
|
+
get override_vertical_spacing () {
|
|
1279
|
+
return layout_options_().override_vertical_spacing;
|
|
1280
|
+
},
|
|
1281
|
+
get grid_spacing () {
|
|
1282
|
+
return layout_options_().grid_spacing;
|
|
1283
|
+
},
|
|
1284
|
+
rows: "all",
|
|
1285
|
+
layout: "grid",
|
|
1286
|
+
element_attributes: {
|
|
1287
|
+
class: "cards"
|
|
1230
1288
|
},
|
|
1231
1289
|
get children () {
|
|
1232
|
-
return
|
|
1290
|
+
return (0, $diwD4$solidjsweb.createComponent)((0, $diwD4$solidjs.Show), {
|
|
1291
|
+
get when () {
|
|
1292
|
+
return !is_loading_();
|
|
1293
|
+
},
|
|
1294
|
+
get fallback () {
|
|
1295
|
+
return rendered_placeholders();
|
|
1296
|
+
},
|
|
1297
|
+
get children () {
|
|
1298
|
+
return (0, $diwD4$solidjsweb.createComponent)((0, $diwD4$solidjs.Suspense), {
|
|
1299
|
+
get fallback () {
|
|
1300
|
+
return (()=>{
|
|
1301
|
+
fallback_is_alive = true;
|
|
1302
|
+
(0, $diwD4$solidjs.onCleanup)(block_suspense_if_needed); // Block suspense after initial run every time after we fetch
|
|
1303
|
+
return (0, $diwD4$solidjs.createMemo)(()=>{
|
|
1304
|
+
// We need to be able to block the suspense since when async product cards are *rendering* we want to show the placeholders on initial load but not when loading more
|
|
1305
|
+
// In future we could have individual suspense's for each product card, but that's too much for now
|
|
1306
|
+
if (get_suspense_is_blocked()) return suspense_contents;
|
|
1307
|
+
set_should_have_placeholders_rendered(true); // just in case
|
|
1308
|
+
(0, $diwD4$solidjs.onCleanup)(()=>set_should_have_placeholders_rendered(false));
|
|
1309
|
+
return rendered_placeholders; // I lifted the placeholders into the memo since we don't want to re-render them when switching from <Show> to <Suspense>
|
|
1310
|
+
});
|
|
1311
|
+
})();
|
|
1312
|
+
},
|
|
1313
|
+
get children () {
|
|
1314
|
+
return (()=>{
|
|
1315
|
+
suspense_contents = (0, $ac167f6af6a48fc3$export$a1fd619a4743ca08)({
|
|
1316
|
+
product_card_template_: product_card_template_,
|
|
1317
|
+
plp_results_: plp_results_,
|
|
1318
|
+
last_result_in_viewport_: last_result_in_viewport_,
|
|
1319
|
+
first_result_in_viewport_: first_result_in_viewport_,
|
|
1320
|
+
market_: market_,
|
|
1321
|
+
merchant_: merchant_,
|
|
1322
|
+
all_products_loaded_: all_products_loaded_,
|
|
1323
|
+
min_products_to_fetch_: min_products_to_fetch_,
|
|
1324
|
+
query_base_: query_base_,
|
|
1325
|
+
depict_api_: depict_api_,
|
|
1326
|
+
is_loading_: is_loading_
|
|
1327
|
+
});
|
|
1328
|
+
(0, $diwD4$solidjs.onCleanup)(()=>suspense_contents = undefined);
|
|
1329
|
+
return suspense_contents;
|
|
1330
|
+
})();
|
|
1331
|
+
}
|
|
1332
|
+
});
|
|
1333
|
+
}
|
|
1334
|
+
});
|
|
1233
1335
|
}
|
|
1234
|
-
})
|
|
1235
|
-
(0, $diwD4$solidjsweb.ssr)($fe76fb463cc60b89$var$_tmpl$3, (0, $diwD4$solidjsweb.ssrHydrationKey)(), get_styling())
|
|
1336
|
+
})
|
|
1236
1337
|
];
|
|
1237
1338
|
}
|
|
1238
1339
|
});
|
|
@@ -1240,13 +1341,14 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
1240
1341
|
})), (0, $diwD4$solidjsweb.escape)(desktop_filter_elements_()));
|
|
1241
1342
|
}
|
|
1242
1343
|
/**
|
|
1243
|
-
*
|
|
1344
|
+
* Changes cols_at_size depending on if filters are open or not so one card less is shown when the filters are open
|
|
1244
1345
|
* This function is special to the actual PLPResults.
|
|
1245
|
-
*/ function $fe76fb463cc60b89$var$
|
|
1246
|
-
(0, $diwD4$solidjs.
|
|
1346
|
+
*/ function $fe76fb463cc60b89$var$make_modified_cols_at_size({ layout_options_: layout_options_ , sort_or_filter_open_: sort_or_filter_open_ }) {
|
|
1347
|
+
return (0, $diwD4$solidjs.createMemo)(()=>{
|
|
1348
|
+
const layout_options = layout_options_();
|
|
1247
1349
|
// Add grid styling that changes when filters get opened/closed
|
|
1248
|
-
const when_filters_closed_cols =
|
|
1249
|
-
|
|
1350
|
+
const when_filters_closed_cols = layout_options.cols_at_size;
|
|
1351
|
+
return sort_or_filter_open_() ? when_filters_closed_cols.map((row)=>{
|
|
1250
1352
|
const [num_cols_default, , , , override_cols] = row;
|
|
1251
1353
|
const cloned_row = [
|
|
1252
1354
|
...row
|
|
@@ -1262,8 +1364,6 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
1262
1364
|
};
|
|
1263
1365
|
return cloned_row;
|
|
1264
1366
|
}) : when_filters_closed_cols;
|
|
1265
|
-
const css = (0, $diwD4$depictaiutilishared.n_col_styling_with_dist)(selector_beginning_, layout_options_.grid_spacing, cols_at_size, "grid", layout_options_.override_vertical_spacing);
|
|
1266
|
-
set_styling_(css);
|
|
1267
1367
|
});
|
|
1268
1368
|
}
|
|
1269
1369
|
|
|
@@ -5392,15 +5492,19 @@ class $48567ac5b39bac56$export$f34314aa9505732e {
|
|
|
5392
5492
|
});
|
|
5393
5493
|
}
|
|
5394
5494
|
}
|
|
5395
|
-
function $48567ac5b39bac56$export$e2bf8ce7779e827e(
|
|
5495
|
+
function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
|
|
5496
|
+
const { depict_category: depict_category , product_card_template: product_card_template , category_title: category_title } = props;
|
|
5396
5497
|
const shared_properties = $48567ac5b39bac56$var$get_shared_properties(depict_category);
|
|
5397
|
-
const grid_spacing_override = typeof grid_spacing === "string" ? {
|
|
5398
|
-
grid_spacing: grid_spacing
|
|
5399
|
-
} : {
|
|
5400
|
-
override_vertical_spacing: grid_spacing.vertical,
|
|
5401
|
-
grid_spacing: grid_spacing.horizontal
|
|
5402
|
-
};
|
|
5403
5498
|
return (0, $95837413165cc2df$export$23fca46f3143581f)(()=>{
|
|
5499
|
+
const grid_spacing_override = (0, $diwD4$solidjs.createMemo)(()=>{
|
|
5500
|
+
const { grid_spacing: grid_spacing } = props; // can be reactive
|
|
5501
|
+
return typeof grid_spacing === "string" ? {
|
|
5502
|
+
grid_spacing: grid_spacing
|
|
5503
|
+
} : {
|
|
5504
|
+
override_vertical_spacing: grid_spacing.vertical,
|
|
5505
|
+
grid_spacing: grid_spacing.horizontal
|
|
5506
|
+
};
|
|
5507
|
+
});
|
|
5404
5508
|
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;
|
|
5405
5509
|
(0, $diwD4$solidjs.onCleanup)(reset_history_state_);
|
|
5406
5510
|
return (0, $840d88a04b2d22a7$export$f7d2f673fc2f091d)({
|
|
@@ -5412,9 +5516,9 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e({ depict_category: depict_cat
|
|
|
5412
5516
|
query_id_: ()=>depict_category.category_id,
|
|
5413
5517
|
listing_type_: ()=>depict_category.listing_type,
|
|
5414
5518
|
i18n_: i18n_,
|
|
5415
|
-
show_quicklinks_: show_quicklinks,
|
|
5519
|
+
show_quicklinks_: (0, $diwD4$solidjs.createMemo)(()=>props.show_quicklinks ?? true),
|
|
5416
5520
|
category_title_: category_title,
|
|
5417
|
-
show_breadcrumbs_: show_breadcrumbs,
|
|
5521
|
+
show_breadcrumbs_: (0, $diwD4$solidjs.createMemo)(()=>props.show_breadcrumbs ?? true),
|
|
5418
5522
|
current_sorting_: current_sorting_,
|
|
5419
5523
|
router_: router_,
|
|
5420
5524
|
get_breadcrumb_accessor_: (accessor)=>(0, $diwD4$solidjs.createComputed)(()=>breadcrumb_signal_[1](accessor())),
|
|
@@ -5426,10 +5530,10 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e({ depict_category: depict_cat
|
|
|
5426
5530
|
selected_filters_: selected_filters_,
|
|
5427
5531
|
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
5428
5532
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
5429
|
-
layout_options_: {
|
|
5430
|
-
|
|
5431
|
-
|
|
5432
|
-
|
|
5533
|
+
layout_options_: (0, $diwD4$solidjs.createMemo)(()=>({
|
|
5534
|
+
cols_at_size: (0, $4e04be41243c3d80$export$6daf8749b65a1b77)(props.cols_at_size),
|
|
5535
|
+
...grid_spacing_override()
|
|
5536
|
+
})),
|
|
5433
5537
|
product_card_template_: product_card_template
|
|
5434
5538
|
});
|
|
5435
5539
|
}, "Entire CategoryPage failed");
|
|
@@ -5826,17 +5930,14 @@ function $66b8b9a9613c141d$export$b94867ecbd698f21({ search_field_value_: search
|
|
|
5826
5930
|
|
|
5827
5931
|
|
|
5828
5932
|
|
|
5933
|
+
|
|
5829
5934
|
const $fb29c6201c369e39$var$_tmpl$ = [
|
|
5830
|
-
"<div",
|
|
5831
|
-
' class="cards">',
|
|
5832
|
-
"</div>"
|
|
5833
|
-
], $fb29c6201c369e39$var$_tmpl$2 = [
|
|
5834
5935
|
"<div",
|
|
5835
5936
|
' class="search-recs"><h3 class="search-recs-title">',
|
|
5836
5937
|
"</h3><!--#-->",
|
|
5837
5938
|
"<!--/--><!--#-->",
|
|
5838
5939
|
"<!--/--></div>"
|
|
5839
|
-
], $fb29c6201c369e39$var$_tmpl$
|
|
5940
|
+
], $fb29c6201c369e39$var$_tmpl$2 = [
|
|
5840
5941
|
"<button",
|
|
5841
5942
|
' class="show-more major" type="button">',
|
|
5842
5943
|
"</button>"
|
|
@@ -5847,59 +5948,58 @@ function $fb29c6201c369e39$export$7de92c4c2205ebf3({ depict_api_: depict_api_ ,
|
|
|
5847
5948
|
const rows_object = view_more_button_ ? $fb29c6201c369e39$var$make_state_saved_rows(showing_recommendation_rows_, i18n_) : "all";
|
|
5848
5949
|
const [recommendations_resource] = (0, $diwD4$solidjs.createResource)(search_query_base_, (query)=>depict_api_.get_recommended(query).then((r)=>r.displays));
|
|
5849
5950
|
const is_showing_something = (0, $diwD4$solidjs.createMemo)(()=>recommendations_resource.loading || recommendations_resource()?.length);
|
|
5850
|
-
const num_placeholders_ = (0, $diwD4$solidjs.createMemo)(()=>(0, $aec24316ed262dc0$export$6c9030e511152266) + get_showing_recommendation_rows() * Math.max(...layout_options_.cols_at_size.map(([per_column])=>per_column)));
|
|
5851
|
-
const cards = (0, $diwD4$solidjsweb.ssr)($fb29c6201c369e39$var$_tmpl$, (0, $diwD4$solidjsweb.ssrHydrationKey)(), (0, $diwD4$solidjsweb.escape)((0, $diwD4$solidjsweb.createComponent)((0, $diwD4$solidjs.Suspense), {
|
|
5852
|
-
get fallback () {
|
|
5853
|
-
return (0, $0caf87eaa19079da$export$f33414a4df0afd3f)({
|
|
5854
|
-
num_placeholders_: num_placeholders_,
|
|
5855
|
-
product_card_template_: product_card_template_
|
|
5856
|
-
});
|
|
5857
|
-
},
|
|
5858
|
-
get children () {
|
|
5859
|
-
return (()=>{
|
|
5860
|
-
// IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
|
|
5861
|
-
const displays_by_key_ = (0, $a73063cc642f3e5f$export$7f8bd308237ab5a5)((0, $diwD4$solidjs.createMemo)(()=>recommendations_resource() || []));
|
|
5862
|
-
return (0, $a73063cc642f3e5f$export$43f0fb951fcb0c54)({
|
|
5863
|
-
displays_by_key_: displays_by_key_,
|
|
5864
|
-
merchant_: (0, $diwD4$solidjs.createMemo)(()=>search_query_base_().tenant),
|
|
5865
|
-
market_: (0, $diwD4$solidjs.createMemo)(()=>search_query_base_().market),
|
|
5866
|
-
product_card_template_: product_card_template_
|
|
5867
|
-
});
|
|
5868
|
-
})();
|
|
5869
|
-
}
|
|
5870
|
-
})));
|
|
5871
|
-
const search_recs_elements = (0, $diwD4$solidjsweb.ssr)($fb29c6201c369e39$var$_tmpl$2, (0, $diwD4$solidjsweb.ssrHydrationKey)(), (0, $diwD4$solidjsweb.escape)(i18n_.search_recs_title_()), (0, $diwD4$solidjsweb.escape)((0, $fc23d7668ae0011d$export$a2cc176055f8f08)()), (0, $diwD4$solidjsweb.escape)(cards));
|
|
5872
|
-
// the cards element must have a parent for Layout to work, therefore we're inserting it into a div above
|
|
5873
|
-
(0, $diwD4$depictaiutilishared.Layout)({
|
|
5874
|
-
container_element: cards,
|
|
5875
|
-
layout: "grid",
|
|
5876
|
-
rows: rows_object,
|
|
5877
|
-
...layout_options_
|
|
5878
|
-
}).catch((e)=>(0, $diwD4$depictaiutilishared.report)([
|
|
5879
|
-
e,
|
|
5880
|
-
"Layout failed"
|
|
5881
|
-
], "error"));
|
|
5951
|
+
const num_placeholders_ = (0, $diwD4$solidjs.createMemo)(()=>(0, $aec24316ed262dc0$export$6c9030e511152266) + get_showing_recommendation_rows() * Math.max(...layout_options_().cols_at_size.map(([per_column])=>per_column)));
|
|
5882
5952
|
return (0, $diwD4$solidjsweb.createComponent)((0, $diwD4$solidjs.Show), {
|
|
5883
5953
|
get when () {
|
|
5884
5954
|
return is_showing_something();
|
|
5885
5955
|
},
|
|
5886
|
-
children
|
|
5956
|
+
get children () {
|
|
5957
|
+
return (0, $diwD4$solidjsweb.ssr)($fb29c6201c369e39$var$_tmpl$, (0, $diwD4$solidjsweb.ssrHydrationKey)(), (0, $diwD4$solidjsweb.escape)(i18n_.search_recs_title_()), (0, $diwD4$solidjsweb.escape)((0, $fc23d7668ae0011d$export$a2cc176055f8f08)()), (0, $diwD4$solidjsweb.escape)((0, $diwD4$solidjsweb.createComponent)((0, $f48d0fbb00835aaa$export$d21e32dfedac04be), (0, $diwD4$solidjsweb.mergeProps)({
|
|
5958
|
+
rows: rows_object,
|
|
5959
|
+
layout: "grid",
|
|
5960
|
+
element_attributes: {
|
|
5961
|
+
class: "cards"
|
|
5962
|
+
}
|
|
5963
|
+
}, layout_options_, {
|
|
5964
|
+
get children () {
|
|
5965
|
+
return (0, $diwD4$solidjsweb.createComponent)((0, $diwD4$solidjs.Suspense), {
|
|
5966
|
+
get fallback () {
|
|
5967
|
+
return (0, $0caf87eaa19079da$export$f33414a4df0afd3f)({
|
|
5968
|
+
num_placeholders_: num_placeholders_,
|
|
5969
|
+
product_card_template_: product_card_template_
|
|
5970
|
+
});
|
|
5971
|
+
},
|
|
5972
|
+
get children () {
|
|
5973
|
+
return (()=>{
|
|
5974
|
+
// IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
|
|
5975
|
+
const displays_by_key_ = (0, $a73063cc642f3e5f$export$7f8bd308237ab5a5)((0, $diwD4$solidjs.createMemo)(()=>recommendations_resource() || []));
|
|
5976
|
+
return (0, $a73063cc642f3e5f$export$43f0fb951fcb0c54)({
|
|
5977
|
+
displays_by_key_: displays_by_key_,
|
|
5978
|
+
merchant_: (0, $diwD4$solidjs.createMemo)(()=>search_query_base_().tenant),
|
|
5979
|
+
market_: (0, $diwD4$solidjs.createMemo)(()=>search_query_base_().market),
|
|
5980
|
+
product_card_template_: product_card_template_
|
|
5981
|
+
});
|
|
5982
|
+
})();
|
|
5983
|
+
}
|
|
5984
|
+
});
|
|
5985
|
+
}
|
|
5986
|
+
}))));
|
|
5987
|
+
}
|
|
5887
5988
|
});
|
|
5888
5989
|
}
|
|
5889
5990
|
function $fb29c6201c369e39$var$make_state_saved_rows([get_showing_recommendation_rows, set_showing_recommendation_rows], i18n_) {
|
|
5890
|
-
const
|
|
5991
|
+
const currently_visible = (0, $diwD4$solidjs.createSignal)(0); // this number shouldn't matter for anything except typing
|
|
5992
|
+
const [get_currently_visible, set_currently_visible] = currently_visible;
|
|
5891
5993
|
const rows = {
|
|
5892
|
-
|
|
5994
|
+
currently_visible: currently_visible,
|
|
5893
5995
|
start_rows: (0, $diwD4$solidjs.untrack)(get_showing_recommendation_rows) ?? $fb29c6201c369e39$export$1c8c715550dc689d,
|
|
5894
5996
|
rows_per_click: 3,
|
|
5895
|
-
button: (0, $diwD4$solidjsweb.ssr)($fb29c6201c369e39$var$_tmpl$
|
|
5997
|
+
button: (0, $diwD4$solidjsweb.ssr)($fb29c6201c369e39$var$_tmpl$2, (0, $diwD4$solidjsweb.ssrHydrationKey)(), (0, $diwD4$solidjsweb.escape)(i18n_.view_more_()))
|
|
5896
5998
|
};
|
|
5897
|
-
(0, $diwD4$
|
|
5898
|
-
|
|
5899
|
-
})
|
|
5900
|
-
(0, $diwD4$solidjs.createComputed)((0, $diwD4$solidjs.on)(get_showing_recommendation_rows, (new_rows = $fb29c6201c369e39$export$1c8c715550dc689d)=>{
|
|
5901
|
-
if (ipns.latest_call_value !== new_rows && ipns.state !== new_rows) ipns(new_rows);
|
|
5902
|
-
}, {
|
|
5999
|
+
(0, $diwD4$solidjs.createComputed)((0, $diwD4$solidjs.on)(get_currently_visible, (new_visible)=>set_showing_recommendation_rows(new_visible), {
|
|
6000
|
+
defer: true
|
|
6001
|
+
}));
|
|
6002
|
+
(0, $diwD4$solidjs.createComputed)((0, $diwD4$solidjs.on)(get_showing_recommendation_rows, (new_rows = $fb29c6201c369e39$export$1c8c715550dc689d)=>set_currently_visible(new_rows), {
|
|
5903
6003
|
defer: true
|
|
5904
6004
|
}));
|
|
5905
6005
|
return rows;
|
|
@@ -7199,7 +7299,7 @@ const $f1d7cb69f839a526$var$_tmpl$ = [
|
|
|
7199
7299
|
"<!--/--><!--#-->",
|
|
7200
7300
|
"<!--/--></div>"
|
|
7201
7301
|
];
|
|
7202
|
-
function $f1d7cb69f839a526$export$a54ec244c8863715({ 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_
|
|
7302
|
+
function $f1d7cb69f839a526$export$a54ec244c8863715({ 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_ , scroll_restoration_data_: scroll_restoration_data_ , product_card_template_: product_card_template_ , modal_body_style_ref_: modal_body_style_ref_ }) {
|
|
7203
7303
|
const [get_sorting] = current_sorting_;
|
|
7204
7304
|
const all_products_loaded_ = (0, $diwD4$solidjs.createSignal)(false);
|
|
7205
7305
|
const [get_all_products_loaded, set_all_products_loaded] = all_products_loaded_;
|
|
@@ -7435,7 +7535,9 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({ depict_api_: depict_api_ ,
|
|
|
7435
7535
|
depict_api_: depict_api_,
|
|
7436
7536
|
i18n_: i18n_,
|
|
7437
7537
|
search_query_base_: search_query_base_,
|
|
7438
|
-
layout_options_
|
|
7538
|
+
get layout_options_ () {
|
|
7539
|
+
return (0, $diwD4$solidjs.createMemo)(()=>recommendations_layout_options_?.() ?? layout_options_());
|
|
7540
|
+
},
|
|
7439
7541
|
showing_recommendation_rows_: showing_recommendation_rows_,
|
|
7440
7542
|
view_more_button_: search_recs_view_more_,
|
|
7441
7543
|
product_card_template_: product_card_template_
|
|
@@ -7724,16 +7826,19 @@ function $2c61e4cd8229c49a$var$get_shared_properties(depict_search) {
|
|
|
7724
7826
|
return shared_properties;
|
|
7725
7827
|
}
|
|
7726
7828
|
function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
|
|
7727
|
-
const { depict_search: depict_search ,
|
|
7829
|
+
const { depict_search: depict_search , product_card_template: product_card_template } = props;
|
|
7728
7830
|
const shared_properties = $2c61e4cd8229c49a$var$get_shared_properties(depict_search);
|
|
7729
|
-
const grid_spacing_override = typeof grid_spacing === "string" ? {
|
|
7730
|
-
grid_spacing: grid_spacing
|
|
7731
|
-
} : {
|
|
7732
|
-
override_vertical_spacing: grid_spacing.vertical,
|
|
7733
|
-
grid_spacing: grid_spacing.horizontal
|
|
7734
|
-
};
|
|
7735
7831
|
return (0, $95837413165cc2df$export$23fca46f3143581f)(()=>{
|
|
7736
7832
|
const { state_: state_ } = shared_properties;
|
|
7833
|
+
const grid_spacing_override = (0, $diwD4$solidjs.createMemo)(()=>{
|
|
7834
|
+
const { grid_spacing: grid_spacing } = props; // can be reactive
|
|
7835
|
+
return typeof grid_spacing === "string" ? {
|
|
7836
|
+
grid_spacing: grid_spacing
|
|
7837
|
+
} : {
|
|
7838
|
+
override_vertical_spacing: grid_spacing.vertical,
|
|
7839
|
+
grid_spacing: grid_spacing.horizontal
|
|
7840
|
+
};
|
|
7841
|
+
});
|
|
7737
7842
|
(0, $diwD4$solidjs.onCleanup)(shared_properties.reset_history_state_);
|
|
7738
7843
|
return (0, $f1d7cb69f839a526$export$a54ec244c8863715)({
|
|
7739
7844
|
input_modal_open_: ()=>!!depict_search.modal_open,
|
|
@@ -7779,19 +7884,23 @@ function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
|
|
|
7779
7884
|
showing_recommendation_rows_: state_.search_showing_recommendation_rows,
|
|
7780
7885
|
scroll_restoration_data_: state_.search_scroll_restoration_data,
|
|
7781
7886
|
include_input_field_: ()=>props.include_input_field,
|
|
7782
|
-
layout_options_: {
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
recommendations_layout_options_:
|
|
7787
|
-
|
|
7788
|
-
|
|
7789
|
-
|
|
7887
|
+
layout_options_: (0, $diwD4$solidjs.createMemo)(()=>({
|
|
7888
|
+
cols_at_size: (0, $4e04be41243c3d80$export$6daf8749b65a1b77)(props.cols_at_size),
|
|
7889
|
+
...grid_spacing_override()
|
|
7890
|
+
})),
|
|
7891
|
+
recommendations_layout_options_: (0, $diwD4$solidjs.createMemo)(()=>{
|
|
7892
|
+
const { extra_depict_options: extra_depict_options } = props;
|
|
7893
|
+
return extra_depict_options?.recommendations_cols_at_size ? {
|
|
7894
|
+
cols_at_size: (0, $4e04be41243c3d80$export$6daf8749b65a1b77)(extra_depict_options.recommendations_cols_at_size),
|
|
7895
|
+
...grid_spacing_override()
|
|
7896
|
+
} : undefined;
|
|
7897
|
+
}),
|
|
7790
7898
|
product_card_template_: product_card_template
|
|
7791
7899
|
});
|
|
7792
7900
|
}, "Entire SearchPage failed");
|
|
7793
7901
|
}
|
|
7794
|
-
function $2c61e4cd8229c49a$export$316f6f283ae64765(
|
|
7902
|
+
function $2c61e4cd8229c49a$export$316f6f283ae64765(props) {
|
|
7903
|
+
const { depict_search: depict_search , modal_dispose_handler: modal_dispose_handler , click_handler: click_handler } = props;
|
|
7795
7904
|
const shared_properties = $2c61e4cd8229c49a$var$get_shared_properties(depict_search);
|
|
7796
7905
|
return (0, $95837413165cc2df$export$23fca46f3143581f)(()=>{
|
|
7797
7906
|
let input_element;
|
|
@@ -7820,7 +7929,7 @@ function $2c61e4cd8229c49a$export$316f6f283ae64765({ depict_search: depict_searc
|
|
|
7820
7929
|
input_element.selectionStart,
|
|
7821
7930
|
input_element.selectionEnd
|
|
7822
7931
|
];
|
|
7823
|
-
const { cleanup: cleanup } = $2c61e4cd8229c49a$var$align_field_modal(style_props_, search_field, aligner_ref);
|
|
7932
|
+
const { cleanup: cleanup } = $2c61e4cd8229c49a$var$align_field_modal(style_props_, search_field, ()=>props.aligner_ref);
|
|
7824
7933
|
const complete_modal_dispose_handler = ()=>{
|
|
7825
7934
|
modal_dispose_handler?.();
|
|
7826
7935
|
cleanup();
|
|
@@ -7844,23 +7953,21 @@ function $2c61e4cd8229c49a$export$316f6f283ae64765({ depict_search: depict_searc
|
|
|
7844
7953
|
];
|
|
7845
7954
|
}, "SearchField failed");
|
|
7846
7955
|
}
|
|
7847
|
-
function $2c61e4cd8229c49a$var$align_field_modal(style_props_, input,
|
|
7956
|
+
function $2c61e4cd8229c49a$var$align_field_modal(style_props_, input, aligner_ref_accessor) {
|
|
7848
7957
|
return (0, $diwD4$solidjs.createRoot)((dispose)=>{
|
|
7849
|
-
|
|
7958
|
+
(0, $diwD4$solidjs.createComputed)(()=>{
|
|
7959
|
+
const aligner_ref = aligner_ref_accessor?.();
|
|
7960
|
+
if (!aligner_ref) {
|
|
7961
|
+
(0, $fd463ff0edb29915$export$b3ad617e9036868)(style_props_, input);
|
|
7962
|
+
return;
|
|
7963
|
+
}
|
|
7850
7964
|
const { cleanup: cleanup } = (0, $d8e94ea381ab57fa$export$828dcdd425fd3231)(aligner_ref);
|
|
7965
|
+
(0, $diwD4$solidjs.onCleanup)(cleanup);
|
|
7851
7966
|
(0, $fd463ff0edb29915$export$b3ad617e9036868)(style_props_, aligner_ref, undefined, false, "top");
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
}
|
|
7857
|
-
};
|
|
7858
|
-
} else {
|
|
7859
|
-
(0, $fd463ff0edb29915$export$b3ad617e9036868)(style_props_, input);
|
|
7860
|
-
return {
|
|
7861
|
-
cleanup: dispose
|
|
7862
|
-
};
|
|
7863
|
-
}
|
|
7967
|
+
});
|
|
7968
|
+
return {
|
|
7969
|
+
cleanup: dispose
|
|
7970
|
+
};
|
|
7864
7971
|
});
|
|
7865
7972
|
}
|
|
7866
7973
|
|