@storepecker/storefront-core 2.3.3 → 2.3.5
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/{chunk-WZ6I3N4O.cjs → chunk-JH4JJBXE.cjs} +2 -3
- package/dist/{chunk-ANTJLYQD.js → chunk-TF2KMTB6.js} +2 -3
- package/dist/hooks/index.cjs +4 -4
- package/dist/hooks/index.js +1 -1
- package/dist/store/index.cjs +4 -4
- package/dist/store/index.d.cts +3 -4
- package/dist/store/index.d.ts +3 -4
- package/dist/store/index.js +1 -1
- package/package.json +1 -1
|
@@ -120,11 +120,10 @@ var useCartStore = zustand.create((set) => ({
|
|
|
120
120
|
set({ status: "idle" /* IDLE */ });
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
|
-
updateCustomization: async (
|
|
123
|
+
updateCustomization: async (customizationInputs) => {
|
|
124
124
|
set({ status: "loading" /* LOADING */ });
|
|
125
125
|
try {
|
|
126
|
-
await chunkHTFVROIV_cjs.updateOrderCustomization(
|
|
127
|
-
await useCartStore.getState().syncCart();
|
|
126
|
+
await chunkHTFVROIV_cjs.updateOrderCustomization({ customization_inputs: customizationInputs });
|
|
128
127
|
} catch {
|
|
129
128
|
} finally {
|
|
130
129
|
set({ status: "idle" /* IDLE */ });
|
|
@@ -118,11 +118,10 @@ var useCartStore = create((set) => ({
|
|
|
118
118
|
set({ status: "idle" /* IDLE */ });
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
|
-
updateCustomization: async (
|
|
121
|
+
updateCustomization: async (customizationInputs) => {
|
|
122
122
|
set({ status: "loading" /* LOADING */ });
|
|
123
123
|
try {
|
|
124
|
-
await updateOrderCustomization(
|
|
125
|
-
await useCartStore.getState().syncCart();
|
|
124
|
+
await updateOrderCustomization({ customization_inputs: customizationInputs });
|
|
126
125
|
} catch {
|
|
127
126
|
} finally {
|
|
128
127
|
set({ status: "idle" /* IDLE */ });
|
package/dist/hooks/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkY46EHRJQ_cjs = require('../chunk-Y46EHRJQ.cjs');
|
|
4
4
|
var chunk2AHH3XBW_cjs = require('../chunk-2AHH3XBW.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkJH4JJBXE_cjs = require('../chunk-JH4JJBXE.cjs');
|
|
6
6
|
var chunkY2CPMT34_cjs = require('../chunk-Y2CPMT34.cjs');
|
|
7
7
|
var chunkSMHJRNCR_cjs = require('../chunk-SMHJRNCR.cjs');
|
|
8
8
|
var chunkBTT3XQ32_cjs = require('../chunk-BTT3XQ32.cjs');
|
|
@@ -320,7 +320,7 @@ function useCheckoutPayment(options) {
|
|
|
320
320
|
const [isConfirmingPayment, setIsConfirmingPayment] = react.useState(false);
|
|
321
321
|
const [showSuccessModal, setShowSuccessModal] = react.useState(false);
|
|
322
322
|
const [showFailureModal, setShowFailureModal] = react.useState(false);
|
|
323
|
-
const resetCartCount =
|
|
323
|
+
const resetCartCount = chunkJH4JJBXE_cjs.useCartStore((s) => s.resetCartCount);
|
|
324
324
|
const callbacks = {
|
|
325
325
|
onSuccess: (order) => {
|
|
326
326
|
setOrderSummary(order);
|
|
@@ -506,8 +506,8 @@ function useVariantSelector(options) {
|
|
|
506
506
|
}
|
|
507
507
|
function useShopCheckout(options) {
|
|
508
508
|
const { product, onNavigateToCart, onToast } = options;
|
|
509
|
-
const { addToCart, setCart } =
|
|
510
|
-
const isUserAuthenticated =
|
|
509
|
+
const { addToCart, setCart } = chunkJH4JJBXE_cjs.useCartStore();
|
|
510
|
+
const isUserAuthenticated = chunkJH4JJBXE_cjs.useAuthStore((s) => s.isAuthenticated);
|
|
511
511
|
const [isWishlisted, setIsWishlisted] = react.useState(product.is_wishlisted);
|
|
512
512
|
const [isAddedToCart, setIsAddedToCart] = react.useState(false);
|
|
513
513
|
const [loading, setLoading] = react.useState(false);
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getUserDetails } from '../chunk-WYXT5AAG.js';
|
|
2
2
|
import { findMatchingVariant, findSimilarVariant, isVariantCombinationAvailable, isColorVariantType } from '../chunk-HEFA67WK.js';
|
|
3
|
-
import { useCartStore, useAuthStore } from '../chunk-
|
|
3
|
+
import { useCartStore, useAuthStore } from '../chunk-TF2KMTB6.js';
|
|
4
4
|
import { getCart, getProductList, getProductDetail, getWishlist, notifyProductStock, getProductCategories, getCategories } from '../chunk-U25T7M6S.js';
|
|
5
5
|
import { cart_default } from '../chunk-QAC72HKO.js';
|
|
6
6
|
import { processPayment, fetchAvailableCoupons, applyCheckoutCoupon, removeCheckoutCoupon } from '../chunk-Y4NGR42Z.js';
|
package/dist/store/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkJH4JJBXE_cjs = require('../chunk-JH4JJBXE.cjs');
|
|
4
4
|
var chunkY2CPMT34_cjs = require('../chunk-Y2CPMT34.cjs');
|
|
5
5
|
require('../chunk-SMHJRNCR.cjs');
|
|
6
6
|
require('../chunk-HTFVROIV.cjs');
|
|
@@ -68,15 +68,15 @@ var useProductStore = zustand.create((set, get) => ({
|
|
|
68
68
|
|
|
69
69
|
Object.defineProperty(exports, "loginUser", {
|
|
70
70
|
enumerable: true,
|
|
71
|
-
get: function () { return
|
|
71
|
+
get: function () { return chunkJH4JJBXE_cjs.loginUser; }
|
|
72
72
|
});
|
|
73
73
|
Object.defineProperty(exports, "useAuthStore", {
|
|
74
74
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
75
|
+
get: function () { return chunkJH4JJBXE_cjs.useAuthStore; }
|
|
76
76
|
});
|
|
77
77
|
Object.defineProperty(exports, "useCartStore", {
|
|
78
78
|
enumerable: true,
|
|
79
|
-
get: function () { return
|
|
79
|
+
get: function () { return chunkJH4JJBXE_cjs.useCartStore; }
|
|
80
80
|
});
|
|
81
81
|
exports.useProductStore = useProductStore;
|
|
82
82
|
exports.useWishlistStore = useWishlistStore;
|
package/dist/store/index.d.cts
CHANGED
|
@@ -33,10 +33,9 @@ interface CartStore extends CartState {
|
|
|
33
33
|
variant_id: number;
|
|
34
34
|
quantity: number;
|
|
35
35
|
}>, addressId?: number) => Promise<void>;
|
|
36
|
-
updateCustomization: (
|
|
37
|
-
|
|
38
|
-
customer_input: string;
|
|
39
|
-
product_variant: number;
|
|
36
|
+
updateCustomization: (customizationInputs: Array<{
|
|
37
|
+
id: number;
|
|
38
|
+
customer_input: string | number | boolean | null;
|
|
40
39
|
}>) => Promise<void>;
|
|
41
40
|
}
|
|
42
41
|
declare const useCartStore: zustand.UseBoundStore<zustand.StoreApi<CartStore>>;
|
package/dist/store/index.d.ts
CHANGED
|
@@ -33,10 +33,9 @@ interface CartStore extends CartState {
|
|
|
33
33
|
variant_id: number;
|
|
34
34
|
quantity: number;
|
|
35
35
|
}>, addressId?: number) => Promise<void>;
|
|
36
|
-
updateCustomization: (
|
|
37
|
-
|
|
38
|
-
customer_input: string;
|
|
39
|
-
product_variant: number;
|
|
36
|
+
updateCustomization: (customizationInputs: Array<{
|
|
37
|
+
id: number;
|
|
38
|
+
customer_input: string | number | boolean | null;
|
|
40
39
|
}>) => Promise<void>;
|
|
41
40
|
}
|
|
42
41
|
declare const useCartStore: zustand.UseBoundStore<zustand.StoreApi<CartStore>>;
|
package/dist/store/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { loginUser, useAuthStore, useCartStore } from '../chunk-
|
|
1
|
+
export { loginUser, useAuthStore, useCartStore } from '../chunk-TF2KMTB6.js';
|
|
2
2
|
import { getWishlist, getProducts } from '../chunk-U25T7M6S.js';
|
|
3
3
|
import '../chunk-QAC72HKO.js';
|
|
4
4
|
import '../chunk-LW3V53WJ.js';
|