create-sitecore-jss 22.2.0-canary.36 → 22.2.0-canary.37

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.
@@ -0,0 +1,7 @@
1
+ <div class="component content {{styles}}" [attr.id]="id">
2
+ <div class="component-content">
3
+ <div class="field-content">
4
+ <div *scRichText="content || contextContent"></div>
5
+ </div>
6
+ </div>
7
+ </div>
@@ -0,0 +1,34 @@
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
+ })
11
+ export class PageContentComponent extends SxaComponent implements OnInit, OnDestroy {
12
+ content?: RichTextField;
13
+ contextContent?: RichTextField;
14
+ private contextSubscription: Subscription;
15
+
16
+ constructor(private jssContext: JssContextService) {
17
+ super();
18
+ }
19
+ ngOnInit() {
20
+ super.ngOnInit();
21
+
22
+ this.content = this.rendering.fields?.Content as RichTextField;
23
+ this.contextSubscription = this.jssContext.state.subscribe((newState) => {
24
+ this.contextContent =
25
+ newState.sitecore && (newState.sitecore.route.fields.Content as RichTextField);
26
+ });
27
+ }
28
+
29
+ ngOnDestroy() {
30
+ if (this.contextSubscription) {
31
+ this.contextSubscription.unsubscribe();
32
+ }
33
+ }
34
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-sitecore-jss",
3
- "version": "22.2.0-canary.36",
3
+ "version": "22.2.0-canary.37",
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": "6c05bf93afe6709e8e730a1912b5eb9be9c65881"
66
+ "gitHead": "2f18bc17c4728742b8ba81f1df2c237d4102d14c"
67
67
  }