@faststore/core 2.2.52 → 2.2.54
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 +54 -60
- 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/prerender-manifest.json +1 -1
- package/.next/react-loadable-manifest.json +3 -3
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/350.js +1 -1
- package/.next/server/chunks/390.js +453 -393
- package/.next/server/chunks/520.js +491 -0
- package/.next/server/chunks/732.js +1 -1
- package/.next/server/chunks/74.js +2081 -494
- package/.next/server/chunks/796.js +495 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/404.js +14 -0
- package/.next/server/pages/404.js.nft.json +1 -1
- package/.next/server/pages/500.js +14 -0
- package/.next/server/pages/500.js.nft.json +1 -1
- package/.next/server/pages/[...slug].js +13 -13
- package/.next/server/pages/[...slug].js.nft.json +1 -1
- package/.next/server/pages/[slug]/p.js +9 -9
- package/.next/server/pages/[slug]/p.js.nft.json +1 -1
- package/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/server/pages/account.js +14 -0
- package/.next/server/pages/account.js.nft.json +1 -1
- package/.next/server/pages/api/graphql.js +1 -1
- package/.next/server/pages/checkout.js +14 -0
- package/.next/server/pages/checkout.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 +8 -8
- package/.next/server/pages/index.js.nft.json +1 -1
- package/.next/server/pages/login.js +14 -0
- package/.next/server/pages/login.js.nft.json +1 -1
- package/.next/server/pages/s.js +8 -1
- package/.next/server/pages/s.js.nft.json +1 -1
- package/.next/static/H_kSoqYPjjK2sM3cxP_pS/_buildManifest.js +1 -0
- package/.next/static/chunks/158-02891d5ee60b505c.js +1 -0
- package/.next/static/chunks/251.98f500dd8ba008ae.js +1 -0
- package/.next/static/chunks/497-176c5263d6378afc.js +1 -0
- package/.next/static/chunks/585.92188327fc30a684.js +1 -0
- package/.next/static/chunks/800.ea75aa39e939d9af.js +1 -0
- package/.next/static/chunks/897-b07932d813bb7dac.js +1 -0
- package/.next/static/chunks/pages/{404-7710903c2a59fa6e.js → 404-0bacd82dcf801c94.js} +1 -1
- package/.next/static/chunks/pages/{500-88a231e61179db83.js → 500-4dceb834e001d990.js} +1 -1
- package/.next/static/chunks/pages/[...slug]-0765ca2a2572ab9e.js +1 -0
- package/.next/static/chunks/pages/[slug]/p-a402fb32d2a6ec95.js +1 -0
- package/.next/static/chunks/pages/{account-f163e14670372c05.js → account-57c0c1f70eed76a6.js} +1 -1
- package/.next/static/chunks/pages/{checkout-cf498a32e110bde8.js → checkout-e5db8918e7c9c75e.js} +1 -1
- package/.next/static/chunks/pages/index-d0c9985f7dde64ce.js +1 -0
- package/.next/static/chunks/pages/{login-707636c85f23cac6.js → login-39000c786b4f6222.js} +1 -1
- package/.next/static/chunks/pages/s-e195109f5acced7c.js +1 -0
- package/.next/static/chunks/webpack-422f774fb36da0fb.js +1 -0
- package/.next/static/css/{4e42cc999ad62b57.css → 0dc997f9da3027b7.css} +1 -1
- package/.next/static/css/58e1e061ceea2cd8.css +1 -0
- package/.next/static/css/{d7bbfbd552f407e9.css → cbccabebb36f7f92.css} +1 -1
- package/.next/static/css/{d456bfc64bc489a2.css → cf062feb79245123.css} +1 -1
- package/.next/trace +81 -80
- package/.turbo/turbo-build.log +19 -19
- package/.turbo/turbo-test.log +11 -11
- package/package.json +2 -2
- 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/ProductShelf/DefaultComponents.ts +9 -0
- package/src/components/sections/ProductShelf/OverriddenDefaultProductShelf.ts +12 -0
- package/src/components/templates/LandingPage/LandingPage.tsx +2 -2
- package/src/components/templates/ProductListingPage/ProductListing.tsx +1 -1
- package/src/components/ui/ProductShelf/ProductShelf.tsx +11 -12
- package/src/pages/[slug]/p.tsx +1 -1
- package/src/pages/index.tsx +2 -2
- package/src/sdk/overrides/sections.tsx +8 -0
- package/src/typings/overrides.ts +4 -1
- package/.next/server/chunks/117.js +0 -430
- package/.next/server/chunks/184.js +0 -61
- package/.next/server/chunks/53.js +0 -61
- package/.next/server/chunks/773.js +0 -550
- package/.next/server/chunks/854.js +0 -72
- package/.next/server/chunks/979.js +0 -1305
- package/.next/static/Vfb6D5MSONBW7u11rKVhf/_buildManifest.js +0 -1
- package/.next/static/chunks/158-85b4b978d0a1cf1b.js +0 -1
- package/.next/static/chunks/223-cb77217cce52d45c.js +0 -1
- package/.next/static/chunks/251.1c79f06f2a2814b1.js +0 -1
- package/.next/static/chunks/497-f3f10b00c609f0c2.js +0 -1
- package/.next/static/chunks/585.2d70151d75fdf960.js +0 -1
- package/.next/static/chunks/783-fbcb7a3216c40744.js +0 -1
- package/.next/static/chunks/800.f63caad837409c7e.js +0 -1
- package/.next/static/chunks/pages/[...slug]-e87fa1c381512f10.js +0 -1
- package/.next/static/chunks/pages/[slug]/p-c4c65f184eaa6c98.js +0 -1
- package/.next/static/chunks/pages/index-098f2e020e698003.js +0 -1
- package/.next/static/chunks/pages/s-0bfcfd0d40841dcf.js +0 -1
- package/.next/static/chunks/webpack-590d458bd6727c5b.js +0 -1
- package/.next/static/css/14238403d5139812.css +0 -1
- package/.next/static/css/dfbdb0f27fd64782.css +0 -1
- package/src/components/sections/BannerText/Overrides.tsx +0 -18
- package/src/components/sections/ProductShelf/Overrides.tsx +0 -20
- /package/.next/static/{Vfb6D5MSONBW7u11rKVhf → H_kSoqYPjjK2sM3cxP_pS}/_ssgManifest.js +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
$ yarn partytown & yarn generate && next build
|
|
2
|
-
$ partytown copylib ./public/~partytown
|
|
3
2
|
$ faststore generate-graphql -c
|
|
3
|
+
$ partytown copylib ./public/~partytown
|
|
4
4
|
Partytown lib copied to: /home/runner/work/faststore/faststore/packages/core/public/~partytown
|
|
5
5
|
success - GraphQL schema, types, and optimizations successfully generated 🎉
|
|
6
6
|
warn - You have enabled experimental feature (scrollRestoration) in next.config.js.
|
|
@@ -38,28 +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
|
-
┌ ● /
|
|
42
|
-
├ └ css/
|
|
43
|
-
├ /_app 0 B 83.
|
|
44
|
-
├ ● /[...slug]
|
|
45
|
-
├ └ css/
|
|
46
|
-
├ ● /[slug]/p
|
|
47
|
-
├ └ css/
|
|
48
|
-
├ ○ /404 1.19 kB
|
|
49
|
-
├ ● /500 1.21 kB
|
|
50
|
-
├ ● /account 677 B
|
|
51
|
-
├ λ /api/graphql 0 B 83.
|
|
52
|
-
├ λ /api/health/live 0 B 83.
|
|
53
|
-
├ λ /api/health/ready 0 B 83.
|
|
54
|
-
├ λ /api/preview 0 B 83.
|
|
55
|
-
├ ● /checkout
|
|
56
|
-
├ ● /login 1.14 kB
|
|
57
|
-
└ ● /s
|
|
41
|
+
┌ ● / 6.61 kB 127 kB
|
|
42
|
+
├ └ css/cf062feb79245123.css 8.38 kB
|
|
43
|
+
├ /_app 0 B 83.7 kB
|
|
44
|
+
├ ● /[...slug] 7.35 kB 139 kB
|
|
45
|
+
├ └ css/0dc997f9da3027b7.css 8.8 kB
|
|
46
|
+
├ ● /[slug]/p 14.9 kB 135 kB
|
|
47
|
+
├ └ css/cbccabebb36f7f92.css 13.3 kB
|
|
48
|
+
├ ○ /404 1.19 kB 121 kB
|
|
49
|
+
├ ● /500 1.21 kB 121 kB
|
|
50
|
+
├ ● /account 677 B 121 kB
|
|
51
|
+
├ λ /api/graphql 0 B 83.7 kB
|
|
52
|
+
├ λ /api/health/live 0 B 83.7 kB
|
|
53
|
+
├ λ /api/health/ready 0 B 83.7 kB
|
|
54
|
+
├ λ /api/preview 0 B 83.7 kB
|
|
55
|
+
├ ● /checkout 662 B 121 kB
|
|
56
|
+
├ ● /login 1.14 kB 121 kB
|
|
57
|
+
└ ● /s 1.38 kB 133 kB
|
|
58
58
|
+ First Load JS shared by all 86.8 kB
|
|
59
59
|
├ chunks/framework-dfd14d7ce6600b03.js 45.3 kB
|
|
60
60
|
├ chunks/main-e4e873ee741162eb.js 24.2 kB
|
|
61
61
|
├ chunks/pages/_app-30b9666307e4b3b1.js 12.1 kB
|
|
62
|
-
├ chunks/webpack-
|
|
62
|
+
├ chunks/webpack-422f774fb36da0fb.js 2.23 kB
|
|
63
63
|
└ css/5d1f64b61ea581f4.css 3.05 kB
|
|
64
64
|
|
|
65
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 (20.574 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 (
|
|
7
|
-
✓ should return a valid GraphQL schema contain all expected queries (
|
|
8
|
-
✓ should return a valid GraphQL schema contain all expected mutations
|
|
5
|
+
✓ should return a valid GraphQL schema (27 ms)
|
|
6
|
+
✓ should return a valid GraphQL schema contain all expected types (8 ms)
|
|
7
|
+
✓ should return a valid GraphQL schema contain all expected queries (2 ms)
|
|
8
|
+
✓ should return a valid GraphQL schema contain all expected mutations (1 ms)
|
|
9
9
|
VTEX API Extension
|
|
10
|
-
✓ getTypeDefsFromFolder function should return an Array (
|
|
10
|
+
✓ getTypeDefsFromFolder function should return an Array (8 ms)
|
|
11
11
|
Third Party API Extension
|
|
12
|
-
✓ getTypeDefsFromFolder function should return an Array (
|
|
12
|
+
✓ getTypeDefsFromFolder function should return an Array (5 ms)
|
|
13
13
|
Final Schema after merging
|
|
14
|
-
✓ should return a valid merged GraphQL schema (
|
|
14
|
+
✓ should return a valid merged GraphQL schema (39 ms)
|
|
15
15
|
Envelop
|
|
16
|
-
✓ should exist with its plugins (
|
|
17
|
-
✓ should handle options and execute (
|
|
16
|
+
✓ should exist with its plugins (26 ms)
|
|
17
|
+
✓ should handle options and execute (198 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:
|
|
22
|
+
Time: 20.712 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.54",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "vtex/faststore",
|
|
6
6
|
"browserslist": "supports es6-module and not dead",
|
|
@@ -123,5 +123,5 @@
|
|
|
123
123
|
"node": "18.19.0",
|
|
124
124
|
"yarn": "1.19.1"
|
|
125
125
|
},
|
|
126
|
-
"gitHead": "
|
|
126
|
+
"gitHead": "bd49979ef06f4af7632e86a2c552bcef20690f0a"
|
|
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
|
+
)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ProductShelf as UIProductShelf } from '@faststore/ui'
|
|
2
|
+
import ProductCard from 'src/components/product/ProductCard'
|
|
3
|
+
import Carousel from 'src/components/ui/Carousel'
|
|
4
|
+
|
|
5
|
+
export const ProductShelfDefaultComponents = {
|
|
6
|
+
ProductShelf: UIProductShelf,
|
|
7
|
+
__experimentalCarousel: Carousel,
|
|
8
|
+
__experimentalProductCard: ProductCard,
|
|
9
|
+
} as const
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { override } from 'src/customizations/src/components/overrides/ProductShelf'
|
|
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 ProductShelf section present in the Headless CMS
|
|
9
|
+
*/
|
|
10
|
+
export const OverriddenDefaultProductShelf = getOverriddenSection(
|
|
11
|
+
override as SectionOverrideDefinition<'ProductShelf'>
|
|
12
|
+
)
|
|
@@ -6,9 +6,9 @@ import MissingContentError from 'src/sdk/error/MissingContentError/MissingConten
|
|
|
6
6
|
import RenderSections from 'src/components/cms/RenderSections'
|
|
7
7
|
import { OverriddenDefaultHero as Hero } from 'src/components/sections/Hero/OverriddenDefaultHero'
|
|
8
8
|
import Incentives from 'src/components/sections/Incentives'
|
|
9
|
-
import ProductShelf from 'src/components/sections/ProductShelf'
|
|
9
|
+
import { OverriddenDefaultProductShelf as ProductShelf } from 'src/components/sections/ProductShelf/OverriddenDefaultProductShelf'
|
|
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'
|
|
@@ -2,7 +2,7 @@ import type { ServerCollectionPageQueryQuery } from '@generated/graphql'
|
|
|
2
2
|
import Breadcrumb from 'src/components/sections/Breadcrumb'
|
|
3
3
|
import { OverriddenDefaultHero as Hero } from 'src/components/sections/Hero/OverriddenDefaultHero'
|
|
4
4
|
import ProductGallery from 'src/components/sections/ProductGallery'
|
|
5
|
-
import ProductShelf from 'src/components/sections/ProductShelf'
|
|
5
|
+
import { OverriddenDefaultProductShelf as ProductShelf } from 'src/components/sections/ProductShelf/OverriddenDefaultProductShelf'
|
|
6
6
|
import ScrollToTopButton from 'src/components/sections/ScrollToTopButton'
|
|
7
7
|
import { ITEMS_PER_PAGE } from 'src/constants'
|
|
8
8
|
import deepmerge from 'deepmerge'
|
|
@@ -2,15 +2,10 @@ import { useEffect, useId, useRef } from 'react'
|
|
|
2
2
|
|
|
3
3
|
import ProductShelfSkeleton from 'src/components/skeletons/ProductShelfSkeleton'
|
|
4
4
|
import { useViewItemListEvent } from 'src/sdk/analytics/hooks/useViewItemListEvent'
|
|
5
|
+
import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
|
|
5
6
|
import { useProductsQuery } from 'src/sdk/product/useProductsQuery'
|
|
6
7
|
import { textToKebabCase } from 'src/utils/utilities'
|
|
7
8
|
|
|
8
|
-
import {
|
|
9
|
-
ProductShelf as ProductShelfWrapper,
|
|
10
|
-
__experimentalCarousel as Carousel,
|
|
11
|
-
__experimentalProductCard as ProductCard,
|
|
12
|
-
} from 'src/components/sections/ProductShelf/Overrides'
|
|
13
|
-
|
|
14
9
|
type Sort =
|
|
15
10
|
| 'discount_desc'
|
|
16
11
|
| 'name_asc'
|
|
@@ -42,14 +37,16 @@ export type ProductShelfProps = {
|
|
|
42
37
|
function ProductShelf({
|
|
43
38
|
title,
|
|
44
39
|
inView,
|
|
45
|
-
productCardConfiguration: {
|
|
46
|
-
bordered = ProductCard.props.bordered,
|
|
47
|
-
showDiscountBadge = ProductCard.props.showDiscountBadge,
|
|
48
|
-
} = {},
|
|
40
|
+
productCardConfiguration: { bordered, showDiscountBadge } = {},
|
|
49
41
|
numberOfItems,
|
|
50
42
|
itemsPerPage = 5,
|
|
51
43
|
...otherProps
|
|
52
44
|
}: ProductShelfProps) {
|
|
45
|
+
const {
|
|
46
|
+
ProductShelf: ProductShelfWrapper,
|
|
47
|
+
__experimentalCarousel: Carousel,
|
|
48
|
+
__experimentalProductCard: ProductCard,
|
|
49
|
+
} = useOverrideComponents<'ProductShelf'>()
|
|
53
50
|
const titleId = textToKebabCase(title)
|
|
54
51
|
const id = useId()
|
|
55
52
|
const viewedOnce = useRef(false)
|
|
@@ -100,8 +97,10 @@ function ProductShelf({
|
|
|
100
97
|
sizes: '(max-width: 768px) 42vw, 30vw',
|
|
101
98
|
}}
|
|
102
99
|
{...ProductCard.props}
|
|
103
|
-
bordered={bordered}
|
|
104
|
-
showDiscountBadge={
|
|
100
|
+
bordered={bordered ?? ProductCard.props.bordered}
|
|
101
|
+
showDiscountBadge={
|
|
102
|
+
showDiscountBadge ?? ProductCard.props.showDiscountBadge
|
|
103
|
+
}
|
|
105
104
|
// Dynamic props shouldn't be overridable
|
|
106
105
|
// This decision can be reviewed later if needed
|
|
107
106
|
key={`${product.node.id}`}
|
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,11 +4,11 @@ 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'
|
|
7
|
+
import { OverriddenDefaultBannerText as BannerText } from 'src/components/sections/BannerText/OverriddenDefaultBannerText'
|
|
8
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
|
-
import ProductShelf from 'src/components/sections/ProductShelf'
|
|
11
|
+
import { OverriddenDefaultProductShelf as ProductShelf } from 'src/components/sections/ProductShelf/OverriddenDefaultProductShelf'
|
|
12
12
|
import ProductTiles from 'src/components/sections/ProductTiles'
|
|
13
13
|
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
14
14
|
import { mark } from 'src/sdk/tests/mark'
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import Alert from '../../components/sections/Alert'
|
|
2
|
+
import BannerText from '../../components/sections/BannerText'
|
|
2
3
|
import Hero from '../../components/sections/Hero'
|
|
4
|
+
import ProductShelf from '../../components/sections/ProductShelf'
|
|
3
5
|
|
|
4
6
|
import type { DefaultSectionComponentsDefinitions } from '../../typings/overridesDefinition'
|
|
5
7
|
import type { SectionsOverrides } from '../../typings/overrides'
|
|
6
8
|
import { AlertDefaultComponents } from '../../components/sections/Alert/DefaultComponents'
|
|
9
|
+
import { BannerTextDefaultComponents } from '../../components/sections/BannerText/DefaultComponents'
|
|
7
10
|
import { HeroDefaultComponents } from '../../components/sections/Hero/DefaultComponents'
|
|
11
|
+
import { ProductShelfDefaultComponents } from '../../components/sections/ProductShelf/DefaultComponents'
|
|
8
12
|
|
|
9
13
|
export const Sections = {
|
|
10
14
|
Alert,
|
|
15
|
+
BannerText,
|
|
11
16
|
Hero,
|
|
17
|
+
ProductShelf,
|
|
12
18
|
}
|
|
13
19
|
|
|
14
20
|
export const DefaultComponents: Partial<
|
|
@@ -18,5 +24,7 @@ export const DefaultComponents: Partial<
|
|
|
18
24
|
>
|
|
19
25
|
> = {
|
|
20
26
|
Alert: AlertDefaultComponents,
|
|
27
|
+
BannerText: BannerTextDefaultComponents,
|
|
21
28
|
Hero: HeroDefaultComponents,
|
|
29
|
+
ProductShelf: ProductShelfDefaultComponents,
|
|
22
30
|
}
|
package/src/typings/overrides.ts
CHANGED
|
@@ -47,7 +47,10 @@ 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<
|
|
50
|
+
export type SupportedSectionsOverridesV2 = Pick<
|
|
51
|
+
SectionsOverrides,
|
|
52
|
+
'Alert' | 'BannerText' | 'Hero' | 'ProductShelf'
|
|
53
|
+
>
|
|
51
54
|
|
|
52
55
|
/**
|
|
53
56
|
* Originally, these types were defined in their respective Overrides file
|