@depict-ai/ui 4.7.7 → 4.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ES10/index.cjs +173 -118
- package/ES10/index.d.ts +7 -17
- package/ES10/index.js +174 -119
- package/latest/index.cjs +168 -110
- package/latest/index.d.ts +7 -17
- package/latest/index.js +169 -111
- package/package.json +4 -4
- package/server/ES10/index.cjs +104 -69
- package/server/ES10/index.d.ts +7 -17
- package/server/ES10/index.js +104 -69
- package/server/latest/index.cjs +105 -70
- package/server/latest/index.d.ts +7 -17
- package/server/latest/index.js +105 -70
package/latest/index.cjs
CHANGED
|
@@ -98,7 +98,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $1f4925833f07df29$export$5b7
|
|
|
98
98
|
$parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de035477d6fef996);
|
|
99
99
|
$parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
|
|
100
100
|
/*! Depict.ai search and product listing SDK */
|
|
101
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.7.
|
|
101
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.7.9";
|
|
102
102
|
function $4b455f60dadde8b8$export$5bad61ecde080b1f(...params) {
|
|
103
103
|
const {
|
|
104
104
|
collapse: collapse,
|
|
@@ -701,24 +701,27 @@ function $0f313083912e447a$export$8be2714ec7f169ee(props = {}) {
|
|
|
701
701
|
}
|
|
702
702
|
var $a0e53f99354809d9$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div>`),
|
|
703
703
|
$a0e53f99354809d9$var$_tmpl$2 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class="depict-slider depict"><button aria-label="Scroll left"class="left d-navbutton"type=button></button><button aria-label="Scroll right"class="right d-navbutton"type=button></button><div class=sliding>`);
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
}) {
|
|
704
|
+
const $a0e53f99354809d9$var$SlidableContext = /*@__PURE__*/$gVhhF$solidjs.createContext();
|
|
705
|
+
function $a0e53f99354809d9$export$6649caad96ef8870(props) {
|
|
706
|
+
const {
|
|
707
|
+
slider_ref_: slider_ref_,
|
|
708
|
+
faded_opacity_ = 0.7,
|
|
709
|
+
mutation_plugins_ = [],
|
|
710
|
+
disable_fading_: disable_fading_,
|
|
711
|
+
snapAlign_: snapAlign_,
|
|
712
|
+
fadingThreshold_ = 0.96
|
|
713
|
+
} = props;
|
|
715
714
|
const [hasHydrated, setHasHydrated] = $gVhhF$solidjs.createSignal(false);
|
|
716
715
|
$gVhhF$solidjs.createEffect(() => setHasHydrated(true));
|
|
717
716
|
const MakeButton = () => (() => {
|
|
718
717
|
var _el$ = $gVhhF$solidjsweb.getNextElement($a0e53f99354809d9$var$_tmpl$);
|
|
719
718
|
$gVhhF$solidjsweb.insert(_el$, $gVhhF$solidjsweb.createComponent((0, $0f313083912e447a$export$8be2714ec7f169ee), {
|
|
720
|
-
height_
|
|
721
|
-
|
|
719
|
+
get height_() {
|
|
720
|
+
return props.arrow_height_;
|
|
721
|
+
},
|
|
722
|
+
get width_() {
|
|
723
|
+
return props.arrow_width_;
|
|
724
|
+
}
|
|
722
725
|
}));
|
|
723
726
|
return _el$;
|
|
724
727
|
})();
|
|
@@ -738,12 +741,13 @@ function $a0e53f99354809d9$export$6649caad96ef8870({
|
|
|
738
741
|
_el$5 = _el$4.nextSibling;
|
|
739
742
|
$gVhhF$solidjsweb.insert(_el$3, $gVhhF$solidjsweb.createComponent(MakeButton, {}));
|
|
740
743
|
$gVhhF$solidjsweb.insert(_el$4, $gVhhF$solidjsweb.createComponent(MakeButton, {}));
|
|
741
|
-
$gVhhF$solidjsweb.insert(_el$5, children);
|
|
744
|
+
$gVhhF$solidjsweb.insert(_el$5, () => props.children);
|
|
742
745
|
return _el$2;
|
|
743
746
|
})();
|
|
744
747
|
},
|
|
745
748
|
get children() {
|
|
746
749
|
return (() => {
|
|
750
|
+
const [intersectionEntries_, setIntersectionEntries] = $gVhhF$solidjs.createSignal([]);
|
|
747
751
|
const fading_plugin = disable_fading_ ? undefined : $gVhhF$depictaiutilishared.slider_fading_factory({
|
|
748
752
|
threshold_: fadingThreshold_,
|
|
749
753
|
faded_opacity_: faded_opacity_
|
|
@@ -756,9 +760,17 @@ function $a0e53f99354809d9$export$6649caad96ef8870({
|
|
|
756
760
|
constructor_plugins: [$gVhhF$depictaiutilishared.slider_snap_css(0, {
|
|
757
761
|
align: snapAlign_
|
|
758
762
|
}).constructor_plugin, ...(fading_plugin ? [fading_plugin.constructor_plugin] : [])],
|
|
759
|
-
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_]
|
|
763
|
+
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_, entries => setIntersectionEntries(entries)]
|
|
760
764
|
});
|
|
761
|
-
$gVhhF$solidjsweb.insert(slider.insert_here,
|
|
765
|
+
$gVhhF$solidjsweb.insert(slider.insert_here, () => $gVhhF$solidjsweb.createComponent($a0e53f99354809d9$var$SlidableContext.Provider, {
|
|
766
|
+
value: {
|
|
767
|
+
slider_: slider,
|
|
768
|
+
intersectionEntries_: intersectionEntries_
|
|
769
|
+
},
|
|
770
|
+
get children() {
|
|
771
|
+
return props.children;
|
|
772
|
+
}
|
|
773
|
+
}));
|
|
762
774
|
$gVhhF$solidjs.onCleanup(() => slider.observer.disconnect());
|
|
763
775
|
slider_ref_?.(slider);
|
|
764
776
|
return slider.container;
|
|
@@ -766,6 +778,9 @@ function $a0e53f99354809d9$export$6649caad96ef8870({
|
|
|
766
778
|
}
|
|
767
779
|
});
|
|
768
780
|
}
|
|
781
|
+
function $a0e53f99354809d9$export$eaa625fb39439e37() {
|
|
782
|
+
return $gVhhF$solidjs.useContext($a0e53f99354809d9$var$SlidableContext);
|
|
783
|
+
}
|
|
769
784
|
var $363ce4d1d71041aa$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<h2 class=recs-title>`);
|
|
770
785
|
function $363ce4d1d71041aa$export$d41d19e89346fa2({
|
|
771
786
|
recommendations_resource_: recommendations_resource_,
|
|
@@ -941,34 +956,6 @@ function $b54e6192d0caa293$export$d9f36cf74e24d595(media_query) {
|
|
|
941
956
|
}) => signal[1](matches)).remove);
|
|
942
957
|
return signal[0];
|
|
943
958
|
}
|
|
944
|
-
|
|
945
|
-
/** @jsxImportSource solid-js */
|
|
946
|
-
|
|
947
|
-
function $f13855d1b951b24a$export$ebdc3711f7e02ccd(what_to_watch) {
|
|
948
|
-
const [width, setWidth] = $gVhhF$solidjs.createSignal();
|
|
949
|
-
const resizeObserver = new ResizeObserver($gVhhF$depictaiutilishared.catchify(records => {
|
|
950
|
-
for (let j = 0; j < records.length; j++) {
|
|
951
|
-
const width = records[j].borderBoxSize?.[0]?.inlineSize ?? what_to_watch.getBoundingClientRect().width;
|
|
952
|
-
setWidth(width);
|
|
953
|
-
}
|
|
954
|
-
}));
|
|
955
|
-
// If we start observing elements before they're in the DOM Chrome (Version 117.0.5938.92 (Official Build) (arm64)) sometimes gives us a resize event with a width of 0 and then doesn't dispatch one with the actual width once it's in the DOM. So we wait until the element is in the DOM before we start observing it.
|
|
956
|
-
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
957
|
-
const disconnect = (0, $gVhhF$depictaiutilishared.observer).onexists(what_to_watch, ({
|
|
958
|
-
element: element
|
|
959
|
-
}) => requestAnimationFrame($gVhhF$depictaiutilishared.catchify(() => {
|
|
960
|
-
const current_size = what_to_watch.getBoundingClientRect().width;
|
|
961
|
-
if (current_size)
|
|
962
|
-
// If element has size, set signal to that. ResizeObserver only triggers when the content is visible in some cases, but it might already have a size. This reduces size filter expanding animation jank in chrome.
|
|
963
|
-
setWidth(current_size);
|
|
964
|
-
resizeObserver.observe(element);
|
|
965
|
-
})));
|
|
966
|
-
$gVhhF$solidjs.onCleanup(() => {
|
|
967
|
-
resizeObserver.disconnect();
|
|
968
|
-
disconnect();
|
|
969
|
-
});
|
|
970
|
-
return width;
|
|
971
|
-
}
|
|
972
959
|
function $061ff5b4c3d36171$export$89c6019e4baa40b1(props) {
|
|
973
960
|
const style = $gVhhF$solidjs.createMemo(() => {
|
|
974
961
|
const {
|
|
@@ -1128,9 +1115,10 @@ function $19950faaac026e09$export$6e5611bc7e57e477(props) {
|
|
|
1128
1115
|
});
|
|
1129
1116
|
// Batch idle callbacks so that MutationObserver can batch the resulting mutations better, so we don't lose tons of CPU time to MutationObservers doing lots of things for each image
|
|
1130
1117
|
// Happened on singular, they have some weird observer (+we also have one but ours is at least 3x more efficient)
|
|
1131
|
-
const executeWhenIdleBatched = fn => {
|
|
1118
|
+
const executeWhenIdleBatched = (fn, isSizesUpdate) => {
|
|
1132
1119
|
if (typeof requestIdleCallback !== "function") return setTimeout(fn); // Old browsers don't get optimisation
|
|
1133
|
-
if ($gVhhF$solidjs.untrack(isPrioritisedImage)) return fn(); // If we're one of the first 8 images, execute the callbacks immediately
|
|
1120
|
+
if ((!isSizesUpdate || !sizeSetFastPath) && $gVhhF$solidjs.untrack(isPrioritisedImage)) return fn(); // If we're one of the first 8 images, execute the callbacks immediately (improves lighthouse metrics)
|
|
1121
|
+
// unless we're just a `sizes` update after the initial sizes setting (this optimisation makes the looks animation a lot smoother on low-cpu devices)
|
|
1134
1122
|
const existingStack = listingContext?.[$19950faaac026e09$var$onIdleFunctionsSymbol];
|
|
1135
1123
|
if (existingStack) return existingStack.add(fn);
|
|
1136
1124
|
const newStack = new Set([fn]);
|
|
@@ -1212,10 +1200,11 @@ function $19950faaac026e09$export$6e5611bc7e57e477(props) {
|
|
|
1212
1200
|
// This greatly improves performance when loading (more) products
|
|
1213
1201
|
// See https://depictaiworkspace.slack.com/archives/C05NJ0K3WRL/p1698220617663139
|
|
1214
1202
|
timeoutSet = true; // Important to set timeoutSet before the call to executeWhenIdleBatched since if this is an important image executeWhenIdleBatched will execute fn immediately
|
|
1215
|
-
executeWhenIdleBatched(handler);
|
|
1203
|
+
executeWhenIdleBatched(handler, true);
|
|
1216
1204
|
});
|
|
1205
|
+
const dontLoadImageYet = $gVhhF$solidjs.createMemo(() => !props.size() || !hasSetSize()); // Moving this condition into a memo saves us from re-setting src and srcset (expensive) if just props.size changes
|
|
1217
1206
|
$gVhhF$solidjs.createEffect(() => {
|
|
1218
|
-
if (
|
|
1207
|
+
if (dontLoadImageYet()) return; // If size isn't known or set, don't assign src yet since it would cause the most low res image to load
|
|
1219
1208
|
Object.assign(img, src_options());
|
|
1220
1209
|
// Add to DOM once decoded to not require/block any paints before image has completed loading and avoid showing broken image symbol
|
|
1221
1210
|
// We can do this because there has to be a container around us giving us a size
|
|
@@ -1231,7 +1220,7 @@ function $19950faaac026e09$export$6e5611bc7e57e477(props) {
|
|
|
1231
1220
|
img.decode().catch(e => $gVhhF$depictaiutilishared.dwarn("Failed to decode image", e, img)) // Display the image also if loading failed so webdev can debug and doesn't get "no image"
|
|
1232
1221
|
.then(async () => {
|
|
1233
1222
|
// Also wait with inserting image (i.e. paint) until browser is idle
|
|
1234
|
-
await new Promise(r => executeWhenIdleBatched(r));
|
|
1223
|
+
await new Promise(r => executeWhenIdleBatched(r, false));
|
|
1235
1224
|
if (gotCleanedUp) return;
|
|
1236
1225
|
setHasDecoded(true);
|
|
1237
1226
|
hasDecodedFastPath = true;
|
|
@@ -1562,7 +1551,7 @@ var $b9e830d616d01b31$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div
|
|
|
1562
1551
|
let $b9e830d616d01b31$var$cachedValue;
|
|
1563
1552
|
async function $b9e830d616d01b31$export$7b9a0e99f0aeb2f3() {
|
|
1564
1553
|
if ($b9e830d616d01b31$var$cachedValue != undefined) return $b9e830d616d01b31$var$cachedValue;
|
|
1565
|
-
return $b9e830d616d01b31$var$cachedValue =
|
|
1554
|
+
return $b9e830d616d01b31$var$cachedValue = $b9e830d616d01b31$var$checkIfIsAffectedByChromeBug326498383();
|
|
1566
1555
|
}
|
|
1567
1556
|
async function $b9e830d616d01b31$var$checkIfIsAffectedByChromeBug326498383() {
|
|
1568
1557
|
let isAffected = true;
|
|
@@ -1575,7 +1564,7 @@ async function $b9e830d616d01b31$var$checkIfIsAffectedByChromeBug326498383() {
|
|
|
1575
1564
|
setTimeout($gVhhF$depictaiutilishared.catchify(() => {
|
|
1576
1565
|
r();
|
|
1577
1566
|
div.remove();
|
|
1578
|
-
}),
|
|
1567
|
+
}), 500);
|
|
1579
1568
|
});
|
|
1580
1569
|
const {
|
|
1581
1570
|
style: style
|
|
@@ -1617,7 +1606,8 @@ function $905010a06f9aeae5$export$ebf0b1d4f90c09ae({
|
|
|
1617
1606
|
animationDuration_: animationDuration_,
|
|
1618
1607
|
supportsHover_: supportsHover_,
|
|
1619
1608
|
priceFormatting_: priceFormatting_,
|
|
1620
|
-
pseudoRouter_: pseudoRouter_
|
|
1609
|
+
pseudoRouter_: pseudoRouter_,
|
|
1610
|
+
containerHeight_: containerHeight_
|
|
1621
1611
|
}) {
|
|
1622
1612
|
let isAffectedByChromeBug = false;
|
|
1623
1613
|
// If the user requests the drawer to be expanded or not
|
|
@@ -1637,6 +1627,8 @@ function $905010a06f9aeae5$export$ebf0b1d4f90c09ae({
|
|
|
1637
1627
|
get children() {
|
|
1638
1628
|
var _el$ = $gVhhF$solidjsweb.getNextElement($905010a06f9aeae5$var$_tmpl$),
|
|
1639
1629
|
_el$2 = _el$.firstChild;
|
|
1630
|
+
$gVhhF$solidjsweb.addEventListener(_el$2, "mouseleave", $gVhhF$depictaiutilishared.catchify(() => supportsHover_() && setUserWantsExpanded(false)));
|
|
1631
|
+
$gVhhF$solidjsweb.addEventListener(_el$2, "mouseenter", $gVhhF$depictaiutilishared.catchify(() => supportsHover_() && setUserWantsExpanded(true)));
|
|
1640
1632
|
$gVhhF$solidjsweb.use(el => $gVhhF$solidjs.createEffect(() => {
|
|
1641
1633
|
if (userWantsExpanded()) return;
|
|
1642
1634
|
if (isAffectedByChromeBug) {
|
|
@@ -1648,22 +1640,6 @@ function $905010a06f9aeae5$export$ebf0b1d4f90c09ae({
|
|
|
1648
1640
|
behavior: "smooth"
|
|
1649
1641
|
});
|
|
1650
1642
|
}), _el$2);
|
|
1651
|
-
$gVhhF$solidjsweb.spread(_el$2, $gVhhF$solidjsweb.mergeProps({
|
|
1652
|
-
get classList() {
|
|
1653
|
-
return {
|
|
1654
|
-
expanded: userWantsExpanded(),
|
|
1655
|
-
"resting-fully-expanded": !getSecondPartAnimationRunning() && userWantsExpanded()
|
|
1656
|
-
};
|
|
1657
|
-
},
|
|
1658
|
-
get onMouseEnter() {
|
|
1659
|
-
return $gVhhF$depictaiutilishared.catchify(() => supportsHover_() && setUserWantsExpanded(true));
|
|
1660
|
-
},
|
|
1661
|
-
get onMouseLeave() {
|
|
1662
|
-
return $gVhhF$depictaiutilishared.catchify(() => supportsHover_() && setUserWantsExpanded(false));
|
|
1663
|
-
}
|
|
1664
|
-
}, () => displays_() && {
|
|
1665
|
-
style: `--look-card-width:${containerWidth_()}px;--look-item-height:${lookItemHeight() || 200}px`
|
|
1666
|
-
}), false, true);
|
|
1667
1643
|
$gVhhF$solidjsweb.insert(_el$2, $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Index), {
|
|
1668
1644
|
get each() {
|
|
1669
1645
|
return displays_() || Array.from({
|
|
@@ -1688,7 +1664,21 @@ function $905010a06f9aeae5$export$ebf0b1d4f90c09ae({
|
|
|
1688
1664
|
});
|
|
1689
1665
|
}
|
|
1690
1666
|
}));
|
|
1691
|
-
$gVhhF$solidjsweb.
|
|
1667
|
+
$gVhhF$solidjsweb.effect(_p$ => {
|
|
1668
|
+
var _v$ = !!userWantsExpanded(),
|
|
1669
|
+
_v$2 = !!(!getSecondPartAnimationRunning() && userWantsExpanded()),
|
|
1670
|
+
_v$3 = displays_() &&
|
|
1671
|
+
// The styling is written like this to eke out animation smoothness on low CPU devices, git blame for previous, more readable versions.
|
|
1672
|
+
`--look-card-width:${containerWidth_()}px;--look-card-height:${containerHeight_()}px;--look-item-height:${lookItemHeight() || 200}px`;
|
|
1673
|
+
_v$ !== _p$.e && _el$2.classList.toggle("expanded", _p$.e = _v$);
|
|
1674
|
+
_v$2 !== _p$.t && _el$2.classList.toggle("resting-fully-expanded", _p$.t = _v$2);
|
|
1675
|
+
_p$.a = $gVhhF$solidjsweb.style(_el$2, _v$3, _p$.a);
|
|
1676
|
+
return _p$;
|
|
1677
|
+
}, {
|
|
1678
|
+
e: undefined,
|
|
1679
|
+
t: undefined,
|
|
1680
|
+
a: undefined
|
|
1681
|
+
});
|
|
1692
1682
|
return _el$;
|
|
1693
1683
|
}
|
|
1694
1684
|
});
|
|
@@ -1715,7 +1705,7 @@ function $905010a06f9aeae5$var$scrollingFunctionForChrome(element, targetScrollY
|
|
|
1715
1705
|
// Bootstrap our animation - it will get called right before next frame shall be rendered.
|
|
1716
1706
|
requestAnimationFrame(step);
|
|
1717
1707
|
}
|
|
1718
|
-
var $ad882bbe664dbd53$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class=look-card
|
|
1708
|
+
var $ad882bbe664dbd53$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class=look-card><!$><!/><!$><!/>`);
|
|
1719
1709
|
function $ad882bbe664dbd53$export$44809a8a3e867e30({
|
|
1720
1710
|
display_: display_,
|
|
1721
1711
|
expandedLooksSignal_: [expandedLooks_, setExpandedLooks],
|
|
@@ -1725,20 +1715,14 @@ function $ad882bbe664dbd53$export$44809a8a3e867e30({
|
|
|
1725
1715
|
priceFormatting_: priceFormatting_,
|
|
1726
1716
|
pseudoRouter_: pseudoRouter_
|
|
1727
1717
|
}) {
|
|
1718
|
+
let container;
|
|
1728
1719
|
const useWantsExpandedSignal_ = $gVhhF$solidjs.createSignal(false);
|
|
1729
1720
|
const [userWantsExpanded, setUserWantsExpanded] = useWantsExpandedSignal_;
|
|
1730
1721
|
const supportsHover_ = $b54e6192d0caa293$export$d9f36cf74e24d595("(hover: hover) and (pointer: fine)");
|
|
1731
1722
|
const us = Symbol("look");
|
|
1732
|
-
const
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
target: target
|
|
1736
|
-
}) => setUserWantsExpanded(prev => !prev)), true);
|
|
1737
|
-
$gVhhF$solidjsweb.effect(() => _el$.classList.toggle("placeholder", !display_()));
|
|
1738
|
-
$gVhhF$solidjsweb.runHydrationEvents();
|
|
1739
|
-
return _el$;
|
|
1740
|
-
})();
|
|
1741
|
-
const containerWidth_ = $f13855d1b951b24a$export$ebdc3711f7e02ccd(container);
|
|
1723
|
+
const index = $129b9b9c010039d0$export$e3faf4d95300054f();
|
|
1724
|
+
const [containerWidth_, setContainerWidth] = $gVhhF$solidjs.createSignal();
|
|
1725
|
+
const [containerHeight_, setContainerHeight] = $gVhhF$solidjs.createSignal();
|
|
1742
1726
|
const clickHandler = $gVhhF$depictaiutilishared.catchify(({
|
|
1743
1727
|
target: target
|
|
1744
1728
|
}) => {
|
|
@@ -1746,6 +1730,7 @@ function $ad882bbe664dbd53$export$44809a8a3e867e30({
|
|
|
1746
1730
|
// When clicking outside the look, close it
|
|
1747
1731
|
setUserWantsExpanded(false);
|
|
1748
1732
|
});
|
|
1733
|
+
const slidableInformation = $a0e53f99354809d9$export$eaa625fb39439e37();
|
|
1749
1734
|
addEventListener("click", clickHandler);
|
|
1750
1735
|
$gVhhF$solidjs.onCleanup(() => removeEventListener("click", clickHandler));
|
|
1751
1736
|
$gVhhF$solidjs.createEffect(() => setExpandedLooks(prev => {
|
|
@@ -1757,37 +1742,82 @@ function $ad882bbe664dbd53$export$44809a8a3e867e30({
|
|
|
1757
1742
|
} else prev.delete(us);
|
|
1758
1743
|
return prev;
|
|
1759
1744
|
}));
|
|
1745
|
+
if (slidableInformation) {
|
|
1746
|
+
const ourVisiblityInSlider = $gVhhF$solidjs.createMemo(() => {
|
|
1747
|
+
const currentCard = index?.();
|
|
1748
|
+
if (isNaN(currentCard)) return;
|
|
1749
|
+
slidableInformation?.intersectionEntries_();
|
|
1750
|
+
return slidableInformation?.slider_.intersecting_items_object?.[currentCard]?.intersectionRatio;
|
|
1751
|
+
});
|
|
1752
|
+
$gVhhF$solidjs.createEffect(prevVisibility => {
|
|
1753
|
+
// Have memo -> effect setup for diffing, so we do as little work as possible in unrelated cards
|
|
1754
|
+
// as number is safe because undefined and NaN are both not < 0.5
|
|
1755
|
+
const visibility = ourVisiblityInSlider();
|
|
1756
|
+
if (visibility < 0.5 && (isNaN(prevVisibility) || visibility - prevVisibility < 0))
|
|
1757
|
+
// When sliding this card completely into the background, collapse it
|
|
1758
|
+
// Don't collapse it if we're about to put it more into visibility, to fix what's described at the end of https://www.loom.com/share/8796209c68764b18a0d565010929f594
|
|
1759
|
+
setUserWantsExpanded(false);
|
|
1760
|
+
return visibility;
|
|
1761
|
+
});
|
|
1762
|
+
}
|
|
1760
1763
|
// Close us if another look expands
|
|
1761
1764
|
$gVhhF$solidjs.createEffect(() => !expandedLooks_().has(us) && setUserWantsExpanded(false));
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1765
|
+
return (() => {
|
|
1766
|
+
var _el$ = $gVhhF$solidjsweb.getNextElement($ad882bbe664dbd53$var$_tmpl$),
|
|
1767
|
+
_el$2 = _el$.firstChild,
|
|
1768
|
+
[_el$3, _co$] = $gVhhF$solidjsweb.getNextMarker(_el$2.nextSibling),
|
|
1769
|
+
_el$4 = _el$3.nextSibling,
|
|
1770
|
+
[_el$5, _co$2] = $gVhhF$solidjsweb.getNextMarker(_el$4.nextSibling);
|
|
1771
|
+
$gVhhF$solidjsweb.addEventListener(_el$, "click", $gVhhF$depictaiutilishared.catchify(() => setUserWantsExpanded(prev => !prev)), true);
|
|
1772
|
+
$gVhhF$solidjsweb.use(el => {
|
|
1773
|
+
container = el;
|
|
1774
|
+
const ro = new ResizeObserver($gVhhF$depictaiutilishared.catchify(records => {
|
|
1775
|
+
const last = records.at(-1);
|
|
1776
|
+
if (!last) return;
|
|
1777
|
+
const {
|
|
1778
|
+
width: width,
|
|
1779
|
+
height: height
|
|
1780
|
+
} = last.contentRect;
|
|
1781
|
+
setContainerWidth(width);
|
|
1782
|
+
setContainerHeight(height);
|
|
1783
|
+
}));
|
|
1784
|
+
ro.observe(el);
|
|
1785
|
+
$gVhhF$solidjs.onCleanup(() => ro.disconnect());
|
|
1786
|
+
}, _el$);
|
|
1787
|
+
_el$.classList.toggle("placeholder", !!!display_);
|
|
1788
|
+
$gVhhF$solidjsweb.insert(_el$, $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
|
|
1789
|
+
get when() {
|
|
1790
|
+
return display_();
|
|
1791
|
+
},
|
|
1792
|
+
get fallback() {
|
|
1793
|
+
return $gVhhF$solidjsweb.createComponent((0, $3bc4a89b971a3af5$export$3f37af283f8fb843), {
|
|
1794
|
+
aspectRatio: `var(${(0, $6f604560873e4f69$export$8a2234b5b1a5ebd4)}, ${placeholderImageAspectRatio_})`
|
|
1795
|
+
});
|
|
1796
|
+
},
|
|
1797
|
+
get children() {
|
|
1798
|
+
return $gVhhF$solidjsweb.createComponent((0, $d212a67662c5cf38$export$9d4a4b669b1929ab), {
|
|
1799
|
+
get src() {
|
|
1800
|
+
return display_()?.image_urls?.[0];
|
|
1801
|
+
},
|
|
1802
|
+
aspectRatio: placeholderImageAspectRatio_,
|
|
1803
|
+
autoAdjustAspectRatio: true
|
|
1804
|
+
});
|
|
1805
|
+
}
|
|
1806
|
+
}), _el$3, _co$);
|
|
1807
|
+
$gVhhF$solidjsweb.insert(_el$, $gVhhF$solidjsweb.createComponent((0, $905010a06f9aeae5$export$ebf0b1d4f90c09ae), {
|
|
1808
|
+
displays_: () => display_()?.displays,
|
|
1809
|
+
userWantsExpandedSignal_: useWantsExpandedSignal_,
|
|
1810
|
+
containerWidth_: containerWidth_,
|
|
1811
|
+
animationDuration_: animationDuration_,
|
|
1812
|
+
supportsHover_: supportsHover_,
|
|
1813
|
+
FavoriteButton_: FavoriteButton_,
|
|
1814
|
+
priceFormatting_: priceFormatting_,
|
|
1815
|
+
pseudoRouter_: pseudoRouter_,
|
|
1816
|
+
containerHeight_: containerHeight_
|
|
1817
|
+
}), _el$5, _co$2);
|
|
1818
|
+
$gVhhF$solidjsweb.runHydrationEvents();
|
|
1819
|
+
return _el$;
|
|
1820
|
+
})();
|
|
1791
1821
|
}
|
|
1792
1822
|
$gVhhF$solidjsweb.delegateEvents(["click"]);
|
|
1793
1823
|
|
|
@@ -3451,6 +3481,34 @@ let $0b6e2070a98de347$export$44dad306455dddf;
|
|
|
3451
3481
|
DEPICT_ID["SEARCH_PAGE"] = "depict-search-page";
|
|
3452
3482
|
DEPICT_ID["PLP_CATEGORY"] = "depict-plp-category";
|
|
3453
3483
|
})($0b6e2070a98de347$export$44dad306455dddf || ($0b6e2070a98de347$export$44dad306455dddf = {}));
|
|
3484
|
+
|
|
3485
|
+
/** @jsxImportSource solid-js */
|
|
3486
|
+
|
|
3487
|
+
function $f13855d1b951b24a$export$ebdc3711f7e02ccd(what_to_watch) {
|
|
3488
|
+
const [width, setWidth] = $gVhhF$solidjs.createSignal();
|
|
3489
|
+
const resizeObserver = new ResizeObserver($gVhhF$depictaiutilishared.catchify(records => {
|
|
3490
|
+
for (let j = 0; j < records.length; j++) {
|
|
3491
|
+
const width = records[j].borderBoxSize?.[0]?.inlineSize ?? what_to_watch.getBoundingClientRect().width;
|
|
3492
|
+
setWidth(width);
|
|
3493
|
+
}
|
|
3494
|
+
}));
|
|
3495
|
+
// If we start observing elements before they're in the DOM Chrome (Version 117.0.5938.92 (Official Build) (arm64)) sometimes gives us a resize event with a width of 0 and then doesn't dispatch one with the actual width once it's in the DOM. So we wait until the element is in the DOM before we start observing it.
|
|
3496
|
+
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
3497
|
+
const disconnect = (0, $gVhhF$depictaiutilishared.observer).onexists(what_to_watch, ({
|
|
3498
|
+
element: element
|
|
3499
|
+
}) => requestAnimationFrame($gVhhF$depictaiutilishared.catchify(() => {
|
|
3500
|
+
const current_size = what_to_watch.getBoundingClientRect().width;
|
|
3501
|
+
if (current_size)
|
|
3502
|
+
// If element has size, set signal to that. ResizeObserver only triggers when the content is visible in some cases, but it might already have a size. This reduces size filter expanding animation jank in chrome.
|
|
3503
|
+
setWidth(current_size);
|
|
3504
|
+
resizeObserver.observe(element);
|
|
3505
|
+
})));
|
|
3506
|
+
$gVhhF$solidjs.onCleanup(() => {
|
|
3507
|
+
resizeObserver.disconnect();
|
|
3508
|
+
disconnect();
|
|
3509
|
+
});
|
|
3510
|
+
return width;
|
|
3511
|
+
}
|
|
3454
3512
|
var $0175183387c8923a$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<svg xmlns=http://www.w3.org/2000/svg width=21 height=20 viewBox="0 0 21 20"fill=none><path fill-rule=evenodd d="M9.563 3.438c-3.107 0-5.625 2.518-5.625 5.625s2.518 5.625 5.625 5.625 5.625-2.518 5.625-5.625-2.518-5.625-5.625-5.625zm-7.5 5.625a7.5 7.5 0 1 1 15 0c0 1.733-.588 3.329-1.575 4.599l3.176 3.176a.94.94 0 0 1 0 1.326.94.94 0 0 1-1.326 0l-3.176-3.176a7.47 7.47 0 0 1-4.599 1.575 7.5 7.5 0 0 1-7.5-7.5z"fill=#0f0f0f>`);
|
|
3455
3513
|
function $0175183387c8923a$export$f7658c347b037c3f(props = {}) {
|
|
3456
3514
|
return (() => {
|
package/latest/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
|
|
13
13
|
import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
|
|
14
|
-
export const version = "4.7.
|
|
14
|
+
export const version = "4.7.9";
|
|
15
15
|
/**
|
|
16
16
|
* Just like `useExpandingContainer` except that the children can be reactive solid-js signals, basically solid's JSX.Element instead of our JSX.Element
|
|
17
17
|
*/
|
|
@@ -121,17 +121,7 @@ export function GenericSliderArrowButton(props?: {
|
|
|
121
121
|
width_?: number;
|
|
122
122
|
height_?: number;
|
|
123
123
|
}): SVGElement;
|
|
124
|
-
export function SlidableItems({
|
|
125
|
-
children,
|
|
126
|
-
slider_ref_,
|
|
127
|
-
faded_opacity_,
|
|
128
|
-
mutation_plugins_,
|
|
129
|
-
disable_fading_,
|
|
130
|
-
arrow_width_,
|
|
131
|
-
arrow_height_,
|
|
132
|
-
snapAlign_,
|
|
133
|
-
fadingThreshold_
|
|
134
|
-
}: {
|
|
124
|
+
export function SlidableItems(props: {
|
|
135
125
|
children?: JSX.Element;
|
|
136
126
|
slider_ref_?: (slider: Amazing_Slider) => any;
|
|
137
127
|
faded_opacity_?: number;
|
|
@@ -185,10 +175,6 @@ export function ImagePlaceholder(props: ImagePlaceholderBaseOptions & (ImagePlac
|
|
|
185
175
|
* Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
|
|
186
176
|
*/
|
|
187
177
|
export function media_query_to_accessor(media_query: string): import("solid-js").Accessor<boolean>;
|
|
188
|
-
/**
|
|
189
|
-
* Returns accessor with the size of the provided element, including padding and border (I think)
|
|
190
|
-
*/
|
|
191
|
-
export function make_accurate_width_accessor(what_to_watch: HTMLElement): import("solid-js").Accessor<number | undefined>;
|
|
192
178
|
/**
|
|
193
179
|
* A Placeholder to use instead of some text, while it's loading. This is the inline version, meant to be embedded into sentences (or exist instead of them), etc.
|
|
194
180
|
* If you want a block version, use `ImagePlaceholder` with `width`and `height` set instead.
|
|
@@ -515,6 +501,10 @@ export function CrossIcon(props?: JSX.SvgSVGAttributes<SVGSVGElement>): SVGEleme
|
|
|
515
501
|
* Symbol used to identify the version of a SearchModal function. Values right now: 1 = 1st gen classic modal, 2 = second gen modal
|
|
516
502
|
*/
|
|
517
503
|
export const modalVersionSymbol: unique symbol;
|
|
504
|
+
/**
|
|
505
|
+
* Returns accessor with the size of the provided element, including padding and border (I think)
|
|
506
|
+
*/
|
|
507
|
+
export function make_accurate_width_accessor(what_to_watch: HTMLElement): import("solid-js").Accessor<number | undefined>;
|
|
518
508
|
/**
|
|
519
509
|
* This function is used to determine if the user is trying to open a link in a new tab or window, and we therefore should not single page navigate
|
|
520
510
|
* @param clickEvent The click event that triggered the navigation
|
|
@@ -902,7 +892,7 @@ export function LookCard({
|
|
|
902
892
|
expandedLooksSignal_: Signal<Set<symbol>>;
|
|
903
893
|
priceFormatting_: Accessor<plp_shared_i18n["price_formatting_"]>;
|
|
904
894
|
pseudoRouter_: PseudoRouter;
|
|
905
|
-
}):
|
|
895
|
+
}): JSX.Element;
|
|
906
896
|
/**
|
|
907
897
|
* Render a grid with provided recommendations. displayTransformers will not be applied for this since you yourself provide the displays. Options are reactive.
|
|
908
898
|
*/
|