@depict-ai/ui 4.1.3 → 4.1.5

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/latest/index.js CHANGED
@@ -7,7 +7,76 @@ import { createStore as $9HbP8$createStore, reconcile as $9HbP8$reconcile } from
7
7
  /*! Depict.ai search and product listing SDK */
8
8
  import { register_es_version } from "../multi_import_deduplicator.mjs";
9
9
  register_es_version("ui", "latest");
10
- const $ec291e0010116877$export$83d89fbfd8236492 = "4.1.3";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "4.1.5";
11
+
12
+ /**
13
+ * This is a function that will safely clone an object that may contain promises.
14
+ * It will use structuredClone to clone the object and then re-apply (copy) any promises that were in the original object to the cloned object.
15
+ * @param obj Anything to clone
16
+ */
17
+ function $de6ccd37192b5fc2$export$83bb9af5671e1dbe(obj) {
18
+ if (obj instanceof Promise) return obj;
19
+ // Extract all promises, keep a map of them, and then re-apply them to both the original object and the target object after cloning
20
+ const seen = new Set();
21
+ const keyStack = [[]];
22
+ const valueStack = [obj];
23
+ const promiseLocationStack = [];
24
+ while (valueStack.length) {
25
+ const value = valueStack.pop();
26
+ const keyPath = keyStack.pop();
27
+ // Promises can only be in objects and we don't need to check for objects we've already seen (like in circular references)
28
+ if (typeof value !== "object" || value === null || seen.has(value)) continue;
29
+ seen.add(value);
30
+ if (Array.isArray(value)) {
31
+ for (let i = 0; i < value.length; i++) {
32
+ const ourValue = value[i];
33
+ const valuesKeyPath = [...keyPath, i];
34
+ if (ourValue instanceof Promise) {
35
+ promiseLocationStack.push([valuesKeyPath, ourValue]);
36
+ delete value[i]; // This will leave a hole in the array, but it's fine since we'll put it back soon
37
+ // This way both the indexes will be correct when putting the value back and our for loop doesn't get messed up
38
+ } else {
39
+ keyStack.push(valuesKeyPath);
40
+ valueStack.push(ourValue);
41
+ }
42
+ }
43
+ continue;
44
+ }
45
+ for (const innerKey in value) {
46
+ const ourValue = value[innerKey];
47
+ const valuesKeyPath = [...keyPath, innerKey];
48
+ if (ourValue instanceof Promise) {
49
+ promiseLocationStack.push([valuesKeyPath, ourValue]);
50
+ delete value[innerKey];
51
+ } else {
52
+ keyStack.push(valuesKeyPath);
53
+ valueStack.push(ourValue);
54
+ }
55
+ }
56
+ }
57
+ let structuredClonedObject;
58
+ let error;
59
+ try {
60
+ structuredClonedObject = structuredClone(obj);
61
+ } catch (e) {
62
+ // We still need to put back the promises in the original object, even if we threw an error
63
+ error = e;
64
+ }
65
+ // Put back the promises in both the original object and the cloned object
66
+ while (promiseLocationStack.length) {
67
+ const [keyPath, promise] = promiseLocationStack.pop();
68
+ let targetInClone = structuredClonedObject;
69
+ let targetInOriginal = obj;
70
+ for (let i = 0; i < keyPath.length - 1; i++) {
71
+ if (!error) targetInClone = targetInClone[keyPath[i]];
72
+ targetInOriginal = targetInOriginal[keyPath[i]];
73
+ }
74
+ if (!error) targetInClone[keyPath[keyPath.length - 1]] = promise;
75
+ targetInOriginal[keyPath[keyPath.length - 1]] = promise;
76
+ }
77
+ if (error) throw error;
78
+ return structuredClonedObject;
79
+ }
11
80
  const $90980bd87c9960f9$export$3064e1e8c6513da3 = new Set();
12
81
  let $90980bd87c9960f9$var$has_ran = false;
13
82
  function $90980bd87c9960f9$export$5162a71f252e6122() {
@@ -149,12 +218,55 @@ function $dc9262ef6f786812$export$d9f36cf74e24d595(media_query) {
149
218
  }) => signal[1](matches)).remove);
150
219
  return signal[0];
151
220
  }
