@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/client/main.cjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
var $57o7A$depictaiutilishared = require("@depict-ai/utilishared");
|
|
2
|
-
var $57o7A$solidjs = require("solid-js");
|
|
3
2
|
var $57o7A$solidjsweb = require("solid-js/web");
|
|
3
|
+
var $57o7A$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,12 +44,198 @@ $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
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
function $5f7d55c710fd1bc2$export$2f0cbfbb4354bb52(elements) {
|
|
66
|
+
// FYI this probably doesn't work on hugely deep nestings or large amount of elements
|
|
67
|
+
return (0, $57o7A$solidjs.createMemo)(()=>$5f7d55c710fd1bc2$var$unwrapping_helper(elements));
|
|
68
|
+
}
|
|
69
|
+
function $5f7d55c710fd1bc2$var$unwrapping_helper(elements) {
|
|
70
|
+
const result = [];
|
|
71
|
+
if (Array.isArray(elements)) for(let i = 0; i < elements.length; i++){
|
|
72
|
+
const element = elements[i];
|
|
73
|
+
result.push(...$5f7d55c710fd1bc2$var$unwrapping_helper(element));
|
|
74
|
+
}
|
|
75
|
+
else if (typeof elements == "function") result.push(...$5f7d55c710fd1bc2$var$unwrapping_helper(elements()));
|
|
76
|
+
else if (elements != undefined && typeof elements != "boolean") result.push(elements);
|
|
77
|
+
return result;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
47
82
|
|
|
48
83
|
|
|
49
84
|
|
|
50
85
|
|
|
51
86
|
|
|
87
|
+
|
|
88
|
+
// Errors caused by SDK consuming code interfacing with the SDK, not the SDK itself or other Depict packages
|
|
89
|
+
class $7dd1edb2ee2b43ad$export$e1d52e4f0c7557a1 extends Error {
|
|
90
|
+
}
|
|
91
|
+
class $7dd1edb2ee2b43ad$export$aa14a9f43128f61f extends $7dd1edb2ee2b43ad$export$e1d52e4f0c7557a1 {
|
|
92
|
+
constructor(templateError){
|
|
93
|
+
super("Uncaught error in product card template", {
|
|
94
|
+
cause: templateError
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
const $edafe91daf3091d7$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div></div>`, 2);
|
|
101
|
+
function $edafe91daf3091d7$export$b69d0d92862de18b(props) {
|
|
102
|
+
return (0, $57o7A$solidjs.ErrorBoundary)({
|
|
103
|
+
fallback (err, retry) {
|
|
104
|
+
const { message_: message_ , severity_: severity_ } = props;
|
|
105
|
+
let message = message_;
|
|
106
|
+
if (err instanceof (0, $7dd1edb2ee2b43ad$export$aa14a9f43128f61f)) {
|
|
107
|
+
console.error(err.cause);
|
|
108
|
+
message = `${message}: ${err.message}`;
|
|
109
|
+
} else (0, $57o7A$depictaiutilishared.report)([
|
|
110
|
+
err,
|
|
111
|
+
message_
|
|
112
|
+
], severity_);
|
|
113
|
+
props.on_error_?.(retry);
|
|
114
|
+
return (()=>{
|
|
115
|
+
const _el$ = (0, $57o7A$solidjsweb.getNextElement)($edafe91daf3091d7$var$_tmpl$);
|
|
116
|
+
(0, $57o7A$solidjsweb.insert)(_el$, message);
|
|
117
|
+
(0, $57o7A$solidjsweb.effect)((_$p)=>(0, $57o7A$solidjsweb.classList)(_el$, Object.fromEntries(props.class_list_?.map((c)=>[
|
|
118
|
+
c,
|
|
119
|
+
true
|
|
120
|
+
]) || []), _$p));
|
|
121
|
+
return _el$;
|
|
122
|
+
})();
|
|
123
|
+
},
|
|
124
|
+
get children () {
|
|
125
|
+
return props.children;
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
const $f48d0fbb00835aaa$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div></div>`, 2), $f48d0fbb00835aaa$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<style type="text/css"></style>`, 2);
|
|
132
|
+
function $f48d0fbb00835aaa$export$d21e32dfedac04be(props) {
|
|
133
|
+
return (0, $57o7A$solidjsweb.createComponent)((0, $edafe91daf3091d7$export$b69d0d92862de18b), {
|
|
134
|
+
get message_ () {
|
|
135
|
+
return "Failed calculating " + props.layout + " layout";
|
|
136
|
+
},
|
|
137
|
+
severity_: "error",
|
|
138
|
+
get children () {
|
|
139
|
+
return $f48d0fbb00835aaa$var$ActualSolidLayout(props);
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
function $f48d0fbb00835aaa$var$ActualSolidLayout(props) {
|
|
144
|
+
// Copy of Layout from utilishared but using solid-js signals instead of async iterable IPNS
|
|
145
|
+
const show_all_rows = (0, $57o7A$solidjs.createMemo)(()=>props.rows === "all");
|
|
146
|
+
const rows_or_empty_object = (0, $57o7A$solidjs.createMemo)(()=>show_all_rows() ? {} : props.rows);
|
|
147
|
+
const button_elements = (0, $5f7d55c710fd1bc2$export$2f0cbfbb4354bb52)((0, $57o7A$solidjs.createMemo)(()=>rows_or_empty_object().button));
|
|
148
|
+
const have_a_button = (0, $57o7A$solidjs.createMemo)(()=>{
|
|
149
|
+
const button = button_elements();
|
|
150
|
+
return !(!button || Array.isArray(button) && !button.length);
|
|
151
|
+
});
|
|
152
|
+
const [get_styling, set_styling] = (0, $57o7A$solidjs.createSignal)();
|
|
153
|
+
const container_class = (0, $57o7A$depictaiutilishared.make_random_classname)();
|
|
154
|
+
const selector_beginning = `.depict .${container_class}>`; // class so ppl can have id if needed
|
|
155
|
+
const container_element = (()=>{
|
|
156
|
+
const _el$ = (0, $57o7A$solidjsweb.getNextElement)($f48d0fbb00835aaa$var$_tmpl$);
|
|
157
|
+
(0, $57o7A$solidjsweb.spread)(_el$, (0, $57o7A$solidjsweb.mergeProps)(()=>props.element_attributes), false, true);
|
|
158
|
+
(0, $57o7A$solidjsweb.insert)(_el$, ()=>props.children);
|
|
159
|
+
(0, $57o7A$solidjsweb.runHydrationEvents)();
|
|
160
|
+
return _el$;
|
|
161
|
+
})();
|
|
162
|
+
const [get_children_count, set_children_count] = (0, $57o7A$solidjs.createSignal)(0);
|
|
163
|
+
const update_children_count = ()=>set_children_count(container_element.children.length);
|
|
164
|
+
const col_styling = (0, $57o7A$solidjs.createMemo)(()=>(0, $57o7A$depictaiutilishared.n_col_styling_with_dist)(selector_beginning, props.grid_spacing, props.cols_at_size, props.layout, props.override_vertical_spacing));
|
|
165
|
+
const default_currently_visible_signal = (0, $57o7A$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
|
|
166
|
+
const rows_visible_signal = (0, $57o7A$solidjs.createMemo)(()=>rows_or_empty_object().currently_visible || default_currently_visible_signal);
|
|
167
|
+
const get_rows_visible = (0, $57o7A$solidjs.createMemo)(()=>rows_visible_signal()[0]());
|
|
168
|
+
const set_rows_visible = (0, $57o7A$solidjs.createMemo)(()=>rows_visible_signal()[1]);
|
|
169
|
+
const button_class = (0, $57o7A$depictaiutilishared.make_random_classname)();
|
|
170
|
+
const button_container = (0, $57o7A$solidjs.createMemo)(()=>have_a_button() && (()=>{
|
|
171
|
+
const _el$2 = (0, $57o7A$solidjsweb.getNextElement)($f48d0fbb00835aaa$var$_tmpl$);
|
|
172
|
+
(0, $57o7A$solidjsweb.addEventListener)(_el$2, "click", (0, $57o7A$depictaiutilishared.catchify)(()=>set_rows_visible()((prev)=>prev + (rows_or_empty_object().rows_per_click ?? 1))), true);
|
|
173
|
+
(0, $57o7A$solidjsweb.className)(_el$2, "load-more-container " + button_class);
|
|
174
|
+
(0, $57o7A$solidjsweb.insert)(_el$2, ()=>rows_or_empty_object().button);
|
|
175
|
+
(0, $57o7A$solidjsweb.runHydrationEvents)();
|
|
176
|
+
return _el$2;
|
|
177
|
+
})());
|
|
178
|
+
container_element.classList.add(container_class);
|
|
179
|
+
(0, $57o7A$solidjs.createComputed)(()=>{
|
|
180
|
+
// Make sure we don't have more rows visible than max_rows (this could happen by max_rows being decreased)
|
|
181
|
+
const rows_visible = get_rows_visible();
|
|
182
|
+
const max_rows = rows_or_empty_object().max_rows;
|
|
183
|
+
if (!isNaN(max_rows) && max_rows >= 0 && rows_visible > max_rows) set_rows_visible()(max_rows);
|
|
184
|
+
});
|
|
185
|
+
(0, $57o7A$solidjs.createRenderEffect)(()=>{
|
|
186
|
+
// Be careful to only read show_all_rows in here (ofc doesn't apply to nested effects)
|
|
187
|
+
if (show_all_rows()) {
|
|
188
|
+
// no view more functionality requested
|
|
189
|
+
set_styling(()=>col_styling);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
(0, $57o7A$solidjs.untrack)(()=>set_rows_visible()(rows_or_empty_object().start_rows ?? 1));
|
|
193
|
+
update_children_count();
|
|
194
|
+
const mutation_observer = new MutationObserver((0, $57o7A$depictaiutilishared.catchify)(update_children_count));
|
|
195
|
+
mutation_observer.observe(container_element, {
|
|
196
|
+
childList: true
|
|
197
|
+
});
|
|
198
|
+
(0, $57o7A$solidjs.onCleanup)(()=>mutation_observer.disconnect());
|
|
199
|
+
set_styling(// this is needed because solid will think that the memo-accessor is a setter function otherwise
|
|
200
|
+
()=>(0, $57o7A$solidjs.createMemo)(()=>{
|
|
201
|
+
const { rows_per_click: rows_per_click , max_rows: max_rows = -1 } = rows_or_empty_object();
|
|
202
|
+
const rows_visible = get_rows_visible();
|
|
203
|
+
const children_count = get_children_count();
|
|
204
|
+
return col_styling() + props.cols_at_size.map((options)=>{
|
|
205
|
+
const [, min, max] = options;
|
|
206
|
+
let should_hide_button;
|
|
207
|
+
let visible_recs;
|
|
208
|
+
if (props.disable_partial_rows) {
|
|
209
|
+
visible_recs = (0, $57o7A$depictaiutilishared.layout_get_visible_recs_without_partial_rows)(rows_visible, children_count, options);
|
|
210
|
+
const visible_recs_next_show_more = (0, $57o7A$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?
|
|
211
|
+
children_count, options);
|
|
212
|
+
should_hide_button = visible_recs === visible_recs_next_show_more;
|
|
213
|
+
} else {
|
|
214
|
+
visible_recs = (0, $57o7A$depictaiutilishared.layout_get_total_rec_amount_for_row)(rows_visible, options);
|
|
215
|
+
should_hide_button = visible_recs >= children_count;
|
|
216
|
+
}
|
|
217
|
+
const should_hide_button_final = button_class && (should_hide_button || max_rows !== -1 && rows_visible >= max_rows);
|
|
218
|
+
return `${(0, $57o7A$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}` : ``}}`;
|
|
219
|
+
}).join("");
|
|
220
|
+
}));
|
|
221
|
+
});
|
|
222
|
+
return [
|
|
223
|
+
container_element,
|
|
224
|
+
(0, $57o7A$solidjsweb.memo)(button_container),
|
|
225
|
+
(()=>{
|
|
226
|
+
const _el$3 = (0, $57o7A$solidjsweb.getNextElement)($f48d0fbb00835aaa$var$_tmpl$2);
|
|
227
|
+
(0, $57o7A$solidjsweb.insert)(_el$3, get_styling);
|
|
228
|
+
return _el$3;
|
|
229
|
+
})()
|
|
230
|
+
];
|
|
231
|
+
}
|
|
232
|
+
(0, $57o7A$solidjsweb.delegateEvents)([
|
|
233
|
+
"click"
|
|
234
|
+
]);
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
52
239
|
async function $9abb0a35d4b60ed3$export$79b1565500412d9b(search_modal, modal_fn_opts) {
|
|
53
240
|
const body = await (0, $57o7A$depictaiutilishared.observer).wait_for_element("body");
|
|
54
241
|
let dispose_and_remove;
|
|
@@ -710,8 +897,6 @@ function $401aee5f33dca9e2$export$83fd5de5504a7a67({ formatted_number_of_results
|
|
|
710
897
|
|
|
711
898
|
|
|
712
899
|
|
|
713
|
-
|
|
714
|
-
|
|
715
900
|
|
|
716
901
|
|
|
717
902
|
|
|
@@ -948,71 +1133,6 @@ function $fc23d7668ae0011d$export$a2cc176055f8f08() {
|
|
|
948
1133
|
|
|
949
1134
|
|
|
950
1135
|
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
// Errors caused by SDK consuming code interfacing with the SDK, not the SDK itself or other Depict packages
|
|
955
|
-
class $7dd1edb2ee2b43ad$export$e1d52e4f0c7557a1 extends Error {
|
|
956
|
-
}
|
|
957
|
-
class $7dd1edb2ee2b43ad$export$aa14a9f43128f61f extends $7dd1edb2ee2b43ad$export$e1d52e4f0c7557a1 {
|
|
958
|
-
constructor(templateError){
|
|
959
|
-
super("Uncaught error in product card template", {
|
|
960
|
-
cause: templateError
|
|
961
|
-
});
|
|
962
|
-
}
|
|
963
|
-
}
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
const $edafe91daf3091d7$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div></div>`, 2);
|
|
967
|
-
function $edafe91daf3091d7$export$b69d0d92862de18b(props) {
|
|
968
|
-
return (0, $57o7A$solidjs.ErrorBoundary)({
|
|
969
|
-
fallback (err, retry) {
|
|
970
|
-
const { message_: message_ , severity_: severity_ } = props;
|
|
971
|
-
let message = message_;
|
|
972
|
-
if (err instanceof (0, $7dd1edb2ee2b43ad$export$aa14a9f43128f61f)) {
|
|
973
|
-
console.error(err.cause);
|
|
974
|
-
message = `${message}: ${err.message}`;
|
|
975
|
-
} else (0, $57o7A$depictaiutilishared.report)([
|
|
976
|
-
err,
|
|
977
|
-
message_
|
|
978
|
-
], severity_);
|
|
979
|
-
props.on_error_?.(retry);
|
|
980
|
-
return (()=>{
|
|
981
|
-
const _el$ = (0, $57o7A$solidjsweb.getNextElement)($edafe91daf3091d7$var$_tmpl$);
|
|
982
|
-
(0, $57o7A$solidjsweb.insert)(_el$, message);
|
|
983
|
-
(0, $57o7A$solidjsweb.effect)((_$p)=>(0, $57o7A$solidjsweb.classList)(_el$, Object.fromEntries(props.class_list_?.map((c)=>[
|
|
984
|
-
c,
|
|
985
|
-
true
|
|
986
|
-
]) || []), _$p));
|
|
987
|
-
return _el$;
|
|
988
|
-
})();
|
|
989
|
-
},
|
|
990
|
-
get children () {
|
|
991
|
-
return props.children;
|
|
992
|
-
}
|
|
993
|
-
});
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
function $5f7d55c710fd1bc2$export$2f0cbfbb4354bb52(elements) {
|
|
1000
|
-
// FYI this probably doesn't work on hugely deep nestings or large amount of elements
|
|
1001
|
-
return (0, $57o7A$solidjs.createMemo)(()=>$5f7d55c710fd1bc2$var$unwrapping_helper(elements));
|
|
1002
|
-
}
|
|
1003
|
-
function $5f7d55c710fd1bc2$var$unwrapping_helper(elements) {
|
|
1004
|
-
const result = [];
|
|
1005
|
-
if (Array.isArray(elements)) for(let i = 0; i < elements.length; i++){
|
|
1006
|
-
const element = elements[i];
|
|
1007
|
-
result.push(...$5f7d55c710fd1bc2$var$unwrapping_helper(element));
|
|
1008
|
-
}
|
|
1009
|
-
else if (typeof elements == "function") result.push(...$5f7d55c710fd1bc2$var$unwrapping_helper(elements()));
|
|
1010
|
-
else if (elements != undefined && typeof elements != "boolean") result.push(elements);
|
|
1011
|
-
return result;
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
1136
|
let $0caf87eaa19079da$var$cached_placeholder_element;
|
|
1017
1137
|
let $0caf87eaa19079da$var$rendering_cached_placeholder_element;
|
|
1018
1138
|
function $0caf87eaa19079da$export$f33414a4df0afd3f({ product_card_template_: product_card_template_ , num_placeholders_: num_placeholders_ }) {
|
|
@@ -1326,7 +1446,8 @@ function $ac167f6af6a48fc3$export$a1fd619a4743ca08({ plp_results_: plp_results_
|
|
|
1326
1446
|
}
|
|
1327
1447
|
|
|
1328
1448
|
|
|
1329
|
-
|
|
1449
|
+
|
|
1450
|
+
const $fe76fb463cc60b89$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="PLP-results"><!#><!/><!#><!/></div>`, 6);
|
|
1330
1451
|
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_ }) {
|
|
1331
1452
|
// 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
|
|
1332
1453
|
const is_loading_ = (0, $57o7A$solidjs.createMemo)(()=>plp_results_.loading || query_base_.loading);
|
|
@@ -1369,9 +1490,6 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
1369
1490
|
let suspense_contents;
|
|
1370
1491
|
let is_just_after_plp_results_update = false;
|
|
1371
1492
|
let fallback_is_alive = false;
|
|
1372
|
-
const random_id = (0, $57o7A$depictaiutilishared.make_random_classname)();
|
|
1373
|
-
const selector_beginning_ = `.depict.plp #${random_id}>`;
|
|
1374
|
-
const [get_styling, set_styling_] = (0, $57o7A$solidjs.createSignal)("");
|
|
1375
1493
|
const [get_should_have_placeholders_rendered, set_should_have_placeholders_rendered] = (0, $57o7A$solidjs.createSignal)(true);
|
|
1376
1494
|
const rendered_placeholders = (0, $57o7A$solidjs.createMemo)(()=>get_should_have_placeholders_rendered() ? (0, $0caf87eaa19079da$export$f33414a4df0afd3f)({
|
|
1377
1495
|
product_card_template_: product_card_template_,
|
|
@@ -1381,64 +1499,22 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
1381
1499
|
})
|
|
1382
1500
|
}) : undefined);
|
|
1383
1501
|
const [get_suspense_is_blocked, set_suspense_is_blocked] = (0, $57o7A$solidjs.createSignal)(false);
|
|
1502
|
+
const modified_cols_at_size = $fe76fb463cc60b89$var$make_modified_cols_at_size({
|
|
1503
|
+
layout_options_: layout_options_,
|
|
1504
|
+
sort_or_filter_open_: sort_or_filter_open_
|
|
1505
|
+
});
|
|
1384
1506
|
(0, $57o7A$solidjs.createComputed)(()=>{
|
|
1385
1507
|
if (!is_loading_()) return;
|
|
1386
1508
|
set_should_have_placeholders_rendered(true);
|
|
1387
1509
|
set_suspense_is_blocked(false);
|
|
1388
1510
|
is_just_after_plp_results_update = true;
|
|
1389
1511
|
});
|
|
1390
|
-
$fe76fb463cc60b89$var$results_grid_styling_generator({
|
|
1391
|
-
layout_options_: layout_options_,
|
|
1392
|
-
set_styling_: set_styling_,
|
|
1393
|
-
sort_or_filter_open_: sort_or_filter_open_,
|
|
1394
|
-
selector_beginning_: selector_beginning_
|
|
1395
|
-
});
|
|
1396
|
-
const has_at_least_one_display = (0, $57o7A$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
|
|
1397
1512
|
const block_suspense_if_needed = ()=>{
|
|
1398
1513
|
if (!is_just_after_plp_results_update) return;
|
|
1399
1514
|
is_just_after_plp_results_update = false;
|
|
1400
1515
|
fallback_is_alive = false;
|
|
1401
1516
|
set_suspense_is_blocked(true);
|
|
1402
1517
|
};
|
|
1403
|
-
const non_placeholder_product_cards = (0, $57o7A$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)
|
|
1404
|
-
// We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
|
|
1405
|
-
// (For the whole idea of the displays being cached to work we can't tear down and re-run ProductCards for every new result.
|
|
1406
|
-
// We have to keep ProductCards alive, but hidden, and feed them new data as soon as we had it)
|
|
1407
|
-
(0, $57o7A$solidjsweb.createComponent)((0, $57o7A$solidjs.Suspense), {
|
|
1408
|
-
get fallback () {
|
|
1409
|
-
return (()=>{
|
|
1410
|
-
fallback_is_alive = true;
|
|
1411
|
-
(0, $57o7A$solidjs.onCleanup)(block_suspense_if_needed); // Block suspense after initial run every time after we fetch
|
|
1412
|
-
return (0, $57o7A$solidjs.createMemo)(()=>{
|
|
1413
|
-
// 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
|
|
1414
|
-
// In future we could have individual suspense's for each product card, but that's too much for now
|
|
1415
|
-
if (get_suspense_is_blocked()) return suspense_contents;
|
|
1416
|
-
set_should_have_placeholders_rendered(true); // just in case
|
|
1417
|
-
(0, $57o7A$solidjs.onCleanup)(()=>set_should_have_placeholders_rendered(false));
|
|
1418
|
-
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>
|
|
1419
|
-
});
|
|
1420
|
-
})();
|
|
1421
|
-
},
|
|
1422
|
-
get children () {
|
|
1423
|
-
return (()=>{
|
|
1424
|
-
suspense_contents = (0, $ac167f6af6a48fc3$export$a1fd619a4743ca08)({
|
|
1425
|
-
product_card_template_: product_card_template_,
|
|
1426
|
-
plp_results_: plp_results_,
|
|
1427
|
-
last_result_in_viewport_: last_result_in_viewport_,
|
|
1428
|
-
first_result_in_viewport_: first_result_in_viewport_,
|
|
1429
|
-
market_: market_,
|
|
1430
|
-
merchant_: merchant_,
|
|
1431
|
-
all_products_loaded_: all_products_loaded_,
|
|
1432
|
-
min_products_to_fetch_: min_products_to_fetch_,
|
|
1433
|
-
query_base_: query_base_,
|
|
1434
|
-
depict_api_: depict_api_,
|
|
1435
|
-
is_loading_: is_loading_
|
|
1436
|
-
});
|
|
1437
|
-
(0, $57o7A$solidjs.onCleanup)(()=>suspense_contents = undefined);
|
|
1438
|
-
return suspense_contents;
|
|
1439
|
-
})();
|
|
1440
|
-
}
|
|
1441
|
-
}));
|
|
1442
1518
|
(0, $57o7A$solidjs.createEffect)((0, $57o7A$solidjs.on)(plp_results_, ()=>{
|
|
1443
1519
|
if (!fallback_is_alive) {
|
|
1444
1520
|
// 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
|
|
@@ -1450,27 +1526,69 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
1450
1526
|
}));
|
|
1451
1527
|
return [
|
|
1452
1528
|
(0, $57o7A$solidjsweb.memo)((0, $fc23d7668ae0011d$export$a2cc176055f8f08)),
|
|
1453
|
-
(()
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1529
|
+
(0, $57o7A$solidjsweb.createComponent)((0, $f48d0fbb00835aaa$export$d21e32dfedac04be), {
|
|
1530
|
+
get cols_at_size () {
|
|
1531
|
+
return modified_cols_at_size();
|
|
1532
|
+
},
|
|
1533
|
+
get override_vertical_spacing () {
|
|
1534
|
+
return layout_options_().override_vertical_spacing;
|
|
1535
|
+
},
|
|
1536
|
+
get grid_spacing () {
|
|
1537
|
+
return layout_options_().grid_spacing;
|
|
1538
|
+
},
|
|
1539
|
+
rows: "all",
|
|
1540
|
+
layout: "grid",
|
|
1541
|
+
element_attributes: {
|
|
1542
|
+
class: "cards"
|
|
1543
|
+
},
|
|
1544
|
+
get children () {
|
|
1545
|
+
return (0, $57o7A$solidjsweb.createComponent)((0, $57o7A$solidjs.Show), {
|
|
1546
|
+
get when () {
|
|
1547
|
+
return !is_loading_();
|
|
1548
|
+
},
|
|
1549
|
+
get fallback () {
|
|
1550
|
+
return rendered_placeholders();
|
|
1551
|
+
},
|
|
1552
|
+
get children () {
|
|
1553
|
+
return (0, $57o7A$solidjsweb.createComponent)((0, $57o7A$solidjs.Suspense), {
|
|
1554
|
+
get fallback () {
|
|
1555
|
+
return (()=>{
|
|
1556
|
+
fallback_is_alive = true;
|
|
1557
|
+
(0, $57o7A$solidjs.onCleanup)(block_suspense_if_needed); // Block suspense after initial run every time after we fetch
|
|
1558
|
+
return (0, $57o7A$solidjs.createMemo)(()=>{
|
|
1559
|
+
// 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
|
|
1560
|
+
// In future we could have individual suspense's for each product card, but that's too much for now
|
|
1561
|
+
if (get_suspense_is_blocked()) return suspense_contents;
|
|
1562
|
+
set_should_have_placeholders_rendered(true); // just in case
|
|
1563
|
+
(0, $57o7A$solidjs.onCleanup)(()=>set_should_have_placeholders_rendered(false));
|
|
1564
|
+
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>
|
|
1565
|
+
});
|
|
1566
|
+
})();
|
|
1567
|
+
},
|
|
1568
|
+
get children () {
|
|
1569
|
+
return (()=>{
|
|
1570
|
+
suspense_contents = (0, $ac167f6af6a48fc3$export$a1fd619a4743ca08)({
|
|
1571
|
+
product_card_template_: product_card_template_,
|
|
1572
|
+
plp_results_: plp_results_,
|
|
1573
|
+
last_result_in_viewport_: last_result_in_viewport_,
|
|
1574
|
+
first_result_in_viewport_: first_result_in_viewport_,
|
|
1575
|
+
market_: market_,
|
|
1576
|
+
merchant_: merchant_,
|
|
1577
|
+
all_products_loaded_: all_products_loaded_,
|
|
1578
|
+
min_products_to_fetch_: min_products_to_fetch_,
|
|
1579
|
+
query_base_: query_base_,
|
|
1580
|
+
depict_api_: depict_api_,
|
|
1581
|
+
is_loading_: is_loading_
|
|
1582
|
+
});
|
|
1583
|
+
(0, $57o7A$solidjs.onCleanup)(()=>suspense_contents = undefined);
|
|
1584
|
+
return suspense_contents;
|
|
1585
|
+
})();
|
|
1586
|
+
}
|
|
1587
|
+
});
|
|
1588
|
+
}
|
|
1589
|
+
});
|
|
1590
|
+
}
|
|
1591
|
+
})
|
|
1474
1592
|
];
|
|
1475
1593
|
}
|
|
1476
1594
|
});
|
|
@@ -1482,13 +1600,14 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
1482
1600
|
})();
|
|
1483
1601
|
}
|
|
1484
1602
|
/**
|
|
1485
|
-
*
|
|
1603
|
+
* Changes cols_at_size depending on if filters are open or not so one card less is shown when the filters are open
|
|
1486
1604
|
* This function is special to the actual PLPResults.
|
|
1487
|
-
*/ function $fe76fb463cc60b89$var$
|
|
1488
|
-
(0, $57o7A$solidjs.
|
|
1605
|
+
*/ function $fe76fb463cc60b89$var$make_modified_cols_at_size({ layout_options_: layout_options_ , sort_or_filter_open_: sort_or_filter_open_ }) {
|
|
1606
|
+
return (0, $57o7A$solidjs.createMemo)(()=>{
|
|
1607
|
+
const layout_options = layout_options_();
|
|
1489
1608
|
// Add grid styling that changes when filters get opened/closed
|
|
1490
|
-
const when_filters_closed_cols =
|
|
1491
|
-
|
|
1609
|
+
const when_filters_closed_cols = layout_options.cols_at_size;
|
|
1610
|
+
return sort_or_filter_open_() ? when_filters_closed_cols.map((row)=>{
|
|
1492
1611
|
const [num_cols_default, , , , override_cols] = row;
|
|
1493
1612
|
const cloned_row = [
|
|
1494
1613
|
...row
|
|
@@ -1504,8 +1623,6 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
1504
1623
|
};
|
|
1505
1624
|
return cloned_row;
|
|
1506
1625
|
}) : when_filters_closed_cols;
|
|
1507
|
-
const css = (0, $57o7A$depictaiutilishared.n_col_styling_with_dist)(selector_beginning_, layout_options_.grid_spacing, cols_at_size, "grid", layout_options_.override_vertical_spacing);
|
|
1508
|
-
set_styling_(css);
|
|
1509
1626
|
});
|
|
1510
1627
|
}
|
|
1511
1628
|
|
|
@@ -6129,15 +6246,19 @@ class $48567ac5b39bac56$export$f34314aa9505732e {
|
|
|
6129
6246
|
});
|
|
6130
6247
|
}
|
|
6131
6248
|
}
|
|
6132
|
-
function $48567ac5b39bac56$export$e2bf8ce7779e827e(
|
|
6249
|
+
function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
|
|
6250
|
+
const { depict_category: depict_category , product_card_template: product_card_template , category_title: category_title } = props;
|
|
6133
6251
|
const shared_properties = $48567ac5b39bac56$var$get_shared_properties(depict_category);
|
|
6134
|
-
const grid_spacing_override = typeof grid_spacing === "string" ? {
|
|
6135
|
-
grid_spacing: grid_spacing
|
|
6136
|
-
} : {
|
|
6137
|
-
override_vertical_spacing: grid_spacing.vertical,
|
|
6138
|
-
grid_spacing: grid_spacing.horizontal
|
|
6139
|
-
};
|
|
6140
6252
|
return (0, $95837413165cc2df$export$23fca46f3143581f)(()=>{
|
|
6253
|
+
const grid_spacing_override = (0, $57o7A$solidjs.createMemo)(()=>{
|
|
6254
|
+
const { grid_spacing: grid_spacing } = props; // can be reactive
|
|
6255
|
+
return typeof grid_spacing === "string" ? {
|
|
6256
|
+
grid_spacing: grid_spacing
|
|
6257
|
+
} : {
|
|
6258
|
+
override_vertical_spacing: grid_spacing.vertical,
|
|
6259
|
+
grid_spacing: grid_spacing.horizontal
|
|
6260
|
+
};
|
|
6261
|
+
});
|
|
6141
6262
|
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;
|
|
6142
6263
|
(0, $57o7A$solidjs.onCleanup)(reset_history_state_);
|
|
6143
6264
|
return (0, $840d88a04b2d22a7$export$f7d2f673fc2f091d)({
|
|
@@ -6149,9 +6270,9 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e({ depict_category: depict_cat
|
|
|
6149
6270
|
query_id_: ()=>depict_category.category_id,
|
|
6150
6271
|
listing_type_: ()=>depict_category.listing_type,
|
|
6151
6272
|
i18n_: i18n_,
|
|
6152
|
-
show_quicklinks_: show_quicklinks,
|
|
6273
|
+
show_quicklinks_: (0, $57o7A$solidjs.createMemo)(()=>props.show_quicklinks ?? true),
|
|
6153
6274
|
category_title_: category_title,
|
|
6154
|
-
show_breadcrumbs_: show_breadcrumbs,
|
|
6275
|
+
show_breadcrumbs_: (0, $57o7A$solidjs.createMemo)(()=>props.show_breadcrumbs ?? true),
|
|
6155
6276
|
current_sorting_: current_sorting_,
|
|
6156
6277
|
router_: router_,
|
|
6157
6278
|
get_breadcrumb_accessor_: (accessor)=>(0, $57o7A$solidjs.createComputed)(()=>breadcrumb_signal_[1](accessor())),
|
|
@@ -6163,10 +6284,10 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e({ depict_category: depict_cat
|
|
|
6163
6284
|
selected_filters_: selected_filters_,
|
|
6164
6285
|
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
6165
6286
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
6166
|
-
layout_options_: {
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6287
|
+
layout_options_: (0, $57o7A$solidjs.createMemo)(()=>({
|
|
6288
|
+
cols_at_size: (0, $4e04be41243c3d80$export$6daf8749b65a1b77)(props.cols_at_size),
|
|
6289
|
+
...grid_spacing_override()
|
|
6290
|
+
})),
|
|
6170
6291
|
product_card_template_: product_card_template
|
|
6171
6292
|
});
|
|
6172
6293
|
}, "Entire CategoryPage failed");
|
|
@@ -6661,80 +6782,74 @@ function $66b8b9a9613c141d$export$b94867ecbd698f21({ search_field_value_: search
|
|
|
6661
6782
|
|
|
6662
6783
|
|
|
6663
6784
|
|
|
6664
|
-
|
|
6785
|
+
|
|
6786
|
+
const $fb29c6201c369e39$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="search-recs"><h3 class="search-recs-title"></h3><!#><!/><!#><!/></div>`, 8), $fb29c6201c369e39$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<button class="show-more major" type="button"></button>`, 2);
|
|
6665
6787
|
const $fb29c6201c369e39$export$1c8c715550dc689d = 2;
|
|
6666
6788
|
function $fb29c6201c369e39$export$7de92c4c2205ebf3({ depict_api_: depict_api_ , i18n_: i18n_ , search_query_base_: search_query_base_ , product_card_template_: product_card_template_ , showing_recommendation_rows_: showing_recommendation_rows_ , view_more_button_: view_more_button_ = true , layout_options_: layout_options_ }) {
|
|
6667
6789
|
const [get_showing_recommendation_rows] = showing_recommendation_rows_; // We reset this in after_submit in search.tsx FYI
|
|
6668
6790
|
const rows_object = view_more_button_ ? $fb29c6201c369e39$var$make_state_saved_rows(showing_recommendation_rows_, i18n_) : "all";
|
|
6669
6791
|
const [recommendations_resource] = (0, $57o7A$solidjs.createResource)(search_query_base_, (query)=>depict_api_.get_recommended(query).then((r)=>r.displays));
|
|
6670
6792
|
const is_showing_something = (0, $57o7A$solidjs.createMemo)(()=>recommendations_resource.loading || recommendations_resource()?.length);
|
|
6671
|
-
const num_placeholders_ = (0, $57o7A$solidjs.createMemo)(()=>(0, $aec24316ed262dc0$export$6c9030e511152266) + get_showing_recommendation_rows() * Math.max(...layout_options_.cols_at_size.map(([per_column])=>per_column)));
|
|
6672
|
-
const cards = (()=>{
|
|
6673
|
-
const _el$ = (0, $57o7A$solidjsweb.getNextElement)($fb29c6201c369e39$var$_tmpl$);
|
|
6674
|
-
(0, $57o7A$solidjsweb.insert)(_el$, (0, $57o7A$solidjsweb.createComponent)((0, $57o7A$solidjs.Suspense), {
|
|
6675
|
-
get fallback () {
|
|
6676
|
-
return (0, $0caf87eaa19079da$export$f33414a4df0afd3f)({
|
|
6677
|
-
num_placeholders_: num_placeholders_,
|
|
6678
|
-
product_card_template_: product_card_template_
|
|
6679
|
-
});
|
|
6680
|
-
},
|
|
6681
|
-
get children () {
|
|
6682
|
-
return (()=>{
|
|
6683
|
-
// IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
|
|
6684
|
-
const displays_by_key_ = (0, $a73063cc642f3e5f$export$7f8bd308237ab5a5)((0, $57o7A$solidjs.createMemo)(()=>recommendations_resource() || []));
|
|
6685
|
-
return (0, $a73063cc642f3e5f$export$43f0fb951fcb0c54)({
|
|
6686
|
-
displays_by_key_: displays_by_key_,
|
|
6687
|
-
merchant_: (0, $57o7A$solidjs.createMemo)(()=>search_query_base_().tenant),
|
|
6688
|
-
market_: (0, $57o7A$solidjs.createMemo)(()=>search_query_base_().market),
|
|
6689
|
-
product_card_template_: product_card_template_
|
|
6690
|
-
});
|
|
6691
|
-
})();
|
|
6692
|
-
}
|
|
6693
|
-
}));
|
|
6694
|
-
return _el$;
|
|
6695
|
-
})();
|
|
6696
|
-
const search_recs_elements = (()=>{
|
|
6697
|
-
const _el$2 = (0, $57o7A$solidjsweb.getNextElement)($fb29c6201c369e39$var$_tmpl$2), _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, [_el$5, _co$] = (0, $57o7A$solidjsweb.getNextMarker)(_el$4.nextSibling), _el$6 = _el$5.nextSibling, [_el$7, _co$2] = (0, $57o7A$solidjsweb.getNextMarker)(_el$6.nextSibling);
|
|
6698
|
-
(0, $57o7A$solidjsweb.insert)(_el$3, ()=>i18n_.search_recs_title_());
|
|
6699
|
-
(0, $57o7A$solidjsweb.insert)(_el$2, (0, $fc23d7668ae0011d$export$a2cc176055f8f08), _el$5, _co$);
|
|
6700
|
-
(0, $57o7A$solidjsweb.insert)(_el$2, cards, _el$7, _co$2);
|
|
6701
|
-
return _el$2;
|
|
6702
|
-
})();
|
|
6703
|
-
// the cards element must have a parent for Layout to work, therefore we're inserting it into a div above
|
|
6704
|
-
(0, $57o7A$depictaiutilishared.Layout)({
|
|
6705
|
-
container_element: cards,
|
|
6706
|
-
layout: "grid",
|
|
6707
|
-
rows: rows_object,
|
|
6708
|
-
...layout_options_
|
|
6709
|
-
}).catch((e)=>(0, $57o7A$depictaiutilishared.report)([
|
|
6710
|
-
e,
|
|
6711
|
-
"Layout failed"
|
|
6712
|
-
], "error"));
|
|
6793
|
+
const num_placeholders_ = (0, $57o7A$solidjs.createMemo)(()=>(0, $aec24316ed262dc0$export$6c9030e511152266) + get_showing_recommendation_rows() * Math.max(...layout_options_().cols_at_size.map(([per_column])=>per_column)));
|
|
6713
6794
|
return (0, $57o7A$solidjsweb.createComponent)((0, $57o7A$solidjs.Show), {
|
|
6714
6795
|
get when () {
|
|
6715
6796
|
return is_showing_something();
|
|
6716
6797
|
},
|
|
6717
|
-
children
|
|
6798
|
+
get children () {
|
|
6799
|
+
const _el$ = (0, $57o7A$solidjsweb.getNextElement)($fb29c6201c369e39$var$_tmpl$), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, [_el$4, _co$] = (0, $57o7A$solidjsweb.getNextMarker)(_el$3.nextSibling), _el$5 = _el$4.nextSibling, [_el$6, _co$2] = (0, $57o7A$solidjsweb.getNextMarker)(_el$5.nextSibling);
|
|
6800
|
+
(0, $57o7A$solidjsweb.insert)(_el$2, ()=>i18n_.search_recs_title_());
|
|
6801
|
+
(0, $57o7A$solidjsweb.insert)(_el$, (0, $fc23d7668ae0011d$export$a2cc176055f8f08), _el$4, _co$);
|
|
6802
|
+
(0, $57o7A$solidjsweb.insert)(_el$, (0, $57o7A$solidjsweb.createComponent)((0, $f48d0fbb00835aaa$export$d21e32dfedac04be), (0, $57o7A$solidjsweb.mergeProps)({
|
|
6803
|
+
rows: rows_object,
|
|
6804
|
+
layout: "grid",
|
|
6805
|
+
element_attributes: {
|
|
6806
|
+
class: "cards"
|
|
6807
|
+
}
|
|
6808
|
+
}, layout_options_, {
|
|
6809
|
+
get children () {
|
|
6810
|
+
return (0, $57o7A$solidjsweb.createComponent)((0, $57o7A$solidjs.Suspense), {
|
|
6811
|
+
get fallback () {
|
|
6812
|
+
return (0, $0caf87eaa19079da$export$f33414a4df0afd3f)({
|
|
6813
|
+
num_placeholders_: num_placeholders_,
|
|
6814
|
+
product_card_template_: product_card_template_
|
|
6815
|
+
});
|
|
6816
|
+
},
|
|
6817
|
+
get children () {
|
|
6818
|
+
return (()=>{
|
|
6819
|
+
// IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
|
|
6820
|
+
const displays_by_key_ = (0, $a73063cc642f3e5f$export$7f8bd308237ab5a5)((0, $57o7A$solidjs.createMemo)(()=>recommendations_resource() || []));
|
|
6821
|
+
return (0, $a73063cc642f3e5f$export$43f0fb951fcb0c54)({
|
|
6822
|
+
displays_by_key_: displays_by_key_,
|
|
6823
|
+
merchant_: (0, $57o7A$solidjs.createMemo)(()=>search_query_base_().tenant),
|
|
6824
|
+
market_: (0, $57o7A$solidjs.createMemo)(()=>search_query_base_().market),
|
|
6825
|
+
product_card_template_: product_card_template_
|
|
6826
|
+
});
|
|
6827
|
+
})();
|
|
6828
|
+
}
|
|
6829
|
+
});
|
|
6830
|
+
}
|
|
6831
|
+
})), _el$6, _co$2);
|
|
6832
|
+
return _el$;
|
|
6833
|
+
}
|
|
6718
6834
|
});
|
|
6719
6835
|
}
|
|
6720
6836
|
function $fb29c6201c369e39$var$make_state_saved_rows([get_showing_recommendation_rows, set_showing_recommendation_rows], i18n_) {
|
|
6721
|
-
const
|
|
6837
|
+
const currently_visible = (0, $57o7A$solidjs.createSignal)(0); // this number shouldn't matter for anything except typing
|
|
6838
|
+
const [get_currently_visible, set_currently_visible] = currently_visible;
|
|
6722
6839
|
const rows = {
|
|
6723
|
-
|
|
6840
|
+
currently_visible: currently_visible,
|
|
6724
6841
|
start_rows: (0, $57o7A$solidjs.untrack)(get_showing_recommendation_rows) ?? $fb29c6201c369e39$export$1c8c715550dc689d,
|
|
6725
6842
|
rows_per_click: 3,
|
|
6726
6843
|
button: (()=>{
|
|
6727
|
-
const _el$
|
|
6728
|
-
(0, $57o7A$solidjsweb.insert)(_el$
|
|
6729
|
-
return _el$
|
|
6844
|
+
const _el$7 = (0, $57o7A$solidjsweb.getNextElement)($fb29c6201c369e39$var$_tmpl$2);
|
|
6845
|
+
(0, $57o7A$solidjsweb.insert)(_el$7, ()=>i18n_.view_more_());
|
|
6846
|
+
return _el$7;
|
|
6730
6847
|
})()
|
|
6731
6848
|
};
|
|
6732
|
-
(0, $57o7A$
|
|
6733
|
-
|
|
6734
|
-
})
|
|
6735
|
-
(0, $57o7A$solidjs.createComputed)((0, $57o7A$solidjs.on)(get_showing_recommendation_rows, (new_rows = $fb29c6201c369e39$export$1c8c715550dc689d)=>{
|
|
6736
|
-
if (ipns.latest_call_value !== new_rows && ipns.state !== new_rows) ipns(new_rows);
|
|
6737
|
-
}, {
|
|
6849
|
+
(0, $57o7A$solidjs.createComputed)((0, $57o7A$solidjs.on)(get_currently_visible, (new_visible)=>set_showing_recommendation_rows(new_visible), {
|
|
6850
|
+
defer: true
|
|
6851
|
+
}));
|
|
6852
|
+
(0, $57o7A$solidjs.createComputed)((0, $57o7A$solidjs.on)(get_showing_recommendation_rows, (new_rows = $fb29c6201c369e39$export$1c8c715550dc689d)=>set_currently_visible(new_rows), {
|
|
6738
6853
|
defer: true
|
|
6739
6854
|
}));
|
|
6740
6855
|
return rows;
|
|
@@ -8187,7 +8302,7 @@ function $2005eec80e40088f$export$41b4894022a3580f({ style_props_: style_props_
|
|
|
8187
8302
|
|
|
8188
8303
|
|
|
8189
8304
|
const $f1d7cb69f839a526$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="filter-results-for-one-row"><!#><!/><!#><!/></div>`, 6), $f1d7cb69f839a526$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="depict plp search"><div class="listing-page"><!#><!/><!#><!/><!#><!/><!#><!/><!#><!/><!#><!/></div><!#><!/><!#><!/></div>`, 20);
|
|
8190
|
-
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_
|
|
8305
|
+
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_ }) {
|
|
8191
8306
|
const [get_sorting] = current_sorting_;
|
|
8192
8307
|
const all_products_loaded_ = (0, $57o7A$solidjs.createSignal)(false);
|
|
8193
8308
|
const [get_all_products_loaded, set_all_products_loaded] = all_products_loaded_;
|
|
@@ -8435,7 +8550,9 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({ depict_api_: depict_api_ ,
|
|
|
8435
8550
|
depict_api_: depict_api_,
|
|
8436
8551
|
i18n_: i18n_,
|
|
8437
8552
|
search_query_base_: search_query_base_,
|
|
8438
|
-
layout_options_
|
|
8553
|
+
get layout_options_ () {
|
|
8554
|
+
return (0, $57o7A$solidjs.createMemo)(()=>recommendations_layout_options_?.() ?? layout_options_());
|
|
8555
|
+
},
|
|
8439
8556
|
showing_recommendation_rows_: showing_recommendation_rows_,
|
|
8440
8557
|
view_more_button_: search_recs_view_more_,
|
|
8441
8558
|
product_card_template_: product_card_template_
|
|
@@ -8725,16 +8842,19 @@ function $2c61e4cd8229c49a$var$get_shared_properties(depict_search) {
|
|
|
8725
8842
|
return shared_properties;
|
|
8726
8843
|
}
|
|
8727
8844
|
function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
|
|
8728
|
-
const { depict_search: depict_search ,
|
|
8845
|
+
const { depict_search: depict_search , product_card_template: product_card_template } = props;
|
|
8729
8846
|
const shared_properties = $2c61e4cd8229c49a$var$get_shared_properties(depict_search);
|
|
8730
|
-
const grid_spacing_override = typeof grid_spacing === "string" ? {
|
|
8731
|
-
grid_spacing: grid_spacing
|
|
8732
|
-
} : {
|
|
8733
|
-
override_vertical_spacing: grid_spacing.vertical,
|
|
8734
|
-
grid_spacing: grid_spacing.horizontal
|
|
8735
|
-
};
|
|
8736
8847
|
return (0, $95837413165cc2df$export$23fca46f3143581f)(()=>{
|
|
8737
8848
|
const { state_: state_ } = shared_properties;
|
|
8849
|
+
const grid_spacing_override = (0, $57o7A$solidjs.createMemo)(()=>{
|
|
8850
|
+
const { grid_spacing: grid_spacing } = props; // can be reactive
|
|
8851
|
+
return typeof grid_spacing === "string" ? {
|
|
8852
|
+
grid_spacing: grid_spacing
|
|
8853
|
+
} : {
|
|
8854
|
+
override_vertical_spacing: grid_spacing.vertical,
|
|
8855
|
+
grid_spacing: grid_spacing.horizontal
|
|
8856
|
+
};
|
|
8857
|
+
});
|
|
8738
8858
|
(0, $57o7A$solidjs.onCleanup)(shared_properties.reset_history_state_);
|
|
8739
8859
|
return (0, $f1d7cb69f839a526$export$a54ec244c8863715)({
|
|
8740
8860
|
input_modal_open_: ()=>!!depict_search.modal_open,
|
|
@@ -8780,19 +8900,23 @@ function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
|
|
|
8780
8900
|
showing_recommendation_rows_: state_.search_showing_recommendation_rows,
|
|
8781
8901
|
scroll_restoration_data_: state_.search_scroll_restoration_data,
|
|
8782
8902
|
include_input_field_: ()=>props.include_input_field,
|
|
8783
|
-
layout_options_: {
|
|
8784
|
-
|
|
8785
|
-
|
|
8786
|
-
|
|
8787
|
-
recommendations_layout_options_:
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
|
|
8903
|
+
layout_options_: (0, $57o7A$solidjs.createMemo)(()=>({
|
|
8904
|
+
cols_at_size: (0, $4e04be41243c3d80$export$6daf8749b65a1b77)(props.cols_at_size),
|
|
8905
|
+
...grid_spacing_override()
|
|
8906
|
+
})),
|
|
8907
|
+
recommendations_layout_options_: (0, $57o7A$solidjs.createMemo)(()=>{
|
|
8908
|
+
const { extra_depict_options: extra_depict_options } = props;
|
|
8909
|
+
return extra_depict_options?.recommendations_cols_at_size ? {
|
|
8910
|
+
cols_at_size: (0, $4e04be41243c3d80$export$6daf8749b65a1b77)(extra_depict_options.recommendations_cols_at_size),
|
|
8911
|
+
...grid_spacing_override()
|
|
8912
|
+
} : undefined;
|
|
8913
|
+
}),
|
|
8791
8914
|
product_card_template_: product_card_template
|
|
8792
8915
|
});
|
|
8793
8916
|
}, "Entire SearchPage failed");
|
|
8794
8917
|
}
|
|
8795
|
-
function $2c61e4cd8229c49a$export$316f6f283ae64765(
|
|
8918
|
+
function $2c61e4cd8229c49a$export$316f6f283ae64765(props) {
|
|
8919
|
+
const { depict_search: depict_search , modal_dispose_handler: modal_dispose_handler , click_handler: click_handler } = props;
|
|
8796
8920
|
const shared_properties = $2c61e4cd8229c49a$var$get_shared_properties(depict_search);
|
|
8797
8921
|
return (0, $95837413165cc2df$export$23fca46f3143581f)(()=>{
|
|
8798
8922
|
let input_element;
|
|
@@ -8821,7 +8945,7 @@ function $2c61e4cd8229c49a$export$316f6f283ae64765({ depict_search: depict_searc
|
|
|
8821
8945
|
input_element.selectionStart,
|
|
8822
8946
|
input_element.selectionEnd
|
|
8823
8947
|
];
|
|
8824
|
-
const { cleanup: cleanup } = $2c61e4cd8229c49a$var$align_field_modal(style_props_, search_field, aligner_ref);
|
|
8948
|
+
const { cleanup: cleanup } = $2c61e4cd8229c49a$var$align_field_modal(style_props_, search_field, ()=>props.aligner_ref);
|
|
8825
8949
|
const complete_modal_dispose_handler = ()=>{
|
|
8826
8950
|
modal_dispose_handler?.();
|
|
8827
8951
|
cleanup();
|
|
@@ -8849,23 +8973,21 @@ function $2c61e4cd8229c49a$export$316f6f283ae64765({ depict_search: depict_searc
|
|
|
8849
8973
|
];
|
|
8850
8974
|
}, "SearchField failed");
|
|
8851
8975
|
}
|
|
8852
|
-
function $2c61e4cd8229c49a$var$align_field_modal(style_props_, input,
|
|
8976
|
+
function $2c61e4cd8229c49a$var$align_field_modal(style_props_, input, aligner_ref_accessor) {
|
|
8853
8977
|
return (0, $57o7A$solidjs.createRoot)((dispose)=>{
|
|
8854
|
-
|
|
8978
|
+
(0, $57o7A$solidjs.createComputed)(()=>{
|
|
8979
|
+
const aligner_ref = aligner_ref_accessor?.();
|
|
8980
|
+
if (!aligner_ref) {
|
|
8981
|
+
(0, $fd463ff0edb29915$export$b3ad617e9036868)(style_props_, input);
|
|
8982
|
+
return;
|
|
8983
|
+
}
|
|
8855
8984
|
const { cleanup: cleanup } = (0, $d8e94ea381ab57fa$export$828dcdd425fd3231)(aligner_ref);
|
|
8985
|
+
(0, $57o7A$solidjs.onCleanup)(cleanup);
|
|
8856
8986
|
(0, $fd463ff0edb29915$export$b3ad617e9036868)(style_props_, aligner_ref, undefined, false, "top");
|
|
8857
|
-
|
|
8858
|
-
|
|
8859
|
-
|
|
8860
|
-
|
|
8861
|
-
}
|
|
8862
|
-
};
|
|
8863
|
-
} else {
|
|
8864
|
-
(0, $fd463ff0edb29915$export$b3ad617e9036868)(style_props_, input);
|
|
8865
|
-
return {
|
|
8866
|
-
cleanup: dispose
|
|
8867
|
-
};
|
|
8868
|
-
}
|
|
8987
|
+
});
|
|
8988
|
+
return {
|
|
8989
|
+
cleanup: dispose
|
|
8990
|
+
};
|
|
8869
8991
|
});
|
|
8870
8992
|
}
|
|
8871
8993
|
|