@faststore/core 3.99.1 → 4.0.0-dev.4
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/.turbo/turbo-generate.log +29 -0
- package/.turbo/turbo-test.log +47 -16
- package/@generated/cached-operations.json +24 -0
- package/@generated/gql.ts +134 -210
- package/@generated/graphql.ts +1628 -3037
- package/@generated/index.ts +1 -1
- package/@generated/persisted-documents.json +1 -1
- package/@generated/schema.graphql +1854 -1743
- package/CHANGELOG.md +28 -4
- package/README.md +2 -1
- package/api/index.ts +6 -7
- package/cms/faststore/base.jsonc +1 -1
- package/cms/faststore/components/cms_component__alert.jsonc +5 -1
- package/cms/faststore/components/cms_component__bannernewsletter.jsonc +5 -1
- package/cms/faststore/components/cms_component__bannertext.jsonc +5 -1
- package/cms/faststore/components/cms_component__breadcrumb.jsonc +16 -4
- package/cms/faststore/components/cms_component__cartsidebar.jsonc +21 -1
- package/cms/faststore/components/cms_component__children.jsonc +5 -1
- package/cms/faststore/components/cms_component__crosssellingshelf.jsonc +5 -1
- package/cms/faststore/components/cms_component__emptystate.jsonc +8 -3
- package/cms/faststore/components/cms_component__footer.jsonc +9 -3
- package/cms/faststore/components/cms_component__hero.jsonc +5 -1
- package/cms/faststore/components/cms_component__incentives.jsonc +5 -1
- package/cms/faststore/components/cms_component__navbar.jsonc +139 -1
- package/cms/faststore/components/cms_component__newsletter.jsonc +5 -1
- package/cms/faststore/components/cms_component__productdetails.jsonc +33 -1
- package/cms/faststore/components/cms_component__productgallery.jsonc +113 -15
- package/cms/faststore/components/cms_component__productshelf.jsonc +5 -1
- package/cms/faststore/components/cms_component__producttiles.jsonc +5 -1
- package/cms/faststore/components/cms_component__regionbar.jsonc +5 -1
- package/cms/faststore/components/cms_component__regionmodal.jsonc +5 -1
- package/cms/faststore/components/cms_component__regionpopover.jsonc +5 -1
- package/cms/faststore/components/cms_component__scrolltotopbutton.jsonc +29 -0
- package/cms/faststore/components/cms_component__search.jsonc +5 -1
- package/cms/faststore/content-types.json +115 -0
- package/cms/faststore/pages/cms_content_type__globalsections.jsonc +52 -0
- package/cms/faststore/pages/cms_content_type__home.jsonc +6 -0
- package/cms/faststore/pages/cms_content_type__landingpage.jsonc +8 -1
- package/cms/faststore/pages/cms_content_type__pdp.jsonc +6 -0
- package/cms/faststore/pages/cms_content_type__plp.jsonc +17 -0
- package/cms/faststore/pages/cms_content_type__search.jsonc +17 -0
- package/cms/faststore/schema.json +547 -43
- package/cms/faststore/sections.json +330 -21
- package/discovery.config.default.js +49 -3
- package/next-env.d.ts +2 -1
- package/next.config.js +48 -26
- package/package.json +47 -60
- package/public/icons.svg +5 -1
- package/scripts/i18n.js +76 -0
- package/src/components/account/MyAccountDrawer/OrganizationDrawer/OrganizationDrawer.tsx +2 -1
- package/src/components/account/MyAccountDrawer/OrganizationDrawer/section.module.scss +25 -24
- package/src/components/account/MyAccountDrawer/ProfileSummary/profile-summary.scss +8 -6
- package/src/components/account/MyAccountLayout/styles.scss +16 -12
- package/src/components/account/MyAccountMenu/styles.scss +21 -22
- package/src/components/account/MyAccountUserDetails/styles.module.scss +4 -2
- package/src/components/account/components/MyAccountAccordion/styles.scss +4 -2
- package/src/components/account/components/MyAccountHeader/styles.scss +3 -1
- package/src/components/account/components/MyAccountTable/styles.scss +6 -4
- package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/section.module.scss +21 -19
- package/src/components/account/orders/MyAccountListOrders/MyAccountListOrdersTable/MyAccountListOrdersTable.tsx +3 -1
- package/src/components/account/orders/MyAccountListOrders/MyAccountListOrdersTable/styles.scss +5 -3
- package/src/components/account/orders/MyAccountListOrders/styles.module.scss +25 -22
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountBudgetsCard/styles.scss +7 -5
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountDeliveryOptionAccordion/styles.scss +7 -5
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountMoreInformationCard/styles.scss +3 -1
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActionModal/styles.module.scss +8 -6
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActions/styles.scss +3 -1
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountStatusCard/styles.scss +8 -6
- package/src/components/account/orders/MyAccountOrderDetails/section.module.scss +36 -43
- package/src/components/account/profile/profile.module.scss +3 -1
- package/src/components/account/section.module.scss +3 -1
- package/src/components/account/security/styles.module.scss +14 -8
- package/src/components/cart/CartSidebar/CartSidebar.tsx +10 -1
- package/src/components/cart/CartSidebar/section.module.scss +19 -17
- package/src/components/cart/EmptyCart/EmptyCart.tsx +12 -4
- package/src/components/cms/GlobalSections.tsx +12 -12
- package/src/components/cms/RenderSections.tsx +10 -2
- package/src/components/cms/plp/Components.ts +9 -0
- package/src/components/common/Alert/section.module.scss +10 -5
- package/src/components/common/PreviewTag/section.module.scss +48 -40
- package/src/components/common/Toast/section.module.scss +4 -2
- package/src/components/localization/LocalizationSelector/LocalizationSelector.tsx +320 -0
- package/src/components/localization/LocalizationSelector/index.ts +1 -0
- package/src/components/localization/LocalizationSelector/section.module.scss +18 -0
- package/src/components/localization/index.ts +1 -0
- package/src/components/navigation/Navbar/Navbar.tsx +49 -1
- package/src/components/navigation/NavbarSlider/NavbarSlider.tsx +19 -1
- package/src/components/navigation/NavbarSlider/section.module.scss +12 -10
- package/src/components/product/OutOfStock/OutOfStock.tsx +6 -1
- package/src/components/product/ProductCard/ProductCard.tsx +1 -1
- package/src/components/region/RegionModal/RegionModal.tsx +4 -1
- package/src/components/region/RegionModal/section.module.scss +10 -8
- package/src/components/region/RegionPopover/RegionPopover.tsx +6 -5
- package/src/components/region/RegionPopover/section.module.scss +9 -7
- package/src/components/region/RegionSlider/RegionSlider.tsx +5 -2
- package/src/components/region/RegionSlider/section.module.scss +16 -13
- package/src/components/search/Filter/FilterDeliveryMethodFacet.tsx +5 -5
- package/src/components/search/Filter/FilterDesktop.tsx +13 -4
- package/src/components/search/Filter/FilterSlider.tsx +18 -6
- package/src/components/search/Filter/section.module.scss +21 -19
- package/src/components/search/SearchDropdown/SearchDropdown.tsx +9 -7
- package/src/components/search/SearchHistory/SearchHistory.tsx +7 -2
- package/src/components/search/SearchInput/SearchInput.tsx +21 -8
- package/src/components/search/SearchProductItem/SearchProductItem.tsx +10 -3
- package/src/components/search/SearchTop/SearchTop.tsx +30 -24
- package/src/components/search/Sort/Sort.tsx +17 -19
- package/src/components/sections/Alert/Alert.tsx +6 -1
- package/src/components/sections/BannerNewsletter/section.module.scss +6 -4
- package/src/components/sections/BannerText/section.module.scss +5 -3
- package/src/components/sections/Breadcrumb/Breadcrumb.tsx +6 -2
- package/src/components/sections/Breadcrumb/section.module.scss +7 -5
- package/src/components/sections/EmptyState/section.module.scss +5 -3
- package/src/components/sections/Footer/Footer.tsx +1 -5
- package/src/components/sections/Footer/section.module.scss +10 -8
- package/src/components/sections/Hero/Hero.tsx +3 -1
- package/src/components/sections/Hero/section.module.scss +6 -4
- package/src/components/sections/Incentives/section.module.scss +5 -3
- package/src/components/sections/Navbar/Navbar.tsx +45 -0
- package/src/components/sections/Navbar/section.module.scss +34 -33
- package/src/components/sections/Newsletter/section.module.scss +10 -8
- package/src/components/sections/ProductDetails/ProductDetails.tsx +23 -1
- package/src/components/sections/ProductDetails/section.module.scss +32 -30
- package/src/components/sections/ProductGallery/EmptyGallery.tsx +13 -16
- package/src/components/sections/ProductGallery/section.module.scss +42 -39
- package/src/components/sections/ProductShelf/section.module.scss +22 -17
- package/src/components/sections/ProductTiles/section.module.scss +15 -13
- package/src/components/sections/RegionBar/section.module.scss +5 -3
- package/src/components/sections/ScrollToTopButton/ScrollToTopButton.tsx +4 -3
- package/src/components/sections/ScrollToTopButton/section.module.scss +4 -2
- package/src/components/templates/LandingPage/LandingPage.tsx +22 -16
- package/src/components/templates/ProductListingPage/ProductListing.tsx +1 -13
- package/src/components/templates/ProductListingPage/ProductListingPage.tsx +8 -3
- package/src/components/ui/Breadcrumb/Breadcrumb.tsx +14 -11
- package/src/components/ui/Button/ButtonSignIn/ButtonSignIn.tsx +2 -1
- package/src/components/ui/Button/ButtonSignIn/ButtonSignInFallback/ButtonSignInFallback.tsx +3 -1
- package/src/components/ui/Link/Link.tsx +19 -2
- package/src/components/ui/LinkButton/LinkButton.tsx +28 -0
- package/src/components/ui/LinkButton/index.ts +2 -0
- package/src/components/ui/LocalizationButton/LocalizationButton.tsx +124 -0
- package/src/components/ui/LocalizationButton/index.ts +1 -0
- package/src/components/ui/PickupPoints/PickupPointCards.tsx +2 -4
- package/src/components/ui/ProductComparison/ProductComparisonSidebar.tsx +34 -17
- package/src/components/ui/ProductDescription/ProductDescription.tsx +8 -3
- package/src/components/ui/ProductDetails/AddToCartLoadingSkeleton.tsx +6 -2
- package/src/components/ui/ProductDetails/ProductDetailsSettings.tsx +17 -5
- package/src/components/ui/ProductGallery/ProductGallery.tsx +7 -3
- package/src/components/ui/ProductGallery/ProductGalleryPage.tsx +1 -3
- package/src/components/ui/ShippingSimulation/ShippingSimulation.tsx +6 -1
- package/src/customizations/src/styles/custom-mixins.scss +0 -2
- package/src/experimental/index.ts +26 -0
- package/src/experimental/myAccountServerSideProps.ts +11 -2
- package/src/experimental/searchServerSideFunctions/getServerSideProps.ts +13 -7
- package/src/experimental/searchServerSideFunctions/getStaticProps.ts +5 -4
- package/src/instrumentation.ts +20 -6
- package/src/pages/404.tsx +5 -4
- package/src/pages/500.tsx +5 -4
- package/src/pages/[...slug].tsx +7 -4
- package/src/pages/[slug]/p.tsx +26 -8
- package/src/pages/_app.tsx +9 -1
- package/src/pages/api/fs/logout.ts +3 -2
- package/src/pages/api/graphql.ts +7 -23
- package/src/pages/api/preview.ts +21 -8
- package/src/pages/checkout.tsx +15 -5
- package/src/pages/index.tsx +19 -10
- package/src/pages/login.tsx +5 -4
- package/src/pages/pvt/account/403.tsx +11 -2
- package/src/pages/pvt/account/404.tsx +13 -3
- package/src/pages/pvt/account/index.tsx +6 -4
- package/src/pages/pvt/account/orders/[id].tsx +11 -3
- package/src/pages/pvt/account/orders/index.tsx +11 -3
- package/src/pages/pvt/account/profile.tsx +11 -2
- package/src/pages/pvt/account/security.tsx +11 -2
- package/src/pages/pvt/account/user-details.tsx +11 -2
- package/src/pages/s.tsx +26 -6
- package/src/proxy.ts +154 -0
- package/src/sdk/account/refreshToken.ts +4 -4
- package/src/sdk/account/useReorder.ts +8 -2
- package/src/sdk/analytics/platform/vtex/search.ts +3 -2
- package/src/sdk/cart/redirectToCheckout.ts +14 -8
- package/src/sdk/cart/useCheckoutButton.ts +7 -1
- package/src/sdk/deliveryPromise/useDeliveryPromise.ts +10 -18
- package/src/sdk/graphql/request.ts +102 -50
- package/src/sdk/localization/bindingSelector.ts +91 -0
- package/src/sdk/localization/index.ts +4 -0
- package/src/sdk/localization/match-url.ts +64 -0
- package/src/sdk/localization/types.ts +31 -0
- package/src/sdk/localization/useBindingSelector.ts +183 -0
- package/src/sdk/localization/useLocaleValidation.ts +49 -0
- package/src/sdk/localization/useLocalizationConfig.tsx +160 -0
- package/src/sdk/offer/fetcher.ts +3 -2
- package/src/sdk/product/useLocalizedVariables.ts +1 -1
- package/src/sdk/product/usePageProductsQuery.ts +2 -2
- package/src/sdk/product/useProductGalleryQuery.ts +1 -2
- package/src/sdk/product/useProductLink.ts +3 -1
- package/src/sdk/search/formatSearchPath.ts +28 -3
- package/src/sdk/search/state.ts +22 -13
- package/src/sdk/search/useSearchBase.ts +10 -0
- package/src/sdk/search/useSearchHistory.ts +41 -7
- package/src/sdk/session/index.ts +21 -3
- package/src/sdk/shipping/useShippingSimulation.ts +10 -2
- package/src/sdk/tsconfig.json +6 -0
- package/src/sdk/ui/useLink.ts +48 -0
- package/src/server/cms/global.ts +40 -0
- package/src/server/cms/index.ts +18 -10
- package/src/server/cms/pdp.ts +1 -0
- package/src/server/cms/plp.ts +3 -0
- package/src/server/content/service.ts +36 -24
- package/src/server/content/types.ts +10 -3
- package/src/server/index.ts +27 -20
- package/src/server/options.ts +27 -2
- package/src/styles/global/index.scss +10 -7
- package/src/styles/main.scss +3 -3
- package/src/typings/locales.ts +41 -0
- package/src/utils/fetchProductGallerySSR.ts +3 -1
- package/src/utils/getBaseDomain.ts +2 -1
- package/src/utils/getRequestHostname.ts +26 -0
- package/src/utils/globalSettings.ts +11 -0
- package/src/utils/localization/bindingPaths.ts +337 -0
- package/src/utils/localization/validateLocaleForHostname.ts +69 -0
- package/src/utils/localization/withLocaleValidation.ts +36 -0
- package/src/utils/utilities.ts +22 -0
- package/test/pages/api/preview.test.ts +93 -0
- package/test/sdk/localization/bindingSelector.test.ts +246 -0
- package/test/sdk/localization/store-url.browser.test.ts +140 -0
- package/test/sdk/localization/store-url.test.ts +96 -0
- package/test/sdk/localization/useBindingSelector.test.tsx +219 -0
- package/test/sdk/search/useSearchHistory.test.ts +222 -0
- package/test/server/cms/index.test.ts +3 -4
- package/test/server/content/service.test.ts +98 -0
- package/test/server/index.test.ts +10 -22
- package/test/utils/cookieCacheBusting.test.ts +32 -24
- package/test/utils/getRequestHostname.test.ts +71 -0
- package/test/utils/localization/bindingPaths.test.ts +706 -0
- package/test/utils/match-url.test.ts +388 -0
- package/tsconfig.json +11 -3
- package/vitest.config.ts +61 -0
- package/.next/BUILD_ID +0 -1
- package/.next/build-manifest.json +0 -197
- package/.next/cache/.tsbuildinfo +0 -1
- package/.next/cache/config.json +0 -7
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/export-marker.json +0 -1
- package/.next/images-manifest.json +0 -1
- package/.next/next-minimal-server.js.nft.json +0 -1
- package/.next/next-server.js.nft.json +0 -1
- package/.next/package.json +0 -1
- package/.next/prerender-manifest.js +0 -1
- package/.next/prerender-manifest.json +0 -1
- package/.next/react-loadable-manifest.json +0 -478
- package/.next/required-server-files.json +0 -1
- package/.next/routes-manifest.json +0 -1
- package/.next/server/chunks/1280.js +0 -1
- package/.next/server/chunks/1454.js +0 -1
- package/.next/server/chunks/1554.js +0 -1
- package/.next/server/chunks/1607.js +0 -1
- package/.next/server/chunks/1780.js +0 -1
- package/.next/server/chunks/1917.js +0 -1
- package/.next/server/chunks/1972.js +0 -1
- package/.next/server/chunks/2230.js +0 -1
- package/.next/server/chunks/2249.js +0 -1
- package/.next/server/chunks/2430.js +0 -1
- package/.next/server/chunks/2445.js +0 -12
- package/.next/server/chunks/2570.js +0 -1
- package/.next/server/chunks/2792.js +0 -1
- package/.next/server/chunks/2903.js +0 -1
- package/.next/server/chunks/294.js +0 -1
- package/.next/server/chunks/2955.js +0 -1
- package/.next/server/chunks/3006.js +0 -1
- package/.next/server/chunks/3029.js +0 -1
- package/.next/server/chunks/3060.js +0 -1
- package/.next/server/chunks/3408.js +0 -1
- package/.next/server/chunks/3483.js +0 -1
- package/.next/server/chunks/3683.js +0 -1
- package/.next/server/chunks/3836.js +0 -1
- package/.next/server/chunks/3890.js +0 -494
- package/.next/server/chunks/3922.js +0 -1
- package/.next/server/chunks/3945.js +0 -1
- package/.next/server/chunks/3951.js +0 -7
- package/.next/server/chunks/416.js +0 -1
- package/.next/server/chunks/4194.js +0 -1
- package/.next/server/chunks/4365.js +0 -1
- package/.next/server/chunks/4451.js +0 -1
- package/.next/server/chunks/4803.js +0 -1
- package/.next/server/chunks/4913.js +0 -13
- package/.next/server/chunks/5402.js +0 -1
- package/.next/server/chunks/5723.js +0 -13
- package/.next/server/chunks/5796.js +0 -1
- package/.next/server/chunks/6393.js +0 -1
- package/.next/server/chunks/6457.js +0 -6
- package/.next/server/chunks/6698.js +0 -1
- package/.next/server/chunks/6804.js +0 -6
- package/.next/server/chunks/6886.js +0 -1
- package/.next/server/chunks/7098.js +0 -9
- package/.next/server/chunks/7169.js +0 -1
- package/.next/server/chunks/7228.js +0 -1
- package/.next/server/chunks/7275.js +0 -1
- package/.next/server/chunks/7371.js +0 -1
- package/.next/server/chunks/7692.js +0 -1
- package/.next/server/chunks/7799.js +0 -1
- package/.next/server/chunks/8068.js +0 -1
- package/.next/server/chunks/83.js +0 -1
- package/.next/server/chunks/831.js +0 -1
- package/.next/server/chunks/8563.js +0 -1
- package/.next/server/chunks/8569.js +0 -1
- package/.next/server/chunks/8687.js +0 -1
- package/.next/server/chunks/870.js +0 -1
- package/.next/server/chunks/8737.js +0 -1
- package/.next/server/chunks/8741.js +0 -1
- package/.next/server/chunks/9088.js +0 -1
- package/.next/server/chunks/9117.js +0 -1
- package/.next/server/chunks/9237.js +0 -1
- package/.next/server/chunks/948.js +0 -3
- package/.next/server/chunks/9563.js +0 -3
- package/.next/server/chunks/9570.js +0 -1
- package/.next/server/chunks/9740.js +0 -1
- package/.next/server/chunks/9853.js +0 -1
- package/.next/server/chunks/9984.js +0 -1
- package/.next/server/chunks/9985.js +0 -1
- package/.next/server/chunks/9990.js +0 -1
- package/.next/server/chunks/ButtonSignIn.js +0 -1
- package/.next/server/chunks/Dropdown.js +0 -1
- package/.next/server/chunks/DropdownButton.js +0 -1
- package/.next/server/chunks/DropdownItem.js +0 -1
- package/.next/server/chunks/DropdownMenu.js +0 -1
- package/.next/server/chunks/FilterSkeleton.js +0 -1
- package/.next/server/chunks/ScrollToTopButton.js +0 -1
- package/.next/server/chunks/UIBannerText.js +0 -1
- package/.next/server/chunks/UISKUMatrixSidebar.js +0 -1
- package/.next/server/chunks/font-manifest.json +0 -1
- package/.next/server/edge-instrumentation.js +0 -2
- package/.next/server/edge-instrumentation.js.map +0 -1
- package/.next/server/edge-runtime-webpack.js +0 -157
- package/.next/server/edge-runtime-webpack.js.map +0 -1
- package/.next/server/font-manifest.json +0 -1
- package/.next/server/functions-config-manifest.json +0 -1
- package/.next/server/instrumentation.js +0 -1
- package/.next/server/instrumentation.js.nft.json +0 -1
- package/.next/server/middleware-build-manifest.js +0 -1
- package/.next/server/middleware-manifest.json +0 -6
- package/.next/server/middleware-react-loadable-manifest.js +0 -1
- package/.next/server/next-font-manifest.js +0 -1
- package/.next/server/next-font-manifest.json +0 -1
- package/.next/server/pages/404.js +0 -1
- package/.next/server/pages/404.js.nft.json +0 -1
- package/.next/server/pages/500.js +0 -1
- package/.next/server/pages/500.js.nft.json +0 -1
- package/.next/server/pages/[...slug].js +0 -1
- package/.next/server/pages/[...slug].js.nft.json +0 -1
- package/.next/server/pages/[slug]/p.js +0 -1
- package/.next/server/pages/[slug]/p.js.nft.json +0 -1
- package/.next/server/pages/_app.js +0 -1
- package/.next/server/pages/_app.js.nft.json +0 -1
- package/.next/server/pages/_document.js +0 -1
- package/.next/server/pages/_document.js.nft.json +0 -1
- package/.next/server/pages/_error.js +0 -1
- package/.next/server/pages/_error.js.nft.json +0 -1
- package/.next/server/pages/api/fs/logout.js +0 -1
- package/.next/server/pages/api/fs/logout.js.nft.json +0 -1
- package/.next/server/pages/api/graphql.js +0 -3
- package/.next/server/pages/api/graphql.js.nft.json +0 -1
- package/.next/server/pages/api/health/live.js +0 -1
- package/.next/server/pages/api/health/live.js.nft.json +0 -1
- package/.next/server/pages/api/health/ready.js +0 -1
- package/.next/server/pages/api/health/ready.js.nft.json +0 -1
- package/.next/server/pages/api/preview.js +0 -1
- package/.next/server/pages/api/preview.js.nft.json +0 -1
- package/.next/server/pages/checkout.js +0 -1
- package/.next/server/pages/checkout.js.nft.json +0 -1
- package/.next/server/pages/en-US/404.html +0 -42
- package/.next/server/pages/en-US/404.json +0 -1
- package/.next/server/pages/en-US/500.html +0 -42
- package/.next/server/pages/en-US/500.json +0 -1
- package/.next/server/pages/en-US/checkout.html +0 -42
- package/.next/server/pages/en-US/checkout.json +0 -1
- package/.next/server/pages/en-US/login.html +0 -42
- package/.next/server/pages/en-US/login.json +0 -1
- package/.next/server/pages/en-US/s.html +0 -42
- package/.next/server/pages/en-US/s.json +0 -1
- package/.next/server/pages/en-US.html +0 -42
- package/.next/server/pages/en-US.json +0 -1
- package/.next/server/pages/index.js +0 -1
- package/.next/server/pages/index.js.nft.json +0 -1
- package/.next/server/pages/login.js +0 -1
- package/.next/server/pages/login.js.nft.json +0 -1
- package/.next/server/pages/pvt/account/403.js +0 -1
- package/.next/server/pages/pvt/account/403.js.nft.json +0 -1
- package/.next/server/pages/pvt/account/404.js +0 -1
- package/.next/server/pages/pvt/account/404.js.nft.json +0 -1
- package/.next/server/pages/pvt/account/[...unknown].js +0 -1
- package/.next/server/pages/pvt/account/[...unknown].js.nft.json +0 -1
- package/.next/server/pages/pvt/account/orders/[id].js +0 -1
- package/.next/server/pages/pvt/account/orders/[id].js.nft.json +0 -1
- package/.next/server/pages/pvt/account/orders.js +0 -1
- package/.next/server/pages/pvt/account/orders.js.nft.json +0 -1
- package/.next/server/pages/pvt/account/profile.js +0 -1
- package/.next/server/pages/pvt/account/profile.js.nft.json +0 -1
- package/.next/server/pages/pvt/account/security.js +0 -1
- package/.next/server/pages/pvt/account/security.js.nft.json +0 -1
- package/.next/server/pages/pvt/account/user-details.js +0 -1
- package/.next/server/pages/pvt/account/user-details.js.nft.json +0 -1
- package/.next/server/pages/pvt/account.js +0 -1
- package/.next/server/pages/pvt/account.js.nft.json +0 -1
- package/.next/server/pages/s.js +0 -1
- package/.next/server/pages/s.js.nft.json +0 -1
- package/.next/server/pages-manifest.json +0 -1
- package/.next/server/webpack-api-runtime.js +0 -1
- package/.next/server/webpack-runtime.js +0 -1
- package/.next/static/NAuY8lqaeBBZf9CMZuYI2/_buildManifest.js +0 -1
- package/.next/static/NAuY8lqaeBBZf9CMZuYI2/_ssgManifest.js +0 -1
- package/.next/static/chunks/227-f109b24190a008ab.js +0 -8
- package/.next/static/chunks/2284.185d834d9829b652.js +0 -1
- package/.next/static/chunks/2851.e68ed3c8d27a032a.js +0 -1
- package/.next/static/chunks/2927.5a79877943a6bf7c.js +0 -1
- package/.next/static/chunks/3155.7bc4c730a79d9ecb.js +0 -1
- package/.next/static/chunks/3166-0b30a3887c0c346d.js +0 -1
- package/.next/static/chunks/3399.017c5209b74b0d97.js +0 -1
- package/.next/static/chunks/3483.ef53d632a763da3f.js +0 -1
- package/.next/static/chunks/349.b3b38e1e9f719dda.js +0 -1
- package/.next/static/chunks/3802.5e8b0b689eacc0f8.js +0 -1
- package/.next/static/chunks/3836.620480018be48233.js +0 -1
- package/.next/static/chunks/4436.e7af66f0b654ee36.js +0 -1
- package/.next/static/chunks/4803.b1920b6e3a1a6304.js +0 -1
- package/.next/static/chunks/5796.4351370494d8b8b6.js +0 -1
- package/.next/static/chunks/6393.55f991b1a6bb4fe7.js +0 -1
- package/.next/static/chunks/6700.b23221a57514e737.js +0 -1
- package/.next/static/chunks/6789.960162355435a81d.js +0 -1
- package/.next/static/chunks/7191-befad64ba238a817.js +0 -1
- package/.next/static/chunks/7692.8d5bf4560341a2f6.js +0 -1
- package/.next/static/chunks/7861.7f9f1a124a43da30.js +0 -6
- package/.next/static/chunks/8068.43663fb64762f7b8.js +0 -1
- package/.next/static/chunks/83.e0c16f0299b364a5.js +0 -1
- package/.next/static/chunks/8325.dabe9aa22eaadeed.js +0 -1
- package/.next/static/chunks/8587.53c8ce185ed1a2cb.js +0 -1
- package/.next/static/chunks/9173-e89da04079c35360.js +0 -2
- package/.next/static/chunks/9237.7555603703f81bf7.js +0 -1
- package/.next/static/chunks/9298-1d1ed0a54133cb59.js +0 -28
- package/.next/static/chunks/9399.d116a7fd62024783.js +0 -1
- package/.next/static/chunks/941.3e2782ab9c490eb0.js +0 -1
- package/.next/static/chunks/9701.f9a0bfffba8807dc.js +0 -1
- package/.next/static/chunks/9909.787576b171184aa5.js +0 -1
- package/.next/static/chunks/9960.7ef77f8a8b046170.js +0 -1
- package/.next/static/chunks/9979.aedbc094bdc2c599.js +0 -1
- package/.next/static/chunks/BannerNewsletter.00328ad162109908.js +0 -1
- package/.next/static/chunks/BannerText.dbbec87cadb8a521.js +0 -1
- package/.next/static/chunks/ButtonSignIn.f6e210eaca873e48.js +0 -1
- package/.next/static/chunks/CartItem.b34e295377f6f94f.js +0 -1
- package/.next/static/chunks/CartSidebar.ac447d1ef6276da1.js +0 -1
- package/.next/static/chunks/Dropdown.38b48c749bad6b60.js +0 -1
- package/.next/static/chunks/DropdownButton.66fa6b25dddb3a07.js +0 -1
- package/.next/static/chunks/DropdownItem.38b8f5a07c7f422a.js +0 -1
- package/.next/static/chunks/DropdownMenu.48b11521a24c6efd.js +0 -1
- package/.next/static/chunks/EmptyCart.320e2f94a0d5e6b1.js +0 -1
- package/.next/static/chunks/FilterSkeleton.7ab99e28f92341c9.js +0 -1
- package/.next/static/chunks/Footer.166b02c2f13980c6.js +0 -1
- package/.next/static/chunks/Gift.c49ba26da2fbab5e.js +0 -1
- package/.next/static/chunks/Newsletter.fc406f6029057022.js +0 -1
- package/.next/static/chunks/OrderSummary.5957d69f990d9add.js +0 -1
- package/.next/static/chunks/PreviewTag.f4f0c8710a7bcad9.js +0 -1
- package/.next/static/chunks/ProductShelf.cc46f5cdeeaeaff6.js +0 -1
- package/.next/static/chunks/ProductTiles.9b804e51b0704d60.js +0 -1
- package/.next/static/chunks/RegionModal.319ad44250cb12d2.js +0 -1
- package/.next/static/chunks/RegionSlider.0e0e93369f4f9c92.js +0 -1
- package/.next/static/chunks/ScrollToTopButton.c15431f2e8bb93ef.js +0 -1
- package/.next/static/chunks/ShoppingAssistant.ba191eb4dbed67e5.js +0 -1
- package/.next/static/chunks/Toast.5f90f0436708be5e.js +0 -1
- package/.next/static/chunks/UIBannerText.7315b16af4457059.js +0 -1
- package/.next/static/chunks/UISKUMatrixSidebar.b4349b2682bbe183.js +0 -1
- package/.next/static/chunks/UIToast.19a8664c01a00d3a.js +0 -1
- package/.next/static/chunks/framework-d514426edf885c68.js +0 -33
- package/.next/static/chunks/main-ec03882c4375091d.js +0 -1
- package/.next/static/chunks/pages/404-e3dfbbac003b02a2.js +0 -1
- package/.next/static/chunks/pages/500-c7814e085081d7b8.js +0 -1
- package/.next/static/chunks/pages/[...slug]-dc8a395a43b081f1.js +0 -1
- package/.next/static/chunks/pages/[slug]/p-644f1132f5a0f736.js +0 -1
- package/.next/static/chunks/pages/_app-84aaff8a9d4de60e.js +0 -1
- package/.next/static/chunks/pages/_error-2b0148be56a716e9.js +0 -1
- package/.next/static/chunks/pages/checkout-2071467ad42dfb99.js +0 -1
- package/.next/static/chunks/pages/index-8774d5b4a8744eb2.js +0 -1
- package/.next/static/chunks/pages/login-e74747c9f9cb5b49.js +0 -1
- package/.next/static/chunks/pages/pvt/account/403-491e6b062487b30f.js +0 -1
- package/.next/static/chunks/pages/pvt/account/404-5ad472d9f2ee1980.js +0 -1
- package/.next/static/chunks/pages/pvt/account/[...unknown]-f80f645594d2740c.js +0 -1
- package/.next/static/chunks/pages/pvt/account/orders/[id]-64e42157c0974c48.js +0 -1
- package/.next/static/chunks/pages/pvt/account/orders-faab39f2aff05fae.js +0 -1
- package/.next/static/chunks/pages/pvt/account/profile-9672177ee2665bc0.js +0 -1
- package/.next/static/chunks/pages/pvt/account/security-03eb1ccab9a30563.js +0 -1
- package/.next/static/chunks/pages/pvt/account/user-details-7838e3f79781596c.js +0 -1
- package/.next/static/chunks/pages/pvt/account-65fefcc699344bdb.js +0 -1
- package/.next/static/chunks/pages/s-162ba789e6611175.js +0 -1
- package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
- package/.next/static/chunks/webpack-f621ff3e951d2982.js +0 -1
- package/.next/static/css/02259c549b2179f2.css +0 -1
- package/.next/static/css/02eaf202d3d11fd1.css +0 -1
- package/.next/static/css/033e241c58ba6fbb.css +0 -1
- package/.next/static/css/042d012bc1895b5c.css +0 -1
- package/.next/static/css/14176a4704ff97b2.css +0 -1
- package/.next/static/css/146a8678babc61bf.css +0 -1
- package/.next/static/css/16d65422bfa80f51.css +0 -1
- package/.next/static/css/1c4983f11b861ea0.css +0 -1
- package/.next/static/css/204754bbd8cc4bef.css +0 -1
- package/.next/static/css/24d91007fc96be10.css +0 -1
- package/.next/static/css/2980acad3f8e1028.css +0 -1
- package/.next/static/css/2c19433e38fd7533.css +0 -1
- package/.next/static/css/31380ebc6e671486.css +0 -1
- package/.next/static/css/42df884711219edb.css +0 -1
- package/.next/static/css/4f0597b0bf0ef2e1.css +0 -1
- package/.next/static/css/54cedf4b65e5863f.css +0 -1
- package/.next/static/css/6580147d7ab8fcca.css +0 -1
- package/.next/static/css/6819dddf2b1b5ea7.css +0 -1
- package/.next/static/css/7ef7762f412ed665.css +0 -1
- package/.next/static/css/82f3cd529b672812.css +0 -1
- package/.next/static/css/837662922091162f.css +0 -1
- package/.next/static/css/8e6ab59ace21e03b.css +0 -1
- package/.next/static/css/a852afa9be31e946.css +0 -1
- package/.next/static/css/b684b347c5cc6514.css +0 -1
- package/.next/static/css/bcdaef0a83277ef5.css +0 -1
- package/.next/static/css/c33615999008d3f9.css +0 -1
- package/.next/static/css/c34f6ea9953e2f63.css +0 -1
- package/.next/static/css/ea11d74a2848b093.css +0 -1
- package/.next/static/css/f16438bcf4508fb3.css +0 -1
- package/.next/static/css/f60366555f563deb.css +0 -1
- package/.next/trace +0 -143
- package/.turbo/turbo-build.log +0 -140
- package/jest.config.js +0 -17
- package/public/~partytown/debug/partytown-atomics.js +0 -556
- package/public/~partytown/debug/partytown-media.js +0 -374
- package/public/~partytown/debug/partytown-sandbox-sw.js +0 -543
- package/public/~partytown/debug/partytown-sw.js +0 -59
- package/public/~partytown/debug/partytown-ww-atomics.js +0 -1789
- package/public/~partytown/debug/partytown-ww-sw.js +0 -1781
- package/public/~partytown/debug/partytown.js +0 -72
- package/public/~partytown/partytown-atomics.js +0 -2
- package/public/~partytown/partytown-media.js +0 -2
- package/public/~partytown/partytown-sw.js +0 -2
- package/public/~partytown/partytown.js +0 -2
- package/src/middleware__DISABLED.ts +0 -65
- package/src/server/generator/generateGraphQLSchemaFile.ts +0 -3
- package/src/server/generator/schema.ts +0 -81
package/src/pages/500.tsx
CHANGED
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
|
|
9
9
|
import { default as GLOBAL_COMPONENTS } from 'src/components/cms/global/Components'
|
|
10
10
|
import RenderSections from 'src/components/cms/RenderSections'
|
|
11
|
-
import { getComponentKey } from 'src/utils/cms'
|
|
12
11
|
import { OverriddenDefaultEmptyState as EmptyState } from 'src/components/sections/EmptyState/OverriddenDefaultEmptyState'
|
|
13
12
|
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
14
13
|
import PLUGINS_COMPONENTS from 'src/plugins'
|
|
@@ -17,6 +16,7 @@ import type { PageContentType } from 'src/server/cms'
|
|
|
17
16
|
import { injectGlobalSections } from 'src/server/cms/global'
|
|
18
17
|
import { contentService } from 'src/server/content/service'
|
|
19
18
|
import type { PreviewData } from 'src/server/content/types'
|
|
19
|
+
import { getComponentKey } from 'src/utils/cms'
|
|
20
20
|
|
|
21
21
|
/* A list of components that can be used in the CMS. */
|
|
22
22
|
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
@@ -68,18 +68,19 @@ export const getStaticProps: GetStaticProps<
|
|
|
68
68
|
Props,
|
|
69
69
|
Record<string, string>,
|
|
70
70
|
PreviewData
|
|
71
|
-
> = async ({ previewData }) => {
|
|
71
|
+
> = async ({ previewData, locale }) => {
|
|
72
|
+
const contentContext = { previewData, locale }
|
|
72
73
|
const [
|
|
73
74
|
globalSectionsPromise,
|
|
74
75
|
globalSectionsHeaderPromise,
|
|
75
76
|
globalSectionsFooterPromise,
|
|
76
|
-
] = getGlobalSectionsData(
|
|
77
|
+
] = getGlobalSectionsData(contentContext)
|
|
77
78
|
|
|
78
79
|
const [page, globalSections, globalSectionsHeader, globalSectionsFooter] =
|
|
79
80
|
await Promise.all([
|
|
80
81
|
contentService.getSingleContent<PageContentType>({
|
|
82
|
+
...contentContext,
|
|
81
83
|
contentType: '500',
|
|
82
|
-
previewData,
|
|
83
84
|
}),
|
|
84
85
|
globalSectionsPromise,
|
|
85
86
|
globalSectionsHeaderPromise,
|
package/src/pages/[...slug].tsx
CHANGED
|
@@ -114,17 +114,18 @@ export const getStaticProps: GetStaticProps<
|
|
|
114
114
|
Props,
|
|
115
115
|
{ slug: string[] },
|
|
116
116
|
PreviewData
|
|
117
|
-
> = async ({ params, previewData }) => {
|
|
117
|
+
> = async ({ params, previewData, locale }) => {
|
|
118
118
|
const slug = params?.slug.join('/') ?? ''
|
|
119
119
|
const rewrites = (await storeConfig.rewrites?.()) ?? []
|
|
120
|
+
const contentContext = { previewData, locale }
|
|
120
121
|
|
|
121
122
|
const [
|
|
122
123
|
globalSectionsPromise,
|
|
123
124
|
globalSectionsHeaderPromise,
|
|
124
125
|
globalSectionsFooterPromise,
|
|
125
|
-
] = getGlobalSectionsData(
|
|
126
|
+
] = getGlobalSectionsData(contentContext)
|
|
126
127
|
|
|
127
|
-
const landingPagePromise = getLandingPageBySlug(slug,
|
|
128
|
+
const landingPagePromise = getLandingPageBySlug(slug, contentContext)
|
|
128
129
|
|
|
129
130
|
const landingPage = await landingPagePromise
|
|
130
131
|
|
|
@@ -174,8 +175,9 @@ export const getStaticProps: GetStaticProps<
|
|
|
174
175
|
}),
|
|
175
176
|
contentService.getPlpContent(
|
|
176
177
|
{
|
|
177
|
-
|
|
178
|
+
...contentContext,
|
|
178
179
|
slug,
|
|
180
|
+
locale,
|
|
179
181
|
},
|
|
180
182
|
rewrites
|
|
181
183
|
),
|
|
@@ -191,6 +193,7 @@ export const getStaticProps: GetStaticProps<
|
|
|
191
193
|
?.sortBySelection as SearchState['sort'],
|
|
192
194
|
term: '',
|
|
193
195
|
selectedFacets: data?.collection?.meta.selectedFacets,
|
|
196
|
+
locale,
|
|
194
197
|
})
|
|
195
198
|
|
|
196
199
|
const notFound = errors.find(isNotFoundError)
|
package/src/pages/[slug]/p.tsx
CHANGED
|
@@ -27,12 +27,14 @@ import { getRedirect } from 'src/sdk/redirects'
|
|
|
27
27
|
import { useSession } from 'src/sdk/session'
|
|
28
28
|
import { execute } from 'src/server'
|
|
29
29
|
import { getComponentKey } from 'src/utils/cms'
|
|
30
|
+
import { getChannelForLocale } from 'src/utils/localization/bindingPaths'
|
|
30
31
|
|
|
31
32
|
import storeConfig from 'discovery.config'
|
|
32
33
|
import {
|
|
33
34
|
getGlobalSectionsData,
|
|
34
35
|
type GlobalSectionsData,
|
|
35
36
|
} from 'src/components/cms/GlobalSections'
|
|
37
|
+
import { getStoreURL } from 'src/sdk/localization/useLocalizationConfig'
|
|
36
38
|
import { getOfferUrl, useOffer } from 'src/sdk/offer'
|
|
37
39
|
import PageProvider, { type PDPContext } from 'src/sdk/overrides/PageProvider'
|
|
38
40
|
import { useProductQuery } from 'src/sdk/product/useProductQuery'
|
|
@@ -101,7 +103,10 @@ function Page({
|
|
|
101
103
|
|
|
102
104
|
// SEO data
|
|
103
105
|
const title = meta?.title ?? storeSeo.title
|
|
104
|
-
const titleTemplate =
|
|
106
|
+
const titleTemplate =
|
|
107
|
+
settings?.seo?.titleTemplate ??
|
|
108
|
+
pdpSeo?.titleTemplate ??
|
|
109
|
+
storeSeo.titleTemplate
|
|
105
110
|
const description =
|
|
106
111
|
meta?.description ||
|
|
107
112
|
pdpSeo.descriptionTemplate.replace(/%s/g, () => title) ||
|
|
@@ -122,7 +127,7 @@ function Page({
|
|
|
122
127
|
if (itemListElements.length !== 0) {
|
|
123
128
|
itemListElements = itemListElements.map(
|
|
124
129
|
({ item: pathname, name, position }) => {
|
|
125
|
-
const pageUrl =
|
|
130
|
+
const pageUrl = getStoreURL() + pathname
|
|
126
131
|
|
|
127
132
|
return { name, position, item: pageUrl }
|
|
128
133
|
}
|
|
@@ -197,7 +202,12 @@ function Page({
|
|
|
197
202
|
]}
|
|
198
203
|
titleTemplate={titleTemplate}
|
|
199
204
|
/>
|
|
200
|
-
|
|
205
|
+
|
|
206
|
+
{/* TODO: when localized slugs are available remove this workaround */}
|
|
207
|
+
{!storeConfig.localization?.enabled && (
|
|
208
|
+
<BreadcrumbJsonLd itemListElements={itemListElements} />
|
|
209
|
+
)}
|
|
210
|
+
|
|
201
211
|
<ProductJsonLd
|
|
202
212
|
id={`${meta.canonical}${settings?.seo?.id ?? ''}`}
|
|
203
213
|
mainEntityOfPage={`${meta.canonical}${
|
|
@@ -305,14 +315,15 @@ export const getStaticProps: GetStaticProps<
|
|
|
305
315
|
Props,
|
|
306
316
|
{ slug: string },
|
|
307
317
|
PreviewData
|
|
308
|
-
> = async ({ params, previewData }) => {
|
|
318
|
+
> = async ({ params, previewData, locale }) => {
|
|
309
319
|
const slug = params?.slug ?? ''
|
|
320
|
+
const contentContext = { previewData, locale }
|
|
310
321
|
|
|
311
322
|
const [
|
|
312
323
|
globalSectionsPromise,
|
|
313
324
|
globalSectionsHeaderPromise,
|
|
314
325
|
globalSectionsFooterPromise,
|
|
315
|
-
] = getGlobalSectionsData(
|
|
326
|
+
] = getGlobalSectionsData(contentContext)
|
|
316
327
|
|
|
317
328
|
const [
|
|
318
329
|
searchResult,
|
|
@@ -321,7 +332,13 @@ export const getStaticProps: GetStaticProps<
|
|
|
321
332
|
globalSectionsFooter,
|
|
322
333
|
] = await Promise.all([
|
|
323
334
|
execute<ServerProductQueryQueryVariables, ServerProductQueryQuery>({
|
|
324
|
-
variables: {
|
|
335
|
+
variables: {
|
|
336
|
+
locator: [
|
|
337
|
+
{ key: 'slug', value: slug },
|
|
338
|
+
{ key: 'channel', value: getChannelForLocale(locale) },
|
|
339
|
+
{ key: 'locale', value: locale },
|
|
340
|
+
],
|
|
341
|
+
},
|
|
325
342
|
operation: query,
|
|
326
343
|
}),
|
|
327
344
|
globalSectionsPromise,
|
|
@@ -357,15 +374,16 @@ export const getStaticProps: GetStaticProps<
|
|
|
357
374
|
const cmsPage: PDPContentType = await contentService.getPdpContent(
|
|
358
375
|
data.product,
|
|
359
376
|
{
|
|
360
|
-
|
|
377
|
+
...contentContext,
|
|
361
378
|
slug,
|
|
379
|
+
locale,
|
|
362
380
|
}
|
|
363
381
|
)
|
|
364
382
|
|
|
365
383
|
const { seo } = data.product
|
|
366
384
|
const title = seo.title
|
|
367
385
|
const description = seo.description
|
|
368
|
-
const canonical = `${
|
|
386
|
+
const canonical = `${getStoreURL()}${seo.canonical}`
|
|
369
387
|
|
|
370
388
|
const meta = { title, description, canonical }
|
|
371
389
|
|
package/src/pages/_app.tsx
CHANGED
|
@@ -15,13 +15,20 @@ import ErrorBoundary from 'src/sdk/error/ErrorBoundary'
|
|
|
15
15
|
import useGeolocation from 'src/sdk/geolocation/useGeolocation'
|
|
16
16
|
import useScrollRestoration from 'src/sdk/ui/useScrollRestoration'
|
|
17
17
|
|
|
18
|
-
import SEO from 'next-seo.config'
|
|
19
18
|
import storeConfig from 'discovery.config'
|
|
19
|
+
import SEO from 'next-seo.config'
|
|
20
20
|
|
|
21
21
|
// FastStore UI's base styles
|
|
22
22
|
import '../styles/main.scss'
|
|
23
23
|
|
|
24
24
|
import { ITEMS_PER_PAGE } from 'src/constants'
|
|
25
|
+
import { useLocalizationConfig } from 'src/sdk/localization/useLocalizationConfig'
|
|
26
|
+
|
|
27
|
+
function LocalizationConfigUpdater() {
|
|
28
|
+
// Update session with localization config
|
|
29
|
+
useLocalizationConfig()
|
|
30
|
+
return null
|
|
31
|
+
}
|
|
25
32
|
|
|
26
33
|
function App({ Component, pageProps }: AppProps) {
|
|
27
34
|
useGeolocation()
|
|
@@ -35,6 +42,7 @@ function App({ Component, pageProps }: AppProps) {
|
|
|
35
42
|
|
|
36
43
|
return (
|
|
37
44
|
<ErrorBoundary>
|
|
45
|
+
{storeConfig.localization?.enabled && <LocalizationConfigUpdater />}
|
|
38
46
|
<Head> {!process.env.DISABLE_3P_SCRIPTS && <ThirdPartyScripts />}</Head>
|
|
39
47
|
<DefaultSeo {...SEO} />
|
|
40
48
|
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
getCookieDomains,
|
|
8
8
|
getVtexCookieNames,
|
|
9
9
|
} from 'src/utils/clearCookies'
|
|
10
|
+
import { getRequestHostname } from 'src/utils/getRequestHostname'
|
|
10
11
|
|
|
11
12
|
const ADDITIONAL_COOKIES = ['CheckoutOrderFormOwnership'] as const
|
|
12
13
|
|
|
@@ -24,9 +25,9 @@ const handler: NextApiHandler = async (
|
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
try {
|
|
27
|
-
const hostname = request.headers.host
|
|
28
|
+
const hostname = getRequestHostname(request.headers.host)
|
|
28
29
|
const cookies = parse(request.headers.cookie ?? '')
|
|
29
|
-
const domains = getCookieDomains(hostname)
|
|
30
|
+
const domains = hostname ? getCookieDomains(hostname) : [undefined]
|
|
30
31
|
const clearedCookies: string[] = []
|
|
31
32
|
|
|
32
33
|
const vtexCookieNames = getVtexCookieNames(Object.keys(cookies))
|
package/src/pages/api/graphql.ts
CHANGED
|
@@ -9,6 +9,7 @@ import type { NextApiHandler, NextApiRequest } from 'next'
|
|
|
9
9
|
|
|
10
10
|
import discoveryConfig from 'discovery.config'
|
|
11
11
|
import { getJWTAutCookie } from 'src/utils/getCookie'
|
|
12
|
+
import { getRequestHostname } from 'src/utils/getRequestHostname'
|
|
12
13
|
import { shouldForceRefreshTokenForValidateSession } from 'src/utils/validateSessionRefreshToken'
|
|
13
14
|
import { execute } from '../../server'
|
|
14
15
|
|
|
@@ -19,26 +20,6 @@ const ALLOWED_HOST_SUFFIXES = ['localhost', '.vtex.app', '.localhost']
|
|
|
19
20
|
// Example: "Set-Cookie: key=value; Domain=example.com; Path=/"
|
|
20
21
|
const MATCH_DOMAIN_REGEXP = /(?:^|;\s*)(?:domain=)([^;]+)/i
|
|
21
22
|
|
|
22
|
-
/**
|
|
23
|
-
* Extracts hostname from the incoming request.
|
|
24
|
-
*/
|
|
25
|
-
const getRequestHostname = ({
|
|
26
|
-
request,
|
|
27
|
-
}: {
|
|
28
|
-
request: NextApiRequest
|
|
29
|
-
}): string | null => {
|
|
30
|
-
const hostHeader = request.headers.host?.trim()
|
|
31
|
-
if (!hostHeader) {
|
|
32
|
-
return null
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
try {
|
|
36
|
-
return new URL(`https://${hostHeader}`).hostname
|
|
37
|
-
} catch {
|
|
38
|
-
return null
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
23
|
/**
|
|
43
24
|
* Checks whether the cookie domain should be replaced by host.
|
|
44
25
|
*/
|
|
@@ -85,7 +66,7 @@ const normalizeSetCookieDomain = ({
|
|
|
85
66
|
return setCookie
|
|
86
67
|
}
|
|
87
68
|
|
|
88
|
-
const host = getRequestHostname(
|
|
69
|
+
const host = getRequestHostname(request.headers.host)
|
|
89
70
|
if (!host) {
|
|
90
71
|
return setCookie
|
|
91
72
|
}
|
|
@@ -209,7 +190,7 @@ const handler: NextApiHandler = async (request, response) => {
|
|
|
209
190
|
|
|
210
191
|
if (hasErrors) {
|
|
211
192
|
const error = errors.find(isFastStoreError)
|
|
212
|
-
console.error(error)
|
|
193
|
+
console.error('Graphql execution returned with error: ', error)
|
|
213
194
|
|
|
214
195
|
response.status(error?.extensions.status ?? 500).end()
|
|
215
196
|
return
|
|
@@ -264,7 +245,10 @@ const handler: NextApiHandler = async (request, response) => {
|
|
|
264
245
|
response.setHeader('content-type', 'application/json')
|
|
265
246
|
response.send(JSON.stringify({ data, errors }))
|
|
266
247
|
} catch (err) {
|
|
267
|
-
console.error(
|
|
248
|
+
console.error(
|
|
249
|
+
'Something unexpected occurred querying Graphql endpoint: \n',
|
|
250
|
+
err
|
|
251
|
+
)
|
|
268
252
|
|
|
269
253
|
if (err instanceof BadRequestError) {
|
|
270
254
|
response.status(400).end()
|
package/src/pages/api/preview.ts
CHANGED
|
@@ -33,17 +33,20 @@ const pickParam = (req: NextApiRequest, parameter: string) => {
|
|
|
33
33
|
const setPreviewAndRedirect = (
|
|
34
34
|
res: NextApiResponse,
|
|
35
35
|
previewData: Record<string, string>,
|
|
36
|
-
redirectPath: string
|
|
36
|
+
redirectPath: string,
|
|
37
|
+
locale?: string
|
|
37
38
|
) => {
|
|
39
|
+
const previewSessionData =
|
|
40
|
+
locale === undefined ? previewData : { ...previewData, locale }
|
|
38
41
|
const options: { maxAge: number; path?: string } = {
|
|
39
42
|
maxAge: 3600,
|
|
40
43
|
}
|
|
41
44
|
|
|
42
|
-
if (!isBranchPreview(
|
|
45
|
+
if (!isBranchPreview(previewSessionData as PreviewData)) {
|
|
43
46
|
options.path = redirectPath.split('?')[0]
|
|
44
47
|
}
|
|
45
48
|
|
|
46
|
-
res.setPreviewData(
|
|
49
|
+
res.setPreviewData(previewSessionData, options)
|
|
47
50
|
res.redirect(redirectPath)
|
|
48
51
|
}
|
|
49
52
|
|
|
@@ -58,6 +61,7 @@ const handler: NextApiHandler = async (req, res) => {
|
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
let slug = pickParam(req, 'slug')
|
|
64
|
+
const locale = pickParam(req, 'locale')
|
|
61
65
|
if (slug && !slug.startsWith('/')) {
|
|
62
66
|
slug = `/${slug}`
|
|
63
67
|
}
|
|
@@ -99,9 +103,13 @@ const handler: NextApiHandler = async (req, res) => {
|
|
|
99
103
|
}
|
|
100
104
|
|
|
101
105
|
// Fetch CMS to check if the provided `locator` exists
|
|
106
|
+
const contentContext = {
|
|
107
|
+
previewData: locator,
|
|
108
|
+
locale,
|
|
109
|
+
}
|
|
102
110
|
const page = await contentService.getSingleContent({
|
|
111
|
+
...contentContext,
|
|
103
112
|
contentType: locator.contentType,
|
|
104
|
-
previewData: locator,
|
|
105
113
|
slug,
|
|
106
114
|
documentId: locator.documentId,
|
|
107
115
|
versionId: locator.versionId,
|
|
@@ -121,21 +129,26 @@ const handler: NextApiHandler = async (req, res) => {
|
|
|
121
129
|
slug &&
|
|
122
130
|
['landingPage', 'plp', 'pdp'].includes(locator.contentType)
|
|
123
131
|
) {
|
|
124
|
-
return setPreviewAndRedirect(res, locator, slug)
|
|
132
|
+
return setPreviewAndRedirect(res, locator, slug, locale)
|
|
125
133
|
}
|
|
126
134
|
|
|
127
135
|
// Redirect to the path from the fetched locator
|
|
128
136
|
const redirects = previewRedirects as Record<string, string>
|
|
129
137
|
if (redirects[locator.contentType]) {
|
|
130
|
-
return setPreviewAndRedirect(
|
|
138
|
+
return setPreviewAndRedirect(
|
|
139
|
+
res,
|
|
140
|
+
locator,
|
|
141
|
+
redirects[locator.contentType],
|
|
142
|
+
locale
|
|
143
|
+
)
|
|
131
144
|
}
|
|
132
145
|
|
|
133
146
|
if (locator.contentType === 'landingPage') {
|
|
134
147
|
slug = (page.settings as Settings)?.seo?.slug
|
|
135
|
-
return setPreviewAndRedirect(res, locator, slug)
|
|
148
|
+
return setPreviewAndRedirect(res, locator, slug, locale)
|
|
136
149
|
}
|
|
137
150
|
|
|
138
|
-
return setPreviewAndRedirect(res, locator, '/')
|
|
151
|
+
return setPreviewAndRedirect(res, locator, '/', locale)
|
|
139
152
|
} catch (error) {
|
|
140
153
|
if (error instanceof StatusError) {
|
|
141
154
|
res.status(error.status).end(error.message)
|
package/src/pages/checkout.tsx
CHANGED
|
@@ -13,6 +13,7 @@ import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
|
13
13
|
|
|
14
14
|
import RenderSections from 'src/components/cms/RenderSections'
|
|
15
15
|
import PageProvider from 'src/sdk/overrides/PageProvider'
|
|
16
|
+
import { useLink } from 'src/sdk/ui/useLink'
|
|
16
17
|
import { injectGlobalSections } from 'src/server/cms/global'
|
|
17
18
|
import storeConfig from '../../discovery.config'
|
|
18
19
|
|
|
@@ -29,17 +30,25 @@ const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
|
29
30
|
function Page({ globalSections: globalSectionsProp }: Props) {
|
|
30
31
|
const { sections: globalSections, settings: globalSettings } =
|
|
31
32
|
globalSectionsProp ?? {}
|
|
33
|
+
const { resolveLink } = useLink()
|
|
32
34
|
|
|
33
35
|
useEffect(() => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
const href = resolveLink(storeConfig.checkoutUrl) ?? storeConfig.checkoutUrl
|
|
37
|
+
window.location.href = href
|
|
38
|
+
}, [resolveLink])
|
|
39
|
+
|
|
40
|
+
const globalSettingLoading = globalSettings?.loading as { label?: string }
|
|
41
|
+
const loadingLabel =
|
|
42
|
+
typeof globalSettingLoading?.label === 'string'
|
|
43
|
+
? globalSettingLoading?.label
|
|
44
|
+
: ''
|
|
36
45
|
|
|
37
46
|
return (
|
|
38
47
|
<PageProvider context={{ globalSettings }}>
|
|
39
48
|
<RenderSections globalSections={globalSections} components={COMPONENTS}>
|
|
40
49
|
<NextSeo noindex nofollow />
|
|
41
50
|
|
|
42
|
-
<div>
|
|
51
|
+
<div>{loadingLabel}</div>
|
|
43
52
|
</RenderSections>
|
|
44
53
|
</PageProvider>
|
|
45
54
|
)
|
|
@@ -49,12 +58,13 @@ export const getStaticProps: GetStaticProps<
|
|
|
49
58
|
Props,
|
|
50
59
|
Record<string, string>,
|
|
51
60
|
Locator
|
|
52
|
-
> = async ({ previewData }) => {
|
|
61
|
+
> = async ({ previewData, locale }) => {
|
|
62
|
+
const contentContext = { previewData, locale }
|
|
53
63
|
const [
|
|
54
64
|
globalSectionsPromise,
|
|
55
65
|
globalSectionsHeaderPromise,
|
|
56
66
|
globalSectionsFooterPromise,
|
|
57
|
-
] = getGlobalSectionsData(
|
|
67
|
+
] = getGlobalSectionsData(contentContext)
|
|
58
68
|
|
|
59
69
|
const [globalSections, globalSectionsHeader, globalSectionsFooter] =
|
|
60
70
|
await Promise.all([
|
package/src/pages/index.tsx
CHANGED
|
@@ -9,10 +9,11 @@ import {
|
|
|
9
9
|
getGlobalSectionsData,
|
|
10
10
|
} from 'src/components/cms/GlobalSections'
|
|
11
11
|
import COMPONENTS from 'src/components/cms/home/Components'
|
|
12
|
+
import { getStoreURL } from 'src/sdk/localization/useLocalizationConfig'
|
|
12
13
|
import PageProvider from 'src/sdk/overrides/PageProvider'
|
|
13
14
|
import { injectGlobalSections } from 'src/server/cms/global'
|
|
14
|
-
import { contentService } from 'src/server/content/service'
|
|
15
15
|
import type { PreviewData } from 'src/server/content/types'
|
|
16
|
+
import { contentService } from 'src/server/content/service'
|
|
16
17
|
import { getDynamicContent } from 'src/utils/dynamicContent'
|
|
17
18
|
import storeConfig from '../../discovery.config'
|
|
18
19
|
|
|
@@ -35,6 +36,10 @@ function Page({
|
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
const publisherId = settings?.seo?.publisherId ?? storeConfig.seo.publisherId
|
|
39
|
+
const titleTemplate =
|
|
40
|
+
settings?.seo?.titleTemplate ??
|
|
41
|
+
storeConfig.seo.titleTemplate ??
|
|
42
|
+
storeConfig.seo.title
|
|
38
43
|
|
|
39
44
|
const organizationAddress = Object.entries(
|
|
40
45
|
settings?.seo?.organization?.address ?? {}
|
|
@@ -48,17 +53,19 @@ function Page({
|
|
|
48
53
|
{} as Record<string, string>
|
|
49
54
|
)
|
|
50
55
|
|
|
56
|
+
const storeUrl = getStoreURL()
|
|
57
|
+
|
|
51
58
|
return (
|
|
52
59
|
<>
|
|
53
60
|
{/* SEO */}
|
|
54
61
|
<NextSeo
|
|
55
62
|
title={settings?.seo?.title ?? storeConfig.seo.title}
|
|
56
63
|
description={settings?.seo?.description ?? storeConfig.seo?.description}
|
|
57
|
-
titleTemplate={
|
|
58
|
-
canonical={settings?.seo?.canonical ??
|
|
64
|
+
titleTemplate={titleTemplate}
|
|
65
|
+
canonical={settings?.seo?.canonical ?? storeUrl}
|
|
59
66
|
openGraph={{
|
|
60
67
|
type: 'website',
|
|
61
|
-
url:
|
|
68
|
+
url: storeUrl,
|
|
62
69
|
title: settings?.seo?.title ?? storeConfig.seo.title,
|
|
63
70
|
description:
|
|
64
71
|
settings?.seo?.description ?? storeConfig.seo.description,
|
|
@@ -67,10 +74,10 @@ function Page({
|
|
|
67
74
|
<SiteLinksSearchBoxJsonLd
|
|
68
75
|
type="WebSite"
|
|
69
76
|
name={settings?.seo?.name ?? storeConfig.seo.name}
|
|
70
|
-
url={
|
|
77
|
+
url={storeUrl}
|
|
71
78
|
potentialActions={[
|
|
72
79
|
{
|
|
73
|
-
target: `${
|
|
80
|
+
target: `${storeUrl}/s/?q`,
|
|
74
81
|
queryInput: 'search_term_string',
|
|
75
82
|
},
|
|
76
83
|
]}
|
|
@@ -150,12 +157,13 @@ export const getStaticProps: GetStaticProps<
|
|
|
150
157
|
Props,
|
|
151
158
|
Record<string, string>,
|
|
152
159
|
PreviewData
|
|
153
|
-
> = async ({ previewData }) => {
|
|
160
|
+
> = async ({ previewData, locale }) => {
|
|
161
|
+
const contentContext = { previewData, locale }
|
|
154
162
|
const [
|
|
155
163
|
globalSectionsPromise,
|
|
156
164
|
globalSectionsHeaderPromise,
|
|
157
165
|
globalSectionsFooterPromise,
|
|
158
|
-
] = getGlobalSectionsData(
|
|
166
|
+
] = getGlobalSectionsData(contentContext)
|
|
159
167
|
const serverDataPromise = getDynamicContent({ pageType: 'home' })
|
|
160
168
|
|
|
161
169
|
let cmsPage = null
|
|
@@ -166,15 +174,16 @@ export const getStaticProps: GetStaticProps<
|
|
|
166
174
|
|
|
167
175
|
const pagePromise = cmsPage
|
|
168
176
|
? contentService.getSingleContent<PageContentType>({
|
|
177
|
+
...contentContext,
|
|
169
178
|
contentType: 'home',
|
|
170
|
-
previewData,
|
|
171
179
|
documentId: cmsPage.documentId,
|
|
172
180
|
versionId: cmsPage.versionId,
|
|
173
181
|
releaseId: cmsPage.releaseId,
|
|
182
|
+
locale,
|
|
174
183
|
})
|
|
175
184
|
: contentService.getSingleContent<PageContentType>({
|
|
185
|
+
...contentContext,
|
|
176
186
|
contentType: 'home',
|
|
177
|
-
previewData,
|
|
178
187
|
})
|
|
179
188
|
|
|
180
189
|
const [
|
package/src/pages/login.tsx
CHANGED
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
getGlobalSectionsData,
|
|
10
10
|
} from 'src/components/cms/GlobalSections'
|
|
11
11
|
import RenderSections from 'src/components/cms/RenderSections'
|
|
12
|
-
import { getComponentKey } from 'src/utils/cms'
|
|
13
12
|
import { OverriddenDefaultEmptyState as EmptyState } from 'src/components/sections/EmptyState/OverriddenDefaultEmptyState'
|
|
14
13
|
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
15
14
|
import PLUGINS_COMPONENTS from 'src/plugins'
|
|
@@ -18,6 +17,7 @@ import type { PageContentType } from 'src/server/cms'
|
|
|
18
17
|
import { injectGlobalSections } from 'src/server/cms/global'
|
|
19
18
|
import { contentService } from 'src/server/content/service'
|
|
20
19
|
import type { PreviewData } from 'src/server/content/types'
|
|
20
|
+
import { getComponentKey } from 'src/utils/cms'
|
|
21
21
|
import storeConfig from '../../discovery.config'
|
|
22
22
|
|
|
23
23
|
/* A list of components that can be used in the CMS. */
|
|
@@ -80,18 +80,19 @@ export const getStaticProps: GetStaticProps<
|
|
|
80
80
|
Props,
|
|
81
81
|
Record<string, string>,
|
|
82
82
|
PreviewData
|
|
83
|
-
> = async ({ previewData }) => {
|
|
83
|
+
> = async ({ previewData, locale }) => {
|
|
84
|
+
const contentContext = { previewData, locale }
|
|
84
85
|
const [
|
|
85
86
|
globalSectionsPromise,
|
|
86
87
|
globalSectionsHeaderPromise,
|
|
87
88
|
globalSectionsFooterPromise,
|
|
88
|
-
] = getGlobalSectionsData(
|
|
89
|
+
] = getGlobalSectionsData(contentContext)
|
|
89
90
|
|
|
90
91
|
const [page, globalSections, globalSectionsHeader, globalSectionsFooter] =
|
|
91
92
|
await Promise.all([
|
|
92
93
|
contentService.getSingleContent<PageContentType>({
|
|
94
|
+
...contentContext,
|
|
93
95
|
contentType: 'login',
|
|
94
|
-
previewData,
|
|
95
96
|
}),
|
|
96
97
|
globalSectionsPromise,
|
|
97
98
|
globalSectionsHeaderPromise,
|
|
@@ -23,6 +23,7 @@ import { useRefreshToken } from 'src/sdk/account/useRefreshToken'
|
|
|
23
23
|
import PageProvider from 'src/sdk/overrides/PageProvider'
|
|
24
24
|
import { execute } from 'src/server'
|
|
25
25
|
import { injectGlobalSections } from 'src/server/cms/global'
|
|
26
|
+
import { withLocaleValidationSSR } from 'src/utils/localization/withLocaleValidation'
|
|
26
27
|
import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
|
|
27
28
|
|
|
28
29
|
import storeConfig from 'discovery.config'
|
|
@@ -90,16 +91,20 @@ const query = gql(`
|
|
|
90
91
|
}
|
|
91
92
|
`)
|
|
92
93
|
|
|
93
|
-
|
|
94
|
+
const getServerSidePropsBase: GetServerSideProps<
|
|
94
95
|
Props,
|
|
95
96
|
Record<string, string>,
|
|
96
97
|
Locator
|
|
97
98
|
> = async (context) => {
|
|
99
|
+
const contentContext = {
|
|
100
|
+
previewData: context.previewData,
|
|
101
|
+
locale: context.locale,
|
|
102
|
+
}
|
|
98
103
|
const [
|
|
99
104
|
globalSectionsPromise,
|
|
100
105
|
globalSectionsHeaderPromise,
|
|
101
106
|
globalSectionsFooterPromise,
|
|
102
|
-
] = getGlobalSectionsData(
|
|
107
|
+
] = getGlobalSectionsData(contentContext)
|
|
103
108
|
|
|
104
109
|
const [account, globalSections, globalSectionsHeader, globalSectionsFooter] =
|
|
105
110
|
await Promise.all([
|
|
@@ -160,4 +165,8 @@ export const getServerSideProps: GetServerSideProps<
|
|
|
160
165
|
}
|
|
161
166
|
}
|
|
162
167
|
|
|
168
|
+
export const getServerSideProps = withLocaleValidationSSR(
|
|
169
|
+
getServerSidePropsBase
|
|
170
|
+
)
|
|
171
|
+
|
|
163
172
|
export default Page
|
|
@@ -24,6 +24,7 @@ import PageProvider from 'src/sdk/overrides/PageProvider'
|
|
|
24
24
|
import { execute } from 'src/server'
|
|
25
25
|
import { type PageContentType, getPage } from 'src/server/cms'
|
|
26
26
|
import { injectGlobalSections } from 'src/server/cms/global'
|
|
27
|
+
import { withLocaleValidationSSR } from 'src/utils/localization/withLocaleValidation'
|
|
27
28
|
import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
|
|
28
29
|
|
|
29
30
|
/* A list of components that can be used in the CMS. */
|
|
@@ -71,11 +72,15 @@ const query = gql(`
|
|
|
71
72
|
}
|
|
72
73
|
`)
|
|
73
74
|
|
|
74
|
-
|
|
75
|
+
const getServerSidePropsBase: GetServerSideProps<
|
|
75
76
|
Props,
|
|
76
77
|
Record<string, string>,
|
|
77
78
|
Locator
|
|
78
79
|
> = async (context) => {
|
|
80
|
+
const contentContext = {
|
|
81
|
+
previewData: context.previewData,
|
|
82
|
+
locale: context.locale,
|
|
83
|
+
}
|
|
79
84
|
const { isFaststoreMyAccountEnabled, redirect } = getMyAccountRedirect({
|
|
80
85
|
query: context.query,
|
|
81
86
|
})
|
|
@@ -88,7 +93,7 @@ export const getServerSideProps: GetServerSideProps<
|
|
|
88
93
|
globalSectionsPromise,
|
|
89
94
|
globalSectionsHeaderPromise,
|
|
90
95
|
globalSectionsFooterPromise,
|
|
91
|
-
] = getGlobalSectionsData(
|
|
96
|
+
] = getGlobalSectionsData(contentContext)
|
|
92
97
|
|
|
93
98
|
const [
|
|
94
99
|
page,
|
|
@@ -98,7 +103,8 @@ export const getServerSideProps: GetServerSideProps<
|
|
|
98
103
|
globalSectionsFooter,
|
|
99
104
|
] = await Promise.all([
|
|
100
105
|
getPage<PageContentType>({
|
|
101
|
-
...(
|
|
106
|
+
...(contentContext.previewData?.contentType === '404' &&
|
|
107
|
+
contentContext.previewData),
|
|
102
108
|
contentType: '404',
|
|
103
109
|
}),
|
|
104
110
|
execute<ServerAccountPageQueryQueryVariables, ServerAccountPageQueryQuery>(
|
|
@@ -144,4 +150,8 @@ export const getServerSideProps: GetServerSideProps<
|
|
|
144
150
|
}
|
|
145
151
|
}
|
|
146
152
|
|
|
153
|
+
export const getServerSideProps = withLocaleValidationSSR(
|
|
154
|
+
getServerSidePropsBase
|
|
155
|
+
)
|
|
156
|
+
|
|
147
157
|
export default Page
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import type { GetServerSideProps, NextPage } from 'next'
|
|
2
2
|
import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
|
|
3
|
+
import { withLocaleValidationSSR } from 'src/utils/localization/withLocaleValidation'
|
|
3
4
|
|
|
4
5
|
const MyAccountRedirectPage: NextPage = () => {
|
|
5
6
|
return null
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
query,
|
|
10
|
-
req,
|
|
11
|
-
}) => {
|
|
9
|
+
const getServerSidePropsBase: GetServerSideProps = async ({ query, req }) => {
|
|
12
10
|
const { isFaststoreMyAccountEnabled, redirect } = getMyAccountRedirect({
|
|
13
11
|
query,
|
|
14
12
|
})
|
|
@@ -25,4 +23,8 @@ export const getServerSideProps: GetServerSideProps = async ({
|
|
|
25
23
|
}
|
|
26
24
|
}
|
|
27
25
|
|
|
26
|
+
export const getServerSideProps = withLocaleValidationSSR(
|
|
27
|
+
getServerSidePropsBase
|
|
28
|
+
)
|
|
29
|
+
|
|
28
30
|
export default MyAccountRedirectPage
|