@faststore/core 3.0.112 → 3.0.116
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 +32 -32
- 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/153.js +1 -1
- package/.next/server/chunks/24.js +1 -1
- package/.next/server/chunks/498.js +1 -1
- package/.next/server/chunks/646.js +2 -2
- package/.next/server/chunks/82.js +2 -2
- package/.next/server/chunks/933.js +1 -1
- package/.next/server/chunks/997.js +1 -1
- package/.next/server/middleware-build-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/_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/checkout.js +1 -1
- package/.next/server/pages/checkout.js.nft.json +1 -1
- package/.next/server/pages/en-US/404.html +2 -69
- package/.next/server/pages/en-US/404.json +1 -1
- package/.next/server/pages/en-US/500.html +2 -69
- package/.next/server/pages/en-US/500.json +1 -1
- package/.next/server/pages/en-US/account.html +2 -69
- package/.next/server/pages/en-US/account.json +1 -1
- package/.next/server/pages/en-US/checkout.html +2 -69
- package/.next/server/pages/en-US/checkout.json +1 -1
- package/.next/server/pages/en-US/login.html +2 -69
- package/.next/server/pages/en-US/login.json +1 -1
- package/.next/server/pages/en-US/s.html +2 -69
- package/.next/server/pages/en-US/s.json +1 -1
- package/.next/server/pages/en-US.html +3 -70
- package/.next/server/pages/en-US.json +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/KTDlBYjCu5WzIPGoRYTKn/_buildManifest.js +1 -0
- package/.next/static/chunks/{575-ae1d53677e78fd7b.js → 108-090729aea2c4ba4c.js} +2 -2
- package/.next/static/chunks/629-0cb613f9bcc4f486.js +1 -0
- package/.next/static/chunks/968-2833bd4b4774c583.js +1 -0
- package/.next/static/chunks/pages/{404-88e398da671e9a74.js → 404-3c76e2c43ca8dcd4.js} +1 -1
- package/.next/static/chunks/pages/{500-8460c80c5f08bb09.js → 500-1ad030e3adff740a.js} +1 -1
- package/.next/static/chunks/pages/[...slug]-dd7f247ab9486429.js +1 -0
- package/.next/static/chunks/pages/[slug]/p-e7077156f76f4cef.js +1 -0
- package/.next/static/chunks/pages/_app-5d553d859f2f0ef5.js +1 -0
- package/.next/static/chunks/pages/{account-2f8be1e9ff489677.js → account-e7b06039b653381d.js} +1 -1
- package/.next/static/chunks/pages/{checkout-0b95738bd7217e14.js → checkout-996d898a57d037a0.js} +1 -1
- package/.next/static/chunks/pages/index-d7ef84d142b53200.js +1 -0
- package/.next/static/chunks/pages/{login-0f8dfe5bdc54f8cc.js → login-b82e639bfe6d70ce.js} +1 -1
- package/.next/static/chunks/pages/s-5f2e23d107382a98.js +1 -0
- package/.next/trace +95 -95
- package/.turbo/turbo-build.log +16 -16
- package/.turbo/turbo-test.log +4 -4
- package/cypress/integration/a11y.test.js +17 -5
- package/cypress/integration/analytics.test.js +2 -2
- package/cypress/integration/seo.test.js +6 -3
- package/faststore.config.default.js +2 -2
- package/package.json +9 -11
- package/src/components/cms/GlobalSections.tsx +3 -3
- package/src/components/cms/RenderSections.tsx +2 -5
- package/src/components/common/Alert/Alert.tsx +1 -3
- package/src/components/common/Footer/Footer.tsx +7 -5
- package/src/components/common/Footer/FooterLinks.tsx +1 -1
- package/src/components/common/Footer/FooterSocial.tsx +10 -3
- package/src/components/navigation/Navbar/Navbar.tsx +1 -4
- package/src/components/navigation/NavbarLinks/NavbarLinks.tsx +1 -2
- package/src/components/navigation/NavbarSlider/NavbarSlider.tsx +1 -2
- package/src/components/sections/Incentives/Incentives.tsx +5 -3
- package/src/components/sections/ProductGallery/ProductGallery.tsx +2 -7
- package/src/components/ui/Incentives/Incentives.tsx +11 -5
- package/src/components/ui/ProductDetails/ProductDetailsSettings.tsx +1 -2
- package/src/pages/[...slug].tsx +1 -3
- package/src/pages/[slug]/p.tsx +1 -4
- package/src/pages/_app.tsx +0 -7
- package/src/pages/_document.tsx +9 -0
- package/src/pages/index.tsx +19 -23
- package/src/pages/s.tsx +1 -4
- package/.next/static/Zw3RRqpKiix9XheiagRJ4/_buildManifest.js +0 -1
- package/.next/static/chunks/629-2035a739f8a77882.js +0 -1
- package/.next/static/chunks/968-064430c7734aa0e9.js +0 -1
- package/.next/static/chunks/pages/[...slug]-8ccbcdddf41a0c95.js +0 -1
- package/.next/static/chunks/pages/[slug]/p-08757b2e058d168d.js +0 -1
- package/.next/static/chunks/pages/_app-aeb8a1c6bff23375.js +0 -68
- package/.next/static/chunks/pages/index-2ed543569f2d5886.js +0 -1
- package/.next/static/chunks/pages/s-b52ba3a76a5e2d94.js +0 -1
- package/cypress/integration/performance.test.js +0 -65
- package/src/sdk/tests/mark.tsx +0 -10
- /package/.next/static/{Zw3RRqpKiix9XheiagRJ4 → KTDlBYjCu5WzIPGoRYTKn}/_ssgManifest.js +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -45,27 +45,27 @@ Warning: Dynamic Content not found for the page: home. Refer to the Dynamic Cont
|
|
|
45
45
|
Collecting build traces ...
|
|
46
46
|
|
|
47
47
|
Route (pages) Size First Load JS
|
|
48
|
-
┌ ● / 1.
|
|
48
|
+
┌ ● / 1.24 kB 143 kB
|
|
49
49
|
├ └ css/197e314c5a03eabd.css 740 B
|
|
50
|
-
├ /_app 0 B
|
|
51
|
-
├ ● /[...slug] 2.
|
|
50
|
+
├ /_app 0 B 90.7 kB
|
|
51
|
+
├ ● /[...slug] 2.79 kB 155 kB
|
|
52
52
|
├ └ css/e47f1a002bdcf76f.css 2.38 kB
|
|
53
|
-
├ ● /[slug]/p 10.8 kB
|
|
53
|
+
├ ● /[slug]/p 10.8 kB 152 kB
|
|
54
54
|
├ └ css/fbd711b9f5abf105.css 9.57 kB
|
|
55
|
-
├ ○ /404 1.28 kB
|
|
56
|
-
├ ● /500 1.29 kB
|
|
57
|
-
├ ● /account 674 B
|
|
58
|
-
├ λ /api/graphql 0 B
|
|
59
|
-
├ λ /api/health/live 0 B
|
|
60
|
-
├ λ /api/health/ready 0 B
|
|
61
|
-
├ λ /api/preview 0 B
|
|
62
|
-
├ ● /checkout 660 B
|
|
63
|
-
├ ● /login 1.4 kB
|
|
64
|
-
└ ● /s 2.
|
|
65
|
-
+ First Load JS shared by all
|
|
55
|
+
├ ○ /404 1.28 kB 126 kB
|
|
56
|
+
├ ● /500 1.29 kB 126 kB
|
|
57
|
+
├ ● /account 674 B 126 kB
|
|
58
|
+
├ λ /api/graphql 0 B 90.7 kB
|
|
59
|
+
├ λ /api/health/live 0 B 90.7 kB
|
|
60
|
+
├ λ /api/health/ready 0 B 90.7 kB
|
|
61
|
+
├ λ /api/preview 0 B 90.7 kB
|
|
62
|
+
├ ● /checkout 660 B 126 kB
|
|
63
|
+
├ ● /login 1.4 kB 126 kB
|
|
64
|
+
└ ● /s 2.22 kB 154 kB
|
|
65
|
+
+ First Load JS shared by all 93.7 kB
|
|
66
66
|
├ chunks/framework-8e279965036b6169.js 45.4 kB
|
|
67
67
|
├ chunks/main-029f1328cfee9686.js 33.1 kB
|
|
68
|
-
├ chunks/pages/_app-
|
|
68
|
+
├ chunks/pages/_app-5d553d859f2f0ef5.js 9.85 kB
|
|
69
69
|
├ chunks/webpack-8883d8523b03e385.js 2.38 kB
|
|
70
70
|
└ css/ee0556daedda6306.css 3.07 kB
|
|
71
71
|
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
$ jest
|
|
2
|
-
PASS test/utils/multipleTemplates.test.ts (36.
|
|
3
|
-
PASS test/server/cms/index.test.ts (37.
|
|
4
|
-
PASS test/server/index.test.ts (
|
|
2
|
+
PASS test/utils/multipleTemplates.test.ts (36.656 s)
|
|
3
|
+
PASS test/server/cms/index.test.ts (37.261 s)
|
|
4
|
+
PASS test/server/index.test.ts (40.532 s)
|
|
5
5
|
|
|
6
6
|
Test Suites: 3 passed, 3 total
|
|
7
7
|
Tests: 19 passed, 19 total
|
|
8
8
|
Snapshots: 0 total
|
|
9
|
-
Time:
|
|
9
|
+
Time: 41.708 s
|
|
10
10
|
Ran all test suites.
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* Cypress tests for a11y (accessibility)
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { disabledA11yRules } from '../global'
|
|
8
7
|
import { cypress } from '../../faststore.config'
|
|
9
8
|
|
|
10
9
|
const { pages } = cypress
|
|
@@ -22,7 +21,12 @@ describe('Accessibility tests', () => {
|
|
|
22
21
|
cy.getById('product-link').should('exist')
|
|
23
22
|
|
|
24
23
|
cy.injectAxe()
|
|
25
|
-
|
|
24
|
+
|
|
25
|
+
cy.checkA11y(null, {
|
|
26
|
+
rules: {
|
|
27
|
+
'aria-allowed-role': { enabled: true },
|
|
28
|
+
},
|
|
29
|
+
})
|
|
26
30
|
})
|
|
27
31
|
|
|
28
32
|
it('checks a11y for product page', () => {
|
|
@@ -30,10 +34,14 @@ describe('Accessibility tests', () => {
|
|
|
30
34
|
cy.waitForHydration()
|
|
31
35
|
|
|
32
36
|
// Wait for product to be available and page to be interactive
|
|
33
|
-
cy.
|
|
37
|
+
cy.get('[data-testid="buy-button"]').should('exist')
|
|
34
38
|
|
|
35
39
|
cy.injectAxe()
|
|
36
|
-
cy.checkA11y(null,
|
|
40
|
+
cy.checkA11y(null, {
|
|
41
|
+
rules: {
|
|
42
|
+
'aria-allowed-role': { enabled: true },
|
|
43
|
+
},
|
|
44
|
+
})
|
|
37
45
|
})
|
|
38
46
|
|
|
39
47
|
it('checks a11y for home page', () => {
|
|
@@ -41,6 +49,10 @@ describe('Accessibility tests', () => {
|
|
|
41
49
|
cy.waitForHydration()
|
|
42
50
|
|
|
43
51
|
cy.injectAxe()
|
|
44
|
-
cy.checkA11y(null,
|
|
52
|
+
cy.checkA11y(null, {
|
|
53
|
+
rules: {
|
|
54
|
+
'aria-allowed-role': { enabled: true },
|
|
55
|
+
},
|
|
56
|
+
})
|
|
45
57
|
})
|
|
46
58
|
})
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Cypress tests for testing the Analytics module
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { options } from '../global'
|
|
8
7
|
import { cypress } from '../../faststore.config'
|
|
8
|
+
import { options } from '../global'
|
|
9
9
|
|
|
10
10
|
const { pages } = cypress
|
|
11
11
|
|
|
@@ -395,7 +395,7 @@ describe('view_cart event', () => {
|
|
|
395
395
|
({ event: eventName }) => eventName === 'view_cart'
|
|
396
396
|
)
|
|
397
397
|
|
|
398
|
-
expect(event.ecommerce.value).to.equal(
|
|
398
|
+
expect(event.ecommerce.value).to.equal(420)
|
|
399
399
|
expect(event.ecommerce.items.length).to.equal(1)
|
|
400
400
|
})
|
|
401
401
|
})
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* TODO: Improve structured data validaton by actually using schema.org's schemas
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { options } from '../global'
|
|
10
9
|
import { cypress, storeUrl } from '../../faststore.config'
|
|
10
|
+
import { options } from '../global'
|
|
11
11
|
|
|
12
12
|
const { pages } = cypress
|
|
13
13
|
|
|
@@ -88,10 +88,13 @@ describe('Product Page Seo', () => {
|
|
|
88
88
|
.should(($el) => {
|
|
89
89
|
expect($el.attr('content')).to.eq('index,follow')
|
|
90
90
|
})
|
|
91
|
+
|
|
91
92
|
cy.get('link[rel="canonical"]')
|
|
92
93
|
.should('exist')
|
|
93
|
-
.
|
|
94
|
-
|
|
94
|
+
.and(($link) => {
|
|
95
|
+
const href = $link.attr('href')
|
|
96
|
+
const regex = new RegExp(`^${href.split('/')[0]}`)
|
|
97
|
+
expect(`${storeUrl}${pages.pdp}`).to.match(regex)
|
|
95
98
|
})
|
|
96
99
|
})
|
|
97
100
|
|
|
@@ -67,7 +67,7 @@ module.exports = {
|
|
|
67
67
|
server: process.env.BASE_SITE_URL || 'http://localhost:3000',
|
|
68
68
|
pages: {
|
|
69
69
|
home: '/',
|
|
70
|
-
pdp: '/
|
|
70
|
+
pdp: '/4k-philips-monitor-99988213/p',
|
|
71
71
|
collection: '/office',
|
|
72
72
|
},
|
|
73
73
|
},
|
|
@@ -76,7 +76,7 @@ module.exports = {
|
|
|
76
76
|
cypress: {
|
|
77
77
|
pages: {
|
|
78
78
|
home: '/',
|
|
79
|
-
pdp: '/
|
|
79
|
+
pdp: '/4k-philips-monitor-99988213/p',
|
|
80
80
|
collection: '/office',
|
|
81
81
|
collection_2: '/technology',
|
|
82
82
|
collection_filtered:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.116",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "vtex/faststore",
|
|
6
6
|
"browserslist": "supports es6-module and not dead",
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"@envelop/graphql-jit": "^1.1.1",
|
|
44
44
|
"@envelop/parser-cache": "^2.2.0",
|
|
45
45
|
"@envelop/validation-cache": "^2.2.0",
|
|
46
|
-
"@faststore/api": "^3.0.
|
|
47
|
-
"@faststore/components": "^3.0.
|
|
48
|
-
"@faststore/graphql-utils": "^3.0.
|
|
49
|
-
"@faststore/lighthouse": "^3.0.
|
|
50
|
-
"@faststore/sdk": "^3.0.
|
|
51
|
-
"@faststore/ui": "^3.0.
|
|
46
|
+
"@faststore/api": "^3.0.116",
|
|
47
|
+
"@faststore/components": "^3.0.116",
|
|
48
|
+
"@faststore/graphql-utils": "^3.0.116",
|
|
49
|
+
"@faststore/lighthouse": "^3.0.116",
|
|
50
|
+
"@faststore/sdk": "^3.0.116",
|
|
51
|
+
"@faststore/ui": "^3.0.116",
|
|
52
52
|
"@graphql-codegen/cli": "^5.0.2",
|
|
53
53
|
"@graphql-codegen/client-preset": "^4.2.6",
|
|
54
54
|
"@graphql-codegen/typescript": "^4.0.7",
|
|
@@ -63,7 +63,6 @@
|
|
|
63
63
|
"@vtex/client-cms": "^0.2.12",
|
|
64
64
|
"@vtex/prettier-config": "1.0.0",
|
|
65
65
|
"autoprefixer": "^10.4.0",
|
|
66
|
-
"chalk": "^5.2.0",
|
|
67
66
|
"css-loader": "^6.7.1",
|
|
68
67
|
"deepmerge": "^4.3.1",
|
|
69
68
|
"draftjs-to-html": "^0.9.1",
|
|
@@ -72,7 +71,6 @@
|
|
|
72
71
|
"include-media": "^1.4.10",
|
|
73
72
|
"next": "^13.5.6",
|
|
74
73
|
"next-seo": "^6.4.0",
|
|
75
|
-
"nextjs-progressbar": "^0.0.14",
|
|
76
74
|
"postcss": "^8.4.4",
|
|
77
75
|
"prettier": "^2.2.0",
|
|
78
76
|
"react": "^18.2.0",
|
|
@@ -89,7 +87,7 @@
|
|
|
89
87
|
"devDependencies": {
|
|
90
88
|
"@cypress/code-coverage": "^3.12.1",
|
|
91
89
|
"@envelop/testing": "^6.0.0",
|
|
92
|
-
"@faststore/eslint-config": "^3.0.
|
|
90
|
+
"@faststore/eslint-config": "^3.0.116",
|
|
93
91
|
"@lhci/cli": "^0.9.0",
|
|
94
92
|
"@testing-library/cypress": "^10.0.1",
|
|
95
93
|
"@types/cypress": "^1.1.3",
|
|
@@ -130,5 +128,5 @@
|
|
|
130
128
|
"node": "18.19.0",
|
|
131
129
|
"yarn": "1.19.1"
|
|
132
130
|
},
|
|
133
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "944909c520a5f2d541354bce0b13b35e1ade9653"
|
|
134
132
|
}
|
|
@@ -56,7 +56,7 @@ export const getGlobalSectionsData = async (
|
|
|
56
56
|
const page = cmsData[GLOBAL_SECTIONS_CONTENT_TYPE][0]
|
|
57
57
|
|
|
58
58
|
if (page) {
|
|
59
|
-
const pageData =
|
|
59
|
+
const pageData = getPage<PageContentType>({
|
|
60
60
|
contentType: GLOBAL_SECTIONS_CONTENT_TYPE,
|
|
61
61
|
documentId: page.documentId,
|
|
62
62
|
versionId: page.versionId,
|
|
@@ -66,11 +66,11 @@ export const getGlobalSectionsData = async (
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
const
|
|
69
|
+
const pageData = getPage<PageContentType>({
|
|
70
70
|
...(previewData?.contentType === GLOBAL_SECTIONS_CONTENT_TYPE &&
|
|
71
71
|
previewData),
|
|
72
72
|
contentType: GLOBAL_SECTIONS_CONTENT_TYPE,
|
|
73
73
|
})
|
|
74
74
|
|
|
75
|
-
return
|
|
75
|
+
return pageData
|
|
76
76
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import chalk from 'chalk'
|
|
2
1
|
import { ComponentType, PropsWithChildren, memo, useMemo } from 'react'
|
|
3
2
|
|
|
4
3
|
import SectionBoundary from './SectionBoundary'
|
|
@@ -30,10 +29,8 @@ const RenderSectionsBase = ({ sections = [], components }: Props) => {
|
|
|
30
29
|
|
|
31
30
|
if (!Component) {
|
|
32
31
|
// TODO: add a documentation link to help to do this
|
|
33
|
-
console.
|
|
34
|
-
`${
|
|
35
|
-
'warn'
|
|
36
|
-
)} - ${name} not found. Add a new component for this section or remove it from the CMS`
|
|
32
|
+
console.warn(
|
|
33
|
+
`${name} not found. Add a new component for this section or remove it from the CMS`
|
|
37
34
|
)
|
|
38
35
|
|
|
39
36
|
return null
|
|
@@ -2,7 +2,6 @@ import type { PropsWithChildren, ReactNode } from 'react'
|
|
|
2
2
|
import { useCallback, useState } from 'react'
|
|
3
3
|
|
|
4
4
|
import { AlertProps as UIAlertProps } from '@faststore/ui'
|
|
5
|
-
import { mark } from 'src/sdk/tests/mark'
|
|
6
5
|
|
|
7
6
|
import Section from 'src/components/sections/Section/Section'
|
|
8
7
|
import styles from './section.module.scss'
|
|
@@ -50,5 +49,4 @@ function Alert({
|
|
|
50
49
|
)
|
|
51
50
|
}
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
export default mark(Alert)
|
|
52
|
+
export default Alert
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { ReactNode } from 'react'
|
|
2
|
-
import { mark } from 'src/sdk/tests/mark'
|
|
3
2
|
|
|
4
3
|
interface FooterProps {
|
|
5
4
|
children: ReactNode
|
|
6
5
|
}
|
|
7
6
|
|
|
8
7
|
export function FooterInfo({ children }: FooterProps) {
|
|
9
|
-
return
|
|
8
|
+
return (
|
|
9
|
+
<section data-fs-footer-info aria-label="Footer Information">
|
|
10
|
+
{children}
|
|
11
|
+
</section>
|
|
12
|
+
)
|
|
10
13
|
}
|
|
11
14
|
|
|
12
15
|
export function FooterNavigation({ children }: FooterProps) {
|
|
13
|
-
return <
|
|
16
|
+
return <section data-fs-footer-navigation>{children}</section>
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
export function Footer({ children }: FooterProps) {
|
|
@@ -26,5 +29,4 @@ export function Footer({ children }: FooterProps) {
|
|
|
26
29
|
)
|
|
27
30
|
}
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
export default mark(Footer)
|
|
32
|
+
export default Footer
|
|
@@ -67,7 +67,7 @@ function FooterLinks({ links }: FooterLinksProps) {
|
|
|
67
67
|
</div>
|
|
68
68
|
|
|
69
69
|
<div className="hidden-mobile">
|
|
70
|
-
<nav data-fs-footer-links-columns>
|
|
70
|
+
<nav data-fs-footer-links-columns aria-label="Footer Links Navigation">
|
|
71
71
|
{links.map(({ sectionTitle, items }) => (
|
|
72
72
|
<div key={sectionTitle}>
|
|
73
73
|
<p data-fs-footer-links-title>{sectionTitle}</p>
|
|
@@ -13,12 +13,19 @@ type FooterSocialLink = {
|
|
|
13
13
|
export interface FooterSocialProps {
|
|
14
14
|
title: string
|
|
15
15
|
links: FooterSocialLink[]
|
|
16
|
+
id?: string
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
function FooterSocial({
|
|
19
|
+
function FooterSocial({
|
|
20
|
+
title,
|
|
21
|
+
links,
|
|
22
|
+
id = 'footer-social-title',
|
|
23
|
+
}: FooterSocialProps) {
|
|
19
24
|
return (
|
|
20
|
-
<section data-fs-footer-social>
|
|
21
|
-
<p data-fs-footer-social-title
|
|
25
|
+
<section data-fs-footer-social aria-labelledby={id}>
|
|
26
|
+
<p data-fs-footer-social-title id={id}>
|
|
27
|
+
{title}
|
|
28
|
+
</p>
|
|
22
29
|
<UIList>
|
|
23
30
|
{links.map(({ icon: { icon }, url }) => (
|
|
24
31
|
<li key={icon}>
|
|
@@ -2,8 +2,6 @@ import { useRef, useState, useCallback } from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { useUI, useScrollDirection, Icon as UIIcon } from '@faststore/ui'
|
|
4
4
|
|
|
5
|
-
import { mark } from 'src/sdk/tests/mark'
|
|
6
|
-
|
|
7
5
|
import type { SearchInputRef } from 'src/components/search/SearchInput'
|
|
8
6
|
import SearchInput from 'src/components/search/SearchInput'
|
|
9
7
|
import NavbarLinks from 'src/components/navigation/NavbarLinks'
|
|
@@ -174,5 +172,4 @@ function Navbar({
|
|
|
174
172
|
)
|
|
175
173
|
}
|
|
176
174
|
|
|
177
|
-
|
|
178
|
-
export default mark(Navbar)
|
|
175
|
+
export default Navbar
|
|
@@ -7,7 +7,6 @@ import Link from 'src/components/ui/Link'
|
|
|
7
7
|
import RegionButton from 'src/components/region/RegionButton'
|
|
8
8
|
import type { NavbarProps } from 'src/components/navigation/Navbar'
|
|
9
9
|
|
|
10
|
-
import { mark } from 'src/sdk/tests/mark'
|
|
11
10
|
import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
|
|
12
11
|
|
|
13
12
|
interface NavbarLinksProps extends UINavbarLinksProps {
|
|
@@ -52,4 +51,4 @@ function NavbarLinks({
|
|
|
52
51
|
)
|
|
53
52
|
}
|
|
54
53
|
|
|
55
|
-
export default
|
|
54
|
+
export default NavbarLinks
|
|
@@ -5,7 +5,6 @@ import { ButtonSignInFallback } from 'src/components/ui/Button'
|
|
|
5
5
|
import Link from 'src/components/ui/Link'
|
|
6
6
|
import NavbarLinks from 'src/components/navigation/NavbarLinks'
|
|
7
7
|
import Logo from 'src/components/ui/Logo'
|
|
8
|
-
import { mark } from 'src/sdk/tests/mark'
|
|
9
8
|
|
|
10
9
|
import type { NavbarProps } from '../Navbar'
|
|
11
10
|
|
|
@@ -73,4 +72,4 @@ function NavbarSlider({
|
|
|
73
72
|
)
|
|
74
73
|
}
|
|
75
74
|
|
|
76
|
-
export default
|
|
75
|
+
export default NavbarSlider
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import UIIncentives from 'src/components/ui/Incentives/Incentives'
|
|
2
1
|
import type { Incentive } from 'src/components/ui/Incentives'
|
|
2
|
+
import UIIncentives from 'src/components/ui/Incentives/Incentives'
|
|
3
3
|
|
|
4
4
|
import Section from '../Section'
|
|
5
5
|
import styles from './section.module.scss'
|
|
6
6
|
|
|
7
7
|
interface Props {
|
|
8
8
|
incentives: Incentive[]
|
|
9
|
+
label?: string
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
function Incentives({ incentives }: Props) {
|
|
12
|
+
function Incentives({ incentives, label }: Props) {
|
|
12
13
|
return (
|
|
13
14
|
<Section className={`${styles.section} section-incentives layout__section`}>
|
|
14
|
-
|
|
15
|
+
{/* Leaving label as an empty string isn’t ideal, but it works for now. Ideally, we should receive a label from the CMS to identify which Incentive section we’re referring to. */}
|
|
16
|
+
<UIIncentives incentives={incentives} colored label={label ?? ''} />
|
|
15
17
|
</Section>
|
|
16
18
|
)
|
|
17
19
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { mark } from '../../../sdk/tests/mark'
|
|
2
|
-
|
|
3
1
|
import ProductGallery, {
|
|
4
2
|
ProductGalleryProps,
|
|
5
3
|
} from '../../ui/ProductGallery/ProductGallery'
|
|
@@ -70,11 +68,8 @@ function ProductGallerySection({
|
|
|
70
68
|
)
|
|
71
69
|
}
|
|
72
70
|
|
|
73
|
-
ProductGallerySection.displayName = 'ProductGallery'
|
|
74
|
-
const MarkedProductGallery = mark(ProductGallerySection)
|
|
75
|
-
|
|
76
71
|
const OverridableProductGallery = getOverridableSection<
|
|
77
|
-
typeof
|
|
78
|
-
>('ProductGallery',
|
|
72
|
+
typeof ProductGallerySection
|
|
73
|
+
>('ProductGallery', ProductGallerySection, ProductGalleryDefaultComponents)
|
|
79
74
|
|
|
80
75
|
export default OverridableProductGallery
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Icon as UIIcon,
|
|
3
|
-
List as UIList,
|
|
4
3
|
Incentive as UIIncentive,
|
|
4
|
+
List as UIList,
|
|
5
5
|
} from '@faststore/ui'
|
|
6
6
|
|
|
7
7
|
export type Incentive = {
|
|
@@ -22,18 +22,24 @@ export interface IncentivesProps {
|
|
|
22
22
|
* Controls the component's direction.
|
|
23
23
|
*/
|
|
24
24
|
variant?: 'horizontal' | 'vertical'
|
|
25
|
+
/**
|
|
26
|
+
* Label to identify the incentive list and offer better accessibility
|
|
27
|
+
*/
|
|
28
|
+
label?: string
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
function Incentives({
|
|
28
32
|
incentives,
|
|
29
33
|
variant = 'horizontal',
|
|
30
34
|
colored = false,
|
|
35
|
+
label,
|
|
31
36
|
}: IncentivesProps) {
|
|
32
37
|
return (
|
|
33
|
-
<
|
|
38
|
+
<section
|
|
34
39
|
data-fs-incentives
|
|
35
40
|
data-fs-incentives-colored={colored}
|
|
36
41
|
data-fs-incentives-variant={variant}
|
|
42
|
+
aria-label={`Incentives List ${label}`}
|
|
37
43
|
>
|
|
38
44
|
<UIList data-fs-content="incentives">
|
|
39
45
|
{incentives.map((incentive, index) => (
|
|
@@ -46,7 +52,7 @@ function Incentives({
|
|
|
46
52
|
width={32}
|
|
47
53
|
height={32}
|
|
48
54
|
/>
|
|
49
|
-
<
|
|
55
|
+
<section data-fs-incentive-content>
|
|
50
56
|
<p data-fs-incentive-title>{incentive.title}</p>
|
|
51
57
|
<span data-fs-incentive-description>
|
|
52
58
|
{incentive.firstLineText}
|
|
@@ -56,12 +62,12 @@ function Incentives({
|
|
|
56
62
|
{incentive.secondLineText}
|
|
57
63
|
</span>
|
|
58
64
|
)}
|
|
59
|
-
</
|
|
65
|
+
</section>
|
|
60
66
|
</UIIncentive>
|
|
61
67
|
</li>
|
|
62
68
|
))}
|
|
63
69
|
</UIList>
|
|
64
|
-
</
|
|
70
|
+
</section>
|
|
65
71
|
)
|
|
66
72
|
}
|
|
67
73
|
|
|
@@ -9,9 +9,8 @@ import { useFormattedPrice } from 'src/sdk/product/useFormattedPrice'
|
|
|
9
9
|
import Selectors from 'src/components/ui/SkuSelector'
|
|
10
10
|
import AddToCartLoadingSkeleton from './AddToCartLoadingSkeleton'
|
|
11
11
|
|
|
12
|
-
import { Icon as UIIcon, useUI } from '@faststore/ui'
|
|
12
|
+
import { Icon as UIIcon, Label as UILabel, useUI } from '@faststore/ui'
|
|
13
13
|
import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
|
|
14
|
-
import { Label as UILabel } from '@faststore/ui'
|
|
15
14
|
|
|
16
15
|
interface ProductDetailsSettingsProps {
|
|
17
16
|
product: ProductDetailsFragment_ProductFragment
|
package/src/pages/[...slug].tsx
CHANGED
|
@@ -7,7 +7,6 @@ import type {
|
|
|
7
7
|
ServerCollectionPageQueryQuery,
|
|
8
8
|
ServerCollectionPageQueryQueryVariables,
|
|
9
9
|
} from '@generated/graphql'
|
|
10
|
-
import { mark } from 'src/sdk/tests/mark'
|
|
11
10
|
import { execute } from 'src/server'
|
|
12
11
|
|
|
13
12
|
import { Locator } from '@vtex/client-cms'
|
|
@@ -150,5 +149,4 @@ export const getStaticPaths: GetStaticPaths = async () => {
|
|
|
150
149
|
}
|
|
151
150
|
}
|
|
152
151
|
|
|
153
|
-
|
|
154
|
-
export default mark(Page)
|
|
152
|
+
export default Page
|
package/src/pages/[slug]/p.tsx
CHANGED
|
@@ -22,7 +22,6 @@ import { OverriddenDefaultProductShelf as ProductShelf } from 'src/components/se
|
|
|
22
22
|
import ProductTiles from 'src/components/sections/ProductTiles'
|
|
23
23
|
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
24
24
|
import { useSession } from 'src/sdk/session'
|
|
25
|
-
import { mark } from 'src/sdk/tests/mark'
|
|
26
25
|
import { execute } from 'src/server'
|
|
27
26
|
|
|
28
27
|
import storeConfig from 'faststore.config'
|
|
@@ -274,6 +273,4 @@ export const getStaticPaths: GetStaticPaths = async () => {
|
|
|
274
273
|
}
|
|
275
274
|
}
|
|
276
275
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
export default mark(Page)
|
|
276
|
+
export default Page
|
package/src/pages/_app.tsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { UIProvider } from '@faststore/ui'
|
|
2
2
|
import type { AppProps } from 'next/app'
|
|
3
|
-
import NextNProgress from 'nextjs-progressbar'
|
|
4
3
|
import Layout from 'src/Layout'
|
|
5
4
|
import AnalyticsHandler from 'src/sdk/analytics'
|
|
6
5
|
import ErrorBoundary from 'src/sdk/error/ErrorBoundary'
|
|
@@ -15,12 +14,6 @@ import { DefaultSeo } from 'next-seo'
|
|
|
15
14
|
function App({ Component, pageProps }: AppProps) {
|
|
16
15
|
return (
|
|
17
16
|
<ErrorBoundary>
|
|
18
|
-
<NextNProgress
|
|
19
|
-
color="var(--fs-color-primary-bkg);"
|
|
20
|
-
showOnShallow={false}
|
|
21
|
-
options={{ showSpinner: false }}
|
|
22
|
-
/>
|
|
23
|
-
|
|
24
17
|
<DefaultSeo {...SEO} />
|
|
25
18
|
|
|
26
19
|
<AnalyticsHandler />
|
package/src/pages/_document.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Head, Html, Main, NextScript } from 'next/document'
|
|
2
|
+
import storeConfig from '../../faststore.config'
|
|
2
3
|
|
|
3
4
|
import ThirdPartyScripts from 'src/components/ThirdPartyScripts'
|
|
4
5
|
import { WebFonts } from 'src/customizations/src/GlobalOverrides'
|
|
@@ -7,6 +8,14 @@ function Document() {
|
|
|
7
8
|
return (
|
|
8
9
|
<Html>
|
|
9
10
|
<Head>
|
|
11
|
+
<link
|
|
12
|
+
rel="preconnect"
|
|
13
|
+
href={`https://${storeConfig.api.storeId}.vtexassets.com`}
|
|
14
|
+
/>
|
|
15
|
+
<link
|
|
16
|
+
rel="dns-prefetch"
|
|
17
|
+
href={`https://${storeConfig.api.storeId}.vtexassets.com`}
|
|
18
|
+
/>
|
|
10
19
|
{!process.env.DISABLE_3P_SCRIPTS && <ThirdPartyScripts />}
|
|
11
20
|
<WebFonts />
|
|
12
21
|
</Head>
|
package/src/pages/index.tsx
CHANGED
|
@@ -12,7 +12,6 @@ import { OverriddenDefaultNewsletter as Newsletter } from 'src/components/sectio
|
|
|
12
12
|
import { OverriddenDefaultProductShelf as ProductShelf } from 'src/components/sections/ProductShelf/OverriddenDefaultProductShelf'
|
|
13
13
|
import ProductTiles from 'src/components/sections/ProductTiles'
|
|
14
14
|
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
15
|
-
import { mark } from 'src/sdk/tests/mark'
|
|
16
15
|
import type { PageContentType } from 'src/server/cms'
|
|
17
16
|
import { getPage } from 'src/server/cms'
|
|
18
17
|
|
|
@@ -100,36 +99,33 @@ export const getStaticProps: GetStaticProps<
|
|
|
100
99
|
Record<string, string>,
|
|
101
100
|
Locator
|
|
102
101
|
> = async ({ previewData }) => {
|
|
103
|
-
const
|
|
104
|
-
const
|
|
102
|
+
const globalSectionsPromise = getGlobalSectionsData(previewData)
|
|
103
|
+
const serverDataPromise = getDynamicContent({ pageType: 'home' })
|
|
105
104
|
|
|
105
|
+
let cmsPage = null
|
|
106
106
|
if (storeConfig.cms.data) {
|
|
107
107
|
const cmsData = JSON.parse(storeConfig.cms.data)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
cmsPage = cmsData['home'][0]
|
|
109
|
+
}
|
|
110
|
+
const pagePromise = cmsPage
|
|
111
|
+
? getPage<PageContentType>({
|
|
112
112
|
contentType: 'home',
|
|
113
|
-
documentId:
|
|
114
|
-
versionId:
|
|
113
|
+
documentId: cmsPage.documentId,
|
|
114
|
+
versionId: cmsPage.versionId,
|
|
115
115
|
})
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
contentType: 'home',
|
|
126
|
-
})
|
|
116
|
+
: getPage<PageContentType>({
|
|
117
|
+
...(previewData?.contentType === 'home' && previewData),
|
|
118
|
+
contentType: 'home',
|
|
119
|
+
})
|
|
120
|
+
const [page, globalSections, serverData] = await Promise.all([
|
|
121
|
+
pagePromise,
|
|
122
|
+
globalSectionsPromise,
|
|
123
|
+
serverDataPromise,
|
|
124
|
+
])
|
|
127
125
|
|
|
128
126
|
return {
|
|
129
127
|
props: { page, globalSections, serverData },
|
|
130
128
|
}
|
|
131
129
|
}
|
|
132
130
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
export default mark(Page)
|
|
131
|
+
export default Page
|