@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContentValue } from "../../core/dist/define-content-type.js";
|
|
1
|
+
import { ContentValue, MessageLocaleProp } from "../../core/dist/define-content-type.js";
|
|
2
2
|
import { ComponentDefinition } from "../../core/dist/define-component.js";
|
|
3
3
|
import "../../core/dist/index.js";
|
|
4
4
|
import { OrderCompletionData } from "../../sdk/orders/completion-badge.js";
|
|
@@ -15,58 +15,86 @@ export declare const OrderDetailsHeaderContent: {
|
|
|
15
15
|
readonly prefix: {
|
|
16
16
|
readonly type: "string";
|
|
17
17
|
readonly title: "Prefix";
|
|
18
|
+
readonly format: "icu-message";
|
|
19
|
+
readonly messageSource: "Order #";
|
|
18
20
|
};
|
|
19
21
|
readonly copyLabel: {
|
|
20
22
|
readonly type: "string";
|
|
21
23
|
readonly title: "Copy label";
|
|
24
|
+
readonly format: "icu-message";
|
|
25
|
+
readonly messageSource: "Copy";
|
|
22
26
|
};
|
|
23
27
|
readonly copyAccessibleName: {
|
|
24
28
|
readonly type: "string";
|
|
25
29
|
readonly title: "Copy accessible name";
|
|
30
|
+
readonly format: "icu-message";
|
|
31
|
+
readonly messageSource: "Copy order number";
|
|
26
32
|
};
|
|
27
33
|
readonly copyCopied: {
|
|
28
34
|
readonly type: "string";
|
|
29
35
|
readonly title: "Copied";
|
|
36
|
+
readonly format: "icu-message";
|
|
37
|
+
readonly messageSource: "Copied";
|
|
30
38
|
};
|
|
31
39
|
readonly copyFailure: {
|
|
32
40
|
readonly type: "string";
|
|
33
41
|
readonly title: "Copy failure";
|
|
42
|
+
readonly format: "icu-message";
|
|
43
|
+
readonly messageSource: "Could not copy";
|
|
34
44
|
};
|
|
35
45
|
readonly copyDismiss: {
|
|
36
46
|
readonly type: "string";
|
|
37
47
|
readonly title: "Dismiss copy";
|
|
48
|
+
readonly format: "icu-message";
|
|
49
|
+
readonly messageSource: "Dismiss";
|
|
38
50
|
};
|
|
39
51
|
readonly statusInProgress: {
|
|
40
52
|
readonly type: "string";
|
|
41
53
|
readonly title: "In progress";
|
|
54
|
+
readonly format: "icu-message";
|
|
55
|
+
readonly messageSource: "In progress";
|
|
42
56
|
};
|
|
43
57
|
readonly statusCancellationRequested: {
|
|
44
58
|
readonly type: "string";
|
|
45
59
|
readonly title: "Cancellation requested";
|
|
60
|
+
readonly format: "icu-message";
|
|
61
|
+
readonly messageSource: "Cancellation requested";
|
|
46
62
|
};
|
|
47
63
|
readonly statusCancelled: {
|
|
48
64
|
readonly type: "string";
|
|
49
65
|
readonly title: "Cancelled";
|
|
66
|
+
readonly format: "icu-message";
|
|
67
|
+
readonly messageSource: "Canceled";
|
|
50
68
|
};
|
|
51
69
|
readonly statusDelivered: {
|
|
52
70
|
readonly type: "string";
|
|
53
71
|
readonly title: "Delivered";
|
|
72
|
+
readonly format: "icu-message";
|
|
73
|
+
readonly messageSource: "Delivered";
|
|
54
74
|
};
|
|
55
75
|
readonly statusShipped: {
|
|
56
76
|
readonly type: "string";
|
|
57
77
|
readonly title: "Shipped";
|
|
78
|
+
readonly format: "icu-message";
|
|
79
|
+
readonly messageSource: "Shipped";
|
|
58
80
|
};
|
|
59
81
|
readonly statusReadyForPickup: {
|
|
60
82
|
readonly type: "string";
|
|
61
83
|
readonly title: "Ready for pickup";
|
|
84
|
+
readonly format: "icu-message";
|
|
85
|
+
readonly messageSource: "Ready for pickup";
|
|
62
86
|
};
|
|
63
87
|
readonly statusCollected: {
|
|
64
88
|
readonly type: "string";
|
|
65
89
|
readonly title: "Collected";
|
|
90
|
+
readonly format: "icu-message";
|
|
91
|
+
readonly messageSource: "Collected";
|
|
66
92
|
};
|
|
67
93
|
readonly statusPlaceholder: {
|
|
68
94
|
readonly type: "string";
|
|
69
95
|
readonly title: "Status unavailable";
|
|
96
|
+
readonly format: "icu-message";
|
|
97
|
+
readonly messageSource: "Status unavailable";
|
|
70
98
|
};
|
|
71
99
|
};
|
|
72
100
|
};
|
|
@@ -80,25 +108,14 @@ export type OrderDetailsHeaderData = {
|
|
|
80
108
|
orderNumber: string;
|
|
81
109
|
completion: OrderCompletionData;
|
|
82
110
|
} | null;
|
|
83
|
-
export type OrderDetailsHeaderProps = Readonly<{
|
|
111
|
+
export type OrderDetailsHeaderProps = MessageLocaleProp & Readonly<{
|
|
84
112
|
$data?: OrderDetailsHeaderData | null;
|
|
85
113
|
$content?: OrderDetailsHeaderContentValue;
|
|
86
|
-
prefix?: string;
|
|
87
|
-
copyLabel?: string;
|
|
88
|
-
copyAccessibleName?: string;
|
|
89
114
|
className?: string;
|
|
90
115
|
ref?: Ref<HTMLElement>;
|
|
91
116
|
}>;
|
|
92
|
-
export declare const OrderDetailsHeaderDefinition: ComponentDefinition<
|
|
93
|
-
$data?: OrderDetailsHeaderData | null;
|
|
94
|
-
$content?: OrderDetailsHeaderContentValue;
|
|
95
|
-
prefix?: string;
|
|
96
|
-
copyLabel?: string;
|
|
97
|
-
copyAccessibleName?: string;
|
|
98
|
-
className?: string;
|
|
99
|
-
ref?: Ref<HTMLElement>;
|
|
100
|
-
}>>;
|
|
117
|
+
export declare const OrderDetailsHeaderDefinition: ComponentDefinition<OrderDetailsHeaderProps>;
|
|
101
118
|
export declare function OrderDetailsHeaderSkeleton({ className, ...props }: ComponentPropsWithRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
102
|
-
export declare function OrderDetailsHeader({ $data, $content,
|
|
119
|
+
export declare function OrderDetailsHeader({ $data, $content, className, ref }: OrderDetailsHeaderProps): import("react/jsx-runtime").JSX.Element | null;
|
|
103
120
|
//#endregion
|
|
104
121
|
//# sourceMappingURL=order-details-header.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { defineComponent } from "../../core/dist/define-component.js";
|
|
3
3
|
import { defineContentType } from "../../core/dist/define-content-type.js";
|
|
4
4
|
import "../../core/dist/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { useMessageFormatter } from "../../sdk/i18n/use-message-formatter.js";
|
|
6
6
|
import { CopyText } from "../../particles/copy-text/copy-text.js";
|
|
7
7
|
import { OrderStatusBadge } from "../../particles/order-status-badge/order-status-badge.js";
|
|
8
8
|
import { completionBadgeModel } from "../../sdk/orders/completion-badge.js";
|
|
@@ -29,59 +29,87 @@ const OrderDetailsHeaderContent = defineContentType({
|
|
|
29
29
|
properties: {
|
|
30
30
|
prefix: {
|
|
31
31
|
type: "string",
|
|
32
|
-
title: "Prefix"
|
|
32
|
+
title: "Prefix",
|
|
33
|
+
format: "icu-message",
|
|
34
|
+
messageSource: "Order #"
|
|
33
35
|
},
|
|
34
36
|
copyLabel: {
|
|
35
37
|
type: "string",
|
|
36
|
-
title: "Copy label"
|
|
38
|
+
title: "Copy label",
|
|
39
|
+
format: "icu-message",
|
|
40
|
+
messageSource: "Copy"
|
|
37
41
|
},
|
|
38
42
|
copyAccessibleName: {
|
|
39
43
|
type: "string",
|
|
40
|
-
title: "Copy accessible name"
|
|
44
|
+
title: "Copy accessible name",
|
|
45
|
+
format: "icu-message",
|
|
46
|
+
messageSource: "Copy order number"
|
|
41
47
|
},
|
|
42
48
|
copyCopied: {
|
|
43
49
|
type: "string",
|
|
44
|
-
title: "Copied"
|
|
50
|
+
title: "Copied",
|
|
51
|
+
format: "icu-message",
|
|
52
|
+
messageSource: "Copied"
|
|
45
53
|
},
|
|
46
54
|
copyFailure: {
|
|
47
55
|
type: "string",
|
|
48
|
-
title: "Copy failure"
|
|
56
|
+
title: "Copy failure",
|
|
57
|
+
format: "icu-message",
|
|
58
|
+
messageSource: "Could not copy"
|
|
49
59
|
},
|
|
50
60
|
copyDismiss: {
|
|
51
61
|
type: "string",
|
|
52
|
-
title: "Dismiss copy"
|
|
62
|
+
title: "Dismiss copy",
|
|
63
|
+
format: "icu-message",
|
|
64
|
+
messageSource: "Dismiss"
|
|
53
65
|
},
|
|
54
66
|
statusInProgress: {
|
|
55
67
|
type: "string",
|
|
56
|
-
title: "In progress"
|
|
68
|
+
title: "In progress",
|
|
69
|
+
format: "icu-message",
|
|
70
|
+
messageSource: "In progress"
|
|
57
71
|
},
|
|
58
72
|
statusCancellationRequested: {
|
|
59
73
|
type: "string",
|
|
60
|
-
title: "Cancellation requested"
|
|
74
|
+
title: "Cancellation requested",
|
|
75
|
+
format: "icu-message",
|
|
76
|
+
messageSource: "Cancellation requested"
|
|
61
77
|
},
|
|
62
78
|
statusCancelled: {
|
|
63
79
|
type: "string",
|
|
64
|
-
title: "Cancelled"
|
|
80
|
+
title: "Cancelled",
|
|
81
|
+
format: "icu-message",
|
|
82
|
+
messageSource: "Canceled"
|
|
65
83
|
},
|
|
66
84
|
statusDelivered: {
|
|
67
85
|
type: "string",
|
|
68
|
-
title: "Delivered"
|
|
86
|
+
title: "Delivered",
|
|
87
|
+
format: "icu-message",
|
|
88
|
+
messageSource: "Delivered"
|
|
69
89
|
},
|
|
70
90
|
statusShipped: {
|
|
71
91
|
type: "string",
|
|
72
|
-
title: "Shipped"
|
|
92
|
+
title: "Shipped",
|
|
93
|
+
format: "icu-message",
|
|
94
|
+
messageSource: "Shipped"
|
|
73
95
|
},
|
|
74
96
|
statusReadyForPickup: {
|
|
75
97
|
type: "string",
|
|
76
|
-
title: "Ready for pickup"
|
|
98
|
+
title: "Ready for pickup",
|
|
99
|
+
format: "icu-message",
|
|
100
|
+
messageSource: "Ready for pickup"
|
|
77
101
|
},
|
|
78
102
|
statusCollected: {
|
|
79
103
|
type: "string",
|
|
80
|
-
title: "Collected"
|
|
104
|
+
title: "Collected",
|
|
105
|
+
format: "icu-message",
|
|
106
|
+
messageSource: "Collected"
|
|
81
107
|
},
|
|
82
108
|
statusPlaceholder: {
|
|
83
109
|
type: "string",
|
|
84
|
-
title: "Status unavailable"
|
|
110
|
+
title: "Status unavailable",
|
|
111
|
+
format: "icu-message",
|
|
112
|
+
messageSource: "Status unavailable"
|
|
85
113
|
}
|
|
86
114
|
}
|
|
87
115
|
}
|
|
@@ -98,38 +126,19 @@ const OrderDetailsHeaderDefinition = defineComponent({
|
|
|
98
126
|
label: "Order Details Header",
|
|
99
127
|
category: "content"
|
|
100
128
|
},
|
|
101
|
-
schema: {
|
|
102
|
-
|
|
103
|
-
type: "string",
|
|
104
|
-
default: "Order #",
|
|
105
|
-
label: "Prefix"
|
|
106
|
-
},
|
|
107
|
-
copyLabel: {
|
|
108
|
-
type: "string",
|
|
109
|
-
default: "Copy",
|
|
110
|
-
label: "Copy label"
|
|
111
|
-
},
|
|
112
|
-
copyAccessibleName: {
|
|
113
|
-
type: "string",
|
|
114
|
-
default: "Copy order number",
|
|
115
|
-
label: "Copy accessible name"
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
guideline: "The top of the order details page: the order number as the page h1 beside a prefix, a copy action bound to the number alone, and the shared status badge. Prefix, copy, and status sentences are content; a blank field keeps the catalogue or the schema prop. Place it once, first on the page; it renders nothing when the read returns no order."
|
|
129
|
+
schema: {},
|
|
130
|
+
guideline: "The top of the order details page: the order number as the page h1 beside a prefix, a copy action bound to the number alone, and the shared status badge. Prefix, copy, and status sentences are content. Place it once, first on the page; it renders nothing when the read returns no order."
|
|
119
131
|
});
|
|
120
|
-
function
|
|
121
|
-
return value?.trim() || void 0;
|
|
122
|
-
}
|
|
123
|
-
function statusMessages(content) {
|
|
132
|
+
function statusMessages({ format }) {
|
|
124
133
|
return {
|
|
125
|
-
"in-progress":
|
|
126
|
-
"cancellation-requested":
|
|
127
|
-
cancelled:
|
|
128
|
-
delivered:
|
|
129
|
-
shipped:
|
|
130
|
-
"ready-for-pickup":
|
|
131
|
-
collected:
|
|
132
|
-
placeholder:
|
|
134
|
+
"in-progress": format("statusInProgress"),
|
|
135
|
+
"cancellation-requested": format("statusCancellationRequested"),
|
|
136
|
+
cancelled: format("statusCancelled"),
|
|
137
|
+
delivered: format("statusDelivered"),
|
|
138
|
+
shipped: format("statusShipped"),
|
|
139
|
+
"ready-for-pickup": format("statusReadyForPickup"),
|
|
140
|
+
collected: format("statusCollected"),
|
|
141
|
+
placeholder: format("statusPlaceholder")
|
|
133
142
|
};
|
|
134
143
|
}
|
|
135
144
|
function OrderDetailsHeaderSkeleton({ className, ...props }) {
|
|
@@ -141,12 +150,11 @@ function OrderDetailsHeaderSkeleton({ className, ...props }) {
|
|
|
141
150
|
children: [/* @__PURE__ */ jsx("span", { "data-fs-order-details-header-skeleton-fact": "" }), /* @__PURE__ */ jsx("span", { "data-fs-order-details-header-skeleton-fact": "" })]
|
|
142
151
|
});
|
|
143
152
|
}
|
|
144
|
-
function OrderDetailsHeader({ $data, $content,
|
|
145
|
-
const
|
|
153
|
+
function OrderDetailsHeader({ $data, $content, className, ref }) {
|
|
154
|
+
const messages = useMessageFormatter(OrderDetailsHeaderContent, $content);
|
|
146
155
|
if (!$data) return null;
|
|
147
|
-
const
|
|
148
|
-
const
|
|
149
|
-
const accessibleName = authored($content?.copyAccessibleName) ?? copyAccessibleName ?? intl.formatMessage({ id: "fs/order.number.copy-name" });
|
|
156
|
+
const { format } = messages;
|
|
157
|
+
const prefix = format("prefix");
|
|
150
158
|
const badge = completionBadgeModel($data.completion);
|
|
151
159
|
return /* @__PURE__ */ jsxs("header", {
|
|
152
160
|
ref,
|
|
@@ -155,9 +163,9 @@ function OrderDetailsHeader({ $data, $content, prefix, copyLabel, copyAccessible
|
|
|
155
163
|
children: [
|
|
156
164
|
/* @__PURE__ */ jsxs("h1", {
|
|
157
165
|
"data-fs-order-details-header-heading": "",
|
|
158
|
-
children: [
|
|
166
|
+
children: [prefix ? /* @__PURE__ */ jsx("span", {
|
|
159
167
|
"data-fs-order-details-header-prefix": "",
|
|
160
|
-
children:
|
|
168
|
+
children: prefix
|
|
161
169
|
}) : null, /* @__PURE__ */ jsx("span", {
|
|
162
170
|
"data-fs-order-details-header-number": "",
|
|
163
171
|
children: $data.orderNumber
|
|
@@ -167,18 +175,18 @@ function OrderDetailsHeader({ $data, $content, prefix, copyLabel, copyAccessible
|
|
|
167
175
|
"data-fs-order-details-header-copy": "",
|
|
168
176
|
children: /* @__PURE__ */ jsx(CopyText, {
|
|
169
177
|
text: $data.orderNumber,
|
|
170
|
-
accessibleName,
|
|
171
|
-
successMessage:
|
|
172
|
-
failureMessage:
|
|
173
|
-
dismissLabel:
|
|
174
|
-
children:
|
|
178
|
+
accessibleName: format("copyAccessibleName"),
|
|
179
|
+
successMessage: format("copyCopied"),
|
|
180
|
+
failureMessage: format("copyFailure"),
|
|
181
|
+
dismissLabel: format("copyDismiss"),
|
|
182
|
+
children: format("copyLabel")
|
|
175
183
|
})
|
|
176
184
|
}),
|
|
177
185
|
badge ? /* @__PURE__ */ jsx(OrderStatusBadge, {
|
|
178
186
|
state: badge.state,
|
|
179
187
|
tone: badge.tone,
|
|
180
188
|
label: badge.label,
|
|
181
|
-
messages: statusMessages(
|
|
189
|
+
messages: statusMessages(messages),
|
|
182
190
|
"data-fs-order-details-header-status": ""
|
|
183
191
|
}) : null
|
|
184
192
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-details-header.js","names":[],"sources":["../../../src/matter/order-details-header/order-details-header.tsx"],"sourcesContent":["'use client';\n\nimport { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef, Ref } from 'react';\nimport { CopyText } from '../../particles/copy-text/copy-text.js';\nimport { OrderStatusBadge, type OrderStatusMessages } from '../../particles/order-status-badge/order-status-badge.js';\nimport {
|
|
1
|
+
{"version":3,"file":"order-details-header.js","names":[],"sources":["../../../src/matter/order-details-header/order-details-header.tsx"],"sourcesContent":["'use client';\n\nimport { type ContentValue, defineComponent, defineContentType, type MessageLocaleProp } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef, Ref } from 'react';\nimport { CopyText } from '../../particles/copy-text/copy-text.js';\nimport { OrderStatusBadge, type OrderStatusMessages } from '../../particles/order-status-badge/order-status-badge.js';\nimport type { MessageFormatter } from '../../sdk/i18n/message-formatter.js';\nimport { useMessageFormatter } from '../../sdk/i18n/use-message-formatter.js';\nimport { completionBadgeModel, type OrderCompletionData } from '../../sdk/orders/completion-badge.js';\n\nconst fragment = /* GraphQL */ `\n fragment OrderDetailsHeaderData on Query {\n customerOrder(id: $orderId) {\n orderNumber\n completion {\n view\n label\n }\n }\n }\n`;\n\nexport const OrderDetailsHeaderContent = defineContentType({\n id: 'order-details-header',\n title: 'Order Details Header',\n description: 'The prefix, the copy action, and the status sentences on the order page.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n prefix: { type: 'string', title: 'Prefix', format: 'icu-message', messageSource: 'Order #' },\n copyLabel: { type: 'string', title: 'Copy label', format: 'icu-message', messageSource: 'Copy' },\n copyAccessibleName: {\n type: 'string',\n title: 'Copy accessible name',\n format: 'icu-message',\n messageSource: 'Copy order number',\n },\n copyCopied: { type: 'string', title: 'Copied', format: 'icu-message', messageSource: 'Copied' },\n copyFailure: { type: 'string', title: 'Copy failure', format: 'icu-message', messageSource: 'Could not copy' },\n copyDismiss: { type: 'string', title: 'Dismiss copy', format: 'icu-message', messageSource: 'Dismiss' },\n statusInProgress: { type: 'string', title: 'In progress', format: 'icu-message', messageSource: 'In progress' },\n statusCancellationRequested: {\n type: 'string',\n title: 'Cancellation requested',\n format: 'icu-message',\n messageSource: 'Cancellation requested',\n },\n statusCancelled: { type: 'string', title: 'Cancelled', format: 'icu-message', messageSource: 'Canceled' },\n statusDelivered: { type: 'string', title: 'Delivered', format: 'icu-message', messageSource: 'Delivered' },\n statusShipped: { type: 'string', title: 'Shipped', format: 'icu-message', messageSource: 'Shipped' },\n statusReadyForPickup: {\n type: 'string',\n title: 'Ready for pickup',\n format: 'icu-message',\n messageSource: 'Ready for pickup',\n },\n statusCollected: { type: 'string', title: 'Collected', format: 'icu-message', messageSource: 'Collected' },\n statusPlaceholder: {\n type: 'string',\n title: 'Status unavailable',\n format: 'icu-message',\n messageSource: 'Status unavailable',\n },\n },\n },\n});\n\nexport type OrderDetailsHeaderContentValue = ContentValue<typeof OrderDetailsHeaderContent>;\n\n/**\n * The `customerOrder` root the generator passes as `$data`. A single-root fragment is bound to\n * that field's value, so this is the order itself, or null when the read resolves nothing.\n */\nexport type OrderDetailsHeaderData = {\n orderNumber: string;\n completion: OrderCompletionData;\n} | null;\n\nexport type OrderDetailsHeaderProps = MessageLocaleProp &\n Readonly<{\n $data?: OrderDetailsHeaderData | null;\n $content?: OrderDetailsHeaderContentValue;\n className?: string;\n ref?: Ref<HTMLElement>;\n }>;\n\nexport const OrderDetailsHeaderDefinition = defineComponent<OrderDetailsHeaderProps>({\n name: 'OrderDetailsHeader',\n importPath: '@vtex/faststore/components',\n component: OrderDetailsHeader,\n content: OrderDetailsHeaderContent,\n fragment,\n fetchStrategy: 'static',\n skeleton: OrderDetailsHeaderSkeleton,\n editor: { label: 'Order Details Header', category: 'content' },\n schema: {},\n guideline:\n 'The top of the order details page: the order number as the page h1 beside a prefix, a copy action bound to the number alone, and the shared status badge. Prefix, copy, and status sentences are content. Place it once, first on the page; it renders nothing when the read returns no order.',\n});\n\nfunction statusMessages({ format }: MessageFormatter<typeof OrderDetailsHeaderContent>): OrderStatusMessages {\n return {\n 'in-progress': format('statusInProgress'),\n 'cancellation-requested': format('statusCancellationRequested'),\n cancelled: format('statusCancelled'),\n delivered: format('statusDelivered'),\n shipped: format('statusShipped'),\n 'ready-for-pickup': format('statusReadyForPickup'),\n collected: format('statusCollected'),\n placeholder: format('statusPlaceholder'),\n };\n}\n\nexport function OrderDetailsHeaderSkeleton({ className, ...props }: ComponentPropsWithRef<'div'>) {\n return (\n <div {...props} className={className} data-fs-order-details-header-skeleton=\"\" aria-hidden=\"true\">\n <span data-fs-order-details-header-skeleton-fact=\"\" />\n <span data-fs-order-details-header-skeleton-fact=\"\" />\n </div>\n );\n}\n\nexport function OrderDetailsHeader({ $data, $content, className, ref }: OrderDetailsHeaderProps) {\n const messages = useMessageFormatter(OrderDetailsHeaderContent, $content);\n if (!$data) {\n return null;\n }\n\n const { format } = messages;\n const prefix = format('prefix');\n const badge = completionBadgeModel($data.completion);\n\n return (\n <header ref={ref} className={className} data-fs-order-details-header=\"\">\n <h1 data-fs-order-details-header-heading=\"\">\n {prefix ? <span data-fs-order-details-header-prefix=\"\">{prefix}</span> : null}\n <span data-fs-order-details-header-number=\"\">{$data.orderNumber}</span>\n </h1>\n <div data-fs-order-details-header-copy=\"\">\n <CopyText\n text={$data.orderNumber}\n accessibleName={format('copyAccessibleName')}\n successMessage={format('copyCopied')}\n failureMessage={format('copyFailure')}\n dismissLabel={format('copyDismiss')}\n >\n {format('copyLabel')}\n </CopyText>\n </div>\n {badge ? (\n <OrderStatusBadge\n state={badge.state}\n tone={badge.tone}\n label={badge.label}\n messages={statusMessages(messages)}\n data-fs-order-details-header-status=\"\"\n />\n ) : null}\n </header>\n );\n}\n"],"mappings":";;;;;;;;;;AAUA,MAAM,WAAyB;;;;;;;;;;;AAY/B,MAAa,4BAA4B,kBAAkB;CACzD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY;GACV,QAAQ;IAAE,MAAM;IAAU,OAAO;IAAU,QAAQ;IAAe,eAAe;GAAU;GAC3F,WAAW;IAAE,MAAM;IAAU,OAAO;IAAc,QAAQ;IAAe,eAAe;GAAO;GAC/F,oBAAoB;IAClB,MAAM;IACN,OAAO;IACP,QAAQ;IACR,eAAe;GACjB;GACA,YAAY;IAAE,MAAM;IAAU,OAAO;IAAU,QAAQ;IAAe,eAAe;GAAS;GAC9F,aAAa;IAAE,MAAM;IAAU,OAAO;IAAgB,QAAQ;IAAe,eAAe;GAAiB;GAC7G,aAAa;IAAE,MAAM;IAAU,OAAO;IAAgB,QAAQ;IAAe,eAAe;GAAU;GACtG,kBAAkB;IAAE,MAAM;IAAU,OAAO;IAAe,QAAQ;IAAe,eAAe;GAAc;GAC9G,6BAA6B;IAC3B,MAAM;IACN,OAAO;IACP,QAAQ;IACR,eAAe;GACjB;GACA,iBAAiB;IAAE,MAAM;IAAU,OAAO;IAAa,QAAQ;IAAe,eAAe;GAAW;GACxG,iBAAiB;IAAE,MAAM;IAAU,OAAO;IAAa,QAAQ;IAAe,eAAe;GAAY;GACzG,eAAe;IAAE,MAAM;IAAU,OAAO;IAAW,QAAQ;IAAe,eAAe;GAAU;GACnG,sBAAsB;IACpB,MAAM;IACN,OAAO;IACP,QAAQ;IACR,eAAe;GACjB;GACA,iBAAiB;IAAE,MAAM;IAAU,OAAO;IAAa,QAAQ;IAAe,eAAe;GAAY;GACzG,mBAAmB;IACjB,MAAM;IACN,OAAO;IACP,QAAQ;IACR,eAAe;GACjB;EACF;CACF;AACF,CAAC;AAqBD,MAAa,+BAA+B,gBAAyC;CACnF,MAAM;CACN,YAAY;CACZ,WAAW;CACX,SAAS;CACT;CACA,eAAe;CACf,UAAU;CACV,QAAQ;EAAE,OAAO;EAAwB,UAAU;CAAU;CAC7D,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,SAAS,eAAe,EAAE,UAAmF;CAC3G,OAAO;EACL,eAAe,OAAO,kBAAkB;EACxC,0BAA0B,OAAO,6BAA6B;EAC9D,WAAW,OAAO,iBAAiB;EACnC,WAAW,OAAO,iBAAiB;EACnC,SAAS,OAAO,eAAe;EAC/B,oBAAoB,OAAO,sBAAsB;EACjD,WAAW,OAAO,iBAAiB;EACnC,aAAa,OAAO,mBAAmB;CACzC;AACF;AAEA,SAAgB,2BAA2B,EAAE,WAAW,GAAG,SAAuC;CAChG,OACE,qBAAC,OAAD;EAAK,GAAI;EAAkB;EAAW,yCAAsC;EAAG,eAAY;EAA3F,UAAA,CACE,oBAAC,QAAD,EAAM,8CAA2C,GAAI,CAAA,GACrD,oBAAC,QAAD,EAAM,8CAA2C,GAAI,CAAA,CAClD;;AAET;AAEA,SAAgB,mBAAmB,EAAE,OAAO,UAAU,WAAW,OAAgC;CAC/F,MAAM,WAAW,oBAAoB,2BAA2B,QAAQ;CACxE,IAAI,CAAC,OACH,OAAO;CAGT,MAAM,EAAE,WAAW;CACnB,MAAM,SAAS,OAAO,QAAQ;CAC9B,MAAM,QAAQ,qBAAqB,MAAM,UAAU;CAEnD,OACE,qBAAC,UAAD;EAAa;EAAgB;EAAW,gCAA6B;EAArE,UAAA;GACE,qBAAC,MAAD;IAAI,wCAAqC;IAAzC,UAAA,CACG,SAAS,oBAAC,QAAD;KAAM,uCAAoC;KAAI,UAAA;IAAa,CAAA,IAAI,MACzE,oBAAC,QAAD;KAAM,uCAAoC;KAAI,UAAA,MAAM;IAAkB,CAAA,CACpE;;GACJ,oBAAC,OAAD;IAAK,qCAAkC;IACrC,UAAA,oBAAC,UAAD;KACE,MAAM,MAAM;KACZ,gBAAgB,OAAO,oBAAoB;KAC3C,gBAAgB,OAAO,YAAY;KACnC,gBAAgB,OAAO,aAAa;KACpC,cAAc,OAAO,aAAa;KAEjC,UAAA,OAAO,WAAW;IACX,CAAA;GACP,CAAA;GACJ,QACC,oBAAC,kBAAD;IACE,OAAO,MAAM;IACb,MAAM,MAAM;IACZ,OAAO,MAAM;IACb,UAAU,eAAe,QAAQ;IACjC,uCAAoC;GACrC,CAAA,IACC;EACE;;AAEZ"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ContentValue, MessageLocaleProp } from "../../core/dist/define-content-type.js";
|
|
2
|
+
import { ComponentDefinition } from "../../core/dist/define-component.js";
|
|
3
|
+
import "../../core/dist/index.js";
|
|
4
|
+
import { ComponentPropsWithRef, Ref } from "react";
|
|
5
|
+
//#region src/matter/order-invoice-download/order-invoice-download.d.ts
|
|
6
|
+
export declare const OrderInvoiceDownloadContent: {
|
|
7
|
+
readonly id: "order-invoice-download";
|
|
8
|
+
readonly title: "Order Invoice Download";
|
|
9
|
+
readonly description: "The download control and each invoice entry on the order page.";
|
|
10
|
+
readonly schema: {
|
|
11
|
+
readonly type: "object";
|
|
12
|
+
readonly additionalProperties: false;
|
|
13
|
+
readonly properties: {
|
|
14
|
+
readonly downloadLabel: {
|
|
15
|
+
readonly type: "string";
|
|
16
|
+
readonly title: "Download label";
|
|
17
|
+
readonly format: "icu-message";
|
|
18
|
+
readonly messageSource: "Download invoice";
|
|
19
|
+
};
|
|
20
|
+
readonly entryLabel: {
|
|
21
|
+
readonly type: "string";
|
|
22
|
+
readonly title: "Entry label";
|
|
23
|
+
readonly format: "icu-message";
|
|
24
|
+
readonly messageSource: "Invoice {n} of {total}";
|
|
25
|
+
readonly messageArguments: {
|
|
26
|
+
readonly type: "object";
|
|
27
|
+
readonly properties: {
|
|
28
|
+
readonly n: {
|
|
29
|
+
readonly type: "integer";
|
|
30
|
+
};
|
|
31
|
+
readonly total: {
|
|
32
|
+
readonly type: "integer";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
readonly messageExample: {
|
|
37
|
+
readonly n: 1;
|
|
38
|
+
readonly total: 2;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
readonly description: {
|
|
42
|
+
readonly type: "string";
|
|
43
|
+
readonly title: "Description";
|
|
44
|
+
readonly format: "icu-message";
|
|
45
|
+
readonly messageSource: "This order was invoiced in parts. Choose the invoice to download.";
|
|
46
|
+
};
|
|
47
|
+
readonly closeLabel: {
|
|
48
|
+
readonly type: "string";
|
|
49
|
+
readonly title: "Close label";
|
|
50
|
+
readonly format: "icu-message";
|
|
51
|
+
readonly messageSource: "Close";
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
export type OrderInvoiceDownloadContentValue = ContentValue<typeof OrderInvoiceDownloadContent>;
|
|
57
|
+
export type OrderInvoiceDownloadInvoice = {
|
|
58
|
+
url: string;
|
|
59
|
+
issuedAt: string | null;
|
|
60
|
+
kind: 'SALE' | 'RETURN';
|
|
61
|
+
};
|
|
62
|
+
export type OrderInvoiceDownloadData = {
|
|
63
|
+
progress: {
|
|
64
|
+
cancelled: boolean;
|
|
65
|
+
};
|
|
66
|
+
invoices: OrderInvoiceDownloadInvoice[];
|
|
67
|
+
} | null;
|
|
68
|
+
export type OrderInvoiceDownloadProps = MessageLocaleProp & Readonly<{
|
|
69
|
+
$data?: OrderInvoiceDownloadData | null;
|
|
70
|
+
$content?: OrderInvoiceDownloadContentValue;
|
|
71
|
+
className?: string;
|
|
72
|
+
ref?: Ref<HTMLDivElement>;
|
|
73
|
+
}>;
|
|
74
|
+
export declare const OrderInvoiceDownloadDefinition: ComponentDefinition<OrderInvoiceDownloadProps>;
|
|
75
|
+
export declare function OrderInvoiceDownloadSkeleton({ className, ...props }: ComponentPropsWithRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
76
|
+
export declare function OrderInvoiceDownload({ $data, $content, className, ref }: OrderInvoiceDownloadProps): import("react/jsx-runtime").JSX.Element | null;
|
|
77
|
+
//#endregion
|
|
78
|
+
//# sourceMappingURL=order-invoice-download.d.ts.map
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { defineComponent } from "../../core/dist/define-component.js";
|
|
3
|
+
import { defineContentType } from "../../core/dist/define-content-type.js";
|
|
4
|
+
import "../../core/dist/index.js";
|
|
5
|
+
import { resolveNavigableHref } from "../../utils/safe-href.js";
|
|
6
|
+
import { useMessageFormatter } from "../../sdk/i18n/use-message-formatter.js";
|
|
7
|
+
import { DialogBackdrop, DialogClose, DialogDescription, DialogPopup, DialogPortal, DialogRoot, DialogTitle, DialogTrigger, DialogViewport } from "../../particles/dialog/dialog.js";
|
|
8
|
+
import { useRef } from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
//#region src/matter/order-invoice-download/order-invoice-download.tsx
|
|
11
|
+
const fragment = `
|
|
12
|
+
fragment OrderInvoiceDownloadData on Query {
|
|
13
|
+
customerOrder(id: $orderId) {
|
|
14
|
+
progress {
|
|
15
|
+
cancelled
|
|
16
|
+
}
|
|
17
|
+
invoices {
|
|
18
|
+
url
|
|
19
|
+
issuedAt
|
|
20
|
+
kind
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
const OrderInvoiceDownloadContent = defineContentType({
|
|
26
|
+
id: "order-invoice-download",
|
|
27
|
+
title: "Order Invoice Download",
|
|
28
|
+
description: "The download control and each invoice entry on the order page.",
|
|
29
|
+
schema: {
|
|
30
|
+
type: "object",
|
|
31
|
+
additionalProperties: false,
|
|
32
|
+
properties: {
|
|
33
|
+
downloadLabel: {
|
|
34
|
+
type: "string",
|
|
35
|
+
title: "Download label",
|
|
36
|
+
format: "icu-message",
|
|
37
|
+
messageSource: "Download invoice"
|
|
38
|
+
},
|
|
39
|
+
entryLabel: {
|
|
40
|
+
type: "string",
|
|
41
|
+
title: "Entry label",
|
|
42
|
+
format: "icu-message",
|
|
43
|
+
messageSource: "Invoice {n} of {total}",
|
|
44
|
+
messageArguments: {
|
|
45
|
+
type: "object",
|
|
46
|
+
properties: {
|
|
47
|
+
n: { type: "integer" },
|
|
48
|
+
total: { type: "integer" }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
messageExample: {
|
|
52
|
+
n: 1,
|
|
53
|
+
total: 2
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
description: {
|
|
57
|
+
type: "string",
|
|
58
|
+
title: "Description",
|
|
59
|
+
format: "icu-message",
|
|
60
|
+
messageSource: "This order was invoiced in parts. Choose the invoice to download."
|
|
61
|
+
},
|
|
62
|
+
closeLabel: {
|
|
63
|
+
type: "string",
|
|
64
|
+
title: "Close label",
|
|
65
|
+
format: "icu-message",
|
|
66
|
+
messageSource: "Close"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
const OrderInvoiceDownloadDefinition = defineComponent({
|
|
72
|
+
name: "OrderInvoiceDownload",
|
|
73
|
+
importPath: "@vtex/faststore/components",
|
|
74
|
+
component: OrderInvoiceDownload,
|
|
75
|
+
content: OrderInvoiceDownloadContent,
|
|
76
|
+
fragment,
|
|
77
|
+
fetchStrategy: "static",
|
|
78
|
+
skeleton: OrderInvoiceDownloadSkeleton,
|
|
79
|
+
editor: {
|
|
80
|
+
label: "Order Invoice Download",
|
|
81
|
+
category: "action"
|
|
82
|
+
},
|
|
83
|
+
schema: {},
|
|
84
|
+
guideline: "Offers every invoice file the order read kept. One file navigates to the merchant address. Several open a dialog that stays open after a choice. Renders nothing when the order is cancelled or no file remains. Labels are content messages. It does not choose its place on the page."
|
|
85
|
+
});
|
|
86
|
+
function openAddress(url) {
|
|
87
|
+
globalThis.location.assign(url);
|
|
88
|
+
}
|
|
89
|
+
function OrderInvoiceDownloadSkeleton({ className, ...props }) {
|
|
90
|
+
return /* @__PURE__ */ jsx("div", {
|
|
91
|
+
...props,
|
|
92
|
+
className,
|
|
93
|
+
"data-fs-order-invoice-download-skeleton": "",
|
|
94
|
+
"aria-hidden": "true"
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function OrderInvoiceDownload({ $data, $content, className, ref }) {
|
|
98
|
+
const portalRoot = useRef(null);
|
|
99
|
+
const messages = useMessageFormatter(OrderInvoiceDownloadContent, $content);
|
|
100
|
+
function setRoot(node) {
|
|
101
|
+
portalRoot.current = node;
|
|
102
|
+
if (typeof ref === "function") {
|
|
103
|
+
ref(node);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (ref) ref.current = node;
|
|
107
|
+
}
|
|
108
|
+
if (!$data || $data.progress.cancelled || $data.invoices.length === 0) return null;
|
|
109
|
+
const downloadLabel = messages.format("downloadLabel");
|
|
110
|
+
const description = messages.format("description");
|
|
111
|
+
const closeLabel = messages.format("closeLabel");
|
|
112
|
+
const invoices = $data.invoices.flatMap((invoice) => {
|
|
113
|
+
const destination = resolveNavigableHref(invoice.url);
|
|
114
|
+
return destination.safe ? [{
|
|
115
|
+
...invoice,
|
|
116
|
+
url: destination.href
|
|
117
|
+
}] : [];
|
|
118
|
+
});
|
|
119
|
+
if (invoices.length === 0) return null;
|
|
120
|
+
const [only] = invoices;
|
|
121
|
+
if (invoices.length === 1 && only) return /* @__PURE__ */ jsx("div", {
|
|
122
|
+
ref,
|
|
123
|
+
className,
|
|
124
|
+
"data-fs-order-invoice-download": "",
|
|
125
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
126
|
+
type: "button",
|
|
127
|
+
"data-fs-order-invoice-download-control": "",
|
|
128
|
+
onClick: () => openAddress(only.url),
|
|
129
|
+
children: downloadLabel
|
|
130
|
+
})
|
|
131
|
+
});
|
|
132
|
+
return /* @__PURE__ */ jsx("div", {
|
|
133
|
+
ref: setRoot,
|
|
134
|
+
className,
|
|
135
|
+
"data-fs-order-invoice-download": "",
|
|
136
|
+
children: /* @__PURE__ */ jsxs(DialogRoot, { children: [/* @__PURE__ */ jsx(DialogTrigger, {
|
|
137
|
+
"data-fs-order-invoice-download-control": "",
|
|
138
|
+
children: downloadLabel
|
|
139
|
+
}), /* @__PURE__ */ jsxs(DialogPortal, {
|
|
140
|
+
container: portalRoot,
|
|
141
|
+
children: [/* @__PURE__ */ jsx(DialogBackdrop, {}), /* @__PURE__ */ jsx(DialogViewport, { children: /* @__PURE__ */ jsxs(DialogPopup, { children: [
|
|
142
|
+
/* @__PURE__ */ jsxs("div", {
|
|
143
|
+
"data-fs-order-invoice-download-header": "",
|
|
144
|
+
children: [/* @__PURE__ */ jsx(DialogTitle, { children: downloadLabel }), /* @__PURE__ */ jsx(DialogClose, {
|
|
145
|
+
"aria-label": closeLabel,
|
|
146
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
147
|
+
"data-fs-order-invoice-download-dismiss": "",
|
|
148
|
+
"aria-hidden": "true",
|
|
149
|
+
children: "×"
|
|
150
|
+
})
|
|
151
|
+
})]
|
|
152
|
+
}),
|
|
153
|
+
/* @__PURE__ */ jsx(DialogDescription, { children: description }),
|
|
154
|
+
/* @__PURE__ */ jsx("ul", {
|
|
155
|
+
"data-fs-order-invoice-download-list": "",
|
|
156
|
+
children: invoices.map((invoice, index) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("button", {
|
|
157
|
+
type: "button",
|
|
158
|
+
"data-fs-order-invoice-download-entry": "",
|
|
159
|
+
onClick: () => openAddress(invoice.url),
|
|
160
|
+
children: messages.format("entryLabel", {
|
|
161
|
+
n: index + 1,
|
|
162
|
+
total: invoices.length
|
|
163
|
+
})
|
|
164
|
+
}) }, `${invoice.url}:${index}`))
|
|
165
|
+
})
|
|
166
|
+
] }) })]
|
|
167
|
+
})] })
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
//#endregion
|
|
171
|
+
export { OrderInvoiceDownload, OrderInvoiceDownloadContent, OrderInvoiceDownloadDefinition, OrderInvoiceDownloadSkeleton };
|
|
172
|
+
|
|
173
|
+
//# sourceMappingURL=order-invoice-download.js.map
|