@vtex/faststore 0.0.1
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/CHANGELOG.md +18 -0
- package/LICENSE +21 -0
- package/README.md +95 -0
- package/dist/actions.json +334 -0
- package/dist/catalog.json +6615 -0
- package/dist/client.d.ts +17 -0
- package/dist/client.js +8 -0
- package/dist/components.d.ts +87 -0
- package/dist/components.js +87 -0
- package/dist/content-types.json +684 -0
- package/dist/core/dist/actions/mock-action.d.ts +24 -0
- package/dist/core/dist/actions/mock-action.js +28 -0
- package/dist/core/dist/actions/mock-action.js.map +1 -0
- package/dist/core/dist/actions/registry.d.ts +24 -0
- package/dist/core/dist/actions/registry.js +28 -0
- package/dist/core/dist/actions/registry.js.map +1 -0
- package/dist/core/dist/define-component.d.ts +100 -0
- package/dist/core/dist/define-component.js +8 -0
- package/dist/core/dist/define-component.js.map +1 -0
- package/dist/core/dist/define-content-type.d.ts +95 -0
- package/dist/core/dist/define-content-type.js +283 -0
- package/dist/core/dist/define-content-type.js.map +1 -0
- package/dist/core/dist/index.d.ts +7 -0
- package/dist/core/dist/index.js +5 -0
- package/dist/core/dist/schema/generated/schema.d.ts +28 -0
- package/dist/core/dist/types.d.ts +1 -0
- package/dist/docs/access-code-field.md +100 -0
- package/dist/docs/access-code-sign-in.md +174 -0
- package/dist/docs/account-entry-point.md +155 -0
- package/dist/docs/address-summary.md +50 -0
- package/dist/docs/buy-button.md +162 -0
- package/dist/docs/carousel.md +105 -0
- package/dist/docs/cart-item.md +162 -0
- package/dist/docs/cart-totalizer.md +197 -0
- package/dist/docs/cart.md +495 -0
- package/dist/docs/client-preferences.md +184 -0
- package/dist/docs/client-profile-form.md +192 -0
- package/dist/docs/client-profile.md +117 -0
- package/dist/docs/container.md +97 -0
- package/dist/docs/document-field.md +97 -0
- package/dist/docs/email-field.md +93 -0
- package/dist/docs/email-identification.md +102 -0
- package/dist/docs/footer-copyright.md +112 -0
- package/dist/docs/footer-link-group.md +162 -0
- package/dist/docs/footer-root.md +145 -0
- package/dist/docs/footer-social.md +151 -0
- package/dist/docs/free-shipping-progress.md +87 -0
- package/dist/docs/gallery.md +84 -0
- package/dist/docs/header-root.md +150 -0
- package/dist/docs/identity-edit.md +88 -0
- package/dist/docs/identity-summary.md +106 -0
- package/dist/docs/incentives.md +151 -0
- package/dist/docs/logo.md +135 -0
- package/dist/docs/meter.md +67 -0
- package/dist/docs/navigation-link-list.md +171 -0
- package/dist/docs/navigation-link.md +163 -0
- package/dist/docs/navigation-menu.md +264 -0
- package/dist/docs/payment-methods.md +139 -0
- package/dist/docs/phone-field.md +106 -0
- package/dist/docs/postal-code-field.md +126 -0
- package/dist/docs/pricing.md +499 -0
- package/dist/docs/product-gallery.md +409 -0
- package/dist/docs/product-information.md +295 -0
- package/dist/docs/product-list.md +170 -0
- package/dist/docs/product-quantity.md +88 -0
- package/dist/docs/product-shelf.md +141 -0
- package/dist/docs/promotion.md +109 -0
- package/dist/docs/region.md +225 -0
- package/dist/docs/session.md +123 -0
- package/dist/docs/shipping-address.md +390 -0
- package/dist/docs/shipping-simulator.md +147 -0
- package/dist/docs/sign-in-form.md +117 -0
- package/dist/docs/tabs.md +176 -0
- package/dist/docs/toast.md +124 -0
- package/dist/docs/variant-selector.md +450 -0
- package/dist/graphql/define-subgraph.d.ts +12 -0
- package/dist/graphql/define-subgraph.js +15 -0
- package/dist/graphql/define-subgraph.js.map +1 -0
- package/dist/graphql/gql.d.ts +10 -0
- package/dist/graphql/gql.js +16 -0
- package/dist/graphql/gql.js.map +1 -0
- package/dist/graphql/types.d.ts +88 -0
- package/dist/graphql.d.ts +4 -0
- package/dist/graphql.js +3 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +5 -0
- package/dist/internal/client.d.ts +24 -0
- package/dist/internal/client.js +23 -0
- package/dist/internal/content.d.ts +2 -0
- package/dist/internal/content.js +2 -0
- package/dist/internal/server.d.ts +7 -0
- package/dist/internal/server.js +6 -0
- package/dist/matter/access-code-sign-in/access-code-sign-in.d.ts +111 -0
- package/dist/matter/access-code-sign-in/access-code-sign-in.js +387 -0
- package/dist/matter/access-code-sign-in/access-code-sign-in.js.map +1 -0
- package/dist/matter/account-entry-point/account-entry-point.d.ts +64 -0
- package/dist/matter/account-entry-point/account-entry-point.js +151 -0
- package/dist/matter/account-entry-point/account-entry-point.js.map +1 -0
- package/dist/matter/breadcrumb/breadcrumb.d.ts +40 -0
- package/dist/matter/breadcrumb/breadcrumb.js +155 -0
- package/dist/matter/breadcrumb/breadcrumb.js.map +1 -0
- package/dist/matter/buy-button/buy-button.d.ts +95 -0
- package/dist/matter/buy-button/buy-button.js +259 -0
- package/dist/matter/buy-button/buy-button.js.map +1 -0
- package/dist/matter/cart/cart-namespace.d.ts +48 -0
- package/dist/matter/cart/cart-namespace.js +50 -0
- package/dist/matter/cart/cart-namespace.js.map +1 -0
- package/dist/matter/cart/cart.d.ts +312 -0
- package/dist/matter/cart/cart.js +1034 -0
- package/dist/matter/cart/cart.js.map +1 -0
- package/dist/matter/cart-item/cart-item.d.ts +103 -0
- package/dist/matter/cart-item/cart-item.js +672 -0
- package/dist/matter/cart-item/cart-item.js.map +1 -0
- package/dist/matter/cart-item-compositions/cart-item-compositions.d.ts +49 -0
- package/dist/matter/cart-item-compositions/cart-item-compositions.js +165 -0
- package/dist/matter/cart-item-compositions/cart-item-compositions.js.map +1 -0
- package/dist/matter/cart-item-customizations/cart-item-customizations.d.ts +28 -0
- package/dist/matter/cart-item-customizations/cart-item-customizations.js +73 -0
- package/dist/matter/cart-item-customizations/cart-item-customizations.js.map +1 -0
- package/dist/matter/cart-item-discounts/cart-item-discounts.d.ts +33 -0
- package/dist/matter/cart-item-discounts/cart-item-discounts.js +70 -0
- package/dist/matter/cart-item-discounts/cart-item-discounts.js.map +1 -0
- package/dist/matter/cart-item-seller-info/cart-item-seller-info.d.ts +24 -0
- package/dist/matter/cart-item-seller-info/cart-item-seller-info.js +54 -0
- package/dist/matter/cart-item-seller-info/cart-item-seller-info.js.map +1 -0
- package/dist/matter/cart-item-variations/cart-item-variations.d.ts +27 -0
- package/dist/matter/cart-item-variations/cart-item-variations.js +69 -0
- package/dist/matter/cart-item-variations/cart-item-variations.js.map +1 -0
- package/dist/matter/cart-totalizer/cart-totalizer.d.ts +78 -0
- package/dist/matter/cart-totalizer/cart-totalizer.js +220 -0
- package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -0
- package/dist/matter/client-preferences/client-preferences.d.ts +50 -0
- package/dist/matter/client-preferences/client-preferences.js +206 -0
- package/dist/matter/client-preferences/client-preferences.js.map +1 -0
- package/dist/matter/client-profile/client-profile.d.ts +59 -0
- package/dist/matter/client-profile/client-profile.js +185 -0
- package/dist/matter/client-profile/client-profile.js.map +1 -0
- package/dist/matter/client-profile-form/client-profile-form.d.ts +126 -0
- package/dist/matter/client-profile-form/client-profile-form.js +660 -0
- package/dist/matter/client-profile-form/client-profile-form.js.map +1 -0
- package/dist/matter/delivery-options/delivery-options-accordion.d.ts +30 -0
- package/dist/matter/delivery-options/delivery-options-accordion.js +189 -0
- package/dist/matter/delivery-options/delivery-options-accordion.js.map +1 -0
- package/dist/matter/delivery-options/delivery-options-controller.d.ts +49 -0
- package/dist/matter/delivery-options/delivery-options-controller.js +203 -0
- package/dist/matter/delivery-options/delivery-options-controller.js.map +1 -0
- package/dist/matter/delivery-options/delivery-options.d.ts +31 -0
- package/dist/matter/delivery-options/delivery-options.js +103 -0
- package/dist/matter/delivery-options/delivery-options.js.map +1 -0
- package/dist/matter/delivery-options/use-delivery-option-selection.d.ts +9 -0
- package/dist/matter/delivery-options/use-delivery-option-selection.js +76 -0
- package/dist/matter/delivery-options/use-delivery-option-selection.js.map +1 -0
- package/dist/matter/email-identification/email-identification.d.ts +37 -0
- package/dist/matter/email-identification/email-identification.js +111 -0
- package/dist/matter/email-identification/email-identification.js.map +1 -0
- package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +44 -0
- package/dist/matter/free-shipping-progress/free-shipping-progress.js +170 -0
- package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -0
- package/dist/matter/identity-edit/identity-edit.d.ts +52 -0
- package/dist/matter/identity-edit/identity-edit.js +148 -0
- package/dist/matter/identity-edit/identity-edit.js.map +1 -0
- package/dist/matter/identity-summary/identity-summary.d.ts +128 -0
- package/dist/matter/identity-summary/identity-summary.js +344 -0
- package/dist/matter/identity-summary/identity-summary.js.map +1 -0
- package/dist/matter/pricing/pricing.d.ts +162 -0
- package/dist/matter/pricing/pricing.js +793 -0
- package/dist/matter/pricing/pricing.js.map +1 -0
- package/dist/matter/product-gallery/product-gallery.d.ts +23 -0
- package/dist/matter/product-gallery/product-gallery.js +188 -0
- package/dist/matter/product-gallery/product-gallery.js.map +1 -0
- package/dist/matter/product-information/product-information.d.ts +61 -0
- package/dist/matter/product-information/product-information.js +355 -0
- package/dist/matter/product-information/product-information.js.map +1 -0
- package/dist/matter/product-list/product-list.d.ts +86 -0
- package/dist/matter/product-list/product-list.js +342 -0
- package/dist/matter/product-list/product-list.js.map +1 -0
- package/dist/matter/product-quantity/product-quantity.d.ts +50 -0
- package/dist/matter/product-quantity/product-quantity.js +111 -0
- package/dist/matter/product-quantity/product-quantity.js.map +1 -0
- package/dist/matter/product-shelf/product-shelf.d.ts +125 -0
- package/dist/matter/product-shelf/product-shelf.js +376 -0
- package/dist/matter/product-shelf/product-shelf.js.map +1 -0
- package/dist/matter/region/region.d.ts +211 -0
- package/dist/matter/region/region.js +579 -0
- package/dist/matter/region/region.js.map +1 -0
- package/dist/matter/session/session.d.ts +58 -0
- package/dist/matter/session/session.js +112 -0
- package/dist/matter/session/session.js.map +1 -0
- package/dist/matter/shipping-address/country-descriptors.js +101 -0
- package/dist/matter/shipping-address/country-descriptors.js.map +1 -0
- package/dist/matter/shipping-address/shipping-address.d.ts +284 -0
- package/dist/matter/shipping-address/shipping-address.js +1036 -0
- package/dist/matter/shipping-address/shipping-address.js.map +1 -0
- package/dist/matter/shipping-simulator/shipping-simulator.d.ts +143 -0
- package/dist/matter/shipping-simulator/shipping-simulator.js +644 -0
- package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -0
- package/dist/matter/sign-in-form/sign-in-form.d.ts +79 -0
- package/dist/matter/sign-in-form/sign-in-form.js +226 -0
- package/dist/matter/sign-in-form/sign-in-form.js.map +1 -0
- package/dist/matter/variant-selector/variant-selector.d.ts +183 -0
- package/dist/matter/variant-selector/variant-selector.js +840 -0
- package/dist/matter/variant-selector/variant-selector.js.map +1 -0
- package/dist/message-locales.json +7 -0
- package/dist/particles/access-code-field/access-code-field.d.ts +33 -0
- package/dist/particles/access-code-field/access-code-field.js +95 -0
- package/dist/particles/access-code-field/access-code-field.js.map +1 -0
- package/dist/particles/accordion/accordion.d.ts +45 -0
- package/dist/particles/accordion/accordion.js +156 -0
- package/dist/particles/accordion/accordion.js.map +1 -0
- package/dist/particles/address-summary/address-summary.d.ts +50 -0
- package/dist/particles/address-summary/address-summary.js +129 -0
- package/dist/particles/address-summary/address-summary.js.map +1 -0
- package/dist/particles/badge/badge.d.ts +10 -0
- package/dist/particles/badge/badge.js +27 -0
- package/dist/particles/badge/badge.js.map +1 -0
- package/dist/particles/button/button.d.ts +18 -0
- package/dist/particles/button/button.js +37 -0
- package/dist/particles/button/button.js.map +1 -0
- package/dist/particles/carousel/carousel.d.ts +60 -0
- package/dist/particles/carousel/carousel.js +335 -0
- package/dist/particles/carousel/carousel.js.map +1 -0
- package/dist/particles/checkbox/checkbox.d.ts +40 -0
- package/dist/particles/checkbox/checkbox.js +82 -0
- package/dist/particles/checkbox/checkbox.js.map +1 -0
- package/dist/particles/container/container.d.ts +20 -0
- package/dist/particles/container/container.js +36 -0
- package/dist/particles/container/container.js.map +1 -0
- package/dist/particles/dialog/dialog.d.ts +54 -0
- package/dist/particles/dialog/dialog.js +192 -0
- package/dist/particles/dialog/dialog.js.map +1 -0
- package/dist/particles/document-field/document-field.d.ts +61 -0
- package/dist/particles/document-field/document-field.js +146 -0
- package/dist/particles/document-field/document-field.js.map +1 -0
- package/dist/particles/drawer/drawer.d.ts +52 -0
- package/dist/particles/drawer/drawer.js +183 -0
- package/dist/particles/drawer/drawer.js.map +1 -0
- package/dist/particles/email-field/email-field.d.ts +37 -0
- package/dist/particles/email-field/email-field.js +106 -0
- package/dist/particles/email-field/email-field.js.map +1 -0
- package/dist/particles/field/field.d.ts +50 -0
- package/dist/particles/field/field.js +133 -0
- package/dist/particles/field/field.js.map +1 -0
- package/dist/particles/fieldset/fieldset.d.ts +16 -0
- package/dist/particles/fieldset/fieldset.js +52 -0
- package/dist/particles/fieldset/fieldset.js.map +1 -0
- package/dist/particles/footer-copyright/footer-copyright.d.ts +32 -0
- package/dist/particles/footer-copyright/footer-copyright.js +50 -0
- package/dist/particles/footer-copyright/footer-copyright.js.map +1 -0
- package/dist/particles/footer-link-group/footer-link-group.d.ts +66 -0
- package/dist/particles/footer-link-group/footer-link-group.js +154 -0
- package/dist/particles/footer-link-group/footer-link-group.js.map +1 -0
- package/dist/particles/footer-root/footer-root.d.ts +21 -0
- package/dist/particles/footer-root/footer-root.js +38 -0
- package/dist/particles/footer-root/footer-root.js.map +1 -0
- package/dist/particles/footer-social/footer-social.d.ts +79 -0
- package/dist/particles/footer-social/footer-social.js +176 -0
- package/dist/particles/footer-social/footer-social.js.map +1 -0
- package/dist/particles/gallery/gallery.d.ts +181 -0
- package/dist/particles/gallery/gallery.js +920 -0
- package/dist/particles/gallery/gallery.js.map +1 -0
- package/dist/particles/header-root/header-root.d.ts +21 -0
- package/dist/particles/header-root/header-root.js +38 -0
- package/dist/particles/header-root/header-root.js.map +1 -0
- package/dist/particles/icon/icon.d.ts +22 -0
- package/dist/particles/icon/icon.js +48 -0
- package/dist/particles/icon/icon.js.map +1 -0
- package/dist/particles/image/image.d.ts +13 -0
- package/dist/particles/image/image.js +59 -0
- package/dist/particles/image/image.js.map +1 -0
- package/dist/particles/incentives/incentives.d.ts +85 -0
- package/dist/particles/incentives/incentives.js +200 -0
- package/dist/particles/incentives/incentives.js.map +1 -0
- package/dist/particles/input/input.d.ts +9 -0
- package/dist/particles/input/input.js +28 -0
- package/dist/particles/input/input.js.map +1 -0
- package/dist/particles/logo/logo.d.ts +55 -0
- package/dist/particles/logo/logo.js +96 -0
- package/dist/particles/logo/logo.js.map +1 -0
- package/dist/particles/menu/menu.d.ts +103 -0
- package/dist/particles/menu/menu.js +409 -0
- package/dist/particles/menu/menu.js.map +1 -0
- package/dist/particles/menubar/menubar.d.ts +18 -0
- package/dist/particles/menubar/menubar.js +42 -0
- package/dist/particles/menubar/menubar.js.map +1 -0
- package/dist/particles/meter/meter.d.ts +36 -0
- package/dist/particles/meter/meter.js +132 -0
- package/dist/particles/meter/meter.js.map +1 -0
- package/dist/particles/navigation-link/navigation-link.d.ts +43 -0
- package/dist/particles/navigation-link/navigation-link.js +82 -0
- package/dist/particles/navigation-link/navigation-link.js.map +1 -0
- package/dist/particles/navigation-link-list/navigation-link-list.d.ts +59 -0
- package/dist/particles/navigation-link-list/navigation-link-list.js +103 -0
- package/dist/particles/navigation-link-list/navigation-link-list.js.map +1 -0
- package/dist/particles/navigation-menu/navigation-menu.d.ts +78 -0
- package/dist/particles/navigation-menu/navigation-menu.js +295 -0
- package/dist/particles/navigation-menu/navigation-menu.js.map +1 -0
- package/dist/particles/number-field/number-field.d.ts +46 -0
- package/dist/particles/number-field/number-field.js +169 -0
- package/dist/particles/number-field/number-field.js.map +1 -0
- package/dist/particles/password-field/password-field.d.ts +31 -0
- package/dist/particles/password-field/password-field.js +109 -0
- package/dist/particles/password-field/password-field.js.map +1 -0
- package/dist/particles/payment-methods/payment-methods.d.ts +72 -0
- package/dist/particles/payment-methods/payment-methods.js +151 -0
- package/dist/particles/payment-methods/payment-methods.js.map +1 -0
- package/dist/particles/phone-field/phone-field.d.ts +67 -0
- package/dist/particles/phone-field/phone-field.js +250 -0
- package/dist/particles/phone-field/phone-field.js.map +1 -0
- package/dist/particles/popover/popover.d.ts +68 -0
- package/dist/particles/popover/popover.js +284 -0
- package/dist/particles/popover/popover.js.map +1 -0
- package/dist/particles/postal-code-field/postal-code-field.d.ts +75 -0
- package/dist/particles/postal-code-field/postal-code-field.js +169 -0
- package/dist/particles/postal-code-field/postal-code-field.js.map +1 -0
- package/dist/particles/promotion/promotion.d.ts +46 -0
- package/dist/particles/promotion/promotion.js +78 -0
- package/dist/particles/promotion/promotion.js.map +1 -0
- package/dist/particles/quantity-selector/quantity-selector.d.ts +30 -0
- package/dist/particles/quantity-selector/quantity-selector.js +116 -0
- package/dist/particles/quantity-selector/quantity-selector.js.map +1 -0
- package/dist/particles/radio/radio.d.ts +36 -0
- package/dist/particles/radio/radio.js +76 -0
- package/dist/particles/radio/radio.js.map +1 -0
- package/dist/particles/scroll-area/scroll-area.d.ts +36 -0
- package/dist/particles/scroll-area/scroll-area.js +145 -0
- package/dist/particles/scroll-area/scroll-area.js.map +1 -0
- package/dist/particles/select/select.d.ts +125 -0
- package/dist/particles/select/select.js +478 -0
- package/dist/particles/select/select.js.map +1 -0
- package/dist/particles/separator/separator.d.ts +12 -0
- package/dist/particles/separator/separator.js +33 -0
- package/dist/particles/separator/separator.js.map +1 -0
- package/dist/particles/shared/input-mask.d.ts +5 -0
- package/dist/particles/shared/input-mask.js +58 -0
- package/dist/particles/shared/input-mask.js.map +1 -0
- package/dist/particles/spinner/spinner.d.ts +13 -0
- package/dist/particles/spinner/spinner.js +31 -0
- package/dist/particles/spinner/spinner.js.map +1 -0
- package/dist/particles/switch/switch.d.ts +27 -0
- package/dist/particles/switch/switch.js +59 -0
- package/dist/particles/switch/switch.js.map +1 -0
- package/dist/particles/tabs/tabs.d.ts +45 -0
- package/dist/particles/tabs/tabs.js +164 -0
- package/dist/particles/tabs/tabs.js.map +1 -0
- package/dist/particles/text/text.d.ts +24 -0
- package/dist/particles/text/text.js +40 -0
- package/dist/particles/text/text.js.map +1 -0
- package/dist/particles/toast/toast.d.ts +83 -0
- package/dist/particles/toast/toast.js +194 -0
- package/dist/particles/toast/toast.js.map +1 -0
- package/dist/particles/toggle/toggle.d.ts +26 -0
- package/dist/particles/toggle/toggle.js +61 -0
- package/dist/particles/toggle/toggle.js.map +1 -0
- package/dist/particles/tooltip/tooltip.d.ts +61 -0
- package/dist/particles/tooltip/tooltip.js +240 -0
- package/dist/particles/tooltip/tooltip.js.map +1 -0
- package/dist/schema.graphql +2953 -0
- package/dist/sdk/actions/cart-action-provider.d.ts +19 -0
- package/dist/sdk/actions/cart-action-provider.js +23 -0
- package/dist/sdk/actions/cart-action-provider.js.map +1 -0
- package/dist/sdk/actions/identity-action-provider.d.ts +15 -0
- package/dist/sdk/actions/identity-action-provider.js +19 -0
- package/dist/sdk/actions/identity-action-provider.js.map +1 -0
- package/dist/sdk/actions/index.d.ts +7 -0
- package/dist/sdk/actions/index.js +6 -0
- package/dist/sdk/actions/inject-actions.d.ts +14 -0
- package/dist/sdk/actions/inject-actions.js +36 -0
- package/dist/sdk/actions/inject-actions.js.map +1 -0
- package/dist/sdk/actions/region-action-provider.d.ts +15 -0
- package/dist/sdk/actions/region-action-provider.js +19 -0
- package/dist/sdk/actions/region-action-provider.js.map +1 -0
- package/dist/sdk/actions/session-action-provider.d.ts +15 -0
- package/dist/sdk/actions/session-action-provider.js +19 -0
- package/dist/sdk/actions/session-action-provider.js.map +1 -0
- package/dist/sdk/actions/shipping-action-provider.d.ts +15 -0
- package/dist/sdk/actions/shipping-action-provider.js +19 -0
- package/dist/sdk/actions/shipping-action-provider.js.map +1 -0
- package/dist/sdk/actions/types.d.ts +21 -0
- package/dist/sdk/cache/storefront-cache.js +35 -0
- package/dist/sdk/cache/storefront-cache.js.map +1 -0
- package/dist/sdk/cart/operations.d.ts +31 -0
- package/dist/sdk/cart/operations.js +215 -0
- package/dist/sdk/cart/operations.js.map +1 -0
- package/dist/sdk/cart/optimistic.d.ts +24 -0
- package/dist/sdk/cart/optimistic.js +164 -0
- package/dist/sdk/cart/optimistic.js.map +1 -0
- package/dist/sdk/cart/use-cart-actions.d.ts +56 -0
- package/dist/sdk/cart/use-cart-actions.js +348 -0
- package/dist/sdk/cart/use-cart-actions.js.map +1 -0
- package/dist/sdk/cart/use-cart-validate-on-open.js +50 -0
- package/dist/sdk/cart/use-cart-validate-on-open.js.map +1 -0
- package/dist/sdk/cart/write-gate.js +54 -0
- package/dist/sdk/cart/write-gate.js.map +1 -0
- package/dist/sdk/client/assert-api-url.js +20 -0
- package/dist/sdk/client/assert-api-url.js.map +1 -0
- package/dist/sdk/client/create-client.d.ts +23 -0
- package/dist/sdk/client/create-client.js +46 -0
- package/dist/sdk/client/create-client.js.map +1 -0
- package/dist/sdk/client/fetch-page-data.d.ts +39 -0
- package/dist/sdk/client/fetch-page-data.js +33 -0
- package/dist/sdk/client/fetch-page-data.js.map +1 -0
- package/dist/sdk/client/register-preload-query.d.ts +24 -0
- package/dist/sdk/client/register-preload-query.js +33 -0
- package/dist/sdk/client/register-preload-query.js.map +1 -0
- package/dist/sdk/content/create-content-runtime.d.ts +68 -0
- package/dist/sdk/content/create-content-runtime.js +503 -0
- package/dist/sdk/content/create-content-runtime.js.map +1 -0
- package/dist/sdk/context/headers.d.ts +15 -0
- package/dist/sdk/context/headers.js +21 -0
- package/dist/sdk/context/headers.js.map +1 -0
- package/dist/sdk/context/storefront-context.d.ts +11 -0
- package/dist/sdk/context/storefront-context.js +29 -0
- package/dist/sdk/context/storefront-context.js.map +1 -0
- package/dist/sdk/data/data-override-context.d.ts +12 -0
- package/dist/sdk/data/data-override-context.js +19 -0
- package/dist/sdk/data/data-override-context.js.map +1 -0
- package/dist/sdk/data/entity-subscriber.js +28 -0
- package/dist/sdk/data/entity-subscriber.js.map +1 -0
- package/dist/sdk/data/hot-data-provider.d.ts +19 -0
- package/dist/sdk/data/hot-data-provider.js +33 -0
- package/dist/sdk/data/hot-data-provider.js.map +1 -0
- package/dist/sdk/data/index.d.ts +8 -0
- package/dist/sdk/data/index.js +8 -0
- package/dist/sdk/data/list-item-ref-context.d.ts +20 -0
- package/dist/sdk/data/list-item-ref-context.js +11 -0
- package/dist/sdk/data/list-item-ref-context.js.map +1 -0
- package/dist/sdk/data/multiple-reactive-data-provider.d.ts +32 -0
- package/dist/sdk/data/multiple-reactive-data-provider.js +20 -0
- package/dist/sdk/data/multiple-reactive-data-provider.js.map +1 -0
- package/dist/sdk/data/page-reactive-data-root.d.ts +53 -0
- package/dist/sdk/data/page-reactive-data-root.js +153 -0
- package/dist/sdk/data/page-reactive-data-root.js.map +1 -0
- package/dist/sdk/data/reactive-data-provider.d.ts +25 -0
- package/dist/sdk/data/reactive-data-provider.js +24 -0
- package/dist/sdk/data/reactive-data-provider.js.map +1 -0
- package/dist/sdk/data/reactive-list-item-data-provider.d.ts +26 -0
- package/dist/sdk/data/reactive-list-item-data-provider.js +42 -0
- package/dist/sdk/data/reactive-list-item-data-provider.js.map +1 -0
- package/dist/sdk/data/use-reactive-entity.js +40 -0
- package/dist/sdk/data/use-reactive-entity.js.map +1 -0
- package/dist/sdk/format/client.d.ts +12 -0
- package/dist/sdk/format/client.js +20 -0
- package/dist/sdk/format/client.js.map +1 -0
- package/dist/sdk/format/formatters.d.ts +32 -0
- package/dist/sdk/format/formatters.js +45 -0
- package/dist/sdk/format/formatters.js.map +1 -0
- package/dist/sdk/generated/fragment-types.js +23 -0
- package/dist/sdk/generated/fragment-types.js.map +1 -0
- package/dist/sdk/generated/gql.js +51 -0
- package/dist/sdk/generated/gql.js.map +1 -0
- package/dist/sdk/generated/graphql.d.ts +622 -0
- package/dist/sdk/generated/graphql.js +11917 -0
- package/dist/sdk/generated/graphql.js.map +1 -0
- package/dist/sdk/graphql-tag.d.ts +10 -0
- package/dist/sdk/graphql-tag.js +21 -0
- package/dist/sdk/graphql-tag.js.map +1 -0
- package/dist/sdk/i18n/client.d.ts +4 -0
- package/dist/sdk/i18n/client.js +4 -0
- package/dist/sdk/i18n/locales.d.ts +8 -0
- package/dist/sdk/i18n/locales.js +57 -0
- package/dist/sdk/i18n/locales.js.map +1 -0
- package/dist/sdk/i18n/messages/en-US.js +24 -0
- package/dist/sdk/i18n/messages/en-US.js.map +1 -0
- package/dist/sdk/i18n/messages/en-US.json +19 -0
- package/dist/sdk/i18n/messages/en-US.json.d.ts +23 -0
- package/dist/sdk/i18n/messages/es-ES.js +24 -0
- package/dist/sdk/i18n/messages/es-ES.js.map +1 -0
- package/dist/sdk/i18n/messages/es-ES.json +19 -0
- package/dist/sdk/i18n/messages/pt-BR.js +24 -0
- package/dist/sdk/i18n/messages/pt-BR.js.map +1 -0
- package/dist/sdk/i18n/messages/pt-BR.json +19 -0
- package/dist/sdk/i18n/provider.d.ts +1 -0
- package/dist/sdk/i18n/provider.js +30 -0
- package/dist/sdk/i18n/provider.js.map +1 -0
- package/dist/sdk/i18n/server.d.ts +28 -0
- package/dist/sdk/i18n/server.js +59 -0
- package/dist/sdk/i18n/server.js.map +1 -0
- package/dist/sdk/identity/operations.d.ts +34 -0
- package/dist/sdk/identity/operations.js +78 -0
- package/dist/sdk/identity/operations.js.map +1 -0
- package/dist/sdk/identity/use-identity-actions.d.ts +62 -0
- package/dist/sdk/identity/use-identity-actions.js +180 -0
- package/dist/sdk/identity/use-identity-actions.js.map +1 -0
- package/dist/sdk/provider/index.d.ts +2 -0
- package/dist/sdk/provider/index.js +2 -0
- package/dist/sdk/provider/storefront-provider.d.ts +32 -0
- package/dist/sdk/provider/storefront-provider.js +111 -0
- package/dist/sdk/provider/storefront-provider.js.map +1 -0
- package/dist/sdk/region/operations.d.ts +6 -0
- package/dist/sdk/region/region-operations.d.ts +30 -0
- package/dist/sdk/region/region-operations.js +23 -0
- package/dist/sdk/region/region-operations.js.map +1 -0
- package/dist/sdk/region/use-region-actions.d.ts +23 -0
- package/dist/sdk/region/use-region-actions.js +66 -0
- package/dist/sdk/region/use-region-actions.js.map +1 -0
- package/dist/sdk/seller.js +11 -0
- package/dist/sdk/seller.js.map +1 -0
- package/dist/sdk/session/auth-operations.d.ts +47 -0
- package/dist/sdk/session/auth-operations.js +79 -0
- package/dist/sdk/session/auth-operations.js.map +1 -0
- package/dist/sdk/session/operations.d.ts +6 -0
- package/dist/sdk/session/use-session-actions.d.ts +27 -0
- package/dist/sdk/session/use-session-actions.js +126 -0
- package/dist/sdk/session/use-session-actions.js.map +1 -0
- package/dist/sdk/shipping/cart-operations.d.ts +3 -0
- package/dist/sdk/shipping/cart-operations.js +33 -0
- package/dist/sdk/shipping/cart-operations.js.map +1 -0
- package/dist/sdk/shipping/operations.d.ts +3 -0
- package/dist/sdk/shipping/operations.js +33 -0
- package/dist/sdk/shipping/operations.js.map +1 -0
- package/dist/sdk/shipping/option-select-operations.d.ts +24 -0
- package/dist/sdk/shipping/option-select-operations.js +45 -0
- package/dist/sdk/shipping/option-select-operations.js.map +1 -0
- package/dist/sdk/shipping/request-timeout.js +41 -0
- package/dist/sdk/shipping/request-timeout.js.map +1 -0
- package/dist/sdk/shipping/shipping-operations.d.ts +38 -0
- package/dist/sdk/shipping/shipping-operations.js +77 -0
- package/dist/sdk/shipping/shipping-operations.js.map +1 -0
- package/dist/sdk/shipping/use-cart-shipping-simulation.d.ts +7 -0
- package/dist/sdk/shipping/use-cart-shipping-simulation.js +72 -0
- package/dist/sdk/shipping/use-cart-shipping-simulation.js.map +1 -0
- package/dist/sdk/shipping/use-shipping-actions.d.ts +27 -0
- package/dist/sdk/shipping/use-shipping-actions.js +113 -0
- package/dist/sdk/shipping/use-shipping-actions.js.map +1 -0
- package/dist/sdk/shipping/use-shipping-simulation.d.ts +7 -0
- package/dist/sdk/shipping/use-shipping-simulation.js +72 -0
- package/dist/sdk/shipping/use-shipping-simulation.js.map +1 -0
- package/dist/sdk/state/cart.d.ts +42 -0
- package/dist/sdk/state/cart.js +64 -0
- package/dist/sdk/state/cart.js.map +1 -0
- package/dist/sdk/state/index.js +3 -0
- package/dist/sdk/state/variant-selector.d.ts +17 -0
- package/dist/sdk/state/variant-selector.js +14 -0
- package/dist/sdk/state/variant-selector.js.map +1 -0
- package/dist/utils/safe-href.js +63 -0
- package/dist/utils/safe-href.js.map +1 -0
- package/package.json +84 -0
- package/src/styles/tailwind.css +32 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ComponentDefinition } from "../../core/dist/define-component.js";
|
|
2
|
+
import "../../core/dist/index.js";
|
|
3
|
+
import { SessionEntity } from "../../sdk/session/operations.js";
|
|
4
|
+
import { ReactNode } from "react";
|
|
5
|
+
//#region src/matter/session/session.d.ts
|
|
6
|
+
export type SessionState = 'anonymous' | 'identified' | 'loggedIn';
|
|
7
|
+
/**
|
|
8
|
+
* Derive the identity tri-state from the two raw session flags. `loggedIn` takes precedence: an
|
|
9
|
+
* authenticated shopper is always `loggedIn` regardless of `isIdentified`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function deriveSessionState({ loggedIn, isIdentified }: {
|
|
12
|
+
loggedIn: boolean;
|
|
13
|
+
isIdentified: boolean;
|
|
14
|
+
}): SessionState;
|
|
15
|
+
export type SessionContextValue = Readonly<{
|
|
16
|
+
/** Derived tri-state: anonymous | identified | loggedIn. */
|
|
17
|
+
state: SessionState;
|
|
18
|
+
/** Raw authenticated-session flag from `session.loggedIn`. */
|
|
19
|
+
loggedIn: boolean;
|
|
20
|
+
/** Raw edit-permission flag from `session.canEditData`; lets Controls render editable vs. masked. */
|
|
21
|
+
canEditData: boolean;
|
|
22
|
+
/** True while the Session entity has not yet resolved. */
|
|
23
|
+
loading: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const SessionContext: React.Context<SessionContextValue>;
|
|
26
|
+
/**
|
|
27
|
+
* Read the derived session state and raw flags from the nearest `SessionRoot`. Throws when called
|
|
28
|
+
* outside a `SessionRoot` subtree (a misplaced `useSession()` is a composition bug the author should
|
|
29
|
+
* see immediately, not a silent degrade to anonymous), mirroring `useCart()` (Decision 6).
|
|
30
|
+
*
|
|
31
|
+
* While the Session entity is unresolved the context carries `loading: true` and `state:
|
|
32
|
+
* 'anonymous'` (the least-privileged default); consumers that must not flash gate on `loading`.
|
|
33
|
+
*/
|
|
34
|
+
export declare function useSession(): SessionContextValue;
|
|
35
|
+
export type SessionRootProps = {
|
|
36
|
+
/**
|
|
37
|
+
* Session entity slice forwarded by the reactive runtime (`ReactiveDataProvider`) — the value of
|
|
38
|
+
* the `session` top-level field on `SessionData on Query`, not the wrapping `{ session: … }` shape.
|
|
39
|
+
* Receives `null` while the entity has not yet resolved.
|
|
40
|
+
*/
|
|
41
|
+
$data?: SessionEntity | null;
|
|
42
|
+
children?: ReactNode;
|
|
43
|
+
};
|
|
44
|
+
export type SessionGuardProps = {
|
|
45
|
+
/** The session states under which the children render. Renders nothing for any other state. */
|
|
46
|
+
when?: SessionState[];
|
|
47
|
+
children?: ReactNode;
|
|
48
|
+
};
|
|
49
|
+
export declare const SessionRootDefinition: ComponentDefinition<SessionRootProps>;
|
|
50
|
+
export declare const SessionGuardDefinition: ComponentDefinition<SessionGuardProps>;
|
|
51
|
+
export declare function SessionRoot({ $data: $dataProp, children }: SessionRootProps): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export declare function SessionGuard({ when, children }: SessionGuardProps): import("react/jsx-runtime").JSX.Element | null;
|
|
53
|
+
export declare const Session: {
|
|
54
|
+
Root: typeof SessionRoot;
|
|
55
|
+
Guard: typeof SessionGuard;
|
|
56
|
+
};
|
|
57
|
+
//#endregion
|
|
58
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { defineComponent } from "../../core/dist/define-component.js";
|
|
3
|
+
import "../../core/dist/index.js";
|
|
4
|
+
import { graphql } from "../../sdk/generated/gql.js";
|
|
5
|
+
import { useDataOverride } from "../../sdk/data/data-override-context.js";
|
|
6
|
+
import { createContext, useContext, useMemo } from "react";
|
|
7
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
8
|
+
//#region src/matter/session/session.tsx
|
|
9
|
+
const fragment = graphql(`
|
|
10
|
+
fragment SessionData on Query {
|
|
11
|
+
session {
|
|
12
|
+
...SessionFragment
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`);
|
|
16
|
+
/**
|
|
17
|
+
* Derive the identity tri-state from the two raw session flags. `loggedIn` takes precedence: an
|
|
18
|
+
* authenticated shopper is always `loggedIn` regardless of `isIdentified`.
|
|
19
|
+
*/
|
|
20
|
+
function deriveSessionState({ loggedIn, isIdentified }) {
|
|
21
|
+
if (loggedIn) return "loggedIn";
|
|
22
|
+
if (isIdentified) return "identified";
|
|
23
|
+
return "anonymous";
|
|
24
|
+
}
|
|
25
|
+
const SESSION_DATA_UNSET = Symbol("SessionContextUnset");
|
|
26
|
+
const SessionContextInternal = createContext(SESSION_DATA_UNSET);
|
|
27
|
+
const SessionContext = SessionContextInternal;
|
|
28
|
+
/**
|
|
29
|
+
* Read the derived session state and raw flags from the nearest `SessionRoot`. Throws when called
|
|
30
|
+
* outside a `SessionRoot` subtree (a misplaced `useSession()` is a composition bug the author should
|
|
31
|
+
* see immediately, not a silent degrade to anonymous), mirroring `useCart()` (Decision 6).
|
|
32
|
+
*
|
|
33
|
+
* While the Session entity is unresolved the context carries `loading: true` and `state:
|
|
34
|
+
* 'anonymous'` (the least-privileged default); consumers that must not flash gate on `loading`.
|
|
35
|
+
*/
|
|
36
|
+
function useSession() {
|
|
37
|
+
const ctx = useContext(SessionContextInternal);
|
|
38
|
+
if (ctx === SESSION_DATA_UNSET) throw new Error("useSession() must be used inside a <SessionRoot> subtree.");
|
|
39
|
+
return ctx;
|
|
40
|
+
}
|
|
41
|
+
const SessionRootDefinition = defineComponent({
|
|
42
|
+
name: "SessionRoot",
|
|
43
|
+
importPath: "@vtex/faststore/components",
|
|
44
|
+
component: SessionRoot,
|
|
45
|
+
fragment,
|
|
46
|
+
fetchStrategy: "reactive",
|
|
47
|
+
editor: {
|
|
48
|
+
label: "Session Root",
|
|
49
|
+
category: "identity"
|
|
50
|
+
},
|
|
51
|
+
schema: {},
|
|
52
|
+
providesContext: "session",
|
|
53
|
+
guideline: "Read-only identity-state provider, normally the root of the shared layout so the header and every page it serves resolve the same session: reads the Session and broadcasts the anonymous/identified/logged-in tri-state plus the raw loggedIn and canEditData flags. Layout scope fetches client-side with the shopper cookie; page scope fetches server-side without it. Exactly one per rendered tree — a page must not add its own when the layout already hosts one. See session.md."
|
|
54
|
+
});
|
|
55
|
+
const SessionGuardDefinition = defineComponent({
|
|
56
|
+
name: "SessionGuard",
|
|
57
|
+
importPath: "@vtex/faststore/components",
|
|
58
|
+
component: SessionGuard,
|
|
59
|
+
editor: {
|
|
60
|
+
label: "Session Guard",
|
|
61
|
+
category: "identity"
|
|
62
|
+
},
|
|
63
|
+
schema: { when: {
|
|
64
|
+
type: "array",
|
|
65
|
+
items: [
|
|
66
|
+
"anonymous",
|
|
67
|
+
"identified",
|
|
68
|
+
"loggedIn"
|
|
69
|
+
],
|
|
70
|
+
label: "When State"
|
|
71
|
+
} },
|
|
72
|
+
requiresContext: "session",
|
|
73
|
+
guideline: "Declarative gate: renders its children only when the current session state is one of the values in `when` (e.g. {\"when\":[\"identified\",\"loggedIn\"]}), else renders nothing. Use it in page or layout JSON to show or hide an identity subtree by state without writing the gate into a component. Must be inside SessionRoot, which may be hosted by the page or by its layout."
|
|
74
|
+
});
|
|
75
|
+
function SessionRoot({ $data: $dataProp, children }) {
|
|
76
|
+
const session = useDataOverride($dataProp) ?? null;
|
|
77
|
+
const loading = session == null;
|
|
78
|
+
const value = useMemo(() => {
|
|
79
|
+
const loggedIn = session?.loggedIn ?? false;
|
|
80
|
+
return {
|
|
81
|
+
state: deriveSessionState({
|
|
82
|
+
loggedIn,
|
|
83
|
+
isIdentified: session?.isIdentified ?? false
|
|
84
|
+
}),
|
|
85
|
+
loggedIn,
|
|
86
|
+
canEditData: session?.canEditData ?? false,
|
|
87
|
+
loading
|
|
88
|
+
};
|
|
89
|
+
}, [
|
|
90
|
+
session?.loggedIn,
|
|
91
|
+
session?.isIdentified,
|
|
92
|
+
session?.canEditData,
|
|
93
|
+
loading
|
|
94
|
+
]);
|
|
95
|
+
return /* @__PURE__ */ jsx(SessionContextInternal, {
|
|
96
|
+
value,
|
|
97
|
+
children
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function SessionGuard({ when, children }) {
|
|
101
|
+
const { state } = useSession();
|
|
102
|
+
if (!when?.includes(state)) return null;
|
|
103
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
104
|
+
}
|
|
105
|
+
const Session = {
|
|
106
|
+
Root: SessionRoot,
|
|
107
|
+
Guard: SessionGuard
|
|
108
|
+
};
|
|
109
|
+
//#endregion
|
|
110
|
+
export { Session, SessionContext, SessionGuard, SessionGuardDefinition, SessionRoot, SessionRootDefinition, deriveSessionState, useSession };
|
|
111
|
+
|
|
112
|
+
//# sourceMappingURL=session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.js","names":[],"sources":["../../../src/matter/session/session.tsx"],"sourcesContent":["'use client';\n\nimport { defineComponent } from '@vtex/fs-core';\nimport { createContext, type ReactNode, useContext, useMemo } from 'react';\nimport { useDataOverride } from '../../sdk/data/data-override-context.js';\nimport { graphql } from '../../sdk/generated/gql.js';\nimport type { SessionEntity } from '../../sdk/session/operations.js';\n\n// ---------------------------------------------------------------------------\n// GraphQL Fragment — typed via @graphql-codegen client-preset\n// ---------------------------------------------------------------------------\n\nconst fragment = graphql(`\n fragment SessionData on Query {\n session {\n ...SessionFragment\n }\n }\n`);\n\n// ---------------------------------------------------------------------------\n// Tri-state derivation — the single home of the truth table (Decision 2).\n// ---------------------------------------------------------------------------\n\nexport type SessionState = 'anonymous' | 'identified' | 'loggedIn';\n\n/**\n * Derive the identity tri-state from the two raw session flags. `loggedIn` takes precedence: an\n * authenticated shopper is always `loggedIn` regardless of `isIdentified`.\n */\nexport function deriveSessionState({\n loggedIn,\n isIdentified,\n}: {\n loggedIn: boolean;\n isIdentified: boolean;\n}): SessionState {\n if (loggedIn) return 'loggedIn';\n if (isIdentified) return 'identified';\n return 'anonymous';\n}\n\n// ---------------------------------------------------------------------------\n// Session context (read-only derived state + raw flags)\n// ---------------------------------------------------------------------------\n\nexport type SessionContextValue = Readonly<{\n /** Derived tri-state: anonymous | identified | loggedIn. */\n state: SessionState;\n /** Raw authenticated-session flag from `session.loggedIn`. */\n loggedIn: boolean;\n /** Raw edit-permission flag from `session.canEditData`; lets Controls render editable vs. masked. */\n canEditData: boolean;\n /** True while the Session entity has not yet resolved. */\n loading: boolean;\n}>;\n\nconst SESSION_DATA_UNSET = Symbol('SessionContextUnset');\n\nconst SessionContextInternal = createContext<SessionContextValue | typeof SESSION_DATA_UNSET>(SESSION_DATA_UNSET);\n\nexport const SessionContext = SessionContextInternal as React.Context<SessionContextValue>;\n\n/**\n * Read the derived session state and raw flags from the nearest `SessionRoot`. Throws when called\n * outside a `SessionRoot` subtree (a misplaced `useSession()` is a composition bug the author should\n * see immediately, not a silent degrade to anonymous), mirroring `useCart()` (Decision 6).\n *\n * While the Session entity is unresolved the context carries `loading: true` and `state:\n * 'anonymous'` (the least-privileged default); consumers that must not flash gate on `loading`.\n */\nexport function useSession(): SessionContextValue {\n const ctx = useContext(SessionContextInternal);\n if (ctx === SESSION_DATA_UNSET) {\n throw new Error('useSession() must be used inside a <SessionRoot> subtree.');\n }\n return ctx;\n}\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport type SessionRootProps = {\n /**\n * Session entity slice forwarded by the reactive runtime (`ReactiveDataProvider`) — the value of\n * the `session` top-level field on `SessionData on Query`, not the wrapping `{ session: … }` shape.\n * Receives `null` while the entity has not yet resolved.\n */\n $data?: SessionEntity | null;\n children?: ReactNode;\n};\n\nexport type SessionGuardProps = {\n /** The session states under which the children render. Renders nothing for any other state. */\n when?: SessionState[];\n children?: ReactNode;\n};\n\n// ---------------------------------------------------------------------------\n// Definitions\n// ---------------------------------------------------------------------------\n\nexport const SessionRootDefinition = defineComponent<SessionRootProps>({\n name: 'SessionRoot',\n importPath: '@vtex/faststore/components',\n component: SessionRoot,\n fragment,\n fetchStrategy: 'reactive',\n editor: { label: 'Session Root', category: 'identity' },\n schema: {},\n providesContext: 'session',\n guideline:\n 'Read-only identity-state provider, normally the root of the shared layout so the header and every page it serves resolve the same session: reads the Session and broadcasts the anonymous/identified/logged-in tri-state plus the raw loggedIn and canEditData flags. Layout scope fetches client-side with the shopper cookie; page scope fetches server-side without it. Exactly one per rendered tree — a page must not add its own when the layout already hosts one. See session.md.',\n});\n\nexport const SessionGuardDefinition = defineComponent<SessionGuardProps>({\n name: 'SessionGuard',\n importPath: '@vtex/faststore/components',\n component: SessionGuard,\n editor: { label: 'Session Guard', category: 'identity' },\n schema: {\n when: { type: 'array', items: ['anonymous', 'identified', 'loggedIn'] as const, label: 'When State' },\n },\n requiresContext: 'session',\n guideline:\n 'Declarative gate: renders its children only when the current session state is one of the values in `when` (e.g. {\"when\":[\"identified\",\"loggedIn\"]}), else renders nothing. Use it in page or layout JSON to show or hide an identity subtree by state without writing the gate into a component. Must be inside SessionRoot, which may be hosted by the page or by its layout.',\n});\n\n// ---------------------------------------------------------------------------\n// Implementations\n// ---------------------------------------------------------------------------\n\nexport function SessionRoot({ $data: $dataProp, children }: SessionRootProps) {\n const $data = useDataOverride($dataProp);\n const session = $data ?? null;\n const loading = session == null;\n\n const value: SessionContextValue = useMemo(() => {\n const loggedIn = session?.loggedIn ?? false;\n const isIdentified = session?.isIdentified ?? false;\n return {\n state: deriveSessionState({ loggedIn, isIdentified }),\n loggedIn,\n canEditData: session?.canEditData ?? false,\n loading,\n };\n }, [session?.loggedIn, session?.isIdentified, session?.canEditData, loading]);\n\n return <SessionContextInternal value={value}>{children}</SessionContextInternal>;\n}\n\nexport function SessionGuard({ when, children }: SessionGuardProps) {\n const { state } = useSession();\n if (!when?.includes(state)) return null;\n return <>{children}</>;\n}\n\n// ---------------------------------------------------------------------------\n// Namespace export\n// ---------------------------------------------------------------------------\n\nexport const Session = {\n Root: SessionRoot,\n Guard: SessionGuard,\n};\n"],"mappings":";;;;;;;;AAYA,MAAM,WAAW,QAAQ;;;;;;CAMxB;;;;;AAYD,SAAgB,mBAAmB,EACjC,UACA,gBAIe;CACf,IAAI,UAAU,OAAO;CACrB,IAAI,cAAc,OAAO;CACzB,OAAO;AACT;AAiBA,MAAM,qBAAqB,OAAO,qBAAqB;AAEvD,MAAM,yBAAyB,cAA+D,kBAAkB;AAEhH,MAAa,iBAAiB;;;;;;;;;AAU9B,SAAgB,aAAkC;CAChD,MAAM,MAAM,WAAW,sBAAsB;CAC7C,IAAI,QAAQ,oBACV,MAAM,IAAI,MAAM,2DAA2D;CAE7E,OAAO;AACT;AA0BA,MAAa,wBAAwB,gBAAkC;CACrE,MAAM;CACN,YAAY;CACZ,WAAW;CACX;CACA,eAAe;CACf,QAAQ;EAAE,OAAO;EAAgB,UAAU;CAAW;CACtD,QAAQ,CAAC;CACT,iBAAiB;CACjB,WACE;AACJ,CAAC;AAED,MAAa,yBAAyB,gBAAmC;CACvE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAiB,UAAU;CAAW;CACvD,QAAQ,EACN,MAAM;EAAE,MAAM;EAAS,OAAO;GAAC;GAAa;GAAc;EAAU;EAAY,OAAO;CAAa,EACtG;CACA,iBAAiB;CACjB,WACE;AACJ,CAAC;AAMD,SAAgB,YAAY,EAAE,OAAO,WAAW,YAA8B;CAE5E,MAAM,UADQ,gBAAgB,SACV,KAAK;CACzB,MAAM,UAAU,WAAW;CAE3B,MAAM,QAA6B,cAAc;EAC/C,MAAM,WAAW,SAAS,YAAY;EAEtC,OAAO;GACL,OAAO,mBAAmB;IAAE;IAAU,cAFnB,SAAS,gBAAgB;GAEO,CAAC;GACpD;GACA,aAAa,SAAS,eAAe;GACrC;EACF;CACF,GAAG;EAAC,SAAS;EAAU,SAAS;EAAc,SAAS;EAAa;CAAO,CAAC;CAE5E,OAAO,oBAAC,wBAAD;EAA+B;EAAQ;CAAiC,CAAA;AACjF;AAEA,SAAgB,aAAa,EAAE,MAAM,YAA+B;CAClE,MAAM,EAAE,UAAU,WAAW;CAC7B,IAAI,CAAC,MAAM,SAAS,KAAK,GAAG,OAAO;CACnC,OAAO,oBAAA,UAAA,EAAG,SAAW,CAAA;AACvB;AAMA,MAAa,UAAU;CACrB,MAAM;CACN,OAAO;AACT"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* All available country descriptors, keyed by ISO alpha-3 code.
|
|
3
|
+
*
|
|
4
|
+
* The country selector lists only countries with a descriptor; a descriptor-less country is unreachable.
|
|
5
|
+
* Adding a country is a data-only change: add a new CountryDescriptor entry here.
|
|
6
|
+
*/
|
|
7
|
+
const countryDescriptors = {
|
|
8
|
+
BRA: {
|
|
9
|
+
iso: "BRA",
|
|
10
|
+
label: "Brasil",
|
|
11
|
+
fields: [
|
|
12
|
+
{
|
|
13
|
+
name: "recipientName",
|
|
14
|
+
label: "nome do destinatário"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "street",
|
|
18
|
+
label: "rua"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "number",
|
|
22
|
+
label: "número"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "complement",
|
|
26
|
+
label: "complemento (opcional)"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "neighborhood",
|
|
30
|
+
label: "bairro"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "city",
|
|
34
|
+
label: "cidade"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: "state",
|
|
38
|
+
label: "estado"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "postalCode",
|
|
42
|
+
label: "cep"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
USA: {
|
|
47
|
+
iso: "USA",
|
|
48
|
+
label: "Estados Unidos",
|
|
49
|
+
fields: [
|
|
50
|
+
{
|
|
51
|
+
name: "recipientName",
|
|
52
|
+
label: "nome do destinatário"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "street",
|
|
56
|
+
label: "rua"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "number",
|
|
60
|
+
label: "número"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "complement",
|
|
64
|
+
label: "complemento (opcional)"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: "city",
|
|
68
|
+
label: "cidade"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: "state",
|
|
72
|
+
label: "estado"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "postalCode",
|
|
76
|
+
label: "código postal"
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Returns an ordered list of available country ISO codes (those with a descriptor).
|
|
83
|
+
*
|
|
84
|
+
* @returns ISO alpha-3 codes of all implemented countries, in definition order.
|
|
85
|
+
*/
|
|
86
|
+
function getAvailableCountries() {
|
|
87
|
+
return Object.keys(countryDescriptors);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Retrieves the descriptor for a given country.
|
|
91
|
+
*
|
|
92
|
+
* @param iso - ISO 3166-1 alpha-3 country code (e.g., "BRA", "USA")
|
|
93
|
+
* @returns The CountryDescriptor for the country, or undefined if not implemented.
|
|
94
|
+
*/
|
|
95
|
+
function getCountryDescriptor(iso) {
|
|
96
|
+
return countryDescriptors[iso];
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
export { countryDescriptors, getAvailableCountries, getCountryDescriptor };
|
|
100
|
+
|
|
101
|
+
//# sourceMappingURL=country-descriptors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"country-descriptors.js","names":[],"sources":["../../../src/matter/shipping-address/country-descriptors.ts"],"sourcesContent":["/**\n * Country-adaptive shipping address form descriptors.\n *\n * Each descriptor declares the form shape (field set, order, and labels) for a specific country.\n * Descriptors are data only: no validation metadata, no required flags, no format patterns.\n * Country adaptation is data-driven; adding a country is a data-only change (a new descriptor entry).\n *\n * Canonical field names must be shared/consistent across descriptors for fields both countries have\n * (recipientName, postalCode, street, number, complement, city, state), so that switching countries\n * preserves shared field values in the batched draft state (Decision 1/Invariant).\n *\n * Per Decision 2, this narrows the RFC's descriptor scope to form shape only: the only client-enforced\n * content rule is the non-blank recipient name. Postal-code format, per-country required enforcement,\n * and per-field blur validation are deferred to VTEX (v1 surfaces rejections as UPSTREAM_ERROR) and\n * a future @vtex/country-forms adoption.\n */\n\n/**\n * Describes a single form field within a country descriptor.\n *\n * @property name - Canonical field name (e.g., \"recipientName\", \"street\", \"neighborhood\").\n * Shared field names across descriptors enable draft state preservation on country switch.\n * @property label - Human-readable label for the field. Named `label` (not a key) to allow future\n * swapping with i18n keys once the codebase adopts an i18n layer.\n */\nexport type FieldDescriptor = Readonly<{\n name: string;\n label: string;\n}>;\n\n/**\n * Describes the form shape for a single country.\n *\n * @property iso - ISO 3166-1 alpha-3 country code (e.g., \"BRA\", \"USA\"). Must be a valid 3-letter code\n * matching the Address.country field type (plain String!, ISO alpha-3 by convention).\n * @property label - Human-readable country name for the country selector (e.g., \"Brazil\", \"United States\").\n * Named `label` (not a key) to allow future swapping with i18n keys.\n * @property fields - Ordered field set for this country. Order defines the visual order in the form.\n * Only fields this country uses are listed; absent fields are not rendered.\n */\nexport type CountryDescriptor = Readonly<{\n iso: string;\n label: string;\n fields: readonly FieldDescriptor[];\n}>;\n\n/**\n * Brazil (BRA) address form descriptor.\n *\n * Field order:\n * 1. recipientName — recipient of the package\n * 2. street — street name\n * 3. number — street number\n * 4. complement — apartment, suite, etc. (optional per GraphQL but no form-level validation)\n * 5. neighborhood — bairro (BR-specific, not in US form)\n * 6. city — city name\n * 7. state — state/UF code (canonical name shared with US, though US calls it state abbreviation)\n * 8. postalCode — CEP format (validation deferred to VTEX in v1)\n */\nconst brDescriptor: CountryDescriptor = {\n iso: 'BRA',\n label: 'Brasil',\n fields: [\n { name: 'recipientName', label: 'nome do destinatário' },\n { name: 'street', label: 'rua' },\n { name: 'number', label: 'número' },\n { name: 'complement', label: 'complemento (opcional)' },\n { name: 'neighborhood', label: 'bairro' },\n { name: 'city', label: 'cidade' },\n { name: 'state', label: 'estado' },\n { name: 'postalCode', label: 'cep' },\n ],\n};\n\n/**\n * United States (USA) address form descriptor.\n *\n * Field order:\n * 1. recipientName — recipient of the package\n * 2. street — street name\n * 3. number — street number\n * 4. complement — apartment, suite, etc. (optional per GraphQL but no form-level validation)\n * 5. city — city name\n * 6. state — state abbreviation (canonical name shared with BR for draft preservation)\n * 7. postalCode — ZIP/ZIP+4 format (validation deferred to VTEX in v1)\n *\n * Note: neighborhood is not included in the US v1 form. If the shopper switches from BR to US,\n * the neighborhood value is retained in the draft but hidden (descriptor controls visibility only);\n * switching back to BR resurfaces it.\n */\nconst usaDescriptor: CountryDescriptor = {\n iso: 'USA',\n label: 'Estados Unidos',\n fields: [\n { name: 'recipientName', label: 'nome do destinatário' },\n { name: 'street', label: 'rua' },\n { name: 'number', label: 'número' },\n { name: 'complement', label: 'complemento (opcional)' },\n { name: 'city', label: 'cidade' },\n { name: 'state', label: 'estado' },\n { name: 'postalCode', label: 'código postal' },\n ],\n};\n\n/**\n * All available country descriptors, keyed by ISO alpha-3 code.\n *\n * The country selector lists only countries with a descriptor; a descriptor-less country is unreachable.\n * Adding a country is a data-only change: add a new CountryDescriptor entry here.\n */\nexport const countryDescriptors: Readonly<Record<string, CountryDescriptor>> = {\n BRA: brDescriptor,\n USA: usaDescriptor,\n};\n\n/**\n * Returns an ordered list of available country ISO codes (those with a descriptor).\n *\n * @returns ISO alpha-3 codes of all implemented countries, in definition order.\n */\nexport function getAvailableCountries(): readonly string[] {\n return Object.keys(countryDescriptors);\n}\n\n/**\n * Retrieves the descriptor for a given country.\n *\n * @param iso - ISO 3166-1 alpha-3 country code (e.g., \"BRA\", \"USA\")\n * @returns The CountryDescriptor for the country, or undefined if not implemented.\n */\nexport function getCountryDescriptor(iso: string): CountryDescriptor | undefined {\n return countryDescriptors[iso];\n}\n"],"mappings":";;;;;;AA8GA,MAAa,qBAAkE;CAC7E,KAAK;EAnDL,KAAK;EACL,OAAO;EACP,QAAQ;GACN;IAAE,MAAM;IAAiB,OAAO;GAAuB;GACvD;IAAE,MAAM;IAAU,OAAO;GAAM;GAC/B;IAAE,MAAM;IAAU,OAAO;GAAS;GAClC;IAAE,MAAM;IAAc,OAAO;GAAyB;GACtD;IAAE,MAAM;IAAgB,OAAO;GAAS;GACxC;IAAE,MAAM;IAAQ,OAAO;GAAS;GAChC;IAAE,MAAM;IAAS,OAAO;GAAS;GACjC;IAAE,MAAM;IAAc,OAAO;GAAM;EACrC;CAwCK;CACL,KAAK;EArBL,KAAK;EACL,OAAO;EACP,QAAQ;GACN;IAAE,MAAM;IAAiB,OAAO;GAAuB;GACvD;IAAE,MAAM;IAAU,OAAO;GAAM;GAC/B;IAAE,MAAM;IAAU,OAAO;GAAS;GAClC;IAAE,MAAM;IAAc,OAAO;GAAyB;GACtD;IAAE,MAAM;IAAQ,OAAO;GAAS;GAChC;IAAE,MAAM;IAAS,OAAO;GAAS;GACjC;IAAE,MAAM;IAAc,OAAO;GAAgB;EAC/C;CAWK;AACP;;;;;;AAOA,SAAgB,wBAA2C;CACzD,OAAO,OAAO,KAAK,kBAAkB;AACvC;;;;;;;AAQA,SAAgB,qBAAqB,KAA4C;CAC/E,OAAO,mBAAmB;AAC5B"}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { ComponentDefinition } from "../../core/dist/define-component.js";
|
|
2
|
+
import "../../core/dist/index.js";
|
|
3
|
+
import { ComponentActions } from "../../sdk/actions/types.js";
|
|
4
|
+
import { ReactNode } from "react";
|
|
5
|
+
//#region src/matter/shipping-address/shipping-address.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* The `$data` slice forwarded by the reactive runtime. `ShippingAddressData` selects two root
|
|
8
|
+
* fields (`shipping`, `clientProfile`), so the compiler composes them via
|
|
9
|
+
* `MultipleReactiveDataProvider`, which keys each entity's resolved slice by its own root field —
|
|
10
|
+
* `$data` is `{ shipping: {...}, clientProfile: {...} }`, not a flat/unwrapped shape (that unwrapped
|
|
11
|
+
* shape only applies to single-root-field fragments, e.g. CartTotalizerRoot's `$data.totalizers`).
|
|
12
|
+
*/
|
|
13
|
+
export type ShippingAddressData = {
|
|
14
|
+
shipping?: {
|
|
15
|
+
address?: {
|
|
16
|
+
id?: string | null;
|
|
17
|
+
recipientName?: string | null;
|
|
18
|
+
postalCode?: string | null;
|
|
19
|
+
country?: string | null;
|
|
20
|
+
street?: string | null;
|
|
21
|
+
number?: string | null;
|
|
22
|
+
complement?: string | null;
|
|
23
|
+
neighborhood?: string | null;
|
|
24
|
+
city?: string | null;
|
|
25
|
+
state?: string | null;
|
|
26
|
+
} | null;
|
|
27
|
+
savedAddresses?: Array<{
|
|
28
|
+
id?: string | null;
|
|
29
|
+
recipientName?: string | null;
|
|
30
|
+
postalCode?: string | null;
|
|
31
|
+
country?: string | null;
|
|
32
|
+
street?: string | null;
|
|
33
|
+
number?: string | null;
|
|
34
|
+
complement?: string | null;
|
|
35
|
+
neighborhood?: string | null;
|
|
36
|
+
city?: string | null;
|
|
37
|
+
state?: string | null;
|
|
38
|
+
}>;
|
|
39
|
+
} | null;
|
|
40
|
+
clientProfile?: {
|
|
41
|
+
firstName?: string | null;
|
|
42
|
+
lastName?: string | null;
|
|
43
|
+
} | null;
|
|
44
|
+
} | null;
|
|
45
|
+
export type ShippingAddressRootProps = {
|
|
46
|
+
/** Default country (ISO alpha-3) when no address exists. */
|
|
47
|
+
defaultCountry?: string;
|
|
48
|
+
className?: string;
|
|
49
|
+
children?: ReactNode;
|
|
50
|
+
/** `ShippingAddressData` forwarded by the reactive runtime. */
|
|
51
|
+
$data?: ShippingAddressData;
|
|
52
|
+
/** Compiler-injected action surface; carries `shipping.setAddress`. */
|
|
53
|
+
$actions?: ComponentActions;
|
|
54
|
+
};
|
|
55
|
+
export type ShippingAddressStreetControlProps = {
|
|
56
|
+
className?: string;
|
|
57
|
+
};
|
|
58
|
+
export type ShippingAddressNumberControlProps = {
|
|
59
|
+
className?: string;
|
|
60
|
+
};
|
|
61
|
+
export type ShippingAddressCityControlProps = {
|
|
62
|
+
className?: string;
|
|
63
|
+
};
|
|
64
|
+
export type ShippingAddressStateControlProps = {
|
|
65
|
+
className?: string;
|
|
66
|
+
};
|
|
67
|
+
export type ShippingAddressPostalCodeControlProps = {
|
|
68
|
+
className?: string;
|
|
69
|
+
};
|
|
70
|
+
export type ShippingAddressComplementControlProps = {
|
|
71
|
+
className?: string;
|
|
72
|
+
};
|
|
73
|
+
export type ShippingAddressNeighborhoodControlProps = {
|
|
74
|
+
className?: string;
|
|
75
|
+
};
|
|
76
|
+
export type ShippingAddressCountryControlProps = {
|
|
77
|
+
className?: string;
|
|
78
|
+
label?: string;
|
|
79
|
+
};
|
|
80
|
+
export type ShippingAddressRecipientNameControlProps = {
|
|
81
|
+
className?: string;
|
|
82
|
+
};
|
|
83
|
+
export type ShippingAddressSavedListProps = {
|
|
84
|
+
className?: string;
|
|
85
|
+
};
|
|
86
|
+
export type ShippingAddressSavedOptionProps = {
|
|
87
|
+
id: string;
|
|
88
|
+
className?: string;
|
|
89
|
+
};
|
|
90
|
+
export type ShippingAddressSubmitProps = {
|
|
91
|
+
className?: string;
|
|
92
|
+
label?: string;
|
|
93
|
+
pendingLabel?: string;
|
|
94
|
+
};
|
|
95
|
+
export type ShippingAddressErrorProps = {
|
|
96
|
+
className?: string;
|
|
97
|
+
};
|
|
98
|
+
export type ShippingAddressSavedAddressDrawerControllerProps = {
|
|
99
|
+
children?: ReactNode;
|
|
100
|
+
};
|
|
101
|
+
export type ShippingAddressSavedAddressSubmitProps = {
|
|
102
|
+
className?: string;
|
|
103
|
+
label?: string;
|
|
104
|
+
pendingLabel?: string;
|
|
105
|
+
};
|
|
106
|
+
export type ShippingAddressSelectedSummaryProps = {
|
|
107
|
+
className?: string;
|
|
108
|
+
/**
|
|
109
|
+
* The lines to render, in order — typically the `AddressSummaryRecipient` / `Street` / `Locality`
|
|
110
|
+
* leaves. Defaults to recipient, street, locality when omitted.
|
|
111
|
+
*/
|
|
112
|
+
children?: ReactNode;
|
|
113
|
+
};
|
|
114
|
+
export type ShippingAddressEditControllerProps = {
|
|
115
|
+
children?: ReactNode;
|
|
116
|
+
};
|
|
117
|
+
export type ShippingAddressSectionPanelProps = {
|
|
118
|
+
children?: ReactNode;
|
|
119
|
+
};
|
|
120
|
+
export type ShippingAddressEditButtonProps = {
|
|
121
|
+
className?: string;
|
|
122
|
+
label?: string;
|
|
123
|
+
/** Compose custom button content (e.g. an Icon plus text); falls back to `label`. */
|
|
124
|
+
children?: ReactNode;
|
|
125
|
+
};
|
|
126
|
+
export declare const ShippingAddressRootDefinition: ComponentDefinition<ShippingAddressRootProps>;
|
|
127
|
+
export declare const ShippingAddressRecipientNameControlDefinition: ComponentDefinition<ShippingAddressRecipientNameControlProps>;
|
|
128
|
+
export declare const ShippingAddressStreetControlDefinition: ComponentDefinition<ShippingAddressStreetControlProps>;
|
|
129
|
+
export declare const ShippingAddressNumberControlDefinition: ComponentDefinition<ShippingAddressNumberControlProps>;
|
|
130
|
+
export declare const ShippingAddressCityControlDefinition: ComponentDefinition<ShippingAddressCityControlProps>;
|
|
131
|
+
export declare const ShippingAddressStateControlDefinition: ComponentDefinition<ShippingAddressStateControlProps>;
|
|
132
|
+
export declare const ShippingAddressPostalCodeControlDefinition: ComponentDefinition<ShippingAddressPostalCodeControlProps>;
|
|
133
|
+
export declare const ShippingAddressComplementControlDefinition: ComponentDefinition<ShippingAddressComplementControlProps>;
|
|
134
|
+
export declare const ShippingAddressNeighborhoodControlDefinition: ComponentDefinition<ShippingAddressNeighborhoodControlProps>;
|
|
135
|
+
export declare const ShippingAddressCountryControlDefinition: ComponentDefinition<ShippingAddressCountryControlProps>;
|
|
136
|
+
export declare const ShippingAddressSavedListDefinition: ComponentDefinition<ShippingAddressSavedListProps>;
|
|
137
|
+
export declare const ShippingAddressSavedOptionDefinition: ComponentDefinition<ShippingAddressSavedOptionProps>;
|
|
138
|
+
export declare const ShippingAddressSubmitDefinition: ComponentDefinition<ShippingAddressSubmitProps>;
|
|
139
|
+
export declare const ShippingAddressErrorDefinition: ComponentDefinition<ShippingAddressErrorProps>;
|
|
140
|
+
export declare const ShippingAddressSavedAddressDrawerControllerDefinition: ComponentDefinition<ShippingAddressSavedAddressDrawerControllerProps>;
|
|
141
|
+
export declare const ShippingAddressSavedAddressSubmitDefinition: ComponentDefinition<ShippingAddressSavedAddressSubmitProps>;
|
|
142
|
+
export declare const ShippingAddressSelectedSummaryDefinition: ComponentDefinition<ShippingAddressSelectedSummaryProps>;
|
|
143
|
+
export declare const ShippingAddressEditControllerDefinition: ComponentDefinition<ShippingAddressEditControllerProps>;
|
|
144
|
+
export declare const ShippingAddressSummaryViewDefinition: ComponentDefinition<ShippingAddressSectionPanelProps>;
|
|
145
|
+
export declare const ShippingAddressEditFormDefinition: ComponentDefinition<ShippingAddressSectionPanelProps>;
|
|
146
|
+
export declare const ShippingAddressEditButtonDefinition: ComponentDefinition<ShippingAddressEditButtonProps>;
|
|
147
|
+
export declare const ShippingAddressCancelButtonDefinition: ComponentDefinition<ShippingAddressEditButtonProps>;
|
|
148
|
+
/**
|
|
149
|
+
* ShippingAddressRoot owns the batched form state, manages the current descriptor,
|
|
150
|
+
* and provides context to child Controls. It handles submit dispatch and error tracking.
|
|
151
|
+
*/
|
|
152
|
+
export declare function ShippingAddressRoot({ defaultCountry, className, children, $data: $dataProp, $actions }: ShippingAddressRootProps): import("react/jsx-runtime").JSX.Element;
|
|
153
|
+
/**
|
|
154
|
+
* RecipientNameControl — the only client-validated field (US-4, US-6).
|
|
155
|
+
* Pre-filled from clientProfile, editable, required.
|
|
156
|
+
*/
|
|
157
|
+
export declare function ShippingAddressRecipientNameControl({ className }: ShippingAddressRecipientNameControlProps): import("react/jsx-runtime").JSX.Element | null;
|
|
158
|
+
/** StreetControl */
|
|
159
|
+
export declare function ShippingAddressStreetControl({ className }: ShippingAddressStreetControlProps): import("react/jsx-runtime").JSX.Element | null;
|
|
160
|
+
/** NumberControl */
|
|
161
|
+
export declare function ShippingAddressNumberControl({ className }: ShippingAddressNumberControlProps): import("react/jsx-runtime").JSX.Element | null;
|
|
162
|
+
/** CityControl */
|
|
163
|
+
export declare function ShippingAddressCityControl({ className }: ShippingAddressCityControlProps): import("react/jsx-runtime").JSX.Element | null;
|
|
164
|
+
/** StateControl */
|
|
165
|
+
export declare function ShippingAddressStateControl({ className }: ShippingAddressStateControlProps): import("react/jsx-runtime").JSX.Element | null;
|
|
166
|
+
/** PostalCodeControl */
|
|
167
|
+
export declare function ShippingAddressPostalCodeControl({ className }: ShippingAddressPostalCodeControlProps): import("react/jsx-runtime").JSX.Element | null;
|
|
168
|
+
/** ComplementControl */
|
|
169
|
+
export declare function ShippingAddressComplementControl({ className }: ShippingAddressComplementControlProps): import("react/jsx-runtime").JSX.Element | null;
|
|
170
|
+
/** NeighborhoodControl (BR-specific in v1) */
|
|
171
|
+
export declare function ShippingAddressNeighborhoodControl({ className }: ShippingAddressNeighborhoodControlProps): import("react/jsx-runtime").JSX.Element | null;
|
|
172
|
+
/** CountryControl — lists only countries with a descriptor (US-2, first criterion) */
|
|
173
|
+
export declare function ShippingAddressCountryControl({ className, label }: ShippingAddressCountryControlProps): import("react/jsx-runtime").JSX.Element;
|
|
174
|
+
/**
|
|
175
|
+
* ShippingAddressSavedList — renders only when savedAddresses is non-empty (logged-in signal).
|
|
176
|
+
*/
|
|
177
|
+
export declare function ShippingAddressSavedList({ className }: ShippingAddressSavedListProps): import("react/jsx-runtime").JSX.Element | null;
|
|
178
|
+
/**
|
|
179
|
+
* ShippingAddressSavedOption — selectable saved address; populates draft on selection.
|
|
180
|
+
* Includes isCurrent visual variant to mark the address matching the current cart address (Decision 8).
|
|
181
|
+
*/
|
|
182
|
+
export declare function ShippingAddressSavedOption({ id, className }: ShippingAddressSavedOptionProps): import("react/jsx-runtime").JSX.Element | null;
|
|
183
|
+
/**
|
|
184
|
+
* ShippingAddressSubmit — dispatches the batched submit; reflects pending state.
|
|
185
|
+
*/
|
|
186
|
+
export declare function ShippingAddressSubmit({ className, label, pendingLabel }: ShippingAddressSubmitProps): import("react/jsx-runtime").JSX.Element;
|
|
187
|
+
/**
|
|
188
|
+
* ShippingAddressSavedAddressDrawerController — makes the wrapped DrawerRoot controlled by the
|
|
189
|
+
* shipping-address context's savedAddressDrawerOpen state, and blocks dismissal (Escape, backdrop
|
|
190
|
+
* click, close button) while drawerSubmitting is true by simply not forwarding the close request
|
|
191
|
+
* to the setter. Mirrors CartOpenOnAdd's cloneElement mechanism. Expects a single DrawerRoot child.
|
|
192
|
+
*/
|
|
193
|
+
export declare function ShippingAddressSavedAddressDrawerController({ children }: ShippingAddressSavedAddressDrawerControllerProps): ReactNode;
|
|
194
|
+
/**
|
|
195
|
+
* ShippingAddressSavedAddressSubmit — the drawer's "selecionar" submit button; independent
|
|
196
|
+
* submitting state from the main form's Submit (Decision 7); no-ops when the selected saved
|
|
197
|
+
* address is already the current one (Decision 8).
|
|
198
|
+
*/
|
|
199
|
+
export declare function ShippingAddressSavedAddressSubmit({ className, label, pendingLabel }: ShippingAddressSavedAddressSubmitProps): import("react/jsx-runtime").JSX.Element;
|
|
200
|
+
/**
|
|
201
|
+
* ShippingAddressSelectedSummary — provides the current delivery address via AddressSummaryRoot's
|
|
202
|
+
* context and renders it through AddressSummary. Composed lines go through that same wrapper rather
|
|
203
|
+
* than replacing it, because AddressSummaryRoot renders no DOM and `className` would have nowhere to
|
|
204
|
+
* land. Self-gating on currentAddress: renders null when there is none yet, rather than an empty
|
|
205
|
+
* provider with nothing meaningful to show.
|
|
206
|
+
*/
|
|
207
|
+
export declare function ShippingAddressSelectedSummary({ className, children }: ShippingAddressSelectedSummaryProps): import("react/jsx-runtime").JSX.Element | null;
|
|
208
|
+
/**
|
|
209
|
+
* ShippingAddressEditController — owns the view/edit mode. Defaults to 'view' when a current
|
|
210
|
+
* address exists, 'edit' otherwise (derived reactively from currentAddressId, so it self-corrects
|
|
211
|
+
* if the address arrives asynchronously after mount, same issue as the draft-sync effect above).
|
|
212
|
+
* Once the shopper explicitly toggles (via ShippingAddressEditButton) or a submit succeeds, the
|
|
213
|
+
* explicit mode takes over. Does not render any DOM itself; provides ShippingAddressSectionContext
|
|
214
|
+
* to ShippingAddressSummaryView/ShippingAddressEditForm/ShippingAddressEditButton descendants.
|
|
215
|
+
*/
|
|
216
|
+
export declare function ShippingAddressEditController({ children }: ShippingAddressEditControllerProps): import("react/jsx-runtime").JSX.Element;
|
|
217
|
+
/** Renders its children only while the section shows the saved-address summary. */
|
|
218
|
+
export declare function ShippingAddressSummaryView({ children }: ShippingAddressSectionPanelProps): import("react/jsx-runtime").JSX.Element | null;
|
|
219
|
+
/** Renders its children only while the section shows the address form. */
|
|
220
|
+
export declare function ShippingAddressEditForm({ children }: ShippingAddressSectionPanelProps): import("react/jsx-runtime").JSX.Element | null;
|
|
221
|
+
/**
|
|
222
|
+
* ShippingAddressEditButton — CTA that switches the mode to 'edit'. Has no knowledge of why the
|
|
223
|
+
* mode might currently be 'view' (a current address, or a just-completed submit) — it only writes
|
|
224
|
+
* the mode forward.
|
|
225
|
+
*/
|
|
226
|
+
export declare function ShippingAddressEditButton({ className, label, children }: ShippingAddressEditButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
227
|
+
/**
|
|
228
|
+
* ShippingAddressCancelButton — returns the section to its summary without writing. Without it a
|
|
229
|
+
* shopper who opens the form can only leave through a successful `setAddress`, and blanking the
|
|
230
|
+
* recipient disables Submit, which leaves the section stuck open over the summary it replaced.
|
|
231
|
+
*/
|
|
232
|
+
export declare function ShippingAddressCancelButton({ className, label, children }: ShippingAddressEditButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
233
|
+
/**
|
|
234
|
+
* ShippingAddressError — renders domain userErrors inline, or generic upstream error state.
|
|
235
|
+
*/
|
|
236
|
+
export declare function ShippingAddressError({ className }: ShippingAddressErrorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
237
|
+
export declare const ShippingAddress: {
|
|
238
|
+
Root: typeof ShippingAddressRoot;
|
|
239
|
+
RootDefinition: ComponentDefinition<ShippingAddressRootProps>;
|
|
240
|
+
RecipientNameControl: typeof ShippingAddressRecipientNameControl;
|
|
241
|
+
RecipientNameControlDefinition: ComponentDefinition<ShippingAddressRecipientNameControlProps>;
|
|
242
|
+
StreetControl: typeof ShippingAddressStreetControl;
|
|
243
|
+
StreetControlDefinition: ComponentDefinition<ShippingAddressStreetControlProps>;
|
|
244
|
+
NumberControl: typeof ShippingAddressNumberControl;
|
|
245
|
+
NumberControlDefinition: ComponentDefinition<ShippingAddressNumberControlProps>;
|
|
246
|
+
CityControl: typeof ShippingAddressCityControl;
|
|
247
|
+
CityControlDefinition: ComponentDefinition<ShippingAddressCityControlProps>;
|
|
248
|
+
StateControl: typeof ShippingAddressStateControl;
|
|
249
|
+
StateControlDefinition: ComponentDefinition<ShippingAddressStateControlProps>;
|
|
250
|
+
PostalCodeControl: typeof ShippingAddressPostalCodeControl;
|
|
251
|
+
PostalCodeControlDefinition: ComponentDefinition<ShippingAddressPostalCodeControlProps>;
|
|
252
|
+
ComplementControl: typeof ShippingAddressComplementControl;
|
|
253
|
+
ComplementControlDefinition: ComponentDefinition<ShippingAddressComplementControlProps>;
|
|
254
|
+
NeighborhoodControl: typeof ShippingAddressNeighborhoodControl;
|
|
255
|
+
NeighborhoodControlDefinition: ComponentDefinition<ShippingAddressNeighborhoodControlProps>;
|
|
256
|
+
CountryControl: typeof ShippingAddressCountryControl;
|
|
257
|
+
CountryControlDefinition: ComponentDefinition<ShippingAddressCountryControlProps>;
|
|
258
|
+
SavedList: typeof ShippingAddressSavedList;
|
|
259
|
+
SavedListDefinition: ComponentDefinition<ShippingAddressSavedListProps>;
|
|
260
|
+
SavedOption: typeof ShippingAddressSavedOption;
|
|
261
|
+
SavedOptionDefinition: ComponentDefinition<ShippingAddressSavedOptionProps>;
|
|
262
|
+
Submit: typeof ShippingAddressSubmit;
|
|
263
|
+
SubmitDefinition: ComponentDefinition<ShippingAddressSubmitProps>;
|
|
264
|
+
SavedAddressDrawerController: typeof ShippingAddressSavedAddressDrawerController;
|
|
265
|
+
SavedAddressDrawerControllerDefinition: ComponentDefinition<ShippingAddressSavedAddressDrawerControllerProps>;
|
|
266
|
+
SavedAddressSubmit: typeof ShippingAddressSavedAddressSubmit;
|
|
267
|
+
SavedAddressSubmitDefinition: ComponentDefinition<ShippingAddressSavedAddressSubmitProps>;
|
|
268
|
+
SelectedSummary: typeof ShippingAddressSelectedSummary;
|
|
269
|
+
SelectedSummaryDefinition: ComponentDefinition<ShippingAddressSelectedSummaryProps>;
|
|
270
|
+
EditController: typeof ShippingAddressEditController;
|
|
271
|
+
EditControllerDefinition: ComponentDefinition<ShippingAddressEditControllerProps>;
|
|
272
|
+
SummaryView: typeof ShippingAddressSummaryView;
|
|
273
|
+
SummaryViewDefinition: ComponentDefinition<ShippingAddressSectionPanelProps>;
|
|
274
|
+
EditForm: typeof ShippingAddressEditForm;
|
|
275
|
+
EditFormDefinition: ComponentDefinition<ShippingAddressSectionPanelProps>;
|
|
276
|
+
EditButton: typeof ShippingAddressEditButton;
|
|
277
|
+
EditButtonDefinition: ComponentDefinition<ShippingAddressEditButtonProps>;
|
|
278
|
+
CancelButton: typeof ShippingAddressCancelButton;
|
|
279
|
+
CancelButtonDefinition: ComponentDefinition<ShippingAddressEditButtonProps>;
|
|
280
|
+
Error: typeof ShippingAddressError;
|
|
281
|
+
ErrorDefinition: ComponentDefinition<ShippingAddressErrorProps>;
|
|
282
|
+
};
|
|
283
|
+
//#endregion
|
|
284
|
+
//# sourceMappingURL=shipping-address.d.ts.map
|