@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/latest/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var $gVhhF$depictaiutilishared = require("@depict-ai/utilishared/latest");
|
|
2
|
-
var $gVhhF$solidjs = require("solid-js");
|
|
3
2
|
var $gVhhF$solidjsweb = require("solid-js/web");
|
|
3
|
+
var $gVhhF$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,190 @@ $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__*/$gVhhF$solidjs.createContext();
|
|
71
|
+
function $84798aaa863a4909$export$e68cff63f76bd15b(props) {
|
|
72
|
+
const our_object = {};
|
|
73
|
+
return $gVhhF$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 $gVhhF$solidjs.useContext($84798aaa863a4909$var$ListingContext);
|
|
82
|
+
}
|
|
83
|
+
const $93304d59a9747aa6$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div></div>`, 2);
|
|
84
|
+
function $93304d59a9747aa6$export$94026ee33dbabc26(props) {
|
|
85
|
+
return (() => {
|
|
86
|
+
const _el$ = $gVhhF$solidjsweb.getNextElement($93304d59a9747aa6$var$_tmpl$);
|
|
87
|
+
$gVhhF$solidjsweb.effect(_$p => $gVhhF$solidjsweb.style(_el$, `position:relative;width:100%;padding-bottom:${1 / props.aspectRatio * 100}%`, _$p));
|
|
88
|
+
return _el$;
|
|
89
|
+
})();
|
|
90
|
+
}
|
|
91
|
+
const $19950faaac026e09$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<img>`, 1);
|
|
92
|
+
function $19950faaac026e09$export$e6fffe67d4cdd848(whatToWatch) {
|
|
93
|
+
const [size, setSize] = $gVhhF$solidjs.createSignal(0);
|
|
94
|
+
const resizeObserver = new ResizeObserver($gVhhF$depictaiutilishared.catchify(records => {
|
|
95
|
+
for (let j = 0; j < records.length; j++) {
|
|
96
|
+
const {
|
|
97
|
+
width: width
|
|
98
|
+
} = records[j].contentRect;
|
|
99
|
+
if (!width) continue;
|
|
100
|
+
// 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
|
|
101
|
+
const new_size = width * 1.05 * ((0, $gVhhF$depictaiutilishared.is_safari) ? 4 / 3 : 1);
|
|
102
|
+
setSize(Math.round(new_size));
|
|
103
|
+
}
|
|
104
|
+
}));
|
|
105
|
+
// 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.
|
|
106
|
+
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
107
|
+
const disconnect = (0, $gVhhF$depictaiutilishared.observer).onexists(whatToWatch, ({
|
|
108
|
+
element: element
|
|
109
|
+
}) => requestAnimationFrame($gVhhF$depictaiutilishared.catchify(() => resizeObserver.observe(element))));
|
|
110
|
+
$gVhhF$solidjs.onCleanup(() => {
|
|
111
|
+
resizeObserver.disconnect();
|
|
112
|
+
disconnect();
|
|
113
|
+
});
|
|
114
|
+
return size;
|
|
115
|
+
}
|
|
116
|
+
function $19950faaac026e09$export$6e5611bc7e57e477(props) {
|
|
117
|
+
// Enable reactive props
|
|
118
|
+
const otherOptions = $gVhhF$solidjs.createMemo(() => {
|
|
119
|
+
const cloned_props = {
|
|
120
|
+
...props
|
|
121
|
+
};
|
|
122
|
+
delete cloned_props.resolutions;
|
|
123
|
+
// @ts-ignore
|
|
124
|
+
delete cloned_props.size;
|
|
125
|
+
// @ts-ignore
|
|
126
|
+
delete cloned_props.src;
|
|
127
|
+
return cloned_props;
|
|
128
|
+
});
|
|
129
|
+
const src_options = $gVhhF$solidjs.createMemo(() => {
|
|
130
|
+
const src = new URL(props.src, location.origin);
|
|
131
|
+
const fallback_src = $19950faaac026e09$var$generateImageUrl(src, 400);
|
|
132
|
+
const srcset = $19950faaac026e09$var$make_srcset(src, props.resolutions || [64, 128, 256, 300, 400, 512, 768, 1024, 1280, 1536, 2048, 4096]);
|
|
133
|
+
return {
|
|
134
|
+
src: fallback_src,
|
|
135
|
+
srcset: srcset
|
|
136
|
+
};
|
|
137
|
+
});
|
|
138
|
+
return (() => {
|
|
139
|
+
const _el$ = $gVhhF$solidjsweb.getNextElement($19950faaac026e09$var$_tmpl$);
|
|
140
|
+
$gVhhF$solidjsweb.spread(_el$, $gVhhF$solidjsweb.mergeProps(otherOptions, src_options, {
|
|
141
|
+
get sizes() {
|
|
142
|
+
return props.size() + "px";
|
|
143
|
+
}
|
|
144
|
+
}), false, false);
|
|
145
|
+
$gVhhF$solidjsweb.runHydrationEvents();
|
|
146
|
+
return _el$;
|
|
147
|
+
})();
|
|
148
|
+
}
|
|
149
|
+
function $19950faaac026e09$var$make_srcset(url, resolutions) {
|
|
150
|
+
return resolutions.map(width => `${$19950faaac026e09$var$generateImageUrl(url, width)} ${width}w`).join(", ");
|
|
151
|
+
}
|
|
152
|
+
function $19950faaac026e09$var$generateImageUrl(url, width) {
|
|
153
|
+
url.searchParams.set("width", width);
|
|
154
|
+
return url.href;
|
|
155
|
+
}
|
|
156
|
+
const $a33065cfed827fc0$var$backupSizeSignal = /*@__PURE__*/$gVhhF$solidjs.createSignal();
|
|
157
|
+
const $a33065cfed827fc0$export$d7b7ab832c20e2f4 = /*@__PURE__*/Symbol("ShopifyContainedImage");
|
|
158
|
+
function $a33065cfed827fc0$export$e4b984597b71e989(props) {
|
|
159
|
+
const context = $84798aaa863a4909$export$8d0c4fdbb05a2f2e();
|
|
160
|
+
if (context && !context[$a33065cfed827fc0$export$d7b7ab832c20e2f4])
|
|
161
|
+
// create a signal that's the same for all items in this listing
|
|
162
|
+
context[$a33065cfed827fc0$export$d7b7ab832c20e2f4] = $gVhhF$solidjs.createSignal();
|
|
163
|
+
$gVhhF$depictaiutilishared.dlog("Checking for", $a33065cfed827fc0$export$d7b7ab832c20e2f4, "in", context);
|
|
164
|
+
const [currentImageSize, setCurrentImageSize] = context?.[$a33065cfed827fc0$export$d7b7ab832c20e2f4] || $a33065cfed827fc0$var$backupSizeSignal; // use global fallback signal (might lead to blurry images) if no context is available
|
|
165
|
+
const container = $gVhhF$solidjsweb.createComponent((0, $93304d59a9747aa6$export$94026ee33dbabc26), {
|
|
166
|
+
get aspectRatio() {
|
|
167
|
+
return props.aspectRatio;
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
const owner = $gVhhF$solidjs.getOwner();
|
|
171
|
+
let createdSizeAccessor = false;
|
|
172
|
+
let wasCleanedUp = false;
|
|
173
|
+
$gVhhF$solidjs.createEffect(() => {
|
|
174
|
+
if (currentImageSize() || wasCleanedUp) return; // We get into the effect when onCleanup is called if we don't have wasCleanedUp
|
|
175
|
+
// ensure we always have a size accessor
|
|
176
|
+
// 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
|
|
177
|
+
setCurrentImageSize(() => $gVhhF$solidjs.runWithOwner(owner, () => $19950faaac026e09$export$e6fffe67d4cdd848(container)));
|
|
178
|
+
});
|
|
179
|
+
$gVhhF$solidjs.onCleanup(() => {
|
|
180
|
+
wasCleanedUp = true; // important to set this before the function call below and always, so the dead effects don't create dead size accessors
|
|
181
|
+
if (!createdSizeAccessor) return;
|
|
182
|
+
$gVhhF$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
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
container.append($gVhhF$solidjsweb.createComponent((0, $19950faaac026e09$export$6e5611bc7e57e477), {
|
|
186
|
+
style: "width: 100%; height: 100%; object-fit: contain; position: absolute; inset: 0;",
|
|
187
|
+
get size() {
|
|
188
|
+
return $gVhhF$solidjs.createMemo(() => currentImageSize()?.() || 0);
|
|
189
|
+
},
|
|
190
|
+
get src() {
|
|
191
|
+
return props.src;
|
|
192
|
+
}
|
|
193
|
+
}));
|
|
194
|
+
return container;
|
|
195
|
+
}
|
|
196
|
+
const $0f313083912e447a$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<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>`, 4);
|
|
197
|
+
function $0f313083912e447a$export$8be2714ec7f169ee(props = {}) {
|
|
198
|
+
return (() => {
|
|
199
|
+
const _el$ = $gVhhF$solidjsweb.getNextElement($0f313083912e447a$var$_tmpl$);
|
|
200
|
+
$gVhhF$solidjsweb.effect(_p$ => {
|
|
201
|
+
const _v$ = props.width_ ?? 14,
|
|
202
|
+
_v$2 = props.height_ ?? 26;
|
|
203
|
+
_v$ !== _p$._v$ && $gVhhF$solidjsweb.setAttribute(_el$, "width", _p$._v$ = _v$);
|
|
204
|
+
_v$2 !== _p$._v$2 && $gVhhF$solidjsweb.setAttribute(_el$, "height", _p$._v$2 = _v$2);
|
|
205
|
+
return _p$;
|
|
206
|
+
}, {
|
|
207
|
+
_v$: undefined,
|
|
208
|
+
_v$2: undefined
|
|
209
|
+
});
|
|
210
|
+
return _el$;
|
|
211
|
+
})();
|
|
212
|
+
}
|
|
213
|
+
const $a0e53f99354809d9$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div></div>`, 2);
|
|
214
|
+
function $a0e53f99354809d9$export$6649caad96ef8870({
|
|
215
|
+
children: children,
|
|
216
|
+
slider_ref_: slider_ref_,
|
|
217
|
+
faded_opacity_ = 0.7,
|
|
218
|
+
mutation_plugins_ = [],
|
|
219
|
+
disable_fading_: disable_fading_,
|
|
220
|
+
arrow_width_: arrow_width_,
|
|
221
|
+
arrow_height_: arrow_height_
|
|
222
|
+
}) {
|
|
223
|
+
const slider = new (0, $gVhhF$depictaiutilishared.Amazing_Slider)({
|
|
224
|
+
button_contents: {
|
|
225
|
+
left: [(() => {
|
|
226
|
+
const _el$ = $gVhhF$solidjsweb.getNextElement($a0e53f99354809d9$var$_tmpl$);
|
|
227
|
+
$gVhhF$solidjsweb.insert(_el$, $gVhhF$solidjsweb.createComponent((0, $0f313083912e447a$export$8be2714ec7f169ee), {
|
|
228
|
+
height_: arrow_height_,
|
|
229
|
+
width_: arrow_width_
|
|
230
|
+
}));
|
|
231
|
+
return _el$;
|
|
232
|
+
})()],
|
|
233
|
+
right: [(() => {
|
|
234
|
+
const _el$2 = $gVhhF$solidjsweb.getNextElement($a0e53f99354809d9$var$_tmpl$);
|
|
235
|
+
$gVhhF$solidjsweb.insert(_el$2, $gVhhF$solidjsweb.createComponent((0, $0f313083912e447a$export$8be2714ec7f169ee), {
|
|
236
|
+
height_: arrow_height_,
|
|
237
|
+
width_: arrow_width_
|
|
238
|
+
}));
|
|
239
|
+
return _el$2;
|
|
240
|
+
})()]
|
|
241
|
+
},
|
|
242
|
+
constructor_plugins: [$gVhhF$depictaiutilishared.slider_snap_css().constructor_plugin],
|
|
243
|
+
mutation_plugins: [...(disable_fading_ ? [] : [$gVhhF$depictaiutilishared.slider_fading_factory({
|
|
244
|
+
threshold_: 0.96,
|
|
245
|
+
faded_opacity_: faded_opacity_
|
|
246
|
+
}).mutation_plugin_]), ...mutation_plugins_]
|
|
247
|
+
});
|
|
248
|
+
$gVhhF$solidjsweb.insert(slider.insert_here, children);
|
|
249
|
+
$gVhhF$solidjs.onCleanup(() => slider.observer.disconnect());
|
|
250
|
+
slider_ref_?.(slider);
|
|
251
|
+
return slider.container;
|
|
252
|
+
}
|
|
65
253
|
|
|
66
254
|
/** @jsxImportSource solid-js */
|
|
67
255
|
|
|
@@ -493,63 +681,6 @@ function $f48d0fbb00835aaa$export$445d8d3f5f706a40(props, container_element, ins
|
|
|
493
681
|
return [container_element, $gVhhF$solidjsweb.memo(view_more_button_container), $gVhhF$solidjsweb.memo(view_less_button_container), style_element];
|
|
494
682
|
}
|
|
495
683
|
$gVhhF$solidjsweb.delegateEvents(["click"]);
|
|
496
|
-
const $0f313083912e447a$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<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>`, 4);
|
|
497
|
-
function $0f313083912e447a$export$8be2714ec7f169ee(props = {}) {
|
|
498
|
-
return (() => {
|
|
499
|
-
const _el$ = $gVhhF$solidjsweb.getNextElement($0f313083912e447a$var$_tmpl$);
|
|
500
|
-
$gVhhF$solidjsweb.effect(_p$ => {
|
|
501
|
-
const _v$ = props.width_ ?? 14,
|
|
502
|
-
_v$2 = props.height_ ?? 26;
|
|
503
|
-
_v$ !== _p$._v$ && $gVhhF$solidjsweb.setAttribute(_el$, "width", _p$._v$ = _v$);
|
|
504
|
-
_v$2 !== _p$._v$2 && $gVhhF$solidjsweb.setAttribute(_el$, "height", _p$._v$2 = _v$2);
|
|
505
|
-
return _p$;
|
|
506
|
-
}, {
|
|
507
|
-
_v$: undefined,
|
|
508
|
-
_v$2: undefined
|
|
509
|
-
});
|
|
510
|
-
return _el$;
|
|
511
|
-
})();
|
|
512
|
-
}
|
|
513
|
-
const $a0e53f99354809d9$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div></div>`, 2);
|
|
514
|
-
function $a0e53f99354809d9$export$6649caad96ef8870({
|
|
515
|
-
children: children,
|
|
516
|
-
slider_ref_: slider_ref_,
|
|
517
|
-
faded_opacity_ = 0.7,
|
|
518
|
-
mutation_plugins_ = [],
|
|
519
|
-
disable_fading_: disable_fading_,
|
|
520
|
-
arrow_width_: arrow_width_,
|
|
521
|
-
arrow_height_: arrow_height_
|
|
522
|
-
}) {
|
|
523
|
-
const slider = new (0, $gVhhF$depictaiutilishared.Amazing_Slider)({
|
|
524
|
-
button_contents: {
|
|
525
|
-
left: [(() => {
|
|
526
|
-
const _el$ = $gVhhF$solidjsweb.getNextElement($a0e53f99354809d9$var$_tmpl$);
|
|
527
|
-
$gVhhF$solidjsweb.insert(_el$, $gVhhF$solidjsweb.createComponent((0, $0f313083912e447a$export$8be2714ec7f169ee), {
|
|
528
|
-
height_: arrow_height_,
|
|
529
|
-
width_: arrow_width_
|
|
530
|
-
}));
|
|
531
|
-
return _el$;
|
|
532
|
-
})()],
|
|
533
|
-
right: [(() => {
|
|
534
|
-
const _el$2 = $gVhhF$solidjsweb.getNextElement($a0e53f99354809d9$var$_tmpl$);
|
|
535
|
-
$gVhhF$solidjsweb.insert(_el$2, $gVhhF$solidjsweb.createComponent((0, $0f313083912e447a$export$8be2714ec7f169ee), {
|
|
536
|
-
height_: arrow_height_,
|
|
537
|
-
width_: arrow_width_
|
|
538
|
-
}));
|
|
539
|
-
return _el$2;
|
|
540
|
-
})()]
|
|
541
|
-
},
|
|
542
|
-
constructor_plugins: [$gVhhF$depictaiutilishared.slider_snap_css().constructor_plugin],
|
|
543
|
-
mutation_plugins: [...(disable_fading_ ? [] : [$gVhhF$depictaiutilishared.slider_fading_factory({
|
|
544
|
-
threshold_: 0.96,
|
|
545
|
-
faded_opacity_: faded_opacity_
|
|
546
|
-
}).mutation_plugin_]), ...mutation_plugins_]
|
|
547
|
-
});
|
|
548
|
-
$gVhhF$solidjsweb.insert(slider.insert_here, children);
|
|
549
|
-
$gVhhF$solidjs.onCleanup(() => slider.observer.disconnect());
|
|
550
|
-
slider_ref_?.(slider);
|
|
551
|
-
return slider.container;
|
|
552
|
-
}
|
|
553
684
|
function $363ce4d1d71041aa$export$d41d19e89346fa2({
|
|
554
685
|
recommendations_resource_: recommendations_resource_,
|
|
555
686
|
product_card_template_: product_card_template_,
|
|
@@ -659,15 +790,19 @@ function $72f96c4782db0b1b$export$9574e176201e5e8d(props) {
|
|
|
659
790
|
const [recommendations_resource_] = $gVhhF$solidjs.createResource(() => props.recommendations, recs => recs);
|
|
660
791
|
return (() => {
|
|
661
792
|
const _el$ = $gVhhF$solidjsweb.getNextElement($72f96c4782db0b1b$var$_tmpl$);
|
|
662
|
-
$gVhhF$solidjsweb.insert(_el$, (
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
793
|
+
$gVhhF$solidjsweb.insert(_el$, $gVhhF$solidjsweb.createComponent((0, $84798aaa863a4909$export$e68cff63f76bd15b), {
|
|
794
|
+
get children() {
|
|
795
|
+
return $363ce4d1d71041aa$export$d41d19e89346fa2({
|
|
796
|
+
product_card_template_: (...args) => props.product_card_template(...args),
|
|
797
|
+
recommendations_resource_: recommendations_resource_,
|
|
798
|
+
market_: () => props.market,
|
|
799
|
+
merchant_: () => props.merchant,
|
|
800
|
+
layout_options_: $gVhhF$solidjs.createMemo(() => ({
|
|
801
|
+
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(props.cols_at_size),
|
|
802
|
+
...grid_spacing_override()
|
|
803
|
+
}))
|
|
804
|
+
});
|
|
805
|
+
}
|
|
671
806
|
}));
|
|
672
807
|
return _el$;
|
|
673
808
|
})();
|
|
@@ -772,83 +907,25 @@ function $1f8dbf7e28b3eff2$export$9756467d34d91cdb(props) {
|
|
|
772
907
|
const [recommendations_resource_] = $gVhhF$solidjs.createResource(() => props.recommendations, recs => recs);
|
|
773
908
|
return (() => {
|
|
774
909
|
const _el$2 = $gVhhF$solidjsweb.getNextElement($1f8dbf7e28b3eff2$var$_tmpl$2);
|
|
775
|
-
$gVhhF$solidjsweb.insert(_el$2, (
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
910
|
+
$gVhhF$solidjsweb.insert(_el$2, $gVhhF$solidjsweb.createComponent((0, $84798aaa863a4909$export$e68cff63f76bd15b), {
|
|
911
|
+
get children() {
|
|
912
|
+
return $b8e79813f4f7ebe4$export$7da560f849543dff({
|
|
913
|
+
rows_object_: rows_object_,
|
|
914
|
+
product_card_template_: (...args) => props.product_card_template(...args),
|
|
915
|
+
recommendations_resource_: recommendations_resource_,
|
|
916
|
+
market_: () => props.market,
|
|
917
|
+
merchant_: () => props.merchant,
|
|
918
|
+
layout_options_: $gVhhF$solidjs.createMemo(() => ({
|
|
919
|
+
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(props.cols_at_size),
|
|
920
|
+
...grid_spacing_override()
|
|
921
|
+
}))
|
|
922
|
+
});
|
|
923
|
+
}
|
|
785
924
|
}));
|
|
786
925
|
return _el$2;
|
|
787
926
|
})();
|
|
788
927
|
}, "RecommendationGrid failed");
|
|
789
928
|
}
|
|
790
|
-
const $19950faaac026e09$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<img>`, 1);
|
|
791
|
-
function $19950faaac026e09$export$e6fffe67d4cdd848(whatToWatch) {
|
|
792
|
-
const [size, setSize] = $gVhhF$solidjs.createSignal(0);
|
|
793
|
-
const resizeObserver = new ResizeObserver($gVhhF$depictaiutilishared.catchify(records => {
|
|
794
|
-
for (let j = 0; j < records.length; j++) {
|
|
795
|
-
const {
|
|
796
|
-
width: width
|
|
797
|
-
} = records[j].contentRect;
|
|
798
|
-
if (!width) continue;
|
|
799
|
-
// 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
|
|
800
|
-
const new_size = width * 1.05 * ((0, $gVhhF$depictaiutilishared.is_safari) ? 4 / 3 : 1);
|
|
801
|
-
setSize(Math.round(new_size));
|
|
802
|
-
}
|
|
803
|
-
}));
|
|
804
|
-
// 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.
|
|
805
|
-
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
806
|
-
const disconnect = (0, $gVhhF$depictaiutilishared.observer).onexists(whatToWatch, ({
|
|
807
|
-
element: element
|
|
808
|
-
}) => requestAnimationFrame($gVhhF$depictaiutilishared.catchify(() => resizeObserver.observe(element))));
|
|
809
|
-
$gVhhF$solidjs.onCleanup(() => {
|
|
810
|
-
resizeObserver.disconnect();
|
|
811
|
-
disconnect();
|
|
812
|
-
});
|
|
813
|
-
return size;
|
|
814
|
-
}
|
|
815
|
-
function $19950faaac026e09$export$6e5611bc7e57e477({
|
|
816
|
-
src: raw_src,
|
|
817
|
-
size: size,
|
|
818
|
-
resolutions = [64, 128, 256, 300, 400, 512, 768, 1024, 1280, 1536, 2048, 4096],
|
|
819
|
-
...otherOptions
|
|
820
|
-
}) {
|
|
821
|
-
const src = new URL(raw_src, location.origin);
|
|
822
|
-
const fallbackSrc = $19950faaac026e09$var$generateImageUrl(src, 400);
|
|
823
|
-
const srcset = $19950faaac026e09$var$make_srcset(src, resolutions);
|
|
824
|
-
return (() => {
|
|
825
|
-
const _el$ = $gVhhF$solidjsweb.getNextElement($19950faaac026e09$var$_tmpl$);
|
|
826
|
-
$gVhhF$solidjsweb.spread(_el$, $gVhhF$solidjsweb.mergeProps(otherOptions, {
|
|
827
|
-
"src": fallbackSrc,
|
|
828
|
-
"srcset": srcset,
|
|
829
|
-
get sizes() {
|
|
830
|
-
return size() + "px";
|
|
831
|
-
}
|
|
832
|
-
}), false, false);
|
|
833
|
-
$gVhhF$solidjsweb.runHydrationEvents();
|
|
834
|
-
return _el$;
|
|
835
|
-
})();
|
|
836
|
-
}
|
|
837
|
-
function $19950faaac026e09$var$make_srcset(url, resolutions) {
|
|
838
|
-
return resolutions.map(width => `${$19950faaac026e09$var$generateImageUrl(url, width)} ${width}w`).join(", ");
|
|
839
|
-
}
|
|
840
|
-
function $19950faaac026e09$var$generateImageUrl(url, width) {
|
|
841
|
-
url.searchParams.set("width", width);
|
|
842
|
-
return url.href;
|
|
843
|
-
}
|
|
844
|
-
const $93304d59a9747aa6$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div></div>`, 2);
|
|
845
|
-
function $93304d59a9747aa6$export$94026ee33dbabc26(props) {
|
|
846
|
-
return (() => {
|
|
847
|
-
const _el$ = $gVhhF$solidjsweb.getNextElement($93304d59a9747aa6$var$_tmpl$);
|
|
848
|
-
$gVhhF$solidjsweb.effect(_$p => $gVhhF$solidjsweb.style(_el$, `position:relative;width:100%;padding-bottom:${1 / props.aspectRatio * 100}%`, _$p));
|
|
849
|
-
return _el$;
|
|
850
|
-
})();
|
|
851
|
-
}
|
|
852
929
|
function $4b455f60dadde8b8$export$5bad61ecde080b1f(...params) {
|
|
853
930
|
const {
|
|
854
931
|
collapse: collapse,
|
|
@@ -6540,26 +6617,30 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
|
|
|
6540
6617
|
severity_: "error",
|
|
6541
6618
|
message_: "Showing results failed",
|
|
6542
6619
|
get children() {
|
|
6543
|
-
return $
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6620
|
+
return $gVhhF$solidjsweb.createComponent((0, $84798aaa863a4909$export$e68cff63f76bd15b), {
|
|
6621
|
+
get children() {
|
|
6622
|
+
return $fe76fb463cc60b89$export$3925f87b1545cfc6({
|
|
6623
|
+
min_products_to_fetch_:
|
|
6624
|
+
// if you want to get if all products have been loaded you can add an optional signal here, see SearchPage
|
|
6625
|
+
min_products_to_fetch_,
|
|
6626
|
+
query_base_: query_base_,
|
|
6627
|
+
plp_results_: plp_results_,
|
|
6628
|
+
depict_api_: depict_api_,
|
|
6629
|
+
first_result_in_viewport_: first_result_in_viewport_,
|
|
6630
|
+
last_result_in_viewport_: last_result_in_viewport_,
|
|
6631
|
+
scroll_restoration_data_: scroll_restoration_data_,
|
|
6632
|
+
layout_options_: layout_options_,
|
|
6633
|
+
product_card_template_: product_card_template_,
|
|
6634
|
+
sort_or_filter_open_: sort_or_filter_open_,
|
|
6635
|
+
desktop_filter_elements_: desktop_filter_elements_,
|
|
6636
|
+
id_currently_querying_for_: query_id_,
|
|
6637
|
+
no_results_options_: {
|
|
6638
|
+
selected_filters_: selected_filters_,
|
|
6639
|
+
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
6640
|
+
i18n_: i18n_,
|
|
6641
|
+
local_filter_cache_: local_filter_cache_
|
|
6642
|
+
}
|
|
6643
|
+
});
|
|
6563
6644
|
}
|
|
6564
6645
|
});
|
|
6565
6646
|
}
|
|
@@ -7561,8 +7642,10 @@ function $fb29c6201c369e39$export$7de92c4c2205ebf3({
|
|
|
7561
7642
|
}) {
|
|
7562
7643
|
const [get_showing_recommendation_rows] = showing_recommendation_rows_; // We reset this in after_submit in search.tsx FYI
|
|
7563
7644
|
const rows_object = view_more_button_ ? $fb29c6201c369e39$var$make_state_saved_rows(showing_recommendation_rows_, i18n_) : "all";
|
|
7564
|
-
const [recommendations_resource] = $gVhhF$solidjs.createResource(
|
|
7565
|
-
|
|
7645
|
+
const [recommendations_resource] = $gVhhF$solidjs.createResource(() => all_products_loaded_() && search_query_base_(),
|
|
7646
|
+
// only fetch/refetch if all products are loaded
|
|
7647
|
+
query => query && depict_api_.get_recommended(query).then(r => r.displays));
|
|
7648
|
+
const should_show = $gVhhF$solidjs.createMemo(() => !!((recommendations_resource.loading || recommendations_resource()?.length) && all_products_loaded_()));
|
|
7566
7649
|
const num_placeholders_ = $gVhhF$solidjs.createMemo(() => (0, $aec24316ed262dc0$export$6c9030e511152266) + get_showing_recommendation_rows() * Math.max(...layout_options_().cols_at_size.map(([per_column]) => per_column)));
|
|
7567
7650
|
// Don't tear down elements every time one updates the page - don't put them within <Show>
|
|
7568
7651
|
const elements = (() => {
|
|
@@ -7592,7 +7675,10 @@ function $fb29c6201c369e39$export$7de92c4c2205ebf3({
|
|
|
7592
7675
|
get children() {
|
|
7593
7676
|
return (() => {
|
|
7594
7677
|
// IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
|
|
7595
|
-
const displays_by_key_ = $a73063cc642f3e5f$export$7f8bd308237ab5a5($gVhhF$solidjs.createMemo(
|
|
7678
|
+
const displays_by_key_ = $a73063cc642f3e5f$export$7f8bd308237ab5a5($gVhhF$solidjs.createMemo(prev => {
|
|
7679
|
+
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
|
|
7680
|
+
return recommendations_resource() || [];
|
|
7681
|
+
}));
|
|
7596
7682
|
return $a73063cc642f3e5f$export$43f0fb951fcb0c54({
|
|
7597
7683
|
displays_by_key_: displays_by_key_,
|
|
7598
7684
|
merchant_: $gVhhF$solidjs.createMemo(() => search_query_base_().tenant),
|
|
@@ -7608,7 +7694,7 @@ function $fb29c6201c369e39$export$7de92c4c2205ebf3({
|
|
|
7608
7694
|
})();
|
|
7609
7695
|
return $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
|
|
7610
7696
|
get when() {
|
|
7611
|
-
return
|
|
7697
|
+
return should_show();
|
|
7612
7698
|
},
|
|
7613
7699
|
children: elements
|
|
7614
7700
|
});
|
|
@@ -9066,17 +9152,21 @@ function $f40a47a30a358305$export$1c593cbd6f1e10bc({
|
|
|
9066
9152
|
severity_: "error",
|
|
9067
9153
|
message_: "Instant results failed",
|
|
9068
9154
|
get children() {
|
|
9069
|
-
return $
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9155
|
+
return $gVhhF$solidjsweb.createComponent((0, $84798aaa863a4909$export$e68cff63f76bd15b), {
|
|
9156
|
+
get children() {
|
|
9157
|
+
return $6ae556e536054e87$export$62f101a8aa597bf8({
|
|
9158
|
+
search_field_value_: search_field_value_,
|
|
9159
|
+
depict_api_: depict_api_,
|
|
9160
|
+
tenant_: tenant_,
|
|
9161
|
+
i18n_: i18n_,
|
|
9162
|
+
market_: market_,
|
|
9163
|
+
set_total_num_results_accessor_: set_total_num_results_accessor_,
|
|
9164
|
+
router_: router_,
|
|
9165
|
+
set_modal_search_results_: set_modal_search_results_,
|
|
9166
|
+
content_search_enabled_: content_search_enabled_,
|
|
9167
|
+
...instant_results_options_
|
|
9168
|
+
});
|
|
9169
|
+
}
|
|
9080
9170
|
});
|
|
9081
9171
|
}
|
|
9082
9172
|
}), _el$10, _co$2);
|
|
@@ -9977,14 +10067,18 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
|
|
|
9977
10067
|
return content_search_enabled_();
|
|
9978
10068
|
},
|
|
9979
10069
|
get children() {
|
|
9980
|
-
return $gVhhF$solidjsweb.createComponent((0, $
|
|
9981
|
-
|
|
9982
|
-
|
|
9983
|
-
|
|
9984
|
-
|
|
9985
|
-
|
|
9986
|
-
|
|
9987
|
-
|
|
10070
|
+
return $gVhhF$solidjsweb.createComponent((0, $84798aaa863a4909$export$e68cff63f76bd15b), {
|
|
10071
|
+
get children() {
|
|
10072
|
+
return $gVhhF$solidjsweb.createComponent((0, $3716b8caf7f959e2$export$6d0c9c22f6652669), {
|
|
10073
|
+
content_results_rows_: content_results_rows_,
|
|
10074
|
+
search_results_: search_results_,
|
|
10075
|
+
i18n_: i18n_,
|
|
10076
|
+
get_search_query_: get_search_query_,
|
|
10077
|
+
layout_options_: content_layout_options_,
|
|
10078
|
+
router_: router_,
|
|
10079
|
+
query_base_: search_query_base_
|
|
10080
|
+
});
|
|
10081
|
+
}
|
|
9988
10082
|
});
|
|
9989
10083
|
}
|
|
9990
10084
|
});
|
|
@@ -10018,28 +10112,32 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
|
|
|
10018
10112
|
severity_: "error",
|
|
10019
10113
|
message_: "Search results failed",
|
|
10020
10114
|
get children() {
|
|
10021
|
-
return $
|
|
10022
|
-
|
|
10023
|
-
|
|
10024
|
-
|
|
10025
|
-
|
|
10026
|
-
|
|
10027
|
-
|
|
10028
|
-
|
|
10029
|
-
|
|
10030
|
-
|
|
10031
|
-
|
|
10032
|
-
|
|
10033
|
-
|
|
10034
|
-
|
|
10035
|
-
|
|
10036
|
-
|
|
10037
|
-
|
|
10038
|
-
|
|
10039
|
-
|
|
10040
|
-
|
|
10041
|
-
|
|
10042
|
-
|
|
10115
|
+
return $gVhhF$solidjsweb.createComponent((0, $84798aaa863a4909$export$e68cff63f76bd15b), {
|
|
10116
|
+
get children() {
|
|
10117
|
+
return $fe76fb463cc60b89$export$3925f87b1545cfc6({
|
|
10118
|
+
all_products_loaded_: all_products_loaded_,
|
|
10119
|
+
min_products_to_fetch_: min_products_to_fetch_,
|
|
10120
|
+
query_base_: search_query_base_,
|
|
10121
|
+
plp_results_: search_results_,
|
|
10122
|
+
depict_api_: depict_api_,
|
|
10123
|
+
first_result_in_viewport_: first_result_in_viewport_,
|
|
10124
|
+
last_result_in_viewport_: last_result_in_viewport_,
|
|
10125
|
+
scroll_restoration_data_: scroll_restoration_data_,
|
|
10126
|
+
desktop_filter_elements_: desktop_filter_elements_,
|
|
10127
|
+
product_card_template_: product_card_template_,
|
|
10128
|
+
layout_options_: layout_options_,
|
|
10129
|
+
sort_or_filter_open_: sort_or_filter_open_,
|
|
10130
|
+
id_currently_querying_for_: get_search_query_,
|
|
10131
|
+
no_results_options_: {
|
|
10132
|
+
selected_filters_: selected_filters_,
|
|
10133
|
+
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
10134
|
+
local_filter_cache_: local_filter_cache_,
|
|
10135
|
+
i18n_: {
|
|
10136
|
+
...i18n_,
|
|
10137
|
+
no_results_text_: no_results_text_
|
|
10138
|
+
}
|
|
10139
|
+
}
|
|
10140
|
+
});
|
|
10043
10141
|
}
|
|
10044
10142
|
});
|
|
10045
10143
|
}
|
|
@@ -10052,17 +10150,21 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
|
|
|
10052
10150
|
severity_: "error",
|
|
10053
10151
|
message_: "Search recommendations failed",
|
|
10054
10152
|
get children() {
|
|
10055
|
-
return $gVhhF$solidjsweb.createComponent((0, $
|
|
10056
|
-
|
|
10057
|
-
|
|
10058
|
-
|
|
10059
|
-
|
|
10060
|
-
|
|
10061
|
-
|
|
10062
|
-
|
|
10063
|
-
|
|
10064
|
-
|
|
10065
|
-
|
|
10153
|
+
return $gVhhF$solidjsweb.createComponent((0, $84798aaa863a4909$export$e68cff63f76bd15b), {
|
|
10154
|
+
get children() {
|
|
10155
|
+
return $gVhhF$solidjsweb.createComponent((0, $fb29c6201c369e39$export$7de92c4c2205ebf3), {
|
|
10156
|
+
depict_api_: depict_api_,
|
|
10157
|
+
i18n_: i18n_,
|
|
10158
|
+
search_query_base_: search_query_base_,
|
|
10159
|
+
get layout_options_() {
|
|
10160
|
+
return $gVhhF$solidjs.createMemo(() => recommendations_layout_options_?.() ?? layout_options_());
|
|
10161
|
+
},
|
|
10162
|
+
showing_recommendation_rows_: showing_recommendation_rows_,
|
|
10163
|
+
view_more_button_: search_recs_view_more_,
|
|
10164
|
+
product_card_template_: product_card_template_,
|
|
10165
|
+
all_products_loaded_: get_all_products_loaded
|
|
10166
|
+
});
|
|
10167
|
+
}
|
|
10066
10168
|
});
|
|
10067
10169
|
}
|
|
10068
10170
|
});
|