@faststore/core 3.11.2 → 3.11.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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +36 -36
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-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/next-minimal-server.js.nft.json +1 -1
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.js +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/react-loadable-manifest.json +13 -13
- package/.next/required-server-files.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/1163.js +2 -2
- package/.next/server/chunks/3157.js +1 -1
- package/.next/server/chunks/{1377.js → 3668.js} +1 -1
- package/.next/server/chunks/4012.js +1 -1
- package/.next/server/chunks/5754.js +2 -2
- package/.next/server/chunks/6859.js +1 -1
- package/.next/server/chunks/8640.js +1 -1
- package/.next/server/chunks/8857.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/404.js +1 -1
- package/.next/server/pages/404.js.nft.json +1 -1
- package/.next/server/pages/500.js +1 -1
- package/.next/server/pages/500.js.nft.json +1 -1
- package/.next/server/pages/[...slug].js +1 -1
- package/.next/server/pages/[...slug].js.nft.json +1 -1
- package/.next/server/pages/[slug]/p.js +1 -1
- package/.next/server/pages/[slug]/p.js.nft.json +1 -1
- package/.next/server/pages/_app.js +1 -1
- package/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/server/pages/_document.js +1 -1
- package/.next/server/pages/_document.js.nft.json +1 -1
- package/.next/server/pages/_error.js +1 -1
- package/.next/server/pages/_error.js.nft.json +1 -1
- package/.next/server/pages/account.js +1 -1
- package/.next/server/pages/account.js.nft.json +1 -1
- package/.next/server/pages/api/graphql.js +1 -1
- package/.next/server/pages/api/graphql.js.nft.json +1 -1
- package/.next/server/pages/api/health/live.js.nft.json +1 -1
- package/.next/server/pages/api/health/ready.js.nft.json +1 -1
- package/.next/server/pages/api/preview.js.nft.json +1 -1
- package/.next/server/pages/checkout.js +1 -1
- package/.next/server/pages/checkout.js.nft.json +1 -1
- package/.next/server/pages/en-US/404.html +1 -1
- package/.next/server/pages/en-US/500.html +1 -1
- package/.next/server/pages/en-US/account.html +1 -1
- package/.next/server/pages/en-US/checkout.html +1 -1
- package/.next/server/pages/en-US/login.html +1 -1
- package/.next/server/pages/en-US/s.html +1 -1
- package/.next/server/pages/en-US.html +1 -1
- package/.next/server/pages/index.js +1 -1
- package/.next/server/pages/index.js.nft.json +1 -1
- package/.next/server/pages/login.js +1 -1
- package/.next/server/pages/login.js.nft.json +1 -1
- package/.next/server/pages/s.js +1 -1
- package/.next/server/pages/s.js.nft.json +1 -1
- package/.next/server/pages-manifest.json +1 -1
- package/.next/static/{bYvT7j3s1L8_ALPlSxNjt → FO1Q-M-kedNdmpX1S3tkc}/_buildManifest.js +1 -1
- package/.next/static/chunks/{1153.d7522522b6c917ed.js → 1153.7f616071da309cf5.js} +1 -1
- package/.next/static/chunks/1978.8bdcdd4ec5c7ac88.js +1 -0
- package/.next/static/chunks/{5156.fe20405ee7a0d2d5.js → 5156.d1a2bac5ee6f64ac.js} +1 -1
- package/.next/static/chunks/{5217.350e250227ef3657.js → 5217.2c285832cd2bb950.js} +1 -1
- package/.next/static/chunks/{6941-6223429b182b7109.js → 6941-691e0f68baf2036e.js} +2 -2
- package/.next/static/chunks/7498-745c09c46899ea49.js +1 -0
- package/.next/static/chunks/{8857.0ff8f6604fb061a8.js → 8857.141d2a4640c89f4a.js} +1 -1
- package/.next/static/chunks/{main-209ac4974b020af1.js → main-48d1188fa94dad34.js} +1 -1
- package/.next/static/chunks/pages/{_app-91d65e1abd88251d.js → _app-e0cf85dd2f4d858c.js} +1 -1
- package/.next/static/chunks/pages/{_error-85cabf0d7a5ea2f2.js → _error-6a4b9b22c63bd9d7.js} +1 -1
- package/.next/static/chunks/{webpack-a63f842ae0d7bdfd.js → webpack-ed53dd91aa26df33.js} +1 -1
- package/.next/trace +102 -102
- package/.turbo/turbo-build.log +8 -7
- package/.turbo/turbo-test.log +5 -5
- package/CHANGELOG.md +8 -0
- package/README.md +0 -3
- package/codegen.ts +1 -1
- package/cypress/integration/a11y.test.js +0 -1
- package/cypress/integration/analytics.test.js +0 -1
- package/cypress/integration/cart.test.js +0 -1
- package/cypress/integration/plp.test.js +0 -1
- package/cypress/integration/search.test.js +0 -1
- package/cypress/integration/seo.test.js +0 -1
- package/cypress/plugins/index.js +0 -3
- package/cypress/support/commands.js +0 -1
- package/discovery.config.default.js +1 -1
- package/next-seo.config.ts +1 -1
- package/next.config.js +3 -0
- package/package.json +9 -11
- package/src/components/auth/ProfileChallenge/ProfileChallenge.tsx +1 -1
- package/src/components/cart/CartSidebar/CartSidebar.tsx +1 -1
- package/src/components/cart/OrderSummary/OrderSummary.tsx +1 -1
- package/src/components/cms/GlobalSections.tsx +2 -2
- package/src/components/cms/RenderSections.tsx +4 -4
- package/src/components/cms/SectionBoundary.tsx +1 -1
- package/src/components/cms/global/Components.ts +1 -1
- package/src/components/cms/home/Components.ts +1 -1
- package/src/components/cms/plp/Components.ts +1 -1
- package/src/components/cms/search/Components.ts +1 -1
- package/src/components/common/Alert/Alert.tsx +1 -1
- package/src/components/common/Footer/Footer.tsx +1 -1
- package/src/components/product/NotAvailableButton/NotAvailableButton.tsx +1 -1
- package/src/components/product/ProductCard/ProductCard.tsx +1 -1
- package/src/components/product/ProductGrid/ProductGrid.tsx +1 -1
- package/src/components/region/RegionModal/RegionModal.tsx +1 -1
- package/src/components/search/Filter/FilterDesktop.tsx +1 -1
- package/src/components/search/SearchDropdown/SearchDropdown.tsx +2 -2
- package/src/components/search/SearchInput/SearchInput.tsx +1 -1
- package/src/components/search/SearchTop/SearchTop.tsx +1 -1
- package/src/components/sections/BannerText/BannerText.tsx +1 -1
- package/src/components/sections/Breadcrumb/Breadcrumb.tsx +4 -4
- package/src/components/sections/Hero/Hero.tsx +2 -2
- package/src/components/sections/Newsletter/Newsletter.tsx +1 -1
- package/src/components/sections/ProductGallery/ProductGallery.tsx +5 -5
- package/src/components/sections/ProductShelf/ProductShelf.tsx +1 -1
- package/src/components/sections/RegionBar/RegionBar.tsx +3 -1
- package/src/components/templates/ProductListingPage/ProductListing.tsx +2 -2
- package/src/components/templates/SearchPage/SearchPage.tsx +5 -3
- package/src/components/ui/Image/Image.tsx +1 -1
- package/src/components/ui/Image/loader.ts +1 -1
- package/src/components/ui/Link/Link.tsx +1 -1
- package/src/components/ui/ProductGallery/ProductGallery.tsx +5 -5
- package/src/components/ui/ProductGallery/ProductGalleryPage.tsx +1 -1
- package/src/components/ui/ShippingSimulation/ShippingSimulation.tsx +1 -1
- package/src/components/ui/SkuSelector/Selectors.tsx +2 -2
- package/src/customizations/src/components/index.tsx +0 -1
- package/src/customizations/src/components/overrides/Alert.tsx +1 -1
- package/src/customizations/src/components/overrides/BannerText.tsx +1 -1
- package/src/customizations/src/components/overrides/Breadcrumb.tsx +1 -1
- package/src/customizations/src/components/overrides/CrossSellingShelf.tsx +1 -1
- package/src/customizations/src/components/overrides/EmptyState.tsx +1 -1
- package/src/customizations/src/components/overrides/Hero.tsx +1 -1
- package/src/customizations/src/components/overrides/Navbar.tsx +1 -1
- package/src/customizations/src/components/overrides/Newsletter.tsx +1 -1
- package/src/customizations/src/components/overrides/ProductDetails.tsx +1 -1
- package/src/customizations/src/components/overrides/ProductGallery.tsx +1 -1
- package/src/customizations/src/components/overrides/ProductShelf.tsx +1 -1
- package/src/customizations/src/components/overrides/RegionBar.tsx +1 -1
- package/src/experimental/searchServerSideFunctions/getServerSideProps.ts +4 -4
- package/src/experimental/searchServerSideFunctions/getStaticProps.ts +4 -4
- package/src/fonts/WebFonts.tsx +0 -2
- package/src/pages/404.tsx +4 -4
- package/src/pages/500.tsx +4 -4
- package/src/pages/[...slug].tsx +6 -6
- package/src/pages/[slug]/p.tsx +6 -6
- package/src/pages/account.tsx +3 -3
- package/src/pages/api/preview.ts +12 -6
- package/src/pages/checkout.tsx +3 -3
- package/src/pages/index.tsx +1 -1
- package/src/pages/login.tsx +4 -4
- package/src/pages/s.tsx +1 -1
- package/src/plugins/index.ts +0 -1
- package/src/sdk/analytics/platform/vtex/rc.ts +3 -3
- package/src/sdk/analytics/types.ts +2 -2
- package/src/sdk/error/ErrorBoundary/ErrorBoundary.tsx +1 -1
- package/src/sdk/error/MissingContentError/MissingContentError.ts +1 -1
- package/src/sdk/error/MultipleContentError/MultipleContentError.ts +1 -1
- package/src/sdk/graphql/request.ts +2 -2
- package/src/sdk/overrides/OverrideContext.tsx +3 -3
- package/src/sdk/overrides/PageProvider.tsx +3 -4
- package/src/sdk/overrides/getOverriddenSection.tsx +2 -2
- package/src/sdk/overrides/overrides.ts +1 -1
- package/src/sdk/product/useAllVariantProducts.ts +1 -1
- package/src/sdk/product/useLocalizedVariables.ts +1 -1
- package/src/sdk/product/usePageProductsQuery.ts +1 -1
- package/src/sdk/product/useProductGalleryQuery.ts +1 -1
- package/src/sdk/product/useProductsPrefetch.ts +1 -1
- package/src/sdk/search/useFilter.ts +10 -7
- package/src/sdk/shipping/useShippingSimulation.ts +2 -2
- package/src/server/cms/index.ts +1 -1
- package/src/server/cms/pdp.ts +2 -2
- package/src/server/cms/plp.ts +4 -4
- package/src/server/index.ts +4 -5
- package/src/typings/global.d.ts +6 -6
- package/src/typings/overrides.ts +25 -25
- package/src/typings/overridesDefinition.ts +4 -4
- package/src/utils/multipleTemplates.ts +3 -3
- package/test/server/cms/index.test.ts +1 -1
- package/.next/cache/eslint/.cache_1gneedd +0 -1
- package/.next/static/chunks/1978.b33d8b2c02b89474.js +0 -1
- package/.next/static/chunks/7498-304bc236a51fc94c.js +0 -1
- /package/.next/static/{bYvT7j3s1L8_ALPlSxNjt → FO1Q-M-kedNdmpX1S3tkc}/_ssgManifest.js +0 -0
|
@@ -2,7 +2,7 @@ import ProductGrid from 'src/components/product/ProductGrid'
|
|
|
2
2
|
import Sentinel from 'src/sdk/search/Sentinel'
|
|
3
3
|
|
|
4
4
|
import { memo } from 'react'
|
|
5
|
-
import { ProductCardProps } from 'src/components/product/ProductCard'
|
|
5
|
+
import type { ProductCardProps } from 'src/components/product/ProductCard'
|
|
6
6
|
import { useGalleryPage } from 'src/sdk/product/usePageProductsQuery'
|
|
7
7
|
|
|
8
8
|
interface Props {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { GetServerSideProps } from 'next'
|
|
2
|
-
import { SearchPageProps } from './getStaticProps'
|
|
1
|
+
import type { GetServerSideProps } from 'next'
|
|
2
|
+
import type { SearchPageProps } from './getStaticProps'
|
|
3
3
|
|
|
4
4
|
import { getGlobalSectionsData } from 'src/components/cms/GlobalSections'
|
|
5
|
-
import { SearchContentType, getPage } from 'src/server/cms'
|
|
6
|
-
import { Locator } from '@vtex/client-cms'
|
|
5
|
+
import { type SearchContentType, getPage } from 'src/server/cms'
|
|
6
|
+
import type { Locator } from '@vtex/client-cms'
|
|
7
7
|
import storeConfig from 'discovery.config'
|
|
8
8
|
|
|
9
9
|
export const getServerSideProps: GetServerSideProps<
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { GetStaticProps } from 'next'
|
|
1
|
+
import type { GetStaticProps } from 'next'
|
|
2
2
|
import {
|
|
3
3
|
getGlobalSectionsData,
|
|
4
|
-
GlobalSectionsData,
|
|
4
|
+
type GlobalSectionsData,
|
|
5
5
|
} from 'src/components/cms/GlobalSections'
|
|
6
|
-
import { SearchContentType, getPage } from 'src/server/cms'
|
|
7
|
-
import { Locator } from '@vtex/client-cms'
|
|
6
|
+
import { type SearchContentType, getPage } from 'src/server/cms'
|
|
7
|
+
import type { Locator } from '@vtex/client-cms'
|
|
8
8
|
import storeConfig from 'discovery.config'
|
|
9
9
|
|
|
10
10
|
export type SearchPageProps = {
|
package/src/fonts/WebFonts.tsx
CHANGED
package/src/pages/404.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Locator } from '@vtex/client-cms'
|
|
2
|
-
import { GetStaticProps } from 'next'
|
|
1
|
+
import type { Locator } from '@vtex/client-cms'
|
|
2
|
+
import type { GetStaticProps } from 'next'
|
|
3
3
|
import { NextSeo } from 'next-seo'
|
|
4
4
|
import type { ComponentType } from 'react'
|
|
5
5
|
import {
|
|
6
|
-
GlobalSectionsData,
|
|
6
|
+
type GlobalSectionsData,
|
|
7
7
|
getGlobalSectionsData,
|
|
8
8
|
} from 'src/components/cms/GlobalSections'
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ import RenderSections from 'src/components/cms/RenderSections'
|
|
|
12
12
|
import { OverriddenDefaultEmptyState as EmptyState } from 'src/components/sections/EmptyState/OverriddenDefaultEmptyState'
|
|
13
13
|
import PLUGINS_COMPONENTS from 'src/plugins'
|
|
14
14
|
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
15
|
-
import { PageContentType, getPage } from 'src/server/cms'
|
|
15
|
+
import { type PageContentType, getPage } from 'src/server/cms'
|
|
16
16
|
|
|
17
17
|
/* A list of components that can be used in the CMS. */
|
|
18
18
|
const COMPONENTS: Record<string, ComponentType<any>> = {
|
package/src/pages/500.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Locator } from '@vtex/client-cms'
|
|
2
|
-
import { GetStaticProps } from 'next'
|
|
1
|
+
import type { Locator } from '@vtex/client-cms'
|
|
2
|
+
import type { GetStaticProps } from 'next'
|
|
3
3
|
import { NextSeo } from 'next-seo'
|
|
4
4
|
import type { ComponentType } from 'react'
|
|
5
5
|
import {
|
|
6
|
-
GlobalSectionsData,
|
|
6
|
+
type GlobalSectionsData,
|
|
7
7
|
getGlobalSectionsData,
|
|
8
8
|
} from 'src/components/cms/GlobalSections'
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ import RenderSections from 'src/components/cms/RenderSections'
|
|
|
12
12
|
import { OverriddenDefaultEmptyState as EmptyState } from 'src/components/sections/EmptyState/OverriddenDefaultEmptyState'
|
|
13
13
|
import PLUGINS_COMPONENTS from 'src/plugins'
|
|
14
14
|
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
15
|
-
import { PageContentType, getPage } from 'src/server/cms'
|
|
15
|
+
import { type PageContentType, getPage } from 'src/server/cms'
|
|
16
16
|
|
|
17
17
|
/* A list of components that can be used in the CMS. */
|
|
18
18
|
const COMPONENTS: Record<string, ComponentType<any>> = {
|
package/src/pages/[...slug].tsx
CHANGED
|
@@ -9,22 +9,22 @@ import type {
|
|
|
9
9
|
} from '@generated/graphql'
|
|
10
10
|
import { execute } from 'src/server'
|
|
11
11
|
|
|
12
|
-
import { Locator } from '@vtex/client-cms'
|
|
12
|
+
import type { Locator } from '@vtex/client-cms'
|
|
13
13
|
import dynamic from 'next/dynamic'
|
|
14
14
|
import {
|
|
15
15
|
getGlobalSectionsData,
|
|
16
|
-
GlobalSectionsData,
|
|
16
|
+
type GlobalSectionsData,
|
|
17
17
|
} from 'src/components/cms/GlobalSections'
|
|
18
18
|
import {
|
|
19
19
|
getLandingPageBySlug,
|
|
20
|
-
LandingPageProps,
|
|
20
|
+
type LandingPageProps,
|
|
21
21
|
} from 'src/components/templates/LandingPage'
|
|
22
22
|
import ProductListingPage, {
|
|
23
|
-
ProductListingPageProps,
|
|
23
|
+
type ProductListingPageProps,
|
|
24
24
|
} from 'src/components/templates/ProductListingPage'
|
|
25
25
|
import { getRedirect } from 'src/sdk/redirects'
|
|
26
|
-
import { PageContentType } from 'src/server/cms'
|
|
27
|
-
import { getPLP, PLPContentType } from 'src/server/cms/plp'
|
|
26
|
+
import type { PageContentType } from 'src/server/cms'
|
|
27
|
+
import { getPLP, type PLPContentType } from 'src/server/cms/plp'
|
|
28
28
|
import { getDynamicContent } from 'src/utils/dynamicContent'
|
|
29
29
|
|
|
30
30
|
const LandingPage = dynamic(
|
package/src/pages/[slug]/p.tsx
CHANGED
|
@@ -6,9 +6,9 @@ import { BreadcrumbJsonLd, NextSeo, ProductJsonLd } from 'next-seo'
|
|
|
6
6
|
import type { ComponentType } from 'react'
|
|
7
7
|
|
|
8
8
|
import { gql } from '@generated'
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
import type {
|
|
10
|
+
ServerProductQueryQuery,
|
|
11
|
+
ServerProductQueryQueryVariables,
|
|
12
12
|
} from '@generated/graphql'
|
|
13
13
|
import { default as GLOBAL_COMPONENTS } from 'src/components/cms/global/Components'
|
|
14
14
|
import RenderSections from 'src/components/cms/RenderSections'
|
|
@@ -28,12 +28,12 @@ import { execute } from 'src/server'
|
|
|
28
28
|
|
|
29
29
|
import storeConfig from 'discovery.config'
|
|
30
30
|
import {
|
|
31
|
-
GlobalSectionsData,
|
|
31
|
+
type GlobalSectionsData,
|
|
32
32
|
getGlobalSectionsData,
|
|
33
33
|
} from 'src/components/cms/GlobalSections'
|
|
34
|
-
import PageProvider, { PDPContext } from 'src/sdk/overrides/PageProvider'
|
|
34
|
+
import PageProvider, { type PDPContext } from 'src/sdk/overrides/PageProvider'
|
|
35
35
|
import { useProductQuery } from 'src/sdk/product/useProductQuery'
|
|
36
|
-
import { PDPContentType, getPDP } from 'src/server/cms/pdp'
|
|
36
|
+
import { type PDPContentType, getPDP } from 'src/server/cms/pdp'
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* Sections: Components imported from each store's custom components and '../components/sections' only.
|
package/src/pages/account.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Locator } from '@vtex/client-cms'
|
|
2
|
-
import { GetStaticProps } from 'next'
|
|
1
|
+
import type { Locator } from '@vtex/client-cms'
|
|
2
|
+
import type { GetStaticProps } from 'next'
|
|
3
3
|
import { NextSeo } from 'next-seo'
|
|
4
4
|
import type { ComponentType } from 'react'
|
|
5
5
|
import { useEffect } from 'react'
|
|
6
6
|
import {
|
|
7
|
-
GlobalSectionsData,
|
|
7
|
+
type GlobalSectionsData,
|
|
8
8
|
getGlobalSectionsData,
|
|
9
9
|
} from 'src/components/cms/GlobalSections'
|
|
10
10
|
import RenderSections from 'src/components/cms/RenderSections'
|
package/src/pages/api/preview.ts
CHANGED
|
@@ -12,7 +12,10 @@ type Settings = {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
class StatusError extends Error {
|
|
15
|
-
constructor(
|
|
15
|
+
constructor(
|
|
16
|
+
message: string,
|
|
17
|
+
public status: number
|
|
18
|
+
) {
|
|
16
19
|
super(message)
|
|
17
20
|
}
|
|
18
21
|
}
|
|
@@ -35,13 +38,16 @@ const handler: NextApiHandler = async (req, res) => {
|
|
|
35
38
|
'documentId',
|
|
36
39
|
'versionId',
|
|
37
40
|
'releaseId',
|
|
38
|
-
].reduce(
|
|
39
|
-
|
|
41
|
+
].reduce(
|
|
42
|
+
(acc, param) => {
|
|
43
|
+
const value = pickParam(req, param)
|
|
40
44
|
|
|
41
|
-
|
|
45
|
+
if (value !== undefined) acc[param] = value
|
|
42
46
|
|
|
43
|
-
|
|
44
|
-
|
|
47
|
+
return acc
|
|
48
|
+
},
|
|
49
|
+
{} as Record<string, string>
|
|
50
|
+
)
|
|
45
51
|
|
|
46
52
|
// Check if required path params are present
|
|
47
53
|
if (!locator.contentType || !locator.documentId) {
|
package/src/pages/checkout.tsx
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { NextSeo } from 'next-seo'
|
|
2
2
|
import { useEffect } from 'react'
|
|
3
3
|
|
|
4
|
-
import { Locator } from '@vtex/client-cms'
|
|
5
|
-
import { GetStaticProps } from 'next'
|
|
4
|
+
import type { Locator } from '@vtex/client-cms'
|
|
5
|
+
import type { GetStaticProps } from 'next'
|
|
6
6
|
import type { ComponentType } from 'react'
|
|
7
7
|
import { default as GLOBAL_COMPONENTS } from 'src/components/cms/global/Components'
|
|
8
8
|
import {
|
|
9
|
-
GlobalSectionsData,
|
|
9
|
+
type GlobalSectionsData,
|
|
10
10
|
getGlobalSectionsData,
|
|
11
11
|
} from 'src/components/cms/GlobalSections'
|
|
12
12
|
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
package/src/pages/index.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import type { PageContentType } from 'src/server/cms'
|
|
|
7
7
|
import { getPage } from 'src/server/cms'
|
|
8
8
|
|
|
9
9
|
import {
|
|
10
|
-
GlobalSectionsData,
|
|
10
|
+
type GlobalSectionsData,
|
|
11
11
|
getGlobalSectionsData,
|
|
12
12
|
} from 'src/components/cms/GlobalSections'
|
|
13
13
|
import COMPONENTS from 'src/components/cms/home/Components'
|
package/src/pages/login.tsx
CHANGED
|
@@ -2,18 +2,18 @@ import { NextSeo } from 'next-seo'
|
|
|
2
2
|
import type { ComponentType } from 'react'
|
|
3
3
|
import { useEffect } from 'react'
|
|
4
4
|
|
|
5
|
-
import { Locator } from '@vtex/client-cms'
|
|
6
|
-
import { GetStaticProps } from 'next'
|
|
5
|
+
import type { Locator } from '@vtex/client-cms'
|
|
6
|
+
import type { GetStaticProps } from 'next'
|
|
7
7
|
import { default as GLOBAL_COMPONENTS } from 'src/components/cms/global/Components'
|
|
8
8
|
import {
|
|
9
|
-
GlobalSectionsData,
|
|
9
|
+
type GlobalSectionsData,
|
|
10
10
|
getGlobalSectionsData,
|
|
11
11
|
} from 'src/components/cms/GlobalSections'
|
|
12
12
|
import RenderSections from 'src/components/cms/RenderSections'
|
|
13
13
|
import { OverriddenDefaultEmptyState as EmptyState } from 'src/components/sections/EmptyState/OverriddenDefaultEmptyState'
|
|
14
14
|
import PLUGINS_COMPONENTS from 'src/plugins'
|
|
15
15
|
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
16
|
-
import { PageContentType, getPage } from 'src/server/cms'
|
|
16
|
+
import { type PageContentType, getPage } from 'src/server/cms'
|
|
17
17
|
import storeConfig from '../../discovery.config'
|
|
18
18
|
|
|
19
19
|
/* A list of components that can be used in the CMS. */
|
package/src/pages/s.tsx
CHANGED
|
@@ -18,7 +18,7 @@ import storeConfig from 'discovery.config'
|
|
|
18
18
|
import { SearchWrapper } from 'src/components/templates/SearchPage'
|
|
19
19
|
import {
|
|
20
20
|
getStaticProps,
|
|
21
|
-
SearchPageProps,
|
|
21
|
+
type SearchPageProps,
|
|
22
22
|
} from 'src/experimental/searchServerSideFunctions'
|
|
23
23
|
|
|
24
24
|
export interface SearchPageContextType {
|
package/src/plugins/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AnalyticsEvent, PageViewEvent } from '@faststore/sdk'
|
|
2
|
-
import { ServerProductQueryQuery } from '@generated/graphql'
|
|
3
|
-
import {
|
|
1
|
+
import type { AnalyticsEvent, PageViewEvent } from '@faststore/sdk'
|
|
2
|
+
import type { ServerProductQueryQuery } from '@generated/graphql'
|
|
3
|
+
import type {
|
|
4
4
|
CategoryView,
|
|
5
5
|
DepartmentView,
|
|
6
6
|
HomeView,
|
|
@@ -72,7 +72,7 @@ export type SearchEvents =
|
|
|
72
72
|
* Types copied from Request Capture App: https://github.com/vtex/request-capture-app/blob/1becac32c002cb03a57bf36c8a7f9400eab8b933/react/typings/rcevents.d.ts
|
|
73
73
|
*/
|
|
74
74
|
|
|
75
|
-
export
|
|
75
|
+
export type HomeView = {}
|
|
76
76
|
|
|
77
77
|
export interface CategoryView {
|
|
78
78
|
departmentId?: string
|
|
@@ -114,4 +114,4 @@ export interface ProductView {
|
|
|
114
114
|
sellerIds: string // e.g.: "00443713,04412311,1"
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
export
|
|
117
|
+
export type OtherView = {}
|
|
@@ -51,8 +51,8 @@ const baseRequest = async <V = any, D = any>(
|
|
|
51
51
|
fetchOptions?.method !== undefined
|
|
52
52
|
? fetchOptions.method.toUpperCase()
|
|
53
53
|
: operationName.endsWith('Query')
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
? 'GET'
|
|
55
|
+
: 'POST'
|
|
56
56
|
|
|
57
57
|
const params = new URLSearchParams({
|
|
58
58
|
operationName,
|
|
@@ -4,7 +4,7 @@ import type { OverriddenComponents } from '../../typings/overridesDefinition'
|
|
|
4
4
|
import type { SectionsOverrides } from '../../typings/overrides'
|
|
5
5
|
|
|
6
6
|
type OverrideContextType<
|
|
7
|
-
SectionName extends keyof SectionsOverrides = keyof SectionsOverrides
|
|
7
|
+
SectionName extends keyof SectionsOverrides = keyof SectionsOverrides,
|
|
8
8
|
> = {
|
|
9
9
|
className?: string
|
|
10
10
|
components: OverriddenComponents<SectionName>
|
|
@@ -15,11 +15,11 @@ const OverrideContext = createContext<OverrideContextType>(null)
|
|
|
15
15
|
export const OverrideProvider = OverrideContext.Provider
|
|
16
16
|
|
|
17
17
|
export const useOverrideContext = <
|
|
18
|
-
SectionName extends keyof SectionsOverrides = keyof SectionsOverrides
|
|
18
|
+
SectionName extends keyof SectionsOverrides = keyof SectionsOverrides,
|
|
19
19
|
>() => useContext(OverrideContext) as OverrideContextType<SectionName>
|
|
20
20
|
|
|
21
21
|
export const useOverrideComponents = <
|
|
22
|
-
SectionName extends keyof SectionsOverrides = keyof SectionsOverrides
|
|
22
|
+
SectionName extends keyof SectionsOverrides = keyof SectionsOverrides,
|
|
23
23
|
>() =>
|
|
24
24
|
useContext(OverrideContext)
|
|
25
25
|
.components as OverrideContextType<SectionName>['components']
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
ClientManyProductsQueryQuery,
|
|
3
3
|
ClientProductGalleryQueryQuery,
|
|
4
4
|
ClientProductQueryQuery,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from '@generated/graphql'
|
|
8
8
|
import type { PropsWithChildren } from 'react'
|
|
9
9
|
import { createContext, useContext, useMemo } from 'react'
|
|
10
|
-
import { SearchPageContextType } from 'src/pages/s'
|
|
10
|
+
import type { SearchPageContextType } from 'src/pages/s'
|
|
11
11
|
|
|
12
12
|
export interface PDPContext {
|
|
13
13
|
data?: ServerProductQueryQuery &
|
|
@@ -87,7 +87,6 @@ export const usePLP = () => usePage<PLPContext>()
|
|
|
87
87
|
|
|
88
88
|
export const useSearchPage = () => usePage<SearchPageContext>()
|
|
89
89
|
|
|
90
|
-
export const useDynamicContent = <T
|
|
91
|
-
usePage<DynamicContent<T>>()
|
|
90
|
+
export const useDynamicContent = <T,>() => usePage<DynamicContent<T>>()
|
|
92
91
|
|
|
93
92
|
export default PageProvider
|
|
@@ -11,7 +11,7 @@ import { OverrideProvider } from './OverrideContext'
|
|
|
11
11
|
|
|
12
12
|
export function getOverridableSection<
|
|
13
13
|
Section extends ComponentType,
|
|
14
|
-
SectionName extends keyof SectionsOverrides = keyof SectionsOverrides
|
|
14
|
+
SectionName extends keyof SectionsOverrides = keyof SectionsOverrides,
|
|
15
15
|
>(
|
|
16
16
|
sectionName: SectionName,
|
|
17
17
|
Section: Section,
|
|
@@ -58,7 +58,7 @@ export function getOverridableSection<
|
|
|
58
58
|
* @see https://www.faststore.dev/docs/building-sections/overriding-components-and-props
|
|
59
59
|
*/
|
|
60
60
|
export function getOverriddenSection<
|
|
61
|
-
Section extends SectionsOverrides[keyof SectionsOverrides]['Section']
|
|
61
|
+
Section extends SectionsOverrides[keyof SectionsOverrides]['Section'],
|
|
62
62
|
>(override: SectionOverrideDefinition<Section>) {
|
|
63
63
|
const { Section, ...rest } = override
|
|
64
64
|
|
|
@@ -11,7 +11,7 @@ import type { SectionsOverrides } from '../../typings/overrides'
|
|
|
11
11
|
issues of this file. Error lines have been marked with the @ts-ignore comment*/
|
|
12
12
|
|
|
13
13
|
export function getSectionOverrides<
|
|
14
|
-
SectionName extends keyof SectionsOverrides
|
|
14
|
+
SectionName extends keyof SectionsOverrides,
|
|
15
15
|
>(
|
|
16
16
|
defaultComponents: DefaultSectionComponentsDefinitions<SectionName>,
|
|
17
17
|
override: SectionOverrideDefinitionV1<SectionName>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClientManyProductsQueryQueryVariables } from '@generated/graphql'
|
|
1
|
+
import type { ClientManyProductsQueryQueryVariables } from '@generated/graphql'
|
|
2
2
|
import { useMemo } from 'react'
|
|
3
3
|
import { ITEMS_PER_SECTION } from 'src/constants'
|
|
4
4
|
import { useSession } from '../session'
|
|
@@ -4,7 +4,7 @@ import { useSession } from 'src/sdk/session'
|
|
|
4
4
|
import { useLocalizedVariables } from './useLocalizedVariables'
|
|
5
5
|
|
|
6
6
|
import { useSearch } from '@faststore/sdk'
|
|
7
|
-
import { Facet } from '@faststore/sdk/dist/types'
|
|
7
|
+
import type { Facet } from '@faststore/sdk/dist/types'
|
|
8
8
|
import type {
|
|
9
9
|
ClientManyProductsQueryQueryVariables,
|
|
10
10
|
ClientProductGalleryQueryQuery as Query,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useSearch } from '@faststore/sdk'
|
|
2
2
|
|
|
3
3
|
import { gql } from '@generated'
|
|
4
|
-
import { ClientManyProductsQueryQueryVariables } from '@generated/graphql'
|
|
4
|
+
import type { ClientManyProductsQueryQueryVariables } from '@generated/graphql'
|
|
5
5
|
import { useEffect, useCallback } from 'react'
|
|
6
6
|
|
|
7
7
|
import type { QueryOptions } from '../graphql/useQuery'
|
|
@@ -89,15 +89,18 @@ export const useFilter = (allFacets: Filter_FacetsFragment[]) => {
|
|
|
89
89
|
|
|
90
90
|
const selectedMap = useMemo(
|
|
91
91
|
() =>
|
|
92
|
-
selected.reduce(
|
|
93
|
-
|
|
94
|
-
acc.
|
|
95
|
-
|
|
92
|
+
selected.reduce(
|
|
93
|
+
(acc, facet) => {
|
|
94
|
+
if (!acc.has(facet.key)) {
|
|
95
|
+
acc.set(facet.key, new Map())
|
|
96
|
+
}
|
|
96
97
|
|
|
97
|
-
|
|
98
|
+
acc.get(facet.key)?.set(facet.value, facet)
|
|
98
99
|
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
return acc
|
|
101
|
+
},
|
|
102
|
+
new Map() as Map<string, Map<string, IStoreSelectedFacet>>
|
|
103
|
+
),
|
|
101
104
|
[selected]
|
|
102
105
|
)
|
|
103
106
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ChangeEvent } from 'react'
|
|
2
2
|
import { useCallback, useEffect, useReducer, useRef } from 'react'
|
|
3
|
-
import { ClientShippingSimulationQueryQuery } from '@generated/graphql'
|
|
3
|
+
import type { ClientShippingSimulationQueryQuery } from '@generated/graphql'
|
|
4
4
|
import getShippingSimulation from '.'
|
|
5
5
|
import { useSession } from '../session'
|
|
6
6
|
|
|
@@ -46,7 +46,7 @@ const createEmptySimulation = () =>
|
|
|
46
46
|
errorMessage: '',
|
|
47
47
|
},
|
|
48
48
|
shippingSimulation: undefined,
|
|
49
|
-
} as State
|
|
49
|
+
}) as State
|
|
50
50
|
|
|
51
51
|
const reducer = (state: State, action: Action) => {
|
|
52
52
|
const { type } = action
|