@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/ES10/index.cjs
CHANGED
|
@@ -104,7 +104,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
|
|
|
104
104
|
$parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
|
|
105
105
|
$parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
|
|
106
106
|
/*! Depict.ai search and product listing SDK */
|
|
107
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.7.
|
|
107
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.7.9";
|
|
108
108
|
function $d6d51b09cb2116a6$export$5bad61ecde080b1f() {
|
|
109
109
|
const {
|
|
110
110
|
collapse: collapse,
|
|
@@ -746,25 +746,27 @@ function $9d19451330d04c3c$export$8be2714ec7f169ee() {
|
|
|
746
746
|
}
|
|
747
747
|
var $ad8ec7729fffeb9c$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div>`),
|
|
748
748
|
$ad8ec7729fffeb9c$var$_tmpl$2 = /*#__PURE__*/$52FdA$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>`);
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
749
|
+
const $ad8ec7729fffeb9c$var$SlidableContext = /*@__PURE__*/$52FdA$solidjs.createContext();
|
|
750
|
+
function $ad8ec7729fffeb9c$export$6649caad96ef8870(props) {
|
|
751
|
+
const {
|
|
752
752
|
slider_ref_: slider_ref_,
|
|
753
753
|
faded_opacity_ = 0.7,
|
|
754
754
|
mutation_plugins_ = [],
|
|
755
755
|
disable_fading_: disable_fading_,
|
|
756
|
-
arrow_width_: arrow_width_,
|
|
757
|
-
arrow_height_: arrow_height_,
|
|
758
756
|
snapAlign_: snapAlign_,
|
|
759
757
|
fadingThreshold_ = 0.96
|
|
760
|
-
} =
|
|
758
|
+
} = props;
|
|
761
759
|
const [hasHydrated, setHasHydrated] = $52FdA$solidjs.createSignal(false);
|
|
762
760
|
$52FdA$solidjs.createEffect(() => setHasHydrated(true));
|
|
763
761
|
const MakeButton = () => (() => {
|
|
764
762
|
var _el$ = $52FdA$solidjsweb.getNextElement($ad8ec7729fffeb9c$var$_tmpl$);
|
|
765
763
|
$52FdA$solidjsweb.insert(_el$, $52FdA$solidjsweb.createComponent((0, $9d19451330d04c3c$export$8be2714ec7f169ee), {
|
|
766
|
-
height_
|
|
767
|
-
|
|
764
|
+
get height_() {
|
|
765
|
+
return props.arrow_height_;
|
|
766
|
+
},
|
|
767
|
+
get width_() {
|
|
768
|
+
return props.arrow_width_;
|
|
769
|
+
}
|
|
768
770
|
}));
|
|
769
771
|
return _el$;
|
|
770
772
|
})();
|
|
@@ -784,12 +786,13 @@ function $ad8ec7729fffeb9c$export$6649caad96ef8870(_ref) {
|
|
|
784
786
|
_el$5 = _el$4.nextSibling;
|
|
785
787
|
$52FdA$solidjsweb.insert(_el$3, $52FdA$solidjsweb.createComponent(MakeButton, {}));
|
|
786
788
|
$52FdA$solidjsweb.insert(_el$4, $52FdA$solidjsweb.createComponent(MakeButton, {}));
|
|
787
|
-
$52FdA$solidjsweb.insert(_el$5, children);
|
|
789
|
+
$52FdA$solidjsweb.insert(_el$5, () => props.children);
|
|
788
790
|
return _el$2;
|
|
789
791
|
})();
|
|
790
792
|
},
|
|
791
793
|
get children() {
|
|
792
794
|
return (() => {
|
|
795
|
+
const [intersectionEntries_, setIntersectionEntries] = $52FdA$solidjs.createSignal([]);
|
|
793
796
|
const fading_plugin = disable_fading_ ? undefined : $52FdA$depictaiutilishared.slider_fading_factory({
|
|
794
797
|
threshold_: fadingThreshold_,
|
|
795
798
|
faded_opacity_: faded_opacity_
|
|
@@ -802,9 +805,17 @@ function $ad8ec7729fffeb9c$export$6649caad96ef8870(_ref) {
|
|
|
802
805
|
constructor_plugins: [$52FdA$depictaiutilishared.slider_snap_css(0, {
|
|
803
806
|
align: snapAlign_
|
|
804
807
|
}).constructor_plugin, ...(fading_plugin ? [fading_plugin.constructor_plugin] : [])],
|
|
805
|
-
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_]
|
|
808
|
+
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_, entries => setIntersectionEntries(entries)]
|
|
806
809
|
});
|
|
807
|
-
$52FdA$solidjsweb.insert(slider.insert_here,
|
|
810
|
+
$52FdA$solidjsweb.insert(slider.insert_here, () => $52FdA$solidjsweb.createComponent($ad8ec7729fffeb9c$var$SlidableContext.Provider, {
|
|
811
|
+
value: {
|
|
812
|
+
slider_: slider,
|
|
813
|
+
intersectionEntries_: intersectionEntries_
|
|
814
|
+
},
|
|
815
|
+
get children() {
|
|
816
|
+
return props.children;
|
|
817
|
+
}
|
|
818
|
+
}));
|
|
808
819
|
$52FdA$solidjs.onCleanup(() => slider.observer.disconnect());
|
|
809
820
|
slider_ref_ === null || slider_ref_ === void 0 || slider_ref_(slider);
|
|
810
821
|
return slider.container;
|
|
@@ -812,6 +823,9 @@ function $ad8ec7729fffeb9c$export$6649caad96ef8870(_ref) {
|
|
|
812
823
|
}
|
|
813
824
|
});
|
|
814
825
|
}
|
|
826
|
+
function $ad8ec7729fffeb9c$export$eaa625fb39439e37() {
|
|
827
|
+
return $52FdA$solidjs.useContext($ad8ec7729fffeb9c$var$SlidableContext);
|
|
828
|
+
}
|
|
815
829
|
var $236a257ee52e5414$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<h2 class=recs-title>`);
|
|
816
830
|
function $236a257ee52e5414$export$d41d19e89346fa2(_ref) {
|
|
817
831
|
let {
|
|
@@ -995,38 +1009,6 @@ function $3e17e871e9d0911d$export$d9f36cf74e24d595(media_query) {
|
|
|
995
1009
|
}).remove);
|
|
996
1010
|
return signal[0];
|
|
997
1011
|
}
|
|
998
|
-
|
|
999
|
-
/** @jsxImportSource solid-js */
|
|
1000
|
-
|
|
1001
|
-
function $c387d7f1d9fb66c0$export$ebdc3711f7e02ccd(what_to_watch) {
|
|
1002
|
-
const [width, setWidth] = $52FdA$solidjs.createSignal();
|
|
1003
|
-
const resizeObserver = new ResizeObserver($52FdA$depictaiutilishared.catchify(records => {
|
|
1004
|
-
for (let j = 0; j < records.length; j++) {
|
|
1005
|
-
var _records$j$borderBoxS, _records$j$borderBoxS2, _records$j$borderBoxS3;
|
|
1006
|
-
const width = (_records$j$borderBoxS = (_records$j$borderBoxS2 = records[j].borderBoxSize) === null || _records$j$borderBoxS2 === void 0 ? void 0 : (_records$j$borderBoxS3 = _records$j$borderBoxS2[0]) === null || _records$j$borderBoxS3 === void 0 ? void 0 : _records$j$borderBoxS3.inlineSize) !== null && _records$j$borderBoxS !== void 0 ? _records$j$borderBoxS : what_to_watch.getBoundingClientRect().width;
|
|
1007
|
-
setWidth(width);
|
|
1008
|
-
}
|
|
1009
|
-
}));
|
|
1010
|
-
// 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.
|
|
1011
|
-
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
1012
|
-
const disconnect = (0, $52FdA$depictaiutilishared.observer).onexists(what_to_watch, _ref => {
|
|
1013
|
-
let {
|
|
1014
|
-
element: element
|
|
1015
|
-
} = _ref;
|
|
1016
|
-
return requestAnimationFrame($52FdA$depictaiutilishared.catchify(() => {
|
|
1017
|
-
const current_size = what_to_watch.getBoundingClientRect().width;
|
|
1018
|
-
if (current_size)
|
|
1019
|
-
// 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.
|
|
1020
|
-
setWidth(current_size);
|
|
1021
|
-
resizeObserver.observe(element);
|
|
1022
|
-
}));
|
|
1023
|
-
});
|
|
1024
|
-
$52FdA$solidjs.onCleanup(() => {
|
|
1025
|
-
resizeObserver.disconnect();
|
|
1026
|
-
disconnect();
|
|
1027
|
-
});
|
|
1028
|
-
return width;
|
|
1029
|
-
}
|
|
1030
1012
|
function $a7f7d416e6f61504$export$89c6019e4baa40b1(props) {
|
|
1031
1013
|
const style = $52FdA$solidjs.createMemo(() => {
|
|
1032
1014
|
const {
|
|
@@ -1190,9 +1172,10 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
|
1190
1172
|
});
|
|
1191
1173
|
// 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
|
|
1192
1174
|
// Happened on singular, they have some weird observer (+we also have one but ours is at least 3x more efficient)
|
|
1193
|
-
const executeWhenIdleBatched = fn => {
|
|
1175
|
+
const executeWhenIdleBatched = (fn, isSizesUpdate) => {
|
|
1194
1176
|
if (typeof requestIdleCallback !== "function") return setTimeout(fn); // Old browsers don't get optimisation
|
|
1195
|
-
if ($52FdA$solidjs.untrack(isPrioritisedImage)) return fn(); // If we're one of the first 8 images, execute the callbacks immediately
|
|
1177
|
+
if ((!isSizesUpdate || !sizeSetFastPath) && $52FdA$solidjs.untrack(isPrioritisedImage)) return fn(); // If we're one of the first 8 images, execute the callbacks immediately (improves lighthouse metrics)
|
|
1178
|
+
// 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)
|
|
1196
1179
|
const existingStack = listingContext === null || listingContext === void 0 ? void 0 : listingContext[$858fdcf73148519f$var$onIdleFunctionsSymbol];
|
|
1197
1180
|
if (existingStack) return existingStack.add(fn);
|
|
1198
1181
|
const newStack = new Set([fn]);
|
|
@@ -1277,10 +1260,11 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
|
1277
1260
|
// This greatly improves performance when loading (more) products
|
|
1278
1261
|
// See https://depictaiworkspace.slack.com/archives/C05NJ0K3WRL/p1698220617663139
|
|
1279
1262
|
timeoutSet = true; // Important to set timeoutSet before the call to executeWhenIdleBatched since if this is an important image executeWhenIdleBatched will execute fn immediately
|
|
1280
|
-
executeWhenIdleBatched(handler);
|
|
1263
|
+
executeWhenIdleBatched(handler, true);
|
|
1281
1264
|
});
|
|
1265
|
+
const dontLoadImageYet = $52FdA$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
|
|
1282
1266
|
$52FdA$solidjs.createEffect(() => {
|
|
1283
|
-
if (
|
|
1267
|
+
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
|
|
1284
1268
|
Object.assign(img, src_options());
|
|
1285
1269
|
// Add to DOM once decoded to not require/block any paints before image has completed loading and avoid showing broken image symbol
|
|
1286
1270
|
// We can do this because there has to be a container around us giving us a size
|
|
@@ -1296,7 +1280,7 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
|
1296
1280
|
img.decode().catch(e => $52FdA$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"
|
|
1297
1281
|
.then(async () => {
|
|
1298
1282
|
// Also wait with inserting image (i.e. paint) until browser is idle
|
|
1299
|
-
await new Promise(r => executeWhenIdleBatched(r));
|
|
1283
|
+
await new Promise(r => executeWhenIdleBatched(r, false));
|
|
1300
1284
|
if (gotCleanedUp) return;
|
|
1301
1285
|
setHasDecoded(true);
|
|
1302
1286
|
hasDecodedFastPath = true;
|
|
@@ -1650,7 +1634,7 @@ var $dfa95866b27a2a53$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div
|
|
|
1650
1634
|
let $dfa95866b27a2a53$var$cachedValue;
|
|
1651
1635
|
async function $dfa95866b27a2a53$export$7b9a0e99f0aeb2f3() {
|
|
1652
1636
|
if ($dfa95866b27a2a53$var$cachedValue != undefined) return $dfa95866b27a2a53$var$cachedValue;
|
|
1653
|
-
return $dfa95866b27a2a53$var$cachedValue =
|
|
1637
|
+
return $dfa95866b27a2a53$var$cachedValue = $dfa95866b27a2a53$var$checkIfIsAffectedByChromeBug326498383();
|
|
1654
1638
|
}
|
|
1655
1639
|
async function $dfa95866b27a2a53$var$checkIfIsAffectedByChromeBug326498383() {
|
|
1656
1640
|
let isAffected = true;
|
|
@@ -1663,7 +1647,7 @@ async function $dfa95866b27a2a53$var$checkIfIsAffectedByChromeBug326498383() {
|
|
|
1663
1647
|
setTimeout($52FdA$depictaiutilishared.catchify(() => {
|
|
1664
1648
|
r();
|
|
1665
1649
|
div.remove();
|
|
1666
|
-
}),
|
|
1650
|
+
}), 500);
|
|
1667
1651
|
});
|
|
1668
1652
|
const {
|
|
1669
1653
|
style: style
|
|
@@ -1706,7 +1690,8 @@ function $e0b3f1f332b6863b$export$ebf0b1d4f90c09ae(_ref) {
|
|
|
1706
1690
|
animationDuration_: animationDuration_,
|
|
1707
1691
|
supportsHover_: supportsHover_,
|
|
1708
1692
|
priceFormatting_: priceFormatting_,
|
|
1709
|
-
pseudoRouter_: pseudoRouter_
|
|
1693
|
+
pseudoRouter_: pseudoRouter_,
|
|
1694
|
+
containerHeight_: containerHeight_
|
|
1710
1695
|
} = _ref;
|
|
1711
1696
|
let isAffectedByChromeBug = false;
|
|
1712
1697
|
// If the user requests the drawer to be expanded or not
|
|
@@ -1726,6 +1711,8 @@ function $e0b3f1f332b6863b$export$ebf0b1d4f90c09ae(_ref) {
|
|
|
1726
1711
|
get children() {
|
|
1727
1712
|
var _el$ = $52FdA$solidjsweb.getNextElement($e0b3f1f332b6863b$var$_tmpl$),
|
|
1728
1713
|
_el$2 = _el$.firstChild;
|
|
1714
|
+
$52FdA$solidjsweb.addEventListener(_el$2, "mouseleave", $52FdA$depictaiutilishared.catchify(() => supportsHover_() && setUserWantsExpanded(false)));
|
|
1715
|
+
$52FdA$solidjsweb.addEventListener(_el$2, "mouseenter", $52FdA$depictaiutilishared.catchify(() => supportsHover_() && setUserWantsExpanded(true)));
|
|
1729
1716
|
$52FdA$solidjsweb.use(el => $52FdA$solidjs.createEffect(() => {
|
|
1730
1717
|
if (userWantsExpanded()) return;
|
|
1731
1718
|
if (isAffectedByChromeBug) {
|
|
@@ -1737,22 +1724,6 @@ function $e0b3f1f332b6863b$export$ebf0b1d4f90c09ae(_ref) {
|
|
|
1737
1724
|
behavior: "smooth"
|
|
1738
1725
|
});
|
|
1739
1726
|
}), _el$2);
|
|
1740
|
-
$52FdA$solidjsweb.spread(_el$2, $52FdA$solidjsweb.mergeProps({
|
|
1741
|
-
get classList() {
|
|
1742
|
-
return {
|
|
1743
|
-
expanded: userWantsExpanded(),
|
|
1744
|
-
"resting-fully-expanded": !getSecondPartAnimationRunning() && userWantsExpanded()
|
|
1745
|
-
};
|
|
1746
|
-
},
|
|
1747
|
-
get onMouseEnter() {
|
|
1748
|
-
return $52FdA$depictaiutilishared.catchify(() => supportsHover_() && setUserWantsExpanded(true));
|
|
1749
|
-
},
|
|
1750
|
-
get onMouseLeave() {
|
|
1751
|
-
return $52FdA$depictaiutilishared.catchify(() => supportsHover_() && setUserWantsExpanded(false));
|
|
1752
|
-
}
|
|
1753
|
-
}, () => displays_() && {
|
|
1754
|
-
style: "--look-card-width:".concat(containerWidth_(), "px;--look-item-height:").concat(lookItemHeight() || 200, "px")
|
|
1755
|
-
}), false, true);
|
|
1756
1727
|
$52FdA$solidjsweb.insert(_el$2, $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Index), {
|
|
1757
1728
|
get each() {
|
|
1758
1729
|
return displays_() || Array.from({
|
|
@@ -1777,7 +1748,21 @@ function $e0b3f1f332b6863b$export$ebf0b1d4f90c09ae(_ref) {
|
|
|
1777
1748
|
});
|
|
1778
1749
|
}
|
|
1779
1750
|
}));
|
|
1780
|
-
$52FdA$solidjsweb.
|
|
1751
|
+
$52FdA$solidjsweb.effect(_p$ => {
|
|
1752
|
+
var _v$ = !!userWantsExpanded(),
|
|
1753
|
+
_v$2 = !!(!getSecondPartAnimationRunning() && userWantsExpanded()),
|
|
1754
|
+
_v$3 = displays_() &&
|
|
1755
|
+
// The styling is written like this to eke out animation smoothness on low CPU devices, git blame for previous, more readable versions.
|
|
1756
|
+
"--look-card-width:".concat(containerWidth_(), "px;--look-card-height:").concat(containerHeight_(), "px;--look-item-height:").concat(lookItemHeight() || 200, "px");
|
|
1757
|
+
_v$ !== _p$.e && _el$2.classList.toggle("expanded", _p$.e = _v$);
|
|
1758
|
+
_v$2 !== _p$.t && _el$2.classList.toggle("resting-fully-expanded", _p$.t = _v$2);
|
|
1759
|
+
_p$.a = $52FdA$solidjsweb.style(_el$2, _v$3, _p$.a);
|
|
1760
|
+
return _p$;
|
|
1761
|
+
}, {
|
|
1762
|
+
e: undefined,
|
|
1763
|
+
t: undefined,
|
|
1764
|
+
a: undefined
|
|
1765
|
+
});
|
|
1781
1766
|
return _el$;
|
|
1782
1767
|
}
|
|
1783
1768
|
});
|
|
@@ -1804,7 +1789,7 @@ function $e0b3f1f332b6863b$var$scrollingFunctionForChrome(element, targetScrollY
|
|
|
1804
1789
|
// Bootstrap our animation - it will get called right before next frame shall be rendered.
|
|
1805
1790
|
requestAnimationFrame(step);
|
|
1806
1791
|
}
|
|
1807
|
-
var $47e3c3102c78121b$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=look-card
|
|
1792
|
+
var $47e3c3102c78121b$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=look-card><!$><!/><!$><!/>`);
|
|
1808
1793
|
function $47e3c3102c78121b$export$44809a8a3e867e30(_ref) {
|
|
1809
1794
|
let {
|
|
1810
1795
|
display_: display_,
|
|
@@ -1815,31 +1800,23 @@ function $47e3c3102c78121b$export$44809a8a3e867e30(_ref) {
|
|
|
1815
1800
|
priceFormatting_: priceFormatting_,
|
|
1816
1801
|
pseudoRouter_: pseudoRouter_
|
|
1817
1802
|
} = _ref;
|
|
1803
|
+
let container;
|
|
1818
1804
|
const useWantsExpandedSignal_ = $52FdA$solidjs.createSignal(false);
|
|
1819
1805
|
const [userWantsExpanded, setUserWantsExpanded] = useWantsExpandedSignal_;
|
|
1820
1806
|
const supportsHover_ = $3e17e871e9d0911d$export$d9f36cf74e24d595("(hover: hover) and (pointer: fine)");
|
|
1821
1807
|
const us = Symbol("look");
|
|
1822
|
-
const
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
target: target
|
|
1827
|
-
} = _ref2;
|
|
1828
|
-
return setUserWantsExpanded(prev => !prev);
|
|
1829
|
-
}), true);
|
|
1830
|
-
$52FdA$solidjsweb.effect(() => _el$.classList.toggle("placeholder", !display_()));
|
|
1831
|
-
$52FdA$solidjsweb.runHydrationEvents();
|
|
1832
|
-
return _el$;
|
|
1833
|
-
})();
|
|
1834
|
-
const containerWidth_ = $c387d7f1d9fb66c0$export$ebdc3711f7e02ccd(container);
|
|
1835
|
-
const clickHandler = $52FdA$depictaiutilishared.catchify(_ref3 => {
|
|
1808
|
+
const index = $b54645378dfc7280$export$e3faf4d95300054f();
|
|
1809
|
+
const [containerWidth_, setContainerWidth] = $52FdA$solidjs.createSignal();
|
|
1810
|
+
const [containerHeight_, setContainerHeight] = $52FdA$solidjs.createSignal();
|
|
1811
|
+
const clickHandler = $52FdA$depictaiutilishared.catchify(_ref2 => {
|
|
1836
1812
|
let {
|
|
1837
1813
|
target: target
|
|
1838
|
-
} =
|
|
1814
|
+
} = _ref2;
|
|
1839
1815
|
if (target !== container && !container.contains(target))
|
|
1840
1816
|
// When clicking outside the look, close it
|
|
1841
1817
|
setUserWantsExpanded(false);
|
|
1842
1818
|
});
|
|
1819
|
+
const slidableInformation = $ad8ec7729fffeb9c$export$eaa625fb39439e37();
|
|
1843
1820
|
addEventListener("click", clickHandler);
|
|
1844
1821
|
$52FdA$solidjs.onCleanup(() => removeEventListener("click", clickHandler));
|
|
1845
1822
|
$52FdA$solidjs.createEffect(() => setExpandedLooks(prev => {
|
|
@@ -1851,41 +1828,87 @@ function $47e3c3102c78121b$export$44809a8a3e867e30(_ref) {
|
|
|
1851
1828
|
} else prev.delete(us);
|
|
1852
1829
|
return prev;
|
|
1853
1830
|
}));
|
|
1831
|
+
if (slidableInformation) {
|
|
1832
|
+
const ourVisiblityInSlider = $52FdA$solidjs.createMemo(() => {
|
|
1833
|
+
var _slidableInformation$, _slidableInformation$2;
|
|
1834
|
+
const currentCard = index === null || index === void 0 ? void 0 : index();
|
|
1835
|
+
if (isNaN(currentCard)) return;
|
|
1836
|
+
slidableInformation === null || slidableInformation === void 0 || slidableInformation.intersectionEntries_();
|
|
1837
|
+
return slidableInformation === null || slidableInformation === void 0 ? void 0 : (_slidableInformation$ = slidableInformation.slider_.intersecting_items_object) === null || _slidableInformation$ === void 0 ? void 0 : (_slidableInformation$2 = _slidableInformation$[currentCard]) === null || _slidableInformation$2 === void 0 ? void 0 : _slidableInformation$2.intersectionRatio;
|
|
1838
|
+
});
|
|
1839
|
+
$52FdA$solidjs.createEffect(prevVisibility => {
|
|
1840
|
+
// Have memo -> effect setup for diffing, so we do as little work as possible in unrelated cards
|
|
1841
|
+
// as number is safe because undefined and NaN are both not < 0.5
|
|
1842
|
+
const visibility = ourVisiblityInSlider();
|
|
1843
|
+
if (visibility < 0.5 && (isNaN(prevVisibility) || visibility - prevVisibility < 0))
|
|
1844
|
+
// When sliding this card completely into the background, collapse it
|
|
1845
|
+
// 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
|
|
1846
|
+
setUserWantsExpanded(false);
|
|
1847
|
+
return visibility;
|
|
1848
|
+
});
|
|
1849
|
+
}
|
|
1854
1850
|
// Close us if another look expands
|
|
1855
1851
|
$52FdA$solidjs.createEffect(() => !expandedLooks_().has(us) && setUserWantsExpanded(false));
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1852
|
+
return (() => {
|
|
1853
|
+
var _el$ = $52FdA$solidjsweb.getNextElement($47e3c3102c78121b$var$_tmpl$),
|
|
1854
|
+
_el$2 = _el$.firstChild,
|
|
1855
|
+
[_el$3, _co$] = $52FdA$solidjsweb.getNextMarker(_el$2.nextSibling),
|
|
1856
|
+
_el$4 = _el$3.nextSibling,
|
|
1857
|
+
[_el$5, _co$2] = $52FdA$solidjsweb.getNextMarker(_el$4.nextSibling);
|
|
1858
|
+
$52FdA$solidjsweb.addEventListener(_el$, "click", $52FdA$depictaiutilishared.catchify(() => setUserWantsExpanded(prev => !prev)), true);
|
|
1859
|
+
$52FdA$solidjsweb.use(el => {
|
|
1860
|
+
container = el;
|
|
1861
|
+
const ro = new ResizeObserver($52FdA$depictaiutilishared.catchify(records => {
|
|
1862
|
+
const last = records.at(-1);
|
|
1863
|
+
if (!last) return;
|
|
1864
|
+
const {
|
|
1865
|
+
width: width,
|
|
1866
|
+
height: height
|
|
1867
|
+
} = last.contentRect;
|
|
1868
|
+
setContainerWidth(width);
|
|
1869
|
+
setContainerHeight(height);
|
|
1870
|
+
}));
|
|
1871
|
+
ro.observe(el);
|
|
1872
|
+
$52FdA$solidjs.onCleanup(() => ro.disconnect());
|
|
1873
|
+
}, _el$);
|
|
1874
|
+
_el$.classList.toggle("placeholder", !!!display_);
|
|
1875
|
+
$52FdA$solidjsweb.insert(_el$, $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
|
|
1876
|
+
get when() {
|
|
1877
|
+
return display_();
|
|
1878
|
+
},
|
|
1879
|
+
get fallback() {
|
|
1880
|
+
return $52FdA$solidjsweb.createComponent((0, $b8a8d61b3ec5f5ac$export$3f37af283f8fb843), {
|
|
1881
|
+
aspectRatio: "var(".concat((0, $c0cf6af094336798$export$8a2234b5b1a5ebd4), ", ").concat(placeholderImageAspectRatio_, ")")
|
|
1882
|
+
});
|
|
1883
|
+
},
|
|
1884
|
+
get children() {
|
|
1885
|
+
return $52FdA$solidjsweb.createComponent((0, $f3db423dc84bc35d$export$9d4a4b669b1929ab), {
|
|
1886
|
+
get src() {
|
|
1887
|
+
var _display_, _display_$image_urls;
|
|
1888
|
+
return (_display_ = display_()) === null || _display_ === void 0 ? void 0 : (_display_$image_urls = _display_.image_urls) === null || _display_$image_urls === void 0 ? void 0 : _display_$image_urls[0];
|
|
1889
|
+
},
|
|
1890
|
+
aspectRatio: placeholderImageAspectRatio_,
|
|
1891
|
+
autoAdjustAspectRatio: true
|
|
1892
|
+
});
|
|
1893
|
+
}
|
|
1894
|
+
}), _el$3, _co$);
|
|
1895
|
+
$52FdA$solidjsweb.insert(_el$, $52FdA$solidjsweb.createComponent((0, $e0b3f1f332b6863b$export$ebf0b1d4f90c09ae), {
|
|
1896
|
+
displays_: () => {
|
|
1897
|
+
var _display_2;
|
|
1898
|
+
return (_display_2 = display_()) === null || _display_2 === void 0 ? void 0 : _display_2.displays;
|
|
1899
|
+
},
|
|
1900
|
+
userWantsExpandedSignal_: useWantsExpandedSignal_,
|
|
1901
|
+
containerWidth_: containerWidth_,
|
|
1902
|
+
animationDuration_: animationDuration_,
|
|
1903
|
+
supportsHover_: supportsHover_,
|
|
1904
|
+
FavoriteButton_: FavoriteButton_,
|
|
1905
|
+
priceFormatting_: priceFormatting_,
|
|
1906
|
+
pseudoRouter_: pseudoRouter_,
|
|
1907
|
+
containerHeight_: containerHeight_
|
|
1908
|
+
}), _el$5, _co$2);
|
|
1909
|
+
$52FdA$solidjsweb.runHydrationEvents();
|
|
1910
|
+
return _el$;
|
|
1911
|
+
})();
|
|
1889
1912
|
}
|
|
1890
1913
|
$52FdA$solidjsweb.delegateEvents(["click"]);
|
|
1891
1914
|
|
|
@@ -3648,6 +3671,38 @@ let $c95c6dd9e93acd82$export$44dad306455dddf;
|
|
|
3648
3671
|
DEPICT_ID["SEARCH_PAGE"] = "depict-search-page";
|
|
3649
3672
|
DEPICT_ID["PLP_CATEGORY"] = "depict-plp-category";
|
|
3650
3673
|
})($c95c6dd9e93acd82$export$44dad306455dddf || ($c95c6dd9e93acd82$export$44dad306455dddf = {}));
|
|
3674
|
+
|
|
3675
|
+
/** @jsxImportSource solid-js */
|
|
3676
|
+
|
|
3677
|
+
function $c387d7f1d9fb66c0$export$ebdc3711f7e02ccd(what_to_watch) {
|
|
3678
|
+
const [width, setWidth] = $52FdA$solidjs.createSignal();
|
|
3679
|
+
const resizeObserver = new ResizeObserver($52FdA$depictaiutilishared.catchify(records => {
|
|
3680
|
+
for (let j = 0; j < records.length; j++) {
|
|
3681
|
+
var _records$j$borderBoxS, _records$j$borderBoxS2, _records$j$borderBoxS3;
|
|
3682
|
+
const width = (_records$j$borderBoxS = (_records$j$borderBoxS2 = records[j].borderBoxSize) === null || _records$j$borderBoxS2 === void 0 ? void 0 : (_records$j$borderBoxS3 = _records$j$borderBoxS2[0]) === null || _records$j$borderBoxS3 === void 0 ? void 0 : _records$j$borderBoxS3.inlineSize) !== null && _records$j$borderBoxS !== void 0 ? _records$j$borderBoxS : what_to_watch.getBoundingClientRect().width;
|
|
3683
|
+
setWidth(width);
|
|
3684
|
+
}
|
|
3685
|
+
}));
|
|
3686
|
+
// 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.
|
|
3687
|
+
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
3688
|
+
const disconnect = (0, $52FdA$depictaiutilishared.observer).onexists(what_to_watch, _ref => {
|
|
3689
|
+
let {
|
|
3690
|
+
element: element
|
|
3691
|
+
} = _ref;
|
|
3692
|
+
return requestAnimationFrame($52FdA$depictaiutilishared.catchify(() => {
|
|
3693
|
+
const current_size = what_to_watch.getBoundingClientRect().width;
|
|
3694
|
+
if (current_size)
|
|
3695
|
+
// 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.
|
|
3696
|
+
setWidth(current_size);
|
|
3697
|
+
resizeObserver.observe(element);
|
|
3698
|
+
}));
|
|
3699
|
+
});
|
|
3700
|
+
$52FdA$solidjs.onCleanup(() => {
|
|
3701
|
+
resizeObserver.disconnect();
|
|
3702
|
+
disconnect();
|
|
3703
|
+
});
|
|
3704
|
+
return width;
|
|
3705
|
+
}
|
|
3651
3706
|
var $34934309832515dc$var$_tmpl$ = /*#__PURE__*/$52FdA$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>`);
|
|
3652
3707
|
function $34934309832515dc$export$f7658c347b037c3f() {
|
|
3653
3708
|
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
package/ES10/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
|
*/
|