@vtex/faststore 0.0.8 → 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 +101 -0
- package/README.md +0 -1
- package/dist/actions.json +48 -1
- package/dist/catalog.json +1397 -1594
- 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 +67 -56
- package/dist/components.js +64 -53
- package/dist/content-types.json +5886 -555
- package/dist/core/dist/define-component.d.ts +7 -2
- 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-entry-point.md +4 -4
- package/dist/docs/account-menu.md +16 -17
- package/dist/docs/account-saved-cards.md +306 -0
- 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 +157 -0
- package/dist/docs/buy-button.md +7 -8
- package/dist/docs/card-entry.md +42 -29
- package/dist/docs/card-summary.md +185 -0
- package/dist/docs/cardholder-document.md +5 -3
- package/dist/docs/carousel.md +5 -4
- package/dist/docs/cart-destination.md +251 -0
- package/dist/docs/cart-item.md +48 -15
- package/dist/docs/cart-totalizer.md +8 -6
- package/dist/docs/cart.md +240 -39
- 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/footer-social.md +1 -1
- package/dist/docs/form.md +54 -18
- package/dist/docs/free-shipping-progress.md +18 -13
- package/dist/docs/identity-edit.md +8 -2
- package/dist/docs/identity-summary.md +18 -5
- package/dist/docs/incentives.md +2 -2
- package/dist/docs/installments.md +46 -32
- package/dist/docs/logo.md +1 -1
- 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 +32 -6
- package/dist/docs/payment-methods.md +2 -2
- 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 +14 -10
- package/dist/docs/product-list.md +7 -6
- package/dist/docs/product-shelf.md +7 -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/select.md +3 -4
- 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 +5 -3
- package/dist/docs/sign-in.md +173 -0
- package/dist/docs/toast.md +45 -16
- package/dist/docs/variant-selector.md +15 -11
- package/dist/graphql/types.d.ts +4 -14
- package/dist/index.d.ts +3 -2
- package/dist/internal/client.d.ts +4 -3
- package/dist/internal/client.js +5 -2
- package/dist/internal/server.d.ts +10 -5
- package/dist/internal/server.js +9 -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 +463 -0
- package/dist/matter/account-saved-cards/account-saved-cards.js +1011 -0
- package/dist/matter/account-saved-cards/account-saved-cards.js.map +1 -0
- 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 +11 -1
- package/dist/matter/cart/cart-namespace.js +11 -1
- package/dist/matter/cart/cart-namespace.js.map +1 -1
- package/dist/matter/cart/cart.d.ts +416 -45
- package/dist/matter/cart/cart.js +782 -101
- package/dist/matter/cart/cart.js.map +1 -1
- package/dist/matter/cart-destination/cart-destination.d.ts +233 -0
- package/dist/matter/cart-destination/cart-destination.js +703 -0
- package/dist/matter/cart-destination/cart-destination.js.map +1 -0
- package/dist/matter/cart-item/cart-item.d.ts +145 -16
- package/dist/matter/cart-item/cart-item.js +230 -54
- 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 +49 -19
- 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 +85 -10
- package/dist/matter/free-shipping-progress/free-shipping-progress.js +153 -53
- 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 +8 -3
- package/dist/matter/product-shelf/product-shelf.js +111 -10
- 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 +251 -25
- package/dist/matter/shipping-simulator/shipping-simulator.js +261 -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 +59 -0
- package/dist/particles/binding-switcher/binding-switcher.js +194 -0
- package/dist/particles/binding-switcher/binding-switcher.js.map +1 -0
- package/dist/particles/card-summary/card-network.d.ts +17 -0
- package/dist/particles/card-summary/card-network.js +25 -0
- package/dist/particles/card-summary/card-network.js.map +1 -0
- package/dist/particles/card-summary/card-summary.d.ts +113 -0
- package/dist/particles/card-summary/card-summary.js +221 -0
- package/dist/particles/card-summary/card-summary.js.map +1 -0
- 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/footer-social/footer-social.d.ts +1 -1
- package/dist/particles/footer-social/footer-social.js +1 -1
- package/dist/particles/footer-social/footer-social.js.map +1 -1
- package/dist/particles/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/incentives/incentives.d.ts +1 -1
- package/dist/particles/incentives/incentives.js +1 -1
- package/dist/particles/incentives/incentives.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/payment-methods/payment-methods.d.ts +1 -1
- package/dist/particles/payment-methods/payment-methods.js +1 -1
- package/dist/particles/payment-methods/payment-methods.js.map +1 -1
- package/dist/particles/phone-field/phone-field.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 +49 -9
- package/dist/particles/toast/toast.js +81 -15
- package/dist/particles/toast/toast.js.map +1 -1
- package/dist/schema.graphql +461 -89
- package/dist/sdk/actions/index.d.ts +3 -1
- package/dist/sdk/actions/index.js +3 -1
- package/dist/sdk/actions/locale-action-provider.d.ts +16 -0
- package/dist/sdk/actions/locale-action-provider.js +20 -0
- package/dist/sdk/actions/locale-action-provider.js.map +1 -0
- package/dist/sdk/actions/saved-card-action-provider.d.ts +12 -0
- package/dist/sdk/actions/saved-card-action-provider.js +16 -0
- package/dist/sdk/actions/saved-card-action-provider.js.map +1 -0
- package/dist/sdk/actions/types.d.ts +6 -2
- 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/cache/storefront-cache.js +2 -1
- package/dist/sdk/cache/storefront-cache.js.map +1 -1
- package/dist/sdk/cart/operations.d.ts +2 -1
- package/dist/sdk/cart/operations.js +55 -1
- package/dist/sdk/cart/operations.js.map +1 -1
- package/dist/sdk/cart/optimistic.d.ts +30 -7
- package/dist/sdk/cart/optimistic.js +78 -41
- package/dist/sdk/cart/optimistic.js.map +1 -1
- package/dist/sdk/cart/use-cart-actions.d.ts +7 -0
- package/dist/sdk/cart/use-cart-actions.js +61 -15
- package/dist/sdk/cart/use-cart-actions.js.map +1 -1
- package/dist/sdk/cart/use-cart-sync-sales-channel.js +70 -0
- package/dist/sdk/cart/use-cart-sync-sales-channel.js.map +1 -0
- package/dist/sdk/data/index.js +2 -2
- package/dist/sdk/data/reactive-list-item-data-provider.js +2 -2
- package/dist/sdk/generated/gql.js +16 -12
- package/dist/sdk/generated/gql.js.map +1 -1
- package/dist/sdk/generated/graphql.d.ts +197 -51
- package/dist/sdk/generated/graphql.js +2318 -91
- 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/locale/binding-switch-provider.d.ts +13 -0
- package/dist/sdk/locale/binding-switch-provider.js +20 -0
- package/dist/sdk/locale/binding-switch-provider.js.map +1 -0
- package/dist/sdk/locale/use-locale-actions.d.ts +16 -0
- package/dist/sdk/locale/use-locale-actions.js +70 -0
- package/dist/sdk/locale/use-locale-actions.js.map +1 -0
- package/dist/sdk/navigation/binding-switch.d.ts +39 -0
- package/dist/sdk/navigation/binding-switch.js +129 -0
- package/dist/sdk/navigation/binding-switch.js.map +1 -0
- package/dist/sdk/navigation/decode-route-params.d.ts +11 -0
- package/dist/sdk/navigation/decode-route-params.js +32 -0
- package/dist/sdk/navigation/decode-route-params.js.map +1 -0
- package/dist/sdk/navigation/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/saved-cards/operations.d.ts +16 -0
- package/dist/sdk/saved-cards/operations.js +41 -0
- package/dist/sdk/saved-cards/operations.js.map +1 -0
- package/dist/sdk/saved-cards/use-saved-card-actions.d.ts +26 -0
- package/dist/sdk/saved-cards/use-saved-card-actions.js +86 -0
- package/dist/sdk/saved-cards/use-saved-card-actions.js.map +1 -0
- package/dist/sdk/seo/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 +8 -5
- package/dist/sdk/seo/page-alternates.js +11 -14
- 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/shipping-operations.d.ts +1 -1
- package/dist/sdk/shipping/shipping-operations.js +13 -0
- package/dist/sdk/shipping/shipping-operations.js.map +1 -1
- package/dist/sdk/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/sdk/state/cart.d.ts +9 -2
- package/dist/sdk/state/cart.js +9 -2
- package/dist/sdk/state/cart.js.map +1 -1
- package/dist/utils/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 +9 -2
- 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 -164
- package/dist/sdk/i18n/messages/en-US.js.map +0 -1
- package/dist/sdk/i18n/messages/en-US.json +0 -159
- package/dist/sdk/i18n/messages/en-US.json.d.ts +0 -163
- package/dist/sdk/i18n/messages/es-ES.js +0 -164
- package/dist/sdk/i18n/messages/es-ES.js.map +0 -1
- package/dist/sdk/i18n/messages/es-ES.json +0 -159
- package/dist/sdk/i18n/messages/pt-BR.js +0 -164
- package/dist/sdk/i18n/messages/pt-BR.js.map +0 -1
- package/dist/sdk/i18n/messages/pt-BR.json +0 -159
- 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
package/dist/docs/payment.md
CHANGED
|
@@ -80,8 +80,19 @@ Both providers declare `providesContext: ['payment', 'card-capture']`. Every lea
|
|
|
80
80
|
| Prop | Type | Default | Notes |
|
|
81
81
|
|------|------|---------|-------|
|
|
82
82
|
| `group` | string, or array of strings | `["creditCardPaymentGroup", "debitCardPaymentGroup"]` | Scopes the method list to a set of payment groups — a method renders when its `groupName` is a member. A single string still scopes to exactly that one group. Set to `""` (the empty **string**) to show every method the store offers. An empty **array** (`[]`) is not a second spelling of that opt-out — it matches no group, so every method is scoped out and the list renders empty. It only *filters* — it never supplies methods. |
|
|
83
|
+
| `groupOrder` | string, or array of strings | none | The order of the rows in `PaymentMethodList`, as payment group names (`PaymentMethod.groupName`) — copy them from the store's own order-form data, because a name matches **exactly** (case-sensitive, nothing trimmed) and one the store does not use (`pixPaymentGroup` for `instantPaymentPaymentGroup`) is silently ignored. A method's row takes its group's position in the list; the one card option takes the position of the first of its groups (`creditCardPaymentGroup`, `debitCardPaymentGroup`) that the list names and the store offers. A group the list **leaves out** still shows, after the named ones, in the order form's order, with the card option first among them. It only orders: it never hides, adds or renames a method, never changes which method is preselected, and never changes which method a typed card number selects. Unset or `[]` keeps the order form's order, the card option first. A single string is a list of one. |
|
|
83
84
|
|
|
84
|
-
|
|
85
|
+
To put Pix above the card option and keep Boleto last, with a store whose Pix group is `instantPaymentPaymentGroup`:
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{ "group": ["creditCardPaymentGroup", "instantPaymentPaymentGroup", "boletoPaymentGroup"], "groupOrder": ["instantPaymentPaymentGroup", "creditCardPaymentGroup"] }
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
The rows read `Pix`, `Pay with Credit / Debit Card`, `Boleto`: Pix and the card option are named, and Boleto, which the list leaves out, follows them.
|
|
92
|
+
|
|
93
|
+
The order is display-only. `PaymentMethodList` sorts a copy of its own rows, and the `methods` and `allMethods` the other leaves read keep the order form's order (`orderMethodListRows` in `use-payment-method-selection.ts`; pinned in `use-payment-method-selection.test.tsx`). That separation matters for money: a typed card number resolves to the first method in `methods` order whose pattern matches, so sorting `methods` would let the merchant's order change which method an order is charged under. The same reason keeps `methods` the same array as `allMethods` under `group: ""`. The sorted card option takes the position of the first card group the list names that the store actually offers, so naming a debit group the store does not sell cannot pull the card option ahead of rows the merchant listed. The normalized list is published on the `payment` context as `groupOrder`, which keeps its identity while its content is equal. The badge strips (`PaymentMethodBadges`, `AcceptedPaymentMethodBadges`) do not follow it.
|
|
94
|
+
|
|
95
|
+
**Data:** declares `fragment PaymentSectionData on Query`, which selects three root fields: `Query.payment` (the method list with its validator config, plus `selectedMethodId` / `selectedAccountId` / `selectedBin`), `Query.cart.total`, for the `add_payment_info` event, and `Query.clientProfile` (`firstName`, `lastName`, `phone`), for the place-order check. The compiler merges it into the page query — no `dataSources` entry needed — and, because it has three root fields, delivers `$data` keyed as `{ payment, cart, clientProfile }` (ADR-0015). The profile reaches the `payment` context as `clientProfile`: absent or `null` means it was not read and never refuses, an object means it was read, even with every field `null`. `fetchStrategy: 'reactive'` — picking a method re-renders the whole section from the cache, no refetch.
|
|
85
96
|
|
|
86
97
|
**Writes:** `actions: { payment: ['setMethod', 'sendPayments'], analytics: ['track'] }`. Selecting a method dispatches `setMethod`. The root also provides `card-capture` to `CardEntry`: when the place-order sequence runs the `new-card` submission, `CardEntry` builds the card and the root folds in the draft's document, label, and save flag and sends it through `sendPayments`. Once a `CardEntry` is mounted and the cart total has resolved, the root fires `add_payment_info` once.
|
|
87
98
|
|
|
@@ -89,18 +100,24 @@ Renders one container `div` and its children. No heading, no copy, no layout —
|
|
|
89
100
|
|
|
90
101
|
### PaymentSectionController
|
|
91
102
|
|
|
92
|
-
Same props, same fragment shape, same action. Renders **no element at all**: it holds the overlay's open state and hands it to its single overlay child. Unlike the delivery-options controller, a successful method selection does **not** close the surface — the shopper still has a card to type — so close it from a `DrawerClose` / `DialogClose` particle or from the leaf that finishes the flow.
|
|
103
|
+
Same props (including `groupOrder`, which orders the popup's `PaymentMethodList` the same way), same fragment shape, same action. Renders **no element at all**: it holds the overlay's open state and hands it to its single overlay child. Unlike the delivery-options controller, a successful method selection does **not** close the surface — the shopper still has a card to type — so close it from a `DrawerClose` / `DialogClose` particle or from the leaf that finishes the flow.
|
|
93
104
|
|
|
94
105
|
### PaymentMethodList
|
|
95
106
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
107
|
+
No copy props.
|
|
108
|
+
|
|
109
|
+
**Content model** (`payment-method-list`):
|
|
110
|
+
|
|
111
|
+
- `legend`: the radio group's accessible name, rendered as a visible fieldset legend above the rows (T38).
|
|
112
|
+
- `cardLabel`: the card option's own name (T171). One control stands for every in-scope credit and debit method at once, so it cannot be labelled from one method's name — this is the copy instead.
|
|
113
|
+
|
|
114
|
+
- `genericErrorMessage`: the inline alert for a refused method selection. Every `PaymentMethodSelectErrorCode` and `NETWORK_ERROR` reads it: none is one the shopper can fix from this list. A code the package does not know (one a newer server added) also reads it and logs `message.unknown-code`.
|
|
115
|
+
|
|
116
|
+
Every message is read only from `$content`. A missing message renders empty and logs `message.missing`.
|
|
100
117
|
|
|
101
118
|
Renders the inline selection error (`role="alert"`) and the payment options, inside a fieldset named by `legend`. Requires a payment-section ancestor.
|
|
102
119
|
|
|
103
|
-
**Every in-scope credit and debit method is one option**, named by `cardLabel` — not one row per network. Which card network the shopper is paying with comes from the number they type into the card form, which is the only mechanism that can be right: a shopper who picked "Visa" and then typed a Mastercard number had their pick silently overwritten. Every other in-scope method (e.g. Pix) keeps its own row, labelled with the method's name from the order form and bound to that method's own id, exactly as before. Only
|
|
120
|
+
**Every in-scope credit and debit method is one option**, named by `cardLabel` — not one row per network. Which card network the shopper is paying with comes from the number they type into the card form, which is the only mechanism that can be right: a shopper who picked "Visa" and then typed a Mastercard number had their pick silently overwritten. Every other in-scope method (e.g. Pix) keeps its own row, labelled with the method's name from the order form and bound to that method's own id, exactly as before. Only methods whose `type` is `CREDIT_CARD` or `DEBIT_CARD` fold into the card option — a card-like custom method the API types as `OTHER` keeps a row of its own. Set `group` to `""` on the root to switch the folding off entirely and get one row per method; the card form still hides for a non-card row and comes back for a card row (see below).
|
|
104
121
|
|
|
105
122
|
The card option reads as checked while the persisted selection is one of the methods it stands for, **and while nothing is persisted at all** — the card option is the default — and while the section is in card mode (below). It is not bound to any single method id, so activating it dispatches the same candidate the preselection rule would choose (the sole in-scope method, else the sole method in the credit group). When neither is singular — a store with Visa and Mastercard — it dispatches nothing and puts the section in **card mode** instead: the card form comes back at once, the option reads checked, and the method arrives from the typed number. No made-up `"card"` method id is ever sent: the only ids that reach `payment.setMethod` are ids the order form offered.
|
|
106
123
|
|
|
@@ -110,11 +127,11 @@ The container always carries `data-fs-payment-method-list-state` — `"loading"`
|
|
|
110
127
|
|
|
111
128
|
### Preselection and the card-payment collapse
|
|
112
129
|
|
|
113
|
-
When the order form carries no persisted selection and the scoped method list resolves to exactly one method, the section preselects it automatically — one silent `payment.setMethod` dispatch, keyed on that method's id, never on row position. When the scoped list holds more than one method, the section falls back to the sole method in the credit group, if there is exactly one — so a store offering one credit and one debit method keeps preselecting the credit one, the same method it preselected before debit was admitted. **"The credit group" here is always the
|
|
130
|
+
When the order form carries no persisted selection and the scoped method list resolves to exactly one method, the section preselects it automatically — one silent `payment.setMethod` dispatch, keyed on that method's id, never on row position. When the scoped list holds more than one method, the section falls back to the sole method in the credit group, if there is exactly one — so a store offering one credit and one debit method keeps preselecting the credit one, the same method it preselected before debit was admitted. **"The credit group" here is always the methods whose `type` is `CREDIT_CARD`, not whichever member of `group` the store authored** — a store that renamed its credit payment group and listed the new name in `group` gets that method rendered and selectable, but not preselected (the API types an unknown group `OTHER`), and its `add_payment_info` `payment_type` stays unset once picked, because both derive from `PaymentMethod.type` rather than from the store's authored scope. Every other shape preselects nothing. Nothing is preselected while loading, while an order-placement sequence is in flight, when a method or saved-card account is already persisted (in scope or out of it), once a candidate id has already been attempted once, or when `group` is `""` (fix pass, finding R4). Preselection takes no card expression: under `group=""` it stays off even for a single card method, and naming the credit group for the tiebreak never runs there at all. A failed preselection is logged, never shown as `role="alert"` — the shopper never asked for that dispatch.
|
|
114
131
|
|
|
115
132
|
The rule lives in the shared selection engine, not in `PaymentMethodList`: it fires even when no picker is composed, and before a `PaymentSectionController`'s overlay is ever opened.
|
|
116
133
|
|
|
117
|
-
The same engine derives the one collapse fact every card leaf reads (T191). **The card payment collapses** while the persisted selection is a method this section does not serve — an id that does not resolve inside the scoped list — or a method that is **not a card**: one
|
|
134
|
+
The same engine derives the one collapse fact every card leaf reads (T191). **The card payment collapses** while the persisted selection is a method this section does not serve — an id that does not resolve inside the scoped list — or a method that is **not a card**: one whose `type` is neither `CREDIT_CARD` nor `DEBIT_CARD` and whose validator carries no card-number pattern. A store's card-like custom method, typed `OTHER` but with a number pattern, is a card and hides nothing. While collapsed, `CardEntry` hides itself and stays mounted, and `SavedCards`, `CardholderDocument`, `Installments`, `InstallmentsSelect`, `SaveCard` and `BillingAddress` render nothing; `PlaceOrder`, `PaymentMethodList` and `PaymentMethodBadges` stay. See each leaf's own doc for what it keeps for the way back.
|
|
118
135
|
|
|
119
136
|
**The card option brings them back**, with or without a method it can name. With one, it dispatches it, and the leaves return once the order form confirms the selection. With none, it puts the section in card mode, locally — nothing is sent — and the leaves return at once; a card number already typed with at least eight digits is then sent again, once, for its own network. Card mode ends when another method that is not a card is picked and the order form accepts it; a refused pick leaves the shopper on the card, with the refusal in this component's `role="alert"`. Card mode is not persisted: a reload starts over from the order form's selection. Under `group=""` the collapse classifies the same way: a non-card row hides the leaves and a card row brings them back.
|
|
120
137
|
|
|
@@ -158,15 +175,17 @@ Hiding is also conditioned on a composed `PaymentMethodList` being able to bring
|
|
|
158
175
|
| `PaymentSectionRoot` (root `div`) | Stacks the section's parts | `flex flex-col gap-6` |
|
|
159
176
|
| `PaymentMethodList` (root `div`) | Stacks the payment options and the error | `flex flex-col gap-2` |
|
|
160
177
|
| Fieldset (`data-fs-payment-method-list-fieldset`, native `<fieldset>`) | Wraps the legend and the radio rows (T38) — gives the group its visible, accessible name | usually left unstyled; a merchant border/padding choice |
|
|
161
|
-
| Legend (`data-fs-fieldset-legend`, native `<legend>`) | The group's visible name, from `legend` | `text-[14px] font-medium text-[
|
|
178
|
+
| Legend (`data-fs-fieldset-legend`, native `<legend>`) | The group's visible name, from `legend` | `text-[14px] font-medium text-[var(--color-ink)]` |
|
|
162
179
|
| Empty / loading picker (`data-fs-payment-method-list-state`) | Keeps the row-less container visible | `data-[fs-payment-method-list-state=empty]:min-h-12` |
|
|
163
|
-
| Option row (`data-fs-radio-root`) | Each selectable option — the card option and any standalone method row alike | `flex items-center gap-3 border border-[
|
|
164
|
-
| Indicator (`data-fs-payment-method-indicator`) | The selected dot. Present on the card option too | `size-2 rounded-full bg-[
|
|
165
|
-
| Method name (`data-fs-payment-method-name`) | The option's label — `cardLabel` on the card option, `method.name` on a standalone row | `text-[14px] text-[
|
|
166
|
-
| Error (`data-fs-payment-method-list-error`) | Rejected-selection message | `text-[12px]
|
|
180
|
+
| Option row (`data-fs-radio-root`) | Each selectable option — the card option and any standalone method row alike | `flex items-center gap-3 border border-[color-mix(in_srgb,var(--color-ink)_20%,transparent)] p-3` |
|
|
181
|
+
| Indicator (`data-fs-payment-method-indicator`) | The selected dot. Present on the card option too | `size-2 rounded-full bg-[var(--color-primary)]` |
|
|
182
|
+
| Method name (`data-fs-payment-method-name`) | The option's label — `cardLabel` on the card option, `method.name` on a standalone row | `text-[14px] text-[var(--color-ink)]` |
|
|
183
|
+
| Error (`data-fs-payment-method-list-error`) | Rejected-selection message | `text-[12px]` |
|
|
167
184
|
| Placing, section (`data-fs-payment-section-placing`) | Present on `PaymentSectionRoot`'s own container while an order-placement sequence is in flight (T28) — presence only; this container is never made `inert` (see the warning below) | `opacity-90` |
|
|
168
185
|
| Placing, method list (`data-fs-payment-method-list-placing`) | Present on `PaymentMethodList`'s own root while placing; the picker is also `inert` and `aria-disabled` at that point | `opacity-60 cursor-not-allowed` |
|
|
169
186
|
|
|
187
|
+
A status color is a `visualIdentity` feedback role of the foundation: when the store declares them, color the error row `text-[var(--color-feedback-danger)]`, the success row `text-[var(--color-feedback-success)]` and the notice row `text-[var(--color-feedback-warning)]`, never with a hex.
|
|
188
|
+
|
|
170
189
|
State hooks worth styling:
|
|
171
190
|
|
|
172
191
|
- `data-fs-payment-section-path="new-card"` / `="saved-card"` on the section container — present only once a path resolves, so a swatch can emphasize the active half of the section.
|
|
@@ -195,9 +214,9 @@ Styled example:
|
|
|
195
214
|
## Accessibility Contract
|
|
196
215
|
|
|
197
216
|
**What the platform promises:** `PaymentMethodList`'s radio group carries a visible, programmatic
|
|
198
|
-
accessible name (`legend
|
|
199
|
-
|
|
200
|
-
|
|
217
|
+
accessible name (the `legend` message) — a screen-reader user hears what the rows are a choice
|
|
218
|
+
*between*, not just "radio button, 1 of 3." A store that leaves `legend` unauthored ships a nameless
|
|
219
|
+
group, and the formatter logs `message.missing`. Each row keeps its own accessible name
|
|
201
220
|
from the method's own display name. The group is a native `<fieldset>`/`<legend>` pair (not `aria-label`
|
|
202
221
|
on a `<div>`), so it is also visible to sighted and low-vision shoppers and reachable by page-level
|
|
203
222
|
translation tooling. Keyboard: the group is one Tab stop — Tab lands on the checked row, and the arrow
|
package/dist/docs/phone-field.md
CHANGED
|
@@ -57,13 +57,13 @@ RFC's named double-binder hole.
|
|
|
57
57
|
| `defaultValue` | string | `''` | Uncontrolled initial raw value (pre-fill). |
|
|
58
58
|
| `onValueChange` | `(value: string) => void` | — | Fires on every change with the raw (unmasked) value. |
|
|
59
59
|
| `country` | `'US' \| 'BR'` | `'US'` | Selects the mask and validation rule; other codes fall back to US. |
|
|
60
|
-
| `label` | string |
|
|
60
|
+
| `label` | string | — | Accessible label, formatted by the owner from its own message field. Unbound and omitted, it renders empty. |
|
|
61
61
|
| `isDisabled` | boolean | `false` | Disables the input (e.g. while a write is in flight). |
|
|
62
62
|
| `placeholder` | string | — | Input placeholder. |
|
|
63
63
|
| `invalid` | boolean | — | Host-forced invalid state; overrides the internal blur validation when set. |
|
|
64
64
|
| `error` | string | — | Host-supplied error text; overrides the internal error string when set. |
|
|
65
|
-
| `errorInvalid` | string |
|
|
66
|
-
| `errorRequired` | string |
|
|
65
|
+
| `errorInvalid` | string | — | Inline error for an invalid format, formatted by the owner. Omitted, the field is still invalid but shows no text. |
|
|
66
|
+
| `errorRequired` | string | — | Inline error when a mandatory field is empty, formatted by the owner. Omitted, the field is still invalid but shows no text. |
|
|
67
67
|
| `requirement` | `'mandatory' \| 'optional'` | — | `mandatory`: empty blocks; `optional`: empty allowed, format still checked when present. Unset is no opinion, so a phone with no fieldset baseline is optional. It only ever raises — bound to a fieldset whose rule already says required, `'optional'` does not lower it. There is no value that suppresses the field: a store that does not want it removes the particle from the page instead (`rfc-user-identity.md` F9). |
|
|
68
68
|
| `onBlur` | `() => void` | — | Fires on blur, after validation runs. |
|
|
69
69
|
| `ref` | `Ref<HTMLInputElement>` | — | Lands on the masked `<input type="tel">`. Composed with react-hook-form's own ref on the bound path — a caller ref and react-hook-form's ref are both honoured. |
|
|
@@ -148,7 +148,7 @@ trade of Decision 4; widen store CSS keyed on the specific hooks if it must also
|
|
|
148
148
|
|
|
149
149
|
- **Validating on every keystroke.** Format validation runs on blur/submit only.
|
|
150
150
|
- **Wiring GraphQL into this particle.** It is data-agnostic; use `ClientProfilePhoneControl` for the checkout-bound binding.
|
|
151
|
-
- **
|
|
151
|
+
- **Expecting package copy.** The particle has none. Its owner (`ClientProfilePhoneControl`, `ClientProfileFieldsetPhoneControl`, `MyAccountProfilePhoneControl`) formats `label` / `errorInvalid` / `errorRequired` from its own message fields and passes the strings.
|
|
152
152
|
- **Reading the masked value.** `onValueChange` emits the raw (unmasked) value — persist that, not the display string.
|
|
153
153
|
|
|
154
154
|
---
|
package/dist/docs/place-order.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# PlaceOrder
|
|
2
2
|
|
|
3
3
|
**Category:** commerce
|
|
4
|
-
**Purpose:** The checkout's place-order CTA. Runs the three-call payment sequence (start transaction, the holder's direct-to-gateway submission, gateway callback), blocks interaction while it runs, and renders one inline outcome — an error message or a success confirmation — once it settles, plus an optional status message while it runs.
|
|
4
|
+
**Purpose:** The checkout's place-order CTA. Runs the three-call payment sequence (start transaction, the holder's direct-to-gateway submission, gateway callback), blocks interaction while it runs, and renders one inline outcome — an error message or a success confirmation — once it settles, plus an optional status message while it runs. When the bank asks for a 3D Secure challenge and the store authored a return page (`challengeReturnHref`), it sends the shopper to the bank instead, and the [[challenge-return]] page finishes the order.
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -43,7 +43,7 @@ PaymentSectionRoot (or PaymentSectionController)
|
|
|
43
43
|
|
|
44
44
|
Child order reflects visual order. `PlaceOrder` composes under **either** payment root with no change — both provide the same `payment` context and the same submission channel (ADR-0009).
|
|
45
45
|
|
|
46
|
-
`PlaceOrder` never reads or holds a card field. It calls `usePlaceOrder`, the
|
|
46
|
+
`PlaceOrder` never reads or holds a card field. It calls `usePlaceOrder`, the orchestration hook, which resolves a continuation that `CardEntry`/`SavedCards` registered on a submission channel by the shopper's entry path — this component only knows there is a hook to call, a loading state to block on, and an outcome to render. It also reads `usePayment().draft.billingAddressDifferent` and forwards it into `usePlaceOrder`, so the gateway descriptor carries whether the shopper picked a different billing address — the one other fact this component touches, and still not a card field.
|
|
47
47
|
|
|
48
48
|
---
|
|
49
49
|
|
|
@@ -51,32 +51,73 @@ Child order reflects visual order. `PlaceOrder` composes under **either** paymen
|
|
|
51
51
|
|
|
52
52
|
### PlaceOrder
|
|
53
53
|
|
|
54
|
-
No sub-components. Renders a button, an optional status region while the sequence runs (only when `placingMessage` is authored), and, once the sequence has settled, one inline outcome region (error or success).
|
|
54
|
+
No sub-components. Renders a button, an optional status region while the sequence runs (only when the `placingMessage` message is authored), and, once the sequence has settled, one inline outcome region (error or success).
|
|
55
55
|
|
|
56
56
|
| Prop | Type | Default | Notes |
|
|
57
57
|
|------|------|---------|-------|
|
|
58
|
-
| `
|
|
59
|
-
| `
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
|
64
|
-
|
|
65
|
-
| `
|
|
66
|
-
| `
|
|
67
|
-
| `
|
|
68
|
-
| `
|
|
69
|
-
| `
|
|
70
|
-
| `
|
|
71
|
-
| `
|
|
72
|
-
| `
|
|
73
|
-
| `
|
|
74
|
-
| `
|
|
75
|
-
| `
|
|
76
|
-
| `
|
|
77
|
-
| `
|
|
78
|
-
|
|
79
|
-
|
|
58
|
+
| `successHref` | page reference or string | `{ "standard": "order-placed" }` | Page navigated to after a successful placement. A page reference gets the placed order's Node id (`orderNodeId`) as its `orderId` param, percent-encoded. A string is a logical path of this store, navigated as written under the binding's base path. **Success-gated**: the navigation is requested only once an attempt settles with no errors and a non-null order Node id — never on a refusal. |
|
|
59
|
+
| `challengeReturnHref` | page reference | *(none)* | The page the bank sends the shopper back to after a 3D Secure challenge: a page of this store that composes [[challenge-return]], e.g. `{ "page": "checkout-challenge-return" }`. A page reference only; a string, or a page the route map does not hold, is refused with a dev-only `console.warn` naming this prop. No default, because a standard page cannot name a return page. Absent: no return URL is sent and a bank challenge is refused as before. |
|
|
60
|
+
|
|
61
|
+
**Content model** (`place-order`): every label and message below is an ICU message field with no arguments. Each reads only from `$content`: an unauthored label or refusal message renders empty and logs `message.missing`. A store without CMS authors the fields on the element, as below; a CMS-bound store keeps them in content.
|
|
62
|
+
|
|
63
|
+
| Field | Message source | Notes |
|
|
64
|
+
|-------|----------------|-------|
|
|
65
|
+
| `label` | `"Place order"` | Button label while idle. |
|
|
66
|
+
| `placingLabel` | `"Placing order..."` | Button label while the sequence is in flight. |
|
|
67
|
+
| `placingMessage` | `"Processing your payment. Please keep this page open."` | Status message in its own `role="status"` region beside the button while the order is being placed. Read only while placing: a missing or blank message renders no region, and a missing one logs `message.missing`. The button text while placing stays `placingLabel`. |
|
|
68
|
+
| `resumeLabel` | `"Complete your order"` | Button label while a surviving attempt offers a resume — the card already left the browser (or its fate is unknown) and the next click finalizes it instead of running the full sequence again. |
|
|
69
|
+
| `successMessage` | `"Order placed successfully."` | Shown once the sequence settles with no errors. |
|
|
70
|
+
| `missingSubmissionMessage` | `"Enter your payment details before placing the order."` | Shown when `placeOrder()` is invoked with no registered submission for the current path (e.g. the shopper never finished entering a card). |
|
|
71
|
+
| `missingMethodMessage` | `"Choose a payment method before placing the order."` | Shown when no payment method is selected yet. |
|
|
72
|
+
| `invalidTransactionMessage` | `"Unable to start the payment. Please try again."` | Shown when `startTransaction` resolves incomplete transaction data. |
|
|
73
|
+
| `networkErrorMessage` | `"Unable to complete the request. Please try again."` | Shown for an infrastructure-level failure reaching the payment gateway action. |
|
|
74
|
+
| `missingDocumentMessage` | `"Enter your document before placing the order."` | Shown when the selected method requires a cardholder document and none is set. |
|
|
75
|
+
| `invalidDocumentMessage` | `"Enter a valid document before placing the order."` | Shown when the typed cardholder document fails validation. |
|
|
76
|
+
| `unavailableMethodMessage` | `"Choose another payment method before placing the order."` | Shown instead of the two document messages above when the selected method calls for a cardholder document the page is not showing — a method the card form cannot pay with, or one outside the payment root's `group` — so the shopper has to choose another payment method. |
|
|
77
|
+
| `unsavedBillingAddressMessage` | `"Save your billing address before placing the order."` | Shown when the shopper declined "same as delivery" but never saved a custom billing address. |
|
|
78
|
+
| `missingProfileNameMessage` | `"Enter your first and last name before placing the order."` | Shown when the cart's profile has no first name or no last name. See the cart-profile check below. |
|
|
79
|
+
| `missingProfilePhoneMessage` | `"Enter your phone number before placing the order."` | Shown when the cart's profile has a first and last name but no phone. See the cart-profile check below. |
|
|
80
|
+
| `invalidCardDataMessage` | `"Enter valid card details before placing the order."` | Shown when the new-card draft itself fails validation before ever reaching the gateway. |
|
|
81
|
+
| `unsupportedNetworkMessage` | `"This card is not from a network the store accepts. Use another card or choose another payment method."` | Shown when the typed card number is well-formed but no network the store accepts claims it, whether or not a payment method is selected. |
|
|
82
|
+
| `invalidSecurityCodeMessage` | `"Enter a valid security code before placing the order."` | Shown when a saved-card submission is refused for a missing or invalid CVV. |
|
|
83
|
+
| `gatewayErrorMessage` | `"Unable to complete the payment. Please try again."` | Shown when the payment gateway itself refuses the submitted card. |
|
|
84
|
+
| `inFlightMessage` | `"This order is already being placed. Please wait."` | Shown when a click lands on an order-placement attempt whose own sequence is still running — a transaction this instance did not open, and which nothing here may finalize or re-run. |
|
|
85
|
+
| `unconfirmedMessage` | `"We could not confirm your order yet. Your payment may still be processing, so please do not pay again."` | Shown when the payment was handed to the gateway but the order could not be confirmed, so it may still be processing. Renders in its own `role="status"` node, never in the error alert. |
|
|
86
|
+
| `declinedMessage` | `"Check your payment information or choose another payment method."` | Shown when the payment gateway answered the callback and refused the payment (server code `PAYMENT_DECLINED`). Renders in the error alert, and the shopper may submit again. One sentence for every refusal: the API never forwards the gateway's own words. |
|
|
87
|
+
| `lapsedTransactionMessage` | `"We could not confirm your order yet. Your payment may still be processing, so please do not pay again."` | Shown when the payment window lapsed before the order was confirmed (server code `MISSING_TRANSACTION_COOKIES`), or the order group the callback sent is not the one this session started (`ORDER_GROUP_MISMATCH`). Renders in the error alert, and the attempt stays resume-only, so the source tells the shopper not to pay again. |
|
|
88
|
+
| `challengeUnavailableMessage` | `"Your bank asked for an extra verification step that we could not open. Your payment may still be processing, so please do not pay again."` | Shown when the bank asks for a challenge this CTA cannot follow (server code `REDIRECT_REQUIRED` with no usable address, or no return page authored). The attempt stays resume-only. |
|
|
89
|
+
|
|
90
|
+
### The cart-profile check
|
|
91
|
+
|
|
92
|
+
The payment root reads the cart's `clientProfile` (first name, last name and phone, never the profile's document) and the place-order check refuses a click while a name or the phone is blank, after the document and billing-address checks. The profile page may be a different page from the payment page: the check reads the cart, not what the page composes. A profile that the root did not receive, because it is still resolving or because a hand-written `$data` omits it, never refuses and VTEX stays the backstop. A profile that arrived with every field `null` is a read, empty profile and does refuse. Only the code is logged, never a name or a phone.
|
|
93
|
+
|
|
94
|
+
### The placing state
|
|
95
|
+
|
|
96
|
+
While this CTA's own sequence runs, the button reads `placingLabel`, is disabled and carries `aria-busy`. When the `placingMessage` message is authored, an `<output data-fs-place-order-placing>` follows the button with that text. The field is read only while placing: a missing or blank message renders the busy button and nothing else, and a missing one logs `message.missing`. The message is rendered as a text node, so markup in it shows as typed. `placingLabel` stays the button's text; the message is a separate surface for copy that explains the wait, such as asking the shopper to keep the page open.
|
|
97
|
+
|
|
98
|
+
The surface cannot show without the form being blocked. The CTA publishes its `placing` onto the payment context in a layout effect, and `PaymentMethodList`, `CardEntry`, `SavedCards`, `CardholderDocument`, `Installments`, `InstallmentsSelect`, `SaveCard` and `BillingAddress` read it and render `inert` and `aria-disabled` in the same commit that mounts the surface. The payment root's own container only gets a presence attribute, never `inert`, because this CTA's alert and status regions live inside it (see [[payment]]).
|
|
99
|
+
|
|
100
|
+
The surface follows the CTA that is running the sequence, not the section:
|
|
101
|
+
|
|
102
|
+
- A click refused before any call (no registered submission, no method, the document gate, a pre-flight refusal) never mounts it, not even for one frame.
|
|
103
|
+
- With two `PlaceOrder` elements under one root, only the one that was clicked shows it. The other is disabled without one.
|
|
104
|
+
- A CTA that remounts over an attempt waiting for a resume shows it only after the shopper clicks `resumeLabel`, while the callback is pending, although the section is already blocked.
|
|
105
|
+
- If the CTA unmounts mid-sequence, the surface leaves with it and the leaves stay `inert` until the attempt settles.
|
|
106
|
+
- It is a status region, never an alert, and the error, unconfirmed and success regions are absent while it shows, including on the second attempt after a refused one.
|
|
107
|
+
|
|
108
|
+
These are pinned in the "authored placing surface" suite of `place-order.test.tsx`. The bank-challenge redirect keeps the surface on screen while the page leaves (below).
|
|
109
|
+
|
|
110
|
+
### The bank challenge (3D Secure)
|
|
111
|
+
|
|
112
|
+
When `challengeReturnHref` names a page, the request to the payment gateway carries the absolute URL of that page, `<origin><public path>?orderGroup=<group>&redirect=true`, built under the current binding's base path, and `redirect=false`. If the gateway callback then answers that the bank needs a challenge and gives an absolute `http(s)` address, this CTA navigates the document to it once, keeps the button disabled and busy, keeps the authored `placingMessage` message showing and the rest of the payment form blocked, and draws neither the error alert nor the success line while the page leaves. The result of the click still carries `REDIRECT_REQUIRED`, and the attempt stays `unresolved`: the order is finished on the return page, never by this CTA, and nothing is paid twice.
|
|
113
|
+
|
|
114
|
+
The redirect is followed only when a return URL was sent, the answer carries `REDIRECT_REQUIRED` and no order, and the address is absolute `http(s)`. A site-relative or protocol-relative address, any other scheme, or an answer without a usable address is refused like any other callback answer: the alert shows `challengeUnavailableMessage` and the attempt stays resume-only. A store that authored no return page keeps exactly that refusal.
|
|
115
|
+
|
|
116
|
+
A resume (the button reading `resumeLabel`) that gets a challenge answer redirects the same way. A resume that finishes the order reports its `purchase` analytics event, reading the value and currency from the settled order, once per order (the marker is kept in `localStorage`, see ADR-0023).
|
|
117
|
+
|
|
118
|
+
The once-per-order rule spans all three ways an order can finish: a single pass of this CTA, its in-page resume, and the [[challenge-return]] page. Each goes through `claimPurchase` in `sdk/payment/resumed-purchase.ts`, a synchronous check-and-set on `fs:purchase-sent:<order group>` that is written before the event is sent, so an emission that throws is never repeated, and that falls back to an in-memory set for one page lifetime when storage refuses. A resume reads the order because the attempt record deliberately carries no value or currency. It reports for `APPROVED`, `PENDING` (anti-fraud review) and `UNKNOWN`, and not for `DENIED` or an order with no total. The marker is claimed only after those checks, so an order that was not reported is not marked as reported. A hook consumer that passes no `readSettledOrder` gets no event from a resume and no error.
|
|
119
|
+
|
|
120
|
+
Every refusal message above is resolved by the `code` of the `PaymentUserError` this CTA renders — in its alert, or in its status node for `unconfirmedMessage` — never by which component produced the error. The server codes are those of `paymentStartTransaction` and `paymentGatewayCallback`: `PAYMENT_DECLINED` (`declinedMessage`), `MISSING_TRANSACTION_COOKIES` and `ORDER_GROUP_MISMATCH` (`lapsedTransactionMessage`), `REDIRECT_REQUIRED` (`challengeUnavailableMessage`), `MISSING_PAYMENT_METHOD_SELECTION`, `INVALID_TRANSACTION_DATA`, and the cart faults `MISSING_CART_CONTEXT` and `CART_NOT_FOUND`, which share `networkErrorMessage`. The card form's `CARD_ENTRY_COLLAPSED` reads `unavailableMethodMessage`. Every `message` is diagnostic and never renders: a code this component does not word (one a newer server added) shows `networkErrorMessage` and logs `message.unknown-code`.
|
|
80
121
|
|
|
81
122
|
**Data:** declares its own thin `fragment PlaceOrderData on Query` selecting `payment.selectedMethodId`, `payment.selectedInstallment`, and `payment.methods { id groupName }` — the exact slice the orchestration hook needs, no more. **Actions:** declares `actions: { payment: ['startTransaction', 'gatewayCallback'], analytics: ['track'] }`. Must be inside a payment root (`requiresContext: 'payment'`).
|
|
82
123
|
|
|
@@ -97,6 +138,7 @@ Every message prop above is resolved by the `code` of the client-synthesized `Pa
|
|
|
97
138
|
"props": {
|
|
98
139
|
"label": "Place order",
|
|
99
140
|
"placingLabel": "Placing order...",
|
|
141
|
+
"resumeLabel": "Complete your order",
|
|
100
142
|
"successMessage": "Order placed successfully.",
|
|
101
143
|
"successHref": { "standard": "order-placed" }
|
|
102
144
|
}
|
|
@@ -104,7 +146,7 @@ Every message prop above is resolved by the `code` of the client-synthesized `Pa
|
|
|
104
146
|
}
|
|
105
147
|
```
|
|
106
148
|
|
|
107
|
-
`successHref` is shown here with its default value. A string must be a logical path of this store, such as `/obrigado`; an absolute URL, a protocol-relative URL, or a non-http(s) scheme is refused rather than navigated to.
|
|
149
|
+
`successHref` is shown here with its default value. The example authors only the button labels and the success message; a store authors every message field of the content type, refusals included. A string must be a logical path of this store, such as `/obrigado`; an absolute URL, a protocol-relative URL, or a non-http(s) scheme is refused rather than navigated to.
|
|
108
150
|
|
|
109
151
|
---
|
|
110
152
|
|
|
@@ -113,18 +155,22 @@ Every message prop above is resolved by the `code` of the client-synthesized `Pa
|
|
|
113
155
|
- **Nesting `PlaceOrder` inside `CardEntry` or `SavedCards`.** It must be a sibling of both under the same payment root, so one CTA serves both the new-card and saved-card paths.
|
|
114
156
|
- **Placing `PlaceOrder` outside any `PaymentSectionRoot`/`PaymentSectionController`.** It throws at render — there is no payment context or submission channel to resolve.
|
|
115
157
|
- **Confusing it with `BuyButtonButton`.** `BuyButtonButton` adds a product to the cart on a PDP; `PlaceOrder` runs the payment sequence in checkout. They are never composed together.
|
|
116
|
-
- **Expecting a
|
|
158
|
+
- **Expecting a 3D Secure challenge without a return page.** The shopper is sent to the bank only when `challengeReturnHref` names a page of the store that composes `ChallengeReturn`. Without it the shopper reads the server's `REDIRECT_REQUIRED` message and the attempt stays locked. Only accounts that deliver 3D Secure by redirect are supported; payment-app delivery is out of scope.
|
|
159
|
+
- **Authoring `challengeReturnHref` as a string.** It is a page reference. A string cannot be turned into the absolute return URL the bank must come back to, so it is refused with a dev-only warning and no return URL is sent.
|
|
117
160
|
|
|
118
161
|
---
|
|
119
162
|
|
|
120
163
|
## Known limitations
|
|
121
164
|
|
|
122
|
-
- **A remount reads the surviving attempt instead of losing it
|
|
165
|
+
- **A remount reads the surviving attempt instead of losing it, but the attempt does not survive a page reload.** The place-order sequence keeps an identity-and-phase record on the payment context, above this component's own mount, next to `placing`. Closing and reopening a `Dialog` or `Drawer` popup with no `keepMounted` does not reset it: a settled attempt renders disabled with no further calls (`succeeded` is derived from the record, not only from this instance's own `attempted` and `userErrors`), and an attempt whose card already reached the gateway offers a resume (`resumeLabel`) that finalizes the same transaction, never a fresh `startTransaction` or a second card submission. A full page reload loses the attempt, because nothing persists it in `sessionStorage` or elsewhere. The one exception is a shopper sent to the bank, who returns to the `ChallengeReturn` page, which holds no attempt and finishes the order from the order group in its own URL. The direct-to-gateway POST's abort budget (30 seconds, `GATEWAY_REQUEST_TIMEOUT_MS` in `sdk/payment/gateway.ts`) is a placeholder that has not been confirmed with payments.
|
|
123
166
|
- **A refusal raised before the card POST leaves the CTA on `label`, not `resumeLabel`.** A card form that refuses after the transaction opened but before any request was issued (a missing `sendPayments` action, an origin the gateway builder will not post to, its own draft check) reports `reachedGateway: false`, so the attempt is recorded as refused: nothing was paid, the button keeps its `label`, and the next click opens a fresh transaction. A request that reached the gateway, or that cannot be shown not to have (a rejected request, a holder that throws or resolves a malformed result), stays resume-only and reads `resumeLabel`.
|
|
124
|
-
- **A
|
|
125
|
-
- **
|
|
167
|
+
- **A refused `gatewayCallback` frees the next click; every other callback failure stays on `resumeLabel`.** Once the card POST was accepted, the hook frees the next click for a callback error whose server code is none of `REDIRECT_REQUIRED`, `MISSING_TRANSACTION_COOKIES` and `ORDER_GROUP_MISMATCH` and that carries no `orderId`. `ORDER_GROUP_MISMATCH` is the API's answer when the order group sent with the callback is not the one this browser session's own start bound (or the session holds none): nothing is sent to VTEX, and because the card POST was already accepted the attempt stays locked, exactly like the other two. The API answers a refusal from the gateway with `PAYMENT_DECLINED`, so a shopper whose card was refused reads `declinedMessage` and can enter another card without a reload. The freed attempt is recorded as refused with no order group, so the next click opens a fresh transaction and never calls the callback again with the old group. A timeout, a network failure, an unreadable result, a gateway that was unreachable (502 to 504), a bank challenge, a lapsed transaction cookie or an order group that does not match the session stays on `resumeLabel` and only re-issues the callback, because the payment may still be processing.
|
|
168
|
+
- **A shopper who presses Back from the bank page may find a blocked form.** The browser may restore this page from its back-forward cache with `placing` still true, so the button stays disabled until a reload. Nothing was charged by this checkout; VTEX cancels the order it opened after five minutes. A reload clears the block and the shopper places a new order.
|
|
169
|
+
- **The return URL carries the order group.** `?orderGroup=<group>&redirect=true` sits in the browser history and, for same-origin requests, in the `Referer`. The order's Node id is a reversible base64 of the same group, so this exposes nothing the confirmation URL did not already.
|
|
170
|
+
- **Sibling placement (never nested inside `CardEntry`/`SavedCards`) is a convention, not something the compiler enforces.** `requiresContext: 'payment'` only fails a build with no payment-providing ancestor at any depth; it cannot detect that this component was nested one level too deep. Getting this wrong compiles clean and still leaves the other entry path with no CTA at all.
|
|
126
171
|
- **`successHref` navigates with `replace`, not `push`.** The payment step is removed from the history stack, so the Back button from the confirmation page returns to whatever preceded payment, not to the payment step itself — deliberate (placing an order is terminal, and a live place-order CTA one Back press away risks a duplicate transaction), but a divergence from this package's other redirect-on-success component, `CartRedirectOnAdd`, which uses `push`.
|
|
127
172
|
- **A string `successHref` that is not a path of this store fails closed.** An absolute URL, a protocol-relative URL (`//host/...`), or a non-http(s) scheme is refused rather than navigated to, with a dev-only `console.warn`. This keeps a store schema from turning the CTA into a redirect off the storefront right after a real purchase. A store without a confirmation page in its route map also stays on the payment page.
|
|
173
|
+
- **A saved card that needs no security code uses Start Transaction without gateway calls; platform order creation remains unconfirmed.** Its submission sends no request and resolves with `completesWithoutGateway: true`. The hook honours the flag only as the literal `true` with an empty `userErrors` list: it then skips Send Payments and the gateway callback, takes the order group as the order id, and reports `reachedGateway: true`; the client treats the attempt as terminal, so a second run is not legal. Any other value, including a truthy non-boolean, keeps the callback leg. A failed start still refuses the attempt. Whether the platform creates the order on that route alone is not proven in this repository.
|
|
128
174
|
- **Focus moves on a refused click only, never for a result the gateway returned.** When a click is refused because the cardholder document is missing or malformed, or the custom billing address was never saved, `PlaceOrder` asks the payment root to move keyboard focus to that field or form. This applies to any result that did not reach the gateway (`reachedGateway: false`) whose first error carries one of those three codes, including a code a registered submission returned itself after the transaction opened. A refusal carrying any other code, and any result that reached the gateway (a decline included, whatever its code), moves nothing, and neither does a re-render or a remount. The reason stays in the existing outcome alert.
|
|
129
175
|
|
|
130
176
|
## Styling
|
|
@@ -132,12 +178,14 @@ Every message prop above is resolved by the `code` of the client-synthesized `Pa
|
|
|
132
178
|
| Component | What you style | Plausible classes |
|
|
133
179
|
|---|---|---|
|
|
134
180
|
| `PlaceOrder` (root `div`) | Layout wrapper stacking the button and the outcome region | `flex flex-col gap-[8px] items-start` |
|
|
135
|
-
| Button (`data-fs-place-order-button`) | The CTA itself — full-width pill, disabled/busy states | `inline-flex items-center justify-center w-full h-[44px] px-[20px] bg-[
|
|
136
|
-
| Placing (`data-fs-place-order-placing`) | The status region, present only while this CTA's own sequence runs and only when `placingMessage` is authored. Every payment leaf is `inert` for as long as it exists. | `text-[13px] text-[
|
|
137
|
-
| Error (`data-fs-place-order-error`) | Inline error line, `role="alert"` | `text-[13px]
|
|
138
|
-
| Unconfirmed (`data-fs-place-order-unconfirmed`) | Inline notice that the order could not be confirmed yet, `role="status"` | `text-[13px]
|
|
139
|
-
| Success (`data-fs-place-order-success`) | Inline success line, `role="status"` | `text-[13px]
|
|
140
|
-
| Success order id (`data-fs-place-order-success-order-id`) | The placed order's id, inside the success line | `font-mono text-[12px] text-[
|
|
181
|
+
| Button (`data-fs-place-order-button`) | The CTA itself — full-width pill, disabled/busy states | `inline-flex items-center justify-center w-full h-[44px] px-[20px] bg-[var(--color-primary)] text-[var(--color-surface)] rounded-[var(--radius-base)] text-[14px] font-bold uppercase cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed` |
|
|
182
|
+
| Placing (`data-fs-place-order-placing`) | The status region, present only while this CTA's own sequence runs and only when the `placingMessage` message is authored. Every payment leaf is `inert` for as long as it exists. | `text-[13px] text-[color-mix(in_srgb,var(--color-ink)_60%,transparent)]` |
|
|
183
|
+
| Error (`data-fs-place-order-error`) | Inline error line, `role="alert"` | `text-[13px]` |
|
|
184
|
+
| Unconfirmed (`data-fs-place-order-unconfirmed`) | Inline notice that the order could not be confirmed yet, `role="status"` | `text-[13px]` |
|
|
185
|
+
| Success (`data-fs-place-order-success`) | Inline success line, `role="status"` | `text-[13px]` |
|
|
186
|
+
| Success order id (`data-fs-place-order-success-order-id`) | The placed order's id, inside the success line | `font-mono text-[12px] text-[color-mix(in_srgb,var(--color-ink)_60%,transparent)]` |
|
|
187
|
+
|
|
188
|
+
A status color is a `visualIdentity` feedback role of the foundation: when the store declares them, color the error row `text-[var(--color-feedback-danger)]`, the success row `text-[var(--color-feedback-success)]` and the notice row `text-[var(--color-feedback-warning)]`, never with a hex.
|
|
141
189
|
|
|
142
190
|
Always include `disabled:` styling on the button — it disables automatically while the sequence runs and again once it succeeds.
|
|
143
191
|
|
|
@@ -115,7 +115,9 @@ The element `id` is the durable content key for the `postal-code-field` entry sl
|
|
|
115
115
|
| `data-fs-postal-code-field` | The field container (stacks label, input, error) | `flex flex-col gap-[8px]` |
|
|
116
116
|
| `data-fs-postal-code-field-label` | The label typography | `text-[13px] font-semibold text-[#1a1a1a]` |
|
|
117
117
|
| `data-fs-postal-code-field-input` | The input box; compose with `data-invalid`, `data-focused`, `data-disabled` | `h-11 rounded-lg border border-[#d4d4d4] px-4 text-[15px]` |
|
|
118
|
-
| `data-fs-postal-code-field-error` | The inline error text | `text-[12px] text-[
|
|
118
|
+
| `data-fs-postal-code-field-error` | The inline error text | `text-[12px] text-[var(--color-feedback-danger)]` |
|
|
119
|
+
|
|
120
|
+
The role colors above are the foundation's `visualIdentity` roles (`--color-feedback-danger`), so they follow the store when it changes them.
|
|
119
121
|
|
|
120
122
|
---
|
|
121
123
|
|
package/dist/docs/pricing.md
CHANGED
|
@@ -135,7 +135,8 @@ Discount badge for the `listPrice`-vs-`price` markdown. Renders `null` when ther
|
|
|
135
135
|
| Prop | Type | Default | Notes |
|
|
136
136
|
|------|------|---------|-------|
|
|
137
137
|
| `format` | `"percentage"` \| `"absolute"` | `"percentage"` | `percentage` shows `-25%`; `absolute` shows the currency-formatted markdown `-R$ 10,00` (`listPrice - price`, using the active storefront context). Mirrors `ProductCardDiscount`. |
|
|
138
|
-
|
|
138
|
+
|
|
139
|
+
**Content model** (`pricing-discount`): `percentageTemplate`, an ICU message with a `percentage` argument (integer markdown), rendered for `format: "percentage"`, and `amountTemplate`, with an `amount` argument (currency-formatted `listPrice - price`), rendered for `format: "absolute"`. Only the message the format picks is formatted.
|
|
139
140
|
|
|
140
141
|
### PricingInstallments
|
|
141
142
|
|
|
@@ -175,20 +176,15 @@ Renders the surrounding plan's `paymentMethod` (e.g. *"Visa"*, *"Pix"*) as a `<s
|
|
|
175
176
|
|
|
176
177
|
### PricingInstallment
|
|
177
178
|
|
|
178
|
-
Single installment line. Must be a descendant of `PricingInstallments`, `PricingInstallmentPlan`, or `PricingInstallmentsForPlan`. If `children` are provided, they replace the
|
|
179
|
+
Single installment line. Must be a descendant of `PricingInstallments`, `PricingInstallmentPlan`, or `PricingInstallmentsForPlan`. If `children` are provided, they replace the text entirely (useful for CTAs like *"Buy with store card"*). No props.
|
|
179
180
|
|
|
180
|
-
|
|
181
|
-
|------|------|---------|-------|
|
|
182
|
-
| `template` | string | `"{count}x de {value}"` | placeholders: `{count}`, `{value}` |
|
|
183
|
-
| `interestFreeLabel` | string | `"sem juros"` | appended when the plan is interest-free; pass `""` to omit |
|
|
181
|
+
**Content model** (`pricing-installment`): `template`, an ICU message with `count` and `value` (currency-formatted) arguments, and `interestFreeLabel`, appended when the installment is interest-free.
|
|
184
182
|
|
|
185
183
|
### PricingSpotDiscount
|
|
186
184
|
|
|
187
|
-
Discount badge for the cash/Pix difference between `spotPrice` and `price` (e.g. *"com mais 9% OFF no Pix"*). Renders `null` when `spotPrice >= price`. Symmetric to `PricingDiscount` but for the spot-price percentage. Rounding is nearest-integer.
|
|
185
|
+
Discount badge for the cash/Pix difference between `spotPrice` and `price` (e.g. *"com mais 9% OFF no Pix"*). Renders `null` when `spotPrice >= price`. Symmetric to `PricingDiscount` but for the spot-price percentage. Rounding is nearest-integer. No props.
|
|
188
186
|
|
|
189
|
-
|
|
190
|
-
|------|------|---------|-------|
|
|
191
|
-
| `template` | string | `"-{percentage}%"` | placeholder: `{percentage}` (the rounded spot-discount percentage) |
|
|
187
|
+
**Content model** (`pricing-spot-discount`): `template`, an ICU message with a `percentage` argument (the rounded spot-discount percentage).
|
|
192
188
|
|
|
193
189
|
### PricingHighlights
|
|
194
190
|
|
|
@@ -204,11 +200,11 @@ Iterator over `Offer.promotions` — structured deals like *"Compre 3 leve 2"*,
|
|
|
204
200
|
|
|
205
201
|
### PricingPromotion
|
|
206
202
|
|
|
207
|
-
Renders the current promotion
|
|
203
|
+
Renders the current promotion from its `$content` template. Reads from the context set by `PricingPromotions`. Children override the text. No props.
|
|
208
204
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
205
|
+
**Content model** (`pricing-promotion`): `template`, an ICU message with a `name` argument (the promotion's display name).
|
|
206
|
+
|
|
207
|
+
Every `Pricing*` message is read only from `$content`. A missing message renders empty and logs `message.missing`; with `children`, no message is formatted.
|
|
212
208
|
|
|
213
209
|
---
|
|
214
210
|
|
|
@@ -230,7 +226,7 @@ A full PDP pricing block as it would appear in a generated page schema:
|
|
|
230
226
|
},
|
|
231
227
|
"pricing-list": { "type": "PricingListPrice" },
|
|
232
228
|
"pricing-selling": { "type": "PricingSellingPrice" },
|
|
233
|
-
"pricing-discount": { "type": "PricingDiscount", "props": { "
|
|
229
|
+
"pricing-discount": { "type": "PricingDiscount", "props": { "percentageTemplate": "-{percentage}%" } },
|
|
234
230
|
"pricing-spot": { "type": "PricingSpotPrice" },
|
|
235
231
|
"pricing-installments": {
|
|
236
232
|
"type": "PricingInstallments",
|
|
@@ -451,12 +447,12 @@ Style `PricingRoot` as a vertical stack and each price line as its own typograph
|
|
|
451
447
|
| Component | What you style | Plausible classes |
|
|
452
448
|
|---|---|---|
|
|
453
449
|
| `PricingRoot` | Stacks the price lines | `flex flex-col gap-[4px] mt-[8px] w-full` |
|
|
454
|
-
| `PricingSellingPrice` | The headline price — large, bold, often the brand color | `text-[28px] leading-[1.15] font-bold text-[
|
|
455
|
-
| `PricingListPrice` | The struck-through original price — small and muted | `text-[13px] leading-[1.4] font-normal text-[
|
|
456
|
-
| `PricingDiscount` / `PricingSpotDiscount` | Savings badge — small, often a colored chip | `inline-flex items-center px-[6px] py-[2px] rounded-[4px] bg-[
|
|
457
|
-
| `PricingInstallments` / `PricingInstallment` | Installment line — small, secondary | `text-[13px] leading-[1.4] text-[
|
|
450
|
+
| `PricingSellingPrice` | The headline price — large, bold, often the brand color | `text-[28px] leading-[1.15] font-bold text-[var(--color-primary)] tracking-[-0.01em] block` |
|
|
451
|
+
| `PricingListPrice` | The struck-through original price — small and muted | `text-[13px] leading-[1.4] font-normal text-[var(--color-text-subtle)] line-through` |
|
|
452
|
+
| `PricingDiscount` / `PricingSpotDiscount` | Savings badge — small, often a colored chip | `inline-flex items-center px-[6px] py-[2px] rounded-[4px] bg-[var(--color-primary)] text-white text-[12px] font-semibold` |
|
|
453
|
+
| `PricingInstallments` / `PricingInstallment` | Installment line — small, secondary | `text-[13px] leading-[1.4] text-[var(--color-text-muted)] mt-[2px] block` |
|
|
458
454
|
|
|
459
|
-
|
|
455
|
+
When the selling price is in the brand color, write it as the role's variable (`var(--color-primary)`), not as its hex, and reuse it on the discount chip. A muted grey that several lines share, such as the list and installment color, is a variable of the page or layout `theme`; a grey used once stays an arbitrary hex read off the image. `line-through` is what makes the list price read as the old price.
|
|
460
456
|
|
|
461
457
|
Styled minimal example (list + selling + installments):
|
|
462
458
|
|
|
@@ -469,11 +465,11 @@ Styled minimal example (list + selling + installments):
|
|
|
469
465
|
},
|
|
470
466
|
"pricing-list": {
|
|
471
467
|
"type": "PricingListPrice",
|
|
472
|
-
"style": ["text-[13px]", "leading-[1.4]", "font-normal", "text-[
|
|
468
|
+
"style": ["text-[13px]", "leading-[1.4]", "font-normal", "text-[var(--color-text-subtle)]", "line-through"]
|
|
473
469
|
},
|
|
474
470
|
"pricing-selling": {
|
|
475
471
|
"type": "PricingSellingPrice",
|
|
476
|
-
"style": ["text-[28px]", "leading-[1.15]", "font-bold", "text-[
|
|
472
|
+
"style": ["text-[28px]", "leading-[1.15]", "font-bold", "text-[var(--color-primary)]", "tracking-[-0.01em]", "block"]
|
|
477
473
|
},
|
|
478
474
|
"pricing-installments": {
|
|
479
475
|
"type": "PricingInstallments",
|
|
@@ -483,11 +479,13 @@ Styled minimal example (list + selling + installments):
|
|
|
483
479
|
"pricing-installment": {
|
|
484
480
|
"type": "PricingInstallment",
|
|
485
481
|
"props": { "template": "ou em até {count}x de {value}", "interestFreeLabel": "sem juros" },
|
|
486
|
-
"style": ["text-[13px]", "leading-[1.4]", "text-[
|
|
482
|
+
"style": ["text-[13px]", "leading-[1.4]", "text-[var(--color-text-muted)]"]
|
|
487
483
|
}
|
|
488
484
|
}
|
|
489
485
|
```
|
|
490
486
|
|
|
487
|
+
The colors that several elements share are variables of the page or layout `theme`, which declares them: `{"--color-text-subtle": "#8A8A8A", "--color-text-muted": "#666666"}`. A color used once stays a hex.
|
|
488
|
+
|
|
491
489
|
---
|
|
492
490
|
|
|
493
491
|
## Related
|