@storepecker/storefront-core 2.9.0 → 2.10.0

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 (89) hide show
  1. package/dist/address-BdIB6IuI.d.cts +42 -0
  2. package/dist/address-BdIB6IuI.d.ts +42 -0
  3. package/dist/api/index.cjs +38 -30
  4. package/dist/api/index.d.cts +27 -9
  5. package/dist/api/index.d.ts +27 -9
  6. package/dist/api/index.js +3 -3
  7. package/dist/{buy-now-B1dkx82V.d.cts → buy-now-B_15RUVT.d.cts} +2 -2
  8. package/dist/{buy-now-BgKd5p4J.d.ts → buy-now-kII0KrhP.d.ts} +2 -2
  9. package/dist/{cart-BGIsIZdM.d.ts → cart-DZq1ZEnE.d.ts} +1 -1
  10. package/dist/{cart-CyN2JQTw.d.cts → cart-DwMFBmpC.d.cts} +1 -1
  11. package/dist/checkout/index.cjs +115 -22
  12. package/dist/checkout/index.d.cts +28 -4
  13. package/dist/checkout/index.d.ts +28 -4
  14. package/dist/checkout/index.js +4 -3
  15. package/dist/{chunk-IG4BW3ZB.cjs → chunk-32X4SWN4.cjs} +3 -3
  16. package/dist/{chunk-RDUT4W3B.cjs → chunk-6APRQ2ED.cjs} +4 -1
  17. package/dist/{chunk-ICKTXS6B.js → chunk-6IXTFZFS.js} +3 -3
  18. package/dist/{chunk-7M5CVYZJ.js → chunk-A7EI7XLU.js} +8 -1
  19. package/dist/{chunk-CBKJ3Y2I.js → chunk-EWZ7TGI7.js} +11 -1
  20. package/dist/{chunk-5XVHYPOC.js → chunk-FF5N7PTB.js} +1 -1
  21. package/dist/{chunk-XFOUNOKO.cjs → chunk-KNG4OMS5.cjs} +8 -0
  22. package/dist/{chunk-CIBMO44U.cjs → chunk-NOT6VKXA.cjs} +18 -15
  23. package/dist/{chunk-ETXIP5XE.cjs → chunk-NRPK5GCJ.cjs} +8 -0
  24. package/dist/{chunk-K44JZ5NL.cjs → chunk-NSAHGMS7.cjs} +6 -1
  25. package/dist/chunk-QED6QJZC.cjs +603 -0
  26. package/dist/{chunk-SU5LVRZD.js → chunk-QQHQTBAM.js} +12 -9
  27. package/dist/{chunk-W6BDMNSU.js → chunk-QVO56X4E.js} +1 -1
  28. package/dist/{chunk-6LS5F4R3.cjs → chunk-SGJUMI3M.cjs} +11 -0
  29. package/dist/{chunk-YLLAP3H2.cjs → chunk-SGKLMS7W.cjs} +2 -2
  30. package/dist/{chunk-WFDKKOO7.js → chunk-VAU5OL72.js} +6 -1
  31. package/dist/{chunk-ZGMLOLTC.js → chunk-VRZRV2BR.js} +4 -1
  32. package/dist/{chunk-IVKJJLG7.cjs → chunk-WWJAPKRQ.cjs} +8 -8
  33. package/dist/chunk-Y4RNRPBC.js +545 -0
  34. package/dist/{chunk-YMZZCVZ2.js → chunk-ZAWZ3RB6.js} +8 -1
  35. package/dist/{collections-ycrA2cPL.d.ts → collections-CNh2OGbl.d.ts} +1 -1
  36. package/dist/{collections-8YdINtUf.d.cts → collections-CXgOv5_G.d.cts} +1 -1
  37. package/dist/components/address-form.cjs +6 -6
  38. package/dist/components/address-form.d.cts +10 -6
  39. package/dist/components/address-form.d.ts +10 -6
  40. package/dist/components/address-form.js +5 -5
  41. package/dist/components/digital-product-download-modal.d.cts +2 -2
  42. package/dist/components/digital-product-download-modal.d.ts +2 -2
  43. package/dist/components/index.cjs +8 -8
  44. package/dist/components/index.d.cts +7 -7
  45. package/dist/components/index.d.ts +7 -7
  46. package/dist/components/index.js +6 -6
  47. package/dist/components/search-dropdown.d.cts +4 -4
  48. package/dist/components/search-dropdown.d.ts +4 -4
  49. package/dist/components/share-button.cjs +3 -3
  50. package/dist/components/share-button.d.cts +1 -1
  51. package/dist/components/share-button.d.ts +1 -1
  52. package/dist/components/share-button.js +2 -2
  53. package/dist/components/theme-data-initializer.d.cts +5 -5
  54. package/dist/components/theme-data-initializer.d.ts +5 -5
  55. package/dist/hooks/index.cjs +685 -34
  56. package/dist/hooks/index.d.cts +238 -13
  57. package/dist/hooks/index.d.ts +238 -13
  58. package/dist/hooks/index.js +655 -12
  59. package/dist/{instagram-CqJBZ-0X.d.ts → instagram-BADLnNQ3.d.ts} +1 -1
  60. package/dist/{instagram-D4JUT4ZU.d.cts → instagram-DalreBu6.d.cts} +1 -1
  61. package/dist/models/index.d.cts +9 -8
  62. package/dist/models/index.d.ts +9 -8
  63. package/dist/{orders-COKWr7K7.d.cts → orders-B3G4CyhH.d.cts} +1 -1
  64. package/dist/{orders-Cp8qNCrl.d.ts → orders-Bl-Slh72.d.ts} +1 -1
  65. package/dist/pincode-8u7yWLpQ.d.cts +29 -0
  66. package/dist/pincode-8u7yWLpQ.d.ts +29 -0
  67. package/dist/pincode-CHM-ZD3H.d.ts +179 -0
  68. package/dist/pincode-Ch3bZSJz.d.cts +179 -0
  69. package/dist/{pixelEvents-BJNH06rS.d.cts → pixelEvents-COqZIgTu.d.cts} +5 -4
  70. package/dist/{pixelEvents-2Tb-_fRP.d.ts → pixelEvents-Ds6fwS9t.d.ts} +5 -4
  71. package/dist/{product-CZtFWhxO.d.ts → product-D9liEtl4.d.cts} +1 -0
  72. package/dist/{product-CZtFWhxO.d.cts → product-D9liEtl4.d.ts} +1 -0
  73. package/dist/store/index.cjs +7 -7
  74. package/dist/store/index.d.cts +6 -6
  75. package/dist/store/index.d.ts +6 -6
  76. package/dist/store/index.js +2 -2
  77. package/dist/{useAddressForm-DGbEn91-.d.cts → useAddressForm-fMOb5Z-a.d.ts} +6 -1
  78. package/dist/{useAddressForm-cO3Au33k.d.ts → useAddressForm-wleIo78M.d.cts} +6 -1
  79. package/dist/utils/index.cjs +60 -56
  80. package/dist/utils/index.d.cts +17 -8
  81. package/dist/utils/index.d.ts +17 -8
  82. package/dist/utils/index.js +4 -4
  83. package/dist/{wishlist-Cx9Vrszq.d.cts → wishlist-BakHvIFN.d.cts} +1 -1
  84. package/dist/{wishlist-CRNbfFIx.d.ts → wishlist-Cj0sQxiY.d.ts} +1 -1
  85. package/package.json +1 -1
  86. package/dist/address-DwBZHzbI.d.cts +0 -19
  87. package/dist/address-DwBZHzbI.d.ts +0 -19
  88. package/dist/chunk-TFWTQTWE.cjs +0 -246
  89. package/dist/chunk-UWW5YIHL.js +0 -232
