create-sitecore-jss 21.0.1 → 21.0.3

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 (33) hide show
  1. package/dist/initializers/nextjs/index.js +1 -1
  2. package/dist/templates/angular/package.json +5 -5
  3. package/dist/templates/angular/sitecore/definitions/components/graph-ql-integrated-demo.sitecore.graphql +3 -3
  4. package/dist/templates/angular/sitecore/definitions/routes.sitecore.ts +2 -2
  5. package/dist/templates/angular/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.graphql +3 -3
  6. package/dist/templates/angular/src/graphql-fragment-types.ts +3 -3
  7. package/dist/templates/nextjs/package.json +4 -4
  8. package/dist/templates/nextjs/src/temp/GraphQLIntrospectionResult.json +8 -8
  9. package/dist/templates/nextjs-styleguide/package.json +1 -1
  10. package/dist/templates/nextjs-styleguide/sitecore/definitions/components/graphql/GraphQL-IntegratedDemo.sitecore.graphql +3 -3
  11. package/dist/templates/nextjs-styleguide/sitecore/definitions/routes.sitecore.ts +3 -3
  12. package/dist/templates/nextjs-styleguide/src/components/graphql/GraphQL-ConnectedDemo.dynamic.graphql +3 -3
  13. package/dist/templates/nextjs-styleguide/src/components/graphql/GraphQL-ConnectedDemo.dynamic.tsx +7 -7
  14. package/dist/templates/nextjs-sxa/src/assets/basic/_footer.scss +2 -14
  15. package/dist/templates/nextjs-sxa/src/assets/basic/_promo.scss +5 -0
  16. package/dist/templates/nextjs-sxa/src/assets/sass/components/_component-container.scss +12 -9
  17. package/dist/templates/nextjs-sxa/src/components/Image.tsx +3 -4
  18. package/dist/templates/nextjs-sxa/src/components/PageContent.tsx +3 -2
  19. package/dist/templates/nextjs-sxa/src/pages/api/sitemap.ts +25 -1
  20. package/dist/templates/node-headless-ssr-experience-edge/package.json +2 -2
  21. package/dist/templates/node-headless-ssr-proxy/package.json +3 -3
  22. package/dist/templates/react/package.json +5 -5
  23. package/dist/templates/react/sitecore/definitions/components/GraphQL-IntegratedDemo.sitecore.graphql +3 -3
  24. package/dist/templates/react/sitecore/definitions/routes.sitecore.js +2 -2
  25. package/dist/templates/react/src/components/GraphQL-ConnectedDemo/query.graphql +3 -3
  26. package/dist/templates/react/src/temp/GraphQLFragmentTypes.json +3 -3
  27. package/dist/templates/react-native/package.json +4 -4
  28. package/dist/templates/vue/package.json +4 -4
  29. package/dist/templates/vue/sitecore/definitions/components/GraphQL-IntegratedDemo.sitecore.graphql +3 -3
  30. package/dist/templates/vue/sitecore/definitions/routes.sitecore.js +2 -2
  31. package/dist/templates/vue/src/components/GraphQL/GraphQL-ConnectedDemo.query.graphql +3 -3
  32. package/dist/templates/vue/src/temp/GraphQLFragmentTypes.json +3 -3
  33. package/package.json +2 -2
@@ -69,7 +69,7 @@ class NextjsInitializer {
69
69
  value: 'nextjs-styleguide-tracking',
70
70
  },
71
71
  {
72
- name: 'nextjs-sxa - Includes example components and setup for Headless SXA projects (only compatible with Sitecore XM Cloud)',
72
+ name: 'nextjs-sxa - Includes example components and setup for Headless SXA projects',
73
73
  value: 'nextjs-sxa',
74
74
  },
