@faststore/core 3.69.1 → 3.70.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +50 -50
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/cache/config.json +3 -3
  5. package/.next/cache/webpack/client-production/0.pack +0 -0
  6. package/.next/cache/webpack/client-production/index.pack +0 -0
  7. package/.next/cache/webpack/server-production/0.pack +0 -0
  8. package/.next/cache/webpack/server-production/index.pack +0 -0
  9. package/.next/prerender-manifest.js +1 -1
  10. package/.next/prerender-manifest.json +1 -1
  11. package/.next/react-loadable-manifest.json +18 -18
  12. package/.next/routes-manifest.json +1 -1
  13. package/.next/server/chunks/1780.js +1 -1
  14. package/.next/server/chunks/2778.js +2 -2
  15. package/.next/server/chunks/3882.js +1 -1
  16. package/.next/server/chunks/3918.js +1 -1
  17. package/.next/server/chunks/3963.js +1 -1
  18. package/.next/server/chunks/948.js +2 -2
  19. package/.next/server/functions-config-manifest.json +1 -1
  20. package/.next/server/middleware-build-manifest.js +1 -1
  21. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  22. package/.next/server/pages/404.js +1 -1
  23. package/.next/server/pages/500.js +1 -1
  24. package/.next/server/pages/[...slug].js +1 -1
  25. package/.next/server/pages/[slug]/p.js +1 -1
  26. package/.next/server/pages/en-US/404.html +1 -1
  27. package/.next/server/pages/en-US/500.html +1 -1
  28. package/.next/server/pages/en-US/checkout.html +1 -1
  29. package/.next/server/pages/en-US/login.html +1 -1
  30. package/.next/server/pages/en-US/s.html +1 -1
  31. package/.next/server/pages/en-US.html +1 -1
  32. package/.next/server/pages/index.js +1 -1
  33. package/.next/server/pages/login.js +1 -1
  34. package/.next/server/pages/s.js +1 -1
  35. package/.next/server/pages-manifest.json +1 -1
  36. package/.next/static/chunks/3166-e2e2d3255aa5f208.js +1 -0
  37. package/.next/static/chunks/6355.454b14737c2bf69c.js +1 -0
  38. package/.next/static/chunks/7191-df87383e8d7c078f.js +1 -0
  39. package/.next/static/chunks/9173-ed47aa8015d45a84.js +1 -0
  40. package/.next/static/chunks/BannerNewsletter.fe0181162c046991.js +1 -0
  41. package/.next/static/chunks/BannerText.681f118e9f149f6c.js +1 -0
  42. package/.next/static/chunks/Footer.0eb7e5cc7bce8103.js +1 -0
  43. package/.next/static/chunks/Newsletter.46c9113fa222890a.js +1 -0
  44. package/.next/static/chunks/ProductShelf.b75a7ab8e313ea07.js +1 -0
  45. package/.next/static/chunks/ProductTiles.35cd23ada22f5a96.js +1 -0
  46. package/.next/static/chunks/RegionModal.04b02aafc0836d49.js +1 -0
  47. package/.next/static/chunks/RegionSlider.d063ccee38bdfdb7.js +1 -0
  48. package/.next/static/chunks/pages/404-cc5de07438cb53b5.js +1 -0
  49. package/.next/static/chunks/pages/500-926ab913425651bc.js +1 -0
  50. package/.next/static/chunks/pages/[...slug]-b3a9bdfcf0127006.js +1 -0
  51. package/.next/static/chunks/pages/[slug]/p-73a253032aaf8ce2.js +1 -0
  52. package/.next/static/chunks/pages/account/403-b65f508af4df4904.js +1 -0
  53. package/.next/static/chunks/pages/account/404-9a7f4c3464751182.js +1 -0
  54. package/.next/static/chunks/pages/index-004d6444cfaf59cb.js +1 -0
  55. package/.next/static/chunks/pages/login-3043634ec00661a8.js +1 -0
  56. package/.next/static/chunks/pages/s-3197dfed5c06ad7b.js +1 -0
  57. package/.next/static/chunks/{webpack-42d75fbe3cafd732.js → webpack-b39da7001e937875.js} +1 -1
  58. package/.next/static/css/{92960607d6088082.css → 9bdd3be2a41064c6.css} +1 -1
  59. package/.next/static/{tVd-SsiuJlud_z2vlEscj → oQne5jO4IL3AxXpTpm5ye}/_buildManifest.js +1 -1
  60. package/.next/trace +135 -135
  61. package/.turbo/turbo-build.log +18 -18
  62. package/.turbo/turbo-test.log +5 -5
  63. package/CHANGELOG.md +12 -0
  64. package/package.json +2 -2
  65. package/src/components/cms/RenderSections.tsx +5 -4
  66. package/src/components/cms/global/Components.ts +9 -8
  67. package/src/components/cms/home/Components.ts +7 -6
  68. package/src/components/cms/plp/Components.ts +8 -7
  69. package/src/components/cms/search/Components.ts +9 -8
  70. package/src/components/region/RegionModal/RegionModal.tsx +2 -0
  71. package/src/components/region/RegionPopover/RegionPopover.tsx +2 -0
  72. package/src/components/region/RegionSlider/RegionSlider.tsx +2 -0
  73. package/src/components/sections/Alert/Alert.tsx +2 -0
  74. package/src/components/sections/BannerNewsletter/BannerNewsletter.tsx +2 -0
  75. package/src/components/sections/BannerText/BannerText.tsx +2 -0
  76. package/src/components/sections/Breadcrumb/Breadcrumb.tsx +2 -0
  77. package/src/components/sections/CrossSellingShelf/CrossSellingShelf.tsx +2 -0
  78. package/src/components/sections/EmptyState/EmptyState.tsx +2 -0
  79. package/src/components/sections/Footer/Footer.tsx +2 -0
  80. package/src/components/sections/Hero/Hero.tsx +2 -0
  81. package/src/components/sections/Incentives/Incentives.tsx +2 -0
  82. package/src/components/sections/Navbar/Navbar.tsx +2 -0
  83. package/src/components/sections/Newsletter/Newsletter.tsx +2 -0
  84. package/src/components/sections/ProductDetails/ProductDetails.tsx +2 -0
  85. package/src/components/sections/ProductGallery/ProductGallery.tsx +2 -0
  86. package/src/components/sections/ProductShelf/ProductShelf.tsx +2 -0
  87. package/src/components/sections/ProductTiles/ProductTiles.tsx +2 -0
  88. package/src/components/sections/RegionBar/RegionBar.tsx +2 -0
  89. package/src/components/templates/LandingPage/LandingPage.tsx +9 -8
  90. package/src/pages/404.tsx +2 -1
  91. package/src/pages/500.tsx +2 -1
  92. package/src/pages/[slug]/p.tsx +12 -11
  93. package/src/pages/login.tsx +2 -1
  94. package/src/utils/cms.ts +10 -0
  95. package/.next/static/chunks/3166-a8f5e248b43b7766.js +0 -1
  96. package/.next/static/chunks/6355.57d1a07f50ee6cc9.js +0 -1
  97. package/.next/static/chunks/7191-4faf346dc8112e08.js +0 -1
  98. package/.next/static/chunks/9173-9fc2b806c0ac0b8d.js +0 -1
  99. package/.next/static/chunks/BannerNewsletter.a9ea51c53885c80f.js +0 -1
  100. package/.next/static/chunks/BannerText.21f106b180339df1.js +0 -1
  101. package/.next/static/chunks/Footer.09dddd47ce6c816f.js +0 -1
  102. package/.next/static/chunks/Newsletter.2c79d1813e9f9c95.js +0 -1
  103. package/.next/static/chunks/ProductShelf.3ddb66d12af618d2.js +0 -1
  104. package/.next/static/chunks/ProductTiles.81efd0bf3542f004.js +0 -1
  105. package/.next/static/chunks/RegionModal.503f063f2e19b936.js +0 -1
  106. package/.next/static/chunks/RegionSlider.00de4571775d04cc.js +0 -1
  107. package/.next/static/chunks/pages/404-dca50618ea3e6fb6.js +0 -1
  108. package/.next/static/chunks/pages/500-ae6697c7631fb07a.js +0 -1
  109. package/.next/static/chunks/pages/[...slug]-debd8b208a0e3d02.js +0 -1
  110. package/.next/static/chunks/pages/[slug]/p-9e6d7d3fd6978f5a.js +0 -1
  111. package/.next/static/chunks/pages/account/403-a3d8b31b4e9ee8a6.js +0 -1
  112. package/.next/static/chunks/pages/account/404-22b789f04fcdce39.js +0 -1
  113. package/.next/static/chunks/pages/index-b45c9535696b5ab1.js +0 -1
  114. package/.next/static/chunks/pages/login-bae3a4cdaaed110c.js +0 -1
  115. package/.next/static/chunks/pages/s-011eedb19dcdccc6.js +0 -1
  116. /package/.next/static/{tVd-SsiuJlud_z2vlEscj → oQne5jO4IL3AxXpTpm5ye}/_ssgManifest.js +0 -0
