@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
|
@@ -11,12 +11,13 @@ function useCardCapture() {
|
|
|
11
11
|
return ctx;
|
|
12
12
|
}
|
|
13
13
|
/** Registers on mount and on any argument change, so the provider always holds the latest closure. */
|
|
14
|
-
function useRegisterCardCapture(capture, preflight) {
|
|
14
|
+
function useRegisterCardCapture(capture, preflight, explainMissingMethod) {
|
|
15
15
|
const { registerCapture } = useCardCapture();
|
|
16
|
-
useEffect(() => registerCapture(capture, preflight), [
|
|
16
|
+
useEffect(() => registerCapture(capture, preflight, explainMissingMethod), [
|
|
17
17
|
registerCapture,
|
|
18
18
|
capture,
|
|
19
|
-
preflight
|
|
19
|
+
preflight,
|
|
20
|
+
explainMissingMethod
|
|
20
21
|
]);
|
|
21
22
|
}
|
|
22
23
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-capture.js","names":[],"sources":["../../../src/matter/card-entry/card-capture.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, useContext, useEffect } from 'react';\nimport type { PaymentSubmissionPath } from '../../sdk/payment/submission-registry.js';\n\n/**\n * The `card-capture` context (specs/sfs-3457-card-entry-card-capture-context.md): everything\n * `CardEntry` needs from whichever surface composes it. The fields own the card values; the provider\n * owns the accepted networks, when a capture runs, and where the card goes. This is the PCI context:\n * `CardEntry` is its only consumer.\n */\n\nexport type CardCaptureValidator = Readonly<{\n numberMask: string | null;\n numberRegex: string | null;\n cvvMask: string | null;\n cvvRegex: string | null;\n cvvRequired: boolean;\n expirationRequired: boolean;\n holderNameRequired: boolean;\n}>;\n\n/** One accepted network and its validation rules. `PaymentSectionMethod` is assignable to it. */\nexport type CardCaptureNetwork = Readonly<{\n id: string;\n name: string;\n validator: CardCaptureValidator;\n}>;\n\n/** The card as the fields hold it. Exists only as the argument of one `send` call. */\nexport type CapturedCard = Readonly<{\n number: string;\n securityCode: string;\n expirationDate: string;\n holderName: string;\n}>;\n\nexport type CardCaptureError = Readonly<{ code: string; message: string }>;\n\nexport type CardCaptureTarget = (card: CapturedCard) => Promise<
|
|
1
|
+
{"version":3,"file":"card-capture.js","names":[],"sources":["../../../src/matter/card-entry/card-capture.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, useContext, useEffect } from 'react';\nimport type { PaymentSubmissionPath } from '../../sdk/payment/submission-registry.js';\n\n/**\n * The `card-capture` context (specs/sfs-3457-card-entry-card-capture-context.md): everything\n * `CardEntry` needs from whichever surface composes it. The fields own the card values; the provider\n * owns the accepted networks, when a capture runs, and where the card goes. This is the PCI context:\n * `CardEntry` is its only consumer.\n */\n\nexport type CardCaptureValidator = Readonly<{\n numberMask: string | null;\n numberRegex: string | null;\n cvvMask: string | null;\n cvvRegex: string | null;\n cvvRequired: boolean;\n expirationRequired: boolean;\n holderNameRequired: boolean;\n}>;\n\n/** One accepted network and its validation rules. `PaymentSectionMethod` is assignable to it. */\nexport type CardCaptureNetwork = Readonly<{\n id: string;\n name: string;\n validator: CardCaptureValidator;\n}>;\n\n/** The card as the fields hold it. Exists only as the argument of one `send` call. */\nexport type CapturedCard = Readonly<{\n number: string;\n securityCode: string;\n expirationDate: string;\n holderName: string;\n}>;\n\nexport type CardCaptureError = Readonly<{ code: string; message: string }>;\n\n/**\n * What a capture and its target resolve (T112). `reachedGateway` is `false` only when no request was\n * issued — `CardEntry`'s own refusals set it, and a target passes through whatever its transport reports.\n * Kept local rather than imported from the SDK: `CardEntry` is surface-agnostic, and the account will\n * tokenize through the same context.\n */\nexport type CardCaptureResult = Readonly<{ reachedGateway: boolean; userErrors: readonly CardCaptureError[] }>;\n\nexport type CardCaptureTarget = (card: CapturedCard) => Promise<CardCaptureResult>;\n\n/** Registered by `CardEntry`; the provider calls it with the target for this one submission. */\nexport type CardCapture = (send: CardCaptureTarget) => Promise<CardCaptureResult>;\n\n/** Synchronous, I/O-free verdict on the draft, with the same contract as `PaymentPreflightCheck`. */\nexport type CardCapturePreflight = () => readonly CardCaptureError[];\n\n/**\n * Synchronous, side-effect-free explanation of why no payment method is selected (T47), with the same\n * contract as `PaymentMissingMethodExplainer`: returns the refusal that names the card as the reason, or\n * `null`. Fixed copy and a fixed code only; it never echoes anything the shopper typed.\n */\nexport type CardCaptureMissingMethodExplainer = () => CardCaptureError | null;\n\n/** The checkout facts `CardEntry` reacts to. Absent outside the checkout. */\nexport type CardCaptureSelection = Readonly<{\n selectMethod: (input: { methodId: string; bin: string }) => void;\n selectNewCard: () => void;\n setDraftBin: (bin: string | null) => void;\n path: PaymentSubmissionPath | null;\n bin: string | null;\n collapsed: boolean;\n cardModeActive: boolean;\n selectedMethodId: string | null;\n selectionOutOfScope: boolean;\n selectionNonCard: boolean;\n}>;\n\nexport type CardCaptureContextValue = Readonly<{\n networks: readonly CardCaptureNetwork[];\n busy: boolean;\n /** When `CardEntry` clears its fields after the target settles. A pre-flight refusal never clears. */\n clearOn: 'success' | 'any-outcome';\n /** Registers the capture, its pre-flight check and, optionally, its missing-method explainer. Returns the unregister function. */\n registerCapture: (\n capture: CardCapture,\n preflight: CardCapturePreflight,\n explainMissingMethod?: CardCaptureMissingMethodExplainer,\n ) => () => void;\n /** Called with the resolved network's id, or `null`, whenever that resolution changes. */\n onNetworkChange?: (networkId: string | null) => void;\n selection?: CardCaptureSelection;\n}>;\n\nconst CARD_CAPTURE_CONTEXT_UNSET = Symbol('CardCaptureContextUnset');\n\nconst CardCaptureContextInternal = createContext<CardCaptureContextValue | typeof CARD_CAPTURE_CONTEXT_UNSET>(\n CARD_CAPTURE_CONTEXT_UNSET,\n);\n\nexport const CardCaptureContext = CardCaptureContextInternal as React.Context<CardCaptureContextValue>;\n\n/** Throws outside a provider, mirroring `usePayment()`: a misplaced `CardEntry` is a composition bug. */\nexport function useCardCapture(): CardCaptureContextValue {\n const ctx = useContext(CardCaptureContextInternal);\n if (ctx === CARD_CAPTURE_CONTEXT_UNSET) {\n throw new Error(\n 'useCardCapture() must be used inside a card-capture provider (PaymentSectionRoot, PaymentSectionController).',\n );\n }\n return ctx;\n}\n\n/** Registers on mount and on any argument change, so the provider always holds the latest closure. */\nexport function useRegisterCardCapture(\n capture: CardCapture,\n preflight: CardCapturePreflight,\n explainMissingMethod?: CardCaptureMissingMethodExplainer,\n): void {\n const { registerCapture } = useCardCapture();\n\n useEffect(\n () => registerCapture(capture, preflight, explainMissingMethod),\n [registerCapture, capture, preflight, explainMissingMethod],\n );\n}\n"],"mappings":";;;AA4FA,MAAM,6BAA6B,OAAO,yBAAyB;AAEnE,MAAM,6BAA6B,cACjC,0BACF;AAEA,MAAa,qBAAqB;;AAGlC,SAAgB,iBAA0C;CACxD,MAAM,MAAM,WAAW,0BAA0B;CACjD,IAAI,QAAQ,4BACV,MAAM,IAAI,MACR,8GACF;CAEF,OAAO;AACT;;AAGA,SAAgB,uBACd,SACA,WACA,sBACM;CACN,MAAM,EAAE,oBAAoB,eAAe;CAE3C,gBACQ,gBAAgB,SAAS,WAAW,oBAAoB,GAC9D;EAAC;EAAiB;EAAS;EAAW;CAAoB,CAC5D;AACF"}
|
|
@@ -44,9 +44,11 @@ export type CardEntryProps = {
|
|
|
44
44
|
cvvDescription?: string;
|
|
45
45
|
/** Shown on the number field when it is left blank. */
|
|
46
46
|
numberRequiredMessage?: string;
|
|
47
|
-
/** Shown on the number field for a Luhn-invalid PAN, or a Luhn-valid one that
|
|
48
|
-
*
|
|
47
|
+
/** Shown on the number field for a Luhn-invalid PAN, or a Luhn-valid one that a configured
|
|
48
|
+
* network claims only as a prefix (the wrong length, or two networks at once). */
|
|
49
49
|
numberInvalidMessage?: string;
|
|
50
|
+
/** Shown on the number field for a Luhn-valid PAN that no configured network claims at all. */
|
|
51
|
+
networkNotAcceptedMessage?: string;
|
|
50
52
|
/** Shown on the holder-name field when it is left blank and the detected method requires it. */
|
|
51
53
|
holderNameRequiredMessage?: string;
|
|
52
54
|
/** Shown on the expiration field when it is left blank and the detected method requires it. */
|
|
@@ -115,6 +117,6 @@ export declare const CARD_ENTRY_INVALID_DATA_CODE = "INVALID_CARD_DATA";
|
|
|
115
117
|
*/
|
|
116
118
|
export declare const CARD_ENTRY_COLLAPSED_CODE = "CARD_ENTRY_COLLAPSED";
|
|
117
119
|
export declare const CardEntryDefinition: ComponentDefinition<CardEntryProps>;
|
|
118
|
-
export declare function CardEntry({ legend, numberLabel, numberPlaceholder, holderNameLabel, holderNamePlaceholder, expirationLabel, expirationPlaceholder, cvvLabel, cvvPlaceholder, cvvDescription, numberRequiredMessage, numberInvalidMessage, holderNameRequiredMessage, expirationRequiredMessage, expirationInvalidMessage, expirationExpiredMessage, cvvRequiredMessage, cvvInvalidMessage, disabled, className }: CardEntryProps): import("react/jsx-runtime").JSX.Element;
|
|
120
|
+
export declare function CardEntry({ legend, numberLabel, numberPlaceholder, holderNameLabel, holderNamePlaceholder, expirationLabel, expirationPlaceholder, cvvLabel, cvvPlaceholder, cvvDescription, numberRequiredMessage, numberInvalidMessage, networkNotAcceptedMessage, holderNameRequiredMessage, expirationRequiredMessage, expirationInvalidMessage, expirationExpiredMessage, cvvRequiredMessage, cvvInvalidMessage, disabled, className }: Readonly<CardEntryProps>): import("react/jsx-runtime").JSX.Element;
|
|
119
121
|
//#endregion
|
|
120
122
|
//# sourceMappingURL=card-entry.d.ts.map
|
|
@@ -8,6 +8,7 @@ import { useCardCapture, useRegisterCardCapture } from "./card-capture.js";
|
|
|
8
8
|
import { applyMask } from "../../particles/shared/input-mask.js";
|
|
9
9
|
import "../../particles/document-field/document-field.js";
|
|
10
10
|
import { SECURITY_CODE_MASK_STYLE, isSecurityCodeComplete } from "../../sdk/payment/security-code-mask.js";
|
|
11
|
+
import { ownValue } from "../../utils/own-value.js";
|
|
11
12
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
12
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
14
|
//#region src/matter/card-entry/card-entry.tsx
|
|
@@ -211,11 +212,11 @@ const NETWORK_ICON_BY_KEY = {
|
|
|
211
212
|
americanexpress: "amex",
|
|
212
213
|
diners: "diners",
|
|
213
214
|
dinersclub: "diners",
|
|
214
|
-
elo: "elo-card"
|
|
215
|
+
elo: "elo-card",
|
|
216
|
+
discover: "discover"
|
|
215
217
|
};
|
|
216
218
|
function networkIconName(name) {
|
|
217
|
-
|
|
218
|
-
return NETWORK_ICON_BY_KEY[key] ?? null;
|
|
219
|
+
return ownValue(NETWORK_ICON_BY_KEY, name.toLowerCase().replaceAll(/[^a-z]/g, "")) ?? null;
|
|
219
220
|
}
|
|
220
221
|
/**
|
|
221
222
|
* Standard Luhn checksum. Rejects non-digit strings and anything shorter than 12 digits — no real
|
|
@@ -301,24 +302,45 @@ function isValidCvv(value, validator) {
|
|
|
301
302
|
function isCardShapedMethod(method) {
|
|
302
303
|
return Boolean(method.validator.numberRegex);
|
|
303
304
|
}
|
|
304
|
-
|
|
305
|
-
|
|
305
|
+
/**
|
|
306
|
+
* Whether a typed number is a well-formed card that no configured network accepts (T47, Decision 1): it is
|
|
307
|
+
* Luhn-valid, detection could have run (at least one method carries a `numberRegex`, the N2 rule), no
|
|
308
|
+
* network's exact pattern matches the digits, and no network claims them even as a BIN-level prefix. A prefix
|
|
309
|
+
* a network claims at the wrong length, or one two networks claim, is a malformed number rather than an
|
|
310
|
+
* unaccepted one and stays `false`. Pure: reads nothing but its arguments, and returns a boolean.
|
|
311
|
+
*/
|
|
312
|
+
function matchesNoConfiguredNetwork(methods, digits) {
|
|
313
|
+
return isValidLuhn(digits) && methods.some(isCardShapedMethod) && exactMatch(methods, digits) === null && relaxedCandidates(methods, digits).length === 0;
|
|
314
|
+
}
|
|
315
|
+
function validateNumber(draft, validator, methods, messages) {
|
|
306
316
|
const digits = toDigits(draft.number);
|
|
307
317
|
const networkDetectionPossible = methods.some(isCardShapedMethod);
|
|
308
|
-
if (!digits)
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
317
|
-
if (
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
return
|
|
318
|
+
if (!digits) return { number: messages.numberRequired };
|
|
319
|
+
if (!isValidLuhn(digits)) return { number: messages.numberInvalid };
|
|
320
|
+
if (networkDetectionPossible && !(validator.numberRegex && safeTest(validator.numberRegex, digits))) return { number: matchesNoConfiguredNetwork(methods, digits) ? messages.networkNotAccepted : messages.numberInvalid };
|
|
321
|
+
return {};
|
|
322
|
+
}
|
|
323
|
+
function validateExpiration(draft, validator, messages) {
|
|
324
|
+
if (!validator.expirationRequired) return {};
|
|
325
|
+
if (!draft.expiration.trim()) return { expiration: messages.expirationRequired };
|
|
326
|
+
if (!isExpirationFormatValid(draft.expiration)) return { expiration: messages.expirationInvalid };
|
|
327
|
+
if (!isExpirationInFuture(draft.expiration)) return { expiration: messages.expirationExpired };
|
|
328
|
+
return {};
|
|
329
|
+
}
|
|
330
|
+
function validateCvv(draft, validator, messages) {
|
|
331
|
+
if (!validator.cvvRequired) return {};
|
|
332
|
+
if (!draft.cvv.trim()) return { cvv: messages.cvvRequired };
|
|
333
|
+
if (!isValidCvv(draft.cvv, validator)) return { cvv: messages.cvvInvalid };
|
|
334
|
+
return {};
|
|
335
|
+
}
|
|
336
|
+
function validateDraft(draft, validator, methods, messages) {
|
|
337
|
+
const holderNameError = validator.holderNameRequired && !draft.holderName.trim() ? { holderName: messages.holderNameRequired } : {};
|
|
338
|
+
return {
|
|
339
|
+
...validateNumber(draft, validator, methods, messages),
|
|
340
|
+
...holderNameError,
|
|
341
|
+
...validateExpiration(draft, validator, messages),
|
|
342
|
+
...validateCvv(draft, validator, messages)
|
|
343
|
+
};
|
|
322
344
|
}
|
|
323
345
|
const CARD_ENTRY_INVALID_DATA_CODE = "INVALID_CARD_DATA";
|
|
324
346
|
const INVALID_CARD_DATA_ERROR = {
|
|
@@ -338,11 +360,24 @@ const CARD_ENTRY_COLLAPSED_ERROR = {
|
|
|
338
360
|
code: CARD_ENTRY_COLLAPSED_CODE,
|
|
339
361
|
message: "This card is not available for the currently selected payment method."
|
|
340
362
|
};
|
|
363
|
+
/**
|
|
364
|
+
* The refusal for a well-formed card number no configured network accepts (T47, Decision 2). Minted here,
|
|
365
|
+
* not in `use-place-order.ts`, because `CARD_FIELD_PATTERN` forbids the word "card" anywhere in that file:
|
|
366
|
+
* the hook only passes along whatever refusal a registered explainer names. Fixed copy and a fixed code —
|
|
367
|
+
* nothing derived from the typed number (digits, BIN, last four, length, a guessed network) may ever be
|
|
368
|
+
* added to the message or to a log line.
|
|
369
|
+
*/
|
|
370
|
+
const CARD_ENTRY_UNSUPPORTED_NETWORK_CODE = "UNSUPPORTED_CARD_NETWORK";
|
|
371
|
+
const UNSUPPORTED_NETWORK_ERROR = {
|
|
372
|
+
code: CARD_ENTRY_UNSUPPORTED_NETWORK_CODE,
|
|
373
|
+
message: "This card is not from a network the store accepts. Use another card or choose another payment method."
|
|
374
|
+
};
|
|
341
375
|
const CardEntryDefinition = defineComponent({
|
|
342
376
|
name: "CardEntry",
|
|
343
377
|
importPath: "@vtex/faststore/components",
|
|
344
378
|
component: CardEntry,
|
|
345
379
|
requiresContext: "card-capture",
|
|
380
|
+
hardened: true,
|
|
346
381
|
editor: {
|
|
347
382
|
label: "Card Entry",
|
|
348
383
|
category: "commerce"
|
|
@@ -405,6 +440,11 @@ const CardEntryDefinition = defineComponent({
|
|
|
405
440
|
default: "Enter a valid card number",
|
|
406
441
|
label: "Number invalid message"
|
|
407
442
|
},
|
|
443
|
+
networkNotAcceptedMessage: {
|
|
444
|
+
type: "string",
|
|
445
|
+
default: "This card is not from a network the store accepts",
|
|
446
|
+
label: "Network not accepted message"
|
|
447
|
+
},
|
|
408
448
|
holderNameRequiredMessage: {
|
|
409
449
|
type: "string",
|
|
410
450
|
default: "Cardholder name is required",
|
|
@@ -443,7 +483,7 @@ const CardEntryDefinition = defineComponent({
|
|
|
443
483
|
},
|
|
444
484
|
guideline: "New-card entry: masked number with live network detection, holder name, expiration, and CVV, each shown and required per the detected network's validator config from the 'card-capture' context. Must be placed inside a card-capture provider: PaymentSectionRoot or PaymentSectionController at checkout. Owns the card values itself — it builds the card and hands it only to the submission target its provider supplies; no other component ever needs the card number or CVV. Card number and CVV are never schema props, fragment fields, or action payloads — do not add one. See card-entry.md."
|
|
445
485
|
});
|
|
446
|
-
function CardEntry({ legend = "Card details", numberLabel = "Card number", numberPlaceholder, holderNameLabel = "Cardholder name", holderNamePlaceholder, expirationLabel = "Expiration date", expirationPlaceholder = "MM/YY", cvvLabel = "Security code", cvvPlaceholder, cvvDescription = "The 3-4 digit number on your card", numberRequiredMessage = "Card number is required", numberInvalidMessage = "Enter a valid card number", holderNameRequiredMessage = "Cardholder name is required", expirationRequiredMessage = "Expiration date is required", expirationInvalidMessage = "Enter a valid expiration date", expirationExpiredMessage = "This card has expired", cvvRequiredMessage = "Security code is required", cvvInvalidMessage = "Enter a valid security code", disabled = false, className }) {
|
|
486
|
+
function CardEntry({ legend = "Card details", numberLabel = "Card number", numberPlaceholder, holderNameLabel = "Cardholder name", holderNamePlaceholder, expirationLabel = "Expiration date", expirationPlaceholder = "MM/YY", cvvLabel = "Security code", cvvPlaceholder, cvvDescription = "The 3-4 digit number on your card", numberRequiredMessage = "Card number is required", numberInvalidMessage = "Enter a valid card number", networkNotAcceptedMessage = "This card is not from a network the store accepts", holderNameRequiredMessage = "Cardholder name is required", expirationRequiredMessage = "Expiration date is required", expirationInvalidMessage = "Enter a valid expiration date", expirationExpiredMessage = "This card has expired", cvvRequiredMessage = "Security code is required", cvvInvalidMessage = "Enter a valid security code", disabled = false, className }) {
|
|
447
487
|
const { networks: methods, busy: placing, clearOn, onNetworkChange, selection } = useCardCapture();
|
|
448
488
|
const draftPath = selection?.path ?? null;
|
|
449
489
|
const draftBin = selection?.bin ?? null;
|
|
@@ -456,6 +496,7 @@ function CardEntry({ legend = "Card details", numberLabel = "Card number", numbe
|
|
|
456
496
|
const validationMessages = useMemo(() => ({
|
|
457
497
|
numberRequired: numberRequiredMessage,
|
|
458
498
|
numberInvalid: numberInvalidMessage,
|
|
499
|
+
networkNotAccepted: networkNotAcceptedMessage,
|
|
459
500
|
holderNameRequired: holderNameRequiredMessage,
|
|
460
501
|
expirationRequired: expirationRequiredMessage,
|
|
461
502
|
expirationInvalid: expirationInvalidMessage,
|
|
@@ -465,6 +506,7 @@ function CardEntry({ legend = "Card details", numberLabel = "Card number", numbe
|
|
|
465
506
|
}), [
|
|
466
507
|
numberRequiredMessage,
|
|
467
508
|
numberInvalidMessage,
|
|
509
|
+
networkNotAcceptedMessage,
|
|
468
510
|
holderNameRequiredMessage,
|
|
469
511
|
expirationRequiredMessage,
|
|
470
512
|
expirationInvalidMessage,
|
|
@@ -640,7 +682,7 @@ function CardEntry({ legend = "Card details", numberLabel = "Card number", numbe
|
|
|
640
682
|
setFieldErrors(errors);
|
|
641
683
|
const firstInvalid = VALIDATION_ORDER.find((key) => errors[key]);
|
|
642
684
|
if (firstInvalid) focusField(firstInvalid);
|
|
643
|
-
return [INVALID_CARD_DATA_ERROR];
|
|
685
|
+
return [matchesNoConfiguredNetwork(methods, digits) ? UNSUPPORTED_NETWORK_ERROR : INVALID_CARD_DATA_ERROR];
|
|
644
686
|
}, [
|
|
645
687
|
collapsed,
|
|
646
688
|
number,
|
|
@@ -649,6 +691,7 @@ function CardEntry({ legend = "Card details", numberLabel = "Card number", numbe
|
|
|
649
691
|
cvv,
|
|
650
692
|
validator,
|
|
651
693
|
methods,
|
|
694
|
+
digits,
|
|
652
695
|
focusField,
|
|
653
696
|
validationMessages,
|
|
654
697
|
selectionOutOfScope,
|
|
@@ -657,7 +700,10 @@ function CardEntry({ legend = "Card details", numberLabel = "Card number", numbe
|
|
|
657
700
|
]);
|
|
658
701
|
const capture = useCallback(async (send) => {
|
|
659
702
|
const refusals = checkDraft();
|
|
660
|
-
if (refusals.length > 0) return
|
|
703
|
+
if (refusals.length > 0) return {
|
|
704
|
+
reachedGateway: false,
|
|
705
|
+
userErrors: refusals
|
|
706
|
+
};
|
|
661
707
|
const card = {
|
|
662
708
|
number,
|
|
663
709
|
securityCode: cvv,
|
|
@@ -666,9 +712,9 @@ function CardEntry({ legend = "Card details", numberLabel = "Card number", numbe
|
|
|
666
712
|
};
|
|
667
713
|
let succeeded = false;
|
|
668
714
|
try {
|
|
669
|
-
const
|
|
670
|
-
succeeded = userErrors.length === 0;
|
|
671
|
-
return
|
|
715
|
+
const result = await send(card);
|
|
716
|
+
succeeded = result.userErrors.length === 0;
|
|
717
|
+
return result;
|
|
672
718
|
} finally {
|
|
673
719
|
if (succeeded || clearOn === "any-outcome") {
|
|
674
720
|
setNumber("");
|
|
@@ -685,7 +731,12 @@ function CardEntry({ legend = "Card details", numberLabel = "Card number", numbe
|
|
|
685
731
|
cvv,
|
|
686
732
|
clearOn
|
|
687
733
|
]);
|
|
688
|
-
|
|
734
|
+
const explainMissingMethod = useCallback(() => !collapsed && matchesNoConfiguredNetwork(methods, digits) ? UNSUPPORTED_NETWORK_ERROR : null, [
|
|
735
|
+
collapsed,
|
|
736
|
+
methods,
|
|
737
|
+
digits
|
|
738
|
+
]);
|
|
739
|
+
useRegisterCardCapture(capture, checkDraft, explainMissingMethod);
|
|
689
740
|
return /* @__PURE__ */ jsx("div", {
|
|
690
741
|
hidden: collapsed,
|
|
691
742
|
"data-fs-card-entry-collapse-boundary": "",
|
|
@@ -827,6 +878,6 @@ function CardEntry({ legend = "Card details", numberLabel = "Card number", numbe
|
|
|
827
878
|
});
|
|
828
879
|
}
|
|
829
880
|
//#endregion
|
|
830
|
-
export { CARD_ENTRY_COLLAPSED_CODE, CARD_ENTRY_INVALID_DATA_CODE, CardEntry, CardEntryDefinition, NETWORK_ICON_BY_KEY, detectNetworkMethod, isExpirationFormatValid, isExpirationInFuture, isValidLuhn, resolveCompleteBin, resolveNetworkMethod, shouldRedispatchOnReturnToNewCard };
|
|
881
|
+
export { CARD_ENTRY_COLLAPSED_CODE, CARD_ENTRY_INVALID_DATA_CODE, CARD_ENTRY_UNSUPPORTED_NETWORK_CODE, CardEntry, CardEntryDefinition, NETWORK_ICON_BY_KEY, detectNetworkMethod, isExpirationFormatValid, isExpirationInFuture, isValidLuhn, matchesNoConfiguredNetwork, resolveCompleteBin, resolveNetworkMethod, shouldRedispatchOnReturnToNewCard };
|
|
831
882
|
|
|
832
883
|
//# sourceMappingURL=card-entry.js.map
|