75
75
  {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "<%- appName %>",
3
- "version": "21.0.1",
3
+ "version": "21.0.3",
4
4
  "description": "Application utilizing Sitecore JavaScript Services and Angular (angular-cli).",
5
5
  "config": {
6
6
  "appName": "<%- appName %>",
@@ -63,7 +63,7 @@
63
63
  "@apollo/client": "^3.3.12",
64
64
  "@ngx-translate/core": "~13.0.0",
65
65
  "@ngx-translate/http-loader": "~6.0.0",
66
- "@sitecore-jss/sitecore-jss-angular": "^21.0.1",
66
+ "@sitecore-jss/sitecore-jss-angular": "^21.0.3",
67
67
  "apollo-angular": "~2.4.0",
68
68
  "bootstrap": "^4.3.1",
69
69
  "core-js": "~3.9.1",
@@ -86,9 +86,9 @@
86
86
  "@angular/cli": "~11.2.5",
87
87
  "@angular/compiler-cli": "~11.2.6",
88
88
  "@angular/language-service": "~11.2.6",
89
- "@sitecore-jss/sitecore-jss-angular-schematics": "^21.0.1",
90
- "@sitecore-jss/sitecore-jss-cli": "^21.0.1",
91
- "@sitecore-jss/sitecore-jss-dev-tools": "^21.0.1",
89
+ "@sitecore-jss/sitecore-jss-angular-schematics": "^21.0.3",
90
+ "@sitecore-jss/sitecore-jss-cli": "^21.0.3",
91
+ "@sitecore-jss/sitecore-jss-dev-tools": "^21.0.3",
92
92
  "@types/isomorphic-fetch": "0.0.35",
93
93
  "@types/jasmine": "~3.6.7",
94
94
  "@types/jasminewd2": "~2.0.8",
@@ -42,8 +42,8 @@ query IntegratedDemoQuery($datasource: String!, $contextItem: String!, $language
42
42
  # (as long as the GraphQLData helper is used)
43
43
  contextItem: item(path: $contextItem, language: $language) {
44
44
  id
45
- # Get the page title from the page template
46
- ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
45
+ # Get the page title from the app route template
46
+ ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
47
47
  pageTitle {
48
48
  value
49
49
  }
@@ -56,7 +56,7 @@ query IntegratedDemoQuery($datasource: String!, $contextItem: String!, $language
56
56
  # typing fragments can be used anywhere!
57
57
  # so in this case, we're grabbing the 'pageTitle'
58
58
  # field on all child route items.
59
- ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
59
+ ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
60
60
  pageTitle {
61
61
  jsonValue
62
62
  value
@@ -16,7 +16,7 @@ export default function addRoutesToManifest(manifest: Manifest): Promise<void> {
16
16
  // which routes can use by setting `template: YourCustomRouteTypeName` in their definition.
17
17
  const appTemplateSection = 'Page Metadata';
18
18
  manifest.setDefaultRouteType({
19
- name: '<%- helper.getAppPrefix(appPrefix, appName) %>Page',
19
+ name: '<%- helper.getAppPrefix(appPrefix, appName) %>App Route',
20
20
  fields: [
21
21
  {
22
22
  name: 'pageTitle',
@@ -25,7 +25,7 @@ export default function addRoutesToManifest(manifest: Manifest): Promise<void> {
25
25
  type: CommonFieldTypes.SingleLineText,
26
26
  },
27
27
  ],
28
- insertOptions: ['<%- helper.getAppPrefix(appPrefix, appName) %>Page'],
28
+ insertOptions: ['<%- helper.getAppPrefix(appPrefix, appName) %>App Route'],
29
29
  });
30
30
 
31
31
  return mergeFs('./data/routes') // relative to process invocation (i.e. your package.json)
@@ -40,8 +40,8 @@ query ConnectedDemoQuery($datasource: String!, $contextItem: String!, $language:
40
40
  # $contextItem should be set to the ID of the current context item (the route item)
41
41
  contextItem: item(path: $contextItem, language: $language) {
42
42
  id
43
- # Get the page title from the page template
44
- ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
43
+ # Get the page title from the app route template
44
+ ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
45
45
  pageTitle {
46
46
  value
47
47
  }
@@ -54,7 +54,7 @@ query ConnectedDemoQuery($datasource: String!, $contextItem: String!, $language:
54
54
  # typing fragments can be used anywhere!
55
55
  # so in this case, we're grabbing the 'pageTitle'
56
56
  # field on all child route items.
57
- ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
57
+ ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
58
58
  pageTitle {
59
59
  jsonValue
60
60
  value
@@ -153,7 +153,7 @@ export default {
153
153
  name: '<%- helper.getAppPrefix(appPrefix, appName, false) %>ContentBlock',
154
154
  },
155
155
  {
156
- name: 'C__<%- helper.getAppPrefix(appPrefix, appName, false) %>Page',
156
+ name: 'C__<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute',
157
157
  },
158
158
  {
159
159
  name: 'JsonRendering',
@@ -192,13 +192,13 @@ export default {
192
192
  },
193
193
  {
194
194
  kind: 'INTERFACE',
195
- name: '<%- helper.getAppPrefix(appPrefix, appName, false) %>Page',
195
+ name: '<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute',
196
196
  possibleTypes: [
197
197
  {
198
198
  name: '<%- helper.getAppPrefix(appPrefix, appName, false) %>ExampleCustomRouteType',
199
199
  },
200
200
  {
201
- name: 'C__<%- helper.getAppPrefix(appPrefix, appName, false) %>Page',
201
+ name: 'C__<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute',
202
202
  },
203
203
  ],
204
204
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "<%- appName %>",
3
3
  "description": "Application utilizing Sitecore JavaScript Services and Next.js",
4
- "version": "21.0.1",
4
+ "version": "21.0.3",
5
5
  "private": true,
6
6
  "config": {
7
7
  "appName": "<%- appName %>",
@@ -29,10 +29,10 @@
29
29
  },
30
30
  "license": "Apache-2.0",
31
31
  "dependencies": {
32
- "@sitecore-jss/sitecore-jss-nextjs": "^21.0.1",
32
+ "@sitecore-jss/sitecore-jss-nextjs": "^21.0.3",
33
33
  "graphql": "~15.8.0",
34
34
  "graphql-tag": "^2.11.0",
35
- "next": "^12.2.5",
35
+ "next": "^12.3.1",
36
36
  "next-localization": "^0.12.0",
37
37
  "react": "^18.1.0",
38
38
  "react-dom": "^18.1.0"
@@ -45,7 +45,7 @@
45
45
  "@graphql-codegen/typescript-operations": "^1.17.9",
46
46
  "@graphql-codegen/typescript-resolvers": "^1.17.10",
47
47
  "@graphql-typed-document-node/core": "^3.1.0",
48
- "@sitecore-jss/sitecore-jss-cli": "^21.0.1",
48
+ "@sitecore-jss/sitecore-jss-cli": "^21.0.3",
49
49
  "@types/node": "^14.6.4",
50
50
  "@types/react": "^18.0.12",
51
51
  "@types/react-dom": "^18.0.5",
@@ -2179,7 +2179,7 @@
2179
2179
  },
2180
2180
  {
2181
2181
  "kind": "OBJECT",
2182
- "name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>Page",
2182
+ "name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute",
2183
2183
  "ofType": null
2184
2184
  },
2185
2185
  {
@@ -17760,7 +17760,7 @@
17760
17760
  "interfaces": [
17761
17761
  {
17762
17762
  "kind": "INTERFACE",
17763
- "name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>Page",
17763
+ "name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute",
17764
17764
  "ofType": null
17765
17765
  },
17766
17766
  {
@@ -18219,8 +18219,8 @@
18219
18219
  },
18220
18220
  {
18221
18221
  "kind": "OBJECT",
18222
- "name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>Page",
18223
- "description": "/sitecore/templates/Project/<%- helper.getAppPrefix(appPrefix, appName, false) %>/<%- helper.getAppPrefix(appPrefix, appName, false) %>-Page template (ID: {787584C0-A057-5876-9836-F8B3708F0CAF}). NOTE: This is a concrete type. Favor using interfaces instead of this type (e.g. <%- helper.getAppPrefix(appPrefix, appName, false) %>Page) for reliable querying.",
18222
+ "name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute",
18223
+ "description": "/sitecore/templates/Project/<%- helper.getAppPrefix(appPrefix, appName, false) %>/<%- helper.getAppPrefix(appPrefix, appName, false) %>-App Route template (ID: {787584C0-A057-5876-9836-F8B3708F0CAF}). NOTE: This is a concrete type. Favor using interfaces instead of this type (e.g. <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute) for reliable querying.",
18224
18224
  "fields": [
18225
18225
  {
18226
18226
  "name": "ancestors",
@@ -18643,7 +18643,7 @@
18643
18643
  "interfaces": [
18644
18644
  {
18645
18645
  "kind": "INTERFACE",
18646
- "name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>Page",
18646
+ "name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute",
18647
18647
  "ofType": null
18648
18648
  },
18649
18649
  {
@@ -21496,8 +21496,8 @@
21496
21496
  },
21497
21497
  {
21498
21498
  "kind": "INTERFACE",
21499
- "name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>Page",
21500
- "description": "/sitecore/templates/Project/<%- helper.getAppPrefix(appPrefix, appName, false) %>/<%- helper.getAppPrefix(appPrefix, appName, false) %>-Page template (ID: {787584C0-A057-5876-9836-F8B3708F0CAF}). Also implements Route.",
21499
+ "name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute",
21500
+ "description": "/sitecore/templates/Project/<%- helper.getAppPrefix(appPrefix, appName, false) %>/<%- helper.getAppPrefix(appPrefix, appName, false) %>-App Route template (ID: {787584C0-A057-5876-9836-F8B3708F0CAF}). Also implements Route.",
21501
21501
  "fields": [
21502
21502
  {
21503
21503
  "name": "pageTitle",
@@ -21523,7 +21523,7 @@
21523
21523
  },
21524
21524
  {
21525
21525
  "kind": "OBJECT",
21526
- "name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>Page",
21526
+ "name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute",
21527
21527
  "ofType": null
21528
21528
  }
21529
21529
  ]
@@ -4,7 +4,7 @@
4
4
  "nprogress": "~0.2.0"
5
5
  },
6
6
  "devDependencies": {
7
- "@sitecore-jss/sitecore-jss-dev-tools": "^21.0.1",
7
+ "@sitecore-jss/sitecore-jss-dev-tools": "^21.0.3",
8
8
  "@types/nprogress": "^0.2.0"
9
9
  },
10
10
  "scripts": {
@@ -42,8 +42,8 @@ query IntegratedDemoQuery($datasource: String!, $contextItem: String!, $language
42
42
  # (as long as the GraphQLData helper is used)
43
43
  contextItem: item(path: $contextItem, language: $language) {
44
44
  id
45
- # Get the page title from the page template
46
- ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
45
+ # Get the page title from the app route template
46
+ ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
47
47
  pageTitle {
48
48
  value
49
49
  }
@@ -56,7 +56,7 @@ query IntegratedDemoQuery($datasource: String!, $contextItem: String!, $language
56
56
  # typing fragments can be used anywhere!
57
57
  # so in this case, we're grabbing the 'pageTitle'
58
58
  # field on all child route items.
59
- ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
59
+ ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
60
60
  pageTitle {
61
61
  jsonValue
62
62
  value
@@ -24,8 +24,8 @@ export default function addRoutesToManifest(manifest: Manifest): Promise<void> {
24
24
  const appTemplateSection = 'Page Metadata';
25
25
 
26
26
  manifest.setDefaultRouteType({
27
- name: '<%- helper.getAppPrefix(appPrefix, appName) %>Page',
28
- displayName: 'Page',
27
+ name: '<%- helper.getAppPrefix(appPrefix, appName) %>App Route',
28
+ displayName: 'App Route',
29
29
  fields: [
30
30
  {
31
31
  name: 'pageTitle',
@@ -34,7 +34,7 @@ export default function addRoutesToManifest(manifest: Manifest): Promise<void> {
34
34
  type: CommonFieldTypes.SingleLineText,
35
35
  },
36
36
  ],
37
- insertOptions: ['<%- helper.getAppPrefix(appPrefix, appName) %>Page'],
37
+ insertOptions: ['<%- helper.getAppPrefix(appPrefix, appName) %>App Route'],
38
38
  });
39
39
 
40
40
  return mergeFs('./data/routes') // relative to process invocation (i.e. your package.json)
@@ -40,8 +40,8 @@ query ConnectedDemoQuery($datasource: String!, $contextItem: String!, $language:
40
40
  # $contextItem should be set to the ID of the current context item (the route item)
41
41
  contextItem: item(path: $contextItem, language: $language) {
42
42
  id
43
- # Get the page title from the page template
44
- ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
43
+ # Get the page title from the app route template
44
+ ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
45
45
  pageTitle {
46
46
  value
47
47
  }
@@ -54,7 +54,7 @@ query ConnectedDemoQuery($datasource: String!, $contextItem: String!, $language:
54
54
  # typing fragments can be used anywhere!
55
55
  # so in this case, we're grabbing the 'pageTitle'
56
56
  # field on all child route items.
57
- ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
57
+ ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
58
58
  pageTitle {
59
59
  jsonValue
60
60
  value
@@ -12,18 +12,18 @@ import {
12
12
  import NextLink from 'next/link';
13
13
  import {
14
14
  ConnectedDemoQueryDocument,
15
- <%- helper.getAppPrefix(appPrefix, appName, false) %>Page as Page,
15
+ <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute as AppRoute,
16
16
  Item,
17
17
  <%- helper.getAppPrefix(appPrefix, appName, false) %>GraphQlConnectedDemo as GrapQLConnectedDemoDatasource,
18
18
  } from './GraphQL-ConnectedDemo.dynamic.graphql';
19
19
  import { ComponentProps } from 'lib/component-props';
20
20
  import config from 'temp/config';
21
21
 
22
- type PageItem = Page & Item;
22
+ type RouteItem = AppRoute & Item;
23
23
 
24
24
  type GraphQLConnectedDemoData = {
25
25
  datasource: GrapQLConnectedDemoDatasource;
26
- contextItem: PageItem;
26
+ contextItem: RouteItem;
27
27
  };
28
28
 
29
29
  type GraphQLConnectedDemoProps = ComponentProps & GraphQLConnectedDemoData;
@@ -80,12 +80,12 @@ const GraphQLConnectedDemo = (props: GraphQLConnectedDemoProps): JSX.Element =>
80
80
  children:
81
81
  <ul>
82
82
  {props.contextItem.children.results.map((child) => {
83
- const pageItem = child as PageItem;
83
+ const routeItem = child as RouteItem;
84
84
 
85
85
  return (
86
- <li key={pageItem.id}>
87
- <NextLink href={pageItem.url.path}>{pageItem.pageTitle?.value}</NextLink>
88
- (editable title too! <Text field={pageItem.pageTitle?.jsonValue} />)
86
+ <li key={routeItem.id}>
87
+ <NextLink href={routeItem.url.path}>{routeItem.pageTitle?.value}</NextLink>
88
+ (editable title too! <Text field={routeItem.pageTitle?.jsonValue} />)
89
89
  </li>
90
90
  );
91
91
  })}
@@ -1,16 +1,6 @@
1
1
  @import "@sass/abstracts/mixins";
2
2
  @import "variables";
3
3
 
4
- .prod-mode {
5
- #footer {
6
- padding-top: 80px;
7
-
8
- @include respond-to(mobile-large) {
9
- padding-top: 0;
10
- }
11
- }
12
- }
13
-
14
4
  footer {
15
5
  @include respond-to(mobile-large) {
16
6
  padding-top: 0;
@@ -26,10 +16,8 @@ footer {
26
16
  color: $text-white;
27
17
  }
28
18
 
29
- p {
30
- span {
31
- color: $text-white;
32
- }
19
+ p, span {
20
+ color: $text-white;
33
21
  }
34
22
  }
35
23
 
@@ -7,6 +7,11 @@
7
7
  padding-left: 0;
8
8
  padding-right: 0;
9
9
  padding-bottom: 0;
10
+ margin-bottom: 80px;
11
+
12
+ @include respond-to(mobile-large) {
13
+ margin-bottom: 0;
14
+ }
10
15
 
11
16
  >.component-content {
12
17
  border: 0;
@@ -2,14 +2,17 @@
2
2
 
3
3
  .container-wrapper {
4
4
  width: 100%;
5
- .container {
6
- padding: 0;
7
-
8
- &.fullwidth-container {
9
- max-width: unset;
10
- }
11
- .component-content {
12
- @include clearfix();
13
- }
5
+ }
6
+
7
+ .container {
8
+ padding: 0;
9
+
10
+ &.fullwidth-container {
11
+ max-width: unset;
14
12
  }
13
+
14
+ .component-content {
15
+ @include clearfix();
16
+ }
17
+
15
18
  }
@@ -8,7 +8,6 @@ import {
8
8
  Text,
9
9
  useSitecoreContext,
10
10
  } from '@sitecore-jss/sitecore-jss-nextjs';
11
- import { getEEMarkup } from '@sitecore-jss/sitecore-jss-react';
12
11
 
13
12
  interface Fields {
14
13
  Image: ImageField;
@@ -38,12 +37,12 @@ export const Banner = (props: ImageProps): JSX.Element => {
38
37
  ?.replace(`width="${props?.fields?.Image?.value?.width}"`, 'width="100%"')
39
38
  .replace(`height="${props?.fields?.Image?.value?.height}"`, 'height="100%"'),
40
39
  };
41
- const Image = () => (modifyImageProps.editable ? getEEMarkup(modifyImageProps) : null);
40
+ const id = props.params.RenderingIdentifier;
42
41
 
43
42
  return (
44
- <div className={`component hero-banner ${props.params.styles}`}>
43
+ <div className={`component hero-banner ${props.params.styles}`} id={id ? id : undefined}>
45
44
  <div className="component-content sc-sxa-image-hero-banner" style={backgroundStyle}>
46
- {sitecoreContext.pageEditing ? <Image /> : ''}
45
+ {sitecoreContext.pageEditing ? <JssImage field={modifyImageProps} /> : ''}
47
46
  </div>
48
47
  </div>
49
48
  );
@@ -29,10 +29,11 @@ const ComponentContent = (props: ComponentContentProps) => {
29
29
 
30
30
  export const Default = (props: PageContentProps): JSX.Element => {
31
31
  const { sitecoreContext } = useSitecoreContext();
32
+ const id = props.params.RenderingIdentifier;
32
33
 
33
34
  if (!(props.fields && props.fields.Content) && !sitecoreContext?.route?.fields?.Content) {
34
35
  return (
35
- <div className={`component content ${props.params.styles}`}>
36
+ <div className={`component content ${props.params.styles}`} id={id ? id : undefined}>
36
37
  <div className="component-content">
37
38
  <div className="field-content">[Content]</div>
38
39
  </div>
@@ -47,7 +48,7 @@ export const Default = (props: PageContentProps): JSX.Element => {
47
48
  ) as RichTextField;
48
49
 
49
50
  return (
50
- <ComponentContent styles={props.params.styles} id={props.params.RenderingIdentifier}>
51
+ <ComponentContent styles={props.params.styles} id={id}>
51
52
  <JssRichText field={field} />
52
53
  </ComponentContent>
53
54
  );
@@ -19,13 +19,16 @@ const sitemapApi = async (
19
19
  siteName: config.jssAppName,
20
20
  });
21
21
 
22
+ // if url has sitemap-{n}.xml type. The id - can be null if it's sitemap.xml request
22
23
  const sitemapPath = await sitemapXmlService.getSitemap(id as string);
23
24
 
25
+ // if sitemap is match otherwise redirect to 404 page
24
26
  if (sitemapPath) {
25
27
  const isAbsoluteUrl = sitemapPath.match(ABSOLUTE_URL_REGEXP);
26
28
  const sitemapUrl = isAbsoluteUrl ? sitemapPath : `${config.sitecoreApiHost}${sitemapPath}`;
27
29
  res.setHeader('Content-Type', 'text/xml;charset=utf-8');
28
30
 
31
+ // need to prepare stream from sitemap url
29
32
  return new AxiosDataFetcher()
30
33
  .get(sitemapUrl, {
31
34
  responseType: 'stream',
@@ -36,7 +39,28 @@ const sitemapApi = async (
36
39
  .catch(() => res.redirect('/404'));
37
40
  }
38
41
 
39
- res.redirect('/404');
42
+ // this approache if user go to /sitemap.xml - under it generate xml page with list of sitemaps
43
+ const sitemaps = await sitemapXmlService.fetchSitemaps();
44
+
45
+ if (!sitemaps.length) {
46
+ return res.redirect('/404');
47
+ }
48
+
49
+ const SitemapLinks = sitemaps
50
+ .map(
51
+ (item) =>
52
+ `<sitemap>
53
+ <loc>${item}</loc>
54
+ </sitemap>
55
+ `
56
+ )
57
+ .join('');
58
+
59
+ res.setHeader('Content-Type', 'text/xml;charset=utf-8');
60
+
61
+ return res.send(`
62
+ <sitemapindex xmlns="http://sitemaps.org/schemas/sitemap/0.9" encoding="UTF-8">${SitemapLinks}</sitemapindex>
63
+ `);
40
64
  };
41
65
 
42
66
  export default sitemapApi;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-headless-ssr-experience-edge-sample",
3
- "version": "21.0.1",
3
+ "version": "21.0.3",
4
4
  "description": "Node server-side-rendering sample for running JSS apps under Node hosting using Experience Edge",
5
5
  "scripts": {
6
6
  "start": "ts-node ./src/index.ts"
@@ -23,7 +23,7 @@
23
23
  "homepage": "https://jss.sitecore.com",
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
- "@sitecore-jss/sitecore-jss": "^21.0.1",
26
+ "@sitecore-jss/sitecore-jss": "^21.0.3",
27
27
  "compression": "^1.7.4",
28
28
  "express": "^4.17.1",
29
29
  "dotenv": "^16.0.0"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-headless-ssr-proxy-sample",
3
- "version": "21.0.1",
3
+ "version": "21.0.3",
4
4
  "description": "Node server-side-rendering proxy sample for running JSS apps under Node hosting",
5
5
  "scripts": {
6
6
  "start": "ts-node ./src/index.ts"
@@ -23,8 +23,8 @@
23
23
  "homepage": "https://jss.sitecore.com",
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
- "@sitecore-jss/sitecore-jss": "^21.0.1",
27
- "@sitecore-jss/sitecore-jss-proxy": "^21.0.1",
26
+ "@sitecore-jss/sitecore-jss": "^21.0.3",
27
+ "@sitecore-jss/sitecore-jss-proxy": "^21.0.3",
28
28
  "agentkeepalive": "^4.1.3",
29
29
  "compression": "~1.7.3",
30
30
  "express": "~4.16.4",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "<%- appName %>",
3
3
  "description": "Application utilizing Sitecore JavaScript Services and React (create-react-app).",
4
- "version": "21.0.1",
4
+ "version": "21.0.3",
5
5
  "private": true,
6
6
  "config": {
7
7
  "appName": "<%- appName %>",
@@ -32,7 +32,7 @@
32
32
  "license": "Apache-2.0",
33
33
  "dependencies": {
34
34
  "@apollo/client": "^3.5.6",
35
- "@sitecore-jss/sitecore-jss-react": "^21.0.1",
35
+ "@sitecore-jss/sitecore-jss-react": "^21.0.3",
36
36
  "axios": "^0.21.1",
37
37
  "bootstrap": "^4.3.1",
38
38
  "cross-fetch": "^3.0.6",
@@ -54,9 +54,9 @@
54
54
  "@babel/core": "^7.16.0",
55
55
  "@babel/preset-env": "^7.10.4",
56
56
  "@babel/register": "~7.6.2",
57
- "@sitecore-jss/sitecore-jss-cli": "^21.0.1",
58
- "@sitecore-jss/sitecore-jss-dev-tools": "^21.0.1",
59
- "@sitecore-jss/sitecore-jss-rendering-host": "^21.0.1",
57
+ "@sitecore-jss/sitecore-jss-cli": "^21.0.3",
58
+ "@sitecore-jss/sitecore-jss-dev-tools": "^21.0.3",
59
+ "@sitecore-jss/sitecore-jss-rendering-host": "^21.0.3",
60
60
  "babel-eslint": "^10.1.0",
61
61
  "babel-loader": "8.1.0",
62
62
  "babel-preset-react-app": "~9.0.2",
@@ -42,8 +42,8 @@ query IntegratedDemoQuery($datasource: String!, $contextItem: String!, $language
42
42
  # (as long as the GraphQLData helper is used)
43
43
  contextItem: item(path: $contextItem, language: $language) {
44
44
  id
45
- # Get the page title from the page template
46
- ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
45
+ # Get the page title from the app route template
46
+ ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
47
47
  pageTitle {
48
48
  value
49
49
  }
@@ -56,7 +56,7 @@ query IntegratedDemoQuery($datasource: String!, $contextItem: String!, $language
56
56
  # typing fragments can be used anywhere!
57
57
  # so in this case, we're grabbing the 'pageTitle'
58
58
  # field on all child route items.
59
- ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
59
+ ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
60
60
  pageTitle {
61
61
  jsonValue
62
62
  value
@@ -28,7 +28,7 @@ export default function addRoutesToManifest(manifest) {
28
28
  const appTemplateSection = 'Page Metadata';
29
29
 
30
30
  manifest.setDefaultRouteType({
31
- name: '<%- helper.getAppPrefix(appPrefix, appName) %>Page',
31
+ name: '<%- helper.getAppPrefix(appPrefix, appName) %>App Route',
32
32
  fields: [
33
33
  {
34
34
  name: 'pageTitle',
@@ -37,7 +37,7 @@ export default function addRoutesToManifest(manifest) {
37
37
  type: CommonFieldTypes.SingleLineText,
38
38
  },
39
39
  ],
40
- insertOptions: ['<%- helper.getAppPrefix(appPrefix, appName) %>Page'],
40
+ insertOptions: ['<%- helper.getAppPrefix(appPrefix, appName) %>App Route'],
41
41
  });
42
42
 
43
43
  return mergeFs('./data/routes') // relative to process invocation (i.e. your package.json)
@@ -40,8 +40,8 @@ query ConnectedDemoQuery($datasource: String!, $contextItem: String!, $language:
40
40
  # $contextItem should be set to the ID of the current context item (the route item)
41
41
  contextItem: item(path: $contextItem, language: $language) {
42
42
  id
43
- # Get the page title from the page template
44
- ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
43
+ # Get the page title from the app route template
44
+ ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
45
45
  pageTitle {
46
46
  value
47
47
  }
@@ -54,7 +54,7 @@ query ConnectedDemoQuery($datasource: String!, $contextItem: String!, $language:
54
54
  # typing fragments can be used anywhere!
55
55
  # so in this case, we're grabbing the 'pageTitle'
56
56
  # field on all child route items.
57
- ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
57
+ ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
58
58
  pageTitle {
59
59
  jsonValue
60
60
  value
@@ -141,7 +141,7 @@
141
141
  "name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>ContentBlock"
142
142
  },
143
143
  {
144
- "name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>Page"
144
+ "name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute"
145
145
  },
146
146
  {
147
147
  "name": "JsonRendering"
@@ -180,13 +180,13 @@
180
180
  },
181
181
  {
182
182
  "kind": "INTERFACE",
183
- "name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>Page",
183
+ "name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute",
184
184
  "possibleTypes": [
185
185
  {
186
186
  "name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>ExampleCustomRouteType"
187
187
  },
188
188
  {
189
- "name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>Page"
189
+ "name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute"
190
190
  }
191
191
  ]
192
192
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "<%- appName %>",
3
- "version": "21.0.1",
3
+ "version": "21.0.3",
4
4
  "description": "A basic React Native app utilizing Sitecore JavaScript Services",
5
5
  "config": {
6
6
  "appName": "<%- appName %>",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@react-native-community/masked-view": "^0.1.10",
30
- "@sitecore-jss/sitecore-jss-react-native": "^21.0.1",
30
+ "@sitecore-jss/sitecore-jss-react-native": "^21.0.3",
31
31
  "prop-types": "^15.6.0",
32
32
  "react": "16.13.1",
33
33
  "react-native": "^0.63.4",
@@ -41,8 +41,8 @@
41
41
  },
42
42
  "private": true,
43
43
  "devDependencies": {
44
- "@sitecore-jss/sitecore-jss-cli": "^21.0.1",
45
- "@sitecore-jss/sitecore-jss-dev-tools": "^21.0.1",
44
+ "@sitecore-jss/sitecore-jss-cli": "^21.0.3",
45
+ "@sitecore-jss/sitecore-jss-dev-tools": "^21.0.3",
46
46
  "babel-core": "^6.26.0",
47
47
  "babel-eslint": "^8.2.1",
48
48
  "babel-plugin-inline-replace-variables": "^1.3.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "<%- appName %>",
3
- "version": "21.0.1",
3
+ "version": "21.0.3",
4
4
  "description": "Application utilizing Sitecore JavaScript Services and Vue (vue-cli).",
5
5
  "private": true,
6
6
  "config": {
@@ -48,7 +48,7 @@
48
48
  "dependencies": {
49
49
  "@apollo/client": "^3.5.6",
50
50
  "@panter/vue-i18next": "~0.15.1",
51
- "@sitecore-jss/sitecore-jss-vue": "^21.0.1",
51
+ "@sitecore-jss/sitecore-jss-vue": "^21.0.3",
52
52
  "@vue/apollo-composable": "^4.0.0-alpha.12",
53
53
  "@vue/apollo-option": "^4.0.0-alpha.11",
54
54
  "@vue/apollo-ssr": "^4.0.0-alpha.11",
@@ -67,8 +67,8 @@
67
67
  },
68
68
  "devDependencies": {
69
69
  "@babel/register": "7.6.2",
70
- "@sitecore-jss/sitecore-jss-cli": "^21.0.1",
71
- "@sitecore-jss/sitecore-jss-dev-tools": "^21.0.1",
70
+ "@sitecore-jss/sitecore-jss-cli": "^21.0.3",
71
+ "@sitecore-jss/sitecore-jss-dev-tools": "^21.0.3",
72
72
  "@vue/cli-plugin-babel": "~4.5.13",
73
73
  "@vue/cli-plugin-eslint": "~4.5.13",
74
74
  "@vue/cli-service": "~4.5.13",
@@ -42,8 +42,8 @@ query IntegratedDemoQuery($datasource: String!, $contextItem: String!, $language
42
42
  # (as long as the GraphQLData helper is used)
43
43
  contextItem: item(path: $contextItem, language: $language) {
44
44
  id
45
- # Get the page title from the page template
46
- ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
45
+ # Get the page title from the app route template
46
+ ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
47
47
  pageTitle {
48
48
  value
49
49
  }
@@ -56,7 +56,7 @@ query IntegratedDemoQuery($datasource: String!, $contextItem: String!, $language
56
56
  # typing fragments can be used anywhere!
57
57
  # so in this case, we're grabbing the 'pageTitle'
58
58
  # field on all child route items.
59
- ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
59
+ ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
60
60
  pageTitle {
61
61
  jsonValue
62
62
  value
@@ -22,7 +22,7 @@ export default function addRoutesToManifest(manifest) {
22
22
  const appTemplateSection = 'Page Metadata';
23
23
 
24
24
  manifest.setDefaultRouteType({
25
- name: '<%- helper.getAppPrefix(appPrefix, appName) %>Page',
25
+ name: '<%- helper.getAppPrefix(appPrefix, appName) %>App Route',
26
26
  fields: [
27
27
  {
28
28
  name: 'pageTitle',
@@ -31,7 +31,7 @@ export default function addRoutesToManifest(manifest) {
31
31
  type: CommonFieldTypes.SingleLineText,
32
32
  },
33
33
  ],
34
- insertOptions: ['<%- helper.getAppPrefix(appPrefix, appName) %>Page'],
34
+ insertOptions: ['<%- helper.getAppPrefix(appPrefix, appName) %>App Route'],
35
35
  });
36
36
 
37
37
  return mergeFs('./data/routes') // relative to process invocation (i.e. your package.json)
@@ -40,8 +40,8 @@ query ConnectedDemoQuery($datasource: String!, $contextItem: String!, $language:
40
40
  # $contextItem should be set to the ID of the current context item (the route item)
41
41
  contextItem: item(path: $contextItem, language: $language) {
42
42
  id
43
- # Get the page title from the page template
44
- ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
43
+ # Get the page title from the app route template
44
+ ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
45
45
  pageTitle {
46
46
  value
47
47
  }
@@ -54,7 +54,7 @@ query ConnectedDemoQuery($datasource: String!, $contextItem: String!, $language:
54
54
  # typing fragments can be used anywhere!
55
55
  # so in this case, we're grabbing the 'pageTitle'
56
56
  # field on all child route items.
57
- ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
57
+ ...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
58
58
  pageTitle {
59
59
  jsonValue
60
60
  value
@@ -144,7 +144,7 @@
144
144
  "name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>ContentBlock"
145
145
  },
146
146
  {
147
- "name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>Page"
147
+ "name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute"
148
148
  },
149
149
  {
150
150
  "name": "JsonRendering"
@@ -246,13 +246,13 @@
246
246
  },
247
247
  {
248
248
  "kind": "INTERFACE",
249
- "name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>Page",
249
+ "name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute",
250
250
  "possibleTypes": [
251
251
  {
252
252
  "name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>ExampleCustomRouteType"
253
253
  },
254
254
  {
255
- "name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>Page"
255
+ "name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute"
256
256
  }
257
257
  ]
258
258
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-sitecore-jss",
3
- "version": "21.0.1",
3
+ "version": "21.0.3",
4
4
  "description": "Sitecore JSS initializer",
5
5
  "bin": "./dist/index.js",
6
6
  "scripts": {
@@ -64,5 +64,5 @@
64
64
  "ts-node": "^10.4.0",
65
65
  "typescript": "~4.3.5"
66
66
  },
67
- "gitHead": "a8ce6e1211ed8fea0d59786527f67348423932b5"
67
+ "gitHead": "7af7750d21733a3b83931dc81f950a925edd72d0"
68
68
  }