create-sitecore-jss 22.5.0-beta.10 → 22.5.0-beta.11
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.
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import Head from 'next/head';
|
|
6
6
|
import {
|
|
7
|
-
Placeholder,
|
|
8
7
|
LayoutServiceData,
|
|
9
8
|
Field,
|
|
10
|
-
DesignLibrary,
|
|
11
9
|
HTMLLink,
|
|
12
|
-
|
|
10
|
+
Placeholder,
|
|
11
|
+
<% if (templates.includes('nextjs-xmcloud')) { %>
|
|
12
|
+
DesignLibrary,
|
|
13
|
+
RenderingType,
|
|
14
|
+
<% } %>
|
|
13
15
|
} from '@sitecore-jss/sitecore-jss-nextjs';
|
|
14
16
|
import config from 'temp/config';
|
|
15
17
|
import Scripts from 'src/Scripts';
|
|
@@ -34,6 +36,26 @@ const Layout = ({ layoutData, headLinks }: LayoutProps): JSX.Element => {
|
|
|
34
36
|
const isPageEditing = layoutData.sitecore.context.pageEditing;
|
|
35
37
|
const mainClassPageEditing = isPageEditing ? 'editing-mode' : 'prod-mode';
|
|
36
38
|
|
|
39
|
+
const renderContent = () => (
|
|
40
|
+
<>
|
|
41
|
+
<header>
|
|
42
|
+
<div id="header">
|
|
43
|
+
{route && <Placeholder name="headless-header" rendering={route} />}
|
|
44
|
+
</div>
|
|
45
|
+
</header>
|
|
46
|
+
<main>
|
|
47
|
+
<div id="content">
|
|
48
|
+
{route && <Placeholder name="headless-main" rendering={route} />}
|
|
49
|
+
</div>
|
|
50
|
+
</main>
|
|
51
|
+
<footer>
|
|
52
|
+
<div id="footer">
|
|
53
|
+
{route && <Placeholder name="headless-footer" rendering={route} />}
|
|
54
|
+
</div>
|
|
55
|
+
</footer>
|
|
56
|
+
</>
|
|
57
|
+
);
|
|
58
|
+
|
|
37
59
|
return (
|
|
38
60
|
<>
|
|
39
61
|
<Scripts />
|
|
@@ -47,28 +69,14 @@ const Layout = ({ layoutData, headLinks }: LayoutProps): JSX.Element => {
|
|
|
47
69
|
|
|
48
70
|
{/* root placeholder for the app, which we add components to using route data */}
|
|
49
71
|
<div className={mainClassPageEditing}>
|
|
50
|
-
<% if (templates.includes('nextjs-xmcloud')
|
|
72
|
+
<% if (templates.includes('nextjs-xmcloud')) { %>
|
|
51
73
|
{layoutData.sitecore.context.renderingType === RenderingType.Component ? (
|
|
52
74
|
<DesignLibrary {...layoutData} />
|
|
53
75
|
) : (
|
|
54
|
-
|
|
55
|
-
<header>
|
|
56
|
-
<div id="header">
|
|
57
|
-
{route && <Placeholder name="headless-header" rendering={route} />}
|
|
58
|
-
</div>
|
|
59
|
-
</header>
|
|
60
|
-
<main>
|
|
61
|
-
<div id="content">
|
|
62
|
-
{route && <Placeholder name="headless-main" rendering={route} />}
|
|
63
|
-
</div>
|
|
64
|
-
</main>
|
|
65
|
-
<footer>
|
|
66
|
-
<div id="footer">
|
|
67
|
-
{route && <Placeholder name="headless-footer" rendering={route} />}
|
|
68
|
-
</div>
|
|
69
|
-
</footer>
|
|
70
|
-
</>
|
|
76
|
+
renderContent()
|
|
71
77
|
)}
|
|
78
|
+
<% } else { %>
|
|
79
|
+
{renderContent()}
|
|
72
80
|
<% } %>
|
|
73
81
|
</div>
|
|
74
82
|
</>
|
|
@@ -76,3 +84,4 @@ const Layout = ({ layoutData, headLinks }: LayoutProps): JSX.Element => {
|
|
|
76
84
|
};
|
|
77
85
|
|
|
78
86
|
export default Layout;
|
|
87
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-sitecore-jss",
|
|
3
|
-
"version": "22.5.0-beta.
|
|
3
|
+
"version": "22.5.0-beta.11",
|
|
4
4
|
"description": "Sitecore JSS initializer",
|
|
5
5
|
"bin": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"ts-node": "^10.9.1",
|
|
66
66
|
"typescript": "~5.6.3"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "60c1594cdbc7ff5c173965d4b95020778fae1d7f"
|
|
69
69
|
}
|