@vtex/faststore 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +99 -0
- package/dist/actions.json +152 -1
- package/dist/catalog.json +2541 -1278
- package/dist/cli/UnreachableCaseError-Crd168Vu.js +10 -0
- package/dist/cli/UnreachableCaseError-Crd168Vu.js.map +1 -0
- package/dist/cli/cacheControl-CEojH_TM.js +158 -0
- package/dist/cli/cacheControl-CEojH_TM.js.map +1 -0
- package/dist/cli/cachePolicy-m2vASMRW.js +26 -0
- package/dist/cli/cachePolicy-m2vASMRW.js.map +1 -0
- package/dist/cli/computeCoreSchemaHash-DPJZj-qJ.js +10 -0
- package/dist/cli/computeCoreSchemaHash-DPJZj-qJ.js.map +1 -0
- package/dist/cli/default-BCQHcwbL.js +253 -0
- package/dist/cli/default-BCQHcwbL.js.map +1 -0
- package/dist/cli/disableSuggestions-yO9UqiWn.js +21 -0
- package/dist/cli/disableSuggestions-yO9UqiWn.js.map +1 -0
- package/dist/cli/dist-C1JhdHfo.js +2001 -0
- package/dist/cli/dist-C1JhdHfo.js.map +1 -0
- package/dist/cli/graphql-DG9thCDG.js +14589 -0
- package/dist/cli/graphql-DG9thCDG.js.map +1 -0
- package/dist/cli/index.d.ts +799 -0
- package/dist/cli/index.js +36459 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/index.min-BsIHDfFK.js +613 -0
- package/dist/cli/index.min-BsIHDfFK.js.map +1 -0
- package/dist/cli/inlineTrace-uLgOJ3TH.js +52 -0
- package/dist/cli/inlineTrace-uLgOJ3TH.js.map +1 -0
- package/dist/cli/internalPlugin-DnuwN4_4.js +11 -0
- package/dist/cli/internalPlugin-DnuwN4_4.js.map +1 -0
- package/dist/cli/packageVersion-DQAnIEil.js +6 -0
- package/dist/cli/packageVersion-DQAnIEil.js.map +1 -0
- package/dist/cli/rolldown-runtime-BMI-E3GI.js +44 -0
- package/dist/cli/schemaIsSubgraph-DoGh3OYj.js +17 -0
- package/dist/cli/schemaIsSubgraph-DoGh3OYj.js.map +1 -0
- package/dist/cli/schemaReporting-K-me-3-v.js +199 -0
- package/dist/cli/schemaReporting-K-me-3-v.js.map +1 -0
- package/dist/cli/server-runtime.js +49879 -0
- package/dist/cli/server-runtime.js.map +1 -0
- package/dist/cli/traceTreeBuilder-BIcV2U7b.js +9118 -0
- package/dist/cli/traceTreeBuilder-BIcV2U7b.js.map +1 -0
- package/dist/cli/usageReporting-Bpl8vSZX.js +10201 -0
- package/dist/cli/usageReporting-Bpl8vSZX.js.map +1 -0
- package/dist/cli/v4-CBhFvC49.js +42 -0
- package/dist/cli/v4-CBhFvC49.js.map +1 -0
- package/dist/client.d.ts +5 -1
- package/dist/client.js +5 -1
- package/dist/components.d.ts +38 -9
- package/dist/components.js +42 -13
- package/dist/content-types.json +616 -0
- package/dist/core/dist/define-component.d.ts +43 -1
- package/dist/core/dist/index.d.ts +2 -2
- package/dist/docs/account-access-gate.md +4 -4
- package/dist/docs/account-address-book.md +519 -0
- package/dist/docs/account-entry-point.md +1 -1
- package/dist/docs/account-menu-identity.md +160 -0
- package/dist/docs/account-menu.md +107 -24
- package/dist/docs/alert-dialog.md +2 -2
- package/dist/docs/avatar.md +103 -0
- package/dist/docs/billing-address.md +17 -9
- package/dist/docs/card-entry.md +37 -6
- package/dist/docs/cardholder-document.md +16 -14
- package/dist/docs/cart-item.md +1 -1
- package/dist/docs/cart.md +8 -8
- package/dist/docs/client-profile-fieldset.md +7 -5
- package/dist/docs/copy-text.md +84 -0
- package/dist/docs/document-field.md +8 -8
- package/dist/docs/footer-link-group.md +2 -2
- package/dist/docs/header-root.md +1 -1
- package/dist/docs/incentives.md +2 -2
- package/dist/docs/logo.md +5 -5
- package/dist/docs/my-account-profile.md +5 -5
- package/dist/docs/navigation-link-list.md +2 -2
- package/dist/docs/navigation-link.md +3 -3
- package/dist/docs/order-cancel.md +52 -0
- package/dist/docs/order-delivery-address.md +63 -0
- package/dist/docs/order-delivery-group.md +83 -0
- package/dist/docs/order-details-back.md +41 -0
- package/dist/docs/order-details-header.md +48 -0
- package/dist/docs/order-list-row.md +46 -0
- package/dist/docs/order-list-search.md +101 -0
- package/dist/docs/order-list-views.md +97 -0
- package/dist/docs/order-list.md +94 -0
- package/dist/docs/order-payment.md +94 -0
- package/dist/docs/order-placed-date.md +49 -0
- package/dist/docs/order-placed-payment-summary.md +13 -15
- package/dist/docs/order-placed.md +225 -0
- package/dist/docs/order-progress.md +88 -0
- package/dist/docs/order-status-badge.md +91 -0
- package/dist/docs/order-summary.md +53 -0
- package/dist/docs/payment-method-badges.md +14 -3
- package/dist/docs/place-order.md +13 -9
- package/dist/docs/product-shelf.md +20 -13
- package/dist/docs/saved-cards.md +2 -2
- package/dist/docs/select.md +19 -6
- package/dist/docs/session.md +1 -1
- package/dist/docs/shipping-address.md +1 -1
- package/dist/docs/sign-in-redirect.md +6 -6
- package/dist/docs/toast.md +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +2 -1
- package/dist/internal/client.d.ts +6 -1
- package/dist/internal/client.js +8 -3
- package/dist/internal/content.d.ts +2 -2
- package/dist/internal/server.d.ts +8 -1
- package/dist/internal/server.js +8 -1
- package/dist/matter/account-access-gate/account-access-gate.d.ts +2 -1
- package/dist/matter/account-access-gate/account-access-gate.js +19 -16
- package/dist/matter/account-access-gate/account-access-gate.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-delete.d.ts +60 -0
- package/dist/matter/account-address-book/account-address-book-delete.js +184 -0
- package/dist/matter/account-address-book/account-address-book-delete.js.map +1 -0
- package/dist/matter/account-address-book/account-address-book-deliverability.d.ts +19 -0
- package/dist/matter/account-address-book/account-address-book-deliverability.js +50 -0
- package/dist/matter/account-address-book/account-address-book-deliverability.js.map +1 -0
- package/dist/matter/account-address-book/account-address-book-form-parts.d.ts +42 -0
- package/dist/matter/account-address-book/account-address-book-form-parts.js +146 -0
- package/dist/matter/account-address-book/account-address-book-form-parts.js.map +1 -0
- package/dist/matter/account-address-book/account-address-book-profile-notice.d.ts +25 -0
- package/dist/matter/account-address-book/account-address-book-profile-notice.js +72 -0
- package/dist/matter/account-address-book/account-address-book-profile-notice.js.map +1 -0
- package/dist/matter/account-address-book/account-address-book.d.ts +120 -0
- package/dist/matter/account-address-book/account-address-book.js +469 -0
- package/dist/matter/account-address-book/account-address-book.js.map +1 -0
- package/dist/matter/account-address-book/account-address-country-switch.js +59 -0
- package/dist/matter/account-address-book/account-address-country-switch.js.map +1 -0
- package/dist/matter/account-address-book/account-address-country.d.ts +36 -0
- package/dist/matter/account-address-book/account-address-country.js +151 -0
- package/dist/matter/account-address-book/account-address-country.js.map +1 -0
- package/dist/matter/account-address-book/account-address-first-line.js +11 -0
- package/dist/matter/account-address-book/account-address-first-line.js.map +1 -0
- package/dist/matter/account-address-book/account-address-form-context.d.ts +55 -0
- package/dist/matter/account-address-book/account-address-form-context.js +14 -0
- package/dist/matter/account-address-book/account-address-form-context.js.map +1 -0
- package/dist/matter/account-address-book/account-address-form.d.ts +85 -0
- package/dist/matter/account-address-book/account-address-form.js +946 -0
- package/dist/matter/account-address-book/account-address-form.js.map +1 -0
- package/dist/matter/account-address-book/account-address-postal-autofill.js +189 -0
- package/dist/matter/account-address-book/account-address-postal-autofill.js.map +1 -0
- package/dist/matter/account-address-book/account-address-record.d.ts +26 -0
- package/dist/matter/account-address-book/account-address-record.js +138 -0
- package/dist/matter/account-address-book/account-address-record.js.map +1 -0
- package/dist/matter/account-entry-point/account-entry-point.js +11 -11
- package/dist/matter/account-entry-point/account-entry-point.js.map +1 -1
- package/dist/matter/account-menu/account-menu.d.ts +77 -3
- package/dist/matter/account-menu/account-menu.js +252 -19
- package/dist/matter/account-menu/account-menu.js.map +1 -1
- package/dist/matter/account-menu/sign-out-failure.js +50 -0
- package/dist/matter/account-menu/sign-out-failure.js.map +1 -0
- package/dist/matter/account-menu-identity/account-menu-identity.d.ts +21 -0
- package/dist/matter/account-menu-identity/account-menu-identity.js +88 -0
- package/dist/matter/account-menu-identity/account-menu-identity.js.map +1 -0
- package/dist/matter/billing-address/billing-address.d.ts +30 -17
- package/dist/matter/billing-address/billing-address.js +128 -33
- package/dist/matter/billing-address/billing-address.js.map +1 -1
- package/dist/matter/breadcrumb/breadcrumb.js +2 -2
- package/dist/matter/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/matter/card-entry/card-capture.js +4 -3
- package/dist/matter/card-entry/card-capture.js.map +1 -1
- package/dist/matter/card-entry/card-entry.d.ts +5 -3
- package/dist/matter/card-entry/card-entry.js +78 -27
- package/dist/matter/card-entry/card-entry.js.map +1 -1
- package/dist/matter/cardholder-document/cardholder-document.d.ts +10 -9
- package/dist/matter/cardholder-document/cardholder-document.js +36 -16
- package/dist/matter/cardholder-document/cardholder-document.js.map +1 -1
- package/dist/matter/cart/cart.d.ts +7 -2
- package/dist/matter/cart/cart.js +29 -26
- package/dist/matter/cart/cart.js.map +1 -1
- package/dist/matter/cart-item/cart-item.js +2 -2
- package/dist/matter/cart-item/cart-item.js.map +1 -1
- package/dist/matter/client-preferences/client-preferences-fieldset.js +2 -2
- package/dist/matter/client-profile-form/client-profile-fieldset.js +9 -6
- package/dist/matter/client-profile-form/client-profile-fieldset.js.map +1 -1
- package/dist/matter/identity-edit/identity-edit.js +3 -3
- package/dist/matter/identity-edit/identity-edit.js.map +1 -1
- package/dist/matter/identity-summary/identity-summary.js +4 -3
- package/dist/matter/identity-summary/identity-summary.js.map +1 -1
- package/dist/matter/my-account-profile/my-account-profile.d.ts +6 -3
- package/dist/matter/my-account-profile/my-account-profile.js +6 -5
- package/dist/matter/my-account-profile/my-account-profile.js.map +1 -1
- package/dist/matter/order-cancel/order-cancel.d.ts +110 -0
- package/dist/matter/order-cancel/order-cancel.js +344 -0
- package/dist/matter/order-cancel/order-cancel.js.map +1 -0
- package/dist/matter/order-delivery-address/order-delivery-address.d.ts +73 -0
- package/dist/matter/order-delivery-address/order-delivery-address.js +172 -0
- package/dist/matter/order-delivery-address/order-delivery-address.js.map +1 -0
- package/dist/matter/order-delivery-group/order-delivery-group.d.ts +128 -0
- package/dist/matter/order-delivery-group/order-delivery-group.js +408 -0
- package/dist/matter/order-delivery-group/order-delivery-group.js.map +1 -0
- package/dist/matter/order-details-header/order-details-header.d.ts +104 -0
- package/dist/matter/order-details-header/order-details-header.js +190 -0
- package/dist/matter/order-details-header/order-details-header.js.map +1 -0
- package/dist/matter/order-list/customer-orders-filter.d.ts +12 -0
- package/dist/matter/order-list/customer-orders-filter.js +30 -0
- package/dist/matter/order-list/customer-orders-filter.js.map +1 -0
- package/dist/matter/order-list/order-list.d.ts +121 -0
- package/dist/matter/order-list/order-list.js +395 -0
- package/dist/matter/order-list/order-list.js.map +1 -0
- package/dist/matter/order-list-row/order-list-row.d.ts +44 -0
- package/dist/matter/order-list-row/order-list-row.js +127 -0
- package/dist/matter/order-list-row/order-list-row.js.map +1 -0
- package/dist/matter/order-list-search/order-list-search.d.ts +72 -0
- package/dist/matter/order-list-search/order-list-search.js +296 -0
- package/dist/matter/order-list-search/order-list-search.js.map +1 -0
- package/dist/matter/order-list-views/order-list-views.d.ts +65 -0
- package/dist/matter/order-list-views/order-list-views.js +154 -0
- package/dist/matter/order-list-views/order-list-views.js.map +1 -0
- package/dist/matter/order-payment/order-payment.d.ts +83 -0
- package/dist/matter/order-payment/order-payment.js +258 -0
- package/dist/matter/order-payment/order-payment.js.map +1 -0
- package/dist/matter/order-placed/order-placed-deliveries.d.ts +145 -0
- package/dist/matter/order-placed/order-placed-deliveries.js +380 -0
- package/dist/matter/order-placed/order-placed-deliveries.js.map +1 -0
- package/dist/matter/order-placed/order-placed.d.ts +122 -0
- package/dist/matter/order-placed/order-placed.js +452 -0
- package/dist/matter/order-placed/order-placed.js.map +1 -0
- package/dist/matter/order-placed-date/order-placed-date.d.ts +45 -0
- package/dist/matter/order-placed-date/order-placed-date.js +92 -0
- package/dist/matter/order-placed-date/order-placed-date.js.map +1 -0
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.d.ts +5 -8
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js +29 -81
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js.map +1 -1
- package/dist/matter/order-progress/order-progress.d.ts +85 -0
- package/dist/matter/order-progress/order-progress.js +203 -0
- package/dist/matter/order-progress/order-progress.js.map +1 -0
- package/dist/matter/order-summary/order-summary.d.ts +81 -0
- package/dist/matter/order-summary/order-summary.js +192 -0
- package/dist/matter/order-summary/order-summary.js.map +1 -0
- package/dist/matter/payment/cardholder-document-rule.d.ts +35 -0
- package/dist/matter/payment/cardholder-document-rule.js +35 -0
- package/dist/matter/payment/cardholder-document-rule.js.map +1 -0
- package/dist/matter/payment/payment-card-capture.js +38 -23
- package/dist/matter/payment/payment-card-capture.js.map +1 -1
- package/dist/matter/payment/payment-controller.js +12 -0
- package/dist/matter/payment/payment-controller.js.map +1 -1
- package/dist/matter/payment/payment-method-badges.js +4 -2
- package/dist/matter/payment/payment-method-badges.js.map +1 -1
- package/dist/matter/payment/payment.js +12 -0
- package/dist/matter/payment/payment.js.map +1 -1
- package/dist/matter/payment/use-payment-method-selection.d.ts +39 -0
- package/dist/matter/payment/use-payment-method-selection.js +30 -2
- package/dist/matter/payment/use-payment-method-selection.js.map +1 -1
- package/dist/matter/payment/use-payment-submit-gate.d.ts +16 -2
- package/dist/matter/payment/use-payment-submit-gate.js +42 -14
- package/dist/matter/payment/use-payment-submit-gate.js.map +1 -1
- package/dist/matter/place-order/place-order.d.ts +12 -7
- package/dist/matter/place-order/place-order.js +126 -103
- package/dist/matter/place-order/place-order.js.map +1 -1
- package/dist/matter/pricing/pricing.js +5 -5
- package/dist/matter/pricing/pricing.js.map +1 -1
- package/dist/matter/product-shelf/product-shelf.d.ts +61 -31
- package/dist/matter/product-shelf/product-shelf.js +157 -57
- package/dist/matter/product-shelf/product-shelf.js.map +1 -1
- package/dist/matter/region/region.js +1 -1
- package/dist/matter/saved-cards/saved-cards.js +27 -15
- package/dist/matter/saved-cards/saved-cards.js.map +1 -1
- package/dist/matter/session/session.js +2 -2
- package/dist/matter/session/session.js.map +1 -1
- package/dist/matter/shipping-address/country-descriptors.d.ts +1 -0
- package/dist/matter/shipping-address/country-descriptors.js +23 -1
- package/dist/matter/shipping-address/country-descriptors.js.map +1 -1
- package/dist/matter/shipping-address/shipping-address.js +63 -15
- package/dist/matter/shipping-address/shipping-address.js.map +1 -1
- package/dist/matter/shipping-simulator/shipping-simulator.d.ts +1 -1
- package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
- package/dist/matter/sign-in-redirect/sign-in-redirect.js +48 -10
- package/dist/matter/sign-in-redirect/sign-in-redirect.js.map +1 -1
- package/dist/matter/variant-selector/variant-selector.js +2 -2
- package/dist/matter/variant-selector/variant-selector.js.map +1 -1
- package/dist/particles/address-summary/address-summary.js +2 -2
- package/dist/particles/address-summary/address-summary.js.map +1 -1
- package/dist/particles/alert-dialog/alert-dialog.d.ts +5 -1
- package/dist/particles/alert-dialog/alert-dialog.js +5 -2
- package/dist/particles/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/particles/avatar/avatar.d.ts +17 -0
- package/dist/particles/avatar/avatar.js +65 -0
- package/dist/particles/avatar/avatar.js.map +1 -0
- package/dist/particles/copy-text/copy-text.d.ts +28 -0
- package/dist/particles/copy-text/copy-text.js +140 -0
- package/dist/particles/copy-text/copy-text.js.map +1 -0
- package/dist/particles/document-field/document-field.d.ts +34 -5
- package/dist/particles/document-field/document-field.js +115 -19
- package/dist/particles/document-field/document-field.js.map +1 -1
- package/dist/particles/field/field.js +1 -1
- package/dist/particles/field/field.js.map +1 -1
- package/dist/particles/footer-link-group/footer-link-group.d.ts +6 -2
- package/dist/particles/footer-link-group/footer-link-group.js +18 -7
- package/dist/particles/footer-link-group/footer-link-group.js.map +1 -1
- package/dist/particles/incentives/incentives.d.ts +6 -2
- package/dist/particles/incentives/incentives.js +7 -2
- package/dist/particles/incentives/incentives.js.map +1 -1
- package/dist/particles/logo/logo.d.ts +3 -2
- package/dist/particles/logo/logo.js +20 -8
- package/dist/particles/logo/logo.js.map +1 -1
- package/dist/particles/navigation-link/navigation-link.d.ts +2 -3
- package/dist/particles/navigation-link/navigation-link.js +4 -4
- package/dist/particles/navigation-link/navigation-link.js.map +1 -1
- package/dist/particles/navigation-link-list/navigation-link-list.d.ts +6 -2
- package/dist/particles/navigation-link-list/navigation-link-list.js +18 -7
- package/dist/particles/navigation-link-list/navigation-link-list.js.map +1 -1
- package/dist/particles/order-details-back/order-details-back.d.ts +28 -0
- package/dist/particles/order-details-back/order-details-back.js +52 -0
- package/dist/particles/order-details-back/order-details-back.js.map +1 -0
- package/dist/particles/order-status-badge/order-status-badge.d.ts +19 -0
- package/dist/particles/order-status-badge/order-status-badge.js +50 -0
- package/dist/particles/order-status-badge/order-status-badge.js.map +1 -0
- package/dist/particles/phone-field/phone-field.js +2 -2
- package/dist/particles/phone-field/phone-field.js.map +1 -1
- package/dist/particles/select/select.js +6 -6
- package/dist/particles/select/select.js.map +1 -1
- package/dist/particles/toast/toast.d.ts +1 -1
- package/dist/particles/toast/toast.js +32 -6
- package/dist/particles/toast/toast.js.map +1 -1
- package/dist/schema.graphql +1079 -54
- package/dist/sdk/actions/address-action-provider.d.ts +16 -0
- package/dist/sdk/actions/address-action-provider.js +20 -0
- package/dist/sdk/actions/address-action-provider.js.map +1 -0
- package/dist/sdk/actions/analytics-action-provider.js +1 -1
- package/dist/sdk/actions/index.d.ts +3 -1
- package/dist/sdk/actions/index.js +3 -1
- package/dist/sdk/actions/order-action-provider.d.ts +12 -0
- package/dist/sdk/actions/order-action-provider.js +16 -0
- package/dist/sdk/actions/order-action-provider.js.map +1 -0
- package/dist/sdk/actions/types.d.ts +6 -2
- package/dist/sdk/address/address-fields.js +38 -0
- package/dist/sdk/address/address-fields.js.map +1 -0
- package/dist/sdk/address/checkout-readiness.js +17 -0
- package/dist/sdk/address/checkout-readiness.js.map +1 -0
- package/dist/sdk/address/constants.js +60 -0
- package/dist/sdk/address/constants.js.map +1 -0
- package/dist/sdk/address/country-display.js +19 -0
- package/dist/sdk/address/country-display.js.map +1 -0
- package/dist/sdk/address/country-rules.js +30 -0
- package/dist/sdk/address/country-rules.js.map +1 -0
- package/dist/sdk/address/format-address.js +18 -0
- package/dist/sdk/address/format-address.js.map +1 -0
- package/dist/sdk/address/iso-countries.js +262 -0
- package/dist/sdk/address/iso-countries.js.map +1 -0
- package/dist/sdk/address/layouts.js +56 -0
- package/dist/sdk/address/layouts.js.map +1 -0
- package/dist/sdk/address/messages.js +97 -0
- package/dist/sdk/address/messages.js.map +1 -0
- package/dist/sdk/address/operations.d.ts +54 -0
- package/dist/sdk/address/operations.js +83 -0
- package/dist/sdk/address/operations.js.map +1 -0
- package/dist/sdk/address/postal-code-lookup-operations.js +23 -0
- package/dist/sdk/address/postal-code-lookup-operations.js.map +1 -0
- package/dist/sdk/address/postal-code.js +11 -0
- package/dist/sdk/address/postal-code.js.map +1 -0
- package/dist/sdk/address/schema.js +14 -0
- package/dist/sdk/address/schema.js.map +1 -0
- package/dist/sdk/address/server-fields.js +25 -0
- package/dist/sdk/address/server-fields.js.map +1 -0
- package/dist/sdk/address/switch-country.js +57 -0
- package/dist/sdk/address/switch-country.js.map +1 -0
- package/dist/sdk/address/types.d.ts +26 -0
- package/dist/sdk/address/use-address-actions.d.ts +29 -0
- package/dist/sdk/address/use-address-actions.js +247 -0
- package/dist/sdk/address/use-address-actions.js.map +1 -0
- package/dist/sdk/address/use-address-by-postal-code.js +57 -0
- package/dist/sdk/address/use-address-by-postal-code.js.map +1 -0
- package/dist/sdk/address/validate-address.js +62 -0
- package/dist/sdk/address/validate-address.js.map +1 -0
- package/dist/sdk/analytics/use-analytics-actions.js +2 -1
- package/dist/sdk/analytics/use-analytics-actions.js.map +1 -1
- package/dist/sdk/cache/storefront-cache.js +29 -4
- package/dist/sdk/cache/storefront-cache.js.map +1 -1
- package/dist/sdk/cart/use-cart-actions.js +9 -8
- package/dist/sdk/cart/use-cart-actions.js.map +1 -1
- package/dist/sdk/cart/use-cart-validate-on-open.js +2 -1
- package/dist/sdk/cart/use-cart-validate-on-open.js.map +1 -1
- package/dist/sdk/client/fetch-page-data.d.ts +11 -0
- package/dist/sdk/client/fetch-page-data.js +12 -1
- package/dist/sdk/client/fetch-page-data.js.map +1 -1
- package/dist/sdk/content/create-content-runtime.d.ts +22 -1
- package/dist/sdk/content/create-content-runtime.js +90 -9
- package/dist/sdk/content/create-content-runtime.js.map +1 -1
- package/dist/sdk/data/empty-content-value.js +16 -0
- package/dist/sdk/data/empty-content-value.js.map +1 -0
- package/dist/sdk/data/failed-fields.js +23 -0
- package/dist/sdk/data/failed-fields.js.map +1 -0
- package/dist/sdk/data/hot-data-provider.js +2 -1
- package/dist/sdk/data/hot-data-provider.js.map +1 -1
- package/dist/sdk/data/index.js +1 -1
- package/dist/sdk/data/page-reactive-data-root.d.ts +45 -7
- package/dist/sdk/data/page-reactive-data-root.js +88 -12
- package/dist/sdk/data/page-reactive-data-root.js.map +1 -1
- package/dist/sdk/data/variables-from-content.d.ts +43 -0
- package/dist/sdk/data/variables-from-content.js +57 -0
- package/dist/sdk/data/variables-from-content.js.map +1 -0
- package/dist/sdk/generated/fragment-types.js +2 -0
- package/dist/sdk/generated/fragment-types.js.map +1 -1
- package/dist/sdk/generated/gql.js +4 -1
- package/dist/sdk/generated/gql.js.map +1 -1
- package/dist/sdk/generated/graphql.d.ts +8 -0
- package/dist/sdk/generated/graphql.js +296 -1
- package/dist/sdk/generated/graphql.js.map +1 -1
- package/dist/sdk/i18n/messages/en-US.js +138 -1
- package/dist/sdk/i18n/messages/en-US.json +138 -1
- package/dist/sdk/i18n/messages/en-US.json.d.ts +137 -0
- package/dist/sdk/i18n/messages/es-ES.js +138 -1
- package/dist/sdk/i18n/messages/es-ES.json +138 -1
- package/dist/sdk/i18n/messages/pt-BR.js +138 -1
- package/dist/sdk/i18n/messages/pt-BR.json +138 -1
- package/dist/sdk/identity/use-identity-actions.js +5 -4
- package/dist/sdk/identity/use-identity-actions.js.map +1 -1
- package/dist/sdk/navigation/current-page.js +30 -0
- package/dist/sdk/navigation/current-page.js.map +1 -0
- package/dist/sdk/navigation/not-found-log.d.ts +28 -0
- package/dist/sdk/navigation/not-found-log.js +133 -0
- package/dist/sdk/navigation/not-found-log.js.map +1 -0
- package/dist/sdk/navigation/path.js +25 -0
- package/dist/sdk/navigation/path.js.map +1 -0
- package/dist/sdk/navigation/redirect.d.ts +11 -0
- package/dist/sdk/navigation/redirect.js +22 -0
- package/dist/sdk/navigation/redirect.js.map +1 -0
- package/dist/sdk/navigation/report.js +70 -0
- package/dist/sdk/navigation/report.js.map +1 -0
- package/dist/sdk/navigation/resolve-storefront-href.d.ts +12 -0
- package/dist/sdk/navigation/resolve-storefront-href.js +214 -0
- package/dist/sdk/navigation/resolve-storefront-href.js.map +1 -0
- package/dist/sdk/navigation/route-identity-provider.d.ts +11 -0
- package/dist/sdk/navigation/route-identity-provider.js +20 -0
- package/dist/sdk/navigation/route-identity-provider.js.map +1 -0
- package/dist/sdk/navigation/route-map-provider.d.ts +19 -0
- package/dist/sdk/navigation/route-map-provider.js +29 -0
- package/dist/sdk/navigation/route-map-provider.js.map +1 -0
- package/dist/sdk/navigation/storefront-link.d.ts +16 -0
- package/dist/sdk/navigation/storefront-link.js +66 -0
- package/dist/sdk/navigation/storefront-link.js.map +1 -0
- package/dist/sdk/navigation/types.d.ts +45 -0
- package/dist/sdk/navigation/use-storefront-navigation.d.ts +26 -0
- package/dist/sdk/navigation/use-storefront-navigation.js +73 -0
- package/dist/sdk/navigation/use-storefront-navigation.js.map +1 -0
- package/dist/sdk/navigation/use-storefront-route.d.ts +26 -0
- package/dist/sdk/navigation/use-storefront-route.js +87 -0
- package/dist/sdk/navigation/use-storefront-route.js.map +1 -0
- package/dist/sdk/navigation/use-storefront-search-params.d.ts +11 -0
- package/dist/sdk/navigation/use-storefront-search-params.js +16 -0
- package/dist/sdk/navigation/use-storefront-search-params.js.map +1 -0
- package/dist/sdk/orders/completion-badge.d.ts +8 -0
- package/dist/sdk/orders/completion-badge.js +47 -0
- package/dist/sdk/orders/completion-badge.js.map +1 -0
- package/dist/sdk/orders/order-operations.d.ts +19 -0
- package/dist/sdk/orders/order-operations.js +21 -0
- package/dist/sdk/orders/order-operations.js.map +1 -0
- package/dist/sdk/orders/use-order-actions.d.ts +23 -0
- package/dist/sdk/orders/use-order-actions.js +62 -0
- package/dist/sdk/orders/use-order-actions.js.map +1 -0
- package/dist/sdk/payment/gateway-origin.js +26 -13
- package/dist/sdk/payment/gateway-origin.js.map +1 -1
- package/dist/sdk/payment/gateway.d.ts +14 -2
- package/dist/sdk/payment/gateway.js +32 -14
- package/dist/sdk/payment/gateway.js.map +1 -1
- package/dist/sdk/payment/operations.js +11 -0
- package/dist/sdk/payment/operations.js.map +1 -1
- package/dist/sdk/payment/submission-registry.d.ts +2 -1
- package/dist/sdk/payment/submission-registry.js +12 -8
- package/dist/sdk/payment/submission-registry.js.map +1 -1
- package/dist/sdk/payment/use-payment-actions.d.ts +5 -3
- package/dist/sdk/payment/use-payment-actions.js +6 -3
- package/dist/sdk/payment/use-payment-actions.js.map +1 -1
- package/dist/sdk/payment/use-place-order.d.ts +6 -3
- package/dist/sdk/payment/use-place-order.js +334 -144
- package/dist/sdk/payment/use-place-order.js.map +1 -1
- package/dist/sdk/region/use-region-actions.js +2 -1
- package/dist/sdk/region/use-region-actions.js.map +1 -1
- package/dist/sdk/seo/page-alternates.d.ts +55 -0
- package/dist/sdk/seo/page-alternates.js +132 -0
- package/dist/sdk/seo/page-alternates.js.map +1 -0
- package/dist/sdk/session/read-server-session.d.ts +21 -0
- package/dist/sdk/session/read-server-session.js +61 -0
- package/dist/sdk/session/read-server-session.js.map +1 -0
- package/dist/sdk/session/use-session-actions.js +5 -4
- package/dist/sdk/session/use-session-actions.js.map +1 -1
- package/dist/sdk/session/use-session-revalidation.js +2 -1
- package/dist/sdk/session/use-session-revalidation.js.map +1 -1
- package/dist/sdk/shipping/use-shipping-actions.js +3 -2
- package/dist/sdk/shipping/use-shipping-actions.js.map +1 -1
- package/dist/utils/own-value.js +19 -0
- package/dist/utils/own-value.js.map +1 -0
- package/dist/utils/safe-href.d.ts +11 -0
- package/dist/utils/safe-href.js +31 -22
- package/dist/utils/safe-href.js.map +1 -1
- package/package.json +17 -2
- package/skills/storefront-asset/SKILL.md +111 -0
- package/skills/storefront-asset/references/api-side.md +153 -0
- package/skills/storefront-asset/references/findings.md +40 -0
- package/skills/storefront-asset/references/ui-side.md +94 -0
- package/src/styles/tailwind.css +27 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logo.js","names":[],"sources":["../../../src/particles/logo/logo.tsx"],"sourcesContent":["import { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef } from 'react';\nimport { resolveSafeHref } from '../../utils/safe-href.js';\nimport { Image } from '../image/image.js';\nimport { NavigationLink } from '../navigation-link/navigation-link.js';\n\n// `src` declares no `format`: a store's logo is usually a root-relative path served from its\n// `public/` folder (`/logo.svg`), which JSON Schema's `uri` format rejects.\nexport const LogoContent = defineContentType({\n id: 'logo',\n title: 'Logo',\n description: 'Brand logo asset, alt text, and link destination.',\n schema: {\n type: 'object',\n additionalProperties: false,\n // `src` is optional so an entry authoring `alt` alone still validates: a slice missing a\n // required property is shape-invalid, and the boundary drops the element instead of the field.\n required: ['alt'],\n properties: {\n src: { type: 'string', minLength: 1, title: 'Source URL', widget: { 'ui:widget': 'media-gallery' } },\n alt: { type: 'string', minLength: 1, title: 'Alt text' },\n href: {\n type: 'string',\n minLength: 1,\n title: 'Link destination',\n format: 'uri-reference',\n // The set `resolveSafeHref` admits, so the Admin form cannot reject a destination the render\n // gate would have kept. Author-time only and lookahead-free, as in the sibling particles.\n pattern: '^(?:https?://.*|mailto:.+|tel:.+|/(?:[^/].*)?)$',\n },\n },\n },\n});\n\n/** Props for {@link Logo}. Extends native `<div>` attributes (the styling root). */\nexport type LogoProps = Omit<ComponentPropsWithRef<'div'>, 'children'> & {\n /** Brand logo asset URL. Optional: the render gate, not the type, requires a resolved value. */\n src?: string;\n /** Accessible alt text. Optional: the render gate, not the type, requires a resolved value. */\n alt?: string;\n /** Navigation destination; defaults to the
|
|
1
|
+
{"version":3,"file":"logo.js","names":[],"sources":["../../../src/particles/logo/logo.tsx"],"sourcesContent":["import { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef } from 'react';\nimport type { PageRef } from '../../sdk/navigation/types.js';\nimport { resolveSafeHref } from '../../utils/safe-href.js';\nimport { Image } from '../image/image.js';\nimport { NavigationLink } from '../navigation-link/navigation-link.js';\n\n// `src` declares no `format`: a store's logo is usually a root-relative path served from its\n// `public/` folder (`/logo.svg`), which JSON Schema's `uri` format rejects.\nexport const LogoContent = defineContentType({\n id: 'logo',\n title: 'Logo',\n description: 'Brand logo asset, alt text, and link destination.',\n schema: {\n type: 'object',\n additionalProperties: false,\n // `src` is optional so an entry authoring `alt` alone still validates: a slice missing a\n // required property is shape-invalid, and the boundary drops the element instead of the field.\n required: ['alt'],\n properties: {\n src: { type: 'string', minLength: 1, title: 'Source URL', widget: { 'ui:widget': 'media-gallery' } },\n alt: { type: 'string', minLength: 1, title: 'Alt text' },\n href: {\n type: 'string',\n minLength: 1,\n title: 'Link destination',\n format: 'uri-reference',\n // The set `resolveSafeHref` admits, so the Admin form cannot reject a destination the render\n // gate would have kept. Author-time only and lookahead-free, as in the sibling particles.\n pattern: '^(?:https?://.*|mailto:.+|tel:.+|/(?:[^/].*)?)$',\n },\n },\n },\n});\n\n/** Props for {@link Logo}. Extends native `<div>` attributes (the styling root). */\nexport type LogoProps = Omit<ComponentPropsWithRef<'div'>, 'children'> & {\n /** Brand logo asset URL. Optional: the render gate, not the type, requires a resolved value. */\n src?: string;\n /** Accessible alt text. Optional: the render gate, not the type, requires a resolved value. */\n alt?: string;\n /** Navigation destination; defaults to the home page. A string that fails the safety check is dropped. */\n href?: PageRef | string;\n /** Image loading strategy. `eager` suits the above-the-fold header; author `lazy` below it. */\n loading?: 'lazy' | 'eager';\n /** Merchant-authored logo, sliced from the page/layout content entry; wins over the props when\n * present. Absent in a non-CMS store — the props are the fallback. */\n $content?: ContentValue<typeof LogoContent>;\n};\n\nexport const LogoDefinition = defineComponent<LogoProps>({\n name: 'Logo',\n importPath: '@vtex/faststore/components',\n component: Logo,\n content: LogoContent,\n editor: { label: 'Logo', category: 'content' },\n schema: {\n src: { type: 'string', label: 'Source URL' },\n alt: { type: 'string', label: 'Alt Text' },\n href: { type: 'link', default: { standard: 'home' }, label: 'Link Destination' },\n loading: { type: ['lazy', 'eager'] as const, default: 'eager', label: 'Loading' },\n },\n guideline:\n 'Brand logo linking to the configured home; a CMS entry overrides its src, alt, and href at runtime. Every prop is optional: an element bound to a CMS entry should author none of them, so an unconfigured store renders no logo instead of a placeholder. Author src and alt only where no entry supplies them, never as a fallback beside one. Size it responsively with a swatch on data-fs-logo, and reach the mark itself through data-fs-logo-image. A destination that is not an http, https, mailto, tel, or site-relative URL is dropped and the image renders unlinked. Loads eagerly for the above-the-fold header; set loading to lazy below the fold. Composes the Image and NavigationLink particles.',\n});\n\nexport function Logo({\n src,\n alt,\n href = { standard: 'home' },\n loading = 'eager',\n $content,\n className,\n ...props\n}: LogoProps) {\n // The optional content fields fall through when blank, so clearing one in the Admin reads as\n // unauthored. `alt` is required in the model, so a blank value is a violation the gate rejects.\n const logoSrc = $content?.src?.trim() ? $content.src : src;\n const logoAlt = $content?.alt ?? alt;\n // A non-blank CMS string wins, and a refusal drops the link rather than falling back to the prop.\n const logoHref = $content?.href?.trim() ? $content.href : href;\n\n if (!logoSrc || !logoAlt?.trim()) {\n return null;\n }\n\n const destination = resolveLogoHref(logoHref);\n const image = <Image src={logoSrc} alt={logoAlt} loading={loading} data-fs-logo-image=\"\" />;\n\n return (\n <div {...props} className={className} data-fs-logo=\"\">\n {destination === null ? image : <NavigationLink href={destination}>{image}</NavigationLink>}\n </div>\n );\n}\n\n/**\n * A page reference skips the string allowlist. A string is checked, and a refusal drops the link.\n * No read-time validator enforces `format` or `pattern`, so this is the only gate on a CMS string.\n */\nfunction resolveLogoHref(href: PageRef | string): PageRef | string | null {\n if (typeof href !== 'string') return href;\n\n const destination = resolveSafeHref(href);\n if (!destination.safe) {\n // A bounded reason and no authored value, the convention the content runtime's own log follows.\n console.warn('[Logo] link destination rejected', { reason: destination.reason });\n return null;\n }\n\n return destination.href;\n}\n"],"mappings":";;;;;;;;AASA,MAAa,cAAc,kBAAkB;CAC3C,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EAGtB,UAAU,CAAC,KAAK;EAChB,YAAY;GACV,KAAK;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;IAAc,QAAQ,EAAE,aAAa,gBAAgB;GAAE;GACnG,KAAK;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAW;GACvD,MAAM;IACJ,MAAM;IACN,WAAW;IACX,OAAO;IACP,QAAQ;IAGR,SAAS;GACX;EACF;CACF;AACF,CAAC;AAiBD,MAAa,iBAAiB,gBAA2B;CACvD,MAAM;CACN,YAAY;CACZ,WAAW;CACX,SAAS;CACT,QAAQ;EAAE,OAAO;EAAQ,UAAU;CAAU;CAC7C,QAAQ;EACN,KAAK;GAAE,MAAM;GAAU,OAAO;EAAa;EAC3C,KAAK;GAAE,MAAM;GAAU,OAAO;EAAW;EACzC,MAAM;GAAE,MAAM;GAAQ,SAAS,EAAE,UAAU,OAAO;GAAG,OAAO;EAAmB;EAC/E,SAAS;GAAE,MAAM,CAAC,QAAQ,OAAO;GAAY,SAAS;GAAS,OAAO;EAAU;CAClF;CACA,WACE;AACJ,CAAC;AAED,SAAgB,KAAK,EACnB,KACA,KACA,OAAO,EAAE,UAAU,OAAO,GAC1B,UAAU,SACV,UACA,WACA,GAAG,SACS;CAGZ,MAAM,UAAU,UAAU,KAAK,KAAK,IAAI,SAAS,MAAM;CACvD,MAAM,UAAU,UAAU,OAAO;CAEjC,MAAM,WAAW,UAAU,MAAM,KAAK,IAAI,SAAS,OAAO;CAE1D,IAAI,CAAC,WAAW,CAAC,SAAS,KAAK,GAC7B,OAAO;CAGT,MAAM,cAAc,gBAAgB,QAAQ;CAC5C,MAAM,QAAQ,oBAAC,OAAD;EAAO,KAAK;EAAS,KAAK;EAAkB;EAAS,sBAAmB;CAAI,CAAA;CAE1F,OACE,oBAAC,OAAD;EAAK,GAAI;EAAkB;EAAW,gBAAa;EAChD,UAAA,gBAAgB,OAAO,QAAQ,oBAAC,gBAAD;GAAgB,MAAM;GAAc,UAAA;EAAsB,CAAA;CACvF,CAAA;AAET;;;;;AAMA,SAAS,gBAAgB,MAAiD;CACxE,IAAI,OAAO,SAAS,UAAU,OAAO;CAErC,MAAM,cAAc,gBAAgB,IAAI;CACxC,IAAI,CAAC,YAAY,MAAM;EAErB,QAAQ,KAAK,oCAAoC,EAAE,QAAQ,YAAY,OAAO,CAAC;EAC/E,OAAO;CACT;CAEA,OAAO,YAAY;AACrB"}
|
|
@@ -1,8 +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 {
|
|
5
|
-
import Link from "next/link";
|
|
4
|
+
import { StorefrontLinkProps } from "../../sdk/navigation/storefront-link.js";
|
|
6
5
|
//#region src/particles/navigation-link/navigation-link.d.ts
|
|
7
6
|
export declare const NavigationLinkContent: {
|
|
8
7
|
readonly id: "navigation-link";
|
|
@@ -32,7 +31,7 @@ export declare const NavigationLinkContent: {
|
|
|
32
31
|
};
|
|
33
32
|
};
|
|
34
33
|
};
|
|
35
|
-
export type NavigationLinkProps =
|
|
34
|
+
export type NavigationLinkProps = StorefrontLinkProps & {
|
|
36
35
|
/** Merchant-authored link, sliced from the page/layout content entry; wins over the props field by
|
|
37
36
|
* field when present. Absent in a non-CMS store — the props are the fallback. */
|
|
38
37
|
$content?: ContentValue<typeof NavigationLinkContent>;
|
|
@@ -3,8 +3,8 @@ 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 { resolveSafeHref } from "../../utils/safe-href.js";
|
|
6
|
+
import { StorefrontLink } from "../../sdk/navigation/storefront-link.js";
|
|
6
7
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
import Link from "next/link";
|
|
8
8
|
//#region src/particles/navigation-link/navigation-link.tsx
|
|
9
9
|
const NavigationLinkContent = defineContentType({
|
|
10
10
|
id: "navigation-link",
|
|
@@ -45,7 +45,7 @@ const NavigationLinkDefinition = defineComponent({
|
|
|
45
45
|
},
|
|
46
46
|
schema: {
|
|
47
47
|
href: {
|
|
48
|
-
type: "
|
|
48
|
+
type: "link",
|
|
49
49
|
label: "URL"
|
|
50
50
|
},
|
|
51
51
|
target: {
|
|
@@ -54,7 +54,7 @@ const NavigationLinkDefinition = defineComponent({
|
|
|
54
54
|
label: "Target"
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
|
-
guideline: "Client-side navigation link
|
|
57
|
+
guideline: "Client-side navigation link that renders StorefrontLink, where href is a page reference or a logical path. Use for all internal navigation to avoid full-page reloads. Set target to _blank to open the destination in a new tab; when you do, write an \"(opens in new tab)\" cue into the link text, because the component adds no announcement of its own. A CMS entry overrides the link text, href, and target at runtime; a destination it supplies that is not an http, https, mailto, tel, or site-relative URL is refused and the authored href stands."
|
|
58
58
|
});
|
|
59
59
|
function NavigationLink({ href, className, children, target, rel, $content, ...props }) {
|
|
60
60
|
const entryDestination = $content?.href?.trim() ? resolveSafeHref($content.href) : null;
|
|
@@ -66,7 +66,7 @@ function NavigationLink({ href, className, children, target, rel, $content, ...p
|
|
|
66
66
|
const relTokens = rel?.split(/\s+/).filter(Boolean) ?? [];
|
|
67
67
|
const present = new Set(relTokens.map((token) => token.toLowerCase()));
|
|
68
68
|
const safeRel = opensNewTab ? [...relTokens, ...["noopener", "noreferrer"].filter((token) => !present.has(token))].join(" ") : rel;
|
|
69
|
-
return /* @__PURE__ */ jsx(
|
|
69
|
+
return /* @__PURE__ */ jsx(StorefrontLink, {
|
|
70
70
|
...props,
|
|
71
71
|
href: linkHref,
|
|
72
72
|
target: linkTarget,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-link.js","names":[],"sources":["../../../src/particles/navigation-link/navigation-link.tsx"],"sourcesContent":["'use client';\n\nimport { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport
|
|
1
|
+
{"version":3,"file":"navigation-link.js","names":[],"sources":["../../../src/particles/navigation-link/navigation-link.tsx"],"sourcesContent":["'use client';\n\nimport { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport { StorefrontLink, type StorefrontLinkProps } from '../../sdk/navigation/storefront-link.js';\nimport { resolveSafeHref } from '../../utils/safe-href.js';\n\n// Only `text` is required — an entry that just retitles a link should not force the merchant to\n// retype its destination.\nexport const NavigationLinkContent = defineContentType({\n id: 'navigation-link',\n title: 'Navigation Link',\n description: 'Link label, destination, and whether it opens in a new tab.',\n schema: {\n type: 'object',\n additionalProperties: false,\n required: ['text'],\n properties: {\n text: { type: 'string', minLength: 1, title: 'Label' },\n href: {\n type: 'string',\n title: 'Destination',\n // `uri-reference` rather than `uri`, which rejects the root-relative paths most navigation\n // targets are. Author-time guidance only and lookahead-free, as in the sibling particles;\n // the empty alternative is this model's own, since clearing the field has to stay saveable.\n format: 'uri-reference',\n pattern: '^$|^(?:https?://.*|mailto:.+|tel:.+|/(?:[^/].*)?)$',\n },\n target: { type: 'string', enum: ['_self', '_blank'], title: 'Target' },\n },\n },\n});\n\nexport type NavigationLinkProps = StorefrontLinkProps & {\n /** Merchant-authored link, sliced from the page/layout content entry; wins over the props field by\n * field when present. Absent in a non-CMS store — the props are the fallback. */\n $content?: ContentValue<typeof NavigationLinkContent>;\n};\n\nexport const NavigationLinkDefinition = defineComponent<NavigationLinkProps>({\n name: 'NavigationLink',\n importPath: '@vtex/faststore/components',\n component: NavigationLink,\n content: NavigationLinkContent,\n editor: { label: 'Navigation Link', category: 'navigation' },\n schema: {\n href: { type: 'link', label: 'URL' },\n target: { type: ['_self', '_blank'] as const, default: '_self', label: 'Target' },\n },\n guideline:\n 'Client-side navigation link that renders StorefrontLink, where href is a page reference or a logical path. Use for all internal navigation to avoid full-page reloads. Set target to _blank to open the destination in a new tab; when you do, write an \"(opens in new tab)\" cue into the link text, because the component adds no announcement of its own. A CMS entry overrides the link text, href, and target at runtime; a destination it supplies that is not an http, https, mailto, tel, or site-relative URL is refused and the authored href stands.',\n});\n\nexport function NavigationLink({ href, className, children, target, rel, $content, ...props }: NavigationLinkProps) {\n // Resolve the entry before deriving anything from `target`: a _blank arriving from the CMS needs the\n // same tab-nabbing defense as an authored one. `href` and `text` fall back on a blank entry field so\n // a cleared value keeps the authored link rather than emitting an empty destination or label.\n // Only the entry's destination goes through the allowlist: the prop comes from the store's own\n // source, while nothing enforces the model's shape on the value the Admin supplies. A refused\n // destination falls back the same way a cleared one does.\n const entryDestination = $content?.href?.trim() ? resolveSafeHref($content.href) : null;\n if (entryDestination && !entryDestination.safe) {\n // A bounded reason and no authored value, the convention the content runtime's own log follows.\n console.warn('[NavigationLink] link destination rejected', { reason: entryDestination.reason });\n }\n const linkHref = entryDestination?.safe ? entryDestination.href : href;\n const linkTarget = $content?.target ?? target;\n const linkText = $content?.text?.trim() ? $content.text : children;\n\n // Target keywords are ASCII case-insensitive per HTML, so _BLANK opens a new tab just like _blank.\n const opensNewTab = linkTarget?.toLowerCase() === '_blank';\n // Append rather than replace: a composing matter may pass its own rel, and the tab-nabbing defense has to survive it.\n // Link types are case-insensitive too, so a caller-passed NOOPENER already counts as noopener.\n const relTokens = rel?.split(/\\s+/).filter(Boolean) ?? [];\n const present = new Set(relTokens.map((token) => token.toLowerCase()));\n const safeRel = opensNewTab\n ? [...relTokens, ...['noopener', 'noreferrer'].filter((token) => !present.has(token))].join(' ')\n : rel;\n\n return (\n <StorefrontLink\n {...props}\n href={linkHref}\n target={linkTarget}\n rel={safeRel}\n className={className}\n data-fs-navigation-link=\"\"\n >\n {linkText}\n </StorefrontLink>\n );\n}\n"],"mappings":";;;;;;;;AAQA,MAAa,wBAAwB,kBAAkB;CACrD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,UAAU,CAAC,MAAM;EACjB,YAAY;GACV,MAAM;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAQ;GACrD,MAAM;IACJ,MAAM;IACN,OAAO;IAIP,QAAQ;IACR,SAAS;GACX;GACA,QAAQ;IAAE,MAAM;IAAU,MAAM,CAAC,SAAS,QAAQ;IAAG,OAAO;GAAS;EACvE;CACF;AACF,CAAC;AAQD,MAAa,2BAA2B,gBAAqC;CAC3E,MAAM;CACN,YAAY;CACZ,WAAW;CACX,SAAS;CACT,QAAQ;EAAE,OAAO;EAAmB,UAAU;CAAa;CAC3D,QAAQ;EACN,MAAM;GAAE,MAAM;GAAQ,OAAO;EAAM;EACnC,QAAQ;GAAE,MAAM,CAAC,SAAS,QAAQ;GAAY,SAAS;GAAS,OAAO;EAAS;CAClF;CACA,WACE;AACJ,CAAC;AAED,SAAgB,eAAe,EAAE,MAAM,WAAW,UAAU,QAAQ,KAAK,UAAU,GAAG,SAA8B;CAOlH,MAAM,mBAAmB,UAAU,MAAM,KAAK,IAAI,gBAAgB,SAAS,IAAI,IAAI;CACnF,IAAI,oBAAoB,CAAC,iBAAiB,MAExC,QAAQ,KAAK,8CAA8C,EAAE,QAAQ,iBAAiB,OAAO,CAAC;CAEhG,MAAM,WAAW,kBAAkB,OAAO,iBAAiB,OAAO;CAClE,MAAM,aAAa,UAAU,UAAU;CACvC,MAAM,WAAW,UAAU,MAAM,KAAK,IAAI,SAAS,OAAO;CAG1D,MAAM,cAAc,YAAY,YAAY,MAAM;CAGlD,MAAM,YAAY,KAAK,MAAM,KAAK,CAAC,CAAC,OAAO,OAAO,KAAK,CAAC;CACxD,MAAM,UAAU,IAAI,IAAI,UAAU,KAAK,UAAU,MAAM,YAAY,CAAC,CAAC;CACrE,MAAM,UAAU,cACZ,CAAC,GAAG,WAAW,GAAG,CAAC,YAAY,YAAY,CAAC,CAAC,QAAQ,UAAU,CAAC,QAAQ,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAC7F;CAEJ,OACE,oBAAC,gBAAD;EACE,GAAI;EACJ,MAAM;EACN,QAAQ;EACR,KAAK;EACM;EACX,2BAAwB;EAEvB,UAAA;CACa,CAAA;AAEpB"}
|
|
@@ -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 } from "react";
|
|
5
6
|
//#region src/particles/navigation-link-list/navigation-link-list.d.ts
|
|
6
7
|
export declare const NavigationLinkListContent: {
|
|
@@ -45,8 +46,11 @@ export declare const NavigationLinkListContent: {
|
|
|
45
46
|
};
|
|
46
47
|
};
|
|
47
48
|
type NavigationLinkListContentValue = ContentValue<typeof NavigationLinkListContent>;
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
type NavigationLinkListContentLink = NonNullable<NavigationLinkListContentValue['links']>[number];
|
|
50
|
+
/** One authored link. The prop accepts a page reference; a CMS href stays a string. */
|
|
51
|
+
export type NavigationLinkListLink = Omit<NavigationLinkListContentLink, 'href'> & {
|
|
52
|
+
href: PageRef | string;
|
|
53
|
+
};
|
|
50
54
|
export type NavigationLinkListProps = ComponentPropsWithRef<'ul'> & {
|
|
51
55
|
/** Authored fallback for the link list, used when no CMS entry supplies one. */
|
|
52
56
|
links?: readonly NavigationLinkListLink[];
|
|
@@ -59,25 +59,36 @@ const NavigationLinkListDefinition = defineComponent({
|
|
|
59
59
|
} },
|
|
60
60
|
guideline: "The list of navigation links as one CMS-editable collection, so a merchant adds, removes and reorders them without a deployment. Owns its own <ul>, so compose it directly under NavigationMenuRoot for the desktop bar and inside DrawerPopup for the mobile panel — reference the same element id from both and one entry feeds both surfaces. See navigation-link-list.md."
|
|
61
61
|
});
|
|
62
|
+
function readLinks(content, authored) {
|
|
63
|
+
if (content !== void 0) return content;
|
|
64
|
+
return authored ?? [];
|
|
65
|
+
}
|
|
66
|
+
function resolveDestination(href, index) {
|
|
67
|
+
if (typeof href !== "string") return href;
|
|
68
|
+
const destination = resolveSafeHref(href);
|
|
69
|
+
if (!destination.safe) {
|
|
70
|
+
console.warn("[NavigationLinkList] link destination rejected", {
|
|
71
|
+
index,
|
|
72
|
+
reason: destination.reason
|
|
73
|
+
});
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
return destination.href;
|
|
77
|
+
}
|
|
62
78
|
function resolveLinks(links) {
|
|
63
79
|
const resolved = [];
|
|
64
80
|
links.forEach((link, index) => {
|
|
65
81
|
if (link.label.trim().length === 0) return;
|
|
66
|
-
const destination = resolveSafeHref(link.href);
|
|
67
|
-
if (!destination.safe) console.warn("[NavigationLinkList] link destination rejected", {
|
|
68
|
-
index,
|
|
69
|
-
reason: destination.reason
|
|
70
|
-
});
|
|
71
82
|
resolved.push({
|
|
72
83
|
label: link.label,
|
|
73
|
-
href:
|
|
84
|
+
href: resolveDestination(link.href, index),
|
|
74
85
|
target: link.target
|
|
75
86
|
});
|
|
76
87
|
});
|
|
77
88
|
return resolved;
|
|
78
89
|
}
|
|
79
90
|
function NavigationLinkList({ links, $content, className, ...props }) {
|
|
80
|
-
const resolved = resolveLinks($content?.links
|
|
91
|
+
const resolved = resolveLinks(readLinks($content?.links, links));
|
|
81
92
|
if (resolved.length === 0) return null;
|
|
82
93
|
return /* @__PURE__ */ jsx("ul", {
|
|
83
94
|
...props,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-link-list.js","names":[],"sources":["../../../src/particles/navigation-link-list/navigation-link-list.tsx"],"sourcesContent":["import { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef } from 'react';\nimport { resolveSafeHref } from '../../utils/safe-href.js';\nimport { NavigationLink } from '../navigation-link/navigation-link.js';\n\n// ---------------------------------------------------------------------------\n// Content model\n// ---------------------------------------------------------------------------\n\nexport const NavigationLinkListContent = defineContentType({\n id: 'navigation-link-list',\n title: 'Navigation Links',\n description: 'The ordered list of navigation links, editable without a deployment.',\n schema: {\n type: 'object',\n additionalProperties: false,\n // `links` is not required, for the reason FooterLinkGroup records: a missing element key already\n // omits the component, so requiring it would only cost the prop fallback its shape validity.\n properties: {\n links: {\n type: 'array',\n title: 'Links',\n minItems: 1,\n items: {\n type: 'object',\n additionalProperties: false,\n required: ['label', 'href'],\n properties: {\n label: { type: 'string', minLength: 1, title: 'Label' },\n href: {\n type: 'string',\n minLength: 1,\n title: 'URL',\n format: 'uri-reference',\n // Author-time guidance only, and lookahead-free so the Admin's RE2-family engine takes it.\n pattern: '^(?:https?://.*|mailto:.+|tel:.+|/(?:[^/].*)?)$',\n },\n target: { type: 'string', enum: ['_self', '_blank'], default: '_self', title: 'Open in' },\n },\n },\n },\n },\n },\n});\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\ntype NavigationLinkListContentValue = ContentValue<typeof NavigationLinkListContent>;\n\n/** One authored link.
|
|
1
|
+
{"version":3,"file":"navigation-link-list.js","names":[],"sources":["../../../src/particles/navigation-link-list/navigation-link-list.tsx"],"sourcesContent":["import { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef } from 'react';\nimport type { PageRef } from '../../sdk/navigation/types.js';\nimport { resolveSafeHref } from '../../utils/safe-href.js';\nimport { NavigationLink } from '../navigation-link/navigation-link.js';\n\n// ---------------------------------------------------------------------------\n// Content model\n// ---------------------------------------------------------------------------\n\nexport const NavigationLinkListContent = defineContentType({\n id: 'navigation-link-list',\n title: 'Navigation Links',\n description: 'The ordered list of navigation links, editable without a deployment.',\n schema: {\n type: 'object',\n additionalProperties: false,\n // `links` is not required, for the reason FooterLinkGroup records: a missing element key already\n // omits the component, so requiring it would only cost the prop fallback its shape validity.\n properties: {\n links: {\n type: 'array',\n title: 'Links',\n minItems: 1,\n items: {\n type: 'object',\n additionalProperties: false,\n required: ['label', 'href'],\n properties: {\n label: { type: 'string', minLength: 1, title: 'Label' },\n href: {\n type: 'string',\n minLength: 1,\n title: 'URL',\n format: 'uri-reference',\n // Author-time guidance only, and lookahead-free so the Admin's RE2-family engine takes it.\n pattern: '^(?:https?://.*|mailto:.+|tel:.+|/(?:[^/].*)?)$',\n },\n target: { type: 'string', enum: ['_self', '_blank'], default: '_self', title: 'Open in' },\n },\n },\n },\n },\n },\n});\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\ntype NavigationLinkListContentValue = ContentValue<typeof NavigationLinkListContent>;\n\ntype NavigationLinkListContentLink = NonNullable<NavigationLinkListContentValue['links']>[number];\n\n/** One authored link. The prop accepts a page reference; a CMS href stays a string. */\nexport type NavigationLinkListLink = Omit<NavigationLinkListContentLink, 'href'> & {\n href: PageRef | string;\n};\n\nexport type NavigationLinkListProps = ComponentPropsWithRef<'ul'> & {\n /** Authored fallback for the link list, used when no CMS entry supplies one. */\n links?: readonly NavigationLinkListLink[];\n /** Injected by the compiler, sliced from the page's or layout's composite content entry. */\n $content?: NavigationLinkListContentValue;\n};\n\n// ---------------------------------------------------------------------------\n// Definition\n// ---------------------------------------------------------------------------\n\nexport const NavigationLinkListDefinition = defineComponent({\n name: 'NavigationLinkList',\n importPath: '@vtex/faststore/components',\n component: NavigationLinkList,\n content: NavigationLinkListContent,\n editor: { label: 'Navigation Links', category: 'navigation' },\n schema: {\n links: { type: 'array', label: 'Links' },\n },\n guideline:\n 'The list of navigation links as one CMS-editable collection, so a merchant adds, removes and reorders them without a deployment. Owns its own <ul>, so compose it directly under NavigationMenuRoot for the desktop bar and inside DrawerPopup for the mobile panel — reference the same element id from both and one entry feeds both surfaces. See navigation-link-list.md.',\n});\n\n// ---------------------------------------------------------------------------\n// Implementation\n// ---------------------------------------------------------------------------\n\n/** A resolved link, ready to render. A null `href` is a destination the allowlist refused. */\ntype ResolvedLink = {\n label: string;\n href: PageRef | string | null;\n target: NavigationLinkListLink['target'];\n};\n\nfunction readLinks(\n content: readonly NavigationLinkListContentLink[] | undefined,\n authored: readonly NavigationLinkListLink[] | undefined,\n): readonly NavigationLinkListLink[] {\n if (content !== undefined) return content;\n return authored ?? [];\n}\n\nfunction resolveDestination(href: PageRef | string, index: number): PageRef | string | null {\n if (typeof href !== 'string') return href;\n\n const destination = resolveSafeHref(href);\n if (!destination.safe) {\n console.warn('[NavigationLinkList] link destination rejected', { index, reason: destination.reason });\n return null;\n }\n return destination.href;\n}\n\nfunction resolveLinks(links: readonly NavigationLinkListLink[]): ResolvedLink[] {\n const resolved: ResolvedLink[] = [];\n\n links.forEach((link, index) => {\n // `minLength` is enforced by neither the runtime slice nor the preflight, so a blank label\n // reaches the component. Drop the link: an anchor with no accessible name is a WCAG failure.\n if (link.label.trim().length === 0) {\n return;\n }\n resolved.push({\n label: link.label,\n href: resolveDestination(link.href, index),\n target: link.target,\n });\n });\n\n return resolved;\n}\n\nexport function NavigationLinkList({ links, $content, className, ...props }: NavigationLinkListProps) {\n // An entry supplying `links: []` beats an authored prop: a merchant who cleared the list cleared it.\n // `minItems` guides the Admin form only, so that empty list still reaches this component.\n const resolved = resolveLinks(readLinks($content?.links, links));\n\n if (resolved.length === 0) {\n return null;\n }\n\n return (\n <ul {...props} className={className} data-fs-navigation-link-list=\"\">\n {resolved.map((link, index) => (\n <li key={index} data-fs-navigation-link-list-item=\"\">\n {link.href === null ? (\n <span data-fs-text=\"\" data-fs-navigation-link-list-text=\"\">\n {link.label}\n </span>\n ) : (\n // `target` reaches NavigationLink as a prop, which is where the tab-nabbing defense\n // lives: it derives rel from the resolved target, so `_blank` carries noopener/noreferrer.\n <NavigationLink href={link.href} target={link.target}>\n {link.label}\n </NavigationLink>\n )}\n </li>\n ))}\n </ul>\n );\n}\n"],"mappings":";;;;;;;AAUA,MAAa,4BAA4B,kBAAkB;CACzD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EAGtB,YAAY,EACV,OAAO;GACL,MAAM;GACN,OAAO;GACP,UAAU;GACV,OAAO;IACL,MAAM;IACN,sBAAsB;IACtB,UAAU,CAAC,SAAS,MAAM;IAC1B,YAAY;KACV,OAAO;MAAE,MAAM;MAAU,WAAW;MAAG,OAAO;KAAQ;KACtD,MAAM;MACJ,MAAM;MACN,WAAW;MACX,OAAO;MACP,QAAQ;MAER,SAAS;KACX;KACA,QAAQ;MAAE,MAAM;MAAU,MAAM,CAAC,SAAS,QAAQ;MAAG,SAAS;MAAS,OAAO;KAAU;IAC1F;GACF;EACF,EACF;CACF;AACF,CAAC;AA0BD,MAAa,+BAA+B,gBAAgB;CAC1D,MAAM;CACN,YAAY;CACZ,WAAW;CACX,SAAS;CACT,QAAQ;EAAE,OAAO;EAAoB,UAAU;CAAa;CAC5D,QAAQ,EACN,OAAO;EAAE,MAAM;EAAS,OAAO;CAAQ,EACzC;CACA,WACE;AACJ,CAAC;AAaD,SAAS,UACP,SACA,UACmC;CACnC,IAAI,YAAY,KAAA,GAAW,OAAO;CAClC,OAAO,YAAY,CAAC;AACtB;AAEA,SAAS,mBAAmB,MAAwB,OAAwC;CAC1F,IAAI,OAAO,SAAS,UAAU,OAAO;CAErC,MAAM,cAAc,gBAAgB,IAAI;CACxC,IAAI,CAAC,YAAY,MAAM;EACrB,QAAQ,KAAK,kDAAkD;GAAE;GAAO,QAAQ,YAAY;EAAO,CAAC;EACpG,OAAO;CACT;CACA,OAAO,YAAY;AACrB;AAEA,SAAS,aAAa,OAA0D;CAC9E,MAAM,WAA2B,CAAC;CAElC,MAAM,SAAS,MAAM,UAAU;EAG7B,IAAI,KAAK,MAAM,KAAK,CAAC,CAAC,WAAW,GAC/B;EAEF,SAAS,KAAK;GACZ,OAAO,KAAK;GACZ,MAAM,mBAAmB,KAAK,MAAM,KAAK;GACzC,QAAQ,KAAK;EACf,CAAC;CACH,CAAC;CAED,OAAO;AACT;AAEA,SAAgB,mBAAmB,EAAE,OAAO,UAAU,WAAW,GAAG,SAAkC;CAGpG,MAAM,WAAW,aAAa,UAAU,UAAU,OAAO,KAAK,CAAC;CAE/D,IAAI,SAAS,WAAW,GACtB,OAAO;CAGT,OACE,oBAAC,MAAD;EAAI,GAAI;EAAkB;EAAW,gCAA6B;EAC/D,UAAA,SAAS,KAAK,MAAM,UACnB,oBAAC,MAAD;GAAgB,qCAAkC;GAC/C,UAAA,KAAK,SAAS,OACb,oBAAC,QAAD;IAAM,gBAAa;IAAG,qCAAkC;IACrD,UAAA,KAAK;GACF,CAAA,IAIN,oBAAC,gBAAD;IAAgB,MAAM,KAAK;IAAM,QAAQ,KAAK;IAC3C,UAAA,KAAK;GACQ,CAAA;EAEhB,GAZK,KAYL,CACL;CACC,CAAA;AAER"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ContentValue } from "../../core/dist/define-content-type.js";
|
|
2
|
+
import { ComponentDefinition } from "../../core/dist/define-component.js";
|
|
3
|
+
import "../../core/dist/index.js";
|
|
4
|
+
import { ComponentPropsWithRef } from "react";
|
|
5
|
+
//#region src/particles/order-details-back/order-details-back.d.ts
|
|
6
|
+
export declare const OrderDetailsBackContent: {
|
|
7
|
+
readonly id: "order-details-back";
|
|
8
|
+
readonly title: "Order Details Back";
|
|
9
|
+
readonly description: "The link back to the order list.";
|
|
10
|
+
readonly schema: {
|
|
11
|
+
readonly type: "object";
|
|
12
|
+
readonly additionalProperties: false;
|
|
13
|
+
readonly properties: {
|
|
14
|
+
readonly label: {
|
|
15
|
+
readonly type: "string";
|
|
16
|
+
readonly title: "Label";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export type OrderDetailsBackContentValue = ContentValue<typeof OrderDetailsBackContent>;
|
|
22
|
+
export type OrderDetailsBackProps = ComponentPropsWithRef<'a'> & {
|
|
23
|
+
$content?: OrderDetailsBackContentValue;
|
|
24
|
+
};
|
|
25
|
+
export declare const OrderDetailsBackDefinition: ComponentDefinition<OrderDetailsBackProps>;
|
|
26
|
+
export declare function OrderDetailsBack({ className, ref, $content, ...props }: OrderDetailsBackProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
//#endregion
|
|
28
|
+
//# sourceMappingURL=order-details-back.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { defineComponent } from "../../core/dist/define-component.js";
|
|
3
|
+
import { defineContentType } from "../../core/dist/define-content-type.js";
|
|
4
|
+
import "../../core/dist/index.js";
|
|
5
|
+
import { useIntl } from "../../sdk/i18n/client.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/particles/order-details-back/order-details-back.tsx
|
|
8
|
+
const LIST_HREF = "/pvt/orders";
|
|
9
|
+
const OrderDetailsBackContent = defineContentType({
|
|
10
|
+
id: "order-details-back",
|
|
11
|
+
title: "Order Details Back",
|
|
12
|
+
description: "The link back to the order list.",
|
|
13
|
+
schema: {
|
|
14
|
+
type: "object",
|
|
15
|
+
additionalProperties: false,
|
|
16
|
+
properties: { label: {
|
|
17
|
+
type: "string",
|
|
18
|
+
title: "Label"
|
|
19
|
+
} }
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const OrderDetailsBackDefinition = defineComponent({
|
|
23
|
+
name: "OrderDetailsBack",
|
|
24
|
+
importPath: "@vtex/faststore/components",
|
|
25
|
+
component: OrderDetailsBack,
|
|
26
|
+
content: OrderDetailsBackContent,
|
|
27
|
+
editor: {
|
|
28
|
+
label: "Order Details Back",
|
|
29
|
+
category: "action"
|
|
30
|
+
},
|
|
31
|
+
schema: {},
|
|
32
|
+
guideline: "The return from one order to the order list. Place it first on the order page when the layout has no account breadcrumb. The label is content; a blank field keeps the catalogue."
|
|
33
|
+
});
|
|
34
|
+
function authored(value, fallback) {
|
|
35
|
+
return value?.trim() || fallback;
|
|
36
|
+
}
|
|
37
|
+
function OrderDetailsBack({ className, ref, $content, ...props }) {
|
|
38
|
+
const intl = useIntl();
|
|
39
|
+
const label = authored($content?.label, intl.formatMessage({ id: "fs/order.back-to-orders" }));
|
|
40
|
+
return /* @__PURE__ */ jsx("a", {
|
|
41
|
+
...props,
|
|
42
|
+
ref,
|
|
43
|
+
href: LIST_HREF,
|
|
44
|
+
className,
|
|
45
|
+
"data-fs-order-details-back": "",
|
|
46
|
+
children: label
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { OrderDetailsBack, OrderDetailsBackContent, OrderDetailsBackDefinition };
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=order-details-back.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order-details-back.js","names":[],"sources":["../../../src/particles/order-details-back/order-details-back.tsx"],"sourcesContent":["'use client';\n\nimport { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef } from 'react';\nimport { useIntl } from '../../sdk/i18n/client.js';\n\nconst LIST_HREF = '/pvt/orders';\n\nexport const OrderDetailsBackContent = defineContentType({\n id: 'order-details-back',\n title: 'Order Details Back',\n description: 'The link back to the order list.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', title: 'Label' },\n },\n },\n});\n\nexport type OrderDetailsBackContentValue = ContentValue<typeof OrderDetailsBackContent>;\n\nexport type OrderDetailsBackProps = ComponentPropsWithRef<'a'> & {\n $content?: OrderDetailsBackContentValue;\n};\n\nexport const OrderDetailsBackDefinition = defineComponent<OrderDetailsBackProps>({\n name: 'OrderDetailsBack',\n importPath: '@vtex/faststore/components',\n component: OrderDetailsBack,\n content: OrderDetailsBackContent,\n editor: { label: 'Order Details Back', category: 'action' },\n schema: {},\n guideline:\n 'The return from one order to the order list. Place it first on the order page when the layout has no account breadcrumb. The label is content; a blank field keeps the catalogue.',\n});\n\nfunction authored(value: string | undefined, fallback: string): string {\n const trimmed = value?.trim();\n return trimmed || fallback;\n}\n\nexport function OrderDetailsBack({ className, ref, $content, ...props }: OrderDetailsBackProps) {\n const intl = useIntl();\n const label = authored($content?.label, intl.formatMessage({ id: 'fs/order.back-to-orders' }));\n\n return (\n <a {...props} ref={ref} href={LIST_HREF} className={className} data-fs-order-details-back=\"\">\n {label}\n </a>\n );\n}\n"],"mappings":";;;;;;;AAMA,MAAM,YAAY;AAElB,MAAa,0BAA0B,kBAAkB;CACvD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY,EACV,OAAO;GAAE,MAAM;GAAU,OAAO;EAAQ,EAC1C;CACF;AACF,CAAC;AAQD,MAAa,6BAA6B,gBAAuC;CAC/E,MAAM;CACN,YAAY;CACZ,WAAW;CACX,SAAS;CACT,QAAQ;EAAE,OAAO;EAAsB,UAAU;CAAS;CAC1D,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,SAAS,SAAS,OAA2B,UAA0B;CAErE,OADgB,OAAO,KAAK,KACV;AACpB;AAEA,SAAgB,iBAAiB,EAAE,WAAW,KAAK,UAAU,GAAG,SAAgC;CAC9F,MAAM,OAAO,QAAQ;CACrB,MAAM,QAAQ,SAAS,UAAU,OAAO,KAAK,cAAc,EAAE,IAAI,0BAA0B,CAAC,CAAC;CAE7F,OACE,oBAAC,KAAD;EAAG,GAAI;EAAY;EAAK,MAAM;EAAsB;EAAW,8BAA2B;EACvF,UAAA;CACA,CAAA;AAEP"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ComponentDefinition } from "../../core/dist/define-component.js";
|
|
2
|
+
import "../../core/dist/index.js";
|
|
3
|
+
import { ComponentPropsWithRef } from "react";
|
|
4
|
+
//#region src/particles/order-status-badge/order-status-badge.d.ts
|
|
5
|
+
export type OrderStatusState = 'ongoing' | 'completed' | 'cancelled';
|
|
6
|
+
export type OrderStatusTone = 'neutral' | 'progress' | 'success' | 'danger';
|
|
7
|
+
export type OrderStatusMessageKey = 'cancelled' | 'cancellation-requested' | 'in-progress' | 'delivered' | 'shipped' | 'ready-for-pickup' | 'collected' | 'placeholder';
|
|
8
|
+
/** Per-label sentences. A blank value keeps the catalogue sentence for that label. */
|
|
9
|
+
export type OrderStatusMessages = Partial<Record<OrderStatusMessageKey, string>>;
|
|
10
|
+
export type OrderStatusBadgeProps = Omit<ComponentPropsWithRef<'span'>, 'children'> & {
|
|
11
|
+
state: OrderStatusState;
|
|
12
|
+
tone: OrderStatusTone;
|
|
13
|
+
label: string;
|
|
14
|
+
messages?: OrderStatusMessages;
|
|
15
|
+
};
|
|
16
|
+
export declare const OrderStatusBadgeDefinition: ComponentDefinition<OrderStatusBadgeProps>;
|
|
17
|
+
export declare function OrderStatusBadge({ state, tone, label, messages, className, ...props }: OrderStatusBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
//#endregion
|
|
19
|
+
//# sourceMappingURL=order-status-badge.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { defineComponent } from "../../core/dist/define-component.js";
|
|
3
|
+
import "../../core/dist/index.js";
|
|
4
|
+
import { useIntl } from "../../sdk/i18n/client.js";
|
|
5
|
+
import { Badge } from "../badge/badge.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/particles/order-status-badge/order-status-badge.tsx
|
|
8
|
+
const ORDER_STATUS_MESSAGES = {
|
|
9
|
+
cancelled: "fs/order-status.cancelled",
|
|
10
|
+
"cancellation-requested": "fs/order-status.cancellation-requested",
|
|
11
|
+
"in-progress": "fs/order-status.in-progress",
|
|
12
|
+
delivered: "fs/order-status.delivered",
|
|
13
|
+
shipped: "fs/order-status.shipped",
|
|
14
|
+
"ready-for-pickup": "fs/order-status.ready-for-pickup",
|
|
15
|
+
collected: "fs/order-status.collected"
|
|
16
|
+
};
|
|
17
|
+
function orderStatusMessageId(label) {
|
|
18
|
+
if (!Object.hasOwn(ORDER_STATUS_MESSAGES, label)) return "fs/order-status.placeholder";
|
|
19
|
+
return ORDER_STATUS_MESSAGES[label] ?? "fs/order-status.placeholder";
|
|
20
|
+
}
|
|
21
|
+
const OrderStatusBadgeDefinition = defineComponent({
|
|
22
|
+
name: "OrderStatusBadge",
|
|
23
|
+
importPath: "@vtex/faststore/components",
|
|
24
|
+
component: OrderStatusBadge,
|
|
25
|
+
editor: {
|
|
26
|
+
label: "Order Status Badge",
|
|
27
|
+
category: "content"
|
|
28
|
+
},
|
|
29
|
+
schema: {},
|
|
30
|
+
guideline: "Shopper-facing order status. Pass the completion view, the label id, and a tone. A messages entry replaces the catalogue sentence for that label; a blank entry and an unknown label keep the catalogue."
|
|
31
|
+
});
|
|
32
|
+
function messageKey(label) {
|
|
33
|
+
return Object.hasOwn(ORDER_STATUS_MESSAGES, label) ? label : "placeholder";
|
|
34
|
+
}
|
|
35
|
+
function OrderStatusBadge({ state, tone, label, messages, className, ...props }) {
|
|
36
|
+
const intl = useIntl();
|
|
37
|
+
const authored = messages?.[messageKey(label)]?.trim();
|
|
38
|
+
return /* @__PURE__ */ jsx(Badge, {
|
|
39
|
+
...props,
|
|
40
|
+
className,
|
|
41
|
+
"data-fs-order-status-badge": "",
|
|
42
|
+
"data-fs-order-status-badge-state": state,
|
|
43
|
+
"data-fs-order-status-badge-tone": tone,
|
|
44
|
+
children: authored || intl.formatMessage({ id: orderStatusMessageId(label) })
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { OrderStatusBadge, OrderStatusBadgeDefinition };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=order-status-badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order-status-badge.js","names":[],"sources":["../../../src/particles/order-status-badge/order-status-badge.tsx"],"sourcesContent":["'use client';\n\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef } from 'react';\nimport { useIntl } from '../../sdk/i18n/client.js';\nimport type { MessageId } from '../../sdk/i18n/locales.js';\nimport { Badge } from '../badge/badge.js';\n\nexport type OrderStatusState = 'ongoing' | 'completed' | 'cancelled';\n\nexport type OrderStatusTone = 'neutral' | 'progress' | 'success' | 'danger';\n\nexport type OrderStatusMessageKey =\n | 'cancelled'\n | 'cancellation-requested'\n | 'in-progress'\n | 'delivered'\n | 'shipped'\n | 'ready-for-pickup'\n | 'collected'\n | 'placeholder';\n\n/** Per-label sentences. A blank value keeps the catalogue sentence for that label. */\nexport type OrderStatusMessages = Partial<Record<OrderStatusMessageKey, string>>;\n\nexport type OrderStatusBadgeProps = Omit<ComponentPropsWithRef<'span'>, 'children'> & {\n state: OrderStatusState;\n tone: OrderStatusTone;\n label: string;\n messages?: OrderStatusMessages;\n};\n\nconst ORDER_STATUS_MESSAGES: Record<string, MessageId> = {\n cancelled: 'fs/order-status.cancelled',\n 'cancellation-requested': 'fs/order-status.cancellation-requested',\n 'in-progress': 'fs/order-status.in-progress',\n delivered: 'fs/order-status.delivered',\n shipped: 'fs/order-status.shipped',\n 'ready-for-pickup': 'fs/order-status.ready-for-pickup',\n collected: 'fs/order-status.collected',\n};\n\nfunction orderStatusMessageId(label: string): MessageId {\n // Bracket access walks Object.prototype, so \"constructor\" would skip the placeholder.\n if (!Object.hasOwn(ORDER_STATUS_MESSAGES, label)) {\n return 'fs/order-status.placeholder';\n }\n\n return ORDER_STATUS_MESSAGES[label] ?? 'fs/order-status.placeholder';\n}\n\nexport const OrderStatusBadgeDefinition = defineComponent<OrderStatusBadgeProps>({\n name: 'OrderStatusBadge',\n importPath: '@vtex/faststore/components',\n component: OrderStatusBadge,\n editor: { label: 'Order Status Badge', category: 'content' },\n schema: {},\n guideline:\n 'Shopper-facing order status. Pass the completion view, the label id, and a tone. A messages entry replaces the catalogue sentence for that label; a blank entry and an unknown label keep the catalogue.',\n});\n\nfunction messageKey(label: string): OrderStatusMessageKey {\n return Object.hasOwn(ORDER_STATUS_MESSAGES, label) ? (label as OrderStatusMessageKey) : 'placeholder';\n}\n\nexport function OrderStatusBadge({ state, tone, label, messages, className, ...props }: OrderStatusBadgeProps) {\n const intl = useIntl();\n const authored = messages?.[messageKey(label)]?.trim();\n\n return (\n <Badge\n {...props}\n className={className}\n data-fs-order-status-badge=\"\"\n data-fs-order-status-badge-state={state}\n data-fs-order-status-badge-tone={tone}\n >\n {authored || intl.formatMessage({ id: orderStatusMessageId(label) })}\n </Badge>\n );\n}\n"],"mappings":";;;;;;;AAgCA,MAAM,wBAAmD;CACvD,WAAW;CACX,0BAA0B;CAC1B,eAAe;CACf,WAAW;CACX,SAAS;CACT,oBAAoB;CACpB,WAAW;AACb;AAEA,SAAS,qBAAqB,OAA0B;CAEtD,IAAI,CAAC,OAAO,OAAO,uBAAuB,KAAK,GAC7C,OAAO;CAGT,OAAO,sBAAsB,UAAU;AACzC;AAEA,MAAa,6BAA6B,gBAAuC;CAC/E,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAsB,UAAU;CAAU;CAC3D,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,SAAS,WAAW,OAAsC;CACxD,OAAO,OAAO,OAAO,uBAAuB,KAAK,IAAK,QAAkC;AAC1F;AAEA,SAAgB,iBAAiB,EAAE,OAAO,MAAM,OAAO,UAAU,WAAW,GAAG,SAAgC;CAC7G,MAAM,OAAO,QAAQ;CACrB,MAAM,WAAW,WAAW,WAAW,KAAK,EAAE,EAAE,KAAK;CAErD,OACE,oBAAC,OAAD;EACE,GAAI;EACO;EACX,8BAA2B;EAC3B,oCAAkC;EAClC,mCAAiC;EAEhC,UAAA,YAAY,KAAK,cAAc,EAAE,IAAI,qBAAqB,KAAK,EAAE,CAAC;CAC9D,CAAA;AAEX"}
|
|
@@ -5,7 +5,7 @@ import { FieldBinding, TEXT_FIELD_VALUE, mergeFieldValidator, useBoundField, use
|
|
|
5
5
|
import { useComposedRef } from "../shared/compose-refs.js";
|
|
6
6
|
import { Input } from "../input/input.js";
|
|
7
7
|
import { createContext, useContext, useMemo, useState } from "react";
|
|
8
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { Field } from "@base-ui/react/field";
|
|
10
10
|
import { useFormContext, useFormState } from "react-hook-form";
|
|
11
11
|
//#region src/particles/phone-field/phone-field.tsx
|
|
@@ -258,7 +258,7 @@ function PhoneFieldView({ ref, country, className, label, isDisabled, placeholde
|
|
|
258
258
|
disabled: isDisabled,
|
|
259
259
|
children: /* @__PURE__ */ jsx(PhoneFieldInputContext.Provider, {
|
|
260
260
|
value: inputContext,
|
|
261
|
-
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
261
|
+
children: children ?? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
262
262
|
/* @__PURE__ */ jsx(Field.Label, {
|
|
263
263
|
"data-fs-phone-field-label": "",
|
|
264
264
|
"data-fs-field-label": "",
|