@ng-prism/core 21.10.0 → 21.10.2

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.
@@ -1,9 +1,11 @@
1
1
  import { PrismCanvasService, type CanvasBg } from '../services/prism-canvas.service.js';
2
2
  import { PrismVariantBgService } from '../services/prism-variant-bg.service.js';
3
+ import { PrismLayoutService } from '../services/prism-layout.service.js';
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class PrismCanvasToolbarComponent {
5
6
  protected readonly canvas: PrismCanvasService;
6
7
  protected readonly variantBg: PrismVariantBgService;
8
+ protected readonly layout: PrismLayoutService;
7
9
  protected setBg(bg: CanvasBg): void;
8
10
  protected readonly bgs: CanvasBg[];
9
11
  protected readonly zooms: {
@@ -1 +1 @@
1
- {"version":3,"file":"prism-canvas-toolbar.component.d.ts","sourceRoot":"","sources":["../../../src/app/canvas/prism-canvas-toolbar.component.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAClB,KAAK,QAAQ,EACd,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;;AAEhF,qBAgJa,2BAA2B;IACtC,SAAS,CAAC,QAAQ,CAAC,MAAM,qBAA8B;IACvD,SAAS,CAAC,QAAQ,CAAC,SAAS,wBAAiC;IAE7D,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI;IAQnC,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,CAMhC;IACF,SAAS,CAAC,QAAQ,CAAC,KAAK;;;QAKtB;IAEF,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;yCA1B5B,2BAA2B;2CAA3B,2BAA2B;CA6BvC"}
1
+ {"version":3,"file":"prism-canvas-toolbar.component.d.ts","sourceRoot":"","sources":["../../../src/app/canvas/prism-canvas-toolbar.component.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAClB,KAAK,QAAQ,EACd,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;;AAEzE,qBA+Ka,2BAA2B;IACtC,SAAS,CAAC,QAAQ,CAAC,MAAM,qBAA8B;IACvD,SAAS,CAAC,QAAQ,CAAC,SAAS,wBAAiC;IAC7D,SAAS,CAAC,QAAQ,CAAC,MAAM,qBAA8B;IAEvD,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI;IAQnC,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,CAMhC;IACF,SAAS,CAAC,QAAQ,CAAC,KAAK;;;QAKtB;IAEF,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;yCA3B5B,2BAA2B;2CAA3B,2BAA2B;CA8BvC"}
@@ -2,19 +2,20 @@ import { Component, inject, ChangeDetectionStrategy } from '@angular/core';
2
2
  import { PrismIconComponent } from '../icons/prism-icon.component.js';
3
3
  import { PrismCanvasService, } from '../services/prism-canvas.service.js';
4
4
  import { PrismVariantBgService } from '../services/prism-variant-bg.service.js';
5
+ import { PrismLayoutService } from '../services/prism-layout.service.js';
5
6
  import * as i0 from "@angular/core";
6
7
  const _forTrack0 = ($index, $item) => $item.value;
7
8
  function PrismCanvasToolbarComponent_For_5_Conditional_1_Template(rf, ctx) { if (rf & 1) {
8
9
  i0.ɵɵnamespaceSVG();
9
- i0.ɵɵelementStart(0, "svg", 11);
10
- i0.ɵɵelement(1, "path", 12);
10
+ i0.ɵɵelementStart(0, "svg", 14);
11
+ i0.ɵɵelement(1, "path", 15);
11
12
  i0.ɵɵelementEnd();
12
13
  } }
13
14
  function PrismCanvasToolbarComponent_For_5_Template(rf, ctx) { if (rf & 1) {
14
15
  const _r1 = i0.ɵɵgetCurrentView();
15
- i0.ɵɵelementStart(0, "button", 10);
16
+ i0.ɵɵelementStart(0, "button", 13);
16
17
  i0.ɵɵlistener("click", function PrismCanvasToolbarComponent_For_5_Template_button_click_0_listener() { const bg_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.setBg(bg_r2)); });
17
- i0.ɵɵconditionalCreate(1, PrismCanvasToolbarComponent_For_5_Conditional_1_Template, 2, 0, ":svg:svg", 11);
18
+ i0.ɵɵconditionalCreate(1, PrismCanvasToolbarComponent_For_5_Conditional_1_Template, 2, 0, ":svg:svg", 14);
18
19
  i0.ɵɵtext(2);
19
20
  i0.ɵɵelementEnd();
20
21
  } if (rf & 2) {
@@ -29,7 +30,7 @@ function PrismCanvasToolbarComponent_For_5_Template(rf, ctx) { if (rf & 1) {
29
30
  } }
30
31
  function PrismCanvasToolbarComponent_For_11_Template(rf, ctx) { if (rf & 1) {
31
32
  const _r4 = i0.ɵɵgetCurrentView();
32
- i0.ɵɵelementStart(0, "button", 13);
33
+ i0.ɵɵelementStart(0, "button", 16);
33
34
  i0.ɵɵlistener("click", function PrismCanvasToolbarComponent_For_11_Template_button_click_0_listener() { const z_r5 = i0.ɵɵrestoreView(_r4).$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.canvas.setZoom(z_r5.value)); });
34
35
  i0.ɵɵtext(1);
35
36
  i0.ɵɵelementEnd();
@@ -43,6 +44,7 @@ function PrismCanvasToolbarComponent_For_11_Template(rf, ctx) { if (rf & 1) {
43
44
  export class PrismCanvasToolbarComponent {
44
45
  canvas = inject(PrismCanvasService);
45
46
  variantBg = inject(PrismVariantBgService);
47
+ layout = inject(PrismLayoutService);
46
48
  setBg(bg) {
47
49
  if (this.variantBg.recommended() !== null) {
48
50
  this.variantBg.setOverride(bg);
@@ -68,7 +70,7 @@ export class PrismCanvasToolbarComponent {
68
70
  return s.charAt(0).toUpperCase() + s.slice(1);
69
71
  }
70
72
  static ɵfac = function PrismCanvasToolbarComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PrismCanvasToolbarComponent)(); };
71
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PrismCanvasToolbarComponent, selectors: [["prism-canvas-toolbar"]], decls: 19, vars: 6, consts: [[1, "canvas-toolbar"], [1, "tool-label"], [1, "tool-group"], [1, "tool-btn", 3, "tool-btn--active", "tool-btn--recommended", "title"], [1, "tool-sep"], [1, "tool-btn", 3, "tool-btn--active"], ["title", "Toggle guides", "aria-label", "Toggle guides", 1, "tool-btn", 3, "click"], ["name", "crosshair", 3, "size"], ["title", "Toggle rulers", "aria-label", "Toggle rulers", 1, "tool-btn", 3, "click"], ["name", "move", 3, "size"], [1, "tool-btn", 3, "click", "title"], ["width", "11", "height", "11", "viewBox", "0 0 24 24", "fill", "#facc15", "aria-label", "Recommended", 1, "bg-star"], ["d", "M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01z"], [1, "tool-btn", 3, "click"]], template: function PrismCanvasToolbarComponent_Template(rf, ctx) { if (rf & 1) {
73
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PrismCanvasToolbarComponent, selectors: [["prism-canvas-toolbar"]], decls: 23, vars: 9, consts: [[1, "canvas-toolbar"], [1, "tool-label"], [1, "tool-group"], [1, "tool-btn", 3, "tool-btn--active", "tool-btn--recommended", "title"], [1, "tool-sep"], [1, "tool-btn", 3, "tool-btn--active"], ["title", "Toggle guides", "aria-label", "Toggle guides", 1, "tool-btn", 3, "click"], ["name", "crosshair", 3, "size"], ["title", "Toggle rulers", "aria-label", "Toggle rulers", 1, "tool-btn", 3, "click"], ["name", "move", 3, "size"], [1, "tool-spacer"], ["title", "Toggle Angular template", "aria-label", "Toggle Angular template", 1, "tool-btn", "tool-btn--tpl", 3, "click"], ["name", "code", 3, "size"], [1, "tool-btn", 3, "click", "title"], ["width", "11", "height", "11", "viewBox", "0 0 24 24", "fill", "#facc15", "aria-label", "Recommended", 1, "bg-star"], ["d", "M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01z"], [1, "tool-btn", 3, "click"]], template: function PrismCanvasToolbarComponent_Template(rf, ctx) { if (rf & 1) {
72
74
  i0.ɵɵelementStart(0, "div", 0)(1, "span", 1);
73
75
  i0.ɵɵtext(2, "Canvas");
74
76
  i0.ɵɵelementEnd();
@@ -92,6 +94,12 @@ export class PrismCanvasToolbarComponent {
92
94
  i0.ɵɵlistener("click", function PrismCanvasToolbarComponent_Template_button_click_16_listener() { return ctx.canvas.toggleRulers(); });
93
95
  i0.ɵɵelement(17, "prism-icon", 9);
94
96
  i0.ɵɵtext(18, " Rulers ");
97
+ i0.ɵɵelementEnd();
98
+ i0.ɵɵelement(19, "div", 10);
99
+ i0.ɵɵelementStart(20, "button", 11);
100
+ i0.ɵɵlistener("click", function PrismCanvasToolbarComponent_Template_button_click_20_listener() { return ctx.layout.toggleTemplatePopover(); });
101
+ i0.ɵɵelement(21, "prism-icon", 12);
102
+ i0.ɵɵtext(22, " Template ");
95
103
  i0.ɵɵelementEnd()();
96
104
  } if (rf & 2) {
97
105
  i0.ɵɵadvance(4);
@@ -106,7 +114,11 @@ export class PrismCanvasToolbarComponent {
106
114
  i0.ɵɵclassProp("tool-btn--active", ctx.canvas.rulers());
107
115
  i0.ɵɵadvance();
108
116
  i0.ɵɵproperty("size", 13);
109
- } }, dependencies: [PrismIconComponent], styles: [".canvas-toolbar[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 8px 20px;\n border-bottom: 1px solid var(--prism-border);\n background: var(--prism-bg);\n min-height: 44px;\n }\n\n .tool-group[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 1px;\n padding: 2px;\n background: var(--prism-input-bg);\n border: 1px solid var(--prism-border);\n border-radius: var(--radius-md);\n }\n\n .tool-btn[_ngcontent-%COMP%] {\n height: 24px;\n padding: 0 9px;\n border-radius: var(--radius-sm);\n display: flex;\n align-items: center;\n gap: 5px;\n font-size: var(--fs-sm);\n color: var(--prism-text-muted);\n transition: all var(--dur-fast);\n font-weight: 500;\n background: none;\n border: none;\n cursor: pointer;\n font-family: var(--font-sans);\n }\n .tool-btn[_ngcontent-%COMP%]:hover {\n color: var(--prism-text);\n background: color-mix(in srgb, var(--prism-primary) 8%, transparent);\n }\n .tool-btn--active[_ngcontent-%COMP%] {\n color: var(--prism-text);\n background: color-mix(in srgb, var(--prism-primary) 15%, transparent);\n box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--prism-primary) 30%, transparent);\n }\n .bg-star[_ngcontent-%COMP%] {\n flex-shrink: 0;\n filter: drop-shadow(0 0 2px rgba(250, 204, 21, 0.4));\n }\n\n .tool-sep[_ngcontent-%COMP%] {\n width: 1px;\n height: 18px;\n background: var(--prism-border);\n margin: 0 4px;\n }\n\n .tool-label[_ngcontent-%COMP%] {\n font-size: var(--fs-xs);\n color: var(--prism-text-ghost);\n text-transform: uppercase;\n letter-spacing: 0.08em;\n font-weight: 600;\n margin-right: 2px;\n }"], changeDetection: 0 });
117
+ i0.ɵɵadvance(3);
118
+ i0.ɵɵclassProp("tool-btn--tpl-active", ctx.layout.templatePopoverVisible());
119
+ i0.ɵɵadvance();
120
+ i0.ɵɵproperty("size", 13);
121
+ } }, dependencies: [PrismIconComponent], styles: [".canvas-toolbar[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 8px 20px;\n border-bottom: 1px solid var(--prism-border);\n background: var(--prism-bg);\n min-height: 44px;\n }\n\n .tool-group[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 1px;\n padding: 2px;\n background: var(--prism-input-bg);\n border: 1px solid var(--prism-border);\n border-radius: var(--radius-md);\n }\n\n .tool-btn[_ngcontent-%COMP%] {\n height: 24px;\n padding: 0 9px;\n border-radius: var(--radius-sm);\n display: flex;\n align-items: center;\n gap: 5px;\n font-size: var(--fs-sm);\n color: var(--prism-text-muted);\n transition: all var(--dur-fast);\n font-weight: 500;\n background: none;\n border: none;\n cursor: pointer;\n font-family: var(--font-sans);\n }\n .tool-btn[_ngcontent-%COMP%]:hover {\n color: var(--prism-text);\n background: color-mix(in srgb, var(--prism-primary) 8%, transparent);\n }\n .tool-btn--active[_ngcontent-%COMP%] {\n color: var(--prism-text);\n background: color-mix(in srgb, var(--prism-primary) 15%, transparent);\n box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--prism-primary) 30%, transparent);\n }\n .bg-star[_ngcontent-%COMP%] {\n flex-shrink: 0;\n filter: drop-shadow(0 0 2px rgba(250, 204, 21, 0.4));\n }\n\n .tool-sep[_ngcontent-%COMP%] {\n width: 1px;\n height: 18px;\n background: var(--prism-border);\n margin: 0 4px;\n }\n\n .tool-label[_ngcontent-%COMP%] {\n font-size: var(--fs-xs);\n color: var(--prism-text-ghost);\n text-transform: uppercase;\n letter-spacing: 0.08em;\n font-weight: 600;\n margin-right: 2px;\n }\n\n .tool-spacer[_ngcontent-%COMP%] { flex: 1; }\n\n .tool-btn--tpl[_ngcontent-%COMP%] {\n color: var(--prism-primary);\n background: color-mix(in srgb, var(--prism-primary) 10%, transparent);\n border: 1px solid\n color-mix(in srgb, var(--prism-primary) 25%, transparent);\n font-family: var(--font-mono);\n }\n .tool-btn--tpl[_ngcontent-%COMP%]:hover {\n color: var(--prism-primary);\n background: color-mix(in srgb, var(--prism-primary) 18%, transparent);\n }\n .tool-btn--tpl.tool-btn--tpl-active[_ngcontent-%COMP%] {\n background: color-mix(in srgb, var(--prism-primary) 22%, transparent);\n box-shadow: inset 0 0 0 1px\n color-mix(in srgb, var(--prism-primary) 35%, transparent);\n }"], changeDetection: 0 });
110
122
  }
111
123
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PrismCanvasToolbarComponent, [{
112
124
  type: Component,
@@ -178,7 +190,20 @@ export class PrismCanvasToolbarComponent {
178
190
  <prism-icon name="move" [size]="13" />
179
191
  Rulers
180
192
  </button>
193
+
194
+ <div class="tool-spacer"></div>
195
+
196
+ <button
197
+ class="tool-btn tool-btn--tpl"
198
+ [class.tool-btn--tpl-active]="layout.templatePopoverVisible()"
199
+ (click)="layout.toggleTemplatePopover()"
200
+ title="Toggle Angular template"
201
+ aria-label="Toggle Angular template"
202
+ >
203
+ <prism-icon name="code" [size]="13" />
204
+ Template
205
+ </button>
181
206
  </div>
182
- `, styles: ["\n .canvas-toolbar {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 8px 20px;\n border-bottom: 1px solid var(--prism-border);\n background: var(--prism-bg);\n min-height: 44px;\n }\n\n .tool-group {\n display: flex;\n align-items: center;\n gap: 1px;\n padding: 2px;\n background: var(--prism-input-bg);\n border: 1px solid var(--prism-border);\n border-radius: var(--radius-md);\n }\n\n .tool-btn {\n height: 24px;\n padding: 0 9px;\n border-radius: var(--radius-sm);\n display: flex;\n align-items: center;\n gap: 5px;\n font-size: var(--fs-sm);\n color: var(--prism-text-muted);\n transition: all var(--dur-fast);\n font-weight: 500;\n background: none;\n border: none;\n cursor: pointer;\n font-family: var(--font-sans);\n }\n .tool-btn:hover {\n color: var(--prism-text);\n background: color-mix(in srgb, var(--prism-primary) 8%, transparent);\n }\n .tool-btn--active {\n color: var(--prism-text);\n background: color-mix(in srgb, var(--prism-primary) 15%, transparent);\n box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--prism-primary) 30%, transparent);\n }\n .bg-star {\n flex-shrink: 0;\n filter: drop-shadow(0 0 2px rgba(250, 204, 21, 0.4));\n }\n\n .tool-sep {\n width: 1px;\n height: 18px;\n background: var(--prism-border);\n margin: 0 4px;\n }\n\n .tool-label {\n font-size: var(--fs-xs);\n color: var(--prism-text-ghost);\n text-transform: uppercase;\n letter-spacing: 0.08em;\n font-weight: 600;\n margin-right: 2px;\n }\n\n "] }]
207
+ `, styles: ["\n .canvas-toolbar {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 8px 20px;\n border-bottom: 1px solid var(--prism-border);\n background: var(--prism-bg);\n min-height: 44px;\n }\n\n .tool-group {\n display: flex;\n align-items: center;\n gap: 1px;\n padding: 2px;\n background: var(--prism-input-bg);\n border: 1px solid var(--prism-border);\n border-radius: var(--radius-md);\n }\n\n .tool-btn {\n height: 24px;\n padding: 0 9px;\n border-radius: var(--radius-sm);\n display: flex;\n align-items: center;\n gap: 5px;\n font-size: var(--fs-sm);\n color: var(--prism-text-muted);\n transition: all var(--dur-fast);\n font-weight: 500;\n background: none;\n border: none;\n cursor: pointer;\n font-family: var(--font-sans);\n }\n .tool-btn:hover {\n color: var(--prism-text);\n background: color-mix(in srgb, var(--prism-primary) 8%, transparent);\n }\n .tool-btn--active {\n color: var(--prism-text);\n background: color-mix(in srgb, var(--prism-primary) 15%, transparent);\n box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--prism-primary) 30%, transparent);\n }\n .bg-star {\n flex-shrink: 0;\n filter: drop-shadow(0 0 2px rgba(250, 204, 21, 0.4));\n }\n\n .tool-sep {\n width: 1px;\n height: 18px;\n background: var(--prism-border);\n margin: 0 4px;\n }\n\n .tool-label {\n font-size: var(--fs-xs);\n color: var(--prism-text-ghost);\n text-transform: uppercase;\n letter-spacing: 0.08em;\n font-weight: 600;\n margin-right: 2px;\n }\n\n .tool-spacer { flex: 1; }\n\n .tool-btn--tpl {\n color: var(--prism-primary);\n background: color-mix(in srgb, var(--prism-primary) 10%, transparent);\n border: 1px solid\n color-mix(in srgb, var(--prism-primary) 25%, transparent);\n font-family: var(--font-mono);\n }\n .tool-btn--tpl:hover {\n color: var(--prism-primary);\n background: color-mix(in srgb, var(--prism-primary) 18%, transparent);\n }\n .tool-btn--tpl.tool-btn--tpl-active {\n background: color-mix(in srgb, var(--prism-primary) 22%, transparent);\n box-shadow: inset 0 0 0 1px\n color-mix(in srgb, var(--prism-primary) 35%, transparent);\n }\n "] }]
183
208
  }], null, null); })();
184
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismCanvasToolbarComponent, { className: "PrismCanvasToolbarComponent", filePath: "app/canvas/prism-canvas-toolbar.component.ts", lineNumber: 153 }); })();
209
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismCanvasToolbarComponent, { className: "PrismCanvasToolbarComponent", filePath: "app/canvas/prism-canvas-toolbar.component.ts", lineNumber: 185 }); })();
@@ -0,0 +1,16 @@
1
+ import { PrismLayoutService } from '../services/prism-layout.service.js';
2
+ import * as i0 from "@angular/core";
3
+ export declare class PrismTemplatePopoverComponent {
4
+ private readonly navigationService;
5
+ private readonly rendererService;
6
+ protected readonly layoutService: PrismLayoutService;
7
+ protected readonly copied: import("@angular/core").WritableSignal<boolean>;
8
+ private copiedResetTimer;
9
+ protected readonly snippet: import("@angular/core").Signal<string>;
10
+ protected readonly highlighted: import("@angular/core").Signal<string>;
11
+ protected copy(): void;
12
+ protected onEscape(): void;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<PrismTemplatePopoverComponent, never>;
14
+ static ɵcmp: i0.ɵɵComponentDeclaration<PrismTemplatePopoverComponent, "prism-template-popover", never, {}, {}, never, never, true, never>;
15
+ }
16
+ //# sourceMappingURL=prism-template-popover.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prism-template-popover.component.d.ts","sourceRoot":"","sources":["../../../src/app/canvas/prism-template-popover.component.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;;AAkCzE,qBAkKa,6BAA6B;IACxC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAkC;IACpE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAgC;IAChE,SAAS,CAAC,QAAQ,CAAC,aAAa,qBAA8B;IAE9D,SAAS,CAAC,QAAQ,CAAC,MAAM,kDAAiB;IAC1C,OAAO,CAAC,gBAAgB,CAA8C;IAEtE,SAAS,CAAC,QAAQ,CAAC,OAAO,yCAqBvB;IAEH,SAAS,CAAC,QAAQ,CAAC,WAAW,yCAI3B;IAEH,SAAS,CAAC,IAAI,IAAI,IAAI;IAUtB,SAAS,CAAC,QAAQ,IAAI,IAAI;yCA/Cf,6BAA6B;2CAA7B,6BAA6B;CAoDzC"}
@@ -0,0 +1,162 @@
1
+ import { Component, inject, computed, signal, ChangeDetectionStrategy, HostListener, } from '@angular/core';
2
+ import { PrismIconComponent } from '../icons/prism-icon.component.js';
3
+ import { PrismLayoutService } from '../services/prism-layout.service.js';
4
+ import { PrismNavigationService } from '../services/prism-navigation.service.js';
5
+ import { PrismRendererService } from '../services/prism-renderer.service.js';
6
+ import { generateSnippet } from '../renderer/snippet-generator.js';
7
+ import * as i0 from "@angular/core";
8
+ function PrismTemplatePopoverComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
9
+ const _r1 = i0.ɵɵgetCurrentView();
10
+ i0.ɵɵelementStart(0, "div", 1);
11
+ i0.ɵɵlistener("click", function PrismTemplatePopoverComponent_Conditional_0_Template_div_click_0_listener($event) { return $event.stopPropagation(); });
12
+ i0.ɵɵelementStart(1, "div", 2);
13
+ i0.ɵɵelement(2, "prism-icon", 3);
14
+ i0.ɵɵelementStart(3, "span");
15
+ i0.ɵɵtext(4, "Angular Template");
16
+ i0.ɵɵelementEnd();
17
+ i0.ɵɵelementStart(5, "button", 4);
18
+ i0.ɵɵlistener("click", function PrismTemplatePopoverComponent_Conditional_0_Template_button_click_5_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.copy()); });
19
+ i0.ɵɵelement(6, "prism-icon", 5);
20
+ i0.ɵɵtext(7);
21
+ i0.ɵɵelementEnd();
22
+ i0.ɵɵelementStart(8, "button", 6);
23
+ i0.ɵɵlistener("click", function PrismTemplatePopoverComponent_Conditional_0_Template_button_click_8_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.layoutService.closeTemplatePopover()); });
24
+ i0.ɵɵelement(9, "prism-icon", 7);
25
+ i0.ɵɵelementEnd()();
26
+ i0.ɵɵelement(10, "pre", 8);
27
+ i0.ɵɵelementEnd();
28
+ } if (rf & 2) {
29
+ const ctx_r1 = i0.ɵɵnextContext();
30
+ i0.ɵɵadvance(2);
31
+ i0.ɵɵproperty("size", 13);
32
+ i0.ɵɵadvance(3);
33
+ i0.ɵɵproperty("title", ctx_r1.copied() ? "Copied!" : "Copy to clipboard");
34
+ i0.ɵɵadvance();
35
+ i0.ɵɵproperty("name", ctx_r1.copied() ? "shield-check" : "copy")("size", 12);
36
+ i0.ɵɵadvance();
37
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.copied() ? "Copied" : "Copy", " ");
38
+ i0.ɵɵadvance(2);
39
+ i0.ɵɵproperty("size", 13);
40
+ i0.ɵɵadvance();
41
+ i0.ɵɵproperty("innerHTML", ctx_r1.highlighted(), i0.ɵɵsanitizeHtml);
42
+ } }
43
+ function esc(s) {
44
+ return s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
45
+ }
46
+ function tokenizeXml(code) {
47
+ const re = /(\/\/[^\n]*)|(<\/?[\w-]+)|(\[[\w.]+\]|[\w-]+)=|"([^"]*)"|(\/>|>)|(\n)|([^<\["\n/>=]+|[/=])/g;
48
+ let out = '';
49
+ let m;
50
+ while ((m = re.exec(code)) !== null) {
51
+ if (m[1] != null) {
52
+ out += `<span class="tok-com">${esc(m[1])}</span>`;
53
+ }
54
+ else if (m[2] != null) {
55
+ out += `<span class="tok-tag">${esc(m[2])}</span>`;
56
+ }
57
+ else if (m[3] != null) {
58
+ out += `<span class="tok-attr">${esc(m[3])}</span>=`;
59
+ }
60
+ else if (m[4] != null) {
61
+ out += `"<span class="tok-str">${esc(m[4])}</span>"`;
62
+ }
63
+ else if (m[5] != null) {
64
+ out += `<span class="tok-tag">${esc(m[5])}</span>`;
65
+ }
66
+ else if (m[6] != null) {
67
+ out += '\n';
68
+ }
69
+ else {
70
+ out += esc(m[0]);
71
+ }
72
+ }
73
+ return out;
74
+ }
75
+ export class PrismTemplatePopoverComponent {
76
+ navigationService = inject(PrismNavigationService);
77
+ rendererService = inject(PrismRendererService);
78
+ layoutService = inject(PrismLayoutService);
79
+ copied = signal(false, ...(ngDevMode ? [{ debugName: "copied" }] : []));
80
+ copiedResetTimer = null;
81
+ snippet = computed(() => {
82
+ const comp = this.navigationService.activeComponent();
83
+ if (!comp)
84
+ return '';
85
+ const variant = comp.meta.showcaseConfig.variants?.[this.rendererService.activeVariantIndex()];
86
+ const explicitKeys = variant?.inputs
87
+ ? new Set(Object.keys(variant.inputs))
88
+ : undefined;
89
+ const directiveOptions = comp.meta.componentMeta.isDirective
90
+ ? { host: comp.meta.showcaseConfig.host }
91
+ : undefined;
92
+ return generateSnippet(comp.meta.componentMeta.selector, comp.meta.inputs, this.rendererService.inputValues(), explicitKeys, this.rendererService.activeContent(), directiveOptions);
93
+ }, ...(ngDevMode ? [{ debugName: "snippet" }] : []));
94
+ highlighted = computed(() => {
95
+ const code = this.snippet();
96
+ if (!code)
97
+ return '';
98
+ return tokenizeXml(code);
99
+ }, ...(ngDevMode ? [{ debugName: "highlighted" }] : []));
100
+ copy() {
101
+ const code = this.snippet();
102
+ if (!code)
103
+ return;
104
+ navigator.clipboard?.writeText(code);
105
+ this.copied.set(true);
106
+ if (this.copiedResetTimer)
107
+ clearTimeout(this.copiedResetTimer);
108
+ this.copiedResetTimer = setTimeout(() => this.copied.set(false), 1500);
109
+ }
110
+ onEscape() {
111
+ if (this.layoutService.templatePopoverVisible()) {
112
+ this.layoutService.closeTemplatePopover();
113
+ }
114
+ }
115
+ static ɵfac = function PrismTemplatePopoverComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PrismTemplatePopoverComponent)(); };
116
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PrismTemplatePopoverComponent, selectors: [["prism-template-popover"]], hostBindings: function PrismTemplatePopoverComponent_HostBindings(rf, ctx) { if (rf & 1) {
117
+ i0.ɵɵlistener("keydown.escape", function PrismTemplatePopoverComponent_keydown_escape_HostBindingHandler() { return ctx.onEscape(); }, i0.ɵɵresolveDocument);
118
+ } }, decls: 1, vars: 1, consts: [["role", "dialog", "aria-label", "Angular template", 1, "tpl-popover"], ["role", "dialog", "aria-label", "Angular template", 1, "tpl-popover", 3, "click"], [1, "tpl-popover-head"], ["name", "code", 3, "size"], [1, "tpl-popover-copy", 3, "click", "title"], [3, "name", "size"], ["aria-label", "Close", "title", "Close (Esc)", 1, "tpl-popover-close", 3, "click"], ["name", "x", 3, "size"], [1, "tpl-popover-body", 3, "innerHTML"]], template: function PrismTemplatePopoverComponent_Template(rf, ctx) { if (rf & 1) {
119
+ i0.ɵɵconditionalCreate(0, PrismTemplatePopoverComponent_Conditional_0_Template, 11, 7, "div", 0);
120
+ } if (rf & 2) {
121
+ i0.ɵɵconditional(ctx.layoutService.templatePopoverVisible() ? 0 : -1);
122
+ } }, dependencies: [PrismIconComponent], styles: ["[_nghost-%COMP%] { display: contents; }\n\n .tpl-popover[_ngcontent-%COMP%] {\n position: absolute;\n right: 20px;\n top: 8px;\n width: 520px;\n max-width: calc(100% - 40px);\n max-height: min(420px, calc(100% - 16px));\n background: var(--prism-bg-elevated);\n border: 1px solid var(--prism-border-strong);\n border-radius: var(--radius-lg, 10px);\n box-shadow:\n 0 20px 60px rgba(0, 0, 0, 0.45),\n 0 0 0 1px color-mix(in srgb, var(--prism-primary) 10%, transparent);\n display: flex;\n flex-direction: column;\n z-index: 30;\n overflow: hidden;\n animation: _ngcontent-%COMP%_tpl-fade-in var(--dur-fast, 0.15s) var(--ease-default, ease-out);\n }\n\n @keyframes _ngcontent-%COMP%_tpl-fade-in {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n\n .tpl-popover-head[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 0 12px 0 16px;\n height: 40px;\n border-bottom: 1px solid var(--prism-border);\n background: linear-gradient(\n 180deg,\n var(--prism-bg-surface),\n var(--prism-bg-elevated)\n );\n flex-shrink: 0;\n }\n .tpl-popover-head[_ngcontent-%COMP%] > prism-icon[_ngcontent-%COMP%] {\n color: var(--prism-text-muted);\n }\n .tpl-popover-head[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] {\n flex: 1;\n font-size: var(--fs-xs);\n font-weight: 700;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n color: var(--prism-text-2);\n }\n\n .tpl-popover-copy[_ngcontent-%COMP%] {\n height: 26px;\n padding: 0 10px;\n font-size: var(--fs-sm);\n font-family: var(--font-sans);\n font-weight: 500;\n color: var(--prism-primary);\n background: color-mix(in srgb, var(--prism-primary) 12%, transparent);\n border: 1px solid color-mix(in srgb, var(--prism-primary) 25%, transparent);\n border-radius: var(--radius-sm, 5px);\n display: flex;\n align-items: center;\n gap: 5px;\n cursor: pointer;\n transition: background var(--dur-fast);\n }\n .tpl-popover-copy[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--prism-primary) 20%, transparent);\n }\n\n .tpl-popover-close[_ngcontent-%COMP%] {\n width: 26px;\n height: 26px;\n display: grid;\n place-items: center;\n border-radius: var(--radius-sm, 5px);\n color: var(--prism-text-muted);\n background: transparent;\n border: 0;\n cursor: pointer;\n transition: background var(--dur-fast), color var(--dur-fast);\n }\n .tpl-popover-close[_ngcontent-%COMP%]:hover {\n color: var(--prism-text);\n background: var(--prism-input-bg);\n }\n\n .tpl-popover-body[_ngcontent-%COMP%] {\n margin: 0;\n padding: 14px 18px;\n font-family: var(--font-mono);\n font-size: var(--fs-md);\n line-height: 1.7;\n color: var(--prism-text-2);\n overflow: auto;\n background: var(--prism-bg);\n flex: 1;\n min-height: 0;\n white-space: pre;\n }\n .tpl-popover-body[_ngcontent-%COMP%]::-webkit-scrollbar {\n width: 6px;\n height: 6px;\n }\n .tpl-popover-body[_ngcontent-%COMP%]::-webkit-scrollbar-thumb {\n background: var(--prism-border-strong);\n border-radius: 3px;\n }\n\n [_nghost-%COMP%] .tok-tag { color: var(--prism-code-tag); }\n [_nghost-%COMP%] .tok-attr { color: var(--prism-code-attr); }\n [_nghost-%COMP%] .tok-str { color: var(--prism-code-str); }\n [_nghost-%COMP%] .tok-com { color: var(--prism-code-com); font-style: italic; }"], changeDetection: 0 });
123
+ }
124
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PrismTemplatePopoverComponent, [{
125
+ type: Component,
126
+ args: [{ selector: 'prism-template-popover', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [PrismIconComponent], template: `
127
+ @if (layoutService.templatePopoverVisible()) {
128
+ <div
129
+ class="tpl-popover"
130
+ role="dialog"
131
+ aria-label="Angular template"
132
+ (click)="$event.stopPropagation()"
133
+ >
134
+ <div class="tpl-popover-head">
135
+ <prism-icon name="code" [size]="13" />
136
+ <span>Angular Template</span>
137
+ <button
138
+ class="tpl-popover-copy"
139
+ (click)="copy()"
140
+ [title]="copied() ? 'Copied!' : 'Copy to clipboard'"
141
+ >
142
+ <prism-icon [name]="copied() ? 'shield-check' : 'copy'" [size]="12" />
143
+ {{ copied() ? 'Copied' : 'Copy' }}
144
+ </button>
145
+ <button
146
+ class="tpl-popover-close"
147
+ (click)="layoutService.closeTemplatePopover()"
148
+ aria-label="Close"
149
+ title="Close (Esc)"
150
+ >
151
+ <prism-icon name="x" [size]="13" />
152
+ </button>
153
+ </div>
154
+ <pre class="tpl-popover-body" [innerHTML]="highlighted()"></pre>
155
+ </div>
156
+ }
157
+ `, styles: ["\n :host { display: contents; }\n\n .tpl-popover {\n position: absolute;\n right: 20px;\n top: 8px;\n width: 520px;\n max-width: calc(100% - 40px);\n max-height: min(420px, calc(100% - 16px));\n background: var(--prism-bg-elevated);\n border: 1px solid var(--prism-border-strong);\n border-radius: var(--radius-lg, 10px);\n box-shadow:\n 0 20px 60px rgba(0, 0, 0, 0.45),\n 0 0 0 1px color-mix(in srgb, var(--prism-primary) 10%, transparent);\n display: flex;\n flex-direction: column;\n z-index: 30;\n overflow: hidden;\n animation: tpl-fade-in var(--dur-fast, 0.15s) var(--ease-default, ease-out);\n }\n\n @keyframes tpl-fade-in {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n\n .tpl-popover-head {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 0 12px 0 16px;\n height: 40px;\n border-bottom: 1px solid var(--prism-border);\n background: linear-gradient(\n 180deg,\n var(--prism-bg-surface),\n var(--prism-bg-elevated)\n );\n flex-shrink: 0;\n }\n .tpl-popover-head > prism-icon {\n color: var(--prism-text-muted);\n }\n .tpl-popover-head > span {\n flex: 1;\n font-size: var(--fs-xs);\n font-weight: 700;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n color: var(--prism-text-2);\n }\n\n .tpl-popover-copy {\n height: 26px;\n padding: 0 10px;\n font-size: var(--fs-sm);\n font-family: var(--font-sans);\n font-weight: 500;\n color: var(--prism-primary);\n background: color-mix(in srgb, var(--prism-primary) 12%, transparent);\n border: 1px solid color-mix(in srgb, var(--prism-primary) 25%, transparent);\n border-radius: var(--radius-sm, 5px);\n display: flex;\n align-items: center;\n gap: 5px;\n cursor: pointer;\n transition: background var(--dur-fast);\n }\n .tpl-popover-copy:hover {\n background: color-mix(in srgb, var(--prism-primary) 20%, transparent);\n }\n\n .tpl-popover-close {\n width: 26px;\n height: 26px;\n display: grid;\n place-items: center;\n border-radius: var(--radius-sm, 5px);\n color: var(--prism-text-muted);\n background: transparent;\n border: 0;\n cursor: pointer;\n transition: background var(--dur-fast), color var(--dur-fast);\n }\n .tpl-popover-close:hover {\n color: var(--prism-text);\n background: var(--prism-input-bg);\n }\n\n .tpl-popover-body {\n margin: 0;\n padding: 14px 18px;\n font-family: var(--font-mono);\n font-size: var(--fs-md);\n line-height: 1.7;\n color: var(--prism-text-2);\n overflow: auto;\n background: var(--prism-bg);\n flex: 1;\n min-height: 0;\n white-space: pre;\n }\n .tpl-popover-body::-webkit-scrollbar {\n width: 6px;\n height: 6px;\n }\n .tpl-popover-body::-webkit-scrollbar-thumb {\n background: var(--prism-border-strong);\n border-radius: 3px;\n }\n\n :host ::ng-deep .tok-tag { color: var(--prism-code-tag); }\n :host ::ng-deep .tok-attr { color: var(--prism-code-attr); }\n :host ::ng-deep .tok-str { color: var(--prism-code-str); }\n :host ::ng-deep .tok-com { color: var(--prism-code-com); font-style: italic; }\n "] }]
158
+ }], null, { onEscape: [{
159
+ type: HostListener,
160
+ args: ['document:keydown.escape']
161
+ }] }); })();
162
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismTemplatePopoverComponent, { className: "PrismTemplatePopoverComponent", filePath: "app/canvas/prism-template-popover.component.ts", lineNumber: 206 }); })();
@@ -1 +1 @@
1
- {"version":3,"file":"prism-icon.component.d.ts","sourceRoot":"","sources":["../../../src/app/icons/prism-icon.component.ts"],"names":[],"mappings":";AAgDA,qBAOa,kBAAkB;IAC7B,QAAQ,CAAC,IAAI,8CAA4B;IACzC,QAAQ,CAAC,IAAI,8CAAa;IAE1B,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAmC;;yCAJ3C,kBAAkB;2CAAlB,kBAAkB;CAkC9B"}
1
+ {"version":3,"file":"prism-icon.component.d.ts","sourceRoot":"","sources":["../../../src/app/icons/prism-icon.component.ts"],"names":[],"mappings":";AAkDA,qBAOa,kBAAkB;IAC7B,QAAQ,CAAC,IAAI,8CAA4B;IACzC,QAAQ,CAAC,IAAI,8CAAa;IAE1B,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAmC;;yCAJ3C,kBAAkB;2CAAlB,kBAAkB;CAkC9B"}
@@ -24,6 +24,8 @@ const ICONS = {
24
24
  copy: '<rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>',
25
25
  'maximize-2': '<path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3M3 16v3a2 2 0 0 0 2 2h3m8 0h3a2 2 0 0 0 2-2v-3"/>',
26
26
  eye: '<path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"/><circle cx="12" cy="12" r="3"/>',
27
+ code: '<path d="m18 16 4-4-4-4M6 8l-4 4 4 4m8.5-12-5 16"/>',
28
+ x: '<path d="M18 6 6 18M6 6l12 12"/>',
27
29
  };
