@depict-ai/portal-components 2.7.34 → 2.7.36
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 +1 -1
- package/dist/main.js +113 -82
- package/dist/module.js +115 -84
- package/package.json +5 -4
- package/src/specialForShopify/DefaultSolidProductCard.tsx +29 -5
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.
|
|
7
|
+
export const version = "2.7.36";
|
|
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.
|
|
23
|
+
const $0a017be3a74fcc94$export$83d89fbfd8236492 = "2.7.36";
|
|
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$
|
|
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 = [
|
|
@@ -95,8 +95,7 @@ const $3375ddd88f77967d$var$sizeOrder = [
|
|
|
95
95
|
];
|
|
96
96
|
const $3375ddd88f77967d$var$ContainsColorSwatchesContext = /*@__PURE__*/ (0, $7jsgb$solidjs.createContext)();
|
|
97
97
|
let $3375ddd88f77967d$var$colorCanvasContext;
|
|
98
|
-
function $3375ddd88f77967d$export$f11681c54c860912(display, info, configuredOptions_,
|
|
99
|
-
overrideAspectRatio) {
|
|
98
|
+
function $3375ddd88f77967d$export$f11681c54c860912(display, info, configuredOptions_, overrideAspectRatio) {
|
|
100
99
|
const variantDisplays = (0, $7jsgb$solidjs.createMemo)(()=>display()?.variant_displays);
|
|
101
100
|
const defaultVariantIndex = (0, $7jsgb$solidjs.createMemo)(()=>display()?.variant_index);
|
|
102
101
|
const [showVariantIndex, setShowVariantIndex] = (0, $7jsgb$solidjs.createSignal)((0, $7jsgb$solidjs.untrack)(defaultVariantIndex));
|
|
@@ -205,9 +204,18 @@ overrideAspectRatio) {
|
|
|
205
204
|
(0, $7jsgb$solidjs.createEffect)(()=>!showVariantIndex() && defaultVariantIndex() != undefined && setShowVariantIndex(defaultVariantIndex()));
|
|
206
205
|
const element = (0, $7jsgb$solidjsweb.createComponent)($3375ddd88f77967d$var$ContainsColorSwatchesProvider, {
|
|
207
206
|
get children () {
|
|
208
|
-
var _el$3 = $3375ddd88f77967d$var$_tmpl$
|
|
209
|
-
(0, $7jsgb$solidjsweb.
|
|
210
|
-
|
|
207
|
+
var _el$3 = $3375ddd88f77967d$var$_tmpl$5();
|
|
208
|
+
(0, $7jsgb$solidjsweb.spread)(_el$3, (0, $7jsgb$solidjsweb.mergeProps)({
|
|
209
|
+
get style () {
|
|
210
|
+
return mainStyle();
|
|
211
|
+
},
|
|
212
|
+
get onMouseEnter () {
|
|
213
|
+
return (0, $7jsgb$depictaiutilisharedlatest.catchify)(()=>!noHoverSupport_() && setCardIsHovered(true));
|
|
214
|
+
},
|
|
215
|
+
get onMouseLeave () {
|
|
216
|
+
return (0, $7jsgb$depictaiutilisharedlatest.catchify)(()=>!noHoverSupport_() && setCardIsHovered(false));
|
|
217
|
+
}
|
|
218
|
+
}, ()=>configuredOptions_().overrideMainAttributes_), false, true);
|
|
211
219
|
(0, $7jsgb$solidjsweb.insert)(_el$3, (0, $7jsgb$solidjsweb.createComponent)(LinkWrapped, {
|
|
212
220
|
"class": "upper",
|
|
213
221
|
focusable_: true,
|
|
@@ -223,6 +231,30 @@ overrideAspectRatio) {
|
|
|
223
231
|
});
|
|
224
232
|
}
|
|
225
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;
|
|
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);
|
|
226
258
|
(0, $7jsgb$solidjsweb.insert)(_el$3, ()=>{
|
|
227
259
|
// We want the whole product card to be a link, except for the color swatches
|
|
228
260
|
const [containsColorSwatches] = $3375ddd88f77967d$var$useContainsColorSwatches();
|
|
@@ -373,7 +405,6 @@ overrideAspectRatio) {
|
|
|
373
405
|
}
|
|
374
406
|
});
|
|
375
407
|
}, null);
|
|
376
|
-
(0, $7jsgb$solidjsweb.effect)((_$p)=>(0, $7jsgb$solidjsweb.style)(_el$3, mainStyle(), _$p));
|
|
377
408
|
return _el$3;
|
|
378
409
|
}
|
|
379
410
|
});
|
|
@@ -501,13 +532,13 @@ function $3375ddd88f77967d$var$ColorSwatches({ colorMap_: colorMap_, setShowVari
|
|
|
501
532
|
setContainsColorSwatches(true);
|
|
502
533
|
(0, $7jsgb$solidjs.onCleanup)(()=>setContainsColorSwatches(false));
|
|
503
534
|
return (()=>{
|
|
504
|
-
var _el$
|
|
535
|
+
var _el$7 = $3375ddd88f77967d$var$_tmpl$7();
|
|
505
536
|
(0, $7jsgb$solidjsweb.use)((el)=>{
|
|
506
537
|
ref_?.(el);
|
|
507
538
|
// Do like this so we don't override other styles set by AnimateRowSwitch
|
|
508
539
|
(0, $7jsgb$solidjs.createEffect)(()=>$3375ddd88f77967d$var$setPropertyIfExists(el.style, "--swatch-container-height", wantedContainerHeightRem_() && wantedContainerHeightRem_() + "rem"));
|
|
509
|
-
}, _el$
|
|
510
|
-
(0, $7jsgb$solidjsweb.insert)(_el$
|
|
540
|
+
}, _el$7);
|
|
541
|
+
(0, $7jsgb$solidjsweb.insert)(_el$7, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.For), {
|
|
511
542
|
get each () {
|
|
512
543
|
return entriesToShow();
|
|
513
544
|
},
|
|
@@ -517,28 +548,28 @@ function $3375ddd88f77967d$var$ColorSwatches({ colorMap_: colorMap_, setShowVari
|
|
|
517
548
|
// We need a default fallback for it being usable
|
|
518
549
|
const [invalidColor, setInvalidColor] = (0, $7jsgb$solidjs.createSignal)(false);
|
|
519
550
|
return (()=>{
|
|
520
|
-
var _el$
|
|
551
|
+
var _el$9 = $3375ddd88f77967d$var$_tmpl$8();
|
|
521
552
|
(0, $7jsgb$solidjsweb.use)((element)=>requestAnimationFrame(// After one frame we're usually in the DOM, if we're not boxShadow is ""
|
|
522
553
|
// If it's none, the color was invalid - so just show this swatch as a white swatch which is the prettiest
|
|
523
|
-
(0, $7jsgb$depictaiutilisharedlatest.catchify)(()=>getComputedStyle(element).boxShadow === "none" && setInvalidColor(true))), _el$
|
|
524
|
-
(0, $7jsgb$solidjsweb.addEventListener)(_el$
|
|
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)=>{
|
|
525
556
|
clearTimeout(unHoverDebouncedTimeout);
|
|
526
557
|
unHoverDebouncedTimeout = setTimeout((0, $7jsgb$depictaiutilisharedlatest.catchify)(()=>setShowVariantIndex_(defaultVariantIndex_())), 500);
|
|
527
558
|
}));
|
|
528
|
-
(0, $7jsgb$solidjsweb.addEventListener)(_el$
|
|
559
|
+
(0, $7jsgb$solidjsweb.addEventListener)(_el$9, "pointerenter", (0, $7jsgb$depictaiutilisharedlatest.catchify)((e)=>{
|
|
529
560
|
clearTimeout(unHoverDebouncedTimeout);
|
|
530
561
|
setShowVariantIndex_(thisColorIsDefaultColor() ? defaultVariantIndex_() : variantIndex_);
|
|
531
562
|
}));
|
|
532
|
-
(0, $7jsgb$solidjsweb.setAttribute)(_el$
|
|
533
|
-
(0, $7jsgb$solidjsweb.setAttribute)(_el$
|
|
563
|
+
(0, $7jsgb$solidjsweb.setAttribute)(_el$9, "href", pageUrl_);
|
|
564
|
+
(0, $7jsgb$solidjsweb.setAttribute)(_el$9, "title", colorName);
|
|
534
565
|
(0, $7jsgb$solidjsweb.effect)((_p$)=>{
|
|
535
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());
|
|
536
|
-
_v$5 !== _p$.e && (0, $7jsgb$solidjsweb.setAttribute)(_el$
|
|
537
|
-
_v$6 !== _p$.t && (0, $7jsgb$solidjsweb.setAttribute)(_el$
|
|
538
|
-
_p$.a = (0, $7jsgb$solidjsweb.style)(_el$
|
|
539
|
-
_v$8 !== _p$.o && _el$
|
|
540
|
-
_v$9 !== _p$.i && _el$
|
|
541
|
-
_v$10 !== _p$.n && _el$
|
|
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);
|
|
542
573
|
return _p$;
|
|
543
574
|
}, {
|
|
544
575
|
e: undefined,
|
|
@@ -548,19 +579,19 @@ function $3375ddd88f77967d$var$ColorSwatches({ colorMap_: colorMap_, setShowVari
|
|
|
548
579
|
i: undefined,
|
|
549
580
|
n: undefined
|
|
550
581
|
});
|
|
551
|
-
return _el$
|
|
582
|
+
return _el$9;
|
|
552
583
|
})();
|
|
553
584
|
}
|
|
554
585
|
}), null);
|
|
555
|
-
(0, $7jsgb$solidjsweb.insert)(_el$
|
|
586
|
+
(0, $7jsgb$solidjsweb.insert)(_el$7, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.Show), {
|
|
556
587
|
get when () {
|
|
557
588
|
return entriesToShow().length !== colorMap_().size;
|
|
558
589
|
},
|
|
559
590
|
get children () {
|
|
560
|
-
return $3375ddd88f77967d$var$_tmpl$
|
|
591
|
+
return $3375ddd88f77967d$var$_tmpl$6();
|
|
561
592
|
}
|
|
562
593
|
}), null);
|
|
563
|
-
return _el$
|
|
594
|
+
return _el$7;
|
|
564
595
|
})();
|
|
565
596
|
})();
|
|
566
597
|
}
|
|
@@ -584,14 +615,14 @@ function $3375ddd88f77967d$var$Sizes({ sizesInStock_: sizesInStock_, ref_: ref_,
|
|
|
584
615
|
return keysToShow().length > 1;
|
|
585
616
|
},
|
|
586
617
|
get children () {
|
|
587
|
-
var _el$
|
|
618
|
+
var _el$10 = $3375ddd88f77967d$var$_tmpl$10();
|
|
588
619
|
(0, $7jsgb$solidjsweb.use)((el)=>{
|
|
589
620
|
ref_?.(el);
|
|
590
621
|
// Do like this so we don't override other styles set by AnimateRowSwitch
|
|
591
622
|
(0, $7jsgb$solidjs.createEffect)(()=>el.style.setProperty("--font-size-rem", fontSizeRem_() + "rem"));
|
|
592
623
|
(0, $7jsgb$solidjs.createEffect)(()=>el.style.setProperty("--sizes-gap", gap() + "px"));
|
|
593
|
-
}, _el$
|
|
594
|
-
(0, $7jsgb$solidjsweb.insert)(_el$
|
|
624
|
+
}, _el$10);
|
|
625
|
+
(0, $7jsgb$solidjsweb.insert)(_el$10, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.For), {
|
|
595
626
|
get each () {
|
|
596
627
|
return $3375ddd88f77967d$var$sortSizes(keysToShow());
|
|
597
628
|
},
|
|
@@ -601,30 +632,30 @@ function $3375ddd88f77967d$var$Sizes({ sizesInStock_: sizesInStock_, ref_: ref_,
|
|
|
601
632
|
},
|
|
602
633
|
get fallback () {
|
|
603
634
|
return (()=>{
|
|
604
|
-
var _el$
|
|
605
|
-
(0, $7jsgb$solidjsweb.insert)(_el$
|
|
606
|
-
return _el$
|
|
635
|
+
var _el$16 = $3375ddd88f77967d$var$_tmpl$12();
|
|
636
|
+
(0, $7jsgb$solidjsweb.insert)(_el$16, size);
|
|
637
|
+
return _el$16;
|
|
607
638
|
})();
|
|
608
639
|
},
|
|
609
640
|
get children () {
|
|
610
|
-
var _el$
|
|
611
|
-
(0, $7jsgb$solidjsweb.insert)(_el$
|
|
612
|
-
return _el$
|
|
641
|
+
var _el$15 = $3375ddd88f77967d$var$_tmpl$11();
|
|
642
|
+
(0, $7jsgb$solidjsweb.insert)(_el$15, size);
|
|
643
|
+
return _el$15;
|
|
613
644
|
}
|
|
614
645
|
})
|
|
615
646
|
}), null);
|
|
616
|
-
(0, $7jsgb$solidjsweb.insert)(_el$
|
|
647
|
+
(0, $7jsgb$solidjsweb.insert)(_el$10, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.Show), {
|
|
617
648
|
get when () {
|
|
618
649
|
return hidden() > 0;
|
|
619
650
|
},
|
|
620
651
|
get children () {
|
|
621
|
-
var _el$
|
|
622
|
-
(0, $7jsgb$solidjsweb.insert)(_el$
|
|
623
|
-
return _el$
|
|
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;
|
|
624
655
|
}
|
|
625
656
|
}), null);
|
|
626
|
-
(0, $7jsgb$solidjsweb.effect)(()=>_el$
|
|
627
|
-
return _el$
|
|
657
|
+
(0, $7jsgb$solidjsweb.effect)(()=>_el$10.classList.toggle("small", !!(widthAvailableForSizes_() < 250)));
|
|
658
|
+
return _el$10;
|
|
628
659
|
}
|
|
629
660
|
});
|
|
630
661
|
}
|
|
@@ -672,10 +703,10 @@ function $3375ddd88f77967d$var$ImagesAndVideos({ image_urls_: image_urls_, video
|
|
|
672
703
|
},
|
|
673
704
|
get fallback () {
|
|
674
705
|
return (()=>{
|
|
675
|
-
var _el$
|
|
676
|
-
(0, $7jsgb$solidjsweb.insert)(_el$
|
|
677
|
-
(0, $7jsgb$solidjsweb.effect)(()=>(0, $7jsgb$solidjsweb.className)(_el$
|
|
678
|
-
return _el$
|
|
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;
|
|
679
710
|
})();
|
|
680
711
|
},
|
|
681
712
|
get children () {
|
|
@@ -782,8 +813,8 @@ function $3375ddd88f77967d$var$ImagesAndVideos({ image_urls_: image_urls_, video
|
|
|
782
813
|
get children () {
|
|
783
814
|
return (0, $7jsgb$solidjsweb.createComponent)(MaybeShowLazily, {
|
|
784
815
|
get children () {
|
|
785
|
-
var _el$
|
|
786
|
-
(0, $7jsgb$solidjsweb.insert)(_el$
|
|
816
|
+
var _el$18 = $3375ddd88f77967d$var$_tmpl$14();
|
|
817
|
+
(0, $7jsgb$solidjsweb.insert)(_el$18, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$depictaiuilatest.ImageContainer), {
|
|
787
818
|
get aspectRatio () {
|
|
788
819
|
return aspectRatio_();
|
|
789
820
|
},
|
|
@@ -804,7 +835,7 @@ function $3375ddd88f77967d$var$ImagesAndVideos({ image_urls_: image_urls_, video
|
|
|
804
835
|
});
|
|
805
836
|
}
|
|
806
837
|
}));
|
|
807
|
-
return _el$
|
|
838
|
+
return _el$18;
|
|
808
839
|
}
|
|
809
840
|
});
|
|
810
841
|
}
|
|
@@ -825,8 +856,8 @@ function $3375ddd88f77967d$var$ImagesAndVideos({ image_urls_: image_urls_, video
|
|
|
825
856
|
get children () {
|
|
826
857
|
return (0, $7jsgb$solidjsweb.createComponent)(MaybeShowLazily, {
|
|
827
858
|
get children () {
|
|
828
|
-
var _el$
|
|
829
|
-
(0, $7jsgb$solidjsweb.insert)(_el$
|
|
859
|
+
var _el$19 = $3375ddd88f77967d$var$_tmpl$15();
|
|
860
|
+
(0, $7jsgb$solidjsweb.insert)(_el$19, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$depictaiuilatest.ShopifyContainedImage), {
|
|
830
861
|
src: image_url,
|
|
831
862
|
get aspectRatio () {
|
|
832
863
|
return aspectRatio_();
|
|
@@ -835,7 +866,7 @@ function $3375ddd88f77967d$var$ImagesAndVideos({ image_urls_: image_urls_, video
|
|
|
835
866
|
alt: "Product image"
|
|
836
867
|
}
|
|
837
868
|
}), null);
|
|
838
|
-
(0, $7jsgb$solidjsweb.insert)(_el$
|
|
869
|
+
(0, $7jsgb$solidjsweb.insert)(_el$19, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.Show), {
|
|
839
870
|
get when () {
|
|
840
871
|
return (0, $7jsgb$solidjsweb.memo)(()=>!!(!index() && image_urls_()?.[1]))() && !hoverImageDisabled();
|
|
841
872
|
},
|
|
@@ -856,7 +887,7 @@ function $3375ddd88f77967d$var$ImagesAndVideos({ image_urls_: image_urls_, video
|
|
|
856
887
|
});
|
|
857
888
|
}
|
|
858
889
|
}), null);
|
|
859
|
-
return _el$
|
|
890
|
+
return _el$19;
|
|
860
891
|
}
|
|
861
892
|
});
|
|
862
893
|
}
|
|
@@ -887,46 +918,46 @@ function $3375ddd88f77967d$var$Video(props) {
|
|
|
887
918
|
const productCardIndexAccessor = (0, $7jsgb$depictaiuilatest.useProductCardIndex)();
|
|
888
919
|
const cardIsVisible = (0, $7jsgb$depictaiuilatest.useProductCardIsVisible)();
|
|
889
920
|
return (()=>{
|
|
890
|
-
var _el$
|
|
921
|
+
var _el$20 = $3375ddd88f77967d$var$_tmpl$17();
|
|
891
922
|
(0, $7jsgb$solidjsweb.use)((element)=>{
|
|
892
923
|
element.disablePictureInPicture = true;
|
|
893
924
|
(0, $7jsgb$solidjs.createEffect)(()=>{
|
|
894
925
|
if ((cardIsVisible() || props.forceIsVisible_) && tabIsVisible() && !props.swipedPastVideo_) element.play().catch((e)=>(0, $7jsgb$depictaiutilisharedlatest.dwarn)("Error playing video", e));
|
|
895
926
|
else element.pause();
|
|
896
927
|
});
|
|
897
|
-
}, _el$
|
|
898
|
-
_el$
|
|
899
|
-
_el$
|
|
900
|
-
_el$
|
|
901
|
-
_el$
|
|
902
|
-
(0, $7jsgb$solidjsweb.spread)(_el$
|
|
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)({
|
|
903
934
|
get poster () {
|
|
904
935
|
return props.poster_;
|
|
905
936
|
}
|
|
906
937
|
}, ()=>productCardIndexAccessor?.() < 8 && {
|
|
907
938
|
preload: "auto"
|
|
908
939
|
}), false, true);
|
|
909
|
-
(0, $7jsgb$solidjsweb.insert)(_el$
|
|
940
|
+
(0, $7jsgb$solidjsweb.insert)(_el$20, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.Show), {
|
|
910
941
|
get when () {
|
|
911
942
|
return hlsSource();
|
|
912
943
|
},
|
|
913
944
|
get children () {
|
|
914
|
-
var _el$
|
|
915
|
-
(0, $7jsgb$solidjsweb.effect)(()=>(0, $7jsgb$solidjsweb.setAttribute)(_el$
|
|
916
|
-
return _el$
|
|
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;
|
|
917
948
|
}
|
|
918
949
|
}), null);
|
|
919
|
-
(0, $7jsgb$solidjsweb.insert)(_el$
|
|
950
|
+
(0, $7jsgb$solidjsweb.insert)(_el$20, (0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.For), {
|
|
920
951
|
get each () {
|
|
921
952
|
return nonHLSSources();
|
|
922
953
|
},
|
|
923
954
|
children: (source)=>(()=>{
|
|
924
|
-
var _el$
|
|
925
|
-
(0, $7jsgb$solidjsweb.setAttribute)(_el$
|
|
926
|
-
return _el$
|
|
955
|
+
var _el$22 = $3375ddd88f77967d$var$_tmpl$18();
|
|
956
|
+
(0, $7jsgb$solidjsweb.setAttribute)(_el$22, "src", source);
|
|
957
|
+
return _el$22;
|
|
927
958
|
})()
|
|
928
959
|
}), null);
|
|
929
|
-
return _el$
|
|
960
|
+
return _el$20;
|
|
930
961
|
})();
|
|
931
962
|
}
|
|
932
963
|
// ChatGPT written
|
|
@@ -963,9 +994,9 @@ function $3375ddd88f77967d$var$Prices({ formatPrice_: formatPrice_, configuredOp
|
|
|
963
994
|
get children () {
|
|
964
995
|
return [
|
|
965
996
|
(()=>{
|
|
966
|
-
var _el$
|
|
967
|
-
(0, $7jsgb$solidjsweb.use)((el)=>$3375ddd88f77967d$var$setStyleForTextOptions(el, priceOptions), _el$
|
|
968
|
-
(0, $7jsgb$solidjsweb.insert)(_el$
|
|
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), {
|
|
969
1000
|
get when () {
|
|
970
1001
|
return variantToShow_();
|
|
971
1002
|
},
|
|
@@ -989,7 +1020,7 @@ function $3375ddd88f77967d$var$Prices({ formatPrice_: formatPrice_, configuredOp
|
|
|
989
1020
|
});
|
|
990
1021
|
}
|
|
991
1022
|
}));
|
|
992
|
-
return _el$
|
|
1023
|
+
return _el$23;
|
|
993
1024
|
})(),
|
|
994
1025
|
(0, $7jsgb$solidjsweb.createComponent)((0, $7jsgb$solidjs.Suspense), {
|
|
995
1026
|
get children () {
|
|
@@ -1001,10 +1032,10 @@ function $3375ddd88f77967d$var$Prices({ formatPrice_: formatPrice_, configuredOp
|
|
|
1001
1032
|
return [
|
|
1002
1033
|
" ",
|
|
1003
1034
|
(()=>{
|
|
1004
|
-
var _el$
|
|
1005
|
-
(0, $7jsgb$solidjsweb.use)((el)=>$3375ddd88f77967d$var$setStyleForTextOptions(el, originalPriceOptions), _el$
|
|
1006
|
-
(0, $7jsgb$solidjsweb.insert)(_el$
|
|
1007
|
-
return _el$
|
|
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;
|
|
1008
1039
|
})()
|
|
1009
1040
|
];
|
|
1010
1041
|
}
|
|
@@ -1086,11 +1117,11 @@ function $3375ddd88f77967d$var$InComponentOrDiv(props) {
|
|
|
1086
1117
|
children: resolved
|
|
1087
1118
|
});
|
|
1088
1119
|
return (()=>{
|
|
1089
|
-
var _el$
|
|
1090
|
-
(0, $7jsgb$solidjsweb.use)((el)=>props?.ref_?.(el), _el$
|
|
1091
|
-
(0, $7jsgb$solidjsweb.insert)(_el$
|
|
1092
|
-
(0, $7jsgb$solidjsweb.effect)(()=>(0, $7jsgb$solidjsweb.className)(_el$
|
|
1093
|
-
return _el$
|
|
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;
|
|
1094
1125
|
})();
|
|
1095
1126
|
});
|
|
1096
1127
|
}
|
package/dist/module.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {add_to_version_info as $2MCgq$add_to_version_info, standard_price_format as $2MCgq$standard_price_format, catchify as $2MCgq$catchify, dlog as $2MCgq$dlog, dwarn as $2MCgq$dwarn} from "@depict-ai/utilishared/latest";
|
|
2
2
|
import {RecommendationGrid as $2MCgq$RecommendationGrid, defaultColsAtSize as $2MCgq$defaultColsAtSize, defaultGridSpacing as $2MCgq$defaultGridSpacing, media_query_to_accessor as $2MCgq$media_query_to_accessor, TextPlaceholder as $2MCgq$TextPlaceholder, useListing as $2MCgq$useListing, shopifyContainedImageContextSymbol as $2MCgq$shopifyContainedImageContextSymbol, usePLPLayout as $2MCgq$usePLPLayout, useProductCardIsVisible as $2MCgq$useProductCardIsVisible, useSlidableInformation as $2MCgq$useSlidableInformation, SlidableItems as $2MCgq$SlidableItems, ImagePlaceholder as $2MCgq$ImagePlaceholder, ImageContainer as $2MCgq$ImageContainer, ShopifyContainedImage as $2MCgq$ShopifyContainedImage, useVisibilityState as $2MCgq$useVisibilityState, useProductCardIndex as $2MCgq$useProductCardIndex, RecommendationSlider as $2MCgq$RecommendationSlider, accessor_of_object_to_object_with_accessor_values as $2MCgq$accessor_of_object_to_object_with_accessor_values, create_modified_filters as $2MCgq$create_modified_filters, SelectedFilters as $2MCgq$SelectedFilters, FilterBody as $2MCgq$FilterBody, ExpandingDetails as $2MCgq$ExpandingDetails, ListingProvider as $2MCgq$ListingProvider, PseudoRouter as $2MCgq$PseudoRouter, LookCard as $2MCgq$LookCard} from "@depict-ai/ui/latest";
|
|
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,
|
|
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,
|
|
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.
|
|
10
|
+
const $91c11b750e80ede3$export$83d89fbfd8236492 = "2.7.36";
|
|
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$
|
|
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 = [
|
|
@@ -82,8 +82,7 @@ const $29535f590238371c$var$sizeOrder = [
|
|
|
82
82
|
];
|
|
83
83
|
const $29535f590238371c$var$ContainsColorSwatchesContext = /*@__PURE__*/ (0, $2MCgq$createContext)();
|
|
84
84
|
let $29535f590238371c$var$colorCanvasContext;
|
|
85
|
-
function $29535f590238371c$export$f11681c54c860912(display, info, configuredOptions_,
|
|
86
|
-
overrideAspectRatio) {
|
|
85
|
+
function $29535f590238371c$export$f11681c54c860912(display, info, configuredOptions_, overrideAspectRatio) {
|
|
87
86
|
const variantDisplays = (0, $2MCgq$createMemo)(()=>display()?.variant_displays);
|
|
88
87
|
const defaultVariantIndex = (0, $2MCgq$createMemo)(()=>display()?.variant_index);
|
|
89
88
|
const [showVariantIndex, setShowVariantIndex] = (0, $2MCgq$createSignal)((0, $2MCgq$untrack)(defaultVariantIndex));
|
|
@@ -192,9 +191,18 @@ overrideAspectRatio) {
|
|
|
192
191
|
(0, $2MCgq$createEffect)(()=>!showVariantIndex() && defaultVariantIndex() != undefined && setShowVariantIndex(defaultVariantIndex()));
|
|
193
192
|
const element = (0, $2MCgq$createComponent)($29535f590238371c$var$ContainsColorSwatchesProvider, {
|
|
194
193
|
get children () {
|
|
195
|
-
var _el$3 = $29535f590238371c$var$_tmpl$
|
|
196
|
-
(0, $2MCgq$
|
|
197
|
-
|
|
194
|
+
var _el$3 = $29535f590238371c$var$_tmpl$5();
|
|
195
|
+
(0, $2MCgq$spread)(_el$3, (0, $2MCgq$mergeProps)({
|
|
196
|
+
get style () {
|
|
197
|
+
return mainStyle();
|
|
198
|
+
},
|
|
199
|
+
get onMouseEnter () {
|
|
200
|
+
return (0, $2MCgq$catchify)(()=>!noHoverSupport_() && setCardIsHovered(true));
|
|
201
|
+
},
|
|
202
|
+
get onMouseLeave () {
|
|
203
|
+
return (0, $2MCgq$catchify)(()=>!noHoverSupport_() && setCardIsHovered(false));
|
|
204
|
+
}
|
|
205
|
+
}, ()=>configuredOptions_().overrideMainAttributes_), false, true);
|
|
198
206
|
(0, $2MCgq$insert)(_el$3, (0, $2MCgq$createComponent)(LinkWrapped, {
|
|
199
207
|
"class": "upper",
|
|
200
208
|
focusable_: true,
|
|
@@ -210,6 +218,30 @@ overrideAspectRatio) {
|
|
|
210
218
|
});
|
|
211
219
|
}
|
|
212
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;
|
|
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);
|
|
213
245
|
(0, $2MCgq$insert)(_el$3, ()=>{
|
|
214
246
|
// We want the whole product card to be a link, except for the color swatches
|
|
215
247
|
const [containsColorSwatches] = $29535f590238371c$var$useContainsColorSwatches();
|
|
@@ -360,7 +392,6 @@ overrideAspectRatio) {
|
|
|
360
392
|
}
|
|
361
393
|
});
|
|
362
394
|
}, null);
|
|
363
|
-
(0, $2MCgq$effect)((_$p)=>(0, $2MCgq$style)(_el$3, mainStyle(), _$p));
|
|
364
395
|
return _el$3;
|
|
365
396
|
}
|
|
366
397
|
});
|
|
@@ -488,13 +519,13 @@ function $29535f590238371c$var$ColorSwatches({ colorMap_: colorMap_, setShowVari
|
|
|
488
519
|
setContainsColorSwatches(true);
|
|
489
520
|
(0, $2MCgq$onCleanup)(()=>setContainsColorSwatches(false));
|
|
490
521
|
return (()=>{
|
|
491
|
-
var _el$
|
|
522
|
+
var _el$7 = $29535f590238371c$var$_tmpl$7();
|
|
492
523
|
(0, $2MCgq$use)((el)=>{
|
|
493
524
|
ref_?.(el);
|
|
494
525
|
// Do like this so we don't override other styles set by AnimateRowSwitch
|
|
495
526
|
(0, $2MCgq$createEffect)(()=>$29535f590238371c$var$setPropertyIfExists(el.style, "--swatch-container-height", wantedContainerHeightRem_() && wantedContainerHeightRem_() + "rem"));
|
|
496
|
-
}, _el$
|
|
497
|
-
(0, $2MCgq$insert)(_el$
|
|
527
|
+
}, _el$7);
|
|
528
|
+
(0, $2MCgq$insert)(_el$7, (0, $2MCgq$createComponent)((0, $2MCgq$For), {
|
|
498
529
|
get each () {
|
|
499
530
|
return entriesToShow();
|
|
500
531
|
},
|
|
@@ -504,28 +535,28 @@ function $29535f590238371c$var$ColorSwatches({ colorMap_: colorMap_, setShowVari
|
|
|
504
535
|
// We need a default fallback for it being usable
|
|
505
536
|
const [invalidColor, setInvalidColor] = (0, $2MCgq$createSignal)(false);
|
|
506
537
|
return (()=>{
|
|
507
|
-
var _el$
|
|
538
|
+
var _el$9 = $29535f590238371c$var$_tmpl$8();
|
|
508
539
|
(0, $2MCgq$use)((element)=>requestAnimationFrame(// After one frame we're usually in the DOM, if we're not boxShadow is ""
|
|
509
540
|
// If it's none, the color was invalid - so just show this swatch as a white swatch which is the prettiest
|
|
510
|
-
(0, $2MCgq$catchify)(()=>getComputedStyle(element).boxShadow === "none" && setInvalidColor(true))), _el$
|
|
511
|
-
(0, $2MCgq$addEventListener)(_el$
|
|
541
|
+
(0, $2MCgq$catchify)(()=>getComputedStyle(element).boxShadow === "none" && setInvalidColor(true))), _el$9);
|
|
542
|
+
(0, $2MCgq$addEventListener)(_el$9, "pointerleave", (0, $2MCgq$catchify)((e)=>{
|
|
512
543
|
clearTimeout(unHoverDebouncedTimeout);
|
|
513
544
|
unHoverDebouncedTimeout = setTimeout((0, $2MCgq$catchify)(()=>setShowVariantIndex_(defaultVariantIndex_())), 500);
|
|
514
545
|
}));
|
|
515
|
-
(0, $2MCgq$addEventListener)(_el$
|
|
546
|
+
(0, $2MCgq$addEventListener)(_el$9, "pointerenter", (0, $2MCgq$catchify)((e)=>{
|
|
516
547
|
clearTimeout(unHoverDebouncedTimeout);
|
|
517
548
|
setShowVariantIndex_(thisColorIsDefaultColor() ? defaultVariantIndex_() : variantIndex_);
|
|
518
549
|
}));
|
|
519
|
-
(0, $2MCgq$setAttribute)(_el$
|
|
520
|
-
(0, $2MCgq$setAttribute)(_el$
|
|
550
|
+
(0, $2MCgq$setAttribute)(_el$9, "href", pageUrl_);
|
|
551
|
+
(0, $2MCgq$setAttribute)(_el$9, "title", colorName);
|
|
521
552
|
(0, $2MCgq$effect)((_p$)=>{
|
|
522
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());
|
|
523
|
-
_v$5 !== _p$.e && (0, $2MCgq$setAttribute)(_el$
|
|
524
|
-
_v$6 !== _p$.t && (0, $2MCgq$setAttribute)(_el$
|
|
525
|
-
_p$.a = (0, $2MCgq$style)(_el$
|
|
526
|
-
_v$8 !== _p$.o && _el$
|
|
527
|
-
_v$9 !== _p$.i && _el$
|
|
528
|
-
_v$10 !== _p$.n && _el$
|
|
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);
|
|
529
560
|
return _p$;
|
|
530
561
|
}, {
|
|
531
562
|
e: undefined,
|
|
@@ -535,19 +566,19 @@ function $29535f590238371c$var$ColorSwatches({ colorMap_: colorMap_, setShowVari
|
|
|
535
566
|
i: undefined,
|
|
536
567
|
n: undefined
|
|
537
568
|
});
|
|
538
|
-
return _el$
|
|
569
|
+
return _el$9;
|
|
539
570
|
})();
|
|
540
571
|
}
|
|
541
572
|
}), null);
|
|
542
|
-
(0, $2MCgq$insert)(_el$
|
|
573
|
+
(0, $2MCgq$insert)(_el$7, (0, $2MCgq$createComponent)((0, $2MCgq$Show), {
|
|
543
574
|
get when () {
|
|
544
575
|
return entriesToShow().length !== colorMap_().size;
|
|
545
576
|
},
|
|
546
577
|
get children () {
|
|
547
|
-
return $29535f590238371c$var$_tmpl$
|
|
578
|
+
return $29535f590238371c$var$_tmpl$6();
|
|
548
579
|
}
|
|
549
580
|
}), null);
|
|
550
|
-
return _el$
|
|
581
|
+
return _el$7;
|
|
551
582
|
})();
|
|
552
583
|
})();
|
|
553
584
|
}
|
|
@@ -571,14 +602,14 @@ function $29535f590238371c$var$Sizes({ sizesInStock_: sizesInStock_, ref_: ref_,
|
|
|
571
602
|
return keysToShow().length > 1;
|
|
572
603
|
},
|
|
573
604
|
get children () {
|
|
574
|
-
var _el$
|
|
605
|
+
var _el$10 = $29535f590238371c$var$_tmpl$10();
|
|
575
606
|
(0, $2MCgq$use)((el)=>{
|
|
576
607
|
ref_?.(el);
|
|
577
608
|
// Do like this so we don't override other styles set by AnimateRowSwitch
|
|
578
609
|
(0, $2MCgq$createEffect)(()=>el.style.setProperty("--font-size-rem", fontSizeRem_() + "rem"));
|
|
579
610
|
(0, $2MCgq$createEffect)(()=>el.style.setProperty("--sizes-gap", gap() + "px"));
|
|
580
|
-
}, _el$
|
|
581
|
-
(0, $2MCgq$insert)(_el$
|
|
611
|
+
}, _el$10);
|
|
612
|
+
(0, $2MCgq$insert)(_el$10, (0, $2MCgq$createComponent)((0, $2MCgq$For), {
|
|
582
613
|
get each () {
|
|
583
614
|
return $29535f590238371c$var$sortSizes(keysToShow());
|
|
584
615
|
},
|
|
@@ -588,30 +619,30 @@ function $29535f590238371c$var$Sizes({ sizesInStock_: sizesInStock_, ref_: ref_,
|
|
|
588
619
|
},
|
|
589
620
|
get fallback () {
|
|
590
621
|
return (()=>{
|
|
591
|
-
var _el$
|
|
592
|
-
(0, $2MCgq$insert)(_el$
|
|
593
|
-
return _el$
|
|
622
|
+
var _el$16 = $29535f590238371c$var$_tmpl$12();
|
|
623
|
+
(0, $2MCgq$insert)(_el$16, size);
|
|
624
|
+
return _el$16;
|
|
594
625
|
})();
|
|
595
626
|
},
|
|
596
627
|
get children () {
|
|
597
|
-
var _el$
|
|
598
|
-
(0, $2MCgq$insert)(_el$
|
|
599
|
-
return _el$
|
|
628
|
+
var _el$15 = $29535f590238371c$var$_tmpl$11();
|
|
629
|
+
(0, $2MCgq$insert)(_el$15, size);
|
|
630
|
+
return _el$15;
|
|
600
631
|
}
|
|
601
632
|
})
|
|
602
633
|
}), null);
|
|
603
|
-
(0, $2MCgq$insert)(_el$
|
|
634
|
+
(0, $2MCgq$insert)(_el$10, (0, $2MCgq$createComponent)((0, $2MCgq$Show), {
|
|
604
635
|
get when () {
|
|
605
636
|
return hidden() > 0;
|
|
606
637
|
},
|
|
607
638
|
get children () {
|
|
608
|
-
var _el$
|
|
609
|
-
(0, $2MCgq$insert)(_el$
|
|
610
|
-
return _el$
|
|
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;
|
|
611
642
|
}
|
|
612
643
|
}), null);
|
|
613
|
-
(0, $2MCgq$effect)(()=>_el$
|
|
614
|
-
return _el$
|
|
644
|
+
(0, $2MCgq$effect)(()=>_el$10.classList.toggle("small", !!(widthAvailableForSizes_() < 250)));
|
|
645
|
+
return _el$10;
|
|
615
646
|
}
|
|
616
647
|
});
|
|
617
648
|
}
|
|
@@ -659,10 +690,10 @@ function $29535f590238371c$var$ImagesAndVideos({ image_urls_: image_urls_, video
|
|
|
659
690
|
},
|
|
660
691
|
get fallback () {
|
|
661
692
|
return (()=>{
|
|
662
|
-
var _el$
|
|
663
|
-
(0, $2MCgq$insert)(_el$
|
|
664
|
-
(0, $2MCgq$effect)(()=>(0, $2MCgq$className)(_el$
|
|
665
|
-
return _el$
|
|
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;
|
|
666
697
|
})();
|
|
667
698
|
},
|
|
668
699
|
get children () {
|
|
@@ -769,8 +800,8 @@ function $29535f590238371c$var$ImagesAndVideos({ image_urls_: image_urls_, video
|
|
|
769
800
|
get children () {
|
|
770
801
|
return (0, $2MCgq$createComponent)(MaybeShowLazily, {
|
|
771
802
|
get children () {
|
|
772
|
-
var _el$
|
|
773
|
-
(0, $2MCgq$insert)(_el$
|
|
803
|
+
var _el$18 = $29535f590238371c$var$_tmpl$14();
|
|
804
|
+
(0, $2MCgq$insert)(_el$18, (0, $2MCgq$createComponent)((0, $2MCgq$ImageContainer), {
|
|
774
805
|
get aspectRatio () {
|
|
775
806
|
return aspectRatio_();
|
|
776
807
|
},
|
|
@@ -791,7 +822,7 @@ function $29535f590238371c$var$ImagesAndVideos({ image_urls_: image_urls_, video
|
|
|
791
822
|
});
|
|
792
823
|
}
|
|
793
824
|
}));
|
|
794
|
-
return _el$
|
|
825
|
+
return _el$18;
|
|
795
826
|
}
|
|
796
827
|
});
|
|
797
828
|
}
|
|
@@ -812,8 +843,8 @@ function $29535f590238371c$var$ImagesAndVideos({ image_urls_: image_urls_, video
|
|
|
812
843
|
get children () {
|
|
813
844
|
return (0, $2MCgq$createComponent)(MaybeShowLazily, {
|
|
814
845
|
get children () {
|
|
815
|
-
var _el$
|
|
816
|
-
(0, $2MCgq$insert)(_el$
|
|
846
|
+
var _el$19 = $29535f590238371c$var$_tmpl$15();
|
|
847
|
+
(0, $2MCgq$insert)(_el$19, (0, $2MCgq$createComponent)((0, $2MCgq$ShopifyContainedImage), {
|
|
817
848
|
src: image_url,
|
|
818
849
|
get aspectRatio () {
|
|
819
850
|
return aspectRatio_();
|
|
@@ -822,7 +853,7 @@ function $29535f590238371c$var$ImagesAndVideos({ image_urls_: image_urls_, video
|
|
|
822
853
|
alt: "Product image"
|
|
823
854
|
}
|
|
824
855
|
}), null);
|
|
825
|
-
(0, $2MCgq$insert)(_el$
|
|
856
|
+
(0, $2MCgq$insert)(_el$19, (0, $2MCgq$createComponent)((0, $2MCgq$Show), {
|
|
826
857
|
get when () {
|
|
827
858
|
return (0, $2MCgq$memo)(()=>!!(!index() && image_urls_()?.[1]))() && !hoverImageDisabled();
|
|
828
859
|
},
|
|
@@ -843,7 +874,7 @@ function $29535f590238371c$var$ImagesAndVideos({ image_urls_: image_urls_, video
|
|
|
843
874
|
});
|
|
844
875
|
}
|
|
845
876
|
}), null);
|
|
846
|
-
return _el$
|
|
877
|
+
return _el$19;
|
|
847
878
|
}
|
|
848
879
|
});
|
|
849
880
|
}
|
|
@@ -874,46 +905,46 @@ function $29535f590238371c$var$Video(props) {
|
|
|
874
905
|
const productCardIndexAccessor = (0, $2MCgq$useProductCardIndex)();
|
|
875
906
|
const cardIsVisible = (0, $2MCgq$useProductCardIsVisible)();
|
|
876
907
|
return (()=>{
|
|
877
|
-
var _el$
|
|
908
|
+
var _el$20 = $29535f590238371c$var$_tmpl$17();
|
|
878
909
|
(0, $2MCgq$use)((element)=>{
|
|
879
910
|
element.disablePictureInPicture = true;
|
|
880
911
|
(0, $2MCgq$createEffect)(()=>{
|
|
881
912
|
if ((cardIsVisible() || props.forceIsVisible_) && tabIsVisible() && !props.swipedPastVideo_) element.play().catch((e)=>(0, $2MCgq$dwarn)("Error playing video", e));
|
|
882
913
|
else element.pause();
|
|
883
914
|
});
|
|
884
|
-
}, _el$
|
|
885
|
-
_el$
|
|
886
|
-
_el$
|
|
887
|
-
_el$
|
|
888
|
-
_el$
|
|
889
|
-
(0, $2MCgq$spread)(_el$
|
|
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)({
|
|
890
921
|
get poster () {
|
|
891
922
|
return props.poster_;
|
|
892
923
|
}
|
|
893
924
|
}, ()=>productCardIndexAccessor?.() < 8 && {
|
|
894
925
|
preload: "auto"
|
|
895
926
|
}), false, true);
|
|
896
|
-
(0, $2MCgq$insert)(_el$
|
|
927
|
+
(0, $2MCgq$insert)(_el$20, (0, $2MCgq$createComponent)((0, $2MCgq$Show), {
|
|
897
928
|
get when () {
|
|
898
929
|
return hlsSource();
|
|
899
930
|
},
|
|
900
931
|
get children () {
|
|
901
|
-
var _el$
|
|
902
|
-
(0, $2MCgq$effect)(()=>(0, $2MCgq$setAttribute)(_el$
|
|
903
|
-
return _el$
|
|
932
|
+
var _el$21 = $29535f590238371c$var$_tmpl$16();
|
|
933
|
+
(0, $2MCgq$effect)(()=>(0, $2MCgq$setAttribute)(_el$21, "src", hlsSource()));
|
|
934
|
+
return _el$21;
|
|
904
935
|
}
|
|
905
936
|
}), null);
|
|
906
|
-
(0, $2MCgq$insert)(_el$
|
|
937
|
+
(0, $2MCgq$insert)(_el$20, (0, $2MCgq$createComponent)((0, $2MCgq$For), {
|
|
907
938
|
get each () {
|
|
908
939
|
return nonHLSSources();
|
|
909
940
|
},
|
|
910
941
|
children: (source)=>(()=>{
|
|
911
|
-
var _el$
|
|
912
|
-
(0, $2MCgq$setAttribute)(_el$
|
|
913
|
-
return _el$
|
|
942
|
+
var _el$22 = $29535f590238371c$var$_tmpl$18();
|
|
943
|
+
(0, $2MCgq$setAttribute)(_el$22, "src", source);
|
|
944
|
+
return _el$22;
|
|
914
945
|
})()
|
|
915
946
|
}), null);
|
|
916
|
-
return _el$
|
|
947
|
+
return _el$20;
|
|
917
948
|
})();
|
|
918
949
|
}
|
|
919
950
|
// ChatGPT written
|
|
@@ -950,9 +981,9 @@ function $29535f590238371c$var$Prices({ formatPrice_: formatPrice_, configuredOp
|
|
|
950
981
|
get children () {
|
|
951
982
|
return [
|
|
952
983
|
(()=>{
|
|
953
|
-
var _el$
|
|
954
|
-
(0, $2MCgq$use)((el)=>$29535f590238371c$var$setStyleForTextOptions(el, priceOptions), _el$
|
|
955
|
-
(0, $2MCgq$insert)(_el$
|
|
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), {
|
|
956
987
|
get when () {
|
|
957
988
|
return variantToShow_();
|
|
958
989
|
},
|
|
@@ -976,7 +1007,7 @@ function $29535f590238371c$var$Prices({ formatPrice_: formatPrice_, configuredOp
|
|
|
976
1007
|
});
|
|
977
1008
|
}
|
|
978
1009
|
}));
|
|
979
|
-
return _el$
|
|
1010
|
+
return _el$23;
|
|
980
1011
|
})(),
|
|
981
1012
|
(0, $2MCgq$createComponent)((0, $2MCgq$Suspense), {
|
|
982
1013
|
get children () {
|
|
@@ -988,10 +1019,10 @@ function $29535f590238371c$var$Prices({ formatPrice_: formatPrice_, configuredOp
|
|
|
988
1019
|
return [
|
|
989
1020
|
" ",
|
|
990
1021
|
(()=>{
|
|
991
|
-
var _el$
|
|
992
|
-
(0, $2MCgq$use)((el)=>$29535f590238371c$var$setStyleForTextOptions(el, originalPriceOptions), _el$
|
|
993
|
-
(0, $2MCgq$insert)(_el$
|
|
994
|
-
return _el$
|
|
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;
|
|
995
1026
|
})()
|
|
996
1027
|
];
|
|
997
1028
|
}
|
|
@@ -1073,11 +1104,11 @@ function $29535f590238371c$var$InComponentOrDiv(props) {
|
|
|
1073
1104
|
children: resolved
|
|
1074
1105
|
});
|
|
1075
1106
|
return (()=>{
|
|
1076
|
-
var _el$
|
|
1077
|
-
(0, $2MCgq$use)((el)=>props?.ref_?.(el), _el$
|
|
1078
|
-
(0, $2MCgq$insert)(_el$
|
|
1079
|
-
(0, $2MCgq$effect)(()=>(0, $2MCgq$className)(_el$
|
|
1080
|
-
return _el$
|
|
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;
|
|
1081
1112
|
})();
|
|
1082
1113
|
});
|
|
1083
1114
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/portal-components",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.36",
|
|
4
4
|
"packageManager": "yarn@3.2.2",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -71,7 +71,8 @@
|
|
|
71
71
|
"sass": "./dist/styles/index.scss"
|
|
72
72
|
},
|
|
73
73
|
"./styles/*": "./dist/styles/*",
|
|
74
|
-
"./src/specialForShopify/DefaultSolidProductCard.tsx": "./src/specialForShopify/DefaultSolidProductCard.tsx"
|
|
74
|
+
"./src/specialForShopify/DefaultSolidProductCard.tsx": "./src/specialForShopify/DefaultSolidProductCard.tsx",
|
|
75
|
+
"./src/specialForShopify/DefaultSolidProductCard": "./src/specialForShopify/DefaultSolidProductCard.tsx"
|
|
75
76
|
},
|
|
76
77
|
"files": [
|
|
77
78
|
"/dist",
|
|
@@ -101,10 +102,10 @@
|
|
|
101
102
|
"dependencies": {
|
|
102
103
|
"@babel/runtime": "latest",
|
|
103
104
|
"@babel/runtime-corejs3": "^7.22.6",
|
|
104
|
-
"@depict-ai/plp-styling": "^4.4.
|
|
105
|
+
"@depict-ai/plp-styling": "^4.4.23",
|
|
105
106
|
"@depict-ai/react-ui": "^4.8.7",
|
|
106
107
|
"@depict-ai/types": "^5.4.5",
|
|
107
|
-
"@depict-ai/ui": "^4.8.
|
|
108
|
+
"@depict-ai/ui": "^4.8.30",
|
|
108
109
|
"@depict-ai/utilishared": "^2.4.7",
|
|
109
110
|
"parcel": "^2.10.3",
|
|
110
111
|
"solid-js": "^1.8.16"
|
|
@@ -128,13 +128,22 @@ 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;
|
|
136
134
|
}),
|
|
137
|
-
configuredOptions_: Accessor<
|
|
135
|
+
configuredOptions_: Accessor<
|
|
136
|
+
ProductCardSchema & {
|
|
137
|
+
/**
|
|
138
|
+
* used in Depict portal where we don't have a provider with an IntersectionObserver
|
|
139
|
+
*/
|
|
140
|
+
forceIsVisible_?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Used in Depict shopify app admin UI when this is a non-user configured product card
|
|
143
|
+
*/
|
|
144
|
+
overrideMainAttributes_?: JSX.HTMLAttributes<HTMLDivElement>;
|
|
145
|
+
}
|
|
146
|
+
>,
|
|
138
147
|
overrideAspectRatio?: Accessor<number>
|
|
139
148
|
) {
|
|
140
149
|
const variantDisplays = createMemo(() => display()?.variant_displays);
|
|
@@ -259,10 +268,11 @@ export function DefaultSolidProductCard(
|
|
|
259
268
|
const element = (
|
|
260
269
|
<ContainsColorSwatchesProvider>
|
|
261
270
|
<div
|
|
262
|
-
class=
|
|
271
|
+
class="d-product-card"
|
|
263
272
|
style={mainStyle()}
|
|
264
273
|
onMouseEnter={catchify(() => !noHoverSupport_() && setCardIsHovered(true))}
|
|
265
274
|
onMouseLeave={catchify(() => !noHoverSupport_() && setCardIsHovered(false))}
|
|
275
|
+
{...configuredOptions_().overrideMainAttributes_}
|
|
266
276
|
>
|
|
267
277
|
<LinkWrapped class="upper" focusable_={true}>
|
|
268
278
|
<ImagesAndVideos
|
|
@@ -275,7 +285,21 @@ export function DefaultSolidProductCard(
|
|
|
275
285
|
forceIsVisible_={() => configuredOptions_().forceIsVisible_}
|
|
276
286
|
/>
|
|
277
287
|
</LinkWrapped>
|
|
278
|
-
|
|
288
|
+
<Suspense>
|
|
289
|
+
<Show when={configuredOptions_().smart_labels}>
|
|
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>
|
|
279
303
|
{(() => {
|
|
280
304
|
// We want the whole product card to be a link, except for the color swatches
|
|
281
305
|
const [containsColorSwatches] = useContainsColorSwatches();
|