@depict-ai/ui 4.7.6 → 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/latest/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { add_to_version_info as $9HbP8$add_to_version_info, useExpandingContainer as $9HbP8$useExpandingContainer, fetch_retry as $9HbP8$fetch_retry, base_url as $9HbP8$base_url, dwarn as $9HbP8$dwarn, slider_fractional_factory as $9HbP8$slider_fractional_factory, dlog as $9HbP8$dlog, camelCasifyObject as $9HbP8$camelCasifyObject, make_random_classname as $9HbP8$make_random_classname, n_col_styling_with_dist as $9HbP8$n_col_styling_with_dist, catchify as $9HbP8$catchify, layout_get_visible_recs_without_partial_rows as $9HbP8$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $9HbP8$layout_get_total_rec_amount_for_row, layout_media_query_header as $9HbP8$layout_media_query_header, report as $9HbP8$report, slider_fading_factory as $9HbP8$slider_fading_factory, Amazing_Slider as $9HbP8$Amazing_Slider, slider_snap_css as $9HbP8$slider_snap_css, observer as $9HbP8$observer, javascript_media_query as $9HbP8$javascript_media_query, queueMacroTask as $9HbP8$queueMacroTask, findMostFrequentItem as $9HbP8$findMostFrequentItem, standard_price_format as $9HbP8$standard_price_format, instant_exec_on_suspect_history_change as $9HbP8$instant_exec_on_suspect_history_change, deparallelize_no_drop as $9HbP8$deparallelize_no_drop, ContainedImage as $9HbP8$ContainedImage, buildThresholdList as $9HbP8$buildThresholdList, make_asyncIterable_exiter as $9HbP8$make_asyncIterable_exiter, href_change_ipns as $9HbP8$href_change_ipns, base64_encode_unicode as $9HbP8$base64_encode_unicode, base64_decode_unicode as $9HbP8$base64_decode_unicode, use_href_accessor as $9HbP8$use_href_accessor, get_session_id as $9HbP8$get_session_id, add_version_query_params as $9HbP8$add_version_query_params, hex_to_rgb as $9HbP8$hex_to_rgb, relative_luminance_from_rgb as $9HbP8$relative_luminance_from_rgb, snakeCasifyObject as $9HbP8$snakeCasifyObject, sort_obj as $9HbP8$sort_obj, make_url_with_query_params as $9HbP8$make_url_with_query_params, insert_surfaces as $9HbP8$insert_surfaces, is_debug as $9HbP8$is_debug } from "@depict-ai/utilishared/latest";
|
|
2
|
-
import { createComponent as $9HbP8$createComponent, insert as $9HbP8$insert, template as $9HbP8$template, getNextElement as $9HbP8$getNextElement, mergeProps as $9HbP8$mergeProps, effect as $9HbP8$effect, className as $9HbP8$className, isServer as $9HbP8$isServer, spread as $9HbP8$spread, runHydrationEvents as $9HbP8$runHydrationEvents, addEventListener as $9HbP8$addEventListener, memo as $9HbP8$memo, delegateEvents as $9HbP8$delegateEvents, getNextMarker as $9HbP8$getNextMarker, classList as $9HbP8$classList, setAttribute as $9HbP8$setAttribute,
|
|
2
|
+
import { createComponent as $9HbP8$createComponent, insert as $9HbP8$insert, template as $9HbP8$template, getNextElement as $9HbP8$getNextElement, mergeProps as $9HbP8$mergeProps, effect as $9HbP8$effect, className as $9HbP8$className, isServer as $9HbP8$isServer, spread as $9HbP8$spread, runHydrationEvents as $9HbP8$runHydrationEvents, addEventListener as $9HbP8$addEventListener, memo as $9HbP8$memo, delegateEvents as $9HbP8$delegateEvents, getNextMarker as $9HbP8$getNextMarker, classList as $9HbP8$classList, setAttribute as $9HbP8$setAttribute, use as $9HbP8$use, style as $9HbP8$style, setProperty as $9HbP8$setProperty, Dynamic as $9HbP8$Dynamic } from "solid-js/web";
|
|
3
3
|
import { createSignal as $9HbP8$createSignal, createMemo as $9HbP8$createMemo, createResource as $9HbP8$createResource, createEffect as $9HbP8$createEffect, Show as $9HbP8$Show, mergeProps as $9HbP8$mergeProps1, Suspense as $9HbP8$Suspense, untrack as $9HbP8$untrack, createRenderEffect as $9HbP8$createRenderEffect, Index as $9HbP8$Index, createRoot as $9HbP8$createRoot, onCleanup as $9HbP8$onCleanup, For as $9HbP8$For, getOwner as $9HbP8$getOwner, runWithOwner as $9HbP8$runWithOwner, createContext as $9HbP8$createContext, useContext as $9HbP8$useContext, createUniqueId as $9HbP8$createUniqueId, createComputed as $9HbP8$createComputed, ErrorBoundary as $9HbP8$ErrorBoundary, splitProps as $9HbP8$splitProps, on as $9HbP8$on, batch as $9HbP8$batch, createSelector as $9HbP8$createSelector, children as $9HbP8$children, createReaction as $9HbP8$createReaction, mapArray as $9HbP8$mapArray } from "solid-js";
|
|
4
4
|
import { ListenableSet as $9HbP8$ListenableSet, catchify as $9HbP8$catchify1, use_href_accessor as $9HbP8$use_href_accessor1, queueMacroTask as $9HbP8$queueMacroTask1, report as $9HbP8$report1 } from "@depict-ai/utilishared/latest";
|
|
5
5
|
import { createStore as $9HbP8$createStore, reconcile as $9HbP8$reconcile } from "solid-js/store";
|
|
@@ -7,7 +7,7 @@ import { createStore as $9HbP8$createStore, reconcile as $9HbP8$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.8";
|
|
11
11
|
function $24e27fab9c821b86$export$5bad61ecde080b1f(...params) {
|
|
12
12
|
const {
|
|
13
13
|
collapse: collapse,
|
|
@@ -850,34 +850,6 @@ function $dc9262ef6f786812$export$d9f36cf74e24d595(media_query) {
|
|
|
850
850
|
}) => signal[1](matches)).remove);
|
|
851
851
|
return signal[0];
|
|
852
852
|
}
|
|
853
|
-
|
|
854
|
-
/** @jsxImportSource solid-js */
|
|
855
|
-
|
|
856
|
-
function $2449872a62a75a20$export$ebdc3711f7e02ccd(what_to_watch) {
|
|
857
|
-
const [width, setWidth] = $9HbP8$createSignal();
|
|
858
|
-
const resizeObserver = new ResizeObserver($9HbP8$catchify(records => {
|
|
859
|
-
for (let j = 0; j < records.length; j++) {
|
|
860
|
-
const width = records[j].borderBoxSize?.[0]?.inlineSize ?? what_to_watch.getBoundingClientRect().width;
|
|
861
|
-
setWidth(width);
|
|
862
|
-
}
|
|
863
|
-
}));
|
|
864
|
-
// 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.
|
|
865
|
-
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
866
|
-
const disconnect = (0, $9HbP8$observer).onexists(what_to_watch, ({
|
|
867
|
-
element: element
|
|
868
|
-
}) => requestAnimationFrame($9HbP8$catchify(() => {
|
|
869
|
-
const current_size = what_to_watch.getBoundingClientRect().width;
|
|
870
|
-
if (current_size)
|
|
871
|
-
// 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.
|
|
872
|
-
setWidth(current_size);
|
|
873
|
-
resizeObserver.observe(element);
|
|
874
|
-
})));
|
|
875
|
-
$9HbP8$onCleanup(() => {
|
|
876
|
-
resizeObserver.disconnect();
|
|
877
|
-
disconnect();
|
|
878
|
-
});
|
|
879
|
-
return width;
|
|
880
|
-
}
|
|
881
853
|
function $d134eae24341b4a1$export$89c6019e4baa40b1(props) {
|
|
882
854
|
const style = $9HbP8$createMemo(() => {
|
|
883
855
|
const {
|
|
@@ -1037,9 +1009,10 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
1037
1009
|
});
|
|
1038
1010
|
// 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
|
|
1039
1011
|
// Happened on singular, they have some weird observer (+we also have one but ours is at least 3x more efficient)
|
|
1040
|
-
const executeWhenIdleBatched = fn => {
|
|
1012
|
+
const executeWhenIdleBatched = (fn, isSizesUpdate) => {
|
|
1041
1013
|
if (typeof requestIdleCallback !== "function") return setTimeout(fn); // Old browsers don't get optimisation
|
|
1042
|
-
if ($9HbP8$untrack(isPrioritisedImage)) return fn(); // If we're one of the first 8 images, execute the callbacks immediately
|
|
1014
|
+
if ((!isSizesUpdate || !sizeSetFastPath) && $9HbP8$untrack(isPrioritisedImage)) return fn(); // If we're one of the first 8 images, execute the callbacks immediately (improves lighthouse metrics)
|
|
1015
|
+
// 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)
|
|
1043
1016
|
const existingStack = listingContext?.[$e8ffe11ed01df0fe$var$onIdleFunctionsSymbol];
|
|
1044
1017
|
if (existingStack) return existingStack.add(fn);
|
|
1045
1018
|
const newStack = new Set([fn]);
|
|
@@ -1121,10 +1094,11 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
1121
1094
|
// This greatly improves performance when loading (more) products
|
|
1122
1095
|
// See https://depictaiworkspace.slack.com/archives/C05NJ0K3WRL/p1698220617663139
|
|
1123
1096
|
timeoutSet = true; // Important to set timeoutSet before the call to executeWhenIdleBatched since if this is an important image executeWhenIdleBatched will execute fn immediately
|
|
1124
|
-
executeWhenIdleBatched(handler);
|
|
1097
|
+
executeWhenIdleBatched(handler, true);
|
|
1125
1098
|
});
|
|
1099
|
+
const dontLoadImageYet = $9HbP8$createMemo(() => !props.size() || !hasSetSize()); // Moving this condition into a memo saves us from re-setting src and srcset (expensive) if just props.size changes
|
|
1126
1100
|
$9HbP8$createEffect(() => {
|
|
1127
|
-
if (
|
|
1101
|
+
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
|
|
1128
1102
|
Object.assign(img, src_options());
|
|
1129
1103
|
// Add to DOM once decoded to not require/block any paints before image has completed loading and avoid showing broken image symbol
|
|
1130
1104
|
// We can do this because there has to be a container around us giving us a size
|
|
@@ -1140,7 +1114,7 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
1140
1114
|
img.decode().catch(e => $9HbP8$dwarn("Failed to decode image", e, img)) // Display the image also if loading failed so webdev can debug and doesn't get "no image"
|
|
1141
1115
|
.then(async () => {
|
|
1142
1116
|
// Also wait with inserting image (i.e. paint) until browser is idle
|
|
1143
|
-
await new Promise(r => executeWhenIdleBatched(r));
|
|
1117
|
+
await new Promise(r => executeWhenIdleBatched(r, false));
|
|
1144
1118
|
if (gotCleanedUp) return;
|
|
1145
1119
|
setHasDecoded(true);
|
|
1146
1120
|
hasDecodedFastPath = true;
|
|
@@ -1471,7 +1445,7 @@ var $62a8f670f8464532$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div style=posi
|
|
|
1471
1445
|
let $62a8f670f8464532$var$cachedValue;
|
|
1472
1446
|
async function $62a8f670f8464532$export$7b9a0e99f0aeb2f3() {
|
|
1473
1447
|
if ($62a8f670f8464532$var$cachedValue != undefined) return $62a8f670f8464532$var$cachedValue;
|
|
1474
|
-
return $62a8f670f8464532$var$cachedValue =
|
|
1448
|
+
return $62a8f670f8464532$var$cachedValue = $62a8f670f8464532$var$checkIfIsAffectedByChromeBug326498383();
|
|
1475
1449
|
}
|
|
1476
1450
|
async function $62a8f670f8464532$var$checkIfIsAffectedByChromeBug326498383() {
|
|
1477
1451
|
let isAffected = true;
|
|
@@ -1484,7 +1458,7 @@ async function $62a8f670f8464532$var$checkIfIsAffectedByChromeBug326498383() {
|
|
|
1484
1458
|
setTimeout($9HbP8$catchify(() => {
|
|
1485
1459
|
r();
|
|
1486
1460
|
div.remove();
|
|
1487
|
-
}),
|
|
1461
|
+
}), 500);
|
|
1488
1462
|
});
|
|
1489
1463
|
const {
|
|
1490
1464
|
style: style
|
|
@@ -1526,7 +1500,8 @@ function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
|
|
|
1526
1500
|
animationDuration_: animationDuration_,
|
|
1527
1501
|
supportsHover_: supportsHover_,
|
|
1528
1502
|
priceFormatting_: priceFormatting_,
|
|
1529
|
-
pseudoRouter_: pseudoRouter_
|
|
1503
|
+
pseudoRouter_: pseudoRouter_,
|
|
1504
|
+
containerHeight_: containerHeight_
|
|
1530
1505
|
}) {
|
|
1531
1506
|
let isAffectedByChromeBug = false;
|
|
1532
1507
|
// If the user requests the drawer to be expanded or not
|
|
@@ -1546,6 +1521,8 @@ function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
|
|
|
1546
1521
|
get children() {
|
|
1547
1522
|
var _el$ = $9HbP8$getNextElement($7555dcad3b8a4632$var$_tmpl$),
|
|
1548
1523
|
_el$2 = _el$.firstChild;
|
|
1524
|
+
$9HbP8$addEventListener(_el$2, "mouseleave", $9HbP8$catchify(() => supportsHover_() && setUserWantsExpanded(false)));
|
|
1525
|
+
$9HbP8$addEventListener(_el$2, "mouseenter", $9HbP8$catchify(() => supportsHover_() && setUserWantsExpanded(true)));
|
|
1549
1526
|
$9HbP8$use(el => $9HbP8$createEffect(() => {
|
|
1550
1527
|
if (userWantsExpanded()) return;
|
|
1551
1528
|
if (isAffectedByChromeBug) {
|
|
@@ -1557,22 +1534,6 @@ function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
|
|
|
1557
1534
|
behavior: "smooth"
|
|
1558
1535
|
});
|
|
1559
1536
|
}), _el$2);
|
|
1560
|
-
$9HbP8$spread(_el$2, $9HbP8$mergeProps({
|
|
1561
|
-
get classList() {
|
|
1562
|
-
return {
|
|
1563
|
-
expanded: userWantsExpanded(),
|
|
1564
|
-
"resting-fully-expanded": !getSecondPartAnimationRunning() && userWantsExpanded()
|
|
1565
|
-
};
|
|
1566
|
-
},
|
|
1567
|
-
get onMouseEnter() {
|
|
1568
|
-
return $9HbP8$catchify(() => supportsHover_() && setUserWantsExpanded(true));
|
|
1569
|
-
},
|
|
1570
|
-
get onMouseLeave() {
|
|
1571
|
-
return $9HbP8$catchify(() => supportsHover_() && setUserWantsExpanded(false));
|
|
1572
|
-
}
|
|
1573
|
-
}, () => displays_() && {
|
|
1574
|
-
style: `--look-card-width:${containerWidth_()}px;--look-item-height:${lookItemHeight() || 200}px`
|
|
1575
|
-
}), false, true);
|
|
1576
1537
|
$9HbP8$insert(_el$2, $9HbP8$createComponent((0, $9HbP8$Index), {
|
|
1577
1538
|
get each() {
|
|
1578
1539
|
return displays_() || Array.from({
|
|
@@ -1597,7 +1558,21 @@ function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
|
|
|
1597
1558
|
});
|
|
1598
1559
|
}
|
|
1599
1560
|
}));
|
|
1600
|
-
$9HbP8$
|
|
1561
|
+
$9HbP8$effect(_p$ => {
|
|
1562
|
+
var _v$ = !!userWantsExpanded(),
|
|
1563
|
+
_v$2 = !!(!getSecondPartAnimationRunning() && userWantsExpanded()),
|
|
1564
|
+
_v$3 = displays_() &&
|
|
1565
|
+
// The styling is written like this to eke out animation smoothness on low CPU devices, git blame for previous, more readable versions.
|
|
1566
|
+
`--look-card-width:${containerWidth_()}px;--look-card-height:${containerHeight_()}px;--look-item-height:${lookItemHeight() || 200}px`;
|
|
1567
|
+
_v$ !== _p$.e && _el$2.classList.toggle("expanded", _p$.e = _v$);
|
|
1568
|
+
_v$2 !== _p$.t && _el$2.classList.toggle("resting-fully-expanded", _p$.t = _v$2);
|
|
1569
|
+
_p$.a = $9HbP8$style(_el$2, _v$3, _p$.a);
|
|
1570
|
+
return _p$;
|
|
1571
|
+
}, {
|
|
1572
|
+
e: undefined,
|
|
1573
|
+
t: undefined,
|
|
1574
|
+
a: undefined
|
|
1575
|
+
});
|
|
1601
1576
|
return _el$;
|
|
1602
1577
|
}
|
|
1603
1578
|
});
|
|
@@ -1624,7 +1599,7 @@ function $7555dcad3b8a4632$var$scrollingFunctionForChrome(element, targetScrollY
|
|
|
1624
1599
|
// Bootstrap our animation - it will get called right before next frame shall be rendered.
|
|
1625
1600
|
requestAnimationFrame(step);
|
|
1626
1601
|
}
|
|
1627
|
-
var $28ee4f7db3cc44b8$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=look-card
|
|
1602
|
+
var $28ee4f7db3cc44b8$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=look-card><!$><!/><!$><!/>`);
|
|
1628
1603
|
function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
1629
1604
|
display_: display_,
|
|
1630
1605
|
expandedLooksSignal_: [expandedLooks_, setExpandedLooks],
|
|
@@ -1634,20 +1609,13 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1634
1609
|
priceFormatting_: priceFormatting_,
|
|
1635
1610
|
pseudoRouter_: pseudoRouter_
|
|
1636
1611
|
}) {
|
|
1612
|
+
let container;
|
|
1637
1613
|
const useWantsExpandedSignal_ = $9HbP8$createSignal(false);
|
|
1638
1614
|
const [userWantsExpanded, setUserWantsExpanded] = useWantsExpandedSignal_;
|
|
1639
1615
|
const supportsHover_ = $dc9262ef6f786812$export$d9f36cf74e24d595("(hover: hover) and (pointer: fine)");
|
|
1640
1616
|
const us = Symbol("look");
|
|
1641
|
-
const
|
|
1642
|
-
|
|
1643
|
-
$9HbP8$addEventListener(_el$, "click", $9HbP8$catchify(({
|
|
1644
|
-
target: target
|
|
1645
|
-
}) => setUserWantsExpanded(prev => !prev)), true);
|
|
1646
|
-
$9HbP8$effect(() => _el$.classList.toggle("placeholder", !display_()));
|
|
1647
|
-
$9HbP8$runHydrationEvents();
|
|
1648
|
-
return _el$;
|
|
1649
|
-
})();
|
|
1650
|
-
const containerWidth_ = $2449872a62a75a20$export$ebdc3711f7e02ccd(container);
|
|
1617
|
+
const [containerWidth_, setContainerWidth] = $9HbP8$createSignal();
|
|
1618
|
+
const [containerHeight_, setContainerHeight] = $9HbP8$createSignal();
|
|
1651
1619
|
const clickHandler = $9HbP8$catchify(({
|
|
1652
1620
|
target: target
|
|
1653
1621
|
}) => {
|
|
@@ -1668,35 +1636,62 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1668
1636
|
}));
|
|
1669
1637
|
// Close us if another look expands
|
|
1670
1638
|
$9HbP8$createEffect(() => !expandedLooks_().has(us) && setUserWantsExpanded(false));
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1639
|
+
return (() => {
|
|
1640
|
+
var _el$ = $9HbP8$getNextElement($28ee4f7db3cc44b8$var$_tmpl$),
|
|
1641
|
+
_el$2 = _el$.firstChild,
|
|
1642
|
+
[_el$3, _co$] = $9HbP8$getNextMarker(_el$2.nextSibling),
|
|
1643
|
+
_el$4 = _el$3.nextSibling,
|
|
1644
|
+
[_el$5, _co$2] = $9HbP8$getNextMarker(_el$4.nextSibling);
|
|
1645
|
+
$9HbP8$addEventListener(_el$, "click", $9HbP8$catchify(() => setUserWantsExpanded(prev => !prev)), true);
|
|
1646
|
+
$9HbP8$use(el => {
|
|
1647
|
+
container = el;
|
|
1648
|
+
const ro = new ResizeObserver($9HbP8$catchify(records => {
|
|
1649
|
+
const last = records.at(-1);
|
|
1650
|
+
if (!last) return;
|
|
1651
|
+
const {
|
|
1652
|
+
width: width,
|
|
1653
|
+
height: height
|
|
1654
|
+
} = last.contentRect;
|
|
1655
|
+
setContainerWidth(width);
|
|
1656
|
+
setContainerHeight(height);
|
|
1657
|
+
}));
|
|
1658
|
+
ro.observe(el);
|
|
1659
|
+
$9HbP8$onCleanup(() => ro.disconnect());
|
|
1660
|
+
}, _el$);
|
|
1661
|
+
_el$.classList.toggle("placeholder", !!!display_);
|
|
1662
|
+
$9HbP8$insert(_el$, $9HbP8$createComponent((0, $9HbP8$Show), {
|
|
1663
|
+
get when() {
|
|
1664
|
+
return display_();
|
|
1665
|
+
},
|
|
1666
|
+
get fallback() {
|
|
1667
|
+
return $9HbP8$createComponent((0, $7f60f09116a3fe61$export$3f37af283f8fb843), {
|
|
1668
|
+
aspectRatio: `var(${(0, $bb15dfb548a7666e$export$8a2234b5b1a5ebd4)}, ${placeholderImageAspectRatio_})`
|
|
1669
|
+
});
|
|
1670
|
+
},
|
|
1671
|
+
get children() {
|
|
1672
|
+
return $9HbP8$createComponent((0, $70bb27cc6be01fc7$export$9d4a4b669b1929ab), {
|
|
1673
|
+
get src() {
|
|
1674
|
+
return display_()?.image_urls?.[0];
|
|
1675
|
+
},
|
|
1676
|
+
aspectRatio: placeholderImageAspectRatio_,
|
|
1677
|
+
autoAdjustAspectRatio: true
|
|
1678
|
+
});
|
|
1679
|
+
}
|
|
1680
|
+
}), _el$3, _co$);
|
|
1681
|
+
$9HbP8$insert(_el$, $9HbP8$createComponent((0, $7555dcad3b8a4632$export$ebf0b1d4f90c09ae), {
|
|
1682
|
+
displays_: () => display_()?.displays,
|
|
1683
|
+
userWantsExpandedSignal_: useWantsExpandedSignal_,
|
|
1684
|
+
containerWidth_: containerWidth_,
|
|
1685
|
+
animationDuration_: animationDuration_,
|
|
1686
|
+
supportsHover_: supportsHover_,
|
|
1687
|
+
FavoriteButton_: FavoriteButton_,
|
|
1688
|
+
priceFormatting_: priceFormatting_,
|
|
1689
|
+
pseudoRouter_: pseudoRouter_,
|
|
1690
|
+
containerHeight_: containerHeight_
|
|
1691
|
+
}), _el$5, _co$2);
|
|
1692
|
+
$9HbP8$runHydrationEvents();
|
|
1693
|
+
return _el$;
|
|
1694
|
+
})();
|
|
1700
1695
|
}
|
|
1701
1696
|
$9HbP8$delegateEvents(["click"]);
|
|
1702
1697
|
|
|
@@ -3360,6 +3355,34 @@ let $f86ba724282f6690$export$44dad306455dddf;
|
|
|
3360
3355
|
DEPICT_ID["SEARCH_PAGE"] = "depict-search-page";
|
|
3361
3356
|
DEPICT_ID["PLP_CATEGORY"] = "depict-plp-category";
|
|
3362
3357
|
})($f86ba724282f6690$export$44dad306455dddf || ($f86ba724282f6690$export$44dad306455dddf = {}));
|
|
3358
|
+
|
|
3359
|
+
/** @jsxImportSource solid-js */
|
|
3360
|
+
|
|
3361
|
+
function $2449872a62a75a20$export$ebdc3711f7e02ccd(what_to_watch) {
|
|
3362
|
+
const [width, setWidth] = $9HbP8$createSignal();
|
|
3363
|
+
const resizeObserver = new ResizeObserver($9HbP8$catchify(records => {
|
|
3364
|
+
for (let j = 0; j < records.length; j++) {
|
|
3365
|
+
const width = records[j].borderBoxSize?.[0]?.inlineSize ?? what_to_watch.getBoundingClientRect().width;
|
|
3366
|
+
setWidth(width);
|
|
3367
|
+
}
|
|
3368
|
+
}));
|
|
3369
|
+
// 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.
|
|
3370
|
+
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
3371
|
+
const disconnect = (0, $9HbP8$observer).onexists(what_to_watch, ({
|
|
3372
|
+
element: element
|
|
3373
|
+
}) => requestAnimationFrame($9HbP8$catchify(() => {
|
|
3374
|
+
const current_size = what_to_watch.getBoundingClientRect().width;
|
|
3375
|
+
if (current_size)
|
|
3376
|
+
// 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.
|
|
3377
|
+
setWidth(current_size);
|
|
3378
|
+
resizeObserver.observe(element);
|
|
3379
|
+
})));
|
|
3380
|
+
$9HbP8$onCleanup(() => {
|
|
3381
|
+
resizeObserver.disconnect();
|
|
3382
|
+
disconnect();
|
|
3383
|
+
});
|
|
3384
|
+
return width;
|
|
3385
|
+
}
|
|
3363
3386
|
var $081752ca508a876f$var$_tmpl$ = /*#__PURE__*/$9HbP8$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>`);
|
|
3364
3387
|
function $081752ca508a876f$export$f7658c347b037c3f(props = {}) {
|
|
3365
3388
|
return (() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/ui",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.8",
|
|
4
4
|
"description": "Base package containing the actual UI of Depict UI along with translations, with a not-simplified API. We recommend using @depict-ai/js-ui or @depict-ai/react-ui instead.",
|
|
5
5
|
"packageManager": "yarn@3.2.2",
|
|
6
6
|
"sass": "styles.scss",
|
|
@@ -236,9 +236,9 @@
|
|
|
236
236
|
"@babel/plugin-transform-typescript": "^7.22.9",
|
|
237
237
|
"@babel/runtime": "latest",
|
|
238
238
|
"@babel/runtime-corejs3": "^7.22.6",
|
|
239
|
-
"@depict-ai/plp-styling": "^4.4.
|
|
240
|
-
"@depict-ai/types": "^5.4.
|
|
241
|
-
"@depict-ai/utilishared": "^2.4.
|
|
239
|
+
"@depict-ai/plp-styling": "^4.4.3",
|
|
240
|
+
"@depict-ai/types": "^5.4.2",
|
|
241
|
+
"@depict-ai/utilishared": "^2.4.3",
|
|
242
242
|
"solid-js": "^1.8.12"
|
|
243
243
|
},
|
|
244
244
|
"type": "module",
|
package/server/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.8";
|
|
108
108
|
function $d6d51b09cb2116a6$export$5bad61ecde080b1f() {
|
|
109
109
|
const {
|
|
110
110
|
collapse: collapse,
|
|
@@ -908,38 +908,6 @@ function $3e17e871e9d0911d$export$d9f36cf74e24d595(media_query) {
|
|
|
908
908
|
}).remove);
|
|
909
909
|
return signal[0];
|
|
910
910
|
}
|
|
911
|
-
|
|
912
|
-
/** @jsxImportSource solid-js */
|
|
913
|
-
|
|
914
|
-
function $c387d7f1d9fb66c0$export$ebdc3711f7e02ccd(what_to_watch) {
|
|
915
|
-
const [width, setWidth] = $3hooq$solidjs.createSignal();
|
|
916
|
-
const resizeObserver = new ResizeObserver($3hooq$depictaiutilishared.catchify(records => {
|
|
917
|
-
for (let j = 0; j < records.length; j++) {
|
|
918
|
-
var _records$j$borderBoxS, _records$j$borderBoxS2, _records$j$borderBoxS3;
|
|
919
|
-
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;
|
|
920
|
-
setWidth(width);
|
|
921
|
-
}
|
|
922
|
-
}));
|
|
923
|
-
// 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.
|
|
924
|
-
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
925
|
-
const disconnect = (0, $3hooq$depictaiutilishared.observer).onexists(what_to_watch, _ref => {
|
|
926
|
-
let {
|
|
927
|
-
element: element
|
|
928
|
-
} = _ref;
|
|
929
|
-
return requestAnimationFrame($3hooq$depictaiutilishared.catchify(() => {
|
|
930
|
-
const current_size = what_to_watch.getBoundingClientRect().width;
|
|
931
|
-
if (current_size)
|
|
932
|
-
// 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.
|
|
933
|
-
setWidth(current_size);
|
|
934
|
-
resizeObserver.observe(element);
|
|
935
|
-
}));
|
|
936
|
-
});
|
|
937
|
-
$3hooq$solidjs.onCleanup(() => {
|
|
938
|
-
resizeObserver.disconnect();
|
|
939
|
-
disconnect();
|
|
940
|
-
});
|
|
941
|
-
return width;
|
|
942
|
-
}
|
|
943
911
|
function $a7f7d416e6f61504$export$89c6019e4baa40b1(props) {
|
|
944
912
|
const style = $3hooq$solidjs.createMemo(() => {
|
|
945
913
|
const {
|
|
@@ -1078,9 +1046,10 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
|
1078
1046
|
});
|
|
1079
1047
|
// 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
|
|
1080
1048
|
// Happened on singular, they have some weird observer (+we also have one but ours is at least 3x more efficient)
|
|
1081
|
-
const executeWhenIdleBatched = fn => {
|
|
1049
|
+
const executeWhenIdleBatched = (fn, isSizesUpdate) => {
|
|
1082
1050
|
if (typeof requestIdleCallback !== "function") return setTimeout(fn); // Old browsers don't get optimisation
|
|
1083
|
-
if ($3hooq$solidjs.untrack(isPrioritisedImage)) return fn(); // If we're one of the first 8 images, execute the callbacks immediately
|
|
1051
|
+
if ((!isSizesUpdate || !sizeSetFastPath) && $3hooq$solidjs.untrack(isPrioritisedImage)) return fn(); // If we're one of the first 8 images, execute the callbacks immediately (improves lighthouse metrics)
|
|
1052
|
+
// 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)
|
|
1084
1053
|
const existingStack = listingContext === null || listingContext === void 0 ? void 0 : listingContext[$858fdcf73148519f$var$onIdleFunctionsSymbol];
|
|
1085
1054
|
if (existingStack) return existingStack.add(fn);
|
|
1086
1055
|
const newStack = new Set([fn]);
|
|
@@ -1165,10 +1134,11 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
|
1165
1134
|
// This greatly improves performance when loading (more) products
|
|
1166
1135
|
// See https://depictaiworkspace.slack.com/archives/C05NJ0K3WRL/p1698220617663139
|
|
1167
1136
|
timeoutSet = true; // Important to set timeoutSet before the call to executeWhenIdleBatched since if this is an important image executeWhenIdleBatched will execute fn immediately
|
|
1168
|
-
executeWhenIdleBatched(handler);
|
|
1137
|
+
executeWhenIdleBatched(handler, true);
|
|
1169
1138
|
});
|
|
1139
|
+
const dontLoadImageYet = $3hooq$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
|
|
1170
1140
|
$3hooq$solidjs.createEffect(() => {
|
|
1171
|
-
if (
|
|
1141
|
+
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
|
|
1172
1142
|
Object.assign(img, src_options());
|
|
1173
1143
|
// Add to DOM once decoded to not require/block any paints before image has completed loading and avoid showing broken image symbol
|
|
1174
1144
|
// We can do this because there has to be a container around us giving us a size
|
|
@@ -1184,7 +1154,7 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
|
1184
1154
|
img.decode().catch(e => $3hooq$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"
|
|
1185
1155
|
.then(async () => {
|
|
1186
1156
|
// Also wait with inserting image (i.e. paint) until browser is idle
|
|
1187
|
-
await new Promise(r => executeWhenIdleBatched(r));
|
|
1157
|
+
await new Promise(r => executeWhenIdleBatched(r, false));
|
|
1188
1158
|
if (gotCleanedUp) return;
|
|
1189
1159
|
setHasDecoded(true);
|
|
1190
1160
|
hasDecodedFastPath = true;
|
|
@@ -1461,7 +1431,7 @@ var $dfa95866b27a2a53$var$_tmpl$ = ["<div", ' style="position:absolute;width:10p
|
|
|
1461
1431
|
let $dfa95866b27a2a53$var$cachedValue;
|
|
1462
1432
|
async function $dfa95866b27a2a53$export$7b9a0e99f0aeb2f3() {
|
|
1463
1433
|
if ($dfa95866b27a2a53$var$cachedValue != undefined) return $dfa95866b27a2a53$var$cachedValue;
|
|
1464
|
-
return $dfa95866b27a2a53$var$cachedValue =
|
|
1434
|
+
return $dfa95866b27a2a53$var$cachedValue = $dfa95866b27a2a53$var$checkIfIsAffectedByChromeBug326498383();
|
|
1465
1435
|
}
|
|
1466
1436
|
async function $dfa95866b27a2a53$var$checkIfIsAffectedByChromeBug326498383() {
|
|
1467
1437
|
let isAffected = true;
|
|
@@ -1474,7 +1444,7 @@ async function $dfa95866b27a2a53$var$checkIfIsAffectedByChromeBug326498383() {
|
|
|
1474
1444
|
setTimeout($3hooq$depictaiutilishared.catchify(() => {
|
|
1475
1445
|
r();
|
|
1476
1446
|
div.remove();
|
|
1477
|
-
}),
|
|
1447
|
+
}), 500);
|
|
1478
1448
|
});
|
|
1479
1449
|
const {
|
|
1480
1450
|
style: style
|
|
@@ -1507,7 +1477,7 @@ async function $dfa95866b27a2a53$var$checkIfIsAffectedByChromeBug326498383() {
|
|
|
1507
1477
|
}
|
|
1508
1478
|
return isAffected;
|
|
1509
1479
|
}
|
|
1510
|
-
var $e0b3f1f332b6863b$var$_tmpl$ = ["<div", ' class="scroll-padding">', "</div>"];
|
|
1480
|
+
var $e0b3f1f332b6863b$var$_tmpl$ = ["<div", ' class="scroll-padding"><div class="', '" style="', '">', "</div></div>"];
|
|
1511
1481
|
function $e0b3f1f332b6863b$export$ebf0b1d4f90c09ae(_ref) {
|
|
1512
1482
|
let {
|
|
1513
1483
|
displays_: displays_,
|
|
@@ -1517,7 +1487,8 @@ function $e0b3f1f332b6863b$export$ebf0b1d4f90c09ae(_ref) {
|
|
|
1517
1487
|
animationDuration_: animationDuration_,
|
|
1518
1488
|
supportsHover_: supportsHover_,
|
|
1519
1489
|
priceFormatting_: priceFormatting_,
|
|
1520
|
-
pseudoRouter_: pseudoRouter_
|
|
1490
|
+
pseudoRouter_: pseudoRouter_,
|
|
1491
|
+
containerHeight_: containerHeight_
|
|
1521
1492
|
} = _ref;
|
|
1522
1493
|
let isAffectedByChromeBug = false;
|
|
1523
1494
|
// If the user requests the drawer to be expanded or not
|
|
@@ -1535,13 +1506,9 @@ function $e0b3f1f332b6863b$export$ebf0b1d4f90c09ae(_ref) {
|
|
|
1535
1506
|
return containerWidth_() || !displays_();
|
|
1536
1507
|
},
|
|
1537
1508
|
get children() {
|
|
1538
|
-
return $3hooq$solidjsweb.ssr($e0b3f1f332b6863b$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(),
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
}
|
|
1542
|
-
}, () => displays_() && {
|
|
1543
|
-
style: "--look-card-width:".concat(containerWidth_(), "px;--look-item-height:").concat(lookItemHeight() || 200, "px")
|
|
1544
|
-
}), () => $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Index), {
|
|
1509
|
+
return $3hooq$solidjsweb.ssr($e0b3f1f332b6863b$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), "look-overlay ".concat(userWantsExpanded() ? "expanded" : "", " ").concat(!getSecondPartAnimationRunning() && userWantsExpanded() ? "resting-fully-expanded" : ""), $3hooq$solidjsweb.ssrStyle(displays_() &&
|
|
1510
|
+
// The styling is written like this to eke out animation smoothness on low CPU devices, git blame for previous, more readable versions.
|
|
1511
|
+
"--look-card-width:".concat(containerWidth_(), "px;--look-card-height:").concat(containerHeight_(), "px;--look-item-height:").concat(lookItemHeight() || 200, "px")), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Index), {
|
|
1545
1512
|
get each() {
|
|
1546
1513
|
return displays_() || Array.from({
|
|
1547
1514
|
length: 4
|
|
@@ -1564,7 +1531,7 @@ function $e0b3f1f332b6863b$export$ebf0b1d4f90c09ae(_ref) {
|
|
|
1564
1531
|
})
|
|
1565
1532
|
});
|
|
1566
1533
|
}
|
|
1567
|
-
}))
|
|
1534
|
+
})));
|
|
1568
1535
|
}
|
|
1569
1536
|
});
|
|
1570
1537
|
}
|
|
@@ -1590,7 +1557,7 @@ function $e0b3f1f332b6863b$var$scrollingFunctionForChrome(element, targetScrollY
|
|
|
1590
1557
|
// Bootstrap our animation - it will get called right before next frame shall be rendered.
|
|
1591
1558
|
requestAnimationFrame(step);
|
|
1592
1559
|
}
|
|
1593
|
-
var $47e3c3102c78121b$var$_tmpl$ = ["<div", ' class="', '"
|
|
1560
|
+
var $47e3c3102c78121b$var$_tmpl$ = ["<div", ' class="', '"><!--$-->', "<!--/--><!--$-->", "<!--/--></div>"];
|
|
1594
1561
|
function $47e3c3102c78121b$export$44809a8a3e867e30(_ref) {
|
|
1595
1562
|
let {
|
|
1596
1563
|
display_: display_,
|
|
@@ -1601,12 +1568,13 @@ function $47e3c3102c78121b$export$44809a8a3e867e30(_ref) {
|
|
|
1601
1568
|
priceFormatting_: priceFormatting_,
|
|
1602
1569
|
pseudoRouter_: pseudoRouter_
|
|
1603
1570
|
} = _ref;
|
|
1571
|
+
let container;
|
|
1604
1572
|
const useWantsExpandedSignal_ = $3hooq$solidjs.createSignal(false);
|
|
1605
1573
|
const [userWantsExpanded, setUserWantsExpanded] = useWantsExpandedSignal_;
|
|
1606
1574
|
const supportsHover_ = $3e17e871e9d0911d$export$d9f36cf74e24d595("(hover: hover) and (pointer: fine)");
|
|
1607
1575
|
const us = Symbol("look");
|
|
1608
|
-
const
|
|
1609
|
-
const
|
|
1576
|
+
const [containerWidth_, setContainerWidth] = $3hooq$solidjs.createSignal();
|
|
1577
|
+
const [containerHeight_, setContainerHeight] = $3hooq$solidjs.createSignal();
|
|
1610
1578
|
const clickHandler = $3hooq$depictaiutilishared.catchify(_ref2 => {
|
|
1611
1579
|
let {
|
|
1612
1580
|
target: target
|
|
@@ -1628,7 +1596,7 @@ function $47e3c3102c78121b$export$44809a8a3e867e30(_ref) {
|
|
|
1628
1596
|
}));
|
|
1629
1597
|
// Close us if another look expands
|
|
1630
1598
|
$3hooq$solidjs.createEffect(() => !expandedLooks_().has(us) && setUserWantsExpanded(false));
|
|
1631
|
-
$3hooq$solidjsweb.
|
|
1599
|
+
return $3hooq$solidjsweb.ssr($47e3c3102c78121b$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), "look-card ".concat(!display_ ? "placeholder" : ""), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
1632
1600
|
get when() {
|
|
1633
1601
|
return display_();
|
|
1634
1602
|
},
|
|
@@ -1647,7 +1615,7 @@ function $47e3c3102c78121b$export$44809a8a3e867e30(_ref) {
|
|
|
1647
1615
|
autoAdjustAspectRatio: true
|
|
1648
1616
|
});
|
|
1649
1617
|
}
|
|
1650
|
-
}), $3hooq$solidjsweb.createComponent((0, $e0b3f1f332b6863b$export$ebf0b1d4f90c09ae), {
|
|
1618
|
+
})), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $e0b3f1f332b6863b$export$ebf0b1d4f90c09ae), {
|
|
1651
1619
|
displays_: () => {
|
|
1652
1620
|
var _display_2;
|
|
1653
1621
|
return (_display_2 = display_()) === null || _display_2 === void 0 ? void 0 : _display_2.displays;
|
|
@@ -1658,9 +1626,9 @@ function $47e3c3102c78121b$export$44809a8a3e867e30(_ref) {
|
|
|
1658
1626
|
supportsHover_: supportsHover_,
|
|
1659
1627
|
FavoriteButton_: FavoriteButton_,
|
|
1660
1628
|
priceFormatting_: priceFormatting_,
|
|
1661
|
-
pseudoRouter_: pseudoRouter_
|
|
1662
|
-
|
|
1663
|
-
|
|
1629
|
+
pseudoRouter_: pseudoRouter_,
|
|
1630
|
+
containerHeight_: containerHeight_
|
|
1631
|
+
})));
|
|
1664
1632
|
}
|
|
1665
1633
|
|
|
1666
1634
|
/**
|
|
@@ -3103,6 +3071,38 @@ let $c95c6dd9e93acd82$export$44dad306455dddf;
|
|
|
3103
3071
|
DEPICT_ID["SEARCH_PAGE"] = "depict-search-page";
|
|
3104
3072
|
DEPICT_ID["PLP_CATEGORY"] = "depict-plp-category";
|
|
3105
3073
|
})($c95c6dd9e93acd82$export$44dad306455dddf || ($c95c6dd9e93acd82$export$44dad306455dddf = {}));
|
|
3074
|
+
|
|
3075
|
+
/** @jsxImportSource solid-js */
|
|
3076
|
+
|
|
3077
|
+
function $c387d7f1d9fb66c0$export$ebdc3711f7e02ccd(what_to_watch) {
|
|
3078
|
+
const [width, setWidth] = $3hooq$solidjs.createSignal();
|
|
3079
|
+
const resizeObserver = new ResizeObserver($3hooq$depictaiutilishared.catchify(records => {
|
|
3080
|
+
for (let j = 0; j < records.length; j++) {
|
|
3081
|
+
var _records$j$borderBoxS, _records$j$borderBoxS2, _records$j$borderBoxS3;
|
|
3082
|
+
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;
|
|
3083
|
+
setWidth(width);
|
|
3084
|
+
}
|
|
3085
|
+
}));
|
|
3086
|
+
// 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.
|
|
3087
|
+
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
3088
|
+
const disconnect = (0, $3hooq$depictaiutilishared.observer).onexists(what_to_watch, _ref => {
|
|
3089
|
+
let {
|
|
3090
|
+
element: element
|
|
3091
|
+
} = _ref;
|
|
3092
|
+
return requestAnimationFrame($3hooq$depictaiutilishared.catchify(() => {
|
|
3093
|
+
const current_size = what_to_watch.getBoundingClientRect().width;
|
|
3094
|
+
if (current_size)
|
|
3095
|
+
// 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.
|
|
3096
|
+
setWidth(current_size);
|
|
3097
|
+
resizeObserver.observe(element);
|
|
3098
|
+
}));
|
|
3099
|
+
});
|
|
3100
|
+
$3hooq$solidjs.onCleanup(() => {
|
|
3101
|
+
resizeObserver.disconnect();
|
|
3102
|
+
disconnect();
|
|
3103
|
+
});
|
|
3104
|
+
return width;
|
|
3105
|
+
}
|
|
3106
3106
|
var $34934309832515dc$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>';
|
|
3107
3107
|
function $34934309832515dc$export$f7658c347b037c3f() {
|
|
3108
3108
|
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
package/server/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.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
|
*/
|