221
+ var $d20eff0aadc28983$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<span>`);
222
+ function $d20eff0aadc28983$export$acb3eaade4b23afd(props) {
223
+ // Work around https://github.com/solidjs/solid/issues/1980
224
+ return (() => {
225
+ var _el$ = $9HbP8$getNextElement($d20eff0aadc28983$var$_tmpl$);
226
+ $9HbP8$effect(_p$ => {
227
+ var _v$ = `${props.class || ""} depict-placeholder`,
228
+ _v$2 = props.style;
229
+ _v$ !== _p$.e && $9HbP8$className(_el$, _p$.e = _v$);
230
+ _p$.t = $9HbP8$style(_el$, _v$2, _p$.t);
231
+ return _p$;
232
+ }, {
233
+ e: undefined,
234
+ t: undefined
235
+ });
236
+ return _el$;
237
+ })();
238
+ }
239
+ function $d134eae24341b4a1$export$89c6019e4baa40b1(props) {
240
+ const style = $9HbP8$createMemo(() => {
241
+ const {
242
+ style: style,
243
+ height: height,
244
+ width: width
245
+ } = props;
246
+ return {
247
+ ...(style || {}),
248
+ height: height ?? "1em",
249
+ ...(width && {
250
+ width: width
251
+ })
252
+ };
253
+ });
254
+ return $9HbP8$createComponent((0, $d20eff0aadc28983$export$acb3eaade4b23afd), {
255
+ get style() {
256
+ return style();
257
+ },
258
+ get ["class"]() {
259
+ return props.class;
260
+ }
261
+ });
262
+ }
152
263
  var $e003be2a50d9e5bc$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<span class="title line-clamp">`),
