create-sitecore-jss 22.2.0-canary.31 → 22.2.0-canary.33

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,23 @@
1
+ <div class="component promo {{ styles }}" [attr.id]="id">
2
+ <div class="component-content">
3
+ <ng-container *ngIf="rendering.fields; else empty">
4
+ <div class="field-promoicon">
5
+ <img *scImage="rendering.fields.PromoIcon" />
6
+ </div>
7
+ <div class="promo-text">
8
+ <div>
9
+ <div class="field-promotext">
10
+ <div *scRichText="rendering.fields.PromoText"></div>
11
+ </div>
12
+ </div>
13
+ <div class="field-promolink">
14
+ <a *scLink="rendering.fields.PromoLink"></a>
15
+ </div>
16
+ </div>
17
+ </ng-container>
18
+ </div>
19
+ </div>
20
+
21
+ <ng-template #empty>
22
+ <span className="is-empty-hint">Promo</span>
23
+ </ng-template>
@@ -0,0 +1,8 @@
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
+ })
8
+ export class PromoComponent extends SxaComponent {}
@@ -0,0 +1,10 @@
1
+ <div class="component row-splitter" [ngClass]="rowSplitterStyles" [attr.id]="id">
2
+ <div *ngFor="let ph of enabledPlaceholders" class="container-fluid" [ngClass]="getRowClass(+ph - 1)">
3
+ <div>
4
+ <div class="row">
5
+ <sc-placeholder [name]="getPlaceholderName(ph)" [rendering]="rendering">
6
+ </sc-placeholder>
7
+ </div>
8
+ </div>
9
+ </div>
10
+ </div>
@@ -0,0 +1,30 @@
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
+ })
8
+ export class RowSplitterComponent extends SxaComponent {
9
+ get rowSplitterStyles(): string {
10
+ return `${this.rendering.params.GridParameters ?? ''} ${this.rendering.params.Styles ??
11
+ ''}`.trimEnd();
12
+ }
13
+
14
+ get rowStyles(): string[] {
15
+ return Array.from({ length: 8 }, (_, i) => this.rendering.params[`Styles${i + 1}`]);
16
+ }
17
+
18
+ get enabledPlaceholders(): string[] {
19
+ return this.rendering.params.EnabledPlaceholders.split(',');
20
+ }
21
+
22
+ getRowClass(index: number): string {
23
+ const styleClass = this.rowStyles[index] || '';
24
+ return `${styleClass}`.trim();
25
+ }
26
+
27
+ getPlaceholderName(ph: string): string {
28
+ return `row-${ph}-{*}`;
29
+ }
30
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-sitecore-jss",
3
- "version": "22.2.0-canary.31",
3
+ "version": "22.2.0-canary.33",
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": "7fba0bcdf1dc62589ca6fe799ad6b307d4dd1672"
66
+ "gitHead": "7c31699ed07f68f22eca9a7b252ed66ecda5d636"
67
67
  }