@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.
- package/README.md +3 -3
- package/dist/app/createStorefrontApp.d.ts +65 -0
- package/dist/app/createStorefrontApp.d.ts.map +1 -0
- package/dist/{define.d.ts → app/define.d.ts} +3 -3
- package/dist/app/define.d.ts.map +1 -0
- package/dist/app/hydration.d.ts +37 -0
- package/dist/app/hydration.d.ts.map +1 -0
- package/dist/app/prerender.d.ts +57 -0
- package/dist/app/prerender.d.ts.map +1 -0
- package/dist/{router.d.ts → app/router.d.ts} +140 -113
- package/dist/app/router.d.ts.map +1 -0
- package/dist/{scaffold.d.ts → app/scaffold.d.ts} +2 -2
- package/dist/app/scaffold.d.ts.map +1 -0
- package/dist/app/serving.d.ts +70 -0
- package/dist/app/serving.d.ts.map +1 -0
- package/dist/app/static-render.d.ts +46 -0
- package/dist/app/static-render.d.ts.map +1 -0
- package/dist/blocks/block-at-path.d.ts +59 -0
- package/dist/blocks/block-at-path.d.ts.map +1 -0
- package/dist/blocks/page-blocks.d.ts +163 -0
- package/dist/blocks/page-blocks.d.ts.map +1 -0
- package/dist/blocks/page-data.d.ts +105 -0
- package/dist/blocks/page-data.d.ts.map +1 -0
- package/dist/{blocks.d.ts → blocks/registry.d.ts} +1 -1
- package/dist/blocks/registry.d.ts.map +1 -0
- package/dist/{sections.d.ts → blocks/sections.d.ts} +40 -2
- package/dist/blocks/sections.d.ts.map +1 -0
- package/dist/chunk-6IXTENLB.js +162 -0
- package/dist/chunk-6IXTENLB.js.map +1 -0
- package/dist/chunk-SX3J3QIT.js +11046 -0
- package/dist/chunk-SX3J3QIT.js.map +1 -0
- package/dist/components/PaymentTerms.d.ts +34 -0
- package/dist/components/PaymentTerms.d.ts.map +1 -0
- package/dist/components/Skeleton.d.ts +17 -0
- package/dist/components/Skeleton.d.ts.map +1 -0
- package/dist/components/SmoothImage.d.ts +1 -1
- package/dist/components/SmoothImage.d.ts.map +1 -1
- package/dist/components/account/CustomerAccountShell.d.ts +17 -0
- package/dist/components/account/CustomerAccountShell.d.ts.map +1 -0
- package/dist/components/account/SignInModal.d.ts.map +1 -0
- package/dist/components/account/section.d.ts +15 -0
- package/dist/components/account/section.d.ts.map +1 -0
- package/dist/components/cart/CartDrawer.d.ts.map +1 -0
- package/dist/components/cart/QuantityInput.d.ts.map +1 -0
- package/dist/components/checkout/CheckoutPayment.d.ts +17 -0
- package/dist/components/checkout/CheckoutPayment.d.ts.map +1 -0
- package/dist/components/checkout/CheckoutSteps.d.ts +9 -0
- package/dist/components/checkout/CheckoutSteps.d.ts.map +1 -0
- package/dist/components/checkout/DeliveryEstimator.d.ts.map +1 -0
- package/dist/components/collection/CategoryShowcase.d.ts +44 -0
- package/dist/components/collection/CategoryShowcase.d.ts.map +1 -0
- package/dist/components/collection/FiltersPanel.d.ts +19 -0
- package/dist/components/collection/FiltersPanel.d.ts.map +1 -0
- package/dist/components/collection/ProductGrid.d.ts.map +1 -0
- package/dist/components/layout/PageBodyBlocks.d.ts +40 -0
- package/dist/components/layout/PageBodyBlocks.d.ts.map +1 -0
- package/dist/components/layout/SearchOverlay.d.ts +13 -0
- package/dist/components/layout/SearchOverlay.d.ts.map +1 -0
- package/dist/components/layout/StorefrontErrorBoundary.d.ts.map +1 -0
- package/dist/components/layout/StorefrontFooter.d.ts.map +1 -0
- package/dist/components/layout/StorefrontHeader.d.ts.map +1 -0
- package/dist/components/layout/Toaster.d.ts.map +1 -0
- package/dist/components/marketing/CollectionSections.d.ts +463 -0
- package/dist/components/marketing/CollectionSections.d.ts.map +1 -0
- package/dist/components/marketing/ConversionSections.d.ts +221 -0
- package/dist/components/marketing/ConversionSections.d.ts.map +1 -0
- package/dist/components/marketing/EditorialSections.d.ts +248 -0
- package/dist/components/marketing/EditorialSections.d.ts.map +1 -0
- package/dist/components/marketing/EntityList.d.ts +97 -0
- package/dist/components/marketing/EntityList.d.ts.map +1 -0
- package/dist/components/marketing/FormBlock.d.ts +167 -0
- package/dist/components/marketing/FormBlock.d.ts.map +1 -0
- package/dist/components/marketing/HeroSection.d.ts +125 -0
- package/dist/components/marketing/HeroSection.d.ts.map +1 -0
- package/dist/components/marketing/MediaCarousel.d.ts +135 -0
- package/dist/components/marketing/MediaCarousel.d.ts.map +1 -0
- package/dist/components/marketing/MiscSections.d.ts +252 -0
- package/dist/components/marketing/MiscSections.d.ts.map +1 -0
- package/dist/components/order/OrderTrackingTimeline.d.ts.map +1 -0
- package/dist/components/order/SuccessMark.d.ts +10 -0
- package/dist/components/order/SuccessMark.d.ts.map +1 -0
- package/dist/components/product/ProductCard.d.ts +14 -0
- package/dist/components/product/ProductCard.d.ts.map +1 -0
- package/dist/components/product/ProductEnquiryForm.d.ts.map +1 -0
- package/dist/components/product/ProductGallery.d.ts +36 -0
- package/dist/components/product/ProductGallery.d.ts.map +1 -0
- package/dist/components/{ProductOptionSelector.d.ts → product/ProductOptionSelector.d.ts} +1 -1
- package/dist/components/product/ProductOptionSelector.d.ts.map +1 -0
- package/dist/components/product/ProductRail.d.ts +93 -0
- package/dist/components/product/ProductRail.d.ts.map +1 -0
- package/dist/components/product/ProductReviews.d.ts +39 -0
- package/dist/components/product/ProductReviews.d.ts.map +1 -0
- package/dist/components/product/ProductSlider.d.ts +169 -0
- package/dist/components/product/ProductSlider.d.ts.map +1 -0
- package/dist/components/product/ProductSpecs.d.ts.map +1 -0
- package/dist/components/product/RelatedProducts.d.ts.map +1 -0
- package/dist/{auth.d.ts → data/auth.d.ts} +9 -0
- package/dist/data/auth.d.ts.map +1 -0
- package/dist/data/facets.d.ts +39 -0
- package/dist/data/facets.d.ts.map +1 -0
- package/dist/data/loaders.d.ts +52 -0
- package/dist/data/loaders.d.ts.map +1 -0
- package/dist/data/local-orders.d.ts +5 -0
- package/dist/data/local-orders.d.ts.map +1 -0
- package/dist/data/order-status.d.ts.map +1 -0
- package/dist/data/product-options.d.ts +36 -0
- package/dist/data/product-options.d.ts.map +1 -0
- package/dist/data/shipping-items.d.ts +20 -0
- package/dist/data/shipping-items.d.ts.map +1 -0
- package/dist/diagnostics/seo-audit.d.ts +54 -0
- package/dist/diagnostics/seo-audit.d.ts.map +1 -0
- package/dist/diagnostics/seo-audit.js +3 -0
- package/dist/diagnostics/seo-audit.js.map +1 -0
- package/dist/document/change.d.ts +100 -0
- package/dist/document/change.d.ts.map +1 -0
- package/dist/document/config.d.ts +311 -0
- package/dist/document/config.d.ts.map +1 -0
- package/dist/document/describe.d.ts +135 -0
- package/dist/document/describe.d.ts.map +1 -0
- package/dist/document/overlay.d.ts +58 -0
- package/dist/document/overlay.d.ts.map +1 -0
- package/dist/{presets.d.ts → document/presets.d.ts} +2 -2
- package/dist/document/presets.d.ts.map +1 -0
- package/dist/document/render.d.ts +171 -0
- package/dist/document/render.d.ts.map +1 -0
- package/dist/document/round-trip.d.ts +46 -0
- package/dist/document/round-trip.d.ts.map +1 -0
- package/dist/document/sections.d.ts +194 -0
- package/dist/document/sections.d.ts.map +1 -0
- package/dist/document/store-policy.d.ts +29 -0
- package/dist/document/store-policy.d.ts.map +1 -0
- package/dist/document/upgrade.d.ts +112 -0
- package/dist/document/upgrade.d.ts.map +1 -0
- package/dist/document/validate.d.ts +24 -0
- package/dist/document/validate.d.ts.map +1 -0
- package/dist/{component-contracts.d.ts → extend/component-contracts.d.ts} +74 -22
- package/dist/extend/component-contracts.d.ts.map +1 -0
- package/dist/extend/component-override.d.ts +38 -0
- package/dist/extend/component-override.d.ts.map +1 -0
- package/dist/extend/component-selectors.d.ts.map +1 -0
- package/dist/extend/editor-bridge.d.ts +59 -0
- package/dist/extend/editor-bridge.d.ts.map +1 -0
- package/dist/extend/extension-points.d.ts +103 -0
- package/dist/extend/extension-points.d.ts.map +1 -0
- package/dist/extend/slots.d.ts +216 -0
- package/dist/extend/slots.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +25 -6
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/use-address.d.ts +26 -0
- package/dist/hooks/use-address.d.ts.map +1 -0
- package/dist/hooks/use-cart.d.ts +3 -0
- package/dist/hooks/use-cart.d.ts.map +1 -0
- package/dist/hooks/use-catalog.d.ts +24 -0
- package/dist/hooks/use-catalog.d.ts.map +1 -0
- package/dist/hooks/use-categories.d.ts +19 -0
- package/dist/hooks/use-categories.d.ts.map +1 -0
- package/dist/hooks/use-checkout.d.ts +41 -0
- package/dist/hooks/use-checkout.d.ts.map +1 -0
- package/dist/hooks/use-discount-validator.d.ts +20 -0
- package/dist/hooks/use-discount-validator.d.ts.map +1 -0
- package/dist/hooks/use-enquiry.d.ts +7 -0
- package/dist/hooks/use-enquiry.d.ts.map +1 -0
- package/dist/hooks/{useMyOrders.d.ts → use-my-orders.d.ts} +1 -1
- package/dist/hooks/use-my-orders.d.ts.map +1 -0
- package/dist/hooks/use-order.d.ts +17 -0
- package/dist/hooks/use-order.d.ts.map +1 -0
- package/dist/hooks/use-payment-methods.d.ts +19 -0
- package/dist/hooks/use-payment-methods.d.ts.map +1 -0
- package/dist/hooks/use-policies.d.ts +25 -0
- package/dist/hooks/use-policies.d.ts.map +1 -0
- package/dist/hooks/use-product.d.ts +15 -0
- package/dist/hooks/use-product.d.ts.map +1 -0
- package/dist/hooks/{useProducts.d.ts → use-products.d.ts} +1 -1
- package/dist/hooks/use-products.d.ts.map +1 -0
- package/dist/hooks/use-region.d.ts +15 -0
- package/dist/hooks/use-region.d.ts.map +1 -0
- package/dist/hooks/use-shipping.d.ts +32 -0
- package/dist/hooks/use-shipping.d.ts.map +1 -0
- package/dist/hooks/use-storefront-actions.d.ts +12 -0
- package/dist/hooks/use-storefront-actions.d.ts.map +1 -0
- package/dist/hooks/use-storefront-head.d.ts +19 -0
- package/dist/hooks/use-storefront-head.d.ts.map +1 -0
- package/dist/hooks/use-storefront.d.ts +3 -0
- package/dist/hooks/use-storefront.d.ts.map +1 -0
- package/dist/index.d.ts +124 -54
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1310 -5010
- package/dist/index.js.map +1 -1
- package/dist/lib/errors.d.ts +9 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/format.d.ts.map +1 -0
- package/dist/lib/motion.d.ts.map +1 -0
- package/dist/lib/seo.d.ts +26 -0
- package/dist/lib/seo.d.ts.map +1 -0
- package/dist/{testids.d.ts → lib/testids.d.ts} +33 -0
- package/dist/lib/testids.d.ts.map +1 -0
- package/dist/{theme.d.ts → lib/theme.d.ts} +41 -3
- package/dist/lib/theme.d.ts.map +1 -0
- package/dist/render.d.ts +5 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/render.js +359 -0
- package/dist/render.js.map +1 -0
- package/dist/stores/cart.store.d.ts +34 -2
- package/dist/stores/cart.store.d.ts.map +1 -1
- package/dist/stores/catalog.store.d.ts +11 -0
- package/dist/stores/catalog.store.d.ts.map +1 -1
- package/dist/stores/delivery.store.d.ts +9 -0
- package/dist/stores/delivery.store.d.ts.map +1 -1
- package/dist/views/CatalogPage.d.ts.map +1 -0
- package/dist/views/CheckoutPage.d.ts.map +1 -0
- package/dist/views/ContentPage.d.ts +11 -0
- package/dist/views/ContentPage.d.ts.map +1 -0
- package/dist/views/HomePage.d.ts +9 -0
- package/dist/views/HomePage.d.ts.map +1 -0
- package/dist/views/MyPurchasesPage.d.ts.map +1 -0
- package/dist/views/NotFoundPage.d.ts.map +1 -0
- package/dist/views/OrderConfirmationPage.d.ts.map +1 -0
- package/dist/{pages → views}/PolicyPage.d.ts.map +1 -1
- package/dist/views/ProductDetailPage.d.ts.map +1 -0
- package/dist/views/StorefrontPage.d.ts +35 -0
- package/dist/views/StorefrontPage.d.ts.map +1 -0
- package/dist/workflows/checkout.d.ts +1 -1
- package/dist/workflows/checkout.d.ts.map +1 -1
- package/package.json +21 -14
- package/dist/auth.d.ts.map +0 -1
- package/dist/blocks.d.ts.map +0 -1
- package/dist/component-contracts.d.ts.map +0 -1
- package/dist/component-selectors.d.ts.map +0 -1
- package/dist/components/CartDrawer.d.ts.map +0 -1
- package/dist/components/CustomerAccountShell.d.ts +0 -13
- package/dist/components/CustomerAccountShell.d.ts.map +0 -1
- package/dist/components/DeliveryEstimator.d.ts.map +0 -1
- package/dist/components/FiltersPanel.d.ts +0 -3
- package/dist/components/FiltersPanel.d.ts.map +0 -1
- package/dist/components/OrderTrackingTimeline.d.ts.map +0 -1
- package/dist/components/ProductCard.d.ts +0 -4
- package/dist/components/ProductCard.d.ts.map +0 -1
- package/dist/components/ProductEnquiryForm.d.ts.map +0 -1
- package/dist/components/ProductGallery.d.ts +0 -22
- package/dist/components/ProductGallery.d.ts.map +0 -1
- package/dist/components/ProductGrid.d.ts.map +0 -1
- package/dist/components/ProductOptionSelector.d.ts.map +0 -1
- package/dist/components/ProductSpecs.d.ts.map +0 -1
- package/dist/components/QuantityInput.d.ts.map +0 -1
- package/dist/components/RelatedProducts.d.ts.map +0 -1
- package/dist/components/SignInModal.d.ts.map +0 -1
- package/dist/components/StorefrontErrorBoundary.d.ts.map +0 -1
- package/dist/components/StorefrontFooter.d.ts.map +0 -1
- package/dist/components/StorefrontHeader.d.ts.map +0 -1
- package/dist/components/Toaster.d.ts.map +0 -1
- package/dist/components/sections/CategoryShowcase.d.ts +0 -6
- package/dist/components/sections/CategoryShowcase.d.ts.map +0 -1
- package/dist/components/sections/HeroSection.d.ts +0 -9
- package/dist/components/sections/HeroSection.d.ts.map +0 -1
- package/dist/components/sections/MediaCarousel.d.ts +0 -11
- package/dist/components/sections/MediaCarousel.d.ts.map +0 -1
- package/dist/components/sections/MiscSections.d.ts +0 -33
- package/dist/components/sections/MiscSections.d.ts.map +0 -1
- package/dist/components/sections/ProductRail.d.ts +0 -9
- package/dist/components/sections/ProductRail.d.ts.map +0 -1
- package/dist/components/sections/ProductSlider.d.ts +0 -15
- package/dist/components/sections/ProductSlider.d.ts.map +0 -1
- package/dist/config.d.ts +0 -174
- package/dist/config.d.ts.map +0 -1
- package/dist/createStorefrontApp.d.ts +0 -28
- package/dist/createStorefrontApp.d.ts.map +0 -1
- package/dist/define.d.ts.map +0 -1
- package/dist/format.d.ts.map +0 -1
- package/dist/hooks/useCategories.d.ts +0 -6
- package/dist/hooks/useCategories.d.ts.map +0 -1
- package/dist/hooks/useDiscountValidator.d.ts +0 -14
- package/dist/hooks/useDiscountValidator.d.ts.map +0 -1
- package/dist/hooks/useMyOrders.d.ts.map +0 -1
- package/dist/hooks/useProduct.d.ts +0 -7
- package/dist/hooks/useProduct.d.ts.map +0 -1
- package/dist/hooks/useProducts.d.ts.map +0 -1
- package/dist/hooks/useStorefront.d.ts +0 -35
- package/dist/hooks/useStorefront.d.ts.map +0 -1
- package/dist/hooks/useStorefrontHead.d.ts +0 -11
- package/dist/hooks/useStorefrontHead.d.ts.map +0 -1
- package/dist/motion.d.ts.map +0 -1
- package/dist/order-status.d.ts.map +0 -1
- package/dist/pages/CatalogPage.d.ts.map +0 -1
- package/dist/pages/CheckoutPage.d.ts.map +0 -1
- package/dist/pages/HomePage.d.ts +0 -9
- package/dist/pages/HomePage.d.ts.map +0 -1
- package/dist/pages/MyPurchasesPage.d.ts.map +0 -1
- package/dist/pages/NotFoundPage.d.ts.map +0 -1
- package/dist/pages/OrderConfirmationPage.d.ts.map +0 -1
- package/dist/pages/ProductDetailPage.d.ts.map +0 -1
- package/dist/presets.d.ts.map +0 -1
- package/dist/product-options.d.ts +0 -12
- package/dist/product-options.d.ts.map +0 -1
- package/dist/router.d.ts.map +0 -1
- package/dist/scaffold.d.ts.map +0 -1
- package/dist/sections.d.ts.map +0 -1
- package/dist/testids.d.ts.map +0 -1
- package/dist/theme.d.ts.map +0 -1
- package/src/auth.ts +0 -227
- package/src/blocks.tsx +0 -51
- package/src/catalog.ts +0 -3
- package/src/component-contracts.ts +0 -154
- package/src/component-selectors.ts +0 -31
- package/src/components/CartDrawer.tsx +0 -279
- package/src/components/CustomerAccountShell.tsx +0 -102
- package/src/components/DeliveryEstimator.tsx +0 -157
- package/src/components/FiltersPanel.tsx +0 -109
- package/src/components/OrderTrackingTimeline.tsx +0 -135
- package/src/components/Price.tsx +0 -32
- package/src/components/ProductCard.tsx +0 -120
- package/src/components/ProductEnquiryForm.tsx +0 -175
- package/src/components/ProductGallery.tsx +0 -174
- package/src/components/ProductGrid.tsx +0 -43
- package/src/components/ProductOptionSelector.tsx +0 -50
- package/src/components/ProductSpecs.tsx +0 -75
- package/src/components/QuantityInput.tsx +0 -52
- package/src/components/RelatedProducts.tsx +0 -40
- package/src/components/SignInModal.tsx +0 -120
- package/src/components/SmoothImage.tsx +0 -59
- package/src/components/StorefrontErrorBoundary.tsx +0 -51
- package/src/components/StorefrontFooter.tsx +0 -110
- package/src/components/StorefrontHeader.tsx +0 -477
- package/src/components/Toaster.tsx +0 -60
- package/src/components/sections/CategoryShowcase.tsx +0 -80
- package/src/components/sections/HeroSection.tsx +0 -193
- package/src/components/sections/MediaCarousel.tsx +0 -141
- package/src/components/sections/MiscSections.tsx +0 -158
- package/src/components/sections/ProductRail.tsx +0 -81
- package/src/components/sections/ProductSlider.tsx +0 -119
- package/src/config.ts +0 -229
- package/src/createStorefrontApp.tsx +0 -247
- package/src/define.ts +0 -34
- package/src/format.ts +0 -7
- package/src/hooks/index.ts +0 -6
- package/src/hooks/useCategories.ts +0 -26
- package/src/hooks/useDiscountValidator.ts +0 -43
- package/src/hooks/useMyOrders.ts +0 -41
- package/src/hooks/useProduct.ts +0 -36
- package/src/hooks/useProducts.ts +0 -39
- package/src/hooks/useStorefront.ts +0 -58
- package/src/hooks/useStorefrontHead.ts +0 -25
- package/src/index.ts +0 -202
- package/src/motion.tsx +0 -94
- package/src/order-status.ts +0 -33
- package/src/pages/CatalogPage.tsx +0 -118
- package/src/pages/CheckoutPage.tsx +0 -689
- package/src/pages/HomePage.tsx +0 -16
- package/src/pages/MyPurchasesPage.tsx +0 -311
- package/src/pages/NotFoundPage.tsx +0 -25
- package/src/pages/OrderConfirmationPage.tsx +0 -190
- package/src/pages/PolicyPage.tsx +0 -47
- package/src/pages/ProductDetailPage.tsx +0 -264
- package/src/presets.ts +0 -324
- package/src/product-options.ts +0 -63
- package/src/router.ts +0 -49
- package/src/scaffold.tsx +0 -115
- package/src/sections.ts +0 -116
- package/src/shop.ts +0 -4
- package/src/stores/cart.store.ts +0 -185
- package/src/stores/catalog.store.ts +0 -39
- package/src/stores/delivery.store.ts +0 -152
- package/src/stores/session.store.ts +0 -28
- package/src/stores/toast.store.ts +0 -43
- package/src/testids.ts +0 -136
- package/src/theme.ts +0 -194
- package/src/ui.ts +0 -5
- package/src/workflows/checkout.ts +0 -119
- /package/dist/components/{SignInModal.d.ts → account/SignInModal.d.ts} +0 -0
- /package/dist/components/{CartDrawer.d.ts → cart/CartDrawer.d.ts} +0 -0
- /package/dist/components/{QuantityInput.d.ts → cart/QuantityInput.d.ts} +0 -0
- /package/dist/components/{DeliveryEstimator.d.ts → checkout/DeliveryEstimator.d.ts} +0 -0
- /package/dist/components/{ProductGrid.d.ts → collection/ProductGrid.d.ts} +0 -0
- /package/dist/components/{StorefrontErrorBoundary.d.ts → layout/StorefrontErrorBoundary.d.ts} +0 -0
- /package/dist/components/{StorefrontFooter.d.ts → layout/StorefrontFooter.d.ts} +0 -0
- /package/dist/components/{StorefrontHeader.d.ts → layout/StorefrontHeader.d.ts} +0 -0
- /package/dist/components/{Toaster.d.ts → layout/Toaster.d.ts} +0 -0
- /package/dist/components/{OrderTrackingTimeline.d.ts → order/OrderTrackingTimeline.d.ts} +0 -0
- /package/dist/components/{ProductEnquiryForm.d.ts → product/ProductEnquiryForm.d.ts} +0 -0
- /package/dist/components/{ProductSpecs.d.ts → product/ProductSpecs.d.ts} +0 -0
- /package/dist/components/{RelatedProducts.d.ts → product/RelatedProducts.d.ts} +0 -0
- /package/dist/{order-status.d.ts → data/order-status.d.ts} +0 -0
- /package/dist/{component-selectors.d.ts → extend/component-selectors.d.ts} +0 -0
- /package/dist/{format.d.ts → lib/format.d.ts} +0 -0
- /package/dist/{motion.d.ts → lib/motion.d.ts} +0 -0
- /package/dist/{pages → views}/CatalogPage.d.ts +0 -0
- /package/dist/{pages → views}/CheckoutPage.d.ts +0 -0
- /package/dist/{pages → views}/MyPurchasesPage.d.ts +0 -0
- /package/dist/{pages → views}/NotFoundPage.d.ts +0 -0
- /package/dist/{pages → views}/OrderConfirmationPage.d.ts +0 -0
- /package/dist/{pages → views}/PolicyPage.d.ts +0 -0
- /package/dist/{pages → views}/ProductDetailPage.d.ts +0 -0
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
import type { EntityDeclarationInput } from '@fayz-ai/core';
|
|
3
|
+
import type { ShopProvider } from '@fayz-ai/shop/provider';
|
|
4
|
+
import type { MockShopSeed } from '@fayz-ai/shop/mock';
|
|
5
|
+
import type { PaymentMethodKind, Product, StoreSettings } from '@fayz-ai/shop/types';
|
|
6
|
+
import type { Promotion } from '@fayz-ai/shop/rules';
|
|
7
|
+
import type { StorefrontTheme } from '../lib/theme';
|
|
8
|
+
import type { HomeConfig, NavLink, FooterConfig } from '../blocks/sections';
|
|
9
|
+
import type { StorefrontPagesConfig } from '../blocks/page-blocks';
|
|
10
|
+
import type { StorefrontSlots } from '../extend/slots';
|
|
11
|
+
import type { StorefrontAuthConfig } from '../data/auth';
|
|
12
|
+
import type { StorefrontComponents } from '../extend/component-contracts';
|
|
13
|
+
import type { StorefrontReviewsConfig } from '../components/product/ProductReviews';
|
|
14
|
+
import type { CatalogFacetConfig } from '../components/collection/FiltersPanel';
|
|
15
|
+
export type StorefrontRouteKind = 'home' | 'catalog' | 'product' | 'checkout' | 'account' | 'order' | 'custom';
|
|
16
|
+
export type StorefrontRouteParams = Record<string, string>;
|
|
17
|
+
export interface StorefrontRouteComponentProps {
|
|
18
|
+
path: string;
|
|
19
|
+
params: StorefrontRouteParams;
|
|
20
|
+
config: ResolvedStorefrontConfig;
|
|
21
|
+
}
|
|
22
|
+
export type StorefrontRouteChrome = 'default' | 'focused';
|
|
23
|
+
export type StorefrontCommerceMode = 'checkout' | 'catalog' | 'enquiry';
|
|
24
|
+
export type StorefrontImageLoadingMode = 'fade' | 'none';
|
|
25
|
+
export interface StorefrontImageLoadingConfig {
|
|
26
|
+
mode?: StorefrontImageLoadingMode;
|
|
27
|
+
durationMs?: number;
|
|
28
|
+
easing?: string;
|
|
29
|
+
blur?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface StorefrontRouteDefinition {
|
|
32
|
+
/**
|
|
33
|
+
* Stable identifier for generated-code diffs, QA reports, and route ownership.
|
|
34
|
+
*/
|
|
35
|
+
id: string;
|
|
36
|
+
/**
|
|
37
|
+
* Hash route pattern. Supports the same params as matchPath, e.g. '/checkout'
|
|
38
|
+
* or '/collections/:slug'. Custom routes are matched before SDK defaults.
|
|
39
|
+
*/
|
|
40
|
+
path: string;
|
|
41
|
+
/**
|
|
42
|
+
* Intent label for agents and manifests. It does not change matching behavior.
|
|
43
|
+
*/
|
|
44
|
+
kind?: StorefrontRouteKind;
|
|
45
|
+
/**
|
|
46
|
+
* Shell chrome for the route. `focused` hides storefront nav/footer/cart
|
|
47
|
+
* around high-intent flows such as checkout.
|
|
48
|
+
*/
|
|
49
|
+
chrome?: StorefrontRouteChrome;
|
|
50
|
+
/**
|
|
51
|
+
* App-owned screen/workflow that can still use storefront/shop primitives.
|
|
52
|
+
*/
|
|
53
|
+
component: React.ComponentType<StorefrontRouteComponentProps>;
|
|
54
|
+
}
|
|
55
|
+
export interface StorefrontDiscountConfig {
|
|
56
|
+
code: string;
|
|
57
|
+
percent: number;
|
|
58
|
+
title?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface StorefrontEnquiryConfig {
|
|
61
|
+
label?: string;
|
|
62
|
+
successMessage?: string;
|
|
63
|
+
subjectPrefix?: string;
|
|
64
|
+
email?: string;
|
|
65
|
+
whatsappUrl?: string;
|
|
66
|
+
requirePhone?: boolean;
|
|
67
|
+
}
|
|
68
|
+
export interface StorefrontConfig {
|
|
69
|
+
/** Store display name (header, page title) */
|
|
70
|
+
name: string;
|
|
71
|
+
/** Optional logo node; defaults to the store name */
|
|
72
|
+
logo?: React.ReactNode;
|
|
73
|
+
/** ISO 4217 — default 'BRL' */
|
|
74
|
+
currency?: string;
|
|
75
|
+
/** Intl locale for money/date formatting — default 'pt-BR' */
|
|
76
|
+
locale?: string;
|
|
77
|
+
/** Visual identity: colors, fonts, radius, header/card personality */
|
|
78
|
+
theme?: StorefrontTheme;
|
|
79
|
+
/** Checkout-first default, catalog-only browsing, or product enquiry flow. */
|
|
80
|
+
commerceMode?: StorefrontCommerceMode;
|
|
81
|
+
/** Promo message above the header (e.g. 'FRETE GRÁTIS ACIMA DE R$ 300') */
|
|
82
|
+
announcement?: string;
|
|
83
|
+
/**
|
|
84
|
+
* How pages are addressed when this store is served.
|
|
85
|
+
*
|
|
86
|
+
* `'hash'` (the default) needs no server configuration and is how every
|
|
87
|
+
* shipped store works today. `'history'` gives each page a real URL, which is
|
|
88
|
+
* what makes it indexable, shareable with its own link preview, and
|
|
89
|
+
* prerenderable — and requires the host to serve the app shell for unknown
|
|
90
|
+
* paths, or a deep link 404s before the app ever runs.
|
|
91
|
+
*/
|
|
92
|
+
routing?: 'hash' | 'history';
|
|
93
|
+
/**
|
|
94
|
+
* Home page blueprint. When set, `/` renders it and the catalog moves to /catalog.
|
|
95
|
+
*
|
|
96
|
+
* Still fully supported — five of seven live stores write it. `pages.home` is
|
|
97
|
+
* the same thing with room for the other routes; this stays as the short form.
|
|
98
|
+
*/
|
|
99
|
+
home?: HomeConfig;
|
|
100
|
+
/**
|
|
101
|
+
* Pages composed from blocks.
|
|
102
|
+
*
|
|
103
|
+
* `catalog` and `product` compose AROUND the native body block rather than
|
|
104
|
+
* replacing it, so a store adds content to those pages without taking over
|
|
105
|
+
* their maintenance. Omitting a page renders the SDK default — adopting this
|
|
106
|
+
* field changes nothing until something is added.
|
|
107
|
+
*/
|
|
108
|
+
pages?: StorefrontPagesConfig;
|
|
109
|
+
/**
|
|
110
|
+
* Blocks grafted into named positions inside SDK pages.
|
|
111
|
+
*
|
|
112
|
+
* This is the rung between "configure a section" and "rewrite the page". If
|
|
113
|
+
* you are about to reimplement an SDK page to add one thing to it, look for
|
|
114
|
+
* the slot first — and if the position you need is missing, that is a gap in
|
|
115
|
+
* this list rather than a reason to fork. `listSlots()` enumerates them.
|
|
116
|
+
*/
|
|
117
|
+
slots?: StorefrontSlots;
|
|
118
|
+
/** Header nav links — defaults derived from home/catalog routing */
|
|
119
|
+
nav?: NavLink[];
|
|
120
|
+
/** Footer content (about text, contact, social) */
|
|
121
|
+
footer?: FooterConfig;
|
|
122
|
+
/** Preferred backend descriptor for manifest/scaffold metadata. */
|
|
123
|
+
backend?: {
|
|
124
|
+
provider?: 'mock' | 'fayz-api' | 'fayz-shop' | 'custom';
|
|
125
|
+
url?: string;
|
|
126
|
+
};
|
|
127
|
+
/** @deprecated Use backend/provider adapters. Storefront no longer creates Supabase clients. */
|
|
128
|
+
supabaseUrl?: string;
|
|
129
|
+
/** @deprecated Use backend/provider adapters. Storefront no longer creates Supabase clients. */
|
|
130
|
+
supabaseAnonKey?: string;
|
|
131
|
+
/** Explicit provider override (tests, custom backends) */
|
|
132
|
+
provider?: ShopProvider;
|
|
133
|
+
/** Per-store mock catalog (products/categories/discounts) for mock mode */
|
|
134
|
+
catalog?: MockShopSeed;
|
|
135
|
+
/**
|
|
136
|
+
* Custom entity declarations (spine M4), keyed by entity key. Registered
|
|
137
|
+
* through defineEntity at runtime init, so one config field yields the
|
|
138
|
+
* record schema, the storage descriptor, the generated RLS, the entity.*
|
|
139
|
+
* loaders and the admin form.
|
|
140
|
+
*/
|
|
141
|
+
entities?: Record<string, EntityDeclarationInput>;
|
|
142
|
+
/** Store-level discount codes available regardless of provider backend. */
|
|
143
|
+
discounts?: StorefrontDiscountConfig[];
|
|
144
|
+
/**
|
|
145
|
+
* Rule-engine promotions (spine M6) — the serializable Promotion shape:
|
|
146
|
+
* eligibility rules + application method, pure data. Rides in the Store
|
|
147
|
+
* Document's `promotions` section; the mock provider evaluates them with
|
|
148
|
+
* the reference evaluator, a live backend re-evaluates server-side. A
|
|
149
|
+
* `{code, percent}` entry in `discounts` is the same thing in shorthand.
|
|
150
|
+
*/
|
|
151
|
+
promotions?: Promotion[];
|
|
152
|
+
/**
|
|
153
|
+
* Institutional/legal page content (privacy, terms, returns). Plain text —
|
|
154
|
+
* blank lines separate paragraphs. Unset pages render a placeholder so the
|
|
155
|
+
* routes (and footer links) exist even before the store writes its policy.
|
|
156
|
+
*/
|
|
157
|
+
legal?: {
|
|
158
|
+
privacy?: string;
|
|
159
|
+
terms?: string;
|
|
160
|
+
returns?: string;
|
|
161
|
+
};
|
|
162
|
+
/** Customer auth — same AuthAdapter contract as createSaasApp. Default: mock. */
|
|
163
|
+
auth?: StorefrontAuthConfig;
|
|
164
|
+
/** Shipping pricing — default { flatRate: 0 } */
|
|
165
|
+
shipping?: {
|
|
166
|
+
flatRate?: number;
|
|
167
|
+
freeAbove?: number;
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* Payment behavior. v1 default 'mock' instantly marks orders paid with NO
|
|
171
|
+
* real charge (demo). M4 sets 'pix-mercadopago' so orders stay pending until
|
|
172
|
+
* a real payment webhook confirms settlement.
|
|
173
|
+
*/
|
|
174
|
+
payments?: {
|
|
175
|
+
/**
|
|
176
|
+
* 'gateway' means a real PSP is connected: the checkout opens a charge and
|
|
177
|
+
* the order waits for it. WHICH provider is deliberately not spelled here —
|
|
178
|
+
* that lives in the store's connection row, server side. A storefront that
|
|
179
|
+
* named the acquirer would need a redeploy to change acquirer.
|
|
180
|
+
*/
|
|
181
|
+
mode?: 'mock' | 'pix-mercadopago' | 'gateway';
|
|
182
|
+
/**
|
|
183
|
+
* Which methods the checkout offers. Declaring them is what lets the order
|
|
184
|
+
* record how the buyer intends to pay instead of assuming 'credit_card',
|
|
185
|
+
* which is what it did while the card form was a simulation.
|
|
186
|
+
*/
|
|
187
|
+
methods?: readonly PaymentMethodKind[];
|
|
188
|
+
/**
|
|
189
|
+
* Published payment terms, shown on the card and the PDP. These are the two
|
|
190
|
+
* lines every Brazilian storefront carries and the SDK had no model for:
|
|
191
|
+
* the Pix discount and the interest-free instalment.
|
|
192
|
+
*
|
|
193
|
+
* Display only — they describe what the merchant advertises, not a charge
|
|
194
|
+
* the checkout computes. A product may override the Pix price per SKU via
|
|
195
|
+
* `metadata.pixPrice`.
|
|
196
|
+
*/
|
|
197
|
+
terms?: {
|
|
198
|
+
/** e.g. 5 → "5% de desconto no Pix". */
|
|
199
|
+
pixDiscountPercent?: number;
|
|
200
|
+
/** Longest interest-free plan offered. */
|
|
201
|
+
maxInstallments?: number;
|
|
202
|
+
/** Don't split below this per-instalment value. Default 10. */
|
|
203
|
+
minInstallmentValue?: number;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* The PDP specification table renders scalar `product.metadata` alongside
|
|
208
|
+
* SKU/category/weight. Stores also keep bookkeeping in metadata; `exclude`
|
|
209
|
+
* hides those keys and `labels` names the rest, so a store doesn't have to
|
|
210
|
+
* fork ProductSpecs to stop showing an internal field.
|
|
211
|
+
*/
|
|
212
|
+
productSpecs?: {
|
|
213
|
+
exclude?: readonly string[];
|
|
214
|
+
labels?: Readonly<Record<string, string>>;
|
|
215
|
+
};
|
|
216
|
+
/** Product reviews shown on the PDP. See ./components/product/ProductReviews. */
|
|
217
|
+
reviews?: StorefrontReviewsConfig;
|
|
218
|
+
/**
|
|
219
|
+
* Extra catalog refinements over `product.metadata`, rendered in the filters
|
|
220
|
+
* panel and reflected in `?<key>=<value>`. This is how a store adds its own
|
|
221
|
+
* discovery axis — colour, purpose, brand — without forking FiltersPanel.
|
|
222
|
+
*/
|
|
223
|
+
catalogFacets?: readonly CatalogFacetConfig[];
|
|
224
|
+
/** Product enquiry behavior for catalog/enquiry stores. */
|
|
225
|
+
enquiry?: StorefrontEnquiryConfig;
|
|
226
|
+
/** Feature toggles — defaults depend on commerceMode. */
|
|
227
|
+
features?: {
|
|
228
|
+
discounts?: boolean;
|
|
229
|
+
accounts?: boolean;
|
|
230
|
+
cart?: boolean;
|
|
231
|
+
checkout?: boolean;
|
|
232
|
+
};
|
|
233
|
+
/** Global storefront image reveal behavior. Default is a soft fade. */
|
|
234
|
+
imageLoading?: StorefrontImageLoadingConfig;
|
|
235
|
+
/** Header search behaviour. Omit for the inline live-filter. */
|
|
236
|
+
search?: StorefrontSearchConfig;
|
|
237
|
+
/**
|
|
238
|
+
* The merchant's own commercial policy, read from the store's settings row at
|
|
239
|
+
* boot (see ./store-policy). NOT authored here: an app declares its defaults
|
|
240
|
+
* through the fields above, and this arrives from the database to override the
|
|
241
|
+
* ones the merchant actually decided.
|
|
242
|
+
*
|
|
243
|
+
* Present so components can read the decisions that have no equivalent
|
|
244
|
+
* config field — whether an account is required, which optional checkout
|
|
245
|
+
* fields to show. The ones that DO have a field (currency, payment methods)
|
|
246
|
+
* are folded into those fields instead, so nothing has to read both.
|
|
247
|
+
*/
|
|
248
|
+
policy?: StoreSettings;
|
|
249
|
+
/** Code-level component replacements. Kept out of serialized manifests. */
|
|
250
|
+
components?: StorefrontComponents;
|
|
251
|
+
/** Code-level route overrides/custom routes. Kept out of serialized manifests. */
|
|
252
|
+
routes?: readonly StorefrontRouteDefinition[];
|
|
253
|
+
}
|
|
254
|
+
export interface ResolvedStorefrontConfig extends StorefrontConfig {
|
|
255
|
+
currency: string;
|
|
256
|
+
locale: string;
|
|
257
|
+
shipping: {
|
|
258
|
+
flatRate: number;
|
|
259
|
+
freeAbove?: number;
|
|
260
|
+
};
|
|
261
|
+
payments: {
|
|
262
|
+
mode: NonNullable<NonNullable<StorefrontConfig['payments']>['mode']>;
|
|
263
|
+
methods: readonly PaymentMethodKind[];
|
|
264
|
+
terms?: NonNullable<StorefrontConfig['payments']>['terms'];
|
|
265
|
+
};
|
|
266
|
+
commerceMode: StorefrontCommerceMode;
|
|
267
|
+
enquiry: Required<Pick<StorefrontEnquiryConfig, 'label' | 'successMessage' | 'subjectPrefix'>> & Omit<StorefrontEnquiryConfig, 'label' | 'successMessage' | 'subjectPrefix'>;
|
|
268
|
+
features: {
|
|
269
|
+
discounts: boolean;
|
|
270
|
+
accounts: boolean;
|
|
271
|
+
cart: boolean;
|
|
272
|
+
checkout: boolean;
|
|
273
|
+
};
|
|
274
|
+
imageLoading: Required<StorefrontImageLoadingConfig>;
|
|
275
|
+
/** Where the full product list lives ('/' without a home page, '/catalog' with one) */
|
|
276
|
+
catalogPath: string;
|
|
277
|
+
nav: NavLink[];
|
|
278
|
+
/** `pages` with the legacy `home` short form folded in — always read this one. */
|
|
279
|
+
pages: StorefrontPagesConfig;
|
|
280
|
+
search: Required<Omit<StorefrontSearchConfig, 'renderSuggestion'>> & Pick<StorefrontSearchConfig, 'renderSuggestion'>;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Header search. Defaults reproduce the inline live-filter the storefront has
|
|
284
|
+
* always had, so turning this on is opt-in; every label and limit is a knob
|
|
285
|
+
* because "what a search feels like" is a per-store decision, not the SDK's.
|
|
286
|
+
*/
|
|
287
|
+
export interface StorefrontSearchConfig {
|
|
288
|
+
/**
|
|
289
|
+
* 'inline' filters the catalogue as you type (the original behaviour).
|
|
290
|
+
* 'overlay' dims the page and shows suggestions under the field, with a
|
|
291
|
+
* link through to the full result page.
|
|
292
|
+
*/
|
|
293
|
+
mode?: 'inline' | 'overlay';
|
|
294
|
+
placeholder?: string;
|
|
295
|
+
/** Where "see all results" lands, carrying `?q=`. */
|
|
296
|
+
resultsPath?: string;
|
|
297
|
+
/** Suggestions shown under the field before the shopper commits. */
|
|
298
|
+
suggestionsLimit?: number;
|
|
299
|
+
/** Characters before anything is queried — 1 matches everything, which is noise. */
|
|
300
|
+
minChars?: number;
|
|
301
|
+
ctaLabel?: string;
|
|
302
|
+
emptyLabel?: string;
|
|
303
|
+
/** Full control of a suggestion row when the default card is wrong for the store. */
|
|
304
|
+
renderSuggestion?: (product: Product) => ReactNode;
|
|
305
|
+
}
|
|
306
|
+
export declare function resolveConfig(config: StorefrontConfig): ResolvedStorefrontConfig;
|
|
307
|
+
export declare const StorefrontConfigProvider: React.Provider<ResolvedStorefrontConfig | null>;
|
|
308
|
+
export declare function useStorefrontConfig(): ResolvedStorefrontConfig;
|
|
309
|
+
export declare function useStorefrontConfigOptional(): ResolvedStorefrontConfig | null;
|
|
310
|
+
export declare function getStorefrontComponents(config: ResolvedStorefrontConfig): StorefrontComponents;
|
|
311
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/document/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACxE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAGlE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAA;AACzE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAA;AACnF,OAA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BAAwB,GAAG,oBAAoB,CAE9F"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { BlockDescriptor, EntityDescriptor, ExtensionPointDescriptor, JsonSchema, LoaderDescriptor, RegistryEntryDescriptor } from '@fayz-ai/core';
|
|
2
|
+
import type { RuleAttribute } from '@fayz-ai/shop/rules';
|
|
3
|
+
import type { FayzDeprecation, FayzDeprecationPolicy } from '@fayz-ai/sdk/deprecations';
|
|
4
|
+
import type { StoreCodemodDescriptor, StoreDeprecationFinding } from './upgrade';
|
|
5
|
+
import type { SlotDescriptor } from '../extend/slots';
|
|
6
|
+
import type { StoreDocument, StoreSectionName } from './sections';
|
|
7
|
+
import type { StoreValidationReport } from './validate';
|
|
8
|
+
/**
|
|
9
|
+
* What this store's backend can do.
|
|
10
|
+
*
|
|
11
|
+
* Designed to become backend-aware: today every store is Fayz-backed, so the
|
|
12
|
+
* values are constants. When a second backend lands (spine I11 — e.g. a
|
|
13
|
+
* Shopify-backed store whose catalog is mirrored into canonical tables), this
|
|
14
|
+
* shape is derived from the backend provider instead: a Shopify-backed store
|
|
15
|
+
* keeps `catalogMirror` but cannot run our rule engine, so `ruleEngine`
|
|
16
|
+
* flips false while the document stays identical. Consumers must branch on
|
|
17
|
+
* these flags, never on the provider name.
|
|
18
|
+
*/
|
|
19
|
+
export interface StoreCapabilities {
|
|
20
|
+
/** Backend family serving the store. */
|
|
21
|
+
backend: string;
|
|
22
|
+
/** Commerce modes the storefront shell can run. */
|
|
23
|
+
commerceModes: readonly string[];
|
|
24
|
+
/** Reads come from the canonical Fayz catalog (mirrored for ERP-backed stores). */
|
|
25
|
+
catalogMirror: boolean;
|
|
26
|
+
/** Cart + checkout run against the Fayz order path. */
|
|
27
|
+
checkout: boolean;
|
|
28
|
+
/** Declared data loaders resolved once per page (spine M3). */
|
|
29
|
+
loaders: boolean;
|
|
30
|
+
/** Rule engine (spine M6): promotions as data, evaluated by the reference
|
|
31
|
+
* evaluator (mock) or shop_compute_promotion_actions (Supabase). True for
|
|
32
|
+
* Fayz-backed stores; a backend that cannot run our rules (e.g. a
|
|
33
|
+
* Shopify-mirrored store) flips this false and consumers must branch on
|
|
34
|
+
* the flag, never the provider name. */
|
|
35
|
+
ruleEngine: boolean;
|
|
36
|
+
/** Custom entity declarations (spine M4): defineEntity + entity.* loaders +
|
|
37
|
+
* generic storage. True for Fayz-backed stores (both providers implement
|
|
38
|
+
* the entity surface); a future backend without it flips this false and
|
|
39
|
+
* consumers must branch on the flag, never the provider name. */
|
|
40
|
+
customEntities: boolean;
|
|
41
|
+
/** Extension point registry (spine M7): declared seams with enforced
|
|
42
|
+
* input+output schemas, many dependency-ordered handlers, and exactly one
|
|
43
|
+
* nullable beforePlaceOrder escape valve. */
|
|
44
|
+
extensionPoints: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface StoreSectionDescription {
|
|
47
|
+
description: string;
|
|
48
|
+
/** Section versions this SDK understands, ascending. */
|
|
49
|
+
versions: readonly number[];
|
|
50
|
+
/** JSON Schema for the section, compiled from the same spec the validator runs. */
|
|
51
|
+
schema: JsonSchema;
|
|
52
|
+
}
|
|
53
|
+
/** Summary of one concrete document, when one is passed in. */
|
|
54
|
+
/** The I10 contract, as data the agent reads before authoring (spine M10):
|
|
55
|
+
* the policy, every deprecation, and the codemod that answers each one. */
|
|
56
|
+
export interface StoreContractDescription {
|
|
57
|
+
policy: FayzDeprecationPolicy;
|
|
58
|
+
deprecations: FayzDeprecation[];
|
|
59
|
+
codemods: StoreCodemodDescriptor[];
|
|
60
|
+
}
|
|
61
|
+
export interface StoreDocumentSummary {
|
|
62
|
+
name?: string;
|
|
63
|
+
/** Sections present in the document. */
|
|
64
|
+
sections: string[];
|
|
65
|
+
/** Block types the document places (pages, home, slots), sorted, deduped. */
|
|
66
|
+
blocksUsed: string[];
|
|
67
|
+
/** Loader ids the document's data declarations reference, sorted, deduped.
|
|
68
|
+
* Meta-level needs of placed blocks are not repeated here — they are the
|
|
69
|
+
* block's own contract, readable from the blocks registry. */
|
|
70
|
+
loadersUsed: string[];
|
|
71
|
+
/** Handle names the document references, sorted, deduped. */
|
|
72
|
+
handlesUsed: string[];
|
|
73
|
+
/** What in THIS store is deprecated, and what replaces it (I10 + I2). */
|
|
74
|
+
deprecations: StoreDeprecationFinding[];
|
|
75
|
+
validation: StoreValidationReport;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* One of the author-facing abilities (spine §3 L5).
|
|
79
|
+
*
|
|
80
|
+
* Enumerating them is the point. WooCommerce's own conclusion about agent
|
|
81
|
+
* surfaces — quoted in the spine — is that the surface must be "purpose-built
|
|
82
|
+
* domain abilities … instead of automatically projecting every REST-shaped
|
|
83
|
+
* operation", and an ability an agent cannot discover is an ability it will not
|
|
84
|
+
* use. There are four, they are listed here with their input schemas, and the
|
|
85
|
+
* list is derived from nothing: if a fifth is added it must be added here.
|
|
86
|
+
*/
|
|
87
|
+
export interface StoreAbilityDescriptor {
|
|
88
|
+
name: 'describeStore' | 'validateStore' | 'renderStore' | 'applyChange';
|
|
89
|
+
/** Where it is imported from. */
|
|
90
|
+
module: string;
|
|
91
|
+
/** Does it change the document? */
|
|
92
|
+
writes: boolean;
|
|
93
|
+
description: string;
|
|
94
|
+
/** JSON Schema of the options/arguments beyond the document itself. */
|
|
95
|
+
input: JsonSchema;
|
|
96
|
+
/** What the caller gets back, in prose — the shapes are exported types. */
|
|
97
|
+
output: string;
|
|
98
|
+
}
|
|
99
|
+
export interface StoreDescription {
|
|
100
|
+
version: 1;
|
|
101
|
+
capabilities: StoreCapabilities;
|
|
102
|
+
/** The four abilities, with their input schemas (spine L5). */
|
|
103
|
+
abilities: readonly StoreAbilityDescriptor[];
|
|
104
|
+
sections: Record<StoreSectionName, StoreSectionDescription>;
|
|
105
|
+
/** The deprecation contract (spine M10, I10). Enumerable on purpose: an
|
|
106
|
+
* agent that cannot read what is going away will keep generating it. */
|
|
107
|
+
contract: StoreContractDescription;
|
|
108
|
+
registries: {
|
|
109
|
+
blocks: BlockDescriptor[];
|
|
110
|
+
loaders: LoaderDescriptor[];
|
|
111
|
+
entities: EntityDescriptor[];
|
|
112
|
+
handles: RegistryEntryDescriptor[];
|
|
113
|
+
/** The rule attribute vocabulary AS ROWS (I9) — the same rows the admin
|
|
114
|
+
* promotion form renders from and validateStore checks against. */
|
|
115
|
+
ruleAttributes: RuleAttribute[];
|
|
116
|
+
/** Every extension point with its input/output schemas AND registered
|
|
117
|
+
* handlers (spine M7) — the enumerable behaviour surface. */
|
|
118
|
+
extensionPoints: ExtensionPointDescriptor[];
|
|
119
|
+
};
|
|
120
|
+
/** The closed operator set rules may use. */
|
|
121
|
+
ruleOperators: readonly string[];
|
|
122
|
+
pageKinds: readonly string[];
|
|
123
|
+
slots: readonly SlotDescriptor[];
|
|
124
|
+
componentSlots: readonly string[];
|
|
125
|
+
settingTypes: readonly string[];
|
|
126
|
+
/** The field-type vocabulary defineEntity accepts (spine M4). */
|
|
127
|
+
entityFieldTypes: readonly string[];
|
|
128
|
+
document?: StoreDocumentSummary;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* The machine-readable description of the storefront authoring surface, plus —
|
|
132
|
+
* when a document is passed — a summary of that document against it.
|
|
133
|
+
*/
|
|
134
|
+
export declare function describeStore(doc?: StoreDocument | Record<string, unknown>): StoreDescription;
|
|
135
|
+
//# sourceMappingURL=describe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../src/document/describe.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,UAAU,EACV,gBAAgB,EAChB,uBAAuB,EACxB,MAAM,eAAe,CAAA;AAEtB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AAEvF,OAAO,KAAK,EAAE,sBAA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C/B,iEAAiE;IACjE,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAA;IACnC,QAAQ,CAAC,EAAE,oBAAoB,CAAA;CAChC;AAmKD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,CAAC,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,gBAAgB,CAkD7F"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { StoreDocument } from './sections';
|
|
2
|
+
import type { StoreValidationReport } from './validate';
|
|
3
|
+
/** Sparse map of document path -> value. Absent means "use the document's". */
|
|
4
|
+
export type StoreOverlay = Record<string, unknown>;
|
|
5
|
+
export interface OverlayRejection {
|
|
6
|
+
path: string;
|
|
7
|
+
code: 'unparseable-path' | 'not-a-setting' | 'section-not-overlayable' | 'no-block-at-path';
|
|
8
|
+
message: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ApplyOverlayResult {
|
|
11
|
+
/** The document a shopper is served: base with the accepted settings applied. */
|
|
12
|
+
document: Record<string, unknown>;
|
|
13
|
+
/** Paths that were applied, in the order they were. */
|
|
14
|
+
applied: string[];
|
|
15
|
+
/** Paths the rule refused, each saying why. */
|
|
16
|
+
rejected: OverlayRejection[];
|
|
17
|
+
/** Validation of the MERGED document — the only one that matters. */
|
|
18
|
+
validation: StoreValidationReport;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Sections an overlay may reach into at all. Everything else is mirrored from
|
|
22
|
+
* the backend (catalog), money (commerce), infrastructure (backend, auth) or
|
|
23
|
+
* code — none of which is a settings-panel change.
|
|
24
|
+
*/
|
|
25
|
+
export declare const OVERLAYABLE_SECTIONS: readonly ["presentation", "theme"];
|
|
26
|
+
/**
|
|
27
|
+
* Is this path a setting? Needs the document, and cannot work without it —
|
|
28
|
+
* a path-only rule ("settings live under `props`") failed the fleet twice:
|
|
29
|
+
*
|
|
30
|
+
* - the two block forms MIX inside one array (artorious's home page is 3
|
|
31
|
+
* nested and 5 flat), so requiring `props` made the flat ones uneditable;
|
|
32
|
+
* - a setting VALUE can look exactly like a block — a form field is
|
|
33
|
+
* `{id, label, type, required}` — so keying on `type` would refuse a
|
|
34
|
+
* legitimate edit.
|
|
35
|
+
*
|
|
36
|
+
* The walk resolves against the real document and asks the renderer's own
|
|
37
|
+
* `isNestedBlockRef` which form each block took. It stops the moment it enters
|
|
38
|
+
* a setting, which is what makes the form-field case need no exception.
|
|
39
|
+
*
|
|
40
|
+
* `theme` is settings throughout — it is nothing but tokens.
|
|
41
|
+
*/
|
|
42
|
+
export declare function isSettingPath(document: StoreDocument | Record<string, unknown>, path: string): OverlayRejection | null;
|
|
43
|
+
/**
|
|
44
|
+
* Merge an overlay onto a document. Never mutates the input. Rejections are
|
|
45
|
+
* reported rather than thrown: an overlay with one bad entry must still deliver
|
|
46
|
+
* the other forty, or a store stops updating and nobody knows why.
|
|
47
|
+
*/
|
|
48
|
+
export declare function applyOverlay(document: StoreDocument | Record<string, unknown>, overlay: StoreOverlay): ApplyOverlayResult;
|
|
49
|
+
/**
|
|
50
|
+
* Drop overlay entries the document can no longer accept. Orphans are harmless
|
|
51
|
+
* on their own — applyOverlay refuses them — but they accumulate, and an
|
|
52
|
+
* overlay nobody prunes hides a real mistake among a hundred dead ones.
|
|
53
|
+
*/
|
|
54
|
+
export declare function pruneOverlay(document: StoreDocument | Record<string, unknown>, overlay: StoreOverlay): {
|
|
55
|
+
overlay: StoreOverlay;
|
|
56
|
+
dropped: string[];
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=overlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../src/document/overlay.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAavD,+EAA+E;AAC/E,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAElD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,kBAAkB,GAAG,eAAe,GAAG,yBAAyB,GAAG,kBAAkB,CAAA;IAC3F,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,iFAAiF;IACjF,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,uDAAuD;IACvD,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,+CAA+C;IAC/C,QAAQ,EAAE,gBAAgB,EAAE,CAAA;IAC5B,qEAAqE;IACrE,UAAU,EAAE,qBAAqB,CAAA;CAClC;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,oCAAqC,CAAA;AAMtE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjD,IAAI,EAAE,MAAM,GACX,gBAAgB,GAAG,IAAI,CAsFzB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjD,OAAO,EAAE,YAAY,GACpB,kBAAkB,CA2DpB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjD,OAAO,EAAE,YAAY,GACpB;IAAE,OAAO,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAQ9C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { StorefrontTheme } from '
|
|
2
|
-
import type { HomeConfig } from '
|
|
1
|
+
import type { StorefrontTheme } from '../lib/theme';
|
|
2
|
+
import type { HomeConfig } from '../blocks/sections';
|
|
3
3
|
/** Real imagery for a template home — resolved at build time (e.g. via
|
|
4
4
|
* scripts/fetch-unsplash.mjs); falls back to gradient placeholders when omitted. */
|
|
5
5
|
export interface TemplateImages {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../src/document/presets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AASpD;qFACqF;AACrF,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAChC,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;CACpC;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,eAAe,CAAA;IACtB,0EAA0E;IAC1E,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,KAAK,UAAU,CAAA;IAChE,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,yFAAyF;AACzF,eAAO,MAAM,YAAY,EAAE,kBA0C1B,CAAA;AAED,gGAAgG;AAChG,eAAO,MAAM,cAAc,EAAE,kBA2D5B,CAAA;AAED,kHAAkH;AAClH,eAAO,MAAM,YAAY,EAAE,kBAkD1B,CAAA;AAED,0GAA0G;AAC1G,eAAO,MAAM,eAAe,EAAE,kBA4D7B,CAAA;AAED;;2FAE2F;AAC3F,eAAO,MAAM,YAAY,EAAE,kBA4D1B,CAAA;AAED,eAAO,MAAM,mBAAmB;;;;;;CAMtB,CAAA;AAEV,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,mBAAmB,CAAA"}
|