@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,46 @@
1
+ import type { BlockNode } from '@fayz-ai/core';
2
+ import type { PageDataEntry, PageDataNeed } from '../blocks/page-data';
3
+ /**
4
+ * What a route declared for the document head during a static render.
5
+ *
6
+ * Title and description are the client-rendered baseline. The rest is what a
7
+ * page needs to be worth anything once it HAS its own URL: a canonical so the
8
+ * engine knows which address is authoritative, an image and type so a share in
9
+ * a messaging app is not a grey rectangle, and JSON-LD so a product is eligible
10
+ * for a rich result instead of a plain blue link.
11
+ */
12
+ export interface StaticHeadInput {
13
+ title?: string;
14
+ description?: string | null;
15
+ /** Absolute URL. A relative canonical is ignored by search engines. */
16
+ canonical?: string;
17
+ /** Absolute URL of the image a share should show. */
18
+ image?: string;
19
+ /** OpenGraph type — 'website', 'article', 'product'. */
20
+ type?: string;
21
+ /** schema.org objects, emitted as <script type="application/ld+json">. */
22
+ jsonLd?: Array<Record<string, unknown>>;
23
+ }
24
+ export interface StaticRenderPass {
25
+ /** Called once per scope, so a page plus its slots report the whole rendered
26
+ * composition — including forced-layout repairs (I7). */
27
+ tree(nodes: readonly BlockNode[]): void;
28
+ needs(needs: readonly PageDataNeed[]): void;
29
+ head(input: StaticHeadInput): void;
30
+ /** Resolved by an earlier pass, keyed by `dataNeedKey`. A key present here is
31
+ * served instead of being fetched. */
32
+ entries: Readonly<Record<string, PageDataEntry>>;
33
+ /**
34
+ * Absolute origin the rendered page will be served from, when the caller
35
+ * knows it. Pages need it to declare a canonical or an og:image, and a static
36
+ * render has no `window.location` to infer one from — so it travels with the
37
+ * pass rather than being guessed per page.
38
+ */
39
+ origin?: string;
40
+ }
41
+ /** The pass currently rendering, or null — which is every browser render. */
42
+ export declare function currentStaticRenderPass(): StaticRenderPass | null;
43
+ /** Run one synchronous render with `pass` installed. Nesting restores the
44
+ * previous pass, so a renderer inside a renderer cannot strand the global. */
45
+ export declare function withStaticRenderPass<T>(pass: StaticRenderPass, render: () => T): T;
46
+ //# sourceMappingURL=static-render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static-render.d.ts","sourceRoot":"","sources":["../../src/app/static-render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAYtE;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,0EAA0E;IAC1E,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CACxC;AAED,MAAM,WAAW,gBAAgB;IAC/B;8DAC0D;IAC1D,IAAI,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,GAAG,IAAI,CAAA;IACvC,KAAK,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,GAAG,IAAI,CAAA;IAC3C,IAAI,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAAA;IAClC;2CACuC;IACvC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAA;IAChD;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAID,6EAA6E;AAC7E,wBAAgB,uBAAuB,IAAI,gBAAgB,GAAG,IAAI,CAEjE;AAED;+EAC+E;AAC/E,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAQlF"}
@@ -0,0 +1,59 @@
1
+ import type { BlockDescriptor } from '@fayz-ai/core';
2
+ import type { StoreDocument } from '../document/sections';
3
+ export interface BlockAtPath {
4
+ /** The path as given, echoed so a caller can key state by it. */
5
+ path: string;
6
+ /** The block's registered type. */
7
+ type: string;
8
+ /**
9
+ * Where this block's settings live: `<path>.props` for the nested form,
10
+ * `<path>` itself for the flat one. Both forms MIX inside one array, so a
11
+ * caller appending `.props` by hand is right about some blocks and silently
12
+ * wrong about the rest. Pass this to `settingChange` and it cannot happen.
13
+ */
14
+ settingsPath: string;
15
+ /** Current values, whichever form they took — the form's initial state. */
16
+ props: Record<string, unknown>;
17
+ /** Empty when the block declares no settings, which is itself the answer. */
18
+ settings: BlockDescriptor['settings'];
19
+ /** For a caller that wants labels, help text or presets. */
20
+ descriptor: BlockDescriptor | null;
21
+ }
22
+ export type BlockAtPathError = {
23
+ code: 'unparseable-path';
24
+ message: string;
25
+ } | {
26
+ code: 'no-block-at-path';
27
+ message: string;
28
+ } | {
29
+ code: 'unknown-block';
30
+ message: string;
31
+ valid: string[];
32
+ };
33
+ /**
34
+ * Resolve a picked path against a Store Document.
35
+ *
36
+ * Every failure names what went wrong and, for an unknown block, the valid set
37
+ * (I2) — an editor that silently renders an empty panel teaches a merchant that
38
+ * the editor is broken.
39
+ */
40
+ export declare function blockAtPath(document: StoreDocument | Record<string, unknown>, path: string): {
41
+ ok: true;
42
+ block: BlockAtPath;
43
+ } | {
44
+ ok: false;
45
+ error: BlockAtPathError;
46
+ };
47
+ /**
48
+ * The change that saves one edited setting.
49
+ *
50
+ * Takes `settingsPath`, not the block's path: only `blockAtPath` has seen the
51
+ * node and knows which form it took. Hardcoding `.props.` here wrote an ignored
52
+ * key on every flat block — a save that reported success and changed nothing.
53
+ */
54
+ export declare function settingChange(settingsPath: string, settingId: string, value: unknown): {
55
+ op: 'set' | 'remove';
56
+ path: string;
57
+ value?: unknown;
58
+ };
59
+ //# sourceMappingURL=block-at-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block-at-path.d.ts","sourceRoot":"","sources":["../../src/blocks/block-at-path.ts"],"names":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,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAMA"}
@@ -0,0 +1,163 @@
1
+ import type { BlockDataNeeds, BlockNode } from '@fayz-ai/core';
2
+ import type { StorefrontSection } from './sections';
3
+ import type { StorefrontTheme } from '../lib/theme';
4
+ /** Pages that are composed from blocks, and the `enabledOn` vocabulary.
5
+ * `content` is the editorial kind: a titled page that is nothing but blocks —
6
+ * no commerce body, no catalog assumptions. */
7
+ export type StorefrontPageKind = 'home' | 'catalog' | 'product' | 'collection' | 'content';
8
+ /**
9
+ * A block instance in a page tree — the general form.
10
+ *
11
+ * `id` matters more than it looks: two product rails on one page are
12
+ * indistinguishable without it, so an external editor cannot target one of them
13
+ * and an AI-generated diff cannot say which it changed. VTEX solved the same
14
+ * problem with `rich-text#hero`; this is the same idea spelled as a field.
15
+ */
16
+ export interface StorefrontBlockRef {
17
+ /** Registered block id — an SDK section, a plugin block, or an app's own. */
18
+ type: string;
19
+ id?: string;
20
+ props?: Record<string, unknown>;
21
+ children?: readonly StorefrontBlockRef[];
22
+ /**
23
+ * Instance-level data needs, merged over the block meta's `data` declaration
24
+ * by need name — how a document points a block's loader at a route param
25
+ * (`{ products: { loader: 'products.list', params: { category: { $param:
26
+ * 'slug' } } } }`). Resolved once per page by the page-data scope.
27
+ */
28
+ data?: BlockDataNeeds;
29
+ }
30
+ /**
31
+ * What a page's block list accepts.
32
+ *
33
+ * The typed union keeps checking SDK sections (a bad `variant` is still a type
34
+ * error); the open ref form is what lets an app place its own registered block
35
+ * without casting.
36
+ */
37
+ export type StorefrontBlockLike = StorefrontSection | StorefrontBlockRef;
38
+ export interface StorefrontPageConfig {
39
+ blocks: readonly StorefrontBlockLike[];
40
+ }
41
+ /**
42
+ * An editorial page, expressible entirely in the document: a slug, a title, a
43
+ * route, and blocks. This is the page kind that absorbs the "brand site half"
44
+ * of a store — biography, philosophy, press, collections — which today lives
45
+ * as hand-written custom routes (cristinarotondaro carries ~240 lines of them).
46
+ *
47
+ * The store chrome (header, footer, cart) still frames the page; what a
48
+ * content page does NOT get is a commerce body block or any catalog
49
+ * assumption. It is blocks all the way down.
50
+ */
51
+ export interface StorefrontContentPageConfig extends StorefrontPageConfig {
52
+ /** Document/page title (`<title>` gets "<title> — <store>"). Defaults to the slug. */
53
+ title?: string;
54
+ /**
55
+ * Route path. Defaults to `/<slug>`. May declare params (`/categoria/:slug`)
56
+ * — one page then serves every match, and its blocks read the params through
57
+ * `$param` loader bindings (M3). validateStore checks that every binding
58
+ * names a param the path declares.
59
+ */
60
+ path?: string;
61
+ /**
62
+ * Theme overlay applied ONLY inside this page, merged over the store theme.
63
+ *
64
+ * This is what makes a campaign page — a licensed line, a seasonal drop, a
65
+ * collab — expressible as a content page instead of a microsite. Stores
66
+ * routinely build those elsewhere and lose the funnel with them: the "buy"
67
+ * CTA leaves for another domain and the cart, the session and the
68
+ * attribution go with it.
69
+ *
70
+ * The overlay is emitted scoped to `[data-page="<slug>"]`, so a hot-pink
71
+ * summer drop cannot repaint the header, the cart drawer or any other route.
72
+ * It merges key by key, so a page that sets only `colors.primary` keeps the
73
+ * store's typography and every other token.
74
+ */
75
+ theme?: Partial<StorefrontTheme>;
76
+ }
77
+ /**
78
+ * Merge a page's theme overlay over the store theme.
79
+ *
80
+ * Nested groups merge rather than replace: a page declaring one colour must not
81
+ * silently drop the store's fonts, radii and brand tokens back to SDK defaults.
82
+ */
83
+ export declare function mergePageTheme(base: StorefrontTheme | undefined, overlay: Partial<StorefrontTheme> | undefined): StorefrontTheme | undefined;
84
+ /** The wrapper attribute + selector a page's scoped theme is emitted under. */
85
+ export declare function pageThemeSelector(slug: string): string;
86
+ /** The params a route path pattern declares ('/categoria/:slug' → ['slug']). */
87
+ export declare function routePathParams(path: string): string[];
88
+ export interface StorefrontPagesConfig {
89
+ home?: StorefrontPageConfig;
90
+ catalog?: StorefrontPageConfig;
91
+ product?: StorefrontPageConfig;
92
+ collection?: StorefrontPageConfig;
93
+ /** Editorial pages, keyed by slug. */
94
+ content?: Record<string, StorefrontContentPageConfig>;
95
+ }
96
+ /** Route path of one content page (explicit `path`, or `/<slug>`). */
97
+ export declare function contentPagePath(slug: string, page: StorefrontContentPageConfig): string;
98
+ export interface ContentPageMatch {
99
+ slug: string;
100
+ page: StorefrontContentPageConfig;
101
+ /** Params extracted from the page's path pattern, when it declares any. */
102
+ params: Record<string, string>;
103
+ }
104
+ /** The content page a path resolves to, if the store declared one. Paths are
105
+ * patterns (`/categoria/:slug`), so one declared page can serve a family of
106
+ * URLs and hand the matched params to its blocks' `$param` bindings. */
107
+ export declare function matchContentPage(pages: StorefrontPagesConfig | undefined, path: string): ContentPageMatch | null;
108
+ /** Block ids for the native page bodies — Shopify's `main` section, by another name. */
109
+ export declare const CATALOG_BODY_BLOCK = "catalogBody";
110
+ export declare const PRODUCT_BODY_BLOCK = "productBody";
111
+ /**
112
+ * Keys that are block identity rather than props, in the nested form.
113
+ *
114
+ * Exported for the same reason `blockInstanceId` is: it must be ONE rule.
115
+ * Whoever asks "where do this block's settings live" — the renderer here, the
116
+ * editor via `blockAtPath`, the overlay's settings/structure guard — has to get
117
+ * the same answer, or an edit an editor accepts is one the renderer ignores.
118
+ */
119
+ export declare const BLOCK_STRUCTURAL_KEYS: ReadonlySet<string>;
120
+ /**
121
+ * Does this entry keep its settings under `props` (nested form) or inline on
122
+ * the entry itself (flat form)?
123
+ *
124
+ * Both forms are first-class and they MIX inside one array — artorious's home
125
+ * page is 3 nested and 5 flat — so nothing may assume the shape from the path
126
+ * it took to get here.
127
+ */
128
+ export declare function isNestedBlockRef(entry: unknown): boolean;
129
+ /**
130
+ * The id a block instance is known by: the authored `id`, or `<type>-<index>`
131
+ * when it has none.
132
+ *
133
+ * Exported because it must be ONE rule. A block with no authored id still
134
+ * reaches the outside world under its synthesized id — `renderStore` reports
135
+ * it, an editor targets it, a generated diff names it — so `applyChange` has
136
+ * to resolve `blocks[#banner-0]` to the same entry the renderer called
137
+ * `banner-0`. Two implementations of this rule would make the id an agent is
138
+ * handed by one ability unusable by another.
139
+ */
140
+ export declare function blockInstanceId(entry: unknown, index: number): string;
141
+ /** Normalize an authored block list into the block tree the renderer consumes. */
142
+ export declare function toBlockNodes(blocks: readonly StorefrontBlockLike[]): BlockNode[];
143
+ /**
144
+ * The default tree for a page kind — what the SDK renders when a store has not
145
+ * composed the page. For catalog and product that is the native body alone,
146
+ * which is why adopting `pages` is a no-op until a store adds something.
147
+ */
148
+ export declare function defaultPageBlocks(kind: StorefrontPageKind): BlockNode[];
149
+ export interface PageBlockDiagnostic {
150
+ level: 'error' | 'warning';
151
+ rule: string;
152
+ detail: string;
153
+ }
154
+ /**
155
+ * Diagnostics for one composed page.
156
+ *
157
+ * These are reported, not enforced. A store in production must not go blank
158
+ * because a block was placed on a page its author did not anticipate — so the
159
+ * hard stop belongs in the editor (which reads the same `enabledOn` through
160
+ * `describeBlocks`), and this is the development-time equivalent.
161
+ */
162
+ export declare function checkPageBlocks(kind: StorefrontPageKind, nodes: readonly BlockNode[]): PageBlockDiagnostic[];
163
+ //# sourceMappingURL=page-blocks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page-blocks.d.ts","sourceRoot":"","sources":["../../src/blocks/page-blocks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AA+BnD;;gDAEgD;AAChD,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,CAAA;AAE1F;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,M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le' | 'loading' | 'ready' | 'error';
4
+ export interface PageDataEntry {
5
+ status: 'loading' | 'ready' | 'error';
6
+ data?: unknown;
7
+ error?: string;
8
+ }
9
+ /** One collected, binding-resolved, deduped need. */
10
+ export interface PageDataNeed {
11
+ key: string;
12
+ loader: string;
13
+ params: Record<string, unknown>;
14
+ }
15
+ /**
16
+ * Resolve a declared need's param bindings against the page's route params and
17
+ * the declaring block's props (setting defaults filled in, so the declaration
18
+ * and the rendered block agree on unset props). A binding that resolves to
19
+ * `undefined` drops its param — dataNeedKey drops undefined anyway, so the
20
+ * declared need and a hook asking with explicit `undefined`s share a key.
21
+ */
22
+ export declare function resolveDataParams(need: BlockDataNeed, context: {
23
+ params: Record<string, string>;
24
+ props: Record<string, unknown>;
25
+ }): Record<string, unknown>;
26
+ /**
27
+ * Walk a block tree (children included) and collect every declared need,
28
+ * bindings resolved, deduped by canonical (loader, params) key.
29
+ */
30
+ export declare function collectDataNeeds(nodes: readonly BlockNode[], routeParams?: Record<string, string>): PageDataNeed[];
31
+ /** Resolve ONE need through the provider port. Never throws: an unknown
32
+ * loader or a failing read becomes an 'error' entry for that need alone. */
33
+ export declare function resolvePageDataNeed(need: Pick<PageDataNeed, 'loader' | 'params'>): Promise<PageDataEntry>;
34
+ /** Resolve a set of needs concurrently, isolated per need. Test seam and the
35
+ * future server-side entry point — the scope component uses the same calls. */
36
+ export declare function resolvePageData(needs: readonly PageDataNeed[]): Promise<Record<string, PageDataEntry>>;
37
+ export interface PageDataScopeProps {
38
+ nodes: readonly BlockNode[];
39
+ /** Route params the tree's `$param` bindings resolve against. */
40
+ params?: Record<string, string>;
41
+ /**
42
+ * Pre-resolved entries, keyed by dataNeedKey — the server-side/static-render
43
+ * seam (L4): `resolvePageData(collectDataNeeds(nodes))` ahead of render,
44
+ * then hand the results in. Keys already 'ready' here are never re-fetched;
45
+ * anything missing resolves client-side as usual.
46
+ */
47
+ initial?: Record<string, PageDataEntry>;
48
+ children: React.ReactNode;
49
+ }
50
+ /**
51
+ * Collects and resolves the data needs of one block tree, and provides the
52
+ * results. Scopes nest (a slot inside a page): a child scope reuses every
53
+ * entry an ancestor already resolved and only fetches its own remainder, so
54
+ * dedupe holds across the whole rendered page, not per tree.
55
+ */
56
+ export declare function PageDataScope({ nodes, params, initial, children }: PageDataScopeProps): React.JSX.Element;
57
+ export interface UseLoaderResult<T> {
58
+ status: PageDataStatus;
59
+ data: T | null;
60
+ error: string | null;
61
+ /** Re-run the read (bypasses the page-resolved entry from then on). */
62
+ reload: () => void;
63
+ }
64
+ /**
65
+ * A block's (or page's) read: `useLoader('products.list', { filter, limit })`.
66
+ *
67
+ * When a PageDataScope above already resolved the same (loader, params) pair —
68
+ * because this block, or ANY block on the page, declared it — the resolved
69
+ * entry is returned and no request is made. Otherwise the hook resolves the
70
+ * loader itself, through the same provider port, so a component used outside a
71
+ * composed page (a store's hand-written route) keeps working identically.
72
+ * Pass `null` params to disable the read.
73
+ */
74
+ export declare function useLoader<T>(loader: string, params: Record<string, unknown> | null): UseLoaderResult<T>;
75
+ /**
76
+ * A BLOCK's named data need: `useBlockData(node, 'products', fallback)`.
77
+ *
78
+ * Reads the block's effective declaration — meta `data` with the document
79
+ * instance's `data` merged over it — and resolves its bindings with the SAME
80
+ * inputs the page resolver used (scope route params, node props over setting
81
+ * defaults), so the two always compute the same key. That is what makes a
82
+ * document able to rebind a param (`category: { $param: 'slug' }`) and have
83
+ * the rendered block follow: the block asks for its declared need, not for a
84
+ * hardcoded one.
85
+ *
86
+ * `fallback` covers the component being used directly as JSX (a store's
87
+ * hand-written route), where there is no node and no declaration to read.
88
+ */
89
+ export declare function useBlockData<T>(node: BlockNode | undefined, name: string, fallback: {
90
+ loader: string;
91
+ params: Record<string, unknown>;
92
+ }): UseLoaderResult<T> & {
93
+ loader: string;
94
+ };
95
+ /**
96
+ * What a block renders when its declared data failed: nothing for shoppers, a
97
+ * visible card for builders — the same visibility rule as a crashed block
98
+ * (M2's per-block error boundary, WooCommerce's `CURRENT_USER_IS_ADMIN ?
99
+ * onError : () => null`).
100
+ */
101
+ export declare function BlockDataError({ loader, message }: {
102
+ loader: string;
103
+ message?: string | null;
104
+ }): React.JSX.Element | null;
105
+ //# sourceMappingURL=page-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page-data.d.ts","sourceRoot":"","sources":["../../src/blocks/page-data.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkE,MAAM,OAAO,CAAA;AAUtF,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAqB7D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;AAEnE,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;IACrC,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,qDAAqD;AACrD,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAChC;AAID;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAC1E,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASzB;AASD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,WAAW,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GACvC,YAAY,EAAE,CAkBhB;AAID;6EAC6E;AAC7E,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,EA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eAAe,CAAC,CAAC,CAAC,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAiBzC;AAID;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,4BAiB9F"}
@@ -3,4 +3,4 @@ import type { StorefrontSection } from './sections';
3
3
  export declare function registerStorefrontBlocks(): void;
