@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cart-destination.js","names":[],"sources":["../../../src/matter/cart-destination/cart-destination.tsx"],"sourcesContent":["'use client';\n\nimport {\n type ContentValue,\n defineComponent,\n defineContentType,\n type MessageFieldName,\n type MessageLocaleProp,\n} from '@vtex/fs-core';\nimport {\n type ChangeEvent,\n type ComponentPropsWithRef,\n createContext,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { Field } from '../../particles/field/field.js';\nimport { Input } from '../../particles/input/input.js';\nimport { useActionsOverride } from '../../sdk/actions/actions-override-context.js';\nimport type { ComponentActions } from '../../sdk/actions/types.js';\nimport { addressFields } from '../../sdk/address/address-fields.js';\nimport { loadCountryRules } from '../../sdk/address/country-rules.js';\nimport { normalizePostalCode } from '../../sdk/address/postal-code.js';\nimport type { CountryRules } from '../../sdk/address/types.js';\nimport { validateAddress } from '../../sdk/address/validate-address.js';\nimport { awaitCartWrites } from '../../sdk/cart/write-gate.js';\nimport { useDataOverride } from '../../sdk/data/data-override-context.js';\nimport { ReactiveRootContext } from '../../sdk/data/page-reactive-data-root.js';\nimport type { ShippingAddressUpdateErrorCode } from '../../sdk/generated/graphql.js';\nimport { formatErrorCode } from '../../sdk/i18n/format-error-code.js';\nimport { useMessageFormatter } from '../../sdk/i18n/use-message-formatter.js';\nimport type { ShippingAddressUpdateErrorEntity } from '../../sdk/shipping/shipping-operations.js';\nimport { loggableErrorName } from '../../utils/loggable-error-name.js';\n\n// ---------------------------------------------------------------------------\n// GraphQL Fragment — the destination only, never a name or a street\n// ---------------------------------------------------------------------------\n\nconst fragment = /* GraphQL */ `\n fragment CartDestinationData on Query {\n shipping {\n __typename\n id\n address {\n __typename\n id\n postalCode\n country\n city\n state\n }\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Content models — one per copy-bearing part\n// ---------------------------------------------------------------------------\n\nexport const CartDestinationValueContent = defineContentType({\n id: 'cart-destination-value',\n title: 'Cart Destination Value',\n description: 'Copy that precedes the destination in read mode.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n prefix: { type: 'string', title: 'Prefix' },\n },\n },\n});\n\nexport const CartDestinationChangeContent = defineContentType({\n id: 'cart-destination-change',\n title: 'Cart Destination Change',\n description: 'Copy for the control that opens edit mode.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', title: 'Button label' },\n },\n },\n});\n\nexport const CartDestinationSubmitContent = defineContentType({\n id: 'cart-destination-submit',\n title: 'Cart Destination Submit',\n description: 'Copy for the control that writes the destination.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', title: 'Button label' },\n pendingLabel: { type: 'string', title: 'Pending label' },\n },\n },\n});\n\nexport const CartDestinationCancelContent = defineContentType({\n id: 'cart-destination-cancel',\n title: 'Cart Destination Cancel',\n description: 'Copy for the control that closes edit mode without writing.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', title: 'Button label' },\n },\n },\n});\n\nexport const CartDestinationErrorContent = defineContentType({\n id: 'cart-destination-error',\n title: 'Cart Destination Error',\n description: 'Messages shown when the destination write is refused, one per error code the shopper can act on.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n genericMessage: {\n type: 'string',\n title: 'Failure message',\n description: 'Shown for a network failure and for every refusal the shopper cannot act on.',\n format: 'icu-message',\n messageSource: 'Unable to update the delivery location. Please try again.',\n },\n invalidPostalCodeMessage: {\n type: 'string',\n title: 'Invalid postal code message',\n description: 'Shown when the server rejects the postal code.',\n format: 'icu-message',\n messageSource: 'Enter a valid postal code.',\n },\n },\n },\n});\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/**\n * The `shipping` slice forwarded by the reactive runtime: the value of the `shipping` top-level field\n * of `CartDestinationData on Query`, `null` while it has not resolved.\n */\nexport type CartDestinationEntity = {\n __typename?: 'Shipping';\n id?: string;\n address?: {\n __typename?: 'Address';\n id?: string | null;\n postalCode?: string | null;\n country?: string | null;\n city?: string | null;\n state?: string | null;\n } | null;\n};\n\nexport type CartDestinationRootProps = ComponentPropsWithRef<'div'> & {\n /** Country used while the cart has no address yet. */\n defaultCountry?: string;\n $data?: CartDestinationEntity | null;\n /** Injected by the compiler from `actions: { shipping: ['setAddress'] }`. */\n $actions?: ComponentActions;\n children?: ReactNode;\n};\n\nexport type CartDestinationReadProps = ComponentPropsWithRef<'div'>;\n\n/** Children are omitted: what this renders is the cart's destination, never authored content. */\nexport type CartDestinationValueProps = Omit<ComponentPropsWithRef<'span'>, 'children'> & {\n prefix?: string;\n /** Merchant-authored copy; wins over the prop when present. */\n $content?: ContentValue<typeof CartDestinationValueContent>;\n};\n\nexport type CartDestinationUnsetProps = ComponentPropsWithRef<'button'>;\n\nexport type CartDestinationChangeProps = ComponentPropsWithRef<'button'> & {\n label?: string;\n $content?: ContentValue<typeof CartDestinationChangeContent>;\n};\n\nexport type CartDestinationFormProps = ComponentPropsWithRef<'form'>;\n\nexport type CartDestinationPostalCodeControlProps = {\n className?: string;\n label?: string;\n /** Wins over the example the country's rules give. */\n placeholder?: string;\n /** The field's own message for a draft that fails the country's postal code rules. */\n invalidMessage?: string;\n};\n\nexport type CartDestinationSubmitProps = ComponentPropsWithRef<'button'> & {\n label?: string;\n pendingLabel?: string;\n $content?: ContentValue<typeof CartDestinationSubmitContent>;\n};\n\nexport type CartDestinationCancelProps = ComponentPropsWithRef<'button'> & {\n label?: string;\n $content?: ContentValue<typeof CartDestinationCancelContent>;\n};\n\n/** Children are omitted: what this renders is the message for the write's error code. */\nexport type CartDestinationErrorProps = Omit<ComponentPropsWithRef<'div'>, 'children'> &\n MessageLocaleProp & {\n $content?: ContentValue<typeof CartDestinationErrorContent>;\n };\n\n// ---------------------------------------------------------------------------\n// Context\n// ---------------------------------------------------------------------------\n\nexport type CartDestinationContextValue = Readonly<{\n /** The cart's postal code, from `$data` only; null until a destination is set. */\n postalCode: string | null;\n city: string | null;\n state: string | null;\n /** The address country, else the root's `defaultCountry`. */\n country: string;\n /** The root query is in flight and no address is cached yet. */\n loading: boolean;\n /** Edit mode. Local to the root, `false` on mount. */\n editing: boolean;\n startEditing: () => void;\n /** Closes edit mode and discards the draft and the errors; writes nothing. */\n cancel: () => void;\n draft: string;\n setDraft: (value: string) => void;\n /**\n * The country's rules for edit mode. `null` while they load, and when the load failed or the\n * country is outside the library: the draft is then free text and nothing validates it.\n */\n rules: CountryRules | null;\n /** The rules are still loading: the field and Submit stay disabled. */\n rulesLoading: boolean;\n /** The draft is valid for the country, different from the current one, and no write is pending. */\n canSubmit: boolean;\n pending: boolean;\n errors: readonly ShippingAddressUpdateErrorEntity[];\n /** The last submit was refused locally. */\n invalid: boolean;\n submit: () => void;\n}>;\n\nconst CART_DESTINATION_CONTEXT_UNSET = Symbol('CartDestinationContextUnset');\n\nconst CartDestinationContextInternal = createContext<\n CartDestinationContextValue | typeof CART_DESTINATION_CONTEXT_UNSET\n>(CART_DESTINATION_CONTEXT_UNSET);\n\n/**\n * Read the destination and the edit-mode state from the nearest `CartDestinationRoot`. Throws outside\n * one: a misplaced part is a composition bug the author should see at once.\n */\nexport function useCartDestination(): CartDestinationContextValue {\n const ctx = useContext(CartDestinationContextInternal);\n if (ctx === CART_DESTINATION_CONTEXT_UNSET) {\n throw new Error('CartDestination components must be used inside a <CartDestinationRoot> subtree.');\n }\n return ctx;\n}\n\n/** Whether a `CartDestinationForm` encloses the subtree, so `CartDestinationSubmit` knows its form owner. */\nconst CartDestinationFormContext = createContext(false);\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nconst DEFAULT_COUNTRY = 'BRA';\n\n/** Whether the country's rules refuse the value. A country the library does not cover refuses nothing. */\nfunction isPostalCodeRefused(value: string, rules: CountryRules | null): boolean {\n if (!rules?.covered) return false;\n return validateAddress({ postalCode: value.trim() }, rules).postalCode !== undefined;\n}\n\n/** The form the write sends and the comparison uses: the country's own, else the trimmed text. */\nfunction toStoredPostalCode(value: string, rules: CountryRules | null): string {\n return rules ? normalizePostalCode(value, rules) : value.trim();\n}\n\nfunction isDraftSubmittable(draft: string, current: string | null, rules: CountryRules | null): boolean {\n if (draft.trim() === '' || isPostalCodeRefused(draft, rules)) return false;\n return toStoredPostalCode(draft, rules) !== toStoredPostalCode(current ?? '', rules);\n}\n\n// ---------------------------------------------------------------------------\n// Definitions\n// ---------------------------------------------------------------------------\n\nexport const CartDestinationRootDefinition = defineComponent<CartDestinationRootProps>({\n name: 'CartDestinationRoot',\n importPath: '@vtex/faststore/components',\n component: CartDestinationRoot,\n fragment,\n fetchStrategy: 'reactive',\n providesContext: 'cartDestination',\n actions: { shipping: ['setAddress'] },\n editor: { label: 'Cart Destination Root', category: 'content' },\n schema: {\n defaultCountry: { type: 'string', default: 'BRA', label: 'Default country (ISO alpha-3)' },\n },\n guideline:\n 'Where the cart is delivered, with a postal-code-only form that writes the cart destination so the free-shipping bar follows. Compose CartDestinationRead (CartDestinationValue, CartDestinationUnset, CartDestinationChange) for read mode and CartDestinationForm (PostalCodeControl, Submit, Cancel, Error) for edit mode. Starts in read mode; the store cannot open edit mode from outside. See cart-destination.md.',\n});\n\nexport const CartDestinationReadDefinition = defineComponent<CartDestinationReadProps>({\n name: 'CartDestinationRead',\n importPath: '@vtex/faststore/components',\n component: CartDestinationRead,\n requiresContext: 'cartDestination',\n editor: { label: 'Cart Destination Read', category: 'layout' },\n schema: {},\n guideline:\n 'Wraps what read mode shows: the value, the invitation when no destination is set, and the change control. Renders nothing while edit mode is open. Must be inside CartDestinationRoot.',\n});\n\nexport const CartDestinationValueDefinition = defineComponent<CartDestinationValueProps>({\n name: 'CartDestinationValue',\n importPath: '@vtex/faststore/components',\n component: CartDestinationValue,\n content: CartDestinationValueContent,\n requiresContext: 'cartDestination',\n editor: { label: 'Cart Destination Value', category: 'content' },\n schema: {\n prefix: { type: 'string', label: 'Prefix' },\n },\n guideline:\n 'The cart destination as postal code, city and state, each in its own element. Renders nothing while loading or when no destination is set. Must be inside CartDestinationRoot.',\n});\n\nexport const CartDestinationUnsetDefinition = defineComponent<CartDestinationUnsetProps>({\n name: 'CartDestinationUnset',\n importPath: '@vtex/faststore/components',\n component: CartDestinationUnset,\n requiresContext: 'cartDestination',\n editor: { label: 'Cart Destination Unset', category: 'content' },\n schema: {},\n guideline:\n 'A button that opens edit mode when pressed, like CartDestinationChange, with aria-expanded tied to the mode. Renders only once the destination resolved and none is set. Its children are the store-authored invitation (for example an Icon and a Text reading \"Informe seu CEP\"). Never place a CartDestinationChange, a link or another button inside it: a button cannot hold another. The regular CartDestinationChange repeats it, so the store usually hides that one while this shows. Place it within CartDestinationRead. Must be inside CartDestinationRoot.',\n});\n\nexport const CartDestinationChangeDefinition = defineComponent<CartDestinationChangeProps>({\n name: 'CartDestinationChange',\n importPath: '@vtex/faststore/components',\n component: CartDestinationChange,\n content: CartDestinationChangeContent,\n requiresContext: 'cartDestination',\n editor: { label: 'Cart Destination Change', category: 'action' },\n schema: {\n label: { type: 'string', label: 'Button label' },\n },\n guideline:\n 'Button that opens edit mode, styled as a link by the store. Place it inside CartDestinationRead. Must be inside CartDestinationRoot.',\n});\n\nexport const CartDestinationFormDefinition = defineComponent<CartDestinationFormProps>({\n name: 'CartDestinationForm',\n importPath: '@vtex/faststore/components',\n component: CartDestinationForm,\n requiresContext: 'cartDestination',\n editor: { label: 'Cart Destination Form', category: 'action' },\n schema: {},\n guideline:\n 'Edit mode: renders only while editing and routes Enter to the submit. Holds the postal code control, Submit, Cancel and Error, and any help text the store places. Must be inside CartDestinationRoot.',\n});\n\nexport const CartDestinationPostalCodeControlDefinition = defineComponent<CartDestinationPostalCodeControlProps>({\n name: 'CartDestinationPostalCodeControl',\n importPath: '@vtex/faststore/components',\n component: CartDestinationPostalCodeControl,\n requiresContext: 'cartDestination',\n editor: { label: 'Cart Destination Postal Code Control', category: 'content' },\n schema: {\n label: { type: 'string', label: 'Label' },\n placeholder: { type: 'string', label: 'Placeholder' },\n invalidMessage: { type: 'string', label: 'Invalid-value message' },\n },\n guideline:\n \"The postal code input of edit mode, empty each time edit mode opens and focused once enabled. A plain text field whose limits and example come from the cart country's postal code rules; it stays disabled while they load, and a country the rules do not cover takes free text. Must be inside CartDestinationForm.\",\n});\n\nexport const CartDestinationSubmitDefinition = defineComponent<CartDestinationSubmitProps>({\n name: 'CartDestinationSubmit',\n importPath: '@vtex/faststore/components',\n component: CartDestinationSubmit,\n content: CartDestinationSubmitContent,\n requiresContext: 'cartDestination',\n editor: { label: 'Cart Destination Submit', category: 'action' },\n schema: {\n label: { type: 'string', label: 'Button label' },\n pendingLabel: { type: 'string', label: 'Pending label' },\n },\n guideline:\n \"Writes the typed postal code. Disabled until the country's rules have loaded, the typed code is valid for the country (any text for a country the rules do not cover) and different from the current one, and while a write is pending (aria-busy). Must be inside CartDestinationForm.\",\n});\n\nexport const CartDestinationCancelDefinition = defineComponent<CartDestinationCancelProps>({\n name: 'CartDestinationCancel',\n importPath: '@vtex/faststore/components',\n component: CartDestinationCancel,\n content: CartDestinationCancelContent,\n requiresContext: 'cartDestination',\n editor: { label: 'Cart Destination Cancel', category: 'action' },\n schema: {\n label: { type: 'string', label: 'Button label' },\n },\n guideline:\n 'Closes edit mode, discards what was typed and writes nothing. Disabled while a write is pending. Must be inside CartDestinationForm.',\n});\n\nexport const CartDestinationErrorDefinition = defineComponent<CartDestinationErrorProps>({\n name: 'CartDestinationError',\n importPath: '@vtex/faststore/components',\n component: CartDestinationError,\n content: CartDestinationErrorContent,\n requiresContext: 'cartDestination',\n editor: { label: 'Cart Destination Error', category: 'content' },\n schema: {},\n guideline:\n 'Announces why the destination write failed, as an alert, and renders nothing otherwise. Words each error code from its $content: invalidPostalCodeMessage for a postal code the server rejects, genericMessage for a network failure and every refusal the shopper cannot act on. A postal code the platform refuses upstream also reaches the client as a network failure, so write genericMessage to cover it. An unknown code also shows genericMessage. Must be inside CartDestinationForm.',\n});\n\n// ---------------------------------------------------------------------------\n// Implementations\n// ---------------------------------------------------------------------------\n\n/**\n * Reads the cart destination reactively and publishes it, the edit-mode flag, the draft and the write\n * state as `cartDestination` context.\n *\n * The destination is never copied into state: the Value renders only what `$data` resolves, and a\n * successful write updates it solely by the mutation payload normalizing into the Apollo cache. A\n * rejected write therefore needs no rollback.\n */\nexport function CartDestinationRoot({\n defaultCountry = DEFAULT_COUNTRY,\n $data: $dataProp,\n $actions: $actionsProp,\n className,\n children,\n ...props\n}: CartDestinationRootProps) {\n const $data = useDataOverride($dataProp);\n const $actions = useActionsOverride($actionsProp);\n const address = $data?.address ?? null;\n const { loading: rootLoading } = useContext(ReactiveRootContext);\n\n const postalCode = address?.postalCode ?? null;\n // A null destination is ambiguous alone: an unresolved read and a cart with none look the same, so\n // the root query's in-flight flag tells \"loading\" from \"unset\".\n const loading = rootLoading && postalCode == null;\n const country = address?.country ?? defaultCountry;\n\n const [editing, setEditing] = useState(false);\n const [draft, setDraft] = useState('');\n const [pending, setPending] = useState(false);\n const [errors, setErrors] = useState<readonly ShippingAddressUpdateErrorEntity[]>([]);\n const [invalid, setInvalid] = useState(false);\n // State is batched, so two activations in one tick would both pass a `pending` check.\n const inFlightRef = useRef(false);\n const rootRef = useRef<HTMLDivElement>(null);\n const wasEditingRef = useRef(false);\n\n /**\n * Leaving edit mode moves focus back to the control that opens it, which only mounts once read mode\n * renders again, hence an effect on the flag rather than a call at the event. With no destination that\n * is the invitation; the change control is hidden then, so the invitation wins when both exist.\n * Opening it focuses the field, which `CartDestinationPostalCodeControl` does once the rules have loaded and enabled it.\n */\n useEffect(() => {\n if (wasEditingRef.current === editing) return;\n wasEditingRef.current = editing;\n if (editing) return;\n const trigger =\n rootRef.current?.querySelector<HTMLElement>('[data-fs-cart-destination-unset]') ??\n rootRef.current?.querySelector<HTMLElement>('[data-fs-cart-destination-change]');\n trigger?.focus();\n }, [editing]);\n\n // The rules load when edit mode opens. A failed load is not remembered by `loadCountryRules`, so the\n // next opening retries it; `rules: null` in the settled entry means the load failed.\n const [loaded, setLoaded] = useState<{ country: string; rules: CountryRules | null } | null>(null);\n useEffect(() => {\n if (!editing) {\n setLoaded((current) => (current?.rules ? current : null));\n return;\n }\n let active = true;\n loadCountryRules(country).then(\n (rules) => {\n if (active) setLoaded({ country, rules });\n },\n (error) => {\n if (!active) return;\n console.warn('[CartDestinationRoot] country rules failed to load', {\n country,\n error: loggableErrorName(error),\n });\n setLoaded({ country, rules: null });\n },\n );\n return () => {\n active = false;\n };\n }, [editing, country]);\n\n const rulesLoading = editing && loaded?.country !== country;\n const rules = loaded?.country === country ? loaded.rules : null;\n const canSubmit = !pending && !rulesLoading && isDraftSubmittable(draft, postalCode, rules);\n\n const startEditing = useCallback(() => setEditing(true), []);\n\n const cancel = useCallback(() => {\n setEditing(false);\n setDraft('');\n setErrors([]);\n setInvalid(false);\n }, []);\n\n /** Typing is the shopper's answer to a refusal, so the message and the invalid flag go with it. */\n const updateDraft = useCallback((value: string) => {\n setDraft(value);\n setErrors((current) => (current.length === 0 ? current : []));\n setInvalid(false);\n }, []);\n\n const submit = useCallback(() => {\n if (inFlightRef.current) return;\n const setAddress = $actions?.shipping?.setAddress;\n if (!setAddress) return;\n if (!canSubmit) {\n setInvalid(true);\n return;\n }\n\n inFlightRef.current = true;\n setPending(true);\n setErrors([]);\n setInvalid(false);\n\n // The resolver builds `logisticsInfo` from the order form it reads, so a line write still in\n // flight has to land first.\n void awaitCartWrites()\n .then(() => setAddress({ postalCode: toStoredPostalCode(draft, rules), country }))\n .then((writeErrors) => {\n if (writeErrors.length > 0) {\n // A refusal keeps edit mode open so the message has somewhere to show.\n setErrors(writeErrors);\n return;\n }\n setEditing(false);\n setDraft('');\n })\n .finally(() => {\n inFlightRef.current = false;\n setPending(false);\n });\n }, [$actions, canSubmit, draft, country, rules]);\n\n const value: CartDestinationContextValue = useMemo(\n () => ({\n postalCode,\n city: address?.city ?? null,\n state: address?.state ?? null,\n country,\n loading,\n editing,\n startEditing,\n cancel,\n draft,\n setDraft: updateDraft,\n rules,\n rulesLoading,\n canSubmit,\n pending,\n errors,\n invalid,\n submit,\n }),\n [\n postalCode,\n address?.city,\n address?.state,\n country,\n loading,\n editing,\n startEditing,\n cancel,\n draft,\n updateDraft,\n rules,\n rulesLoading,\n canSubmit,\n pending,\n errors,\n invalid,\n submit,\n ],\n );\n\n return (\n <CartDestinationContextInternal value={value}>\n <div\n {...props}\n ref={rootRef}\n className={className}\n data-fs-cart-destination=\"\"\n {...(pending ? { 'data-fs-cart-destination-pending': '' } : {})}\n {...(editing ? { 'data-fs-cart-destination-editing': '' } : {})}\n >\n {children}\n </div>\n </CartDestinationContextInternal>\n );\n}\n\nexport function CartDestinationRead({ className, children, ...props }: CartDestinationReadProps) {\n const { editing } = useCartDestination();\n if (editing) return null;\n\n return (\n <div {...props} className={className} data-fs-cart-destination-read=\"\">\n {children}\n </div>\n );\n}\n\nfunction pickAuthored(content: string | undefined, prop: string | undefined): string | null {\n if (content?.trim()) return content;\n if (prop?.trim()) return prop;\n return null;\n}\n\nexport function CartDestinationValue({ prefix, $content, className, ...props }: CartDestinationValueProps) {\n const { postalCode, city, state, loading } = useCartDestination();\n if (loading || postalCode == null) return null;\n\n const resolvedPrefix = pickAuthored($content?.prefix, prefix);\n\n return (\n <span {...props} className={className} data-fs-cart-destination-value=\"\">\n {resolvedPrefix ? <span data-fs-cart-destination-value-prefix=\"\">{resolvedPrefix}</span> : null}\n {/* Plain text nodes between the pieces: they keep the accessible name readable and a flex\n container strips them, so a store's `gap` still governs the visible spacing. */}\n {resolvedPrefix ? ' ' : null}\n <span data-fs-cart-destination-value-postal-code=\"\">{postalCode}</span>\n {city || state ? ' · ' : null}\n {city ? <span data-fs-cart-destination-value-city=\"\">{city}</span> : null}\n {city && state ? ', ' : null}\n {state ? <span data-fs-cart-destination-value-state=\"\">{state}</span> : null}\n </span>\n );\n}\n\nexport function CartDestinationUnset({ className, children, onClick, ...props }: CartDestinationUnsetProps) {\n const { postalCode, loading, editing, startEditing } = useCartDestination();\n if (loading || postalCode != null) return null;\n\n return (\n <button\n {...props}\n type=\"button\"\n onClick={(event) => {\n onClick?.(event);\n startEditing();\n }}\n aria-expanded={editing}\n className={className}\n data-fs-cart-destination-unset=\"\"\n >\n {children}\n </button>\n );\n}\n\nexport function CartDestinationChange({ label, $content, className, children, ...props }: CartDestinationChangeProps) {\n const { editing, startEditing } = useCartDestination();\n const resolvedLabel = pickAuthored($content?.label, label);\n\n return (\n <button\n {...props}\n type=\"button\"\n onClick={startEditing}\n aria-expanded={editing}\n className={className}\n data-fs-cart-destination-change=\"\"\n >\n {children ?? resolvedLabel}\n </button>\n );\n}\n\nexport function CartDestinationForm({ className, children, ...props }: CartDestinationFormProps) {\n const { editing, submit } = useCartDestination();\n if (!editing) return null;\n\n return (\n <CartDestinationFormContext value={true}>\n <form // react-doctor-disable-line no-prevent-default -- submit() is the only handler, so a native submit would reload the page\n {...props}\n className={className}\n data-fs-cart-destination-form=\"\"\n // Submit is disabled for an invalid draft, so the browser skips implicit submission on Enter\n // and the field would never be flagged; the key is routed to submit() here instead.\n onKeyDown={(event) => {\n if (event.key !== 'Enter' || !(event.target instanceof HTMLInputElement)) return;\n event.preventDefault();\n submit();\n }}\n onSubmit={(event) => {\n event.preventDefault();\n submit();\n }}\n >\n {children}\n </form>\n </CartDestinationFormContext>\n );\n}\n\nexport function CartDestinationPostalCodeControl({\n className,\n label,\n placeholder,\n invalidMessage,\n}: Readonly<CartDestinationPostalCodeControlProps>) {\n const { draft, setDraft, errors, invalid, pending, rules, rulesLoading } = useCartDestination();\n const rootRef = useRef<HTMLDivElement>(null);\n const focusedOnOpenRef = useRef(false);\n const [blurInvalid, setBlurInvalid] = useState(false);\n const refused = errors.length > 0;\n\n const descriptor = useMemo(\n () => (rules ? addressFields(rules, {}).find(({ name }) => name === 'postalCode') : undefined),\n [rules],\n );\n /** The country's example postal code: address data, not a message. */\n const example = descriptor?.placeholder?.values.example;\n\n /** A disabled input cannot take focus, so opening edit mode focuses the field once the rules enable it. */\n useEffect(() => {\n if (rulesLoading || focusedOnOpenRef.current) return;\n focusedOnOpenRef.current = true;\n rootRef.current?.querySelector<HTMLInputElement>('[data-fs-postal-code-field-input]')?.focus();\n }, [rulesLoading]);\n\n /**\n * Disabling the input while the write is in flight drops focus to the body, so a refusal otherwise\n * lands with nothing focused. Waits for `pending` to clear: focusing a disabled input is a no-op.\n */\n useEffect(() => {\n if (!refused || pending) return;\n rootRef.current?.querySelector<HTMLInputElement>('[data-fs-postal-code-field-input]')?.focus();\n }, [refused, pending]);\n\n function handleChange(event: ChangeEvent<HTMLInputElement>) {\n setBlurInvalid(false);\n setDraft(event.target.value);\n }\n\n const showInvalid = invalid || refused || blurInvalid;\n\n return (\n <Field.Root\n ref={rootRef}\n className={className}\n name=\"postalCode\"\n invalid={showInvalid}\n disabled={pending || rulesLoading}\n data-fs-postal-code-field=\"\"\n data-fs-cart-destination-postal-code-control=\"\"\n >\n {label ? <Field.Label data-fs-postal-code-field-label=\"\">{label}</Field.Label> : null}\n <Input\n data-fs-postal-code-field-input=\"\"\n type=\"text\"\n name=\"postalCode\"\n autoComplete=\"postal-code\"\n value={draft}\n maxLength={descriptor?.maxLength}\n inputMode={descriptor?.inputMode}\n placeholder={placeholder ?? example}\n onChange={handleChange}\n onBlur={() => setBlurInvalid(draft.trim() !== '' && isPostalCodeRefused(draft, rules))}\n />\n {/* While a refusal stands, the message is `CartDestinationError`'s. */}\n {showInvalid && !refused && invalidMessage ? (\n <Field.Error match data-fs-postal-code-field-error=\"\">\n {invalidMessage}\n </Field.Error>\n ) : null}\n </Field.Root>\n );\n}\n\nexport function CartDestinationSubmit({\n label,\n pendingLabel,\n $content,\n className,\n children,\n ...props\n}: CartDestinationSubmitProps) {\n const { canSubmit, pending, submit } = useCartDestination();\n const inForm = useContext(CartDestinationFormContext);\n\n const resolvedLabel = pickAuthored($content?.label, label);\n const resolvedPendingLabel = pickAuthored($content?.pendingLabel, pendingLabel);\n\n return (\n <button\n {...props}\n // The form routes native submission to the same submit(); alone there is no form to submit.\n type={inForm ? 'submit' : 'button'}\n onClick={inForm ? props.onClick : submit}\n disabled={!canSubmit || props.disabled}\n aria-busy={pending || undefined}\n className={className}\n data-fs-cart-destination-submit=\"\"\n {...(pending ? { 'data-fs-cart-destination-submit-pending': '' } : {})}\n >\n {children ?? (pending ? (resolvedPendingLabel ?? resolvedLabel) : resolvedLabel)}\n </button>\n );\n}\n\nexport function CartDestinationCancel({ label, $content, className, children, ...props }: CartDestinationCancelProps) {\n const { cancel, pending } = useCartDestination();\n const resolvedLabel = pickAuthored($content?.label, label);\n\n return (\n <button\n {...props}\n type=\"button\"\n onClick={cancel}\n disabled={pending || props.disabled}\n className={className}\n data-fs-cart-destination-cancel=\"\"\n >\n {children ?? resolvedLabel}\n </button>\n );\n}\n\n/**\n * The message for each code `shippingAddressUpdate` can return, plus the client-minted transport failure.\n * This form writes only the postal code and the country, so every other refusal is one the shopper\n * cannot act on here.\n */\nexport const CART_DESTINATION_ERROR_FIELDS = {\n INVALID_POSTAL_CODE: 'invalidPostalCodeMessage',\n INVALID_ADDRESS: 'genericMessage',\n INVALID_COUNTRY_CODE: 'genericMessage',\n MISSING_RECIPIENT_NAME: 'genericMessage',\n INVALID_SAVED_ADDRESS_ID: 'genericMessage',\n MISSING_CART_CONTEXT: 'genericMessage',\n CART_NOT_FOUND: 'genericMessage',\n NETWORK_ERROR: 'genericMessage',\n} as const satisfies Record<\n ShippingAddressUpdateErrorCode | 'NETWORK_ERROR',\n MessageFieldName<typeof CartDestinationErrorContent>\n>;\n\nexport function CartDestinationError({ $content, $locale, className, ...props }: CartDestinationErrorProps) {\n const { errors } = useCartDestination();\n const { format } = useMessageFormatter(CartDestinationErrorContent, $content);\n const [firstError] = errors;\n if (!firstError) return null;\n\n return (\n <div {...props} role=\"alert\" className={className} data-fs-cart-destination-error=\"\">\n {formatErrorCode(\n CartDestinationErrorContent,\n CART_DESTINATION_ERROR_FIELDS,\n firstError,\n format,\n 'genericMessage',\n )}\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Namespace export\n// ---------------------------------------------------------------------------\n\nexport const CartDestination = {\n Root: CartDestinationRoot,\n Read: CartDestinationRead,\n Value: CartDestinationValue,\n Unset: CartDestinationUnset,\n Change: CartDestinationChange,\n Form: CartDestinationForm,\n PostalCodeControl: CartDestinationPostalCodeControl,\n Submit: CartDestinationSubmit,\n Cancel: CartDestinationCancel,\n Error: CartDestinationError,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2CA,MAAM,WAAyB;;;;;;;;;;;;;;;;AAqB/B,MAAa,8BAA8B,kBAAkB;CAC3D,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY,EACV,QAAQ;GAAE,MAAM;GAAU,OAAO;EAAS,EAC5C;CACF;AACF,CAAC;AAED,MAAa,+BAA+B,kBAAkB;CAC5D,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY,EACV,OAAO;GAAE,MAAM;GAAU,OAAO;EAAe,EACjD;CACF;AACF,CAAC;AAED,MAAa,+BAA+B,kBAAkB;CAC5D,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY;GACV,OAAO;IAAE,MAAM;IAAU,OAAO;GAAe;GA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ue, MessageLocaleProp } from "../../core/dist/define-content-type.js";
|
|
1
2
|
import { ComponentDefinition } from "../../core/dist/define-component.js";
|
|
2
3
|
import "../../core/dist/index.js";
|
|
3
4
|
import { CartItemEntity } from "../../sdk/cart/operations.js";
|
|
@@ -5,6 +6,128 @@ import { ComponentActions } from "../../sdk/actions/types.js";
|
|
|
5
6
|
import { NavigationLinkProps } from "../../particles/navigation-link/navigation-link.js";
|
|
6
7
|
import { ComponentPropsWithRef, ReactNode } from "react";
|
|
7
8
|
//#region src/matter/cart-item/cart-item.d.ts
|
|
9
|
+
export declare const CartItemDiscountPercentageContent: {
|
|
10
|
+
readonly id: "cart-item-discount-percentage";
|
|
11
|
+
readonly title: "Cart Item Discount Percentage";
|
|
12
|
+
readonly description: "The per-line discount badge.";
|
|
13
|
+
readonly schema: {
|
|
14
|
+
readonly type: "object";
|
|
15
|
+
readonly additionalProperties: false;
|
|
16
|
+
readonly properties: {
|
|
17
|
+
readonly template: {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
readonly title: "Badge text";
|
|
20
|
+
readonly description: "percentage is the integer percent off the list price.";
|
|
21
|
+
readonly format: "icu-message";
|
|
22
|
+
readonly messageSource: "-{percentage}%";
|
|
23
|
+
readonly messageArguments: {
|
|
24
|
+
readonly type: "object";
|
|
25
|
+
readonly properties: {
|
|
26
|
+
readonly percentage: {
|
|
27
|
+
readonly type: "integer";
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
readonly messageExample: {
|
|
32
|
+
readonly percentage: 20;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export declare const CartItemQuantityContent: {
|
|
39
|
+
readonly id: "cart-item-quantity";
|
|
40
|
+
readonly title: "Cart Item Quantity";
|
|
41
|
+
readonly description: "The notice shown when a typed quantity is corrected.";
|
|
42
|
+
readonly schema: {
|
|
43
|
+
readonly type: "object";
|
|
44
|
+
readonly additionalProperties: false;
|
|
45
|
+
readonly properties: {
|
|
46
|
+
readonly validationMessage: {
|
|
47
|
+
readonly type: "string";
|
|
48
|
+
readonly title: "Adjusted quantity notice";
|
|
49
|
+
readonly description: "value is the corrected amount, in the unit shown to the shopper.";
|
|
50
|
+
readonly format: "icu-message";
|
|
51
|
+
readonly messageSource: "Quantity adjusted to {value}.";
|
|
52
|
+
readonly messageArguments: {
|
|
53
|
+
readonly type: "object";
|
|
54
|
+
readonly properties: {
|
|
55
|
+
readonly value: {
|
|
56
|
+
readonly type: "number";
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
readonly messageExample: {
|
|
61
|
+
readonly value: 3;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
export declare const CartItemRemoveContent: {
|
|
68
|
+
readonly id: "cart-item-remove";
|
|
69
|
+
readonly title: "Cart Item Remove";
|
|
70
|
+
readonly description: "The toast raised after a line is removed.";
|
|
71
|
+
readonly schema: {
|
|
72
|
+
readonly type: "object";
|
|
73
|
+
readonly additionalProperties: false;
|
|
74
|
+
readonly properties: {
|
|
75
|
+
readonly removedMessage: {
|
|
76
|
+
readonly type: "string";
|
|
77
|
+
readonly title: "Removed message";
|
|
78
|
+
readonly format: "icu-message";
|
|
79
|
+
readonly messageSource: "Item removed";
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
export declare const CartItemUnavailableContent: {
|
|
85
|
+
readonly id: "cart-item-unavailable";
|
|
86
|
+
readonly title: "Cart Item Unavailable";
|
|
87
|
+
readonly description: "The status label of a line that cannot be bought, one per availability state.";
|
|
88
|
+
readonly schema: {
|
|
89
|
+
readonly type: "object";
|
|
90
|
+
readonly additionalProperties: false;
|
|
91
|
+
readonly properties: {
|
|
92
|
+
readonly outOfStockLabel: {
|
|
93
|
+
readonly type: "string";
|
|
94
|
+
readonly title: "Out of stock label";
|
|
95
|
+
readonly format: "icu-message";
|
|
96
|
+
readonly messageSource: "Out of stock";
|
|
97
|
+
};
|
|
98
|
+
readonly cannotBeDeliveredLabel: {
|
|
99
|
+
readonly type: "string";
|
|
100
|
+
readonly title: "Cannot be delivered label";
|
|
101
|
+
readonly format: "icu-message";
|
|
102
|
+
readonly messageSource: "Cannot be delivered";
|
|
103
|
+
};
|
|
104
|
+
readonly unavailableLabel: {
|
|
105
|
+
readonly type: "string";
|
|
106
|
+
readonly title: "Unavailable label";
|
|
107
|
+
readonly description: "Any other state the line cannot be bought in.";
|
|
108
|
+
readonly format: "icu-message";
|
|
109
|
+
readonly messageSource: "Unavailable";
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
export declare const CartItemGiftContent: {
|
|
115
|
+
readonly id: "cart-item-gift";
|
|
116
|
+
readonly title: "Cart Item Gift";
|
|
117
|
+
readonly description: "The marker of a promotional gift line.";
|
|
118
|
+
readonly schema: {
|
|
119
|
+
readonly type: "object";
|
|
120
|
+
readonly additionalProperties: false;
|
|
121
|
+
readonly properties: {
|
|
122
|
+
readonly label: {
|
|
123
|
+
readonly type: "string";
|
|
124
|
+
readonly title: "Gift label";
|
|
125
|
+
readonly format: "icu-message";
|
|
126
|
+
readonly messageSource: "Free";
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
};
|
|
8
131
|
export type CartItemRootProps = ComponentPropsWithRef<'div'> & {
|
|
9
132
|
/**
|
|
10
133
|
* Per-line slice delivered by the `reactive-list-item` runtime (`ReactiveListItemDataProvider`) —
|
|
@@ -23,8 +146,8 @@ export type CartItemVariantProps = ComponentPropsWithRef<'span'>;
|
|
|
23
146
|
export type CartItemSkuProps = ComponentPropsWithRef<'span'>;
|
|
24
147
|
export type CartItemPriceProps = ComponentPropsWithRef<'span'>;
|
|
25
148
|
export type CartItemListPriceProps = ComponentPropsWithRef<'span'>;
|
|
26
|
-
export type CartItemDiscountPercentageProps = ComponentPropsWithRef<'span'> & {
|
|
27
|
-
|
|
149
|
+
export type CartItemDiscountPercentageProps = ComponentPropsWithRef<'span'> & MessageLocaleProp & {
|
|
150
|
+
$content?: ContentValue<typeof CartItemDiscountPercentageContent>;
|
|
28
151
|
};
|
|
29
152
|
export type CartItemLineTotalProps = ComponentPropsWithRef<'span'>;
|
|
30
153
|
export type CartItemOwnTotalProps = ComponentPropsWithRef<'span'>;
|
|
@@ -39,7 +162,7 @@ export type CartItemQuantitySlice = {
|
|
|
39
162
|
unitMultiplier: number;
|
|
40
163
|
} | null;
|
|
41
164
|
};
|
|
42
|
-
export type CartItemQuantityProps = Omit<ComponentPropsWithRef<'div'>, 'defaultValue' | 'value'> & {
|
|
165
|
+
export type CartItemQuantityProps = Omit<ComponentPropsWithRef<'div'>, 'defaultValue' | 'value'> & MessageLocaleProp & {
|
|
43
166
|
/** Minimum, in purchasable units — not in the unit shown to the shopper. */
|
|
44
167
|
min?: number;
|
|
45
168
|
/** Maximum, in purchasable units. Unbounded when unset. */
|
|
@@ -47,22 +170,28 @@ export type CartItemQuantityProps = Omit<ComponentPropsWithRef<'div'>, 'defaultV
|
|
|
47
170
|
/** Step, in purchasable units: one step moves the display by one unit multiplier. */
|
|
48
171
|
step?: number;
|
|
49
172
|
removeOnDecrement?: boolean;
|
|
50
|
-
/** Snap-notice template; `{value}` is replaced with the corrected displayed amount. */
|
|
51
|
-
validationMessage?: string;
|
|
52
173
|
children?: ReactNode;
|
|
53
174
|
/** Per-line slice from the reactive-list-item runtime; injected/overridden by the wrapper. */
|
|
54
175
|
$data?: CartItemQuantitySlice | null;
|
|
55
176
|
/** Injected by the compiler from `actions: { cart: [...] }`; the cart write surface. */
|
|
56
177
|
$actions?: ComponentActions;
|
|
178
|
+
/** The snap notice; its `value` argument is the corrected displayed amount. */
|
|
179
|
+
$content?: ContentValue<typeof CartItemQuantityContent>;
|
|
57
180
|
};
|
|
58
181
|
export type CartItemQuantityValueProps = ComponentPropsWithRef<'span'>;
|
|
59
|
-
export type CartItemRemoveProps = ComponentPropsWithRef<'button'> & {
|
|
182
|
+
export type CartItemRemoveProps = ComponentPropsWithRef<'button'> & MessageLocaleProp & {
|
|
60
183
|
/** Injected by the compiler from `actions: { cart: ['removeItem'] }`; the cart write surface. */
|
|
61
184
|
$actions?: ComponentActions;
|
|
185
|
+
/** The title of the toast raised after a removal that returns no errors. */
|
|
186
|
+
$content?: ContentValue<typeof CartItemRemoveContent>;
|
|
62
187
|
};
|
|
63
188
|
export type CartItemAvailableProps = ComponentPropsWithRef<'div'>;
|
|
64
|
-
export type CartItemUnavailableProps = ComponentPropsWithRef<'div'
|
|
65
|
-
|
|
189
|
+
export type CartItemUnavailableProps = ComponentPropsWithRef<'div'> & MessageLocaleProp & {
|
|
190
|
+
$content?: ContentValue<typeof CartItemUnavailableContent>;
|
|
191
|
+
};
|
|
192
|
+
export type CartItemGiftProps = ComponentPropsWithRef<'span'> & MessageLocaleProp & {
|
|
193
|
+
$content?: ContentValue<typeof CartItemGiftContent>;
|
|
194
|
+
};
|
|
66
195
|
export declare const CartItemRootDefinition: ComponentDefinition<CartItemRootProps>;
|
|
67
196
|
export declare const CartItemImageDefinition: ComponentDefinition<CartItemImageProps>;
|
|
68
197
|
export declare const CartItemProductLinkDefinition: ComponentDefinition<CartItemProductLinkProps>;
|
|
@@ -79,25 +208,25 @@ export declare const CartItemQuantityDefinition: ComponentDefinition<CartItemQua
|
|
|
79
208
|
export declare const CartItemQuantityValueDefinition: ComponentDefinition<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>>;
|
|
80
209
|
export declare const CartItemRemoveDefinition: ComponentDefinition<CartItemRemoveProps>;
|
|
81
210
|
export declare const CartItemAvailableDefinition: ComponentDefinition<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
|
|
82
|
-
export declare const CartItemUnavailableDefinition: ComponentDefinition<
|
|
83
|
-
export declare const CartItemGiftDefinition: ComponentDefinition<
|
|
211
|
+
export declare const CartItemUnavailableDefinition: ComponentDefinition<CartItemUnavailableProps>;
|
|
212
|
+
export declare const CartItemGiftDefinition: ComponentDefinition<CartItemGiftProps>;
|
|
84
213
|
export declare function CartItemRoot({ $data: $dataProp, className, children, ...props }: CartItemRootProps): import("react/jsx-runtime").JSX.Element;
|
|
85
|
-
export declare function CartItemImage({ className, objectFit, ...props }: CartItemImageProps): import("react/jsx-runtime").JSX.Element
|
|
214
|
+
export declare function CartItemImage({ className, objectFit, ref, onError, ...props }: CartItemImageProps): import("react/jsx-runtime").JSX.Element;
|
|
86
215
|
export declare function CartItemProductLink({ className, children, ...props }: Readonly<CartItemProductLinkProps>): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
|
|
87
216
|
export declare function CartItemName({ className, children, ...props }: CartItemNameProps): import("react/jsx-runtime").JSX.Element;
|
|
88
217
|
export declare function CartItemVariant({ className, children, ...props }: CartItemVariantProps): import("react/jsx-runtime").JSX.Element | null;
|
|
89
218
|
export declare function CartItemSku({ className, children, ...props }: CartItemSkuProps): import("react/jsx-runtime").JSX.Element | null;
|
|
90
219
|
export declare function CartItemPrice({ className, children, ...props }: CartItemPriceProps): import("react/jsx-runtime").JSX.Element;
|
|
91
220
|
export declare function CartItemListPrice({ className, children, ...props }: CartItemListPriceProps): import("react/jsx-runtime").JSX.Element | null;
|
|
92
|
-
export declare function CartItemDiscountPercentage({
|
|
221
|
+
export declare function CartItemDiscountPercentage({ $content, $locale, className, children, ...props }: CartItemDiscountPercentageProps): import("react/jsx-runtime").JSX.Element | null;
|
|
93
222
|
export declare function CartItemLineTotal({ className, children, ...props }: CartItemLineTotalProps): import("react/jsx-runtime").JSX.Element;
|
|
94
223
|
export declare function CartItemOwnTotal({ className, children, ...props }: CartItemOwnTotalProps): import("react/jsx-runtime").JSX.Element;
|
|
95
224
|
export declare function CartItemAggregateTotal({ className, children, ...props }: CartItemAggregateTotalProps): import("react/jsx-runtime").JSX.Element;
|
|
96
|
-
export declare function CartItemQuantity({ className, children, min, max, step, removeOnDecrement,
|
|
225
|
+
export declare function CartItemQuantity({ className, children, min, max, step, removeOnDecrement, $data: $dataProp, $actions: $actionsProp, $content, $locale, ...props }: CartItemQuantityProps): import("react/jsx-runtime").JSX.Element | null;
|
|
97
226
|
export declare function CartItemQuantityValue({ className, children, ...props }: CartItemQuantityValueProps): import("react/jsx-runtime").JSX.Element;
|
|
98
|
-
export declare function CartItemRemove({ className, children, onClick, $actions: $actionsProp, ...props }: CartItemRemoveProps): import("react/jsx-runtime").JSX.Element | null;
|
|
227
|
+
export declare function CartItemRemove({ className, children, onClick, disabled, $actions: $actionsProp, $content, $locale, ...props }: CartItemRemoveProps): import("react/jsx-runtime").JSX.Element | null;
|
|
99
228
|
export declare function CartItemAvailable({ className, children, ...props }: CartItemAvailableProps): import("react/jsx-runtime").JSX.Element | null;
|
|
100
|
-
export declare function CartItemUnavailable({ className, children, ...props }: CartItemUnavailableProps): import("react/jsx-runtime").JSX.Element | null;
|
|
101
|
-
export declare function CartItemGift({ className, children, ...props }: CartItemGiftProps): import("react/jsx-runtime").JSX.Element | null;
|
|
229
|
+
export declare function CartItemUnavailable({ $content, $locale, className, children, ...props }: CartItemUnavailableProps): import("react/jsx-runtime").JSX.Element | null;
|
|
230
|
+
export declare function CartItemGift({ $content, $locale, className, children, ...props }: CartItemGiftProps): import("react/jsx-runtime").JSX.Element | null;
|
|
102
231
|
//#endregion
|
|
103
232
|
//# sourceMappingURL=cart-item.d.ts.map
|