@vtex/faststore 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/README.md +0 -1
- package/dist/actions.json +6 -1
- package/dist/catalog.json +789 -1701
- package/dist/cli/index.d.ts +66 -28
- package/dist/cli/index.js +7371 -512
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/server-runtime.js +41 -60
- package/dist/cli/server-runtime.js.map +1 -1
- package/dist/client.d.ts +3 -3
- package/dist/client.js +2 -2
- package/dist/components.d.ts +63 -57
- package/dist/components.js +60 -54
- package/dist/content-types.json +5785 -754
- package/dist/core/dist/define-component.d.ts +1 -1
- package/dist/core/dist/define-content-type.d.ts +50 -2
- package/dist/core/dist/define-content-type.js +107 -3
- package/dist/core/dist/define-content-type.js.map +1 -1
- package/dist/core/dist/index.d.ts +2 -2
- package/dist/docs/access-code-field.md +1 -1
- package/dist/docs/access-code-sign-in.md +126 -77
- package/dist/docs/account-address-book.md +210 -95
- package/dist/docs/account-menu.md +14 -15
- package/dist/docs/account-saved-cards.md +44 -39
- package/dist/docs/alert-dialog.md +3 -1
- package/dist/docs/avatar.md +4 -2
- package/dist/docs/billing-address.md +99 -30
- package/dist/docs/binding-switcher.md +5 -2
- package/dist/docs/buy-button.md +7 -8
- package/dist/docs/card-entry.md +39 -26
- package/dist/docs/card-summary.md +18 -8
- package/dist/docs/cardholder-document.md +5 -3
- package/dist/docs/carousel.md +5 -4
- package/dist/docs/cart-destination.md +39 -26
- package/dist/docs/cart-item.md +29 -14
- package/dist/docs/cart-totalizer.md +7 -5
- package/dist/docs/cart.md +135 -41
- package/dist/docs/challenge-return.md +135 -0
- package/dist/docs/client-preferences-fieldset.md +10 -5
- package/dist/docs/client-preferences.md +31 -8
- package/dist/docs/client-profile-fieldset.md +20 -6
- package/dist/docs/client-profile.md +12 -3
- package/dist/docs/copy-text.md +9 -7
- package/dist/docs/document-field.md +1 -1
- package/dist/docs/email-field.md +2 -1
- package/dist/docs/email-identification.md +12 -2
- package/dist/docs/footer-copyright.md +4 -2
- package/dist/docs/form.md +54 -18
- package/dist/docs/free-shipping-progress.md +6 -5
- package/dist/docs/identity-edit.md +8 -2
- package/dist/docs/identity-summary.md +18 -5
- package/dist/docs/installments.md +46 -32
- package/dist/docs/my-account-profile.md +16 -11
- package/dist/docs/navigation-link.md +5 -3
- package/dist/docs/order-cancel.md +3 -1
- package/dist/docs/order-delivery-address.md +7 -5
- package/dist/docs/order-delivery-group.md +1 -3
- package/dist/docs/order-details-back.md +1 -1
- package/dist/docs/order-details-header.md +1 -4
- package/dist/docs/order-invoice-download.md +60 -0
- package/dist/docs/order-list-row.md +1 -1
- package/dist/docs/order-list-search.md +13 -20
- package/dist/docs/order-list-views.md +11 -17
- package/dist/docs/order-list.md +12 -5
- package/dist/docs/order-payment.md +9 -7
- package/dist/docs/order-placed-date.md +1 -1
- package/dist/docs/order-placed-payment-summary.md +28 -15
- package/dist/docs/order-placed.md +49 -14
- package/dist/docs/order-progress.md +1 -1
- package/dist/docs/order-status-badge.md +20 -9
- package/dist/docs/order-summary.md +2 -2
- package/dist/docs/order-tracking-link.md +58 -0
- package/dist/docs/payment-method-badges.md +30 -4
- package/dist/docs/payment-methods.md +1 -1
- package/dist/docs/payment.md +36 -17
- package/dist/docs/phone-field.md +4 -4
- package/dist/docs/place-order.md +84 -36
- package/dist/docs/postal-code-field.md +3 -1
- package/dist/docs/pricing.md +21 -23
- package/dist/docs/product-gallery.md +19 -20
- package/dist/docs/product-information.md +13 -9
- package/dist/docs/product-list.md +7 -6
- package/dist/docs/product-shelf.md +0 -1
- package/dist/docs/promotion.md +4 -2
- package/dist/docs/region.md +23 -15
- package/dist/docs/save-card.md +7 -6
- package/dist/docs/saved-cards.md +65 -36
- package/dist/docs/shipping-address.md +57 -21
- package/dist/docs/shipping-simulator.md +53 -15
- package/dist/docs/sign-in-disclosure.md +176 -0
- package/dist/docs/sign-in-form.md +78 -47
- package/dist/docs/sign-in-redirect.md +4 -2
- package/dist/docs/sign-in.md +173 -0
- package/dist/docs/toast.md +15 -4
- package/dist/docs/variant-selector.md +15 -11
- package/dist/graphql/types.d.ts +4 -14
- package/dist/index.d.ts +2 -2
- package/dist/internal/client.d.ts +1 -3
- package/dist/internal/client.js +1 -1
- package/dist/internal/server.d.ts +7 -4
- package/dist/internal/server.js +7 -4
- package/dist/matter/access-code-sign-in/access-code-sign-in.d.ts +250 -66
- package/dist/matter/access-code-sign-in/access-code-sign-in.js +459 -188
- package/dist/matter/access-code-sign-in/access-code-sign-in.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-delete.d.ts +78 -40
- package/dist/matter/account-address-book/account-address-book-delete.js +86 -50
- package/dist/matter/account-address-book/account-address-book-delete.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-deliverability.d.ts +21 -4
- package/dist/matter/account-address-book/account-address-book-deliverability.js +45 -17
- package/dist/matter/account-address-book/account-address-book-deliverability.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-form-parts.d.ts +74 -19
- package/dist/matter/account-address-book/account-address-book-form-parts.js +77 -26
- package/dist/matter/account-address-book/account-address-book-form-parts.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-profile-notice.d.ts +27 -6
- package/dist/matter/account-address-book/account-address-book-profile-notice.js +55 -28
- package/dist/matter/account-address-book/account-address-book-profile-notice.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book.d.ts +67 -14
- package/dist/matter/account-address-book/account-address-book.js +74 -33
- package/dist/matter/account-address-book/account-address-book.js.map +1 -1
- package/dist/matter/account-address-book/account-address-country-switch.js +3 -3
- package/dist/matter/account-address-book/account-address-country-switch.js.map +1 -1
- package/dist/matter/account-address-book/account-address-country.d.ts +66 -20
- package/dist/matter/account-address-book/account-address-country.js +83 -49
- package/dist/matter/account-address-book/account-address-country.js.map +1 -1
- package/dist/matter/account-address-book/account-address-form-context.d.ts +8 -4
- package/dist/matter/account-address-book/account-address-form-context.js.map +1 -1
- package/dist/matter/account-address-book/account-address-form.d.ts +468 -45
- package/dist/matter/account-address-book/account-address-form.js +518 -155
- package/dist/matter/account-address-book/account-address-form.js.map +1 -1
- package/dist/matter/account-address-book/account-address-record.d.ts +27 -6
- package/dist/matter/account-address-book/account-address-record.js +32 -17
- package/dist/matter/account-address-book/account-address-record.js.map +1 -1
- package/dist/matter/account-menu/account-menu.d.ts +34 -17
- package/dist/matter/account-menu/account-menu.js +46 -54
- package/dist/matter/account-menu/account-menu.js.map +1 -1
- package/dist/matter/account-menu-identity/account-menu-identity.js +1 -1
- package/dist/matter/account-saved-cards/account-saved-cards.d.ts +108 -28
- package/dist/matter/account-saved-cards/account-saved-cards.js +177 -122
- package/dist/matter/account-saved-cards/account-saved-cards.js.map +1 -1
- package/dist/matter/billing-address/billing-address.d.ts +156 -74
- package/dist/matter/billing-address/billing-address.js +227 -156
- package/dist/matter/billing-address/billing-address.js.map +1 -1
- package/dist/matter/breadcrumb/breadcrumb.d.ts +21 -3
- package/dist/matter/breadcrumb/breadcrumb.js +24 -9
- package/dist/matter/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/matter/buy-button/buy-button.d.ts +8 -11
- package/dist/matter/buy-button/buy-button.js +10 -19
- package/dist/matter/buy-button/buy-button.js.map +1 -1
- package/dist/matter/card-entry/card-capture.js +12 -4
- package/dist/matter/card-entry/card-capture.js.map +1 -1
- package/dist/matter/card-entry/card-entry.d.ts +123 -32
- package/dist/matter/card-entry/card-entry.js +348 -221
- package/dist/matter/card-entry/card-entry.js.map +1 -1
- package/dist/matter/cart/cart-namespace.d.ts +7 -1
- package/dist/matter/cart/cart-namespace.js +7 -1
- package/dist/matter/cart/cart-namespace.js.map +1 -1
- package/dist/matter/cart/cart.d.ts +402 -61
- package/dist/matter/cart/cart.js +624 -153
- package/dist/matter/cart/cart.js.map +1 -1
- package/dist/matter/cart-destination/cart-destination.d.ts +30 -19
- package/dist/matter/cart-destination/cart-destination.js +160 -70
- package/dist/matter/cart-destination/cart-destination.js.map +1 -1
- package/dist/matter/cart-item/cart-item.d.ts +144 -17
- package/dist/matter/cart-item/cart-item.js +166 -49
- package/dist/matter/cart-item/cart-item.js.map +1 -1
- package/dist/matter/cart-item-compositions/cart-item-compositions.js +1 -1
- package/dist/matter/cart-item-compositions/cart-item-compositions.js.map +1 -1
- package/dist/matter/cart-item-customizations/cart-item-customizations.js +1 -1
- package/dist/matter/cart-item-customizations/cart-item-customizations.js.map +1 -1
- package/dist/matter/cart-item-discounts/cart-item-discounts.js +1 -1
- package/dist/matter/cart-item-discounts/cart-item-discounts.js.map +1 -1
- package/dist/matter/cart-item-seller-info/cart-item-seller-info.js +1 -1
- package/dist/matter/cart-item-seller-info/cart-item-seller-info.js.map +1 -1
- package/dist/matter/cart-item-variations/cart-item-variations.js +1 -1
- package/dist/matter/cart-item-variations/cart-item-variations.js.map +1 -1
- package/dist/matter/cart-totalizer/cart-totalizer.d.ts +43 -9
- package/dist/matter/cart-totalizer/cart-totalizer.js +46 -17
- package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -1
- package/dist/matter/challenge-return/challenge-return.d.ts +62 -0
- package/dist/matter/challenge-return/challenge-return.js +241 -0
- package/dist/matter/challenge-return/challenge-return.js.map +1 -0
- package/dist/matter/client-preferences/client-preferences-fieldset.d.ts +86 -17
- package/dist/matter/client-preferences/client-preferences-fieldset.js +126 -54
- package/dist/matter/client-preferences/client-preferences-fieldset.js.map +1 -1
- package/dist/matter/client-preferences/client-preferences.d.ts +50 -7
- package/dist/matter/client-preferences/client-preferences.js +84 -15
- package/dist/matter/client-preferences/client-preferences.js.map +1 -1
- package/dist/matter/client-profile/client-profile.d.ts +44 -9
- package/dist/matter/client-profile/client-profile.js +64 -24
- package/dist/matter/client-profile/client-profile.js.map +1 -1
- package/dist/matter/client-profile-form/client-profile-fieldset.d.ts +119 -22
- package/dist/matter/client-profile-form/client-profile-fieldset.js +161 -73
- package/dist/matter/client-profile-form/client-profile-fieldset.js.map +1 -1
- package/dist/matter/delivery-options/delivery-options-accordion.d.ts +49 -4
- package/dist/matter/delivery-options/delivery-options-accordion.js +67 -14
- package/dist/matter/delivery-options/delivery-options-accordion.js.map +1 -1
- package/dist/matter/delivery-options/delivery-options-controller.d.ts +69 -9
- package/dist/matter/delivery-options/delivery-options-controller.js +80 -14
- package/dist/matter/delivery-options/delivery-options-controller.js.map +1 -1
- package/dist/matter/delivery-options/delivery-options.d.ts +37 -2
- package/dist/matter/delivery-options/delivery-options.js +75 -12
- package/dist/matter/delivery-options/delivery-options.js.map +1 -1
- package/dist/matter/delivery-options/use-delivery-option-selection.d.ts +1 -0
- package/dist/matter/delivery-options/use-delivery-option-selection.js +1 -1
- package/dist/matter/delivery-options/use-delivery-option-selection.js.map +1 -1
- package/dist/matter/email-identification/email-identification.d.ts +25 -3
- package/dist/matter/email-identification/email-identification.js +49 -12
- package/dist/matter/email-identification/email-identification.js.map +1 -1
- package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +79 -7
- package/dist/matter/free-shipping-progress/free-shipping-progress.js +77 -20
- package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -1
- package/dist/matter/identity-edit/identity-edit.d.ts +52 -10
- package/dist/matter/identity-edit/identity-edit.js +47 -19
- package/dist/matter/identity-edit/identity-edit.js.map +1 -1
- package/dist/matter/identity-summary/identity-summary.d.ts +76 -22
- package/dist/matter/identity-summary/identity-summary.js +95 -45
- package/dist/matter/identity-summary/identity-summary.js.map +1 -1
- package/dist/matter/installments/installments-select.d.ts +98 -16
- package/dist/matter/installments/installments-select.js +156 -48
- package/dist/matter/installments/installments-select.js.map +1 -1
- package/dist/matter/installments/installments.d.ts +96 -16
- package/dist/matter/installments/installments.js +115 -40
- package/dist/matter/installments/installments.js.map +1 -1
- package/dist/matter/installments/use-installments-selection.d.ts +1 -0
- package/dist/matter/installments/use-installments-selection.js +8 -3
- package/dist/matter/installments/use-installments-selection.js.map +1 -1
- package/dist/matter/my-account-profile/my-account-profile.d.ts +358 -103
- package/dist/matter/my-account-profile/my-account-profile.js +370 -174
- package/dist/matter/my-account-profile/my-account-profile.js.map +1 -1
- package/dist/matter/order-cancel/order-cancel.d.ts +65 -19
- package/dist/matter/order-cancel/order-cancel.js +118 -51
- package/dist/matter/order-cancel/order-cancel.js.map +1 -1
- package/dist/matter/order-delivery-address/order-delivery-address.d.ts +8 -18
- package/dist/matter/order-delivery-address/order-delivery-address.js +14 -23
- package/dist/matter/order-delivery-address/order-delivery-address.js.map +1 -1
- package/dist/matter/order-delivery-group/order-delivery-group.d.ts +40 -24
- package/dist/matter/order-delivery-group/order-delivery-group.js +64 -74
- package/dist/matter/order-delivery-group/order-delivery-group.js.map +1 -1
- package/dist/matter/order-details-header/order-details-header.d.ts +32 -15
- package/dist/matter/order-details-header/order-details-header.js +66 -58
- package/dist/matter/order-details-header/order-details-header.js.map +1 -1
- package/dist/matter/order-invoice-download/order-invoice-download.d.ts +78 -0
- package/dist/matter/order-invoice-download/order-invoice-download.js +173 -0
- package/dist/matter/order-invoice-download/order-invoice-download.js.map +1 -0
- package/dist/matter/order-list/order-list.d.ts +164 -19
- package/dist/matter/order-list/order-list.js +229 -87
- package/dist/matter/order-list/order-list.js.map +1 -1
- package/dist/matter/order-list-row/order-list-row.d.ts +6 -1
- package/dist/matter/order-list-row/order-list-row.js +3 -2
- package/dist/matter/order-list-row/order-list-row.js.map +1 -1
- package/dist/matter/order-list-search/order-list-search.d.ts +18 -26
- package/dist/matter/order-list-search/order-list-search.js +30 -69
- package/dist/matter/order-list-search/order-list-search.js.map +1 -1
- package/dist/matter/order-list-views/order-list-views.d.ts +15 -22
- package/dist/matter/order-list-views/order-list-views.js +22 -68
- package/dist/matter/order-list-views/order-list-views.js.map +1 -1
- package/dist/matter/order-payment/order-payment.d.ts +33 -10
- package/dist/matter/order-payment/order-payment.js +44 -39
- package/dist/matter/order-payment/order-payment.js.map +1 -1
- package/dist/matter/order-placed/order-placed-deliveries.d.ts +144 -12
- package/dist/matter/order-placed/order-placed-deliveries.js +115 -40
- package/dist/matter/order-placed/order-placed-deliveries.js.map +1 -1
- package/dist/matter/order-placed/order-placed.d.ts +198 -31
- package/dist/matter/order-placed/order-placed.js +230 -139
- package/dist/matter/order-placed/order-placed.js.map +1 -1
- package/dist/matter/order-placed-date/order-placed-date.d.ts +5 -8
- package/dist/matter/order-placed-date/order-placed-date.js +7 -8
- package/dist/matter/order-placed-date/order-placed-date.js.map +1 -1
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.d.ts +90 -17
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js +93 -117
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js.map +1 -1
- package/dist/matter/order-progress/order-progress.d.ts +19 -8
- package/dist/matter/order-progress/order-progress.js +37 -45
- package/dist/matter/order-progress/order-progress.js.map +1 -1
- package/dist/matter/order-summary/order-summary.d.ts +19 -9
- package/dist/matter/order-summary/order-summary.js +38 -44
- package/dist/matter/order-summary/order-summary.js.map +1 -1
- package/dist/matter/order-tracking-link/order-tracking-link.d.ts +43 -0
- package/dist/matter/order-tracking-link/order-tracking-link.js +107 -0
- package/dist/matter/order-tracking-link/order-tracking-link.js.map +1 -0
- package/dist/matter/payment/payment-card-capture.js +17 -10
- package/dist/matter/payment/payment-card-capture.js.map +1 -1
- package/dist/matter/payment/payment-controller.d.ts +4 -2
- package/dist/matter/payment/payment-controller.js +30 -9
- package/dist/matter/payment/payment-controller.js.map +1 -1
- package/dist/matter/payment/payment-method-badges.js +1 -1
- package/dist/matter/payment/payment.d.ts +69 -19
- package/dist/matter/payment/payment.js +101 -35
- package/dist/matter/payment/payment.js.map +1 -1
- package/dist/matter/payment/use-payment-method-selection.d.ts +25 -4
- package/dist/matter/payment/use-payment-method-selection.js +94 -32
- package/dist/matter/payment/use-payment-method-selection.js.map +1 -1
- package/dist/matter/payment/use-payment-submit-gate.d.ts +14 -3
- package/dist/matter/payment/use-payment-submit-gate.js +47 -8
- package/dist/matter/payment/use-payment-submit-gate.js.map +1 -1
- package/dist/matter/place-order/place-order.d.ts +171 -57
- package/dist/matter/place-order/place-order.js +376 -185
- package/dist/matter/place-order/place-order.js.map +1 -1
- package/dist/matter/pricing/pricing.d.ts +152 -13
- package/dist/matter/pricing/pricing.js +153 -52
- package/dist/matter/pricing/pricing.js.map +1 -1
- package/dist/matter/product-information/product-information.d.ts +27 -4
- package/dist/matter/product-information/product-information.js +32 -15
- package/dist/matter/product-information/product-information.js.map +1 -1
- package/dist/matter/product-list/product-list.d.ts +24 -6
- package/dist/matter/product-list/product-list.js +32 -26
- package/dist/matter/product-list/product-list.js.map +1 -1
- package/dist/matter/product-shelf/product-shelf.d.ts +1 -3
- package/dist/matter/product-shelf/product-shelf.js +2 -15
- package/dist/matter/product-shelf/product-shelf.js.map +1 -1
- package/dist/matter/region/region.d.ts +33 -16
- package/dist/matter/region/region.js +59 -52
- package/dist/matter/region/region.js.map +1 -1
- package/dist/matter/save-card/save-card.d.ts +43 -8
- package/dist/matter/save-card/save-card.js +61 -23
- package/dist/matter/save-card/save-card.js.map +1 -1
- package/dist/matter/saved-cards/saved-cards.d.ts +113 -21
- package/dist/matter/saved-cards/saved-cards.js +349 -77
- package/dist/matter/saved-cards/saved-cards.js.map +1 -1
- package/dist/matter/shipping-address/address-payload.js +25 -0
- package/dist/matter/shipping-address/address-payload.js.map +1 -0
- package/dist/matter/shipping-address/country-descriptors.js +71 -71
- package/dist/matter/shipping-address/country-descriptors.js.map +1 -1
- package/dist/matter/shipping-address/library-country-descriptors.js +136 -0
- package/dist/matter/shipping-address/library-country-descriptors.js.map +1 -0
- package/dist/matter/shipping-address/shipping-address.d.ts +312 -45
- package/dist/matter/shipping-address/shipping-address.js +443 -188
- package/dist/matter/shipping-address/shipping-address.js.map +1 -1
- package/dist/matter/shipping-simulator/shipping-simulator.d.ts +250 -24
- package/dist/matter/shipping-simulator/shipping-simulator.js +257 -51
- package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
- package/dist/matter/sign-in/sign-in.d.ts +108 -0
- package/dist/matter/sign-in/sign-in.js +285 -0
- package/dist/matter/sign-in/sign-in.js.map +1 -0
- package/dist/matter/sign-in-disclosure/sign-in-disclosure.d.ts +81 -0
- package/dist/matter/sign-in-disclosure/sign-in-disclosure.js +232 -0
- package/dist/matter/sign-in-disclosure/sign-in-disclosure.js.map +1 -0
- package/dist/matter/sign-in-form/sign-in-form.d.ts +93 -62
- package/dist/matter/sign-in-form/sign-in-form.js +134 -144
- package/dist/matter/sign-in-form/sign-in-form.js.map +1 -1
- package/dist/particles/binding-switcher/binding-switcher.d.ts +29 -8
- package/dist/particles/binding-switcher/binding-switcher.js +37 -26
- package/dist/particles/binding-switcher/binding-switcher.js.map +1 -1
- package/dist/particles/card-summary/card-summary.d.ts +38 -8
- package/dist/particles/card-summary/card-summary.js +55 -22
- package/dist/particles/card-summary/card-summary.js.map +1 -1
- package/dist/particles/carousel/carousel.d.ts +99 -11
- package/dist/particles/carousel/carousel.js +103 -35
- package/dist/particles/carousel/carousel.js.map +1 -1
- package/dist/particles/copy-text/copy-text.js +5 -15
- package/dist/particles/copy-text/copy-text.js.map +1 -1
- package/dist/particles/dialog/dialog.d.ts +14 -6
- package/dist/particles/dialog/dialog.js +6 -3
- package/dist/particles/dialog/dialog.js.map +1 -1
- package/dist/particles/drawer/drawer.js +1 -1
- package/dist/particles/drawer/drawer.js.map +1 -1
- package/dist/particles/email-field/email-field.d.ts +2 -1
- package/dist/particles/email-field/email-field.js +2 -1
- package/dist/particles/email-field/email-field.js.map +1 -1
- package/dist/particles/footer-link-group/footer-link-group.js +1 -0
- package/dist/particles/footer-link-group/footer-link-group.js.map +1 -1
- package/dist/particles/form/form.d.ts +85 -13
- package/dist/particles/form/form.js +91 -42
- package/dist/particles/form/form.js.map +1 -1
- package/dist/particles/gallery/gallery.d.ts +129 -12
- package/dist/particles/gallery/gallery.js +121 -34
- package/dist/particles/gallery/gallery.js.map +1 -1
- package/dist/particles/order-details-back/order-details-back.d.ts +5 -3
- package/dist/particles/order-details-back/order-details-back.js +8 -10
- package/dist/particles/order-details-back/order-details-back.js.map +1 -1
- package/dist/particles/order-status-badge/order-status-badge.d.ts +3 -3
- package/dist/particles/order-status-badge/order-status-badge.js +4 -20
- package/dist/particles/order-status-badge/order-status-badge.js.map +1 -1
- package/dist/particles/password-field/password-field.d.ts +1 -1
- package/dist/particles/password-field/password-field.js +2 -4
- package/dist/particles/password-field/password-field.js.map +1 -1
- package/dist/particles/phone-field/phone-field.d.ts +4 -4
- package/dist/particles/phone-field/phone-field.js +8 -11
- package/dist/particles/phone-field/phone-field.js.map +1 -1
- package/dist/particles/spinner/spinner.d.ts +24 -4
- package/dist/particles/spinner/spinner.js +25 -9
- package/dist/particles/spinner/spinner.js.map +1 -1
- package/dist/particles/switch/switch.d.ts +4 -1
- package/dist/particles/switch/switch.js +3 -1
- package/dist/particles/switch/switch.js.map +1 -1
- package/dist/particles/toast/toast.d.ts +29 -3
- package/dist/particles/toast/toast.js +34 -10
- package/dist/particles/toast/toast.js.map +1 -1
- package/dist/schema.graphql +164 -56
- package/dist/sdk/address/address-fields.js +4 -4
- package/dist/sdk/address/address-fields.js.map +1 -1
- package/dist/sdk/address/constants.js +1 -6
- package/dist/sdk/address/constants.js.map +1 -1
- package/dist/sdk/address/messages.js +44 -44
- package/dist/sdk/address/messages.js.map +1 -1
- package/dist/sdk/address/postal-code.js +15 -2
- package/dist/sdk/address/postal-code.js.map +1 -1
- package/dist/sdk/address/types.d.ts +5 -3
- package/dist/sdk/address/validate-address.js +3 -3
- package/dist/sdk/address/validate-address.js.map +1 -1
- package/dist/sdk/analytics/use-analytics-actions.d.ts +1 -1
- package/dist/sdk/analytics/use-analytics-actions.js.map +1 -1
- package/dist/sdk/cart/use-cart-actions.js.map +1 -1
- package/dist/sdk/data/index.js +2 -2
- package/dist/sdk/data/reactive-list-item-data-provider.js +2 -2
- package/dist/sdk/generated/gql.js +1 -1
- package/dist/sdk/generated/gql.js.map +1 -1
- package/dist/sdk/generated/graphql.d.ts +20 -5
- package/dist/sdk/generated/graphql.js +6 -0
- package/dist/sdk/generated/graphql.js.map +1 -1
- package/dist/sdk/i18n/format-error-code.js +23 -0
- package/dist/sdk/i18n/format-error-code.js.map +1 -0
- package/dist/sdk/i18n/message-formatter.d.ts +22 -0
- package/dist/sdk/i18n/message-formatter.js +140 -0
- package/dist/sdk/i18n/message-formatter.js.map +1 -0
- package/dist/sdk/i18n/use-message-formatter.d.ts +8 -0
- package/dist/sdk/i18n/use-message-formatter.js +18 -0
- package/dist/sdk/i18n/use-message-formatter.js.map +1 -0
- package/dist/sdk/identity/use-identity-actions.js.map +1 -1
- package/dist/sdk/navigation/redirect.d.ts +2 -0
- package/dist/sdk/navigation/redirect.js +19 -1
- package/dist/sdk/navigation/redirect.js.map +1 -1
- package/dist/sdk/navigation/types.d.ts +13 -0
- package/dist/sdk/payment/bin-format.js +20 -0
- package/dist/sdk/payment/bin-format.js.map +1 -0
- package/dist/sdk/payment/challenge-return.js +37 -0
- package/dist/sdk/payment/challenge-return.js.map +1 -0
- package/dist/sdk/payment/confirmation-last-four.js +39 -0
- package/dist/sdk/payment/confirmation-last-four.js.map +1 -0
- package/dist/sdk/payment/gateway.d.ts +1 -1
- package/dist/sdk/payment/gateway.js +8 -2
- package/dist/sdk/payment/gateway.js.map +1 -1
- package/dist/sdk/payment/operations.d.ts +1 -0
- package/dist/sdk/payment/operations.js +28 -6
- package/dist/sdk/payment/operations.js.map +1 -1
- package/dist/sdk/payment/resumed-purchase.d.ts +1 -0
- package/dist/sdk/payment/resumed-purchase.js +119 -0
- package/dist/sdk/payment/resumed-purchase.js.map +1 -0
- package/dist/sdk/payment/security-code-mask.js +16 -23
- package/dist/sdk/payment/security-code-mask.js.map +1 -1
- package/dist/sdk/payment/submission-registry.js +6 -2
- package/dist/sdk/payment/submission-registry.js.map +1 -1
- package/dist/sdk/payment/use-payment-actions.d.ts +18 -3
- package/dist/sdk/payment/use-payment-actions.js +23 -3
- package/dist/sdk/payment/use-payment-actions.js.map +1 -1
- package/dist/sdk/payment/use-place-order.d.ts +10 -2
- package/dist/sdk/payment/use-place-order.js +138 -76
- package/dist/sdk/payment/use-place-order.js.map +1 -1
- package/dist/sdk/provider/storefront-provider.d.ts +1 -7
- package/dist/sdk/provider/storefront-provider.js +4 -11
- package/dist/sdk/provider/storefront-provider.js.map +1 -1
- package/dist/sdk/seo/entity-landing.d.ts +24 -0
- package/dist/sdk/seo/entity-landing.js +30 -0
- package/dist/sdk/seo/entity-landing.js.map +1 -0
- package/dist/sdk/seo/page-alternates.d.ts +3 -2
- package/dist/sdk/seo/page-alternates.js +4 -2
- package/dist/sdk/seo/page-alternates.js.map +1 -1
- package/dist/sdk/seo/search-landing.d.ts +42 -0
- package/dist/sdk/seo/search-landing.js +85 -0
- package/dist/sdk/seo/search-landing.js.map +1 -0
- package/dist/sdk/session/mock-session.d.ts +9 -0
- package/dist/sdk/session/mock-session.js +31 -0
- package/dist/sdk/session/mock-session.js.map +1 -0
- package/dist/sdk/session/read-server-session.d.ts +3 -0
- package/dist/sdk/session/read-server-session.js +5 -0
- package/dist/sdk/session/read-server-session.js.map +1 -1
- package/dist/sdk/session/return-path-segment.d.ts +10 -0
- package/dist/sdk/session/return-path-segment.js +15 -0
- package/dist/sdk/session/return-path-segment.js.map +1 -0
- package/dist/sdk/session/use-session-actions.js.map +1 -1
- package/dist/sdk/shipping/use-cart-shipping-simulation.js.map +1 -1
- package/dist/sdk/shipping/use-shipping-actions.js.map +1 -1
- package/dist/sdk/shipping/use-shipping-simulation.js.map +1 -1
- package/dist/utils/safe-href.d.ts +2 -0
- package/package.json +4 -3
- package/skills/storefront-asset/SKILL.md +2 -2
- package/skills/storefront-asset/references/api-side.md +27 -14
- package/skills/storefront-asset/references/findings.md +5 -2
- package/src/styles/tailwind.css +8 -0
- package/dist/matter/shipping-address/country-descriptors.d.ts +0 -1
- package/dist/message-locales.json +0 -7
- package/dist/sdk/i18n/client.d.ts +0 -4
- package/dist/sdk/i18n/client.js +0 -4
- package/dist/sdk/i18n/locales.d.ts +0 -8
- package/dist/sdk/i18n/locales.js +0 -57
- package/dist/sdk/i18n/locales.js.map +0 -1
- package/dist/sdk/i18n/messages/en-US.js +0 -183
- package/dist/sdk/i18n/messages/en-US.js.map +0 -1
- package/dist/sdk/i18n/messages/en-US.json +0 -178
- package/dist/sdk/i18n/messages/en-US.json.d.ts +0 -182
- package/dist/sdk/i18n/messages/es-ES.js +0 -183
- package/dist/sdk/i18n/messages/es-ES.js.map +0 -1
- package/dist/sdk/i18n/messages/es-ES.json +0 -178
- package/dist/sdk/i18n/messages/pt-BR.js +0 -183
- package/dist/sdk/i18n/messages/pt-BR.js.map +0 -1
- package/dist/sdk/i18n/messages/pt-BR.json +0 -178
- package/dist/sdk/i18n/provider.d.ts +0 -1
- package/dist/sdk/i18n/provider.js +0 -30
- package/dist/sdk/i18n/provider.js.map +0 -1
- package/dist/sdk/i18n/server.d.ts +0 -28
- package/dist/sdk/i18n/server.js +0 -59
- package/dist/sdk/i18n/server.js.map +0 -1
- package/dist/utils/resolve-authored-copy.js +0 -18
- package/dist/utils/resolve-authored-copy.js.map +0 -1
- package/dist/utils/substitute-template.js +0 -33
- package/dist/utils/substitute-template.js.map +0 -1
|
@@ -1,19 +1,123 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { defineComponent } from "../../core/dist/define-component.js";
|
|
3
|
+
import { defineContentType } from "../../core/dist/define-content-type.js";
|
|
3
4
|
import "../../core/dist/index.js";
|
|
4
5
|
import { resolveSafeHref } from "../../utils/safe-href.js";
|
|
5
6
|
import { useStorefrontContext } from "../../sdk/context/storefront-context.js";
|
|
7
|
+
import { useMessageFormatter } from "../../sdk/i18n/use-message-formatter.js";
|
|
6
8
|
import { graphql } from "../../sdk/generated/gql.js";
|
|
7
9
|
import { useActionsOverride } from "../../sdk/actions/actions-override-context.js";
|
|
8
10
|
import { useDataOverride } from "../../sdk/data/data-override-context.js";
|
|
9
|
-
import { NavigationLink } from "../../particles/navigation-link/navigation-link.js";
|
|
10
11
|
import { loggableErrorName } from "../../utils/loggable-error-name.js";
|
|
12
|
+
import { NavigationLink } from "../../particles/navigation-link/navigation-link.js";
|
|
11
13
|
import { useOptionalToast } from "../../particles/toast/toast.js";
|
|
12
14
|
import { formatPrice, isFiniteAmount } from "../cart/cart.js";
|
|
13
|
-
import { createContext, useCallback, useContext, useState } from "react";
|
|
15
|
+
import { createContext, useCallback, useContext, useRef, useState } from "react";
|
|
14
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
17
|
import { NumberField } from "@base-ui/react/number-field";
|
|
16
18
|
//#region src/matter/cart-item/cart-item.tsx
|
|
19
|
+
const CartItemDiscountPercentageContent = defineContentType({
|
|
20
|
+
id: "cart-item-discount-percentage",
|
|
21
|
+
title: "Cart Item Discount Percentage",
|
|
22
|
+
description: "The per-line discount badge.",
|
|
23
|
+
schema: {
|
|
24
|
+
type: "object",
|
|
25
|
+
additionalProperties: false,
|
|
26
|
+
properties: { template: {
|
|
27
|
+
type: "string",
|
|
28
|
+
title: "Badge text",
|
|
29
|
+
description: "percentage is the integer percent off the list price.",
|
|
30
|
+
format: "icu-message",
|
|
31
|
+
messageSource: "-{percentage}%",
|
|
32
|
+
messageArguments: {
|
|
33
|
+
type: "object",
|
|
34
|
+
properties: { percentage: { type: "integer" } }
|
|
35
|
+
},
|
|
36
|
+
messageExample: { percentage: 20 }
|
|
37
|
+
} }
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const CartItemQuantityContent = defineContentType({
|
|
41
|
+
id: "cart-item-quantity",
|
|
42
|
+
title: "Cart Item Quantity",
|
|
43
|
+
description: "The notice shown when a typed quantity is corrected.",
|
|
44
|
+
schema: {
|
|
45
|
+
type: "object",
|
|
46
|
+
additionalProperties: false,
|
|
47
|
+
properties: { validationMessage: {
|
|
48
|
+
type: "string",
|
|
49
|
+
title: "Adjusted quantity notice",
|
|
50
|
+
description: "value is the corrected amount, in the unit shown to the shopper.",
|
|
51
|
+
format: "icu-message",
|
|
52
|
+
messageSource: "Quantity adjusted to {value}.",
|
|
53
|
+
messageArguments: {
|
|
54
|
+
type: "object",
|
|
55
|
+
properties: { value: { type: "number" } }
|
|
56
|
+
},
|
|
57
|
+
messageExample: { value: 3 }
|
|
58
|
+
} }
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
const CartItemRemoveContent = defineContentType({
|
|
62
|
+
id: "cart-item-remove",
|
|
63
|
+
title: "Cart Item Remove",
|
|
64
|
+
description: "The toast raised after a line is removed.",
|
|
65
|
+
schema: {
|
|
66
|
+
type: "object",
|
|
67
|
+
additionalProperties: false,
|
|
68
|
+
properties: { removedMessage: {
|
|
69
|
+
type: "string",
|
|
70
|
+
title: "Removed message",
|
|
71
|
+
format: "icu-message",
|
|
72
|
+
messageSource: "Item removed"
|
|
73
|
+
} }
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
const CartItemUnavailableContent = defineContentType({
|
|
77
|
+
id: "cart-item-unavailable",
|
|
78
|
+
title: "Cart Item Unavailable",
|
|
79
|
+
description: "The status label of a line that cannot be bought, one per availability state.",
|
|
80
|
+
schema: {
|
|
81
|
+
type: "object",
|
|
82
|
+
additionalProperties: false,
|
|
83
|
+
properties: {
|
|
84
|
+
outOfStockLabel: {
|
|
85
|
+
type: "string",
|
|
86
|
+
title: "Out of stock label",
|
|
87
|
+
format: "icu-message",
|
|
88
|
+
messageSource: "Out of stock"
|
|
89
|
+
},
|
|
90
|
+
cannotBeDeliveredLabel: {
|
|
91
|
+
type: "string",
|
|
92
|
+
title: "Cannot be delivered label",
|
|
93
|
+
format: "icu-message",
|
|
94
|
+
messageSource: "Cannot be delivered"
|
|
95
|
+
},
|
|
96
|
+
unavailableLabel: {
|
|
97
|
+
type: "string",
|
|
98
|
+
title: "Unavailable label",
|
|
99
|
+
description: "Any other state the line cannot be bought in.",
|
|
100
|
+
format: "icu-message",
|
|
101
|
+
messageSource: "Unavailable"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
const CartItemGiftContent = defineContentType({
|
|
107
|
+
id: "cart-item-gift",
|
|
108
|
+
title: "Cart Item Gift",
|
|
109
|
+
description: "The marker of a promotional gift line.",
|
|
110
|
+
schema: {
|
|
111
|
+
type: "object",
|
|
112
|
+
additionalProperties: false,
|
|
113
|
+
properties: { label: {
|
|
114
|
+
type: "string",
|
|
115
|
+
title: "Gift label",
|
|
116
|
+
format: "icu-message",
|
|
117
|
+
messageSource: "Free"
|
|
118
|
+
} }
|
|
119
|
+
}
|
|
120
|
+
});
|
|
17
121
|
const fragment = graphql(`
|
|
18
122
|
fragment CartItemRootData on Query {
|
|
19
123
|
cart {
|
|
@@ -103,7 +207,7 @@ const CartItemRootDefinition = defineComponent({
|
|
|
103
207
|
category: "commerce"
|
|
104
208
|
},
|
|
105
209
|
schema: {},
|
|
106
|
-
guideline: "Per-line data provider for the cart line-item template: place it directly inside CartList, wrapping the CartItem* particles (CartItemImage, CartItemName, CartItemPrice, the CartItemQuantity stepper, CartItemRemove, …). It owns the core per-item fields and delivers each line its own slice, so the core particles must sit inside it. Must be inside CartList. See cart-item.md."
|
|
210
|
+
guideline: "Per-line data provider for the cart line-item template: place it directly inside CartList, CartAvailableItems or CartUnavailableItems, wrapping the CartItem* particles (CartItemImage, CartItemName, CartItemPrice, the CartItemQuantity stepper, CartItemRemove, …). It owns the core per-item fields and delivers each line its own slice, so the core particles must sit inside it. Must be inside CartList, CartAvailableItems or CartUnavailableItems. See cart-item.md."
|
|
107
211
|
});
|
|
108
212
|
const CartItemImageDefinition = defineComponent({
|
|
109
213
|
name: "CartItemImage",
|
|
@@ -202,17 +306,14 @@ const CartItemDiscountPercentageDefinition = defineComponent({
|
|
|
202
306
|
name: "CartItemDiscountPercentage",
|
|
203
307
|
importPath: "@vtex/faststore/components",
|
|
204
308
|
component: CartItemDiscountPercentage,
|
|
309
|
+
content: CartItemDiscountPercentageContent,
|
|
205
310
|
requiresContext: "cart-item-data",
|
|
206
311
|
editor: {
|
|
207
312
|
label: "Cart Item Discount %",
|
|
208
313
|
category: "commerce"
|
|
209
314
|
},
|
|
210
|
-
schema: {
|
|
211
|
-
|
|
212
|
-
default: "-{percentage}%",
|
|
213
|
-
label: "Template"
|
|
214
|
-
} },
|
|
215
|
-
guideline: "Per-line discount badge showing the integer listPrice-vs-sellingPrice percentage (e.g. \"-20%\"); use the template prop to customize the format ({percentage} is the integer percent). Renders null when the line has no discount (sellingPrice >= listPrice), so it only appears on promotional lines. Place alongside CartItemPrice/CartItemListPrice. Must be inside CartItemRoot."
|
|
315
|
+
schema: {},
|
|
316
|
+
guideline: "Per-line discount badge showing the integer listPrice-vs-sellingPrice percentage (e.g. \"-20%\"); the $content field template is an ICU message whose percentage argument is the integer percent. Renders null when the line has no discount (sellingPrice >= listPrice), so it only appears on promotional lines. Place alongside CartItemPrice/CartItemListPrice. Must be inside CartItemRoot."
|
|
216
317
|
});
|
|
217
318
|
const CartItemLineTotalDefinition = defineComponent({
|
|
218
319
|
name: "CartItemLineTotal",
|
|
@@ -254,6 +355,7 @@ const CartItemQuantityDefinition = defineComponent({
|
|
|
254
355
|
name: "CartItemQuantity",
|
|
255
356
|
importPath: "@vtex/faststore/components",
|
|
256
357
|
component: CartItemQuantity,
|
|
358
|
+
content: CartItemQuantityContent,
|
|
257
359
|
fragment: cartItemQuantityFragment,
|
|
258
360
|
fetchStrategy: "reactive-list-item",
|
|
259
361
|
requiresContext: "cart-item-data",
|
|
@@ -280,11 +382,6 @@ const CartItemQuantityDefinition = defineComponent({
|
|
|
280
382
|
type: "boolean",
|
|
281
383
|
default: false,
|
|
282
384
|
label: "Remove On Decrement"
|
|
283
|
-
},
|
|
284
|
-
validationMessage: {
|
|
285
|
-
type: "string",
|
|
286
|
-
default: "Quantity adjusted to {value}.",
|
|
287
|
-
label: "Validation Message"
|
|
288
385
|
}
|
|
289
386
|
},
|
|
290
387
|
actions: { cart: [
|
|
@@ -292,7 +389,7 @@ const CartItemQuantityDefinition = defineComponent({
|
|
|
292
389
|
"decreaseQuantity",
|
|
293
390
|
"removeItem"
|
|
294
391
|
] },
|
|
295
|
-
guideline: "Quantity stepper for a cart item, shown in the unit the merchant sells in: the displayed amount is the line's quantity times its unit multiplier, so a SKU sold in 500 g portions reads 1.5 rather than 3. min, max, and step are configured in purchasable units and converted for display, so one template serves SKUs with different multipliers. A typed amount that is out of bounds or off the multiplier grid snaps to the nearest valid value on commit and renders validationMessage. Set removeOnDecrement=true to remove the item when quantity reaches the minimum. Renders nothing on a gift line — a gift's quantity is promotion-controlled and cannot be stepped or removed, so use CartItemQuantityValue to show a gift's fixed quantity. Must be inside CartItemRoot. See cart-item.md."
|
|
392
|
+
guideline: "Quantity stepper for a cart item, shown in the unit the merchant sells in: the displayed amount is the line's quantity times its unit multiplier, so a SKU sold in 500 g portions reads 1.5 rather than 3. min, max, and step are configured in purchasable units and converted for display, so one template serves SKUs with different multipliers. A typed amount that is out of bounds or off the multiplier grid snaps to the nearest valid value on commit and renders the $content field validationMessage, which also shows when the platform stores a lower quantity than the stepper asked for, such as when stock runs out. Set removeOnDecrement=true to remove the item when quantity reaches the minimum. Renders nothing on a gift line — a gift's quantity is promotion-controlled and cannot be stepped or removed, so use CartItemQuantityValue to show a gift's fixed quantity. Must be inside CartItemRoot. See cart-item.md."
|
|
296
393
|
});
|
|
297
394
|
const CartItemQuantityValueDefinition = defineComponent({
|
|
298
395
|
name: "CartItemQuantityValue",
|
|
@@ -310,18 +407,15 @@ const CartItemRemoveDefinition = defineComponent({
|
|
|
310
407
|
name: "CartItemRemove",
|
|
311
408
|
importPath: "@vtex/faststore/components",
|
|
312
409
|
component: CartItemRemove,
|
|
410
|
+
content: CartItemRemoveContent,
|
|
313
411
|
requiresContext: "cart-item-data",
|
|
314
412
|
editor: {
|
|
315
413
|
label: "Cart Item Remove",
|
|
316
414
|
category: "commerce"
|
|
317
415
|
},
|
|
318
|
-
schema: {
|
|
319
|
-
type: "string",
|
|
320
|
-
default: "Item removed",
|
|
321
|
-
label: "Removed message"
|
|
322
|
-
} },
|
|
416
|
+
schema: {},
|
|
323
417
|
actions: { cart: ["removeItem"] },
|
|
324
|
-
guideline: "Button that removes the current line item from the cart. Disabled while the removal is in flight; when the removal returns no errors it raises a toast titled removedMessage (needs a ToastProvider with a ToastList in the layout; with none, no toast shows and removal still works). Must be inside CartItemRoot. Also composes inside CartItemUnavailable as a remove-on-alert control. See cart-item.md."
|
|
418
|
+
guideline: "Button that removes the current line item from the cart. Disabled while the removal is in flight; when the removal returns no errors it raises a toast titled by the $content field removedMessage (needs a ToastProvider with a ToastList in the layout; with none, no toast shows and removal still works). Must be inside CartItemRoot. Also composes inside CartItemUnavailable as a remove-on-alert control. See cart-item.md."
|
|
325
419
|
});
|
|
326
420
|
const CartItemAvailableDefinition = defineComponent({
|
|
327
421
|
name: "CartItemAvailable",
|
|
@@ -339,25 +433,27 @@ const CartItemUnavailableDefinition = defineComponent({
|
|
|
339
433
|
name: "CartItemUnavailable",
|
|
340
434
|
importPath: "@vtex/faststore/components",
|
|
341
435
|
component: CartItemUnavailable,
|
|
436
|
+
content: CartItemUnavailableContent,
|
|
342
437
|
requiresContext: "cart-item-data",
|
|
343
438
|
editor: {
|
|
344
439
|
label: "Cart Item Unavailable",
|
|
345
440
|
category: "commerce"
|
|
346
441
|
},
|
|
347
442
|
schema: {},
|
|
348
|
-
guideline: "Status badge shown only when the current cart item is NOT available. Renders
|
|
443
|
+
guideline: "Status badge shown only when the current cart item is NOT available. Renders one $content message per state (OUT_OF_STOCK → outOfStockLabel, UNAVAILABLE → cannotBeDeliveredLabel, otherwise unavailableLabel); pass children to override the text — children REPLACE the label, so a remove-on-alert composition nests an explicit label plus a CartItemRemove. Emits data-fs-cart-item-unavailable-state for per-state styling. Must be inside CartItemRoot. See cart-item.md."
|
|
349
444
|
});
|
|
350
445
|
const CartItemGiftDefinition = defineComponent({
|
|
351
446
|
name: "CartItemGift",
|
|
352
447
|
importPath: "@vtex/faststore/components",
|
|
353
448
|
component: CartItemGift,
|
|
449
|
+
content: CartItemGiftContent,
|
|
354
450
|
requiresContext: "cart-item-data",
|
|
355
451
|
editor: {
|
|
356
452
|
label: "Cart Item Gift",
|
|
357
453
|
category: "commerce"
|
|
358
454
|
},
|
|
359
455
|
schema: {},
|
|
360
|
-
guideline: "Free marker for a promotional gift line: renders only when the current cart item is a gift, showing
|
|
456
|
+
guideline: "Free marker for a promotional gift line: renders only when the current cart item is a gift, showing the $content field label; pass children to override the text — children REPLACE the label. Place it beside CartItemPrice/CartItemListPrice, whose struck-through list price it complements. It is an inline marker, not a wrapper for a gift-only subtree. On a gift line CartItemRemove suppresses itself and CartItemRoot marks the row with data-fs-cart-item-gift-line, so neither needs composing differently. Must be inside CartItemRoot. See cart-item.md."
|
|
361
457
|
});
|
|
362
458
|
function CartItemRoot({ $data: $dataProp, className, children, ...props }) {
|
|
363
459
|
const slice = useDataOverride($dataProp) ?? null;
|
|
@@ -491,19 +587,19 @@ function CartItemListPrice({ className, children, ...props }) {
|
|
|
491
587
|
children: children ?? formatPrice(listPrice, locale, currency)
|
|
492
588
|
});
|
|
493
589
|
}
|
|
494
|
-
function CartItemDiscountPercentage({
|
|
590
|
+
function CartItemDiscountPercentage({ $content, $locale, className, children, ...props }) {
|
|
495
591
|
const item = useCartItem();
|
|
592
|
+
const { format } = useMessageFormatter(CartItemDiscountPercentageContent, $content);
|
|
496
593
|
const listPrice = Number(item.listPrice.amount);
|
|
497
594
|
const sellingPrice = Number(item.sellingPrice.amount);
|
|
498
595
|
if (listPrice <= sellingPrice) return null;
|
|
499
596
|
const percent = Math.round((listPrice - sellingPrice) / listPrice * 100);
|
|
500
|
-
const text = template.replaceAll("{percentage}", String(percent));
|
|
501
597
|
return /* @__PURE__ */ jsx("span", {
|
|
502
598
|
...props,
|
|
503
599
|
className,
|
|
504
600
|
"data-fs-cart-item-discount-percentage": "",
|
|
505
601
|
"data-fs-text": "",
|
|
506
|
-
children: children ??
|
|
602
|
+
children: children ?? format("template", { percentage: percent })
|
|
507
603
|
});
|
|
508
604
|
}
|
|
509
605
|
function CartItemLineTotal({ className, children, ...props }) {
|
|
@@ -578,11 +674,14 @@ function resolveAdjustment(entered, snappedDisplay, multiplier, minDisplay, maxD
|
|
|
578
674
|
};
|
|
579
675
|
return null;
|
|
580
676
|
}
|
|
581
|
-
function CartItemQuantity({ className, children, min = 1, max, step, removeOnDecrement,
|
|
677
|
+
function CartItemQuantity({ className, children, min = 1, max, step, removeOnDecrement, $data: $dataProp, $actions: $actionsProp, $content, $locale, ...props }) {
|
|
582
678
|
const item = useCartItem();
|
|
583
679
|
const slice = useDataOverride($dataProp);
|
|
584
680
|
const $actions = useActionsOverride($actionsProp);
|
|
585
681
|
const [adjustment, setAdjustment] = useState(null);
|
|
682
|
+
const [requestedUnits, setRequestedUnits] = useState(null);
|
|
683
|
+
const latestRequest = useRef(0);
|
|
684
|
+
const { format } = useMessageFormatter(CartItemQuantityContent, $content);
|
|
586
685
|
if (item.gift) return null;
|
|
587
686
|
const cart = $actions?.cart;
|
|
588
687
|
const multiplier = effectiveMultiplier(slice);
|
|
@@ -595,6 +694,9 @@ function CartItemQuantity({ className, children, min = 1, max, step, removeOnDec
|
|
|
595
694
|
const maxDisplay = maxUnits == null ? void 0 : roundTo(maxUnits * multiplier, decimals);
|
|
596
695
|
function handleValueCommitted(value) {
|
|
597
696
|
if (value == null) return;
|
|
697
|
+
latestRequest.current += 1;
|
|
698
|
+
const request = latestRequest.current;
|
|
699
|
+
setRequestedUnits(null);
|
|
598
700
|
if (removeOnDecrement && value < minDisplay) {
|
|
599
701
|
setAdjustment(null);
|
|
600
702
|
cart?.removeItem?.({ id: item.id });
|
|
@@ -604,15 +706,23 @@ function CartItemQuantity({ className, children, min = 1, max, step, removeOnDec
|
|
|
604
706
|
const snappedDisplay = roundTo(snapped * multiplier, decimals);
|
|
605
707
|
setAdjustment(resolveAdjustment(value, snappedDisplay, multiplier, minDisplay, maxDisplay));
|
|
606
708
|
const delta = snapped - item.quantity;
|
|
607
|
-
|
|
709
|
+
let write;
|
|
710
|
+
if (delta > 0) write = cart?.increaseQuantity?.({
|
|
608
711
|
id: item.id,
|
|
609
712
|
by: delta
|
|
610
713
|
});
|
|
611
|
-
else if (delta < 0) cart?.decreaseQuantity?.({
|
|
714
|
+
else if (delta < 0) write = cart?.decreaseQuantity?.({
|
|
612
715
|
id: item.id,
|
|
613
716
|
by: -delta
|
|
614
717
|
});
|
|
718
|
+
write?.then((errors) => {
|
|
719
|
+
if (errors.length === 0 && latestRequest.current === request) setRequestedUnits(snapped);
|
|
720
|
+
});
|
|
615
721
|
}
|
|
722
|
+
const shown = requestedUnits != null && item.quantity < requestedUnits ? {
|
|
723
|
+
reason: "platform",
|
|
724
|
+
value: roundTo(item.quantity * multiplier, decimals)
|
|
725
|
+
} : adjustment;
|
|
616
726
|
const effectiveMin = removeOnDecrement ? 0 : minDisplay;
|
|
617
727
|
const computedClassName = removeOnDecrement ? className ? `group ${className}` : "group" : className;
|
|
618
728
|
return /* @__PURE__ */ jsxs(NumberField.Root, {
|
|
@@ -620,7 +730,11 @@ function CartItemQuantity({ className, children, min = 1, max, step, removeOnDec
|
|
|
620
730
|
value: roundTo(item.quantity * multiplier, decimals),
|
|
621
731
|
onValueCommitted: handleValueCommitted,
|
|
622
732
|
onValueChange: (_value, details) => {
|
|
623
|
-
if (details.reason === "input-change" || details.reason === "input-paste" || details.reason === "input-clear")
|
|
733
|
+
if (details.reason === "input-change" || details.reason === "input-paste" || details.reason === "input-clear") {
|
|
734
|
+
latestRequest.current += 1;
|
|
735
|
+
setAdjustment(null);
|
|
736
|
+
setRequestedUnits(null);
|
|
737
|
+
}
|
|
624
738
|
},
|
|
625
739
|
min: effectiveMin,
|
|
626
740
|
max: maxDisplay,
|
|
@@ -632,15 +746,15 @@ function CartItemQuantity({ className, children, min = 1, max, step, removeOnDec
|
|
|
632
746
|
className: computedClassName,
|
|
633
747
|
"data-fs-cart-item-quantity": "",
|
|
634
748
|
...multiplier === 1 ? {} : { "data-fs-cart-item-quantity-multiplier": String(multiplier) },
|
|
635
|
-
...
|
|
749
|
+
...shown ? {
|
|
636
750
|
"data-fs-cart-item-quantity-adjusted": "",
|
|
637
|
-
"data-fs-cart-item-quantity-adjusted-reason":
|
|
751
|
+
"data-fs-cart-item-quantity-adjusted-reason": shown.reason
|
|
638
752
|
} : {},
|
|
639
753
|
...removeOnDecrement && item.quantity <= minUnits ? { "data-fs-cart-item-at-min": "" } : {},
|
|
640
|
-
children: [children,
|
|
754
|
+
children: [children, shown ? /* @__PURE__ */ jsx("div", {
|
|
641
755
|
role: "alert",
|
|
642
756
|
"data-fs-cart-item-quantity-validation": "",
|
|
643
|
-
children:
|
|
757
|
+
children: format("validationMessage", { value: shown.value })
|
|
644
758
|
}) : null]
|
|
645
759
|
});
|
|
646
760
|
}
|
|
@@ -653,11 +767,12 @@ function CartItemQuantityValue({ className, children, ...props }) {
|
|
|
653
767
|
children: children ?? String(item.quantity)
|
|
654
768
|
});
|
|
655
769
|
}
|
|
656
|
-
function CartItemRemove({ className, children, onClick, disabled,
|
|
770
|
+
function CartItemRemove({ className, children, onClick, disabled, $actions: $actionsProp, $content, $locale, ...props }) {
|
|
657
771
|
const $actions = useActionsOverride($actionsProp);
|
|
658
772
|
const item = useCartItem();
|
|
659
773
|
const toast = useOptionalToast();
|
|
660
774
|
const [pending, setPending] = useState(false);
|
|
775
|
+
const { format } = useMessageFormatter(CartItemRemoveContent, $content);
|
|
661
776
|
if (item.gift) return null;
|
|
662
777
|
async function handleClick(e) {
|
|
663
778
|
if (pending) return;
|
|
@@ -671,7 +786,7 @@ function CartItemRemove({ className, children, onClick, disabled, removedMessage
|
|
|
671
786
|
try {
|
|
672
787
|
const userErrors = await removeItem({ id: item.id });
|
|
673
788
|
if (Array.isArray(userErrors) && userErrors.length === 0) toast?.add({
|
|
674
|
-
title: removedMessage,
|
|
789
|
+
title: format("removedMessage"),
|
|
675
790
|
type: "success"
|
|
676
791
|
});
|
|
677
792
|
} catch (error) {
|
|
@@ -691,12 +806,10 @@ function CartItemRemove({ className, children, onClick, disabled, removedMessage
|
|
|
691
806
|
children
|
|
692
807
|
});
|
|
693
808
|
}
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
function unavailableLabel(availability) {
|
|
699
|
-
return UNAVAILABLE_LABELS[availability] ?? "Unavailable";
|
|
809
|
+
function unavailableField(availability) {
|
|
810
|
+
if (availability === "OUT_OF_STOCK") return "outOfStockLabel";
|
|
811
|
+
if (availability === "UNAVAILABLE") return "cannotBeDeliveredLabel";
|
|
812
|
+
return "unavailableLabel";
|
|
700
813
|
}
|
|
701
814
|
function CartItemAvailable({ className, children, ...props }) {
|
|
702
815
|
if (useCartItem().variant.availability !== "AVAILABLE") return null;
|
|
@@ -707,28 +820,32 @@ function CartItemAvailable({ className, children, ...props }) {
|
|
|
707
820
|
children
|
|
708
821
|
});
|
|
709
822
|
}
|
|
710
|
-
function CartItemUnavailable({ className, children, ...props }) {
|
|
711
|
-
const
|
|
823
|
+
function CartItemUnavailable({ $content, $locale, className, children, ...props }) {
|
|
824
|
+
const item = useCartItem();
|
|
825
|
+
const { format } = useMessageFormatter(CartItemUnavailableContent, $content);
|
|
826
|
+
const { availability } = item.variant;
|
|
712
827
|
if (availability === "AVAILABLE") return null;
|
|
713
828
|
return /* @__PURE__ */ jsx("div", {
|
|
714
829
|
...props,
|
|
715
830
|
className,
|
|
716
831
|
"data-fs-cart-item-unavailable": "",
|
|
717
832
|
"data-fs-cart-item-unavailable-state": availability.toLowerCase(),
|
|
718
|
-
children: children ??
|
|
833
|
+
children: children ?? format(unavailableField(availability))
|
|
719
834
|
});
|
|
720
835
|
}
|
|
721
|
-
function CartItemGift({ className, children, ...props }) {
|
|
722
|
-
|
|
836
|
+
function CartItemGift({ $content, $locale, className, children, ...props }) {
|
|
837
|
+
const item = useCartItem();
|
|
838
|
+
const { format } = useMessageFormatter(CartItemGiftContent, $content);
|
|
839
|
+
if (!item.gift) return null;
|
|
723
840
|
return /* @__PURE__ */ jsx("span", {
|
|
724
841
|
...props,
|
|
725
842
|
className,
|
|
726
843
|
"data-fs-cart-item-gift": "",
|
|
727
844
|
"data-fs-text": "",
|
|
728
|
-
children: children ?? "
|
|
845
|
+
children: children ?? format("label")
|
|
729
846
|
});
|
|
730
847
|
}
|
|
731
848
|
//#endregion
|
|
732
|
-
export { CartItemAggregateTotal, CartItemAggregateTotalDefinition, CartItemAvailable, CartItemAvailableDefinition, CartItemDiscountPercentage, CartItemDiscountPercentageDefinition, CartItemGift, CartItemGiftDefinition, CartItemImage, CartItemImageDefinition, CartItemLineTotal, CartItemLineTotalDefinition, CartItemListPrice, CartItemListPriceDefinition, CartItemName, CartItemNameDefinition, CartItemOwnTotal, CartItemOwnTotalDefinition, CartItemPrice, CartItemPriceDefinition, CartItemProductLink, CartItemProductLinkDefinition, CartItemQuantity, CartItemQuantityDefinition, CartItemQuantityValue, CartItemQuantityValueDefinition, CartItemRemove, CartItemRemoveDefinition, CartItemRoot, CartItemRootDefinition, CartItemSku, CartItemSkuDefinition, CartItemUnavailable, CartItemUnavailableDefinition, CartItemVariant, CartItemVariantDefinition };
|
|
849
|
+
export { CartItemAggregateTotal, CartItemAggregateTotalDefinition, CartItemAvailable, CartItemAvailableDefinition, CartItemDiscountPercentage, CartItemDiscountPercentageContent, CartItemDiscountPercentageDefinition, CartItemGift, CartItemGiftContent, CartItemGiftDefinition, CartItemImage, CartItemImageDefinition, CartItemLineTotal, CartItemLineTotalDefinition, CartItemListPrice, CartItemListPriceDefinition, CartItemName, CartItemNameDefinition, CartItemOwnTotal, CartItemOwnTotalDefinition, CartItemPrice, CartItemPriceDefinition, CartItemProductLink, CartItemProductLinkDefinition, CartItemQuantity, CartItemQuantityContent, CartItemQuantityDefinition, CartItemQuantityValue, CartItemQuantityValueDefinition, CartItemRemove, CartItemRemoveContent, CartItemRemoveDefinition, CartItemRoot, CartItemRootDefinition, CartItemSku, CartItemSkuDefinition, CartItemUnavailable, CartItemUnavailableContent, CartItemUnavailableDefinition, CartItemVariant, CartItemVariantDefinition };
|
|
733
850
|
|
|
734
851
|
//# sourceMappingURL=cart-item.js.map
|