@vtex/faststore 0.0.10 → 0.0.11
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 +42 -0
- package/README.md +0 -1
- package/dist/actions.json +6 -1
- package/dist/catalog.json +789 -1701
- package/dist/cli/index.d.ts +66 -28
- package/dist/cli/index.js +7371 -512
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/server-runtime.js +41 -60
- package/dist/cli/server-runtime.js.map +1 -1
- package/dist/client.d.ts +3 -3
- package/dist/client.js +2 -2
- package/dist/components.d.ts +63 -57
- package/dist/components.js +60 -54
- package/dist/content-types.json +5785 -754
- package/dist/core/dist/define-component.d.ts +1 -1
- package/dist/core/dist/define-content-type.d.ts +50 -2
- package/dist/core/dist/define-content-type.js +107 -3
- package/dist/core/dist/define-content-type.js.map +1 -1
- package/dist/core/dist/index.d.ts +2 -2
- package/dist/docs/access-code-field.md +1 -1
- package/dist/docs/access-code-sign-in.md +126 -77
- package/dist/docs/account-address-book.md +210 -95
- package/dist/docs/account-menu.md +14 -15
- package/dist/docs/account-saved-cards.md +44 -39
- package/dist/docs/alert-dialog.md +3 -1
- package/dist/docs/avatar.md +4 -2
- package/dist/docs/billing-address.md +99 -30
- package/dist/docs/binding-switcher.md +5 -2
- package/dist/docs/buy-button.md +7 -8
- package/dist/docs/card-entry.md +39 -26
- package/dist/docs/card-summary.md +18 -8
- package/dist/docs/cardholder-document.md +5 -3
- package/dist/docs/carousel.md +5 -4
- package/dist/docs/cart-destination.md +39 -26
- package/dist/docs/cart-item.md +29 -14
- package/dist/docs/cart-totalizer.md +7 -5
- package/dist/docs/cart.md +135 -41
- package/dist/docs/challenge-return.md +135 -0
- package/dist/docs/client-preferences-fieldset.md +10 -5
- package/dist/docs/client-preferences.md +31 -8
- package/dist/docs/client-profile-fieldset.md +20 -6
- package/dist/docs/client-profile.md +12 -3
- package/dist/docs/copy-text.md +9 -7
- package/dist/docs/document-field.md +1 -1
- package/dist/docs/email-field.md +2 -1
- package/dist/docs/email-identification.md +12 -2
- package/dist/docs/footer-copyright.md +4 -2
- package/dist/docs/form.md +54 -18
- package/dist/docs/free-shipping-progress.md +6 -5
- package/dist/docs/identity-edit.md +8 -2
- package/dist/docs/identity-summary.md +18 -5
- package/dist/docs/installments.md +46 -32
- package/dist/docs/my-account-profile.md +16 -11
- package/dist/docs/navigation-link.md +5 -3
- package/dist/docs/order-cancel.md +3 -1
- package/dist/docs/order-delivery-address.md +7 -5
- package/dist/docs/order-delivery-group.md +1 -3
- package/dist/docs/order-details-back.md +1 -1
- package/dist/docs/order-details-header.md +1 -4
- package/dist/docs/order-invoice-download.md +60 -0
- package/dist/docs/order-list-row.md +1 -1
- package/dist/docs/order-list-search.md +13 -20
- package/dist/docs/order-list-views.md +11 -17
- package/dist/docs/order-list.md +12 -5
- package/dist/docs/order-payment.md +9 -7
- package/dist/docs/order-placed-date.md +1 -1
- package/dist/docs/order-placed-payment-summary.md +28 -15
- package/dist/docs/order-placed.md +49 -14
- package/dist/docs/order-progress.md +1 -1
- package/dist/docs/order-status-badge.md +20 -9
- package/dist/docs/order-summary.md +2 -2
- package/dist/docs/order-tracking-link.md +58 -0
- package/dist/docs/payment-method-badges.md +30 -4
- package/dist/docs/payment-methods.md +1 -1
- package/dist/docs/payment.md +36 -17
- package/dist/docs/phone-field.md +4 -4
- package/dist/docs/place-order.md +84 -36
- package/dist/docs/postal-code-field.md +3 -1
- package/dist/docs/pricing.md +21 -23
- package/dist/docs/product-gallery.md +19 -20
- package/dist/docs/product-information.md +13 -9
- package/dist/docs/product-list.md +7 -6
- package/dist/docs/product-shelf.md +0 -1
- package/dist/docs/promotion.md +4 -2
- package/dist/docs/region.md +23 -15
- package/dist/docs/save-card.md +7 -6
- package/dist/docs/saved-cards.md +65 -36
- package/dist/docs/shipping-address.md +57 -21
- package/dist/docs/shipping-simulator.md +53 -15
- package/dist/docs/sign-in-disclosure.md +176 -0
- package/dist/docs/sign-in-form.md +78 -47
- package/dist/docs/sign-in-redirect.md +4 -2
- package/dist/docs/sign-in.md +173 -0
- package/dist/docs/toast.md +15 -4
- package/dist/docs/variant-selector.md +15 -11
- package/dist/graphql/types.d.ts +4 -14
- package/dist/index.d.ts +2 -2
- package/dist/internal/client.d.ts +1 -3
- package/dist/internal/client.js +1 -1
- package/dist/internal/server.d.ts +7 -4
- package/dist/internal/server.js +7 -4
- package/dist/matter/access-code-sign-in/access-code-sign-in.d.ts +250 -66
- package/dist/matter/access-code-sign-in/access-code-sign-in.js +459 -188
- package/dist/matter/access-code-sign-in/access-code-sign-in.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-delete.d.ts +78 -40
- package/dist/matter/account-address-book/account-address-book-delete.js +86 -50
- package/dist/matter/account-address-book/account-address-book-delete.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-deliverability.d.ts +21 -4
- package/dist/matter/account-address-book/account-address-book-deliverability.js +45 -17
- package/dist/matter/account-address-book/account-address-book-deliverability.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-form-parts.d.ts +74 -19
- package/dist/matter/account-address-book/account-address-book-form-parts.js +77 -26
- package/dist/matter/account-address-book/account-address-book-form-parts.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-profile-notice.d.ts +27 -6
- package/dist/matter/account-address-book/account-address-book-profile-notice.js +55 -28
- package/dist/matter/account-address-book/account-address-book-profile-notice.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book.d.ts +67 -14
- package/dist/matter/account-address-book/account-address-book.js +74 -33
- package/dist/matter/account-address-book/account-address-book.js.map +1 -1
- package/dist/matter/account-address-book/account-address-country-switch.js +3 -3
- package/dist/matter/account-address-book/account-address-country-switch.js.map +1 -1
- package/dist/matter/account-address-book/account-address-country.d.ts +66 -20
- package/dist/matter/account-address-book/account-address-country.js +83 -49
- package/dist/matter/account-address-book/account-address-country.js.map +1 -1
- package/dist/matter/account-address-book/account-address-form-context.d.ts +8 -4
- package/dist/matter/account-address-book/account-address-form-context.js.map +1 -1
- package/dist/matter/account-address-book/account-address-form.d.ts +468 -45
- package/dist/matter/account-address-book/account-address-form.js +518 -155
- package/dist/matter/account-address-book/account-address-form.js.map +1 -1
- package/dist/matter/account-address-book/account-address-record.d.ts +27 -6
- package/dist/matter/account-address-book/account-address-record.js +32 -17
- package/dist/matter/account-address-book/account-address-record.js.map +1 -1
- package/dist/matter/account-menu/account-menu.d.ts +34 -17
- package/dist/matter/account-menu/account-menu.js +46 -54
- package/dist/matter/account-menu/account-menu.js.map +1 -1
- package/dist/matter/account-menu-identity/account-menu-identity.js +1 -1
- package/dist/matter/account-saved-cards/account-saved-cards.d.ts +108 -28
- package/dist/matter/account-saved-cards/account-saved-cards.js +177 -122
- package/dist/matter/account-saved-cards/account-saved-cards.js.map +1 -1
- package/dist/matter/billing-address/billing-address.d.ts +156 -74
- package/dist/matter/billing-address/billing-address.js +227 -156
- package/dist/matter/billing-address/billing-address.js.map +1 -1
- package/dist/matter/breadcrumb/breadcrumb.d.ts +21 -3
- package/dist/matter/breadcrumb/breadcrumb.js +24 -9
- package/dist/matter/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/matter/buy-button/buy-button.d.ts +8 -11
- package/dist/matter/buy-button/buy-button.js +10 -19
- package/dist/matter/buy-button/buy-button.js.map +1 -1
- package/dist/matter/card-entry/card-capture.js +12 -4
- package/dist/matter/card-entry/card-capture.js.map +1 -1
- package/dist/matter/card-entry/card-entry.d.ts +123 -32
- package/dist/matter/card-entry/card-entry.js +348 -221
- package/dist/matter/card-entry/card-entry.js.map +1 -1
- package/dist/matter/cart/cart-namespace.d.ts +7 -1
- package/dist/matter/cart/cart-namespace.js +7 -1
- package/dist/matter/cart/cart-namespace.js.map +1 -1
- package/dist/matter/cart/cart.d.ts +402 -61
- package/dist/matter/cart/cart.js +624 -153
- package/dist/matter/cart/cart.js.map +1 -1
- package/dist/matter/cart-destination/cart-destination.d.ts +30 -19
- package/dist/matter/cart-destination/cart-destination.js +160 -70
- package/dist/matter/cart-destination/cart-destination.js.map +1 -1
- package/dist/matter/cart-item/cart-item.d.ts +144 -17
- package/dist/matter/cart-item/cart-item.js +166 -49
- package/dist/matter/cart-item/cart-item.js.map +1 -1
- package/dist/matter/cart-item-compositions/cart-item-compositions.js +1 -1
- package/dist/matter/cart-item-compositions/cart-item-compositions.js.map +1 -1
- package/dist/matter/cart-item-customizations/cart-item-customizations.js +1 -1
- package/dist/matter/cart-item-customizations/cart-item-customizations.js.map +1 -1
- package/dist/matter/cart-item-discounts/cart-item-discounts.js +1 -1
- package/dist/matter/cart-item-discounts/cart-item-discounts.js.map +1 -1
- package/dist/matter/cart-item-seller-info/cart-item-seller-info.js +1 -1
- package/dist/matter/cart-item-seller-info/cart-item-seller-info.js.map +1 -1
- package/dist/matter/cart-item-variations/cart-item-variations.js +1 -1
- package/dist/matter/cart-item-variations/cart-item-variations.js.map +1 -1
- package/dist/matter/cart-totalizer/cart-totalizer.d.ts +43 -9
- package/dist/matter/cart-totalizer/cart-totalizer.js +46 -17
- package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -1
- package/dist/matter/challenge-return/challenge-return.d.ts +62 -0
- package/dist/matter/challenge-return/challenge-return.js +241 -0
- package/dist/matter/challenge-return/challenge-return.js.map +1 -0
- package/dist/matter/client-preferences/client-preferences-fieldset.d.ts +86 -17
- package/dist/matter/client-preferences/client-preferences-fieldset.js +126 -54
- package/dist/matter/client-preferences/client-preferences-fieldset.js.map +1 -1
- package/dist/matter/client-preferences/client-preferences.d.ts +50 -7
- package/dist/matter/client-preferences/client-preferences.js +84 -15
- package/dist/matter/client-preferences/client-preferences.js.map +1 -1
- package/dist/matter/client-profile/client-profile.d.ts +44 -9
- package/dist/matter/client-profile/client-profile.js +64 -24
- package/dist/matter/client-profile/client-profile.js.map +1 -1
- package/dist/matter/client-profile-form/client-profile-fieldset.d.ts +119 -22
- package/dist/matter/client-profile-form/client-profile-fieldset.js +161 -73
- package/dist/matter/client-profile-form/client-profile-fieldset.js.map +1 -1
- package/dist/matter/delivery-options/delivery-options-accordion.d.ts +49 -4
- package/dist/matter/delivery-options/delivery-options-accordion.js +67 -14
- package/dist/matter/delivery-options/delivery-options-accordion.js.map +1 -1
- package/dist/matter/delivery-options/delivery-options-controller.d.ts +69 -9
- package/dist/matter/delivery-options/delivery-options-controller.js +80 -14
- package/dist/matter/delivery-options/delivery-options-controller.js.map +1 -1
- package/dist/matter/delivery-options/delivery-options.d.ts +37 -2
- package/dist/matter/delivery-options/delivery-options.js +75 -12
- package/dist/matter/delivery-options/delivery-options.js.map +1 -1
- package/dist/matter/delivery-options/use-delivery-option-selection.d.ts +1 -0
- package/dist/matter/delivery-options/use-delivery-option-selection.js +1 -1
- package/dist/matter/delivery-options/use-delivery-option-selection.js.map +1 -1
- package/dist/matter/email-identification/email-identification.d.ts +25 -3
- package/dist/matter/email-identification/email-identification.js +49 -12
- package/dist/matter/email-identification/email-identification.js.map +1 -1
- package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +79 -7
- package/dist/matter/free-shipping-progress/free-shipping-progress.js +77 -20
- package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -1
- package/dist/matter/identity-edit/identity-edit.d.ts +52 -10
- package/dist/matter/identity-edit/identity-edit.js +47 -19
- package/dist/matter/identity-edit/identity-edit.js.map +1 -1
- package/dist/matter/identity-summary/identity-summary.d.ts +76 -22
- package/dist/matter/identity-summary/identity-summary.js +95 -45
- package/dist/matter/identity-summary/identity-summary.js.map +1 -1
- package/dist/matter/installments/installments-select.d.ts +98 -16
- package/dist/matter/installments/installments-select.js +156 -48
- package/dist/matter/installments/installments-select.js.map +1 -1
- package/dist/matter/installments/installments.d.ts +96 -16
- package/dist/matter/installments/installments.js +115 -40
- package/dist/matter/installments/installments.js.map +1 -1
- package/dist/matter/installments/use-installments-selection.d.ts +1 -0
- package/dist/matter/installments/use-installments-selection.js +8 -3
- package/dist/matter/installments/use-installments-selection.js.map +1 -1
- package/dist/matter/my-account-profile/my-account-profile.d.ts +358 -103
- package/dist/matter/my-account-profile/my-account-profile.js +370 -174
- package/dist/matter/my-account-profile/my-account-profile.js.map +1 -1
- package/dist/matter/order-cancel/order-cancel.d.ts +65 -19
- package/dist/matter/order-cancel/order-cancel.js +118 -51
- package/dist/matter/order-cancel/order-cancel.js.map +1 -1
- package/dist/matter/order-delivery-address/order-delivery-address.d.ts +8 -18
- package/dist/matter/order-delivery-address/order-delivery-address.js +14 -23
- package/dist/matter/order-delivery-address/order-delivery-address.js.map +1 -1
- package/dist/matter/order-delivery-group/order-delivery-group.d.ts +40 -24
- package/dist/matter/order-delivery-group/order-delivery-group.js +64 -74
- package/dist/matter/order-delivery-group/order-delivery-group.js.map +1 -1
- package/dist/matter/order-details-header/order-details-header.d.ts +32 -15
- package/dist/matter/order-details-header/order-details-header.js +66 -58
- package/dist/matter/order-details-header/order-details-header.js.map +1 -1
- package/dist/matter/order-invoice-download/order-invoice-download.d.ts +78 -0
- package/dist/matter/order-invoice-download/order-invoice-download.js +173 -0
- package/dist/matter/order-invoice-download/order-invoice-download.js.map +1 -0
- package/dist/matter/order-list/order-list.d.ts +164 -19
- package/dist/matter/order-list/order-list.js +229 -87
- package/dist/matter/order-list/order-list.js.map +1 -1
- package/dist/matter/order-list-row/order-list-row.d.ts +6 -1
- package/dist/matter/order-list-row/order-list-row.js +3 -2
- package/dist/matter/order-list-row/order-list-row.js.map +1 -1
- package/dist/matter/order-list-search/order-list-search.d.ts +18 -26
- package/dist/matter/order-list-search/order-list-search.js +30 -69
- package/dist/matter/order-list-search/order-list-search.js.map +1 -1
- package/dist/matter/order-list-views/order-list-views.d.ts +15 -22
- package/dist/matter/order-list-views/order-list-views.js +22 -68
- package/dist/matter/order-list-views/order-list-views.js.map +1 -1
- package/dist/matter/order-payment/order-payment.d.ts +33 -10
- package/dist/matter/order-payment/order-payment.js +44 -39
- package/dist/matter/order-payment/order-payment.js.map +1 -1
- package/dist/matter/order-placed/order-placed-deliveries.d.ts +144 -12
- package/dist/matter/order-placed/order-placed-deliveries.js +115 -40
- package/dist/matter/order-placed/order-placed-deliveries.js.map +1 -1
- package/dist/matter/order-placed/order-placed.d.ts +198 -31
- package/dist/matter/order-placed/order-placed.js +230 -139
- package/dist/matter/order-placed/order-placed.js.map +1 -1
- package/dist/matter/order-placed-date/order-placed-date.d.ts +5 -8
- package/dist/matter/order-placed-date/order-placed-date.js +7 -8
- package/dist/matter/order-placed-date/order-placed-date.js.map +1 -1
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.d.ts +90 -17
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js +93 -117
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js.map +1 -1
- package/dist/matter/order-progress/order-progress.d.ts +19 -8
- package/dist/matter/order-progress/order-progress.js +37 -45
- package/dist/matter/order-progress/order-progress.js.map +1 -1
- package/dist/matter/order-summary/order-summary.d.ts +19 -9
- package/dist/matter/order-summary/order-summary.js +38 -44
- package/dist/matter/order-summary/order-summary.js.map +1 -1
- package/dist/matter/order-tracking-link/order-tracking-link.d.ts +43 -0
- package/dist/matter/order-tracking-link/order-tracking-link.js +107 -0
- package/dist/matter/order-tracking-link/order-tracking-link.js.map +1 -0
- package/dist/matter/payment/payment-card-capture.js +17 -10
- package/dist/matter/payment/payment-card-capture.js.map +1 -1
- package/dist/matter/payment/payment-controller.d.ts +4 -2
- package/dist/matter/payment/payment-controller.js +30 -9
- package/dist/matter/payment/payment-controller.js.map +1 -1
- package/dist/matter/payment/payment-method-badges.js +1 -1
- package/dist/matter/payment/payment.d.ts +69 -19
- package/dist/matter/payment/payment.js +101 -35
- package/dist/matter/payment/payment.js.map +1 -1
- package/dist/matter/payment/use-payment-method-selection.d.ts +25 -4
- package/dist/matter/payment/use-payment-method-selection.js +94 -32
- package/dist/matter/payment/use-payment-method-selection.js.map +1 -1
- package/dist/matter/payment/use-payment-submit-gate.d.ts +14 -3
- package/dist/matter/payment/use-payment-submit-gate.js +47 -8
- package/dist/matter/payment/use-payment-submit-gate.js.map +1 -1
- package/dist/matter/place-order/place-order.d.ts +171 -57
- package/dist/matter/place-order/place-order.js +376 -185
- package/dist/matter/place-order/place-order.js.map +1 -1
- package/dist/matter/pricing/pricing.d.ts +152 -13
- package/dist/matter/pricing/pricing.js +153 -52
- package/dist/matter/pricing/pricing.js.map +1 -1
- package/dist/matter/product-information/product-information.d.ts +27 -4
- package/dist/matter/product-information/product-information.js +32 -15
- package/dist/matter/product-information/product-information.js.map +1 -1
- package/dist/matter/product-list/product-list.d.ts +24 -6
- package/dist/matter/product-list/product-list.js +32 -26
- package/dist/matter/product-list/product-list.js.map +1 -1
- package/dist/matter/product-shelf/product-shelf.d.ts +1 -3
- package/dist/matter/product-shelf/product-shelf.js +2 -15
- package/dist/matter/product-shelf/product-shelf.js.map +1 -1
- package/dist/matter/region/region.d.ts +33 -16
- package/dist/matter/region/region.js +59 -52
- package/dist/matter/region/region.js.map +1 -1
- package/dist/matter/save-card/save-card.d.ts +43 -8
- package/dist/matter/save-card/save-card.js +61 -23
- package/dist/matter/save-card/save-card.js.map +1 -1
- package/dist/matter/saved-cards/saved-cards.d.ts +113 -21
- package/dist/matter/saved-cards/saved-cards.js +349 -77
- package/dist/matter/saved-cards/saved-cards.js.map +1 -1
- package/dist/matter/shipping-address/address-payload.js +25 -0
- package/dist/matter/shipping-address/address-payload.js.map +1 -0
- package/dist/matter/shipping-address/country-descriptors.js +71 -71
- package/dist/matter/shipping-address/country-descriptors.js.map +1 -1
- package/dist/matter/shipping-address/library-country-descriptors.js +136 -0
- package/dist/matter/shipping-address/library-country-descriptors.js.map +1 -0
- package/dist/matter/shipping-address/shipping-address.d.ts +312 -45
- package/dist/matter/shipping-address/shipping-address.js +443 -188
- package/dist/matter/shipping-address/shipping-address.js.map +1 -1
- package/dist/matter/shipping-simulator/shipping-simulator.d.ts +250 -24
- package/dist/matter/shipping-simulator/shipping-simulator.js +257 -51
- package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
- package/dist/matter/sign-in/sign-in.d.ts +108 -0
- package/dist/matter/sign-in/sign-in.js +285 -0
- package/dist/matter/sign-in/sign-in.js.map +1 -0
- package/dist/matter/sign-in-disclosure/sign-in-disclosure.d.ts +81 -0
- package/dist/matter/sign-in-disclosure/sign-in-disclosure.js +232 -0
- package/dist/matter/sign-in-disclosure/sign-in-disclosure.js.map +1 -0
- package/dist/matter/sign-in-form/sign-in-form.d.ts +93 -62
- package/dist/matter/sign-in-form/sign-in-form.js +134 -144
- package/dist/matter/sign-in-form/sign-in-form.js.map +1 -1
- package/dist/particles/binding-switcher/binding-switcher.d.ts +29 -8
- package/dist/particles/binding-switcher/binding-switcher.js +37 -26
- package/dist/particles/binding-switcher/binding-switcher.js.map +1 -1
- package/dist/particles/card-summary/card-summary.d.ts +38 -8
- package/dist/particles/card-summary/card-summary.js +55 -22
- package/dist/particles/card-summary/card-summary.js.map +1 -1
- package/dist/particles/carousel/carousel.d.ts +99 -11
- package/dist/particles/carousel/carousel.js +103 -35
- package/dist/particles/carousel/carousel.js.map +1 -1
- package/dist/particles/copy-text/copy-text.js +5 -15
- package/dist/particles/copy-text/copy-text.js.map +1 -1
- package/dist/particles/dialog/dialog.d.ts +14 -6
- package/dist/particles/dialog/dialog.js +6 -3
- package/dist/particles/dialog/dialog.js.map +1 -1
- package/dist/particles/drawer/drawer.js +1 -1
- package/dist/particles/drawer/drawer.js.map +1 -1
- package/dist/particles/email-field/email-field.d.ts +2 -1
- package/dist/particles/email-field/email-field.js +2 -1
- package/dist/particles/email-field/email-field.js.map +1 -1
- package/dist/particles/footer-link-group/footer-link-group.js +1 -0
- package/dist/particles/footer-link-group/footer-link-group.js.map +1 -1
- package/dist/particles/form/form.d.ts +85 -13
- package/dist/particles/form/form.js +91 -42
- package/dist/particles/form/form.js.map +1 -1
- package/dist/particles/gallery/gallery.d.ts +129 -12
- package/dist/particles/gallery/gallery.js +121 -34
- package/dist/particles/gallery/gallery.js.map +1 -1
- package/dist/particles/order-details-back/order-details-back.d.ts +5 -3
- package/dist/particles/order-details-back/order-details-back.js +8 -10
- package/dist/particles/order-details-back/order-details-back.js.map +1 -1
- package/dist/particles/order-status-badge/order-status-badge.d.ts +3 -3
- package/dist/particles/order-status-badge/order-status-badge.js +4 -20
- package/dist/particles/order-status-badge/order-status-badge.js.map +1 -1
- package/dist/particles/password-field/password-field.d.ts +1 -1
- package/dist/particles/password-field/password-field.js +2 -4
- package/dist/particles/password-field/password-field.js.map +1 -1
- package/dist/particles/phone-field/phone-field.d.ts +4 -4
- package/dist/particles/phone-field/phone-field.js +8 -11
- package/dist/particles/phone-field/phone-field.js.map +1 -1
- package/dist/particles/spinner/spinner.d.ts +24 -4
- package/dist/particles/spinner/spinner.js +25 -9
- package/dist/particles/spinner/spinner.js.map +1 -1
- package/dist/particles/switch/switch.d.ts +4 -1
- package/dist/particles/switch/switch.js +3 -1
- package/dist/particles/switch/switch.js.map +1 -1
- package/dist/particles/toast/toast.d.ts +29 -3
- package/dist/particles/toast/toast.js +34 -10
- package/dist/particles/toast/toast.js.map +1 -1
- package/dist/schema.graphql +164 -56
- package/dist/sdk/address/address-fields.js +4 -4
- package/dist/sdk/address/address-fields.js.map +1 -1
- package/dist/sdk/address/constants.js +1 -6
- package/dist/sdk/address/constants.js.map +1 -1
- package/dist/sdk/address/messages.js +44 -44
- package/dist/sdk/address/messages.js.map +1 -1
- package/dist/sdk/address/postal-code.js +15 -2
- package/dist/sdk/address/postal-code.js.map +1 -1
- package/dist/sdk/address/types.d.ts +5 -3
- package/dist/sdk/address/validate-address.js +3 -3
- package/dist/sdk/address/validate-address.js.map +1 -1
- package/dist/sdk/analytics/use-analytics-actions.d.ts +1 -1
- package/dist/sdk/analytics/use-analytics-actions.js.map +1 -1
- package/dist/sdk/cart/use-cart-actions.js.map +1 -1
- package/dist/sdk/data/index.js +2 -2
- package/dist/sdk/data/reactive-list-item-data-provider.js +2 -2
- package/dist/sdk/generated/gql.js +1 -1
- package/dist/sdk/generated/gql.js.map +1 -1
- package/dist/sdk/generated/graphql.d.ts +20 -5
- package/dist/sdk/generated/graphql.js +6 -0
- package/dist/sdk/generated/graphql.js.map +1 -1
- package/dist/sdk/i18n/format-error-code.js +23 -0
- package/dist/sdk/i18n/format-error-code.js.map +1 -0
- package/dist/sdk/i18n/message-formatter.d.ts +22 -0
- package/dist/sdk/i18n/message-formatter.js +140 -0
- package/dist/sdk/i18n/message-formatter.js.map +1 -0
- package/dist/sdk/i18n/use-message-formatter.d.ts +8 -0
- package/dist/sdk/i18n/use-message-formatter.js +18 -0
- package/dist/sdk/i18n/use-message-formatter.js.map +1 -0
- package/dist/sdk/identity/use-identity-actions.js.map +1 -1
- package/dist/sdk/navigation/redirect.d.ts +2 -0
- package/dist/sdk/navigation/redirect.js +19 -1
- package/dist/sdk/navigation/redirect.js.map +1 -1
- package/dist/sdk/navigation/types.d.ts +13 -0
- package/dist/sdk/payment/bin-format.js +20 -0
- package/dist/sdk/payment/bin-format.js.map +1 -0
- package/dist/sdk/payment/challenge-return.js +37 -0
- package/dist/sdk/payment/challenge-return.js.map +1 -0
- package/dist/sdk/payment/confirmation-last-four.js +39 -0
- package/dist/sdk/payment/confirmation-last-four.js.map +1 -0
- package/dist/sdk/payment/gateway.d.ts +1 -1
- package/dist/sdk/payment/gateway.js +8 -2
- package/dist/sdk/payment/gateway.js.map +1 -1
- package/dist/sdk/payment/operations.d.ts +1 -0
- package/dist/sdk/payment/operations.js +28 -6
- package/dist/sdk/payment/operations.js.map +1 -1
- package/dist/sdk/payment/resumed-purchase.d.ts +1 -0
- package/dist/sdk/payment/resumed-purchase.js +119 -0
- package/dist/sdk/payment/resumed-purchase.js.map +1 -0
- package/dist/sdk/payment/security-code-mask.js +16 -23
- package/dist/sdk/payment/security-code-mask.js.map +1 -1
- package/dist/sdk/payment/submission-registry.js +6 -2
- package/dist/sdk/payment/submission-registry.js.map +1 -1
- package/dist/sdk/payment/use-payment-actions.d.ts +18 -3
- package/dist/sdk/payment/use-payment-actions.js +23 -3
- package/dist/sdk/payment/use-payment-actions.js.map +1 -1
- package/dist/sdk/payment/use-place-order.d.ts +10 -2
- package/dist/sdk/payment/use-place-order.js +138 -76
- package/dist/sdk/payment/use-place-order.js.map +1 -1
- package/dist/sdk/provider/storefront-provider.d.ts +1 -7
- package/dist/sdk/provider/storefront-provider.js +4 -11
- package/dist/sdk/provider/storefront-provider.js.map +1 -1
- package/dist/sdk/seo/entity-landing.d.ts +24 -0
- package/dist/sdk/seo/entity-landing.js +30 -0
- package/dist/sdk/seo/entity-landing.js.map +1 -0
- package/dist/sdk/seo/page-alternates.d.ts +3 -2
- package/dist/sdk/seo/page-alternates.js +4 -2
- package/dist/sdk/seo/page-alternates.js.map +1 -1
- package/dist/sdk/seo/search-landing.d.ts +42 -0
- package/dist/sdk/seo/search-landing.js +85 -0
- package/dist/sdk/seo/search-landing.js.map +1 -0
- package/dist/sdk/session/mock-session.d.ts +9 -0
- package/dist/sdk/session/mock-session.js +31 -0
- package/dist/sdk/session/mock-session.js.map +1 -0
- package/dist/sdk/session/read-server-session.d.ts +3 -0
- package/dist/sdk/session/read-server-session.js +5 -0
- package/dist/sdk/session/read-server-session.js.map +1 -1
- package/dist/sdk/session/return-path-segment.d.ts +10 -0
- package/dist/sdk/session/return-path-segment.js +15 -0
- package/dist/sdk/session/return-path-segment.js.map +1 -0
- package/dist/sdk/session/use-session-actions.js.map +1 -1
- package/dist/sdk/shipping/use-cart-shipping-simulation.js.map +1 -1
- package/dist/sdk/shipping/use-shipping-actions.js.map +1 -1
- package/dist/sdk/shipping/use-shipping-simulation.js.map +1 -1
- package/dist/utils/safe-href.d.ts +2 -0
- package/package.json +4 -3
- package/skills/storefront-asset/SKILL.md +2 -2
- package/skills/storefront-asset/references/api-side.md +27 -14
- package/skills/storefront-asset/references/findings.md +5 -2
- package/src/styles/tailwind.css +8 -0
- package/dist/matter/shipping-address/country-descriptors.d.ts +0 -1
- package/dist/message-locales.json +0 -7
- package/dist/sdk/i18n/client.d.ts +0 -4
- package/dist/sdk/i18n/client.js +0 -4
- package/dist/sdk/i18n/locales.d.ts +0 -8
- package/dist/sdk/i18n/locales.js +0 -57
- package/dist/sdk/i18n/locales.js.map +0 -1
- package/dist/sdk/i18n/messages/en-US.js +0 -183
- package/dist/sdk/i18n/messages/en-US.js.map +0 -1
- package/dist/sdk/i18n/messages/en-US.json +0 -178
- package/dist/sdk/i18n/messages/en-US.json.d.ts +0 -182
- package/dist/sdk/i18n/messages/es-ES.js +0 -183
- package/dist/sdk/i18n/messages/es-ES.js.map +0 -1
- package/dist/sdk/i18n/messages/es-ES.json +0 -178
- package/dist/sdk/i18n/messages/pt-BR.js +0 -183
- package/dist/sdk/i18n/messages/pt-BR.js.map +0 -1
- package/dist/sdk/i18n/messages/pt-BR.json +0 -178
- package/dist/sdk/i18n/provider.d.ts +0 -1
- package/dist/sdk/i18n/provider.js +0 -30
- package/dist/sdk/i18n/provider.js.map +0 -1
- package/dist/sdk/i18n/server.d.ts +0 -28
- package/dist/sdk/i18n/server.js +0 -59
- package/dist/sdk/i18n/server.js.map +0 -1
- package/dist/utils/resolve-authored-copy.js +0 -18
- package/dist/utils/resolve-authored-copy.js.map +0 -1
- package/dist/utils/substitute-template.js +0 -33
- package/dist/utils/substitute-template.js.map +0 -1
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { defineComponent } from "../../core/dist/define-component.js";
|
|
3
|
+
import { defineContentType } from "../../core/dist/define-content-type.js";
|
|
3
4
|
import "../../core/dist/index.js";
|
|
4
5
|
import { resolveSiteRelativeHref } from "../../utils/safe-href.js";
|
|
5
|
-
import {
|
|
6
|
+
import { useMessageFormatter } from "../../sdk/i18n/use-message-formatter.js";
|
|
6
7
|
import { useStorefrontNavigation } from "../../sdk/navigation/use-storefront-navigation.js";
|
|
7
8
|
import { Field, FieldsetFieldContext, TEXT_FIELD_VALUE, useBoundField, useFieldsetField, useFieldsetFieldNames } from "../../particles/field/field.js";
|
|
8
9
|
import { useActionsOverride } from "../../sdk/actions/actions-override-context.js";
|
|
9
|
-
import { resolveAuthoredCopy } from "../../utils/resolve-authored-copy.js";
|
|
10
10
|
import { useSession } from "../session/session.js";
|
|
11
|
-
import { loggableErrorName } from "../../utils/loggable-error-name.js";
|
|
12
11
|
import { Button } from "../../particles/button/button.js";
|
|
13
|
-
import {
|
|
12
|
+
import { loggableErrorName } from "../../utils/loggable-error-name.js";
|
|
13
|
+
import { ACCOUNT_MAX_LENGTH } from "../../sdk/address/constants.js";
|
|
14
14
|
import { useOptionalAccountAddressBook } from "./account-address-book.js";
|
|
15
15
|
import { useToast } from "../../particles/toast/toast.js";
|
|
16
16
|
import { Select } from "../../particles/select/select.js";
|
|
17
17
|
import { AccountAddressFormContext, useAccountAddressForm } from "./account-address-form-context.js";
|
|
18
|
-
import { AccountAddressCountryNotice, AddressCountryControl } from "./account-address-country.js";
|
|
19
18
|
import { FormRoot, useFormRegistry } from "../../particles/form/form.js";
|
|
20
19
|
import { addressFields } from "../../sdk/address/address-fields.js";
|
|
21
20
|
import { loadCountryRules } from "../../sdk/address/country-rules.js";
|
|
@@ -25,7 +24,7 @@ import { applyCountrySwitch, initialAddressCountry } from "./account-address-cou
|
|
|
25
24
|
import { dependentsOf, usePostalCodeAutofill } from "./account-address-postal-autofill.js";
|
|
26
25
|
import { useOptionalAccountAddressRecord } from "./account-address-record.js";
|
|
27
26
|
import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
28
|
-
import {
|
|
27
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
29
28
|
import { useFormContext, useWatch } from "react-hook-form";
|
|
30
29
|
//#region src/matter/account-address-book/account-address-form.tsx
|
|
31
30
|
const DEFAULT_COUNTRY = "BRA";
|
|
@@ -50,20 +49,39 @@ const EDITABLE_FIELDS = [
|
|
|
50
49
|
];
|
|
51
50
|
const SERVER_REQUIRED = {
|
|
52
51
|
code: "required",
|
|
53
|
-
|
|
52
|
+
message: "required"
|
|
54
53
|
};
|
|
55
54
|
const SERVER_INVALID = {
|
|
56
55
|
code: "invalid",
|
|
57
|
-
|
|
56
|
+
message: "invalid"
|
|
57
|
+
};
|
|
58
|
+
const ERROR_FIELDS = {
|
|
59
|
+
unrenderedField: "unrenderedFieldMessage",
|
|
60
|
+
notFound: "notFoundMessage",
|
|
61
|
+
unauthorized: "unauthorizedMessage",
|
|
62
|
+
saveFailed: "saveFailedMessage",
|
|
63
|
+
rulesFailed: "rulesFailedMessage",
|
|
64
|
+
countrySwitchFailed: "countrySwitchFailedMessage",
|
|
65
|
+
unsupportedCountry: "unsupportedCountryMessage"
|
|
58
66
|
};
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
const LABEL_FIELDS = {
|
|
68
|
+
cep: "cepLabel",
|
|
69
|
+
city: "cityLabel",
|
|
70
|
+
commune: "communeLabel",
|
|
71
|
+
complement: "complementLabel",
|
|
72
|
+
county: "countyLabel",
|
|
73
|
+
department: "departmentLabel",
|
|
74
|
+
district: "districtLabel",
|
|
75
|
+
municipality: "municipalityLabel",
|
|
76
|
+
neighborhood: "neighborhoodLabel",
|
|
77
|
+
number: "numberLabel",
|
|
78
|
+
postalCode: "postalCodeLabel",
|
|
79
|
+
postcode: "postcodeLabel",
|
|
80
|
+
province: "provinceLabel",
|
|
81
|
+
region: "regionLabel",
|
|
82
|
+
state: "stateLabel",
|
|
83
|
+
street: "streetLabel",
|
|
84
|
+
town: "townLabel"
|
|
67
85
|
};
|
|
68
86
|
function toDraft(address) {
|
|
69
87
|
if (!address) return {};
|
|
@@ -73,7 +91,7 @@ function isBlankDraft(draft) {
|
|
|
73
91
|
return EDITABLE_FIELDS.every((field) => (draft[field] ?? "").trim() === "");
|
|
74
92
|
}
|
|
75
93
|
function toCountry(code) {
|
|
76
|
-
return
|
|
94
|
+
return (code?.trim() || DEFAULT_COUNTRY).toUpperCase();
|
|
77
95
|
}
|
|
78
96
|
/** A refusal's code decides the message when it names no field on screen; a named field reads as unrendered. */
|
|
79
97
|
function toFormError({ code, field }) {
|
|
@@ -120,15 +138,11 @@ function splitByScreen(found, controls) {
|
|
|
120
138
|
formLevel: offScreen ? "unrenderedField" : null
|
|
121
139
|
};
|
|
122
140
|
}
|
|
123
|
-
function
|
|
124
|
-
if (edited) return resolveAuthoredCopy(savedMessage, intl.formatMessage({ id: "fs/address-form.saved" }));
|
|
125
|
-
return resolveAuthoredCopy(addedMessage, intl.formatMessage({ id: "fs/address-form.added" }));
|
|
126
|
-
}
|
|
127
|
-
function describeStatus(status, blockedMessage, intl) {
|
|
141
|
+
function describeStatus(status, { format }) {
|
|
128
142
|
if (status === null) return "";
|
|
129
|
-
if (status.kind === "filled") return
|
|
130
|
-
|
|
131
|
-
return
|
|
143
|
+
if (status.kind === "filled") return format("statusFilled", { count: status.count });
|
|
144
|
+
if (status.kind === "fields") return format("statusFields", { count: status.count });
|
|
145
|
+
return format("statusFailed");
|
|
132
146
|
}
|
|
133
147
|
function focusFirstInvalid(form, errors) {
|
|
134
148
|
if (!form) return;
|
|
@@ -153,7 +167,7 @@ function useFormPlacement() {
|
|
|
153
167
|
mode: seed ? "edit" : "add"
|
|
154
168
|
};
|
|
155
169
|
}
|
|
156
|
-
function AccountAddressFormRoot({ defaultCountry,
|
|
170
|
+
function AccountAddressFormRoot({ defaultCountry, $content, $locale, returnHref, $actions, className, children, ...props }) {
|
|
157
171
|
const { state: sessionState } = useSession();
|
|
158
172
|
useToast();
|
|
159
173
|
const { book, record, mode } = useFormPlacement();
|
|
@@ -174,25 +188,14 @@ function AccountAddressFormRoot({ defaultCountry, addedMessage, savedMessage, bl
|
|
|
174
188
|
"data-fs-account-address-form-mode": mode,
|
|
175
189
|
children: /* @__PURE__ */ jsx(AccountAddressFieldset, {
|
|
176
190
|
defaultCountry,
|
|
177
|
-
|
|
178
|
-
savedMessage,
|
|
179
|
-
blockedMessage,
|
|
191
|
+
$content,
|
|
180
192
|
returnHref,
|
|
181
193
|
$actions,
|
|
182
194
|
writing,
|
|
183
195
|
setWriting,
|
|
184
196
|
switchTarget,
|
|
185
197
|
setSwitchTarget,
|
|
186
|
-
children
|
|
187
|
-
/* @__PURE__ */ jsx(AddressCountryControl, {}),
|
|
188
|
-
/* @__PURE__ */ jsx(AccountAddressCountryNotice, {}),
|
|
189
|
-
/* @__PURE__ */ jsx(AccountAddressFormRecipientName, {}),
|
|
190
|
-
/* @__PURE__ */ jsx(AccountAddressFormFields, {}),
|
|
191
|
-
/* @__PURE__ */ jsx(AccountAddressFormReference, {}),
|
|
192
|
-
/* @__PURE__ */ jsx(AccountAddressFormError, {}),
|
|
193
|
-
/* @__PURE__ */ jsx(AccountAddressFormSubmit, {}),
|
|
194
|
-
/* @__PURE__ */ jsx(AccountAddressFormCancel, {})
|
|
195
|
-
] })
|
|
198
|
+
children
|
|
196
199
|
})
|
|
197
200
|
});
|
|
198
201
|
}
|
|
@@ -200,11 +203,11 @@ function AccountAddressFormRoot({ defaultCountry, addedMessage, savedMessage, bl
|
|
|
200
203
|
* The form's one fieldset under its FormRoot. It reads and writes the draft through react-hook-form,
|
|
201
204
|
* and owns the rules, the errors, the country switch, the postal-code fill and the write.
|
|
202
205
|
*/
|
|
203
|
-
function AccountAddressFieldset({ defaultCountry,
|
|
206
|
+
function AccountAddressFieldset({ defaultCountry, $content, returnHref, $actions: $actionsProp, writing, setWriting, switchTarget, setSwitchTarget, children }) {
|
|
204
207
|
const { registerFieldset } = useFormRegistry();
|
|
205
208
|
const { getValues, setValue, subscribe } = useFormContext();
|
|
206
209
|
const toast = useToast();
|
|
207
|
-
const
|
|
210
|
+
const messages = useMessageFormatter(AccountAddressFormContent, $content);
|
|
208
211
|
const $actions = useActionsOverride($actionsProp);
|
|
209
212
|
const { push } = useStorefrontNavigation();
|
|
210
213
|
const { book, seed, mode } = useFormPlacement();
|
|
@@ -218,6 +221,7 @@ function AccountAddressFieldset({ defaultCountry, addedMessage, savedMessage, bl
|
|
|
218
221
|
const [fieldErrors, setFieldErrors] = useState({});
|
|
219
222
|
const [formError, setFormError] = useState(null);
|
|
220
223
|
const [status, setStatus] = useState(null);
|
|
224
|
+
const [fieldLabel, setFieldLabel] = useState(null);
|
|
221
225
|
const pendingRef = useRef(false);
|
|
222
226
|
const mountedRef = useRef(true);
|
|
223
227
|
useEffect(() => {
|
|
@@ -359,6 +363,10 @@ function AccountAddressFieldset({ defaultCountry, addedMessage, savedMessage, bl
|
|
|
359
363
|
seedDraft
|
|
360
364
|
]);
|
|
361
365
|
const registerField = useCallback((name) => registry.registerFieldName(fieldPath(name)), [registry]);
|
|
366
|
+
const registerFieldLabel = useCallback((label) => {
|
|
367
|
+
setFieldLabel(() => label);
|
|
368
|
+
return () => setFieldLabel((current) => current === label ? null : current);
|
|
369
|
+
}, []);
|
|
362
370
|
const applyFill = useCallback((filled) => {
|
|
363
371
|
writeDraft(filled);
|
|
364
372
|
setFieldErrors((previous) => {
|
|
@@ -429,10 +437,13 @@ function AccountAddressFieldset({ defaultCountry, addedMessage, savedMessage, bl
|
|
|
429
437
|
if (formLevel === null && Object.keys(onScreen).length === 0) return null;
|
|
430
438
|
return [{
|
|
431
439
|
code: "ADDRESS_FORM_BLOCKED",
|
|
432
|
-
message: describeStatus(block(onScreen, formLevel),
|
|
440
|
+
message: describeStatus(block(onScreen, formLevel), messages)
|
|
433
441
|
}];
|
|
434
442
|
}
|
|
435
|
-
/**
|
|
443
|
+
/**
|
|
444
|
+
* Puts each refusal on the field it names, and the rest on the form: a save never fails silently.
|
|
445
|
+
* Returns what `dispatch` hands `FormRoot`: the form's own status copy, never the server's `message`.
|
|
446
|
+
*/
|
|
436
447
|
function refuse(userErrors) {
|
|
437
448
|
const errors = {};
|
|
438
449
|
const controls = mountedFields();
|
|
@@ -443,7 +454,10 @@ function AccountAddressFieldset({ defaultCountry, addedMessage, savedMessage, bl
|
|
|
443
454
|
if (name && controls.has(name) && onField) errors[name] ??= userError.code === "MISSING_REQUIRED_FIELD" ? SERVER_REQUIRED : SERVER_INVALID;
|
|
444
455
|
else formLevel ??= toFormError(userError);
|
|
445
456
|
}
|
|
446
|
-
|
|
457
|
+
return [{
|
|
458
|
+
code: userErrors[0]?.code,
|
|
459
|
+
message: describeStatus(block(errors, formLevel), messages)
|
|
460
|
+
}];
|
|
447
461
|
}
|
|
448
462
|
function toPayload(values) {
|
|
449
463
|
const current = {
|
|
@@ -482,17 +496,9 @@ function AccountAddressFieldset({ defaultCountry, addedMessage, savedMessage, bl
|
|
|
482
496
|
setWriting(true);
|
|
483
497
|
try {
|
|
484
498
|
const userErrors = await write(payload);
|
|
485
|
-
if (userErrors.length > 0)
|
|
486
|
-
refuse(userErrors);
|
|
487
|
-
return userErrors;
|
|
488
|
-
}
|
|
499
|
+
if (userErrors.length > 0) return refuse(userErrors);
|
|
489
500
|
toast.add({
|
|
490
|
-
title:
|
|
491
|
-
edited: seed !== null,
|
|
492
|
-
addedMessage,
|
|
493
|
-
savedMessage,
|
|
494
|
-
intl
|
|
495
|
-
}),
|
|
501
|
+
title: messages.format(seed === null ? "addedMessage" : "savedMessage"),
|
|
496
502
|
type: "success"
|
|
497
503
|
});
|
|
498
504
|
if (mountedRef.current) closeForm();
|
|
@@ -571,7 +577,9 @@ function AccountAddressFieldset({ defaultCountry, addedMessage, savedMessage, bl
|
|
|
571
577
|
setField,
|
|
572
578
|
registerField,
|
|
573
579
|
close: closeForm,
|
|
574
|
-
countryChoice
|
|
580
|
+
countryChoice,
|
|
581
|
+
fieldLabel,
|
|
582
|
+
registerFieldLabel
|
|
575
583
|
}), [
|
|
576
584
|
mode,
|
|
577
585
|
country,
|
|
@@ -583,7 +591,9 @@ function AccountAddressFieldset({ defaultCountry, addedMessage, savedMessage, bl
|
|
|
583
591
|
setField,
|
|
584
592
|
registerField,
|
|
585
593
|
closeForm,
|
|
586
|
-
countryChoice
|
|
594
|
+
countryChoice,
|
|
595
|
+
fieldLabel,
|
|
596
|
+
registerFieldLabel
|
|
587
597
|
]);
|
|
588
598
|
return /* @__PURE__ */ jsx(FieldsetFieldContext, {
|
|
589
599
|
value: registry,
|
|
@@ -595,13 +605,26 @@ function AccountAddressFieldset({ defaultCountry, addedMessage, savedMessage, bl
|
|
|
595
605
|
"data-fs-account-address-form-status": "",
|
|
596
606
|
"data-fs-sr-only": "",
|
|
597
607
|
className: "sr-only",
|
|
598
|
-
children: describeStatus(status,
|
|
608
|
+
children: describeStatus(status, messages)
|
|
599
609
|
})]
|
|
600
610
|
})
|
|
601
611
|
});
|
|
602
612
|
}
|
|
603
|
-
|
|
604
|
-
|
|
613
|
+
/** RecipientName and Reference never get a postal-code error: only a country field does. */
|
|
614
|
+
function labelFieldErrorText({ format }, { message, values }) {
|
|
615
|
+
if (message === "required") return format("requiredError");
|
|
616
|
+
if (message === "tooLong") return format("tooLongError", { maxLength: String(values?.maxLength ?? "") });
|
|
617
|
+
return format("invalidError");
|
|
618
|
+
}
|
|
619
|
+
function countryFieldErrorText({ format }, { message, values }) {
|
|
620
|
+
const example = String(values?.example ?? "");
|
|
621
|
+
switch (message) {
|
|
622
|
+
case "required": return format("requiredError");
|
|
623
|
+
case "tooLong": return format("tooLongError", { maxLength: String(values?.maxLength ?? "") });
|
|
624
|
+
case "cep": return format("cepError", { example });
|
|
625
|
+
case "postalCode": return format("postalCodeError", { example });
|
|
626
|
+
case "invalid": return format("invalidError");
|
|
627
|
+
}
|
|
605
628
|
}
|
|
606
629
|
/** Registers the field with the form while it is on screen and returns its value. */
|
|
607
630
|
function useAddressFieldValue(name) {
|
|
@@ -622,10 +645,9 @@ function chooseOption(setField, name, value, descriptors) {
|
|
|
622
645
|
setField(name, value);
|
|
623
646
|
for (const dependent of dependentsOf(name, descriptors)) setField(dependent, "");
|
|
624
647
|
}
|
|
625
|
-
function AddressTextField({ name, label, maxLength, inputMode, placeholder, className }) {
|
|
648
|
+
function AddressTextField({ name, label, errorText, maxLength, inputMode, placeholder, className }) {
|
|
626
649
|
const { fieldErrors, setField } = useAccountAddressForm();
|
|
627
650
|
const value = useAddressFieldValue(name);
|
|
628
|
-
const intl = useIntl();
|
|
629
651
|
const error = fieldErrors[name];
|
|
630
652
|
return /* @__PURE__ */ jsxs(Field.Root, {
|
|
631
653
|
className,
|
|
@@ -643,15 +665,14 @@ function AddressTextField({ name, label, maxLength, inputMode, placeholder, clas
|
|
|
643
665
|
}),
|
|
644
666
|
error ? /* @__PURE__ */ jsx(Field.Error, {
|
|
645
667
|
match: true,
|
|
646
|
-
children:
|
|
668
|
+
children: errorText(error)
|
|
647
669
|
}) : null
|
|
648
670
|
]
|
|
649
671
|
});
|
|
650
672
|
}
|
|
651
|
-
function AddressSelectField({ name, label, options, placeholder, className, onChange }) {
|
|
673
|
+
function AddressSelectField({ name, label, errorText, options, placeholder, className, onChange }) {
|
|
652
674
|
const { fieldErrors } = useAccountAddressForm();
|
|
653
675
|
const value = useAddressFieldValue(name);
|
|
654
|
-
const intl = useIntl();
|
|
655
676
|
const errorId = useId();
|
|
656
677
|
const error = fieldErrors[name];
|
|
657
678
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -681,28 +702,30 @@ function AddressSelectField({ name, label, options, placeholder, className, onCh
|
|
|
681
702
|
}), error ? /* @__PURE__ */ jsx("p", {
|
|
682
703
|
id: errorId,
|
|
683
704
|
"data-fs-account-address-form-field-error": "",
|
|
684
|
-
children:
|
|
705
|
+
children: errorText(error)
|
|
685
706
|
}) : null]
|
|
686
707
|
});
|
|
687
708
|
}
|
|
688
|
-
function AccountAddressFormRecipientName({
|
|
709
|
+
function AccountAddressFormRecipientName({ $content, className }) {
|
|
689
710
|
const { rules } = useAccountAddressForm();
|
|
690
|
-
const
|
|
711
|
+
const messages = useMessageFormatter(AccountAddressFormRecipientNameContent, $content);
|
|
691
712
|
if (!rules) return null;
|
|
692
713
|
return /* @__PURE__ */ jsx(AddressTextField, {
|
|
693
714
|
name: "recipientName",
|
|
694
|
-
label:
|
|
715
|
+
label: messages.format("label"),
|
|
716
|
+
errorText: (error) => labelFieldErrorText(messages, error),
|
|
695
717
|
maxLength: ACCOUNT_MAX_LENGTH.recipientName,
|
|
696
718
|
className
|
|
697
719
|
});
|
|
698
720
|
}
|
|
699
|
-
function AccountAddressFormReference({
|
|
721
|
+
function AccountAddressFormReference({ $content, className }) {
|
|
700
722
|
const { rules } = useAccountAddressForm();
|
|
701
|
-
const
|
|
723
|
+
const messages = useMessageFormatter(AccountAddressFormReferenceContent, $content);
|
|
702
724
|
if (!rules) return null;
|
|
703
725
|
return /* @__PURE__ */ jsx(AddressTextField, {
|
|
704
726
|
name: "reference",
|
|
705
|
-
label:
|
|
727
|
+
label: messages.format("label"),
|
|
728
|
+
errorText: (error) => labelFieldErrorText(messages, error),
|
|
706
729
|
maxLength: ACCOUNT_MAX_LENGTH.reference,
|
|
707
730
|
className
|
|
708
731
|
});
|
|
@@ -710,20 +733,25 @@ function AccountAddressFormReference({ label, className }) {
|
|
|
710
733
|
/**
|
|
711
734
|
* One field per descriptor the country's rules give for the draft, in the order the country's form lists them.
|
|
712
735
|
* A complete postal code fills the empty state, city, neighborhood and street the shopper has not typed;
|
|
713
|
-
* the fill is announced once.
|
|
736
|
+
* the fill is announced once. Its labels also word the country notice's list of fields left behind.
|
|
714
737
|
*/
|
|
715
|
-
function AccountAddressFormFields({ className }) {
|
|
716
|
-
const { rules, draft, setField } = useAccountAddressForm();
|
|
717
|
-
const
|
|
738
|
+
function AccountAddressFormFields({ $content, className }) {
|
|
739
|
+
const { rules, draft, setField, registerFieldLabel } = useAccountAddressForm();
|
|
740
|
+
const messages = useMessageFormatter(AccountAddressFormFieldsContent, $content);
|
|
741
|
+
const { format } = messages;
|
|
742
|
+
const fieldLabel = useCallback((key) => format(LABEL_FIELDS[key]), [format]);
|
|
743
|
+
useEffect(() => registerFieldLabel(fieldLabel), [registerFieldLabel, fieldLabel]);
|
|
718
744
|
if (!rules) return null;
|
|
719
745
|
const descriptors = addressFields(rules, draft);
|
|
746
|
+
const errorText = (error) => countryFieldErrorText(messages, error);
|
|
720
747
|
return descriptors.map((descriptor) => {
|
|
721
|
-
const { name, control,
|
|
722
|
-
const label =
|
|
723
|
-
const hint = placeholder ?
|
|
748
|
+
const { name, control, maxLength, inputMode, options, placeholder } = descriptor;
|
|
749
|
+
const label = fieldLabel(descriptor.label);
|
|
750
|
+
const hint = placeholder?.key === "street" ? format("streetPlaceholder") : placeholder && format("postalCodePlaceholder", { example: placeholder.values.example ?? "" });
|
|
724
751
|
if (control === "select") return /* @__PURE__ */ jsx(AddressSelectField, {
|
|
725
752
|
name,
|
|
726
753
|
label,
|
|
754
|
+
errorText,
|
|
727
755
|
options: options ?? [],
|
|
728
756
|
placeholder: hint,
|
|
729
757
|
className,
|
|
@@ -732,6 +760,7 @@ function AccountAddressFormFields({ className }) {
|
|
|
732
760
|
return /* @__PURE__ */ jsx(AddressTextField, {
|
|
733
761
|
name,
|
|
734
762
|
label,
|
|
763
|
+
errorText,
|
|
735
764
|
maxLength,
|
|
736
765
|
inputMode,
|
|
737
766
|
placeholder: hint,
|
|
@@ -739,30 +768,21 @@ function AccountAddressFormFields({ className }) {
|
|
|
739
768
|
}, name);
|
|
740
769
|
});
|
|
741
770
|
}
|
|
742
|
-
function AccountAddressFormError({
|
|
771
|
+
function AccountAddressFormError({ $content, $locale, className, ...props }) {
|
|
743
772
|
const { formError } = useAccountAddressForm();
|
|
744
|
-
const
|
|
773
|
+
const { format } = useMessageFormatter(AccountAddressFormErrorContent, $content);
|
|
745
774
|
if (!formError) return null;
|
|
746
|
-
const authored = {
|
|
747
|
-
unrenderedField: unrenderedFieldMessage,
|
|
748
|
-
notFound: notFoundMessage,
|
|
749
|
-
unauthorized: unauthorizedMessage,
|
|
750
|
-
saveFailed: saveFailedMessage,
|
|
751
|
-
rulesFailed: rulesFailedMessage,
|
|
752
|
-
countrySwitchFailed: countrySwitchFailedMessage,
|
|
753
|
-
unsupportedCountry: unsupportedCountryMessage
|
|
754
|
-
};
|
|
755
775
|
return /* @__PURE__ */ jsx("div", {
|
|
756
776
|
...props,
|
|
757
777
|
role: "alert",
|
|
758
778
|
className,
|
|
759
779
|
"data-fs-account-address-form-error": formError,
|
|
760
|
-
children:
|
|
780
|
+
children: format(ERROR_FIELDS[formError])
|
|
761
781
|
});
|
|
762
782
|
}
|
|
763
|
-
function AccountAddressFormSubmit({
|
|
783
|
+
function AccountAddressFormSubmit({ $content, $locale, className, children, ...props }) {
|
|
764
784
|
const { country, rules, formError, pending, countryChoice } = useAccountAddressForm();
|
|
765
|
-
const
|
|
785
|
+
const { format } = useMessageFormatter(AccountAddressFormSubmitContent, $content);
|
|
766
786
|
const switching = countryChoice.selected !== country;
|
|
767
787
|
return /* @__PURE__ */ jsx(Button, {
|
|
768
788
|
...props,
|
|
@@ -771,12 +791,12 @@ function AccountAddressFormSubmit({ label, className, children, ...props }) {
|
|
|
771
791
|
disabled: rules === null || formError === "rulesFailed" || pending || switching,
|
|
772
792
|
"aria-busy": pending || void 0,
|
|
773
793
|
"data-fs-account-address-form-submit": "",
|
|
774
|
-
children: children ??
|
|
794
|
+
children: children ?? format("label")
|
|
775
795
|
});
|
|
776
796
|
}
|
|
777
|
-
function AccountAddressFormCancel({
|
|
797
|
+
function AccountAddressFormCancel({ $content, $locale, className, children, onClick, ...props }) {
|
|
778
798
|
const { close, pending } = useAccountAddressForm();
|
|
779
|
-
const
|
|
799
|
+
const { format } = useMessageFormatter(AccountAddressFormCancelContent, $content);
|
|
780
800
|
return /* @__PURE__ */ jsx(Button, {
|
|
781
801
|
...props,
|
|
782
802
|
type: "button",
|
|
@@ -787,13 +807,65 @@ function AccountAddressFormCancel({ label, className, children, onClick, ...prop
|
|
|
787
807
|
close();
|
|
788
808
|
},
|
|
789
809
|
"data-fs-account-address-form-cancel": "",
|
|
790
|
-
children: children ??
|
|
810
|
+
children: children ?? format("label")
|
|
791
811
|
});
|
|
792
812
|
}
|
|
813
|
+
const AccountAddressFormContent = defineContentType({
|
|
814
|
+
id: "account-address-form",
|
|
815
|
+
title: "Account Address Form",
|
|
816
|
+
description: "The messages the address form shows or announces when a save ends or a postal code fills fields.",
|
|
817
|
+
schema: {
|
|
818
|
+
type: "object",
|
|
819
|
+
additionalProperties: false,
|
|
820
|
+
properties: {
|
|
821
|
+
addedMessage: {
|
|
822
|
+
type: "string",
|
|
823
|
+
title: "Address added message",
|
|
824
|
+
format: "icu-message",
|
|
825
|
+
messageSource: "Address added."
|
|
826
|
+
},
|
|
827
|
+
savedMessage: {
|
|
828
|
+
type: "string",
|
|
829
|
+
title: "Address saved message",
|
|
830
|
+
format: "icu-message",
|
|
831
|
+
messageSource: "Address saved."
|
|
832
|
+
},
|
|
833
|
+
statusFilled: {
|
|
834
|
+
type: "string",
|
|
835
|
+
title: "Fields filled from the postal code",
|
|
836
|
+
format: "icu-message",
|
|
837
|
+
messageSource: "{count, plural, one {# field filled from the postal code.} other {# fields filled from the postal code.}}",
|
|
838
|
+
messageArguments: {
|
|
839
|
+
type: "object",
|
|
840
|
+
properties: { count: { type: "integer" } }
|
|
841
|
+
},
|
|
842
|
+
messageExample: { count: 2 }
|
|
843
|
+
},
|
|
844
|
+
statusFields: {
|
|
845
|
+
type: "string",
|
|
846
|
+
title: "Save blocked by fields",
|
|
847
|
+
format: "icu-message",
|
|
848
|
+
messageSource: "Address not saved. {count, plural, one {# field needs attention.} other {# fields need attention.}}",
|
|
849
|
+
messageArguments: {
|
|
850
|
+
type: "object",
|
|
851
|
+
properties: { count: { type: "integer" } }
|
|
852
|
+
},
|
|
853
|
+
messageExample: { count: 2 }
|
|
854
|
+
},
|
|
855
|
+
statusFailed: {
|
|
856
|
+
type: "string",
|
|
857
|
+
title: "Save failed",
|
|
858
|
+
format: "icu-message",
|
|
859
|
+
messageSource: "Address not saved."
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
});
|
|
793
864
|
const AccountAddressFormRootDefinition = defineComponent({
|
|
794
865
|
name: "AccountAddressFormRoot",
|
|
795
866
|
importPath: "@vtex/faststore/components",
|
|
796
867
|
component: AccountAddressFormRoot,
|
|
868
|
+
content: AccountAddressFormContent,
|
|
797
869
|
requiresContext: "session",
|
|
798
870
|
providesContext: "account-address-form",
|
|
799
871
|
actions: { address: ["create", "update"] },
|
|
@@ -807,45 +879,247 @@ const AccountAddressFormRootDefinition = defineComponent({
|
|
|
807
879
|
default: "BRA",
|
|
808
880
|
label: "Preferred country (ISO-3)"
|
|
809
881
|
},
|
|
810
|
-
addedMessage: {
|
|
811
|
-
type: "string",
|
|
812
|
-
label: "Address added message"
|
|
813
|
-
},
|
|
814
|
-
savedMessage: {
|
|
815
|
-
type: "string",
|
|
816
|
-
label: "Address saved message"
|
|
817
|
-
},
|
|
818
|
-
blockedMessage: {
|
|
819
|
-
type: "string",
|
|
820
|
-
label: "Save blocked message"
|
|
821
|
-
},
|
|
822
882
|
returnHref: {
|
|
823
883
|
type: "link",
|
|
824
884
|
default: { standard: "address" },
|
|
825
885
|
label: "Return page"
|
|
826
886
|
}
|
|
827
887
|
},
|
|
828
|
-
guideline: "The form that adds an address or corrects a saved one, with the fields, order and options of the address's country. Opens through AccountAddressBookAddTrigger and AccountAddressBookEditTrigger, placed by AccountAddressBookFormSlot or AccountAddressBookFormDialog. Requires a SessionRoot and a mounted ToastProvider ancestor: saving shows a toast and closes the form. On its own page (add: no ancestor; edit: inside AccountAddressRecord) leaving the form, by a save, a save with no changes or Cancel, goes to returnHref instead, so mount the ToastProvider in the layout for the toast to outlive the navigation. A new address takes defaultCountry when the store ships there or the list is unknown, else the first country the store ships to; the shopper picks another through AddressCountryControl. A saved address keeps its own country, shown as text. A save the form or the server blocks marks each field, moves focus to the first one and announces it, and keeps what was typed.
|
|
888
|
+
guideline: "The form that adds an address or corrects a saved one, with the fields, order and options of the address's country. Opens through AccountAddressBookAddTrigger and AccountAddressBookEditTrigger, placed by AccountAddressBookFormSlot or AccountAddressBookFormDialog. Requires a SessionRoot and a mounted ToastProvider ancestor: saving shows a toast and closes the form. On its own page (add: no ancestor; edit: inside AccountAddressRecord) leaving the form, by a save, a save with no changes or Cancel, goes to returnHref instead, so mount the ToastProvider in the layout for the toast to outlive the navigation. A new address takes defaultCountry when the store ships there or the list is unknown, else the first country the store ships to; the shopper picks another through AddressCountryControl. A saved address keeps its own country, shown as text. A save the form or the server blocks marks each field, moves focus to the first one and announces it, and keeps what was typed. It renders only its children, so compose AddressCountryControl, AccountAddressCountryNotice, RecipientName, Fields, Reference, Error, Submit and Cancel in it. See account-address-book.md."
|
|
889
|
+
});
|
|
890
|
+
const AccountAddressFormRecipientNameContent = defineContentType({
|
|
891
|
+
id: "account-address-form-recipient-name",
|
|
892
|
+
title: "Account Address Form Recipient Name",
|
|
893
|
+
description: "The recipient name field's label and errors.",
|
|
894
|
+
schema: {
|
|
895
|
+
type: "object",
|
|
896
|
+
additionalProperties: false,
|
|
897
|
+
properties: {
|
|
898
|
+
label: {
|
|
899
|
+
type: "string",
|
|
900
|
+
title: "Field label",
|
|
901
|
+
format: "icu-message",
|
|
902
|
+
messageSource: "Recipient name"
|
|
903
|
+
},
|
|
904
|
+
requiredError: {
|
|
905
|
+
type: "string",
|
|
906
|
+
title: "Required field error",
|
|
907
|
+
format: "icu-message",
|
|
908
|
+
messageSource: "This field is required."
|
|
909
|
+
},
|
|
910
|
+
invalidError: {
|
|
911
|
+
type: "string",
|
|
912
|
+
title: "Invalid field error",
|
|
913
|
+
format: "icu-message",
|
|
914
|
+
messageSource: "Check this field."
|
|
915
|
+
},
|
|
916
|
+
tooLongError: {
|
|
917
|
+
type: "string",
|
|
918
|
+
title: "Too long error",
|
|
919
|
+
format: "icu-message",
|
|
920
|
+
messageSource: "Use {maxLength} characters or fewer.",
|
|
921
|
+
messageArguments: {
|
|
922
|
+
type: "object",
|
|
923
|
+
properties: { maxLength: { type: "string" } }
|
|
924
|
+
},
|
|
925
|
+
messageExample: { maxLength: "200" }
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
}
|
|
829
929
|
});
|
|
830
930
|
const AccountAddressFormRecipientNameDefinition = defineComponent({
|
|
831
931
|
name: "AccountAddressFormRecipientName",
|
|
832
932
|
importPath: "@vtex/faststore/components",
|
|
833
933
|
component: AccountAddressFormRecipientName,
|
|
934
|
+
content: AccountAddressFormRecipientNameContent,
|
|
834
935
|
requiresContext: "account-address-form",
|
|
835
936
|
editor: {
|
|
836
937
|
label: "Account Address Form Recipient Name",
|
|
837
938
|
category: "input"
|
|
838
939
|
},
|
|
839
|
-
schema: {
|
|
840
|
-
type: "string",
|
|
841
|
-
label: "Field label"
|
|
842
|
-
} },
|
|
940
|
+
schema: {},
|
|
843
941
|
guideline: "The name of the person who receives the order. Required for every country. Place it first, before AccountAddressFormFields. Shown once the country's rules have loaded. Must be inside AccountAddressFormRoot."
|
|
844
942
|
});
|
|
943
|
+
const AccountAddressFormFieldsContent = defineContentType({
|
|
944
|
+
id: "account-address-form-fields",
|
|
945
|
+
title: "Account Address Form Fields",
|
|
946
|
+
description: "Labels, placeholders and errors of the fields the address's country asks for.",
|
|
947
|
+
schema: {
|
|
948
|
+
type: "object",
|
|
949
|
+
additionalProperties: false,
|
|
950
|
+
properties: {
|
|
951
|
+
cepLabel: {
|
|
952
|
+
type: "string",
|
|
953
|
+
title: "CEP label",
|
|
954
|
+
format: "icu-message",
|
|
955
|
+
messageSource: "CEP"
|
|
956
|
+
},
|
|
957
|
+
cityLabel: {
|
|
958
|
+
type: "string",
|
|
959
|
+
title: "City label",
|
|
960
|
+
format: "icu-message",
|
|
961
|
+
messageSource: "City"
|
|
962
|
+
},
|
|
963
|
+
communeLabel: {
|
|
964
|
+
type: "string",
|
|
965
|
+
title: "Commune label",
|
|
966
|
+
format: "icu-message",
|
|
967
|
+
messageSource: "Commune"
|
|
968
|
+
},
|
|
969
|
+
complementLabel: {
|
|
970
|
+
type: "string",
|
|
971
|
+
title: "Additional information label",
|
|
972
|
+
format: "icu-message",
|
|
973
|
+
messageSource: "Additional information (optional)"
|
|
974
|
+
},
|
|
975
|
+
countyLabel: {
|
|
976
|
+
type: "string",
|
|
977
|
+
title: "County label",
|
|
978
|
+
format: "icu-message",
|
|
979
|
+
messageSource: "County"
|
|
980
|
+
},
|
|
981
|
+
departmentLabel: {
|
|
982
|
+
type: "string",
|
|
983
|
+
title: "Department label",
|
|
984
|
+
format: "icu-message",
|
|
985
|
+
messageSource: "Department"
|
|
986
|
+
},
|
|
987
|
+
districtLabel: {
|
|
988
|
+
type: "string",
|
|
989
|
+
title: "District label",
|
|
990
|
+
format: "icu-message",
|
|
991
|
+
messageSource: "District"
|
|
992
|
+
},
|
|
993
|
+
municipalityLabel: {
|
|
994
|
+
type: "string",
|
|
995
|
+
title: "Municipality label",
|
|
996
|
+
format: "icu-message",
|
|
997
|
+
messageSource: "Municipality"
|
|
998
|
+
},
|
|
999
|
+
neighborhoodLabel: {
|
|
1000
|
+
type: "string",
|
|
1001
|
+
title: "Neighborhood label",
|
|
1002
|
+
format: "icu-message",
|
|
1003
|
+
messageSource: "Neighborhood"
|
|
1004
|
+
},
|
|
1005
|
+
numberLabel: {
|
|
1006
|
+
type: "string",
|
|
1007
|
+
title: "Number label",
|
|
1008
|
+
format: "icu-message",
|
|
1009
|
+
messageSource: "Number"
|
|
1010
|
+
},
|
|
1011
|
+
postalCodeLabel: {
|
|
1012
|
+
type: "string",
|
|
1013
|
+
title: "Postal code label",
|
|
1014
|
+
format: "icu-message",
|
|
1015
|
+
messageSource: "Postal code"
|
|
1016
|
+
},
|
|
1017
|
+
postcodeLabel: {
|
|
1018
|
+
type: "string",
|
|
1019
|
+
title: "Postcode label",
|
|
1020
|
+
format: "icu-message",
|
|
1021
|
+
messageSource: "Postcode"
|
|
1022
|
+
},
|
|
1023
|
+
provinceLabel: {
|
|
1024
|
+
type: "string",
|
|
1025
|
+
title: "Province label",
|
|
1026
|
+
format: "icu-message",
|
|
1027
|
+
messageSource: "Province"
|
|
1028
|
+
},
|
|
1029
|
+
regionLabel: {
|
|
1030
|
+
type: "string",
|
|
1031
|
+
title: "Region label",
|
|
1032
|
+
format: "icu-message",
|
|
1033
|
+
messageSource: "Region"
|
|
1034
|
+
},
|
|
1035
|
+
stateLabel: {
|
|
1036
|
+
type: "string",
|
|
1037
|
+
title: "State label",
|
|
1038
|
+
format: "icu-message",
|
|
1039
|
+
messageSource: "State"
|
|
1040
|
+
},
|
|
1041
|
+
streetLabel: {
|
|
1042
|
+
type: "string",
|
|
1043
|
+
title: "Street address label",
|
|
1044
|
+
format: "icu-message",
|
|
1045
|
+
messageSource: "Street address"
|
|
1046
|
+
},
|
|
1047
|
+
townLabel: {
|
|
1048
|
+
type: "string",
|
|
1049
|
+
title: "Town label",
|
|
1050
|
+
format: "icu-message",
|
|
1051
|
+
messageSource: "Town"
|
|
1052
|
+
},
|
|
1053
|
+
postalCodePlaceholder: {
|
|
1054
|
+
type: "string",
|
|
1055
|
+
title: "Postal code placeholder",
|
|
1056
|
+
format: "icu-message",
|
|
1057
|
+
messageSource: "Example: {example}",
|
|
1058
|
+
messageArguments: {
|
|
1059
|
+
type: "object",
|
|
1060
|
+
properties: { example: { type: "string" } }
|
|
1061
|
+
},
|
|
1062
|
+
messageExample: { example: "01310-100" }
|
|
1063
|
+
},
|
|
1064
|
+
streetPlaceholder: {
|
|
1065
|
+
type: "string",
|
|
1066
|
+
title: "Street placeholder",
|
|
1067
|
+
format: "icu-message",
|
|
1068
|
+
messageSource: "Address line 1"
|
|
1069
|
+
},
|
|
1070
|
+
cepError: {
|
|
1071
|
+
type: "string",
|
|
1072
|
+
title: "Invalid CEP error",
|
|
1073
|
+
format: "icu-message",
|
|
1074
|
+
messageSource: "Enter a valid CEP (example: {example}).",
|
|
1075
|
+
messageArguments: {
|
|
1076
|
+
type: "object",
|
|
1077
|
+
properties: { example: { type: "string" } }
|
|
1078
|
+
},
|
|
1079
|
+
messageExample: { example: "01310-100" }
|
|
1080
|
+
},
|
|
1081
|
+
postalCodeError: {
|
|
1082
|
+
type: "string",
|
|
1083
|
+
title: "Invalid postal code error",
|
|
1084
|
+
format: "icu-message",
|
|
1085
|
+
messageSource: "Enter a valid postal code (example: {example}).",
|
|
1086
|
+
messageArguments: {
|
|
1087
|
+
type: "object",
|
|
1088
|
+
properties: { example: { type: "string" } }
|
|
1089
|
+
},
|
|
1090
|
+
messageExample: { example: "K1A 0A9" }
|
|
1091
|
+
},
|
|
1092
|
+
requiredError: {
|
|
1093
|
+
type: "string",
|
|
1094
|
+
title: "Required field error",
|
|
1095
|
+
format: "icu-message",
|
|
1096
|
+
messageSource: "This field is required."
|
|
1097
|
+
},
|
|
1098
|
+
invalidError: {
|
|
1099
|
+
type: "string",
|
|
1100
|
+
title: "Invalid field error",
|
|
1101
|
+
format: "icu-message",
|
|
1102
|
+
messageSource: "Check this field."
|
|
1103
|
+
},
|
|
1104
|
+
tooLongError: {
|
|
1105
|
+
type: "string",
|
|
1106
|
+
title: "Too long error",
|
|
1107
|
+
format: "icu-message",
|
|
1108
|
+
messageSource: "Use {maxLength} characters or fewer.",
|
|
1109
|
+
messageArguments: {
|
|
1110
|
+
type: "object",
|
|
1111
|
+
properties: { maxLength: { type: "string" } }
|
|
1112
|
+
},
|
|
1113
|
+
messageExample: { maxLength: "100" }
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
});
|
|
845
1118
|
const AccountAddressFormFieldsDefinition = defineComponent({
|
|
846
1119
|
name: "AccountAddressFormFields",
|
|
847
1120
|
importPath: "@vtex/faststore/components",
|
|
848
1121
|
component: AccountAddressFormFields,
|
|
1122
|
+
content: AccountAddressFormFieldsContent,
|
|
849
1123
|
requiresContext: "account-address-form",
|
|
850
1124
|
editor: {
|
|
851
1125
|
label: "Account Address Form Fields",
|
|
@@ -854,93 +1128,182 @@ const AccountAddressFormFieldsDefinition = defineComponent({
|
|
|
854
1128
|
schema: {},
|
|
855
1129
|
guideline: "One field per field the address's country asks for, in the order that country's form lists them, with its labels, limits and lists: Brazil's city is a list that follows its state. Changing a list clears the fields that depend on it. Shown once the country's rules have loaded. Must be inside AccountAddressFormRoot."
|
|
856
1130
|
});
|
|
1131
|
+
const AccountAddressFormReferenceContent = defineContentType({
|
|
1132
|
+
id: "account-address-form-reference",
|
|
1133
|
+
title: "Account Address Form Reference",
|
|
1134
|
+
description: "The reference field's label and errors.",
|
|
1135
|
+
schema: {
|
|
1136
|
+
type: "object",
|
|
1137
|
+
additionalProperties: false,
|
|
1138
|
+
properties: {
|
|
1139
|
+
label: {
|
|
1140
|
+
type: "string",
|
|
1141
|
+
title: "Field label",
|
|
1142
|
+
format: "icu-message",
|
|
1143
|
+
messageSource: "Reference (optional)"
|
|
1144
|
+
},
|
|
1145
|
+
requiredError: {
|
|
1146
|
+
type: "string",
|
|
1147
|
+
title: "Required field error",
|
|
1148
|
+
format: "icu-message",
|
|
1149
|
+
messageSource: "This field is required."
|
|
1150
|
+
},
|
|
1151
|
+
invalidError: {
|
|
1152
|
+
type: "string",
|
|
1153
|
+
title: "Invalid field error",
|
|
1154
|
+
format: "icu-message",
|
|
1155
|
+
messageSource: "Check this field."
|
|
1156
|
+
},
|
|
1157
|
+
tooLongError: {
|
|
1158
|
+
type: "string",
|
|
1159
|
+
title: "Too long error",
|
|
1160
|
+
format: "icu-message",
|
|
1161
|
+
messageSource: "Use {maxLength} characters or fewer.",
|
|
1162
|
+
messageArguments: {
|
|
1163
|
+
type: "object",
|
|
1164
|
+
properties: { maxLength: { type: "string" } }
|
|
1165
|
+
},
|
|
1166
|
+
messageExample: { maxLength: "750" }
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
});
|
|
857
1171
|
const AccountAddressFormReferenceDefinition = defineComponent({
|
|
858
1172
|
name: "AccountAddressFormReference",
|
|
859
1173
|
importPath: "@vtex/faststore/components",
|
|
860
1174
|
component: AccountAddressFormReference,
|
|
1175
|
+
content: AccountAddressFormReferenceContent,
|
|
861
1176
|
requiresContext: "account-address-form",
|
|
862
1177
|
editor: {
|
|
863
1178
|
label: "Account Address Form Reference",
|
|
864
1179
|
category: "input"
|
|
865
1180
|
},
|
|
866
|
-
schema: {
|
|
867
|
-
type: "string",
|
|
868
|
-
label: "Field label"
|
|
869
|
-
} },
|
|
1181
|
+
schema: {},
|
|
870
1182
|
guideline: "A landmark that helps the carrier find the address. Optional. Place it after AccountAddressFormFields. Shown once the country's rules have loaded. Must be inside AccountAddressFormRoot."
|
|
871
1183
|
});
|
|
1184
|
+
const AccountAddressFormErrorContent = defineContentType({
|
|
1185
|
+
id: "account-address-form-error",
|
|
1186
|
+
title: "Account Address Form Error",
|
|
1187
|
+
description: "Messages for an error about the whole address form.",
|
|
1188
|
+
schema: {
|
|
1189
|
+
type: "object",
|
|
1190
|
+
additionalProperties: false,
|
|
1191
|
+
properties: {
|
|
1192
|
+
unrenderedFieldMessage: {
|
|
1193
|
+
type: "string",
|
|
1194
|
+
title: "Field not shown message",
|
|
1195
|
+
format: "icu-message",
|
|
1196
|
+
messageSource: "This address needs details this form can't show, so it wasn't saved."
|
|
1197
|
+
},
|
|
1198
|
+
notFoundMessage: {
|
|
1199
|
+
type: "string",
|
|
1200
|
+
title: "Address gone message",
|
|
1201
|
+
format: "icu-message",
|
|
1202
|
+
messageSource: "This address no longer exists."
|
|
1203
|
+
},
|
|
1204
|
+
unauthorizedMessage: {
|
|
1205
|
+
type: "string",
|
|
1206
|
+
title: "Session expired message",
|
|
1207
|
+
format: "icu-message",
|
|
1208
|
+
messageSource: "Your session expired. Sign in again to save this address."
|
|
1209
|
+
},
|
|
1210
|
+
saveFailedMessage: {
|
|
1211
|
+
type: "string",
|
|
1212
|
+
title: "Save failed message",
|
|
1213
|
+
format: "icu-message",
|
|
1214
|
+
messageSource: "We couldn't save this address. Try again."
|
|
1215
|
+
},
|
|
1216
|
+
rulesFailedMessage: {
|
|
1217
|
+
type: "string",
|
|
1218
|
+
title: "Form failed to load message",
|
|
1219
|
+
format: "icu-message",
|
|
1220
|
+
messageSource: "We couldn't load this form. Close it and try again."
|
|
1221
|
+
},
|
|
1222
|
+
countrySwitchFailedMessage: {
|
|
1223
|
+
type: "string",
|
|
1224
|
+
title: "Country change failed message",
|
|
1225
|
+
format: "icu-message",
|
|
1226
|
+
messageSource: "We couldn't change the country. Try again."
|
|
1227
|
+
},
|
|
1228
|
+
unsupportedCountryMessage: {
|
|
1229
|
+
type: "string",
|
|
1230
|
+
title: "Country not delivered message",
|
|
1231
|
+
format: "icu-message",
|
|
1232
|
+
messageSource: "The store doesn't deliver to this country."
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
});
|
|
872
1237
|
const AccountAddressFormErrorDefinition = defineComponent({
|
|
873
1238
|
name: "AccountAddressFormError",
|
|
874
1239
|
importPath: "@vtex/faststore/components",
|
|
875
1240
|
component: AccountAddressFormError,
|
|
1241
|
+
content: AccountAddressFormErrorContent,
|
|
876
1242
|
requiresContext: "account-address-form",
|
|
877
1243
|
editor: {
|
|
878
1244
|
label: "Account Address Form Error",
|
|
879
1245
|
category: "content"
|
|
880
1246
|
},
|
|
1247
|
+
schema: {},
|
|
1248
|
+
guideline: "The error about the whole form, as an alert: a refusal on a field this form does not show, an address that no longer exists, an expired session, a failed save, a form that could not load, a country change that could not load, or a country the store doesn't deliver to. Renders nothing when there is none. Must be inside AccountAddressFormRoot."
|
|
1249
|
+
});
|
|
1250
|
+
const AccountAddressFormSubmitContent = defineContentType({
|
|
1251
|
+
id: "account-address-form-submit",
|
|
1252
|
+
title: "Account Address Form Submit",
|
|
1253
|
+
description: "Label of the control that saves the address form.",
|
|
881
1254
|
schema: {
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
},
|
|
886
|
-
notFoundMessage: {
|
|
887
|
-
type: "string",
|
|
888
|
-
label: "Address gone message"
|
|
889
|
-
},
|
|
890
|
-
unauthorizedMessage: {
|
|
1255
|
+
type: "object",
|
|
1256
|
+
additionalProperties: false,
|
|
1257
|
+
properties: { label: {
|
|
891
1258
|
type: "string",
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
},
|
|
898
|
-
rulesFailedMessage: {
|
|
899
|
-
type: "string",
|
|
900
|
-
label: "Form failed to load message"
|
|
901
|
-
},
|
|
902
|
-
countrySwitchFailedMessage: {
|
|
903
|
-
type: "string",
|
|
904
|
-
label: "Country change failed message"
|
|
905
|
-
},
|
|
906
|
-
unsupportedCountryMessage: {
|
|
907
|
-
type: "string",
|
|
908
|
-
label: "Country not delivered message"
|
|
909
|
-
}
|
|
910
|
-
},
|
|
911
|
-
guideline: "The error about the whole form, as an alert: a refusal on a field this form does not show, an address that no longer exists, an expired session, a failed save, a form that could not load, a country change that could not load, or a country the store doesn't deliver to. Renders nothing when there is none. Must be inside AccountAddressFormRoot."
|
|
1259
|
+
title: "Button label",
|
|
1260
|
+
format: "icu-message",
|
|
1261
|
+
messageSource: "Save"
|
|
1262
|
+
} }
|
|
1263
|
+
}
|
|
912
1264
|
});
|
|
913
1265
|
const AccountAddressFormSubmitDefinition = defineComponent({
|
|
914
1266
|
name: "AccountAddressFormSubmit",
|
|
915
1267
|
importPath: "@vtex/faststore/components",
|
|
916
1268
|
component: AccountAddressFormSubmit,
|
|
1269
|
+
content: AccountAddressFormSubmitContent,
|
|
917
1270
|
requiresContext: "account-address-form",
|
|
918
1271
|
editor: {
|
|
919
1272
|
label: "Account Address Form Submit",
|
|
920
1273
|
category: "action"
|
|
921
1274
|
},
|
|
922
|
-
schema: {
|
|
923
|
-
type: "string",
|
|
924
|
-
label: "Button label"
|
|
925
|
-
} },
|
|
1275
|
+
schema: {},
|
|
926
1276
|
guideline: "Saves the form. Disabled until the country's rules have loaded, while a country change loads, and while a save is in flight, and marked busy then. Must be inside AccountAddressFormRoot."
|
|
927
1277
|
});
|
|
1278
|
+
const AccountAddressFormCancelContent = defineContentType({
|
|
1279
|
+
id: "account-address-form-cancel",
|
|
1280
|
+
title: "Account Address Form Cancel",
|
|
1281
|
+
description: "Label of the control that closes the address form.",
|
|
1282
|
+
schema: {
|
|
1283
|
+
type: "object",
|
|
1284
|
+
additionalProperties: false,
|
|
1285
|
+
properties: { label: {
|
|
1286
|
+
type: "string",
|
|
1287
|
+
title: "Button label",
|
|
1288
|
+
format: "icu-message",
|
|
1289
|
+
messageSource: "Cancel"
|
|
1290
|
+
} }
|
|
1291
|
+
}
|
|
1292
|
+
});
|
|
928
1293
|
const AccountAddressFormCancelDefinition = defineComponent({
|
|
929
1294
|
name: "AccountAddressFormCancel",
|
|
930
1295
|
importPath: "@vtex/faststore/components",
|
|
931
1296
|
component: AccountAddressFormCancel,
|
|
1297
|
+
content: AccountAddressFormCancelContent,
|
|
932
1298
|
requiresContext: "account-address-form",
|
|
933
1299
|
editor: {
|
|
934
1300
|
label: "Account Address Form Cancel",
|
|
935
1301
|
category: "action"
|
|
936
1302
|
},
|
|
937
|
-
schema: {
|
|
938
|
-
type: "string",
|
|
939
|
-
label: "Button label"
|
|
940
|
-
} },
|
|
1303
|
+
schema: {},
|
|
941
1304
|
guideline: "Closes the form and drops what was typed. On its own page it goes to the returnHref of its root. Must be inside AccountAddressFormRoot."
|
|
942
1305
|
});
|
|
943
1306
|
//#endregion
|
|
944
|
-
export { AccountAddressFormCancel, AccountAddressFormCancelDefinition, AccountAddressFormError, AccountAddressFormErrorDefinition, AccountAddressFormFields, AccountAddressFormFieldsDefinition, AccountAddressFormRecipientName, AccountAddressFormRecipientNameDefinition, AccountAddressFormReference, AccountAddressFormReferenceDefinition, AccountAddressFormRoot, AccountAddressFormRootDefinition, AccountAddressFormSubmit, AccountAddressFormSubmitDefinition };
|
|
1307
|
+
export { AccountAddressFormCancel, AccountAddressFormCancelContent, AccountAddressFormCancelDefinition, AccountAddressFormContent, AccountAddressFormError, AccountAddressFormErrorContent, AccountAddressFormErrorDefinition, AccountAddressFormFields, AccountAddressFormFieldsContent, AccountAddressFormFieldsDefinition, AccountAddressFormRecipientName, AccountAddressFormRecipientNameContent, AccountAddressFormRecipientNameDefinition, AccountAddressFormReference, AccountAddressFormReferenceContent, AccountAddressFormReferenceDefinition, AccountAddressFormRoot, AccountAddressFormRootDefinition, AccountAddressFormSubmit, AccountAddressFormSubmitContent, AccountAddressFormSubmitDefinition };
|
|
945
1308
|
|
|
946
1309
|
//# sourceMappingURL=account-address-form.js.map
|