create-sitecore-jss 22.5.0-beta.10 → 22.5.0-beta.12
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
|
+
|
|
@@ -17,3 +17,7 @@ PERSONALIZE_MIDDLEWARE_CDP_TIMEOUT=
|
|
|
17
17
|
|
|
18
18
|
# Timeout (ms) for Sitecore Experience Edge requests to respond within. Default is 400.
|
|
19
19
|
PERSONALIZE_MIDDLEWARE_EDGE_TIMEOUT=
|
|
20
|
+
|
|
21
|
+
# Client ID and Secret used for Design Library functionality
|
|
22
|
+
SITECORE_AUTH_CLIENT_ID=
|
|
23
|
+
SITECORE_AUTH_CLIENT_SECRET=
|
package/dist/templates/nextjs-xmcloud/scripts/generate-component-builder/plugins/code-extraction.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentBuilderPlugin, ComponentBuilderPluginConfig } from '..';
|
|
2
|
-
import {
|
|
2
|
+
import { extractFiles } from '@sitecore-jss/sitecore-jss-dev-tools';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* If consented to, sends components code for code generation learning to XMC
|
|
@@ -8,7 +8,7 @@ class CodeExtractionPlugin implements ComponentBuilderPlugin {
|
|
|
8
8
|
order = 100;
|
|
9
9
|
|
|
10
10
|
exec(config: ComponentBuilderPluginConfig) {
|
|
11
|
-
|
|
11
|
+
extractFiles({});
|
|
12
12
|
return config;
|
|
13
13
|
}
|
|
14
14
|
}
|
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.12",
|
|
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": "7e0753049a5b53583287f5b6569a5dc4233745bb"
|
|
69
69
|
}
|