@fayz-ai/storefront 0.9.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. package/README.md +3 -3
  2. package/dist/app/createStorefrontApp.d.ts +65 -0
  3. package/dist/app/createStorefrontApp.d.ts.map +1 -0
  4. package/dist/{define.d.ts → app/define.d.ts} +3 -3
  5. package/dist/app/define.d.ts.map +1 -0
  6. package/dist/app/hydration.d.ts +37 -0
  7. package/dist/app/hydration.d.ts.map +1 -0
  8. package/dist/app/prerender.d.ts +57 -0
  9. package/dist/app/prerender.d.ts.map +1 -0
  10. package/dist/{router.d.ts → app/router.d.ts} +140 -113
  11. package/dist/app/router.d.ts.map +1 -0
  12. package/dist/{scaffold.d.ts → app/scaffold.d.ts} +2 -2
  13. package/dist/app/scaffold.d.ts.map +1 -0
  14. package/dist/app/serving.d.ts +70 -0
  15. package/dist/app/serving.d.ts.map +1 -0
  16. package/dist/app/static-render.d.ts +46 -0
  17. package/dist/app/static-render.d.ts.map +1 -0
  18. package/dist/blocks/block-at-path.d.ts +59 -0
  19. package/dist/blocks/block-at-path.d.ts.map +1 -0
  20. package/dist/blocks/page-blocks.d.ts +163 -0
  21. package/dist/blocks/page-blocks.d.ts.map +1 -0
  22. package/dist/blocks/page-data.d.ts +105 -0
  23. package/dist/blocks/page-data.d.ts.map +1 -0
  24. package/dist/{blocks.d.ts → blocks/registry.d.ts} +1 -1
  25. package/dist/blocks/registry.d.ts.map +1 -0
  26. package/dist/{sections.d.ts → blocks/sections.d.ts} +40 -2
  27. package/dist/blocks/sections.d.ts.map +1 -0
  28. package/dist/chunk-6IXTENLB.js +162 -0
  29. package/dist/chunk-6IXTENLB.js.map +1 -0
  30. package/dist/chunk-SX3J3QIT.js +11046 -0
  31. package/dist/chunk-SX3J3QIT.js.map +1 -0
  32. package/dist/components/PaymentTerms.d.ts +34 -0
  33. package/dist/components/PaymentTerms.d.ts.map +1 -0
  34. package/dist/components/Skeleton.d.ts +17 -0
  35. package/dist/components/Skeleton.d.ts.map +1 -0
  36. package/dist/components/SmoothImage.d.ts +1 -1
  37. package/dist/components/SmoothImage.d.ts.map +1 -1
  38. package/dist/components/account/CustomerAccountShell.d.ts +17 -0
  39. package/dist/components/account/CustomerAccountShell.d.ts.map +1 -0
  40. package/dist/components/account/SignInModal.d.ts.map +1 -0
  41. package/dist/components/account/section.d.ts +15 -0
  42. package/dist/components/account/section.d.ts.map +1 -0
  43. package/dist/components/cart/CartDrawer.d.ts.map +1 -0
  44. package/dist/components/cart/QuantityInput.d.ts.map +1 -0
  45. package/dist/components/checkout/CheckoutPayment.d.ts +17 -0
  46. package/dist/components/checkout/CheckoutPayment.d.ts.map +1 -0
  47. package/dist/components/checkout/CheckoutSteps.d.ts +9 -0
  48. package/dist/components/checkout/CheckoutSteps.d.ts.map +1 -0
  49. package/dist/components/checkout/DeliveryEstimator.d.ts.map +1 -0
  50. package/dist/components/collection/CategoryShowcase.d.ts +44 -0
  51. package/dist/components/collection/CategoryShowcase.d.ts.map +1 -0
  52. package/dist/components/collection/FiltersPanel.d.ts +19 -0
  53. package/dist/components/collection/FiltersPanel.d.ts.map +1 -0
  54. package/dist/components/collection/ProductGrid.d.ts.map +1 -0
  55. package/dist/components/layout/PageBodyBlocks.d.ts +40 -0
  56. package/dist/components/layout/PageBodyBlocks.d.ts.map +1 -0
  57. package/dist/components/layout/SearchOverlay.d.ts +13 -0
  58. package/dist/components/layout/SearchOverlay.d.ts.map +1 -0
  59. package/dist/components/layout/StorefrontErrorBoundary.d.ts.map +1 -0
  60. package/dist/components/layout/StorefrontFooter.d.ts.map +1 -0
  61. package/dist/components/layout/StorefrontHeader.d.ts.map +1 -0
  62. package/dist/components/layout/Toaster.d.ts.map +1 -0
  63. package/dist/components/marketing/CollectionSections.d.ts +463 -0
  64. package/dist/components/marketing/CollectionSections.d.ts.map +1 -0
  65. package/dist/components/marketing/ConversionSections.d.ts +221 -0
  66. package/dist/components/marketing/ConversionSections.d.ts.map +1 -0
  67. package/dist/components/marketing/EditorialSections.d.ts +248 -0
  68. package/dist/components/marketing/EditorialSections.d.ts.map +1 -0
  69. package/dist/components/marketing/EntityList.d.ts +97 -0
  70. package/dist/components/marketing/EntityList.d.ts.map +1 -0
  71. package/dist/components/marketing/FormBlock.d.ts +167 -0
  72. package/dist/components/marketing/FormBlock.d.ts.map +1 -0
  73. package/dist/components/marketing/HeroSection.d.ts +125 -0
  74. package/dist/components/marketing/HeroSection.d.ts.map +1 -0
  75. package/dist/components/marketing/MediaCarousel.d.ts +135 -0
  76. package/dist/components/marketing/MediaCarousel.d.ts.map +1 -0
  77. package/dist/components/marketing/MiscSections.d.ts +252 -0
  78. package/dist/components/marketing/MiscSections.d.ts.map +1 -0
  79. package/dist/components/order/OrderTrackingTimeline.d.ts.map +1 -0
  80. package/dist/components/order/SuccessMark.d.ts +10 -0
  81. package/dist/components/order/SuccessMark.d.ts.map +1 -0
  82. package/dist/components/product/ProductCard.d.ts +14 -0
  83. package/dist/components/product/ProductCard.d.ts.map +1 -0
  84. package/dist/components/product/ProductEnquiryForm.d.ts.map +1 -0
  85. package/dist/components/product/ProductGallery.d.ts +36 -0
  86. package/dist/components/product/ProductGallery.d.ts.map +1 -0
  87. package/dist/components/{ProductOptionSelector.d.ts → product/ProductOptionSelector.d.ts} +1 -1
  88. package/dist/components/product/ProductOptionSelector.d.ts.map +1 -0
  89. package/dist/components/product/ProductRail.d.ts +93 -0
  90. package/dist/components/product/ProductRail.d.ts.map +1 -0
  91. package/dist/components/product/ProductReviews.d.ts +39 -0
  92. package/dist/components/product/ProductReviews.d.ts.map +1 -0
  93. package/dist/components/product/ProductSlider.d.ts +169 -0
  94. package/dist/components/product/ProductSlider.d.ts.map +1 -0
  95. package/dist/components/product/ProductSpecs.d.ts.map +1 -0
  96. package/dist/components/product/RelatedProducts.d.ts.map +1 -0
  97. package/dist/{auth.d.ts → data/auth.d.ts} +9 -0
  98. package/dist/data/auth.d.ts.map +1 -0
  99. package/dist/data/facets.d.ts +39 -0
  100. package/dist/data/facets.d.ts.map +1 -0
  101. package/dist/data/loaders.d.ts +52 -0
  102. package/dist/data/loaders.d.ts.map +1 -0
  103. package/dist/data/local-orders.d.ts +5 -0
  104. package/dist/data/local-orders.d.ts.map +1 -0
  105. package/dist/data/order-status.d.ts.map +1 -0
  106. package/dist/data/product-options.d.ts +36 -0
  107. package/dist/data/product-options.d.ts.map +1 -0
  108. package/dist/data/shipping-items.d.ts +20 -0
  109. package/dist/data/shipping-items.d.ts.map +1 -0
  110. package/dist/diagnostics/seo-audit.d.ts +54 -0
  111. package/dist/diagnostics/seo-audit.d.ts.map +1 -0
  112. package/dist/diagnostics/seo-audit.js +3 -0
  113. package/dist/diagnostics/seo-audit.js.map +1 -0
  114. package/dist/document/change.d.ts +100 -0
  115. package/dist/document/change.d.ts.map +1 -0
  116. package/dist/document/config.d.ts +311 -0
  117. package/dist/document/config.d.ts.map +1 -0
  118. package/dist/document/describe.d.ts +135 -0
  119. package/dist/document/describe.d.ts.map +1 -0
  120. package/dist/document/overlay.d.ts +58 -0
  121. package/dist/document/overlay.d.ts.map +1 -0
  122. package/dist/{presets.d.ts → document/presets.d.ts} +2 -2
  123. package/dist/document/presets.d.ts.map +1 -0
  124. package/dist/document/render.d.ts +171 -0
  125. package/dist/document/render.d.ts.map +1 -0
  126. package/dist/document/round-trip.d.ts +46 -0
  127. package/dist/document/round-trip.d.ts.map +1 -0
  128. package/dist/document/sections.d.ts +194 -0
  129. package/dist/document/sections.d.ts.map +1 -0
  130. package/dist/document/store-policy.d.ts +29 -0
  131. package/dist/document/store-policy.d.ts.map +1 -0
  132. package/dist/document/upgrade.d.ts +112 -0
  133. package/dist/document/upgrade.d.ts.map +1 -0
  134. package/dist/document/validate.d.ts +24 -0
  135. package/dist/document/validate.d.ts.map +1 -0
  136. package/dist/{component-contracts.d.ts → extend/component-contracts.d.ts} +74 -22
  137. package/dist/extend/component-contracts.d.ts.map +1 -0
  138. package/dist/extend/component-override.d.ts +38 -0
  139. package/dist/extend/component-override.d.ts.map +1 -0
  140. package/dist/extend/component-selectors.d.ts.map +1 -0
  141. package/dist/extend/editor-bridge.d.ts +59 -0
  142. package/dist/extend/editor-bridge.d.ts.map +1 -0
  143. package/dist/extend/extension-points.d.ts +103 -0
  144. package/dist/extend/extension-points.d.ts.map +1 -0
  145. package/dist/extend/slots.d.ts +216 -0
  146. package/dist/extend/slots.d.ts.map +1 -0
  147. package/dist/hooks/index.d.ts +25 -6
  148. package/dist/hooks/index.d.ts.map +1 -1
  149. package/dist/hooks/use-address.d.ts +26 -0
  150. package/dist/hooks/use-address.d.ts.map +1 -0
  151. package/dist/hooks/use-cart.d.ts +3 -0
  152. package/dist/hooks/use-cart.d.ts.map +1 -0
  153. package/dist/hooks/use-catalog.d.ts +24 -0
  154. package/dist/hooks/use-catalog.d.ts.map +1 -0
  155. package/dist/hooks/use-categories.d.ts +19 -0
  156. package/dist/hooks/use-categories.d.ts.map +1 -0
  157. package/dist/hooks/use-checkout.d.ts +41 -0
  158. package/dist/hooks/use-checkout.d.ts.map +1 -0
  159. package/dist/hooks/use-discount-validator.d.ts +20 -0
  160. package/dist/hooks/use-discount-validator.d.ts.map +1 -0
  161. package/dist/hooks/use-enquiry.d.ts +7 -0
  162. package/dist/hooks/use-enquiry.d.ts.map +1 -0
  163. package/dist/hooks/{useMyOrders.d.ts → use-my-orders.d.ts} +1 -1
  164. package/dist/hooks/use-my-orders.d.ts.map +1 -0
  165. package/dist/hooks/use-order.d.ts +17 -0
  166. package/dist/hooks/use-order.d.ts.map +1 -0
  167. package/dist/hooks/use-payment-methods.d.ts +19 -0
  168. package/dist/hooks/use-payment-methods.d.ts.map +1 -0
  169. package/dist/hooks/use-policies.d.ts +25 -0
  170. package/dist/hooks/use-policies.d.ts.map +1 -0
  171. package/dist/hooks/use-product.d.ts +15 -0
  172. package/dist/hooks/use-product.d.ts.map +1 -0
  173. package/dist/hooks/{useProducts.d.ts → use-products.d.ts} +1 -1
  174. package/dist/hooks/use-products.d.ts.map +1 -0
  175. package/dist/hooks/use-region.d.ts +15 -0
  176. package/dist/hooks/use-region.d.ts.map +1 -0
  177. package/dist/hooks/use-shipping.d.ts +32 -0
  178. package/dist/hooks/use-shipping.d.ts.map +1 -0
  179. package/dist/hooks/use-storefront-actions.d.ts +12 -0
  180. package/dist/hooks/use-storefront-actions.d.ts.map +1 -0
  181. package/dist/hooks/use-storefront-head.d.ts +19 -0
  182. package/dist/hooks/use-storefront-head.d.ts.map +1 -0
  183. package/dist/hooks/use-storefront.d.ts +3 -0
  184. package/dist/hooks/use-storefront.d.ts.map +1 -0
  185. package/dist/index.d.ts +124 -54
  186. package/dist/index.d.ts.map +1 -1
  187. package/dist/index.js +1310 -5010
  188. package/dist/index.js.map +1 -1
  189. package/dist/lib/errors.d.ts +9 -0
  190. package/dist/lib/errors.d.ts.map +1 -0
  191. package/dist/lib/format.d.ts.map +1 -0
  192. package/dist/lib/motion.d.ts.map +1 -0
  193. package/dist/lib/seo.d.ts +26 -0
  194. package/dist/lib/seo.d.ts.map +1 -0
  195. package/dist/{testids.d.ts → lib/testids.d.ts} +33 -0
  196. package/dist/lib/testids.d.ts.map +1 -0
  197. package/dist/{theme.d.ts → lib/theme.d.ts} +41 -3
  198. package/dist/lib/theme.d.ts.map +1 -0
  199. package/dist/render.d.ts +5 -0
  200. package/dist/render.d.ts.map +1 -0
  201. package/dist/render.js +359 -0
  202. package/dist/render.js.map +1 -0
  203. package/dist/stores/cart.store.d.ts +34 -2
  204. package/dist/stores/cart.store.d.ts.map +1 -1
  205. package/dist/stores/catalog.store.d.ts +11 -0
  206. package/dist/stores/catalog.store.d.ts.map +1 -1
  207. package/dist/stores/delivery.store.d.ts +9 -0
  208. package/dist/stores/delivery.store.d.ts.map +1 -1
  209. package/dist/views/CatalogPage.d.ts.map +1 -0
  210. package/dist/views/CheckoutPage.d.ts.map +1 -0
  211. package/dist/views/ContentPage.d.ts +11 -0
  212. package/dist/views/ContentPage.d.ts.map +1 -0
  213. package/dist/views/HomePage.d.ts +9 -0
  214. package/dist/views/HomePage.d.ts.map +1 -0
  215. package/dist/views/MyPurchasesPage.d.ts.map +1 -0
  216. package/dist/views/NotFoundPage.d.ts.map +1 -0
  217. package/dist/views/OrderConfirmationPage.d.ts.map +1 -0
  218. package/dist/{pages → views}/PolicyPage.d.ts.map +1 -1
  219. package/dist/views/ProductDetailPage.d.ts.map +1 -0
  220. package/dist/views/StorefrontPage.d.ts +35 -0
  221. package/dist/views/StorefrontPage.d.ts.map +1 -0
  222. package/dist/workflows/checkout.d.ts +1 -1
  223. package/dist/workflows/checkout.d.ts.map +1 -1
  224. package/package.json +21 -14
  225. package/dist/auth.d.ts.map +0 -1
  226. package/dist/blocks.d.ts.map +0 -1
  227. package/dist/component-contracts.d.ts.map +0 -1
  228. package/dist/component-selectors.d.ts.map +0 -1
  229. package/dist/components/CartDrawer.d.ts.map +0 -1
  230. package/dist/components/CustomerAccountShell.d.ts +0 -13
  231. package/dist/components/CustomerAccountShell.d.ts.map +0 -1
  232. package/dist/components/DeliveryEstimator.d.ts.map +0 -1
  233. package/dist/components/FiltersPanel.d.ts +0 -3
  234. package/dist/components/FiltersPanel.d.ts.map +0 -1
  235. package/dist/components/OrderTrackingTimeline.d.ts.map +0 -1
  236. package/dist/components/ProductCard.d.ts +0 -4
  237. package/dist/components/ProductCard.d.ts.map +0 -1
  238. package/dist/components/ProductEnquiryForm.d.ts.map +0 -1
  239. package/dist/components/ProductGallery.d.ts +0 -22
  240. package/dist/components/ProductGallery.d.ts.map +0 -1
  241. package/dist/components/ProductGrid.d.ts.map +0 -1
  242. package/dist/components/ProductOptionSelector.d.ts.map +0 -1
  243. package/dist/components/ProductSpecs.d.ts.map +0 -1
  244. package/dist/components/QuantityInput.d.ts.map +0 -1
  245. package/dist/components/RelatedProducts.d.ts.map +0 -1
  246. package/dist/components/SignInModal.d.ts.map +0 -1
  247. package/dist/components/StorefrontErrorBoundary.d.ts.map +0 -1
  248. package/dist/components/StorefrontFooter.d.ts.map +0 -1
  249. package/dist/components/StorefrontHeader.d.ts.map +0 -1
  250. package/dist/components/Toaster.d.ts.map +0 -1
  251. package/dist/components/sections/CategoryShowcase.d.ts +0 -6
  252. package/dist/components/sections/CategoryShowcase.d.ts.map +0 -1
  253. package/dist/components/sections/HeroSection.d.ts +0 -9
  254. package/dist/components/sections/HeroSection.d.ts.map +0 -1
  255. package/dist/components/sections/MediaCarousel.d.ts +0 -11
  256. package/dist/components/sections/MediaCarousel.d.ts.map +0 -1
  257. package/dist/components/sections/MiscSections.d.ts +0 -33
  258. package/dist/components/sections/MiscSections.d.ts.map +0 -1
  259. package/dist/components/sections/ProductRail.d.ts +0 -9
  260. package/dist/components/sections/ProductRail.d.ts.map +0 -1
  261. package/dist/components/sections/ProductSlider.d.ts +0 -15
  262. package/dist/components/sections/ProductSlider.d.ts.map +0 -1
  263. package/dist/config.d.ts +0 -174
  264. package/dist/config.d.ts.map +0 -1
  265. package/dist/createStorefrontApp.d.ts +0 -28
  266. package/dist/createStorefrontApp.d.ts.map +0 -1
  267. package/dist/define.d.ts.map +0 -1
  268. package/dist/format.d.ts.map +0 -1
  269. package/dist/hooks/useCategories.d.ts +0 -6
  270. package/dist/hooks/useCategories.d.ts.map +0 -1
  271. package/dist/hooks/useDiscountValidator.d.ts +0 -14
  272. package/dist/hooks/useDiscountValidator.d.ts.map +0 -1
  273. package/dist/hooks/useMyOrders.d.ts.map +0 -1
  274. package/dist/hooks/useProduct.d.ts +0 -7
  275. package/dist/hooks/useProduct.d.ts.map +0 -1
  276. package/dist/hooks/useProducts.d.ts.map +0 -1
  277. package/dist/hooks/useStorefront.d.ts +0 -35
  278. package/dist/hooks/useStorefront.d.ts.map +0 -1
  279. package/dist/hooks/useStorefrontHead.d.ts +0 -11
  280. package/dist/hooks/useStorefrontHead.d.ts.map +0 -1
  281. package/dist/motion.d.ts.map +0 -1
  282. package/dist/order-status.d.ts.map +0 -1
  283. package/dist/pages/CatalogPage.d.ts.map +0 -1
  284. package/dist/pages/CheckoutPage.d.ts.map +0 -1
  285. package/dist/pages/HomePage.d.ts +0 -9
  286. package/dist/pages/HomePage.d.ts.map +0 -1
  287. package/dist/pages/MyPurchasesPage.d.ts.map +0 -1
  288. package/dist/pages/NotFoundPage.d.ts.map +0 -1
  289. package/dist/pages/OrderConfirmationPage.d.ts.map +0 -1
  290. package/dist/pages/ProductDetailPage.d.ts.map +0 -1
  291. package/dist/presets.d.ts.map +0 -1
  292. package/dist/product-options.d.ts +0 -12
  293. package/dist/product-options.d.ts.map +0 -1
  294. package/dist/router.d.ts.map +0 -1
  295. package/dist/scaffold.d.ts.map +0 -1
  296. package/dist/sections.d.ts.map +0 -1
  297. package/dist/testids.d.ts.map +0 -1
  298. package/dist/theme.d.ts.map +0 -1
  299. package/src/auth.ts +0 -227
  300. package/src/blocks.tsx +0 -51
  301. package/src/catalog.ts +0 -3
  302. package/src/component-contracts.ts +0 -154
  303. package/src/component-selectors.ts +0 -31
  304. package/src/components/CartDrawer.tsx +0 -279
  305. package/src/components/CustomerAccountShell.tsx +0 -102
  306. package/src/components/DeliveryEstimator.tsx +0 -157
  307. package/src/components/FiltersPanel.tsx +0 -109
  308. package/src/components/OrderTrackingTimeline.tsx +0 -135
  309. package/src/components/Price.tsx +0 -32
  310. package/src/components/ProductCard.tsx +0 -120
  311. package/src/components/ProductEnquiryForm.tsx +0 -175
  312. package/src/components/ProductGallery.tsx +0 -174
  313. package/src/components/ProductGrid.tsx +0 -43
  314. package/src/components/ProductOptionSelector.tsx +0 -50
  315. package/src/components/ProductSpecs.tsx +0 -75
  316. package/src/components/QuantityInput.tsx +0 -52
  317. package/src/components/RelatedProducts.tsx +0 -40
  318. package/src/components/SignInModal.tsx +0 -120
  319. package/src/components/SmoothImage.tsx +0 -59
  320. package/src/components/StorefrontErrorBoundary.tsx +0 -51
  321. package/src/components/StorefrontFooter.tsx +0 -110
  322. package/src/components/StorefrontHeader.tsx +0 -477
  323. package/src/components/Toaster.tsx +0 -60
  324. package/src/components/sections/CategoryShowcase.tsx +0 -80
  325. package/src/components/sections/HeroSection.tsx +0 -193
  326. package/src/components/sections/MediaCarousel.tsx +0 -141
  327. package/src/components/sections/MiscSections.tsx +0 -158
  328. package/src/components/sections/ProductRail.tsx +0 -81
  329. package/src/components/sections/ProductSlider.tsx +0 -119
  330. package/src/config.ts +0 -229
  331. package/src/createStorefrontApp.tsx +0 -247
  332. package/src/define.ts +0 -34
  333. package/src/format.ts +0 -7
  334. package/src/hooks/index.ts +0 -6
  335. package/src/hooks/useCategories.ts +0 -26
  336. package/src/hooks/useDiscountValidator.ts +0 -43
  337. package/src/hooks/useMyOrders.ts +0 -41
  338. package/src/hooks/useProduct.ts +0 -36
  339. package/src/hooks/useProducts.ts +0 -39
  340. package/src/hooks/useStorefront.ts +0 -58
  341. package/src/hooks/useStorefrontHead.ts +0 -25
  342. package/src/index.ts +0 -202
  343. package/src/motion.tsx +0 -94
  344. package/src/order-status.ts +0 -33
  345. package/src/pages/CatalogPage.tsx +0 -118
  346. package/src/pages/CheckoutPage.tsx +0 -689
  347. package/src/pages/HomePage.tsx +0 -16
  348. package/src/pages/MyPurchasesPage.tsx +0 -311
  349. package/src/pages/NotFoundPage.tsx +0 -25
  350. package/src/pages/OrderConfirmationPage.tsx +0 -190
  351. package/src/pages/PolicyPage.tsx +0 -47
  352. package/src/pages/ProductDetailPage.tsx +0 -264
  353. package/src/presets.ts +0 -324
  354. package/src/product-options.ts +0 -63
  355. package/src/router.ts +0 -49
  356. package/src/scaffold.tsx +0 -115
  357. package/src/sections.ts +0 -116
  358. package/src/shop.ts +0 -4
  359. package/src/stores/cart.store.ts +0 -185
  360. package/src/stores/catalog.store.ts +0 -39
  361. package/src/stores/delivery.store.ts +0 -152
  362. package/src/stores/session.store.ts +0 -28
  363. package/src/stores/toast.store.ts +0 -43
  364. package/src/testids.ts +0 -136
  365. package/src/theme.ts +0 -194
  366. package/src/ui.ts +0 -5
  367. package/src/workflows/checkout.ts +0 -119
  368. /package/dist/components/{SignInModal.d.ts → account/SignInModal.d.ts} +0 -0
  369. /package/dist/components/{CartDrawer.d.ts → cart/CartDrawer.d.ts} +0 -0
  370. /package/dist/components/{QuantityInput.d.ts → cart/QuantityInput.d.ts} +0 -0
  371. /package/dist/components/{DeliveryEstimator.d.ts → checkout/DeliveryEstimator.d.ts} +0 -0
  372. /package/dist/components/{ProductGrid.d.ts → collection/ProductGrid.d.ts} +0 -0
  373. /package/dist/components/{StorefrontErrorBoundary.d.ts → layout/StorefrontErrorBoundary.d.ts} +0 -0
  374. /package/dist/components/{StorefrontFooter.d.ts → layout/StorefrontFooter.d.ts} +0 -0
  375. /package/dist/components/{StorefrontHeader.d.ts → layout/StorefrontHeader.d.ts} +0 -0
  376. /package/dist/components/{Toaster.d.ts → layout/Toaster.d.ts} +0 -0
  377. /package/dist/components/{OrderTrackingTimeline.d.ts → order/OrderTrackingTimeline.d.ts} +0 -0
  378. /package/dist/components/{ProductEnquiryForm.d.ts → product/ProductEnquiryForm.d.ts} +0 -0
  379. /package/dist/components/{ProductSpecs.d.ts → product/ProductSpecs.d.ts} +0 -0
  380. /package/dist/components/{RelatedProducts.d.ts → product/RelatedProducts.d.ts} +0 -0
  381. /package/dist/{order-status.d.ts → data/order-status.d.ts} +0 -0
  382. /package/dist/{component-selectors.d.ts → extend/component-selectors.d.ts} +0 -0
  383. /package/dist/{format.d.ts → lib/format.d.ts} +0 -0
  384. /package/dist/{motion.d.ts → lib/motion.d.ts} +0 -0
  385. /package/dist/{pages → views}/CatalogPage.d.ts +0 -0
  386. /package/dist/{pages → views}/CheckoutPage.d.ts +0 -0
  387. /package/dist/{pages → views}/MyPurchasesPage.d.ts +0 -0
  388. /package/dist/{pages → views}/NotFoundPage.d.ts +0 -0
  389. /package/dist/{pages → views}/OrderConfirmationPage.d.ts +0 -0
  390. /package/dist/{pages → views}/PolicyPage.d.ts +0 -0
  391. /package/dist/{pages → views}/ProductDetailPage.d.ts +0 -0
