@storepecker/storefront-core 2.4.2 → 2.5.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.
Files changed (37) hide show
  1. package/dist/api/index.cjs +50 -42
  2. package/dist/api/index.d.cts +11 -4
  3. package/dist/api/index.d.ts +11 -4
  4. package/dist/api/index.js +2 -2
  5. package/dist/{cart-y-7RPmnQ.d.ts → cart-CLf2ljxd.d.ts} +21 -0
  6. package/dist/{cart-kJoawc_Z.d.cts → cart-CuLMWnfy.d.cts} +21 -0
  7. package/dist/checkout/index.cjs +22 -22
  8. package/dist/checkout/index.d.cts +2 -2
  9. package/dist/checkout/index.d.ts +2 -2
  10. package/dist/checkout/index.js +2 -2
  11. package/dist/{chunk-QU53I4AA.cjs → chunk-23YAZNVF.cjs} +37 -18
  12. package/dist/{chunk-AOJRQMJZ.cjs → chunk-DXQX7ZIL.cjs} +8 -1
  13. package/dist/{chunk-Y2CPMT34.cjs → chunk-MTSMQAZR.cjs} +11 -3
  14. package/dist/{chunk-SFMTL3AQ.js → chunk-NXQIWB36.js} +10 -6
  15. package/dist/{chunk-ZIALBJZK.cjs → chunk-PZJT2Y5B.cjs} +15 -11
  16. package/dist/{chunk-YFF6DWZM.js → chunk-S3ZZ3ZA7.js} +8 -2
  17. package/dist/{chunk-BR45AXQP.js → chunk-VZAIAQZJ.js} +33 -14
  18. package/dist/{chunk-U25T7M6S.js → chunk-XURYZRER.js} +11 -4
  19. package/dist/components/index.d.cts +2 -2
  20. package/dist/components/index.d.ts +2 -2
  21. package/dist/components/theme-data-initializer.d.cts +2 -2
  22. package/dist/components/theme-data-initializer.d.ts +2 -2
  23. package/dist/hooks/index.cjs +22 -21
  24. package/dist/hooks/index.d.cts +2 -2
  25. package/dist/hooks/index.d.ts +2 -2
  26. package/dist/hooks/index.js +6 -5
  27. package/dist/models/index.d.cts +1 -1
  28. package/dist/models/index.d.ts +1 -1
  29. package/dist/{pixelEvents-C1rFPOwb.d.cts → pixelEvents-CXViXGtV.d.cts} +1 -1
  30. package/dist/{pixelEvents-Bo-VjAx8.d.ts → pixelEvents-LqK0Ltr_.d.ts} +1 -1
  31. package/dist/store/index.cjs +8 -8
  32. package/dist/store/index.d.cts +5 -4
  33. package/dist/store/index.d.ts +5 -4
  34. package/dist/store/index.js +3 -3
  35. package/dist/utils/index.d.cts +3 -3
  36. package/dist/utils/index.d.ts +3 -3
  37. package/package.json +1 -1
@@ -2,13 +2,13 @@
2
2
 
3
3
  var chunkY46EHRJQ_cjs = require('../chunk-Y46EHRJQ.cjs');
4
4
  var chunk2AHH3XBW_cjs = require('../chunk-2AHH3XBW.cjs');
5
- var chunkQU53I4AA_cjs = require('../chunk-QU53I4AA.cjs');
6
- var chunkY2CPMT34_cjs = require('../chunk-Y2CPMT34.cjs');
5
+ var chunk23YAZNVF_cjs = require('../chunk-23YAZNVF.cjs');
6
+ var chunkMTSMQAZR_cjs = require('../chunk-MTSMQAZR.cjs');
7
7
  var chunkSMHJRNCR_cjs = require('../chunk-SMHJRNCR.cjs');
8
- var chunkZIALBJZK_cjs = require('../chunk-ZIALBJZK.cjs');
8
+ var chunkPZJT2Y5B_cjs = require('../chunk-PZJT2Y5B.cjs');
9
9
  var chunkXFOUNOKO_cjs = require('../chunk-XFOUNOKO.cjs');
