@faststore/core 3.69.0 → 3.70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +50 -50
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- 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.js +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/react-loadable-manifest.json +18 -18
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/1780.js +1 -1
- package/.next/server/chunks/2778.js +2 -2
- package/.next/server/chunks/3882.js +1 -1
- package/.next/server/chunks/3918.js +1 -1
- package/.next/server/chunks/3963.js +1 -1
- package/.next/server/chunks/948.js +2 -2
- package/.next/server/chunks/9563.js +1 -1
- 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 +1 -1
- package/.next/server/pages/500.js +1 -1
- package/.next/server/pages/[...slug].js +1 -1
- package/.next/server/pages/[slug]/p.js +1 -1
- package/.next/server/pages/api/graphql.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/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/index.js +1 -1
- package/.next/server/pages/login.js +1 -1
- package/.next/server/pages/s.js +1 -1
- package/.next/server/pages-manifest.json +1 -1
- package/.next/static/{8LqJdo90qttH83UstKDej → T-feA7OkkJoZOJ4u9O47z}/_buildManifest.js +1 -1
- package/.next/static/chunks/3166-e2e2d3255aa5f208.js +1 -0
- package/.next/static/chunks/6355.454b14737c2bf69c.js +1 -0
- package/.next/static/chunks/7191-df87383e8d7c078f.js +1 -0
- package/.next/static/chunks/9173-ed47aa8015d45a84.js +1 -0
- package/.next/static/chunks/BannerNewsletter.fe0181162c046991.js +1 -0
- package/.next/static/chunks/BannerText.681f118e9f149f6c.js +1 -0
- package/.next/static/chunks/Footer.0eb7e5cc7bce8103.js +1 -0
- package/.next/static/chunks/Newsletter.46c9113fa222890a.js +1 -0
- package/.next/static/chunks/ProductShelf.b75a7ab8e313ea07.js +1 -0
- package/.next/static/chunks/ProductTiles.35cd23ada22f5a96.js +1 -0
- package/.next/static/chunks/RegionModal.04b02aafc0836d49.js +1 -0
- package/.next/static/chunks/RegionSlider.d063ccee38bdfdb7.js +1 -0
- package/.next/static/chunks/pages/404-cc5de07438cb53b5.js +1 -0
- package/.next/static/chunks/pages/500-926ab913425651bc.js +1 -0
- package/.next/static/chunks/pages/[...slug]-b3a9bdfcf0127006.js +1 -0
- package/.next/static/chunks/pages/[slug]/p-3c16bf4c43aefc51.js +1 -0
- package/.next/static/chunks/pages/account/403-b65f508af4df4904.js +1 -0
- package/.next/static/chunks/pages/account/404-9a7f4c3464751182.js +1 -0
- package/.next/static/chunks/pages/index-004d6444cfaf59cb.js +1 -0
- package/.next/static/chunks/pages/login-3043634ec00661a8.js +1 -0
- package/.next/static/chunks/pages/s-3197dfed5c06ad7b.js +1 -0
- package/.next/static/chunks/{webpack-8b6c086380cf1398.js → webpack-b39da7001e937875.js} +1 -1
- package/.next/static/css/{92960607d6088082.css → 9bdd3be2a41064c6.css} +1 -1
- package/.next/trace +135 -135
- package/.turbo/turbo-build.log +19 -19
- package/.turbo/turbo-test.log +5 -5
- package/CHANGELOG.md +12 -0
- package/package.json +2 -2
- package/src/components/cms/RenderSections.tsx +5 -4
- package/src/components/cms/global/Components.ts +9 -8
- package/src/components/cms/home/Components.ts +7 -6
- package/src/components/cms/plp/Components.ts +8 -7
- package/src/components/cms/search/Components.ts +9 -8
- package/src/components/region/RegionModal/RegionModal.tsx +2 -0
- package/src/components/region/RegionPopover/RegionPopover.tsx +2 -0
- package/src/components/region/RegionSlider/RegionSlider.tsx +2 -0
- package/src/components/sections/Alert/Alert.tsx +2 -0
- package/src/components/sections/BannerNewsletter/BannerNewsletter.tsx +2 -0
- package/src/components/sections/BannerText/BannerText.tsx +2 -0
- package/src/components/sections/Breadcrumb/Breadcrumb.tsx +2 -0
- package/src/components/sections/CrossSellingShelf/CrossSellingShelf.tsx +2 -0
- package/src/components/sections/EmptyState/EmptyState.tsx +2 -0
- package/src/components/sections/Footer/Footer.tsx +2 -0
- package/src/components/sections/Hero/Hero.tsx +2 -0
- package/src/components/sections/Incentives/Incentives.tsx +2 -0
- package/src/components/sections/Navbar/Navbar.tsx +2 -0
- package/src/components/sections/Newsletter/Newsletter.tsx +2 -0
- package/src/components/sections/ProductDetails/ProductDetails.tsx +2 -0
- package/src/components/sections/ProductGallery/ProductGallery.tsx +2 -0
- package/src/components/sections/ProductShelf/ProductShelf.tsx +2 -0
- package/src/components/sections/ProductTiles/ProductTiles.tsx +2 -0
- package/src/components/sections/RegionBar/RegionBar.tsx +2 -0
- package/src/components/templates/LandingPage/LandingPage.tsx +9 -8
- package/src/components/ui/ProductShelf/ProductShelf.tsx +15 -1
- package/src/pages/404.tsx +2 -1
- package/src/pages/500.tsx +2 -1
- package/src/pages/[slug]/p.tsx +10 -9
- package/src/pages/login.tsx +2 -1
- package/src/sdk/deliveryPromise/useDeliveryPromiseFacets.ts +20 -0
- package/src/sdk/product/useLocalizedVariables.ts +2 -14
- package/src/utils/cms.ts +10 -0
- package/.next/static/chunks/3166-6af5e854c2f2913a.js +0 -1
- package/.next/static/chunks/6355.57d1a07f50ee6cc9.js +0 -1
- package/.next/static/chunks/7191-9bdd5f0c18fbd942.js +0 -1
- package/.next/static/chunks/9173-9fc2b806c0ac0b8d.js +0 -1
- package/.next/static/chunks/BannerNewsletter.a9ea51c53885c80f.js +0 -1
- package/.next/static/chunks/BannerText.21f106b180339df1.js +0 -1
- package/.next/static/chunks/Footer.09dddd47ce6c816f.js +0 -1
- package/.next/static/chunks/Newsletter.2c79d1813e9f9c95.js +0 -1
- package/.next/static/chunks/ProductShelf.299d0989eea49a79.js +0 -1
- package/.next/static/chunks/ProductTiles.ab99b919f3c0215f.js +0 -1
- package/.next/static/chunks/RegionModal.503f063f2e19b936.js +0 -1
- package/.next/static/chunks/RegionSlider.00de4571775d04cc.js +0 -1
- package/.next/static/chunks/pages/404-dca50618ea3e6fb6.js +0 -1
- package/.next/static/chunks/pages/500-ae6697c7631fb07a.js +0 -1
- package/.next/static/chunks/pages/[...slug]-debd8b208a0e3d02.js +0 -1
- package/.next/static/chunks/pages/[slug]/p-d782ecb21200f200.js +0 -1
- package/.next/static/chunks/pages/account/403-a3d8b31b4e9ee8a6.js +0 -1
- package/.next/static/chunks/pages/account/404-22b789f04fcdce39.js +0 -1
- package/.next/static/chunks/pages/index-b45c9535696b5ab1.js +0 -1
- package/.next/static/chunks/pages/login-bae3a4cdaaed110c.js +0 -1
- package/.next/static/chunks/pages/s-011eedb19dcdccc6.js +0 -1
- /package/.next/static/{8LqJdo90qttH83UstKDej → T-feA7OkkJoZOJ4u9O47z}/_ssgManifest.js +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@3.
|
|
2
|
+
> @faststore/core@3.69.1 prebuild /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> na run partytown && na run generate
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @faststore/core@3.
|
|
6
|
+
> @faststore/core@3.69.1 partytown /home/runner/work/faststore/faststore/packages/core
|
|
7
7
|
> partytown copylib ./public/~partytown
|
|
8
8
|
|
|
9
9
|
Partytown lib copied to: /home/runner/work/faststore/faststore/packages/core/public/~partytown
|
|
10
10
|
|
|
11
|
-
> @faststore/core@3.
|
|
11
|
+
> @faststore/core@3.69.1 generate /home/runner/work/faststore/faststore/packages/core
|
|
12
12
|
> na run generate:schema && na run generate:codegen && na run format:generated
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
> @faststore/core@3.
|
|
15
|
+
> @faststore/core@3.69.1 generate:schema /home/runner/work/faststore/faststore/packages/core
|
|
16
16
|
> tsx src/server/generator/generateGraphQLSchemaFile.ts
|
|
17
17
|
|
|
18
18
|
Schema GraphQL file generated successfully
|
|
19
19
|
|
|
20
|
-
> @faststore/core@3.
|
|
20
|
+
> @faststore/core@3.69.1 generate:codegen /home/runner/work/faststore/faststore/packages/core
|
|
21
21
|
> graphql-codegen
|
|
22
22
|
|
|
23
23
|
[STARTED] Parse Configuration
|
|
@@ -37,11 +37,11 @@ Running lifecycle hook "afterStart" scripts...
|
|
|
37
37
|
[CLI] Loading Documents
|
|
38
38
|
[CLI] Generating output
|
|
39
39
|
|
|
40
|
-
> @faststore/core@3.
|
|
40
|
+
> @faststore/core@3.69.1 format:generated /home/runner/work/faststore/faststore/packages/core
|
|
41
41
|
> prettier --write "@generated/**/*.{ts,js,tsx,jsx,json}" --loglevel error
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
> @faststore/core@3.
|
|
44
|
+
> @faststore/core@3.69.1 build /home/runner/work/faststore/faststore/packages/core
|
|
45
45
|
> next build
|
|
46
46
|
|
|
47
47
|
⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
|
|
@@ -58,7 +58,7 @@ Browserslist: caniuse-lite is outdated. Please run:
|
|
|
58
58
|
Creating an optimized production build ...
|
|
59
59
|
Disabled SWC as replacement for Babel because of custom Babel configuration ".babelrc.js" https://nextjs.org/docs/messages/swc-disabled
|
|
60
60
|
Using external babel configuration from /home/runner/work/faststore/faststore/packages/core/.babelrc.js
|
|
61
|
-
Browserslist: browsers data (caniuse-lite) is
|
|
61
|
+
Browserslist: browsers data (caniuse-lite) is 7 months old. Please run:
|
|
62
62
|
npx update-browserslist-db@latest
|
|
63
63
|
Why you should do it regularly: https://github.com/browserslist/update-db#readme
|
|
64
64
|
✓ Compiled successfully
|
|
@@ -73,23 +73,23 @@ Warning: Dynamic Content not found for the page: home. Refer to the Dynamic Cont
|
|
|
73
73
|
Collecting build traces ...
|
|
74
74
|
|
|
75
75
|
Route (pages) Size First Load JS
|
|
76
|
-
┌ ● / 3.
|
|
76
|
+
┌ ● / 3.66 kB 139 kB
|
|
77
77
|
├ └ css/b1806cbafd0c1f81.css 3.06 kB
|
|
78
78
|
├ /_app 0 B 105 kB
|
|
79
|
-
├ ● /[...slug] 2.
|
|
80
|
-
├ ● /[slug]/p 32.
|
|
79
|
+
├ ● /[...slug] 2.45 kB 147 kB
|
|
80
|
+
├ ● /[slug]/p 32.6 kB 168 kB
|
|
81
81
|
├ ├ css/a3ca6a9b63f657be.css 5.75 kB
|
|
82
82
|
├ ├ css/62a5153ac7061286.css 6.11 kB
|
|
83
83
|
├ └ css/6831395ff5fd317a.css 16.1 kB
|
|
84
|
-
├ ○ /404 1.
|
|
85
|
-
├ ● /500 1.
|
|
84
|
+
├ ○ /404 1.55 kB 137 kB
|
|
85
|
+
├ ● /500 1.55 kB 137 kB
|
|
86
86
|
├ λ /account 240 B 105 kB
|
|
87
87
|
├ ● /account/[...unknown] 281 B 105 kB
|
|
88
|
-
├ λ /account/403 2.
|
|
88
|
+
├ λ /account/403 2.44 kB 138 kB
|
|
89
89
|
├ └ css/b7bba8fce075688b.css 4.2 kB
|
|
90
|
-
├ λ /account/404 2.
|
|
90
|
+
├ λ /account/404 2.13 kB 138 kB
|
|
91
91
|
├ └ css/5347dbc8b71de47d.css 4.25 kB
|
|
92
|
-
├ λ /account/orders 8.94 kB
|
|
92
|
+
├ λ /account/orders 8.94 kB 145 kB
|
|
93
93
|
├ └ css/3d41485722b4e3f5.css 12.1 kB
|
|
94
94
|
├ λ /account/orders/[id] 12.1 kB 148 kB
|
|
95
95
|
├ └ css/ba1d8927d8745656.css 12.6 kB
|
|
@@ -104,13 +104,13 @@ Route (pages) Size First Load JS
|
|
|
104
104
|
├ λ /api/health/ready 0 B 105 kB
|
|
105
105
|
├ λ /api/preview 0 B 105 kB
|
|
106
106
|
├ ● /checkout 737 B 136 kB
|
|
107
|
-
├ ● /login 1.
|
|
108
|
-
└ ● /s 3.
|
|
107
|
+
├ ● /login 1.68 kB 137 kB
|
|
108
|
+
└ ● /s 3.28 kB 148 kB
|
|
109
109
|
+ First Load JS shared by all 108 kB
|
|
110
110
|
├ chunks/framework-807b0f81cbc129f0.js 45.4 kB
|
|
111
111
|
├ chunks/main-f658704b53a96ab1.js 33.1 kB
|
|
112
112
|
├ chunks/pages/_app-728289774860e9d9.js 22.8 kB
|
|
113
|
-
├ chunks/webpack-
|
|
113
|
+
├ chunks/webpack-b39da7001e937875.js 3.81 kB
|
|
114
114
|
└ css/0a57ee6c7a57788c.css 3.49 kB
|
|
115
115
|
|
|
116
116
|
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@3.
|
|
2
|
+
> @faststore/core@3.69.1 test /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> jest
|
|
4
4
|
|
|
5
|
-
PASS test/
|
|
6
|
-
PASS test/
|
|
5
|
+
PASS test/server/cms/global.test.ts (26.447 s)
|
|
6
|
+
PASS test/utils/multipleTemplates.test.ts (27.118 s)
|
|
7
7
|
PASS test/server/cms/index.test.ts
|
|
8
|
-
PASS test/server/index.test.ts (30.
|
|
8
|
+
PASS test/server/index.test.ts (30.054 s)
|
|
9
9
|
|
|
10
10
|
Test Suites: 4 passed, 4 total
|
|
11
11
|
Tests: 22 passed, 22 total
|
|
12
12
|
Snapshots: 0 total
|
|
13
|
-
Time: 31.
|
|
13
|
+
Time: 31.187 s
|
|
14
14
|
Ran all test suites.
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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.70.0](https://github.com/vtex/faststore/compare/v3.69.1...v3.70.0) (2025-08-01)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- [CP-407] Add support for rendering components based on their $componentKey ([#2915](https://github.com/vtex/faststore/issues/2915)) ([7e679c4](https://github.com/vtex/faststore/commit/7e679c43976ab7f874b73b53e59bfaf0a4e99483))
|
|
11
|
+
|
|
12
|
+
## [3.69.1](https://github.com/vtex/faststore/compare/v3.69.0...v3.69.1) (2025-08-01)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- removing unwanted facets on product shelf to prevent duplication… ([#2970](https://github.com/vtex/faststore/issues/2970)) ([6ba3ca0](https://github.com/vtex/faststore/commit/6ba3ca06ecee058bc93ef9fa784a585f0a8c6563))
|
|
17
|
+
|
|
6
18
|
# [3.69.0](https://github.com/vtex/faststore/compare/v3.68.2...v3.69.0) (2025-07-31)
|
|
7
19
|
|
|
8
20
|
### Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.70.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "vtex/faststore",
|
|
6
6
|
"browserslist": "supports es6-module and not dead",
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
"ts-jest": "29.1.1",
|
|
108
108
|
"typescript": "5.3.2"
|
|
109
109
|
},
|
|
110
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "1382f090bad27a9f4134db7c88c7f7ae5f328eb4"
|
|
111
111
|
}
|
|
@@ -19,7 +19,7 @@ import ViewportObserver from './ViewportObserver'
|
|
|
19
19
|
interface Props {
|
|
20
20
|
components?: Record<string, ComponentType<any>>
|
|
21
21
|
globalSections?: Array<{ name: string; data: any }>
|
|
22
|
-
sections?: Array<{ name: string; data: any }>
|
|
22
|
+
sections?: Array<{ name: string; data: any; $componentKey?: string }>
|
|
23
23
|
isInteractive?: boolean
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -106,13 +106,14 @@ export const RenderSectionsBase = ({
|
|
|
106
106
|
}: Props) => {
|
|
107
107
|
return (
|
|
108
108
|
<>
|
|
109
|
-
{sections.map(({ name, data = {} }, index) => {
|
|
110
|
-
const
|
|
109
|
+
{sections.map(({ name, data = {}, $componentKey }, index) => {
|
|
110
|
+
const key = $componentKey ?? name
|
|
111
|
+
const Component = components[key]
|
|
111
112
|
|
|
112
113
|
if (!Component) {
|
|
113
114
|
// TODO: add a documentation link to help to do this
|
|
114
115
|
console.warn(
|
|
115
|
-
`${
|
|
116
|
+
`${key} not found. Add a new component for this section or remove it from the CMS`
|
|
116
117
|
)
|
|
117
118
|
|
|
118
119
|
return null
|
|
@@ -8,6 +8,7 @@ import { OverriddenDefaultRegionBar as RegionBar } from 'src/components/sections
|
|
|
8
8
|
|
|
9
9
|
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
10
10
|
import PLUGINS_COMPONENTS from 'src/plugins'
|
|
11
|
+
import { getComponentKey } from 'src/utils/cms'
|
|
11
12
|
|
|
12
13
|
const CartSidebar = dynamic(
|
|
13
14
|
() =>
|
|
@@ -37,14 +38,14 @@ const RegionSlider = dynamic(
|
|
|
37
38
|
)
|
|
38
39
|
|
|
39
40
|
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
40
|
-
Alert,
|
|
41
|
-
Navbar,
|
|
42
|
-
RegionBar,
|
|
43
|
-
RegionPopover,
|
|
44
|
-
CartSidebar, // out of viewport
|
|
45
|
-
RegionModal, // out of viewport
|
|
46
|
-
RegionSlider, // out of viewport
|
|
47
|
-
Footer, // out of viewport
|
|
41
|
+
[getComponentKey(Alert, 'Alert')]: Alert,
|
|
42
|
+
[getComponentKey(Navbar, 'Navbar')]: Navbar,
|
|
43
|
+
[getComponentKey(RegionBar, 'RegionBar')]: RegionBar,
|
|
44
|
+
[getComponentKey(RegionPopover, 'RegionPopover')]: RegionPopover,
|
|
45
|
+
[getComponentKey(CartSidebar, 'CartSidebar')]: CartSidebar, // out of viewport
|
|
46
|
+
[getComponentKey(RegionModal, 'RegionModal')]: RegionModal, // out of viewport
|
|
47
|
+
[getComponentKey(RegionSlider, 'RegionSlider')]: RegionSlider, // out of viewport
|
|
48
|
+
[getComponentKey(Footer, 'Footer')]: Footer, // out of viewport
|
|
48
49
|
...PLUGINS_COMPONENTS,
|
|
49
50
|
...CUSTOM_COMPONENTS,
|
|
50
51
|
}
|
|
@@ -4,6 +4,7 @@ import type { ComponentType } from 'react'
|
|
|
4
4
|
import { OverriddenDefaultHero as Hero } from 'src/components/sections/Hero/OverriddenDefaultHero'
|
|
5
5
|
import Incentives from 'src/components/sections/Incentives'
|
|
6
6
|
import { default as GLOBAL_COMPONENTS } from '../global/Components'
|
|
7
|
+
import { getComponentKey } from 'src/utils/cms'
|
|
7
8
|
|
|
8
9
|
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
9
10
|
import PLUGINS_COMPONENTS from 'src/plugins'
|
|
@@ -43,12 +44,12 @@ const ProductTiles = dynamic(
|
|
|
43
44
|
*/
|
|
44
45
|
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
45
46
|
...GLOBAL_COMPONENTS,
|
|
46
|
-
Hero,
|
|
47
|
-
Incentives,
|
|
48
|
-
BannerText,
|
|
49
|
-
Newsletter,
|
|
50
|
-
ProductShelf,
|
|
51
|
-
ProductTiles,
|
|
47
|
+
[getComponentKey(Hero, 'Hero')]: Hero,
|
|
48
|
+
[getComponentKey(Incentives, 'Incentives')]: Incentives,
|
|
49
|
+
[getComponentKey(BannerText, 'BannerText')]: BannerText,
|
|
50
|
+
[getComponentKey(Newsletter, 'Newsletter')]: Newsletter,
|
|
51
|
+
[getComponentKey(ProductShelf, 'ProductShelf')]: ProductShelf,
|
|
52
|
+
[getComponentKey(ProductTiles, 'ProductTiles')]: ProductTiles,
|
|
52
53
|
...PLUGINS_COMPONENTS,
|
|
53
54
|
...CUSTOM_COMPONENTS,
|
|
54
55
|
}
|
|
@@ -7,6 +7,7 @@ import { OverriddenDefaultProductGallery as ProductGallery } from 'src/component
|
|
|
7
7
|
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
8
8
|
import PLUGINS_COMPONENTS from 'src/plugins'
|
|
9
9
|
import { default as GLOBAL_COMPONENTS } from '../global/Components'
|
|
10
|
+
import { getComponentKey } from 'src/utils/cms'
|
|
10
11
|
|
|
11
12
|
const BannerText = dynamic(
|
|
12
13
|
() =>
|
|
@@ -47,13 +48,13 @@ const ProductTiles = dynamic(
|
|
|
47
48
|
*/
|
|
48
49
|
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
49
50
|
...GLOBAL_COMPONENTS,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
ProductGallery,
|
|
53
|
-
BannerText,
|
|
54
|
-
Newsletter,
|
|
55
|
-
ProductShelf,
|
|
56
|
-
ProductTiles,
|
|
51
|
+
[getComponentKey(Hero, 'Hero')]: Hero,
|
|
52
|
+
[getComponentKey(Breadcrumb, 'Breadcrumb')]: Breadcrumb,
|
|
53
|
+
[getComponentKey(ProductGallery, 'ProductGallery')]: ProductGallery,
|
|
54
|
+
[getComponentKey(BannerText, 'BannerText')]: BannerText,
|
|
55
|
+
[getComponentKey(Newsletter, 'Newsletter')]: Newsletter,
|
|
56
|
+
[getComponentKey(ProductShelf, 'ProductShelf')]: ProductShelf,
|
|
57
|
+
[getComponentKey(ProductTiles, 'ProductTiles')]: ProductTiles,
|
|
57
58
|
...PLUGINS_COMPONENTS,
|
|
58
59
|
...CUSTOM_COMPONENTS,
|
|
59
60
|
}
|
|
@@ -7,6 +7,7 @@ import { OverriddenDefaultProductGallery as ProductGallery } from 'src/component
|
|
|
7
7
|
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
8
8
|
import PLUGINS_COMPONENTS from 'src/plugins'
|
|
9
9
|
import { default as GLOBAL_COMPONENTS } from '../global/Components'
|
|
10
|
+
import { getComponentKey } from 'src/utils/cms'
|
|
10
11
|
|
|
11
12
|
const BannerText = dynamic(
|
|
12
13
|
() =>
|
|
@@ -55,14 +56,14 @@ const ProductTiles = dynamic(
|
|
|
55
56
|
*/
|
|
56
57
|
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
57
58
|
...GLOBAL_COMPONENTS,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
ProductGallery,
|
|
61
|
-
BannerText,
|
|
62
|
-
BannerNewsletter,
|
|
63
|
-
Newsletter,
|
|
64
|
-
ProductShelf,
|
|
65
|
-
ProductTiles,
|
|
59
|
+
[getComponentKey(Hero, 'Hero')]: Hero,
|
|
60
|
+
[getComponentKey(Breadcrumb, 'Breadcrumb')]: Breadcrumb,
|
|
61
|
+
[getComponentKey(ProductGallery, 'ProductGallery')]: ProductGallery,
|
|
62
|
+
[getComponentKey(BannerText, 'BannerText')]: BannerText,
|
|
63
|
+
[getComponentKey(BannerNewsletter, 'BannerNewsletter')]: BannerNewsletter,
|
|
64
|
+
[getComponentKey(Newsletter, 'Newsletter')]: Newsletter,
|
|
65
|
+
[getComponentKey(ProductShelf, 'ProductShelf')]: ProductShelf,
|
|
66
|
+
[getComponentKey(ProductTiles, 'ProductTiles')]: ProductTiles,
|
|
66
67
|
...PLUGINS_COMPONENTS,
|
|
67
68
|
...CUSTOM_COMPONENTS,
|
|
68
69
|
}
|
|
@@ -41,6 +41,8 @@ function BreadcrumbSection({ ...otherProps }: BreadcrumbSectionProps) {
|
|
|
41
41
|
)
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
BreadcrumbSection.$componentKey = 'Breadcrumb'
|
|
45
|
+
|
|
44
46
|
const OverridableBreadcrumbSection = getOverridableSection<
|
|
45
47
|
typeof BreadcrumbSection
|
|
46
48
|
>('Breadcrumb', BreadcrumbSection, BreadcrumbDefaultComponents)
|
|
@@ -51,6 +51,8 @@ const CrossSellingShelf = ({
|
|
|
51
51
|
)
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
CrossSellingShelf.$componentKey = 'CrossSellingShelf'
|
|
55
|
+
|
|
54
56
|
const OverridableCrossSellingShelf = getOverridableSection<
|
|
55
57
|
typeof CrossSellingShelf
|
|
56
58
|
>('CrossSellingShelf', CrossSellingShelf, CrossSellingShelfDefaultComponents)
|
|
@@ -68,6 +68,8 @@ function ProductGallerySection({
|
|
|
68
68
|
)
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
ProductGallerySection.$componentKey = 'ProductGallery'
|
|
72
|
+
|
|
71
73
|
const OverridableProductGallery = getOverridableSection<
|
|
72
74
|
typeof ProductGallerySection
|
|
73
75
|
>('ProductGallery', ProductGallerySection, ProductGalleryDefaultComponents)
|
|
@@ -3,6 +3,7 @@ import type { ComponentType } from 'react'
|
|
|
3
3
|
|
|
4
4
|
import { default as GLOBAL_COMPONENTS } from 'src/components/cms/global/Components'
|
|
5
5
|
import RenderSections from 'src/components/cms/RenderSections'
|
|
6
|
+
import { getComponentKey } from 'src/utils/cms'
|
|
6
7
|
import BannerNewsletter from 'src/components/sections/BannerNewsletter/BannerNewsletter'
|
|
7
8
|
import { OverriddenDefaultBannerText as BannerText } from 'src/components/sections/BannerText/OverriddenDefaultBannerText'
|
|
8
9
|
import { OverriddenDefaultCrossSellingShelf as CrossSellingShelf } from 'src/components/sections/CrossSellingShelf/OverriddenDefaultCrossSellingShelf'
|
|
@@ -24,14 +25,14 @@ import type { PreviewData } from 'src/server/content/types'
|
|
|
24
25
|
/* A list of components that can be used in the CMS. */
|
|
25
26
|
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
26
27
|
...GLOBAL_COMPONENTS,
|
|
27
|
-
Hero,
|
|
28
|
-
BannerText,
|
|
29
|
-
BannerNewsletter,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
Newsletter,
|
|
33
|
-
ProductShelf,
|
|
34
|
-
ProductTiles,
|
|
28
|
+
[getComponentKey(Hero, 'Hero')]: Hero,
|
|
29
|
+
[getComponentKey(BannerText, 'BannerText')]: BannerText,
|
|
30
|
+
[getComponentKey(BannerNewsletter, 'BannerNewsletter')]: BannerNewsletter,
|
|
31
|
+
[getComponentKey(Incentives, 'Incentives')]: Incentives,
|
|
32
|
+
[getComponentKey(CrossSellingShelf, 'CrossSellingShelf')]: CrossSellingShelf,
|
|
33
|
+
[getComponentKey(Newsletter, 'Newsletter')]: Newsletter,
|
|
34
|
+
[getComponentKey(ProductShelf, 'ProductShelf')]: ProductShelf,
|
|
35
|
+
[getComponentKey(ProductTiles, 'ProductTiles')]: ProductTiles,
|
|
35
36
|
...PLUGINS_COMPONENTS,
|
|
36
37
|
...CUSTOM_COMPONENTS,
|
|
37
38
|
}
|
|
@@ -5,6 +5,8 @@ import { useViewItemListEvent } from 'src/sdk/analytics/hooks/useViewItemListEve
|
|
|
5
5
|
import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
|
|
6
6
|
import { useProductsQuery } from 'src/sdk/product/useProductsQuery'
|
|
7
7
|
import { textToKebabCase } from 'src/utils/utilities'
|
|
8
|
+
import { useDeliveryPromiseFacets } from 'src/sdk/deliveryPromise/useDeliveryPromiseFacets'
|
|
9
|
+
import deepmerge from 'deepmerge'
|
|
8
10
|
|
|
9
11
|
const ProductShelfSkeleton = dynamic(
|
|
10
12
|
() =>
|
|
@@ -61,7 +63,16 @@ function ProductShelf({
|
|
|
61
63
|
const titleId = textToKebabCase(title)
|
|
62
64
|
const id = useId()
|
|
63
65
|
const viewedOnce = useRef(false)
|
|
64
|
-
const
|
|
66
|
+
const { deliveryFacets } = useDeliveryPromiseFacets()
|
|
67
|
+
|
|
68
|
+
const data = useProductsQuery({
|
|
69
|
+
first: numberOfItems,
|
|
70
|
+
selectedFacets: deepmerge(otherProps.selectedFacets, deliveryFacets, {
|
|
71
|
+
arrayMerge: overwriteMerge,
|
|
72
|
+
}),
|
|
73
|
+
...otherProps,
|
|
74
|
+
})
|
|
75
|
+
|
|
65
76
|
const products = data?.search?.products
|
|
66
77
|
const productEdges = products?.edges ?? []
|
|
67
78
|
const aspectRatio = 1
|
|
@@ -128,3 +139,6 @@ function ProductShelf({
|
|
|
128
139
|
}
|
|
129
140
|
|
|
130
141
|
export default ProductShelf
|
|
142
|
+
|
|
143
|
+
// Array merging strategy from deepmerge that makes client arrays overwrite server array
|
|
144
|
+
const overwriteMerge = (_: any[], clientArray: any[]) => clientArray
|
package/src/pages/404.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
|
|
9
9
|
import { default as GLOBAL_COMPONENTS } from 'src/components/cms/global/Components'
|
|
10
10
|
import RenderSections from 'src/components/cms/RenderSections'
|
|
11
|
+
import { getComponentKey } from 'src/utils/cms'
|
|
11
12
|
import { OverriddenDefaultEmptyState as EmptyState } from 'src/components/sections/EmptyState/OverriddenDefaultEmptyState'
|
|
12
13
|
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
13
14
|
import PLUGINS_COMPONENTS from 'src/plugins'
|
|
@@ -20,7 +21,7 @@ import type { PreviewData } from 'src/server/content/types'
|
|
|
20
21
|
/* A list of components that can be used in the CMS. */
|
|
21
22
|
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
22
23
|
...GLOBAL_COMPONENTS,
|
|
23
|
-
EmptyState,
|
|
24
|
+
[getComponentKey(EmptyState, 'EmptyState')]: EmptyState,
|
|
24
25
|
...PLUGINS_COMPONENTS,
|
|
25
26
|
...CUSTOM_COMPONENTS,
|
|
26
27
|
}
|
package/src/pages/500.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
|
|
9
9
|
import { default as GLOBAL_COMPONENTS } from 'src/components/cms/global/Components'
|
|
10
10
|
import RenderSections from 'src/components/cms/RenderSections'
|
|
11
|
+
import { getComponentKey } from 'src/utils/cms'
|
|
11
12
|
import { OverriddenDefaultEmptyState as EmptyState } from 'src/components/sections/EmptyState/OverriddenDefaultEmptyState'
|
|
12
13
|
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
13
14
|
import PLUGINS_COMPONENTS from 'src/plugins'
|
|
@@ -20,7 +21,7 @@ import type { PreviewData } from 'src/server/content/types'
|
|
|
20
21
|
/* A list of components that can be used in the CMS. */
|
|
21
22
|
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
22
23
|
...GLOBAL_COMPONENTS,
|
|
23
|
-
EmptyState,
|
|
24
|
+
[getComponentKey(EmptyState, 'EmptyState')]: EmptyState,
|
|
24
25
|
...PLUGINS_COMPONENTS,
|
|
25
26
|
...CUSTOM_COMPONENTS,
|
|
26
27
|
}
|
package/src/pages/[slug]/p.tsx
CHANGED
|
@@ -12,6 +12,7 @@ import type {
|
|
|
12
12
|
} from '@generated/graphql'
|
|
13
13
|
import { default as GLOBAL_COMPONENTS } from 'src/components/cms/global/Components'
|
|
14
14
|
import RenderSections from 'src/components/cms/RenderSections'
|
|
15
|
+
import { getComponentKey } from 'src/utils/cms'
|
|
15
16
|
import BannerNewsletter from 'src/components/sections/BannerNewsletter/BannerNewsletter'
|
|
16
17
|
import { OverriddenDefaultBannerText as BannerText } from 'src/components/sections/BannerText/OverriddenDefaultBannerText'
|
|
17
18
|
import { OverriddenDefaultBreadcrumb as Breadcrumb } from 'src/components/sections/Breadcrumb/OverriddenDefaultBreadcrumb'
|
|
@@ -53,15 +54,15 @@ type StoreConfig = typeof storeConfig & {
|
|
|
53
54
|
*/
|
|
54
55
|
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
55
56
|
...GLOBAL_COMPONENTS,
|
|
56
|
-
Breadcrumb,
|
|
57
|
-
BannerNewsletter,
|
|
58
|
-
Newsletter,
|
|
59
|
-
BannerText,
|
|
60
|
-
Hero,
|
|
61
|
-
ProductDetails,
|
|
62
|
-
ProductShelf,
|
|
63
|
-
ProductTiles,
|
|
64
|
-
CrossSellingShelf,
|
|
57
|
+
[getComponentKey(Breadcrumb, 'Breadcrumb')]: Breadcrumb,
|
|
58
|
+
[getComponentKey(BannerNewsletter, 'BannerNewsletter')]: BannerNewsletter,
|
|
59
|
+
[getComponentKey(Newsletter, 'Newsletter')]: Newsletter,
|
|
60
|
+
[getComponentKey(BannerText, 'BannerText')]: BannerText,
|
|
61
|
+
[getComponentKey(Hero, 'Hero')]: Hero,
|
|
62
|
+
[getComponentKey(ProductDetails, 'ProductDetails')]: ProductDetails,
|
|
63
|
+
[getComponentKey(ProductShelf, 'ProductShelf')]: ProductShelf,
|
|
64
|
+
[getComponentKey(ProductTiles, 'ProductTiles')]: ProductTiles,
|
|
65
|
+
[getComponentKey(CrossSellingShelf, 'CrossSellingShelf')]: CrossSellingShelf,
|
|
65
66
|
...PLUGINS_COMPONENTS,
|
|
66
67
|
...CUSTOM_COMPONENTS,
|
|
67
68
|
}
|
package/src/pages/login.tsx
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
getGlobalSectionsData,
|
|
10
10
|
} from 'src/components/cms/GlobalSections'
|
|
11
11
|
import RenderSections from 'src/components/cms/RenderSections'
|
|
12
|
+
import { getComponentKey } from 'src/utils/cms'
|
|
12
13
|
import { OverriddenDefaultEmptyState as EmptyState } from 'src/components/sections/EmptyState/OverriddenDefaultEmptyState'
|
|
13
14
|
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
14
15
|
import PLUGINS_COMPONENTS from 'src/plugins'
|
|
@@ -22,7 +23,7 @@ import storeConfig from '../../discovery.config'
|
|
|
22
23
|
/* A list of components that can be used in the CMS. */
|
|
23
24
|
const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
24
25
|
...GLOBAL_COMPONENTS,
|
|
25
|
-
EmptyState,
|
|
26
|
+
[getComponentKey(EmptyState, 'EmptyState')]: EmptyState,
|
|
26
27
|
...PLUGINS_COMPONENTS,
|
|
27
28
|
...CUSTOM_COMPONENTS,
|
|
28
29
|
}
|