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.
Files changed (229) hide show
  1. package/LICENSE.MD +202 -202
  2. package/README.md +10 -10
  3. package/dist/templates/angular/package.json +24 -25
  4. package/dist/templates/angular/scripts/generate-component-factory/template.ts +1 -3
  5. package/dist/templates/angular/server.bundle.ts +3 -2
  6. package/dist/templates/angular/src/app/ViewBag.ts +4 -0
  7. package/dist/templates/angular/src/app/app.component.ts +10 -9
  8. package/dist/templates/angular/src/app/app.module.ts +3 -1
  9. package/dist/templates/angular/src/app/app.server.module.ts +4 -5
  10. package/dist/templates/angular/src/app/components/app-components.shared.module.ts +16 -3
  11. package/dist/templates/angular/src/app/components/content-block/content-block.component.ts +2 -1
  12. package/dist/templates/angular/src/app/i18n/jss-translation-client-loader.service.ts +3 -2
  13. package/dist/templates/angular/src/app/i18n/jss-translation-server-loader.service.ts +6 -4
  14. package/dist/templates/angular/src/app/injection-tokens.ts +13 -0
  15. package/dist/templates/angular/src/app/jss-context.server-side.service.ts +8 -10
  16. package/dist/templates/angular/src/app/jss-context.service.ts +6 -4
  17. package/dist/templates/angular/src/app/jss-graphql.module.ts +58 -48
  18. package/dist/templates/angular/src/app/jss-graphql.service.ts +6 -6
  19. package/dist/templates/angular/src/app/jss-meta.service.ts +3 -2
  20. package/dist/templates/angular/src/app/routing/layout/layout.component.ts +10 -4
  21. package/dist/templates/angular/src/app/routing/navigation/navigation.component.ts +3 -0
  22. package/dist/templates/angular/src/app/routing/not-found/not-found.component.ts +1 -1
  23. package/dist/templates/angular/src/app/routing/routing.module.ts +3 -4
  24. package/dist/templates/angular/src/app/routing/scripts/scripts.module.ts +1 -1
  25. package/dist/templates/angular/src/assets/images/sc_logo.svg +52 -52
  26. package/dist/templates/angular-sxp/data/component-content/Styleguide/ContentReuse/LoremIpsumContentBlock/en.yml +9 -9
  27. package/dist/templates/angular-sxp/data/content/Styleguide/ContentListField/Item1/en.yml +6 -6
  28. package/dist/templates/angular-sxp/data/content/Styleguide/ContentListField/Item2/en.yml +6 -6
  29. package/dist/templates/angular-sxp/data/content/Styleguide/EditFrameDemo/Item1/en.yml +6 -6
  30. package/dist/templates/angular-sxp/data/content/Styleguide/EditFrameDemo/Item2/en.yml +6 -6
  31. package/dist/templates/angular-sxp/data/content/Styleguide/ItemLinkField/Item1/en.yml +6 -6
  32. package/dist/templates/angular-sxp/data/content/Styleguide/ItemLinkField/Item2/en.yml +6 -6
  33. package/dist/templates/angular-sxp/data/dictionary/en.yml +4 -4
  34. package/dist/templates/angular-sxp/data/dictionary/{{language}}.yml +4 -4
  35. package/dist/templates/angular-sxp/data/routes/en.yml +61 -61
  36. package/dist/templates/angular-sxp/data/routes/graphql/en.yml +27 -27
  37. package/dist/templates/angular-sxp/data/routes/graphql/sample-1/en.yml +9 -9
  38. package/dist/templates/angular-sxp/data/routes/graphql/sample-2/en.yml +9 -9
  39. package/dist/templates/angular-sxp/data/routes/styleguide/custom-route-type/en.yml +12 -12
  40. package/dist/templates/angular-sxp/data/routes/styleguide/en.yml +271 -271
  41. package/dist/templates/angular-sxp/data/routes/styleguide/{{language}}.yml +25 -25
  42. package/dist/templates/angular-sxp/data/routes/{{language}}.yml +4 -4
  43. package/dist/templates/angular-sxp/sitecore/config/{{appName}}.config +90 -90
  44. package/dist/templates/angular-sxp/sitecore/definitions/components/graph-ql-integrated-demo.sitecore.graphql +71 -71
  45. package/dist/templates/angular-sxp/sitecore/gitignore +2 -2
  46. package/dist/templates/angular-sxp/src/app/components/app-components.shared.module.ts +1 -3
  47. package/dist/templates/angular-sxp/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.html +41 -39
  48. package/dist/templates/angular-sxp/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.ts +5 -3
  49. package/dist/templates/angular-sxp/src/app/components/graph-ql-integrated-demo/graph-ql-integrated-demo.component.html +6 -4
  50. package/dist/templates/angular-sxp/src/app/components/graph-ql-integrated-demo/graph-ql-integrated-demo.component.ts +4 -4
  51. package/dist/templates/angular-sxp/src/app/components/graph-ql-layout/graph-ql-layout.component.html +3 -4
  52. package/dist/templates/angular-sxp/src/app/components/graph-ql-layout/graph-ql-layout.component.ts +4 -4
  53. package/dist/templates/angular-sxp/src/app/components/shared/styleguide-specimen/styleguide-specimen.component.ts +3 -4
  54. package/dist/templates/angular-sxp/src/app/components/styleguide-angular-lazy-loading/styleguide-angular-lazy-loading.component.ts +5 -5
  55. package/dist/templates/angular-sxp/src/app/components/styleguide-angular-lazy-loading/styleguide-angular-lazy-loading.module.ts +2 -5
  56. package/dist/templates/angular-sxp/src/app/components/styleguide-component-params/styleguide-component-params.component.html +8 -4
  57. package/dist/templates/angular-sxp/src/app/components/styleguide-component-params/styleguide-component-params.component.ts +2 -2
  58. package/dist/templates/angular-sxp/src/app/components/styleguide-custom-route-type/styleguide-custom-route-type.component.ts +5 -5
  59. package/dist/templates/angular-sxp/src/app/components/styleguide-edit-frame/styleguide-edit-frame.component.html +7 -3
  60. package/dist/templates/angular-sxp/src/app/components/styleguide-edit-frame/styleguide-edit-frame.component.ts +13 -4
  61. package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-checkbox/styleguide-field-usage-checkbox.component.ts +2 -2
  62. package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-content-list/styleguide-field-usage-content-list.component.html +20 -16
  63. package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-content-list/styleguide-field-usage-content-list.component.ts +20 -3
  64. package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-custom/styleguide-field-usage-custom.component.ts +2 -0
  65. package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-date/styleguide-field-usage-date.component.ts +4 -1
  66. package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-file/styleguide-field-usage-file.component.ts +3 -1
  67. package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-image/styleguide-field-usage-image.component.ts +3 -1
  68. package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-item-link/styleguide-field-usage-item-link.component.html +4 -4
  69. package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-item-link/styleguide-field-usage-item-link.component.ts +4 -1
  70. package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-link/styleguide-field-usage-link.component.ts +3 -1
  71. package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-number/styleguide-field-usage-number.component.ts +2 -0
  72. package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-rich-text/styleguide-field-usage-rich-text.component.ts +3 -1
  73. package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-text/styleguide-field-usage-text.component.ts +3 -1
  74. package/dist/templates/angular-sxp/src/app/components/styleguide-layout/styleguide-layout.component.html +12 -8
  75. package/dist/templates/angular-sxp/src/app/components/styleguide-layout/styleguide-layout.component.ts +2 -4
  76. package/dist/templates/angular-sxp/src/app/components/styleguide-layout-reuse/styleguide-layout-reuse.component.ts +3 -1
  77. package/dist/templates/angular-sxp/src/app/components/styleguide-layout-tabs/styleguide-layout-tabs.component.html +18 -15
  78. package/dist/templates/angular-sxp/src/app/components/styleguide-layout-tabs/styleguide-layout-tabs.component.ts +6 -4
  79. package/dist/templates/angular-sxp/src/app/components/styleguide-layout-tabs-tab/styleguide-layout-tabs-tab.component.html +2 -2
  80. package/dist/templates/angular-sxp/src/app/components/styleguide-layout-tabs-tab/styleguide-layout-tabs-tab.component.ts +4 -4
  81. package/dist/templates/angular-sxp/src/app/components/styleguide-multilingual/styleguide-multilingual.component.ts +7 -3
  82. package/dist/templates/angular-sxp/src/app/components/styleguide-route-fields/styleguide-route-fields.component.ts +5 -4
  83. package/dist/templates/angular-sxp/src/app/components/styleguide-section/styleguide-section.component.ts +2 -1
  84. package/dist/templates/angular-sxp/src/app/components/styleguide-sitecore-context/styleguide-sitecore-context.component.ts +7 -4
  85. package/dist/templates/angular-sxp/src/app/components/styleguide-tracking/styleguide-tracking.component.html +6 -2
  86. package/dist/templates/angular-sxp/src/app/components/styleguide-tracking/styleguide-tracking.component.ts +12 -12
  87. package/dist/templates/angular-sxp/src/app/jss-data-fetcher.service.ts +4 -2
  88. package/dist/templates/angular-sxp/src/app/routing/scripts/scripts.component.ts +10 -0
  89. package/dist/templates/angular-sxp/src/app/routing/scripts/scripts.module.ts +1 -1
  90. package/dist/templates/angular-sxp/src/app/routing/scripts/visitor-identification/visitor-identification.component.ts +6 -3
  91. package/dist/templates/angular-xmcloud/scripts/generate-component-factory/template.ts +1 -3
  92. package/dist/templates/angular-xmcloud/src/app/components/app-components.shared.module.ts +1 -2
  93. package/dist/templates/angular-xmcloud/src/app/components/column-splitter/column-splitter.component.html +6 -4
  94. package/dist/templates/angular-xmcloud/src/app/components/column-splitter/column-splitter.component.ts +4 -1
  95. package/dist/templates/angular-xmcloud/src/app/components/container/container.component.html +14 -5
  96. package/dist/templates/angular-xmcloud/src/app/components/container/container.component.ts +3 -0
  97. package/dist/templates/angular-xmcloud/src/app/components/image/image.component.html +21 -23
  98. package/dist/templates/angular-xmcloud/src/app/components/image/image.component.ts +5 -5
  99. package/dist/templates/angular-xmcloud/src/app/components/link-list/link-list.component.html +11 -10
  100. package/dist/templates/angular-xmcloud/src/app/components/link-list/link-list.component.ts +3 -0
  101. package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation-item.component.html +14 -17
  102. package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation-item.component.ts +3 -3
  103. package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation.component.html +3 -6
  104. package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation.component.ts +8 -5
  105. package/dist/templates/angular-xmcloud/src/app/components/page-content/page-content.component.ts +4 -4
  106. package/dist/templates/angular-xmcloud/src/app/components/partial-design-dynamic-placeholder/partial-design-dynamic-placeholder.component.ts +2 -0
  107. package/dist/templates/angular-xmcloud/src/app/components/promo/promo.component.html +4 -6
  108. package/dist/templates/angular-xmcloud/src/app/components/promo/promo.component.ts +3 -0
  109. package/dist/templates/angular-xmcloud/src/app/components/richtext/richtext.component.html +3 -4
  110. package/dist/templates/angular-xmcloud/src/app/components/richtext/richtext.component.ts +3 -0
  111. package/dist/templates/angular-xmcloud/src/app/components/row-splitter/row-splitter.component.html +10 -9
  112. package/dist/templates/angular-xmcloud/src/app/components/row-splitter/row-splitter.component.ts +3 -0
  113. package/dist/templates/angular-xmcloud/src/app/components/title/title.component.html +4 -5
  114. package/dist/templates/angular-xmcloud/src/app/components/title/title.component.ts +5 -5
  115. package/dist/templates/angular-xmcloud/src/app/jss-link.service.ts +2 -2
  116. package/dist/templates/angular-xmcloud/src/app/routing/layout/layout.component.html +38 -36
  117. package/dist/templates/angular-xmcloud/src/app/routing/layout/layout.component.ts +10 -6
  118. package/dist/templates/angular-xmcloud/src/app/routing/scripts/cdp-page-view.component.ts +2 -3
  119. package/dist/templates/angular-xmcloud/src/app/routing/scripts/cloud-sdk-init.component.ts +2 -2
  120. package/dist/templates/angular-xmcloud/src/app/routing/scripts/scripts.component.ts +13 -0
  121. package/dist/templates/angular-xmcloud/src/app/routing/scripts/scripts.module.ts +1 -2
  122. package/dist/templates/nextjs/public/sc_logo.svg +52 -52
  123. package/dist/templates/nextjs-styleguide/data/component-content/Styleguide/ContentReuse/LoremIpsumContentBlock/en.yml +9 -9
  124. package/dist/templates/nextjs-styleguide/data/content/Styleguide/ContentListField/Item1/en.yml +6 -6
  125. package/dist/templates/nextjs-styleguide/data/content/Styleguide/ContentListField/Item2/en.yml +6 -6
  126. package/dist/templates/nextjs-styleguide/data/content/Styleguide/EditFrameDemo/Item1/en.yml +6 -6
  127. package/dist/templates/nextjs-styleguide/data/content/Styleguide/EditFrameDemo/Item2/en.yml +6 -6
  128. package/dist/templates/nextjs-styleguide/data/content/Styleguide/ItemLinkField/Item1/en.yml +6 -6
  129. package/dist/templates/nextjs-styleguide/data/content/Styleguide/ItemLinkField/Item2/en.yml +6 -6
  130. package/dist/templates/nextjs-styleguide/data/dictionary/en.yml +4 -4
  131. package/dist/templates/nextjs-styleguide/data/dictionary/{{language}}.yml +4 -4
  132. package/dist/templates/nextjs-styleguide/data/routes/en.yml +63 -63
  133. package/dist/templates/nextjs-styleguide/data/routes/graphql/en.yml +27 -27
  134. package/dist/templates/nextjs-styleguide/data/routes/graphql/sample-1/en.yml +9 -9
  135. package/dist/templates/nextjs-styleguide/data/routes/graphql/sample-2/en.yml +9 -9
  136. package/dist/templates/nextjs-styleguide/data/routes/styleguide/custom-route-type/en.yml +12 -12
  137. package/dist/templates/nextjs-styleguide/data/routes/styleguide/en.yml +259 -259
  138. package/dist/templates/nextjs-styleguide/data/routes/styleguide/{{language}}.yml +25 -25
  139. package/dist/templates/nextjs-styleguide/data/routes/{{language}}.yml +4 -4
  140. package/dist/templates/nextjs-styleguide-tracking/data/dictionary/en.yml +5 -5
  141. package/dist/templates/nextjs-styleguide-tracking/data/routes/tracking/en.yml +8 -8
  142. package/dist/templates/nextjs-sxa/src/assets/sass/components/_component-column-splitter.scss +14 -14
  143. package/dist/templates/nextjs-sxa/src/assets/sass/components/promo/_promo-shadow.scss +42 -42
  144. package/dist/templates/react/data/component-content/Styleguide/ContentReuse/LoremIpsumContentBlock/en.yml +9 -9
  145. package/dist/templates/react/data/content/Styleguide/ContentListField/Item1/en.yml +6 -6
  146. package/dist/templates/react/data/content/Styleguide/ContentListField/Item2/en.yml +6 -6
  147. package/dist/templates/react/data/content/Styleguide/EditFrameDemo/Item1/en.yml +6 -6
  148. package/dist/templates/react/data/content/Styleguide/EditFrameDemo/Item2/en.yml +6 -6
  149. package/dist/templates/react/data/content/Styleguide/ItemLinkField/Item1/en.yml +6 -6
  150. package/dist/templates/react/data/content/Styleguide/ItemLinkField/Item2/en.yml +6 -6
  151. package/dist/templates/react/data/dictionary/en.yml +4 -4
  152. package/dist/templates/react/data/dictionary/{{language}}.yml +4 -4
  153. package/dist/templates/react/data/routes/en.yml +61 -61
  154. package/dist/templates/react/data/routes/graphql/en.yml +27 -27
  155. package/dist/templates/react/data/routes/graphql/sample-1/en.yml +9 -9
  156. package/dist/templates/react/data/routes/graphql/sample-2/en.yml +9 -9
  157. package/dist/templates/react/data/routes/styleguide/custom-route-type/en.yml +12 -12
  158. package/dist/templates/react/data/routes/styleguide/en.yml +263 -263
  159. package/dist/templates/react/data/routes/styleguide/{{language}}.yml +26 -26
  160. package/dist/templates/react/data/routes/{{language}}.yml +4 -4
  161. package/dist/templates/react-native/.buckconfig +6 -6
  162. package/dist/templates/react-native/.eslintrc +74 -74
  163. package/dist/templates/react-native/.gitattributes +1 -1
  164. package/dist/templates/react-native/.prettierrc +9 -9
  165. package/dist/templates/react-native/.vscode/launch.json +42 -42
  166. package/dist/templates/react-native/.vscode/settings.json +1 -1
  167. package/dist/templates/react-native/LICENSE.txt +202 -202
  168. package/dist/templates/react-native/README.MD +115 -115
  169. package/dist/templates/react-native/android/app/BUCK +55 -55
  170. package/dist/templates/react-native/android/app/build.gradle +201 -201
  171. package/dist/templates/react-native/android/app/build_defs.bzl +19 -19
  172. package/dist/templates/react-native/android/app/proguard-rules.pro +10 -10
  173. package/dist/templates/react-native/android/app/src/debug/AndroidManifest.xml +8 -8
  174. package/dist/templates/react-native/android/app/src/main/AndroidManifest.xml +26 -26
  175. package/dist/templates/react-native/android/app/src/main/java/com/{{appName}}/MainActivity.java +15 -15
  176. package/dist/templates/react-native/android/app/src/main/java/com/{{appName}}/MainApplication.java +74 -74
  177. package/dist/templates/react-native/android/app/src/main/res/values/strings.xml +3 -3
  178. package/dist/templates/react-native/android/app/src/main/res/values/styles.xml +9 -9
  179. package/dist/templates/react-native/android/build.gradle +38 -38
  180. package/dist/templates/react-native/android/gradle/wrapper/gradle-wrapper.properties +5 -5
  181. package/dist/templates/react-native/android/gradle.properties +21 -21
  182. package/dist/templates/react-native/android/gradlew +188 -188
  183. package/dist/templates/react-native/android/gradlew.bat +100 -100
  184. package/dist/templates/react-native/android/settings.gradle +3 -3
  185. package/dist/templates/react-native/app.json +3 -3
  186. package/dist/templates/react-native/assets/img/sc_logo.svg +52 -52
  187. package/dist/templates/react-native/data/content/Styleguide/ItemLinkField/Item1/en.json +10 -10
  188. package/dist/templates/react-native/data/routes/en.json +22 -22
  189. package/dist/templates/react-native/data/routes/styleguide/en.json +227 -227
  190. package/dist/templates/react-native/data/routes/styleguide/{{language}}.json +31 -31
  191. package/dist/templates/react-native/data/routes/{{language}}.json +7 -7
  192. package/dist/templates/react-native/gitignore +60 -60
  193. package/dist/templates/react-native/ios/Podfile +53 -53
  194. package/dist/templates/react-native/ios/{{appName}}/AppDelegate.h +15 -15
  195. package/dist/templates/react-native/ios/{{appName}}/AppDelegate.m +42 -42
  196. package/dist/templates/react-native/ios/{{appName}}/Base.lproj/LaunchScreen.xib +42 -42
  197. package/dist/templates/react-native/ios/{{appName}}/Images.xcassets/AppIcon.appiconset/Contents.json +38 -38
  198. package/dist/templates/react-native/ios/{{appName}}/Images.xcassets/Contents.json +6 -6
  199. package/dist/templates/react-native/ios/{{appName}}/Info.plist +57 -57
  200. package/dist/templates/react-native/ios/{{appName}}/main.m +16 -16
  201. package/dist/templates/react-native/ios/{{appName}}-tvOS/Info.plist +53 -53
  202. package/dist/templates/react-native/ios/{{appName}}-tvOSTests/Info.plist +24 -24
  203. package/dist/templates/react-native/ios/{{appName}}.xcodeproj/xcshareddata/xcschemes/BasicSampleReactNative-tvOS.xcscheme +129 -129
  204. package/dist/templates/react-native/ios/{{appName}}.xcodeproj/xcshareddata/xcschemes/BasicSampleReactNative.xcscheme +129 -129
  205. package/dist/templates/react-native/ios/{{appName}}Tests/BasicSampleReactNativeTests.m +72 -72
  206. package/dist/templates/react-native/ios/{{appName}}Tests/Info.plist +24 -24
  207. package/dist/templates/react-native/package.json +78 -78
  208. package/dist/templates/react-native/sitecore/config/{{appName}}.config +47 -47
  209. package/dist/templates/react-native/sitecore/gitignore +2 -2
  210. package/dist/templates/vue/data/component-content/Styleguide/ContentReuse/LoremIpsumContentBlock/en.yml +9 -9
  211. package/dist/templates/vue/data/content/Styleguide/ContentListField/Item1/en.yml +6 -6
  212. package/dist/templates/vue/data/content/Styleguide/ContentListField/Item2/en.yml +6 -6
  213. package/dist/templates/vue/data/content/Styleguide/EditFrameDemo/Item1/en.yml +6 -6
  214. package/dist/templates/vue/data/content/Styleguide/EditFrameDemo/Item2/en.yml +6 -6
  215. package/dist/templates/vue/data/content/Styleguide/ItemLinkField/Item1/en.yml +6 -6
  216. package/dist/templates/vue/data/content/Styleguide/ItemLinkField/Item2/en.yml +6 -6
  217. package/dist/templates/vue/data/dictionary/en.yml +7 -7
  218. package/dist/templates/vue/data/dictionary/{{language}}.yml +7 -7
  219. package/dist/templates/vue/data/routes/en.yml +63 -63
  220. package/dist/templates/vue/data/routes/graphql/en.yml +34 -34
  221. package/dist/templates/vue/data/routes/graphql/sample-1/en.yml +9 -9
  222. package/dist/templates/vue/data/routes/graphql/sample-2/en.yml +9 -9
  223. package/dist/templates/vue/data/routes/styleguide/custom-route-type/en.yml +12 -12
  224. package/dist/templates/vue/data/routes/styleguide/en.yml +264 -264
  225. package/dist/templates/vue/data/routes/styleguide/{{language}}.yml +26 -26
  226. package/dist/templates/vue/data/routes/{{language}}.yml +4 -4
  227. package/dist/templates/vue/public/img/icons/safari-pinned-tab.svg +75 -75
  228. package/dist/templates/vue/src/assets/sc_logo.svg +52 -52
  229. 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
