@vendure-platform/create 0.5.0 → 1.0.0-major.202609091053.0.0
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 +4 -0
- package/README.md +53 -41
- package/dist/add-to-existing.d.ts +19 -13
- package/dist/add-to-existing.js +1 -1
- package/dist/assets/demo-data/assets/branding/logo.svg +4 -0
- package/dist/assets/demo-data/assets/images/absorbent-pad.webp +0 -0
- package/dist/assets/demo-data/assets/images/adjustable-wrench.webp +0 -0
- package/dist/assets/demo-data/assets/images/anchor-bolt.webp +0 -0
- package/dist/assets/demo-data/assets/images/angle-grinder.webp +0 -0
- package/dist/assets/demo-data/assets/images/barrier-tape.webp +0 -0
- package/dist/assets/demo-data/assets/images/bench-grinder.webp +0 -0
- package/dist/assets/demo-data/assets/images/bracket.webp +0 -0
- package/dist/assets/demo-data/assets/images/broom.webp +0 -0
- package/dist/assets/demo-data/assets/images/bucket.webp +0 -0
- package/dist/assets/demo-data/assets/images/cable-gland.webp +0 -0
- package/dist/assets/demo-data/assets/images/cable-tie.webp +0 -0
- package/dist/assets/demo-data/assets/images/cable-tray.webp +0 -0
- package/dist/assets/demo-data/assets/images/cable.webp +0 -0
- package/dist/assets/demo-data/assets/images/chimney-base-kit.webp +0 -0
- package/dist/assets/demo-data/assets/images/chimney-cowl-bird-guard.webp +0 -0
- package/dist/assets/demo-data/assets/images/chimney-cowl-open.webp +0 -0
- package/dist/assets/demo-data/assets/images/chimney-storm-collar.webp +0 -0
- package/dist/assets/demo-data/assets/images/chimney-wall-bracket.webp +0 -0
- package/dist/assets/demo-data/assets/images/circular-saw.webp +0 -0
- package/dist/assets/demo-data/assets/images/cleaning-spray.webp +0 -0
- package/dist/assets/demo-data/assets/images/conduit.webp +0 -0
- package/dist/assets/demo-data/assets/images/cordless-drill.webp +0 -0
- package/dist/assets/demo-data/assets/images/drill-bits.webp +0 -0
- package/dist/assets/demo-data/assets/images/dust-mask.webp +0 -0
- package/dist/assets/demo-data/assets/images/ear-defenders.webp +0 -0
- package/dist/assets/demo-data/assets/images/ear-plugs.webp +0 -0
- package/dist/assets/demo-data/assets/images/extension-lead.webp +0 -0
- package/dist/assets/demo-data/assets/images/eye-wash-station.webp +0 -0
- package/dist/assets/demo-data/assets/images/face-shield.webp +0 -0
- package/dist/assets/demo-data/assets/images/file-set.webp +0 -0
- package/dist/assets/demo-data/assets/images/first-aid-kit.webp +0 -0
- package/dist/assets/demo-data/assets/images/floor-sign.webp +0 -0
- package/dist/assets/demo-data/assets/images/flue-bend-45.webp +0 -0
- package/dist/assets/demo-data/assets/images/flue-bend-90.webp +0 -0
- package/dist/assets/demo-data/assets/images/flue-section-1000mm.webp +0 -0
- package/dist/assets/demo-data/assets/images/flue-section-250mm.webp +0 -0
- package/dist/assets/demo-data/assets/images/flue-section-500mm.webp +0 -0
- package/dist/assets/demo-data/assets/images/fuse.webp +0 -0
- package/dist/assets/demo-data/assets/images/glove-dispenser.webp +0 -0
- package/dist/assets/demo-data/assets/images/grinding-disc.webp +0 -0
- package/dist/assets/demo-data/assets/images/hacksaw.webp +0 -0
- package/dist/assets/demo-data/assets/images/hammer.webp +0 -0
- package/dist/assets/demo-data/assets/images/hand-sanitiser.webp +0 -0
- package/dist/assets/demo-data/assets/images/head-torch.webp +0 -0
- package/dist/assets/demo-data/assets/images/heat-gun.webp +0 -0
- package/dist/assets/demo-data/assets/images/hex-bolt.webp +0 -0
- package/dist/assets/demo-data/assets/images/hex-key-set.webp +0 -0
- package/dist/assets/demo-data/assets/images/hex-nut.webp +0 -0
- package/dist/assets/demo-data/assets/images/hi-vis-jacket.webp +0 -0
- package/dist/assets/demo-data/assets/images/hi-vis-vest.webp +0 -0
- package/dist/assets/demo-data/assets/images/hose-clamp.webp +0 -0
- package/dist/assets/demo-data/assets/images/impact-driver.webp +0 -0
- package/dist/assets/demo-data/assets/images/jigsaw.webp +0 -0
- package/dist/assets/demo-data/assets/images/junction-box.webp +0 -0
- package/dist/assets/demo-data/assets/images/knee-pads.webp +0 -0
- package/dist/assets/demo-data/assets/images/machine-screw.webp +0 -0
- package/dist/assets/demo-data/assets/images/made-to-order-configurable-chimney.webp +0 -0
- package/dist/assets/demo-data/assets/images/mallet.webp +0 -0
- package/dist/assets/demo-data/assets/images/mcb.webp +0 -0
- package/dist/assets/demo-data/assets/images/mop.webp +0 -0
- package/dist/assets/demo-data/assets/images/paper-towels.webp +0 -0
- package/dist/assets/demo-data/assets/images/pipe-wrench.webp +0 -0
- package/dist/assets/demo-data/assets/images/pliers-set.webp +0 -0
- package/dist/assets/demo-data/assets/images/pry-bar.webp +0 -0
- package/dist/assets/demo-data/assets/images/rcd.webp +0 -0
- package/dist/assets/demo-data/assets/images/reciprocating-saw.webp +0 -0
- package/dist/assets/demo-data/assets/images/rivet.webp +0 -0
- package/dist/assets/demo-data/assets/images/roof-flashing-high-pitch.webp +0 -0
- package/dist/assets/demo-data/assets/images/roof-flashing-low-pitch.webp +0 -0
- package/dist/assets/demo-data/assets/images/safety-boots.webp +0 -0
- package/dist/assets/demo-data/assets/images/safety-glasses.webp +0 -0
- package/dist/assets/demo-data/assets/images/safety-harness.webp +0 -0
- package/dist/assets/demo-data/assets/images/safety-helmet.webp +0 -0
- package/dist/assets/demo-data/assets/images/safety-sign.webp +0 -0
- package/dist/assets/demo-data/assets/images/sanding-disc.webp +0 -0
- package/dist/assets/demo-data/assets/images/saw-blade.webp +0 -0
- package/dist/assets/demo-data/assets/images/screwdriver-set.webp +0 -0
- package/dist/assets/demo-data/assets/images/screwdriver.webp +0 -0
- package/dist/assets/demo-data/assets/images/self-tapping-screw.webp +0 -0
- package/dist/assets/demo-data/assets/images/socket-set.webp +0 -0
- package/dist/assets/demo-data/assets/images/socket.webp +0 -0
- package/dist/assets/demo-data/assets/images/spanner-set.webp +0 -0
- package/dist/assets/demo-data/assets/images/spanner.webp +0 -0
- package/dist/assets/demo-data/assets/images/spill-kit.webp +0 -0
- package/dist/assets/demo-data/assets/images/spirit-level.webp +0 -0
- package/dist/assets/demo-data/assets/images/switch.webp +0 -0
- package/dist/assets/demo-data/assets/images/tape-measure.webp +0 -0
- package/dist/assets/demo-data/assets/images/terminal-block.webp +0 -0
- package/dist/assets/demo-data/assets/images/threaded-rod.webp +0 -0
- package/dist/assets/demo-data/assets/images/torque-wrench.webp +0 -0
- package/dist/assets/demo-data/assets/images/utility-knife.webp +0 -0
- package/dist/assets/demo-data/assets/images/wall-pass-sleeve.webp +0 -0
- package/dist/assets/demo-data/assets/images/wall-plug.webp +0 -0
- package/dist/assets/demo-data/assets/images/washer.webp +0 -0
- package/dist/assets/demo-data/assets/images/waste-bin.webp +0 -0
- package/dist/assets/demo-data/assets/images/wire-connector.webp +0 -0
- package/dist/assets/demo-data/assets/images/wire-cutters.webp +0 -0
- package/dist/assets/demo-data/assets/images/wood-screw.webp +0 -0
- package/dist/assets/demo-data/assets/images/work-gloves.webp +0 -0
- package/dist/assets/demo-data/assets/images/work-light.webp +0 -0
- package/dist/assets/demo-data/assets/initial-data.json +667 -0
- package/dist/assets/demo-data/assets/products.csv +779 -0
- package/dist/assets/demo-data/initial-data.json +663 -663
- package/dist/assets/storefront/components.json +20 -20
- package/dist/assets/storefront/eslint.config.mjs +10 -10
- package/dist/assets/storefront/graphql.config.yml +1 -1
- package/dist/assets/storefront/next-env.d.ts +2 -1
- package/dist/assets/storefront/next.config.ts +19 -17
- package/dist/assets/storefront/package.json +3 -2
- package/dist/assets/storefront/postcss.config.mjs +1 -1
- package/dist/assets/storefront/src/app/[locale]/(catalog)/catalog/page.tsx +17 -21
- package/dist/assets/storefront/src/app/[locale]/(catalog)/collection/[slug]/page.tsx +64 -42
- package/dist/assets/storefront/src/app/[locale]/(catalog)/layout.tsx +1 -5
- package/dist/assets/storefront/src/app/[locale]/(catalog)/product/[slug]/actions.ts +69 -65
- package/dist/assets/storefront/src/app/[locale]/(catalog)/product/[slug]/page.tsx +64 -38
- package/dist/assets/storefront/src/app/[locale]/(catalog)/search/page.tsx +24 -27
- package/dist/assets/storefront/src/app/[locale]/(catalog)/search/search-results.tsx +11 -9
- package/dist/assets/storefront/src/app/[locale]/(catalog)/search/search-term.tsx +4 -4
- package/dist/assets/storefront/src/app/[locale]/(scenario)/[...path]/page.tsx +1 -1
- package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/accept-invitation-client.tsx +8 -13
- package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/actions.ts +11 -14
- package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/page.tsx +30 -33
- package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/sign-out-and-retry.tsx +6 -6
- package/dist/assets/storefront/src/app/[locale]/account/addresses/actions.ts +30 -45
- package/dist/assets/storefront/src/app/[locale]/account/addresses/address-form.tsx +166 -159
- package/dist/assets/storefront/src/app/[locale]/account/addresses/addresses-client.tsx +35 -26
- package/dist/assets/storefront/src/app/[locale]/account/addresses/loading.tsx +1 -3
- package/dist/assets/storefront/src/app/[locale]/account/addresses/page.tsx +18 -18
- package/dist/assets/storefront/src/app/[locale]/account/approvals/actions.ts +5 -8
- package/dist/assets/storefront/src/app/[locale]/account/approvals/page.tsx +79 -69
- package/dist/assets/storefront/src/app/[locale]/account/company/actions.ts +10 -11
- package/dist/assets/storefront/src/app/[locale]/account/company/addresses/actions.ts +6 -15
- package/dist/assets/storefront/src/app/[locale]/account/company/addresses/address-form.tsx +57 -49
- package/dist/assets/storefront/src/app/[locale]/account/company/addresses/addresses-client.tsx +23 -25
- package/dist/assets/storefront/src/app/[locale]/account/company/addresses/page.tsx +30 -30
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/actions.ts +20 -29
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/business-unit-form.tsx +32 -37
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/business-units-client.tsx +32 -25
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/page.tsx +26 -24
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/types.ts +7 -4
- package/dist/assets/storefront/src/app/[locale]/account/company/edit-company-form.tsx +11 -21
- package/dist/assets/storefront/src/app/[locale]/account/company/page.tsx +25 -28
- package/dist/assets/storefront/src/app/[locale]/account/company/payment-methods/page.tsx +26 -24
- package/dist/assets/storefront/src/app/[locale]/account/company/payment-methods/payment-methods-client.tsx +5 -7
- package/dist/assets/storefront/src/app/[locale]/account/company/roles/page.tsx +24 -25
- package/dist/assets/storefront/src/app/[locale]/account/company/roles/roles-client.tsx +11 -26
- package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/actions.ts +6 -10
- package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/page.tsx +18 -16
- package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/tax-ids-client.tsx +74 -67
- package/dist/assets/storefront/src/app/[locale]/account/company/users/actions.ts +16 -25
- package/dist/assets/storefront/src/app/[locale]/account/company/users/edit-user-form.tsx +27 -25
- package/dist/assets/storefront/src/app/[locale]/account/company/users/invite-user-form.tsx +27 -19
- package/dist/assets/storefront/src/app/[locale]/account/company/users/page.tsx +34 -29
- package/dist/assets/storefront/src/app/[locale]/account/company/users/users-client.tsx +35 -38
- package/dist/assets/storefront/src/app/[locale]/account/error.tsx +1 -3
- package/dist/assets/storefront/src/app/[locale]/account/layout.tsx +16 -22
- package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/page.tsx +151 -103
- package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/reorder-actions.ts +6 -7
- package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/reorder-dialog.tsx +22 -48
- package/dist/assets/storefront/src/app/[locale]/account/orders/loading.tsx +8 -8
- package/dist/assets/storefront/src/app/[locale]/account/orders/page.tsx +101 -61
- package/dist/assets/storefront/src/app/[locale]/account/profile/actions.ts +32 -23
- package/dist/assets/storefront/src/app/[locale]/account/profile/change-password-form.tsx +6 -16
- package/dist/assets/storefront/src/app/[locale]/account/profile/edit-email-form.tsx +7 -17
- package/dist/assets/storefront/src/app/[locale]/account/profile/edit-profile-form.tsx +6 -16
- package/dist/assets/storefront/src/app/[locale]/account/profile/loading.tsx +12 -18
- package/dist/assets/storefront/src/app/[locale]/account/profile/page.tsx +17 -15
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/file-upload-tab.tsx +2 -6
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/manual-entry-tab.tsx +18 -15
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/page.tsx +5 -6
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/preview-table.tsx +10 -2
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/save-to-list-dialog.tsx +24 -26
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/sku-autocomplete.tsx +19 -10
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/text-input-tab.tsx +3 -8
- package/dist/assets/storefront/src/app/[locale]/account/quotes/[id]/page.tsx +93 -62
- package/dist/assets/storefront/src/app/[locale]/account/quotes/actions.ts +38 -45
- package/dist/assets/storefront/src/app/[locale]/account/quotes/new/new-quote-form.tsx +3 -5
- package/dist/assets/storefront/src/app/[locale]/account/quotes/new/page.tsx +6 -6
- package/dist/assets/storefront/src/app/[locale]/account/quotes/page.tsx +92 -59
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/add-item-search.tsx +11 -9
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/add-member-form.tsx +31 -15
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/members-panel.tsx +52 -33
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/page.tsx +22 -14
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/rename-dialog.tsx +34 -13
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/actions.ts +117 -72
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/new/new-shared-cart-form.tsx +21 -14
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/new/page.tsx +10 -10
- package/dist/assets/storefront/src/app/[locale]/account/shared-carts/page.tsx +54 -41
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/[id]/page.tsx +22 -8
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/[id]/shopping-list-detail-client.tsx +62 -49
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/actions.ts +9 -4
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/create-shopping-list-form.tsx +5 -11
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/loading.tsx +1 -1
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/page.tsx +32 -42
- package/dist/assets/storefront/src/app/[locale]/account/store-credits/actions.ts +8 -8
- package/dist/assets/storefront/src/app/[locale]/account/store-credits/claim-form.tsx +6 -10
- package/dist/assets/storefront/src/app/[locale]/account/store-credits/page.tsx +76 -55
- package/dist/assets/storefront/src/app/[locale]/account/store-credits/reveal-code.tsx +10 -6
- package/dist/assets/storefront/src/app/[locale]/account/verify-email/page.tsx +32 -39
- package/dist/assets/storefront/src/app/[locale]/cart/actions.ts +29 -23
- package/dist/assets/storefront/src/app/[locale]/cart/cart-items.tsx +111 -40
- package/dist/assets/storefront/src/app/[locale]/cart/cart-line-actions.tsx +9 -9
- package/dist/assets/storefront/src/app/[locale]/cart/cart-quantity-control.tsx +61 -48
- package/dist/assets/storefront/src/app/[locale]/cart/cart-remove-button.tsx +15 -9
- package/dist/assets/storefront/src/app/[locale]/cart/cart.tsx +38 -41
- package/dist/assets/storefront/src/app/[locale]/cart/code-input.tsx +8 -8
- package/dist/assets/storefront/src/app/[locale]/cart/order-summary.tsx +56 -35
- package/dist/assets/storefront/src/app/[locale]/cart/page.tsx +11 -11
- package/dist/assets/storefront/src/app/[locale]/cart/promotion-code.tsx +56 -47
- package/dist/assets/storefront/src/app/[locale]/cart/reapproval-confirm.tsx +22 -20
- package/dist/assets/storefront/src/app/[locale]/cart/request-quote-button.tsx +7 -16
- package/dist/assets/storefront/src/app/[locale]/checkout/actions.ts +39 -65
- package/dist/assets/storefront/src/app/[locale]/checkout/cancel-quote-checkout-button.tsx +5 -5
- package/dist/assets/storefront/src/app/[locale]/checkout/checkout-flow.tsx +202 -202
- package/dist/assets/storefront/src/app/[locale]/checkout/checkout-provider.tsx +142 -142
- package/dist/assets/storefront/src/app/[locale]/checkout/order-summary.tsx +158 -139
- package/dist/assets/storefront/src/app/[locale]/checkout/page.tsx +58 -47
- package/dist/assets/storefront/src/app/[locale]/checkout/steps/delivery-step.tsx +86 -88
- package/dist/assets/storefront/src/app/[locale]/checkout/steps/payment-step.tsx +90 -91
- package/dist/assets/storefront/src/app/[locale]/checkout/steps/review-step.tsx +166 -161
- package/dist/assets/storefront/src/app/[locale]/checkout/steps/shipping-address-step.tsx +573 -494
- package/dist/assets/storefront/src/app/[locale]/error.tsx +3 -5
- package/dist/assets/storefront/src/app/[locale]/forgot-password/actions.ts +10 -7
- package/dist/assets/storefront/src/app/[locale]/forgot-password/forgot-password-form.tsx +10 -25
- package/dist/assets/storefront/src/app/[locale]/forgot-password/page.tsx +5 -5
- package/dist/assets/storefront/src/app/[locale]/globals.css +48 -48
- package/dist/assets/storefront/src/app/[locale]/layout.tsx +56 -50
- package/dist/assets/storefront/src/app/[locale]/not-found.tsx +3 -5
- package/dist/assets/storefront/src/app/[locale]/order-confirmation/[code]/order-confirmation.tsx +71 -102
- package/dist/assets/storefront/src/app/[locale]/order-confirmation/[code]/page.tsx +7 -5
- package/dist/assets/storefront/src/app/[locale]/page.tsx +33 -35
- package/dist/assets/storefront/src/app/[locale]/register/actions.ts +7 -7
- package/dist/assets/storefront/src/app/[locale]/register/page.tsx +22 -16
- package/dist/assets/storefront/src/app/[locale]/register/registration-form.tsx +22 -34
- package/dist/assets/storefront/src/app/[locale]/register-company/actions.ts +15 -19
- package/dist/assets/storefront/src/app/[locale]/register-company/page.tsx +17 -15
- package/dist/assets/storefront/src/app/[locale]/register-company/registration-form.tsx +9 -15
- package/dist/assets/storefront/src/app/[locale]/reset-password/actions.ts +7 -8
- package/dist/assets/storefront/src/app/[locale]/reset-password/page.tsx +18 -12
- package/dist/assets/storefront/src/app/[locale]/reset-password/reset-password-form.tsx +8 -16
- package/dist/assets/storefront/src/app/[locale]/shopping-list/[code]/add-to-cart-button.tsx +10 -4
- package/dist/assets/storefront/src/app/[locale]/shopping-list/[code]/page.tsx +62 -30
- package/dist/assets/storefront/src/app/[locale]/sign-in/actions.ts +14 -16
- package/dist/assets/storefront/src/app/[locale]/sign-in/login-form.tsx +17 -30
- package/dist/assets/storefront/src/app/[locale]/sign-in/page.tsx +35 -30
- package/dist/assets/storefront/src/app/[locale]/verify/actions.ts +8 -8
- package/dist/assets/storefront/src/app/[locale]/verify/page.tsx +18 -14
- package/dist/assets/storefront/src/app/[locale]/verify/verify-content.tsx +25 -27
- package/dist/assets/storefront/src/app/[locale]/verify-pending/page.tsx +23 -23
- package/dist/assets/storefront/src/app/api/clear-company-context/route.ts +6 -3
- package/dist/assets/storefront/src/app/api/revalidate/route.ts +19 -28
- package/dist/assets/storefront/src/app/api/search-analytics/route.ts +1 -1
- package/dist/assets/storefront/src/components/commerce/account-nav-items.ts +43 -18
- package/dist/assets/storefront/src/components/commerce/account-sidebar.tsx +30 -22
- package/dist/assets/storefront/src/components/commerce/active-filters.tsx +1 -1
- package/dist/assets/storefront/src/components/commerce/add-to-shared-cart.tsx +49 -27
- package/dist/assets/storefront/src/components/commerce/approval-decision-form.tsx +9 -13
- package/dist/assets/storefront/src/components/commerce/approval-status-badge.tsx +23 -15
- package/dist/assets/storefront/src/components/commerce/business-unit-switcher.tsx +11 -11
- package/dist/assets/storefront/src/components/commerce/catalog-search-bar.tsx +2 -2
- package/dist/assets/storefront/src/components/commerce/category-product-section.tsx +28 -16
- package/dist/assets/storefront/src/components/commerce/category-sidebar.tsx +31 -18
- package/dist/assets/storefront/src/components/commerce/collection-hero-banner.tsx +2 -4
- package/dist/assets/storefront/src/components/commerce/company-state-badge.tsx +10 -16
- package/dist/assets/storefront/src/components/commerce/company-switcher.tsx +12 -12
- package/dist/assets/storefront/src/components/commerce/configurator-form.tsx +188 -79
- package/dist/assets/storefront/src/components/commerce/facet-filters.tsx +29 -49
- package/dist/assets/storefront/src/components/commerce/gift-card-pdp.tsx +4 -4
- package/dist/assets/storefront/src/components/commerce/gift-card-product-info.tsx +20 -30
- package/dist/assets/storefront/src/components/commerce/instant-search-dropdown.tsx +258 -227
- package/dist/assets/storefront/src/components/commerce/order-status-badge.tsx +27 -19
- package/dist/assets/storefront/src/components/commerce/packaging-unit-selector.tsx +27 -26
- package/dist/assets/storefront/src/components/commerce/permission-gate.tsx +4 -4
- package/dist/assets/storefront/src/components/commerce/price-range-filter.tsx +5 -5
- package/dist/assets/storefront/src/components/commerce/price-tiers.tsx +38 -21
- package/dist/assets/storefront/src/components/commerce/price.tsx +3 -3
- package/dist/assets/storefront/src/components/commerce/product-card-list.tsx +39 -16
- package/dist/assets/storefront/src/components/commerce/product-card.tsx +35 -18
- package/dist/assets/storefront/src/components/commerce/product-carousel.tsx +20 -12
- package/dist/assets/storefront/src/components/commerce/product-grid.tsx +14 -13
- package/dist/assets/storefront/src/components/commerce/product-image-carousel.tsx +10 -8
- package/dist/assets/storefront/src/components/commerce/product-info.tsx +118 -74
- package/dist/assets/storefront/src/components/commerce/product-list-expansion.tsx +102 -74
- package/dist/assets/storefront/src/components/commerce/product-list-view.tsx +1 -1
- package/dist/assets/storefront/src/components/commerce/product-sidebar.tsx +36 -11
- package/dist/assets/storefront/src/components/commerce/product-view-switcher.tsx +33 -21
- package/dist/assets/storefront/src/components/commerce/quote-action-buttons.tsx +80 -45
- package/dist/assets/storefront/src/components/commerce/quote-activity-timeline.tsx +126 -50
- package/dist/assets/storefront/src/components/commerce/quote-comment-form.tsx +9 -13
- package/dist/assets/storefront/src/components/commerce/quote-csv-export-button.tsx +6 -6
- package/dist/assets/storefront/src/components/commerce/quote-product-search.tsx +22 -18
- package/dist/assets/storefront/src/components/commerce/quote-request-form.tsx +28 -27
- package/dist/assets/storefront/src/components/commerce/quote-status-badge.tsx +26 -18
- package/dist/assets/storefront/src/components/commerce/quote-validity-indicator.tsx +7 -7
- package/dist/assets/storefront/src/components/commerce/quote-version-comparison.tsx +50 -30
- package/dist/assets/storefront/src/components/commerce/related-products.tsx +37 -28
- package/dist/assets/storefront/src/components/commerce/shared-cart-status-badge.tsx +12 -8
- package/dist/assets/storefront/src/components/commerce/shop-by-category.tsx +8 -7
- package/dist/assets/storefront/src/components/commerce/shopping-list-toggle.tsx +14 -20
- package/dist/assets/storefront/src/components/commerce/sort-dropdown.tsx +9 -16
- package/dist/assets/storefront/src/components/commerce/store-credit-summary.tsx +30 -32
- package/dist/assets/storefront/src/components/commerce/subcollection-tiles.tsx +11 -13
- package/dist/assets/storefront/src/components/layout/auth-page-shell.tsx +2 -2
- package/dist/assets/storefront/src/components/layout/draft-mode-indicator.tsx +2 -7
- package/dist/assets/storefront/src/components/layout/draft-mode-link.tsx +4 -2
- package/dist/assets/storefront/src/components/layout/footer.tsx +70 -28
- package/dist/assets/storefront/src/components/layout/navbar/actions.ts +9 -12
- package/dist/assets/storefront/src/components/layout/navbar/cart-icon.tsx +9 -9
- package/dist/assets/storefront/src/components/layout/navbar/channel-picker-wrapper.tsx +4 -9
- package/dist/assets/storefront/src/components/layout/navbar/channel-picker.tsx +13 -8
- package/dist/assets/storefront/src/components/layout/navbar/currency-picker-wrapper.tsx +4 -4
- package/dist/assets/storefront/src/components/layout/navbar/currency-picker.tsx +11 -6
- package/dist/assets/storefront/src/components/layout/navbar/language-picker.tsx +7 -7
- package/dist/assets/storefront/src/components/layout/navbar/login-button.tsx +24 -21
- package/dist/assets/storefront/src/components/layout/navbar/mobile-nav.tsx +8 -8
- package/dist/assets/storefront/src/components/layout/navbar/nav-menu-items.tsx +4 -6
- package/dist/assets/storefront/src/components/layout/navbar/navbar-cart.tsx +1 -1
- package/dist/assets/storefront/src/components/layout/navbar/navbar-collections.tsx +41 -42
- package/dist/assets/storefront/src/components/layout/navbar/navbar-link.tsx +7 -10
- package/dist/assets/storefront/src/components/layout/navbar/navbar-user.tsx +18 -23
- package/dist/assets/storefront/src/components/layout/navbar/theme-switcher.tsx +9 -9
- package/dist/assets/storefront/src/components/layout/navbar.tsx +36 -31
- package/dist/assets/storefront/src/components/layout/search-input.tsx +35 -32
- package/dist/assets/storefront/src/components/providers/awaiting-approval-banner.tsx +12 -10
- package/dist/assets/storefront/src/components/providers/cart-count-server.tsx +14 -12
- package/dist/assets/storefront/src/components/providers/company-context-guard.tsx +4 -4
- package/dist/assets/storefront/src/components/providers/company-permissions-server.tsx +2 -6
- package/dist/assets/storefront/src/components/providers/theme-provider.tsx +3 -3
- package/dist/assets/storefront/src/components/shared/breadcrumbs.tsx +4 -1
- package/dist/assets/storefront/src/components/shared/country-select.tsx +63 -67
- package/dist/assets/storefront/src/components/shared/pagination.tsx +15 -28
- package/dist/assets/storefront/src/components/shared/prefetch-link.tsx +1 -1
- package/dist/assets/storefront/src/components/shared/skeletons/search-input-skeleton.tsx +1 -3
- package/dist/assets/storefront/src/components/ui/accordion.tsx +46 -51
- package/dist/assets/storefront/src/components/ui/alert-dialog.tsx +94 -121
- package/dist/assets/storefront/src/components/ui/alert.tsx +48 -54
- package/dist/assets/storefront/src/components/ui/aspect-ratio.tsx +5 -7
- package/dist/assets/storefront/src/components/ui/avatar.tsx +29 -44
- package/dist/assets/storefront/src/components/ui/badge.tsx +28 -37
- package/dist/assets/storefront/src/components/ui/breadcrumb.tsx +82 -89
- package/dist/assets/storefront/src/components/ui/button.tsx +43 -49
- package/dist/assets/storefront/src/components/ui/calendar.tsx +157 -198
- package/dist/assets/storefront/src/components/ui/card.tsx +53 -76
- package/dist/assets/storefront/src/components/ui/carousel.tsx +194 -212
- package/dist/assets/storefront/src/components/ui/chart.tsx +274 -317
- package/dist/assets/storefront/src/components/ui/checkbox.tsx +24 -27
- package/dist/assets/storefront/src/components/ui/collapsible.tsx +9 -21
- package/dist/assets/storefront/src/components/ui/command.tsx +114 -159
- package/dist/assets/storefront/src/components/ui/context-menu.tsx +167 -199
- package/dist/assets/storefront/src/components/ui/dialog.tsx +97 -114
- package/dist/assets/storefront/src/components/ui/drawer.tsx +93 -107
- package/dist/assets/storefront/src/components/ui/dropdown-menu.tsx +171 -206
- package/dist/assets/storefront/src/components/ui/empty-state.tsx +5 -5
- package/dist/assets/storefront/src/components/ui/field.tsx +196 -208
- package/dist/assets/storefront/src/components/ui/form.tsx +115 -139
- package/dist/assets/storefront/src/components/ui/hover-card.tsx +27 -33
- package/dist/assets/storefront/src/components/ui/input-otp.tsx +50 -59
- package/dist/assets/storefront/src/components/ui/input.tsx +17 -17
- package/dist/assets/storefront/src/components/ui/kbd-shortcut.tsx +3 -1
- package/dist/assets/storefront/src/components/ui/label.tsx +16 -19
- package/dist/assets/storefront/src/components/ui/menubar.tsx +193 -223
- package/dist/assets/storefront/src/components/ui/navigation-menu.tsx +123 -130
- package/dist/assets/storefront/src/components/ui/pagination.tsx +87 -108
- package/dist/assets/storefront/src/components/ui/popover.tsx +29 -35
- package/dist/assets/storefront/src/components/ui/progress.tsx +19 -26
- package/dist/assets/storefront/src/components/ui/radio-group.tsx +32 -38
- package/dist/assets/storefront/src/components/ui/resizable.tsx +37 -42
- package/dist/assets/storefront/src/components/ui/scroll-area.tsx +41 -47
- package/dist/assets/storefront/src/components/ui/select.tsx +130 -152
- package/dist/assets/storefront/src/components/ui/separator.tsx +21 -21
- package/dist/assets/storefront/src/components/ui/sheet.tsx +90 -111
- package/dist/assets/storefront/src/components/ui/sidebar.tsx +611 -649
- package/dist/assets/storefront/src/components/ui/skeleton.tsx +10 -10
- package/dist/assets/storefront/src/components/ui/slider.tsx +50 -55
- package/dist/assets/storefront/src/components/ui/sonner.tsx +20 -20
- package/dist/assets/storefront/src/components/ui/switch.tsx +23 -26
- package/dist/assets/storefront/src/components/ui/table.tsx +65 -97
- package/dist/assets/storefront/src/components/ui/tabs.tsx +39 -55
- package/dist/assets/storefront/src/components/ui/textarea.tsx +14 -14
- package/dist/assets/storefront/src/components/ui/toggle-group.tsx +56 -62
- package/dist/assets/storefront/src/components/ui/toggle.tsx +37 -38
- package/dist/assets/storefront/src/components/ui/tooltip.tsx +38 -46
- package/dist/assets/storefront/src/config/capabilities.ts +41 -0
- package/dist/assets/storefront/src/config/scenario-meta.ts +2 -2
- package/dist/assets/storefront/src/config/scenario.ts +24 -16
- package/dist/assets/storefront/src/contexts/auth-context.tsx +5 -6
- package/dist/assets/storefront/src/graphql-env.d.ts +47 -41
- package/dist/assets/storefront/src/graphql.ts +5 -5
- package/dist/assets/storefront/src/hooks/use-mobile.ts +13 -13
- package/dist/assets/storefront/src/i18n/locale-utils.ts +3 -3
- package/dist/assets/storefront/src/i18n/navigation.ts +4 -4
- package/dist/assets/storefront/src/i18n/request.ts +4 -4
- package/dist/assets/storefront/src/i18n/routing.ts +5 -5
- package/dist/assets/storefront/src/i18n/server.ts +35 -7
- package/dist/assets/storefront/src/lib/actions/switch-channel.ts +9 -9
- package/dist/assets/storefront/src/lib/actions/switch-currency.ts +7 -7
- package/dist/assets/storefront/src/lib/auth.ts +1 -1
- package/dist/assets/storefront/src/lib/backend-health.ts +14 -6
- package/dist/assets/storefront/src/lib/cart-count-context.tsx +10 -4
- package/dist/assets/storefront/src/lib/cart-guard-utils.ts +2 -1
- package/dist/assets/storefront/src/lib/cart-guard.ts +7 -6
- package/dist/assets/storefront/src/lib/channel-server.ts +4 -4
- package/dist/assets/storefront/src/lib/company-context.ts +1 -1
- package/dist/assets/storefront/src/lib/company-permissions-context.tsx +1 -5
- package/dist/assets/storefront/src/lib/currency-server.ts +4 -4
- package/dist/assets/storefront/src/lib/format.ts +16 -7
- package/dist/assets/storefront/src/lib/metadata.ts +39 -44
- package/dist/assets/storefront/src/lib/quantity.ts +2 -4
- package/dist/assets/storefront/src/lib/search-bar-context.tsx +7 -4
- package/dist/assets/storefront/src/lib/use-recent-searches.ts +8 -6
- package/dist/assets/storefront/src/lib/utils.ts +3 -3
- package/dist/assets/storefront/src/lib/vendure/actions.ts +18 -16
- package/dist/assets/storefront/src/lib/vendure/api.ts +36 -23
- package/dist/assets/storefront/src/lib/vendure/approval-utils.ts +9 -8
- package/dist/assets/storefront/src/lib/vendure/cached.ts +20 -15
- package/dist/assets/storefront/src/lib/vendure/capability-documents.ts +246 -0
- package/dist/assets/storefront/src/lib/vendure/capability-schema.ts +358 -0
- package/dist/assets/storefront/src/lib/vendure/capability-ui.ts +15 -0
- package/dist/assets/storefront/src/lib/vendure/mutations.ts +835 -532
- package/dist/assets/storefront/src/lib/vendure/queries.ts +877 -524
- package/dist/assets/storefront/src/proxy.ts +11 -0
- package/dist/assets/storefront/src/scenarios/customer/hero.tsx +2 -2
- package/dist/assets/storefront/src/scenarios/customer/meta.ts +1 -1
- package/dist/assets/storefront/src/schema.graphql +337 -243
- package/dist/assets/templates/README.md.hbs +25 -1
- package/dist/assets/templates/docker-compose.yml.hbs +4 -0
- package/dist/assets/templates/env.hbs +34 -9
- package/dist/assets/templates/environment.d.ts.hbs +1 -0
- package/dist/assets/templates/gitignore.hbs +7 -4
- package/dist/assets/templates/migrate.ts.hbs +55 -0
- package/dist/assets/templates/npmrc.hbs +7 -2
- package/dist/assets/templates/platform-edition.ts.hbs +21 -0
- package/dist/assets/templates/server-package.json.hbs +15 -8
- package/dist/assets/templates/vendure-config.ts.hbs +18 -0
- package/dist/bin/run.js +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +1 -1
- package/dist/console-onboarding.d.ts +44 -0
- package/dist/console-onboarding.js +1 -0
- package/dist/hub-projects.d.ts +48 -0
- package/dist/hub-projects.js +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +1 -1
- package/dist/plugin-registry.d.ts +61 -2
- package/dist/plugin-registry.js +1 -1
- package/dist/registry.d.ts +16 -13
- package/dist/registry.js +1 -1
- package/dist/scaffold-shared.js +1 -1
- package/dist/scaffold-storefront-only.js +1 -1
- package/dist/scaffolder.d.ts +11 -0
- package/dist/scaffolder.js +1 -1
- package/dist/storefront-copier.d.ts +7 -2
- package/dist/storefront-copier.js +1 -1
- package/dist/template-renderer.d.ts +26 -5
- package/dist/template-renderer.js +1 -1
- package/dist/types.d.ts +54 -23
- package/package.json +14 -2
- package/dist/assets/storefront/src/middleware.ts +0 -11
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
+
"style": "new-york",
|
|
4
|
+
"rsc": true,
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"tailwind": {
|
|
7
|
+
"config": "",
|
|
8
|
+
"css": "src/app/globals.css",
|
|
9
|
+
"baseColor": "slate",
|
|
10
|
+
"cssVariables": true,
|
|
11
|
+
"prefix": ""
|
|
12
|
+
},
|
|
13
|
+
"iconLibrary": "lucide",
|
|
14
|
+
"aliases": {
|
|
15
|
+
"components": "@/components",
|
|
16
|
+
"utils": "@/lib/utils",
|
|
17
|
+
"ui": "@/components/ui",
|
|
18
|
+
"lib": "@/lib",
|
|
19
|
+
"hooks": "@/hooks"
|
|
20
|
+
},
|
|
21
|
+
"registries": {}
|
|
22
22
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import nextVitals from 'eslint-config-next/core-web-vitals';
|
|
2
|
+
import nextTs from 'eslint-config-next/typescript';
|
|
3
|
+
import { defineConfig, globalIgnores } from 'eslint/config';
|
|
4
4
|
|
|
5
5
|
const eslintConfig = defineConfig([
|
|
6
6
|
...nextVitals,
|
|
7
7
|
...nextTs,
|
|
8
|
-
globalIgnores([
|
|
8
|
+
globalIgnores(['.next/**', 'out/**', 'build/**', 'next-env.d.ts']),
|
|
9
9
|
{
|
|
10
10
|
// Relax some rules for the starter code
|
|
11
11
|
rules: {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
13
|
+
'@typescript-eslint/no-unused-vars': 'warn',
|
|
14
|
+
'react/no-unescaped-entities': 'warn',
|
|
15
15
|
// These React 19 compiler rules are quite strict for the starter code
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
'react-hooks/set-state-in-effect': 'warn',
|
|
17
|
+
'react-hooks/purity': 'warn',
|
|
18
|
+
'react-hooks/error-boundaries': 'warn',
|
|
19
19
|
},
|
|
20
20
|
},
|
|
21
21
|
]);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
schema:
|
|
2
|
-
|
|
2
|
+
- http://localhost:3500/shop-api
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="next" />
|
|
2
2
|
/// <reference types="next/image-types/global" />
|
|
3
|
-
import "./.next/
|
|
3
|
+
import "./.next/types/routes.d.ts";
|
|
4
|
+
import "./.next/types/root-params.d.ts";
|
|
4
5
|
|
|
5
6
|
// NOTE: This file should not be edited
|
|
6
7
|
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {NextConfig} from 'next';
|
|
1
|
+
import { NextConfig } from 'next';
|
|
2
2
|
import createNextIntlPlugin from 'next-intl/plugin';
|
|
3
|
-
|
|
4
3
|
// Derive URLs from port variables if not explicitly set
|
|
5
4
|
const vendurePort = process.env.VENDURE_PORT ?? '3500';
|
|
6
5
|
const storefrontPort = process.env.STOREFRONT_PORT ?? '3001';
|
|
@@ -10,19 +9,21 @@ const withNextIntl = createNextIntlPlugin('./src/i18n/request.ts');
|
|
|
10
9
|
const nextConfig: NextConfig = {
|
|
11
10
|
// cacheComponents enables PPR + useCache + dynamicIO.
|
|
12
11
|
//
|
|
13
|
-
// Combining this with next-intl
|
|
14
|
-
// scopes can read the locale
|
|
15
|
-
//
|
|
16
|
-
//
|
|
12
|
+
// Combining this with next-intl needs next/root-params so that 'use cache'
|
|
13
|
+
// scopes can read the locale (which becomes an automatic cache key) instead
|
|
14
|
+
// of headers(), which is forbidden in cache boundaries. next/root-params is
|
|
15
|
+
// stable as of Next.js 16.3 and needs no config flag; the 16.2-era
|
|
16
|
+
// `experimental.rootParams` opt-in no longer exists.
|
|
17
17
|
//
|
|
18
|
-
// Key constraints (as of Next.js 16.
|
|
19
|
-
// 1. No root layout above [locale]
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
// 2. next/root-params
|
|
24
|
-
//
|
|
25
|
-
// as a
|
|
18
|
+
// Key constraints (as of Next.js 16.3 / next-intl 4.9):
|
|
19
|
+
// 1. No root layout above [locale]. Root params are the dynamic segments
|
|
20
|
+
// that sit above the root layout, so a layout.tsx at the app root
|
|
21
|
+
// would leave [locale] below it and next/root-params would export
|
|
22
|
+
// nothing.
|
|
23
|
+
// 2. next/root-params works in any Server Component, including shared
|
|
24
|
+
// utility modules, but not in Client Components, Server Actions or
|
|
25
|
+
// Route Handlers. Those must use getLocale() or take locale as a
|
|
26
|
+
// parameter — see src/i18n/server.ts.
|
|
26
27
|
// 3. Turbopack dev has a pre-existing compilation hang on this project
|
|
27
28
|
// (not i18n-related), so we use --webpack for dev and build.
|
|
28
29
|
//
|
|
@@ -31,14 +32,15 @@ const nextConfig: NextConfig = {
|
|
|
31
32
|
// https://aurorascharff.no/posts/implementing-nextjs-16-use-cache-with-next-intl-internationalization/
|
|
32
33
|
cacheComponents: true,
|
|
33
34
|
experimental: {
|
|
34
|
-
rootParams: true,
|
|
35
35
|
optimizePackageImports: ['lucide-react'],
|
|
36
36
|
},
|
|
37
37
|
env: {
|
|
38
38
|
// Derive API URL from PORT if not explicitly set
|
|
39
39
|
VENDURE_SHOP_API_URL: process.env.VENDURE_SHOP_API_URL ?? `http://localhost:${vendurePort}/shop-api`,
|
|
40
40
|
NEXT_PUBLIC_SITE_URL: process.env.NEXT_PUBLIC_SITE_URL ?? `http://localhost:${storefrontPort}`,
|
|
41
|
-
...(process.env.VENDURE_CHANNEL_TOKEN
|
|
41
|
+
...(process.env.VENDURE_CHANNEL_TOKEN
|
|
42
|
+
? { VENDURE_CHANNEL_TOKEN: process.env.VENDURE_CHANNEL_TOKEN }
|
|
43
|
+
: {}),
|
|
42
44
|
REVALIDATION_SECRET: process.env.REVALIDATION_SECRET,
|
|
43
45
|
NEXT_PUBLIC_SCENARIO: process.env.NEXT_PUBLIC_SCENARIO ?? 'customer',
|
|
44
46
|
},
|
|
@@ -53,4 +55,4 @@ const nextConfig: NextConfig = {
|
|
|
53
55
|
},
|
|
54
56
|
};
|
|
55
57
|
|
|
56
|
-
export default withNextIntl(nextConfig);
|
|
58
|
+
export default withNextIntl(nextConfig);
|
|
@@ -37,16 +37,17 @@
|
|
|
37
37
|
"@radix-ui/react-toggle": "^1.1.10",
|
|
38
38
|
"@radix-ui/react-toggle-group": "^1.1.11",
|
|
39
39
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
40
|
-
"@vendure-platform/storefront-client": "^0.
|
|
40
|
+
"@vendure-platform/storefront-client": "^1.0.0-major.202609091053.0.0",
|
|
41
41
|
"class-variance-authority": "^0.7.1",
|
|
42
42
|
"clsx": "^2.1.1",
|
|
43
43
|
"cmdk": "^1.1.1",
|
|
44
44
|
"date-fns": "^4.1.0",
|
|
45
45
|
"embla-carousel-react": "^8.6.0",
|
|
46
46
|
"gql.tada": "^1.9.0",
|
|
47
|
+
"graphql": "^16.13.2",
|
|
47
48
|
"input-otp": "^1.4.2",
|
|
48
49
|
"lucide-react": "^0.544.0",
|
|
49
|
-
"next": "^16.
|
|
50
|
+
"next": "^16.3.3",
|
|
50
51
|
"next-intl": "^4.8.3",
|
|
51
52
|
"next-themes": "^0.4.6",
|
|
52
53
|
"react": " ^19.2.0",
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { ShopByCategory } from '@/components/commerce/shop-by-category';
|
|
2
|
+
import { Link } from '@/i18n/navigation';
|
|
3
|
+
import { getActiveChannelToken } from '@/lib/channel-server';
|
|
4
|
+
import { SITE_NAME, buildAlternates, buildCanonicalUrl } from '@/lib/metadata';
|
|
5
|
+
import { getTopCollections } from '@/lib/vendure/cached';
|
|
6
|
+
import { ArrowRight } from 'lucide-react';
|
|
7
|
+
import type { Metadata } from 'next';
|
|
8
|
+
import { getTranslations, setRequestLocale } from 'next-intl/server';
|
|
9
9
|
|
|
10
10
|
export async function generateMetadata({
|
|
11
11
|
params,
|
|
12
|
-
}: {
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
}: {
|
|
13
|
+
params: Promise<{ locale: string }>;
|
|
14
|
+
}): Promise<Metadata> {
|
|
15
|
+
const { locale } = await params;
|
|
16
|
+
const t = await getTranslations({ locale, namespace: 'Catalog' });
|
|
15
17
|
const title = t('pageTitle');
|
|
16
18
|
const description = t('pageDescription');
|
|
17
19
|
return {
|
|
@@ -27,10 +29,8 @@ export async function generateMetadata({
|
|
|
27
29
|
};
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
export default async function CatalogPage({
|
|
31
|
-
params
|
|
32
|
-
}: {params: Promise<{locale: string}>}) {
|
|
33
|
-
const {locale} = await params;
|
|
32
|
+
export default async function CatalogPage({ params }: { params: Promise<{ locale: string }> }) {
|
|
33
|
+
const { locale } = await params;
|
|
34
34
|
setRequestLocale(locale);
|
|
35
35
|
const channelToken = await getActiveChannelToken();
|
|
36
36
|
const [collections, t] = await Promise.all([
|
|
@@ -41,12 +41,8 @@ export default async function CatalogPage({
|
|
|
41
41
|
return (
|
|
42
42
|
<div className="py-8">
|
|
43
43
|
<header className="mb-8">
|
|
44
|
-
<h1 className="text-3xl md:text-4xl font-bold tracking-tight">
|
|
45
|
-
|
|
46
|
-
</h1>
|
|
47
|
-
<p className="mt-2 text-muted-foreground">
|
|
48
|
-
{t('pageDescription')}
|
|
49
|
-
</p>
|
|
44
|
+
<h1 className="text-3xl md:text-4xl font-bold tracking-tight">{t('pageTitle')}</h1>
|
|
45
|
+
<p className="mt-2 text-muted-foreground">{t('pageDescription')}</p>
|
|
50
46
|
</header>
|
|
51
47
|
|
|
52
48
|
<ShopByCategory collections={collections} />
|
|
@@ -1,38 +1,47 @@
|
|
|
1
|
-
import type { Metadata } from 'next';
|
|
2
|
-
import { Suspense } from 'react';
|
|
3
|
-
import { publicClient } from '@/lib/vendure/api';
|
|
4
|
-
import { getActiveChannelToken } from '@/lib/channel-server';
|
|
5
|
-
import { SearchProductsQuery, GetCollectionProductsQuery } from '@/lib/vendure/queries';
|
|
6
1
|
import { CatalogSearchBar } from '@/components/commerce/catalog-search-bar';
|
|
7
2
|
import { CollectionHeroBanner } from '@/components/commerce/collection-hero-banner';
|
|
8
|
-
import { SubcollectionTiles } from '@/components/commerce/subcollection-tiles';
|
|
9
|
-
import { ProductGrid } from '@/components/commerce/product-grid';
|
|
10
3
|
import { FacetFilters } from '@/components/commerce/facet-filters';
|
|
11
|
-
import {
|
|
4
|
+
import { ProductGrid } from '@/components/commerce/product-grid';
|
|
5
|
+
import { SubcollectionTiles } from '@/components/commerce/subcollection-tiles';
|
|
12
6
|
import { Breadcrumbs } from '@/components/shared/breadcrumbs';
|
|
13
7
|
import { CatalogSidebarSkeleton } from '@/components/shared/catalog-sidebar-skeleton';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { getTranslations, setRequestLocale } from 'next-intl/server';
|
|
8
|
+
import { ProductGridSkeleton } from '@/components/shared/product-grid-skeleton';
|
|
9
|
+
import { getActiveChannelToken } from '@/lib/channel-server';
|
|
17
10
|
import {
|
|
18
|
-
SITE_NAME,
|
|
19
|
-
truncateDescription,
|
|
20
|
-
buildCanonicalUrl,
|
|
21
11
|
buildAlternates,
|
|
12
|
+
buildCanonicalUrl,
|
|
22
13
|
buildOgImages,
|
|
14
|
+
SITE_NAME,
|
|
15
|
+
truncateDescription,
|
|
23
16
|
} from '@/lib/metadata';
|
|
17
|
+
import { buildSearchInput, getCurrentPage } from '@/lib/search-helpers';
|
|
18
|
+
import { publicClient } from '@/lib/vendure/api';
|
|
19
|
+
import { GetCollectionProductsQuery, SearchProductsQuery } from '@/lib/vendure/queries';
|
|
20
|
+
import type { Metadata } from 'next';
|
|
21
|
+
import { getTranslations, setRequestLocale } from 'next-intl/server';
|
|
22
|
+
import { cacheLife, cacheTag } from 'next/cache';
|
|
23
|
+
import { Suspense } from 'react';
|
|
24
24
|
|
|
25
|
-
async function getCollectionProducts(
|
|
25
|
+
async function getCollectionProducts(
|
|
26
|
+
slug: string,
|
|
27
|
+
locale: string,
|
|
28
|
+
searchParams: { [key: string]: string | string[] | undefined },
|
|
29
|
+
channelToken?: string,
|
|
30
|
+
) {
|
|
26
31
|
'use cache';
|
|
27
32
|
cacheLife('hours');
|
|
28
33
|
cacheTag(`collection-${slug}-${locale}${channelToken ? `-${channelToken}` : ''}`);
|
|
29
34
|
|
|
30
|
-
const [result, error] = await publicClient.query(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
const [result, error] = await publicClient.query(
|
|
36
|
+
SearchProductsQuery,
|
|
37
|
+
{
|
|
38
|
+
input: buildSearchInput({
|
|
39
|
+
searchParams,
|
|
40
|
+
collectionSlug: slug,
|
|
41
|
+
}),
|
|
42
|
+
},
|
|
43
|
+
{ languageCode: locale, ...(channelToken ? { channelToken } : {}) },
|
|
44
|
+
);
|
|
36
45
|
if (error) return undefined;
|
|
37
46
|
return result;
|
|
38
47
|
}
|
|
@@ -42,22 +51,28 @@ async function getCollectionMetadata(slug: string, locale: string, channelToken?
|
|
|
42
51
|
cacheLife('hours');
|
|
43
52
|
cacheTag(`collection-meta-${slug}-${locale}${channelToken ? `-${channelToken}` : ''}`);
|
|
44
53
|
|
|
45
|
-
const [result, error] = await publicClient.query(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
54
|
+
const [result, error] = await publicClient.query(
|
|
55
|
+
GetCollectionProductsQuery,
|
|
56
|
+
{
|
|
57
|
+
slug,
|
|
58
|
+
input: { take: 0, collectionSlug: slug, groupByProduct: true },
|
|
59
|
+
},
|
|
60
|
+
{ languageCode: locale, ...(channelToken ? { channelToken } : {}) },
|
|
61
|
+
);
|
|
49
62
|
if (error) return undefined;
|
|
50
63
|
return result;
|
|
51
64
|
}
|
|
52
65
|
|
|
53
66
|
export async function generateMetadata({
|
|
54
67
|
params,
|
|
55
|
-
}: {
|
|
68
|
+
}: {
|
|
69
|
+
params: Promise<{ locale: string; slug: string }>;
|
|
70
|
+
}): Promise<Metadata> {
|
|
56
71
|
const { locale, slug } = await params;
|
|
57
72
|
const channelToken = await getActiveChannelToken();
|
|
58
73
|
const [result, t] = await Promise.all([
|
|
59
74
|
getCollectionMetadata(slug, locale, channelToken),
|
|
60
|
-
getTranslations({locale, namespace: 'Product'}),
|
|
75
|
+
getTranslations({ locale, namespace: 'Product' }),
|
|
61
76
|
]);
|
|
62
77
|
if (!result) {
|
|
63
78
|
return { title: t('home') };
|
|
@@ -88,9 +103,7 @@ export async function generateMetadata({
|
|
|
88
103
|
card: 'summary_large_image',
|
|
89
104
|
title: collection.name,
|
|
90
105
|
description,
|
|
91
|
-
images: collection.featuredAsset?.preview
|
|
92
|
-
? [collection.featuredAsset.preview]
|
|
93
|
-
: undefined,
|
|
106
|
+
images: collection.featuredAsset?.preview ? [collection.featuredAsset.preview] : undefined,
|
|
94
107
|
},
|
|
95
108
|
};
|
|
96
109
|
}
|
|
@@ -109,7 +122,13 @@ export default async function CollectionPage({
|
|
|
109
122
|
);
|
|
110
123
|
}
|
|
111
124
|
|
|
112
|
-
async function CollectionContent({
|
|
125
|
+
async function CollectionContent({
|
|
126
|
+
paramsPromise,
|
|
127
|
+
searchParamsPromise,
|
|
128
|
+
}: {
|
|
129
|
+
paramsPromise: Promise<{ locale: string; slug: string }>;
|
|
130
|
+
searchParamsPromise: Promise<{ [key: string]: string | string[] | undefined }>;
|
|
131
|
+
}) {
|
|
113
132
|
const { locale, slug } = await paramsPromise;
|
|
114
133
|
setRequestLocale(locale);
|
|
115
134
|
const searchParams = await searchParamsPromise;
|
|
@@ -122,13 +141,12 @@ async function CollectionContent({ paramsPromise, searchParamsPromise }: { param
|
|
|
122
141
|
]);
|
|
123
142
|
|
|
124
143
|
const collection = metaResult?.data?.collection;
|
|
125
|
-
const breadcrumbs =
|
|
126
|
-
?.
|
|
127
|
-
|
|
128
|
-
i
|
|
129
|
-
? { name: b.name }
|
|
130
|
-
|
|
131
|
-
) ?? [];
|
|
144
|
+
const breadcrumbs =
|
|
145
|
+
collection?.breadcrumbs
|
|
146
|
+
?.filter((b) => b.slug !== '__root_collection__')
|
|
147
|
+
.map((b, i, arr) =>
|
|
148
|
+
i === arr.length - 1 ? { name: b.name } : { name: b.name, href: `/collection/${b.slug}` },
|
|
149
|
+
) ?? [];
|
|
132
150
|
|
|
133
151
|
if (!productData) {
|
|
134
152
|
return (
|
|
@@ -165,11 +183,15 @@ async function CollectionContent({ paramsPromise, searchParamsPromise }: { param
|
|
|
165
183
|
<Suspense>
|
|
166
184
|
<CatalogSearchBar />
|
|
167
185
|
</Suspense>
|
|
168
|
-
{children.length > 0 &&
|
|
169
|
-
<SubcollectionTiles collections={children} />
|
|
170
|
-
)}
|
|
186
|
+
{children.length > 0 && <SubcollectionTiles collections={children} />}
|
|
171
187
|
<Suspense fallback={<ProductGridSkeleton />}>
|
|
172
|
-
<ProductGrid
|
|
188
|
+
<ProductGrid
|
|
189
|
+
productDataPromise={productDataPromise}
|
|
190
|
+
currentPage={page}
|
|
191
|
+
take={12}
|
|
192
|
+
view={searchParams.view as string}
|
|
193
|
+
emptyMessage={t('noCategoryProducts')}
|
|
194
|
+
/>
|
|
173
195
|
</Suspense>
|
|
174
196
|
</div>
|
|
175
197
|
</div>
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
export default function CatalogLayout({ children }: { children: ReactNode }) {
|
|
4
|
-
return (
|
|
5
|
-
<div className="container mx-auto px-4 pt-[var(--page-top-offset)]">
|
|
6
|
-
{children}
|
|
7
|
-
</div>
|
|
8
|
-
);
|
|
4
|
+
return <div className="container mx-auto px-4 pt-[var(--page-top-offset)]">{children}</div>;
|
|
9
5
|
}
|
|
@@ -1,66 +1,67 @@
|
|
|
1
1
|
'use server';
|
|
2
2
|
|
|
3
|
+
import { setAuthToken } from '@/lib/auth';
|
|
4
|
+
import { cartGuard } from '@/lib/cart-guard';
|
|
5
|
+
import { getGuardError } from '@/lib/cart-guard-utils';
|
|
6
|
+
import { normalizeQuantity } from '@/lib/quantity';
|
|
3
7
|
import { client } from '@/lib/vendure/api';
|
|
4
8
|
import {
|
|
5
|
-
AddToCartMutation,
|
|
6
|
-
AddGiftCardToOrderMutation,
|
|
7
9
|
AddConfigurationToOrderMutation,
|
|
10
|
+
AddGiftCardToOrderMutation,
|
|
11
|
+
AddToCartMutation,
|
|
8
12
|
UpdateConfigurationOnOrderMutation,
|
|
9
13
|
} from '@/lib/vendure/mutations';
|
|
10
14
|
import {
|
|
11
|
-
GetProductDetailQuery,
|
|
12
15
|
EvaluateConfigurationQuery,
|
|
13
16
|
GetActiveOrderConfigurationsQuery,
|
|
17
|
+
GetProductDetailQuery,
|
|
14
18
|
type ActiveOrderConfiguration,
|
|
15
19
|
} from '@/lib/vendure/queries';
|
|
16
20
|
import { updateTag } from 'next/cache';
|
|
17
|
-
import { setAuthToken } from '@/lib/auth';
|
|
18
|
-
import { normalizeQuantity } from '@/lib/quantity';
|
|
19
|
-
import { cartGuard } from '@/lib/cart-guard';
|
|
20
|
-
import { getGuardError } from '@/lib/cart-guard-utils';
|
|
21
21
|
|
|
22
22
|
export async function getProductBySlug(slug: string) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
const [result, error] = await client.query(GetProductDetailQuery, { slug });
|
|
24
|
+
if (error) throw error;
|
|
25
|
+
return result.data.product;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export async function addToCart(variantId: string, quantity: number = 1, packagingUnitId?: string) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
const guard = await cartGuard();
|
|
30
|
+
const guardError = getGuardError(guard);
|
|
31
|
+
if (guardError) {
|
|
32
|
+
return { success: false, error: guardError };
|
|
33
|
+
}
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
const nextQuantity = normalizeQuantity(quantity);
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
const customFields = packagingUnitId ? { packagingUnitId } : undefined;
|
|
38
|
+
const [result, error] = await client.mutate(AddToCartMutation, {
|
|
39
|
+
variantId,
|
|
40
|
+
quantity: nextQuantity,
|
|
41
|
+
customFields,
|
|
42
|
+
});
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
if (error) {
|
|
45
|
+
return { success: false, error: 'Failed to add item to cart' };
|
|
46
|
+
}
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
if (result.authToken) {
|
|
49
|
+
await setAuthToken(result.authToken);
|
|
50
|
+
}
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
52
|
+
if (result.data.addItemToOrder.__typename === 'Order') {
|
|
53
|
+
updateTag('cart');
|
|
54
|
+
updateTag('active-order');
|
|
55
|
+
return {
|
|
56
|
+
success: true,
|
|
57
|
+
order: result.data.addItemToOrder,
|
|
58
|
+
requiresReapproval: guard.requiresReapproval,
|
|
59
|
+
};
|
|
60
|
+
} else {
|
|
61
|
+
const data = result.data.addItemToOrder;
|
|
62
|
+
const error = 'interceptorError' in data ? data.interceptorError : data.message;
|
|
63
|
+
return { success: false, error };
|
|
64
|
+
}
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
export interface AddGiftCardInput {
|
|
@@ -79,19 +80,16 @@ export async function addGiftCardToCart(input: AddGiftCardInput) {
|
|
|
79
80
|
return { error: guardError };
|
|
80
81
|
}
|
|
81
82
|
|
|
82
|
-
const [result, error] = await client.mutate(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
message: input.message || undefined,
|
|
91
|
-
deliveryDate: input.deliveryDate ? new Date(input.deliveryDate).toISOString() : undefined,
|
|
92
|
-
},
|
|
83
|
+
const [result, error] = await client.mutate(AddGiftCardToOrderMutation, {
|
|
84
|
+
input: {
|
|
85
|
+
value: input.value,
|
|
86
|
+
templateId: input.templateId,
|
|
87
|
+
senderName: input.senderName || undefined,
|
|
88
|
+
recipientEmailAddress: input.recipientEmailAddress || undefined,
|
|
89
|
+
message: input.message || undefined,
|
|
90
|
+
deliveryDate: input.deliveryDate ? new Date(input.deliveryDate).toISOString() : undefined,
|
|
93
91
|
},
|
|
94
|
-
);
|
|
92
|
+
});
|
|
95
93
|
|
|
96
94
|
if (error) {
|
|
97
95
|
console.error('[addGiftCardToCart]', error);
|
|
@@ -114,9 +112,13 @@ export async function addGiftCardToCart(input: AddGiftCardInput) {
|
|
|
114
112
|
export async function evaluateConfiguration(systemId: string, values: { fieldRef: string; value: string }[]) {
|
|
115
113
|
const { getLocale } = await import('next-intl/server');
|
|
116
114
|
const locale = await getLocale();
|
|
117
|
-
const [result, error] = await client.query(
|
|
118
|
-
|
|
119
|
-
|
|
115
|
+
const [result, error] = await client.query(
|
|
116
|
+
EvaluateConfigurationQuery,
|
|
117
|
+
{
|
|
118
|
+
input: { systemId, values },
|
|
119
|
+
},
|
|
120
|
+
{ languageCode: locale },
|
|
121
|
+
);
|
|
120
122
|
if (error) {
|
|
121
123
|
return { error: error.message || 'Failed to evaluate configuration' };
|
|
122
124
|
}
|
|
@@ -135,7 +137,7 @@ export async function getActiveOrderConfiguration(
|
|
|
135
137
|
const [result, error] = await client.query(GetActiveOrderConfigurationsQuery, undefined);
|
|
136
138
|
if (error) return null;
|
|
137
139
|
return (
|
|
138
|
-
result.data.activeOrder?.productConfigurations?.find(c => c.id === productConfigurationId) ?? null
|
|
140
|
+
result.data.activeOrder?.productConfigurations?.find((c) => c.id === productConfigurationId) ?? null
|
|
139
141
|
);
|
|
140
142
|
}
|
|
141
143
|
|
|
@@ -150,10 +152,9 @@ export async function updateConfigurationOnOrder(
|
|
|
150
152
|
return { success: false, error: guardError };
|
|
151
153
|
}
|
|
152
154
|
|
|
153
|
-
const [result, error] = await client.mutate(
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
);
|
|
155
|
+
const [result, error] = await client.mutate(UpdateConfigurationOnOrderMutation, {
|
|
156
|
+
input: { productConfigurationId, values, name: name || undefined },
|
|
157
|
+
});
|
|
157
158
|
|
|
158
159
|
if (error) {
|
|
159
160
|
return { success: false, error: error.message || 'Failed to update configuration' };
|
|
@@ -168,17 +169,20 @@ export async function updateConfigurationOnOrder(
|
|
|
168
169
|
return { success: true };
|
|
169
170
|
}
|
|
170
171
|
|
|
171
|
-
export async function addConfigurationToOrder(
|
|
172
|
+
export async function addConfigurationToOrder(
|
|
173
|
+
systemId: string,
|
|
174
|
+
values: { fieldRef: string; value: string }[],
|
|
175
|
+
name?: string,
|
|
176
|
+
) {
|
|
172
177
|
const guard = await cartGuard();
|
|
173
178
|
const guardError = getGuardError(guard);
|
|
174
179
|
if (guardError) {
|
|
175
180
|
return { success: false, error: guardError };
|
|
176
181
|
}
|
|
177
182
|
|
|
178
|
-
const [result, error] = await client.mutate(
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
);
|
|
183
|
+
const [result, error] = await client.mutate(AddConfigurationToOrderMutation, {
|
|
184
|
+
input: { systemId, values, name: name || undefined },
|
|
185
|
+
});
|
|
182
186
|
|
|
183
187
|
if (error) {
|
|
184
188
|
return { success: false, error: error.message || 'Failed to add configuration to order' };
|