4
4
  /** Convert the typed storefront section blueprint into a generic block tree. */
5
5
  export declare function sectionsToBlocks(sections: readonly StorefrontSection[]): BlockNode[];
6
- //# sourceMappingURL=blocks.d.ts.map
6
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/blocks/registry.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAkEnD,wBAAgB,wBAAwB,IAAI,IAAI,CA4C/C;AAKD,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,GAAG,SAAS,EAAE,CAKpF"}
@@ -1,4 +1,5 @@
1
- import type { HeroVariant } from './theme';
1
+ import type { HeroVariant } from '../lib/theme';
2
+ import type { StorefrontBlockLike } from './page-blocks';
2
3
  import type React from 'react';
3
4
  export interface HeroSlide {
4
5
  title: string;
@@ -93,7 +94,20 @@ export type StorefrontSection = {
93
94
  /** @deprecated Use StorefrontSection. Kept for existing generated stores. */
94
95
  export type HomeSection = StorefrontSection;
95
96
  export interface HomeConfig {
96
- sections: readonly StorefrontSection[];
97
+ /**
98
+ * Accepts an app's own registered block, not just the SDK's typed sections.
99
+ *
100
+ * `home` and `pages.home` are the same page written two ways, and
101
+ * `pages.home.blocks` has taken `StorefrontBlockLike` since the page-tree
102
+ * work — so the short form five of seven live stores actually write was the
103
+ * one that still could not name a block the union has never heard of. That
104
+ * asymmetry is what forced `sections: mySections as never`, which throws away
105
+ * type checking on the whole array to place one custom block.
106
+ *
107
+ * The typed union is still first in the union, so a bad `variant` on an SDK
108
+ * section remains a type error.
109
+ */
110
+ sections: readonly StorefrontBlockLike[];
97
111
  }
98
112
  export interface NavLink {
99
113
  label: string;
@@ -124,4 +138,28 @@ export interface FooterConfig {
124
138
  }
125
139
  /** Wide gradient SVG data-URI — deterministic hero/banner art, no network. */
126
140
  export declare function bannerPlaceholder(label: string, hueA: number, hueB: number, w?: number, h?: number): string;
141
+ /**
142
+ * The aspect ratios the SDK's layouts are built around. A replacement image
143
+ * that honours these drops in; one that does not will letterbox or crop.
144
+ *
145
+ * product 3:4 portrait (cards, gallery) 750 × 1000
146
+ * banner ~21:9 wide (promo strips) 1600 × 700
147
+ * category 4:5 portrait (showcase tiles) 480 × 600
148
+ *
149
+ * `product` is 3:4 because that is what ProductCard's `imageAspect: 'portrait'`
150
+ * actually renders (`aspect-[3/4]`). Amboras's placeholder README prescribes
151
+ * "3:4 portrait (800x1000px)" — 800 × 1000 is 4:5, so following their pixels
152
+ * would letterbox every card by 5%. Ratios are worth copying; arithmetic is
153
+ * worth checking.
154
+ */
155
+ export declare const PLACEHOLDER_ASPECTS: {
156
+ readonly product: readonly [750, 1000];
157
+ readonly banner: readonly [1600, 700];
158
+ readonly category: readonly [480, 600];
159
+ };
160
+ /**
161
+ * Portrait product placeholder as an SVG data-URI — deterministic per product
162
+ * name, no network. Defaults to the prescribed 3:4.
163
+ */
164
+ export declare function productPlaceholder(label: string, w?: number, h?: number): string;
127
165
  //# sourceMappingURL=sections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sections.d.ts","sourceRoot":"","sources":["../../src/blocks/sections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAI/C,OAAO,KA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AA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB,CAAA;CACF;AAED,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,SAAO,EAAE,CAAC,SAAM,GAAG,MAAM,CAYtG;AAkBD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB;;;;CAItB,CAAA;AAiBV;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,CAAC,GAAE,MAAuC,EAC1C,CAAC,GAAE,MAAuC,GACzC,MAAM,CAcR"}
@@ -0,0 +1,162 @@
1
+ // src/diagnostics/seo-audit.ts
2
+ var metaContent = (input, key) => input.meta.find((m) => m.name === key || m.property === key)?.content?.trim() || void 0;
3
+ function gradeFor(score) {
4
+ if (score >= 90) return "A";
5
+ if (score >= 75) return "B";
6
+ if (score >= 60) return "C";
7
+ if (score >= 40) return "D";
8
+ return "F";
9
+ }
10
+ function auditStorefrontSeo(input) {
11
+ const f = [];
12
+ const add = (id, label, status, detail, why, weight) => f.push({ id, label, status, detail, why, weight });
13
+ const isFragment = (input.url ?? input.path).includes("#/");
14
+ add(
15
+ "real-url",
16
+ "Real URL",
17
+ isFragment ? "fail" : "pass",
18
+ isFragment ? "Page is addressed by fragment (#/\u2026)" : input.path,
19
+ "A URL fragment is never sent to the server, so every page of the store collapses into one address: one entry in the index, one set of meta tags, no per-page link preview, and nothing to prerender.",
20
+ 25
21
+ );
22
+ const hasBody = input.contentTextLength >= 200;
23
+ add(
24
+ "server-content",
25
+ "Content in the HTML",
26
+ hasBody ? input.skeletonCount > 0 ? "warn" : "pass" : "fail",
27
+ `${input.contentTextLength} chars of main content` + (input.skeletonCount > 0 ? `, ${input.skeletonCount} loading placeholders still present` : ""),
28
+ "Crawlers do run JavaScript, but on a slower second pass and with less weight. Content already in the HTML is indexed on the first pass, and is what a link preview or a text-only client sees at all.",
29
+ 20
30
+ );
31
+ const title = input.title?.trim();
32
+ const titleLen = title?.length ?? 0;
33
+ add(
34
+ "title",
35
+ "Title",
36
+ !title ? "fail" : titleLen > 60 || titleLen < 15 ? "warn" : "pass",
37
+ title ? `${titleLen} chars \u2014 \u201C${title.slice(0, 70)}\u201D` : "missing",
38
+ "The title is the clickable line in search results and the tab name. Under ~15 chars wastes the slot; over ~60 gets truncated mid-word.",
39
+ 15
40
+ );
41
+ const desc = metaContent(input, "description");
42
+ const descLen = desc?.length ?? 0;
43
+ add(
44
+ "description",
45
+ "Meta description",
46
+ !desc ? "fail" : descLen > 160 || descLen < 50 ? "warn" : "pass",
47
+ desc ? `${descLen} chars` : "missing",
48
+ "Not a ranking factor, but it is the snippet under the title. Absent, the engine invents one from page text; over ~160 chars it is cut off.",
49
+ 10
50
+ );
51
+ const canonical = input.links.find((l) => l.rel === "canonical")?.href;
52
+ const canonicalAbsolute = canonical?.startsWith("http") ?? false;
53
+ add(
54
+ "canonical",
55
+ "Canonical URL",
56
+ !canonical ? "fail" : !canonicalAbsolute ? "warn" : "pass",
57
+ canonical ?? "missing",
58
+ "Tells the engine which URL is authoritative when the same page is reachable with tracking parameters. Must be absolute \u2014 a relative canonical is ignored.",
59
+ 10
60
+ );
61
+ const ogTitle = metaContent(input, "og:title");
62
+ const ogImage = metaContent(input, "og:image");
63
+ const ogType = metaContent(input, "og:type");
64
+ const socialOk = Boolean(ogTitle && ogImage);
65
+ add(
66
+ "social",
67
+ "Link preview (OpenGraph)",
68
+ socialOk ? "pass" : ogTitle ? "warn" : "fail",
69
+ [ogTitle && "og:title", ogImage && "og:image", ogType && `og:type=${ogType}`].filter(Boolean).join(", ") || "missing",
70
+ "What WhatsApp, Instagram and Slack render when the link is shared. Without og:image the share is a bare grey rectangle \u2014 for a store shared in messaging apps this is often worth more than search rank.",
71
+ 10
72
+ );
73
+ const types = input.jsonLdTypes;
74
+ add(
75
+ "structured-data",
76
+ "Structured data",
77
+ types.length ? "pass" : "warn",
78
+ types.length ? types.join(", ") : "none",
79
+ "Product JSON-LD makes a page eligible for rich results \u2014 price, availability and rating shown directly in search. BreadcrumbList replaces the bare URL with a readable path.",
80
+ 5
81
+ );
82
+ add(
83
+ "h1",
84
+ "Single H1",
85
+ input.h1Count === 1 ? "pass" : input.h1Count === 0 ? "fail" : "warn",
86
+ `${input.h1Count} found`,
87
+ "The H1 is the page\u2019s stated subject. None leaves it ambiguous; several compete with each other.",
88
+ 3
89
+ );
90
+ add(
91
+ "image-alt",
92
+ "Image alt text",
93
+ input.imagesMissingAlt === 0 ? "pass" : input.imagesMissingAlt > 3 ? "fail" : "warn",
94
+ `${input.imagesMissingAlt}/${input.imageCount} missing alt`,
95
+ "Alt text is how a product image enters image search, and how a screen reader describes it. On a catalogue page the images are the product.",
96
+ 2
97
+ );
98
+ if (input.statusCode != null) {
99
+ const notFoundish = /não encontrada|not found|404/i.test(input.title ?? "");
100
+ const soft404 = notFoundish && input.statusCode === 200;
101
+ add(
102
+ "status",
103
+ "HTTP status",
104
+ soft404 ? "fail" : "pass",
105
+ `${input.statusCode}${soft404 ? " on a not-found page" : ""}`,
106
+ "A missing page answering 200 is a \u201Csoft 404\u201D: the engine indexes it as real content and the site accumulates near-duplicate empty pages.",
107
+ 5
108
+ );
109
+ }
110
+ const total = f.reduce((s, x) => s + x.weight, 0);
111
+ const earned = f.reduce(
112
+ (s, x) => s + (x.status === "pass" ? x.weight : x.status === "warn" ? x.weight * 0.5 : 0),
113
+ 0
114
+ );
115
+ const score = total === 0 ? 0 : Math.round(earned / total * 100);
116
+ return {
117
+ score,
118
+ grade: gradeFor(score),
119
+ findings: f,
120
+ passed: f.filter((x) => x.status === "pass").length,
121
+ total: f.length
122
+ };
123
+ }
124
+ function collectSeoAuditInput(doc, path) {
125
+ const main = doc.querySelector("main") ?? doc.body;
126
+ const images = Array.from(doc.querySelectorAll("img"));
127
+ const jsonLdTypes = [];
128
+ for (const el of Array.from(doc.querySelectorAll('script[type="application/ld+json"]'))) {
129
+ try {
130
+ const parsed = JSON.parse(el.textContent ?? "");
131
+ for (const node of Array.isArray(parsed) ? parsed : [parsed]) {
132
+ if (node && typeof node["@type"] === "string") jsonLdTypes.push(node["@type"]);
133
+ }
134
+ } catch {
135
+ jsonLdTypes.push("(unparseable)");
136
+ }
137
+ }
138
+ return {
139
+ path,
140
+ url: doc.location?.href,
141
+ title: doc.title,
142
+ meta: Array.from(doc.querySelectorAll("meta")).map((m) => ({
143
+ name: m.getAttribute("name") ?? void 0,
144
+ property: m.getAttribute("property") ?? void 0,
145
+ content: m.getAttribute("content") ?? ""
146
+ })),
147
+ links: Array.from(doc.querySelectorAll("link[rel]")).map((l) => ({
148
+ rel: l.getAttribute("rel") ?? "",
149
+ href: l.getAttribute("href") ?? ""
150
+ })),
151
+ jsonLdTypes,
152
+ h1Count: doc.querySelectorAll("h1").length,
153
+ imageCount: images.length,
154
+ imagesMissingAlt: images.filter((i) => !i.getAttribute("alt")?.trim()).length,
155
+ contentTextLength: (main?.textContent ?? "").replace(/\s+/g, " ").trim().length,
156
+ skeletonCount: doc.querySelectorAll(".animate-pulse").length
157
+ };
158
+ }
159
+
160
+ export { auditStorefrontSeo, collectSeoAuditInput };
161
+ //# sourceMappingURL=chunk-6IXTENLB.js.map
162
+ //# sourceMappingURL=chunk-6IXTENLB.js.map