@faststore/core 2.0.139-alpha.0 → 2.0.141-alpha.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/.next/BUILD_ID +1 -0
- package/.next/build-manifest.json +132 -0
- package/.next/cache/.tsbuildinfo +1 -0
- package/.next/cache/config.json +7 -0
- package/.next/cache/eslint/.cache_1gneedd +1 -0
- package/.next/cache/next-server.js.nft.json +1 -0
- 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/export-marker.json +1 -0
- package/.next/images-manifest.json +1 -0
- package/.next/next-server.js.nft.json +1 -0
- package/.next/package.json +1 -0
- package/.next/prerender-manifest.json +1 -0
- package/.next/react-loadable-manifest.json +48 -0
- package/.next/required-server-files.json +1 -0
- package/.next/routes-manifest.json +1 -0
- package/.next/server/chunks/104.js +703 -0
- package/.next/server/chunks/123.js +58 -0
- package/.next/server/chunks/143.js +106 -0
- package/.next/server/chunks/183.js +80 -0
- package/.next/server/chunks/247.js +61 -0
- package/.next/server/chunks/280.js +324 -0
- package/.next/server/chunks/287.js +58 -0
- package/.next/server/chunks/312.js +670 -0
- package/.next/server/chunks/336.js +821 -0
- package/.next/server/chunks/350.js +142 -0
- package/.next/server/chunks/368.js +253 -0
- package/.next/server/chunks/401.js +7241 -0
- package/.next/server/chunks/431.js +7241 -0
- package/.next/server/chunks/502.js +600 -0
- package/.next/server/chunks/557.js +132 -0
- package/.next/server/chunks/576.js +80 -0
- package/.next/server/chunks/597.js +169 -0
- package/.next/server/chunks/608.js +644 -0
- package/.next/server/chunks/644.js +235 -0
- package/.next/server/chunks/664.js +3401 -0
- package/.next/server/chunks/676.js +32 -0
- package/.next/server/chunks/701.js +87 -0
- package/.next/server/chunks/74.js +2520 -0
- package/.next/server/chunks/746.js +225 -0
- package/.next/server/chunks/82.js +371 -0
- package/.next/server/chunks/854.js +72 -0
- package/.next/server/chunks/859.js +959 -0
- package/.next/server/chunks/874.js +487 -0
- package/.next/server/chunks/886.js +120 -0
- package/.next/server/chunks/907.js +1723 -0
- package/.next/server/chunks/98.js +124 -0
- package/.next/server/chunks/font-manifest.json +1 -0
- package/.next/server/font-manifest.json +1 -0
- package/.next/server/middleware-build-manifest.js +1 -0
- package/.next/server/middleware-manifest.json +6 -0
- package/.next/server/middleware-react-loadable-manifest.js +1 -0
- package/.next/server/pages/404.js +393 -0
- package/.next/server/pages/404.js.nft.json +1 -0
- package/.next/server/pages/500.js +395 -0
- package/.next/server/pages/500.js.nft.json +1 -0
- package/.next/server/pages/[...slug].js +725 -0
- package/.next/server/pages/[...slug].js.nft.json +1 -0
- package/.next/server/pages/[slug]/p.js +2386 -0
- package/.next/server/pages/[slug]/p.js.nft.json +1 -0
- package/.next/server/pages/_app.js +368 -0
- package/.next/server/pages/_app.js.nft.json +1 -0
- package/.next/server/pages/_document.js +304 -0
- package/.next/server/pages/_document.js.nft.json +1 -0
- package/.next/server/pages/_error.js +164 -0
- package/.next/server/pages/_error.js.nft.json +1 -0
- package/.next/server/pages/account.js +370 -0
- package/.next/server/pages/account.js.nft.json +1 -0
- package/.next/server/pages/api/graphql.js +315 -0
- package/.next/server/pages/api/graphql.js.nft.json +1 -0
- package/.next/server/pages/api/preview.js +118 -0
- package/.next/server/pages/api/preview.js.nft.json +1 -0
- package/.next/server/pages/checkout.js +370 -0
- package/.next/server/pages/checkout.js.nft.json +1 -0
- package/.next/server/pages/en-US/404.html +81 -0
- package/.next/server/pages/en-US/404.json +1 -0
- package/.next/server/pages/en-US/500.html +81 -0
- package/.next/server/pages/en-US/500.json +1 -0
- package/.next/server/pages/en-US/account.html +81 -0
- package/.next/server/pages/en-US/account.json +1 -0
- package/.next/server/pages/en-US/checkout.html +81 -0
- package/.next/server/pages/en-US/checkout.json +1 -0
- package/.next/server/pages/en-US/login.html +81 -0
- package/.next/server/pages/en-US/login.json +1 -0
- package/.next/server/pages/en-US/s.html +81 -0
- package/.next/server/pages/en-US/s.json +1 -0
- package/.next/server/pages/en-US.html +81 -0
- package/.next/server/pages/en-US.json +1 -0
- package/.next/server/pages/index.js +966 -0
- package/.next/server/pages/index.js.nft.json +1 -0
- package/.next/server/pages/login.js +375 -0
- package/.next/server/pages/login.js.nft.json +1 -0
- package/.next/server/pages/s.js +457 -0
- package/.next/server/pages/s.js.nft.json +1 -0
- package/.next/server/pages-manifest.json +16 -0
- package/.next/server/webpack-api-runtime.js +229 -0
- package/.next/server/webpack-runtime.js +229 -0
- package/.next/static/aYsUeJebfxFmPYaCwqdKq/_buildManifest.js +1 -0
- package/.next/static/aYsUeJebfxFmPYaCwqdKq/_ssgManifest.js +1 -0
- package/.next/static/chunks/143.dd8a556e6957baa1.js +1 -0
- package/.next/static/chunks/170.c17ce564bb568265.js +1 -0
- package/.next/static/chunks/202-80a2f2380b08e20d.js +1 -0
- package/.next/static/chunks/226.b57e10ad9932f88c.js +1 -0
- package/.next/static/chunks/327-43715af4f3fffaf6.js +1 -0
- package/.next/static/chunks/336.0846f48eccce57e4.js +1 -0
- package/.next/static/chunks/366-4a0572a47e2225d9.js +1 -0
- package/.next/static/chunks/391-47b923ef44945418.js +1 -0
- package/.next/static/chunks/495.8ffebac98e9475dc.js +1 -0
- package/.next/static/chunks/502.7fd4f230c33d8eca.js +1 -0
- package/.next/static/chunks/545-1d3d08edfd2ee4c6.js +1 -0
- package/.next/static/chunks/597.c5cf3fbeae5ceb63.js +1 -0
- package/.next/static/chunks/651.7142f31ce1e052b3.js +1 -0
- package/.next/static/chunks/741.52f7fb873418346f.js +1 -0
- package/.next/static/chunks/98.97381d2021f86cd9.js +1 -0
- package/.next/static/chunks/framework-dfd14d7ce6600b03.js +1 -0
- package/.next/static/chunks/main-fd466221927468fd.js +1 -0
- package/.next/static/chunks/pages/404-eb7e8c41c852c36d.js +1 -0
- package/.next/static/chunks/pages/500-7dc597fd3f74e419.js +1 -0
- package/.next/static/chunks/pages/[...slug]-229b8537827404bc.js +1 -0
- package/.next/static/chunks/pages/[slug]/p-a3a8af1949dc6eca.js +1 -0
- package/.next/static/chunks/pages/_app-3e4e7e579cb0681a.js +1 -0
- package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +1 -0
- package/.next/static/chunks/pages/account-7f4c51b747b4edd0.js +1 -0
- package/.next/static/chunks/pages/checkout-cb8871ab88a1471f.js +1 -0
- package/.next/static/chunks/pages/index-7587d2684d1f1de4.js +1 -0
- package/.next/static/chunks/pages/login-9490b01a047906c0.js +1 -0
- package/.next/static/chunks/pages/s-9582cfca21ff2718.js +1 -0
- package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +1 -0
- package/.next/static/chunks/webpack-d73d5e1e07f9bee2.js +1 -0
- package/.next/static/css/13a4da555ff5e3be.css +1 -0
- package/.next/static/css/2257f9a5bf751bf1.css +1 -0
- package/.next/static/css/2e00f7ba49c754b3.css +1 -0
- package/.next/static/css/2e9de35e0cb999e0.css +1 -0
- package/.next/static/css/43b1b3821e21630c.css +1 -0
- package/.next/static/css/48af598df5fe042d.css +1 -0
- package/.next/static/css/587c27bbda64e700.css +1 -0
- package/.next/static/css/7701d01af31e31d1.css +1 -0
- package/.next/static/css/e02cdad8fc000339.css +1 -0
- package/.next/static/css/e434797816e17065.css +1 -0
- package/.next/static/media/brandless-neutral.76ddf63a.png +0 -0
- package/.next/trace +68 -0
- package/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +10 -0
- package/cms/faststore/content-types.json +5 -0
- package/package.json +4 -4
- package/public/~partytown/debug/partytown-atomics.js +556 -0
- package/public/~partytown/debug/partytown-media.js +374 -0
- package/public/~partytown/debug/partytown-sandbox-sw.js +543 -0
- package/public/~partytown/debug/partytown-sw.js +59 -0
- package/public/~partytown/debug/partytown-ww-atomics.js +1789 -0
- package/public/~partytown/debug/partytown-ww-sw.js +1781 -0
- package/public/~partytown/debug/partytown.js +72 -0
- package/public/~partytown/partytown-atomics.js +2 -0
- package/public/~partytown/partytown-media.js +2 -0
- package/public/~partytown/partytown-sw.js +2 -0
- package/public/~partytown/partytown.js +2 -0
- package/src/components/sections/Breadcrumb/Breadcrumb.tsx +30 -10
- package/src/components/sections/ProductDetails/ProductDetails.tsx +1 -3
- package/src/components/ui/Breadcrumb/Breadcrumb.tsx +15 -17
- package/src/pages/[...slug].tsx +41 -22
- package/src/pages/[slug]/p.tsx +9 -8
- package/src/pages/index.tsx +10 -9
- package/src/pages/s.tsx +29 -10
- package/src/server/cms.ts +3 -1
package/src/pages/s.tsx
CHANGED
|
@@ -1,25 +1,38 @@
|
|
|
1
|
+
import type { SearchState } from '@faststore/sdk'
|
|
1
2
|
import { parseSearchState, SearchProvider } from '@faststore/sdk'
|
|
3
|
+
import { SROnly as UISROnly } from '@faststore/ui'
|
|
2
4
|
import { NextSeo } from 'next-seo'
|
|
3
5
|
import { useRouter } from 'next/router'
|
|
6
|
+
import type { ComponentType } from 'react'
|
|
4
7
|
import { useEffect, useState } from 'react'
|
|
5
|
-
import type { SearchState } from '@faststore/sdk'
|
|
6
|
-
import { SROnly as UISROnly } from '@faststore/ui'
|
|
7
8
|
|
|
8
9
|
import Breadcrumb from 'src/components/sections/Breadcrumb'
|
|
9
10
|
import ProductGallery from 'src/components/sections/ProductGallery'
|
|
10
11
|
import { ITEMS_PER_PAGE } from 'src/constants'
|
|
12
|
+
import CUSTOM_COMPONENTS from 'src/customizations/components'
|
|
11
13
|
import { useApplySearchState } from 'src/sdk/search/state'
|
|
12
14
|
import { mark } from 'src/sdk/tests/mark'
|
|
13
15
|
|
|
14
|
-
import
|
|
16
|
+
import { Locator } from '@vtex/client-cms'
|
|
17
|
+
import { GetStaticProps } from 'next'
|
|
15
18
|
import GlobalSections, {
|
|
16
19
|
getGlobalSectionsData,
|
|
17
20
|
GlobalSectionsData,
|
|
18
21
|
} from 'src/components/cms/GlobalSections'
|
|
19
|
-
import
|
|
20
|
-
import {
|
|
22
|
+
import RenderSections from 'src/components/cms/RenderSections'
|
|
23
|
+
import { getPage, SearchContentType } from 'src/server/cms'
|
|
24
|
+
import storeConfig from '../../faststore.config'
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Sections: Components imported from each store's custom components and '../components/sections' only.
|
|
28
|
+
* Do not import or render components from any other folder in here.
|
|
29
|
+
*/
|
|
30
|
+
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
31
|
+
Breadcrumb,
|
|
32
|
+
...CUSTOM_COMPONENTS,
|
|
33
|
+
}
|
|
21
34
|
|
|
22
|
-
type Props = {
|
|
35
|
+
type Props = SearchContentType & {
|
|
23
36
|
globalSections: GlobalSectionsData
|
|
24
37
|
}
|
|
25
38
|
|
|
@@ -36,7 +49,7 @@ const useSearchParams = () => {
|
|
|
36
49
|
return params
|
|
37
50
|
}
|
|
38
51
|
|
|
39
|
-
function Page({ globalSections }: Props) {
|
|
52
|
+
function Page({ sections, globalSections }: Props) {
|
|
40
53
|
const searchParams = useSearchParams()
|
|
41
54
|
const applySearchState = useApplySearchState()
|
|
42
55
|
const title = 'Search Results'
|
|
@@ -79,7 +92,7 @@ function Page({ globalSections }: Props) {
|
|
|
79
92
|
If needed, wrap your component in a <Section /> component
|
|
80
93
|
(not the HTML tag) before rendering it here.
|
|
81
94
|
*/}
|
|
82
|
-
<
|
|
95
|
+
<RenderSections sections={sections} components={COMPONENTS} />
|
|
83
96
|
|
|
84
97
|
<ProductGallery
|
|
85
98
|
title="Search Results"
|
|
@@ -95,10 +108,16 @@ export const getStaticProps: GetStaticProps<
|
|
|
95
108
|
Record<string, string>,
|
|
96
109
|
Locator
|
|
97
110
|
> = async ({ previewData }) => {
|
|
98
|
-
const globalSections = await
|
|
111
|
+
const [cmsPage, globalSections] = await Promise.all([
|
|
112
|
+
getPage<SearchContentType>({
|
|
113
|
+
...(previewData?.contentType === 'search' ? previewData : null),
|
|
114
|
+
contentType: 'search',
|
|
115
|
+
}),
|
|
116
|
+
getGlobalSectionsData(previewData),
|
|
117
|
+
])
|
|
99
118
|
|
|
100
119
|
return {
|
|
101
|
-
props: { globalSections },
|
|
120
|
+
props: { ...cmsPage, globalSections },
|
|
102
121
|
}
|
|
103
122
|
}
|
|
104
123
|
|
package/src/server/cms.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import ClientCMS from '@vtex/client-cms'
|
|
2
1
|
import type { ContentData, Locator } from '@vtex/client-cms'
|
|
2
|
+
import ClientCMS from '@vtex/client-cms'
|
|
3
3
|
|
|
4
4
|
import config from '../../faststore.config'
|
|
5
5
|
|
|
@@ -54,6 +54,8 @@ export const getPage = async <T extends ContentData>(options: Options) => {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
export type PDPContentType = ContentData
|
|
57
|
+
export type PLPContentType = ContentData
|
|
58
|
+
export type SearchContentType = ContentData
|
|
57
59
|
|
|
58
60
|
export type PageContentType = ContentData & {
|
|
59
61
|
settings: {
|