storefront-layouts 1.0.3 → 1.0.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.
Files changed (509) hide show
  1. package/dist/components/auth/LoginForm.js +2 -2
  2. package/dist/components/auth/LoginSheet.js +2 -2
  3. package/dist/components/auth/login-form-core.js +3 -3
  4. package/dist/components/auth/login-sheet-header.js +3 -3
  5. package/dist/components/auth/login-sheet-registry.js +2 -2
  6. package/dist/components/auth/login-sheet-themes/booking-agenda.theme.js +1 -1
  7. package/dist/components/auth/login-sheet-themes/booking.theme.js +1 -1
  8. package/dist/components/auth/login-sheet-themes/clothing-minimal.theme.js +1 -1
  9. package/dist/components/auth/login-sheet-themes/clothing.theme.js +1 -1
  10. package/dist/components/auth/login-sheet-themes/electronics-grid.theme.js +1 -1
  11. package/dist/components/auth/login-sheet-themes/electronics.theme.js +1 -1
  12. package/dist/components/auth/login-sheet-themes/food-modern.theme.js +1 -1
  13. package/dist/components/auth/login-sheet-themes/food.theme.js +1 -1
  14. package/dist/components/auth/login-sheet-themes/index.js +9 -9
  15. package/dist/components/auth/login-sheet-themes/motivational-speaker.theme.js +1 -1
  16. package/dist/components/auth/login-sheet-themes/theme-input-baselines.d.ts +2 -2
  17. package/dist/components/auth/login-sheet-themes/theme-input-baselines.d.ts.map +1 -1
  18. package/dist/components/auth/login-sheet-themes/theme-input-baselines.js +2 -2
  19. package/dist/components/auth/login-sheets/StoreLoginSheetShell.d.ts.map +1 -1
  20. package/dist/components/auth/login-sheets/StoreLoginSheetShell.js +6 -6
  21. package/dist/components/auth/use-login-submit.js +3 -3
  22. package/dist/components/cart/InventoryHoldCountdown.js +2 -2
  23. package/dist/components/categories/category-masonry-grid.js +3 -3
  24. package/dist/components/checkout/CheckoutFeeLines.js +1 -1
  25. package/dist/components/checkout/ShippingOptionsPanel.js +3 -3
  26. package/dist/components/learning/CertificateTemplates.js +2 -2
  27. package/dist/components/learning/CertificateViewer.js +3 -3
  28. package/dist/components/learning/MentorshipProgress.d.ts.map +1 -1
  29. package/dist/components/learning/MentorshipProgress.js +4 -4
  30. package/dist/components/product/ProductVariationSelectors.js +1 -1
  31. package/dist/components/rich-text/CategoryDescription.js +2 -2
  32. package/dist/components/rich-text/ProductDescription.js +2 -2
  33. package/dist/components/rich-text/RichTextExcerpt.js +1 -1
  34. package/dist/components/rich-text/SafeRichHtml.d.ts +8 -11
  35. package/dist/components/rich-text/SafeRichHtml.d.ts.map +1 -1
  36. package/dist/components/rich-text/SafeRichHtml.js +3 -5
  37. package/dist/components/shipping/ProductDeliveryInfoSection.d.ts.map +1 -1
  38. package/dist/components/shipping/ProductDeliveryInfoSection.js +7 -4
  39. package/dist/components/shipping/ShippingQuoteAddressForm.js +3 -3
  40. package/dist/components/ui/alert-modal.js +2 -2
  41. package/dist/components/ui/avatar-image.js +1 -1
  42. package/dist/components/ui/badge.js +1 -1
  43. package/dist/components/ui/breadcrumbs.js +1 -1
  44. package/dist/components/ui/button.d.ts +1 -1
  45. package/dist/components/ui/button.js +1 -1
  46. package/dist/components/ui/card.js +1 -1
  47. package/dist/components/ui/category-tree.js +2 -2
  48. package/dist/components/ui/checkout-button.d.ts.map +1 -1
  49. package/dist/components/ui/checkout-button.js +11 -283
  50. package/dist/components/ui/guest-checkout-modal.js +3 -3
  51. package/dist/components/ui/image-skeleton.js +2 -2
  52. package/dist/components/ui/image-with-fallback.d.ts +3 -1
  53. package/dist/components/ui/image-with-fallback.d.ts.map +1 -1
  54. package/dist/components/ui/image-with-fallback.js +55 -139
  55. package/dist/components/ui/input.js +1 -1
  56. package/dist/components/ui/limited-time-offer-badge.js +2 -2
  57. package/dist/components/ui/loading-skeleton-wrapper.js +1 -1
  58. package/dist/components/ui/modal.js +2 -2
  59. package/dist/components/ui/otp-input.js +1 -1
  60. package/dist/components/ui/out-of-stock-overlay.js +1 -1
  61. package/dist/components/ui/page-animate-wrapper.js +2 -2
  62. package/dist/components/ui/page-content-loader.js +2 -2
  63. package/dist/components/ui/page-loader.js +1 -1
  64. package/dist/components/ui/product-card.d.ts.map +1 -1
  65. package/dist/components/ui/product-card.js +17 -17
  66. package/dist/components/ui/product-rating.js +1 -1
  67. package/dist/components/ui/product-stock-badge.js +2 -2
  68. package/dist/components/ui/review-form.js +2 -2
  69. package/dist/components/ui/route-skeleton-loader.js +6 -6
  70. package/dist/components/ui/sheet.d.ts +2 -1
  71. package/dist/components/ui/sheet.d.ts.map +1 -1
  72. package/dist/components/ui/sheet.js +4 -4
  73. package/dist/components/ui/skeleton.js +1 -1
  74. package/dist/components/ui/skeletons/index.js +5 -5
  75. package/dist/components/ui/skeletons/product-grid-skeleton.js +1 -1
  76. package/dist/components/ui/store-logos.d.ts.map +1 -1
  77. package/dist/components/ui/store-logos.js +4 -4
  78. package/dist/components/ui/toast.js +1 -1
  79. package/dist/components/ui/video-player.js +2 -2
  80. package/dist/editor/alignment-schemas/booking.js +1 -1
  81. package/dist/editor/alignment-schemas/clothing-minimal.js +1 -1
  82. package/dist/editor/alignment-schemas/index.js +20 -20
  83. package/dist/editor/alignment-schemas/lazy-loader.js +1 -1
  84. package/dist/editor/alignment-schemas/metadata.js +1 -1
  85. package/dist/editor/alignment-schemas/resolve-canvas-inspector-leaf.js +3 -3
  86. package/dist/editor/blocks/index.js +3 -3
  87. package/dist/editor/blocks/migrate-clothing-minimal.js +3 -3
  88. package/dist/editor/blocks/nav-outline-utils.js +2 -2
  89. package/dist/editor/blocks/registry.js +1 -1
  90. package/dist/editor/document/adapter.js +4 -4
  91. package/dist/editor/document/block-tree.js +1 -1
  92. package/dist/editor/document/index.js +6 -6
  93. package/dist/editor/document/validate.js +1 -1
  94. package/dist/editor/index.js +12 -12
  95. package/dist/editor/layout-content-loader.js +3 -3
  96. package/dist/editor/payaza-form/ArrayItemManager.js +2 -2
  97. package/dist/editor/payaza-form/EditorCanvasPreview.js +5 -5
  98. package/dist/editor/payaza-form/FieldRenderer.js +17 -17
  99. package/dist/editor/payaza-form/IframePreviewMessageBridge.js +3 -3
  100. package/dist/editor/payaza-form/PayazaFormEditor.js +31 -31
  101. package/dist/editor/payaza-form/PayazaFormEditorFullPage.js +2 -2
  102. package/dist/editor/payaza-form/SliderArrayEditor.js +3 -3
  103. package/dist/editor/payaza-form/components/ArrayField.js +1 -1
  104. package/dist/editor/payaza-form/components/BlockStylesInspector.js +1 -1
  105. package/dist/editor/payaza-form/components/BlocksField.js +9 -9
  106. package/dist/editor/payaza-form/components/ButtonField.js +3 -3
  107. package/dist/editor/payaza-form/components/CanvasGranularInspector.js +11 -11
  108. package/dist/editor/payaza-form/components/IconField.js +2 -2
  109. package/dist/editor/payaza-form/components/ImageField.js +1 -1
  110. package/dist/editor/payaza-form/components/NumberField.js +1 -1
  111. package/dist/editor/payaza-form/components/RichTextField.js +2 -2
  112. package/dist/editor/payaza-form/components/SectionField.js +1 -1
  113. package/dist/editor/payaza-form/components/SectionSchemaInspector.js +3 -3
  114. package/dist/editor/payaza-form/components/StarRatingField.js +2 -2
  115. package/dist/editor/payaza-form/components/TextField.js +1 -1
  116. package/dist/editor/payaza-form/data-merger.js +6 -6
  117. package/dist/editor/payaza-form/data-transformer.js +3 -3
  118. package/dist/editor/payaza-form/engine.js +1 -1
  119. package/dist/editor/payaza-form/examples/custom-widgets.example.js +1 -1
  120. package/dist/editor/payaza-form/index.js +8 -8
  121. package/dist/editor/payaza-form/layout-loader.js +2 -2
  122. package/dist/editor/payaza-form/preview-message-handler.js +3 -3
  123. package/dist/editor/payaza-form/schema-bridge.js +3 -3
  124. package/dist/editor/payaza-form/widget-registry.js +1 -1
  125. package/dist/editor/shared/BlockOutlineTree.js +2 -2
  126. package/dist/editor/shared/EditorHeader.js +2 -2
  127. package/dist/editor/shared/EditorNavigator.js +2 -2
  128. package/dist/editor/shared/IframePreview.js +6 -6
  129. package/dist/editor/shared/InlineCanvasPreview.js +8 -8
  130. package/dist/editor/shared/LayoutRenderer.js +1 -1
  131. package/dist/editor/shared/ResizableSidebar.js +1 -1
  132. package/dist/editor/shared/index.js +7 -7
  133. package/dist/hooks/use-analytics.js +3 -3
  134. package/dist/hooks/use-api.js +1 -1
  135. package/dist/hooks/use-cart-api.d.ts.map +1 -1
  136. package/dist/hooks/use-cart-api.js +8 -3
  137. package/dist/hooks/use-catalog-loader.js +3 -3
  138. package/dist/hooks/use-catalog-price-range.d.ts +2 -5
  139. package/dist/hooks/use-catalog-price-range.d.ts.map +1 -1
  140. package/dist/hooks/use-catalog-price-range.js +20 -5
  141. package/dist/hooks/use-category-products.d.ts +8 -0
  142. package/dist/hooks/use-category-products.d.ts.map +1 -0
  143. package/dist/hooks/use-category-products.js +43 -0
  144. package/dist/hooks/use-checkout-fees.d.ts +3 -4
  145. package/dist/hooks/use-checkout-fees.d.ts.map +1 -1
  146. package/dist/hooks/use-checkout-fees.js +1 -1
  147. package/dist/hooks/use-content-ready.js +1 -1
  148. package/dist/hooks/use-featured-products.d.ts +3 -0
  149. package/dist/hooks/use-featured-products.d.ts.map +1 -0
  150. package/dist/hooks/use-featured-products.js +25 -0
  151. package/dist/hooks/use-multi-store-checkout-fees.d.ts +3 -4
  152. package/dist/hooks/use-multi-store-checkout-fees.d.ts.map +1 -1
  153. package/dist/hooks/use-multi-store-checkout-fees.js +1 -1
  154. package/dist/hooks/use-navigation-loading.js +1 -1
  155. package/dist/hooks/use-payaza-checkout.d.ts +1 -1
  156. package/dist/hooks/use-payaza-checkout.d.ts.map +1 -1
  157. package/dist/hooks/use-payaza-checkout.js +9 -3
  158. package/dist/hooks/use-product-brands.d.ts +5 -0
  159. package/dist/hooks/use-product-brands.d.ts.map +1 -0
  160. package/dist/hooks/use-product-brands.js +25 -0
  161. package/dist/hooks/use-product-by-slug.d.ts +7 -0
  162. package/dist/hooks/use-product-by-slug.d.ts.map +1 -0
  163. package/dist/hooks/use-product-by-slug.js +38 -0
  164. package/dist/hooks/use-product-reviews.d.ts +15 -0
  165. package/dist/hooks/use-product-reviews.d.ts.map +1 -0
  166. package/dist/hooks/use-product-reviews.js +75 -0
  167. package/dist/hooks/use-product-variation-selection.d.ts +2 -8
  168. package/dist/hooks/use-product-variation-selection.d.ts.map +1 -1
  169. package/dist/hooks/use-product-variation-selection.js +1 -1
  170. package/dist/hooks/use-products-api.js +3 -3
  171. package/dist/hooks/use-shipping-quote.js +2 -2
  172. package/dist/hooks/use-store-api.js +4 -4
  173. package/dist/hooks/usePreviewSlideSync.js +1 -1
  174. package/dist/index.d.ts +62 -74
  175. package/dist/index.d.ts.map +1 -1
  176. package/dist/index.js +141 -153
  177. package/dist/layouts/booking/components/BookingHomePage.d.ts.map +1 -1
  178. package/dist/layouts/booking/components/BookingHomePage.js +68 -74
  179. package/dist/layouts/booking/components/BookingMultilineHeading.js +1 -1
  180. package/dist/layouts/booking/components/BookingTestimonialCard.js +2 -2
  181. package/dist/layouts/booking/components/BookingTestimonialsEmptyState.js +1 -1
  182. package/dist/layouts/booking/components/booking-footer-defaults.js +2 -2
  183. package/dist/layouts/booking/index.js +8 -8
  184. package/dist/layouts/booking/pages/AboutPage.d.ts +1 -1
  185. package/dist/layouts/booking/pages/AboutPage.d.ts.map +1 -1
  186. package/dist/layouts/booking/pages/AboutPage.js +39 -60
  187. package/dist/layouts/booking/pages/BookPage.d.ts.map +1 -1
  188. package/dist/layouts/booking/pages/BookPage.js +16 -22
  189. package/dist/layouts/booking/pages/CategoriesPage.js +6 -6
  190. package/dist/layouts/booking/pages/CategoryPage.d.ts +1 -1
  191. package/dist/layouts/booking/pages/CategoryPage.d.ts.map +1 -1
  192. package/dist/layouts/booking/pages/CategoryPage.js +17 -26
  193. package/dist/layouts/booking/pages/ContactPage.d.ts +1 -1
  194. package/dist/layouts/booking/pages/ContactPage.d.ts.map +1 -1
  195. package/dist/layouts/booking/pages/ContactPage.js +5 -12
  196. package/dist/layouts/booking/pages/ProductDetailPage.d.ts +1 -1
  197. package/dist/layouts/booking/pages/ProductDetailPage.d.ts.map +1 -1
  198. package/dist/layouts/booking/pages/ProductDetailPage.js +203 -150
  199. package/dist/layouts/booking/pages/ServicesPage.d.ts +1 -1
  200. package/dist/layouts/booking/pages/ServicesPage.d.ts.map +1 -1
  201. package/dist/layouts/booking/pages/ServicesPage.js +11 -31
  202. package/dist/layouts/booking-agenda/components/BookingHomePageAgenda.d.ts.map +1 -1
  203. package/dist/layouts/booking-agenda/components/BookingHomePageAgenda.js +21 -30
  204. package/dist/layouts/booking-agenda/index.js +8 -8
  205. package/dist/layouts/booking-agenda/pages/AboutPage.d.ts +1 -1
  206. package/dist/layouts/booking-agenda/pages/AboutPage.d.ts.map +1 -1
  207. package/dist/layouts/booking-agenda/pages/AboutPage.js +11 -14
  208. package/dist/layouts/booking-agenda/pages/BookPage.d.ts.map +1 -1
  209. package/dist/layouts/booking-agenda/pages/BookPage.js +15 -21
  210. package/dist/layouts/booking-agenda/pages/CategoriesPage.js +5 -5
  211. package/dist/layouts/booking-agenda/pages/CategoryPage.d.ts +1 -1
  212. package/dist/layouts/booking-agenda/pages/CategoryPage.d.ts.map +1 -1
  213. package/dist/layouts/booking-agenda/pages/CategoryPage.js +12 -18
  214. package/dist/layouts/booking-agenda/pages/ContactPage.d.ts +1 -1
  215. package/dist/layouts/booking-agenda/pages/ContactPage.d.ts.map +1 -1
  216. package/dist/layouts/booking-agenda/pages/ContactPage.js +8 -13
  217. package/dist/layouts/booking-agenda/pages/ProductDetailPage.d.ts +1 -1
  218. package/dist/layouts/booking-agenda/pages/ProductDetailPage.d.ts.map +1 -1
  219. package/dist/layouts/booking-agenda/pages/ProductDetailPage.js +202 -149
  220. package/dist/layouts/booking-agenda/pages/ServicesPage.d.ts +1 -1
  221. package/dist/layouts/booking-agenda/pages/ServicesPage.d.ts.map +1 -1
  222. package/dist/layouts/booking-agenda/pages/ServicesPage.js +8 -23
  223. package/dist/layouts/clothing/components/ClothingHomePage.d.ts.map +1 -1
  224. package/dist/layouts/clothing/components/ClothingHomePage.js +199 -136
  225. package/dist/layouts/clothing/index.js +7 -7
  226. package/dist/layouts/clothing/pages/AboutPage.d.ts +1 -1
  227. package/dist/layouts/clothing/pages/AboutPage.d.ts.map +1 -1
  228. package/dist/layouts/clothing/pages/AboutPage.js +19 -33
  229. package/dist/layouts/clothing/pages/CategoriesPage.js +8 -8
  230. package/dist/layouts/clothing/pages/CategoryPage.d.ts +1 -1
  231. package/dist/layouts/clothing/pages/CategoryPage.d.ts.map +1 -1
  232. package/dist/layouts/clothing/pages/CategoryPage.js +15 -41
  233. package/dist/layouts/clothing/pages/ContactPage.d.ts +1 -1
  234. package/dist/layouts/clothing/pages/ContactPage.d.ts.map +1 -1
  235. package/dist/layouts/clothing/pages/ContactPage.js +5 -8
  236. package/dist/layouts/clothing/pages/ProductDetailPage.d.ts +1 -1
  237. package/dist/layouts/clothing/pages/ProductDetailPage.d.ts.map +1 -1
  238. package/dist/layouts/clothing/pages/ProductDetailPage.js +256 -167
  239. package/dist/layouts/clothing/pages/ProductsPage.d.ts +1 -1
  240. package/dist/layouts/clothing/pages/ProductsPage.d.ts.map +1 -1
  241. package/dist/layouts/clothing/pages/ProductsPage.js +125 -59
  242. package/dist/layouts/clothing/payaza-bindings.js +2 -2
  243. package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.d.ts.map +1 -1
  244. package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.js +32 -131
  245. package/dist/layouts/clothing-minimal/components/clothing-minimal-block-render.js +8 -8
  246. package/dist/layouts/clothing-minimal/index.js +7 -7
  247. package/dist/layouts/clothing-minimal/pages/AboutPage.d.ts +1 -1
  248. package/dist/layouts/clothing-minimal/pages/AboutPage.d.ts.map +1 -1
  249. package/dist/layouts/clothing-minimal/pages/AboutPage.js +37 -61
  250. package/dist/layouts/clothing-minimal/pages/CategoriesPage.js +7 -7
  251. package/dist/layouts/clothing-minimal/pages/CategoryPage.d.ts +1 -1
  252. package/dist/layouts/clothing-minimal/pages/CategoryPage.d.ts.map +1 -1
  253. package/dist/layouts/clothing-minimal/pages/CategoryPage.js +13 -18
  254. package/dist/layouts/clothing-minimal/pages/ContactPage.d.ts +1 -1
  255. package/dist/layouts/clothing-minimal/pages/ContactPage.d.ts.map +1 -1
  256. package/dist/layouts/clothing-minimal/pages/ContactPage.js +5 -8
  257. package/dist/layouts/clothing-minimal/pages/ProductDetailPage.d.ts +1 -1
  258. package/dist/layouts/clothing-minimal/pages/ProductDetailPage.d.ts.map +1 -1
  259. package/dist/layouts/clothing-minimal/pages/ProductDetailPage.js +202 -143
  260. package/dist/layouts/clothing-minimal/pages/ProductsPage.d.ts +1 -1
  261. package/dist/layouts/clothing-minimal/pages/ProductsPage.d.ts.map +1 -1
  262. package/dist/layouts/clothing-minimal/pages/ProductsPage.js +126 -57
  263. package/dist/layouts/electronics/components/ElectronicsCategoriesPage.js +7 -7
  264. package/dist/layouts/electronics/components/ElectronicsGridProductCard.js +10 -10
  265. package/dist/layouts/electronics/components/ElectronicsHomePage.d.ts.map +1 -1
  266. package/dist/layouts/electronics/components/ElectronicsHomePage.js +29 -31
  267. package/dist/layouts/electronics/components/ElectronicsPageWrapper.js +4 -4
  268. package/dist/layouts/electronics/components/ElectronicsProductsPage.d.ts.map +1 -1
  269. package/dist/layouts/electronics/components/ElectronicsProductsPage.js +81 -23
  270. package/dist/layouts/electronics/components/ElectronicsStoreFooter.js +2 -2
  271. package/dist/layouts/electronics/components/ElectronicsStoreHeader.js +6 -6
  272. package/dist/layouts/electronics/index.js +18 -18
  273. package/dist/layouts/electronics/pages/AboutPage.d.ts +1 -1
  274. package/dist/layouts/electronics/pages/AboutPage.d.ts.map +1 -1
  275. package/dist/layouts/electronics/pages/AboutPage.js +11 -14
  276. package/dist/layouts/electronics/pages/CategoriesPage.js +1 -1
  277. package/dist/layouts/electronics/pages/CategoryPage.d.ts +1 -1
  278. package/dist/layouts/electronics/pages/CategoryPage.d.ts.map +1 -1
  279. package/dist/layouts/electronics/pages/CategoryPage.js +14 -20
  280. package/dist/layouts/electronics/pages/ContactPage.d.ts +1 -1
  281. package/dist/layouts/electronics/pages/ContactPage.d.ts.map +1 -1
  282. package/dist/layouts/electronics/pages/ContactPage.js +8 -13
  283. package/dist/layouts/electronics/pages/HelpCenterPage.js +1 -1
  284. package/dist/layouts/electronics/pages/PrivacyPolicyPage.js +1 -1
  285. package/dist/layouts/electronics/pages/ProductDetailPage.d.ts +1 -1
  286. package/dist/layouts/electronics/pages/ProductDetailPage.d.ts.map +1 -1
  287. package/dist/layouts/electronics/pages/ProductDetailPage.js +201 -142
  288. package/dist/layouts/electronics/pages/ProductsPage.d.ts +1 -1
  289. package/dist/layouts/electronics/pages/ProductsPage.d.ts.map +1 -1
  290. package/dist/layouts/electronics/pages/ProductsPage.js +119 -49
  291. package/dist/layouts/electronics/pages/TermsPage.js +1 -1
  292. package/dist/layouts/electronics/pages/TrackOrderPage.js +4 -4
  293. package/dist/layouts/electronics-grid/components/ElectronicsGridProductCard.js +10 -10
  294. package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.d.ts.map +1 -1
  295. package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.js +75 -33
  296. package/dist/layouts/electronics-grid/index.js +14 -14
  297. package/dist/layouts/electronics-grid/pages/AboutPage.d.ts +1 -1
  298. package/dist/layouts/electronics-grid/pages/AboutPage.d.ts.map +1 -1
  299. package/dist/layouts/electronics-grid/pages/AboutPage.js +11 -14
  300. package/dist/layouts/electronics-grid/pages/CategoriesPage.js +1 -1
  301. package/dist/layouts/electronics-grid/pages/CategoryPage.d.ts +1 -1
  302. package/dist/layouts/electronics-grid/pages/CategoryPage.d.ts.map +1 -1
  303. package/dist/layouts/electronics-grid/pages/CategoryPage.js +14 -20
  304. package/dist/layouts/electronics-grid/pages/ContactPage.d.ts +1 -1
  305. package/dist/layouts/electronics-grid/pages/ContactPage.d.ts.map +1 -1
  306. package/dist/layouts/electronics-grid/pages/ContactPage.js +8 -13
  307. package/dist/layouts/electronics-grid/pages/ElectronicsGridCategoriesPage.js +6 -6
  308. package/dist/layouts/electronics-grid/pages/HelpCenterPage.js +1 -1
  309. package/dist/layouts/electronics-grid/pages/PrivacyPolicyPage.js +1 -1
  310. package/dist/layouts/electronics-grid/pages/ProductDetailPage.d.ts +1 -1
  311. package/dist/layouts/electronics-grid/pages/ProductDetailPage.d.ts.map +1 -1
  312. package/dist/layouts/electronics-grid/pages/ProductDetailPage.js +201 -142
  313. package/dist/layouts/electronics-grid/pages/ProductsPage.d.ts +1 -1
  314. package/dist/layouts/electronics-grid/pages/ProductsPage.d.ts.map +1 -1
  315. package/dist/layouts/electronics-grid/pages/ProductsPage.js +121 -52
  316. package/dist/layouts/electronics-grid/pages/TermsPage.js +1 -1
  317. package/dist/layouts/electronics-grid/pages/TrackOrderPage.js +4 -4
  318. package/dist/layouts/food/components/FoodHomePage.d.ts.map +1 -1
  319. package/dist/layouts/food/components/FoodHomePage.js +42 -41
  320. package/dist/layouts/food/index.js +8 -8
  321. package/dist/layouts/food/pages/AboutPage.d.ts +1 -1
  322. package/dist/layouts/food/pages/AboutPage.d.ts.map +1 -1
  323. package/dist/layouts/food/pages/AboutPage.js +44 -45
  324. package/dist/layouts/food/pages/CategoriesPage.js +6 -6
  325. package/dist/layouts/food/pages/CategoryPage.d.ts +1 -1
  326. package/dist/layouts/food/pages/CategoryPage.d.ts.map +1 -1
  327. package/dist/layouts/food/pages/CategoryPage.js +23 -21
  328. package/dist/layouts/food/pages/ContactPage.d.ts +1 -1
  329. package/dist/layouts/food/pages/ContactPage.d.ts.map +1 -1
  330. package/dist/layouts/food/pages/ContactPage.js +5 -7
  331. package/dist/layouts/food/pages/MenuPage.d.ts +1 -1
  332. package/dist/layouts/food/pages/MenuPage.d.ts.map +1 -1
  333. package/dist/layouts/food/pages/MenuPage.js +81 -42
  334. package/dist/layouts/food/pages/ProductDetailPage.d.ts +1 -1
  335. package/dist/layouts/food/pages/ProductDetailPage.d.ts.map +1 -1
  336. package/dist/layouts/food/pages/ProductDetailPage.js +209 -171
  337. package/dist/layouts/food/pages/ProductsPage.d.ts +1 -1
  338. package/dist/layouts/food/pages/ProductsPage.d.ts.map +1 -1
  339. package/dist/layouts/food/pages/ProductsPage.js +130 -45
  340. package/dist/layouts/food-modern/components/FoodHomePageModern.js +10 -10
  341. package/dist/layouts/food-modern/index.js +8 -8
  342. package/dist/layouts/food-modern/pages/AboutPage.d.ts +1 -1
  343. package/dist/layouts/food-modern/pages/AboutPage.d.ts.map +1 -1
  344. package/dist/layouts/food-modern/pages/AboutPage.js +11 -14
  345. package/dist/layouts/food-modern/pages/CategoriesPage.js +5 -5
  346. package/dist/layouts/food-modern/pages/CategoryPage.d.ts +1 -1
  347. package/dist/layouts/food-modern/pages/CategoryPage.d.ts.map +1 -1
  348. package/dist/layouts/food-modern/pages/CategoryPage.js +23 -20
  349. package/dist/layouts/food-modern/pages/ContactPage.d.ts +1 -1
  350. package/dist/layouts/food-modern/pages/ContactPage.d.ts.map +1 -1
  351. package/dist/layouts/food-modern/pages/ContactPage.js +5 -7
  352. package/dist/layouts/food-modern/pages/MenuPage.d.ts +1 -1
  353. package/dist/layouts/food-modern/pages/MenuPage.d.ts.map +1 -1
  354. package/dist/layouts/food-modern/pages/MenuPage.js +81 -46
  355. package/dist/layouts/food-modern/pages/ProductDetailPage.d.ts +1 -1
  356. package/dist/layouts/food-modern/pages/ProductDetailPage.d.ts.map +1 -1
  357. package/dist/layouts/food-modern/pages/ProductDetailPage.js +202 -143
  358. package/dist/layouts/food-modern/pages/ProductsPage.d.ts +1 -1
  359. package/dist/layouts/food-modern/pages/ProductsPage.d.ts.map +1 -1
  360. package/dist/layouts/food-modern/pages/ProductsPage.js +117 -33
  361. package/dist/layouts/motivational-speaker/components/MotivationalHomePage.d.ts.map +1 -1
  362. package/dist/layouts/motivational-speaker/components/MotivationalHomePage.js +32 -23
  363. package/dist/layouts/motivational-speaker/components/MotivationalSpeakerPageWrapper.js +1 -1
  364. package/dist/layouts/motivational-speaker/index.js +9 -9
  365. package/dist/layouts/motivational-speaker/pages/AboutPage.d.ts +1 -1
  366. package/dist/layouts/motivational-speaker/pages/AboutPage.d.ts.map +1 -1
  367. package/dist/layouts/motivational-speaker/pages/AboutPage.js +6 -9
  368. package/dist/layouts/motivational-speaker/pages/CategoryPage.d.ts +1 -1
  369. package/dist/layouts/motivational-speaker/pages/CategoryPage.d.ts.map +1 -1
  370. package/dist/layouts/motivational-speaker/pages/CategoryPage.js +18 -22
  371. package/dist/layouts/motivational-speaker/pages/ContactPage.d.ts +1 -1
  372. package/dist/layouts/motivational-speaker/pages/ContactPage.d.ts.map +1 -1
  373. package/dist/layouts/motivational-speaker/pages/ContactPage.js +9 -13
  374. package/dist/layouts/motivational-speaker/pages/ProductsPage.d.ts +1 -1
  375. package/dist/layouts/motivational-speaker/pages/ProductsPage.d.ts.map +1 -1
  376. package/dist/layouts/motivational-speaker/pages/ProductsPage.js +121 -52
  377. package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.d.ts +1 -1
  378. package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.d.ts.map +1 -1
  379. package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.js +15 -24
  380. package/dist/layouts/motivational-speaker/pages/ServicesPage.d.ts +1 -1
  381. package/dist/layouts/motivational-speaker/pages/ServicesPage.d.ts.map +1 -1
  382. package/dist/layouts/motivational-speaker/pages/ServicesPage.js +8 -23
  383. package/dist/layouts/motivational-speaker/pages/SubscriptionPage.js +7 -7
  384. package/dist/layouts/shared/components/BaseStoreLayout.js +9 -9
  385. package/dist/layouts/shared/components/CartLineQuantityControl.js +1 -1
  386. package/dist/layouts/shared/components/GenericPageWrapper.js +3 -3
  387. package/dist/layouts/shared/components/ProductPriceFilterSection.js +4 -4
  388. package/dist/layouts/shared/components/PromoBanner.d.ts +1 -4
  389. package/dist/layouts/shared/components/PromoBanner.d.ts.map +1 -1
  390. package/dist/layouts/shared/components/PromoBanner.js +12 -8
  391. package/dist/layouts/shared/components/StoreFooter.js +10 -10
  392. package/dist/layouts/shared/components/StoreHeader.js +7 -7
  393. package/dist/layouts/shared/components/TestimonialCard.d.ts.map +1 -1
  394. package/dist/layouts/shared/components/TestimonialCard.js +2 -2
  395. package/dist/layouts/shared/components/headers/BookingAgendaSidebar.js +2 -2
  396. package/dist/layouts/shared/components/headers/ClothingMinimalHeader.js +11 -11
  397. package/dist/layouts/shared/components/headers/FoodModernHeader.js +7 -7
  398. package/dist/layouts/shared/index.js +22 -22
  399. package/dist/layouts/shared/pages/AccountPage.d.ts.map +1 -1
  400. package/dist/layouts/shared/pages/AccountPage.js +101 -27
  401. package/dist/layouts/shared/pages/CartPage.d.ts.map +1 -1
  402. package/dist/layouts/shared/pages/CartPage.js +39 -90
  403. package/dist/layouts/shared/pages/CheckoutPage.d.ts.map +1 -1
  404. package/dist/layouts/shared/pages/CheckoutPage.js +349 -868
  405. package/dist/layouts/shared/pages/CookiePolicyPage.js +1 -1
  406. package/dist/layouts/shared/pages/FeatureDisabledPage.js +1 -1
  407. package/dist/layouts/shared/pages/HelpCenterPage.js +1 -1
  408. package/dist/layouts/shared/pages/MaintenancePage.d.ts.map +1 -1
  409. package/dist/layouts/shared/pages/MaintenancePage.js +2 -3
  410. package/dist/layouts/shared/pages/PortfolioPage.d.ts.map +1 -1
  411. package/dist/layouts/shared/pages/PortfolioPage.js +2 -2
  412. package/dist/layouts/shared/pages/PrivacyPolicyPage.js +1 -1
  413. package/dist/layouts/shared/pages/SizeGuidePage.js +1 -1
  414. package/dist/layouts/shared/pages/StyleGuidePage.js +3 -3
  415. package/dist/layouts/shared/pages/TeamPage.d.ts.map +1 -1
  416. package/dist/layouts/shared/pages/TeamPage.js +1 -1
  417. package/dist/layouts/shared/pages/TermsPage.js +1 -1
  418. package/dist/layouts/shared/pages/TrackOrderPage.js +4 -4
  419. package/dist/layouts/shared/pages/WishlistPage.d.ts.map +1 -1
  420. package/dist/layouts/shared/pages/WishlistPage.js +44 -29
  421. package/dist/layouts/shared/wrappers/BookingAgendaLayout.d.ts.map +1 -1
  422. package/dist/layouts/shared/wrappers/BookingAgendaLayout.js +80 -35
  423. package/dist/layouts/shared/wrappers/ClothingLayout.js +8 -8
  424. package/dist/layouts/shared/wrappers/ClothingMinimalLayout.js +7 -7
  425. package/dist/layouts/shared/wrappers/ElectronicsLayout.js +5 -5
  426. package/dist/layouts/shared/wrappers/FoodModernLayout.js +6 -6
  427. package/dist/layouts/shared/wrappers/MotivationalLayout.js +9 -9
  428. package/dist/layouts/shared/wrappers/StandardLayout.js +8 -8
  429. package/dist/lib/api.d.ts +3 -4
  430. package/dist/lib/api.d.ts.map +1 -1
  431. package/dist/lib/api.js +69 -109
  432. package/dist/lib/auth-context.js +2 -2
  433. package/dist/lib/content-selectors.d.ts +1 -1
  434. package/dist/lib/content-selectors.d.ts.map +1 -1
  435. package/dist/lib/content-selectors.js +8 -0
  436. package/dist/lib/layout-config-hydration.js +2 -2
  437. package/dist/lib/loading-context.d.ts.map +1 -1
  438. package/dist/lib/loading-context.js +11 -21
  439. package/dist/lib/payaza-checkout.d.ts.map +1 -1
  440. package/dist/lib/payaza-checkout.js +2 -4
  441. package/dist/lib/payaza-public-key.d.ts +6 -0
  442. package/dist/lib/payaza-public-key.d.ts.map +1 -0
  443. package/dist/lib/payaza-public-key.js +10 -0
  444. package/dist/lib/rich-html.d.ts +31 -26
  445. package/dist/lib/rich-html.d.ts.map +1 -1
  446. package/dist/lib/rich-html.js +1 -0
  447. package/dist/lib/services/analytics.service.js +1 -1
  448. package/dist/lib/services/auth.service.js +1 -1
  449. package/dist/lib/services/booking.service.js +1 -1
  450. package/dist/lib/services/category.service.js +1 -1
  451. package/dist/lib/services/checkout.service.d.ts +3 -0
  452. package/dist/lib/services/checkout.service.d.ts.map +1 -1
  453. package/dist/lib/services/checkout.service.js +1 -1
  454. package/dist/lib/services/contact.service.js +1 -1
  455. package/dist/lib/services/customer.service.js +1 -1
  456. package/dist/lib/services/fees.service.d.ts +17 -63
  457. package/dist/lib/services/fees.service.d.ts.map +1 -1
  458. package/dist/lib/services/fees.service.js +4 -138
  459. package/dist/lib/services/index.js +13 -13
  460. package/dist/lib/services/location.service.js +1 -1
  461. package/dist/lib/services/order.service.js +1 -1
  462. package/dist/lib/services/payment.service.js +1 -1
  463. package/dist/lib/services/product.service.d.ts +7 -2
  464. package/dist/lib/services/product.service.d.ts.map +1 -1
  465. package/dist/lib/services/product.service.js +13 -1
  466. package/dist/lib/services/promo.service.js +1 -1
  467. package/dist/lib/services/review.service.js +1 -1
  468. package/dist/lib/services/service.service.js +1 -1
  469. package/dist/lib/services/shipping.service.js +1 -1
  470. package/dist/lib/services/store.service.js +1 -1
  471. package/dist/lib/store-config-utils.d.ts +1 -10
  472. package/dist/lib/store-config-utils.d.ts.map +1 -1
  473. package/dist/lib/store-config-utils.js +73 -261
  474. package/dist/lib/store-config.js +1 -1
  475. package/dist/lib/store-context.d.ts +1 -23
  476. package/dist/lib/store-context.d.ts.map +1 -1
  477. package/dist/lib/store-context.js +89 -111
  478. package/dist/lib/store-types.d.ts +9 -91
  479. package/dist/lib/store-types.d.ts.map +1 -1
  480. package/dist/lib/utils/asset-helpers.js +1 -1
  481. package/dist/lib/utils/catalog-price-bounds.d.ts +16 -6
  482. package/dist/lib/utils/catalog-price-bounds.d.ts.map +1 -1
  483. package/dist/lib/utils/catalog-price-bounds.js +58 -14
  484. package/dist/lib/utils/category-tree.d.ts +9 -0
  485. package/dist/lib/utils/category-tree.d.ts.map +1 -1
  486. package/dist/lib/utils/category-tree.js +26 -0
  487. package/dist/lib/utils/editor-preview.d.ts +5 -0
  488. package/dist/lib/utils/editor-preview.d.ts.map +1 -1
  489. package/dist/lib/utils/editor-preview.js +17 -3
  490. package/dist/lib/utils/fee-calculations.d.ts +5 -1
  491. package/dist/lib/utils/fee-calculations.d.ts.map +1 -1
  492. package/dist/lib/utils/fee-calculations.js +28 -31
  493. package/dist/lib/utils/index.d.ts +1 -1
  494. package/dist/lib/utils/index.d.ts.map +1 -1
  495. package/dist/lib/utils/index.js +4 -4
  496. package/dist/lib/utils/product-images.js +1 -1
  497. package/dist/lib/utils/product-share.js +1 -1
  498. package/dist/lib/utils/url-helpers.d.ts +6 -0
  499. package/dist/lib/utils/url-helpers.d.ts.map +1 -1
  500. package/dist/lib/utils/url-helpers.js +20 -4
  501. package/dist/preview/LayoutPreview.js +6 -6
  502. package/dist/preview/PreviewRouter.js +4 -4
  503. package/dist/preview/canvas/PreviewCanvasEnhancer.js +8 -8
  504. package/dist/preview/canvas/preview-flush-await.js +1 -1
  505. package/dist/preview/canvas/preview-isolation.js +1 -1
  506. package/dist/preview/canvas/preview-route.js +2 -2
  507. package/dist/preview/index.js +5 -5
  508. package/dist/styles/index.css +190 -149
  509. package/package.json +31 -43
