@storepecker/storefront-core 2.9.1 → 2.10.1
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/address-BdIB6IuI.d.cts +42 -0
- package/dist/address-BdIB6IuI.d.ts +42 -0
- package/dist/api/index.cjs +36 -32
- package/dist/api/index.d.cts +20 -17
- package/dist/api/index.d.ts +20 -17
- package/dist/api/index.js +4 -4
- package/dist/{buy-now-BqVWXyy8.d.cts → buy-now-CDug6LJ_.d.ts} +2 -2
- package/dist/{buy-now-DFdnuLjO.d.ts → buy-now-DrKY5_9R.d.cts} +2 -2
- package/dist/checkout/index.cjs +163 -76
- package/dist/checkout/index.d.cts +37 -26
- package/dist/checkout/index.d.ts +37 -26
- package/dist/checkout/index.js +50 -64
- package/dist/checkout-totals-CbmXM9L7.d.cts +220 -0
- package/dist/checkout-totals-DU8l-Wyb.d.ts +220 -0
- package/dist/{chunk-IG4BW3ZB.cjs → chunk-32X4SWN4.cjs} +3 -3
- package/dist/{chunk-NQZ5GUOG.cjs → chunk-3YPE6UPC.cjs} +24 -16
- package/dist/{chunk-RDUT4W3B.cjs → chunk-6APRQ2ED.cjs} +4 -1
- package/dist/{chunk-ICKTXS6B.js → chunk-6IXTFZFS.js} +3 -3
- package/dist/{chunk-7M5CVYZJ.js → chunk-A7EI7XLU.js} +8 -1
- package/dist/chunk-DZPK7GPG.js +601 -0
- package/dist/{chunk-TH7OAMGC.js → chunk-E4D4XOAE.js} +24 -16
- package/dist/{chunk-NRPK5GCJ.cjs → chunk-EFYAFXIS.cjs} +3 -3
- package/dist/{chunk-CBKJ3Y2I.js → chunk-EWZ7TGI7.js} +11 -1
- package/dist/{chunk-5XVHYPOC.js → chunk-FF5N7PTB.js} +1 -1
- package/dist/{chunk-NOT6VKXA.cjs → chunk-H6UZTS5O.cjs} +67 -23
- package/dist/{chunk-XFOUNOKO.cjs → chunk-KNG4OMS5.cjs} +8 -0
- package/dist/{chunk-ZAWZ3RB6.js → chunk-NNE42NMP.js} +1 -1
- package/dist/chunk-PN6KH5PX.cjs +661 -0
- package/dist/{chunk-QQHQTBAM.js → chunk-QSRVMOXT.js} +48 -6
- package/dist/{chunk-W6BDMNSU.js → chunk-QVO56X4E.js} +1 -1
- package/dist/{chunk-6LS5F4R3.cjs → chunk-SGJUMI3M.cjs} +11 -0
- package/dist/{chunk-YLLAP3H2.cjs → chunk-SGKLMS7W.cjs} +2 -2
- package/dist/{chunk-ZGMLOLTC.js → chunk-VRZRV2BR.js} +4 -1
- package/dist/{chunk-IVKJJLG7.cjs → chunk-WWJAPKRQ.cjs} +8 -8
- package/dist/{collections-CXgOv5_G.d.cts → collections-CKNFcE2d.d.cts} +1 -1
- package/dist/{collections-CNh2OGbl.d.ts → collections-CtRKsWVx.d.ts} +1 -1
- package/dist/components/address-form.cjs +6 -6
- package/dist/components/address-form.d.cts +10 -6
- package/dist/components/address-form.d.ts +10 -6
- package/dist/components/address-form.js +5 -5
- package/dist/components/digital-product-download-modal.d.cts +2 -2
- package/dist/components/digital-product-download-modal.d.ts +2 -2
- package/dist/components/index.cjs +8 -8
- package/dist/components/index.d.cts +6 -7
- package/dist/components/index.d.ts +6 -7
- package/dist/components/index.js +6 -6
- package/dist/components/search-dropdown.d.cts +4 -4
- package/dist/components/search-dropdown.d.ts +4 -4
- package/dist/components/share-button.cjs +3 -3
- package/dist/components/share-button.d.cts +1 -1
- package/dist/components/share-button.d.ts +1 -1
- package/dist/components/share-button.js +2 -2
- package/dist/components/theme-data-initializer.d.cts +4 -5
- package/dist/components/theme-data-initializer.d.ts +4 -5
- package/dist/hooks/index.cjs +672 -44
- package/dist/hooks/index.d.cts +239 -13
- package/dist/hooks/index.d.ts +239 -13
- package/dist/hooks/index.js +630 -11
- package/dist/{instagram-DalreBu6.d.cts → instagram-CSzrxk10.d.cts} +8 -2
- package/dist/{instagram-BADLnNQ3.d.ts → instagram-CagTLmyq.d.ts} +8 -2
- package/dist/models/index.d.cts +8 -8
- package/dist/models/index.d.ts +8 -8
- package/dist/orders-B6BmHCJN.d.ts +337 -0
- package/dist/orders-ZKP0lqRN.d.cts +337 -0
- package/dist/pincode-8u7yWLpQ.d.cts +29 -0
- package/dist/pincode-8u7yWLpQ.d.ts +29 -0
- package/dist/{pixelEvents-LsealscG.d.ts → pixelEvents-DqJ_CEEr.d.ts} +4 -4
- package/dist/{pixelEvents-BtEO5QAR.d.cts → pixelEvents-bahgVW4_.d.cts} +4 -4
- package/dist/{product-D9liEtl4.d.cts → product-D4kol-Z-.d.cts} +26 -2
- package/dist/{product-D9liEtl4.d.ts → product-D4kol-Z-.d.ts} +26 -2
- package/dist/store/index.cjs +20 -30
- package/dist/store/index.d.cts +21 -7
- package/dist/store/index.d.ts +21 -7
- package/dist/store/index.js +9 -26
- package/dist/{useAddressForm-DGbEn91-.d.cts → useAddressForm-fMOb5Z-a.d.ts} +6 -1
- package/dist/{useAddressForm-cO3Au33k.d.ts → useAddressForm-wleIo78M.d.cts} +6 -1
- package/dist/utils/index.cjs +60 -56
- package/dist/utils/index.d.cts +24 -9
- package/dist/utils/index.d.ts +24 -9
- package/dist/utils/index.js +4 -4
- package/dist/{wishlist-Cj0sQxiY.d.ts → wishlist-L3fM5-ie.d.ts} +1 -1
- package/dist/{wishlist-BakHvIFN.d.cts → wishlist-_0x0r1jt.d.cts} +1 -1
- package/package.json +1 -1
- package/dist/address-DwBZHzbI.d.cts +0 -19
- package/dist/address-DwBZHzbI.d.ts +0 -19
- package/dist/cart-DZq1ZEnE.d.ts +0 -153
- package/dist/cart-DwMFBmpC.d.cts +0 -153
- package/dist/chunk-34Y7Y5FU.cjs +0 -246
- package/dist/chunk-VPTN4YXD.js +0 -232
- package/dist/orders-B3G4CyhH.d.cts +0 -166
- package/dist/orders-Bl-Slh72.d.ts +0 -166
package/dist/store/index.d.cts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as zustand from 'zustand';
|
|
2
|
-
import { a as CartState, C as Cart, U as User } from '../
|
|
3
|
-
import { f as ProductDetail, d as Product } from '../product-
|
|
4
|
-
import { W as Wishlist } from '../wishlist-
|
|
5
|
-
import { P as PageHeaderProps } from '../pixelEvents-
|
|
2
|
+
import { a as CartState, C as Cart, U as User } from '../orders-ZKP0lqRN.cjs';
|
|
3
|
+
import { f as ProductDetail, d as Product } from '../product-D4kol-Z-.cjs';
|
|
4
|
+
import { W as Wishlist } from '../wishlist-_0x0r1jt.cjs';
|
|
5
|
+
import { P as PageHeaderProps } from '../pixelEvents-bahgVW4_.cjs';
|
|
6
6
|
import 'react-toastify';
|
|
7
|
-
import '../collections-
|
|
8
|
-
import '../orders-B3G4CyhH.cjs';
|
|
7
|
+
import '../collections-CKNFcE2d.cjs';
|
|
9
8
|
|
|
10
9
|
interface CartStore extends CartState {
|
|
11
10
|
setCart: (cart: Cart.Root) => void;
|
|
@@ -68,11 +67,26 @@ declare const useAuthStore: zustand.UseBoundStore<zustand.StoreApi<AuthStore>>;
|
|
|
68
67
|
declare const loginUser: (user: User.LoginUserData) => Promise<void>;
|
|
69
68
|
|
|
70
69
|
interface WishlistStore extends Wishlist.Root {
|
|
70
|
+
/** Whether the server wishlist has been loaded into the store this session. */
|
|
71
|
+
loaded: boolean;
|
|
71
72
|
setWishlist: (wishlist: Wishlist.Root) => void;
|
|
72
73
|
resetWishlist: () => void;
|
|
73
74
|
syncWishlist: () => Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Removes the given variants from the wishlist if they're on it — called
|
|
77
|
+
* after they're added to the cart, so a carted item doesn't stay wishlisted.
|
|
78
|
+
* Logged-in only (guests have no server wishlist). Resolves `false` when the
|
|
79
|
+
* wishlist couldn't be updated, so the theme can tell the shopper; never throws.
|
|
80
|
+
*/
|
|
81
|
+
removeAddedFromWishlist: (variantIds: number[]) => Promise<boolean>;
|
|
74
82
|
}
|
|
75
83
|
declare const useWishlistStore: zustand.UseBoundStore<zustand.StoreApi<WishlistStore>>;
|
|
84
|
+
/**
|
|
85
|
+
* Whether a variant is wishlisted. Reads the store once it's loaded, so every
|
|
86
|
+
* heart for the same product stays in sync (e.g. after add-to-cart removes it);
|
|
87
|
+
* until then falls back to the value the product payload came with.
|
|
88
|
+
*/
|
|
89
|
+
declare function useIsWishlisted(variantId: number | undefined, initial?: boolean): boolean;
|
|
76
90
|
|
|
77
91
|
interface ProductStore extends Product.ProductState {
|
|
78
92
|
fetchProducts: (filter: Product.ProductFilter) => Promise<void>;
|
|
@@ -86,4 +100,4 @@ interface ThemeStore {
|
|
|
86
100
|
}
|
|
87
101
|
declare const useThemeData: zustand.UseBoundStore<zustand.StoreApi<ThemeStore>>;
|
|
88
102
|
|
|
89
|
-
export { loginUser, useAuthStore, useCartStore, useProductStore, useThemeData, useWishlistStore };
|
|
103
|
+
export { loginUser, useAuthStore, useCartStore, useIsWishlisted, useProductStore, useThemeData, useWishlistStore };
|
package/dist/store/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as zustand from 'zustand';
|
|
2
|
-
import { a as CartState, C as Cart, U as User } from '../
|
|
3
|
-
import { f as ProductDetail, d as Product } from '../product-
|
|
4
|
-
import { W as Wishlist } from '../wishlist-
|
|
5
|
-
import { P as PageHeaderProps } from '../pixelEvents-
|
|
2
|
+
import { a as CartState, C as Cart, U as User } from '../orders-B6BmHCJN.js';
|
|
3
|
+
import { f as ProductDetail, d as Product } from '../product-D4kol-Z-.js';
|
|
4
|
+
import { W as Wishlist } from '../wishlist-L3fM5-ie.js';
|
|
5
|
+
import { P as PageHeaderProps } from '../pixelEvents-DqJ_CEEr.js';
|
|
6
6
|
import 'react-toastify';
|
|
7
|
-
import '../collections-
|
|
8
|
-
import '../orders-Bl-Slh72.js';
|
|
7
|
+
import '../collections-CtRKsWVx.js';
|
|
9
8
|
|
|
10
9
|
interface CartStore extends CartState {
|
|
11
10
|
setCart: (cart: Cart.Root) => void;
|
|
@@ -68,11 +67,26 @@ declare const useAuthStore: zustand.UseBoundStore<zustand.StoreApi<AuthStore>>;
|
|
|
68
67
|
declare const loginUser: (user: User.LoginUserData) => Promise<void>;
|
|
69
68
|
|
|
70
69
|
interface WishlistStore extends Wishlist.Root {
|
|
70
|
+
/** Whether the server wishlist has been loaded into the store this session. */
|
|
71
|
+
loaded: boolean;
|
|
71
72
|
setWishlist: (wishlist: Wishlist.Root) => void;
|
|
72
73
|
resetWishlist: () => void;
|
|
73
74
|
syncWishlist: () => Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Removes the given variants from the wishlist if they're on it — called
|
|
77
|
+
* after they're added to the cart, so a carted item doesn't stay wishlisted.
|
|
78
|
+
* Logged-in only (guests have no server wishlist). Resolves `false` when the
|
|
79
|
+
* wishlist couldn't be updated, so the theme can tell the shopper; never throws.
|
|
80
|
+
*/
|
|
81
|
+
removeAddedFromWishlist: (variantIds: number[]) => Promise<boolean>;
|
|
74
82
|
}
|
|
75
83
|
declare const useWishlistStore: zustand.UseBoundStore<zustand.StoreApi<WishlistStore>>;
|
|
84
|
+
/**
|
|
85
|
+
* Whether a variant is wishlisted. Reads the store once it's loaded, so every
|
|
86
|
+
* heart for the same product stays in sync (e.g. after add-to-cart removes it);
|
|
87
|
+
* until then falls back to the value the product payload came with.
|
|
88
|
+
*/
|
|
89
|
+
declare function useIsWishlisted(variantId: number | undefined, initial?: boolean): boolean;
|
|
76
90
|
|
|
77
91
|
interface ProductStore extends Product.ProductState {
|
|
78
92
|
fetchProducts: (filter: Product.ProductFilter) => Promise<void>;
|
|
@@ -86,4 +100,4 @@ interface ThemeStore {
|
|
|
86
100
|
}
|
|
87
101
|
declare const useThemeData: zustand.UseBoundStore<zustand.StoreApi<ThemeStore>>;
|
|
88
102
|
|
|
89
|
-
export { loginUser, useAuthStore, useCartStore, useProductStore, useThemeData, useWishlistStore };
|
|
103
|
+
export { loginUser, useAuthStore, useCartStore, useIsWishlisted, useProductStore, useThemeData, useWishlistStore };
|
package/dist/store/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { loginUser, useAuthStore, useCartStore } from '../chunk-
|
|
2
|
-
import {
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { loginUser, useAuthStore, useCartStore, useIsWishlisted, useWishlistStore } from '../chunk-QSRVMOXT.js';
|
|
2
|
+
import { getProducts } from '../chunk-NNE42NMP.js';
|
|
3
|
+
import '../chunk-E4D4XOAE.js';
|
|
4
4
|
import '../chunk-KCLVR6G5.js';
|
|
5
5
|
export { useThemeData } from '../chunk-5NUDTIQ2.js';
|
|
6
6
|
import '../chunk-3SYYP3XV.js';
|
|
@@ -10,27 +10,6 @@ import '../chunk-JQMLHRWL.js';
|
|
|
10
10
|
import { create } from 'zustand';
|
|
11
11
|
|
|
12
12
|
var initialState = {
|
|
13
|
-
wishlist_count: 0,
|
|
14
|
-
product_variants: []
|
|
15
|
-
};
|
|
16
|
-
var useWishlistStore = create((set) => ({
|
|
17
|
-
...initialState,
|
|
18
|
-
setWishlist: (wishlist) => set(wishlist),
|
|
19
|
-
resetWishlist: () => set(initialState),
|
|
20
|
-
syncWishlist: async () => {
|
|
21
|
-
try {
|
|
22
|
-
const response = await getWishlist("/customer/wishlist/");
|
|
23
|
-
if (response.data) {
|
|
24
|
-
set({
|
|
25
|
-
wishlist_count: response.data.wishlist_count,
|
|
26
|
-
product_variants: response.data.product_variants
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
} catch {
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}));
|
|
33
|
-
var initialState2 = {
|
|
34
13
|
data: [],
|
|
35
14
|
status: "loading" /* LOADING */,
|
|
36
15
|
hasMore: false,
|
|
@@ -39,15 +18,18 @@ var initialState2 = {
|
|
|
39
18
|
page_size: 10
|
|
40
19
|
}
|
|
41
20
|
};
|
|
21
|
+
var latestProductRequest = 0;
|
|
42
22
|
var useProductStore = create((set, get) => ({
|
|
43
|
-
...
|
|
23
|
+
...initialState,
|
|
44
24
|
fetchProducts: async (filter) => {
|
|
25
|
+
const requestId = ++latestProductRequest;
|
|
45
26
|
set((state) => ({
|
|
46
27
|
status: "loading" /* LOADING */,
|
|
47
28
|
data: filter.page === 1 ? [] : state.data
|
|
48
29
|
}));
|
|
49
30
|
try {
|
|
50
31
|
const response = await getProducts({ ...filter });
|
|
32
|
+
if (requestId !== latestProductRequest) return;
|
|
51
33
|
if (response.data) {
|
|
52
34
|
const { results, ...meta } = response.data;
|
|
53
35
|
set((state) => ({
|
|
@@ -59,10 +41,11 @@ var useProductStore = create((set, get) => ({
|
|
|
59
41
|
}));
|
|
60
42
|
}
|
|
61
43
|
} catch {
|
|
44
|
+
if (requestId !== latestProductRequest) return;
|
|
62
45
|
set({ status: "idle" /* IDLE */ });
|
|
63
46
|
}
|
|
64
47
|
},
|
|
65
48
|
setGatePasses: (products) => set({ data: products })
|
|
66
49
|
}));
|
|
67
50
|
|
|
68
|
-
export { useProductStore
|
|
51
|
+
export { useProductStore };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChangeEvent } from 'react';
|
|
2
2
|
import { useFormik } from 'formik';
|
|
3
|
-
import { A as Address } from './address-
|
|
3
|
+
import { A as Address } from './address-BdIB6IuI.js';
|
|
4
4
|
|
|
5
5
|
interface UseAddressFormOptions {
|
|
6
6
|
/** Existing address for edit mode. When provided, form prefills from this address. */
|
|
@@ -37,6 +37,11 @@ interface UseAddressFormReturn {
|
|
|
37
37
|
isSubmitting: boolean;
|
|
38
38
|
isEditing: boolean;
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated Use `useCountryAwareAddressForm`: per-country address formats,
|
|
42
|
+
* postcode rules, pincode lookup, and it hands the payload back instead of
|
|
43
|
+
* saving it. This hook will be removed in 3.0.0.
|
|
44
|
+
*/
|
|
40
45
|
declare function useAddressForm(options?: UseAddressFormOptions): UseAddressFormReturn;
|
|
41
46
|
|
|
42
47
|
export { type UseAddressFormOptions as U, type UseAddressFormReturn as a, useAddressForm as u };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChangeEvent } from 'react';
|
|
2
2
|
import { useFormik } from 'formik';
|
|
3
|
-
import { A as Address } from './address-
|
|
3
|
+
import { A as Address } from './address-BdIB6IuI.cjs';
|
|
4
4
|
|
|
5
5
|
interface UseAddressFormOptions {
|
|
6
6
|
/** Existing address for edit mode. When provided, form prefills from this address. */
|
|
@@ -37,6 +37,11 @@ interface UseAddressFormReturn {
|
|
|
37
37
|
isSubmitting: boolean;
|
|
38
38
|
isEditing: boolean;
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated Use `useCountryAwareAddressForm`: per-country address formats,
|
|
42
|
+
* postcode rules, pincode lookup, and it hands the payload back instead of
|
|
43
|
+
* saving it. This hook will be removed in 3.0.0.
|
|
44
|
+
*/
|
|
40
45
|
declare function useAddressForm(options?: UseAddressFormOptions): UseAddressFormReturn;
|
|
41
46
|
|
|
42
47
|
export { type UseAddressFormOptions as U, type UseAddressFormReturn as a, useAddressForm as u };
|
package/dist/utils/index.cjs
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
var chunk57UU7IJ2_cjs = require('../chunk-57UU7IJ2.cjs');
|
|
4
4
|
var chunk2AHH3XBW_cjs = require('../chunk-2AHH3XBW.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunk3YPE6UPC_cjs = require('../chunk-3YPE6UPC.cjs');
|
|
6
6
|
var chunkNSAHGMS7_cjs = require('../chunk-NSAHGMS7.cjs');
|
|
7
|
-
var
|
|
8
|
-
var chunk6LS5F4R3_cjs = require('../chunk-6LS5F4R3.cjs');
|
|
7
|
+
var chunkSGJUMI3M_cjs = require('../chunk-SGJUMI3M.cjs');
|
|
9
8
|
var chunkBBRB475I_cjs = require('../chunk-BBRB475I.cjs');
|
|
9
|
+
var chunkLJUGNSQQ_cjs = require('../chunk-LJUGNSQQ.cjs');
|
|
10
10
|
var chunkBBRXE57K_cjs = require('../chunk-BBRXE57K.cjs');
|
|
11
11
|
var chunkNE3ZHELZ_cjs = require('../chunk-NE3ZHELZ.cjs');
|
|
12
12
|
var chunkN3CTXRFT_cjs = require('../chunk-N3CTXRFT.cjs');
|
|
@@ -87,7 +87,7 @@ var constructPaymentPayload = async (amount, orderId, userId, phoneNumber, merch
|
|
|
87
87
|
const dataPayload = JSON.stringify(paymentPayload);
|
|
88
88
|
console.log(dataPayload);
|
|
89
89
|
const dataBase64 = Buffer.from(dataPayload).toString("base64");
|
|
90
|
-
const checksum = await
|
|
90
|
+
const checksum = await chunkSGJUMI3M_cjs.digestMessage(`${dataBase64}/pg/v1/pay${saltKey}`);
|
|
91
91
|
const finalChecksum = `${checksum}###${saltIndex}`;
|
|
92
92
|
return {
|
|
93
93
|
base64Payload: dataBase64,
|
|
@@ -95,7 +95,7 @@ var constructPaymentPayload = async (amount, orderId, userId, phoneNumber, merch
|
|
|
95
95
|
};
|
|
96
96
|
};
|
|
97
97
|
var createXVerifyHeader = async (merchantId, transactionId, saltKey, saltIndex) => {
|
|
98
|
-
const checksum = await
|
|
98
|
+
const checksum = await chunkSGJUMI3M_cjs.digestMessage(
|
|
99
99
|
`/pg/v1/status/${merchantId}/${transactionId}${saltKey}`
|
|
100
100
|
);
|
|
101
101
|
const finalChecksum = `${checksum}###${saltIndex}`;
|
|
@@ -355,103 +355,71 @@ Object.defineProperty(exports, "isVariantCombinationAvailable", {
|
|
|
355
355
|
});
|
|
356
356
|
Object.defineProperty(exports, "LocalCart", {
|
|
357
357
|
enumerable: true,
|
|
358
|
-
get: function () { return
|
|
358
|
+
get: function () { return chunk3YPE6UPC_cjs.cart_default; }
|
|
359
359
|
});
|
|
360
360
|
Object.defineProperty(exports, "pixelEvents", {
|
|
361
361
|
enumerable: true,
|
|
362
362
|
get: function () { return chunkNSAHGMS7_cjs.pixelEvents; }
|
|
363
363
|
});
|
|
364
|
-
Object.defineProperty(exports, "CacheManager", {
|
|
365
|
-
enumerable: true,
|
|
366
|
-
get: function () { return chunkLJUGNSQQ_cjs.CacheManager; }
|
|
367
|
-
});
|
|
368
|
-
Object.defineProperty(exports, "cache", {
|
|
369
|
-
enumerable: true,
|
|
370
|
-
get: function () { return chunkLJUGNSQQ_cjs.cache; }
|
|
371
|
-
});
|
|
372
|
-
Object.defineProperty(exports, "clearCache", {
|
|
373
|
-
enumerable: true,
|
|
374
|
-
get: function () { return chunkLJUGNSQQ_cjs.clearCache; }
|
|
375
|
-
});
|
|
376
|
-
Object.defineProperty(exports, "deleteCache", {
|
|
377
|
-
enumerable: true,
|
|
378
|
-
get: function () { return chunkLJUGNSQQ_cjs.deleteCache; }
|
|
379
|
-
});
|
|
380
|
-
Object.defineProperty(exports, "generateCacheKey", {
|
|
381
|
-
enumerable: true,
|
|
382
|
-
get: function () { return chunkLJUGNSQQ_cjs.generateCacheKey; }
|
|
383
|
-
});
|
|
384
|
-
Object.defineProperty(exports, "getCache", {
|
|
385
|
-
enumerable: true,
|
|
386
|
-
get: function () { return chunkLJUGNSQQ_cjs.getCache; }
|
|
387
|
-
});
|
|
388
|
-
Object.defineProperty(exports, "hasCache", {
|
|
389
|
-
enumerable: true,
|
|
390
|
-
get: function () { return chunkLJUGNSQQ_cjs.hasCache; }
|
|
391
|
-
});
|
|
392
|
-
Object.defineProperty(exports, "invalidateCache", {
|
|
393
|
-
enumerable: true,
|
|
394
|
-
get: function () { return chunkLJUGNSQQ_cjs.invalidateCache; }
|
|
395
|
-
});
|
|
396
|
-
Object.defineProperty(exports, "setCache", {
|
|
397
|
-
enumerable: true,
|
|
398
|
-
get: function () { return chunkLJUGNSQQ_cjs.setCache; }
|
|
399
|
-
});
|
|
400
364
|
Object.defineProperty(exports, "constructFilter", {
|
|
401
365
|
enumerable: true,
|
|
402
|
-
get: function () { return
|
|
366
|
+
get: function () { return chunkSGJUMI3M_cjs.constructFilter; }
|
|
403
367
|
});
|
|
404
368
|
Object.defineProperty(exports, "convertObjectToParams", {
|
|
405
369
|
enumerable: true,
|
|
406
|
-
get: function () { return
|
|
370
|
+
get: function () { return chunkSGJUMI3M_cjs.convertObjectToParams; }
|
|
407
371
|
});
|
|
408
372
|
Object.defineProperty(exports, "convertToCurrency", {
|
|
409
373
|
enumerable: true,
|
|
410
|
-
get: function () { return
|
|
374
|
+
get: function () { return chunkSGJUMI3M_cjs.convertToCurrency; }
|
|
411
375
|
});
|
|
412
376
|
Object.defineProperty(exports, "digestMessage", {
|
|
413
377
|
enumerable: true,
|
|
414
|
-
get: function () { return
|
|
378
|
+
get: function () { return chunkSGJUMI3M_cjs.digestMessage; }
|
|
379
|
+
});
|
|
380
|
+
Object.defineProperty(exports, "focusFirstInvalidField", {
|
|
381
|
+
enumerable: true,
|
|
382
|
+
get: function () { return chunkSGJUMI3M_cjs.focusFirstInvalidField; }
|
|
415
383
|
});
|
|
416
384
|
Object.defineProperty(exports, "formatDateTime", {
|
|
417
385
|
enumerable: true,
|
|
418
|
-
get: function () { return
|
|
386
|
+
get: function () { return chunkSGJUMI3M_cjs.formatDateTime; }
|
|
419
387
|
});
|
|
420
388
|
Object.defineProperty(exports, "formatPostalLabel", {
|
|
421
389
|
enumerable: true,
|
|
422
|
-
get: function () { return
|
|
390
|
+
get: function () { return chunkSGJUMI3M_cjs.formatPostalLabel; }
|
|
423
391
|
});
|
|
424
392
|
Object.defineProperty(exports, "getAddressMeta", {
|
|
425
393
|
enumerable: true,
|
|
426
|
-
get: function () { return
|
|
394
|
+
get: function () { return chunkSGJUMI3M_cjs.getAddressMeta; }
|
|
427
395
|
});
|
|
428
396
|
Object.defineProperty(exports, "getDelayInMilliseconds", {
|
|
429
397
|
enumerable: true,
|
|
430
|
-
get: function () { return
|
|
398
|
+
get: function () { return chunkSGJUMI3M_cjs.getDelayInMilliseconds; }
|
|
431
399
|
});
|
|
432
400
|
Object.defineProperty(exports, "getOrderStatus", {
|
|
433
401
|
enumerable: true,
|
|
434
|
-
get: function () { return
|
|
402
|
+
get: function () { return chunkSGJUMI3M_cjs.getOrderStatus; }
|
|
435
403
|
});
|
|
436
404
|
Object.defineProperty(exports, "getParamsFromURL", {
|
|
437
405
|
enumerable: true,
|
|
438
|
-
get: function () { return
|
|
406
|
+
get: function () { return chunkSGJUMI3M_cjs.getParamsFromURL; }
|
|
439
407
|
});
|
|
440
408
|
Object.defineProperty(exports, "getQueryParams", {
|
|
441
409
|
enumerable: true,
|
|
442
|
-
get: function () { return
|
|
410
|
+
get: function () { return chunkSGJUMI3M_cjs.getQueryParams; }
|
|
443
411
|
});
|
|
444
412
|
Object.defineProperty(exports, "pluralize", {
|
|
445
413
|
enumerable: true,
|
|
446
|
-
get: function () { return
|
|
414
|
+
get: function () { return chunkSGJUMI3M_cjs.pluralize; }
|
|
447
415
|
});
|
|
448
416
|
Object.defineProperty(exports, "pushParamsToURL", {
|
|
449
417
|
enumerable: true,
|
|
450
|
-
get: function () { return
|
|
418
|
+
get: function () { return chunkSGJUMI3M_cjs.pushParamsToURL; }
|
|
451
419
|
});
|
|
452
420
|
Object.defineProperty(exports, "shareLink", {
|
|
453
421
|
enumerable: true,
|
|
454
|
-
get: function () { return
|
|
422
|
+
get: function () { return chunkSGJUMI3M_cjs.shareLink; }
|
|
455
423
|
});
|
|
456
424
|
Object.defineProperty(exports, "isExpired", {
|
|
457
425
|
enumerable: true,
|
|
@@ -461,6 +429,42 @@ Object.defineProperty(exports, "timeFromNow", {
|
|
|
461
429
|
enumerable: true,
|
|
462
430
|
get: function () { return chunkBBRB475I_cjs.timeFromNow; }
|
|
463
431
|
});
|
|
432
|
+
Object.defineProperty(exports, "CacheManager", {
|
|
433
|
+
enumerable: true,
|
|
434
|
+
get: function () { return chunkLJUGNSQQ_cjs.CacheManager; }
|
|
435
|
+
});
|
|
436
|
+
Object.defineProperty(exports, "cache", {
|
|
437
|
+
enumerable: true,
|
|
438
|
+
get: function () { return chunkLJUGNSQQ_cjs.cache; }
|
|
439
|
+
});
|
|
440
|
+
Object.defineProperty(exports, "clearCache", {
|
|
441
|
+
enumerable: true,
|
|
442
|
+
get: function () { return chunkLJUGNSQQ_cjs.clearCache; }
|
|
443
|
+
});
|
|
444
|
+
Object.defineProperty(exports, "deleteCache", {
|
|
445
|
+
enumerable: true,
|
|
446
|
+
get: function () { return chunkLJUGNSQQ_cjs.deleteCache; }
|
|
447
|
+
});
|
|
448
|
+
Object.defineProperty(exports, "generateCacheKey", {
|
|
449
|
+
enumerable: true,
|
|
450
|
+
get: function () { return chunkLJUGNSQQ_cjs.generateCacheKey; }
|
|
451
|
+
});
|
|
452
|
+
Object.defineProperty(exports, "getCache", {
|
|
453
|
+
enumerable: true,
|
|
454
|
+
get: function () { return chunkLJUGNSQQ_cjs.getCache; }
|
|
455
|
+
});
|
|
456
|
+
Object.defineProperty(exports, "hasCache", {
|
|
457
|
+
enumerable: true,
|
|
458
|
+
get: function () { return chunkLJUGNSQQ_cjs.hasCache; }
|
|
459
|
+
});
|
|
460
|
+
Object.defineProperty(exports, "invalidateCache", {
|
|
461
|
+
enumerable: true,
|
|
462
|
+
get: function () { return chunkLJUGNSQQ_cjs.invalidateCache; }
|
|
463
|
+
});
|
|
464
|
+
Object.defineProperty(exports, "setCache", {
|
|
465
|
+
enumerable: true,
|
|
466
|
+
get: function () { return chunkLJUGNSQQ_cjs.setCache; }
|
|
467
|
+
});
|
|
464
468
|
Object.defineProperty(exports, "Auth", {
|
|
465
469
|
enumerable: true,
|
|
466
470
|
get: function () { return chunkBBRXE57K_cjs.auth_default; }
|
package/dist/utils/index.d.cts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { f as ProductDetail, O as OperatingHours, T as TimeSlot, A as Attributes } from '../product-
|
|
2
|
-
export { h as ADDRESS_FORM_SESSION_KEY, i as ALLOWED_COUNTRIES, D as DEFAULT_TOAST_CONFIG, j as PRODUCT_STATUSES, g as SLICE_STATUS, U as USER_CART, k as USER_CREDENTIALS, l as USER_CRED_REFRESH_TOKEN, m as USER_CRED_TOKEN, p as pathNameMap } from '../product-
|
|
3
|
-
import { C as Cart } from '../
|
|
1
|
+
import { f as ProductDetail, O as OperatingHours, T as TimeSlot, A as Attributes } from '../product-D4kol-Z-.cjs';
|
|
2
|
+
export { h as ADDRESS_FORM_SESSION_KEY, i as ALLOWED_COUNTRIES, D as DEFAULT_TOAST_CONFIG, j as PRODUCT_STATUSES, g as SLICE_STATUS, U as USER_CART, k as USER_CREDENTIALS, l as USER_CRED_REFRESH_TOKEN, m as USER_CRED_TOKEN, p as pathNameMap } from '../product-D4kol-Z-.cjs';
|
|
3
|
+
import { C as Cart, O as Order } from '../orders-ZKP0lqRN.cjs';
|
|
4
4
|
export { S as SnapstoreConfig, g as getApiEndpoint, a as getCloudFront, b as getConfig, c as getPhonePeApiEndpoint, d as getPublicApiEndpoint, e as getSecretKey, f as getStoreId, i as initConfig } from '../index-DTyIuLuI.cjs';
|
|
5
|
-
import { S as SectionFilters } from '../pixelEvents-
|
|
6
|
-
export { A as AvailableFilter, B as Banner, a as Blogs, C as Category, b as CategoryHighlights, c as Collections, d as ColorScheme, F as FilterOption, e as FilterType, f as Footer, H as HeaderCategory, g as Hero, h as HomePageContents, I as ImageWithText, L as LocationData, i as Logo, M as Menuitem, N as NavBar, j as NavElement, k as NavElementOld, P as PageHeaderProps, l as PageMeta, m as PageProps, n as PagePropsFull, o as PreFooter, p as ProductCollection, q as ProductHighlight, R as RibbonBar, r as RibbonMessage, s as Section, t as SectionType, u as SliderSettings, v as SocialLinks, w as SocialMedia, x as StoreReview, y as SubCategory, z as SubCategorySection, T as TemplateTheme, D as Theme, V as ValueHighlights, E as pixelEvents, G as preFooterContent } from '../pixelEvents-
|
|
7
|
-
import { O as Order } from '../orders-B3G4CyhH.cjs';
|
|
5
|
+
import { S as SectionFilters } from '../pixelEvents-bahgVW4_.cjs';
|
|
6
|
+
export { A as AvailableFilter, B as Banner, a as Blogs, C as Category, b as CategoryHighlights, c as Collections, d as ColorScheme, F as FilterOption, e as FilterType, f as Footer, H as HeaderCategory, g as Hero, h as HomePageContents, I as ImageWithText, L as LocationData, i as Logo, M as Menuitem, N as NavBar, j as NavElement, k as NavElementOld, P as PageHeaderProps, l as PageMeta, m as PageProps, n as PagePropsFull, o as PreFooter, p as ProductCollection, q as ProductHighlight, R as RibbonBar, r as RibbonMessage, s as Section, t as SectionType, u as SliderSettings, v as SocialLinks, w as SocialMedia, x as StoreReview, y as SubCategory, z as SubCategorySection, T as TemplateTheme, D as Theme, V as ValueHighlights, E as pixelEvents, G as preFooterContent } from '../pixelEvents-bahgVW4_.cjs';
|
|
8
7
|
import { AxiosResponse } from 'axios';
|
|
9
8
|
import { a as PhonePe } from '../phonepe-dWMLZel6.cjs';
|
|
10
9
|
import 'react-toastify';
|
|
11
|
-
import '../collections-
|
|
10
|
+
import '../collections-CKNFcE2d.cjs';
|
|
12
11
|
|
|
13
12
|
declare function setAuthTokenChangeCallback(callback: (token: string | undefined) => void): void;
|
|
14
13
|
declare const Auth: {
|
|
@@ -57,7 +56,14 @@ declare function generateCacheKey(endpoint: string, params?: Record<string, any>
|
|
|
57
56
|
declare const LocalCart: {
|
|
58
57
|
get(): Cart.Root | null;
|
|
59
58
|
set(cart: any): void;
|
|
60
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Adds `quantity` of `product`, capped so the line never goes past the
|
|
61
|
+
* product's stock: the guest cart isn't checked against the server until
|
|
62
|
+
* checkout, so repeated adds would otherwise pile up past what's available.
|
|
63
|
+
* Returns how many units were actually added (0 when at the limit or for a
|
|
64
|
+
* pre-order); compare it with the requested quantity to tell the shopper.
|
|
65
|
+
*/
|
|
66
|
+
add(product: ProductDetail.Root, quantity?: number): number;
|
|
61
67
|
remove(product: ProductDetail.Root): void;
|
|
62
68
|
updateQuantity(product: ProductDetail.Root, quantity: number): void;
|
|
63
69
|
clear(): void;
|
|
@@ -84,7 +90,9 @@ declare function pluralize(strings: TemplateStringsArray, count: number, singula
|
|
|
84
90
|
declare function digestMessage(message: string): Promise<string>;
|
|
85
91
|
declare const constructFilter: (filter: SectionFilters[]) => CustomObject;
|
|
86
92
|
declare const getDelayInMilliseconds: (value: number, unit: "hours" | "days" | "weeks" | "months" | "minutes" | "seconds") => number;
|
|
93
|
+
/** @deprecated Use `buildAddressFormat` / `loadAddressFormat` from `/checkout` (`postalLabel`). */
|
|
87
94
|
declare function formatPostalLabel(zipNameType?: string): string;
|
|
95
|
+
/** @deprecated Use `useAddressFormat` (`/hooks`) or `loadAddressFormat` (`/checkout`), which cache the metadata and add per-country overrides. */
|
|
88
96
|
declare function getAddressMeta(countryCode: string): Promise<{
|
|
89
97
|
regionLabel: any;
|
|
90
98
|
postalLabel: string;
|
|
@@ -94,6 +102,13 @@ declare function getOrderStatus(order: Order.Root | Order.OrderSummary): {
|
|
|
94
102
|
title: string;
|
|
95
103
|
info?: string;
|
|
96
104
|
};
|
|
105
|
+
/**
|
|
106
|
+
* Scrolls to and focuses the first form control whose `name` has an error.
|
|
107
|
+
* Fields absent from the DOM (e.g. a hidden postcode) are skipped.
|
|
108
|
+
*
|
|
109
|
+
* @param root Element to search in (e.g. the form); defaults to the document.
|
|
110
|
+
*/
|
|
111
|
+
declare function focusFirstInvalidField(errors: Record<string, unknown>, root?: ParentNode | null): void;
|
|
97
112
|
|
|
98
113
|
declare class PhonepePayment {
|
|
99
114
|
private readonly amount;
|
|
@@ -212,4 +227,4 @@ declare function isProductCustomized(customizationInputs: Array<{
|
|
|
212
227
|
[key: string]: any;
|
|
213
228
|
}> | undefined, productId: number): boolean;
|
|
214
229
|
|
|
215
|
-
export { Auth, CacheManager, LocalCart, PhonepePayment, SectionFilters, authRoutes, cache, calculateDiscountPercent, clearCache, constructFilter, convertObjectToParams, convertToCurrency, cropImage, debounce, deleteCache, digestMessage, findMatchingVariant, findSimilarVariant, formatBookingDateTime, formatDateTime, formatPostalLabel, generateCacheKey, generateTimeOptions, getAddressMeta, getAvailableDaysText, getCache, getDelayInMilliseconds, getNextAvailableDate, getOrderStatus, getParamsFromURL, getQueryParams, getTimeConstraints, getUniqueId, hasCache, invalidateCache, isAvailableDay, isColorVariantType, isExpired, isProductCustomized, isVariantCombinationAvailable, pluralize, protectedRoutes, publicRoutes, pushParamsToURL, setAuthTokenChangeCallback, setCache, shareLink, timeFromNow, urls };
|
|
230
|
+
export { Auth, CacheManager, LocalCart, PhonepePayment, SectionFilters, authRoutes, cache, calculateDiscountPercent, clearCache, constructFilter, convertObjectToParams, convertToCurrency, cropImage, debounce, deleteCache, digestMessage, findMatchingVariant, findSimilarVariant, focusFirstInvalidField, formatBookingDateTime, formatDateTime, formatPostalLabel, generateCacheKey, generateTimeOptions, getAddressMeta, getAvailableDaysText, getCache, getDelayInMilliseconds, getNextAvailableDate, getOrderStatus, getParamsFromURL, getQueryParams, getTimeConstraints, getUniqueId, hasCache, invalidateCache, isAvailableDay, isColorVariantType, isExpired, isProductCustomized, isVariantCombinationAvailable, pluralize, protectedRoutes, publicRoutes, pushParamsToURL, setAuthTokenChangeCallback, setCache, shareLink, timeFromNow, urls };
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { f as ProductDetail, O as OperatingHours, T as TimeSlot, A as Attributes } from '../product-
|
|
2
|
-
export { h as ADDRESS_FORM_SESSION_KEY, i as ALLOWED_COUNTRIES, D as DEFAULT_TOAST_CONFIG, j as PRODUCT_STATUSES, g as SLICE_STATUS, U as USER_CART, k as USER_CREDENTIALS, l as USER_CRED_REFRESH_TOKEN, m as USER_CRED_TOKEN, p as pathNameMap } from '../product-
|
|
3
|
-
import { C as Cart } from '../
|
|
1
|
+
import { f as ProductDetail, O as OperatingHours, T as TimeSlot, A as Attributes } from '../product-D4kol-Z-.js';
|
|
2
|
+
export { h as ADDRESS_FORM_SESSION_KEY, i as ALLOWED_COUNTRIES, D as DEFAULT_TOAST_CONFIG, j as PRODUCT_STATUSES, g as SLICE_STATUS, U as USER_CART, k as USER_CREDENTIALS, l as USER_CRED_REFRESH_TOKEN, m as USER_CRED_TOKEN, p as pathNameMap } from '../product-D4kol-Z-.js';
|
|
3
|
+
import { C as Cart, O as Order } from '../orders-B6BmHCJN.js';
|
|
4
4
|
export { S as SnapstoreConfig, g as getApiEndpoint, a as getCloudFront, b as getConfig, c as getPhonePeApiEndpoint, d as getPublicApiEndpoint, e as getSecretKey, f as getStoreId, i as initConfig } from '../index-DTyIuLuI.js';
|
|
5
|
-
import { S as SectionFilters } from '../pixelEvents-
|
|
6
|
-
export { A as AvailableFilter, B as Banner, a as Blogs, C as Category, b as CategoryHighlights, c as Collections, d as ColorScheme, F as FilterOption, e as FilterType, f as Footer, H as HeaderCategory, g as Hero, h as HomePageContents, I as ImageWithText, L as LocationData, i as Logo, M as Menuitem, N as NavBar, j as NavElement, k as NavElementOld, P as PageHeaderProps, l as PageMeta, m as PageProps, n as PagePropsFull, o as PreFooter, p as ProductCollection, q as ProductHighlight, R as RibbonBar, r as RibbonMessage, s as Section, t as SectionType, u as SliderSettings, v as SocialLinks, w as SocialMedia, x as StoreReview, y as SubCategory, z as SubCategorySection, T as TemplateTheme, D as Theme, V as ValueHighlights, E as pixelEvents, G as preFooterContent } from '../pixelEvents-
|
|
7
|
-
import { O as Order } from '../orders-Bl-Slh72.js';
|
|
5
|
+
import { S as SectionFilters } from '../pixelEvents-DqJ_CEEr.js';
|
|
6
|
+
export { A as AvailableFilter, B as Banner, a as Blogs, C as Category, b as CategoryHighlights, c as Collections, d as ColorScheme, F as FilterOption, e as FilterType, f as Footer, H as HeaderCategory, g as Hero, h as HomePageContents, I as ImageWithText, L as LocationData, i as Logo, M as Menuitem, N as NavBar, j as NavElement, k as NavElementOld, P as PageHeaderProps, l as PageMeta, m as PageProps, n as PagePropsFull, o as PreFooter, p as ProductCollection, q as ProductHighlight, R as RibbonBar, r as RibbonMessage, s as Section, t as SectionType, u as SliderSettings, v as SocialLinks, w as SocialMedia, x as StoreReview, y as SubCategory, z as SubCategorySection, T as TemplateTheme, D as Theme, V as ValueHighlights, E as pixelEvents, G as preFooterContent } from '../pixelEvents-DqJ_CEEr.js';
|
|
8
7
|
import { AxiosResponse } from 'axios';
|
|
9
8
|
import { a as PhonePe } from '../phonepe-dWMLZel6.js';
|
|
10
9
|
import 'react-toastify';
|
|
11
|
-
import '../collections-
|
|
10
|
+
import '../collections-CtRKsWVx.js';
|
|
12
11
|
|
|
13
12
|
declare function setAuthTokenChangeCallback(callback: (token: string | undefined) => void): void;
|
|
14
13
|
declare const Auth: {
|
|
@@ -57,7 +56,14 @@ declare function generateCacheKey(endpoint: string, params?: Record<string, any>
|
|
|
57
56
|
declare const LocalCart: {
|
|
58
57
|
get(): Cart.Root | null;
|
|
59
58
|
set(cart: any): void;
|
|
60
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Adds `quantity` of `product`, capped so the line never goes past the
|
|
61
|
+
* product's stock: the guest cart isn't checked against the server until
|
|
62
|
+
* checkout, so repeated adds would otherwise pile up past what's available.
|
|
63
|
+
* Returns how many units were actually added (0 when at the limit or for a
|
|
64
|
+
* pre-order); compare it with the requested quantity to tell the shopper.
|
|
65
|
+
*/
|
|
66
|
+
add(product: ProductDetail.Root, quantity?: number): number;
|
|
61
67
|
remove(product: ProductDetail.Root): void;
|
|
62
68
|
updateQuantity(product: ProductDetail.Root, quantity: number): void;
|
|
63
69
|
clear(): void;
|
|
@@ -84,7 +90,9 @@ declare function pluralize(strings: TemplateStringsArray, count: number, singula
|
|
|
84
90
|
declare function digestMessage(message: string): Promise<string>;
|
|
85
91
|
declare const constructFilter: (filter: SectionFilters[]) => CustomObject;
|
|
86
92
|
declare const getDelayInMilliseconds: (value: number, unit: "hours" | "days" | "weeks" | "months" | "minutes" | "seconds") => number;
|
|
93
|
+
/** @deprecated Use `buildAddressFormat` / `loadAddressFormat` from `/checkout` (`postalLabel`). */
|
|
87
94
|
declare function formatPostalLabel(zipNameType?: string): string;
|
|
95
|
+
/** @deprecated Use `useAddressFormat` (`/hooks`) or `loadAddressFormat` (`/checkout`), which cache the metadata and add per-country overrides. */
|
|
88
96
|
declare function getAddressMeta(countryCode: string): Promise<{
|
|
89
97
|
regionLabel: any;
|
|
90
98
|
postalLabel: string;
|
|
@@ -94,6 +102,13 @@ declare function getOrderStatus(order: Order.Root | Order.OrderSummary): {
|
|
|
94
102
|
title: string;
|
|
95
103
|
info?: string;
|
|
96
104
|
};
|
|
105
|
+
/**
|
|
106
|
+
* Scrolls to and focuses the first form control whose `name` has an error.
|
|
107
|
+
* Fields absent from the DOM (e.g. a hidden postcode) are skipped.
|
|
108
|
+
*
|
|
109
|
+
* @param root Element to search in (e.g. the form); defaults to the document.
|
|
110
|
+
*/
|
|
111
|
+
declare function focusFirstInvalidField(errors: Record<string, unknown>, root?: ParentNode | null): void;
|
|
97
112
|
|
|
98
113
|
declare class PhonepePayment {
|
|
99
114
|
private readonly amount;
|
|
@@ -212,4 +227,4 @@ declare function isProductCustomized(customizationInputs: Array<{
|
|
|
212
227
|
[key: string]: any;
|
|
213
228
|
}> | undefined, productId: number): boolean;
|
|
214
229
|
|
|
215
|
-
export { Auth, CacheManager, LocalCart, PhonepePayment, SectionFilters, authRoutes, cache, calculateDiscountPercent, clearCache, constructFilter, convertObjectToParams, convertToCurrency, cropImage, debounce, deleteCache, digestMessage, findMatchingVariant, findSimilarVariant, formatBookingDateTime, formatDateTime, formatPostalLabel, generateCacheKey, generateTimeOptions, getAddressMeta, getAvailableDaysText, getCache, getDelayInMilliseconds, getNextAvailableDate, getOrderStatus, getParamsFromURL, getQueryParams, getTimeConstraints, getUniqueId, hasCache, invalidateCache, isAvailableDay, isColorVariantType, isExpired, isProductCustomized, isVariantCombinationAvailable, pluralize, protectedRoutes, publicRoutes, pushParamsToURL, setAuthTokenChangeCallback, setCache, shareLink, timeFromNow, urls };
|
|
230
|
+
export { Auth, CacheManager, LocalCart, PhonepePayment, SectionFilters, authRoutes, cache, calculateDiscountPercent, clearCache, constructFilter, convertObjectToParams, convertToCurrency, cropImage, debounce, deleteCache, digestMessage, findMatchingVariant, findSimilarVariant, focusFirstInvalidField, formatBookingDateTime, formatDateTime, formatPostalLabel, generateCacheKey, generateTimeOptions, getAddressMeta, getAvailableDaysText, getCache, getDelayInMilliseconds, getNextAvailableDate, getOrderStatus, getParamsFromURL, getQueryParams, getTimeConstraints, getUniqueId, hasCache, invalidateCache, isAvailableDay, isColorVariantType, isExpired, isProductCustomized, isVariantCombinationAvailable, pluralize, protectedRoutes, publicRoutes, pushParamsToURL, setAuthTokenChangeCallback, setCache, shareLink, timeFromNow, urls };
|
package/dist/utils/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { authRoutes, protectedRoutes, publicRoutes, routes_default as urls } from '../chunk-OOFYY6GR.js';
|
|
2
2
|
export { findMatchingVariant, findSimilarVariant, isColorVariantType, isVariantCombinationAvailable } from '../chunk-HEFA67WK.js';
|
|
3
|
-
export { cart_default as LocalCart } from '../chunk-
|
|
3
|
+
export { cart_default as LocalCart } from '../chunk-E4D4XOAE.js';
|
|
4
4
|
export { pixelEvents } from '../chunk-VAU5OL72.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export { constructFilter, convertObjectToParams, convertToCurrency, digestMessage, formatDateTime, formatPostalLabel, getAddressMeta, getDelayInMilliseconds, getOrderStatus, getParamsFromURL, getQueryParams, pluralize, pushParamsToURL, shareLink } from '../chunk-CBKJ3Y2I.js';
|
|
5
|
+
import { digestMessage } from '../chunk-EWZ7TGI7.js';
|
|
6
|
+
export { constructFilter, convertObjectToParams, convertToCurrency, digestMessage, focusFirstInvalidField, formatDateTime, formatPostalLabel, getAddressMeta, getDelayInMilliseconds, getOrderStatus, getParamsFromURL, getQueryParams, pluralize, pushParamsToURL, shareLink } from '../chunk-EWZ7TGI7.js';
|
|
8
7
|
export { isExpired, timeFromNow } from '../chunk-HSF2D56O.js';
|
|
8
|
+
export { CacheManager, cache, clearCache, deleteCache, generateCacheKey, getCache, hasCache, invalidateCache, setCache } from '../chunk-OSM73ETC.js';
|
|
9
9
|
export { auth_default as Auth, setAuthTokenChangeCallback } from '../chunk-WEMNXIRS.js';
|
|
10
10
|
export { ADDRESS_FORM_SESSION_KEY, ALLOWED_COUNTRIES, DEFAULT_TOAST_CONFIG, PRODUCT_STATUSES, SLICE_STATUS, USER_CART, USER_CREDENTIALS, USER_CRED_REFRESH_TOKEN, USER_CRED_TOKEN, pathNameMap } from '../chunk-BQ256JKN.js';
|
|
11
11
|
import { getPhonePeApiEndpoint, getPublicApiEndpoint } from '../chunk-JQMLHRWL.js';
|
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
interface Address {
|
|
2
|
-
id: number;
|
|
3
|
-
customer: number;
|
|
4
|
-
address: string;
|
|
5
|
-
city: string;
|
|
6
|
-
state: string;
|
|
7
|
-
state_obj: string;
|
|
8
|
-
customer_email: string;
|
|
9
|
-
country: string;
|
|
10
|
-
pincode: string;
|
|
11
|
-
latitude: number | null;
|
|
12
|
-
longitude: number | null;
|
|
13
|
-
is_default: boolean;
|
|
14
|
-
customer_name: string;
|
|
15
|
-
customer_phone: string;
|
|
16
|
-
customer_country_code: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type { Address as A };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
interface Address {
|
|
2
|
-
id: number;
|
|
3
|
-
customer: number;
|
|
4
|
-
address: string;
|
|
5
|
-
city: string;
|
|
6
|
-
state: string;
|
|
7
|
-
state_obj: string;
|
|
8
|
-
customer_email: string;
|
|
9
|
-
country: string;
|
|
10
|
-
pincode: string;
|
|
11
|
-
latitude: number | null;
|
|
12
|
-
longitude: number | null;
|
|
13
|
-
is_default: boolean;
|
|
14
|
-
customer_name: string;
|
|
15
|
-
customer_phone: string;
|
|
16
|
-
customer_country_code: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type { Address as A };
|