10
10
  require('../chunk-K44JZ5NL.cjs');
11
- var chunkAOJRQMJZ_cjs = require('../chunk-AOJRQMJZ.cjs');
11
+ var chunkDXQX7ZIL_cjs = require('../chunk-DXQX7ZIL.cjs');
12
12
  var chunkKLNKIQQM_cjs = require('../chunk-KLNKIQQM.cjs');
13
13
  var chunkRDUT4W3B_cjs = require('../chunk-RDUT4W3B.cjs');
14
14
  require('../chunk-LJUGNSQQ.cjs');
@@ -55,7 +55,7 @@ var useCart = (addressId) => {
55
55
  async (addrId) => {
56
56
  try {
57
57
  setIsLoading(true);
58
- const result = await chunkY2CPMT34_cjs.getCart("/customer/cart/", addrId ?? addressId);
58
+ const result = await chunkMTSMQAZR_cjs.getCart("/customer/cart/", addrId ?? addressId);
59
59
  setData(result);
60
60
  setError(null);
61
61
  } catch (err) {
@@ -90,7 +90,7 @@ var useOrders = (filters) => {
90
90
  try {
91
91
  setIsLoading(true);
92
92
  const url = `/customer/order/?${queryString}`;
93
- const result = await chunkAOJRQMJZ_cjs.getOrders(url);
93
+ const result = await chunkDXQX7ZIL_cjs.getOrders(url);
94
94
  setData(result);
95
95
  setError(null);
96
96
  } catch (err) {
@@ -127,7 +127,7 @@ function useGetProducts(initialFilter, options) {
127
127
  apiParams[key] = value;
128
128
  }
129
129
  }
130
- const result = await chunkY2CPMT34_cjs.getProductList(endpoint, apiParams);
130
+ const result = await chunkMTSMQAZR_cjs.getProductList(endpoint, apiParams);
131
131
  setData(result);
132
132
  if (modeRef.current === "append" && isLoadMoreRef.current) {
133
133
  setProducts((prev) => [...prev, ...result.results || []]);
@@ -195,7 +195,7 @@ var useGetProductDetails = (slug) => {
195
195
  const fetchData = react.useCallback(async () => {
196
196
  try {
197
197
  setIsLoading(true);
198
- const result = await chunkY2CPMT34_cjs.getProductDetail("/inventory/products/", slug);
198
+ const result = await chunkMTSMQAZR_cjs.getProductDetail("/inventory/products/", slug);
199
199
  setData(result);
200
200
  } catch (err) {
201
201
  } finally {
@@ -218,7 +218,7 @@ var useGetProductCategories = () => {
218
218
  const fetchData = async () => {
219
219
  try {
220
220
  setIsLoading(true);
221
- const result = await chunkY2CPMT34_cjs.getProductCategories("/store/categories");
221
+ const result = await chunkMTSMQAZR_cjs.getProductCategories("/store/categories");
222
222
  setData(result || []);
223
223
  } catch (err) {
224
224
  setError(err);
@@ -263,7 +263,7 @@ var useWishlist = () => {
263
263
  const fetchData = react.useCallback(async () => {
264
264
  try {
265
265
  setIsLoading(true);
266
- const response = await chunkY2CPMT34_cjs.getWishlist("/customer/wishlist/");
266
+ const response = await chunkMTSMQAZR_cjs.getWishlist("/customer/wishlist/");
267
267
  if (response.data) setData(response.data);
268
268
  setError(null);
269
269
  } catch (err) {
@@ -321,7 +321,7 @@ function useCheckoutPayment(options) {
321
321
  const [isConfirmingPayment, setIsConfirmingPayment] = react.useState(false);
322
322
  const [showSuccessModal, setShowSuccessModal] = react.useState(false);
323
323
  const [showFailureModal, setShowFailureModal] = react.useState(false);
324
- const resetCartCount = chunkQU53I4AA_cjs.useCartStore((s) => s.resetCartCount);
324
+ const resetCartCount = chunk23YAZNVF_cjs.useCartStore((s) => s.resetCartCount);
325
325
  const callbacks = {
326
326
  onSuccess: (order) => {
327
327
  setOrderSummary(order);
@@ -340,20 +340,21 @@ function useCheckoutPayment(options) {
340
340
  onPaymentEnd: () => setIsConfirmingPayment(false)
341
341
  };
342
342
  const placeAndPay = react.useCallback(
343
- async (addressId, paymentMethod) => {
343
+ async (addressId, paymentMethod, shippingOptionId) => {
344
344
  try {
345
345
  setIsPlacingOrder(true);
346
346
  const isCod = paymentMethod === "cod";
347
- const response = await chunkAOJRQMJZ_cjs.placeOrder(
347
+ const response = await chunkDXQX7ZIL_cjs.placeOrder(
348
348
  addressId,
349
349
  options.phonepeRedirectUrl,
350
350
  isCod,
351
+ shippingOptionId,
351
352
  options.stripeRedirectUrl,
352
353
  options.tabbyRedirectUrl
353
354
  );
354
355
  const order = response.data;
355
356
  setOrderSummary(order);
356
- chunkZIALBJZK_cjs.processPayment(order, paymentMethod, callbacks);
357
+ chunkPZJT2Y5B_cjs.processPayment(order, paymentMethod, callbacks);
357
358
  } catch {
358
359
  setShowFailureModal(true);
359
360
  } finally {
@@ -383,7 +384,7 @@ function useCheckoutCoupon(options) {
383
384
  const refreshCoupons = react.useCallback(async () => {
384
385
  setIsLoading(true);
385
386
  try {
386
- const coupons = await chunkZIALBJZK_cjs.fetchAvailableCoupons();
387
+ const coupons = await chunkPZJT2Y5B_cjs.fetchAvailableCoupons();
387
388
  setAvailableCoupons(coupons);
388
389
  } catch {
389
390
  } finally {
@@ -395,7 +396,7 @@ function useCheckoutCoupon(options) {
395
396
  setError(null);
396
397
  setIsApplying(true);
397
398
  try {
398
- const coupon = await chunkZIALBJZK_cjs.applyCheckoutCoupon(code, callbacks);
399
+ const coupon = await chunkPZJT2Y5B_cjs.applyCheckoutCoupon(code, callbacks);
399
400
  setAppliedCoupon(coupon);
400
401
  } catch (err) {
401
402
  setError(err instanceof Error ? err.message : "Failed to apply coupon");
@@ -408,7 +409,7 @@ function useCheckoutCoupon(options) {
408
409
  const removeCouponHandler = react.useCallback(async () => {
409
410
  if (!appliedCoupon) return;
410
411
  try {
411
- await chunkZIALBJZK_cjs.removeCheckoutCoupon(appliedCoupon.coupon_code, callbacks);
412
+ await chunkPZJT2Y5B_cjs.removeCheckoutCoupon(appliedCoupon.coupon_code, callbacks);
412
413
  setAppliedCoupon(null);
413
414
  setError(null);
414
415
  } catch {
@@ -507,8 +508,8 @@ function useVariantSelector(options) {
507
508
  }
508
509
  function useShopCheckout(options) {
509
510
  const { product, onNavigateToCart, onToast } = options;
510
- const { addToCart, setCart } = chunkQU53I4AA_cjs.useCartStore();
511
- const isUserAuthenticated = chunkQU53I4AA_cjs.useAuthStore((s) => s.isAuthenticated);
511
+ const { addToCart, setCart } = chunk23YAZNVF_cjs.useCartStore();
512
+ const isUserAuthenticated = chunk23YAZNVF_cjs.useAuthStore((s) => s.isAuthenticated);
512
513
  const [isWishlisted, setIsWishlisted] = react.useState(product.is_wishlisted);
513
514
  const [isAddedToCart, setIsAddedToCart] = react.useState(false);
514
515
  const [loading, setLoading] = react.useState(false);
@@ -519,7 +520,7 @@ function useShopCheckout(options) {
519
520
  react.useEffect(() => {
520
521
  const fetchCategories = async () => {
521
522
  try {
522
- const response = await chunkY2CPMT34_cjs.getCategories();
523
+ const response = await chunkMTSMQAZR_cjs.getCategories();
523
524
  setCategories(response.data);
524
525
  } catch (error) {
525
526
  console.log(error);
@@ -633,7 +634,7 @@ function useShopCheckout(options) {
633
634
  const handleNotifyMeFormSubmit = react.useCallback(
634
635
  async (values) => {
635
636
  try {
636
- const response = await chunkY2CPMT34_cjs.notifyProductStock({
637
+ const response = await chunkMTSMQAZR_cjs.notifyProductStock({
637
638
  ...values,
638
639
  variant_slug: product.slug
639
640
  });
@@ -1,6 +1,6 @@
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-kJoawc_Z.cjs';
3
+ import { C as Cart, b as Category, U as User, c as Coupon } from '../cart-CuLMWnfy.cjs';
4
4
  import { O as Order } from '../orders-CjNmCY5I.cjs';
5
5
  import { d as Product, f as ProductDetail, e as ProductAttribute, A as Attributes } from '../product-DJMdi4D4.cjs';
6
6
  import { W as Wishlist } from '../wishlist-CUuCTSVJ.cjs';
@@ -108,7 +108,7 @@ interface UseCheckoutPaymentReturn {
108
108
  showFailureModal: boolean;
109
109
  setShowSuccessModal: (show: boolean) => void;
110
110
  setShowFailureModal: (show: boolean) => void;
111
- placeAndPay: (addressId: number, paymentMethod: string) => Promise<void>;
111
+ placeAndPay: (addressId: number, paymentMethod: string, shippingOptionId?: number) => Promise<void>;
112
112
  }
113
113
  /**
114
114
  * Hook that manages the full checkout payment flow:
@@ -1,6 +1,6 @@
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-y-7RPmnQ.js';
3
+ import { C as Cart, b as Category, U as User, c as Coupon } from '../cart-CLf2ljxd.js';
4
4
  import { O as Order } from '../orders-L_8eIkUS.js';
5
5
  import { d as Product, f as ProductDetail, e as ProductAttribute, A as Attributes } from '../product-DJMdi4D4.js';
6
6
  import { W as Wishlist } from '../wishlist-DKYFZR0s.js';
@@ -108,7 +108,7 @@ interface UseCheckoutPaymentReturn {
108
108
  showFailureModal: boolean;
109
109
  setShowSuccessModal: (show: boolean) => void;
110
110
  setShowFailureModal: (show: boolean) => void;
111
- placeAndPay: (addressId: number, paymentMethod: string) => Promise<void>;
111
+ placeAndPay: (addressId: number, paymentMethod: string, shippingOptionId?: number) => Promise<void>;
112
112
  }
113
113
  /**
114
114
  * Hook that manages the full checkout payment flow:
@@ -1,12 +1,12 @@
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-BR45AXQP.js';
4
- import { getCart, getProductList, getProductDetail, getWishlist, notifyProductStock, getProductCategories, getCategories } from '../chunk-U25T7M6S.js';
3
+ import { useCartStore, useAuthStore } from '../chunk-VZAIAQZJ.js';
4
+ import { getCart, getProductList, getProductDetail, getWishlist, notifyProductStock, getProductCategories, getCategories } from '../chunk-XURYZRER.js';
5
5
  import { cart_default } from '../chunk-QAC72HKO.js';
6
- import { processPayment, fetchAvailableCoupons, applyCheckoutCoupon, removeCheckoutCoupon } from '../chunk-SFMTL3AQ.js';
6
+ import { processPayment, fetchAvailableCoupons, applyCheckoutCoupon, removeCheckoutCoupon } from '../chunk-NXQIWB36.js';
7
7
  import { applyCoupon, removeCoupon, getCoupons, getAppliedCoupon } from '../chunk-7M5CVYZJ.js';
8
8
  import '../chunk-WFDKKOO7.js';
9
- import { getOrders, placeOrder } from '../chunk-YFF6DWZM.js';
9
+ import { getOrders, placeOrder } from '../chunk-S3ZZ3ZA7.js';
10
10
  export { useAddressForm } from '../chunk-6Q7QMPOQ.js';
11
11
  import { getAddresses } from '../chunk-ZGMLOLTC.js';
12
12
  import '../chunk-OSM73ETC.js';
@@ -338,7 +338,7 @@ function useCheckoutPayment(options) {
338
338
  onPaymentEnd: () => setIsConfirmingPayment(false)
339
339
  };
340
340
  const placeAndPay = useCallback(
341
- async (addressId, paymentMethod) => {
341
+ async (addressId, paymentMethod, shippingOptionId) => {
342
342
  try {
343
343
  setIsPlacingOrder(true);
344
344
  const isCod = paymentMethod === "cod";
@@ -346,6 +346,7 @@ function useCheckoutPayment(options) {
346
346
  addressId,
347
347
  options.phonepeRedirectUrl,
348
348
  isCod,
349
+ shippingOptionId,
349
350
  options.stripeRedirectUrl,
350
351
  options.tabbyRedirectUrl
351
352
  );
@@ -1,6 +1,6 @@
1
1
  export { A as Address } from '../address-DwBZHzbI.cjs';
2
2
  export { A as Analytics, B as Booking, a as BookingDetails, R as Review } from '../booking-DX9SU_qm.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-kJoawc_Z.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-CuLMWnfy.cjs';
4
4
  export { A as CollectionAttributes, C as CollectionResponse, s as singleCollection } from '../collections-WzvTO0OQ.cjs';
5
5
  export { O as Order } from '../orders-CjNmCY5I.cjs';
6
6
  export { D as Data, P as PaymentInstrument, a as PhonePe } from '../phonepe-dWMLZel6.cjs';
@@ -1,6 +1,6 @@
1
1
  export { A as Address } from '../address-DwBZHzbI.js';
2
2
  export { A as Analytics, B as Booking, a as BookingDetails, R as Review } from '../booking-BVWe8HHh.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-y-7RPmnQ.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-CLf2ljxd.js';
4
4
  export { A as CollectionAttributes, C as CollectionResponse, s as singleCollection } from '../collections-BDSVfRNo.js';
5
5
  export { O as Order } from '../orders-L_8eIkUS.js';
6
6
  export { D as Data, P as PaymentInstrument, a as PhonePe } from '../phonepe-dWMLZel6.js';
@@ -1,4 +1,4 @@
1
- import { b as Category$1, C as Cart } from './cart-kJoawc_Z.cjs';
1
+ import { b as Category$1, C as Cart } from './cart-CuLMWnfy.cjs';
2
2
  import { C as CollectionResponse } from './collections-WzvTO0OQ.cjs';
3
3
  import { O as Order } from './orders-CjNmCY5I.cjs';
4
4
  import { f as ProductDetail, d as Product } from './product-DJMdi4D4.cjs';
@@ -1,4 +1,4 @@
1
- import { b as Category$1, C as Cart } from './cart-y-7RPmnQ.js';
1
+ import { b as Category$1, C as Cart } from './cart-CLf2ljxd.js';
2
2
  import { C as CollectionResponse } from './collections-BDSVfRNo.js';
3
3
  import { O as Order } from './orders-L_8eIkUS.js';
4
4
  import { f as ProductDetail, d as Product } from './product-DJMdi4D4.js';
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkQU53I4AA_cjs = require('../chunk-QU53I4AA.cjs');
4
- var chunkY2CPMT34_cjs = require('../chunk-Y2CPMT34.cjs');
3
+ var chunk23YAZNVF_cjs = require('../chunk-23YAZNVF.cjs');
4
+ var chunkMTSMQAZR_cjs = require('../chunk-MTSMQAZR.cjs');
5
5
  require('../chunk-SMHJRNCR.cjs');
6
- require('../chunk-AOJRQMJZ.cjs');
6
+ require('../chunk-DXQX7ZIL.cjs');
7
7
  var chunkDODFO744_cjs = require('../chunk-DODFO744.cjs');
8
8
  require('../chunk-ECHV2JSY.cjs');
9
9
  require('../chunk-BBRXE57K.cjs');
@@ -21,7 +21,7 @@ var useWishlistStore = zustand.create((set) => ({
21
21
  resetWishlist: () => set(initialState),
22
22
  syncWishlist: async () => {
23
23
  try {
24
- const response = await chunkY2CPMT34_cjs.getWishlist("/customer/wishlist/");
24
+ const response = await chunkMTSMQAZR_cjs.getWishlist("/customer/wishlist/");
25
25
  if (response.data) {
26
26
  set({
27
27
  wishlist_count: response.data.wishlist_count,
@@ -49,7 +49,7 @@ var useProductStore = zustand.create((set, get) => ({
49
49
  data: filter.page === 1 ? [] : state.data
50
50
  }));
51
51
  try {
52
- const response = await chunkY2CPMT34_cjs.getProducts({ ...filter });
52
+ const response = await chunkMTSMQAZR_cjs.getProducts({ ...filter });
53
53
  if (response.data) {
54
54
  const { results, ...meta } = response.data;
55
55
  set((state) => ({
@@ -69,15 +69,15 @@ var useProductStore = zustand.create((set, get) => ({
69
69
 
70
70
  Object.defineProperty(exports, "loginUser", {
71
71
  enumerable: true,
72
- get: function () { return chunkQU53I4AA_cjs.loginUser; }
72
+ get: function () { return chunk23YAZNVF_cjs.loginUser; }
73
73
  });
74
74
  Object.defineProperty(exports, "useAuthStore", {
75
75
  enumerable: true,
76
- get: function () { return chunkQU53I4AA_cjs.useAuthStore; }
76
+ get: function () { return chunk23YAZNVF_cjs.useAuthStore; }
77
77
  });
78
78
  Object.defineProperty(exports, "useCartStore", {
79
79
  enumerable: true,
80
- get: function () { return chunkQU53I4AA_cjs.useCartStore; }
80
+ get: function () { return chunk23YAZNVF_cjs.useCartStore; }
81
81
  });
82
82
  Object.defineProperty(exports, "useThemeData", {
83
83
  enumerable: true,
@@ -1,8 +1,8 @@
1
1
  import * as zustand from 'zustand';
2
- import { a as CartState, C as Cart, U as User } from '../cart-kJoawc_Z.cjs';
2
+ import { a as CartState, C as Cart, U as User } from '../cart-CuLMWnfy.cjs';
3
3
  import { W as Wishlist } from '../wishlist-CUuCTSVJ.cjs';
4
4
  import { d as Product } from '../product-DJMdi4D4.cjs';
5
- import { P as PageHeaderProps } from '../pixelEvents-C1rFPOwb.cjs';
5
+ import { P as PageHeaderProps } from '../pixelEvents-CXViXGtV.cjs';
6
6
  import 'react-toastify';
7
7
  import '../collections-WzvTO0OQ.cjs';
8
8
  import '../orders-CjNmCY5I.cjs';
@@ -14,8 +14,9 @@ interface CartStore extends CartState {
14
14
  /**
15
15
  * Fetch latest cart from backend (or local) and update state.
16
16
  */
17
- syncCart: (addressId?: number) => Promise<void>;
18
- fetchCart: (addressId?: number) => Promise<void>;
17
+ syncCart: (addressId?: number, shippingOptionId?: number) => Promise<void>;
18
+ fetchCart: (addressId?: number, shippingOptionId?: number) => Promise<void>;
19
+ fetchCartQuantity: () => Promise<void>;
19
20
  /**
20
21
  * Cart modification helpers that call the corresponding API and
21
22
  * automatically synchronize the store afterwards.
@@ -1,8 +1,8 @@
1
1
  import * as zustand from 'zustand';
2
- import { a as CartState, C as Cart, U as User } from '../cart-y-7RPmnQ.js';
2
+ import { a as CartState, C as Cart, U as User } from '../cart-CLf2ljxd.js';
3
3
  import { W as Wishlist } from '../wishlist-DKYFZR0s.js';
4
4
  import { d as Product } from '../product-DJMdi4D4.js';
5
- import { P as PageHeaderProps } from '../pixelEvents-Bo-VjAx8.js';
5
+ import { P as PageHeaderProps } from '../pixelEvents-LqK0Ltr_.js';
6
6
  import 'react-toastify';
7
7
  import '../collections-BDSVfRNo.js';
8
8
  import '../orders-L_8eIkUS.js';
@@ -14,8 +14,9 @@ interface CartStore extends CartState {
14
14
  /**
15
15
  * Fetch latest cart from backend (or local) and update state.
16
16
  */
17
- syncCart: (addressId?: number) => Promise<void>;
18
- fetchCart: (addressId?: number) => Promise<void>;
17
+ syncCart: (addressId?: number, shippingOptionId?: number) => Promise<void>;
18
+ fetchCart: (addressId?: number, shippingOptionId?: number) => Promise<void>;
19
+ fetchCartQuantity: () => Promise<void>;
19
20
  /**
20
21
  * Cart modification helpers that call the corresponding API and
21
22
  * automatically synchronize the store afterwards.
@@ -1,7 +1,7 @@
1
- export { loginUser, useAuthStore, useCartStore } from '../chunk-BR45AXQP.js';
2
- import { getWishlist, getProducts } from '../chunk-U25T7M6S.js';
1
+ export { loginUser, useAuthStore, useCartStore } from '../chunk-VZAIAQZJ.js';
2
+ import { getWishlist, getProducts } from '../chunk-XURYZRER.js';
3
3
  import '../chunk-QAC72HKO.js';
4
- import '../chunk-YFF6DWZM.js';
4
+ import '../chunk-S3ZZ3ZA7.js';
5
5
  export { useThemeData } from '../chunk-5NUDTIQ2.js';
6
6
  import '../chunk-3SYYP3XV.js';
7
7
  import '../chunk-WEMNXIRS.js';
@@ -1,9 +1,9 @@
1
1
  import { f as ProductDetail, O as OperatingHours, T as TimeSlot, A as Attributes } from '../product-DJMdi4D4.cjs';
2
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-DJMdi4D4.cjs';
3
- import { C as Cart } from '../cart-kJoawc_Z.cjs';
3
+ import { C as Cart } from '../cart-CuLMWnfy.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-C1rFPOwb.cjs';
6
- export { A as AvailableFilter, B as Banner, C as Category, a as CategoryHighlights, b as Collections, c as ColorScheme, F as FilterOption, d as FilterType, e as Footer, H as HeaderCategory, f as Hero, g as HomePageContents, I as ImageWithText, L as LocationData, h as Logo, M as Menuitem, N as NavBar, i as NavElement, j as NavElementOld, P as PageHeaderProps, k as PageMeta, l as PageProps, m as PagePropsFull, n as PreFooter, o as ProductCollection, p as ProductHighlight, R as RibbonBar, q as RibbonMessage, r as Section, s as SectionType, t as SliderSettings, u as SocialLinks, v as SocialMedia, w as StoreReview, x as SubCategory, y as SubCategorySection, T as TemplateTheme, z as Theme, V as ValueHighlights, D as pixelEvents, E as preFooterContent } from '../pixelEvents-C1rFPOwb.cjs';
5
+ import { S as SectionFilters } from '../pixelEvents-CXViXGtV.cjs';
6
+ export { A as AvailableFilter, B as Banner, C as Category, a as CategoryHighlights, b as Collections, c as ColorScheme, F as FilterOption, d as FilterType, e as Footer, H as HeaderCategory, f as Hero, g as HomePageContents, I as ImageWithText, L as LocationData, h as Logo, M as Menuitem, N as NavBar, i as NavElement, j as NavElementOld, P as PageHeaderProps, k as PageMeta, l as PageProps, m as PagePropsFull, n as PreFooter, o as ProductCollection, p as ProductHighlight, R as RibbonBar, q as RibbonMessage, r as Section, s as SectionType, t as SliderSettings, u as SocialLinks, v as SocialMedia, w as StoreReview, x as SubCategory, y as SubCategorySection, T as TemplateTheme, z as Theme, V as ValueHighlights, D as pixelEvents, E as preFooterContent } from '../pixelEvents-CXViXGtV.cjs';
7
7
  import { AxiosResponse } from 'axios';
8
8
  import { a as PhonePe } from '../phonepe-dWMLZel6.cjs';
9
9
  import 'react-toastify';
@@ -1,9 +1,9 @@
1
1
  import { f as ProductDetail, O as OperatingHours, T as TimeSlot, A as Attributes } from '../product-DJMdi4D4.js';
2
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-DJMdi4D4.js';
3
- import { C as Cart } from '../cart-y-7RPmnQ.js';
3
+ import { C as Cart } from '../cart-CLf2ljxd.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-Bo-VjAx8.js';
6
- export { A as AvailableFilter, B as Banner, C as Category, a as CategoryHighlights, b as Collections, c as ColorScheme, F as FilterOption, d as FilterType, e as Footer, H as HeaderCategory, f as Hero, g as HomePageContents, I as ImageWithText, L as LocationData, h as Logo, M as Menuitem, N as NavBar, i as NavElement, j as NavElementOld, P as PageHeaderProps, k as PageMeta, l as PageProps, m as PagePropsFull, n as PreFooter, o as ProductCollection, p as ProductHighlight, R as RibbonBar, q as RibbonMessage, r as Section, s as SectionType, t as SliderSettings, u as SocialLinks, v as SocialMedia, w as StoreReview, x as SubCategory, y as SubCategorySection, T as TemplateTheme, z as Theme, V as ValueHighlights, D as pixelEvents, E as preFooterContent } from '../pixelEvents-Bo-VjAx8.js';
5
+ import { S as SectionFilters } from '../pixelEvents-LqK0Ltr_.js';
6
+ export { A as AvailableFilter, B as Banner, C as Category, a as CategoryHighlights, b as Collections, c as ColorScheme, F as FilterOption, d as FilterType, e as Footer, H as HeaderCategory, f as Hero, g as HomePageContents, I as ImageWithText, L as LocationData, h as Logo, M as Menuitem, N as NavBar, i as NavElement, j as NavElementOld, P as PageHeaderProps, k as PageMeta, l as PageProps, m as PagePropsFull, n as PreFooter, o as ProductCollection, p as ProductHighlight, R as RibbonBar, q as RibbonMessage, r as Section, s as SectionType, t as SliderSettings, u as SocialLinks, v as SocialMedia, w as StoreReview, x as SubCategory, y as SubCategorySection, T as TemplateTheme, z as Theme, V as ValueHighlights, D as pixelEvents, E as preFooterContent } from '../pixelEvents-LqK0Ltr_.js';
7
7
  import { AxiosResponse } from 'axios';
8
8
  import { a as PhonePe } from '../phonepe-dWMLZel6.js';
9
9
  import 'react-toastify';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storepecker/storefront-core",
3
- "version": "2.4.2",
3
+ "version": "2.5.1",
4
4
  "description": "Shared logic and utilities for Snapstore themes",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",