@storepecker/storefront-core 2.1.1 → 2.2.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-DQEZzyUG.d.cts → address-DwBZHzbI.d.cts} +2 -2
- package/dist/{address-DQEZzyUG.d.ts → address-DwBZHzbI.d.ts} +2 -2
- package/dist/api/index.cjs +25 -17
- package/dist/api/index.d.cts +50 -17
- package/dist/api/index.d.ts +50 -17
- package/dist/api/index.js +9 -2
- package/dist/{booking-CZ59BXk3.d.ts → booking-BGvxHd-t.d.cts} +2 -2
- package/dist/{booking-BgZoXUBv.d.cts → booking-BSZ6NP-e.d.ts} +2 -2
- package/dist/{cart-BY8D8w-s.d.cts → cart-CfsntcpS.d.ts} +38 -5
- package/dist/{cart-GuhgeBBt.d.ts → cart-XumsY-y0.d.cts} +38 -5
- package/dist/checkout/index.d.cts +3 -3
- package/dist/checkout/index.d.ts +3 -3
- package/dist/{chunk-26A3EBZI.cjs → chunk-A67PCF55.cjs} +1 -2
- package/dist/{chunk-Y6NFUWTH.js → chunk-ERLBPVFK.js} +1 -2
- package/dist/{chunk-PWYWNRVO.cjs → chunk-JVSR6THX.cjs} +6 -6
- package/dist/{chunk-UOFTDL4D.js → chunk-ZKHQPHT5.js} +1 -1
- package/dist/collections-D4tvWcZp.d.ts +23 -0
- package/dist/collections-dCr3VEJo.d.cts +23 -0
- package/dist/components/index.d.cts +11 -11
- package/dist/components/index.d.ts +11 -11
- package/dist/hooks/index.cjs +16 -16
- package/dist/hooks/index.d.cts +24 -18
- package/dist/hooks/index.d.ts +24 -18
- package/dist/hooks/index.js +7 -7
- package/dist/models/index.d.cts +8 -8
- package/dist/models/index.d.ts +8 -8
- package/dist/{orders-DHJhJ3xz.d.cts → orders-CvCa7XWm.d.ts} +19 -17
- package/dist/{orders-DHJhJ3xz.d.ts → orders-Dm5Dq02y.d.cts} +19 -17
- package/dist/{phonepe-D7vn-9SR.d.cts → phonepe-dWMLZel6.d.cts} +3 -3
- package/dist/{phonepe-D7vn-9SR.d.ts → phonepe-dWMLZel6.d.ts} +3 -3
- package/dist/{product-Dfi0ke-4.d.cts → product-Daxj09p9.d.cts} +64 -61
- package/dist/{product-Dfi0ke-4.d.ts → product-Daxj09p9.d.ts} +64 -61
- package/dist/store/index.cjs +10 -10
- package/dist/store/index.d.cts +8 -4
- package/dist/store/index.d.ts +8 -4
- package/dist/store/index.js +5 -5
- package/dist/{useAddressForm-DgkCP1nG.d.cts → useAddressForm-DGbEn91-.d.cts} +1 -1
- package/dist/{useAddressForm-C-Uzug4d.d.ts → useAddressForm-cO3Au33k.d.ts} +1 -1
- package/dist/utils/index.d.cts +6 -6
- package/dist/utils/index.d.ts +6 -6
- package/dist/wishlist-Cow1wVqf.d.cts +10 -0
- package/dist/wishlist-gamNg0T1.d.ts +10 -0
- package/package.json +1 -1
- package/dist/collections-CenI9AlQ.d.cts +0 -40
- package/dist/collections-CenI9AlQ.d.ts +0 -40
- package/dist/wishlist-DHOvXmJj.d.cts +0 -41
- package/dist/wishlist-LfdFxddw.d.ts +0 -41
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkA67PCF55_cjs = require('./chunk-A67PCF55.cjs');
|
|
4
4
|
var chunkSMHJRNCR_cjs = require('./chunk-SMHJRNCR.cjs');
|
|
5
5
|
var chunkBBRXE57K_cjs = require('./chunk-BBRXE57K.cjs');
|
|
6
6
|
var chunkNE3ZHELZ_cjs = require('./chunk-NE3ZHELZ.cjs');
|
|
@@ -22,7 +22,7 @@ var useCartStore = zustand.create((set) => ({
|
|
|
22
22
|
syncCart: async (addressId) => {
|
|
23
23
|
set({ status: "loading" /* LOADING */ });
|
|
24
24
|
try {
|
|
25
|
-
const response = await
|
|
25
|
+
const response = await chunkA67PCF55_cjs.getCart("/customer/cart/", addressId);
|
|
26
26
|
if (response) {
|
|
27
27
|
set({ cart: response, status: "idle" /* IDLE */ });
|
|
28
28
|
}
|
|
@@ -33,7 +33,7 @@ var useCartStore = zustand.create((set) => ({
|
|
|
33
33
|
fetchCart: async (addressId) => {
|
|
34
34
|
set({ status: "loading" /* LOADING */ });
|
|
35
35
|
try {
|
|
36
|
-
const response = await
|
|
36
|
+
const response = await chunkA67PCF55_cjs.getCart("/customer/cart/", addressId);
|
|
37
37
|
if (response) {
|
|
38
38
|
set({ cart: response, status: "idle" /* IDLE */ });
|
|
39
39
|
}
|
|
@@ -44,7 +44,7 @@ var useCartStore = zustand.create((set) => ({
|
|
|
44
44
|
addToCart: async (items, customizationInputs, addressId) => {
|
|
45
45
|
set({ status: "loading" /* LOADING */ });
|
|
46
46
|
try {
|
|
47
|
-
await
|
|
47
|
+
await chunkA67PCF55_cjs.addToCart(items, customizationInputs);
|
|
48
48
|
await useCartStore.getState().syncCart(addressId);
|
|
49
49
|
} catch {
|
|
50
50
|
} finally {
|
|
@@ -54,7 +54,7 @@ var useCartStore = zustand.create((set) => ({
|
|
|
54
54
|
removeFromCart: async (items, addressId) => {
|
|
55
55
|
set({ status: "loading" /* LOADING */ });
|
|
56
56
|
try {
|
|
57
|
-
await
|
|
57
|
+
await chunkA67PCF55_cjs.removeFromCart(items);
|
|
58
58
|
await useCartStore.getState().syncCart(addressId);
|
|
59
59
|
} catch {
|
|
60
60
|
} finally {
|
|
@@ -64,7 +64,7 @@ var useCartStore = zustand.create((set) => ({
|
|
|
64
64
|
updateCart: async (items, addressId) => {
|
|
65
65
|
set({ status: "loading" /* LOADING */ });
|
|
66
66
|
try {
|
|
67
|
-
await
|
|
67
|
+
await chunkA67PCF55_cjs.updateCart(items);
|
|
68
68
|
await useCartStore.getState().syncCart(addressId);
|
|
69
69
|
} catch {
|
|
70
70
|
} finally {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { updateCart, removeFromCart, addToCart, getCart } from './chunk-
|
|
1
|
+
import { updateCart, removeFromCart, addToCart, getCart } from './chunk-ERLBPVFK.js';
|
|
2
2
|
import { cart_default } from './chunk-QAC72HKO.js';
|
|
3
3
|
import { auth_default } from './chunk-WEMNXIRS.js';
|
|
4
4
|
import { USER_CRED_TOKEN, USER_CREDENTIALS } from './chunk-BQ256JKN.js';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { d as Product } from './product-Daxj09p9.js';
|
|
2
|
+
|
|
3
|
+
interface CollectionResponse {
|
|
4
|
+
id: number;
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
slug: string;
|
|
8
|
+
is_published: boolean;
|
|
9
|
+
image: string | null;
|
|
10
|
+
published_at: string | null;
|
|
11
|
+
variants?: Product.ProductList[];
|
|
12
|
+
}
|
|
13
|
+
interface singleCollection {
|
|
14
|
+
slug: string;
|
|
15
|
+
}
|
|
16
|
+
interface Attributes {
|
|
17
|
+
[key: string]: {
|
|
18
|
+
name: string;
|
|
19
|
+
value: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type { Attributes as A, CollectionResponse as C, singleCollection as s };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { d as Product } from './product-Daxj09p9.cjs';
|
|
2
|
+
|
|
3
|
+
interface CollectionResponse {
|
|
4
|
+
id: number;
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
slug: string;
|
|
8
|
+
is_published: boolean;
|
|
9
|
+
image: string | null;
|
|
10
|
+
published_at: string | null;
|
|
11
|
+
variants?: Product.ProductList[];
|
|
12
|
+
}
|
|
13
|
+
interface singleCollection {
|
|
14
|
+
slug: string;
|
|
15
|
+
}
|
|
16
|
+
interface Attributes {
|
|
17
|
+
[key: string]: {
|
|
18
|
+
name: string;
|
|
19
|
+
value: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type { Attributes as A, CollectionResponse as C, singleCollection as s };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { U as UseAddressFormOptions, u as useAddressForm } from '../useAddressForm-
|
|
3
|
-
import {
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { U as UseAddressFormOptions, u as useAddressForm } from '../useAddressForm-DGbEn91-.cjs';
|
|
3
|
+
import { f as ProductDetail } from '../product-Daxj09p9.cjs';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
-
import { O as Order } from '../orders-
|
|
5
|
+
import { O as Order } from '../orders-Dm5Dq02y.cjs';
|
|
6
6
|
import 'formik';
|
|
7
|
-
import '../address-
|
|
7
|
+
import '../address-DwBZHzbI.cjs';
|
|
8
8
|
import 'react-toastify';
|
|
9
9
|
|
|
10
10
|
interface SearchDropdownOption {
|
|
@@ -24,13 +24,13 @@ interface SearchDropdownProps {
|
|
|
24
24
|
error?: string;
|
|
25
25
|
label?: string;
|
|
26
26
|
name?: string;
|
|
27
|
-
renderOption?: (option: SearchDropdownOption) =>
|
|
28
|
-
renderSelected?: (option: SearchDropdownOption | null) =>
|
|
27
|
+
renderOption?: (option: SearchDropdownOption) => React__default.ReactNode;
|
|
28
|
+
renderSelected?: (option: SearchDropdownOption | null) => React__default.ReactNode;
|
|
29
29
|
filterFunction?: (option: SearchDropdownOption, searchTerm: string) => boolean;
|
|
30
30
|
emptyMessage?: string;
|
|
31
31
|
maxHeight?: string;
|
|
32
32
|
}
|
|
33
|
-
declare const SearchDropdown:
|
|
33
|
+
declare const SearchDropdown: React__default.FC<SearchDropdownProps>;
|
|
34
34
|
|
|
35
35
|
interface AddressFormRef {
|
|
36
36
|
formik: ReturnType<typeof useAddressForm>["formik"];
|
|
@@ -42,8 +42,8 @@ interface AddressFormProps extends UseAddressFormOptions {
|
|
|
42
42
|
type: "submit";
|
|
43
43
|
disabled: boolean;
|
|
44
44
|
loading: boolean;
|
|
45
|
-
children:
|
|
46
|
-
}) =>
|
|
45
|
+
children: React__default.ReactNode;
|
|
46
|
+
}) => React__default.ReactNode;
|
|
47
47
|
/** Called when formik instance is ready (alternative to ref) */
|
|
48
48
|
onFormikReady?: (formik: ReturnType<typeof useAddressForm>["formik"]) => void;
|
|
49
49
|
/** Called when cancel is clicked */
|
|
@@ -57,7 +57,7 @@ interface AddressFormProps extends UseAddressFormOptions {
|
|
|
57
57
|
/** Submit button text. Default: "Save" */
|
|
58
58
|
submitLabel?: string;
|
|
59
59
|
}
|
|
60
|
-
declare const AddressForm:
|
|
60
|
+
declare const AddressForm: React__default.ForwardRefExoticComponent<AddressFormProps & React__default.RefAttributes<AddressFormRef>>;
|
|
61
61
|
|
|
62
62
|
interface ShareButtonProps {
|
|
63
63
|
product: ProductDetail.Root;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { U as UseAddressFormOptions, u as useAddressForm } from '../useAddressForm-
|
|
3
|
-
import {
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { U as UseAddressFormOptions, u as useAddressForm } from '../useAddressForm-cO3Au33k.js';
|
|
3
|
+
import { f as ProductDetail } from '../product-Daxj09p9.js';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
-
import { O as Order } from '../orders-
|
|
5
|
+
import { O as Order } from '../orders-CvCa7XWm.js';
|
|
6
6
|
import 'formik';
|
|
7
|
-
import '../address-
|
|
7
|
+
import '../address-DwBZHzbI.js';
|
|
8
8
|
import 'react-toastify';
|
|
9
9
|
|
|
10
10
|
interface SearchDropdownOption {
|
|
@@ -24,13 +24,13 @@ interface SearchDropdownProps {
|
|
|
24
24
|
error?: string;
|
|
25
25
|
label?: string;
|
|
26
26
|
name?: string;
|
|
27
|
-
renderOption?: (option: SearchDropdownOption) =>
|
|
28
|
-
renderSelected?: (option: SearchDropdownOption | null) =>
|
|
27
|
+
renderOption?: (option: SearchDropdownOption) => React__default.ReactNode;
|
|
28
|
+
renderSelected?: (option: SearchDropdownOption | null) => React__default.ReactNode;
|
|
29
29
|
filterFunction?: (option: SearchDropdownOption, searchTerm: string) => boolean;
|
|
30
30
|
emptyMessage?: string;
|
|
31
31
|
maxHeight?: string;
|
|
32
32
|
}
|
|
33
|
-
declare const SearchDropdown:
|
|
33
|
+
declare const SearchDropdown: React__default.FC<SearchDropdownProps>;
|
|
34
34
|
|
|
35
35
|
interface AddressFormRef {
|
|
36
36
|
formik: ReturnType<typeof useAddressForm>["formik"];
|
|
@@ -42,8 +42,8 @@ interface AddressFormProps extends UseAddressFormOptions {
|
|
|
42
42
|
type: "submit";
|
|
43
43
|
disabled: boolean;
|
|
44
44
|
loading: boolean;
|
|
45
|
-
children:
|
|
46
|
-
}) =>
|
|
45
|
+
children: React__default.ReactNode;
|
|
46
|
+
}) => React__default.ReactNode;
|
|
47
47
|
/** Called when formik instance is ready (alternative to ref) */
|
|
48
48
|
onFormikReady?: (formik: ReturnType<typeof useAddressForm>["formik"]) => void;
|
|
49
49
|
/** Called when cancel is clicked */
|
|
@@ -57,7 +57,7 @@ interface AddressFormProps extends UseAddressFormOptions {
|
|
|
57
57
|
/** Submit button text. Default: "Save" */
|
|
58
58
|
submitLabel?: string;
|
|
59
59
|
}
|
|
60
|
-
declare const AddressForm:
|
|
60
|
+
declare const AddressForm: React__default.ForwardRefExoticComponent<AddressFormProps & React__default.RefAttributes<AddressFormRef>>;
|
|
61
61
|
|
|
62
62
|
interface ShareButtonProps {
|
|
63
63
|
product: ProductDetail.Root;
|
package/dist/hooks/index.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkKKQKHG26_cjs = require('../chunk-KKQKHG26.cjs');
|
|
4
4
|
var chunk2AHH3XBW_cjs = require('../chunk-2AHH3XBW.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var chunkJVSR6THX_cjs = require('../chunk-JVSR6THX.cjs');
|
|
6
|
+
var chunkA67PCF55_cjs = require('../chunk-A67PCF55.cjs');
|
|
7
7
|
var chunkSMHJRNCR_cjs = require('../chunk-SMHJRNCR.cjs');
|
|
8
8
|
var chunkXLQAALMU_cjs = require('../chunk-XLQAALMU.cjs');
|
|
9
9
|
var chunkFMHR5ABF_cjs = require('../chunk-FMHR5ABF.cjs');
|
|
@@ -52,7 +52,7 @@ var useCart = (addressId) => {
|
|
|
52
52
|
async (addrId) => {
|
|
53
53
|
try {
|
|
54
54
|
setIsLoading(true);
|
|
55
|
-
const result = await
|
|
55
|
+
const result = await chunkA67PCF55_cjs.getCart("/customer/cart/", addrId ?? addressId);
|
|
56
56
|
setData(result);
|
|
57
57
|
setError(null);
|
|
58
58
|
} catch (err) {
|
|
@@ -72,7 +72,7 @@ var useCart = (addressId) => {
|
|
|
72
72
|
},
|
|
73
73
|
[fetchData]
|
|
74
74
|
);
|
|
75
|
-
return { data, error, isLoading, mutate: fetchData, refetchWithParams };
|
|
75
|
+
return { data, error, isLoading, mutate: fetchData, refetchWithParams, setData };
|
|
76
76
|
};
|
|
77
77
|
var useOrders = (filters) => {
|
|
78
78
|
const [data, setData] = react.useState(void 0);
|
|
@@ -95,7 +95,7 @@ var useOrders = (filters) => {
|
|
|
95
95
|
react.useEffect(() => {
|
|
96
96
|
fetchData();
|
|
97
97
|
}, [fetchData]);
|
|
98
|
-
return { data, error, isLoading, mutate: fetchData };
|
|
98
|
+
return { data, error, isLoading, mutate: fetchData, setData };
|
|
99
99
|
};
|
|
100
100
|
function useGetProducts(initialFilter, options) {
|
|
101
101
|
const paginationMode = options?.paginationMode || "replace";
|
|
@@ -120,7 +120,7 @@ function useGetProducts(initialFilter, options) {
|
|
|
120
120
|
apiParams[key] = value;
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
const result = await
|
|
123
|
+
const result = await chunkA67PCF55_cjs.getProductList(endpoint, apiParams);
|
|
124
124
|
setData(result);
|
|
125
125
|
if (modeRef.current === "append" && isLoadMoreRef.current) {
|
|
126
126
|
setProducts((prev) => [...prev, ...result.results || []]);
|
|
@@ -188,7 +188,7 @@ var useGetProductDetails = (slug) => {
|
|
|
188
188
|
const fetchData = react.useCallback(async () => {
|
|
189
189
|
try {
|
|
190
190
|
setIsLoading(true);
|
|
191
|
-
const result = await
|
|
191
|
+
const result = await chunkA67PCF55_cjs.getProductDetail("/inventory/products/", slug);
|
|
192
192
|
setData(result);
|
|
193
193
|
} catch (err) {
|
|
194
194
|
} finally {
|
|
@@ -211,7 +211,7 @@ var useGetProductCategories = () => {
|
|
|
211
211
|
const fetchData = async () => {
|
|
212
212
|
try {
|
|
213
213
|
setIsLoading(true);
|
|
214
|
-
const result = await
|
|
214
|
+
const result = await chunkA67PCF55_cjs.getProductCategories("/store/categories");
|
|
215
215
|
setData(result || []);
|
|
216
216
|
} catch (err) {
|
|
217
217
|
setError(err);
|
|
@@ -256,8 +256,8 @@ var useWishlist = () => {
|
|
|
256
256
|
const fetchData = react.useCallback(async () => {
|
|
257
257
|
try {
|
|
258
258
|
setIsLoading(true);
|
|
259
|
-
const
|
|
260
|
-
setData(
|
|
259
|
+
const response = await chunkA67PCF55_cjs.getWishlist("/customer/wishlist/");
|
|
260
|
+
if (response.data) setData(response.data);
|
|
261
261
|
setError(null);
|
|
262
262
|
} catch (err) {
|
|
263
263
|
setError(err);
|
|
@@ -271,7 +271,7 @@ var useWishlist = () => {
|
|
|
271
271
|
fetchData();
|
|
272
272
|
}
|
|
273
273
|
}, [fetchData]);
|
|
274
|
-
return { data, error, isLoading, mutate: fetchData };
|
|
274
|
+
return { data, error, isLoading, mutate: fetchData, setData };
|
|
275
275
|
};
|
|
276
276
|
var useProductDetailModal = () => {
|
|
277
277
|
const [selectedProductSlug, setSelectedProductSlug] = react.useState();
|
|
@@ -314,7 +314,7 @@ function useCheckoutPayment(options) {
|
|
|
314
314
|
const [isConfirmingPayment, setIsConfirmingPayment] = react.useState(false);
|
|
315
315
|
const [showSuccessModal, setShowSuccessModal] = react.useState(false);
|
|
316
316
|
const [showFailureModal, setShowFailureModal] = react.useState(false);
|
|
317
|
-
const resetCartCount =
|
|
317
|
+
const resetCartCount = chunkJVSR6THX_cjs.useCartStore((s) => s.resetCartCount);
|
|
318
318
|
const callbacks = {
|
|
319
319
|
onSuccess: (order) => {
|
|
320
320
|
setOrderSummary(order);
|
|
@@ -500,8 +500,8 @@ function useVariantSelector(options) {
|
|
|
500
500
|
}
|
|
501
501
|
function useShopCheckout(options) {
|
|
502
502
|
const { product, onNavigateToCart, onToast } = options;
|
|
503
|
-
const { addToCart, setCart } =
|
|
504
|
-
const isUserAuthenticated =
|
|
503
|
+
const { addToCart, setCart } = chunkJVSR6THX_cjs.useCartStore();
|
|
504
|
+
const isUserAuthenticated = chunkJVSR6THX_cjs.useAuthStore((s) => s.isAuthenticated);
|
|
505
505
|
const [isWishlisted, setIsWishlisted] = react.useState(product.is_wishlisted);
|
|
506
506
|
const [isAddedToCart, setIsAddedToCart] = react.useState(false);
|
|
507
507
|
const [loading, setLoading] = react.useState(false);
|
|
@@ -512,7 +512,7 @@ function useShopCheckout(options) {
|
|
|
512
512
|
react.useEffect(() => {
|
|
513
513
|
const fetchCategories = async () => {
|
|
514
514
|
try {
|
|
515
|
-
const response = await
|
|
515
|
+
const response = await chunkA67PCF55_cjs.getCategories();
|
|
516
516
|
setCategories(response.data);
|
|
517
517
|
} catch (error) {
|
|
518
518
|
console.log(error);
|
|
@@ -626,7 +626,7 @@ function useShopCheckout(options) {
|
|
|
626
626
|
const handleNotifyMeFormSubmit = react.useCallback(
|
|
627
627
|
async (values) => {
|
|
628
628
|
try {
|
|
629
|
-
const response = await
|
|
629
|
+
const response = await chunkA67PCF55_cjs.notifyProductStock({
|
|
630
630
|
...values,
|
|
631
631
|
variant_slug: product.slug
|
|
632
632
|
});
|
package/dist/hooks/index.d.cts
CHANGED
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
import { A as Address } from '../address-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { A as Address } from '../address-DwBZHzbI.cjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { C as Cart, b as Category, U as User, c as Coupon } from '../cart-XumsY-y0.cjs';
|
|
4
|
+
import { O as Order } from '../orders-Dm5Dq02y.cjs';
|
|
5
|
+
import { d as Product, f as ProductDetail, e as ProductAttribute, A as Attributes } from '../product-Daxj09p9.cjs';
|
|
6
|
+
import { W as Wishlist } from '../wishlist-Cow1wVqf.cjs';
|
|
7
|
+
export { U as UseAddressFormOptions, a as UseAddressFormReturn, u as useAddressForm } from '../useAddressForm-DGbEn91-.cjs';
|
|
7
8
|
import 'react-toastify';
|
|
8
|
-
import 'react';
|
|
9
9
|
import 'formik';
|
|
10
10
|
|
|
11
11
|
declare const useAddress: () => {
|
|
12
12
|
data: Address[];
|
|
13
|
-
error:
|
|
13
|
+
error: unknown;
|
|
14
14
|
isLoading: boolean;
|
|
15
15
|
mutate: () => Promise<void>;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
declare const useCart: (addressId?: number) => {
|
|
19
19
|
data: Cart.Root | undefined;
|
|
20
|
-
error:
|
|
20
|
+
error: unknown;
|
|
21
21
|
isLoading: boolean;
|
|
22
22
|
mutate: (addrId?: number) => Promise<void>;
|
|
23
23
|
refetchWithParams: (newAddressId?: number) => void;
|
|
24
|
+
setData: React.Dispatch<React.SetStateAction<Cart.Root | undefined>>;
|
|
24
25
|
};
|
|
25
26
|
|
|
26
|
-
declare const useOrders: (filters:
|
|
27
|
+
declare const useOrders: (filters: Record<string, string>) => {
|
|
27
28
|
data: Order.OrderResponse | undefined;
|
|
28
|
-
error:
|
|
29
|
+
error: unknown;
|
|
29
30
|
isLoading: boolean;
|
|
30
31
|
mutate: () => Promise<void>;
|
|
32
|
+
setData: React.Dispatch<React.SetStateAction<Order.OrderResponse | undefined>>;
|
|
31
33
|
};
|
|
32
34
|
|
|
33
35
|
type PaginationMode = "append" | "replace";
|
|
@@ -51,28 +53,29 @@ interface UseGetProductsReturn {
|
|
|
51
53
|
}
|
|
52
54
|
declare function useGetProducts(initialFilter: CustomObject, options?: UseGetProductsOptions): UseGetProductsReturn;
|
|
53
55
|
declare const useGetProductDetails: (slug: string) => {
|
|
54
|
-
data:
|
|
56
|
+
data: Product.Root | undefined;
|
|
55
57
|
loading: boolean;
|
|
56
58
|
isLoading: boolean;
|
|
57
59
|
};
|
|
58
60
|
declare const useGetProductCategories: () => {
|
|
59
61
|
data: Category.Root[];
|
|
60
62
|
loading: boolean;
|
|
61
|
-
error:
|
|
63
|
+
error: unknown;
|
|
62
64
|
};
|
|
63
65
|
|
|
64
66
|
declare const useUserDetails: () => {
|
|
65
67
|
data: User.Root | undefined;
|
|
66
|
-
error:
|
|
68
|
+
error: unknown;
|
|
67
69
|
isLoading: boolean;
|
|
68
70
|
mutate: () => Promise<void>;
|
|
69
71
|
};
|
|
70
72
|
|
|
71
73
|
declare const useWishlist: () => {
|
|
72
74
|
data: Wishlist.Root | undefined;
|
|
73
|
-
error:
|
|
75
|
+
error: unknown;
|
|
74
76
|
isLoading: boolean;
|
|
75
77
|
mutate: () => Promise<void>;
|
|
78
|
+
setData: React.Dispatch<React.SetStateAction<Wishlist.Root | undefined>>;
|
|
76
79
|
};
|
|
77
80
|
|
|
78
81
|
declare const useProductDetailModal: () => {
|
|
@@ -139,7 +142,7 @@ interface UseVariantSelectorOptions {
|
|
|
139
142
|
/** The current product detail. */
|
|
140
143
|
product: ProductDetail.Root;
|
|
141
144
|
/** Product attributes map (variant type → choices). */
|
|
142
|
-
productAttributes: Record<string,
|
|
145
|
+
productAttributes: Record<string, ProductAttribute[]>;
|
|
143
146
|
/** Called when a new variant is resolved. Theme handles navigation/callback. */
|
|
144
147
|
onVariantChange?: (slug: string) => void;
|
|
145
148
|
}
|
|
@@ -183,13 +186,16 @@ interface UseShopCheckoutReturn {
|
|
|
183
186
|
isUserAuthenticated: boolean;
|
|
184
187
|
productCustomizations: ProductDetail.Customization[];
|
|
185
188
|
handleAddToCart: () => Promise<void>;
|
|
186
|
-
handleCustomizationSubmit: (data:
|
|
189
|
+
handleCustomizationSubmit: (data: Record<string, string>) => Promise<void>;
|
|
187
190
|
handleQuantityChange: (value: number) => void;
|
|
188
191
|
handleShare: () => void;
|
|
189
192
|
handleLogin: () => void;
|
|
190
193
|
closeLoginModal: () => void;
|
|
191
194
|
handleNotifyMe: () => void;
|
|
192
|
-
handleNotifyMeFormSubmit: (values:
|
|
195
|
+
handleNotifyMeFormSubmit: (values: {
|
|
196
|
+
email: string;
|
|
197
|
+
name: string;
|
|
198
|
+
}) => Promise<void>;
|
|
193
199
|
handleNotifyMeModalClose: () => void;
|
|
194
200
|
handleWishlistUpdated: (status: "add" | "remove") => void;
|
|
195
201
|
isOutOfStock: boolean;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
import { A as Address } from '../address-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { A as Address } from '../address-DwBZHzbI.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { C as Cart, b as Category, U as User, c as Coupon } from '../cart-CfsntcpS.js';
|
|
4
|
+
import { O as Order } from '../orders-CvCa7XWm.js';
|
|
5
|
+
import { d as Product, f as ProductDetail, e as ProductAttribute, A as Attributes } from '../product-Daxj09p9.js';
|
|
6
|
+
import { W as Wishlist } from '../wishlist-gamNg0T1.js';
|
|
7
|
+
export { U as UseAddressFormOptions, a as UseAddressFormReturn, u as useAddressForm } from '../useAddressForm-cO3Au33k.js';
|
|
7
8
|
import 'react-toastify';
|
|
8
|
-
import 'react';
|
|
9
9
|
import 'formik';
|
|
10
10
|
|
|
11
11
|
declare const useAddress: () => {
|
|
12
12
|
data: Address[];
|
|
13
|
-
error:
|
|
13
|
+
error: unknown;
|
|
14
14
|
isLoading: boolean;
|
|
15
15
|
mutate: () => Promise<void>;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
declare const useCart: (addressId?: number) => {
|
|
19
19
|
data: Cart.Root | undefined;
|
|
20
|
-
error:
|
|
20
|
+
error: unknown;
|
|
21
21
|
isLoading: boolean;
|
|
22
22
|
mutate: (addrId?: number) => Promise<void>;
|
|
23
23
|
refetchWithParams: (newAddressId?: number) => void;
|
|
24
|
+
setData: React.Dispatch<React.SetStateAction<Cart.Root | undefined>>;
|
|
24
25
|
};
|
|
25
26
|
|
|
26
|
-
declare const useOrders: (filters:
|
|
27
|
+
declare const useOrders: (filters: Record<string, string>) => {
|
|
27
28
|
data: Order.OrderResponse | undefined;
|
|
28
|
-
error:
|
|
29
|
+
error: unknown;
|
|
29
30
|
isLoading: boolean;
|
|
30
31
|
mutate: () => Promise<void>;
|
|
32
|
+
setData: React.Dispatch<React.SetStateAction<Order.OrderResponse | undefined>>;
|
|
31
33
|
};
|
|
32
34
|
|
|
33
35
|
type PaginationMode = "append" | "replace";
|
|
@@ -51,28 +53,29 @@ interface UseGetProductsReturn {
|
|
|
51
53
|
}
|
|
52
54
|
declare function useGetProducts(initialFilter: CustomObject, options?: UseGetProductsOptions): UseGetProductsReturn;
|
|
53
55
|
declare const useGetProductDetails: (slug: string) => {
|
|
54
|
-
data:
|
|
56
|
+
data: Product.Root | undefined;
|
|
55
57
|
loading: boolean;
|
|
56
58
|
isLoading: boolean;
|
|
57
59
|
};
|
|
58
60
|
declare const useGetProductCategories: () => {
|
|
59
61
|
data: Category.Root[];
|
|
60
62
|
loading: boolean;
|
|
61
|
-
error:
|
|
63
|
+
error: unknown;
|
|
62
64
|
};
|
|
63
65
|
|
|
64
66
|
declare const useUserDetails: () => {
|
|
65
67
|
data: User.Root | undefined;
|
|
66
|
-
error:
|
|
68
|
+
error: unknown;
|
|
67
69
|
isLoading: boolean;
|
|
68
70
|
mutate: () => Promise<void>;
|
|
69
71
|
};
|
|
70
72
|
|
|
71
73
|
declare const useWishlist: () => {
|
|
72
74
|
data: Wishlist.Root | undefined;
|
|
73
|
-
error:
|
|
75
|
+
error: unknown;
|
|
74
76
|
isLoading: boolean;
|
|
75
77
|
mutate: () => Promise<void>;
|
|
78
|
+
setData: React.Dispatch<React.SetStateAction<Wishlist.Root | undefined>>;
|
|
76
79
|
};
|
|
77
80
|
|
|
78
81
|
declare const useProductDetailModal: () => {
|
|
@@ -139,7 +142,7 @@ interface UseVariantSelectorOptions {
|
|
|
139
142
|
/** The current product detail. */
|
|
140
143
|
product: ProductDetail.Root;
|
|
141
144
|
/** Product attributes map (variant type → choices). */
|
|
142
|
-
productAttributes: Record<string,
|
|
145
|
+
productAttributes: Record<string, ProductAttribute[]>;
|
|
143
146
|
/** Called when a new variant is resolved. Theme handles navigation/callback. */
|
|
144
147
|
onVariantChange?: (slug: string) => void;
|
|
145
148
|
}
|
|
@@ -183,13 +186,16 @@ interface UseShopCheckoutReturn {
|
|
|
183
186
|
isUserAuthenticated: boolean;
|
|
184
187
|
productCustomizations: ProductDetail.Customization[];
|
|
185
188
|
handleAddToCart: () => Promise<void>;
|
|
186
|
-
handleCustomizationSubmit: (data:
|
|
189
|
+
handleCustomizationSubmit: (data: Record<string, string>) => Promise<void>;
|
|
187
190
|
handleQuantityChange: (value: number) => void;
|
|
188
191
|
handleShare: () => void;
|
|
189
192
|
handleLogin: () => void;
|
|
190
193
|
closeLoginModal: () => void;
|
|
191
194
|
handleNotifyMe: () => void;
|
|
192
|
-
handleNotifyMeFormSubmit: (values:
|
|
195
|
+
handleNotifyMeFormSubmit: (values: {
|
|
196
|
+
email: string;
|
|
197
|
+
name: string;
|
|
198
|
+
}) => Promise<void>;
|
|
193
199
|
handleNotifyMeModalClose: () => void;
|
|
194
200
|
handleWishlistUpdated: (status: "add" | "remove") => void;
|
|
195
201
|
isOutOfStock: boolean;
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getUserDetails } from '../chunk-C7ZJZEEN.js';
|
|
2
2
|
import { findMatchingVariant, findSimilarVariant, isVariantCombinationAvailable, isColorVariantType } from '../chunk-HEFA67WK.js';
|
|
3
|
-
import { useCartStore, useAuthStore } from '../chunk-
|
|
4
|
-
import { getCart, getProductList, getProductDetail, getWishlist, notifyProductStock, getProductCategories, getCategories } from '../chunk-
|
|
3
|
+
import { useCartStore, useAuthStore } from '../chunk-ZKHQPHT5.js';
|
|
4
|
+
import { getCart, getProductList, getProductDetail, getWishlist, notifyProductStock, getProductCategories, getCategories } from '../chunk-ERLBPVFK.js';
|
|
5
5
|
import { cart_default } from '../chunk-QAC72HKO.js';
|
|
6
6
|
import { processPayment, fetchAvailableCoupons, applyCheckoutCoupon, removeCheckoutCoupon } from '../chunk-BHOXJGIE.js';
|
|
7
7
|
import { getOrders, placeOrder, applyCoupon, removeCoupon, getCoupons, getAppliedCoupon } from '../chunk-GHABOHLA.js';
|
|
@@ -70,7 +70,7 @@ var useCart = (addressId) => {
|
|
|
70
70
|
},
|
|
71
71
|
[fetchData]
|
|
72
72
|
);
|
|
73
|
-
return { data, error, isLoading, mutate: fetchData, refetchWithParams };
|
|
73
|
+
return { data, error, isLoading, mutate: fetchData, refetchWithParams, setData };
|
|
74
74
|
};
|
|
75
75
|
var useOrders = (filters) => {
|
|
76
76
|
const [data, setData] = useState(void 0);
|
|
@@ -93,7 +93,7 @@ var useOrders = (filters) => {
|
|
|
93
93
|
useEffect(() => {
|
|
94
94
|
fetchData();
|
|
95
95
|
}, [fetchData]);
|
|
96
|
-
return { data, error, isLoading, mutate: fetchData };
|
|
96
|
+
return { data, error, isLoading, mutate: fetchData, setData };
|
|
97
97
|
};
|
|
98
98
|
function useGetProducts(initialFilter, options) {
|
|
99
99
|
const paginationMode = options?.paginationMode || "replace";
|
|
@@ -254,8 +254,8 @@ var useWishlist = () => {
|
|
|
254
254
|
const fetchData = useCallback(async () => {
|
|
255
255
|
try {
|
|
256
256
|
setIsLoading(true);
|
|
257
|
-
const
|
|
258
|
-
setData(
|
|
257
|
+
const response = await getWishlist("/customer/wishlist/");
|
|
258
|
+
if (response.data) setData(response.data);
|
|
259
259
|
setError(null);
|
|
260
260
|
} catch (err) {
|
|
261
261
|
setError(err);
|
|
@@ -269,7 +269,7 @@ var useWishlist = () => {
|
|
|
269
269
|
fetchData();
|
|
270
270
|
}
|
|
271
271
|
}, [fetchData]);
|
|
272
|
-
return { data, error, isLoading, mutate: fetchData };
|
|
272
|
+
return { data, error, isLoading, mutate: fetchData, setData };
|
|
273
273
|
};
|
|
274
274
|
var useProductDetailModal = () => {
|
|
275
275
|
const [selectedProductSlug, setSelectedProductSlug] = useState();
|
package/dist/models/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { A as Address } from '../address-
|
|
2
|
-
export { A as Analytics, B as Booking, a as BookingDetails, R as Review } from '../booking-
|
|
3
|
-
export { A as ApplicableTarget, C as Cart, a as CartState, b as Category, c as Coupon, d as CouponResponse, e as CouponStatus, f as Coupons, D as DiscountType, V as ValueType } from '../cart-
|
|
4
|
-
export { A as CollectionAttributes, C as CollectionResponse,
|
|
5
|
-
export { O as Order } from '../orders-
|
|
6
|
-
export { D as Data, P as PaymentInstrument, a as PhonePe } from '../phonepe-
|
|
7
|
-
export { A as Attributes, B as
|
|
8
|
-
export {
|
|
1
|
+
export { A as Address } from '../address-DwBZHzbI.cjs';
|
|
2
|
+
export { A as Analytics, B as Booking, a as BookingDetails, R as Review } from '../booking-BGvxHd-t.cjs';
|
|
3
|
+
export { A as ApplicableTarget, C as Cart, a as CartState, b as Category, c as Coupon, d as CouponResponse, e as CouponStatus, f as Coupons, D as DiscountType, U as User, V as ValueType } from '../cart-XumsY-y0.cjs';
|
|
4
|
+
export { A as CollectionAttributes, C as CollectionResponse, s as singleCollection } from '../collections-dCr3VEJo.cjs';
|
|
5
|
+
export { O as Order } from '../orders-Dm5Dq02y.cjs';
|
|
6
|
+
export { D as Data, P as PaymentInstrument, a as PhonePe } from '../phonepe-dWMLZel6.cjs';
|
|
7
|
+
export { A as Attributes, B as BaseProduct, a as BookingService, b as BookingServiceDate, c as Brand, C as CustomField, O as OperatingHours, P as Photos, d as Product, e as ProductAttribute, f as ProductDetail, S as SpecialHours, T as TimeSlot, W as WishlistState } from '../product-Daxj09p9.cjs';
|
|
8
|
+
export { W as Wishlist } from '../wishlist-Cow1wVqf.cjs';
|
|
9
9
|
import 'react-toastify';
|
|
10
10
|
|
|
11
11
|
declare namespace CountryModel {
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { A as Address } from '../address-
|
|
2
|
-
export { A as Analytics, B as Booking, a as BookingDetails, R as Review } from '../booking-
|
|
3
|
-
export { A as ApplicableTarget, C as Cart, a as CartState, b as Category, c as Coupon, d as CouponResponse, e as CouponStatus, f as Coupons, D as DiscountType, V as ValueType } from '../cart-
|
|
4
|
-
export { A as CollectionAttributes, C as CollectionResponse,
|
|
5
|
-
export { O as Order } from '../orders-
|
|
6
|
-
export { D as Data, P as PaymentInstrument, a as PhonePe } from '../phonepe-
|
|
7
|
-
export { A as Attributes, B as
|
|
8
|
-
export {
|
|
1
|
+
export { A as Address } from '../address-DwBZHzbI.js';
|
|
2
|
+
export { A as Analytics, B as Booking, a as BookingDetails, R as Review } from '../booking-BSZ6NP-e.js';
|
|
3
|
+
export { A as ApplicableTarget, C as Cart, a as CartState, b as Category, c as Coupon, d as CouponResponse, e as CouponStatus, f as Coupons, D as DiscountType, U as User, V as ValueType } from '../cart-CfsntcpS.js';
|
|
4
|
+
export { A as CollectionAttributes, C as CollectionResponse, s as singleCollection } from '../collections-D4tvWcZp.js';
|
|
5
|
+
export { O as Order } from '../orders-CvCa7XWm.js';
|
|
6
|
+
export { D as Data, P as PaymentInstrument, a as PhonePe } from '../phonepe-dWMLZel6.js';
|
|
7
|
+
export { A as Attributes, B as BaseProduct, a as BookingService, b as BookingServiceDate, c as Brand, C as CustomField, O as OperatingHours, P as Photos, d as Product, e as ProductAttribute, f as ProductDetail, S as SpecialHours, T as TimeSlot, W as WishlistState } from '../product-Daxj09p9.js';
|
|
8
|
+
export { W as Wishlist } from '../wishlist-gamNg0T1.js';
|
|
9
9
|
import 'react-toastify';
|
|
10
10
|
|
|
11
11
|
declare namespace CountryModel {
|