@storepecker/storefront-core 2.3.5 → 2.4.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 (75) hide show
  1. package/dist/api/index.cjs +28 -24
  2. package/dist/api/index.d.cts +2 -1
  3. package/dist/api/index.d.ts +2 -1
  4. package/dist/api/index.js +1 -1
  5. package/dist/checkout/index.cjs +22 -22
  6. package/dist/checkout/index.js +2 -2
  7. package/dist/{chunk-BTT3XQ32.cjs → chunk-33TWVRZE.cjs} +6 -6
  8. package/dist/chunk-3YRSHPM6.cjs +34 -0
  9. package/dist/chunk-5NUDTIQ2.js +9 -0
  10. package/dist/{chunk-ILVGYHNI.js → chunk-6Q7QMPOQ.js} +2 -1
  11. package/dist/{chunk-HTFVROIV.cjs → chunk-7UK3E7SL.cjs} +6 -0
  12. package/dist/chunk-B3BXKMQA.cjs +271 -0
  13. package/dist/chunk-BTR3HLL4.js +14 -0
  14. package/dist/chunk-DODFO744.cjs +11 -0
  15. package/dist/chunk-EGFOTJPC.js +22 -0
  16. package/dist/{chunk-YUPBTD4M.js → chunk-F45S7UWC.js} +1 -139
  17. package/dist/chunk-HAQWCNDY.cjs +24 -0
  18. package/dist/{chunk-Y4NGR42Z.js → chunk-HUIT4JCR.js} +1 -1
  19. package/dist/{chunk-TF2KMTB6.js → chunk-JRYWZMNT.js} +1 -1
  20. package/dist/{chunk-JCOOINQF.cjs → chunk-KLNKIQQM.cjs} +4 -3
  21. package/dist/chunk-L43KF3AC.js +269 -0
  22. package/dist/chunk-LHF5BSWO.cjs +16 -0
  23. package/dist/chunk-LJUGNSQQ.cjs +149 -0
  24. package/dist/chunk-NA5GT4D3.js +75 -0
  25. package/dist/chunk-OSM73ETC.js +139 -0
  26. package/dist/{chunk-4CVKE6CC.cjs → chunk-OTMTHA5C.cjs} +0 -147
  27. package/dist/{chunk-JH4JJBXE.cjs → chunk-TTIQRDHX.cjs} +2 -2
  28. package/dist/chunk-U7EXLQCT.js +32 -0
  29. package/dist/{chunk-LW3V53WJ.js → chunk-UVU7H4E6.js} +6 -1
  30. package/dist/chunk-V447PVRV.cjs +308 -0
  31. package/dist/chunk-VWQR3A7V.cjs +81 -0
  32. package/dist/chunk-YK4M3SFP.js +301 -0
  33. package/dist/components/address-form.cjs +17 -0
  34. package/dist/components/address-form.css +329 -0
  35. package/dist/components/address-form.d.cts +33 -0
  36. package/dist/components/address-form.d.ts +33 -0
  37. package/dist/components/address-form.js +11 -0
  38. package/dist/components/digital-product-download-modal.cjs +8 -0
  39. package/dist/components/digital-product-download-modal.d.cts +15 -0
  40. package/dist/components/digital-product-download-modal.d.ts +15 -0
  41. package/dist/components/digital-product-download-modal.js +2 -0
  42. package/dist/components/index.cjs +35 -684
  43. package/dist/components/index.d.cts +14 -82
  44. package/dist/components/index.d.ts +14 -82
  45. package/dist/components/index.js +11 -678
  46. package/dist/components/search-dropdown.cjs +7 -0
  47. package/dist/components/search-dropdown.css +200 -0
  48. package/dist/components/search-dropdown.d.cts +28 -0
  49. package/dist/components/search-dropdown.d.ts +28 -0
  50. package/dist/components/search-dropdown.js +1 -0
  51. package/dist/components/share-button.cjs +9 -0
  52. package/dist/components/share-button.d.cts +11 -0
  53. package/dist/components/share-button.d.ts +11 -0
  54. package/dist/components/share-button.js +3 -0
  55. package/dist/components/share-icon.cjs +7 -0
  56. package/dist/components/share-icon.d.cts +9 -0
  57. package/dist/components/share-icon.d.ts +9 -0
  58. package/dist/components/share-icon.js +1 -0
  59. package/dist/components/theme-data-initializer.cjs +8 -0
  60. package/dist/components/theme-data-initializer.d.cts +12 -0
  61. package/dist/components/theme-data-initializer.d.ts +12 -0
  62. package/dist/components/theme-data-initializer.js +2 -0
  63. package/dist/hooks/index.cjs +18 -17
  64. package/dist/hooks/index.js +6 -5
  65. package/dist/pixelEvents-Bo-VjAx8.d.ts +371 -0
  66. package/dist/pixelEvents-C1rFPOwb.d.cts +371 -0
  67. package/dist/store/index.cjs +10 -5
  68. package/dist/store/index.d.cts +10 -1
  69. package/dist/store/index.d.ts +10 -1
  70. package/dist/store/index.js +3 -2
  71. package/dist/utils/index.cjs +44 -43
  72. package/dist/utils/index.d.cts +7 -370
  73. package/dist/utils/index.d.ts +7 -370
  74. package/dist/utils/index.js +3 -2
  75. package/package.json +49 -1
