create-sitecore-jss 22.2.0-canary.81 → 22.2.0-canary.83

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 (362) hide show
  1. package/dist/bin.js +19 -35
  2. package/dist/common/index.js +3 -5
  3. package/dist/common/processes/install.js +2 -9
  4. package/dist/common/processes/next.js +3 -6
  5. package/dist/common/processes/transform.js +13 -18
  6. package/dist/common/prompts/base.js +25 -0
  7. package/dist/common/utils/helpers.js +19 -29
  8. package/dist/init-runner.js +11 -16
  9. package/dist/initializers/angular/index.js +0 -13
  10. package/dist/initializers/angular/prompts.js +1 -22
  11. package/dist/initializers/nextjs/index.js +2 -2
  12. package/dist/initializers/nextjs/prompts.js +0 -2
  13. package/dist/initializers/nextjs/remove-dev-dependencies.js +2 -2
  14. package/dist/initializers/nextjs-multisite/index.js +1 -1
  15. package/dist/initializers/nextjs-styleguide/index.js +1 -1
  16. package/dist/initializers/nextjs-styleguide-tracking/index.js +1 -1
  17. package/dist/initializers/nextjs-sxa/index.js +1 -1
  18. package/dist/initializers/nextjs-xmcloud/index.js +1 -1
  19. package/dist/initializers/react/index.js +3 -3
  20. package/dist/initializers/react/prompts.js +1 -1
  21. package/dist/initializers/react-native/prompts.js +0 -1
  22. package/dist/initializers/vue/prompts.js +1 -1
  23. package/dist/templates/angular/.env +3 -4
  24. package/dist/templates/angular/.eslintrc +0 -1
  25. package/dist/templates/angular/README.md +45 -5
  26. package/dist/templates/angular/angular.json +6 -1
  27. package/dist/templates/angular/gitignore +0 -5
  28. package/dist/templates/angular/package.json +18 -6
  29. package/dist/templates/angular/proxy.conf.js +23 -5
  30. package/dist/templates/angular/scripts/bootstrap.ts +24 -5
  31. package/dist/templates/angular/scripts/generate-component-factory.ts +166 -0
  32. package/dist/templates/angular/scripts/generate-config.ts +72 -71
  33. package/dist/templates/angular/scripts/update-graphql-fragment-data.ts +28 -21
  34. package/dist/templates/angular/server.bundle.ts +5 -3
  35. package/dist/templates/angular/src/app/JssState.ts +9 -2
  36. package/dist/templates/angular/src/app/app.module.ts +6 -5
  37. package/dist/templates/angular/src/app/app.server.module.ts +6 -9
  38. package/dist/templates/angular/src/app/components/app-components.shared.module.ts +19 -4
  39. package/dist/templates/angular/src/app/components/gitignore +1 -1
  40. package/dist/templates/{angular-sxp → angular}/src/app/components/graph-ql-layout/graph-ql-layout.component.ts +1 -1
  41. package/dist/templates/angular/src/app/i18n/jss-translation-client-loader.service.ts +7 -15
  42. package/dist/templates/angular/src/app/i18n/jss-translation-server-loader.service.ts +2 -14
  43. package/dist/templates/angular/src/app/jss-context.server-side.service.ts +4 -4
  44. package/dist/templates/angular/src/app/jss-context.service.ts +11 -14
  45. package/dist/templates/{angular-sxp → angular}/src/app/jss-data-fetcher.service.ts +1 -3
  46. package/dist/templates/angular/src/app/jss-graphql.service.ts +7 -7
  47. package/dist/templates/angular/src/app/layout/jss-layout.service.ts +2 -2
  48. package/dist/templates/angular/src/app/lib/client-factory.ts +28 -0
  49. package/dist/templates/angular/src/app/lib/dictionary-service-factory.ts +13 -24
  50. package/dist/templates/angular/src/app/lib/layout-service-factory.ts +12 -20
  51. package/dist/templates/angular/src/app/routing/layout/layout.component.html +1 -1
  52. package/dist/templates/angular/src/app/routing/layout/layout.component.ts +11 -11
  53. package/dist/templates/angular/src/app/routing/navigation/navigation.component.html +6 -5
  54. package/dist/templates/angular/src/app/routing/navigation/navigation.component.ts +2 -1
  55. package/dist/templates/angular/src/app/routing/routing.module.ts +21 -14
  56. package/dist/templates/{angular-sxp/src/app/routing/scripts → angular/src/app/routing}/visitor-identification/visitor-identification.component.ts +3 -9
  57. package/dist/templates/angular/src/environments/gitignore +1 -2
  58. package/dist/templates/angular/src/graphql-fragment-types.ts +95 -0
  59. package/dist/templates/angular/tsconfig.json +2 -7
  60. package/dist/templates/nextjs/scripts/config/plugins/fallback.ts +1 -0
  61. package/dist/templates/nextjs/scripts/generate-config.ts +1 -8
  62. package/dist/templates/nextjs-styleguide/scripts/config/plugins/disconnected.ts +0 -1
  63. package/dist/templates/nextjs-sxa/src/assets/sass/components/common/_alignment.scss +7 -34
  64. package/dist/templates/node-headless-ssr-proxy/src/config.ts +3 -3
  65. package/dist/templates/node-headless-ssr-proxy/src/httpAgents.ts +2 -2
  66. package/dist/templates/node-headless-ssr-proxy/src/index.ts +2 -9
  67. package/dist/templates/react/scripts/generate-config.js +3 -10
  68. package/dist/templates/vue/scripts/generate-config.js +0 -5
  69. package/package.json +2 -2
  70. package/dist/common/prompts/proxy.js +0 -35
  71. package/dist/common/prompts/sxp.js +0 -34
  72. package/dist/initializers/angular-sxp/index.js +0 -62
  73. package/dist/initializers/angular-xmcloud/index.js +0 -80
  74. package/dist/initializers/node-xmcloud-proxy/index.js +0 -33
  75. package/dist/templates/angular/scripts/config/index.ts +0 -28
  76. package/dist/templates/angular/scripts/config/plugins/computed.ts +0 -21
  77. package/dist/templates/angular/scripts/config/plugins/fallback.ts +0 -22
  78. package/dist/templates/angular/scripts/config/plugins/package-json.ts +0 -22
  79. package/dist/templates/angular/scripts/config/plugins/scjssconfig.ts +0 -29
  80. package/dist/templates/angular/scripts/generate-component-factory/index.ts +0 -45
  81. package/dist/templates/angular/scripts/generate-component-factory/plugins/component-factory.ts +0 -147
  82. package/dist/templates/angular/scripts/generate-component-factory/plugins/components.ts +0 -19
  83. package/dist/templates/angular/scripts/generate-component-factory/plugins/packages.ts +0 -29
  84. package/dist/templates/angular/scripts/generate-component-factory/template.ts +0 -46
  85. package/dist/templates/angular/scripts/generate-plugins.ts +0 -33
  86. package/dist/templates/angular/scripts/temp/gitignore +0 -2
  87. package/dist/templates/angular/server.exports.ts +0 -13
  88. package/dist/templates/angular/src/app/lib/config.ts +0 -16
  89. package/dist/templates/angular/src/app/lib/graphql-client-factory/config.ts +0 -21
  90. package/dist/templates/angular/src/app/lib/graphql-client-factory/index.ts +0 -16
  91. package/dist/templates/angular/src/app/routing/scripts/scripts.component.html +0 -1
  92. package/dist/templates/angular/src/app/routing/scripts/scripts.component.ts +0 -7
  93. package/dist/templates/angular/src/app/routing/scripts/scripts.module.ts +0 -8
  94. package/dist/templates/angular-sxp/.env +0 -2
  95. package/dist/templates/angular-sxp/package.json +0 -12
  96. package/dist/templates/angular-sxp/proxy.conf.js +0 -43
  97. package/dist/templates/angular-sxp/scripts/config/plugins/disconnected.ts +0 -29
  98. package/dist/templates/angular-sxp/src/app/components/app-components.shared.module.ts +0 -35
  99. package/dist/templates/angular-sxp/src/app/routing/navigation/navigation.component.html +0 -23
  100. package/dist/templates/angular-sxp/src/app/routing/scripts/scripts.component.html +0 -3
  101. package/dist/templates/angular-sxp/src/app/routing/scripts/scripts.module.ts +0 -9
  102. package/dist/templates/angular-sxp/src/graphql-fragment-types.ts +0 -219
  103. package/dist/templates/angular-xmcloud/.env +0 -21
  104. package/dist/templates/angular-xmcloud/angular.json +0 -33
  105. package/dist/templates/angular-xmcloud/package.json +0 -17
  106. package/dist/templates/angular-xmcloud/scripts/bootstrap.ts +0 -28
  107. package/dist/templates/angular-xmcloud/scripts/config/plugins/xmcloud.ts +0 -39
  108. package/dist/templates/angular-xmcloud/scripts/generate-component-factory/plugins/packages.ts +0 -34
  109. package/dist/templates/angular-xmcloud/scripts/generate-component-factory/template.ts +0 -57
  110. package/dist/templates/angular-xmcloud/scripts/generate-metadata.ts +0 -25
  111. package/dist/templates/angular-xmcloud/scripts/proxy-build.ts +0 -15
  112. package/dist/templates/angular-xmcloud/server.exports.ts +0 -24
  113. package/dist/templates/angular-xmcloud/src/app/components/app-components.shared.module.ts +0 -21
  114. package/dist/templates/angular-xmcloud/src/app/components/column-splitter/column-splitter.component.html +0 -5
  115. package/dist/templates/angular-xmcloud/src/app/components/column-splitter/column-splitter.component.ts +0 -40
  116. package/dist/templates/angular-xmcloud/src/app/components/container/container.component.html +0 -14
  117. package/dist/templates/angular-xmcloud/src/app/components/container/container.component.ts +0 -30
  118. package/dist/templates/angular-xmcloud/src/app/components/image/image.component.html +0 -36
  119. package/dist/templates/angular-xmcloud/src/app/components/image/image.component.ts +0 -67
  120. package/dist/templates/angular-xmcloud/src/app/components/link-list/link-list.component.html +0 -15
  121. package/dist/templates/angular-xmcloud/src/app/components/link-list/link-list.component.ts +0 -41
  122. package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation-item.component.html +0 -23
  123. package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation-item.component.ts +0 -65
  124. package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation.component.html +0 -21
  125. package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation.component.ts +0 -49
  126. package/dist/templates/angular-xmcloud/src/app/components/page-content/page-content.component.html +0 -5
  127. package/dist/templates/angular-xmcloud/src/app/components/page-content/page-content.component.ts +0 -39
  128. package/dist/templates/angular-xmcloud/src/app/components/partial-design-dynamic-placeholder/partial-design-dynamic-placeholder.component.html +0 -1
  129. package/dist/templates/angular-xmcloud/src/app/components/partial-design-dynamic-placeholder/partial-design-dynamic-placeholder.component.ts +0 -15
  130. package/dist/templates/angular-xmcloud/src/app/components/promo/promo.component.html +0 -21
  131. package/dist/templates/angular-xmcloud/src/app/components/promo/promo.component.ts +0 -13
  132. package/dist/templates/angular-xmcloud/src/app/components/richtext/richtext.component.html +0 -8
  133. package/dist/templates/angular-xmcloud/src/app/components/richtext/richtext.component.ts +0 -21
  134. package/dist/templates/angular-xmcloud/src/app/components/row-splitter/row-splitter.component.html +0 -11
  135. package/dist/templates/angular-xmcloud/src/app/components/row-splitter/row-splitter.component.ts +0 -35
  136. package/dist/templates/angular-xmcloud/src/app/components/sxa.component.ts +0 -15
  137. package/dist/templates/angular-xmcloud/src/app/components/title/title.component.html +0 -10
  138. package/dist/templates/angular-xmcloud/src/app/components/title/title.component.ts +0 -56
  139. package/dist/templates/angular-xmcloud/src/app/jss-link.service.ts +0 -55
  140. package/dist/templates/angular-xmcloud/src/app/lib/config.ts +0 -17
  141. package/dist/templates/angular-xmcloud/src/app/lib/graphql-client-factory/config.ts +0 -58
  142. package/dist/templates/angular-xmcloud/src/app/routing/layout/layout.component.html +0 -38
  143. package/dist/templates/angular-xmcloud/src/app/routing/layout/layout.component.ts +0 -104
  144. package/dist/templates/angular-xmcloud/src/app/routing/scripts/cdp-page-view.component.ts +0 -77
  145. package/dist/templates/angular-xmcloud/src/app/routing/scripts/cloud-sdk-init.component.ts +0 -48
  146. package/dist/templates/angular-xmcloud/src/app/routing/scripts/scripts.component.html +0 -5
  147. package/dist/templates/angular-xmcloud/src/app/routing/scripts/scripts.module.ts +0 -12
  148. package/dist/templates/angular-xmcloud/src/assets/styles/basic/_component.scss +0 -48
  149. package/dist/templates/angular-xmcloud/src/assets/styles/basic/_container.scss +0 -64
  150. package/dist/templates/angular-xmcloud/src/assets/styles/basic/_fonts.scss +0 -3
  151. package/dist/templates/angular-xmcloud/src/assets/styles/basic/_footer.scss +0 -31
  152. package/dist/templates/angular-xmcloud/src/assets/styles/basic/_header.scss +0 -51
  153. package/dist/templates/angular-xmcloud/src/assets/styles/basic/_navigation.scss +0 -150
  154. package/dist/templates/angular-xmcloud/src/assets/styles/basic/_promo.scss +0 -58
  155. package/dist/templates/angular-xmcloud/src/assets/styles/basic/_rich-text.scss +0 -11
  156. package/dist/templates/angular-xmcloud/src/assets/styles/basic/_variables.scss +0 -10
  157. package/dist/templates/angular-xmcloud/src/assets/styles/basic/main.scss +0 -8
  158. package/dist/templates/angular-xmcloud/src/assets/styles/main.scss +0 -14
  159. package/dist/templates/angular-xmcloud/src/assets/styles/sass/_app.scss +0 -103
  160. package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/_functions.scss +0 -8
  161. package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/_mixins.scss +0 -121
  162. package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/_vars.scss +0 -3
  163. package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/vars/_colors.scss +0 -283
  164. package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/vars/_fontSizes.scss +0 -16
  165. package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/vars/_margins.scss +0 -11
  166. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/fonts/_fonts.scss +0 -1
  167. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/fonts/index.scss +0 -1
  168. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/index.scss +0 -3
  169. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/links/_link-button.scss +0 -26
  170. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/links/index.scss +0 -1
  171. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/reset/_inputs.scss +0 -58
  172. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/reset/_links.scss +0 -14
  173. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/reset/_ui-datepicker.scss +0 -7
  174. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/richtext/_richtext-files-icons.scss +0 -86
  175. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/richtext/_richtext.scss +0 -101
  176. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/richtext/index.scss +0 -2
  177. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/typehead/_typehead.scss +0 -95
  178. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/typehead/index.scss +0 -1
  179. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-column-splitter.scss +0 -14
  180. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-container.scss +0 -27
  181. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-image.scss +0 -18
  182. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-navigation.scss +0 -51
  183. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-promo.scss +0 -42
  184. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-richtext-content.scss +0 -19
  185. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_alignment.scss +0 -26
  186. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_boxed.scss +0 -16
  187. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_clearfix.scss +0 -11
  188. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_highlighted.scss +0 -63
  189. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_link-button.scss +0 -16
  190. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_promoted-box.scss +0 -3
  191. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/index.scss +0 -6
  192. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/container/_bordered.scss +0 -24
  193. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/container/_title-row-box.scss +0 -66
  194. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/container/index.scss +0 -1
  195. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image/_image-default-size.scss +0 -6
  196. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image/index.scss +0 -1
  197. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image-alignment/_image-left.scss +0 -3
  198. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image-alignment/_image-right.scss +0 -3
  199. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/index.scss +0 -17
  200. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/layout/_acaindent.scss +0 -5
  201. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/layout/_background.scss +0 -27
  202. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/layout/index.scss +0 -1
  203. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/link-list/_component-link-list.scss +0 -45
  204. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/link-list/_list-vertical.scss +0 -20
  205. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/link-list/index.scss +0 -2
  206. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-fat.scss +0 -58
  207. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-main-horizontal-vertical.scss +0 -176
  208. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-mobile.scss +0 -85
  209. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-sidebar.scss +0 -29
  210. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_sitemap-navigation.scss +0 -20
  211. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/index.scss +0 -5
  212. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/_absolute-bottom-link.scss +0 -8
  213. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/_promo-hero.scss +0 -40
  214. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/_promo-shadow.scss +0 -42
  215. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/index.scss +0 -3
  216. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/rich-text/_rich-text-lists.scss +0 -63
  217. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/rich-text/index.scss +0 -1
  218. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/spacing/_background-colors.scss +0 -14
  219. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/spacing/_indent.scss +0 -13
  220. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/spacing/index.scss +0 -2
  221. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/title/_component-title.scss +0 -30
  222. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/title/index.scss +0 -1
  223. package/dist/templates/angular-xmcloud/src/assets/styles/sass/main.scss +0 -4
  224. package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/index.scss +0 -6
  225. package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/link-list/index.scss +0 -0
  226. package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/navigation/index.scss +0 -0
  227. package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/page-content/index.scss +0 -0
  228. package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/promo/index.scss +0 -0
  229. package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/rich-text/index.scss +0 -0
  230. package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/title/index.scss +0 -0
  231. package/dist/templates/node-headless-ssr-experience-edge/gitignore +0 -19
  232. package/dist/templates/node-headless-ssr-proxy/gitignore +0 -19
  233. package/dist/templates/node-xmcloud-proxy/.env +0 -14
  234. package/dist/templates/node-xmcloud-proxy/README.md +0 -36
  235. package/dist/templates/node-xmcloud-proxy/gitignore +0 -33
  236. package/dist/templates/node-xmcloud-proxy/package.json +0 -26
  237. package/dist/templates/node-xmcloud-proxy/src/config.ts +0 -25
  238. package/dist/templates/node-xmcloud-proxy/src/index.ts +0 -210
  239. package/dist/templates/node-xmcloud-proxy/src/types.ts +0 -27
  240. package/dist/templates/node-xmcloud-proxy/tsconfig.json +0 -22
  241. /package/dist/templates/{angular-sxp → angular}/data/component-content/Styleguide/ContentReuse/LoremIpsumContentBlock/en.yml +0 -0
  242. /package/dist/templates/{angular-sxp → angular}/data/component-content/gitignore +0 -0
  243. /package/dist/templates/{angular-sxp → angular}/data/content/Styleguide/ContentListField/Item1/en.yml +0 -0
  244. /package/dist/templates/{angular-sxp → angular}/data/content/Styleguide/ContentListField/Item2/en.yml +0 -0
  245. /package/dist/templates/{angular-sxp → angular}/data/content/Styleguide/EditFrameDemo/Item1/en.yml +0 -0
  246. /package/dist/templates/{angular-sxp → angular}/data/content/Styleguide/EditFrameDemo/Item2/en.yml +0 -0
  247. /package/dist/templates/{angular-sxp → angular}/data/content/Styleguide/ItemLinkField/Item1/en.yml +0 -0
  248. /package/dist/templates/{angular-sxp → angular}/data/content/Styleguide/ItemLinkField/Item2/en.yml +0 -0
  249. /package/dist/templates/{angular-sxp → angular}/data/content/gitignore +0 -0
  250. /package/dist/templates/{angular-sxp → angular}/data/dictionary/en.yml +0 -0
  251. /package/dist/templates/{angular-sxp → angular}/data/dictionary/{{language}}.yml +0 -0
  252. /package/dist/templates/{angular-sxp → angular}/data/media/files/jss.pdf +0 -0
  253. /package/dist/templates/{angular-sxp → angular}/data/media/img/jss_logo.png +0 -0
  254. /package/dist/templates/{angular-sxp → angular}/data/media/img/sc_logo.png +0 -0
  255. /package/dist/templates/{angular-sxp → angular}/data/routes/en.yml +0 -0
  256. /package/dist/templates/{angular-sxp → angular}/data/routes/graphql/en.yml +0 -0
  257. /package/dist/templates/{angular-sxp → angular}/data/routes/graphql/sample-1/en.yml +0 -0
  258. /package/dist/templates/{angular-sxp → angular}/data/routes/graphql/sample-2/en.yml +0 -0
  259. /package/dist/templates/{angular-sxp → angular}/data/routes/styleguide/custom-route-type/en.yml +0 -0
  260. /package/dist/templates/{angular-sxp → angular}/data/routes/styleguide/en.yml +0 -0
  261. /package/dist/templates/{angular-sxp → angular}/data/routes/styleguide/{{language}}.yml +0 -0
  262. /package/dist/templates/{angular-sxp → angular}/data/routes/{{language}}.yml +0 -0
  263. /package/dist/templates/{angular-sxp → angular}/scripts/disconnected-mode-proxy.ts +0 -0
  264. /package/dist/templates/{angular-sxp → angular}/scripts/lint-yml.ts +0 -0
  265. /package/dist/templates/{angular-sxp → angular}/sitecore/config/{{appName}}.config +0 -0
  266. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/component-content.sitecore.ts +0 -0
  267. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/Styleguide-Layout-Reuse.sitecore.ts +0 -0
  268. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/Styleguide-Layout-Tabs-Tab.sitecore.ts +0 -0
  269. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/Styleguide-Layout-Tabs.sitecore.ts +0 -0
  270. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/Styleguide-Layout.sitecore.ts +0 -0
  271. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/Styleguide-Multilingual.sitecore.ts +0 -0
  272. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/Styleguide-Section.sitecore.ts +0 -0
  273. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/content-block.sitecore.ts +0 -0
  274. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/graph-ql-connected-demo.sitecore.ts +0 -0
  275. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/graph-ql-integrated-demo.sitecore.graphql +0 -0
  276. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/graph-ql-integrated-demo.sitecore.ts +0 -0
  277. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/graph-ql-layout.sitecore.ts +0 -0
  278. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-angular-lazy-loading.sitecore.ts +0 -0
  279. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-component-params.sitecore.ts +0 -0
  280. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-custom-route-type.sitecore.ts +0 -0
  281. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-edit-frame.sitecore.ts +0 -0
  282. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-field-usage-checkbox.sitecore.ts +0 -0
  283. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-field-usage-content-list.sitecore.ts +0 -0
  284. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-field-usage-custom.sitecore.ts +0 -0
  285. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-field-usage-date.sitecore.ts +0 -0
  286. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-field-usage-file.sitecore.ts +0 -0
  287. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-field-usage-image.sitecore.ts +0 -0
  288. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-field-usage-item-link.sitecore.ts +0 -0
  289. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-field-usage-link.sitecore.ts +0 -0
  290. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-field-usage-number.sitecore.ts +0 -0
  291. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-field-usage-rich-text.sitecore.ts +0 -0
  292. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-field-usage-text.sitecore.ts +0 -0
  293. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-route-fields.sitecore.ts +0 -0
  294. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-sitecore-context.sitecore.ts +0 -0
  295. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/components/styleguide-tracking.sitecore.ts +0 -0
  296. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/config.js +0 -0
  297. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/content.sitecore.ts +0 -0
  298. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/dictionary.sitecore.ts +0 -0
  299. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/placeholders.sitecore.ts +0 -0
  300. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/routes.sitecore.ts +0 -0
  301. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/templates/Styleguide-Explanatory-Component.sitecore.ts +0 -0
  302. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/templates/styleguide-content-list-template.sitecore.ts +0 -0
  303. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/templates/styleguide-edit-frame-list-item-template.sitecore.ts +0 -0
  304. /package/dist/templates/{angular-sxp → angular}/sitecore/definitions/templates/styleguide-item-link-template.sitecore.ts +0 -0
  305. /package/dist/templates/{angular-sxp → angular}/sitecore/gitignore +0 -0
  306. /package/dist/templates/{angular-sxp → angular}/sitecore/pipelines/example.patch.ts +0 -0
  307. /package/dist/templates/{angular-sxp → angular}/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.graphql +0 -0
  308. /package/dist/templates/{angular-sxp → angular}/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.html +0 -0
  309. /package/dist/templates/{angular-sxp → angular}/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.ts +0 -0
  310. /package/dist/templates/{angular-sxp → angular}/src/app/components/graph-ql-integrated-demo/graph-ql-integrated-demo.component.html +0 -0
  311. /package/dist/templates/{angular-sxp → angular}/src/app/components/graph-ql-integrated-demo/graph-ql-integrated-demo.component.ts +0 -0
  312. /package/dist/templates/{angular-sxp → angular}/src/app/components/graph-ql-layout/graph-ql-layout.component.html +0 -0
  313. /package/dist/templates/{angular-sxp → angular}/src/app/components/shared/styleguide-specimen/styleguide-specimen.component.ts +0 -0
  314. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-angular-lazy-loading/styleguide-angular-lazy-loading.component.html +0 -0
  315. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-angular-lazy-loading/styleguide-angular-lazy-loading.component.ts +0 -0
  316. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-angular-lazy-loading/styleguide-angular-lazy-loading.module.ts +0 -0
  317. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-component-params/styleguide-component-params.component.html +0 -0
  318. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-component-params/styleguide-component-params.component.ts +0 -0
  319. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-custom-route-type/styleguide-custom-route-type.component.html +0 -0
  320. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-custom-route-type/styleguide-custom-route-type.component.ts +0 -0
  321. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-edit-frame/styleguide-edit-frame.component.html +0 -0
  322. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-edit-frame/styleguide-edit-frame.component.ts +0 -0
  323. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-checkbox/styleguide-field-usage-checkbox.component.html +0 -0
  324. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-checkbox/styleguide-field-usage-checkbox.component.ts +0 -0
  325. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-content-list/styleguide-field-usage-content-list.component.html +0 -0
  326. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-content-list/styleguide-field-usage-content-list.component.ts +0 -0
  327. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-custom/styleguide-field-usage-custom.component.html +0 -0
  328. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-custom/styleguide-field-usage-custom.component.ts +0 -0
  329. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-date/styleguide-field-usage-date.component.html +0 -0
  330. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-date/styleguide-field-usage-date.component.ts +0 -0
  331. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-file/styleguide-field-usage-file.component.html +0 -0
  332. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-file/styleguide-field-usage-file.component.ts +0 -0
  333. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-image/styleguide-field-usage-image.component.html +0 -0
  334. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-image/styleguide-field-usage-image.component.ts +0 -0
  335. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-item-link/styleguide-field-usage-item-link.component.html +0 -0
  336. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-item-link/styleguide-field-usage-item-link.component.ts +0 -0
  337. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-link/styleguide-field-usage-link.component.html +0 -0
  338. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-link/styleguide-field-usage-link.component.ts +0 -0
  339. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-number/styleguide-field-usage-number.component.html +0 -0
  340. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-number/styleguide-field-usage-number.component.ts +0 -0
  341. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-rich-text/styleguide-field-usage-rich-text.component.html +0 -0
  342. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-rich-text/styleguide-field-usage-rich-text.component.ts +0 -0
  343. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-text/styleguide-field-usage-text.component.html +0 -0
  344. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-field-usage-text/styleguide-field-usage-text.component.ts +0 -0
  345. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-layout/styleguide-layout.component.html +0 -0
  346. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-layout/styleguide-layout.component.ts +0 -0
  347. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-layout-reuse/styleguide-layout-reuse.component.html +0 -0
  348. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-layout-reuse/styleguide-layout-reuse.component.ts +0 -0
  349. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-layout-tabs/styleguide-layout-tabs.component.html +0 -0
  350. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-layout-tabs/styleguide-layout-tabs.component.ts +0 -0
  351. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-layout-tabs-tab/styleguide-layout-tabs-tab.component.html +0 -0
  352. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-layout-tabs-tab/styleguide-layout-tabs-tab.component.ts +0 -0
  353. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-multilingual/styleguide-multilingual.component.html +0 -0
  354. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-multilingual/styleguide-multilingual.component.ts +0 -0
  355. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-route-fields/styleguide-route-fields.component.html +0 -0
  356. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-route-fields/styleguide-route-fields.component.ts +0 -0
  357. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-section/styleguide-section.component.html +0 -0
  358. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-section/styleguide-section.component.ts +0 -0
  359. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-sitecore-context/styleguide-sitecore-context.component.html +0 -0
  360. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-sitecore-context/styleguide-sitecore-context.component.ts +0 -0
  361. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-tracking/styleguide-tracking.component.html +0 -0
  362. /package/dist/templates/{angular-sxp → angular}/src/app/components/styleguide-tracking/styleguide-tracking.component.ts +0 -0
