@depict-ai/ui 4.1.2 → 4.1.4
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 +23 -13
- package/ES10/index.d.ts +5 -5
- package/ES10/index.js +23 -13
- package/latest/index.cjs +23 -13
- package/latest/index.d.ts +5 -5
- package/latest/index.js +23 -13
- package/package.json +1 -1
- package/server/ES10/index.cjs +23 -13
- package/server/ES10/index.d.ts +5 -5
- package/server/ES10/index.js +23 -13
- package/server/latest/index.cjs +23 -13
- package/server/latest/index.d.ts +5 -5
- package/server/latest/index.js +23 -13
package/ES10/index.cjs
CHANGED
|
@@ -98,7 +98,7 @@ $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447a
|
|
|
98
98
|
$parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
|
|
99
99
|
$parcel$export(module.exports, "SearchField", () => $98aef9965764903d$export$316f6f283ae64765);
|
|
100
100
|
/*! Depict.ai search and product listing SDK */
|
|
101
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.1.
|
|
101
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.1.4";
|
|
102
102
|
const $cfcd56242923775d$export$3064e1e8c6513da3 = new Set();
|
|
103
103
|
let $cfcd56242923775d$var$has_ran = false;
|
|
104
104
|
function $cfcd56242923775d$export$5162a71f252e6122() {
|
|
@@ -2645,8 +2645,12 @@ const $858fdcf73148519f$export$f8945274f08a3105 = /*@__PURE__*/Symbol("listingCo
|
|
|
2645
2645
|
const $858fdcf73148519f$export$6066eb417ed2e9f7 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
2646
2646
|
function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
2647
2647
|
const src_options = $52FdA$solidjs.createMemo(() => {
|
|
2648
|
-
const
|
|
2649
|
-
|
|
2648
|
+
const {
|
|
2649
|
+
src: src,
|
|
2650
|
+
customGenerateImageUrl_: customGenerateImageUrl_
|
|
2651
|
+
} = props;
|
|
2652
|
+
const fallback_src = (customGenerateImageUrl_ || $858fdcf73148519f$export$1d6267828870adda)(src, 400);
|
|
2653
|
+
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], customGenerateImageUrl_);
|
|
2650
2654
|
// The order here *might* matter - I've seen mobile safari always start with loading the 400px version when it was reversed
|
|
2651
2655
|
return {
|
|
2652
2656
|
srcset: srcset,
|
|
@@ -2786,10 +2790,10 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
|
2786
2790
|
children: img
|
|
2787
2791
|
});
|
|
2788
2792
|
}
|
|
2789
|
-
function $858fdcf73148519f$var$make_srcset(url, resolutions) {
|
|
2790
|
-
return resolutions.map(width => "".concat($858fdcf73148519f$
|
|
2793
|
+
function $858fdcf73148519f$var$make_srcset(url, resolutions, customGenerateImageUrl_) {
|
|
2794
|
+
return resolutions.map(width => "".concat((customGenerateImageUrl_ || $858fdcf73148519f$export$1d6267828870adda)(url, width), " ").concat(width, "w")).join(", ");
|
|
2791
2795
|
}
|
|
2792
|
-
function $858fdcf73148519f$
|
|
2796
|
+
function $858fdcf73148519f$export$1d6267828870adda(url, width) {
|
|
2793
2797
|
// Even just creating one `URL` object per image src and then setting the search parameter is quite slow (0.25ms to set the width param)
|
|
2794
2798
|
// We're making the assumptions that the url has already at least one query parameter and that the image resizing service will choose the last one out of a duplicate width parameter (shopify's does)
|
|
2795
2799
|
// That way we can just to string concatenation which is insanely fast
|
|
@@ -2852,14 +2856,20 @@ function $28535bb7671c63d1$export$e4b984597b71e989(props) {
|
|
|
2852
2856
|
return container;
|
|
2853
2857
|
}
|
|
2854
2858
|
function $9e470232a6b789a3$export$9d4a4b669b1929ab(props) {
|
|
2855
|
-
const src = $52FdA$solidjs.createMemo(() => {
|
|
2856
|
-
const urlObject = new URL("https://img.depict.ai/ResizeImage/".concat(props.merchant_, "?format=webp"));
|
|
2857
|
-
urlObject.searchParams.set("url", props.src);
|
|
2858
|
-
return urlObject.href;
|
|
2859
|
-
});
|
|
2860
2859
|
return $52FdA$solidjsweb.createComponent((0, $28535bb7671c63d1$export$e4b984597b71e989), $52FdA$solidjsweb.mergeProps(props, {
|
|
2861
|
-
get
|
|
2862
|
-
return
|
|
2860
|
+
get imgProps() {
|
|
2861
|
+
return {
|
|
2862
|
+
...props.imgProps,
|
|
2863
|
+
customGenerateImageUrl_: (url, width // Apparently don't have to encode url for CF's service
|
|
2864
|
+
) => {
|
|
2865
|
+
if (url.startsWith("https://cdn.shopify.com"))
|
|
2866
|
+
// The shopify image resizing CDN blocks Cloudflare's image resizer. It's possible that we can't detect shopify image URLs sometimes because they go to the merchant's domain,
|
|
2867
|
+
// but it seems like the URLs returned by the Depict API always goes to the cdn.shopify.com version of an image, so this simple workaround works.
|
|
2868
|
+
return $858fdcf73148519f$export$1d6267828870adda(url, width);
|
|
2869
|
+
// Use cloudflare image resizer instead of img.depict.ai because it's a lot faster (and also auto-chooses other formats if webp is not supported)
|
|
2870
|
+
return "https://app.depict.ai/cdn-cgi/image/width=".concat(width, ",format=auto/").concat(url);
|
|
2871
|
+
}
|
|
2872
|
+
};
|
|
2863
2873
|
}
|
|
2864
2874
|
}));
|
|
2865
2875
|
}
|
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 _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
|
|
13
|
-
export const version = "4.1.
|
|
13
|
+
export const version = "4.1.4";
|
|
14
14
|
export const prefixes_to_preserve_in_history_dot_state: Set<string>;
|
|
15
15
|
/**
|
|
16
16
|
* Prevent, usually SPAs, from deleting our stuff from history.state when they call history.pushState with a new object they have constructed. This will only run once no matter how often it's called.
|
|
@@ -434,10 +434,10 @@ export function makeSizeAccessor(whatToWatch: HTMLElement): Accessor<number>;
|
|
|
434
434
|
export function ShopifyResponsiveImg(props: {
|
|
435
435
|
resolutions?: number[];
|
|
436
436
|
size: Accessor<number>;
|
|
437
|
-
} & Omit<JSX.ImgHTMLAttributes<HTMLImageElement>, "srcset" | "src" | "sizes" | "loading"> & {
|
|
438
437
|
src: string;
|
|
439
438
|
loading?: "eager" | "lazy" | "force-lazy";
|
|
440
|
-
|
|
439
|
+
customGenerateImageUrl_?: (url: string, width: number) => string;
|
|
440
|
+
} & Omit<JSX.ImgHTMLAttributes<HTMLImageElement>, "srcset" | "src" | "sizes" | "loading">): JSX.Element;
|
|
441
441
|
type ImagePlaceholderBaseOptions = {
|
|
442
442
|
style?: JSX.CSSProperties;
|
|
443
443
|
class?: string;
|
|
@@ -1246,7 +1246,7 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
|
|
|
1246
1246
|
on_listing_query_change?: (new_listing_query?: ListingQuery | undefined, old_listing_query?: ListingQuery | undefined) => void;
|
|
1247
1247
|
content_blocks_by_row?: ContentBlocksByRow;
|
|
1248
1248
|
layout?: PossibleLayout;
|
|
1249
|
-
}): import("@depict-ai/utilishared
|
|
1249
|
+
}): import("@depict-ai/utilishared").Node_Array;
|
|
1250
1250
|
export function BreadCrumbs<T extends Display>({
|
|
1251
1251
|
depict_category
|
|
1252
1252
|
}: {
|
|
@@ -1386,7 +1386,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
|
|
|
1386
1386
|
* Open the modal with support for alignment.
|
|
1387
1387
|
* @returns {void}
|
|
1388
1388
|
*/
|
|
1389
|
-
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends
|
|
1389
|
+
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
|
|
1390
1390
|
export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
|
|
1391
1391
|
export interface PageReplacer {
|
|
1392
1392
|
readonly render_: () => Node_Array;
|
package/ES10/index.js
CHANGED
|
@@ -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.1.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.1.4";
|
|
14
14
|
const $68e6625c8d51f847$export$3064e1e8c6513da3 = new Set();
|
|
15
15
|
let $68e6625c8d51f847$var$has_ran = false;
|
|
16
16
|
function $68e6625c8d51f847$export$5162a71f252e6122() {
|
|
@@ -2557,8 +2557,12 @@ const $56047603f9d212b6$export$f8945274f08a3105 = /*@__PURE__*/Symbol("listingCo
|
|
|
2557
2557
|
const $56047603f9d212b6$export$6066eb417ed2e9f7 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
2558
2558
|
function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
2559
2559
|
const src_options = $8tj43$createMemo(() => {
|
|
2560
|
-
const
|
|
2561
|
-
|
|
2560
|
+
const {
|
|
2561
|
+
src: src,
|
|
2562
|
+
customGenerateImageUrl_: customGenerateImageUrl_
|
|
2563
|
+
} = props;
|
|
2564
|
+
const fallback_src = (customGenerateImageUrl_ || $56047603f9d212b6$export$1d6267828870adda)(src, 400);
|
|
2565
|
+
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], customGenerateImageUrl_);
|
|
2562
2566
|
// The order here *might* matter - I've seen mobile safari always start with loading the 400px version when it was reversed
|
|
2563
2567
|
return {
|
|
2564
2568
|
srcset: srcset,
|
|
@@ -2698,10 +2702,10 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
|
2698
2702
|
children: img
|
|
2699
2703
|
});
|
|
2700
2704
|
}
|
|
2701
|
-
function $56047603f9d212b6$var$make_srcset(url, resolutions) {
|
|
2702
|
-
return resolutions.map(width => "".concat($56047603f9d212b6$
|
|
2705
|
+
function $56047603f9d212b6$var$make_srcset(url, resolutions, customGenerateImageUrl_) {
|
|
2706
|
+
return resolutions.map(width => "".concat((customGenerateImageUrl_ || $56047603f9d212b6$export$1d6267828870adda)(url, width), " ").concat(width, "w")).join(", ");
|
|
2703
2707
|
}
|
|
2704
|
-
function $56047603f9d212b6$
|
|
2708
|
+
function $56047603f9d212b6$export$1d6267828870adda(url, width) {
|
|
2705
2709
|
// Even just creating one `URL` object per image src and then setting the search parameter is quite slow (0.25ms to set the width param)
|
|
2706
2710
|
// We're making the assumptions that the url has already at least one query parameter and that the image resizing service will choose the last one out of a duplicate width parameter (shopify's does)
|
|
2707
2711
|
// That way we can just to string concatenation which is insanely fast
|
|
@@ -2764,14 +2768,20 @@ function $4df489344a0f97c7$export$e4b984597b71e989(props) {
|
|
|
2764
2768
|
return container;
|
|
2765
2769
|
}
|
|
2766
2770
|
function $7fbaab3d3dafb4f5$export$9d4a4b669b1929ab(props) {
|
|
2767
|
-
const src = $8tj43$createMemo(() => {
|
|
2768
|
-
const urlObject = new URL("https://img.depict.ai/ResizeImage/".concat(props.merchant_, "?format=webp"));
|
|
2769
|
-
urlObject.searchParams.set("url", props.src);
|
|
2770
|
-
return urlObject.href;
|
|
2771
|
-
});
|
|
2772
2771
|
return $8tj43$createComponent((0, $4df489344a0f97c7$export$e4b984597b71e989), $8tj43$mergeProps(props, {
|
|
2773
|
-
get
|
|
2774
|
-
return
|
|
2772
|
+
get imgProps() {
|
|
2773
|
+
return {
|
|
2774
|
+
...props.imgProps,
|
|
2775
|
+
customGenerateImageUrl_: (url, width // Apparently don't have to encode url for CF's service
|
|
2776
|
+
) => {
|
|
2777
|
+
if (url.startsWith("https://cdn.shopify.com"))
|
|
2778
|
+
// The shopify image resizing CDN blocks Cloudflare's image resizer. It's possible that we can't detect shopify image URLs sometimes because they go to the merchant's domain,
|
|
2779
|
+
// but it seems like the URLs returned by the Depict API always goes to the cdn.shopify.com version of an image, so this simple workaround works.
|
|
2780
|
+
return $56047603f9d212b6$export$1d6267828870adda(url, width);
|
|
2781
|
+
// Use cloudflare image resizer instead of img.depict.ai because it's a lot faster (and also auto-chooses other formats if webp is not supported)
|
|
2782
|
+
return "https://app.depict.ai/cdn-cgi/image/width=".concat(width, ",format=auto/").concat(url);
|
|
2783
|
+
}
|
|
2784
|
+
};
|
|
2775
2785
|
}
|
|
2776
2786
|
}));
|
|
2777
2787
|
}
|
package/latest/index.cjs
CHANGED
|
@@ -92,7 +92,7 @@ $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad99
|
|
|
92
92
|
$parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
|
|
93
93
|
$parcel$export(module.exports, "SearchField", () => $c0a0659cf97e8eb2$export$316f6f283ae64765);
|
|
94
94
|
/*! Depict.ai search and product listing SDK */
|
|
95
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.1.
|
|
95
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.1.4";
|
|
96
96
|
const $d84fe647b84b5dc5$export$3064e1e8c6513da3 = new Set();
|
|
97
97
|
let $d84fe647b84b5dc5$var$has_ran = false;
|
|
98
98
|
function $d84fe647b84b5dc5$export$5162a71f252e6122() {
|
|
@@ -2539,8 +2539,12 @@ const $19950faaac026e09$export$f8945274f08a3105 = /*@__PURE__*/Symbol("listingCo
|
|
|
2539
2539
|
const $19950faaac026e09$export$6066eb417ed2e9f7 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
2540
2540
|
function $19950faaac026e09$export$6e5611bc7e57e477(props) {
|
|
2541
2541
|
const src_options = $gVhhF$solidjs.createMemo(() => {
|
|
2542
|
-
const
|
|
2543
|
-
|
|
2542
|
+
const {
|
|
2543
|
+
src: src,
|
|
2544
|
+
customGenerateImageUrl_: customGenerateImageUrl_
|
|
2545
|
+
} = props;
|
|
2546
|
+
const fallback_src = (customGenerateImageUrl_ || $19950faaac026e09$export$1d6267828870adda)(src, 400);
|
|
2547
|
+
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], customGenerateImageUrl_);
|
|
2544
2548
|
// The order here *might* matter - I've seen mobile safari always start with loading the 400px version when it was reversed
|
|
2545
2549
|
return {
|
|
2546
2550
|
srcset: srcset,
|
|
@@ -2677,10 +2681,10 @@ function $19950faaac026e09$export$6e5611bc7e57e477(props) {
|
|
|
2677
2681
|
children: img
|
|
2678
2682
|
});
|
|
2679
2683
|
}
|
|
2680
|
-
function $19950faaac026e09$var$make_srcset(url, resolutions) {
|
|
2681
|
-
return resolutions.map(width => `${$19950faaac026e09$
|
|
2684
|
+
function $19950faaac026e09$var$make_srcset(url, resolutions, customGenerateImageUrl_) {
|
|
2685
|
+
return resolutions.map(width => `${(customGenerateImageUrl_ || $19950faaac026e09$export$1d6267828870adda)(url, width)} ${width}w`).join(", ");
|
|
2682
2686
|
}
|
|
2683
|
-
function $19950faaac026e09$
|
|
2687
|
+
function $19950faaac026e09$export$1d6267828870adda(url, width) {
|
|
2684
2688
|
// Even just creating one `URL` object per image src and then setting the search parameter is quite slow (0.25ms to set the width param)
|
|
2685
2689
|
// We're making the assumptions that the url has already at least one query parameter and that the image resizing service will choose the last one out of a duplicate width parameter (shopify's does)
|
|
2686
2690
|
// That way we can just to string concatenation which is insanely fast
|
|
@@ -2741,14 +2745,20 @@ function $a33065cfed827fc0$export$e4b984597b71e989(props) {
|
|
|
2741
2745
|
return container;
|
|
2742
2746
|
}
|
|
2743
2747
|
function $e8327f98c8ee28d7$export$9d4a4b669b1929ab(props) {
|
|
2744
|
-
const src = $gVhhF$solidjs.createMemo(() => {
|
|
2745
|
-
const urlObject = new URL(`https://img.depict.ai/ResizeImage/${props.merchant_}?format=webp`);
|
|
2746
|
-
urlObject.searchParams.set("url", props.src);
|
|
2747
|
-
return urlObject.href;
|
|
2748
|
-
});
|
|
2749
2748
|
return $gVhhF$solidjsweb.createComponent((0, $a33065cfed827fc0$export$e4b984597b71e989), $gVhhF$solidjsweb.mergeProps(props, {
|
|
2750
|
-
get
|
|
2751
|
-
return
|
|
2749
|
+
get imgProps() {
|
|
2750
|
+
return {
|
|
2751
|
+
...props.imgProps,
|
|
2752
|
+
customGenerateImageUrl_: (url, width // Apparently don't have to encode url for CF's service
|
|
2753
|
+
) => {
|
|
2754
|
+
if (url.startsWith("https://cdn.shopify.com"))
|
|
2755
|
+
// The shopify image resizing CDN blocks Cloudflare's image resizer. It's possible that we can't detect shopify image URLs sometimes because they go to the merchant's domain,
|
|
2756
|
+
// but it seems like the URLs returned by the Depict API always goes to the cdn.shopify.com version of an image, so this simple workaround works.
|
|
2757
|
+
return $19950faaac026e09$export$1d6267828870adda(url, width);
|
|
2758
|
+
// Use cloudflare image resizer instead of img.depict.ai because it's a lot faster (and also auto-chooses other formats if webp is not supported)
|
|
2759
|
+
return `https://app.depict.ai/cdn-cgi/image/width=${width},format=auto/${url}`;
|
|
2760
|
+
}
|
|
2761
|
+
};
|
|
2752
2762
|
}
|
|
2753
2763
|
}));
|
|
2754
2764
|
}
|
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 _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
|
|
13
|
-
export const version = "4.1.
|
|
13
|
+
export const version = "4.1.4";
|
|
14
14
|
export const prefixes_to_preserve_in_history_dot_state: Set<string>;
|
|
15
15
|
/**
|
|
16
16
|
* Prevent, usually SPAs, from deleting our stuff from history.state when they call history.pushState with a new object they have constructed. This will only run once no matter how often it's called.
|
|
@@ -434,10 +434,10 @@ export function makeSizeAccessor(whatToWatch: HTMLElement): Accessor<number>;
|
|
|
434
434
|
export function ShopifyResponsiveImg(props: {
|
|
435
435
|
resolutions?: number[];
|
|
436
436
|
size: Accessor<number>;
|
|
437
|
-
} & Omit<JSX.ImgHTMLAttributes<HTMLImageElement>, "srcset" | "src" | "sizes" | "loading"> & {
|
|
438
437
|
src: string;
|
|
439
438
|
loading?: "eager" | "lazy" | "force-lazy";
|
|
440
|
-
|
|
439
|
+
customGenerateImageUrl_?: (url: string, width: number) => string;
|
|
440
|
+
} & Omit<JSX.ImgHTMLAttributes<HTMLImageElement>, "srcset" | "src" | "sizes" | "loading">): JSX.Element;
|
|
441
441
|
type ImagePlaceholderBaseOptions = {
|
|
442
442
|
style?: JSX.CSSProperties;
|
|
443
443
|
class?: string;
|
|
@@ -1246,7 +1246,7 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
|
|
|
1246
1246
|
on_listing_query_change?: (new_listing_query?: ListingQuery | undefined, old_listing_query?: ListingQuery | undefined) => void;
|
|
1247
1247
|
content_blocks_by_row?: ContentBlocksByRow;
|
|
1248
1248
|
layout?: PossibleLayout;
|
|
1249
|
-
}): import("@depict-ai/utilishared
|
|
1249
|
+
}): import("@depict-ai/utilishared").Node_Array;
|
|
1250
1250
|
export function BreadCrumbs<T extends Display>({
|
|
1251
1251
|
depict_category
|
|
1252
1252
|
}: {
|
|
@@ -1386,7 +1386,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
|
|
|
1386
1386
|
* Open the modal with support for alignment.
|
|
1387
1387
|
* @returns {void}
|
|
1388
1388
|
*/
|
|
1389
|
-
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends
|
|
1389
|
+
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
|
|
1390
1390
|
export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
|
|
1391
1391
|
export interface PageReplacer {
|
|
1392
1392
|
readonly render_: () => Node_Array;
|
package/latest/index.js
CHANGED
|
@@ -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.1.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "4.1.4";
|
|
11
11
|
const $90980bd87c9960f9$export$3064e1e8c6513da3 = new Set();
|
|
12
12
|
let $90980bd87c9960f9$var$has_ran = false;
|
|
13
13
|
function $90980bd87c9960f9$export$5162a71f252e6122() {
|
|
@@ -2454,8 +2454,12 @@ const $e8ffe11ed01df0fe$export$f8945274f08a3105 = /*@__PURE__*/Symbol("listingCo
|
|
|
2454
2454
|
const $e8ffe11ed01df0fe$export$6066eb417ed2e9f7 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
2455
2455
|
function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
2456
2456
|
const src_options = $9HbP8$createMemo(() => {
|
|
2457
|
-
const
|
|
2458
|
-
|
|
2457
|
+
const {
|
|
2458
|
+
src: src,
|
|
2459
|
+
customGenerateImageUrl_: customGenerateImageUrl_
|
|
2460
|
+
} = props;
|
|
2461
|
+
const fallback_src = (customGenerateImageUrl_ || $e8ffe11ed01df0fe$export$1d6267828870adda)(src, 400);
|
|
2462
|
+
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], customGenerateImageUrl_);
|
|
2459
2463
|
// The order here *might* matter - I've seen mobile safari always start with loading the 400px version when it was reversed
|
|
2460
2464
|
return {
|
|
2461
2465
|
srcset: srcset,
|
|
@@ -2592,10 +2596,10 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
2592
2596
|
children: img
|
|
2593
2597
|
});
|
|
2594
2598
|
}
|
|
2595
|
-
function $e8ffe11ed01df0fe$var$make_srcset(url, resolutions) {
|
|
2596
|
-
return resolutions.map(width => `${$e8ffe11ed01df0fe$
|
|
2599
|
+
function $e8ffe11ed01df0fe$var$make_srcset(url, resolutions, customGenerateImageUrl_) {
|
|
2600
|
+
return resolutions.map(width => `${(customGenerateImageUrl_ || $e8ffe11ed01df0fe$export$1d6267828870adda)(url, width)} ${width}w`).join(", ");
|
|
2597
2601
|
}
|
|
2598
|
-
function $e8ffe11ed01df0fe$
|
|
2602
|
+
function $e8ffe11ed01df0fe$export$1d6267828870adda(url, width) {
|
|
2599
2603
|
// Even just creating one `URL` object per image src and then setting the search parameter is quite slow (0.25ms to set the width param)
|
|
2600
2604
|
// We're making the assumptions that the url has already at least one query parameter and that the image resizing service will choose the last one out of a duplicate width parameter (shopify's does)
|
|
2601
2605
|
// That way we can just to string concatenation which is insanely fast
|
|
@@ -2656,14 +2660,20 @@ function $660070e2a394b3c3$export$e4b984597b71e989(props) {
|
|
|
2656
2660
|
return container;
|
|
2657
2661
|
}
|
|
2658
2662
|
function $4f16612bea257571$export$9d4a4b669b1929ab(props) {
|
|
2659
|
-
const src = $9HbP8$createMemo(() => {
|
|
2660
|
-
const urlObject = new URL(`https://img.depict.ai/ResizeImage/${props.merchant_}?format=webp`);
|
|
2661
|
-
urlObject.searchParams.set("url", props.src);
|
|
2662
|
-
return urlObject.href;
|
|
2663
|
-
});
|
|
2664
2663
|
return $9HbP8$createComponent((0, $660070e2a394b3c3$export$e4b984597b71e989), $9HbP8$mergeProps(props, {
|
|
2665
|
-
get
|
|
2666
|
-
return
|
|
2664
|
+
get imgProps() {
|
|
2665
|
+
return {
|
|
2666
|
+
...props.imgProps,
|
|
2667
|
+
customGenerateImageUrl_: (url, width // Apparently don't have to encode url for CF's service
|
|
2668
|
+
) => {
|
|
2669
|
+
if (url.startsWith("https://cdn.shopify.com"))
|
|
2670
|
+
// The shopify image resizing CDN blocks Cloudflare's image resizer. It's possible that we can't detect shopify image URLs sometimes because they go to the merchant's domain,
|
|
2671
|
+
// but it seems like the URLs returned by the Depict API always goes to the cdn.shopify.com version of an image, so this simple workaround works.
|
|
2672
|
+
return $e8ffe11ed01df0fe$export$1d6267828870adda(url, width);
|
|
2673
|
+
// Use cloudflare image resizer instead of img.depict.ai because it's a lot faster (and also auto-chooses other formats if webp is not supported)
|
|
2674
|
+
return `https://app.depict.ai/cdn-cgi/image/width=${width},format=auto/${url}`;
|
|
2675
|
+
}
|
|
2676
|
+
};
|
|
2667
2677
|
}
|
|
2668
2678
|
}));
|
|
2669
2679
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/ui",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.4",
|
|
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
|
@@ -98,7 +98,7 @@ $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447a
|
|
|
98
98
|
$parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
|
|
99
99
|
$parcel$export(module.exports, "SearchField", () => $98aef9965764903d$export$316f6f283ae64765);
|
|
100
100
|
/*! Depict.ai search and product listing SDK */
|
|
101
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.1.
|
|
101
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.1.4";
|
|
102
102
|
const $cfcd56242923775d$export$3064e1e8c6513da3 = new Set();
|
|
103
103
|
let $cfcd56242923775d$var$has_ran = false;
|
|
104
104
|
function $cfcd56242923775d$export$5162a71f252e6122() {
|
|
@@ -2075,8 +2075,12 @@ const $858fdcf73148519f$export$f8945274f08a3105 = /*@__PURE__*/Symbol("listingCo
|
|
|
2075
2075
|
const $858fdcf73148519f$export$6066eb417ed2e9f7 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
2076
2076
|
function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
2077
2077
|
const src_options = $3hooq$solidjs.createMemo(() => {
|
|
2078
|
-
const
|
|
2079
|
-
|
|
2078
|
+
const {
|
|
2079
|
+
src: src,
|
|
2080
|
+
customGenerateImageUrl_: customGenerateImageUrl_
|
|
2081
|
+
} = props;
|
|
2082
|
+
const fallback_src = (customGenerateImageUrl_ || $858fdcf73148519f$export$1d6267828870adda)(src, 400);
|
|
2083
|
+
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], customGenerateImageUrl_);
|
|
2080
2084
|
// The order here *might* matter - I've seen mobile safari always start with loading the 400px version when it was reversed
|
|
2081
2085
|
return {
|
|
2082
2086
|
srcset: srcset,
|
|
@@ -2216,10 +2220,10 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
|
2216
2220
|
children: img
|
|
2217
2221
|
});
|
|
2218
2222
|
}
|
|
2219
|
-
function $858fdcf73148519f$var$make_srcset(url, resolutions) {
|
|
2220
|
-
return resolutions.map(width => "".concat($858fdcf73148519f$
|
|
2223
|
+
function $858fdcf73148519f$var$make_srcset(url, resolutions, customGenerateImageUrl_) {
|
|
2224
|
+
return resolutions.map(width => "".concat((customGenerateImageUrl_ || $858fdcf73148519f$export$1d6267828870adda)(url, width), " ").concat(width, "w")).join(", ");
|
|
2221
2225
|
}
|
|
2222
|
-
function $858fdcf73148519f$
|
|
2226
|
+
function $858fdcf73148519f$export$1d6267828870adda(url, width) {
|
|
2223
2227
|
// Even just creating one `URL` object per image src and then setting the search parameter is quite slow (0.25ms to set the width param)
|
|
2224
2228
|
// We're making the assumptions that the url has already at least one query parameter and that the image resizing service will choose the last one out of a duplicate width parameter (shopify's does)
|
|
2225
2229
|
// That way we can just to string concatenation which is insanely fast
|
|
@@ -2282,14 +2286,20 @@ function $28535bb7671c63d1$export$e4b984597b71e989(props) {
|
|
|
2282
2286
|
return container;
|
|
2283
2287
|
}
|
|
2284
2288
|
function $9e470232a6b789a3$export$9d4a4b669b1929ab(props) {
|
|
2285
|
-
const src = $3hooq$solidjs.createMemo(() => {
|
|
2286
|
-
const urlObject = new URL("https://img.depict.ai/ResizeImage/".concat(props.merchant_, "?format=webp"));
|
|
2287
|
-
urlObject.searchParams.set("url", props.src);
|
|
2288
|
-
return urlObject.href;
|
|
2289
|
-
});
|
|
2290
2289
|
return $3hooq$solidjsweb.createComponent((0, $28535bb7671c63d1$export$e4b984597b71e989), $3hooq$solidjsweb.mergeProps(props, {
|
|
2291
|
-
get
|
|
2292
|
-
return
|
|
2290
|
+
get imgProps() {
|
|
2291
|
+
return {
|
|
2292
|
+
...props.imgProps,
|
|
2293
|
+
customGenerateImageUrl_: (url, width // Apparently don't have to encode url for CF's service
|
|
2294
|
+
) => {
|
|
2295
|
+
if (url.startsWith("https://cdn.shopify.com"))
|
|
2296
|
+
// The shopify image resizing CDN blocks Cloudflare's image resizer. It's possible that we can't detect shopify image URLs sometimes because they go to the merchant's domain,
|
|
2297
|
+
// but it seems like the URLs returned by the Depict API always goes to the cdn.shopify.com version of an image, so this simple workaround works.
|
|
2298
|
+
return $858fdcf73148519f$export$1d6267828870adda(url, width);
|
|
2299
|
+
// Use cloudflare image resizer instead of img.depict.ai because it's a lot faster (and also auto-chooses other formats if webp is not supported)
|
|
2300
|
+
return "https://app.depict.ai/cdn-cgi/image/width=".concat(width, ",format=auto/").concat(url);
|
|
2301
|
+
}
|
|
2302
|
+
};
|
|
2293
2303
|
}
|
|
2294
2304
|
}));
|
|
2295
2305
|
}
|
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 _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
|
|
13
|
-
export const version = "4.1.
|
|
13
|
+
export const version = "4.1.4";
|
|
14
14
|
export const prefixes_to_preserve_in_history_dot_state: Set<string>;
|
|
15
15
|
/**
|
|
16
16
|
* Prevent, usually SPAs, from deleting our stuff from history.state when they call history.pushState with a new object they have constructed. This will only run once no matter how often it's called.
|
|
@@ -434,10 +434,10 @@ export function makeSizeAccessor(whatToWatch: HTMLElement): Accessor<number>;
|
|
|
434
434
|
export function ShopifyResponsiveImg(props: {
|
|
435
435
|
resolutions?: number[];
|
|
436
436
|
size: Accessor<number>;
|
|
437
|
-
} & Omit<JSX.ImgHTMLAttributes<HTMLImageElement>, "srcset" | "src" | "sizes" | "loading"> & {
|
|
438
437
|
src: string;
|
|
439
438
|
loading?: "eager" | "lazy" | "force-lazy";
|
|
440
|
-
|
|
439
|
+
customGenerateImageUrl_?: (url: string, width: number) => string;
|
|
440
|
+
} & Omit<JSX.ImgHTMLAttributes<HTMLImageElement>, "srcset" | "src" | "sizes" | "loading">): JSX.Element;
|
|
441
441
|
type ImagePlaceholderBaseOptions = {
|
|
442
442
|
style?: JSX.CSSProperties;
|
|
443
443
|
class?: string;
|
|
@@ -1246,7 +1246,7 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
|
|
|
1246
1246
|
on_listing_query_change?: (new_listing_query?: ListingQuery | undefined, old_listing_query?: ListingQuery | undefined) => void;
|
|
1247
1247
|
content_blocks_by_row?: ContentBlocksByRow;
|
|
1248
1248
|
layout?: PossibleLayout;
|
|
1249
|
-
}): import("@depict-ai/utilishared
|
|
1249
|
+
}): import("@depict-ai/utilishared").Node_Array;
|
|
1250
1250
|
export function BreadCrumbs<T extends Display>({
|
|
1251
1251
|
depict_category
|
|
1252
1252
|
}: {
|
|
@@ -1386,7 +1386,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
|
|
|
1386
1386
|
* Open the modal with support for alignment.
|
|
1387
1387
|
* @returns {void}
|
|
1388
1388
|
*/
|
|
1389
|
-
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends
|
|
1389
|
+
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
|
|
1390
1390
|
export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
|
|
1391
1391
|
export interface PageReplacer {
|
|
1392
1392
|
readonly render_: () => Node_Array;
|
package/server/ES10/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { createStore as $b8hua$createStore, reconcile as $b8hua$reconcile } from
|
|
|
10
10
|
/*! Depict.ai search and product listing SDK */
|
|
11
11
|
import { register_es_version } from "../../multi_import_deduplicator.mjs";
|
|
12
12
|
register_es_version("ui", "ES10");
|
|
13
|
-
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.1.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.1.4";
|
|
14
14
|
const $68e6625c8d51f847$export$3064e1e8c6513da3 = new Set();
|
|
15
15
|
let $68e6625c8d51f847$var$has_ran = false;
|
|
16
16
|
function $68e6625c8d51f847$export$5162a71f252e6122() {
|
|
@@ -1987,8 +1987,12 @@ const $56047603f9d212b6$export$f8945274f08a3105 = /*@__PURE__*/Symbol("listingCo
|
|
|
1987
1987
|
const $56047603f9d212b6$export$6066eb417ed2e9f7 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
1988
1988
|
function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
1989
1989
|
const src_options = $b8hua$createMemo(() => {
|
|
1990
|
-
const
|
|
1991
|
-
|
|
1990
|
+
const {
|
|
1991
|
+
src: src,
|
|
1992
|
+
customGenerateImageUrl_: customGenerateImageUrl_
|
|
1993
|
+
} = props;
|
|
1994
|
+
const fallback_src = (customGenerateImageUrl_ || $56047603f9d212b6$export$1d6267828870adda)(src, 400);
|
|
1995
|
+
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], customGenerateImageUrl_);
|
|
1992
1996
|
// The order here *might* matter - I've seen mobile safari always start with loading the 400px version when it was reversed
|
|
1993
1997
|
return {
|
|
1994
1998
|
srcset: srcset,
|
|
@@ -2128,10 +2132,10 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
|
2128
2132
|
children: img
|
|
2129
2133
|
});
|
|
2130
2134
|
}
|
|
2131
|
-
function $56047603f9d212b6$var$make_srcset(url, resolutions) {
|
|
2132
|
-
return resolutions.map(width => "".concat($56047603f9d212b6$
|
|
2135
|
+
function $56047603f9d212b6$var$make_srcset(url, resolutions, customGenerateImageUrl_) {
|
|
2136
|
+
return resolutions.map(width => "".concat((customGenerateImageUrl_ || $56047603f9d212b6$export$1d6267828870adda)(url, width), " ").concat(width, "w")).join(", ");
|
|
2133
2137
|
}
|
|
2134
|
-
function $56047603f9d212b6$
|
|
2138
|
+
function $56047603f9d212b6$export$1d6267828870adda(url, width) {
|
|
2135
2139
|
// Even just creating one `URL` object per image src and then setting the search parameter is quite slow (0.25ms to set the width param)
|
|
2136
2140
|
// We're making the assumptions that the url has already at least one query parameter and that the image resizing service will choose the last one out of a duplicate width parameter (shopify's does)
|
|
2137
2141
|
// That way we can just to string concatenation which is insanely fast
|
|
@@ -2194,14 +2198,20 @@ function $4df489344a0f97c7$export$e4b984597b71e989(props) {
|
|
|
2194
2198
|
return container;
|
|
2195
2199
|
}
|
|
2196
2200
|
function $7fbaab3d3dafb4f5$export$9d4a4b669b1929ab(props) {
|
|
2197
|
-
const src = $b8hua$createMemo(() => {
|
|
2198
|
-
const urlObject = new URL("https://img.depict.ai/ResizeImage/".concat(props.merchant_, "?format=webp"));
|
|
2199
|
-
urlObject.searchParams.set("url", props.src);
|
|
2200
|
-
return urlObject.href;
|
|
2201
|
-
});
|
|
2202
2201
|
return $b8hua$createComponent((0, $4df489344a0f97c7$export$e4b984597b71e989), $b8hua$mergeProps(props, {
|
|
2203
|
-
get
|
|
2204
|
-
return
|
|
2202
|
+
get imgProps() {
|
|
2203
|
+
return {
|
|
2204
|
+
...props.imgProps,
|
|
2205
|
+
customGenerateImageUrl_: (url, width // Apparently don't have to encode url for CF's service
|
|
2206
|
+
) => {
|
|
2207
|
+
if (url.startsWith("https://cdn.shopify.com"))
|
|
2208
|
+
// The shopify image resizing CDN blocks Cloudflare's image resizer. It's possible that we can't detect shopify image URLs sometimes because they go to the merchant's domain,
|
|
2209
|
+
// but it seems like the URLs returned by the Depict API always goes to the cdn.shopify.com version of an image, so this simple workaround works.
|
|
2210
|
+
return $56047603f9d212b6$export$1d6267828870adda(url, width);
|
|
2211
|
+
// Use cloudflare image resizer instead of img.depict.ai because it's a lot faster (and also auto-chooses other formats if webp is not supported)
|
|
2212
|
+
return "https://app.depict.ai/cdn-cgi/image/width=".concat(width, ",format=auto/").concat(url);
|
|
2213
|
+
}
|
|
2214
|
+
};
|
|
2205
2215
|
}
|
|
2206
2216
|
}));
|
|
2207
2217
|
}
|
package/server/latest/index.cjs
CHANGED
|
@@ -92,7 +92,7 @@ $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad99
|
|
|
92
92
|
$parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
|
|
93
93
|
$parcel$export(module.exports, "SearchField", () => $c0a0659cf97e8eb2$export$316f6f283ae64765);
|
|
94
94
|
/*! Depict.ai search and product listing SDK */
|
|
95
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.1.
|
|
95
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.1.4";
|
|
96
96
|
const $d84fe647b84b5dc5$export$3064e1e8c6513da3 = new Set();
|
|
97
97
|
let $d84fe647b84b5dc5$var$has_ran = false;
|
|
98
98
|
function $d84fe647b84b5dc5$export$5162a71f252e6122() {
|
|
@@ -1983,8 +1983,12 @@ const $19950faaac026e09$export$f8945274f08a3105 = /*@__PURE__*/Symbol("listingCo
|
|
|
1983
1983
|
const $19950faaac026e09$export$6066eb417ed2e9f7 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
1984
1984
|
function $19950faaac026e09$export$6e5611bc7e57e477(props) {
|
|
1985
1985
|
const src_options = $5vyXB$solidjs.createMemo(() => {
|
|
1986
|
-
const
|
|
1987
|
-
|
|
1986
|
+
const {
|
|
1987
|
+
src: src,
|
|
1988
|
+
customGenerateImageUrl_: customGenerateImageUrl_
|
|
1989
|
+
} = props;
|
|
1990
|
+
const fallback_src = (customGenerateImageUrl_ || $19950faaac026e09$export$1d6267828870adda)(src, 400);
|
|
1991
|
+
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], customGenerateImageUrl_);
|
|
1988
1992
|
// The order here *might* matter - I've seen mobile safari always start with loading the 400px version when it was reversed
|
|
1989
1993
|
return {
|
|
1990
1994
|
srcset: srcset,
|
|
@@ -2121,10 +2125,10 @@ function $19950faaac026e09$export$6e5611bc7e57e477(props) {
|
|
|
2121
2125
|
children: img
|
|
2122
2126
|
});
|
|
2123
2127
|
}
|
|
2124
|
-
function $19950faaac026e09$var$make_srcset(url, resolutions) {
|
|
2125
|
-
return resolutions.map(width => `${$19950faaac026e09$
|
|
2128
|
+
function $19950faaac026e09$var$make_srcset(url, resolutions, customGenerateImageUrl_) {
|
|
2129
|
+
return resolutions.map(width => `${(customGenerateImageUrl_ || $19950faaac026e09$export$1d6267828870adda)(url, width)} ${width}w`).join(", ");
|
|
2126
2130
|
}
|
|
2127
|
-
function $19950faaac026e09$
|
|
2131
|
+
function $19950faaac026e09$export$1d6267828870adda(url, width) {
|
|
2128
2132
|
// Even just creating one `URL` object per image src and then setting the search parameter is quite slow (0.25ms to set the width param)
|
|
2129
2133
|
// We're making the assumptions that the url has already at least one query parameter and that the image resizing service will choose the last one out of a duplicate width parameter (shopify's does)
|
|
2130
2134
|
// That way we can just to string concatenation which is insanely fast
|
|
@@ -2185,14 +2189,20 @@ function $a33065cfed827fc0$export$e4b984597b71e989(props) {
|
|
|
2185
2189
|
return container;
|
|
2186
2190
|
}
|
|
2187
2191
|
function $e8327f98c8ee28d7$export$9d4a4b669b1929ab(props) {
|
|
2188
|
-
const src = $5vyXB$solidjs.createMemo(() => {
|
|
2189
|
-
const urlObject = new URL(`https://img.depict.ai/ResizeImage/${props.merchant_}?format=webp`);
|
|
2190
|
-
urlObject.searchParams.set("url", props.src);
|
|
2191
|
-
return urlObject.href;
|
|
2192
|
-
});
|
|
2193
2192
|
return $5vyXB$solidjsweb.createComponent((0, $a33065cfed827fc0$export$e4b984597b71e989), $5vyXB$solidjsweb.mergeProps(props, {
|
|
2194
|
-
get
|
|
2195
|
-
return
|
|
2193
|
+
get imgProps() {
|
|
2194
|
+
return {
|
|
2195
|
+
...props.imgProps,
|
|
2196
|
+
customGenerateImageUrl_: (url, width // Apparently don't have to encode url for CF's service
|
|
2197
|
+
) => {
|
|
2198
|
+
if (url.startsWith("https://cdn.shopify.com"))
|
|
2199
|
+
// The shopify image resizing CDN blocks Cloudflare's image resizer. It's possible that we can't detect shopify image URLs sometimes because they go to the merchant's domain,
|
|
2200
|
+
// but it seems like the URLs returned by the Depict API always goes to the cdn.shopify.com version of an image, so this simple workaround works.
|
|
2201
|
+
return $19950faaac026e09$export$1d6267828870adda(url, width);
|
|
2202
|
+
// Use cloudflare image resizer instead of img.depict.ai because it's a lot faster (and also auto-chooses other formats if webp is not supported)
|
|
2203
|
+
return `https://app.depict.ai/cdn-cgi/image/width=${width},format=auto/${url}`;
|
|
2204
|
+
}
|
|
2205
|
+
};
|
|
2196
2206
|
}
|
|
2197
2207
|
}));
|
|
2198
2208
|
}
|
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 _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
|
|
13
|
-
export const version = "4.1.
|
|
13
|
+
export const version = "4.1.4";
|
|
14
14
|
export const prefixes_to_preserve_in_history_dot_state: Set<string>;
|
|
15
15
|
/**
|
|
16
16
|
* Prevent, usually SPAs, from deleting our stuff from history.state when they call history.pushState with a new object they have constructed. This will only run once no matter how often it's called.
|
|
@@ -434,10 +434,10 @@ export function makeSizeAccessor(whatToWatch: HTMLElement): Accessor<number>;
|
|
|
434
434
|
export function ShopifyResponsiveImg(props: {
|
|
435
435
|
resolutions?: number[];
|
|
436
436
|
size: Accessor<number>;
|
|
437
|
-
} & Omit<JSX.ImgHTMLAttributes<HTMLImageElement>, "srcset" | "src" | "sizes" | "loading"> & {
|
|
438
437
|
src: string;
|
|
439
438
|
loading?: "eager" | "lazy" | "force-lazy";
|
|
440
|
-
|
|
439
|
+
customGenerateImageUrl_?: (url: string, width: number) => string;
|
|
440
|
+
} & Omit<JSX.ImgHTMLAttributes<HTMLImageElement>, "srcset" | "src" | "sizes" | "loading">): JSX.Element;
|
|
441
441
|
type ImagePlaceholderBaseOptions = {
|
|
442
442
|
style?: JSX.CSSProperties;
|
|
443
443
|
class?: string;
|
|
@@ -1246,7 +1246,7 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
|
|
|
1246
1246
|
on_listing_query_change?: (new_listing_query?: ListingQuery | undefined, old_listing_query?: ListingQuery | undefined) => void;
|
|
1247
1247
|
content_blocks_by_row?: ContentBlocksByRow;
|
|
1248
1248
|
layout?: PossibleLayout;
|
|
1249
|
-
}): import("@depict-ai/utilishared
|
|
1249
|
+
}): import("@depict-ai/utilishared").Node_Array;
|
|
1250
1250
|
export function BreadCrumbs<T extends Display>({
|
|
1251
1251
|
depict_category
|
|
1252
1252
|
}: {
|
|
@@ -1386,7 +1386,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
|
|
|
1386
1386
|
* Open the modal with support for alignment.
|
|
1387
1387
|
* @returns {void}
|
|
1388
1388
|
*/
|
|
1389
|
-
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends
|
|
1389
|
+
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
|
|
1390
1390
|
export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
|
|
1391
1391
|
export interface PageReplacer {
|
|
1392
1392
|
readonly render_: () => Node_Array;
|
package/server/latest/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { createStore as $i7OB2$createStore, reconcile as $i7OB2$reconcile } from
|
|
|
7
7
|
/*! Depict.ai search and product listing SDK */
|
|
8
8
|
import { register_es_version } from "../../multi_import_deduplicator.mjs";
|
|
9
9
|
register_es_version("ui", "latest");
|
|
10
|
-
const $ec291e0010116877$export$83d89fbfd8236492 = "4.1.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "4.1.4";
|
|
11
11
|
const $90980bd87c9960f9$export$3064e1e8c6513da3 = new Set();
|
|
12
12
|
let $90980bd87c9960f9$var$has_ran = false;
|
|
13
13
|
function $90980bd87c9960f9$export$5162a71f252e6122() {
|
|
@@ -1898,8 +1898,12 @@ const $e8ffe11ed01df0fe$export$f8945274f08a3105 = /*@__PURE__*/Symbol("listingCo
|
|
|
1898
1898
|
const $e8ffe11ed01df0fe$export$6066eb417ed2e9f7 = /*@__PURE__*/Symbol("listingContextAspectRatios");
|
|
1899
1899
|
function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
1900
1900
|
const src_options = $i7OB2$createMemo(() => {
|
|
1901
|
-
const
|
|
1902
|
-
|
|
1901
|
+
const {
|
|
1902
|
+
src: src,
|
|
1903
|
+
customGenerateImageUrl_: customGenerateImageUrl_
|
|
1904
|
+
} = props;
|
|
1905
|
+
const fallback_src = (customGenerateImageUrl_ || $e8ffe11ed01df0fe$export$1d6267828870adda)(src, 400);
|
|
1906
|
+
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], customGenerateImageUrl_);
|
|
1903
1907
|
// The order here *might* matter - I've seen mobile safari always start with loading the 400px version when it was reversed
|
|
1904
1908
|
return {
|
|
1905
1909
|
srcset: srcset,
|
|
@@ -2036,10 +2040,10 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
2036
2040
|
children: img
|
|
2037
2041
|
});
|
|
2038
2042
|
}
|
|
2039
|
-
function $e8ffe11ed01df0fe$var$make_srcset(url, resolutions) {
|
|
2040
|
-
return resolutions.map(width => `${$e8ffe11ed01df0fe$
|
|
2043
|
+
function $e8ffe11ed01df0fe$var$make_srcset(url, resolutions, customGenerateImageUrl_) {
|
|
2044
|
+
return resolutions.map(width => `${(customGenerateImageUrl_ || $e8ffe11ed01df0fe$export$1d6267828870adda)(url, width)} ${width}w`).join(", ");
|
|
2041
2045
|
}
|
|
2042
|
-
function $e8ffe11ed01df0fe$
|
|
2046
|
+
function $e8ffe11ed01df0fe$export$1d6267828870adda(url, width) {
|
|
2043
2047
|
// Even just creating one `URL` object per image src and then setting the search parameter is quite slow (0.25ms to set the width param)
|
|
2044
2048
|
// We're making the assumptions that the url has already at least one query parameter and that the image resizing service will choose the last one out of a duplicate width parameter (shopify's does)
|
|
2045
2049
|
// That way we can just to string concatenation which is insanely fast
|
|
@@ -2100,14 +2104,20 @@ function $660070e2a394b3c3$export$e4b984597b71e989(props) {
|
|
|
2100
2104
|
return container;
|
|
2101
2105
|
}
|
|
2102
2106
|
function $4f16612bea257571$export$9d4a4b669b1929ab(props) {
|
|
2103
|
-
const src = $i7OB2$createMemo(() => {
|
|
2104
|
-
const urlObject = new URL(`https://img.depict.ai/ResizeImage/${props.merchant_}?format=webp`);
|
|
2105
|
-
urlObject.searchParams.set("url", props.src);
|
|
2106
|
-
return urlObject.href;
|
|
2107
|
-
});
|
|
2108
2107
|
return $i7OB2$createComponent((0, $660070e2a394b3c3$export$e4b984597b71e989), $i7OB2$mergeProps(props, {
|
|
2109
|
-
get
|
|
2110
|
-
return
|
|
2108
|
+
get imgProps() {
|
|
2109
|
+
return {
|
|
2110
|
+
...props.imgProps,
|
|
2111
|
+
customGenerateImageUrl_: (url, width // Apparently don't have to encode url for CF's service
|
|
2112
|
+
) => {
|
|
2113
|
+
if (url.startsWith("https://cdn.shopify.com"))
|
|
2114
|
+
// The shopify image resizing CDN blocks Cloudflare's image resizer. It's possible that we can't detect shopify image URLs sometimes because they go to the merchant's domain,
|
|
2115
|
+
// but it seems like the URLs returned by the Depict API always goes to the cdn.shopify.com version of an image, so this simple workaround works.
|
|
2116
|
+
return $e8ffe11ed01df0fe$export$1d6267828870adda(url, width);
|
|
2117
|
+
// Use cloudflare image resizer instead of img.depict.ai because it's a lot faster (and also auto-chooses other formats if webp is not supported)
|
|
2118
|
+
return `https://app.depict.ai/cdn-cgi/image/width=${width},format=auto/${url}`;
|
|
2119
|
+
}
|
|
2120
|
+
};
|
|
2111
2121
|
}
|
|
2112
2122
|
}));
|
|
2113
2123
|
}
|