@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,9 @@
1
+ /**
2
+ * The message inside a thrown value.
3
+ *
4
+ * `err instanceof Error` is not enough here: the Supabase provider rethrows
5
+ * PostgrestError, a plain object with `message`, so every `instanceof` check in
6
+ * the storefront fell through to a generic sentence and lost what the server said.
7
+ */
8
+ export declare function errorMessage(err: unknown): string;
9
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAMjD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/lib/format.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,SAAQ,EAAE,MAAM,SAAU,GAAG,MAAM,CAErF;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"motion.d.ts","sourceRoot":"","sources":["../../src/lib/motion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAO1D,wBAAgB,oBAAoB,IAAI,OAAO,CAG9C;AAED,iEAAiE;AACjE,wBAAgB,SAAS,CAAC,CAAC,SAAS,WAAW,EAAE,MAAM,SAAoB,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAyB1G;AAED,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACvE,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED;;;uDAGuD;AACvD,wBAAgB,MAAM,CAAC,EAAE,KAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,WAAW,qBAYrF;AAED,iFAAiF;AACjF,wBAAgB,WAAW,CAAC,SAAS,SAAI,GAAG,OAAO,CASlD;AAED,mFAAmF;AACnF,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAgBrD"}
@@ -0,0 +1,26 @@
1
+ import type { Product } from '@fayz-ai/shop/types';
2
+ import type { ResolvedStorefrontConfig } from '../document/config';
3
+ import type { StaticHeadInput } from '../app/static-render';
4
+ export interface StorefrontSeoContext {
5
+ config: ResolvedStorefrontConfig;
6
+ /** In-app path, e.g. '/product/pork-ribs'. */
7
+ path: string;
8
+ /** Absolute origin, e.g. 'https://loja.example.com'. */
9
+ origin?: string;
10
+ }
11
+ /** Primary image, falling back to the first — how product cards pick one. */
12
+ export declare function primaryImageUrl(product: Product): string | undefined;
13
+ /**
14
+ * schema.org Product. Availability is derived from inventory rather than
15
+ * declared, because a rich result advertising an in-stock product that is not
16
+ * is worse than no rich result.
17
+ */
18
+ export declare function productJsonLd(product: Product, ctx: StorefrontSeoContext): Record<string, unknown>;
19
+ /** The head declaration for a product page. */
20
+ export declare function productSeo(product: Product, ctx: StorefrontSeoContext): StaticHeadInput;
21
+ /** The head declaration for any non-product route: canonical only. */
22
+ export declare function pageSeo(ctx: StorefrontSeoContext, input: {
23
+ title: string;
24
+ description?: string | null;
25
+ }): StaticHeadInput;
26
+ //# sourceMappingURL=seo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seo.d.ts","sourceRoot":"","sources":["../../src/lib/seo.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAiB3D,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,wBAAwB,CAAA;IAChC,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAA;IACZ,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAUD,6EAA6E;AAC7E,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAEpE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,oBAAoB,GACxB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAqBzB;AAED,+CAA+C;AAC/C,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,oBAAoB,GAAG,eAAe,CAuBvF;AAED,sEAAsE;AACtE,wBAAgB,OAAO,CACrB,GAAG,EAAE,oBAAoB,EACzB,KAAK,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GACpD,eAAe,CAEjB"}
@@ -1,6 +1,11 @@
1
1
  export declare const TID: {
2
2
  readonly headerSearch: "header-search";
3
3
  readonly headerSearchToggle: "header-search-toggle";
4
+ readonly searchOverlay: "search-overlay";
5
+ readonly searchOverlayInput: "search-overlay-input";
6
+ readonly searchOverlayClose: "search-overlay-close";
7
+ readonly searchOverlayCta: "search-overlay-cta";
8
+ readonly searchSuggestion: "search-suggestion";
4
9
  readonly cartButton: "cart-button";
5
10
  readonly cartCount: "cart-count";
6
11
  readonly accountLink: "account-link";
@@ -21,6 +26,7 @@ export declare const TID: {
21
26
  readonly productSliderNext: "product-slider-next";
22
27
  readonly categoryShowcase: "category-showcase";
23
28
  readonly productRail: "product-rail";
29
+ readonly entityList: "entity-list";
24
30
  readonly benefits: "benefits-row";
25
31
  readonly promoBanner: "promo-banner";
26
32
  readonly manifesto: "manifesto";
@@ -29,6 +35,18 @@ export declare const TID: {
29
35
  readonly newsletterEmail: "newsletter-email";
30
36
  readonly newsletterSubmit: "newsletter-submit";
31
37
  readonly newsletterDone: "newsletter-done";
38
+ readonly formBlock: "form-block";
39
+ readonly formBlockField: (id: string) => string;
40
+ readonly formBlockSubmit: "form-block-submit";
41
+ readonly formBlockSuccess: "form-block-success";
42
+ readonly formBlockError: "form-block-error";
43
+ readonly collectionHero: "collection-hero";
44
+ readonly collectionHeroCta: "collection-hero-cta";
45
+ readonly productSpotlight: "product-spotlight";
46
+ readonly productSpotlightCta: "product-spotlight-cta";
47
+ readonly motifStrip: "motif-strip";
48
+ readonly collectionCta: "collection-cta";
49
+ readonly collectionCtaButton: "collection-cta-button";
32
50
  readonly productGrid: "product-grid";
33
51
  readonly productCard: "product-card";
34
52
  readonly productCardName: "product-card-name";
@@ -67,6 +85,8 @@ export declare const TID: {
67
85
  readonly enquirySuccess: "enquiry-success";
68
86
  readonly enquiryError: "enquiry-error";
69
87
  readonly cartDrawer: "cart-drawer";
88
+ readonly cartLinesList: "cart-lines-list";
89
+ readonly cartFooter: "cart-footer";
70
90
  readonly cartLine: "cart-line";
71
91
  readonly lineQty: "line-qty";
72
92
  readonly lineInc: "line-inc";
@@ -92,6 +112,7 @@ export declare const TID: {
92
112
  readonly deliveryClear: "delivery-clear";
93
113
  readonly checkoutEmail: "checkout-email";
94
114
  readonly checkoutName: "checkout-name";
115
+ readonly checkoutDocument: "checkout-document";
95
116
  readonly checkoutStreet: "checkout-street";
96
117
  readonly checkoutCity: "checkout-city";
97
118
  readonly checkoutZip: "checkout-zip";
@@ -99,6 +120,17 @@ export declare const TID: {
99
120
  readonly checkoutExpiry: "checkout-expiry";
100
121
  readonly checkoutCvc: "checkout-cvc";
101
122
  readonly placeOrder: "place-order";
123
+ readonly checkoutSteps: "checkout-steps";
124
+ readonly checkoutStep: (n: number) => string;
125
+ readonly checkoutPayment: "checkout-payment";
126
+ readonly checkoutPaymentTotal: "checkout-payment-total";
127
+ readonly checkoutContinue: "checkout-continue";
128
+ readonly checkoutBack: "checkout-back";
129
+ readonly checkoutDone: "checkout-done";
130
+ readonly pixPanel: "pix-panel";
131
+ readonly pixCode: "pix-code";
132
+ readonly pixCopy: "pix-copy";
133
+ readonly pixConfirm: "pix-confirm";
102
134
  readonly checkoutError: "checkout-error";
103
135
  readonly checkoutProcessing: "checkout-processing";
104
136
  readonly orderNumber: "order-number";
@@ -117,6 +149,7 @@ export declare const TID: {
117
149
  readonly signinName: "signin-name";
118
150
  readonly signinSubmit: "signin-submit";
119
151
  readonly authError: "auth-error";
152
+ readonly authNotice: "auth-notice";
120
153
  readonly purchasesList: "purchases-list";
121
154
  readonly purchaseItem: "purchase-item";
122
155
  readonly purchasesEmpty: "purchases-empty";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testids.d.ts","sourceRoot":"","sources":["../../src/lib/testids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG;;;;;;;;;;;;;8BAcG,MAAM;iCACH,MAAM;;;;;;;;;;;;;;;;;;;;;;;;kCAyBL,MAAM;;;;;;;;;;;;;;;;;;oCAqBJ,MAAM;;;;;;;;;;sCAWJ,MAAM;sCACN,MAAM,SAAS,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BA4D5B,MAAM;;;;;;;;;;;;;;;uCAiBE,MAAM;;;;;;;;;;;;;;;;;;CAmBxB,CAAA"}
@@ -63,16 +63,54 @@ export interface StorefrontTheme {
63
63
  };
64
64
  /** Uppercase CTA buttons with letter-spacing (Uyuni/Flex tone) */
65
65
  uppercaseButtons?: boolean;
66
+ /**
67
+ * Brand token scales — the schema'd half of the token surface (spine M2).
68
+ * Each map is emitted as namespaced CSS custom properties, so blocks and
69
+ * store CSS consume the brand's rhythm instead of hardcoding magic numbers:
70
+ *
71
+ * spacing `--sf-space-<key>` e.g. { sm: '8px', md: '16px', lg: '32px' }
72
+ * typeScale `--sf-text-<key>` e.g. { body: '1rem', h2: 'clamp(24px,3vw,34px)' }
73
+ * breakpoints `--sf-breakpoint-<key>` e.g. { md: '768px', lg: '1080px' } — CSS
74
+ * custom properties cannot drive media queries; these document the
75
+ * grid for JS consumers and generated styles.
76
+ * motion `--sf-motion-<key>` e.g. { fast: '150ms', reveal: 'cubic-bezier(0.22,1,0.36,1)' }
77
+ *
78
+ * Keys are validated (slug-like) and values must be strings; the free-form
79
+ * escape hatch stays `tokens` below.
80
+ */
81
+ spacing?: Record<string, string>;
82
+ typeScale?: Record<string, string>;
83
+ breakpoints?: Record<string, string>;
84
+ motion?: Record<string, string>;
66
85
  /** Brand-token passthrough. Each entry is emitted verbatim as a `--<key>` CSS
67
86
  * custom property, so a store can add gradients, glows, extra colors, or
68
87
  * letter-spacing the fixed schema doesn't enumerate — without editing the SDK.
69
88
  * e.g. { 'grad-ember': 'linear-gradient(...)', 'glow-ember': '0 0 0 1px ...' }. */
70
89
  tokens?: Record<string, string>;
71
90
  }
72
- export declare function themeToCss(theme: StorefrontTheme): string;
73
- /** Injects theme CSS variables + Google Fonts. Mount once inside the app root. */
74
- export declare function StorefrontThemeStyle({ theme }: {
91
+ /** The schema'd scale fields and the CSS custom-property prefix each emits. */
92
+ export declare const THEME_SCALE_VAR_PREFIX: {
93
+ readonly spacing: "--sf-space";
94
+ readonly typeScale: "--sf-text";
95
+ readonly breakpoints: "--sf-breakpoint";
96
+ readonly motion: "--sf-motion";
97
+ };
98
+ export type ThemeScaleField = keyof typeof THEME_SCALE_VAR_PREFIX;
99
+ export declare const THEME_SCALE_FIELDS: readonly ThemeScaleField[];
100
+ export interface ThemeCssOptions {
101
+ /** CSS selector the custom properties are emitted under. Defaults to `:root`.
102
+ * A page-scoped theme (a campaign page) passes something like
103
+ * `[data-page="verao"]` so its palette does not leak to the shell. */
104
+ selector?: string;
105
+ }
106
+ export declare function themeToCss(theme: StorefrontTheme, options?: ThemeCssOptions): string;
107
+ /** Injects theme CSS variables + Google Fonts. Mount once inside the app root
108
+ * for the store theme; a page-scoped theme mounts another instance with its
109
+ * own `selector`. */
110
+ export declare function StorefrontThemeStyle({ theme, selector, }: {
75
111
  theme: StorefrontTheme;
112
+ /** Emit under this selector instead of `:root`. See `themeToCss`. */
113
+ selector?: string;
76
114
  }): React.ReactElement<{
77
115
  'data-sf-theme': string;
78
116
  }, string | React.JSXElementConstructor<any>>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/lib/theme.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,5 @@
1
+ export { renderStore, htmlToText, wrapDocument } from './document/render';
2
+ export type { RenderStoreOptions, StoreRenderResult, StoreRenderDataEntry, StoreRenderDiagnostic, StoreRenderHeading, StoreRenderBlock, } from './document/render';
3
+ export { prerenderStore, buildSitemapXml, buildRobotsTxt, outputPathFor, prerenderClientRouter, } from './app/prerender';
4
+ export type { PrerenderOptions, PrerenderResult, PrerenderPage } from './app/prerender';
5
+ //# sourceMappingURL=render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACzE,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,mBAAmB,CAAA;AAK1B,OAAO,EACL,cAAc,EACd,eAAe,EACf,cAAc,EACd,aAAa,EACb,qBAAqB,GACtB,MAAM,iBAAiB,CAAA;AACxB,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA"}
package/dist/render.js ADDED
@@ -0,0 +1,359 @@
1
+ import { validateStore, resolveConfig, registerStorefrontBlocks, registerStorefrontEntities, resetPageDiagnostics, withStaticRenderPass, StorefrontConfigProvider, StorefrontShell, resolvePageData, themeToCss, serializePageData, hydrateStoreDocument, storefrontPaths, isPublicPath, resolveStorefrontProvider } from './chunk-SX3J3QIT.js';
2
+ import { renderToStaticMarkup } from 'react-dom/server';
3
+ import { historyRouterAdapter, setBlockErrorVisibility, setBlockEditorMode, staticRouterAdapter, buildSeoTags } from '@fayz-ai/core';
4
+ import { createMockShopProvider } from '@fayz-ai/shop/mock';
5
+ import { getShopProvider, setShopProvider } from '@fayz-ai/shop/runtime';
6
+ import { jsx } from 'react/jsx-runtime';
7
+
8
+ var VOID_TEXT_TAGS = /<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi;
9
+ var ENTITIES = {
10
+ amp: "&",
11
+ lt: "<",
12
+ gt: ">",
13
+ quot: '"',
14
+ apos: "'",
15
+ nbsp: " ",
16
+ "#39": "'",
17
+ "#x27": "'",
18
+ "#x2F": "/"
19
+ };
20
+ function decodeEntities(text) {
21
+ return text.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g, (match, name) => {
22
+ const direct = ENTITIES[name];
23
+ if (direct !== void 0) return direct;
24
+ if (name.startsWith("#x") || name.startsWith("#X")) {
25
+ return String.fromCodePoint(Number.parseInt(name.slice(2), 16));
26
+ }
27
+ if (name.startsWith("#")) return String.fromCodePoint(Number(name.slice(1)));
28
+ return match;
29
+ });
30
+ }
31
+ function htmlToText(html) {
32
+ return decodeEntities(html.replace(VOID_TEXT_TAGS, " ").replace(/<[^>]*>/g, " ")).replace(/\s+/g, " ").trim();
33
+ }
34
+ function readOutline(html) {
35
+ const found = [];
36
+ const pattern = /<h([1-6])\b[^>]*>([\s\S]*?)<\/h\1>/gi;
37
+ let match;
38
+ while ((match = pattern.exec(html)) !== null) {
39
+ const text = htmlToText(match[2] ?? "");
40
+ if (text) found.push({ level: Number(match[1]), text });
41
+ }
42
+ return found;
43
+ }
44
+ function readLinks(html) {
45
+ const found = /* @__PURE__ */ new Set();
46
+ const pattern = /<a\b[^>]*\bhref="([^"]*)"/gi;
47
+ let match;
48
+ while ((match = pattern.exec(html)) !== null) {
49
+ const href = decodeEntities(match[1] ?? "");
50
+ if (href) found.add(href);
51
+ }
52
+ return [...found];
53
+ }
54
+ function escapeHtml(text) {
55
+ return text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
56
+ }
57
+ function flattenBlocks(nodes, within, out) {
58
+ for (const node of nodes) {
59
+ out.push({ type: node.type, ...node.id ? { id: node.id } : {}, ...within.length ? { within: [...within] } : {} });
60
+ if (node.children?.length) flattenBlocks(node.children, [...within, node.type], out);
61
+ }
62
+ }
63
+ function captureConsole(sink, render) {
64
+ const originalError = console.error;
65
+ const originalWarn = console.warn;
66
+ const record = (level) => (...args) => {
67
+ const message = args.map((arg) => arg instanceof Error ? arg.message : typeof arg === "string" ? arg : safeStringify(arg)).join(" ").trim();
68
+ if (!message) return;
69
+ const source = message.startsWith("[blocks]") ? "blocks" : message.startsWith("[storefront]") ? "storefront" : "render";
70
+ sink.push({ level, source, message });
71
+ };
72
+ console.error = record("error");
73
+ console.warn = record("warn");
74
+ try {
75
+ return render();
76
+ } finally {
77
+ console.error = originalError;
78
+ console.warn = originalWarn;
79
+ }
80
+ }
81
+ function safeStringify(value) {
82
+ try {
83
+ return JSON.stringify(value) ?? String(value);
84
+ } catch {
85
+ return String(value);
86
+ }
87
+ }
88
+ function providerFor(option, config, doc) {
89
+ if (option && typeof option === "object") return option;
90
+ if (option === "document") {
91
+ const catalog = doc.catalog;
92
+ const promotions = doc.promotions?.promotions;
93
+ const { version: _version, ...seed } = catalog ?? {};
94
+ return createMockShopProvider({
95
+ ...seed,
96
+ ...Array.isArray(promotions) ? { promotions } : {}
97
+ });
98
+ }
99
+ return resolveStorefrontProvider(config);
100
+ }
101
+ async function renderStore(input, options = {}) {
102
+ const path = options.path ?? "/";
103
+ const maxPasses = Math.max(1, options.maxPasses ?? 4);
104
+ const doc = input;
105
+ const validation = validateStore(input);
106
+ if (!validation.ok && (options.onError ?? "report") === "throw") {
107
+ throw new Error(
108
+ `renderStore: the document failed validation:
109
+ ${validation.errors.map((e) => ` - ${e.path || "(document)"}: ${e.message}${e.valid ? ` (valid: ${e.valid.join(", ")})` : ""}`).join("\n")}`
110
+ );
111
+ }
112
+ const diagnostics = [];
113
+ const hydrationLog = [];
114
+ const config = captureConsole(hydrationLog, () => hydrateStoreDocument(input, { onError: "report" }));
115
+ diagnostics.push(...hydrationLog.filter((d) => !d.message.includes("Store document failed validation")));
116
+ const resolved = resolveConfig(
117
+ (options.imageReveal ?? "settled") === "settled" ? { ...config, imageLoading: { ...config.imageLoading, mode: "none" } } : config
118
+ );
119
+ registerStorefrontBlocks();
120
+ registerStorefrontEntities(config);
121
+ const previousProvider = getShopProvider();
122
+ setShopProvider(providerFor(options.provider, config, doc));
123
+ setBlockErrorVisibility("visible");
124
+ if (options.editor) setBlockEditorMode(true);
125
+ const renderRouter = options.router ? staticRouterAdapter(path, { href: (to) => options.router.href(to) }) : staticRouterAdapter(path, { href: (to) => `#${to.startsWith("/") ? to : `/${to}`}` });
126
+ const entries = {};
127
+ let html = "";
128
+ let passes = 0;
129
+ let head = {};
130
+ let blocks = [];
131
+ let stale = [];
132
+ try {
133
+ for (let round = 0; round < maxPasses; round++) {
134
+ passes = round + 1;
135
+ const seenNeeds = /* @__PURE__ */ new Map();
136
+ const trees = [];
137
+ const heads = [];
138
+ const pass = {
139
+ tree: (nodes) => void trees.push([...nodes]),
140
+ needs: (needs) => {
141
+ for (const need of needs) if (!seenNeeds.has(need.key)) seenNeeds.set(need.key, need);
142
+ },
143
+ head: (input_) => void heads.push(input_),
144
+ entries,
145
+ origin: options.origin
146
+ };
147
+ resetPageDiagnostics();
148
+ const roundDiagnostics = [];
149
+ html = captureConsole(
150
+ roundDiagnostics,
151
+ () => withStaticRenderPass(
152
+ pass,
153
+ () => renderToStaticMarkup(
154
+ /* @__PURE__ */ jsx(StorefrontConfigProvider, { value: resolved, children: /* @__PURE__ */ jsx(StorefrontShell, { path, router: renderRouter }) })
155
+ )
156
+ )
157
+ );
158
+ blocks = [];
159
+ for (const tree of trees) flattenBlocks(tree, [], blocks);
160
+ head = heads.reduce(
161
+ (acc, entry) => ({
162
+ title: entry.title ?? acc.title,
163
+ description: entry.description ?? acc.description,
164
+ canonical: entry.canonical ?? acc.canonical,
165
+ image: entry.image ?? acc.image,
166
+ type: entry.type ?? acc.type,
167
+ // Concatenated, not overwritten: a product page declares its Product
168
+ // object and the chrome around it its BreadcrumbList, and a page is
169
+ // allowed to carry both.
170
+ jsonLd: [...acc.jsonLd ?? [], ...entry.jsonLd ?? []]
171
+ }),
172
+ {}
173
+ );
174
+ const pending = [...seenNeeds.values()].filter((need) => !(need.key in entries));
175
+ if (pending.length === 0) {
176
+ diagnostics.push(...roundDiagnostics);
177
+ break;
178
+ }
179
+ if (round === maxPasses - 1) {
180
+ stale = pending;
181
+ diagnostics.push(...roundDiagnostics);
182
+ diagnostics.push({
183
+ level: "warn",
184
+ source: "render",
185
+ message: `render stopped after ${maxPasses} passes with ${pending.length} data need(s) still loading \u2014 raise maxPasses if a page legitimately chains this deep`
186
+ });
187
+ break;
188
+ }
189
+ Object.assign(entries, await resolvePageData(pending));
190
+ }
191
+ } finally {
192
+ setShopProvider(previousProvider);
193
+ setBlockErrorVisibility(null);
194
+ if (options.editor) setBlockEditorMode(false);
195
+ }
196
+ const data = Object.entries(entries).map(([key, entry]) => {
197
+ const [loader, params] = splitNeedKey(key);
198
+ return {
199
+ key,
200
+ loader,
201
+ params,
202
+ status: entry.status === "ready" ? "ready" : "error",
203
+ ...Array.isArray(entry.data) ? { count: entry.data.length } : {},
204
+ ...entry.error ? { error: entry.error } : {}
205
+ };
206
+ });
207
+ for (const need of stale) {
208
+ data.push({ key: need.key, loader: need.loader, params: need.params, status: "unresolved" });
209
+ }
210
+ const found = !html.includes('data-storefront-page="not-found"');
211
+ const title = head.title ?? resolved.name;
212
+ const text = htmlToText(html);
213
+ const outline = readOutline(html);
214
+ const body = (options.html ?? "document") === "fragment" ? html : wrapDocument(html + serializePageData({ entries, path }), {
215
+ title,
216
+ description: head.description ?? void 0,
217
+ seo: { canonical: head.canonical, image: head.image, type: head.type, jsonLd: head.jsonLd },
218
+ siteName: resolved.name,
219
+ lang: options.lang ?? config.locale ?? "pt-BR",
220
+ themeCss: resolved.theme ? themeToCss(resolved.theme) : "",
221
+ stylesheets: options.stylesheets ?? [],
222
+ head: options.head ?? ""
223
+ });
224
+ return {
225
+ ok: validation.ok && found && !diagnostics.some((d) => d.level === "error") && !data.some((d) => d.status !== "ready"),
226
+ path,
227
+ title,
228
+ ...head.description ? { description: head.description } : {},
229
+ found,
230
+ html: body,
231
+ text,
232
+ outline,
233
+ blocks,
234
+ links: readLinks(html),
235
+ images: (html.match(/<img\b/gi) ?? []).length,
236
+ data,
237
+ diagnostics,
238
+ validation,
239
+ passes,
240
+ bytes: new TextEncoder().encode(body).length
241
+ };
242
+ }
243
+ function splitNeedKey(key) {
244
+ const space = key.indexOf(" ");
245
+ if (space === -1) return [key, {}];
246
+ try {
247
+ return [key.slice(0, space), JSON.parse(key.slice(space + 1))];
248
+ } catch {
249
+ return [key.slice(0, space), {}];
250
+ }
251
+ }
252
+ function wrapDocument(markup, options) {
253
+ const links = options.stylesheets.map((href) => `<link rel="stylesheet" href="${escapeHtml(href)}">`).join("");
254
+ const themeStyle = options.themeCss ? `<style>${options.themeCss}</style>` : "";
255
+ const tags = buildSeoTags({
256
+ title: options.title,
257
+ description: options.description,
258
+ canonical: options.seo?.canonical,
259
+ image: options.seo?.image,
260
+ type: options.seo?.type,
261
+ siteName: options.siteName,
262
+ jsonLd: options.seo?.jsonLd
263
+ });
264
+ const meta = tags.meta.map(
265
+ (t) => t.name ? `<meta name="${escapeHtml(t.name)}" content="${escapeHtml(t.content)}">` : `<meta property="${escapeHtml(t.property ?? "")}" content="${escapeHtml(t.content)}">`
266
+ ).join("");
267
+ const seoLinks = tags.links.map((l) => `<link rel="${escapeHtml(l.rel)}" href="${escapeHtml(l.href)}">`).join("");
268
+ const jsonLd = tags.jsonLd.map(
269
+ (obj) => `<script type="application/ld+json">${JSON.stringify(obj).replace(/</g, "\\u003c")}</script>`
270
+ ).join("");
271
+ return `<!doctype html><html lang="${escapeHtml(options.lang)}"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>${escapeHtml(tags.title)}</title>${meta}${seoLinks}${links}${themeStyle}${jsonLd}${options.head}</head><body>${markup}</body></html>`;
272
+ }
273
+ function outputPathFor(path) {
274
+ const clean = (path.split("?")[0] ?? "/").replace(/^\/+|\/+$/g, "");
275
+ return clean === "" ? "index.html" : `${clean}/index.html`;
276
+ }
277
+ function xmlEscape(value) {
278
+ return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
279
+ }
280
+ function buildSitemapXml(origin, paths) {
281
+ const base = origin.replace(/\/$/, "");
282
+ const urls = paths.map((p) => ` <url><loc>${xmlEscape(`${base}${p}`)}</loc></url>`).join("\n");
283
+ return `<?xml version="1.0" encoding="UTF-8"?>
284
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
285
+ ${urls}
286
+ </urlset>
287
+ `;
288
+ }
289
+ function buildRobotsTxt(origin) {
290
+ const base = origin.replace(/\/$/, "");
291
+ return [
292
+ "User-agent: *",
293
+ "Allow: /",
294
+ "Disallow: /checkout",
295
+ "Disallow: /account",
296
+ "Disallow: /order/",
297
+ "",
298
+ `Sitemap: ${base}/sitemap.xml`,
299
+ ""
300
+ ].join("\n");
301
+ }
302
+ async function mapWithLimit(items, limit, fn) {
303
+ const results = new Array(items.length);
304
+ let next = 0;
305
+ const workers = Array.from({ length: Math.min(limit, items.length) }, async () => {
306
+ for (; ; ) {
307
+ const i = next++;
308
+ if (i >= items.length) return;
309
+ results[i] = await fn(items[i]);
310
+ }
311
+ });
312
+ await Promise.all(workers);
313
+ return results;
314
+ }
315
+ async function prerenderStore(document, options) {
316
+ const config = resolveConfig(hydrateStoreDocument(document, { onError: "report" }));
317
+ const paths = options.paths ?? await storefrontPaths({ config, provider: options.provider });
318
+ const publicPaths = paths.filter((p) => isPublicPath(config, p));
319
+ const skipped = [];
320
+ const rendered = await mapWithLimit(publicPaths, options.concurrency ?? 8, async (path) => {
321
+ let result;
322
+ try {
323
+ result = await renderStore(document, {
324
+ ...options,
325
+ path,
326
+ router: staticRouterAdapter(path)
327
+ });
328
+ } catch (error) {
329
+ skipped.push({ path, reason: error instanceof Error ? error.message : String(error) });
330
+ return null;
331
+ }
332
+ const page = {
333
+ path,
334
+ html: result.html,
335
+ outputPath: outputPathFor(path),
336
+ title: result.title,
337
+ found: result.found,
338
+ ok: result.ok
339
+ };
340
+ if (!result.found) {
341
+ skipped.push({ path, reason: "rendered the not-found page" });
342
+ return null;
343
+ }
344
+ options.onPage?.(page);
345
+ return page;
346
+ });
347
+ const pages = rendered.filter((p) => p !== null);
348
+ return {
349
+ pages,
350
+ skipped,
351
+ sitemapXml: buildSitemapXml(options.origin, pages.map((p) => p.path)),
352
+ robotsTxt: buildRobotsTxt(options.origin)
353
+ };
354
+ }
355
+ var prerenderClientRouter = historyRouterAdapter;
356
+
357
+ export { buildRobotsTxt, buildSitemapXml, htmlToText, outputPathFor, prerenderClientRouter, prerenderStore, renderStore, wrapDocument };
358
+ //# sourceMappingURL=render.js.map
359
+ //# sourceMappingURL=render.js.map