create-sitecore-jss 22.1.0-canary.9 → 22.2.0-canary.10
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 +70 -28
- package/dist/common/index.js +5 -3
- package/dist/common/processes/install.js +9 -2
- package/dist/common/processes/next.js +3 -3
- package/dist/common/processes/transform.js +29 -14
- package/dist/common/prompts/base.js +0 -12
- package/dist/common/prompts/sxp.js +20 -0
- package/dist/common/utils/helpers.js +28 -43
- 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 +66 -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 +32 -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 +5 -3
- package/dist/templates/angular/README.md +5 -45
- package/dist/templates/angular/angular.json +1 -6
- package/dist/templates/angular/package.json +43 -53
- 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 +23 -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-config.ts +53 -73
- package/dist/templates/angular/scripts/generate-plugins.ts +28 -0
- package/dist/templates/angular/scripts/temp/gitignore +2 -0
- package/dist/templates/angular/scripts/update-graphql-fragment-data.ts +4 -2
- package/dist/templates/angular/server.bundle.ts +20 -2
- package/dist/templates/angular/src/app/JssState.ts +1 -4
- package/dist/templates/angular/src/app/app.module.ts +0 -2
- package/dist/templates/angular/src/app/components/app-components.shared.module.ts +4 -19
- package/dist/templates/angular/src/app/jss-context.server-side.service.ts +0 -2
- package/dist/templates/angular/src/app/lib/config.ts +16 -0
- package/dist/templates/angular/src/app/lib/dictionary-service-factory.ts +21 -13
- 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 +1 -2
- 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/graphql-fragment-types.ts +0 -95
- package/dist/templates/angular/src/polyfills.ts +2 -6
- package/dist/templates/angular/src/test.ts +1 -6
- package/dist/templates/angular/tsconfig.json +7 -2
- 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 +27 -0
- package/dist/templates/angular-sxp/src/app/components/app-components.shared.module.ts +35 -0
- 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 +8 -0
- package/dist/templates/angular-xmcloud/angular.json +34 -0
- package/dist/templates/angular-xmcloud/package.json +15 -0
- package/dist/templates/angular-xmcloud/scripts/config/plugins/xmcloud.ts +23 -0
- package/dist/templates/angular-xmcloud/scripts/proxy-build.ts +15 -0
- package/dist/templates/angular-xmcloud/src/app/components/container/container.component.html +15 -0
- package/dist/templates/angular-xmcloud/src/app/components/container/container.component.ts +30 -0
- package/dist/templates/angular-xmcloud/src/app/components/richtext/richtext.component.html +13 -0
- package/dist/templates/angular-xmcloud/src/app/components/richtext/richtext.component.ts +16 -0
- package/dist/templates/angular-xmcloud/src/app/components/sxa.component.ts +15 -0
- package/dist/templates/angular-xmcloud/src/app/jss-link.service.ts +51 -0
- package/dist/templates/angular-xmcloud/src/app/lib/config.ts +15 -0
- package/dist/templates/angular-xmcloud/src/app/lib/graphql-client-factory.ts +44 -0
- package/dist/templates/angular-xmcloud/src/app/routing/layout/layout.component.html +39 -0
- package/dist/templates/angular-xmcloud/src/app/routing/layout/layout.component.ts +111 -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 +49 -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 +4 -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/next.config.js +5 -0
- package/dist/templates/nextjs/package.json +7 -6
- package/dist/templates/nextjs/src/lib/next-config/plugins/cors-header.js +0 -9
- package/dist/templates/nextjs/src/pages/[[...path]].tsx +1 -13
- package/dist/templates/nextjs-styleguide/package.json +1 -1
- package/dist/templates/nextjs-sxa/src/assets/sass/components/_component-image.scss +1 -1
- package/dist/templates/nextjs-sxa/src/assets/sass/components/title/_component-title.scss +19 -13
- package/dist/templates/nextjs-sxa/src/components/Image.tsx +22 -12
- package/dist/templates/nextjs-sxa/src/components/Promo.tsx +1 -1
- package/dist/templates/nextjs-sxa/src/components/Title.tsx +10 -13
- package/dist/templates/nextjs-xmcloud/package.json +1 -1
- package/dist/templates/nextjs-xmcloud/src/Scripts.tsx +2 -0
- package/dist/templates/nextjs-xmcloud/src/lib/dictionary-service-factory.ts +46 -0
- package/dist/templates/nextjs-xmcloud/src/lib/graphql-editing-service.ts +9 -0
- package/dist/templates/nextjs-xmcloud/src/lib/middleware/plugins/personalize.ts +6 -5
- package/dist/templates/nextjs-xmcloud/src/lib/page-props-factory/plugins/personalize.ts +7 -3
- package/dist/templates/nextjs-xmcloud/src/lib/page-props-factory/plugins/preview-mode.ts +72 -0
- package/dist/templates/nextjs-xmcloud/src/pages/api/editing/render.ts +46 -0
- package/dist/templates/node-headless-ssr-experience-edge/package.json +2 -2
- package/dist/templates/node-headless-ssr-proxy/package.json +4 -4
- package/dist/templates/node-xmcloud-proxy/.env +8 -0
- package/dist/templates/node-xmcloud-proxy/README.md +36 -0
- package/dist/templates/node-xmcloud-proxy/package.json +25 -0
- package/dist/templates/node-xmcloud-proxy/src/config.ts +19 -0
- package/dist/templates/node-xmcloud-proxy/src/index.ts +161 -0
- package/dist/templates/node-xmcloud-proxy/src/types.ts +59 -0
- package/dist/templates/node-xmcloud-proxy/tsconfig.json +22 -0
- package/dist/templates/react/package.json +5 -5
- package/dist/templates/react-native/package.json +4 -4
- package/dist/templates/vue/package.json +4 -4
- package/package.json +4 -4
- /package/dist/templates/angular/src/app/lib/{client-factory.ts → graphql-client-factory.ts} +0 -0
- /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/graph-ql-layout/graph-ql-layout.component.ts +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
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { execSync } from 'child_process';
|
|
2
|
+
import { environment } from '../src/environments/environment';
|
|
3
|
+
|
|
4
|
+
// Executed at the end of the build process (jss build) to move the build output to the proxy build path
|
|
5
|
+
|
|
6
|
+
try {
|
|
7
|
+
console.log('Moving build output to proxy build path:', environment.proxyBuildPath);
|
|
8
|
+
|
|
9
|
+
execSync(`del-cli ${environment.proxyBuildPath} --force`, { stdio: 'inherit' });
|
|
10
|
+
execSync(`move-cli ./dist ${environment.proxyBuildPath}`, { stdio: 'inherit' });
|
|
11
|
+
|
|
12
|
+
console.log('Proxy build prepared successfully!');
|
|
13
|
+
} catch (error) {
|
|
14
|
+
console.error('Error preparing proxy build:', error);
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<div class="container-wrapper" *ngIf="wrapped; else default">
|
|
2
|
+
<ng-container *ngTemplateOutlet="default"></ng-container>
|
|
3
|
+
</div>
|
|
4
|
+
<ng-template #default>
|
|
5
|
+
<div class="component container-default {{ styles }}" [attr.id]="id">
|
|
6
|
+
<div class="component-content" [ngStyle]="backgroundStyle">
|
|
7
|
+
<div class="row">
|
|
8
|
+
<sc-placeholder
|
|
9
|
+
[name]="placeholderName"
|
|
10
|
+
[rendering]="rendering">
|
|
11
|
+
</sc-placeholder>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</ng-template>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Component, OnInit } from '@angular/core';
|
|
2
|
+
import { SxaComponent } from '../sxa.component';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'app-container',
|
|
6
|
+
templateUrl: './container.component.html',
|
|
7
|
+
})
|
|
8
|
+
export class ContainerComponent extends SxaComponent implements OnInit {
|
|
9
|
+
placeholderName: string;
|
|
10
|
+
wrapped: boolean;
|
|
11
|
+
|
|
12
|
+
override ngOnInit() {
|
|
13
|
+
super.ngOnInit();
|
|
14
|
+
|
|
15
|
+
this.placeholderName = `container-${this.rendering.params?.DynamicPlaceholderId}`;
|
|
16
|
+
this.wrapped = this.rendering.params?.Styles?.split(' ').includes('container');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
get backgroundStyle() {
|
|
20
|
+
const backgroundImage = this.rendering.params?.BackgroundImage;
|
|
21
|
+
const mediaUrlPattern = new RegExp(/mediaurl=\"([^"]*)\"/, 'i');
|
|
22
|
+
if (!backgroundImage || !backgroundImage.match(mediaUrlPattern)) {
|
|
23
|
+
return {};
|
|
24
|
+
}
|
|
25
|
+
const mediaUrl = backgroundImage.match(mediaUrlPattern)[1];
|
|
26
|
+
return {
|
|
27
|
+
backgroundImage: `url('${mediaUrl}')`,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<div
|
|
2
|
+
class="component rich-text {{ styles }}"
|
|
3
|
+
[attr.id]="id"
|
|
4
|
+
>
|
|
5
|
+
<div class="component-content">
|
|
6
|
+
<ng-container *ngIf="text; else emptyHint">
|
|
7
|
+
<div *scRichText="text"></div>
|
|
8
|
+
</ng-container>
|
|
9
|
+
<ng-template #emptyHint>
|
|
10
|
+
<span class="is-empty-hint">Rich text</span>
|
|
11
|
+
</ng-template>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
})
|
|
9
|
+
export class RichTextComponent extends SxaComponent implements OnInit {
|
|
10
|
+
text?: Field<string>;
|
|
11
|
+
|
|
12
|
+
ngOnInit() {
|
|
13
|
+
super.ngOnInit();
|
|
14
|
+
this.text = this.rendering.fields?.Text as Field<string>;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OnInit, Input, Directive } from '@angular/core';
|
|
2
|
+
import { ComponentRendering } from '@sitecore-jss/sitecore-jss-angular';
|
|
3
|
+
|
|
4
|
+
@Directive()
|
|
5
|
+
export abstract class SxaComponent implements OnInit {
|
|
6
|
+
@Input() rendering: ComponentRendering;
|
|
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,51 @@
|
|
|
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
|
+
export class JssLinkService {
|
|
7
|
+
document: Document;
|
|
8
|
+
|
|
9
|
+
constructor() {
|
|
10
|
+
this.document = Inject(DOCUMENT);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Adds link element in the document head.
|
|
15
|
+
* @param headLinks - An array of HTMLLink objects to add to the head.
|
|
16
|
+
*/
|
|
17
|
+
addHeadLinks(headLink: HTMLLink) {
|
|
18
|
+
if (!headLink) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
this.createLink(headLink);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Creates a new link element and appends it to the head.
|
|
27
|
+
* @param headLink - An HTMLLink object to be added.
|
|
28
|
+
*/
|
|
29
|
+
private createLink(headLink: HTMLLink) {
|
|
30
|
+
if (!headLink.rel || !headLink.href) {
|
|
31
|
+
console.log('Invalid link object:', headLink);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const link: HTMLLinkElement = this.document.createElement('link');
|
|
36
|
+
link.setAttribute('rel', headLink.rel);
|
|
37
|
+
link.setAttribute('href', headLink.href);
|
|
38
|
+
this.document.head.appendChild(link);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Removes all link elements that match the specified rel attribute.
|
|
43
|
+
* @param rel - The rel attribute of the links to be removed.
|
|
44
|
+
*/
|
|
45
|
+
removeLinksByRel(rel: string) {
|
|
46
|
+
const links = this.document.head.querySelectorAll(`link[rel="${rel}"]`);
|
|
47
|
+
links.forEach((link) => {
|
|
48
|
+
this.document.head.removeChild(link);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GraphQLRequestClientFactoryConfig,
|
|
3
|
+
GraphQLRequestClient,
|
|
4
|
+
} from '@sitecore-jss/sitecore-jss-angular';
|
|
5
|
+
import { environment as env } from '../../environments/environment';
|
|
6
|
+
|
|
7
|
+
// The GraphQLRequestClientFactory serves as the central hub for executing GraphQL requests within the application
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new GraphQLRequestClientFactory instance
|
|
11
|
+
* @returns GraphQLRequestClientFactory instance
|
|
12
|
+
*/
|
|
13
|
+
export const createGraphQLClientFactory = () => {
|
|
14
|
+
let clientConfig: GraphQLRequestClientFactoryConfig;
|
|
15
|
+
|
|
16
|
+
// If we are in a production environment we are going to use Node XM Cloud proxy
|
|
17
|
+
if (env.production === 'true') {
|
|
18
|
+
if (env.proxyHost && env.sitecoreApiKey && env.graphQLEndpoint) {
|
|
19
|
+
// Server side requests should go directly to the Sitecore, browser requests should go through the proxy.
|
|
20
|
+
clientConfig = {
|
|
21
|
+
endpoint:
|
|
22
|
+
typeof window === 'undefined'
|
|
23
|
+
? env.graphQLEndpoint
|
|
24
|
+
: `${env.proxyHost}${env.graphQLEndpointPath}`,
|
|
25
|
+
apiKey: env.sitecoreApiKey,
|
|
26
|
+
};
|
|
27
|
+
} else {
|
|
28
|
+
throw new Error('Please configure your proxyHost, sitecoreApiKey, graphQLEndpoint.');
|
|
29
|
+
}
|
|
30
|
+
} else {
|
|
31
|
+
if (env.graphQLEndpoint && env.sitecoreApiKey) {
|
|
32
|
+
clientConfig = {
|
|
33
|
+
endpoint: env.graphQLEndpoint,
|
|
34
|
+
apiKey: env.sitecoreApiKey,
|
|
35
|
+
};
|
|
36
|
+
} else {
|
|
37
|
+
throw new Error('Please configure your graphQLEndpoint and sitecoreApiKey.');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return GraphQLRequestClient.createClientFactory(clientConfig);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const clientFactory = createGraphQLClientFactory();
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<app-navigation></app-navigation>
|
|
2
|
+
<div class="{{ mainClassPageEditing }}">
|
|
3
|
+
<ng-container *ngIf="state === LayoutState.Layout">
|
|
4
|
+
<app-scripts></app-scripts>
|
|
5
|
+
<header>
|
|
6
|
+
<div id="header">
|
|
7
|
+
<sc-placeholder
|
|
8
|
+
name="headless-header"
|
|
9
|
+
[rendering]="route"
|
|
10
|
+
(loaded)="onPlaceholderLoaded($event)"
|
|
11
|
+
></sc-placeholder>
|
|
12
|
+
</div>
|
|
13
|
+
</header>
|
|
14
|
+
<main>
|
|
15
|
+
<div id="content">
|
|
16
|
+
<sc-placeholder
|
|
17
|
+
name="headless-main"
|
|
18
|
+
[rendering]="route"
|
|
19
|
+
(loaded)="onPlaceholderLoaded($event)"
|
|
20
|
+
></sc-placeholder>
|
|
21
|
+
</div>
|
|
22
|
+
</main>
|
|
23
|
+
<footer>
|
|
24
|
+
<div id="footer">
|
|
25
|
+
<sc-placeholder
|
|
26
|
+
name="headless-footer"
|
|
27
|
+
[rendering]="route"
|
|
28
|
+
(loaded)="onMainPlaceholderLoaded($event)"
|
|
29
|
+
></sc-placeholder>
|
|
30
|
+
</div>
|
|
31
|
+
</footer>
|
|
32
|
+
</ng-container>
|
|
33
|
+
|
|
34
|
+
<app-not-found
|
|
35
|
+
*ngIf="state === LayoutState.NotFound"
|
|
36
|
+
[errorContextData]="errorContextData"
|
|
37
|
+
></app-not-found>
|
|
38
|
+
<app-server-error *ngIf="state === LayoutState.Error"></app-server-error>
|
|
39
|
+
</div>
|
|
@@ -0,0 +1,111 @@
|
|
|
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
|
+
|
|
15
|
+
enum LayoutState {
|
|
16
|
+
Layout,
|
|
17
|
+
NotFound,
|
|
18
|
+
Error,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface RouteFields {
|
|
22
|
+
[name: string]: unknown;
|
|
23
|
+
pageTitle: Field<string>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@Component({
|
|
27
|
+
selector: 'app-layout',
|
|
28
|
+
templateUrl: './layout.component.html',
|
|
29
|
+
})
|
|
30
|
+
export class LayoutComponent implements OnInit, OnDestroy {
|
|
31
|
+
route: RouteData<RouteFields>;
|
|
32
|
+
state: LayoutState;
|
|
33
|
+
LayoutState = LayoutState;
|
|
34
|
+
subscription: Subscription;
|
|
35
|
+
errorContextData: LayoutServiceContextData;
|
|
36
|
+
mainClassPageEditing: string;
|
|
37
|
+
|
|
38
|
+
constructor(
|
|
39
|
+
private activatedRoute: ActivatedRoute,
|
|
40
|
+
private readonly meta: JssMetaService,
|
|
41
|
+
private linkService: JssLinkService
|
|
42
|
+
) {}
|
|
43
|
+
|
|
44
|
+
ngOnInit() {
|
|
45
|
+
// route data is populated by the JssRouteResolver
|
|
46
|
+
this.subscription = this.activatedRoute.data.subscribe(
|
|
47
|
+
(data: { jssState: JssState<RouteFields> }) => {
|
|
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
|
+
/** TODO: get contextId and edgeUrl properly **/
|
|
62
|
+
const sitecoreEdgeContextId = '';
|
|
63
|
+
const sitecoreEdgeUrl = '';
|
|
64
|
+
const contentStyles = getContentStylesheetLink(
|
|
65
|
+
{ sitecore: data.jssState.sitecore },
|
|
66
|
+
sitecoreEdgeContextId,
|
|
67
|
+
sitecoreEdgeUrl
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
// Clear existing stylesheets
|
|
71
|
+
this.linkService.removeLinksByRel('stylesheet');
|
|
72
|
+
|
|
73
|
+
if (contentStyles) {
|
|
74
|
+
this.linkService.addHeadLinks(contentStyles);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (data.jssState.routeFetchError) {
|
|
79
|
+
if (
|
|
80
|
+
data.jssState.routeFetchError.status >= 400 &&
|
|
81
|
+
data.jssState.routeFetchError.status < 500
|
|
82
|
+
) {
|
|
83
|
+
this.state = LayoutState.NotFound;
|
|
84
|
+
} else {
|
|
85
|
+
this.state = LayoutState.Error;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
this.errorContextData =
|
|
89
|
+
data.jssState.routeFetchError.data && data.jssState.routeFetchError.data.sitecore;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
ngOnDestroy() {
|
|
96
|
+
// important to unsubscribe when the component is destroyed
|
|
97
|
+
this.subscription.unsubscribe();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
setMetadata(routeFields: RouteFields) {
|
|
101
|
+
// set page title, if it exists
|
|
102
|
+
if (routeFields && routeFields.pageTitle) {
|
|
103
|
+
this.meta.setTitle(routeFields.pageTitle.value || 'Page');
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
onMainPlaceholderLoaded(_placeholderName: string) {
|
|
108
|
+
// you may optionally hook to the loaded event for a placeholder,
|
|
109
|
+
// which can be useful for analytics and other DOM-based things that need to know when a placeholder's content is available.
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
flex-direction: column-reverse;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
header {
|
|
17
|
+
#header {
|
|
18
|
+
.bs-title {
|
|
19
|
+
padding-left: 50px;
|
|
20
|
+
|
|
21
|
+
h1 {
|
|
22
|
+
font-size: $text-size-24;
|
|
23
|
+
font-weight: 600;
|
|
24
|
+
line-height: 18px;
|
|
25
|
+
padding-top: 40px;
|
|
26
|
+
margin: 0;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@include respond-to(mobile-large) {
|
|
31
|
+
padding-bottom: 0;
|
|
32
|
+
padding-top: 0;
|
|
33
|
+
flex-direction: column-reverse;
|
|
34
|
+
|
|
35
|
+
.bs-title {
|
|
36
|
+
padding-left: 0;
|
|
37
|
+
text-align: center;
|
|
38
|
+
margin-top: -5px;
|
|
39
|
+
|
|
40
|
+
h1 {
|
|
41
|
+
font-weight: 500;
|
|
42
|
+
line-height: 29px;
|
|
43
|
+
padding-top: 0;
|
|
44
|
+
margin-bottom: 10px;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|