@faststore/core 3.10.0 → 3.11.1
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 +4 -4
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/eslint/.cache_1gneedd +1 -1
- 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/routes-manifest.json +1 -1
- package/.next/server/chunks/371.js +1 -1
- package/.next/server/chunks/5430.js +1 -1
- package/.next/server/chunks/5671.js +1 -1
- package/.next/server/chunks/5754.js +1 -1
- package/.next/server/functions-config-manifest.json +1 -1
- package/.next/server/middleware-build-manifest.js +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/s.js +1 -1
- package/.next/server/pages-manifest.json +1 -1
- package/.next/static/{KLRpc4egH7cH2aYyX8E9h → Ip8ORS16rwfFtlFeTRcSj}/_buildManifest.js +1 -1
- package/.next/static/chunks/pages/{_app-e8bd1b2503bf0aa9.js → _app-91d65e1abd88251d.js} +1 -1
- package/.next/static/chunks/pages/s-e609aea0cbb6c9fd.js +1 -0
- package/.next/trace +102 -101
- package/.turbo/turbo-build.log +9 -9
- package/.turbo/turbo-test.log +5 -5
- package/CHANGELOG.md +10 -0
- package/discovery.config.default.js +6 -1
- package/package.json +7 -32
- package/src/experimental/searchServerSideFunctions/getServerSideProps.ts +51 -0
- package/src/experimental/searchServerSideFunctions/getStaticProps.ts +57 -0
- package/src/experimental/searchServerSideFunctions/index.ts +2 -0
- package/src/pages/s.tsx +61 -65
- package/.editorconfig +0 -13
- package/.husky/pre-commit +0 -4
- package/.next/static/chunks/pages/s-a932301211f32425.js +0 -1
- package/.stylelintignore +0 -1
- package/.vscode/settings.json +0 -7
- package/stylelint.config.js +0 -82
- /package/.next/static/{KLRpc4egH7cH2aYyX8E9h → Ip8ORS16rwfFtlFeTRcSj}/_ssgManifest.js +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -38,8 +38,8 @@ https://nextjs.org/telemetry
|
|
|
38
38
|
Collecting page data ...
|
|
39
39
|
Generating static pages (0/7) ...
|
|
40
40
|
|
|
41
41
|
Generating static pages (1/7)
|
|
42
|
-
Warning: Dynamic Content not found for the page: home. Refer to the Dynamic Content documentation at https://developers.vtex.com/docs/guides/faststore/dynamic-content-overview for mapping the page and the corresponding data-fetching function.
|
|
43
42
|
|
|
44
43
|
Generating static pages (3/7)
|
|
44
|
+
Warning: Dynamic Content not found for the page: home. Refer to the Dynamic Content documentation at https://developers.vtex.com/docs/guides/faststore/dynamic-content-overview for mapping the page and the corresponding data-fetching function.
|
|
45
45
|
|
|
46
46
|
Generating static pages (5/7)
|
|
47
47
|
|
|
48
48
|
✓ Generating static pages (7/7)
|
|
49
49
|
Finalizing page optimization ...
|
|
@@ -48,7 +48,7 @@ Warning: Dynamic Content not found for the page: home. Refer to the Dynamic Cont
|
|
|
48
48
|
Route (pages) Size First Load JS
|
|
49
49
|
┌ ● / 3.23 kB 122 kB
|
|
50
50
|
├ └ css/b1806cbafd0c1f81.css 3.06 kB
|
|
51
|
-
├ /_app 0 B
|
|
51
|
+
├ /_app 0 B 92 kB
|
|
52
52
|
├ ● /[...slug] 2.09 kB 131 kB
|
|
53
53
|
├ ● /[slug]/p 34.1 kB 153 kB
|
|
54
54
|
├ ├ css/bf1560439df2c1a1.css 5.66 kB
|
|
@@ -57,17 +57,17 @@ Route (pages) Size First Load JS
|
|
|
57
57
|
├ ○ /404 1.48 kB 121 kB
|
|
58
58
|
├ ● /500 1.48 kB 121 kB
|
|
59
59
|
├ ● /account 714 B 120 kB
|
|
60
|
-
├ λ /api/graphql 0 B
|
|
61
|
-
├ λ /api/health/live 0 B
|
|
62
|
-
├ λ /api/health/ready 0 B
|
|
63
|
-
├ λ /api/preview 0 B
|
|
60
|
+
├ λ /api/graphql 0 B 92 kB
|
|
61
|
+
├ λ /api/health/live 0 B 92 kB
|
|
62
|
+
├ λ /api/health/ready 0 B 92 kB
|
|
63
|
+
├ λ /api/preview 0 B 92 kB
|
|
64
64
|
├ ● /checkout 695 B 120 kB
|
|
65
65
|
├ ● /login 1.59 kB 121 kB
|
|
66
|
-
└ ● /s 2.
|
|
66
|
+
└ ● /s 2.92 kB 132 kB
|
|
67
67
|
+ First Load JS shared by all 95 kB
|
|
68
68
|
├ chunks/framework-12a146e94cfcf7c4.js 45.4 kB
|
|
69
69
|
├ chunks/main-209ac4974b020af1.js 33.1 kB
|
|
70
|
-
├ chunks/pages/_app-
|
|
70
|
+
├ chunks/pages/_app-91d65e1abd88251d.js 9.97 kB
|
|
71
71
|
├ chunks/webpack-bf502499da135235.js 3.57 kB
|
|
72
72
|
└ css/ee0556daedda6306.css 3.07 kB
|
|
73
73
|
|
|
@@ -75,4 +75,4 @@ Route (pages) Size First Load JS
|
|
|
75
75
|
○ (Static) automatically rendered as static HTML (uses no initial props)
|
|
76
76
|
● (SSG) automatically generated as static HTML + JSON (uses getStaticProps)
|
|
77
77
|
|
|
78
|
-
Done in 69.
|
|
78
|
+
Done in 69.82s.
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
yarn run v1.22.22
|
|
2
2
|
$ jest
|
|
3
|
-
PASS test/server/cms/index.test.ts (
|
|
4
|
-
PASS test/utils/multipleTemplates.test.ts (36.
|
|
5
|
-
PASS test/server/index.test.ts (39.
|
|
3
|
+
PASS test/server/cms/index.test.ts (36.143 s)
|
|
4
|
+
PASS test/utils/multipleTemplates.test.ts (36.37 s)
|
|
5
|
+
PASS test/server/index.test.ts (39.735 s)
|
|
6
6
|
|
|
7
7
|
Test Suites: 3 passed, 3 total
|
|
8
8
|
Tests: 19 passed, 19 total
|
|
9
9
|
Snapshots: 0 total
|
|
10
|
-
Time: 40.
|
|
10
|
+
Time: 40.867 s
|
|
11
11
|
Ran all test suites.
|
|
12
|
-
Done in 42.
|
|
12
|
+
Done in 42.35s.
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.11.1](https://github.com/vtex/faststore/compare/v3.11.0...v3.11.1) (2025-01-29)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @faststore/core
|
|
9
|
+
|
|
10
|
+
# [3.11.0](https://github.com/vtex/faststore/compare/v3.10.0...v3.11.0) (2025-01-29)
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- search page with SSR ([#2619](https://github.com/vtex/faststore/issues/2619)) ([6fd2d0d](https://github.com/vtex/faststore/commit/6fd2d0d5e92f0922f8d97237d9d04a7eadc5e894))
|
|
15
|
+
|
|
6
16
|
# [3.10.0](https://github.com/vtex/faststore/compare/v3.9.3...v3.10.0) (2025-01-29)
|
|
7
17
|
|
|
8
18
|
### Features
|
|
@@ -6,7 +6,11 @@ module.exports = {
|
|
|
6
6
|
author: 'Store Framework',
|
|
7
7
|
plp: {
|
|
8
8
|
titleTemplate: '%s | FastStore PLP',
|
|
9
|
-
descriptionTemplate: '%s products on FastStore Product Listing Page'
|
|
9
|
+
descriptionTemplate: '%s products on FastStore Product Listing Page'
|
|
10
|
+
},
|
|
11
|
+
search: {
|
|
12
|
+
titleTemplate: '%s: Search results title',
|
|
13
|
+
descriptionTemplate: '%s: Search results description',
|
|
10
14
|
},
|
|
11
15
|
},
|
|
12
16
|
|
|
@@ -106,5 +110,6 @@ module.exports = {
|
|
|
106
110
|
noRobots: false,
|
|
107
111
|
preact: false,
|
|
108
112
|
enableRedirects: false,
|
|
113
|
+
enableSearchSSR: false,
|
|
109
114
|
},
|
|
110
115
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.11.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "vtex/faststore",
|
|
6
6
|
"browserslist": "supports es6-module and not dead",
|
|
@@ -25,16 +25,16 @@
|
|
|
25
25
|
"test:e2e": "cypress open",
|
|
26
26
|
"test": "jest",
|
|
27
27
|
"lhci": "lhci autorun",
|
|
28
|
-
"
|
|
29
|
-
"lint": "next lint",
|
|
30
|
-
"stylelint": "stylelint \"**/*.scss\"",
|
|
31
|
-
"stylelint:fix": "stylelint \"**/*.scss\" --fix",
|
|
32
|
-
"postinstall": "node postinstall.js && (is-ci || (cd ../.. && husky install packages/core/.husky)) || echo Skipped postinstall step for @faststore/core",
|
|
28
|
+
"postinstall": "node postinstall.js && is-ci || echo Skipped postinstall step for @faststore/core",
|
|
33
29
|
"partytown": "partytown copylib ./public/~partytown"
|
|
34
30
|
},
|
|
35
31
|
"engines": {
|
|
36
32
|
"node": ">=18"
|
|
37
33
|
},
|
|
34
|
+
"volta": {
|
|
35
|
+
"node": "18.19.0",
|
|
36
|
+
"yarn": "1.19.1"
|
|
37
|
+
},
|
|
38
38
|
"sideEffects": false,
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@antfu/ni": "^0.21.12",
|
|
@@ -99,34 +99,9 @@
|
|
|
99
99
|
"cypress-axe": "^1.5.0",
|
|
100
100
|
"cypress-wait-until": "^2.0.1",
|
|
101
101
|
"dotenv": "^8.2.0",
|
|
102
|
-
"eslint": "^7.32.0",
|
|
103
|
-
"husky": "^5.2.0",
|
|
104
102
|
"is-ci": "^3.0.0",
|
|
105
103
|
"jest": "^29.7.0",
|
|
106
|
-
"lint-staged": "^15.2.0",
|
|
107
|
-
"stylelint": "^14.6.0",
|
|
108
|
-
"stylelint-config-recess-order": "^3.0.0",
|
|
109
|
-
"stylelint-config-standard": "^24.0.0",
|
|
110
|
-
"stylelint-config-standard-scss": "^3.0.0",
|
|
111
|
-
"stylelint-order": "^5.0.0",
|
|
112
|
-
"stylelint-scss": "^4.0.1",
|
|
113
104
|
"ts-jest": "29.1.1"
|
|
114
105
|
},
|
|
115
|
-
"
|
|
116
|
-
"*.{ts,js,tsx,jsx}": [
|
|
117
|
-
"eslint --fix",
|
|
118
|
-
"prettier --write"
|
|
119
|
-
],
|
|
120
|
-
"*.json": [
|
|
121
|
-
"prettier --write"
|
|
122
|
-
],
|
|
123
|
-
"*.scss": [
|
|
124
|
-
"stylelint --fix"
|
|
125
|
-
]
|
|
126
|
-
},
|
|
127
|
-
"volta": {
|
|
128
|
-
"node": "18.19.0",
|
|
129
|
-
"yarn": "1.19.1"
|
|
130
|
-
},
|
|
131
|
-
"gitHead": "03506c3d584afd18033e383c806a078a3f9862dc"
|
|
106
|
+
"gitHead": "6fea4f1cc3db6a9a894959c31ad2c9a47cfe941a"
|
|
132
107
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { GetServerSideProps } from 'next'
|
|
2
|
+
import { SearchPageProps } from './getStaticProps'
|
|
3
|
+
|
|
4
|
+
import { getGlobalSectionsData } from 'src/components/cms/GlobalSections'
|
|
5
|
+
import { SearchContentType, getPage } from 'src/server/cms'
|
|
6
|
+
import { Locator } from '@vtex/client-cms'
|
|
7
|
+
import storeConfig from 'discovery.config'
|
|
8
|
+
|
|
9
|
+
export const getServerSideProps: GetServerSideProps<
|
|
10
|
+
SearchPageProps,
|
|
11
|
+
Record<string, string>,
|
|
12
|
+
Locator
|
|
13
|
+
> = async (context) => {
|
|
14
|
+
const { previewData, query, res } = context
|
|
15
|
+
const searchTerm = (query.q as string)?.split('+').join(' ')
|
|
16
|
+
|
|
17
|
+
const globalSections = await getGlobalSectionsData(previewData)
|
|
18
|
+
|
|
19
|
+
if (storeConfig.cms.data) {
|
|
20
|
+
const cmsData = JSON.parse(storeConfig.cms.data)
|
|
21
|
+
const page = cmsData['search'][0]
|
|
22
|
+
if (page) {
|
|
23
|
+
const pageData = await getPage<SearchContentType>({
|
|
24
|
+
contentType: 'search',
|
|
25
|
+
documentId: page.documentId,
|
|
26
|
+
versionId: page.versionId,
|
|
27
|
+
})
|
|
28
|
+
return {
|
|
29
|
+
props: { page: pageData, globalSections, searchTerm },
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const page = await getPage<SearchContentType>({
|
|
35
|
+
...(previewData?.contentType === 'search' ? previewData : null),
|
|
36
|
+
contentType: 'search',
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
res.setHeader(
|
|
40
|
+
'Cache-Control',
|
|
41
|
+
'public, s-maxage=300, stale-while-revalidate=31536000, stale-if-error=31536000'
|
|
42
|
+
) // 5 minutes of fresh content and 1 year of stale content
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
props: {
|
|
46
|
+
page,
|
|
47
|
+
globalSections,
|
|
48
|
+
searchTerm,
|
|
49
|
+
},
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { GetStaticProps } from 'next'
|
|
2
|
+
import {
|
|
3
|
+
getGlobalSectionsData,
|
|
4
|
+
GlobalSectionsData,
|
|
5
|
+
} from 'src/components/cms/GlobalSections'
|
|
6
|
+
import { SearchContentType, getPage } from 'src/server/cms'
|
|
7
|
+
import { Locator } from '@vtex/client-cms'
|
|
8
|
+
import storeConfig from 'discovery.config'
|
|
9
|
+
|
|
10
|
+
export type SearchPageProps = {
|
|
11
|
+
page: SearchContentType
|
|
12
|
+
globalSections: GlobalSectionsData
|
|
13
|
+
searchTerm?: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/*
|
|
17
|
+
Depending on the value of the storeConfig.experimental.enableSearchSSR flag, the function used will be getServerSideProps (./getServerSideProps).
|
|
18
|
+
Our CLI that does this process of converting from getStaticProps to getServerSideProps.
|
|
19
|
+
*/
|
|
20
|
+
export const getStaticProps: GetStaticProps<
|
|
21
|
+
SearchPageProps,
|
|
22
|
+
Record<string, string>,
|
|
23
|
+
Locator
|
|
24
|
+
> = async (context) => {
|
|
25
|
+
const { previewData } = context
|
|
26
|
+
|
|
27
|
+
const globalSections = await getGlobalSectionsData(previewData)
|
|
28
|
+
|
|
29
|
+
if (storeConfig.cms.data) {
|
|
30
|
+
const cmsData = JSON.parse(storeConfig.cms.data)
|
|
31
|
+
const page = cmsData['search'][0]
|
|
32
|
+
|
|
33
|
+
if (page) {
|
|
34
|
+
const pageData = await getPage<SearchContentType>({
|
|
35
|
+
contentType: 'search',
|
|
36
|
+
documentId: page.documentId,
|
|
37
|
+
versionId: page.versionId,
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
props: { page: pageData, globalSections },
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const page = await getPage<SearchContentType>({
|
|
47
|
+
...(previewData?.contentType === 'search' ? previewData : null),
|
|
48
|
+
contentType: 'search',
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
props: {
|
|
53
|
+
page,
|
|
54
|
+
globalSections,
|
|
55
|
+
},
|
|
56
|
+
}
|
|
57
|
+
}
|
package/src/pages/s.tsx
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { GetStaticProps } from 'next'
|
|
2
1
|
import { NextSeo } from 'next-seo'
|
|
3
2
|
import { useRouter } from 'next/router'
|
|
4
3
|
import { useMemo } from 'react'
|
|
@@ -14,19 +13,13 @@ import { SROnly as UISROnly } from '@faststore/ui'
|
|
|
14
13
|
import { ITEMS_PER_PAGE } from 'src/constants'
|
|
15
14
|
import { useApplySearchState } from 'src/sdk/search/state'
|
|
16
15
|
|
|
17
|
-
import { Locator } from '@vtex/client-cms'
|
|
18
16
|
import storeConfig from 'discovery.config'
|
|
19
|
-
import {
|
|
20
|
-
getGlobalSectionsData,
|
|
21
|
-
GlobalSectionsData,
|
|
22
|
-
} from 'src/components/cms/GlobalSections'
|
|
23
|
-
import { SearchWrapper } from 'src/components/templates/SearchPage'
|
|
24
|
-
import { getPage, SearchContentType } from 'src/server/cms'
|
|
25
17
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
import { SearchWrapper } from 'src/components/templates/SearchPage'
|
|
19
|
+
import {
|
|
20
|
+
getStaticProps,
|
|
21
|
+
SearchPageProps,
|
|
22
|
+
} from 'src/experimental/searchServerSideFunctions'
|
|
30
23
|
|
|
31
24
|
export interface SearchPageContextType {
|
|
32
25
|
title: string
|
|
@@ -54,21 +47,69 @@ const useSearchParams = ({
|
|
|
54
47
|
}, [asPath, defaultSort])
|
|
55
48
|
}
|
|
56
49
|
|
|
57
|
-
|
|
50
|
+
type StoreConfig = typeof storeConfig
|
|
51
|
+
|
|
52
|
+
function generateSEOData(storeConfig: StoreConfig, searchTerm?: string) {
|
|
53
|
+
const { search: searchSeo, ...seo } = storeConfig.seo
|
|
54
|
+
|
|
55
|
+
const isSSREnabled = storeConfig.experimental.enableSearchSSR
|
|
56
|
+
|
|
57
|
+
// default behavior without SSR
|
|
58
|
+
if (!isSSREnabled) {
|
|
59
|
+
return {
|
|
60
|
+
title: seo.title,
|
|
61
|
+
description: seo.description,
|
|
62
|
+
titleTemplate: seo.titleTemplate,
|
|
63
|
+
openGraph: {
|
|
64
|
+
type: 'website',
|
|
65
|
+
title: seo.title,
|
|
66
|
+
description: seo.description,
|
|
67
|
+
},
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const title = searchTerm ?? 'Search Results'
|
|
72
|
+
const titleTemplate = searchSeo?.titleTemplate ?? seo.titleTemplate
|
|
73
|
+
const description = searchSeo?.descriptionTemplate
|
|
74
|
+
? searchSeo.descriptionTemplate.replace(/%s/g, () => searchTerm)
|
|
75
|
+
: seo.description
|
|
76
|
+
|
|
77
|
+
const canonical = searchTerm
|
|
78
|
+
? `${storeConfig.storeUrl}/s?q=${searchTerm}`
|
|
79
|
+
: undefined
|
|
80
|
+
|
|
81
|
+
return {
|
|
82
|
+
title,
|
|
83
|
+
description,
|
|
84
|
+
titleTemplate,
|
|
85
|
+
canonical,
|
|
86
|
+
openGraph: {
|
|
87
|
+
type: 'website',
|
|
88
|
+
title: title,
|
|
89
|
+
description: description,
|
|
90
|
+
},
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function Page({
|
|
95
|
+
page: searchContentType,
|
|
96
|
+
globalSections,
|
|
97
|
+
searchTerm,
|
|
98
|
+
}: SearchPageProps) {
|
|
58
99
|
const { settings } = searchContentType
|
|
59
100
|
const applySearchState = useApplySearchState()
|
|
60
101
|
const searchParams = useSearchParams({
|
|
61
102
|
sort: settings?.productGallery?.sortBySelection as SearchState['sort'],
|
|
62
103
|
})
|
|
63
104
|
|
|
64
|
-
const title = 'Search Results'
|
|
65
|
-
const { description, titleTemplate } = storeConfig.seo
|
|
66
105
|
const itemsPerPage = settings?.productGallery?.itemsPerPage ?? ITEMS_PER_PAGE
|
|
67
106
|
|
|
68
107
|
if (!searchParams) {
|
|
69
108
|
return null
|
|
70
109
|
}
|
|
71
110
|
|
|
111
|
+
const seoData = generateSEOData(storeConfig, searchTerm)
|
|
112
|
+
|
|
72
113
|
return (
|
|
73
114
|
<SearchProvider
|
|
74
115
|
onChange={applySearchState}
|
|
@@ -76,19 +117,9 @@ function Page({ page: searchContentType, globalSections }: Props) {
|
|
|
76
117
|
{...searchParams}
|
|
77
118
|
>
|
|
78
119
|
{/* SEO */}
|
|
79
|
-
<NextSeo
|
|
80
|
-
noindex
|
|
81
|
-
title={title}
|
|
82
|
-
description={description}
|
|
83
|
-
titleTemplate={titleTemplate}
|
|
84
|
-
openGraph={{
|
|
85
|
-
type: 'website',
|
|
86
|
-
title,
|
|
87
|
-
description,
|
|
88
|
-
}}
|
|
89
|
-
/>
|
|
120
|
+
<NextSeo noindex {...seoData} />
|
|
90
121
|
|
|
91
|
-
<UISROnly text={title} />
|
|
122
|
+
<UISROnly text={seoData.title} />
|
|
92
123
|
|
|
93
124
|
{/*
|
|
94
125
|
WARNING: Do not import or render components from any
|
|
@@ -105,8 +136,8 @@ function Page({ page: searchContentType, globalSections }: Props) {
|
|
|
105
136
|
itemsPerPage={itemsPerPage}
|
|
106
137
|
searchContentType={searchContentType}
|
|
107
138
|
serverData={{
|
|
108
|
-
title,
|
|
109
|
-
searchTerm: searchParams.term ?? undefined,
|
|
139
|
+
title: seoData.title,
|
|
140
|
+
searchTerm: searchTerm ?? searchParams.term ?? undefined,
|
|
110
141
|
}}
|
|
111
142
|
globalSections={globalSections.sections}
|
|
112
143
|
/>
|
|
@@ -114,41 +145,6 @@ function Page({ page: searchContentType, globalSections }: Props) {
|
|
|
114
145
|
)
|
|
115
146
|
}
|
|
116
147
|
|
|
117
|
-
export
|
|
118
|
-
Props,
|
|
119
|
-
Record<string, string>,
|
|
120
|
-
Locator
|
|
121
|
-
> = async ({ previewData }) => {
|
|
122
|
-
const globalSections = await getGlobalSectionsData(previewData)
|
|
123
|
-
|
|
124
|
-
if (storeConfig.cms.data) {
|
|
125
|
-
const cmsData = JSON.parse(storeConfig.cms.data)
|
|
126
|
-
const page = cmsData['search'][0]
|
|
127
|
-
|
|
128
|
-
if (page) {
|
|
129
|
-
const pageData = await getPage<SearchContentType>({
|
|
130
|
-
contentType: 'search',
|
|
131
|
-
documentId: page.documentId,
|
|
132
|
-
versionId: page.versionId,
|
|
133
|
-
})
|
|
134
|
-
|
|
135
|
-
return {
|
|
136
|
-
props: { page: pageData, globalSections },
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const page = await getPage<SearchContentType>({
|
|
142
|
-
...(previewData?.contentType === 'search' ? previewData : null),
|
|
143
|
-
contentType: 'search',
|
|
144
|
-
})
|
|
145
|
-
|
|
146
|
-
return {
|
|
147
|
-
props: {
|
|
148
|
-
page,
|
|
149
|
-
globalSections,
|
|
150
|
-
},
|
|
151
|
-
}
|
|
152
|
-
}
|
|
148
|
+
export { getStaticProps }
|
|
153
149
|
|
|
154
150
|
export default Page
|
package/.editorconfig
DELETED
package/.husky/pre-commit
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6552],{5450:function(e,t,r){"use strict";var n=r(2784);t.Z=function({text:e,as:t}){let r=t??"span";return n.createElement(r,{"data-fs-sr-only":!0},e)}},6133:function(e,t,r){"use strict";var n=r(2784);t.Z=function({testId:e="fs-empty-state",title:t,titleIcon:r,variant:o="default",bkgColor:a="default",children:c,...i}){return n.createElement("section",{"data-fs-empty-state":!0,"data-fs-empty-state-variant":o,"data-fs-empty-state-bkg-color":a,"data-fs-content":"empty-state","data-testid":e,...i},t&&n.createElement("header",{"data-fs-empty-state-title":!0},r&&n.createElement(n.Fragment,null,r),n.createElement("p",null,t)),c)}},945:function(e,t,r){"use strict";r.d(t,{Z:function(){return j}});var n=r(9499),o=r(1163),a=r(2614),c=r(1667),i=r(4329),l=r(9089),u=r(8919),p=r.n(u),d={EmptyState:r(6133).Z},b=r(7296),f=r(2322);function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){(0,n.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var useErrorState=()=>{var e,{query:{errorId:t,fromUrl:r},pathname:n,asPath:a}=(0,o.useRouter)();return{errorId:t,fromUrl:null!==(e=null!=r?r:a)&&void 0!==e?e:n}},j=(0,b.B)("EmptyState",function(e){var t,r,n,o,{title:u,titleIcon:d,children:b,subtitle:j,errorState:h,showLoader:y=!1}=e,{EmptyState:O}=(0,i.r3)(),{errorId:v,fromUrl:P}=useErrorState(),g=null!=d&&d.icon?(0,f.jsx)(a.Z,{name:null==d?void 0:d.icon,"aria-label":null==d?void 0:d.alt,width:56,height:56,weight:"thin"}):O.props.titleIcon;return(0,f.jsx)(l.Z,{className:"".concat(p().section," section-empty-state"),children:(0,f.jsxs)(O.Component,_objectSpread(_objectSpread({bkgColor:"light"},O.props),{},{title:null!=u?u:O.props.title,titleIcon:g,children:[!!j&&(0,f.jsx)("h2",{children:j}),!!(null!=h&&null!==(t=h.errorId)&&void 0!==t&&t.show)&&(0,f.jsx)("p",{children:"".concat(null==h?void 0:null===(r=h.errorId)||void 0===r?void 0:r.description," ").concat(v)}),!!(null!=h&&null!==(n=h.fromUrl)&&void 0!==n&&n.show)&&(0,f.jsx)("p",{children:"".concat(null==h?void 0:null===(o=h.fromUrl)||void 0===o?void 0:o.description," ").concat(P)}),y&&(0,f.jsx)(c.Z,{}),b]}))})},d)},4654:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSG:function(){return I},default:function(){return s}});var n=r(9499),o=r(5351),a=r(1163),c=r(2784),i=r(6142),l=r(2339),u=r(1197),p=r(5450),d=r(1023),b=r(5403),f=r(5430),j=r.n(f),h=r(9029),y=r(945),O=r(1080),v=r.n(O),P=r(9089),g=r(7921),w=r(7563),S=r(5152),m=r.n(S),_=r(3472),E=r(3638),x=r(4485),D=r(4439),Z=r(7641),K=r(1271);function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){(0,n.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var k=m()(()=>Promise.all([r.e(9161),r.e(84)]).then(r.bind(r,3620)).then(e=>e.OverriddenDefaultBannerText),{ssr:!1,loadableGenerated:{webpack:()=>[3620]}}),G=m()(()=>Promise.all([r.e(1770),r.e(218),r.e(9161),r.e(2858)]).then(r.bind(r,8545)),{ssr:!1,loadableGenerated:{webpack:()=>[8545]}}),N=m()(()=>Promise.all([r.e(1770),r.e(218),r.e(9704)]).then(r.bind(r,1482)).then(e=>e.OverriddenDefaultNewsletter),{ssr:!1,loadableGenerated:{webpack:()=>[1482]}}),W=m()(()=>Promise.all([r.e(3472),r.e(3506)]).then(r.bind(r,1171)).then(e=>e.OverriddenDefaultProductShelf),{ssr:!1,loadableGenerated:{webpack:()=>[1171]}}),C=m()(()=>r.e(7181).then(r.bind(r,9755)),{ssr:!1,loadableGenerated:{webpack:()=>[9755]}}),R=_objectSpread(_objectSpread(_objectSpread({},K.Z),{},{Breadcrumb:_.j,Hero:E.V,ProductGallery:x.f,BannerText:k,BannerNewsletter:G,Newsletter:N,ProductShelf:W,ProductTiles:C},Z.Z),D.Z),B=r(4960),T=r(7171),U=r(2322);function SearchPage_ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function SearchPage_objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?SearchPage_ownKeys(Object(r),!0).forEach(function(t){(0,n.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):SearchPage_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var SearchPage_SearchPage=function(e){var{page:{sections:t},data:r,globalSections:n}=e,{pages:o,useGalleryPage:a}=(0,T.Y_)(),c={data:SearchPage_objectSpread(SearchPage_objectSpread({},r),{},{pages:o})};return(0,U.jsx)(U.Fragment,{children:(0,U.jsx)(B.ZP,{context:c,children:(0,U.jsx)(T.Bj.Provider,{value:a,children:(0,U.jsx)(w.Z,{sections:t,globalSections:n,components:R})})})})};function SearchWrapper_ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function SearchWrapper_objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?SearchWrapper_ownKeys(Object(r),!0).forEach(function(t){(0,n.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):SearchWrapper_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function EmptySearch(){return(0,U.jsx)(P.Z,{className:"".concat(v().section," section-product-gallery"),children:(0,U.jsx)("section",{"data-testid":"product-gallery","data-fs-product-listing":!0,children:(0,U.jsx)(y.Z,{title:"",showLoader:!0})})})}function SearchWrapper(e){var t,r,n,o,{itemsPerPage:c,searchContentType:i,serverData:l,globalSections:u}=e,p=(0,a.useRouter)(),{state:{term:d,sort:b,selectedFacets:f},pages:j,resetInfiniteScroll:y}=(0,h.R)(),{data:O,isValidating:v}=(0,g.UO)({term:d,sort:b,itemsPerPage:c,selectedFacets:f});if(v||!O)return(0,U.jsx)(EmptySearch,{});if(null!=O&&null!==(t=O.redirect)&&void 0!==t&&t.url)return p.replace(null==O?void 0:null===(o=O.redirect)||void 0===o?void 0:o.url,null,{shallow:!0}),(0,U.jsx)(EmptySearch,{});var P=null==O?void 0:null===(r=O.search)||void 0===r?void 0:r.products,w=j.length,S=Math.ceil((null==P?void 0:null===(n=P.pageInfo)||void 0===n?void 0:n.totalCount)/c);return S>0&&S<w&&y(0),(0,U.jsx)(SearchPage_SearchPage,{page:i,data:SearchWrapper_objectSpread(SearchWrapper_objectSpread({},l),O),globalSections:u})}function s_ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s_objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s_ownKeys(Object(r),!0).forEach(function(t){(0,n.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var I=!0,useSearchParams=e=>{var{sort:t}=e,{asPath:r}=(0,a.useRouter)();return(0,c.useMemo)(()=>{var e=new URL(r,"http://localhost");t&&!e.searchParams.has("sort")&&e.searchParams.set("sort",t);var n=(0,i.Q)(e),o=(0,l.Z)(n).href;return(0,i.Q)(new URL(o))},[r,t])},s=function(e){var t,r,n,a,{page:c,globalSections:i}=e,{settings:l}=c,f=(0,b.j)(),h=useSearchParams({sort:null==l?void 0:null===(t=l.productGallery)||void 0===t?void 0:t.sortBySelection}),y="Search Results",{description:O,titleTemplate:v}=j().seo,P=null!==(r=null==l?void 0:null===(n=l.productGallery)||void 0===n?void 0:n.itemsPerPage)&&void 0!==r?r:d.g;return h?(0,U.jsxs)(u.z,s_objectSpread(s_objectSpread({onChange:f,itemsPerPage:P},h),{},{children:[(0,U.jsx)(o.PB,{noindex:!0,title:y,description:O,titleTemplate:v,openGraph:{type:"website",title:y,description:O}}),(0,U.jsx)(p.Z,{text:y}),(0,U.jsx)(SearchWrapper,{itemsPerPage:P,searchContentType:c,serverData:{title:y,searchTerm:null!==(a=h.term)&&void 0!==a?a:void 0},globalSections:i.sections})]})):null}},1343:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/s",function(){return r(4654)}])},8919:function(e){e.exports={section:"section_section__KG_b8",load:"section_load__DKeod"}}},function(e){e.O(0,[6941,7563,4501,9774,2888,179],function(){return e(e.s=1343)}),_N_E=e.O()}]);
|
package/.stylelintignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
src/styles/fonts.css
|
package/.vscode/settings.json
DELETED
package/stylelint.config.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: ['stylelint-config-standard-scss', 'stylelint-config-recess-order'],
|
|
3
|
-
|
|
4
|
-
plugins: ['stylelint-scss', 'stylelint-order'],
|
|
5
|
-
rules: {
|
|
6
|
-
'max-line-length': null,
|
|
7
|
-
'color-hex-length': null,
|
|
8
|
-
'number-leading-zero': null,
|
|
9
|
-
'selector-list-comma-newline-after': null,
|
|
10
|
-
'value-keyword-case': null,
|
|
11
|
-
'value-no-vendor-prefix': null,
|
|
12
|
-
'declaration-block-no-duplicate-properties': null,
|
|
13
|
-
'property-no-unknown': null,
|
|
14
|
-
'custom-property-empty-line-before': null,
|
|
15
|
-
'color-no-invalid-hex': true,
|
|
16
|
-
'font-family-no-duplicate-names': true,
|
|
17
|
-
'named-grid-areas-no-invalid': true,
|
|
18
|
-
'function-calc-no-unspaced-operator': true,
|
|
19
|
-
'function-linear-gradient-no-nonstandard-direction': true,
|
|
20
|
-
'string-no-newline': true,
|
|
21
|
-
'unit-no-unknown': true,
|
|
22
|
-
'custom-property-no-missing-var-function': true,
|
|
23
|
-
'keyframe-declaration-no-important': true,
|
|
24
|
-
'declaration-block-no-duplicate-custom-properties': true,
|
|
25
|
-
'declaration-block-no-shorthand-property-overrides': true,
|
|
26
|
-
'block-no-empty': true,
|
|
27
|
-
'selector-type-no-unknown': true,
|
|
28
|
-
'selector-pseudo-class-no-unknown': true,
|
|
29
|
-
'selector-pseudo-element-no-unknown': true,
|
|
30
|
-
'comment-no-empty': true,
|
|
31
|
-
'no-descending-specificity': null,
|
|
32
|
-
'no-invalid-position-at-import-rule': null,
|
|
33
|
-
'no-duplicate-at-import-rules': true,
|
|
34
|
-
'no-extra-semicolons': true,
|
|
35
|
-
'no-invalid-double-slash-comments': true,
|
|
36
|
-
'shorthand-property-no-redundant-values': true,
|
|
37
|
-
'declaration-no-important': true,
|
|
38
|
-
'declaration-block-single-line-max-declarations': 1,
|
|
39
|
-
'selector-max-empty-lines': 0,
|
|
40
|
-
'selector-max-universal': 1,
|
|
41
|
-
'no-unknown-animations': true,
|
|
42
|
-
'color-hex-case': 'lower',
|
|
43
|
-
'function-max-empty-lines': 0,
|
|
44
|
-
'function-name-case': 'lower',
|
|
45
|
-
'number-no-trailing-zeros': true,
|
|
46
|
-
'unit-case': 'lower',
|
|
47
|
-
'property-case': 'lower',
|
|
48
|
-
'value-list-max-empty-lines': 0,
|
|
49
|
-
'declaration-colon-space-after': 'always-single-line',
|
|
50
|
-
'declaration-colon-space-before': null,
|
|
51
|
-
'block-closing-brace-space-before': 'always-single-line',
|
|
52
|
-
'block-opening-brace-space-after': 'always-single-line',
|
|
53
|
-
'block-opening-brace-space-before': 'always',
|
|
54
|
-
'selector-attribute-brackets-space-inside': 'never',
|
|
55
|
-
'selector-combinator-space-after': 'always',
|
|
56
|
-
'selector-combinator-space-before': 'always',
|
|
57
|
-
'selector-pseudo-class-case': 'lower',
|
|
58
|
-
'selector-pseudo-element-case': 'lower',
|
|
59
|
-
'selector-type-case': 'lower',
|
|
60
|
-
'at-rule-name-case': 'lower',
|
|
61
|
-
'at-rule-semicolon-space-before': 'never',
|
|
62
|
-
'at-rule-empty-line-before': [
|
|
63
|
-
'always',
|
|
64
|
-
{
|
|
65
|
-
except: ['blockless-after-same-name-blockless', 'first-nested'],
|
|
66
|
-
ignore: ['after-comment'],
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
'scss/dollar-variable-colon-space-after': 'always',
|
|
70
|
-
'scss/dollar-variable-colon-space-before': 'never',
|
|
71
|
-
'scss/dollar-variable-pattern': /^[a-z-0-9]+$/,
|
|
72
|
-
'scss/double-slash-comment-whitespace-inside': 'always',
|
|
73
|
-
'scss/operator-no-newline-before': true,
|
|
74
|
-
'scss/operator-no-unspaced': true,
|
|
75
|
-
'scss/selector-no-redundant-nesting-selector': true,
|
|
76
|
-
'scss/at-rule-no-unknown': true,
|
|
77
|
-
'scss/at-import-partial-extension': null,
|
|
78
|
-
'scss/no-global-function-names': null,
|
|
79
|
-
'selector-class-pattern':
|
|
80
|
-
'^(?:(?:o|c|u|t|s|is|has|_|js|qa)-)?[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*(?:__[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:--[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:\\[.+\\])?$',
|
|
81
|
-
},
|
|
82
|
-
}
|
|
File without changes
|