@fayz-ai/storefront 0.9.0 → 0.10.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 (368) 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-6B7H3IZ6.js +10232 -0
  29. package/dist/chunk-6B7H3IZ6.js.map +1 -0
  30. package/dist/chunk-6IXTENLB.js +162 -0
  31. package/dist/chunk-6IXTENLB.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/SmoothImage.d.ts +1 -1
  35. package/dist/components/SmoothImage.d.ts.map +1 -1
  36. package/dist/components/account/CustomerAccountShell.d.ts.map +1 -0
  37. package/dist/components/account/SignInModal.d.ts.map +1 -0
  38. package/dist/components/cart/CartDrawer.d.ts.map +1 -0
  39. package/dist/components/cart/QuantityInput.d.ts.map +1 -0
  40. package/dist/components/checkout/DeliveryEstimator.d.ts.map +1 -0
  41. package/dist/components/collection/CategoryShowcase.d.ts +44 -0
  42. package/dist/components/collection/CategoryShowcase.d.ts.map +1 -0
  43. package/dist/components/collection/FiltersPanel.d.ts +19 -0
  44. package/dist/components/collection/FiltersPanel.d.ts.map +1 -0
  45. package/dist/components/collection/ProductGrid.d.ts.map +1 -0
  46. package/dist/components/layout/PageBodyBlocks.d.ts +40 -0
  47. package/dist/components/layout/PageBodyBlocks.d.ts.map +1 -0
  48. package/dist/components/layout/SearchOverlay.d.ts +13 -0
  49. package/dist/components/layout/SearchOverlay.d.ts.map +1 -0
  50. package/dist/components/layout/StorefrontErrorBoundary.d.ts.map +1 -0
  51. package/dist/components/layout/StorefrontFooter.d.ts.map +1 -0
  52. package/dist/components/layout/StorefrontHeader.d.ts.map +1 -0
  53. package/dist/components/layout/Toaster.d.ts.map +1 -0
  54. package/dist/components/marketing/CollectionSections.d.ts +463 -0
  55. package/dist/components/marketing/CollectionSections.d.ts.map +1 -0
  56. package/dist/components/marketing/ConversionSections.d.ts +221 -0
  57. package/dist/components/marketing/ConversionSections.d.ts.map +1 -0
  58. package/dist/components/marketing/EditorialSections.d.ts +248 -0
  59. package/dist/components/marketing/EditorialSections.d.ts.map +1 -0
  60. package/dist/components/marketing/EntityList.d.ts +97 -0
  61. package/dist/components/marketing/EntityList.d.ts.map +1 -0
  62. package/dist/components/marketing/FormBlock.d.ts +167 -0
  63. package/dist/components/marketing/FormBlock.d.ts.map +1 -0
  64. package/dist/components/marketing/HeroSection.d.ts +125 -0
  65. package/dist/components/marketing/HeroSection.d.ts.map +1 -0
  66. package/dist/components/marketing/MediaCarousel.d.ts +135 -0
  67. package/dist/components/marketing/MediaCarousel.d.ts.map +1 -0
  68. package/dist/components/marketing/MiscSections.d.ts +252 -0
  69. package/dist/components/marketing/MiscSections.d.ts.map +1 -0
  70. package/dist/components/order/OrderTrackingTimeline.d.ts.map +1 -0
  71. package/dist/components/product/ProductCard.d.ts +14 -0
  72. package/dist/components/product/ProductCard.d.ts.map +1 -0
  73. package/dist/components/product/ProductEnquiryForm.d.ts.map +1 -0
  74. package/dist/components/product/ProductGallery.d.ts +36 -0
  75. package/dist/components/product/ProductGallery.d.ts.map +1 -0
  76. package/dist/components/{ProductOptionSelector.d.ts → product/ProductOptionSelector.d.ts} +1 -1
  77. package/dist/components/product/ProductOptionSelector.d.ts.map +1 -0
  78. package/dist/components/product/ProductRail.d.ts +93 -0
  79. package/dist/components/product/ProductRail.d.ts.map +1 -0
  80. package/dist/components/product/ProductReviews.d.ts +39 -0
  81. package/dist/components/product/ProductReviews.d.ts.map +1 -0
  82. package/dist/components/product/ProductSlider.d.ts +169 -0
  83. package/dist/components/product/ProductSlider.d.ts.map +1 -0
  84. package/dist/components/product/ProductSpecs.d.ts.map +1 -0
  85. package/dist/components/product/RelatedProducts.d.ts.map +1 -0
  86. package/dist/{auth.d.ts → data/auth.d.ts} +9 -0
  87. package/dist/data/auth.d.ts.map +1 -0
  88. package/dist/data/facets.d.ts +39 -0
  89. package/dist/data/facets.d.ts.map +1 -0
  90. package/dist/data/loaders.d.ts +56 -0
  91. package/dist/data/loaders.d.ts.map +1 -0
  92. package/dist/data/order-status.d.ts.map +1 -0
  93. package/dist/data/product-options.d.ts +36 -0
  94. package/dist/data/product-options.d.ts.map +1 -0
  95. package/dist/diagnostics/seo-audit.d.ts +54 -0
  96. package/dist/diagnostics/seo-audit.d.ts.map +1 -0
  97. package/dist/diagnostics/seo-audit.js +3 -0
  98. package/dist/diagnostics/seo-audit.js.map +1 -0
  99. package/dist/document/change.d.ts +100 -0
  100. package/dist/document/change.d.ts.map +1 -0
  101. package/dist/{config.d.ts → document/config.d.ts} +126 -7
  102. package/dist/document/config.d.ts.map +1 -0
  103. package/dist/document/describe.d.ts +135 -0
  104. package/dist/document/describe.d.ts.map +1 -0
  105. package/dist/document/overlay.d.ts +58 -0
  106. package/dist/document/overlay.d.ts.map +1 -0
  107. package/dist/{presets.d.ts → document/presets.d.ts} +2 -2
  108. package/dist/document/presets.d.ts.map +1 -0
  109. package/dist/document/render.d.ts +171 -0
  110. package/dist/document/render.d.ts.map +1 -0
  111. package/dist/document/round-trip.d.ts +46 -0
  112. package/dist/document/round-trip.d.ts.map +1 -0
  113. package/dist/document/sections.d.ts +194 -0
  114. package/dist/document/sections.d.ts.map +1 -0
  115. package/dist/document/upgrade.d.ts +112 -0
  116. package/dist/document/upgrade.d.ts.map +1 -0
  117. package/dist/document/validate.d.ts +24 -0
  118. package/dist/document/validate.d.ts.map +1 -0
  119. package/dist/{component-contracts.d.ts → extend/component-contracts.d.ts} +74 -22
  120. package/dist/extend/component-contracts.d.ts.map +1 -0
  121. package/dist/extend/component-override.d.ts +38 -0
  122. package/dist/extend/component-override.d.ts.map +1 -0
  123. package/dist/extend/component-selectors.d.ts.map +1 -0
  124. package/dist/extend/editor-bridge.d.ts +59 -0
  125. package/dist/extend/editor-bridge.d.ts.map +1 -0
  126. package/dist/extend/extension-points.d.ts +103 -0
  127. package/dist/extend/extension-points.d.ts.map +1 -0
  128. package/dist/extend/slots.d.ts +216 -0
  129. package/dist/extend/slots.d.ts.map +1 -0
  130. package/dist/hooks/index.d.ts +25 -6
  131. package/dist/hooks/index.d.ts.map +1 -1
  132. package/dist/hooks/use-address.d.ts +26 -0
  133. package/dist/hooks/use-address.d.ts.map +1 -0
  134. package/dist/hooks/use-cart.d.ts +3 -0
  135. package/dist/hooks/use-cart.d.ts.map +1 -0
  136. package/dist/hooks/use-catalog.d.ts +24 -0
  137. package/dist/hooks/use-catalog.d.ts.map +1 -0
  138. package/dist/hooks/use-categories.d.ts +19 -0
  139. package/dist/hooks/use-categories.d.ts.map +1 -0
  140. package/dist/hooks/use-checkout.d.ts +41 -0
  141. package/dist/hooks/use-checkout.d.ts.map +1 -0
  142. package/dist/hooks/use-discount-validator.d.ts +20 -0
  143. package/dist/hooks/use-discount-validator.d.ts.map +1 -0
  144. package/dist/hooks/use-enquiry.d.ts +7 -0
  145. package/dist/hooks/use-enquiry.d.ts.map +1 -0
  146. package/dist/hooks/{useMyOrders.d.ts → use-my-orders.d.ts} +1 -1
  147. package/dist/hooks/use-my-orders.d.ts.map +1 -0
  148. package/dist/hooks/use-order.d.ts +17 -0
  149. package/dist/hooks/use-order.d.ts.map +1 -0
  150. package/dist/hooks/use-payment-methods.d.ts +19 -0
  151. package/dist/hooks/use-payment-methods.d.ts.map +1 -0
  152. package/dist/hooks/use-policies.d.ts +25 -0
  153. package/dist/hooks/use-policies.d.ts.map +1 -0
  154. package/dist/hooks/use-product.d.ts +15 -0
  155. package/dist/hooks/use-product.d.ts.map +1 -0
  156. package/dist/hooks/{useProducts.d.ts → use-products.d.ts} +1 -1
  157. package/dist/hooks/use-products.d.ts.map +1 -0
  158. package/dist/hooks/use-region.d.ts +15 -0
  159. package/dist/hooks/use-region.d.ts.map +1 -0
  160. package/dist/hooks/use-shipping.d.ts +29 -0
  161. package/dist/hooks/use-shipping.d.ts.map +1 -0
  162. package/dist/hooks/use-storefront-actions.d.ts +12 -0
  163. package/dist/hooks/use-storefront-actions.d.ts.map +1 -0
  164. package/dist/hooks/use-storefront-head.d.ts +19 -0
  165. package/dist/hooks/use-storefront-head.d.ts.map +1 -0
  166. package/dist/hooks/use-storefront.d.ts +3 -0
  167. package/dist/hooks/use-storefront.d.ts.map +1 -0
  168. package/dist/index.d.ts +123 -54
  169. package/dist/index.d.ts.map +1 -1
  170. package/dist/index.js +1311 -5012
  171. package/dist/index.js.map +1 -1
  172. package/dist/lib/format.d.ts.map +1 -0
  173. package/dist/lib/motion.d.ts.map +1 -0
  174. package/dist/lib/seo.d.ts +26 -0
  175. package/dist/lib/seo.d.ts.map +1 -0
  176. package/dist/{testids.d.ts → lib/testids.d.ts} +21 -0
  177. package/dist/lib/testids.d.ts.map +1 -0
  178. package/dist/{theme.d.ts → lib/theme.d.ts} +41 -3
  179. package/dist/lib/theme.d.ts.map +1 -0
  180. package/dist/render.d.ts +5 -0
  181. package/dist/render.d.ts.map +1 -0
  182. package/dist/render.js +359 -0
  183. package/dist/render.js.map +1 -0
  184. package/dist/stores/cart.store.d.ts +6 -2
  185. package/dist/stores/cart.store.d.ts.map +1 -1
  186. package/dist/stores/catalog.store.d.ts +11 -0
  187. package/dist/stores/catalog.store.d.ts.map +1 -1
  188. package/dist/views/CatalogPage.d.ts.map +1 -0
  189. package/dist/views/CheckoutPage.d.ts.map +1 -0
  190. package/dist/views/ContentPage.d.ts +11 -0
  191. package/dist/views/ContentPage.d.ts.map +1 -0
  192. package/dist/views/HomePage.d.ts +9 -0
  193. package/dist/views/HomePage.d.ts.map +1 -0
  194. package/dist/views/MyPurchasesPage.d.ts.map +1 -0
  195. package/dist/views/NotFoundPage.d.ts.map +1 -0
  196. package/dist/{pages → views}/OrderConfirmationPage.d.ts.map +1 -1
  197. package/dist/{pages → views}/PolicyPage.d.ts.map +1 -1
  198. package/dist/views/ProductDetailPage.d.ts.map +1 -0
  199. package/dist/views/StorefrontPage.d.ts +35 -0
  200. package/dist/views/StorefrontPage.d.ts.map +1 -0
  201. package/dist/workflows/checkout.d.ts +1 -1
  202. package/dist/workflows/checkout.d.ts.map +1 -1
  203. package/package.json +21 -14
  204. package/dist/auth.d.ts.map +0 -1
  205. package/dist/blocks.d.ts.map +0 -1
  206. package/dist/component-contracts.d.ts.map +0 -1
  207. package/dist/component-selectors.d.ts.map +0 -1
  208. package/dist/components/CartDrawer.d.ts.map +0 -1
  209. package/dist/components/CustomerAccountShell.d.ts.map +0 -1
  210. package/dist/components/DeliveryEstimator.d.ts.map +0 -1
  211. package/dist/components/FiltersPanel.d.ts +0 -3
  212. package/dist/components/FiltersPanel.d.ts.map +0 -1
  213. package/dist/components/OrderTrackingTimeline.d.ts.map +0 -1
  214. package/dist/components/ProductCard.d.ts +0 -4
  215. package/dist/components/ProductCard.d.ts.map +0 -1
  216. package/dist/components/ProductEnquiryForm.d.ts.map +0 -1
  217. package/dist/components/ProductGallery.d.ts +0 -22
  218. package/dist/components/ProductGallery.d.ts.map +0 -1
  219. package/dist/components/ProductGrid.d.ts.map +0 -1
  220. package/dist/components/ProductOptionSelector.d.ts.map +0 -1
  221. package/dist/components/ProductSpecs.d.ts.map +0 -1
  222. package/dist/components/QuantityInput.d.ts.map +0 -1
  223. package/dist/components/RelatedProducts.d.ts.map +0 -1
  224. package/dist/components/SignInModal.d.ts.map +0 -1
  225. package/dist/components/StorefrontErrorBoundary.d.ts.map +0 -1
  226. package/dist/components/StorefrontFooter.d.ts.map +0 -1
  227. package/dist/components/StorefrontHeader.d.ts.map +0 -1
  228. package/dist/components/Toaster.d.ts.map +0 -1
  229. package/dist/components/sections/CategoryShowcase.d.ts +0 -6
  230. package/dist/components/sections/CategoryShowcase.d.ts.map +0 -1
  231. package/dist/components/sections/HeroSection.d.ts +0 -9
  232. package/dist/components/sections/HeroSection.d.ts.map +0 -1
  233. package/dist/components/sections/MediaCarousel.d.ts +0 -11
  234. package/dist/components/sections/MediaCarousel.d.ts.map +0 -1
  235. package/dist/components/sections/MiscSections.d.ts +0 -33
  236. package/dist/components/sections/MiscSections.d.ts.map +0 -1
  237. package/dist/components/sections/ProductRail.d.ts +0 -9
  238. package/dist/components/sections/ProductRail.d.ts.map +0 -1
  239. package/dist/components/sections/ProductSlider.d.ts +0 -15
  240. package/dist/components/sections/ProductSlider.d.ts.map +0 -1
  241. package/dist/config.d.ts.map +0 -1
  242. package/dist/createStorefrontApp.d.ts +0 -28
  243. package/dist/createStorefrontApp.d.ts.map +0 -1
  244. package/dist/define.d.ts.map +0 -1
  245. package/dist/format.d.ts.map +0 -1
  246. package/dist/hooks/useCategories.d.ts +0 -6
  247. package/dist/hooks/useCategories.d.ts.map +0 -1
  248. package/dist/hooks/useDiscountValidator.d.ts +0 -14
  249. package/dist/hooks/useDiscountValidator.d.ts.map +0 -1
  250. package/dist/hooks/useMyOrders.d.ts.map +0 -1
  251. package/dist/hooks/useProduct.d.ts +0 -7
  252. package/dist/hooks/useProduct.d.ts.map +0 -1
  253. package/dist/hooks/useProducts.d.ts.map +0 -1
  254. package/dist/hooks/useStorefront.d.ts +0 -35
  255. package/dist/hooks/useStorefront.d.ts.map +0 -1
  256. package/dist/hooks/useStorefrontHead.d.ts +0 -11
  257. package/dist/hooks/useStorefrontHead.d.ts.map +0 -1
  258. package/dist/motion.d.ts.map +0 -1
  259. package/dist/order-status.d.ts.map +0 -1
  260. package/dist/pages/CatalogPage.d.ts.map +0 -1
  261. package/dist/pages/CheckoutPage.d.ts.map +0 -1
  262. package/dist/pages/HomePage.d.ts +0 -9
  263. package/dist/pages/HomePage.d.ts.map +0 -1
  264. package/dist/pages/MyPurchasesPage.d.ts.map +0 -1
  265. package/dist/pages/NotFoundPage.d.ts.map +0 -1
  266. package/dist/pages/ProductDetailPage.d.ts.map +0 -1
  267. package/dist/presets.d.ts.map +0 -1
  268. package/dist/product-options.d.ts +0 -12
  269. package/dist/product-options.d.ts.map +0 -1
  270. package/dist/router.d.ts.map +0 -1
  271. package/dist/scaffold.d.ts.map +0 -1
  272. package/dist/sections.d.ts.map +0 -1
  273. package/dist/testids.d.ts.map +0 -1
  274. package/dist/theme.d.ts.map +0 -1
  275. package/src/auth.ts +0 -227
  276. package/src/blocks.tsx +0 -51
  277. package/src/catalog.ts +0 -3
  278. package/src/component-contracts.ts +0 -154
  279. package/src/component-selectors.ts +0 -31
  280. package/src/components/CartDrawer.tsx +0 -279
  281. package/src/components/CustomerAccountShell.tsx +0 -102
  282. package/src/components/DeliveryEstimator.tsx +0 -157
  283. package/src/components/FiltersPanel.tsx +0 -109
  284. package/src/components/OrderTrackingTimeline.tsx +0 -135
  285. package/src/components/Price.tsx +0 -32
  286. package/src/components/ProductCard.tsx +0 -120
  287. package/src/components/ProductEnquiryForm.tsx +0 -175
  288. package/src/components/ProductGallery.tsx +0 -174
  289. package/src/components/ProductGrid.tsx +0 -43
  290. package/src/components/ProductOptionSelector.tsx +0 -50
  291. package/src/components/ProductSpecs.tsx +0 -75
  292. package/src/components/QuantityInput.tsx +0 -52
  293. package/src/components/RelatedProducts.tsx +0 -40
  294. package/src/components/SignInModal.tsx +0 -120
  295. package/src/components/SmoothImage.tsx +0 -59
  296. package/src/components/StorefrontErrorBoundary.tsx +0 -51
  297. package/src/components/StorefrontFooter.tsx +0 -110
  298. package/src/components/StorefrontHeader.tsx +0 -477
  299. package/src/components/Toaster.tsx +0 -60
  300. package/src/components/sections/CategoryShowcase.tsx +0 -80
  301. package/src/components/sections/HeroSection.tsx +0 -193
  302. package/src/components/sections/MediaCarousel.tsx +0 -141
  303. package/src/components/sections/MiscSections.tsx +0 -158
  304. package/src/components/sections/ProductRail.tsx +0 -81
  305. package/src/components/sections/ProductSlider.tsx +0 -119
  306. package/src/config.ts +0 -229
  307. package/src/createStorefrontApp.tsx +0 -247
  308. package/src/define.ts +0 -34
  309. package/src/format.ts +0 -7
  310. package/src/hooks/index.ts +0 -6
  311. package/src/hooks/useCategories.ts +0 -26
  312. package/src/hooks/useDiscountValidator.ts +0 -43
  313. package/src/hooks/useMyOrders.ts +0 -41
  314. package/src/hooks/useProduct.ts +0 -36
  315. package/src/hooks/useProducts.ts +0 -39
  316. package/src/hooks/useStorefront.ts +0 -58
  317. package/src/hooks/useStorefrontHead.ts +0 -25
  318. package/src/index.ts +0 -202
  319. package/src/motion.tsx +0 -94
  320. package/src/order-status.ts +0 -33
  321. package/src/pages/CatalogPage.tsx +0 -118
  322. package/src/pages/CheckoutPage.tsx +0 -689
  323. package/src/pages/HomePage.tsx +0 -16
  324. package/src/pages/MyPurchasesPage.tsx +0 -311
  325. package/src/pages/NotFoundPage.tsx +0 -25
  326. package/src/pages/OrderConfirmationPage.tsx +0 -190
  327. package/src/pages/PolicyPage.tsx +0 -47
  328. package/src/pages/ProductDetailPage.tsx +0 -264
  329. package/src/presets.ts +0 -324
  330. package/src/product-options.ts +0 -63
  331. package/src/router.ts +0 -49
  332. package/src/scaffold.tsx +0 -115
  333. package/src/sections.ts +0 -116
  334. package/src/shop.ts +0 -4
  335. package/src/stores/cart.store.ts +0 -185
  336. package/src/stores/catalog.store.ts +0 -39
  337. package/src/stores/delivery.store.ts +0 -152
  338. package/src/stores/session.store.ts +0 -28
  339. package/src/stores/toast.store.ts +0 -43
  340. package/src/testids.ts +0 -136
  341. package/src/theme.ts +0 -194
  342. package/src/ui.ts +0 -5
  343. package/src/workflows/checkout.ts +0 -119
  344. /package/dist/components/{CustomerAccountShell.d.ts → account/CustomerAccountShell.d.ts} +0 -0
  345. /package/dist/components/{SignInModal.d.ts → account/SignInModal.d.ts} +0 -0
  346. /package/dist/components/{CartDrawer.d.ts → cart/CartDrawer.d.ts} +0 -0
  347. /package/dist/components/{QuantityInput.d.ts → cart/QuantityInput.d.ts} +0 -0
  348. /package/dist/components/{DeliveryEstimator.d.ts → checkout/DeliveryEstimator.d.ts} +0 -0
  349. /package/dist/components/{ProductGrid.d.ts → collection/ProductGrid.d.ts} +0 -0
  350. /package/dist/components/{StorefrontErrorBoundary.d.ts → layout/StorefrontErrorBoundary.d.ts} +0 -0
  351. /package/dist/components/{StorefrontFooter.d.ts → layout/StorefrontFooter.d.ts} +0 -0
  352. /package/dist/components/{StorefrontHeader.d.ts → layout/StorefrontHeader.d.ts} +0 -0
  353. /package/dist/components/{Toaster.d.ts → layout/Toaster.d.ts} +0 -0
  354. /package/dist/components/{OrderTrackingTimeline.d.ts → order/OrderTrackingTimeline.d.ts} +0 -0
  355. /package/dist/components/{ProductEnquiryForm.d.ts → product/ProductEnquiryForm.d.ts} +0 -0
  356. /package/dist/components/{ProductSpecs.d.ts → product/ProductSpecs.d.ts} +0 -0
  357. /package/dist/components/{RelatedProducts.d.ts → product/RelatedProducts.d.ts} +0 -0
  358. /package/dist/{order-status.d.ts → data/order-status.d.ts} +0 -0
  359. /package/dist/{component-selectors.d.ts → extend/component-selectors.d.ts} +0 -0
  360. /package/dist/{format.d.ts → lib/format.d.ts} +0 -0
  361. /package/dist/{motion.d.ts → lib/motion.d.ts} +0 -0
  362. /package/dist/{pages → views}/CatalogPage.d.ts +0 -0
  363. /package/dist/{pages → views}/CheckoutPage.d.ts +0 -0
  364. /package/dist/{pages → views}/MyPurchasesPage.d.ts +0 -0
  365. /package/dist/{pages → views}/NotFoundPage.d.ts +0 -0
  366. /package/dist/{pages → views}/OrderConfirmationPage.d.ts +0 -0
  367. /package/dist/{pages → views}/PolicyPage.d.ts +0 -0
  368. /package/dist/{pages → views}/ProductDetailPage.d.ts +0 -0