@@ -1,12 +1,14 @@
1
- import { f as ProductDetail, d as Product, O as OperatingHours, T as TimeSlot, A as Attributes } from '../product-DJMdi4D4.cjs';
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, b as Category$1 } from '../cart-kJoawc_Z.cjs';
3
+ import { C as Cart } from '../cart-kJoawc_Z.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 { C as CollectionResponse } from '../collections-WzvTO0OQ.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';
6
7
  import { AxiosResponse } from 'axios';
7
8
  import { a as PhonePe } from '../phonepe-dWMLZel6.cjs';
8
- import { O as Order } from '../orders-CjNmCY5I.cjs';
9
9
  import 'react-toastify';
10
+ import '../collections-WzvTO0OQ.cjs';
11
+ import '../orders-CjNmCY5I.cjs';
10
12
 
11
13
  declare function setAuthTokenChangeCallback(callback: (token: string | undefined) => void): void;
12
14
  declare const Auth: {
@@ -65,327 +67,6 @@ declare const cropImage: (image: string, croppedAreaPixels: any, onError: any, o
65
67
 
66
68
  declare const debounce: (fn: Function, ms?: number) => (this: any, ...args: any[]) => void;
67
69
 
68
- interface PageProps {
69
- nav_bar: NavBar;
70
- store: string;
71
- store_desc: string;
72
- page_meta_data: PageMeta;
73
- primary_color: string;
74
- social_media: SocialMedia[];
75
- }
76
- type PageMeta = {
77
- title: string;
78
- description: string;
79
- image: string;
80
- url: string;
81
- canonical_url: string;
82
- appleTouchIcon: string;
83
- twitter_card_size: string;
84
- favIcon: string;
85
- };
86
- interface TemplateTheme {
87
- primary: string;
88
- secondary: string;
89
- }
90
- interface Logo {
91
- url: string;
92
- title: string;
93
- }
94
- interface NavElementOld {
95
- title: string;
96
- is_dropdown: boolean;
97
- link?: string;
98
- menuitems?: Menuitem[];
99
- }
100
- interface Menuitem {
101
- id: number;
102
- title: string;
103
- link: string;
104
- sub_categories?: SubCategory[];
105
- }
106
- interface SubCategory {
107
- id: number;
108
- title: string;
109
- link: string;
110
- }
111
- interface SocialMedia {
112
- type: string;
113
- link: string;
114
- }
115
- interface PagePropsFull {
116
- store: number;
117
- theme: Theme;
118
- privacy_policy: any;
119
- terms_and_condition: any;
120
- custom_css: string;
121
- custom_js: string;
122
- navbar: NavBar;
123
- color_scheme: ColorScheme;
124
- social_links: SocialLinks;
125
- hero: Hero;
126
- sections: Section[];
127
- footer: Footer;
128
- start_head_tag: string;
129
- end_head_tag: string;
130
- start_body_tag: string;
131
- end_body_tag: string;
132
- logo: string;
133
- favicon: string;
134
- store_name: string;
135
- store_description: string;
136
- social_image: string;
137
- url: string;
138
- categories: HeaderCategory[];
139
- store_phone: string;
140
- store_email: string;
141
- store_address: string;
142
- google_tag_manager_id?: string;
143
- }
144
- type PageHeaderProps = Pick<PagePropsFull, "navbar" | "logo" | "store_name" | "store_description" | "color_scheme" | "social_image" | "social_links" | "url" | "footer" | "categories" | "store_phone" | "store_email" | "store_address" | "start_head_tag" | "end_head_tag" | "start_body_tag" | "end_body_tag" | "google_tag_manager_id"> & {
145
- currency_code: string;
146
- currency_symbol: string;
147
- is_cod_enabled: boolean;
148
- cod_amount: number;
149
- store_review_enabled: boolean;
150
- product_review_enabled: boolean;
151
- store_review_popup_delay: number;
152
- store_review_popup_delay_unit: "hours" | "days" | "weeks" | "months" | "minutes" | "seconds";
153
- popup_enabled: boolean;
154
- popup_heading_text: string;
155
- popup_message_text: string;
156
- popup_thank_you_message: string;
157
- public_checkout_enabled: boolean;
158
- booking_success_message: string;
159
- order_success_message: string;
160
- };
161
- type HomePageContents = Pick<PagePropsFull, "hero" | "sections">;
162
- interface Theme {
163
- id: number;
164
- name: string;
165
- slug: string;
166
- color_scheme: ColorScheme;
167
- is_active: boolean;
168
- }
169
- interface ColorScheme {
170
- primary: string;
171
- secondary: string;
172
- bodyBackground: string;
173
- bodyBackground1: string;
174
- bodyBackgroundSecondary: string;
175
- bodyBackgroundDark: string;
176
- borderBackground: string;
177
- textPrimary: string;
178
- textPrimaryLight: string;
179
- textSecondary: string;
180
- btnText: string;
181
- }
182
- interface RibbonMessage {
183
- id: string;
184
- message: string;
185
- link: string;
186
- }
187
- interface RibbonBar {
188
- type: "ribbon-bar";
189
- messages: RibbonMessage[];
190
- textColor: string;
191
- id: string;
192
- position: "top" | "bottom";
193
- animation: string;
194
- switchInterval: number;
195
- }
196
- interface NavBar {
197
- wishlist: boolean;
198
- cart: boolean;
199
- navElements: NavElement[];
200
- }
201
- interface NavBar {
202
- wishlist: boolean;
203
- cart: boolean;
204
- navElements: NavElement[];
205
- ribbonbar: RibbonBar;
206
- logoPosition: "left" | "center";
207
- }
208
- interface NavElement {
209
- key: string;
210
- title: string;
211
- is_dropdown: boolean;
212
- link?: string;
213
- enabled?: boolean;
214
- description: string;
215
- }
216
- interface NavElement {
217
- key: string;
218
- title: string;
219
- is_dropdown: boolean;
220
- link?: string;
221
- enabled?: boolean;
222
- description: string;
223
- }
224
- interface HeaderCategory {
225
- id: number;
226
- name: string;
227
- link: string;
228
- slug: string;
229
- children?: HeaderCategory[];
230
- }
231
- interface SliderSettings {
232
- id: string;
233
- title: string;
234
- description: string;
235
- cta: string;
236
- ctaLink: string;
237
- bannerImage: string;
238
- bannerImageMobile: string;
239
- showContents?: boolean;
240
- }
241
- interface Hero {
242
- title: string;
243
- cta: string;
244
- ctaLink: string;
245
- heroImage: string;
246
- description: string;
247
- heroImageMobile: string;
248
- showTitle: boolean;
249
- showCTA: boolean;
250
- bannerLink: string;
251
- enableSlider: boolean;
252
- sliderSettings: SliderSettings[];
253
- switchInterval: number;
254
- showHeroBanner: boolean;
255
- }
256
- type FilterType = "category" | "badge" | "title";
257
- type FilterOption = "select" | "equals" | "contain" | "startWith" | "endWith";
258
- type AvailableFilter = {
259
- id: number;
260
- label: string;
261
- value: FilterType;
262
- options: FilterOption[];
263
- };
264
- interface SectionFilters {
265
- id: string;
266
- type: FilterType;
267
- label: string;
268
- condition: FilterOption;
269
- value: string | string[];
270
- }
271
- interface SectionFilters {
272
- id: string;
273
- type: FilterType;
274
- label: string;
275
- condition: FilterOption;
276
- value: string | string[];
277
- }
278
- interface ProductCollection {
279
- type: "product-collection";
280
- title?: string;
281
- filters?: SectionFilters[];
282
- id: string;
283
- row_count: number;
284
- }
285
- interface Category {
286
- type: "categories";
287
- title?: string;
288
- id?: string;
289
- categories?: Category$1.Root[];
290
- selectedCategories?: string[];
291
- }
292
- interface Banner {
293
- type: "banner";
294
- title: string;
295
- description?: string;
296
- bannerImage: string;
297
- ctaText?: string;
298
- ctaLink?: string;
299
- id: string;
300
- bannerLink: string;
301
- showContents: boolean;
302
- mobileBannerImage: string;
303
- }
304
- interface SubCategorySection {
305
- type: "sub-categories";
306
- id: number;
307
- title: string;
308
- category?: Category$1.Root;
309
- }
310
- interface preFooterContent {
311
- id: string;
312
- image: string;
313
- title: string;
314
- description: string;
315
- }
316
- interface PreFooter {
317
- type: "pre-footer";
318
- id: string;
319
- contents: preFooterContent[];
320
- }
321
- interface CategoryHighlights {
322
- type: "category-highlights";
323
- title?: string;
324
- id?: string;
325
- categories: Category$1.Root[];
326
- }
327
- interface StoreReview {
328
- type: "store-review";
329
- id: string;
330
- title: string;
331
- filter: string;
332
- reviewsCount: number;
333
- starColor: string;
334
- autoPlayEnabled: boolean;
335
- }
336
- interface ProductHighlight {
337
- type: "product-highlight";
338
- id: string;
339
- title: string;
340
- productSlug: string;
341
- }
342
- interface ImageWithText {
343
- type: "image-with-text";
344
- id: string;
345
- title: string;
346
- content: string;
347
- image: string;
348
- showCta: boolean;
349
- ctaText: string;
350
- ctaLink: string;
351
- imagePosition: 'left' | 'right';
352
- }
353
- interface Collections {
354
- type: "collections";
355
- id: string;
356
- slug: string;
357
- title?: string;
358
- description?: string;
359
- variants?: CollectionResponse[];
360
- }
361
- interface ValueHighlights {
362
- type: "value-highlights";
363
- id: string;
364
- title: string;
365
- description: string;
366
- highlights: {
367
- value: string;
368
- label: string;
369
- image: string;
370
- social: null | string;
371
- }[];
372
- }
373
- type SectionType = "product-collection" | "categories" | "banner" | "sub-categories" | "pre-footer" | "category-highlights" | "store-review" | "product-highlight" | "image-with-text" | "collections" | "value-highlights";
374
- type Section = ProductCollection | Category | Banner | PreFooter | StoreReview | CategoryHighlights | SubCategorySection | ProductHighlight | ImageWithText | Collections | ValueHighlights;
375
- interface Footer {
376
- showSocialLinks: boolean;
377
- showContactDetails: boolean;
378
- showNameWithLogo: boolean;
379
- showWhatsappBubble: boolean;
380
- showMadeWithStorepecker: boolean;
381
- }
382
- interface SocialLinks {
383
- }
384
- interface LocationData {
385
- country_code: string;
386
- city: string;
387
- }
388
-
389
70
  declare function convertObjectToParams(params: {
390
71
  [key: string]: any;
391
72
  }): string;
@@ -425,50 +106,6 @@ declare class PhonepePayment {
425
106
  checkPaymentStatus(transactionId: string): Promise<AxiosResponse<PhonePe> | undefined>;
426
107
  }
427
108
 
428
- declare global {
429
- interface Window {
430
- fbq: any;
431
- }
432
- }
433
- declare const pixelEvents: {
434
- /**
435
- * Track when a user views a product
436
- */
437
- productView: (product: ProductDetail.Root) => void;
438
- /**
439
- * Track when a product is added to cart
440
- */
441
- addToCart: (product: Product.ProductList, quantity?: number) => void;
442
- removeFromCart: (product: ProductDetail.Root) => void;
443
- /**
444
- * Track when a product is added to wishlist
445
- */
446
- addToWishlist: (product: Product.ProductList) => void;
447
- /**
448
- * Track when user initiates checkout
449
- */
450
- initiateCheckout: (orderSummary: Order.OrderSummary, paymentMethod: string) => void;
451
- /**
452
- * Track successful purchases
453
- */
454
- purchase: (orderSummary: Order.OrderSummary) => void;
455
- /**
456
- * Track search events
457
- */
458
- search: (searchTerm: string, resultCount: number) => void;
459
- /**
460
- * Track when a user views their cart
461
- */
462
- cartView: (cart: Cart.Root) => void;
463
- /**
464
- * Track when a user completes a checkout
465
- */
466
- checkoutCompleted: (orderSummary: Order.OrderSummary) => void;
467
- addressInfoSubmitted: () => void;
468
- checkoutStarted: (cart: Cart.Root) => void;
469
- pageViewed: () => void;
470
- };
471
-
472
109
  declare const protectedRoutes: string[];
473
110
  declare const authRoutes: string[];
474
111
  declare const publicRoutes: string[];
@@ -570,4 +207,4 @@ declare function isProductCustomized(customizationInputs: Array<{
570
207
  [key: string]: any;
571
208
  }> | undefined, productId: number): boolean;
572
209
 
573
- export { Auth, type AvailableFilter, type Banner, CacheManager, type Category, type CategoryHighlights, type Collections, type ColorScheme, type FilterOption, type FilterType, type Footer, type HeaderCategory, type Hero, type HomePageContents, type ImageWithText, LocalCart, type LocationData, type Logo, type Menuitem, type NavBar, type NavElement, type NavElementOld, type PageHeaderProps, type PageMeta, type PageProps, type PagePropsFull, PhonepePayment, type PreFooter, type ProductCollection, type ProductHighlight, type RibbonBar, type RibbonMessage, type Section, type SectionFilters, type SectionType, type SliderSettings, type SocialLinks, type SocialMedia, type StoreReview, type SubCategory, type SubCategorySection, type TemplateTheme, type Theme, type ValueHighlights, authRoutes, cache, calculateDiscountPercent, clearCache, constructFilter, convertObjectToParams, convertToCurrency, cropImage, debounce, deleteCache, digestMessage, findMatchingVariant, findSimilarVariant, formatBookingDateTime, formatDateTime, formatPostalLabel, generateCacheKey, generateTimeOptions, getAddressMeta, getAvailableDaysText, getCache, getDelayInMilliseconds, getNextAvailableDate, getParamsFromURL, getQueryParams, getTimeConstraints, getUniqueId, hasCache, invalidateCache, isAvailableDay, isColorVariantType, isExpired, isProductCustomized, isVariantCombinationAvailable, pixelEvents, pluralize, type preFooterContent, protectedRoutes, publicRoutes, pushParamsToURL, setAuthTokenChangeCallback, setCache, shareLink, timeFromNow, urls };
210
+ 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, getParamsFromURL, getQueryParams, getTimeConstraints, getUniqueId, hasCache, invalidateCache, isAvailableDay, isColorVariantType, isExpired, isProductCustomized, isVariantCombinationAvailable, pluralize, protectedRoutes, publicRoutes, pushParamsToURL, setAuthTokenChangeCallback, setCache, shareLink, timeFromNow, urls };