@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
@@ -1,9 +1,10 @@
1
1
  import type React from 'react';
2
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';
3
+ import type { ProductOptionGroup, ProductOptionSelection } from '../data/product-options';
4
+ import type { ResolvedStorefrontConfig, StorefrontCommerceMode } from '../document/config';
5
+ import type { MediaCarouselItem } from '../blocks/sections';
6
+ import type { CartState } from '../stores/cart.store';
7
+ import type { ComponentOverride } from './component-override';
7
8
  export interface StorefrontComponentBaseProps {
8
9
  config: ResolvedStorefrontConfig;
9
10
  commerceMode: StorefrontCommerceMode;
@@ -17,9 +18,26 @@ export interface StorefrontActions {
17
18
  closeCart: () => void;
18
19
  createProductEnquiry: (input: CreateProductEnquiryInput) => Promise<ProductEnquiry>;
19
20
  }
21
+ /**
22
+ * Which photo the CARD shows — the grid-side counterpart of
23
+ * {@link ProductGalleryOrder}.
24
+ *
25
+ * primary the first `is_primary` row, else the first row (the default;
26
+ * byte-identical to what the card has always done)
27
+ * position the lowest `sortOrder`, ties broken by image id
28
+ *
29
+ * `position` exists because `is_primary` is not a unique constraint: artorious
30
+ * carries products with TWO primary rows, which made the card's pick depend on
31
+ * PostgREST's tie order — the same card could show a different photo between
32
+ * two loads. The gallery got `order` in M2; the card had no equivalent and a
33
+ * store fork was the only way to sort by position.
34
+ */
35
+ export type ProductCardImageOrder = 'primary' | 'position';
20
36
  export interface ProductCardProps extends StorefrontComponentBaseProps {
21
37
  product: Product;
22
38
  actions: Pick<StorefrontActions, 'navigateTo' | 'addToCart' | 'openCart'>;
39
+ /** Defaults to 'primary' — see {@link ProductCardImageOrder}. */
40
+ imageOrder?: ProductCardImageOrder;
23
41
  }
24
42
  export interface ProductDetailProps extends StorefrontComponentBaseProps {
25
43
  product: Product;
@@ -35,10 +53,24 @@ export interface ProductDetailProps extends StorefrontComponentBaseProps {
35
53
  addToCart: () => void;
36
54
  openEnquiry: () => void;
37
55
  }
56
+ /**
57
+ * Which photo leads the gallery.
58
+ *
59
+ * primary the merchant's pick: isPrimary first, then sortOrder ascending (default)
60
+ * position sortOrder ascending, ignoring the primary flag
61
+ * newest sortOrder descending — the most recently added photo leads
62
+ *
63
+ * `newest` exists because of a real fork: artorious reimplemented the entire
64
+ * 158-line gallery to change ONLY this rule (its Supabase rows carried two
65
+ * conflicting is_primary flags, so sort_order was the only trustworthy signal).
66
+ * A props-only override (`components.ProductGallery.props.order`) now does it.
67
+ */
68
+ export type ProductGalleryOrder = 'primary' | 'position' | 'newest';
38
69
  export interface ProductGalleryProps extends StorefrontComponentBaseProps {
39
70
  product: Product;
40
71
  images: ProductImage[];
41
72
  primaryImage?: ProductImage;
73
+ order?: ProductGalleryOrder;
42
74
  }
43
75
  export interface ProductPriceProps extends StorefrontComponentBaseProps {
44
76
  product: Product;
@@ -115,24 +147,44 @@ export interface StorefrontStateProps extends StorefrontComponentBaseProps {
115
147
  export interface CartDrawerFooterExtraProps extends StorefrontComponentBaseProps {
116
148
  cart: CartState;
117
149
  }
150
+ /**
151
+ * Code-level component replacements.
152
+ *
153
+ * Each entry accepts either the component (what stores write today) or
154
+ * `{ component?, props? }`. Passing only `props` keeps the SDK component and
155
+ * forces some of its props — which is what four of five customizing stores
156
+ * actually wanted when they replaced a whole card instead.
157
+ *
158
+ * Every field takes the union rather than only the two surfaces stores have
159
+ * overridden so far: "why can I pass props to ProductCard but not CategoryCard"
160
+ * is a worse surface than one extra type.
161
+ */
118
162
  export interface StorefrontComponents {
119
- ProductCard?: React.ComponentType<ProductCardProps>;
120
- ProductDetail?: React.ComponentType<ProductDetailProps>;
121
- ProductGallery?: React.ComponentType<ProductGalleryProps>;
122
- ProductPrice?: React.ComponentType<ProductPriceProps>;
123
- ProductActions?: React.ComponentType<ProductActionsProps>;
124
- ProductEnquiryForm?: React.ComponentType<ProductEnquiryFormContractProps>;
125
- CategoryCard?: React.ComponentType<CategoryCardProps>;
126
- CollectionSection?: React.ComponentType<CollectionSectionProps>;
127
- HeroSection?: React.ComponentType<HeroSectionContractProps>;
128
- MediaCarousel?: React.ComponentType<MediaCarouselProps>;
129
- ProductSlider?: React.ComponentType<ProductSliderProps>;
130
- Header?: React.ComponentType<StorefrontChromeProps>;
131
- Footer?: React.ComponentType<StorefrontChromeProps>;
132
- Shell?: React.ComponentType<StorefrontChromeProps>;
133
- EmptyState?: React.ComponentType<StorefrontStateProps>;
134
- LoadingState?: React.ComponentType<StorefrontStateProps>;
135
- ErrorState?: React.ComponentType<StorefrontStateProps>;
136
- CartDrawerFooterExtra?: React.ComponentType<CartDrawerFooterExtraProps>;
163
+ ProductCard?: ComponentOverride<ProductCardProps>;
164
+ ProductDetail?: ComponentOverride<ProductDetailProps>;
165
+ ProductGallery?: ComponentOverride<ProductGalleryProps>;
166
+ ProductPrice?: ComponentOverride<ProductPriceProps>;
167
+ ProductActions?: ComponentOverride<ProductActionsProps>;
168
+ ProductEnquiryForm?: ComponentOverride<ProductEnquiryFormContractProps>;
169
+ CategoryCard?: ComponentOverride<CategoryCardProps>;
170
+ CollectionSection?: ComponentOverride<CollectionSectionProps>;
171
+ HeroSection?: ComponentOverride<HeroSectionContractProps>;
172
+ MediaCarousel?: ComponentOverride<MediaCarouselProps>;
173
+ ProductSlider?: ComponentOverride<ProductSliderProps>;
174
+ Header?: ComponentOverride<StorefrontChromeProps>;
175
+ Footer?: ComponentOverride<StorefrontChromeProps>;
176
+ Shell?: ComponentOverride<StorefrontChromeProps>;
177
+ EmptyState?: ComponentOverride<StorefrontStateProps>;
178
+ LoadingState?: ComponentOverride<StorefrontStateProps>;
179
+ ErrorState?: ComponentOverride<StorefrontStateProps>;
180
+ CartDrawerFooterExtra?: ComponentOverride<CartDrawerFooterExtraProps>;
137
181
  }
182
+ /**
183
+ * The override surface as a runtime value, for validators and catalogs: a
184
+ * store document referencing an unknown component slot must be told the valid
185
+ * set (I2), and a type alone cannot say it at runtime. The `satisfies` +
186
+ * exhaustiveness pair keeps this list impossible to leave stale when a key is
187
+ * added to {@link StorefrontComponents}.
188
+ */
189
+ export declare const STOREFRONT_COMPONENT_KEYS: readonly ["ProductCard", "ProductDetail", "ProductGallery", "ProductPrice", "ProductActions", "ProductEnquiryForm", "CategoryCard", "CollectionSection", "HeroSection", "MediaCarousel", "ProductSlider", "Header", "Footer", "Shell", "EmptyState", "LoadingState", "ErrorState", "CartDrawerFooterExtra"];
138
190
  //# sourceMappingURL=component-contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-contracts.d.ts","sourceRoot":"","sources":["../../src/extend/component-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAyB,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACrH,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AACzF,OAAO,KAAK,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC1F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAE7D,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,wBAAwB,CAAA;IAChC,YAAY,EAAE,sBAAsB,CAAA;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,SAAS,EAAE,CAAC,OAAO,EAAE,O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AA;CACtE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,6SAmBsB,CAAA"}
@@ -0,0 +1,38 @@
1
+ import type { ComponentType } from 'react';
2
+ /**
3
+ * Either the whole component (what stores write today), or an adjustment.
4
+ *
5
+ * `{ props }` alone keeps the SDK component and forces some of its props.
6
+ * `{ component, props }` replaces it and pre-binds props — useful for a wrapper
7
+ * that needs a couple of fixed values.
8
+ */
9
+ export type ComponentOverride<P> = ComponentType<P> | {
10
+ component?: ComponentType<P>;
11
+ /** Props forced on the component, overriding what the page passes. */
12
+ props?: Partial<P>;
13
+ };
14
+ export interface ResolvedOverride<P> {
15
+ Component: ComponentType<P>;
16
+ /** Props to apply last, so an override wins over what the page computed. */
17
+ props: Partial<P>;
18
+ /** True when the store replaced the component rather than adjusting it. */
19
+ replaced: boolean;
20
+ }
21
+ /**
22
+ * Normalize both override forms against the SDK's own component.
23
+ *
24
+ * Override props are applied AFTER the page's, deliberately: an override that
25
+ * could not win over a computed prop would be unable to change the thing the
26
+ * store is overriding it for.
27
+ */
28
+ export declare function resolveOverride<P>(override: ComponentOverride<P> | undefined, fallback: ComponentType<P>): ResolvedOverride<P>;
29
+ /**
30
+ * The component an override resolves to, or undefined when the store only
31
+ * adjusted props. Lets a page keep its existing `if (Override) …` branch, which
32
+ * exists because replacing a page body is structurally different from tweaking
33
+ * one of its props.
34
+ */
35
+ export declare function overrideComponent<P>(override: ComponentOverride<P> | undefined): ComponentType<P> | undefined;
36
+ /** The props an override forces, whether or not it also replaces the component. */
37
+ export declare function overrideProps<P>(override: ComponentOverride<P> | undefined): Partial<P>;
38
+ //# sourceMappingURL=component-override.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-override.d.ts","sourceRoot":"","sources":["../../src/extend/component-override.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAiB1C;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,I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A"}
@@ -0,0 +1,59 @@
1
+ export interface EditorBridgeOptions {
2
+ /**
3
+ * Origins allowed to drive the picker. An activation from anywhere else is
4
+ * ignored. Required: there is no safe default, because the parent of an
5
+ * iframe is chosen by whoever embedded it.
6
+ */
7
+ allowedOrigins: readonly string[];
8
+ /** Test seam. Defaults to the ambient window. */
9
+ target?: Window;
10
+ }
11
+ export interface PickedBlock {
12
+ /** Dotted document path — what applyChange accepts and validateStore reports. */
13
+ path: string;
14
+ /** The block's registered type, so the parent can look up its schema. */
15
+ type: string;
16
+ /** Bounding rect of the block's first painted child, for the parent's overlay. */
17
+ rect?: {
18
+ top: number;
19
+ left: number;
20
+ width: number;
21
+ height: number;
22
+ };
23
+ }
24
+ export declare const EDITOR_MESSAGES: {
25
+ readonly activate: "ACTIVATE_ELEMENT_PICKER";
26
+ readonly deactivate: "DEACTIVATE_ELEMENT_PICKER";
27
+ readonly ready: "ELEMENT_PICKER_READY";
28
+ readonly picked: "ELEMENT_PICKED";
29
+ readonly cancelled: "ELEMENT_PICKER_CANCELLED";
30
+ readonly navigation: "NAVIGATION_CHANGE";
31
+ };
32
+ /**
33
+ * The nearest ancestor that is a block, and the element that actually paints.
34
+ *
35
+ * The stamp lives on a `display: contents` wrapper, which has no box of its
36
+ * own — `getBoundingClientRect()` on it returns zeros. So the rect comes from
37
+ * its first element child, which is the block's real root.
38
+ */
39
+ export declare function blockAt(element: Element | null): {
40
+ path: string;
41
+ type: string;
42
+ node: Element;
43
+ } | null;
44
+ /**
45
+ * Wire the storefront to an editor parent. Returns a teardown.
46
+ *
47
+ * Inert when the page is not framed: a storefront served to a shopper has
48
+ * `window.parent === window`, nothing is registered, and editor mode stays off.
49
+ */
50
+ export declare function connectEditorBridge(options: EditorBridgeOptions): () => void;
51
+ /**
52
+ * Tell the parent the route changed, so its URL bar follows the iframe.
53
+ *
54
+ * Silent until an allowed parent has activated the bridge — the path is not
55
+ * sensitive, but broadcasting to '*' from every storefront is a habit worth
56
+ * not forming.
57
+ */
58
+ export declare function reportNavigation(path: string, parentOrigin: string | null, target?: Window): void;
59
+ //# sourceMappingURL=editor-bridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-bridge.d.ts","sourceRoot":"","sources":["../../src/extend/editor-bridge.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,cAAc,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAA;IACZ,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAA;IACZ,kFAAkF;IAClF,IAAI,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;CACpE;AAED,eAAO,MAAM,eAAe;;;;;;;CAOlB,CAAA;AAEV;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAWrG;AAQD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,IAAI,CA8E5E;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAIjG"}
@@ -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,CAA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;;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,MAAM,CAAA;KACpB,CAAA;IACD;;;OAGG;IACH,WAAW,EAAE;QACX,OAAO,EAAE,OAAO,CAAA;QAChB,OAAO,EAAE,OAAO,CAAA;QAChB,MAAM,EAAE,OAAO,CAAA;QACf,0EAA0E;QAC1E,UAAU,EAAE,OAAO,CAAA;KACpB,CAAA;IACD,OAAO,EAAE;QACP,gEAAgE;QAChE,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAA;QAC5B,4CAA4C;QAC5C,OAAO,EAAE,OAAO,CAAA;KACjB,CAAA;IACD,IAAI,EAAE;QAAE,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;IACtD,QAAQ,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC7C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IAC7B,MAAM,EAAE,MAAM,CAAC,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AAED,+CAA+C;AAC/C,wBAAgB,SAAS,CACvB,aAAa,CAAC,EAAE,kBAAkB,GAAG,gBAAgB,GACpD,SAAS,cAAc,EAAE,CAQ3B;AAED,uEAAuE;AACvE,wBAAgB,SAAS,CAAC,KAAK,EAAE,eAAe,GAAG,SAAS,GAAG,SAAS,cAAc,EAAE,CAMvF;AAMD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,kBAAkB,KAAK,wBAAwB,CAAC,CAAC,CAAC,GAAG,IAAI,CAEjG;AAED,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,kBAAkB;IACrD,IAAI,EAAE,CAAC,CAAA;IACP,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,wBAAwB,CAAC,CAAC,CAAC,CAAA;CACtC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,kBAAkB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,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,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACtG,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAG1C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAC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