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,27 +1,30 @@
1
1
  'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { Button } from '../../../components/ui/button.js';
4
- import { ImageWithFallback } from '../../../components/ui/image-with-fallback.js';
5
- import { useStore } from '../../../lib/store-context.js';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useCategoryProducts } from '../../../hooks/use-category-products';
4
+ import { Button } from '../../../components/ui/button';
5
+ import { ImageWithFallback } from '../../../components/ui/image-with-fallback';
6
+ import { useStore } from '../../../lib/store-context';
6
7
  import { ArrowLeft, Filter } from 'lucide-react';
7
8
  import Link from 'next/link';
8
- import { useToast } from '../../../components/ui/toast.js';
9
- import { useAnalytics } from '../../../hooks/use-analytics.js';
10
- import { useEffect, useMemo } from 'react';
11
- import { formatCurrency, isEditorPreviewMode, resolveCategoryBySlugForDisplay, resolveMenuItemsForDisplay } from '../../../lib/utils/index.js';
12
- import { useCatalogLoader } from '../../../hooks/use-catalog-loader.js';
13
- import { CategoryDescription } from '../../../components/rich-text/CategoryDescription.js';
14
- import { RichTextExcerpt } from '../../../components/rich-text/RichTextExcerpt.js';
15
- export function FoodModernCategoryPage({ storeConfig: initialConfig, categorySlug }) {
9
+ import { useToast } from '../../../components/ui/toast';
10
+ import { useAnalytics } from '../../../hooks/use-analytics';
11
+ import { useEffect } from 'react';
12
+ import { formatCurrency } from '../../../lib/utils';
13
+ export function CategoryPage({ storeConfig: initialConfig, categorySlug }) {
16
14
  const { store, addToCart } = useStore();
17
15
  const storeConfig = store || initialConfig;
18
- const isPreview = isEditorPreviewMode(storeConfig);
19
- const { categories: loadedCategories, products: loadedProducts, menuItems: loadedMenuItems } = useCatalogLoader(storeConfig, { fetchServices: false });
20
- const category = resolveCategoryBySlugForDisplay(loadedCategories, categorySlug, isPreview);
21
- const menuItems = useMemo(() => {
22
- const allItems = resolveMenuItemsForDisplay(loadedMenuItems, loadedProducts, isPreview);
23
- return allItems.filter(item => item.categoryId === category?.id);
24
- }, [loadedMenuItems, loadedProducts, isPreview, category?.id]);
16
+ const categories = storeConfig.categories || [];
17
+ const category = categories.find(c => c.slug === categorySlug);
18
+ const { products, isLoading, hasMore, loadMore } = useCategoryProducts(storeConfig.id, category?.id);
19
+ const menuItems = products.map((product) => ({
20
+ id: product.id,
21
+ name: product.name,
22
+ description: product.description || '',
23
+ price: product.price,
24
+ image: product.images[0],
25
+ categoryId: product.categoryId,
26
+ inStock: product.inStock,
27
+ }));
25
28
  const { addToast } = useToast();
26
29
  const { trackEvent } = useAnalytics();
27
30
  // Track category view
@@ -60,5 +63,5 @@ export function FoodModernCategoryPage({ storeConfig: initialConfig, categorySlu
60
63
  const isDarkTheme = storeConfig.type === 'food-modern' || storeConfig.branding.theme === 'dark';
61
64
  const bgColor = isDarkTheme ? 'bg-[#0F0F0F]' : 'bg-gray-50';
62
65
  const textColor = isDarkTheme ? 'text-white' : 'text-gray-900';
63
- return (_jsxs("div", { className: `min-h-screen ${bgColor} ${textColor} transition-colors duration-300`, children: [_jsxs("div", { "data-section": "categoryDetail", "data-payaza-section-key": "categoryDetail", "data-payaza-page": "categoryDetail", className: "relative h-[40vh] overflow-hidden", children: [_jsx(ImageWithFallback, { src: category.image, alt: category.name, className: "w-full h-full object-cover", skeletonAspectRatio: "16/9" }), _jsx("div", { className: `absolute inset-0 ${isDarkTheme ? 'bg-black/60' : 'bg-black/40'} backdrop-blur-[2px]` }), _jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-center text-center p-6 text-white", children: [_jsx("h1", { className: "text-5xl md:text-7xl font-bold tracking-tight mb-4", children: category.name }), _jsx(CategoryDescription, { description: category.description })] })] }), _jsxs("div", { className: "container mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 py-12", children: [_jsxs("div", { className: "flex flex-col md:flex-row justify-between items-center mb-10 gap-4", children: [_jsxs(Link, { href: `/${storeConfig.slug}/categories`, className: `inline-flex items-center text-sm font-medium ${isDarkTheme ? 'text-gray-400 hover:text-white' : 'text-gray-600 hover:text-gray-900'}`, children: [_jsx(ArrowLeft, { className: "h-4 w-4 mr-2" }), "Back to All Categories"] }), _jsx("div", { className: "flex items-center gap-4", children: _jsxs(Button, { variant: "outline", className: `${isDarkTheme ? 'border-white/20 text-white hover:bg-white/10' : 'bg-white'}`, children: [_jsx(Filter, { className: "h-4 w-4 mr-2" }), " Filter"] }) })] }), !hasItems ? (_jsxs("div", { className: "text-center py-20 border border-dashed border-gray-300 rounded-3xl", children: [_jsx("p", { className: "text-gray-500 text-lg", children: "No items found in this category." }), _jsx(Button, { className: "mt-4", onClick: () => window.history.back(), children: "Go Back" })] })) : (_jsx("div", { className: "space-y-12", children: _jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-8", children: menuItems.map((item) => (_jsxs("div", { className: "group bg-[#1A1A1A] rounded-none overflow-hidden border border-white/5 hover:border-orange-500/50 transition-all duration-500 flex flex-col h-full", children: [_jsxs("div", { className: "relative aspect-square overflow-hidden grayscale hover:grayscale-0 transition-all duration-700", children: [_jsx(ImageWithFallback, { src: item.image, alt: item.name, className: "w-full h-full object-cover transition-transform duration-700 group-hover:scale-110", skeletonAspectRatio: "square" }), _jsx("div", { className: "absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-center justify-center", children: _jsx(Button, { className: "rounded-none bg-white text-black hover:bg-orange-600 hover:text-white transform translate-y-4 group-hover:translate-y-0 transition-all duration-300 shadow-lg font-bold px-8 uppercase tracking-widest text-xs", onClick: () => handleAddToCart(item), children: "Order Now" }) })] }), _jsxs("div", { className: "p-8 flex flex-col flex-1 text-center", children: [_jsx("h3", { className: "font-bold text-xl text-white uppercase tracking-tight mb-2 group-hover:text-orange-500 transition-colors", children: item.name }), _jsx(RichTextExcerpt, { value: item.description, as: "p", className: "text-gray-500 text-sm mb-6 line-clamp-2 leading-relaxed flex-1 font-light italic" }), _jsx("span", { className: "text-2xl font-serif text-white", children: formatCurrency(item.price, storeConfig.settings?.currency || 'USD') })] })] }, item.id))) }) }))] })] }));
66
+ return (_jsxs("div", { className: `min-h-screen ${bgColor} ${textColor} transition-colors duration-300`, children: [_jsxs("div", { className: "relative h-[40vh] overflow-hidden", children: [_jsx(ImageWithFallback, { src: category.image, alt: category.name, className: "w-full h-full object-cover", skeletonAspectRatio: "16/9" }), _jsx("div", { className: `absolute inset-0 ${isDarkTheme ? 'bg-black/60' : 'bg-black/40'} backdrop-blur-[2px]` }), _jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-center text-center p-6 text-white", children: [_jsx("h1", { className: "text-5xl md:text-7xl font-bold tracking-tight mb-4", children: category.name }), category.description && (_jsx("p", { className: "text-lg md:text-xl max-w-2xl opacity-90 font-light", children: category.description }))] })] }), _jsxs("div", { className: "container mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 py-12", children: [_jsxs("div", { className: "flex flex-col md:flex-row justify-between items-center mb-10 gap-4", children: [_jsxs(Link, { href: `/${storeConfig.slug}/categories`, className: `inline-flex items-center text-sm font-medium ${isDarkTheme ? 'text-gray-400 hover:text-white' : 'text-gray-600 hover:text-gray-900'}`, children: [_jsx(ArrowLeft, { className: "h-4 w-4 mr-2" }), "Back to All Categories"] }), _jsx("div", { className: "flex items-center gap-4", children: _jsxs(Button, { variant: "outline", className: `${isDarkTheme ? 'border-white/20 text-white hover:bg-white/10' : 'bg-white'}`, children: [_jsx(Filter, { className: "h-4 w-4 mr-2" }), " Filter"] }) })] }), !hasItems && !isLoading ? (_jsxs("div", { className: "text-center py-20 border border-dashed border-gray-300 rounded-3xl", children: [_jsx("p", { className: "text-gray-500 text-lg", children: "No items found in this category." }), _jsx(Button, { className: "mt-4", onClick: () => window.history.back(), children: "Go Back" })] })) : (_jsxs(_Fragment, { children: [_jsx("div", { className: "space-y-12", children: _jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-8", children: menuItems.map((item) => (_jsxs("div", { className: "group bg-[#1A1A1A] rounded-none overflow-hidden border border-white/5 hover:border-orange-500/50 transition-all duration-500 flex flex-col h-full", children: [_jsxs("div", { className: "relative aspect-square overflow-hidden grayscale hover:grayscale-0 transition-all duration-700", children: [_jsx(ImageWithFallback, { src: item.image, alt: item.name, className: "w-full h-full object-cover transition-transform duration-700 group-hover:scale-110", skeletonAspectRatio: "square" }), _jsx("div", { className: "absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-center justify-center", children: _jsx(Button, { className: "rounded-none bg-white text-black hover:bg-orange-600 hover:text-white transform translate-y-4 group-hover:translate-y-0 transition-all duration-300 shadow-lg font-bold px-8 uppercase tracking-widest text-xs", onClick: () => handleAddToCart(item), children: "Order Now" }) })] }), _jsxs("div", { className: "p-8 flex flex-col flex-1 text-center", children: [_jsx("h3", { className: "font-bold text-xl text-white uppercase tracking-tight mb-2 group-hover:text-orange-500 transition-colors", children: item.name }), _jsx("p", { className: "text-gray-500 text-sm mb-6 line-clamp-2 leading-relaxed flex-1 font-light italic", children: item.description }), _jsx("span", { className: "text-2xl font-serif text-white", children: formatCurrency(item.price, storeConfig.settings?.currency || 'USD') })] })] }, item.id))) }) }), hasMore && (_jsx("div", { className: "mt-10 flex justify-center", children: _jsx(Button, { onClick: loadMore, disabled: isLoading, children: "Load more" }) }))] }))] })] }));
64
67
  }
