@depict-ai/portal-components 2.7.35 → 2.7.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import { SearchFilter } from "@depict-ai/types/api/SearchResponse";
4
4
  import { Locale } from "@depict-ai/react-ui/locales/latest";
5
5
  import { ReactNode } from "react";
6
6
  import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
7
- export const version = "2.7.35";
7
+ export const version = "2.7.37";
8
8
  type TextOptions = {
9
9
  /** Enabled */
10
10
  enabled: boolean;
package/dist/main.js CHANGED
@@ -20,7 +20,7 @@ $parcel$export(module.exports, "ExpandingSection", () => $2214dc111b9e2866$expor
20
20
  $parcel$export(module.exports, "ReactLookCard", () => $35bab9ff48bfe404$export$48787da2a5568bc);
21
21
  $parcel$export(module.exports, "version", () => $0a017be3a74fcc94$export$83d89fbfd8236492);
22
22
  /*! Depict.ai portal components */ // This is where the actual source of your React stuff should live
23
- const $0a017be3a74fcc94$export$83d89fbfd8236492 = "2.7.35";
23
+ const $0a017be3a74fcc94$export$83d89fbfd8236492 = "2.7.37";
24
24
 
25
25
 
26
26
 
@@ -53,7 +53,7 @@ function $d38f1fd3cc4cd6b2$export$f6e64e17bd69eeef({ solid_component: solid_comp
53
53
 
54
54
 
55
55
 
56
- var $3375ddd88f77967d$var$_tmpl$ = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<a>`), $3375ddd88f77967d$var$_tmpl$2 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<div class="d-title line-clamp">`), $3375ddd88f77967d$var$_tmpl$3 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<div class=d-product-card>`), $3375ddd88f77967d$var$_tmpl$4 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<svg xmlns=http://www.w3.org/2000/svg width=12 height=12 class=more><path d="M10.8 6c0 .153-.061.299-.169.407s-.255.169-.407.169H6.576v3.648c0 .153-.061.299-.169.407S6.153 10.8 6 10.8s-.299-.061-.407-.169-.169-.255-.169-.407V6.576H1.776c-.153 0-.299-.061-.407-.169S1.2 6.153 1.2 6s.061-.299.169-.407.255-.169.407-.169h3.648V1.776c0-.153.061-.299.169-.407S5.847 1.2 6 1.2s.299.061.407.169.169.255.169.407v3.648h3.648c.153 0 .299.061.407.169s.169.255.169.407z">`), $3375ddd88f77967d$var$_tmpl$5 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<div class=d-swatches>`), $3375ddd88f77967d$var$_tmpl$6 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<a class=d-swatch>`), $3375ddd88f77967d$var$_tmpl$7 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<span class=more>+ <!> more`), $3375ddd88f77967d$var$_tmpl$8 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<div class=sizes>`), $3375ddd88f77967d$var$_tmpl$9 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<span>`), $3375ddd88f77967d$var$_tmpl$10 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<s>`), $3375ddd88f77967d$var$_tmpl$11 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<div>`), $3375ddd88f77967d$var$_tmpl$12 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<div class="media-item video">`), $3375ddd88f77967d$var$_tmpl$13 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<div class="media-item image">`), $3375ddd88f77967d$var$_tmpl$14 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<source type=application/x-mpegURL>`), $3375ddd88f77967d$var$_tmpl$15 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<video class=s-responsive-image crossorigin=anonymous>`), $3375ddd88f77967d$var$_tmpl$16 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<source>`), $3375ddd88f77967d$var$_tmpl$17 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<span class=price>`), $3375ddd88f77967d$var$_tmpl$18 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<span class=original-price>`);
56
+ var $3375ddd88f77967d$var$_tmpl$ = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<a>`), $3375ddd88f77967d$var$_tmpl$2 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<div class="d-title line-clamp">`), $3375ddd88f77967d$var$_tmpl$3 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<div class="d-badge d-off">%`), $3375ddd88f77967d$var$_tmpl$4 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<div class=d-badges>`), $3375ddd88f77967d$var$_tmpl$5 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<div class=d-product-card>`), $3375ddd88f77967d$var$_tmpl$6 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<svg xmlns=http://www.w3.org/2000/svg width=12 height=12 class=more><path d="M10.8 6c0 .153-.061.299-.169.407s-.255.169-.407.169H6.576v3.648c0 .153-.061.299-.169.407S6.153 10.8 6 10.8s-.299-.061-.407-.169-.169-.255-.169-.407V6.576H1.776c-.153 0-.299-.061-.407-.169S1.2 6.153 1.2 6s.061-.299.169-.407.255-.169.407-.169h3.648V1.776c0-.153.061-.299.169-.407S5.847 1.2 6 1.2s.299.061.407.169.169.255.169.407v3.648h3.648c.153 0 .299.061.407.169s.169.255.169.407z">`), $3375ddd88f77967d$var$_tmpl$7 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<div class=d-swatches>`), $3375ddd88f77967d$var$_tmpl$8 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<a class=d-swatch>`), $3375ddd88f77967d$var$_tmpl$9 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<span class=more>+ <!> more`), $3375ddd88f77967d$var$_tmpl$10 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<div class=sizes>`), $3375ddd88f77967d$var$_tmpl$11 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<span>`), $3375ddd88f77967d$var$_tmpl$12 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<s>`), $3375ddd88f77967d$var$_tmpl$13 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<div>`), $3375ddd88f77967d$var$_tmpl$14 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<div class="media-item video">`), $3375ddd88f77967d$var$_tmpl$15 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<div class="media-item image">`), $3375ddd88f77967d$var$_tmpl$16 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<source type=application/x-mpegURL>`), $3375ddd88f77967d$var$_tmpl$17 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<video class=s-responsive-image crossorigin=anonymous>`), $3375ddd88f77967d$var$_tmpl$18 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<source>`), $3375ddd88f77967d$var$_tmpl$19 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<span class=price>`), $3375ddd88f77967d$var$_tmpl$20 = /*#__PURE__*/ (0, $7jsgb$solidjsweb.template)(`<span class=original-price>`);
57
57
  // You can import from the solid-js library here and leverage its reactivity to create an interactive UI.
58
58
  // Also, Depict packages can be imported (you must import /latest from those).
59
59
  const $3375ddd88f77967d$var$sizeOrder = [
@@ -204,7 +204,7 @@ function $3375ddd88f77967d$export$f11681c54c860912(display, info, configuredOpti
204
204
  (0, $7jsgb$solidjs.createEffect)(()=>!showVariantIndex() && defaultVariantIndex() != undefined && setShowVariantIndex(defaultVariantIndex()));
205
205
  const element = (0, $7jsgb$solidjsweb.createComponent)($3375ddd88f77967d$var$ContainsColorSwatchesProvider, {
206
206
  get children () {
207
- var _el$3 = $3375ddd88f77967d$var$_tmpl$3();
207
+ var _el$3 = $3375ddd88f77967d$var$_tmpl$5();
208
208
  (0, $7jsgb$solidjsweb.spread)(_el$3, (0, $7jsgb$solidjsweb.mergeProps)({
209
209
  get style () {
210
210
  return mainStyle();
@@ -231,6 +231,30 @@ function $3375ddd88f77967d$export$f11681c54c860912(display, info, configuredOpti
231
231
  });
232
232
  }
233
233
  }), null);
234
+ (0, $7jsgb$solidjsweb.insert)(_el$3, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.Suspense), {
235
+ get children () {
236
+ return (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.Show), {
237
+ get when () {
238
+ return configuredOptions_().smart_labels.enabled;
239
+ },
240
+ get children () {
241
+ var _el$4 = $3375ddd88f77967d$var$_tmpl$4();
242
+ (0, $7jsgb$solidjsweb.insert)(_el$4, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.Show), {
243
+ get when () {
244
+ return (0, $7jsgb$solidjsweb.memo)(()=>!!(salePrice() && originalPrice()))() && salePrice() !== originalPrice();
245
+ },
246
+ get children () {
247
+ var _el$5 = $3375ddd88f77967d$var$_tmpl$3(), _el$6 = _el$5.firstChild;
248
+ (0, $7jsgb$solidjsweb.use)((el)=>$3375ddd88f77967d$var$setStyleForTextOptions(el, ()=>configuredOptions_().smart_labels), _el$5);
249
+ (0, $7jsgb$solidjsweb.insert)(_el$5, ()=>Math.round((1 - salePrice() / originalPrice()) * -100), _el$6);
250
+ return _el$5;
251
+ }
252
+ }));
253
+ return _el$4;
254
+ }
255
+ });
256
+ }
257
+ }), null);
234
258
  (0, $7jsgb$solidjsweb.insert)(_el$3, ()=>{
235
259
  // We want the whole product card to be a link, except for the color swatches
236
260
  const [containsColorSwatches] = $3375ddd88f77967d$var$useContainsColorSwatches();
@@ -508,13 +532,13 @@ function $3375ddd88f77967d$var$ColorSwatches({ colorMap_: colorMap_, setShowVari
508
532
  setContainsColorSwatches(true);
509
533
  (0, $7jsgb$solidjs.onCleanup)(()=>setContainsColorSwatches(false));
510
534
  return (()=>{
511
- var _el$4 = $3375ddd88f77967d$var$_tmpl$5();
535
+ var _el$7 = $3375ddd88f77967d$var$_tmpl$7();
512
536
  (0, $7jsgb$solidjsweb.use)((el)=>{
513
537
  ref_?.(el);
514
538
  // Do like this so we don't override other styles set by AnimateRowSwitch
515
539
  (0, $7jsgb$solidjs.createEffect)(()=>$3375ddd88f77967d$var$setPropertyIfExists(el.style, "--swatch-container-height", wantedContainerHeightRem_() && wantedContainerHeightRem_() + "rem"));
516
- }, _el$4);
517
- (0, $7jsgb$solidjsweb.insert)(_el$4, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.For), {
540
+ }, _el$7);
541
+ (0, $7jsgb$solidjsweb.insert)(_el$7, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.For), {
518
542
  get each () {
519
543
  return entriesToShow();
520
544
  },
@@ -524,28 +548,28 @@ function $3375ddd88f77967d$var$ColorSwatches({ colorMap_: colorMap_, setShowVari
524
548
  // We need a default fallback for it being usable
525
549
  const [invalidColor, setInvalidColor] = (0, $7jsgb$solidjs.createSignal)(false);
526
550
  return (()=>{
527
- var _el$6 = $3375ddd88f77967d$var$_tmpl$6();
551
+ var _el$9 = $3375ddd88f77967d$var$_tmpl$8();
528
552
  (0, $7jsgb$solidjsweb.use)((element)=>requestAnimationFrame(// After one frame we're usually in the DOM, if we're not boxShadow is ""
529
553
  // If it's none, the color was invalid - so just show this swatch as a white swatch which is the prettiest
530
- (0, $7jsgb$depictaiutilisharedlatest.catchify)(()=>getComputedStyle(element).boxShadow === "none" && setInvalidColor(true))), _el$6);
531
- (0, $7jsgb$solidjsweb.addEventListener)(_el$6, "pointerleave", (0, $7jsgb$depictaiutilisharedlatest.catchify)((e)=>{
554
+ (0, $7jsgb$depictaiutilisharedlatest.catchify)(()=>getComputedStyle(element).boxShadow === "none" && setInvalidColor(true))), _el$9);
555
+ (0, $7jsgb$solidjsweb.addEventListener)(_el$9, "pointerleave", (0, $7jsgb$depictaiutilisharedlatest.catchify)((e)=>{
532
556
  clearTimeout(unHoverDebouncedTimeout);
533
557
  unHoverDebouncedTimeout = setTimeout((0, $7jsgb$depictaiutilisharedlatest.catchify)(()=>setShowVariantIndex_(defaultVariantIndex_())), 500);
534
558
  }));
535
- (0, $7jsgb$solidjsweb.addEventListener)(_el$6, "pointerenter", (0, $7jsgb$depictaiutilisharedlatest.catchify)((e)=>{
559
+ (0, $7jsgb$solidjsweb.addEventListener)(_el$9, "pointerenter", (0, $7jsgb$depictaiutilisharedlatest.catchify)((e)=>{
536
560
  clearTimeout(unHoverDebouncedTimeout);
537
561
  setShowVariantIndex_(thisColorIsDefaultColor() ? defaultVariantIndex_() : variantIndex_);
538
562
  }));
539
- (0, $7jsgb$solidjsweb.setAttribute)(_el$6, "href", pageUrl_);
540
- (0, $7jsgb$solidjsweb.setAttribute)(_el$6, "title", colorName);
563
+ (0, $7jsgb$solidjsweb.setAttribute)(_el$9, "href", pageUrl_);
564
+ (0, $7jsgb$solidjsweb.setAttribute)(_el$9, "title", colorName);
541
565
  (0, $7jsgb$solidjsweb.effect)((_p$)=>{
542
566
  var _v$5 = isHidden_?.(), _v$6 = isHidden_?.() ? -1 : undefined, _v$7 = `--background:${invalidColor() ? "white" : hexColor_}`, _v$8 = !!(colorsAtIndex_()?.[showVariantIndex_()] === colorName), _v$9 = !!thisColorIsDefaultColor(), _v$10 = !!($3375ddd88f77967d$var$isLightColor(hexColor_) || invalidColor());
543
- _v$5 !== _p$.e && (0, $7jsgb$solidjsweb.setAttribute)(_el$6, "aria-hidden", _p$.e = _v$5);
544
- _v$6 !== _p$.t && (0, $7jsgb$solidjsweb.setAttribute)(_el$6, "tabindex", _p$.t = _v$6);
545
- _p$.a = (0, $7jsgb$solidjsweb.style)(_el$6, _v$7, _p$.a);
546
- _v$8 !== _p$.o && _el$6.classList.toggle("selected", _p$.o = _v$8);
547
- _v$9 !== _p$.i && _el$6.classList.toggle("first", _p$.i = _v$9);
548
- _v$10 !== _p$.n && _el$6.classList.toggle("light-colored", _p$.n = _v$10);
567
+ _v$5 !== _p$.e && (0, $7jsgb$solidjsweb.setAttribute)(_el$9, "aria-hidden", _p$.e = _v$5);
568
+ _v$6 !== _p$.t && (0, $7jsgb$solidjsweb.setAttribute)(_el$9, "tabindex", _p$.t = _v$6);
569
+ _p$.a = (0, $7jsgb$solidjsweb.style)(_el$9, _v$7, _p$.a);
570
+ _v$8 !== _p$.o && _el$9.classList.toggle("selected", _p$.o = _v$8);
571
+ _v$9 !== _p$.i && _el$9.classList.toggle("first", _p$.i = _v$9);
572
+ _v$10 !== _p$.n && _el$9.classList.toggle("light-colored", _p$.n = _v$10);
549
573
  return _p$;
550
574
  }, {
551
575
  e: undefined,
@@ -555,19 +579,19 @@ function $3375ddd88f77967d$var$ColorSwatches({ colorMap_: colorMap_, setShowVari
555
579
  i: undefined,
556
580
  n: undefined
557
581
  });
558
- return _el$6;
582
+ return _el$9;
559
583
  })();
560
584
  }
561
585
  }), null);
562
- (0, $7jsgb$solidjsweb.insert)(_el$4, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.Show), {
586
+ (0, $7jsgb$solidjsweb.insert)(_el$7, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.Show), {
563
587
  get when () {
564
588
  return entriesToShow().length !== colorMap_().size;
565
589
  },
566
590
  get children () {
567
- return $3375ddd88f77967d$var$_tmpl$4();
591
+ return $3375ddd88f77967d$var$_tmpl$6();
568
592
  }
569
593
  }), null);
570
- return _el$4;
594
+ return _el$7;
571
595
  })();
572
596
  })();
573
597
  }
@@ -591,14 +615,14 @@ function $3375ddd88f77967d$var$Sizes({ sizesInStock_: sizesInStock_, ref_: ref_,
591
615
  return keysToShow().length > 1;
592
616
  },
593
617
  get children () {
594
- var _el$7 = $3375ddd88f77967d$var$_tmpl$8();
618
+ var _el$10 = $3375ddd88f77967d$var$_tmpl$10();
595
619
  (0, $7jsgb$solidjsweb.use)((el)=>{
596
620
  ref_?.(el);
597
621
  // Do like this so we don't override other styles set by AnimateRowSwitch
598
622
  (0, $7jsgb$solidjs.createEffect)(()=>el.style.setProperty("--font-size-rem", fontSizeRem_() + "rem"));
599
623
  (0, $7jsgb$solidjs.createEffect)(()=>el.style.setProperty("--sizes-gap", gap() + "px"));
600
- }, _el$7);
601
- (0, $7jsgb$solidjsweb.insert)(_el$7, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.For), {
624
+ }, _el$10);
625
+ (0, $7jsgb$solidjsweb.insert)(_el$10, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.For), {
602
626
  get each () {
603
627
  return $3375ddd88f77967d$var$sortSizes(keysToShow());
604
628
  },
@@ -608,30 +632,30 @@ function $3375ddd88f77967d$var$Sizes({ sizesInStock_: sizesInStock_, ref_: ref_,
608
632
  },
609
633
  get fallback () {
610
634
  return (()=>{
611
- var _el$13 = $3375ddd88f77967d$var$_tmpl$10();
612
- (0, $7jsgb$solidjsweb.insert)(_el$13, size);
613
- return _el$13;
635
+ var _el$16 = $3375ddd88f77967d$var$_tmpl$12();
636
+ (0, $7jsgb$solidjsweb.insert)(_el$16, size);
637
+ return _el$16;
614
638
  })();
615
639
  },
616
640
  get children () {
617
- var _el$12 = $3375ddd88f77967d$var$_tmpl$9();
618
- (0, $7jsgb$solidjsweb.insert)(_el$12, size);
619
- return _el$12;
641
+ var _el$15 = $3375ddd88f77967d$var$_tmpl$11();
642
+ (0, $7jsgb$solidjsweb.insert)(_el$15, size);
643
+ return _el$15;
620
644
  }
621
645
  })
622
646
  }), null);
623
- (0, $7jsgb$solidjsweb.insert)(_el$7, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.Show), {
647
+ (0, $7jsgb$solidjsweb.insert)(_el$10, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.Show), {
624
648
  get when () {
625
649
  return hidden() > 0;
626
650
  },
627
651
  get children () {
628
- var _el$8 = $3375ddd88f77967d$var$_tmpl$7(), _el$9 = _el$8.firstChild, _el$11 = _el$9.nextSibling, _el$10 = _el$11.nextSibling;
629
- (0, $7jsgb$solidjsweb.insert)(_el$8, hidden, _el$11);
630
- return _el$8;
652
+ var _el$11 = $3375ddd88f77967d$var$_tmpl$9(), _el$12 = _el$11.firstChild, _el$14 = _el$12.nextSibling, _el$13 = _el$14.nextSibling;
653
+ (0, $7jsgb$solidjsweb.insert)(_el$11, hidden, _el$14);
654
+ return _el$11;
631
655
  }
632
656
  }), null);
633
- (0, $7jsgb$solidjsweb.effect)(()=>_el$7.classList.toggle("small", !!(widthAvailableForSizes_() < 250)));
634
- return _el$7;
657
+ (0, $7jsgb$solidjsweb.effect)(()=>_el$10.classList.toggle("small", !!(widthAvailableForSizes_() < 250)));
658
+ return _el$10;
635
659
  }
636
660
  });
637
661
  }
@@ -679,10 +703,10 @@ function $3375ddd88f77967d$var$ImagesAndVideos({ image_urls_: image_urls_, video
679
703
  },
680
704
  get fallback () {
681
705
  return (()=>{
682
- var _el$14 = $3375ddd88f77967d$var$_tmpl$11();
683
- (0, $7jsgb$solidjsweb.insert)(_el$14, resolved);
684
- (0, $7jsgb$solidjsweb.effect)(()=>(0, $7jsgb$solidjsweb.className)(_el$14, containerClasses().join(" ")));
685
- return _el$14;
706
+ var _el$17 = $3375ddd88f77967d$var$_tmpl$13();
707
+ (0, $7jsgb$solidjsweb.insert)(_el$17, resolved);
708
+ (0, $7jsgb$solidjsweb.effect)(()=>(0, $7jsgb$solidjsweb.className)(_el$17, containerClasses().join(" ")));
709
+ return _el$17;
686
710
  })();
687
711
  },
688
712
  get children () {
@@ -789,8 +813,8 @@ function $3375ddd88f77967d$var$ImagesAndVideos({ image_urls_: image_urls_, video
789
813
  get children () {
790
814
  return (0, $7jsgb$solidjsweb.createComponent)(MaybeShowLazily, {
791
815
  get children () {
792
- var _el$15 = $3375ddd88f77967d$var$_tmpl$12();
793
- (0, $7jsgb$solidjsweb.insert)(_el$15, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$depictaiuilatest.ImageContainer), {
816
+ var _el$18 = $3375ddd88f77967d$var$_tmpl$14();
817
+ (0, $7jsgb$solidjsweb.insert)(_el$18, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$depictaiuilatest.ImageContainer), {
794
818
  get aspectRatio () {
795
819
  return aspectRatio_();
796
820
  },
@@ -811,7 +835,7 @@ function $3375ddd88f77967d$var$ImagesAndVideos({ image_urls_: image_urls_, video
811
835
  });
812
836
  }
813
837
  }));
814
- return _el$15;
838
+ return _el$18;
815
839
  }
816
840
  });
817
841
  }
@@ -832,8 +856,8 @@ function $3375ddd88f77967d$var$ImagesAndVideos({ image_urls_: image_urls_, video
832
856
  get children () {
833
857
  return (0, $7jsgb$solidjsweb.createComponent)(MaybeShowLazily, {
834
858
  get children () {
835
- var _el$16 = $3375ddd88f77967d$var$_tmpl$13();
836
- (0, $7jsgb$solidjsweb.insert)(_el$16, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$depictaiuilatest.ShopifyContainedImage), {
859
+ var _el$19 = $3375ddd88f77967d$var$_tmpl$15();
860
+ (0, $7jsgb$solidjsweb.insert)(_el$19, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$depictaiuilatest.ShopifyContainedImage), {
837
861
  src: image_url,
838
862
  get aspectRatio () {
839
863
  return aspectRatio_();
@@ -842,7 +866,7 @@ function $3375ddd88f77967d$var$ImagesAndVideos({ image_urls_: image_urls_, video
842
866
  alt: "Product image"
843
867
  }
844
868
  }), null);
845
- (0, $7jsgb$solidjsweb.insert)(_el$16, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.Show), {
869
+ (0, $7jsgb$solidjsweb.insert)(_el$19, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.Show), {
846
870
  get when () {
847
871
  return (0, $7jsgb$solidjsweb.memo)(()=>!!(!index() && image_urls_()?.[1]))() && !hoverImageDisabled();
848
872
  },
@@ -863,7 +887,7 @@ function $3375ddd88f77967d$var$ImagesAndVideos({ image_urls_: image_urls_, video
863
887
  });
864
888
  }
865
889
  }), null);
866
- return _el$16;
890
+ return _el$19;
867
891
  }
868
892
  });
869
893
  }
@@ -894,46 +918,46 @@ function $3375ddd88f77967d$var$Video(props) {
894
918
  const productCardIndexAccessor = (0, $7jsgb$depictaiuilatest.useProductCardIndex)();
895
919
  const cardIsVisible = (0, $7jsgb$depictaiuilatest.useProductCardIsVisible)();
896
920
  return (()=>{
897
- var _el$17 = $3375ddd88f77967d$var$_tmpl$15();
921
+ var _el$20 = $3375ddd88f77967d$var$_tmpl$17();
898
922
  (0, $7jsgb$solidjsweb.use)((element)=>{
899
923
  element.disablePictureInPicture = true;
900
924
  (0, $7jsgb$solidjs.createEffect)(()=>{
901
925
  if ((cardIsVisible() || props.forceIsVisible_) && tabIsVisible() && !props.swipedPastVideo_) element.play().catch((e)=>(0, $7jsgb$depictaiutilisharedlatest.dwarn)("Error playing video", e));
902
926
  else element.pause();
903
927
  });
904
- }, _el$17);
905
- _el$17.controls = false;
906
- _el$17.playsInline = true;
907
- _el$17.loop = true;
908
- _el$17.muted = true;
909
- (0, $7jsgb$solidjsweb.spread)(_el$17, (0, $7jsgb$solidjsweb.mergeProps)({
928
+ }, _el$20);
929
+ _el$20.controls = false;
930
+ _el$20.playsInline = true;
931
+ _el$20.loop = true;
932
+ _el$20.muted = true;
933
+ (0, $7jsgb$solidjsweb.spread)(_el$20, (0, $7jsgb$solidjsweb.mergeProps)({
910
934
  get poster () {
911
935
  return props.poster_;
912
936
  }
913
937
  }, ()=>productCardIndexAccessor?.() < 8 && {
914
938
  preload: "auto"
915
939
  }), false, true);
916
- (0, $7jsgb$solidjsweb.insert)(_el$17, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.Show), {
940
+ (0, $7jsgb$solidjsweb.insert)(_el$20, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.Show), {
917
941
  get when () {
918
942
  return hlsSource();
919
943
  },
920
944
  get children () {
921
- var _el$18 = $3375ddd88f77967d$var$_tmpl$14();
922
- (0, $7jsgb$solidjsweb.effect)(()=>(0, $7jsgb$solidjsweb.setAttribute)(_el$18, "src", hlsSource()));
923
- return _el$18;
945
+ var _el$21 = $3375ddd88f77967d$var$_tmpl$16();
946
+ (0, $7jsgb$solidjsweb.effect)(()=>(0, $7jsgb$solidjsweb.setAttribute)(_el$21, "src", hlsSource()));
947
+ return _el$21;
924
948
  }
925
949
  }), null);
926
- (0, $7jsgb$solidjsweb.insert)(_el$17, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.For), {
950
+ (0, $7jsgb$solidjsweb.insert)(_el$20, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.For), {
927
951
  get each () {
928
952
  return nonHLSSources();
929
953
  },
930
954
  children: (source)=>(()=>{
931
- var _el$19 = $3375ddd88f77967d$var$_tmpl$16();
932
- (0, $7jsgb$solidjsweb.setAttribute)(_el$19, "src", source);
933
- return _el$19;
955
+ var _el$22 = $3375ddd88f77967d$var$_tmpl$18();
956
+ (0, $7jsgb$solidjsweb.setAttribute)(_el$22, "src", source);
957
+ return _el$22;
934
958
  })()
935
959
  }), null);
936
- return _el$17;
960
+ return _el$20;
937
961
  })();
938
962
  }
939
963
  // ChatGPT written
@@ -970,9 +994,9 @@ function $3375ddd88f77967d$var$Prices({ formatPrice_: formatPrice_, configuredOp
970
994
  get children () {
971
995
  return [
972
996
  (()=>{
973
- var _el$20 = $3375ddd88f77967d$var$_tmpl$17();
974
- (0, $7jsgb$solidjsweb.use)((el)=>$3375ddd88f77967d$var$setStyleForTextOptions(el, priceOptions), _el$20);
975
- (0, $7jsgb$solidjsweb.insert)(_el$20, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.Show), {
997
+ var _el$23 = $3375ddd88f77967d$var$_tmpl$19();
998
+ (0, $7jsgb$solidjsweb.use)((el)=>$3375ddd88f77967d$var$setStyleForTextOptions(el, priceOptions), _el$23);
999
+ (0, $7jsgb$solidjsweb.insert)(_el$23, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.Show), {
976
1000
  get when () {
977
1001
  return variantToShow_();
978
1002
  },
@@ -996,7 +1020,7 @@ function $3375ddd88f77967d$var$Prices({ formatPrice_: formatPrice_, configuredOp
996
1020
  });
997
1021
  }
998
1022
  }));
999
- return _el$20;
1023
+ return _el$23;
1000
1024
  })(),
1001
1025
  (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.Suspense), {
1002
1026
  get children () {
@@ -1008,10 +1032,10 @@ function $3375ddd88f77967d$var$Prices({ formatPrice_: formatPrice_, configuredOp
1008
1032
  return [
1009
1033
  " ",
1010
1034
  (()=>{
1011
- var _el$21 = $3375ddd88f77967d$var$_tmpl$18();
1012
- (0, $7jsgb$solidjsweb.use)((el)=>$3375ddd88f77967d$var$setStyleForTextOptions(el, originalPriceOptions), _el$21);
1013
- (0, $7jsgb$solidjsweb.insert)(_el$21, ()=>formatPrice_?.(originalPrice_()));
1014
- return _el$21;
1035
+ var _el$24 = $3375ddd88f77967d$var$_tmpl$20();
1036
+ (0, $7jsgb$solidjsweb.use)((el)=>$3375ddd88f77967d$var$setStyleForTextOptions(el, originalPriceOptions), _el$24);
1037
+ (0, $7jsgb$solidjsweb.insert)(_el$24, ()=>formatPrice_?.(originalPrice_()));
1038
+ return _el$24;
1015
1039
  })()
1016
1040
  ];
1017
1041
  }
@@ -1093,11 +1117,11 @@ function $3375ddd88f77967d$var$InComponentOrDiv(props) {
1093
1117
  children: resolved
1094
1118
  });
1095
1119
  return (()=>{
1096
- var _el$22 = $3375ddd88f77967d$var$_tmpl$11();
1097
- (0, $7jsgb$solidjsweb.use)((el)=>props?.ref_?.(el), _el$22);
1098
- (0, $7jsgb$solidjsweb.insert)(_el$22, resolved);
1099
- (0, $7jsgb$solidjsweb.effect)(()=>(0, $7jsgb$solidjsweb.className)(_el$22, props.class_));
1100
- return _el$22;
1120
+ var _el$25 = $3375ddd88f77967d$var$_tmpl$13();
1121
+ (0, $7jsgb$solidjsweb.use)((el)=>props?.ref_?.(el), _el$25);
1122
+ (0, $7jsgb$solidjsweb.insert)(_el$25, resolved);
1123
+ (0, $7jsgb$solidjsweb.effect)(()=>(0, $7jsgb$solidjsweb.className)(_el$25, props.class_));
1124
+ return _el$25;
1101
1125
  })();
1102
1126
  });
1103
1127
  }
@@ -1114,7 +1138,6 @@ function $70cc6bd7e3f1dd4b$export$d1a48be4967fe67c(react_props) {
1114
1138
  solid_component: (props_store)=>{
1115
1139
  return (0, $3375ddd88f77967d$export$f11681c54c860912)(()=>props_store.display, {
1116
1140
  set_on_index_change: ()=>{},
1117
- depictCardsDataset: {},
1118
1141
  formatPrice: (price)=>price && (0, $7jsgb$depictaiutilisharedlatest.standard_price_format)(price)
1119
1142
  }, ()=>({
1120
1143
  ...props_store?.options || $70cc6bd7e3f1dd4b$export$5c9921af2948d16a,
@@ -1181,7 +1204,6 @@ function $9b4cfecb283dbb57$export$ef681ece395f74(props) {
1181
1204
  product_card_template: (display, info)=>{
1182
1205
  return (0, $3375ddd88f77967d$export$f11681c54c860912)(()=>display, info && {
1183
1206
  ...info,
1184
- depictCardsDataset: {},
1185
1207
  formatPrice: (price)=>price && (0, $7jsgb$depictaiutilisharedlatest.standard_price_format)(price)
1186
1208
  }, ()=>props.productCardConfig || (0, $70cc6bd7e3f1dd4b$export$5c9921af2948d16a));
1187
1209
  },
@@ -1229,7 +1251,6 @@ function $1113a95ded76fc38$var$SolidWrapper(props) {
1229
1251
  product_card_template: (display, info)=>{
1230
1252
  return (0, $3375ddd88f77967d$export$f11681c54c860912)(()=>display, info && {
1231
1253
  ...info,
1232
- depictCardsDataset: {},
1233
1254
  formatPrice: (price)=>price && (0, $7jsgb$depictaiutilisharedlatest.standard_price_format)(price)
1234
1255
  }, ()=>props.productCardConfig || (0, $70cc6bd7e3f1dd4b$export$5c9921af2948d16a));
1235
1256
  },
package/dist/module.js CHANGED
@@ -3,11 +3,11 @@ import {RecommendationGrid as $2MCgq$RecommendationGrid, defaultColsAtSize as $2
3
3
  import {render as $2MCgq$render, template as $2MCgq$template, createComponent as $2MCgq$createComponent, addEventListener as $2MCgq$addEventListener, use as $2MCgq$use, insert as $2MCgq$insert, effect as $2MCgq$effect, className as $2MCgq$className, setAttribute as $2MCgq$setAttribute, spread as $2MCgq$spread, mergeProps as $2MCgq$mergeProps, memo as $2MCgq$memo, style as $2MCgq$style, classList as $2MCgq$classList, delegateEvents as $2MCgq$delegateEvents} from "solid-js/web";
4
4
  import {useRef as $2MCgq$useRef, useState as $2MCgq$useState, useEffect as $2MCgq$useEffect, createElement as $2MCgq$createElement, Fragment as $2MCgq$Fragment} from "react";
5
5
  import {createStore as $2MCgq$createStore, reconcile as $2MCgq$reconcile} from "solid-js/store";
6
- import {createContext as $2MCgq$createContext, createMemo as $2MCgq$createMemo, createSignal as $2MCgq$createSignal, untrack as $2MCgq$untrack, createResource as $2MCgq$createResource, Suspense as $2MCgq$Suspense, createEffect as $2MCgq$createEffect, children as $2MCgq$children, Show as $2MCgq$Show, onCleanup as $2MCgq$onCleanup, For as $2MCgq$For, createRenderEffect as $2MCgq$createRenderEffect, on as $2MCgq$on, useContext as $2MCgq$useContext} from "solid-js";
6
+ import {createContext as $2MCgq$createContext, createMemo as $2MCgq$createMemo, createSignal as $2MCgq$createSignal, untrack as $2MCgq$untrack, createResource as $2MCgq$createResource, Suspense as $2MCgq$Suspense, createEffect as $2MCgq$createEffect, Show as $2MCgq$Show, children as $2MCgq$children, onCleanup as $2MCgq$onCleanup, For as $2MCgq$For, createRenderEffect as $2MCgq$createRenderEffect, on as $2MCgq$on, useContext as $2MCgq$useContext} from "solid-js";
7
7
  import {createPortal as $2MCgq$createPortal} from "react-dom";
8
8
 
9
9
  /*! Depict.ai portal components */ // This is where the actual source of your React stuff should live
10
- const $91c11b750e80ede3$export$83d89fbfd8236492 = "2.7.35";
10
+ const $91c11b750e80ede3$export$83d89fbfd8236492 = "2.7.37";
11
11
 
12
12
 
13
13
 
@@ -40,7 +40,7 @@ function $0fe03f2fcd2418f8$export$f6e64e17bd69eeef({ solid_component: solid_comp
40
40
 
41
41
 
42
42
 
43
- var $29535f590238371c$var$_tmpl$ = /*#__PURE__*/ (0, $2MCgq$template)(`<a>`), $29535f590238371c$var$_tmpl$2 = /*#__PURE__*/ (0, $2MCgq$template)(`<div class="d-title line-clamp">`), $29535f590238371c$var$_tmpl$3 = /*#__PURE__*/ (0, $2MCgq$template)(`<div class=d-product-card>`), $29535f590238371c$var$_tmpl$4 = /*#__PURE__*/ (0, $2MCgq$template)(`<svg xmlns=http://www.w3.org/2000/svg width=12 height=12 class=more><path d="M10.8 6c0 .153-.061.299-.169.407s-.255.169-.407.169H6.576v3.648c0 .153-.061.299-.169.407S6.153 10.8 6 10.8s-.299-.061-.407-.169-.169-.255-.169-.407V6.576H1.776c-.153 0-.299-.061-.407-.169S1.2 6.153 1.2 6s.061-.299.169-.407.255-.169.407-.169h3.648V1.776c0-.153.061-.299.169-.407S5.847 1.2 6 1.2s.299.061.407.169.169.255.169.407v3.648h3.648c.153 0 .299.061.407.169s.169.255.169.407z">`), $29535f590238371c$var$_tmpl$5 = /*#__PURE__*/ (0, $2MCgq$template)(`<div class=d-swatches>`), $29535f590238371c$var$_tmpl$6 = /*#__PURE__*/ (0, $2MCgq$template)(`<a class=d-swatch>`), $29535f590238371c$var$_tmpl$7 = /*#__PURE__*/ (0, $2MCgq$template)(`<span class=more>+ <!> more`), $29535f590238371c$var$_tmpl$8 = /*#__PURE__*/ (0, $2MCgq$template)(`<div class=sizes>`), $29535f590238371c$var$_tmpl$9 = /*#__PURE__*/ (0, $2MCgq$template)(`<span>`), $29535f590238371c$var$_tmpl$10 = /*#__PURE__*/ (0, $2MCgq$template)(`<s>`), $29535f590238371c$var$_tmpl$11 = /*#__PURE__*/ (0, $2MCgq$template)(`<div>`), $29535f590238371c$var$_tmpl$12 = /*#__PURE__*/ (0, $2MCgq$template)(`<div class="media-item video">`), $29535f590238371c$var$_tmpl$13 = /*#__PURE__*/ (0, $2MCgq$template)(`<div class="media-item image">`), $29535f590238371c$var$_tmpl$14 = /*#__PURE__*/ (0, $2MCgq$template)(`<source type=application/x-mpegURL>`), $29535f590238371c$var$_tmpl$15 = /*#__PURE__*/ (0, $2MCgq$template)(`<video class=s-responsive-image crossorigin=anonymous>`), $29535f590238371c$var$_tmpl$16 = /*#__PURE__*/ (0, $2MCgq$template)(`<source>`), $29535f590238371c$var$_tmpl$17 = /*#__PURE__*/ (0, $2MCgq$template)(`<span class=price>`), $29535f590238371c$var$_tmpl$18 = /*#__PURE__*/ (0, $2MCgq$template)(`<span class=original-price>`);
43
+ var $29535f590238371c$var$_tmpl$ = /*#__PURE__*/ (0, $2MCgq$template)(`<a>`), $29535f590238371c$var$_tmpl$2 = /*#__PURE__*/ (0, $2MCgq$template)(`<div class="d-title line-clamp">`), $29535f590238371c$var$_tmpl$3 = /*#__PURE__*/ (0, $2MCgq$template)(`<div class="d-badge d-off">%`), $29535f590238371c$var$_tmpl$4 = /*#__PURE__*/ (0, $2MCgq$template)(`<div class=d-badges>`), $29535f590238371c$var$_tmpl$5 = /*#__PURE__*/ (0, $2MCgq$template)(`<div class=d-product-card>`), $29535f590238371c$var$_tmpl$6 = /*#__PURE__*/ (0, $2MCgq$template)(`<svg xmlns=http://www.w3.org/2000/svg width=12 height=12 class=more><path d="M10.8 6c0 .153-.061.299-.169.407s-.255.169-.407.169H6.576v3.648c0 .153-.061.299-.169.407S6.153 10.8 6 10.8s-.299-.061-.407-.169-.169-.255-.169-.407V6.576H1.776c-.153 0-.299-.061-.407-.169S1.2 6.153 1.2 6s.061-.299.169-.407.255-.169.407-.169h3.648V1.776c0-.153.061-.299.169-.407S5.847 1.2 6 1.2s.299.061.407.169.169.255.169.407v3.648h3.648c.153 0 .299.061.407.169s.169.255.169.407z">`), $29535f590238371c$var$_tmpl$7 = /*#__PURE__*/ (0, $2MCgq$template)(`<div class=d-swatches>`), $29535f590238371c$var$_tmpl$8 = /*#__PURE__*/ (0, $2MCgq$template)(`<a class=d-swatch>`), $29535f590238371c$var$_tmpl$9 = /*#__PURE__*/ (0, $2MCgq$template)(`<span class=more>+ <!> more`), $29535f590238371c$var$_tmpl$10 = /*#__PURE__*/ (0, $2MCgq$template)(`<div class=sizes>`), $29535f590238371c$var$_tmpl$11 = /*#__PURE__*/ (0, $2MCgq$template)(`<span>`), $29535f590238371c$var$_tmpl$12 = /*#__PURE__*/ (0, $2MCgq$template)(`<s>`), $29535f590238371c$var$_tmpl$13 = /*#__PURE__*/ (0, $2MCgq$template)(`<div>`), $29535f590238371c$var$_tmpl$14 = /*#__PURE__*/ (0, $2MCgq$template)(`<div class="media-item video">`), $29535f590238371c$var$_tmpl$15 = /*#__PURE__*/ (0, $2MCgq$template)(`<div class="media-item image">`), $29535f590238371c$var$_tmpl$16 = /*#__PURE__*/ (0, $2MCgq$template)(`<source type=application/x-mpegURL>`), $29535f590238371c$var$_tmpl$17 = /*#__PURE__*/ (0, $2MCgq$template)(`<video class=s-responsive-image crossorigin=anonymous>`), $29535f590238371c$var$_tmpl$18 = /*#__PURE__*/ (0, $2MCgq$template)(`<source>`), $29535f590238371c$var$_tmpl$19 = /*#__PURE__*/ (0, $2MCgq$template)(`<span class=price>`), $29535f590238371c$var$_tmpl$20 = /*#__PURE__*/ (0, $2MCgq$template)(`<span class=original-price>`);
44
44
  // You can import from the solid-js library here and leverage its reactivity to create an interactive UI.
