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,32 +1,17 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { Button } from '../../../components/ui/button.js';
3
+ import { Button } from '../../../components/ui/button';
4
4
  import { Clock, ArrowRight, Filter } from 'lucide-react';
5
5
  import Link from 'next/link';
6
6
  import { useState } from 'react';
7
- import { cn, formatCurrency, filterCategoriesForServices, isEditorPreviewMode, resolveStoreServicesForDisplay } from '../../../lib/utils/index.js';
8
- import { useCatalogLoader } from '../../../hooks/use-catalog-loader.js';
7
+ import { cn, formatCurrency, filterActiveServices } from '../../../lib/utils';
9
8
  import Image from 'next/image';
10
- import { RichTextExcerpt } from '../../../components/rich-text/RichTextExcerpt.js';
11
- import { useStore } from '../../../lib/store-context.js';
12
- import { showLayoutDecorativeBadges } from '../../../lib/layout-badges.js';
13
- import { encodePayazaFieldKey, payazaInlineBindingProps } from '../../../preview/canvas/field-key.js';
14
- export function BookingAgendaServicesPage({ storeConfig: initialConfig, initialCategory, titleOverride }) {
15
- const { store } = useStore();
16
- const storeConfig = store || initialConfig;
17
- const isPreview = isEditorPreviewMode(storeConfig);
18
- const { services: loadedServices, categories: loadedCategories } = useCatalogLoader(storeConfig, {
19
- fetchProducts: false,
20
- });
21
- const services = resolveStoreServicesForDisplay(loadedServices, isPreview);
22
- const categories = filterCategoriesForServices(loadedCategories, services);
9
+ export function ServicesPage({ storeConfig, initialCategory, titleOverride }) {
10
+ const categories = storeConfig.categories || [];
11
+ const services = filterActiveServices(storeConfig.services || []);
23
12
  const [activeCategory, setActiveCategory] = useState(initialCategory || categories[0]?.slug || '');
24
13
  const primaryColor = storeConfig.branding.primaryColor;
25
14
  const servicesConfig = storeConfig.layoutConfig?.pages?.services;
26
- const heroConfig = servicesConfig?.hero || servicesConfig?.servicesHeader;
27
- const heroImage = typeof heroConfig?.backgroundImage === 'string' && heroConfig.backgroundImage.trim().length > 0
28
- ? heroConfig.backgroundImage.trim()
29
- : 'https://images.unsplash.com/photo-1512496015851-a90fb38ba796?q=80&w=2070&auto=format&fit=crop';
30
15
  // Booking-agenda (medical) specific labels
31
16
  const categoryLabel = 'Departments';
32
17
  const serviceLabel = 'Procedures';
@@ -39,8 +24,8 @@ export function BookingAgendaServicesPage({ storeConfig: initialConfig, initialC
39
24
  const getServiceLink = (slug) => {
40
25
  return `/${storeConfig.slug}/book?service=${slug}`;
41
26
  };
42
- const pageTitle = titleOverride || heroConfig?.title || servicesConfig?.title || (_jsxs(_Fragment, { children: ["Signature ", _jsx("span", { className: "font-bold font-sans", style: { color: primaryColor }, children: serviceLabel })] }));
43
- return (_jsxs("div", { className: "min-h-screen bg-white pb-20", children: [heroConfig?.show !== false && (_jsxs("div", { "data-section": "hero", "data-payaza-section-key": "hero", "data-payaza-page": "services", className: "relative bg-gray-900 py-32 px-4 text-center overflow-hidden", children: [_jsxs("div", { className: "absolute inset-0", "data-payaza-image": isPreview ? encodePayazaFieldKey('hero', ['backgroundImage']) : undefined, children: [_jsx(Image, { src: heroImage, alt: "Service Menu", fill: true, className: "w-full h-full object-cover opacity-60", unoptimized: true }, heroImage), _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/80 via-black/40 to-black/30" })] }), _jsxs("div", { className: "container mx-auto max-w-4xl relative z-10", children: [showLayoutDecorativeBadges() && (_jsx("span", { className: "inline-block py-1 px-3 rounded-full bg-white/10 backdrop-blur-md border border-white/20 text-xs font-bold uppercase tracking-widest text-white mb-6 shadow-sm", children: storeConfig.name })), _jsx("h1", { className: "text-5xl md:text-7xl font-serif font-light mb-6 tracking-tight text-white leading-tight", ...payazaInlineBindingProps(isPreview, 'hero', ['title']), children: pageTitle }), _jsx("p", { className: "text-gray-200 max-w-2xl mx-auto text-lg font-light leading-relaxed", ...payazaInlineBindingProps(isPreview, 'hero', ['description']), children: heroConfig?.description || servicesConfig?.description || storeConfig.description || `Explore our curated selection of premium ${serviceLabel.toLowerCase()} designed for your success.` })] })] })), _jsx("div", { className: "sticky top-16 z-30 bg-white/80 backdrop-blur-xl border-b border-gray-100 transition-all", children: _jsx("div", { className: "container mx-auto px-4", children: _jsxs("div", { className: "flex items-center gap-3 overflow-x-auto py-4 scrollbar-hide no-scrollbar", children: [_jsxs("div", { className: "flex items-center gap-2 text-xs font-bold text-gray-400 uppercase tracking-wider px-4 border-r border-gray-100 hidden md:flex shrink-0", children: [_jsx(Filter, { className: "w-3.5 h-3.5" }), categoryLabel] }), categories.map((cat) => (_jsx("button", { onClick: () => setActiveCategory(cat.slug), className: cn("px-6 py-2.5 rounded-full text-sm font-bold whitespace-nowrap transition-all duration-300 border flex-shrink-0", activeCategory === cat.slug
27
+ const pageTitle = titleOverride || servicesConfig?.title || (_jsxs(_Fragment, { children: ["Signature ", _jsx("span", { className: "font-bold font-sans", style: { color: primaryColor }, children: serviceLabel })] }));
28
+ return (_jsxs("div", { className: "min-h-screen bg-white pb-20", children: [_jsxs("div", { "data-section": "hero", className: "relative bg-gray-900 py-32 px-4 text-center overflow-hidden", children: [_jsxs("div", { className: "absolute inset-0", children: [_jsx(Image, { src: "https://images.unsplash.com/photo-1512496015851-a90fb38ba796?q=80&w=2070&auto=format&fit=crop", alt: "Service Menu", fill: true, className: "w-full h-full object-cover opacity-60" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/80 via-black/40 to-black/30" })] }), _jsxs("div", { className: "container mx-auto max-w-4xl relative z-10", children: [_jsx("span", { className: "inline-block py-1 px-3 rounded-full bg-white/10 backdrop-blur-md border border-white/20 text-xs font-bold uppercase tracking-widest text-white mb-6 shadow-sm", children: storeConfig.name }), _jsx("h1", { className: "text-5xl md:text-7xl font-serif font-light mb-6 tracking-tight text-white leading-tight", children: pageTitle }), _jsx("p", { className: "text-gray-200 max-w-2xl mx-auto text-lg font-light leading-relaxed", children: servicesConfig?.description || storeConfig.description || `Explore our curated selection of premium ${serviceLabel.toLowerCase()} designed for your success.` })] })] }), _jsx("div", { className: "sticky top-16 z-30 bg-white/80 backdrop-blur-xl border-b border-gray-100 transition-all", children: _jsx("div", { className: "container mx-auto px-4", children: _jsxs("div", { className: "flex items-center gap-3 overflow-x-auto py-4 scrollbar-hide no-scrollbar", children: [_jsxs("div", { className: "flex items-center gap-2 text-xs font-bold text-gray-400 uppercase tracking-wider px-4 border-r border-gray-100 hidden md:flex shrink-0", children: [_jsx(Filter, { className: "w-3.5 h-3.5" }), categoryLabel] }), categories.map((cat) => (_jsx("button", { onClick: () => setActiveCategory(cat.slug), className: cn("px-6 py-2.5 rounded-full text-sm font-bold whitespace-nowrap transition-all duration-300 border flex-shrink-0", activeCategory === cat.slug
44
29
  ? "text-white shadow-lg scale-105 border-transparent"
45
- : "bg-white text-gray-500 border-gray-100 hover:border-gray-300 hover:text-black"), style: activeCategory === cat.slug ? { backgroundColor: primaryColor } : {}, children: cat.name }, cat.id)))] }) }) }), _jsx("div", { "data-section": "services-list", "data-payaza-section-key": "services-list", "data-payaza-page": "services", className: "container mx-auto px-4 max-w-7xl py-16", children: _jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-x-10 gap-y-16", children: filteredServices.map((service) => (_jsxs("div", { className: "group flex flex-col h-full", children: [_jsxs(Link, { href: getServiceLink(service.slug), className: "block relative aspect-[4/3] rounded-3xl overflow-hidden bg-gray-100 mb-6 shadow-sm group-hover:shadow-xl transition-all duration-500", children: [_jsx(Image, { src: service.image || 'https://images.unsplash.com/photo-1629909613654-28e377c37b09?w=800&auto=format&fit=crop&q=60', alt: service.name, fill: true, className: "w-full h-full object-cover transition-transform duration-700 group-hover:scale-105", unoptimized: true }), _jsx("div", { className: "absolute bottom-4 left-4 bg-white/95 backdrop-blur px-4 py-2 rounded-full text-sm font-bold shadow-sm text-gray-900", children: service.price > 0 ? formatCurrency(service.price, service.currency || storeConfig.settings?.currency || 'USD') : 'Free' }), _jsx("div", { className: "absolute inset-0 bg-black/20 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-center justify-center", children: _jsx(Button, { className: "rounded-full bg-white text-black hover:bg-gray-100 transform translate-y-4 group-hover:translate-y-0 transition-all duration-300 shadow-lg font-bold px-8", children: "Book Now" }) })] }), _jsxs("div", { className: "flex flex-col flex-1", children: [_jsx("div", { className: "flex justify-between items-start mb-3", children: _jsx(Link, { href: getServiceLink(service.slug), children: _jsx("h3", { className: "text-2xl font-bold text-gray-900 group-hover:text-gray-600 transition-colors", children: service.name }) }) }), _jsx(RichTextExcerpt, { value: service.description, as: "p", className: "text-gray-500 mb-6 line-clamp-2 leading-relaxed text-base flex-1" }), _jsxs("div", { className: "flex items-center justify-between pt-4 border-t border-gray-100 text-sm font-medium text-gray-500", children: [_jsxs("div", { className: "flex items-center gap-6", children: [service.duration > 0 && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Clock, { className: "w-4 h-4 text-gray-400" }), service.duration, " mins"] })), service.contentType && (_jsx("div", { className: "flex items-center gap-2 uppercase tracking-widest text-[10px] font-black", children: service.contentType }))] }), _jsxs(Link, { href: getServiceLink(service.slug), className: "flex items-center gap-2 text-black font-bold group/link", children: ["Book ", _jsx(ArrowRight, { className: "w-4 h-4 transition-transform group-hover/link:translate-x-1" })] })] })] })] }, service.id))) }) })] }));
30
+ : "bg-white text-gray-500 border-gray-100 hover:border-gray-300 hover:text-black"), style: activeCategory === cat.slug ? { backgroundColor: primaryColor } : {}, children: cat.name }, cat.id)))] }) }) }), _jsx("div", { "data-section": "services-list", className: "container mx-auto px-4 max-w-7xl py-16", children: _jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-x-10 gap-y-16", children: filteredServices.map((service) => (_jsxs("div", { className: "group flex flex-col h-full", children: [_jsxs(Link, { href: getServiceLink(service.slug), className: "block relative aspect-[4/3] rounded-3xl overflow-hidden bg-gray-100 mb-6 shadow-sm group-hover:shadow-xl transition-all duration-500", children: [_jsx(Image, { src: service.image || 'https://images.unsplash.com/photo-1629909613654-28e377c37b09?w=800&auto=format&fit=crop&q=60', alt: service.name, fill: true, className: "w-full h-full object-cover transition-transform duration-700 group-hover:scale-105" }), _jsx("div", { className: "absolute bottom-4 left-4 bg-white/95 backdrop-blur px-4 py-2 rounded-full text-sm font-bold shadow-sm text-gray-900", children: service.price > 0 ? formatCurrency(service.price, service.currency || storeConfig.settings?.currency || 'USD') : 'Free' }), _jsx("div", { className: "absolute inset-0 bg-black/20 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-center justify-center", children: _jsx(Button, { className: "rounded-full bg-white text-black hover:bg-gray-100 transform translate-y-4 group-hover:translate-y-0 transition-all duration-300 shadow-lg font-bold px-8", children: "Book Now" }) })] }), _jsxs("div", { className: "flex flex-col flex-1", children: [_jsx("div", { className: "flex justify-between items-start mb-3", children: _jsx(Link, { href: getServiceLink(service.slug), children: _jsx("h3", { className: "text-2xl font-bold text-gray-900 group-hover:text-gray-600 transition-colors", children: service.name }) }) }), _jsx("p", { className: "text-gray-500 mb-6 line-clamp-2 leading-relaxed text-base flex-1", children: service.description }), _jsxs("div", { className: "flex items-center justify-between pt-4 border-t border-gray-100 text-sm font-medium text-gray-500", children: [_jsxs("div", { className: "flex items-center gap-6", children: [service.duration > 0 && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Clock, { className: "w-4 h-4 text-gray-400" }), service.duration, " mins"] })), service.contentType && (_jsx("div", { className: "flex items-center gap-2 uppercase tracking-widest text-[10px] font-black", children: service.contentType }))] }), _jsxs(Link, { href: getServiceLink(service.slug), className: "flex items-center gap-2 text-black font-bold group/link", children: ["Book ", _jsx(ArrowRight, { className: "w-4 h-4 transition-transform group-hover/link:translate-x-1" })] })] })] })] }, service.id))) }) })] }));
46
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ClothingHomePage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/clothing/components/ClothingHomePage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAsBvD,UAAU,qBAAqB;IAC7B,WAAW,EAAE,WAAW,CAAC;CAC1B;AAaD,wBAAgB,gBAAgB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,qBAAqB,2CA8sBrF"}
1
+ {"version":3,"file":"ClothingHomePage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/clothing/components/ClothingHomePage.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAevD,UAAU,qBAAqB;IAC7B,WAAW,EAAE,WAAW,CAAC;CAC1B;AAaD,wBAAgB,gBAAgB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,qBAAqB,2CA6uBrF"}
@@ -1,25 +1,18 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { Button } from '../../../components/ui/button.js';
4
- import { ProductRating } from '../../../components/ui/product-rating.js';
3
+ import { useFeaturedProducts } from '../../../hooks/use-featured-products';
4
+ import { Button } from '../../../components/ui/button';
5
+ import { ProductRating } from '../../../components/ui/product-rating';
5
6
  import { ShoppingCart, Heart, ArrowRight, ChevronLeft, ChevronRight } from 'lucide-react';
6
7
  import Link from 'next/link';
7
- import { ImageWithFallback } from '../../../components/ui/image-with-fallback.js';
8
+ import { ImageWithFallback } from '../../../components/ui/image-with-fallback';
8
9
  import { useState, useEffect } from 'react';
9
- import { formatCurrency, resolveStoreProductsForDisplay } from '../../../lib/utils/index.js';
10
- import { resolveProductImageUrls } from '../../../lib/utils/product-images.js';
11
- import { getLayoutText, getBannerImage, normalizeStoreImageUrl } from '../../../lib/utils/asset-helpers.js';
12
- import { shouldUseAPI } from '../../../lib/utils/demo-detection.js';
13
- import { useStore } from '../../../lib/store-context.js';
14
- import { DynamicIcon } from '../../../components/ui/dynamic-icon.js';
15
- import { PromoBanner } from '../../shared/components/PromoBanner.js';
16
- import { getPayazaSectionInlineStyle } from '../../../lib/payaza-section-styles.js';
17
- import { resolveStoreLink } from '../../../lib/layout-route-utils.js';
18
- import { useClothingPayaza } from '../payaza-bindings.js';
19
- import { showLayoutDecorativeBadges } from '../../../lib/layout-badges.js';
20
- import { compactArrayItems, readItemIconName } from '../../../lib/compact-array-items.js';
21
- import { usePreviewSlideSync } from '../../../hooks/usePreviewSlideSync.js';
22
- import { trackStorefrontEvent } from '../../../lib/mixpanel.js';
10
+ import { formatCurrency, filterActiveProducts } from '../../../lib/utils';
11
+ import { getLayoutText, getBannerImage } from '../../../lib/utils/asset-helpers';
12
+ import { toStoreHref } from '../../../lib/utils/url-helpers';
13
+ import { shouldUseAPI } from '../../../lib/utils/demo-detection';
14
+ import { useStore } from '../../../lib/store-context';
15
+ import { DynamicIcon } from '../../../components/ui/dynamic-icon';
23
16
  export function ClothingHomePage({ storeConfig: initialConfig }) {
24
17
  // Use the store from context which is updated in real-time by the editor
25
18
  const { store } = useStore();
@@ -27,7 +20,7 @@ export function ClothingHomePage({ storeConfig: initialConfig }) {
27
20
  const layoutConfig = storeConfig.layoutConfig;
28
21
  const categories = storeConfig.categories || [];
29
22
  // In preview mode, use mock products if none are available
30
- const { isPreview, section, edit, image, inline, icon } = useClothingPayaza(storeConfig, 'home');
23
+ const isPreview = (typeof window !== 'undefined' && window.__IS_PREVIEW__) || storeConfig.layoutConfig?.isPreview;
31
24
  // Randomly select max 2 categories on every page load
32
25
  const [displayedCategories, setDisplayedCategories] = useState([]);
33
26
  useEffect(() => {
@@ -49,94 +42,133 @@ export function ClothingHomePage({ storeConfig: initialConfig }) {
49
42
  }, [categories, isPreview]); // Added categories and isPreview to deps
50
43
  // ... rest of the component logic ...
51
44
  // Deduplicate products to avoid key warnings and filter out inactive/deleted products
52
- const rawProducts = storeConfig.products || [];
45
+ const initialProducts = storeConfig.products || [];
46
+ const rawProducts = useFeaturedProducts(storeConfig.id, initialProducts, !isPreview);
53
47
  const uniqueProducts = rawProducts.filter((product, index, self) => index === self.findIndex((t) => t.id === product.id));
54
- const resolvedProducts = resolveStoreProductsForDisplay(uniqueProducts, isPreview);
55
- // Use real products when available; in preview fall back to mock placeholders only when empty.
56
- const products = resolvedProducts.length > 0
57
- ? resolvedProducts
58
- : (isPreview ? [
59
- { id: 'p1', name: 'Premium Cotton Tee', price: 45, currency: 'USD', images: ['https://images.unsplash.com/photo-1521572267360-ee0c2909d518?q=80&w=800'], slug: 'premium-tee', rating: 4.8, reviewCount: 124 },
60
- { id: 'p2', name: 'Slim Fit Denim', price: 89, currency: 'USD', images: ['https://images.unsplash.com/photo-1542272604-787c3835535d?q=80&w=800'], slug: 'slim-denim', rating: 4.6, reviewCount: 89 },
61
- { id: 'p3', name: 'Classic Trench Coat', price: 199, currency: 'USD', images: ['https://images.unsplash.com/photo-1591047139829-d91aecb6caea?q=80&w=800'], slug: 'trench-coat', rating: 4.9, reviewCount: 56, compareAtPrice: 249 },
62
- { id: 'p4', name: 'Leather Chelsea Boots', price: 159, currency: 'USD', images: ['https://images.unsplash.com/photo-1638247025967-b4e38f787b76?q=80&w=800'], slug: 'chelsea-boots', rating: 4.7, reviewCount: 112 }
63
- ] : []);
48
+ const activeProducts = filterActiveProducts(uniqueProducts);
49
+ // Use real active products if available, otherwise if in preview, use all products (including drafts),
50
+ // and if still none, use mock data
51
+ const products = activeProducts.length > 0
52
+ ? activeProducts
53
+ : (isPreview && rawProducts.length > 0
54
+ ? rawProducts
55
+ : (isPreview ? [
56
+ { id: 'p1', name: 'Premium Cotton Tee', price: 45, currency: 'USD', images: ['https://images.unsplash.com/photo-1521572267360-ee0c2909d518?q=80&w=800'], slug: 'premium-tee', rating: 4.8, reviewCount: 124 },
57
+ { id: 'p2', name: 'Slim Fit Denim', price: 89, currency: 'USD', images: ['https://images.unsplash.com/photo-1542272604-787c3835535d?q=80&w=800'], slug: 'slim-denim', rating: 4.6, reviewCount: 89 },
58
+ { id: 'p3', name: 'Classic Trench Coat', price: 199, currency: 'USD', images: ['https://images.unsplash.com/photo-1591047139829-d91aecb6caea?q=80&w=800'], slug: 'trench-coat', rating: 4.9, reviewCount: 56, compareAtPrice: 249 },
59
+ { id: 'p4', name: 'Leather Chelsea Boots', price: 159, currency: 'USD', images: ['https://images.unsplash.com/photo-1638247025967-b4e38f787b76?q=80&w=800'], slug: 'chelsea-boots', rating: 4.7, reviewCount: 112 }
60
+ ] : []));
64
61
  // Hero slides data - use new slider structure with fallback to old format
65
62
  // For demo stores, helpers will return fallbacks; for real stores, try layoutConfig first, then helpers
66
63
  const isRealStore = shouldUseAPI(storeConfig.slug);
67
- const DEFAULT_HERO_IMAGES = [
68
- 'https://images.unsplash.com/photo-1523381210434-271e8be1f52b?q=80&w=2000&auto=format&fit=crop',
69
- 'https://images.unsplash.com/photo-1441986300917-64674bd600d8?q=80&w=2000&auto=format&fit=crop',
70
- 'https://images.unsplash.com/photo-1558769132-cb1aea458c5e?q=80&w=2000&auto=format&fit=crop',
71
- ];
72
- const mapConfigSlidersToHeroSlides = (sliders, heroSection) => {
73
- const showBadges = heroSection?.showBadges !== false &&
74
- (layoutConfig?.hero?.showBadges !== false || heroSection?.showBadges === undefined);
75
- return sliders
76
- .filter((slider) => slider)
77
- .map((slider, index) => {
64
+ // Debug logging for slider configuration
65
+ if (process.env.NODE_ENV === 'development') {
66
+ console.log('[ClothingHomePage] LayoutConfig sections.hero:', layoutConfig?.sections?.hero);
67
+ console.log('[ClothingHomePage] LayoutConfig hero (top-level):', layoutConfig?.hero);
68
+ console.log('[ClothingHomePage] Sliders found:', layoutConfig?.sections?.hero?.sliders?.length || 0);
69
+ }
70
+ // Try new structure first (sections.hero.sliders)
71
+ let heroSlides = [];
72
+ if (layoutConfig?.sections?.hero?.sliders && Array.isArray(layoutConfig.sections.hero.sliders) && layoutConfig.sections.hero.sliders.length > 0) {
73
+ if (process.env.NODE_ENV === 'development') {
74
+ console.log('[ClothingHomePage] Using sections.hero.sliders structure');
75
+ }
76
+ heroSlides = layoutConfig.sections.hero.sliders
77
+ .filter((slider) => slider && slider.image) // Filter out invalid sliders
78
+ .map((slider) => {
79
+ // Extract button text - only use if not empty
78
80
  const primaryButtonText = slider.primaryButton?.text?.trim() || '';
79
81
  const secondaryButtonText = slider.secondaryButton?.text?.trim() || '';
80
- const defaultImage = DEFAULT_HERO_IMAGES[index % DEFAULT_HERO_IMAGES.length];
82
+ if (process.env.NODE_ENV === 'development') {
83
+ console.log('[ClothingHomePage] Slider:', {
84
+ id: slider.id,
85
+ image: slider.image ? 'present' : 'missing',
86
+ title: slider.title,
87
+ primaryButtonText,
88
+ secondaryButtonText,
89
+ });
90
+ }
91
+ // Check badge visibility - use sections.hero.showBadges first, fallback to top-level hero.showBadges
92
+ const showBadges = layoutConfig?.sections?.hero?.showBadges !== false &&
93
+ (layoutConfig?.hero?.showBadges !== false || layoutConfig?.sections?.hero?.showBadges === undefined);
81
94
  return {
82
- image: normalizeStoreImageUrl(slider.image) || defaultImage,
95
+ image: slider.image || '',
83
96
  badge: (showBadges && slider.badge && slider.badge.trim() !== '') ? slider.badge : undefined,
84
- title: slider.title?.trim() || storeConfig.name,
85
- description: slider.description?.trim() || storeConfig.description || '',
97
+ title: slider.title || storeConfig.name,
98
+ description: slider.description || storeConfig.description || '',
99
+ // Only set button text if it's not empty - this allows button visibility logic to work
86
100
  primaryButtonText: primaryButtonText || getLayoutText(storeConfig, 'common.shopNow', 'Shop Now'),
87
- primaryButtonLink: slider.primaryButton?.link || `/${storeConfig.slug}/products`,
88
- secondaryButtonText: secondaryButtonText || undefined,
89
- secondaryButtonLink: slider.secondaryButton?.link || `/${storeConfig.slug}/categories`,
101
+ primaryButtonLink: toStoreHref(storeConfig.slug, slider.primaryButton?.link, '/products'),
102
+ secondaryButtonText: secondaryButtonText || undefined, // Don't provide fallback for secondary
103
+ secondaryButtonLink: toStoreHref(storeConfig.slug, slider.secondaryButton?.link, '/categories'),
90
104
  };
91
105
  });
92
- };
93
- const buildLegacyFallbackHeroSlides = () => [
94
- {
95
- image: getBannerImage(storeConfig, 'hero_slide_1', 'https://images.unsplash.com/photo-1523381210434-271e8be1f52b?q=80&w=2000&auto=format&fit=crop'),
96
- badge: layoutConfig?.hero?.showBadges
97
- ? (isRealStore && layoutConfig?.text?.hero?.slides?.[0]?.badge ? layoutConfig.text.hero.slides[0].badge : getLayoutText(storeConfig, 'hero.badge', 'New Season'))
98
- : undefined,
99
- title: isRealStore && layoutConfig?.text?.hero?.slides?.[0]?.title ? layoutConfig.text.hero.slides[0].title : (getLayoutText(storeConfig, 'hero.slide1.title', storeConfig.name) || storeConfig.name),
100
- description: isRealStore && layoutConfig?.text?.hero?.slides?.[0]?.description ? layoutConfig.text.hero.slides[0].description : (getLayoutText(storeConfig, 'hero.slide1.description', storeConfig.description) || storeConfig.description),
101
- primaryButtonText: isRealStore && layoutConfig?.text?.hero?.slides?.[0]?.primaryButton ? layoutConfig.text.hero.slides[0].primaryButton : getLayoutText(storeConfig, 'common.shopNow', 'Shop Now'),
102
- primaryButtonLink: `/${storeConfig.slug}/products`,
103
- secondaryButtonText: isRealStore && layoutConfig?.text?.hero?.slides?.[0]?.secondaryButton ? layoutConfig.text.hero.slides[0].secondaryButton : getLayoutText(storeConfig, 'common.explore', 'Explore'),
104
- secondaryButtonLink: `/${storeConfig.slug}/categories`,
105
- },
106
- {
107
- image: getBannerImage(storeConfig, 'hero_slide_2', 'https://images.unsplash.com/photo-1441986300917-64674bd600d8?q=80&w=2000&auto=format&fit=crop'),
108
- badge: layoutConfig?.hero?.showBadges
109
- ? (isRealStore && layoutConfig?.text?.hero?.slides?.[1]?.badge ? layoutConfig.text.hero.slides[1].badge : getLayoutText(storeConfig, 'common.trending', 'Trending Now'))
110
- : undefined,
111
- title: isRealStore && layoutConfig?.text?.hero?.slides?.[1]?.title ? layoutConfig.text.hero.slides[1].title : getLayoutText(storeConfig, 'hero.slide2.title', 'Discover Your Style'),
112
- description: isRealStore && layoutConfig?.text?.hero?.slides?.[1]?.description ? layoutConfig.text.hero.slides[1].description : getLayoutText(storeConfig, 'hero.slide2.description', 'Explore our curated collection of timeless pieces and contemporary designs.'),
113
- primaryButtonText: isRealStore && layoutConfig?.text?.hero?.slides?.[1]?.primaryButton ? layoutConfig.text.hero.slides[1].primaryButton : getLayoutText(storeConfig, 'common.viewAll', 'View Collection'),
114
- primaryButtonLink: `/${storeConfig.slug}/products`,
115
- secondaryButtonText: isRealStore && layoutConfig?.text?.hero?.slides?.[1]?.secondaryButton ? layoutConfig.text.hero.slides[1].secondaryButton : undefined,
116
- secondaryButtonLink: `/${storeConfig.slug}/categories/men`,
117
- },
118
- {
119
- image: getBannerImage(storeConfig, 'hero_slide_3', 'https://images.unsplash.com/photo-1558769132-cb1aea458c5e?q=80&w=2000&auto=format&fit=crop'),
120
- badge: layoutConfig?.hero?.showBadges
121
- ? (isRealStore && layoutConfig?.text?.hero?.slides?.[2]?.badge ? layoutConfig.text.hero.slides[2].badge : getLayoutText(storeConfig, 'common.limited', 'Limited Edition'))
122
- : undefined,
123
- title: isRealStore && layoutConfig?.text?.hero?.slides?.[2]?.title ? layoutConfig.text.hero.slides[2].title : getLayoutText(storeConfig, 'hero.slide3.title', 'Premium Quality'),
124
- description: isRealStore && layoutConfig?.text?.hero?.slides?.[2]?.description ? layoutConfig.text.hero.slides[2].description : getLayoutText(storeConfig, 'hero.slide3.description', 'Crafted with attention to detail and premium materials for lasting elegance.'),
125
- primaryButtonText: isRealStore && layoutConfig?.text?.hero?.slides?.[2]?.primaryButton ? layoutConfig.text.hero.slides[2].primaryButton : getLayoutText(storeConfig, 'common.shopNow', 'Shop Now'),
126
- primaryButtonLink: `/${storeConfig.slug}/products`,
127
- secondaryButtonText: isRealStore && layoutConfig?.text?.hero?.slides?.[2]?.secondaryButton ? layoutConfig.text.hero.slides[2].secondaryButton : undefined,
128
- secondaryButtonLink: `/${storeConfig.slug}/categories/men`,
129
- },
130
- ];
131
- let heroSlides = buildLegacyFallbackHeroSlides();
132
- if (layoutConfig?.sections?.hero?.sliders && Array.isArray(layoutConfig.sections.hero.sliders) && layoutConfig.sections.hero.sliders.length > 0) {
133
- heroSlides = mapConfigSlidersToHeroSlides(layoutConfig.sections.hero.sliders, layoutConfig.sections.hero);
134
106
  }
135
107
  else if (layoutConfig?.hero?.sliders && Array.isArray(layoutConfig.hero.sliders) && layoutConfig.hero.sliders.length > 0) {
136
- heroSlides = mapConfigSlidersToHeroSlides(layoutConfig.hero.sliders, layoutConfig.sections?.hero);
108
+ // Fallback to top-level hero.sliders
109
+ if (process.env.NODE_ENV === 'development') {
110
+ console.log('[ClothingHomePage] Using top-level hero.sliders structure');
111
+ }
112
+ heroSlides = layoutConfig.hero.sliders
113
+ .filter((slider) => slider && slider.image) // Filter out invalid sliders
114
+ .map((slider) => {
115
+ const primaryButtonText = slider.primaryButton?.text?.trim() || '';
116
+ const secondaryButtonText = slider.secondaryButton?.text?.trim() || '';
117
+ // Check badge visibility - use sections.hero.showBadges first, fallback to top-level hero.showBadges
118
+ const showBadges = layoutConfig?.sections?.hero?.showBadges !== false &&
119
+ (layoutConfig?.hero?.showBadges !== false || layoutConfig?.sections?.hero?.showBadges === undefined);
120
+ return {
121
+ image: slider.image || '',
122
+ badge: (showBadges && slider.badge && slider.badge.trim() !== '') ? slider.badge : undefined,
123
+ title: slider.title || storeConfig.name,
124
+ description: slider.description || storeConfig.description || '',
125
+ primaryButtonText: primaryButtonText || getLayoutText(storeConfig, 'common.shopNow', 'Shop Now'),
126
+ primaryButtonLink: toStoreHref(storeConfig.slug, slider.primaryButton?.link, '/products'),
127
+ secondaryButtonText: secondaryButtonText || undefined,
128
+ secondaryButtonLink: toStoreHref(storeConfig.slug, slider.secondaryButton?.link, '/categories'),
129
+ };
130
+ });
137
131
  }
138
- if (heroSlides.length === 0) {
139
- heroSlides = buildLegacyFallbackHeroSlides();
132
+ else {
133
+ // Fallback to old format (backward compatibility)
134
+ heroSlides = [
135
+ {
136
+ image: getBannerImage(storeConfig, 'hero_slide_1', 'https://images.unsplash.com/photo-1523381210434-271e8be1f52b?q=80&w=2000&auto=format&fit=crop'),
137
+ badge: layoutConfig?.hero?.showBadges
138
+ ? (isRealStore && layoutConfig?.text?.hero?.slides?.[0]?.badge ? layoutConfig.text.hero.slides[0].badge : getLayoutText(storeConfig, 'hero.badge', 'New Season'))
139
+ : undefined,
140
+ title: isRealStore && layoutConfig?.text?.hero?.slides?.[0]?.title ? layoutConfig.text.hero.slides[0].title : (getLayoutText(storeConfig, 'hero.slide1.title', storeConfig.name) || storeConfig.name),
141
+ description: isRealStore && layoutConfig?.text?.hero?.slides?.[0]?.description ? layoutConfig.text.hero.slides[0].description : (getLayoutText(storeConfig, 'hero.slide1.description', storeConfig.description) || storeConfig.description),
142
+ primaryButtonText: isRealStore && layoutConfig?.text?.hero?.slides?.[0]?.primaryButton ? layoutConfig.text.hero.slides[0].primaryButton : getLayoutText(storeConfig, 'common.shopNow', 'Shop Now'),
143
+ primaryButtonLink: `/${storeConfig.slug}/products`,
144
+ secondaryButtonText: isRealStore && layoutConfig?.text?.hero?.slides?.[0]?.secondaryButton ? layoutConfig.text.hero.slides[0].secondaryButton : getLayoutText(storeConfig, 'common.explore', 'Explore'),
145
+ secondaryButtonLink: `/${storeConfig.slug}/categories`,
146
+ },
147
+ {
148
+ image: getBannerImage(storeConfig, 'hero_slide_2', 'https://images.unsplash.com/photo-1617059063772-34532796ddb5?q=80&w=2000&auto=format&fit=crop'),
149
+ badge: layoutConfig?.hero?.showBadges
150
+ ? (isRealStore && layoutConfig?.text?.hero?.slides?.[1]?.badge ? layoutConfig.text.hero.slides[1].badge : getLayoutText(storeConfig, 'common.trending', 'Trending Now'))
151
+ : undefined,
152
+ title: isRealStore && layoutConfig?.text?.hero?.slides?.[1]?.title ? layoutConfig.text.hero.slides[1].title : getLayoutText(storeConfig, 'hero.slide2.title', 'Discover Your Style'),
153
+ description: isRealStore && layoutConfig?.text?.hero?.slides?.[1]?.description ? layoutConfig.text.hero.slides[1].description : getLayoutText(storeConfig, 'hero.slide2.description', 'Explore our curated collection of timeless pieces and contemporary designs.'),
154
+ primaryButtonText: isRealStore && layoutConfig?.text?.hero?.slides?.[1]?.primaryButton ? layoutConfig.text.hero.slides[1].primaryButton : getLayoutText(storeConfig, 'common.viewAll', 'View Collection'),
155
+ primaryButtonLink: `/${storeConfig.slug}/products`,
156
+ secondaryButtonText: isRealStore && layoutConfig?.text?.hero?.slides?.[1]?.secondaryButton ? layoutConfig.text.hero.slides[1].secondaryButton : undefined,
157
+ secondaryButtonLink: `/${storeConfig.slug}/categories/men`,
158
+ },
159
+ {
160
+ image: getBannerImage(storeConfig, 'hero_slide_3', 'https://images.unsplash.com/photo-1558769132-cb1aea458c5e?q=80&w=2000&auto=format&fit=crop'),
161
+ badge: layoutConfig?.hero?.showBadges
162
+ ? (isRealStore && layoutConfig?.text?.hero?.slides?.[2]?.badge ? layoutConfig.text.hero.slides[2].badge : getLayoutText(storeConfig, 'common.limited', 'Limited Edition'))
163
+ : undefined,
164
+ title: isRealStore && layoutConfig?.text?.hero?.slides?.[2]?.title ? layoutConfig.text.hero.slides[2].title : getLayoutText(storeConfig, 'hero.slide3.title', 'Premium Quality'),
165
+ description: isRealStore && layoutConfig?.text?.hero?.slides?.[2]?.description ? layoutConfig.text.hero.slides[2].description : getLayoutText(storeConfig, 'hero.slide3.description', 'Crafted with attention to detail and premium materials for lasting elegance.'),
166
+ primaryButtonText: isRealStore && layoutConfig?.text?.hero?.slides?.[2]?.primaryButton ? layoutConfig.text.hero.slides[2].primaryButton : getLayoutText(storeConfig, 'common.shopNow', 'Shop Now'),
167
+ primaryButtonLink: `/${storeConfig.slug}/products`,
168
+ secondaryButtonText: isRealStore && layoutConfig?.text?.hero?.slides?.[2]?.secondaryButton ? layoutConfig.text.hero.slides[2].secondaryButton : undefined,
169
+ secondaryButtonLink: `/${storeConfig.slug}/categories/men`,
170
+ },
171
+ ];
140
172
  }
141
173
  const [currentSlide, setCurrentSlide] = useState(0);
142
174
  const [isAutoPlaying, setIsAutoPlaying] = useState(layoutConfig?.hero?.autoPlay !== false);
@@ -170,7 +202,6 @@ export function ClothingHomePage({ storeConfig: initialConfig }) {
170
202
  setAutoPlayResumeTime(10000);
171
203
  }
172
204
  };
173
- usePreviewSlideSync('hero', goToSlide, () => setIsAutoPlaying(false));
174
205
  const nextSlide = () => {
175
206
  if (heroSlides.length === 0)
176
207
  return;
@@ -193,29 +224,23 @@ export function ClothingHomePage({ storeConfig: initialConfig }) {
193
224
  const getCategoryGridClass = () => {
194
225
  return 'grid-cols-1 md:grid-cols-2';
195
226
  };
196
- return (_jsxs("div", { className: "min-h-screen bg-white", children: [(layoutConfig?.sections?.hero?.show !== false || layoutConfig?.hero?.show !== false) && heroSlides.length > 0 && (_jsxs("section", { ...section('hero'), style: getPayazaSectionInlineStyle(storeConfig, 'home', 'hero'), className: `relative min-h-[360px] w-full overflow-hidden ${isPreview
197
- ? 'h-[min(70dvh,28rem)] sm:h-[min(75dvh,32rem)] lg:h-[85vh]'
198
- : 'h-[70dvh] sm:h-[75dvh] lg:h-[85vh]'}`, onMouseEnter: () => setIsAutoPlaying(false), onMouseLeave: () => layoutConfig?.hero?.autoPlay !== false && setIsAutoPlaying(true), children: [_jsx("div", { className: "relative h-full w-full", children: heroSlides.map((slide, index) => (_jsxs("div", { className: `absolute inset-0 transition-opacity duration-1000 ease-in-out ${index === currentSlide ? 'opacity-100 z-10' : 'opacity-0 z-0'}`, children: [_jsxs("div", { className: "absolute inset-0", ...image('hero', ['sliders', String(index), 'image']), children: [_jsx(ImageWithFallback, { src: slide.image, alt: slide.title, className: "absolute inset-0 h-full w-full object-cover", skeletonAspectRatio: "16/9" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-r from-black/50 via-black/20 to-transparent" })] }), _jsx("div", { className: "absolute inset-0 flex items-center z-20", children: _jsx("div", { className: "container mx-auto px-4 sm:px-6 lg:px-8", children: _jsxs("div", { className: `max-w-3xl text-white space-y-8 transition-all duration-1000 ${index === currentSlide
227
+ return (_jsxs("div", { className: "min-h-screen bg-white", children: [(layoutConfig?.sections?.hero?.show !== false || layoutConfig?.hero?.show !== false) && heroSlides.length > 0 && (_jsxs("section", { "data-section": "hero", className: "relative h-[85vh] w-full overflow-hidden", onMouseEnter: () => setIsAutoPlaying(false), onMouseLeave: () => layoutConfig?.hero?.autoPlay !== false && setIsAutoPlaying(true), children: [_jsx("div", { className: "relative h-full w-full", children: heroSlides.map((slide, index) => (_jsxs("div", { className: `absolute inset-0 transition-opacity duration-1000 ease-in-out ${index === currentSlide ? 'opacity-100 z-10' : 'opacity-0 z-0'}`, children: [_jsxs("div", { className: "absolute inset-0", children: [_jsx(ImageWithFallback, { src: slide.image, alt: slide.title, className: "absolute inset-0 h-full w-full object-cover", skeletonAspectRatio: "16/9", priority: index === currentSlide }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-r from-black/50 via-black/20 to-transparent" })] }), _jsx("div", { className: "absolute inset-0 flex items-center z-20", children: _jsx("div", { className: "container mx-auto px-4 sm:px-6 lg:px-8", children: _jsxs("div", { className: `max-w-3xl text-white space-y-8 transition-all duration-1000 ${index === currentSlide
199
228
  ? 'opacity-100 translate-y-0'
200
- : 'opacity-0 translate-y-8'}`, children: [_jsxs("div", { children: [showLayoutDecorativeBadges() && slide.badge && (_jsx("span", { className: "inline-block px-4 py-1.5 bg-white/20 backdrop-blur-md rounded-full text-sm font-medium border border-white/30 uppercase tracking-wider mb-4", ...edit('hero', ['sliders', String(index), 'badge']), children: slide.badge })), _jsx("h1", { className: "text-4xl sm:text-6xl lg:text-7xl font-bold leading-tight tracking-tight mb-4", ...edit('hero', ['sliders', String(index), 'title']), children: slide.title }), _jsx("div", { className: "h-1 w-24 bg-white/80 rounded-full" })] }), _jsx("p", { className: "text-xl sm:text-2xl text-gray-100 font-light leading-relaxed max-w-lg", ...edit('hero', ['sliders', String(index), 'description']), children: slide.description }), _jsxs("div", { className: "flex flex-wrap gap-4 pt-4", children: [layoutConfig?.sections?.hero?.showCTA !== false &&
229
+ : 'opacity-0 translate-y-8'}`, children: [_jsxs("div", { children: [slide.badge && (_jsx("span", { className: "inline-block px-4 py-1.5 bg-white/20 backdrop-blur-md rounded-full text-sm font-medium border border-white/30 uppercase tracking-wider mb-4", children: slide.badge })), _jsx("h1", { className: "text-4xl sm:text-6xl lg:text-7xl font-bold leading-tight tracking-tight mb-4", children: slide.title }), _jsx("div", { className: "h-1 w-24 bg-white/80 rounded-full" })] }), _jsx("p", { className: "text-xl sm:text-2xl text-gray-100 font-light leading-relaxed max-w-lg", children: slide.description }), _jsxs("div", { className: "flex flex-wrap gap-4 pt-4", children: [layoutConfig?.sections?.hero?.showCTA !== false &&
201
230
  layoutConfig?.hero?.showCTA !== false &&
202
231
  slide.primaryButtonText &&
203
- slide.primaryButtonText.trim() !== '' && (_jsx(Link, { href: resolveStoreLink(slide.primaryButtonLink || 'products', storeConfig.slug), children: _jsx(Button, { size: "lg", className: "h-14 px-10 text-base rounded-full bg-white text-black hover:bg-gray-100 transition-all duration-300 hover:scale-105 font-semibold", ...edit('hero', ['sliders', String(index), 'primaryButton', 'text']), children: slide.primaryButtonText }) })), (layoutConfig?.sections?.hero?.showSecondaryCTA !== false || layoutConfig?.hero?.showSecondaryCTA !== false) &&
232
+ slide.primaryButtonText.trim() !== '' && (_jsx(Link, { href: slide.primaryButtonLink, children: _jsx(Button, { size: "lg", className: "h-14 px-10 text-base rounded-full bg-white text-black hover:bg-gray-100 transition-all duration-300 hover:scale-105 font-semibold", children: slide.primaryButtonText }) })), (layoutConfig?.sections?.hero?.showSecondaryCTA !== false || layoutConfig?.hero?.showSecondaryCTA !== false) &&
204
233
  slide.secondaryButtonText &&
205
234
  slide.secondaryButtonText.trim() !== '' &&
206
- slide.secondaryButtonLink && (_jsx(Link, { href: resolveStoreLink(slide.secondaryButtonLink, storeConfig.slug), children: _jsx(Button, { size: "lg", variant: "outline", className: "h-14 px-10 text-base rounded-full border-white bg-transparent text-white hover:bg-white/20 hover:text-white backdrop-blur-sm transition-all duration-300", style: { color: 'white' }, ...edit('hero', ['sliders', String(index), 'secondaryButton', 'text']), children: slide.secondaryButtonText }) }))] })] }) }) })] }, index))) }), _jsx("button", { onClick: prevSlide, className: "absolute left-4 top-1/2 -translate-y-1/2 z-30 bg-white/10 hover:bg-white/20 backdrop-blur-md rounded-full p-3 transition-all duration-300 hover:scale-110 group", "aria-label": "Previous slide", children: _jsx(ChevronLeft, { className: "h-6 w-6 text-white group-hover:text-white" }) }), _jsx("button", { onClick: nextSlide, className: "absolute right-4 top-1/2 -translate-y-1/2 z-30 bg-white/10 hover:bg-white/20 backdrop-blur-md rounded-full p-3 transition-all duration-300 hover:scale-110 group", "aria-label": "Next slide", children: _jsx(ChevronRight, { className: "h-6 w-6 text-white group-hover:text-white" }) }), _jsx("div", { className: "absolute bottom-8 left-1/2 -translate-x-1/2 z-30 flex gap-2", children: heroSlides.map((_, index) => (_jsx("button", { onClick: () => goToSlide(index), className: `transition-all duration-300 rounded-full ${index === currentSlide
235
+ slide.secondaryButtonLink && (_jsx(Link, { href: slide.secondaryButtonLink, children: _jsx(Button, { size: "lg", variant: "outline", className: "h-14 px-10 text-base rounded-full border-white bg-transparent text-white hover:bg-white/20 hover:text-white backdrop-blur-sm transition-all duration-300", style: { color: 'white' }, children: slide.secondaryButtonText }) }))] })] }) }) })] }, index))) }), _jsx("button", { onClick: prevSlide, className: "absolute left-4 top-1/2 -translate-y-1/2 z-30 bg-white/10 hover:bg-white/20 backdrop-blur-md rounded-full p-3 transition-all duration-300 hover:scale-110 group", "aria-label": "Previous slide", children: _jsx(ChevronLeft, { className: "h-6 w-6 text-white group-hover:text-white" }) }), _jsx("button", { onClick: nextSlide, className: "absolute right-4 top-1/2 -translate-y-1/2 z-30 bg-white/10 hover:bg-white/20 backdrop-blur-md rounded-full p-3 transition-all duration-300 hover:scale-110 group", "aria-label": "Next slide", children: _jsx(ChevronRight, { className: "h-6 w-6 text-white group-hover:text-white" }) }), _jsx("div", { className: "absolute bottom-8 left-1/2 -translate-x-1/2 z-30 flex gap-2", children: heroSlides.map((_, index) => (_jsx("button", { onClick: () => goToSlide(index), className: `transition-all duration-300 rounded-full ${index === currentSlide
207
236
  ? 'w-12 h-2 bg-white'
208
- : 'w-2 h-2 bg-white/50 hover:bg-white/75'}`, "aria-label": `Go to slide ${index + 1}` }, index))) })] })), layoutConfig?.sections?.features?.show !== false && (_jsx("section", { ...section('benefitsStrip'), style: getPayazaSectionInlineStyle(storeConfig, 'home', 'benefitsStrip'), className: "py-8 bg-gray-50 border-b border-gray-100", children: _jsx("div", { className: "container mx-auto px-4 sm:px-6 lg:px-8", children: _jsx("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-8 text-center divide-y md:divide-y-0 md:divide-x divide-gray-200", children: compactArrayItems(layoutConfig?.sections?.features?.items?.length
209
- ? layoutConfig.sections.features.items
210
- : isPreview
211
- ? [
212
- { icon: 'Truck', title: 'Free Shipping', description: `On all orders over $${storeConfig.settings.freeShippingThreshold}` },
213
- { icon: 'RefreshCw', title: 'Free Returns', description: '30-day money back guarantee' },
214
- { icon: 'ShieldCheck', title: 'Secure Payment', description: '100% secure checkout process' },
215
- ]
216
- : []).map((item, idx) => {
217
- return (_jsxs("div", { className: "flex flex-col items-center justify-center gap-2 p-4", children: [_jsx("div", { ...icon('benefitsStrip', ['items', String(idx), 'icon']), children: _jsx(DynamicIcon, { name: readItemIconName(item, 'Truck'), className: "h-6 w-6 text-gray-900" }) }), _jsx("h3", { className: "font-semibold text-gray-900", ...inline('benefitsStrip', ['items', String(idx), 'title']), children: item.title }), _jsx("p", { className: "text-sm text-gray-500", ...inline('benefitsStrip', ['items', String(idx), 'description']), children: item.description })] }, idx));
218
- }) }) }) })), layoutConfig?.sections?.categories?.show !== false && (_jsx("section", { ...section('categories'), style: getPayazaSectionInlineStyle(storeConfig, 'home', 'categories'), className: "py-12 md:py-20 px-4 sm:px-6 lg:px-8", children: _jsxs("div", { className: "container mx-auto max-w-7xl", children: [_jsxs("div", { className: "flex flex-col md:flex-row justify-between items-end mb-8 md:mb-12 gap-4", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-3xl md:text-4xl font-bold mb-3 tracking-tight", ...inline('categories', ['title']), children: layoutConfig?.sections?.categories?.title || getLayoutText(storeConfig, 'sections.categories.title', isPreview ? 'Shop by Category' : '') }), _jsx("p", { className: "text-gray-500 text-lg", ...inline('categories', ['subtitle']), children: layoutConfig?.sections?.categories?.subtitle || getLayoutText(storeConfig, 'sections.categories.subtitle', isPreview ? 'Curated collections for every style' : '') })] }), layoutConfig?.sections?.categories?.showViewAll !== false && (_jsxs(Link, { href: `/${storeConfig.slug}/categories`, className: "group flex items-center gap-2 text-sm font-medium hover:text-gray-600 transition-colors pb-1 border-b border-transparent hover:border-gray-300", ...inline('categories', ['viewAll']), children: [getLayoutText(storeConfig, 'sections.categories.viewAll', 'View All Categories'), " ", _jsx(ArrowRight, { className: "h-4 w-4 transition-transform group-hover:translate-x-1" })] }))] }), _jsx("div", { className: `grid ${getCategoryGridClass()} gap-6`, children: displayedCategories.map((category) => {
237
+ : 'w-2 h-2 bg-white/50 hover:bg-white/75'}`, "aria-label": `Go to slide ${index + 1}` }, index))) })] })), layoutConfig?.sections?.features?.show !== false && (_jsx("section", { "data-section": "about", className: "py-8 bg-gray-50 border-b border-gray-100", children: _jsx("div", { className: "container mx-auto px-4 sm:px-6 lg:px-8", children: _jsx("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-8 text-center divide-y md:divide-y-0 md:divide-x divide-gray-200", children: (layoutConfig?.sections?.features?.items || [
238
+ { icon: 'Truck', title: 'Free Shipping', description: `On all orders over $${storeConfig.settings.freeShippingThreshold}` },
239
+ { icon: 'RefreshCw', title: 'Free Returns', description: '30-day money back guarantee' },
240
+ { icon: 'ShieldCheck', title: 'Secure Payment', description: '100% secure checkout process' }
241
+ ]).filter(Boolean).map((item, idx) => {
242
+ return (_jsxs("div", { className: "flex flex-col items-center justify-center gap-2 p-4", children: [_jsx(DynamicIcon, { name: item.icon, className: "h-6 w-6 text-gray-900" }), _jsx("h3", { className: "font-semibold text-gray-900", children: item.title }), _jsx("p", { className: "text-sm text-gray-500", children: item.description })] }, idx));
243
+ }) }) }) })), layoutConfig?.sections?.categories?.show !== false && (_jsx("section", { "data-section": "categories", className: "py-12 md:py-20 px-4 sm:px-6 lg:px-8", children: _jsxs("div", { className: "container mx-auto max-w-7xl", children: [_jsxs("div", { className: "flex flex-col md:flex-row justify-between items-end mb-8 md:mb-12 gap-4", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-3xl md:text-4xl font-bold mb-3 tracking-tight", children: getLayoutText(storeConfig, 'sections.categories.title', 'Shop by Category') }), _jsx("p", { className: "text-gray-500 text-lg", children: getLayoutText(storeConfig, 'sections.categories.subtitle', 'Curated collections for every style') })] }), layoutConfig?.sections?.categories?.showViewAll !== false && (_jsxs(Link, { href: `/${storeConfig.slug}/categories`, className: "group flex items-center gap-2 text-sm font-medium hover:text-gray-600 transition-colors pb-1 border-b border-transparent hover:border-gray-300", children: [getLayoutText(storeConfig, 'sections.categories.viewAll', 'View All Categories'), " ", _jsx(ArrowRight, { className: "h-4 w-4 transition-transform group-hover:translate-x-1" })] }))] }), _jsx("div", { className: `grid ${getCategoryGridClass()} gap-6`, children: displayedCategories.map((category) => {
219
244
  // Validate category image - handle all formats
220
245
  const extractCategoryImage = (image) => {
221
246
  if (!image)
@@ -239,30 +264,68 @@ export function ClothingHomePage({ storeConfig: initialConfig }) {
239
264
  return undefined;
240
265
  };
241
266
  const categoryImage = extractCategoryImage(category.image);
242
- return (_jsxs(Link, { href: `/${storeConfig.slug}/categories/${category.slug}`, className: `group relative overflow-hidden rounded-2xl aspect-[3/4]`, children: [_jsxs("div", { className: "absolute inset-0 bg-gray-200", children: [_jsx(ImageWithFallback, { src: categoryImage, alt: category.name, className: "w-full h-full object-cover transition-transform duration-700 group-hover:scale-110", skeletonAspectRatio: "auto" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/70 via-black/20 to-transparent opacity-80 group-hover:opacity-70 transition-opacity" })] }), _jsxs("div", { className: "absolute inset-0 flex flex-col justify-end p-8", children: [_jsx("h3", { className: "text-2xl font-bold text-white mb-2 transform translate-y-0 transition-transform duration-300", children: category.name }), _jsx("div", { className: "h-0.5 w-12 bg-white/0 group-hover:bg-white/100 transition-all duration-500 mb-4" }), _jsxs("span", { className: "inline-flex items-center text-white text-sm font-medium opacity-0 group-hover:opacity-100 transform translate-y-4 group-hover:translate-y-0 transition-all duration-300", children: [getLayoutText(storeConfig, 'common.shopNow', 'Shop Now'), " ", _jsx(ArrowRight, { className: "ml-2 h-4 w-4" })] })] })] }, category.id));
243
- }) })] }) })), layoutConfig?.sections?.marketing?.editorial?.show !== false && (_jsx("section", { ...section('lookbook'), style: getPayazaSectionInlineStyle(storeConfig, 'home', 'lookbook'), className: "py-16 md:py-24 px-4 sm:px-6 lg:px-8 bg-stone-50", children: _jsx("div", { className: "container mx-auto max-w-7xl", children: _jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-10 md:gap-12 lg:gap-20 items-center", children: [_jsxs("div", { className: "relative pb-8 md:pb-0", children: [_jsx("div", { className: "aspect-[4/5] rounded-lg overflow-hidden relative", ...image('lookbook', ['image']), children: _jsx(ImageWithFallback, { src: layoutConfig?.sections?.marketing?.editorial?.image || 'https://images.unsplash.com/photo-1490481651871-ab68de25d43d?q=80&w=2000&auto=format&fit=crop', alt: "Editorial Lookbook", className: "w-full h-full object-cover", skeletonAspectRatio: "4/5" }) }), (layoutConfig?.sections?.marketing?.editorial?.detailImage) && (_jsx("div", { className: "z-20 mx-auto mt-6 h-40 w-40 rounded-lg bg-white p-4 shadow-xl animate-fade-in-up md:absolute md:bottom-[-2rem] md:right-[-2rem] md:mx-0 md:mt-0 md:h-48 md:w-48", style: { animationDelay: '0.2s' }, ...image('lookbook', ['detailImage']), children: _jsx("div", { className: "relative h-full w-full", children: _jsx(ImageWithFallback, { src: layoutConfig.sections.marketing.editorial.detailImage, alt: "Detail Shot", className: "h-full w-full rounded object-cover", skeletonAspectRatio: "square" }) }) }))] }), _jsxs("div", { className: "space-y-8", children: [_jsx("div", { className: "flex flex-col gap-2", children: _jsx("span", { className: "text-sm font-bold tracking-widest text-gray-500 uppercase", ...inline('lookbook', ['badgeText']), children: layoutConfig?.sections?.marketing?.editorial?.badgeText || "Lookbook" }) }), _jsx("h2", { className: "text-4xl md:text-5xl font-bold tracking-tight leading-tight text-gray-900", ...edit('lookbook', ['title']), children: layoutConfig?.sections?.marketing?.editorial?.title ? (layoutConfig.sections.marketing.editorial.title.split('\n').map((line, idx, arr) => (_jsxs("span", { children: [line, idx < arr.length - 1 && _jsx("br", {})] }, idx)))) : (_jsxs(_Fragment, { children: ["Redefining Modern ", _jsx("br", {}), _jsx("span", { className: "italic font-serif", children: "Elegance" })] })) }), _jsx("p", { className: "text-lg text-gray-600 leading-relaxed", ...edit('lookbook', ['description']), children: layoutConfig?.sections?.marketing?.editorial?.description || "Explore our latest editorial featuring timeless pieces crafted for the contemporary wardrobe. From essential basics to statement outwear, find your signature look." }), _jsxs("div", { className: "flex flex-col sm:flex-row gap-4 pt-4", children: [layoutConfig?.sections?.marketing?.editorial?.primaryButton?.text && (_jsx(Link, { href: layoutConfig.sections.marketing.editorial.primaryButton.link?.startsWith('/')
244
- ? `/${storeConfig.slug}${layoutConfig.sections.marketing.editorial.primaryButton.link}`
245
- : (layoutConfig.sections.marketing.editorial.primaryButton.link || `/${storeConfig.slug}/style-guide`), children: _jsx(Button, { className: "rounded-full px-8 py-6 bg-gray-900 hover:bg-black text-white transition-all", ...edit('lookbook', ['primaryButton', 'text']), children: layoutConfig.sections.marketing.editorial.primaryButton.text }) })), layoutConfig?.sections?.marketing?.editorial?.secondaryButton?.text && (_jsx(Link, { href: layoutConfig.sections.marketing.editorial.secondaryButton.link?.startsWith('/')
246
- ? `/${storeConfig.slug}${layoutConfig.sections.marketing.editorial.secondaryButton.link}`
247
- : (layoutConfig.sections.marketing.editorial.secondaryButton.link || `/${storeConfig.slug}/about`), children: _jsx(Button, { variant: "outline", className: "rounded-full px-8 py-6 border-gray-300 hover:bg-white hover:border-gray-900 transition-all", ...edit('lookbook', ['secondaryButton', 'text']), children: layoutConfig.sections.marketing.editorial.secondaryButton.text }) }))] })] })] }) }) })), layoutConfig?.sections?.featuredProducts?.show !== false && (_jsx("section", { ...section('featuredProducts'), style: getPayazaSectionInlineStyle(storeConfig, 'home', 'featuredProducts'), className: "py-16 md:py-24 px-4 sm:px-6 lg:px-8 bg-white", children: _jsxs("div", { className: "container mx-auto max-w-7xl", children: [_jsxs("div", { className: "text-center max-w-2xl mx-auto mb-10 md:mb-16", children: [_jsx("span", { className: "text-sm font-bold tracking-widest text-gray-500 uppercase mb-3 block", ...inline('featuredProducts', ['eyebrow']), children: layoutConfig?.sections?.featuredProducts?.eyebrow || "Curated For You" }), _jsx("h2", { className: "text-3xl md:text-4xl font-bold mb-4 tracking-tight", ...inline('featuredProducts', ['title']), children: layoutConfig?.sections?.featuredProducts?.title || getLayoutText(storeConfig, 'sections.featuredProducts.title', 'Trending Now') }), _jsx("div", { className: "h-1 w-20 bg-gray-900 mx-auto mb-6" }), _jsx("p", { className: "text-gray-600 text-lg", ...inline('featuredProducts', ['subtitle']), children: getLayoutText(storeConfig, 'sections.featuredProducts.subtitle', 'Discover the latest trends and essential pieces that define this season\'s style.') })] }), _jsx("div", { className: "grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-4 gap-4 sm:gap-8", children: products.slice(0, 4).map((product) => {
248
- const validImages = resolveProductImageUrls(product.images);
249
- const firstImage = validImages[0];
250
- return (_jsx("div", { className: "group", children: _jsxs(Link, { href: `/${storeConfig.slug}/products/${product.slug}`, onClick: () => trackStorefrontEvent('Product_clicked', {
251
- storeId: storeConfig.id,
252
- storeSlug: storeConfig.slug,
253
- productId: product.id,
254
- productName: product.name,
255
- categoryId: product.categoryId,
256
- price: product.price,
257
- }), children: [_jsxs("div", { className: "relative aspect-[3/4] bg-gray-50 rounded-xl overflow-hidden mb-4", children: [_jsx(ImageWithFallback, { src: firstImage, alt: product.name, className: "w-full h-full object-cover transition-transform duration-700 group-hover:scale-105", skeletonAspectRatio: "3/4" }), validImages[1] && (_jsx(ImageWithFallback, { src: validImages[1], alt: product.name, className: "absolute inset-0 w-full h-full object-cover opacity-0 group-hover:opacity-100 transition-opacity duration-500", skeletonAspectRatio: "3/4" })), _jsxs("div", { className: "hidden lg:flex absolute bottom-4 right-4 flex-col gap-2 opacity-0 transform translate-x-4 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-300", children: [storeConfig.features.wishlist && (_jsx(Button, { variant: "secondary", size: "icon", className: "bg-white hover:bg-black hover:text-white shadow-md rounded-full transition-colors", children: _jsx(Heart, { className: "h-4 w-4" }) })), _jsx(Button, { variant: "secondary", size: "icon", className: "bg-white hover:bg-black hover:text-white shadow-md rounded-full transition-colors", children: _jsx(ShoppingCart, { className: "h-4 w-4" }) })] }), _jsx(Button, { variant: "secondary", size: "icon", className: "lg:hidden absolute bottom-3 right-3 bg-white text-black h-10 w-10 rounded-full shadow-lg z-10 active:scale-95 transition-transform", children: _jsx(ShoppingCart, { className: "h-4 w-4" }) }), product.compareAtPrice && (_jsx("span", { className: "absolute top-3 left-3 bg-black text-white text-xs font-bold px-3 py-1 rounded-full uppercase tracking-wide", children: getLayoutText(storeConfig, 'common.sale', 'Sale') }))] }), _jsxs("div", { className: "space-y-1", children: [_jsx("h3", { className: "font-semibold text-gray-900 group-hover:text-gray-600 transition-colors text-lg", children: product.name }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "font-medium text-gray-900", children: formatCurrency(product.price, product.currency || 'USD') }), product.compareAtPrice && (_jsx("span", { className: "text-sm text-gray-400 line-through", children: formatCurrency(product.compareAtPrice, product.currency || 'USD') }))] }), _jsx(ProductRating, { rating: product.rating, reviewCount: product.reviewCount, size: "sm", showReviewCount: false, className: "shrink-0" })] })] }) }, product.id));
258
- }) }), layoutConfig?.sections?.featuredProducts?.showViewAll !== false && (_jsx("div", { className: "mt-16 text-center", children: _jsx(Link, { href: `/${storeConfig.slug}/products`, children: _jsx(Button, { variant: "outline", className: "rounded-full px-10 py-6 border-gray-200 hover:border-black hover:bg-black hover:text-white transition-all text-base font-medium", ...inline('featuredProducts', ['viewAll']), children: getLayoutText(storeConfig, 'sections.featuredProducts.viewAll', 'View All Products') }) }) }))] }) })), _jsx(PromoBanner, { config: layoutConfig?.sections?.marketing?.promoBanner
259
- ? {
260
- show: layoutConfig.sections.marketing.promoBanner.show ?? false,
261
- image: layoutConfig.sections.marketing.promoBanner.image,
262
- title: layoutConfig.sections.marketing.promoBanner.title,
263
- subtitle: layoutConfig.sections.marketing.promoBanner.subtitle,
264
- buttonText: layoutConfig.sections.marketing.promoBanner.buttonText,
265
- buttonLink: layoutConfig.sections.marketing.promoBanner.buttonLink,
266
- }
267
- : undefined, storeSlug: storeConfig.slug, layoutStyle: "clothing", sectionKey: "promoBanner", page: "home", className: "container mx-auto max-w-7xl" })] }));
267
+ return (_jsxs(Link, { href: `/${storeConfig.slug}/categories/${category.slug}`, className: `group relative overflow-hidden rounded-2xl aspect-[3/4]`, children: [_jsxs("div", { className: "absolute inset-0 bg-gray-200", children: [_jsx(ImageWithFallback, { src: categoryImage, alt: category.name, className: "w-full h-full object-cover transition-transform duration-700 group-hover:scale-110", skeletonAspectRatio: "auto", lazy: true }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/70 via-black/20 to-transparent opacity-80 group-hover:opacity-70 transition-opacity" })] }), _jsxs("div", { className: "absolute inset-0 flex flex-col justify-end p-8", children: [_jsx("h3", { className: "text-2xl font-bold text-white mb-2 transform translate-y-0 transition-transform duration-300", children: category.name }), _jsx("div", { className: "h-0.5 w-12 bg-white/0 group-hover:bg-white/100 transition-all duration-500 mb-4" }), _jsxs("span", { className: "inline-flex items-center text-white text-sm font-medium opacity-0 group-hover:opacity-100 transform translate-y-4 group-hover:translate-y-0 transition-all duration-300", children: [getLayoutText(storeConfig, 'common.shopNow', 'Shop Now'), " ", _jsx(ArrowRight, { className: "ml-2 h-4 w-4" })] })] })] }, category.id));
268
+ }) })] }) })), layoutConfig?.sections?.marketing?.editorial?.show !== false && (_jsx("section", { "data-section": "editorial", className: "py-16 md:py-24 px-4 sm:px-6 lg:px-8 bg-stone-50", children: _jsx("div", { className: "container mx-auto max-w-7xl", children: _jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-10 md:gap-12 lg:gap-20 items-center", children: [_jsxs("div", { className: "relative", children: [_jsx("div", { className: "aspect-[4/5] rounded-lg overflow-hidden relative", children: _jsx(ImageWithFallback, { src: layoutConfig?.sections?.marketing?.editorial?.image || 'https://images.unsplash.com/photo-1490481651871-ab68de25d43d?q=80&w=2000&auto=format&fit=crop', alt: "Editorial Lookbook", className: "w-full h-full object-cover", skeletonAspectRatio: "4/5", lazy: true }) }), (layoutConfig?.sections?.marketing?.editorial?.detailImage) && (_jsx("div", { className: "absolute w-48 h-48 bg-white p-4 shadow-xl rounded-lg hidden md:block z-20 animate-fade-in-up", style: { bottom: '-2rem', right: '-2rem', animationDelay: '0.2s' }, children: _jsx("div", { className: "w-full h-full relative", children: _jsx(ImageWithFallback, { src: layoutConfig.sections.marketing.editorial.detailImage, alt: "Detail Shot", className: "w-full h-full object-cover rounded", skeletonAspectRatio: "square", lazy: true }) }) }))] }), _jsxs("div", { className: "space-y-8", children: [_jsx("div", { className: "flex flex-col gap-2", children: _jsx("span", { className: "text-sm font-bold tracking-widest text-gray-500 uppercase", children: layoutConfig?.sections?.marketing?.editorial?.badgeText || "Lookbook" }) }), _jsx("h2", { className: "text-4xl md:text-5xl font-bold tracking-tight leading-tight text-gray-900", children: layoutConfig?.sections?.marketing?.editorial?.title ? (layoutConfig.sections.marketing.editorial.title.split('\n').map((line, idx, arr) => (_jsxs("span", { children: [line, idx < arr.length - 1 && _jsx("br", {})] }, idx)))) : (_jsxs(_Fragment, { children: ["Redefining Modern ", _jsx("br", {}), _jsx("span", { className: "italic font-serif", children: "Elegance" })] })) }), _jsx("p", { className: "text-lg text-gray-600 leading-relaxed", children: layoutConfig?.sections?.marketing?.editorial?.description || "Explore our latest editorial featuring timeless pieces crafted for the contemporary wardrobe. From essential basics to statement outwear, find your signature look." }), _jsxs("div", { className: "flex flex-col sm:flex-row gap-4 pt-4", children: [layoutConfig?.sections?.marketing?.editorial?.primaryButton?.text && (_jsx(Link, { href: toStoreHref(storeConfig.slug, layoutConfig.sections.marketing.editorial.primaryButton.link, '/style-guide'), children: _jsx(Button, { className: "rounded-full px-8 py-6 bg-gray-900 hover:bg-black text-white transition-all", children: layoutConfig.sections.marketing.editorial.primaryButton.text }) })), layoutConfig?.sections?.marketing?.editorial?.secondaryButton?.text && (_jsx(Link, { href: toStoreHref(storeConfig.slug, layoutConfig.sections.marketing.editorial.secondaryButton.link, '/about'), children: _jsx(Button, { variant: "outline", className: "rounded-full px-8 py-6 border-gray-300 hover:bg-white hover:border-gray-900 transition-all", children: layoutConfig.sections.marketing.editorial.secondaryButton.text }) }))] })] })] }) }) })), layoutConfig?.sections?.featuredProducts?.show !== false && (_jsx("section", { "data-section": "featuredProducts", className: "py-16 md:py-24 px-4 sm:px-6 lg:px-8 bg-white", children: _jsxs("div", { className: "container mx-auto max-w-7xl", children: [_jsxs("div", { className: "text-center max-w-2xl mx-auto mb-10 md:mb-16", children: [_jsx("span", { className: "text-sm font-bold tracking-widest text-gray-500 uppercase mb-3 block", children: layoutConfig?.sections?.featuredProducts?.eyebrow || "Curated For You" }), _jsx("h2", { className: "text-3xl md:text-4xl font-bold mb-4 tracking-tight", children: layoutConfig?.sections?.featuredProducts?.title || getLayoutText(storeConfig, 'sections.featuredProducts.title', 'Trending Now') }), _jsx("div", { className: "h-1 w-20 bg-gray-900 mx-auto mb-6" }), _jsx("p", { className: "text-gray-600 text-lg", children: getLayoutText(storeConfig, 'sections.featuredProducts.subtitle', 'Discover the latest trends and essential pieces that define this season\'s style.') })] }), _jsx("div", { className: "grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-4 gap-4 sm:gap-8", children: products.slice(0, 4).map((product) => {
269
+ // Comprehensive image extraction - handles all formats
270
+ const extractProductImages = (images) => {
271
+ if (!images)
272
+ return [];
273
+ // If already an array of strings, validate and return
274
+ if (Array.isArray(images)) {
275
+ const firstItem = images[0];
276
+ if (typeof firstItem === 'string') {
277
+ return images
278
+ .filter((img) => typeof img === 'string' && img.trim().length > 0)
279
+ .map((img) => img.trim());
280
+ }
281
+ // If array of objects, extract URLs
282
+ if (firstItem && typeof firstItem === 'object' && firstItem !== null) {
283
+ const result = [];
284
+ for (const item of images) {
285
+ if (!item)
286
+ continue;
287
+ if (typeof item === 'object' && item !== null) {
288
+ // Check for url property
289
+ if ('url' in item && item.url) {
290
+ const url = typeof item.url === 'string' ? item.url.trim() : String(item.url).trim();
291
+ if (url.length > 0) {
292
+ result.push(url);
293
+ }
294
+ }
295
+ // Check for nested url
296
+ else if (item.url && typeof item.url === 'object' && 'url' in item.url) {
297
+ const url = typeof item.url.url === 'string' ? item.url.url.trim() : String(item.url.url).trim();
298
+ if (url.length > 0) {
299
+ result.push(url);
300
+ }
301
+ }
302
+ }
303
+ else if (typeof item === 'string') {
304
+ const trimmed = item.trim();
305
+ if (trimmed.length > 0) {
306
+ result.push(trimmed);
307
+ }
308
+ }
309
+ }
310
+ return result;
311
+ }
312
+ }
313
+ // Handle single object
314
+ if (typeof images === 'object' && images !== null && !Array.isArray(images)) {
315
+ if ('url' in images && images.url) {
316
+ const url = typeof images.url === 'string' ? images.url.trim() : String(images.url).trim();
317
+ return url.length > 0 ? [url] : [];
318
+ }
319
+ }
320
+ // Handle single string
321
+ if (typeof images === 'string') {
322
+ const trimmed = images.trim();
323
+ return trimmed.length > 0 ? [trimmed] : [];
324
+ }
325
+ return [];
326
+ };
327
+ const validImages = extractProductImages(product.images);
328
+ const firstImage = validImages.length > 0 ? validImages[0] : undefined;
329
+ return (_jsx("div", { className: "group", children: _jsxs(Link, { href: `/${storeConfig.slug}/products/${product.slug}`, children: [_jsxs("div", { className: "relative aspect-[3/4] bg-gray-50 rounded-xl overflow-hidden mb-4", children: [_jsx(ImageWithFallback, { src: firstImage, alt: product.name, className: "w-full h-full object-cover transition-transform duration-700 group-hover:scale-105", skeletonAspectRatio: "3/4", lazy: true }), validImages[1] && (_jsx(ImageWithFallback, { src: validImages[1], alt: product.name, className: "absolute inset-0 w-full h-full object-cover opacity-0 group-hover:opacity-100 transition-opacity duration-500", skeletonAspectRatio: "3/4", lazy: true })), _jsxs("div", { className: "hidden lg:flex absolute bottom-4 right-4 flex-col gap-2 opacity-0 transform translate-x-4 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-300", children: [storeConfig.features.wishlist && (_jsx(Button, { variant: "secondary", size: "icon", className: "bg-white hover:bg-black hover:text-white shadow-md rounded-full transition-colors", children: _jsx(Heart, { className: "h-4 w-4" }) })), _jsx(Button, { variant: "secondary", size: "icon", className: "bg-white hover:bg-black hover:text-white shadow-md rounded-full transition-colors", children: _jsx(ShoppingCart, { className: "h-4 w-4" }) })] }), _jsx(Button, { variant: "secondary", size: "icon", className: "lg:hidden absolute bottom-3 right-3 bg-white text-black h-10 w-10 rounded-full shadow-lg z-10 active:scale-95 transition-transform", children: _jsx(ShoppingCart, { className: "h-4 w-4" }) }), product.compareAtPrice && (_jsx("span", { className: "absolute top-3 left-3 bg-black text-white text-xs font-bold px-3 py-1 rounded-full uppercase tracking-wide", children: getLayoutText(storeConfig, 'common.sale', 'Sale') }))] }), _jsxs("div", { className: "space-y-1", children: [_jsx("h3", { className: "font-semibold text-gray-900 group-hover:text-gray-600 transition-colors text-lg", children: product.name }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "font-medium text-gray-900", children: formatCurrency(product.price, product.currency || 'USD') }), product.compareAtPrice && (_jsx("span", { className: "text-sm text-gray-400 line-through", children: formatCurrency(product.compareAtPrice, product.currency || 'USD') }))] }), _jsx(ProductRating, { rating: product.rating, reviewCount: product.reviewCount, size: "sm", showReviewCount: false, className: "shrink-0" })] })] }) }, product.id));
330
+ }) }), layoutConfig?.sections?.featuredProducts?.showViewAll !== false && (_jsx("div", { className: "mt-16 text-center", children: _jsx(Link, { href: `/${storeConfig.slug}/products`, children: _jsx(Button, { variant: "outline", className: "rounded-full px-10 py-6 border-gray-200 hover:border-black hover:bg-black hover:text-white transition-all text-base font-medium", children: getLayoutText(storeConfig, 'sections.featuredProducts.viewAll', 'View All Products') }) }) }))] }) }))] }));
268
331
  }
@@ -1,8 +1,8 @@
1
1
  // Fashion Hub (clothing) layout — fully sandboxed exports (see ClothingLayout + styles/clothing.css)
2
- export { ClothingHomePage } from './components/ClothingHomePage.js';
3
- export { ClothingProductsPage } from './pages/ProductsPage.js';
4
- export { ClothingProductDetailPage } from './pages/ProductDetailPage.js';
5
- export { ClothingCategoryPage } from './pages/CategoryPage.js';
6
- export { ClothingCategoriesPage } from './pages/CategoriesPage.js';
7
- export { ClothingAboutPage } from './pages/AboutPage.js';
8
- export { ClothingContactPage } from './pages/ContactPage.js';
2
+ export { ClothingHomePage } from './components/ClothingHomePage';
3
+ export { ClothingProductsPage } from './pages/ProductsPage';
4
+ export { ClothingProductDetailPage } from './pages/ProductDetailPage';
5
+ export { ClothingCategoryPage } from './pages/CategoryPage';
6
+ export { ClothingCategoriesPage } from './pages/CategoriesPage';
7
+ export { ClothingAboutPage } from './pages/AboutPage';
8
+ export { ClothingContactPage } from './pages/ContactPage';