@depict-ai/ui 4.7.7 → 4.7.8
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 +127 -107
- package/ES10/index.d.ts +6 -6
- package/ES10/index.js +128 -108
- package/latest/index.cjs +117 -94
- package/latest/index.d.ts +6 -6
- package/latest/index.js +118 -95
- package/package.json +4 -4
- package/server/ES10/index.cjs +58 -58
- package/server/ES10/index.d.ts +6 -6
- package/server/ES10/index.js +58 -58
- package/server/latest/index.cjs +54 -54
- package/server/latest/index.d.ts +6 -6
- package/server/latest/index.js +54 -54
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.8";
|
|
14
14
|
function $8e8b179489080711$export$5bad61ecde080b1f() {
|
|
15
15
|
const {
|
|
16
16
|
collapse: collapse,
|
|
@@ -814,38 +814,6 @@ function $00a5b94f0c11efbb$export$d9f36cf74e24d595(media_query) {
|
|
|
814
814
|
}).remove);
|
|
815
815
|
return signal[0];
|
|
816
816
|
}
|
|
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
817
|
function $ceafb6fb91c6f394$export$89c6019e4baa40b1(props) {
|
|
850
818
|
const style = $b8hua$createMemo(() => {
|
|
851
819
|
const {
|
|
@@ -984,9 +952,10 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
|
984
952
|
});
|
|
985
953
|
// 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
954
|
// Happened on singular, they have some weird observer (+we also have one but ours is at least 3x more efficient)
|
|
987
|
-
const executeWhenIdleBatched = fn => {
|
|
955
|
+
const executeWhenIdleBatched = (fn, isSizesUpdate) => {
|
|
988
956
|
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
|
|
957
|
+
if ((!isSizesUpdate || !sizeSetFastPath) && $b8hua$untrack(isPrioritisedImage)) return fn(); // If we're one of the first 8 images, execute the callbacks immediately (improves lighthouse metrics)
|
|
958
|
+
// 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
959
|
const existingStack = listingContext === null || listingContext === void 0 ? void 0 : listingContext[$56047603f9d212b6$var$onIdleFunctionsSymbol];
|
|
991
960
|
if (existingStack) return existingStack.add(fn);
|
|
992
961
|
const newStack = new Set([fn]);
|
|
@@ -1071,10 +1040,11 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
|
1071
1040
|
// This greatly improves performance when loading (more) products
|
|
1072
1041
|
// See https://depictaiworkspace.slack.com/archives/C05NJ0K3WRL/p1698220617663139
|
|
1073
1042
|
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);
|
|
1043
|
+
executeWhenIdleBatched(handler, true);
|
|
1075
1044
|
});
|
|
1045
|
+
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
1046
|
$b8hua$createEffect(() => {
|
|
1077
|
-
if (
|
|
1047
|
+
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
1048
|
Object.assign(img, src_options());
|
|
1079
1049
|
// Add to DOM once decoded to not require/block any paints before image has completed loading and avoid showing broken image symbol
|
|
1080
1050
|
// We can do this because there has to be a container around us giving us a size
|
|
@@ -1090,7 +1060,7 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
|
1090
1060
|
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
1061
|
.then(async () => {
|
|
1092
1062
|
// Also wait with inserting image (i.e. paint) until browser is idle
|
|
1093
|
-
await new Promise(r => executeWhenIdleBatched(r));
|
|
1063
|
+
await new Promise(r => executeWhenIdleBatched(r, false));
|
|
1094
1064
|
if (gotCleanedUp) return;
|
|
1095
1065
|
setHasDecoded(true);
|
|
1096
1066
|
hasDecodedFastPath = true;
|
|
@@ -1367,7 +1337,7 @@ var $72017ebd8b9df947$var$_tmpl$ = ["<div", ' style="position:absolute;width:10p
|
|
|
1367
1337
|
let $72017ebd8b9df947$var$cachedValue;
|
|
1368
1338
|
async function $72017ebd8b9df947$export$7b9a0e99f0aeb2f3() {
|
|
1369
1339
|
if ($72017ebd8b9df947$var$cachedValue != undefined) return $72017ebd8b9df947$var$cachedValue;
|
|
1370
|
-
return $72017ebd8b9df947$var$cachedValue =
|
|
1340
|
+
return $72017ebd8b9df947$var$cachedValue = $72017ebd8b9df947$var$checkIfIsAffectedByChromeBug326498383();
|
|
1371
1341
|
}
|
|
1372
1342
|
async function $72017ebd8b9df947$var$checkIfIsAffectedByChromeBug326498383() {
|
|
1373
1343
|
let isAffected = true;
|
|
@@ -1380,7 +1350,7 @@ async function $72017ebd8b9df947$var$checkIfIsAffectedByChromeBug326498383() {
|
|
|
1380
1350
|
setTimeout($b8hua$catchify(() => {
|
|
1381
1351
|
r();
|
|
1382
1352
|
div.remove();
|
|
1383
|
-
}),
|
|
1353
|
+
}), 500);
|
|
1384
1354
|
});
|
|
1385
1355
|
const {
|
|
1386
1356
|
style: style
|
|
@@ -1413,7 +1383,7 @@ async function $72017ebd8b9df947$var$checkIfIsAffectedByChromeBug326498383() {
|
|
|
1413
1383
|
}
|
|
1414
1384
|
return isAffected;
|
|
1415
1385
|
}
|
|
1416
|
-
var $4089a7972a508539$var$_tmpl$ = ["<div", ' class="scroll-padding">', "</div>"];
|
|
1386
|
+
var $4089a7972a508539$var$_tmpl$ = ["<div", ' class="scroll-padding"><div class="', '" style="', '">', "</div></div>"];
|
|
1417
1387
|
function $4089a7972a508539$export$ebf0b1d4f90c09ae(_ref) {
|
|
1418
1388
|
let {
|
|
1419
1389
|
displays_: displays_,
|
|
@@ -1423,7 +1393,8 @@ function $4089a7972a508539$export$ebf0b1d4f90c09ae(_ref) {
|
|
|
1423
1393
|
animationDuration_: animationDuration_,
|
|
1424
1394
|
supportsHover_: supportsHover_,
|
|
1425
1395
|
priceFormatting_: priceFormatting_,
|
|
1426
|
-
pseudoRouter_: pseudoRouter_
|
|
1396
|
+
pseudoRouter_: pseudoRouter_,
|
|
1397
|
+
containerHeight_: containerHeight_
|
|
1427
1398
|
} = _ref;
|
|
1428
1399
|
let isAffectedByChromeBug = false;
|
|
1429
1400
|
// If the user requests the drawer to be expanded or not
|
|
@@ -1441,13 +1412,9 @@ function $4089a7972a508539$export$ebf0b1d4f90c09ae(_ref) {
|
|
|
1441
1412
|
return containerWidth_() || !displays_();
|
|
1442
1413
|
},
|
|
1443
1414
|
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), {
|
|
1415
|
+
return $b8hua$ssr($4089a7972a508539$var$_tmpl$, $b8hua$ssrHydrationKey(), "look-overlay ".concat(userWantsExpanded() ? "expanded" : "", " ").concat(!getSecondPartAnimationRunning() && userWantsExpanded() ? "resting-fully-expanded" : ""), $b8hua$ssrStyle(displays_() &&
|
|
1416
|
+
// The styling is written like this to eke out animation smoothness on low CPU devices, git blame for previous, more readable versions.
|
|
1417
|
+
"--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
1418
|
get each() {
|
|
1452
1419
|
return displays_() || Array.from({
|
|
1453
1420
|
length: 4
|
|
@@ -1470,7 +1437,7 @@ function $4089a7972a508539$export$ebf0b1d4f90c09ae(_ref) {
|
|
|
1470
1437
|
})
|
|
1471
1438
|
});
|
|
1472
1439
|
}
|
|
1473
|
-
}))
|
|
1440
|
+
})));
|
|
1474
1441
|
}
|
|
1475
1442
|
});
|
|
1476
1443
|
}
|
|
@@ -1496,7 +1463,7 @@ function $4089a7972a508539$var$scrollingFunctionForChrome(element, targetScrollY
|
|
|
1496
1463
|
// Bootstrap our animation - it will get called right before next frame shall be rendered.
|
|
1497
1464
|
requestAnimationFrame(step);
|
|
1498
1465
|
}
|
|
1499
|
-
var $697d8713dc82b9ab$var$_tmpl$ = ["<div", ' class="', '"
|
|
1466
|
+
var $697d8713dc82b9ab$var$_tmpl$ = ["<div", ' class="', '"><!--$-->', "<!--/--><!--$-->", "<!--/--></div>"];
|
|
1500
1467
|
function $697d8713dc82b9ab$export$44809a8a3e867e30(_ref) {
|
|
1501
1468
|
let {
|
|
1502
1469
|
display_: display_,
|
|
@@ -1507,12 +1474,13 @@ function $697d8713dc82b9ab$export$44809a8a3e867e30(_ref) {
|
|
|
1507
1474
|
priceFormatting_: priceFormatting_,
|
|
1508
1475
|
pseudoRouter_: pseudoRouter_
|
|
1509
1476
|
} = _ref;
|
|
1477
|
+
let container;
|
|
1510
1478
|
const useWantsExpandedSignal_ = $b8hua$createSignal(false);
|
|
1511
1479
|
const [userWantsExpanded, setUserWantsExpanded] = useWantsExpandedSignal_;
|
|
1512
1480
|
const supportsHover_ = $00a5b94f0c11efbb$export$d9f36cf74e24d595("(hover: hover) and (pointer: fine)");
|
|
1513
1481
|
const us = Symbol("look");
|
|
1514
|
-
const
|
|
1515
|
-
const
|
|
1482
|
+
const [containerWidth_, setContainerWidth] = $b8hua$createSignal();
|
|
1483
|
+
const [containerHeight_, setContainerHeight] = $b8hua$createSignal();
|
|
1516
1484
|
const clickHandler = $b8hua$catchify(_ref2 => {
|
|
1517
1485
|
let {
|
|
1518
1486
|
target: target
|
|
@@ -1534,7 +1502,7 @@ function $697d8713dc82b9ab$export$44809a8a3e867e30(_ref) {
|
|
|
1534
1502
|
}));
|
|
1535
1503
|
// Close us if another look expands
|
|
1536
1504
|
$b8hua$createEffect(() => !expandedLooks_().has(us) && setUserWantsExpanded(false));
|
|
1537
|
-
$b8hua$
|
|
1505
|
+
return $b8hua$ssr($697d8713dc82b9ab$var$_tmpl$, $b8hua$ssrHydrationKey(), "look-card ".concat(!display_ ? "placeholder" : ""), $b8hua$escape($b8hua$createComponent((0, $b8hua$Show), {
|
|
1538
1506
|
get when() {
|
|
1539
1507
|
return display_();
|
|
1540
1508
|
},
|
|
@@ -1553,7 +1521,7 @@ function $697d8713dc82b9ab$export$44809a8a3e867e30(_ref) {
|
|
|
1553
1521
|
autoAdjustAspectRatio: true
|
|
1554
1522
|
});
|
|
1555
1523
|
}
|
|
1556
|
-
}), $b8hua$createComponent((0, $4089a7972a508539$export$ebf0b1d4f90c09ae), {
|
|
1524
|
+
})), $b8hua$escape($b8hua$createComponent((0, $4089a7972a508539$export$ebf0b1d4f90c09ae), {
|
|
1557
1525
|
displays_: () => {
|
|
1558
1526
|
var _display_2;
|
|
1559
1527
|
return (_display_2 = display_()) === null || _display_2 === void 0 ? void 0 : _display_2.displays;
|
|
@@ -1564,9 +1532,9 @@ function $697d8713dc82b9ab$export$44809a8a3e867e30(_ref) {
|
|
|
1564
1532
|
supportsHover_: supportsHover_,
|
|
1565
1533
|
FavoriteButton_: FavoriteButton_,
|
|
1566
1534
|
priceFormatting_: priceFormatting_,
|
|
1567
|
-
pseudoRouter_: pseudoRouter_
|
|
1568
|
-
|
|
1569
|
-
|
|
1535
|
+
pseudoRouter_: pseudoRouter_,
|
|
1536
|
+
containerHeight_: containerHeight_
|
|
1537
|
+
})));
|
|
1570
1538
|
}
|
|
1571
1539
|
|
|
1572
1540
|
/**
|
|
@@ -3009,6 +2977,38 @@ let $c3820807ac1e6fd7$export$44dad306455dddf;
|
|
|
3009
2977
|
DEPICT_ID["SEARCH_PAGE"] = "depict-search-page";
|
|
3010
2978
|
DEPICT_ID["PLP_CATEGORY"] = "depict-plp-category";
|
|
3011
2979
|
})($c3820807ac1e6fd7$export$44dad306455dddf || ($c3820807ac1e6fd7$export$44dad306455dddf = {}));
|
|
2980
|
+
|
|
2981
|
+
/** @jsxImportSource solid-js */
|
|
2982
|
+
|
|
2983
|
+
function $fc830a7ee59416ef$export$ebdc3711f7e02ccd(what_to_watch) {
|
|
2984
|
+
const [width, setWidth] = $b8hua$createSignal();
|
|
2985
|
+
const resizeObserver = new ResizeObserver($b8hua$catchify(records => {
|
|
2986
|
+
for (let j = 0; j < records.length; j++) {
|
|
2987
|
+
var _records$j$borderBoxS, _records$j$borderBoxS2, _records$j$borderBoxS3;
|
|
2988
|
+
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;
|
|
2989
|
+
setWidth(width);
|
|
2990
|
+
}
|
|
2991
|
+
}));
|
|
2992
|
+
// 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.
|
|
2993
|
+
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
2994
|
+
const disconnect = (0, $b8hua$observer).onexists(what_to_watch, _ref => {
|
|
2995
|
+
let {
|
|
2996
|
+
element: element
|
|
2997
|
+
} = _ref;
|
|
2998
|
+
return requestAnimationFrame($b8hua$catchify(() => {
|
|
2999
|
+
const current_size = what_to_watch.getBoundingClientRect().width;
|
|
3000
|
+
if (current_size)
|
|
3001
|
+
// 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.
|
|
3002
|
+
setWidth(current_size);
|
|
3003
|
+
resizeObserver.observe(element);
|
|
3004
|
+
}));
|
|
3005
|
+
});
|
|
3006
|
+
$b8hua$onCleanup(() => {
|
|
3007
|
+
resizeObserver.disconnect();
|
|
3008
|
+
disconnect();
|
|
3009
|
+
});
|
|
3010
|
+
return width;
|
|
3011
|
+
}
|
|
3012
3012
|
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
3013
|
function $83c36ed4520d0335$export$f7658c347b037c3f() {
|
|
3014
3014
|
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
package/server/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.8";
|
|
102
102
|
function $4b455f60dadde8b8$export$5bad61ecde080b1f(...params) {
|
|
103
103
|
const {
|
|
104
104
|
collapse: collapse,
|
|
@@ -865,34 +865,6 @@ function $b54e6192d0caa293$export$d9f36cf74e24d595(media_query) {
|
|
|
865
865
|
}) => signal[1](matches)).remove);
|
|
866
866
|
return signal[0];
|
|
867
867
|
}
|
|
868
|
-
|
|
869
|
-
/** @jsxImportSource solid-js */
|
|
870
|
-
|
|
871
|
-
function $f13855d1b951b24a$export$ebdc3711f7e02ccd(what_to_watch) {
|
|
872
|
-
const [width, setWidth] = $5vyXB$solidjs.createSignal();
|
|
873
|
-
const resizeObserver = new ResizeObserver($5vyXB$depictaiutilishared.catchify(records => {
|
|
874
|
-
for (let j = 0; j < records.length; j++) {
|
|
875
|
-
const width = records[j].borderBoxSize?.[0]?.inlineSize ?? what_to_watch.getBoundingClientRect().width;
|
|
876
|
-
setWidth(width);
|
|
877
|
-
}
|
|
878
|
-
}));
|
|
879
|
-
// 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.
|
|
880
|
-
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
881
|
-
const disconnect = (0, $5vyXB$depictaiutilishared.observer).onexists(what_to_watch, ({
|
|
882
|
-
element: element
|
|
883
|
-
}) => requestAnimationFrame($5vyXB$depictaiutilishared.catchify(() => {
|
|
884
|
-
const current_size = what_to_watch.getBoundingClientRect().width;
|
|
885
|
-
if (current_size)
|
|
886
|
-
// 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.
|
|
887
|
-
setWidth(current_size);
|
|
888
|
-
resizeObserver.observe(element);
|
|
889
|
-
})));
|
|
890
|
-
$5vyXB$solidjs.onCleanup(() => {
|
|
891
|
-
resizeObserver.disconnect();
|
|
892
|
-
disconnect();
|
|
893
|
-
});
|
|
894
|
-
return width;
|
|
895
|
-
}
|
|
896
868
|
function $061ff5b4c3d36171$export$89c6019e4baa40b1(props) {
|
|
897
869
|
const style = $5vyXB$solidjs.createMemo(() => {
|
|
898
870
|
const {
|
|
@@ -1027,9 +999,10 @@ function $19950faaac026e09$export$6e5611bc7e57e477(props) {
|
|
|
1027
999
|
});
|
|
1028
1000
|
// 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
|
|
1029
1001
|
// Happened on singular, they have some weird observer (+we also have one but ours is at least 3x more efficient)
|
|
1030
|
-
const executeWhenIdleBatched = fn => {
|
|
1002
|
+
const executeWhenIdleBatched = (fn, isSizesUpdate) => {
|
|
1031
1003
|
if (typeof requestIdleCallback !== "function") return setTimeout(fn); // Old browsers don't get optimisation
|
|
1032
|
-
if ($5vyXB$solidjs.untrack(isPrioritisedImage)) return fn(); // If we're one of the first 8 images, execute the callbacks immediately
|
|
1004
|
+
if ((!isSizesUpdate || !sizeSetFastPath) && $5vyXB$solidjs.untrack(isPrioritisedImage)) return fn(); // If we're one of the first 8 images, execute the callbacks immediately (improves lighthouse metrics)
|
|
1005
|
+
// 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)
|
|
1033
1006
|
const existingStack = listingContext?.[$19950faaac026e09$var$onIdleFunctionsSymbol];
|
|
1034
1007
|
if (existingStack) return existingStack.add(fn);
|
|
1035
1008
|
const newStack = new Set([fn]);
|
|
@@ -1111,10 +1084,11 @@ function $19950faaac026e09$export$6e5611bc7e57e477(props) {
|
|
|
1111
1084
|
// This greatly improves performance when loading (more) products
|
|
1112
1085
|
// See https://depictaiworkspace.slack.com/archives/C05NJ0K3WRL/p1698220617663139
|
|
1113
1086
|
timeoutSet = true; // Important to set timeoutSet before the call to executeWhenIdleBatched since if this is an important image executeWhenIdleBatched will execute fn immediately
|
|
1114
|
-
executeWhenIdleBatched(handler);
|
|
1087
|
+
executeWhenIdleBatched(handler, true);
|
|
1115
1088
|
});
|
|
1089
|
+
const dontLoadImageYet = $5vyXB$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
|
|
1116
1090
|
$5vyXB$solidjs.createEffect(() => {
|
|
1117
|
-
if (
|
|
1091
|
+
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
|
|
1118
1092
|
Object.assign(img, src_options());
|
|
1119
1093
|
// Add to DOM once decoded to not require/block any paints before image has completed loading and avoid showing broken image symbol
|
|
1120
1094
|
// We can do this because there has to be a container around us giving us a size
|
|
@@ -1130,7 +1104,7 @@ function $19950faaac026e09$export$6e5611bc7e57e477(props) {
|
|
|
1130
1104
|
img.decode().catch(e => $5vyXB$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"
|
|
1131
1105
|
.then(async () => {
|
|
1132
1106
|
// Also wait with inserting image (i.e. paint) until browser is idle
|
|
1133
|
-
await new Promise(r => executeWhenIdleBatched(r));
|
|
1107
|
+
await new Promise(r => executeWhenIdleBatched(r, false));
|
|
1134
1108
|
if (gotCleanedUp) return;
|
|
1135
1109
|
setHasDecoded(true);
|
|
1136
1110
|
hasDecodedFastPath = true;
|
|
@@ -1385,7 +1359,7 @@ var $b9e830d616d01b31$var$_tmpl$ = ["<div", ' style="position:absolute;width:10p
|
|
|
1385
1359
|
let $b9e830d616d01b31$var$cachedValue;
|
|
1386
1360
|
async function $b9e830d616d01b31$export$7b9a0e99f0aeb2f3() {
|
|
1387
1361
|
if ($b9e830d616d01b31$var$cachedValue != undefined) return $b9e830d616d01b31$var$cachedValue;
|
|
1388
|
-
return $b9e830d616d01b31$var$cachedValue =
|
|
1362
|
+
return $b9e830d616d01b31$var$cachedValue = $b9e830d616d01b31$var$checkIfIsAffectedByChromeBug326498383();
|
|
1389
1363
|
}
|
|
1390
1364
|
async function $b9e830d616d01b31$var$checkIfIsAffectedByChromeBug326498383() {
|
|
1391
1365
|
let isAffected = true;
|
|
@@ -1398,7 +1372,7 @@ async function $b9e830d616d01b31$var$checkIfIsAffectedByChromeBug326498383() {
|
|
|
1398
1372
|
setTimeout($5vyXB$depictaiutilishared.catchify(() => {
|
|
1399
1373
|
r();
|
|
1400
1374
|
div.remove();
|
|
1401
|
-
}),
|
|
1375
|
+
}), 500);
|
|
1402
1376
|
});
|
|
1403
1377
|
const {
|
|
1404
1378
|
style: style
|
|
@@ -1431,7 +1405,7 @@ async function $b9e830d616d01b31$var$checkIfIsAffectedByChromeBug326498383() {
|
|
|
1431
1405
|
}
|
|
1432
1406
|
return isAffected;
|
|
1433
1407
|
}
|
|
1434
|
-
var $905010a06f9aeae5$var$_tmpl$ = ["<div", ' class="scroll-padding">', "</div>"];
|
|
1408
|
+
var $905010a06f9aeae5$var$_tmpl$ = ["<div", ' class="scroll-padding"><div class="', '" style="', '">', "</div></div>"];
|
|
1435
1409
|
function $905010a06f9aeae5$export$ebf0b1d4f90c09ae({
|
|
1436
1410
|
displays_: displays_,
|
|
1437
1411
|
FavoriteButton_: FavoriteButton_,
|
|
@@ -1440,7 +1414,8 @@ function $905010a06f9aeae5$export$ebf0b1d4f90c09ae({
|
|
|
1440
1414
|
animationDuration_: animationDuration_,
|
|
1441
1415
|
supportsHover_: supportsHover_,
|
|
1442
1416
|
priceFormatting_: priceFormatting_,
|
|
1443
|
-
pseudoRouter_: pseudoRouter_
|
|
1417
|
+
pseudoRouter_: pseudoRouter_,
|
|
1418
|
+
containerHeight_: containerHeight_
|
|
1444
1419
|
}) {
|
|
1445
1420
|
let isAffectedByChromeBug = false;
|
|
1446
1421
|
// If the user requests the drawer to be expanded or not
|
|
@@ -1458,13 +1433,9 @@ function $905010a06f9aeae5$export$ebf0b1d4f90c09ae({
|
|
|
1458
1433
|
return containerWidth_() || !displays_();
|
|
1459
1434
|
},
|
|
1460
1435
|
get children() {
|
|
1461
|
-
return $5vyXB$solidjsweb.ssr($905010a06f9aeae5$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
}
|
|
1465
|
-
}, () => displays_() && {
|
|
1466
|
-
style: `--look-card-width:${containerWidth_()}px;--look-item-height:${lookItemHeight() || 200}px`
|
|
1467
|
-
}), () => $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Index), {
|
|
1436
|
+
return $5vyXB$solidjsweb.ssr($905010a06f9aeae5$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), `look-overlay ${userWantsExpanded() ? "expanded" : ""} ${!getSecondPartAnimationRunning() && userWantsExpanded() ? "resting-fully-expanded" : ""}`, $5vyXB$solidjsweb.ssrStyle(displays_() &&
|
|
1437
|
+
// The styling is written like this to eke out animation smoothness on low CPU devices, git blame for previous, more readable versions.
|
|
1438
|
+
`--look-card-width:${containerWidth_()}px;--look-card-height:${containerHeight_()}px;--look-item-height:${lookItemHeight() || 200}px`), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Index), {
|
|
1468
1439
|
get each() {
|
|
1469
1440
|
return displays_() || Array.from({
|
|
1470
1441
|
length: 4
|
|
@@ -1487,7 +1458,7 @@ function $905010a06f9aeae5$export$ebf0b1d4f90c09ae({
|
|
|
1487
1458
|
})
|
|
1488
1459
|
});
|
|
1489
1460
|
}
|
|
1490
|
-
}))
|
|
1461
|
+
})));
|
|
1491
1462
|
}
|
|
1492
1463
|
});
|
|
1493
1464
|
}
|
|
@@ -1513,7 +1484,7 @@ function $905010a06f9aeae5$var$scrollingFunctionForChrome(element, targetScrollY
|
|
|
1513
1484
|
// Bootstrap our animation - it will get called right before next frame shall be rendered.
|
|
1514
1485
|
requestAnimationFrame(step);
|
|
1515
1486
|
}
|
|
1516
|
-
var $ad882bbe664dbd53$var$_tmpl$ = ["<div", ' class="', '"
|
|
1487
|
+
var $ad882bbe664dbd53$var$_tmpl$ = ["<div", ' class="', '"><!--$-->', "<!--/--><!--$-->", "<!--/--></div>"];
|
|
1517
1488
|
function $ad882bbe664dbd53$export$44809a8a3e867e30({
|
|
1518
1489
|
display_: display_,
|
|
1519
1490
|
expandedLooksSignal_: [expandedLooks_, setExpandedLooks],
|
|
@@ -1523,12 +1494,13 @@ function $ad882bbe664dbd53$export$44809a8a3e867e30({
|
|
|
1523
1494
|
priceFormatting_: priceFormatting_,
|
|
1524
1495
|
pseudoRouter_: pseudoRouter_
|
|
1525
1496
|
}) {
|
|
1497
|
+
let container;
|
|
1526
1498
|
const useWantsExpandedSignal_ = $5vyXB$solidjs.createSignal(false);
|
|
1527
1499
|
const [userWantsExpanded, setUserWantsExpanded] = useWantsExpandedSignal_;
|
|
1528
1500
|
const supportsHover_ = $b54e6192d0caa293$export$d9f36cf74e24d595("(hover: hover) and (pointer: fine)");
|
|
1529
1501
|
const us = Symbol("look");
|
|
1530
|
-
const
|
|
1531
|
-
const
|
|
1502
|
+
const [containerWidth_, setContainerWidth] = $5vyXB$solidjs.createSignal();
|
|
1503
|
+
const [containerHeight_, setContainerHeight] = $5vyXB$solidjs.createSignal();
|
|
1532
1504
|
const clickHandler = $5vyXB$depictaiutilishared.catchify(({
|
|
1533
1505
|
target: target
|
|
1534
1506
|
}) => {
|
|
@@ -1549,7 +1521,7 @@ function $ad882bbe664dbd53$export$44809a8a3e867e30({
|
|
|
1549
1521
|
}));
|
|
1550
1522
|
// Close us if another look expands
|
|
1551
1523
|
$5vyXB$solidjs.createEffect(() => !expandedLooks_().has(us) && setUserWantsExpanded(false));
|
|
1552
|
-
$5vyXB$solidjsweb.
|
|
1524
|
+
return $5vyXB$solidjsweb.ssr($ad882bbe664dbd53$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), `look-card ${!display_ ? "placeholder" : ""}`, $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
1553
1525
|
get when() {
|
|
1554
1526
|
return display_();
|
|
1555
1527
|
},
|
|
@@ -1567,7 +1539,7 @@ function $ad882bbe664dbd53$export$44809a8a3e867e30({
|
|
|
1567
1539
|
autoAdjustAspectRatio: true
|
|
1568
1540
|
});
|
|
1569
1541
|
}
|
|
1570
|
-
}), $5vyXB$solidjsweb.createComponent((0, $905010a06f9aeae5$export$ebf0b1d4f90c09ae), {
|
|
1542
|
+
})), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $905010a06f9aeae5$export$ebf0b1d4f90c09ae), {
|
|
1571
1543
|
displays_: () => display_()?.displays,
|
|
1572
1544
|
userWantsExpandedSignal_: useWantsExpandedSignal_,
|
|
1573
1545
|
containerWidth_: containerWidth_,
|
|
@@ -1575,9 +1547,9 @@ function $ad882bbe664dbd53$export$44809a8a3e867e30({
|
|
|
1575
1547
|
supportsHover_: supportsHover_,
|
|
1576
1548
|
FavoriteButton_: FavoriteButton_,
|
|
1577
1549
|
priceFormatting_: priceFormatting_,
|
|
1578
|
-
pseudoRouter_: pseudoRouter_
|
|
1579
|
-
|
|
1580
|
-
|
|
1550
|
+
pseudoRouter_: pseudoRouter_,
|
|
1551
|
+
containerHeight_: containerHeight_
|
|
1552
|
+
})));
|
|
1581
1553
|
}
|
|
1582
1554
|
|
|
1583
1555
|
/**
|
|
@@ -2926,6 +2898,34 @@ let $0b6e2070a98de347$export$44dad306455dddf;
|
|
|
2926
2898
|
DEPICT_ID["SEARCH_PAGE"] = "depict-search-page";
|
|
2927
2899
|
DEPICT_ID["PLP_CATEGORY"] = "depict-plp-category";
|
|
2928
2900
|
})($0b6e2070a98de347$export$44dad306455dddf || ($0b6e2070a98de347$export$44dad306455dddf = {}));
|
|
2901
|
+
|
|
2902
|
+
/** @jsxImportSource solid-js */
|
|
2903
|
+
|
|
2904
|
+
function $f13855d1b951b24a$export$ebdc3711f7e02ccd(what_to_watch) {
|
|
2905
|
+
const [width, setWidth] = $5vyXB$solidjs.createSignal();
|
|
2906
|
+
const resizeObserver = new ResizeObserver($5vyXB$depictaiutilishared.catchify(records => {
|
|
2907
|
+
for (let j = 0; j < records.length; j++) {
|
|
2908
|
+
const width = records[j].borderBoxSize?.[0]?.inlineSize ?? what_to_watch.getBoundingClientRect().width;
|
|
2909
|
+
setWidth(width);
|
|
2910
|
+
}
|
|
2911
|
+
}));
|
|
2912
|
+
// 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.
|
|
2913
|
+
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
2914
|
+
const disconnect = (0, $5vyXB$depictaiutilishared.observer).onexists(what_to_watch, ({
|
|
2915
|
+
element: element
|
|
2916
|
+
}) => requestAnimationFrame($5vyXB$depictaiutilishared.catchify(() => {
|
|
2917
|
+
const current_size = what_to_watch.getBoundingClientRect().width;
|
|
2918
|
+
if (current_size)
|
|
2919
|
+
// 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.
|
|
2920
|
+
setWidth(current_size);
|
|
2921
|
+
resizeObserver.observe(element);
|
|
2922
|
+
})));
|
|
2923
|
+
$5vyXB$solidjs.onCleanup(() => {
|
|
2924
|
+
resizeObserver.disconnect();
|
|
2925
|
+
disconnect();
|
|
2926
|
+
});
|
|
2927
|
+
return width;
|
|
2928
|
+
}
|
|
2929
2929
|
var $0175183387c8923a$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>';
|
|
2930
2930
|
function $0175183387c8923a$export$f7658c347b037c3f(props = {}) {
|
|
2931
2931
|
return $5vyXB$solidjsweb.ssrElement("svg", $5vyXB$solidjsweb.mergeProps({
|
package/server/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.8";
|
|
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
|
*/
|
|
@@ -185,10 +185,6 @@ export function ImagePlaceholder(props: ImagePlaceholderBaseOptions & (ImagePlac
|
|
|
185
185
|
* Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
|
|
186
186
|
*/
|
|
187
187
|
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
188
|
/**
|
|
193
189
|
* 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
190
|
* If you want a block version, use `ImagePlaceholder` with `width`and `height` set instead.
|
|
@@ -515,6 +511,10 @@ export function CrossIcon(props?: JSX.SvgSVGAttributes<SVGSVGElement>): SVGEleme
|
|
|
515
511
|
* Symbol used to identify the version of a SearchModal function. Values right now: 1 = 1st gen classic modal, 2 = second gen modal
|
|
516
512
|
*/
|
|
517
513
|
export const modalVersionSymbol: unique symbol;
|
|
514
|
+
/**
|
|
515
|
+
* Returns accessor with the size of the provided element, including padding and border (I think)
|
|
516
|
+
*/
|
|
517
|
+
export function make_accurate_width_accessor(what_to_watch: HTMLElement): import("solid-js").Accessor<number | undefined>;
|
|
518
518
|
/**
|
|
519
519
|
* 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
520
|
* @param clickEvent The click event that triggered the navigation
|
|
@@ -902,7 +902,7 @@ export function LookCard({
|
|
|
902
902
|
expandedLooksSignal_: Signal<Set<symbol>>;
|
|
903
903
|
priceFormatting_: Accessor<plp_shared_i18n["price_formatting_"]>;
|
|
904
904
|
pseudoRouter_: PseudoRouter;
|
|
905
|
-
}):
|
|
905
|
+
}): JSX.Element;
|
|
906
906
|
/**
|
|
907
907
|
* Render a grid with provided recommendations. displayTransformers will not be applied for this since you yourself provide the displays. Options are reactive.
|
|
908
908
|
*/
|