@@ -1,23 +1,23 @@
1
1
 
2
- > @faststore/core@3.69.0 prebuild /home/runner/work/faststore/faststore/packages/core
2
+ > @faststore/core@3.70.0 prebuild /home/runner/work/faststore/faststore/packages/core
3
3
  > na run partytown && na run generate
4
4
 
5
5
 
6
- > @faststore/core@3.69.0 partytown /home/runner/work/faststore/faststore/packages/core
6
+ > @faststore/core@3.70.0 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.69.0 generate /home/runner/work/faststore/faststore/packages/core
11
+ > @faststore/core@3.70.0 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.69.0 generate:schema /home/runner/work/faststore/faststore/packages/core
15
+ > @faststore/core@3.70.0 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.69.0 generate:codegen /home/runner/work/faststore/faststore/packages/core
20
+ > @faststore/core@3.70.0 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.69.0 format:generated /home/runner/work/faststore/faststore/packages/core
40
+ > @faststore/core@3.70.0 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.69.0 build /home/runner/work/faststore/faststore/packages/core
44
+ > @faststore/core@3.70.0 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
@@ -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.58 kB 139 kB
76
+ ┌ ● / 3.66 kB 139 kB
77
77
  ├ └ css/b1806cbafd0c1f81.css 3.06 kB