package/src/auth.ts DELETED
@@ -1,227 +0,0 @@
1
- import type { AuthAdapter, AuthUser } from '@fayz-ai/core'
2
- import {
3
- createAuthRuntime,
4
- createMockAuthAdapter,
5
- type AuthPluginOptions,
6
- } from '@fayz-ai/plugin-auth'
7
- import { getShopProvider } from '@fayz-ai/shop/runtime'
8
- import { setShopAccessTokenResolver } from '@fayz-ai/sdk/shop'
9
- import { useSessionStore } from './stores/session.store'
10
-
11
- // ---------------------------------------------------------------------------
12
- // Customer auth — the SAME AuthAdapter contract createSaasApp uses, so the
13
- // mock and Supabase adapters from @fayz-ai/auth serve both the saas admin and
14
- // the storefront customer. The storefront adds one layer on top: linking the
15
- // auth identity to a ShopCustomer record (find-or-create by email) so orders
16
- // and purchase history attach to a customer.
17
- // ---------------------------------------------------------------------------
18
-
19
- export type StorefrontAuthAdapter = AuthAdapter | 'mock' | 'supabase' | (string & {})
20
-
21
- export interface StorefrontAuthConfig {
22
- adapter?: AuthPluginOptions['adapter']
23
- provider?: AuthPluginOptions['provider']
24
- routes?: AuthPluginOptions['routes']
25
- supabase?: AuthPluginOptions['supabase']
26
- }
27
-
28
- let _adapter: AuthAdapter | null = null
29
-
30
- function isAuthAdapter(value: unknown): value is AuthAdapter {
31
- return Boolean(
32
- value &&
33
- typeof value === 'object' &&
34
- 'getSession' in value &&
35
- 'signIn' in value &&
36
- 'signOut' in value,
37
- )
38
- }
39
-
40
- function normalizeAuthConfig(
41
- configured: StorefrontAuthAdapter | StorefrontAuthConfig | undefined,
42
- ): StorefrontAuthConfig {
43
- if (!configured) return {}
44
- if (typeof configured === 'string' || isAuthAdapter(configured)) return { adapter: configured }
45
- return configured
46
- }
47
-
48
- export function resolveAuthAdapter(
49
- configured: StorefrontAuthAdapter | StorefrontAuthConfig | undefined,
50
- fallback?: { supabaseUrl?: string; supabaseAnonKey?: string },
51
- ): AuthAdapter {
52
- const config = normalizeAuthConfig(configured)
53
- return createAuthRuntime({
54
- provider: config.provider ?? config.adapter ?? (fallback?.supabaseUrl ? 'supabase' : 'mock'),
55
- adapter: config.adapter,
56
- routes: config.routes,
57
- requireAuth: false,
58
- supabase: {
59
- url: config.supabase?.url ?? fallback?.supabaseUrl,
60
- anonKey: config.supabase?.anonKey ?? fallback?.supabaseAnonKey,
61
- client: config.supabase?.client,
62
- callbackUrl: config.supabase?.callbackUrl,
63
- resetPasswordUrl: config.supabase?.resetPasswordUrl,
64
- },
65
- }).adapter
66
- }
67
-
68
- // The shopper's current access token, handed to the shop REST client so its
69
- // requests reach PostgREST as the signed-in user instead of as `anon`. Held
70
- // here rather than in the session store because it is a credential: it must not
71
- // be persisted to localStorage alongside the customer id. The Supabase client
72
- // owns its own refresh; this is only a mirror of the live value.
73
- let _accessToken: string | null = null
74
-
75
- /** Whether an authenticated identity was ever seen this session. Distinguishes
76
- * "signed out" from "was never signed in" — see the onAuthStateChange guard. */
77
- let _hadAuthUser = false
78
-
79
- /** Refresh the mirrored token from the adapter. Safe to call on any event. */
80
- async function syncAccessToken(adapter: AuthAdapter): Promise<void> {
81
- try {
82
- const existing = await adapter.getSession()
83
- _accessToken = existing?.session.accessToken ?? null
84
- } catch {
85
- _accessToken = null
86
- }
87
- }
88
-
89
- /** Called once by createStorefrontApp. Restores any persisted session. */
90
- export function initCustomerAuth(adapter: AuthAdapter): void {
91
- _adapter = adapter
92
-
93
- // Registered before the first await so no request can slip out anonymously
94
- // while the session is still being restored.
95
- setShopAccessTokenResolver(() => _accessToken)
96
-
97
- adapter
98
- .getSession()
99
- .then((existing) => {
100
- _accessToken = existing?.session.accessToken ?? null
101
- if (!existing) return
102
- _hadAuthUser = true
103
- const store = useSessionStore.getState()
104
- // Re-link only when the persisted shop session doesn't match the auth user
105
- if (store.email !== existing.user.email) {
106
- void linkCustomer(existing.user)
107
- }
108
- })
109
- .catch(() => {})
110
-
111
- adapter.onAuthStateChange((user) => {
112
- if (!user) {
113
- _accessToken = null
114
- // Only tear down the shop session if there WAS an authenticated identity
115
- // to lose. The Supabase adapter fires this once on boot with a null user
116
- // (INITIAL_SESSION), and clearing unconditionally wiped the guest's local
117
- // session on every page load — a guest who checked out could no longer
118
- // find their order after a reload. The mock adapter never surfaced this
119
- // because it always restored a session.
120
- if (_hadAuthUser) {
121
- _hadAuthUser = false
122
- useSessionStore.getState().signOut()
123
- }
124
- return
125
- }
126
- _hadAuthUser = true
127
- // Covers token refresh too, not just sign-in: the callback carries the user
128
- // but not the token, and a stale token would 401 every read an hour in.
129
- void syncAccessToken(adapter)
130
- })
131
- }
132
-
133
- export function getCustomerAuthAdapter(): AuthAdapter {
134
- if (!_adapter) _adapter = createMockAuthAdapter()
135
- return _adapter
136
- }
137
-
138
- /** Resolve (find-or-create + server-side auth link) the ShopCustomer for an email. */
139
- async function resolveShopCustomer(email: string, name: string) {
140
- const provider = getShopProvider()
141
- // Preferred: provider.resolveCustomer find-or-creates AND links auth.uid
142
- // server-side (RLS-safe). Falls back to generic CRUD for legacy providers.
143
- if (provider.resolveCustomer) return provider.resolveCustomer({ email, name })
144
- const matches = await provider.listCustomers({ search: email, limit: 10 })
145
- const existing = matches.find((c) => (c.email ?? '').toLowerCase() === email)
146
- if (existing) return existing
147
- const parts = name.trim().split(/\s+/).filter(Boolean)
148
- return provider.createCustomer({
149
- firstName: parts[0] ?? email.split('@')[0] ?? 'Cliente',
150
- lastName: parts.slice(1).join(' '),
151
- email,
152
- })
153
- }
154
-
155
- /** Find-or-create the ShopCustomer for an auth identity and persist the session. */
156
- async function linkCustomer(user: AuthUser, fullName?: string): Promise<{ customerId: string }> {
157
- const email = (user.email ?? '').trim().toLowerCase()
158
- const name = fullName ?? user.fullName ?? ''
159
- const customer = await resolveShopCustomer(email, name)
160
- useSessionStore.getState().setSession({
161
- customerId: customer.id,
162
- email,
163
- name: name || `${customer.firstName} ${customer.lastName}`.trim(),
164
- })
165
- return { customerId: customer.id }
166
- }
167
-
168
- export interface EstablishSessionOptions {
169
- /** Provided → adapter.signIn; omitted → passwordless customer identity via signUp (mock-friendly). */
170
- password?: string
171
- name?: string
172
- }
173
-
174
- /**
175
- * Sign a customer in through the auth adapter and link the ShopCustomer.
176
- * Used by the account page sign-in AND by checkout (so a buyer is signed in
177
- * for "my purchases" immediately after purchase) — one auth path, two doors.
178
- */
179
- export async function establishCustomerSession(
180
- email: string,
181
- opts?: EstablishSessionOptions,
182
- ): Promise<{ customerId: string }> {
183
- const normalized = email.trim().toLowerCase()
184
- if (opts?.password) {
185
- const adapter = getCustomerAuthAdapter()
186
- const session = await adapter.signIn(normalized, opts.password)
187
- // Before linkCustomer, not after: linkCustomer calls shop_resolve_customer,
188
- // which reads auth.uid() to fill auth_user_id. Sent with the old token that
189
- // link silently no-ops and the account stays unlinked forever.
190
- _accessToken = session.accessToken ?? null
191
- _hadAuthUser = true
192
- return linkCustomer(session.user.email ? session.user : { ...session.user, email: normalized }, opts.name)
193
- }
194
- // Guest / passwordless checkout: do NOT create an auth account (that made
195
- // returning guests fail with "user already registered" on Supabase). Just
196
- // resolve the ShopCustomer and persist the local session for order history.
197
- return linkCustomer({ id: '', email: normalized } as AuthUser, opts?.name)
198
- }
199
-
200
- /** Convenience wrapper — passwordless email sign-in (guest checkout path). */
201
- export function signInByEmail(email: string, name?: string): Promise<{ customerId: string }> {
202
- return establishCustomerSession(email, { name })
203
- }
204
-
205
- /** Explicit account creation (account page "Criar conta" form). */
206
- export async function signUpCustomer(
207
- email: string,
208
- password: string,
209
- name: string,
210
- ): Promise<{ customerId: string }> {
211
- const adapter = getCustomerAuthAdapter()
212
- const normalized = email.trim().toLowerCase()
213
- const session = await adapter.signUp(normalized, password, name)
214
- _accessToken = session.accessToken ?? null
215
- _hadAuthUser = true
216
- return linkCustomer(session.user.email ? session.user : { ...session.user, email: normalized }, name)
217
- }
218
-
219
- export async function signOutCustomer(): Promise<void> {
220
- try {
221
- await getCustomerAuthAdapter().signOut()
222
- } finally {
223
- _accessToken = null
224
- _hadAuthUser = false
225
- useSessionStore.getState().signOut()
226
- }
227
- }
package/src/blocks.tsx DELETED
@@ -1,51 +0,0 @@
1
- import { registerBlock } from '@fayz-ai/core'
2
- import type { BlockNode } from '@fayz-ai/core'
3
- import type { StorefrontSection } from './sections'
4
- import { HeroSection } from './components/sections/HeroSection'
5
- import { CategoryShowcase } from './components/sections/CategoryShowcase'
6
- import { ProductRail } from './components/sections/ProductRail'
7
- import { MediaCarousel } from './components/sections/MediaCarousel'
8
- import { ProductSlider } from './components/sections/ProductSlider'
9
- import {
10
- BenefitsRow,
11
- PromoBanner,
12
- ManifestoBlock,
13
- Testimonials,
14
- NewsletterBand,
15
- } from './components/sections/MiscSections'
16
-
17
- // ---------------------------------------------------------------------------
18
- // Storefront blocks — the section components registered into the universal
19
- // block registry. This replaces HomePage's hardcoded switch: a home page is now
20
- // a block tree (`{ type, props }[]`) resolved through the registry, identical
21
- // to how admin pages will compose. Section prop shapes are unchanged, so the
22
- // components are registered directly.
23
- // ---------------------------------------------------------------------------
24
-
25
- let registered = false
26
-
27
- export function registerStorefrontBlocks(): void {
28
- if (registered) return
29
- registered = true
30
- registerBlock('hero', HeroSection, { source: 'sdk', label: 'Hero' })
31
- registerBlock('mediaCarousel', MediaCarousel, { source: 'sdk', label: 'Media carousel' })
32
- registerBlock('categories', CategoryShowcase, { source: 'sdk', label: 'Categories' })
33
- registerBlock('products', ProductRail, { source: 'sdk', label: 'Product rail' })
34
- registerBlock('productSlider', ProductSlider, { source: 'sdk', label: 'Product slider' })
35
- registerBlock('benefits', BenefitsRow, { source: 'sdk', label: 'Benefits row' })
36
- registerBlock('banner', PromoBanner, { source: 'sdk', label: 'Promo banner' })
37
- registerBlock('manifesto', ManifestoBlock, { source: 'sdk', label: 'Manifesto' })
38
- registerBlock('testimonials', Testimonials, { source: 'sdk', label: 'Testimonials' })
39
- registerBlock('newsletter', NewsletterBand, { source: 'sdk', label: 'Newsletter band' })
40
- }
41
-
42
- // Registration happens in initStorefrontRuntime (both the scaffold and
43
- // createStorefront call it) so importing this module stays side-effect-free.
44
-
45
- /** Convert the typed storefront section blueprint into a generic block tree. */
46
- export function sectionsToBlocks(sections: readonly StorefrontSection[]): BlockNode[] {
47
- return sections.map((section, i) => {
48
- const { type, ...props } = section
49
- return { type, id: `${type}-${i}`, props: props as Record<string, unknown> }
50
- })
51
- }
package/src/catalog.ts DELETED
@@ -1,3 +0,0 @@
1
- // Front-door re-export of @fayz-ai/shop/catalog (mock catalog builders/data)
2
- // so storefront apps import from `@fayz-ai/storefront/catalog`.
3
- export * from '@fayz-ai/shop/catalog'
@@ -1,154 +0,0 @@
1
- import type React from 'react'
2
- import type { Category, CreateProductEnquiryInput, Product, ProductEnquiry, ProductImage } from '@fayz-ai/shop/types'
3
- import type { ProductOptionGroup, ProductOptionSelection } from './product-options'
4
- import type { ResolvedStorefrontConfig, StorefrontCommerceMode } from './config'
5
- import type { MediaCarouselItem } from './sections'
6
- import type { CartState } from './stores/cart.store'
7
-
8
- export interface StorefrontComponentBaseProps {
9
- config: ResolvedStorefrontConfig
10
- commerceMode: StorefrontCommerceMode
11
- className?: string
12
- testId?: string
13
- }
14
-
15
- export interface StorefrontActions {
16
- navigateTo: (to: string) => void
17
- addToCart: (product: Product, quantity?: number, options?: ProductOptionSelection) => void
18
- openCart: () => void
19
- closeCart: () => void
20
- createProductEnquiry: (input: CreateProductEnquiryInput) => Promise<ProductEnquiry>
21
- }
22
-
23
- export interface ProductCardProps extends StorefrontComponentBaseProps {
24
- product: Product
25
- actions: Pick<StorefrontActions, 'navigateTo' | 'addToCart' | 'openCart'>
26
- }
27
-
28
- export interface ProductDetailProps extends StorefrontComponentBaseProps {
29
- product: Product
30
- primaryImage?: ProductImage
31
- optionGroups: ProductOptionGroup[]
32
- selectedOptions: ProductOptionSelection
33
- setSelectedOptions: React.Dispatch<React.SetStateAction<ProductOptionSelection>>
34
- quantity: number
35
- setQuantity: React.Dispatch<React.SetStateAction<number>>
36
- soldOut: boolean
37
- lowStock: boolean
38
- actions: Pick<StorefrontActions, 'addToCart' | 'createProductEnquiry' | 'navigateTo'>
39
- addToCart: () => void
40
- openEnquiry: () => void
41
- }
42
-
43
- export interface ProductGalleryProps extends StorefrontComponentBaseProps {
44
- product: Product
45
- images: ProductImage[]
46
- primaryImage?: ProductImage
47
- }
48
-
49
- export interface ProductPriceProps extends StorefrontComponentBaseProps {
50
- product: Product
51
- value: number
52
- compareAt?: number | null
53
- }
54
-
55
- export interface ProductActionsProps extends StorefrontComponentBaseProps {
56
- product: Product
57
- quantity: number
58
- setQuantity: React.Dispatch<React.SetStateAction<number>>
59
- soldOut: boolean
60
- actions: Pick<StorefrontActions, 'addToCart' | 'createProductEnquiry' | 'navigateTo'>
61
- addToCart: () => void
62
- openEnquiry: () => void
63
- }
64
-
65
- export interface ProductEnquiryFormContractProps extends StorefrontComponentBaseProps {
66
- product: Product
67
- onSuccess?: () => void
68
- }
69
-
70
- export interface CategoryCardProps extends StorefrontComponentBaseProps {
71
- category: Category
72
- actions: Pick<StorefrontActions, 'navigateTo'>
73
- }
74
-
75
- export interface CollectionSectionProps extends StorefrontComponentBaseProps {
76
- title: string
77
- subtitle?: string
78
- products: Product[]
79
- category?: Category
80
- children?: React.ReactNode
81
- }
82
-
83
- export interface HeroSectionContractProps extends StorefrontComponentBaseProps {
84
- title: string
85
- subtitle?: string
86
- eyebrow?: string
87
- image?: string
88
- cta?: string
89
- href?: string
90
- children?: React.ReactNode
91
- }
92
-
93
- export interface MediaCarouselProps extends StorefrontComponentBaseProps {
94
- items: MediaCarouselItem[]
95
- height?: 'medium' | 'tall' | 'screen'
96
- autoplayMs?: number
97
- overlay?: 'dark' | 'soft' | 'none'
98
- }
99
-
100
- export interface ProductSliderProps extends StorefrontComponentBaseProps {
101
- title: string
102
- subtitle?: string
103
- eyebrow?: string
104
- filter?: 'sale' | 'new' | 'all'
105
- categoryName?: string
106
- collection?: string
107
- limit?: number
108
- cta?: string
109
- href?: string
110
- }
111
-
112
- export interface StorefrontChromeProps extends StorefrontComponentBaseProps {
113
- children?: React.ReactNode
114
- }
115
-
116
- export interface StorefrontStateProps extends StorefrontComponentBaseProps {
117
- title?: string
118
- message?: string
119
- children?: React.ReactNode
120
- }
121
-
122
- /**
123
- * Extra content rendered inside CartDrawer's footer, right after the
124
- * "Finalizar compra" button — e.g. an alternative checkout path like
125
- * "Finalizar via WhatsApp". Unlike every other entry in
126
- * StorefrontComponents, this isn't a whole-component replacement:
127
- * CartDrawer is always the SDK's own, this only adds optional content
128
- * inside it. Only rendered when the cart has lines (same condition as the
129
- * checkout button itself).
130
- */
131
- export interface CartDrawerFooterExtraProps extends StorefrontComponentBaseProps {
132
- cart: CartState
133
- }
134
-
135
- export interface StorefrontComponents {
136
- ProductCard?: React.ComponentType<ProductCardProps>
137
- ProductDetail?: React.ComponentType<ProductDetailProps>
138
- ProductGallery?: React.ComponentType<ProductGalleryProps>
139
- ProductPrice?: React.ComponentType<ProductPriceProps>
140
- ProductActions?: React.ComponentType<ProductActionsProps>
141
- ProductEnquiryForm?: React.ComponentType<ProductEnquiryFormContractProps>
142
- CategoryCard?: React.ComponentType<CategoryCardProps>
143
- CollectionSection?: React.ComponentType<CollectionSectionProps>
144
- HeroSection?: React.ComponentType<HeroSectionContractProps>
145
- MediaCarousel?: React.ComponentType<MediaCarouselProps>
146
- ProductSlider?: React.ComponentType<ProductSliderProps>
147
- Header?: React.ComponentType<StorefrontChromeProps>
148
- Footer?: React.ComponentType<StorefrontChromeProps>
149
- Shell?: React.ComponentType<StorefrontChromeProps>
150
- EmptyState?: React.ComponentType<StorefrontStateProps>
151
- LoadingState?: React.ComponentType<StorefrontStateProps>
152
- ErrorState?: React.ComponentType<StorefrontStateProps>
153
- CartDrawerFooterExtra?: React.ComponentType<CartDrawerFooterExtraProps>
154
- }
@@ -1,31 +0,0 @@
1
- import { TID } from './testids'
2
-
3
- /**
4
- * Stable selectors that custom storefront components must preserve.
5
- *
6
- * Apps can fully customize the visual tree, but replacement components still
7
- * need these anchors so smoke tests, QA, and agents can operate stores.
8
- */
9
- export const productCardComponentContract = {
10
- root: { 'data-testid': TID.productCard },
11
- name: { 'data-testid': TID.productCardName },
12
- priceTestId: TID.productCardPrice,
13
- addButton: { 'data-testid': TID.productCardAdd },
14
- } as const
15
-
16
- export const storefrontComponentContracts = {
17
- productCard: productCardComponentContract,
18
- productDetail: {
19
- root: { 'data-testid': TID.pdpRoot },
20
- gallery: { 'data-testid': TID.pdpGallery },
21
- name: { 'data-testid': TID.pdpName },
22
- description: { 'data-testid': TID.pdpDescription },
23
- actions: { 'data-testid': TID.pdpActions },
24
- addButton: { 'data-testid': TID.pdpAddToCart },
25
- enquiryButton: { 'data-testid': TID.pdpEnquiryButton },
26
- enquiryForm: { 'data-testid': TID.enquiryForm },
27
- },
28
- } as const
29
-
30
- export type ProductCardComponentContract = typeof productCardComponentContract
31
- export type ProductDetailComponentContract = typeof storefrontComponentContracts.productDetail