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,19 +1,20 @@
|
|
|
1
|
-
import { Component, OnInit, OnDestroy, Input } from '@angular/core';
|
|
1
|
+
import { Component, OnInit, OnDestroy, Input, inject } from '@angular/core';
|
|
2
2
|
import { Subscription } from 'rxjs';
|
|
3
3
|
import { JssContextService } from '../../jss-context.service';
|
|
4
|
-
import { ComponentRendering } from '@sitecore-jss/sitecore-jss-angular';
|
|
4
|
+
import { ComponentRendering, JssModule } from '@sitecore-jss/sitecore-jss-angular';
|
|
5
|
+
import { StyleguideSpecimenComponent } from '../shared/styleguide-specimen/styleguide-specimen.component';
|
|
5
6
|
|
|
6
7
|
@Component({
|
|
7
8
|
selector: 'app-styleguide-route-fields',
|
|
8
9
|
templateUrl: './styleguide-route-fields.component.html',
|
|
10
|
+
imports: [JssModule, StyleguideSpecimenComponent]
|
|
9
11
|
})
|
|
10
12
|
export class StyleguideRouteFieldsComponent implements OnInit, OnDestroy {
|
|
11
13
|
@Input() rendering: ComponentRendering;
|
|
12
14
|
contextFields: { [name: string]: unknown };
|
|
13
15
|
|
|
14
16
|
private contextSubscription: Subscription;
|
|
15
|
-
|
|
16
|
-
constructor(private jssContext: JssContextService) { }
|
|
17
|
+
private jssContext = inject(JssContextService);
|
|
17
18
|
|
|
18
19
|
ngOnInit() {
|
|
19
20
|
this.contextSubscription = this.jssContext.state.subscribe((state) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, Input, OnInit } 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
|
/**
|
|
5
5
|
* Represents a category of styleguide specimens within the Styleguide-Layout.
|
|
@@ -9,6 +9,7 @@ import { ComponentRendering } from '@sitecore-jss/sitecore-jss-angular';
|
|
|
9
9
|
@Component({
|
|
10
10
|
selector: 'app-styleguide-section',
|
|
11
11
|
templateUrl: './styleguide-section.component.html',
|
|
12
|
+
imports: [JssModule]
|
|
12
13
|
})
|
|
13
14
|
export class StyleguideSectionComponent implements OnInit {
|
|
14
15
|
@Input() rendering: ComponentRendering;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
|
-
import { Component, Input, OnInit, OnDestroy } from '@angular/core';
|
|
2
|
+
import { Component, Input, OnInit, OnDestroy, inject } from '@angular/core';
|
|
3
3
|
import { ComponentRendering } from '@sitecore-jss/sitecore-jss-angular';
|
|
4
4
|
import { JssContextService } from '../../jss-context.service';
|
|
5
|
+
import { StyleguideSpecimenComponent } from '../shared/styleguide-specimen/styleguide-specimen.component';
|
|
5
6
|
import { Subscription } from 'rxjs';
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -11,19 +12,21 @@ import { Subscription } from 'rxjs';
|
|
|
11
12
|
* NOTE: if not using async pipe, ensure you unsubscribe from the context
|
|
12
13
|
* in ngOnDestroy(). See styleguide-layout-tabs for an example.
|
|
13
14
|
*/
|
|
15
|
+
|
|
14
16
|
@Component({
|
|
15
17
|
selector: 'app-styleguide-sitecore-context',
|
|
16
|
-
templateUrl: './styleguide-sitecore-context.component.html'
|
|
18
|
+
templateUrl: './styleguide-sitecore-context.component.html',
|
|
19
|
+
imports: [StyleguideSpecimenComponent]
|
|
17
20
|
})
|
|
18
21
|
export class StyleguideSitecoreContextComponent implements OnInit, OnDestroy {
|
|
19
22
|
@Input() rendering: ComponentRendering;
|
|
20
23
|
private contextSubscription: Subscription;
|
|
21
24
|
|
|
22
25
|
// inject the JssContextService, which maintains the current Sitecore Context
|
|
23
|
-
|
|
26
|
+
private jssContext = inject(JssContextService);
|
|
24
27
|
|
|
25
28
|
ngOnInit() {
|
|
26
|
-
this.contextSubscription = this.jssContext.state.subscribe((state) => {
|
|
29
|
+
this.contextSubscription = this.jssContext.state.subscribe((state: unknown) => {
|
|
27
30
|
console.debug('The current Sitecore Context in styleguide-sitecore-context.component.ts is...', state);
|
|
28
31
|
});
|
|
29
32
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
<app-styleguide-specimen [rendering]="rendering" e2eId="styleguide-tracking">
|
|
2
|
-
|
|
2
|
+
@if (disconnectedMode) {
|
|
3
|
+
<p>The tracking API is only available in connected, integrated, or headless modes.</p>
|
|
4
|
+
}
|
|
3
5
|
|
|
4
|
-
|
|
6
|
+
@if (!disconnectedMode) {
|
|
7
|
+
<div>
|
|
5
8
|
<p class="alert alert-warning">
|
|
6
9
|
Note: The JSS tracker API is disabled by default. Consult the <a href="https://jss.sitecore.com/docs/fundamentals/services/tracking">tracking documentation</a> to enable it.
|
|
7
10
|
</p>
|
|
@@ -172,4 +175,5 @@
|
|
|
172
175
|
</fieldset>
|
|
173
176
|
</div>
|
|
174
177
|
</div>
|
|
178
|
+
}
|
|
175
179
|
</app-styleguide-specimen>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Component, Input, OnInit } from '@angular/core';
|
|
1
|
+
import { Component, Input, OnInit, inject } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
2
3
|
import {
|
|
3
4
|
ComponentRendering,
|
|
4
5
|
trackingApi,
|
|
@@ -6,6 +7,7 @@ import {
|
|
|
6
7
|
} from '@sitecore-jss/sitecore-jss-angular';
|
|
7
8
|
import { environment } from '../../../environments/environment';
|
|
8
9
|
import { JssDataFetcherService } from '../../jss-data-fetcher.service';
|
|
10
|
+
import { StyleguideSpecimenComponent } from '../shared/styleguide-specimen/styleguide-specimen.component';
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* Demonstrates usage of a Text content field within JSS.
|
|
@@ -14,6 +16,7 @@ import { JssDataFetcherService } from '../../jss-data-fetcher.service';
|
|
|
14
16
|
@Component({
|
|
15
17
|
selector: 'app-styleguide-tracking',
|
|
16
18
|
templateUrl: './styleguide-tracking.component.html',
|
|
19
|
+
imports: [CommonModule, StyleguideSpecimenComponent]
|
|
17
20
|
})
|
|
18
21
|
export class StyleguideTrackingComponent implements OnInit {
|
|
19
22
|
@Input() rendering: ComponentRendering;
|
|
@@ -25,17 +28,14 @@ export class StyleguideTrackingComponent implements OnInit {
|
|
|
25
28
|
pageId: string;
|
|
26
29
|
pageUrl: string;
|
|
27
30
|
disconnectedMode = true;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
fetcher: dataFetcher.fetch,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
31
|
+
private dataFetcher = inject(JssDataFetcherService);
|
|
32
|
+
trackingApiOptions: TrackingRequestOptions = {
|
|
33
|
+
host: environment.sitecoreApiHost,
|
|
34
|
+
querystringParams: {
|
|
35
|
+
sc_apikey: environment.sitecoreApiKey,
|
|
36
|
+
},
|
|
37
|
+
fetcher: this.dataFetcher.fetch,
|
|
38
|
+
};
|
|
39
39
|
|
|
40
40
|
ngOnInit() {
|
|
41
41
|
this.disconnectedMode = this.rendering.dataSource === 'available-in-connected-mode';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
1
|
+
import { Injectable, inject } from '@angular/core';
|
|
2
2
|
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
|
|
3
3
|
import { HttpResponse } from '@sitecore-jss/sitecore-jss-angular';
|
|
4
4
|
import { Observable, lastValueFrom } from 'rxjs';
|
|
@@ -7,10 +7,12 @@ import { Observable, lastValueFrom } from 'rxjs';
|
|
|
7
7
|
providedIn: 'root',
|
|
8
8
|
})
|
|
9
9
|
export class JssDataFetcherService {
|
|
10
|
-
constructor(
|
|
10
|
+
constructor() {
|
|
11
11
|
this.fetch = this.fetch.bind(this);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
protected httpClient = inject(HttpClient);
|
|
15
|
+
|
|
14
16
|
fetch<T>(url: string, data: unknown): Promise<HttpResponse<T>> {
|
|
15
17
|
let result: Observable<T>;
|
|
16
18
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { VisitorIdentificationComponent } from './visitor-identification/visitor-identification.component';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'app-scripts',
|
|
6
|
+
templateUrl: './scripts.component.html',
|
|
7
|
+
imports: [VisitorIdentificationComponent]
|
|
8
|
+
})
|
|
9
|
+
export class ScriptsComponent {}
|
|
10
|
+
|
|
@@ -3,7 +3,7 @@ import { ScriptsComponent } from './scripts.component';
|
|
|
3
3
|
import { VisitorIdentificationComponent } from './visitor-identification/visitor-identification.component';
|
|
4
4
|
|
|
5
5
|
@NgModule({
|
|
6
|
+
imports: [ScriptsComponent, VisitorIdentificationComponent],
|
|
6
7
|
exports: [ScriptsComponent],
|
|
7
|
-
declarations: [ScriptsComponent, VisitorIdentificationComponent],
|
|
8
8
|
})
|
|
9
9
|
export class ScriptsModule {}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { Component, OnInit, OnDestroy } from '@angular/core';
|
|
1
|
+
import { Component, OnInit, OnDestroy, inject } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
2
3
|
import { Subscription } from 'rxjs';
|
|
3
4
|
import { JssContextService } from '../../../jss-context.service';
|
|
5
|
+
import { JssState } from '../../../JssState';
|
|
4
6
|
|
|
5
7
|
let emittedVI = false;
|
|
6
8
|
|
|
@@ -20,6 +22,7 @@ let emittedVI = false;
|
|
|
20
22
|
[content]="visitorIdentificationTimestamp"
|
|
21
23
|
/>
|
|
22
24
|
`,
|
|
25
|
+
imports: [CommonModule]
|
|
23
26
|
})
|
|
24
27
|
export class VisitorIdentificationComponent implements OnInit, OnDestroy {
|
|
25
28
|
visitorIdentificationTimestamp: number;
|
|
@@ -27,10 +30,10 @@ export class VisitorIdentificationComponent implements OnInit, OnDestroy {
|
|
|
27
30
|
private contextSubscription: Subscription;
|
|
28
31
|
|
|
29
32
|
// inject the JssContextService, which maintains the current Sitecore Context
|
|
30
|
-
|
|
33
|
+
private jssContext = inject(JssContextService);
|
|
31
34
|
|
|
32
35
|
ngOnInit() {
|
|
33
|
-
this.contextSubscription = this.jssContext.state.subscribe((state) => {
|
|
36
|
+
this.contextSubscription = this.jssContext.state.subscribe((state: JssState) => {
|
|
34
37
|
if (state.sitecore && state.sitecore.context) {
|
|
35
38
|
if (
|
|
36
39
|
!emittedVI &&
|
|
@@ -29,6 +29,7 @@ export const components = [
|
|
|
29
29
|
@NgModule({
|
|
30
30
|
imports: [
|
|
31
31
|
AppComponentsSharedModule,
|
|
32
|
+
${declarations.join('\n ')} // Standalone components
|
|
32
33
|
JssModule.withComponents([
|
|
33
34
|
${registrations.join('\n ')}
|
|
34
35
|
], [
|
|
@@ -49,9 +50,6 @@ export const components = [
|
|
|
49
50
|
JssModule,
|
|
50
51
|
AppComponentsSharedModule,
|
|
51
52
|
],
|
|
52
|
-
declarations: [
|
|
53
|
-
${declarations.join('\n ')}
|
|
54
|
-
],
|
|
55
53
|
})
|
|
56
54
|
export class AppComponentsModule { }
|
|
57
55
|
`;
|
|
@@ -14,8 +14,7 @@ import { NavigationItemComponent } from './navigation/navigation-item.component'
|
|
|
14
14
|
Don't want code generation? See ./.gitignore for instructions to turn it off.
|
|
15
15
|
*/
|
|
16
16
|
@NgModule({
|
|
17
|
-
imports: [CommonModule, TranslateModule, RouterModule, JssModule, FormsModule],
|
|
17
|
+
imports: [CommonModule, TranslateModule, RouterModule, JssModule, FormsModule, NavigationItemComponent],
|
|
18
18
|
exports: [CommonModule, TranslateModule, RouterModule, FormsModule, NavigationItemComponent],
|
|
19
|
-
declarations: [NavigationItemComponent],
|
|
20
19
|
})
|
|
21
20
|
export class AppComponentsSharedModule {}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
<div
|
|
3
|
-
<
|
|
1
|
+
@for (ph of enabledPlaceholders; track ph) {
|
|
2
|
+
<div [ngClass]="getColumnClass(+ph - 1)">
|
|
3
|
+
<div class="row">
|
|
4
|
+
<sc-placeholder [name]="getPlaceholderName(ph)" [rendering]="rendering"> </sc-placeholder>
|
|
5
|
+
</div>
|
|
4
6
|
</div>
|
|
5
|
-
|
|
7
|
+
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { JssModule } from '@sitecore-jss/sitecore-jss-angular';
|
|
2
4
|
import { SxaComponent } from '../sxa.component';
|
|
3
5
|
|
|
4
6
|
@Component({
|
|
5
7
|
selector: 'app-column-splitter',
|
|
6
8
|
templateUrl: './column-splitter.component.html',
|
|
9
|
+
imports: [CommonModule, JssModule],
|
|
7
10
|
host: {
|
|
8
11
|
'class': 'row component column-splitter',
|
|
9
12
|
'[class]': 'columnSplitterStyles',
|
package/dist/templates/angular-xmcloud/src/app/components/container/container.component.html
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
<
|
|
1
|
+
@if (wrapped) {
|
|
2
|
+
<div class="container-wrapper">
|
|
3
|
+
<div class="component container-default {{ styles }}" [attr.id]="id">
|
|
4
|
+
<div class="component-content" [ngStyle]="backgroundStyle">
|
|
5
|
+
<sc-placeholder
|
|
6
|
+
[name]="placeholderName"
|
|
7
|
+
[rendering]="rendering"
|
|
8
|
+
class="row">
|
|
9
|
+
</sc-placeholder>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
} @else {
|
|
5
14
|
<div class="component container-default {{ styles }}" [attr.id]="id">
|
|
6
15
|
<div class="component-content" [ngStyle]="backgroundStyle">
|
|
7
16
|
<sc-placeholder
|
|
@@ -11,4 +20,4 @@
|
|
|
11
20
|
</sc-placeholder>
|
|
12
21
|
</div>
|
|
13
22
|
</div>
|
|
14
|
-
|
|
23
|
+
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { Component, OnInit } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { JssModule } from '@sitecore-jss/sitecore-jss-angular';
|
|
2
4
|
import { SxaComponent } from '../sxa.component';
|
|
3
5
|
|
|
4
6
|
@Component({
|
|
5
7
|
selector: 'app-container',
|
|
6
8
|
templateUrl: './container.component.html',
|
|
9
|
+
imports: [CommonModule, JssModule],
|
|
7
10
|
})
|
|
8
11
|
export class ContainerComponent extends SxaComponent implements OnInit {
|
|
9
12
|
placeholderName: string;
|
|
@@ -1,36 +1,34 @@
|
|
|
1
1
|
<ng-container [ngTemplateOutlet]="variant"></ng-container>
|
|
2
2
|
|
|
3
3
|
<ng-template #default>
|
|
4
|
-
|
|
5
|
-
<div class="component
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
@if (rendering.fields) {
|
|
5
|
+
<div class="component image {{ styles }}" [attr.id]="id">
|
|
6
|
+
<div class="component-content">
|
|
7
|
+
@if (isEditing || !rendering.fields.TargetUrl?.value?.href) {
|
|
8
|
+
<img *scImage="rendering.fields.Image" />
|
|
9
|
+
} @else {
|
|
10
|
+
<a *scGenericLink="rendering.fields.TargetUrl">
|
|
11
|
+
<img *scImage="rendering.fields.Image" />
|
|
12
|
+
</a>
|
|
13
|
+
}
|
|
14
|
+
<span class="image-caption field-imagecaption" *scText="rendering.fields.ImageCaption"></span>
|
|
15
|
+
</div>
|
|
10
16
|
</div>
|
|
11
|
-
|
|
17
|
+
} @else {
|
|
18
|
+
<div class="component image {{ styles }}">
|
|
19
|
+
<div class="component-content">
|
|
20
|
+
<span class="is-empty-hint">Image</span>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
}
|
|
12
24
|
</ng-template>
|
|
13
25
|
|
|
14
26
|
<ng-template #banner>
|
|
15
27
|
<div class="component hero-banner {{ styles }} {{ classHeroBannerEmpty }}" [attr.id]="id">
|
|
16
28
|
<div class="component-content sc-sxa-image-hero-banner" [ngStyle]="backgroundStyle">
|
|
17
|
-
|
|
29
|
+
@if (isEditing) {
|
|
18
30
|
<img *scImage="modifyImageProps" />
|
|
19
|
-
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
</ng-template>
|
|
23
|
-
|
|
24
|
-
<ng-template #withLink>
|
|
25
|
-
<a *scGenericLink="rendering.fields.TargetUrl">
|
|
26
|
-
<img *scImage="rendering.fields.Image" />
|
|
27
|
-
</a>
|
|
28
|
-
</ng-template>
|
|
29
|
-
|
|
30
|
-
<ng-template #empty>
|
|
31
|
-
<div class="component image {{ styles }}">
|
|
32
|
-
<div class="component-content">
|
|
33
|
-
<span class="is-empty-hint">Image</span>
|
|
31
|
+
}
|
|
34
32
|
</div>
|
|
35
33
|
</div>
|
|
36
34
|
</ng-template>
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { Component, OnInit, OnDestroy, ViewChild, TemplateRef } from '@angular/core';
|
|
1
|
+
import { Component, OnInit, OnDestroy, ViewChild, TemplateRef, inject } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { JssModule } from '@sitecore-jss/sitecore-jss-angular';
|
|
2
4
|
import { Subscription } from 'rxjs';
|
|
3
5
|
import { EditMode, ImageField } from '@sitecore-jss/sitecore-jss-angular';
|
|
4
6
|
import { SxaComponent } from '../sxa.component';
|
|
@@ -7,6 +9,7 @@ import { JssContextService } from '../../jss-context.service';
|
|
|
7
9
|
@Component({
|
|
8
10
|
selector: 'app-image',
|
|
9
11
|
templateUrl: './image.component.html',
|
|
12
|
+
imports: [CommonModule, JssModule],
|
|
10
13
|
})
|
|
11
14
|
export class ImageComponent extends SxaComponent implements OnInit, OnDestroy {
|
|
12
15
|
@ViewChild('default', { static: true }) defaultVariant: TemplateRef<any>;
|
|
@@ -16,10 +19,7 @@ export class ImageComponent extends SxaComponent implements OnInit, OnDestroy {
|
|
|
16
19
|
modifyImageProps = {};
|
|
17
20
|
isEditing = false;
|
|
18
21
|
private contextSubscription: Subscription;
|
|
19
|
-
|
|
20
|
-
constructor(private jssContext: JssContextService) {
|
|
21
|
-
super();
|
|
22
|
-
}
|
|
22
|
+
private jssContext = inject(JssContextService);
|
|
23
23
|
|
|
24
24
|
ngOnInit() {
|
|
25
25
|
super.ngOnInit();
|
package/dist/templates/angular-xmcloud/src/app/components/link-list/link-list.component.html
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
<div class="component-content">
|
|
2
|
-
|
|
2
|
+
@if (title) {
|
|
3
3
|
<h3 *scText="title"></h3>
|
|
4
|
-
|
|
4
|
+
} @else {
|
|
5
|
+
<span class="is-empty-hint">Link list</span>
|
|
6
|
+
}
|
|
5
7
|
<ul>
|
|
6
|
-
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
@for (fieldLink of fieldLinks; track $index) {
|
|
9
|
+
<li [ngClass]="getFieldLinkClass($index)">
|
|
10
|
+
<div class="field-link">
|
|
11
|
+
<a *scGenericLink="fieldLink"></a>
|
|
12
|
+
</div>
|
|
13
|
+
</li>
|
|
14
|
+
}
|
|
11
15
|
</ul>
|
|
12
16
|
</div>
|
|
13
|
-
<ng-template #defaultTitle>
|
|
14
|
-
<span class="is-empty-hint">Link list</span>
|
|
15
|
-
</ng-template>
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { Component, OnInit } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { JssModule } from '@sitecore-jss/sitecore-jss-angular';
|
|
2
4
|
import { SxaComponent } from '../sxa.component';
|
|
3
5
|
import { Field, LinkField, SxaLinkListFields } from '@sitecore-jss/sitecore-jss-angular';
|
|
4
6
|
|
|
5
7
|
@Component({
|
|
6
8
|
selector: 'app-link-list',
|
|
7
9
|
templateUrl: './link-list.component.html',
|
|
10
|
+
imports: [CommonModule, JssModule],
|
|
8
11
|
host: {
|
|
9
12
|
'class': 'component link-list',
|
|
10
13
|
'[class]': 'styles',
|
package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation-item.component.html
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
<li [class]="cssClasses" [ngClass]="{ active: isActive }" tabIndex="0">
|
|
2
2
|
<div [ngClass]="{ 'navigation-title': true, child: hasChildren }" (click)="isActive = !isActive">
|
|
3
3
|
<a *scRouterLink="linkField" (click)="onClick($event)">
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
navItemFields.DisplayName
|
|
12
|
-
}}</ng-container>
|
|
4
|
+
@if (navItemFields.NavigationTitle) {
|
|
5
|
+
<span *scText="navItemFields.NavigationTitle"></span>
|
|
6
|
+
} @else if (navItemFields.Title) {
|
|
7
|
+
<span *scText="navItemFields.Title"></span>
|
|
8
|
+
} @else {
|
|
9
|
+
{{ navItemFields.DisplayName }}
|
|
10
|
+
}
|
|
13
11
|
</a>
|
|
14
12
|
</div>
|
|
15
|
-
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</ul>
|
|
13
|
+
@if (hasChildren) {
|
|
14
|
+
<ul class="clearfix">
|
|
15
|
+
@for (childNavItemFields of navItemFields.Children; track childNavItemFields.Id) {
|
|
16
|
+
<app-navigation-item [navItemFields]="childNavItemFields" [relativeLevel]="childrenRelativeLevel" (childLinkClickEvent)="onClick($event)"></app-navigation-item>
|
|
17
|
+
}
|
|
18
|
+
</ul>
|
|
19
|
+
}
|
|
23
20
|
</li>
|
package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation-item.component.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { LinkField, JssModule } from '@sitecore-jss/sitecore-jss-angular';
|
|
3
4
|
import { Field } from '@sitecore-jss/sitecore-jss-angular';
|
|
4
5
|
|
|
5
6
|
export interface NavItemFields {
|
|
@@ -16,6 +17,7 @@ export interface NavItemFields {
|
|
|
16
17
|
@Component({
|
|
17
18
|
selector: 'app-navigation-item',
|
|
18
19
|
templateUrl: './navigation-item.component.html',
|
|
20
|
+
imports: [CommonModule, JssModule]
|
|
19
21
|
})
|
|
20
22
|
export class NavigationItemComponent implements OnInit {
|
|
21
23
|
@Input() navItemFields: NavItemFields;
|
|
@@ -27,8 +29,6 @@ export class NavigationItemComponent implements OnInit {
|
|
|
27
29
|
childrenRelativeLevel = 0;
|
|
28
30
|
hasChildren = false;
|
|
29
31
|
|
|
30
|
-
constructor() {}
|
|
31
|
-
|
|
32
32
|
ngOnInit() {
|
|
33
33
|
this.cssClasses = `${this.navItemFields.Styles.concat('rel-level' + this.relativeLevel).join(
|
|
34
34
|
' '
|
package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation.component.html
CHANGED
|
@@ -9,12 +9,9 @@
|
|
|
9
9
|
<div class="component-content">
|
|
10
10
|
<nav>
|
|
11
11
|
<ul class="clearfix">
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
[relativeLevel]="baseLevel"
|
|
16
|
-
(childLinkClickEvent)="toggleMenu($event, false)"
|
|
17
|
-
></app-navigation-item>
|
|
12
|
+
@for (navItemFields of fieldKeys; track $index) {
|
|
13
|
+
<app-navigation-item [navItemFields]="rendering.fields[navItemFields]" [relativeLevel]="baseLevel" (childLinkClickEvent)="toggleMenu($event, false)"></app-navigation-item>
|
|
14
|
+
}
|
|
18
15
|
</ul>
|
|
19
16
|
</nav>
|
|
20
17
|
</div>
|
package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation.component.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { Component, OnInit, OnDestroy } from '@angular/core';
|
|
1
|
+
import { Component, OnInit, OnDestroy, inject } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { JssModule } from '@sitecore-jss/sitecore-jss-angular';
|
|
2
4
|
import { Subscription } from 'rxjs';
|
|
3
5
|
import { SxaComponent } from '../sxa.component';
|
|
4
6
|
import { JssContextService } from '../../jss-context.service';
|
|
7
|
+
import { NavigationItemComponent } from './navigation-item.component';
|
|
5
8
|
|
|
6
9
|
@Component({
|
|
7
10
|
selector: 'app-navigation',
|
|
8
11
|
templateUrl: './navigation.component.html',
|
|
12
|
+
imports: [CommonModule, JssModule, NavigationItemComponent],
|
|
9
13
|
host: {
|
|
10
14
|
'class': 'component navigation',
|
|
11
15
|
'[id]': 'id',
|
|
@@ -17,16 +21,15 @@ export class NavigationComponent extends SxaComponent implements OnInit, OnDestr
|
|
|
17
21
|
private contextSubscription: Subscription;
|
|
18
22
|
isOpenMenu = false;
|
|
19
23
|
baseLevel = 1;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
super();
|
|
23
|
-
}
|
|
24
|
+
private jssContext = inject(JssContextService);
|
|
25
|
+
fieldKeys: string[];
|
|
24
26
|
|
|
25
27
|
ngOnInit() {
|
|
26
28
|
super.ngOnInit();
|
|
27
29
|
this.contextSubscription = this.jssContext.state.subscribe((newState) => {
|
|
28
30
|
this.isEditing = newState.sitecore && newState.sitecore.context.pageEditing;
|
|
29
31
|
});
|
|
32
|
+
this.fieldKeys = Object.keys(this.rendering.fields || {});
|
|
30
33
|
}
|
|
31
34
|
|
|
32
35
|
ngOnDestroy() {
|
package/dist/templates/angular-xmcloud/src/app/components/page-content/page-content.component.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { Component, OnDestroy, OnInit, inject } from '@angular/core';
|
|
2
|
+
import { JssModule } from '@sitecore-jss/sitecore-jss-angular';
|
|
2
3
|
import { RichTextField } from '@sitecore-jss/sitecore-jss-angular';
|
|
3
4
|
import { JssContextService } from '../../jss-context.service';
|
|
4
5
|
import { SxaComponent } from './../sxa.component';
|
|
@@ -7,6 +8,7 @@ import { Subscription } from 'rxjs';
|
|
|
7
8
|
@Component({
|
|
8
9
|
selector: 'app-page-content',
|
|
9
10
|
templateUrl: './page-content.component.html',
|
|
11
|
+
imports: [JssModule],
|
|
10
12
|
host: {
|
|
11
13
|
'class': 'component content',
|
|
12
14
|
'[class]': 'styles',
|
|
@@ -17,10 +19,8 @@ export class PageContentComponent extends SxaComponent implements OnInit, OnDest
|
|
|
17
19
|
content?: RichTextField;
|
|
18
20
|
contextContent?: RichTextField;
|
|
19
21
|
private contextSubscription: Subscription;
|
|
22
|
+
private jssContext = inject(JssContextService);
|
|
20
23
|
|
|
21
|
-
constructor(private jssContext: JssContextService) {
|
|
22
|
-
super();
|
|
23
|
-
}
|
|
24
24
|
ngOnInit() {
|
|
25
25
|
super.ngOnInit();
|
|
26
26
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Component, OnInit } from '@angular/core';
|
|
2
|
+
import { JssModule } from '@sitecore-jss/sitecore-jss-angular';
|
|
2
3
|
import { SxaComponent } from '../sxa.component';
|
|
3
4
|
|
|
4
5
|
@Component({
|
|
5
6
|
selector: 'app-partial-design-dynamic-placeholder',
|
|
6
7
|
templateUrl: './partial-design-dynamic-placeholder.component.html',
|
|
8
|
+
imports: [JssModule]
|
|
7
9
|
})
|
|
8
10
|
export class PartialDesignDynamicPlaceholderComponent extends SxaComponent implements OnInit {
|
|
9
11
|
sig: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div class="component-content">
|
|
2
|
-
|
|
2
|
+
@if (rendering.fields) {
|
|
3
3
|
<div class="field-promoicon">
|
|
4
4
|
<img *scImage="rendering.fields.PromoIcon" />
|
|
5
5
|
</div>
|
|
@@ -13,9 +13,7 @@
|
|
|
13
13
|
<a *scGenericLink="rendering.fields.PromoLink"></a>
|
|
14
14
|
</div>
|
|
15
15
|
</div>
|
|
16
|
-
|
|
16
|
+
} @else {
|
|
17
|
+
<span className="is-empty-hint">Promo</span>
|
|
18
|
+
}
|
|
17
19
|
</div>
|
|
18
|
-
|
|
19
|
-
<ng-template #empty>
|
|
20
|
-
<span className="is-empty-hint">Promo</span>
|
|
21
|
-
</ng-template>
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { Component } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { JssModule } from '@sitecore-jss/sitecore-jss-angular';
|
|
2
4
|
import { SxaComponent } from '../sxa.component';
|
|
3
5
|
|
|
4
6
|
@Component({
|
|
5
7
|
selector: 'app-promo',
|
|
6
8
|
templateUrl: './promo.component.html',
|
|
9
|
+
imports: [CommonModule, JssModule],
|
|
7
10
|
host: {
|
|
8
11
|
'class': 'component promo',
|
|
9
12
|
'[class]': "styles",
|