@@ -1,29 +1,19 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { createContext, useContext, useEffect, useState, useMemo, useCallback, useRef } from 'react';
4
- import { getStoreConfig } from './store-config.js';
5
- import { shouldUseAPI, getBaseStoreSlug } from './utils/demo-detection.js';
6
- import { storeService } from './services/store.service.js';
3
+ import { createContext, useContext, useEffect, useState, useMemo, useCallback } from 'react';
4
+ import { getStoreConfig } from './store-config';
5
+ import { shouldUseAPI, getBaseStoreSlug } from './utils/demo-detection';
6
+ import { storeService } from './services/store.service';
7
7
  // Note: cartService and wishlistService removed - using localStorage only for cart/wishlist
8
8
  // These services are only needed for shared pages (cart, wishlist, account) which aren't editable in the editor
9
- import { categoryService } from './services/category.service.js';
10
- import { productService } from './services/product.service.js';
11
- import { serviceService } from './services/service.service.js';
12
- import { transformCategoryToStoreCategory, transformProductToStoreProduct, transformServiceToStoreService, transformStoreResponseToConfig } from './store-config-utils.js';
13
- import { useLoading } from './loading-context.js';
14
- import { normalizePrice, isDeepEqual } from './utils/index.js';
15
- import { richFieldPlainTextForDisplay } from './rich-html.js';
16
- import { useAuth } from './auth-context.js';
17
- import { analyticsService } from './services/analytics.service.js';
18
- import { getProductStockInfo, formatStockLimitMessage } from './inventory-utils.js';
19
- import { buildCartLineProduct } from './product-variation-utils.js';
20
- import { trackStorefrontEvent } from './mixpanel.js';
21
- function normalizeAddToCartOptions(variantIdOrOptions) {
22
- if (typeof variantIdOrOptions === 'string') {
23
- return { variantId: variantIdOrOptions };
24
- }
25
- return variantIdOrOptions ?? {};
26
- }
9
+ import { categoryService } from './services/category.service';
10
+ import { productService } from './services/product.service';
11
+ import { serviceService } from './services/service.service';
12
+ import { transformCategoryToStoreCategory, transformProductToStoreProduct, transformServiceToStoreService } from './store-config-utils';
13
+ import { useLoading } from './loading-context';
14
+ import { normalizePrice } from './utils';
15
+ import { useAuth } from './auth-context';
16
+ import { analyticsService } from './services/analytics.service';
27
17
  export const StoreContext = createContext({
28
18
  store: null,
29
19
  isLoading: true,
@@ -33,16 +23,11 @@ export const StoreContext = createContext({
33
23
  removeFromCart: async () => { },
34
24
  updateCartQuantity: async () => { },
35
25
  removeOrderItemsFromCart: async () => { },
36
- finalizeCartAfterOrder: async () => { },
37
26
  cartTotal: 0,
38
27
  cartCount: 0,
39
28
  isCartOpen: false,
40
29
  setIsCartOpen: () => { },
41
30
  isCartLoading: false,
42
- isCartHydrated: true,
43
- isCartRefreshing: false,
44
- refreshCart: async () => { },
45
- handleInventoryHoldExpired: () => { },
46
31
  buyNowItem: null,
47
32
  setBuyNowItem: () => { },
48
33
  clearBuyNowItem: () => { },
@@ -116,34 +101,14 @@ export function StoreProvider({ children, storeSlug, initialConfig }) {
116
101
  // Wishlist State
117
102
  const [wishlist, setWishlist] = useState([]);
118
103
  const [isWishlistLoading, setIsWishlistLoading] = useState(false);
119
- const lastSyncedInitialConfigRef = useRef(null);
120
- // Track Store_viewed once per store per session (not on every re-render/config update)
121
- const trackedStoreViewId = useRef(null);
122
- useEffect(() => {
123
- if (!store?.id || trackedStoreViewId.current === store.id)
124
- return;
125
- trackedStoreViewId.current = store.id;
126
- trackStorefrontEvent('Store_viewed', {
127
- storeId: store.id,
128
- storeSlug: store.slug,
129
- storeName: store.name,
130
- layout: store.layout,
131
- customerId: isAuthenticated ? (user?.id || null) : null,
132
- });
133
- }, [store?.id, store?.slug, store?.name, store?.layout, isAuthenticated, user?.id]);
134
104
  useEffect(() => {
135
105
  if (initialConfig) {
136
- // Avoid setStore on every parent re-render when the editor passes a new object reference
137
- // with identical data (reduces preview flicker / layout thrashing)
138
- const prev = lastSyncedInitialConfigRef.current;
139
- if (!prev || !isDeepEqual(prev, initialConfig)) {
140
- setStore(initialConfig);
141
- lastSyncedInitialConfigRef.current = initialConfig;
142
- }
106
+ // For live preview/editor, we want to update the store state immediately
107
+ // when initialConfig (which is actually the dynamic config from the editor) changes
108
+ setStore(initialConfig);
143
109
  setIsLoading(false);
144
110
  return;
145
111
  }
146
- lastSyncedInitialConfigRef.current = null;
147
112
  if (!storeSlug) {
148
113
  setIsLoading(false);
149
114
  return;
@@ -159,16 +124,15 @@ export function StoreProvider({ children, storeSlug, initialConfig }) {
159
124
  const baseSlug = getBaseStoreSlug(storeSlug);
160
125
  console.log('[StoreContext] Loading store from API (client-side):', baseSlug);
161
126
  const { store: apiStore } = await storeService.getStoreBySlug(baseSlug);
162
- const storeConfig = transformStoreResponseToConfig(apiStore);
163
127
  // Fetch categories, products, and services in parallel
164
128
  const [categoriesResult, productsResult, servicesResult] = await Promise.allSettled([
165
129
  categoryService.getCategories(apiStore.id).then((apiCategories) => apiCategories.map(transformCategoryToStoreCategory)),
166
130
  productService
167
131
  .getProducts({
168
132
  storeId: apiStore.id,
169
- limit: 1000,
133
+ limit: 12,
170
134
  })
171
- .then((response) => response.data.map((product) => transformProductToStoreProduct(product))),
135
+ .then((response) => response.data.map(transformProductToStoreProduct)),
172
136
  serviceService
173
137
  .getServices(apiStore.id)
174
138
  .then((apiServices) => apiServices.map(transformServiceToStoreService)),
@@ -196,23 +160,57 @@ export function StoreProvider({ children, storeSlug, initialConfig }) {
196
160
  else {
197
161
  console.log(`[StoreContext] Fetched ${services.length} services`);
198
162
  }
199
- // Populate dynamic catalog data on the hydrated store config
200
- storeConfig.categories = categories;
201
- storeConfig.products = products;
202
- storeConfig.services = services;
203
- if (storeConfig.layout.startsWith('food')) {
204
- storeConfig.menuItems = products.map((product) => ({
205
- id: product.id,
206
- name: product.name,
207
- description: richFieldPlainTextForDisplay(product.description),
208
- price: product.price,
209
- image: product.images[0],
210
- categoryId: product.categoryId,
211
- inStock: product.inStock,
212
- dietaryInfo: product.specifications?.dietaryInfo || [],
213
- customizable: !!product.variants?.length,
214
- }));
163
+ // Build contactInfo from various sources
164
+ let contactInfo = apiStore.contactInfo || {
165
+ email: apiStore.contactEmail,
166
+ phone: apiStore.contactPhone,
167
+ address: apiStore.address,
168
+ };
169
+ // If contactInfo exists but doesn't have an address, merge Store's address if available
170
+ if (contactInfo && !contactInfo.address && apiStore.address) {
171
+ contactInfo = {
172
+ ...contactInfo,
173
+ address: apiStore.address,
174
+ };
215
175
  }
176
+ // Transform API response to StoreConfig format
177
+ const storeConfig = {
178
+ id: apiStore.id,
179
+ slug: apiStore.slug,
180
+ name: apiStore.name,
181
+ description: apiStore.description || '',
182
+ type: 'generic',
183
+ layout: 'generic',
184
+ branding: {
185
+ primaryColor: apiStore.branding?.primaryColor || '#000000',
186
+ secondaryColor: apiStore.branding?.secondaryColor,
187
+ accentColor: apiStore.branding?.secondaryColor || apiStore.branding?.primaryColor || '#000000',
188
+ logo: apiStore.branding?.logo || apiStore.logo, // Check branding.logo first, then root logo
189
+ },
190
+ navigation: {
191
+ main: [],
192
+ footer: [],
193
+ },
194
+ features: {
195
+ cart: true,
196
+ wishlist: true,
197
+ reviews: true,
198
+ search: true,
199
+ filters: true,
200
+ booking: false,
201
+ delivery: true,
202
+ },
203
+ products,
204
+ categories,
205
+ services,
206
+ settings: {
207
+ currency: apiStore.settings?.currency || 'USD',
208
+ taxRate: apiStore.settings?.taxRate, // Deprecated: kept for backward compatibility
209
+ vat: apiStore.settings?.vat,
210
+ serviceCharge: apiStore.settings?.serviceCharge,
211
+ },
212
+ contactInfo: (contactInfo.email || contactInfo.phone || contactInfo.address) ? contactInfo : undefined,
213
+ };
216
214
  setStore(storeConfig);
217
215
  }
218
216
  else {
@@ -288,23 +286,12 @@ export function StoreProvider({ children, storeSlug, initialConfig }) {
288
286
  localStorage.setItem(`cart_${storeSlug}`, JSON.stringify(cart));
289
287
  localStorage.setItem(`wishlist_${storeSlug}`, JSON.stringify(wishlist));
290
288
  }, [cart, wishlist, storeSlug, store]);
291
- const addToCart = useCallback(async (product, quantity = 1, variantIdOrOptions) => {
292
- const { variantId, variantName, unitPrice } = normalizeAddToCartOptions(variantIdOrOptions);
293
- const matchingVariant = variantId ? product.variants?.find(v => v.id === variantId) : undefined;
294
- const resolvedVariantName = variantName ?? matchingVariant?.name ?? matchingVariant?.value;
295
- const resolvedUnitPrice = unitPrice ?? matchingVariant?.price ?? product.price;
296
- const stock = getProductStockInfo(product);
297
- if (!stock.canPurchase) {
289
+ const addToCart = useCallback(async (product, quantity = 1, variantId) => {
290
+ // Validate product is in stock
291
+ if (!product.inStock) {
298
292
  console.warn('[StoreContext] Attempted to add out-of-stock product to cart:', product.id);
299
- throw new Error(formatStockLimitMessage(product.name, stock.availableStock ?? 0));
300
- }
301
- if (product.trackInventory !== false && stock.availableStock != null) {
302
- const cartItemId = variantId ? `${product.id}-${variantId}` : product.id;
303
- const existingItem = cart.find((item) => item.id === cartItemId || (item.productId === product.id && item.variantId === variantId));
304
- const requestedQty = (existingItem?.quantity || 0) + quantity;
305
- if (requestedQty > stock.availableStock) {
306
- throw new Error(formatStockLimitMessage(product.name, stock.availableStock, requestedQty));
307
- }
293
+ // Note: Error message should be shown by the calling component
294
+ throw new Error('This product is currently out of stock');
308
295
  }
309
296
  setIsCartLoading(true);
310
297
  try {
@@ -322,14 +309,13 @@ export function StoreProvider({ children, storeSlug, initialConfig }) {
322
309
  productId: product.id,
323
310
  quantity,
324
311
  variantId,
325
- variantName: resolvedVariantName,
326
- price: resolvedUnitPrice,
327
- product: buildCartLineProduct(product, matchingVariant),
312
+ price: product.price,
313
+ product
328
314
  }];
329
315
  });
330
- setIsCartOpen(true);
316
+ // Track add to cart event
331
317
  if (store?.id) {
332
- analyticsService.trackCommerceEvent({
318
+ analyticsService.trackEvent({
333
319
  storeId: store.id,
334
320
  eventType: 'add_to_cart',
335
321
  userId: isAuthenticated ? (user?.id || null) : null,
@@ -338,27 +324,16 @@ export function StoreProvider({ children, storeSlug, initialConfig }) {
338
324
  productName: product.name,
339
325
  categoryId: product.categoryId,
340
326
  quantity,
341
- price: resolvedUnitPrice,
327
+ price: product.price,
342
328
  variantId,
343
329
  },
344
- }, `add_to_cart:${product.id}:${variantId || 'default'}`);
345
- trackStorefrontEvent('Product_added_to_cart', {
346
- storeId: store.id,
347
- storeSlug: store.slug,
348
- productId: product.id,
349
- productName: product.name,
350
- categoryId: product.categoryId,
351
- quantity,
352
- price: product.price,
353
- variantId,
354
- customerId: isAuthenticated ? (user?.id || null) : null,
355
- });
330
+ }).catch(err => console.warn('Failed to track add to cart:', err));
356
331
  }
357
332
  }
358
333
  finally {
359
334
  setIsCartLoading(false);
360
335
  }
361
- }, [store?.id, store?.slug, isAuthenticated, user?.id]);
336
+ }, [store?.id, isAuthenticated, user?.id]);
362
337
  const removeFromCart = useCallback(async (cartItemId) => {
363
338
  setIsCartLoading(true);
364
339
  try {
@@ -366,8 +341,9 @@ export function StoreProvider({ children, storeSlug, initialConfig }) {
366
341
  const removedItem = cart.find(item => item.id === cartItemId);
367
342
  // Use local storage only (cartService removed)
368
343
  setCart(prev => prev.filter(item => item.id !== cartItemId));
344
+ // Track remove_from_cart event
369
345
  if (removedItem && store?.id) {
370
- analyticsService.trackCommerceEvent({
346
+ analyticsService.trackEvent({
371
347
  storeId: store.id,
372
348
  eventType: 'remove_from_cart',
373
349
  userId: isAuthenticated ? (user?.id || null) : null,
@@ -378,7 +354,7 @@ export function StoreProvider({ children, storeSlug, initialConfig }) {
378
354
  price: removedItem.price,
379
355
  variantId: removedItem.variantId,
380
356
  },
381
- }, `remove_from_cart:${removedItem.productId}:${removedItem.variantId || 'default'}`);
357
+ }).catch(err => console.warn('Failed to track remove_from_cart:', err));
382
358
  }
383
359
  }
384
360
  finally {
@@ -416,13 +392,17 @@ export function StoreProvider({ children, storeSlug, initialConfig }) {
416
392
  }
417
393
  return updated;
418
394
  });
395
+ // Track wishlist events
419
396
  if (store?.id) {
420
- analyticsService.trackCommerceEvent({
397
+ analyticsService.trackEvent({
421
398
  storeId: store.id,
422
399
  eventType: wasInWishlist ? 'wishlist_remove' : 'wishlist_add',
423
400
  userId: isAuthenticated ? (user?.id || null) : null,
424
- metadata: { productId, productName },
425
- }, `wishlist:${productId}`);
401
+ metadata: {
402
+ productId,
403
+ productName,
404
+ },
405
+ }).catch(err => console.warn('Failed to track wishlist event:', err));
426
406
  }
427
407
  }
428
408
  catch (error) {
@@ -449,8 +429,6 @@ export function StoreProvider({ children, storeSlug, initialConfig }) {
449
429
  isCartOpen,
450
430
  setIsCartOpen,
451
431
  isCartLoading,
452
- isCartHydrated: true,
453
- refreshCart: async () => { },
454
432
  buyNowItem,
455
433
  setBuyNowItem,
456
434
  clearBuyNowItem,
@@ -1,5 +1,4 @@
1
- import type { PayazaRichTextStored } from './rich-html';
2
- export type StoreLayoutType = 'food' | 'food-modern' | 'clothing' | 'clothing-minimal' | 'booking' | 'booking-agenda' | 'electronics' | 'electronics-grid' | 'motivational-speaker' | 'marketplace';
1
+ export type StoreLayoutType = 'food' | 'food-modern' | 'clothing' | 'clothing-minimal' | 'booking' | 'booking-agenda' | 'electronics' | 'electronics-grid' | 'motivational-speaker';
3
2
  export interface StoreBranding {
4
3
  primaryColor: string;
5
4
  secondaryColor?: string;
@@ -42,7 +41,7 @@ export interface StoreCategory {
42
41
  id: string;
43
42
  name: string;
44
43
  slug: string;
45
- description?: string | PayazaRichTextStored;
44
+ description?: string;
46
45
  image?: string;
47
46
  parentId?: string;
48
47
  children?: StoreCategory[];
@@ -64,32 +63,22 @@ export interface StoreProduct {
64
63
  id: string;
65
64
  name: string;
66
65
  slug: string;
67
- description: string | PayazaRichTextStored;
66
+ description: string;
68
67
  price: number;
69
68
  compareAtPrice?: number;
70
- isLimitedTimeOffer?: boolean;
71
- limitedTimeOfferEndsAt?: string | null;
72
69
  images: string[];
73
70
  categoryId: string;
74
71
  category?: string;
72
+ brand?: string;
75
73
  inStock: boolean;
76
- trackInventory?: boolean;
77
- availableStock?: number;
78
- lowStockThreshold?: number;
79
74
  sku?: string;
80
75
  currency?: string;
81
76
  variants?: Array<{
82
77
  id: string;
83
- name?: string;
84
- value?: string;
85
- attributes?: Record<string, string>;
78
+ name: string;
79
+ value: string;
86
80
  price?: number;
87
- compareAtPrice?: number;
88
81
  sku?: string;
89
- stock?: number;
90
- inStock?: boolean;
91
- isActive?: boolean;
92
- images?: string[];
93
82
  }>;
94
83
  specifications?: Record<string, string>;
95
84
  rating?: number;
@@ -102,7 +91,7 @@ export interface StoreService {
102
91
  id: string;
103
92
  name: string;
104
93
  slug: string;
105
- description: string | PayazaRichTextStored;
94
+ description: string;
106
95
  price: number;
107
96
  currency?: string;
108
97
  duration: number;
@@ -169,8 +158,6 @@ export interface TestimonialItem {
169
158
  rating: number;
170
159
  image?: string;
171
160
  order: number;
172
- location?: string;
173
- date?: string;
174
161
  }
175
162
  export interface StorySection {
176
163
  show: boolean;
@@ -211,14 +198,14 @@ export interface StoreConfig {
211
198
  slug: string;
212
199
  name: string;
213
200
  description: string;
214
- /** When false, customer checkout and booking payments are disabled (merchant not verified). */
215
- checkoutEnabled?: boolean;
216
201
  type: StoreLayoutType;
217
202
  layout: StoreLayoutType;
218
203
  branding: StoreBranding;
219
204
  navigation: StoreNavigation;
220
205
  categories: StoreCategory[];
221
206
  products?: StoreProduct[];
207
+ /** Total active catalog size from bootstrap productsMeta (may exceed products.length). */
208
+ productsTotal?: number;
222
209
  services?: StoreService[];
223
210
  menuItems?: StoreMenuItem[];
224
211
  domain?: StoreDomain;
@@ -245,7 +232,6 @@ export interface StoreConfig {
245
232
  };
246
233
  settings: {
247
234
  currency: string;
248
- industry?: string;
249
235
  taxRate?: number;
250
236
  shippingEnabled?: boolean;
251
237
  minOrderAmount?: number;
@@ -261,8 +247,6 @@ export interface StoreConfig {
261
247
  enabled: boolean;
262
248
  applyTo: 'pos' | 'online' | 'both';
263
249
  };
264
- /** Who pays Shopaza collection fees at checkout: customer (added to total) or merchant (deducted at settlement). */
265
- collectionFeePayer?: 'customer' | 'merchant';
266
250
  };
267
251
  payment?: {
268
252
  payazaPublicKey?: string;
@@ -358,25 +342,12 @@ export interface StoreLayoutConfig {
358
342
  showBadges?: boolean;
359
343
  sliders?: HeroSlider[];
360
344
  badge?: string;
361
- hero_badge?: string;
362
345
  title?: string;
363
346
  titleHighlight?: string;
364
347
  subtitle?: string;
365
348
  description?: string;
366
349
  primaryCTA?: string;
367
350
  secondaryCTA?: string;
368
- primaryButton?: {
369
- text?: string;
370
- link?: string;
371
- };
372
- secondaryButton?: {
373
- text?: string;
374
- link?: string;
375
- };
376
- showTrustIndicators?: boolean;
377
- deliveryTime?: string;
378
- ratingText?: string;
379
- ratingIcon?: string;
380
351
  };
381
352
  categories?: {
382
353
  show: boolean;
@@ -473,20 +444,15 @@ export interface StoreLayoutConfig {
473
444
  description?: string;
474
445
  items?: string[];
475
446
  };
476
- showDiscountBadge?: boolean;
477
- discountSuffix?: string;
478
447
  };
479
448
  testimonials?: {
480
449
  show: boolean;
481
450
  title?: string;
482
451
  subtitle?: string;
483
452
  items?: TestimonialItem[];
484
- showRatings?: boolean;
485
- limit?: number;
486
453
  quote?: string;
487
454
  author?: string;
488
455
  role?: string;
489
- maxItems?: number;
490
456
  };
491
457
  story?: StorySection;
492
458
  promoBanner?: PromoBannerSection;
@@ -520,14 +486,6 @@ export interface StoreLayoutConfig {
520
486
  viewAllLabel?: string;
521
487
  memberName?: string;
522
488
  memberRole?: string;
523
- memberRating?: string;
524
- memberReviewCount?: string;
525
- ratingIcon?: string;
526
- specialist_image?: string;
527
- features?: Array<{
528
- text: string;
529
- icon?: string;
530
- }>;
531
489
  };
532
490
  services?: {
533
491
  show: boolean;
@@ -566,8 +524,6 @@ export interface StoreLayoutConfig {
566
524
  stat2Value?: string;
567
525
  buttonText?: string;
568
526
  buttonLink?: string;
569
- chefBadgeTitle?: string;
570
- chefBadgeSubtitle?: string;
571
527
  };
572
528
  trust?: {
573
529
  show: boolean;
@@ -599,8 +555,6 @@ export interface StoreLayoutConfig {
599
555
  }>;
600
556
  hero?: any;
601
557
  story?: any;
602
- aboutHero?: any;
603
- ourStory?: any;
604
558
  stats?: any;
605
559
  'contact-info'?: any;
606
560
  values?: any;
@@ -608,7 +562,6 @@ export interface StoreLayoutConfig {
608
562
  aboutContent?: any;
609
563
  statsSection?: any;
610
564
  contactSection?: any;
611
- contactInfoSection?: any;
612
565
  };
613
566
  team?: {
614
567
  title?: string;
@@ -639,29 +592,6 @@ export interface StoreLayoutConfig {
639
592
  services?: {
640
593
  title?: string;
641
594
  description?: string;
642
- hero?: {
643
- title?: string;
644
- description?: string;
645
- backgroundImage?: string;
646
- show?: boolean;
647
- [key: string]: any;
648
- };
649
- servicesHeader?: {
650
- title?: string;
651
- showFilters?: boolean;
652
- showSearch?: boolean;
653
- backgroundImage?: string;
654
- [key: string]: any;
655
- };
656
- servicesGrid?: {
657
- showPagination?: boolean;
658
- showBookButton?: boolean;
659
- [key: string]: any;
660
- };
661
- 'services-list'?: {
662
- show?: boolean;
663
- [key: string]: any;
664
- };
665
595
  };
666
596
  faq?: {
667
597
  title?: string;
@@ -677,12 +607,9 @@ export interface StoreLayoutConfig {
677
607
  categories?: {
678
608
  categoriesHeader?: any;
679
609
  categoryGrid?: any;
680
- categoriesGrid?: any;
681
610
  };
682
611
  categoryDetail?: {
683
612
  categoryDetail?: any;
684
- categoryHeader?: any;
685
- productGrid?: any;
686
613
  showServices?: boolean;
687
614
  showProducts?: boolean;
688
615
  showBanner?: boolean;
@@ -691,7 +618,6 @@ export interface StoreLayoutConfig {
691
618
  };
692
619
  productDetail?: {
693
620
  productDetail?: any;
694
- menuItemInfo?: any;
695
621
  showSizeGuide?: boolean;
696
622
  showAddToCart?: boolean;
697
623
  showWishlist?: boolean;
@@ -704,18 +630,12 @@ export interface StoreLayoutConfig {
704
630
  contactForm?: any;
705
631
  hero?: any;
706
632
  form?: any;
707
- reservationForm?: any;
708
633
  backgroundImage?: string;
709
634
  title?: string;
710
635
  subtitle?: string;
711
636
  infoTitle?: string;
712
637
  infoDescription?: string;
713
638
  };
714
- book?: {
715
- bookingHeader?: any;
716
- bookingForm?: any;
717
- };
718
- serviceDetail?: any;
719
639
  menu?: {
720
640
  menuHeader?: any;
721
641
  menuGrid?: any;
@@ -915,7 +835,5 @@ export interface StoreLayoutConfig {
915
835
  assignedText?: Record<string, string>;
916
836
  assignedAssets?: Record<string, string>;
917
837
  assetRequirements?: any;
918
- /** Inline section styles keyed by `${pageId}::${sectionKey}` — Payaza Styles inspector. */
919
- payazaSectionStyles?: Record<string, Record<string, string>>;
920
838
  }
921
839
  //# sourceMappingURL=store-types.d.ts.map