@faststore/core 2.2.51 → 2.2.53
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 +48 -49
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/eslint/.cache_1gneedd +1 -1
- package/.next/cache/next-server.js.nft.json +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-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/350.js +1 -1
- package/.next/server/chunks/390.js +393 -453
- package/.next/server/chunks/74.js +432 -187
- package/.next/server/chunks/773.js +550 -0
- package/.next/server/chunks/{979.js → 890.js} +13 -113
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/[...slug].js +7 -7
- package/.next/server/pages/[...slug].js.nft.json +1 -1
- package/.next/server/pages/[slug]/p.js +5 -5
- package/.next/server/pages/[slug]/p.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/en-US/404.html +2 -2
- package/.next/server/pages/en-US/500.html +2 -2
- package/.next/server/pages/en-US/account.html +2 -2
- package/.next/server/pages/en-US/checkout.html +2 -2
- package/.next/server/pages/en-US/login.html +2 -2
- package/.next/server/pages/en-US/s.html +2 -2
- package/.next/server/pages/en-US.html +2 -2
- package/.next/server/pages/index.js +5 -5
- package/.next/server/pages/index.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/static/McclVBfxjOJEmRRYVXL7T/_buildManifest.js +1 -0
- package/.next/static/chunks/158-042441a60c3b4b56.js +1 -0
- package/.next/static/chunks/290-383e1d36f83c367d.js +1 -0
- package/.next/static/chunks/pages/{404-2240f0b22db2d370.js → 404-7710903c2a59fa6e.js} +1 -1
- package/.next/static/chunks/pages/{500-c0580e3299329874.js → 500-88a231e61179db83.js} +1 -1
- package/.next/static/chunks/pages/[...slug]-9b20bb8274fe7854.js +1 -0
- package/.next/static/chunks/pages/[slug]/{p-e1df08570f34a0d8.js → p-0ef7dd71888c199e.js} +1 -1
- package/.next/static/chunks/pages/{account-b35bcbef719765f3.js → account-f163e14670372c05.js} +1 -1
- package/.next/static/chunks/pages/{checkout-55bd56ade4408cbe.js → checkout-cf498a32e110bde8.js} +1 -1
- package/.next/static/chunks/pages/index-1cfe3afbd6564f45.js +1 -0
- package/.next/static/chunks/pages/{login-3f94bff1503b4fdc.js → login-707636c85f23cac6.js} +1 -1
- package/.next/static/chunks/pages/{s-8575d9c5780684d0.js → s-0bfcfd0d40841dcf.js} +1 -1
- package/.next/static/chunks/webpack-ba86ae9a63f61805.js +1 -0
- package/.next/static/css/14c11109f82a6f9a.css +1 -0
- package/.next/static/css/4e42cc999ad62b57.css +1 -0
- package/.next/static/css/d456bfc64bc489a2.css +1 -0
- package/.next/static/css/e337ce16f77f08a7.css +1 -0
- package/.next/trace +81 -80
- package/.turbo/turbo-build.log +12 -11
- package/.turbo/turbo-test.log +9 -9
- package/package.json +9 -9
- package/src/components/sections/BannerNewsletter/BannerNewsletter.tsx +2 -1
- package/src/components/sections/BannerText/BannerText.tsx +16 -16
- package/src/components/sections/BannerText/DefaultComponents.ts +9 -0
- package/src/components/sections/BannerText/OverriddenDefaultBannerText.ts +12 -0
- package/src/components/sections/Hero/DefaultComponents.ts +11 -0
- package/src/components/sections/Hero/Hero.tsx +12 -9
- package/src/components/sections/Hero/OverriddenDefaultHero.ts +12 -0
- package/src/components/templates/LandingPage/LandingPage.tsx +2 -2
- package/src/components/templates/ProductListingPage/ProductListing.tsx +1 -1
- package/src/pages/[slug]/p.tsx +1 -1
- package/src/pages/index.tsx +2 -2
- package/src/sdk/overrides/getOverriddenSection.tsx +5 -3
- package/src/sdk/overrides/sections.tsx +8 -0
- package/src/typings/overrides.ts +1 -1
- package/.next/server/chunks/398.js +0 -611
- package/.next/static/EcMI9hKhWC_hpCOHJZCZc/_buildManifest.js +0 -1
- package/.next/static/chunks/469-1925f9bd1c82e92b.js +0 -1
- package/.next/static/chunks/783-fbcb7a3216c40744.js +0 -1
- package/.next/static/chunks/pages/[...slug]-92810abb37fa7bda.js +0 -1
- package/.next/static/chunks/pages/index-2506749e45c335bf.js +0 -1
- package/.next/static/chunks/webpack-86d49ac4b093b8cf.js +0 -1
- package/.next/static/css/29868543c76bc6fd.css +0 -1
- package/.next/static/css/527e334fa69cf40a.css +0 -1
- package/.next/static/css/a2eefb25a4608343.css +0 -1
- package/.next/static/css/dfbdb0f27fd64782.css +0 -1
- package/src/components/sections/BannerText/Overrides.tsx +0 -18
- package/src/components/sections/Hero/Overrides.tsx +0 -20
- /package/.next/static/{EcMI9hKhWC_hpCOHJZCZc → McclVBfxjOJEmRRYVXL7T}/_ssgManifest.js +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
$ yarn partytown & yarn generate && next build
|
|
2
2
|
$ partytown copylib ./public/~partytown
|
|
3
|
-
$ faststore generate-graphql -c
|
|
4
3
|
Partytown lib copied to: /home/runner/work/faststore/faststore/packages/core/public/~partytown
|
|
4
|
+
$ faststore generate-graphql -c
|
|
5
5
|
success - GraphQL schema, types, and optimizations successfully generated 🎉
|
|
6
6
|
warn - You have enabled experimental feature (scrollRestoration) in next.config.js.
|
|
7
7
|
warn - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.
|
|
@@ -38,27 +38,28 @@ info - Generating static pages (7/7)
|
|
|
38
38
|
info - Finalizing page optimization...
|
|
39
39
|
|
|
40
40
|
Route (pages) Size First Load JS
|
|
41
|
-
┌ ● /
|
|
41
|
+
┌ ● / 2.42 kB 128 kB
|
|
42
|
+
├ └ css/d456bfc64bc489a2.css 5.47 kB
|
|
42
43
|
├ /_app 0 B 83.8 kB
|
|
43
|
-
├ ● /[...slug]
|
|
44
|
-
├ └ css/
|
|
44
|
+
├ ● /[...slug] 3.56 kB 140 kB
|
|
45
|
+
├ └ css/4e42cc999ad62b57.css 5.9 kB
|
|
45
46
|
├ ● /[slug]/p 10.9 kB 136 kB
|
|
46
47
|
├ └ css/d7bbfbd552f407e9.css 11.3 kB
|
|
47
|
-
├ ○ /404 1.19 kB
|
|
48
|
-
├ ● /500 1.21 kB
|
|
49
|
-
├ ● /account
|
|
48
|
+
├ ○ /404 1.19 kB 113 kB
|
|
49
|
+
├ ● /500 1.21 kB 113 kB
|
|
50
|
+
├ ● /account 677 B 112 kB
|
|
50
51
|
├ λ /api/graphql 0 B 83.8 kB
|
|
51
52
|
├ λ /api/health/live 0 B 83.8 kB
|
|
52
53
|
├ λ /api/health/ready 0 B 83.8 kB
|
|
53
54
|
├ λ /api/preview 0 B 83.8 kB
|
|
54
|
-
├ ● /checkout 661 B
|
|
55
|
-
├ ● /login 1.14 kB
|
|
56
|
-
└ ● /s 4.57 kB
|
|
55
|
+
├ ● /checkout 661 B 112 kB
|
|
56
|
+
├ ● /login 1.14 kB 113 kB
|
|
57
|
+
└ ● /s 4.57 kB 127 kB
|
|
57
58
|
+ First Load JS shared by all 86.8 kB
|
|
58
59
|
├ chunks/framework-dfd14d7ce6600b03.js 45.3 kB
|
|
59
60
|
├ chunks/main-e4e873ee741162eb.js 24.2 kB
|
|
60
61
|
├ chunks/pages/_app-30b9666307e4b3b1.js 12.1 kB
|
|
61
|
-
├ chunks/webpack-
|
|
62
|
+
├ chunks/webpack-ba86ae9a63f61805.js 2.25 kB
|
|
62
63
|
└ css/5d1f64b61ea581f4.css 3.05 kB
|
|
63
64
|
|
|
64
65
|
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
$ jest
|
|
2
|
-
PASS test/server/index.test.ts (
|
|
2
|
+
PASS test/server/index.test.ts (21.683 s)
|
|
3
3
|
FastStore GraphQL Layer
|
|
4
4
|
@faststore/api
|
|
5
|
-
✓ should return a valid GraphQL schema (
|
|
6
|
-
✓ should return a valid GraphQL schema contain all expected types (
|
|
5
|
+
✓ should return a valid GraphQL schema (38 ms)
|
|
6
|
+
✓ should return a valid GraphQL schema contain all expected types (13 ms)
|
|
7
7
|
✓ should return a valid GraphQL schema contain all expected queries (1 ms)
|
|
8
8
|
✓ should return a valid GraphQL schema contain all expected mutations
|
|
9
9
|
VTEX API Extension
|
|
10
|
-
✓ getTypeDefsFromFolder function should return an Array (
|
|
10
|
+
✓ getTypeDefsFromFolder function should return an Array (20 ms)
|
|
11
11
|
Third Party API Extension
|
|
12
|
-
✓ getTypeDefsFromFolder function should return an Array (
|
|
12
|
+
✓ getTypeDefsFromFolder function should return an Array (7 ms)
|
|
13
13
|
Final Schema after merging
|
|
14
|
-
✓ should return a valid merged GraphQL schema (
|
|
14
|
+
✓ should return a valid merged GraphQL schema (84 ms)
|
|
15
15
|
Envelop
|
|
16
|
-
✓ should exist with its plugins (
|
|
17
|
-
✓ should handle options and execute (
|
|
16
|
+
✓ should exist with its plugins (74 ms)
|
|
17
|
+
✓ should handle options and execute (333 ms)
|
|
18
18
|
|
|
19
19
|
Test Suites: 1 passed, 1 total
|
|
20
20
|
Tests: 9 passed, 9 total
|
|
21
21
|
Snapshots: 0 total
|
|
22
|
-
Time: 21.
|
|
22
|
+
Time: 21.826 s
|
|
23
23
|
Ran all test suites.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.53",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "vtex/faststore",
|
|
6
6
|
"browserslist": "supports es6-module and not dead",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"@envelop/graphql-jit": "^1.1.1",
|
|
38
38
|
"@envelop/parser-cache": "^2.2.0",
|
|
39
39
|
"@envelop/validation-cache": "^2.2.0",
|
|
40
|
-
"@faststore/api": "^2.2.
|
|
41
|
-
"@faststore/components": "^2.2.
|
|
42
|
-
"@faststore/graphql-utils": "^2.2.
|
|
43
|
-
"@faststore/sdk": "^2.2.
|
|
44
|
-
"@faststore/ui": "^2.2.
|
|
40
|
+
"@faststore/api": "^2.2.52",
|
|
41
|
+
"@faststore/components": "^2.2.52",
|
|
42
|
+
"@faststore/graphql-utils": "^2.2.52",
|
|
43
|
+
"@faststore/sdk": "^2.2.52",
|
|
44
|
+
"@faststore/ui": "^2.2.52",
|
|
45
45
|
"@graphql-codegen/cli": "^3.3.1",
|
|
46
46
|
"@graphql-codegen/typescript": "^3.0.4",
|
|
47
47
|
"@graphql-codegen/typescript-operations": "^3.0.4",
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@cypress/code-coverage": "^3.12.1",
|
|
80
80
|
"@envelop/testing": "^6.0.0",
|
|
81
|
-
"@faststore/cli": "^2.2.
|
|
82
|
-
"@faststore/eslint-config": "^2.2.
|
|
81
|
+
"@faststore/cli": "^2.2.52",
|
|
82
|
+
"@faststore/eslint-config": "^2.2.52",
|
|
83
83
|
"@faststore/lighthouse": "^1.12.32",
|
|
84
84
|
"@lhci/cli": "^0.9.0",
|
|
85
85
|
"@testing-library/cypress": "^10.0.1",
|
|
@@ -123,5 +123,5 @@
|
|
|
123
123
|
"node": "18.19.0",
|
|
124
124
|
"yarn": "1.19.1"
|
|
125
125
|
},
|
|
126
|
-
"gitHead": "
|
|
126
|
+
"gitHead": "03d9d8f9a33f655c137c03f3a6991a94c713bd47"
|
|
127
127
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { BannerTextProps } from 'src/components/sections/BannerText'
|
|
2
|
+
import { OverriddenDefaultBannerText as BannerText } from 'src/components/sections/BannerText/OverriddenDefaultBannerText'
|
|
2
3
|
import Newsletter, { NewsletterProps } from 'src/components/sections/Newsletter'
|
|
3
4
|
import Section from '../Section'
|
|
4
5
|
import styles from './section.module.scss'
|
|
@@ -3,10 +3,7 @@ import {
|
|
|
3
3
|
BannerTextContentProps as UIBannerTextContentProps,
|
|
4
4
|
} from '@faststore/ui'
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
BannerText as BannerTextWrapper,
|
|
8
|
-
BannerTextContent,
|
|
9
|
-
} from 'src/components/sections/BannerText/Overrides'
|
|
6
|
+
import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
|
|
10
7
|
import Section from '../Section'
|
|
11
8
|
|
|
12
9
|
import styles from './section.module.scss'
|
|
@@ -27,29 +24,32 @@ export interface BannerTextProps {
|
|
|
27
24
|
function BannerText({
|
|
28
25
|
title,
|
|
29
26
|
caption,
|
|
30
|
-
link: {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
linkTargetBlank: linkTargetBlank = BannerTextContent.props.linkTargetBlank,
|
|
34
|
-
},
|
|
35
|
-
variant = BannerTextWrapper.props.variant ?? 'primary',
|
|
36
|
-
colorVariant = BannerTextWrapper.props.colorVariant ?? 'main',
|
|
27
|
+
link: { url: linkUrl, text: linkText, linkTargetBlank },
|
|
28
|
+
variant,
|
|
29
|
+
colorVariant,
|
|
37
30
|
}: BannerTextProps) {
|
|
31
|
+
const { BannerText: BannerTextWrapper, BannerTextContent } =
|
|
32
|
+
useOverrideComponents<'BannerText'>()
|
|
33
|
+
|
|
38
34
|
return (
|
|
39
35
|
<Section className={`${styles.section} section-banner layout__section`}>
|
|
40
36
|
<div className="layout__content">
|
|
41
37
|
<BannerTextWrapper.Component
|
|
42
38
|
{...BannerTextWrapper.props}
|
|
43
|
-
variant={variant}
|
|
44
|
-
colorVariant={
|
|
39
|
+
variant={variant ?? BannerTextWrapper.props.variant ?? 'primary'}
|
|
40
|
+
colorVariant={
|
|
41
|
+
colorVariant ?? BannerTextWrapper.props.colorVariant ?? 'main'
|
|
42
|
+
}
|
|
45
43
|
>
|
|
46
44
|
<BannerTextContent.Component
|
|
47
45
|
{...BannerTextContent.props}
|
|
48
46
|
title={title}
|
|
49
47
|
caption={caption}
|
|
50
|
-
link={linkUrl}
|
|
51
|
-
linkText={linkText}
|
|
52
|
-
linkTargetBlank={
|
|
48
|
+
link={linkUrl ?? BannerTextContent.props.link}
|
|
49
|
+
linkText={linkText ?? BannerTextContent.props.linkText}
|
|
50
|
+
linkTargetBlank={
|
|
51
|
+
linkTargetBlank ?? BannerTextContent.props.linkTargetBlank
|
|
52
|
+
}
|
|
53
53
|
/>
|
|
54
54
|
</BannerTextWrapper.Component>
|
|
55
55
|
</div>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { override } from 'src/customizations/src/components/overrides/BannerText'
|
|
2
|
+
import { getOverriddenSection } from 'src/sdk/overrides/getOverriddenSection'
|
|
3
|
+
import type { SectionOverrideDefinition } from 'src/typings/overridesDefinition'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* This component exists to support overrides 1.0
|
|
7
|
+
*
|
|
8
|
+
* This allows users to override the default BannerText section present in the Headless CMS
|
|
9
|
+
*/
|
|
10
|
+
export const OverriddenDefaultBannerText = getOverriddenSection(
|
|
11
|
+
override as SectionOverrideDefinition<'BannerText'>
|
|
12
|
+
)
|
|
@@ -4,11 +4,8 @@ import {
|
|
|
4
4
|
} from '@faststore/ui'
|
|
5
5
|
import { ReactNode } from 'react'
|
|
6
6
|
import { Image } from 'src/components/ui/Image'
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
HeroImage,
|
|
10
|
-
HeroHeader,
|
|
11
|
-
} from 'src/components/sections/Hero/Overrides'
|
|
7
|
+
|
|
8
|
+
import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
|
|
12
9
|
|
|
13
10
|
import Section from '../Section'
|
|
14
11
|
|
|
@@ -36,16 +33,22 @@ const Hero = ({
|
|
|
36
33
|
title,
|
|
37
34
|
subtitle,
|
|
38
35
|
image,
|
|
39
|
-
variant
|
|
40
|
-
colorVariant
|
|
36
|
+
variant,
|
|
37
|
+
colorVariant,
|
|
41
38
|
icon,
|
|
42
39
|
}: HeroProps) => {
|
|
40
|
+
const {
|
|
41
|
+
Hero: HeroWrapper,
|
|
42
|
+
HeroImage,
|
|
43
|
+
HeroHeader,
|
|
44
|
+
} = useOverrideComponents<'Hero'>()
|
|
45
|
+
|
|
43
46
|
return (
|
|
44
47
|
<Section className={`${styles.section} section-hero`}>
|
|
45
48
|
<HeroWrapper.Component
|
|
46
49
|
{...HeroWrapper.props}
|
|
47
|
-
variant={variant}
|
|
48
|
-
colorVariant={colorVariant}
|
|
50
|
+
variant={variant ?? HeroWrapper.props.variant ?? 'primary'}
|
|
51
|
+
colorVariant={colorVariant ?? HeroWrapper.props.colorVariant ?? 'main'}
|
|
49
52
|
>
|
|
50
53
|
<HeroImage.Component {...HeroImage.props}>
|
|
51
54
|
<Image
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { override } from 'src/customizations/src/components/overrides/Hero'
|
|
2
|
+
import { getOverriddenSection } from 'src/sdk/overrides/getOverriddenSection'
|
|
3
|
+
import type { SectionOverrideDefinition } from 'src/typings/overridesDefinition'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* This component exists to support overrides 1.0
|
|
7
|
+
*
|
|
8
|
+
* This allows users to override the default Hero section present in the Headless CMS
|
|
9
|
+
*/
|
|
10
|
+
export const OverriddenDefaultHero = getOverriddenSection(
|
|
11
|
+
override as SectionOverrideDefinition<'Hero'>
|
|
12
|
+
)
|
|
@@ -4,11 +4,11 @@ import type { Locator } from '@vtex/client-cms'
|
|
|
4
4
|
|
|
5
5
|
import MissingContentError from 'src/sdk/error/MissingContentError/MissingContentError'
|
|
6
6
|
import RenderSections from 'src/components/cms/RenderSections'
|
|
7
|
-
import Hero from 'src/components/sections/Hero'
|
|
7
|
+
import { OverriddenDefaultHero as Hero } from 'src/components/sections/Hero/OverriddenDefaultHero'
|
|
8
8
|
import Incentives from 'src/components/sections/Incentives'
|
|
9
9
|
import ProductShelf from 'src/components/sections/ProductShelf'
|
|
10
10
|
import ProductTiles from 'src/components/sections/ProductTiles'
|
|
11
|
-
import BannerText from 'src/components/sections/BannerText'
|
|
11
|
+
import { OverriddenDefaultBannerText as BannerText } from 'src/components/sections/BannerText/OverriddenDefaultBannerText'
|
|
12
12
|
import Newsletter from 'src/components/sections/Newsletter'
|
|
13
13
|
import { getPage } from 'src/server/cms'
|
|
14
14
|
import type { PageContentType } from 'src/server/cms'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ServerCollectionPageQueryQuery } from '@generated/graphql'
|
|
2
2
|
import Breadcrumb from 'src/components/sections/Breadcrumb'
|
|
3
|
-
import Hero from 'src/components/sections/Hero'
|
|
3
|
+
import { OverriddenDefaultHero as Hero } from 'src/components/sections/Hero/OverriddenDefaultHero'
|
|
4
4
|
import ProductGallery from 'src/components/sections/ProductGallery'
|
|
5
5
|
import ProductShelf from 'src/components/sections/ProductShelf'
|
|
6
6
|
import ScrollToTopButton from 'src/components/sections/ScrollToTopButton'
|
package/src/pages/[slug]/p.tsx
CHANGED
|
@@ -12,7 +12,7 @@ import type {
|
|
|
12
12
|
} from '@generated/graphql'
|
|
13
13
|
import RenderSections from 'src/components/cms/RenderSections'
|
|
14
14
|
import BannerNewsletter from 'src/components/sections/BannerNewsletter/BannerNewsletter'
|
|
15
|
-
import BannerText from 'src/components/sections/BannerText'
|
|
15
|
+
import { OverriddenDefaultBannerText as BannerText } from 'src/components/sections/BannerText/OverriddenDefaultBannerText'
|
|
16
16
|
import Breadcrumb from 'src/components/sections/Breadcrumb'
|
|
17
17
|
import CrossSellingShelf from 'src/components/sections/CrossSellingShelf'
|
|
18
18
|
import ProductDetails from 'src/components/sections/ProductDetails'
|
package/src/pages/index.tsx
CHANGED
|
@@ -4,8 +4,8 @@ import { NextSeo, SiteLinksSearchBoxJsonLd } from 'next-seo'
|
|
|
4
4
|
import type { ComponentType } from 'react'
|
|
5
5
|
|
|
6
6
|
import RenderSections from 'src/components/cms/RenderSections'
|
|
7
|
-
import BannerText from 'src/components/sections/BannerText'
|
|
8
|
-
import Hero from 'src/components/sections/Hero'
|
|
7
|
+
import { OverriddenDefaultBannerText as BannerText } from 'src/components/sections/BannerText/OverriddenDefaultBannerText'
|
|
8
|
+
import { OverriddenDefaultHero as Hero } from 'src/components/sections/Hero/OverriddenDefaultHero'
|
|
9
9
|
import Incentives from 'src/components/sections/Incentives'
|
|
10
10
|
import Newsletter from 'src/components/sections/Newsletter'
|
|
11
11
|
import ProductShelf from 'src/components/sections/ProductShelf'
|
|
@@ -21,8 +21,7 @@ function createOverriddenSection<
|
|
|
21
21
|
sectionOverrides,
|
|
22
22
|
className,
|
|
23
23
|
}: {
|
|
24
|
-
|
|
25
|
-
Section: ComponentType<ComponentProps<(typeof Sections)[SectionName]>>
|
|
24
|
+
Section: (typeof Sections)[SectionName]
|
|
26
25
|
sectionOverrides: OverriddenComponents<SectionName>
|
|
27
26
|
className?: string
|
|
28
27
|
}) {
|
|
@@ -31,9 +30,12 @@ function createOverriddenSection<
|
|
|
31
30
|
return function OverriddenSection(
|
|
32
31
|
props: React.ComponentProps<typeof Section>
|
|
33
32
|
) {
|
|
33
|
+
/** This type wizardry is here because the props won't behave correctly if nothing is done */
|
|
34
|
+
const SectionComponent = Section as ComponentType<typeof props>
|
|
35
|
+
|
|
34
36
|
return (
|
|
35
37
|
<OverrideProvider value={overrideContextValue}>
|
|
36
|
-
<
|
|
38
|
+
<SectionComponent {...props} />
|
|
37
39
|
</OverrideProvider>
|
|
38
40
|
)
|
|
39
41
|
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import Alert from '../../components/sections/Alert'
|
|
2
|
+
import Hero from '../../components/sections/Hero'
|
|
3
|
+
import BannerText from '../../components/sections/BannerText'
|
|
2
4
|
|
|
3
5
|
import type { DefaultSectionComponentsDefinitions } from '../../typings/overridesDefinition'
|
|
4
6
|
import type { SectionsOverrides } from '../../typings/overrides'
|
|
5
7
|
import { AlertDefaultComponents } from '../../components/sections/Alert/DefaultComponents'
|
|
8
|
+
import { HeroDefaultComponents } from '../../components/sections/Hero/DefaultComponents'
|
|
9
|
+
import { BannerTextDefaultComponents } from '../../components/sections/BannerText/DefaultComponents'
|
|
6
10
|
|
|
7
11
|
export const Sections = {
|
|
8
12
|
Alert,
|
|
13
|
+
Hero,
|
|
14
|
+
BannerText,
|
|
9
15
|
}
|
|
10
16
|
|
|
11
17
|
export const DefaultComponents: Partial<
|
|
@@ -15,4 +21,6 @@ export const DefaultComponents: Partial<
|
|
|
15
21
|
>
|
|
16
22
|
> = {
|
|
17
23
|
Alert: AlertDefaultComponents,
|
|
24
|
+
Hero: HeroDefaultComponents,
|
|
25
|
+
BannerText: BannerTextDefaultComponents,
|
|
18
26
|
}
|
package/src/typings/overrides.ts
CHANGED
|
@@ -47,7 +47,7 @@ export type SectionOverride = {
|
|
|
47
47
|
}[keyof SectionsOverrides]
|
|
48
48
|
|
|
49
49
|
/** TODO: every use of this type should be replaced by SectionsOverrides after all sections are supported */
|
|
50
|
-
export type SupportedSectionsOverridesV2 = Pick<SectionsOverrides, 'Alert'>
|
|
50
|
+
export type SupportedSectionsOverridesV2 = Pick<SectionsOverrides, 'Alert' | 'Hero' | 'BannerText'>
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* Originally, these types were defined in their respective Overrides file
|