@vtex/faststore 0.0.6 → 0.0.8
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 +99 -0
- package/dist/actions.json +152 -1
- package/dist/catalog.json +2541 -1278
- package/dist/cli/UnreachableCaseError-Crd168Vu.js +10 -0
- package/dist/cli/UnreachableCaseError-Crd168Vu.js.map +1 -0
- package/dist/cli/cacheControl-CEojH_TM.js +158 -0
- package/dist/cli/cacheControl-CEojH_TM.js.map +1 -0
- package/dist/cli/cachePolicy-m2vASMRW.js +26 -0
- package/dist/cli/cachePolicy-m2vASMRW.js.map +1 -0
- package/dist/cli/computeCoreSchemaHash-DPJZj-qJ.js +10 -0
- package/dist/cli/computeCoreSchemaHash-DPJZj-qJ.js.map +1 -0
- package/dist/cli/default-BCQHcwbL.js +253 -0
- package/dist/cli/default-BCQHcwbL.js.map +1 -0
- package/dist/cli/disableSuggestions-yO9UqiWn.js +21 -0
- package/dist/cli/disableSuggestions-yO9UqiWn.js.map +1 -0
- package/dist/cli/dist-C1JhdHfo.js +2001 -0
- package/dist/cli/dist-C1JhdHfo.js.map +1 -0
- package/dist/cli/graphql-DG9thCDG.js +14589 -0
- package/dist/cli/graphql-DG9thCDG.js.map +1 -0
- package/dist/cli/index.d.ts +799 -0
- package/dist/cli/index.js +36459 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/index.min-BsIHDfFK.js +613 -0
- package/dist/cli/index.min-BsIHDfFK.js.map +1 -0
- package/dist/cli/inlineTrace-uLgOJ3TH.js +52 -0
- package/dist/cli/inlineTrace-uLgOJ3TH.js.map +1 -0
- package/dist/cli/internalPlugin-DnuwN4_4.js +11 -0
- package/dist/cli/internalPlugin-DnuwN4_4.js.map +1 -0
- package/dist/cli/packageVersion-DQAnIEil.js +6 -0
- package/dist/cli/packageVersion-DQAnIEil.js.map +1 -0
- package/dist/cli/rolldown-runtime-BMI-E3GI.js +44 -0
- package/dist/cli/schemaIsSubgraph-DoGh3OYj.js +17 -0
- package/dist/cli/schemaIsSubgraph-DoGh3OYj.js.map +1 -0
- package/dist/cli/schemaReporting-K-me-3-v.js +199 -0
- package/dist/cli/schemaReporting-K-me-3-v.js.map +1 -0
- package/dist/cli/server-runtime.js +49879 -0
- package/dist/cli/server-runtime.js.map +1 -0
- package/dist/cli/traceTreeBuilder-BIcV2U7b.js +9118 -0
- package/dist/cli/traceTreeBuilder-BIcV2U7b.js.map +1 -0
- package/dist/cli/usageReporting-Bpl8vSZX.js +10201 -0
- package/dist/cli/usageReporting-Bpl8vSZX.js.map +1 -0
- package/dist/cli/v4-CBhFvC49.js +42 -0
- package/dist/cli/v4-CBhFvC49.js.map +1 -0
- package/dist/client.d.ts +5 -1
- package/dist/client.js +5 -1
- package/dist/components.d.ts +38 -9
- package/dist/components.js +42 -13
- package/dist/content-types.json +616 -0
- package/dist/core/dist/define-component.d.ts +43 -1
- package/dist/core/dist/index.d.ts +2 -2
- package/dist/docs/account-access-gate.md +4 -4
- package/dist/docs/account-address-book.md +519 -0
- package/dist/docs/account-entry-point.md +1 -1
- package/dist/docs/account-menu-identity.md +160 -0
- package/dist/docs/account-menu.md +107 -24
- package/dist/docs/alert-dialog.md +2 -2
- package/dist/docs/avatar.md +103 -0
- package/dist/docs/billing-address.md +17 -9
- package/dist/docs/card-entry.md +37 -6
- package/dist/docs/cardholder-document.md +16 -14
- package/dist/docs/cart-item.md +1 -1
- package/dist/docs/cart.md +8 -8
- package/dist/docs/client-profile-fieldset.md +7 -5
- package/dist/docs/copy-text.md +84 -0
- package/dist/docs/document-field.md +8 -8
- package/dist/docs/footer-link-group.md +2 -2
- package/dist/docs/header-root.md +1 -1
- package/dist/docs/incentives.md +2 -2
- package/dist/docs/logo.md +5 -5
- package/dist/docs/my-account-profile.md +5 -5
- package/dist/docs/navigation-link-list.md +2 -2
- package/dist/docs/navigation-link.md +3 -3
- package/dist/docs/order-cancel.md +52 -0
- package/dist/docs/order-delivery-address.md +63 -0
- package/dist/docs/order-delivery-group.md +83 -0
- package/dist/docs/order-details-back.md +41 -0
- package/dist/docs/order-details-header.md +48 -0
- package/dist/docs/order-list-row.md +46 -0
- package/dist/docs/order-list-search.md +101 -0
- package/dist/docs/order-list-views.md +97 -0
- package/dist/docs/order-list.md +94 -0
- package/dist/docs/order-payment.md +94 -0
- package/dist/docs/order-placed-date.md +49 -0
- package/dist/docs/order-placed-payment-summary.md +13 -15
- package/dist/docs/order-placed.md +225 -0
- package/dist/docs/order-progress.md +88 -0
- package/dist/docs/order-status-badge.md +91 -0
- package/dist/docs/order-summary.md +53 -0
- package/dist/docs/payment-method-badges.md +14 -3
- package/dist/docs/place-order.md +13 -9
- package/dist/docs/product-shelf.md +20 -13
- package/dist/docs/saved-cards.md +2 -2
- package/dist/docs/select.md +19 -6
- package/dist/docs/session.md +1 -1
- package/dist/docs/shipping-address.md +1 -1
- package/dist/docs/sign-in-redirect.md +6 -6
- package/dist/docs/toast.md +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +2 -1
- package/dist/internal/client.d.ts +6 -1
- package/dist/internal/client.js +8 -3
- package/dist/internal/content.d.ts +2 -2
- package/dist/internal/server.d.ts +8 -1
- package/dist/internal/server.js +8 -1
- package/dist/matter/account-access-gate/account-access-gate.d.ts +2 -1
- package/dist/matter/account-access-gate/account-access-gate.js +19 -16
- package/dist/matter/account-access-gate/account-access-gate.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-delete.d.ts +60 -0
- package/dist/matter/account-address-book/account-address-book-delete.js +184 -0
- package/dist/matter/account-address-book/account-address-book-delete.js.map +1 -0
- package/dist/matter/account-address-book/account-address-book-deliverability.d.ts +19 -0
- package/dist/matter/account-address-book/account-address-book-deliverability.js +50 -0
- package/dist/matter/account-address-book/account-address-book-deliverability.js.map +1 -0
- package/dist/matter/account-address-book/account-address-book-form-parts.d.ts +42 -0
- package/dist/matter/account-address-book/account-address-book-form-parts.js +146 -0
- package/dist/matter/account-address-book/account-address-book-form-parts.js.map +1 -0
- package/dist/matter/account-address-book/account-address-book-profile-notice.d.ts +25 -0
- package/dist/matter/account-address-book/account-address-book-profile-notice.js +72 -0
- package/dist/matter/account-address-book/account-address-book-profile-notice.js.map +1 -0
- package/dist/matter/account-address-book/account-address-book.d.ts +120 -0
- package/dist/matter/account-address-book/account-address-book.js +469 -0
- package/dist/matter/account-address-book/account-address-book.js.map +1 -0
- package/dist/matter/account-address-book/account-address-country-switch.js +59 -0
- package/dist/matter/account-address-book/account-address-country-switch.js.map +1 -0
- package/dist/matter/account-address-book/account-address-country.d.ts +36 -0
- package/dist/matter/account-address-book/account-address-country.js +151 -0
- package/dist/matter/account-address-book/account-address-country.js.map +1 -0
- package/dist/matter/account-address-book/account-address-first-line.js +11 -0
- package/dist/matter/account-address-book/account-address-first-line.js.map +1 -0
- package/dist/matter/account-address-book/account-address-form-context.d.ts +55 -0
- package/dist/matter/account-address-book/account-address-form-context.js +14 -0
- package/dist/matter/account-address-book/account-address-form-context.js.map +1 -0
- package/dist/matter/account-address-book/account-address-form.d.ts +85 -0
- package/dist/matter/account-address-book/account-address-form.js +946 -0
- package/dist/matter/account-address-book/account-address-form.js.map +1 -0
- package/dist/matter/account-address-book/account-address-postal-autofill.js +189 -0
- package/dist/matter/account-address-book/account-address-postal-autofill.js.map +1 -0
- package/dist/matter/account-address-book/account-address-record.d.ts +26 -0
- package/dist/matter/account-address-book/account-address-record.js +138 -0
- package/dist/matter/account-address-book/account-address-record.js.map +1 -0
- package/dist/matter/account-entry-point/account-entry-point.js +11 -11
- package/dist/matter/account-entry-point/account-entry-point.js.map +1 -1
- package/dist/matter/account-menu/account-menu.d.ts +77 -3
- package/dist/matter/account-menu/account-menu.js +252 -19
- package/dist/matter/account-menu/account-menu.js.map +1 -1
- package/dist/matter/account-menu/sign-out-failure.js +50 -0
- package/dist/matter/account-menu/sign-out-failure.js.map +1 -0
- package/dist/matter/account-menu-identity/account-menu-identity.d.ts +21 -0
- package/dist/matter/account-menu-identity/account-menu-identity.js +88 -0
- package/dist/matter/account-menu-identity/account-menu-identity.js.map +1 -0
- package/dist/matter/billing-address/billing-address.d.ts +30 -17
- package/dist/matter/billing-address/billing-address.js +128 -33
- package/dist/matter/billing-address/billing-address.js.map +1 -1
- package/dist/matter/breadcrumb/breadcrumb.js +2 -2
- package/dist/matter/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/matter/card-entry/card-capture.js +4 -3
- package/dist/matter/card-entry/card-capture.js.map +1 -1
- package/dist/matter/card-entry/card-entry.d.ts +5 -3
- package/dist/matter/card-entry/card-entry.js +78 -27
- package/dist/matter/card-entry/card-entry.js.map +1 -1
- package/dist/matter/cardholder-document/cardholder-document.d.ts +10 -9
- package/dist/matter/cardholder-document/cardholder-document.js +36 -16
- package/dist/matter/cardholder-document/cardholder-document.js.map +1 -1
- package/dist/matter/cart/cart.d.ts +7 -2
- package/dist/matter/cart/cart.js +29 -26
- package/dist/matter/cart/cart.js.map +1 -1
- package/dist/matter/cart-item/cart-item.js +2 -2
- package/dist/matter/cart-item/cart-item.js.map +1 -1
- package/dist/matter/client-preferences/client-preferences-fieldset.js +2 -2
- package/dist/matter/client-profile-form/client-profile-fieldset.js +9 -6
- package/dist/matter/client-profile-form/client-profile-fieldset.js.map +1 -1
- package/dist/matter/identity-edit/identity-edit.js +3 -3
- package/dist/matter/identity-edit/identity-edit.js.map +1 -1
- package/dist/matter/identity-summary/identity-summary.js +4 -3
- package/dist/matter/identity-summary/identity-summary.js.map +1 -1
- package/dist/matter/my-account-profile/my-account-profile.d.ts +6 -3
- package/dist/matter/my-account-profile/my-account-profile.js +6 -5
- package/dist/matter/my-account-profile/my-account-profile.js.map +1 -1
- package/dist/matter/order-cancel/order-cancel.d.ts +110 -0
- package/dist/matter/order-cancel/order-cancel.js +344 -0
- package/dist/matter/order-cancel/order-cancel.js.map +1 -0
- package/dist/matter/order-delivery-address/order-delivery-address.d.ts +73 -0
- package/dist/matter/order-delivery-address/order-delivery-address.js +172 -0
- package/dist/matter/order-delivery-address/order-delivery-address.js.map +1 -0
- package/dist/matter/order-delivery-group/order-delivery-group.d.ts +128 -0
- package/dist/matter/order-delivery-group/order-delivery-group.js +408 -0
- package/dist/matter/order-delivery-group/order-delivery-group.js.map +1 -0
- package/dist/matter/order-details-header/order-details-header.d.ts +104 -0
- package/dist/matter/order-details-header/order-details-header.js +190 -0
- package/dist/matter/order-details-header/order-details-header.js.map +1 -0
- package/dist/matter/order-list/customer-orders-filter.d.ts +12 -0
- package/dist/matter/order-list/customer-orders-filter.js +30 -0
- package/dist/matter/order-list/customer-orders-filter.js.map +1 -0
- package/dist/matter/order-list/order-list.d.ts +121 -0
- package/dist/matter/order-list/order-list.js +395 -0
- package/dist/matter/order-list/order-list.js.map +1 -0
- package/dist/matter/order-list-row/order-list-row.d.ts +44 -0
- package/dist/matter/order-list-row/order-list-row.js +127 -0
- package/dist/matter/order-list-row/order-list-row.js.map +1 -0
- package/dist/matter/order-list-search/order-list-search.d.ts +72 -0
- package/dist/matter/order-list-search/order-list-search.js +296 -0
- package/dist/matter/order-list-search/order-list-search.js.map +1 -0
- package/dist/matter/order-list-views/order-list-views.d.ts +65 -0
- package/dist/matter/order-list-views/order-list-views.js +154 -0
- package/dist/matter/order-list-views/order-list-views.js.map +1 -0
- package/dist/matter/order-payment/order-payment.d.ts +83 -0
- package/dist/matter/order-payment/order-payment.js +258 -0
- package/dist/matter/order-payment/order-payment.js.map +1 -0
- package/dist/matter/order-placed/order-placed-deliveries.d.ts +145 -0
- package/dist/matter/order-placed/order-placed-deliveries.js +380 -0
- package/dist/matter/order-placed/order-placed-deliveries.js.map +1 -0
- package/dist/matter/order-placed/order-placed.d.ts +122 -0
- package/dist/matter/order-placed/order-placed.js +452 -0
- package/dist/matter/order-placed/order-placed.js.map +1 -0
- package/dist/matter/order-placed-date/order-placed-date.d.ts +45 -0
- package/dist/matter/order-placed-date/order-placed-date.js +92 -0
- package/dist/matter/order-placed-date/order-placed-date.js.map +1 -0
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.d.ts +5 -8
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js +29 -81
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js.map +1 -1
- package/dist/matter/order-progress/order-progress.d.ts +85 -0
- package/dist/matter/order-progress/order-progress.js +203 -0
- package/dist/matter/order-progress/order-progress.js.map +1 -0
- package/dist/matter/order-summary/order-summary.d.ts +81 -0
- package/dist/matter/order-summary/order-summary.js +192 -0
- package/dist/matter/order-summary/order-summary.js.map +1 -0
- package/dist/matter/payment/cardholder-document-rule.d.ts +35 -0
- package/dist/matter/payment/cardholder-document-rule.js +35 -0
- package/dist/matter/payment/cardholder-document-rule.js.map +1 -0
- package/dist/matter/payment/payment-card-capture.js +38 -23
- package/dist/matter/payment/payment-card-capture.js.map +1 -1
- package/dist/matter/payment/payment-controller.js +12 -0
- package/dist/matter/payment/payment-controller.js.map +1 -1
- package/dist/matter/payment/payment-method-badges.js +4 -2
- package/dist/matter/payment/payment-method-badges.js.map +1 -1
- package/dist/matter/payment/payment.js +12 -0
- package/dist/matter/payment/payment.js.map +1 -1
- package/dist/matter/payment/use-payment-method-selection.d.ts +39 -0
- package/dist/matter/payment/use-payment-method-selection.js +30 -2
- package/dist/matter/payment/use-payment-method-selection.js.map +1 -1
- package/dist/matter/payment/use-payment-submit-gate.d.ts +16 -2
- package/dist/matter/payment/use-payment-submit-gate.js +42 -14
- package/dist/matter/payment/use-payment-submit-gate.js.map +1 -1
- package/dist/matter/place-order/place-order.d.ts +12 -7
- package/dist/matter/place-order/place-order.js +126 -103
- package/dist/matter/place-order/place-order.js.map +1 -1
- package/dist/matter/pricing/pricing.js +5 -5
- package/dist/matter/pricing/pricing.js.map +1 -1
- package/dist/matter/product-shelf/product-shelf.d.ts +61 -31
- package/dist/matter/product-shelf/product-shelf.js +157 -57
- package/dist/matter/product-shelf/product-shelf.js.map +1 -1
- package/dist/matter/region/region.js +1 -1
- package/dist/matter/saved-cards/saved-cards.js +27 -15
- package/dist/matter/saved-cards/saved-cards.js.map +1 -1
- package/dist/matter/session/session.js +2 -2
- package/dist/matter/session/session.js.map +1 -1
- package/dist/matter/shipping-address/country-descriptors.d.ts +1 -0
- package/dist/matter/shipping-address/country-descriptors.js +23 -1
- package/dist/matter/shipping-address/country-descriptors.js.map +1 -1
- package/dist/matter/shipping-address/shipping-address.js +63 -15
- package/dist/matter/shipping-address/shipping-address.js.map +1 -1
- package/dist/matter/shipping-simulator/shipping-simulator.d.ts +1 -1
- package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
- package/dist/matter/sign-in-redirect/sign-in-redirect.js +48 -10
- package/dist/matter/sign-in-redirect/sign-in-redirect.js.map +1 -1
- package/dist/matter/variant-selector/variant-selector.js +2 -2
- package/dist/matter/variant-selector/variant-selector.js.map +1 -1
- package/dist/particles/address-summary/address-summary.js +2 -2
- package/dist/particles/address-summary/address-summary.js.map +1 -1
- package/dist/particles/alert-dialog/alert-dialog.d.ts +5 -1
- package/dist/particles/alert-dialog/alert-dialog.js +5 -2
- package/dist/particles/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/particles/avatar/avatar.d.ts +17 -0
- package/dist/particles/avatar/avatar.js +65 -0
- package/dist/particles/avatar/avatar.js.map +1 -0
- package/dist/particles/copy-text/copy-text.d.ts +28 -0
- package/dist/particles/copy-text/copy-text.js +140 -0
- package/dist/particles/copy-text/copy-text.js.map +1 -0
- package/dist/particles/document-field/document-field.d.ts +34 -5
- package/dist/particles/document-field/document-field.js +115 -19
- package/dist/particles/document-field/document-field.js.map +1 -1
- package/dist/particles/field/field.js +1 -1
- package/dist/particles/field/field.js.map +1 -1
- package/dist/particles/footer-link-group/footer-link-group.d.ts +6 -2
- package/dist/particles/footer-link-group/footer-link-group.js +18 -7
- package/dist/particles/footer-link-group/footer-link-group.js.map +1 -1
- package/dist/particles/incentives/incentives.d.ts +6 -2
- package/dist/particles/incentives/incentives.js +7 -2
- package/dist/particles/incentives/incentives.js.map +1 -1
- package/dist/particles/logo/logo.d.ts +3 -2
- package/dist/particles/logo/logo.js +20 -8
- package/dist/particles/logo/logo.js.map +1 -1
- package/dist/particles/navigation-link/navigation-link.d.ts +2 -3
- package/dist/particles/navigation-link/navigation-link.js +4 -4
- package/dist/particles/navigation-link/navigation-link.js.map +1 -1
- package/dist/particles/navigation-link-list/navigation-link-list.d.ts +6 -2
- package/dist/particles/navigation-link-list/navigation-link-list.js +18 -7
- package/dist/particles/navigation-link-list/navigation-link-list.js.map +1 -1
- package/dist/particles/order-details-back/order-details-back.d.ts +28 -0
- package/dist/particles/order-details-back/order-details-back.js +52 -0
- package/dist/particles/order-details-back/order-details-back.js.map +1 -0
- package/dist/particles/order-status-badge/order-status-badge.d.ts +19 -0
- package/dist/particles/order-status-badge/order-status-badge.js +50 -0
- package/dist/particles/order-status-badge/order-status-badge.js.map +1 -0
- package/dist/particles/phone-field/phone-field.js +2 -2
- package/dist/particles/phone-field/phone-field.js.map +1 -1
- package/dist/particles/select/select.js +6 -6
- package/dist/particles/select/select.js.map +1 -1
- package/dist/particles/toast/toast.d.ts +1 -1
- package/dist/particles/toast/toast.js +32 -6
- package/dist/particles/toast/toast.js.map +1 -1
- package/dist/schema.graphql +1079 -54
- package/dist/sdk/actions/address-action-provider.d.ts +16 -0
- package/dist/sdk/actions/address-action-provider.js +20 -0
- package/dist/sdk/actions/address-action-provider.js.map +1 -0
- package/dist/sdk/actions/analytics-action-provider.js +1 -1
- package/dist/sdk/actions/index.d.ts +3 -1
- package/dist/sdk/actions/index.js +3 -1
- package/dist/sdk/actions/order-action-provider.d.ts +12 -0
- package/dist/sdk/actions/order-action-provider.js +16 -0
- package/dist/sdk/actions/order-action-provider.js.map +1 -0
- package/dist/sdk/actions/types.d.ts +6 -2
- package/dist/sdk/address/address-fields.js +38 -0
- package/dist/sdk/address/address-fields.js.map +1 -0
- package/dist/sdk/address/checkout-readiness.js +17 -0
- package/dist/sdk/address/checkout-readiness.js.map +1 -0
- package/dist/sdk/address/constants.js +60 -0
- package/dist/sdk/address/constants.js.map +1 -0
- package/dist/sdk/address/country-display.js +19 -0
- package/dist/sdk/address/country-display.js.map +1 -0
- package/dist/sdk/address/country-rules.js +30 -0
- package/dist/sdk/address/country-rules.js.map +1 -0
- package/dist/sdk/address/format-address.js +18 -0
- package/dist/sdk/address/format-address.js.map +1 -0
- package/dist/sdk/address/iso-countries.js +262 -0
- package/dist/sdk/address/iso-countries.js.map +1 -0
- package/dist/sdk/address/layouts.js +56 -0
- package/dist/sdk/address/layouts.js.map +1 -0
- package/dist/sdk/address/messages.js +97 -0
- package/dist/sdk/address/messages.js.map +1 -0
- package/dist/sdk/address/operations.d.ts +54 -0
- package/dist/sdk/address/operations.js +83 -0
- package/dist/sdk/address/operations.js.map +1 -0
- package/dist/sdk/address/postal-code-lookup-operations.js +23 -0
- package/dist/sdk/address/postal-code-lookup-operations.js.map +1 -0
- package/dist/sdk/address/postal-code.js +11 -0
- package/dist/sdk/address/postal-code.js.map +1 -0
- package/dist/sdk/address/schema.js +14 -0
- package/dist/sdk/address/schema.js.map +1 -0
- package/dist/sdk/address/server-fields.js +25 -0
- package/dist/sdk/address/server-fields.js.map +1 -0
- package/dist/sdk/address/switch-country.js +57 -0
- package/dist/sdk/address/switch-country.js.map +1 -0
- package/dist/sdk/address/types.d.ts +26 -0
- package/dist/sdk/address/use-address-actions.d.ts +29 -0
- package/dist/sdk/address/use-address-actions.js +247 -0
- package/dist/sdk/address/use-address-actions.js.map +1 -0
- package/dist/sdk/address/use-address-by-postal-code.js +57 -0
- package/dist/sdk/address/use-address-by-postal-code.js.map +1 -0
- package/dist/sdk/address/validate-address.js +62 -0
- package/dist/sdk/address/validate-address.js.map +1 -0
- package/dist/sdk/analytics/use-analytics-actions.js +2 -1
- package/dist/sdk/analytics/use-analytics-actions.js.map +1 -1
- package/dist/sdk/cache/storefront-cache.js +29 -4
- package/dist/sdk/cache/storefront-cache.js.map +1 -1
- package/dist/sdk/cart/use-cart-actions.js +9 -8
- package/dist/sdk/cart/use-cart-actions.js.map +1 -1
- package/dist/sdk/cart/use-cart-validate-on-open.js +2 -1
- package/dist/sdk/cart/use-cart-validate-on-open.js.map +1 -1
- package/dist/sdk/client/fetch-page-data.d.ts +11 -0
- package/dist/sdk/client/fetch-page-data.js +12 -1
- package/dist/sdk/client/fetch-page-data.js.map +1 -1
- package/dist/sdk/content/create-content-runtime.d.ts +22 -1
- package/dist/sdk/content/create-content-runtime.js +90 -9
- package/dist/sdk/content/create-content-runtime.js.map +1 -1
- package/dist/sdk/data/empty-content-value.js +16 -0
- package/dist/sdk/data/empty-content-value.js.map +1 -0
- package/dist/sdk/data/failed-fields.js +23 -0
- package/dist/sdk/data/failed-fields.js.map +1 -0
- package/dist/sdk/data/hot-data-provider.js +2 -1
- package/dist/sdk/data/hot-data-provider.js.map +1 -1
- package/dist/sdk/data/index.js +1 -1
- package/dist/sdk/data/page-reactive-data-root.d.ts +45 -7
- package/dist/sdk/data/page-reactive-data-root.js +88 -12
- package/dist/sdk/data/page-reactive-data-root.js.map +1 -1
- package/dist/sdk/data/variables-from-content.d.ts +43 -0
- package/dist/sdk/data/variables-from-content.js +57 -0
- package/dist/sdk/data/variables-from-content.js.map +1 -0
- package/dist/sdk/generated/fragment-types.js +2 -0
- package/dist/sdk/generated/fragment-types.js.map +1 -1
- package/dist/sdk/generated/gql.js +4 -1
- package/dist/sdk/generated/gql.js.map +1 -1
- package/dist/sdk/generated/graphql.d.ts +8 -0
- package/dist/sdk/generated/graphql.js +296 -1
- package/dist/sdk/generated/graphql.js.map +1 -1
- package/dist/sdk/i18n/messages/en-US.js +138 -1
- package/dist/sdk/i18n/messages/en-US.json +138 -1
- package/dist/sdk/i18n/messages/en-US.json.d.ts +137 -0
- package/dist/sdk/i18n/messages/es-ES.js +138 -1
- package/dist/sdk/i18n/messages/es-ES.json +138 -1
- package/dist/sdk/i18n/messages/pt-BR.js +138 -1
- package/dist/sdk/i18n/messages/pt-BR.json +138 -1
- package/dist/sdk/identity/use-identity-actions.js +5 -4
- package/dist/sdk/identity/use-identity-actions.js.map +1 -1
- package/dist/sdk/navigation/current-page.js +30 -0
- package/dist/sdk/navigation/current-page.js.map +1 -0
- package/dist/sdk/navigation/not-found-log.d.ts +28 -0
- package/dist/sdk/navigation/not-found-log.js +133 -0
- package/dist/sdk/navigation/not-found-log.js.map +1 -0
- package/dist/sdk/navigation/path.js +25 -0
- package/dist/sdk/navigation/path.js.map +1 -0
- package/dist/sdk/navigation/redirect.d.ts +11 -0
- package/dist/sdk/navigation/redirect.js +22 -0
- package/dist/sdk/navigation/redirect.js.map +1 -0
- package/dist/sdk/navigation/report.js +70 -0
- package/dist/sdk/navigation/report.js.map +1 -0
- package/dist/sdk/navigation/resolve-storefront-href.d.ts +12 -0
- package/dist/sdk/navigation/resolve-storefront-href.js +214 -0
- package/dist/sdk/navigation/resolve-storefront-href.js.map +1 -0
- package/dist/sdk/navigation/route-identity-provider.d.ts +11 -0
- package/dist/sdk/navigation/route-identity-provider.js +20 -0
- package/dist/sdk/navigation/route-identity-provider.js.map +1 -0
- package/dist/sdk/navigation/route-map-provider.d.ts +19 -0
- package/dist/sdk/navigation/route-map-provider.js +29 -0
- package/dist/sdk/navigation/route-map-provider.js.map +1 -0
- package/dist/sdk/navigation/storefront-link.d.ts +16 -0
- package/dist/sdk/navigation/storefront-link.js +66 -0
- package/dist/sdk/navigation/storefront-link.js.map +1 -0
- package/dist/sdk/navigation/types.d.ts +45 -0
- package/dist/sdk/navigation/use-storefront-navigation.d.ts +26 -0
- package/dist/sdk/navigation/use-storefront-navigation.js +73 -0
- package/dist/sdk/navigation/use-storefront-navigation.js.map +1 -0
- package/dist/sdk/navigation/use-storefront-route.d.ts +26 -0
- package/dist/sdk/navigation/use-storefront-route.js +87 -0
- package/dist/sdk/navigation/use-storefront-route.js.map +1 -0
- package/dist/sdk/navigation/use-storefront-search-params.d.ts +11 -0
- package/dist/sdk/navigation/use-storefront-search-params.js +16 -0
- package/dist/sdk/navigation/use-storefront-search-params.js.map +1 -0
- package/dist/sdk/orders/completion-badge.d.ts +8 -0
- package/dist/sdk/orders/completion-badge.js +47 -0
- package/dist/sdk/orders/completion-badge.js.map +1 -0
- package/dist/sdk/orders/order-operations.d.ts +19 -0
- package/dist/sdk/orders/order-operations.js +21 -0
- package/dist/sdk/orders/order-operations.js.map +1 -0
- package/dist/sdk/orders/use-order-actions.d.ts +23 -0
- package/dist/sdk/orders/use-order-actions.js +62 -0
- package/dist/sdk/orders/use-order-actions.js.map +1 -0
- package/dist/sdk/payment/gateway-origin.js +26 -13
- package/dist/sdk/payment/gateway-origin.js.map +1 -1
- package/dist/sdk/payment/gateway.d.ts +14 -2
- package/dist/sdk/payment/gateway.js +32 -14
- package/dist/sdk/payment/gateway.js.map +1 -1
- package/dist/sdk/payment/operations.js +11 -0
- package/dist/sdk/payment/operations.js.map +1 -1
- package/dist/sdk/payment/submission-registry.d.ts +2 -1
- package/dist/sdk/payment/submission-registry.js +12 -8
- package/dist/sdk/payment/submission-registry.js.map +1 -1
- package/dist/sdk/payment/use-payment-actions.d.ts +5 -3
- package/dist/sdk/payment/use-payment-actions.js +6 -3
- package/dist/sdk/payment/use-payment-actions.js.map +1 -1
- package/dist/sdk/payment/use-place-order.d.ts +6 -3
- package/dist/sdk/payment/use-place-order.js +334 -144
- package/dist/sdk/payment/use-place-order.js.map +1 -1
- package/dist/sdk/region/use-region-actions.js +2 -1
- package/dist/sdk/region/use-region-actions.js.map +1 -1
- package/dist/sdk/seo/page-alternates.d.ts +55 -0
- package/dist/sdk/seo/page-alternates.js +132 -0
- package/dist/sdk/seo/page-alternates.js.map +1 -0
- package/dist/sdk/session/read-server-session.d.ts +21 -0
- package/dist/sdk/session/read-server-session.js +61 -0
- package/dist/sdk/session/read-server-session.js.map +1 -0
- package/dist/sdk/session/use-session-actions.js +5 -4
- package/dist/sdk/session/use-session-actions.js.map +1 -1
- package/dist/sdk/session/use-session-revalidation.js +2 -1
- package/dist/sdk/session/use-session-revalidation.js.map +1 -1
- package/dist/sdk/shipping/use-shipping-actions.js +3 -2
- package/dist/sdk/shipping/use-shipping-actions.js.map +1 -1
- package/dist/utils/own-value.js +19 -0
- package/dist/utils/own-value.js.map +1 -0
- package/dist/utils/safe-href.d.ts +11 -0
- package/dist/utils/safe-href.js +31 -22
- package/dist/utils/safe-href.js.map +1 -1
- package/package.json +17 -2
- package/skills/storefront-asset/SKILL.md +111 -0
- package/skills/storefront-asset/references/api-side.md +153 -0
- package/skills/storefront-asset/references/findings.md +40 -0
- package/skills/storefront-asset/references/ui-side.md +94 -0
- package/src/styles/tailwind.css +27 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cardholder-document.js","names":[],"sources":["../../../src/matter/cardholder-document/cardholder-document.tsx"],"sourcesContent":["'use client';\n\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef, Ref } from 'react';\nimport { DocumentField } from '../../particles/document-field/document-field.js';\nimport { usePayment } from '../payment/payment.js';\nimport { isCardholderDocumentShown } from '../payment/use-payment-submit-gate.js';\n\n/**\n * The cardholder-document field (specs/cardholder-document.md, T8 of the Credit Card epic;\n * docs/features/credit-card/rfc.md § D3). Renders the existing `particles/document-field`\n * `DocumentField` for CPF, gated on the *selected* payment method's validator: presence follows\n * `documentDisplayable`, requiredness follows `documentRequired` — two distinct, non-null flags\n * (T1's read model; `use-payment-method-selection.ts`'s `PaymentSectionValidator`), read off\n * `usePayment().selectedMethod` (`selectedMethodId` resolved against the scoped `methods` list,\n * carrying the full validator — specs/payment-section-root.md's contract table names T8 as the\n * consumer of exactly these two flags on that field).\n *\n * Declares no fragment of its own: T5's merged `PaymentSectionData` fragment\n * (`matter/payment/payment.tsx`) already selects both flags, so this leaf reads them off context\n * instead of re-selecting them. The shipped precedent for a context-only, fragment-less payment\n * leaf is `SavedCardCvvField` (`matter/saved-cards/saved-cards.tsx`), deliberately absent from\n * `data-component-contract.test.ts`'s fragment-registration list for the same reason.\n *\n * The collected value is not sensitive — the RFC's \"The card-data submission channel\" section\n * names the cardholder document alongside the save-card flag/label as travelling on the ordinary\n * `draft`, never the submission registry — and is published via `setDraftDocument` on every\n * change, mirroring `CardEntry`'s own `setDraftBin` idiom (`card-entry.tsx`): no validation, no\n * dispatch, just keep the shared fact current. T7's `CardEntry` (merged) already folds\n * `draft.document` into its gateway card object, so this component's only job is keeping that\n * value current; it never itself calls `sendPayments` or registers a submission continuation.\n *\n * CPF-only by design, not by omission — see this task's own spec, § \"Multi-country deferral\", for\n * why the read model cannot yet select a document type or a country, and what widening a future\n * task would need to do about it.\n */\n\n// ---------------------------------------------------------------------------\n// Props\n// ---------------------------------------------------------------------------\n\nexport type CardholderDocumentProps = Omit<\n ComponentPropsWithRef<'div'>,\n 'defaultValue' | 'value' | 'onChange' | 'onBlur' | 'ref'\n> & {\n label?: string;\n placeholder?: string;\n errorMessage?: string;\n /** Disables the input without hiding it — distinct from the data-driven presence gate below. */\n disabled?: boolean;\n /** Forwarded to `DocumentField`, which lands it on the `<input>`, not on the wrapper `<div>`. */\n ref?: Ref<HTMLInputElement>;\n};\n\n// ---------------------------------------------------------------------------\n// Definition\n// ---------------------------------------------------------------------------\n\nexport const CardholderDocumentDefinition = defineComponent<CardholderDocumentProps>({\n name: 'CardholderDocument',\n importPath: '@vtex/faststore/components',\n component: CardholderDocument,\n requiresContext: 'payment',\n editor: { label: 'Cardholder Document', category: 'commerce' },\n schema: {\n label: { type: 'string', default: 'CPF', label: 'Label' },\n placeholder: { type: 'string', default: '000.000.000-00', label: 'Placeholder' },\n errorMessage: { type: 'string', default: 'Invalid CPF', label: 'Error message' },\n disabled: { type: 'boolean', default: false, label: 'Disabled' },\n },\n guideline:\n \"Cardholder tax-document field for the currently selected payment method (CPF only in this build): renders only when that method's validator marks a document displayable, and marks the input required when the validator marks the document required — the particle, not this leaf, decides whether a typed value is well-formed. Place as a sibling of CardEntry and SavedCards inside a PaymentSectionRoot or PaymentSectionController; renders nothing before a method is selected or when the selected method has no document to collect. The collected value is a plain draft fact — never a schema prop, a fragment field, or an action payload — and is unrelated to the shopper's saved profile document, which this component never reads. See cardholder-document.md.\",\n});\n\n// ---------------------------------------------------------------------------\n// Implementation\n// ---------------------------------------------------------------------------\n\nexport function CardholderDocument({\n label = 'CPF',\n placeholder = '000.000.000-00',\n errorMessage = 'Invalid CPF',\n disabled = false,\n className,\n ...props\n}: CardholderDocumentProps) {\n const { selectedMethod, draft, setDraftDocument, placing, cardPaymentCollapsed } = usePayment();\n const validator = selectedMethod?.validator;\n const documentRequired = validator?.documentRequired ?? false;\n\n // Presence follows `documentDisplayable` alone (specs/payment-section-root.md's contract table),\n // never the entry path: the validator is resolved off the selected *method*, not off\n // `draft.path`, matching the merged T5 spec verbatim. See this task's own spec, § \"Decisions\",\n // for the measured, deliberately-not-fixed interaction this has with a saved-card selection.\n // T191 (FR-7, Decision 3): nothing renders while the card payment is collapsed either, whatever the\n // selected method's own validator says. The field re-seeds from `draft.document` when it comes back.\n // T192 (Decision 3): `isCardholderDocumentShown` is that condition, defined once — the submit gate\n // reads the same function, so it never asks for a document this field is not showing.\n if (!isCardholderDocumentShown({ cardPaymentCollapsed, selectedMethod })) return null;\n\n return (\n <DocumentField\n {...props}\n className={className}\n // T28: `Field.Root` (Base UI) forwards unknown native props onto its rendered element\n // (`document-field.tsx`'s own `{...props}` spread), so `inert`/`aria-disabled` land on the same\n // element `data-fs-cardholder-document` is on — there is no separate root of this component's own.\n inert={placing}\n aria-disabled={placing || undefined}\n documentType=\"CPF\"\n requirement={documentRequired ? 'mandatory' : 'optional'}\n // Re-seeds from the shared draft on every mount, so a shopper's already-typed value survives\n // this leaf unmounting and remounting (e.g. `documentDisplayable` flips off then on again as\n // network detection re-resolves mid-typing) instead of starting blank again. Uncontrolled —\n // `DocumentField` owns masking and blur validation from here; this component never re-applies\n // its own mask (Decision \"Uncontrolled composition, not a second masking implementation\").\n defaultValue={draft.document ?? ''}\n label={label}\n placeholder={placeholder}\n errorMessage={errorMessage}\n disabled={disabled}\n onValueChange={(value) => setDraftDocument(value || null)}\n data-fs-cardholder-document=\"\"\n {...(documentRequired ? { 'data-fs-cardholder-document-required': '' } : {})}\n {...(placing ? { 'data-fs-cardholder-document-placing': '' } : {})}\n />\n );\n}\n"],"mappings":";;;;;;;;AA0DA,MAAa,+BAA+B,gBAAyC;CACnF,MAAM;CACN,YAAY;CACZ,WAAW;CACX,iBAAiB;CACjB,QAAQ;EAAE,OAAO;EAAuB,UAAU;CAAW;CAC7D,QAAQ;EACN,OAAO;GAAE,MAAM;GAAU,SAAS;GAAO,OAAO;EAAQ;EACxD,aAAa;GAAE,MAAM;GAAU,SAAS;GAAkB,OAAO;EAAc;EAC/E,cAAc;GAAE,MAAM;GAAU,SAAS;GAAe,OAAO;EAAgB;EAC/E,UAAU;GAAE,MAAM;GAAW,SAAS;GAAO,OAAO;EAAW;CACjE;CACA,WACE;AACJ,CAAC;AAMD,SAAgB,mBAAmB,EACjC,QAAQ,OACR,cAAc,kBACd,eAAe,eACf,WAAW,OACX,WACA,GAAG,SACuB;CAC1B,MAAM,EAAE,gBAAgB,OAAO,kBAAkB,SAAS,yBAAyB,WAAW;CAE9F,MAAM,oBADY,gBAAgB,UAAA,EACE,oBAAoB;CAUxD,IAAI,CAAC,0BAA0B;EAAE;EAAsB;CAAe,CAAC,GAAG,OAAO;CAEjF,OACE,oBAAC,eAAD;EACE,GAAI;EACO;EAIX,OAAO;EACP,iBAAe,WAAW,KAAA;EAC1B,cAAa;EACb,aAAa,mBAAmB,cAAc;EAM9C,cAAc,MAAM,YAAY;EACzB;EACM;EACC;EACJ;EACV,gBAAgB,UAAU,iBAAiB,SAAS,IAAI;EACxD,+BAA4B;EAC5B,GAAK,mBAAmB,EAAE,wCAAwC,GAAG,IAAI,CAAC;EAC1E,GAAK,UAAU,EAAE,uCAAuC,GAAG,IAAI,CAAC;CACjE,CAAA;AAEL"}
|
|
1
|
+
{"version":3,"file":"cardholder-document.js","names":[],"sources":["../../../src/matter/cardholder-document/cardholder-document.tsx"],"sourcesContent":["'use client';\n\nimport { defineComponent } from '@vtex/fs-core';\nimport { type ComponentPropsWithRef, type Ref, useEffect, useRef } from 'react';\nimport { DOCUMENTS, DocumentField } from '../../particles/document-field/document-field.js';\nimport { useComposedRef } from '../../particles/shared/compose-refs.js';\nimport { resolveCardholderDocument } from '../payment/cardholder-document-rule.js';\nimport { usePayment } from '../payment/payment.js';\nimport { isCardholderDocumentShown } from '../payment/use-payment-submit-gate.js';\n\n/**\n * The cardholder-document field (specs/cardholder-document.md, T8 of the Credit Card epic;\n * docs/features/credit-card/rfc.md § D3). Renders the existing `particles/document-field`\n * `DocumentField` for the document the store's country asks for (T42: `USA` SSN, `BRA` CPF, `CAN` SIN,\n * `MEX` RFC — `usePayment().countryDocumentType`), gated on the *selected* payment method's validator:\n * presence follows `documentDisplayable`, requiredness follows `documentRequired` — two distinct,\n * non-null flags (T1's read model; `use-payment-method-selection.ts`'s `PaymentSectionValidator`), read\n * off `usePayment().selectedMethod` (`selectedMethodId` resolved against the scoped `methods` list,\n * carrying the full validator — specs/payment-section-root.md's contract table names T8 as the\n * consumer of exactly these two flags on that field). `resolveCardholderDocument` combines the two\n * halves; the submit gate and the card capture read the same function.\n *\n * Declares no fragment of its own: T5's merged `PaymentSectionData` fragment\n * (`matter/payment/payment.tsx`) already selects both flags, so this leaf reads them off context\n * instead of re-selecting them. The shipped precedent for a context-only, fragment-less payment\n * leaf is `SavedCardCvvField` (`matter/saved-cards/saved-cards.tsx`), deliberately absent from\n * `data-component-contract.test.ts`'s fragment-registration list for the same reason.\n *\n * The collected value is not sensitive — the RFC's \"The card-data submission channel\" section\n * names the cardholder document alongside the save-card flag/label as travelling on the ordinary\n * `draft`, never the submission registry — and is published via `setDraftDocument` on every\n * change, mirroring `CardEntry`'s own `setDraftBin` idiom (`card-entry.tsx`): no validation, no\n * dispatch, just keep the shared fact current. T7's `CardEntry` (merged) already folds\n * `draft.document` into its gateway card object, so this component's only job is keeping that\n * value current; it never itself calls `sendPayments` or registers a submission continuation.\n *\n * A store whose country resolves to no document type shows no field, refuses nothing and sends no\n * document (T42, Decision 7).\n */\n\n// ---------------------------------------------------------------------------\n// Props\n// ---------------------------------------------------------------------------\n\nexport type CardholderDocumentProps = Omit<\n ComponentPropsWithRef<'div'>,\n 'defaultValue' | 'value' | 'onChange' | 'onBlur' | 'ref'\n> & {\n label?: string;\n placeholder?: string;\n errorMessage?: string;\n /** Disables the input without hiding it — distinct from the data-driven presence gate below. */\n disabled?: boolean;\n /** Forwarded to `DocumentField`, which lands it on the `<input>`, not on the wrapper `<div>`. */\n ref?: Ref<HTMLInputElement>;\n};\n\n// ---------------------------------------------------------------------------\n// Definition\n// ---------------------------------------------------------------------------\n\nexport const CardholderDocumentDefinition = defineComponent<CardholderDocumentProps>({\n name: 'CardholderDocument',\n importPath: '@vtex/faststore/components',\n component: CardholderDocument,\n requiresContext: 'payment',\n editor: { label: 'Cardholder Document', category: 'commerce' },\n schema: {\n label: { type: 'string', label: 'Label' },\n placeholder: { type: 'string', label: 'Placeholder' },\n errorMessage: { type: 'string', label: 'Error message' },\n disabled: { type: 'boolean', default: false, label: 'Disabled' },\n },\n guideline:\n \"Cardholder tax-document field for the currently selected payment method: the store's country picks the document (SSN for the United States, CPF for Brazil, SIN for Canada, RFC for Mexico) with its own label, mask and validation, so leave label, placeholder and errorMessage unset unless the store serves one country. Renders only when that method's validator marks a document displayable and the country has a document type, and marks the input required when the validator marks the document required — the particle, not this leaf, decides whether a typed value is well-formed. Place as a sibling of CardEntry and SavedCards inside a PaymentSectionRoot or PaymentSectionController; renders nothing before a method is selected or when the selected method has no document to collect. The collected value is a plain draft fact — never a schema prop, a fragment field, or an action payload — and is unrelated to the shopper's saved profile document, which this component never reads. See cardholder-document.md.\",\n});\n\n// ---------------------------------------------------------------------------\n// Implementation\n// ---------------------------------------------------------------------------\n\nexport function CardholderDocument({\n label,\n placeholder,\n errorMessage,\n disabled = false,\n className,\n ref,\n ...props\n}: CardholderDocumentProps) {\n const {\n selectedMethod,\n countryDocumentType,\n draft,\n setDraftDocument,\n placing,\n cardPaymentCollapsed,\n registerRefusalFocus,\n } = usePayment();\n const inputRef = useRef<HTMLInputElement>(null);\n const composedRef = useComposedRef(ref, inputRef);\n // T42: the method decides whether to ask and whether the answer is mandatory, the country decides which\n // document. `null` — no method, a method that asks for nothing, or a country with no document type — is\n // no field at all.\n const documentRule = resolveCardholderDocument({ method: selectedMethod, countryDocumentType });\n const documentRequired = documentRule?.required ?? false;\n\n // Presence follows `documentDisplayable` alone (specs/payment-section-root.md's contract table),\n // never the entry path: the validator is resolved off the selected *method*, not off\n // `draft.path`, matching the merged T5 spec verbatim. See this task's own spec, § \"Decisions\",\n // for the measured, deliberately-not-fixed interaction this has with a saved-card selection.\n // T191 (FR-7, Decision 3): nothing renders while the card payment is collapsed either, whatever the\n // selected method's own validator says. The field re-seeds from `draft.document` when it comes back.\n // T192 (Decision 3): `isCardholderDocumentShown` is that condition, defined once — the submit gate\n // reads the same function, so it never asks for a document this field is not showing.\n const shown = isCardholderDocumentShown({ cardPaymentCollapsed, selectedMethod, countryDocumentType });\n\n // T212: while this field is on screen and can take focus, a refusal naming it may move focus here. The\n // function reads the live element at call time, so registering costs nothing per render, and it reports\n // whether focus really landed so the registry can fall through to another leaf.\n const canTakeFocus = shown && !disabled;\n useEffect(() => {\n if (!canTakeFocus) return;\n return registerRefusalFocus('cardholder-field', () => {\n const input = inputRef.current;\n if (!input) return false;\n input.focus();\n return input.ownerDocument.activeElement === input;\n });\n }, [canTakeFocus, registerRefusalFocus]);\n\n if (!shown || !documentRule) return null;\n const spec = DOCUMENTS[documentRule.type];\n\n return (\n <DocumentField\n // Keyed by type, so a type change remounts the particle and the mask of one type never meets the\n // value of another.\n key={documentRule.type}\n {...props}\n ref={composedRef}\n className={className}\n // T28: `Field.Root` (Base UI) forwards unknown native props onto its rendered element\n // (`document-field.tsx`'s own `{...props}` spread), so `inert`/`aria-disabled` land on the same\n // element `data-fs-cardholder-document` is on — there is no separate root of this component's own.\n inert={placing}\n aria-disabled={placing || undefined}\n documentType={documentRule.type}\n requirement={documentRequired ? 'mandatory' : 'optional'}\n // Re-seeds from the shared draft on every mount, so a shopper's already-typed value survives\n // this leaf unmounting and remounting (e.g. `documentDisplayable` flips off then on again as\n // network detection re-resolves mid-typing) instead of starting blank again. Uncontrolled —\n // `DocumentField` owns masking and blur validation from here; this component never re-applies\n // its own mask (Decision \"Uncontrolled composition, not a second masking implementation\").\n defaultValue={draft.document ?? ''}\n label={label ?? spec.name}\n placeholder={placeholder ?? spec.placeholder}\n errorMessage={errorMessage ?? `Invalid ${spec.name}`}\n disabled={disabled}\n onValueChange={(value) => setDraftDocument(value || null)}\n data-fs-cardholder-document=\"\"\n {...(documentRequired ? { 'data-fs-cardholder-document-required': '' } : {})}\n {...(placing ? { 'data-fs-cardholder-document-placing': '' } : {})}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;AA6DA,MAAa,+BAA+B,gBAAyC;CACnF,MAAM;CACN,YAAY;CACZ,WAAW;CACX,iBAAiB;CACjB,QAAQ;EAAE,OAAO;EAAuB,UAAU;CAAW;CAC7D,QAAQ;EACN,OAAO;GAAE,MAAM;GAAU,OAAO;EAAQ;EACxC,aAAa;GAAE,MAAM;GAAU,OAAO;EAAc;EACpD,cAAc;GAAE,MAAM;GAAU,OAAO;EAAgB;EACvD,UAAU;GAAE,MAAM;GAAW,SAAS;GAAO,OAAO;EAAW;CACjE;CACA,WACE;AACJ,CAAC;AAMD,SAAgB,mBAAmB,EACjC,OACA,aACA,cACA,WAAW,OACX,WACA,KACA,GAAG,SACuB;CAC1B,MAAM,EACJ,gBACA,qBACA,OACA,kBACA,SACA,sBACA,yBACE,WAAW;CACf,MAAM,WAAW,OAAyB,IAAI;CAC9C,MAAM,cAAc,eAAe,KAAK,QAAQ;CAIhD,MAAM,eAAe,0BAA0B;EAAE,QAAQ;EAAgB;CAAoB,CAAC;CAC9F,MAAM,mBAAmB,cAAc,YAAY;CAUnD,MAAM,QAAQ,0BAA0B;EAAE;EAAsB;EAAgB;CAAoB,CAAC;CAKrG,MAAM,eAAe,SAAS,CAAC;CAC/B,gBAAgB;EACd,IAAI,CAAC,cAAc;EACnB,OAAO,qBAAqB,0BAA0B;GACpD,MAAM,QAAQ,SAAS;GACvB,IAAI,CAAC,OAAO,OAAO;GACnB,MAAM,MAAM;GACZ,OAAO,MAAM,cAAc,kBAAkB;EAC/C,CAAC;CACH,GAAG,CAAC,cAAc,oBAAoB,CAAC;CAEvC,IAAI,CAAC,SAAS,CAAC,cAAc,OAAO;CACpC,MAAM,OAAO,UAAU,aAAa;CAEpC,OACE,oBAAC,eAAD;EAIE,GAAI;EACJ,KAAK;EACM;EAIX,OAAO;EACP,iBAAe,WAAW,KAAA;EAC1B,cAAc,aAAa;EAC3B,aAAa,mBAAmB,cAAc;EAM9C,cAAc,MAAM,YAAY;EAChC,OAAO,SAAS,KAAK;EACrB,aAAa,eAAe,KAAK;EACjC,cAAc,gBAAgB,WAAW,KAAK;EACpC;EACV,gBAAgB,UAAU,iBAAiB,SAAS,IAAI;EACxD,+BAA4B;EAC5B,GAAK,mBAAmB,EAAE,wCAAwC,GAAG,IAAI,CAAC;EAC1E,GAAK,UAAU,EAAE,uCAAuC,GAAG,IAAI,CAAC;CACjE,GAzBM,aAAa,IAyBnB;AAEL"}
|
|
@@ -2,6 +2,7 @@ import { ContentValue } 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 "../../sdk/generated/graphql.js";
|
|
5
|
+
import { PageRef } from "../../sdk/navigation/types.js";
|
|
5
6
|
import { CartEntity } from "../../sdk/cart/operations.js";
|
|
6
7
|
import { ComponentActions } from "../../sdk/actions/types.js";
|
|
7
8
|
import { NavigationLinkProps } from "../../particles/navigation-link/navigation-link.js";
|
|
@@ -71,7 +72,7 @@ export type CartCountProps = ComponentPropsWithRef<'span'> & {
|
|
|
71
72
|
};
|
|
72
73
|
export type CartErrorProps = ComponentPropsWithRef<'div'>;
|
|
73
74
|
export type CartGoCheckoutProps = Omit<NavigationLinkProps, 'href' | '$content'> & {
|
|
74
|
-
href?: string;
|
|
75
|
+
href?: PageRef | string;
|
|
75
76
|
/** Authored fallback for the button label; `children` still works for stores that label it there. */
|
|
76
77
|
label?: string;
|
|
77
78
|
/** Merchant-authored label, sliced from the page/layout content entry; wins over the label prop and
|
|
@@ -139,7 +140,7 @@ export type CartOpenOnAddProps = {
|
|
|
139
140
|
$actions?: ComponentActions;
|
|
140
141
|
};
|
|
141
142
|
export type CartRedirectOnAddProps = {
|
|
142
|
-
href?: string;
|
|
143
|
+
href?: PageRef | string;
|
|
143
144
|
children?: ReactNode;
|
|
144
145
|
};
|
|
145
146
|
export declare const CartDataContext: React.Context<CartDataContextValue>;
|
|
@@ -198,6 +199,10 @@ export declare function CartOpenOnAdd({ children, $actions: $actionsProp }: Cart
|
|
|
198
199
|
* redirect is post-resolve and success-gated. The initial `0` is ignored, so a fresh mount never
|
|
199
200
|
* navigates. Context-free — no `CartRoot` ancestor (ADR-0010). Renders its passthrough children (or
|
|
200
201
|
* nothing); it carries no drawer.
|
|
202
|
+
*
|
|
203
|
+
* The effect keys on the serialized `href`, not on its identity: a reference authored in a schema
|
|
204
|
+
* arrives as a new object on every server render, and keying on it would push to checkout again on a
|
|
205
|
+
* `router.refresh()` long after the add.
|
|
201
206
|
*/
|
|
202
207
|
export declare function CartRedirectOnAdd({ href, children }: CartRedirectOnAddProps): ReactNode;
|
|
203
208
|
export declare function CartLoading({ className, children, ...props }: CartLoadingProps): import("react/jsx-runtime").JSX.Element | null;
|
package/dist/matter/cart/cart.js
CHANGED
|
@@ -3,10 +3,13 @@ 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
5
|
import { useStorefrontContext } from "../../sdk/context/storefront-context.js";
|
|
6
|
+
import { useStorefrontNavigation } from "../../sdk/navigation/use-storefront-navigation.js";
|
|
6
7
|
import { graphql } from "../../sdk/generated/gql.js";
|
|
7
8
|
import { useActionsOverride } from "../../sdk/actions/actions-override-context.js";
|
|
8
9
|
import { useDataOverride } from "../../sdk/data/data-override-context.js";
|
|
9
10
|
import { NavigationLink } from "../../particles/navigation-link/navigation-link.js";
|
|
11
|
+
import { ListItemRefContext } from "../../sdk/data/list-item-ref-context.js";
|
|
12
|
+
import { ReactiveRootContext } from "../../sdk/data/page-reactive-data-root.js";
|
|
10
13
|
import { Icon } from "../../particles/icon/icon.js";
|
|
11
14
|
import { DrawerClose } from "../../particles/drawer/drawer.js";
|
|
12
15
|
import { Image } from "../../particles/image/image.js";
|
|
@@ -14,12 +17,9 @@ import { cartCouponErrorsVar, cartLastAddVar, cartUserErrorsVar, miniCartOpenVar
|
|
|
14
17
|
import { awaitCartWrites } from "../../sdk/cart/write-gate.js";
|
|
15
18
|
import { readCartFromCache } from "../../sdk/cart/use-cart-actions.js";
|
|
16
19
|
import { useCartValidateOnOpen } from "../../sdk/cart/use-cart-validate-on-open.js";
|
|
17
|
-
import { ListItemRefContext } from "../../sdk/data/list-item-ref-context.js";
|
|
18
|
-
import { ReactiveRootContext } from "../../sdk/data/page-reactive-data-root.js";
|
|
19
20
|
import { useApolloClient, useReactiveVar } from "@apollo/client/react";
|
|
20
21
|
import { cloneElement, createContext, isValidElement, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
21
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
-
import { useRouter } from "next/navigation";
|
|
22
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
23
23
|
import { useLinkStatus } from "next/link";
|
|
24
24
|
//#region src/matter/cart/cart.tsx
|
|
25
25
|
const CartDisclaimerContent = defineContentType({
|
|
@@ -195,8 +195,8 @@ const CartGoCheckoutDefinition = defineComponent({
|
|
|
195
195
|
},
|
|
196
196
|
schema: {
|
|
197
197
|
href: {
|
|
198
|
-
type: "
|
|
199
|
-
default: "
|
|
198
|
+
type: "link",
|
|
199
|
+
default: { standard: "checkout" },
|
|
200
200
|
label: "Checkout URL"
|
|
201
201
|
},
|
|
202
202
|
label: {
|
|
@@ -206,7 +206,7 @@ const CartGoCheckoutDefinition = defineComponent({
|
|
|
206
206
|
}
|
|
207
207
|
},
|
|
208
208
|
actions: { cart: ["validate"] },
|
|
209
|
-
guideline: "Navigation link to the checkout page (default href
|
|
209
|
+
guideline: "Navigation link to the checkout page (default href the checkout page); use as the checkout CTA inside the cart summary. In a mini-cart it is the DrawerPopup footer CTA, next to CartTotal. The button wording is merchant-editable content: a CMS entry wins, then the label prop (default \"Checkout\"), then children — so a store that labels the button through children keeps working and a CMS save overrides it without a deploy. The destination is not content-editable: href stays an authored prop, because re-pointing checkout is not a copy decision. Before routing it runs a stock validation and only navigates when the re-checked cart has no unavailable line; a validation that cannot run falls open and navigates anyway. During a client-side route transition to checkout it surfaces a loading state on its content wrapper as aria-busy plus data-fs-cart-go-checkout-pending, and while the pre-checkout validation runs it exposes data-fs-cart-go-checkout-validating — there is no built-in spinner, so opt into one by styling those attributes (e.g. composing a Spinner). For an external or hard checkout navigation there is no client-side transition, so the loading state simply does not show (a graceful no-op). The enriched footer checkout CTA is CartCheckoutGuard wrapping CartTotal and this CartGoCheckout: the guard makes the CTA inert (data-fs-cart-checkout-blocked) while any item is unavailable, and CartTotal shows the grand total at the button. Must be inside CartRoot."
|
|
210
210
|
});
|
|
211
211
|
const CartCouponFormDefinition = defineComponent({
|
|
212
212
|
name: "CartCouponForm",
|
|
@@ -324,7 +324,7 @@ function CartTotal({ label, className, children, ...props }) {
|
|
|
324
324
|
className,
|
|
325
325
|
"data-fs-cart-total": "",
|
|
326
326
|
"data-fs-text": "",
|
|
327
|
-
children: label == null ? value : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", { children: label }), /* @__PURE__ */ jsx("span", { children: value })] })
|
|
327
|
+
children: label == null ? value : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", { children: label }), /* @__PURE__ */ jsx("span", { children: value })] })
|
|
328
328
|
});
|
|
329
329
|
}
|
|
330
330
|
function CartCount({ className, children, template = "{count}", ...props }) {
|
|
@@ -362,14 +362,12 @@ function CartGoCheckoutPending({ children }) {
|
|
|
362
362
|
function configuredLabel(value) {
|
|
363
363
|
return value?.trim() ? value : void 0;
|
|
364
364
|
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
}
|
|
369
|
-
function CartGoCheckout({ href = "/checkout", label, className, children, onClick, $content, $actions: $actionsProp, ...props }) {
|
|
365
|
+
/** The default destination of both checkout navigations. Module-level, so an effect keyed on it is stable. */
|
|
366
|
+
const CHECKOUT_PAGE = { standard: "checkout" };
|
|
367
|
+
function CartGoCheckout({ href = CHECKOUT_PAGE, label, className, children, onClick, $content, $actions: $actionsProp, ...props }) {
|
|
370
368
|
const $actions = useActionsOverride($actionsProp);
|
|
371
369
|
const client = useApolloClient();
|
|
372
|
-
const
|
|
370
|
+
const { push } = useStorefrontNavigation();
|
|
373
371
|
const [validating, setValidating] = useState(false);
|
|
374
372
|
const inFlight = useRef(false);
|
|
375
373
|
const resolvedChildren = typeof children === "string" ? configuredLabel(children) : children;
|
|
@@ -386,10 +384,10 @@ function CartGoCheckout({ href = "/checkout", label, className, children, onClic
|
|
|
386
384
|
try {
|
|
387
385
|
await awaitCartWrites();
|
|
388
386
|
if ((await validate()).length > 0) {
|
|
389
|
-
|
|
387
|
+
push(href);
|
|
390
388
|
return;
|
|
391
389
|
}
|
|
392
|
-
if (!(readCartFromCache(client)?.items ?? []).some((item) => item.variant.availability !== "AVAILABLE"))
|
|
390
|
+
if (!(readCartFromCache(client)?.items ?? []).some((item) => item.variant.availability !== "AVAILABLE")) push(href);
|
|
393
391
|
} finally {
|
|
394
392
|
inFlight.current = false;
|
|
395
393
|
setValidating(false);
|
|
@@ -428,7 +426,7 @@ function CartCouponForm({ placeholder = "Coupon code", applyLabel = "Apply", cla
|
|
|
428
426
|
onSubmit: handleSubmit,
|
|
429
427
|
"data-fs-cart-coupon-form": "",
|
|
430
428
|
...pending ? { "data-fs-cart-coupon-pending": "" } : {},
|
|
431
|
-
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("input", {
|
|
429
|
+
children: children ?? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("input", {
|
|
432
430
|
type: "text",
|
|
433
431
|
value: code,
|
|
434
432
|
placeholder,
|
|
@@ -649,11 +647,11 @@ const CartRedirectOnAddDefinition = defineComponent({
|
|
|
649
647
|
category: "commerce"
|
|
650
648
|
},
|
|
651
649
|
schema: { href: {
|
|
652
|
-
type: "
|
|
653
|
-
default: "
|
|
650
|
+
type: "link",
|
|
651
|
+
default: { standard: "checkout" },
|
|
654
652
|
label: "Checkout URL"
|
|
655
653
|
} },
|
|
656
|
-
guideline: "No-mini-cart post-add behavior: navigates the shopper to checkout (href, default
|
|
654
|
+
guideline: "No-mini-cart post-add behavior: navigates the shopper to checkout (href, default the checkout page) after each successful add to cart. Compose it once in the layout for a store that has no mini-cart drawer; it renders no UI of its own. Use this instead of a mini-cart when adding a product should go straight to checkout. Mutually exclusive with CartOpenOnAdd — compose exactly one, and omit the drawer when using this. See cart.md."
|
|
657
655
|
});
|
|
658
656
|
/**
|
|
659
657
|
* Makes the wrapped mini-cart `DrawerRoot` controlled by `miniCartOpenVar` and opens it on each
|
|
@@ -683,16 +681,21 @@ function CartOpenOnAdd({ children, $actions: $actionsProp }) {
|
|
|
683
681
|
* redirect is post-resolve and success-gated. The initial `0` is ignored, so a fresh mount never
|
|
684
682
|
* navigates. Context-free — no `CartRoot` ancestor (ADR-0010). Renders its passthrough children (or
|
|
685
683
|
* nothing); it carries no drawer.
|
|
684
|
+
*
|
|
685
|
+
* The effect keys on the serialized `href`, not on its identity: a reference authored in a schema
|
|
686
|
+
* arrives as a new object on every server render, and keying on it would push to checkout again on a
|
|
687
|
+
* `router.refresh()` long after the add.
|
|
686
688
|
*/
|
|
687
|
-
function CartRedirectOnAdd({ href =
|
|
688
|
-
const
|
|
689
|
+
function CartRedirectOnAdd({ href = CHECKOUT_PAGE, children }) {
|
|
690
|
+
const { push } = useStorefrontNavigation();
|
|
689
691
|
const pulse = useReactiveVar(cartLastAddVar);
|
|
692
|
+
const hrefKey = JSON.stringify(href);
|
|
690
693
|
useEffect(() => {
|
|
691
|
-
if (pulse > 0)
|
|
694
|
+
if (pulse > 0) push(JSON.parse(hrefKey));
|
|
692
695
|
}, [
|
|
693
696
|
pulse,
|
|
694
|
-
|
|
695
|
-
|
|
697
|
+
hrefKey,
|
|
698
|
+
push
|
|
696
699
|
]);
|
|
697
700
|
return children;
|
|
698
701
|
}
|
|
@@ -920,7 +923,7 @@ function CartAlertRoot({ text, icon, iconUrl, iconAlt, className, children, $con
|
|
|
920
923
|
...props,
|
|
921
924
|
className,
|
|
922
925
|
"data-fs-cart-alert": "",
|
|
923
|
-
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(CartAlertIcon, {}), /* @__PURE__ */ jsx(CartAlertText, {})] })
|
|
926
|
+
children: children ?? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(CartAlertIcon, {}), /* @__PURE__ */ jsx(CartAlertText, {})] })
|
|
924
927
|
})
|
|
925
928
|
});
|
|
926
929
|
}
|