create-sitecore-jss 22.6.0 → 22.7.0-canary.10
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/LICENSE.MD +202 -202
- package/README.md +10 -10
- package/dist/templates/angular/src/assets/images/sc_logo.svg +52 -52
- package/dist/templates/angular-sxp/data/component-content/Styleguide/ContentReuse/LoremIpsumContentBlock/en.yml +9 -9
- package/dist/templates/angular-sxp/data/content/Styleguide/ContentListField/Item1/en.yml +6 -6
- package/dist/templates/angular-sxp/data/content/Styleguide/ContentListField/Item2/en.yml +6 -6
- package/dist/templates/angular-sxp/data/content/Styleguide/EditFrameDemo/Item1/en.yml +6 -6
- package/dist/templates/angular-sxp/data/content/Styleguide/EditFrameDemo/Item2/en.yml +6 -6
- package/dist/templates/angular-sxp/data/content/Styleguide/ItemLinkField/Item1/en.yml +6 -6
- package/dist/templates/angular-sxp/data/content/Styleguide/ItemLinkField/Item2/en.yml +6 -6
- package/dist/templates/angular-sxp/data/dictionary/en.yml +4 -4
- package/dist/templates/angular-sxp/data/dictionary/{{language}}.yml +4 -4
- package/dist/templates/angular-sxp/data/routes/en.yml +61 -61
- package/dist/templates/angular-sxp/data/routes/graphql/en.yml +27 -27
- package/dist/templates/angular-sxp/data/routes/graphql/sample-1/en.yml +9 -9
- package/dist/templates/angular-sxp/data/routes/graphql/sample-2/en.yml +9 -9
- package/dist/templates/angular-sxp/data/routes/styleguide/custom-route-type/en.yml +12 -12
- package/dist/templates/angular-sxp/data/routes/styleguide/en.yml +271 -271
- package/dist/templates/angular-sxp/data/routes/styleguide/{{language}}.yml +25 -25
- package/dist/templates/angular-sxp/data/routes/{{language}}.yml +4 -4
- package/dist/templates/angular-sxp/sitecore/config/{{appName}}.config +90 -90
- package/dist/templates/angular-sxp/sitecore/definitions/components/graph-ql-integrated-demo.sitecore.graphql +71 -71
- package/dist/templates/angular-sxp/sitecore/gitignore +2 -2
- package/dist/templates/angular-xmcloud/package.json +2 -2
- package/dist/templates/nextjs/package.json +8 -21
- package/dist/templates/nextjs/public/sc_logo.svg +52 -52
- package/dist/templates/nextjs/scripts/templates/component-src.ts +1 -0
- package/dist/templates/nextjs/src/Bootstrap.tsx +1 -0
- package/dist/templates/nextjs/src/Layout.tsx +1 -1
- package/dist/templates/nextjs/src/Navigation.tsx +1 -0
- package/dist/templates/nextjs/src/NotFound.tsx +1 -0
- package/dist/templates/nextjs/src/Scripts.tsx +2 -0
- package/dist/templates/nextjs/src/components/ContentBlock.tsx +1 -0
- package/dist/templates/nextjs/src/lib/next-config/plugins/monorepo.js +2 -2
- package/dist/templates/nextjs/src/pages/404.tsx +1 -0
- package/dist/templates/nextjs/src/pages/[[...path]].tsx +1 -1
- package/dist/templates/nextjs/src/pages/_app.tsx +1 -0
- package/dist/templates/nextjs/src/temp/gitignore +0 -1
- package/dist/templates/nextjs/tsconfig.json +0 -1
- package/dist/templates/nextjs-styleguide/data/component-content/Styleguide/ContentReuse/LoremIpsumContentBlock/en.yml +9 -9
- package/dist/templates/nextjs-styleguide/data/content/Styleguide/ContentListField/Item1/en.yml +6 -6
- package/dist/templates/nextjs-styleguide/data/content/Styleguide/ContentListField/Item2/en.yml +6 -6
- package/dist/templates/nextjs-styleguide/data/content/Styleguide/EditFrameDemo/Item1/en.yml +6 -6
- package/dist/templates/nextjs-styleguide/data/content/Styleguide/EditFrameDemo/Item2/en.yml +6 -6
- package/dist/templates/nextjs-styleguide/data/content/Styleguide/ItemLinkField/Item1/en.yml +6 -6
- package/dist/templates/nextjs-styleguide/data/content/Styleguide/ItemLinkField/Item2/en.yml +6 -6
- package/dist/templates/nextjs-styleguide/data/dictionary/en.yml +4 -4
- package/dist/templates/nextjs-styleguide/data/dictionary/{{language}}.yml +4 -4
- package/dist/templates/nextjs-styleguide/data/routes/en.yml +63 -63
- package/dist/templates/nextjs-styleguide/data/routes/graphql/en.yml +27 -27
- package/dist/templates/nextjs-styleguide/data/routes/graphql/sample-1/en.yml +9 -9
- package/dist/templates/nextjs-styleguide/data/routes/graphql/sample-2/en.yml +9 -9
- package/dist/templates/nextjs-styleguide/data/routes/styleguide/custom-route-type/en.yml +12 -12
- package/dist/templates/nextjs-styleguide/data/routes/styleguide/en.yml +259 -259
- package/dist/templates/nextjs-styleguide/data/routes/styleguide/{{language}}.yml +25 -25
- package/dist/templates/nextjs-styleguide/data/routes/{{language}}.yml +4 -4
- package/dist/templates/nextjs-styleguide/graphql.d.ts +5 -0
- package/dist/templates/nextjs-styleguide/package.json +3 -1
- package/dist/templates/nextjs-styleguide/src/Navigation.tsx +1 -0
- package/dist/templates/nextjs-styleguide/src/components/fields/Styleguide-FieldUsage-Checkbox.tsx +1 -0
- package/dist/templates/nextjs-styleguide/src/components/fields/Styleguide-FieldUsage-ContentList.tsx +1 -0
- package/dist/templates/nextjs-styleguide/src/components/fields/Styleguide-FieldUsage-Custom.tsx +1 -0
- package/dist/templates/nextjs-styleguide/src/components/fields/Styleguide-FieldUsage-Date.tsx +1 -0
- package/dist/templates/nextjs-styleguide/src/components/fields/Styleguide-FieldUsage-File.tsx +1 -0
- package/dist/templates/nextjs-styleguide/src/components/fields/Styleguide-FieldUsage-Image.tsx +1 -0
- package/dist/templates/nextjs-styleguide/src/components/fields/Styleguide-FieldUsage-ItemLink.tsx +1 -0
- package/dist/templates/nextjs-styleguide/src/components/fields/Styleguide-FieldUsage-Link.tsx +1 -0
- package/dist/templates/nextjs-styleguide/src/components/fields/Styleguide-FieldUsage-Number.tsx +1 -0
- package/dist/templates/nextjs-styleguide/src/components/fields/Styleguide-FieldUsage-RichText.tsx +1 -0
- package/dist/templates/nextjs-styleguide/src/components/fields/Styleguide-FieldUsage-Text.tsx +1 -0
- package/dist/templates/nextjs-styleguide/src/components/graphql/GraphQL-ConnectedDemo.dynamic.tsx +59 -16
- package/dist/templates/nextjs-styleguide/src/components/graphql/GraphQL-IntegratedDemo.tsx +2 -3
- package/dist/templates/nextjs-styleguide/src/components/graphql/GraphQL-Layout.tsx +5 -1
- package/dist/templates/nextjs-styleguide/src/components/styleguide/Styleguide-ComponentParams.tsx +1 -0
- package/dist/templates/nextjs-styleguide/src/components/styleguide/Styleguide-CustomRouteType.tsx +2 -3
- package/dist/templates/nextjs-styleguide/src/components/styleguide/Styleguide-EditFrame.tsx +1 -0
- package/dist/templates/nextjs-styleguide/src/components/styleguide/Styleguide-Layout-Reuse.tsx +1 -0
- package/dist/templates/nextjs-styleguide/src/components/styleguide/Styleguide-Layout-Tabs-Tab.tsx +4 -1
- package/dist/templates/nextjs-styleguide/src/components/styleguide/Styleguide-Layout-Tabs.tsx +4 -3
- package/dist/templates/nextjs-styleguide/src/components/styleguide/Styleguide-Layout.tsx +1 -0
- package/dist/templates/nextjs-styleguide/src/components/styleguide/Styleguide-Multilingual.tsx +1 -0
- package/dist/templates/nextjs-styleguide/src/components/styleguide/Styleguide-RouteFields.tsx +1 -0
- package/dist/templates/nextjs-styleguide/src/components/styleguide/Styleguide-Section.tsx +1 -0
- package/dist/templates/nextjs-styleguide/src/components/styleguide/Styleguide-SitecoreContext.tsx +1 -0
- package/dist/templates/nextjs-styleguide/src/components/styleguide/Styleguide-Specimen.tsx +1 -0
- package/dist/templates/{nextjs → nextjs-styleguide}/src/lib/next-config/plugins/graphql.js +2 -14
- package/dist/templates/nextjs-styleguide/src/pages/_app.tsx +1 -0
- package/dist/templates/nextjs-styleguide-tracking/data/dictionary/en.yml +5 -5
- package/dist/templates/nextjs-styleguide-tracking/data/routes/tracking/en.yml +8 -8
- package/dist/templates/nextjs-styleguide-tracking/src/Navigation.tsx +1 -0
- package/dist/templates/nextjs-styleguide-tracking/src/Scripts.tsx +1 -0
- package/dist/templates/nextjs-styleguide-tracking/src/components/styleguide/Styleguide-Tracking.tsx +7 -7
- package/dist/templates/nextjs-sxa/scripts/templates/component-src.ts +1 -1
- package/dist/templates/nextjs-sxa/src/Layout.tsx +1 -1
- package/dist/templates/nextjs-sxa/src/assets/sass/components/_component-column-splitter.scss +2 -2
- package/dist/templates/nextjs-sxa/src/assets/sass/components/promo/_promo-shadow.scss +2 -2
- package/dist/templates/nextjs-sxa/src/components/ColumnSplitter.tsx +1 -1
- package/dist/templates/nextjs-sxa/src/components/Container.tsx +1 -1
- package/dist/templates/nextjs-sxa/src/components/Image.tsx +1 -1
- package/dist/templates/nextjs-sxa/src/components/LinkList.tsx +1 -1
- package/dist/templates/nextjs-sxa/src/components/Navigation.tsx +1 -1
- package/dist/templates/nextjs-sxa/src/components/PageContent.tsx +1 -1
- package/dist/templates/nextjs-sxa/src/components/PartialDesignDynamicPlaceholder.tsx +1 -1
- package/dist/templates/nextjs-sxa/src/components/Promo.tsx +1 -1
- package/dist/templates/nextjs-sxa/src/components/RichText.tsx +1 -1
- package/dist/templates/nextjs-sxa/src/components/RowSplitter.tsx +1 -1
- package/dist/templates/nextjs-sxa/src/components/Title.tsx +1 -1
- package/dist/templates/nextjs-sxa/src/lib/next-config/plugins/sass.js +3 -0
- package/dist/templates/nextjs-sxa/src/pages/404.tsx +1 -0
- package/dist/templates/nextjs-sxa/src/pages/500.tsx +1 -0
- package/dist/templates/nextjs-sxa/src/pages/_app.tsx +1 -0
- package/dist/templates/nextjs-xmcloud/package.json +2 -2
- package/dist/templates/nextjs-xmcloud/scripts/templates/byoc-component-src.ts +1 -1
- package/dist/templates/nextjs-xmcloud/src/Bootstrap.tsx +1 -1
- package/dist/templates/nextjs-xmcloud/src/Scripts.tsx +1 -0
- package/dist/templates/nextjs-xmcloud/src/byoc/index.tsx +1 -1
- package/dist/templates/nextjs-xmcloud/src/components/CdpPageView.tsx +1 -0
- package/dist/templates/nextjs-xmcloud/src/components/FEAASScripts.tsx +1 -0
- package/dist/templates/nextjs-xmcloud/src/pages/[[...path]].tsx +1 -1
- package/dist/templates/nextjs-xmcloud/src/pages/feaas/render.tsx +1 -0
- package/dist/templates/react/data/component-content/Styleguide/ContentReuse/LoremIpsumContentBlock/en.yml +9 -9
- package/dist/templates/react/data/content/Styleguide/ContentListField/Item1/en.yml +6 -6
- package/dist/templates/react/data/content/Styleguide/ContentListField/Item2/en.yml +6 -6
- package/dist/templates/react/data/content/Styleguide/EditFrameDemo/Item1/en.yml +6 -6
- package/dist/templates/react/data/content/Styleguide/EditFrameDemo/Item2/en.yml +6 -6
- package/dist/templates/react/data/content/Styleguide/ItemLinkField/Item1/en.yml +6 -6
- package/dist/templates/react/data/content/Styleguide/ItemLinkField/Item2/en.yml +6 -6
- package/dist/templates/react/data/dictionary/en.yml +4 -4
- package/dist/templates/react/data/dictionary/{{language}}.yml +4 -4
- package/dist/templates/react/data/routes/en.yml +61 -61
- package/dist/templates/react/data/routes/graphql/en.yml +27 -27
- package/dist/templates/react/data/routes/graphql/sample-1/en.yml +9 -9
- package/dist/templates/react/data/routes/graphql/sample-2/en.yml +9 -9
- package/dist/templates/react/data/routes/styleguide/custom-route-type/en.yml +12 -12
- package/dist/templates/react/data/routes/styleguide/en.yml +263 -263
- package/dist/templates/react/data/routes/styleguide/{{language}}.yml +26 -26
- package/dist/templates/react/data/routes/{{language}}.yml +4 -4
- package/dist/templates/react/package.json +3 -3
- package/dist/templates/react-native/.buckconfig +6 -6
- package/dist/templates/react-native/.eslintrc +74 -74
- package/dist/templates/react-native/.gitattributes +1 -1
- package/dist/templates/react-native/.prettierrc +9 -9
- package/dist/templates/react-native/.vscode/launch.json +42 -42
- package/dist/templates/react-native/.vscode/settings.json +1 -1
- package/dist/templates/react-native/LICENSE.txt +202 -202
- package/dist/templates/react-native/README.MD +115 -115
- package/dist/templates/react-native/android/app/BUCK +55 -55
- package/dist/templates/react-native/android/app/build.gradle +201 -201
- package/dist/templates/react-native/android/app/build_defs.bzl +19 -19
- package/dist/templates/react-native/android/app/proguard-rules.pro +10 -10
- package/dist/templates/react-native/android/app/src/debug/AndroidManifest.xml +8 -8
- package/dist/templates/react-native/android/app/src/main/AndroidManifest.xml +26 -26
- package/dist/templates/react-native/android/app/src/main/java/com/{{appName}}/MainActivity.java +15 -15
- package/dist/templates/react-native/android/app/src/main/java/com/{{appName}}/MainApplication.java +74 -74
- package/dist/templates/react-native/android/app/src/main/res/values/strings.xml +3 -3
- package/dist/templates/react-native/android/app/src/main/res/values/styles.xml +9 -9
- package/dist/templates/react-native/android/build.gradle +38 -38
- package/dist/templates/react-native/android/gradle/wrapper/gradle-wrapper.properties +5 -5
- package/dist/templates/react-native/android/gradle.properties +21 -21
- package/dist/templates/react-native/android/gradlew +188 -188
- package/dist/templates/react-native/android/gradlew.bat +100 -100
- package/dist/templates/react-native/android/settings.gradle +3 -3
- package/dist/templates/react-native/app.json +3 -3
- package/dist/templates/react-native/assets/img/sc_logo.svg +52 -52
- package/dist/templates/react-native/data/content/Styleguide/ItemLinkField/Item1/en.json +10 -10
- package/dist/templates/react-native/data/routes/en.json +22 -22
- package/dist/templates/react-native/data/routes/styleguide/en.json +227 -227
- package/dist/templates/react-native/data/routes/styleguide/{{language}}.json +31 -31
- package/dist/templates/react-native/data/routes/{{language}}.json +7 -7
- package/dist/templates/react-native/gitignore +60 -60
- package/dist/templates/react-native/ios/Podfile +53 -53
- package/dist/templates/react-native/ios/{{appName}}/AppDelegate.h +15 -15
- package/dist/templates/react-native/ios/{{appName}}/AppDelegate.m +42 -42
- package/dist/templates/react-native/ios/{{appName}}/Base.lproj/LaunchScreen.xib +42 -42
- package/dist/templates/react-native/ios/{{appName}}/Images.xcassets/AppIcon.appiconset/Contents.json +38 -38
- package/dist/templates/react-native/ios/{{appName}}/Images.xcassets/Contents.json +6 -6
- package/dist/templates/react-native/ios/{{appName}}/Info.plist +57 -57
- package/dist/templates/react-native/ios/{{appName}}/main.m +16 -16
- package/dist/templates/react-native/ios/{{appName}}-tvOS/Info.plist +53 -53
- package/dist/templates/react-native/ios/{{appName}}-tvOSTests/Info.plist +24 -24
- package/dist/templates/react-native/ios/{{appName}}.xcodeproj/xcshareddata/xcschemes/BasicSampleReactNative-tvOS.xcscheme +129 -129
- package/dist/templates/react-native/ios/{{appName}}.xcodeproj/xcshareddata/xcschemes/BasicSampleReactNative.xcscheme +129 -129
- package/dist/templates/react-native/ios/{{appName}}Tests/BasicSampleReactNativeTests.m +72 -72
- package/dist/templates/react-native/ios/{{appName}}Tests/Info.plist +24 -24
- package/dist/templates/react-native/package.json +78 -78
- package/dist/templates/react-native/sitecore/config/{{appName}}.config +47 -47
- package/dist/templates/react-native/sitecore/gitignore +2 -2
- package/dist/templates/vue/data/component-content/Styleguide/ContentReuse/LoremIpsumContentBlock/en.yml +9 -9
- package/dist/templates/vue/data/content/Styleguide/ContentListField/Item1/en.yml +6 -6
- package/dist/templates/vue/data/content/Styleguide/ContentListField/Item2/en.yml +6 -6
- package/dist/templates/vue/data/content/Styleguide/EditFrameDemo/Item1/en.yml +6 -6
- package/dist/templates/vue/data/content/Styleguide/EditFrameDemo/Item2/en.yml +6 -6
- package/dist/templates/vue/data/content/Styleguide/ItemLinkField/Item1/en.yml +6 -6
- package/dist/templates/vue/data/content/Styleguide/ItemLinkField/Item2/en.yml +6 -6
- package/dist/templates/vue/data/dictionary/en.yml +7 -7
- package/dist/templates/vue/data/dictionary/{{language}}.yml +7 -7
- package/dist/templates/vue/data/routes/en.yml +63 -63
- package/dist/templates/vue/data/routes/graphql/en.yml +34 -34
- package/dist/templates/vue/data/routes/graphql/sample-1/en.yml +9 -9
- package/dist/templates/vue/data/routes/graphql/sample-2/en.yml +9 -9
- package/dist/templates/vue/data/routes/styleguide/custom-route-type/en.yml +12 -12
- package/dist/templates/vue/data/routes/styleguide/en.yml +264 -264
- package/dist/templates/vue/data/routes/styleguide/{{language}}.yml +26 -26
- package/dist/templates/vue/data/routes/{{language}}.yml +4 -4
- package/dist/templates/vue/public/img/icons/safari-pinned-tab.svg +75 -75
- package/dist/templates/vue/src/assets/sc_logo.svg +52 -52
- package/package.json +2 -2
- package/dist/templates/nextjs/.graphql-let.yml +0 -8
- package/dist/templates/nextjs/scripts/fetch-graphql-introspection-data.ts +0 -46
- package/dist/templates/nextjs/src/temp/GraphQLIntrospectionResult.json +0 -22216
package/dist/templates/nextjs-styleguide/src/components/graphql/GraphQL-ConnectedDemo.dynamic.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useEffect } from 'react';
|
|
1
|
+
import React, { JSX, useEffect } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Text,
|
|
4
4
|
Link,
|
|
@@ -8,24 +8,67 @@ import {
|
|
|
8
8
|
withDatasourceCheck,
|
|
9
9
|
} from '@sitecore-jss/sitecore-jss-nextjs';
|
|
10
10
|
import { GraphQLRequestClient } from '@sitecore-jss/sitecore-jss-nextjs/graphql';
|
|
11
|
-
import {
|
|
12
|
-
resetEditorChromes
|
|
13
|
-
} from '@sitecore-jss/sitecore-jss-nextjs/utils';
|
|
11
|
+
import { resetEditorChromes } from '@sitecore-jss/sitecore-jss-nextjs/utils';
|
|
14
12
|
import NextLink from 'next/link';
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute as AppRoute,
|
|
18
|
-
Item,
|
|
19
|
-
<%- helper.getAppPrefix(appPrefix, appName, false) %>GraphQlConnectedDemo as GrapQLConnectedDemoDatasource,
|
|
20
|
-
} from 'graphql-types';
|
|
13
|
+
import ConnectedDemoQuery from './GraphQL-ConnectedDemo.dynamic.graphql';
|
|
21
14
|
import { ComponentProps } from 'lib/component-props';
|
|
22
15
|
import config from 'temp/config';
|
|
23
16
|
|
|
24
|
-
type
|
|
17
|
+
type GraphQLConnectedDemoDataSource = {
|
|
18
|
+
sample1: {
|
|
19
|
+
jsonValue: {
|
|
20
|
+
value: string;
|
|
21
|
+
};
|
|
22
|
+
value: string;
|
|
23
|
+
};
|
|
24
|
+
sample2: {
|
|
25
|
+
definition: {
|
|
26
|
+
type: string;
|
|
27
|
+
shared: boolean;
|
|
28
|
+
};
|
|
29
|
+
jsonValue: {
|
|
30
|
+
value: {
|
|
31
|
+
href: string;
|
|
32
|
+
linktype: string;
|
|
33
|
+
target: string;
|
|
34
|
+
text: string;
|
|
35
|
+
url: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
target: string;
|
|
39
|
+
text: string;
|
|
40
|
+
url: string;
|
|
41
|
+
};
|
|
42
|
+
name: string;
|
|
43
|
+
id: string;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
type Item = {
|
|
47
|
+
id: string;
|
|
48
|
+
url: {
|
|
49
|
+
path: string;
|
|
50
|
+
};
|
|
51
|
+
pageTitle: {
|
|
52
|
+
value: string;
|
|
53
|
+
jsonValue: {
|
|
54
|
+
value: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
type ItemSearchResults = {
|
|
60
|
+
results: Item[];
|
|
61
|
+
};
|
|
25
62
|
|
|
26
63
|
type GraphQLConnectedDemoData = {
|
|
27
|
-
datasource:
|
|
28
|
-
contextItem:
|
|
64
|
+
datasource: GraphQLConnectedDemoDataSource;
|
|
65
|
+
contextItem: {
|
|
66
|
+
id: string;
|
|
67
|
+
children: ItemSearchResults;
|
|
68
|
+
pageTitle: {
|
|
69
|
+
value: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
29
72
|
};
|
|
30
73
|
|
|
31
74
|
type GraphQLConnectedDemoProps = ComponentProps & GraphQLConnectedDemoData;
|
|
@@ -82,7 +125,7 @@ const GraphQLConnectedDemo = (props: GraphQLConnectedDemoProps): JSX.Element =>
|
|
|
82
125
|
children:
|
|
83
126
|
<ul>
|
|
84
127
|
{props.contextItem.children.results.map((child) => {
|
|
85
|
-
const routeItem = child as
|
|
128
|
+
const routeItem = child as Item;
|
|
86
129
|
|
|
87
130
|
return (
|
|
88
131
|
<li key={routeItem.id}>
|
|
@@ -115,7 +158,7 @@ export const getStaticProps: GetStaticComponentProps = async (rendering, layoutD
|
|
|
115
158
|
|
|
116
159
|
const result = await graphQLClient.request<GraphQLConnectedDemoData>(
|
|
117
160
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
118
|
-
|
|
161
|
+
ConnectedDemoQuery,
|
|
119
162
|
{
|
|
120
163
|
datasource: rendering.dataSource,
|
|
121
164
|
contextItem: layoutData?.sitecore?.route?.itemId,
|
|
@@ -143,7 +186,7 @@ export const getServerSideProps: GetServerSideComponentProps = async (rendering,
|
|
|
143
186
|
|
|
144
187
|
const result = await graphQLClient.request<GraphQLConnectedDemoData>(
|
|
145
188
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
146
|
-
|
|
189
|
+
ConnectedDemoQuery,
|
|
147
190
|
{
|
|
148
191
|
datasource: rendering.dataSource,
|
|
149
192
|
contextItem: layoutData?.sitecore?.route?.itemId,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
1
2
|
import { Text, Link, withDatasourceCheck } from '@sitecore-jss/sitecore-jss-nextjs';
|
|
2
3
|
import { ComponentProps } from 'lib/component-props';
|
|
3
4
|
import NextLink from 'next/link';
|
|
@@ -114,9 +115,7 @@ const GraphQLIntegratedDemo = (props: GraphQlIntegratedDemoProps): JSX.Element =
|
|
|
114
115
|
<ul>
|
|
115
116
|
{contextItem.children.results.map((child: Item) => (
|
|
116
117
|
<li key={child.id}>
|
|
117
|
-
<NextLink href={child.url.path}>
|
|
118
|
-
{child.pageTitle.value}
|
|
119
|
-
</NextLink>
|
|
118
|
+
<NextLink href={child.url.path}>{child.pageTitle.value}</NextLink>
|
|
120
119
|
(editable title too! <Text field={child.pageTitle.jsonValue} />)
|
|
121
120
|
</li>
|
|
122
121
|
))}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
1
2
|
import { Placeholder, useSitecoreContext } from '@sitecore-jss/sitecore-jss-nextjs';
|
|
2
3
|
import { ComponentProps } from 'lib/component-props';
|
|
3
4
|
|
|
@@ -28,7 +29,10 @@ const GraphQLLayout = ({ rendering }: ComponentProps): JSX.Element => {
|
|
|
28
29
|
</>
|
|
29
30
|
)}
|
|
30
31
|
{!disconnectedMode && (
|
|
31
|
-
<Placeholder
|
|
32
|
+
<Placeholder
|
|
33
|
+
name="<%- helper.getAppPrefix(appPrefix, appName) %>jss-graphql-layout"
|
|
34
|
+
rendering={rendering}
|
|
35
|
+
/>
|
|
32
36
|
)}
|
|
33
37
|
</div>
|
|
34
38
|
);
|
package/dist/templates/nextjs-styleguide/src/components/styleguide/Styleguide-CustomRouteType.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
1
2
|
import Link from 'next/link';
|
|
2
3
|
import { useSitecoreContext, Text, RichText, Field } from '@sitecore-jss/sitecore-jss-nextjs';
|
|
3
4
|
|
|
@@ -27,9 +28,7 @@ const StyleguideCustomRouteType = (): JSX.Element => {
|
|
|
27
28
|
|
|
28
29
|
<RichText field={fields.content} />
|
|
29
30
|
|
|
30
|
-
<Link href="/styleguide">
|
|
31
|
-
Return to the Styleguide
|
|
32
|
-
</Link>
|
|
31
|
+
<Link href="/styleguide">Return to the Styleguide</Link>
|
|
33
32
|
</div>
|
|
34
33
|
);
|
|
35
34
|
};
|
package/dist/templates/nextjs-styleguide/src/components/styleguide/Styleguide-Layout-Tabs-Tab.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
1
2
|
import {
|
|
2
3
|
Text,
|
|
3
4
|
RichText,
|
|
@@ -7,13 +8,15 @@ import {
|
|
|
7
8
|
} from '@sitecore-jss/sitecore-jss-nextjs';
|
|
8
9
|
import { ComponentProps } from 'lib/component-props';
|
|
9
10
|
|
|
10
|
-
type
|
|
11
|
+
export type TabProps = {
|
|
11
12
|
fields: {
|
|
12
13
|
content: Field<string>;
|
|
13
14
|
title: Field<string>;
|
|
14
15
|
};
|
|
15
16
|
};
|
|
16
17
|
|
|
18
|
+
type StyleguideLayoutTabsTabProps = ComponentProps & TabProps;
|
|
19
|
+
|
|
17
20
|
/**
|
|
18
21
|
* This is a single tab within the tabs sample component. These are added to the tabs placeholder.
|
|
19
22
|
* This component demonstrates conditionally altering rendering when in the Sitecore Experience Editor to improve
|
package/dist/templates/nextjs-styleguide/src/components/styleguide/Styleguide-Layout-Tabs.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import { withPlaceholder, withSitecoreContext, Text } from '@sitecore-jss/siteco
|
|
|
3
3
|
import StyleguideSpecimen from './Styleguide-Specimen';
|
|
4
4
|
import { ComponentWithContextProps } from 'lib/component-props';
|
|
5
5
|
import { StyleguideSpecimenFields } from 'lib/component-props/styleguide';
|
|
6
|
+
import { TabProps } from './Styleguide-Layout-Tabs-Tab';
|
|
6
7
|
|
|
7
8
|
interface StyleguideLayoutTabsState {
|
|
8
9
|
activeTabIndex: number;
|
|
@@ -55,7 +56,7 @@ class StyleguideLayoutTabs extends React.Component<
|
|
|
55
56
|
*/}
|
|
56
57
|
{!isEditing &&
|
|
57
58
|
(tabsPlaceholder || [])
|
|
58
|
-
.filter((tab: ReactElement) => tab.props && tab.props.fields)
|
|
59
|
+
.filter((tab: ReactElement) => tab.props && (tab.props as TabProps).fields)
|
|
59
60
|
.map((tab: ReactElement, index: number) => (
|
|
60
61
|
<li className="nav-item" key={`tab${index}`}>
|
|
61
62
|
<a
|
|
@@ -63,14 +64,14 @@ class StyleguideLayoutTabs extends React.Component<
|
|
|
63
64
|
onClick={() => this.setActiveTab(index)}
|
|
64
65
|
href="#t"
|
|
65
66
|
>
|
|
66
|
-
<Text field={tab.props.fields.title} />
|
|
67
|
+
<Text field={(tab.props as TabProps).fields.title} />
|
|
67
68
|
</a>
|
|
68
69
|
</li>
|
|
69
70
|
))}
|
|
70
71
|
</ul>
|
|
71
72
|
<div className="p-3 border-left border-right border-bottom">
|
|
72
73
|
{(tabsPlaceholder || []).map((tab: ReactElement) => {
|
|
73
|
-
const isValid = tab.props && tab.props.fields;
|
|
74
|
+
const isValid = tab.props && (tab.props as TabProps).fields;
|
|
74
75
|
|
|
75
76
|
// allow experience editor markup components to render
|
|
76
77
|
if (!isValid && isEditing) return tab;
|
|
@@ -7,19 +7,7 @@ const graphqlPlugin = (nextConfig = {}) => {
|
|
|
7
7
|
config.module.rules.push({
|
|
8
8
|
test: /\.graphql$/,
|
|
9
9
|
exclude: /node_modules/,
|
|
10
|
-
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
config.module.rules.push({
|
|
14
|
-
test: /\.graphqls$/,
|
|
15
|
-
exclude: /node_modules/,
|
|
16
|
-
use: ['graphql-let/schema/loader'],
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
config.module.rules.push({
|
|
20
|
-
test: /\.ya?ml$/,
|
|
21
|
-
type: 'json',
|
|
22
|
-
use: 'yaml-loader',
|
|
10
|
+
loader: 'graphql-tag/loader',
|
|
23
11
|
});
|
|
24
12
|
|
|
25
13
|
// Overload the Webpack config if it was already overloaded
|
|
@@ -28,7 +16,7 @@ const graphqlPlugin = (nextConfig = {}) => {
|
|
|
28
16
|
}
|
|
29
17
|
|
|
30
18
|
return config;
|
|
31
|
-
}
|
|
19
|
+
},
|
|
32
20
|
});
|
|
33
21
|
};
|
|
34
22
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
styleguide-sample: This is a dictionary entry in English as a demonstration
|
|
2
|
-
Documentation: Documentation
|
|
3
|
-
Styleguide: Styleguide
|
|
4
|
-
GraphQL: GraphQL
|
|
5
|
-
Tracking: Tracking
|
|
1
|
+
styleguide-sample: This is a dictionary entry in English as a demonstration
|
|
2
|
+
Documentation: Documentation
|
|
3
|
+
Styleguide: Styleguide
|
|
4
|
+
GraphQL: GraphQL
|
|
5
|
+
Tracking: Tracking
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
fields:
|
|
2
|
-
pageTitle: Styleguide Tracking | Sitecore JSS
|
|
3
|
-
placeholders:
|
|
4
|
-
<%- helper.getAppPrefix(appPrefix, appName) %>jss-main:
|
|
5
|
-
- componentName: Styleguide-Tracking
|
|
6
|
-
fields:
|
|
7
|
-
heading: Tracking
|
|
8
|
-
description: <p><small>JSS supports tracking Sitecore analytics events from within apps. Give it a try with this handy interactive demo.</small></p>
|
|
1
|
+
fields:
|
|
2
|
+
pageTitle: Styleguide Tracking | Sitecore JSS
|
|
3
|
+
placeholders:
|
|
4
|
+
<%- helper.getAppPrefix(appPrefix, appName) %>jss-main:
|
|
5
|
+
- componentName: Styleguide-Tracking
|
|
6
|
+
fields:
|
|
7
|
+
heading: Tracking
|
|
8
|
+
description: <p><small>JSS supports tracking Sitecore analytics events from within apps. Give it a try with this handy interactive demo.</small></p>
|
package/dist/templates/nextjs-styleguide-tracking/src/components/styleguide/Styleguide-Tracking.tsx
CHANGED
|
@@ -18,13 +18,13 @@ type StyleguideTrackingProps = ComponentWithContextProps & StyleguideSpecimenFie
|
|
|
18
18
|
* Demonstrates analytics tracking patterns (xDB)
|
|
19
19
|
*/
|
|
20
20
|
class StyleguideTracking extends React.Component<StyleguideTrackingProps> {
|
|
21
|
-
private event: RefObject<HTMLInputElement>;
|
|
22
|
-
private goal: RefObject<HTMLInputElement>;
|
|
23
|
-
private outcomeName: RefObject<HTMLInputElement>;
|
|
24
|
-
private outcomeValue: RefObject<HTMLInputElement>;
|
|
25
|
-
private campaign: RefObject<HTMLInputElement>;
|
|
26
|
-
private pageId: RefObject<HTMLInputElement>;
|
|
27
|
-
private pageUrl: RefObject<HTMLInputElement>;
|
|
21
|
+
private event: RefObject<HTMLInputElement | null>;
|
|
22
|
+
private goal: RefObject<HTMLInputElement | null>;
|
|
23
|
+
private outcomeName: RefObject<HTMLInputElement | null>;
|
|
24
|
+
private outcomeValue: RefObject<HTMLInputElement | null>;
|
|
25
|
+
private campaign: RefObject<HTMLInputElement | null>;
|
|
26
|
+
private pageId: RefObject<HTMLInputElement | null>;
|
|
27
|
+
private pageUrl: RefObject<HTMLInputElement | null>;
|
|
28
28
|
|
|
29
29
|
private trackingApiOptions: TrackingRequestOptions;
|
|
30
30
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @returns component src boilerplate as a string
|
|
5
5
|
*/
|
|
6
6
|
function generateComponentSrc(componentName: string): string {
|
|
7
|
-
return `import
|
|
7
|
+
return `import { JSX } from 'react';
|
|
8
8
|
import { ComponentParams, ComponentRendering } from '@sitecore-jss/sitecore-jss-nextjs';
|
|
9
9
|
|
|
10
10
|
interface ${componentName}Props {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This Layout is needed for Starter Kit.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import { JSX } from 'react';
|
|
5
5
|
import Head from 'next/head';
|
|
6
6
|
import { Placeholder, LayoutServiceData, Field, HTMLLink } from '@sitecore-jss/sitecore-jss-nextjs';
|
|
7
7
|
import config from 'temp/config';
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
float: left;
|
|
14
14
|
}
|
|
15
15
|
>.component-content {
|
|
16
|
+
padding: 15px;
|
|
17
|
+
margin: 0 0 30px 0;
|
|
16
18
|
@include respond-to(all-mobile) {
|
|
17
19
|
margin: 0 10px 30px 10px;
|
|
18
20
|
}
|
|
19
|
-
padding: 15px;
|
|
20
|
-
margin: 0 0 30px 0;
|
|
21
21
|
&:before, &:after {
|
|
22
22
|
opacity: 0.7;
|
|
23
23
|
box-shadow: 0 17px 10px rgba(0, 0, 0, 0.7);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
1
2
|
import {
|
|
2
3
|
ComponentParams,
|
|
3
4
|
ComponentRendering,
|
|
4
5
|
Placeholder,
|
|
5
6
|
} from '@sitecore-jss/sitecore-jss-nextjs';
|
|
6
|
-
import React from 'react';
|
|
7
7
|
|
|
8
8
|
interface ComponentProps {
|
|
9
9
|
rendering: ComponentRendering & { params: ComponentParams };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CSSProperties, JSX } from 'react';
|
|
1
2
|
import {
|
|
2
3
|
EditMode,
|
|
3
4
|
Field,
|
|
@@ -8,7 +9,6 @@ import {
|
|
|
8
9
|
Text,
|
|
9
10
|
useSitecoreContext,
|
|
10
11
|
} from '@sitecore-jss/sitecore-jss-nextjs';
|
|
11
|
-
import React, { CSSProperties } from 'react';
|
|
12
12
|
|
|
13
13
|
interface Fields {
|
|
14
14
|
Image: ImageField & { metadata?: { [key: string]: unknown } };
|
|
@@ -11,6 +11,9 @@ const SassAlias = require('sass-alias');
|
|
|
11
11
|
'@sass': path.join(__dirname, '../../../assets', 'sass'),
|
|
12
12
|
'@fontawesome': path.join(__dirname, '../../../../node_modules', 'font-awesome'),
|
|
13
13
|
}).getImporter(),
|
|
14
|
+
// temporary measure until new versions of bootstrap and font-awesome released
|
|
15
|
+
quietDeps: true,
|
|
16
|
+
silenceDeprecations: ["import", "legacy-js-api"],
|
|
14
17
|
},
|
|
15
18
|
});
|
|
16
19
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
3
|
"@sitecore/components": "~2.0.1",
|
|
4
|
-
"@sitecore-cloudsdk/core": "^0.
|
|
5
|
-
"@sitecore-cloudsdk/events": "^0.
|
|
4
|
+
"@sitecore-cloudsdk/core": "^0.5.1",
|
|
5
|
+
"@sitecore-cloudsdk/events": "^0.5.1",
|
|
6
6
|
"@sitecore-feaas/clientside": "^0.5.19"
|
|
7
7
|
}
|
|
8
8
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @returns component src boilerplate as a string
|
|
5
5
|
*/
|
|
6
6
|
function generateComponentSrc(componentName: string): string {
|
|
7
|
-
return `import
|
|
7
|
+
return `import { JSX } from 'react';
|
|
8
8
|
import * as FEAAS from '@sitecore-feaas/clientside/react';
|
|
9
9
|
|
|
10
10
|
interface ${componentName}Props {
|