- constructor(private jssContext: JssContextService) { }
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
- <p *ngIf="disconnectedMode">The tracking API is only available in connected, integrated, or headless modes.</p>
2
+ @if (disconnectedMode) {
3
+ <p>The tracking API is only available in connected, integrated, or headless modes.</p>
4
+ }
3
5
 
4
- <div *ngIf="!disconnectedMode">
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
- trackingApiOptions: TrackingRequestOptions;
29
-
30
- constructor(dataFetcher: JssDataFetcherService) {
31
- this.trackingApiOptions = {
32
- host: environment.sitecoreApiHost,
33
- querystringParams: {
34
- sc_apikey: environment.sitecoreApiKey,
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(private readonly httpClient: HttpClient) {
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
- constructor(private jssContext: JssContextService) {}
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
- <div *ngFor="let ph of enabledPlaceholders" [ngClass]="getColumnClass(+ph - 1)">
2
- <div class="row">
3
- <sc-placeholder [name]="getPlaceholderName(ph)" [rendering]="rendering"> </sc-placeholder>
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
- </div>
7
+ }
@@ -1,9 +1,12 @@
1
- import { Component } from '@angular/core';
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',
@@ -1,7 +1,16 @@
1
- <div class="container-wrapper" *ngIf="wrapped; else default">
2
- <ng-container *ngTemplateOutlet="default"></ng-container>
3
- </div>
4
- <ng-template #default>
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
- </ng-template>
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
- <div class="component image {{ styles }}" [attr.id]="id" *ngIf="rendering.fields; else empty">
5
- <div class="component-content">
6
- <ng-container *ngIf="isEditing || !rendering.fields.TargetUrl?.value?.href; else withLink">
7
- <img *scImage="rendering.fields.Image" />
8
- </ng-container>
9
- <span class="image-caption field-imagecaption" *scText="rendering.fields.ImageCaption"></span>
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
- </div>
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
- <ng-container *ngIf="isEditing">
29
+ @if (isEditing) {
18
30
  <img *scImage="modifyImageProps" />
19
- </ng-container>
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();
@@ -1,15 +1,16 @@
1
1
  <div class="component-content">
2
- <ng-container *ngIf="title; else defaultTitle">
2
+ @if (title) {
3
3
  <h3 *scText="title"></h3>
4
- </ng-container>
4
+ } @else {
5
+ <span class="is-empty-hint">Link list</span>
6
+ }
5
7
  <ul>
6
- <li *ngFor="let fieldLink of fieldLinks; index as i" [ngClass]="getFieldLinkClass(i)">
7
- <div class="field-link">
8
- <a *scGenericLink="fieldLink"></a>
9
- </div>
10
- </li>
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',
@@ -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
- <ng-container *ngIf="navItemFields.NavigationTitle"
5
- ><span *scText="navItemFields.NavigationTitle"></span
6
- ></ng-container>
7
- <ng-container *ngIf="!navItemFields.NavigationTitle && navItemFields.Title">
8
- <span *scText="navItemFields.Title"></span
9
- ></ng-container>
10
- <ng-container *ngIf="!navItemFields.NavigationTitle && !navItemFields.Title">{{
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
- <ul *ngIf="hasChildren" class="clearfix">
16
- <app-navigation-item
17
- *ngFor="let childNavItemFields of navItemFields.Children"
18
- [navItemFields]="childNavItemFields"
19
- [relativeLevel]="childrenRelativeLevel"
20
- (childLinkClickEvent)="onClick($event)"
21
- ></app-navigation-item>
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>
@@ -1,5 +1,6 @@
1
1
  import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core';
2
- import { LinkField } from '@sitecore-jss/sitecore-jss-angular';
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
  ' '
@@ -9,12 +9,9 @@
9
9
  <div class="component-content">
10
10
  <nav>
11
11
  <ul class="clearfix">
12
- <app-navigation-item
13
- *ngFor="let navItemFields of rendering.fields"
14
- [navItemFields]="navItemFields"
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>
@@ -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
- constructor(private jssContext: JssContextService) {
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() {
@@ -1,4 +1,5 @@
1
- import { Component, OnDestroy, OnInit } from '@angular/core';
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
- <ng-container *ngIf="rendering.fields; else empty">
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
- </ng-container>
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",