153
264
  $e003be2a50d9e5bc$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<span class=brand>`),
154
265
  $e003be2a50d9e5bc$var$_tmpl$3 = /*#__PURE__*/$9HbP8$template(`<div class="tagline line-clamp">`),
155
266
  $e003be2a50d9e5bc$var$_tmpl$4 = /*#__PURE__*/$9HbP8$template(`<span class="orig price"><!$><!/><!$><!/><!$><!/>`),
156
- $e003be2a50d9e5bc$var$_tmpl$5 = /*#__PURE__*/$9HbP8$template(`<a class=instant-card><div class=img-part><!$><!/><!$><!/></div><div class=right-part><!$><!/><div class=price-container><!$><!/><span class=price><!$><!/><!$><!/><!$><!/>`),
157
- $e003be2a50d9e5bc$var$_tmpl$6 = /*#__PURE__*/$9HbP8$template(`<div class=title-brand-tagline>`);
267
+ $e003be2a50d9e5bc$var$_tmpl$5 = /*#__PURE__*/$9HbP8$template(`<span class=price><!$><!/><!$><!/><!$><!/>`),
268
+ $e003be2a50d9e5bc$var$_tmpl$6 = /*#__PURE__*/$9HbP8$template(`<a class=instant-card><div class=img-part><!$><!/><!$><!/></div><div class=right-part><!$><!/><div class=price-container><!$><!/><!$><!/>`),
269
+ $e003be2a50d9e5bc$var$_tmpl$7 = /*#__PURE__*/$9HbP8$template(`<div class=title-brand-tagline>`);
158
270
  const $e003be2a50d9e5bc$export$b05c0ae390cf3e06 = ({
159
271
  display_: display_,
160
272
  router_: router_,
@@ -168,7 +280,10 @@ const $e003be2a50d9e5bc$export$b05c0ae390cf3e06 = ({
168
280
  const [get_selected_index_, set_selected_index_] = selected_index_ || [];
169
281
  const variant = display_.variant_displays[display_.variant_index];
170
282
  const href = $9HbP8$createMemo(() => variant.page_url); // <- could be made reactive getter in displayTransformers, read it in memo here since it might create computations (for example in the preview-brower), and there's no owner in the onClick handler
171
- const is_sale = variant.sale_price !== variant.original_price;
283
+ // Prices can be promises, for example in our shopify app. Always assume they are (will work the same when they aren't)
284
+ const [salePrice] = $9HbP8$createResource(() => variant.sale_price);
285
+ const [originalPrice] = $9HbP8$createResource(() => variant.original_price);
286
+ const isOnSale = $9HbP8$createMemo(() => salePrice() !== originalPrice());
172
287
  const supports_hover = $dc9262ef6f786812$export$d9f36cf74e24d595("(hover: hover) and (pointer: fine)");
173
288
  const [isSelected, selectedDueToKeyboardNavigation] = selected_index_ ? $f4125ce4984deee6$export$fb40a80c530e5f2b(get_selected_index_, keyboardNavigationGroupIndex_, index_) : [];
174
289
  const secondary_image_url = variant.image_urls?.[1] || variant.secondary_image_url || variant.alternative_display_image_url;
@@ -190,25 +305,20 @@ const $e003be2a50d9e5bc$export$b05c0ae390cf3e06 = ({
190
305
  })();
191
306
  })())];
192
307
  return (() => {
193
- var _el$4 = $9HbP8$getNextElement($e003be2a50d9e5bc$var$_tmpl$5),
308
+ var _el$4 = $9HbP8$getNextElement($e003be2a50d9e5bc$var$_tmpl$6),
194
309
  _el$5 = _el$4.firstChild,
195
310
  _el$6 = _el$5.firstChild,
196
311
  [_el$7, _co$] = $9HbP8$getNextMarker(_el$6.nextSibling),
197
312
  _el$8 = _el$7.nextSibling,
198
313
  [_el$9, _co$2] = $9HbP8$getNextMarker(_el$8.nextSibling),
199
314
  _el$10 = _el$5.nextSibling,
200
- _el$28 = _el$10.firstChild,
201
- [_el$29, _co$10] = $9HbP8$getNextMarker(_el$28.nextSibling),
202
- _el$11 = _el$29.nextSibling,
315
+ _el$30 = _el$10.firstChild,
316
+ [_el$31, _co$11] = $9HbP8$getNextMarker(_el$30.nextSibling),
317
+ _el$11 = _el$31.nextSibling,
203
318
  _el$26 = _el$11.firstChild,
204
319
  [_el$27, _co$9] = $9HbP8$getNextMarker(_el$26.nextSibling),
205
- _el$19 = _el$27.nextSibling,
206
- _el$20 = _el$19.firstChild,
207
- [_el$21, _co$6] = $9HbP8$getNextMarker(_el$20.nextSibling),
208
- _el$22 = _el$21.nextSibling,
209
- [_el$23, _co$7] = $9HbP8$getNextMarker(_el$22.nextSibling),
210
- _el$24 = _el$23.nextSibling,
211
- [_el$25, _co$8] = $9HbP8$getNextMarker(_el$24.nextSibling);
320
+ _el$28 = _el$27.nextSibling,
321
+ [_el$29, _co$10] = $9HbP8$getNextMarker(_el$28.nextSibling);
212
322
  $9HbP8$use(element => $f4125ce4984deee6$export$12761f53d7ab7f27(element, () => selectedDueToKeyboardNavigation?.() ?? false), _el$4);
213
323
  $9HbP8$addEventListener(_el$4, "mouseleave", $9HbP8$catchify(() => set_selected_index_?.()));
214
324
  $9HbP8$addEventListener(_el$4, "mouseenter", $9HbP8$catchify(() => set_selected_index_?.([keyboardNavigationGroupIndex_(), index_()])));
@@ -233,12 +343,14 @@ const $e003be2a50d9e5bc$export$b05c0ae390cf3e06 = ({
233
343
  }
234
344
  }), _el$9, _co$2);
235
345
  $9HbP8$insert(_el$10, selected_index_ ? $9HbP8$createComponent(TitleBrandTagline, {}) : (() => {
236
- var _el$30 = $9HbP8$getNextElement($e003be2a50d9e5bc$var$_tmpl$6);
237
- $9HbP8$insert(_el$30, $9HbP8$createComponent(TitleBrandTagline, {}));
238
- return _el$30;
239
- })(), _el$29, _co$10);
346
+ var _el$32 = $9HbP8$getNextElement($e003be2a50d9e5bc$var$_tmpl$7);
347
+ $9HbP8$insert(_el$32, $9HbP8$createComponent(TitleBrandTagline, {}));
348
+ return _el$32;
349
+ })(), _el$31, _co$11);
240
350
  $9HbP8$insert(_el$11, $9HbP8$createComponent((0, $9HbP8$Show), {
241
- when: is_sale,
351
+ get when() {
352
+ return isOnSale();
353
+ },
242
354
  get children() {
243
355
  var _el$12 = $9HbP8$getNextElement($e003be2a50d9e5bc$var$_tmpl$4),
244
356
  _el$13 = _el$12.firstChild,
@@ -250,7 +362,7 @@ const $e003be2a50d9e5bc$export$b05c0ae390cf3e06 = ({
250
362
  $9HbP8$insert(_el$12, () => i18n_.price_formatting_().pre_, _el$14, _co$3);
251
363
  $9HbP8$insert(_el$12, $9HbP8$createComponent((0, $8c0f86cb3e266eeb$export$a71e92cfbb498adc), {
252
364
  get price_() {
253
- return variant.original_price;
365
+ return originalPrice();
254
366
  },
255
367
  get price_formatting_() {
256
368
  return i18n_.price_formatting_();
@@ -260,17 +372,39 @@ const $e003be2a50d9e5bc$export$b05c0ae390cf3e06 = ({
260
372
  return _el$12;
261
373
  }
262
374
  }), _el$27, _co$9);
263
- _el$19.classList.toggle("sales-price", !!is_sale);
264
- $9HbP8$insert(_el$19, () => i18n_.price_formatting_().pre_, _el$21, _co$6);
265
- $9HbP8$insert(_el$19, $9HbP8$createComponent((0, $8c0f86cb3e266eeb$export$a71e92cfbb498adc), {
266
- get price_() {
267
- return variant.sale_price;
375
+ $9HbP8$insert(_el$11, $9HbP8$createComponent((0, $9HbP8$Show), {
376
+ get when() {
377
+ return !salePrice.loading && salePrice.latest;
268
378
  },
269
- get price_formatting_() {
270
- return i18n_.price_formatting_();
379
+ get fallback() {
380
+ return $9HbP8$createComponent((0, $d134eae24341b4a1$export$89c6019e4baa40b1), {
381
+ width: "5ch",
382
+ height: "1em",
383
+ "class": "price"
384
+ });
385
+ },
386
+ get children() {
387
+ var _el$19 = $9HbP8$getNextElement($e003be2a50d9e5bc$var$_tmpl$5),
388
+ _el$20 = _el$19.firstChild,
389
+ [_el$21, _co$6] = $9HbP8$getNextMarker(_el$20.nextSibling),
390
+ _el$22 = _el$21.nextSibling,
391
+ [_el$23, _co$7] = $9HbP8$getNextMarker(_el$22.nextSibling),
392
+ _el$24 = _el$23.nextSibling,
393
+ [_el$25, _co$8] = $9HbP8$getNextMarker(_el$24.nextSibling);
394
+ $9HbP8$insert(_el$19, () => i18n_.price_formatting_().pre_, _el$21, _co$6);
395
+ $9HbP8$insert(_el$19, $9HbP8$createComponent((0, $8c0f86cb3e266eeb$export$a71e92cfbb498adc), {
396
+ get price_() {
397
+ return salePrice();
398
+ },
399
+ get price_formatting_() {
400
+ return i18n_.price_formatting_();
401
+ }
402
+ }), _el$23, _co$7);
403
+ $9HbP8$insert(_el$19, () => i18n_.price_formatting_().post_, _el$25, _co$8);
404
+ $9HbP8$effect(() => _el$19.classList.toggle("sales-price", !!isOnSale()));
405
+ return _el$19;
271
406
  }
272
- }), _el$23, _co$7);
273
- $9HbP8$insert(_el$19, () => i18n_.price_formatting_().post_, _el$25, _co$8);
407
+ }), _el$29, _co$10);
274
408
  $9HbP8$effect(_p$ => {
275
409
  var _v$ = href(),
276
410
  _v$2 = display_.search_result_id,
@@ -289,24 +423,6 @@ const $e003be2a50d9e5bc$export$b05c0ae390cf3e06 = ({
289
423
  })();
290
424
  };
291
425
  $9HbP8$delegateEvents(["click"]);
292
- var $d20eff0aadc28983$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<span>`);
293
- function $d20eff0aadc28983$export$acb3eaade4b23afd(props) {
294
- // Work around https://github.com/solidjs/solid/issues/1980
295
- return (() => {
296
- var _el$ = $9HbP8$getNextElement($d20eff0aadc28983$var$_tmpl$);
297
- $9HbP8$effect(_p$ => {
298
- var _v$ = `${props.class || ""} depict-placeholder`,
299
- _v$2 = props.style;
300
- _v$ !== _p$.e && $9HbP8$className(_el$, _p$.e = _v$);
301
- _p$.t = $9HbP8$style(_el$, _v$2, _p$.t);
302
- return _p$;
303
- }, {
304
- e: undefined,
305
- t: undefined
306
- });
307
- return _el$;
308
- })();
309
- }
310
426
  function $7f60f09116a3fe61$export$3f37af283f8fb843(props) {
311
427
  const style = $9HbP8$createMemo(() => {
312
428
  const {
@@ -338,30 +454,6 @@ function $7f60f09116a3fe61$export$3f37af283f8fb843(props) {
338
454
  }
339
455
  });
340
456
  }
341
- function $d134eae24341b4a1$export$89c6019e4baa40b1(props) {
342
- const style = $9HbP8$createMemo(() => {
343
- const {
344
- style: style,
345
- height: height,
346
- width: width
347
- } = props;
348
- return {
349
- ...(style || {}),
350
- height: height ?? "1em",
351
- ...(width && {
352
- width: width
353
- })
354
- };
355
- });
356
- return $9HbP8$createComponent((0, $d20eff0aadc28983$export$acb3eaade4b23afd), {
357
- get style() {
358
- return style();
359
- },
360
- get ["class"]() {
361
- return props.class;
362
- }
363
- });
364
- }
365
457
  var $bb15dfb548a7666e$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=instant-card><div class=img-part></div><div class=right-part><div class=title-brand-tagline><span class=title></span></div><div class=price-container>`);
366
458
  const $bb15dfb548a7666e$export$8a2234b5b1a5ebd4 = "--image-aspect-ratio";
367
459
  function $bb15dfb548a7666e$export$ee1733d9a8495996() {
@@ -470,7 +562,12 @@ function $29ec7cddbe1d3484$export$43f0fb951fcb0c54({
470
562
  // We had a case on singular where they popped an image url and due to use caching after some time there was no image
471
563
  // Attempt cloning the displays if possible (99.9% of the cases probably) and if not, just use the original display
472
564
  try {
473
- display = structuredClone(display);
565
+ // Use promiseSafeStructuredClone so that:
566
+ // 1. When fetching for example prices from an API, one can start that API request
567
+ // 2. Add the promise to the display
568
+ // 3. Already render the product card with placeholders for prices while the price loads
569
+ // 4. When the price loads, re-render the display with the new price
570
+ display = $de6ccd37192b5fc2$export$83bb9af5671e1dbe(display);
474
571
  } catch (e) {
475
572
  if (!$29ec7cddbe1d3484$var$printedCloneError) {
476
573
  $29ec7cddbe1d3484$var$printedCloneError = true;
@@ -528,7 +625,7 @@ function $29ec7cddbe1d3484$export$43f0fb951fcb0c54({
528
625
  // Modified futher to bias towards saying objects are equal non-primitive objects differ
529
626
  function $29ec7cddbe1d3484$var$deep_equal(obj1, obj2) {
530
627
  const stack = [[obj1, obj2]];
531
- while (stack.length > 0) {
628
+ while (stack.length) {
532
629
  const [currentObj1, currentObj2] = stack.pop();
533
630
  if (currentObj1 === currentObj2) continue;
534
631
  if (Array.isArray(currentObj1) && Array.isArray(currentObj2)) {
@@ -2456,10 +2553,10 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
2456
2553
  const src_options = $9HbP8$createMemo(() => {
2457
2554
  const {
2458
2555
  src: src,
2459
- customGenerateImageUrl_: customGenerateImageUrl_
2556
+ customUrls: customUrls
2460
2557
  } = props;
2461
- const fallback_src = (customGenerateImageUrl_ || $e8ffe11ed01df0fe$var$generateImageUrl)(src, 400);
2462
- const srcset = $e8ffe11ed01df0fe$var$make_srcset(props.src, props.resolutions || [64, 128, 256, 300, 400, 512, 640, 768, 1024, 1280, 1536, 2048, 2560, 3072, 3584, 4096], customGenerateImageUrl_);
2558
+ const fallback_src = (customUrls || $e8ffe11ed01df0fe$export$1d6267828870adda)(src, 400);
2559
+ const srcset = $e8ffe11ed01df0fe$var$make_srcset(props.src, props.resolutions || [64, 128, 256, 300, 400, 512, 640, 768, 1024, 1280, 1536, 2048, 2560, 3072, 3584, 4096], customUrls);
2463
2560
  // The order here *might* matter - I've seen mobile safari always start with loading the 400px version when it was reversed
2464
2561
  return {
2465
2562
  srcset: srcset,
@@ -2468,7 +2565,9 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
2468
2565
  });
2469
2566
  // Work around https://github.com/solidjs/solid/issues/1828
2470
2567
  const img = new Image(); // Need to use new Image or browser might not start loading image before it's in the DOM
2471
- const [, otherAttributes] = $9HbP8$splitProps(props, ["resolutions", "size", "src", "srcSet", "loading"]);
2568
+ const [, otherAttributes] = $9HbP8$splitProps(props, ["resolutions", "size", "src", "srcSet", "loading", "customUrls" // Can't have properties ending on underscore because the property name mangling will get confused by this <-
2569
+ ]);
2570
+
2472
2571
  const [hasSetSize, setHasSetSize] = $9HbP8$createSignal(false);
2473
2572
  const [hasDecoded, setHasDecoded] = $9HbP8$createSignal(false);
2474
2573
  const productCardIndexAccessor = $b6440e72ed83671a$export$e3faf4d95300054f();
@@ -2597,9 +2696,9 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
2597
2696
  });
2598
2697
  }
2599
2698
  function $e8ffe11ed01df0fe$var$make_srcset(url, resolutions, customGenerateImageUrl_) {
2600
- return resolutions.map(width => `${(customGenerateImageUrl_ || $e8ffe11ed01df0fe$var$generateImageUrl)(url, width)} ${width}w`).join(", ");
2699
+ return resolutions.map(width => `${(customGenerateImageUrl_ || $e8ffe11ed01df0fe$export$1d6267828870adda)(url, width)} ${width}w`).join(", ");
2601
2700
  }
2602
- function $e8ffe11ed01df0fe$var$generateImageUrl(url, width) {
2701
+ function $e8ffe11ed01df0fe$export$1d6267828870adda(url, width) {
2603
2702
  // Even just creating one `URL` object per image src and then setting the search parameter is quite slow (0.25ms to set the width param)
2604
2703
  // We're making the assumptions that the url has already at least one query parameter and that the image resizing service will choose the last one out of a duplicate width parameter (shopify's does)
2605
2704
  // That way we can just to string concatenation which is insanely fast
@@ -2664,8 +2763,15 @@ function $4f16612bea257571$export$9d4a4b669b1929ab(props) {
2664
2763
  get imgProps() {
2665
2764
  return {
2666
2765
  ...props.imgProps,
2667
- customGenerateImageUrl_: (url, width // Apparently don't have to encode url for CF's service
2668
- ) => `https://app.depict.ai/cdn-cgi/image/width=${width},format=auto/${url}`
2766
+ customUrls: (url, width // Apparently don't have to encode url for CF's service
2767
+ ) => {
2768
+ if (url.startsWith("https://cdn.shopify.com"))
2769
+ // The shopify image resizing CDN blocks Cloudflare's image resizer. It's possible that we can't detect shopify image URLs sometimes because they go to the merchant's domain,
2770
+ // but it seems like the URLs returned by the Depict API always goes to the cdn.shopify.com version of an image, so this simple workaround works.
2771
+ return $e8ffe11ed01df0fe$export$1d6267828870adda(url, width);
2772
+ // Use cloudflare image resizer instead of img.depict.ai because it's a lot faster (and also auto-chooses other formats if webp is not supported)
2773
+ return `https://app.depict.ai/cdn-cgi/image/width=${width},format=auto/${url}`;
2774
+ }
2669
2775
  };