45
45
  // Also, Depict packages can be imported (you must import /latest from those).
46
46
  const $29535f590238371c$var$sizeOrder = [
@@ -191,7 +191,7 @@ function $29535f590238371c$export$f11681c54c860912(display, info, configuredOpti
191
191
  (0, $2MCgq$createEffect)(()=>!showVariantIndex() && defaultVariantIndex() != undefined && setShowVariantIndex(defaultVariantIndex()));
192
192
  const element = (0, $2MCgq$createComponent)($29535f590238371c$var$ContainsColorSwatchesProvider, {
193
193
  get children () {
194
- var _el$3 = $29535f590238371c$var$_tmpl$3();
194
+ var _el$3 = $29535f590238371c$var$_tmpl$5();
195
195
  (0, $2MCgq$spread)(_el$3, (0, $2MCgq$mergeProps)({
196
196
  get style () {
197
197
  return mainStyle();
@@ -218,6 +218,30 @@ function $29535f590238371c$export$f11681c54c860912(display, info, configuredOpti
218
218
  });
219
219
  }
220
220
  }), null);
221
+ (0, $2MCgq$insert)(_el$3, (0, $2MCgq$createComponent)((0, $2MCgq$Suspense), {
222
+ get children () {
223
+ return (0, $2MCgq$createComponent)((0, $2MCgq$Show), {
224
+ get when () {
225
+ return configuredOptions_().smart_labels.enabled;
226
+ },
227
+ get children () {
228
+ var _el$4 = $29535f590238371c$var$_tmpl$4();
229
+ (0, $2MCgq$insert)(_el$4, (0, $2MCgq$createComponent)((0, $2MCgq$Show), {
230
+ get when () {
231
+ return (0, $2MCgq$memo)(()=>!!(salePrice() && originalPrice()))() && salePrice() !== originalPrice();
232
+ },
233
+ get children () {
234
+ var _el$5 = $29535f590238371c$var$_tmpl$3(), _el$6 = _el$5.firstChild;
235
+ (0, $2MCgq$use)((el)=>$29535f590238371c$var$setStyleForTextOptions(el, ()=>configuredOptions_().smart_labels), _el$5);
236
+ (0, $2MCgq$insert)(_el$5, ()=>Math.round((1 - salePrice() / originalPrice()) * -100), _el$6);
237
+ return _el$5;
238
+ }
239
+ }));
240
+ return _el$4;
241
+ }
242
+ });
243
+ }
244
+ }), null);
221
245
  (0, $2MCgq$insert)(_el$3, ()=>{
222
246
  // We want the whole product card to be a link, except for the color swatches
223
247
  const [containsColorSwatches] = $29535f590238371c$var$useContainsColorSwatches();
@@ -495,13 +519,13 @@ function $29535f590238371c$var$ColorSwatches({ colorMap_: colorMap_, setShowVari
495
519
  setContainsColorSwatches(true);
496
520
  (0, $2MCgq$onCleanup)(()=>setContainsColorSwatches(false));
497
521
  return (()=>{
498
- var _el$4 = $29535f590238371c$var$_tmpl$5();
522
+ var _el$7 = $29535f590238371c$var$_tmpl$7();
499
523
  (0, $2MCgq$use)((el)=>{
500
524
  ref_?.(el);
501
525
  // Do like this so we don't override other styles set by AnimateRowSwitch
502
526
  (0, $2MCgq$createEffect)(()=>$29535f590238371c$var$setPropertyIfExists(el.style, "--swatch-container-height", wantedContainerHeightRem_() && wantedContainerHeightRem_() + "rem"));
503
- }, _el$4);
504
- (0, $2MCgq$insert)(_el$4, (0, $2MCgq$createComponent)((0, $2MCgq$For), {
527
+ }, _el$7);
528
+ (0, $2MCgq$insert)(_el$7, (0, $2MCgq$createComponent)((0, $2MCgq$For), {
505
529
  get each () {
506
530
  return entriesToShow();
507
531
  },
@@ -511,28 +535,28 @@ function $29535f590238371c$var$ColorSwatches({ colorMap_: colorMap_, setShowVari
511
535
  // We need a default fallback for it being usable
512
536
  const [invalidColor, setInvalidColor] = (0, $2MCgq$createSignal)(false);
513
537
  return (()=>{
514
- var _el$6 = $29535f590238371c$var$_tmpl$6();
538
+ var _el$9 = $29535f590238371c$var$_tmpl$8();
515
539
  (0, $2MCgq$use)((element)=>requestAnimationFrame(// After one frame we're usually in the DOM, if we're not boxShadow is ""
516
540
  // If it's none, the color was invalid - so just show this swatch as a white swatch which is the prettiest
517
- (0, $2MCgq$catchify)(()=>getComputedStyle(element).boxShadow === "none" && setInvalidColor(true))), _el$6);
518
- (0, $2MCgq$addEventListener)(_el$6, "pointerleave", (0, $2MCgq$catchify)((e)=>{
541
+ (0, $2MCgq$catchify)(()=>getComputedStyle(element).boxShadow === "none" && setInvalidColor(true))), _el$9);
542
+ (0, $2MCgq$addEventListener)(_el$9, "pointerleave", (0, $2MCgq$catchify)((e)=>{
519
543
  clearTimeout(unHoverDebouncedTimeout);
520
544
  unHoverDebouncedTimeout = setTimeout((0, $2MCgq$catchify)(()=>setShowVariantIndex_(defaultVariantIndex_())), 500);
521
545
  }));
522
- (0, $2MCgq$addEventListener)(_el$6, "pointerenter", (0, $2MCgq$catchify)((e)=>{
546
+ (0, $2MCgq$addEventListener)(_el$9, "pointerenter", (0, $2MCgq$catchify)((e)=>{
523
547
  clearTimeout(unHoverDebouncedTimeout);
524
548
  setShowVariantIndex_(thisColorIsDefaultColor() ? defaultVariantIndex_() : variantIndex_);
525
549
  }));
526
- (0, $2MCgq$setAttribute)(_el$6, "href", pageUrl_);
527
- (0, $2MCgq$setAttribute)(_el$6, "title", colorName);
550
+ (0, $2MCgq$setAttribute)(_el$9, "href", pageUrl_);
551
+ (0, $2MCgq$setAttribute)(_el$9, "title", colorName);
528
552
  (0, $2MCgq$effect)((_p$)=>{
529
553
  var _v$5 = isHidden_?.(), _v$6 = isHidden_?.() ? -1 : undefined, _v$7 = `--background:${invalidColor() ? "white" : hexColor_}`, _v$8 = !!(colorsAtIndex_()?.[showVariantIndex_()] === colorName), _v$9 = !!thisColorIsDefaultColor(), _v$10 = !!($29535f590238371c$var$isLightColor(hexColor_) || invalidColor());
530
- _v$5 !== _p$.e && (0, $2MCgq$setAttribute)(_el$6, "aria-hidden", _p$.e = _v$5);
531
- _v$6 !== _p$.t && (0, $2MCgq$setAttribute)(_el$6, "tabindex", _p$.t = _v$6);
532
- _p$.a = (0, $2MCgq$style)(_el$6, _v$7, _p$.a);
533
- _v$8 !== _p$.o && _el$6.classList.toggle("selected", _p$.o = _v$8);
534
- _v$9 !== _p$.i && _el$6.classList.toggle("first", _p$.i = _v$9);
535
- _v$10 !== _p$.n && _el$6.classList.toggle("light-colored", _p$.n = _v$10);
554
+ _v$5 !== _p$.e && (0, $2MCgq$setAttribute)(_el$9, "aria-hidden", _p$.e = _v$5);
555
+ _v$6 !== _p$.t && (0, $2MCgq$setAttribute)(_el$9, "tabindex", _p$.t = _v$6);
556
+ _p$.a = (0, $2MCgq$style)(_el$9, _v$7, _p$.a);
557
+ _v$8 !== _p$.o && _el$9.classList.toggle("selected", _p$.o = _v$8);
558
+ _v$9 !== _p$.i && _el$9.classList.toggle("first", _p$.i = _v$9);
559
+ _v$10 !== _p$.n && _el$9.classList.toggle("light-colored", _p$.n = _v$10);
536
560
  return _p$;
537
561
  }, {
538
562
  e: undefined,
@@ -542,19 +566,19 @@ function $29535f590238371c$var$ColorSwatches({ colorMap_: colorMap_, setShowVari
542
566
  i: undefined,
543
567
  n: undefined
544
568
  });
545
- return _el$6;
569
+ return _el$9;
546
570
  })();
547
571
  }
548
572
  }), null);
549
- (0, $2MCgq$insert)(_el$4, (0, $2MCgq$createComponent)((0, $2MCgq$Show), {
573
+ (0, $2MCgq$insert)(_el$7, (0, $2MCgq$createComponent)((0, $2MCgq$Show), {
550
574
  get when () {
551
575
  return entriesToShow().length !== colorMap_().size;
552
576
  },
553
577
  get children () {
554
- return $29535f590238371c$var$_tmpl$4();
578
+ return $29535f590238371c$var$_tmpl$6();
555
579
  }
556
580
  }), null);
557
- return _el$4;
581
+ return _el$7;
558
582
  })();
559
583
  })();
560
584
  }
@@ -578,14 +602,14 @@ function $29535f590238371c$var$Sizes({ sizesInStock_: sizesInStock_, ref_: ref_,
578
602
  return keysToShow().length > 1;
579
603
  },
580
604
  get children () {
581
- var _el$7 = $29535f590238371c$var$_tmpl$8();
605
+ var _el$10 = $29535f590238371c$var$_tmpl$10();
582
606
  (0, $2MCgq$use)((el)=>{
583
607
  ref_?.(el);
584
608
  // Do like this so we don't override other styles set by AnimateRowSwitch
585
609
  (0, $2MCgq$createEffect)(()=>el.style.setProperty("--font-size-rem", fontSizeRem_() + "rem"));
586
610
  (0, $2MCgq$createEffect)(()=>el.style.setProperty("--sizes-gap", gap() + "px"));
587
- }, _el$7);
588
- (0, $2MCgq$insert)(_el$7, (0, $2MCgq$createComponent)((0, $2MCgq$For), {
611
+ }, _el$10);
612
+ (0, $2MCgq$insert)(_el$10, (0, $2MCgq$createComponent)((0, $2MCgq$For), {
589
613
  get each () {
590
614
  return $29535f590238371c$var$sortSizes(keysToShow());
591
615
  },
@@ -595,30 +619,30 @@ function $29535f590238371c$var$Sizes({ sizesInStock_: sizesInStock_, ref_: ref_,
595
619
  },
596
620
  get fallback () {
597
621
  return (()=>{
598
- var _el$13 = $29535f590238371c$var$_tmpl$10();
599
- (0, $2MCgq$insert)(_el$13, size);
600
- return _el$13;
622
+ var _el$16 = $29535f590238371c$var$_tmpl$12();
623
+ (0, $2MCgq$insert)(_el$16, size);
624
+ return _el$16;
601
625
  })();
602
626
  },
603
627
  get children () {
604
- var _el$12 = $29535f590238371c$var$_tmpl$9();
605
- (0, $2MCgq$insert)(_el$12, size);
606
- return _el$12;
628
+ var _el$15 = $29535f590238371c$var$_tmpl$11();
629
+ (0, $2MCgq$insert)(_el$15, size);
630
+ return _el$15;
607
631
  }
608
632
  })
609
633
  }), null);
610
- (0, $2MCgq$insert)(_el$7, (0, $2MCgq$createComponent)((0, $2MCgq$Show), {
634
+ (0, $2MCgq$insert)(_el$10, (0, $2MCgq$createComponent)((0, $2MCgq$Show), {
611
635
  get when () {
612
636
  return hidden() > 0;
613
637
  },
614
638
  get children () {
615
- var _el$8 = $29535f590238371c$var$_tmpl$7(), _el$9 = _el$8.firstChild, _el$11 = _el$9.nextSibling, _el$10 = _el$11.nextSibling;
616
- (0, $2MCgq$insert)(_el$8, hidden, _el$11);
617
- return _el$8;
639
+ var _el$11 = $29535f590238371c$var$_tmpl$9(), _el$12 = _el$11.firstChild, _el$14 = _el$12.nextSibling, _el$13 = _el$14.nextSibling;
640
+ (0, $2MCgq$insert)(_el$11, hidden, _el$14);
641
+ return _el$11;
618
642
  }
619
643
  }), null);
620
- (0, $2MCgq$effect)(()=>_el$7.classList.toggle("small", !!(widthAvailableForSizes_() < 250)));
621
- return _el$7;
644
+ (0, $2MCgq$effect)(()=>_el$10.classList.toggle("small", !!(widthAvailableForSizes_() < 250)));
645
+ return _el$10;
622
646
  }
623
647
  });
624
648
  }
@@ -666,10 +690,10 @@ function $29535f590238371c$var$ImagesAndVideos({ image_urls_: image_urls_, video
666
690
  },
667
691
  get fallback () {
668
692
  return (()=>{
669
- var _el$14 = $29535f590238371c$var$_tmpl$11();
670
- (0, $2MCgq$insert)(_el$14, resolved);
671
- (0, $2MCgq$effect)(()=>(0, $2MCgq$className)(_el$14, containerClasses().join(" ")));
672
- return _el$14;
693
+ var _el$17 = $29535f590238371c$var$_tmpl$13();
694
+ (0, $2MCgq$insert)(_el$17, resolved);
695
+ (0, $2MCgq$effect)(()=>(0, $2MCgq$className)(_el$17, containerClasses().join(" ")));
696
+ return _el$17;
673
697
  })();
674
698
  },
675
699
  get children () {
@@ -776,8 +800,8 @@ function $29535f590238371c$var$ImagesAndVideos({ image_urls_: image_urls_, video
776
800
  get children () {
777
801
  return (0, $2MCgq$createComponent)(MaybeShowLazily, {
778
802
  get children () {
779
- var _el$15 = $29535f590238371c$var$_tmpl$12();
780
- (0, $2MCgq$insert)(_el$15, (0, $2MCgq$createComponent)((0, $2MCgq$ImageContainer), {
803
+ var _el$18 = $29535f590238371c$var$_tmpl$14();
804
+ (0, $2MCgq$insert)(_el$18, (0, $2MCgq$createComponent)((0, $2MCgq$ImageContainer), {
781
805
  get aspectRatio () {
782
806
  return aspectRatio_();
783
807
  },
@@ -798,7 +822,7 @@ function $29535f590238371c$var$ImagesAndVideos({ image_urls_: image_urls_, video
798
822
  });
799
823
  }
800
824
  }));
801
- return _el$15;
825
+ return _el$18;
802
826
  }
803
827
  });
804
828
  }
@@ -819,8 +843,8 @@ function $29535f590238371c$var$ImagesAndVideos({ image_urls_: image_urls_, video
819
843
  get children () {
820
844
  return (0, $2MCgq$createComponent)(MaybeShowLazily, {
821
845
  get children () {
822
- var _el$16 = $29535f590238371c$var$_tmpl$13();
823
- (0, $2MCgq$insert)(_el$16, (0, $2MCgq$createComponent)((0, $2MCgq$ShopifyContainedImage), {
846
+ var _el$19 = $29535f590238371c$var$_tmpl$15();
847
+ (0, $2MCgq$insert)(_el$19, (0, $2MCgq$createComponent)((0, $2MCgq$ShopifyContainedImage), {
824
848
  src: image_url,
825
849
  get aspectRatio () {
826
850
  return aspectRatio_();
@@ -829,7 +853,7 @@ function $29535f590238371c$var$ImagesAndVideos({ image_urls_: image_urls_, video
829
853
  alt: "Product image"
830
854
  }
831
855
  }), null);
832
- (0, $2MCgq$insert)(_el$16, (0, $2MCgq$createComponent)((0, $2MCgq$Show), {
856
+ (0, $2MCgq$insert)(_el$19, (0, $2MCgq$createComponent)((0, $2MCgq$Show), {
833
857
  get when () {
834
858
  return (0, $2MCgq$memo)(()=>!!(!index() && image_urls_()?.[1]))() && !hoverImageDisabled();
835
859
  },
@@ -850,7 +874,7 @@ function $29535f590238371c$var$ImagesAndVideos({ image_urls_: image_urls_, video
850
874
  });
851
875
  }
852
876
  }), null);
853
- return _el$16;
877
+ return _el$19;
854
878
  }
855
879
  });
856
880
  }
@@ -881,46 +905,46 @@ function $29535f590238371c$var$Video(props) {
881
905
  const productCardIndexAccessor = (0, $2MCgq$useProductCardIndex)();
882
906
  const cardIsVisible = (0, $2MCgq$useProductCardIsVisible)();
883
907
  return (()=>{
884
- var _el$17 = $29535f590238371c$var$_tmpl$15();
908
+ var _el$20 = $29535f590238371c$var$_tmpl$17();
885
909
  (0, $2MCgq$use)((element)=>{
886
910
  element.disablePictureInPicture = true;
887
911
  (0, $2MCgq$createEffect)(()=>{
888
912
  if ((cardIsVisible() || props.forceIsVisible_) && tabIsVisible() && !props.swipedPastVideo_) element.play().catch((e)=>(0, $2MCgq$dwarn)("Error playing video", e));
889
913
  else element.pause();
890
914
  });
891
- }, _el$17);
892
- _el$17.controls = false;
893
- _el$17.playsInline = true;
894
- _el$17.loop = true;
895
- _el$17.muted = true;
896
- (0, $2MCgq$spread)(_el$17, (0, $2MCgq$mergeProps)({
915
+ }, _el$20);
916
+ _el$20.controls = false;
917
+ _el$20.playsInline = true;
918
+ _el$20.loop = true;
919
+ _el$20.muted = true;
920
+ (0, $2MCgq$spread)(_el$20, (0, $2MCgq$mergeProps)({
897
921
  get poster () {
898
922
  return props.poster_;
899
923
  }
900
924
  }, ()=>productCardIndexAccessor?.() < 8 && {
901
925
  preload: "auto"
902
926
  }), false, true);
903
- (0, $2MCgq$insert)(_el$17, (0, $2MCgq$createComponent)((0, $2MCgq$Show), {
927
+ (0, $2MCgq$insert)(_el$20, (0, $2MCgq$createComponent)((0, $2MCgq$Show), {
904
928
  get when () {
905
929
  return hlsSource();
906
930
  },
907
931
  get children () {
908
- var _el$18 = $29535f590238371c$var$_tmpl$14();
909
- (0, $2MCgq$effect)(()=>(0, $2MCgq$setAttribute)(_el$18, "src", hlsSource()));
910
- return _el$18;
932
+ var _el$21 = $29535f590238371c$var$_tmpl$16();
933
+ (0, $2MCgq$effect)(()=>(0, $2MCgq$setAttribute)(_el$21, "src", hlsSource()));
934
+ return _el$21;
911
935
  }
912
936
  }), null);
913
- (0, $2MCgq$insert)(_el$17, (0, $2MCgq$createComponent)((0, $2MCgq$For), {
937
+ (0, $2MCgq$insert)(_el$20, (0, $2MCgq$createComponent)((0, $2MCgq$For), {
914
938
  get each () {
915
939
  return nonHLSSources();
916
940
  },
917
941
  children: (source)=>(()=>{
918
- var _el$19 = $29535f590238371c$var$_tmpl$16();
919
- (0, $2MCgq$setAttribute)(_el$19, "src", source);
920
- return _el$19;
942
+ var _el$22 = $29535f590238371c$var$_tmpl$18();
943
+ (0, $2MCgq$setAttribute)(_el$22, "src", source);
944
+ return _el$22;
921
945
  })()
922
946
  }), null);
923
- return _el$17;
947
+ return _el$20;
924
948
  })();
925
949
  }
926
950
  // ChatGPT written
@@ -957,9 +981,9 @@ function $29535f590238371c$var$Prices({ formatPrice_: formatPrice_, configuredOp
957
981
  get children () {
958
982
  return [
959
983
  (()=>{
960
- var _el$20 = $29535f590238371c$var$_tmpl$17();
961
- (0, $2MCgq$use)((el)=>$29535f590238371c$var$setStyleForTextOptions(el, priceOptions), _el$20);
962
- (0, $2MCgq$insert)(_el$20, (0, $2MCgq$createComponent)((0, $2MCgq$Show), {
984
+ var _el$23 = $29535f590238371c$var$_tmpl$19();
985
+ (0, $2MCgq$use)((el)=>$29535f590238371c$var$setStyleForTextOptions(el, priceOptions), _el$23);
986
+ (0, $2MCgq$insert)(_el$23, (0, $2MCgq$createComponent)((0, $2MCgq$Show), {
963
987
  get when () {
964
988
  return variantToShow_();
965
989
  },
@@ -983,7 +1007,7 @@ function $29535f590238371c$var$Prices({ formatPrice_: formatPrice_, configuredOp
983
1007
  });
984
1008
  }
985
1009
  }));
986
- return _el$20;
1010
+ return _el$23;
987
1011
  })(),
988
1012
  (0, $2MCgq$createComponent)((0, $2MCgq$Suspense), {
989
1013
  get children () {
@@ -995,10 +1019,10 @@ function $29535f590238371c$var$Prices({ formatPrice_: formatPrice_, configuredOp
995
1019
  return [
996
1020
  " ",
997
1021
  (()=>{
998
- var _el$21 = $29535f590238371c$var$_tmpl$18();
999
- (0, $2MCgq$use)((el)=>$29535f590238371c$var$setStyleForTextOptions(el, originalPriceOptions), _el$21);
1000
- (0, $2MCgq$insert)(_el$21, ()=>formatPrice_?.(originalPrice_()));
1001
- return _el$21;
1022
+ var _el$24 = $29535f590238371c$var$_tmpl$20();
1023
+ (0, $2MCgq$use)((el)=>$29535f590238371c$var$setStyleForTextOptions(el, originalPriceOptions), _el$24);
1024
+ (0, $2MCgq$insert)(_el$24, ()=>formatPrice_?.(originalPrice_()));
1025
+ return _el$24;
1002
1026
  })()
1003
1027
  ];
1004
1028
  }
@@ -1080,11 +1104,11 @@ function $29535f590238371c$var$InComponentOrDiv(props) {
1080
1104
  children: resolved
1081
1105
  });
1082
1106
  return (()=>{
1083
- var _el$22 = $29535f590238371c$var$_tmpl$11();
1084
- (0, $2MCgq$use)((el)=>props?.ref_?.(el), _el$22);
1085
- (0, $2MCgq$insert)(_el$22, resolved);
1086
- (0, $2MCgq$effect)(()=>(0, $2MCgq$className)(_el$22, props.class_));
1087
- return _el$22;
1107
+ var _el$25 = $29535f590238371c$var$_tmpl$13();
1108
+ (0, $2MCgq$use)((el)=>props?.ref_?.(el), _el$25);
1109
+ (0, $2MCgq$insert)(_el$25, resolved);
1110
+ (0, $2MCgq$effect)(()=>(0, $2MCgq$className)(_el$25, props.class_));
1111
+ return _el$25;
1088
1112
  })();
1089
1113
  });
1090
1114
  }
@@ -1101,7 +1125,6 @@ function $474e9d712b745d60$export$d1a48be4967fe67c(react_props) {
1101
1125
  solid_component: (props_store)=>{
1102
1126
  return (0, $29535f590238371c$export$f11681c54c860912)(()=>props_store.display, {
1103
1127
  set_on_index_change: ()=>{},
1104
- depictCardsDataset: {},
1105
1128
  formatPrice: (price)=>price && (0, $2MCgq$standard_price_format)(price)
1106
1129
  }, ()=>({
1107
1130
  ...props_store?.options || $474e9d712b745d60$export$5c9921af2948d16a,
@@ -1168,7 +1191,6 @@ function $8ade1943efc108c6$export$ef681ece395f74(props) {
1168
1191
  product_card_template: (display, info)=>{
1169
1192
  return (0, $29535f590238371c$export$f11681c54c860912)(()=>display, info && {
1170
1193
  ...info,
1171
- depictCardsDataset: {},
1172
1194
  formatPrice: (price)=>price && (0, $2MCgq$standard_price_format)(price)
1173
1195
  }, ()=>props.productCardConfig || (0, $474e9d712b745d60$export$5c9921af2948d16a));
1174
1196
  },
@@ -1216,7 +1238,6 @@ function $e3716493302f533c$var$SolidWrapper(props) {
1216
1238
  product_card_template: (display, info)=>{
1217
1239
  return (0, $29535f590238371c$export$f11681c54c860912)(()=>display, info && {
1218
1240
  ...info,
1219
- depictCardsDataset: {},
1220
1241
  formatPrice: (price)=>price && (0, $2MCgq$standard_price_format)(price)
1221
1242
  }, ()=>props.productCardConfig || (0, $474e9d712b745d60$export$5c9921af2948d16a));
1222
1243
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/portal-components",
3
- "version": "2.7.35",
3
+ "version": "2.7.37",
4
4
  "packageManager": "yarn@3.2.2",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/main.js",
@@ -102,7 +102,7 @@
102
102
  "dependencies": {
103
103
  "@babel/runtime": "latest",
104
104
  "@babel/runtime-corejs3": "^7.22.6",
105
- "@depict-ai/plp-styling": "^4.4.21",
105
+ "@depict-ai/plp-styling": "^4.4.24",
106
106
  "@depict-ai/react-ui": "^4.8.7",
107
107
  "@depict-ai/types": "^5.4.5",
108
108
  "@depict-ai/ui": "^4.8.30",
@@ -128,8 +128,6 @@ export function DefaultSolidProductCard(
128
128
  info:
129
129
  | undefined
130
130
  | (SDKRenderingInfo & {
131
- // depictCardsDataset is the dataset of the #depict-cards HTML element. It is empty in the development environment.
132
- depictCardsDataset?: Record<string, string>;
133
131
  // formatPrice takes a price as number (`price` is NOT in cents but the actual price, as returned from Depict) and returns a formatted string. It will use the same currency formatting that the shopify store is configured to use.
134
132
  // In development (product card editor), a fallback formatting will be used.
135
133
  formatPrice: <T extends number | undefined>(price: T) => T extends undefined ? undefined : string;
@@ -270,7 +268,7 @@ export function DefaultSolidProductCard(
270
268
  const element = (
271
269
  <ContainsColorSwatchesProvider>
272
270
  <div
273
- class={`d-product-card`}
271
+ class="d-product-card"
274
272
  style={mainStyle()}
275
273
  onMouseEnter={catchify(() => !noHoverSupport_() && setCardIsHovered(true))}
276
274
  onMouseLeave={catchify(() => !noHoverSupport_() && setCardIsHovered(false))}
@@ -287,7 +285,21 @@ export function DefaultSolidProductCard(
287
285
  forceIsVisible_={() => configuredOptions_().forceIsVisible_}
288
286
  />
289
287
  </LinkWrapped>
290
-
288
+ <Suspense>
289
+ <Show when={configuredOptions_().smart_labels.enabled}>
290
+ <div class="d-badges">
291
+ {/* Other badges can be added here */}
292
+ <Show when={salePrice() && originalPrice() && salePrice() !== originalPrice()}>
293
+ <div
294
+ class="d-badge d-off"
295
+ ref={el => setStyleForTextOptions(el, () => configuredOptions_().smart_labels)}
296
+ >
297
+ {Math.round((1 - salePrice()! / originalPrice()!) * -100)}%
298
+ </div>
299
+ </Show>
300
+ </div>
301
+ </Show>
302
+ </Suspense>
291
303
  {(() => {
292
304
  // We want the whole product card to be a link, except for the color swatches
293
305
  const [containsColorSwatches] = useContainsColorSwatches();