78
78
  ├ /_app 0 B 105 kB
79
- ├ ● /[...slug] 2.4 kB 147 kB
80
- ├ ● /[slug]/p 32.3 kB 168 kB
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.51 kB 137 kB
85
- ├ ● /500 1.52 kB 137 kB
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.42 kB 138 kB
88
+ ├ λ /account/403 2.44 kB 138 kB
89
89
  ├ └ css/b7bba8fce075688b.css 4.2 kB
90
- ├ λ /account/404 2.11 kB 138 kB
90
+ ├ λ /account/404 2.13 kB 138 kB
91
91
  ├ └ css/5347dbc8b71de47d.css 4.25 kB
92
- ├ λ /account/orders 8.94 kB 144 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.64 kB 137 kB
108
- └ ● /s 3.2 kB 148 kB
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-42d75fbe3cafd732.js 3.8 kB
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)
@@ -1,14 +1,14 @@
1
1
 
2
- > @faststore/core@3.69.0 test /home/runner/work/faststore/faststore/packages/core
2
+ > @faststore/core@3.70.0 test /home/runner/work/faststore/faststore/packages/core
3
3
  > jest
4
4
 
5
- PASS test/utils/multipleTemplates.test.ts (27.108 s)
6
- PASS test/server/cms/global.test.ts (27.451 s)
5
+ PASS test/server/cms/global.test.ts (25.901 s)
6
+ PASS test/utils/multipleTemplates.test.ts (26.067 s)
7
7
  PASS test/server/cms/index.test.ts
8
- PASS test/server/index.test.ts (30.583 s)
8
+ PASS test/server/index.test.ts (29.729 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.868 s
13
+ Time: 30.888 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.1](https://github.com/vtex/faststore/compare/v3.70.0...v3.70.1) (2025-08-04)
7
+
8
+ ### Bug Fixes
9
+
10
+ - Using SEO product name and description input if available ([#2969](https://github.com/vtex/faststore/issues/2969)) ([590000d](https://github.com/vtex/faststore/commit/590000d63539e0ce476018027a7ed2fdd2589c45)), closes [#2701](https://github.com/vtex/faststore/issues/2701)
11
+
12
+ # [3.70.0](https://github.com/vtex/faststore/compare/v3.69.1...v3.70.0) (2025-08-01)
13
+
14
+ ### Features
15
+
16
+ - [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))
17
+
6
18
  ## [3.69.1](https://github.com/vtex/faststore/compare/v3.69.0...v3.69.1) (2025-08-01)
7
19
 
8
20
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "3.69.1",
3
+ "version": "3.70.1",
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": "a9e52da1845bb5f3aff66fcef75efdb2970f6ed6"
110
+ "gitHead": "367347f3ba4d9da0c62d99e6a32faf385b6d54da"
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 Component = components[name]
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
- `${name} not found. Add a new component for this section or remove it from the CMS`
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
- Breadcrumb,
51
- Hero,
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
- Breadcrumb,
59
- Hero,
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
  }
@@ -143,4 +143,6 @@ function RegionModal(regionModalProps: RegionModalProps) {
143
143
  )
144
144
  }
145
145
 
146
+ RegionModal.$componentKey = 'RegionModal'
147
+
146
148
  export default RegionModal
@@ -186,4 +186,6 @@ function RegionPopover(regionPopoverProps: RegionPopoverProps) {
186
186
  )
187
187
  }
188
188
 
189
+ RegionPopover.$componentKey = 'RegionPopover'
190
+
189
191
  export default RegionPopover
@@ -404,4 +404,6 @@ function RegionSlider() {
404
404
  )
405
405
  }
406
406
 
407
+ RegionSlider.$componentKey = 'RegionSlider'
408
+
407
409
  export default RegionSlider
@@ -37,6 +37,8 @@ function Alert({ icon, content, link: { text, to }, dismissible }: AlertProps) {
37
37
  )
38
38
  }
39
39
 
