@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/server/ES10/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { createStore as $b8hua$createStore, reconcile as $b8hua$reconcile } from
|
|
|
10
10
|
/*! Depict.ai search and product listing SDK */
|
|
11
11
|
import { register_es_version } from "../../multi_import_deduplicator.mjs";
|
|
12
12
|
register_es_version("ui", "ES10");
|
|
13
|
-
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.7.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.7.9";
|
|
14
14
|
function $8e8b179489080711$export$5bad61ecde080b1f() {
|
|
15
15
|
const {
|
|
16
16
|
collapse: collapse,
|
|
@@ -593,23 +593,25 @@ function $ca6ab5f08bd28bca$export$8be2714ec7f169ee() {
|
|
|
593
593
|
}
|
|
594
594
|
var $002f09d00aac50b2$var$_tmpl$ = ["<div", ">", "</div>"],
|
|
595
595
|
$002f09d00aac50b2$var$_tmpl$2 = ["<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">', "</div></div>"];
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
596
|
+
const $002f09d00aac50b2$var$SlidableContext = /*@__PURE__*/$b8hua$createContext();
|
|
597
|
+
function $002f09d00aac50b2$export$6649caad96ef8870(props) {
|
|
598
|
+
const {
|
|
599
599
|
slider_ref_: slider_ref_,
|
|
600
600
|
faded_opacity_ = 0.7,
|
|
601
601
|
mutation_plugins_ = [],
|
|
602
602
|
disable_fading_: disable_fading_,
|
|
603
|
-
arrow_width_: arrow_width_,
|
|
604
|
-
arrow_height_: arrow_height_,
|
|
605
603
|
snapAlign_: snapAlign_,
|
|
606
604
|
fadingThreshold_ = 0.96
|
|
607
|
-
} =
|
|
605
|
+
} = props;
|
|
608
606
|
const [hasHydrated, setHasHydrated] = $b8hua$createSignal(false);
|
|
609
607
|
$b8hua$createEffect(() => setHasHydrated(true));
|
|
610
608
|
const MakeButton = () => $b8hua$ssr($002f09d00aac50b2$var$_tmpl$, $b8hua$ssrHydrationKey(), $b8hua$escape($b8hua$createComponent((0, $ca6ab5f08bd28bca$export$8be2714ec7f169ee), {
|
|
611
|
-
height_
|
|
612
|
-
|
|
609
|
+
get height_() {
|
|
610
|
+
return props.arrow_height_;
|
|
611
|
+
},
|
|
612
|
+
get width_() {
|
|
613
|
+
return props.arrow_width_;
|
|
614
|
+
}
|
|
613
615
|
})));
|
|
614
616
|
// To support SSR it would be very hard to make Amazing_Slider compatible with solid's SSR because it would have to be rewritten in a more JSX way
|
|
615
617
|
// However, all it would do on the server (when used by SlidableItems) is creating the following 5 div elements
|
|
@@ -620,10 +622,11 @@ function $002f09d00aac50b2$export$6649caad96ef8870(_ref) {
|
|
|
620
622
|
return hasHydrated() && !(0, $b8hua$isServer);
|
|
621
623
|
},
|
|
622
624
|
get fallback() {
|
|
623
|
-
return $b8hua$ssr($002f09d00aac50b2$var$_tmpl$2, $b8hua$ssrHydrationKey(), $b8hua$escape($b8hua$createComponent(MakeButton, {})), $b8hua$escape($b8hua$createComponent(MakeButton, {})), $b8hua$escape(children));
|
|
625
|
+
return $b8hua$ssr($002f09d00aac50b2$var$_tmpl$2, $b8hua$ssrHydrationKey(), $b8hua$escape($b8hua$createComponent(MakeButton, {})), $b8hua$escape($b8hua$createComponent(MakeButton, {})), $b8hua$escape(props.children));
|
|
624
626
|
},
|
|
625
627
|
get children() {
|
|
626
628
|
return (() => {
|
|
629
|
+
const [intersectionEntries_, setIntersectionEntries] = $b8hua$createSignal([]);
|
|
627
630
|
const fading_plugin = disable_fading_ ? undefined : $b8hua$slider_fading_factory({
|
|
628
631
|
threshold_: fadingThreshold_,
|
|
629
632
|
faded_opacity_: faded_opacity_
|
|
@@ -636,9 +639,17 @@ function $002f09d00aac50b2$export$6649caad96ef8870(_ref) {
|
|
|
636
639
|
constructor_plugins: [$b8hua$slider_snap_css(0, {
|
|
637
640
|
align: snapAlign_
|
|
638
641
|
}).constructor_plugin, ...(fading_plugin ? [fading_plugin.constructor_plugin] : [])],
|
|
639
|
-
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_]
|
|
642
|
+
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_, entries => setIntersectionEntries(entries)]
|
|
640
643
|
});
|
|
641
|
-
$b8hua$insert(slider.insert_here,
|
|
644
|
+
$b8hua$insert(slider.insert_here, () => $b8hua$createComponent($002f09d00aac50b2$var$SlidableContext.Provider, {
|
|
645
|
+
value: {
|
|
646
|
+
slider_: slider,
|
|
647
|
+
intersectionEntries_: intersectionEntries_
|
|
648
|
+
},
|
|
649
|
+
get children() {
|
|
650
|
+
return props.children;
|
|
651
|
+
}
|
|
652
|
+
}));
|
|
642
653
|
$b8hua$onCleanup(() => slider.observer.disconnect());
|
|
643
654
|
slider_ref_ === null || slider_ref_ === void 0 || slider_ref_(slider);
|
|
644
655
|
return slider.container;
|
|
@@ -646,6 +657,9 @@ function $002f09d00aac50b2$export$6649caad96ef8870(_ref) {
|
|
|
646
657
|
}
|
|
647
658
|
});
|
|
648
659
|
}
|
|
660
|
+
function $002f09d00aac50b2$export$eaa625fb39439e37() {
|
|
661
|
+
return $b8hua$useContext($002f09d00aac50b2$var$SlidableContext);
|
|
662
|
+
}
|
|
649
663
|
var $39ddb986053fb759$var$_tmpl$ = ["<h2", ' class="recs-title">', "</h2>"];
|
|
650
664
|
function $39ddb986053fb759$export$d41d19e89346fa2(_ref) {
|
|
651
665
|
let {
|
|
@@ -814,38 +828,6 @@ function $00a5b94f0c11efbb$export$d9f36cf74e24d595(media_query) {
|
|
|
814
828
|
}).remove);
|
|
815
829
|
return signal[0];
|
|
816
830
|
}
|
|
817
|
-
|
|
818
|
-
/** @jsxImportSource solid-js */
|
|
819
|
-
|
|
820
|
-
function $fc830a7ee59416ef$export$ebdc3711f7e02ccd(what_to_watch) {
|
|
821
|
-
const [width, setWidth] = $b8hua$createSignal();
|
|
822
|
-
const resizeObserver = new ResizeObserver($b8hua$catchify(records => {
|
|
823
|
-
for (let j = 0; j < records.length; j++) {
|
|
824
|
-
var _records$j$borderBoxS, _records$j$borderBoxS2, _records$j$borderBoxS3;
|
|
825
|
-
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;
|
|
826
|
-
setWidth(width);
|
|
827
|
-
}
|
|
828
|
-
}));
|
|
829
|
-
// 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.
|
|
830
|
-
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
831
|
-
const disconnect = (0, $b8hua$observer).onexists(what_to_watch, _ref => {
|
|
832
|
-
let {
|
|
833
|
-
element: element
|
|
834
|
-
} = _ref;
|
|
835
|
-
return requestAnimationFrame($b8hua$catchify(() => {
|
|
836
|
-
const current_size = what_to_watch.getBoundingClientRect().width;
|
|
837
|
-
if (current_size)
|
|
838
|
-
// 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.
|
|
839
|
-
setWidth(current_size);
|
|
840
|
-
resizeObserver.observe(element);
|
|
841
|
-
}));
|
|
842
|
-
});
|
|
843
|
-
$b8hua$onCleanup(() => {
|
|
844
|
-
resizeObserver.disconnect();
|
|
845
|
-
disconnect();
|
|
846
|
-
});
|
|
847
|
-
return width;
|
|
848
|
-
}
|
|
849
831
|
function $ceafb6fb91c6f394$export$89c6019e4baa40b1(props) {
|
|
850
832
|
const style = $b8hua$createMemo(() => {
|
|
851
833
|
const {
|
|
@@ -984,9 +966,10 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
|
984
966
|
});
|
|
985
967
|
// 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
|
|
986
968
|
// Happened on singular, they have some weird observer (+we also have one but ours is at least 3x more efficient)
|
|
987
|
-
const executeWhenIdleBatched = fn => {
|
|
969
|
+
const executeWhenIdleBatched = (fn, isSizesUpdate) => {
|
|
988
970
|
if (typeof requestIdleCallback !== "function") return setTimeout(fn); // Old browsers don't get optimisation
|
|
989
|
-
if ($b8hua$untrack(isPrioritisedImage)) return fn(); // If we're one of the first 8 images, execute the callbacks immediately
|
|
971
|
+
if ((!isSizesUpdate || !sizeSetFastPath) && $b8hua$untrack(isPrioritisedImage)) return fn(); // If we're one of the first 8 images, execute the callbacks immediately (improves lighthouse metrics)
|
|
972
|
+
// 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)
|
|
990
973
|
const existingStack = listingContext === null || listingContext === void 0 ? void 0 : listingContext[$56047603f9d212b6$var$onIdleFunctionsSymbol];
|
|
991
974
|
if (existingStack) return existingStack.add(fn);
|
|
992
975
|
const newStack = new Set([fn]);
|
|
@@ -1071,10 +1054,11 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
|
1071
1054
|
// This greatly improves performance when loading (more) products
|
|
1072
1055
|
// See https://depictaiworkspace.slack.com/archives/C05NJ0K3WRL/p1698220617663139
|
|
1073
1056
|
timeoutSet = true; // Important to set timeoutSet before the call to executeWhenIdleBatched since if this is an important image executeWhenIdleBatched will execute fn immediately
|
|
1074
|
-
executeWhenIdleBatched(handler);
|
|
1057
|
+
executeWhenIdleBatched(handler, true);
|
|
1075
1058
|
});
|
|
1059
|
+
const dontLoadImageYet = $b8hua$createMemo(() => !props.size() || !hasSetSize()); // Moving this condition into a memo saves us from re-setting src and srcset (expensive) if just props.size changes
|
|
1076
1060
|
$b8hua$createEffect(() => {
|
|
1077
|
-
if (
|
|
1061
|
+
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
|
|
1078
1062
|
Object.assign(img, src_options());
|
|
1079
1063
|
// Add to DOM once decoded to not require/block any paints before image has completed loading and avoid showing broken image symbol
|
|
1080
1064
|
// We can do this because there has to be a container around us giving us a size
|
|
@@ -1090,7 +1074,7 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
|
1090
1074
|
img.decode().catch(e => $b8hua$dwarn("Failed to decode image", e, img)) // Display the image also if loading failed so webdev can debug and doesn't get "no image"
|
|
1091
1075
|
.then(async () => {
|
|
1092
1076
|
// Also wait with inserting image (i.e. paint) until browser is idle
|
|
1093
|
-
await new Promise(r => executeWhenIdleBatched(r));
|
|
1077
|
+
await new Promise(r => executeWhenIdleBatched(r, false));
|
|
1094
1078
|
if (gotCleanedUp) return;
|
|
1095
1079
|
setHasDecoded(true);
|
|
1096
1080
|
hasDecodedFastPath = true;
|
|
@@ -1367,7 +1351,7 @@ var $72017ebd8b9df947$var$_tmpl$ = ["<div", ' style="position:absolute;width:10p
|
|
|
1367
1351
|
let $72017ebd8b9df947$var$cachedValue;
|
|
1368
1352
|
async function $72017ebd8b9df947$export$7b9a0e99f0aeb2f3() {
|
|
1369
1353
|
if ($72017ebd8b9df947$var$cachedValue != undefined) return $72017ebd8b9df947$var$cachedValue;
|
|
1370
|
-
return $72017ebd8b9df947$var$cachedValue =
|
|
1354
|
+
return $72017ebd8b9df947$var$cachedValue = $72017ebd8b9df947$var$checkIfIsAffectedByChromeBug326498383();
|
|
1371
1355
|
}
|
|
1372
1356
|
async function $72017ebd8b9df947$var$checkIfIsAffectedByChromeBug326498383() {
|
|
1373
1357
|
let isAffected = true;
|
|
@@ -1380,7 +1364,7 @@ async function $72017ebd8b9df947$var$checkIfIsAffectedByChromeBug326498383() {
|
|
|
1380
1364
|
setTimeout($b8hua$catchify(() => {
|
|
1381
1365
|
r();
|
|
1382
1366
|
div.remove();
|
|
1383
|
-
}),
|
|
1367
|
+
}), 500);
|
|
1384
1368
|
});
|
|
1385
1369
|
const {
|
|
1386
1370
|
style: style
|
|
@@ -1413,7 +1397,7 @@ async function $72017ebd8b9df947$var$checkIfIsAffectedByChromeBug326498383() {
|
|
|
1413
1397
|
}
|
|
1414
1398
|
return isAffected;
|
|
1415
1399
|
}
|
|
1416
|
-
var $4089a7972a508539$var$_tmpl$ = ["<div", ' class="scroll-padding">', "</div>"];
|
|
1400
|
+
var $4089a7972a508539$var$_tmpl$ = ["<div", ' class="scroll-padding"><div class="', '" style="', '">', "</div></div>"];
|
|
1417
1401
|
function $4089a7972a508539$export$ebf0b1d4f90c09ae(_ref) {
|
|
1418
1402
|
let {
|
|
1419
1403
|
displays_: displays_,
|
|
@@ -1423,7 +1407,8 @@ function $4089a7972a508539$export$ebf0b1d4f90c09ae(_ref) {
|
|
|
1423
1407
|
animationDuration_: animationDuration_,
|
|
1424
1408
|
supportsHover_: supportsHover_,
|
|
1425
1409
|
priceFormatting_: priceFormatting_,
|
|
1426
|
-
pseudoRouter_: pseudoRouter_
|
|
1410
|
+
pseudoRouter_: pseudoRouter_,
|
|
1411
|
+
containerHeight_: containerHeight_
|
|
1427
1412
|
} = _ref;
|
|
1428
1413
|
let isAffectedByChromeBug = false;
|
|
1429
1414
|
// If the user requests the drawer to be expanded or not
|
|
@@ -1441,13 +1426,9 @@ function $4089a7972a508539$export$ebf0b1d4f90c09ae(_ref) {
|
|
|
1441
1426
|
return containerWidth_() || !displays_();
|
|
1442
1427
|
},
|
|
1443
1428
|
get children() {
|
|
1444
|
-
return $b8hua$ssr($4089a7972a508539$var$_tmpl$, $b8hua$ssrHydrationKey(),
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
}
|
|
1448
|
-
}, () => displays_() && {
|
|
1449
|
-
style: "--look-card-width:".concat(containerWidth_(), "px;--look-item-height:").concat(lookItemHeight() || 200, "px")
|
|
1450
|
-
}), () => $b8hua$escape($b8hua$createComponent((0, $b8hua$Index), {
|
|
1429
|
+
return $b8hua$ssr($4089a7972a508539$var$_tmpl$, $b8hua$ssrHydrationKey(), "look-overlay ".concat(userWantsExpanded() ? "expanded" : "", " ").concat(!getSecondPartAnimationRunning() && userWantsExpanded() ? "resting-fully-expanded" : ""), $b8hua$ssrStyle(displays_() &&
|
|
1430
|
+
// The styling is written like this to eke out animation smoothness on low CPU devices, git blame for previous, more readable versions.
|
|
1431
|
+
"--look-card-width:".concat(containerWidth_(), "px;--look-card-height:").concat(containerHeight_(), "px;--look-item-height:").concat(lookItemHeight() || 200, "px")), $b8hua$escape($b8hua$createComponent((0, $b8hua$Index), {
|
|
1451
1432
|
get each() {
|
|
1452
1433
|
return displays_() || Array.from({
|
|
1453
1434
|
length: 4
|
|
@@ -1470,7 +1451,7 @@ function $4089a7972a508539$export$ebf0b1d4f90c09ae(_ref) {
|
|
|
1470
1451
|
})
|
|
1471
1452
|
});
|
|
1472
1453
|
}
|
|
1473
|
-
}))
|
|
1454
|
+
})));
|
|
1474
1455
|
}
|
|
1475
1456
|
});
|
|
1476
1457
|
}
|
|
@@ -1496,7 +1477,7 @@ function $4089a7972a508539$var$scrollingFunctionForChrome(element, targetScrollY
|
|
|
1496
1477
|
// Bootstrap our animation - it will get called right before next frame shall be rendered.
|
|
1497
1478
|
requestAnimationFrame(step);
|
|
1498
1479
|
}
|
|
1499
|
-
var $697d8713dc82b9ab$var$_tmpl$ = ["<div", ' class="', '"
|
|
1480
|
+
var $697d8713dc82b9ab$var$_tmpl$ = ["<div", ' class="', '"><!--$-->', "<!--/--><!--$-->", "<!--/--></div>"];
|
|
1500
1481
|
function $697d8713dc82b9ab$export$44809a8a3e867e30(_ref) {
|
|
1501
1482
|
let {
|
|
1502
1483
|
display_: display_,
|
|
@@ -1507,12 +1488,14 @@ function $697d8713dc82b9ab$export$44809a8a3e867e30(_ref) {
|
|
|
1507
1488
|
priceFormatting_: priceFormatting_,
|
|
1508
1489
|
pseudoRouter_: pseudoRouter_
|
|
1509
1490
|
} = _ref;
|
|
1491
|
+
let container;
|
|
1510
1492
|
const useWantsExpandedSignal_ = $b8hua$createSignal(false);
|
|
1511
1493
|
const [userWantsExpanded, setUserWantsExpanded] = useWantsExpandedSignal_;
|
|
1512
1494
|
const supportsHover_ = $00a5b94f0c11efbb$export$d9f36cf74e24d595("(hover: hover) and (pointer: fine)");
|
|
1513
1495
|
const us = Symbol("look");
|
|
1514
|
-
const
|
|
1515
|
-
const containerWidth_ = $
|
|
1496
|
+
const index = $1e69163caedaab4e$export$e3faf4d95300054f();
|
|
1497
|
+
const [containerWidth_, setContainerWidth] = $b8hua$createSignal();
|
|
1498
|
+
const [containerHeight_, setContainerHeight] = $b8hua$createSignal();
|
|
1516
1499
|
const clickHandler = $b8hua$catchify(_ref2 => {
|
|
1517
1500
|
let {
|
|
1518
1501
|
target: target
|
|
@@ -1521,6 +1504,7 @@ function $697d8713dc82b9ab$export$44809a8a3e867e30(_ref) {
|
|
|
1521
1504
|
// When clicking outside the look, close it
|
|
1522
1505
|
setUserWantsExpanded(false);
|
|
1523
1506
|
});
|
|
1507
|
+
const slidableInformation = $002f09d00aac50b2$export$eaa625fb39439e37();
|
|
1524
1508
|
addEventListener("click", clickHandler);
|
|
1525
1509
|
$b8hua$onCleanup(() => removeEventListener("click", clickHandler));
|
|
1526
1510
|
$b8hua$createEffect(() => setExpandedLooks(prev => {
|
|
@@ -1532,9 +1516,28 @@ function $697d8713dc82b9ab$export$44809a8a3e867e30(_ref) {
|
|
|
1532
1516
|
} else prev.delete(us);
|
|
1533
1517
|
return prev;
|
|
1534
1518
|
}));
|
|
1519
|
+
if (slidableInformation) {
|
|
1520
|
+
const ourVisiblityInSlider = $b8hua$createMemo(() => {
|
|
1521
|
+
var _slidableInformation$, _slidableInformation$2;
|
|
1522
|
+
const currentCard = index === null || index === void 0 ? void 0 : index();
|
|
1523
|
+
if (isNaN(currentCard)) return;
|
|
1524
|
+
slidableInformation === null || slidableInformation === void 0 || slidableInformation.intersectionEntries_();
|
|
1525
|
+
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;
|
|
1526
|
+
});
|
|
1527
|
+
$b8hua$createEffect(prevVisibility => {
|
|
1528
|
+
// Have memo -> effect setup for diffing, so we do as little work as possible in unrelated cards
|
|
1529
|
+
// as number is safe because undefined and NaN are both not < 0.5
|
|
1530
|
+
const visibility = ourVisiblityInSlider();
|
|
1531
|
+
if (visibility < 0.5 && (isNaN(prevVisibility) || visibility - prevVisibility < 0))
|
|
1532
|
+
// When sliding this card completely into the background, collapse it
|
|
1533
|
+
// 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
|
|
1534
|
+
setUserWantsExpanded(false);
|
|
1535
|
+
return visibility;
|
|
1536
|
+
});
|
|
1537
|
+
}
|
|
1535
1538
|
// Close us if another look expands
|
|
1536
1539
|
$b8hua$createEffect(() => !expandedLooks_().has(us) && setUserWantsExpanded(false));
|
|
1537
|
-
$b8hua$
|
|
1540
|
+
return $b8hua$ssr($697d8713dc82b9ab$var$_tmpl$, $b8hua$ssrHydrationKey(), "look-card ".concat(!display_ ? "placeholder" : ""), $b8hua$escape($b8hua$createComponent((0, $b8hua$Show), {
|
|
1538
1541
|
get when() {
|
|
1539
1542
|
return display_();
|
|
1540
1543
|
},
|
|
@@ -1553,7 +1556,7 @@ function $697d8713dc82b9ab$export$44809a8a3e867e30(_ref) {
|
|
|
1553
1556
|
autoAdjustAspectRatio: true
|
|
1554
1557
|
});
|
|
1555
1558
|
}
|
|
1556
|
-
}), $b8hua$createComponent((0, $4089a7972a508539$export$ebf0b1d4f90c09ae), {
|
|
1559
|
+
})), $b8hua$escape($b8hua$createComponent((0, $4089a7972a508539$export$ebf0b1d4f90c09ae), {
|
|
1557
1560
|
displays_: () => {
|
|
1558
1561
|
var _display_2;
|
|
1559
1562
|
return (_display_2 = display_()) === null || _display_2 === void 0 ? void 0 : _display_2.displays;
|
|
@@ -1564,9 +1567,9 @@ function $697d8713dc82b9ab$export$44809a8a3e867e30(_ref) {
|
|
|
1564
1567
|
supportsHover_: supportsHover_,
|
|
1565
1568
|
FavoriteButton_: FavoriteButton_,
|
|
1566
1569
|
priceFormatting_: priceFormatting_,
|
|
1567
|
-
pseudoRouter_: pseudoRouter_
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
+
pseudoRouter_: pseudoRouter_,
|
|
1571
|
+
containerHeight_: containerHeight_
|
|
1572
|
+
})));
|
|
1570
1573
|
}
|
|
1571
1574
|
|
|
1572
1575
|
/**
|
|
@@ -3009,6 +3012,38 @@ let $c3820807ac1e6fd7$export$44dad306455dddf;
|
|
|
3009
3012
|
DEPICT_ID["SEARCH_PAGE"] = "depict-search-page";
|
|
3010
3013
|
DEPICT_ID["PLP_CATEGORY"] = "depict-plp-category";
|
|
3011
3014
|
})($c3820807ac1e6fd7$export$44dad306455dddf || ($c3820807ac1e6fd7$export$44dad306455dddf = {}));
|
|
3015
|
+
|
|
3016
|
+
/** @jsxImportSource solid-js */
|
|
3017
|
+
|
|
3018
|
+
function $fc830a7ee59416ef$export$ebdc3711f7e02ccd(what_to_watch) {
|
|
3019
|
+
const [width, setWidth] = $b8hua$createSignal();
|
|
3020
|
+
const resizeObserver = new ResizeObserver($b8hua$catchify(records => {
|
|
3021
|
+
for (let j = 0; j < records.length; j++) {
|
|
3022
|
+
var _records$j$borderBoxS, _records$j$borderBoxS2, _records$j$borderBoxS3;
|
|
3023
|
+
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;
|
|
3024
|
+
setWidth(width);
|
|
3025
|
+
}
|
|
3026
|
+
}));
|
|
3027
|
+
// 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.
|
|
3028
|
+
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
3029
|
+
const disconnect = (0, $b8hua$observer).onexists(what_to_watch, _ref => {
|
|
3030
|
+
let {
|
|
3031
|
+
element: element
|
|
3032
|
+
} = _ref;
|
|
3033
|
+
return requestAnimationFrame($b8hua$catchify(() => {
|
|
3034
|
+
const current_size = what_to_watch.getBoundingClientRect().width;
|
|
3035
|
+
if (current_size)
|
|
3036
|
+
// 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.
|
|
3037
|
+
setWidth(current_size);
|
|
3038
|
+
resizeObserver.observe(element);
|
|
3039
|
+
}));
|
|
3040
|
+
});
|
|
3041
|
+
$b8hua$onCleanup(() => {
|
|
3042
|
+
resizeObserver.disconnect();
|
|
3043
|
+
disconnect();
|
|
3044
|
+
});
|
|
3045
|
+
return width;
|
|
3046
|
+
}
|
|
3012
3047
|
var $83c36ed4520d0335$var$_tmpl$ = '<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"></path>';
|
|
3013
3048
|
function $83c36ed4520d0335$export$f7658c347b037c3f() {
|
|
3014
3049
|
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|