create-sitecore-jss 22.10.0-canary.8 → 22.10.0
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/package.json +24 -25
- package/dist/templates/angular/scripts/generate-component-factory/template.ts +1 -3
- package/dist/templates/angular/server.bundle.ts +3 -2
- package/dist/templates/angular/src/app/ViewBag.ts +4 -0
- package/dist/templates/angular/src/app/app.component.ts +10 -9
- package/dist/templates/angular/src/app/app.module.ts +3 -1
- package/dist/templates/angular/src/app/app.server.module.ts +4 -5
- package/dist/templates/angular/src/app/components/app-components.shared.module.ts +16 -3
- package/dist/templates/angular/src/app/components/content-block/content-block.component.ts +2 -1
- package/dist/templates/angular/src/app/i18n/jss-translation-client-loader.service.ts +3 -2
- package/dist/templates/angular/src/app/i18n/jss-translation-server-loader.service.ts +6 -4
- package/dist/templates/angular/src/app/injection-tokens.ts +13 -0
- package/dist/templates/angular/src/app/jss-context.server-side.service.ts +8 -10
- package/dist/templates/angular/src/app/jss-context.service.ts +6 -4
- package/dist/templates/angular/src/app/jss-graphql.module.ts +58 -48
- package/dist/templates/angular/src/app/jss-graphql.service.ts +6 -6
- package/dist/templates/angular/src/app/jss-meta.service.ts +3 -2
- package/dist/templates/angular/src/app/routing/layout/layout.component.ts +10 -4
- package/dist/templates/angular/src/app/routing/navigation/navigation.component.ts +3 -0
- package/dist/templates/angular/src/app/routing/not-found/not-found.component.ts +1 -1
- package/dist/templates/angular/src/app/routing/routing.module.ts +3 -4
- package/dist/templates/angular/src/app/routing/scripts/scripts.module.ts +1 -1
- 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-sxp/src/app/components/app-components.shared.module.ts +1 -3
- package/dist/templates/angular-sxp/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.html +41 -39
- package/dist/templates/angular-sxp/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.ts +5 -3
- package/dist/templates/angular-sxp/src/app/components/graph-ql-integrated-demo/graph-ql-integrated-demo.component.html +6 -4
- package/dist/templates/angular-sxp/src/app/components/graph-ql-integrated-demo/graph-ql-integrated-demo.component.ts +4 -4
- package/dist/templates/angular-sxp/src/app/components/graph-ql-layout/graph-ql-layout.component.html +3 -4
- package/dist/templates/angular-sxp/src/app/components/graph-ql-layout/graph-ql-layout.component.ts +4 -4
- package/dist/templates/angular-sxp/src/app/components/shared/styleguide-specimen/styleguide-specimen.component.ts +3 -4
- package/dist/templates/angular-sxp/src/app/components/styleguide-angular-lazy-loading/styleguide-angular-lazy-loading.component.ts +5 -5
- package/dist/templates/angular-sxp/src/app/components/styleguide-angular-lazy-loading/styleguide-angular-lazy-loading.module.ts +2 -5
- package/dist/templates/angular-sxp/src/app/components/styleguide-component-params/styleguide-component-params.component.html +8 -4
- package/dist/templates/angular-sxp/src/app/components/styleguide-component-params/styleguide-component-params.component.ts +2 -2
- package/dist/templates/angular-sxp/src/app/components/styleguide-custom-route-type/styleguide-custom-route-type.component.ts +5 -5
- package/dist/templates/angular-sxp/src/app/components/styleguide-edit-frame/styleguide-edit-frame.component.html +7 -3
- package/dist/templates/angular-sxp/src/app/components/styleguide-edit-frame/styleguide-edit-frame.component.ts +13 -4
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-checkbox/styleguide-field-usage-checkbox.component.ts +2 -2
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-content-list/styleguide-field-usage-content-list.component.html +20 -16
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-content-list/styleguide-field-usage-content-list.component.ts +20 -3
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-custom/styleguide-field-usage-custom.component.ts +2 -0
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-date/styleguide-field-usage-date.component.ts +4 -1
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-file/styleguide-field-usage-file.component.ts +3 -1
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-image/styleguide-field-usage-image.component.ts +3 -1
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-item-link/styleguide-field-usage-item-link.component.html +4 -4
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-item-link/styleguide-field-usage-item-link.component.ts +4 -1
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-link/styleguide-field-usage-link.component.ts +3 -1
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-number/styleguide-field-usage-number.component.ts +2 -0
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-rich-text/styleguide-field-usage-rich-text.component.ts +3 -1
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-text/styleguide-field-usage-text.component.ts +3 -1
- package/dist/templates/angular-sxp/src/app/components/styleguide-layout/styleguide-layout.component.html +12 -8
- package/dist/templates/angular-sxp/src/app/components/styleguide-layout/styleguide-layout.component.ts +2 -4
- package/dist/templates/angular-sxp/src/app/components/styleguide-layout-reuse/styleguide-layout-reuse.component.ts +3 -1
- package/dist/templates/angular-sxp/src/app/components/styleguide-layout-tabs/styleguide-layout-tabs.component.html +18 -15
- package/dist/templates/angular-sxp/src/app/components/styleguide-layout-tabs/styleguide-layout-tabs.component.ts +6 -4
- package/dist/templates/angular-sxp/src/app/components/styleguide-layout-tabs-tab/styleguide-layout-tabs-tab.component.html +2 -2
- package/dist/templates/angular-sxp/src/app/components/styleguide-layout-tabs-tab/styleguide-layout-tabs-tab.component.ts +4 -4
- package/dist/templates/angular-sxp/src/app/components/styleguide-multilingual/styleguide-multilingual.component.ts +7 -3
- package/dist/templates/angular-sxp/src/app/components/styleguide-route-fields/styleguide-route-fields.component.ts +5 -4
- package/dist/templates/angular-sxp/src/app/components/styleguide-section/styleguide-section.component.ts +2 -1
- package/dist/templates/angular-sxp/src/app/components/styleguide-sitecore-context/styleguide-sitecore-context.component.ts +7 -4
- package/dist/templates/angular-sxp/src/app/components/styleguide-tracking/styleguide-tracking.component.html +6 -2
- package/dist/templates/angular-sxp/src/app/components/styleguide-tracking/styleguide-tracking.component.ts +12 -12
- package/dist/templates/angular-sxp/src/app/jss-data-fetcher.service.ts +4 -2
- package/dist/templates/angular-sxp/src/app/routing/scripts/scripts.component.ts +10 -0
- package/dist/templates/angular-sxp/src/app/routing/scripts/scripts.module.ts +1 -1
- package/dist/templates/angular-sxp/src/app/routing/scripts/visitor-identification/visitor-identification.component.ts +6 -3
- package/dist/templates/angular-xmcloud/scripts/generate-component-factory/template.ts +1 -3
- package/dist/templates/angular-xmcloud/src/app/components/app-components.shared.module.ts +1 -2
- package/dist/templates/angular-xmcloud/src/app/components/column-splitter/column-splitter.component.html +6 -4
- package/dist/templates/angular-xmcloud/src/app/components/column-splitter/column-splitter.component.ts +4 -1
- package/dist/templates/angular-xmcloud/src/app/components/container/container.component.html +14 -5
- package/dist/templates/angular-xmcloud/src/app/components/container/container.component.ts +3 -0
- package/dist/templates/angular-xmcloud/src/app/components/image/image.component.html +21 -23
- package/dist/templates/angular-xmcloud/src/app/components/image/image.component.ts +5 -5
- package/dist/templates/angular-xmcloud/src/app/components/link-list/link-list.component.html +11 -10
- package/dist/templates/angular-xmcloud/src/app/components/link-list/link-list.component.ts +3 -0
- package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation-item.component.html +14 -17
- package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation-item.component.ts +3 -3
- package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation.component.html +3 -6
- package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation.component.ts +8 -5
- package/dist/templates/angular-xmcloud/src/app/components/page-content/page-content.component.ts +4 -4
- package/dist/templates/angular-xmcloud/src/app/components/partial-design-dynamic-placeholder/partial-design-dynamic-placeholder.component.ts +2 -0
- package/dist/templates/angular-xmcloud/src/app/components/promo/promo.component.html +4 -6
- package/dist/templates/angular-xmcloud/src/app/components/promo/promo.component.ts +3 -0
- package/dist/templates/angular-xmcloud/src/app/components/richtext/richtext.component.html +3 -4
- package/dist/templates/angular-xmcloud/src/app/components/richtext/richtext.component.ts +3 -0
- package/dist/templates/angular-xmcloud/src/app/components/row-splitter/row-splitter.component.html +10 -9
- package/dist/templates/angular-xmcloud/src/app/components/row-splitter/row-splitter.component.ts +3 -0
- package/dist/templates/angular-xmcloud/src/app/components/title/title.component.html +4 -5
- package/dist/templates/angular-xmcloud/src/app/components/title/title.component.ts +5 -5
- package/dist/templates/angular-xmcloud/src/app/jss-link.service.ts +2 -2
- package/dist/templates/angular-xmcloud/src/app/routing/layout/layout.component.html +38 -36
- package/dist/templates/angular-xmcloud/src/app/routing/layout/layout.component.ts +10 -6
- package/dist/templates/angular-xmcloud/src/app/routing/scripts/cdp-page-view.component.ts +2 -3
- package/dist/templates/angular-xmcloud/src/app/routing/scripts/cloud-sdk-init.component.ts +2 -2
- package/dist/templates/angular-xmcloud/src/app/routing/scripts/scripts.component.ts +13 -0
- package/dist/templates/angular-xmcloud/src/app/routing/scripts/scripts.module.ts +1 -2
- package/dist/templates/nextjs/public/sc_logo.svg +52 -52
- 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-tracking/data/dictionary/en.yml +5 -5
- package/dist/templates/nextjs-styleguide-tracking/data/routes/tracking/en.yml +8 -8
- package/dist/templates/nextjs-sxa/src/assets/sass/components/_component-column-splitter.scss +14 -14
- package/dist/templates/nextjs-sxa/src/assets/sass/components/promo/_promo-shadow.scss +42 -42
- 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-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
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
JSS Sitecore Configuration Patch File
|
|
3
|
-
|
|
4
|
-
This configuration file registers the JSS site with Sitecore, and configures the Layout Service
|
|
5
|
-
to work with it. Config patches need to be deployed to the Sitecore server.
|
|
6
|
-
|
|
7
|
-
Normally `jss deploy config` can do this for local development. To manually deploy, or to deploy via CI,
|
|
8
|
-
this file can be placed in the `App_Config/Include` folder, or a subfolder of it, within the Sitecore site.
|
|
9
|
-
-->
|
|
10
|
-
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"
|
|
11
|
-
xmlns:set="http://www.sitecore.net/xmlconfig/set/"
|
|
12
|
-
xmlns:role="http://www.sitecore.net/xmlconfig/role/">
|
|
13
|
-
<sitecore>
|
|
14
|
-
<settings>
|
|
15
|
-
<!--
|
|
16
|
-
PROXY CONFIGURATION
|
|
17
|
-
When running JSS with the headless proxy (node-headless-ssr-proxy),
|
|
18
|
-
the original IP address of clients is obscured by the proxy.
|
|
19
|
-
This setting tells Sitecore to read the forwarded header the proxy sends,
|
|
20
|
-
thus making analytics track the correct original client IP address.
|
|
21
|
-
-->
|
|
22
|
-
<setting name="Analytics.ForwardedRequestHttpHeader" set:value="X-Forwarded-For" />
|
|
23
|
-
</settings>
|
|
24
|
-
<sites>
|
|
25
|
-
<!--
|
|
26
|
-
JSS Site Registration
|
|
27
|
-
This configures the site with Sitecore - i.e. host headers, item paths.
|
|
28
|
-
If your JSS app lives within an existing Sitecore site, this may not be necessary.
|
|
29
|
-
|
|
30
|
-
IMPORTANT: JSS sites ship in 'live mode', which makes development and testing easy,
|
|
31
|
-
but disables workflow and publishing. Before going to production, change the `database`
|
|
32
|
-
below to `web` instead of `master`.
|
|
33
|
-
-->
|
|
34
|
-
<site patch:before="site[@name='website']"
|
|
35
|
-
inherits="website"
|
|
36
|
-
name="<%- appName %>"
|
|
37
|
-
hostName="<%- hostName.replace(/^https?:\/\//, '') %>"
|
|
38
|
-
rootPath="/sitecore/content/<%- appName %>"
|
|
39
|
-
startItem="/home"
|
|
40
|
-
database="master" />
|
|
41
|
-
</sites>
|
|
42
|
-
<javaScriptServices>
|
|
43
|
-
<apps>
|
|
44
|
-
<!--
|
|
45
|
-
JSS App Registration
|
|
46
|
-
The JSS app needs to be registered in order to support layout service and import services.
|
|
47
|
-
|
|
48
|
-
There are many available attributes, and they inherit the defaults if not explicitly specified here.
|
|
49
|
-
Defaults are defined in `/App_Config/Sitecore/JavaScriptServices/Sitecore.JavaScriptServices.Apps.config`
|
|
50
|
-
|
|
51
|
-
NOTE: graphQLEndpoint enables _Integrated GraphQL_. If not using integrated GraphQL, it can be removed.
|
|
52
|
-
|
|
53
|
-
NOTE: layoutServiceConfiguration should be set to "default" when using GraphQL Edge schema.
|
|
54
|
-
When using integrated GraphQL with Edge schema, a $language value is injected
|
|
55
|
-
since language is required in all Edge queries. "jss" configuration does not do this (which is backwards
|
|
56
|
-
compatible with JSS versions < 18.0.0).
|
|
57
|
-
-->
|
|
58
|
-
<app name="<%- appName %>"
|
|
59
|
-
layoutServiceConfiguration="default"
|
|
60
|
-
sitecorePath="/sitecore/content/<%- appName %>"
|
|
61
|
-
inherits="defaults"
|
|
62
|
-
useLanguageSpecificLayout="true"
|
|
63
|
-
graphQLEndpoint="/sitecore/api/graph/edge" />
|
|
64
|
-
</apps>
|
|
65
|
-
<!--
|
|
66
|
-
IMAGE RESIZING WHITELIST
|
|
67
|
-
Using Sitecore server-side media resizing (i.e. the `imageParams` or `srcSet` props on the `<Image/>` helper component)
|
|
68
|
-
could expose your Sitecore server to a denial-of-service attack by rescaling an image with many arbitrary dimensions.
|
|
69
|
-
In JSS resizing param sets that are unknown are rejected by a whitelist.
|
|
70
|
-
|
|
71
|
-
Sets of image sizing parameters that are used in app components must be whitelisted here.
|
|
72
|
-
If a param set is not whitelisted, the image will be returned _without resizing_.
|
|
73
|
-
|
|
74
|
-
To determine the image parameters being used, look at the query string on the `src` of the rendered image, i.e. '/img.jpg?mw=100&h=72' -> mw=100,h=72
|
|
75
|
-
Note: the parameter sets defined here are comma-delimited (,) instead of &-delimited like the query string. Multiple sets are endline-delimited.
|
|
76
|
-
-->
|
|
77
|
-
<allowedMediaParams>
|
|
78
|
-
<!-- XML element name is arbitary, useful for organizing and patching -->
|
|
79
|
-
<styleguide-image-sample>
|
|
80
|
-
mw=100,
|
|
81
|
-
mh=50
|
|
82
|
-
</styleguide-image-sample>
|
|
83
|
-
<styleguide-image-sample-adaptive>
|
|
84
|
-
mw=300
|
|
85
|
-
mw=100
|
|
86
|
-
</styleguide-image-sample-adaptive>
|
|
87
|
-
</allowedMediaParams>
|
|
88
|
-
</javaScriptServices>
|
|
89
|
-
</sitecore>
|
|
90
|
-
</configuration>
|
|
1
|
+
<!--
|
|
2
|
+
JSS Sitecore Configuration Patch File
|
|
3
|
+
|
|
4
|
+
This configuration file registers the JSS site with Sitecore, and configures the Layout Service
|
|
5
|
+
to work with it. Config patches need to be deployed to the Sitecore server.
|
|
6
|
+
|
|
7
|
+
Normally `jss deploy config` can do this for local development. To manually deploy, or to deploy via CI,
|
|
8
|
+
this file can be placed in the `App_Config/Include` folder, or a subfolder of it, within the Sitecore site.
|
|
9
|
+
-->
|
|
10
|
+
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"
|
|
11
|
+
xmlns:set="http://www.sitecore.net/xmlconfig/set/"
|
|
12
|
+
xmlns:role="http://www.sitecore.net/xmlconfig/role/">
|
|
13
|
+
<sitecore>
|
|
14
|
+
<settings>
|
|
15
|
+
<!--
|
|
16
|
+
PROXY CONFIGURATION
|
|
17
|
+
When running JSS with the headless proxy (node-headless-ssr-proxy),
|
|
18
|
+
the original IP address of clients is obscured by the proxy.
|
|
19
|
+
This setting tells Sitecore to read the forwarded header the proxy sends,
|
|
20
|
+
thus making analytics track the correct original client IP address.
|
|
21
|
+
-->
|
|
22
|
+
<setting name="Analytics.ForwardedRequestHttpHeader" set:value="X-Forwarded-For" />
|
|
23
|
+
</settings>
|
|
24
|
+
<sites>
|
|
25
|
+
<!--
|
|
26
|
+
JSS Site Registration
|
|
27
|
+
This configures the site with Sitecore - i.e. host headers, item paths.
|
|
28
|
+
If your JSS app lives within an existing Sitecore site, this may not be necessary.
|
|
29
|
+
|
|
30
|
+
IMPORTANT: JSS sites ship in 'live mode', which makes development and testing easy,
|
|
31
|
+
but disables workflow and publishing. Before going to production, change the `database`
|
|
32
|
+
below to `web` instead of `master`.
|
|
33
|
+
-->
|
|
34
|
+
<site patch:before="site[@name='website']"
|
|
35
|
+
inherits="website"
|
|
36
|
+
name="<%- appName %>"
|
|
37
|
+
hostName="<%- hostName.replace(/^https?:\/\//, '') %>"
|
|
38
|
+
rootPath="/sitecore/content/<%- appName %>"
|
|
39
|
+
startItem="/home"
|
|
40
|
+
database="master" />
|
|
41
|
+
</sites>
|
|
42
|
+
<javaScriptServices>
|
|
43
|
+
<apps>
|
|
44
|
+
<!--
|
|
45
|
+
JSS App Registration
|
|
46
|
+
The JSS app needs to be registered in order to support layout service and import services.
|
|
47
|
+
|
|
48
|
+
There are many available attributes, and they inherit the defaults if not explicitly specified here.
|
|
49
|
+
Defaults are defined in `/App_Config/Sitecore/JavaScriptServices/Sitecore.JavaScriptServices.Apps.config`
|
|
50
|
+
|
|
51
|
+
NOTE: graphQLEndpoint enables _Integrated GraphQL_. If not using integrated GraphQL, it can be removed.
|
|
52
|
+
|
|
53
|
+
NOTE: layoutServiceConfiguration should be set to "default" when using GraphQL Edge schema.
|
|
54
|
+
When using integrated GraphQL with Edge schema, a $language value is injected
|
|
55
|
+
since language is required in all Edge queries. "jss" configuration does not do this (which is backwards
|
|
56
|
+
compatible with JSS versions < 18.0.0).
|
|
57
|
+
-->
|
|
58
|
+
<app name="<%- appName %>"
|
|
59
|
+
layoutServiceConfiguration="default"
|
|
60
|
+
sitecorePath="/sitecore/content/<%- appName %>"
|
|
61
|
+
inherits="defaults"
|
|
62
|
+
useLanguageSpecificLayout="true"
|
|
63
|
+
graphQLEndpoint="/sitecore/api/graph/edge" />
|
|
64
|
+
</apps>
|
|
65
|
+
<!--
|
|
66
|
+
IMAGE RESIZING WHITELIST
|
|
67
|
+
Using Sitecore server-side media resizing (i.e. the `imageParams` or `srcSet` props on the `<Image/>` helper component)
|
|
68
|
+
could expose your Sitecore server to a denial-of-service attack by rescaling an image with many arbitrary dimensions.
|
|
69
|
+
In JSS resizing param sets that are unknown are rejected by a whitelist.
|
|
70
|
+
|
|
71
|
+
Sets of image sizing parameters that are used in app components must be whitelisted here.
|
|
72
|
+
If a param set is not whitelisted, the image will be returned _without resizing_.
|
|
73
|
+
|
|
74
|
+
To determine the image parameters being used, look at the query string on the `src` of the rendered image, i.e. '/img.jpg?mw=100&h=72' -> mw=100,h=72
|
|
75
|
+
Note: the parameter sets defined here are comma-delimited (,) instead of &-delimited like the query string. Multiple sets are endline-delimited.
|
|
76
|
+
-->
|
|
77
|
+
<allowedMediaParams>
|
|
78
|
+
<!-- XML element name is arbitary, useful for organizing and patching -->
|
|
79
|
+
<styleguide-image-sample>
|
|
80
|
+
mw=100,
|
|
81
|
+
mh=50
|
|
82
|
+
</styleguide-image-sample>
|
|
83
|
+
<styleguide-image-sample-adaptive>
|
|
84
|
+
mw=300
|
|
85
|
+
mw=100
|
|
86
|
+
</styleguide-image-sample-adaptive>
|
|
87
|
+
</allowedMediaParams>
|
|
88
|
+
</javaScriptServices>
|
|
89
|
+
</sitecore>
|
|
90
|
+
</configuration>
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
# This file contains a GraphQL query that will be executed and the result provided to
|
|
2
|
-
# your JSS component. You can run this query in GraphiQL ($endpoint/ui) for a nice editing experience.
|
|
3
|
-
|
|
4
|
-
# Note that we're executing _two queries_ (datasource and contextItem)
|
|
5
|
-
# within the context of the IntegratedDemoQuery _operation_. This makes it
|
|
6
|
-
# very efficient at gathering data from multiple sources.
|
|
7
|
-
|
|
8
|
-
query IntegratedDemoQuery($datasource: String!, $contextItem: String!, $language: String!) {
|
|
9
|
-
# Datasource query
|
|
10
|
-
# $datasource will always be set to the ID of the rendering's datasource item
|
|
11
|
-
# (as long as the GraphQLData helper is used)
|
|
12
|
-
datasource: item(path: $datasource, language: $language) {
|
|
13
|
-
id
|
|
14
|
-
name
|
|
15
|
-
# Strongly-typed querying on known templates is possible!
|
|
16
|
-
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>GraphQLIntegratedDemo {
|
|
17
|
-
# Single-line text field
|
|
18
|
-
sample1 {
|
|
19
|
-
# the 'jsonValue' field is a JSON blob that represents the object that
|
|
20
|
-
# should be passed to JSS field rendering helpers (i.e. text, image, link)
|
|
21
|
-
jsonValue
|
|
22
|
-
value
|
|
23
|
-
}
|
|
24
|
-
# General Link field
|
|
25
|
-
sample2 {
|
|
26
|
-
jsonValue
|
|
27
|
-
# Structured querying of the field's values is possible
|
|
28
|
-
text
|
|
29
|
-
target
|
|
30
|
-
url
|
|
31
|
-
# Access to the template definition is possible
|
|
32
|
-
definition {
|
|
33
|
-
type
|
|
34
|
-
shared
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
# Context/route item query
|
|
41
|
-
# $contextItem will always be set to the ID of the current context item (the route item)
|
|
42
|
-
# (as long as the GraphQLData helper is used)
|
|
43
|
-
contextItem: item(path: $contextItem, language: $language) {
|
|
44
|
-
id
|
|
45
|
-
# Get the page title from the app route template
|
|
46
|
-
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
|
|
47
|
-
pageTitle {
|
|
48
|
-
value
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
# List the children of the current route
|
|
53
|
-
children(hasLayout: true) {
|
|
54
|
-
results {
|
|
55
|
-
id
|
|
56
|
-
# typing fragments can be used anywhere!
|
|
57
|
-
# so in this case, we're grabbing the 'pageTitle'
|
|
58
|
-
# field on all child route items.
|
|
59
|
-
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
|
|
60
|
-
pageTitle {
|
|
61
|
-
jsonValue
|
|
62
|
-
value
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
url {
|
|
66
|
-
path
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
1
|
+
# This file contains a GraphQL query that will be executed and the result provided to
|
|
2
|
+
# your JSS component. You can run this query in GraphiQL ($endpoint/ui) for a nice editing experience.
|
|
3
|
+
|
|
4
|
+
# Note that we're executing _two queries_ (datasource and contextItem)
|
|
5
|
+
# within the context of the IntegratedDemoQuery _operation_. This makes it
|
|
6
|
+
# very efficient at gathering data from multiple sources.
|
|
7
|
+
|
|
8
|
+
query IntegratedDemoQuery($datasource: String!, $contextItem: String!, $language: String!) {
|
|
9
|
+
# Datasource query
|
|
10
|
+
# $datasource will always be set to the ID of the rendering's datasource item
|
|
11
|
+
# (as long as the GraphQLData helper is used)
|
|
12
|
+
datasource: item(path: $datasource, language: $language) {
|
|
13
|
+
id
|
|
14
|
+
name
|
|
15
|
+
# Strongly-typed querying on known templates is possible!
|
|
16
|
+
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>GraphQLIntegratedDemo {
|
|
17
|
+
# Single-line text field
|
|
18
|
+
sample1 {
|
|
19
|
+
# the 'jsonValue' field is a JSON blob that represents the object that
|
|
20
|
+
# should be passed to JSS field rendering helpers (i.e. text, image, link)
|
|
21
|
+
jsonValue
|
|
22
|
+
value
|
|
23
|
+
}
|
|
24
|
+
# General Link field
|
|
25
|
+
sample2 {
|
|
26
|
+
jsonValue
|
|
27
|
+
# Structured querying of the field's values is possible
|
|
28
|
+
text
|
|
29
|
+
target
|
|
30
|
+
url
|
|
31
|
+
# Access to the template definition is possible
|
|
32
|
+
definition {
|
|
33
|
+
type
|
|
34
|
+
shared
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
# Context/route item query
|
|
41
|
+
# $contextItem will always be set to the ID of the current context item (the route item)
|
|
42
|
+
# (as long as the GraphQLData helper is used)
|
|
43
|
+
contextItem: item(path: $contextItem, language: $language) {
|
|
44
|
+
id
|
|
45
|
+
# Get the page title from the app route template
|
|
46
|
+
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
|
|
47
|
+
pageTitle {
|
|
48
|
+
value
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
# List the children of the current route
|
|
53
|
+
children(hasLayout: true) {
|
|
54
|
+
results {
|
|
55
|
+
id
|
|
56
|
+
# typing fragments can be used anywhere!
|
|
57
|
+
# so in this case, we're grabbing the 'pageTitle'
|
|
58
|
+
# field on all child route items.
|
|
59
|
+
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
|
|
60
|
+
pageTitle {
|
|
61
|
+
jsonValue
|
|
62
|
+
value
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
url {
|
|
66
|
+
path
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
manifest
|
|
2
|
-
update-package
|
|
1
|
+
manifest
|
|
2
|
+
update-package
|
|
3
3
|
package
|
|
@@ -20,6 +20,7 @@ import { JssModule } from '@sitecore-jss/sitecore-jss-angular';
|
|
|
20
20
|
RouterModule,
|
|
21
21
|
JssModule,
|
|
22
22
|
FormsModule,
|
|
23
|
+
StyleguideSpecimenComponent
|
|
23
24
|
],
|
|
24
25
|
exports: [
|
|
25
26
|
CommonModule,
|
|
@@ -28,8 +29,5 @@ import { JssModule } from '@sitecore-jss/sitecore-jss-angular';
|
|
|
28
29
|
FormsModule,
|
|
29
30
|
StyleguideSpecimenComponent
|
|
30
31
|
],
|
|
31
|
-
declarations: [
|
|
32
|
-
StyleguideSpecimenComponent
|
|
33
|
-
],
|
|
34
32
|
})
|
|
35
33
|
export class AppComponentsSharedModule { }
|
|
@@ -9,47 +9,49 @@
|
|
|
9
9
|
the cache. Consult the Apollo documentation for details.
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
@if (query$ | async; as queryResult) {
|
|
13
13
|
<div>
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
14
|
+
<div>
|
|
15
|
+
<h4>Datasource Item (via Connected GraphQL)</h4>
|
|
16
|
+
id: {{ queryResult.data.datasource.id }}
|
|
17
|
+
<br />
|
|
18
|
+
name: {{ queryResult.data.datasource.name }}
|
|
19
|
+
<br />
|
|
20
|
+
sample1: {{ queryResult.data.datasource.sample1.value }}
|
|
21
|
+
<br />
|
|
22
|
+
sample1 (editable): <span *scText="queryResult.data.datasource.sample1.jsonValue"></span>
|
|
23
|
+
<br />
|
|
24
|
+
sample2:<br />
|
|
25
|
+
<ul>
|
|
26
|
+
<li>text: {{ queryResult.data.datasource.sample2.text }}</li>
|
|
27
|
+
<li>url: {{ queryResult.data.datasource.sample2.url }}</li>
|
|
28
|
+
<li>target: {{ queryResult.data.datasource.sample2.target }}</li>
|
|
29
|
+
<li>
|
|
30
|
+
editable: <a *scLink="queryResult.data.datasource.sample2.jsonValue"></a>
|
|
31
|
+
</li>
|
|
32
|
+
<li>field type: {{ queryResult.data.datasource.sample2.definition.type }}</li>
|
|
33
|
+
<li>field is shared?: {{ queryResult.data.datasource.sample2.definition.shared.toString() }}</li>
|
|
34
|
+
</ul>
|
|
35
|
+
</div>
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
<div>
|
|
38
|
+
<h4>Route Item (via Connected GraphQL)</h4>
|
|
39
|
+
id: {{ queryResult.data.contextItem.id }}
|
|
40
|
+
<br />
|
|
41
|
+
page title: {{ queryResult.data.contextItem.pageTitle.value }}
|
|
42
|
+
<br />
|
|
43
|
+
children:
|
|
44
|
+
<ul>
|
|
45
|
+
@for (child of queryResult.data.contextItem.children.results; track child) {
|
|
46
|
+
<li>
|
|
47
|
+
<a [routerLink]="child.url.path">{{ child.pageTitle.value }}</a>
|
|
48
|
+
(editable title too! <span *scText="child.pageTitle.jsonValue"></span>)
|
|
49
|
+
</li>
|
|
50
|
+
}
|
|
51
|
+
</ul>
|
|
52
|
+
</div>
|
|
49
53
|
</div>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<ng-template #loading>
|
|
54
|
+
} @else {
|
|
53
55
|
<p class="alert alert-info">GraphQL query is loading...</p>
|
|
54
|
-
|
|
56
|
+
}
|
|
55
57
|
</div>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Component, Input, OnInit } from '@angular/core';
|
|
2
|
-
import {
|
|
1
|
+
import { Component, Input, OnInit, inject } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { ComponentRendering, JssModule } from '@sitecore-jss/sitecore-jss-angular';
|
|
3
4
|
import { DocumentNode } from 'graphql';
|
|
4
5
|
import { JssGraphQLService } from '../../jss-graphql.service';
|
|
5
6
|
import { ApolloQueryResult } from '@apollo/client/core';
|
|
@@ -14,6 +15,7 @@ const ComponentQuery: DocumentNode = require('graphql-tag/loader!./graph-ql-conn
|
|
|
14
15
|
@Component({
|
|
15
16
|
selector: 'app-graph-ql-connected-demo',
|
|
16
17
|
templateUrl: './graph-ql-connected-demo.component.html',
|
|
18
|
+
imports: [CommonModule, JssModule]
|
|
17
19
|
})
|
|
18
20
|
export class GraphQLConnectedDemoComponent implements OnInit {
|
|
19
21
|
@Input() rendering: ComponentRendering;
|
|
@@ -22,7 +24,7 @@ export class GraphQLConnectedDemoComponent implements OnInit {
|
|
|
22
24
|
// inject the JssGraphQLService to make GraphQL queries
|
|
23
25
|
// note that it's possible to use Apollo directly, but the JSS
|
|
24
26
|
// service provides automatic GraphQL variables and SSR assistance.
|
|
25
|
-
|
|
27
|
+
private graphQLService = inject(JssGraphQLService);
|
|
26
28
|
|
|
27
29
|
ngOnInit(): void {
|
|
28
30
|
// the query result is an Rx Observable, so any observable patterns
|
|
@@ -38,10 +38,12 @@
|
|
|
38
38
|
<br />
|
|
39
39
|
children:
|
|
40
40
|
<ul>
|
|
41
|
-
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
@for (child of queryResult.data.contextItem.children.results; track child) {
|
|
42
|
+
<li>
|
|
43
|
+
<a [routerLink]="child.url.path">{{ child.pageTitle.value }}</a>
|
|
44
|
+
(editable title too! <span *scText="child.pageTitle.jsonValue"></span>)
|
|
45
|
+
</li>
|
|
46
|
+
}
|
|
45
47
|
</ul>
|
|
46
48
|
</div>
|
|
47
49
|
</div>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Component, OnInit, Input } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { ComponentRendering, JssModule } from '@sitecore-jss/sitecore-jss-angular';
|
|
3
4
|
|
|
4
5
|
interface QueryResult {
|
|
5
6
|
data: {
|
|
@@ -63,13 +64,12 @@ interface ItemSearchResults {
|
|
|
63
64
|
@Component({
|
|
64
65
|
selector: 'app-graph-ql-integrated-demo',
|
|
65
66
|
templateUrl: './graph-ql-integrated-demo.component.html',
|
|
67
|
+
imports: [CommonModule, JssModule]
|
|
66
68
|
})
|
|
67
69
|
export class GraphQLIntegratedDemoComponent implements OnInit {
|
|
68
70
|
@Input() rendering: ComponentRendering;
|
|
69
71
|
queryResult: QueryResult;
|
|
70
|
-
|
|
71
|
-
constructor() {}
|
|
72
|
-
|
|
72
|
+
|
|
73
73
|
ngOnInit() {
|
|
74
74
|
this.queryResult = (this.rendering.fields as unknown) as QueryResult;
|
|
75
75
|
}
|
package/dist/templates/angular-sxp/src/app/components/graph-ql-layout/graph-ql-layout.component.html
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div data-e2e-id="graphql-layout">
|
|
2
|
-
|
|
2
|
+
@if (disconnectedMode) {
|
|
3
3
|
<p>
|
|
4
4
|
This app is running in disconnected mode. GraphQL requires connected mode, headless connected
|
|
5
5
|
mode, or integrated mode to work.
|
|
@@ -12,11 +12,10 @@
|
|
|
12
12
|
To view the GraphQL samples, restart the app using <code>jss start:connected</code> or
|
|
13
13
|
deploy the app to Sitecore to run in integrated mode per the JSS documentation.
|
|
14
14
|
</p>
|
|
15
|
-
|
|
16
|
-
<ng-container *ngIf="!disconnectedMode">
|
|
15
|
+
} @else {
|
|
17
16
|
<sc-placeholder
|
|
18
17
|
name="<%- helper.getAppPrefix(appPrefix, appName) %>jss-graphql-layout"
|
|
19
18
|
[rendering]="rendering"
|
|
20
19
|
></sc-placeholder>
|
|
21
|
-
|
|
20
|
+
}
|
|
22
21
|
</div>
|
package/dist/templates/angular-sxp/src/app/components/graph-ql-layout/graph-ql-layout.component.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Component, OnInit, Input } from '@angular/core';
|
|
2
|
-
import { ComponentRendering } from '@sitecore-jss/sitecore-jss-angular';
|
|
1
|
+
import { Component, OnInit, Input, inject } from '@angular/core';
|
|
2
|
+
import { ComponentRendering, JssModule } from '@sitecore-jss/sitecore-jss-angular';
|
|
3
3
|
import { JssContextService } from '../../jss-context.service';
|
|
4
4
|
|
|
5
5
|
@Component({
|
|
6
6
|
selector: 'app-graph-ql-layout',
|
|
7
7
|
templateUrl: './graph-ql-layout.component.html',
|
|
8
|
+
imports: [JssModule]
|
|
8
9
|
})
|
|
9
10
|
export class GraphQLLayoutComponent implements OnInit {
|
|
10
11
|
@Input() rendering: ComponentRendering;
|
|
11
12
|
disconnectedMode: boolean;
|
|
12
|
-
|
|
13
|
-
constructor(private contextService: JssContextService) { }
|
|
13
|
+
private contextService = inject(JssContextService);
|
|
14
14
|
|
|
15
15
|
ngOnInit() {
|
|
16
16
|
this.disconnectedMode = this.contextService.stateValue.sitecore.route.itemId === 'available-in-connected-mode';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, OnInit, Input } from '@angular/core';
|
|
2
|
-
import { ComponentRendering } from '@sitecore-jss/sitecore-jss-angular';
|
|
2
|
+
import { ComponentRendering, JssModule } from '@sitecore-jss/sitecore-jss-angular';
|
|
3
3
|
|
|
4
4
|
function dasherize(str: string) {
|
|
5
5
|
return str.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, function(s, i) {
|
|
@@ -24,7 +24,8 @@ function dasherize(str: string) {
|
|
|
24
24
|
</p>
|
|
25
25
|
<div class="border p-2"><ng-content></ng-content></div>
|
|
26
26
|
</div>
|
|
27
|
-
|
|
27
|
+
`,
|
|
28
|
+
imports: [JssModule]
|
|
28
29
|
})
|
|
29
30
|
export class StyleguideSpecimenComponent implements OnInit {
|
|
30
31
|
@Input() rendering: ComponentRendering;
|
|
@@ -32,8 +33,6 @@ export class StyleguideSpecimenComponent implements OnInit {
|
|
|
32
33
|
id: string;
|
|
33
34
|
componentName: string;
|
|
34
35
|
|
|
35
|
-
constructor() { }
|
|
36
|
-
|
|
37
36
|
ngOnInit() {
|
|
38
37
|
this.id = `i${this.rendering.uid.replace(/[{}]/g, '')}`;
|
|
39
38
|
this.componentName = dasherize(this.rendering.componentName);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Component, Input } from '@angular/core';
|
|
2
|
-
import { ComponentRendering } from '@sitecore-jss/sitecore-jss-angular';
|
|
2
|
+
import { ComponentRendering, JssModule } from '@sitecore-jss/sitecore-jss-angular';
|
|
3
|
+
import { StyleguideSpecimenComponent } from '../shared/styleguide-specimen/styleguide-specimen.component';
|
|
3
4
|
|
|
4
5
|
@Component({
|
|
5
6
|
selector: 'app-styleguide-angular-lazy-loading',
|
|
6
7
|
templateUrl: './styleguide-angular-lazy-loading.component.html',
|
|
7
|
-
styles: []
|
|
8
|
+
styles: [],
|
|
9
|
+
imports: [JssModule, StyleguideSpecimenComponent]
|
|
8
10
|
})
|
|
9
11
|
export class StyleguideAngularLazyLoadingComponent {
|
|
10
12
|
@Input() rendering: ComponentRendering;
|
|
11
|
-
|
|
12
|
-
constructor() { }
|
|
13
|
-
}
|
|
13
|
+
};
|
|
@@ -10,10 +10,7 @@ import { AppComponentsSharedModule } from '../app-components.shared.module';
|
|
|
10
10
|
imports: [
|
|
11
11
|
// this call signals to JSS that this component is the one being lazy loaded by this module
|
|
12
12
|
JssModule.forChild(StyleguideAngularLazyLoadingComponent),
|
|
13
|
-
AppComponentsSharedModule
|
|
14
|
-
]
|
|
15
|
-
declarations: [
|
|
16
|
-
StyleguideAngularLazyLoadingComponent,
|
|
17
|
-
],
|
|
13
|
+
AppComponentsSharedModule,
|
|
14
|
+
]
|
|
18
15
|
})
|
|
19
16
|
export class StyleguideAngularLazyLoadingModule { }
|
|
@@ -8,12 +8,16 @@
|
|
|
8
8
|
<br />
|
|
9
9
|
param type: <code>{{ useCtaType }}</code>
|
|
10
10
|
<!-- because the param is a string, you need to compare it as a string - if(`useCta`) won't work correctly. -->
|
|
11
|
-
|
|
11
|
+
@if (useCta === 'true') {
|
|
12
|
+
<div class="alert alert-info">the call to action is shown</div>
|
|
13
|
+
}
|
|
12
14
|
</div>
|
|
13
15
|
<p>columns param: {{ columns }}</p>
|
|
14
16
|
<div class="row">
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
@for (column of columnsArray; track column) {
|
|
18
|
+
<div class="col-sm">
|
|
19
|
+
Column {{ column }}
|
|
20
|
+
</div>
|
|
21
|
+
}
|
|
18
22
|
</div>
|
|
19
23
|
</app-styleguide-specimen>
|