@depict-ai/ui 4.0.1 → 4.0.3
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 +55 -4
- package/ES10/index.d.ts +25 -23
- package/ES10/index.js +59 -8
- package/latest/index.cjs +52 -4
- package/latest/index.d.ts +25 -23
- package/latest/index.js +56 -8
- package/locales/ES10/index.cjs +6 -0
- package/locales/ES10/index.d.ts +1 -0
- package/locales/ES10/index.js +6 -1
- package/locales/latest/index.cjs +6 -0
- package/locales/latest/index.d.ts +1 -0
- package/locales/latest/index.js +6 -1
- package/package.json +3 -3
- package/server/ES10/index.cjs +55 -4
- package/server/ES10/index.d.ts +25 -23
- package/server/ES10/index.js +59 -8
- package/server/latest/index.cjs +52 -4
- package/server/latest/index.d.ts +25 -23
- package/server/latest/index.js +56 -8
package/latest/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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, 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,
|
|
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, ListenableSet as $9HbP8$ListenableSet, findMostFrequentItem as $9HbP8$findMostFrequentItem, queueMacroTask as $9HbP8$queueMacroTask, 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, insert_surfaces as $9HbP8$insert_surfaces } from "@depict-ai/utilishared/latest";
|
|
2
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, on as $9HbP8$on, Index as $9HbP8$Index, batch as $9HbP8$batch, ErrorBoundary as $9HbP8$ErrorBoundary, createContext as $9HbP8$createContext, useContext as $9HbP8$useContext, mergeProps as $9HbP8$mergeProps1, createUniqueId as $9HbP8$createUniqueId, createRenderEffect as $9HbP8$createRenderEffect, createSelector as $9HbP8$createSelector, children as $9HbP8$children, splitProps as $9HbP8$splitProps, 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
|
-
import { ListenableSet as $9HbP8$
|
|
4
|
+
import { ListenableSet as $9HbP8$ListenableSet1, 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";
|
|
6
6
|
|
|
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.3";
|
|
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 => {
|
|
@@ -2344,6 +2344,7 @@ function $e8ffe11ed01df0fe$export$e6fffe67d4cdd848(whatToWatch) {
|
|
|
2344
2344
|
return size;
|
|
2345
2345
|
}
|
|
2346
2346
|
const $e8ffe11ed01df0fe$var$onIdleFunctionsSymbol = /*@__PURE__*/Symbol("onIdleFunctions");
|
|
2347
|
+
const $e8ffe11ed01df0fe$export$f8945274f08a3105 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
2347
2348
|
function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
2348
2349
|
// Enable reactive props
|
|
2349
2350
|
const otherOptions = $9HbP8$createMemo(() => {
|
|
@@ -2408,6 +2409,21 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
2408
2409
|
let timeoutSet = false;
|
|
2409
2410
|
let gotCleanedUp = false;
|
|
2410
2411
|
img.classList.add("s-responsive-image");
|
|
2412
|
+
if (listingContext) {
|
|
2413
|
+
let prevValue;
|
|
2414
|
+
const aspectRatios = listingContext[$e8ffe11ed01df0fe$export$f8945274f08a3105] ||= new (0, $9HbP8$ListenableSet)();
|
|
2415
|
+
img.addEventListener("load", $9HbP8$catchify(() => {
|
|
2416
|
+
// Save our aspect ratio whenever it changes, so that we can base the containers on the most dominant aspect ratio, used in SearchModalV2
|
|
2417
|
+
const aspectRatio_ = img.naturalWidth / img.naturalHeight;
|
|
2418
|
+
if (prevValue) aspectRatios.delete(prevValue);
|
|
2419
|
+
const newValue = !isNaN(aspectRatio_) ? {
|
|
2420
|
+
aspectRatio_: aspectRatio_
|
|
2421
|
+
} : undefined;
|
|
2422
|
+
if (newValue) aspectRatios.add(newValue);
|
|
2423
|
+
prevValue = newValue;
|
|
2424
|
+
}));
|
|
2425
|
+
$9HbP8$onCleanup(() => prevValue && aspectRatios.delete(prevValue));
|
|
2426
|
+
}
|
|
2411
2427
|
$9HbP8$onCleanup(() => gotCleanedUp = true);
|
|
2412
2428
|
$9HbP8$spread(img, $9HbP8$mergeProps1(otherOptions), false, true);
|
|
2413
2429
|
$9HbP8$createEffect(() => {
|
|
@@ -2475,9 +2491,28 @@ function $660070e2a394b3c3$export$e4b984597b71e989(props) {
|
|
|
2475
2491
|
// create a signal that's the same for all items in this listing
|
|
2476
2492
|
context[$660070e2a394b3c3$export$d7b7ab832c20e2f4] = $9HbP8$createSignal();
|
|
2477
2493
|
const [currentImageSize, setCurrentImageSize] = context?.[$660070e2a394b3c3$export$d7b7ab832c20e2f4] || $660070e2a394b3c3$var$backupSizeSignal; // use global fallback signal (might lead to blurry images) if no context is available
|
|
2494
|
+
const aspectRatiosSet = context ?
|
|
2495
|
+
// If the context exists we have to create the set here as getting it here would be too late when it's created by ShopifyResponsiveImg below
|
|
2496
|
+
context[(0, $e8ffe11ed01df0fe$export$f8945274f08a3105)] ||= new (0, $9HbP8$ListenableSet)() : undefined;
|
|
2497
|
+
const [aspectRatios, setAspectRatios] = $9HbP8$createSignal(aspectRatiosSet, {
|
|
2498
|
+
equals: false
|
|
2499
|
+
});
|
|
2500
|
+
const aspectRatioToUse = $9HbP8$createMemo(() => {
|
|
2501
|
+
const aspectRatiosSet = aspectRatios(); // This signal "changes" to the same set every time the set changes, so we can use it as a dependency here
|
|
2502
|
+
useMostPrevalentAspectRatio: {
|
|
2503
|
+
if (!aspectRatiosSet || !props.autoAdjustAspectRatio) break useMostPrevalentAspectRatio;
|
|
2504
|
+
// Get the aspect ratio that most of the loaded images inside the ListingProvider we are, load
|
|
2505
|
+
const asArray = [...aspectRatiosSet].map(({
|
|
2506
|
+
aspectRatio_: aspectRatio_
|
|
2507
|
+
}) => aspectRatio_);
|
|
2508
|
+
const mostPrevalentAspectRatio = $9HbP8$findMostFrequentItem(asArray);
|
|
2509
|
+
if (mostPrevalentAspectRatio) return `var(${(0, $bb15dfb548a7666e$export$8a2234b5b1a5ebd4)}, ${mostPrevalentAspectRatio})`;
|
|
2510
|
+
}
|
|
2511
|
+
return props.aspectRatio;
|
|
2512
|
+
});
|
|
2478
2513
|
const container = $9HbP8$createComponent((0, $f18d425032111270$export$94026ee33dbabc26), {
|
|
2479
2514
|
get aspectRatio() {
|
|
2480
|
-
return
|
|
2515
|
+
return aspectRatioToUse();
|
|
2481
2516
|
},
|
|
2482
2517
|
get ["class"]() {
|
|
2483
2518
|
return props.class;
|
|
@@ -2486,6 +2521,10 @@ function $660070e2a394b3c3$export$e4b984597b71e989(props) {
|
|
|
2486
2521
|
const owner = $9HbP8$getOwner();
|
|
2487
2522
|
let createdSizeAccessor = false;
|
|
2488
2523
|
let wasCleanedUp = false;
|
|
2524
|
+
for (const event of ["add", "delete"]) {
|
|
2525
|
+
aspectRatiosSet?.addEventListener(event, () => setAspectRatios(aspectRatiosSet));
|
|
2526
|
+
$9HbP8$onCleanup(() => aspectRatiosSet?.removeEventListener(event, () => setAspectRatios(aspectRatiosSet)));
|
|
2527
|
+
}
|
|
2489
2528
|
$9HbP8$createEffect(() => {
|
|
2490
2529
|
if (currentImageSize() || wasCleanedUp) return; // We get into the effect when onCleanup is called if we don't have wasCleanedUp
|
|
2491
2530
|
// ensure we always have a size accessor
|
|
@@ -3500,7 +3539,8 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
3500
3539
|
get src() {
|
|
3501
3540
|
return props.src_;
|
|
3502
3541
|
},
|
|
3503
|
-
|
|
3542
|
+
autoAdjustAspectRatio: true,
|
|
3543
|
+
aspectRatio: 1
|
|
3504
3544
|
}),
|
|
3505
3545
|
...instant_results_options_
|
|
3506
3546
|
}), _el$4, _co$);
|
|
@@ -3676,7 +3716,7 @@ const $024fbc0a2d796fad$var$TabsContext = /*@__PURE__*/$9HbP8$createContext();
|
|
|
3676
3716
|
const $024fbc0a2d796fad$var$useTabs = () => $9HbP8$useContext($024fbc0a2d796fad$var$TabsContext);
|
|
3677
3717
|
function $024fbc0a2d796fad$export$b2539bed5023c21c(props) {
|
|
3678
3718
|
return $9HbP8$createComponent($024fbc0a2d796fad$var$TabsContext.Provider, {
|
|
3679
|
-
value: new (0, $9HbP8$
|
|
3719
|
+
value: new (0, $9HbP8$ListenableSet1)(),
|
|
3680
3720
|
get children() {
|
|
3681
3721
|
return $9HbP8$createComponent($024fbc0a2d796fad$var$ActualTabs, $9HbP8$mergeProps(props, {
|
|
3682
3722
|
get children() {
|
|
@@ -3841,7 +3881,15 @@ async function $194bd6b8e4c59830$export$79b1565500412d9b(search_modal, modal_fn_
|
|
|
3841
3881
|
const actually_close = () => {
|
|
3842
3882
|
dispose();
|
|
3843
3883
|
on_dispose?.();
|
|
3844
|
-
|
|
3884
|
+
const {
|
|
3885
|
+
activeElement: activeElement
|
|
3886
|
+
} = document;
|
|
3887
|
+
modal_els.forEach(el => {
|
|
3888
|
+
if (el.contains(activeElement))
|
|
3889
|
+
// Fix page jumping to the bottom when closing modal with scape after animation in safari
|
|
3890
|
+
activeElement?.blur?.();
|
|
3891
|
+
el.remove();
|
|
3892
|
+
});
|
|
3845
3893
|
};
|
|
3846
3894
|
if (animation_started && +new Date() - animation_started > 1000)
|
|
3847
3895
|
// Animation broke, close it this time
|
|
@@ -12483,7 +12531,7 @@ function $49de9d31aeea1b5e$export$6d0c9c22f6652669({
|
|
|
12483
12531
|
number_: num_results,
|
|
12484
12532
|
i18n_: i18n_
|
|
12485
12533
|
});
|
|
12486
|
-
const queries_without_content_results_ = new (0, $9HbP8$
|
|
12534
|
+
const queries_without_content_results_ = new (0, $9HbP8$ListenableSet)();
|
|
12487
12535
|
const [check_query, set_check_query] = $9HbP8$createSignal(false);
|
|
12488
12536
|
const placeholders_enabled = $9HbP8$createMemo(() => {
|
|
12489
12537
|
// don't show placeholders when the user toggles filters
|
package/locales/ES10/index.cjs
CHANGED
|
@@ -32,6 +32,7 @@ $parcel$export(module.exports, "it", () => $50cd633c714251ff$export$3486a10f30cf
|
|
|
32
32
|
$parcel$export(module.exports, "it_IT", () => $50cd633c714251ff$export$f9b5ea3bf81395b7);
|
|
33
33
|
$parcel$export(module.exports, "no", () => $50cd633c714251ff$export$401451a107dc42ce);
|
|
34
34
|
$parcel$export(module.exports, "nb_NO", () => $50cd633c714251ff$export$9493b74ae2e265b1);
|
|
35
|
+
$parcel$export(module.exports, "nb", () => $50cd633c714251ff$export$38ef0e3f791a121e);
|
|
35
36
|
$parcel$export(module.exports, "no_NO", () => $50cd633c714251ff$export$f096898031724516);
|
|
36
37
|
$parcel$export(module.exports, "pl", () => $50cd633c714251ff$export$6ea5311eda92944f);
|
|
37
38
|
$parcel$export(module.exports, "pl_PL", () => $50cd633c714251ff$export$cac2311efb6f04b1);
|
|
@@ -1126,6 +1127,11 @@ const $50cd633c714251ff$export$9493b74ae2e265b1 = {
|
|
|
1126
1127
|
...(0, $198e62eb02da5caf$export$dcb702a89633f297),
|
|
1127
1128
|
backend_locale_: "nb_NO"
|
|
1128
1129
|
};
|
|
1130
|
+
const $50cd633c714251ff$export$38ef0e3f791a121e = {
|
|
1131
|
+
...(0, $198e62eb02da5caf$export$e3024c30c728ef08),
|
|
1132
|
+
...(0, $198e62eb02da5caf$export$dcb702a89633f297),
|
|
1133
|
+
backend_locale_: "nb"
|
|
1134
|
+
};
|
|
1129
1135
|
const $50cd633c714251ff$export$f096898031724516 = {
|
|
1130
1136
|
...(0, $198e62eb02da5caf$export$e3024c30c728ef08),
|
|
1131
1137
|
...(0, $198e62eb02da5caf$export$dcb702a89633f297),
|
package/locales/ES10/index.d.ts
CHANGED
package/locales/ES10/index.js
CHANGED
|
@@ -1085,6 +1085,11 @@ const $72b32e7f8dfbdf34$export$9493b74ae2e265b1 = {
|
|
|
1085
1085
|
...(0, $38f06990a10567ed$export$dcb702a89633f297),
|
|
1086
1086
|
backend_locale_: "nb_NO"
|
|
1087
1087
|
};
|
|
1088
|
+
const $72b32e7f8dfbdf34$export$38ef0e3f791a121e = {
|
|
1089
|
+
...(0, $38f06990a10567ed$export$e3024c30c728ef08),
|
|
1090
|
+
...(0, $38f06990a10567ed$export$dcb702a89633f297),
|
|
1091
|
+
backend_locale_: "nb"
|
|
1092
|
+
};
|
|
1088
1093
|
const $72b32e7f8dfbdf34$export$f096898031724516 = {
|
|
1089
1094
|
...(0, $38f06990a10567ed$export$e3024c30c728ef08),
|
|
1090
1095
|
...(0, $38f06990a10567ed$export$dcb702a89633f297),
|
|
@@ -1126,4 +1131,4 @@ const $72b32e7f8dfbdf34$export$c395d7caf3689a53 = {
|
|
|
1126
1131
|
backend_locale_: "sv_SE"
|
|
1127
1132
|
};
|
|
1128
1133
|
const $72b32e7f8dfbdf34$export$d7f512c98c859244 = $72b32e7f8dfbdf34$export$84584c2a98eb6753;
|
|
1129
|
-
export { $72b32e7f8dfbdf34$export$67ff43e65e668f2b as cz, $72b32e7f8dfbdf34$export$8c8450b83b664ba4 as da, $72b32e7f8dfbdf34$export$6de2d8c8de3011d9 as da_DK, $72b32e7f8dfbdf34$export$9c64ee4d84d79ce1 as nl, $72b32e7f8dfbdf34$export$56f6972fd618655a as nl_BE, $72b32e7f8dfbdf34$export$ecbd6264f248e614 as nl_NL, $72b32e7f8dfbdf34$export$84584c2a98eb6753 as en, $72b32e7f8dfbdf34$export$c8af9ccf06a8b16a as en_AU, $72b32e7f8dfbdf34$export$a2bced10ed717c1f as en_CA, $72b32e7f8dfbdf34$export$6ac7ea553f9cecc6 as en_EU, $72b32e7f8dfbdf34$export$b76508d27899e649 as en_GB, $72b32e7f8dfbdf34$export$df031397bb44d506 as en_IE, $72b32e7f8dfbdf34$export$25dc44e90bc68e13 as en_US, $72b32e7f8dfbdf34$export$ed5179c818622fb as fi, $72b32e7f8dfbdf34$export$beb170d4da98ae91 as fi_FI, $72b32e7f8dfbdf34$export$acb2a88f7d552ebf as fr, $72b32e7f8dfbdf34$export$30f960919adb1a48 as fr_FR, $72b32e7f8dfbdf34$export$2fa162a495d26869 as de, $72b32e7f8dfbdf34$export$cdfc1e873a859e64 as de_AT, $72b32e7f8dfbdf34$export$24592eff4b41c0d as de_CH, $72b32e7f8dfbdf34$export$5d6cddfc629f77eb as de_DE, $72b32e7f8dfbdf34$export$3486a10f30cf1ee4 as it, $72b32e7f8dfbdf34$export$f9b5ea3bf81395b7 as it_IT, $72b32e7f8dfbdf34$export$401451a107dc42ce as no, $72b32e7f8dfbdf34$export$9493b74ae2e265b1 as nb_NO, $72b32e7f8dfbdf34$export$f096898031724516 as no_NO, $72b32e7f8dfbdf34$export$6ea5311eda92944f as pl, $72b32e7f8dfbdf34$export$cac2311efb6f04b1 as pl_PL, $72b32e7f8dfbdf34$export$84175d5f1cb4e39d as pt, $72b32e7f8dfbdf34$export$ca5e4045a55e76d2 as es, $72b32e7f8dfbdf34$export$97f82aee9c1ce125 as es_ES, $72b32e7f8dfbdf34$export$65540e5f7f6e7dce as sv, $72b32e7f8dfbdf34$export$c395d7caf3689a53 as sv_SE, $72b32e7f8dfbdf34$export$d7f512c98c859244 as defaultLocale };
|
|
1134
|
+
export { $72b32e7f8dfbdf34$export$67ff43e65e668f2b as cz, $72b32e7f8dfbdf34$export$8c8450b83b664ba4 as da, $72b32e7f8dfbdf34$export$6de2d8c8de3011d9 as da_DK, $72b32e7f8dfbdf34$export$9c64ee4d84d79ce1 as nl, $72b32e7f8dfbdf34$export$56f6972fd618655a as nl_BE, $72b32e7f8dfbdf34$export$ecbd6264f248e614 as nl_NL, $72b32e7f8dfbdf34$export$84584c2a98eb6753 as en, $72b32e7f8dfbdf34$export$c8af9ccf06a8b16a as en_AU, $72b32e7f8dfbdf34$export$a2bced10ed717c1f as en_CA, $72b32e7f8dfbdf34$export$6ac7ea553f9cecc6 as en_EU, $72b32e7f8dfbdf34$export$b76508d27899e649 as en_GB, $72b32e7f8dfbdf34$export$df031397bb44d506 as en_IE, $72b32e7f8dfbdf34$export$25dc44e90bc68e13 as en_US, $72b32e7f8dfbdf34$export$ed5179c818622fb as fi, $72b32e7f8dfbdf34$export$beb170d4da98ae91 as fi_FI, $72b32e7f8dfbdf34$export$acb2a88f7d552ebf as fr, $72b32e7f8dfbdf34$export$30f960919adb1a48 as fr_FR, $72b32e7f8dfbdf34$export$2fa162a495d26869 as de, $72b32e7f8dfbdf34$export$cdfc1e873a859e64 as de_AT, $72b32e7f8dfbdf34$export$24592eff4b41c0d as de_CH, $72b32e7f8dfbdf34$export$5d6cddfc629f77eb as de_DE, $72b32e7f8dfbdf34$export$3486a10f30cf1ee4 as it, $72b32e7f8dfbdf34$export$f9b5ea3bf81395b7 as it_IT, $72b32e7f8dfbdf34$export$401451a107dc42ce as no, $72b32e7f8dfbdf34$export$9493b74ae2e265b1 as nb_NO, $72b32e7f8dfbdf34$export$38ef0e3f791a121e as nb, $72b32e7f8dfbdf34$export$f096898031724516 as no_NO, $72b32e7f8dfbdf34$export$6ea5311eda92944f as pl, $72b32e7f8dfbdf34$export$cac2311efb6f04b1 as pl_PL, $72b32e7f8dfbdf34$export$84175d5f1cb4e39d as pt, $72b32e7f8dfbdf34$export$ca5e4045a55e76d2 as es, $72b32e7f8dfbdf34$export$97f82aee9c1ce125 as es_ES, $72b32e7f8dfbdf34$export$65540e5f7f6e7dce as sv, $72b32e7f8dfbdf34$export$c395d7caf3689a53 as sv_SE, $72b32e7f8dfbdf34$export$d7f512c98c859244 as defaultLocale };
|
package/locales/latest/index.cjs
CHANGED
|
@@ -32,6 +32,7 @@ $parcel$export(module.exports, "it", () => $2d187e768d780a64$export$3486a10f30cf
|
|
|
32
32
|
$parcel$export(module.exports, "it_IT", () => $2d187e768d780a64$export$f9b5ea3bf81395b7);
|
|
33
33
|
$parcel$export(module.exports, "no", () => $2d187e768d780a64$export$401451a107dc42ce);
|
|
34
34
|
$parcel$export(module.exports, "nb_NO", () => $2d187e768d780a64$export$9493b74ae2e265b1);
|
|
35
|
+
$parcel$export(module.exports, "nb", () => $2d187e768d780a64$export$38ef0e3f791a121e);
|
|
35
36
|
$parcel$export(module.exports, "no_NO", () => $2d187e768d780a64$export$f096898031724516);
|
|
36
37
|
$parcel$export(module.exports, "pl", () => $2d187e768d780a64$export$6ea5311eda92944f);
|
|
37
38
|
$parcel$export(module.exports, "pl_PL", () => $2d187e768d780a64$export$cac2311efb6f04b1);
|
|
@@ -1126,6 +1127,11 @@ const $2d187e768d780a64$export$9493b74ae2e265b1 = {
|
|
|
1126
1127
|
...(0, $0a060b0fa5b7442d$export$dcb702a89633f297),
|
|
1127
1128
|
backend_locale_: "nb_NO"
|
|
1128
1129
|
};
|
|
1130
|
+
const $2d187e768d780a64$export$38ef0e3f791a121e = {
|
|
1131
|
+
...(0, $0a060b0fa5b7442d$export$e3024c30c728ef08),
|
|
1132
|
+
...(0, $0a060b0fa5b7442d$export$dcb702a89633f297),
|
|
1133
|
+
backend_locale_: "nb"
|
|
1134
|
+
};
|
|
1129
1135
|
const $2d187e768d780a64$export$f096898031724516 = {
|
|
1130
1136
|
...(0, $0a060b0fa5b7442d$export$e3024c30c728ef08),
|
|
1131
1137
|
...(0, $0a060b0fa5b7442d$export$dcb702a89633f297),
|
package/locales/latest/index.js
CHANGED
|
@@ -1085,6 +1085,11 @@ const $70cb39a790dd4f65$export$9493b74ae2e265b1 = {
|
|
|
1085
1085
|
...(0, $2c5d03375c4a5b27$export$dcb702a89633f297),
|
|
1086
1086
|
backend_locale_: "nb_NO"
|
|
1087
1087
|
};
|
|
1088
|
+
const $70cb39a790dd4f65$export$38ef0e3f791a121e = {
|
|
1089
|
+
...(0, $2c5d03375c4a5b27$export$e3024c30c728ef08),
|
|
1090
|
+
...(0, $2c5d03375c4a5b27$export$dcb702a89633f297),
|
|
1091
|
+
backend_locale_: "nb"
|
|
1092
|
+
};
|
|
1088
1093
|
const $70cb39a790dd4f65$export$f096898031724516 = {
|
|
1089
1094
|
...(0, $2c5d03375c4a5b27$export$e3024c30c728ef08),
|
|
1090
1095
|
...(0, $2c5d03375c4a5b27$export$dcb702a89633f297),
|
|
@@ -1126,4 +1131,4 @@ const $70cb39a790dd4f65$export$c395d7caf3689a53 = {
|
|
|
1126
1131
|
backend_locale_: "sv_SE"
|
|
1127
1132
|
};
|
|
1128
1133
|
const $70cb39a790dd4f65$export$d7f512c98c859244 = $70cb39a790dd4f65$export$84584c2a98eb6753;
|
|
1129
|
-
export { $70cb39a790dd4f65$export$67ff43e65e668f2b as cz, $70cb39a790dd4f65$export$8c8450b83b664ba4 as da, $70cb39a790dd4f65$export$6de2d8c8de3011d9 as da_DK, $70cb39a790dd4f65$export$9c64ee4d84d79ce1 as nl, $70cb39a790dd4f65$export$56f6972fd618655a as nl_BE, $70cb39a790dd4f65$export$ecbd6264f248e614 as nl_NL, $70cb39a790dd4f65$export$84584c2a98eb6753 as en, $70cb39a790dd4f65$export$c8af9ccf06a8b16a as en_AU, $70cb39a790dd4f65$export$a2bced10ed717c1f as en_CA, $70cb39a790dd4f65$export$6ac7ea553f9cecc6 as en_EU, $70cb39a790dd4f65$export$b76508d27899e649 as en_GB, $70cb39a790dd4f65$export$df031397bb44d506 as en_IE, $70cb39a790dd4f65$export$25dc44e90bc68e13 as en_US, $70cb39a790dd4f65$export$ed5179c818622fb as fi, $70cb39a790dd4f65$export$beb170d4da98ae91 as fi_FI, $70cb39a790dd4f65$export$acb2a88f7d552ebf as fr, $70cb39a790dd4f65$export$30f960919adb1a48 as fr_FR, $70cb39a790dd4f65$export$2fa162a495d26869 as de, $70cb39a790dd4f65$export$cdfc1e873a859e64 as de_AT, $70cb39a790dd4f65$export$24592eff4b41c0d as de_CH, $70cb39a790dd4f65$export$5d6cddfc629f77eb as de_DE, $70cb39a790dd4f65$export$3486a10f30cf1ee4 as it, $70cb39a790dd4f65$export$f9b5ea3bf81395b7 as it_IT, $70cb39a790dd4f65$export$401451a107dc42ce as no, $70cb39a790dd4f65$export$9493b74ae2e265b1 as nb_NO, $70cb39a790dd4f65$export$f096898031724516 as no_NO, $70cb39a790dd4f65$export$6ea5311eda92944f as pl, $70cb39a790dd4f65$export$cac2311efb6f04b1 as pl_PL, $70cb39a790dd4f65$export$84175d5f1cb4e39d as pt, $70cb39a790dd4f65$export$ca5e4045a55e76d2 as es, $70cb39a790dd4f65$export$97f82aee9c1ce125 as es_ES, $70cb39a790dd4f65$export$65540e5f7f6e7dce as sv, $70cb39a790dd4f65$export$c395d7caf3689a53 as sv_SE, $70cb39a790dd4f65$export$d7f512c98c859244 as defaultLocale };
|
|
1134
|
+
export { $70cb39a790dd4f65$export$67ff43e65e668f2b as cz, $70cb39a790dd4f65$export$8c8450b83b664ba4 as da, $70cb39a790dd4f65$export$6de2d8c8de3011d9 as da_DK, $70cb39a790dd4f65$export$9c64ee4d84d79ce1 as nl, $70cb39a790dd4f65$export$56f6972fd618655a as nl_BE, $70cb39a790dd4f65$export$ecbd6264f248e614 as nl_NL, $70cb39a790dd4f65$export$84584c2a98eb6753 as en, $70cb39a790dd4f65$export$c8af9ccf06a8b16a as en_AU, $70cb39a790dd4f65$export$a2bced10ed717c1f as en_CA, $70cb39a790dd4f65$export$6ac7ea553f9cecc6 as en_EU, $70cb39a790dd4f65$export$b76508d27899e649 as en_GB, $70cb39a790dd4f65$export$df031397bb44d506 as en_IE, $70cb39a790dd4f65$export$25dc44e90bc68e13 as en_US, $70cb39a790dd4f65$export$ed5179c818622fb as fi, $70cb39a790dd4f65$export$beb170d4da98ae91 as fi_FI, $70cb39a790dd4f65$export$acb2a88f7d552ebf as fr, $70cb39a790dd4f65$export$30f960919adb1a48 as fr_FR, $70cb39a790dd4f65$export$2fa162a495d26869 as de, $70cb39a790dd4f65$export$cdfc1e873a859e64 as de_AT, $70cb39a790dd4f65$export$24592eff4b41c0d as de_CH, $70cb39a790dd4f65$export$5d6cddfc629f77eb as de_DE, $70cb39a790dd4f65$export$3486a10f30cf1ee4 as it, $70cb39a790dd4f65$export$f9b5ea3bf81395b7 as it_IT, $70cb39a790dd4f65$export$401451a107dc42ce as no, $70cb39a790dd4f65$export$9493b74ae2e265b1 as nb_NO, $70cb39a790dd4f65$export$38ef0e3f791a121e as nb, $70cb39a790dd4f65$export$f096898031724516 as no_NO, $70cb39a790dd4f65$export$6ea5311eda92944f as pl, $70cb39a790dd4f65$export$cac2311efb6f04b1 as pl_PL, $70cb39a790dd4f65$export$84175d5f1cb4e39d as pt, $70cb39a790dd4f65$export$ca5e4045a55e76d2 as es, $70cb39a790dd4f65$export$97f82aee9c1ce125 as es_ES, $70cb39a790dd4f65$export$65540e5f7f6e7dce as sv, $70cb39a790dd4f65$export$c395d7caf3689a53 as sv_SE, $70cb39a790dd4f65$export$d7f512c98c859244 as defaultLocale };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/ui",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.3",
|
|
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": "^3.0.
|
|
239
|
+
"@depict-ai/plp-styling": "^3.0.4",
|
|
240
240
|
"@depict-ai/types": "^5.0.3",
|
|
241
|
-
"@depict-ai/utilishared": "^2.0.
|
|
241
|
+
"@depict-ai/utilishared": "^2.0.11",
|
|
242
242
|
"solid-js": "^1.8.7"
|
|
243
243
|
},
|
|
244
244
|
"type": "module",
|
package/server/ES10/index.cjs
CHANGED
|
@@ -92,7 +92,7 @@ $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447a
|
|
|
92
92
|
$parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
|
|
93
93
|
$parcel$export(module.exports, "SearchField", () => $98aef9965764903d$export$316f6f283ae64765);
|
|
94
94
|
/*! Depict.ai search and product listing SDK */
|
|
95
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.0.
|
|
95
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.0.3";
|
|
96
96
|
function $a28000bc10de28ad$export$e417c49320921907(dependency, fetcher) {
|
|
97
97
|
const [promiseOfCurrentFetcherRun, setPromiseOfCurrentFetcherRun] = $3hooq$solidjs.createSignal();
|
|
98
98
|
const deparallelizedFetcher = $3hooq$depictaiutilishared.deparallelize_no_drop(async dependencyValue => {
|
|
@@ -1960,6 +1960,7 @@ function $858fdcf73148519f$export$e6fffe67d4cdd848(whatToWatch) {
|
|
|
1960
1960
|
return size;
|
|
1961
1961
|
}
|
|
1962
1962
|
const $858fdcf73148519f$var$onIdleFunctionsSymbol = /*@__PURE__*/Symbol("onIdleFunctions");
|
|
1963
|
+
const $858fdcf73148519f$export$f8945274f08a3105 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
1963
1964
|
function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
1964
1965
|
// Enable reactive props
|
|
1965
1966
|
const otherOptions = $3hooq$solidjs.createMemo(() => {
|
|
@@ -2024,6 +2025,21 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
|
2024
2025
|
let timeoutSet = false;
|
|
2025
2026
|
let gotCleanedUp = false;
|
|
2026
2027
|
img.classList.add("s-responsive-image");
|
|
2028
|
+
if (listingContext) {
|
|
2029
|
+
let prevValue;
|
|
2030
|
+
const aspectRatios = listingContext[$858fdcf73148519f$export$f8945274f08a3105] || (listingContext[$858fdcf73148519f$export$f8945274f08a3105] = new (0, $3hooq$depictaiutilishared.ListenableSet)());
|
|
2031
|
+
img.addEventListener("load", $3hooq$depictaiutilishared.catchify(() => {
|
|
2032
|
+
// Save our aspect ratio whenever it changes, so that we can base the containers on the most dominant aspect ratio, used in SearchModalV2
|
|
2033
|
+
const aspectRatio_ = img.naturalWidth / img.naturalHeight;
|
|
2034
|
+
if (prevValue) aspectRatios.delete(prevValue);
|
|
2035
|
+
const newValue = !isNaN(aspectRatio_) ? {
|
|
2036
|
+
aspectRatio_: aspectRatio_
|
|
2037
|
+
} : undefined;
|
|
2038
|
+
if (newValue) aspectRatios.add(newValue);
|
|
2039
|
+
prevValue = newValue;
|
|
2040
|
+
}));
|
|
2041
|
+
$3hooq$solidjs.onCleanup(() => prevValue && aspectRatios.delete(prevValue));
|
|
2042
|
+
}
|
|
2027
2043
|
$3hooq$solidjs.onCleanup(() => gotCleanedUp = true);
|
|
2028
2044
|
$3hooq$solidjsweb.spread(img, $3hooq$solidjs.mergeProps(otherOptions), false, true);
|
|
2029
2045
|
$3hooq$solidjs.createEffect(() => {
|
|
@@ -2091,9 +2107,29 @@ function $28535bb7671c63d1$export$e4b984597b71e989(props) {
|
|
|
2091
2107
|
// create a signal that's the same for all items in this listing
|
|
2092
2108
|
context[$28535bb7671c63d1$export$d7b7ab832c20e2f4] = $3hooq$solidjs.createSignal();
|
|
2093
2109
|
const [currentImageSize, setCurrentImageSize] = (context === null || context === void 0 ? void 0 : context[$28535bb7671c63d1$export$d7b7ab832c20e2f4]) || $28535bb7671c63d1$var$backupSizeSignal; // use global fallback signal (might lead to blurry images) if no context is available
|
|
2110
|
+
const aspectRatiosSet = context ? context[(0, $858fdcf73148519f$export$f8945274f08a3105)] || (context[(0, $858fdcf73148519f$export$f8945274f08a3105)] = new (0, $3hooq$depictaiutilishared.ListenableSet)()) : undefined;
|
|
2111
|
+
const [aspectRatios, setAspectRatios] = $3hooq$solidjs.createSignal(aspectRatiosSet, {
|
|
2112
|
+
equals: false
|
|
2113
|
+
});
|
|
2114
|
+
const aspectRatioToUse = $3hooq$solidjs.createMemo(() => {
|
|
2115
|
+
const aspectRatiosSet = aspectRatios(); // This signal "changes" to the same set every time the set changes, so we can use it as a dependency here
|
|
2116
|
+
useMostPrevalentAspectRatio: {
|
|
2117
|
+
if (!aspectRatiosSet || !props.autoAdjustAspectRatio) break useMostPrevalentAspectRatio;
|
|
2118
|
+
// Get the aspect ratio that most of the loaded images inside the ListingProvider we are, load
|
|
2119
|
+
const asArray = [...aspectRatiosSet].map(_ref => {
|
|
2120
|
+
let {
|
|
2121
|
+
aspectRatio_: aspectRatio_
|
|
2122
|
+
} = _ref;
|
|
2123
|
+
return aspectRatio_;
|
|
2124
|
+
});
|
|
2125
|
+
const mostPrevalentAspectRatio = $3hooq$depictaiutilishared.findMostFrequentItem(asArray);
|
|
2126
|
+
if (mostPrevalentAspectRatio) return "var(".concat((0, $c0cf6af094336798$export$8a2234b5b1a5ebd4), ", ").concat(mostPrevalentAspectRatio, ")");
|
|
2127
|
+
}
|
|
2128
|
+
return props.aspectRatio;
|
|
2129
|
+
});
|
|
2094
2130
|
const container = $3hooq$solidjsweb.createComponent((0, $ce467edb5343cfcd$export$94026ee33dbabc26), {
|
|
2095
2131
|
get aspectRatio() {
|
|
2096
|
-
return
|
|
2132
|
+
return aspectRatioToUse();
|
|
2097
2133
|
},
|
|
2098
2134
|
get ["class"]() {
|
|
2099
2135
|
return props.class;
|
|
@@ -2102,6 +2138,10 @@ function $28535bb7671c63d1$export$e4b984597b71e989(props) {
|
|
|
2102
2138
|
const owner = $3hooq$solidjs.getOwner();
|
|
2103
2139
|
let createdSizeAccessor = false;
|
|
2104
2140
|
let wasCleanedUp = false;
|
|
2141
|
+
for (const event of ["add", "delete"]) {
|
|
2142
|
+
aspectRatiosSet === null || aspectRatiosSet === void 0 || aspectRatiosSet.addEventListener(event, () => setAspectRatios(aspectRatiosSet));
|
|
2143
|
+
$3hooq$solidjs.onCleanup(() => aspectRatiosSet === null || aspectRatiosSet === void 0 ? void 0 : aspectRatiosSet.removeEventListener(event, () => setAspectRatios(aspectRatiosSet)));
|
|
2144
|
+
}
|
|
2105
2145
|
$3hooq$solidjs.createEffect(() => {
|
|
2106
2146
|
if (currentImageSize() || wasCleanedUp) return; // We get into the effect when onCleanup is called if we don't have wasCleanedUp
|
|
2107
2147
|
// ensure we always have a size accessor
|
|
@@ -2977,7 +3017,8 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
|
|
|
2977
3017
|
get src() {
|
|
2978
3018
|
return props.src_;
|
|
2979
3019
|
},
|
|
2980
|
-
|
|
3020
|
+
autoAdjustAspectRatio: true,
|
|
3021
|
+
aspectRatio: 1
|
|
2981
3022
|
}),
|
|
2982
3023
|
...instant_results_options_
|
|
2983
3024
|
})));
|
|
@@ -3198,7 +3239,17 @@ async function $4cf7d9829d60d844$export$79b1565500412d9b(search_modal, modal_fn_
|
|
|
3198
3239
|
const actually_close = () => {
|
|
3199
3240
|
dispose();
|
|
3200
3241
|
on_dispose === null || on_dispose === void 0 || on_dispose();
|
|
3201
|
-
|
|
3242
|
+
const {
|
|
3243
|
+
activeElement: activeElement
|
|
3244
|
+
} = document;
|
|
3245
|
+
modal_els.forEach(el => {
|
|
3246
|
+
if (el.contains(activeElement)) {
|
|
3247
|
+
var _blur, _ref;
|
|
3248
|
+
// Fix page jumping to the bottom when closing modal with scape after animation in safari
|
|
3249
|
+
activeElement === null || activeElement === void 0 || (_blur = (_ref = activeElement).blur) === null || _blur === void 0 || _blur.call(_ref);
|
|
3250
|
+
}
|
|
3251
|
+
el.remove();
|
|
3252
|
+
});
|
|
3202
3253
|
};
|
|
3203
3254
|
if (animation_started && +new Date() - animation_started > 1000)
|
|
3204
3255
|
// Animation broke, close it this time
|
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.3";
|
|
14
14
|
export type ModalAlignmentSignals = {
|
|
15
15
|
body_: Signal<JSX.CSSProperties>;
|
|
16
16
|
field_: Signal<JSX.CSSProperties>;
|
|
@@ -407,6 +407,28 @@ export function ShopifyResponsiveImg(props: {
|
|
|
407
407
|
} & Omit<JSX.ImgHTMLAttributes<HTMLImageElement>, "srcset" | "src" | "sizes"> & {
|
|
408
408
|
src: string;
|
|
409
409
|
}): JSX.Element;
|
|
410
|
+
type ImagePlaceholderBaseOptions = {
|
|
411
|
+
style?: JSX.CSSProperties;
|
|
412
|
+
class?: string;
|
|
413
|
+
};
|
|
414
|
+
type ImagePlaceholderBlockOptions = {
|
|
415
|
+
width: string;
|
|
416
|
+
height: string;
|
|
417
|
+
};
|
|
418
|
+
type ImagePlaceholderImageOptions = {
|
|
419
|
+
aspectRatio: number | string;
|
|
420
|
+
};
|
|
421
|
+
/**
|
|
422
|
+
* A placeholder that can be used instead of an image or other block of content while it's loading.
|
|
423
|
+
* The placeholder has `display:block`, meaning it will create a new "row" in the layout for itself. Can be used either for images with a defined aspect ratio (ContainedImage) or blocks.
|
|
424
|
+
* @property aspectRatio if aspectRatio is defined the placeholder will be in "image mode" and fill out the available width and then adjust the height according to the aspectRatio
|
|
425
|
+
* @property width If width and height is set, the defined width and height will be used.
|
|
426
|
+
* @property height If width and height is set, the defined width and height will be used.
|
|
427
|
+
* @property class extra classes to add to the placeholder
|
|
428
|
+
* @property style extra styles to add to the placeholder
|
|
429
|
+
*/
|
|
430
|
+
export function ImagePlaceholder(props: ImagePlaceholderBaseOptions & (ImagePlaceholderBlockOptions | ImagePlaceholderImageOptions)): JSX.Element;
|
|
431
|
+
export function DefaultInstantCardPlaceholder(): HTMLDivElement;
|
|
410
432
|
export const shopifyContainedImageContextSymbol: unique symbol;
|
|
411
433
|
/**
|
|
412
434
|
* Abstraction built on top of ShopifyResponsiveImg. This is your one-stop-shop If you just need a responsive image.
|
|
@@ -417,11 +439,13 @@ export const shopifyContainedImageContextSymbol: unique symbol;
|
|
|
417
439
|
* @property aspectRatio aspect ratio of the image
|
|
418
440
|
* @property class extra class to add to the container
|
|
419
441
|
* @property alt alt text for the image
|
|
442
|
+
* @property autoAdjustAspectRatio whether to automatically adjust the aspect ratio of the image to the majority of the aspect ratios of loaded images in the current listing provider. Defaults to false. Can be overriden with css variable --image-aspect-ratio
|
|
420
443
|
* @property imgProps props to pass to ShopifyResponsiveImg to add to the <img> element
|
|
421
444
|
*/
|
|
422
445
|
export function ShopifyContainedImage(props: {
|
|
423
446
|
src: string;
|
|
424
447
|
aspectRatio: number | string;
|
|
448
|
+
autoAdjustAspectRatio?: boolean;
|
|
425
449
|
class?: string;
|
|
426
450
|
imgProps?: Omit<Parameters<typeof ShopifyResponsiveImg>[0], "size" | "src">;
|
|
427
451
|
}): HTMLDivElement;
|
|
@@ -489,28 +513,6 @@ interface Styles {
|
|
|
489
513
|
[selector: string]: JSX.CSSProperties;
|
|
490
514
|
}
|
|
491
515
|
export const styles_to_valid_css_string: (styles: Styles) => string;
|
|
492
|
-
type ImagePlaceholderBaseOptions = {
|
|
493
|
-
style?: JSX.CSSProperties;
|
|
494
|
-
class?: string;
|
|
495
|
-
};
|
|
496
|
-
type ImagePlaceholderBlockOptions = {
|
|
497
|
-
width: string;
|
|
498
|
-
height: string;
|
|
499
|
-
};
|
|
500
|
-
type ImagePlaceholderImageOptions = {
|
|
501
|
-
aspectRatio: number | string;
|
|
502
|
-
};
|
|
503
|
-
/**
|
|
504
|
-
* A placeholder that can be used instead of an image or other block of content while it's loading.
|
|
505
|
-
* The placeholder has `display:block`, meaning it will create a new "row" in the layout for itself. Can be used either for images with a defined aspect ratio (ContainedImage) or blocks.
|
|
506
|
-
* @property aspectRatio if aspectRatio is defined the placeholder will be in "image mode" and fill out the available width and then adjust the height according to the aspectRatio
|
|
507
|
-
* @property width If width and height is set, the defined width and height will be used.
|
|
508
|
-
* @property height If width and height is set, the defined width and height will be used.
|
|
509
|
-
* @property class extra classes to add to the placeholder
|
|
510
|
-
* @property style extra styles to add to the placeholder
|
|
511
|
-
*/
|
|
512
|
-
export function ImagePlaceholder(props: ImagePlaceholderBaseOptions & (ImagePlaceholderBlockOptions | ImagePlaceholderImageOptions)): JSX.Element;
|
|
513
|
-
export function DefaultInstantCardPlaceholder(): HTMLDivElement;
|
|
514
516
|
/**
|
|
515
517
|
* Second generation search modal - the solid component that gets added to <body> when the search modal is opened
|
|
516
518
|
*/
|
package/server/ES10/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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, 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,
|
|
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, ListenableSet as $b8hua$ListenableSet, findMostFrequentItem as $b8hua$findMostFrequentItem, queueMacroTask as $b8hua$queueMacroTask, 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, insert_surfaces as $b8hua$insert_surfaces } from "@depict-ai/utilishared/ES10";
|
|
2
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, on as $b8hua$on, Index as $b8hua$Index, batch as $b8hua$batch, ErrorBoundary as $b8hua$ErrorBoundary, createContext as $b8hua$createContext, useContext as $b8hua$useContext, mergeProps as $b8hua$mergeProps1, createUniqueId as $b8hua$createUniqueId, createRenderEffect as $b8hua$createRenderEffect, createSelector as $b8hua$createSelector, children as $b8hua$children, splitProps as $b8hua$splitProps, 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
|
-
import { ListenableSet as $b8hua$
|
|
4
|
+
import { ListenableSet as $b8hua$ListenableSet1, 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";
|
|
6
6
|
import $b8hua$babelruntimehelpersclassPrivateFieldSet from "@babel/runtime/helpers/classPrivateFieldSet";
|
|
7
7
|
import $b8hua$babelruntimehelpersclassPrivateFieldGet from "@babel/runtime/helpers/classPrivateFieldGet";
|
|
@@ -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.3";
|
|
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 => {
|
|
@@ -1878,6 +1878,7 @@ function $56047603f9d212b6$export$e6fffe67d4cdd848(whatToWatch) {
|
|
|
1878
1878
|
return size;
|
|
1879
1879
|
}
|
|
1880
1880
|
const $56047603f9d212b6$var$onIdleFunctionsSymbol = /*@__PURE__*/Symbol("onIdleFunctions");
|
|
1881
|
+
const $56047603f9d212b6$export$f8945274f08a3105 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
1881
1882
|
function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
1882
1883
|
// Enable reactive props
|
|
1883
1884
|
const otherOptions = $b8hua$createMemo(() => {
|
|
@@ -1942,6 +1943,21 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
|
1942
1943
|
let timeoutSet = false;
|
|
1943
1944
|
let gotCleanedUp = false;
|
|
1944
1945
|
img.classList.add("s-responsive-image");
|
|
1946
|
+
if (listingContext) {
|
|
1947
|
+
let prevValue;
|
|
1948
|
+
const aspectRatios = listingContext[$56047603f9d212b6$export$f8945274f08a3105] || (listingContext[$56047603f9d212b6$export$f8945274f08a3105] = new (0, $b8hua$ListenableSet)());
|
|
1949
|
+
img.addEventListener("load", $b8hua$catchify(() => {
|
|
1950
|
+
// Save our aspect ratio whenever it changes, so that we can base the containers on the most dominant aspect ratio, used in SearchModalV2
|
|
1951
|
+
const aspectRatio_ = img.naturalWidth / img.naturalHeight;
|
|
1952
|
+
if (prevValue) aspectRatios.delete(prevValue);
|
|
1953
|
+
const newValue = !isNaN(aspectRatio_) ? {
|
|
1954
|
+
aspectRatio_: aspectRatio_
|
|
1955
|
+
} : undefined;
|
|
1956
|
+
if (newValue) aspectRatios.add(newValue);
|
|
1957
|
+
prevValue = newValue;
|
|
1958
|
+
}));
|
|
1959
|
+
$b8hua$onCleanup(() => prevValue && aspectRatios.delete(prevValue));
|
|
1960
|
+
}
|
|
1945
1961
|
$b8hua$onCleanup(() => gotCleanedUp = true);
|
|
1946
1962
|
$b8hua$spread(img, $b8hua$mergeProps1(otherOptions), false, true);
|
|
1947
1963
|
$b8hua$createEffect(() => {
|
|
@@ -2009,9 +2025,29 @@ function $4df489344a0f97c7$export$e4b984597b71e989(props) {
|
|
|
2009
2025
|
// create a signal that's the same for all items in this listing
|
|
2010
2026
|
context[$4df489344a0f97c7$export$d7b7ab832c20e2f4] = $b8hua$createSignal();
|
|
2011
2027
|
const [currentImageSize, setCurrentImageSize] = (context === null || context === void 0 ? void 0 : context[$4df489344a0f97c7$export$d7b7ab832c20e2f4]) || $4df489344a0f97c7$var$backupSizeSignal; // use global fallback signal (might lead to blurry images) if no context is available
|
|
2028
|
+
const aspectRatiosSet = context ? context[(0, $56047603f9d212b6$export$f8945274f08a3105)] || (context[(0, $56047603f9d212b6$export$f8945274f08a3105)] = new (0, $b8hua$ListenableSet)()) : undefined;
|
|
2029
|
+
const [aspectRatios, setAspectRatios] = $b8hua$createSignal(aspectRatiosSet, {
|
|
2030
|
+
equals: false
|
|
2031
|
+
});
|
|
2032
|
+
const aspectRatioToUse = $b8hua$createMemo(() => {
|
|
2033
|
+
const aspectRatiosSet = aspectRatios(); // This signal "changes" to the same set every time the set changes, so we can use it as a dependency here
|
|
2034
|
+
useMostPrevalentAspectRatio: {
|
|
2035
|
+
if (!aspectRatiosSet || !props.autoAdjustAspectRatio) break useMostPrevalentAspectRatio;
|
|
2036
|
+
// Get the aspect ratio that most of the loaded images inside the ListingProvider we are, load
|
|
2037
|
+
const asArray = [...aspectRatiosSet].map(_ref => {
|
|
2038
|
+
let {
|
|
2039
|
+
aspectRatio_: aspectRatio_
|
|
2040
|
+
} = _ref;
|
|
2041
|
+
return aspectRatio_;
|
|
2042
|
+
});
|
|
2043
|
+
const mostPrevalentAspectRatio = $b8hua$findMostFrequentItem(asArray);
|
|
2044
|
+
if (mostPrevalentAspectRatio) return "var(".concat((0, $5eaa00b951637e96$export$8a2234b5b1a5ebd4), ", ").concat(mostPrevalentAspectRatio, ")");
|
|
2045
|
+
}
|
|
2046
|
+
return props.aspectRatio;
|
|
2047
|
+
});
|
|
2012
2048
|
const container = $b8hua$createComponent((0, $801e8845d3fa3653$export$94026ee33dbabc26), {
|
|
2013
2049
|
get aspectRatio() {
|
|
2014
|
-
return
|
|
2050
|
+
return aspectRatioToUse();
|
|
2015
2051
|
},
|
|
2016
2052
|
get ["class"]() {
|
|
2017
2053
|
return props.class;
|
|
@@ -2020,6 +2056,10 @@ function $4df489344a0f97c7$export$e4b984597b71e989(props) {
|
|
|
2020
2056
|
const owner = $b8hua$getOwner();
|
|
2021
2057
|
let createdSizeAccessor = false;
|
|
2022
2058
|
let wasCleanedUp = false;
|
|
2059
|
+
for (const event of ["add", "delete"]) {
|
|
2060
|
+
aspectRatiosSet === null || aspectRatiosSet === void 0 || aspectRatiosSet.addEventListener(event, () => setAspectRatios(aspectRatiosSet));
|
|
2061
|
+
$b8hua$onCleanup(() => aspectRatiosSet === null || aspectRatiosSet === void 0 ? void 0 : aspectRatiosSet.removeEventListener(event, () => setAspectRatios(aspectRatiosSet)));
|
|
2062
|
+
}
|
|
2023
2063
|
$b8hua$createEffect(() => {
|
|
2024
2064
|
if (currentImageSize() || wasCleanedUp) return; // We get into the effect when onCleanup is called if we don't have wasCleanedUp
|
|
2025
2065
|
// ensure we always have a size accessor
|
|
@@ -2895,7 +2935,8 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
|
|
|
2895
2935
|
get src() {
|
|
2896
2936
|
return props.src_;
|
|
2897
2937
|
},
|
|
2898
|
-
|
|
2938
|
+
autoAdjustAspectRatio: true,
|
|
2939
|
+
aspectRatio: 1
|
|
2899
2940
|
}),
|
|
2900
2941
|
...instant_results_options_
|
|
2901
2942
|
})));
|
|
@@ -2973,7 +3014,7 @@ const $6a439680ae7e9ba3$var$TabsContext = /*@__PURE__*/$b8hua$createContext();
|
|
|
2973
3014
|
const $6a439680ae7e9ba3$var$useTabs = () => $b8hua$useContext($6a439680ae7e9ba3$var$TabsContext);
|
|
2974
3015
|
function $6a439680ae7e9ba3$export$b2539bed5023c21c(props) {
|
|
2975
3016
|
return $b8hua$createComponent($6a439680ae7e9ba3$var$TabsContext.Provider, {
|
|
2976
|
-
value: new (0, $b8hua$
|
|
3017
|
+
value: new (0, $b8hua$ListenableSet1)(),
|
|
2977
3018
|
get children() {
|
|
2978
3019
|
return $b8hua$createComponent($6a439680ae7e9ba3$var$ActualTabs, $b8hua$mergeProps(props, {
|
|
2979
3020
|
get children() {
|
|
@@ -3116,7 +3157,17 @@ async function $d5f1e6a0f9117286$export$79b1565500412d9b(search_modal, modal_fn_
|
|
|
3116
3157
|
const actually_close = () => {
|
|
3117
3158
|
dispose();
|
|
3118
3159
|
on_dispose === null || on_dispose === void 0 || on_dispose();
|
|
3119
|
-
|
|
3160
|
+
const {
|
|
3161
|
+
activeElement: activeElement
|
|
3162
|
+
} = document;
|
|
3163
|
+
modal_els.forEach(el => {
|
|
3164
|
+
if (el.contains(activeElement)) {
|
|
3165
|
+
var _blur, _ref;
|
|
3166
|
+
// Fix page jumping to the bottom when closing modal with scape after animation in safari
|
|
3167
|
+
activeElement === null || activeElement === void 0 || (_blur = (_ref = activeElement).blur) === null || _blur === void 0 || _blur.call(_ref);
|
|
3168
|
+
}
|
|
3169
|
+
el.remove();
|
|
3170
|
+
});
|
|
3120
3171
|
};
|
|
3121
3172
|
if (animation_started && +new Date() - animation_started > 1000)
|
|
3122
3173
|
// Animation broke, close it this time
|
|
@@ -10890,7 +10941,7 @@ function $d53ebed6f63304e4$export$6d0c9c22f6652669(_ref) {
|
|
|
10890
10941
|
number_: num_results,
|
|
10891
10942
|
i18n_: i18n_
|
|
10892
10943
|
});
|
|
10893
|
-
const queries_without_content_results_ = new (0, $b8hua$
|
|
10944
|
+
const queries_without_content_results_ = new (0, $b8hua$ListenableSet)();
|
|
10894
10945
|
const [check_query, set_check_query] = $b8hua$createSignal(false);
|
|
10895
10946
|
const placeholders_enabled = $b8hua$createMemo(() => {
|
|
10896
10947
|
// don't show placeholders when the user toggles filters
|