@ng-prism/core 21.4.0 → 21.4.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.
- package/dist/app/panels/controls/prism-controls-panel.component.js +23 -22
- package/dist/app/panels/panel-host/prism-panel-host.component.d.ts.map +1 -1
- package/dist/app/panels/panel-host/prism-panel-host.component.js +4 -0
- package/dist/app/renderer/prism-renderer.component.d.ts +5 -1
- package/dist/app/renderer/prism-renderer.component.d.ts.map +1 -1
- package/dist/app/renderer/prism-renderer.component.js +24 -5
- package/dist/app/services/prism-panel.service.d.ts +2 -0
- package/dist/app/services/prism-panel.service.d.ts.map +1 -1
- package/dist/app/services/prism-panel.service.js +1 -0
- package/dist/app/services/prism-renderer.service.d.ts.map +1 -1
- package/dist/app/services/prism-renderer.service.js +9 -1
- package/package.json +1 -1
|
@@ -9,64 +9,65 @@ import { PrismNavigationService } from '../../services/prism-navigation.service.
|
|
|
9
9
|
import { PrismPluginService } from '../../services/prism-plugin.service.js';
|
|
10
10
|
import { PrismRendererService } from '../../services/prism-renderer.service.js';
|
|
11
11
|
import * as i0 from "@angular/core";
|
|
12
|
-
const _c0 = a0 => ({ inputMeta: a0 });
|
|
12
|
+
const _c0 = (a0, a1) => ({ inputMeta: a0, rendererService: a1 });
|
|
13
13
|
const _c1 = () => [];
|
|
14
14
|
const _forTrack0 = ($index, $item) => $item.name;
|
|
15
15
|
function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
16
16
|
i0.ɵɵelementContainer(0, 3);
|
|
17
17
|
} if (rf & 2) {
|
|
18
18
|
const input_r1 = i0.ɵɵnextContext().$implicit;
|
|
19
|
-
|
|
19
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
20
|
+
i0.ɵɵproperty("ngComponentOutlet", ctx.component)("ngComponentOutletInputs", i0.ɵɵpureFunction2(2, _c0, input_r1, ctx_r1.rendererService));
|
|
20
21
|
} }
|
|
21
22
|
function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_0_Template(rf, ctx) { if (rf & 1) {
|
|
22
|
-
const
|
|
23
|
+
const _r3 = i0.ɵɵgetCurrentView();
|
|
23
24
|
i0.ɵɵelementStart(0, "prism-boolean-control", 6);
|
|
24
|
-
i0.ɵɵlistener("valueChange", function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_0_Template_prism_boolean_control_valueChange_0_listener($event) { i0.ɵɵrestoreView(
|
|
25
|
+
i0.ɵɵlistener("valueChange", function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_0_Template_prism_boolean_control_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r3); const input_r1 = i0.ɵɵnextContext(2).$implicit; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.rendererService.updateInput(input_r1.name, $event)); });
|
|
25
26
|
i0.ɵɵelementEnd();
|
|
26
27
|
} if (rf & 2) {
|
|
27
28
|
const input_r1 = i0.ɵɵnextContext(2).$implicit;
|
|
28
|
-
const
|
|
29
|
-
i0.ɵɵproperty("value",
|
|
29
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
30
|
+
i0.ɵɵproperty("value", ctx_r1.asBoolean(ctx_r1.rendererService.inputValues()[input_r1.name]))("label", input_r1.name)("typeName", input_r1.rawType ?? "");
|
|
30
31
|
} }
|
|
31
32
|
function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_1_Template(rf, ctx) { if (rf & 1) {
|
|
32
33
|
const _r4 = i0.ɵɵgetCurrentView();
|
|
33
34
|
i0.ɵɵelementStart(0, "prism-number-control", 6);
|
|
34
|
-
i0.ɵɵlistener("valueChange", function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_1_Template_prism_number_control_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r4); const input_r1 = i0.ɵɵnextContext(2).$implicit; const
|
|
35
|
+
i0.ɵɵlistener("valueChange", function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_1_Template_prism_number_control_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r4); const input_r1 = i0.ɵɵnextContext(2).$implicit; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.rendererService.updateInput(input_r1.name, $event)); });
|
|
35
36
|
i0.ɵɵelementEnd();
|
|
36
37
|
} if (rf & 2) {
|
|
37
38
|
const input_r1 = i0.ɵɵnextContext(2).$implicit;
|
|
38
|
-
const
|
|
39
|
-
i0.ɵɵproperty("value",
|
|
39
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
40
|
+
i0.ɵɵproperty("value", ctx_r1.asNumber(ctx_r1.rendererService.inputValues()[input_r1.name]))("label", input_r1.name)("typeName", input_r1.rawType ?? "");
|
|
40
41
|
} }
|
|
41
42
|
function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_2_Template(rf, ctx) { if (rf & 1) {
|
|
42
43
|
const _r5 = i0.ɵɵgetCurrentView();
|
|
43
44
|
i0.ɵɵelementStart(0, "prism-union-control", 7);
|
|
44
|
-
i0.ɵɵlistener("valueChange", function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_2_Template_prism_union_control_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r5); const input_r1 = i0.ɵɵnextContext(2).$implicit; const
|
|
45
|
+
i0.ɵɵlistener("valueChange", function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_2_Template_prism_union_control_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r5); const input_r1 = i0.ɵɵnextContext(2).$implicit; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.rendererService.updateInput(input_r1.name, $event)); });
|
|
45
46
|
i0.ɵɵelementEnd();
|
|
46
47
|
} if (rf & 2) {
|
|
47
48
|
const input_r1 = i0.ɵɵnextContext(2).$implicit;
|
|
48
|
-
const
|
|
49
|
-
i0.ɵɵproperty("value",
|
|
49
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
50
|
+
i0.ɵɵproperty("value", ctx_r1.asString(ctx_r1.rendererService.inputValues()[input_r1.name]))("label", input_r1.name)("typeName", input_r1.rawType ?? "")("options", input_r1.values ?? i0.ɵɵpureFunction0(4, _c1));
|
|
50
51
|
} }
|
|
51
52
|
function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_3_Template(rf, ctx) { if (rf & 1) {
|
|
52
53
|
const _r6 = i0.ɵɵgetCurrentView();
|
|
53
54
|
i0.ɵɵelementStart(0, "prism-string-control", 6);
|
|
54
|
-
i0.ɵɵlistener("valueChange", function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_3_Template_prism_string_control_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r6); const input_r1 = i0.ɵɵnextContext(2).$implicit; const
|
|
55
|
+
i0.ɵɵlistener("valueChange", function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_3_Template_prism_string_control_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r6); const input_r1 = i0.ɵɵnextContext(2).$implicit; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.rendererService.updateInput(input_r1.name, $event)); });
|
|
55
56
|
i0.ɵɵelementEnd();
|
|
56
57
|
} if (rf & 2) {
|
|
57
58
|
const input_r1 = i0.ɵɵnextContext(2).$implicit;
|
|
58
|
-
const
|
|
59
|
-
i0.ɵɵproperty("value",
|
|
59
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
60
|
+
i0.ɵɵproperty("value", ctx_r1.asString(ctx_r1.rendererService.inputValues()[input_r1.name]))("label", input_r1.name)("typeName", input_r1.rawType ?? "");
|
|
60
61
|
} }
|
|
61
62
|
function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_4_Template(rf, ctx) { if (rf & 1) {
|
|
62
63
|
const _r7 = i0.ɵɵgetCurrentView();
|
|
63
64
|
i0.ɵɵelementStart(0, "prism-json-control", 6);
|
|
64
|
-
i0.ɵɵlistener("valueChange", function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_4_Template_prism_json_control_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r7); const input_r1 = i0.ɵɵnextContext(2).$implicit; const
|
|
65
|
+
i0.ɵɵlistener("valueChange", function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_4_Template_prism_json_control_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r7); const input_r1 = i0.ɵɵnextContext(2).$implicit; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.rendererService.updateInput(input_r1.name, $event)); });
|
|
65
66
|
i0.ɵɵelementEnd();
|
|
66
67
|
} if (rf & 2) {
|
|
67
68
|
const input_r1 = i0.ɵɵnextContext(2).$implicit;
|
|
68
|
-
const
|
|
69
|
-
i0.ɵɵproperty("value",
|
|
69
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
70
|
+
i0.ɵɵproperty("value", ctx_r1.rendererService.inputValues()[input_r1.name])("label", input_r1.name)("typeName", input_r1.rawType ?? "");
|
|
70
71
|
} }
|
|
71
72
|
function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
72
73
|
i0.ɵɵconditionalCreate(0, PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_0_Template, 1, 3, "prism-boolean-control", 4)(1, PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_1_Template, 1, 3, "prism-number-control", 4)(2, PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_2_Template, 1, 5, "prism-union-control", 5)(3, PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_3_Template, 1, 3, "prism-string-control", 4)(4, PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_4_Template, 1, 3, "prism-json-control", 4);
|
|
@@ -77,14 +78,14 @@ function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Template(
|
|
|
77
78
|
} }
|
|
78
79
|
function PrismControlsPanelComponent_Conditional_0_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
79
80
|
i0.ɵɵelementStart(0, "div", 1);
|
|
80
|
-
i0.ɵɵconditionalCreate(1, PrismControlsPanelComponent_Conditional_0_For_2_Conditional_1_Template, 1,
|
|
81
|
+
i0.ɵɵconditionalCreate(1, PrismControlsPanelComponent_Conditional_0_For_2_Conditional_1_Template, 1, 5, "ng-container", 3)(2, PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Template, 5, 1);
|
|
81
82
|
i0.ɵɵelementEnd();
|
|
82
83
|
} if (rf & 2) {
|
|
83
84
|
let tmp_12_0;
|
|
84
85
|
const input_r1 = ctx.$implicit;
|
|
85
|
-
const
|
|
86
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
86
87
|
i0.ɵɵadvance();
|
|
87
|
-
i0.ɵɵconditional((tmp_12_0 =
|
|
88
|
+
i0.ɵɵconditional((tmp_12_0 = ctx_r1.getCustomControl(input_r1)) ? 1 : 2, tmp_12_0);
|
|
88
89
|
} }
|
|
89
90
|
function PrismControlsPanelComponent_Conditional_0_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
90
91
|
i0.ɵɵelementStart(0, "p", 2);
|
|
@@ -149,7 +150,7 @@ export class PrismControlsPanelComponent {
|
|
|
149
150
|
@if (getCustomControl(input); as customCtrl) {
|
|
150
151
|
<ng-container
|
|
151
152
|
[ngComponentOutlet]="customCtrl.component"
|
|
152
|
-
[ngComponentOutletInputs]="{ inputMeta: input }"
|
|
153
|
+
[ngComponentOutletInputs]="{ inputMeta: input, rendererService: rendererService }"
|
|
153
154
|
/>
|
|
154
155
|
} @else {
|
|
155
156
|
@switch (input.type) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prism-panel-host.component.d.ts","sourceRoot":"","sources":["../../../../src/app/panels/panel-host/prism-panel-host.component.ts"],"names":[],"mappings":"AACA,OAAO,EAA0D,mBAAmB,EAAU,SAAS,EAAU,KAAK,IAAI,EAAE,MAAM,eAAe,CAAC;AAKlJ,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;;AAK1E,qBAqFa,uBAAwB,YAAW,SAAS;IACvD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA8B;IAC5D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAkC;IACtD,SAAS,CAAC,QAAQ,CAAC,YAAY,oBAA6B;IAC5D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA+B;IAC3D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA4B;IACzD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAgC;IAEhE,SAAS,CAAC,QAAQ,CAAC,SAAS,gDAAkE;IAE9F,SAAS,CAAC,QAAQ,CAAC,aAAa,gDAK7B;IAEH,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAkB;IAEhD,SAAS,CAAC,QAAQ,CAAC,SAAS,gFAGzB;IACH,SAAS,CAAC,QAAQ,CAAC,iBAAiB,+DAAsC;IAC1E,SAAS,CAAC,QAAQ,CAAC,WAAW;;OAE1B;IAEJ,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoC;IAC9D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA0C;IAExE,SAAS,CAAC,QAAQ,CAAC,cAAc,sDAY9B;;
|
|
1
|
+
{"version":3,"file":"prism-panel-host.component.d.ts","sourceRoot":"","sources":["../../../../src/app/panels/panel-host/prism-panel-host.component.ts"],"names":[],"mappings":"AACA,OAAO,EAA0D,mBAAmB,EAAU,SAAS,EAAU,KAAK,IAAI,EAAE,MAAM,eAAe,CAAC;AAKlJ,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;;AAK1E,qBAqFa,uBAAwB,YAAW,SAAS;IACvD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA8B;IAC5D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAkC;IACtD,SAAS,CAAC,QAAQ,CAAC,YAAY,oBAA6B;IAC5D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA+B;IAC3D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA4B;IACzD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAgC;IAEhE,SAAS,CAAC,QAAQ,CAAC,SAAS,gDAAkE;IAE9F,SAAS,CAAC,QAAQ,CAAC,aAAa,gDAK7B;IAEH,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAkB;IAEhD,SAAS,CAAC,QAAQ,CAAC,SAAS,gFAGzB;IACH,SAAS,CAAC,QAAQ,CAAC,iBAAiB,+DAAsC;IAC1E,SAAS,CAAC,QAAQ,CAAC,WAAW;;OAE1B;IAEJ,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoC;IAC9D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA0C;IAExE,SAAS,CAAC,QAAQ,CAAC,cAAc,sDAY9B;;IA0DH,WAAW,IAAI,IAAI;yCArGR,uBAAuB;2CAAvB,uBAAuB;CAwGnC"}
|
|
@@ -86,6 +86,10 @@ export class PrismPanelHostComponent {
|
|
|
86
86
|
return this.injectorCache.get(panel.id);
|
|
87
87
|
}, ...(ngDevMode ? [{ debugName: "activeInjector" }] : []));
|
|
88
88
|
constructor() {
|
|
89
|
+
effect(() => {
|
|
90
|
+
const injector = this.activeInjector();
|
|
91
|
+
this.panelService.activePanelInjector.set(injector === this.envInjector ? null : injector);
|
|
92
|
+
});
|
|
89
93
|
effect(() => {
|
|
90
94
|
const element = this.rendererService.renderedElement();
|
|
91
95
|
const comp = this.nav.activeComponent();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Type } from '@angular/core';
|
|
1
|
+
import { Injector, type Type } from '@angular/core';
|
|
2
2
|
import { A11yPerspectiveService } from '../panels/a11y/a11y-perspective.service.js';
|
|
3
3
|
import { PrismNavigationService } from '../services/prism-navigation.service.js';
|
|
4
4
|
import { PrismRendererService } from '../services/prism-renderer.service.js';
|
|
@@ -21,6 +21,10 @@ export declare class PrismRendererComponent {
|
|
|
21
21
|
private readonly pluginService;
|
|
22
22
|
private readonly overlayCache;
|
|
23
23
|
readonly activeOverlay: import("@angular/core").WritableSignal<Type<unknown> | null>;
|
|
24
|
+
protected readonly overlayInputs: {
|
|
25
|
+
rendererService: PrismRendererService;
|
|
26
|
+
};
|
|
27
|
+
protected readonly overlayInjector: import("@angular/core").Signal<import("@angular/core").EnvironmentInjector | Injector>;
|
|
24
28
|
readonly codeVisible: import("@angular/core").WritableSignal<boolean>;
|
|
25
29
|
readonly snippet: import("@angular/core").Signal<string>;
|
|
26
30
|
constructor();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prism-renderer.component.d.ts","sourceRoot":"","sources":["../../../src/app/renderer/prism-renderer.component.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"prism-renderer.component.d.ts","sourceRoot":"","sources":["../../../src/app/renderer/prism-renderer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,QAAQ,EAER,KAAK,IAAI,EAIV,MAAM,eAAe,CAAC;AAOvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAIpF,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAGjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;;AAG7E,qBA4Ka,sBAAsB;IACjC,SAAS,CAAC,QAAQ,CAAC,iBAAiB,yBAAkC;IACtE,SAAS,CAAC,QAAQ,CAAC,eAAe,uBAAgC;IAClE,SAAS,CAAC,QAAQ,CAAC,kBAAkB,yBAAkC;IACvE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAgC;IAChE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAgC;IAChE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoB;IAC7C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAsB;IACjD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAoD;IAElF,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4D;IACnF,OAAO,CAAC,YAAY,CAAsC;IAC1D,OAAO,CAAC,mBAAmB,CAAsC;IACjE,OAAO,CAAC,oBAAoB,CAA0D;IACtF,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA6B;IAC1D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA8B;IAC5D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAoC;IACjE,QAAQ,CAAC,aAAa,+DAAsC;IAC5D,SAAS,CAAC,QAAQ,CAAC,aAAa;;MAA6C;IAE7E,SAAS,CAAC,QAAQ,CAAC,eAAe,yFAG/B;IAEH,QAAQ,CAAC,WAAW,kDAAiB;IAErC,QAAQ,CAAC,OAAO,yCAgBb;;IAiFH,OAAO,CAAC,eAAe;IAiEvB,OAAO,CAAC,OAAO;yCA9LJ,sBAAsB;2CAAtB,sBAAsB;CA4MlC"}
|
|
@@ -50,7 +50,7 @@ function PrismRendererComponent_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
|
50
50
|
i0.ɵɵtemplate(0, PrismRendererComponent_Conditional_5_ng_container_0_Template, 1, 0, "ng-container", 8);
|
|
51
51
|
} if (rf & 2) {
|
|
52
52
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
53
|
-
i0.ɵɵproperty("ngComponentOutlet", ctx_r2.activeOverlay());
|
|
53
|
+
i0.ɵɵproperty("ngComponentOutlet", ctx_r2.activeOverlay())("ngComponentOutletInputs", ctx_r2.overlayInputs)("ngComponentOutletInjector", ctx_r2.overlayInjector());
|
|
54
54
|
} }
|
|
55
55
|
function PrismRendererComponent_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
56
56
|
const _r6 = i0.ɵɵgetCurrentView();
|
|
@@ -90,6 +90,11 @@ export class PrismRendererComponent {
|
|
|
90
90
|
pluginService = inject(PrismPluginService);
|
|
91
91
|
overlayCache = new Map();
|
|
92
92
|
activeOverlay = signal(null, ...(ngDevMode ? [{ debugName: "activeOverlay" }] : []));
|
|
93
|
+
overlayInputs = { rendererService: this.rendererService };
|
|
94
|
+
overlayInjector = computed(() => {
|
|
95
|
+
const panelInjector = this.panelService.activePanelInjector();
|
|
96
|
+
return panelInjector ?? this.injector;
|
|
97
|
+
}, ...(ngDevMode ? [{ debugName: "overlayInjector" }] : []));
|
|
93
98
|
codeVisible = signal(false, ...(ngDevMode ? [{ debugName: "codeVisible" }] : []));
|
|
94
99
|
snippet = computed(() => {
|
|
95
100
|
const comp = this.navigationService.activeComponent();
|
|
@@ -131,7 +136,12 @@ export class PrismRendererComponent {
|
|
|
131
136
|
return;
|
|
132
137
|
}
|
|
133
138
|
performance.mark('prism:rerender:start');
|
|
139
|
+
const knownInputs = new Set(comp.meta.inputs.map((i) => i.name));
|
|
134
140
|
for (const [key, value] of Object.entries(inputs)) {
|
|
141
|
+
if (!knownInputs.has(key)) {
|
|
142
|
+
console.warn(`[ng-prism] Unknown input "${key}" on <${comp.meta.componentMeta.selector}> — skipping. Remove it from @Showcase variants.`);
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
135
145
|
ref.setInput(key, value);
|
|
136
146
|
}
|
|
137
147
|
ref.changeDetectorRef.detectChanges();
|
|
@@ -205,7 +215,12 @@ export class PrismRendererComponent {
|
|
|
205
215
|
this.outputSubscriptions.push(sub);
|
|
206
216
|
}
|
|
207
217
|
}
|
|
218
|
+
const knownInputs = new Set(comp.meta.inputs.map((i) => i.name));
|
|
208
219
|
for (const [key, value] of Object.entries(this.rendererService.inputValues())) {
|
|
220
|
+
if (!knownInputs.has(key)) {
|
|
221
|
+
console.warn(`[ng-prism] Unknown input "${key}" on <${selector}> — skipping. Remove it from @Showcase variants.`);
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
209
224
|
this.componentRef.setInput(key, value);
|
|
210
225
|
}
|
|
211
226
|
this.componentRef.changeDetectorRef.detectChanges();
|
|
@@ -233,12 +248,12 @@ export class PrismRendererComponent {
|
|
|
233
248
|
i0.ɵɵviewQuerySignal(ctx.outlet, _c0, 5, ViewContainerRef);
|
|
234
249
|
} if (rf & 2) {
|
|
235
250
|
i0.ɵɵqueryAdvance();
|
|
236
|
-
} }, decls: 8, vars: 6, consts: [["outlet", ""], [1, "prism-renderer"], [1, "prism-renderer__canvas"], [1, "prism-renderer__code-bar"], [1, "prism-renderer__code"], [1, "prism-renderer__toolbar"], [1, "prism-renderer__variant", 3, "prism-renderer__variant--active"], [1, "prism-renderer__variant", 3, "click"], [4, "ngComponentOutlet"], [1, "prism-renderer__code-button", 3, "click"], ["language", "xml", 3, "highlight"]], template: function PrismRendererComponent_Template(rf, ctx) { if (rf & 1) {
|
|
251
|
+
} }, decls: 8, vars: 6, consts: [["outlet", ""], [1, "prism-renderer"], [1, "prism-renderer__canvas"], [1, "prism-renderer__code-bar"], [1, "prism-renderer__code"], [1, "prism-renderer__toolbar"], [1, "prism-renderer__variant", 3, "prism-renderer__variant--active"], [1, "prism-renderer__variant", 3, "click"], [4, "ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector"], [1, "prism-renderer__code-button", 3, "click"], ["language", "xml", 3, "highlight"]], template: function PrismRendererComponent_Template(rf, ctx) { if (rf & 1) {
|
|
237
252
|
i0.ɵɵelementStart(0, "div", 1);
|
|
238
253
|
i0.ɵɵconditionalCreate(1, PrismRendererComponent_Conditional_1_Template, 1, 1);
|
|
239
254
|
i0.ɵɵelementStart(2, "div", 2);
|
|
240
255
|
i0.ɵɵelementContainer(3, null, 0);
|
|
241
|
-
i0.ɵɵconditionalCreate(5, PrismRendererComponent_Conditional_5_Template, 1,
|
|
256
|
+
i0.ɵɵconditionalCreate(5, PrismRendererComponent_Conditional_5_Template, 1, 3, "ng-container");
|
|
242
257
|
i0.ɵɵelementEnd();
|
|
243
258
|
i0.ɵɵconditionalCreate(6, PrismRendererComponent_Conditional_6_Template, 3, 2, "div", 3);
|
|
244
259
|
i0.ɵɵconditionalCreate(7, PrismRendererComponent_Conditional_7_Template, 3, 1, "div", 4);
|
|
@@ -279,7 +294,11 @@ export class PrismRendererComponent {
|
|
|
279
294
|
<div class="prism-renderer__canvas" [class.prism-renderer__canvas--sr]="perspectiveService.mode() === 'screen-reader'">
|
|
280
295
|
<ng-container #outlet />
|
|
281
296
|
@if (activeOverlay()) {
|
|
282
|
-
<ng-container
|
|
297
|
+
<ng-container
|
|
298
|
+
*ngComponentOutlet="activeOverlay()!;
|
|
299
|
+
inputs: overlayInputs;
|
|
300
|
+
injector: overlayInjector()"
|
|
301
|
+
/>
|
|
283
302
|
}
|
|
284
303
|
</div>
|
|
285
304
|
@if (snippet()) {
|
|
@@ -301,7 +320,7 @@ export class PrismRendererComponent {
|
|
|
301
320
|
</div>
|
|
302
321
|
`, styles: ["\n .prism-renderer {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-height: 0;\n }\n\n .prism-renderer__toolbar {\n display: flex;\n align-items: center;\n padding: 0 8px;\n border-bottom: 1px solid var(--prism-border);\n flex-shrink: 0;\n background: var(--prism-bg-elevated);\n }\n .prism-renderer__variant {\n padding: 8px 14px;\n font-size: 13px;\n font-family: var(--prism-font-sans);\n border: none;\n background: none;\n color: var(--prism-text-muted);\n cursor: pointer;\n position: relative;\n margin-bottom: -1px;\n transition: color 0.12s;\n }\n .prism-renderer__variant::after {\n content: '';\n position: absolute;\n bottom: 0; left: 0; right: 0;\n height: 2px;\n background: linear-gradient(90deg, var(--prism-primary-from), var(--prism-primary-to));\n opacity: 0;\n transition: opacity 0.12s;\n }\n .prism-renderer__variant:hover { color: var(--prism-text); }\n .prism-renderer__variant--active { color: var(--prism-primary); }\n .prism-renderer__variant--active::after { opacity: 1; }\n\n .prism-renderer__canvas {\n position: relative;\n flex: 1;\n padding: 48px 40px;\n overflow: auto;\n background-color: var(--prism-bg-surface);\n background-image: radial-gradient(\n circle,\n color-mix(in srgb, var(--prism-primary) 15%, transparent) 1px,\n transparent 1px\n );\n background-size: 20px 20px;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n transition: filter 0.2s;\n }\n .prism-renderer__canvas--sr {\n filter: brightness(0.82) saturate(0.7);\n }\n\n .prism-renderer__code-bar {\n display: flex;\n align-items: center;\n padding: 0 12px;\n border-top: 1px solid var(--prism-border);\n flex-shrink: 0;\n background: var(--prism-bg-elevated);\n }\n .prism-renderer__code-button {\n display: flex;\n align-items: center;\n gap: 5px;\n padding: 6px 8px;\n font-size: 11.5px;\n font-family: var(--prism-font-mono, monospace);\n border: none;\n background: none;\n color: var(--prism-text-muted);\n cursor: pointer;\n position: relative;\n transition: color 0.12s;\n margin-bottom: -1px;\n }\n .prism-renderer__code-button::after {\n content: '';\n position: absolute;\n bottom: 0; left: 4px; right: 4px;\n height: 2px;\n background: linear-gradient(90deg, var(--prism-primary-from), var(--prism-primary-to));\n opacity: 0;\n transition: opacity 0.12s;\n }\n .prism-renderer__code-button:hover { color: var(--prism-text-2); }\n .prism-renderer__code-button--active { color: var(--prism-primary); }\n .prism-renderer__code-button--active::after { opacity: 1; }\n\n .prism-renderer__code {\n border-top: 1px solid var(--prism-border);\n overflow: auto;\n flex-shrink: 0;\n max-height: 240px;\n background: var(--prism-void);\n }\n .prism-renderer__code pre {\n margin: 0;\n padding: 20px 24px;\n font-size: 12.5px;\n line-height: 1.65;\n font-family: var(--prism-font-mono);\n }\n .prism-renderer__code code { font-family: inherit; }\n :host ::ng-deep .prism-renderer__code .hljs {\n background: transparent;\n color: var(--prism-text-2);\n }\n :host ::ng-deep .prism-renderer__code .hljs-tag { color: var(--prism-text-muted); }\n :host ::ng-deep .prism-renderer__code .hljs-name { color: var(--prism-primary); }\n :host ::ng-deep .prism-renderer__code .hljs-attr { color: #93c5fd; }\n :host ::ng-deep .prism-renderer__code .hljs-string { color: #7dd3fc; }\n "] }]
|
|
303
322
|
}], () => [], { outlet: [{ type: i0.ViewChild, args: ['outlet', { ...{ read: ViewContainerRef }, isSignal: true }] }] }); })();
|
|
304
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismRendererComponent, { className: "PrismRendererComponent", filePath: "app/renderer/prism-renderer.component.ts", lineNumber:
|
|
323
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismRendererComponent, { className: "PrismRendererComponent", filePath: "app/renderer/prism-renderer.component.ts", lineNumber: 203 }); })();
|
|
305
324
|
function parseContentToNodes(content) {
|
|
306
325
|
if (typeof content === 'string') {
|
|
307
326
|
return [htmlToNodes(content)];
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { EnvironmentInjector } from '@angular/core';
|
|
1
2
|
import * as i0 from "@angular/core";
|
|
2
3
|
export declare class PrismPanelService {
|
|
3
4
|
readonly activePanelId: import("@angular/core").WritableSignal<string>;
|
|
4
5
|
readonly activeViewId: import("@angular/core").WritableSignal<string>;
|
|
6
|
+
readonly activePanelInjector: import("@angular/core").WritableSignal<EnvironmentInjector | null>;
|
|
5
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<PrismPanelService, never>;
|
|
6
8
|
static ɵprov: i0.ɵɵInjectableDeclaration<PrismPanelService>;
|
|
7
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prism-panel.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-panel.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prism-panel.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-panel.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAsB,MAAM,eAAe,CAAC;;AAExE,qBACa,iBAAiB;IAC5B,QAAQ,CAAC,aAAa,iDAA8B;IACpD,QAAQ,CAAC,YAAY,iDAA8B;IACnD,QAAQ,CAAC,mBAAmB,qEAA4C;yCAH7D,iBAAiB;6CAAjB,iBAAiB;CAI7B"}
|
|
@@ -3,6 +3,7 @@ import * as i0 from "@angular/core";
|
|
|
3
3
|
export class PrismPanelService {
|
|
4
4
|
activePanelId = signal('controls', ...(ngDevMode ? [{ debugName: "activePanelId" }] : []));
|
|
5
5
|
activeViewId = signal('renderer', ...(ngDevMode ? [{ debugName: "activeViewId" }] : []));
|
|
6
|
+
activePanelInjector = signal(null, ...(ngDevMode ? [{ debugName: "activePanelInjector" }] : []));
|
|
6
7
|
static ɵfac = function PrismPanelService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PrismPanelService)(); };
|
|
7
8
|
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: PrismPanelService, factory: PrismPanelService.ɵfac, providedIn: 'root' });
|
|
8
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prism-renderer.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-renderer.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;;AAGrE,qBACa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAkC;IAEpE,QAAQ,CAAC,kBAAkB,iDAAa;IACxC,QAAQ,CAAC,WAAW,kEAAuC;IAC3D,QAAQ,CAAC,aAAa,sFAAkE;IACxF,QAAQ,CAAC,eAAe,yDAAgC;IAExD,OAAO,CAAC,cAAc,CAAuB;IAE7C,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;IAM/C,qBAAqB,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;IAoCnD,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAMlC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAI/C,OAAO,CAAC,YAAY;yCA9DT,oBAAoB;6CAApB,oBAAoB;
|
|
1
|
+
{"version":3,"file":"prism-renderer.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-renderer.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;;AAGrE,qBACa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAkC;IAEpE,QAAQ,CAAC,kBAAkB,iDAAa;IACxC,QAAQ,CAAC,WAAW,kEAAuC;IAC3D,QAAQ,CAAC,aAAa,sFAAkE;IACxF,QAAQ,CAAC,eAAe,yDAAgC;IAExD,OAAO,CAAC,cAAc,CAAuB;IAE7C,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;IAM/C,qBAAqB,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;IAoCnD,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAMlC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAI/C,OAAO,CAAC,YAAY;yCA9DT,oBAAoB;6CAApB,oBAAoB;CAuGhC"}
|
|
@@ -68,7 +68,15 @@ export class PrismRendererService {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
const variant = comp.meta.showcaseConfig.variants?.[index];
|
|
71
|
-
const
|
|
71
|
+
const variantInputs = variant?.inputs ?? {};
|
|
72
|
+
const validInputNames = new Set(comp.meta.inputs.map((i) => i.name));
|
|
73
|
+
for (const key of Object.keys(variantInputs)) {
|
|
74
|
+
if (!validInputNames.has(key)) {
|
|
75
|
+
console.warn(`[ng-prism] Variant "${variant?.name ?? index}" references unknown input "${key}" on ${comp.meta.className} — ignoring.`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const filteredVariantInputs = Object.fromEntries(Object.entries(variantInputs).filter(([key]) => validInputNames.has(key)));
|
|
79
|
+
const values = { ...reset, ...defaults, ...filteredVariantInputs };
|
|
72
80
|
if (comp.meta.componentMeta.isDirective && variant?.content) {
|
|
73
81
|
values['__prismContent__'] = typeof variant.content === 'string' ? variant.content : '';
|
|
74
82
|
}
|