@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,7 +1,7 @@
|
|
|
1
1
|
# SignInRedirect
|
|
2
2
|
|
|
3
3
|
**Category:** identity
|
|
4
|
-
**Purpose:** The whole of the
|
|
4
|
+
**Purpose:** The whole of the sign-in page — hands the document over to the account's platform login, carrying the shopper's way back.
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -13,7 +13,7 @@ The image is the source of truth for layout, and this component is not in any la
|
|
|
13
13
|
|
|
14
14
|
## When to use
|
|
15
15
|
|
|
16
|
-
- On the
|
|
16
|
+
- On the sign-in page (`{ standard: 'sign-in' }`), as its only element, when the store's account lives on the VTEX platform's login rather than on the storefront.
|
|
17
17
|
|
|
18
18
|
## When NOT to use
|
|
19
19
|
|
|
@@ -32,7 +32,7 @@ The image is the source of truth for layout, and this component is not in any la
|
|
|
32
32
|
SignInRedirect
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
It requires no `SessionRoot` and declares no context: it reads nothing of the shopper's.
|
|
35
|
+
It requires no `SessionRoot` and declares no context: it reads nothing of the shopper's. The sign-in page deliberately sits outside the account layout, so a shopper who is already signed in still makes the hop.
|
|
36
36
|
|
|
37
37
|
## Components
|
|
38
38
|
|
|
@@ -40,7 +40,7 @@ It requires no `SessionRoot` and declares no context: it reads nothing of the sh
|
|
|
40
40
|
|
|
41
41
|
| Prop | Type | Default | Notes |
|
|
42
42
|
|------|------|---------|-------|
|
|
43
|
-
| `platformLoginUrl` | string | — | The account's platform login. An absolute URL (`https://account.example.net/api/io/login`) or a site-relative path (`/api/io/login`). The storefront's own
|
|
43
|
+
| `platformLoginUrl` | string | — | The account's platform login. An absolute URL (`https://account.example.net/api/io/login`) or a site-relative path (`/api/io/login`). The storefront's own sign-in page is refused, whichever way it is spelled. Required in practice: with no usable value the component renders nothing. |
|
|
44
44
|
| `loadingLabel` | string | — | Text shown while the handover is pending. Absent renders the element with no text. |
|
|
45
45
|
|
|
46
46
|
### SignInRedirectLoading
|
|
@@ -57,7 +57,7 @@ Content model (`sign-in-redirect`) fields, edited in the CMS:
|
|
|
57
57
|
|
|
58
58
|
**Only the return parameter crosses.** The component reads exactly one parameter from the incoming URL, `returnUrl`, and composes the destination from the authored address. Every other parameter on the incoming URL is dropped rather than forwarded into an auth URL; every parameter already on the authored address survives, because the destination is built from it.
|
|
59
59
|
|
|
60
|
-
**The return is revalidated on arrival, not trusted.** `/
|
|
60
|
+
**The return is revalidated on arrival, not trusted.** `returnUrl` is a logical path, without the binding's base path, and this component prefixes it before the handover, so a shopper on `/pt-BR` returns to `/pt-BR/pvt/profile`. The sign-in page is reachable by a hand-crafted link, so the value is treated as shopper-supplied whoever produced it. A return that leaves the site, is protocol-relative, or points back at the sign-in page itself is dropped — never rewritten into a working one — and a bounded warning names the reason. Refusing a self-referential return is what keeps a shopper who just authenticated from being handed to the platform a second time.
|
|
61
61
|
|
|
62
62
|
**The return's form follows the address's origin.** A path alone cannot say which origin it belongs to, and the store author is the one who decides whether the receiver shares the storefront's. A same-origin address gets the site-relative path exactly as it arrived; a cross-origin one would resolve that path against its own domain, so the value is absolutized first — always against the storefront's origin, never the address's.
|
|
63
63
|
|
|
@@ -92,7 +92,7 @@ Bound to a CMS entry, the element authors no `loadingLabel` at all — the entry
|
|
|
92
92
|
- **Expecting it to skip the hop for a signed-in shopper.** It reads no session by design, so every visitor is handed over.
|
|
93
93
|
- **Authoring `$content` in the schema.** `$content` is compiler-injected from the page's content entry; naming it in `props` fails the build.
|
|
94
94
|
- **Authoring `returnUrl` on `platformLoginUrl`.** The shopper's return overwrites it; author the address's other parameters instead.
|
|
95
|
-
- **Pointing `platformLoginUrl` at the storefront's own
|
|
95
|
+
- **Pointing `platformLoginUrl` at the storefront's own sign-in page.** That is this page handed to itself, which would reload the page forever; the address is refused instead. Another host's `/login` is the platform's page and is fine.
|
|
96
96
|
- **Selecting it from a screenshot.** It has no visual identity — a sign-in screen in an image is the platform's page, not this one.
|
|
97
97
|
|
|
98
98
|
---
|
|
@@ -118,7 +118,7 @@ That element carries both hooks: `data-fs-sign-in-redirect` is the component's i
|
|
|
118
118
|
}
|
|
119
119
|
```
|
|
120
120
|
|
|
121
|
-
A spinner beside the text is a decoration the component does not render. Draw it from the element itself, once per store, as the `SignInRedirect` base swatch in `
|
|
121
|
+
A spinner beside the text is a decoration the component does not render. Draw it from the element itself, once per store, as the `SignInRedirect` base swatch in `foundation.json → styles`. `before:block` is what makes the pseudo-element take a width and height — an inline one ignores both:
|
|
122
122
|
|
|
123
123
|
```json
|
|
124
124
|
{
|
package/dist/docs/toast.md
CHANGED
|
@@ -21,23 +21,23 @@
|
|
|
21
21
|
|
|
22
22
|
## Composition
|
|
23
23
|
|
|
24
|
-
`Toast` is not authored as a
|
|
24
|
+
`Toast` is not authored as a per-toast PageSchema tree. The stack is mounted once in the layout schema, near the root. A `ToastViewport` with no children renders every toast itself; to control the markup, put a `ToastList` inside it with the per-toast card as a template:
|
|
25
25
|
|
|
26
26
|
```
|
|
27
27
|
ToastProvider
|
|
28
28
|
└── ToastPortal
|
|
29
29
|
└── ToastViewport
|
|
30
|
+
└── ToastList ← repeats its children once per queued toast
|
|
31
|
+
└── ToastRoot ← the template; reads its toast from ToastList
|
|
32
|
+
├── ToastTitle (optional — auto-renders toast.title with no children)
|
|
33
|
+
├── ToastDescription (optional — auto-renders toast.description with no children)
|
|
34
|
+
├── ToastAction (optional) ← reversible action, e.g. "Undo"
|
|
35
|
+
└── ToastClose (optional)
|
|
30
36
|
```
|
|
31
37
|
|
|
32
|
-
|
|
38
|
+
A `ToastViewport` with no children renders one default toast per entry of `useToast().toasts` (see below), so a page schema never lists a toast. Passing children takes control of the markup, and `ToastList` is the schema-composable way to do it: it renders its template once per queued toast and `ToastRoot` reads each toast from it. In application code you can instead map over `useToast().toasts` and pass `toast` to `ToastRoot` yourself.
|
|
33
39
|
|
|
34
|
-
|
|
35
|
-
ToastRoot ← one per queued toast, keyed by toast.id
|
|
36
|
-
├── ToastTitle (optional — auto-renders toast.title with no children)
|
|
37
|
-
├── ToastDescription (optional — auto-renders toast.description with no children)
|
|
38
|
-
├── ToastAction (optional) ← reversible action, e.g. "Undo"
|
|
39
|
-
└── ToastClose (optional)
|
|
40
|
-
```
|
|
40
|
+
The message text is not in the schema. It comes from whoever calls `add()` at runtime. With no children, `ToastList` renders `ToastRoot > ToastTitle + ToastDescription` for each toast; a `ToastViewport` containing a `ToastList` counts as having children, so the default toasts do not render alongside it.
|
|
41
41
|
|
|
42
42
|
`Icon` (existing particle) may be composed as a plain sibling of `ToastTitle`/`ToastDescription` inside `ToastRoot` — there is no dedicated status-icon sub-component. Wrap it in a plain `<span data-fs-toast-icon-container="">` at the call site for a tinted background; `ToastRoot` does not inject this wrapper itself, since it renders `children` verbatim. Style both hooks off `data-fs-toast-root-type`.
|
|
43
43
|
|
|
@@ -61,15 +61,25 @@ Renders `ToastViewport` into `document.body`. No props, context-only.
|
|
|
61
61
|
|
|
62
62
|
The fixed-position stack container. Renders a `<div>` — style it directly.
|
|
63
63
|
|
|
64
|
-
No
|
|
64
|
+
- **No children:** renders one default toast per active toast, in queue order: `ToastRoot` > `ToastTitle` + `ToastDescription` + `ToastAction` + `ToastClose`. Each part renders nothing when the toast has no matching text or `actionProps`, so a reversible toast shows its action between the text and the close button. The close button is named from the message catalog (`fs/toast.dismiss`); its `×` glyph is hidden from assistive technology. The default toast has no status icon and adds no `data-fs-*` hook beyond the existing ones.
|
|
65
|
+
- **With children:** renders exactly those children and no default toast. `null`, `false` and `undefined` count as no children.
|
|
66
|
+
- **Region name:** every viewport gets `aria-label` from the message catalog (`fs/toast.region`, "Notifications") unless you pass your own `aria-label`.
|
|
67
|
+
|
|
68
|
+
No props beyond standard `className`/HTML attributes. It reads the message catalog, so it needs an intl provider ancestor (a generated app's root layout provides one).
|
|
69
|
+
|
|
70
|
+
### ToastList
|
|
71
|
+
|
|
72
|
+
Renders its `children` once for each queued toast, in the order of `useToast().toasts`, each inside a per-toast context that `ToastRoot` reads. With no children it renders `ToastRoot > ToastTitle + ToastDescription`. It renders no element of its own, so it adds no `data-fs-*` hook and takes no `style`. Without a `ToastProvider` ancestor it renders nothing. Place it as the direct child of `ToastViewport`.
|
|
73
|
+
|
|
74
|
+
No props beyond `children`.
|
|
65
75
|
|
|
66
76
|
### ToastRoot
|
|
67
77
|
|
|
68
|
-
One instance per active toast.
|
|
78
|
+
One instance per active toast. Place it inside `ToastList` as the template, or render it yourself with an explicit `toast`. With neither, it renders nothing.
|
|
69
79
|
|
|
70
80
|
| Prop | Type | Default | Notes |
|
|
71
81
|
|------|------|---------|-------|
|
|
72
|
-
| `toast` | `ToastObject` |
|
|
82
|
+
| `toast` | `ToastObject` | toast from the enclosing `ToastList` | One entry from `useToast().toasts`. Wins over the list's toast when both exist. |
|
|
73
83
|
| `swipeDirection` | `'up' \| 'down' \| 'left' \| 'right'` or an array of those | `['down', 'right']` | Directions the shopper can swipe to dismiss. |
|
|
74
84
|
|
|
75
85
|
### ToastTitle / ToastDescription
|
|
@@ -97,7 +107,18 @@ function SaveProfileButton() {
|
|
|
97
107
|
}
|
|
98
108
|
```
|
|
99
109
|
|
|
100
|
-
|
|
110
|
+
Under a provider-optional caller, such as a component that renders in layouts with or without a provider, use `useOptionalToast()`. It returns the same value as `useToast()`, or `null` when no `ToastProvider` is mounted, and never throws:
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
import { useOptionalToast } from '@vtex/faststore/components';
|
|
114
|
+
|
|
115
|
+
function RemoveButton() {
|
|
116
|
+
const toast = useOptionalToast();
|
|
117
|
+
return <button onClick={() => toast?.add({ title: 'Item removed' })}>Remove</button>;
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
`useToast()` is Base UI's `useToastManager()` re-exported under the FastStore name, and it still throws without a provider. `toasts`, `add`, `close`, `update`, and `promise` all behave exactly as documented at [base-ui.com/react/components/toast](https://base-ui.com/react/components/toast).
|
|
101
122
|
|
|
102
123
|
---
|
|
103
124
|
|
|
@@ -106,6 +127,7 @@ function SaveProfileButton() {
|
|
|
106
127
|
| Component | What you style | Plausible classes |
|
|
107
128
|
|---|---|---|
|
|
108
129
|
| `ToastViewport` | Positions the stack on the screen | `fixed bottom-4 right-4 flex flex-col gap-2 w-[320px]` |
|
|
130
|
+
| `ToastList` | Nothing. It renders no element | — |
|
|
109
131
|
| `ToastRoot` | The toast card's surface; key off `data-fs-toast-root-type` for status color | `rounded-lg px-4 py-3 shadow-lg data-[fs-toast-root-type=error]:bg-red-50` |
|
|
110
132
|
| `ToastTitle` | Toast heading typography | `text-sm font-semibold` |
|
|
111
133
|
| `ToastDescription` | Toast body typography | `text-sm text-gray-600` |
|
package/dist/index.d.ts
CHANGED
|
@@ -4,12 +4,16 @@ import { JsonValue, StorefrontContext } from "./core/dist/schema/generated/schem
|
|
|
4
4
|
import { ContentArraySchema, ContentNestedObjectShape, ContentObjectPropertySchema, ContentObjectSchema, ContentPropertySchema, ContentPropertyType, ContentScalarSchema, ContentScalarType, ContentTypeDefinition, ContentValue, defineContentType } from "./core/dist/define-content-type.js";
|
|
5
5
|
import { ComponentDefinition, EditorMetadata, FetchStrategy, PropSchema, PropSchemaField, PropType, VariableBinding, VariableBindings, defineComponent } from "./core/dist/define-component.js";
|
|
6
6
|
import "./core/dist/index.js";
|
|
7
|
+
import { PageRef, ResolveHrefReason, ResolveHrefResult, RouteIdentity, RouteKind, RouteMap, RouteMapEntry, StandardName } from "./sdk/navigation/types.js";
|
|
7
8
|
import { CartUserError } from "./sdk/cart/operations.js";
|
|
8
9
|
import { AddItemPayload, CartActions, CartCouponPayload, CartLinePayload, CartLinesPayload, CartQuantityPayload } from "./sdk/cart/use-cart-actions.js";
|
|
9
10
|
import { ClientPreferenceKey, ClientProfileUserError, CustomerProfileUserError } from "./sdk/identity/operations.js";
|
|
10
11
|
import { ClientPreferencesUpdatePayload, ClientProfileUpdatePayload, CustomerProfileUpdatePayload, IdentityActions } from "./sdk/identity/use-identity-actions.js";
|
|
12
|
+
import { LocaleActions } from "./sdk/locale/use-locale-actions.js";
|
|
13
|
+
import { OrderCancelOrder, OrderCancelUserError } from "./sdk/orders/order-operations.js";
|
|
14
|
+
import { OrderActions, OrderCancelInput, OrderCancelResult } from "./sdk/orders/use-order-actions.js";
|
|
11
15
|
import { PaymentBillingAddressUpdateInput, PaymentMethodSelectInput, PaymentMoney, PaymentUserError } from "./sdk/payment/operations.js";
|
|
12
|
-
import { PaymentGatewayCard, PaymentGatewayNewCard, PaymentGatewaySavedCard, PaymentGatewayTransaction, SendPaymentsRequest } from "./sdk/payment/gateway.js";
|
|
16
|
+
import { PaymentGatewayCard, PaymentGatewayNewCard, PaymentGatewayResult, PaymentGatewaySavedCard, PaymentGatewayTransaction, SendPaymentsRequest } from "./sdk/payment/gateway.js";
|
|
13
17
|
import { PaymentActions, PaymentGatewayCallbackResult, PaymentStartTransactionResult } from "./sdk/payment/use-payment-actions.js";
|
|
14
18
|
import { RegionUserError } from "./sdk/region/region-operations.js";
|
|
15
19
|
import { RegionActions } from "./sdk/region/use-region-actions.js";
|
|
@@ -19,4 +23,5 @@ import { ShippingOptionSelectUserError } from "./sdk/shipping/option-select-oper
|
|
|
19
23
|
import { ShippingAddressInput, ShippingAddressUpdateErrorEntity } from "./sdk/shipping/shipping-operations.js";
|
|
20
24
|
import { ShippingActions } from "./sdk/shipping/use-shipping-actions.js";
|
|
21
25
|
import { ComponentActions } from "./sdk/actions/types.js";
|
|
22
|
-
|
|
26
|
+
import { resolveStorefrontHref } from "./sdk/navigation/resolve-storefront-href.js";
|
|
27
|
+
export { type ActionSelector, type AddItemPayload, type CartActions, type CartCouponPayload, type CartLinePayload, type CartLinesPayload, type CartQuantityPayload, type CartUserError, type ClientPreferenceKey, type ClientPreferencesUpdatePayload, type ClientProfileUpdatePayload, type ClientProfileUserError, type ComponentActions, type ComponentDefinition, type ContentArraySchema, type ContentNestedObjectShape, type ContentObjectPropertySchema, type ContentObjectSchema, type ContentPropertySchema, type ContentPropertyType, type ContentScalarSchema, type ContentScalarType, type ContentTypeDefinition, type ContentValue, type CustomerProfileUpdatePayload, type CustomerProfileUserError, type EditorMetadata, type FetchStrategy, type IdentityActions, type JsonValue, type LocaleActions, type MockActions, type OrderActions, type OrderCancelInput, type OrderCancelOrder, type OrderCancelResult, type OrderCancelUserError, type PageRef, type PaymentActions, type PaymentBillingAddressUpdateInput, type PaymentGatewayCallbackResult, type PaymentGatewayCard, type PaymentGatewayNewCard, type PaymentGatewayResult, type PaymentGatewaySavedCard, type PaymentGatewayTransaction, type PaymentMethodSelectInput, type PaymentMoney, type PaymentStartTransactionResult, type PaymentUserError, type PropSchema, type PropSchemaField, type PropType, type RegionActions, type RegionUserError, type ResolveHrefReason, type ResolveHrefResult, type RouteIdentity, type RouteKind, type RouteMap, type RouteMapEntry, type SendPaymentsRequest, type SessionAccessCodeRequestResult, type SessionActions, type SessionPasswordLoginPayload, type SessionRequestAccessCodePayload, type SessionUserError, type SessionValidateAccessCodePayload, type ShippingActions, type ShippingAddressInput, type ShippingAddressUpdateErrorEntity, type ShippingOptionSelectUserError, type StandardName, type StorefrontContext, type VariableBinding, type VariableBindings, defineComponent, defineContentType, mockAction, resolveStorefrontHref };
|
package/dist/index.js
CHANGED
|
@@ -2,4 +2,5 @@ import { mockAction } from "./core/dist/actions/mock-action.js";
|
|
|
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
|
-
|
|
5
|
+
import { resolveStorefrontHref } from "./sdk/navigation/resolve-storefront-href.js";
|
|
6
|
+
export { defineComponent, defineContentType, mockAction, resolveStorefrontHref };
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { MessageId, Messages } from "../sdk/i18n/locales.js";
|
|
2
2
|
import "../sdk/i18n/client.js";
|
|
3
3
|
import { gql } from "../sdk/graphql-tag.js";
|
|
4
|
+
import { AddressActionProvider, AddressActionProviderProps } from "../sdk/actions/address-action-provider.js";
|
|
4
5
|
import { AnalyticsActionProvider, AnalyticsActionProviderProps } from "../sdk/actions/analytics-action-provider.js";
|
|
5
6
|
import { CartActionProvider, CartActionProviderProps } from "../sdk/actions/cart-action-provider.js";
|
|
6
7
|
import { IdentityActionProvider, IdentityActionProviderProps } from "../sdk/actions/identity-action-provider.js";
|
|
8
|
+
import { LocaleActionProvider, LocaleActionProviderProps } from "../sdk/actions/locale-action-provider.js";
|
|
9
|
+
import { OrderActionProvider, OrderActionProviderProps } from "../sdk/actions/order-action-provider.js";
|
|
7
10
|
import { PaymentActionProvider, PaymentActionProviderProps } from "../sdk/actions/payment-action-provider.js";
|
|
8
11
|
import { RegionActionProvider, RegionActionProviderProps } from "../sdk/actions/region-action-provider.js";
|
|
12
|
+
import { SavedCardActionProvider, SavedCardActionProviderProps } from "../sdk/actions/saved-card-action-provider.js";
|
|
9
13
|
import { SessionActionProvider, SessionActionProviderProps } from "../sdk/actions/session-action-provider.js";
|
|
10
14
|
import { ShippingActionProvider, ShippingActionProviderProps } from "../sdk/actions/shipping-action-provider.js";
|
|
11
15
|
import "../sdk/actions/index.js";
|
|
@@ -19,8 +23,12 @@ import { ClientVariablesMap, PageReactiveDataRoot, PageReactiveDataRootProps, Re
|
|
|
19
23
|
import { ReactiveDataProvider, ReactiveDataProviderProps } from "../sdk/data/reactive-data-provider.js";
|
|
20
24
|
import { ReactiveListItemDataProvider, ReactiveListItemDataProviderProps } from "../sdk/data/reactive-list-item-data-provider.js";
|
|
21
25
|
import "../sdk/data/index.js";
|
|
26
|
+
import { BindingSwitchProvider, BindingSwitchProviderProps } from "../sdk/locale/binding-switch-provider.js";
|
|
27
|
+
import { RouteMapProvider, RouteMapProviderProps, ToLogicalPath } from "../sdk/navigation/route-map-provider.js";
|
|
28
|
+
import { reportNotFoundRequest } from "../sdk/navigation/not-found-log.js";
|
|
29
|
+
import { RouteIdentityProvider, RouteIdentityProviderProps } from "../sdk/navigation/route-identity-provider.js";
|
|
22
30
|
import { StorefrontProvider, StorefrontProviderProps } from "../sdk/provider/storefront-provider.js";
|
|
23
31
|
import "../sdk/provider/index.js";
|
|
24
32
|
import { cartCouponErrorsVar, cartLastAddVar, cartUserErrorsVar, miniCartOpenVar, orderFormIdVar } from "../sdk/state/cart.js";
|
|
25
33
|
import { SelectedVariant, publishedVariantIdFor, selectedVariantVar } from "../sdk/state/variant-selector.js";
|
|
26
|
-
export { AnalyticsActionProvider, type AnalyticsActionProviderProps, CartActionProvider, type CartActionProviderProps, type ClientVariablesMap, DataOverrideContext, HotDataProvider, type HotDataProviderProps, IdentityActionProvider, type IdentityActionProviderProps, type ListItemRef, ListItemRefContext, type MessageId, type Messages, MultipleReactiveDataProvider, type MultipleReactiveDataProviderEntity, type MultipleReactiveDataProviderProps, PageReactiveDataRoot, type PageReactiveDataRootProps, PaymentActionProvider, type PaymentActionProviderProps, ReactiveDataProvider, type ReactiveDataProviderProps, ReactiveListItemDataProvider, type ReactiveListItemDataProviderProps, ReactiveRootContext, type ReactiveRootContextValue, RegionActionProvider, type RegionActionProviderProps, type SelectedVariant, SessionActionProvider, type SessionActionProviderProps, ShippingActionProvider, type ShippingActionProviderProps, StorefrontProvider, type StorefrontProviderProps, buildOptimisticDecrease, buildOptimisticIncrease, buildOptimisticRemove, buildStorefrontContextHeaders, cartCouponErrorsVar, cartLastAddVar, cartUserErrorsVar, gql, miniCartOpenVar, orderFormIdVar, publishedVariantIdFor, selectedVariantVar, useDataOverride, useListItemRef };
|
|
34
|
+
export { AddressActionProvider, type AddressActionProviderProps, AnalyticsActionProvider, type AnalyticsActionProviderProps, BindingSwitchProvider, type BindingSwitchProviderProps, CartActionProvider, type CartActionProviderProps, type ClientVariablesMap, DataOverrideContext, HotDataProvider, type HotDataProviderProps, IdentityActionProvider, type IdentityActionProviderProps, type ListItemRef, ListItemRefContext, LocaleActionProvider, type LocaleActionProviderProps, type MessageId, type Messages, MultipleReactiveDataProvider, type MultipleReactiveDataProviderEntity, type MultipleReactiveDataProviderProps, OrderActionProvider, type OrderActionProviderProps, PageReactiveDataRoot, type PageReactiveDataRootProps, PaymentActionProvider, type PaymentActionProviderProps, ReactiveDataProvider, type ReactiveDataProviderProps, ReactiveListItemDataProvider, type ReactiveListItemDataProviderProps, ReactiveRootContext, type ReactiveRootContextValue, RegionActionProvider, type RegionActionProviderProps, RouteIdentityProvider, type RouteIdentityProviderProps, RouteMapProvider, type RouteMapProviderProps, SavedCardActionProvider, type SavedCardActionProviderProps, type SelectedVariant, SessionActionProvider, type SessionActionProviderProps, ShippingActionProvider, type ShippingActionProviderProps, StorefrontProvider, type StorefrontProviderProps, type ToLogicalPath, buildOptimisticDecrease, buildOptimisticIncrease, buildOptimisticRemove, buildStorefrontContextHeaders, cartCouponErrorsVar, cartLastAddVar, cartUserErrorsVar, gql, miniCartOpenVar, orderFormIdVar, publishedVariantIdFor, reportNotFoundRequest, selectedVariantVar, useDataOverride, useListItemRef };
|
package/dist/internal/client.js
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { gql } from "../sdk/graphql-tag.js";
|
|
2
|
+
import { RouteMapProvider } from "../sdk/navigation/route-map-provider.js";
|
|
3
|
+
import { RouteIdentityProvider } from "../sdk/navigation/route-identity-provider.js";
|
|
2
4
|
import { DataOverrideContext, useDataOverride } from "../sdk/data/data-override-context.js";
|
|
5
|
+
import { ListItemRefContext, useListItemRef } from "../sdk/data/list-item-ref-context.js";
|
|
3
6
|
import { PageReactiveDataRoot, ReactiveRootContext } from "../sdk/data/page-reactive-data-root.js";
|
|
4
7
|
import { HotDataProvider } from "../sdk/data/hot-data-provider.js";
|
|
5
8
|
import { publishedVariantIdFor, selectedVariantVar } from "../sdk/state/variant-selector.js";
|
|
6
9
|
import { cartCouponErrorsVar, cartLastAddVar, cartUserErrorsVar, miniCartOpenVar, orderFormIdVar } from "../sdk/state/cart.js";
|
|
7
10
|
import { buildOptimisticDecrease, buildOptimisticIncrease, buildOptimisticRemove } from "../sdk/cart/optimistic.js";
|
|
8
|
-
import {
|
|
11
|
+
import { AddressActionProvider } from "../sdk/actions/address-action-provider.js";
|
|
9
12
|
import { AnalyticsActionProvider } from "../sdk/actions/analytics-action-provider.js";
|
|
10
13
|
import { CartActionProvider } from "../sdk/actions/cart-action-provider.js";
|
|
11
14
|
import { IdentityActionProvider } from "../sdk/actions/identity-action-provider.js";
|
|
15
|
+
import { BindingSwitchProvider } from "../sdk/locale/binding-switch-provider.js";
|
|
16
|
+
import { LocaleActionProvider } from "../sdk/actions/locale-action-provider.js";
|
|
17
|
+
import { OrderActionProvider } from "../sdk/actions/order-action-provider.js";
|
|
12
18
|
import { PaymentActionProvider } from "../sdk/actions/payment-action-provider.js";
|
|
13
19
|
import { RegionActionProvider } from "../sdk/actions/region-action-provider.js";
|
|
20
|
+
import { SavedCardActionProvider } from "../sdk/actions/saved-card-action-provider.js";
|
|
14
21
|
import { SessionActionProvider } from "../sdk/actions/session-action-provider.js";
|
|
15
22
|
import { ShippingActionProvider } from "../sdk/actions/shipping-action-provider.js";
|
|
16
23
|
import "../sdk/actions/index.js";
|
|
@@ -19,7 +26,8 @@ import { MultipleReactiveDataProvider } from "../sdk/data/multiple-reactive-data
|
|
|
19
26
|
import { ReactiveDataProvider } from "../sdk/data/reactive-data-provider.js";
|
|
20
27
|
import { ReactiveListItemDataProvider } from "../sdk/data/reactive-list-item-data-provider.js";
|
|
21
28
|
import "../sdk/data/index.js";
|
|
29
|
+
import { reportNotFoundRequest } from "../sdk/navigation/not-found-log.js";
|
|
22
30
|
import { StorefrontProvider } from "../sdk/provider/storefront-provider.js";
|
|
23
31
|
import "../sdk/provider/index.js";
|
|
24
32
|
import "../sdk/state/index.js";
|
|
25
|
-
export { AnalyticsActionProvider, CartActionProvider, DataOverrideContext, HotDataProvider, IdentityActionProvider, ListItemRefContext, MultipleReactiveDataProvider, PageReactiveDataRoot, PaymentActionProvider, ReactiveDataProvider, ReactiveListItemDataProvider, ReactiveRootContext, RegionActionProvider, SessionActionProvider, ShippingActionProvider, StorefrontProvider, buildOptimisticDecrease, buildOptimisticIncrease, buildOptimisticRemove, buildStorefrontContextHeaders, cartCouponErrorsVar, cartLastAddVar, cartUserErrorsVar, gql, miniCartOpenVar, orderFormIdVar, publishedVariantIdFor, selectedVariantVar, useDataOverride, useListItemRef };
|
|
33
|
+
export { AddressActionProvider, AnalyticsActionProvider, BindingSwitchProvider, CartActionProvider, DataOverrideContext, HotDataProvider, IdentityActionProvider, ListItemRefContext, LocaleActionProvider, MultipleReactiveDataProvider, OrderActionProvider, PageReactiveDataRoot, PaymentActionProvider, ReactiveDataProvider, ReactiveListItemDataProvider, ReactiveRootContext, RegionActionProvider, RouteIdentityProvider, RouteMapProvider, SavedCardActionProvider, SessionActionProvider, ShippingActionProvider, StorefrontProvider, buildOptimisticDecrease, buildOptimisticIncrease, buildOptimisticRemove, buildStorefrontContextHeaders, cartCouponErrorsVar, cartLastAddVar, cartUserErrorsVar, gql, miniCartOpenVar, orderFormIdVar, publishedVariantIdFor, reportNotFoundRequest, selectedVariantVar, useDataOverride, useListItemRef };
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
import { resolveStorefrontHref } from "../sdk/navigation/resolve-storefront-href.js";
|
|
1
2
|
import { buildStorefrontContextHeaders } from "../sdk/context/headers.js";
|
|
3
|
+
import { AlternateBinding, BuildPageAlternatesOptions, CATALOG_ROUTE_ALTERNATES_QUERY, PageAlternates, RouteParams, RouteVariant, buildPageAlternates, catalogClusterPaths, routeLogicalPath } from "../sdk/seo/page-alternates.js";
|
|
4
|
+
import { BindingSwitchRequest, BindingSwitchResult, ResolveBindingSwitchOptions, resolveBindingSwitch } from "../sdk/navigation/binding-switch.js";
|
|
5
|
+
import { customerOrdersFilter } from "../matter/order-list/customer-orders-filter.js";
|
|
2
6
|
import { CreateClientOptions, createClient } from "../sdk/client/create-client.js";
|
|
3
7
|
import { FetchPageDataOptions, FetchPageDataResult, fetchPageData } from "../sdk/client/fetch-page-data.js";
|
|
4
8
|
import { PreloadQueryRegistry, RegisterPreloadQueryOptions, registerPreloadQuery } from "../sdk/client/register-preload-query.js";
|
|
5
9
|
import { ContentVariableField, ContentVariablesSpec, VariablesFromContentOptions, variablesFromContent } from "../sdk/data/variables-from-content.js";
|
|
6
10
|
import { getIntl, loadMessages } from "../sdk/i18n/server.js";
|
|
11
|
+
import { decodeRouteParams } from "../sdk/navigation/decode-route-params.js";
|
|
12
|
+
import { permanentRedirectToStorefrontPage, redirectToStorefrontPage } from "../sdk/navigation/redirect.js";
|
|
7
13
|
import { ServerSessionRead, readServerSession } from "../sdk/session/read-server-session.js";
|
|
8
|
-
import {
|
|
14
|
+
import { signInTarget } from "../utils/safe-href.js";
|
|
9
15
|
import { PreloadQueryProps } from "@apollo/client-integration-nextjs";
|
|
10
|
-
export { type ContentVariableField, type ContentVariablesSpec, type CreateClientOptions, type FetchPageDataOptions, type FetchPageDataResult, type PreloadQueryProps, type PreloadQueryRegistry, type RegisterPreloadQueryOptions, type ServerSessionRead, type VariablesFromContentOptions, buildStorefrontContextHeaders, createClient, fetchPageData, getIntl, loadMessages, readServerSession, registerPreloadQuery,
|
|
16
|
+
export { type AlternateBinding, type BindingSwitchRequest, type BindingSwitchResult, type BuildPageAlternatesOptions, CATALOG_ROUTE_ALTERNATES_QUERY, type ContentVariableField, type ContentVariablesSpec, type CreateClientOptions, type FetchPageDataOptions, type FetchPageDataResult, type PageAlternates, type PreloadQueryProps, type PreloadQueryRegistry, type RegisterPreloadQueryOptions, type ResolveBindingSwitchOptions, type RouteParams, type RouteVariant, type ServerSessionRead, type VariablesFromContentOptions, buildPageAlternates, buildStorefrontContextHeaders, catalogClusterPaths, createClient, customerOrdersFilter, decodeRouteParams, fetchPageData, getIntl, loadMessages, permanentRedirectToStorefrontPage, readServerSession, redirectToStorefrontPage, registerPreloadQuery, resolveBindingSwitch, resolveStorefrontHref, routeLogicalPath, signInTarget, variablesFromContent };
|
package/dist/internal/server.js
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { signInTarget } from "../utils/safe-href.js";
|
|
2
|
+
import { resolveStorefrontHref } from "../sdk/navigation/resolve-storefront-href.js";
|
|
2
3
|
import { buildStorefrontContextHeaders } from "../sdk/context/headers.js";
|
|
4
|
+
import { customerOrdersFilter } from "../matter/order-list/customer-orders-filter.js";
|
|
3
5
|
import { createClient } from "../sdk/client/create-client.js";
|
|
4
6
|
import { fetchPageData } from "../sdk/client/fetch-page-data.js";
|
|
5
7
|
import { registerPreloadQuery } from "../sdk/client/register-preload-query.js";
|
|
6
8
|
import { variablesFromContent } from "../sdk/data/variables-from-content.js";
|
|
7
9
|
import { getIntl, loadMessages } from "../sdk/i18n/server.js";
|
|
10
|
+
import { CATALOG_ROUTE_ALTERNATES_QUERY, buildPageAlternates, catalogClusterPaths, routeLogicalPath } from "../sdk/seo/page-alternates.js";
|
|
11
|
+
import { decodeRouteParams } from "../sdk/navigation/decode-route-params.js";
|
|
12
|
+
import { resolveBindingSwitch } from "../sdk/navigation/binding-switch.js";
|
|
13
|
+
import { permanentRedirectToStorefrontPage, redirectToStorefrontPage } from "../sdk/navigation/redirect.js";
|
|
8
14
|
import { readServerSession } from "../sdk/session/read-server-session.js";
|
|
9
|
-
export { buildStorefrontContextHeaders, createClient, fetchPageData, getIntl, loadMessages, readServerSession, registerPreloadQuery,
|
|
15
|
+
export { CATALOG_ROUTE_ALTERNATES_QUERY, buildPageAlternates, buildStorefrontContextHeaders, catalogClusterPaths, createClient, customerOrdersFilter, decodeRouteParams, fetchPageData, getIntl, loadMessages, permanentRedirectToStorefrontPage, readServerSession, redirectToStorefrontPage, registerPreloadQuery, resolveBindingSwitch, resolveStorefrontHref, routeLogicalPath, signInTarget, variablesFromContent };
|
|
@@ -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 { ComponentPropsWithRef, ReactNode } from "react";
|
|
5
6
|
//#region src/matter/account-access-gate/account-access-gate.d.ts
|
|
6
7
|
export declare const AccountAccessGateContent: {
|
|
@@ -62,7 +63,7 @@ export type AccountAccessGateNoticeProps = Omit<ComponentPropsWithRef<'output'>,
|
|
|
62
63
|
/** The message for this reason. Nothing renders in its place when unauthored. */
|
|
63
64
|
message?: string;
|
|
64
65
|
/** Where the link out leads, built by the gate from the page the shopper is on. */
|
|
65
|
-
signInHref: string;
|
|
66
|
+
signInHref: PageRef | string;
|
|
66
67
|
/** Label of the link out. No label, no link. */
|
|
67
68
|
signInLabel?: string;
|
|
68
69
|
};
|
|
@@ -2,14 +2,15 @@
|
|
|
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 { signInTarget } from "../../utils/safe-href.js";
|
|
6
|
+
import { useStorefrontNavigation } from "../../sdk/navigation/use-storefront-navigation.js";
|
|
7
|
+
import { useStorefrontRoute } from "../../sdk/navigation/use-storefront-route.js";
|
|
5
8
|
import { useSession } from "../session/session.js";
|
|
6
|
-
import { resolveSignInHref } from "../../utils/safe-href.js";
|
|
7
9
|
import { NavigationLink } from "../../particles/navigation-link/navigation-link.js";
|
|
8
10
|
import { useSessionRevalidation } from "../../sdk/session/use-session-revalidation.js";
|
|
9
11
|
import { useSignOutIntent, withdrawSignOutIntent } from "./sign-out-intent.js";
|
|
10
12
|
import { useEffect, useRef, useState } from "react";
|
|
11
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
import { usePathname, useRouter } from "next/navigation";
|
|
13
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
14
|
import { flushSync } from "react-dom";
|
|
14
15
|
//#region src/matter/account-access-gate/account-access-gate.tsx
|
|
15
16
|
const AccountAccessGateContent = defineContentType({
|
|
@@ -71,7 +72,7 @@ const AccountAccessGateDefinition = defineComponent({
|
|
|
71
72
|
label: "Sign-in Link Label"
|
|
72
73
|
}
|
|
73
74
|
},
|
|
74
|
-
guideline: "The account's single access decision: place it once in the account layout, wrapping the body, and every page that declares that layout inherits it — never restate it per section. It renders its children only for a logged-in shopper; it shows a composed loading look while the session resolves, replaces the current history entry with the sign-in destination for a visitor who arrived signed out (identified counts as signed out), tells a shopper whose session ended mid-visit rather than bouncing them, and stands down while AccountMenuSignOut navigates. It redirects at most once per visit: a shopper who comes back from sign-in still signed out gets a message and a link rather than a second hop. Must be inside SessionRoot, which the same layout hosts. Never place the
|
|
75
|
+
guideline: "The account's single access decision: place it once in the account layout, wrapping the body, and every page that declares that layout inherits it — never restate it per section. It renders its children only for a logged-in shopper; it shows a composed loading look while the session resolves, replaces the current history entry with the sign-in destination for a visitor who arrived signed out (identified counts as signed out), tells a shopper whose session ended mid-visit rather than bouncing them, and stands down while AccountMenuSignOut navigates. It redirects at most once per visit: a shopper who comes back from sign-in still signed out gets a message and a link rather than a second hop. Must be inside SessionRoot, which the same layout hosts. Never place the sign-in page under it — the gate redirects there, and a gated sign-in page would redirect to itself."
|
|
75
76
|
});
|
|
76
77
|
/** The one automatic hop the gate has already spent, surviving the full document load out to the
|
|
77
78
|
* platform and back, and no further than this tab. */
|
|
@@ -79,19 +80,15 @@ const SIGN_IN_ATTEMPT_KEY = "fs::account-access-gate::sign-in-attempt";
|
|
|
79
80
|
function AccountAccessGate({ loadingLabel, expiredMessage, signInIncompleteMessage, signInLabel, $content, children }) {
|
|
80
81
|
const { state, loading } = useSession();
|
|
81
82
|
const signingOut = useSignOutIntent();
|
|
82
|
-
const
|
|
83
|
-
const
|
|
83
|
+
const { path, search } = useStorefrontRoute();
|
|
84
|
+
const { hrefFor, replace } = useStorefrontNavigation();
|
|
84
85
|
const revalidate = useSessionRevalidation();
|
|
85
86
|
const [wasSignedIn, setWasSignedIn] = useState(false);
|
|
86
87
|
const [unconfirmed, setUnconfirmed] = useState(false);
|
|
87
88
|
const [revalidating, setRevalidating] = useState(false);
|
|
88
89
|
const restoreGeneration = useRef(0);
|
|
89
90
|
const [hopSpent, setHopSpent] = useState(null);
|
|
90
|
-
const
|
|
91
|
-
useEffect(() => {
|
|
92
|
-
setSearch(globalThis.location.search);
|
|
93
|
-
});
|
|
94
|
-
const returnPath = pathname === null ? null : `${pathname}${search ?? ""}`;
|
|
91
|
+
const returnPath = `${path}${search ?? ""}`;
|
|
95
92
|
const outcome = resolveOutcome({
|
|
96
93
|
signingOut,
|
|
97
94
|
unconfirmed,
|
|
@@ -118,10 +115,15 @@ function AccountAccessGate({ loadingLabel, expiredMessage, signInIncompleteMessa
|
|
|
118
115
|
setHopSpent(true);
|
|
119
116
|
return;
|
|
120
117
|
}
|
|
121
|
-
const
|
|
118
|
+
const target = signInTarget(returnPath);
|
|
119
|
+
const destination = hrefFor(target);
|
|
120
|
+
if (destination === null) {
|
|
121
|
+
setHopSpent(true);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
122
124
|
recordSignInAttempt(destination);
|
|
123
125
|
setHopSpent(false);
|
|
124
|
-
|
|
126
|
+
replace(target);
|
|
125
127
|
return;
|
|
126
128
|
}
|
|
127
129
|
case "stand-down":
|
|
@@ -133,7 +135,8 @@ function AccountAccessGate({ loadingLabel, expiredMessage, signInIncompleteMessa
|
|
|
133
135
|
hopSpent,
|
|
134
136
|
search,
|
|
135
137
|
returnPath,
|
|
136
|
-
|
|
138
|
+
hrefFor,
|
|
139
|
+
replace
|
|
137
140
|
]);
|
|
138
141
|
useEffect(() => {
|
|
139
142
|
function handlePageHide(event) {
|
|
@@ -181,13 +184,13 @@ function AccountAccessGate({ loadingLabel, expiredMessage, signInIncompleteMessa
|
|
|
181
184
|
"data-fs-account-access-gate": "",
|
|
182
185
|
children: entryLoadingLabel
|
|
183
186
|
});
|
|
184
|
-
case "account": return /* @__PURE__ */ jsx(Fragment, { children });
|
|
187
|
+
case "account": return /* @__PURE__ */ jsx(Fragment$1, { children });
|
|
185
188
|
case "expired":
|
|
186
189
|
case "sign-in-incomplete": return /* @__PURE__ */ jsx(AccountAccessGateNotice, {
|
|
187
190
|
"data-fs-account-access-gate": "",
|
|
188
191
|
reason: outcome === "expired" ? "expired" : "sign-in-incomplete",
|
|
189
192
|
message: outcome === "expired" ? entryExpiredMessage : entryIncompleteMessage,
|
|
190
|
-
signInHref:
|
|
193
|
+
signInHref: signInTarget(returnPath),
|
|
191
194
|
signInLabel: entrySignInLabel
|
|
192
195
|
});
|
|
193
196
|
default: return assertUnreachable(outcome);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-access-gate.js","names":[],"sources":["../../../src/matter/account-access-gate/account-access-gate.tsx"],"sourcesContent":["'use client';\n\nimport { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport { usePathname, useRouter } from 'next/navigation';\nimport { type ComponentPropsWithRef, type ReactNode, useEffect, useRef, useState } from 'react';\nimport { flushSync } from 'react-dom';\nimport { NavigationLink } from '../../particles/navigation-link/navigation-link.js';\nimport { useSessionRevalidation } from '../../sdk/session/use-session-revalidation.js';\nimport { resolveSignInHref } from '../../utils/safe-href.js';\nimport { type SessionState, useSession } from '../session/session.js';\nimport { useSignOutIntent, withdrawSignOutIntent } from './sign-out-intent.js';\n\n// Nothing is required, following the shipped identity components: an entry may author any subset, and\n// a slice missing a required property is shape-invalid, which drops the whole element rather than the\n// one field.\nexport const AccountAccessGateContent = defineContentType({\n id: 'account-access-gate',\n title: 'Account Access Gate',\n description: 'What the shopper is told while the account resolves and when it will not open for them.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n loadingLabel: { type: 'string', minLength: 1, title: 'Loading announcement' },\n expiredMessage: { type: 'string', minLength: 1, title: 'Session ended message' },\n signInIncompleteMessage: { type: 'string', minLength: 1, title: 'Sign-in did not complete message' },\n signInLabel: { type: 'string', minLength: 1, title: 'Sign-in link label' },\n },\n },\n});\n\n/** Why the account will not open, as a bounded value: a style target and the choice of message. */\nexport type AccountAccessGateNoticeReason = 'expired' | 'sign-in-incomplete';\n\n/** Props for {@link AccountAccessGate}. It renders a different element per outcome and forwards no\n * element props of its own; each rendered part carries its own. */\nexport type AccountAccessGateProps = {\n /** Text announced while the session resolves. */\n loadingLabel?: string;\n /** What a shopper whose session ended mid-visit is told. */\n expiredMessage?: string;\n /** What a shopper who came back from sign-in still signed out is told. */\n signInIncompleteMessage?: string;\n /** Label of the link out of either notice. Without it no link renders — a focusable link a screen\n * reader announces as its bare URL is worse than no control at all. */\n signInLabel?: string;\n /** Merchant-authored fields, sliced from the layout content entry; win over the props field by field\n * when present. Absent in a non-CMS store — the props are the fallback. */\n $content?: ContentValue<typeof AccountAccessGateContent>;\n /** The account. Rendered only for a signed-in shopper. */\n children?: ReactNode;\n};\n\n/** Props for {@link AccountAccessGateLoading}. Extends native `<output>` attributes. */\nexport type AccountAccessGateLoadingProps = ComponentPropsWithRef<'output'>;\n\n/** Props for {@link AccountAccessGateNotice}. Extends native `<output>` attributes. */\nexport type AccountAccessGateNoticeProps = Omit<ComponentPropsWithRef<'output'>, 'children'> & {\n reason: AccountAccessGateNoticeReason;\n /** The message for this reason. Nothing renders in its place when unauthored. */\n message?: string;\n /** Where the link out leads, built by the gate from the page the shopper is on. */\n signInHref: string;\n /** Label of the link out. No label, no link. */\n signInLabel?: string;\n};\n\nexport const AccountAccessGateDefinition = defineComponent<AccountAccessGateProps>({\n name: 'AccountAccessGate',\n importPath: '@vtex/faststore/components',\n component: AccountAccessGate,\n content: AccountAccessGateContent,\n editor: { label: 'Account Access Gate', category: 'identity' },\n requiresContext: 'session',\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 expiredMessage: { type: 'string', label: 'Session Ended Message' },\n signInIncompleteMessage: { type: 'string', label: 'Sign-in Did Not Complete Message' },\n signInLabel: { type: 'string', label: 'Sign-in Link Label' },\n },\n guideline:\n \"The account's single access decision: place it once in the account layout, wrapping the body, and every page that declares that layout inherits it — never restate it per section. It renders its children only for a logged-in shopper; it shows a composed loading look while the session resolves, replaces the current history entry with the sign-in destination for a visitor who arrived signed out (identified counts as signed out), tells a shopper whose session ended mid-visit rather than bouncing them, and stands down while AccountMenuSignOut navigates. It redirects at most once per visit: a shopper who comes back from sign-in still signed out gets a message and a link rather than a second hop. Must be inside SessionRoot, which the same layout hosts. Never place the /login route under it — the gate redirects there, and a gated /login would redirect to itself.\",\n});\n\n/** The one automatic hop the gate has already spent, surviving the full document load out to the\n * platform and back, and no further than this tab. */\nconst SIGN_IN_ATTEMPT_KEY = 'fs::account-access-gate::sign-in-attempt';\n\n/**\n * What the gate renders, in precedence order. `signing-in` covers both the frame that decides whether\n * the hop is still available and the frame after the replace is issued: they render the same nothing,\n * and only the effect tells them apart.\n */\ntype AccountAccessGateOutcome = 'stand-down' | 'expired' | 'loading' | 'account' | 'sign-in-incomplete' | 'signing-in';\n\nexport function AccountAccessGate({\n loadingLabel,\n expiredMessage,\n signInIncompleteMessage,\n signInLabel,\n $content,\n children,\n}: Readonly<AccountAccessGateProps>) {\n const { state, loading } = useSession();\n const signingOut = useSignOutIntent();\n const pathname = usePathname();\n const router = useRouter();\n const revalidate = useSessionRevalidation();\n\n // Whether this gate has ever resolved to a signed-in shopper. It is what separates a session that\n // ended from a visitor who arrived signed out — the tri-state spells both `anonymous`.\n const [wasSignedIn, setWasSignedIn] = useState(false);\n // A revalidation that could not answer. It outranks `loading` because the discard that preceded it\n // is what leaves the session unresolved, so nothing else is coming to end that wait.\n const [unconfirmed, setUnconfirmed] = useState(false);\n // A re-read in flight. The gate withholds the account for itself rather than waiting to be told:\n // discarding the cached session leaves the data layer unresolved, but it reaches the gate only once\n // the watched query has re-read, and the account must be gone in the frame the restore arrives.\n const [revalidating, setRevalidating] = useState(false);\n // Which re-read the gate is still listening to. Two restores in a row put two answers in flight, and\n // the older one may land last.\n const restoreGeneration = useRef(0);\n // `null` until the arrival path has read the record. Read from an effect rather than from the render\n // body: session storage does not exist on the server, and a value that appeared between the server\n // pass and hydration would change what renders underneath it.\n const [hopSpent, setHopSpent] = useState<boolean | null>(null);\n // `null` until the document has been read, for the same two reasons, and read from the document\n // rather than through `useSearchParams()`, which would require a `Suspense` boundary the generator\n // does not emit on a prerendered route — the reason `SignInRedirect` gives for reading it this way.\n const [search, setSearch] = useState<string | null>(null);\n\n // Deliberately on every commit rather than on mount: `usePathname()` re-renders the gate when the\n // path changes but says nothing about the query, and a shopper who pages through their orders\n // changes only the query. Setting the same string is a bail-out, so this does not loop.\n useEffect(() => {\n setSearch(globalThis.location.search);\n });\n\n // Where the shopper comes back to. `usePathname()` yields the path alone, so a gate that stopped\n // there would return someone reading `/pvt/orders?page=2` to the first page of it.\n const returnPath = pathname === null ? null : `${pathname}${search ?? ''}`;\n\n const outcome = resolveOutcome({ signingOut, unconfirmed, revalidating, loading, state, wasSignedIn, hopSpent });\n\n useEffect(() => {\n switch (outcome) {\n case 'account':\n setWasSignedIn(true);\n setUnconfirmed(false);\n clearSignInAttempt();\n return;\n case 'expired':\n case 'sign-in-incomplete':\n // Every outcome that is not the hop returns it: a shopper who signs in, browses, and comes\n // back later arrives fresh rather than carrying a spent attempt from an earlier one.\n clearSignInAttempt();\n return;\n case 'signing-in': {\n // One more frame before deciding, until the document has been read: a hop recorded against the\n // bare path is the one the shopper comes back to, and there is no second chance at it.\n if (hopSpent !== null || search === null) {\n return;\n }\n if (readSignInAttempt() !== null) {\n setHopSpent(true);\n return;\n }\n const destination = resolveSignInHref(returnPath);\n recordSignInAttempt(destination);\n setHopSpent(false);\n // Replace rather than push: back from the platform's login should reach the page the shopper\n // came from, not the account that threw them at it.\n // react-doctor-disable-next-line nextjs-no-client-side-redirect -- the session resolves on the client, so the server has nothing to decide with\n router.replace(destination);\n return;\n }\n case 'stand-down':\n case 'loading':\n return;\n default:\n assertUnreachable(outcome);\n }\n }, [outcome, hopSpent, search, returnPath, router]);\n\n useEffect(() => {\n function handlePageHide(event: PageTransitionEvent): void {\n if (!event.persisted) {\n return;\n }\n // What the browser freezes is the DOM, and a restore puts that same DOM back before any script\n // runs. Standing the account down on the way out rather than on the way back is what keeps the\n // restored document from showing it in the frames before `pageshow` can decide again.\n flushSync(() => {\n setRevalidating(true);\n });\n }\n\n function handlePageShow(event: PageTransitionEvent): void {\n // An ordinary load re-decides by mounting. Only a restore resumes a heap that already holds an\n // answer, and `persisted` is the browser's own word for it.\n if (!event.persisted) {\n return;\n }\n const generation = restoreGeneration.current + 1;\n restoreGeneration.current = generation;\n // The navigation this authorized has already happened; a restored document holding it would\n // stand down forever. Withdrawn before the re-read so the gate is deciding again by the time\n // the answer lands.\n withdrawSignOutIntent();\n setUnconfirmed(false);\n setRevalidating(true);\n void revalidate().then((result) => {\n // A later restore has already asked the same question, and its answer is the one that counts.\n // This one describes a session the gate has since discarded a second time.\n if (generation !== restoreGeneration.current) {\n return;\n }\n setRevalidating(false);\n switch (result) {\n case 'failed':\n setUnconfirmed(true);\n return;\n case 'revalidated':\n case 'unavailable':\n // Nothing left to distrust: either the session was re-read, or there was no cached\n // session to discard in the first place and the one in the tree came from a prop.\n return;\n default:\n assertUnreachable(result);\n }\n });\n }\n\n globalThis.addEventListener('pagehide', handlePageHide);\n globalThis.addEventListener('pageshow', handlePageShow);\n return () => {\n globalThis.removeEventListener('pagehide', handlePageHide);\n globalThis.removeEventListener('pageshow', handlePageShow);\n };\n }, [revalidate]);\n\n // The intent authorizes one transition and this gate is its only reader, so it must not survive the\n // gate. A sign-out that navigates client-side takes the account layout down without reloading the\n // document, and nothing else would ever take the flag back: the next account page the shopper opens\n // would mount into a standing intent and render nothing at all, with no error to explain it.\n useEffect(() => withdrawSignOutIntent, []);\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 entryExpiredMessage = $content?.expiredMessage?.trim() ? $content.expiredMessage : expiredMessage;\n const entryIncompleteMessage = $content?.signInIncompleteMessage?.trim()\n ? $content.signInIncompleteMessage\n : signInIncompleteMessage;\n const entrySignInLabel = $content?.signInLabel?.trim() ? $content.signInLabel : signInLabel;\n\n switch (outcome) {\n case 'stand-down':\n case 'signing-in':\n return null;\n case 'loading':\n return (\n // The part carries its own hook; the component's identity travels from here, which is how a\n // store targets it by name the way every other component is targeted.\n <AccountAccessGateLoading data-fs-account-access-gate=\"\">{entryLoadingLabel}</AccountAccessGateLoading>\n );\n case 'account':\n return <>{children}</>;\n case 'expired':\n case 'sign-in-incomplete':\n return (\n <AccountAccessGateNotice\n data-fs-account-access-gate=\"\"\n reason={outcome === 'expired' ? 'expired' : 'sign-in-incomplete'}\n message={outcome === 'expired' ? entryExpiredMessage : entryIncompleteMessage}\n signInHref={resolveSignInHref(returnPath)}\n signInLabel={entrySignInLabel}\n />\n );\n default:\n return assertUnreachable(outcome);\n }\n}\n\n/**\n * The whole decision, as one ordered read of the gate's inputs.\n *\n * `signingOut` outranks everything, including a session still reading `loggedIn`: the sign-out records\n * its intent before it awaits the mutation, and the frame between the payload landing and the document\n * load starting is exactly the one this ordering protects.\n *\n * `loading` outranks the tri-state for the reason `AccountEntryPoint` gives: an unresolved session\n * reports `anonymous`, so reading the state first would bounce a shopper who is signed in. A re-read\n * in flight reads as the same wait: the session it is checking is one the gate has stopped believing.\n */\nfunction resolveOutcome({\n signingOut,\n unconfirmed,\n revalidating,\n loading,\n state,\n wasSignedIn,\n hopSpent,\n}: {\n signingOut: boolean;\n unconfirmed: boolean;\n revalidating: boolean;\n loading: boolean;\n state: SessionState;\n wasSignedIn: boolean;\n hopSpent: boolean | null;\n}): AccountAccessGateOutcome {\n if (signingOut) {\n return 'stand-down';\n }\n // A re-read that could not answer says nothing about how the shopper got here, so the notice keeps\n // the history the gate already has. Telling someone who never reached the account that their session\n // ended names an event that never happened; the incomplete sign-in is the one they actually had.\n if (unconfirmed) {\n return wasSignedIn ? 'expired' : 'sign-in-incomplete';\n }\n if (revalidating || loading) {\n return 'loading';\n }\n if (state === 'loggedIn') {\n return 'account';\n }\n if (wasSignedIn) {\n return 'expired';\n }\n return hopSpent === true ? 'sign-in-incomplete' : 'signing-in';\n}\n\nfunction assertUnreachable(outcome: never): never {\n throw new Error(`[AccountAccessGate] unhandled outcome: ${String(outcome)}`);\n}\n\n/**\n * The look of a session that has not answered yet. A real part with its own hook rather than an ad hoc\n * spinner, so a store can style it and a story can render it.\n */\nexport function AccountAccessGateLoading({ className, children, ...props }: AccountAccessGateLoadingProps) {\n return (\n <output {...props} aria-live=\"polite\" className={className} data-fs-account-access-gate-loading=\"\">\n {children}\n </output>\n );\n}\n\n/**\n * What renders in the account's place when it will not open: the message for this reason, and a link\n * the shopper may take back into sign-in.\n *\n * The link is the whole of the escape from a sign-in loop. The gate stops redirecting after one\n * automatic hop, so the next attempt is a click rather than a bounce — and a shopper who keeps landing\n * here at least lands on a page that says so.\n */\nexport function AccountAccessGateNotice({\n reason,\n message,\n signInHref,\n signInLabel,\n className,\n ...props\n}: AccountAccessGateNoticeProps) {\n return (\n <output\n {...props}\n aria-live=\"polite\"\n className={className}\n data-fs-account-access-gate-notice=\"\"\n data-fs-account-access-gate-notice-reason={reason}\n >\n {message ? <span data-fs-account-access-gate-notice-message=\"\">{message}</span> : null}\n {signInLabel?.trim() ? (\n <NavigationLink\n href={signInHref}\n // The destination is a trampoline that redirects on mount, so the default prefetch would\n // fire that GET from a page the shopper may never leave.\n prefetch={false}\n data-fs-account-access-gate-notice-action=\"\"\n >\n {signInLabel}\n </NavigationLink>\n ) : null}\n </output>\n );\n}\n\n/**\n * Session storage, guarded at every access. A browser that refuses it — a shopper blocking site data —\n * throws rather than returning null, and a gate that cannot read its own record still has a shopper to\n * get to sign-in. A refusal therefore reads as \"no record\", which spends the hop; the cost is that the\n * loop protection is absent in that browser, which is the lesser of the two failures.\n */\nfunction readSignInAttempt(): string | null {\n try {\n return globalThis.sessionStorage.getItem(SIGN_IN_ATTEMPT_KEY);\n } catch {\n return null;\n }\n}\n\nfunction recordSignInAttempt(destination: string): void {\n try {\n globalThis.sessionStorage.setItem(SIGN_IN_ATTEMPT_KEY, destination);\n } catch {\n // Nothing to fall back to: the record is the only thing that outlives the hop.\n }\n}\n\nfunction clearSignInAttempt(): void {\n try {\n globalThis.sessionStorage.removeItem(SIGN_IN_ATTEMPT_KEY);\n } catch {\n // Nothing was written either, so there is nothing to undo.\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAeA,MAAa,2BAA2B,kBAAkB;CACxD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY;GACV,cAAc;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAuB;GAC5E,gBAAgB;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAwB;GAC/E,yBAAyB;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAmC;GACnG,aAAa;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAqB;EAC3E;CACF;AACF,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ACd,IACE;;AAEZ;;;;;;;AAQA,SAAS,oBAAmC;CAC1C,IAAI;EACF,OAAO,WAAW,eAAe,QAAQ,mBAAmB;CAC9D,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAS,oBAAoB,aAA2B;CACtD,IAAI;EACF,WAAW,eAAe,QAAQ,qBAAqB,WAAW;CACpE,QAAQ,CAER;AACF;AAEA,SAAS,qBAA2B;CAClC,IAAI;EACF,WAAW,eAAe,WAAW,mBAAmB;CAC1D,QAAQ,CAER;AACF"}
|
|
1
|
+
{"version":3,"file":"account-access-gate.js","names":[],"sources":["../../../src/matter/account-access-gate/account-access-gate.tsx"],"sourcesContent":["'use client';\n\nimport { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport { type ComponentPropsWithRef, type ReactNode, useEffect, useRef, useState } from 'react';\nimport { flushSync } from 'react-dom';\nimport { NavigationLink } from '../../particles/navigation-link/navigation-link.js';\nimport type { PageRef } from '../../sdk/navigation/types.js';\nimport { useStorefrontNavigation } from '../../sdk/navigation/use-storefront-navigation.js';\nimport { useStorefrontRoute } from '../../sdk/navigation/use-storefront-route.js';\nimport { useSessionRevalidation } from '../../sdk/session/use-session-revalidation.js';\nimport { signInTarget } from '../../utils/safe-href.js';\nimport { type SessionState, useSession } from '../session/session.js';\nimport { useSignOutIntent, withdrawSignOutIntent } from './sign-out-intent.js';\n\n// Nothing is required, following the shipped identity components: an entry may author any subset, and\n// a slice missing a required property is shape-invalid, which drops the whole element rather than the\n// one field.\nexport const AccountAccessGateContent = defineContentType({\n id: 'account-access-gate',\n title: 'Account Access Gate',\n description: 'What the shopper is told while the account resolves and when it will not open for them.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n loadingLabel: { type: 'string', minLength: 1, title: 'Loading announcement' },\n expiredMessage: { type: 'string', minLength: 1, title: 'Session ended message' },\n signInIncompleteMessage: { type: 'string', minLength: 1, title: 'Sign-in did not complete message' },\n signInLabel: { type: 'string', minLength: 1, title: 'Sign-in link label' },\n },\n },\n});\n\n/** Why the account will not open, as a bounded value: a style target and the choice of message. */\nexport type AccountAccessGateNoticeReason = 'expired' | 'sign-in-incomplete';\n\n/** Props for {@link AccountAccessGate}. It renders a different element per outcome and forwards no\n * element props of its own; each rendered part carries its own. */\nexport type AccountAccessGateProps = {\n /** Text announced while the session resolves. */\n loadingLabel?: string;\n /** What a shopper whose session ended mid-visit is told. */\n expiredMessage?: string;\n /** What a shopper who came back from sign-in still signed out is told. */\n signInIncompleteMessage?: string;\n /** Label of the link out of either notice. Without it no link renders — a focusable link a screen\n * reader announces as its bare URL is worse than no control at all. */\n signInLabel?: string;\n /** Merchant-authored fields, sliced from the layout content entry; win over the props field by field\n * when present. Absent in a non-CMS store — the props are the fallback. */\n $content?: ContentValue<typeof AccountAccessGateContent>;\n /** The account. Rendered only for a signed-in shopper. */\n children?: ReactNode;\n};\n\n/** Props for {@link AccountAccessGateLoading}. Extends native `<output>` attributes. */\nexport type AccountAccessGateLoadingProps = ComponentPropsWithRef<'output'>;\n\n/** Props for {@link AccountAccessGateNotice}. Extends native `<output>` attributes. */\nexport type AccountAccessGateNoticeProps = Omit<ComponentPropsWithRef<'output'>, 'children'> & {\n reason: AccountAccessGateNoticeReason;\n /** The message for this reason. Nothing renders in its place when unauthored. */\n message?: string;\n /** Where the link out leads, built by the gate from the page the shopper is on. */\n signInHref: PageRef | string;\n /** Label of the link out. No label, no link. */\n signInLabel?: string;\n};\n\nexport const AccountAccessGateDefinition = defineComponent<AccountAccessGateProps>({\n name: 'AccountAccessGate',\n importPath: '@vtex/faststore/components',\n component: AccountAccessGate,\n content: AccountAccessGateContent,\n editor: { label: 'Account Access Gate', category: 'identity' },\n requiresContext: 'session',\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 expiredMessage: { type: 'string', label: 'Session Ended Message' },\n signInIncompleteMessage: { type: 'string', label: 'Sign-in Did Not Complete Message' },\n signInLabel: { type: 'string', label: 'Sign-in Link Label' },\n },\n guideline:\n \"The account's single access decision: place it once in the account layout, wrapping the body, and every page that declares that layout inherits it — never restate it per section. It renders its children only for a logged-in shopper; it shows a composed loading look while the session resolves, replaces the current history entry with the sign-in destination for a visitor who arrived signed out (identified counts as signed out), tells a shopper whose session ended mid-visit rather than bouncing them, and stands down while AccountMenuSignOut navigates. It redirects at most once per visit: a shopper who comes back from sign-in still signed out gets a message and a link rather than a second hop. Must be inside SessionRoot, which the same layout hosts. Never place the sign-in page under it — the gate redirects there, and a gated sign-in page would redirect to itself.\",\n});\n\n/** The one automatic hop the gate has already spent, surviving the full document load out to the\n * platform and back, and no further than this tab. */\nconst SIGN_IN_ATTEMPT_KEY = 'fs::account-access-gate::sign-in-attempt';\n\n/**\n * What the gate renders, in precedence order. `signing-in` covers both the frame that decides whether\n * the hop is still available and the frame after the replace is issued: they render the same nothing,\n * and only the effect tells them apart.\n */\ntype AccountAccessGateOutcome = 'stand-down' | 'expired' | 'loading' | 'account' | 'sign-in-incomplete' | 'signing-in';\n\nexport function AccountAccessGate({\n loadingLabel,\n expiredMessage,\n signInIncompleteMessage,\n signInLabel,\n $content,\n children,\n}: Readonly<AccountAccessGateProps>) {\n const { state, loading } = useSession();\n const signingOut = useSignOutIntent();\n // `search` is `null` on the server and during hydration, and re-read on every render of the gate:\n // a shopper who pages through their orders changes only the query.\n const { path, search } = useStorefrontRoute();\n const { hrefFor, replace } = useStorefrontNavigation();\n const revalidate = useSessionRevalidation();\n\n // Whether this gate has ever resolved to a signed-in shopper. It is what separates a session that\n // ended from a visitor who arrived signed out — the tri-state spells both `anonymous`.\n const [wasSignedIn, setWasSignedIn] = useState(false);\n // A revalidation that could not answer. It outranks `loading` because the discard that preceded it\n // is what leaves the session unresolved, so nothing else is coming to end that wait.\n const [unconfirmed, setUnconfirmed] = useState(false);\n // A re-read in flight. The gate withholds the account for itself rather than waiting to be told:\n // discarding the cached session leaves the data layer unresolved, but it reaches the gate only once\n // the watched query has re-read, and the account must be gone in the frame the restore arrives.\n const [revalidating, setRevalidating] = useState(false);\n // Which re-read the gate is still listening to. Two restores in a row put two answers in flight, and\n // the older one may land last.\n const restoreGeneration = useRef(0);\n // `null` until the arrival path has read the record. Read from an effect rather than from the render\n // body: session storage does not exist on the server, and a value that appeared between the server\n // pass and hydration would change what renders underneath it.\n const [hopSpent, setHopSpent] = useState<boolean | null>(null);\n\n // Where the shopper comes back to: the logical path, which the sign-in route prefixes on the way back.\n // The path alone would return someone reading `/pvt/orders?page=2` to the first page of it.\n const returnPath = `${path}${search ?? ''}`;\n\n const outcome = resolveOutcome({ signingOut, unconfirmed, revalidating, loading, state, wasSignedIn, hopSpent });\n\n useEffect(() => {\n switch (outcome) {\n case 'account':\n setWasSignedIn(true);\n setUnconfirmed(false);\n clearSignInAttempt();\n return;\n case 'expired':\n case 'sign-in-incomplete':\n // Every outcome that is not the hop returns it: a shopper who signs in, browses, and comes\n // back later arrives fresh rather than carrying a spent attempt from an earlier one.\n clearSignInAttempt();\n return;\n case 'signing-in': {\n // One more frame before deciding, until the document has been read: a hop recorded against the\n // bare path is the one the shopper comes back to, and there is no second chance at it.\n if (hopSpent !== null || search === null) {\n return;\n }\n if (readSignInAttempt() !== null) {\n setHopSpent(true);\n return;\n }\n const target = signInTarget(returnPath);\n // The record is the resolved href, but the navigation takes the target: `replace` adds the\n // binding's base path, and handing it the href would add it twice.\n const destination = hrefFor(target);\n // A store with no sign-in page has nowhere to send the shopper. `hrefFor` already logged it;\n // the notice is what keeps the page from staying blank.\n if (destination === null) {\n setHopSpent(true);\n return;\n }\n recordSignInAttempt(destination);\n setHopSpent(false);\n // Replace rather than push: back from the platform's login should reach the page the shopper\n // came from, not the account that threw them at it.\n // react-doctor-disable-next-line nextjs-no-client-side-redirect -- the session resolves on the client, so the server has nothing to decide with\n replace(target);\n return;\n }\n case 'stand-down':\n case 'loading':\n return;\n default:\n assertUnreachable(outcome);\n }\n }, [outcome, hopSpent, search, returnPath, hrefFor, replace]);\n\n useEffect(() => {\n function handlePageHide(event: PageTransitionEvent): void {\n if (!event.persisted) {\n return;\n }\n // What the browser freezes is the DOM, and a restore puts that same DOM back before any script\n // runs. Standing the account down on the way out rather than on the way back is what keeps the\n // restored document from showing it in the frames before `pageshow` can decide again.\n flushSync(() => {\n setRevalidating(true);\n });\n }\n\n function handlePageShow(event: PageTransitionEvent): void {\n // An ordinary load re-decides by mounting. Only a restore resumes a heap that already holds an\n // answer, and `persisted` is the browser's own word for it.\n if (!event.persisted) {\n return;\n }\n const generation = restoreGeneration.current + 1;\n restoreGeneration.current = generation;\n // The navigation this authorized has already happened; a restored document holding it would\n // stand down forever. Withdrawn before the re-read so the gate is deciding again by the time\n // the answer lands.\n withdrawSignOutIntent();\n setUnconfirmed(false);\n setRevalidating(true);\n void revalidate().then((result) => {\n // A later restore has already asked the same question, and its answer is the one that counts.\n // This one describes a session the gate has since discarded a second time.\n if (generation !== restoreGeneration.current) {\n return;\n }\n setRevalidating(false);\n switch (result) {\n case 'failed':\n setUnconfirmed(true);\n return;\n case 'revalidated':\n case 'unavailable':\n // Nothing left to distrust: either the session was re-read, or there was no cached\n // session to discard in the first place and the one in the tree came from a prop.\n return;\n default:\n assertUnreachable(result);\n }\n });\n }\n\n globalThis.addEventListener('pagehide', handlePageHide);\n globalThis.addEventListener('pageshow', handlePageShow);\n return () => {\n globalThis.removeEventListener('pagehide', handlePageHide);\n globalThis.removeEventListener('pageshow', handlePageShow);\n };\n }, [revalidate]);\n\n // The intent authorizes one transition and this gate is its only reader, so it must not survive the\n // gate. A sign-out that navigates client-side takes the account layout down without reloading the\n // document, and nothing else would ever take the flag back: the next account page the shopper opens\n // would mount into a standing intent and render nothing at all, with no error to explain it.\n useEffect(() => withdrawSignOutIntent, []);\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 entryExpiredMessage = $content?.expiredMessage?.trim() ? $content.expiredMessage : expiredMessage;\n const entryIncompleteMessage = $content?.signInIncompleteMessage?.trim()\n ? $content.signInIncompleteMessage\n : signInIncompleteMessage;\n const entrySignInLabel = $content?.signInLabel?.trim() ? $content.signInLabel : signInLabel;\n\n switch (outcome) {\n case 'stand-down':\n case 'signing-in':\n return null;\n case 'loading':\n return (\n // The part carries its own hook; the component's identity travels from here, which is how a\n // store targets it by name the way every other component is targeted.\n <AccountAccessGateLoading data-fs-account-access-gate=\"\">{entryLoadingLabel}</AccountAccessGateLoading>\n );\n case 'account':\n return <>{children}</>;\n case 'expired':\n case 'sign-in-incomplete':\n return (\n <AccountAccessGateNotice\n data-fs-account-access-gate=\"\"\n reason={outcome === 'expired' ? 'expired' : 'sign-in-incomplete'}\n message={outcome === 'expired' ? entryExpiredMessage : entryIncompleteMessage}\n signInHref={signInTarget(returnPath)}\n signInLabel={entrySignInLabel}\n />\n );\n default:\n return assertUnreachable(outcome);\n }\n}\n\n/**\n * The whole decision, as one ordered read of the gate's inputs.\n *\n * `signingOut` outranks everything, including a session still reading `loggedIn`: the sign-out records\n * its intent before it awaits the mutation, and the frame between the payload landing and the document\n * load starting is exactly the one this ordering protects.\n *\n * `loading` outranks the tri-state for the reason `AccountEntryPoint` gives: an unresolved session\n * reports `anonymous`, so reading the state first would bounce a shopper who is signed in. A re-read\n * in flight reads as the same wait: the session it is checking is one the gate has stopped believing.\n */\nfunction resolveOutcome({\n signingOut,\n unconfirmed,\n revalidating,\n loading,\n state,\n wasSignedIn,\n hopSpent,\n}: {\n signingOut: boolean;\n unconfirmed: boolean;\n revalidating: boolean;\n loading: boolean;\n state: SessionState;\n wasSignedIn: boolean;\n hopSpent: boolean | null;\n}): AccountAccessGateOutcome {\n if (signingOut) {\n return 'stand-down';\n }\n // A re-read that could not answer says nothing about how the shopper got here, so the notice keeps\n // the history the gate already has. Telling someone who never reached the account that their session\n // ended names an event that never happened; the incomplete sign-in is the one they actually had.\n if (unconfirmed) {\n return wasSignedIn ? 'expired' : 'sign-in-incomplete';\n }\n if (revalidating || loading) {\n return 'loading';\n }\n if (state === 'loggedIn') {\n return 'account';\n }\n if (wasSignedIn) {\n return 'expired';\n }\n return hopSpent === true ? 'sign-in-incomplete' : 'signing-in';\n}\n\nfunction assertUnreachable(outcome: never): never {\n throw new Error(`[AccountAccessGate] unhandled outcome: ${String(outcome)}`);\n}\n\n/**\n * The look of a session that has not answered yet. A real part with its own hook rather than an ad hoc\n * spinner, so a store can style it and a story can render it.\n */\nexport function AccountAccessGateLoading({ className, children, ...props }: AccountAccessGateLoadingProps) {\n return (\n <output {...props} aria-live=\"polite\" className={className} data-fs-account-access-gate-loading=\"\">\n {children}\n </output>\n );\n}\n\n/**\n * What renders in the account's place when it will not open: the message for this reason, and a link\n * the shopper may take back into sign-in.\n *\n * The link is the whole of the escape from a sign-in loop. The gate stops redirecting after one\n * automatic hop, so the next attempt is a click rather than a bounce — and a shopper who keeps landing\n * here at least lands on a page that says so.\n */\nexport function AccountAccessGateNotice({\n reason,\n message,\n signInHref,\n signInLabel,\n className,\n ...props\n}: AccountAccessGateNoticeProps) {\n return (\n <output\n {...props}\n aria-live=\"polite\"\n className={className}\n data-fs-account-access-gate-notice=\"\"\n data-fs-account-access-gate-notice-reason={reason}\n >\n {message ? <span data-fs-account-access-gate-notice-message=\"\">{message}</span> : null}\n {signInLabel?.trim() ? (\n <NavigationLink\n href={signInHref}\n // The destination is a trampoline that redirects on mount, so the default prefetch would\n // fire that GET from a page the shopper may never leave.\n prefetch={false}\n data-fs-account-access-gate-notice-action=\"\"\n >\n {signInLabel}\n </NavigationLink>\n ) : null}\n </output>\n );\n}\n\n/**\n * Session storage, guarded at every access. A browser that refuses it — a shopper blocking site data —\n * throws rather than returning null, and a gate that cannot read its own record still has a shopper to\n * get to sign-in. A refusal therefore reads as \"no record\", which spends the hop; the cost is that the\n * loop protection is absent in that browser, which is the lesser of the two failures.\n */\nfunction readSignInAttempt(): string | null {\n try {\n return globalThis.sessionStorage.getItem(SIGN_IN_ATTEMPT_KEY);\n } catch {\n return null;\n }\n}\n\nfunction recordSignInAttempt(destination: string): void {\n try {\n globalThis.sessionStorage.setItem(SIGN_IN_ATTEMPT_KEY, destination);\n } catch {\n // Nothing to fall back to: the record is the only thing that outlives the hop.\n }\n}\n\nfunction clearSignInAttempt(): void {\n try {\n globalThis.sessionStorage.removeItem(SIGN_IN_ATTEMPT_KEY);\n } catch {\n // Nothing was written either, so there is nothing to undo.\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAiBA,MAAa,2BAA2B,kBAAkB;CACxD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY;GACV,cAAc;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAuB;GAC5E,gBAAgB;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAwB;GAC/E,yBAAyB;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAmC;GACnG,aAAa;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAqB;EAC3E;CACF;AACF,CAAC;AAsCD,MAAa,8BAA8B,gBAAwC;CACjF,MAAM;CACN,YAAY;CACZ,WAAW;CACX,SAAS;CACT,QAAQ;EAAE,OAAO;EAAuB,UAAU;CAAW;CAC7D,iBAAiB;CACjB,QAAQ;EAGN,cAAc;GAAE,MAAM;GAAU,OAAO;EAAuB;EAC9D,gBAAgB;GAAE,MAAM;GAAU,OAAO;EAAwB;EACjE,yBAAyB;GAAE,MAAM;GAAU,OAAO;EAAmC;EACrF,aAAa;GAAE,MAAM;GAAU,OAAO;EAAqB;CAC7D;CACA,WACE;AACJ,CAAC;;;AAID,MAAM,sBAAsB;AAS5B,SAAgB,kBAAkB,EAChC,cACA,gBACA,yBACA,aACA,UACA,YACmC;CACnC,MAAM,EAAE,OAAO,YAAY,WAAW;CACtC,MAAM,aAAa,iBAAiB;CAGpC,MAAM,EAAE,MAAM,WAAW,mBAAmB;C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