@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
@@ -0,0 +1,171 @@
1
+ import type { RouterAdapter } from '@fayz-ai/core';
2
+ import type { ShopProvider } from '@fayz-ai/shop/provider';
3
+ import type { StaticHeadInput } from '../app/static-render';
4
+ import type { StoreDocument } from './sections';
5
+ import type { StoreValidationReport } from './validate';
6
+ export interface StoreRenderDataEntry {
7
+ /** Canonical `dataNeedKey` — the same key the browser would dedupe on. */
8
+ key: string;
9
+ loader: string;
10
+ params: Record<string, unknown>;
11
+ status: 'ready' | 'error' | 'unresolved';
12
+ /** Item count for an array result, so "the rail is empty" is one field. */
13
+ count?: number;
14
+ error?: string;
15
+ }
16
+ export interface StoreRenderDiagnostic {
17
+ level: 'error' | 'warn';
18
+ /** Where it came from: 'blocks' (core), 'storefront', or 'render'. */
19
+ source: string;
20
+ message: string;
21
+ }
22
+ export interface StoreRenderHeading {
23
+ level: number;
24
+ text: string;
25
+ }
26
+ export interface StoreRenderBlock {
27
+ type: string;
28
+ id?: string;
29
+ /** Ancestor block types, outermost first — empty for a top-level block. */
30
+ within?: string[];
31
+ }
32
+ export interface RenderStoreOptions {
33
+ /** Route to render, in the storefront's own path space ('/', '/catalog',
34
+ * '/product/anel-de-ouro', '/biography'). Default '/'. */
35
+ path?: string;
36
+ /**
37
+ * Where catalog data comes from.
38
+ *
39
+ * - `'config'` (default): the provider the config implies — its explicit
40
+ * provider, or a mock seeded from its catalog. What the shopper sees.
41
+ * - `'document'`: a mock seeded from the document's own `catalog` section.
42
+ * Deterministic and network-free, which is what you want while iterating
43
+ * on a document whose store is backed by a live database.
44
+ * - a `ShopProvider`: bring your own.
45
+ */
46
+ provider?: ShopProvider | 'config' | 'document';
47
+ /**
48
+ * 'report' (default) renders an invalid document anyway and returns the
49
+ * findings — an agent fixing a broken store needs to see the broken store.
50
+ * 'throw' refuses, for a caller using this as a gate.
51
+ */
52
+ onError?: 'throw' | 'report';
53
+ /** 'document' (default) wraps the markup in a full HTML document with the
54
+ * theme CSS and the route's title; 'fragment' returns the shell markup. */
55
+ html?: 'document' | 'fragment';
56
+ /**
57
+ * How many render/resolve rounds to run. One page's data can reveal the
58
+ * next need (a route param feeding a rail), so the loop repeats until no new
59
+ * need appears. Reaching the cap is reported as a diagnostic rather than
60
+ * silently truncating the page. Default 4.
61
+ */
62
+ maxPasses?: number;
63
+ /**
64
+ * Which frame of an image's reveal animation to render.
65
+ *
66
+ * `'settled'` (default) renders images at their loaded state. A store with
67
+ * `imageLoading.mode: 'fade'` paints every image at `opacity: 0` until its
68
+ * load event fires — an event a static render never has — so the honest
69
+ * frame to show is the one every shopper's browser reaches milliseconds
70
+ * later, not a blank page. `'initial'` renders the pre-load frame verbatim,
71
+ * for a caller specifically inspecting first paint.
72
+ */
73
+ imageReveal?: 'settled' | 'initial';
74
+ /** Stylesheet URLs to link from the emitted document — how a preview server
75
+ * hands in the app's real (Tailwind) CSS. */
76
+ stylesheets?: readonly string[];
77
+ /** Extra markup for the emitted `<head>`. */
78
+ head?: string;
79
+ /**
80
+ * How the rendered store is ADDRESSED when served.
81
+ *
82
+ * Defaults to hash, matching how storefronts ship today, so a headless render
83
+ * describes links that actually resolve. Pass `historyRouterAdapter()` (or any
84
+ * adapter) for a store served at real URLs — that is what makes each page
85
+ * come out with a crawlable href of its own, which is the difference between
86
+ * prerendered HTML that can be indexed and prerendered HTML that cannot.
87
+ */
88
+ router?: RouterAdapter;
89
+ /**
90
+ * Absolute origin, e.g. 'https://loja.example.com'. Required for canonical
91
+ * and OpenGraph URLs — without it they are omitted rather than emitted
92
+ * relative, because a relative canonical is ignored.
93
+ */
94
+ origin?: string;
95
+ /** `<html lang>`. Defaults to the document's locale, then 'pt-BR'. */
96
+ lang?: string;
97
+ /**
98
+ * Stamp every block with its document path (`data-fayz-block`).
99
+ *
100
+ * Off by default, because a shopper's page must not carry it. On, the emitted
101
+ * HTML says which document node produced which part of the page — which lets
102
+ * an editor resolve a click to a path, and lets a test assert the identity
103
+ * seam without a browser.
104
+ */
105
+ editor?: boolean;
106
+ }
107
+ export interface StoreRenderResult {
108
+ /** True when the document validates, the path resolved, and nothing on the
109
+ * page reported an error. The one field a gate should read. */
110
+ ok: boolean;
111
+ path: string;
112
+ /** The title this route declared through `useStorefrontHead`. */
113
+ title: string;
114
+ description?: string;
115
+ /** The path resolved to a real page (false = the 404 page rendered). */
116
+ found: boolean;
117
+ html: string;
118
+ /** Visible text, tags stripped and whitespace collapsed — what a reader sees. */
119
+ text: string;
120
+ /** h1–h6 in document order: the page's shape in one glance. */
121
+ outline: StoreRenderHeading[];
122
+ /** Every block that rendered, in order, including forced-layout repairs. */
123
+ blocks: StoreRenderBlock[];
124
+ /** Outbound hrefs, deduped — how an agent checks its nav actually links. */
125
+ links: string[];
126
+ images: number;
127
+ data: StoreRenderDataEntry[];
128
+ diagnostics: StoreRenderDiagnostic[];
129
+ validation: StoreValidationReport;
130
+ /** Render/resolve rounds actually run. */
131
+ passes: number;
132
+ bytes: number;
133
+ }
134
+ /** Visible text of a markup string. Regex rather than a DOM because the
135
+ * workspace has no jsdom and the question — "what words are on this page" —
136
+ * does not need one. */
137
+ export declare function htmlToText(html: string): string;
138
+ /**
139
+ * Render a Store Document to HTML, headless, plus everything an agent needs to
140
+ * understand the result.
141
+ *
142
+ * const result = await renderStore(doc, { path: '/biography' })
143
+ * result.ok // did anything on the page go wrong
144
+ * result.outline // [{ level: 1, text: 'Biography' }, …]
145
+ * result.data // [{ loader: 'products.list', status: 'ready', count: 12 }]
146
+ * result.diagnostics
147
+ */
148
+ export declare function renderStore(input: StoreDocument | Record<string, unknown>, options?: RenderStoreOptions): Promise<StoreRenderResult>;
149
+ interface WrapOptions {
150
+ title: string;
151
+ description?: string;
152
+ lang: string;
153
+ themeCss: string;
154
+ stylesheets: readonly string[];
155
+ head: string;
156
+ /** Canonical / OpenGraph / JSON-LD declared by the route being rendered. */
157
+ seo?: Pick<StaticHeadInput, 'canonical' | 'image' | 'type' | 'jsonLd'>;
158
+ siteName?: string;
159
+ }
160
+ /**
161
+ * The HTML document around the shell markup.
162
+ *
163
+ * Deliberately minimal and self-contained: the theme's CSS variables ride
164
+ * inline (they are already data — M2's brand tokens), and any real stylesheet
165
+ * is LINKED rather than inlined, because the only thing that can produce the
166
+ * app's utility CSS is the app's own build. A caller with no stylesheet gets
167
+ * honest unstyled markup instead of a page that pretends to be styled.
168
+ */
169
+ export declare function wrapDocument(markup: string, options: WrapOptions): string;
170
+ export {};
171
+ //# sourceMappingURL=render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/document/render.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAIlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAa1D,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,sBAAsB,CAAA;AAE7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAoCvD,MAAM,WAAW,oBAAoB;IACnC,0EAA0E;IAC1E,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,MAAM,EAAE,OAAO,GAAG,OAAO,GAAG,YAAY,CAAA;IACxC,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAA;IACvB,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ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AA;IAC1B,4EAA4E;IAC5E,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,oBAAoB,EAAE,CAAA;IAC5B,WAAW,EAAE,qBAAqB,EAAE,CAAA;IACpC,UAAU,EAAE,qBAAqB,CAAA;IACjC,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;CACd;AA8BD;;yBAEyB;AACzB,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI/C;AAkGD;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,KAAK,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9C,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,iBAAiB,CAAC,CAqM5B;AAaD,UAAU,WAAW;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,4EAA4E;IAC5E,GAAG,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAA;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,MAAM,CAwCzE"}
@@ -0,0 +1,46 @@
1
+ import type { StorefrontConfig } from './config';
2
+ import { STORE_DOCUMENT_KIND } from './sections';
3
+ import type { StoreDocument } from './sections';
4
+ export declare function slugifyStoreName(name: string): string;
5
+ export interface ExportStoreOptions {
6
+ /** Namespace for auto-registered handles. Default: slug of the store name. */
7
+ appId?: string;
8
+ /**
9
+ * Register a deterministic handle (`<appId>.<config-path>`) for any code
10
+ * value that has none, instead of failing. `defineStorefront` turns this on
11
+ * so a store written today keeps working; a store that names its own handles
12
+ * (registerHandle) keeps its names — explicit registration always wins the
13
+ * reverse lookup.
14
+ */
15
+ registerMissingHandles?: boolean;
16
+ }
17
+ /**
18
+ * Serialize a defined/live store to Store Document v1.
19
+ *
20
+ * Data fields map to sections verbatim (the authored block form is preserved,
21
+ * flat or nested — both are data). Code fields become handle names in the
22
+ * `code` section. A data field smuggling code (JSX inside a page tree) is a
23
+ * hard error naming the offending path rather than a document that lies.
24
+ */
25
+ export declare function exportStore(config: StorefrontConfig, options?: ExportStoreOptions): StoreDocument;
26
+ export interface HydrateStoreOptions {
27
+ /**
28
+ * 'throw' (default): a document that fails validation aborts hydration with
29
+ * an error listing every finding — the authoring-loop contract (I2).
30
+ * 'report': log the findings and hydrate best-effort, dropping unresolvable
31
+ * code refs — the shopper-facing contract (I7: a broken document degrades
32
+ * instead of white-screening the store). The scaffold uses 'report'.
33
+ */
34
+ onError?: 'throw' | 'report';
35
+ }
36
+ /**
37
+ * Reconstitute a StorefrontConfig from a Store Document.
38
+ *
39
+ * Every code reference resolves through the handle registry by NAME — the
40
+ * document alone plus the app's registered handles is the whole story; there
41
+ * is no in-memory side channel keyed by app id anymore.
42
+ */
43
+ export declare function hydrateStoreDocument(input: StoreDocument | Record<string, unknown>, options?: HydrateStoreOptions): StorefrontConfig;
44
+ /** Re-export so document consumers need one import. */
45
+ export { STORE_DOCUMENT_KIND };
46
+ //# sourceMappingURL=round-trip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"round-trip.d.ts","sourceRoot":"","sources":["../../src/document/round-trip.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,gBAAgB,EAIjB,MAAM,UAAU,CAAA;AAKjB,OAAO,EAAE,mBAAmB,EAAwB,MAAM,YAAY,CAAA;AACtE,OAAO,KAAK,EAAuC,aAAa,EAAE,MAAM,YAAY,CAAA;AAoBpF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,MAAM,WAAW,kBAAkB;IACjC,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;;;OAMG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAA;CACjC;AA4DD;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,GAAE,kBAAuB,GAAG,aAAa,CAgKrG;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;CAC7B;AAQD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9C,OAAO,GAAE,mBAAwB,GAChC,gBAAgB,CAuIlB;AAED,uDAAuD;AACvD,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
@@ -0,0 +1,194 @@
1
+ import type { EntityDeclarationInput, JsonSchema } from '@fayz-ai/core';
2
+ import type { MockShopSeed } from '@fayz-ai/shop/mock';
3
+ import type { Promotion } from '@fayz-ai/shop/rules';
4
+ import type { StorefrontCommerceMode, StorefrontConfig, StorefrontDiscountConfig, StorefrontEnquiryConfig, StorefrontImageLoadingConfig, StorefrontRouteChrome, StorefrontRouteKind, StorefrontSearchConfig } from './config';
5
+ import type { StorefrontTheme } from '../lib/theme';
6
+ import type { HomeConfig, NavLink, FooterConfig } from '../blocks/sections';
7
+ import type { StorefrontPagesConfig } from '../blocks/page-blocks';
8
+ import type { StorefrontSlots } from '../extend/slots';
9
+ import type { StorefrontAuthConfig } from '../data/auth';
10
+ export declare const STORE_DOCUMENT_KIND = "fayz.store";
11
+ export declare const STORE_COMMERCE_MODES: readonly ["checkout", "catalog", "enquiry"];
12
+ export declare const STORE_PAYMENT_MODES: readonly ["mock", "pix-mercadopago", "gateway"];
13
+ export declare const STORE_PAYMENT_METHOD_KINDS: readonly ["pix", "credit_card", "debit_card", "boleto", "cash", "other"];
14
+ type ConfiguredBackendProvider = NonNullable<NonNullable<StorefrontConfig['backend']>['provider']>;
15
+ export declare const STORE_BACKEND_PROVIDERS: readonly ["mock", "fayz-api", "fayz-shop", "custom"];
16
+ export declare const STORE_ROUTE_KINDS: readonly ["home", "catalog", "product", "checkout", "account", "order", "custom"];
17
+ export declare const STORE_ROUTE_CHROMES: readonly ["default", "focused"];
18
+ export declare const STORE_THEME_RADII: readonly ["none", "soft", "round", "pill"];
19
+ interface StoreSectionBase {
20
+ /** This section's own schema version — sections evolve independently. */
21
+ version: number;
22
+ }
23
+ /** Identity: who the store is. The only mandatory section. */
24
+ export interface StoreIdentitySection extends StoreSectionBase {
25
+ name: string;
26
+ /** ISO 4217 — default 'BRL'. */
27
+ currency?: string;
28
+ /** Intl locale — default 'pt-BR'. */
29
+ locale?: string;
30
+ }
31
+ /** Visual identity — StorefrontTheme, spread into the section. */
32
+ export interface StoreThemeSection extends StoreSectionBase, StorefrontTheme {
33
+ }
34
+ /** Commercial behavior: mode, money, offers. */
35
+ export interface StoreCommerceSection extends StoreSectionBase {
36
+ commerceMode?: StorefrontCommerceMode;
37
+ shipping?: StorefrontConfig['shipping'];
38
+ payments?: StorefrontConfig['payments'];
39
+ discounts?: StorefrontDiscountConfig[];
40
+ enquiry?: StorefrontEnquiryConfig;
41
+ features?: StorefrontConfig['features'];
42
+ }
43
+ /** What the shopper sees: composed pages, slots, chrome. `footer` here holds
44
+ * only the serializable part — a non-string `credit` node moves to
45
+ * `code.footerCredit`. */
46
+ export interface StorePresentationSection extends StoreSectionBase {
47
+ announcement?: string;
48
+ /** Text logo. A JSX logo is code — it lives at `code.logo`. */
49
+ logo?: string;
50
+ home?: HomeConfig;
51
+ pages?: StorefrontPagesConfig;
52
+ slots?: StorefrontSlots;
53
+ nav?: NavLink[];
54
+ footer?: FooterConfig;
55
+ imageLoading?: StorefrontImageLoadingConfig;
56
+ catalogFacets?: StorefrontConfig['catalogFacets'];
57
+ productSpecs?: StorefrontConfig['productSpecs'];
58
+ /** Header search knobs. `renderSuggestion` is code — it lives at
59
+ * `code.searchRenderSuggestion`. */
60
+ search?: Omit<StorefrontSearchConfig, 'renderSuggestion'>;
61
+ }
62
+ /** Long-form content: legal/institutional pages and store-supplied reviews. */
63
+ export interface StoreContentSection extends StoreSectionBase {
64
+ legal?: StorefrontConfig['legal'];
65
+ reviews?: StorefrontConfig['reviews'];
66
+ }
67
+ /** The mock catalog seed (products/categories/discounts). */
68
+ export interface StoreCatalogSection extends StoreSectionBase, MockShopSeed {
69
+ }
70
+ /** Rule-engine promotions (spine M6): serializable Promotion values —
71
+ * eligibility rules + application method, attributes drawn from the
72
+ * rule_attribute vocabulary. "Buy 3 pay 2" and "REVENDA10 = 10% off" are
73
+ * both entries here, as pure data. */
74
+ export interface StorePromotionsSection extends StoreSectionBase {
75
+ promotions?: Promotion[];
76
+ }
77
+ /** Custom entity declarations (spine M4): the defineEntity inputs, keyed by
78
+ * entity key. Pure data — hydration re-declares them through defineEntity,
79
+ * which re-derives the schema, storage, RLS and loaders from the same input. */
80
+ export interface StoreEntitiesSection extends StoreSectionBase {
81
+ definitions?: Record<string, EntityDeclarationInput>;
82
+ }
83
+ /** Backend descriptor. The deprecated supabase fields ride along so a legacy
84
+ * config still round-trips losslessly; new stores use `auth.supabase`. */
85
+ export interface StoreBackendSection extends StoreSectionBase {
86
+ provider?: ConfiguredBackendProvider;
87
+ url?: string;
88
+ /** @deprecated legacy StorefrontConfig field, kept for lossless round-trip. */
89
+ supabaseUrl?: string;
90
+ /** @deprecated legacy StorefrontConfig field, kept for lossless round-trip. */
91
+ supabaseAnonKey?: string;
92
+ }
93
+ /** Customer auth, when it is expressible as data ('mock' / 'supabase' + urls).
94
+ * An auth config carrying code (an AuthAdapter object, a supabase client)
95
+ * moves whole to `code.auth`. */
96
+ export interface StoreAuthSection extends StoreSectionBase, StorefrontAuthConfig {
97
+ }
98
+ /** A custom route whose component is referenced by handle name. */
99
+ export interface StoreCodeRouteRef {
100
+ id: string;
101
+ path: string;
102
+ kind?: StorefrontRouteKind;
103
+ chrome?: StorefrontRouteChrome;
104
+ /** Handle name of the route component. */
105
+ component: string;
106
+ }
107
+ /**
108
+ * The code sidecar: every config field that holds code, referenced by the
109
+ * handle NAME it was registered under. Hydration resolves these through the
110
+ * handle registry — an unknown name is a hard error naming the valid set (I2),
111
+ * never a silent drop.
112
+ */
113
+ export interface StoreCodeSection extends StoreSectionBase {
114
+ /** Handle → React.ReactNode (JSX logo). */
115
+ logo?: string;
116
+ /** Handle → ShopProvider. */
117
+ provider?: string;
118
+ /** Handle → StorefrontAuthConfig carrying code. */
119
+ auth?: string;
120
+ /** Handle → React.ReactNode rendered as the footer credit line. */
121
+ footerCredit?: string;
122
+ /** Handle → the `(product) => ReactNode` renderer for a search suggestion. */
123
+ searchRenderSuggestion?: string;
124
+ /** Component-slot name → handle of its ComponentOverride. */
125
+ components?: Record<string, string>;
126
+ routes?: StoreCodeRouteRef[];
127
+ }
128
+ /** Store Document v1 — the serializable form of a whole storefront. */
129
+ export interface StoreDocument {
130
+ $kind: typeof STORE_DOCUMENT_KIND;
131
+ store: StoreIdentitySection;
132
+ theme?: StoreThemeSection;
133
+ commerce?: StoreCommerceSection;
134
+ presentation?: StorePresentationSection;
135
+ content?: StoreContentSection;
136
+ catalog?: StoreCatalogSection;
137
+ entities?: StoreEntitiesSection;
138
+ promotions?: StorePromotionsSection;
139
+ backend?: StoreBackendSection;
140
+ auth?: StoreAuthSection;
141
+ code?: StoreCodeSection;
142
+ }
143
+ export type StoreSectionName = Exclude<keyof StoreDocument, '$kind'>;
144
+ /**
145
+ * A field that is on its way out (spine I10).
146
+ *
147
+ * The section VERSION is what makes this mechanical rather than advisory:
148
+ * while the section is at a version below `removedAtVersion` the field is
149
+ * accepted and the store keeps working; a document that has been through the
150
+ * codemod carries the higher version, and at that version the field is a hard
151
+ * validation error naming `replacement` (I2). That is what lets one SDK serve
152
+ * both a migrated and an unmigrated fleet without a flag.
153
+ */
154
+ export interface StoreFieldDeprecation {
155
+ /** Row id in @fayz-ai/sdk's deprecation registry — the single source of the
156
+ * version window, the shim prose and the codemod id. */
157
+ id: string;
158
+ /** Section version at which this field stops being accepted. */
159
+ removedAtVersion: number;
160
+ /** Document path to write instead. */
161
+ replacement: string;
162
+ }
163
+ export interface StoreFieldSpec {
164
+ type: 'string' | 'number' | 'boolean' | 'object' | 'array';
165
+ description: string;
166
+ required?: boolean;
167
+ enum?: readonly string[];
168
+ /** Present when the field is deprecated. See {@link StoreFieldDeprecation}. */
169
+ deprecated?: StoreFieldDeprecation;
170
+ }
171
+ export interface StoreSectionSpec {
172
+ description: string;
173
+ /** Versions of this section this SDK understands, ascending. */
174
+ versions: readonly number[];
175
+ fields: Record<string, StoreFieldSpec>;
176
+ }
177
+ export declare const STORE_SECTIONS: Record<StoreSectionName, StoreSectionSpec>;
178
+ export declare const STORE_SECTION_NAMES: StoreSectionName[];
179
+ /** Compile a section's field spec to JSON Schema — the same one-declaration
180
+ * principle as `settingsToJsonSchema` (I1). */
181
+ export declare function sectionToJsonSchema(name: StoreSectionName): JsonSchema;
182
+ /**
183
+ * True when a value survives JSON serialization unchanged: the test that
184
+ * routes a config field into a data section versus the code sidecar. React
185
+ * elements (`$$typeof`), functions, class instances (providers, adapters,
186
+ * supabase clients) all fail it.
187
+ */
188
+ export declare function isJsonValue(value: unknown): boolean;
189
+ export declare function isRecord(value: unknown): value is Record<string, unknown>;
190
+ /** Copy of `obj` without `undefined`-valued keys, so a document holds exactly
191
+ * what JSON can carry and object equality means what it looks like. */
192
+ export declare function compact<T extends Record<string, unknown>>(obj: T): T;
193
+ export {};
194
+ //# sourceMappingURL=sections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sections.d.ts","sourceRoot":"","sources":["../../src/document/sections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EA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AAW,EAAE,MAAM,CAAA;IACnB,gEAAgE;IAChE,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;IAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;CACvC;AAQD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,gBAAgB,EAAE,gBAAgB,CA+JrE,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAkC,gBAAgB,EAAE,CAAA;AAEpF;gDACgD;AAChD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,gBAAgB,GAAG,UAAU,CA+BtE;AAID;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAenD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAED;wEACwE;AACxE,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAMpE"}
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import type { StoreSettings } from '@fayz-ai/shop/types';
3
+ import { type ResolvedStorefrontConfig } from './config';
4
+ /**
5
+ * Merge a store's saved policy over its declared config.
6
+ *
7
+ * Pure and exported for its own sake: this is the function that decides what a
8
+ * shopper is offered, and it should be testable without a provider, a network or
9
+ * a React tree.
10
+ */
11
+ export declare function applyStoreSettings(config: ResolvedStorefrontConfig, settings: StoreSettings | null | undefined): ResolvedStorefrontConfig;
12
+ /**
13
+ * Boot-time read of the store's policy, wrapped around the config provider.
14
+ *
15
+ * Renders the DECLARED config immediately and re-renders with the merchant's
16
+ * policy when it lands. Deliberately not a blocking await: a storefront must
17
+ * paint its catalogue without waiting on a settings round trip, and the fields
18
+ * this can change (currency symbol, which payment chips the checkout shows) are
19
+ * not on the first-paint path of the home page.
20
+ *
21
+ * A provider without `getPublicStoreSettings`, an unpublished store, or a failed
22
+ * request all resolve to the same thing: the declared config, unchanged. There
23
+ * is no error state, because there is nothing for a shopper to do about it.
24
+ */
25
+ export declare function StorefrontConfigHost({ config, children, }: {
26
+ config: ResolvedStorefrontConfig;
27
+ children: React.ReactNode;
28
+ }): React.JSX.Element;
29
+ //# sourceMappingURL=store-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store-policy.d.ts","sourceRoot":"","sources":["../../src/document/store-policy.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAA4B,KAAK,wBAAwB,EAAE,MAAM,UAAU,CAAA;AAuBlF;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,wBAAwB,EAChC,QAAQ,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,GACzC,wBAAwB,CA6B1B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,QAAQ,GACT,EAAE;IACD,MAAM,EAAE,wBAAwB,CAAA;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,qBA8BA"}
@@ -0,0 +1,112 @@
1
+ import type { StoreDocument, StoreSectionName } from './sections';
2
+ import type { StoreValidationReport } from './validate';
3
+ /** One deprecated thing found in one store. */
4
+ export interface StoreDeprecationFinding {
5
+ /** Registry row id. */
6
+ id: string;
7
+ /** Dotted document path, when the deprecation is on the document surface. */
8
+ path?: string;
9
+ /** What exactly was found, in the author's words. */
10
+ detail: string;
11
+ deprecatedIn: string;
12
+ removeIn: string;
13
+ /** I2 — always present, always the thing to write instead. */
14
+ replacement: string;
15
+ /** The codemod that answers it. */
16
+ codemod: string;
17
+ /** False when only a human can retire it (pool state, code outside the document). */
18
+ automatable: boolean;
19
+ }
20
+ /** Why a codemod would not run, and what a human has to decide instead. */
21
+ export interface StoreCodemodRefusal {
22
+ reason: string;
23
+ /** The decisions, one per line. Never a suggestion the codemod could have
24
+ * taken itself — if it could, it would have. */
25
+ decide: string[];
26
+ }
27
+ export type StoreCodemodStatus =
28
+ /** The document changed (possibly only its section version). */
29
+ 'applied'
30
+ /** Nothing here to migrate: the section is absent, or already past this version. */
31
+ | 'not-applicable'
32
+ /** Something is here, and moving it safely needs a human. */
33
+ | 'refused';
34
+ /** A section version move — the key the codemod is filed under. */
35
+ export interface StoreCodemodVersionKey {
36
+ section: StoreSectionName;
37
+ from: number;
38
+ to: number;
39
+ }
40
+ export interface StoreCodemodResult {
41
+ codemod: string;
42
+ status: StoreCodemodStatus;
43
+ /** Registry ids this codemod retires. */
44
+ deprecations: string[];
45
+ /** The version move, or null for a deprecation that is not on the document
46
+ * surface at all — which is itself why such a codemod always refuses. */
47
+ version: StoreCodemodVersionKey | null;
48
+ /** One line per document change, in the applyChange path vocabulary. */
49
+ changes: string[];
50
+ note: string;
51
+ refusal?: StoreCodemodRefusal;
52
+ }
53
+ export interface StoreUpgradeOptions {
54
+ /** Restrict the run to these codemod ids. Unknown ids are a hard error
55
+ * naming the valid set (I2). */
56
+ only?: readonly string[];
57
+ }
58
+ export interface StoreUpgradeResult {
59
+ /** False when a codemod refused or the result would not validate. */
60
+ ok: boolean;
61
+ /** The upgraded document. Deep-equal to the input when `changed` is false. */
62
+ doc: StoreDocument;
63
+ changed: boolean;
64
+ deprecations: StoreDeprecationFinding[];
65
+ codemods: StoreCodemodResult[];
66
+ /** The result validated. A codemod that would break the document is a bug
67
+ * in the codemod, and this is where it surfaces. */
68
+ validation: StoreValidationReport;
69
+ }
70
+ /**
71
+ * What in THIS document is deprecated — the machine-readable answer to the
72
+ * question I10 exists to make askable.
73
+ *
74
+ * Only the document surface is visible from here. A deprecation living in the
75
+ * store's own code (the productMetadata overlay) or in a pool (the two SQL
76
+ * ones) is reported by its row as un-automatable rather than omitted: an
77
+ * enumerable deprecation that quietly drops the ones you cannot see from a
78
+ * JSON file would be the silent-failure mode the whole spine is against.
79
+ */
80
+ export declare function scanStoreDeprecations(input: StoreDocument | Record<string, unknown>): StoreDeprecationFinding[];
81
+ /**
82
+ * The deprecations no document can answer for, with the reason.
83
+ *
84
+ * The CLI merges these into its report so `fayz upgrade` never implies a store
85
+ * is clean when the only reason it looks clean is that the evidence is not in
86
+ * the repo.
87
+ */
88
+ export declare function unobservableDeprecations(): StoreDeprecationFinding[];
89
+ /** Every codemod id, in run order. */
90
+ export declare const STORE_CODEMOD_IDS: readonly string[];
91
+ /** What each codemod is, as data — describeStore publishes this. */
92
+ export interface StoreCodemodDescriptor {
93
+ id: string;
94
+ title: string;
95
+ /** Registry ids it retires. */
96
+ deprecations: string[];
97
+ /** The section version it is keyed to, or null when the deprecation is not
98
+ * on the document surface (such a codemod always refuses). */
99
+ version: StoreCodemodVersionKey | null;
100
+ /** Can it ever apply without a human? */
101
+ automatable: boolean;
102
+ }
103
+ export declare function describeCodemods(): StoreCodemodDescriptor[];
104
+ /**
105
+ * Run the codemods against a document and report exactly what would change.
106
+ *
107
+ * PURE: the input document is never mutated, and a refused codemod contributes
108
+ * nothing to the output — a refusal must leave the document byte-identical or
109
+ * the refusal was not a refusal.
110
+ */
111
+ export declare function upgradeStore(input: StoreDocument | Record<string, unknown>, options?: StoreUpgradeOptions): StoreUpgradeResult;
112
+ //# sourceMappingURL=upgrade.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../src/document/upgrade.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAEjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAyBvD,+CAA+C;AAC/C,MAAM,WAAW,uBAAuB;IACtC,uBAAuB;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,6EAA6E;IAC7E,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,qDAA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kBAAkB,EAAE,CAAA;IAC9B;yDACqD;IACrD,UAAU,EAAE,qBAAqB,CAAA;CAClC;AA4BD;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,uBAAuB,EAAE,CAgC/G;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,IAAI,uBAAuB,EAAE,CAIpE;AAsUD,sCAAsC;AACtC,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAAkC,CAAA;AAEjF,oEAAoE;AACpE,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,+BAA+B;IAC/B,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB;mEAC+D;IAC/D,OAAO,EAAE,sBAAsB,GAAG,IAAI,CAAA;IACtC,yCAAyC;IACzC,WAAW,EAAE,OAAO,CAAA;CACrB;AAED,wBAAgB,gBAAgB,IAAI,sBAAsB,EAAE,CAQ3D;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9C,OAAO,GAAE,mBAAwB,GAChC,kBAAkB,CAqCpB"}
@@ -0,0 +1,24 @@
1
+ export interface StoreValidationError {
2
+ /** Dotted path into the document ('presentation.pages.home.blocks[2].type'). */
3
+ path: string;
4
+ /** Stable machine-readable code ('unknown-block', 'unsupported-section-version', …). */
5
+ code: string;
6
+ message: string;
7
+ /** The valid set, present on every unknown-id error — what the AI corrects on. */
8
+ valid?: string[];
9
+ }
10
+ export interface StoreValidationReport {
11
+ ok: boolean;
12
+ errors: StoreValidationError[];
13
+ }
14
+ export declare const STOREFRONT_PAGE_KINDS: readonly ["home", "catalog", "product", "collection", "content"];
15
+ /**
16
+ * Validate a Store Document against the registries and section schemas.
17
+ *
18
+ * Self-sufficient: registers the SDK blocks before checking, so "unknown
19
+ * block" always names the true valid set. App-local blocks and handles must be
20
+ * registered by the app's own modules before this runs — which is the same
21
+ * precondition rendering has.
22
+ */
23
+ export declare function validateStore(doc: unknown): StoreValidationReport;
24
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/document/validate.ts"],"names":[],"mappings":"AA6DA,MAAM,WAAW,oBAAoB;IACnC,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAA;IACZ,wFAAwF;IACxF,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,kFAAkF;IAClF,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,OAAO,CAAA;IACX,MAAM,EAAE,oBAAoB,EAAE,CAAA;CAC/B;AAED,eAAO,MAAM,qBAAqB,kEAAmE,CAAA;AAq4BrG;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,qBAAqB,CA4DjE"}