@storepecker/storefront-core 2.5.3 → 2.5.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/dist/api/index.cjs +74 -45
- package/dist/api/index.d.cts +33 -7
- package/dist/api/index.d.ts +33 -7
- package/dist/api/index.js +25 -4
- package/dist/{cart-DV1HcSC6.d.ts → cart-BGIsIZdM.d.ts} +1 -1
- package/dist/{cart-lJvJzaoH.d.cts → cart-CyN2JQTw.d.cts} +1 -1
- package/dist/checkout/index.cjs +23 -23
- package/dist/checkout/index.d.cts +3 -3
- package/dist/checkout/index.d.ts +3 -3
- package/dist/checkout/index.js +3 -3
- package/dist/{chunk-PARH5TBK.cjs → chunk-5BT3MH4A.cjs} +3 -3
- package/dist/{chunk-EGFOTJPC.js → chunk-5XVHYPOC.js} +1 -1
- package/dist/{chunk-OTMTHA5C.cjs → chunk-6LS5F4R3.cjs} +80 -0
- package/dist/{chunk-F45S7UWC.js → chunk-CBKJ3Y2I.js} +80 -1
- package/dist/{chunk-QAC72HKO.js → chunk-H32TICAM.js} +14 -13
- package/dist/{chunk-6Q7QMPOQ.js → chunk-ICKTXS6B.js} +1 -1
- package/dist/{chunk-HAQWCNDY.cjs → chunk-IG4BW3ZB.cjs} +3 -3
- package/dist/{chunk-KLNKIQQM.cjs → chunk-IVKJJLG7.cjs} +2 -2
- package/dist/{chunk-SMHJRNCR.cjs → chunk-LCMJYFHC.cjs} +14 -13
- package/dist/{chunk-DXQX7ZIL.cjs → chunk-LZADKC4Y.cjs} +6 -0
- package/dist/{chunk-S3ZZ3ZA7.js → chunk-ME6Z7TZW.js} +6 -1
- package/dist/{chunk-P252YNRA.js → chunk-PGBYYKFQ.js} +6 -6
- package/dist/{chunk-PZJT2Y5B.cjs → chunk-QSHOJ3NJ.cjs} +7 -7
- package/dist/{chunk-CUR7CHR5.js → chunk-TY5NK7NW.js} +1 -1
- package/dist/{chunk-NXQIWB36.js → chunk-VYHAWRJR.js} +2 -2
- package/dist/{chunk-L43KF3AC.js → chunk-W6BDMNSU.js} +1 -1
- package/dist/{chunk-B3BXKMQA.cjs → chunk-YLLAP3H2.cjs} +2 -2
- package/dist/{chunk-FU46MZTI.cjs → chunk-ZQOESVVE.cjs} +23 -23
- package/dist/{collections-fGX_D_Mi.d.cts → collections-8YdINtUf.d.cts} +1 -1
- package/dist/{collections-kERS_kZw.d.ts → collections-ycrA2cPL.d.ts} +1 -1
- package/dist/components/address-form.cjs +5 -4
- package/dist/components/address-form.js +4 -3
- 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 +7 -7
- package/dist/components/index.d.cts +5 -5
- package/dist/components/index.d.ts +5 -5
- package/dist/components/index.js +5 -5
- package/dist/components/share-button.cjs +4 -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 +3 -2
- package/dist/components/theme-data-initializer.d.cts +5 -5
- package/dist/components/theme-data-initializer.d.ts +5 -5
- package/dist/hooks/index.cjs +31 -30
- package/dist/hooks/index.d.cts +4 -4
- package/dist/hooks/index.d.ts +4 -4
- package/dist/hooks/index.js +10 -9
- package/dist/{booking-Bpj3o6Av.d.cts → instagram-CqJBZ-0X.d.ts} +56 -2
- package/dist/{booking-cbb8kh2L.d.ts → instagram-D4JUT4ZU.d.cts} +56 -2
- package/dist/models/index.d.cts +6 -6
- package/dist/models/index.d.ts +6 -6
- package/dist/{orders-BhmpycYJ.d.ts → orders-9_scVq_M.d.cts} +3 -2
- package/dist/{orders-CGwKT5L-.d.cts → orders-C1XZr8tx.d.ts} +3 -2
- package/dist/{pixelEvents-CA14Tvrs.d.ts → pixelEvents-D0sH22Er.d.ts} +14 -7
- package/dist/{pixelEvents-Do1wT3z_.d.cts → pixelEvents-uiPHbiAQ.d.cts} +14 -7
- package/dist/{product-B8elBN21.d.cts → product-CZtFWhxO.d.cts} +3 -0
- package/dist/{product-B8elBN21.d.ts → product-CZtFWhxO.d.ts} +3 -0
- package/dist/store/index.cjs +9 -9
- package/dist/store/index.d.cts +7 -7
- package/dist/store/index.d.ts +7 -7
- package/dist/store/index.js +4 -4
- package/dist/utils/index.cjs +31 -27
- package/dist/utils/index.d.cts +13 -9
- package/dist/utils/index.d.ts +13 -9
- package/dist/utils/index.js +4 -4
- package/dist/{wishlist-B-bvvOxv.d.ts → wishlist-CRNbfFIx.d.ts} +1 -1
- package/dist/{wishlist-BdpIFX5_.d.cts → wishlist-Cx9Vrszq.d.cts} +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunk5BT3MH4A_cjs = require('./chunk-5BT3MH4A.cjs');
|
|
4
|
+
var chunkLCMJYFHC_cjs = require('./chunk-LCMJYFHC.cjs');
|
|
5
|
+
var chunkLZADKC4Y_cjs = require('./chunk-LZADKC4Y.cjs');
|
|
6
6
|
var chunkBBRXE57K_cjs = require('./chunk-BBRXE57K.cjs');
|
|
7
7
|
var chunkNE3ZHELZ_cjs = require('./chunk-NE3ZHELZ.cjs');
|
|
8
8
|
var zustand = require('zustand');
|
|
@@ -21,18 +21,18 @@ var useCartStore = zustand.create((set) => ({
|
|
|
21
21
|
if (!state.cart) return { ...state, total_quantity: 0 };
|
|
22
22
|
return { cart: { ...state.cart, total_quantity: 0 }, total_quantity: 0 };
|
|
23
23
|
}),
|
|
24
|
-
|
|
24
|
+
fetchCartItemQuantity: async () => {
|
|
25
25
|
try {
|
|
26
|
-
const { total_quantity } = await
|
|
26
|
+
const { total_quantity } = await chunk5BT3MH4A_cjs.getCartItemQuantity();
|
|
27
27
|
set({ total_quantity });
|
|
28
28
|
} catch (error) {
|
|
29
|
-
console.error("Failed to fetch cart quantity", error);
|
|
29
|
+
console.error("Failed to fetch cart item quantity", error);
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
syncCart: async (addressId, shippingOptionId) => {
|
|
33
33
|
set({ status: "loading" /* LOADING */ });
|
|
34
34
|
try {
|
|
35
|
-
const response = await
|
|
35
|
+
const response = await chunk5BT3MH4A_cjs.getCart("/customer/cart/", addressId, shippingOptionId);
|
|
36
36
|
if (response) {
|
|
37
37
|
set({ cart: response, total_quantity: response.total_quantity, status: "idle" /* IDLE */ });
|
|
38
38
|
}
|
|
@@ -43,7 +43,7 @@ var useCartStore = zustand.create((set) => ({
|
|
|
43
43
|
fetchCart: async (addressId, shippingOptionId) => {
|
|
44
44
|
set({ status: "loading" /* LOADING */ });
|
|
45
45
|
try {
|
|
46
|
-
const response = await
|
|
46
|
+
const response = await chunk5BT3MH4A_cjs.getCart("/customer/cart/", addressId, shippingOptionId);
|
|
47
47
|
if (response) {
|
|
48
48
|
set({ cart: response, total_quantity: response.total_quantity, status: "idle" /* IDLE */ });
|
|
49
49
|
}
|
|
@@ -55,21 +55,21 @@ var useCartStore = zustand.create((set) => ({
|
|
|
55
55
|
set({ status: "loading" /* LOADING */ });
|
|
56
56
|
try {
|
|
57
57
|
if (chunkBBRXE57K_cjs.auth_default.getUserDetails()) {
|
|
58
|
-
await
|
|
58
|
+
await chunk5BT3MH4A_cjs.addToCart(items, customizationInputs);
|
|
59
59
|
await useCartStore.getState().syncCart(addressId);
|
|
60
60
|
} else {
|
|
61
|
-
const cart =
|
|
61
|
+
const cart = chunkLCMJYFHC_cjs.cart_default.get();
|
|
62
62
|
if (cart) {
|
|
63
63
|
items.forEach((item) => {
|
|
64
64
|
const product = cart.product_variants.find(
|
|
65
65
|
(p) => p.id === item.variant_id
|
|
66
66
|
);
|
|
67
67
|
if (product) {
|
|
68
|
-
|
|
68
|
+
chunkLCMJYFHC_cjs.cart_default.add(product, item.quantity);
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
const updatedCart =
|
|
72
|
+
const updatedCart = chunkLCMJYFHC_cjs.cart_default.get();
|
|
73
73
|
if (updatedCart) {
|
|
74
74
|
set({ cart: updatedCart, total_quantity: updatedCart.total_quantity });
|
|
75
75
|
}
|
|
@@ -83,19 +83,19 @@ var useCartStore = zustand.create((set) => ({
|
|
|
83
83
|
set({ status: "loading" /* LOADING */ });
|
|
84
84
|
try {
|
|
85
85
|
if (chunkBBRXE57K_cjs.auth_default.getUserDetails()) {
|
|
86
|
-
await
|
|
86
|
+
await chunk5BT3MH4A_cjs.removeFromCart(items);
|
|
87
87
|
await useCartStore.getState().syncCart(addressId);
|
|
88
88
|
} else {
|
|
89
|
-
const cart =
|
|
89
|
+
const cart = chunkLCMJYFHC_cjs.cart_default.get();
|
|
90
90
|
if (cart) {
|
|
91
91
|
items.forEach((item) => {
|
|
92
92
|
const product = cart.product_variants.find(
|
|
93
93
|
(p) => p.id === item.variant_id
|
|
94
94
|
);
|
|
95
|
-
if (product)
|
|
95
|
+
if (product) chunkLCMJYFHC_cjs.cart_default.remove(product);
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
-
const updatedCart =
|
|
98
|
+
const updatedCart = chunkLCMJYFHC_cjs.cart_default.get();
|
|
99
99
|
if (updatedCart) {
|
|
100
100
|
set({
|
|
101
101
|
cart: updatedCart,
|
|
@@ -114,19 +114,19 @@ var useCartStore = zustand.create((set) => ({
|
|
|
114
114
|
set({ status: "loading" /* LOADING */ });
|
|
115
115
|
try {
|
|
116
116
|
if (chunkBBRXE57K_cjs.auth_default.getUserDetails()) {
|
|
117
|
-
await
|
|
117
|
+
await chunk5BT3MH4A_cjs.updateCart(items);
|
|
118
118
|
await useCartStore.getState().syncCart(addressId);
|
|
119
119
|
} else {
|
|
120
|
-
const cart =
|
|
120
|
+
const cart = chunkLCMJYFHC_cjs.cart_default.get();
|
|
121
121
|
if (cart) {
|
|
122
122
|
items.forEach((item) => {
|
|
123
123
|
const product = cart.product_variants.find(
|
|
124
124
|
(p) => p.id === item.variant_id
|
|
125
125
|
);
|
|
126
|
-
if (product)
|
|
126
|
+
if (product) chunkLCMJYFHC_cjs.cart_default.updateQuantity(product, item.quantity);
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
const updatedCart =
|
|
129
|
+
const updatedCart = chunkLCMJYFHC_cjs.cart_default.get();
|
|
130
130
|
if (updatedCart) {
|
|
131
131
|
set({
|
|
132
132
|
cart: updatedCart,
|
|
@@ -142,7 +142,7 @@ var useCartStore = zustand.create((set) => ({
|
|
|
142
142
|
updateCustomization: async (customizationInputs) => {
|
|
143
143
|
set({ status: "loading" /* LOADING */ });
|
|
144
144
|
try {
|
|
145
|
-
await
|
|
145
|
+
await chunkLZADKC4Y_cjs.updateOrderCustomization({ customization_inputs: customizationInputs });
|
|
146
146
|
} catch {
|
|
147
147
|
} finally {
|
|
148
148
|
set({ status: "idle" /* IDLE */ });
|
|
@@ -174,7 +174,7 @@ var useAuthStore = zustand.create((set, get) => ({
|
|
|
174
174
|
setTimeout(async () => {
|
|
175
175
|
try {
|
|
176
176
|
set({ user, status: "success" /* SUCCESS */, isAuthenticated: true });
|
|
177
|
-
const localCartItems =
|
|
177
|
+
const localCartItems = chunkLCMJYFHC_cjs.cart_default.get();
|
|
178
178
|
if (localCartItems) {
|
|
179
179
|
await useCartStore.getState().addToCart(
|
|
180
180
|
Object.entries(localCartItems.products_quantity).map(
|
|
@@ -184,7 +184,7 @@ var useAuthStore = zustand.create((set, get) => ({
|
|
|
184
184
|
})
|
|
185
185
|
)
|
|
186
186
|
);
|
|
187
|
-
|
|
187
|
+
chunkLCMJYFHC_cjs.cart_default.clear();
|
|
188
188
|
await useCartStore.getState().fetchCart();
|
|
189
189
|
setTimeout(() => {
|
|
190
190
|
if (!preventRefreshAfterLogin) {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkYLLAP3H2_cjs = require('../chunk-YLLAP3H2.cjs');
|
|
4
4
|
require('../chunk-V447PVRV.cjs');
|
|
5
|
-
require('../chunk-
|
|
5
|
+
require('../chunk-IVKJJLG7.cjs');
|
|
6
6
|
require('../chunk-RDUT4W3B.cjs');
|
|
7
7
|
require('../chunk-LJUGNSQQ.cjs');
|
|
8
|
-
require('../chunk-
|
|
8
|
+
require('../chunk-6LS5F4R3.cjs');
|
|
9
|
+
require('../chunk-BBRB475I.cjs');
|
|
9
10
|
require('../chunk-TB72NPRM.cjs');
|
|
10
11
|
require('../chunk-ECHV2JSY.cjs');
|
|
11
12
|
require('../chunk-BBRXE57K.cjs');
|
|
@@ -14,4 +15,4 @@ require('../chunk-N3CTXRFT.cjs');
|
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
|
|
17
|
-
module.exports =
|
|
18
|
+
module.exports = chunkYLLAP3H2_cjs.address_form_default;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export { address_form_default as default } from '../chunk-
|
|
1
|
+
export { address_form_default as default } from '../chunk-W6BDMNSU.js';
|
|
2
2
|
import '../chunk-YK4M3SFP.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-ICKTXS6B.js';
|
|
4
4
|
import '../chunk-ZGMLOLTC.js';
|
|
5
5
|
import '../chunk-OSM73ETC.js';
|
|
6
|
-
import '../chunk-
|
|
6
|
+
import '../chunk-CBKJ3Y2I.js';
|
|
7
|
+
import '../chunk-HSF2D56O.js';
|
|
7
8
|
import '../chunk-ELP23UGF.js';
|
|
8
9
|
import '../chunk-3SYYP3XV.js';
|
|
9
10
|
import '../chunk-WEMNXIRS.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as Order } from '../orders-
|
|
2
|
-
import { f as ProductDetail } from '../product-
|
|
1
|
+
import { O as Order } from '../orders-9_scVq_M.cjs';
|
|
2
|
+
import { f as ProductDetail } from '../product-CZtFWhxO.cjs';
|
|
3
3
|
import 'react-toastify';
|
|
4
4
|
|
|
5
5
|
interface DigitalProductDownloadModalProps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as Order } from '../orders-
|
|
2
|
-
import { f as ProductDetail } from '../product-
|
|
1
|
+
import { O as Order } from '../orders-C1XZr8tx.js';
|
|
2
|
+
import { f as ProductDetail } from '../product-CZtFWhxO.js';
|
|
3
3
|
import 'react-toastify';
|
|
4
4
|
|
|
5
5
|
interface DigitalProductDownloadModalProps {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkYLLAP3H2_cjs = require('../chunk-YLLAP3H2.cjs');
|
|
4
4
|
var chunkV447PVRV_cjs = require('../chunk-V447PVRV.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkIG4BW3ZB_cjs = require('../chunk-IG4BW3ZB.cjs');
|
|
6
6
|
var chunk3YRSHPM6_cjs = require('../chunk-3YRSHPM6.cjs');
|
|
7
7
|
var chunk6DXB4O6P_cjs = require('../chunk-6DXB4O6P.cjs');
|
|
8
8
|
var chunkLHF5BSWO_cjs = require('../chunk-LHF5BSWO.cjs');
|
|
9
|
-
require('../chunk-
|
|
10
|
-
require('../chunk-KLNKIQQM.cjs');
|
|
9
|
+
require('../chunk-IVKJJLG7.cjs');
|
|
11
10
|
require('../chunk-RDUT4W3B.cjs');
|
|
12
11
|
require('../chunk-LJUGNSQQ.cjs');
|
|
13
|
-
require('../chunk-
|
|
12
|
+
require('../chunk-6LS5F4R3.cjs');
|
|
13
|
+
require('../chunk-BBRB475I.cjs');
|
|
14
14
|
require('../chunk-DODFO744.cjs');
|
|
15
15
|
require('../chunk-TB72NPRM.cjs');
|
|
16
16
|
require('../chunk-ECHV2JSY.cjs');
|
|
@@ -22,7 +22,7 @@ require('../chunk-N3CTXRFT.cjs');
|
|
|
22
22
|
|
|
23
23
|
Object.defineProperty(exports, "AddressForm", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkYLLAP3H2_cjs.address_form_default; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "SearchDropdown", {
|
|
28
28
|
enumerable: true,
|
|
@@ -30,7 +30,7 @@ Object.defineProperty(exports, "SearchDropdown", {
|
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "ShareButton", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkIG4BW3ZB_cjs.share_button_default; }
|
|
34
34
|
});
|
|
35
35
|
Object.defineProperty(exports, "ShareIcon", {
|
|
36
36
|
enumerable: true,
|
|
@@ -8,10 +8,10 @@ import 'react';
|
|
|
8
8
|
import '../useAddressForm-DGbEn91-.cjs';
|
|
9
9
|
import 'formik';
|
|
10
10
|
import '../address-DwBZHzbI.cjs';
|
|
11
|
-
import '../product-
|
|
11
|
+
import '../product-CZtFWhxO.cjs';
|
|
12
12
|
import 'react-toastify';
|
|
13
13
|
import 'react/jsx-runtime';
|
|
14
|
-
import '../orders-
|
|
15
|
-
import '../pixelEvents-
|
|
16
|
-
import '../cart-
|
|
17
|
-
import '../collections-
|
|
14
|
+
import '../orders-9_scVq_M.cjs';
|
|
15
|
+
import '../pixelEvents-uiPHbiAQ.cjs';
|
|
16
|
+
import '../cart-CyN2JQTw.cjs';
|
|
17
|
+
import '../collections-8YdINtUf.cjs';
|
|
@@ -8,10 +8,10 @@ import 'react';
|
|
|
8
8
|
import '../useAddressForm-cO3Au33k.js';
|
|
9
9
|
import 'formik';
|
|
10
10
|
import '../address-DwBZHzbI.js';
|
|
11
|
-
import '../product-
|
|
11
|
+
import '../product-CZtFWhxO.js';
|
|
12
12
|
import 'react-toastify';
|
|
13
13
|
import 'react/jsx-runtime';
|
|
14
|
-
import '../orders-
|
|
15
|
-
import '../pixelEvents-
|
|
16
|
-
import '../cart-
|
|
17
|
-
import '../collections-
|
|
14
|
+
import '../orders-C1XZr8tx.js';
|
|
15
|
+
import '../pixelEvents-D0sH22Er.js';
|
|
16
|
+
import '../cart-BGIsIZdM.js';
|
|
17
|
+
import '../collections-ycrA2cPL.js';
|
package/dist/components/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export { address_form_default as AddressForm } from '../chunk-
|
|
1
|
+
export { address_form_default as AddressForm } from '../chunk-W6BDMNSU.js';
|
|
2
2
|
export { search_dropdown_default as SearchDropdown } from '../chunk-YK4M3SFP.js';
|
|
3
|
-
export { share_button_default as ShareButton } from '../chunk-
|
|
3
|
+
export { share_button_default as ShareButton } from '../chunk-5XVHYPOC.js';
|
|
4
4
|
export { ShareIcon } from '../chunk-U7EXLQCT.js';
|
|
5
5
|
export { digital_product_download_modal_default as DigitalProductDownloadModal } from '../chunk-LLRSKDH5.js';
|
|
6
6
|
export { ThemeDataInitializer } from '../chunk-BTR3HLL4.js';
|
|
7
|
-
import '../chunk-
|
|
8
|
-
import '../chunk-6Q7QMPOQ.js';
|
|
7
|
+
import '../chunk-ICKTXS6B.js';
|
|
9
8
|
import '../chunk-ZGMLOLTC.js';
|
|
10
9
|
import '../chunk-OSM73ETC.js';
|
|
11
|
-
import '../chunk-
|
|
10
|
+
import '../chunk-CBKJ3Y2I.js';
|
|
11
|
+
import '../chunk-HSF2D56O.js';
|
|
12
12
|
import '../chunk-5NUDTIQ2.js';
|
|
13
13
|
import '../chunk-ELP23UGF.js';
|
|
14
14
|
import '../chunk-3SYYP3XV.js';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkIG4BW3ZB_cjs = require('../chunk-IG4BW3ZB.cjs');
|
|
4
4
|
require('../chunk-3YRSHPM6.cjs');
|
|
5
|
-
require('../chunk-
|
|
5
|
+
require('../chunk-6LS5F4R3.cjs');
|
|
6
|
+
require('../chunk-BBRB475I.cjs');
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
module.exports =
|
|
10
|
+
module.exports = chunkIG4BW3ZB_cjs.share_button_default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export { share_button_default as default } from '../chunk-
|
|
1
|
+
export { share_button_default as default } from '../chunk-5XVHYPOC.js';
|
|
2
2
|
import '../chunk-U7EXLQCT.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-CBKJ3Y2I.js';
|
|
4
|
+
import '../chunk-HSF2D56O.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { P as PageHeaderProps } from '../pixelEvents-
|
|
2
|
-
import '../cart-
|
|
3
|
-
import '../product-
|
|
1
|
+
import { P as PageHeaderProps } from '../pixelEvents-uiPHbiAQ.cjs';
|
|
2
|
+
import '../cart-CyN2JQTw.cjs';
|
|
3
|
+
import '../product-CZtFWhxO.cjs';
|
|
4
4
|
import 'react-toastify';
|
|
5
|
-
import '../collections-
|
|
6
|
-
import '../orders-
|
|
5
|
+
import '../collections-8YdINtUf.cjs';
|
|
6
|
+
import '../orders-9_scVq_M.cjs';
|
|
7
7
|
|
|
8
8
|
declare function ThemeDataInitializer({ themeData, }: {
|
|
9
9
|
themeData: PageHeaderProps;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { P as PageHeaderProps } from '../pixelEvents-
|
|
2
|
-
import '../cart-
|
|
3
|
-
import '../product-
|
|
1
|
+
import { P as PageHeaderProps } from '../pixelEvents-D0sH22Er.js';
|
|
2
|
+
import '../cart-BGIsIZdM.js';
|
|
3
|
+
import '../product-CZtFWhxO.js';
|
|
4
4
|
import 'react-toastify';
|
|
5
|
-
import '../collections-
|
|
6
|
-
import '../orders-
|
|
5
|
+
import '../collections-ycrA2cPL.js';
|
|
6
|
+
import '../orders-C1XZr8tx.js';
|
|
7
7
|
|
|
8
8
|
declare function ThemeDataInitializer({ themeData, }: {
|
|
9
9
|
themeData: PageHeaderProps;
|
package/dist/hooks/index.cjs
CHANGED
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkY46EHRJQ_cjs = require('../chunk-Y46EHRJQ.cjs');
|
|
4
4
|
var chunk2AHH3XBW_cjs = require('../chunk-2AHH3XBW.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
5
|
+
var chunkZQOESVVE_cjs = require('../chunk-ZQOESVVE.cjs');
|
|
6
|
+
var chunk5BT3MH4A_cjs = require('../chunk-5BT3MH4A.cjs');
|
|
7
|
+
var chunkLCMJYFHC_cjs = require('../chunk-LCMJYFHC.cjs');
|
|
8
|
+
var chunkQSHOJ3NJ_cjs = require('../chunk-QSHOJ3NJ.cjs');
|
|
9
9
|
var chunkXFOUNOKO_cjs = require('../chunk-XFOUNOKO.cjs');
|
|
10
10
|
require('../chunk-K44JZ5NL.cjs');
|
|
11
|
-
var
|
|
12
|
-
var
|
|
11
|
+
var chunkLZADKC4Y_cjs = require('../chunk-LZADKC4Y.cjs');
|
|
12
|
+
var chunkIVKJJLG7_cjs = require('../chunk-IVKJJLG7.cjs');
|
|
13
13
|
var chunkRDUT4W3B_cjs = require('../chunk-RDUT4W3B.cjs');
|
|
14
14
|
require('../chunk-LJUGNSQQ.cjs');
|
|
15
|
-
var
|
|
15
|
+
var chunk6LS5F4R3_cjs = require('../chunk-6LS5F4R3.cjs');
|
|
16
|
+
require('../chunk-BBRB475I.cjs');
|
|
16
17
|
require('../chunk-TB72NPRM.cjs');
|
|
17
18
|
require('../chunk-ECHV2JSY.cjs');
|
|
18
19
|
require('../chunk-BBRXE57K.cjs');
|
|
@@ -55,7 +56,7 @@ var useCart = (addressId) => {
|
|
|
55
56
|
async (addrId, shippingId) => {
|
|
56
57
|
try {
|
|
57
58
|
setIsLoading(true);
|
|
58
|
-
const result = await
|
|
59
|
+
const result = await chunk5BT3MH4A_cjs.getCart("/customer/cart/", addrId ?? addressId, shippingId);
|
|
59
60
|
setData(result);
|
|
60
61
|
setError(null);
|
|
61
62
|
} catch (err) {
|
|
@@ -90,7 +91,7 @@ var useOrders = (filters) => {
|
|
|
90
91
|
try {
|
|
91
92
|
setIsLoading(true);
|
|
92
93
|
const url = `/customer/order/?${queryString}`;
|
|
93
|
-
const result = await
|
|
94
|
+
const result = await chunkLZADKC4Y_cjs.getOrders(url);
|
|
94
95
|
setData(result);
|
|
95
96
|
setError(null);
|
|
96
97
|
} catch (err) {
|
|
@@ -127,7 +128,7 @@ function useGetProducts(initialFilter, options) {
|
|
|
127
128
|
apiParams[key] = value;
|
|
128
129
|
}
|
|
129
130
|
}
|
|
130
|
-
const result = await
|
|
131
|
+
const result = await chunk5BT3MH4A_cjs.getProductList(endpoint, apiParams);
|
|
131
132
|
setData(result);
|
|
132
133
|
if (modeRef.current === "append" && isLoadMoreRef.current) {
|
|
133
134
|
setProducts((prev) => [...prev, ...result.results || []]);
|
|
@@ -195,7 +196,7 @@ var useGetProductDetails = (slug) => {
|
|
|
195
196
|
const fetchData = react.useCallback(async () => {
|
|
196
197
|
try {
|
|
197
198
|
setIsLoading(true);
|
|
198
|
-
const result = await
|
|
199
|
+
const result = await chunk5BT3MH4A_cjs.getProductDetail("/inventory/products/", slug);
|
|
199
200
|
setData(result);
|
|
200
201
|
} catch (err) {
|
|
201
202
|
} finally {
|
|
@@ -218,7 +219,7 @@ var useGetProductCategories = () => {
|
|
|
218
219
|
const fetchData = async () => {
|
|
219
220
|
try {
|
|
220
221
|
setIsLoading(true);
|
|
221
|
-
const result = await
|
|
222
|
+
const result = await chunk5BT3MH4A_cjs.getProductCategories("/store/categories");
|
|
222
223
|
setData(result || []);
|
|
223
224
|
} catch (err) {
|
|
224
225
|
setError(err);
|
|
@@ -263,7 +264,7 @@ var useWishlist = () => {
|
|
|
263
264
|
const fetchData = react.useCallback(async () => {
|
|
264
265
|
try {
|
|
265
266
|
setIsLoading(true);
|
|
266
|
-
const response = await
|
|
267
|
+
const response = await chunk5BT3MH4A_cjs.getWishlist("/customer/wishlist/");
|
|
267
268
|
if (response.data) setData(response.data);
|
|
268
269
|
setError(null);
|
|
269
270
|
} catch (err) {
|
|
@@ -321,7 +322,7 @@ function useCheckoutPayment(options) {
|
|
|
321
322
|
const [isConfirmingPayment, setIsConfirmingPayment] = react.useState(false);
|
|
322
323
|
const [showSuccessModal, setShowSuccessModal] = react.useState(false);
|
|
323
324
|
const [showFailureModal, setShowFailureModal] = react.useState(false);
|
|
324
|
-
const resetCartCount =
|
|
325
|
+
const resetCartCount = chunkZQOESVVE_cjs.useCartStore((s) => s.resetCartCount);
|
|
325
326
|
const callbacks = {
|
|
326
327
|
onSuccess: (order) => {
|
|
327
328
|
setOrderSummary(order);
|
|
@@ -344,7 +345,7 @@ function useCheckoutPayment(options) {
|
|
|
344
345
|
try {
|
|
345
346
|
setIsPlacingOrder(true);
|
|
346
347
|
const isCod = paymentMethod === "cod";
|
|
347
|
-
const response = await
|
|
348
|
+
const response = await chunkLZADKC4Y_cjs.placeOrder(
|
|
348
349
|
addressId,
|
|
349
350
|
options.phonepeRedirectUrl,
|
|
350
351
|
isCod,
|
|
@@ -354,7 +355,7 @@ function useCheckoutPayment(options) {
|
|
|
354
355
|
);
|
|
355
356
|
const order = response.data;
|
|
356
357
|
setOrderSummary(order);
|
|
357
|
-
|
|
358
|
+
chunkQSHOJ3NJ_cjs.processPayment(order, paymentMethod, callbacks);
|
|
358
359
|
} catch {
|
|
359
360
|
setShowFailureModal(true);
|
|
360
361
|
} finally {
|
|
@@ -384,7 +385,7 @@ function useCheckoutCoupon(options) {
|
|
|
384
385
|
const refreshCoupons = react.useCallback(async () => {
|
|
385
386
|
setIsLoading(true);
|
|
386
387
|
try {
|
|
387
|
-
const coupons = await
|
|
388
|
+
const coupons = await chunkQSHOJ3NJ_cjs.fetchAvailableCoupons();
|
|
388
389
|
setAvailableCoupons(coupons);
|
|
389
390
|
} catch {
|
|
390
391
|
} finally {
|
|
@@ -396,7 +397,7 @@ function useCheckoutCoupon(options) {
|
|
|
396
397
|
setError(null);
|
|
397
398
|
setIsApplying(true);
|
|
398
399
|
try {
|
|
399
|
-
const coupon = await
|
|
400
|
+
const coupon = await chunkQSHOJ3NJ_cjs.applyCheckoutCoupon(code, callbacks);
|
|
400
401
|
setAppliedCoupon(coupon);
|
|
401
402
|
} catch (err) {
|
|
402
403
|
setError(err instanceof Error ? err.message : "Failed to apply coupon");
|
|
@@ -409,7 +410,7 @@ function useCheckoutCoupon(options) {
|
|
|
409
410
|
const removeCouponHandler = react.useCallback(async () => {
|
|
410
411
|
if (!appliedCoupon) return;
|
|
411
412
|
try {
|
|
412
|
-
await
|
|
413
|
+
await chunkQSHOJ3NJ_cjs.removeCheckoutCoupon(appliedCoupon.coupon_code, callbacks);
|
|
413
414
|
setAppliedCoupon(null);
|
|
414
415
|
setError(null);
|
|
415
416
|
} catch {
|
|
@@ -508,8 +509,8 @@ function useVariantSelector(options) {
|
|
|
508
509
|
}
|
|
509
510
|
function useShopCheckout(options) {
|
|
510
511
|
const { product, onNavigateToCart, onToast } = options;
|
|
511
|
-
const { addToCart, setCart } =
|
|
512
|
-
const isUserAuthenticated =
|
|
512
|
+
const { addToCart, setCart } = chunkZQOESVVE_cjs.useCartStore();
|
|
513
|
+
const isUserAuthenticated = chunkZQOESVVE_cjs.useAuthStore((s) => s.isAuthenticated);
|
|
513
514
|
const [isWishlisted, setIsWishlisted] = react.useState(product.is_wishlisted);
|
|
514
515
|
const [isAddedToCart, setIsAddedToCart] = react.useState(false);
|
|
515
516
|
const [loading, setLoading] = react.useState(false);
|
|
@@ -520,7 +521,7 @@ function useShopCheckout(options) {
|
|
|
520
521
|
react.useEffect(() => {
|
|
521
522
|
const fetchCategories = async () => {
|
|
522
523
|
try {
|
|
523
|
-
const response = await
|
|
524
|
+
const response = await chunk5BT3MH4A_cjs.getCategories();
|
|
524
525
|
setCategories(response.data);
|
|
525
526
|
} catch (error) {
|
|
526
527
|
console.log(error);
|
|
@@ -547,8 +548,8 @@ function useShopCheckout(options) {
|
|
|
547
548
|
setLoading(false);
|
|
548
549
|
}
|
|
549
550
|
} else {
|
|
550
|
-
|
|
551
|
-
const localCartItems =
|
|
551
|
+
chunkLCMJYFHC_cjs.cart_default.add(product, quantity);
|
|
552
|
+
const localCartItems = chunkLCMJYFHC_cjs.cart_default.get();
|
|
552
553
|
if (localCartItems) {
|
|
553
554
|
setCart(localCartItems);
|
|
554
555
|
}
|
|
@@ -593,8 +594,8 @@ function useShopCheckout(options) {
|
|
|
593
594
|
setLoading(false);
|
|
594
595
|
}
|
|
595
596
|
} else {
|
|
596
|
-
|
|
597
|
-
const localCartItems =
|
|
597
|
+
chunkLCMJYFHC_cjs.cart_default.add(product, quantity);
|
|
598
|
+
const localCartItems = chunkLCMJYFHC_cjs.cart_default.get();
|
|
598
599
|
if (localCartItems) {
|
|
599
600
|
setCart(localCartItems);
|
|
600
601
|
}
|
|
@@ -615,8 +616,8 @@ function useShopCheckout(options) {
|
|
|
615
616
|
setQuantity(value);
|
|
616
617
|
}, []);
|
|
617
618
|
const handleShare = react.useCallback(() => {
|
|
618
|
-
|
|
619
|
-
`Buy ${product.name} at ${
|
|
619
|
+
chunk6LS5F4R3_cjs.shareLink(
|
|
620
|
+
`Buy ${product.name} at ${chunk6LS5F4R3_cjs.convertToCurrency(
|
|
620
621
|
Number(product.selling_price)
|
|
621
622
|
)}`,
|
|
622
623
|
product.name
|
|
@@ -634,7 +635,7 @@ function useShopCheckout(options) {
|
|
|
634
635
|
const handleNotifyMeFormSubmit = react.useCallback(
|
|
635
636
|
async (values) => {
|
|
636
637
|
try {
|
|
637
|
-
const response = await
|
|
638
|
+
const response = await chunk5BT3MH4A_cjs.notifyProductStock({
|
|
638
639
|
...values,
|
|
639
640
|
variant_slug: product.slug
|
|
640
641
|
});
|
|
@@ -769,7 +770,7 @@ function useCoupon(options = {}) {
|
|
|
769
770
|
|
|
770
771
|
Object.defineProperty(exports, "useAddressForm", {
|
|
771
772
|
enumerable: true,
|
|
772
|
-
get: function () { return
|
|
773
|
+
get: function () { return chunkIVKJJLG7_cjs.useAddressForm; }
|
|
773
774
|
});
|
|
774
775
|
exports.useAddress = useAddress;
|
|
775
776
|
exports.useCart = useCart;
|
package/dist/hooks/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { A as Address } from '../address-DwBZHzbI.cjs';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { C as Cart, b as Category, U as User, c as Coupon } from '../cart-
|
|
4
|
-
import { O as Order } from '../orders-
|
|
5
|
-
import { d as Product, f as ProductDetail, e as ProductAttribute, A as Attributes } from '../product-
|
|
6
|
-
import { W as Wishlist } from '../wishlist-
|
|
3
|
+
import { C as Cart, b as Category, U as User, c as Coupon } from '../cart-CyN2JQTw.cjs';
|
|
4
|
+
import { O as Order } from '../orders-9_scVq_M.cjs';
|
|
5
|
+
import { d as Product, f as ProductDetail, e as ProductAttribute, A as Attributes } from '../product-CZtFWhxO.cjs';
|
|
6
|
+
import { W as Wishlist } from '../wishlist-Cx9Vrszq.cjs';
|
|
7
7
|
export { U as UseAddressFormOptions, a as UseAddressFormReturn, u as useAddressForm } from '../useAddressForm-DGbEn91-.cjs';
|
|
8
8
|
import 'react-toastify';
|
|
9
9
|
import 'formik';
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { A as Address } from '../address-DwBZHzbI.js';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { C as Cart, b as Category, U as User, c as Coupon } from '../cart-
|
|
4
|
-
import { O as Order } from '../orders-
|
|
5
|
-
import { d as Product, f as ProductDetail, e as ProductAttribute, A as Attributes } from '../product-
|
|
6
|
-
import { W as Wishlist } from '../wishlist-
|
|
3
|
+
import { C as Cart, b as Category, U as User, c as Coupon } from '../cart-BGIsIZdM.js';
|
|
4
|
+
import { O as Order } from '../orders-C1XZr8tx.js';
|
|
5
|
+
import { d as Product, f as ProductDetail, e as ProductAttribute, A as Attributes } from '../product-CZtFWhxO.js';
|
|
6
|
+
import { W as Wishlist } from '../wishlist-CRNbfFIx.js';
|
|
7
7
|
export { U as UseAddressFormOptions, a as UseAddressFormReturn, u as useAddressForm } from '../useAddressForm-cO3Au33k.js';
|
|
8
8
|
import 'react-toastify';
|
|
9
9
|
import 'formik';
|