@@ -0,0 +1,103 @@
1
+ import type { Product } from '@fayz-ai/shop/types';
2
+ import type { CartLine } from '../stores/cart.store';
3
+ export declare const CART_LINE_ANNOTATION_POINT = "cart.lineAnnotation";
4
+ export declare const ORDER_METADATA_POINT = "order.metadata";
5
+ export declare const PRODUCT_CARD_BADGE_POINT = "product.cardBadge";
6
+ export declare const CHECKOUT_FIELD_POINT = "checkout.field";
7
+ export declare const BEFORE_PLACE_ORDER_VALVE = "checkout.beforePlaceOrder";
8
+ /** Input of cart.lineAnnotation — one cart line, serializable. */
9
+ export interface CartLineAnnotationInput {
10
+ productId: string;
11
+ name: string;
12
+ quantity: number;
13
+ unitPrice: number;
14
+ slug?: string;
15
+ optionsLabel?: string;
16
+ }
17
+ /** Output of cart.lineAnnotation — one annotation chip under the line. */
18
+ export interface CartLineAnnotation {
19
+ /** Stable machine key (namespacing is the handler id; this keys within it). */
20
+ key: string;
21
+ /** Shopper-facing text. */
22
+ label: string;
23
+ /** Optional machine value carried alongside the label. */
24
+ value?: string;
25
+ }
26
+ export interface OrderMetadataInput {
27
+ items: Array<{
28
+ productId: string;
29
+ quantity: number;
30
+ unitPrice: number;
31
+ }>;
32
+ subtotal: number;
33
+ customerEmail?: string;
34
+ }
35
+ export interface ProductCardBadgeInput {
36
+ id: string;
37
+ slug: string;
38
+ name: string;
39
+ price: number;
40
+ inventoryCount: number;
41
+ compareAtPrice?: number | null;
42
+ }
43
+ export interface ProductCardBadge {
44
+ text: string;
45
+ tone?: 'default' | 'accent' | 'warning';
46
+ }
47
+ export interface CheckoutFieldInput {
48
+ customerEmail?: string;
49
+ }
50
+ /** Output of checkout.field — one extra field the checkout form renders. The
51
+ * captured value lands in the order metadata under the handler's namespace. */
52
+ export interface CheckoutFieldContribution {
53
+ id: string;
54
+ label: string;
55
+ type: 'text' | 'checkbox';
56
+ required?: boolean;
57
+ placeholder?: string;
58
+ }
59
+ /** Input of the beforePlaceOrder escape valve — the serializable placement
60
+ * intent, BEFORE the default provider path runs. */
61
+ export interface BeforePlaceOrderContext {
62
+ items: Array<{
63
+ productId: string;
64
+ variantId?: string;
65
+ quantity: number;
66
+ optionsLabel?: string;
67
+ }>;
68
+ customer: {
69
+ name: string;
70
+ email: string;
71
+ };
72
+ currency?: string;
73
+ discountCode?: string;
74
+ shippingTotal?: number;
75
+ notes?: string;
76
+ customerId?: string;
77
+ }
78
+ /** Test seam — clears the whole extension registry (declarations AND
79
+ * handlers) and re-arms registration, so one suite cannot leak handlers into
80
+ * the next. Pairs with core's clearExtensionPoints. */
81
+ export declare function resetStorefrontExtensionPoints(): void;
82
+ /** Declare the storefront extension points. Idempotent; called wherever blocks
83
+ * are registered, so describeStore and the runtime always agree on the set. */
84
+ export declare function registerStorefrontExtensionPoints(): void;
85
+ /** Run cart.lineAnnotation for one line → its annotations, handler-ordered. */
86
+ export declare function getCartLineAnnotations(line: CartLine): Promise<CartLineAnnotation[]>;
87
+ /** Run product.cardBadge for one product → its badges, handler-ordered. */
88
+ export declare function getProductCardBadges(product: Product): Promise<ProductCardBadge[]>;
89
+ /** Run checkout.field → the extra fields a checkout form should render. */
90
+ export declare function getCheckoutFieldContributions(input?: CheckoutFieldInput): Promise<Array<CheckoutFieldContribution & {
91
+ handlerId: string;
92
+ }>>;
93
+ /**
94
+ * Run order.metadata → the namespaced metadata object for a new order, or
95
+ * undefined when nothing contributed. Namespacing by handler id is the
96
+ * WooCommerce ExtendSchema rule: two extensions cannot clobber each other.
97
+ */
98
+ export declare function collectOrderMetadata(input: OrderMetadataInput): Promise<Record<string, unknown> | undefined>;
99
+ /** Run the beforePlaceOrder valve. Null → take the default path. */
100
+ export declare function runBeforePlaceOrderValve<TOrder extends {
101
+ id: string;
102
+ }>(ctx: BeforePlaceOrderContext): Promise<TOrder | null>;
103
+ //# sourceMappingURL=extension-points.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extension-points.d.ts","sourceRoot":"","sources":["../../src/extend/extension-points.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAgBpD,eAAO,MAAM,0BAA0B,wBAAwB,CAAA;AAC/D,eAAO,MAAM,oBAAoB,mBAAmB,CAAA;AACpD,eAAO,MAAM,wBAAwB,sBAAsB,CAAA;AAC3D,eAAO,MAAM,oBAAoB,mBAAmB,CAAA;AACpD,eAAO,MAAM,wBAAwB,8BAA8B,CAAA;AAInE,kEAAkE;AAClE,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,0EAA0E;AAC1E,MAAM,WAAW,kBAAkB;IACjC,+EAA+E;IAC/E,GAAG,EAAE,MAAM,CAAA;IACX,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW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,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAID;;wDAEwD;AACxD,wBAAgB,8BAA8B,IAAI,IAAI,CAGrD;AAED;gFACgF;AAChF,wBAAgB,iCAAiC,IAAI,IAAI,CA8KxD;AAID,+EAA+E;AAC/E,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAe1F;AAED,2EAA2E;AAC3E,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAexF;AAED,2EAA2E;AAC3E,wBAAsB,6BAA6B,CAAC,KAAK,GAAE,kBAAuB,GAAG,OAAO,CAC1F,KAAK,CAAC,yBAAyB,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CACzD,CAOA;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC,CAQlH;AAED,oEAAoE;AACpE,wBAAsB,wBAAwB,CAAC,MAAM,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,EAC1E,GAAG,EAAE,uBAAuB,GAC3B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAGxB"}
@@ -0,0 +1,216 @@
1
+ import React from 'react';
2
+ import type { Product } from '@fayz-ai/shop/types';
3
+ import type { StorefrontBlockLike } from '../blocks/page-blocks';
4
+ import type { CartLine } from '../stores/cart.store';
5
+ /** What each slot area hands to the blocks inside it. */
6
+ export interface StorefrontSlotContextMap {
7
+ productDetail: {
8
+ product: Product;
9
+ soldOut: boolean;
10
+ lowStock: boolean;
11
+ /** Percent off, or 0 when the product is not discounted. */
12
+ discountPct: number;
13
+ };
14
+ /**
15
+ * The card, which renders once per product in a grid — so its context is the
16
+ * one product that card is for, not the list.
17
+ */
18
+ productCard: {
19
+ product: Product;
20
+ soldOut: boolean;
21
+ onSale: boolean;
22
+ /** True when the product has variants, so quick-add routes to the PDP. */
23
+ hasOptions: boolean;
24
+ };
25
+ catalog: {
26
+ /** The products currently visible, after filters and search. */
27
+ products: readonly Product[];
28
+ /** True while the list is being fetched. */
29
+ loading: boolean;
30
+ };
31
+ cart: {
32
+ lines: readonly CartLine[];
33
+ subtotal: number;
34
+ };
35
+ checkout: {
36
+ subtotal: number;
37
+ total: number;
38
+ };
39
+ header: Record<string, never>;
40
+ footer: Record<string, never>;
41
+ }
42
+ export type StorefrontSlotArea = keyof StorefrontSlotContextMap;
43
+ type SlotBlocks = readonly StorefrontBlockLike[];
44
+ /**
45
+ * Where a store may graft blocks into an SDK page.
46
+ *
47
+ * Position names read as "where", not "what": `afterPrice` keeps meaning the
48
+ * same thing if the price stops being a `<Price>` and starts being something
49
+ * else, which a name like `priceBelowSlot` would not.
50
+ */
51
+ export interface StorefrontSlots {
52
+ productDetail?: {
53
+ /** Between the breadcrumb and the product name. */
54
+ beforeTitle?: SlotBlocks;
55
+ /** Immediately under the product name, above the price. */
56
+ afterTitle?: SlotBlocks;
57
+ /** Under the price and discount badge. */
58
+ afterPrice?: SlotBlocks;
59
+ /** Under the description paragraph. */
60
+ afterDescription?: SlotBlocks;
61
+ /** Above the quantity + add-to-cart row. Where trust seals go. */
62
+ beforeAddToCart?: SlotBlocks;
63
+ /** Under the add-to-cart row, above the delivery estimate. */
64
+ afterAddToCart?: SlotBlocks;
65
+ /** Under the gallery column, in the left half of the page. */
66
+ afterGallery?: SlotBlocks;
67
+ /** Above the specification table, below the two-column fold. */
68
+ beforeSpecs?: SlotBlocks;
69
+ /** The bottom of the page, after related products. */
70
+ afterDetail?: SlotBlocks;
71
+ };
72
+ /**
73
+ * The product card, wherever it appears — grid, rail, slider, related.
74
+ *
75
+ * This is where the fleet actually hurt: four of five customizing stores
76
+ * forked a ~120-line card to add one thing to it, and each fork then lost
77
+ * something else (the sale badge, the variant guard, `commerceMode` gating,
78
+ * `theme.productCard` honouring).
79
+ */
80
+ productCard?: {
81
+ /** Above the image, full card width. */
82
+ top?: SlotBlocks;
83
+ /** Over the image. The container is `relative`; content positions itself. */
84
+ imageOverlay?: SlotBlocks;
85
+ /** Between the product name and the price row. */
86
+ afterName?: SlotBlocks;
87
+ /** Under the price row. */
88
+ underPrice?: SlotBlocks;
89
+ };
90
+ catalog?: {
91
+ /** Above the page heading. */
92
+ beforeHeading?: SlotBlocks;
93
+ /** Between the heading and the filters/grid row. */
94
+ beforeGrid?: SlotBlocks;
95
+ /** Inside the filter column, under the filters. */
96
+ afterFilters?: SlotBlocks;
97
+ /** Under the product grid. */
98
+ afterGrid?: SlotBlocks;
99
+ };
100
+ cart?: {
101
+ /** Above the line items. */
102
+ beforeLines?: SlotBlocks;
103
+ /** Between the lines and the totals. */
104
+ beforeSummary?: SlotBlocks;
105
+ /** Under the totals, around the checkout button. */
106
+ afterSummary?: SlotBlocks;
107
+ };
108
+ checkout?: {
109
+ /** Above the checkout form. */
110
+ beforeForm?: SlotBlocks;
111
+ /** Under the payment method selector. */
112
+ afterPaymentMethods?: SlotBlocks;
113
+ /** Under the whole form, around the place-order button. */
114
+ afterForm?: SlotBlocks;
115
+ };
116
+ header?: {
117
+ /**
118
+ * Left of the account/cart icons.
119
+ *
120
+ * Named for the actions row rather than for the header, because the header
121
+ * has three layout variants (default, centered, search) that place the logo
122
+ * differently. A slot "left of the logo" would land somewhere different in
123
+ * each one; the actions row is shared, so this position is the same in all
124
+ * three.
125
+ */
126
+ beforeActions?: SlotBlocks;
127
+ /** Right of the cart icon. */
128
+ afterActions?: SlotBlocks;
129
+ /** A full-width strip under the whole header, in every variant. */
130
+ belowNav?: SlotBlocks;
131
+ };
132
+ footer?: {
133
+ /** Above the footer columns. */
134
+ before?: SlotBlocks;
135
+ /** Under the footer columns, above the credit line. */
136
+ after?: SlotBlocks;
137
+ };
138
+ }
139
+ export interface SlotDescriptor {
140
+ area: StorefrontSlotArea;
141
+ name: string;
142
+ /** Dotted id used in diagnostics and docs. */
143
+ id: string;
144
+ /** Where this slot sits in the page. */
145
+ position: string;
146
+ /** Keys the blocks inside receive through `useSlotContext`. */
147
+ provides: readonly string[];
148
+ /**
149
+ * `stable` means a store in our fleet actually needed this position and paid
150
+ * for it by forking something; `experimental` means the position is plausible
151
+ * but unproven and may move or be removed in a minor.
152
+ *
153
+ * The distinction is not decoration. Every slot is a compatibility promise,
154
+ * and a surface that promises two dozen positions nobody asked for is a
155
+ * surface that cannot be changed later. FastStore marks unproven API with an
156
+ * `__experimental` prefix for the same reason; this is the same idea as a
157
+ * field, so `fayz upgrade` can tell a store which unproven slots it depends on.
158
+ */
159
+ stability: 'stable' | 'experimental';
160
+ /** For stable slots: the fork that proves the position was needed. */
161
+ evidence?: string;
162
+ }
163
+ /**
164
+ * Every slot, with its position, the context it provides, and whether a real
165
+ * store ever asked for it.
166
+ *
167
+ * Shipped as data rather than written in prose because a prose inventory drifts
168
+ * the first time a slot is added. The docs page and the agent's prompt both read
169
+ * this, so there is one list and it is the code's.
170
+ *
171
+ * Six slots are `stable`: a store in the fleet needed that exact position and
172
+ * paid for it by forking a page or a component. The rest are `experimental` —
173
+ * plausible positions with no proven demand yet. Marking them honestly is what
174
+ * keeps the surface changeable; a store that builds on one is told, by
175
+ * `fayz upgrade`, that it did.
176
+ */
177
+ export declare const STOREFRONT_SLOTS: readonly SlotDescriptor[];
178
+ export interface ListSlotsOptions {
179
+ area?: StorefrontSlotArea;
180
+ /** Keep only slots a store has actually proven it needs. */
181
+ stableOnly?: boolean;
182
+ }
183
+ /** The slot inventory, optionally narrowed. */
184
+ export declare function listSlots(areaOrOptions?: StorefrontSlotArea | ListSlotsOptions): readonly SlotDescriptor[];
185
+ /** The slots a store's config actually fills, with their stability. */
186
+ export declare function usedSlots(slots: StorefrontSlots | undefined): readonly SlotDescriptor[];
187
+ /**
188
+ * The context the surrounding slot provides.
189
+ *
190
+ * The type parameter is the caller's assertion about which area it is rendering
191
+ * in, which is as much as a registry-resolved block can be given: the block is
192
+ * looked up by string, so nothing at the call site knows its area statically.
193
+ * Returns null outside a slot, so a block can work both in a slot and in a page.
194
+ */
195
+ export declare function useSlotContext<A extends StorefrontSlotArea>(): StorefrontSlotContextMap[A] | null;
196
+ export interface SlotProps<A extends StorefrontSlotArea> {
197
+ area: A;
198
+ name: string;
199
+ context?: StorefrontSlotContextMap[A];
200
+ }
201
+ /**
202
+ * Render the blocks a store put in one slot.
203
+ *
204
+ * The slot reads its own content out of the config rather than being handed it,
205
+ * so a page places `<Slot area="productDetail" name="afterPrice" />` without
206
+ * threading `config.slots` down to every position. That matters because there
207
+ * are two dozen of these call sites and every threaded prop is a chance to wire
208
+ * one to the wrong slot.
209
+ *
210
+ * Renders nothing — not even a wrapper — when the slot is empty, which is the
211
+ * overwhelmingly common case. An always-present wrapper would change the layout
212
+ * of every page for every store that uses no slots at all.
213
+ */
214
+ export declare function Slot<A extends StorefrontSlotArea>({ area, name, context }: SlotProps<A>): React.JSX.Element | null;
215
+ export {};
216
+ //# sourceMappingURL=slots.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slots.d.ts","sourceRoot":"","sources":["../../src/extend/slots.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAA;AAEjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAIhE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AA2BpD,yDAAyD;AACzD,MAAM,WAAW,wBAAwB;IACvC,aAAa,EAAE;QACb,OAAO,EAAE,OAAO,CAAA;QAChB,OAAO,EAAE,OAAO,CAAA;QAChB,QAAQ,EAAE,OAAO,CAAA;QACjB,4DAA4D;QAC5D,WAAW,EAAE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AAO,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC,4BAsBvF"}
@@ -1,7 +1,26 @@
1
- export { useProducts } from './useProducts';
2
- export { useProduct } from './useProduct';
3
- export { useCategories } from './useCategories';
4
- export { useStorefront, useCatalog, useCart, useEnquiry, useStorefrontActions } from './useStorefront';
5
- export { useMyOrders } from './useMyOrders';
6
- export { useDiscountValidator } from './useDiscountValidator';
1
+ export { useProducts } from './use-products';
2
+ export { useProduct } from './use-product';
3
+ export { useCategories } from './use-categories';
4
+ export { useCatalog } from './use-catalog';
5
+ export { useStorefront } from './use-storefront';
6
+ export { useStorefrontActions } from './use-storefront-actions';
7
+ export { useStorefrontHead } from './use-storefront-head';
8
+ export { useRegion } from './use-region';
9
+ export { usePolicies } from './use-policies';
10
+ export type { StorefrontRegion } from './use-region';
11
+ export type { PolicyKind, StorefrontPolicy, UsePolicies } from './use-policies';
12
+ export { useCart } from './use-cart';
13
+ export { useCheckout } from './use-checkout';
14
+ export { useDiscountValidator } from './use-discount-validator';
15
+ export { usePaymentMethods } from './use-payment-methods';
16
+ export { useShipping } from './use-shipping';
17
+ export { useAddress } from './use-address';
18
+ export type { CheckoutTotals, CheckoutSubmission, UseCheckout } from './use-checkout';
19
+ export type { UsePaymentMethods } from './use-payment-methods';
20
+ export type { UseShipping } from './use-shipping';
21
+ export type { AddressLookupStatus, UseAddress } from './use-address';
22
+ export { useOrder } from './use-order';
23
+ export { useMyOrders } from './use-my-orders';
24
+ export type { UseOrder } from './use-order';
25
+ export { useEnquiry } from './use-enquiry';
7
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EA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;AACrF,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAC9D,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,YAAY,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAGpE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAG3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA"}
@@ -0,0 +1,26 @@
1
+ import type { PostalAddress } from '@fayz-ai/core';
2
+ export type AddressLookupStatus = 'idle' | 'loading' | 'found' | 'not-found' | 'error';
3
+ export interface UseAddress {
4
+ postalCode: string;
5
+ /** The same code formatted for display (`01311-000`). */
6
+ display: string;
7
+ address: PostalAddress | null;
8
+ status: AddressLookupStatus;
9
+ error: string | null;
10
+ /** Set the code and look it up once it is complete. Partial input never calls out. */
11
+ setPostalCode: (value: string) => void;
12
+ clear: () => void;
13
+ }
14
+ /**
15
+ * A postal code, and the address it resolves to.
16
+ *
17
+ * The lookup fires on the code being COMPLETE rather than on every keystroke —
18
+ * a debounce would still send `0`, `01`, `013`… and each is a request that can
19
+ * only fail. The last completed lookup wins: a shopper who corrects a typo mid
20
+ * flight must not have the stale response overwrite the new one.
21
+ *
22
+ * This is the address half of checkout, separated from `useShipping` on purpose:
23
+ * a store that does not ship still asks for a billing address.
24
+ */
25
+ export declare function useAddress(initial?: string): UseAddress;
26
+ //# sourceMappingURL=use-address.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-address.d.ts","sourceRoot":"","sources":["../../src/hooks/use-address.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAElD,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,OAAO,CAAA;AAEtF,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,aAAa,GAAG,IAAI,CAAA;IAC7B,MAAM,EAAE,mBAAmB,CAAA;IAC3B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,sFAAsF;IACtF,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB;AAID;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,OAAO,SAAK,GAAG,UAAU,CAoDnD"}
@@ -0,0 +1,3 @@
1
+ /** The cart: lines, totals and the drawer. */
2
+ export declare function useCart(): import("..").CartState;
3
+ //# sourceMappingURL=use-cart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-cart.d.ts","sourceRoot":"","sources":["../../src/hooks/use-cart.ts"],"names":[],"mappings":"AAEA,8CAA8C;AAC9C,wBAAgB,OAAO,2BAEtB"}
@@ -0,0 +1,24 @@
1
+ /** The catalog store, plus the config a listing page needs to render a link. */
2
+ export declare function useCatalog(): {
3
+ catalogPath: string;
4
+ config: import("..").ResolvedStorefrontConfig;
5
+ search: string;
6
+ categoryId: string | null;
7
+ collection: string | null;
8
+ facets: import("..").CatalogFacets;
9
+ priceMin: number | null;
10
+ priceMax: number | null;
11
+ inStockOnly: boolean;
12
+ sort: import("..").CatalogSort;
13
+ setSearch(search: string): void;
14
+ setCategoryId(categoryId: string | null): void;
15
+ setCollection(collection: string | null): void;
16
+ setFacet(key: string, value: string | null): void;
17
+ clearFacets(): void;
18
+ setPriceMin(priceMin: number | null): void;
19
+ setPriceMax(priceMax: number | null): void;
20
+ setInStockOnly(inStockOnly: boolean): void;
21
+ setSort(sort: import("..").CatalogSort): void;
22
+ reset(): void;
23
+ };
24
+ //# sourceMappingURL=use-catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-catalog.d.ts","sourceRoot":"","sources":["../../src/hooks/use-catalog.ts"],"names":[],"mappings":"AAGA,gFAAgF;AAChF,wBAAgB,UAAU;;;;;;;;;;;;;;;;;;;;;EAIzB"}
@@ -0,0 +1,19 @@
1
+ import type { Category } from '@fayz-ai/shop/types';
2
+ /**
3
+ * Every catalog category, in store order.
4
+ *
5
+ * Reads through the declared `categories.list` loader instead of calling
6
+ * `getShopProvider().listCategories()` from an effect. Same provider, same
7
+ * query, same result — but a read that goes through the port is deduped with
8
+ * any block on the page asking the same question, and it can be resolved ahead
9
+ * of render. That second property is why the change matters: the footer's
10
+ * category column is on every page of every store, and a read that only exists
11
+ * inside an effect is permanently empty in a headless render (M8) and in any
12
+ * future SSR pass (L4). A read that reaches the provider directly can be
13
+ * neither deduped nor pre-resolved.
14
+ */
15
+ export declare function useCategories(): {
16
+ categories: Category[];
17
+ loading: boolean;
18
+ };
19
+ //# sourceMappingURL=use-categories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-categories.d.ts","sourceRoot":"","sources":["../../src/hooks/use-categories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAEnD;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,IAAI;IAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAG5E"}
@@ -0,0 +1,41 @@
1
+ import type { PaymentMethodKind, ShippingAddressInput } from '@fayz-ai/shop/types';
2
+ import type { PlaceStorefrontOrderResult, StorefrontCheckoutAddress, StorefrontCheckoutCustomer } from '../workflows/checkout';
3
+ export interface CheckoutTotals {
4
+ count: number;
5
+ subtotal: number;
6
+ discountTotal: number;
7
+ shipping: number;
8
+ total: number;
9
+ }
10
+ export interface CheckoutSubmission {
11
+ customer: StorefrontCheckoutCustomer;
12
+ address?: StorefrontCheckoutAddress;
13
+ shippingAddress?: ShippingAddressInput;
14
+ paymentMethod?: PaymentMethodKind;
15
+ markPaid?: boolean;
16
+ }
17
+ export interface UseCheckout {
18
+ /** False when the store sells by catalog or enquiry — there is no checkout to render. */
19
+ enabled: boolean;
20
+ /** True when the cart has nothing in it: the reason an enabled checkout still cannot proceed. */
21
+ empty: boolean;
22
+ totals: CheckoutTotals;
23
+ placing: boolean;
24
+ error: string | null;
25
+ placeOrder: (input: CheckoutSubmission) => Promise<PlaceStorefrontOrderResult | null>;
26
+ }
27
+ /**
28
+ * The checkout, with the cart, session and config already bound.
29
+ *
30
+ * `placeOrder` takes only what the shopper typed. Everything the server needs
31
+ * to be told about — lines, discount, totals, the customer session — is read
32
+ * here from the stores, because a caller assembling that payload is a caller
33
+ * that can assemble it wrongly, and the prices in it are exactly the numbers a
34
+ * client must not be trusted with. `shop_place_order` recomputes from the
35
+ * catalog regardless; this keeps the two from disagreeing on screen.
36
+ *
37
+ * `placing` is guarded rather than advisory: a double-submitted checkout is two
38
+ * orders and two charges, and the button being disabled is not a guarantee.
39
+ */
40
+ export declare function useCheckout(): UseCheckout;
41
+ //# sourceMappingURL=use-checkout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-checkout.d.ts","sourceRoot":"","sources":["../../src/hooks/use-checkout.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAYlF,OAAO,KAAK,EACV,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,uBAAuB,CAAA;AAE9B,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,0BAA0B,CAAA;IACpC,OAAO,CAAC,EAAE,yBAAyB,CAAA;IACnC,eAAe,CAAC,EAAE,oBAAoB,CAAA;IACtC,aAAa,CAAC,EAAE,iBAAiB,CAAA;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,yFAAyF;IACzF,OAAO,EAAE,OAAO,CAAA;IAChB,iGAAiG;IACjG,KAAK,EAAE,OAAO,CAAA;IACd,MAAM,EAAE,cAAc,CAAA;IACtB,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,UAAU,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,OAAO,CAAC,0BAA0B,GAAG,IAAI,CAAC,CAAA;CACtF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,IAAI,WAAW,CAqDzC"}
@@ -0,0 +1,20 @@
1
+ export interface DiscountValidation {
2
+ valid: boolean;
3
+ percent: number;
4
+ message?: string;
5
+ }
6
+ /**
7
+ * Storefront coupon validator, backed by the RULE ENGINE (spine M6): a store's
8
+ * `{code, percent}` config entries and its document `promotions` section are
9
+ * both Promotions — one eligibility rule on `code` plus an application method
10
+ * — gated by the same evaluator path the server mirrors. The hardcoded
11
+ * "trust config.discounts directly" branch this hook used to carry is retired.
12
+ *
13
+ * Codes the local document does not know still go through the provider-backed
14
+ * validateDiscount primitive (status/date-window/usage-limit on the discount
15
+ * table), translated through the same adapter. The storefront cart models a
16
+ * discount as a percentage, so non-percentage codes are rejected for
17
+ * client-side preview — the server still honors them at checkout.
18
+ */
19
+ export declare function useDiscountValidator(): (code: string) => Promise<DiscountValidation>;
20
+ //# sourceMappingURL=use-discount-validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-discount-validator.d.ts","sourceRoot":"","sources":["../../src/hooks/use-discount-validator.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,OAAO,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AA0BD;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,IAAI,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAoDpF"}
@@ -0,0 +1,7 @@
1
+ import type { CreateProductEnquiryInput } from '@fayz-ai/shop/types';
2
+ /** The enquiry path, for stores that take orders as conversations rather than checkouts. */
3
+ export declare function useEnquiry(): {
4
+ enquiry: Required<Pick<import("..").StorefrontEnquiryConfig, "label" | "successMessage" | "subjectPrefix">> & Omit<import("..").StorefrontEnquiryConfig, "label" | "successMessage" | "subjectPrefix">;
5
+ createProductEnquiry: (input: CreateProductEnquiryInput) => Promise<import("@fayz-ai/shop").ProductEnquiry>;
6
+ };
7
+ //# sourceMappingURL=use-enquiry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-enquiry.d.ts","sourceRoot":"","sources":["../../src/hooks/use-enquiry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAGpE,4FAA4F;AAC5F,wBAAgB,UAAU;;kCAGmB,yBAAyB;EASrE"}
@@ -4,4 +4,4 @@ export declare function useMyOrders(): {
4
4
  loading: boolean;
5
5
  refresh: () => void;
6
6
  };
