@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
|
@@ -59,8 +59,15 @@ SessionRoot (required ancestor; session tri-state
|
|
|
59
59
|
| Prop | Type | Default | Notes |
|
|
60
60
|
|------|------|---------|-------|
|
|
61
61
|
| `skeletonCount` | number | `2` | Placeholder rows drawn while the preferences resolve. Set it to the number of controls composed. |
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
|
|
63
|
+
Content model (`client-preferences-fieldset`), ICU message fields with no package default; an unauthored one renders empty and logs `message.missing`:
|
|
64
|
+
|
|
65
|
+
| Field | Source (English) | Notes |
|
|
66
|
+
|-------|------------------|-------|
|
|
67
|
+
| `loadingLabel` | `Loading your preferences` | Announced politely while the preferences resolve. |
|
|
68
|
+
| `loadedLabel` | `Your preferences are ready` | Announced politely once the controls mount. |
|
|
69
|
+
| `groupLabel` | `Your preferences` | Accessible name of the `<fieldset>` group; unauthored, no `aria-label` is emitted. |
|
|
70
|
+
| `genericErrorMessage` | `Unable to save your preferences. Please try again.` | Shown by `FormError` for every refusal of the write (`MISSING_CART_CONTEXT`, `CART_NOT_FOUND`, `NO_PREFERENCE_PROVIDED`) and for a network failure; none is one the shopper can fix. A code this fieldset does not know shows it too and logs `message.unknown-code`. |
|
|
64
71
|
|
|
65
72
|
Declares `requiresContext: ['form', 'session']` (needs both a `FormRoot` and a `SessionRoot` ancestor), `providesContext: 'client-preferences'`, `actions: { identity: ['clientPreferencesUpdate'] }`, and its own fragment on `Query.clientPreferences`. Renders `Fieldset.Root` with `disabled={readOnly}`; carries `-pending` until its entity resolves, and `-readonly` when the session reports `canEditData: false`.
|
|
66
73
|
|
|
@@ -72,9 +79,7 @@ The definition also declares that same component as its `skeleton`, which is the
|
|
|
72
79
|
|
|
73
80
|
### ClientPreferencesNewsletterControl / ClientPreferencesSavePersonalDataControl
|
|
74
81
|
|
|
75
|
-
|
|
76
|
-
|------|------|---------|-------|
|
|
77
|
-
| `label` | string | `'Email me with news and offers'` / `'Save my information for next time'` | |
|
|
82
|
+
Content models `client-preferences-newsletter` / `client-preferences-save-data`, one ICU message field each with no package default: `label` (source `Email me with news and offers` / `Save my information for next time`).
|
|
78
83
|
|
|
79
84
|
Childless, renders `Field.Root > Field.Label > Field.Checkbox` (with the checkmark icon), the label text following. Composed children replace that default anatomy and still bind to the same field. Defaults to unchecked (opt-in, not opt-out) — a `null` saved value reads as `false`.
|
|
80
85
|
|
|
@@ -61,8 +61,17 @@ The bound newsletter checkbox (`optinNewsLetter`). Inlines `Field` + `Checkbox`
|
|
|
61
61
|
| Prop | Type | Default | Notes |
|
|
62
62
|
|------|------|---------|-------|
|
|
63
63
|
| `label` | string | — | The text shown beside the checkbox. |
|
|
64
|
+
| `$content` | `ContentValue<typeof NewsletterOptInControlContent>` | — | The inline message for a refused save. |
|
|
64
65
|
| `$actions` | injected | — | Carries `identity.clientPreferencesUpdate` (compiler-injected). |
|
|
65
66
|
|
|
67
|
+
Content type `newsletter-opt-in-control`, keyed on the refusal's `code`:
|
|
68
|
+
|
|
69
|
+
| Content field | Codes | Source (en) |
|
|
70
|
+
|---|---|---|
|
|
71
|
+
| genericErrorMessage | `NETWORK_ERROR`, `MISSING_CART_CONTEXT`, `CART_NOT_FOUND`, `NO_PREFERENCE_PROVIDED` | Unable to save your preference. Please try again. |
|
|
72
|
+
|
|
73
|
+
None of these is something the shopper can fix by toggling again. A code the map does not know (one a newer server added) shows `genericErrorMessage` and logs `message.unknown-code`; a blank field renders an empty error and logs `message.missing`.
|
|
74
|
+
|
|
66
75
|
**Write:** declares `actions: { identity: ['clientPreferencesUpdate'] }`. The write is pessimistic/async — while in flight the checkbox is disabled and the Control carries `data-fs-newsletter-opt-in-pending`. Server `userErrors` surface inline under this checkbox only.
|
|
67
76
|
|
|
68
77
|
### SavePersonalDataOptInControl
|
|
@@ -72,9 +81,12 @@ The bound save-personal-data checkbox (`savePersonalData`). Same shape as `Newsl
|
|
|
72
81
|
| Prop | Type | Default | Notes |
|
|
73
82
|
|------|------|---------|-------|
|
|
74
83
|
| `label` | string | — | The text shown beside the checkbox. |
|
|
84
|
+
| `$content` | `ContentValue<typeof SavePersonalDataOptInControlContent>` | — | The inline message for a refused save. |
|
|
75
85
|
| `$actions` | injected | — | Carries `identity.clientPreferencesUpdate` (compiler-injected). |
|
|
76
86
|
|
|
77
|
-
|
|
87
|
+
Content type `save-personal-data-opt-in-control` has the same `genericErrorMessage` field, for the same codes.
|
|
88
|
+
|
|
89
|
+
Both Controls share one internal `OptInControl` implementation; each registered Control only fixes its `fieldKey`, its `data-fs-*` attributes and its content type.
|
|
78
90
|
|
|
79
91
|
---
|
|
80
92
|
|
|
@@ -83,7 +95,7 @@ Both Controls share one internal `OptInControl` implementation; each registered
|
|
|
83
95
|
- **Pre-fill:** each checkbox reflects its `clientPreferences` value; a `null` (shopper has not chosen) reads as unchecked.
|
|
84
96
|
- **Toggle → persist:** dispatches `$actions.identity.clientPreferencesUpdate` with **only** the toggled field; the other flag is left untouched.
|
|
85
97
|
- **In flight:** the toggled checkbox is disabled and its Control carries its `*-pending` attribute; the other Control is unaffected (per-field pending).
|
|
86
|
-
- **Server `userErrors`:** surfaced inline under the Control that produced them (per-field error)
|
|
98
|
+
- **Server `userErrors`:** surfaced inline under the Control that produced them (per-field error), worded by that Control's `genericErrorMessage`.
|
|
87
99
|
- **Read-only session:** when `useSession()` reports `canEditData: false` (identified but unauthenticated claimed profile — VTEX refuses the write server-side), both checkboxes render disabled and each Control carries its `*-readonly` attribute (`data-fs-newsletter-opt-in-readonly`, `data-fs-save-personal-data-opt-in-readonly`), mirroring `EmailIdentificationControl`.
|
|
88
100
|
|
|
89
101
|
---
|
|
@@ -102,11 +114,17 @@ Both Controls share one internal `OptInControl` implementation; each registered
|
|
|
102
114
|
},
|
|
103
115
|
"newsletter-opt-in": {
|
|
104
116
|
"type": "NewsletterOptInControl",
|
|
105
|
-
"props": {
|
|
117
|
+
"props": {
|
|
118
|
+
"label": "Quero receber novidades e ofertas por e-mail",
|
|
119
|
+
"genericErrorMessage": "Não foi possível salvar sua preferência. Tente novamente."
|
|
120
|
+
}
|
|
106
121
|
},
|
|
107
122
|
"save-data-opt-in": {
|
|
108
123
|
"type": "SavePersonalDataOptInControl",
|
|
109
|
-
"props": {
|
|
124
|
+
"props": {
|
|
125
|
+
"label": "Salvar minhas informações para a próxima compra",
|
|
126
|
+
"genericErrorMessage": "Não foi possível salvar sua preferência. Tente novamente."
|
|
127
|
+
}
|
|
110
128
|
}
|
|
111
129
|
}
|
|
112
130
|
```
|
|
@@ -125,7 +143,10 @@ Both Controls share one internal `OptInControl` implementation; each registered
|
|
|
125
143
|
},
|
|
126
144
|
"newsletter-opt-in": {
|
|
127
145
|
"type": "NewsletterOptInControl",
|
|
128
|
-
"props": {
|
|
146
|
+
"props": {
|
|
147
|
+
"label": "Sign me up for the newsletter",
|
|
148
|
+
"genericErrorMessage": "Unable to save your preference. Please try again."
|
|
149
|
+
}
|
|
129
150
|
}
|
|
130
151
|
}
|
|
131
152
|
```
|
|
@@ -150,7 +171,7 @@ Both Controls share one internal `OptInControl` implementation; each registered
|
|
|
150
171
|
| Component | What you style | Plausible classes |
|
|
151
172
|
|---|---|---|
|
|
152
173
|
| `ClientPreferencesRoot` | Stacks the opt-in rows | `flex flex-col gap-[8px]` |
|
|
153
|
-
| `NewsletterOptInControl` / `SavePersonalDataOptInControl` | The checkbox + label row | `flex items-center gap-[8px] text-[14px] text-[
|
|
174
|
+
| `NewsletterOptInControl` / `SavePersonalDataOptInControl` | The checkbox + label row | `flex items-center gap-[8px] text-[14px] text-[var(--color-text)]` |
|
|
154
175
|
|
|
155
176
|
Styled example:
|
|
156
177
|
|
|
@@ -164,16 +185,18 @@ Styled example:
|
|
|
164
185
|
"newsletter-opt-in": {
|
|
165
186
|
"type": "NewsletterOptInControl",
|
|
166
187
|
"props": { "label": "Quero receber novidades e ofertas por e-mail" },
|
|
167
|
-
"style": ["flex", "items-center", "gap-[8px]", "text-[14px]", "text-[
|
|
188
|
+
"style": ["flex", "items-center", "gap-[8px]", "text-[14px]", "text-[var(--color-text)]"]
|
|
168
189
|
},
|
|
169
190
|
"save-data-opt-in": {
|
|
170
191
|
"type": "SavePersonalDataOptInControl",
|
|
171
192
|
"props": { "label": "Salvar minhas informações para a próxima compra" },
|
|
172
|
-
"style": ["flex", "items-center", "gap-[8px]", "text-[14px]", "text-[
|
|
193
|
+
"style": ["flex", "items-center", "gap-[8px]", "text-[14px]", "text-[var(--color-text)]"]
|
|
173
194
|
}
|
|
174
195
|
}
|
|
175
196
|
```
|
|
176
197
|
|
|
198
|
+
The colors that several elements share are variables of the page or layout `theme`, which declares them: `{"--color-text": "#333333"}`. A color used once stays a hex.
|
|
199
|
+
|
|
177
200
|
---
|
|
178
201
|
|
|
179
202
|
## Related
|
|
@@ -67,8 +67,15 @@ SessionRoot (required ancestor; session tri-state +
|
|
|
67
67
|
| `country` | `'US' \| 'BR'` | `'US'` | Phone mask/validation country, provided to the phone control via context. |
|
|
68
68
|
| `documentType` | string | — | One of `'CPF'`, `'SSN'`, `'SIN'` or `'RFC'` (upper case). The document control renders only when supported, and the payload carries `document` only for a supported type. |
|
|
69
69
|
| `skeletonCount` | number | `4` | Placeholder rows drawn while the profile resolves. Set it to the number of controls composed. |
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
|
|
71
|
+
Content model (`client-profile-fieldset`), ICU message fields with no package default; an unauthored one renders empty and logs `message.missing`:
|
|
72
|
+
|
|
73
|
+
| Field | Source (English) | Notes |
|
|
74
|
+
|-------|------------------|-------|
|
|
75
|
+
| `loadingLabel` | `Loading your details` | Announced politely while the profile resolves. |
|
|
76
|
+
| `loadedLabel` | `Your details are ready` | Announced politely once the controls mount. |
|
|
77
|
+
| `groupLabel` | `Your details` | Accessible name of the `<fieldset>` group; unauthored, no `aria-label` is emitted. |
|
|
78
|
+
| `genericErrorMessage` | `Unable to save your details. Please try again.` | Shown by `FormError` for every refusal of the write (`MISSING_CART_CONTEXT`, `CART_NOT_FOUND`, `NO_PROFILE_FIELD_PROVIDED`) and for a network failure; none is one the shopper can fix. A code this fieldset does not know shows it too and logs `message.unknown-code`. |
|
|
72
79
|
|
|
73
80
|
Declares `requiresContext: ['form', 'session']` (needs both a `FormRoot` and a `SessionRoot` ancestor), `providesContext: 'client-profile-fieldset'`, `actions: { identity: ['clientProfileUpdate'] }`, and its own fragment on `Query.clientProfile`. Renders `Fieldset.Root` with `disabled={readOnly}`; carries `-pending` until its entity resolves, and `-readonly` when the session reports `canEditData: false`.
|
|
74
81
|
|
|
@@ -82,19 +89,26 @@ The definition also declares that same component as its `skeleton`, which is the
|
|
|
82
89
|
|
|
83
90
|
| Prop | Type | Default | Notes |
|
|
84
91
|
|------|------|---------|-------|
|
|
85
|
-
| `label` | string | `'First name'` / `'Last name'` | |
|
|
86
92
|
| `placeholder` | string | — | |
|
|
87
93
|
|
|
94
|
+
Content models `client-profile-first-name` / `client-profile-last-name`, one ICU message field each with no package default: `label` (source `First name` / `Last name`).
|
|
95
|
+
|
|
88
96
|
Childless, renders `Field.Root > Field.Label + Field.Control + Field.Error`. Composed children replace that default anatomy and still bind to the same field.
|
|
89
97
|
|
|
90
98
|
### ClientProfileFieldsetPhoneControl
|
|
91
99
|
|
|
92
100
|
| Prop | Type | Default | Notes |
|
|
93
101
|
|------|------|---------|-------|
|
|
94
|
-
| `
|
|
102
|
+
| `placeholder` | string | — | |
|
|
95
103
|
| `requirement` | `'mandatory' \| 'optional'` | — | Requiredness only — the only source of it for this control, since the fieldset publishes no baseline. Unset raises nothing, so the phone is optional. A field the store does not want is omitted from the page, not switched off by a prop value. |
|
|
96
|
-
|
|
97
|
-
|
|
104
|
+
|
|
105
|
+
Content model (`client-profile-fieldset-phone`), ICU message fields with no package default. The control formats them and hands the strings to `PhoneField`:
|
|
106
|
+
|
|
107
|
+
| Field | Source (English) |
|
|
108
|
+
|-------|------------------|
|
|
109
|
+
| `label` | `Phone` |
|
|
110
|
+
| `errorInvalid` | `Invalid phone number` |
|
|
111
|
+
| `errorRequired` | `Phone number is required` |
|
|
98
112
|
|
|
99
113
|
Composes the `PhoneField` particle. Recomposable (RFC:503): given children, they replace `PhoneField`'s
|
|
100
114
|
default `Field.Label` + `PhoneFieldInput` + `Field.Error` anatomy, in any order; childless keeps today's
|
|
@@ -56,13 +56,19 @@ Binds the reusable `PhoneField` particle to the profile. Reads the saved phone f
|
|
|
56
56
|
|
|
57
57
|
| Prop | Type | Default | Notes |
|
|
58
58
|
|------|------|---------|-------|
|
|
59
|
-
| `label` | string | `'Phone'` | Visible field label. |
|
|
60
59
|
| `country` | `'US' \| 'BR'` | `'US'` | Selects the phone mask and validation rule. |
|
|
61
60
|
| `requirement` | `'mandatory' \| 'optional'` | `'mandatory'` | Controls required validation. A field the store does not want is omitted from the page rather than hidden by a prop. |
|
|
62
|
-
| `errorInvalid` | string | `'Invalid phone number'` | Inline error for an invalid format. |
|
|
63
|
-
| `errorRequired` | string | `'Phone number is required'` | Inline error when a mandatory field is empty. |
|
|
64
61
|
| `$actions` | injected | — | Carries `identity.clientProfileUpdate` (compiler-injected). |
|
|
65
62
|
|
|
63
|
+
Content model (`client-profile-phone-control`), ICU message fields with no package default. The control formats them and hands the strings to `PhoneField`:
|
|
64
|
+
|
|
65
|
+
| Field | Source (English) | Notes |
|
|
66
|
+
|-------|------------------|-------|
|
|
67
|
+
| `label` | `Phone` | Visible field label. |
|
|
68
|
+
| `errorInvalid` | `Invalid phone number` | Inline error for an invalid format. |
|
|
69
|
+
| `errorRequired` | `Phone number is required` | Inline error when a mandatory field is empty. |
|
|
70
|
+
| `genericErrorMessage` | `Unable to save your details. Please try again.` | Inline error for a refused save: `NETWORK_ERROR`, `MISSING_CART_CONTEXT`, `CART_NOT_FOUND` and `NO_PROFILE_FIELD_PROVIDED`, none of which the shopper can fix by editing the phone. A code it does not know (one a newer server added) shows it too and logs `message.unknown-code`. |
|
|
71
|
+
|
|
66
72
|
**Write:** declares `actions: { identity: ['clientProfileUpdate'] }`. No write when the value is unchanged, empty-and-mandatory, or client-side invalid.
|
|
67
73
|
|
|
68
74
|
---
|
|
@@ -80,6 +86,9 @@ Binds the reusable `PhoneField` particle to the profile. Reads the saved phone f
|
|
|
80
86
|
"type": "ClientProfilePhoneControl",
|
|
81
87
|
"props": {
|
|
82
88
|
"label": "Phone",
|
|
89
|
+
"errorInvalid": "Invalid phone number",
|
|
90
|
+
"errorRequired": "Phone number is required",
|
|
91
|
+
"genericErrorMessage": "Unable to save your details. Please try again.",
|
|
83
92
|
"country": "US",
|
|
84
93
|
"requirement": "mandatory"
|
|
85
94
|
}
|
package/dist/docs/copy-text.md
CHANGED
|
@@ -26,18 +26,20 @@ Any screen that needs one action to copy a single string, such as an order numbe
|
|
|
26
26
|
CopyText
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
`CopyText` is one element. The caller passes the visible label or icon as `children`.
|
|
29
|
+
`CopyText` is one element. The caller passes the visible label or icon as `children`. It has no content of its own: the component that owns the copy formats it and passes it as props. The order details header passes its `copyAccessibleName`, `copyCopied`, `copyFailure` and `copyDismiss` message fields.
|
|
30
30
|
|
|
31
31
|
## Components
|
|
32
32
|
|
|
33
33
|
### CopyText
|
|
34
34
|
|
|
35
|
-
| Prop | Type |
|
|
36
|
-
|
|
37
|
-
| `accessibleName` | string |
|
|
38
|
-
| `successMessage` | string |
|
|
39
|
-
| `failureMessage` | string |
|
|
40
|
-
| `dismissLabel` | string |
|
|
35
|
+
| Prop | Type | Purpose |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| `accessibleName` | string | Accessible name of the action |
|
|
38
|
+
| `successMessage` | string | Announced after a successful copy |
|
|
39
|
+
| `failureMessage` | string | Announced when the clipboard rejects the write |
|
|
40
|
+
| `dismissLabel` | string | Accessible name of the dismiss control |
|
|
41
|
+
|
|
42
|
+
None has a default. An omitted prop renders nothing: there is no fallback copy, so the owner formats and passes every one.
|
|
41
43
|
|
|
42
44
|
`text` is required and is not a schema prop. The caller supplies the exact string to copy. `children` is the visible label or icon, and it is not a schema prop either.
|
|
43
45
|
|
|
@@ -141,7 +141,7 @@ The label is associated with the input and the error is linked via `aria-describ
|
|
|
141
141
|
- **Blocking input during masking.** The mask is applied progressively and never rejects a keystroke.
|
|
142
142
|
- **Treating an empty value as invalid.** The document is optional — blank is valid.
|
|
143
143
|
- **Wiring GraphQL into this particle.** It is data-agnostic; the host form owns the profile read/write.
|
|
144
|
-
- **Localizing via a message id.**
|
|
144
|
+
- **Localizing via a message id.** Labels are plain strings; pass `label` / `placeholder` / `errorMessage` directly.
|
|
145
145
|
|
|
146
146
|
---
|
|
147
147
|
|
package/dist/docs/email-field.md
CHANGED
|
@@ -55,6 +55,7 @@ EmailField (data-fs-email-field + inherited data-fs-field-root)
|
|
|
55
55
|
| `disabled` | boolean | `false` | Disables the input (e.g. while a write is in flight). |
|
|
56
56
|
| `required` | boolean | `true` | Email is Always Mandatory at the identity step. |
|
|
57
57
|
| `name` | string | `'email'` | Field/input name. |
|
|
58
|
+
| `autoComplete` | string | — | The input's `autocomplete` token. Omitted, the attribute is not rendered. Set `"username"` when the field is the identifier half of a credential pair, so a password manager saves and fills it with its password. |
|
|
58
59
|
|
|
59
60
|
**Validation:** format is checked on blur/submit only — never per keystroke. A prior format error clears while the shopper edits and is re-evaluated on the next blur.
|
|
60
61
|
|
|
@@ -83,7 +84,7 @@ The label is associated with the input and the error is linked via `aria-describ
|
|
|
83
84
|
|
|
84
85
|
- **Validating on every keystroke.** Format validation runs on blur/submit only.
|
|
85
86
|
- **Wiring GraphQL into this particle.** It is data-agnostic; use `EmailIdentificationControl` for the checkout-bound binding.
|
|
86
|
-
- **Localizing via a message id.**
|
|
87
|
+
- **Localizing via a message id.** Labels are plain strings; pass `label` / `placeholder` / `errorMessage` directly.
|
|
87
88
|
|
|
88
89
|
---
|
|
89
90
|
|
|
@@ -46,9 +46,18 @@ SessionRoot (provides the session tri-state; required a
|
|
|
46
46
|
| `label` | string | — | Passed to `EmailField`. |
|
|
47
47
|
| `placeholder` | string | — | Passed to `EmailField`. |
|
|
48
48
|
| `invalidEmailMessage` | string | — | Inline error text for an invalid email format. |
|
|
49
|
+
| `$content` | `ContentValue<typeof EmailIdentificationControlContent>` | — | The inline message for a refused save. |
|
|
49
50
|
| `$data` | `{ email?: string \| null } \| null` | injected | `clientProfile` slice from the reactive runtime. Not authored in schema. |
|
|
50
51
|
| `$actions` | injected | — | Carries `identity.clientProfileUpdate` (compiler-injected). |
|
|
51
52
|
|
|
53
|
+
Content type `email-identification-control`, keyed on the refusal's `code`:
|
|
54
|
+
|
|
55
|
+
| Content field | Codes | Source (en) |
|
|
56
|
+
|---|---|---|
|
|
57
|
+
| genericErrorMessage | `NETWORK_ERROR`, `MISSING_CART_CONTEXT`, `CART_NOT_FOUND`, `NO_PROFILE_FIELD_PROVIDED` | Unable to save your details. Please try again. |
|
|
58
|
+
|
|
59
|
+
None of these is something the shopper can fix by editing the email. A code the map does not know (one a newer server added) shows `genericErrorMessage` and logs `message.unknown-code`; a blank field renders an empty error and logs `message.missing`.
|
|
60
|
+
|
|
52
61
|
**Data:** declares a colocated `fragment EmailIdentificationData on Query { clientProfile { email } }` with `fetchStrategy: 'reactive'`. The compiler merges it into the page query — no explicit `dataSources` entry needed.
|
|
53
62
|
|
|
54
63
|
**Write:** declares `actions: { identity: ['clientProfileUpdate'] }`. The write is **pessimistic/async** — it awaits the persisted result. While in flight the field is disabled and the root carries `data-fs-email-identification-pending`, so a `CartCheckoutGuard`-style guard can block the checkout CTA.
|
|
@@ -63,7 +72,7 @@ SessionRoot (provides the session tri-state; required a
|
|
|
63
72
|
- **Invalid format:** the field shows its inline error; no write, no step advance.
|
|
64
73
|
- **Cleared field:** blurring an emptied field re-fills the saved email; no write. Clearing must not visually "un-identify" — changing email (= switching user) is a deliberate act done by typing a new one.
|
|
65
74
|
- **`canEditData: false`:** the field renders **disabled** and the root carries `data-fs-email-identification-readonly`. VTEX refuses profile edits for an identified-but-unauthenticated claimed profile, so the control never offers a write that is doomed server-side.
|
|
66
|
-
- **Server `userErrors`:** surfaced inline
|
|
75
|
+
- **Server `userErrors`:** surfaced inline, worded by `genericErrorMessage`; the session is left unchanged.
|
|
67
76
|
|
|
68
77
|
---
|
|
69
78
|
|
|
@@ -78,7 +87,8 @@ SessionRoot (provides the session tri-state; required a
|
|
|
78
87
|
"props": {
|
|
79
88
|
"label": "Email",
|
|
80
89
|
"placeholder": "you@example.com",
|
|
81
|
-
"invalidEmailMessage": "Enter a valid email address."
|
|
90
|
+
"invalidEmailMessage": "Enter a valid email address.",
|
|
91
|
+
"genericErrorMessage": "Unable to save your details. Please try again."
|
|
82
92
|
}
|
|
83
93
|
}
|
|
84
94
|
]
|
|
@@ -90,7 +90,7 @@ The element id is the content key, so name it for the section rather than its st
|
|
|
90
90
|
|
|
91
91
|
| Component | What you style | Plausible classes |
|
|
92
92
|
|---|---|---|
|
|
93
|
-
| `FooterCopyright` | The legal notice line | `text-[12px] leading-[1.5] text-[
|
|
93
|
+
| `FooterCopyright` | The legal notice line | `text-[12px] leading-[1.5] text-[var(--color-text-muted)] text-center py-[16px]` |
|
|
94
94
|
|
|
95
95
|
Styled example:
|
|
96
96
|
|
|
@@ -98,11 +98,13 @@ Styled example:
|
|
|
98
98
|
{
|
|
99
99
|
"footer-copyright": {
|
|
100
100
|
"type": "FooterCopyright",
|
|
101
|
-
"style": ["text-[12px]", "leading-[1.5]", "text-[
|
|
101
|
+
"style": ["text-[12px]", "leading-[1.5]", "text-[var(--color-text-muted)]", "text-center", "py-[16px]"]
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
+
The colors that several elements share are variables of the page or layout `theme`, which declares them: `{"--color-text-muted": "#666666"}`. A color used once stays a hex.
|
|
107
|
+
|
|
106
108
|
---
|
|
107
109
|
|
|
108
110
|
## Related
|
|
@@ -52,7 +52,7 @@ FooterRoot
|
|
|
52
52
|
|
|
53
53
|
**A destination the allowlist refuses renders as text.** Every `url` passes through the shared render-time check, which admits `http:`, `https:`, `mailto:`, `tel:`, and site-relative paths. A refused one — a `javascript:` value, a protocol-relative `//host`, or a URL not yet pasted — renders the profile's label as visible text with no link and no glyph, rather than a mark that looks clickable and goes nowhere. The rejection logs once with the entry index and a bounded reason.
|
|
54
54
|
|
|
55
|
-
**Every predefined name must be registered.** A `platform` resolves to a sprite symbol the store's build has to include; the store's `
|
|
55
|
+
**Every predefined name must be registered.** A `platform` resolves to a sprite symbol the store's build has to include; the store's `foundation.json` writes the names out under `icons.include` — it is JSON, so it cannot import `SOCIAL_PLATFORM_NAMES`, and a test that derives the expected set from the exported constant is what keeps the two in step. A name the store never registered renders an empty `<svg>` — no build error and no runtime error, just a missing mark. `linkedin` and `youtube` need provisioned icon data as well: unlike the other three they have no embedded fallback, so a store that registers them without running `sukima icon-data fetch` fails to build.
|
|
56
56
|
|
|
57
57
|
---
|
|
58
58
|
|
package/dist/docs/form.md
CHANGED
|
@@ -124,6 +124,8 @@ cancels it, because the built-in guard's own `preventDefault()` runs after the a
|
|
|
124
124
|
|
|
125
125
|
## Components
|
|
126
126
|
|
|
127
|
+
Each button part reads its text only from its own `$content`, whose `label` field is an ICU message, unless it has `children`; no part takes a copy prop. A missing message renders an empty button and logs `message.missing`.
|
|
128
|
+
|
|
127
129
|
### FormRoot
|
|
128
130
|
|
|
129
131
|
The only `<form>` in a composition. Renders `noValidate`, wires
|
|
@@ -137,49 +139,65 @@ No props beyond the native `<form>` attributes (`onSubmit` is owned internally a
|
|
|
137
139
|
|
|
138
140
|
| Prop | Type | Default | Notes |
|
|
139
141
|
|------|------|---------|-------|
|
|
140
|
-
| `
|
|
141
|
-
| `children` | ReactNode | — | Wins over `
|
|
142
|
-
|
|
143
|
-
Text resolves `children ?? label ?? formatMessage({ id: 'fs/form.submit' })` — there is no hard-coded
|
|
144
|
-
English default. An author who wants copy other than the catalog's own must set `label` or `children`
|
|
145
|
-
explicitly.
|
|
142
|
+
| `$content` | `ContentValue<typeof FormSubmitContent>` | — | Its `label` message is the button text when there are no `children`. |
|
|
143
|
+
| `children` | ReactNode | — | Wins over `$content` when present; the message is then not read. |
|
|
146
144
|
|
|
147
145
|
A `type="submit"` `Button`, disabled while `formState.isSubmitting`. Pressing it validates every
|
|
148
146
|
registered field first; only once every field is valid does it skip untouched fieldsets, dispatch the
|
|
149
147
|
dirty ones in registration order, and collect what failed. Pressing Enter in a text input does *not*
|
|
150
148
|
submit — see *Implicit submission* above and `FormEnterSubmit` below for a form where it does.
|
|
151
149
|
|
|
150
|
+
Content type `form-submit`:
|
|
151
|
+
|
|
152
|
+
| Content field | Description |
|
|
153
|
+
|---|---|
|
|
154
|
+
| label | Button text |
|
|
155
|
+
|
|
152
156
|
### FormEnterSubmit
|
|
153
157
|
|
|
154
158
|
| Prop | Type | Default | Notes |
|
|
155
159
|
|------|------|---------|-------|
|
|
156
|
-
| `
|
|
157
|
-
| `children` | ReactNode | — | Wins over `
|
|
160
|
+
| `$content` | `ContentValue<typeof FormSubmitContent>` | — | Its `label` message is the button text when there are no `children`. |
|
|
161
|
+
| `children` | ReactNode | — | Wins over `$content` when present; the message is then not read. |
|
|
158
162
|
|
|
159
|
-
Renders the same button as `FormSubmit`, sharing its
|
|
160
|
-
|
|
163
|
+
Renders the same button as `FormSubmit`, sharing its content type (`form-submit` — there is no
|
|
164
|
+
separate one for the Enter variant, since both parts render the same word) and its
|
|
161
165
|
`data-fs-form-submit`/`data-fs-form-submit-pending` hooks — there is no separate styling hook for this
|
|
162
166
|
part. While mounted, it additionally allows Enter to
|
|
163
167
|
submit the enclosing `FormRoot` from any of its text-entry inputs (see *Implicit submission* above for
|
|
164
168
|
the form-wide blast radius and the IME carve-out).
|
|
165
169
|
|
|
170
|
+
Content type `form-submit`, shared with `FormSubmit`.
|
|
171
|
+
|
|
166
172
|
### FormError
|
|
167
173
|
|
|
168
174
|
| Prop | Type | Default | Notes |
|
|
169
175
|
|------|------|---------|-------|
|
|
170
|
-
| `
|
|
176
|
+
| `$content` | `ContentValue<typeof FormErrorContent>` | — | Its `fallbackMessage` message is shown for a fieldset whose write threw rather than resolving `userErrors`. |
|
|
171
177
|
|
|
172
178
|
Renders nothing when the last submit produced no failures. Otherwise, one group per failing fieldset,
|
|
173
179
|
carrying `data-fs-form-error-item={label}` — a styling/selector hook, never rendered as text. The visible
|
|
174
|
-
text inside each group is each failing `userError`'s
|
|
175
|
-
rejected or never settled.
|
|
180
|
+
text inside each group is each failing `userError`'s `message`, or the `fallbackMessage` message when
|
|
181
|
+
the dispatch rejected or never settled. An unauthored `fallbackMessage` renders empty and logs
|
|
182
|
+
`message.missing`.
|
|
183
|
+
|
|
184
|
+
Those messages are the fieldsets' own copy: a fieldset's `dispatch` maps each refusal's `code` to a message
|
|
185
|
+
field of its own `$content` and resolves `{ code, message }` with the formatted text. `FormError` words
|
|
186
|
+
nothing itself. A fieldset never passes the server's `message` through: for a code it has no message field
|
|
187
|
+
for, one a newer server added, it hands over its generic message and logs `message.unknown-code`.
|
|
188
|
+
|
|
189
|
+
Content type `form-error`:
|
|
190
|
+
|
|
191
|
+
| Content field | Description |
|
|
192
|
+
|---|---|
|
|
193
|
+
| fallbackMessage | Shown for a write that failed without `userErrors` |
|
|
176
194
|
|
|
177
195
|
### FormClear
|
|
178
196
|
|
|
179
197
|
| Prop | Type | Default | Notes |
|
|
180
198
|
|------|------|---------|-------|
|
|
181
|
-
| `
|
|
182
|
-
| `children` | ReactNode | — | Wins over `
|
|
199
|
+
| `$content` | `ContentValue<typeof FormClearContent>` | — | Its `label` message is the button text when there are no `children`. |
|
|
200
|
+
| `children` | ReactNode | — | Wins over `$content` when present; the message is then not read. |
|
|
183
201
|
|
|
184
202
|
A `type="button"` `Button` that empties every field registered by every fieldset inside the enclosing
|
|
185
203
|
`FormRoot` — not only the fieldset nearest to it in the tree. Each bound part registers how its own
|
|
@@ -189,18 +207,30 @@ no bound part currently mounted is left alone. The following submit dispatches a
|
|
|
189
207
|
fieldset that had something to clear, and nothing for one where clearing was a no-op. There is no prop
|
|
190
208
|
to scope it to one fieldset; place it only where clearing the whole form is the intended action.
|
|
191
209
|
|
|
210
|
+
Content type `form-clear`:
|
|
211
|
+
|
|
212
|
+
| Content field | Description |
|
|
213
|
+
|---|---|
|
|
214
|
+
| label | Button text |
|
|
215
|
+
|
|
192
216
|
### FormReset
|
|
193
217
|
|
|
194
218
|
| Prop | Type | Default | Notes |
|
|
195
219
|
|------|------|---------|-------|
|
|
196
|
-
| `
|
|
197
|
-
| `children` | ReactNode | — | Wins over `
|
|
220
|
+
| `$content` | `ContentValue<typeof FormResetContent>` | — | Its `label` message is the button text when there are no `children`. |
|
|
221
|
+
| `children` | ReactNode | — | Wins over `$content` when present; the message is then not read. |
|
|
198
222
|
|
|
199
223
|
A `type="button"` `Button` that returns every registered field name to react-hook-form's baseline for
|
|
200
224
|
that name, and clears its dirty/touched state. Before a fieldset's first successful write, that
|
|
201
225
|
baseline is whatever the field's own seed resolves to; it becomes "what was last written" only after a
|
|
202
226
|
successful submit.
|
|
203
227
|
|
|
228
|
+
Content type `form-reset`:
|
|
229
|
+
|
|
230
|
+
| Content field | Description |
|
|
231
|
+
|---|---|
|
|
232
|
+
| label | Button text |
|
|
233
|
+
|
|
204
234
|
---
|
|
205
235
|
|
|
206
236
|
## Canonical schema example
|
|
@@ -216,11 +246,17 @@ schema can author the form's boundary and its actions around wherever a fieldset
|
|
|
216
246
|
"style": ["flex", "flex-col", "gap-4"],
|
|
217
247
|
"children": ["shipping-address-fieldset", "step-error", "step-submit"]
|
|
218
248
|
},
|
|
219
|
-
"step-error": {
|
|
249
|
+
"step-error": {
|
|
250
|
+
"type": "FormError",
|
|
251
|
+
"props": { "fallbackMessage": "We couldn't save your details. Please try again." }
|
|
252
|
+
},
|
|
220
253
|
"step-submit": { "type": "FormSubmit", "props": { "label": "Save and continue" } }
|
|
221
254
|
}
|
|
222
255
|
```
|
|
223
256
|
|
|
257
|
+
`fallbackMessage` on `step-error` and `label` on `step-submit` are messages, not props: a store without `store.cmsStoreId` compiles it into
|
|
258
|
+
the element's `$content`, and a CMS-bound store authors it in the Content Platform instead.
|
|
259
|
+
|
|
224
260
|
`shipping-address-fieldset` is a matter component (shipped by a later task) that renders its own
|
|
225
261
|
fields and calls `registerFieldset` internally — it is placed in the schema like any other
|
|
226
262
|
component, but nothing about its internals is schema-authorable.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# FreeShippingProgress
|
|
2
2
|
|
|
3
3
|
**Category:** commerce
|
|
4
|
-
**Purpose:** Reactive progress bar for the cart's nearest free-shipping goal. Reads `cart.freeShippingProgress` and the
|
|
4
|
+
**Purpose:** Reactive progress bar for the cart's nearest free-shipping goal. Reads `cart.freeShippingProgress` and the cart's `Items` totalizer (the amount the server measures, so shipping and discounts do not count), then renders one of three states: below-threshold (the `label` message, e.g. "faltam {value} para frete grátis", + a partially filled bar), earned (the `qualifiedLabel` message + a full bar), or absent (renders nothing). Composed at the **top of a cart / mini-cart drawer** to nudge the shopper to add a bit more.
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -18,19 +18,23 @@ Look for a **strip at the top of an open cart or mini-cart** with a horizontal p
|
|
|
18
18
|
|
|
19
19
|
| State | Condition | Renders |
|
|
20
20
|
|---|---|---|
|
|
21
|
-
| Below threshold | `qualified === false`,
|
|
22
|
-
| Earned | field `qualified === true`, OR the reactive
|
|
21
|
+
| Below threshold | `qualified === false`, `Items` amount below `threshold` | Below-threshold message + a bar filled to `items / threshold` |
|
|
22
|
+
| Earned | field `qualified === true`, OR the reactive `Items` amount reaches `threshold` | Earned message + a full bar |
|
|
23
23
|
| Absent (self-hide) | `cart.freeShippingProgress === null` (no destination, no eligible promotion, empty cart, still loading, or degraded) | **Nothing** — no bar, no message, no wrapper |
|
|
24
24
|
|
|
25
25
|
## Reactive fill (no extra calls)
|
|
26
26
|
|
|
27
|
-
`freeShippingProgress` is
|
|
27
|
+
`freeShippingProgress` is kept out of `CartFragment`, so only some writes select it: the four line writes (remove, remove several, increase, decrease), the coupon removal and the shipping address update. Each returns the field and the bar takes the server's answer: below the goal it shows the amount still missing, and it comes back to qualified when a later write meets the goal again. The cart's `Items` totalizer is reactive too (the optimistic builders adjust it), so between a write's optimistic prediction and the server's answer the bar derives the **live** fill and remaining from the `Items` amount against the cached `threshold`. The server compares the same `Items` amount, so shipping charges and discounts never move the bar:
|
|
28
28
|
|
|
29
|
-
- `isQualified = qualified || (threshold != null &&
|
|
30
|
-
- `liveRemaining = isQualified ? 0 : max(threshold −
|
|
31
|
-
- `fill = isQualified ? 1 : clamp(
|
|
29
|
+
- `isQualified = qualified || (threshold != null && items >= threshold)` — the field flag covers the already-earned case (where `threshold` is `null`); the reactive comparison flips it at the boundary.
|
|
30
|
+
- `liveRemaining = isQualified ? 0 : max(threshold − items, 0)`
|
|
31
|
+
- `fill = isQualified ? 1 : clamp(items / threshold, 0..1)`
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
When the cart has no usable `Items` amount (no `Items` totalizer, or a blank or non-numeric amount), the bar shows the server's own answer instead: `isQualified = qualified`, `liveRemaining = max(remaining, 0)` from `freeShippingProgress.remaining`, and `fill = (threshold − liveRemaining) / threshold`.
|
|
34
|
+
|
|
35
|
+
While a line write that lowers the items total of a qualified cart is pending, the bar hides: a qualified value has no threshold, so the client cannot tell whether the drop crosses the goal. It returns with the server's answer, and also when the write fails. An emptied cart renders nothing.
|
|
36
|
+
|
|
37
|
+
`addItem`, coupon apply, validate, shipping option select, the region postal code and the cart shipping calculator do not select the field, so they do not refresh it: after one of those the bar keeps the value of the last write that returned it (or of the page load) and derives its state from the `Items` amount. A line write costs no extra read, because the server reuses the order form the write returned; a coupon removal costs one order-form read upstream when the cart has items and a postal code; the shipping address update costs none, because the server reuses the order form it just refreshed. There is no client refetch. `Money.amount` is a string at runtime and is always `Number()`-coerced before math/formatting.
|
|
34
38
|
|
|
35
39
|
---
|
|
36
40
|
|
|
@@ -58,11 +62,11 @@ FreeShippingProgressRoot ← reactive provider; self-hides on null/loadin
|
|
|
58
62
|
|
|
59
63
|
| Component | Props | Notes |
|
|
60
64
|
|---|---|---|
|
|
61
|
-
| `FreeShippingProgressRoot` | `$data` | Provides `FreeShippingProgressContext`; the copy formats from the active storefront context; renders nothing when the field is `null` |
|
|
62
|
-
| `FreeShippingProgressMessage` | `
|
|
63
|
-
| `FreeShippingProgressBar` | — | Renders a `Meter` bar; `aria-valuetext`
|
|
65
|
+
| `FreeShippingProgressRoot` | `threshold?`, `remaining?`, `qualified?`, `itemsTotal?`, `$data` | Provides `FreeShippingProgressContext`; the copy formats from the active storefront context; renders nothing when the field is `null` |
|
|
66
|
+
| `FreeShippingProgressMessage` | `$content` | Content type `free-shipping-progress-message`: `label` is an ICU message whose `value` argument is the formatted remaining amount; `qualifiedLabel` is the earned message. Both read only from `$content`: an unauthored message renders empty and logs `message.missing`. `children` replaces the text, and then no message is formatted |
|
|
67
|
+
| `FreeShippingProgressBar` | — | Renders a `Meter` bar; `aria-valuetext` is its `valueText` message (`{value}` = the formatted remaining amount) or, once earned, `qualifiedValueText` (content type `free-shipping-progress-bar`) |
|
|
64
68
|
|
|
65
|
-
Copy is front-localized and front-formatted from the
|
|
69
|
+
Copy is front-localized and front-formatted from the active storefront context's `locale`/`currency`, not the payload `currencyCode`. A store without CMS authors the message fields on the element, as below; a CMS-bound store keeps them in content.
|
|
66
70
|
|
|
67
71
|
---
|
|
68
72
|
|
|
@@ -79,7 +83,8 @@ Copy is front-localized and front-formatted from the Root's `locale`/`currency`
|
|
|
79
83
|
"props": { "label": "faltam {value} para frete grátis", "qualifiedLabel": "você ganhou frete grátis!" }
|
|
80
84
|
},
|
|
81
85
|
"free-shipping-progress-bar": {
|
|
82
|
-
"type": "FreeShippingProgressBar"
|
|
86
|
+
"type": "FreeShippingProgressBar",
|
|
87
|
+
"props": { "valueText": "{value} restantes para frete grátis", "qualifiedValueText": "frete grátis conquistado" }
|
|
83
88
|
}
|
|
84
89
|
}
|
|
85
90
|
```
|
|
@@ -42,10 +42,16 @@ resolution error rather than a silently dead branch that blanks the section.
|
|
|
42
42
|
|
|
43
43
|
| Prop | Type | Default | Notes |
|
|
44
44
|
|---|---|---|---|
|
|
45
|
-
| `
|
|
46
|
-
| `children` | ReactNode | — | Custom content, e.g. an `Icon` plus text; falls back to `label`. |
|
|
45
|
+
| `children` | ReactNode | — | Custom content, e.g. an `Icon` plus text; falls back to the `label` message. |
|
|
47
46
|
| `className` | string | — | |
|
|
48
47
|
|
|
48
|
+
Content models `identity-edit-button` and `identity-edit-cancel-button`, one ICU message field each, with
|
|
49
|
+
no package default:
|
|
50
|
+
|
|
51
|
+
| Field | Source (English) | Notes |
|
|
52
|
+
|---|---|---|
|
|
53
|
+
| `label` | `Edit` / `Cancel` | Text shown when no children are composed. |
|
|
54
|
+
|
|
49
55
|
## Behavior
|
|
50
56
|
|
|
51
57
|
- Starts on the summary. Unlike the delivery section, nothing about the profile data decides this: the
|