@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/latest/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { createStore as $i7OB2$createStore, reconcile as $i7OB2$reconcile } from
|
|
|
7
7
|
/*! Depict.ai search and product listing SDK */
|
|
8
8
|
import { register_es_version } from "../../multi_import_deduplicator.mjs";
|
|
9
9
|
register_es_version("ui", "latest");
|
|
10
|
-
const $ec291e0010116877$export$83d89fbfd8236492 = "4.7.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "4.7.9";
|
|
11
11
|
function $24e27fab9c821b86$export$5bad61ecde080b1f(...params) {
|
|
12
12
|
const {
|
|
13
13
|
collapse: collapse,
|
|
@@ -562,22 +562,25 @@ function $fbbadcb080ad1d4a$export$8be2714ec7f169ee(props = {}) {
|
|
|
562
562
|
}
|
|
563
563
|
var $f32e14878e75af51$var$_tmpl$ = ["<div", ">", "</div>"],
|
|
564
564
|
$f32e14878e75af51$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>"];
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
}) {
|
|
565
|
+
const $f32e14878e75af51$var$SlidableContext = /*@__PURE__*/$i7OB2$createContext();
|
|
566
|
+
function $f32e14878e75af51$export$6649caad96ef8870(props) {
|
|
567
|
+
const {
|
|
568
|
+
slider_ref_: slider_ref_,
|
|
569
|
+
faded_opacity_ = 0.7,
|
|
570
|
+
mutation_plugins_ = [],
|
|
571
|
+
disable_fading_: disable_fading_,
|
|
572
|
+
snapAlign_: snapAlign_,
|
|
573
|
+
fadingThreshold_ = 0.96
|
|
574
|
+
} = props;
|
|
576
575
|
const [hasHydrated, setHasHydrated] = $i7OB2$createSignal(false);
|
|
577
576
|
$i7OB2$createEffect(() => setHasHydrated(true));
|
|
578
577
|
const MakeButton = () => $i7OB2$ssr($f32e14878e75af51$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent((0, $fbbadcb080ad1d4a$export$8be2714ec7f169ee), {
|
|
579
|
-
height_
|
|
580
|
-
|
|
578
|
+
get height_() {
|
|
579
|
+
return props.arrow_height_;
|
|
580
|
+
},
|
|
581
|
+
get width_() {
|
|
582
|
+
return props.arrow_width_;
|
|
583
|
+
}
|
|
581
584
|
})));
|
|
582
585
|
// 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
|
|
583
586
|
// However, all it would do on the server (when used by SlidableItems) is creating the following 5 div elements
|
|
@@ -588,10 +591,11 @@ function $f32e14878e75af51$export$6649caad96ef8870({
|
|
|
588
591
|
return hasHydrated() && !(0, $i7OB2$isServer);
|
|
589
592
|
},
|
|
590
593
|
get fallback() {
|
|
591
|
-
return $i7OB2$ssr($f32e14878e75af51$var$_tmpl$2, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent(MakeButton, {})), $i7OB2$escape($i7OB2$createComponent(MakeButton, {})), $i7OB2$escape(children));
|
|
594
|
+
return $i7OB2$ssr($f32e14878e75af51$var$_tmpl$2, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent(MakeButton, {})), $i7OB2$escape($i7OB2$createComponent(MakeButton, {})), $i7OB2$escape(props.children));
|
|
592
595
|
},
|
|
593
596
|
get children() {
|
|
594
597
|
return (() => {
|
|
598
|
+
const [intersectionEntries_, setIntersectionEntries] = $i7OB2$createSignal([]);
|
|
595
599
|
const fading_plugin = disable_fading_ ? undefined : $i7OB2$slider_fading_factory({
|
|
596
600
|
threshold_: fadingThreshold_,
|
|
597
601
|
faded_opacity_: faded_opacity_
|
|
@@ -604,9 +608,17 @@ function $f32e14878e75af51$export$6649caad96ef8870({
|
|
|
604
608
|
constructor_plugins: [$i7OB2$slider_snap_css(0, {
|
|
605
609
|
align: snapAlign_
|
|
606
610
|
}).constructor_plugin, ...(fading_plugin ? [fading_plugin.constructor_plugin] : [])],
|
|
607
|
-
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_]
|
|
611
|
+
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_, entries => setIntersectionEntries(entries)]
|
|
608
612
|
});
|
|
609
|
-
$i7OB2$insert(slider.insert_here,
|
|
613
|
+
$i7OB2$insert(slider.insert_here, () => $i7OB2$createComponent($f32e14878e75af51$var$SlidableContext.Provider, {
|
|
614
|
+
value: {
|
|
615
|
+
slider_: slider,
|
|
616
|
+
intersectionEntries_: intersectionEntries_
|
|
617
|
+
},
|
|
618
|
+
get children() {
|
|
619
|
+
return props.children;
|
|
620
|
+
}
|
|
621
|
+
}));
|
|
610
622
|
$i7OB2$onCleanup(() => slider.observer.disconnect());
|
|
611
623
|
slider_ref_?.(slider);
|
|
612
624
|
return slider.container;
|
|
@@ -614,6 +626,9 @@ function $f32e14878e75af51$export$6649caad96ef8870({
|
|
|
614
626
|
}
|
|
615
627
|
});
|
|
616
628
|
}
|
|
629
|
+
function $f32e14878e75af51$export$eaa625fb39439e37() {
|
|
630
|
+
return $i7OB2$useContext($f32e14878e75af51$var$SlidableContext);
|
|
631
|
+
}
|
|
617
632
|
var $c4492d24952ed731$var$_tmpl$ = ["<h2", ' class="recs-title">', "</h2>"];
|
|
618
633
|
function $c4492d24952ed731$export$d41d19e89346fa2({
|
|
619
634
|
recommendations_resource_: recommendations_resource_,
|
|
@@ -774,34 +789,6 @@ function $dc9262ef6f786812$export$d9f36cf74e24d595(media_query) {
|
|
|
774
789
|
}) => signal[1](matches)).remove);
|
|
775
790
|
return signal[0];
|
|
776
791
|
}
|
|
777
|
-
|
|
778
|
-
/** @jsxImportSource solid-js */
|
|
779
|
-
|
|
780
|
-
function $2449872a62a75a20$export$ebdc3711f7e02ccd(what_to_watch) {
|
|
781
|
-
const [width, setWidth] = $i7OB2$createSignal();
|
|
782
|
-
const resizeObserver = new ResizeObserver($i7OB2$catchify(records => {
|
|
783
|
-
for (let j = 0; j < records.length; j++) {
|
|
784
|
-
const width = records[j].borderBoxSize?.[0]?.inlineSize ?? what_to_watch.getBoundingClientRect().width;
|
|
785
|
-
setWidth(width);
|
|
786
|
-
}
|
|
787
|
-
}));
|
|
788
|
-
// 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.
|
|
789
|
-
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
790
|
-
const disconnect = (0, $i7OB2$observer).onexists(what_to_watch, ({
|
|
791
|
-
element: element
|
|
792
|
-
}) => requestAnimationFrame($i7OB2$catchify(() => {
|
|
793
|
-
const current_size = what_to_watch.getBoundingClientRect().width;
|
|
794
|
-
if (current_size)
|
|
795
|
-
// 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.
|
|
796
|
-
setWidth(current_size);
|
|
797
|
-
resizeObserver.observe(element);
|
|
798
|
-
})));
|
|
799
|
-
$i7OB2$onCleanup(() => {
|
|
800
|
-
resizeObserver.disconnect();
|
|
801
|
-
disconnect();
|
|
802
|
-
});
|
|
803
|
-
return width;
|
|
804
|
-
}
|
|
805
792
|
function $d134eae24341b4a1$export$89c6019e4baa40b1(props) {
|
|
806
793
|
const style = $i7OB2$createMemo(() => {
|
|
807
794
|
const {
|
|
@@ -936,9 +923,10 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
936
923
|
});
|
|
937
924
|
// 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
|
|
938
925
|
// Happened on singular, they have some weird observer (+we also have one but ours is at least 3x more efficient)
|
|
939
|
-
const executeWhenIdleBatched = fn => {
|
|
926
|
+
const executeWhenIdleBatched = (fn, isSizesUpdate) => {
|
|
940
927
|
if (typeof requestIdleCallback !== "function") return setTimeout(fn); // Old browsers don't get optimisation
|
|
941
|
-
if ($i7OB2$untrack(isPrioritisedImage)) return fn(); // If we're one of the first 8 images, execute the callbacks immediately
|
|
928
|
+
if ((!isSizesUpdate || !sizeSetFastPath) && $i7OB2$untrack(isPrioritisedImage)) return fn(); // If we're one of the first 8 images, execute the callbacks immediately (improves lighthouse metrics)
|
|
929
|
+
// 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)
|
|
942
930
|
const existingStack = listingContext?.[$e8ffe11ed01df0fe$var$onIdleFunctionsSymbol];
|
|
943
931
|
if (existingStack) return existingStack.add(fn);
|
|
944
932
|
const newStack = new Set([fn]);
|
|
@@ -1020,10 +1008,11 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
1020
1008
|
// This greatly improves performance when loading (more) products
|
|
1021
1009
|
// See https://depictaiworkspace.slack.com/archives/C05NJ0K3WRL/p1698220617663139
|
|
1022
1010
|
timeoutSet = true; // Important to set timeoutSet before the call to executeWhenIdleBatched since if this is an important image executeWhenIdleBatched will execute fn immediately
|
|
1023
|
-
executeWhenIdleBatched(handler);
|
|
1011
|
+
executeWhenIdleBatched(handler, true);
|
|
1024
1012
|
});
|
|
1013
|
+
const dontLoadImageYet = $i7OB2$createMemo(() => !props.size() || !hasSetSize()); // Moving this condition into a memo saves us from re-setting src and srcset (expensive) if just props.size changes
|
|
1025
1014
|
$i7OB2$createEffect(() => {
|
|
1026
|
-
if (
|
|
1015
|
+
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
|
|
1027
1016
|
Object.assign(img, src_options());
|
|
1028
1017
|
// Add to DOM once decoded to not require/block any paints before image has completed loading and avoid showing broken image symbol
|
|
1029
1018
|
// We can do this because there has to be a container around us giving us a size
|
|
@@ -1039,7 +1028,7 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
1039
1028
|
img.decode().catch(e => $i7OB2$dwarn("Failed to decode image", e, img)) // Display the image also if loading failed so webdev can debug and doesn't get "no image"
|
|
1040
1029
|
.then(async () => {
|
|
1041
1030
|
// Also wait with inserting image (i.e. paint) until browser is idle
|
|
1042
|
-
await new Promise(r => executeWhenIdleBatched(r));
|
|
1031
|
+
await new Promise(r => executeWhenIdleBatched(r, false));
|
|
1043
1032
|
if (gotCleanedUp) return;
|
|
1044
1033
|
setHasDecoded(true);
|
|
1045
1034
|
hasDecodedFastPath = true;
|
|
@@ -1294,7 +1283,7 @@ var $62a8f670f8464532$var$_tmpl$ = ["<div", ' style="position:absolute;width:10p
|
|
|
1294
1283
|
let $62a8f670f8464532$var$cachedValue;
|
|
1295
1284
|
async function $62a8f670f8464532$export$7b9a0e99f0aeb2f3() {
|
|
1296
1285
|
if ($62a8f670f8464532$var$cachedValue != undefined) return $62a8f670f8464532$var$cachedValue;
|
|
1297
|
-
return $62a8f670f8464532$var$cachedValue =
|
|
1286
|
+
return $62a8f670f8464532$var$cachedValue = $62a8f670f8464532$var$checkIfIsAffectedByChromeBug326498383();
|
|
1298
1287
|
}
|
|
1299
1288
|
async function $62a8f670f8464532$var$checkIfIsAffectedByChromeBug326498383() {
|
|
1300
1289
|
let isAffected = true;
|
|
@@ -1307,7 +1296,7 @@ async function $62a8f670f8464532$var$checkIfIsAffectedByChromeBug326498383() {
|
|
|
1307
1296
|
setTimeout($i7OB2$catchify(() => {
|
|
1308
1297
|
r();
|
|
1309
1298
|
div.remove();
|
|
1310
|
-
}),
|
|
1299
|
+
}), 500);
|
|
1311
1300
|
});
|
|
1312
1301
|
const {
|
|
1313
1302
|
style: style
|
|
@@ -1340,7 +1329,7 @@ async function $62a8f670f8464532$var$checkIfIsAffectedByChromeBug326498383() {
|
|
|
1340
1329
|
}
|
|
1341
1330
|
return isAffected;
|
|
1342
1331
|
}
|
|
1343
|
-
var $7555dcad3b8a4632$var$_tmpl$ = ["<div", ' class="scroll-padding">', "</div>"];
|
|
1332
|
+
var $7555dcad3b8a4632$var$_tmpl$ = ["<div", ' class="scroll-padding"><div class="', '" style="', '">', "</div></div>"];
|
|
1344
1333
|
function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
|
|
1345
1334
|
displays_: displays_,
|
|
1346
1335
|
FavoriteButton_: FavoriteButton_,
|
|
@@ -1349,7 +1338,8 @@ function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
|
|
|
1349
1338
|
animationDuration_: animationDuration_,
|
|
1350
1339
|
supportsHover_: supportsHover_,
|
|
1351
1340
|
priceFormatting_: priceFormatting_,
|
|
1352
|
-
pseudoRouter_: pseudoRouter_
|
|
1341
|
+
pseudoRouter_: pseudoRouter_,
|
|
1342
|
+
containerHeight_: containerHeight_
|
|
1353
1343
|
}) {
|
|
1354
1344
|
let isAffectedByChromeBug = false;
|
|
1355
1345
|
// If the user requests the drawer to be expanded or not
|
|
@@ -1367,13 +1357,9 @@ function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
|
|
|
1367
1357
|
return containerWidth_() || !displays_();
|
|
1368
1358
|
},
|
|
1369
1359
|
get children() {
|
|
1370
|
-
return $i7OB2$ssr($7555dcad3b8a4632$var$_tmpl$, $i7OB2$ssrHydrationKey(), $
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
}
|
|
1374
|
-
}, () => displays_() && {
|
|
1375
|
-
style: `--look-card-width:${containerWidth_()}px;--look-item-height:${lookItemHeight() || 200}px`
|
|
1376
|
-
}), () => $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Index), {
|
|
1360
|
+
return $i7OB2$ssr($7555dcad3b8a4632$var$_tmpl$, $i7OB2$ssrHydrationKey(), `look-overlay ${userWantsExpanded() ? "expanded" : ""} ${!getSecondPartAnimationRunning() && userWantsExpanded() ? "resting-fully-expanded" : ""}`, $i7OB2$ssrStyle(displays_() &&
|
|
1361
|
+
// The styling is written like this to eke out animation smoothness on low CPU devices, git blame for previous, more readable versions.
|
|
1362
|
+
`--look-card-width:${containerWidth_()}px;--look-card-height:${containerHeight_()}px;--look-item-height:${lookItemHeight() || 200}px`), $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Index), {
|
|
1377
1363
|
get each() {
|
|
1378
1364
|
return displays_() || Array.from({
|
|
1379
1365
|
length: 4
|
|
@@ -1396,7 +1382,7 @@ function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
|
|
|
1396
1382
|
})
|
|
1397
1383
|
});
|
|
1398
1384
|
}
|
|
1399
|
-
}))
|
|
1385
|
+
})));
|
|
1400
1386
|
}
|
|
1401
1387
|
});
|
|
1402
1388
|
}
|
|
@@ -1422,7 +1408,7 @@ function $7555dcad3b8a4632$var$scrollingFunctionForChrome(element, targetScrollY
|
|
|
1422
1408
|
// Bootstrap our animation - it will get called right before next frame shall be rendered.
|
|
1423
1409
|
requestAnimationFrame(step);
|
|
1424
1410
|
}
|
|
1425
|
-
var $28ee4f7db3cc44b8$var$_tmpl$ = ["<div", ' class="', '"
|
|
1411
|
+
var $28ee4f7db3cc44b8$var$_tmpl$ = ["<div", ' class="', '"><!--$-->', "<!--/--><!--$-->", "<!--/--></div>"];
|
|
1426
1412
|
function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
1427
1413
|
display_: display_,
|
|
1428
1414
|
expandedLooksSignal_: [expandedLooks_, setExpandedLooks],
|
|
@@ -1432,12 +1418,14 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1432
1418
|
priceFormatting_: priceFormatting_,
|
|
1433
1419
|
pseudoRouter_: pseudoRouter_
|
|
1434
1420
|
}) {
|
|
1421
|
+
let container;
|
|
1435
1422
|
const useWantsExpandedSignal_ = $i7OB2$createSignal(false);
|
|
1436
1423
|
const [userWantsExpanded, setUserWantsExpanded] = useWantsExpandedSignal_;
|
|
1437
1424
|
const supportsHover_ = $dc9262ef6f786812$export$d9f36cf74e24d595("(hover: hover) and (pointer: fine)");
|
|
1438
1425
|
const us = Symbol("look");
|
|
1439
|
-
const
|
|
1440
|
-
const containerWidth_ = $
|
|
1426
|
+
const index = $b6440e72ed83671a$export$e3faf4d95300054f();
|
|
1427
|
+
const [containerWidth_, setContainerWidth] = $i7OB2$createSignal();
|
|
1428
|
+
const [containerHeight_, setContainerHeight] = $i7OB2$createSignal();
|
|
1441
1429
|
const clickHandler = $i7OB2$catchify(({
|
|
1442
1430
|
target: target
|
|
1443
1431
|
}) => {
|
|
@@ -1445,6 +1433,7 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1445
1433
|
// When clicking outside the look, close it
|
|
1446
1434
|
setUserWantsExpanded(false);
|
|
1447
1435
|
});
|
|
1436
|
+
const slidableInformation = $f32e14878e75af51$export$eaa625fb39439e37();
|
|
1448
1437
|
addEventListener("click", clickHandler);
|
|
1449
1438
|
$i7OB2$onCleanup(() => removeEventListener("click", clickHandler));
|
|
1450
1439
|
$i7OB2$createEffect(() => setExpandedLooks(prev => {
|
|
@@ -1456,9 +1445,27 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1456
1445
|
} else prev.delete(us);
|
|
1457
1446
|
return prev;
|
|
1458
1447
|
}));
|
|
1448
|
+
if (slidableInformation) {
|
|
1449
|
+
const ourVisiblityInSlider = $i7OB2$createMemo(() => {
|
|
1450
|
+
const currentCard = index?.();
|
|
1451
|
+
if (isNaN(currentCard)) return;
|
|
1452
|
+
slidableInformation?.intersectionEntries_();
|
|
1453
|
+
return slidableInformation?.slider_.intersecting_items_object?.[currentCard]?.intersectionRatio;
|
|
1454
|
+
});
|
|
1455
|
+
$i7OB2$createEffect(prevVisibility => {
|
|
1456
|
+
// Have memo -> effect setup for diffing, so we do as little work as possible in unrelated cards
|
|
1457
|
+
// as number is safe because undefined and NaN are both not < 0.5
|
|
1458
|
+
const visibility = ourVisiblityInSlider();
|
|
1459
|
+
if (visibility < 0.5 && (isNaN(prevVisibility) || visibility - prevVisibility < 0))
|
|
1460
|
+
// When sliding this card completely into the background, collapse it
|
|
1461
|
+
// 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
|
|
1462
|
+
setUserWantsExpanded(false);
|
|
1463
|
+
return visibility;
|
|
1464
|
+
});
|
|
1465
|
+
}
|
|
1459
1466
|
// Close us if another look expands
|
|
1460
1467
|
$i7OB2$createEffect(() => !expandedLooks_().has(us) && setUserWantsExpanded(false));
|
|
1461
|
-
$i7OB2$
|
|
1468
|
+
return $i7OB2$ssr($28ee4f7db3cc44b8$var$_tmpl$, $i7OB2$ssrHydrationKey(), `look-card ${!display_ ? "placeholder" : ""}`, $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
|
|
1462
1469
|
get when() {
|
|
1463
1470
|
return display_();
|
|
1464
1471
|
},
|
|
@@ -1476,7 +1483,7 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1476
1483
|
autoAdjustAspectRatio: true
|
|
1477
1484
|
});
|
|
1478
1485
|
}
|
|
1479
|
-
}), $i7OB2$createComponent((0, $7555dcad3b8a4632$export$ebf0b1d4f90c09ae), {
|
|
1486
|
+
})), $i7OB2$escape($i7OB2$createComponent((0, $7555dcad3b8a4632$export$ebf0b1d4f90c09ae), {
|
|
1480
1487
|
displays_: () => display_()?.displays,
|
|
1481
1488
|
userWantsExpandedSignal_: useWantsExpandedSignal_,
|
|
1482
1489
|
containerWidth_: containerWidth_,
|
|
@@ -1484,9 +1491,9 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1484
1491
|
supportsHover_: supportsHover_,
|
|
1485
1492
|
FavoriteButton_: FavoriteButton_,
|
|
1486
1493
|
priceFormatting_: priceFormatting_,
|
|
1487
|
-
pseudoRouter_: pseudoRouter_
|
|
1488
|
-
|
|
1489
|
-
|
|
1494
|
+
pseudoRouter_: pseudoRouter_,
|
|
1495
|
+
containerHeight_: containerHeight_
|
|
1496
|
+
})));
|
|
1490
1497
|
}
|
|
1491
1498
|
|
|
1492
1499
|
/**
|
|
@@ -2835,6 +2842,34 @@ let $f86ba724282f6690$export$44dad306455dddf;
|
|
|
2835
2842
|
DEPICT_ID["SEARCH_PAGE"] = "depict-search-page";
|
|
2836
2843
|
DEPICT_ID["PLP_CATEGORY"] = "depict-plp-category";
|
|
2837
2844
|
})($f86ba724282f6690$export$44dad306455dddf || ($f86ba724282f6690$export$44dad306455dddf = {}));
|
|
2845
|
+
|
|
2846
|
+
/** @jsxImportSource solid-js */
|
|
2847
|
+
|
|
2848
|
+
function $2449872a62a75a20$export$ebdc3711f7e02ccd(what_to_watch) {
|
|
2849
|
+
const [width, setWidth] = $i7OB2$createSignal();
|
|
2850
|
+
const resizeObserver = new ResizeObserver($i7OB2$catchify(records => {
|
|
2851
|
+
for (let j = 0; j < records.length; j++) {
|
|
2852
|
+
const width = records[j].borderBoxSize?.[0]?.inlineSize ?? what_to_watch.getBoundingClientRect().width;
|
|
2853
|
+
setWidth(width);
|
|
2854
|
+
}
|
|
2855
|
+
}));
|
|
2856
|
+
// 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.
|
|
2857
|
+
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
2858
|
+
const disconnect = (0, $i7OB2$observer).onexists(what_to_watch, ({
|
|
2859
|
+
element: element
|
|
2860
|
+
}) => requestAnimationFrame($i7OB2$catchify(() => {
|
|
2861
|
+
const current_size = what_to_watch.getBoundingClientRect().width;
|
|
2862
|
+
if (current_size)
|
|
2863
|
+
// 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.
|
|
2864
|
+
setWidth(current_size);
|
|
2865
|
+
resizeObserver.observe(element);
|
|
2866
|
+
})));
|
|
2867
|
+
$i7OB2$onCleanup(() => {
|
|
2868
|
+
resizeObserver.disconnect();
|
|
2869
|
+
disconnect();
|
|
2870
|
+
});
|
|
2871
|
+
return width;
|
|
2872
|
+
}
|
|
2838
2873
|
var $081752ca508a876f$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>';
|
|
2839
2874
|
function $081752ca508a876f$export$f7658c347b037c3f(props = {}) {
|
|
2840
2875
|
return $i7OB2$ssrElement("svg", $i7OB2$mergeProps({
|