@vtex/faststore 0.0.7 → 0.0.10
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 +102 -0
- package/dist/actions.json +194 -1
- package/dist/catalog.json +3449 -1612
- package/dist/cli/index.d.ts +512 -63
- package/dist/cli/index.js +2098 -686
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/server-runtime.js +44 -24
- package/dist/cli/server-runtime.js.map +1 -1
- package/dist/client.d.ts +5 -1
- package/dist/client.js +5 -1
- package/dist/components.d.ts +42 -10
- package/dist/components.js +47 -15
- package/dist/content-types.json +823 -0
- package/dist/core/dist/define-component.d.ts +12 -2
- package/dist/docs/account-access-gate.md +4 -4
- package/dist/docs/account-address-book.md +519 -0
- package/dist/docs/account-entry-point.md +5 -5
- package/dist/docs/account-menu.md +7 -7
- package/dist/docs/account-saved-cards.md +301 -0
- package/dist/docs/alert-dialog.md +2 -2
- package/dist/docs/billing-address.md +17 -9
- package/dist/docs/binding-switcher.md +154 -0
- package/dist/docs/card-entry.md +38 -7
- package/dist/docs/card-summary.md +175 -0
- package/dist/docs/cardholder-document.md +16 -14
- package/dist/docs/cart-destination.md +238 -0
- package/dist/docs/cart-item.md +22 -4
- package/dist/docs/cart-totalizer.md +1 -1
- package/dist/docs/cart.md +126 -19
- package/dist/docs/client-profile-fieldset.md +7 -5
- package/dist/docs/copy-text.md +84 -0
- package/dist/docs/document-field.md +8 -8
- package/dist/docs/footer-link-group.md +2 -2
- package/dist/docs/footer-social.md +1 -1
- package/dist/docs/free-shipping-progress.md +13 -9
- package/dist/docs/header-root.md +1 -1
- package/dist/docs/incentives.md +4 -4
- package/dist/docs/logo.md +6 -6
- package/dist/docs/my-account-profile.md +4 -4
- package/dist/docs/navigation-link-list.md +2 -2
- package/dist/docs/navigation-link.md +3 -3
- package/dist/docs/order-cancel.md +52 -0
- package/dist/docs/order-delivery-address.md +63 -0
- package/dist/docs/order-delivery-group.md +83 -0
- package/dist/docs/order-details-back.md +41 -0
- package/dist/docs/order-details-header.md +48 -0
- package/dist/docs/order-list-row.md +46 -0
- package/dist/docs/order-list-search.md +101 -0
- package/dist/docs/order-list-views.md +97 -0
- package/dist/docs/order-list.md +94 -0
- package/dist/docs/order-payment.md +94 -0
- package/dist/docs/order-placed-date.md +49 -0
- package/dist/docs/order-placed-payment-summary.md +13 -15
- package/dist/docs/order-placed.md +225 -0
- package/dist/docs/order-progress.md +88 -0
- package/dist/docs/order-status-badge.md +91 -0
- package/dist/docs/order-summary.md +53 -0
- package/dist/docs/payment-method-badges.md +16 -5
- package/dist/docs/payment-methods.md +1 -1
- package/dist/docs/place-order.md +13 -9
- package/dist/docs/product-information.md +2 -2
- package/dist/docs/product-shelf.md +7 -0
- package/dist/docs/saved-cards.md +2 -2
- package/dist/docs/select.md +22 -10
- package/dist/docs/session.md +1 -1
- package/dist/docs/shipping-address.md +1 -1
- package/dist/docs/sign-in-redirect.md +7 -7
- package/dist/docs/toast.md +35 -13
- package/dist/index.d.ts +7 -2
- package/dist/index.js +2 -1
- package/dist/internal/client.d.ts +9 -1
- package/dist/internal/client.js +10 -2
- package/dist/internal/server.d.ts +8 -2
- package/dist/internal/server.js +8 -2
- package/dist/matter/account-access-gate/account-access-gate.d.ts +2 -1
- package/dist/matter/account-access-gate/account-access-gate.js +19 -16
- package/dist/matter/account-access-gate/account-access-gate.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-delete.d.ts +60 -0
- package/dist/matter/account-address-book/account-address-book-delete.js +184 -0
- package/dist/matter/account-address-book/account-address-book-delete.js.map +1 -0
- package/dist/matter/account-address-book/account-address-book-deliverability.d.ts +19 -0
- package/dist/matter/account-address-book/account-address-book-deliverability.js +50 -0
- package/dist/matter/account-address-book/account-address-book-deliverability.js.map +1 -0
- package/dist/matter/account-address-book/account-address-book-form-parts.d.ts +42 -0
- package/dist/matter/account-address-book/account-address-book-form-parts.js +146 -0
- package/dist/matter/account-address-book/account-address-book-form-parts.js.map +1 -0
- package/dist/matter/account-address-book/account-address-book-profile-notice.d.ts +25 -0
- package/dist/matter/account-address-book/account-address-book-profile-notice.js +72 -0
- package/dist/matter/account-address-book/account-address-book-profile-notice.js.map +1 -0
- package/dist/matter/account-address-book/account-address-book.d.ts +120 -0
- package/dist/matter/account-address-book/account-address-book.js +469 -0
- package/dist/matter/account-address-book/account-address-book.js.map +1 -0
- package/dist/matter/account-address-book/account-address-country-switch.js +59 -0
- package/dist/matter/account-address-book/account-address-country-switch.js.map +1 -0
- package/dist/matter/account-address-book/account-address-country.d.ts +36 -0
- package/dist/matter/account-address-book/account-address-country.js +151 -0
- package/dist/matter/account-address-book/account-address-country.js.map +1 -0
- package/dist/matter/account-address-book/account-address-first-line.js +11 -0
- package/dist/matter/account-address-book/account-address-first-line.js.map +1 -0
- package/dist/matter/account-address-book/account-address-form-context.d.ts +55 -0
- package/dist/matter/account-address-book/account-address-form-context.js +14 -0
- package/dist/matter/account-address-book/account-address-form-context.js.map +1 -0
- package/dist/matter/account-address-book/account-address-form.d.ts +85 -0
- package/dist/matter/account-address-book/account-address-form.js +946 -0
- package/dist/matter/account-address-book/account-address-form.js.map +1 -0
- package/dist/matter/account-address-book/account-address-postal-autofill.js +189 -0
- package/dist/matter/account-address-book/account-address-postal-autofill.js.map +1 -0
- package/dist/matter/account-address-book/account-address-record.d.ts +26 -0
- package/dist/matter/account-address-book/account-address-record.js +138 -0
- package/dist/matter/account-address-book/account-address-record.js.map +1 -0
- package/dist/matter/account-entry-point/account-entry-point.js +11 -11
- package/dist/matter/account-entry-point/account-entry-point.js.map +1 -1
- package/dist/matter/account-menu/account-menu.d.ts +7 -3
- package/dist/matter/account-menu/account-menu.js +69 -28
- package/dist/matter/account-menu/account-menu.js.map +1 -1
- package/dist/matter/account-saved-cards/account-saved-cards.d.ts +383 -0
- package/dist/matter/account-saved-cards/account-saved-cards.js +956 -0
- package/dist/matter/account-saved-cards/account-saved-cards.js.map +1 -0
- package/dist/matter/billing-address/billing-address.d.ts +30 -17
- package/dist/matter/billing-address/billing-address.js +128 -33
- package/dist/matter/billing-address/billing-address.js.map +1 -1
- package/dist/matter/breadcrumb/breadcrumb.js +2 -2
- package/dist/matter/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/matter/card-entry/card-capture.js +4 -3
- package/dist/matter/card-entry/card-capture.js.map +1 -1
- package/dist/matter/card-entry/card-entry.d.ts +5 -3
- package/dist/matter/card-entry/card-entry.js +77 -27
- package/dist/matter/card-entry/card-entry.js.map +1 -1
- package/dist/matter/cardholder-document/cardholder-document.d.ts +10 -9
- package/dist/matter/cardholder-document/cardholder-document.js +36 -16
- package/dist/matter/cardholder-document/cardholder-document.js.map +1 -1
- package/dist/matter/cart/cart-namespace.d.ts +5 -1
- package/dist/matter/cart/cart-namespace.js +5 -1
- package/dist/matter/cart/cart-namespace.js.map +1 -1
- package/dist/matter/cart/cart.d.ts +41 -6
- package/dist/matter/cart/cart.js +267 -54
- package/dist/matter/cart/cart.js.map +1 -1
- package/dist/matter/cart-destination/cart-destination.d.ts +222 -0
- package/dist/matter/cart-destination/cart-destination.js +613 -0
- package/dist/matter/cart-destination/cart-destination.js.map +1 -0
- package/dist/matter/cart-item/cart-item.d.ts +4 -2
- package/dist/matter/cart-item/cart-item.js +76 -17
- package/dist/matter/cart-item/cart-item.js.map +1 -1
- package/dist/matter/cart-totalizer/cart-totalizer.js +3 -2
- package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -1
- package/dist/matter/client-preferences/client-preferences-fieldset.js +1 -1
- package/dist/matter/client-profile-form/client-profile-fieldset.js +8 -5
- package/dist/matter/client-profile-form/client-profile-fieldset.js.map +1 -1
- package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +6 -3
- package/dist/matter/free-shipping-progress/free-shipping-progress.js +76 -33
- package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -1
- package/dist/matter/identity-edit/identity-edit.js +3 -3
- package/dist/matter/identity-edit/identity-edit.js.map +1 -1
- package/dist/matter/identity-summary/identity-summary.js +2 -2
- package/dist/matter/identity-summary/identity-summary.js.map +1 -1
- package/dist/matter/my-account-profile/my-account-profile.d.ts +3 -3
- package/dist/matter/my-account-profile/my-account-profile.js +4 -4
- package/dist/matter/my-account-profile/my-account-profile.js.map +1 -1
- package/dist/matter/order-cancel/order-cancel.d.ts +110 -0
- package/dist/matter/order-cancel/order-cancel.js +344 -0
- package/dist/matter/order-cancel/order-cancel.js.map +1 -0
- package/dist/matter/order-delivery-address/order-delivery-address.d.ts +73 -0
- package/dist/matter/order-delivery-address/order-delivery-address.js +172 -0
- package/dist/matter/order-delivery-address/order-delivery-address.js.map +1 -0
- package/dist/matter/order-delivery-group/order-delivery-group.d.ts +128 -0
- package/dist/matter/order-delivery-group/order-delivery-group.js +408 -0
- package/dist/matter/order-delivery-group/order-delivery-group.js.map +1 -0
- package/dist/matter/order-details-header/order-details-header.d.ts +104 -0
- package/dist/matter/order-details-header/order-details-header.js +190 -0
- package/dist/matter/order-details-header/order-details-header.js.map +1 -0
- package/dist/matter/order-list/customer-orders-filter.d.ts +12 -0
- package/dist/matter/order-list/customer-orders-filter.js +30 -0
- package/dist/matter/order-list/customer-orders-filter.js.map +1 -0
- package/dist/matter/order-list/order-list.d.ts +121 -0
- package/dist/matter/order-list/order-list.js +395 -0
- package/dist/matter/order-list/order-list.js.map +1 -0
- package/dist/matter/order-list-row/order-list-row.d.ts +44 -0
- package/dist/matter/order-list-row/order-list-row.js +127 -0
- package/dist/matter/order-list-row/order-list-row.js.map +1 -0
- package/dist/matter/order-list-search/order-list-search.d.ts +72 -0
- package/dist/matter/order-list-search/order-list-search.js +296 -0
- package/dist/matter/order-list-search/order-list-search.js.map +1 -0
- package/dist/matter/order-list-views/order-list-views.d.ts +65 -0
- package/dist/matter/order-list-views/order-list-views.js +154 -0
- package/dist/matter/order-list-views/order-list-views.js.map +1 -0
- package/dist/matter/order-payment/order-payment.d.ts +83 -0
- package/dist/matter/order-payment/order-payment.js +258 -0
- package/dist/matter/order-payment/order-payment.js.map +1 -0
- package/dist/matter/order-placed/order-placed-deliveries.d.ts +145 -0
- package/dist/matter/order-placed/order-placed-deliveries.js +380 -0
- package/dist/matter/order-placed/order-placed-deliveries.js.map +1 -0
- package/dist/matter/order-placed/order-placed.d.ts +122 -0
- package/dist/matter/order-placed/order-placed.js +452 -0
- package/dist/matter/order-placed/order-placed.js.map +1 -0
- package/dist/matter/order-placed-date/order-placed-date.d.ts +45 -0
- package/dist/matter/order-placed-date/order-placed-date.js +92 -0
- package/dist/matter/order-placed-date/order-placed-date.js.map +1 -0
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.d.ts +5 -8
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js +29 -81
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js.map +1 -1
- package/dist/matter/order-progress/order-progress.d.ts +85 -0
- package/dist/matter/order-progress/order-progress.js +203 -0
- package/dist/matter/order-progress/order-progress.js.map +1 -0
- package/dist/matter/order-summary/order-summary.d.ts +81 -0
- package/dist/matter/order-summary/order-summary.js +192 -0
- package/dist/matter/order-summary/order-summary.js.map +1 -0
- package/dist/matter/payment/cardholder-document-rule.d.ts +35 -0
- package/dist/matter/payment/cardholder-document-rule.js +35 -0
- package/dist/matter/payment/cardholder-document-rule.js.map +1 -0
- package/dist/matter/payment/payment-card-capture.js +38 -23
- package/dist/matter/payment/payment-card-capture.js.map +1 -1
- package/dist/matter/payment/payment-controller.js +11 -0
- package/dist/matter/payment/payment-controller.js.map +1 -1
- package/dist/matter/payment/payment-method-badges.js +4 -2
- package/dist/matter/payment/payment-method-badges.js.map +1 -1
- package/dist/matter/payment/payment.js +11 -0
- package/dist/matter/payment/payment.js.map +1 -1
- package/dist/matter/payment/use-payment-method-selection.d.ts +39 -0
- package/dist/matter/payment/use-payment-method-selection.js +30 -2
- package/dist/matter/payment/use-payment-method-selection.js.map +1 -1
- package/dist/matter/payment/use-payment-submit-gate.d.ts +16 -2
- package/dist/matter/payment/use-payment-submit-gate.js +42 -14
- package/dist/matter/payment/use-payment-submit-gate.js.map +1 -1
- package/dist/matter/place-order/place-order.d.ts +12 -7
- package/dist/matter/place-order/place-order.js +126 -103
- package/dist/matter/place-order/place-order.js.map +1 -1
- package/dist/matter/pricing/pricing.js +5 -5
- package/dist/matter/pricing/pricing.js.map +1 -1
- package/dist/matter/product-shelf/product-shelf.d.ts +7 -0
- package/dist/matter/product-shelf/product-shelf.js +115 -1
- package/dist/matter/product-shelf/product-shelf.js.map +1 -1
- package/dist/matter/region/region.js +1 -1
- package/dist/matter/saved-cards/saved-cards.js +26 -15
- package/dist/matter/saved-cards/saved-cards.js.map +1 -1
- package/dist/matter/session/session.js +2 -2
- package/dist/matter/session/session.js.map +1 -1
- package/dist/matter/shipping-address/country-descriptors.d.ts +1 -0
- package/dist/matter/shipping-address/country-descriptors.js +23 -1
- package/dist/matter/shipping-address/country-descriptors.js.map +1 -1
- package/dist/matter/shipping-address/shipping-address.js +62 -14
- package/dist/matter/shipping-address/shipping-address.js.map +1 -1
- package/dist/matter/shipping-simulator/shipping-simulator.d.ts +2 -2
- package/dist/matter/shipping-simulator/shipping-simulator.js +6 -2
- package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
- package/dist/matter/sign-in-redirect/sign-in-redirect.js +48 -10
- package/dist/matter/sign-in-redirect/sign-in-redirect.js.map +1 -1
- package/dist/matter/variant-selector/variant-selector.js +2 -2
- package/dist/matter/variant-selector/variant-selector.js.map +1 -1
- package/dist/particles/address-summary/address-summary.js +2 -2
- package/dist/particles/address-summary/address-summary.js.map +1 -1
- package/dist/particles/alert-dialog/alert-dialog.d.ts +5 -1
- package/dist/particles/alert-dialog/alert-dialog.js +5 -2
- package/dist/particles/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/particles/binding-switcher/binding-switcher.d.ts +38 -0
- package/dist/particles/binding-switcher/binding-switcher.js +183 -0
- package/dist/particles/binding-switcher/binding-switcher.js.map +1 -0
- package/dist/particles/card-summary/card-network.d.ts +17 -0
- package/dist/particles/card-summary/card-network.js +25 -0
- package/dist/particles/card-summary/card-network.js.map +1 -0
- package/dist/particles/card-summary/card-summary.d.ts +83 -0
- package/dist/particles/card-summary/card-summary.js +188 -0
- package/dist/particles/card-summary/card-summary.js.map +1 -0
- package/dist/particles/copy-text/copy-text.d.ts +28 -0
- package/dist/particles/copy-text/copy-text.js +140 -0
- package/dist/particles/copy-text/copy-text.js.map +1 -0
- package/dist/particles/document-field/document-field.d.ts +34 -5
- package/dist/particles/document-field/document-field.js +115 -19
- package/dist/particles/document-field/document-field.js.map +1 -1
- package/dist/particles/field/field.js +1 -1
- package/dist/particles/field/field.js.map +1 -1
- package/dist/particles/footer-link-group/footer-link-group.d.ts +6 -2
- package/dist/particles/footer-link-group/footer-link-group.js +18 -7
- package/dist/particles/footer-link-group/footer-link-group.js.map +1 -1
- package/dist/particles/footer-social/footer-social.d.ts +1 -1
- package/dist/particles/footer-social/footer-social.js +1 -1
- package/dist/particles/footer-social/footer-social.js.map +1 -1
- package/dist/particles/incentives/incentives.d.ts +7 -3
- package/dist/particles/incentives/incentives.js +8 -3
- package/dist/particles/incentives/incentives.js.map +1 -1
- package/dist/particles/logo/logo.d.ts +3 -2
- package/dist/particles/logo/logo.js +20 -8
- package/dist/particles/logo/logo.js.map +1 -1
- package/dist/particles/navigation-link/navigation-link.d.ts +2 -3
- package/dist/particles/navigation-link/navigation-link.js +4 -4
- package/dist/particles/navigation-link/navigation-link.js.map +1 -1
- package/dist/particles/navigation-link-list/navigation-link-list.d.ts +6 -2
- package/dist/particles/navigation-link-list/navigation-link-list.js +18 -7
- package/dist/particles/navigation-link-list/navigation-link-list.js.map +1 -1
- package/dist/particles/order-details-back/order-details-back.d.ts +28 -0
- package/dist/particles/order-details-back/order-details-back.js +52 -0
- package/dist/particles/order-details-back/order-details-back.js.map +1 -0
- package/dist/particles/order-status-badge/order-status-badge.d.ts +19 -0
- package/dist/particles/order-status-badge/order-status-badge.js +50 -0
- package/dist/particles/order-status-badge/order-status-badge.js.map +1 -0
- package/dist/particles/payment-methods/payment-methods.d.ts +1 -1
- package/dist/particles/payment-methods/payment-methods.js +1 -1
- package/dist/particles/payment-methods/payment-methods.js.map +1 -1
- package/dist/particles/phone-field/phone-field.js +2 -2
- package/dist/particles/phone-field/phone-field.js.map +1 -1
- package/dist/particles/select/select.js +6 -6
- package/dist/particles/select/select.js.map +1 -1
- package/dist/particles/toast/toast.d.ts +21 -7
- package/dist/particles/toast/toast.js +76 -8
- package/dist/particles/toast/toast.js.map +1 -1
- package/dist/schema.graphql +1376 -126
- package/dist/sdk/actions/address-action-provider.d.ts +16 -0
- package/dist/sdk/actions/address-action-provider.js +20 -0
- package/dist/sdk/actions/address-action-provider.js.map +1 -0
- package/dist/sdk/actions/analytics-action-provider.js +1 -1
- package/dist/sdk/actions/index.d.ts +5 -1
- package/dist/sdk/actions/index.js +5 -1
- package/dist/sdk/actions/locale-action-provider.d.ts +16 -0
- package/dist/sdk/actions/locale-action-provider.js +20 -0
- package/dist/sdk/actions/locale-action-provider.js.map +1 -0
- package/dist/sdk/actions/order-action-provider.d.ts +12 -0
- package/dist/sdk/actions/order-action-provider.js +16 -0
- package/dist/sdk/actions/order-action-provider.js.map +1 -0
- package/dist/sdk/actions/saved-card-action-provider.d.ts +12 -0
- package/dist/sdk/actions/saved-card-action-provider.js +16 -0
- package/dist/sdk/actions/saved-card-action-provider.js.map +1 -0
- package/dist/sdk/actions/types.d.ts +10 -2
- package/dist/sdk/address/address-fields.js +38 -0
- package/dist/sdk/address/address-fields.js.map +1 -0
- package/dist/sdk/address/checkout-readiness.js +17 -0
- package/dist/sdk/address/checkout-readiness.js.map +1 -0
- package/dist/sdk/address/constants.js +60 -0
- package/dist/sdk/address/constants.js.map +1 -0
- package/dist/sdk/address/country-display.js +19 -0
- package/dist/sdk/address/country-display.js.map +1 -0
- package/dist/sdk/address/country-rules.js +30 -0
- package/dist/sdk/address/country-rules.js.map +1 -0
- package/dist/sdk/address/format-address.js +18 -0
- package/dist/sdk/address/format-address.js.map +1 -0
- package/dist/sdk/address/iso-countries.js +262 -0
- package/dist/sdk/address/iso-countries.js.map +1 -0
- package/dist/sdk/address/layouts.js +56 -0
- package/dist/sdk/address/layouts.js.map +1 -0
- package/dist/sdk/address/messages.js +97 -0
- package/dist/sdk/address/messages.js.map +1 -0
- package/dist/sdk/address/operations.d.ts +54 -0
- package/dist/sdk/address/operations.js +83 -0
- package/dist/sdk/address/operations.js.map +1 -0
- package/dist/sdk/address/postal-code-lookup-operations.js +23 -0
- package/dist/sdk/address/postal-code-lookup-operations.js.map +1 -0
- package/dist/sdk/address/postal-code.js +11 -0
- package/dist/sdk/address/postal-code.js.map +1 -0
- package/dist/sdk/address/schema.js +14 -0
- package/dist/sdk/address/schema.js.map +1 -0
- package/dist/sdk/address/server-fields.js +25 -0
- package/dist/sdk/address/server-fields.js.map +1 -0
- package/dist/sdk/address/switch-country.js +57 -0
- package/dist/sdk/address/switch-country.js.map +1 -0
- package/dist/sdk/address/types.d.ts +26 -0
- package/dist/sdk/address/use-address-actions.d.ts +29 -0
- package/dist/sdk/address/use-address-actions.js +247 -0
- package/dist/sdk/address/use-address-actions.js.map +1 -0
- package/dist/sdk/address/use-address-by-postal-code.js +57 -0
- package/dist/sdk/address/use-address-by-postal-code.js.map +1 -0
- package/dist/sdk/address/validate-address.js +62 -0
- package/dist/sdk/address/validate-address.js.map +1 -0
- package/dist/sdk/cache/storefront-cache.js +30 -4
- package/dist/sdk/cache/storefront-cache.js.map +1 -1
- package/dist/sdk/cart/operations.d.ts +2 -1
- package/dist/sdk/cart/operations.js +55 -1
- package/dist/sdk/cart/operations.js.map +1 -1
- package/dist/sdk/cart/optimistic.d.ts +30 -7
- package/dist/sdk/cart/optimistic.js +78 -41
- package/dist/sdk/cart/optimistic.js.map +1 -1
- package/dist/sdk/cart/use-cart-actions.d.ts +7 -0
- package/dist/sdk/cart/use-cart-actions.js +61 -15
- package/dist/sdk/cart/use-cart-actions.js.map +1 -1
- package/dist/sdk/cart/use-cart-sync-sales-channel.js +70 -0
- package/dist/sdk/cart/use-cart-sync-sales-channel.js.map +1 -0
- package/dist/sdk/client/fetch-page-data.d.ts +11 -0
- package/dist/sdk/client/fetch-page-data.js +12 -1
- package/dist/sdk/client/fetch-page-data.js.map +1 -1
- package/dist/sdk/content/create-content-runtime.js +1 -8
- package/dist/sdk/content/create-content-runtime.js.map +1 -1
- package/dist/sdk/data/failed-fields.js +23 -0
- package/dist/sdk/data/failed-fields.js.map +1 -0
- package/dist/sdk/data/index.js +2 -2
- package/dist/sdk/data/page-reactive-data-root.d.ts +45 -7
- package/dist/sdk/data/page-reactive-data-root.js +88 -12
- package/dist/sdk/data/page-reactive-data-root.js.map +1 -1
- package/dist/sdk/data/reactive-list-item-data-provider.js +2 -2
- package/dist/sdk/generated/fragment-types.js +2 -0
- package/dist/sdk/generated/fragment-types.js.map +1 -1
- package/dist/sdk/generated/gql.js +17 -11
- package/dist/sdk/generated/gql.js.map +1 -1
- package/dist/sdk/generated/graphql.d.ts +185 -46
- package/dist/sdk/generated/graphql.js +2587 -155
- package/dist/sdk/generated/graphql.js.map +1 -1
- package/dist/sdk/i18n/messages/en-US.js +157 -1
- package/dist/sdk/i18n/messages/en-US.json +157 -1
- package/dist/sdk/i18n/messages/en-US.json.d.ts +156 -0
- package/dist/sdk/i18n/messages/es-ES.js +157 -1
- package/dist/sdk/i18n/messages/es-ES.json +157 -1
- package/dist/sdk/i18n/messages/pt-BR.js +157 -1
- package/dist/sdk/i18n/messages/pt-BR.json +157 -1
- package/dist/sdk/i18n/provider.js +1 -1
- package/dist/sdk/i18n/provider.js.map +1 -1
- package/dist/sdk/locale/binding-switch-provider.d.ts +13 -0
- package/dist/sdk/locale/binding-switch-provider.js +20 -0
- package/dist/sdk/locale/binding-switch-provider.js.map +1 -0
- package/dist/sdk/locale/use-locale-actions.d.ts +16 -0
- package/dist/sdk/locale/use-locale-actions.js +70 -0
- package/dist/sdk/locale/use-locale-actions.js.map +1 -0
- package/dist/sdk/navigation/binding-switch.d.ts +39 -0
- package/dist/sdk/navigation/binding-switch.js +129 -0
- package/dist/sdk/navigation/binding-switch.js.map +1 -0
- package/dist/sdk/navigation/current-page.js +30 -0
- package/dist/sdk/navigation/current-page.js.map +1 -0
- package/dist/sdk/navigation/decode-route-params.d.ts +11 -0
- package/dist/sdk/navigation/decode-route-params.js +32 -0
- package/dist/sdk/navigation/decode-route-params.js.map +1 -0
- package/dist/sdk/navigation/not-found-log.d.ts +28 -0
- package/dist/sdk/navigation/not-found-log.js +133 -0
- package/dist/sdk/navigation/not-found-log.js.map +1 -0
- package/dist/sdk/navigation/path.js +25 -0
- package/dist/sdk/navigation/path.js.map +1 -0
- package/dist/sdk/navigation/redirect.d.ts +11 -0
- package/dist/sdk/navigation/redirect.js +22 -0
- package/dist/sdk/navigation/redirect.js.map +1 -0
- package/dist/sdk/navigation/report.js +70 -0
- package/dist/sdk/navigation/report.js.map +1 -0
- package/dist/sdk/navigation/resolve-storefront-href.d.ts +12 -0
- package/dist/sdk/navigation/resolve-storefront-href.js +214 -0
- package/dist/sdk/navigation/resolve-storefront-href.js.map +1 -0
- package/dist/sdk/navigation/route-identity-provider.d.ts +11 -0
- package/dist/sdk/navigation/route-identity-provider.js +20 -0
- package/dist/sdk/navigation/route-identity-provider.js.map +1 -0
- package/dist/sdk/navigation/route-map-provider.d.ts +19 -0
- package/dist/sdk/navigation/route-map-provider.js +29 -0
- package/dist/sdk/navigation/route-map-provider.js.map +1 -0
- package/dist/sdk/navigation/storefront-link.d.ts +16 -0
- package/dist/sdk/navigation/storefront-link.js +66 -0
- package/dist/sdk/navigation/storefront-link.js.map +1 -0
- package/dist/sdk/navigation/types.d.ts +45 -0
- package/dist/sdk/navigation/use-storefront-navigation.d.ts +26 -0
- package/dist/sdk/navigation/use-storefront-navigation.js +73 -0
- package/dist/sdk/navigation/use-storefront-navigation.js.map +1 -0
- package/dist/sdk/navigation/use-storefront-route.d.ts +26 -0
- package/dist/sdk/navigation/use-storefront-route.js +87 -0
- package/dist/sdk/navigation/use-storefront-route.js.map +1 -0
- package/dist/sdk/navigation/use-storefront-search-params.d.ts +11 -0
- package/dist/sdk/navigation/use-storefront-search-params.js +16 -0
- package/dist/sdk/navigation/use-storefront-search-params.js.map +1 -0
- package/dist/sdk/orders/completion-badge.d.ts +8 -0
- package/dist/sdk/orders/completion-badge.js +47 -0
- package/dist/sdk/orders/completion-badge.js.map +1 -0
- package/dist/sdk/orders/order-operations.d.ts +19 -0
- package/dist/sdk/orders/order-operations.js +21 -0
- package/dist/sdk/orders/order-operations.js.map +1 -0
- package/dist/sdk/orders/use-order-actions.d.ts +23 -0
- package/dist/sdk/orders/use-order-actions.js +62 -0
- package/dist/sdk/orders/use-order-actions.js.map +1 -0
- package/dist/sdk/payment/gateway-origin.js +26 -13
- package/dist/sdk/payment/gateway-origin.js.map +1 -1
- package/dist/sdk/payment/gateway.d.ts +14 -2
- package/dist/sdk/payment/gateway.js +32 -14
- package/dist/sdk/payment/gateway.js.map +1 -1
- package/dist/sdk/payment/operations.js +11 -0
- package/dist/sdk/payment/operations.js.map +1 -1
- package/dist/sdk/payment/submission-registry.d.ts +2 -1
- package/dist/sdk/payment/submission-registry.js +12 -8
- package/dist/sdk/payment/submission-registry.js.map +1 -1
- package/dist/sdk/payment/use-payment-actions.d.ts +5 -3
- package/dist/sdk/payment/use-payment-actions.js +5 -2
- package/dist/sdk/payment/use-payment-actions.js.map +1 -1
- package/dist/sdk/payment/use-place-order.d.ts +6 -3
- package/dist/sdk/payment/use-place-order.js +333 -143
- package/dist/sdk/payment/use-place-order.js.map +1 -1
- package/dist/sdk/saved-cards/operations.d.ts +16 -0
- package/dist/sdk/saved-cards/operations.js +41 -0
- package/dist/sdk/saved-cards/operations.js.map +1 -0
- package/dist/sdk/saved-cards/use-saved-card-actions.d.ts +26 -0
- package/dist/sdk/saved-cards/use-saved-card-actions.js +86 -0
- package/dist/sdk/saved-cards/use-saved-card-actions.js.map +1 -0
- package/dist/sdk/seo/page-alternates.d.ts +57 -0
- package/dist/sdk/seo/page-alternates.js +127 -0
- package/dist/sdk/seo/page-alternates.js.map +1 -0
- package/dist/sdk/shipping/shipping-operations.d.ts +1 -1
- package/dist/sdk/shipping/shipping-operations.js +13 -0
- package/dist/sdk/shipping/shipping-operations.js.map +1 -1
- package/dist/sdk/state/cart.d.ts +9 -2
- package/dist/sdk/state/cart.js +9 -2
- package/dist/sdk/state/cart.js.map +1 -1
- package/dist/utils/own-value.js +19 -0
- package/dist/utils/own-value.js.map +1 -0
- package/dist/utils/safe-href.d.ts +4 -4
- package/dist/utils/safe-href.js +31 -22
- package/dist/utils/safe-href.js.map +1 -1
- package/package.json +5 -1
- package/skills/storefront-asset/SKILL.md +111 -0
- package/skills/storefront-asset/references/api-side.md +153 -0
- package/skills/storefront-asset/references/findings.md +40 -0
- package/skills/storefront-asset/references/ui-side.md +94 -0
- package/src/styles/tailwind.css +28 -2
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { defineComponent } from "../../core/dist/define-component.js";
|
|
3
|
+
import "../../core/dist/index.js";
|
|
4
|
+
import { useIntl } from "../../sdk/i18n/client.js";
|
|
5
|
+
import { useDataOverride } from "../../sdk/data/data-override-context.js";
|
|
6
|
+
import { resolveAuthoredCopy } from "../../utils/resolve-authored-copy.js";
|
|
7
|
+
import { useSession } from "../session/session.js";
|
|
8
|
+
import { NavigationLink } from "../../particles/navigation-link/navigation-link.js";
|
|
9
|
+
import { AccountAddressBookSkeleton } from "./account-address-book.js";
|
|
10
|
+
import { checkoutReadiness } from "../../sdk/address/checkout-readiness.js";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
const AccountAddressBookProfileNoticeDefinition = defineComponent({
|
|
13
|
+
name: "AccountAddressBookProfileNotice",
|
|
14
|
+
importPath: "@vtex/faststore/components",
|
|
15
|
+
component: AccountAddressBookProfileNotice,
|
|
16
|
+
fragment: `
|
|
17
|
+
fragment AccountAddressBookProfileNoticeData on Query {
|
|
18
|
+
customerProfile {
|
|
19
|
+
__typename
|
|
20
|
+
id
|
|
21
|
+
homePhone
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`,
|
|
25
|
+
fetchStrategy: "reactive",
|
|
26
|
+
requiresContext: "session",
|
|
27
|
+
skeleton: AccountAddressBookSkeleton,
|
|
28
|
+
editor: {
|
|
29
|
+
label: "Account Address Book Profile Notice",
|
|
30
|
+
category: "identity"
|
|
31
|
+
},
|
|
32
|
+
schema: {
|
|
33
|
+
href: {
|
|
34
|
+
type: "link",
|
|
35
|
+
default: { standard: "profile" },
|
|
36
|
+
label: "Profile page"
|
|
37
|
+
},
|
|
38
|
+
message: {
|
|
39
|
+
type: "string",
|
|
40
|
+
label: "Notice message"
|
|
41
|
+
},
|
|
42
|
+
linkLabel: {
|
|
43
|
+
type: "string",
|
|
44
|
+
label: "Link label"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
guideline: "Tells a signed-in shopper that their saved addresses will not be offered at checkout until their profile has a phone number, with a link to the profile page (href defaults to the store's profile page). Renders nothing when the profile is complete, still loading, or failed to load. Independent of the address book root: place it anywhere under a SessionRoot, typically above AccountAddressBookRoot."
|
|
48
|
+
});
|
|
49
|
+
const PROFILE_PAGE = { standard: "profile" };
|
|
50
|
+
function AccountAddressBookProfileNotice({ $data: $dataProp, href, message, linkLabel, className, ...props }) {
|
|
51
|
+
const profile = useDataOverride($dataProp) ?? null;
|
|
52
|
+
const { state } = useSession();
|
|
53
|
+
const intl = useIntl();
|
|
54
|
+
if (state !== "loggedIn" || profile === null || checkoutReadiness(profile).ready) return null;
|
|
55
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
56
|
+
...props,
|
|
57
|
+
className,
|
|
58
|
+
"data-fs-account-address-book-profile-notice": "",
|
|
59
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
60
|
+
"data-fs-account-address-book-profile-notice-message": "",
|
|
61
|
+
children: resolveAuthoredCopy(message, intl.formatMessage({ id: "fs/address-book.profile-notice" }))
|
|
62
|
+
}), /* @__PURE__ */ jsx(NavigationLink, {
|
|
63
|
+
href: typeof href === "string" && href.trim().length === 0 ? PROFILE_PAGE : href ?? PROFILE_PAGE,
|
|
64
|
+
"data-fs-account-address-book-profile-notice-link": "",
|
|
65
|
+
children: resolveAuthoredCopy(linkLabel, intl.formatMessage({ id: "fs/address-book.profile-notice.link" }))
|
|
66
|
+
})]
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
export { AccountAddressBookProfileNotice, AccountAddressBookProfileNoticeDefinition };
|
|
71
|
+
|
|
72
|
+
//# sourceMappingURL=account-address-book-profile-notice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-address-book-profile-notice.js","names":[],"sources":["../../../src/matter/account-address-book/account-address-book-profile-notice.tsx"],"sourcesContent":["'use client';\n\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef } from 'react';\nimport { NavigationLink } from '../../particles/navigation-link/navigation-link.js';\nimport { checkoutReadiness } from '../../sdk/address/checkout-readiness.js';\nimport { useDataOverride } from '../../sdk/data/data-override-context.js';\nimport { useIntl } from '../../sdk/i18n/client.js';\nimport type { PageRef } from '../../sdk/navigation/types.js';\nimport { resolveAuthoredCopy } from '../../utils/resolve-authored-copy.js';\nimport { useSession } from '../session/session.js';\nimport { AccountAddressBookSkeleton } from './account-address-book.js';\n\n/**\n * Tells the shopper why their saved addresses will not reach the checkout (RFC REQ-01, \"Checkout\n * readiness\"). The checkout imports saved addresses into a cart only when the profile meets its\n * minimums, and otherwise drops them without an error, so a shopper with an incomplete profile sees\n * addresses here that they never see there.\n *\n * Its own matter with its own `customerProfile` fragment (ADR-0011): it needs nothing from the address\n * book's root, so a store places it anywhere under a `SessionRoot`. It renders nothing when the\n * profile is complete, when the profile has not resolved, or when its read failed. The minimums are\n * `checkoutReadiness`'s, so this notice and the checkout agree on them.\n */\n\nconst fragment = /* GraphQL */ `\n fragment AccountAddressBookProfileNoticeData on Query {\n customerProfile {\n __typename\n id\n homePhone\n }\n }\n`;\n\n/** The profile fields the notice reads. */\nexport type AccountAddressBookProfileNoticeSlice = Readonly<{\n __typename?: 'CustomerProfile';\n id: string;\n homePhone?: string | null;\n}>;\n\nexport type AccountAddressBookProfileNoticeProps = ComponentPropsWithRef<'div'> & {\n /** Unwrapped `customerProfile` from the reactive runtime (arity-1 fragment); `null` until resolved. */\n $data?: AccountAddressBookProfileNoticeSlice | null;\n /** Where the link goes. A blank value falls back to the default. */\n href?: PageRef | string;\n /** The notice text. A blank value falls back to the catalog copy. */\n message?: string;\n /** The link's label. A blank value falls back to the catalog copy. */\n linkLabel?: string;\n};\n\nexport const AccountAddressBookProfileNoticeDefinition = defineComponent<AccountAddressBookProfileNoticeProps>({\n name: 'AccountAddressBookProfileNotice',\n importPath: '@vtex/faststore/components',\n component: AccountAddressBookProfileNotice,\n fragment,\n fetchStrategy: 'reactive',\n requiresContext: 'session',\n skeleton: AccountAddressBookSkeleton,\n editor: { label: 'Account Address Book Profile Notice', category: 'identity' },\n schema: {\n // An inline literal, never an identifier: the native catalog builder extracts `schema` statically\n // and silently drops an identifier-valued default.\n href: { type: 'link', default: { standard: 'profile' }, label: 'Profile page' },\n message: { type: 'string', label: 'Notice message' },\n linkLabel: { type: 'string', label: 'Link label' },\n },\n guideline:\n \"Tells a signed-in shopper that their saved addresses will not be offered at checkout until their profile has a phone number, with a link to the profile page (href defaults to the store's profile page). Renders nothing when the profile is complete, still loading, or failed to load. Independent of the address book root: place it anywhere under a SessionRoot, typically above AccountAddressBookRoot.\",\n});\n\nconst PROFILE_PAGE: PageRef = { standard: 'profile' };\n\nexport function AccountAddressBookProfileNotice({\n $data: $dataProp,\n href,\n message,\n linkLabel,\n className,\n ...props\n}: AccountAddressBookProfileNoticeProps) {\n const profile = useDataOverride<AccountAddressBookProfileNoticeSlice | null | undefined>($dataProp) ?? null;\n const { state } = useSession();\n const intl = useIntl();\n\n if (state !== 'loggedIn' || profile === null || checkoutReadiness(profile).ready) return null;\n\n return (\n <div {...props} className={className} data-fs-account-address-book-profile-notice=\"\">\n <p data-fs-account-address-book-profile-notice-message=\"\">\n {resolveAuthoredCopy(message, intl.formatMessage({ id: 'fs/address-book.profile-notice' }))}\n </p>\n <NavigationLink\n href={typeof href === 'string' && href.trim().length === 0 ? PROFILE_PAGE : (href ?? PROFILE_PAGE)}\n data-fs-account-address-book-profile-notice-link=\"\"\n >\n {resolveAuthoredCopy(linkLabel, intl.formatMessage({ id: 'fs/address-book.profile-notice.link' }))}\n </NavigationLink>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAqDA,MAAa,4CAA4C,gBAAsD;CAC7G,MAAM;CACN,YAAY;CACZ,WAAW;CACX;;;;;;;;;CACA,eAAe;CACf,iBAAiB;CACjB,UAAU;CACV,QAAQ;EAAE,OAAO;EAAuC,UAAU;CAAW;CAC7E,QAAQ;EAGN,MAAM;GAAE,MAAM;GAAQ,SAAS,EAAE,UAAU,UAAU;GAAG,OAAO;EAAe;EAC9E,SAAS;GAAE,MAAM;GAAU,OAAO;EAAiB;EACnD,WAAW;GAAE,MAAM;GAAU,OAAO;EAAa;CACnD;CACA,WACE;AACJ,CAAC;AAED,MAAM,eAAwB,EAAE,UAAU,UAAU;AAEpD,SAAgB,gCAAgC,EAC9C,OAAO,WACP,MACA,SACA,WACA,WACA,GAAG,SACoC;CACvC,MAAM,UAAU,gBAAyE,SAAS,KAAK;CACvG,MAAM,EAAE,UAAU,WAAW;CAC7B,MAAM,OAAO,QAAQ;CAErB,IAAI,UAAU,cAAc,YAAY,QAAQ,kBAAkB,OAAO,CAAC,CAAC,OAAO,OAAO;CAEzF,OACE,qBAAC,OAAD;EAAK,GAAI;EAAkB;EAAW,+CAA4C;EAAlF,UAAA,CACE,oBAAC,KAAD;GAAG,uDAAoD;GACpD,UAAA,oBAAoB,SAAS,KAAK,cAAc,EAAE,IAAI,iCAAiC,CAAC,CAAC;EACzF,CAAA,GACH,oBAAC,gBAAD;GACE,MAAM,OAAO,SAAS,YAAY,KAAK,KAAK,CAAC,CAAC,WAAW,IAAI,eAAgB,QAAQ;GACrF,oDAAiD;GAEhD,UAAA,oBAAoB,WAAW,KAAK,cAAc,EAAE,IAAI,sCAAsC,CAAC,CAAC;EACnF,CAAA,CACb;;AAET"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { ComponentDefinition } from "../../core/dist/define-component.js";
|
|
2
|
+
import "../../core/dist/index.js";
|
|
3
|
+
import { ComponentPropsWithRef } from "react";
|
|
4
|
+
//#region src/matter/account-address-book/account-address-book.d.ts
|
|
5
|
+
/** The minimal per-address identifiers the root needs to iterate. */
|
|
6
|
+
export type AccountAddressBookRootSlice = Readonly<{
|
|
7
|
+
__typename?: 'CustomerAddressBook';
|
|
8
|
+
id: string;
|
|
9
|
+
addresses: readonly Readonly<{
|
|
10
|
+
__typename?: 'CustomerAddress';
|
|
11
|
+
id: string;
|
|
12
|
+
}>[];
|
|
13
|
+
}>;
|
|
14
|
+
/** The full per-address slice `AccountAddressBookItem` resolves on its own. */
|
|
15
|
+
export type AccountAddressBookItemSlice = Readonly<{
|
|
16
|
+
__typename?: 'CustomerAddress';
|
|
17
|
+
id: string;
|
|
18
|
+
country?: string | null;
|
|
19
|
+
recipientName?: 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
|
+
postalCode?: string | null;
|
|
27
|
+
reference?: string | null;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Where the book is. `null` is the frame before anything resolved, loaded, or failed: it shows
|
|
31
|
+
* nothing, so no state is ever claimed that the data has not earned.
|
|
32
|
+
*/
|
|
33
|
+
export type AccountAddressBookState = 'loading' | 'error' | 'empty' | 'ready';
|
|
34
|
+
/** The form the book has open. `address` is the item's raw slice, so the form can seed itself from it. */
|
|
35
|
+
export type AccountAddressBookOpenForm = Readonly<{
|
|
36
|
+
mode: 'add';
|
|
37
|
+
}> | Readonly<{
|
|
38
|
+
mode: 'edit';
|
|
39
|
+
address: AccountAddressBookItemSlice;
|
|
40
|
+
}>;
|
|
41
|
+
/** The address a delete confirmation is open for. `null` when none is. */
|
|
42
|
+
export type AccountAddressBookPendingDelete = AccountAddressBookItemSlice | null;
|
|
43
|
+
export type AccountAddressBookContextValue = Readonly<{
|
|
44
|
+
book: AccountAddressBookRootSlice | null;
|
|
45
|
+
state: AccountAddressBookState | null;
|
|
46
|
+
openForm: AccountAddressBookOpenForm | null;
|
|
47
|
+
/** Opens a form, replacing any open one. `opener` is where focus returns when the form closes. */
|
|
48
|
+
open: (form: AccountAddressBookOpenForm, opener: HTMLElement | null) => void;
|
|
49
|
+
close: () => void;
|
|
50
|
+
/** True while the open form has a save in flight. The dialog stays open until it settles. */
|
|
51
|
+
formPending: boolean;
|
|
52
|
+
/** Reported by the open form as its save starts and settles. */
|
|
53
|
+
setFormPending: (pending: boolean) => void;
|
|
54
|
+
/** The address waiting for the shopper's answer to a delete confirmation, or `null`. */
|
|
55
|
+
pendingDelete: AccountAddressBookPendingDelete;
|
|
56
|
+
/** Asks for a confirmation. `opener` is where focus returns when it is declined. */
|
|
57
|
+
requestDelete: (address: AccountAddressBookItemSlice, opener: HTMLElement | null) => void;
|
|
58
|
+
endDelete: () => void;
|
|
59
|
+
/** True from an in-place retry until the book resolves. The error part stays mounted meanwhile. */
|
|
60
|
+
retrying: boolean;
|
|
61
|
+
/** Loads the book again: in place through the page root's `refetch`, else by reloading the page. */
|
|
62
|
+
retry: () => void;
|
|
63
|
+
}>;
|
|
64
|
+
export type AccountAddressBookRootProps = ComponentPropsWithRef<'div'> & {
|
|
65
|
+
/** Unwrapped `customerAddressBook` from the reactive runtime (arity-1 fragment); `null` until resolved. */
|
|
66
|
+
$data?: AccountAddressBookRootSlice | null;
|
|
67
|
+
};
|
|
68
|
+
export type AccountAddressBookListProps = ComponentPropsWithRef<'ul'>;
|
|
69
|
+
export type AccountAddressBookItemProps = ComponentPropsWithRef<'div'> & {
|
|
70
|
+
/** Per-address slice from the reactive-list-item runtime; passed directly in tests. */
|
|
71
|
+
$data?: AccountAddressBookItemSlice | null;
|
|
72
|
+
};
|
|
73
|
+
export type AccountAddressBookItemLinesProps = Readonly<{
|
|
74
|
+
className?: string;
|
|
75
|
+
}>;
|
|
76
|
+
export type AccountAddressBookLoadingProps = ComponentPropsWithRef<'output'> & {
|
|
77
|
+
/** Announced while the book loads. A blank value falls back to the catalog copy. */
|
|
78
|
+
message?: string;
|
|
79
|
+
};
|
|
80
|
+
export type AccountAddressBookEmptyProps = ComponentPropsWithRef<'p'> & {
|
|
81
|
+
/** Shown once the book resolved to zero addresses. A blank value falls back to the catalog copy. */
|
|
82
|
+
message?: string;
|
|
83
|
+
};
|
|
84
|
+
export type AccountAddressBookErrorProps = ComponentPropsWithRef<'div'> & {
|
|
85
|
+
/** Shown when the read failed. A blank value falls back to the catalog copy. */
|
|
86
|
+
message?: string;
|
|
87
|
+
/** The retry control's label. A blank value falls back to the catalog copy. */
|
|
88
|
+
retryLabel?: string;
|
|
89
|
+
};
|
|
90
|
+
/** The resolved book and its state, for any part composed under `AccountAddressBookRoot`. */
|
|
91
|
+
export declare function useAccountAddressBook(): AccountAddressBookContextValue;
|
|
92
|
+
/**
|
|
93
|
+
* The raw address an entry renders, with its alpha-3 `country`. Delete, edit and the deliverability
|
|
94
|
+
* marker read this rather than the summary, whose country is already a display name.
|
|
95
|
+
*/
|
|
96
|
+
export declare function useAccountAddressBookItem(): AccountAddressBookItemSlice;
|
|
97
|
+
export declare function AccountAddressBookRoot({ $data: $dataProp, className, children, ...props }: AccountAddressBookRootProps): import("react/jsx-runtime").JSX.Element | null;
|
|
98
|
+
export declare function AccountAddressBookList({ className, children, ...props }: AccountAddressBookListProps): import("react/jsx-runtime").JSX.Element | null;
|
|
99
|
+
export declare function AccountAddressBookItem({ $data: $dataProp, className, children, ...props }: AccountAddressBookItemProps): import("react/jsx-runtime").JSX.Element | null;
|
|
100
|
+
/** One `p` per line the address's country prints, each field in that country's order. */
|
|
101
|
+
export declare function AccountAddressBookItemLines({ className }: AccountAddressBookItemLinesProps): import("react/jsx-runtime").JSX.Element;
|
|
102
|
+
/**
|
|
103
|
+
* The polite live region stays mounted whether or not the book is loading, so the message is
|
|
104
|
+
* announced when it lands (the region has to exist before its text does).
|
|
105
|
+
*/
|
|
106
|
+
export declare function AccountAddressBookLoading({ message, className, children, ...props }: AccountAddressBookLoadingProps): import("react/jsx-runtime").JSX.Element;
|
|
107
|
+
export declare function AccountAddressBookEmpty({ message, className, ...props }: AccountAddressBookEmptyProps): import("react/jsx-runtime").JSX.Element | null;
|
|
108
|
+
export declare function AccountAddressBookError({ message, retryLabel, className, ...props }: AccountAddressBookErrorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
109
|
+
export declare function AccountAddressBookSkeleton({ className, ...props }: ComponentPropsWithRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
110
|
+
export declare const AccountAddressBookRootDefinition: ComponentDefinition<AccountAddressBookRootProps>;
|
|
111
|
+
export declare const AccountAddressBookListDefinition: ComponentDefinition<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>>;
|
|
112
|
+
export declare const AccountAddressBookItemDefinition: ComponentDefinition<AccountAddressBookItemProps>;
|
|
113
|
+
export declare const AccountAddressBookItemLinesDefinition: ComponentDefinition<Readonly<{
|
|
114
|
+
className?: string;
|
|
115
|
+
}>>;
|
|
116
|
+
export declare const AccountAddressBookLoadingDefinition: ComponentDefinition<AccountAddressBookLoadingProps>;
|
|
117
|
+
export declare const AccountAddressBookEmptyDefinition: ComponentDefinition<AccountAddressBookEmptyProps>;
|
|
118
|
+
export declare const AccountAddressBookErrorDefinition: ComponentDefinition<AccountAddressBookErrorProps>;
|
|
119
|
+
//#endregion
|
|
120
|
+
//# sourceMappingURL=account-address-book.d.ts.map
|
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { defineComponent } from "../../core/dist/define-component.js";
|
|
3
|
+
import "../../core/dist/index.js";
|
|
4
|
+
import { useStorefrontFormatters } from "../../sdk/format/client.js";
|
|
5
|
+
import { useIntl } from "../../sdk/i18n/client.js";
|
|
6
|
+
import { useDataOverride } from "../../sdk/data/data-override-context.js";
|
|
7
|
+
import { resolveAuthoredCopy } from "../../utils/resolve-authored-copy.js";
|
|
8
|
+
import { useSession } from "../session/session.js";
|
|
9
|
+
import { AddressSummary, AddressSummaryCountry, AddressSummaryField, AddressSummaryRecipient, AddressSummaryRoot } from "../../particles/address-summary/address-summary.js";
|
|
10
|
+
import { Button } from "../../particles/button/button.js";
|
|
11
|
+
import { countryDisplayName } from "../../sdk/address/country-display.js";
|
|
12
|
+
import { formatAddress } from "../../sdk/address/format-address.js";
|
|
13
|
+
import { ListItemRefContext } from "../../sdk/data/list-item-ref-context.js";
|
|
14
|
+
import { ReactiveRootContext } from "../../sdk/data/page-reactive-data-root.js";
|
|
15
|
+
import { Fragment, createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
16
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
+
//#region src/matter/account-address-book/account-address-book.tsx
|
|
18
|
+
/**
|
|
19
|
+
* The shopper's saved addresses, listed (specs/sfs-3440-address-book-list.md, RFC REQ-01). One family
|
|
20
|
+
* split by data-fetch role, in the pattern `SavedCards` and `CartRoot` use:
|
|
21
|
+
*
|
|
22
|
+
* - `AccountAddressBookRoot` reads the book once through the page's reactive query, owns the four
|
|
23
|
+
* states, and gates on a signed-in session.
|
|
24
|
+
* - `AccountAddressBookList` fans the addresses out by entity ref, one `li` per address.
|
|
25
|
+
* - `AccountAddressBookItem` subscribes to its own `CustomerAddress` entity (`reactive-list-item`) and
|
|
26
|
+
* bridges it onto the generic `AddressSummary` particle.
|
|
27
|
+
* - `Loading`, `Empty` and `Error` are composed parts, so a store chooses where each sits.
|
|
28
|
+
*
|
|
29
|
+
* Every rule the components apply lives in `sdk/address/`: line order is `formatAddress`'s and the
|
|
30
|
+
* country name is `countryDisplayName`'s. The components only compose them.
|
|
31
|
+
*/
|
|
32
|
+
const fragment = `
|
|
33
|
+
fragment AccountAddressBookRootData on Query {
|
|
34
|
+
customerAddressBook {
|
|
35
|
+
__typename
|
|
36
|
+
id
|
|
37
|
+
addresses {
|
|
38
|
+
__typename
|
|
39
|
+
id
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
const itemFragment = `
|
|
45
|
+
fragment AccountAddressBookItemData on Query {
|
|
46
|
+
customerAddressBook {
|
|
47
|
+
addresses {
|
|
48
|
+
__typename
|
|
49
|
+
id
|
|
50
|
+
country
|
|
51
|
+
recipientName
|
|
52
|
+
street
|
|
53
|
+
number
|
|
54
|
+
complement
|
|
55
|
+
neighborhood
|
|
56
|
+
city
|
|
57
|
+
state
|
|
58
|
+
postalCode
|
|
59
|
+
reference
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
64
|
+
const AccountAddressBookContext = createContext(null);
|
|
65
|
+
/** The resolved book and its state, for any part composed under `AccountAddressBookRoot`. */
|
|
66
|
+
function useAccountAddressBook() {
|
|
67
|
+
const value = useContext(AccountAddressBookContext);
|
|
68
|
+
if (!value) throw new Error("Address book parts must be used inside an AccountAddressBookRoot.");
|
|
69
|
+
return value;
|
|
70
|
+
}
|
|
71
|
+
/** The book's context, or `null` outside a root: the form also stands alone, in add mode. */
|
|
72
|
+
function useOptionalAccountAddressBook() {
|
|
73
|
+
return useContext(AccountAddressBookContext);
|
|
74
|
+
}
|
|
75
|
+
const AccountAddressBookItemContext = createContext(null);
|
|
76
|
+
/**
|
|
77
|
+
* The raw address an entry renders, with its alpha-3 `country`. Delete, edit and the deliverability
|
|
78
|
+
* marker read this rather than the summary, whose country is already a display name.
|
|
79
|
+
*/
|
|
80
|
+
function useAccountAddressBookItem() {
|
|
81
|
+
const value = useContext(AccountAddressBookItemContext);
|
|
82
|
+
if (!value) throw new Error("Address book entry parts must be used inside an AccountAddressBookItem.");
|
|
83
|
+
return value;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Each state gates on the resolved book, never on `loading` alone: `loading` is false on the first
|
|
87
|
+
* client frame before the seed effect runs, and the book is null both while loading and after a
|
|
88
|
+
* failure. So empty needs a book that resolved to zero addresses, and error needs no book and a
|
|
89
|
+
* settled read that reported one.
|
|
90
|
+
*/
|
|
91
|
+
function resolveState({ book, loading, error }) {
|
|
92
|
+
if (book != null) return book.addresses.length === 0 ? "empty" : "ready";
|
|
93
|
+
if (loading) return "loading";
|
|
94
|
+
return error ? "error" : null;
|
|
95
|
+
}
|
|
96
|
+
const BOOK_SELECTOR = "[data-fs-account-address-book]";
|
|
97
|
+
/**
|
|
98
|
+
* Where focus goes once an overlay the book opened has closed: back to the control that opened it,
|
|
99
|
+
* and, when a save or a removal took that control out of the document, to the book itself rather
|
|
100
|
+
* than the page's top. `active` is true while the overlay is open; `remember` runs as it opens.
|
|
101
|
+
*/
|
|
102
|
+
function useFocusReturn(active) {
|
|
103
|
+
const target = useRef(null);
|
|
104
|
+
const remember = useCallback((opener) => {
|
|
105
|
+
target.current = {
|
|
106
|
+
opener,
|
|
107
|
+
root: opener?.closest(BOOK_SELECTOR) ?? null
|
|
108
|
+
};
|
|
109
|
+
}, []);
|
|
110
|
+
useEffect(() => {
|
|
111
|
+
if (active) return;
|
|
112
|
+
const current = target.current;
|
|
113
|
+
target.current = null;
|
|
114
|
+
if (!current) return;
|
|
115
|
+
const { opener, root } = current;
|
|
116
|
+
(opener?.isConnected ? opener : root)?.focus();
|
|
117
|
+
}, [active]);
|
|
118
|
+
return remember;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The retry loads the book again in place through the page root's `refetch`. A root with none falls
|
|
122
|
+
* back to reloading the page: the read changes nothing, so that is safe, and the page re-runs its
|
|
123
|
+
* query.
|
|
124
|
+
*/
|
|
125
|
+
function reloadPage() {
|
|
126
|
+
globalThis.location.reload();
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* A retry keeps the error part, and so its button, mounted while the book loads: focus stays on the
|
|
130
|
+
* button, and the same button is offered again if the read fails again. `retrying` lasts as long as
|
|
131
|
+
* the retry's own `refetch`, so a later load from another trigger is never read as this retry.
|
|
132
|
+
* Once the book resolves, the list or the empty message replaces the button, so focus moves to the
|
|
133
|
+
* book, but only when focus was inside the book at the retry and has fallen to the page's top since.
|
|
134
|
+
* A failed read drops that mark.
|
|
135
|
+
*/
|
|
136
|
+
function useRetry(refetch, state) {
|
|
137
|
+
const [retrying, setRetrying] = useState(false);
|
|
138
|
+
const focusRoot = useRef(null);
|
|
139
|
+
const retry = useCallback(() => {
|
|
140
|
+
if (!refetch) {
|
|
141
|
+
reloadPage();
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const { activeElement } = document;
|
|
145
|
+
focusRoot.current = activeElement instanceof HTMLElement ? activeElement.closest(BOOK_SELECTOR) : null;
|
|
146
|
+
setRetrying(true);
|
|
147
|
+
refetch().catch(() => {}).finally(() => setRetrying(false));
|
|
148
|
+
}, [refetch]);
|
|
149
|
+
useEffect(() => {
|
|
150
|
+
if (state === "error") {
|
|
151
|
+
focusRoot.current = null;
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
if (state !== "ready" && state !== "empty") return;
|
|
155
|
+
const root = focusRoot.current;
|
|
156
|
+
focusRoot.current = null;
|
|
157
|
+
const { activeElement } = document;
|
|
158
|
+
if (root && (!activeElement || activeElement === document.body)) root.focus();
|
|
159
|
+
}, [state]);
|
|
160
|
+
return {
|
|
161
|
+
retrying,
|
|
162
|
+
retry
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
function AccountAddressBookRoot({ $data: $dataProp, className, children, ...props }) {
|
|
166
|
+
const book = useDataOverride($dataProp) ?? null;
|
|
167
|
+
const { loading, error, refetch } = useContext(ReactiveRootContext);
|
|
168
|
+
const { state: sessionState } = useSession();
|
|
169
|
+
const state = resolveState({
|
|
170
|
+
book,
|
|
171
|
+
loading,
|
|
172
|
+
error
|
|
173
|
+
});
|
|
174
|
+
const [openForm, setOpenForm] = useState(null);
|
|
175
|
+
const [formPending, setFormPending] = useState(false);
|
|
176
|
+
const [pendingDelete, setPendingDelete] = useState(null);
|
|
177
|
+
const rememberFormOpener = useFocusReturn(openForm !== null);
|
|
178
|
+
const rememberDeleteOpener = useFocusReturn(pendingDelete !== null);
|
|
179
|
+
const { retrying, retry } = useRetry(refetch, state);
|
|
180
|
+
const open = useCallback((form, opener) => {
|
|
181
|
+
rememberFormOpener(opener);
|
|
182
|
+
setOpenForm(form);
|
|
183
|
+
}, [rememberFormOpener]);
|
|
184
|
+
const close = useCallback(() => setOpenForm(null), []);
|
|
185
|
+
const requestDelete = useCallback((address, opener) => {
|
|
186
|
+
rememberDeleteOpener(opener);
|
|
187
|
+
setPendingDelete(address);
|
|
188
|
+
}, [rememberDeleteOpener]);
|
|
189
|
+
const endDelete = useCallback(() => setPendingDelete(null), []);
|
|
190
|
+
const value = useMemo(() => ({
|
|
191
|
+
book,
|
|
192
|
+
state,
|
|
193
|
+
openForm,
|
|
194
|
+
open,
|
|
195
|
+
close,
|
|
196
|
+
formPending,
|
|
197
|
+
setFormPending,
|
|
198
|
+
pendingDelete,
|
|
199
|
+
requestDelete,
|
|
200
|
+
endDelete,
|
|
201
|
+
retrying,
|
|
202
|
+
retry
|
|
203
|
+
}), [
|
|
204
|
+
book,
|
|
205
|
+
state,
|
|
206
|
+
openForm,
|
|
207
|
+
open,
|
|
208
|
+
close,
|
|
209
|
+
formPending,
|
|
210
|
+
pendingDelete,
|
|
211
|
+
requestDelete,
|
|
212
|
+
endDelete,
|
|
213
|
+
retrying,
|
|
214
|
+
retry
|
|
215
|
+
]);
|
|
216
|
+
if (sessionState !== "loggedIn") return null;
|
|
217
|
+
return /* @__PURE__ */ jsx(AccountAddressBookContext, {
|
|
218
|
+
value,
|
|
219
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
220
|
+
tabIndex: -1,
|
|
221
|
+
...props,
|
|
222
|
+
className,
|
|
223
|
+
"data-fs-account-address-book": "",
|
|
224
|
+
...state ? { "data-fs-account-address-book-state": state } : {},
|
|
225
|
+
children
|
|
226
|
+
})
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
function AccountAddressBookList({ className, children, ...props }) {
|
|
230
|
+
const { book } = useAccountAddressBook();
|
|
231
|
+
const addresses = book?.addresses ?? [];
|
|
232
|
+
if (addresses.length === 0) return null;
|
|
233
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
234
|
+
...props,
|
|
235
|
+
className,
|
|
236
|
+
"data-fs-account-address-book-list": "",
|
|
237
|
+
children: addresses.map(({ id }) => /* @__PURE__ */ jsx("li", {
|
|
238
|
+
"data-fs-account-address-book-list-item": "",
|
|
239
|
+
children: /* @__PURE__ */ jsx(ListItemRefContext, {
|
|
240
|
+
value: {
|
|
241
|
+
__typename: "CustomerAddress",
|
|
242
|
+
id,
|
|
243
|
+
fallbackData: void 0
|
|
244
|
+
},
|
|
245
|
+
children
|
|
246
|
+
})
|
|
247
|
+
}, id))
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
function AccountAddressBookItem({ $data: $dataProp, className, children, ...props }) {
|
|
251
|
+
const slice = useDataOverride($dataProp) ?? null;
|
|
252
|
+
const { displayName } = useStorefrontFormatters();
|
|
253
|
+
if (!slice) return null;
|
|
254
|
+
const summary = {
|
|
255
|
+
recipientName: slice.recipientName,
|
|
256
|
+
street: slice.street,
|
|
257
|
+
number: slice.number,
|
|
258
|
+
complement: slice.complement,
|
|
259
|
+
neighborhood: slice.neighborhood,
|
|
260
|
+
city: slice.city,
|
|
261
|
+
state: slice.state,
|
|
262
|
+
postalCode: slice.postalCode,
|
|
263
|
+
reference: slice.reference,
|
|
264
|
+
country: countryDisplayName(slice.country, displayName)
|
|
265
|
+
};
|
|
266
|
+
return /* @__PURE__ */ jsx(AccountAddressBookItemContext, {
|
|
267
|
+
value: slice,
|
|
268
|
+
children: /* @__PURE__ */ jsx(AddressSummaryRoot, {
|
|
269
|
+
address: summary,
|
|
270
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
271
|
+
...props,
|
|
272
|
+
className,
|
|
273
|
+
"data-fs-account-address-book-item": "",
|
|
274
|
+
children: children ?? /* @__PURE__ */ jsxs(AddressSummary, { children: [
|
|
275
|
+
/* @__PURE__ */ jsx(AddressSummaryRecipient, {}),
|
|
276
|
+
/* @__PURE__ */ jsx(AccountAddressBookItemLines, {}),
|
|
277
|
+
/* @__PURE__ */ jsx(AddressSummaryCountry, {})
|
|
278
|
+
] })
|
|
279
|
+
})
|
|
280
|
+
})
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
/** One `p` per line the address's country prints, each field in that country's order. */
|
|
284
|
+
function AccountAddressBookItemLines({ className }) {
|
|
285
|
+
const address = useAccountAddressBookItem();
|
|
286
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: formatAddress(address, address.country ?? "").map((line) => /* @__PURE__ */ jsx("p", {
|
|
287
|
+
className,
|
|
288
|
+
"data-fs-account-address-book-line": "",
|
|
289
|
+
children: line.map(({ field, separator }) => /* @__PURE__ */ jsxs(Fragment, { children: [separator, /* @__PURE__ */ jsx(AddressSummaryField, { field })] }, field))
|
|
290
|
+
}, line.map(({ field }) => field).join())) });
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* The polite live region stays mounted whether or not the book is loading, so the message is
|
|
294
|
+
* announced when it lands (the region has to exist before its text does).
|
|
295
|
+
*/
|
|
296
|
+
function AccountAddressBookLoading({ message, className, children, ...props }) {
|
|
297
|
+
const { state } = useAccountAddressBook();
|
|
298
|
+
const intl = useIntl();
|
|
299
|
+
return /* @__PURE__ */ jsx("output", {
|
|
300
|
+
...props,
|
|
301
|
+
"aria-live": "polite",
|
|
302
|
+
className,
|
|
303
|
+
"data-fs-account-address-book-loading": "",
|
|
304
|
+
children: state === "loading" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [children ?? /* @__PURE__ */ jsx(AccountAddressBookSkeleton, {}), /* @__PURE__ */ jsx("span", {
|
|
305
|
+
"data-fs-account-address-book-loading-message": "",
|
|
306
|
+
"data-fs-sr-only": "",
|
|
307
|
+
className: "sr-only",
|
|
308
|
+
children: resolveAuthoredCopy(message, intl.formatMessage({ id: "fs/address-book.loading" }))
|
|
309
|
+
})] }) : null
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
function AccountAddressBookEmpty({ message, className, ...props }) {
|
|
313
|
+
const { state } = useAccountAddressBook();
|
|
314
|
+
const intl = useIntl();
|
|
315
|
+
if (state !== "empty") return null;
|
|
316
|
+
return /* @__PURE__ */ jsx("p", {
|
|
317
|
+
...props,
|
|
318
|
+
className,
|
|
319
|
+
"data-fs-account-address-book-empty": "",
|
|
320
|
+
children: resolveAuthoredCopy(message, intl.formatMessage({ id: "fs/address-book.empty" }))
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
function AccountAddressBookError({ message, retryLabel, className, ...props }) {
|
|
324
|
+
const { state, retrying, retry } = useAccountAddressBook();
|
|
325
|
+
const intl = useIntl();
|
|
326
|
+
const busy = retrying && state === "loading";
|
|
327
|
+
if (state !== "error" && !busy) return null;
|
|
328
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
329
|
+
...props,
|
|
330
|
+
role: "alert",
|
|
331
|
+
className,
|
|
332
|
+
"data-fs-account-address-book-error": "",
|
|
333
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
334
|
+
"data-fs-account-address-book-error-message": "",
|
|
335
|
+
children: resolveAuthoredCopy(message, intl.formatMessage({ id: "fs/address-book.error" }))
|
|
336
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
337
|
+
type: "button",
|
|
338
|
+
onClick: busy ? void 0 : retry,
|
|
339
|
+
"aria-disabled": busy || void 0,
|
|
340
|
+
"aria-busy": busy || void 0,
|
|
341
|
+
"data-fs-account-address-book-retry": "",
|
|
342
|
+
children: resolveAuthoredCopy(retryLabel, intl.formatMessage({ id: "fs/address-book.retry" }))
|
|
343
|
+
})]
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
function AccountAddressBookSkeleton({ className, ...props }) {
|
|
347
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
348
|
+
...props,
|
|
349
|
+
className,
|
|
350
|
+
"aria-hidden": "true",
|
|
351
|
+
"data-fs-account-address-book-skeleton": "",
|
|
352
|
+
children: [
|
|
353
|
+
/* @__PURE__ */ jsx("span", { "data-fs-account-address-book-skeleton-line": "" }),
|
|
354
|
+
/* @__PURE__ */ jsx("span", { "data-fs-account-address-book-skeleton-line": "" }),
|
|
355
|
+
/* @__PURE__ */ jsx("span", { "data-fs-account-address-book-skeleton-line": "" })
|
|
356
|
+
]
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
const AccountAddressBookRootDefinition = defineComponent({
|
|
360
|
+
name: "AccountAddressBookRoot",
|
|
361
|
+
importPath: "@vtex/faststore/components",
|
|
362
|
+
component: AccountAddressBookRoot,
|
|
363
|
+
fragment,
|
|
364
|
+
fetchStrategy: "reactive",
|
|
365
|
+
requiresContext: "session",
|
|
366
|
+
providesContext: "account-address-book",
|
|
367
|
+
skeleton: AccountAddressBookSkeleton,
|
|
368
|
+
editor: {
|
|
369
|
+
label: "Account Address Book",
|
|
370
|
+
category: "identity"
|
|
371
|
+
},
|
|
372
|
+
schema: {},
|
|
373
|
+
guideline: "Root of the signed-in shopper's saved addresses: reads the address book once and owns its four states (loading, error, empty, ready), exposed as data-fs-account-address-book-state. Renders nothing unless the session is logged in, so it needs a SessionRoot ancestor. Compose AccountAddressBookLoading, AccountAddressBookError, AccountAddressBookEmpty and an AccountAddressBookList holding one AccountAddressBookItem, in any order. Reading the book starts no cart. See account-address-book.md."
|
|
374
|
+
});
|
|
375
|
+
const AccountAddressBookListDefinition = defineComponent({
|
|
376
|
+
name: "AccountAddressBookList",
|
|
377
|
+
importPath: "@vtex/faststore/components",
|
|
378
|
+
component: AccountAddressBookList,
|
|
379
|
+
requiresContext: "account-address-book",
|
|
380
|
+
editor: {
|
|
381
|
+
label: "Account Address Book List",
|
|
382
|
+
category: "content"
|
|
383
|
+
},
|
|
384
|
+
schema: {},
|
|
385
|
+
guideline: "The saved addresses as a list, one entry per address in the order the book returns them. Place one AccountAddressBookItem inside as the per-address template; it is repeated once per address. Renders nothing until the book has at least one address. Must be inside AccountAddressBookRoot."
|
|
386
|
+
});
|
|
387
|
+
const AccountAddressBookItemDefinition = defineComponent({
|
|
388
|
+
name: "AccountAddressBookItem",
|
|
389
|
+
importPath: "@vtex/faststore/components",
|
|
390
|
+
component: AccountAddressBookItem,
|
|
391
|
+
fragment: itemFragment,
|
|
392
|
+
fetchStrategy: "reactive-list-item",
|
|
393
|
+
requiresContext: "account-address-book",
|
|
394
|
+
providesContext: ["account-address-book-item", "address-summary"],
|
|
395
|
+
skeleton: AccountAddressBookSkeleton,
|
|
396
|
+
editor: {
|
|
397
|
+
label: "Account Address Book Item",
|
|
398
|
+
category: "content"
|
|
399
|
+
},
|
|
400
|
+
schema: {},
|
|
401
|
+
guideline: "One saved address, written the way its country writes it, with the recipient first and the country's name last. With no children it renders that default entry; give it children to compose the entry yourself, using the AddressSummary parts and AccountAddressBookItemLines. Provides the address-summary contract and the raw address for triggers placed inside it. Must be inside AccountAddressBookList."
|
|
402
|
+
});
|
|
403
|
+
const AccountAddressBookItemLinesDefinition = defineComponent({
|
|
404
|
+
name: "AccountAddressBookItemLines",
|
|
405
|
+
importPath: "@vtex/faststore/components",
|
|
406
|
+
component: AccountAddressBookItemLines,
|
|
407
|
+
requiresContext: "account-address-book-item",
|
|
408
|
+
editor: {
|
|
409
|
+
label: "Account Address Book Item Lines",
|
|
410
|
+
category: "content"
|
|
411
|
+
},
|
|
412
|
+
schema: {},
|
|
413
|
+
guideline: "The address's lines in its country's order, one paragraph per line with each field in sequence and its separator (a United States address reads number before street). A field the address lacks is dropped along with its separator. Must be inside AccountAddressBookItem."
|
|
414
|
+
});
|
|
415
|
+
const AccountAddressBookLoadingDefinition = defineComponent({
|
|
416
|
+
name: "AccountAddressBookLoading",
|
|
417
|
+
importPath: "@vtex/faststore/components",
|
|
418
|
+
component: AccountAddressBookLoading,
|
|
419
|
+
requiresContext: "account-address-book",
|
|
420
|
+
editor: {
|
|
421
|
+
label: "Account Address Book Loading",
|
|
422
|
+
category: "content"
|
|
423
|
+
},
|
|
424
|
+
schema: { message: {
|
|
425
|
+
type: "string",
|
|
426
|
+
label: "Loading message"
|
|
427
|
+
} },
|
|
428
|
+
guideline: "Shown only while the book is loading and has not resolved: a placeholder plus a loading message. The wrapper is a polite live region that stays mounted, and the message is visually hidden so it is heard and not seen. Pass children to replace the default placeholder. Must be inside AccountAddressBookRoot."
|
|
429
|
+
});
|
|
430
|
+
const AccountAddressBookEmptyDefinition = defineComponent({
|
|
431
|
+
name: "AccountAddressBookEmpty",
|
|
432
|
+
importPath: "@vtex/faststore/components",
|
|
433
|
+
component: AccountAddressBookEmpty,
|
|
434
|
+
requiresContext: "account-address-book",
|
|
435
|
+
editor: {
|
|
436
|
+
label: "Account Address Book Empty",
|
|
437
|
+
category: "content"
|
|
438
|
+
},
|
|
439
|
+
schema: { message: {
|
|
440
|
+
type: "string",
|
|
441
|
+
label: "Empty message"
|
|
442
|
+
} },
|
|
443
|
+
guideline: "Shown only once the book has resolved to zero addresses, never while it loads or after it fails, so it never invites the shopper to add an address they already have. Must be inside AccountAddressBookRoot."
|
|
444
|
+
});
|
|
445
|
+
const AccountAddressBookErrorDefinition = defineComponent({
|
|
446
|
+
name: "AccountAddressBookError",
|
|
447
|
+
importPath: "@vtex/faststore/components",
|
|
448
|
+
component: AccountAddressBookError,
|
|
449
|
+
requiresContext: "account-address-book",
|
|
450
|
+
editor: {
|
|
451
|
+
label: "Account Address Book Error",
|
|
452
|
+
category: "content"
|
|
453
|
+
},
|
|
454
|
+
schema: {
|
|
455
|
+
message: {
|
|
456
|
+
type: "string",
|
|
457
|
+
label: "Error message"
|
|
458
|
+
},
|
|
459
|
+
retryLabel: {
|
|
460
|
+
type: "string",
|
|
461
|
+
label: "Retry label"
|
|
462
|
+
}
|
|
463
|
+
},
|
|
464
|
+
guideline: "Shown when the book failed to load, as an alert with a retry control that loads the book again in place. Stays, with its retry disabled, while that retry loads. Never shown for a first load or an empty book. Must be inside AccountAddressBookRoot."
|
|
465
|
+
});
|
|
466
|
+
//#endregion
|
|
467
|
+
export { AccountAddressBookEmpty, AccountAddressBookEmptyDefinition, AccountAddressBookError, AccountAddressBookErrorDefinition, AccountAddressBookItem, AccountAddressBookItemDefinition, AccountAddressBookItemLines, AccountAddressBookItemLinesDefinition, AccountAddressBookList, AccountAddressBookListDefinition, AccountAddressBookLoading, AccountAddressBookLoadingDefinition, AccountAddressBookRoot, AccountAddressBookRootDefinition, AccountAddressBookSkeleton, useAccountAddressBook, useAccountAddressBookItem, useOptionalAccountAddressBook };
|
|
468
|
+
|
|
469
|
+
//# sourceMappingURL=account-address-book.js.map
|