7
- //# sourceMappingURL=useMyOrders.d.ts.map
7
+ //# sourceMappingURL=use-my-orders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-my-orders.d.ts","sourceRoot":"","sources":["../../src/hooks/use-my-orders.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAGhD,wBAAgB,WAAW,IAAI;IAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAmCxF"}
@@ -0,0 +1,17 @@
1
+ import type { Order } from '@fayz-ai/shop/types';
2
+ export interface UseOrder {
3
+ order: Order | null;
4
+ loading: boolean;
5
+ error: string | null;
6
+ reload: () => void;
7
+ }
8
+ /**
9
+ * One order by id — the confirmation page, and the link a shopper is emailed.
10
+ *
11
+ * A null id is a legitimate state (the route matched before the id resolved),
12
+ * not an error: it settles to `loading: false` with no order rather than
13
+ * reporting a failure the shopper cannot act on. The last request wins, so a
14
+ * fast reload cannot leave the previous order on screen.
15
+ */
16
+ export declare function useOrder(orderId: string | null | undefined): UseOrder;
17
+ //# sourceMappingURL=use-order.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-order.d.ts","sourceRoot":"","sources":["../../src/hooks/use-order.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAEhD,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;IACnB,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,QAAQ,CAsCrE"}
@@ -0,0 +1,19 @@
1
+ import type { PaymentMethodKind } from '@fayz-ai/shop/types';
2
+ export interface UsePaymentMethods {
3
+ /** The kinds this store offers, in the order it declared them. */
4
+ methods: readonly PaymentMethodKind[];
5
+ /** The default selection: the first declared method, or null when none are. */
6
+ preferred: PaymentMethodKind | null;
7
+ supports: (method: PaymentMethodKind) => boolean;
8
+ }
9
+ /**
10
+ * Which payment methods the store offers.
11
+ *
12
+ * Deliberately provider-agnostic. A method is a declared KIND (`pix`,
13
+ * `credit_card`, `cash`) — never a Stripe or Mercado Pago object — because the
14
+ * canonical rule is that no storefront code imports a provider client. Which
15
+ * gateway settles a `pix` is the backend's business, and swapping it must not
16
+ * change a line here.
17
+ */
18
+ export declare function usePaymentMethods(): UsePaymentMethods;
19
+ //# sourceMappingURL=use-payment-methods.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-payment-methods.d.ts","sourceRoot":"","sources":["../../src/hooks/use-payment-methods.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAG5D,MAAM,WAAW,iBAAiB;IAChC,kEAAkE;IAClE,OAAO,EAAE,SAAS,iBAAiB,EAAE,CAAA;IACrC,+EAA+E;IAC/E,SAAS,EAAE,iBAAiB,GAAG,IAAI,CAAA;IACnC,QAAQ,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,OAAO,CAAA;CACjD;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,IAAI,iBAAiB,CAQrD"}
@@ -0,0 +1,25 @@
1
+ export type PolicyKind = 'privacy' | 'terms' | 'returns';
2
+ export interface StorefrontPolicy {
3
+ kind: PolicyKind;
4
+ title: string;
5
+ path: string;
6
+ /** The store's own text, or null when it has not published this one yet. */
7
+ content: string | null;
8
+ published: boolean;
9
+ }
10
+ export interface UsePolicies {
11
+ policies: StorefrontPolicy[];
12
+ /** True when every policy has text — what a payment processor asks for at go-live. */
13
+ complete: boolean;
14
+ contactEmail?: string;
15
+ }
16
+ /**
17
+ * The institutional pages, as data.
18
+ *
19
+ * All three are always listed, published or not: the routes and footer links
20
+ * have to exist before the store writes its policies, because a 404 where a
21
+ * processor expects a returns policy blocks go-live. `published` is what a
22
+ * checklist reads; the page itself renders a placeholder.
23
+ */
24
+ export declare function usePolicies(): UsePolicies;
25
+ //# sourceMappingURL=use-policies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-policies.d.ts","sourceRoot":"","sources":["../../src/hooks/use-policies.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAA;AAExD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,UAAU,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,4EAA4E;IAC5E,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,SAAS,EAAE,OAAO,CAAA;CACnB;AAQD,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,gBAAgB,EAAE,CAAA;IAC5B,sFAAsF;IACtF,QAAQ,EAAE,OAAO,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,IAAI,WAAW,CAWzC"}