@loczer/storefront-sdk 0.202.0 → 0.203.0
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/dist/index.d.ts +2 -1
- package/dist/lib/storefrontImage.d.ts +2 -1
- package/dist/lib/storefrontImage.d.ts.map +1 -1
- package/dist/lib/storefrontImage.js +13 -7
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/HomePage.js +227 -226
- package/dist/storefront.css +1 -1
- package/dist/ui/day-picker.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -925,7 +925,7 @@ export declare const buildStorefrontCartSummary: (params: {
|
|
|
925
925
|
estimatedDays?: number;
|
|
926
926
|
}) => StorefrontCartSummary;
|
|
927
927
|
|
|
928
|
-
export declare const buildStorefrontImageUrl: (imageId: string, storeSlug: string) => string;
|
|
928
|
+
export declare const buildStorefrontImageUrl: (imageId: string, storeSlug: string, width?: number) => string;
|
|
929
929
|
|
|
930
930
|
export declare const buildStorefrontProductSlug: ({ id, productShortCode, name, }: {
|
|
931
931
|
id: string;
|
|
@@ -4739,6 +4739,7 @@ export declare type StorefrontImageRequestPayload = z.infer<typeof storefrontIma
|
|
|
4739
4739
|
export declare const storefrontImageRequestSchema: z.ZodObject<{
|
|
4740
4740
|
imageId: z.ZodString;
|
|
4741
4741
|
storeSlug: z.ZodString;
|
|
4742
|
+
w: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
4742
4743
|
}, z.core.$strip>;
|
|
4743
4744
|
|
|
4744
4745
|
export declare type StorefrontLocalizedRichText = z.infer<typeof storefrontLocalizedRichTextSchema>;
|
|
@@ -3,8 +3,9 @@ export declare const ROUTE = "/api/public/storefront/images/get";
|
|
|
3
3
|
export declare const requestSchema: z.ZodObject<{
|
|
4
4
|
imageId: z.ZodString;
|
|
5
5
|
storeSlug: z.ZodString;
|
|
6
|
+
w: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
6
7
|
}, z.core.$strip>;
|
|
7
8
|
export type RequestPayload = z.infer<typeof requestSchema>;
|
|
8
9
|
export type StorefrontImageRequestPayload = RequestPayload;
|
|
9
|
-
export declare const buildStorefrontImageUrl: (imageId: string, storeSlug: string) => string;
|
|
10
|
+
export declare const buildStorefrontImageUrl: (imageId: string, storeSlug: string, width?: number) => string;
|
|
10
11
|
//# sourceMappingURL=storefrontImage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storefrontImage.d.ts","sourceRoot":"","sources":["../../src/lib/storefrontImage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,eAAO,MAAM,KAAK,sCAAsC,CAAA;AAExD,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"storefrontImage.d.ts","sourceRoot":"","sources":["../../src/lib/storefrontImage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,eAAO,MAAM,KAAK,sCAAsC,CAAA;AAExD,eAAO,MAAM,aAAa;;;;iBAIxB,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAC1D,MAAM,MAAM,6BAA6B,GAAG,cAAc,CAAA;AAE1D,eAAO,MAAM,uBAAuB,GAAI,SAAS,MAAM,EAAE,WAAW,MAAM,EAAE,QAAQ,MAAM,KAAG,MAc5F,CAAA"}
|
|
@@ -2,13 +2,19 @@ import { z as e } from "zod";
|
|
|
2
2
|
//#region src/lib/storefrontImage.ts
|
|
3
3
|
var t = e.string().trim().regex(/^[a-f0-9]{24}$/i), n = e.string().trim().min(1).toLowerCase(), r = "/api/public/storefront/images/get", i = e.object({
|
|
4
4
|
imageId: t,
|
|
5
|
-
storeSlug: n
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
storeSlug: n,
|
|
6
|
+
w: e.coerce.number().int().min(1).max(4096).optional()
|
|
7
|
+
}), a = (e, t, n) => {
|
|
8
|
+
let i = e.trim();
|
|
9
|
+
if (!i) return "";
|
|
10
|
+
if (!/^[a-f0-9]{24}$/i.test(i)) return i;
|
|
11
|
+
let a = t.trim().toLowerCase();
|
|
12
|
+
if (!a) return i;
|
|
13
|
+
let o = new URLSearchParams({
|
|
14
|
+
imageId: i,
|
|
15
|
+
storeSlug: a
|
|
16
|
+
});
|
|
17
|
+
return typeof n == "number" && Number.isInteger(n) && n > 0 && n <= 4096 && o.set("w", String(n)), `${r}?${o.toString()}`;
|
|
12
18
|
};
|
|
13
19
|
//#endregion
|
|
14
20
|
export { r as ROUTE, a as buildStorefrontImageUrl, i as requestSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../src/pages/HomePage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../src/pages/HomePage.tsx"],"names":[],"mappings":"AA0IA,MAAM,CAAC,OAAO,UAAU,QAAQ,4CA8uB/B"}
|