28
30
  const SVG_NS = 'http://www.w3.org/2000/svg';
29
31
  export class PrismIconComponent {
@@ -61,4 +63,4 @@ export class PrismIconComponent {
61
63
  type: Component,
62
64
  args: [{ selector: 'prism-icon', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: ``, styles: [":host { display: inline-flex; align-items: center; justify-content: center; }"] }]
63
65
  }], () => [], { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] }); })();
64
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismIconComponent, { className: "PrismIconComponent", filePath: "app/icons/prism-icon.component.ts", lineNumber: 56 }); })();
66
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismIconComponent, { className: "PrismIconComponent", filePath: "app/icons/prism-icon.component.ts", lineNumber: 58 }); })();
@@ -7,13 +7,14 @@ export declare class PrismLayoutService {
7
7
  readonly sidebarWidth: import("@angular/core").WritableSignal<number>;
8
8
  readonly panelHeight: import("@angular/core").WritableSignal<number>;
9
9
  readonly panelWidth: import("@angular/core").WritableSignal<number>;
10
- readonly codeDrawerCollapsed: import("@angular/core").WritableSignal<boolean>;
10
+ readonly templatePopoverVisible: import("@angular/core").WritableSignal<boolean>;
11
11
  constructor();
12
12
  toggleSidebar(): void;
13
13
  toggleAddons(): void;
14
14
  toggleToolbar(): void;
15
15
  toggleOrientation(): void;
16
- toggleCodeDrawer(): void;
16
+ toggleTemplatePopover(): void;
17
+ closeTemplatePopover(): void;
17
18
  setSidebarWidth(px: number): void;
18
19
  setPanelHeight(px: number): void;
19
20
  setPanelWidth(px: number): void;
@@ -1 +1 @@
1
- {"version":3,"file":"prism-layout.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-layout.service.ts"],"names":[],"mappings":";AAIA,qBACa,kBAAkB;IAC7B,QAAQ,CAAC,cAAc,kDAAgB;IACvC,QAAQ,CAAC,aAAa,kDAAgB;IACtC,QAAQ,CAAC,cAAc,kDAAgB;IACvC,QAAQ,CAAC,iBAAiB,6DAAwC;IAClE,QAAQ,CAAC,YAAY,iDAAe;IACpC,QAAQ,CAAC,WAAW,iDAAe;IACnC,QAAQ,CAAC,UAAU,iDAAe;IAClC,QAAQ,CAAC,mBAAmB,kDAAiB;;IAM7C,aAAa,IAAI,IAAI;IAKrB,YAAY,IAAI,IAAI;IAKpB,aAAa,IAAI,IAAI;IAKrB,iBAAiB,IAAI,IAAI;IAKzB,gBAAgB,IAAI,IAAI;IAKxB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAKjC,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAKhC,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAK/B,OAAO,CAAC,eAAe;IA4BvB,OAAO,CAAC,aAAa;yCAlFV,kBAAkB;6CAAlB,kBAAkB;CA+F9B"}
1
+ {"version":3,"file":"prism-layout.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-layout.service.ts"],"names":[],"mappings":";AAIA,qBACa,kBAAkB;IAC7B,QAAQ,CAAC,cAAc,kDAAgB;IACvC,QAAQ,CAAC,aAAa,kDAAgB;IACtC,QAAQ,CAAC,cAAc,kDAAgB;IACvC,QAAQ,CAAC,iBAAiB,6DAAwC;IAClE,QAAQ,CAAC,YAAY,iDAAe;IACpC,QAAQ,CAAC,WAAW,iDAAe;IACnC,QAAQ,CAAC,UAAU,iDAAe;IAClC,QAAQ,CAAC,sBAAsB,kDAAiB;;IAMhD,aAAa,IAAI,IAAI;IAKrB,YAAY,IAAI,IAAI;IAKpB,aAAa,IAAI,IAAI;IAKrB,iBAAiB,IAAI,IAAI;IAKzB,qBAAqB,IAAI,IAAI;IAI7B,oBAAoB,IAAI,IAAI;IAI5B,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAKjC,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAKhC,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAK/B,OAAO,CAAC,eAAe;IA0BvB,OAAO,CAAC,aAAa;yCAnFV,kBAAkB;6CAAlB,kBAAkB;CA+F9B"}
@@ -9,7 +9,7 @@ export class PrismLayoutService {
9
9
  sidebarWidth = signal(280, ...(ngDevMode ? [{ debugName: "sidebarWidth" }] : []));
10
10
  panelHeight = signal(300, ...(ngDevMode ? [{ debugName: "panelHeight" }] : []));
11
11
  panelWidth = signal(320, ...(ngDevMode ? [{ debugName: "panelWidth" }] : []));
12
- codeDrawerCollapsed = signal(false, ...(ngDevMode ? [{ debugName: "codeDrawerCollapsed" }] : []));
12
+ templatePopoverVisible = signal(false, ...(ngDevMode ? [{ debugName: "templatePopoverVisible" }] : []));
13
13
  constructor() {
14
14
  this.loadFromStorage();
15
15
  }
@@ -29,9 +29,11 @@ export class PrismLayoutService {
29
29
  this.addonsOrientation.update((v) => (v === 'bottom' ? 'right' : 'bottom'));
30
30
  this.saveToStorage();
31
31
  }
32
- toggleCodeDrawer() {
33
- this.codeDrawerCollapsed.update((v) => !v);
34
- this.saveToStorage();
32
+ toggleTemplatePopover() {
33
+ this.templatePopoverVisible.update((v) => !v);
34
+ }
35
+ closeTemplatePopover() {
36
+ this.templatePopoverVisible.set(false);
35
37
  }
36
38
  setSidebarWidth(px) {
37
39
  this.sidebarWidth.set(Math.max(160, Math.min(600, px)));
@@ -67,8 +69,6 @@ export class PrismLayoutService {
67
69
  this.panelHeight.set(Math.max(100, Math.min(600, d['panelHeight'])));
68
70
  if (typeof d['panelWidth'] === 'number')
69
71
  this.panelWidth.set(Math.max(200, Math.min(600, d['panelWidth'])));
70
- if (typeof d['codeDrawerCollapsed'] === 'boolean')
71
- this.codeDrawerCollapsed.set(d['codeDrawerCollapsed']);
72
72
  }
73
73
  catch { }
74
74
  }
@@ -81,7 +81,6 @@ export class PrismLayoutService {
81
81
  sidebarWidth: this.sidebarWidth(),
82
82
  panelHeight: this.panelHeight(),
83
83
  panelWidth: this.panelWidth(),
84
- codeDrawerCollapsed: this.codeDrawerCollapsed(),
85
84
  };
86
85
  localStorage.setItem(STORAGE_KEY, JSON.stringify(data));
87
86
  }
@@ -19,7 +19,7 @@ import { PrismViewTabBarComponent } from '../view-tab-bar/prism-view-tab-bar.com
19
19
  import { PrismViewPanelHostComponent } from '../view-tab-bar/prism-view-panel-host.component.js';
20
20
  import { PrismResizerDirective } from '../directives/prism-resizer.directive.js';
21
21
  import { PrismCanvasToolbarComponent } from '../canvas/prism-canvas-toolbar.component.js';
22
- import { PrismCodeDrawerComponent } from '../canvas/prism-code-drawer.component.js';
22
+ import { PrismTemplatePopoverComponent } from '../canvas/prism-template-popover.component.js';
23
23
  import * as i0 from "@angular/core";
24
24
  function PrismShellComponent_Conditional_3_Template(rf, ctx) { if (rf & 1) {
25
25
  const _r1 = i0.ɵɵgetCurrentView();
@@ -47,9 +47,8 @@ function PrismShellComponent_Conditional_5_Conditional_1_Conditional_0_Template(
47
47
  function PrismShellComponent_Conditional_5_Conditional_1_Template(rf, ctx) { if (rf & 1) {
48
48
  i0.ɵɵconditionalCreate(0, PrismShellComponent_Conditional_5_Conditional_1_Conditional_0_Template, 2, 0);
49
49
  i0.ɵɵelementStart(1, "div", 12);
50
- i0.ɵɵelement(2, "prism-canvas-toolbar")(3, "prism-renderer");
50
+ i0.ɵɵelement(2, "prism-canvas-toolbar")(3, "prism-renderer")(4, "prism-template-popover");
51
51
  i0.ɵɵelementEnd();
52
- i0.ɵɵelement(4, "prism-code-drawer", 13);
53
52
  } if (rf & 2) {
54
53
  const ctx_r1 = i0.ɵɵnextContext(2);
55
54
  i0.ɵɵconditional(ctx_r1.layout.toolbarVisible() ? 0 : -1);
@@ -59,10 +58,10 @@ function PrismShellComponent_Conditional_5_Conditional_2_Template(rf, ctx) { if
59
58
  } }
60
59
  function PrismShellComponent_Conditional_5_Conditional_3_Template(rf, ctx) { if (rf & 1) {
61
60
  const _r3 = i0.ɵɵgetCurrentView();
62
- i0.ɵɵelementStart(0, "div", 14);
61
+ i0.ɵɵelementStart(0, "div", 13);
63
62
  i0.ɵɵlistener("valueChange", function PrismShellComponent_Conditional_5_Conditional_3_Template_div_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.layout.setPanelHeight($event)); });
64
63
  i0.ɵɵelementEnd();
65
- i0.ɵɵelementStart(1, "div", 15);
64
+ i0.ɵɵelementStart(1, "div", 14);
66
65
  i0.ɵɵelement(2, "prism-panel-host");
67
66
  i0.ɵɵelementEnd();
68
67
  } if (rf & 2) {
@@ -87,14 +86,14 @@ function PrismShellComponent_Conditional_6_Template(rf, ctx) { if (rf & 1) {
87
86
  function PrismShellComponent_Conditional_7_Template(rf, ctx) { if (rf & 1) {
88
87
  i0.ɵɵelementStart(0, "div", 5);
89
88
  i0.ɵɵnamespaceSVG();
90
- i0.ɵɵelementStart(1, "svg", 16);
91
- i0.ɵɵelement(2, "path", 17)(3, "path", 18);
89
+ i0.ɵɵelementStart(1, "svg", 15);
90
+ i0.ɵɵelement(2, "path", 16)(3, "path", 17);
92
91
  i0.ɵɵelementEnd();
93
92
  i0.ɵɵnamespaceHTML();
94
- i0.ɵɵelementStart(4, "p", 19);
93
+ i0.ɵɵelementStart(4, "p", 18);
95
94
  i0.ɵɵtext(5, "Select a component");
96
95
  i0.ɵɵelementEnd();
97
- i0.ɵɵelementStart(6, "p", 20);
96
+ i0.ɵɵelementStart(6, "p", 19);
98
97
  i0.ɵɵtext(7, " from the sidebar to preview it here ");
99
98
  i0.ɵɵelementEnd()();
100
99
  } }
@@ -166,7 +165,7 @@ export class PrismShellComponent {
166
165
  static ɵfac = function PrismShellComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PrismShellComponent)(); };
167
166
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PrismShellComponent, selectors: [["prism-shell"]], hostBindings: function PrismShellComponent_HostBindings(rf, ctx) { if (rf & 1) {
168
167
  i0.ɵɵlistener("keydown", function PrismShellComponent_keydown_HostBindingHandler($event) { return ctx.onKeyDown($event); }, i0.ɵɵresolveDocument);
169
- } }, decls: 8, vars: 8, consts: [[1, "prism-shell"], [1, "prism-shell__header"], [1, "prism-body"], [1, "prism-main"], [1, "prism-main__canvas"], [1, "prism-shell__empty"], [1, "prism-sidebar-wrap"], [1, "prism-sidebar-foot"], ["alt", "ng-prism logo", "src", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABYCAMAAAA0hKKwAAAC7lBMVEUAAADFkfu6Dn9fLlcmNclKI0WFKFAnRr9XJ09tUI3jTZDxU5vxUJvIQ30wYuRNIMFoF7qBEq61g7y0N2+SL1ljQnL8vO5dUqqhNGPps/coVdQ4K8iUEKCkEJm1O3GKaL2JXpzTmePcS4zCitkoQdeVgfK4ie7hqeGde9p7bNTRR4PQRYRqYMawjPe/SHyBX7D4WJ75WaD6W6H4Vp37XKL9y/UlMtbDEoR90f39uvndn/v5U5rYm/vMlPsrTPJLI8z/YbNWH8f6tfr+0PjxrPvqqPu8jPs1K9QxY/zko/tFJc5RIcnTmfuuifv/1PkmNdz0r/olM9hoGcDopPurh/swXP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MAlkExCoSPSK0iKBm68BkcvlVdN71hcMAJABQvhme0d6+nGKVGzbsweQnseFs7gDAMgqYLxKm5d6IiGnKbL5a+vCNDDYKCm2b4I6tm8nCCRm2zZQjCZZwRASWD9TFJKCsFpfFY5BEqrNH/zXN87EaOAYKSkP7GN3794NCkHCo6OjjZBy452gwSkKhaKgIKxU5aYlBKRqTo/6GvZ9MzY2iCEQMMwjHh7uoCAC8SoouJvoto4h8vwxf9WXLgOJjCAeCd+7d280HJc3j5geFxju7sGrMIh4eRUkA6MNxSRWzTK9fSF2KXZvMmIz7O2DQNkOSSeGKeLaC7IJFAUqiISFARO6To5IIqkxX19YxjFYBhBGSHhMTAxD/r14d4OiYEhYcoFLrdYXjMT86Ub1FeO+f8TGgsAQVJJiEIk2N4kHRTZtAoVDXFySk1+WarWo2HA/NBYfPkaWYU+DBihJ4eHhxpNs7Q0hxwUBxQsQplAmQJ4YGjrYUN8UISN4JAgNRMwunkeCg0HhEWSgAQGJ+XPoy8OFww9g32DwCDBJSX2YxINHIBLOoIHVyLX5A8hP3egyTBD73Wc5xGy7TBClhDfYMKdr8TYenXYzNuOEaexP2B9PwjAkmkOcAaH/+t67584Cf3tLsLIMo1S4uJw2istpWM1Pm36j+veWyZhJmJE0I2iG00zEDORjNW2glZXVtGnTBg6cYGU1YRgE/gy/mWA1bMIwmz/QGVRJ3BG6bAAAAABJRU5ErkJggg==", 1, "prism-sidebar-foot__logo"], ["href", "https://dyingangel666.github.io/ng-prism/#/", "target", "_blank", "rel", "noopener", 1, "prism-sidebar-foot__link"], ["prismResizer", "", "axis", "x", 1, "prism-resizer-col", 3, "valueChange", "min", "max", "value"], [1, "prism-main__view-bar"], [1, "prism-canvas-wrap"], [1, "prism-main__code-drawer"], ["prismResizer", "", "axis", "y", 1, "prism-resizer-row", 3, "valueChange", "min", "max", "value"], [1, "prism-main__panel"], ["viewBox", "0 0 24 24", "fill", "none", "stroke", "currentColor", "stroke-width", "1.5", "stroke-linecap", "round", "stroke-linejoin", "round", 1, "prism-shell__empty-icon"], ["d", "M12 2L4 14h16L12 2z"], ["d", "M4 14l4 8h8l4-8"], [1, "prism-shell__empty-text"], [1, "prism-shell__empty-hint"]], template: function PrismShellComponent_Template(rf, ctx) { if (rf & 1) {
168
+ } }, decls: 8, vars: 8, consts: [[1, "prism-shell"], [1, "prism-shell__header"], [1, "prism-body"], [1, "prism-main"], [1, "prism-main__canvas"], [1, "prism-shell__empty"], [1, "prism-sidebar-wrap"], [1, "prism-sidebar-foot"], ["alt", "ng-prism logo", "src", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABYCAMAAAA0hKKwAAAC7lBMVEUAAADFkfu6Dn9fLlcmNclKI0WFKFAnRr9XJ09tUI3jTZDxU5vxUJvIQ30wYuRNIMFoF7qBEq61g7y0N2+SL1ljQnL8vO5dUqqhNGPps/coVdQ4K8iUEKCkEJm1O3GKaL2JXpzTmePcS4zCitkoQdeVgfK4ie7hqeGde9p7bNTRR4PQRYRqYMawjPe/SHyBX7D4WJ75WaD6W6H4Vp37XKL9y/UlMtbDEoR90f39uvndn/v5U5rYm/vMlPsrTPJLI8z/YbNWH8f6tfr+0PjxrPvqqPu8jPs1K9QxY/zko/tFJc5RIcnTmfuuifv/1PkmNdz0r/olM9hoGcDopPurh/swXPotUfVzF7rCj/ukhvv9zfb9wv+XgvvuqfovVvgrRO7/5/60i/zhofunhvv6WJ6B0f2ghPvQlvttGL2/Eoa3i/soPeYnOuA8KdJfHMNjG8F8FbX/4P6yiPuSgfsxYPv3sfq2EYpAJ9BaHcX8Vpy7EYf+x/R3FbiIFLD/X62YE6W5jPychPz+tvb7Yab4Qo/+2P/IkvsvLtaCFLOPE6vIk/v9W6C4BH2Vzv2/jvv+XqOtEY/JEYWH0P28xf2fEpb//f//7v81af+myf2Mf/ykE6P6SpWmEJIkYP3/ZaP/zf+N0P1my/2dyv3/Wqf6uP8UM/D9ZaixD4vBDoGwxv3Mv/v6rvYIIOv/aLiVEZnN9f/+vP9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EhYcoFLrdYXjMT86Ub1FeO+f8TGgsAQVJJiEIk2N4kHRTZtAoVDXFySk1+WarWo2HA/NBYfPkaWYU+DBihJ4eHhxpNs7Q0hxwUBxQsQplAmQJ4YGjrYUN8UISN4JAgNRMwunkeCg0HhEWSgAQGJ+XPoy8OFww9g32DwCDBJSX2YxINHIBLOoIHVyLX5A8hP3egyTBD73Wc5xGy7TBClhDfYMKdr8TYenXYzNuOEaexP2B9PwjAkmkOcAaH/+t67584Cf3tLsLIMo1S4uJw2istpWM1Pm36j+veWyZhJmJE0I2iG00zEDORjNW2glZXVtGnTBg6cYGU1YRgE/gy/mWA1bMIwmz/QGVRJ3BG6bAAAAABJRU5ErkJggg==", 1, "prism-sidebar-foot__logo"], ["href", "https://dyingangel666.github.io/ng-prism/#/", "target", "_blank", "rel", "noopener", 1, "prism-sidebar-foot__link"], ["prismResizer", "", "axis", "x", 1, "prism-resizer-col", 3, "valueChange", "min", "max", "value"], [1, "prism-main__view-bar"], [1, "prism-canvas-wrap"], ["prismResizer", "", "axis", "y", 1, "prism-resizer-row", 3, "valueChange", "min", "max", "value"], [1, "prism-main__panel"], ["viewBox", "0 0 24 24", "fill", "none", "stroke", "currentColor", "stroke-width", "1.5", "stroke-linecap", "round", "stroke-linejoin", "round", 1, "prism-shell__empty-icon"], ["d", "M12 2L4 14h16L12 2z"], ["d", "M4 14l4 8h8l4-8"], [1, "prism-shell__empty-text"], [1, "prism-shell__empty-hint"]], template: function PrismShellComponent_Template(rf, ctx) { if (rf & 1) {
170
169
  i0.ɵɵelementStart(0, "div", 0);
171
170
  i0.ɵɵelement(1, "prism-header", 1);
172
171
  i0.ɵɵelementStart(2, "div", 2);
@@ -195,7 +194,7 @@ export class PrismShellComponent {
195
194
  PrismViewPanelHostComponent,
196
195
  PrismResizerDirective,
197
196
  PrismCanvasToolbarComponent,
198
- PrismCodeDrawerComponent], styles: ["[_nghost-%COMP%] { display: block; height: 100%; }\n\n .prism-shell[_ngcontent-%COMP%] {\n height: 100vh;\n display: grid;\n grid-template-rows: 52px 1fr;\n background: var(--prism-void);\n font-family: var(--font-sans, var(--prism-font-sans));\n color: var(--prism-text);\n overflow: hidden;\n }\n\n .prism-body[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: var(--sw, 264px) 4px 1fr;\n min-height: 0;\n }\n .prism-body--no-sidebar[_ngcontent-%COMP%] {\n grid-template-columns: 1fr;\n }\n\n .prism-sidebar-wrap[_ngcontent-%COMP%] {\n background: var(--prism-bg);\n border-right: 1px solid var(--prism-border);\n display: flex;\n flex-direction: column;\n min-height: 0;\n overflow: hidden;\n }\n\n .prism-sidebar-wrap[_ngcontent-%COMP%] prism-sidebar[_ngcontent-%COMP%] {\n flex: 1;\n min-height: 0;\n }\n\n .prism-sidebar-foot[_ngcontent-%COMP%] {\n border-top: 1px solid var(--prism-border);\n padding: 10px 14px;\n font-size: 11px;\n color: var(--prism-text-ghost);\n display: flex;\n align-items: center;\n gap: 8px;\n }\n .prism-sidebar-foot__logo[_ngcontent-%COMP%] {\n width: 16px;\n flex-shrink: 0;\n }\n .prism-sidebar-foot__link[_ngcontent-%COMP%] {\n color: var(--prism-text-ghost);\n text-decoration: none;\n transition: color var(--dur-fast);\n }\n .prism-sidebar-foot__link[_ngcontent-%COMP%]:hover {\n color: var(--prism-text-2);\n }\n\n .prism-resizer-col[_ngcontent-%COMP%] {\n width: 4px;\n background: transparent;\n transition: background var(--dur-fast) var(--ease-default);\n position: relative;\n z-index: 5;\n }\n .prism-resizer-col[_ngcontent-%COMP%]:hover, \n .prism-resizer-col.active[_ngcontent-%COMP%] {\n background: var(--prism-primary);\n }\n\n .prism-main[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n min-height: 0;\n background: var(--prism-void);\n overflow: hidden;\n }\n\n .prism-resizer-row[_ngcontent-%COMP%] {\n flex-shrink: 0;\n height: 4px;\n background: transparent;\n transition: background var(--dur-fast) var(--ease-default);\n position: relative;\n z-index: 5;\n }\n .prism-resizer-row[_ngcontent-%COMP%]:hover, \n .prism-resizer-row.active[_ngcontent-%COMP%] {\n background: var(--prism-primary);\n }\n\n .prism-canvas-wrap[_ngcontent-%COMP%] {\n flex: 1;\n min-height: 0;\n display: grid;\n grid-template-rows: auto minmax(0, 1fr);\n background: var(--prism-bg-surface);\n overflow: hidden;\n }\n .prism-main__code-drawer[_ngcontent-%COMP%] { flex-shrink: 0; }\n .prism-main__view-bar[_ngcontent-%COMP%] { flex-shrink: 0; }\n .prism-main__canvas[_ngcontent-%COMP%] { flex: 1; min-height: 0; overflow: auto; }\n\n .prism-main__panel[_ngcontent-%COMP%] {\n height: var(--ph, 260px);\n flex-shrink: 0;\n overflow: hidden;\n min-height: 0;\n }\n\n .prism-shell__empty[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 8px;\n grid-row: 1 / -1;\n }\n .prism-shell__empty-icon[_ngcontent-%COMP%] {\n width: 48px;\n height: 48px;\n color: var(--prism-text-ghost);\n margin-bottom: 8px;\n }\n .prism-shell__empty-text[_ngcontent-%COMP%] {\n margin: 0;\n font-size: var(--fs-xl);\n font-weight: 500;\n color: var(--prism-text-muted);\n }\n .prism-shell__empty-hint[_ngcontent-%COMP%] {\n margin: 0;\n font-size: var(--fs-lg);\n color: var(--prism-text-ghost);\n }"], changeDetection: 0 });
197
+ PrismTemplatePopoverComponent], styles: ["[_nghost-%COMP%] { display: block; height: 100%; }\n\n .prism-shell[_ngcontent-%COMP%] {\n height: 100vh;\n display: grid;\n grid-template-rows: 52px 1fr;\n background: var(--prism-void);\n font-family: var(--font-sans, var(--prism-font-sans));\n color: var(--prism-text);\n overflow: hidden;\n }\n\n .prism-body[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: var(--sw, 264px) 4px 1fr;\n min-height: 0;\n }\n .prism-body--no-sidebar[_ngcontent-%COMP%] {\n grid-template-columns: 1fr;\n }\n\n .prism-sidebar-wrap[_ngcontent-%COMP%] {\n background: var(--prism-bg);\n border-right: 1px solid var(--prism-border);\n display: flex;\n flex-direction: column;\n min-height: 0;\n overflow: hidden;\n }\n\n .prism-sidebar-wrap[_ngcontent-%COMP%] prism-sidebar[_ngcontent-%COMP%] {\n flex: 1;\n min-height: 0;\n }\n\n .prism-sidebar-foot[_ngcontent-%COMP%] {\n border-top: 1px solid var(--prism-border);\n padding: 10px 14px;\n font-size: 11px;\n color: var(--prism-text-ghost);\n display: flex;\n align-items: center;\n gap: 8px;\n }\n .prism-sidebar-foot__logo[_ngcontent-%COMP%] {\n width: 16px;\n flex-shrink: 0;\n }\n .prism-sidebar-foot__link[_ngcontent-%COMP%] {\n color: var(--prism-text-ghost);\n text-decoration: none;\n transition: color var(--dur-fast);\n }\n .prism-sidebar-foot__link[_ngcontent-%COMP%]:hover {\n color: var(--prism-text-2);\n }\n\n .prism-resizer-col[_ngcontent-%COMP%] {\n width: 4px;\n background: transparent;\n transition: background var(--dur-fast) var(--ease-default);\n position: relative;\n z-index: 5;\n }\n .prism-resizer-col[_ngcontent-%COMP%]:hover, \n .prism-resizer-col.active[_ngcontent-%COMP%] {\n background: var(--prism-primary);\n }\n\n .prism-main[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n min-height: 0;\n background: var(--prism-void);\n overflow: hidden;\n }\n\n .prism-resizer-row[_ngcontent-%COMP%] {\n flex-shrink: 0;\n height: 4px;\n background: transparent;\n transition: background var(--dur-fast) var(--ease-default);\n position: relative;\n z-index: 5;\n }\n .prism-resizer-row[_ngcontent-%COMP%]:hover, \n .prism-resizer-row.active[_ngcontent-%COMP%] {\n background: var(--prism-primary);\n }\n\n .prism-canvas-wrap[_ngcontent-%COMP%] {\n flex: 1;\n min-height: 0;\n display: grid;\n grid-template-rows: auto minmax(0, 1fr);\n background: var(--prism-bg-surface);\n overflow: hidden;\n position: relative;\n }\n .prism-main__view-bar[_ngcontent-%COMP%] { flex-shrink: 0; }\n .prism-main__canvas[_ngcontent-%COMP%] { flex: 1; min-height: 0; overflow: auto; }\n\n .prism-main__panel[_ngcontent-%COMP%] {\n height: var(--ph, 260px);\n flex-shrink: 0;\n overflow: hidden;\n min-height: 0;\n }\n\n .prism-shell__empty[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 8px;\n grid-row: 1 / -1;\n }\n .prism-shell__empty-icon[_ngcontent-%COMP%] {\n width: 48px;\n height: 48px;\n color: var(--prism-text-ghost);\n margin-bottom: 8px;\n }\n .prism-shell__empty-text[_ngcontent-%COMP%] {\n margin: 0;\n font-size: var(--fs-xl);\n font-weight: 500;\n color: var(--prism-text-muted);\n }\n .prism-shell__empty-hint[_ngcontent-%COMP%] {\n margin: 0;\n font-size: var(--fs-lg);\n color: var(--prism-text-ghost);\n }"], changeDetection: 0 });
199
198
  }
200
199
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PrismShellComponent, [{
201
200
  type: Component,
@@ -211,7 +210,7 @@ export class PrismShellComponent {
211
210
  PrismViewPanelHostComponent,
212
211
  PrismResizerDirective,
213
212
  PrismCanvasToolbarComponent,
214
- PrismCodeDrawerComponent,
213
+ PrismTemplatePopoverComponent,
215
214
  ], template: `
216
215
  <div class="prism-shell" [style]="shellStyle()">
217
216
  <prism-header class="prism-shell__header" />
@@ -265,8 +264,8 @@ export class PrismShellComponent {
265
264
  <div class="prism-canvas-wrap">
266
265
  <prism-canvas-toolbar />
267
266
  <prism-renderer />
267
+ <prism-template-popover />
268
268
  </div>
269
- <prism-code-drawer class="prism-main__code-drawer" />
270
269
  } @else {
271
270
  <prism-view-panel-host class="prism-main__canvas" />
272
271
  } @if (showPanel()) {
@@ -307,7 +306,7 @@ export class PrismShellComponent {
307
306
  </main>
308
307
  </div>
309
308
  </div>
310
- `, styles: ["\n :host { display: block; height: 100%; }\n\n .prism-shell {\n height: 100vh;\n display: grid;\n grid-template-rows: 52px 1fr;\n background: var(--prism-void);\n font-family: var(--font-sans, var(--prism-font-sans));\n color: var(--prism-text);\n overflow: hidden;\n }\n\n .prism-body {\n display: grid;\n grid-template-columns: var(--sw, 264px) 4px 1fr;\n min-height: 0;\n }\n .prism-body--no-sidebar {\n grid-template-columns: 1fr;\n }\n\n .prism-sidebar-wrap {\n background: var(--prism-bg);\n border-right: 1px solid var(--prism-border);\n display: flex;\n flex-direction: column;\n min-height: 0;\n overflow: hidden;\n }\n\n .prism-sidebar-wrap prism-sidebar {\n flex: 1;\n min-height: 0;\n }\n\n .prism-sidebar-foot {\n border-top: 1px solid var(--prism-border);\n padding: 10px 14px;\n font-size: 11px;\n color: var(--prism-text-ghost);\n display: flex;\n align-items: center;\n gap: 8px;\n }\n .prism-sidebar-foot__logo {\n width: 16px;\n flex-shrink: 0;\n }\n .prism-sidebar-foot__link {\n color: var(--prism-text-ghost);\n text-decoration: none;\n transition: color var(--dur-fast);\n }\n .prism-sidebar-foot__link:hover {\n color: var(--prism-text-2);\n }\n\n .prism-resizer-col {\n width: 4px;\n background: transparent;\n transition: background var(--dur-fast) var(--ease-default);\n position: relative;\n z-index: 5;\n }\n .prism-resizer-col:hover,\n .prism-resizer-col.active {\n background: var(--prism-primary);\n }\n\n .prism-main {\n display: flex;\n flex-direction: column;\n min-height: 0;\n background: var(--prism-void);\n overflow: hidden;\n }\n\n .prism-resizer-row {\n flex-shrink: 0;\n height: 4px;\n background: transparent;\n transition: background var(--dur-fast) var(--ease-default);\n position: relative;\n z-index: 5;\n }\n .prism-resizer-row:hover,\n .prism-resizer-row.active {\n background: var(--prism-primary);\n }\n\n .prism-canvas-wrap {\n flex: 1;\n min-height: 0;\n display: grid;\n grid-template-rows: auto minmax(0, 1fr);\n background: var(--prism-bg-surface);\n overflow: hidden;\n }\n .prism-main__code-drawer { flex-shrink: 0; }\n .prism-main__view-bar { flex-shrink: 0; }\n .prism-main__canvas { flex: 1; min-height: 0; overflow: auto; }\n\n .prism-main__panel {\n height: var(--ph, 260px);\n flex-shrink: 0;\n overflow: hidden;\n min-height: 0;\n }\n\n .prism-shell__empty {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 8px;\n grid-row: 1 / -1;\n }\n .prism-shell__empty-icon {\n width: 48px;\n height: 48px;\n color: var(--prism-text-ghost);\n margin-bottom: 8px;\n }\n .prism-shell__empty-text {\n margin: 0;\n font-size: var(--fs-xl);\n font-weight: 500;\n color: var(--prism-text-muted);\n }\n .prism-shell__empty-hint {\n margin: 0;\n font-size: var(--fs-lg);\n color: var(--prism-text-ghost);\n }\n "] }]
309
+ `, styles: ["\n :host { display: block; height: 100%; }\n\n .prism-shell {\n height: 100vh;\n display: grid;\n grid-template-rows: 52px 1fr;\n background: var(--prism-void);\n font-family: var(--font-sans, var(--prism-font-sans));\n color: var(--prism-text);\n overflow: hidden;\n }\n\n .prism-body {\n display: grid;\n grid-template-columns: var(--sw, 264px) 4px 1fr;\n min-height: 0;\n }\n .prism-body--no-sidebar {\n grid-template-columns: 1fr;\n }\n\n .prism-sidebar-wrap {\n background: var(--prism-bg);\n border-right: 1px solid var(--prism-border);\n display: flex;\n flex-direction: column;\n min-height: 0;\n overflow: hidden;\n }\n\n .prism-sidebar-wrap prism-sidebar {\n flex: 1;\n min-height: 0;\n }\n\n .prism-sidebar-foot {\n border-top: 1px solid var(--prism-border);\n padding: 10px 14px;\n font-size: 11px;\n color: var(--prism-text-ghost);\n display: flex;\n align-items: center;\n gap: 8px;\n }\n .prism-sidebar-foot__logo {\n width: 16px;\n flex-shrink: 0;\n }\n .prism-sidebar-foot__link {\n color: var(--prism-text-ghost);\n text-decoration: none;\n transition: color var(--dur-fast);\n }\n .prism-sidebar-foot__link:hover {\n color: var(--prism-text-2);\n }\n\n .prism-resizer-col {\n width: 4px;\n background: transparent;\n transition: background var(--dur-fast) var(--ease-default);\n position: relative;\n z-index: 5;\n }\n .prism-resizer-col:hover,\n .prism-resizer-col.active {\n background: var(--prism-primary);\n }\n\n .prism-main {\n display: flex;\n flex-direction: column;\n min-height: 0;\n background: var(--prism-void);\n overflow: hidden;\n }\n\n .prism-resizer-row {\n flex-shrink: 0;\n height: 4px;\n background: transparent;\n transition: background var(--dur-fast) var(--ease-default);\n position: relative;\n z-index: 5;\n }\n .prism-resizer-row:hover,\n .prism-resizer-row.active {\n background: var(--prism-primary);\n }\n\n .prism-canvas-wrap {\n flex: 1;\n min-height: 0;\n display: grid;\n grid-template-rows: auto minmax(0, 1fr);\n background: var(--prism-bg-surface);\n overflow: hidden;\n position: relative;\n }\n .prism-main__view-bar { flex-shrink: 0; }\n .prism-main__canvas { flex: 1; min-height: 0; overflow: auto; }\n\n .prism-main__panel {\n height: var(--ph, 260px);\n flex-shrink: 0;\n overflow: hidden;\n min-height: 0;\n }\n\n .prism-shell__empty {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 8px;\n grid-row: 1 / -1;\n }\n .prism-shell__empty-icon {\n width: 48px;\n height: 48px;\n color: var(--prism-text-ghost);\n margin-bottom: 8px;\n }\n .prism-shell__empty-text {\n margin: 0;\n font-size: var(--fs-xl);\n font-weight: 500;\n color: var(--prism-text-muted);\n }\n .prism-shell__empty-hint {\n margin: 0;\n font-size: var(--fs-lg);\n color: var(--prism-text-ghost);\n }\n "] }]
311
310
  }], () => [], { onKeyDown: [{
312
311
  type: HostListener,
313
312
  args: ['document:keydown', ['$event']]
@@ -1 +1 @@
1
- {"version":3,"file":"prism-pipeline.d.ts","sourceRoot":"","sources":["../../../src/builder/shared/prism-pipeline.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,EAAiB,KAAK,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAMpE,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,mGAAmG;IACnG,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,wBAAgB,mBAAmB,IAAI,kBAAkB,CAExD;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,mBAAmB,CAAC,CAmD9B"}
1
+ {"version":3,"file":"prism-pipeline.d.ts","sourceRoot":"","sources":["../../../src/builder/shared/prism-pipeline.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAMhE,OAAO,EAAiB,KAAK,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAMpE,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,mGAAmG;IACnG,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,wBAAgB,mBAAmB,IAAI,kBAAkB,CAExD;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,mBAAmB,CAAC,CAoD9B"}
@@ -1,5 +1,5 @@
1
1
  import { join, dirname } from 'path';
2
- import { writeFileSync, readFileSync, mkdirSync, statSync, renameSync, existsSync, unlinkSync } from 'fs';
2
+ import { writeFileSync, readFileSync, mkdirSync, statSync, renameSync, existsSync, unlinkSync, } from 'fs';
3
3
  import ts from 'typescript';
4
4
  import { createScanner } from '../scanner/scanner.js';
5
5
  import { discoverSecondaryEntryPoints } from '../scanner/entry-point-discovery.js';
@@ -28,8 +28,8 @@ export async function runPrismPipeline(options, context, state) {
28
28
  pages: manifest.pages,
29
29
  });
30
30
  const projectMeta = await context.getProjectMetadata(options.prismProject);
31
- const sourceRoot = projectMeta['sourceRoot']
32
- ?? join('projects', options.prismProject, 'src');
31
+ const sourceRoot = projectMeta['sourceRoot'] ??
32
+ join('projects', options.prismProject, 'src');
33
33
  const manifestPath = join(workspaceRoot, sourceRoot, 'prism-manifest.ts');
34
34
  mkdirSync(join(workspaceRoot, sourceRoot), { recursive: true });
35
35
  const written = writeManifestIfChanged(manifestPath, source);
@@ -63,7 +63,9 @@ function writeManifestIfChanged(manifestPath, newContent) {
63
63
  try {
64
64
  unlinkSync(tempPath);
65
65
  }
66
- catch { /* best-effort cleanup */ }
66
+ catch {
67
+ /* best-effort cleanup */
68
+ }
67
69
  }
68
70
  throw err;
69
71
  }
@@ -77,6 +79,18 @@ function isDirectory(path) {
77
79
  return false;
78
80
  }
79
81
  }
82
+ function findLibraryRoot(filePath) {
83
+ let dir = dirname(filePath);
84
+ let parent = dirname(dir);
85
+ while (dir !== parent) {
86
+ if (existsSync(join(dir, 'ng-package.json'))) {
87
+ return dir;
88
+ }
89
+ dir = parent;
90
+ parent = dirname(dir);
91
+ }
92
+ return undefined;
93
+ }
80
94
  function resolveTsconfigPaths(entryPointDir) {
81
95
  const configPath = ts.findConfigFile(entryPointDir, ts.sys.fileExists, 'tsconfig.json');
82
96
  if (!configPath)
@@ -95,10 +109,17 @@ function resolveTsconfigPaths(entryPointDir) {
95
109
  function scanEntryPoints(workspaceRoot, options, state) {
96
110
  const absoluteEntryPoint = join(workspaceRoot, options.entryPoint);
97
111
  const pathOptions = resolveTsconfigPaths(dirname(absoluteEntryPoint));
98
- if (!isDirectory(absoluteEntryPoint)) {
112
+ const entryIsDirectory = isDirectory(absoluteEntryPoint);
113
+ const libraryRoot = entryIsDirectory
114
+ ? absoluteEntryPoint
115
+ : findLibraryRoot(absoluteEntryPoint);
116
+ if (!libraryRoot) {
117
+ return getOrCreateScanner(state, absoluteEntryPoint, pathOptions).scan();
118
+ }
119
+ const entryPoints = discoverSecondaryEntryPoints(libraryRoot, options.libraryImportPath);
120
+ if (entryPoints.length === 0 && !entryIsDirectory) {
99
121
  return getOrCreateScanner(state, absoluteEntryPoint, pathOptions).scan();
100
122
  }
101
- const entryPoints = discoverSecondaryEntryPoints(absoluteEntryPoint, options.libraryImportPath);
102
123
  const allComponents = [];
103
124
  for (const ep of entryPoints) {
104
125
  const scanner = getOrCreateScanner(state, ep.entryFile, pathOptions);
@@ -141,8 +141,7 @@ function addBuilderTargets(options) {
141
141
  const project = workspace.projects[options.project];
142
142
  const prismProjectName = `${options.project}-prism`;
143
143
  const port = options.port ?? 4400;
144
- const sourceRoot = project.sourceRoot ?? `${project.root}/src`;
145
- const entryPoint = `${sourceRoot}/public-api.ts`;
144
+ const entryPoint = project.root ?? project.sourceRoot ?? `projects/${options.project}`;
146
145
  if (!project.architect) {
147
146
  project.architect = {};
148
147
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ng-prism/core",
3
- "version": "21.10.0",
3
+ "version": "21.10.2",
4
4
  "description": "ng-prism — the Angular-native Storybook alternative. Lightweight component showcase with @Showcase decorator, no story files needed.",
5
5
  "keywords": [
6
6
  "ng-prism",