@ng-prism/core 21.8.2 → 21.9.1
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/a11y/a11y-keyboard-overlay.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-keyboard-overlay.component.js +21 -20
- package/dist/app/panels/a11y/a11y-overlay-host.component.d.ts +14 -2
- package/dist/app/panels/a11y/a11y-overlay-host.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-overlay-host.component.js +92 -27
- package/dist/app/panels/a11y/a11y-sr-overlay.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-sr-overlay.component.js +20 -20
- package/dist/app/panels/panel-host/prism-panel-host.component.d.ts +2 -4
- 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 +3 -20
- package/dist/app/provide-prism.d.ts.map +1 -1
- package/dist/app/provide-prism.js +3 -1
- package/dist/app/renderer/prism-renderer.component.d.ts.map +1 -1
- package/dist/app/renderer/prism-renderer.component.js +3 -3
- package/dist/app/services/prism-panel.service.d.ts +5 -1
- package/dist/app/services/prism-panel.service.d.ts.map +1 -1
- package/dist/app/services/prism-panel.service.js +20 -2
- package/dist/app/tokens/prism-tokens.d.ts +2 -1
- package/dist/app/tokens/prism-tokens.d.ts.map +1 -1
- package/dist/app/tokens/prism-tokens.js +1 -0
- package/dist/schematics/ng-add/index.d.ts.map +1 -1
- package/dist/schematics/ng-add/index.js +33 -14
- package/dist/schematics/ng-add/schema.d.ts +1 -0
- package/dist/schematics/ng-add/schema.d.ts.map +1 -1
- package/package.json +1 -1
- package/schematics/ng-add/schema.json +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a11y-keyboard-overlay.component.d.ts","sourceRoot":"","sources":["../../../../src/app/panels/a11y/a11y-keyboard-overlay.component.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;;AAGtE,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,
|
|
1
|
+
{"version":3,"file":"a11y-keyboard-overlay.component.d.ts","sourceRoot":"","sources":["../../../../src/app/panels/a11y/a11y-keyboard-overlay.component.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;;AAGtE,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qBA6Da,4BAA4B;IACvC,SAAS,CAAC,QAAQ,CAAC,UAAU,wBAAiC;IAC9D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAgC;IAChE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA+B;IAC/D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAmC;IAE9D,SAAS,CAAC,QAAQ,CAAC,MAAM,0DAA+B;IAExD,OAAO,CAAC,KAAK,CAAuB;;IAsBpC,OAAO,CAAC,aAAa;yCA9BV,4BAA4B;2CAA5B,4BAA4B;CA6DxC"}
|
|
@@ -16,7 +16,7 @@ function A11yKeyboardOverlayComponent_Conditional_0_For_1_Template(rf, ctx) { if
|
|
|
16
16
|
i0.ɵɵadvance();
|
|
17
17
|
i0.ɵɵstyleProp("left", badge_r1.x - 10, "px")("top", badge_r1.y - 10, "px");
|
|
18
18
|
i0.ɵɵadvance();
|
|
19
|
-
i0.ɵɵ
|
|
19
|
+
i0.ɵɵtextInterpolate1(" ", badge_r1.index, " ");
|
|
20
20
|
} }
|
|
21
21
|
function A11yKeyboardOverlayComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
22
22
|
i0.ɵɵrepeaterCreate(0, A11yKeyboardOverlayComponent_Conditional_0_For_1_Template, 3, 14, null, null, _forTrack0);
|
|
@@ -50,7 +50,7 @@ export class A11yKeyboardOverlayComponent {
|
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
computeBadges(root) {
|
|
53
|
-
const canvas = this.elementRef.nativeElement.closest('.prism-
|
|
53
|
+
const canvas = this.elementRef.nativeElement.closest('.prism-canvas-stage');
|
|
54
54
|
if (!canvas)
|
|
55
55
|
return;
|
|
56
56
|
const doc = root.ownerDocument;
|
|
@@ -82,23 +82,24 @@ export class A11yKeyboardOverlayComponent {
|
|
|
82
82
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(A11yKeyboardOverlayComponent, [{
|
|
83
83
|
type: Component,
|
|
84
84
|
args: [{ selector: 'prism-a11y-kbd-overlay', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
85
|
-
@if (panelState.activeTab() === 'keyboard') {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
|
|
85
|
+
@if (panelState.activeTab() === 'keyboard') { @for (badge of badges(); track
|
|
86
|
+
badge.index) {
|
|
87
|
+
<div
|
|
88
|
+
class="prism-a11y-kbd-ov__highlight"
|
|
89
|
+
[style.left.px]="badge.x"
|
|
90
|
+
[style.top.px]="badge.y"
|
|
91
|
+
[style.width.px]="badge.width"
|
|
92
|
+
[style.height.px]="badge.height"
|
|
93
|
+
[title]="badge.name || badge.role"
|
|
94
|
+
></div>
|
|
95
|
+
<div
|
|
96
|
+
class="prism-a11y-kbd-ov__badge"
|
|
97
|
+
[style.left.px]="badge.x - 10"
|
|
98
|
+
[style.top.px]="badge.y - 10"
|
|
99
|
+
>
|
|
100
|
+
{{ badge.index }}
|
|
101
|
+
</div>
|
|
102
|
+
} }
|
|
102
103
|
`, styles: ["\n :host {\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 100;\n overflow: hidden;\n }\n\n .prism-a11y-kbd-ov__highlight {\n position: absolute;\n border: 2px solid rgba(129, 140, 248, 0.5);\n border-radius: 4px;\n background: rgba(129, 140, 248, 0.06);\n box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.08);\n pointer-events: none;\n }\n\n .prism-a11y-kbd-ov__badge {\n position: absolute;\n width: 20px;\n height: 20px;\n background: var(--prism-primary);\n color: white;\n border-radius: 50%;\n font-size: 10px;\n font-weight: 700;\n display: flex;\n align-items: center;\n justify-content: center;\n box-shadow: 0 0 0 2px white, 0 2px 6px rgba(0, 0, 0, 0.3);\n font-family: var(--prism-font-sans, system-ui, sans-serif);\n pointer-events: auto;\n cursor: default;\n }\n "] }]
|
|
103
104
|
}], () => [], null); })();
|
|
104
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(A11yKeyboardOverlayComponent, { className: "A11yKeyboardOverlayComponent", filePath: "app/panels/a11y/a11y-keyboard-overlay.component.ts", lineNumber:
|
|
105
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(A11yKeyboardOverlayComponent, { className: "A11yKeyboardOverlayComponent", filePath: "app/panels/a11y/a11y-keyboard-overlay.component.ts", lineNumber: 84 }); })();
|
|
@@ -1,10 +1,22 @@
|
|
|
1
|
+
import { PrismRendererService } from '../../services/prism-renderer.service.js';
|
|
1
2
|
import * as i0 from "@angular/core";
|
|
3
|
+
interface Bounds {
|
|
4
|
+
top: number;
|
|
5
|
+
left: number;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
}
|
|
2
9
|
export declare class A11yOverlayHostComponent {
|
|
3
|
-
|
|
10
|
+
readonly rendererService: import("@angular/core").InputSignal<PrismRendererService>;
|
|
4
11
|
private readonly keyboardService;
|
|
12
|
+
private readonly elementRef;
|
|
13
|
+
private readonly layoutTick;
|
|
14
|
+
protected readonly bounds: import("@angular/core").Signal<Bounds | null>;
|
|
5
15
|
protected readonly roleLabel: import("@angular/core").Signal<string | null>;
|
|
6
16
|
protected readonly tabLabel: import("@angular/core").Signal<string | null>;
|
|
17
|
+
constructor();
|
|
7
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<A11yOverlayHostComponent, never>;
|
|
8
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<A11yOverlayHostComponent, "prism-a11y-overlay-host", never, {}, {}, never, never, true, never>;
|
|
19
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<A11yOverlayHostComponent, "prism-a11y-overlay-host", never, { "rendererService": { "alias": "rendererService"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
9
20
|
}
|
|
21
|
+
export {};
|
|
10
22
|
//# sourceMappingURL=a11y-overlay-host.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a11y-overlay-host.component.d.ts","sourceRoot":"","sources":["../../../../src/app/panels/a11y/a11y-overlay-host.component.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"a11y-overlay-host.component.d.ts","sourceRoot":"","sources":["../../../../src/app/panels/a11y/a11y-overlay-host.component.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;;AAEhF,UAAU,MAAM;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qBAyDa,wBAAwB;IACnC,QAAQ,CAAC,eAAe,4DAA0C;IAClE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA+B;IAC/D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAmC;IAE9D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IAExC,SAAS,CAAC,QAAQ,CAAC,MAAM,gDActB;IAEH,SAAS,CAAC,QAAQ,CAAC,SAAS,gDAKzB;IAEH,SAAS,CAAC,QAAQ,CAAC,QAAQ,gDAUxB;;yCAxCQ,wBAAwB;2CAAxB,wBAAwB;CA2DpC"}
|
|
@@ -1,37 +1,72 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, computed, inject, } from '@angular/core';
|
|
1
|
+
import { ChangeDetectionStrategy, Component, computed, effect, ElementRef, inject, input, signal, } from '@angular/core';
|
|
2
2
|
import { A11yKeyboardService } from './a11y-keyboard.service.js';
|
|
3
|
-
import { PrismRendererService } from '../../services/prism-renderer.service.js';
|
|
4
3
|
import * as i0 from "@angular/core";
|
|
5
|
-
function
|
|
6
|
-
i0.ɵɵdomElementStart(0, "div",
|
|
4
|
+
function A11yOverlayHostComponent_Conditional_0_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
5
|
+
i0.ɵɵdomElementStart(0, "div", 3)(1, "span", 4);
|
|
7
6
|
i0.ɵɵtext(2);
|
|
8
7
|
i0.ɵɵdomElementEnd()();
|
|
9
8
|
} if (rf & 2) {
|
|
10
|
-
const
|
|
9
|
+
const b_r1 = i0.ɵɵnextContext();
|
|
10
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
11
|
+
i0.ɵɵstyleProp("top", b_r1.top - 22, "px")("left", b_r1.left - 2, "px");
|
|
11
12
|
i0.ɵɵadvance(2);
|
|
12
|
-
i0.ɵɵtextInterpolate(
|
|
13
|
+
i0.ɵɵtextInterpolate(ctx_r1.roleLabel());
|
|
13
14
|
} }
|
|
14
|
-
function
|
|
15
|
-
i0.ɵɵdomElementStart(0, "div",
|
|
15
|
+
function A11yOverlayHostComponent_Conditional_0_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
16
|
+
i0.ɵɵdomElementStart(0, "div", 5)(1, "span", 4);
|
|
16
17
|
i0.ɵɵtext(2);
|
|
17
18
|
i0.ɵɵdomElementEnd()();
|
|
18
19
|
} if (rf & 2) {
|
|
19
|
-
const
|
|
20
|
+
const b_r1 = i0.ɵɵnextContext();
|
|
21
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
22
|
+
i0.ɵɵstyleProp("top", b_r1.top + b_r1.height + 4, "px")("left", b_r1.left + b_r1.width + 2, "px");
|
|
20
23
|
i0.ɵɵadvance(2);
|
|
21
|
-
i0.ɵɵtextInterpolate(
|
|
24
|
+
i0.ɵɵtextInterpolate(ctx_r1.tabLabel());
|
|
25
|
+
} }
|
|
26
|
+
function A11yOverlayHostComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
27
|
+
i0.ɵɵdomElement(0, "div", 0);
|
|
28
|
+
i0.ɵɵconditionalCreate(1, A11yOverlayHostComponent_Conditional_0_Conditional_1_Template, 3, 5, "div", 1);
|
|
29
|
+
i0.ɵɵconditionalCreate(2, A11yOverlayHostComponent_Conditional_0_Conditional_2_Template, 3, 5, "div", 2);
|
|
30
|
+
} if (rf & 2) {
|
|
31
|
+
const b_r1 = ctx;
|
|
32
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
33
|
+
i0.ɵɵstyleProp("top", b_r1.top, "px")("left", b_r1.left, "px")("width", b_r1.width, "px")("height", b_r1.height, "px");
|
|
34
|
+
i0.ɵɵadvance();
|
|
35
|
+
i0.ɵɵconditional(ctx_r1.roleLabel() ? 1 : -1);
|
|
36
|
+
i0.ɵɵadvance();
|
|
37
|
+
i0.ɵɵconditional(ctx_r1.tabLabel() ? 2 : -1);
|
|
22
38
|
} }
|
|
23
39
|
export class A11yOverlayHostComponent {
|
|
24
|
-
rendererService =
|
|
40
|
+
rendererService = input.required(...(ngDevMode ? [{ debugName: "rendererService" }] : []));
|
|
25
41
|
keyboardService = inject(A11yKeyboardService);
|
|
42
|
+
elementRef = inject((ElementRef));
|
|
43
|
+
layoutTick = signal(0, ...(ngDevMode ? [{ debugName: "layoutTick" }] : []));
|
|
44
|
+
bounds = computed(() => {
|
|
45
|
+
const el = this.rendererService().renderedElement();
|
|
46
|
+
this.layoutTick();
|
|
47
|
+
if (!el)
|
|
48
|
+
return null;
|
|
49
|
+
const parent = this.elementRef.nativeElement.parentElement;
|
|
50
|
+
if (!parent)
|
|
51
|
+
return null;
|
|
52
|
+
const elRect = el.getBoundingClientRect();
|
|
53
|
+
const parentRect = parent.getBoundingClientRect();
|
|
54
|
+
return {
|
|
55
|
+
top: elRect.top - parentRect.top,
|
|
56
|
+
left: elRect.left - parentRect.left,
|
|
57
|
+
width: elRect.width,
|
|
58
|
+
height: elRect.height,
|
|
59
|
+
};
|
|
60
|
+
}, ...(ngDevMode ? [{ debugName: "bounds" }] : []));
|
|
26
61
|
roleLabel = computed(() => {
|
|
27
|
-
const el = this.rendererService.renderedElement();
|
|
62
|
+
const el = this.rendererService().renderedElement();
|
|
28
63
|
if (!el)
|
|
29
64
|
return null;
|
|
30
65
|
const role = el.getAttribute('role') ?? implicitRole(el);
|
|
31
66
|
return role ? `role="${role}"` : null;
|
|
32
67
|
}, ...(ngDevMode ? [{ debugName: "roleLabel" }] : []));
|
|
33
68
|
tabLabel = computed(() => {
|
|
34
|
-
const el = this.rendererService.renderedElement();
|
|
69
|
+
const el = this.rendererService().renderedElement();
|
|
35
70
|
if (!el)
|
|
36
71
|
return null;
|
|
37
72
|
const doc = el.ownerDocument;
|
|
@@ -40,34 +75,64 @@ export class A11yOverlayHostComponent {
|
|
|
40
75
|
return null;
|
|
41
76
|
return `Tab ${items[0].index}`;
|
|
42
77
|
}, ...(ngDevMode ? [{ debugName: "tabLabel" }] : []));
|
|
78
|
+
constructor() {
|
|
79
|
+
effect((onCleanup) => {
|
|
80
|
+
const el = this.rendererService().renderedElement();
|
|
81
|
+
if (!el)
|
|
82
|
+
return;
|
|
83
|
+
const ro = new ResizeObserver(() => this.layoutTick.update((v) => v + 1));
|
|
84
|
+
ro.observe(el);
|
|
85
|
+
const parent = this.elementRef.nativeElement.parentElement;
|
|
86
|
+
if (parent)
|
|
87
|
+
ro.observe(parent);
|
|
88
|
+
onCleanup(() => ro.disconnect());
|
|
89
|
+
});
|
|
90
|
+
effect(() => {
|
|
91
|
+
this.rendererService().inputValues();
|
|
92
|
+
this.rendererService().activeVariantIndex();
|
|
93
|
+
this.layoutTick.update((v) => v + 1);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
43
96
|
static ɵfac = function A11yOverlayHostComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || A11yOverlayHostComponent)(); };
|
|
44
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: A11yOverlayHostComponent, selectors: [["prism-a11y-overlay-host"]], decls:
|
|
45
|
-
i0.ɵɵ
|
|
46
|
-
i0.ɵɵconditionalCreate(1, A11yOverlayHostComponent_Conditional_1_Template, 3, 1, "div", 1);
|
|
47
|
-
i0.ɵɵconditionalCreate(2, A11yOverlayHostComponent_Conditional_2_Template, 3, 1, "div", 2);
|
|
97
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: A11yOverlayHostComponent, selectors: [["prism-a11y-overlay-host"]], inputs: { rendererService: [1, "rendererService"] }, decls: 1, vars: 1, consts: [[1, "a11y-mark", "outline"], [1, "a11y-mark", 3, "top", "left"], [1, "a11y-mark", "kb", 2, "transform", "translateX(-100%)", 3, "top", "left"], [1, "a11y-mark"], [1, "tag"], [1, "a11y-mark", "kb", 2, "transform", "translateX(-100%)"]], template: function A11yOverlayHostComponent_Template(rf, ctx) { if (rf & 1) {
|
|
98
|
+
i0.ɵɵconditionalCreate(0, A11yOverlayHostComponent_Conditional_0_Template, 3, 10);
|
|
48
99
|
} if (rf & 2) {
|
|
49
|
-
|
|
50
|
-
i0.ɵɵconditional(ctx.
|
|
51
|
-
i0.ɵɵadvance();
|
|
52
|
-
i0.ɵɵconditional(ctx.tabLabel() ? 2 : -1);
|
|
100
|
+
let tmp_0_0;
|
|
101
|
+
i0.ɵɵconditional((tmp_0_0 = ctx.bounds()) ? 0 : -1, tmp_0_0);
|
|
53
102
|
} }, styles: ["[_nghost-%COMP%] { display: contents; }\n .a11y-mark[_ngcontent-%COMP%] {\n position: absolute;\n pointer-events: none;\n z-index: 1;\n }\n .outline[_ngcontent-%COMP%] {\n border: 2px solid rgba(59, 130, 246, 0.95);\n border-radius: 4px;\n background: rgba(59, 130, 246, 0.08);\n }\n .tag[_ngcontent-%COMP%] {\n display: inline-block;\n padding: 2px 6px;\n border-radius: 4px;\n background: rgba(17, 24, 39, 0.92);\n color: var(--prism-text-light, #fff);\n font: 11px/1.4 var(--font-mono);\n white-space: nowrap;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);\n }\n .kb[_ngcontent-%COMP%] .tag[_ngcontent-%COMP%] { background: rgba(5, 150, 105, 0.95); }"], changeDetection: 0 });
|
|
54
103
|
}
|
|
55
104
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(A11yOverlayHostComponent, [{
|
|
56
105
|
type: Component,
|
|
57
106
|
args: [{ selector: 'prism-a11y-overlay-host', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
58
|
-
|
|
107
|
+
@if (bounds(); as b) {
|
|
108
|
+
<div
|
|
109
|
+
class="a11y-mark outline"
|
|
110
|
+
[style.top.px]="b.top"
|
|
111
|
+
[style.left.px]="b.left"
|
|
112
|
+
[style.width.px]="b.width"
|
|
113
|
+
[style.height.px]="b.height"
|
|
114
|
+
></div>
|
|
59
115
|
@if (roleLabel()) {
|
|
60
|
-
<div
|
|
116
|
+
<div
|
|
117
|
+
class="a11y-mark"
|
|
118
|
+
[style.top.px]="b.top - 22"
|
|
119
|
+
[style.left.px]="b.left - 2"
|
|
120
|
+
>
|
|
61
121
|
<span class="tag">{{ roleLabel() }}</span>
|
|
62
122
|
</div>
|
|
63
123
|
} @if (tabLabel()) {
|
|
64
|
-
<div
|
|
124
|
+
<div
|
|
125
|
+
class="a11y-mark kb"
|
|
126
|
+
[style.top.px]="b.top + b.height + 4"
|
|
127
|
+
[style.left.px]="b.left + b.width + 2"
|
|
128
|
+
style="transform: translateX(-100%)"
|
|
129
|
+
>
|
|
65
130
|
<span class="tag">{{ tabLabel() }}</span>
|
|
66
131
|
</div>
|
|
67
|
-
}
|
|
132
|
+
} }
|
|
68
133
|
`, styles: ["\n :host { display: contents; }\n .a11y-mark {\n position: absolute;\n pointer-events: none;\n z-index: 1;\n }\n .outline {\n border: 2px solid rgba(59, 130, 246, 0.95);\n border-radius: 4px;\n background: rgba(59, 130, 246, 0.08);\n }\n .tag {\n display: inline-block;\n padding: 2px 6px;\n border-radius: 4px;\n background: rgba(17, 24, 39, 0.92);\n color: var(--prism-text-light, #fff);\n font: 11px/1.4 var(--font-mono);\n white-space: nowrap;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);\n }\n .kb .tag { background: rgba(5, 150, 105, 0.95); }\n "] }]
|
|
69
|
-
}],
|
|
70
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(A11yOverlayHostComponent, { className: "A11yOverlayHostComponent", filePath: "app/panels/a11y/a11y-overlay-host.component.ts", lineNumber:
|
|
134
|
+
}], () => [], { rendererService: [{ type: i0.Input, args: [{ isSignal: true, alias: "rendererService", required: true }] }] }); })();
|
|
135
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(A11yOverlayHostComponent, { className: "A11yOverlayHostComponent", filePath: "app/panels/a11y/a11y-overlay-host.component.ts", lineNumber: 78 }); })();
|
|
71
136
|
function implicitRole(el) {
|
|
72
137
|
const tag = el.tagName.toLowerCase();
|
|
73
138
|
if (tag === 'button')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a11y-sr-overlay.component.d.ts","sourceRoot":"","sources":["../../../../src/app/panels/a11y/a11y-sr-overlay.component.ts"],"names":[],"mappings":";AAaA,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,qBAiEa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAkC;IAC9D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAiC;IAC5D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAgC;IAChE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;IACnD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAmC;IAE9D,SAAS,CAAC,QAAQ,CAAC,MAAM,4DAAiC;IAC1D,SAAS,CAAC,QAAQ,CAAC,WAAW,kDAAiB;IAE/C,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,KAAK,CAAuB;;IA0BpC,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"a11y-sr-overlay.component.d.ts","sourceRoot":"","sources":["../../../../src/app/panels/a11y/a11y-sr-overlay.component.ts"],"names":[],"mappings":";AAaA,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,qBAiEa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAkC;IAC9D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAiC;IAC5D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAgC;IAChE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;IACnD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAmC;IAE9D,SAAS,CAAC,QAAQ,CAAC,MAAM,4DAAiC;IAC1D,SAAS,CAAC,QAAQ,CAAC,WAAW,kDAAiB;IAE/C,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,KAAK,CAAuB;;IA0BpC,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAOjC,OAAO,CAAC,aAAa;yCA5CV,sBAAsB;2CAAtB,sBAAsB;CA8ElC"}
|
|
@@ -23,7 +23,7 @@ function A11ySrOverlayComponent_Conditional_0_For_1_Template(rf, ctx) { if (rf &
|
|
|
23
23
|
i0.ɵɵstyleProp("left", badge_r1.x - 10, "px")("top", badge_r1.y - 10, "px");
|
|
24
24
|
i0.ɵɵclassProp("prism-a11y-sr-ov__badge--active", badge_r1.isActive);
|
|
25
25
|
i0.ɵɵadvance();
|
|
26
|
-
i0.ɵɵ
|
|
26
|
+
i0.ɵɵtextInterpolate1(" ", badge_r1.index, " ");
|
|
27
27
|
} }
|
|
28
28
|
function A11ySrOverlayComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
29
29
|
i0.ɵɵrepeaterCreate(0, A11ySrOverlayComponent_Conditional_0_For_1_Template, 3, 8, null, null, _forTrack0);
|
|
@@ -67,7 +67,7 @@ export class A11ySrOverlayComponent {
|
|
|
67
67
|
this.badges.update((bs) => bs.map((b, i) => ({ ...b, isActive: i === idx })));
|
|
68
68
|
}
|
|
69
69
|
computeBadges(root) {
|
|
70
|
-
const canvas = this.elementRef.nativeElement.closest('.prism-
|
|
70
|
+
const canvas = this.elementRef.nativeElement.closest('.prism-canvas-stage');
|
|
71
71
|
if (!canvas)
|
|
72
72
|
return;
|
|
73
73
|
const doc = root.ownerDocument;
|
|
@@ -103,25 +103,25 @@ export class A11ySrOverlayComponent {
|
|
|
103
103
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(A11ySrOverlayComponent, [{
|
|
104
104
|
type: Component,
|
|
105
105
|
args: [{ selector: 'prism-a11y-sr-overlay', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
106
|
-
@if (showOverlay()) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
></div>
|
|
116
|
-
}
|
|
117
|
-
<div
|
|
118
|
-
class="prism-a11y-sr-ov__badge"
|
|
119
|
-
[class.prism-a11y-sr-ov__badge--active]="badge.isActive"
|
|
120
|
-
[style.left.px]="badge.x - 10"
|
|
121
|
-
[style.top.px]="badge.y - 10"
|
|
122
|
-
>{{ badge.index }}</div>
|
|
123
|
-
}
|
|
106
|
+
@if (showOverlay()) { @for (badge of badges(); track badge.index) { @if
|
|
107
|
+
(badge.isActive) {
|
|
108
|
+
<div
|
|
109
|
+
class="prism-a11y-sr-ov__focus"
|
|
110
|
+
[style.left.px]="badge.x"
|
|
111
|
+
[style.top.px]="badge.y"
|
|
112
|
+
[style.width.px]="badge.width"
|
|
113
|
+
[style.height.px]="badge.height"
|
|
114
|
+
></div>
|
|
124
115
|
}
|
|
116
|
+
<div
|
|
117
|
+
class="prism-a11y-sr-ov__badge"
|
|
118
|
+
[class.prism-a11y-sr-ov__badge--active]="badge.isActive"
|
|
119
|
+
[style.left.px]="badge.x - 10"
|
|
120
|
+
[style.top.px]="badge.y - 10"
|
|
121
|
+
>
|
|
122
|
+
{{ badge.index }}
|
|
123
|
+
</div>
|
|
124
|
+
} }
|
|
125
125
|
`, styles: ["\n :host {\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 100;\n overflow: hidden;\n }\n\n .prism-a11y-sr-ov__focus {\n position: absolute;\n border: 2px solid var(--prism-primary);\n border-radius: 4px;\n background: rgba(167, 139, 250, 0.08);\n box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.12);\n }\n\n .prism-a11y-sr-ov__badge {\n position: absolute;\n height: 18px;\n padding: 0 5px;\n min-width: 18px;\n background: var(--prism-primary);\n color: white;\n border-radius: 9px;\n font-size: 9px;\n font-weight: 700;\n display: flex;\n align-items: center;\n justify-content: center;\n box-shadow: 0 0 0 1.5px white, 0 2px 4px rgba(0, 0, 0, 0.25);\n font-family: var(--prism-font-sans, system-ui, sans-serif);\n }\n\n .prism-a11y-sr-ov__badge--active {\n background: var(--prism-primary-from);\n box-shadow: 0 0 0 2px white, 0 0 0 4px rgba(124, 58, 237, 0.4);\n }\n "] }]
|
|
126
126
|
}], () => [], null); })();
|
|
127
127
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(A11ySrOverlayComponent, { className: "A11ySrOverlayComponent", filePath: "app/panels/a11y/a11y-sr-overlay.component.ts", lineNumber: 88 }); })();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EnvironmentInjector,
|
|
1
|
+
import { EnvironmentInjector, type Type } from '@angular/core';
|
|
2
2
|
import { PrismPanelService } from '../../services/prism-panel.service.js';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class PrismPanelHostComponent
|
|
4
|
+
export declare class PrismPanelHostComponent {
|
|
5
5
|
private readonly pluginService;
|
|
6
6
|
private readonly nav;
|
|
7
7
|
protected readonly panelService: PrismPanelService;
|
|
@@ -22,10 +22,8 @@ export declare class PrismPanelHostComponent implements OnDestroy {
|
|
|
22
22
|
activeComponent: import("../../../index.js").RuntimeComponent | null;
|
|
23
23
|
}>;
|
|
24
24
|
private readonly lazyCache;
|
|
25
|
-
private readonly injectorCache;
|
|
26
25
|
protected readonly activeInjector: import("@angular/core").Signal<EnvironmentInjector>;
|
|
27
26
|
constructor();
|
|
28
|
-
ngOnDestroy(): void;
|
|
29
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<PrismPanelHostComponent, never>;
|
|
30
28
|
static ɵcmp: i0.ɵɵComponentDeclaration<PrismPanelHostComponent, "prism-panel-host", never, {}, {}, never, never, true, never>;
|
|
31
29
|
}
|
|
@@ -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,
|
|
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,EAIL,mBAAmB,EAGnB,KAAK,IAAI,EAEV,MAAM,eAAe,CAAC;AAKvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;;AAK1E,qBA+Ka,uBAAuB;IAClC,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,OAAO,CAAC,QAAQ,CAAC,SAAS,CAExB;IAEF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAK3B;IAEH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAGxB;IAEH,SAAS,CAAC,UAAU,CAClB,OAAO,EAAE,MAAM,GACd;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,QAAQ,CAAA;KAAE,GAAG,IAAI;IAwBzE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAkB;IAEhD,SAAS,CAAC,QAAQ,CAAC,SAAS,gFAQzB;IAEH,SAAS,CAAC,QAAQ,CAAC,iBAAiB,+DAAsC;IAC1E,SAAS,CAAC,QAAQ,CAAC,WAAW;;OAE1B;IAEJ,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoC;IAE9D,SAAS,CAAC,QAAQ,CAAC,cAAc,sDAE/B;;yCAvES,uBAAuB;2CAAvB,uBAAuB;CA6HnC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NgComponentOutlet } from '@angular/common';
|
|
2
|
-
import { Component, computed,
|
|
2
|
+
import { Component, computed, effect, EnvironmentInjector, inject, signal, ChangeDetectionStrategy, } from '@angular/core';
|
|
3
3
|
import { PrismIconComponent } from '../../icons/prism-icon.component.js';
|
|
4
4
|
import { BUILTIN_PANELS } from '../builtin-panels.js';
|
|
5
5
|
import { A11yAuditService } from '../a11y/a11y-audit.service.js';
|
|
@@ -115,22 +115,8 @@ export class PrismPanelHostComponent {
|
|
|
115
115
|
activeComponent: this.nav.activeComponent(),
|
|
116
116
|
}), ...(ngDevMode ? [{ debugName: "panelInputs" }] : []));
|
|
117
117
|
lazyCache = new Map();
|
|
118
|
-
|
|
119
|
-
activeInjector = computed(() => {
|
|
120
|
-
const panelId = this.panelService.activePanelId();
|
|
121
|
-
const panel = this.allPanels().find((p) => p.id === panelId);
|
|
122
|
-
if (!panel?.providers?.length)
|
|
123
|
-
return this.envInjector;
|
|
124
|
-
if (!this.injectorCache.has(panel.id)) {
|
|
125
|
-
this.injectorCache.set(panel.id, createEnvironmentInjector(panel.providers, this.envInjector, `PrismPanel[${panel.id}]`));
|
|
126
|
-
}
|
|
127
|
-
return this.injectorCache.get(panel.id);
|
|
128
|
-
}, ...(ngDevMode ? [{ debugName: "activeInjector" }] : []));
|
|
118
|
+
activeInjector = computed(() => this.panelService.activePanelInjector() ?? this.envInjector, ...(ngDevMode ? [{ debugName: "activeInjector" }] : []));
|
|
129
119
|
constructor() {
|
|
130
|
-
effect(() => {
|
|
131
|
-
const injector = this.activeInjector();
|
|
132
|
-
this.panelService.activePanelInjector.set(injector === this.envInjector ? null : injector);
|
|
133
|
-
});
|
|
134
120
|
effect(() => {
|
|
135
121
|
const element = this.rendererService.renderedElement();
|
|
136
122
|
const comp = this.nav.activeComponent();
|
|
@@ -171,9 +157,6 @@ export class PrismPanelHostComponent {
|
|
|
171
157
|
}
|
|
172
158
|
});
|
|
173
159
|
}
|
|
174
|
-
ngOnDestroy() {
|
|
175
|
-
this.injectorCache.forEach((injector) => injector.destroy());
|
|
176
|
-
}
|
|
177
160
|
static ɵfac = function PrismPanelHostComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PrismPanelHostComponent)(); };
|
|
178
161
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PrismPanelHostComponent, selectors: [["prism-panel-host"]], decls: 6, vars: 2, consts: [[1, "panel"], ["role", "tablist", 1, "panel-tabs"], ["role", "tab", 1, "p-tab", 3, "p-tab--active"], ["role", "tabpanel", 1, "panel-body", 3, "id"], ["role", "tab", 1, "p-tab", 3, "click"], [3, "name", "size"], [1, "p-tab-badge", 3, "ok", "warn", "danger"], [1, "p-tab-badge"], [4, "ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector"]], template: function PrismPanelHostComponent_Template(rf, ctx) { if (rf & 1) {
|
|
179
162
|
i0.ɵɵelementStart(0, "div", 0)(1, "nav", 1);
|
|
@@ -243,4 +226,4 @@ export class PrismPanelHostComponent {
|
|
|
243
226
|
</div>
|
|
244
227
|
`, styles: ["\n .panel {\n background: var(--prism-bg-elevated);\n border-top: 1px solid var(--prism-border);\n display: flex;\n flex-direction: column;\n min-height: 0;\n overflow: hidden;\n height: 100%;\n }\n\n .panel-tabs {\n display: flex;\n align-items: center;\n gap: 2px;\n padding: 0 16px;\n height: 40px;\n border-bottom: 1px solid var(--prism-border);\n background: var(--prism-bg);\n overflow-x: auto;\n scrollbar-width: none;\n flex-shrink: 0;\n }\n .panel-tabs::-webkit-scrollbar { display: none; }\n\n .p-tab {\n position: relative;\n height: 100%;\n display: flex;\n align-items: center;\n gap: 7px;\n padding: 0 12px;\n font-size: var(--fs-md);\n font-weight: 500;\n color: var(--prism-text-muted);\n white-space: nowrap;\n transition: color var(--dur-fast);\n background: none;\n border: none;\n cursor: pointer;\n font-family: var(--font-sans);\n }\n .p-tab:hover { color: var(--prism-text-2); }\n .p-tab--active { color: var(--prism-text); }\n .p-tab--active::after {\n content: '';\n position: absolute;\n left: 8px;\n right: 8px;\n bottom: -1px;\n height: 2px;\n background: linear-gradient(90deg, var(--prism-primary-from), var(--prism-primary-to));\n border-radius: 1px;\n }\n\n .p-tab-badge {\n min-width: 16px;\n height: 16px;\n padding: 0 5px;\n border-radius: 8px;\n background: color-mix(in srgb, var(--prism-primary) 18%, transparent);\n color: var(--prism-primary);\n font-family: var(--font-mono);\n font-size: 10px;\n font-weight: 700;\n display: grid;\n place-items: center;\n }\n .p-tab-badge.ok {\n background: color-mix(in srgb, var(--prism-success) 18%, transparent);\n color: var(--prism-success);\n }\n .p-tab-badge.warn {\n background: color-mix(in srgb, var(--prism-warn) 18%, transparent);\n color: var(--prism-warn);\n }\n .p-tab-badge.danger {\n background: color-mix(in srgb, var(--prism-danger) 18%, transparent);\n color: var(--prism-danger);\n }\n\n .panel-tabs-right {\n margin-left: auto;\n display: flex;\n align-items: center;\n gap: 4px;\n padding-left: 10px;\n }\n\n .icon-btn {\n width: 28px;\n height: 28px;\n display: grid;\n place-items: center;\n border-radius: var(--radius-sm);\n color: var(--prism-text-muted);\n background: none;\n border: none;\n cursor: pointer;\n transition: all var(--dur-fast);\n }\n .icon-btn:hover {\n background: var(--prism-input-bg);\n color: var(--prism-text);\n }\n\n .panel-body {\n flex: 1;\n min-height: 0;\n overflow: auto;\n background: var(--prism-bg-elevated);\n }\n .panel-body::-webkit-scrollbar { width: 8px; height: 8px; }\n .panel-body::-webkit-scrollbar-thumb { background: var(--prism-border-strong); border-radius: 4px; }\n\n :focus-visible {\n outline: 2px solid var(--prism-primary);\n outline-offset: 2px;\n }\n "] }]
|
|
245
228
|
}], () => [], null); })();
|
|
246
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismPanelHostComponent, { className: "PrismPanelHostComponent", filePath: "app/panels/panel-host/prism-panel-host.component.ts", lineNumber:
|
|
229
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismPanelHostComponent, { className: "PrismPanelHostComponent", filePath: "app/panels/panel-host/prism-panel-host.component.ts", lineNumber: 196 }); })();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provide-prism.d.ts","sourceRoot":"","sources":["../../src/app/provide-prism.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAEpF,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAChF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"provide-prism.d.ts","sourceRoot":"","sources":["../../src/app/provide-prism.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAEpF,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAChF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAStE,MAAM,WAAW,mBAAmB;IAClC,cAAc,CAAC,EAAE,oBAAoB,EAAE,CAAC;CACzC;AAED,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,eAAe,EACzB,MAAM,CAAC,EAAE,aAAa,EACtB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,oBAAoB,CAkBtB"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { makeEnvironmentProviders } from '@angular/core';
|
|
2
2
|
import { provideHighlightOptions } from 'ngx-highlightjs';
|
|
3
3
|
import { componentPage } from '../plugin/page-helpers.js';
|
|
4
|
-
import {
|
|
4
|
+
import { BUILTIN_PANELS } from './panels/builtin-panels.js';
|
|
5
|
+
import { PRISM_BUILTIN_PANELS, PRISM_CONFIG, PRISM_MANIFEST, } from './tokens/prism-tokens.js';
|
|
5
6
|
export function providePrism(manifest, config, options) {
|
|
6
7
|
const mergedManifest = options?.componentPages?.length
|
|
7
8
|
? { ...manifest, pages: [...(manifest.pages ?? []), ...options.componentPages.map(o => componentPage(o))] }
|
|
8
9
|
: manifest;
|
|
9
10
|
return makeEnvironmentProviders([
|
|
10
11
|
{ provide: PRISM_MANIFEST, useValue: mergedManifest },
|
|
12
|
+
{ provide: PRISM_BUILTIN_PANELS, useValue: BUILTIN_PANELS },
|
|
11
13
|
...(config ? [{ provide: PRISM_CONFIG, useValue: config }] : []),
|
|
12
14
|
...(config?.appProviders ?? []),
|
|
13
15
|
provideHighlightOptions({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prism-renderer.component.d.ts","sourceRoot":"","sources":["../../../src/app/renderer/prism-renderer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,QAAQ,EAER,KAAK,IAAI,EAIV,MAAM,eAAe,CAAC;AAYvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAGjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;;AAGzE,
|
|
1
|
+
{"version":3,"file":"prism-renderer.component.d.ts","sourceRoot":"","sources":["../../../src/app/renderer/prism-renderer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,QAAQ,EAER,KAAK,IAAI,EAIV,MAAM,eAAe,CAAC;AAYvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAGjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;;AAGzE,qBAyHa,sBAAsB;IACjC,SAAS,CAAC,QAAQ,CAAC,IAAI,OAAQ;IAC/B,SAAS,CAAC,QAAQ,CAAC,iBAAiB,yBAAkC;IACtE,SAAS,CAAC,QAAQ,CAAC,eAAe,uBAAgC;IAClE,SAAS,CAAC,QAAQ,CAAC,aAAa,qBAA8B;IAC9D,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,IAAI,CAAmC;IACxD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAE3B;IAEH,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA6B;IAC1D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA8B;IAE5D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAEpB;IACH,OAAO,CAAC,YAAY,CAAsC;IAC1D,OAAO,CAAC,mBAAmB,CAAsC;IACjE,OAAO,CAAC,oBAAoB,CAChB;IACZ,OAAO,CAAC,YAAY,CAAS;IAE7B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAoC;IACjE,QAAQ,CAAC,aAAa,+DAAsC;IAC5D,SAAS,CAAC,QAAQ,CAAC,aAAa;;MAA6C;IAC7E,SAAS,CAAC,QAAQ,CAAC,eAAe,yFAG/B;;IA0FH,OAAO,CAAC,eAAe;IA6FvB,OAAO,CAAC,OAAO;yCAvNJ,sBAAsB;2CAAtB,sBAAsB;CAqOlC"}
|
|
@@ -223,7 +223,7 @@ export class PrismRendererComponent {
|
|
|
223
223
|
i0.ɵɵstyleProp("--zoom", ctx.canvasService.zoom());
|
|
224
224
|
i0.ɵɵadvance(3);
|
|
225
225
|
i0.ɵɵconditional(ctx.activeOverlay() ? 9 : -1);
|
|
226
|
-
} }, dependencies: [PrismCanvasRulersComponent, NgComponentOutlet], styles: ["[_nghost-%COMP%] { display: block; min-height: 0; flex: 1; }\n\n .prism-canvas-stage[_ngcontent-%COMP%] {\n position: relative;\n overflow: auto;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 32px;\n min-height: 200px;\n height: 100%;\n background-color: var(--prism-bg-surface);\n background-image: radial-gradient(circle, var(--prism-dot) 1px, transparent 1px);\n background-size: 20px 20px;\n transition: filter var(--dur-base);\n }\n\n .prism-canvas-stage[data-bg=\"plain\"][_ngcontent-%COMP%] {\n background-image: none;\n }\n .prism-canvas-stage[data-bg=\"light\"][_ngcontent-%COMP%] {\n background-color: var(--prism-void-light, #f7f5fc);\n background-image: radial-gradient(circle, color-mix(in srgb, var(--prism-primary-from) 15%, transparent) 1px, transparent 1px);\n }\n .prism-canvas-stage[data-bg=\"dark\"][_ngcontent-%COMP%] {\n background-color: var(--prism-void-dark, #07050f);\n background-image: radial-gradient(circle, color-mix(in srgb, var(--prism-primary) 18%, transparent) 1px, transparent 1px);\n }\n .prism-canvas-stage[data-bg=\"checker\"][_ngcontent-%COMP%] {\n background-image:\n linear-gradient(45deg, var(--prism-border) 25%, transparent 25%),\n linear-gradient(-45deg, var(--prism-border) 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, var(--prism-border) 75%),\n linear-gradient(-45deg, transparent 75%, var(--prism-border) 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0;\n }\n\n .stage-crosshair[_ngcontent-%COMP%] {\n position: absolute;\n inset: 0;\n pointer-events: none;\n opacity: 0;\n transition: opacity var(--dur-base);\n }\n .stage-crosshair.visible[_ngcontent-%COMP%] { opacity: 1; }\n .stage-crosshair[_ngcontent-%COMP%]::before, \n .stage-crosshair[_ngcontent-%COMP%]::after {\n content: '';\n position: absolute;\n background: color-mix(in srgb, var(--prism-primary) 20%, transparent);\n }\n .stage-crosshair[_ngcontent-%COMP%]::before { left: 0; right: 0; top: 50%; height: 1px; }\n .stage-crosshair[_ngcontent-%COMP%]::after { top: 0; bottom: 0; left: 50%; width: 1px; }\n\n .canvas-badges[_ngcontent-%COMP%] {\n position: absolute;\n top: 12px;\n left: 20px;\n display: flex;\n gap: 6px;\n pointer-events: none;\n }\n .c-badge[_ngcontent-%COMP%] {\n font-family: var(--font-mono);\n font-size: var(--fs-xs);\n padding: 3px 7px;\n border-radius: 4px;\n background: color-mix(in srgb, var(--prism-bg-elevated) 90%, transparent);\n border: 1px solid var(--prism-border);\n color: var(--prism-text-muted);\n backdrop-filter: blur(8px);\n }\n\n .demo-wrap[_ngcontent-%COMP%] {\n position: relative;\n transform: scale(var(--zoom, 1));\n transition: transform 0.18s;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n }"], changeDetection: 0 });
|
|
226
|
+
} }, dependencies: [PrismCanvasRulersComponent, NgComponentOutlet], styles: ["[_nghost-%COMP%] { display: block; min-height: 0; flex: 1; }\n\n .prism-canvas-stage[_ngcontent-%COMP%] {\n position: relative;\n overflow: auto;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 32px;\n min-height: 200px;\n height: 100%;\n background-color: var(--prism-bg-surface);\n background-image: radial-gradient(circle, var(--prism-dot) 1px, transparent 1px);\n background-size: 20px 20px;\n transition: filter var(--dur-base);\n }\n\n .prism-canvas-stage[data-bg=\"plain\"][_ngcontent-%COMP%] {\n background-image: none;\n }\n .prism-canvas-stage[data-bg=\"light\"][_ngcontent-%COMP%] {\n background-color: var(--prism-void-light, #f7f5fc);\n background-image: radial-gradient(circle, color-mix(in srgb, var(--prism-primary-from) 15%, transparent) 1px, transparent 1px);\n }\n .prism-canvas-stage[data-bg=\"dark\"][_ngcontent-%COMP%] {\n background-color: var(--prism-void-dark, #07050f);\n background-image: radial-gradient(circle, color-mix(in srgb, var(--prism-primary) 18%, transparent) 1px, transparent 1px);\n }\n .prism-canvas-stage[data-bg=\"checker\"][_ngcontent-%COMP%] {\n background-image:\n linear-gradient(45deg, var(--prism-border) 25%, transparent 25%),\n linear-gradient(-45deg, var(--prism-border) 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, var(--prism-border) 75%),\n linear-gradient(-45deg, transparent 75%, var(--prism-border) 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0;\n }\n\n .stage-crosshair[_ngcontent-%COMP%] {\n position: absolute;\n inset: 0;\n pointer-events: none;\n opacity: 0;\n transition: opacity var(--dur-base);\n }\n .stage-crosshair.visible[_ngcontent-%COMP%] { opacity: 1; }\n .stage-crosshair[_ngcontent-%COMP%]::before, \n .stage-crosshair[_ngcontent-%COMP%]::after {\n content: '';\n position: absolute;\n background: color-mix(in srgb, var(--prism-primary) 20%, transparent);\n }\n .stage-crosshair[_ngcontent-%COMP%]::before { left: 0; right: 0; top: 50%; height: 1px; }\n .stage-crosshair[_ngcontent-%COMP%]::after { top: 0; bottom: 0; left: 50%; width: 1px; }\n\n .canvas-badges[_ngcontent-%COMP%] {\n position: absolute;\n top: 12px;\n left: 20px;\n display: flex;\n gap: 6px;\n pointer-events: none;\n }\n .c-badge[_ngcontent-%COMP%] {\n font-family: var(--font-mono);\n font-size: var(--fs-xs);\n padding: 3px 7px;\n border-radius: 4px;\n background: color-mix(in srgb, var(--prism-bg-elevated) 90%, transparent);\n border: 1px solid var(--prism-border);\n color: var(--prism-text-muted);\n backdrop-filter: blur(8px);\n }\n\n .demo-wrap[_ngcontent-%COMP%] {\n position: relative;\n transform: scale(var(--zoom, 1));\n transition: transform 0.18s;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n max-width: 600px;\n }"], changeDetection: 0 });
|
|
227
227
|
}
|
|
228
228
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PrismRendererComponent, [{
|
|
229
229
|
type: Component,
|
|
@@ -253,11 +253,11 @@ export class PrismRendererComponent {
|
|
|
253
253
|
}
|
|
254
254
|
</div>
|
|
255
255
|
</div>
|
|
256
|
-
`, styles: ["\n :host { display: block; min-height: 0; flex: 1; }\n\n .prism-canvas-stage {\n position: relative;\n overflow: auto;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 32px;\n min-height: 200px;\n height: 100%;\n background-color: var(--prism-bg-surface);\n background-image: radial-gradient(circle, var(--prism-dot) 1px, transparent 1px);\n background-size: 20px 20px;\n transition: filter var(--dur-base);\n }\n\n .prism-canvas-stage[data-bg=\"plain\"] {\n background-image: none;\n }\n .prism-canvas-stage[data-bg=\"light\"] {\n background-color: var(--prism-void-light, #f7f5fc);\n background-image: radial-gradient(circle, color-mix(in srgb, var(--prism-primary-from) 15%, transparent) 1px, transparent 1px);\n }\n .prism-canvas-stage[data-bg=\"dark\"] {\n background-color: var(--prism-void-dark, #07050f);\n background-image: radial-gradient(circle, color-mix(in srgb, var(--prism-primary) 18%, transparent) 1px, transparent 1px);\n }\n .prism-canvas-stage[data-bg=\"checker\"] {\n background-image:\n linear-gradient(45deg, var(--prism-border) 25%, transparent 25%),\n linear-gradient(-45deg, var(--prism-border) 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, var(--prism-border) 75%),\n linear-gradient(-45deg, transparent 75%, var(--prism-border) 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0;\n }\n\n .stage-crosshair {\n position: absolute;\n inset: 0;\n pointer-events: none;\n opacity: 0;\n transition: opacity var(--dur-base);\n }\n .stage-crosshair.visible { opacity: 1; }\n .stage-crosshair::before,\n .stage-crosshair::after {\n content: '';\n position: absolute;\n background: color-mix(in srgb, var(--prism-primary) 20%, transparent);\n }\n .stage-crosshair::before { left: 0; right: 0; top: 50%; height: 1px; }\n .stage-crosshair::after { top: 0; bottom: 0; left: 50%; width: 1px; }\n\n .canvas-badges {\n position: absolute;\n top: 12px;\n left: 20px;\n display: flex;\n gap: 6px;\n pointer-events: none;\n }\n .c-badge {\n font-family: var(--font-mono);\n font-size: var(--fs-xs);\n padding: 3px 7px;\n border-radius: 4px;\n background: color-mix(in srgb, var(--prism-bg-elevated) 90%, transparent);\n border: 1px solid var(--prism-border);\n color: var(--prism-text-muted);\n backdrop-filter: blur(8px);\n }\n\n .demo-wrap {\n position: relative;\n transform: scale(var(--zoom, 1));\n transition: transform 0.18s;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n }\n\n "] }]
|
|
256
|
+
`, styles: ["\n :host { display: block; min-height: 0; flex: 1; }\n\n .prism-canvas-stage {\n position: relative;\n overflow: auto;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 32px;\n min-height: 200px;\n height: 100%;\n background-color: var(--prism-bg-surface);\n background-image: radial-gradient(circle, var(--prism-dot) 1px, transparent 1px);\n background-size: 20px 20px;\n transition: filter var(--dur-base);\n }\n\n .prism-canvas-stage[data-bg=\"plain\"] {\n background-image: none;\n }\n .prism-canvas-stage[data-bg=\"light\"] {\n background-color: var(--prism-void-light, #f7f5fc);\n background-image: radial-gradient(circle, color-mix(in srgb, var(--prism-primary-from) 15%, transparent) 1px, transparent 1px);\n }\n .prism-canvas-stage[data-bg=\"dark\"] {\n background-color: var(--prism-void-dark, #07050f);\n background-image: radial-gradient(circle, color-mix(in srgb, var(--prism-primary) 18%, transparent) 1px, transparent 1px);\n }\n .prism-canvas-stage[data-bg=\"checker\"] {\n background-image:\n linear-gradient(45deg, var(--prism-border) 25%, transparent 25%),\n linear-gradient(-45deg, var(--prism-border) 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, var(--prism-border) 75%),\n linear-gradient(-45deg, transparent 75%, var(--prism-border) 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0;\n }\n\n .stage-crosshair {\n position: absolute;\n inset: 0;\n pointer-events: none;\n opacity: 0;\n transition: opacity var(--dur-base);\n }\n .stage-crosshair.visible { opacity: 1; }\n .stage-crosshair::before,\n .stage-crosshair::after {\n content: '';\n position: absolute;\n background: color-mix(in srgb, var(--prism-primary) 20%, transparent);\n }\n .stage-crosshair::before { left: 0; right: 0; top: 50%; height: 1px; }\n .stage-crosshair::after { top: 0; bottom: 0; left: 50%; width: 1px; }\n\n .canvas-badges {\n position: absolute;\n top: 12px;\n left: 20px;\n display: flex;\n gap: 6px;\n pointer-events: none;\n }\n .c-badge {\n font-family: var(--font-mono);\n font-size: var(--fs-xs);\n padding: 3px 7px;\n border-radius: 4px;\n background: color-mix(in srgb, var(--prism-bg-elevated) 90%, transparent);\n border: 1px solid var(--prism-border);\n color: var(--prism-text-muted);\n backdrop-filter: blur(8px);\n }\n\n .demo-wrap {\n position: relative;\n transform: scale(var(--zoom, 1));\n transition: transform 0.18s;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n max-width: 600px;\n }\n\n "] }]
|
|
257
257
|
}], () => [], { outlet: [{ type: i0.ViewChild, args: ['outlet', { ...{
|
|
258
258
|
read: ViewContainerRef,
|
|
259
259
|
}, isSignal: true }] }] }); })();
|
|
260
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismRendererComponent, { className: "PrismRendererComponent", filePath: "app/renderer/prism-renderer.component.ts", lineNumber:
|
|
260
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismRendererComponent, { className: "PrismRendererComponent", filePath: "app/renderer/prism-renderer.component.ts", lineNumber: 156 }); })();
|
|
261
261
|
function parseContentToNodes(content) {
|
|
262
262
|
if (typeof content === 'string') {
|
|
263
263
|
return [htmlToNodes(content)];
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { EnvironmentInjector } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class PrismPanelService {
|
|
4
|
+
private readonly envInjector;
|
|
5
|
+
private readonly pluginService;
|
|
6
|
+
private readonly builtinPanels;
|
|
7
|
+
private readonly injectorCache;
|
|
4
8
|
readonly activePanelId: import("@angular/core").WritableSignal<string>;
|
|
5
9
|
readonly activeViewId: import("@angular/core").WritableSignal<string>;
|
|
6
|
-
readonly activePanelInjector: import("@angular/core").
|
|
10
|
+
readonly activePanelInjector: import("@angular/core").Signal<EnvironmentInjector | null>;
|
|
7
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<PrismPanelService, never>;
|
|
8
12
|
static ɵprov: i0.ɵɵInjectableDeclaration<PrismPanelService>;
|
|
9
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prism-panel.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-panel.service.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"prism-panel.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-panel.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,mBAAmB,EAIpB,MAAM,eAAe,CAAC;;AAIvB,qBACa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA+B;IAC3D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA8B;IAC5D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgC;IAC9D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA0C;IAExE,QAAQ,CAAC,aAAa,iDAA8B;IACpD,QAAQ,CAAC,YAAY,iDAA8B;IAEnD,QAAQ,CAAC,mBAAmB,6DAgBzB;yCAzBQ,iBAAiB;6CAAjB,iBAAiB;CA0B7B"}
|
|
@@ -1,9 +1,27 @@
|
|
|
1
|
-
import { Injectable, signal } from '@angular/core';
|
|
1
|
+
import { computed, createEnvironmentInjector, EnvironmentInjector, inject, Injectable, signal, } from '@angular/core';
|
|
2
|
+
import { PRISM_BUILTIN_PANELS } from '../tokens/prism-tokens.js';
|
|
3
|
+
import { PrismPluginService } from './prism-plugin.service.js';
|
|
2
4
|
import * as i0 from "@angular/core";
|
|
3
5
|
export class PrismPanelService {
|
|
6
|
+
envInjector = inject(EnvironmentInjector);
|
|
7
|
+
pluginService = inject(PrismPluginService);
|
|
8
|
+
builtinPanels = inject(PRISM_BUILTIN_PANELS);
|
|
9
|
+
injectorCache = new Map();
|
|
4
10
|
activePanelId = signal('controls', ...(ngDevMode ? [{ debugName: "activePanelId" }] : []));
|
|
5
11
|
activeViewId = signal('renderer', ...(ngDevMode ? [{ debugName: "activeViewId" }] : []));
|
|
6
|
-
activePanelInjector =
|
|
12
|
+
activePanelInjector = computed(() => {
|
|
13
|
+
const panelId = this.activePanelId();
|
|
14
|
+
const allPanels = [...this.builtinPanels, ...this.pluginService.panels()];
|
|
15
|
+
const panel = allPanels.find((p) => p.id === panelId);
|
|
16
|
+
if (!panel?.providers?.length)
|
|
17
|
+
return null;
|
|
18
|
+
let injector = this.injectorCache.get(panel.id);
|
|
19
|
+
if (!injector) {
|
|
20
|
+
injector = createEnvironmentInjector(panel.providers, this.envInjector, `PrismPanel[${panel.id}]`);
|
|
21
|
+
this.injectorCache.set(panel.id, injector);
|
|
22
|
+
}
|
|
23
|
+
return injector;
|
|
24
|
+
}, ...(ngDevMode ? [{ debugName: "activePanelInjector" }] : []));
|
|
7
25
|
static ɵfac = function PrismPanelService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PrismPanelService)(); };
|
|
8
26
|
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: PrismPanelService, factory: PrismPanelService.ɵfac, providedIn: 'root' });
|
|
9
27
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import type { NgPrismConfig, RuntimeManifest } from '../../plugin/plugin.types.js';
|
|
2
|
+
import type { NgPrismConfig, PanelDefinition, RuntimeManifest } from '../../plugin/plugin.types.js';
|
|
3
3
|
export declare const PRISM_MANIFEST: InjectionToken<RuntimeManifest>;
|
|
4
4
|
export declare const PRISM_CONFIG: InjectionToken<NgPrismConfig>;
|
|
5
5
|
export interface PrismRendererHooks {
|
|
@@ -8,4 +8,5 @@ export interface PrismRendererHooks {
|
|
|
8
8
|
onAfterDestroy?(selector: string): void;
|
|
9
9
|
}
|
|
10
10
|
export declare const PRISM_RENDERER_HOOKS: InjectionToken<PrismRendererHooks>;
|
|
11
|
+
export declare const PRISM_BUILTIN_PANELS: InjectionToken<PanelDefinition[]>;
|
|
11
12
|
//# sourceMappingURL=prism-tokens.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prism-tokens.d.ts","sourceRoot":"","sources":["../../../src/app/tokens/prism-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"prism-tokens.d.ts","sourceRoot":"","sources":["../../../src/app/tokens/prism-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,eAAe,EAChB,MAAM,8BAA8B,CAAC;AAEtC,eAAO,MAAM,cAAc,iCAAwD,CAAC;AAEpF,eAAO,MAAM,YAAY,+BAGvB,CAAC;AAEH,MAAM,WAAW,kBAAkB;IACjC,cAAc,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,aAAa,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,cAAc,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzC;AAED,eAAO,MAAM,oBAAoB,oCAC+B,CAAC;AAEjE,eAAO,MAAM,oBAAoB,mCAGhC,CAAC"}
|
|
@@ -5,3 +5,4 @@ export const PRISM_CONFIG = new InjectionToken('PRISM_CONFIG', {
|
|
|
5
5
|
factory: () => ({}),
|
|
6
6
|
});
|
|
7
7
|
export const PRISM_RENDERER_HOOKS = new InjectionToken('PRISM_RENDERER_HOOKS');
|
|
8
|
+
export const PRISM_BUILTIN_PANELS = new InjectionToken('PRISM_BUILTIN_PANELS', { providedIn: 'root', factory: () => [] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,IAAI,EAIV,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,IAAI,EAIV,MAAM,4BAA4B,CAAC;AAMpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AA+VtD,wBAAgB,KAAK,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAUvD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { chain, SchematicsException, } from '@angular-devkit/schematics';
|
|
2
|
-
import { parse as parseJsonc, modify as modifyJsonc, applyEdits as applyJsoncEdits } from 'jsonc-parser';
|
|
2
|
+
import { parse as parseJsonc, modify as modifyJsonc, applyEdits as applyJsoncEdits, } from 'jsonc-parser';
|
|
3
3
|
function readWorkspace(tree) {
|
|
4
4
|
const buffer = tree.read('angular.json');
|
|
5
5
|
if (!buffer) {
|
|
@@ -20,17 +20,34 @@ function addPrismAppProject(options) {
|
|
|
20
20
|
const prismProjectName = `${options.project}-prism`;
|
|
21
21
|
const prismRoot = `projects/${prismProjectName}`;
|
|
22
22
|
const prismSrc = `${prismRoot}/src`;
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
const zoneless = options.zoneless === true;
|
|
24
|
+
const mainTs = zoneless
|
|
25
|
+
? [
|
|
26
|
+
"import { provideZonelessChangeDetection } from '@angular/core';",
|
|
27
|
+
"import { bootstrapApplication } from '@angular/platform-browser';",
|
|
28
|
+
"import { PrismShellComponent, providePrism } from '@ng-prism/core';",
|
|
29
|
+
"import { PRISM_RUNTIME_MANIFEST } from './prism-manifest';",
|
|
30
|
+
"import config from 'ng-prism.config';",
|
|
31
|
+
'',
|
|
32
|
+
'bootstrapApplication(PrismShellComponent, {',
|
|
33
|
+
' providers: [',
|
|
34
|
+
' provideZonelessChangeDetection(),',
|
|
35
|
+
' providePrism(PRISM_RUNTIME_MANIFEST, config),',
|
|
36
|
+
' ],',
|
|
37
|
+
'});',
|
|
38
|
+
'',
|
|
39
|
+
].join('\n')
|
|
40
|
+
: [
|
|
41
|
+
"import { bootstrapApplication } from '@angular/platform-browser';",
|
|
42
|
+
"import { PrismShellComponent, providePrism } from '@ng-prism/core';",
|
|
43
|
+
"import { PRISM_RUNTIME_MANIFEST } from './prism-manifest';",
|
|
44
|
+
"import config from 'ng-prism.config';",
|
|
45
|
+
'',
|
|
46
|
+
'bootstrapApplication(PrismShellComponent, {',
|
|
47
|
+
' providers: [providePrism(PRISM_RUNTIME_MANIFEST, config)],',
|
|
48
|
+
'});',
|
|
49
|
+
'',
|
|
50
|
+
].join('\n');
|
|
34
51
|
if (!tree.exists(`${prismSrc}/main.ts`)) {
|
|
35
52
|
tree.create(`${prismSrc}/main.ts`, mainTs);
|
|
36
53
|
}
|
|
@@ -83,8 +100,10 @@ function addPrismAppProject(options) {
|
|
|
83
100
|
index: `${prismSrc}/index.html`,
|
|
84
101
|
browser: `${prismSrc}/main.ts`,
|
|
85
102
|
tsConfig: `${prismRoot}/tsconfig.app.json`,
|
|
86
|
-
styles: [
|
|
87
|
-
|
|
103
|
+
styles: [
|
|
104
|
+
'node_modules/highlight.js/styles/base16/solarized-dark.min.css',
|
|
105
|
+
],
|
|
106
|
+
polyfills: zoneless ? [] : ['zone.js'],
|
|
88
107
|
allowedCommonJsDependencies: ['highlight.js'],
|
|
89
108
|
preserveSymlinks: true,
|
|
90
109
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schematics/ng-add/schema.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schematics/ng-add/schema.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
package/package.json
CHANGED
|
@@ -13,6 +13,11 @@
|
|
|
13
13
|
"type": "number",
|
|
14
14
|
"default": 4400,
|
|
15
15
|
"description": "Dev server port for the Prism styleguide"
|
|
16
|
+
},
|
|
17
|
+
"zoneless": {
|
|
18
|
+
"type": "boolean",
|
|
19
|
+
"default": false,
|
|
20
|
+
"description": "Use zoneless change detection (no zone.js polyfill)"
|
|
16
21
|
}
|
|
17
22
|
},
|
|
18
23
|
"required": ["project"],
|