@@ -2,6 +2,6 @@ import { StoreConfig } from '../../../lib/store-types';
2
2
  interface ContactPageProps {
3
3
  storeConfig: StoreConfig;
4
4
  }
5
- export declare function FoodModernContactPage({ storeConfig: initialConfig }: ContactPageProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function ContactPage({ storeConfig: initialConfig }: ContactPageProps): import("react/jsx-runtime").JSX.Element;
6
6
  export {};
7
7
  //# sourceMappingURL=ContactPage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContactPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food-modern/pages/ContactPage.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAQhD,UAAU,gBAAgB;IACtB,WAAW,EAAE,WAAW,CAAC;CAC5B;AAED,wBAAgB,qBAAqB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,gBAAgB,2CAwUrF"}
1
+ {"version":3,"file":"ContactPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food-modern/pages/ContactPage.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAOhD,UAAU,gBAAgB;IACtB,WAAW,EAAE,WAAW,CAAC;CAC5B;AAED,wBAAgB,WAAW,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,gBAAgB,2CA6T3E"}
@@ -1,13 +1,12 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { useState } from 'react';
4
- import { Button } from '../../../components/ui/button.js';
4
+ import { Button } from '../../../components/ui/button';
5
5
  import { Mail, Phone, MapPin, Clock, Send, MessageSquare, CheckCircle } from 'lucide-react';
6
- import { useStore } from '../../../lib/store-context.js';
6
+ import { useStore } from '../../../lib/store-context';
7
7
  import Image from 'next/image';
8
- import { submitContact } from '../../../lib/services/contact.service.js';
9
- import { payazaInlineBindingProps, encodePayazaFieldKey } from '../../../preview/canvas/field-key.js';
10
- export function FoodModernContactPage({ storeConfig: initialConfig }) {
8
+ import { submitContact } from '../../../lib/services/contact.service';
9
+ export function ContactPage({ storeConfig: initialConfig }) {
11
10
  const { store } = useStore();
12
11
  const storeConfig = store || initialConfig;
13
12
  // We use CSS variables for theming to inherit from parent layout
@@ -16,7 +15,6 @@ export function FoodModernContactPage({ storeConfig: initialConfig }) {
16
15
  const [formState, setFormState] = useState('idle');
17
16
  const [errorMessage, setErrorMessage] = useState(null);
18
17
  const contactConfig = storeConfig.layoutConfig?.pages?.contact;
19
- const isPreview = !!storeConfig.isPreview;
20
18
  const handleSubmit = async (e) => {
21
19
  e.preventDefault();
22
20
  setErrorMessage(null);
@@ -51,5 +49,5 @@ export function FoodModernContactPage({ storeConfig: initialConfig }) {
51
49
  setErrorMessage('Failed to send message. Please try again.');
52
50
  }
53
51
  };
54
- return (_jsxs("div", { className: "min-h-screen bg-white pb-20", children: [_jsxs("section", { "data-section": "contactHeader", "data-payaza-section-key": "contactHeader", "data-payaza-page": "contact", className: "relative bg-gray-900 text-white py-20 overflow-hidden", children: [_jsxs("div", { className: "absolute inset-0 opacity-20", "data-payaza-image": isPreview ? encodePayazaFieldKey('contactHeader', ['backgroundImage']) : undefined, children: [_jsx(Image, { src: contactConfig?.contactHeader?.backgroundImage || "https://images.unsplash.com/photo-1596524430615-b46475ddff6e?q=80&w=2070&auto=format&fit=crop", alt: "Contact Background", fill: true, className: "w-full h-full object-cover", unoptimized: true }), _jsx("div", { className: "absolute inset-0 bg-black/60" })] }), _jsxs("div", { className: "container mx-auto px-4 relative z-10 text-center", children: [_jsx("h1", { className: "text-4xl md:text-6xl font-bold mb-4 tracking-tight", ...payazaInlineBindingProps(isPreview, 'contactHeader', ['title']), children: contactConfig?.contactHeader?.title || "Get in Touch" }), _jsx("p", { className: "text-xl text-gray-300 max-w-2xl mx-auto font-light", ...payazaInlineBindingProps(isPreview, 'contactHeader', ['subtitle'], { rich: 'inline' }), children: contactConfig?.contactHeader?.subtitle || "We'd love to hear from you. Here's how you can reach us." })] })] }), _jsx("div", { "data-section": "contactForm", "data-payaza-section-key": "contactForm", "data-payaza-page": "contact", className: "container mx-auto px-4 -mt-10 relative z-20 max-w-6xl", children: _jsxs("div", { className: "bg-white rounded-3xl shadow-xl overflow-hidden border border-gray-100 flex flex-col lg:flex-row", children: [_jsxs("div", { className: "lg:w-2/5 p-8 md:p-12 text-white relative overflow-hidden", style: { backgroundColor: 'var(--store-primary)' }, children: [_jsx("div", { className: "absolute top-0 right-0 -mt-10 -mr-10 w-40 h-40 bg-white opacity-10 rounded-full blur-2xl" }), _jsx("div", { className: "absolute bottom-0 left-0 -mb-10 -ml-10 w-40 h-40 bg-black opacity-10 rounded-full blur-2xl" }), _jsx("h2", { className: "text-2xl font-bold mb-8 relative z-10", children: contactConfig?.contactForm?.infoTitle || "Contact Information" }), _jsx("p", { className: "mb-10 text-white/90 leading-relaxed relative z-10", children: contactConfig?.contactForm?.infoDescription || "Fill out the form and our team will get back to you within 24 hours." }), _jsxs("div", { className: "space-y-8 relative z-10", children: [_jsxs("div", { className: "flex items-start gap-4", children: [_jsx("div", { className: "w-10 h-10 rounded-full bg-white/20 flex items-center justify-center flex-shrink-0", children: _jsx(Phone, { className: "w-5 h-5 text-white" }) }), _jsxs("div", { children: [_jsx("h3", { className: "font-semibold text-white mb-1", children: "Call Us" }), _jsx("p", { className: "text-white/80", children: storeConfig.contactInfo?.phone || '+1 (555) 123-4567' })] })] }), _jsxs("div", { className: "flex items-start gap-4", children: [_jsx("div", { className: "w-10 h-10 rounded-full bg-white/20 flex items-center justify-center flex-shrink-0", children: _jsx(Mail, { className: "w-5 h-5 text-white" }) }), _jsxs("div", { children: [_jsx("h3", { className: "font-semibold text-white mb-1", children: "Email Us" }), _jsx("p", { className: "text-white/80", children: storeConfig.contactInfo?.email || `hello@${storeConfig.slug}.com` })] })] }), _jsxs("div", { className: "flex items-start gap-4", children: [_jsx("div", { className: "w-10 h-10 rounded-full bg-white/20 flex items-center justify-center flex-shrink-0", children: _jsx(MapPin, { className: "w-5 h-5 text-white" }) }), _jsxs("div", { children: [_jsx("h3", { className: "font-semibold text-white mb-1", children: "Visit Us" }), _jsxs("p", { className: "text-white/80", children: [storeConfig.contactInfo?.address?.street || '123 Commerce Blvd', ",", _jsx("br", {}), storeConfig.contactInfo?.address?.city || 'Business City', ", ", storeConfig.contactInfo?.address?.state || 'ST', " ", storeConfig.contactInfo?.address?.zipCode || '12345'] })] })] }), _jsxs("div", { className: "flex items-start gap-4", children: [_jsx("div", { className: "w-10 h-10 rounded-full bg-white/20 flex items-center justify-center flex-shrink-0", children: _jsx(Clock, { className: "w-5 h-5 text-white" }) }), _jsxs("div", { children: [_jsx("h3", { className: "font-semibold text-white mb-1", children: "Opening Hours" }), _jsx("p", { className: "text-white/80", children: storeConfig.locations?.[0]?.openingHours || 'Mon - Fri: 9am - 6pm' }), !storeConfig.locations?.[0]?.openingHours && _jsx("p", { className: "text-white/80", children: "Sat: 10am - 4pm" })] })] })] }), _jsx("div", { className: "mt-12 relative z-10", children: _jsxs("div", { className: "flex gap-4", children: [storeConfig.branding.socialMedia?.instagram && (_jsx("a", { href: storeConfig.branding.socialMedia.instagram, target: "_blank", rel: "noopener noreferrer", className: "w-10 h-10 rounded-full bg-white/20 hover:bg-white/30 flex items-center justify-center transition-colors", children: _jsx(Image, { src: "https://storefront-assets.s3.amazonaws.com/icons/instagram.svg", alt: "Instagram", width: 20, height: 20, className: "brightness-0 invert", unoptimized: true }) })), storeConfig.branding.socialMedia?.twitter && (_jsx("a", { href: storeConfig.branding.socialMedia.twitter, target: "_blank", rel: "noopener noreferrer", className: "w-10 h-10 rounded-full bg-white/20 hover:bg-white/30 flex items-center justify-center transition-colors", children: _jsx(Image, { src: "https://storefront-assets.s3.amazonaws.com/icons/twitter.svg", alt: "Twitter", width: 20, height: 20, className: "brightness-0 invert", unoptimized: true }) })), storeConfig.branding.socialMedia?.facebook && (_jsx("a", { href: storeConfig.branding.socialMedia.facebook, target: "_blank", rel: "noopener noreferrer", className: "w-10 h-10 rounded-full bg-white/20 hover:bg-white/30 flex items-center justify-center transition-colors", children: _jsx(Image, { src: "https://storefront-assets.s3.amazonaws.com/icons/facebook.svg", alt: "Facebook", width: 20, height: 20, className: "brightness-0 invert", unoptimized: true }) })), storeConfig.branding.socialMedia?.youtube && (_jsx("a", { href: storeConfig.branding.socialMedia.youtube, target: "_blank", rel: "noopener noreferrer", className: "w-10 h-10 rounded-full bg-white/20 hover:bg-white/30 flex items-center justify-center transition-colors", children: _jsx(Image, { src: "https://storefront-assets.s3.amazonaws.com/icons/youtube.svg", alt: "YouTube", width: 20, height: 20, className: "brightness-0 invert", unoptimized: true }) }))] }) })] }), _jsxs("div", { className: "lg:w-3/5 p-8 md:p-12 bg-white relative", children: [_jsx("div", { className: "absolute top-0 right-0 p-6 opacity-5", children: _jsx(MessageSquare, { className: "w-32 h-32" }) }), formState === 'success' ? (_jsxs("div", { className: "h-full flex flex-col items-center justify-center text-center py-10", children: [_jsx("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mb-6", children: _jsx(CheckCircle, { className: "w-10 h-10 text-green-600" }) }), _jsx("h3", { className: "text-2xl font-bold text-gray-900 mb-2", children: "Message Sent!" }), _jsx("p", { className: "text-gray-600 max-w-sm mx-auto mb-8", children: "Thank you for contacting us. We have received your message and will respond as soon as possible." }), _jsx(Button, { onClick: () => setFormState('idle'), className: "bg-gray-900 hover:bg-gray-800", children: "Send Another Message" })] })) : (_jsxs("form", { onSubmit: handleSubmit, className: "relative z-10 space-y-6", children: [errorMessage && (_jsx("p", { className: "text-sm text-red-600 bg-red-50 p-3 rounded-xl", children: errorMessage })), _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-6", children: contactConfig?.contactForm?.title || "Send us a Message" }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsxs("div", { className: "space-y-2", children: [_jsx("label", { htmlFor: "firstName", className: "text-sm font-medium text-gray-700", children: "First Name" }), _jsx("input", { type: "text", id: "firstName", required: true, className: "w-full px-4 py-3 rounded-xl bg-gray-50 border border-gray-200 focus:border-gray-900 focus:ring-0 outline-none transition-all", placeholder: "John" })] }), _jsxs("div", { className: "space-y-2", children: [_jsx("label", { htmlFor: "lastName", className: "text-sm font-medium text-gray-700", children: "Last Name" }), _jsx("input", { type: "text", id: "lastName", required: true, className: "w-full px-4 py-3 rounded-xl bg-gray-50 border border-gray-200 focus:border-gray-900 focus:ring-0 outline-none transition-all", placeholder: "Doe" })] })] }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsxs("div", { className: "space-y-2", children: [_jsx("label", { htmlFor: "email", className: "text-sm font-medium text-gray-700", children: "Email Address" }), _jsx("input", { type: "email", id: "email", required: true, className: "w-full px-4 py-3 rounded-xl bg-gray-50 border border-gray-200 focus:border-gray-900 focus:ring-0 outline-none transition-all", placeholder: "john@example.com" })] }), (contactConfig?.contactForm?.showPhone !== false) && (_jsxs("div", { className: "space-y-2", children: [_jsx("label", { htmlFor: "phone", className: "text-sm font-medium text-gray-700", children: "Phone (Optional)" }), _jsx("input", { type: "tel", id: "phone", className: "w-full px-4 py-3 rounded-xl bg-gray-50 border border-gray-200 focus:border-gray-900 focus:ring-0 outline-none transition-all", placeholder: "+1 (555) 000-0000" })] }))] }), (contactConfig?.contactForm?.showSubject !== false) && (_jsxs("div", { className: "space-y-2", children: [_jsx("label", { htmlFor: "subject", className: "text-sm font-medium text-gray-700", children: "Subject" }), _jsx("select", { id: "subject", className: "w-full px-4 py-3 rounded-xl bg-gray-50 border border-gray-200 focus:border-gray-900 focus:ring-0 outline-none transition-all", children: contactConfig?.contactForm?.subjects?.length > 0 ? (contactConfig.contactForm.subjects.map((s, i) => (_jsx("option", { value: s.value, children: s.label }, i)))) : (_jsxs(_Fragment, { children: [_jsx("option", { value: "general", children: "General Inquiry" }), _jsx("option", { value: "reservations", children: "Table Reservation" }), _jsx("option", { value: "catering", children: "Gourmet Catering" }), _jsx("option", { value: "feedback", children: "Experience Feedback" }), _jsx("option", { value: "press", children: "Media & Press" })] })) })] })), _jsxs("div", { className: "space-y-2", children: [_jsx("label", { htmlFor: "message", className: "text-sm font-medium text-gray-700", children: "Message" }), _jsx("textarea", { id: "message", rows: 4, required: true, className: "w-full px-4 py-3 rounded-xl bg-gray-50 border border-gray-200 focus:border-gray-900 focus:ring-0 outline-none transition-all resize-none", placeholder: "How can we help you today?" })] }), _jsx("div", { className: "pt-2", children: _jsx(Button, { type: "submit", disabled: formState === 'submitting', className: "w-full py-6 text-lg font-semibold rounded-xl", style: { backgroundColor: 'var(--store-primary)' }, children: formState === 'submitting' ? (_jsxs("span", { className: "flex items-center gap-2", children: [_jsx("span", { className: "w-4 h-4 border-2 border-white/20 border-t-white rounded-full animate-spin" }), "Sending..."] })) : (_jsxs("span", { className: "flex items-center gap-2", children: ["Send Message", _jsx(Send, { className: "w-4 h-4" })] })) }) })] }))] })] }) }), (contactConfig?.contactForm?.showMap !== false) && (_jsx("section", { "data-section": "contactForm", "data-payaza-section-key": "contactForm", "data-payaza-page": "contact", className: "container mx-auto px-4 mt-20 max-w-6xl", children: _jsxs("div", { className: "bg-gray-100 rounded-3xl overflow-hidden h-96 w-full relative grayscale hover:grayscale-0 transition-all duration-500", children: [_jsx("iframe", { src: contactConfig?.contactForm?.mapIframeUrl || "https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3024.2219901290355!2d-74.00369368400567!3d40.71312937933185!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x89c25a23e28c1191%3A0x49f75d3281df052a!2s150%20Park%20Row%2C%20New%20York%2C%20NY%2010007!5e0!3m2!1sen!2sus!4v1620000000000!5m2!1sen!2sus", width: "100%", height: "100%", style: { border: 0 }, allowFullScreen: true, loading: "lazy", title: "Store Location" }), _jsxs("div", { className: "absolute top-4 right-4 bg-white p-4 rounded-xl shadow-lg z-10 hidden md:block", children: [_jsx("p", { className: "font-bold text-gray-900", children: contactConfig?.contactForm?.mapTitle || storeConfig.name }), _jsx("p", { className: "text-sm text-gray-500", children: contactConfig?.contactForm?.mapAddress || storeConfig.contactInfo?.address?.street || '123 Commerce Blvd' })] })] }) }))] }));
52
+ return (_jsxs("div", { className: "min-h-screen bg-white pb-20", children: [_jsxs("section", { "data-section": "hero", className: "relative bg-gray-900 text-white py-20 overflow-hidden", children: [_jsxs("div", { className: "absolute inset-0 opacity-20", children: [_jsx(Image, { src: contactConfig?.contactHeader?.backgroundImage || "https://images.unsplash.com/photo-1596524430615-b46475ddff6e?q=80&w=2070&auto=format&fit=crop", alt: "Contact Background", fill: true, className: "w-full h-full object-cover" }), _jsx("div", { className: "absolute inset-0 bg-black/60" })] }), _jsxs("div", { className: "container mx-auto px-4 relative z-10 text-center", children: [_jsx("h1", { className: "text-4xl md:text-6xl font-bold mb-4 tracking-tight", children: contactConfig?.contactHeader?.title || "Get in Touch" }), _jsx("p", { className: "text-xl text-gray-300 max-w-2xl mx-auto font-light", children: contactConfig?.contactHeader?.subtitle || "We'd love to hear from you. Here's how you can reach us." })] })] }), _jsx("div", { "data-section": "form", className: "container mx-auto px-4 -mt-10 relative z-20 max-w-6xl", children: _jsxs("div", { className: "bg-white rounded-3xl shadow-xl overflow-hidden border border-gray-100 flex flex-col lg:flex-row", children: [_jsxs("div", { className: "lg:w-2/5 p-8 md:p-12 text-white relative overflow-hidden", style: { backgroundColor: 'var(--store-primary)' }, children: [_jsx("div", { className: "absolute top-0 right-0 -mt-10 -mr-10 w-40 h-40 bg-white opacity-10 rounded-full blur-2xl" }), _jsx("div", { className: "absolute bottom-0 left-0 -mb-10 -ml-10 w-40 h-40 bg-black opacity-10 rounded-full blur-2xl" }), _jsx("h2", { className: "text-2xl font-bold mb-8 relative z-10", children: contactConfig?.contactForm?.infoTitle || "Contact Information" }), _jsx("p", { className: "mb-10 text-white/90 leading-relaxed relative z-10", children: contactConfig?.contactForm?.infoDescription || "Fill out the form and our team will get back to you within 24 hours." }), _jsxs("div", { className: "space-y-8 relative z-10", children: [_jsxs("div", { className: "flex items-start gap-4", children: [_jsx("div", { className: "w-10 h-10 rounded-full bg-white/20 flex items-center justify-center flex-shrink-0", children: _jsx(Phone, { className: "w-5 h-5 text-white" }) }), _jsxs("div", { children: [_jsx("h3", { className: "font-semibold text-white mb-1", children: "Call Us" }), _jsx("p", { className: "text-white/80", children: storeConfig.contactInfo?.phone || '+1 (555) 123-4567' })] })] }), _jsxs("div", { className: "flex items-start gap-4", children: [_jsx("div", { className: "w-10 h-10 rounded-full bg-white/20 flex items-center justify-center flex-shrink-0", children: _jsx(Mail, { className: "w-5 h-5 text-white" }) }), _jsxs("div", { children: [_jsx("h3", { className: "font-semibold text-white mb-1", children: "Email Us" }), _jsx("p", { className: "text-white/80", children: storeConfig.contactInfo?.email || `hello@${storeConfig.slug}.com` })] })] }), _jsxs("div", { className: "flex items-start gap-4", children: [_jsx("div", { className: "w-10 h-10 rounded-full bg-white/20 flex items-center justify-center flex-shrink-0", children: _jsx(MapPin, { className: "w-5 h-5 text-white" }) }), _jsxs("div", { children: [_jsx("h3", { className: "font-semibold text-white mb-1", children: "Visit Us" }), _jsxs("p", { className: "text-white/80", children: [storeConfig.contactInfo?.address?.street || '123 Commerce Blvd', ",", _jsx("br", {}), storeConfig.contactInfo?.address?.city || 'Business City', ", ", storeConfig.contactInfo?.address?.state || 'ST', " ", storeConfig.contactInfo?.address?.zipCode || '12345'] })] })] }), _jsxs("div", { className: "flex items-start gap-4", children: [_jsx("div", { className: "w-10 h-10 rounded-full bg-white/20 flex items-center justify-center flex-shrink-0", children: _jsx(Clock, { className: "w-5 h-5 text-white" }) }), _jsxs("div", { children: [_jsx("h3", { className: "font-semibold text-white mb-1", children: "Opening Hours" }), _jsx("p", { className: "text-white/80", children: storeConfig.locations?.[0]?.openingHours || 'Mon - Fri: 9am - 6pm' }), !storeConfig.locations?.[0]?.openingHours && _jsx("p", { className: "text-white/80", children: "Sat: 10am - 4pm" })] })] })] }), _jsx("div", { className: "mt-12 relative z-10", children: _jsxs("div", { className: "flex gap-4", children: [storeConfig.branding.socialMedia?.instagram && (_jsx("a", { href: storeConfig.branding.socialMedia.instagram, target: "_blank", rel: "noopener noreferrer", className: "w-10 h-10 rounded-full bg-white/20 hover:bg-white/30 flex items-center justify-center transition-colors", children: _jsx(Image, { src: "https://storefront-assets.s3.amazonaws.com/icons/instagram.svg", alt: "Instagram", width: 20, height: 20, className: "brightness-0 invert", unoptimized: true }) })), storeConfig.branding.socialMedia?.twitter && (_jsx("a", { href: storeConfig.branding.socialMedia.twitter, target: "_blank", rel: "noopener noreferrer", className: "w-10 h-10 rounded-full bg-white/20 hover:bg-white/30 flex items-center justify-center transition-colors", children: _jsx(Image, { src: "https://storefront-assets.s3.amazonaws.com/icons/twitter.svg", alt: "Twitter", width: 20, height: 20, className: "brightness-0 invert", unoptimized: true }) })), storeConfig.branding.socialMedia?.facebook && (_jsx("a", { href: storeConfig.branding.socialMedia.facebook, target: "_blank", rel: "noopener noreferrer", className: "w-10 h-10 rounded-full bg-white/20 hover:bg-white/30 flex items-center justify-center transition-colors", children: _jsx(Image, { src: "https://storefront-assets.s3.amazonaws.com/icons/facebook.svg", alt: "Facebook", width: 20, height: 20, className: "brightness-0 invert", unoptimized: true }) })), storeConfig.branding.socialMedia?.youtube && (_jsx("a", { href: storeConfig.branding.socialMedia.youtube, target: "_blank", rel: "noopener noreferrer", className: "w-10 h-10 rounded-full bg-white/20 hover:bg-white/30 flex items-center justify-center transition-colors", children: _jsx(Image, { src: "https://storefront-assets.s3.amazonaws.com/icons/youtube.svg", alt: "YouTube", width: 20, height: 20, className: "brightness-0 invert", unoptimized: true }) }))] }) })] }), _jsxs("div", { className: "lg:w-3/5 p-8 md:p-12 bg-white relative", children: [_jsx("div", { className: "absolute top-0 right-0 p-6 opacity-5", children: _jsx(MessageSquare, { className: "w-32 h-32" }) }), formState === 'success' ? (_jsxs("div", { className: "h-full flex flex-col items-center justify-center text-center py-10", children: [_jsx("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mb-6", children: _jsx(CheckCircle, { className: "w-10 h-10 text-green-600" }) }), _jsx("h3", { className: "text-2xl font-bold text-gray-900 mb-2", children: "Message Sent!" }), _jsx("p", { className: "text-gray-600 max-w-sm mx-auto mb-8", children: "Thank you for contacting us. We have received your message and will respond as soon as possible." }), _jsx(Button, { onClick: () => setFormState('idle'), className: "bg-gray-900 hover:bg-gray-800", children: "Send Another Message" })] })) : (_jsxs("form", { onSubmit: handleSubmit, className: "relative z-10 space-y-6", children: [errorMessage && (_jsx("p", { className: "text-sm text-red-600 bg-red-50 p-3 rounded-xl", children: errorMessage })), _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-6", children: contactConfig?.contactForm?.title || "Send us a Message" }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsxs("div", { className: "space-y-2", children: [_jsx("label", { htmlFor: "firstName", className: "text-sm font-medium text-gray-700", children: "First Name" }), _jsx("input", { type: "text", id: "firstName", required: true, className: "w-full px-4 py-3 rounded-xl bg-gray-50 border border-gray-200 focus:border-gray-900 focus:ring-0 outline-none transition-all", placeholder: "John" })] }), _jsxs("div", { className: "space-y-2", children: [_jsx("label", { htmlFor: "lastName", className: "text-sm font-medium text-gray-700", children: "Last Name" }), _jsx("input", { type: "text", id: "lastName", required: true, className: "w-full px-4 py-3 rounded-xl bg-gray-50 border border-gray-200 focus:border-gray-900 focus:ring-0 outline-none transition-all", placeholder: "Doe" })] })] }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsxs("div", { className: "space-y-2", children: [_jsx("label", { htmlFor: "email", className: "text-sm font-medium text-gray-700", children: "Email Address" }), _jsx("input", { type: "email", id: "email", required: true, className: "w-full px-4 py-3 rounded-xl bg-gray-50 border border-gray-200 focus:border-gray-900 focus:ring-0 outline-none transition-all", placeholder: "john@example.com" })] }), (contactConfig?.contactForm?.showPhone !== false) && (_jsxs("div", { className: "space-y-2", children: [_jsx("label", { htmlFor: "phone", className: "text-sm font-medium text-gray-700", children: "Phone (Optional)" }), _jsx("input", { type: "tel", id: "phone", className: "w-full px-4 py-3 rounded-xl bg-gray-50 border border-gray-200 focus:border-gray-900 focus:ring-0 outline-none transition-all", placeholder: "+1 (555) 000-0000" })] }))] }), (contactConfig?.contactForm?.showSubject !== false) && (_jsxs("div", { className: "space-y-2", children: [_jsx("label", { htmlFor: "subject", className: "text-sm font-medium text-gray-700", children: "Subject" }), _jsx("select", { id: "subject", className: "w-full px-4 py-3 rounded-xl bg-gray-50 border border-gray-200 focus:border-gray-900 focus:ring-0 outline-none transition-all", children: contactConfig?.contactForm?.subjects?.length > 0 ? (contactConfig.contactForm.subjects.map((s, i) => (_jsx("option", { value: s.value, children: s.label }, i)))) : (_jsxs(_Fragment, { children: [_jsx("option", { value: "general", children: "General Inquiry" }), _jsx("option", { value: "reservations", children: "Table Reservation" }), _jsx("option", { value: "catering", children: "Gourmet Catering" }), _jsx("option", { value: "feedback", children: "Experience Feedback" }), _jsx("option", { value: "press", children: "Media & Press" })] })) })] })), _jsxs("div", { className: "space-y-2", children: [_jsx("label", { htmlFor: "message", className: "text-sm font-medium text-gray-700", children: "Message" }), _jsx("textarea", { id: "message", rows: 4, required: true, className: "w-full px-4 py-3 rounded-xl bg-gray-50 border border-gray-200 focus:border-gray-900 focus:ring-0 outline-none transition-all resize-none", placeholder: "How can we help you today?" })] }), _jsx("div", { className: "pt-2", children: _jsx(Button, { type: "submit", disabled: formState === 'submitting', className: "w-full py-6 text-lg font-semibold rounded-xl", style: { backgroundColor: 'var(--store-primary)' }, children: formState === 'submitting' ? (_jsxs("span", { className: "flex items-center gap-2", children: [_jsx("span", { className: "w-4 h-4 border-2 border-white/20 border-t-white rounded-full animate-spin" }), "Sending..."] })) : (_jsxs("span", { className: "flex items-center gap-2", children: ["Send Message", _jsx(Send, { className: "w-4 h-4" })] })) }) })] }))] })] }) }), (contactConfig?.contactForm?.showMap !== false) && (_jsx("section", { "data-section": "map", className: "container mx-auto px-4 mt-20 max-w-6xl", children: _jsxs("div", { className: "bg-gray-100 rounded-3xl overflow-hidden h-96 w-full relative grayscale hover:grayscale-0 transition-all duration-500", children: [_jsx("iframe", { src: contactConfig?.contactForm?.mapIframeUrl || "https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3024.2219901290355!2d-74.00369368400567!3d40.71312937933185!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x89c25a23e28c1191%3A0x49f75d3281df052a!2s150%20Park%20Row%2C%20New%20York%2C%20NY%2010007!5e0!3m2!1sen!2sus!4v1620000000000!5m2!1sen!2sus", width: "100%", height: "100%", style: { border: 0 }, allowFullScreen: true, loading: "lazy", title: "Store Location" }), _jsxs("div", { className: "absolute top-4 right-4 bg-white p-4 rounded-xl shadow-lg z-10 hidden md:block", children: [_jsx("p", { className: "font-bold text-gray-900", children: contactConfig?.contactForm?.mapTitle || storeConfig.name }), _jsx("p", { className: "text-sm text-gray-500", children: contactConfig?.contactForm?.mapAddress || storeConfig.contactInfo?.address?.street || '123 Commerce Blvd' })] })] }) }))] }));
55
53
  }
@@ -3,6 +3,6 @@ interface MenuPageProps {
3
3
  storeConfig: StoreConfig;
4
4
  categorySlug?: string;
5
5
  }
6
- export declare function FoodModernMenuPage({ storeConfig: initialConfig, categorySlug }: MenuPageProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function MenuPage({ storeConfig: initialConfig, categorySlug }: MenuPageProps): import("react/jsx-runtime").JSX.Element;
7
7
  export {};
8
8
  //# sourceMappingURL=MenuPage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MenuPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food-modern/pages/MenuPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAgBhD,UAAU,aAAa;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,kBAAkB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,EAAE,aAAa,2CAsT7F"}
1
+ {"version":3,"file":"MenuPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food-modern/pages/MenuPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAWhD,UAAU,aAAa;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,QAAQ,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,EAAE,aAAa,2CA4UnF"}
@@ -1,35 +1,90 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { Card, CardContent } from '../../../components/ui/card.js';
4
- import { Button } from '../../../components/ui/button.js';
3
+ import { Card, CardContent } from '../../../components/ui/card';
4
+ import { Button } from '../../../components/ui/button';
5
5
  import { ShoppingCart, Search, Star, Flame, Leaf, Wheat, Info, ChevronRight, ChevronLeft } from 'lucide-react';
6
- import { useState, useRef, useEffect, useMemo } from 'react';
7
- import Link from 'next/link';
8
- import { cn, formatCurrency } from '../../../lib/utils/index.js';
9
- import { ImageWithFallback } from '../../../components/ui/image-with-fallback.js';
10
- import { RichTextExcerpt } from '../../../components/rich-text/RichTextExcerpt.js';
11
- import { richFieldPlainTextForDisplay } from '../../../lib/rich-html.js';
12
- import { useStore } from '../../../lib/store-context.js';
13
- import { useToast } from '../../../components/ui/toast.js';
14
- import { isEditorPreviewMode, resolveMenuItemsForDisplay, resolveStoreCategoriesForDisplay } from '../../../lib/utils/index.js';
15
- import { useCatalogLoader } from '../../../hooks/use-catalog-loader.js';
16
- import { payazaInlineBindingProps } from '../../../preview/canvas/field-key.js';
17
- export function FoodModernMenuPage({ storeConfig: initialConfig, categorySlug }) {
18
- const { store, addToCart } = useStore();
6
+ import { useState, useRef, useEffect } from 'react';
7
+ import { cn, formatCurrency } from '../../../lib/utils';
8
+ import { ImageWithFallback } from '../../../components/ui/image-with-fallback';
9
+ import { useStore } from '../../../lib/store-context';
10
+ import { productService } from '../../../lib/services/product.service';
11
+ import { transformProductToStoreProduct } from '../../../lib/store-config-utils';
12
+ export function MenuPage({ storeConfig: initialConfig, categorySlug }) {
13
+ const { store } = useStore();
19
14
  const storeConfig = store || initialConfig;
20
- const { addToast } = useToast();
21
- const isPreview = isEditorPreviewMode(storeConfig);
22
- const menuConfig = storeConfig.layoutConfig?.pages?.menu;
23
- const menuHeader = menuConfig?.menuHeader;
24
- const { products: loadedProducts, categories: loadedCategories, menuItems: loadedMenuItems } = useCatalogLoader(storeConfig, { fetchServices: false });
25
- const categories = resolveStoreCategoriesForDisplay(loadedCategories, isPreview);
26
- const menuItems = useMemo(() => resolveMenuItemsForDisplay(loadedMenuItems, loadedProducts, isPreview), [loadedMenuItems, loadedProducts, isPreview]);
15
+ const categories = storeConfig.categories || [];
16
+ const [menuItems, setMenuItems] = useState(storeConfig.menuItems || []);
27
17
  const [selectedCategory, setSelectedCategory] = useState(categorySlug || '');
28
18
  const [searchQuery, setSearchQuery] = useState('');
19
+ const [currentPage, setCurrentPage] = useState(1);
20
+ const [totalItems, setTotalItems] = useState(storeConfig.menuItems?.length || 0);
21
+ const [isLoadingItems, setIsLoadingItems] = useState(false);
29
22
  const scrollContainerRef = useRef(null);
30
23
  const [showLeftGradient, setShowLeftGradient] = useState(false);
31
24
  const [showRightGradient, setShowRightGradient] = useState(true);
32
25
  const primaryColor = storeConfig.branding.primaryColor;
26
+ const toMenuItems = (products) => products.map((apiProduct) => {
27
+ const product = transformProductToStoreProduct(apiProduct);
28
+ return {
29
+ id: product.id,
30
+ name: product.name,
31
+ description: product.description || '',
32
+ price: product.price,
33
+ image: product.images[0],
34
+ categoryId: product.categoryId,
35
+ inStock: product.inStock,
36
+ dietaryInfo: [],
37
+ };
38
+ });
39
+ useEffect(() => {
40
+ const categoryId = categories.find((category) => category.slug === selectedCategory)?.id;
41
+ const timer = window.setTimeout(async () => {
42
+ setIsLoadingItems(true);
43
+ try {
44
+ const response = await productService.getProducts({
45
+ storeId: storeConfig.id,
46
+ categoryId,
47
+ search: searchQuery || undefined,
48
+ page: 1,
49
+ limit: 12,
50
+ });
51
+ setMenuItems(toMenuItems(response.data));
52
+ setCurrentPage(1);
53
+ setTotalItems(response.meta.total);
54
+ }
55
+ catch (error) {
56
+ console.error('Failed to fetch menu items:', error);
57
+ }
58
+ finally {
59
+ setIsLoadingItems(false);
60
+ }
61
+ }, searchQuery ? 250 : 0);
62
+ return () => window.clearTimeout(timer);
63
+ }, [categories, searchQuery, selectedCategory, storeConfig.id]);
64
+ const loadMore = async () => {
65
+ if (isLoadingItems || currentPage * 12 >= totalItems)
66
+ return;
67
+ setIsLoadingItems(true);
68
+ try {
69
+ const categoryId = categories.find((category) => category.slug === selectedCategory)?.id;
70
+ const response = await productService.getProducts({
71
+ storeId: storeConfig.id,
72
+ categoryId,
73
+ search: searchQuery || undefined,
74
+ page: currentPage + 1,
75
+ limit: 12,
76
+ });
77
+ setMenuItems((items) => [...items, ...toMenuItems(response.data)]);
78
+ setCurrentPage((page) => page + 1);
79
+ setTotalItems(response.meta.total);
80
+ }
81
+ catch (error) {
82
+ console.error('Failed to load more menu items:', error);
83
+ }
84
+ finally {
85
+ setIsLoadingItems(false);
86
+ }
87
+ };
33
88
  // Icons mapping for dietary info
34
89
  const dietaryIcons = {
35
90
  'spicy': Flame,
@@ -48,7 +103,7 @@ export function FoodModernMenuPage({ storeConfig: initialConfig, categorySlug })
48
103
  // Search Filter
49
104
  if (searchQuery) {
50
105
  return item.name.toLowerCase().includes(searchQuery.toLowerCase()) ||
51
- richFieldPlainTextForDisplay(item.description).toLowerCase().includes(searchQuery.toLowerCase());
106
+ item.description.toLowerCase().includes(searchQuery.toLowerCase());
52
107
  }
53
108
  return true;
54
109
  });
@@ -73,37 +128,17 @@ export function FoodModernMenuPage({ storeConfig: initialConfig, categorySlug })
73
128
  });
74
129
  }
75
130
  };
76
- const getItemProductSlug = (itemId) => storeConfig.products?.find((p) => p.id === itemId)?.slug ?? itemId;
77
- const handleAddToCart = (item, e) => {
78
- e.preventDefault();
79
- e.stopPropagation();
80
- const fullProduct = storeConfig.products?.find((p) => p.id === item.id);
81
- const product = fullProduct ?? {
82
- ...item,
83
- slug: item.id,
84
- images: item.image ? [item.image] : [],
85
- variants: [],
86
- specifications: {},
87
- rating: 0,
88
- reviewCount: 0,
89
- categoryId: item.categoryId || '',
90
- inStock: true,
91
- };
92
- addToCart(product);
93
- addToast(`${item.name} added to cart`, 'success');
94
- };
95
- return (_jsxs("div", { className: "min-h-screen bg-gray-50 pb-20", children: [menuHeader?.show !== false && (_jsxs("div", { "data-section": "menuHeader", "data-payaza-section-key": "menuHeader", "data-payaza-page": "menu", className: "relative bg-black text-white py-16 px-4 overflow-hidden", children: [_jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/80 to-transparent" }), _jsxs("div", { className: "relative z-10 container mx-auto text-center max-w-4xl", children: [_jsx("h1", { className: "text-4xl md:text-5xl font-black mb-4 tracking-tight", ...payazaInlineBindingProps(isPreview, 'menuHeader', ['title']), children: menuHeader?.title || 'Our Menu' }), _jsx("p", { className: "text-lg text-gray-200 max-w-2xl mx-auto", ...payazaInlineBindingProps(isPreview, 'menuHeader', ['subtitle']), children: menuHeader?.subtitle ||
96
- 'Discover our wide range of delicious dishes, crafted with passion and the finest ingredients.' })] })] })), _jsx("div", { "data-section": "menuGrid", "data-payaza-section-key": "menuGrid", "data-payaza-page": "menu", className: "sticky top-0 z-30 bg-gray-50/95 backdrop-blur-sm py-4 transition-all border-b border-gray-200 shadow-sm", children: _jsx("div", { className: "container mx-auto px-4 sm:px-6 lg:px-8", children: _jsxs("div", { className: "flex flex-col md:flex-row gap-4 items-center", children: [_jsxs("div", { className: "relative w-full md:max-w-xs flex-shrink-0", children: [_jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 w-4 h-4" }), _jsx("input", { type: "text", placeholder: "Search menu...", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), className: "w-full pl-9 pr-4 py-2 bg-white border border-gray-200 rounded-full text-sm focus:outline-none focus:ring-2 focus:ring-black/5 transition-all shadow-sm" })] }), _jsxs("div", { className: "relative flex-1 w-full overflow-hidden group", children: [_jsx("button", { onClick: () => scrollCategories('left'), className: cn("absolute left-0 top-1/2 -translate-y-1/2 z-10 h-8 w-8 bg-white/90 shadow-md rounded-full flex items-center justify-center text-gray-600 transition-opacity hover:bg-white md:flex hidden", !showLeftGradient && "opacity-0 pointer-events-none"), children: _jsx(ChevronLeft, { className: "w-4 h-4" }) }), _jsx("button", { onClick: () => scrollCategories('right'), className: cn("absolute right-0 top-1/2 -translate-y-1/2 z-10 h-8 w-8 bg-white/90 shadow-md rounded-full flex items-center justify-center text-gray-600 transition-opacity hover:bg-white md:flex hidden", !showRightGradient && "opacity-0 pointer-events-none"), children: _jsx(ChevronRight, { className: "w-4 h-4" }) }), _jsx("div", { className: cn("absolute left-0 top-0 bottom-0 w-12 bg-gradient-to-r from-gray-50 to-transparent z-0 pointer-events-none transition-opacity", showLeftGradient ? "opacity-100" : "opacity-0") }), _jsx("div", { className: cn("absolute right-0 top-0 bottom-0 w-12 bg-gradient-to-l from-gray-50 to-transparent z-0 pointer-events-none transition-opacity", showRightGradient ? "opacity-100" : "opacity-0") }), _jsxs("div", { ref: scrollContainerRef, onScroll: checkScroll, className: "flex gap-2 overflow-x-auto scrollbar-hide py-1 px-1 scroll-smooth", children: [_jsx("button", { onClick: () => setSelectedCategory(''), className: cn("px-4 py-2 rounded-full text-sm font-bold whitespace-nowrap transition-all border flex-shrink-0 select-none", !selectedCategory
131
+ return (_jsxs("div", { className: "min-h-screen bg-gray-50 pb-20", children: [_jsxs("div", { "data-section": "hero", className: "relative bg-black text-white py-16 px-4 overflow-hidden", children: [_jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/80 to-transparent" }), _jsxs("div", { className: "relative z-10 container mx-auto text-center max-w-4xl", children: [_jsx("h1", { className: "text-4xl md:text-5xl font-black mb-4 tracking-tight", children: "Our Menu" }), _jsx("p", { className: "text-lg text-gray-200 max-w-2xl mx-auto", children: "Discover our wide range of delicious dishes, crafted with passion and the finest ingredients." })] })] }), _jsx("div", { "data-section": "menu-list", className: "sticky top-0 z-30 bg-gray-50/95 backdrop-blur-sm py-4 transition-all border-b border-gray-200 shadow-sm", children: _jsx("div", { className: "container mx-auto px-4 sm:px-6 lg:px-8", children: _jsxs("div", { className: "flex flex-col md:flex-row gap-4 items-center", children: [_jsxs("div", { className: "relative w-full md:max-w-xs flex-shrink-0", children: [_jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 w-4 h-4" }), _jsx("input", { type: "text", placeholder: "Search menu...", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), className: "w-full pl-9 pr-4 py-2 bg-white border border-gray-200 rounded-full text-sm focus:outline-none focus:ring-2 focus:ring-black/5 transition-all shadow-sm" })] }), _jsxs("div", { className: "relative flex-1 w-full overflow-hidden group", children: [_jsx("button", { onClick: () => scrollCategories('left'), className: cn("absolute left-0 top-1/2 -translate-y-1/2 z-10 h-8 w-8 bg-white/90 shadow-md rounded-full flex items-center justify-center text-gray-600 transition-opacity hover:bg-white md:flex hidden", !showLeftGradient && "opacity-0 pointer-events-none"), children: _jsx(ChevronLeft, { className: "w-4 h-4" }) }), _jsx("button", { onClick: () => scrollCategories('right'), className: cn("absolute right-0 top-1/2 -translate-y-1/2 z-10 h-8 w-8 bg-white/90 shadow-md rounded-full flex items-center justify-center text-gray-600 transition-opacity hover:bg-white md:flex hidden", !showRightGradient && "opacity-0 pointer-events-none"), children: _jsx(ChevronRight, { className: "w-4 h-4" }) }), _jsx("div", { className: cn("absolute left-0 top-0 bottom-0 w-12 bg-gradient-to-r from-gray-50 to-transparent z-0 pointer-events-none transition-opacity", showLeftGradient ? "opacity-100" : "opacity-0") }), _jsx("div", { className: cn("absolute right-0 top-0 bottom-0 w-12 bg-gradient-to-l from-gray-50 to-transparent z-0 pointer-events-none transition-opacity", showRightGradient ? "opacity-100" : "opacity-0") }), _jsxs("div", { ref: scrollContainerRef, onScroll: checkScroll, className: "flex gap-2 overflow-x-auto scrollbar-hide py-1 px-1 scroll-smooth", children: [_jsx("button", { onClick: () => setSelectedCategory(''), className: cn("px-4 py-2 rounded-full text-sm font-bold whitespace-nowrap transition-all border flex-shrink-0 select-none", !selectedCategory
97
132
  ? "text-white border-transparent shadow-md transform scale-105"
98
133
  : "bg-white text-gray-600 border-gray-200 hover:bg-gray-100 hover:border-gray-300"), style: !selectedCategory ? { backgroundColor: primaryColor } : {}, children: "All Items" }), categories.map((category) => (_jsx("button", { onClick: () => setSelectedCategory(category.slug), className: cn("px-4 py-2 rounded-full text-sm font-bold whitespace-nowrap transition-all border flex-shrink-0 select-none", selectedCategory === category.slug
99
134
  ? "text-white border-transparent shadow-md transform scale-105"
100
- : "bg-white text-gray-600 border-gray-200 hover:bg-gray-100 hover:border-gray-300"), style: selectedCategory === category.slug ? { backgroundColor: primaryColor } : {}, children: category.name }, category.id)))] })] })] }) }) }), _jsxs("div", { className: "container mx-auto px-4 sm:px-6 lg:px-8 py-12", children: [selectedCategory && (_jsx("div", { className: "mb-8 animate-fade-in", children: _jsxs("h2", { className: "text-2xl font-bold text-gray-900 capitalize flex items-center gap-3", children: [categories.find(c => c.slug === selectedCategory)?.name || 'Category', _jsxs("span", { className: "text-sm font-normal text-gray-500 bg-gray-100 px-2 py-0.5 rounded-full", children: [filteredItems.length, " items"] })] }) })), _jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-8", children: filteredItems.map((item, index) => (_jsxs(Card, { className: "group overflow-hidden hover:shadow-xl transition-all duration-300 border-gray-100 flex flex-col h-full bg-white rounded-2xl", children: [_jsx(Link, { href: `/${storeConfig.slug}/products/${getItemProductSlug(item.id)}`, className: "block", children: _jsxs("div", { className: "relative aspect-[4/3] overflow-hidden", children: [_jsx(ImageWithFallback, { src: item.image, alt: item.name, className: "w-full h-full object-cover transition-transform duration-700 group-hover:scale-110", skeletonAspectRatio: "4/3" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-end justify-center pb-6", children: _jsx(Button, { className: "rounded-full font-bold shadow-lg transform translate-y-4 group-hover:translate-y-0 transition-transform duration-300", style: { backgroundColor: primaryColor, color: 'white' }, onClick: (e) => handleAddToCart(item, e), children: "Quick Add" }) }), index % 3 === 0 && (_jsxs("div", { className: "absolute top-3 right-3 bg-white/90 backdrop-blur text-gray-900 text-[10px] font-bold px-2 py-1 rounded-full shadow-sm flex items-center gap-1", children: [_jsx(Star, { className: "w-3 h-3 fill-yellow-400 text-yellow-400" }), " Popular"] }))] }) }), _jsxs(CardContent, { className: "p-6 flex-1 flex flex-col", children: [_jsx(Link, { href: `/${storeConfig.slug}/products/${getItemProductSlug(item.id)}`, className: "group/title", children: _jsxs("div", { className: "flex justify-between items-start mb-2", children: [_jsx("h3", { className: "font-bold text-lg text-gray-900 leading-tight group-hover/title:underline", children: item.name }), _jsx("span", { className: "font-black text-lg text-gray-900 whitespace-nowrap ml-2", children: formatCurrency(item.price, item.currency || storeConfig.settings?.currency || 'USD') })] }) }), _jsx(RichTextExcerpt, { value: item.description, as: "p", className: "text-gray-500 text-sm mb-4 line-clamp-2 leading-relaxed flex-1" }), item.dietaryInfo && item.dietaryInfo.length > 0 && (_jsx("div", { className: "flex flex-wrap gap-2 mb-6", children: item.dietaryInfo.map((info) => {
135
+ : "bg-white text-gray-600 border-gray-200 hover:bg-gray-100 hover:border-gray-300"), style: selectedCategory === category.slug ? { backgroundColor: primaryColor } : {}, children: category.name }, category.id)))] })] })] }) }) }), _jsxs("div", { className: "container mx-auto px-4 sm:px-6 lg:px-8 py-12", children: [selectedCategory && (_jsx("div", { className: "mb-8 animate-fade-in", children: _jsxs("h2", { className: "text-2xl font-bold text-gray-900 capitalize flex items-center gap-3", children: [categories.find(c => c.slug === selectedCategory)?.name || 'Category', _jsxs("span", { className: "text-sm font-normal text-gray-500 bg-gray-100 px-2 py-0.5 rounded-full", children: [filteredItems.length, " items"] })] }) })), _jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-8", children: filteredItems.map((item, index) => (_jsxs(Card, { className: "group overflow-hidden hover:shadow-xl transition-all duration-300 border-gray-100 flex flex-col h-full bg-white rounded-2xl", children: [_jsxs("div", { className: "relative aspect-[4/3] overflow-hidden", children: [_jsx(ImageWithFallback, { src: item.image, alt: item.name, className: "w-full h-full object-cover transition-transform duration-700 group-hover:scale-110", skeletonAspectRatio: "4/3" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-end justify-center pb-6", children: _jsx(Button, { className: "rounded-full font-bold shadow-lg transform translate-y-4 group-hover:translate-y-0 transition-transform duration-300", style: { backgroundColor: primaryColor, color: 'white' }, children: "Quick Add" }) }), index % 3 === 0 && (_jsxs("div", { className: "absolute top-3 right-3 bg-white/90 backdrop-blur text-gray-900 text-[10px] font-bold px-2 py-1 rounded-full shadow-sm flex items-center gap-1", children: [_jsx(Star, { className: "w-3 h-3 fill-yellow-400 text-yellow-400" }), " Popular"] }))] }), _jsxs(CardContent, { className: "p-6 flex-1 flex flex-col", children: [_jsxs("div", { className: "flex justify-between items-start mb-2", children: [_jsx("h3", { className: "font-bold text-lg text-gray-900 leading-tight", children: item.name }), _jsx("span", { className: "font-black text-lg text-gray-900 whitespace-nowrap ml-2", children: formatCurrency(item.price, item.currency || storeConfig.settings?.currency || 'USD') })] }), _jsx("p", { className: "text-gray-500 text-sm mb-4 line-clamp-2 leading-relaxed flex-1", children: item.description }), item.dietaryInfo && item.dietaryInfo.length > 0 && (_jsx("div", { className: "flex flex-wrap gap-2 mb-6", children: item.dietaryInfo.map((info) => {
101
136
  const Icon = dietaryIcons[info.toLowerCase()] || Info;
102
137
  return (_jsxs("span", { className: "inline-flex items-center gap-1 text-[10px] uppercase font-bold px-2 py-1 rounded bg-gray-50 text-gray-500 border border-gray-100", children: [_jsx(Icon, { className: "w-3 h-3" }), info] }, info));
103
138
  }) })), _jsxs(Button, { className: "w-full rounded-xl font-bold h-11 shadow-sm hover:shadow-md transition-all active:scale-[0.98]", style: {
104
139
  backgroundColor: 'black',
105
140
  color: 'white',
106
- }, onClick: (e) => handleAddToCart(item, e), children: [_jsx(ShoppingCart, { className: "h-4 w-4 mr-2" }), "Add to Cart"] })] })] }, item.id))) }), filteredItems.length === 0 && (_jsxs("div", { className: "text-center py-20 bg-white rounded-3xl border border-dashed border-gray-200", children: [_jsx("div", { className: "w-20 h-20 bg-gray-50 rounded-full flex items-center justify-center mx-auto mb-4", children: _jsx(Search, { className: "w-8 h-8 text-gray-300" }) }), _jsx("h3", { className: "text-xl font-bold text-gray-900 mb-2", children: "No items found" }), _jsx("p", { className: "text-gray-500", children: "Try adjusting your search or category filter." }), _jsx(Button, { variant: "outline", className: "mt-6", onClick: () => {
141
+ }, children: [_jsx(ShoppingCart, { className: "h-4 w-4 mr-2" }), "Add to Cart"] })] })] }, item.id))) }), currentPage * 12 < totalItems && (_jsx("div", { className: "mt-10 flex justify-center", children: _jsx(Button, { onClick: loadMore, disabled: isLoadingItems, children: isLoadingItems ? 'Loading...' : 'Load more' }) })), filteredItems.length === 0 && (_jsxs("div", { className: "text-center py-20 bg-white rounded-3xl border border-dashed border-gray-200", children: [_jsx("div", { className: "w-20 h-20 bg-gray-50 rounded-full flex items-center justify-center mx-auto mb-4", children: _jsx(Search, { className: "w-8 h-8 text-gray-300" }) }), _jsx("h3", { className: "text-xl font-bold text-gray-900 mb-2", children: "No items found" }), _jsx("p", { className: "text-gray-500", children: "Try adjusting your search or category filter." }), _jsx(Button, { variant: "outline", className: "mt-6", onClick: () => {
107
142
  setSearchQuery('');
108
143
  setSelectedCategory('');
109
144
  }, children: "Clear Filters" })] }))] })] }));
@@ -3,6 +3,6 @@ interface ProductDetailPageProps {
3
3
  storeConfig: StoreConfig;
4
4
  productSlug: string;
5
5
  }
6
- export declare function FoodModernProductDetailPage({ storeConfig, productSlug }: ProductDetailPageProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function ProductDetailPage({ storeConfig, productSlug }: ProductDetailPageProps): import("react/jsx-runtime").JSX.Element;
7
7
  export {};
8
8
  //# sourceMappingURL=ProductDetailPage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProductDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food-modern/pages/ProductDetailPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAA8C,MAAM,mBAAmB,CAAC;AAoD5F,UAAU,sBAAsB;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAyHD,wBAAgB,2BAA2B,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,sBAAsB,2CAq5B/F"}
1
+ {"version":3,"file":"ProductDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/food-modern/pages/ProductDetailPage.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAA8C,MAAM,mBAAmB,CAAC;AA4B5F,UAAU,sBAAsB;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAsHD,wBAAgB,iBAAiB,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,sBAAsB,2CAuiCrF"}