@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.15",
|
|
4
4
|
"description": "Base package containing the actual UI of Depict UI along with translations, with a not-simplified API. We recommend using @depict-ai/js-ui or @depict-ai/react-ui instead.",
|
|
5
5
|
"packageManager": "yarn@3.2.2",
|
|
6
6
|
"sass": "styles.scss",
|
package/server/ES10/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var $3hooq$depictaiutilishared = require("@depict-ai/utilishared/ES10");
|
|
2
|
-
var $3hooq$solidjs = require("solid-js");
|
|
3
2
|
var $3hooq$solidjsweb = require("solid-js/web");
|
|
3
|
+
var $3hooq$solidjs = require("solid-js");
|
|
4
4
|
var $3hooq$babelruntimehelpersclassPrivateFieldSet = require("@babel/runtime/helpers/classPrivateFieldSet");
|
|
5
5
|
var $3hooq$babelruntimehelpersclassPrivateFieldGet = require("@babel/runtime/helpers/classPrivateFieldGet");
|
|
6
6
|
var $3hooq$babelruntimehelpersdefineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
@@ -16,6 +16,11 @@ function $parcel$export(e, n, v, s) {
|
|
|
16
16
|
function $parcel$interopDefault(a) {
|
|
17
17
|
return a && a.__esModule ? a.default : a;
|
|
18
18
|
}
|
|
19
|
+
$parcel$export(module.exports, "shopifyContainedImageContextSymbol", () => $28535bb7671c63d1$export$d7b7ab832c20e2f4);
|
|
20
|
+
$parcel$export(module.exports, "ListingProvider", () => $d067f3a30f047b41$export$e68cff63f76bd15b);
|
|
21
|
+
$parcel$export(module.exports, "useListing", () => $d067f3a30f047b41$export$8d0c4fdbb05a2f2e);
|
|
22
|
+
$parcel$export(module.exports, "ShopifyContainedImage", () => $28535bb7671c63d1$export$e4b984597b71e989);
|
|
23
|
+
$parcel$export(module.exports, "SlidableItems", () => $ad8ec7729fffeb9c$export$6649caad96ef8870);
|
|
19
24
|
$parcel$export(module.exports, "make_accurate_size_accessor", () => $13671aa5e984acd9$export$9f191182275e9ef);
|
|
20
25
|
$parcel$export(module.exports, "RecommendationSlider", () => $2badc30d7c6610e1$export$9574e176201e5e8d);
|
|
21
26
|
$parcel$export(module.exports, "RecommendationGrid", () => $41227f10ad680afd$export$9756467d34d91cdb);
|
|
@@ -67,7 +72,168 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $33eed84f447aa0c0$expo
|
|
|
67
72
|
$parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447aa0c0$export$7bf543b9d9be2c22);
|
|
68
73
|
$parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
|
|
69
74
|
/*! Depict.ai search and product listing SDK */
|
|
70
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "2.0.
|
|
75
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "2.0.15";
|
|
76
|
+
const $d067f3a30f047b41$var$ListingContext = /*@__PURE__*/$3hooq$solidjs.createContext();
|
|
77
|
+
function $d067f3a30f047b41$export$e68cff63f76bd15b(props) {
|
|
78
|
+
const our_object = {};
|
|
79
|
+
return $3hooq$solidjsweb.createComponent($d067f3a30f047b41$var$ListingContext.Provider, {
|
|
80
|
+
value: our_object,
|
|
81
|
+
get children() {
|
|
82
|
+
return props.children;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function $d067f3a30f047b41$export$8d0c4fdbb05a2f2e() {
|
|
87
|
+
return $3hooq$solidjs.useContext($d067f3a30f047b41$var$ListingContext);
|
|
88
|
+
}
|
|
89
|
+
const $ce467edb5343cfcd$var$_tmpl$ = ["<div", ' style="', '"></div>'];
|
|
90
|
+
function $ce467edb5343cfcd$export$94026ee33dbabc26(props) {
|
|
91
|
+
return $3hooq$solidjsweb.ssr($ce467edb5343cfcd$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.ssrStyle("position:relative;width:100%;padding-bottom:".concat(1 / props.aspectRatio * 100, "%")));
|
|
92
|
+
}
|
|
93
|
+
function $858fdcf73148519f$export$e6fffe67d4cdd848(whatToWatch) {
|
|
94
|
+
const [size, setSize] = $3hooq$solidjs.createSignal(0);
|
|
95
|
+
const resizeObserver = new ResizeObserver($3hooq$depictaiutilishared.catchify(records => {
|
|
96
|
+
for (let j = 0; j < records.length; j++) {
|
|
97
|
+
const {
|
|
98
|
+
width: width
|
|
99
|
+
} = records[j].contentRect;
|
|
100
|
+
if (!width) continue;
|
|
101
|
+
// 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
|
|
102
|
+
const new_size = width * 1.05 * ((0, $3hooq$depictaiutilishared.is_safari) ? 4 / 3 : 1);
|
|
103
|
+
setSize(Math.round(new_size));
|
|
104
|
+
}
|
|
105
|
+
}));
|
|
106
|
+
// 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.
|
|
107
|
+
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
108
|
+
const disconnect = (0, $3hooq$depictaiutilishared.observer).onexists(whatToWatch, _ref => {
|
|
109
|
+
let {
|
|
110
|
+
element: element
|
|
111
|
+
} = _ref;
|
|
112
|
+
return requestAnimationFrame($3hooq$depictaiutilishared.catchify(() => resizeObserver.observe(element)));
|
|
113
|
+
});
|
|
114
|
+
$3hooq$solidjs.onCleanup(() => {
|
|
115
|
+
resizeObserver.disconnect();
|
|
116
|
+
disconnect();
|
|
117
|
+
});
|
|
118
|
+
return size;
|
|
119
|
+
}
|
|
120
|
+
function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
121
|
+
// Enable reactive props
|
|
122
|
+
const otherOptions = $3hooq$solidjs.createMemo(() => {
|
|
123
|
+
const cloned_props = {
|
|
124
|
+
...props
|
|
125
|
+
};
|
|
126
|
+
delete cloned_props.resolutions;
|
|
127
|
+
// @ts-ignore
|
|
128
|
+
delete cloned_props.size;
|
|
129
|
+
// @ts-ignore
|
|
130
|
+
delete cloned_props.src;
|
|
131
|
+
return cloned_props;
|
|
132
|
+
});
|
|
133
|
+
const src_options = $3hooq$solidjs.createMemo(() => {
|
|
134
|
+
const src = new URL(props.src, location.origin);
|
|
135
|
+
const fallback_src = $858fdcf73148519f$var$generateImageUrl(src, 400);
|
|
136
|
+
const srcset = $858fdcf73148519f$var$make_srcset(src, props.resolutions || [64, 128, 256, 300, 400, 512, 768, 1024, 1280, 1536, 2048, 4096]);
|
|
137
|
+
return {
|
|
138
|
+
src: fallback_src,
|
|
139
|
+
srcset: srcset
|
|
140
|
+
};
|
|
141
|
+
});
|
|
142
|
+
return $3hooq$solidjsweb.ssrElement("img", () => ({
|
|
143
|
+
...otherOptions,
|
|
144
|
+
...src_options(),
|
|
145
|
+
"sizes": props.size() + "px"
|
|
146
|
+
}), undefined, true);
|
|
147
|
+
}
|
|
148
|
+
function $858fdcf73148519f$var$make_srcset(url, resolutions) {
|
|
149
|
+
return resolutions.map(width => "".concat($858fdcf73148519f$var$generateImageUrl(url, width), " ").concat(width, "w")).join(", ");
|
|
150
|
+
}
|
|
151
|
+
function $858fdcf73148519f$var$generateImageUrl(url, width) {
|
|
152
|
+
url.searchParams.set("width", width);
|
|
153
|
+
return url.href;
|
|
154
|
+
}
|
|
155
|
+
const $28535bb7671c63d1$var$backupSizeSignal = /*@__PURE__*/$3hooq$solidjs.createSignal();
|
|
156
|
+
const $28535bb7671c63d1$export$d7b7ab832c20e2f4 = /*@__PURE__*/Symbol("ShopifyContainedImage");
|
|
157
|
+
function $28535bb7671c63d1$export$e4b984597b71e989(props) {
|
|
158
|
+
const context = $d067f3a30f047b41$export$8d0c4fdbb05a2f2e();
|
|
159
|
+
if (context && !context[$28535bb7671c63d1$export$d7b7ab832c20e2f4])
|
|
160
|
+
// create a signal that's the same for all items in this listing
|
|
161
|
+
context[$28535bb7671c63d1$export$d7b7ab832c20e2f4] = $3hooq$solidjs.createSignal();
|
|
162
|
+
$3hooq$depictaiutilishared.dlog("Checking for", $28535bb7671c63d1$export$d7b7ab832c20e2f4, "in", context);
|
|
163
|
+
const [currentImageSize, setCurrentImageSize] = (context === null || context === void 0 ? void 0 : context[$28535bb7671c63d1$export$d7b7ab832c20e2f4]) || $28535bb7671c63d1$var$backupSizeSignal; // use global fallback signal (might lead to blurry images) if no context is available
|
|
164
|
+
const container = $3hooq$solidjsweb.createComponent((0, $ce467edb5343cfcd$export$94026ee33dbabc26), {
|
|
165
|
+
get aspectRatio() {
|
|
166
|
+
return props.aspectRatio;
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
const owner = $3hooq$solidjs.getOwner();
|
|
170
|
+
let createdSizeAccessor = false;
|
|
171
|
+
let wasCleanedUp = false;
|
|
172
|
+
$3hooq$solidjs.createEffect(() => {
|
|
173
|
+
if (currentImageSize() || wasCleanedUp) return; // We get into the effect when onCleanup is called if we don't have wasCleanedUp
|
|
174
|
+
// ensure we always have a size accessor
|
|
175
|
+
// 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
|
|
176
|
+
setCurrentImageSize(() => $3hooq$solidjs.runWithOwner(owner, () => $858fdcf73148519f$export$e6fffe67d4cdd848(container)));
|
|
177
|
+
});
|
|
178
|
+
$3hooq$solidjs.onCleanup(() => {
|
|
179
|
+
wasCleanedUp = true; // important to set this before the function call below and always, so the dead effects don't create dead size accessors
|
|
180
|
+
if (!createdSizeAccessor) return;
|
|
181
|
+
$3hooq$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
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
container.append($3hooq$solidjsweb.createComponent((0, $858fdcf73148519f$export$6e5611bc7e57e477), {
|
|
185
|
+
style: "width: 100%; height: 100%; object-fit: contain; position: absolute; inset: 0;",
|
|
186
|
+
get size() {
|
|
187
|
+
return $3hooq$solidjs.createMemo(() => {
|
|
188
|
+
var _currentImageSize;
|
|
189
|
+
return ((_currentImageSize = currentImageSize()) === null || _currentImageSize === void 0 ? void 0 : _currentImageSize()) || 0;
|
|
190
|
+
});
|
|
191
|
+
},
|
|
192
|
+
get src() {
|
|
193
|
+
return props.src;
|
|
194
|
+
}
|
|
195
|
+
}));
|
|
196
|
+
return container;
|
|
197
|
+
}
|
|
198
|
+
const $9d19451330d04c3c$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>'];
|
|
199
|
+
function $9d19451330d04c3c$export$8be2714ec7f169ee() {
|
|
200
|
+
var _$escape2, _$escape3;
|
|
201
|
+
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
202
|
+
return $3hooq$solidjsweb.ssr($9d19451330d04c3c$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.ssrAttribute("width", (_$escape2 = $3hooq$solidjsweb.escape(props.width_, true)) !== null && _$escape2 !== void 0 ? _$escape2 : 14, false) + $3hooq$solidjsweb.ssrAttribute("height", (_$escape3 = $3hooq$solidjsweb.escape(props.height_, true)) !== null && _$escape3 !== void 0 ? _$escape3 : 26, false));
|
|
203
|
+
}
|
|
204
|
+
const $ad8ec7729fffeb9c$var$_tmpl$ = ["<div", ">", "</div>"];
|
|
205
|
+
function $ad8ec7729fffeb9c$export$6649caad96ef8870(_ref) {
|
|
206
|
+
let {
|
|
207
|
+
children: children,
|
|
208
|
+
slider_ref_: slider_ref_,
|
|
209
|
+
faded_opacity_ = 0.7,
|
|
210
|
+
mutation_plugins_ = [],
|
|
211
|
+
disable_fading_: disable_fading_,
|
|
212
|
+
arrow_width_: arrow_width_,
|
|
213
|
+
arrow_height_: arrow_height_
|
|
214
|
+
} = _ref;
|
|
215
|
+
const slider = new (0, $3hooq$depictaiutilishared.Amazing_Slider)({
|
|
216
|
+
button_contents: {
|
|
217
|
+
left: [$3hooq$solidjsweb.ssr($ad8ec7729fffeb9c$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $9d19451330d04c3c$export$8be2714ec7f169ee), {
|
|
218
|
+
height_: arrow_height_,
|
|
219
|
+
width_: arrow_width_
|
|
220
|
+
})))],
|
|
221
|
+
right: [$3hooq$solidjsweb.ssr($ad8ec7729fffeb9c$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $9d19451330d04c3c$export$8be2714ec7f169ee), {
|
|
222
|
+
height_: arrow_height_,
|
|
223
|
+
width_: arrow_width_
|
|
224
|
+
})))]
|
|
225
|
+
},
|
|
226
|
+
constructor_plugins: [$3hooq$depictaiutilishared.slider_snap_css().constructor_plugin],
|
|
227
|
+
mutation_plugins: [...(disable_fading_ ? [] : [$3hooq$depictaiutilishared.slider_fading_factory({
|
|
228
|
+
threshold_: 0.96,
|
|
229
|
+
faded_opacity_: faded_opacity_
|
|
230
|
+
}).mutation_plugin_]), ...mutation_plugins_]
|
|
231
|
+
});
|
|
232
|
+
$3hooq$solidjsweb.insert(slider.insert_here, children);
|
|
233
|
+
$3hooq$solidjs.onCleanup(() => slider.observer.disconnect());
|
|
234
|
+
slider_ref_ === null || slider_ref_ === void 0 || slider_ref_(slider);
|
|
235
|
+
return slider.container;
|
|
236
|
+
}
|
|
71
237
|
|
|
72
238
|
/** @jsxImportSource solid-js */
|
|
73
239
|
|
|
@@ -492,45 +658,6 @@ function $6c2c739b113a8ddf$export$445d8d3f5f706a40(props, container_element) {
|
|
|
492
658
|
if (insert_after_container) container_element.after(style_element);
|
|
493
659
|
return [container_element, view_more_button_container(), view_less_button_container(), style_element];
|
|
494
660
|
}
|
|
495
|
-
const $9d19451330d04c3c$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>'];
|
|
496
|
-
function $9d19451330d04c3c$export$8be2714ec7f169ee() {
|
|
497
|
-
var _$escape2, _$escape3;
|
|
498
|
-
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
499
|
-
return $3hooq$solidjsweb.ssr($9d19451330d04c3c$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.ssrAttribute("width", (_$escape2 = $3hooq$solidjsweb.escape(props.width_, true)) !== null && _$escape2 !== void 0 ? _$escape2 : 14, false) + $3hooq$solidjsweb.ssrAttribute("height", (_$escape3 = $3hooq$solidjsweb.escape(props.height_, true)) !== null && _$escape3 !== void 0 ? _$escape3 : 26, false));
|
|
500
|
-
}
|
|
501
|
-
const $ad8ec7729fffeb9c$var$_tmpl$ = ["<div", ">", "</div>"];
|
|
502
|
-
function $ad8ec7729fffeb9c$export$6649caad96ef8870(_ref) {
|
|
503
|
-
let {
|
|
504
|
-
children: children,
|
|
505
|
-
slider_ref_: slider_ref_,
|
|
506
|
-
faded_opacity_ = 0.7,
|
|
507
|
-
mutation_plugins_ = [],
|
|
508
|
-
disable_fading_: disable_fading_,
|
|
509
|
-
arrow_width_: arrow_width_,
|
|
510
|
-
arrow_height_: arrow_height_
|
|
511
|
-
} = _ref;
|
|
512
|
-
const slider = new (0, $3hooq$depictaiutilishared.Amazing_Slider)({
|
|
513
|
-
button_contents: {
|
|
514
|
-
left: [$3hooq$solidjsweb.ssr($ad8ec7729fffeb9c$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $9d19451330d04c3c$export$8be2714ec7f169ee), {
|
|
515
|
-
height_: arrow_height_,
|
|
516
|
-
width_: arrow_width_
|
|
517
|
-
})))],
|
|
518
|
-
right: [$3hooq$solidjsweb.ssr($ad8ec7729fffeb9c$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $9d19451330d04c3c$export$8be2714ec7f169ee), {
|
|
519
|
-
height_: arrow_height_,
|
|
520
|
-
width_: arrow_width_
|
|
521
|
-
})))]
|
|
522
|
-
},
|
|
523
|
-
constructor_plugins: [$3hooq$depictaiutilishared.slider_snap_css().constructor_plugin],
|
|
524
|
-
mutation_plugins: [...(disable_fading_ ? [] : [$3hooq$depictaiutilishared.slider_fading_factory({
|
|
525
|
-
threshold_: 0.96,
|
|
526
|
-
faded_opacity_: faded_opacity_
|
|
527
|
-
}).mutation_plugin_]), ...mutation_plugins_]
|
|
528
|
-
});
|
|
529
|
-
$3hooq$solidjsweb.insert(slider.insert_here, children);
|
|
530
|
-
$3hooq$solidjs.onCleanup(() => slider.observer.disconnect());
|
|
531
|
-
slider_ref_ === null || slider_ref_ === void 0 || slider_ref_(slider);
|
|
532
|
-
return slider.container;
|
|
533
|
-
}
|
|
534
661
|
function $236a257ee52e5414$export$d41d19e89346fa2(_ref) {
|
|
535
662
|
let {
|
|
536
663
|
recommendations_resource_: recommendations_resource_,
|
|
@@ -643,17 +770,21 @@ function $2badc30d7c6610e1$export$9574e176201e5e8d(props) {
|
|
|
643
770
|
};
|
|
644
771
|
});
|
|
645
772
|
const [recommendations_resource_] = $3hooq$solidjs.createResource(() => props.recommendations, recs => recs);
|
|
646
|
-
return $3hooq$solidjsweb.ssr($2badc30d7c6610e1$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape($
|
|
647
|
-
|
|
648
|
-
return
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
773
|
+
return $3hooq$solidjsweb.ssr($2badc30d7c6610e1$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $d067f3a30f047b41$export$e68cff63f76bd15b), {
|
|
774
|
+
get children() {
|
|
775
|
+
return $236a257ee52e5414$export$d41d19e89346fa2({
|
|
776
|
+
product_card_template_: function () {
|
|
777
|
+
return props.product_card_template(...arguments);
|
|
778
|
+
},
|
|
779
|
+
recommendations_resource_: recommendations_resource_,
|
|
780
|
+
market_: () => props.market,
|
|
781
|
+
merchant_: () => props.merchant,
|
|
782
|
+
layout_options_: $3hooq$solidjs.createMemo(() => ({
|
|
783
|
+
cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(props.cols_at_size),
|
|
784
|
+
...grid_spacing_override()
|
|
785
|
+
}))
|
|
786
|
+
});
|
|
787
|
+
}
|
|
657
788
|
})));
|
|
658
789
|
}, "RecommendationSlider failed");
|
|
659
790
|
}
|
|
@@ -746,76 +877,25 @@ function $41227f10ad680afd$export$9756467d34d91cdb(props) {
|
|
|
746
877
|
};
|
|
747
878
|
});
|
|
748
879
|
const [recommendations_resource_] = $3hooq$solidjs.createResource(() => props.recommendations, recs => recs);
|
|
749
|
-
return $3hooq$solidjsweb.ssr($41227f10ad680afd$var$_tmpl$2, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape($
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
880
|
+
return $3hooq$solidjsweb.ssr($41227f10ad680afd$var$_tmpl$2, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $d067f3a30f047b41$export$e68cff63f76bd15b), {
|
|
881
|
+
get children() {
|
|
882
|
+
return $2c920813c92d6987$export$7da560f849543dff({
|
|
883
|
+
rows_object_: rows_object_,
|
|
884
|
+
product_card_template_: function () {
|
|
885
|
+
return props.product_card_template(...arguments);
|
|
886
|
+
},
|
|
887
|
+
recommendations_resource_: recommendations_resource_,
|
|
888
|
+
market_: () => props.market,
|
|
889
|
+
merchant_: () => props.merchant,
|
|
890
|
+
layout_options_: $3hooq$solidjs.createMemo(() => ({
|
|
891
|
+
cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(props.cols_at_size),
|
|
892
|
+
...grid_spacing_override()
|
|
893
|
+
}))
|
|
894
|
+
});
|
|
895
|
+
}
|
|
761
896
|
})));
|
|
762
897
|
}, "RecommendationGrid failed");
|
|
763
898
|
}
|
|
764
|
-
function $858fdcf73148519f$export$e6fffe67d4cdd848(whatToWatch) {
|
|
765
|
-
const [size, setSize] = $3hooq$solidjs.createSignal(0);
|
|
766
|
-
const resizeObserver = new ResizeObserver($3hooq$depictaiutilishared.catchify(records => {
|
|
767
|
-
for (let j = 0; j < records.length; j++) {
|
|
768
|
-
const {
|
|
769
|
-
width: width
|
|
770
|
-
} = records[j].contentRect;
|
|
771
|
-
if (!width) continue;
|
|
772
|
-
// 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
|
|
773
|
-
const new_size = width * 1.05 * ((0, $3hooq$depictaiutilishared.is_safari) ? 4 / 3 : 1);
|
|
774
|
-
setSize(Math.round(new_size));
|
|
775
|
-
}
|
|
776
|
-
}));
|
|
777
|
-
// 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.
|
|
778
|
-
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
779
|
-
const disconnect = (0, $3hooq$depictaiutilishared.observer).onexists(whatToWatch, _ref => {
|
|
780
|
-
let {
|
|
781
|
-
element: element
|
|
782
|
-
} = _ref;
|
|
783
|
-
return requestAnimationFrame($3hooq$depictaiutilishared.catchify(() => resizeObserver.observe(element)));
|
|
784
|
-
});
|
|
785
|
-
$3hooq$solidjs.onCleanup(() => {
|
|
786
|
-
resizeObserver.disconnect();
|
|
787
|
-
disconnect();
|
|
788
|
-
});
|
|
789
|
-
return size;
|
|
790
|
-
}
|
|
791
|
-
function $858fdcf73148519f$export$6e5611bc7e57e477(_ref2) {
|
|
792
|
-
let {
|
|
793
|
-
src: raw_src,
|
|
794
|
-
size: size,
|
|
795
|
-
resolutions = [64, 128, 256, 300, 400, 512, 768, 1024, 1280, 1536, 2048, 4096],
|
|
796
|
-
...otherOptions
|
|
797
|
-
} = _ref2;
|
|
798
|
-
const src = new URL(raw_src, location.origin);
|
|
799
|
-
const fallbackSrc = $858fdcf73148519f$var$generateImageUrl(src, 400);
|
|
800
|
-
const srcset = $858fdcf73148519f$var$make_srcset(src, resolutions);
|
|
801
|
-
return $3hooq$solidjsweb.ssrElement("img", () => ({
|
|
802
|
-
...otherOptions,
|
|
803
|
-
"src": fallbackSrc,
|
|
804
|
-
"srcset": srcset,
|
|
805
|
-
"sizes": size() + "px"
|
|
806
|
-
}), undefined, true);
|
|
807
|
-
}
|
|
808
|
-
function $858fdcf73148519f$var$make_srcset(url, resolutions) {
|
|
809
|
-
return resolutions.map(width => "".concat($858fdcf73148519f$var$generateImageUrl(url, width), " ").concat(width, "w")).join(", ");
|
|
810
|
-
}
|
|
811
|
-
function $858fdcf73148519f$var$generateImageUrl(url, width) {
|
|
812
|
-
url.searchParams.set("width", width);
|
|
813
|
-
return url.href;
|
|
814
|
-
}
|
|
815
|
-
const $ce467edb5343cfcd$var$_tmpl$ = ["<div", ' style="', '"></div>'];
|
|
816
|
-
function $ce467edb5343cfcd$export$94026ee33dbabc26(props) {
|
|
817
|
-
return $3hooq$solidjsweb.ssr($ce467edb5343cfcd$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.ssrStyle("position:relative;width:100%;padding-bottom:".concat(1 / props.aspectRatio * 100, "%")));
|
|
818
|
-
}
|
|
819
899
|
function $d6d51b09cb2116a6$export$5bad61ecde080b1f() {
|
|
820
900
|
const {
|
|
821
901
|
collapse: collapse,
|
|
@@ -5697,26 +5777,30 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
5697
5777
|
severity_: "error",
|
|
5698
5778
|
message_: "Showing results failed",
|
|
5699
5779
|
get children() {
|
|
5700
|
-
return $
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5780
|
+
return $3hooq$solidjsweb.createComponent((0, $d067f3a30f047b41$export$e68cff63f76bd15b), {
|
|
5781
|
+
get children() {
|
|
5782
|
+
return $484eec37514a982e$export$3925f87b1545cfc6({
|
|
5783
|
+
min_products_to_fetch_:
|
|
5784
|
+
// if you want to get if all products have been loaded you can add an optional signal here, see SearchPage
|
|
5785
|
+
min_products_to_fetch_,
|
|
5786
|
+
query_base_: query_base_,
|
|
5787
|
+
plp_results_: plp_results_,
|
|
5788
|
+
depict_api_: depict_api_,
|
|
5789
|
+
first_result_in_viewport_: first_result_in_viewport_,
|
|
5790
|
+
last_result_in_viewport_: last_result_in_viewport_,
|
|
5791
|
+
scroll_restoration_data_: scroll_restoration_data_,
|
|
5792
|
+
layout_options_: layout_options_,
|
|
5793
|
+
product_card_template_: product_card_template_,
|
|
5794
|
+
sort_or_filter_open_: sort_or_filter_open_,
|
|
5795
|
+
desktop_filter_elements_: desktop_filter_elements_,
|
|
5796
|
+
id_currently_querying_for_: query_id_,
|
|
5797
|
+
no_results_options_: {
|
|
5798
|
+
selected_filters_: selected_filters_,
|
|
5799
|
+
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
5800
|
+
i18n_: i18n_,
|
|
5801
|
+
local_filter_cache_: local_filter_cache_
|
|
5802
|
+
}
|
|
5803
|
+
});
|
|
5720
5804
|
}
|
|
5721
5805
|
});
|
|
5722
5806
|
}
|
|
@@ -6666,10 +6750,12 @@ function $c77adcdf5346b187$export$7de92c4c2205ebf3(_ref) {
|
|
|
6666
6750
|
} = _ref;
|
|
6667
6751
|
const [get_showing_recommendation_rows] = showing_recommendation_rows_; // We reset this in after_submit in search.tsx FYI
|
|
6668
6752
|
const rows_object = view_more_button_ ? $c77adcdf5346b187$var$make_state_saved_rows(showing_recommendation_rows_, i18n_) : "all";
|
|
6669
|
-
const [recommendations_resource] = $3hooq$solidjs.createResource(
|
|
6670
|
-
|
|
6753
|
+
const [recommendations_resource] = $3hooq$solidjs.createResource(() => all_products_loaded_() && search_query_base_(),
|
|
6754
|
+
// only fetch/refetch if all products are loaded
|
|
6755
|
+
query => query && depict_api_.get_recommended(query).then(r => r.displays));
|
|
6756
|
+
const should_show = $3hooq$solidjs.createMemo(() => {
|
|
6671
6757
|
var _recommendations_reso;
|
|
6672
|
-
return recommendations_resource.loading || (
|
|
6758
|
+
return !!((recommendations_resource.loading || (_recommendations_reso = recommendations_resource()) !== null && _recommendations_reso !== void 0 && _recommendations_reso.length) && all_products_loaded_());
|
|
6673
6759
|
});
|
|
6674
6760
|
const num_placeholders_ = $3hooq$solidjs.createMemo(() => (0, $da887c42f8e8847a$export$6c9030e511152266) + get_showing_recommendation_rows() * Math.max(...layout_options_().cols_at_size.map(_ref2 => {
|
|
6675
6761
|
let [per_column] = _ref2;
|
|
@@ -6694,7 +6780,10 @@ function $c77adcdf5346b187$export$7de92c4c2205ebf3(_ref) {
|
|
|
6694
6780
|
get children() {
|
|
6695
6781
|
return (() => {
|
|
6696
6782
|
// IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
|
|
6697
|
-
const displays_by_key_ = $76012c4468a53d1f$export$7f8bd308237ab5a5($3hooq$solidjs.createMemo(
|
|
6783
|
+
const displays_by_key_ = $76012c4468a53d1f$export$7f8bd308237ab5a5($3hooq$solidjs.createMemo(prev => {
|
|
6784
|
+
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
|
|
6785
|
+
return recommendations_resource() || [];
|
|
6786
|
+
}));
|
|
6698
6787
|
return $76012c4468a53d1f$export$43f0fb951fcb0c54({
|
|
6699
6788
|
displays_by_key_: displays_by_key_,
|
|
6700
6789
|
merchant_: $3hooq$solidjs.createMemo(() => search_query_base_().tenant),
|
|
@@ -6708,7 +6797,7 @@ function $c77adcdf5346b187$export$7de92c4c2205ebf3(_ref) {
|
|
|
6708
6797
|
}))));
|
|
6709
6798
|
return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
6710
6799
|
get when() {
|
|
6711
|
-
return
|
|
6800
|
+
return should_show();
|
|
6712
6801
|
},
|
|
6713
6802
|
children: elements
|
|
6714
6803
|
});
|
|
@@ -7919,17 +8008,21 @@ function $24419668d5fcfcd5$export$1c593cbd6f1e10bc(_ref) {
|
|
|
7919
8008
|
severity_: "error",
|
|
7920
8009
|
message_: "Instant results failed",
|
|
7921
8010
|
get children() {
|
|
7922
|
-
return $
|
|
7923
|
-
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
8011
|
+
return $3hooq$solidjsweb.createComponent((0, $d067f3a30f047b41$export$e68cff63f76bd15b), {
|
|
8012
|
+
get children() {
|
|
8013
|
+
return $6e8d48eea3d0469d$export$62f101a8aa597bf8({
|
|
8014
|
+
search_field_value_: search_field_value_,
|
|
8015
|
+
depict_api_: depict_api_,
|
|
8016
|
+
tenant_: tenant_,
|
|
8017
|
+
i18n_: i18n_,
|
|
8018
|
+
market_: market_,
|
|
8019
|
+
set_total_num_results_accessor_: set_total_num_results_accessor_,
|
|
8020
|
+
router_: router_,
|
|
8021
|
+
set_modal_search_results_: set_modal_search_results_,
|
|
8022
|
+
content_search_enabled_: content_search_enabled_,
|
|
8023
|
+
...instant_results_options_
|
|
8024
|
+
});
|
|
8025
|
+
}
|
|
7933
8026
|
});
|
|
7934
8027
|
}
|
|
7935
8028
|
})), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
@@ -8767,14 +8860,18 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
8767
8860
|
return content_search_enabled_();
|
|
8768
8861
|
},
|
|
8769
8862
|
get children() {
|
|
8770
|
-
return $3hooq$solidjsweb.createComponent((0, $
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8863
|
+
return $3hooq$solidjsweb.createComponent((0, $d067f3a30f047b41$export$e68cff63f76bd15b), {
|
|
8864
|
+
get children() {
|
|
8865
|
+
return $3hooq$solidjsweb.createComponent((0, $eab939d0b95b75ee$export$6d0c9c22f6652669), {
|
|
8866
|
+
content_results_rows_: content_results_rows_,
|
|
8867
|
+
search_results_: search_results_,
|
|
8868
|
+
i18n_: i18n_,
|
|
8869
|
+
get_search_query_: get_search_query_,
|
|
8870
|
+
layout_options_: content_layout_options_,
|
|
8871
|
+
router_: router_,
|
|
8872
|
+
query_base_: search_query_base_
|
|
8873
|
+
});
|
|
8874
|
+
}
|
|
8778
8875
|
});
|
|
8779
8876
|
}
|
|
8780
8877
|
});
|
|
@@ -8806,28 +8903,32 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
8806
8903
|
severity_: "error",
|
|
8807
8904
|
message_: "Search results failed",
|
|
8808
8905
|
get children() {
|
|
8809
|
-
return $
|
|
8810
|
-
|
|
8811
|
-
|
|
8812
|
-
|
|
8813
|
-
|
|
8814
|
-
|
|
8815
|
-
|
|
8816
|
-
|
|
8817
|
-
|
|
8818
|
-
|
|
8819
|
-
|
|
8820
|
-
|
|
8821
|
-
|
|
8822
|
-
|
|
8823
|
-
|
|
8824
|
-
|
|
8825
|
-
|
|
8826
|
-
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
|
|
8906
|
+
return $3hooq$solidjsweb.createComponent((0, $d067f3a30f047b41$export$e68cff63f76bd15b), {
|
|
8907
|
+
get children() {
|
|
8908
|
+
return $484eec37514a982e$export$3925f87b1545cfc6({
|
|
8909
|
+
all_products_loaded_: all_products_loaded_,
|
|
8910
|
+
min_products_to_fetch_: min_products_to_fetch_,
|
|
8911
|
+
query_base_: search_query_base_,
|
|
8912
|
+
plp_results_: search_results_,
|
|
8913
|
+
depict_api_: depict_api_,
|
|
8914
|
+
first_result_in_viewport_: first_result_in_viewport_,
|
|
8915
|
+
last_result_in_viewport_: last_result_in_viewport_,
|
|
8916
|
+
scroll_restoration_data_: scroll_restoration_data_,
|
|
8917
|
+
desktop_filter_elements_: desktop_filter_elements_,
|
|
8918
|
+
product_card_template_: product_card_template_,
|
|
8919
|
+
layout_options_: layout_options_,
|
|
8920
|
+
sort_or_filter_open_: sort_or_filter_open_,
|
|
8921
|
+
id_currently_querying_for_: get_search_query_,
|
|
8922
|
+
no_results_options_: {
|
|
8923
|
+
selected_filters_: selected_filters_,
|
|
8924
|
+
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
8925
|
+
local_filter_cache_: local_filter_cache_,
|
|
8926
|
+
i18n_: {
|
|
8927
|
+
...i18n_,
|
|
8928
|
+
no_results_text_: no_results_text_
|
|
8929
|
+
}
|
|
8930
|
+
}
|
|
8931
|
+
});
|
|
8831
8932
|
}
|
|
8832
8933
|
});
|
|
8833
8934
|
}
|
|
@@ -8839,20 +8940,24 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
8839
8940
|
severity_: "error",
|
|
8840
8941
|
message_: "Search recommendations failed",
|
|
8841
8942
|
get children() {
|
|
8842
|
-
return $3hooq$solidjsweb.createComponent((0, $
|
|
8843
|
-
|
|
8844
|
-
|
|
8845
|
-
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
8943
|
+
return $3hooq$solidjsweb.createComponent((0, $d067f3a30f047b41$export$e68cff63f76bd15b), {
|
|
8944
|
+
get children() {
|
|
8945
|
+
return $3hooq$solidjsweb.createComponent((0, $c77adcdf5346b187$export$7de92c4c2205ebf3), {
|
|
8946
|
+
depict_api_: depict_api_,
|
|
8947
|
+
i18n_: i18n_,
|
|
8948
|
+
search_query_base_: search_query_base_,
|
|
8949
|
+
get layout_options_() {
|
|
8950
|
+
return $3hooq$solidjs.createMemo(() => {
|
|
8951
|
+
var _recommendations_layo;
|
|
8952
|
+
return (_recommendations_layo = recommendations_layout_options_ === null || recommendations_layout_options_ === void 0 ? void 0 : recommendations_layout_options_()) !== null && _recommendations_layo !== void 0 ? _recommendations_layo : layout_options_();
|
|
8953
|
+
});
|
|
8954
|
+
},
|
|
8955
|
+
showing_recommendation_rows_: showing_recommendation_rows_,
|
|
8956
|
+
view_more_button_: search_recs_view_more_,
|
|
8957
|
+
product_card_template_: product_card_template_,
|
|
8958
|
+
all_products_loaded_: get_all_products_loaded
|
|
8850
8959
|
});
|
|
8851
|
-
}
|
|
8852
|
-
showing_recommendation_rows_: showing_recommendation_rows_,
|
|
8853
|
-
view_more_button_: search_recs_view_more_,
|
|
8854
|
-
product_card_template_: product_card_template_,
|
|
8855
|
-
all_products_loaded_: get_all_products_loaded
|
|
8960
|
+
}
|
|
8856
8961
|
});
|
|
8857
8962
|
}
|
|
8858
8963
|
});
|