@@ -1,6 +1,6 @@
1
1
  import { ChangeEvent } from 'react';
2
2
  import { useFormik } from 'formik';
3
- import { A as Address } from './address-DwBZHzbI.cjs';
3
+ import { A as Address } from './address-BdIB6IuI.js';
4
4
 
5
5
  interface UseAddressFormOptions {
6
6
  /** Existing address for edit mode. When provided, form prefills from this address. */
@@ -37,6 +37,11 @@ interface UseAddressFormReturn {
37
37
  isSubmitting: boolean;
38
38
  isEditing: boolean;
39
39
  }
40
+ /**
41
+ * @deprecated Use `useCountryAwareAddressForm`: per-country address formats,
42
+ * postcode rules, pincode lookup, and it hands the payload back instead of
43
+ * saving it. This hook will be removed in 3.0.0.
44
+ */
40
45
  declare function useAddressForm(options?: UseAddressFormOptions): UseAddressFormReturn;
41
46
 
42
47
  export { type UseAddressFormOptions as U, type UseAddressFormReturn as a, useAddressForm as u };
@@ -1,6 +1,6 @@
1
1
  import { ChangeEvent } from 'react';
2
2
  import { useFormik } from 'formik';
3
- import { A as Address } from './address-DwBZHzbI.js';
3
+ import { A as Address } from './address-BdIB6IuI.cjs';
4
4
 
5
5
  interface UseAddressFormOptions {
6
6
  /** Existing address for edit mode. When provided, form prefills from this address. */
@@ -37,6 +37,11 @@ interface UseAddressFormReturn {
37
37
  isSubmitting: boolean;
38
38
  isEditing: boolean;
39
39
  }
40
+ /**
41
+ * @deprecated Use `useCountryAwareAddressForm`: per-country address formats,
42
+ * postcode rules, pincode lookup, and it hands the payload back instead of
43
+ * saving it. This hook will be removed in 3.0.0.
44
+ */
40
45
  declare function useAddressForm(options?: UseAddressFormOptions): UseAddressFormReturn;
41
46
 
42
47
  export { type UseAddressFormOptions as U, type UseAddressFormReturn as a, useAddressForm as u };
@@ -3,10 +3,10 @@
3
3
  var chunk57UU7IJ2_cjs = require('../chunk-57UU7IJ2.cjs');
4
4
  var chunk2AHH3XBW_cjs = require('../chunk-2AHH3XBW.cjs');
5
5
  var chunkNQZ5GUOG_cjs = require('../chunk-NQZ5GUOG.cjs');
6
- var chunkK44JZ5NL_cjs = require('../chunk-K44JZ5NL.cjs');
7
- var chunkLJUGNSQQ_cjs = require('../chunk-LJUGNSQQ.cjs');
8
- var chunk6LS5F4R3_cjs = require('../chunk-6LS5F4R3.cjs');
6
+ var chunkNSAHGMS7_cjs = require('../chunk-NSAHGMS7.cjs');
7
+ var chunkSGJUMI3M_cjs = require('../chunk-SGJUMI3M.cjs');
9
8
  var chunkBBRB475I_cjs = require('../chunk-BBRB475I.cjs');
9
+ var chunkLJUGNSQQ_cjs = require('../chunk-LJUGNSQQ.cjs');
10
10
  var chunkBBRXE57K_cjs = require('../chunk-BBRXE57K.cjs');
11
11
  var chunkNE3ZHELZ_cjs = require('../chunk-NE3ZHELZ.cjs');
12
12
  var chunkN3CTXRFT_cjs = require('../chunk-N3CTXRFT.cjs');
@@ -87,7 +87,7 @@ var constructPaymentPayload = async (amount, orderId, userId, phoneNumber, merch
87
87
  const dataPayload = JSON.stringify(paymentPayload);
88
88
  console.log(dataPayload);
89
89
  const dataBase64 = Buffer.from(dataPayload).toString("base64");
90
- const checksum = await chunk6LS5F4R3_cjs.digestMessage(`${dataBase64}/pg/v1/pay${saltKey}`);
90
+ const checksum = await chunkSGJUMI3M_cjs.digestMessage(`${dataBase64}/pg/v1/pay${saltKey}`);
91
91
  const finalChecksum = `${checksum}###${saltIndex}`;
92
92
  return {
93
93
  base64Payload: dataBase64,
@@ -95,7 +95,7 @@ var constructPaymentPayload = async (amount, orderId, userId, phoneNumber, merch
95
95
  };
96
96
  };
97
97
  var createXVerifyHeader = async (merchantId, transactionId, saltKey, saltIndex) => {
98
- const checksum = await chunk6LS5F4R3_cjs.digestMessage(
98
+ const checksum = await chunkSGJUMI3M_cjs.digestMessage(
99
99
  `/pg/v1/status/${merchantId}/${transactionId}${saltKey}`
100
100
  );
101
101
  const finalChecksum = `${checksum}###${saltIndex}`;
@@ -359,99 +359,67 @@ Object.defineProperty(exports, "LocalCart", {
359
359
  });
360
360
  Object.defineProperty(exports, "pixelEvents", {
361
361
  enumerable: true,
362
- get: function () { return chunkK44JZ5NL_cjs.pixelEvents; }
363
- });
364
- Object.defineProperty(exports, "CacheManager", {
365
- enumerable: true,
366
- get: function () { return chunkLJUGNSQQ_cjs.CacheManager; }
367
- });
368
- Object.defineProperty(exports, "cache", {
369
- enumerable: true,
370
- get: function () { return chunkLJUGNSQQ_cjs.cache; }
371
- });
372
- Object.defineProperty(exports, "clearCache", {
373
- enumerable: true,
374
- get: function () { return chunkLJUGNSQQ_cjs.clearCache; }
375
- });
376
- Object.defineProperty(exports, "deleteCache", {
377
- enumerable: true,
378
- get: function () { return chunkLJUGNSQQ_cjs.deleteCache; }
379
- });
380
- Object.defineProperty(exports, "generateCacheKey", {
381
- enumerable: true,
382
- get: function () { return chunkLJUGNSQQ_cjs.generateCacheKey; }
383
- });
384
- Object.defineProperty(exports, "getCache", {
385
- enumerable: true,
386
- get: function () { return chunkLJUGNSQQ_cjs.getCache; }
387
- });
388
- Object.defineProperty(exports, "hasCache", {
389
- enumerable: true,
390
- get: function () { return chunkLJUGNSQQ_cjs.hasCache; }
391
- });
392
- Object.defineProperty(exports, "invalidateCache", {
393
- enumerable: true,
394
- get: function () { return chunkLJUGNSQQ_cjs.invalidateCache; }
395
- });
396
- Object.defineProperty(exports, "setCache", {
397
- enumerable: true,
398
- get: function () { return chunkLJUGNSQQ_cjs.setCache; }
362
+ get: function () { return chunkNSAHGMS7_cjs.pixelEvents; }
399
363
  });
400
364
  Object.defineProperty(exports, "constructFilter", {
401
365
  enumerable: true,
402
- get: function () { return chunk6LS5F4R3_cjs.constructFilter; }
366
+ get: function () { return chunkSGJUMI3M_cjs.constructFilter; }
403
367
  });
404
368
  Object.defineProperty(exports, "convertObjectToParams", {
405
369
  enumerable: true,
406
- get: function () { return chunk6LS5F4R3_cjs.convertObjectToParams; }
370
+ get: function () { return chunkSGJUMI3M_cjs.convertObjectToParams; }
407
371
  });
408
372
  Object.defineProperty(exports, "convertToCurrency", {
409
373
  enumerable: true,
410
- get: function () { return chunk6LS5F4R3_cjs.convertToCurrency; }
374
+ get: function () { return chunkSGJUMI3M_cjs.convertToCurrency; }
411
375
  });
412
376
  Object.defineProperty(exports, "digestMessage", {
413
377
  enumerable: true,
414
- get: function () { return chunk6LS5F4R3_cjs.digestMessage; }
378
+ get: function () { return chunkSGJUMI3M_cjs.digestMessage; }
379
+ });
380
+ Object.defineProperty(exports, "focusFirstInvalidField", {
381
+ enumerable: true,
382
+ get: function () { return chunkSGJUMI3M_cjs.focusFirstInvalidField; }
415
383
  });
416
384
  Object.defineProperty(exports, "formatDateTime", {
417
385
  enumerable: true,
418
- get: function () { return chunk6LS5F4R3_cjs.formatDateTime; }
386
+ get: function () { return chunkSGJUMI3M_cjs.formatDateTime; }
419
387
  });
420
388
  Object.defineProperty(exports, "formatPostalLabel", {
421
389
  enumerable: true,
422
- get: function () { return chunk6LS5F4R3_cjs.formatPostalLabel; }
390
+ get: function () { return chunkSGJUMI3M_cjs.formatPostalLabel; }
423
391
  });
424
392
  Object.defineProperty(exports, "getAddressMeta", {
425
393
  enumerable: true,
426
- get: function () { return chunk6LS5F4R3_cjs.getAddressMeta; }
394
+ get: function () { return chunkSGJUMI3M_cjs.getAddressMeta; }
427
395
  });
428
396
  Object.defineProperty(exports, "getDelayInMilliseconds", {
429
397
  enumerable: true,
430
- get: function () { return chunk6LS5F4R3_cjs.getDelayInMilliseconds; }
398
+ get: function () { return chunkSGJUMI3M_cjs.getDelayInMilliseconds; }
431
399
  });
432
400
  Object.defineProperty(exports, "getOrderStatus", {
433
401
  enumerable: true,
434
- get: function () { return chunk6LS5F4R3_cjs.getOrderStatus; }
402
+ get: function () { return chunkSGJUMI3M_cjs.getOrderStatus; }
435
403
  });
436
404
  Object.defineProperty(exports, "getParamsFromURL", {
437
405
  enumerable: true,
438
- get: function () { return chunk6LS5F4R3_cjs.getParamsFromURL; }
406
+ get: function () { return chunkSGJUMI3M_cjs.getParamsFromURL; }
439
407
  });
440
408
  Object.defineProperty(exports, "getQueryParams", {
441
409
  enumerable: true,
442
- get: function () { return chunk6LS5F4R3_cjs.getQueryParams; }
410
+ get: function () { return chunkSGJUMI3M_cjs.getQueryParams; }
443
411
  });
444
412
  Object.defineProperty(exports, "pluralize", {
445
413
  enumerable: true,
446
- get: function () { return chunk6LS5F4R3_cjs.pluralize; }
414
+ get: function () { return chunkSGJUMI3M_cjs.pluralize; }
447
415
  });
448
416
  Object.defineProperty(exports, "pushParamsToURL", {
449
417
  enumerable: true,
450
- get: function () { return chunk6LS5F4R3_cjs.pushParamsToURL; }
418
+ get: function () { return chunkSGJUMI3M_cjs.pushParamsToURL; }
451
419
  });
452
420
  Object.defineProperty(exports, "shareLink", {
453
421
  enumerable: true,
454
- get: function () { return chunk6LS5F4R3_cjs.shareLink; }
422
+ get: function () { return chunkSGJUMI3M_cjs.shareLink; }
455
423
  });
456
424
  Object.defineProperty(exports, "isExpired", {
457
425
  enumerable: true,
@@ -461,6 +429,42 @@ Object.defineProperty(exports, "timeFromNow", {
461
429
  enumerable: true,
462
430
  get: function () { return chunkBBRB475I_cjs.timeFromNow; }
463
431
  });
432
+ Object.defineProperty(exports, "CacheManager", {
433
+ enumerable: true,
434
+ get: function () { return chunkLJUGNSQQ_cjs.CacheManager; }
435
+ });
436
+ Object.defineProperty(exports, "cache", {
437
+ enumerable: true,
438
+ get: function () { return chunkLJUGNSQQ_cjs.cache; }
439
+ });
440
+ Object.defineProperty(exports, "clearCache", {
441
+ enumerable: true,
442
+ get: function () { return chunkLJUGNSQQ_cjs.clearCache; }
443
+ });
444
+ Object.defineProperty(exports, "deleteCache", {
445
+ enumerable: true,
446
+ get: function () { return chunkLJUGNSQQ_cjs.deleteCache; }
447
+ });
448
+ Object.defineProperty(exports, "generateCacheKey", {
449
+ enumerable: true,
450
+ get: function () { return chunkLJUGNSQQ_cjs.generateCacheKey; }
451
+ });
452
+ Object.defineProperty(exports, "getCache", {
453
+ enumerable: true,
454
+ get: function () { return chunkLJUGNSQQ_cjs.getCache; }
455
+ });
456
+ Object.defineProperty(exports, "hasCache", {
457
+ enumerable: true,
458
+ get: function () { return chunkLJUGNSQQ_cjs.hasCache; }
459
+ });
460
+ Object.defineProperty(exports, "invalidateCache", {
461
+ enumerable: true,
462
+ get: function () { return chunkLJUGNSQQ_cjs.invalidateCache; }
463
+ });
464
+ Object.defineProperty(exports, "setCache", {
465
+ enumerable: true,
466
+ get: function () { return chunkLJUGNSQQ_cjs.setCache; }
467
+ });
464
468
  Object.defineProperty(exports, "Auth", {
465
469
  enumerable: true,
466
470
  get: function () { return chunkBBRXE57K_cjs.auth_default; }
@@ -1,14 +1,14 @@
1
- import { f as ProductDetail, O as OperatingHours, T as TimeSlot, A as Attributes } from '../product-CZtFWhxO.cjs';
2
- export { h as ADDRESS_FORM_SESSION_KEY, i as ALLOWED_COUNTRIES, D as DEFAULT_TOAST_CONFIG, j as PRODUCT_STATUSES, g as SLICE_STATUS, U as USER_CART, k as USER_CREDENTIALS, l as USER_CRED_REFRESH_TOKEN, m as USER_CRED_TOKEN, p as pathNameMap } from '../product-CZtFWhxO.cjs';
3
- import { C as Cart } from '../cart-CyN2JQTw.cjs';
1
+ import { f as ProductDetail, O as OperatingHours, T as TimeSlot, A as Attributes } from '../product-D9liEtl4.cjs';
2
+ export { h as ADDRESS_FORM_SESSION_KEY, i as ALLOWED_COUNTRIES, D as DEFAULT_TOAST_CONFIG, j as PRODUCT_STATUSES, g as SLICE_STATUS, U as USER_CART, k as USER_CREDENTIALS, l as USER_CRED_REFRESH_TOKEN, m as USER_CRED_TOKEN, p as pathNameMap } from '../product-D9liEtl4.cjs';
3
+ import { C as Cart } from '../cart-DwMFBmpC.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-BJNH06rS.cjs';
6
- export { A as AvailableFilter, B as Banner, a as Blogs, C as Category, b as CategoryHighlights, c as Collections, d as ColorScheme, F as FilterOption, e as FilterType, f as Footer, H as HeaderCategory, g as Hero, h as HomePageContents, I as ImageWithText, L as LocationData, i as Logo, M as Menuitem, N as NavBar, j as NavElement, k as NavElementOld, P as PageHeaderProps, l as PageMeta, m as PageProps, n as PagePropsFull, o as PreFooter, p as ProductCollection, q as ProductHighlight, R as RibbonBar, r as RibbonMessage, s as Section, t as SectionType, u as SliderSettings, v as SocialLinks, w as SocialMedia, x as StoreReview, y as SubCategory, z as SubCategorySection, T as TemplateTheme, D as Theme, V as ValueHighlights, E as pixelEvents, G as preFooterContent } from '../pixelEvents-BJNH06rS.cjs';
7
- import { O as Order } from '../orders-COKWr7K7.cjs';
5
+ import { S as SectionFilters } from '../pixelEvents-COqZIgTu.cjs';
6
+ export { A as AvailableFilter, B as Banner, a as Blogs, C as Category, b as CategoryHighlights, c as Collections, d as ColorScheme, F as FilterOption, e as FilterType, f as Footer, H as HeaderCategory, g as Hero, h as HomePageContents, I as ImageWithText, L as LocationData, i as Logo, M as Menuitem, N as NavBar, j as NavElement, k as NavElementOld, P as PageHeaderProps, l as PageMeta, m as PageProps, n as PagePropsFull, o as PreFooter, p as ProductCollection, q as ProductHighlight, R as RibbonBar, r as RibbonMessage, s as Section, t as SectionType, u as SliderSettings, v as SocialLinks, w as SocialMedia, x as StoreReview, y as SubCategory, z as SubCategorySection, T as TemplateTheme, D as Theme, V as ValueHighlights, E as pixelEvents, G as preFooterContent } from '../pixelEvents-COqZIgTu.cjs';
7
+ import { O as Order } from '../orders-B3G4CyhH.cjs';
8
8
  import { AxiosResponse } from 'axios';
9
9
  import { a as PhonePe } from '../phonepe-dWMLZel6.cjs';
10
10
  import 'react-toastify';
11
- import '../collections-8YdINtUf.cjs';
11
+ import '../collections-CXgOv5_G.cjs';
12
12
 
13
13
  declare function setAuthTokenChangeCallback(callback: (token: string | undefined) => void): void;
14
14
  declare const Auth: {
@@ -84,7 +84,9 @@ declare function pluralize(strings: TemplateStringsArray, count: number, singula
84
84
  declare function digestMessage(message: string): Promise<string>;
85
85
  declare const constructFilter: (filter: SectionFilters[]) => CustomObject;
86
86
  declare const getDelayInMilliseconds: (value: number, unit: "hours" | "days" | "weeks" | "months" | "minutes" | "seconds") => number;
87
+ /** @deprecated Use `buildAddressFormat` / `loadAddressFormat` from `/checkout` (`postalLabel`). */
87
88
  declare function formatPostalLabel(zipNameType?: string): string;
89
+ /** @deprecated Use `useAddressFormat` (`/hooks`) or `loadAddressFormat` (`/checkout`), which cache the metadata and add per-country overrides. */
88
90
  declare function getAddressMeta(countryCode: string): Promise<{
89
91
  regionLabel: any;
90
92
  postalLabel: string;
@@ -94,6 +96,13 @@ declare function getOrderStatus(order: Order.Root | Order.OrderSummary): {
94
96
  title: string;
95
97
  info?: string;
96
98
  };
99
+ /**
100
+ * Scrolls to and focuses the first form control whose `name` has an error.
101
+ * Fields absent from the DOM (e.g. a hidden postcode) are skipped.
102
+ *
103
+ * @param root Element to search in (e.g. the form); defaults to the document.
104
+ */
105
+ declare function focusFirstInvalidField(errors: Record<string, unknown>, root?: ParentNode | null): void;
97
106
 
98
107
  declare class PhonepePayment {
99
108
  private readonly amount;
@@ -212,4 +221,4 @@ declare function isProductCustomized(customizationInputs: Array<{
212
221
  [key: string]: any;
213
222
  }> | undefined, productId: number): boolean;
214
223
 
215
- export { Auth, CacheManager, LocalCart, PhonepePayment, SectionFilters, authRoutes, cache, calculateDiscountPercent, clearCache, constructFilter, convertObjectToParams, convertToCurrency, cropImage, debounce, deleteCache, digestMessage, findMatchingVariant, findSimilarVariant, formatBookingDateTime, formatDateTime, formatPostalLabel, generateCacheKey, generateTimeOptions, getAddressMeta, getAvailableDaysText, getCache, getDelayInMilliseconds, getNextAvailableDate, getOrderStatus, getParamsFromURL, getQueryParams, getTimeConstraints, getUniqueId, hasCache, invalidateCache, isAvailableDay, isColorVariantType, isExpired, isProductCustomized, isVariantCombinationAvailable, pluralize, protectedRoutes, publicRoutes, pushParamsToURL, setAuthTokenChangeCallback, setCache, shareLink, timeFromNow, urls };
224
+ export { Auth, CacheManager, LocalCart, PhonepePayment, SectionFilters, authRoutes, cache, calculateDiscountPercent, clearCache, constructFilter, convertObjectToParams, convertToCurrency, cropImage, debounce, deleteCache, digestMessage, findMatchingVariant, findSimilarVariant, focusFirstInvalidField, formatBookingDateTime, formatDateTime, formatPostalLabel, generateCacheKey, generateTimeOptions, getAddressMeta, getAvailableDaysText, getCache, getDelayInMilliseconds, getNextAvailableDate, getOrderStatus, getParamsFromURL, getQueryParams, getTimeConstraints, getUniqueId, hasCache, invalidateCache, isAvailableDay, isColorVariantType, isExpired, isProductCustomized, isVariantCombinationAvailable, pluralize, protectedRoutes, publicRoutes, pushParamsToURL, setAuthTokenChangeCallback, setCache, shareLink, timeFromNow, urls };
@@ -1,14 +1,14 @@
1
- import { f as ProductDetail, O as OperatingHours, T as TimeSlot, A as Attributes } from '../product-CZtFWhxO.js';
2
- export { h as ADDRESS_FORM_SESSION_KEY, i as ALLOWED_COUNTRIES, D as DEFAULT_TOAST_CONFIG, j as PRODUCT_STATUSES, g as SLICE_STATUS, U as USER_CART, k as USER_CREDENTIALS, l as USER_CRED_REFRESH_TOKEN, m as USER_CRED_TOKEN, p as pathNameMap } from '../product-CZtFWhxO.js';
3
- import { C as Cart } from '../cart-BGIsIZdM.js';
1
+ import { f as ProductDetail, O as OperatingHours, T as TimeSlot, A as Attributes } from '../product-D9liEtl4.js';
2
+ export { h as ADDRESS_FORM_SESSION_KEY, i as ALLOWED_COUNTRIES, D as DEFAULT_TOAST_CONFIG, j as PRODUCT_STATUSES, g as SLICE_STATUS, U as USER_CART, k as USER_CREDENTIALS, l as USER_CRED_REFRESH_TOKEN, m as USER_CRED_TOKEN, p as pathNameMap } from '../product-D9liEtl4.js';
3
+ import { C as Cart } from '../cart-DZq1ZEnE.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-2Tb-_fRP.js';
6
- export { A as AvailableFilter, B as Banner, a as Blogs, C as Category, b as CategoryHighlights, c as Collections, d as ColorScheme, F as FilterOption, e as FilterType, f as Footer, H as HeaderCategory, g as Hero, h as HomePageContents, I as ImageWithText, L as LocationData, i as Logo, M as Menuitem, N as NavBar, j as NavElement, k as NavElementOld, P as PageHeaderProps, l as PageMeta, m as PageProps, n as PagePropsFull, o as PreFooter, p as ProductCollection, q as ProductHighlight, R as RibbonBar, r as RibbonMessage, s as Section, t as SectionType, u as SliderSettings, v as SocialLinks, w as SocialMedia, x as StoreReview, y as SubCategory, z as SubCategorySection, T as TemplateTheme, D as Theme, V as ValueHighlights, E as pixelEvents, G as preFooterContent } from '../pixelEvents-2Tb-_fRP.js';
7
- import { O as Order } from '../orders-Cp8qNCrl.js';
5
+ import { S as SectionFilters } from '../pixelEvents-Ds6fwS9t.js';
6
+ export { A as AvailableFilter, B as Banner, a as Blogs, C as Category, b as CategoryHighlights, c as Collections, d as ColorScheme, F as FilterOption, e as FilterType, f as Footer, H as HeaderCategory, g as Hero, h as HomePageContents, I as ImageWithText, L as LocationData, i as Logo, M as Menuitem, N as NavBar, j as NavElement, k as NavElementOld, P as PageHeaderProps, l as PageMeta, m as PageProps, n as PagePropsFull, o as PreFooter, p as ProductCollection, q as ProductHighlight, R as RibbonBar, r as RibbonMessage, s as Section, t as SectionType, u as SliderSettings, v as SocialLinks, w as SocialMedia, x as StoreReview, y as SubCategory, z as SubCategorySection, T as TemplateTheme, D as Theme, V as ValueHighlights, E as pixelEvents, G as preFooterContent } from '../pixelEvents-Ds6fwS9t.js';
7
+ import { O as Order } from '../orders-Bl-Slh72.js';
8
8
  import { AxiosResponse } from 'axios';
9
9
  import { a as PhonePe } from '../phonepe-dWMLZel6.js';
10
10
  import 'react-toastify';
11
- import '../collections-ycrA2cPL.js';
11
+ import '../collections-CNh2OGbl.js';
12
12
 
13
13
  declare function setAuthTokenChangeCallback(callback: (token: string | undefined) => void): void;
14
14
  declare const Auth: {
@@ -84,7 +84,9 @@ declare function pluralize(strings: TemplateStringsArray, count: number, singula
84
84
  declare function digestMessage(message: string): Promise<string>;
85
85
  declare const constructFilter: (filter: SectionFilters[]) => CustomObject;
86
86
  declare const getDelayInMilliseconds: (value: number, unit: "hours" | "days" | "weeks" | "months" | "minutes" | "seconds") => number;
87
+ /** @deprecated Use `buildAddressFormat` / `loadAddressFormat` from `/checkout` (`postalLabel`). */
87
88
  declare function formatPostalLabel(zipNameType?: string): string;
89
+ /** @deprecated Use `useAddressFormat` (`/hooks`) or `loadAddressFormat` (`/checkout`), which cache the metadata and add per-country overrides. */
88
90
  declare function getAddressMeta(countryCode: string): Promise<{
89
91
  regionLabel: any;
90
92
  postalLabel: string;
@@ -94,6 +96,13 @@ declare function getOrderStatus(order: Order.Root | Order.OrderSummary): {
94
96
  title: string;
95
97
  info?: string;
96
98
  };
99
+ /**
100
+ * Scrolls to and focuses the first form control whose `name` has an error.
101
+ * Fields absent from the DOM (e.g. a hidden postcode) are skipped.
102
+ *
103
+ * @param root Element to search in (e.g. the form); defaults to the document.
104
+ */
105
+ declare function focusFirstInvalidField(errors: Record<string, unknown>, root?: ParentNode | null): void;
97
106
 
98
107
  declare class PhonepePayment {
99
108
  private readonly amount;
@@ -212,4 +221,4 @@ declare function isProductCustomized(customizationInputs: Array<{
212
221
  [key: string]: any;
213
222
  }> | undefined, productId: number): boolean;
214
223
 
215
- export { Auth, CacheManager, LocalCart, PhonepePayment, SectionFilters, authRoutes, cache, calculateDiscountPercent, clearCache, constructFilter, convertObjectToParams, convertToCurrency, cropImage, debounce, deleteCache, digestMessage, findMatchingVariant, findSimilarVariant, formatBookingDateTime, formatDateTime, formatPostalLabel, generateCacheKey, generateTimeOptions, getAddressMeta, getAvailableDaysText, getCache, getDelayInMilliseconds, getNextAvailableDate, getOrderStatus, getParamsFromURL, getQueryParams, getTimeConstraints, getUniqueId, hasCache, invalidateCache, isAvailableDay, isColorVariantType, isExpired, isProductCustomized, isVariantCombinationAvailable, pluralize, protectedRoutes, publicRoutes, pushParamsToURL, setAuthTokenChangeCallback, setCache, shareLink, timeFromNow, urls };
224
+ export { Auth, CacheManager, LocalCart, PhonepePayment, SectionFilters, authRoutes, cache, calculateDiscountPercent, clearCache, constructFilter, convertObjectToParams, convertToCurrency, cropImage, debounce, deleteCache, digestMessage, findMatchingVariant, findSimilarVariant, focusFirstInvalidField, formatBookingDateTime, formatDateTime, formatPostalLabel, generateCacheKey, generateTimeOptions, getAddressMeta, getAvailableDaysText, getCache, getDelayInMilliseconds, getNextAvailableDate, getOrderStatus, getParamsFromURL, getQueryParams, getTimeConstraints, getUniqueId, hasCache, invalidateCache, isAvailableDay, isColorVariantType, isExpired, isProductCustomized, isVariantCombinationAvailable, pluralize, protectedRoutes, publicRoutes, pushParamsToURL, setAuthTokenChangeCallback, setCache, shareLink, timeFromNow, urls };
@@ -1,11 +1,11 @@
1
1
  export { authRoutes, protectedRoutes, publicRoutes, routes_default as urls } from '../chunk-OOFYY6GR.js';
2
2
  export { findMatchingVariant, findSimilarVariant, isColorVariantType, isVariantCombinationAvailable } from '../chunk-HEFA67WK.js';
3
3
  export { cart_default as LocalCart } from '../chunk-TH7OAMGC.js';
4
- export { pixelEvents } from '../chunk-WFDKKOO7.js';
5
- export { CacheManager, cache, clearCache, deleteCache, generateCacheKey, getCache, hasCache, invalidateCache, setCache } from '../chunk-OSM73ETC.js';
6
- import { digestMessage } from '../chunk-CBKJ3Y2I.js';
7
- export { constructFilter, convertObjectToParams, convertToCurrency, digestMessage, formatDateTime, formatPostalLabel, getAddressMeta, getDelayInMilliseconds, getOrderStatus, getParamsFromURL, getQueryParams, pluralize, pushParamsToURL, shareLink } from '../chunk-CBKJ3Y2I.js';
4
+ export { pixelEvents } from '../chunk-VAU5OL72.js';
5
+ import { digestMessage } from '../chunk-EWZ7TGI7.js';
6
+ export { constructFilter, convertObjectToParams, convertToCurrency, digestMessage, focusFirstInvalidField, formatDateTime, formatPostalLabel, getAddressMeta, getDelayInMilliseconds, getOrderStatus, getParamsFromURL, getQueryParams, pluralize, pushParamsToURL, shareLink } from '../chunk-EWZ7TGI7.js';
8
7
  export { isExpired, timeFromNow } from '../chunk-HSF2D56O.js';
8
+ export { CacheManager, cache, clearCache, deleteCache, generateCacheKey, getCache, hasCache, invalidateCache, setCache } from '../chunk-OSM73ETC.js';
9
9
  export { auth_default as Auth, setAuthTokenChangeCallback } from '../chunk-WEMNXIRS.js';
10
10
  export { ADDRESS_FORM_SESSION_KEY, ALLOWED_COUNTRIES, DEFAULT_TOAST_CONFIG, PRODUCT_STATUSES, SLICE_STATUS, USER_CART, USER_CREDENTIALS, USER_CRED_REFRESH_TOKEN, USER_CRED_TOKEN, pathNameMap } from '../chunk-BQ256JKN.js';
11
11
  import { getPhonePeApiEndpoint, getPublicApiEndpoint } from '../chunk-JQMLHRWL.js';
@@ -1,4 +1,4 @@
1
- import { f as ProductDetail } from './product-CZtFWhxO.cjs';
1
+ import { f as ProductDetail } from './product-D9liEtl4.cjs';
2
2
 
3
3
  declare namespace Wishlist {
4
4
  interface Root {
@@ -1,4 +1,4 @@
1
- import { f as ProductDetail } from './product-CZtFWhxO.js';
1
+ import { f as ProductDetail } from './product-D9liEtl4.js';
2
2
 
3
3
  declare namespace Wishlist {
4
4
  interface Root {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storepecker/storefront-core",
3
- "version": "2.9.0",
3
+ "version": "2.10.0",
4
4
  "description": "Shared logic and utilities for Snapstore themes",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,19 +0,0 @@
1
- interface Address {
2
- id: number;
3
- customer: number;
4
- address: string;
5
- city: string;
6
- state: string;
7
- state_obj: string;
8
- customer_email: string;
9
- country: string;
10
- pincode: string;
11
- latitude: number | null;
12
- longitude: number | null;
13
- is_default: boolean;
14
- customer_name: string;
15
- customer_phone: string;
16
- customer_country_code: string;
17
- }
18
-
19
- export type { Address as A };
@@ -1,19 +0,0 @@
1
- interface Address {
2
- id: number;
3
- customer: number;
4
- address: string;
5
- city: string;
6
- state: string;
7
- state_obj: string;
8
- customer_email: string;
9
- country: string;
10
- pincode: string;
11
- latitude: number | null;
12
- longitude: number | null;
13
- is_default: boolean;
14
- customer_name: string;
15
- customer_phone: string;
16
- customer_country_code: string;
17
- }
18
-
19
- export type { Address as A };