2670
2776
  }
2671
2777
  }));
@@ -14186,4 +14292,4 @@ function $58b3487626e85ece$var$align_field_modal(alignmentSignals, input, modalV
14186
14292
  });
14187
14293
  }
14188
14294
  $9HbP8$add_to_version_info("ui", (0, $ec291e0010116877$export$83d89fbfd8236492));
14189
- export { $90980bd87c9960f9$export$5162a71f252e6122 as preserve_items_in_history_dot_state, $90980bd87c9960f9$export$3064e1e8c6513da3 as prefixes_to_preserve_in_history_dot_state, $a281666e5c15c2ec$export$29d28dadc2d6b631 as allowNativeNavigation, $66db7a014e20802e$export$1ea76ea778b880dd as modalVersionSymbol, $136f1d4d6c7ba6ac$export$e417c49320921907 as createDeparallelizedNoDropResource, $d8dbf52fea1773e2$export$f50b88e2a00918b5 as throw_globally, $42912431795f188e$export$9265e66f26f8e383 as ClassicSearchModal, $500a16dd18ee5a71$export$b0c55aa2e87c4be7 as SearchModalV2, $4f16612bea257571$export$9d4a4b669b1929ab as ModernResponsiveContainedImage, $024fbc0a2d796fad$export$3e41faf802a29e71 as Tab, $024fbc0a2d796fad$export$b2539bed5023c21c as Tabs, $8560c919ff763930$export$d4973c31938cbfd1 as ShopTheLookButton, $ca6f574bd8772184$export$e183a13865960371 as history_dot_state_to_state, $4147651646da990a$export$916e6850778505f6 as strip_encoded_filter_and_sort, $4147651646da990a$export$58aa3f171519b6d7 as encode_filters, $4147651646da990a$export$f934fa24c3a86811 as decode_filters, $4147651646da990a$export$62acb285a7579555 as encode_sorting, $4147651646da990a$export$766e9676e74997d3 as decode_sorting, $660070e2a394b3c3$export$d7b7ab832c20e2f4 as shopifyContainedImageContextSymbol, $011607bdf658f807$export$e68cff63f76bd15b as ListingProvider, $011607bdf658f807$export$8d0c4fdbb05a2f2e as useListing, $b6440e72ed83671a$export$11354f017ddc9790 as ProductCardIndexProvider, $b6440e72ed83671a$export$e3faf4d95300054f as useProductCardIndex, $660070e2a394b3c3$export$e4b984597b71e989 as ShopifyContainedImage, $f32e14878e75af51$export$6649caad96ef8870 as SlidableItems, $2449872a62a75a20$export$ebdc3711f7e02ccd as make_accurate_width_accessor, $ee116da074deb002$export$9574e176201e5e8d as RecommendationSlider, $9ea5383493360761$export$9756467d34d91cdb as RecommendationGrid, $e8ffe11ed01df0fe$export$6e5611bc7e57e477 as ShopifyResponsiveImg, $e8ffe11ed01df0fe$export$e6fffe67d4cdd848 as makeSizeAccessor, $f18d425032111270$export$94026ee33dbabc26 as ImageContainer, $b7436a6d1fd64e3b$export$b69d0d92862de18b as SentryErrorBoundary, $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d as ExpandingDetails, $c16e74cfe125bb05$export$f091cbac892643a4 as accessor_of_object_to_object_with_accessor_values, $1adfe60f3a14a1d7$export$fecbb157621501bd as SelectedFilters, $fab07f52c9861732$export$3f1a388cc0d8fed7 as FilterBody, $5efb5894079b220e$export$b288c38ae3fddb56 as create_modified_filters, $c8d5ff4524619fcd$export$d21e32dfedac04be as SolidLayout, $194bd6b8e4c59830$export$79b1565500412d9b as general_modal_abstraction, $19976a74d273070d$export$3b621d86b1566b2 as CrossIcon, $fbbadcb080ad1d4a$export$8be2714ec7f169ee as GenericSliderArrowButton, $a0f0e923bad68a9b$export$58e808b1db15d3bc as fetchDepictRecommendations, $961b5c64bef4662f$export$de035477d6fef996 as QuickLinks, $961b5c64bef4662f$export$5b7c3ce0ebe51f86 as BreadCrumbs, $e4615ecd1849548f$export$b91cec6bdc6b32a1 as CategoryTitle, $a6e23a834336fc19$export$824dde41348efed1 as embedded_num_products, $4b2134398dfa83fa$export$c1a6b039e689a58e as get_listings, $961b5c64bef4662f$export$f34314aa9505732e as DepictCategory, $961b5c64bef4662f$export$e2bf8ce7779e827e as CategoryPage, $806c97b931758897$export$ac6237957a15b3f0 as DepictSearch, $806c97b931758897$export$bde3eb976dfded9 as get_search_query_updating_blocked_signal, $806c97b931758897$export$f2dc7e4e4aa11abb as SearchPage, $4fd48cb976bf1789$export$aa14a9f43128f61f as ProductCardError, $6891c018a834cfdd$export$d86a33413558014e as open_modal_with_alignment, $bb15dfb548a7666e$export$ee1733d9a8495996 as DefaultInstantCardPlaceholder, $b6d5529b253681aa$export$b3ad617e9036868 as align_field, $b6d5529b253681aa$export$3f238c96c45e6cc6 as ALIGN_TOP, $b6d5529b253681aa$export$902f8b4a7dae5d78 as ALIGN_WIDTH_ON_MODAL, $b6d5529b253681aa$export$7895aadd1956b1c7 as ALIGN_LEFT, $b6d5529b253681aa$export$6060bc6bee850eb6 as SET_CENTERED_LEFT, $b5cccc8ee7d24677$export$6daf8749b65a1b77 as convert_sdk_cols_at_size_to_layout, $926b1b5ba2239356$export$1233ca167bf71f9a as styles_to_valid_css_string, $aea1edf92433e81e$export$fe334901e8bebd57 as disable_scrolling, $6e8944558258054f$export$d0596b5cae35ad4 as open_search_with_shift_slash, $7fa23e2a0079eca4$export$e015ed2f2950f2e3 as DepictAPI, $dc9262ef6f786812$export$d9f36cf74e24d595 as media_query_to_accessor, $6936724b9e0b98d5$export$689e204eadb33baf as setup_fast_leave, $bf52d9f9eebd1938$export$5196e4c01fa56fcb as show_toast, $8c0f86cb3e266eeb$export$a71e92cfbb498adc as SolidFormatPrice, $4ca91518c9a35379$export$828dcdd425fd3231 as connect_search_field_height_to_aligner_height, $d20eff0aadc28983$export$acb3eaade4b23afd as BasePlaceholder, $d134eae24341b4a1$export$89c6019e4baa40b1 as TextPlaceholder, $7f60f09116a3fe61$export$3f37af283f8fb843 as ImagePlaceholder, $753e9b2889a47c89$export$3ccaa27d81dd8556 as PageReplacer, $4690a06c8489dcd0$export$864d304a0bc46829 as defaultGridSpacing, $4690a06c8489dcd0$export$c3834fa86c616831 as defaultColsAtSize, $4690a06c8489dcd0$export$7bf543b9d9be2c22 as defaultCategoryTitlePlugin, $ec291e0010116877$export$83d89fbfd8236492 as version, $58b3487626e85ece$export$316f6f283ae64765 as SearchField };
14295
+ export { $de6ccd37192b5fc2$export$83bb9af5671e1dbe as promiseSafeStructuredClone, $90980bd87c9960f9$export$5162a71f252e6122 as preserve_items_in_history_dot_state, $90980bd87c9960f9$export$3064e1e8c6513da3 as prefixes_to_preserve_in_history_dot_state, $a281666e5c15c2ec$export$29d28dadc2d6b631 as allowNativeNavigation, $66db7a014e20802e$export$1ea76ea778b880dd as modalVersionSymbol, $136f1d4d6c7ba6ac$export$e417c49320921907 as createDeparallelizedNoDropResource, $d8dbf52fea1773e2$export$f50b88e2a00918b5 as throw_globally, $42912431795f188e$export$9265e66f26f8e383 as ClassicSearchModal, $500a16dd18ee5a71$export$b0c55aa2e87c4be7 as SearchModalV2, $4f16612bea257571$export$9d4a4b669b1929ab as ModernResponsiveContainedImage, $024fbc0a2d796fad$export$3e41faf802a29e71 as Tab, $024fbc0a2d796fad$export$b2539bed5023c21c as Tabs, $8560c919ff763930$export$d4973c31938cbfd1 as ShopTheLookButton, $ca6f574bd8772184$export$e183a13865960371 as history_dot_state_to_state, $4147651646da990a$export$916e6850778505f6 as strip_encoded_filter_and_sort, $4147651646da990a$export$58aa3f171519b6d7 as encode_filters, $4147651646da990a$export$f934fa24c3a86811 as decode_filters, $4147651646da990a$export$62acb285a7579555 as encode_sorting, $4147651646da990a$export$766e9676e74997d3 as decode_sorting, $660070e2a394b3c3$export$d7b7ab832c20e2f4 as shopifyContainedImageContextSymbol, $011607bdf658f807$export$e68cff63f76bd15b as ListingProvider, $011607bdf658f807$export$8d0c4fdbb05a2f2e as useListing, $b6440e72ed83671a$export$11354f017ddc9790 as ProductCardIndexProvider, $b6440e72ed83671a$export$e3faf4d95300054f as useProductCardIndex, $660070e2a394b3c3$export$e4b984597b71e989 as ShopifyContainedImage, $f32e14878e75af51$export$6649caad96ef8870 as SlidableItems, $2449872a62a75a20$export$ebdc3711f7e02ccd as make_accurate_width_accessor, $ee116da074deb002$export$9574e176201e5e8d as RecommendationSlider, $9ea5383493360761$export$9756467d34d91cdb as RecommendationGrid, $e8ffe11ed01df0fe$export$6e5611bc7e57e477 as ShopifyResponsiveImg, $e8ffe11ed01df0fe$export$e6fffe67d4cdd848 as makeSizeAccessor, $f18d425032111270$export$94026ee33dbabc26 as ImageContainer, $b7436a6d1fd64e3b$export$b69d0d92862de18b as SentryErrorBoundary, $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d as ExpandingDetails, $c16e74cfe125bb05$export$f091cbac892643a4 as accessor_of_object_to_object_with_accessor_values, $1adfe60f3a14a1d7$export$fecbb157621501bd as SelectedFilters, $fab07f52c9861732$export$3f1a388cc0d8fed7 as FilterBody, $5efb5894079b220e$export$b288c38ae3fddb56 as create_modified_filters, $c8d5ff4524619fcd$export$d21e32dfedac04be as SolidLayout, $194bd6b8e4c59830$export$79b1565500412d9b as general_modal_abstraction, $19976a74d273070d$export$3b621d86b1566b2 as CrossIcon, $fbbadcb080ad1d4a$export$8be2714ec7f169ee as GenericSliderArrowButton, $a0f0e923bad68a9b$export$58e808b1db15d3bc as fetchDepictRecommendations, $961b5c64bef4662f$export$de035477d6fef996 as QuickLinks, $961b5c64bef4662f$export$5b7c3ce0ebe51f86 as BreadCrumbs, $e4615ecd1849548f$export$b91cec6bdc6b32a1 as CategoryTitle, $a6e23a834336fc19$export$824dde41348efed1 as embedded_num_products, $4b2134398dfa83fa$export$c1a6b039e689a58e as get_listings, $961b5c64bef4662f$export$f34314aa9505732e as DepictCategory, $961b5c64bef4662f$export$e2bf8ce7779e827e as CategoryPage, $806c97b931758897$export$ac6237957a15b3f0 as DepictSearch, $806c97b931758897$export$bde3eb976dfded9 as get_search_query_updating_blocked_signal, $806c97b931758897$export$f2dc7e4e4aa11abb as SearchPage, $4fd48cb976bf1789$export$aa14a9f43128f61f as ProductCardError, $6891c018a834cfdd$export$d86a33413558014e as open_modal_with_alignment, $bb15dfb548a7666e$export$ee1733d9a8495996 as DefaultInstantCardPlaceholder, $b6d5529b253681aa$export$b3ad617e9036868 as align_field, $b6d5529b253681aa$export$3f238c96c45e6cc6 as ALIGN_TOP, $b6d5529b253681aa$export$902f8b4a7dae5d78 as ALIGN_WIDTH_ON_MODAL, $b6d5529b253681aa$export$7895aadd1956b1c7 as ALIGN_LEFT, $b6d5529b253681aa$export$6060bc6bee850eb6 as SET_CENTERED_LEFT, $b5cccc8ee7d24677$export$6daf8749b65a1b77 as convert_sdk_cols_at_size_to_layout, $926b1b5ba2239356$export$1233ca167bf71f9a as styles_to_valid_css_string, $aea1edf92433e81e$export$fe334901e8bebd57 as disable_scrolling, $6e8944558258054f$export$d0596b5cae35ad4 as open_search_with_shift_slash, $7fa23e2a0079eca4$export$e015ed2f2950f2e3 as DepictAPI, $dc9262ef6f786812$export$d9f36cf74e24d595 as media_query_to_accessor, $6936724b9e0b98d5$export$689e204eadb33baf as setup_fast_leave, $bf52d9f9eebd1938$export$5196e4c01fa56fcb as show_toast, $8c0f86cb3e266eeb$export$a71e92cfbb498adc as SolidFormatPrice, $4ca91518c9a35379$export$828dcdd425fd3231 as connect_search_field_height_to_aligner_height, $d20eff0aadc28983$export$acb3eaade4b23afd as BasePlaceholder, $d134eae24341b4a1$export$89c6019e4baa40b1 as TextPlaceholder, $7f60f09116a3fe61$export$3f37af283f8fb843 as ImagePlaceholder, $753e9b2889a47c89$export$3ccaa27d81dd8556 as PageReplacer, $4690a06c8489dcd0$export$864d304a0bc46829 as defaultGridSpacing, $4690a06c8489dcd0$export$c3834fa86c616831 as defaultColsAtSize, $4690a06c8489dcd0$export$7bf543b9d9be2c22 as defaultCategoryTitlePlugin, $ec291e0010116877$export$83d89fbfd8236492 as version, $58b3487626e85ece$export$316f6f283ae64765 as SearchField };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "4.1.3",
3
+ "version": "4.1.5",
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",