@depict-ai/ui 2.0.13 → 2.0.15
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/ES10/index.cjs +334 -230
- package/ES10/index.d.ts +73 -39
- package/ES10/index.js +332 -233
- package/latest/index.cjs +318 -216
- package/latest/index.d.ts +73 -39
- package/latest/index.js +316 -219
- package/package.json +1 -1
- package/server/ES10/index.cjs +303 -198
- package/server/ES10/index.d.ts +73 -39
- package/server/ES10/index.js +301 -201
- package/server/latest/index.cjs +287 -184
- package/server/latest/index.d.ts +73 -39
- package/server/latest/index.js +285 -187
package/server/latest/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var $5vyXB$depictaiutilishared = require("@depict-ai/utilishared/latest");
|
|
2
|
-
var $5vyXB$solidjs = require("solid-js");
|
|
3
2
|
var $5vyXB$solidjsweb = require("solid-js/web");
|
|
3
|
+
var $5vyXB$solidjs = require("solid-js");
|
|
4
4
|
require("../../multi_import_deduplicator.cjs").register_es_version("ui", "latest");
|
|
5
5
|
function $parcel$export(e, n, v, s) {
|
|
6
6
|
Object.defineProperty(e, n, {
|
|
@@ -10,6 +10,11 @@ function $parcel$export(e, n, v, s) {
|
|
|
10
10
|
configurable: true
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
|
+
$parcel$export(module.exports, "shopifyContainedImageContextSymbol", () => $a33065cfed827fc0$export$d7b7ab832c20e2f4);
|
|
14
|
+
$parcel$export(module.exports, "ListingProvider", () => $84798aaa863a4909$export$e68cff63f76bd15b);
|
|
15
|
+
$parcel$export(module.exports, "useListing", () => $84798aaa863a4909$export$8d0c4fdbb05a2f2e);
|
|
16
|
+
$parcel$export(module.exports, "ShopifyContainedImage", () => $a33065cfed827fc0$export$e4b984597b71e989);
|
|
17
|
+
$parcel$export(module.exports, "SlidableItems", () => $a0e53f99354809d9$export$6649caad96ef8870);
|
|
13
18
|
$parcel$export(module.exports, "make_accurate_size_accessor", () => $e5f442fb78c98741$export$9f191182275e9ef);
|
|
14
19
|
$parcel$export(module.exports, "RecommendationSlider", () => $72f96c4782db0b1b$export$9574e176201e5e8d);
|
|
15
20
|
$parcel$export(module.exports, "RecommendationGrid", () => $1f8dbf7e28b3eff2$export$9756467d34d91cdb);
|
|
@@ -61,7 +66,159 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $a3280f0aad997933$expo
|
|
|
61
66
|
$parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad997933$export$7bf543b9d9be2c22);
|
|
62
67
|
$parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
|
|
63
68
|
/*! Depict.ai search and product listing SDK */
|
|
64
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "2.0.
|
|
69
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "2.0.15";
|
|
70
|
+
const $84798aaa863a4909$var$ListingContext = /*@__PURE__*/$5vyXB$solidjs.createContext();
|
|
71
|
+
function $84798aaa863a4909$export$e68cff63f76bd15b(props) {
|
|
72
|
+
const our_object = {};
|
|
73
|
+
return $5vyXB$solidjsweb.createComponent($84798aaa863a4909$var$ListingContext.Provider, {
|
|
74
|
+
value: our_object,
|
|
75
|
+
get children() {
|
|
76
|
+
return props.children;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function $84798aaa863a4909$export$8d0c4fdbb05a2f2e() {
|
|
81
|
+
return $5vyXB$solidjs.useContext($84798aaa863a4909$var$ListingContext);
|
|
82
|
+
}
|
|
83
|
+
const $93304d59a9747aa6$var$_tmpl$ = ["<div", ' style="', '"></div>'];
|
|
84
|
+
function $93304d59a9747aa6$export$94026ee33dbabc26(props) {
|
|
85
|
+
return $5vyXB$solidjsweb.ssr($93304d59a9747aa6$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.ssrStyle(`position:relative;width:100%;padding-bottom:${1 / props.aspectRatio * 100}%`));
|
|
86
|
+
}
|
|
87
|
+
function $19950faaac026e09$export$e6fffe67d4cdd848(whatToWatch) {
|
|
88
|
+
const [size, setSize] = $5vyXB$solidjs.createSignal(0);
|
|
89
|
+
const resizeObserver = new ResizeObserver($5vyXB$depictaiutilishared.catchify(records => {
|
|
90
|
+
for (let j = 0; j < records.length; j++) {
|
|
91
|
+
const {
|
|
92
|
+
width: width
|
|
93
|
+
} = records[j].contentRect;
|
|
94
|
+
if (!width) continue;
|
|
95
|
+
// add extra 5% just in case. + safari is (in some cases) acting a bit questionable and needs a third extra to fill the set width
|
|
96
|
+
const new_size = width * 1.05 * ((0, $5vyXB$depictaiutilishared.is_safari) ? 4 / 3 : 1);
|
|
97
|
+
setSize(Math.round(new_size));
|
|
98
|
+
}
|
|
99
|
+
}));
|
|
100
|
+
// If we start observing elements before they're in the DOM Chrome (Version 117.0.5938.92 (Official Build) (arm64)) sometimes gives us a resize event with a width of 0 and then doesn't dispatch one with the actual width once it's in the DOM. So we wait until the element is in the DOM before we start observing it.
|
|
101
|
+
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
102
|
+
const disconnect = (0, $5vyXB$depictaiutilishared.observer).onexists(whatToWatch, ({
|
|
103
|
+
element: element
|
|
104
|
+
}) => requestAnimationFrame($5vyXB$depictaiutilishared.catchify(() => resizeObserver.observe(element))));
|
|
105
|
+
$5vyXB$solidjs.onCleanup(() => {
|
|
106
|
+
resizeObserver.disconnect();
|
|
107
|
+
disconnect();
|
|
108
|
+
});
|
|
109
|
+
return size;
|
|
110
|
+
}
|
|
111
|
+
function $19950faaac026e09$export$6e5611bc7e57e477(props) {
|
|
112
|
+
// Enable reactive props
|
|
113
|
+
const otherOptions = $5vyXB$solidjs.createMemo(() => {
|
|
114
|
+
const cloned_props = {
|
|
115
|
+
...props
|
|
116
|
+
};
|
|
117
|
+
delete cloned_props.resolutions;
|
|
118
|
+
// @ts-ignore
|
|
119
|
+
delete cloned_props.size;
|
|
120
|
+
// @ts-ignore
|
|
121
|
+
delete cloned_props.src;
|
|
122
|
+
return cloned_props;
|
|
123
|
+
});
|
|
124
|
+
const src_options = $5vyXB$solidjs.createMemo(() => {
|
|
125
|
+
const src = new URL(props.src, location.origin);
|
|
126
|
+
const fallback_src = $19950faaac026e09$var$generateImageUrl(src, 400);
|
|
127
|
+
const srcset = $19950faaac026e09$var$make_srcset(src, props.resolutions || [64, 128, 256, 300, 400, 512, 768, 1024, 1280, 1536, 2048, 4096]);
|
|
128
|
+
return {
|
|
129
|
+
src: fallback_src,
|
|
130
|
+
srcset: srcset
|
|
131
|
+
};
|
|
132
|
+
});
|
|
133
|
+
return $5vyXB$solidjsweb.ssrElement("img", () => ({
|
|
134
|
+
...otherOptions,
|
|
135
|
+
...src_options(),
|
|
136
|
+
"sizes": props.size() + "px"
|
|
137
|
+
}), undefined, true);
|
|
138
|
+
}
|
|
139
|
+
function $19950faaac026e09$var$make_srcset(url, resolutions) {
|
|
140
|
+
return resolutions.map(width => `${$19950faaac026e09$var$generateImageUrl(url, width)} ${width}w`).join(", ");
|
|
141
|
+
}
|
|
142
|
+
function $19950faaac026e09$var$generateImageUrl(url, width) {
|
|
143
|
+
url.searchParams.set("width", width);
|
|
144
|
+
return url.href;
|
|
145
|
+
}
|
|
146
|
+
const $a33065cfed827fc0$var$backupSizeSignal = /*@__PURE__*/$5vyXB$solidjs.createSignal();
|
|
147
|
+
const $a33065cfed827fc0$export$d7b7ab832c20e2f4 = /*@__PURE__*/Symbol("ShopifyContainedImage");
|
|
148
|
+
function $a33065cfed827fc0$export$e4b984597b71e989(props) {
|
|
149
|
+
const context = $84798aaa863a4909$export$8d0c4fdbb05a2f2e();
|
|
150
|
+
if (context && !context[$a33065cfed827fc0$export$d7b7ab832c20e2f4])
|
|
151
|
+
// create a signal that's the same for all items in this listing
|
|
152
|
+
context[$a33065cfed827fc0$export$d7b7ab832c20e2f4] = $5vyXB$solidjs.createSignal();
|
|
153
|
+
$5vyXB$depictaiutilishared.dlog("Checking for", $a33065cfed827fc0$export$d7b7ab832c20e2f4, "in", context);
|
|
154
|
+
const [currentImageSize, setCurrentImageSize] = context?.[$a33065cfed827fc0$export$d7b7ab832c20e2f4] || $a33065cfed827fc0$var$backupSizeSignal; // use global fallback signal (might lead to blurry images) if no context is available
|
|
155
|
+
const container = $5vyXB$solidjsweb.createComponent((0, $93304d59a9747aa6$export$94026ee33dbabc26), {
|
|
156
|
+
get aspectRatio() {
|
|
157
|
+
return props.aspectRatio;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
const owner = $5vyXB$solidjs.getOwner();
|
|
161
|
+
let createdSizeAccessor = false;
|
|
162
|
+
let wasCleanedUp = false;
|
|
163
|
+
$5vyXB$solidjs.createEffect(() => {
|
|
164
|
+
if (currentImageSize() || wasCleanedUp) return; // We get into the effect when onCleanup is called if we don't have wasCleanedUp
|
|
165
|
+
// ensure we always have a size accessor
|
|
166
|
+
// what this whole thing does is set the sizes attribute to the actual size of one of the existing image containers, therefore the value doesn't have to manually be specified
|
|
167
|
+
setCurrentImageSize(() => $5vyXB$solidjs.runWithOwner(owner, () => $19950faaac026e09$export$e6fffe67d4cdd848(container)));
|
|
168
|
+
});
|
|
169
|
+
$5vyXB$solidjs.onCleanup(() => {
|
|
170
|
+
wasCleanedUp = true; // important to set this before the function call below and always, so the dead effects don't create dead size accessors
|
|
171
|
+
if (!createdSizeAccessor) return;
|
|
172
|
+
$5vyXB$depictaiutilishared.queueMacroTask(() => setCurrentImageSize(undefined)); // unset the size accessor next event loop iteration, so that all onCleanup's have time to run, since the effects run more aggressively and can create a size accessor with a cleaned up owner otherwise
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
container.append($5vyXB$solidjsweb.createComponent((0, $19950faaac026e09$export$6e5611bc7e57e477), {
|
|
176
|
+
style: "width: 100%; height: 100%; object-fit: contain; position: absolute; inset: 0;",
|
|
177
|
+
get size() {
|
|
178
|
+
return $5vyXB$solidjs.createMemo(() => currentImageSize()?.() || 0);
|
|
179
|
+
},
|
|
180
|
+
get src() {
|
|
181
|
+
return props.src;
|
|
182
|
+
}
|
|
183
|
+
}));
|
|
184
|
+
return container;
|
|
185
|
+
}
|
|
186
|
+
const $0f313083912e447a$var$_tmpl$ = ["<svg", ' xmlns="http://www.w3.org/2000/svg"', ' viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0" fill="#0f0f0f"></path></svg>'];
|
|
187
|
+
function $0f313083912e447a$export$8be2714ec7f169ee(props = {}) {
|
|
188
|
+
return $5vyXB$solidjsweb.ssr($0f313083912e447a$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.ssrAttribute("width", $5vyXB$solidjsweb.escape(props.width_, true) ?? 14, false) + $5vyXB$solidjsweb.ssrAttribute("height", $5vyXB$solidjsweb.escape(props.height_, true) ?? 26, false));
|
|
189
|
+
}
|
|
190
|
+
const $a0e53f99354809d9$var$_tmpl$ = ["<div", ">", "</div>"];
|
|
191
|
+
function $a0e53f99354809d9$export$6649caad96ef8870({
|
|
192
|
+
children: children,
|
|
193
|
+
slider_ref_: slider_ref_,
|
|
194
|
+
faded_opacity_ = 0.7,
|
|
195
|
+
mutation_plugins_ = [],
|
|
196
|
+
disable_fading_: disable_fading_,
|
|
197
|
+
arrow_width_: arrow_width_,
|
|
198
|
+
arrow_height_: arrow_height_
|
|
199
|
+
}) {
|
|
200
|
+
const slider = new (0, $5vyXB$depictaiutilishared.Amazing_Slider)({
|
|
201
|
+
button_contents: {
|
|
202
|
+
left: [$5vyXB$solidjsweb.ssr($a0e53f99354809d9$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $0f313083912e447a$export$8be2714ec7f169ee), {
|
|
203
|
+
height_: arrow_height_,
|
|
204
|
+
width_: arrow_width_
|
|
205
|
+
})))],
|
|
206
|
+
right: [$5vyXB$solidjsweb.ssr($a0e53f99354809d9$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $0f313083912e447a$export$8be2714ec7f169ee), {
|
|
207
|
+
height_: arrow_height_,
|
|
208
|
+
width_: arrow_width_
|
|
209
|
+
})))]
|
|
210
|
+
},
|
|
211
|
+
constructor_plugins: [$5vyXB$depictaiutilishared.slider_snap_css().constructor_plugin],
|
|
212
|
+
mutation_plugins: [...(disable_fading_ ? [] : [$5vyXB$depictaiutilishared.slider_fading_factory({
|
|
213
|
+
threshold_: 0.96,
|
|
214
|
+
faded_opacity_: faded_opacity_
|
|
215
|
+
}).mutation_plugin_]), ...mutation_plugins_]
|
|
216
|
+
});
|
|
217
|
+
$5vyXB$solidjsweb.insert(slider.insert_here, children);
|
|
218
|
+
$5vyXB$solidjs.onCleanup(() => slider.observer.disconnect());
|
|
219
|
+
slider_ref_?.(slider);
|
|
220
|
+
return slider.container;
|
|
221
|
+
}
|
|
65
222
|
|
|
66
223
|
/** @jsxImportSource solid-js */
|
|
67
224
|
|
|
@@ -464,42 +621,6 @@ function $f48d0fbb00835aaa$export$445d8d3f5f706a40(props, container_element, ins
|
|
|
464
621
|
if (insert_after_container) container_element.after(style_element);
|
|
465
622
|
return [container_element, view_more_button_container(), view_less_button_container(), style_element];
|
|
466
623
|
}
|
|
467
|
-
const $0f313083912e447a$var$_tmpl$ = ["<svg", ' xmlns="http://www.w3.org/2000/svg"', ' viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0" fill="#0f0f0f"></path></svg>'];
|
|
468
|
-
function $0f313083912e447a$export$8be2714ec7f169ee(props = {}) {
|
|
469
|
-
return $5vyXB$solidjsweb.ssr($0f313083912e447a$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.ssrAttribute("width", $5vyXB$solidjsweb.escape(props.width_, true) ?? 14, false) + $5vyXB$solidjsweb.ssrAttribute("height", $5vyXB$solidjsweb.escape(props.height_, true) ?? 26, false));
|
|
470
|
-
}
|
|
471
|
-
const $a0e53f99354809d9$var$_tmpl$ = ["<div", ">", "</div>"];
|
|
472
|
-
function $a0e53f99354809d9$export$6649caad96ef8870({
|
|
473
|
-
children: children,
|
|
474
|
-
slider_ref_: slider_ref_,
|
|
475
|
-
faded_opacity_ = 0.7,
|
|
476
|
-
mutation_plugins_ = [],
|
|
477
|
-
disable_fading_: disable_fading_,
|
|
478
|
-
arrow_width_: arrow_width_,
|
|
479
|
-
arrow_height_: arrow_height_
|
|
480
|
-
}) {
|
|
481
|
-
const slider = new (0, $5vyXB$depictaiutilishared.Amazing_Slider)({
|
|
482
|
-
button_contents: {
|
|
483
|
-
left: [$5vyXB$solidjsweb.ssr($a0e53f99354809d9$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $0f313083912e447a$export$8be2714ec7f169ee), {
|
|
484
|
-
height_: arrow_height_,
|
|
485
|
-
width_: arrow_width_
|
|
486
|
-
})))],
|
|
487
|
-
right: [$5vyXB$solidjsweb.ssr($a0e53f99354809d9$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $0f313083912e447a$export$8be2714ec7f169ee), {
|
|
488
|
-
height_: arrow_height_,
|
|
489
|
-
width_: arrow_width_
|
|
490
|
-
})))]
|
|
491
|
-
},
|
|
492
|
-
constructor_plugins: [$5vyXB$depictaiutilishared.slider_snap_css().constructor_plugin],
|
|
493
|
-
mutation_plugins: [...(disable_fading_ ? [] : [$5vyXB$depictaiutilishared.slider_fading_factory({
|
|
494
|
-
threshold_: 0.96,
|
|
495
|
-
faded_opacity_: faded_opacity_
|
|
496
|
-
}).mutation_plugin_]), ...mutation_plugins_]
|
|
497
|
-
});
|
|
498
|
-
$5vyXB$solidjsweb.insert(slider.insert_here, children);
|
|
499
|
-
$5vyXB$solidjs.onCleanup(() => slider.observer.disconnect());
|
|
500
|
-
slider_ref_?.(slider);
|
|
501
|
-
return slider.container;
|
|
502
|
-
}
|
|
503
624
|
function $363ce4d1d71041aa$export$d41d19e89346fa2({
|
|
504
625
|
recommendations_resource_: recommendations_resource_,
|
|
505
626
|
product_card_template_: product_card_template_,
|
|
@@ -607,15 +728,19 @@ function $72f96c4782db0b1b$export$9574e176201e5e8d(props) {
|
|
|
607
728
|
};
|
|
608
729
|
});
|
|
609
730
|
const [recommendations_resource_] = $5vyXB$solidjs.createResource(() => props.recommendations, recs => recs);
|
|
610
|
-
return $5vyXB$solidjsweb.ssr($72f96c4782db0b1b$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape($
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
731
|
+
return $5vyXB$solidjsweb.ssr($72f96c4782db0b1b$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $84798aaa863a4909$export$e68cff63f76bd15b), {
|
|
732
|
+
get children() {
|
|
733
|
+
return $363ce4d1d71041aa$export$d41d19e89346fa2({
|
|
734
|
+
product_card_template_: (...args) => props.product_card_template(...args),
|
|
735
|
+
recommendations_resource_: recommendations_resource_,
|
|
736
|
+
market_: () => props.market,
|
|
737
|
+
merchant_: () => props.merchant,
|
|
738
|
+
layout_options_: $5vyXB$solidjs.createMemo(() => ({
|
|
739
|
+
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(props.cols_at_size),
|
|
740
|
+
...grid_spacing_override()
|
|
741
|
+
}))
|
|
742
|
+
});
|
|
743
|
+
}
|
|
619
744
|
})));
|
|
620
745
|
}, "RecommendationSlider failed");
|
|
621
746
|
}
|
|
@@ -703,70 +828,23 @@ function $1f8dbf7e28b3eff2$export$9756467d34d91cdb(props) {
|
|
|
703
828
|
};
|
|
704
829
|
});
|
|
705
830
|
const [recommendations_resource_] = $5vyXB$solidjs.createResource(() => props.recommendations, recs => recs);
|
|
706
|
-
return $5vyXB$solidjsweb.ssr($1f8dbf7e28b3eff2$var$_tmpl$2, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape($
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
831
|
+
return $5vyXB$solidjsweb.ssr($1f8dbf7e28b3eff2$var$_tmpl$2, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $84798aaa863a4909$export$e68cff63f76bd15b), {
|
|
832
|
+
get children() {
|
|
833
|
+
return $b8e79813f4f7ebe4$export$7da560f849543dff({
|
|
834
|
+
rows_object_: rows_object_,
|
|
835
|
+
product_card_template_: (...args) => props.product_card_template(...args),
|
|
836
|
+
recommendations_resource_: recommendations_resource_,
|
|
837
|
+
market_: () => props.market,
|
|
838
|
+
merchant_: () => props.merchant,
|
|
839
|
+
layout_options_: $5vyXB$solidjs.createMemo(() => ({
|
|
840
|
+
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(props.cols_at_size),
|
|
841
|
+
...grid_spacing_override()
|
|
842
|
+
}))
|
|
843
|
+
});
|
|
844
|
+
}
|
|
716
845
|
})));
|
|
717
846
|
}, "RecommendationGrid failed");
|
|
718
847
|
}
|
|
719
|
-
function $19950faaac026e09$export$e6fffe67d4cdd848(whatToWatch) {
|
|
720
|
-
const [size, setSize] = $5vyXB$solidjs.createSignal(0);
|
|
721
|
-
const resizeObserver = new ResizeObserver($5vyXB$depictaiutilishared.catchify(records => {
|
|
722
|
-
for (let j = 0; j < records.length; j++) {
|
|
723
|
-
const {
|
|
724
|
-
width: width
|
|
725
|
-
} = records[j].contentRect;
|
|
726
|
-
if (!width) continue;
|
|
727
|
-
// add extra 5% just in case. + safari is (in some cases) acting a bit questionable and needs a third extra to fill the set width
|
|
728
|
-
const new_size = width * 1.05 * ((0, $5vyXB$depictaiutilishared.is_safari) ? 4 / 3 : 1);
|
|
729
|
-
setSize(Math.round(new_size));
|
|
730
|
-
}
|
|
731
|
-
}));
|
|
732
|
-
// If we start observing elements before they're in the DOM Chrome (Version 117.0.5938.92 (Official Build) (arm64)) sometimes gives us a resize event with a width of 0 and then doesn't dispatch one with the actual width once it's in the DOM. So we wait until the element is in the DOM before we start observing it.
|
|
733
|
-
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
734
|
-
const disconnect = (0, $5vyXB$depictaiutilishared.observer).onexists(whatToWatch, ({
|
|
735
|
-
element: element
|
|
736
|
-
}) => requestAnimationFrame($5vyXB$depictaiutilishared.catchify(() => resizeObserver.observe(element))));
|
|
737
|
-
$5vyXB$solidjs.onCleanup(() => {
|
|
738
|
-
resizeObserver.disconnect();
|
|
739
|
-
disconnect();
|
|
740
|
-
});
|
|
741
|
-
return size;
|
|
742
|
-
}
|
|
743
|
-
function $19950faaac026e09$export$6e5611bc7e57e477({
|
|
744
|
-
src: raw_src,
|
|
745
|
-
size: size,
|
|
746
|
-
resolutions = [64, 128, 256, 300, 400, 512, 768, 1024, 1280, 1536, 2048, 4096],
|
|
747
|
-
...otherOptions
|
|
748
|
-
}) {
|
|
749
|
-
const src = new URL(raw_src, location.origin);
|
|
750
|
-
const fallbackSrc = $19950faaac026e09$var$generateImageUrl(src, 400);
|
|
751
|
-
const srcset = $19950faaac026e09$var$make_srcset(src, resolutions);
|
|
752
|
-
return $5vyXB$solidjsweb.ssrElement("img", () => ({
|
|
753
|
-
...otherOptions,
|
|
754
|
-
"src": fallbackSrc,
|
|
755
|
-
"srcset": srcset,
|
|
756
|
-
"sizes": size() + "px"
|
|
757
|
-
}), undefined, true);
|
|
758
|
-
}
|
|
759
|
-
function $19950faaac026e09$var$make_srcset(url, resolutions) {
|
|
760
|
-
return resolutions.map(width => `${$19950faaac026e09$var$generateImageUrl(url, width)} ${width}w`).join(", ");
|
|
761
|
-
}
|
|
762
|
-
function $19950faaac026e09$var$generateImageUrl(url, width) {
|
|
763
|
-
url.searchParams.set("width", width);
|
|
764
|
-
return url.href;
|
|
765
|
-
}
|
|
766
|
-
const $93304d59a9747aa6$var$_tmpl$ = ["<div", ' style="', '"></div>'];
|
|
767
|
-
function $93304d59a9747aa6$export$94026ee33dbabc26(props) {
|
|
768
|
-
return $5vyXB$solidjsweb.ssr($93304d59a9747aa6$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.ssrStyle(`position:relative;width:100%;padding-bottom:${1 / props.aspectRatio * 100}%`));
|
|
769
|
-
}
|
|
770
848
|
function $4b455f60dadde8b8$export$5bad61ecde080b1f(...params) {
|
|
771
849
|
const {
|
|
772
850
|
collapse: collapse,
|
|
@@ -5271,26 +5349,30 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
|
|
|
5271
5349
|
severity_: "error",
|
|
5272
5350
|
message_: "Showing results failed",
|
|
5273
5351
|
get children() {
|
|
5274
|
-
return $
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5352
|
+
return $5vyXB$solidjsweb.createComponent((0, $84798aaa863a4909$export$e68cff63f76bd15b), {
|
|
5353
|
+
get children() {
|
|
5354
|
+
return $fe76fb463cc60b89$export$3925f87b1545cfc6({
|
|
5355
|
+
min_products_to_fetch_:
|
|
5356
|
+
// if you want to get if all products have been loaded you can add an optional signal here, see SearchPage
|
|
5357
|
+
min_products_to_fetch_,
|
|
5358
|
+
query_base_: query_base_,
|
|
5359
|
+
plp_results_: plp_results_,
|
|
5360
|
+
depict_api_: depict_api_,
|
|
5361
|
+
first_result_in_viewport_: first_result_in_viewport_,
|
|
5362
|
+
last_result_in_viewport_: last_result_in_viewport_,
|
|
5363
|
+
scroll_restoration_data_: scroll_restoration_data_,
|
|
5364
|
+
layout_options_: layout_options_,
|
|
5365
|
+
product_card_template_: product_card_template_,
|
|
5366
|
+
sort_or_filter_open_: sort_or_filter_open_,
|
|
5367
|
+
desktop_filter_elements_: desktop_filter_elements_,
|
|
5368
|
+
id_currently_querying_for_: query_id_,
|
|
5369
|
+
no_results_options_: {
|
|
5370
|
+
selected_filters_: selected_filters_,
|
|
5371
|
+
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
5372
|
+
i18n_: i18n_,
|
|
5373
|
+
local_filter_cache_: local_filter_cache_
|
|
5374
|
+
}
|
|
5375
|
+
});
|
|
5294
5376
|
}
|
|
5295
5377
|
});
|
|
5296
5378
|
}
|
|
@@ -6123,8 +6205,10 @@ function $fb29c6201c369e39$export$7de92c4c2205ebf3({
|
|
|
6123
6205
|
}) {
|
|
6124
6206
|
const [get_showing_recommendation_rows] = showing_recommendation_rows_; // We reset this in after_submit in search.tsx FYI
|
|
6125
6207
|
const rows_object = view_more_button_ ? $fb29c6201c369e39$var$make_state_saved_rows(showing_recommendation_rows_, i18n_) : "all";
|
|
6126
|
-
const [recommendations_resource] = $5vyXB$solidjs.createResource(
|
|
6127
|
-
|
|
6208
|
+
const [recommendations_resource] = $5vyXB$solidjs.createResource(() => all_products_loaded_() && search_query_base_(),
|
|
6209
|
+
// only fetch/refetch if all products are loaded
|
|
6210
|
+
query => query && depict_api_.get_recommended(query).then(r => r.displays));
|
|
6211
|
+
const should_show = $5vyXB$solidjs.createMemo(() => !!((recommendations_resource.loading || recommendations_resource()?.length) && all_products_loaded_()));
|
|
6128
6212
|
const num_placeholders_ = $5vyXB$solidjs.createMemo(() => (0, $aec24316ed262dc0$export$6c9030e511152266) + get_showing_recommendation_rows() * Math.max(...layout_options_().cols_at_size.map(([per_column]) => per_column)));
|
|
6129
6213
|
// Don't tear down elements every time one updates the page - don't put them within <Show>
|
|
6130
6214
|
const elements = $5vyXB$solidjsweb.ssr($fb29c6201c369e39$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape(i18n_.search_recs_title_()), $5vyXB$solidjsweb.escape($fc23d7668ae0011d$export$a2cc176055f8f08()), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $f48d0fbb00835aaa$export$d21e32dfedac04be), $5vyXB$solidjsweb.mergeProps({
|
|
@@ -6145,7 +6229,10 @@ function $fb29c6201c369e39$export$7de92c4c2205ebf3({
|
|
|
6145
6229
|
get children() {
|
|
6146
6230
|
return (() => {
|
|
6147
6231
|
// IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
|
|
6148
|
-
const displays_by_key_ = $a73063cc642f3e5f$export$7f8bd308237ab5a5($5vyXB$solidjs.createMemo(
|
|
6232
|
+
const displays_by_key_ = $a73063cc642f3e5f$export$7f8bd308237ab5a5($5vyXB$solidjs.createMemo(prev => {
|
|
6233
|
+
if (!should_show() && prev) return prev; // When we're invisible, don't update what we're rendering to be possibly undefined to preserve the same products if possible
|
|
6234
|
+
return recommendations_resource() || [];
|
|
6235
|
+
}));
|
|
6149
6236
|
return $a73063cc642f3e5f$export$43f0fb951fcb0c54({
|
|
6150
6237
|
displays_by_key_: displays_by_key_,
|
|
6151
6238
|
merchant_: $5vyXB$solidjs.createMemo(() => search_query_base_().tenant),
|
|
@@ -6159,7 +6246,7 @@ function $fb29c6201c369e39$export$7de92c4c2205ebf3({
|
|
|
6159
6246
|
}))));
|
|
6160
6247
|
return $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
6161
6248
|
get when() {
|
|
6162
|
-
return
|
|
6249
|
+
return should_show();
|
|
6163
6250
|
},
|
|
6164
6251
|
children: elements
|
|
6165
6252
|
});
|
|
@@ -7302,17 +7389,21 @@ function $f40a47a30a358305$export$1c593cbd6f1e10bc({
|
|
|
7302
7389
|
severity_: "error",
|
|
7303
7390
|
message_: "Instant results failed",
|
|
7304
7391
|
get children() {
|
|
7305
|
-
return $
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
|
|
7309
|
-
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
|
|
7313
|
-
|
|
7314
|
-
|
|
7315
|
-
|
|
7392
|
+
return $5vyXB$solidjsweb.createComponent((0, $84798aaa863a4909$export$e68cff63f76bd15b), {
|
|
7393
|
+
get children() {
|
|
7394
|
+
return $6ae556e536054e87$export$62f101a8aa597bf8({
|
|
7395
|
+
search_field_value_: search_field_value_,
|
|
7396
|
+
depict_api_: depict_api_,
|
|
7397
|
+
tenant_: tenant_,
|
|
7398
|
+
i18n_: i18n_,
|
|
7399
|
+
market_: market_,
|
|
7400
|
+
set_total_num_results_accessor_: set_total_num_results_accessor_,
|
|
7401
|
+
router_: router_,
|
|
7402
|
+
set_modal_search_results_: set_modal_search_results_,
|
|
7403
|
+
content_search_enabled_: content_search_enabled_,
|
|
7404
|
+
...instant_results_options_
|
|
7405
|
+
});
|
|
7406
|
+
}
|
|
7316
7407
|
});
|
|
7317
7408
|
}
|
|
7318
7409
|
})), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
@@ -8086,14 +8177,18 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
|
|
|
8086
8177
|
return content_search_enabled_();
|
|
8087
8178
|
},
|
|
8088
8179
|
get children() {
|
|
8089
|
-
return $5vyXB$solidjsweb.createComponent((0, $
|
|
8090
|
-
|
|
8091
|
-
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8096
|
-
|
|
8180
|
+
return $5vyXB$solidjsweb.createComponent((0, $84798aaa863a4909$export$e68cff63f76bd15b), {
|
|
8181
|
+
get children() {
|
|
8182
|
+
return $5vyXB$solidjsweb.createComponent((0, $3716b8caf7f959e2$export$6d0c9c22f6652669), {
|
|
8183
|
+
content_results_rows_: content_results_rows_,
|
|
8184
|
+
search_results_: search_results_,
|
|
8185
|
+
i18n_: i18n_,
|
|
8186
|
+
get_search_query_: get_search_query_,
|
|
8187
|
+
layout_options_: content_layout_options_,
|
|
8188
|
+
router_: router_,
|
|
8189
|
+
query_base_: search_query_base_
|
|
8190
|
+
});
|
|
8191
|
+
}
|
|
8097
8192
|
});
|
|
8098
8193
|
}
|
|
8099
8194
|
});
|
|
@@ -8124,28 +8219,32 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
|
|
|
8124
8219
|
severity_: "error",
|
|
8125
8220
|
message_: "Search results failed",
|
|
8126
8221
|
get children() {
|
|
8127
|
-
return $
|
|
8128
|
-
|
|
8129
|
-
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
|
|
8133
|
-
|
|
8134
|
-
|
|
8135
|
-
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
|
|
8141
|
-
|
|
8142
|
-
|
|
8143
|
-
|
|
8144
|
-
|
|
8145
|
-
|
|
8146
|
-
|
|
8147
|
-
|
|
8148
|
-
|
|
8222
|
+
return $5vyXB$solidjsweb.createComponent((0, $84798aaa863a4909$export$e68cff63f76bd15b), {
|
|
8223
|
+
get children() {
|
|
8224
|
+
return $fe76fb463cc60b89$export$3925f87b1545cfc6({
|
|
8225
|
+
all_products_loaded_: all_products_loaded_,
|
|
8226
|
+
min_products_to_fetch_: min_products_to_fetch_,
|
|
8227
|
+
query_base_: search_query_base_,
|
|
8228
|
+
plp_results_: search_results_,
|
|
8229
|
+
depict_api_: depict_api_,
|
|
8230
|
+
first_result_in_viewport_: first_result_in_viewport_,
|
|
8231
|
+
last_result_in_viewport_: last_result_in_viewport_,
|
|
8232
|
+
scroll_restoration_data_: scroll_restoration_data_,
|
|
8233
|
+
desktop_filter_elements_: desktop_filter_elements_,
|
|
8234
|
+
product_card_template_: product_card_template_,
|
|
8235
|
+
layout_options_: layout_options_,
|
|
8236
|
+
sort_or_filter_open_: sort_or_filter_open_,
|
|
8237
|
+
id_currently_querying_for_: get_search_query_,
|
|
8238
|
+
no_results_options_: {
|
|
8239
|
+
selected_filters_: selected_filters_,
|
|
8240
|
+
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
8241
|
+
local_filter_cache_: local_filter_cache_,
|
|
8242
|
+
i18n_: {
|
|
8243
|
+
...i18n_,
|
|
8244
|
+
no_results_text_: no_results_text_
|
|
8245
|
+
}
|
|
8246
|
+
}
|
|
8247
|
+
});
|
|
8149
8248
|
}
|
|
8150
8249
|
});
|
|
8151
8250
|
}
|
|
@@ -8157,17 +8256,21 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
|
|
|
8157
8256
|
severity_: "error",
|
|
8158
8257
|
message_: "Search recommendations failed",
|
|
8159
8258
|
get children() {
|
|
8160
|
-
return $5vyXB$solidjsweb.createComponent((0, $
|
|
8161
|
-
|
|
8162
|
-
|
|
8163
|
-
|
|
8164
|
-
|
|
8165
|
-
|
|
8166
|
-
|
|
8167
|
-
|
|
8168
|
-
|
|
8169
|
-
|
|
8170
|
-
|
|
8259
|
+
return $5vyXB$solidjsweb.createComponent((0, $84798aaa863a4909$export$e68cff63f76bd15b), {
|
|
8260
|
+
get children() {
|
|
8261
|
+
return $5vyXB$solidjsweb.createComponent((0, $fb29c6201c369e39$export$7de92c4c2205ebf3), {
|
|
8262
|
+
depict_api_: depict_api_,
|
|
8263
|
+
i18n_: i18n_,
|
|
8264
|
+
search_query_base_: search_query_base_,
|
|
8265
|
+
get layout_options_() {
|
|
8266
|
+
return $5vyXB$solidjs.createMemo(() => recommendations_layout_options_?.() ?? layout_options_());
|
|
8267
|
+
},
|
|
8268
|
+
showing_recommendation_rows_: showing_recommendation_rows_,
|
|
8269
|
+
view_more_button_: search_recs_view_more_,
|
|
8270
|
+
product_card_template_: product_card_template_,
|
|
8271
|
+
all_products_loaded_: get_all_products_loaded
|
|
8272
|
+
});
|
|
8273
|
+
}
|
|
8171
8274
|
});
|
|
8172
8275
|
}
|
|
8173
8276
|
});
|