@vtex/faststore 0.0.7 → 0.0.8
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 +43 -0
- package/dist/actions.json +152 -1
- package/dist/catalog.json +1264 -142
- 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 +34 -7
- package/dist/components.js +38 -11
- package/dist/content-types.json +523 -0
- package/dist/core/dist/define-component.d.ts +6 -1
- 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 +1 -1
- package/dist/docs/account-menu.md +5 -5
- package/dist/docs/alert-dialog.md +2 -2
- package/dist/docs/billing-address.md +17 -9
- package/dist/docs/card-entry.md +37 -6
- package/dist/docs/cardholder-document.md +16 -14
- package/dist/docs/cart-item.md +1 -1
- package/dist/docs/cart.md +8 -8
- 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/header-root.md +1 -1
- package/dist/docs/incentives.md +2 -2
- package/dist/docs/logo.md +5 -5
- 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 +14 -3
- package/dist/docs/place-order.md +13 -9
- package/dist/docs/saved-cards.md +2 -2
- package/dist/docs/select.md +19 -6
- package/dist/docs/session.md +1 -1
- package/dist/docs/shipping-address.md +1 -1
- package/dist/docs/sign-in-redirect.md +6 -6
- package/dist/docs/toast.md +7 -3
- package/dist/index.d.ts +6 -2
- package/dist/index.js +2 -1
- package/dist/internal/client.d.ts +6 -1
- package/dist/internal/client.js +7 -2
- package/dist/internal/server.d.ts +6 -2
- package/dist/internal/server.js +6 -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/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.d.ts +7 -2
- package/dist/matter/cart/cart.js +29 -26
- package/dist/matter/cart/cart.js.map +1 -1
- package/dist/matter/cart-item/cart-item.js +2 -2
- package/dist/matter/cart-item/cart-item.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/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/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 +1 -1
- 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/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/incentives/incentives.d.ts +6 -2
- package/dist/particles/incentives/incentives.js +7 -2
- 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/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 +1 -1
- package/dist/particles/toast/toast.js +32 -6
- package/dist/particles/toast/toast.js.map +1 -1
- package/dist/schema.graphql +1014 -28
- 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 +3 -1
- package/dist/sdk/actions/index.js +3 -1
- 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/types.d.ts +6 -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 +29 -4
- package/dist/sdk/cache/storefront-cache.js.map +1 -1
- 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 +3 -1
- package/dist/sdk/generated/gql.js.map +1 -1
- package/dist/sdk/generated/graphql.d.ts +8 -0
- package/dist/sdk/generated/graphql.js +212 -1
- package/dist/sdk/generated/graphql.js.map +1 -1
- package/dist/sdk/i18n/messages/en-US.js +138 -1
- package/dist/sdk/i18n/messages/en-US.json +138 -1
- package/dist/sdk/i18n/messages/en-US.json.d.ts +137 -0
- package/dist/sdk/i18n/messages/es-ES.js +138 -1
- package/dist/sdk/i18n/messages/es-ES.json +138 -1
- package/dist/sdk/i18n/messages/pt-BR.js +138 -1
- package/dist/sdk/i18n/messages/pt-BR.json +138 -1
- package/dist/sdk/navigation/current-page.js +30 -0
- package/dist/sdk/navigation/current-page.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/seo/page-alternates.d.ts +55 -0
- package/dist/sdk/seo/page-alternates.js +132 -0
- package/dist/sdk/seo/page-alternates.js.map +1 -0
- 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 +27 -0
|
@@ -0,0 +1,19 @@
|
|
|
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-deliverability.d.ts
|
|
5
|
+
/** The shipping countries the marker reads. */
|
|
6
|
+
export type AccountAddressBookItemDeliverabilitySlice = Readonly<{
|
|
7
|
+
countries: readonly string[];
|
|
8
|
+
source: 'PLATFORM' | 'SALES_CHANNEL_FALLBACK';
|
|
9
|
+
}>;
|
|
10
|
+
export type AccountAddressBookItemDeliverabilityProps = ComponentPropsWithRef<'p'> & {
|
|
11
|
+
/** Unwrapped `shippingCountries` from the reactive runtime: `null` when the read failed, `undefined` outside the page query. */
|
|
12
|
+
$data?: AccountAddressBookItemDeliverabilitySlice | null;
|
|
13
|
+
/** The marker text. A blank value falls back to the catalog copy. */
|
|
14
|
+
message?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const AccountAddressBookItemDeliverabilityDefinition: ComponentDefinition<AccountAddressBookItemDeliverabilityProps>;
|
|
17
|
+
export declare function AccountAddressBookItemDeliverability({ $data: $dataProp, message, className, ...props }: AccountAddressBookItemDeliverabilityProps): import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
+
//#endregion
|
|
19
|
+
//# sourceMappingURL=account-address-book-deliverability.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
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 { AccountAddressBookSkeleton, useAccountAddressBookItem } from "./account-address-book.js";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
const AccountAddressBookItemDeliverabilityDefinition = defineComponent({
|
|
10
|
+
name: "AccountAddressBookItemDeliverability",
|
|
11
|
+
importPath: "@vtex/faststore/components",
|
|
12
|
+
component: AccountAddressBookItemDeliverability,
|
|
13
|
+
fragment: `
|
|
14
|
+
fragment AccountAddressBookItemDeliverabilityData on Query {
|
|
15
|
+
shippingCountries {
|
|
16
|
+
countries
|
|
17
|
+
source
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
`,
|
|
21
|
+
fetchStrategy: "reactive",
|
|
22
|
+
requiresContext: "account-address-book-item",
|
|
23
|
+
skeleton: AccountAddressBookSkeleton,
|
|
24
|
+
editor: {
|
|
25
|
+
label: "Account Address Book Item Deliverability",
|
|
26
|
+
category: "content"
|
|
27
|
+
},
|
|
28
|
+
schema: { message: {
|
|
29
|
+
type: "string",
|
|
30
|
+
label: "Marker message"
|
|
31
|
+
} },
|
|
32
|
+
guideline: "Marks a saved address the store does not ship to, as text read with the address. Place it inside AccountAddressBookItem, which repeats it per address. Renders nothing unless the store's shipping countries are known and the address's country is not among them: a failed read, a single-country fallback list, or an address with no country all leave it empty. Set message to replace the default copy."
|
|
33
|
+
});
|
|
34
|
+
function AccountAddressBookItemDeliverability({ $data: $dataProp, message, className, ...props }) {
|
|
35
|
+
const { country } = useAccountAddressBookItem();
|
|
36
|
+
const shippingCountries = useDataOverride($dataProp);
|
|
37
|
+
const intl = useIntl();
|
|
38
|
+
const code = country?.trim().toUpperCase() ?? "";
|
|
39
|
+
if (shippingCountries?.source !== "PLATFORM" || code === "" || shippingCountries.countries.includes(code)) return null;
|
|
40
|
+
return /* @__PURE__ */ jsx("p", {
|
|
41
|
+
...props,
|
|
42
|
+
className,
|
|
43
|
+
"data-fs-account-address-book-item-deliverability": "",
|
|
44
|
+
children: resolveAuthoredCopy(message, intl.formatMessage({ id: "fs/address-book.undeliverable" }))
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { AccountAddressBookItemDeliverability, AccountAddressBookItemDeliverabilityDefinition };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=account-address-book-deliverability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-address-book-deliverability.js","names":[],"sources":["../../../src/matter/account-address-book/account-address-book-deliverability.tsx"],"sourcesContent":["'use client';\n\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef } from 'react';\nimport { useDataOverride } from '../../sdk/data/data-override-context.js';\nimport { useIntl } from '../../sdk/i18n/client.js';\nimport { resolveAuthoredCopy } from '../../utils/resolve-authored-copy.js';\nimport { AccountAddressBookSkeleton, useAccountAddressBookItem } from './account-address-book.js';\n\n/**\n * Marks a saved address the store does not ship to (specs/sfs-3436-address-deliverability-marker.md,\n * RFC REQ-01). The checkout refuses such an address, and the shopper otherwise finds out mid-purchase.\n *\n * It renders only when it can tell for sure: the store's own shipping countries (`PLATFORM`, never\n * the single-country `SALES_CHANNEL_FALLBACK` guess), a non-blank country on the address, and a\n * country that is not in the list. A failed read, a page that does not carry the marker, and an\n * address with no country all render nothing, so the marker never claims what the data has not earned.\n *\n * Its fragment is the one `AddressCountryControl` (SFS-3442) shares: the same selection, with no alias\n * and no argument, so the compiler merges both into one root read. `ShippingCountries` has no `id`,\n * so the marker keeps the server-rendered value for the whole page.\n */\n\nconst fragment = /* GraphQL */ `\n fragment AccountAddressBookItemDeliverabilityData on Query {\n shippingCountries {\n countries\n source\n }\n }\n`;\n\n/** The shipping countries the marker reads. */\nexport type AccountAddressBookItemDeliverabilitySlice = Readonly<{\n countries: readonly string[];\n source: 'PLATFORM' | 'SALES_CHANNEL_FALLBACK';\n}>;\n\nexport type AccountAddressBookItemDeliverabilityProps = ComponentPropsWithRef<'p'> & {\n /** Unwrapped `shippingCountries` from the reactive runtime: `null` when the read failed, `undefined` outside the page query. */\n $data?: AccountAddressBookItemDeliverabilitySlice | null;\n /** The marker text. A blank value falls back to the catalog copy. */\n message?: string;\n};\n\nexport const AccountAddressBookItemDeliverabilityDefinition =\n defineComponent<AccountAddressBookItemDeliverabilityProps>({\n name: 'AccountAddressBookItemDeliverability',\n importPath: '@vtex/faststore/components',\n component: AccountAddressBookItemDeliverability,\n fragment,\n fetchStrategy: 'reactive',\n requiresContext: 'account-address-book-item',\n skeleton: AccountAddressBookSkeleton,\n editor: { label: 'Account Address Book Item Deliverability', category: 'content' },\n schema: {\n message: { type: 'string', label: 'Marker message' },\n },\n guideline:\n \"Marks a saved address the store does not ship to, as text read with the address. Place it inside AccountAddressBookItem, which repeats it per address. Renders nothing unless the store's shipping countries are known and the address's country is not among them: a failed read, a single-country fallback list, or an address with no country all leave it empty. Set message to replace the default copy.\",\n });\n\nexport function AccountAddressBookItemDeliverability({\n $data: $dataProp,\n message,\n className,\n ...props\n}: AccountAddressBookItemDeliverabilityProps) {\n const { country } = useAccountAddressBookItem();\n const shippingCountries = useDataOverride<AccountAddressBookItemDeliverabilitySlice | null | undefined>($dataProp);\n const intl = useIntl();\n\n const code = country?.trim().toUpperCase() ?? '';\n if (shippingCountries?.source !== 'PLATFORM' || code === '' || shippingCountries.countries.includes(code)) {\n return null;\n }\n\n return (\n <p {...props} className={className} data-fs-account-address-book-item-deliverability=\"\">\n {resolveAuthoredCopy(message, intl.formatMessage({ id: 'fs/address-book.undeliverable' }))}\n </p>\n );\n}\n"],"mappings":";;;;;;;;AA6CA,MAAa,iDACX,gBAA2D;CACzD,MAAM;CACN,YAAY;CACZ,WAAW;CACX;;;;;;;;CACA,eAAe;CACf,iBAAiB;CACjB,UAAU;CACV,QAAQ;EAAE,OAAO;EAA4C,UAAU;CAAU;CACjF,QAAQ,EACN,SAAS;EAAE,MAAM;EAAU,OAAO;CAAiB,EACrD;CACA,WACE;AACJ,CAAC;AAEH,SAAgB,qCAAqC,EACnD,OAAO,WACP,SACA,WACA,GAAG,SACyC;CAC5C,MAAM,EAAE,YAAY,0BAA0B;CAC9C,MAAM,oBAAoB,gBAA8E,SAAS;CACjH,MAAM,OAAO,QAAQ;CAErB,MAAM,OAAO,SAAS,KAAK,CAAC,CAAC,YAAY,KAAK;CAC9C,IAAI,mBAAmB,WAAW,cAAc,SAAS,MAAM,kBAAkB,UAAU,SAAS,IAAI,GACtG,OAAO;CAGT,OACE,oBAAC,KAAD;EAAG,GAAI;EAAkB;EAAW,oDAAiD;EAClF,UAAA,oBAAoB,SAAS,KAAK,cAAc,EAAE,IAAI,gCAAgC,CAAC,CAAC;CACxF,CAAA;AAEP"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ComponentDefinition } from "../../core/dist/define-component.js";
|
|
2
|
+
import "../../core/dist/index.js";
|
|
3
|
+
import { ComponentPropsWithRef, ReactNode } from "react";
|
|
4
|
+
//#region src/matter/account-address-book/account-address-book-form-parts.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Where the address form opens (specs/sfs-3441-address-book-form.md, RFC REQ-02 and REQ-03). The book's
|
|
7
|
+
* root holds which form is open; these parts read it. A trigger opens a form, and a placement part
|
|
8
|
+
* shows it: `AccountAddressBookFormSlot` in place, `AccountAddressBookFormDialog` in a dialog. A store
|
|
9
|
+
* chooses by composition, and no prop selects a layout.
|
|
10
|
+
*/
|
|
11
|
+
export type AccountAddressBookAddTriggerProps = ComponentPropsWithRef<'button'> & {
|
|
12
|
+
/** The button's text. A blank value falls back to the catalog copy. */
|
|
13
|
+
label?: string;
|
|
14
|
+
};
|
|
15
|
+
export type AccountAddressBookEditTriggerProps = ComponentPropsWithRef<'button'> & {
|
|
16
|
+
/** The button's visible text. A blank value falls back to the catalog copy. */
|
|
17
|
+
label?: string;
|
|
18
|
+
};
|
|
19
|
+
export type AccountAddressBookFormSlotProps = ComponentPropsWithRef<'div'>;
|
|
20
|
+
export type AccountAddressBookFormDialogProps = Readonly<{
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
/** Goes on the dialog's popup, the one element a store can size and place: the dialog renders in a portal. */
|
|
23
|
+
className?: string;
|
|
24
|
+
/** The dialog's title. A blank value falls back to the catalog copy for the open mode. */
|
|
25
|
+
title?: string;
|
|
26
|
+
}>;
|
|
27
|
+
export declare function AccountAddressBookAddTrigger({ label, className, children, onClick, ...props }: AccountAddressBookAddTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare function AccountAddressBookEditTrigger({ label, className, children, onClick, ...props }: AccountAddressBookEditTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare function AccountAddressBookFormSlot({ children, ...props }: AccountAddressBookFormSlotProps): import("react/jsx-runtime").JSX.Element | null;
|
|
30
|
+
export declare function AccountAddressBookFormDialog({ title, className, children }: AccountAddressBookFormDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare const AccountAddressBookAddTriggerDefinition: ComponentDefinition<AccountAddressBookAddTriggerProps>;
|
|
32
|
+
export declare const AccountAddressBookEditTriggerDefinition: ComponentDefinition<AccountAddressBookEditTriggerProps>;
|
|
33
|
+
export declare const AccountAddressBookFormSlotDefinition: ComponentDefinition<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
|
|
34
|
+
export declare const AccountAddressBookFormDialogDefinition: ComponentDefinition<Readonly<{
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
/** Goes on the dialog's popup, the one element a store can size and place: the dialog renders in a portal. */
|
|
37
|
+
className?: string;
|
|
38
|
+
/** The dialog's title. A blank value falls back to the catalog copy for the open mode. */
|
|
39
|
+
title?: string;
|
|
40
|
+
}>>;
|
|
41
|
+
//#endregion
|
|
42
|
+
//# sourceMappingURL=account-address-book-form-parts.d.ts.map
|
|
@@ -0,0 +1,146 @@
|
|
|
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 { resolveAuthoredCopy } from "../../utils/resolve-authored-copy.js";
|
|
6
|
+
import { Button } from "../../particles/button/button.js";
|
|
7
|
+
import { useAccountAddressBook, useAccountAddressBookItem } from "./account-address-book.js";
|
|
8
|
+
import { firstLine } from "./account-address-first-line.js";
|
|
9
|
+
import { Dialog } from "../../particles/dialog/dialog.js";
|
|
10
|
+
import { createElement } from "react";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
//#region src/matter/account-address-book/account-address-book-form-parts.tsx
|
|
13
|
+
/** A new key starts a new draft: a different address, or an add after an edit. */
|
|
14
|
+
function formKey(form) {
|
|
15
|
+
return form.mode === "edit" ? `edit:${form.address.id}` : "add";
|
|
16
|
+
}
|
|
17
|
+
function AccountAddressBookAddTrigger({ label, className, children, onClick, ...props }) {
|
|
18
|
+
const { open } = useAccountAddressBook();
|
|
19
|
+
const intl = useIntl();
|
|
20
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
21
|
+
...props,
|
|
22
|
+
type: "button",
|
|
23
|
+
className,
|
|
24
|
+
onClick: (event) => {
|
|
25
|
+
onClick?.(event);
|
|
26
|
+
open({ mode: "add" }, event.currentTarget);
|
|
27
|
+
},
|
|
28
|
+
"data-fs-account-address-book-add": "",
|
|
29
|
+
children: children ?? resolveAuthoredCopy(label, intl.formatMessage({ id: "fs/address-form.add" }))
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function AccountAddressBookEditTrigger({ label, className, children, onClick, ...props }) {
|
|
33
|
+
const { open } = useAccountAddressBook();
|
|
34
|
+
const address = useAccountAddressBookItem();
|
|
35
|
+
const intl = useIntl();
|
|
36
|
+
const text = resolveAuthoredCopy(label, intl.formatMessage({ id: "fs/address-form.edit" }));
|
|
37
|
+
const line = firstLine(address);
|
|
38
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
39
|
+
"aria-label": line === "" ? void 0 : `${text} ${line}`,
|
|
40
|
+
...props,
|
|
41
|
+
type: "button",
|
|
42
|
+
className,
|
|
43
|
+
onClick: (event) => {
|
|
44
|
+
onClick?.(event);
|
|
45
|
+
open({
|
|
46
|
+
mode: "edit",
|
|
47
|
+
address
|
|
48
|
+
}, event.currentTarget);
|
|
49
|
+
},
|
|
50
|
+
"data-fs-account-address-book-edit": "",
|
|
51
|
+
children: children ?? text
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function AccountAddressBookFormSlot({ children, ...props }) {
|
|
55
|
+
const { openForm } = useAccountAddressBook();
|
|
56
|
+
if (openForm === null) return null;
|
|
57
|
+
return /* @__PURE__ */ createElement("div", {
|
|
58
|
+
...props,
|
|
59
|
+
key: formKey(openForm),
|
|
60
|
+
"data-fs-account-address-book-form-slot": ""
|
|
61
|
+
}, children);
|
|
62
|
+
}
|
|
63
|
+
function AccountAddressBookFormDialog({ title, className, children }) {
|
|
64
|
+
const { openForm, close, formPending } = useAccountAddressBook();
|
|
65
|
+
const intl = useIntl();
|
|
66
|
+
const defaultTitle = intl.formatMessage({ id: openForm?.mode === "edit" ? "fs/address-form.title.edit" : "fs/address-form.title.add" });
|
|
67
|
+
return /* @__PURE__ */ jsx(Dialog.Root, {
|
|
68
|
+
open: openForm !== null,
|
|
69
|
+
onOpenChange: (next) => {
|
|
70
|
+
if (!next && !formPending) close();
|
|
71
|
+
},
|
|
72
|
+
children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, {}), /* @__PURE__ */ jsx(Dialog.Viewport, { children: /* @__PURE__ */ jsxs(Dialog.Popup, {
|
|
73
|
+
className,
|
|
74
|
+
"data-fs-account-address-book-form-dialog": "",
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ jsx(Dialog.Title, { children: resolveAuthoredCopy(title, defaultTitle) }),
|
|
77
|
+
/* @__PURE__ */ jsx(Dialog.Close, {
|
|
78
|
+
"aria-label": intl.formatMessage({ id: "fs/a11y.close" }),
|
|
79
|
+
children: "×"
|
|
80
|
+
}),
|
|
81
|
+
openForm === null ? null : /* @__PURE__ */ jsx("div", { children }, formKey(openForm))
|
|
82
|
+
]
|
|
83
|
+
}) })] })
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
const AccountAddressBookAddTriggerDefinition = defineComponent({
|
|
87
|
+
name: "AccountAddressBookAddTrigger",
|
|
88
|
+
importPath: "@vtex/faststore/components",
|
|
89
|
+
component: AccountAddressBookAddTrigger,
|
|
90
|
+
requiresContext: "account-address-book",
|
|
91
|
+
editor: {
|
|
92
|
+
label: "Account Address Book Add Trigger",
|
|
93
|
+
category: "action"
|
|
94
|
+
},
|
|
95
|
+
schema: { label: {
|
|
96
|
+
type: "string",
|
|
97
|
+
label: "Button label"
|
|
98
|
+
} },
|
|
99
|
+
guideline: "Opens the address form in add mode. Shown in every state of the book, the empty one included, since that is where a first address is added. Place an AccountAddressBookFormSlot or an AccountAddressBookFormDialog beside it to show the form. Must be inside AccountAddressBookRoot."
|
|
100
|
+
});
|
|
101
|
+
const AccountAddressBookEditTriggerDefinition = defineComponent({
|
|
102
|
+
name: "AccountAddressBookEditTrigger",
|
|
103
|
+
importPath: "@vtex/faststore/components",
|
|
104
|
+
component: AccountAddressBookEditTrigger,
|
|
105
|
+
requiresContext: "account-address-book-item",
|
|
106
|
+
editor: {
|
|
107
|
+
label: "Account Address Book Edit Trigger",
|
|
108
|
+
category: "action"
|
|
109
|
+
},
|
|
110
|
+
schema: { label: {
|
|
111
|
+
type: "string",
|
|
112
|
+
label: "Button label"
|
|
113
|
+
} },
|
|
114
|
+
guideline: "Opens the address form in edit mode for the address of the entry it sits in. Its accessible name adds the address's first line, so a list of them is told apart. Place it inside AccountAddressBookItem, and an AccountAddressBookFormSlot or an AccountAddressBookFormDialog under the root to show the form."
|
|
115
|
+
});
|
|
116
|
+
const AccountAddressBookFormSlotDefinition = defineComponent({
|
|
117
|
+
name: "AccountAddressBookFormSlot",
|
|
118
|
+
importPath: "@vtex/faststore/components",
|
|
119
|
+
component: AccountAddressBookFormSlot,
|
|
120
|
+
requiresContext: "account-address-book",
|
|
121
|
+
editor: {
|
|
122
|
+
label: "Account Address Book Form Slot",
|
|
123
|
+
category: "layout"
|
|
124
|
+
},
|
|
125
|
+
schema: {},
|
|
126
|
+
guideline: "Shows its children, an AccountAddressFormRoot, in place while a form is open, and nothing otherwise. Each open starts a new draft. Use it to open the form inline under the list; use AccountAddressBookFormDialog for an overlay. Must be inside AccountAddressBookRoot."
|
|
127
|
+
});
|
|
128
|
+
const AccountAddressBookFormDialogDefinition = defineComponent({
|
|
129
|
+
name: "AccountAddressBookFormDialog",
|
|
130
|
+
importPath: "@vtex/faststore/components",
|
|
131
|
+
component: AccountAddressBookFormDialog,
|
|
132
|
+
requiresContext: "account-address-book",
|
|
133
|
+
editor: {
|
|
134
|
+
label: "Account Address Book Form Dialog",
|
|
135
|
+
category: "layout"
|
|
136
|
+
},
|
|
137
|
+
schema: { title: {
|
|
138
|
+
type: "string",
|
|
139
|
+
label: "Dialog title"
|
|
140
|
+
} },
|
|
141
|
+
guideline: "Shows its children, an AccountAddressFormRoot, in a modal dialog while a form is open. Escape and the close button cancel the form and drop the draft, and focus returns to the control that opened it. Use AccountAddressBookFormSlot instead to open the form in place. Must be inside AccountAddressBookRoot."
|
|
142
|
+
});
|
|
143
|
+
//#endregion
|
|
144
|
+
export { AccountAddressBookAddTrigger, AccountAddressBookAddTriggerDefinition, AccountAddressBookEditTrigger, AccountAddressBookEditTriggerDefinition, AccountAddressBookFormDialog, AccountAddressBookFormDialogDefinition, AccountAddressBookFormSlot, AccountAddressBookFormSlotDefinition };
|
|
145
|
+
|
|
146
|
+
//# sourceMappingURL=account-address-book-form-parts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-address-book-form-parts.js","names":[],"sources":["../../../src/matter/account-address-book/account-address-book-form-parts.tsx"],"sourcesContent":["'use client';\n\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef, ReactNode } from 'react';\nimport { Button } from '../../particles/button/button.js';\nimport { Dialog } from '../../particles/dialog/dialog.js';\nimport { useIntl } from '../../sdk/i18n/client.js';\nimport { resolveAuthoredCopy } from '../../utils/resolve-authored-copy.js';\nimport {\n type AccountAddressBookOpenForm,\n useAccountAddressBook,\n useAccountAddressBookItem,\n} from './account-address-book.js';\nimport { firstLine } from './account-address-first-line.js';\n\n/**\n * Where the address form opens (specs/sfs-3441-address-book-form.md, RFC REQ-02 and REQ-03). The book's\n * root holds which form is open; these parts read it. A trigger opens a form, and a placement part\n * shows it: `AccountAddressBookFormSlot` in place, `AccountAddressBookFormDialog` in a dialog. A store\n * chooses by composition, and no prop selects a layout.\n */\n\nexport type AccountAddressBookAddTriggerProps = ComponentPropsWithRef<'button'> & {\n /** The button's text. A blank value falls back to the catalog copy. */\n label?: string;\n};\n\nexport type AccountAddressBookEditTriggerProps = ComponentPropsWithRef<'button'> & {\n /** The button's visible text. A blank value falls back to the catalog copy. */\n label?: string;\n};\n\nexport type AccountAddressBookFormSlotProps = ComponentPropsWithRef<'div'>;\n\nexport type AccountAddressBookFormDialogProps = Readonly<{\n children?: ReactNode;\n /** Goes on the dialog's popup, the one element a store can size and place: the dialog renders in a portal. */\n className?: string;\n /** The dialog's title. A blank value falls back to the catalog copy for the open mode. */\n title?: string;\n}>;\n\n/** A new key starts a new draft: a different address, or an add after an edit. */\nfunction formKey(form: AccountAddressBookOpenForm): string {\n return form.mode === 'edit' ? `edit:${form.address.id}` : 'add';\n}\n\nexport function AccountAddressBookAddTrigger({\n label,\n className,\n children,\n onClick,\n ...props\n}: AccountAddressBookAddTriggerProps) {\n const { open } = useAccountAddressBook();\n const intl = useIntl();\n\n return (\n <Button\n {...props}\n type=\"button\"\n className={className}\n onClick={(event) => {\n onClick?.(event);\n open({ mode: 'add' }, event.currentTarget);\n }}\n data-fs-account-address-book-add=\"\"\n >\n {children ?? resolveAuthoredCopy(label, intl.formatMessage({ id: 'fs/address-form.add' }))}\n </Button>\n );\n}\n\nexport function AccountAddressBookEditTrigger({\n label,\n className,\n children,\n onClick,\n ...props\n}: AccountAddressBookEditTriggerProps) {\n const { open } = useAccountAddressBook();\n const address = useAccountAddressBookItem();\n const intl = useIntl();\n const text = resolveAuthoredCopy(label, intl.formatMessage({ id: 'fs/address-form.edit' }));\n const line = firstLine(address);\n\n return (\n <Button\n aria-label={line === '' ? undefined : `${text} ${line}`}\n {...props}\n type=\"button\"\n className={className}\n onClick={(event) => {\n onClick?.(event);\n open({ mode: 'edit', address }, event.currentTarget);\n }}\n data-fs-account-address-book-edit=\"\"\n >\n {children ?? text}\n </Button>\n );\n}\n\nexport function AccountAddressBookFormSlot({ children, ...props }: AccountAddressBookFormSlotProps) {\n const { openForm } = useAccountAddressBook();\n\n if (openForm === null) return null;\n\n return (\n <div {...props} key={formKey(openForm)} data-fs-account-address-book-form-slot=\"\">\n {children}\n </div>\n );\n}\n\nexport function AccountAddressBookFormDialog({ title, className, children }: AccountAddressBookFormDialogProps) {\n const { openForm, close, formPending } = useAccountAddressBook();\n const intl = useIntl();\n const defaultTitle = intl.formatMessage({\n id: openForm?.mode === 'edit' ? 'fs/address-form.title.edit' : 'fs/address-form.title.add',\n });\n\n return (\n <Dialog.Root\n open={openForm !== null}\n onOpenChange={(next) => {\n // A save in flight keeps the form open: its refusal has to land where the shopper can see it.\n if (!next && !formPending) close();\n }}\n >\n <Dialog.Portal>\n <Dialog.Backdrop />\n <Dialog.Viewport>\n <Dialog.Popup className={className} data-fs-account-address-book-form-dialog=\"\">\n <Dialog.Title>{resolveAuthoredCopy(title, defaultTitle)}</Dialog.Title>\n <Dialog.Close aria-label={intl.formatMessage({ id: 'fs/a11y.close' })}>×</Dialog.Close>\n {openForm === null ? null : <div key={formKey(openForm)}>{children}</div>}\n </Dialog.Popup>\n </Dialog.Viewport>\n </Dialog.Portal>\n </Dialog.Root>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Definitions\n// ---------------------------------------------------------------------------\n\nexport const AccountAddressBookAddTriggerDefinition = defineComponent<AccountAddressBookAddTriggerProps>({\n name: 'AccountAddressBookAddTrigger',\n importPath: '@vtex/faststore/components',\n component: AccountAddressBookAddTrigger,\n requiresContext: 'account-address-book',\n editor: { label: 'Account Address Book Add Trigger', category: 'action' },\n schema: {\n label: { type: 'string', label: 'Button label' },\n },\n guideline:\n 'Opens the address form in add mode. Shown in every state of the book, the empty one included, since that is where a first address is added. Place an AccountAddressBookFormSlot or an AccountAddressBookFormDialog beside it to show the form. Must be inside AccountAddressBookRoot.',\n});\n\nexport const AccountAddressBookEditTriggerDefinition = defineComponent<AccountAddressBookEditTriggerProps>({\n name: 'AccountAddressBookEditTrigger',\n importPath: '@vtex/faststore/components',\n component: AccountAddressBookEditTrigger,\n requiresContext: 'account-address-book-item',\n editor: { label: 'Account Address Book Edit Trigger', category: 'action' },\n schema: {\n label: { type: 'string', label: 'Button label' },\n },\n guideline:\n \"Opens the address form in edit mode for the address of the entry it sits in. Its accessible name adds the address's first line, so a list of them is told apart. Place it inside AccountAddressBookItem, and an AccountAddressBookFormSlot or an AccountAddressBookFormDialog under the root to show the form.\",\n});\n\nexport const AccountAddressBookFormSlotDefinition = defineComponent<AccountAddressBookFormSlotProps>({\n name: 'AccountAddressBookFormSlot',\n importPath: '@vtex/faststore/components',\n component: AccountAddressBookFormSlot,\n requiresContext: 'account-address-book',\n editor: { label: 'Account Address Book Form Slot', category: 'layout' },\n schema: {},\n guideline:\n 'Shows its children, an AccountAddressFormRoot, in place while a form is open, and nothing otherwise. Each open starts a new draft. Use it to open the form inline under the list; use AccountAddressBookFormDialog for an overlay. Must be inside AccountAddressBookRoot.',\n});\n\nexport const AccountAddressBookFormDialogDefinition = defineComponent<AccountAddressBookFormDialogProps>({\n name: 'AccountAddressBookFormDialog',\n importPath: '@vtex/faststore/components',\n component: AccountAddressBookFormDialog,\n requiresContext: 'account-address-book',\n editor: { label: 'Account Address Book Form Dialog', category: 'layout' },\n schema: {\n title: { type: 'string', label: 'Dialog title' },\n },\n guideline:\n 'Shows its children, an AccountAddressFormRoot, in a modal dialog while a form is open. Escape and the close button cancel the form and drop the draft, and focus returns to the control that opened it. Use AccountAddressBookFormSlot instead to open the form in place. Must be inside AccountAddressBookRoot.',\n});\n"],"mappings":";;;;;;;;;;;;;AA2CA,SAAS,QAAQ,MAA0C;CACzD,OAAO,KAAK,SAAS,SAAS,QAAQ,KAAK,QAAQ,OAAO;AAC5D;AAEA,SAAgB,6BAA6B,EAC3C,OACA,WACA,UACA,SACA,GAAG,SACiC;CACpC,MAAM,EAAE,SAAS,sBAAsB;CACvC,MAAM,OAAO,QAAQ;CAErB,OACE,oBAAC,QAAD;EACE,GAAI;EACJ,MAAK;EACM;EACX,UAAU,UAAU;GAClB,UAAU,KAAK;GACf,KAAK,EAAE,MAAM,MAAM,GAAG,MAAM,aAAa;EAC3C;EACA,oCAAiC;EAEhC,UAAA,YAAY,oBAAoB,OAAO,KAAK,cAAc,EAAE,IAAI,sBAAsB,CAAC,CAAC;CACnF,CAAA;AAEZ;AAEA,SAAgB,8BAA8B,EAC5C,OACA,WACA,UACA,SACA,GAAG,SACkC;CACrC,MAAM,EAAE,SAAS,sBAAsB;CACvC,MAAM,UAAU,0BAA0B;CAC1C,MAAM,OAAO,QAAQ;CACrB,MAAM,OAAO,oBAAoB,OAAO,KAAK,cAAc,EAAE,IAAI,uBAAuB,CAAC,CAAC;CAC1F,MAAM,OAAO,UAAU,OAAO;CAE9B,OACE,oBAAC,QAAD;EACE,cAAY,SAAS,KAAK,KAAA,IAAY,GAAG,KAAK,GAAG;EACjD,GAAI;EACJ,MAAK;EACM;EACX,UAAU,UAAU;GAClB,UAAU,KAAK;GACf,KAAK;IAAE,MAAM;IAAQ;GAAQ,GAAG,MAAM,aAAa;EACrD;EACA,qCAAkC;EAEjC,UAAA,YAAY;CACP,CAAA;AAEZ;AAEA,SAAgB,2BAA2B,EAAE,UAAU,GAAG,SAA0C;CAClG,MAAM,EAAE,aAAa,sBAAsB;CAE3C,IAAI,aAAa,MAAM,OAAO;CAE9B,OACE,8BAAC,OAAD;EAAK,GAAI;EAAO,KAAK,QAAQ,QAAQ;EAAG,0CAAuC;CAE1E,GADF,QACE;AAET;AAEA,SAAgB,6BAA6B,EAAE,OAAO,WAAW,YAA+C;CAC9G,MAAM,EAAE,UAAU,OAAO,gBAAgB,sBAAsB;CAC/D,MAAM,OAAO,QAAQ;CACrB,MAAM,eAAe,KAAK,cAAc,EACtC,IAAI,UAAU,SAAS,SAAS,+BAA+B,4BACjE,CAAC;CAED,OACE,oBAAC,OAAO,MAAR;EACE,MAAM,aAAa;EACnB,eAAe,SAAS;GAEtB,IAAI,CAAC,QAAQ,CAAC,aAAa,MAAM;EACnC;EAEA,UAAA,qBAAC,OAAO,QAAR,EAAA,UAAA,CACE,oBAAC,OAAO,UAAR,CAAkB,CAAA,GAClB,oBAAC,OAAO,UAAR,EAAA,UACE,qBAAC,OAAO,OAAR;GAAyB;GAAW,4CAAyC;GAA7E,UAAA;IACE,oBAAC,OAAO,OAAR,EAAA,UAAe,oBAAoB,OAAO,YAAY,EAAgB,CAAA;IACtE,oBAAC,OAAO,OAAR;KAAc,cAAY,KAAK,cAAc,EAAE,IAAI,gBAAgB,CAAC;KAAG,UAAA;IAAe,CAAA;IACrF,aAAa,OAAO,OAAO,oBAAC,OAAD,EAA8B,SAAc,GAAlC,QAAQ,QAAQ,CAAkB;GAC5D;EACC,CAAA,EAAA,CAAA,CACJ,EAAA,CAAA;CACJ,CAAA;AAEjB;AAMA,MAAa,yCAAyC,gBAAmD;CACvG,MAAM;CACN,YAAY;CACZ,WAAW;CACX,iBAAiB;CACjB,QAAQ;EAAE,OAAO;EAAoC,UAAU;CAAS;CACxE,QAAQ,EACN,OAAO;EAAE,MAAM;EAAU,OAAO;CAAe,EACjD;CACA,WACE;AACJ,CAAC;AAED,MAAa,0CAA0C,gBAAoD;CACzG,MAAM;CACN,YAAY;CACZ,WAAW;CACX,iBAAiB;CACjB,QAAQ;EAAE,OAAO;EAAqC,UAAU;CAAS;CACzE,QAAQ,EACN,OAAO;EAAE,MAAM;EAAU,OAAO;CAAe,EACjD;CACA,WACE;AACJ,CAAC;AAED,MAAa,uCAAuC,gBAAiD;CACnG,MAAM;CACN,YAAY;CACZ,WAAW;CACX,iBAAiB;CACjB,QAAQ;EAAE,OAAO;EAAkC,UAAU;CAAS;CACtE,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,yCAAyC,gBAAmD;CACvG,MAAM;CACN,YAAY;CACZ,WAAW;CACX,iBAAiB;CACjB,QAAQ;EAAE,OAAO;EAAoC,UAAU;CAAS;CACxE,QAAQ,EACN,OAAO;EAAE,MAAM;EAAU,OAAO;CAAe,EACjD;CACA,WACE;AACJ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentDefinition } from "../../core/dist/define-component.js";
|
|
2
|
+
import "../../core/dist/index.js";
|
|
3
|
+
import { PageRef } from "../../sdk/navigation/types.js";
|
|
4
|
+
import { ComponentPropsWithRef } from "react";
|
|
5
|
+
//#region src/matter/account-address-book/account-address-book-profile-notice.d.ts
|
|
6
|
+
/** The profile fields the notice reads. */
|
|
7
|
+
export type AccountAddressBookProfileNoticeSlice = Readonly<{
|
|
8
|
+
__typename?: 'CustomerProfile';
|
|
9
|
+
id: string;
|
|
10
|
+
homePhone?: string | null;
|
|
11
|
+
}>;
|
|
12
|
+
export type AccountAddressBookProfileNoticeProps = ComponentPropsWithRef<'div'> & {
|
|
13
|
+
/** Unwrapped `customerProfile` from the reactive runtime (arity-1 fragment); `null` until resolved. */
|
|
14
|
+
$data?: AccountAddressBookProfileNoticeSlice | null;
|
|
15
|
+
/** Where the link goes. A blank value falls back to the default. */
|
|
16
|
+
href?: PageRef | string;
|
|
17
|
+
/** The notice text. A blank value falls back to the catalog copy. */
|
|
18
|
+
message?: string;
|
|
19
|
+
/** The link's label. A blank value falls back to the catalog copy. */
|
|
20
|
+
linkLabel?: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const AccountAddressBookProfileNoticeDefinition: ComponentDefinition<AccountAddressBookProfileNoticeProps>;
|
|
23
|
+
export declare function AccountAddressBookProfileNotice({ $data: $dataProp, href, message, linkLabel, className, ...props }: AccountAddressBookProfileNoticeProps): import("react/jsx-runtime").JSX.Element | null;
|
|
24
|
+
//#endregion
|
|
25
|
+
//# sourceMappingURL=account-address-book-profile-notice.d.ts.map
|
|
@@ -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
|