40
+ Alert.$componentKey = 'Alert'
41
+
40
42
  const OverridableAlert = getOverridableSection<typeof Alert>(
41
43
  'Alert',
42
44
  Alert,
@@ -44,4 +44,6 @@ function BannerNewsletter({
44
44
  )
45
45
  }
46
46
 
47
+ BannerNewsletter.$componentKey = 'BannerNewsletter'
48
+
47
49
  export default BannerNewsletter
@@ -57,6 +57,8 @@ function BannerText({
57
57
  )
58
58
  }
59
59
 
60
+ BannerText.$componentKey = 'BannerText'
61
+
60
62
  const OverridableBannerText = getOverridableSection<typeof BannerText>(
61
63
  'BannerText',
62
64
  BannerText,
@@ -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)
@@ -107,6 +107,8 @@ function EmptyState({
107
107
  )
108
108
  }
109
109
 
110
+ EmptyState.$componentKey = 'EmptyState'
111
+
110
112
  const OverridableEmptyState = getOverridableSection<typeof EmptyState>(
111
113
  'EmptyState',
112
114
  EmptyState,
@@ -90,4 +90,6 @@ const Footer = ({
90
90
  )
91
91
  }
92
92
 
93
+ Footer.$componentKey = 'Footer'
94
+
93
95
  export default Footer
@@ -77,6 +77,8 @@ const Hero = ({
77
77
  )
78
78
  }
79
79
 
80
+ Hero.$componentKey = 'Hero'
81
+
80
82
  const OverridableHero = getOverridableSection<typeof Hero>(
81
83
  'Hero',
82
84
  Hero,
@@ -18,4 +18,6 @@ function Incentives({ incentives, label }: Props) {
18
18
  )
19
19
  }
20
20
 
21
+ Incentives.$componentKey = 'Incentives'
22
+
21
23
  export default Incentives
@@ -110,6 +110,8 @@ function NavbarSection({
110
110
  )
111
111
  }
112
112
 
113
+ NavbarSection.$componentKey = 'Navbar'
114
+
113
115
  const OverridableNavbar = getOverridableSection<typeof NavbarSection>(
114
116
  'Navbar',
115
117
  NavbarSection,
@@ -113,6 +113,8 @@ function Newsletter({
113
113
  )
114
114
  }
115
115
 
116
+ Newsletter.$componentKey = 'Newsletter'
117
+
116
118
  const OverridableNewsletter = getOverridableSection<typeof Newsletter>(
117
119
  'Newsletter',
118
120
  Newsletter,
@@ -336,6 +336,8 @@ function ProductDetails({
336
336
  )
337
337
  }
338
338
 
339
+ ProductDetails.$componentKey = 'ProductDetails'
340
+
339
341
  export const fragment = gql(`
340
342
  fragment ProductDetailsFragment_product on StoreProduct {
341
343
  id: productID
@@ -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)
@@ -23,6 +23,8 @@ function ProductShelfSection({
23
23
  )
24
24
  }
25
25
 
26
+ ProductShelfSection.$componentKey = 'ProductShelf'
27
+
26
28
  const OverridableProductShelf = getOverridableSection<typeof ProductShelf>(
27
29
  'ProductShelf',
28
30
  ProductShelfSection,
@@ -115,4 +115,6 @@ const ProductTiles = ({
115
115
  )
116
116
  }
117
117
 
118
+ ProductTiles.$componentKey = 'ProductTiles'
119
+
118
120
  export default ProductTiles
@@ -43,6 +43,8 @@ function RegionBarSection({ ...otherProps }: RegionBarSectionProps) {
43
43
  )
44
44
  }
45
45
 
46
+ RegionBarSection.$componentKey = 'RegionBar'
47
+
46
48
  const OverridableRegionBar = getOverridableSection<typeof RegionBarSection>(
47
49
  'RegionBar',
48
50
  RegionBarSection,
@@ -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
- CrossSellingShelf,
31
- Incentives,
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
  }
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
  }
@@ -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
  }
@@ -191,8 +192,8 @@ function Page({
191
192
  mainEntityOfPage={`${meta.canonical}${
192
193
  settings?.seo?.mainEntityOfPage ?? ''
193
194
  }`}
194
- productName={product.name}
195
- description={product.description}
195
+ productName={title}
196
+ description={description}
196
197
  brand={product.brand.name}
197
198
  sku={product.sku}
198
199
  gtin={product.gtin}
@@ -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
  }
@@ -0,0 +1,10 @@
1
+ import type { ComponentType } from 'react'
2
+
3
+ export type ComponentTypeWithComponentKey<T> = ComponentType<T> & {
4
+ $componentKey?: string
5
+ }
6
+
7
+ export const getComponentKey = (
8
+ Component: ComponentTypeWithComponentKey<any>,
9
+ name: string
10
+ ) => Component.$componentKey ?? name