create-sitecore-jss 22.2.0-canary.83 → 22.3.0-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +35 -19
- package/dist/common/index.js +5 -3
- package/dist/common/processes/install.js +9 -2
- package/dist/common/processes/next.js +6 -3
- package/dist/common/processes/transform.js +18 -13
- package/dist/common/prompts/base.js +0 -25
- package/dist/common/prompts/proxy.js +35 -0
- package/dist/common/prompts/sxp.js +34 -0
- package/dist/common/utils/helpers.js +29 -19
- package/dist/init-runner.js +16 -11
- package/dist/initializers/angular/index.js +13 -0
- package/dist/initializers/angular/prompts.js +22 -1
- package/dist/initializers/angular-sxp/index.js +62 -0
- package/dist/initializers/angular-xmcloud/index.js +80 -0
- package/dist/initializers/nextjs/index.js +2 -2
- package/dist/initializers/nextjs/prompts.js +2 -0
- package/dist/initializers/nextjs/remove-dev-dependencies.js +2 -2
- package/dist/initializers/nextjs-multisite/index.js +1 -1
- package/dist/initializers/nextjs-styleguide/index.js +1 -1
- package/dist/initializers/nextjs-styleguide-tracking/index.js +1 -1
- package/dist/initializers/nextjs-sxa/index.js +1 -1
- package/dist/initializers/nextjs-xmcloud/index.js +1 -1
- package/dist/initializers/node-xmcloud-proxy/index.js +33 -0
- package/dist/initializers/react/index.js +3 -3
- package/dist/initializers/react/prompts.js +1 -1
- package/dist/initializers/react-native/prompts.js +1 -0
- package/dist/initializers/vue/prompts.js +1 -1
- package/dist/templates/angular/.env +4 -3
- package/dist/templates/angular/.eslintrc +1 -0
- package/dist/templates/angular/README.md +5 -45
- package/dist/templates/angular/angular.json +1 -6
- package/dist/templates/angular/gitignore +5 -0
- package/dist/templates/angular/package.json +11 -23
- package/dist/templates/angular/proxy.conf.js +5 -23
- package/dist/templates/angular/scripts/bootstrap.ts +5 -24
- package/dist/templates/angular/scripts/config/index.ts +28 -0
- package/dist/templates/angular/scripts/config/plugins/computed.ts +21 -0
- package/dist/templates/angular/scripts/config/plugins/fallback.ts +22 -0
- package/dist/templates/angular/scripts/config/plugins/package-json.ts +22 -0
- package/dist/templates/angular/scripts/config/plugins/scjssconfig.ts +29 -0
- package/dist/templates/angular/scripts/generate-component-factory/index.ts +45 -0
- package/dist/templates/angular/scripts/generate-component-factory/plugins/component-factory.ts +147 -0
- package/dist/templates/angular/scripts/generate-component-factory/plugins/components.ts +19 -0
- package/dist/templates/angular/scripts/generate-component-factory/plugins/packages.ts +29 -0
- package/dist/templates/angular/scripts/generate-component-factory/template.ts +46 -0
- package/dist/templates/angular/scripts/generate-config.ts +71 -72
- package/dist/templates/angular/scripts/generate-plugins.ts +33 -0
- package/dist/templates/angular/scripts/temp/gitignore +2 -0
- package/dist/templates/angular/scripts/update-graphql-fragment-data.ts +21 -28
- package/dist/templates/angular/server.bundle.ts +3 -5
- package/dist/templates/angular/server.exports.ts +13 -0
- package/dist/templates/angular/src/app/JssState.ts +2 -9
- package/dist/templates/angular/src/app/app.module.ts +5 -6
- package/dist/templates/angular/src/app/app.server.module.ts +9 -6
- package/dist/templates/angular/src/app/components/app-components.shared.module.ts +4 -19
- package/dist/templates/angular/src/app/components/gitignore +1 -1
- package/dist/templates/angular/src/app/i18n/jss-translation-client-loader.service.ts +15 -7
- package/dist/templates/angular/src/app/i18n/jss-translation-server-loader.service.ts +14 -2
- package/dist/templates/angular/src/app/jss-context.server-side.service.ts +4 -4
- package/dist/templates/angular/src/app/jss-context.service.ts +14 -11
- package/dist/templates/angular/src/app/jss-graphql.service.ts +7 -7
- package/dist/templates/angular/src/app/layout/jss-layout.service.ts +2 -2
- package/dist/templates/angular/src/app/lib/config.ts +16 -0
- package/dist/templates/angular/src/app/lib/dictionary-service-factory.ts +24 -13
- package/dist/templates/angular/src/app/lib/graphql-client-factory/config.ts +21 -0
- package/dist/templates/angular/src/app/lib/graphql-client-factory/index.ts +16 -0
- package/dist/templates/angular/src/app/lib/layout-service-factory.ts +20 -12
- package/dist/templates/angular/src/app/routing/layout/layout.component.html +1 -1
- package/dist/templates/angular/src/app/routing/layout/layout.component.ts +11 -11
- package/dist/templates/angular/src/app/routing/navigation/navigation.component.html +5 -6
- package/dist/templates/angular/src/app/routing/navigation/navigation.component.ts +1 -2
- package/dist/templates/angular/src/app/routing/routing.module.ts +14 -21
- package/dist/templates/angular/src/app/routing/scripts/scripts.component.html +1 -0
- package/dist/templates/angular/src/app/routing/scripts/scripts.component.ts +7 -0
- package/dist/templates/angular/src/app/routing/scripts/scripts.module.ts +8 -0
- package/dist/templates/angular/src/environments/gitignore +2 -1
- package/dist/templates/angular/src/graphql-fragment-types.ts +0 -95
- package/dist/templates/angular/tsconfig.json +7 -2
- package/dist/templates/angular-sxp/.env +2 -0
- package/dist/templates/angular-sxp/package.json +12 -0
- package/dist/templates/angular-sxp/proxy.conf.js +43 -0
- package/dist/templates/angular-sxp/scripts/config/plugins/disconnected.ts +29 -0
- package/dist/templates/angular-sxp/src/app/components/app-components.shared.module.ts +35 -0
- package/dist/templates/{angular → angular-sxp}/src/app/components/graph-ql-layout/graph-ql-layout.component.ts +1 -1
- package/dist/templates/{angular → angular-sxp}/src/app/jss-data-fetcher.service.ts +3 -1
- package/dist/templates/angular-sxp/src/app/routing/navigation/navigation.component.html +23 -0
- package/dist/templates/angular-sxp/src/app/routing/scripts/scripts.component.html +3 -0
- package/dist/templates/angular-sxp/src/app/routing/scripts/scripts.module.ts +9 -0
- package/dist/templates/{angular/src/app/routing → angular-sxp/src/app/routing/scripts}/visitor-identification/visitor-identification.component.ts +9 -3
- package/dist/templates/angular-sxp/src/graphql-fragment-types.ts +219 -0
- package/dist/templates/angular-xmcloud/.env +21 -0
- package/dist/templates/angular-xmcloud/angular.json +33 -0
- package/dist/templates/angular-xmcloud/package.json +17 -0
- package/dist/templates/angular-xmcloud/scripts/bootstrap.ts +28 -0
- package/dist/templates/angular-xmcloud/scripts/config/plugins/xmcloud.ts +39 -0
- package/dist/templates/angular-xmcloud/scripts/generate-component-factory/plugins/packages.ts +34 -0
- package/dist/templates/angular-xmcloud/scripts/generate-component-factory/template.ts +57 -0
- package/dist/templates/angular-xmcloud/scripts/generate-metadata.ts +25 -0
- package/dist/templates/angular-xmcloud/scripts/proxy-build.ts +15 -0
- package/dist/templates/angular-xmcloud/server.exports.ts +24 -0
- package/dist/templates/angular-xmcloud/src/app/components/app-components.shared.module.ts +21 -0
- package/dist/templates/angular-xmcloud/src/app/components/column-splitter/column-splitter.component.html +5 -0
- package/dist/templates/angular-xmcloud/src/app/components/column-splitter/column-splitter.component.ts +40 -0
- package/dist/templates/angular-xmcloud/src/app/components/container/container.component.html +14 -0
- package/dist/templates/angular-xmcloud/src/app/components/container/container.component.ts +30 -0
- package/dist/templates/angular-xmcloud/src/app/components/image/image.component.html +36 -0
- package/dist/templates/angular-xmcloud/src/app/components/image/image.component.ts +67 -0
- package/dist/templates/angular-xmcloud/src/app/components/link-list/link-list.component.html +15 -0
- package/dist/templates/angular-xmcloud/src/app/components/link-list/link-list.component.ts +41 -0
- package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation-item.component.html +23 -0
- package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation-item.component.ts +65 -0
- package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation.component.html +21 -0
- package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation.component.ts +49 -0
- package/dist/templates/angular-xmcloud/src/app/components/page-content/page-content.component.html +5 -0
- package/dist/templates/angular-xmcloud/src/app/components/page-content/page-content.component.ts +39 -0
- package/dist/templates/angular-xmcloud/src/app/components/partial-design-dynamic-placeholder/partial-design-dynamic-placeholder.component.html +1 -0
- package/dist/templates/angular-xmcloud/src/app/components/partial-design-dynamic-placeholder/partial-design-dynamic-placeholder.component.ts +15 -0
- package/dist/templates/angular-xmcloud/src/app/components/promo/promo.component.html +21 -0
- package/dist/templates/angular-xmcloud/src/app/components/promo/promo.component.ts +13 -0
- package/dist/templates/angular-xmcloud/src/app/components/richtext/richtext.component.html +8 -0
- package/dist/templates/angular-xmcloud/src/app/components/richtext/richtext.component.ts +21 -0
- package/dist/templates/angular-xmcloud/src/app/components/row-splitter/row-splitter.component.html +11 -0
- package/dist/templates/angular-xmcloud/src/app/components/row-splitter/row-splitter.component.ts +35 -0
- package/dist/templates/angular-xmcloud/src/app/components/sxa.component.ts +15 -0
- package/dist/templates/angular-xmcloud/src/app/components/title/title.component.html +10 -0
- package/dist/templates/angular-xmcloud/src/app/components/title/title.component.ts +56 -0
- package/dist/templates/angular-xmcloud/src/app/jss-link.service.ts +55 -0
- package/dist/templates/angular-xmcloud/src/app/lib/config.ts +17 -0
- package/dist/templates/angular-xmcloud/src/app/lib/graphql-client-factory/config.ts +58 -0
- package/dist/templates/angular-xmcloud/src/app/routing/layout/layout.component.html +38 -0
- package/dist/templates/angular-xmcloud/src/app/routing/layout/layout.component.ts +104 -0
- package/dist/templates/angular-xmcloud/src/app/routing/scripts/cdp-page-view.component.ts +77 -0
- package/dist/templates/angular-xmcloud/src/app/routing/scripts/cloud-sdk-init.component.ts +48 -0
- package/dist/templates/angular-xmcloud/src/app/routing/scripts/scripts.component.html +5 -0
- package/dist/templates/angular-xmcloud/src/app/routing/scripts/scripts.module.ts +12 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_component.scss +48 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_container.scss +64 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_fonts.scss +3 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_footer.scss +31 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_header.scss +51 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_navigation.scss +150 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_promo.scss +58 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_rich-text.scss +11 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/_variables.scss +10 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/basic/main.scss +8 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/main.scss +14 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/_app.scss +103 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/_functions.scss +8 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/_mixins.scss +121 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/_vars.scss +3 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/vars/_colors.scss +283 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/vars/_fontSizes.scss +16 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/vars/_margins.scss +11 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/fonts/_fonts.scss +1 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/fonts/index.scss +1 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/index.scss +3 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/links/_link-button.scss +26 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/links/index.scss +1 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/reset/_inputs.scss +58 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/reset/_links.scss +14 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/reset/_ui-datepicker.scss +7 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/richtext/_richtext-files-icons.scss +86 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/richtext/_richtext.scss +101 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/richtext/index.scss +2 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/typehead/_typehead.scss +95 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/typehead/index.scss +1 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-column-splitter.scss +14 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-container.scss +27 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-image.scss +18 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-navigation.scss +51 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-promo.scss +42 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-richtext-content.scss +19 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_alignment.scss +26 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_boxed.scss +16 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_clearfix.scss +11 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_highlighted.scss +63 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_link-button.scss +16 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_promoted-box.scss +3 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/index.scss +6 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/container/_bordered.scss +24 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/container/_title-row-box.scss +66 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/container/index.scss +1 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image/_image-default-size.scss +6 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image/index.scss +1 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image-alignment/_image-left.scss +3 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image-alignment/_image-right.scss +3 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/index.scss +17 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/layout/_acaindent.scss +5 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/layout/_background.scss +27 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/layout/index.scss +1 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/link-list/_component-link-list.scss +45 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/link-list/_list-vertical.scss +20 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/link-list/index.scss +2 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-fat.scss +58 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-main-horizontal-vertical.scss +176 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-mobile.scss +85 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-sidebar.scss +29 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_sitemap-navigation.scss +20 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/index.scss +5 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/_absolute-bottom-link.scss +8 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/_promo-hero.scss +40 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/_promo-shadow.scss +42 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/index.scss +3 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/rich-text/_rich-text-lists.scss +63 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/rich-text/index.scss +1 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/spacing/_background-colors.scss +14 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/spacing/_indent.scss +13 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/spacing/index.scss +2 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/title/_component-title.scss +30 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/title/index.scss +1 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/main.scss +4 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/index.scss +6 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/link-list/index.scss +0 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/navigation/index.scss +0 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/page-content/index.scss +0 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/promo/index.scss +0 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/rich-text/index.scss +0 -0
- package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/title/index.scss +0 -0
- package/dist/templates/nextjs/package.json +4 -4
- package/dist/templates/nextjs/scripts/config/plugins/fallback.ts +0 -1
- package/dist/templates/nextjs/scripts/generate-config.ts +8 -1
- package/dist/templates/nextjs-styleguide/package.json +1 -1
- package/dist/templates/nextjs-styleguide/scripts/config/plugins/disconnected.ts +1 -0
- package/dist/templates/nextjs-sxa/src/assets/sass/components/common/_alignment.scss +34 -7
- package/dist/templates/node-headless-ssr-experience-edge/gitignore +19 -0
- package/dist/templates/node-headless-ssr-experience-edge/package.json +2 -2
- package/dist/templates/node-headless-ssr-proxy/gitignore +19 -0
- package/dist/templates/node-headless-ssr-proxy/package.json +3 -3
- package/dist/templates/node-headless-ssr-proxy/src/config.ts +3 -3
- package/dist/templates/node-headless-ssr-proxy/src/httpAgents.ts +2 -2
- package/dist/templates/node-headless-ssr-proxy/src/index.ts +9 -2
- package/dist/templates/node-xmcloud-proxy/.env +14 -0
- package/dist/templates/node-xmcloud-proxy/README.md +36 -0
- package/dist/templates/node-xmcloud-proxy/gitignore +33 -0
- package/dist/templates/node-xmcloud-proxy/package.json +26 -0
- package/dist/templates/node-xmcloud-proxy/src/config.ts +25 -0
- package/dist/templates/node-xmcloud-proxy/src/index.ts +210 -0
- package/dist/templates/node-xmcloud-proxy/src/types.ts +27 -0
- package/dist/templates/node-xmcloud-proxy/tsconfig.json +22 -0
- package/dist/templates/react/package.json +5 -5
- package/dist/templates/react/scripts/generate-config.js +10 -3
- package/dist/templates/react-native/package.json +4 -4
- package/dist/templates/vue/package.json +4 -4
- package/dist/templates/vue/scripts/generate-config.js +5 -0
- package/package.json +2 -2
- package/dist/templates/angular/scripts/generate-component-factory.ts +0 -166
- package/dist/templates/angular/src/app/lib/client-factory.ts +0 -28
- /package/dist/templates/{angular → angular-sxp}/data/component-content/Styleguide/ContentReuse/LoremIpsumContentBlock/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/component-content/gitignore +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/content/Styleguide/ContentListField/Item1/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/content/Styleguide/ContentListField/Item2/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/content/Styleguide/EditFrameDemo/Item1/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/content/Styleguide/EditFrameDemo/Item2/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/content/Styleguide/ItemLinkField/Item1/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/content/Styleguide/ItemLinkField/Item2/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/content/gitignore +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/dictionary/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/dictionary/{{language}}.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/media/files/jss.pdf +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/media/img/jss_logo.png +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/media/img/sc_logo.png +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/routes/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/routes/graphql/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/routes/graphql/sample-1/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/routes/graphql/sample-2/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/routes/styleguide/custom-route-type/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/routes/styleguide/en.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/routes/styleguide/{{language}}.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/data/routes/{{language}}.yml +0 -0
- /package/dist/templates/{angular → angular-sxp}/scripts/disconnected-mode-proxy.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/scripts/lint-yml.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/config/{{appName}}.config +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/component-content.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/Styleguide-Layout-Reuse.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/Styleguide-Layout-Tabs-Tab.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/Styleguide-Layout-Tabs.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/Styleguide-Layout.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/Styleguide-Multilingual.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/Styleguide-Section.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/content-block.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/graph-ql-connected-demo.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/graph-ql-integrated-demo.sitecore.graphql +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/graph-ql-integrated-demo.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/graph-ql-layout.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-angular-lazy-loading.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-component-params.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-custom-route-type.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-edit-frame.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-checkbox.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-content-list.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-custom.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-date.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-file.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-image.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-item-link.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-link.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-number.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-rich-text.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-field-usage-text.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-route-fields.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-sitecore-context.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/components/styleguide-tracking.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/config.js +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/content.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/dictionary.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/placeholders.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/routes.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/templates/Styleguide-Explanatory-Component.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/templates/styleguide-content-list-template.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/templates/styleguide-edit-frame-list-item-template.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/definitions/templates/styleguide-item-link-template.sitecore.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/gitignore +0 -0
- /package/dist/templates/{angular → angular-sxp}/sitecore/pipelines/example.patch.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.graphql +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/graph-ql-integrated-demo/graph-ql-integrated-demo.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/graph-ql-integrated-demo/graph-ql-integrated-demo.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/graph-ql-layout/graph-ql-layout.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/shared/styleguide-specimen/styleguide-specimen.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-angular-lazy-loading/styleguide-angular-lazy-loading.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-angular-lazy-loading/styleguide-angular-lazy-loading.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-angular-lazy-loading/styleguide-angular-lazy-loading.module.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-component-params/styleguide-component-params.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-component-params/styleguide-component-params.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-custom-route-type/styleguide-custom-route-type.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-custom-route-type/styleguide-custom-route-type.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-edit-frame/styleguide-edit-frame.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-edit-frame/styleguide-edit-frame.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-checkbox/styleguide-field-usage-checkbox.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-checkbox/styleguide-field-usage-checkbox.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-content-list/styleguide-field-usage-content-list.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-content-list/styleguide-field-usage-content-list.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-custom/styleguide-field-usage-custom.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-custom/styleguide-field-usage-custom.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-date/styleguide-field-usage-date.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-date/styleguide-field-usage-date.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-file/styleguide-field-usage-file.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-file/styleguide-field-usage-file.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-image/styleguide-field-usage-image.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-image/styleguide-field-usage-image.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-item-link/styleguide-field-usage-item-link.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-item-link/styleguide-field-usage-item-link.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-link/styleguide-field-usage-link.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-link/styleguide-field-usage-link.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-number/styleguide-field-usage-number.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-number/styleguide-field-usage-number.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-rich-text/styleguide-field-usage-rich-text.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-rich-text/styleguide-field-usage-rich-text.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-text/styleguide-field-usage-text.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-field-usage-text/styleguide-field-usage-text.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout/styleguide-layout.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout/styleguide-layout.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout-reuse/styleguide-layout-reuse.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout-reuse/styleguide-layout-reuse.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout-tabs/styleguide-layout-tabs.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout-tabs/styleguide-layout-tabs.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout-tabs-tab/styleguide-layout-tabs-tab.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-layout-tabs-tab/styleguide-layout-tabs-tab.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-multilingual/styleguide-multilingual.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-multilingual/styleguide-multilingual.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-route-fields/styleguide-route-fields.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-route-fields/styleguide-route-fields.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-section/styleguide-section.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-section/styleguide-section.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-sitecore-context/styleguide-sitecore-context.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-sitecore-context/styleguide-sitecore-context.component.ts +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-tracking/styleguide-tracking.component.html +0 -0
- /package/dist/templates/{angular → angular-sxp}/src/app/components/styleguide-tracking/styleguide-tracking.component.ts +0 -0
package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation.component.html
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<label class="menu-mobile-navigate-wrapper">
|
|
2
|
+
<input
|
|
3
|
+
type="checkbox"
|
|
4
|
+
class="menu-mobile-navigate"
|
|
5
|
+
[checked]="isOpenMenu"
|
|
6
|
+
(change)="toggleMenu($event)"
|
|
7
|
+
/>
|
|
8
|
+
<div class="menu-humburger"></div>
|
|
9
|
+
<div class="component-content">
|
|
10
|
+
<nav>
|
|
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>
|
|
18
|
+
</ul>
|
|
19
|
+
</nav>
|
|
20
|
+
</div>
|
|
21
|
+
</label>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Component, OnInit, OnDestroy } from '@angular/core';
|
|
2
|
+
import { Subscription } from 'rxjs';
|
|
3
|
+
import { SxaComponent } from '../sxa.component';
|
|
4
|
+
import { JssContextService } from '../../jss-context.service';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'app-navigation',
|
|
8
|
+
templateUrl: './navigation.component.html',
|
|
9
|
+
host: {
|
|
10
|
+
'class': 'component navigation',
|
|
11
|
+
'[id]': 'id',
|
|
12
|
+
'[class]': 'styles + " " + rendering.params?.GridParameters',
|
|
13
|
+
},
|
|
14
|
+
})
|
|
15
|
+
export class NavigationComponent extends SxaComponent implements OnInit, OnDestroy {
|
|
16
|
+
isEditing = false;
|
|
17
|
+
private contextSubscription: Subscription;
|
|
18
|
+
isOpenMenu = false;
|
|
19
|
+
baseLevel = 1;
|
|
20
|
+
|
|
21
|
+
constructor(private jssContext: JssContextService) {
|
|
22
|
+
super();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
ngOnInit() {
|
|
26
|
+
super.ngOnInit();
|
|
27
|
+
this.contextSubscription = this.jssContext.state.subscribe((newState) => {
|
|
28
|
+
this.isEditing = newState.sitecore && newState.sitecore.context.pageEditing;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
ngOnDestroy() {
|
|
33
|
+
if (this.contextSubscription) {
|
|
34
|
+
this.contextSubscription.unsubscribe();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
toggleMenu(event: Event, flag?: boolean) {
|
|
39
|
+
if (event && this.isEditing) {
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (flag !== undefined) {
|
|
44
|
+
this.isOpenMenu = flag;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
this.isOpenMenu = !this.isOpenMenu;
|
|
48
|
+
}
|
|
49
|
+
}
|
package/dist/templates/angular-xmcloud/src/app/components/page-content/page-content.component.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Component, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { RichTextField } from '@sitecore-jss/sitecore-jss-angular';
|
|
3
|
+
import { JssContextService } from '../../jss-context.service';
|
|
4
|
+
import { SxaComponent } from './../sxa.component';
|
|
5
|
+
import { Subscription } from 'rxjs';
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'app-page-content',
|
|
9
|
+
templateUrl: './page-content.component.html',
|
|
10
|
+
host: {
|
|
11
|
+
'class': 'component content',
|
|
12
|
+
'[class]': 'styles',
|
|
13
|
+
'[id]': 'id',
|
|
14
|
+
}
|
|
15
|
+
})
|
|
16
|
+
export class PageContentComponent extends SxaComponent implements OnInit, OnDestroy {
|
|
17
|
+
content?: RichTextField;
|
|
18
|
+
contextContent?: RichTextField;
|
|
19
|
+
private contextSubscription: Subscription;
|
|
20
|
+
|
|
21
|
+
constructor(private jssContext: JssContextService) {
|
|
22
|
+
super();
|
|
23
|
+
}
|
|
24
|
+
ngOnInit() {
|
|
25
|
+
super.ngOnInit();
|
|
26
|
+
|
|
27
|
+
this.content = this.rendering.fields?.Content as RichTextField;
|
|
28
|
+
this.contextSubscription = this.jssContext.state.subscribe((newState) => {
|
|
29
|
+
this.contextContent =
|
|
30
|
+
newState.sitecore && (newState.sitecore.route.fields.Content as RichTextField);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
ngOnDestroy() {
|
|
35
|
+
if (this.contextSubscription) {
|
|
36
|
+
this.contextSubscription.unsubscribe();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<sc-placeholder [name]="sig" [rendering]="rendering">
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Component, OnInit } from '@angular/core';
|
|
2
|
+
import { SxaComponent } from '../sxa.component';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'app-partial-design-dynamic-placeholder',
|
|
6
|
+
templateUrl: './partial-design-dynamic-placeholder.component.html',
|
|
7
|
+
})
|
|
8
|
+
export class PartialDesignDynamicPlaceholderComponent extends SxaComponent implements OnInit {
|
|
9
|
+
sig: string;
|
|
10
|
+
ngOnInit() {
|
|
11
|
+
super.ngOnInit();
|
|
12
|
+
|
|
13
|
+
this.sig = this.rendering.params?.sig || '';
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<div class="component-content">
|
|
2
|
+
<ng-container *ngIf="rendering.fields; else empty">
|
|
3
|
+
<div class="field-promoicon">
|
|
4
|
+
<img *scImage="rendering.fields.PromoIcon" />
|
|
5
|
+
</div>
|
|
6
|
+
<div class="promo-text">
|
|
7
|
+
<div>
|
|
8
|
+
<div class="field-promotext">
|
|
9
|
+
<div *scRichText="rendering.fields.PromoText"></div>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="field-promolink">
|
|
13
|
+
<a *scGenericLink="rendering.fields.PromoLink"></a>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</ng-container>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<ng-template #empty>
|
|
20
|
+
<span className="is-empty-hint">Promo</span>
|
|
21
|
+
</ng-template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { SxaComponent } from '../sxa.component';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'app-promo',
|
|
6
|
+
templateUrl: './promo.component.html',
|
|
7
|
+
host: {
|
|
8
|
+
'class': 'component promo',
|
|
9
|
+
'[class]': "styles",
|
|
10
|
+
'[id]': "id",
|
|
11
|
+
},
|
|
12
|
+
})
|
|
13
|
+
export class PromoComponent extends SxaComponent {}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Component, OnInit } from '@angular/core';
|
|
2
|
+
import { Field } from '@sitecore-jss/sitecore-jss-angular';
|
|
3
|
+
import { SxaComponent } from '../sxa.component';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'app-richtext',
|
|
7
|
+
templateUrl: './richtext.component.html',
|
|
8
|
+
host: {
|
|
9
|
+
'class': 'component rich-text',
|
|
10
|
+
'[class]': "styles",
|
|
11
|
+
"[attr.id]": "id"
|
|
12
|
+
},
|
|
13
|
+
})
|
|
14
|
+
export class RichTextComponent extends SxaComponent implements OnInit {
|
|
15
|
+
text?: Field<string>;
|
|
16
|
+
|
|
17
|
+
ngOnInit() {
|
|
18
|
+
super.ngOnInit();
|
|
19
|
+
this.text = this.rendering.fields?.Text as Field<string>;
|
|
20
|
+
}
|
|
21
|
+
}
|
package/dist/templates/angular-xmcloud/src/app/components/row-splitter/row-splitter.component.html
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<div
|
|
2
|
+
*ngFor="let ph of enabledPlaceholders"
|
|
3
|
+
class="container-fluid"
|
|
4
|
+
[ngClass]="getRowClass(+ph - 1)"
|
|
5
|
+
>
|
|
6
|
+
<div>
|
|
7
|
+
<div class="row">
|
|
8
|
+
<sc-placeholder [name]="getPlaceholderName(ph)" [rendering]="rendering"> </sc-placeholder>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
package/dist/templates/angular-xmcloud/src/app/components/row-splitter/row-splitter.component.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { SxaComponent } from '../sxa.component';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'app-row-splitter',
|
|
6
|
+
templateUrl: './row-splitter.component.html',
|
|
7
|
+
host: {
|
|
8
|
+
"class": "component row-splitter",
|
|
9
|
+
"[class]": "rowSplitterStyles",
|
|
10
|
+
"[id]": "id"
|
|
11
|
+
}
|
|
12
|
+
})
|
|
13
|
+
export class RowSplitterComponent extends SxaComponent {
|
|
14
|
+
get rowSplitterStyles(): string {
|
|
15
|
+
return `${this.rendering.params.GridParameters ?? ''} ${this.rendering.params.Styles ??
|
|
16
|
+
''}`.trimEnd();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
get rowStyles(): string[] {
|
|
20
|
+
return Array.from({ length: 8 }, (_, i) => this.rendering.params[`Styles${i + 1}`]);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
get enabledPlaceholders(): string[] {
|
|
24
|
+
return this.rendering.params.EnabledPlaceholders.split(',');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
getRowClass(index: number): string {
|
|
28
|
+
const styleClass = this.rowStyles[index] || '';
|
|
29
|
+
return `${styleClass}`.trim();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
getPlaceholderName(ph: string): string {
|
|
33
|
+
return `row-${ph}-{*}`;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OnInit, Input, Directive } from '@angular/core';
|
|
2
|
+
import { ComponentFields, ComponentRendering } from '@sitecore-jss/sitecore-jss-angular';
|
|
3
|
+
|
|
4
|
+
@Directive()
|
|
5
|
+
export abstract class SxaComponent<FieldType = ComponentFields> implements OnInit {
|
|
6
|
+
@Input() rendering: ComponentRendering<FieldType>;
|
|
7
|
+
|
|
8
|
+
id?: string;
|
|
9
|
+
styles?: string;
|
|
10
|
+
|
|
11
|
+
ngOnInit() {
|
|
12
|
+
this.id = this.rendering.params?.RenderingIdentifier;
|
|
13
|
+
this.styles = this.rendering.params?.styles;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
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>
|
|
@@ -0,0 +1,104 @@
|
|
|
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
|
+
}
|