@@ -1,10 +0,0 @@
1
- <div clas="component-content">
2
- <div class="field-title">
3
- <ng-container *ngIf="!pageEditing; else textOnly">
4
- <a *scGenericLink="link"></a>
5
- </ng-container>
6
- </div>
7
- </div>
8
- <ng-template #textOnly>
9
- <span *scText="text"></span>
10
- </ng-template>
@@ -1,56 +0,0 @@
1
- import { Component, OnDestroy, OnInit } from '@angular/core';
2
- import { LinkField, SxaTitleFields, TextField } from '@sitecore-jss/sitecore-jss-angular';
3
- import { SxaComponent } from '../sxa.component';
4
- import { Subscription } from 'rxjs';
5
- import { JssContextService } from '../../jss-context.service';
6
-
7
- @Component({
8
- selector: 'app-title',
9
- templateUrl: './title.component.html',
10
- host: {
11
- 'class': 'component title',
12
- '[class]': 'styles',
13
- '[id]': 'id',
14
- }
15
- })
16
- export class TitleComponent extends SxaComponent<SxaTitleFields> implements OnInit, OnDestroy {
17
- text: TextField;
18
- link: LinkField;
19
- pageEditing?: boolean;
20
-
21
- private contextSubscription: Subscription;
22
-
23
- constructor(private jssContext: JssContextService) {
24
- super();
25
- }
26
-
27
- ngOnInit() {
28
- super.ngOnInit();
29
- const datasource =
30
- this.rendering.fields?.data?.datasource || this.rendering.fields?.data?.contextItem;
31
- this.text = datasource.field?.jsonValue;
32
- this.link = {
33
- value: {
34
- href: datasource?.url?.path,
35
- title: datasource?.field?.jsonValue?.value,
36
- text: datasource?.field?.jsonValue?.value,
37
- },
38
- };
39
- this.contextSubscription = this.jssContext.state.subscribe(({ sitecore }) => {
40
- this.pageEditing = sitecore.context.pageEditing;
41
- if (sitecore.context.pageState !== 'normal') {
42
- this.link.value.querystring = `sc_site=${datasource?.url?.siteName}`;
43
- if (!this.text?.value) {
44
- this.text.value = 'Title field';
45
- this.link.value.href = '#';
46
- }
47
- }
48
- });
49
- }
50
-
51
- ngOnDestroy() {
52
- if (this.contextSubscription) {
53
- this.contextSubscription.unsubscribe();
54
- }
55
- }
56
- }
@@ -1,55 +0,0 @@
1
- import { Inject, Injectable } from '@angular/core';
2
- import { DOCUMENT } from '@angular/common';
3
- import { HTMLLink } from '@sitecore-jss/sitecore-jss-angular';
4
-
5
- @Injectable({
6
- providedIn: 'root',
7
- })
8
- export class JssLinkService {
9
- constructor(@Inject(DOCUMENT) private document: Document) {}
10
-
11
- /**
12
- * Adds link element in the document head.
13
- * @param headLinks - An array of HTMLLink objects to add to the head.
14
- */
15
- addHeadLinks(headLink: HTMLLink) {
16
- if (!headLink) {
17
- return;
18
- }
19
-
20
- // Check if a link with the same rel and href already exists
21
- if (this.isDuplicateLink(headLink)) {
22
- return;
23
- }
24
-
25
- this.createLink(headLink);
26
- }
27
-
28
- /**
29
- * Creates a new link element and appends it to the head.
30
- * @param headLink - An HTMLLink object to be added.
31
- */
32
- private createLink(headLink: HTMLLink) {
33
- if (!headLink.rel || !headLink.href) {
34
- console.log('Invalid link object:', headLink);
35
- return;
36
- }
37
-
38
- const link: HTMLLinkElement = this.document.createElement('link');
39
- link.setAttribute('rel', headLink.rel);
40
- link.setAttribute('href', headLink.href);
41
- this.document.head.appendChild(link);
42
- }
43
-
44
- /**
45
- * Checks for an existing link element with the same rel and href attributes.
46
- * @param headLink - An HTMLLink object to be checked.
47
- * @returns {boolean} - True if a matching link exists, false otherwise.
48
- */
49
- private isDuplicateLink(headLink: HTMLLink): boolean {
50
- const existingLink = this.document.head.querySelector(
51
- `link[rel='${headLink.rel}'][href='${headLink.href}']`
52
- );
53
- return !!existingLink;
54
- }
55
- }
@@ -1,17 +0,0 @@
1
- /*
2
- * Represents the type of config object available within the generated /environments/environment.js
3
- */
4
- export interface JssConfig extends Record<string, string | boolean | undefined> {
5
- production?: false;
6
- sitecoreApiKey?: string;
7
- sitecoreApiHost?: string;
8
- sitecoreSiteName?: string;
9
- defaultLanguage?: string;
10
- graphQLEndpoint?: string;
11
- graphQLEndpointPath?: string;
12
- defaultServerRoute?: string;
13
- proxyBuildPath?: string;
14
- proxyHost?: string;
15
- sitecoreEdgeUrl?: string;
16
- sitecoreEdgeContextId?: string;
17
- }
@@ -1,58 +0,0 @@
1
- import {
2
- GraphQLRequestClientFactoryConfig,
3
- getEdgeProxyContentUrl,
4
- } from '@sitecore-jss/sitecore-jss-angular/cjs';
5
- import { environment as env } from '../../../environments/environment';
6
-
7
- /**
8
- * Gets the configuration for the GraphQLRequestClientFactory
9
- * @returns GraphQLRequestClientFactoryConfig
10
- */
11
- export const getGraphQLClientFactoryConfig = () => {
12
- let clientConfig: GraphQLRequestClientFactoryConfig;
13
-
14
- // Server side requests should go directly to the Sitecore, browser requests should go through the proxy.
15
- const isServer = typeof window === 'undefined';
16
- // If we are in a production environment we are going to use Node XM Cloud proxy
17
- const isProduction = env.production === 'true';
18
-
19
- if (isProduction) {
20
- if (!env.proxyHost) {
21
- throw new Error('Please configure your proxyHost.');
22
- }
23
-
24
- if (env.sitecoreEdgeContextId) {
25
- clientConfig = {
26
- endpoint: isServer
27
- ? getEdgeProxyContentUrl(env.sitecoreEdgeContextId, env.sitecoreEdgeUrl)
28
- : getEdgeProxyContentUrl(env.sitecoreEdgeContextId, env.proxyHost),
29
- };
30
- } else if (env.graphQLEndpoint && env.sitecoreApiKey) {
31
- const graphQLEndpointPath = new URL(env.graphQLEndpoint).pathname;
32
-
33
- clientConfig = {
34
- endpoint: isServer ? env.graphQLEndpoint : `${env.proxyHost}${graphQLEndpointPath}`,
35
- apiKey: env.sitecoreApiKey,
36
- };
37
- }
38
- } else {
39
- if (env.sitecoreEdgeContextId) {
40
- clientConfig = {
41
- endpoint: getEdgeProxyContentUrl(env.sitecoreEdgeContextId, env.sitecoreEdgeUrl),
42
- };
43
- } else if (env.graphQLEndpoint && env.sitecoreApiKey) {
44
- clientConfig = {
45
- endpoint: env.graphQLEndpoint,
46
- apiKey: env.sitecoreApiKey,
47
- };
48
- }
49
- }
50
-
51
- if (!clientConfig?.endpoint) {
52
- throw new Error(
53
- 'Please configure either your sitecoreEdgeContextId, or your graphQLEndpoint and sitecoreApiKey.'
54
- );
55
- }
56
-
57
- return clientConfig;
58
- };
@@ -1,38 +0,0 @@
1
- <div class="{{ mainClassPageEditing }}">
2
- <ng-container *ngIf="state === LayoutState.Layout">
3
- <app-scripts></app-scripts>
4
- <header>
5
- <div id="header">
6
- <sc-placeholder
7
- name="headless-header"
8
- [rendering]="route"
9
- (loaded)="onPlaceholderLoaded($event)"
10
- ></sc-placeholder>
11
- </div>
12
- </header>
13
- <main>
14
- <div id="content">
15
- <sc-placeholder
16
- name="headless-main"
17
- [rendering]="route"
18
- (loaded)="onPlaceholderLoaded($event)"
19
- ></sc-placeholder>
20
- </div>
21
- </main>
22
- <footer>
23
- <div id="footer">
24
- <sc-placeholder
25
- name="headless-footer"
26
- [rendering]="route"
27
- (loaded)="onPlaceholderLoaded($event)"
28
- ></sc-placeholder>
29
- </div>
30
- </footer>
31
- </ng-container>
32
-
33
- <app-not-found
34
- *ngIf="state === LayoutState.NotFound"
35
- [errorContextData]="errorContextData"
36
- ></app-not-found>
37
- <app-server-error *ngIf="state === LayoutState.Error"></app-server-error>
38
- </div>
@@ -1,104 +0,0 @@
1
- /* eslint-disable no-shadow, no-console */
2
- import { Component, OnInit, OnDestroy } from '@angular/core';
3
- import {
4
- RouteData,
5
- Field,
6
- LayoutServiceContextData,
7
- getContentStylesheetLink,
8
- } from '@sitecore-jss/sitecore-jss-angular';
9
- import { ActivatedRoute } from '@angular/router';
10
- import { Subscription } from 'rxjs';
11
- import { JssState } from '../../JssState';
12
- import { JssMetaService } from '../../jss-meta.service';
13
- import { JssLinkService } from '../../jss-link.service';
14
- import { environment as env } from '../../../environments/environment';
15
-
16
- enum LayoutState {
17
- Layout,
18
- NotFound,
19
- Error,
20
- }
21
-
22
- interface RouteFields {
23
- [name: string]: unknown;
24
- pageTitle?: Field<string>;
25
- }
26
-
27
- @Component({
28
- selector: 'app-layout',
29
- templateUrl: './layout.component.html',
30
- })
31
- export class LayoutComponent implements OnInit, OnDestroy {
32
- route: RouteData<RouteFields>;
33
- state: LayoutState;
34
- LayoutState = LayoutState;
35
- subscription: Subscription;
36
- errorContextData: LayoutServiceContextData;
37
- mainClassPageEditing: string;
38
-
39
- constructor(
40
- private activatedRoute: ActivatedRoute,
41
- private readonly meta: JssMetaService,
42
- private linkService: JssLinkService
43
- ) {}
44
-
45
- ngOnInit() {
46
- // route data is populated by the JssRouteResolver
47
- this.subscription = this.activatedRoute.data.subscribe((data: { jssState: JssState }) => {
48
- if (!data.jssState) {
49
- this.state = LayoutState.NotFound;
50
- return;
51
- }
52
-
53
- if (data.jssState.sitecore && data.jssState.sitecore.route) {
54
- this.route = data.jssState.sitecore.route;
55
- this.setMetadata(this.route.fields);
56
- this.state = LayoutState.Layout;
57
- this.mainClassPageEditing = data.jssState.sitecore.context.pageEditing
58
- ? 'editing-mode'
59
- : 'prod-mode';
60
-
61
- const contentStyles = getContentStylesheetLink(
62
- { sitecore: data.jssState.sitecore },
63
- env.sitecoreEdgeContextId,
64
- env.sitecoreEdgeUrl
65
- );
66
-
67
- if (contentStyles) {
68
- this.linkService.addHeadLinks(contentStyles);
69
- }
70
- }
71
-
72
- if (data.jssState.routeFetchError) {
73
- if (
74
- data.jssState.routeFetchError.status >= 400 &&
75
- data.jssState.routeFetchError.status < 500
76
- ) {
77
- this.state = LayoutState.NotFound;
78
- } else {
79
- this.state = LayoutState.Error;
80
- }
81
-
82
- this.errorContextData =
83
- data.jssState.routeFetchError.data && data.jssState.routeFetchError.data.sitecore;
84
- }
85
- });
86
- }
87
-
88
- ngOnDestroy() {
89
- // important to unsubscribe when the component is destroyed
90
- this.subscription.unsubscribe();
91
- }
92
-
93
- setMetadata(routeFields: RouteFields) {
94
- // set page title, if it exists
95
- if (routeFields && routeFields.pageTitle) {
96
- this.meta.setTitle(routeFields.pageTitle.value || 'Page');
97
- }
98
- }
99
-
100
- onPlaceholderLoaded(_placeholderName: string) {
101
- // you may optionally hook to the loaded event for a placeholder,
102
- // which can be useful for analytics and other DOM-based things that need to know when a placeholder's content is available.
103
- }
104
- }
@@ -1,77 +0,0 @@
1
- import { Component, OnInit, OnDestroy } from '@angular/core';
2
- import { Subscription } from 'rxjs';
3
- import { isServer, CdpHelper, LayoutServicePageState } from '@sitecore-jss/sitecore-jss-angular';
4
- import { pageView, PageViewData } from '@sitecore-cloudsdk/events/browser';
5
- import { JssContextService } from '../../jss-context.service';
6
- import { JssState } from '../../JssState';
7
- import { environment } from '../../../environments/environment';
8
-
9
- /**
10
- * This is the CDP page view component.
11
- * It uses the Sitecore Cloud SDK to enable page view events on the client-side.
12
- * See Sitecore Cloud SDK documentation for details.
13
- * https://www.npmjs.com/package/@sitecore-cloudsdk/events
14
- */
15
- @Component({
16
- selector: 'app-cdp-page-view',
17
- template: '',
18
- })
19
- export class CdpPageViewComponent implements OnInit, OnDestroy {
20
- private contextSubscription: Subscription;
21
-
22
- constructor(private jssContext: JssContextService) {}
23
-
24
- ngOnInit(): void {
25
- if (!isServer()) {
26
- this.contextSubscription = this.jssContext.state.subscribe((newState: JssState) => {
27
- const {
28
- route,
29
- context: { pageState, language, variantId },
30
- } = newState.sitecore;
31
-
32
- // Do not create events in editing or preview mode or if missing route data
33
- if (pageState !== LayoutServicePageState.Normal || !route?.itemId) {
34
- return;
35
- }
36
-
37
- // Do not create events if disabled (e.g. we don't have consent)
38
- if (this.disabled()) {
39
- return;
40
- }
41
-
42
- const scope = process.env.PERSONALIZE_SCOPE;
43
- const pageVariantId = CdpHelper.getPageVariantId(
44
- route.itemId,
45
- language || environment.defaultLanguage,
46
- variantId as string,
47
- scope
48
- );
49
-
50
- const pageViewData: PageViewData = {
51
- channel: 'WEB',
52
- currency: 'USD',
53
- page: route.name,
54
- pageVariantId,
55
- language,
56
- };
57
-
58
- pageView(pageViewData).catch((err) => console.debug(err));
59
- });
60
- }
61
- }
62
-
63
- ngOnDestroy() {
64
- if (this.contextSubscription) {
65
- this.contextSubscription.unsubscribe();
66
- }
67
- }
68
-
69
- /**
70
- * Determines if the page view events should be turned off.
71
- * IMPORTANT: You should implement based on your cookie consent management solution of choice.
72
- * By default it is disabled if not in production mode
73
- */
74
- disabled = () => {
75
- return !environment.production;
76
- };
77
- }
@@ -1,48 +0,0 @@
1
- import { Component, OnInit } from '@angular/core';
2
- import { take } from 'rxjs/operators';
3
- import { CloudSDK } from '@sitecore-cloudsdk/core/browser';
4
- import '@sitecore-cloudsdk/events/browser';
5
- import { isServer, LayoutServicePageState } from '@sitecore-jss/sitecore-jss-angular';
6
- import { environment } from '../../../environments/environment';
7
- import { JssContextService } from '../../jss-context.service';
8
- import { JssState } from '../../JssState';
9
-
10
- /**
11
- * Component to init CloudSDK logic - to allow events throughout the site
12
- */
13
- @Component({
14
- selector: 'app-cloud-sdk-init',
15
- template: '',
16
- })
17
- export class CloudSdkInitComponent implements OnInit {
18
- constructor(private jssContext: JssContextService) {}
19
-
20
- ngOnInit(): void {
21
- if (!isServer() && environment.production) {
22
- // to ensure that CloudSDK initialization logic runs only once in the browser, take only the first emitted value of state
23
- this.jssContext.state.pipe(take(1)).subscribe((newState: JssState) => {
24
- const {
25
- route,
26
- context: { pageState },
27
- } = newState.sitecore;
28
-
29
- // Do not initialize CloudSDK in editing or preview mode or if missing route data
30
- if (pageState !== LayoutServicePageState.Normal || !route?.itemId) {
31
- return;
32
- }
33
-
34
- CloudSDK({
35
- siteName: environment.sitecoreSiteName,
36
- sitecoreEdgeUrl: environment.sitecoreEdgeUrl,
37
- sitecoreEdgeContextId: environment.sitecoreEdgeContextId,
38
- // Replace with the top level cookie domain of the website that is being integrated e.g ".example.com" and not "www.example.com"
39
- cookieDomain: window.location.hostname.replace(/^www\./, ''),
40
- // Cookie may be created in personalize middleware (server), but if not we should create it here
41
- enableBrowserCookie: true,
42
- })
43
- .addEvents()
44
- .initialize();
45
- });
46
- }
47
- }
48
- }
@@ -1,5 +0,0 @@
1
- <ng-container>
2
- <sc-editing-scripts></sc-editing-scripts>
3
- <app-cloud-sdk-init></app-cloud-sdk-init>
4
- <app-cdp-page-view></app-cdp-page-view>
5
- </ng-container>
@@ -1,12 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { ScriptsComponent } from './scripts.component';
3
- import { JssModule } from '@sitecore-jss/sitecore-jss-angular';
4
- import { CloudSdkInitComponent } from './cloud-sdk-init.component';
5
- import { CdpPageViewComponent } from './cdp-page-view.component';
6
-
7
- @NgModule({
8
- exports: [ScriptsComponent],
9
- imports: [JssModule],
10
- declarations: [ScriptsComponent, CloudSdkInitComponent, CdpPageViewComponent],
11
- })
12
- export class ScriptsModule {}
@@ -1,48 +0,0 @@
1
- .component-content {
2
- @include respond-to(mobile-large) {
3
- .row {
4
- padding: 0;
5
- margin: 0;
6
- }
7
- }
8
- }
9
- @include respond-to(mobile-large) {
10
- .row {
11
- margin: 0;
12
- padding: 0;
13
- > * {
14
- padding: 0;
15
- margin: 0;
16
- }
17
- }
18
- }
19
-
20
- .hero-banner {
21
- .component-content {
22
- background-position: center;
23
- background-repeat: no-repeat;
24
- background-size: cover;
25
- height: 800px;
26
-
27
- @include respond-to(mobile-large) {
28
- height: 300px;
29
- }
30
- }
31
- .sc-image-wrapper {
32
- opacity: 0;
33
- }
34
- &.scEnabledChrome {
35
- &.hero-banner-empty {
36
- .sc-image-wrapper {
37
- display: block;
38
- width: 100%;
39
-
40
- .scEmptyImage {
41
- max-height: 800px;
42
- max-width: 100%;
43
- width: 100%;
44
- }
45
- }
46
- }
47
- }
48
- }
@@ -1,64 +0,0 @@
1
- @import "sass/abstracts/mixins";
2
- @import "variables";
3
-
4
- body {
5
- font-family: Roboto;
6
- color: $main-color;
7
- }
8
-
9
-
10
- @media (min-width: 1400px) {
11
- .container {
12
- max-width: 1250px;
13
- }
14
- }
15
-
16
- main {
17
- .main-header {
18
- margin-top: 55px;
19
- margin-bottom: 30px;
20
-
21
- @include respond-to(mobile-large) {
22
- margin-bottom: 0;
23
- }
24
-
25
- h4 {
26
- font-size: $text-size-50;
27
- font-weight: 500;
28
- line-height: 70px;
29
- }
30
- }
31
-
32
- .main-news-header {
33
- margin-top: 60px;
34
-
35
- h2 {
36
- font-size: $text-size-36;
37
- line-height: 43px;
38
- }
39
- }
40
-
41
- @include respond-to(mobile-large) {
42
- padding-top: 0;
43
- margin-bottom: 0;
44
-
45
- .main-header {
46
- margin-top: 10px;
47
-
48
- h4 {
49
- font-size: $text-size-24;
50
- line-height: 32px;
51
- }
52
- }
53
-
54
- .main-news-header {
55
- padding-bottom: 35px;
56
-
57
- h2 {
58
- margin-top: 0;
59
- font-size: $text-size-18;
60
- line-height: 22px;
61
- }
62
- }
63
- }
64
- }
@@ -1,3 +0,0 @@
1
- @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');
2
- /* FontAwesome */
3
- @import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css');
@@ -1,31 +0,0 @@
1
- @import "sass/abstracts/mixins";
2
- @import "variables";
3
-
4
- footer {
5
- @include respond-to(mobile-large) {
6
- padding-top: 0;
7
- }
8
- .container-dark-background {
9
- background-color: #262626;
10
- }
11
-
12
- .contacts {
13
- font-size: $text-size-14;
14
-
15
- a {
16
- color: $text-white;
17
- }
18
-
19
- p, span {
20
- color: $text-white;
21
- }
22
- }
23
-
24
- .indent-inner {
25
- padding: 65px;
26
-
27
- @include respond-to(mobile-large) {
28
- padding: 40px 0;
29
- }
30
- }
31
- }
@@ -1,51 +0,0 @@
1
- @import "sass/abstracts/vars/colors";
2
- @import "sass/abstracts/mixins";
3
- @import "variables";
4
-
5
- .prod-mode {
6
- #header {
7
- display: flex;
8
-
9
- @include respond-to(mobile-large) {
10
- padding-bottom: 0;
11
- sc-placeholder {
12
- flex-direction: column-reverse;
13
- }
14
- }
15
- }
16
- }
17
-
18
- header {
19
- #header {
20
- .bs-title {
21
- padding-left: 50px;
22
-
23
- h1 {
24
- font-size: $text-size-24;
25
- font-weight: 600;
26
- line-height: 18px;
27
- padding-top: 40px;
28
- margin: 0;
29
- }
30
- }
31
-
32
- @include respond-to(mobile-large) {
33
- padding-bottom: 0;
34
- padding-top: 0;
35
- flex-direction: column-reverse;
36
-
37
- .bs-title {
38
- padding-left: 0;
39
- text-align: center;
40
- margin-top: -5px;
41
-
42
- h1 {
43
- font-weight: 500;
44
- line-height: 29px;
45
- padding-top: 0;
46
- margin-bottom: 10px;
47
- }
48
- }
49
- }
50
- }
51
- }