create-sitecore-jss 22.2.0-canary.3 → 22.2.0-canary.5

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,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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-sitecore-jss",
3
- "version": "22.2.0-canary.3",
3
+ "version": "22.2.0-canary.5",
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": "04f6c9e59f3ca0b31f4f575c9cf3ee93d6b88f61"
66
+ "gitHead": "a37f9a68fe0447aed16ae317d1881ac9209c3c22"
67
67
  }