@depict-ai/ui 4.0.8 → 4.0.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 +10 -16
- package/ES10/index.d.ts +1 -1
- package/ES10/index.js +11 -17
- package/latest/index.cjs +10 -16
- package/latest/index.d.ts +1 -1
- package/latest/index.js +11 -17
- package/package.json +1 -1
- package/server/ES10/index.cjs +10 -16
- package/server/ES10/index.d.ts +1 -1
- package/server/ES10/index.js +11 -17
- package/server/latest/index.cjs +10 -16
- package/server/latest/index.d.ts +1 -1
- package/server/latest/index.js +11 -17
package/ES10/index.cjs
CHANGED
|
@@ -94,7 +94,7 @@ $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447a
|
|
|
94
94
|
$parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
|
|
95
95
|
$parcel$export(module.exports, "SearchField", () => $98aef9965764903d$export$316f6f283ae64765);
|
|
96
96
|
/*! Depict.ai search and product listing SDK */
|
|
97
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.0.
|
|
97
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.0.9";
|
|
98
98
|
function $a28000bc10de28ad$export$e417c49320921907(dependency, fetcher) {
|
|
99
99
|
const [promiseOfCurrentFetcherRun, setPromiseOfCurrentFetcherRun] = $52FdA$solidjs.createSignal();
|
|
100
100
|
const deparallelizedFetcher = $52FdA$depictaiutilishared.deparallelize_no_drop(async dependencyValue => {
|
|
@@ -2594,18 +2594,6 @@ const $858fdcf73148519f$var$onIdleFunctionsSymbol = /*@__PURE__*/Symbol("onIdleF
|
|
|
2594
2594
|
const $858fdcf73148519f$export$f8945274f08a3105 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
2595
2595
|
const $858fdcf73148519f$export$6066eb417ed2e9f7 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
2596
2596
|
function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
2597
|
-
// Enable reactive props
|
|
2598
|
-
const otherOptions = $52FdA$solidjs.createMemo(() => {
|
|
2599
|
-
const cloned_props = {
|
|
2600
|
-
...props
|
|
2601
|
-
};
|
|
2602
|
-
delete cloned_props.resolutions;
|
|
2603
|
-
// @ts-ignore
|
|
2604
|
-
delete cloned_props.size;
|
|
2605
|
-
// @ts-ignore
|
|
2606
|
-
delete cloned_props.src;
|
|
2607
|
-
return cloned_props;
|
|
2608
|
-
});
|
|
2609
2597
|
const src_options = $52FdA$solidjs.createMemo(() => {
|
|
2610
2598
|
const fallback_src = $858fdcf73148519f$var$generateImageUrl(props.src, 400);
|
|
2611
2599
|
const srcset = $858fdcf73148519f$var$make_srcset(props.src, props.resolutions || [64, 128, 256, 300, 400, 512, 640, 768, 1024, 1280, 1536, 2048, 2560, 3072, 3584, 4096]);
|
|
@@ -2617,19 +2605,25 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
|
2617
2605
|
});
|
|
2618
2606
|
// Work around https://github.com/solidjs/solid/issues/1828
|
|
2619
2607
|
const img = new Image(); // Need to use new Image or browser might not start loading image before it's in the DOM
|
|
2608
|
+
const [, otherAttributes] = $52FdA$solidjs.splitProps(props, ["resolutions", "size", "src", "srcSet", "loading"]);
|
|
2620
2609
|
const [hasSetSize, setHasSetSize] = $52FdA$solidjs.createSignal(false);
|
|
2621
2610
|
const [hasDecoded, setHasDecoded] = $52FdA$solidjs.createSignal(false);
|
|
2622
2611
|
const productCardIndexAccessor = $b54645378dfc7280$export$e3faf4d95300054f();
|
|
2623
2612
|
const sizePX = $52FdA$solidjs.createMemo(() => "".concat(props.size(), "px")); // props.size could be a getter that expects a cleanup so get it in this memo instead of where we set img.sizes
|
|
2624
2613
|
const listingContext = $d067f3a30f047b41$export$8d0c4fdbb05a2f2e();
|
|
2625
2614
|
const isPrioritisedImage = $52FdA$solidjs.createMemo(() => (productCardIndexAccessor === null || productCardIndexAccessor === void 0 ? void 0 : productCardIndexAccessor()) < 8);
|
|
2626
|
-
const
|
|
2615
|
+
const shouldActuallyEnableLazyLoading = $52FdA$solidjs.createMemo(() => {
|
|
2627
2616
|
const {
|
|
2628
2617
|
loading: loading
|
|
2629
2618
|
} = props;
|
|
2630
2619
|
if (loading === "force-lazy") return true;
|
|
2631
2620
|
return loading === "lazy" && !isPrioritisedImage();
|
|
2632
2621
|
});
|
|
2622
|
+
const modifiedOtherAttributes = $52FdA$solidjs.mergeProps(otherAttributes, {
|
|
2623
|
+
get loading() {
|
|
2624
|
+
return shouldActuallyEnableLazyLoading() ? "lazy" : undefined;
|
|
2625
|
+
}
|
|
2626
|
+
});
|
|
2633
2627
|
// 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
|
|
2634
2628
|
// Happened on singular, they have some weird observer (+we also have one but ours is at least 3x more efficient)
|
|
2635
2629
|
const executeWhenIdleBatched = fn => {
|
|
@@ -2692,7 +2686,7 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
|
2692
2686
|
$52FdA$solidjs.onCleanup(() => prevValue && aspectRatios.delete(prevValue));
|
|
2693
2687
|
}
|
|
2694
2688
|
$52FdA$solidjs.onCleanup(() => gotCleanedUp = true);
|
|
2695
|
-
$52FdA$solidjsweb.spread(img, $52FdA$solidjs.mergeProps(
|
|
2689
|
+
$52FdA$solidjsweb.spread(img, $52FdA$solidjs.mergeProps(modifiedOtherAttributes), false, true);
|
|
2696
2690
|
$52FdA$solidjs.createEffect(() => {
|
|
2697
2691
|
if (!props.size()) return; // wait until we have a size, run every time the size changes
|
|
2698
2692
|
if (timeoutSet) return;
|
|
@@ -2719,7 +2713,7 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
|
2719
2713
|
// We can do this because there has to be a container around us giving us a size
|
|
2720
2714
|
// No need to listen if we're already in the DOM
|
|
2721
2715
|
if (hasDecodedFastPath) return;
|
|
2722
|
-
if (
|
|
2716
|
+
if (shouldActuallyEnableLazyLoading()) {
|
|
2723
2717
|
// For lazy loading there's no decoding to wait for as it only occurs when the image is visible
|
|
2724
2718
|
// Make sure src is set before we put the image into the DOM though so no broken image symbol is shown
|
|
2725
2719
|
setHasDecoded(true);
|
package/ES10/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
|
|
|
10
10
|
import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { SearchFilter as _SearchFilter2 } from "@depict-ai/types/api/SearchRequestV2";
|
|
13
|
-
export const version = "4.0.
|
|
13
|
+
export const version = "4.0.9";
|
|
14
14
|
export type ModalAlignmentSignals = {
|
|
15
15
|
body_: Signal<JSX.CSSProperties>;
|
|
16
16
|
field_: Signal<JSX.CSSProperties>;
|
package/ES10/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { add_to_version_info as $8tj43$add_to_version_info, deparallelize_no_drop as $8tj43$deparallelize_no_drop, catchify as $8tj43$catchify, make_random_classname as $8tj43$make_random_classname, ContainedImage as $8tj43$ContainedImage, standard_price_format as $8tj43$standard_price_format, javascript_media_query as $8tj43$javascript_media_query, dlog as $8tj43$dlog, camelCasifyObject as $8tj43$camelCasifyObject, buildThresholdList as $8tj43$buildThresholdList, make_asyncIterable_exiter as $8tj43$make_asyncIterable_exiter, href_change_ipns as $8tj43$href_change_ipns, observer as $8tj43$observer, report as $8tj43$report, base64_encode_unicode as $8tj43$base64_encode_unicode, base64_decode_unicode as $8tj43$base64_decode_unicode, queueMacroTask as $8tj43$queueMacroTask, findMostFrequentItem as $8tj43$findMostFrequentItem, dwarn as $8tj43$dwarn, slider_fading_factory as $8tj43$slider_fading_factory, Amazing_Slider as $8tj43$Amazing_Slider, slider_snap_css as $8tj43$slider_snap_css, n_col_styling_with_dist as $8tj43$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $8tj43$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $8tj43$layout_get_total_rec_amount_for_row, layout_media_query_header as $8tj43$layout_media_query_header, use_href_accessor as $8tj43$use_href_accessor, get_session_id as $8tj43$get_session_id, add_version_query_params as $8tj43$add_version_query_params, base_url as $8tj43$base_url, instant_exec_on_suspect_history_change as $8tj43$instant_exec_on_suspect_history_change, slider_fractional_factory as $8tj43$slider_fractional_factory, useExpandingContainer as $8tj43$useExpandingContainer, hex_to_rgb as $8tj43$hex_to_rgb, relative_luminance_from_rgb as $8tj43$relative_luminance_from_rgb, snakeCasifyObject as $8tj43$snakeCasifyObject, fetch_retry as $8tj43$fetch_retry, make_url_with_query_params as $8tj43$make_url_with_query_params, sort_obj as $8tj43$sort_obj, is_debug as $8tj43$is_debug, ListenableSet as $8tj43$ListenableSet1, insert_surfaces as $8tj43$insert_surfaces } from "@depict-ai/utilishared/ES10";
|
|
2
|
-
import { createSignal as $8tj43$createSignal, createResource as $8tj43$createResource, createEffect as $8tj43$createEffect, untrack as $8tj43$untrack, createMemo as $8tj43$createMemo, onCleanup as $8tj43$onCleanup, Show as $8tj43$Show, createComputed as $8tj43$createComputed, For as $8tj43$For, getOwner as $8tj43$getOwner, runWithOwner as $8tj43$runWithOwner, createContext as $8tj43$createContext, useContext as $8tj43$useContext, on as $8tj43$on, Index as $8tj43$Index, batch as $8tj43$batch, ErrorBoundary as $8tj43$ErrorBoundary, mergeProps as $8tj43$mergeProps1, createUniqueId as $8tj43$createUniqueId, createRenderEffect as $8tj43$createRenderEffect, createSelector as $8tj43$createSelector, children as $8tj43$children,
|
|
2
|
+
import { createSignal as $8tj43$createSignal, createResource as $8tj43$createResource, createEffect as $8tj43$createEffect, untrack as $8tj43$untrack, createMemo as $8tj43$createMemo, onCleanup as $8tj43$onCleanup, Show as $8tj43$Show, createComputed as $8tj43$createComputed, For as $8tj43$For, getOwner as $8tj43$getOwner, runWithOwner as $8tj43$runWithOwner, createContext as $8tj43$createContext, useContext as $8tj43$useContext, on as $8tj43$on, Index as $8tj43$Index, batch as $8tj43$batch, ErrorBoundary as $8tj43$ErrorBoundary, splitProps as $8tj43$splitProps, mergeProps as $8tj43$mergeProps1, createUniqueId as $8tj43$createUniqueId, createRenderEffect as $8tj43$createRenderEffect, createSelector as $8tj43$createSelector, children as $8tj43$children, createRoot as $8tj43$createRoot, Suspense as $8tj43$Suspense, createReaction as $8tj43$createReaction, mapArray as $8tj43$mapArray } from "solid-js";
|
|
3
3
|
import { template as $8tj43$template, getNextElement as $8tj43$getNextElement, addEventListener as $8tj43$addEventListener, insert as $8tj43$insert, memo as $8tj43$memo, runHydrationEvents as $8tj43$runHydrationEvents, createComponent as $8tj43$createComponent, getNextMarker as $8tj43$getNextMarker, use as $8tj43$use, effect as $8tj43$effect, classList as $8tj43$classList, setAttribute as $8tj43$setAttribute, delegateEvents as $8tj43$delegateEvents, style as $8tj43$style, className as $8tj43$className, spread as $8tj43$spread, mergeProps as $8tj43$mergeProps, setProperty as $8tj43$setProperty, isServer as $8tj43$isServer, Dynamic as $8tj43$Dynamic } from "solid-js/web";
|
|
4
4
|
import { ListenableSet as $8tj43$ListenableSet, catchify as $8tj43$catchify1, use_href_accessor as $8tj43$use_href_accessor1, report as $8tj43$report1 } from "@depict-ai/utilishared/ES10";
|
|
5
5
|
import $8tj43$babelruntimehelpersdefineProperty from "@babel/runtime/helpers/defineProperty";
|
|
@@ -10,7 +10,7 @@ import { createStore as $8tj43$createStore, reconcile as $8tj43$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.0.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.0.9";
|
|
14
14
|
function $a604a8ffa4e4c03f$export$e417c49320921907(dependency, fetcher) {
|
|
15
15
|
const [promiseOfCurrentFetcherRun, setPromiseOfCurrentFetcherRun] = $8tj43$createSignal();
|
|
16
16
|
const deparallelizedFetcher = $8tj43$deparallelize_no_drop(async dependencyValue => {
|
|
@@ -2510,18 +2510,6 @@ const $56047603f9d212b6$var$onIdleFunctionsSymbol = /*@__PURE__*/Symbol("onIdleF
|
|
|
2510
2510
|
const $56047603f9d212b6$export$f8945274f08a3105 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
2511
2511
|
const $56047603f9d212b6$export$6066eb417ed2e9f7 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
2512
2512
|
function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
2513
|
-
// Enable reactive props
|
|
2514
|
-
const otherOptions = $8tj43$createMemo(() => {
|
|
2515
|
-
const cloned_props = {
|
|
2516
|
-
...props
|
|
2517
|
-
};
|
|
2518
|
-
delete cloned_props.resolutions;
|
|
2519
|
-
// @ts-ignore
|
|
2520
|
-
delete cloned_props.size;
|
|
2521
|
-
// @ts-ignore
|
|
2522
|
-
delete cloned_props.src;
|
|
2523
|
-
return cloned_props;
|
|
2524
|
-
});
|
|
2525
2513
|
const src_options = $8tj43$createMemo(() => {
|
|
2526
2514
|
const fallback_src = $56047603f9d212b6$var$generateImageUrl(props.src, 400);
|
|
2527
2515
|
const srcset = $56047603f9d212b6$var$make_srcset(props.src, props.resolutions || [64, 128, 256, 300, 400, 512, 640, 768, 1024, 1280, 1536, 2048, 2560, 3072, 3584, 4096]);
|
|
@@ -2533,19 +2521,25 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
|
2533
2521
|
});
|
|
2534
2522
|
// Work around https://github.com/solidjs/solid/issues/1828
|
|
2535
2523
|
const img = new Image(); // Need to use new Image or browser might not start loading image before it's in the DOM
|
|
2524
|
+
const [, otherAttributes] = $8tj43$splitProps(props, ["resolutions", "size", "src", "srcSet", "loading"]);
|
|
2536
2525
|
const [hasSetSize, setHasSetSize] = $8tj43$createSignal(false);
|
|
2537
2526
|
const [hasDecoded, setHasDecoded] = $8tj43$createSignal(false);
|
|
2538
2527
|
const productCardIndexAccessor = $1e69163caedaab4e$export$e3faf4d95300054f();
|
|
2539
2528
|
const sizePX = $8tj43$createMemo(() => "".concat(props.size(), "px")); // props.size could be a getter that expects a cleanup so get it in this memo instead of where we set img.sizes
|
|
2540
2529
|
const listingContext = $5441862cd2f5e111$export$8d0c4fdbb05a2f2e();
|
|
2541
2530
|
const isPrioritisedImage = $8tj43$createMemo(() => (productCardIndexAccessor === null || productCardIndexAccessor === void 0 ? void 0 : productCardIndexAccessor()) < 8);
|
|
2542
|
-
const
|
|
2531
|
+
const shouldActuallyEnableLazyLoading = $8tj43$createMemo(() => {
|
|
2543
2532
|
const {
|
|
2544
2533
|
loading: loading
|
|
2545
2534
|
} = props;
|
|
2546
2535
|
if (loading === "force-lazy") return true;
|
|
2547
2536
|
return loading === "lazy" && !isPrioritisedImage();
|
|
2548
2537
|
});
|
|
2538
|
+
const modifiedOtherAttributes = $8tj43$mergeProps1(otherAttributes, {
|
|
2539
|
+
get loading() {
|
|
2540
|
+
return shouldActuallyEnableLazyLoading() ? "lazy" : undefined;
|
|
2541
|
+
}
|
|
2542
|
+
});
|
|
2549
2543
|
// 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
|
|
2550
2544
|
// Happened on singular, they have some weird observer (+we also have one but ours is at least 3x more efficient)
|
|
2551
2545
|
const executeWhenIdleBatched = fn => {
|
|
@@ -2608,7 +2602,7 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
|
2608
2602
|
$8tj43$onCleanup(() => prevValue && aspectRatios.delete(prevValue));
|
|
2609
2603
|
}
|
|
2610
2604
|
$8tj43$onCleanup(() => gotCleanedUp = true);
|
|
2611
|
-
$8tj43$spread(img, $8tj43$mergeProps1(
|
|
2605
|
+
$8tj43$spread(img, $8tj43$mergeProps1(modifiedOtherAttributes), false, true);
|
|
2612
2606
|
$8tj43$createEffect(() => {
|
|
2613
2607
|
if (!props.size()) return; // wait until we have a size, run every time the size changes
|
|
2614
2608
|
if (timeoutSet) return;
|
|
@@ -2635,7 +2629,7 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
|
2635
2629
|
// We can do this because there has to be a container around us giving us a size
|
|
2636
2630
|
// No need to listen if we're already in the DOM
|
|
2637
2631
|
if (hasDecodedFastPath) return;
|
|
2638
|
-
if (
|
|
2632
|
+
if (shouldActuallyEnableLazyLoading()) {
|
|
2639
2633
|
// For lazy loading there's no decoding to wait for as it only occurs when the image is visible
|
|
2640
2634
|
// Make sure src is set before we put the image into the DOM though so no broken image symbol is shown
|
|
2641
2635
|
setHasDecoded(true);
|
package/latest/index.cjs
CHANGED
|
@@ -88,7 +88,7 @@ $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad99
|
|
|
88
88
|
$parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
|
|
89
89
|
$parcel$export(module.exports, "SearchField", () => $c0a0659cf97e8eb2$export$316f6f283ae64765);
|
|
90
90
|
/*! Depict.ai search and product listing SDK */
|
|
91
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.0.
|
|
91
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.0.9";
|
|
92
92
|
function $53df95e470b2f8d2$export$e417c49320921907(dependency, fetcher) {
|
|
93
93
|
const [promiseOfCurrentFetcherRun, setPromiseOfCurrentFetcherRun] = $gVhhF$solidjs.createSignal();
|
|
94
94
|
const deparallelizedFetcher = $gVhhF$depictaiutilishared.deparallelize_no_drop(async dependencyValue => {
|
|
@@ -2483,18 +2483,6 @@ const $19950faaac026e09$var$onIdleFunctionsSymbol = /*@__PURE__*/Symbol("onIdleF
|
|
|
2483
2483
|
const $19950faaac026e09$export$f8945274f08a3105 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
2484
2484
|
const $19950faaac026e09$export$6066eb417ed2e9f7 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
2485
2485
|
function $19950faaac026e09$export$6e5611bc7e57e477(props) {
|
|
2486
|
-
// Enable reactive props
|
|
2487
|
-
const otherOptions = $gVhhF$solidjs.createMemo(() => {
|
|
2488
|
-
const cloned_props = {
|
|
2489
|
-
...props
|
|
2490
|
-
};
|
|
2491
|
-
delete cloned_props.resolutions;
|
|
2492
|
-
// @ts-ignore
|
|
2493
|
-
delete cloned_props.size;
|
|
2494
|
-
// @ts-ignore
|
|
2495
|
-
delete cloned_props.src;
|
|
2496
|
-
return cloned_props;
|
|
2497
|
-
});
|
|
2498
2486
|
const src_options = $gVhhF$solidjs.createMemo(() => {
|
|
2499
2487
|
const fallback_src = $19950faaac026e09$var$generateImageUrl(props.src, 400);
|
|
2500
2488
|
const srcset = $19950faaac026e09$var$make_srcset(props.src, props.resolutions || [64, 128, 256, 300, 400, 512, 640, 768, 1024, 1280, 1536, 2048, 2560, 3072, 3584, 4096]);
|
|
@@ -2506,19 +2494,25 @@ function $19950faaac026e09$export$6e5611bc7e57e477(props) {
|
|
|
2506
2494
|
});
|
|
2507
2495
|
// Work around https://github.com/solidjs/solid/issues/1828
|
|
2508
2496
|
const img = new Image(); // Need to use new Image or browser might not start loading image before it's in the DOM
|
|
2497
|
+
const [, otherAttributes] = $gVhhF$solidjs.splitProps(props, ["resolutions", "size", "src", "srcSet", "loading"]);
|
|
2509
2498
|
const [hasSetSize, setHasSetSize] = $gVhhF$solidjs.createSignal(false);
|
|
2510
2499
|
const [hasDecoded, setHasDecoded] = $gVhhF$solidjs.createSignal(false);
|
|
2511
2500
|
const productCardIndexAccessor = $129b9b9c010039d0$export$e3faf4d95300054f();
|
|
2512
2501
|
const sizePX = $gVhhF$solidjs.createMemo(() => `${props.size()}px`); // props.size could be a getter that expects a cleanup so get it in this memo instead of where we set img.sizes
|
|
2513
2502
|
const listingContext = $84798aaa863a4909$export$8d0c4fdbb05a2f2e();
|
|
2514
2503
|
const isPrioritisedImage = $gVhhF$solidjs.createMemo(() => productCardIndexAccessor?.() < 8);
|
|
2515
|
-
const
|
|
2504
|
+
const shouldActuallyEnableLazyLoading = $gVhhF$solidjs.createMemo(() => {
|
|
2516
2505
|
const {
|
|
2517
2506
|
loading: loading
|
|
2518
2507
|
} = props;
|
|
2519
2508
|
if (loading === "force-lazy") return true;
|
|
2520
2509
|
return loading === "lazy" && !isPrioritisedImage();
|
|
2521
2510
|
});
|
|
2511
|
+
const modifiedOtherAttributes = $gVhhF$solidjs.mergeProps(otherAttributes, {
|
|
2512
|
+
get loading() {
|
|
2513
|
+
return shouldActuallyEnableLazyLoading() ? "lazy" : undefined;
|
|
2514
|
+
}
|
|
2515
|
+
});
|
|
2522
2516
|
// 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
|
|
2523
2517
|
// Happened on singular, they have some weird observer (+we also have one but ours is at least 3x more efficient)
|
|
2524
2518
|
const executeWhenIdleBatched = fn => {
|
|
@@ -2578,7 +2572,7 @@ function $19950faaac026e09$export$6e5611bc7e57e477(props) {
|
|
|
2578
2572
|
$gVhhF$solidjs.onCleanup(() => prevValue && aspectRatios.delete(prevValue));
|
|
2579
2573
|
}
|
|
2580
2574
|
$gVhhF$solidjs.onCleanup(() => gotCleanedUp = true);
|
|
2581
|
-
$gVhhF$solidjsweb.spread(img, $gVhhF$solidjs.mergeProps(
|
|
2575
|
+
$gVhhF$solidjsweb.spread(img, $gVhhF$solidjs.mergeProps(modifiedOtherAttributes), false, true);
|
|
2582
2576
|
$gVhhF$solidjs.createEffect(() => {
|
|
2583
2577
|
if (!props.size()) return; // wait until we have a size, run every time the size changes
|
|
2584
2578
|
if (timeoutSet) return;
|
|
@@ -2605,7 +2599,7 @@ function $19950faaac026e09$export$6e5611bc7e57e477(props) {
|
|
|
2605
2599
|
// We can do this because there has to be a container around us giving us a size
|
|
2606
2600
|
// No need to listen if we're already in the DOM
|
|
2607
2601
|
if (hasDecodedFastPath) return;
|
|
2608
|
-
if (
|
|
2602
|
+
if (shouldActuallyEnableLazyLoading()) {
|
|
2609
2603
|
// For lazy loading there's no decoding to wait for as it only occurs when the image is visible
|
|
2610
2604
|
// Make sure src is set before we put the image into the DOM though so no broken image symbol is shown
|
|
2611
2605
|
setHasDecoded(true);
|
package/latest/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
|
|
|
10
10
|
import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { SearchFilter as _SearchFilter2 } from "@depict-ai/types/api/SearchRequestV2";
|
|
13
|
-
export const version = "4.0.
|
|
13
|
+
export const version = "4.0.9";
|
|
14
14
|
export type ModalAlignmentSignals = {
|
|
15
15
|
body_: Signal<JSX.CSSProperties>;
|
|
16
16
|
field_: Signal<JSX.CSSProperties>;
|
package/latest/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { add_to_version_info as $9HbP8$add_to_version_info, deparallelize_no_drop as $9HbP8$deparallelize_no_drop, catchify as $9HbP8$catchify, make_random_classname as $9HbP8$make_random_classname, ContainedImage as $9HbP8$ContainedImage, standard_price_format as $9HbP8$standard_price_format, javascript_media_query as $9HbP8$javascript_media_query, dlog as $9HbP8$dlog, camelCasifyObject as $9HbP8$camelCasifyObject, buildThresholdList as $9HbP8$buildThresholdList, make_asyncIterable_exiter as $9HbP8$make_asyncIterable_exiter, href_change_ipns as $9HbP8$href_change_ipns, observer as $9HbP8$observer, report as $9HbP8$report, base64_encode_unicode as $9HbP8$base64_encode_unicode, base64_decode_unicode as $9HbP8$base64_decode_unicode, queueMacroTask as $9HbP8$queueMacroTask, findMostFrequentItem as $9HbP8$findMostFrequentItem, dwarn as $9HbP8$dwarn, slider_fading_factory as $9HbP8$slider_fading_factory, Amazing_Slider as $9HbP8$Amazing_Slider, slider_snap_css as $9HbP8$slider_snap_css, n_col_styling_with_dist as $9HbP8$n_col_styling_with_dist, 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, 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, base_url as $9HbP8$base_url, instant_exec_on_suspect_history_change as $9HbP8$instant_exec_on_suspect_history_change, slider_fractional_factory as $9HbP8$slider_fractional_factory, useExpandingContainer as $9HbP8$useExpandingContainer, hex_to_rgb as $9HbP8$hex_to_rgb, relative_luminance_from_rgb as $9HbP8$relative_luminance_from_rgb, snakeCasifyObject as $9HbP8$snakeCasifyObject, fetch_retry as $9HbP8$fetch_retry, sort_obj as $9HbP8$sort_obj, make_url_with_query_params as $9HbP8$make_url_with_query_params, is_debug as $9HbP8$is_debug, ListenableSet as $9HbP8$ListenableSet1, insert_surfaces as $9HbP8$insert_surfaces } from "@depict-ai/utilishared/latest";
|
|
2
|
-
import { createSignal as $9HbP8$createSignal, createResource as $9HbP8$createResource, createEffect as $9HbP8$createEffect, untrack as $9HbP8$untrack, createMemo as $9HbP8$createMemo, onCleanup as $9HbP8$onCleanup, Show as $9HbP8$Show, createComputed as $9HbP8$createComputed, For as $9HbP8$For, getOwner as $9HbP8$getOwner, runWithOwner as $9HbP8$runWithOwner, createContext as $9HbP8$createContext, useContext as $9HbP8$useContext, on as $9HbP8$on, Index as $9HbP8$Index, batch as $9HbP8$batch, ErrorBoundary as $9HbP8$ErrorBoundary, mergeProps as $9HbP8$mergeProps1, createUniqueId as $9HbP8$createUniqueId, createRenderEffect as $9HbP8$createRenderEffect, createSelector as $9HbP8$createSelector, children as $9HbP8$children,
|
|
2
|
+
import { createSignal as $9HbP8$createSignal, createResource as $9HbP8$createResource, createEffect as $9HbP8$createEffect, untrack as $9HbP8$untrack, createMemo as $9HbP8$createMemo, onCleanup as $9HbP8$onCleanup, Show as $9HbP8$Show, createComputed as $9HbP8$createComputed, For as $9HbP8$For, getOwner as $9HbP8$getOwner, runWithOwner as $9HbP8$runWithOwner, createContext as $9HbP8$createContext, useContext as $9HbP8$useContext, on as $9HbP8$on, Index as $9HbP8$Index, batch as $9HbP8$batch, ErrorBoundary as $9HbP8$ErrorBoundary, splitProps as $9HbP8$splitProps, mergeProps as $9HbP8$mergeProps1, createUniqueId as $9HbP8$createUniqueId, createRenderEffect as $9HbP8$createRenderEffect, createSelector as $9HbP8$createSelector, children as $9HbP8$children, createRoot as $9HbP8$createRoot, Suspense as $9HbP8$Suspense, createReaction as $9HbP8$createReaction, mapArray as $9HbP8$mapArray } from "solid-js";
|
|
3
3
|
import { template as $9HbP8$template, getNextElement as $9HbP8$getNextElement, addEventListener as $9HbP8$addEventListener, insert as $9HbP8$insert, memo as $9HbP8$memo, runHydrationEvents as $9HbP8$runHydrationEvents, createComponent as $9HbP8$createComponent, getNextMarker as $9HbP8$getNextMarker, use as $9HbP8$use, effect as $9HbP8$effect, classList as $9HbP8$classList, setAttribute as $9HbP8$setAttribute, delegateEvents as $9HbP8$delegateEvents, style as $9HbP8$style, className as $9HbP8$className, spread as $9HbP8$spread, mergeProps as $9HbP8$mergeProps, setProperty as $9HbP8$setProperty, isServer as $9HbP8$isServer, Dynamic as $9HbP8$Dynamic } from "solid-js/web";
|
|
4
4
|
import { ListenableSet as $9HbP8$ListenableSet, catchify as $9HbP8$catchify1, use_href_accessor as $9HbP8$use_href_accessor1, 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.0.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "4.0.9";
|
|
11
11
|
function $136f1d4d6c7ba6ac$export$e417c49320921907(dependency, fetcher) {
|
|
12
12
|
const [promiseOfCurrentFetcherRun, setPromiseOfCurrentFetcherRun] = $9HbP8$createSignal();
|
|
13
13
|
const deparallelizedFetcher = $9HbP8$deparallelize_no_drop(async dependencyValue => {
|
|
@@ -2402,18 +2402,6 @@ const $e8ffe11ed01df0fe$var$onIdleFunctionsSymbol = /*@__PURE__*/Symbol("onIdleF
|
|
|
2402
2402
|
const $e8ffe11ed01df0fe$export$f8945274f08a3105 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
2403
2403
|
const $e8ffe11ed01df0fe$export$6066eb417ed2e9f7 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
2404
2404
|
function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
2405
|
-
// Enable reactive props
|
|
2406
|
-
const otherOptions = $9HbP8$createMemo(() => {
|
|
2407
|
-
const cloned_props = {
|
|
2408
|
-
...props
|
|
2409
|
-
};
|
|
2410
|
-
delete cloned_props.resolutions;
|
|
2411
|
-
// @ts-ignore
|
|
2412
|
-
delete cloned_props.size;
|
|
2413
|
-
// @ts-ignore
|
|
2414
|
-
delete cloned_props.src;
|
|
2415
|
-
return cloned_props;
|
|
2416
|
-
});
|
|
2417
2405
|
const src_options = $9HbP8$createMemo(() => {
|
|
2418
2406
|
const fallback_src = $e8ffe11ed01df0fe$var$generateImageUrl(props.src, 400);
|
|
2419
2407
|
const srcset = $e8ffe11ed01df0fe$var$make_srcset(props.src, props.resolutions || [64, 128, 256, 300, 400, 512, 640, 768, 1024, 1280, 1536, 2048, 2560, 3072, 3584, 4096]);
|
|
@@ -2425,19 +2413,25 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
2425
2413
|
});
|
|
2426
2414
|
// Work around https://github.com/solidjs/solid/issues/1828
|
|
2427
2415
|
const img = new Image(); // Need to use new Image or browser might not start loading image before it's in the DOM
|
|
2416
|
+
const [, otherAttributes] = $9HbP8$splitProps(props, ["resolutions", "size", "src", "srcSet", "loading"]);
|
|
2428
2417
|
const [hasSetSize, setHasSetSize] = $9HbP8$createSignal(false);
|
|
2429
2418
|
const [hasDecoded, setHasDecoded] = $9HbP8$createSignal(false);
|
|
2430
2419
|
const productCardIndexAccessor = $b6440e72ed83671a$export$e3faf4d95300054f();
|
|
2431
2420
|
const sizePX = $9HbP8$createMemo(() => `${props.size()}px`); // props.size could be a getter that expects a cleanup so get it in this memo instead of where we set img.sizes
|
|
2432
2421
|
const listingContext = $011607bdf658f807$export$8d0c4fdbb05a2f2e();
|
|
2433
2422
|
const isPrioritisedImage = $9HbP8$createMemo(() => productCardIndexAccessor?.() < 8);
|
|
2434
|
-
const
|
|
2423
|
+
const shouldActuallyEnableLazyLoading = $9HbP8$createMemo(() => {
|
|
2435
2424
|
const {
|
|
2436
2425
|
loading: loading
|
|
2437
2426
|
} = props;
|
|
2438
2427
|
if (loading === "force-lazy") return true;
|
|
2439
2428
|
return loading === "lazy" && !isPrioritisedImage();
|
|
2440
2429
|
});
|
|
2430
|
+
const modifiedOtherAttributes = $9HbP8$mergeProps1(otherAttributes, {
|
|
2431
|
+
get loading() {
|
|
2432
|
+
return shouldActuallyEnableLazyLoading() ? "lazy" : undefined;
|
|
2433
|
+
}
|
|
2434
|
+
});
|
|
2441
2435
|
// 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
|
|
2442
2436
|
// Happened on singular, they have some weird observer (+we also have one but ours is at least 3x more efficient)
|
|
2443
2437
|
const executeWhenIdleBatched = fn => {
|
|
@@ -2497,7 +2491,7 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
2497
2491
|
$9HbP8$onCleanup(() => prevValue && aspectRatios.delete(prevValue));
|
|
2498
2492
|
}
|
|
2499
2493
|
$9HbP8$onCleanup(() => gotCleanedUp = true);
|
|
2500
|
-
$9HbP8$spread(img, $9HbP8$mergeProps1(
|
|
2494
|
+
$9HbP8$spread(img, $9HbP8$mergeProps1(modifiedOtherAttributes), false, true);
|
|
2501
2495
|
$9HbP8$createEffect(() => {
|
|
2502
2496
|
if (!props.size()) return; // wait until we have a size, run every time the size changes
|
|
2503
2497
|
if (timeoutSet) return;
|
|
@@ -2524,7 +2518,7 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
2524
2518
|
// We can do this because there has to be a container around us giving us a size
|
|
2525
2519
|
// No need to listen if we're already in the DOM
|
|
2526
2520
|
if (hasDecodedFastPath) return;
|
|
2527
|
-
if (
|
|
2521
|
+
if (shouldActuallyEnableLazyLoading()) {
|
|
2528
2522
|
// For lazy loading there's no decoding to wait for as it only occurs when the image is visible
|
|
2529
2523
|
// Make sure src is set before we put the image into the DOM though so no broken image symbol is shown
|
|
2530
2524
|
setHasDecoded(true);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/ui",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.9",
|
|
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",
|
package/server/ES10/index.cjs
CHANGED
|
@@ -94,7 +94,7 @@ $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447a
|
|
|
94
94
|
$parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
|
|
95
95
|
$parcel$export(module.exports, "SearchField", () => $98aef9965764903d$export$316f6f283ae64765);
|
|
96
96
|
/*! Depict.ai search and product listing SDK */
|
|
97
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.0.
|
|
97
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.0.9";
|
|
98
98
|
function $a28000bc10de28ad$export$e417c49320921907(dependency, fetcher) {
|
|
99
99
|
const [promiseOfCurrentFetcherRun, setPromiseOfCurrentFetcherRun] = $3hooq$solidjs.createSignal();
|
|
100
100
|
const deparallelizedFetcher = $3hooq$depictaiutilishared.deparallelize_no_drop(async dependencyValue => {
|
|
@@ -2021,18 +2021,6 @@ const $858fdcf73148519f$var$onIdleFunctionsSymbol = /*@__PURE__*/Symbol("onIdleF
|
|
|
2021
2021
|
const $858fdcf73148519f$export$f8945274f08a3105 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
2022
2022
|
const $858fdcf73148519f$export$6066eb417ed2e9f7 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
2023
2023
|
function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
2024
|
-
// Enable reactive props
|
|
2025
|
-
const otherOptions = $3hooq$solidjs.createMemo(() => {
|
|
2026
|
-
const cloned_props = {
|
|
2027
|
-
...props
|
|
2028
|
-
};
|
|
2029
|
-
delete cloned_props.resolutions;
|
|
2030
|
-
// @ts-ignore
|
|
2031
|
-
delete cloned_props.size;
|
|
2032
|
-
// @ts-ignore
|
|
2033
|
-
delete cloned_props.src;
|
|
2034
|
-
return cloned_props;
|
|
2035
|
-
});
|
|
2036
2024
|
const src_options = $3hooq$solidjs.createMemo(() => {
|
|
2037
2025
|
const fallback_src = $858fdcf73148519f$var$generateImageUrl(props.src, 400);
|
|
2038
2026
|
const srcset = $858fdcf73148519f$var$make_srcset(props.src, props.resolutions || [64, 128, 256, 300, 400, 512, 640, 768, 1024, 1280, 1536, 2048, 2560, 3072, 3584, 4096]);
|
|
@@ -2044,19 +2032,25 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
|
2044
2032
|
});
|
|
2045
2033
|
// Work around https://github.com/solidjs/solid/issues/1828
|
|
2046
2034
|
const img = new Image(); // Need to use new Image or browser might not start loading image before it's in the DOM
|
|
2035
|
+
const [, otherAttributes] = $3hooq$solidjs.splitProps(props, ["resolutions", "size", "src", "srcSet", "loading"]);
|
|
2047
2036
|
const [hasSetSize, setHasSetSize] = $3hooq$solidjs.createSignal(false);
|
|
2048
2037
|
const [hasDecoded, setHasDecoded] = $3hooq$solidjs.createSignal(false);
|
|
2049
2038
|
const productCardIndexAccessor = $b54645378dfc7280$export$e3faf4d95300054f();
|
|
2050
2039
|
const sizePX = $3hooq$solidjs.createMemo(() => "".concat(props.size(), "px")); // props.size could be a getter that expects a cleanup so get it in this memo instead of where we set img.sizes
|
|
2051
2040
|
const listingContext = $d067f3a30f047b41$export$8d0c4fdbb05a2f2e();
|
|
2052
2041
|
const isPrioritisedImage = $3hooq$solidjs.createMemo(() => (productCardIndexAccessor === null || productCardIndexAccessor === void 0 ? void 0 : productCardIndexAccessor()) < 8);
|
|
2053
|
-
const
|
|
2042
|
+
const shouldActuallyEnableLazyLoading = $3hooq$solidjs.createMemo(() => {
|
|
2054
2043
|
const {
|
|
2055
2044
|
loading: loading
|
|
2056
2045
|
} = props;
|
|
2057
2046
|
if (loading === "force-lazy") return true;
|
|
2058
2047
|
return loading === "lazy" && !isPrioritisedImage();
|
|
2059
2048
|
});
|
|
2049
|
+
const modifiedOtherAttributes = $3hooq$solidjs.mergeProps(otherAttributes, {
|
|
2050
|
+
get loading() {
|
|
2051
|
+
return shouldActuallyEnableLazyLoading() ? "lazy" : undefined;
|
|
2052
|
+
}
|
|
2053
|
+
});
|
|
2060
2054
|
// 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
|
|
2061
2055
|
// Happened on singular, they have some weird observer (+we also have one but ours is at least 3x more efficient)
|
|
2062
2056
|
const executeWhenIdleBatched = fn => {
|
|
@@ -2119,7 +2113,7 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
|
2119
2113
|
$3hooq$solidjs.onCleanup(() => prevValue && aspectRatios.delete(prevValue));
|
|
2120
2114
|
}
|
|
2121
2115
|
$3hooq$solidjs.onCleanup(() => gotCleanedUp = true);
|
|
2122
|
-
$3hooq$solidjsweb.spread(img, $3hooq$solidjs.mergeProps(
|
|
2116
|
+
$3hooq$solidjsweb.spread(img, $3hooq$solidjs.mergeProps(modifiedOtherAttributes), false, true);
|
|
2123
2117
|
$3hooq$solidjs.createEffect(() => {
|
|
2124
2118
|
if (!props.size()) return; // wait until we have a size, run every time the size changes
|
|
2125
2119
|
if (timeoutSet) return;
|
|
@@ -2146,7 +2140,7 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
|
2146
2140
|
// We can do this because there has to be a container around us giving us a size
|
|
2147
2141
|
// No need to listen if we're already in the DOM
|
|
2148
2142
|
if (hasDecodedFastPath) return;
|
|
2149
|
-
if (
|
|
2143
|
+
if (shouldActuallyEnableLazyLoading()) {
|
|
2150
2144
|
// For lazy loading there's no decoding to wait for as it only occurs when the image is visible
|
|
2151
2145
|
// Make sure src is set before we put the image into the DOM though so no broken image symbol is shown
|
|
2152
2146
|
setHasDecoded(true);
|
package/server/ES10/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
|
|
|
10
10
|
import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { SearchFilter as _SearchFilter2 } from "@depict-ai/types/api/SearchRequestV2";
|
|
13
|
-
export const version = "4.0.
|
|
13
|
+
export const version = "4.0.9";
|
|
14
14
|
export type ModalAlignmentSignals = {
|
|
15
15
|
body_: Signal<JSX.CSSProperties>;
|
|
16
16
|
field_: Signal<JSX.CSSProperties>;
|
package/server/ES10/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { add_to_version_info as $b8hua$add_to_version_info, deparallelize_no_drop as $b8hua$deparallelize_no_drop, catchify as $b8hua$catchify, make_random_classname as $b8hua$make_random_classname, ContainedImage as $b8hua$ContainedImage, standard_price_format as $b8hua$standard_price_format, javascript_media_query as $b8hua$javascript_media_query, dlog as $b8hua$dlog, camelCasifyObject as $b8hua$camelCasifyObject, make_asyncIterable_exiter as $b8hua$make_asyncIterable_exiter, href_change_ipns as $b8hua$href_change_ipns, observer as $b8hua$observer, report as $b8hua$report, base64_encode_unicode as $b8hua$base64_encode_unicode, base64_decode_unicode as $b8hua$base64_decode_unicode, queueMacroTask as $b8hua$queueMacroTask, findMostFrequentItem as $b8hua$findMostFrequentItem, dwarn as $b8hua$dwarn, slider_fading_factory as $b8hua$slider_fading_factory, Amazing_Slider as $b8hua$Amazing_Slider, slider_snap_css as $b8hua$slider_snap_css, n_col_styling_with_dist as $b8hua$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $b8hua$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $b8hua$layout_get_total_rec_amount_for_row, layout_media_query_header as $b8hua$layout_media_query_header, use_href_accessor as $b8hua$use_href_accessor, get_session_id as $b8hua$get_session_id, add_version_query_params as $b8hua$add_version_query_params, base_url as $b8hua$base_url, instant_exec_on_suspect_history_change as $b8hua$instant_exec_on_suspect_history_change, slider_fractional_factory as $b8hua$slider_fractional_factory, useExpandingContainer as $b8hua$useExpandingContainer, hex_to_rgb as $b8hua$hex_to_rgb, relative_luminance_from_rgb as $b8hua$relative_luminance_from_rgb, snakeCasifyObject as $b8hua$snakeCasifyObject, fetch_retry as $b8hua$fetch_retry, make_url_with_query_params as $b8hua$make_url_with_query_params, sort_obj as $b8hua$sort_obj, ListenableSet as $b8hua$ListenableSet1, insert_surfaces as $b8hua$insert_surfaces } from "@depict-ai/utilishared/ES10";
|
|
2
|
-
import { createSignal as $b8hua$createSignal, createResource as $b8hua$createResource, createEffect as $b8hua$createEffect, untrack as $b8hua$untrack, createMemo as $b8hua$createMemo, onCleanup as $b8hua$onCleanup, Show as $b8hua$Show, createComputed as $b8hua$createComputed, For as $b8hua$For, getOwner as $b8hua$getOwner, runWithOwner as $b8hua$runWithOwner, createContext as $b8hua$createContext, useContext as $b8hua$useContext, on as $b8hua$on, Index as $b8hua$Index, batch as $b8hua$batch, ErrorBoundary as $b8hua$ErrorBoundary, mergeProps as $b8hua$mergeProps1, createUniqueId as $b8hua$createUniqueId, createRenderEffect as $b8hua$createRenderEffect, createSelector as $b8hua$createSelector, children as $b8hua$children,
|
|
2
|
+
import { createSignal as $b8hua$createSignal, createResource as $b8hua$createResource, createEffect as $b8hua$createEffect, untrack as $b8hua$untrack, createMemo as $b8hua$createMemo, onCleanup as $b8hua$onCleanup, Show as $b8hua$Show, createComputed as $b8hua$createComputed, For as $b8hua$For, getOwner as $b8hua$getOwner, runWithOwner as $b8hua$runWithOwner, createContext as $b8hua$createContext, useContext as $b8hua$useContext, on as $b8hua$on, Index as $b8hua$Index, batch as $b8hua$batch, ErrorBoundary as $b8hua$ErrorBoundary, splitProps as $b8hua$splitProps, mergeProps as $b8hua$mergeProps1, createUniqueId as $b8hua$createUniqueId, createRenderEffect as $b8hua$createRenderEffect, createSelector as $b8hua$createSelector, children as $b8hua$children, createRoot as $b8hua$createRoot, Suspense as $b8hua$Suspense, createReaction as $b8hua$createReaction, mapArray as $b8hua$mapArray } from "solid-js";
|
|
3
3
|
import { ssr as $b8hua$ssr, ssrHydrationKey as $b8hua$ssrHydrationKey, escape as $b8hua$escape, createComponent as $b8hua$createComponent, ssrAttribute as $b8hua$ssrAttribute, ssrClassList as $b8hua$ssrClassList, ssrStyle as $b8hua$ssrStyle, ssrElement as $b8hua$ssrElement, mergeProps as $b8hua$mergeProps, insert as $b8hua$insert, spread as $b8hua$spread, isServer as $b8hua$isServer, Dynamic as $b8hua$Dynamic } from "solid-js/web";
|
|
4
4
|
import { ListenableSet as $b8hua$ListenableSet, catchify as $b8hua$catchify1, use_href_accessor as $b8hua$use_href_accessor1, report as $b8hua$report1 } from "@depict-ai/utilishared/ES10";
|
|
5
5
|
import $b8hua$babelruntimehelpersdefineProperty from "@babel/runtime/helpers/defineProperty";
|
|
@@ -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.0.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.0.9";
|
|
14
14
|
function $a604a8ffa4e4c03f$export$e417c49320921907(dependency, fetcher) {
|
|
15
15
|
const [promiseOfCurrentFetcherRun, setPromiseOfCurrentFetcherRun] = $b8hua$createSignal();
|
|
16
16
|
const deparallelizedFetcher = $b8hua$deparallelize_no_drop(async dependencyValue => {
|
|
@@ -1937,18 +1937,6 @@ const $56047603f9d212b6$var$onIdleFunctionsSymbol = /*@__PURE__*/Symbol("onIdleF
|
|
|
1937
1937
|
const $56047603f9d212b6$export$f8945274f08a3105 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
1938
1938
|
const $56047603f9d212b6$export$6066eb417ed2e9f7 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
1939
1939
|
function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
1940
|
-
// Enable reactive props
|
|
1941
|
-
const otherOptions = $b8hua$createMemo(() => {
|
|
1942
|
-
const cloned_props = {
|
|
1943
|
-
...props
|
|
1944
|
-
};
|
|
1945
|
-
delete cloned_props.resolutions;
|
|
1946
|
-
// @ts-ignore
|
|
1947
|
-
delete cloned_props.size;
|
|
1948
|
-
// @ts-ignore
|
|
1949
|
-
delete cloned_props.src;
|
|
1950
|
-
return cloned_props;
|
|
1951
|
-
});
|
|
1952
1940
|
const src_options = $b8hua$createMemo(() => {
|
|
1953
1941
|
const fallback_src = $56047603f9d212b6$var$generateImageUrl(props.src, 400);
|
|
1954
1942
|
const srcset = $56047603f9d212b6$var$make_srcset(props.src, props.resolutions || [64, 128, 256, 300, 400, 512, 640, 768, 1024, 1280, 1536, 2048, 2560, 3072, 3584, 4096]);
|
|
@@ -1960,19 +1948,25 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
|
1960
1948
|
});
|
|
1961
1949
|
// Work around https://github.com/solidjs/solid/issues/1828
|
|
1962
1950
|
const img = new Image(); // Need to use new Image or browser might not start loading image before it's in the DOM
|
|
1951
|
+
const [, otherAttributes] = $b8hua$splitProps(props, ["resolutions", "size", "src", "srcSet", "loading"]);
|
|
1963
1952
|
const [hasSetSize, setHasSetSize] = $b8hua$createSignal(false);
|
|
1964
1953
|
const [hasDecoded, setHasDecoded] = $b8hua$createSignal(false);
|
|
1965
1954
|
const productCardIndexAccessor = $1e69163caedaab4e$export$e3faf4d95300054f();
|
|
1966
1955
|
const sizePX = $b8hua$createMemo(() => "".concat(props.size(), "px")); // props.size could be a getter that expects a cleanup so get it in this memo instead of where we set img.sizes
|
|
1967
1956
|
const listingContext = $5441862cd2f5e111$export$8d0c4fdbb05a2f2e();
|
|
1968
1957
|
const isPrioritisedImage = $b8hua$createMemo(() => (productCardIndexAccessor === null || productCardIndexAccessor === void 0 ? void 0 : productCardIndexAccessor()) < 8);
|
|
1969
|
-
const
|
|
1958
|
+
const shouldActuallyEnableLazyLoading = $b8hua$createMemo(() => {
|
|
1970
1959
|
const {
|
|
1971
1960
|
loading: loading
|
|
1972
1961
|
} = props;
|
|
1973
1962
|
if (loading === "force-lazy") return true;
|
|
1974
1963
|
return loading === "lazy" && !isPrioritisedImage();
|
|
1975
1964
|
});
|
|
1965
|
+
const modifiedOtherAttributes = $b8hua$mergeProps1(otherAttributes, {
|
|
1966
|
+
get loading() {
|
|
1967
|
+
return shouldActuallyEnableLazyLoading() ? "lazy" : undefined;
|
|
1968
|
+
}
|
|
1969
|
+
});
|
|
1976
1970
|
// 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
|
|
1977
1971
|
// Happened on singular, they have some weird observer (+we also have one but ours is at least 3x more efficient)
|
|
1978
1972
|
const executeWhenIdleBatched = fn => {
|
|
@@ -2035,7 +2029,7 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
|
2035
2029
|
$b8hua$onCleanup(() => prevValue && aspectRatios.delete(prevValue));
|
|
2036
2030
|
}
|
|
2037
2031
|
$b8hua$onCleanup(() => gotCleanedUp = true);
|
|
2038
|
-
$b8hua$spread(img, $b8hua$mergeProps1(
|
|
2032
|
+
$b8hua$spread(img, $b8hua$mergeProps1(modifiedOtherAttributes), false, true);
|
|
2039
2033
|
$b8hua$createEffect(() => {
|
|
2040
2034
|
if (!props.size()) return; // wait until we have a size, run every time the size changes
|
|
2041
2035
|
if (timeoutSet) return;
|
|
@@ -2062,7 +2056,7 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
|
2062
2056
|
// We can do this because there has to be a container around us giving us a size
|
|
2063
2057
|
// No need to listen if we're already in the DOM
|
|
2064
2058
|
if (hasDecodedFastPath) return;
|
|
2065
|
-
if (
|
|
2059
|
+
if (shouldActuallyEnableLazyLoading()) {
|
|
2066
2060
|
// For lazy loading there's no decoding to wait for as it only occurs when the image is visible
|
|
2067
2061
|
// Make sure src is set before we put the image into the DOM though so no broken image symbol is shown
|
|
2068
2062
|
setHasDecoded(true);
|
package/server/latest/index.cjs
CHANGED
|
@@ -88,7 +88,7 @@ $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad99
|
|
|
88
88
|
$parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
|
|
89
89
|
$parcel$export(module.exports, "SearchField", () => $c0a0659cf97e8eb2$export$316f6f283ae64765);
|
|
90
90
|
/*! Depict.ai search and product listing SDK */
|
|
91
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.0.
|
|
91
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.0.9";
|
|
92
92
|
function $53df95e470b2f8d2$export$e417c49320921907(dependency, fetcher) {
|
|
93
93
|
const [promiseOfCurrentFetcherRun, setPromiseOfCurrentFetcherRun] = $5vyXB$solidjs.createSignal();
|
|
94
94
|
const deparallelizedFetcher = $5vyXB$depictaiutilishared.deparallelize_no_drop(async dependencyValue => {
|
|
@@ -1924,18 +1924,6 @@ const $19950faaac026e09$var$onIdleFunctionsSymbol = /*@__PURE__*/Symbol("onIdleF
|
|
|
1924
1924
|
const $19950faaac026e09$export$f8945274f08a3105 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
1925
1925
|
const $19950faaac026e09$export$6066eb417ed2e9f7 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
1926
1926
|
function $19950faaac026e09$export$6e5611bc7e57e477(props) {
|
|
1927
|
-
// Enable reactive props
|
|
1928
|
-
const otherOptions = $5vyXB$solidjs.createMemo(() => {
|
|
1929
|
-
const cloned_props = {
|
|
1930
|
-
...props
|
|
1931
|
-
};
|
|
1932
|
-
delete cloned_props.resolutions;
|
|
1933
|
-
// @ts-ignore
|
|
1934
|
-
delete cloned_props.size;
|
|
1935
|
-
// @ts-ignore
|
|
1936
|
-
delete cloned_props.src;
|
|
1937
|
-
return cloned_props;
|
|
1938
|
-
});
|
|
1939
1927
|
const src_options = $5vyXB$solidjs.createMemo(() => {
|
|
1940
1928
|
const fallback_src = $19950faaac026e09$var$generateImageUrl(props.src, 400);
|
|
1941
1929
|
const srcset = $19950faaac026e09$var$make_srcset(props.src, props.resolutions || [64, 128, 256, 300, 400, 512, 640, 768, 1024, 1280, 1536, 2048, 2560, 3072, 3584, 4096]);
|
|
@@ -1947,19 +1935,25 @@ function $19950faaac026e09$export$6e5611bc7e57e477(props) {
|
|
|
1947
1935
|
});
|
|
1948
1936
|
// Work around https://github.com/solidjs/solid/issues/1828
|
|
1949
1937
|
const img = new Image(); // Need to use new Image or browser might not start loading image before it's in the DOM
|
|
1938
|
+
const [, otherAttributes] = $5vyXB$solidjs.splitProps(props, ["resolutions", "size", "src", "srcSet", "loading"]);
|
|
1950
1939
|
const [hasSetSize, setHasSetSize] = $5vyXB$solidjs.createSignal(false);
|
|
1951
1940
|
const [hasDecoded, setHasDecoded] = $5vyXB$solidjs.createSignal(false);
|
|
1952
1941
|
const productCardIndexAccessor = $129b9b9c010039d0$export$e3faf4d95300054f();
|
|
1953
1942
|
const sizePX = $5vyXB$solidjs.createMemo(() => `${props.size()}px`); // props.size could be a getter that expects a cleanup so get it in this memo instead of where we set img.sizes
|
|
1954
1943
|
const listingContext = $84798aaa863a4909$export$8d0c4fdbb05a2f2e();
|
|
1955
1944
|
const isPrioritisedImage = $5vyXB$solidjs.createMemo(() => productCardIndexAccessor?.() < 8);
|
|
1956
|
-
const
|
|
1945
|
+
const shouldActuallyEnableLazyLoading = $5vyXB$solidjs.createMemo(() => {
|
|
1957
1946
|
const {
|
|
1958
1947
|
loading: loading
|
|
1959
1948
|
} = props;
|
|
1960
1949
|
if (loading === "force-lazy") return true;
|
|
1961
1950
|
return loading === "lazy" && !isPrioritisedImage();
|
|
1962
1951
|
});
|
|
1952
|
+
const modifiedOtherAttributes = $5vyXB$solidjs.mergeProps(otherAttributes, {
|
|
1953
|
+
get loading() {
|
|
1954
|
+
return shouldActuallyEnableLazyLoading() ? "lazy" : undefined;
|
|
1955
|
+
}
|
|
1956
|
+
});
|
|
1963
1957
|
// 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
|
|
1964
1958
|
// Happened on singular, they have some weird observer (+we also have one but ours is at least 3x more efficient)
|
|
1965
1959
|
const executeWhenIdleBatched = fn => {
|
|
@@ -2019,7 +2013,7 @@ function $19950faaac026e09$export$6e5611bc7e57e477(props) {
|
|
|
2019
2013
|
$5vyXB$solidjs.onCleanup(() => prevValue && aspectRatios.delete(prevValue));
|
|
2020
2014
|
}
|
|
2021
2015
|
$5vyXB$solidjs.onCleanup(() => gotCleanedUp = true);
|
|
2022
|
-
$5vyXB$solidjsweb.spread(img, $5vyXB$solidjs.mergeProps(
|
|
2016
|
+
$5vyXB$solidjsweb.spread(img, $5vyXB$solidjs.mergeProps(modifiedOtherAttributes), false, true);
|
|
2023
2017
|
$5vyXB$solidjs.createEffect(() => {
|
|
2024
2018
|
if (!props.size()) return; // wait until we have a size, run every time the size changes
|
|
2025
2019
|
if (timeoutSet) return;
|
|
@@ -2046,7 +2040,7 @@ function $19950faaac026e09$export$6e5611bc7e57e477(props) {
|
|
|
2046
2040
|
// We can do this because there has to be a container around us giving us a size
|
|
2047
2041
|
// No need to listen if we're already in the DOM
|
|
2048
2042
|
if (hasDecodedFastPath) return;
|
|
2049
|
-
if (
|
|
2043
|
+
if (shouldActuallyEnableLazyLoading()) {
|
|
2050
2044
|
// For lazy loading there's no decoding to wait for as it only occurs when the image is visible
|
|
2051
2045
|
// Make sure src is set before we put the image into the DOM though so no broken image symbol is shown
|
|
2052
2046
|
setHasDecoded(true);
|
package/server/latest/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
|
|
|
10
10
|
import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { SearchFilter as _SearchFilter2 } from "@depict-ai/types/api/SearchRequestV2";
|
|
13
|
-
export const version = "4.0.
|
|
13
|
+
export const version = "4.0.9";
|
|
14
14
|
export type ModalAlignmentSignals = {
|
|
15
15
|
body_: Signal<JSX.CSSProperties>;
|
|
16
16
|
field_: Signal<JSX.CSSProperties>;
|
package/server/latest/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { add_to_version_info as $i7OB2$add_to_version_info, deparallelize_no_drop as $i7OB2$deparallelize_no_drop, catchify as $i7OB2$catchify, make_random_classname as $i7OB2$make_random_classname, ContainedImage as $i7OB2$ContainedImage, standard_price_format as $i7OB2$standard_price_format, javascript_media_query as $i7OB2$javascript_media_query, dlog as $i7OB2$dlog, camelCasifyObject as $i7OB2$camelCasifyObject, make_asyncIterable_exiter as $i7OB2$make_asyncIterable_exiter, href_change_ipns as $i7OB2$href_change_ipns, observer as $i7OB2$observer, report as $i7OB2$report, base64_encode_unicode as $i7OB2$base64_encode_unicode, base64_decode_unicode as $i7OB2$base64_decode_unicode, queueMacroTask as $i7OB2$queueMacroTask, findMostFrequentItem as $i7OB2$findMostFrequentItem, dwarn as $i7OB2$dwarn, slider_fading_factory as $i7OB2$slider_fading_factory, Amazing_Slider as $i7OB2$Amazing_Slider, slider_snap_css as $i7OB2$slider_snap_css, n_col_styling_with_dist as $i7OB2$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $i7OB2$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $i7OB2$layout_get_total_rec_amount_for_row, layout_media_query_header as $i7OB2$layout_media_query_header, use_href_accessor as $i7OB2$use_href_accessor, get_session_id as $i7OB2$get_session_id, add_version_query_params as $i7OB2$add_version_query_params, base_url as $i7OB2$base_url, instant_exec_on_suspect_history_change as $i7OB2$instant_exec_on_suspect_history_change, slider_fractional_factory as $i7OB2$slider_fractional_factory, useExpandingContainer as $i7OB2$useExpandingContainer, hex_to_rgb as $i7OB2$hex_to_rgb, relative_luminance_from_rgb as $i7OB2$relative_luminance_from_rgb, snakeCasifyObject as $i7OB2$snakeCasifyObject, fetch_retry as $i7OB2$fetch_retry, sort_obj as $i7OB2$sort_obj, make_url_with_query_params as $i7OB2$make_url_with_query_params, ListenableSet as $i7OB2$ListenableSet1, insert_surfaces as $i7OB2$insert_surfaces } from "@depict-ai/utilishared/latest";
|
|
2
|
-
import { createSignal as $i7OB2$createSignal, createResource as $i7OB2$createResource, createEffect as $i7OB2$createEffect, untrack as $i7OB2$untrack, createMemo as $i7OB2$createMemo, onCleanup as $i7OB2$onCleanup, Show as $i7OB2$Show, createComputed as $i7OB2$createComputed, For as $i7OB2$For, getOwner as $i7OB2$getOwner, runWithOwner as $i7OB2$runWithOwner, createContext as $i7OB2$createContext, useContext as $i7OB2$useContext, on as $i7OB2$on, Index as $i7OB2$Index, batch as $i7OB2$batch, ErrorBoundary as $i7OB2$ErrorBoundary, mergeProps as $i7OB2$mergeProps1, createUniqueId as $i7OB2$createUniqueId, createRenderEffect as $i7OB2$createRenderEffect, createSelector as $i7OB2$createSelector, children as $i7OB2$children,
|
|
2
|
+
import { createSignal as $i7OB2$createSignal, createResource as $i7OB2$createResource, createEffect as $i7OB2$createEffect, untrack as $i7OB2$untrack, createMemo as $i7OB2$createMemo, onCleanup as $i7OB2$onCleanup, Show as $i7OB2$Show, createComputed as $i7OB2$createComputed, For as $i7OB2$For, getOwner as $i7OB2$getOwner, runWithOwner as $i7OB2$runWithOwner, createContext as $i7OB2$createContext, useContext as $i7OB2$useContext, on as $i7OB2$on, Index as $i7OB2$Index, batch as $i7OB2$batch, ErrorBoundary as $i7OB2$ErrorBoundary, splitProps as $i7OB2$splitProps, mergeProps as $i7OB2$mergeProps1, createUniqueId as $i7OB2$createUniqueId, createRenderEffect as $i7OB2$createRenderEffect, createSelector as $i7OB2$createSelector, children as $i7OB2$children, createRoot as $i7OB2$createRoot, Suspense as $i7OB2$Suspense, createReaction as $i7OB2$createReaction, mapArray as $i7OB2$mapArray } from "solid-js";
|
|
3
3
|
import { ssr as $i7OB2$ssr, ssrHydrationKey as $i7OB2$ssrHydrationKey, escape as $i7OB2$escape, createComponent as $i7OB2$createComponent, ssrAttribute as $i7OB2$ssrAttribute, ssrClassList as $i7OB2$ssrClassList, ssrStyle as $i7OB2$ssrStyle, ssrElement as $i7OB2$ssrElement, mergeProps as $i7OB2$mergeProps, insert as $i7OB2$insert, spread as $i7OB2$spread, isServer as $i7OB2$isServer, Dynamic as $i7OB2$Dynamic } from "solid-js/web";
|
|
4
4
|
import { ListenableSet as $i7OB2$ListenableSet, catchify as $i7OB2$catchify1, use_href_accessor as $i7OB2$use_href_accessor1, report as $i7OB2$report1 } from "@depict-ai/utilishared/latest";
|
|
5
5
|
import { createStore as $i7OB2$createStore, reconcile as $i7OB2$reconcile } from "solid-js/store";
|
|
@@ -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.0.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "4.0.9";
|
|
11
11
|
function $136f1d4d6c7ba6ac$export$e417c49320921907(dependency, fetcher) {
|
|
12
12
|
const [promiseOfCurrentFetcherRun, setPromiseOfCurrentFetcherRun] = $i7OB2$createSignal();
|
|
13
13
|
const deparallelizedFetcher = $i7OB2$deparallelize_no_drop(async dependencyValue => {
|
|
@@ -1843,18 +1843,6 @@ const $e8ffe11ed01df0fe$var$onIdleFunctionsSymbol = /*@__PURE__*/Symbol("onIdleF
|
|
|
1843
1843
|
const $e8ffe11ed01df0fe$export$f8945274f08a3105 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
1844
1844
|
const $e8ffe11ed01df0fe$export$6066eb417ed2e9f7 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
1845
1845
|
function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
1846
|
-
// Enable reactive props
|
|
1847
|
-
const otherOptions = $i7OB2$createMemo(() => {
|
|
1848
|
-
const cloned_props = {
|
|
1849
|
-
...props
|
|
1850
|
-
};
|
|
1851
|
-
delete cloned_props.resolutions;
|
|
1852
|
-
// @ts-ignore
|
|
1853
|
-
delete cloned_props.size;
|
|
1854
|
-
// @ts-ignore
|
|
1855
|
-
delete cloned_props.src;
|
|
1856
|
-
return cloned_props;
|
|
1857
|
-
});
|
|
1858
1846
|
const src_options = $i7OB2$createMemo(() => {
|
|
1859
1847
|
const fallback_src = $e8ffe11ed01df0fe$var$generateImageUrl(props.src, 400);
|
|
1860
1848
|
const srcset = $e8ffe11ed01df0fe$var$make_srcset(props.src, props.resolutions || [64, 128, 256, 300, 400, 512, 640, 768, 1024, 1280, 1536, 2048, 2560, 3072, 3584, 4096]);
|
|
@@ -1866,19 +1854,25 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
1866
1854
|
});
|
|
1867
1855
|
// Work around https://github.com/solidjs/solid/issues/1828
|
|
1868
1856
|
const img = new Image(); // Need to use new Image or browser might not start loading image before it's in the DOM
|
|
1857
|
+
const [, otherAttributes] = $i7OB2$splitProps(props, ["resolutions", "size", "src", "srcSet", "loading"]);
|
|
1869
1858
|
const [hasSetSize, setHasSetSize] = $i7OB2$createSignal(false);
|
|
1870
1859
|
const [hasDecoded, setHasDecoded] = $i7OB2$createSignal(false);
|
|
1871
1860
|
const productCardIndexAccessor = $b6440e72ed83671a$export$e3faf4d95300054f();
|
|
1872
1861
|
const sizePX = $i7OB2$createMemo(() => `${props.size()}px`); // props.size could be a getter that expects a cleanup so get it in this memo instead of where we set img.sizes
|
|
1873
1862
|
const listingContext = $011607bdf658f807$export$8d0c4fdbb05a2f2e();
|
|
1874
1863
|
const isPrioritisedImage = $i7OB2$createMemo(() => productCardIndexAccessor?.() < 8);
|
|
1875
|
-
const
|
|
1864
|
+
const shouldActuallyEnableLazyLoading = $i7OB2$createMemo(() => {
|
|
1876
1865
|
const {
|
|
1877
1866
|
loading: loading
|
|
1878
1867
|
} = props;
|
|
1879
1868
|
if (loading === "force-lazy") return true;
|
|
1880
1869
|
return loading === "lazy" && !isPrioritisedImage();
|
|
1881
1870
|
});
|
|
1871
|
+
const modifiedOtherAttributes = $i7OB2$mergeProps1(otherAttributes, {
|
|
1872
|
+
get loading() {
|
|
1873
|
+
return shouldActuallyEnableLazyLoading() ? "lazy" : undefined;
|
|
1874
|
+
}
|
|
1875
|
+
});
|
|
1882
1876
|
// 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
|
|
1883
1877
|
// Happened on singular, they have some weird observer (+we also have one but ours is at least 3x more efficient)
|
|
1884
1878
|
const executeWhenIdleBatched = fn => {
|
|
@@ -1938,7 +1932,7 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
1938
1932
|
$i7OB2$onCleanup(() => prevValue && aspectRatios.delete(prevValue));
|
|
1939
1933
|
}
|
|
1940
1934
|
$i7OB2$onCleanup(() => gotCleanedUp = true);
|
|
1941
|
-
$i7OB2$spread(img, $i7OB2$mergeProps1(
|
|
1935
|
+
$i7OB2$spread(img, $i7OB2$mergeProps1(modifiedOtherAttributes), false, true);
|
|
1942
1936
|
$i7OB2$createEffect(() => {
|
|
1943
1937
|
if (!props.size()) return; // wait until we have a size, run every time the size changes
|
|
1944
1938
|
if (timeoutSet) return;
|
|
@@ -1965,7 +1959,7 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
1965
1959
|
// We can do this because there has to be a container around us giving us a size
|
|
1966
1960
|
// No need to listen if we're already in the DOM
|
|
1967
1961
|
if (hasDecodedFastPath) return;
|
|
1968
|
-
if (
|
|
1962
|
+
if (shouldActuallyEnableLazyLoading()) {
|
|
1969
1963
|
// For lazy loading there's no decoding to wait for as it only occurs when the image is visible
|
|
1970
1964
|
// Make sure src is set before we put the image into the DOM though so no broken image symbol is shown
|
|
1971
1965
|
setHasDecoded(true);
|