@vtex/faststore 0.0.7 → 0.0.10
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 +102 -0
- package/dist/actions.json +194 -1
- package/dist/catalog.json +3449 -1612
- package/dist/cli/index.d.ts +512 -63
- package/dist/cli/index.js +2098 -686
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/server-runtime.js +44 -24
- package/dist/cli/server-runtime.js.map +1 -1
- package/dist/client.d.ts +5 -1
- package/dist/client.js +5 -1
- package/dist/components.d.ts +42 -10
- package/dist/components.js +47 -15
- package/dist/content-types.json +823 -0
- package/dist/core/dist/define-component.d.ts +12 -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 +5 -5
- package/dist/docs/account-menu.md +7 -7
- package/dist/docs/account-saved-cards.md +301 -0
- package/dist/docs/alert-dialog.md +2 -2
- package/dist/docs/billing-address.md +17 -9
- package/dist/docs/binding-switcher.md +154 -0
- package/dist/docs/card-entry.md +38 -7
- package/dist/docs/card-summary.md +175 -0
- package/dist/docs/cardholder-document.md +16 -14
- package/dist/docs/cart-destination.md +238 -0
- package/dist/docs/cart-item.md +22 -4
- package/dist/docs/cart-totalizer.md +1 -1
- package/dist/docs/cart.md +126 -19
- 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/footer-social.md +1 -1
- package/dist/docs/free-shipping-progress.md +13 -9
- package/dist/docs/header-root.md +1 -1
- package/dist/docs/incentives.md +4 -4
- package/dist/docs/logo.md +6 -6
- package/dist/docs/my-account-profile.md +4 -4
- 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 +16 -5
- package/dist/docs/payment-methods.md +1 -1
- package/dist/docs/place-order.md +13 -9
- package/dist/docs/product-information.md +2 -2
- package/dist/docs/product-shelf.md +7 -0
- package/dist/docs/saved-cards.md +2 -2
- package/dist/docs/select.md +22 -10
- package/dist/docs/session.md +1 -1
- package/dist/docs/shipping-address.md +1 -1
- package/dist/docs/sign-in-redirect.md +7 -7
- package/dist/docs/toast.md +35 -13
- package/dist/index.d.ts +7 -2
- package/dist/index.js +2 -1
- package/dist/internal/client.d.ts +9 -1
- package/dist/internal/client.js +10 -2
- package/dist/internal/server.d.ts +8 -2
- package/dist/internal/server.js +8 -2
- 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 +7 -3
- package/dist/matter/account-menu/account-menu.js +69 -28
- package/dist/matter/account-menu/account-menu.js.map +1 -1
- package/dist/matter/account-saved-cards/account-saved-cards.d.ts +383 -0
- package/dist/matter/account-saved-cards/account-saved-cards.js +956 -0
- package/dist/matter/account-saved-cards/account-saved-cards.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 +77 -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-namespace.d.ts +5 -1
- package/dist/matter/cart/cart-namespace.js +5 -1
- package/dist/matter/cart/cart-namespace.js.map +1 -1
- package/dist/matter/cart/cart.d.ts +41 -6
- package/dist/matter/cart/cart.js +267 -54
- package/dist/matter/cart/cart.js.map +1 -1
- package/dist/matter/cart-destination/cart-destination.d.ts +222 -0
- package/dist/matter/cart-destination/cart-destination.js +613 -0
- package/dist/matter/cart-destination/cart-destination.js.map +1 -0
- package/dist/matter/cart-item/cart-item.d.ts +4 -2
- package/dist/matter/cart-item/cart-item.js +76 -17
- package/dist/matter/cart-item/cart-item.js.map +1 -1
- package/dist/matter/cart-totalizer/cart-totalizer.js +3 -2
- package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -1
- package/dist/matter/client-preferences/client-preferences-fieldset.js +1 -1
- package/dist/matter/client-profile-form/client-profile-fieldset.js +8 -5
- package/dist/matter/client-profile-form/client-profile-fieldset.js.map +1 -1
- package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +6 -3
- package/dist/matter/free-shipping-progress/free-shipping-progress.js +76 -33
- package/dist/matter/free-shipping-progress/free-shipping-progress.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 +2 -2
- package/dist/matter/identity-summary/identity-summary.js.map +1 -1
- package/dist/matter/my-account-profile/my-account-profile.d.ts +3 -3
- package/dist/matter/my-account-profile/my-account-profile.js +4 -4
- 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 +11 -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 +11 -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 +7 -0
- package/dist/matter/product-shelf/product-shelf.js +115 -1
- 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 +26 -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 +62 -14
- package/dist/matter/shipping-address/shipping-address.js.map +1 -1
- package/dist/matter/shipping-simulator/shipping-simulator.d.ts +2 -2
- package/dist/matter/shipping-simulator/shipping-simulator.js +6 -2
- 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/binding-switcher/binding-switcher.d.ts +38 -0
- package/dist/particles/binding-switcher/binding-switcher.js +183 -0
- package/dist/particles/binding-switcher/binding-switcher.js.map +1 -0
- package/dist/particles/card-summary/card-network.d.ts +17 -0
- package/dist/particles/card-summary/card-network.js +25 -0
- package/dist/particles/card-summary/card-network.js.map +1 -0
- package/dist/particles/card-summary/card-summary.d.ts +83 -0
- package/dist/particles/card-summary/card-summary.js +188 -0
- package/dist/particles/card-summary/card-summary.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/footer-social/footer-social.d.ts +1 -1
- package/dist/particles/footer-social/footer-social.js +1 -1
- package/dist/particles/footer-social/footer-social.js.map +1 -1
- package/dist/particles/incentives/incentives.d.ts +7 -3
- package/dist/particles/incentives/incentives.js +8 -3
- 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/payment-methods/payment-methods.d.ts +1 -1
- package/dist/particles/payment-methods/payment-methods.js +1 -1
- package/dist/particles/payment-methods/payment-methods.js.map +1 -1
- package/dist/particles/phone-field/phone-field.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 +21 -7
- package/dist/particles/toast/toast.js +76 -8
- package/dist/particles/toast/toast.js.map +1 -1
- package/dist/schema.graphql +1376 -126
- 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 +5 -1
- package/dist/sdk/actions/index.js +5 -1
- package/dist/sdk/actions/locale-action-provider.d.ts +16 -0
- package/dist/sdk/actions/locale-action-provider.js +20 -0
- package/dist/sdk/actions/locale-action-provider.js.map +1 -0
- package/dist/sdk/actions/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/saved-card-action-provider.d.ts +12 -0
- package/dist/sdk/actions/saved-card-action-provider.js +16 -0
- package/dist/sdk/actions/saved-card-action-provider.js.map +1 -0
- package/dist/sdk/actions/types.d.ts +10 -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/cache/storefront-cache.js +30 -4
- package/dist/sdk/cache/storefront-cache.js.map +1 -1
- package/dist/sdk/cart/operations.d.ts +2 -1
- package/dist/sdk/cart/operations.js +55 -1
- package/dist/sdk/cart/operations.js.map +1 -1
- package/dist/sdk/cart/optimistic.d.ts +30 -7
- package/dist/sdk/cart/optimistic.js +78 -41
- package/dist/sdk/cart/optimistic.js.map +1 -1
- package/dist/sdk/cart/use-cart-actions.d.ts +7 -0
- package/dist/sdk/cart/use-cart-actions.js +61 -15
- package/dist/sdk/cart/use-cart-actions.js.map +1 -1
- package/dist/sdk/cart/use-cart-sync-sales-channel.js +70 -0
- package/dist/sdk/cart/use-cart-sync-sales-channel.js.map +1 -0
- package/dist/sdk/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.js +1 -8
- package/dist/sdk/content/create-content-runtime.js.map +1 -1
- package/dist/sdk/data/failed-fields.js +23 -0
- package/dist/sdk/data/failed-fields.js.map +1 -0
- package/dist/sdk/data/index.js +2 -2
- 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/reactive-list-item-data-provider.js +2 -2
- 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 +17 -11
- package/dist/sdk/generated/gql.js.map +1 -1
- package/dist/sdk/generated/graphql.d.ts +185 -46
- package/dist/sdk/generated/graphql.js +2587 -155
- package/dist/sdk/generated/graphql.js.map +1 -1
- package/dist/sdk/i18n/messages/en-US.js +157 -1
- package/dist/sdk/i18n/messages/en-US.json +157 -1
- package/dist/sdk/i18n/messages/en-US.json.d.ts +156 -0
- package/dist/sdk/i18n/messages/es-ES.js +157 -1
- package/dist/sdk/i18n/messages/es-ES.json +157 -1
- package/dist/sdk/i18n/messages/pt-BR.js +157 -1
- package/dist/sdk/i18n/messages/pt-BR.json +157 -1
- package/dist/sdk/i18n/provider.js +1 -1
- package/dist/sdk/i18n/provider.js.map +1 -1
- package/dist/sdk/locale/binding-switch-provider.d.ts +13 -0
- package/dist/sdk/locale/binding-switch-provider.js +20 -0
- package/dist/sdk/locale/binding-switch-provider.js.map +1 -0
- package/dist/sdk/locale/use-locale-actions.d.ts +16 -0
- package/dist/sdk/locale/use-locale-actions.js +70 -0
- package/dist/sdk/locale/use-locale-actions.js.map +1 -0
- package/dist/sdk/navigation/binding-switch.d.ts +39 -0
- package/dist/sdk/navigation/binding-switch.js +129 -0
- package/dist/sdk/navigation/binding-switch.js.map +1 -0
- package/dist/sdk/navigation/current-page.js +30 -0
- package/dist/sdk/navigation/current-page.js.map +1 -0
- package/dist/sdk/navigation/decode-route-params.d.ts +11 -0
- package/dist/sdk/navigation/decode-route-params.js +32 -0
- package/dist/sdk/navigation/decode-route-params.js.map +1 -0
- package/dist/sdk/navigation/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 +5 -2
- 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 +333 -143
- package/dist/sdk/payment/use-place-order.js.map +1 -1
- package/dist/sdk/saved-cards/operations.d.ts +16 -0
- package/dist/sdk/saved-cards/operations.js +41 -0
- package/dist/sdk/saved-cards/operations.js.map +1 -0
- package/dist/sdk/saved-cards/use-saved-card-actions.d.ts +26 -0
- package/dist/sdk/saved-cards/use-saved-card-actions.js +86 -0
- package/dist/sdk/saved-cards/use-saved-card-actions.js.map +1 -0
- package/dist/sdk/seo/page-alternates.d.ts +57 -0
- package/dist/sdk/seo/page-alternates.js +127 -0
- package/dist/sdk/seo/page-alternates.js.map +1 -0
- package/dist/sdk/shipping/shipping-operations.d.ts +1 -1
- package/dist/sdk/shipping/shipping-operations.js +13 -0
- package/dist/sdk/shipping/shipping-operations.js.map +1 -1
- package/dist/sdk/state/cart.d.ts +9 -2
- package/dist/sdk/state/cart.js +9 -2
- package/dist/sdk/state/cart.js.map +1 -1
- package/dist/utils/own-value.js +19 -0
- package/dist/utils/own-value.js.map +1 -0
- package/dist/utils/safe-href.d.ts +4 -4
- package/dist/utils/safe-href.js +31 -22
- package/dist/utils/safe-href.js.map +1 -1
- package/package.json +5 -1
- 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 +28 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-entry-point.js","names":[],"sources":["../../../src/matter/account-entry-point/account-entry-point.tsx"],"sourcesContent":["'use client';\n\nimport { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport { usePathname } from 'next/navigation';\nimport { type ComponentPropsWithRef, useEffect, useState } from 'react';\nimport { Icon } from '../../particles/icon/icon.js';\nimport { NavigationLink } from '../../particles/navigation-link/navigation-link.js';\nimport { resolveSignInHref } from '../../utils/safe-href.js';\nimport { useSession } from '../session/session.js';\n\n/** The account's root. A fixed convention, never an authored value: an authored destination could\n * misroute the entry into the account. */\nconst ACCOUNT_ROUTE = '/pvt/account';\n\n// Nothing is required: an entry may author any subset, and a slice missing a required property is\n// shape-invalid, which drops the whole element rather than the one field.\nexport const AccountEntryPointContent = defineContentType({\n id: 'account-entry-point',\n title: 'Account Entry Point',\n description: 'Labels and icon for the header sign-in / account control.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n signedOutLabel: { type: 'string', minLength: 1, title: 'Signed-out label' },\n signedInLabel: { type: 'string', minLength: 1, title: 'Signed-in label' },\n icon: { type: 'string', minLength: 1, title: 'Icon' },\n loadingLabel: { type: 'string', minLength: 1, title: 'Loading announcement' },\n },\n },\n});\n\n/** Props for {@link AccountEntryPoint}. Extends native `<a>` attributes (the rendered root). */\nexport type AccountEntryPointProps = Omit<ComponentPropsWithRef<'a'>, 'href' | 'children'> & {\n /** Label for anonymous and identified shoppers. Optional: the render gate, not the type,\n * requires a resolved value. */\n signedOutLabel?: string;\n /** Label for logged-in shoppers. Same gate. */\n signedInLabel?: string;\n /** Icon reference for the glyph. Never gated: a control with no glyph is a valid configuration. */\n icon?: string;\n /** Text the live region announces while the session resolves. */\n loadingLabel?: string;\n /** Merchant-authored fields, sliced from the page/layout content entry; win over the props field\n * by field when present. Absent in a non-CMS store — the props are the fallback. */\n $content?: ContentValue<typeof AccountEntryPointContent>;\n};\n\n/** Props for {@link AccountEntryPointLoading}. Extends native `<span>` attributes. */\nexport type AccountEntryPointLoadingProps = Omit<ComponentPropsWithRef<'span'>, 'children'>;\n\nexport const AccountEntryPointDefinition = defineComponent<AccountEntryPointProps>({\n name: 'AccountEntryPoint',\n importPath: '@vtex/faststore/components',\n component: AccountEntryPoint,\n content: AccountEntryPointContent,\n editor: { label: 'Account Entry Point', category: 'identity' },\n requiresContext: 'session',\n schema: {\n signedOutLabel: { type: 'string', label: 'Signed-out Label' },\n signedInLabel: { type: 'string', label: 'Signed-in Label' },\n icon: { type: 'icon', label: 'Icon' },\n loadingLabel: { type: 'string', label: 'Loading Announcement' },\n },\n guideline:\n 'Session-aware header control rendering one link: the signed-out label toward /login for anonymous and identified shoppers, the signed-in label toward the account route for logged-in ones, and a politely announced placeholder while the session resolves. Both destinations are fixed conventions, not props, so no authored value can misroute the auth flow. Must be inside a SessionRoot, normally the one hosted by the shared layout; a page-hosted provider also works, since the server-side session fetch forwards the shopper cookie. Author the label for a state or that state renders nothing; the labels are optional in the type only because a CMS entry may supply them, and an entry overrides all four fields at runtime. Style it through data-fs-account-entry-point and switch on data-fs-account-entry-point-state.',\n});\n\nexport function AccountEntryPoint({\n signedOutLabel,\n signedInLabel,\n icon,\n loadingLabel,\n $content,\n className,\n ref,\n ...props\n}: AccountEntryPointProps) {\n const { state, loading } = useSession();\n const pathname = usePathname();\n\n // Blank entry fields fall through, so clearing one in the Admin reads as unauthored.\n const entrySignedOutLabel = $content?.signedOutLabel?.trim() ? $content.signedOutLabel : signedOutLabel;\n const entrySignedInLabel = $content?.signedInLabel?.trim() ? $content.signedInLabel : signedInLabel;\n const entryIcon = $content?.icon?.trim() ? $content.icon : icon;\n const entryLoadingLabel = $content?.loadingLabel?.trim() ? $content.loadingLabel : loadingLabel;\n\n // Assistive technology only reports a change inside a region that was already in the tree, so a\n // region mounted together with its text announces nothing. The region therefore holds the same\n // position in both branches — React keeps it mounted across the swap — and starts empty, with the\n // label written on the pass after mount and cleared again once the session resolves.\n //\n // It trails the branch content rather than leading it so the authored swatch, which lands on\n // whichever element leads, can still reach the region through a following-sibling selector.\n const [announcement, setAnnouncement] = useState('');\n const resolvingLabel = loading ? entryLoadingLabel : undefined;\n useEffect(() => {\n setAnnouncement(resolvingLabel ?? '');\n }, [resolvingLabel]);\n\n // Gate on `loading` before `state`: an unresolved session reports `anonymous`, so reading the\n // tri-state first would flash \"Sign In\" at a shopper who is already signed in.\n if (loading) {\n return (\n <>\n <AccountEntryPointLoading {...props} className={className} />\n <AccountEntryPointAnnouncement>{announcement}</AccountEntryPointAnnouncement>\n </>\n );\n }\n\n // `identified` stays on the signed-out link: an identified but unauthenticated shopper cannot\n // reach their account yet.\n const signedIn = state === 'loggedIn';\n const label = signedIn ? entrySignedInLabel : entrySignedOutLabel;\n\n // A focusable link a screen reader announces as its bare URL is worse than no control at all.\n if (!label?.trim()) {\n return null;\n }\n\n return (\n <>\n <NavigationLink\n {...props}\n ref={ref}\n href={signedIn ? ACCOUNT_ROUTE : resolveSignInHref(pathname)}\n // The signed-out destination is a deferred auth proxy that may set a cookie or redirect, and\n // a header control is always in the viewport — the default prefetch would fire that GET on\n // every page view. The account route is an ordinary page, so it keeps the default.\n prefetch={signedIn ? undefined : false}\n className={className}\n data-fs-account-entry-point=\"\"\n data-fs-account-entry-point-state={signedIn ? 'signed-in' : 'signed-out'}\n >\n {entryIcon ? <Icon name={entryIcon} /> : null}\n <span data-fs-account-entry-point-label=\"\">{label}</span>\n </NavigationLink>\n <AccountEntryPointAnnouncement>{announcement}</AccountEntryPointAnnouncement>\n </>\n );\n}\n\n/**\n * The live region that carries the control across the wait. Separate from the visual placeholder\n * because it has to outlive it: the placeholder is only in the tree while the session resolves,\n * while the region has to be there before the text lands for the text to be announced at all.\n */\nfunction AccountEntryPointAnnouncement({ children }: { children: string }) {\n return (\n <output aria-live=\"polite\" data-fs-account-entry-point-announcement=\"\">\n {children}\n </output>\n );\n}\n\n/**\n * The visual stand-in occupying the control's slot while the session resolves. Purely visual: the\n * wait is spoken by the sibling live region, so this is hidden from assistive technology rather\n * than announced twice. Named for the state it represents, as `ShippingSimulatorLoading` is, not\n * for the bar it draws.\n */\nexport function AccountEntryPointLoading({ className, ...props }: AccountEntryPointLoadingProps) {\n return <span {...props} aria-hidden=\"true\" className={className} data-fs-account-entry-point-loading=\"\" />;\n}\n"],"mappings":";;;;;;;;;;;;;;AAYA,MAAM,gBAAgB;AAItB,MAAa,2BAA2B,kBAAkB;CACxD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY;GACV,gBAAgB;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAmB;GAC1E,eAAe;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAkB;GACxE,MAAM;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAO;GACpD,cAAc;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAuB;EAC9E;CACF;AACF,CAAC;AAqBD,MAAa,8BAA8B,gBAAwC;CACjF,MAAM;C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KAAA,IAAY;EACtB;EACX,+BAA4B;EAC5B,qCAAmC,WAAW,cAAc;EAV9D,UAAA,CAYG,YAAY,oBAAC,MAAD,EAAM,MAAM,UAAY,CAAA,IAAI,MACzC,oBAAC,QAAD;GAAM,qCAAkC;GAAI,UAAA;EAAY,CAAA,CAC1C;CAChB,CAAA,GAAA,oBAAC,+BAAD,EAAA,UAAgC,aAA4C,CAAA,CAC5E,EAAA,CAAA;AAEN;;;;;;AAOA,SAAS,8BAA8B,EAAE,YAAkC;CACzE,OACE,oBAAC,UAAD;EAAQ,aAAU;EAAS,4CAAyC;EACjE;CACK,CAAA;AAEZ;;;;;;;AAQA,SAAgB,yBAAyB,EAAE,WAAW,GAAG,SAAwC;CAC/F,OAAO,oBAAC,QAAD;EAAM,GAAI;EAAO,eAAY;EAAkB;EAAW,uCAAoC;CAAI,CAAA;AAC3G"}
|
|
1
|
+
{"version":3,"file":"account-entry-point.js","names":[],"sources":["../../../src/matter/account-entry-point/account-entry-point.tsx"],"sourcesContent":["'use client';\n\nimport { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport { type ComponentPropsWithRef, useEffect, useState } from 'react';\nimport { Icon } from '../../particles/icon/icon.js';\nimport { NavigationLink } from '../../particles/navigation-link/navigation-link.js';\nimport type { PageRef } from '../../sdk/navigation/types.js';\nimport { useStorefrontRoute } from '../../sdk/navigation/use-storefront-route.js';\nimport { signInTarget } from '../../utils/safe-href.js';\nimport { useSession } from '../session/session.js';\n\n/** The account's root page. Never an authored value: an authored destination could misroute the entry\n * into the account. */\nconst ACCOUNT_ROUTE: PageRef = { standard: 'account' };\n\n// Nothing is required: an entry may author any subset, and a slice missing a required property is\n// shape-invalid, which drops the whole element rather than the one field.\nexport const AccountEntryPointContent = defineContentType({\n id: 'account-entry-point',\n title: 'Account Entry Point',\n description: 'Labels and icon for the header sign-in / account control.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n signedOutLabel: { type: 'string', minLength: 1, title: 'Signed-out label' },\n signedInLabel: { type: 'string', minLength: 1, title: 'Signed-in label' },\n icon: { type: 'string', minLength: 1, title: 'Icon' },\n loadingLabel: { type: 'string', minLength: 1, title: 'Loading announcement' },\n },\n },\n});\n\n/** Props for {@link AccountEntryPoint}. Extends native `<a>` attributes (the rendered root). */\nexport type AccountEntryPointProps = Omit<ComponentPropsWithRef<'a'>, 'href' | 'children'> & {\n /** Label for anonymous and identified shoppers. Optional: the render gate, not the type,\n * requires a resolved value. */\n signedOutLabel?: string;\n /** Label for logged-in shoppers. Same gate. */\n signedInLabel?: string;\n /** Icon reference for the glyph. Never gated: a control with no glyph is a valid configuration. */\n icon?: string;\n /** Text the live region announces while the session resolves. */\n loadingLabel?: string;\n /** Merchant-authored fields, sliced from the page/layout content entry; win over the props field\n * by field when present. Absent in a non-CMS store — the props are the fallback. */\n $content?: ContentValue<typeof AccountEntryPointContent>;\n};\n\n/** Props for {@link AccountEntryPointLoading}. Extends native `<span>` attributes. */\nexport type AccountEntryPointLoadingProps = Omit<ComponentPropsWithRef<'span'>, 'children'>;\n\nexport const AccountEntryPointDefinition = defineComponent<AccountEntryPointProps>({\n name: 'AccountEntryPoint',\n importPath: '@vtex/faststore/components',\n component: AccountEntryPoint,\n content: AccountEntryPointContent,\n editor: { label: 'Account Entry Point', category: 'identity' },\n requiresContext: 'session',\n schema: {\n signedOutLabel: { type: 'string', label: 'Signed-out Label' },\n signedInLabel: { type: 'string', label: 'Signed-in Label' },\n icon: { type: 'icon', label: 'Icon' },\n loadingLabel: { type: 'string', label: 'Loading Announcement' },\n },\n guideline:\n 'Session-aware header control rendering one link: the signed-out label toward the sign-in page for anonymous and identified shoppers, the signed-in label toward the account page for logged-in ones, and a politely announced placeholder while the session resolves. Both destinations are fixed conventions, not props, so no authored value can misroute the auth flow. Must be inside a SessionRoot, normally the one hosted by the shared layout; a page-hosted provider also works, since the server-side session fetch forwards the shopper cookie. Author the label for a state or that state renders nothing; the labels are optional in the type only because a CMS entry may supply them, and an entry overrides all four fields at runtime. Style it through data-fs-account-entry-point and switch on data-fs-account-entry-point-state.',\n});\n\nexport function AccountEntryPoint({\n signedOutLabel,\n signedInLabel,\n icon,\n loadingLabel,\n $content,\n className,\n ref,\n ...props\n}: AccountEntryPointProps) {\n const { state, loading } = useSession();\n const { path } = useStorefrontRoute();\n\n // Blank entry fields fall through, so clearing one in the Admin reads as unauthored.\n const entrySignedOutLabel = $content?.signedOutLabel?.trim() ? $content.signedOutLabel : signedOutLabel;\n const entrySignedInLabel = $content?.signedInLabel?.trim() ? $content.signedInLabel : signedInLabel;\n const entryIcon = $content?.icon?.trim() ? $content.icon : icon;\n const entryLoadingLabel = $content?.loadingLabel?.trim() ? $content.loadingLabel : loadingLabel;\n\n // Assistive technology only reports a change inside a region that was already in the tree, so a\n // region mounted together with its text announces nothing. The region therefore holds the same\n // position in both branches — React keeps it mounted across the swap — and starts empty, with the\n // label written on the pass after mount and cleared again once the session resolves.\n //\n // It trails the branch content rather than leading it so the authored swatch, which lands on\n // whichever element leads, can still reach the region through a following-sibling selector.\n const [announcement, setAnnouncement] = useState('');\n const resolvingLabel = loading ? entryLoadingLabel : undefined;\n useEffect(() => {\n setAnnouncement(resolvingLabel ?? '');\n }, [resolvingLabel]);\n\n // Gate on `loading` before `state`: an unresolved session reports `anonymous`, so reading the\n // tri-state first would flash \"Sign In\" at a shopper who is already signed in.\n if (loading) {\n return (\n <>\n <AccountEntryPointLoading {...props} className={className} />\n <AccountEntryPointAnnouncement>{announcement}</AccountEntryPointAnnouncement>\n </>\n );\n }\n\n // `identified` stays on the signed-out link: an identified but unauthenticated shopper cannot\n // reach their account yet.\n const signedIn = state === 'loggedIn';\n const label = signedIn ? entrySignedInLabel : entrySignedOutLabel;\n\n // A focusable link a screen reader announces as its bare URL is worse than no control at all.\n if (!label?.trim()) {\n return null;\n }\n\n return (\n <>\n <NavigationLink\n {...props}\n ref={ref}\n href={signedIn ? ACCOUNT_ROUTE : signInTarget(path)}\n // The signed-out destination is a deferred auth proxy that may set a cookie or redirect, and\n // a header control is always in the viewport — the default prefetch would fire that GET on\n // every page view. The account page is an ordinary page, so it keeps the default.\n prefetch={signedIn ? undefined : false}\n className={className}\n data-fs-account-entry-point=\"\"\n data-fs-account-entry-point-state={signedIn ? 'signed-in' : 'signed-out'}\n >\n {entryIcon ? <Icon name={entryIcon} /> : null}\n <span data-fs-account-entry-point-label=\"\">{label}</span>\n </NavigationLink>\n <AccountEntryPointAnnouncement>{announcement}</AccountEntryPointAnnouncement>\n </>\n );\n}\n\n/**\n * The live region that carries the control across the wait. Separate from the visual placeholder\n * because it has to outlive it: the placeholder is only in the tree while the session resolves,\n * while the region has to be there before the text lands for the text to be announced at all.\n */\nfunction AccountEntryPointAnnouncement({ children }: { children: string }) {\n return (\n <output aria-live=\"polite\" data-fs-account-entry-point-announcement=\"\">\n {children}\n </output>\n );\n}\n\n/**\n * The visual stand-in occupying the control's slot while the session resolves. Purely visual: the\n * wait is spoken by the sibling live region, so this is hidden from assistive technology rather\n * than announced twice. Named for the state it represents, as `ShippingSimulatorLoading` is, not\n * for the bar it draws.\n */\nexport function AccountEntryPointLoading({ className, ...props }: AccountEntryPointLoadingProps) {\n return <span {...props} aria-hidden=\"true\" className={className} data-fs-account-entry-point-loading=\"\" />;\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAM,gBAAyB,EAAE,UAAU,UAAU;AAIrD,MAAa,2BAA2B,kBAAkB;CACxD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY;GACV,gBAAgB;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAmB;GAC1E,eAAe;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAkB;GACxE,MAAM;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAO;GACpD,cAAc;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAuB;EAC9E;CACF;AACF,CAAC;AAqBD,MAAa,8BAA8B,gBAA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I;EAIlD,UAAU,WAAW,KAAA,IAAY;EACtB;EACX,+BAA4B;EAC5B,qCAAmC,WAAW,cAAc;EAV9D,UAAA,CAYG,YAAY,oBAAC,MAAD,EAAM,MAAM,UAAY,CAAA,IAAI,MACzC,oBAAC,QAAD;GAAM,qCAAkC;GAAI,UAAA;EAAY,CAAA,CAC1C;CAChB,CAAA,GAAA,oBAAC,+BAAD,EAAA,UAAgC,aAA4C,CAAA,CAC5E,EAAA,CAAA;AAEN;;;;;;AAOA,SAAS,8BAA8B,EAAE,YAAkC;CACzE,OACE,oBAAC,UAAD;EAAQ,aAAU;EAAS,4CAAyC;EACjE;CACK,CAAA;AAEZ;;;;;;;AAQA,SAAgB,yBAAyB,EAAE,WAAW,GAAG,SAAwC;CAC/F,OAAO,oBAAC,QAAD;EAAM,GAAI;EAAO,eAAY;EAAkB;EAAW,uCAAoC;CAAI,CAAA;AAC3G"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
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
|
+
import { PageRef } from "../../sdk/navigation/types.js";
|
|
4
5
|
import { ComponentActions } from "../../sdk/actions/types.js";
|
|
5
6
|
import { ComponentPropsWithRef } from "react";
|
|
6
7
|
//#region src/matter/account-menu/account-menu.d.ts
|
|
@@ -86,12 +87,15 @@ export declare const AccountMenuSignOutContent: {
|
|
|
86
87
|
};
|
|
87
88
|
};
|
|
88
89
|
type AccountMenuContentValue = ContentValue<typeof AccountMenuContent>;
|
|
89
|
-
/** One authored section. Derived from the model so the prop and content channels cannot drift
|
|
90
|
-
|
|
90
|
+
/** One authored section. Derived from the model so the prop and content channels cannot drift; the prop
|
|
91
|
+
* channel also takes a page reference. */
|
|
92
|
+
export type AccountMenuSection = Omit<NonNullable<AccountMenuContentValue['items']>[number], 'href'> & {
|
|
93
|
+
href: PageRef | string;
|
|
94
|
+
};
|
|
91
95
|
/** A section resolved for render. A null `href` is a destination the allowlist refused. */
|
|
92
96
|
export type AccountMenuResolvedSection = {
|
|
93
97
|
label: string;
|
|
94
|
-
href: string | null;
|
|
98
|
+
href: PageRef | string | null;
|
|
95
99
|
external: boolean;
|
|
96
100
|
};
|
|
97
101
|
export type AccountMenuCurrent = {
|
|
@@ -2,15 +2,19 @@
|
|
|
2
2
|
import { defineComponent } from "../../core/dist/define-component.js";
|
|
3
3
|
import { defineContentType } from "../../core/dist/define-content-type.js";
|
|
4
4
|
import "../../core/dist/index.js";
|
|
5
|
-
import { useActionsOverride } from "../../sdk/actions/actions-override-context.js";
|
|
6
5
|
import { resolveSafeHref, resolveSiteRelativeHref } from "../../utils/safe-href.js";
|
|
6
|
+
import { resolveStorefrontHref } from "../../sdk/navigation/resolve-storefront-href.js";
|
|
7
|
+
import { useStorefrontContext } from "../../sdk/context/storefront-context.js";
|
|
8
|
+
import { useRouteMap } from "../../sdk/navigation/route-map-provider.js";
|
|
9
|
+
import { useStorefrontNavigation } from "../../sdk/navigation/use-storefront-navigation.js";
|
|
10
|
+
import { useStorefrontRoute } from "../../sdk/navigation/use-storefront-route.js";
|
|
11
|
+
import { useActionsOverride } from "../../sdk/actions/actions-override-context.js";
|
|
7
12
|
import { NavigationLink } from "../../particles/navigation-link/navigation-link.js";
|
|
8
13
|
import { declareSignOutIntent, useSignOutIntent, withdrawSignOutIntent } from "../account-access-gate/sign-out-intent.js";
|
|
9
14
|
import { AccountAccessGateLoading } from "../account-access-gate/account-access-gate.js";
|
|
10
15
|
import { clearSignOutFailure, reportSignOutFailure, useSignOutFailure } from "./sign-out-failure.js";
|
|
11
16
|
import { createContext, useContext, useEffect, useLayoutEffect, useMemo, useRef } from "react";
|
|
12
17
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { usePathname, useRouter } from "next/navigation";
|
|
14
18
|
//#region src/matter/account-menu/account-menu.tsx
|
|
15
19
|
const useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
16
20
|
const AccountMenuContent = defineContentType({
|
|
@@ -145,7 +149,7 @@ const AccountMenuIndexRedirectDefinition = defineComponent({
|
|
|
145
149
|
label: "No Section Message"
|
|
146
150
|
}
|
|
147
151
|
},
|
|
148
|
-
guideline: "The whole of the account's root page: it replaces the current history entry with the first section of the merchant's list that stays in the account, skipping one marked external, one whose destination was refused or is not site-relative, and the root itself. It shows the access gate's loading look until the section opens. A list with no such section leaves the root terminal — no navigation, and the no-section message in its place — rather than falling back to the library's defaults. Place it alone on the
|
|
152
|
+
guideline: "The whole of the account's root page: it replaces the current history entry with the first section of the merchant's list that stays in the account, skipping one marked external, one whose destination was refused or is not site-relative, and the root itself. It shows the access gate's loading look until the section opens. A list with no such section leaves the root terminal — no navigation, and the no-section message in its place — rather than falling back to the library's defaults. Place it alone on the account page, inside AccountMenuRoot and under AccountAccessGate, which the my-account layout provides; never on a section's own page, which it would navigate away from."
|
|
149
153
|
});
|
|
150
154
|
const AccountMenuSignOutDefinition = defineComponent({
|
|
151
155
|
name: "AccountMenuSignOut",
|
|
@@ -174,34 +178,44 @@ const AccountMenuSignOutDefinition = defineComponent({
|
|
|
174
178
|
/**
|
|
175
179
|
* The library's default set, the five sections the PRD names. Labels are English as an interim, until
|
|
176
180
|
* the Localization cluster's catalog resolves them per locale. Their destinations only resolve in a
|
|
177
|
-
* store that
|
|
181
|
+
* store that declares the five standard pages.
|
|
178
182
|
*/
|
|
179
183
|
const DEFAULT_SECTIONS = [
|
|
180
184
|
{
|
|
181
185
|
label: "Profile",
|
|
182
|
-
href: "
|
|
186
|
+
href: { standard: "profile" }
|
|
183
187
|
},
|
|
184
188
|
{
|
|
185
189
|
label: "Orders",
|
|
186
|
-
href: "
|
|
190
|
+
href: { standard: "orders" }
|
|
187
191
|
},
|
|
188
192
|
{
|
|
189
193
|
label: "Address",
|
|
190
|
-
href: "
|
|
194
|
+
href: { standard: "address" }
|
|
191
195
|
},
|
|
192
196
|
{
|
|
193
197
|
label: "Payments",
|
|
194
|
-
href: "
|
|
198
|
+
href: { standard: "payments" }
|
|
195
199
|
},
|
|
196
200
|
{
|
|
197
201
|
label: "Security",
|
|
198
|
-
href: "
|
|
202
|
+
href: { standard: "security" }
|
|
199
203
|
}
|
|
200
204
|
];
|
|
205
|
+
const HOME_PAGE = { standard: "home" };
|
|
201
206
|
function resolveSections(sections) {
|
|
202
207
|
const resolved = [];
|
|
203
208
|
sections.forEach((section, index) => {
|
|
204
209
|
if (section.label.trim().length === 0) return;
|
|
210
|
+
const external = section.external ?? false;
|
|
211
|
+
if (typeof section.href !== "string") {
|
|
212
|
+
resolved.push({
|
|
213
|
+
label: section.label,
|
|
214
|
+
href: section.href,
|
|
215
|
+
external
|
|
216
|
+
});
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
205
219
|
const destination = resolveSafeHref(section.href);
|
|
206
220
|
if (!destination.safe) console.warn("[AccountMenu] section destination rejected", {
|
|
207
221
|
index,
|
|
@@ -210,7 +224,7 @@ function resolveSections(sections) {
|
|
|
210
224
|
resolved.push({
|
|
211
225
|
label: section.label,
|
|
212
226
|
href: destination.safe ? destination.href : null,
|
|
213
|
-
external
|
|
227
|
+
external
|
|
214
228
|
});
|
|
215
229
|
});
|
|
216
230
|
return resolved;
|
|
@@ -222,18 +236,33 @@ function normalizePath(value) {
|
|
|
222
236
|
return trimmed.length === 0 ? "/" : trimmed;
|
|
223
237
|
}
|
|
224
238
|
/**
|
|
239
|
+
* The section's path inside the current binding, compared against the route's logical path: a
|
|
240
|
+
* reference resolved without the base path, or an authored site-relative string as written. The menu
|
|
241
|
+
* renders in a layout, outside the page's route marker, so the path is all it can compare. `null` for
|
|
242
|
+
* an external section, a refused or absolute destination, and a reference that does not resolve: none
|
|
243
|
+
* of them is a path of the account.
|
|
244
|
+
*/
|
|
245
|
+
function logicalPathOf(section, bindingId, routeMap) {
|
|
246
|
+
if (section.external || section.href === null) return null;
|
|
247
|
+
if (typeof section.href === "string") return resolveSiteRelativeHref(section.href).safe ? section.href : null;
|
|
248
|
+
return resolveStorefrontHref({
|
|
249
|
+
bindingId,
|
|
250
|
+
basePath: "/"
|
|
251
|
+
}, routeMap, section.href).href;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
225
254
|
* The current section, matched on segment boundaries. Legacy matched by prefix and marked every
|
|
226
255
|
* section whose path was a prefix of the current one; the longest match wins here, which keeps
|
|
227
256
|
* exactly one section current and makes an exact match beat every ancestor without a second rule.
|
|
228
257
|
*/
|
|
229
|
-
function findCurrent(sections,
|
|
230
|
-
|
|
231
|
-
const path = normalizePath(pathname);
|
|
258
|
+
function findCurrent(sections, logicalPath, bindingId, routeMap) {
|
|
259
|
+
const path = normalizePath(logicalPath);
|
|
232
260
|
let current = null;
|
|
233
261
|
let matchedLength = -1;
|
|
234
262
|
for (const [index, section] of sections.entries()) {
|
|
235
|
-
|
|
236
|
-
|
|
263
|
+
const sectionPath = logicalPathOf(section, bindingId, routeMap);
|
|
264
|
+
if (sectionPath === null) continue;
|
|
265
|
+
const href = normalizePath(sectionPath);
|
|
237
266
|
if (href.length <= matchedLength) continue;
|
|
238
267
|
const exact = path === href;
|
|
239
268
|
const ancestor = href !== "/" && path.startsWith(`${href}/`);
|
|
@@ -252,12 +281,13 @@ function findCurrent(sections, pathname) {
|
|
|
252
281
|
* flag — the same site-relative reading `findCurrent` applies. The page itself is skipped too, in every
|
|
253
282
|
* spelling that matches it, since replacing it with itself would leave the loading look up for good.
|
|
254
283
|
*/
|
|
255
|
-
function findIndexDestination(sections, current) {
|
|
256
|
-
const here = current?.match === "exact" ? sections[current.index]
|
|
257
|
-
const herePath = here ?
|
|
284
|
+
function findIndexDestination(sections, current, bindingId, routeMap) {
|
|
285
|
+
const here = current?.match === "exact" ? sections[current.index] : void 0;
|
|
286
|
+
const herePath = here ? logicalPathOf(here, bindingId, routeMap) : null;
|
|
287
|
+
const hereNormalized = herePath === null ? null : normalizePath(herePath);
|
|
258
288
|
for (const section of sections) {
|
|
259
|
-
|
|
260
|
-
if (
|
|
289
|
+
const sectionPath = logicalPathOf(section, bindingId, routeMap);
|
|
290
|
+
if (section.href === null || sectionPath === null || normalizePath(sectionPath) === hereNormalized) continue;
|
|
261
291
|
return section.href;
|
|
262
292
|
}
|
|
263
293
|
return null;
|
|
@@ -282,15 +312,22 @@ function useAccountMenu() {
|
|
|
282
312
|
return value;
|
|
283
313
|
}
|
|
284
314
|
function AccountMenuRoot({ items, $content, className, children, ...props }) {
|
|
285
|
-
const
|
|
315
|
+
const { path } = useStorefrontRoute();
|
|
316
|
+
const { bindingId } = useStorefrontContext();
|
|
317
|
+
const { routeMap } = useRouteMap();
|
|
286
318
|
const sections = $content?.items ?? items ?? DEFAULT_SECTIONS;
|
|
287
319
|
const value = useMemo(() => {
|
|
288
320
|
const resolved = resolveSections(sections);
|
|
289
321
|
return {
|
|
290
322
|
items: resolved,
|
|
291
|
-
current: findCurrent(resolved,
|
|
323
|
+
current: findCurrent(resolved, path, bindingId, routeMap)
|
|
292
324
|
};
|
|
293
|
-
}, [
|
|
325
|
+
}, [
|
|
326
|
+
sections,
|
|
327
|
+
path,
|
|
328
|
+
bindingId,
|
|
329
|
+
routeMap
|
|
330
|
+
]);
|
|
294
331
|
return /* @__PURE__ */ jsx(AccountMenuContext, {
|
|
295
332
|
value,
|
|
296
333
|
children: /* @__PURE__ */ jsx("div", {
|
|
@@ -347,14 +384,16 @@ function AccountMenuList({ label = "Account", className, ...props }) {
|
|
|
347
384
|
}
|
|
348
385
|
function AccountMenuIndexRedirect({ loadingLabel, emptyMessage = "No account section is configured.", $content, className }) {
|
|
349
386
|
const { items, current } = useAccountMenu();
|
|
350
|
-
const
|
|
387
|
+
const { bindingId } = useStorefrontContext();
|
|
388
|
+
const { routeMap } = useRouteMap();
|
|
389
|
+
const { replace } = useStorefrontNavigation();
|
|
351
390
|
const replacedRef = useRef(false);
|
|
352
|
-
const destination = findIndexDestination(items, current);
|
|
391
|
+
const destination = findIndexDestination(items, current, bindingId, routeMap);
|
|
353
392
|
useEffect(() => {
|
|
354
393
|
if (destination === null || replacedRef.current) return;
|
|
355
394
|
replacedRef.current = true;
|
|
356
|
-
|
|
357
|
-
}, [destination,
|
|
395
|
+
replace(destination);
|
|
396
|
+
}, [destination, replace]);
|
|
358
397
|
const entryLoadingLabel = $content?.loadingLabel?.trim() ? $content.loadingLabel : loadingLabel;
|
|
359
398
|
const entryEmptyMessage = $content?.emptyMessage?.trim() ? $content.emptyMessage : emptyMessage;
|
|
360
399
|
if (destination === null) return /* @__PURE__ */ jsx("p", {
|
|
@@ -390,6 +429,8 @@ async function logOut(logout) {
|
|
|
390
429
|
}
|
|
391
430
|
function AccountMenuSignOut({ label, errorMessage, $content, $actions: $actionsProp, className }) {
|
|
392
431
|
const $actions = useActionsOverride($actionsProp);
|
|
432
|
+
const { hrefFor } = useStorefrontNavigation();
|
|
433
|
+
const { basePath } = useStorefrontContext();
|
|
393
434
|
const signingOut = useSignOutIntent();
|
|
394
435
|
const failed = useSignOutFailure();
|
|
395
436
|
const attemptingRef = useRef(false);
|
|
@@ -399,7 +440,7 @@ function AccountMenuSignOut({ label, errorMessage, $content, $actions: $actionsP
|
|
|
399
440
|
clearSignOutFailure();
|
|
400
441
|
declareSignOutIntent();
|
|
401
442
|
if (await logOut($actions?.session?.logout)) {
|
|
402
|
-
globalThis.location.assign(
|
|
443
|
+
globalThis.location.assign(hrefFor(HOME_PAGE) ?? basePath);
|
|
403
444
|
return;
|
|
404
445
|
}
|
|
405
446
|
attemptingRef.current = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-menu.js","names":[],"sources":["../../../src/matter/account-menu/account-menu.tsx"],"sourcesContent":["'use client';\n\nimport { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport { usePathname, useRouter } from 'next/navigation';\nimport {\n type ComponentPropsWithRef,\n createContext,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n} from 'react';\nimport { NavigationLink } from '../../particles/navigation-link/navigation-link.js';\nimport { useActionsOverride } from '../../sdk/actions/actions-override-context.js';\nimport type { ComponentActions } from '../../sdk/actions/types.js';\nimport type { SessionActions } from '../../sdk/session/use-session-actions.js';\nimport { resolveSafeHref, resolveSiteRelativeHref } from '../../utils/safe-href.js';\nimport { AccountAccessGateLoading } from '../account-access-gate/account-access-gate.js';\nimport {\n declareSignOutIntent,\n useSignOutIntent,\n withdrawSignOutIntent,\n} from '../account-access-gate/sign-out-intent.js';\nimport { clearSignOutFailure, reportSignOutFailure, useSignOutFailure } from './sign-out-failure.js';\n\n// The scroll has to land before paint, or the list shows its top for a frame and then jumps.\n// `useEffect` on the server silences React 19's \"useLayoutEffect does nothing on the server\", as\n// `matter/variant-selector` does for its own pre-paint measurement.\nconst useIsomorphicLayoutEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect;\n\n// ---------------------------------------------------------------------------\n// Content model\n// ---------------------------------------------------------------------------\n\nexport const AccountMenuContent = defineContentType({\n id: 'account-menu',\n title: 'Account Menu',\n description: \"The ordered list of the account's sections, editable without a deployment.\",\n schema: {\n type: 'object',\n additionalProperties: false,\n // `items` is not required, for the reason NavigationLinkList records: a missing element key\n // already omits the component, so requiring it would only cost the prop fallback its shape\n // validity.\n properties: {\n items: {\n type: 'array',\n title: 'Sections',\n minItems: 1,\n items: {\n type: 'object',\n additionalProperties: false,\n required: ['label', 'href'],\n properties: {\n label: { type: 'string', minLength: 1, title: 'Label' },\n href: {\n type: 'string',\n minLength: 1,\n title: 'URL',\n format: 'uri-reference',\n // Author-time guidance only, and lookahead-free so the Admin's RE2-family engine takes it.\n pattern: '^(?:https?://.*|mailto:.+|tel:.+|/(?:[^/].*)?)$',\n },\n external: { type: 'boolean', title: 'Leaves the account' },\n },\n },\n },\n },\n },\n});\n\n// Nothing is required, following the gate's model: a slice missing a required property is shape-invalid,\n// which drops the whole element rather than the one field.\nexport const AccountMenuIndexRedirectContent = defineContentType({\n id: 'account-menu-index-redirect',\n title: 'Account Menu Index Redirect',\n description: \"What the account's root shows while it opens the first section, and when there is none to open.\",\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n loadingLabel: { type: 'string', minLength: 1, title: 'Loading announcement' },\n emptyMessage: { type: 'string', minLength: 1, title: 'No section message' },\n },\n },\n});\n\nexport const AccountMenuSignOutContent = defineContentType({\n id: 'account-menu-sign-out',\n title: 'Account Menu Sign Out',\n description: 'The sign-out control in the account sidebar, and what it says when signing out fails.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', minLength: 1, title: 'Sign-out label' },\n errorMessage: { type: 'string', minLength: 1, title: 'Sign-out failed message' },\n },\n },\n});\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\ntype AccountMenuContentValue = ContentValue<typeof AccountMenuContent>;\n\n/** One authored section. Derived from the model so the prop and content channels cannot drift. */\nexport type AccountMenuSection = NonNullable<AccountMenuContentValue['items']>[number];\n\n/** A section resolved for render. A null `href` is a destination the allowlist refused. */\nexport type AccountMenuResolvedSection = {\n label: string;\n href: string | null;\n external: boolean;\n};\n\nexport type AccountMenuCurrent = {\n /** Index into the resolved list. */\n index: number;\n /** `exact` when the path is the section; `ancestor` when the shopper is inside it. */\n match: 'exact' | 'ancestor';\n};\n\nexport type AccountMenuContextValue = {\n /** Resolved, in the merchant's order, with blank-label sections dropped. */\n items: readonly AccountMenuResolvedSection[];\n /** The current section, or null when the path matches none. */\n current: AccountMenuCurrent | null;\n};\n\nexport type AccountMenuRootProps = ComponentPropsWithRef<'div'> & {\n /** Authored fallback for the section list, used when no CMS entry supplies one. */\n items?: readonly AccountMenuSection[];\n /** Injected by the compiler, sliced from the page's or layout's composite content entry. */\n $content?: AccountMenuContentValue;\n};\n\n/** The landmark renders one item per section, so it takes no children. */\nexport type AccountMenuListProps = Omit<ComponentPropsWithRef<'nav'>, 'children'> & {\n /** Accessible name of the navigation landmark. */\n label?: string;\n};\n\n/** It renders the gate's loading look or a message, so it forwards no element props beyond a class. */\nexport type AccountMenuIndexRedirectProps = {\n /** Text announced while the first section opens. */\n loadingLabel?: string;\n /** What the root says when the list holds no section to open. */\n emptyMessage?: string;\n /** Merchant-authored copy, sliced from the page content entry; wins over the props field by field. */\n $content?: ContentValue<typeof AccountMenuIndexRedirectContent>;\n className?: string;\n};\n\nexport type AccountMenuSignOutProps = {\n /** The control's text. */\n label?: string;\n /** What the shopper is told when the sign-out did not happen. */\n errorMessage?: string;\n /** Merchant-authored copy, sliced from the layout content entry; wins over the props field by field. */\n $content?: ContentValue<typeof AccountMenuSignOutContent>;\n /** Injected by the compiler from the definition's `actions`. */\n $actions?: ComponentActions;\n className?: string;\n};\n\n// ---------------------------------------------------------------------------\n// Definitions\n// ---------------------------------------------------------------------------\n\nexport const AccountMenuRootDefinition = defineComponent<AccountMenuRootProps>({\n name: 'AccountMenuRoot',\n importPath: '@vtex/faststore/components',\n component: AccountMenuRoot,\n content: AccountMenuContent,\n providesContext: 'account-menu',\n editor: { label: 'Account Menu Root', category: 'navigation' },\n schema: {\n items: { type: 'array', label: 'Sections' },\n },\n guideline:\n \"The account menu's provider, and deliberately not its landmark: it resolves the section list, derives which section the shopper is reading, publishes both, and renders its children. Compose it in the my-account layout around both AccountMenuList and the Slot holding the section's own page — its context has to reach the consumers inside the slot, and a nav stretched that far would announce every section's content as navigation. The list comes from a published entry, else the authored items prop, else the library's five defaults; a channel supplying an empty list resolves to empty rather than falling through, because a merchant who cleared the list cleared it. Style it through data-fs-account-menu.\",\n});\n\nexport const AccountMenuListDefinition = defineComponent<AccountMenuListProps>({\n name: 'AccountMenuList',\n importPath: '@vtex/faststore/components',\n component: AccountMenuList,\n requiresContext: 'account-menu',\n editor: { label: 'Account Menu List', category: 'navigation' },\n schema: {\n label: { type: 'string', default: 'Account', label: 'Aria Label' },\n },\n guideline:\n \"The account menu's navigation landmark and its items, and nothing else — it surrounds the items alone so the section's own content stays outside the navigation region. Author the label: a landmark with no accessible name is one a screen-reader user cannot tell from any other. The current section carries aria-current, page for the section itself and true for a page inside it, with data-fs-account-menu-item-current beside it as a style target and never as the only signal. When the list scrolls, the current item is brought into view on mount and on every route change. Must be a descendant of AccountMenuRoot.\",\n});\n\nexport const AccountMenuIndexRedirectDefinition = defineComponent<AccountMenuIndexRedirectProps>({\n name: 'AccountMenuIndexRedirect',\n importPath: '@vtex/faststore/components',\n component: AccountMenuIndexRedirect,\n content: AccountMenuIndexRedirectContent,\n requiresContext: 'account-menu',\n editor: { label: 'Account Menu Index Redirect', category: 'navigation' },\n schema: {\n // Mirrored from the content model on purpose, as every content-bearing component in the library\n // does: the entry wins when published, and this is what a store without a CMS authors.\n loadingLabel: { type: 'string', label: 'Loading Announcement' },\n emptyMessage: { type: 'string', default: 'No account section is configured.', label: 'No Section Message' },\n },\n guideline:\n \"The whole of the account's root page: it replaces the current history entry with the first section of the merchant's list that stays in the account, skipping one marked external, one whose destination was refused or is not site-relative, and the root itself. It shows the access gate's loading look until the section opens. A list with no such section leaves the root terminal — no navigation, and the no-section message in its place — rather than falling back to the library's defaults. Place it alone on the /pvt/account page, inside AccountMenuRoot and under AccountAccessGate, which the my-account layout provides; never on a section's own page, which it would navigate away from.\",\n});\n\nexport const AccountMenuSignOutDefinition = defineComponent<AccountMenuSignOutProps>({\n name: 'AccountMenuSignOut',\n importPath: '@vtex/faststore/components',\n component: AccountMenuSignOut,\n content: AccountMenuSignOutContent,\n actions: { session: ['logout'] },\n editor: { label: 'Account Menu Sign Out', category: 'navigation' },\n schema: {\n label: { type: 'string', default: 'Sign out', label: 'Label' },\n errorMessage: {\n type: 'string',\n default: \"We couldn't sign you out. Please try again.\",\n label: 'Sign-out Failed Message',\n },\n },\n guideline:\n \"The account sidebar's way out: it dispatches $actions.session.logout, tells AccountAccessGate the departure is deliberate so the gate stands down instead of sending the shopper to sign in, and then loads the storefront home as a new document, which is what keeps the account out of the client router's cache. A logout that reports an error keeps the shopper on the account page with the failure message rather than landing a still-signed-in shopper on the home page. Compose it inside AccountMenuRoot beside AccountMenuList, under the gate the my-account layout provides — the back-forward cache is the gate's to revalidate, not this control's.\",\n});\n\n// ---------------------------------------------------------------------------\n// Resolution\n// ---------------------------------------------------------------------------\n\n/**\n * The library's default set, the five sections the PRD names. Labels are English as an interim, until\n * the Localization cluster's catalog resolves them per locale. Their destinations only resolve in a\n * store that authored the account's route family.\n */\nconst DEFAULT_SECTIONS: readonly AccountMenuSection[] = [\n { label: 'Profile', href: '/pvt/profile' },\n { label: 'Orders', href: '/pvt/orders' },\n { label: 'Address', href: '/pvt/address' },\n { label: 'Payments', href: '/pvt/payments' },\n { label: 'Security', href: '/pvt/security' },\n];\n\nfunction resolveSections(sections: readonly AccountMenuSection[]): AccountMenuResolvedSection[] {\n const resolved: AccountMenuResolvedSection[] = [];\n\n sections.forEach((section, index) => {\n // `minLength` is enforced by neither the runtime slice nor the preflight, so a blank label\n // reaches the component. Drop the section: an anchor with no accessible name is a WCAG failure.\n if (section.label.trim().length === 0) {\n return;\n }\n const destination = resolveSafeHref(section.href);\n if (!destination.safe) {\n console.warn('[AccountMenu] section destination rejected', { index, reason: destination.reason });\n }\n resolved.push({\n label: section.label,\n href: destination.safe ? destination.href : null,\n external: section.external ?? false,\n });\n });\n\n return resolved;\n}\n\n/** What a match runs against: no query, no hash, and no trailing slash except at the root. */\nfunction normalizePath(value: string): string {\n const separator = value.search(/[?#]/);\n const path = separator === -1 ? value : value.slice(0, separator);\n const trimmed = path.replace(/\\/+$/, '');\n return trimmed.length === 0 ? '/' : trimmed;\n}\n\n/**\n * The current section, matched on segment boundaries. Legacy matched by prefix and marked every\n * section whose path was a prefix of the current one; the longest match wins here, which keeps\n * exactly one section current and makes an exact match beat every ancestor without a second rule.\n */\nfunction findCurrent(\n sections: readonly AccountMenuResolvedSection[],\n pathname: string | null,\n): AccountMenuCurrent | null {\n if (pathname === null) {\n return null;\n }\n\n const path = normalizePath(pathname);\n let current: AccountMenuCurrent | null = null;\n let matchedLength = -1;\n\n for (const [index, section] of sections.entries()) {\n // An external section leaves the account and is outside the current-section contract, and an\n // absolute destination could never be a path in the first place.\n if (section.external || section.href === null || !resolveSiteRelativeHref(section.href).safe) {\n continue;\n }\n const href = normalizePath(section.href);\n if (href.length <= matchedLength) {\n continue;\n }\n // A root href is an ancestor of every account path, so a merchant listing the storefront's home\n // beside the sections would otherwise see it current on every page. It matches exactly or not at all.\n const exact = path === href;\n const ancestor = href !== '/' && path.startsWith(`${href}/`);\n if (!exact && !ancestor) {\n continue;\n }\n current = { index, match: exact ? 'exact' : 'ancestor' };\n matchedLength = href.length;\n }\n\n return current;\n}\n\n/**\n * Where the account's root opens: the first section that stays in the account. An external entry would\n * eject the shopper from the account they just opened, and so would an absolute one the merchant did not\n * flag — the same site-relative reading `findCurrent` applies. The page itself is skipped too, in every\n * spelling that matches it, since replacing it with itself would leave the loading look up for good.\n */\nfunction findIndexDestination(\n sections: readonly AccountMenuResolvedSection[],\n current: AccountMenuCurrent | null,\n): string | null {\n const here = current?.match === 'exact' ? sections[current.index]?.href : null;\n const herePath = here ? normalizePath(here) : null;\n\n for (const section of sections) {\n if (section.external || section.href === null || !resolveSiteRelativeHref(section.href).safe) {\n continue;\n }\n if (normalizePath(section.href) === herePath) {\n continue;\n }\n return section.href;\n }\n\n return null;\n}\n\n/**\n * `page` for the section itself, `true` for a page inside it. The distinction is kept rather than\n * collapsed because the sibling breadcrumb names the deep page as the current one, and two surfaces\n * announcing \"current page\" for two different things is worse than the menu claiming only its set.\n */\nfunction ariaCurrentFor(match: AccountMenuCurrent['match']): 'page' | 'true' {\n return match === 'exact' ? 'page' : 'true';\n}\n\nfunction overflows(element: Element | null | undefined): boolean {\n if (!element) {\n return false;\n }\n return element.scrollWidth > element.clientWidth || element.scrollHeight > element.clientHeight;\n}\n\n// ---------------------------------------------------------------------------\n// Context\n// ---------------------------------------------------------------------------\n\nconst AccountMenuContext = createContext<AccountMenuContextValue | null>(null);\n\n/** The resolved section list and the current section. */\nexport function useAccountMenu(): AccountMenuContextValue {\n const value = useContext(AccountMenuContext);\n if (!value) {\n throw new Error('AccountMenu parts must be used inside AccountMenuRoot.');\n }\n return value;\n}\n\n// ---------------------------------------------------------------------------\n// Implementations\n// ---------------------------------------------------------------------------\n\nexport function AccountMenuRoot({ items, $content, className, children, ...props }: AccountMenuRootProps) {\n const pathname = usePathname();\n // Presence decides, not truthiness: a channel supplying an empty list resolves to empty rather than\n // falling through, so the defaults never override a list the merchant published deliberately.\n // `minItems` guides the Admin form only, so that empty list still reaches this component.\n const sections = $content?.items ?? items ?? DEFAULT_SECTIONS;\n\n const value = useMemo<AccountMenuContextValue>(() => {\n const resolved = resolveSections(sections);\n return { items: resolved, current: findCurrent(resolved, pathname) };\n }, [sections, pathname]);\n\n return (\n <AccountMenuContext value={value}>\n <div {...props} className={className} data-fs-account-menu=\"\">\n {children}\n </div>\n </AccountMenuContext>\n );\n}\n\nexport function AccountMenuList({ label = 'Account', className, ...props }: AccountMenuListProps) {\n const { items, current } = useAccountMenu();\n const currentRef = useRef<HTMLLIElement>(null);\n const currentIndex = current?.index ?? null;\n\n useIsomorphicLayoutEffect(() => {\n if (currentIndex === null) {\n return;\n }\n const item = currentRef.current;\n if (!item || typeof item.scrollIntoView !== 'function') {\n return;\n }\n // Only when the row actually scrolls. An unconditional call scrolls whatever ancestor can move,\n // which on a menu that fits is the page. The containers are the item's `ul` and its `nav`.\n const list = item.parentElement;\n if (!overflows(list) && !overflows(list?.parentElement)) {\n return;\n }\n // `nearest` on both axes is a no-op once the item is visible, so a route change inside the\n // current section does not jolt the row.\n item.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }, [currentIndex]);\n\n if (items.length === 0) {\n return null;\n }\n\n return (\n <nav {...props} aria-label={label} className={className} data-fs-account-menu-list=\"\">\n <ul data-fs-account-menu-items=\"\">\n {items.map((item, index) => {\n const isCurrent = index === currentIndex;\n return (\n <li\n key={index}\n ref={isCurrent ? currentRef : null}\n data-fs-account-menu-item=\"\"\n data-fs-account-menu-item-current={isCurrent ? '' : undefined}\n >\n {item.href === null ? (\n <span data-fs-text=\"\" data-fs-account-menu-text=\"\">\n {item.label}\n </span>\n ) : (\n <NavigationLink\n href={item.href}\n aria-current={current && isCurrent ? ariaCurrentFor(current.match) : undefined}\n data-fs-account-menu-link=\"\"\n >\n {item.label}\n </NavigationLink>\n )}\n </li>\n );\n })}\n </ul>\n </nav>\n );\n}\n\nexport function AccountMenuIndexRedirect({\n loadingLabel,\n emptyMessage = 'No account section is configured.',\n $content,\n className,\n}: Readonly<AccountMenuIndexRedirectProps>) {\n const { items, current } = useAccountMenu();\n const router = useRouter();\n // StrictMode runs an effect twice, and a router whose identity changes per render re-runs it on every\n // pass; one replace is the whole of this part's job.\n const replacedRef = useRef(false);\n\n const destination = findIndexDestination(items, current);\n\n useEffect(() => {\n if (destination === null || replacedRef.current) {\n return;\n }\n replacedRef.current = true;\n // Replace rather than push, so back from the section leaves the account instead of bouncing through\n // its root.\n // react-doctor-disable-next-line nextjs-no-client-side-redirect -- the order is the merchant's, published at runtime, so no static redirect can express it\n router.replace(destination);\n }, [destination, router]);\n\n // Blank entry fields fall through, so clearing one in the Admin reads as unauthored.\n const entryLoadingLabel = $content?.loadingLabel?.trim() ? $content.loadingLabel : loadingLabel;\n const entryEmptyMessage = $content?.emptyMessage?.trim() ? $content.emptyMessage : emptyMessage;\n\n if (destination === null) {\n return (\n <p className={className} data-fs-account-menu-index-redirect=\"\" data-fs-account-menu-index-redirect-empty=\"\">\n {entryEmptyMessage}\n </p>\n );\n }\n\n // The gate's own part rather than one of this part's: in the account layout the gate's wait for the\n // session comes first, and carrying the same look on until the section lands is what keeps a second\n // one from flashing between the two.\n return (\n <AccountAccessGateLoading className={className} data-fs-account-menu-index-redirect=\"\">\n {entryLoadingLabel}\n </AccountAccessGateLoading>\n );\n}\n\nconst DEFAULT_SIGN_OUT_LABEL = 'Sign out';\nconst DEFAULT_SIGN_OUT_ERROR = \"We couldn't sign you out. Please try again.\";\n\n/**\n * The first non-blank of the given values. The models' `minLength` is enforced by neither the runtime\n * slice nor the preflight, and a blank here is a nameless button or a silent failure.\n */\nfunction firstAuthored(...values: (string | undefined)[]): string | undefined {\n return values.find((value) => value?.trim());\n}\n\n/** An absent handler or a rejection is a sign-out that did not happen, never one that did. */\nasync function logOut(logout: SessionActions['logout'] | undefined): Promise<boolean> {\n if (!logout) {\n return false;\n }\n try {\n const errors = await logout();\n return errors.length === 0;\n } catch (error) {\n console.error('[AccountMenuSignOut] logout rejected', error);\n return false;\n }\n}\n\nexport function AccountMenuSignOut({\n label,\n errorMessage,\n $content,\n $actions: $actionsProp,\n className,\n}: Readonly<AccountMenuSignOutProps>) {\n const $actions = useActionsOverride($actionsProp);\n // Any standing intent, whichever control declared it, is a sign-out under way.\n const signingOut = useSignOutIntent();\n const failed = useSignOutFailure();\n // Two activations in the same task see the same render, so the disabled button alone cannot stop\n // the second one.\n const attemptingRef = useRef(false);\n\n async function handleClick() {\n if (attemptingRef.current) {\n return;\n }\n attemptingRef.current = true;\n clearSignOutFailure();\n // Before the await: the logout payload flips the session in place, and a gate that got its turn\n // between the response and the navigation would send the shopper to sign in for the account they\n // just left. From here on this control is unmounted under the gate; the handler still settles.\n declareSignOutIntent();\n\n if (await logOut($actions?.session?.logout)) {\n // A document load rather than the router, whose cache would keep the account behind the back\n // control. What the browser's back-forward cache restores is the gate's to revalidate.\n globalThis.location.assign('/');\n return;\n }\n\n attemptingRef.current = false;\n reportSignOutFailure();\n withdrawSignOutIntent();\n }\n\n const entryLabel = firstAuthored($content?.label, label) ?? DEFAULT_SIGN_OUT_LABEL;\n const entryErrorMessage = firstAuthored($content?.errorMessage, errorMessage) ?? DEFAULT_SIGN_OUT_ERROR;\n\n return (\n <div\n className={className}\n data-fs-account-menu-sign-out=\"\"\n data-fs-account-menu-sign-out-pending={signingOut ? '' : undefined}\n >\n <button\n type=\"button\"\n onClick={handleClick}\n disabled={signingOut}\n aria-busy={signingOut || undefined}\n data-fs-account-menu-sign-out-button=\"\"\n >\n {entryLabel}\n </button>\n {failed ? (\n <p role=\"alert\" data-fs-account-menu-sign-out-error=\"\">\n {entryErrorMessage}\n </p>\n ) : null}\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Namespace export\n// ---------------------------------------------------------------------------\n\nexport const AccountMenu = {\n Root: AccountMenuRoot,\n List: AccountMenuList,\n IndexRedirect: AccountMenuIndexRedirect,\n SignOut: AccountMenuSignOut,\n};\n"],"mappings":";;;;;;;;;;;;;;AA6BA,MAAM,4BAA4B,OAAO,WAAW,cAAc,YAAY;AAM9E,MAAa,qBAAqB,kBAAkB;CAClD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EAItB,YAAY,EACV,OAAO;GACL,MAAM;GACN,OAAO;GACP,UAAU;GACV,OAAO;IACL,MAAM;IACN,sBAAsB;IACtB,UAAU,CAAC,SAAS,MAAM;IAC1B,YAAY;KACV,OAAO;MAAE,MAAM;MAAU,WAAW;MAAG,OAAO;KAAQ;KACtD,MAAM;MACJ,MAAM;MACN,WAAW;MACX,OAAO;MACP,QAAQ;MAER,SAAS;KACX;KACA,UAAU;MAAE,MAAM;MAAW,OAAO;KAAqB;IAC3D;GACF;EACF,EACF;CACF;AACF,CAAC;AAID,MAAa,kCAAkC,kBAAkB;CAC/D,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY;GACV,cAAc;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAuB;GAC5E,cAAc;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAqB;EAC5E;CACF;AACF,CAAC;AAED,MAAa,4BAA4B,kBAAkB;CACzD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY;GACV,OAAO;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAiB;GAC/D,cAAc;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAA0B;EACj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UAAD;GACE,MAAK;GACL,SAAS;GACT,UAAU;GACV,aAAW,cAAc,KAAA;GACzB,wCAAqC;GAEpC,UAAA;EACK,CAAA,GACP,SACC,oBAAC,KAAD;GAAG,MAAK;GAAQ,uCAAoC;GACjD,UAAA;EACA,CAAA,IACD,IACD;;AAET;AAMA,MAAa,cAAc;CACzB,MAAM;CACN,MAAM;CACN,eAAe;CACf,SAAS;AACX"}
|
|
1
|
+
{"version":3,"file":"account-menu.js","names":[],"sources":["../../../src/matter/account-menu/account-menu.tsx"],"sourcesContent":["'use client';\n\nimport { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport {\n type ComponentPropsWithRef,\n createContext,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n} from 'react';\nimport { NavigationLink } from '../../particles/navigation-link/navigation-link.js';\nimport { useActionsOverride } from '../../sdk/actions/actions-override-context.js';\nimport type { ComponentActions } from '../../sdk/actions/types.js';\nimport { useStorefrontContext } from '../../sdk/context/storefront-context.js';\nimport { resolveStorefrontHref } from '../../sdk/navigation/resolve-storefront-href.js';\nimport { useRouteMap } from '../../sdk/navigation/route-map-provider.js';\nimport type { PageRef, RouteMap } from '../../sdk/navigation/types.js';\nimport { useStorefrontNavigation } from '../../sdk/navigation/use-storefront-navigation.js';\nimport { useStorefrontRoute } from '../../sdk/navigation/use-storefront-route.js';\nimport type { SessionActions } from '../../sdk/session/use-session-actions.js';\nimport { resolveSafeHref, resolveSiteRelativeHref } from '../../utils/safe-href.js';\nimport { AccountAccessGateLoading } from '../account-access-gate/account-access-gate.js';\nimport {\n declareSignOutIntent,\n useSignOutIntent,\n withdrawSignOutIntent,\n} from '../account-access-gate/sign-out-intent.js';\nimport { clearSignOutFailure, reportSignOutFailure, useSignOutFailure } from './sign-out-failure.js';\n\n// The scroll has to land before paint, or the list shows its top for a frame and then jumps.\n// `useEffect` on the server silences React 19's \"useLayoutEffect does nothing on the server\", as\n// `matter/variant-selector` does for its own pre-paint measurement.\nconst useIsomorphicLayoutEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect;\n\n// ---------------------------------------------------------------------------\n// Content model\n// ---------------------------------------------------------------------------\n\nexport const AccountMenuContent = defineContentType({\n id: 'account-menu',\n title: 'Account Menu',\n description: \"The ordered list of the account's sections, editable without a deployment.\",\n schema: {\n type: 'object',\n additionalProperties: false,\n // `items` is not required, for the reason NavigationLinkList records: a missing element key\n // already omits the component, so requiring it would only cost the prop fallback its shape\n // validity.\n properties: {\n items: {\n type: 'array',\n title: 'Sections',\n minItems: 1,\n items: {\n type: 'object',\n additionalProperties: false,\n required: ['label', 'href'],\n properties: {\n label: { type: 'string', minLength: 1, title: 'Label' },\n href: {\n type: 'string',\n minLength: 1,\n title: 'URL',\n format: 'uri-reference',\n // Author-time guidance only, and lookahead-free so the Admin's RE2-family engine takes it.\n pattern: '^(?:https?://.*|mailto:.+|tel:.+|/(?:[^/].*)?)$',\n },\n external: { type: 'boolean', title: 'Leaves the account' },\n },\n },\n },\n },\n },\n});\n\n// Nothing is required, following the gate's model: a slice missing a required property is shape-invalid,\n// which drops the whole element rather than the one field.\nexport const AccountMenuIndexRedirectContent = defineContentType({\n id: 'account-menu-index-redirect',\n title: 'Account Menu Index Redirect',\n description: \"What the account's root shows while it opens the first section, and when there is none to open.\",\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n loadingLabel: { type: 'string', minLength: 1, title: 'Loading announcement' },\n emptyMessage: { type: 'string', minLength: 1, title: 'No section message' },\n },\n },\n});\n\nexport const AccountMenuSignOutContent = defineContentType({\n id: 'account-menu-sign-out',\n title: 'Account Menu Sign Out',\n description: 'The sign-out control in the account sidebar, and what it says when signing out fails.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', minLength: 1, title: 'Sign-out label' },\n errorMessage: { type: 'string', minLength: 1, title: 'Sign-out failed message' },\n },\n },\n});\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\ntype AccountMenuContentValue = ContentValue<typeof AccountMenuContent>;\n\n/** One authored section. Derived from the model so the prop and content channels cannot drift; the prop\n * channel also takes a page reference. */\nexport type AccountMenuSection = Omit<NonNullable<AccountMenuContentValue['items']>[number], 'href'> & {\n href: PageRef | string;\n};\n\n/** A section resolved for render. A null `href` is a destination the allowlist refused. */\nexport type AccountMenuResolvedSection = {\n label: string;\n href: PageRef | string | null;\n external: boolean;\n};\n\nexport type AccountMenuCurrent = {\n /** Index into the resolved list. */\n index: number;\n /** `exact` when the path is the section; `ancestor` when the shopper is inside it. */\n match: 'exact' | 'ancestor';\n};\n\nexport type AccountMenuContextValue = {\n /** Resolved, in the merchant's order, with blank-label sections dropped. */\n items: readonly AccountMenuResolvedSection[];\n /** The current section, or null when the path matches none. */\n current: AccountMenuCurrent | null;\n};\n\nexport type AccountMenuRootProps = ComponentPropsWithRef<'div'> & {\n /** Authored fallback for the section list, used when no CMS entry supplies one. */\n items?: readonly AccountMenuSection[];\n /** Injected by the compiler, sliced from the page's or layout's composite content entry. */\n $content?: AccountMenuContentValue;\n};\n\n/** The landmark renders one item per section, so it takes no children. */\nexport type AccountMenuListProps = Omit<ComponentPropsWithRef<'nav'>, 'children'> & {\n /** Accessible name of the navigation landmark. */\n label?: string;\n};\n\n/** It renders the gate's loading look or a message, so it forwards no element props beyond a class. */\nexport type AccountMenuIndexRedirectProps = {\n /** Text announced while the first section opens. */\n loadingLabel?: string;\n /** What the root says when the list holds no section to open. */\n emptyMessage?: string;\n /** Merchant-authored copy, sliced from the page content entry; wins over the props field by field. */\n $content?: ContentValue<typeof AccountMenuIndexRedirectContent>;\n className?: string;\n};\n\nexport type AccountMenuSignOutProps = {\n /** The control's text. */\n label?: string;\n /** What the shopper is told when the sign-out did not happen. */\n errorMessage?: string;\n /** Merchant-authored copy, sliced from the layout content entry; wins over the props field by field. */\n $content?: ContentValue<typeof AccountMenuSignOutContent>;\n /** Injected by the compiler from the definition's `actions`. */\n $actions?: ComponentActions;\n className?: string;\n};\n\n// ---------------------------------------------------------------------------\n// Definitions\n// ---------------------------------------------------------------------------\n\nexport const AccountMenuRootDefinition = defineComponent<AccountMenuRootProps>({\n name: 'AccountMenuRoot',\n importPath: '@vtex/faststore/components',\n component: AccountMenuRoot,\n content: AccountMenuContent,\n providesContext: 'account-menu',\n editor: { label: 'Account Menu Root', category: 'navigation' },\n schema: {\n items: { type: 'array', label: 'Sections' },\n },\n guideline:\n \"The account menu's provider, and deliberately not its landmark: it resolves the section list, derives which section the shopper is reading, publishes both, and renders its children. Compose it in the my-account layout around both AccountMenuList and the Slot holding the section's own page — its context has to reach the consumers inside the slot, and a nav stretched that far would announce every section's content as navigation. The list comes from a published entry, else the authored items prop, else the library's five defaults; a channel supplying an empty list resolves to empty rather than falling through, because a merchant who cleared the list cleared it. Style it through data-fs-account-menu.\",\n});\n\nexport const AccountMenuListDefinition = defineComponent<AccountMenuListProps>({\n name: 'AccountMenuList',\n importPath: '@vtex/faststore/components',\n component: AccountMenuList,\n requiresContext: 'account-menu',\n editor: { label: 'Account Menu List', category: 'navigation' },\n schema: {\n label: { type: 'string', default: 'Account', label: 'Aria Label' },\n },\n guideline:\n \"The account menu's navigation landmark and its items, and nothing else — it surrounds the items alone so the section's own content stays outside the navigation region. Author the label: a landmark with no accessible name is one a screen-reader user cannot tell from any other. The current section carries aria-current, page for the section itself and true for a page inside it, with data-fs-account-menu-item-current beside it as a style target and never as the only signal. When the list scrolls, the current item is brought into view on mount and on every route change. Must be a descendant of AccountMenuRoot.\",\n});\n\nexport const AccountMenuIndexRedirectDefinition = defineComponent<AccountMenuIndexRedirectProps>({\n name: 'AccountMenuIndexRedirect',\n importPath: '@vtex/faststore/components',\n component: AccountMenuIndexRedirect,\n content: AccountMenuIndexRedirectContent,\n requiresContext: 'account-menu',\n editor: { label: 'Account Menu Index Redirect', category: 'navigation' },\n schema: {\n // Mirrored from the content model on purpose, as every content-bearing component in the library\n // does: the entry wins when published, and this is what a store without a CMS authors.\n loadingLabel: { type: 'string', label: 'Loading Announcement' },\n emptyMessage: { type: 'string', default: 'No account section is configured.', label: 'No Section Message' },\n },\n guideline:\n \"The whole of the account's root page: it replaces the current history entry with the first section of the merchant's list that stays in the account, skipping one marked external, one whose destination was refused or is not site-relative, and the root itself. It shows the access gate's loading look until the section opens. A list with no such section leaves the root terminal — no navigation, and the no-section message in its place — rather than falling back to the library's defaults. Place it alone on the account page, inside AccountMenuRoot and under AccountAccessGate, which the my-account layout provides; never on a section's own page, which it would navigate away from.\",\n});\n\nexport const AccountMenuSignOutDefinition = defineComponent<AccountMenuSignOutProps>({\n name: 'AccountMenuSignOut',\n importPath: '@vtex/faststore/components',\n component: AccountMenuSignOut,\n content: AccountMenuSignOutContent,\n actions: { session: ['logout'] },\n editor: { label: 'Account Menu Sign Out', category: 'navigation' },\n schema: {\n label: { type: 'string', default: 'Sign out', label: 'Label' },\n errorMessage: {\n type: 'string',\n default: \"We couldn't sign you out. Please try again.\",\n label: 'Sign-out Failed Message',\n },\n },\n guideline:\n \"The account sidebar's way out: it dispatches $actions.session.logout, tells AccountAccessGate the departure is deliberate so the gate stands down instead of sending the shopper to sign in, and then loads the storefront home as a new document, which is what keeps the account out of the client router's cache. A logout that reports an error keeps the shopper on the account page with the failure message rather than landing a still-signed-in shopper on the home page. Compose it inside AccountMenuRoot beside AccountMenuList, under the gate the my-account layout provides — the back-forward cache is the gate's to revalidate, not this control's.\",\n});\n\n// ---------------------------------------------------------------------------\n// Resolution\n// ---------------------------------------------------------------------------\n\n/**\n * The library's default set, the five sections the PRD names. Labels are English as an interim, until\n * the Localization cluster's catalog resolves them per locale. Their destinations only resolve in a\n * store that declares the five standard pages.\n */\nconst DEFAULT_SECTIONS: readonly AccountMenuSection[] = [\n { label: 'Profile', href: { standard: 'profile' } },\n { label: 'Orders', href: { standard: 'orders' } },\n { label: 'Address', href: { standard: 'address' } },\n { label: 'Payments', href: { standard: 'payments' } },\n { label: 'Security', href: { standard: 'security' } },\n];\n\nconst HOME_PAGE: PageRef = { standard: 'home' };\n\nfunction resolveSections(sections: readonly AccountMenuSection[]): AccountMenuResolvedSection[] {\n const resolved: AccountMenuResolvedSection[] = [];\n\n sections.forEach((section, index) => {\n // `minLength` is enforced by neither the runtime slice nor the preflight, so a blank label\n // reaches the component. Drop the section: an anchor with no accessible name is a WCAG failure.\n if (section.label.trim().length === 0) {\n return;\n }\n const external = section.external ?? false;\n // A page reference names a page of this store, so the allowlist has nothing to judge.\n if (typeof section.href !== 'string') {\n resolved.push({ label: section.label, href: section.href, external });\n return;\n }\n const destination = resolveSafeHref(section.href);\n if (!destination.safe) {\n console.warn('[AccountMenu] section destination rejected', { index, reason: destination.reason });\n }\n resolved.push({ label: section.label, href: destination.safe ? destination.href : null, external });\n });\n\n return resolved;\n}\n\n/** What a match runs against: no query, no hash, and no trailing slash except at the root. */\nfunction normalizePath(value: string): string {\n const separator = value.search(/[?#]/);\n const path = separator === -1 ? value : value.slice(0, separator);\n const trimmed = path.replace(/\\/+$/, '');\n return trimmed.length === 0 ? '/' : trimmed;\n}\n\n/**\n * The section's path inside the current binding, compared against the route's logical path: a\n * reference resolved without the base path, or an authored site-relative string as written. The menu\n * renders in a layout, outside the page's route marker, so the path is all it can compare. `null` for\n * an external section, a refused or absolute destination, and a reference that does not resolve: none\n * of them is a path of the account.\n */\nfunction logicalPathOf(section: AccountMenuResolvedSection, bindingId: string, routeMap: RouteMap): string | null {\n if (section.external || section.href === null) {\n return null;\n }\n if (typeof section.href === 'string') {\n return resolveSiteRelativeHref(section.href).safe ? section.href : null;\n }\n return resolveStorefrontHref({ bindingId, basePath: '/' }, routeMap, section.href).href;\n}\n\n/**\n * The current section, matched on segment boundaries. Legacy matched by prefix and marked every\n * section whose path was a prefix of the current one; the longest match wins here, which keeps\n * exactly one section current and makes an exact match beat every ancestor without a second rule.\n */\nfunction findCurrent(\n sections: readonly AccountMenuResolvedSection[],\n logicalPath: string,\n bindingId: string,\n routeMap: RouteMap,\n): AccountMenuCurrent | null {\n const path = normalizePath(logicalPath);\n let current: AccountMenuCurrent | null = null;\n let matchedLength = -1;\n\n for (const [index, section] of sections.entries()) {\n const sectionPath = logicalPathOf(section, bindingId, routeMap);\n if (sectionPath === null) {\n continue;\n }\n const href = normalizePath(sectionPath);\n if (href.length <= matchedLength) {\n continue;\n }\n // A root href is an ancestor of every account path, so a merchant listing the storefront's home\n // beside the sections would otherwise see it current on every page. It matches exactly or not at all.\n const exact = path === href;\n const ancestor = href !== '/' && path.startsWith(`${href}/`);\n if (!exact && !ancestor) {\n continue;\n }\n current = { index, match: exact ? 'exact' : 'ancestor' };\n matchedLength = href.length;\n }\n\n return current;\n}\n\n/**\n * Where the account's root opens: the first section that stays in the account. An external entry would\n * eject the shopper from the account they just opened, and so would an absolute one the merchant did not\n * flag — the same site-relative reading `findCurrent` applies. The page itself is skipped too, in every\n * spelling that matches it, since replacing it with itself would leave the loading look up for good.\n */\nfunction findIndexDestination(\n sections: readonly AccountMenuResolvedSection[],\n current: AccountMenuCurrent | null,\n bindingId: string,\n routeMap: RouteMap,\n): PageRef | string | null {\n const here = current?.match === 'exact' ? sections[current.index] : undefined;\n const herePath = here ? logicalPathOf(here, bindingId, routeMap) : null;\n const hereNormalized = herePath === null ? null : normalizePath(herePath);\n\n for (const section of sections) {\n const sectionPath = logicalPathOf(section, bindingId, routeMap);\n if (section.href === null || sectionPath === null || normalizePath(sectionPath) === hereNormalized) {\n continue;\n }\n return section.href;\n }\n\n return null;\n}\n\n/**\n * `page` for the section itself, `true` for a page inside it. The distinction is kept rather than\n * collapsed because the sibling breadcrumb names the deep page as the current one, and two surfaces\n * announcing \"current page\" for two different things is worse than the menu claiming only its set.\n */\nfunction ariaCurrentFor(match: AccountMenuCurrent['match']): 'page' | 'true' {\n return match === 'exact' ? 'page' : 'true';\n}\n\nfunction overflows(element: Element | null | undefined): boolean {\n if (!element) {\n return false;\n }\n return element.scrollWidth > element.clientWidth || element.scrollHeight > element.clientHeight;\n}\n\n// ---------------------------------------------------------------------------\n// Context\n// ---------------------------------------------------------------------------\n\nconst AccountMenuContext = createContext<AccountMenuContextValue | null>(null);\n\n/** The resolved section list and the current section. */\nexport function useAccountMenu(): AccountMenuContextValue {\n const value = useContext(AccountMenuContext);\n if (!value) {\n throw new Error('AccountMenu parts must be used inside AccountMenuRoot.');\n }\n return value;\n}\n\n// ---------------------------------------------------------------------------\n// Implementations\n// ---------------------------------------------------------------------------\n\nexport function AccountMenuRoot({ items, $content, className, children, ...props }: AccountMenuRootProps) {\n const { path } = useStorefrontRoute();\n const { bindingId } = useStorefrontContext();\n const { routeMap } = useRouteMap();\n // Presence decides, not truthiness: a channel supplying an empty list resolves to empty rather than\n // falling through, so the defaults never override a list the merchant published deliberately.\n // `minItems` guides the Admin form only, so that empty list still reaches this component.\n const sections = $content?.items ?? items ?? DEFAULT_SECTIONS;\n\n const value = useMemo<AccountMenuContextValue>(() => {\n const resolved = resolveSections(sections);\n return { items: resolved, current: findCurrent(resolved, path, bindingId, routeMap) };\n }, [sections, path, bindingId, routeMap]);\n\n return (\n <AccountMenuContext value={value}>\n <div {...props} className={className} data-fs-account-menu=\"\">\n {children}\n </div>\n </AccountMenuContext>\n );\n}\n\nexport function AccountMenuList({ label = 'Account', className, ...props }: AccountMenuListProps) {\n const { items, current } = useAccountMenu();\n const currentRef = useRef<HTMLLIElement>(null);\n const currentIndex = current?.index ?? null;\n\n useIsomorphicLayoutEffect(() => {\n if (currentIndex === null) {\n return;\n }\n const item = currentRef.current;\n if (!item || typeof item.scrollIntoView !== 'function') {\n return;\n }\n // Only when the row actually scrolls. An unconditional call scrolls whatever ancestor can move,\n // which on a menu that fits is the page. The containers are the item's `ul` and its `nav`.\n const list = item.parentElement;\n if (!overflows(list) && !overflows(list?.parentElement)) {\n return;\n }\n // `nearest` on both axes is a no-op once the item is visible, so a route change inside the\n // current section does not jolt the row.\n item.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }, [currentIndex]);\n\n if (items.length === 0) {\n return null;\n }\n\n return (\n <nav {...props} aria-label={label} className={className} data-fs-account-menu-list=\"\">\n <ul data-fs-account-menu-items=\"\">\n {items.map((item, index) => {\n const isCurrent = index === currentIndex;\n return (\n <li\n key={index}\n ref={isCurrent ? currentRef : null}\n data-fs-account-menu-item=\"\"\n data-fs-account-menu-item-current={isCurrent ? '' : undefined}\n >\n {item.href === null ? (\n <span data-fs-text=\"\" data-fs-account-menu-text=\"\">\n {item.label}\n </span>\n ) : (\n <NavigationLink\n href={item.href}\n aria-current={current && isCurrent ? ariaCurrentFor(current.match) : undefined}\n data-fs-account-menu-link=\"\"\n >\n {item.label}\n </NavigationLink>\n )}\n </li>\n );\n })}\n </ul>\n </nav>\n );\n}\n\nexport function AccountMenuIndexRedirect({\n loadingLabel,\n emptyMessage = 'No account section is configured.',\n $content,\n className,\n}: Readonly<AccountMenuIndexRedirectProps>) {\n const { items, current } = useAccountMenu();\n const { bindingId } = useStorefrontContext();\n const { routeMap } = useRouteMap();\n const { replace } = useStorefrontNavigation();\n // StrictMode runs an effect twice, and a router whose identity changes per render re-runs it on every\n // pass; one replace is the whole of this part's job.\n const replacedRef = useRef(false);\n\n const destination = findIndexDestination(items, current, bindingId, routeMap);\n\n useEffect(() => {\n if (destination === null || replacedRef.current) {\n return;\n }\n replacedRef.current = true;\n // Replace rather than push, so back from the section leaves the account instead of bouncing through\n // its root.\n // react-doctor-disable-next-line nextjs-no-client-side-redirect -- the order is the merchant's, published at runtime, so no static redirect can express it\n replace(destination);\n }, [destination, replace]);\n\n // Blank entry fields fall through, so clearing one in the Admin reads as unauthored.\n const entryLoadingLabel = $content?.loadingLabel?.trim() ? $content.loadingLabel : loadingLabel;\n const entryEmptyMessage = $content?.emptyMessage?.trim() ? $content.emptyMessage : emptyMessage;\n\n if (destination === null) {\n return (\n <p className={className} data-fs-account-menu-index-redirect=\"\" data-fs-account-menu-index-redirect-empty=\"\">\n {entryEmptyMessage}\n </p>\n );\n }\n\n // The gate's own part rather than one of this part's: in the account layout the gate's wait for the\n // session comes first, and carrying the same look on until the section lands is what keeps a second\n // one from flashing between the two.\n return (\n <AccountAccessGateLoading className={className} data-fs-account-menu-index-redirect=\"\">\n {entryLoadingLabel}\n </AccountAccessGateLoading>\n );\n}\n\nconst DEFAULT_SIGN_OUT_LABEL = 'Sign out';\nconst DEFAULT_SIGN_OUT_ERROR = \"We couldn't sign you out. Please try again.\";\n\n/**\n * The first non-blank of the given values. The models' `minLength` is enforced by neither the runtime\n * slice nor the preflight, and a blank here is a nameless button or a silent failure.\n */\nfunction firstAuthored(...values: (string | undefined)[]): string | undefined {\n return values.find((value) => value?.trim());\n}\n\n/** An absent handler or a rejection is a sign-out that did not happen, never one that did. */\nasync function logOut(logout: SessionActions['logout'] | undefined): Promise<boolean> {\n if (!logout) {\n return false;\n }\n try {\n const errors = await logout();\n return errors.length === 0;\n } catch (error) {\n console.error('[AccountMenuSignOut] logout rejected', error);\n return false;\n }\n}\n\nexport function AccountMenuSignOut({\n label,\n errorMessage,\n $content,\n $actions: $actionsProp,\n className,\n}: Readonly<AccountMenuSignOutProps>) {\n const $actions = useActionsOverride($actionsProp);\n const { hrefFor } = useStorefrontNavigation();\n const { basePath } = useStorefrontContext();\n // Any standing intent, whichever control declared it, is a sign-out under way.\n const signingOut = useSignOutIntent();\n const failed = useSignOutFailure();\n // Two activations in the same task see the same render, so the disabled button alone cannot stop\n // the second one.\n const attemptingRef = useRef(false);\n\n async function handleClick() {\n if (attemptingRef.current) {\n return;\n }\n attemptingRef.current = true;\n clearSignOutFailure();\n // Before the await: the logout payload flips the session in place, and a gate that got its turn\n // between the response and the navigation would send the shopper to sign in for the account they\n // just left. From here on this control is unmounted under the gate; the handler still settles.\n declareSignOutIntent();\n\n if (await logOut($actions?.session?.logout)) {\n // A document load rather than the router, whose cache would keep the account behind the back\n // control. What the browser's back-forward cache restores is the gate's to revalidate.\n globalThis.location.assign(hrefFor(HOME_PAGE) ?? basePath);\n return;\n }\n\n attemptingRef.current = false;\n reportSignOutFailure();\n withdrawSignOutIntent();\n }\n\n const entryLabel = firstAuthored($content?.label, label) ?? DEFAULT_SIGN_OUT_LABEL;\n const entryErrorMessage = firstAuthored($content?.errorMessage, errorMessage) ?? DEFAULT_SIGN_OUT_ERROR;\n\n return (\n <div\n className={className}\n data-fs-account-menu-sign-out=\"\"\n data-fs-account-menu-sign-out-pending={signingOut ? '' : undefined}\n >\n <button\n type=\"button\"\n onClick={handleClick}\n disabled={signingOut}\n aria-busy={signingOut || undefined}\n data-fs-account-menu-sign-out-button=\"\"\n >\n {entryLabel}\n </button>\n {failed ? (\n <p role=\"alert\" data-fs-account-menu-sign-out-error=\"\">\n {entryErrorMessage}\n </p>\n ) : null}\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Namespace export\n// ---------------------------------------------------------------------------\n\nexport const AccountMenu = {\n Root: AccountMenuRoot,\n List: AccountMenuList,\n IndexRedirect: AccountMenuIndexRedirect,\n SignOut: AccountMenuSignOut,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkCA,MAAM,4BAA4B,OAAO,WAAW,cAAc,YAAY;AAM9E,MAAa,qBAAqB,kBAAkB;CAClD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EAItB,YAAY,EACV,OAAO;GACL,MAAM;GACN,OAAO;GACP,UAAU;GACV,OAAO;IACL,MAAM;IACN,sBAAsB;IACtB,UAAU,CAAC,SAAS,MAAM;IAC1B,YAAY;KACV,OAAO;MAAE,MAAM;MAAU,WAAW;MAAG,OAAO;KAAQ;KACtD,MAAM;MACJ,MAAM;MACN,WAAW;MACX,OAAO;MACP,QAAQ;MAER,SAAS;KACX;KACA,UAAU;MAAE,MAAM;MAAW,OAAO;KAAqB;IAC3D;GACF;EACF,EACF;CACF;AACF,CAAC;AAID,MAAa,kCAAkC,kBAAkB;CAC/D,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY;GACV,cAAc;IAAE,MAAM;IAAU,WAAW;I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