create-sitecore-jss 22.2.0-canary.72 → 22.2.0-canary.74

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.
@@ -8,6 +8,8 @@
8
8
  "prepare:proxy-build": "ts-node --project src/tsconfig.webpack-server.json ./scripts/proxy-build.ts"
9
9
  },
10
10
  "dependencies": {
11
+ "@sitecore-cloudsdk/core": "^0.4.0-rc.0",
12
+ "@sitecore-cloudsdk/events": "^0.4.0-rc.0",
11
13
  "font-awesome": "^4.7.0",
12
14
  "sass": "^1.52.3",
13
15
  "sass-alias": "^1.0.5"
@@ -0,0 +1,32 @@
1
+ import { Component, OnInit } from '@angular/core';
2
+ import { CloudSDK } from '@sitecore-cloudsdk/core/browser';
3
+ import '@sitecore-cloudsdk/events/browser';
4
+ import { environment } from '../../../environments/environment';
5
+ import { isServer } from '@sitecore-jss/sitecore-jss-angular';
6
+
7
+ /**
8
+ * Component to init CloudSDK logic - to allow events throughout the site
9
+ */
10
+ @Component({
11
+ selector: 'app-cloud-sdk-init',
12
+ template: '',
13
+ })
14
+ export class CloudSdkInitComponent implements OnInit {
15
+ constructor() {}
16
+
17
+ ngOnInit(): void {
18
+ if (!isServer) {
19
+ CloudSDK({
20
+ siteName: environment.sitecoreSiteName,
21
+ sitecoreEdgeUrl: environment.sitecoreEdgeUrl,
22
+ sitecoreEdgeContextId: environment.sitecoreEdgeContextId,
23
+ // Replace with the top level cookie domain of the website that is being integrated e.g ".example.com" and not "www.example.com"
24
+ cookieDomain: window.location.hostname.replace(/^www\./, ''),
25
+ // Cookie may be created in personalize middleware (server), but if not we should create it here
26
+ enableBrowserCookie: true,
27
+ })
28
+ .addEvents()
29
+ .initialize();
30
+ }
31
+ }
32
+ }
@@ -1,3 +1,4 @@
1
1
  <ng-container>
2
2
  <sc-editing-scripts></sc-editing-scripts>
3
+ <app-cloud-sdk-init></app-cloud-sdk-init>
3
4
  </ng-container>
@@ -1,10 +1,11 @@
1
1
  import { NgModule } from '@angular/core';
2
2
  import { ScriptsComponent } from './scripts.component';
3
3
  import { JssModule } from '@sitecore-jss/sitecore-jss-angular';
4
+ import { CloudSdkInitComponent } from './cloud-sdk-init.component';
4
5
 
5
6
  @NgModule({
6
7
  exports: [ScriptsComponent],
7
8
  imports: [JssModule],
8
- declarations: [ScriptsComponent],
9
+ declarations: [ScriptsComponent, CloudSdkInitComponent],
9
10
  })
10
11
  export class ScriptsModule {}
@@ -2,6 +2,8 @@
2
2
  @import '~bootstrap/scss/variables';
3
3
  @import '~bootstrap/scss/mixins';
4
4
 
5
+ $breakpoints: sm, md, lg, xl, xxl;
6
+
5
7
  .position-left,
6
8
  .position-left * {
7
9
  text-align: left !important;
@@ -29,57 +31,23 @@
29
31
  text-align-last: center !important;
30
32
  }
31
33
 
32
- @include media-breakpoint-up(sm) {
33
- .ms-sm-auto {
34
- margin-left: auto !important;
35
- margin-right: 0 !important;
36
- }
37
- .me-sm-auto {
38
- margin-right: auto !important;
39
- margin-left: 0 !important;
40
- }
41
- }
42
-
43
- @include media-breakpoint-up(md) {
44
- .ms-md-auto {
45
- margin-left: auto !important;
46
- margin-right: 0 !important;
47
- }
48
- .me-md-auto {
49
- margin-right: auto !important;
50
- margin-left: 0 !important;
51
- }
52
- }
53
-
54
- @include media-breakpoint-up(lg) {
55
- .ms-lg-auto {
56
- margin-left: auto !important;
57
- margin-right: 0 !important;
58
- }
59
- .me-lg-auto {
60
- margin-right: auto !important;
61
- margin-left: 0 !important;
62
- }
63
- }
64
-
65
- @include media-breakpoint-up(xl) {
66
- .ms-xl-auto {
67
- margin-left: auto !important;
68
- margin-right: 0 !important;
69
- }
70
- .me-xl-auto {
71
- margin-right: auto !important;
72
- margin-left: 0 !important;
34
+ @mixin auto-margins($breakpoint) {
35
+ @include media-breakpoint-up(#{$breakpoint}) {
36
+ .ms-#{$breakpoint}-auto {
37
+ margin-left: auto !important;
38
+ margin-right: 0 !important;
39
+ }
40
+ .me-#{$breakpoint}-auto {
41
+ margin-right: auto !important;
42
+ margin-left: 0 !important;
43
+ }
44
+ .mx-#{$breakpoint}-auto {
45
+ margin-right: auto !important;
46
+ margin-left: auto !important;
47
+ }
73
48
  }
74
49
  }
75
50
 
76
- @include media-breakpoint-up(xxl) {
77
- .ms-xxl-auto {
78
- margin-left: auto !important;
79
- margin-right: 0 !important;
80
- }
81
- .me-xxl-auto {
82
- margin-right: auto !important;
83
- margin-left: 0 !important;
84
- }
51
+ @each $breakpoint in $breakpoints {
52
+ @include auto-margins($breakpoint);
85
53
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-sitecore-jss",
3
- "version": "22.2.0-canary.72",
3
+ "version": "22.2.0-canary.74",
4
4
  "description": "Sitecore JSS initializer",
5
5
  "bin": "./dist/index.js",
6
6
  "scripts": {
@@ -63,5 +63,5 @@
63
63
  "ts-node": "^10.9.1",
64
64
  "typescript": "~4.9.5"
65
65
  },
66
- "gitHead": "f91f33440e5eef9368abd32dabf62a7883a39f5b"
66
+ "gitHead": "1adfe83c042804e1316cd8e78c2f4965fb995850"
67
67
  }