@ng-prism/core 21.8.1 → 21.9.0
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 +11 -0
- package/dist/app/panels/a11y/a11y-overlay-host.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-overlay-host.component.js +89 -23
- 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/renderer/prism-renderer.component.d.ts.map +1 -1
- package/dist/app/renderer/prism-renderer.component.js +3 -3
- package/dist/builder/watcher/prism-watcher.js +1 -1
- package/dist/schematics/ng-add/index.d.ts.map +1 -1
- package/dist/schematics/ng-add/index.js +34 -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,21 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
+
interface Bounds {
|
|
3
|
+
top: number;
|
|
4
|
+
left: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
2
8
|
export declare class A11yOverlayHostComponent {
|
|
3
9
|
private readonly rendererService;
|
|
4
10
|
private readonly keyboardService;
|
|
11
|
+
private readonly elementRef;
|
|
12
|
+
private readonly layoutTick;
|
|
13
|
+
protected readonly bounds: import("@angular/core").Signal<Bounds | null>;
|
|
5
14
|
protected readonly roleLabel: import("@angular/core").Signal<string | null>;
|
|
6
15
|
protected readonly tabLabel: import("@angular/core").Signal<string | null>;
|
|
16
|
+
constructor();
|
|
7
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<A11yOverlayHostComponent, never>;
|
|
8
18
|
static ɵcmp: i0.ɵɵComponentDeclaration<A11yOverlayHostComponent, "prism-a11y-overlay-host", never, {}, {}, never, never, true, never>;
|
|
9
19
|
}
|
|
20
|
+
export {};
|
|
10
21
|
//# 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":";AAYA,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,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAgC;IAChE,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,28 +1,64 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, computed, inject, } from '@angular/core';
|
|
1
|
+
import { ChangeDetectionStrategy, Component, computed, effect, ElementRef, inject, signal, } from '@angular/core';
|
|
2
2
|
import { A11yKeyboardService } from './a11y-keyboard.service.js';
|
|
3
3
|
import { PrismRendererService } from '../../services/prism-renderer.service.js';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
-
function
|
|
6
|
-
i0.ɵɵdomElementStart(0, "div",
|
|
5
|
+
function A11yOverlayHostComponent_Conditional_0_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
6
|
+
i0.ɵɵdomElementStart(0, "div", 3)(1, "span", 4);
|
|
7
7
|
i0.ɵɵtext(2);
|
|
8
8
|
i0.ɵɵdomElementEnd()();
|
|
9
9
|
} if (rf & 2) {
|
|
10
|
-
const
|
|
10
|
+
const b_r1 = i0.ɵɵnextContext();
|
|
11
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
12
|
+
i0.ɵɵstyleProp("top", b_r1.top - 22, "px")("left", b_r1.left - 2, "px");
|
|
11
13
|
i0.ɵɵadvance(2);
|
|
12
|
-
i0.ɵɵtextInterpolate(
|
|
14
|
+
i0.ɵɵtextInterpolate(ctx_r1.roleLabel());
|
|
13
15
|
} }
|
|
14
|
-
function
|
|
15
|
-
i0.ɵɵdomElementStart(0, "div",
|
|
16
|
+
function A11yOverlayHostComponent_Conditional_0_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
17
|
+
i0.ɵɵdomElementStart(0, "div", 5)(1, "span", 4);
|
|
16
18
|
i0.ɵɵtext(2);
|
|
17
19
|
i0.ɵɵdomElementEnd()();
|
|
18
20
|
} if (rf & 2) {
|
|
19
|
-
const
|
|
21
|
+
const b_r1 = i0.ɵɵnextContext();
|
|
22
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
23
|
+
i0.ɵɵstyleProp("top", b_r1.top + b_r1.height + 4, "px")("left", b_r1.left + b_r1.width + 2, "px");
|
|
20
24
|
i0.ɵɵadvance(2);
|
|
21
|
-
i0.ɵɵtextInterpolate(
|
|
25
|
+
i0.ɵɵtextInterpolate(ctx_r1.tabLabel());
|
|
26
|
+
} }
|
|
27
|
+
function A11yOverlayHostComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
28
|
+
i0.ɵɵdomElement(0, "div", 0);
|
|
29
|
+
i0.ɵɵconditionalCreate(1, A11yOverlayHostComponent_Conditional_0_Conditional_1_Template, 3, 5, "div", 1);
|
|
30
|
+
i0.ɵɵconditionalCreate(2, A11yOverlayHostComponent_Conditional_0_Conditional_2_Template, 3, 5, "div", 2);
|
|
31
|
+
} if (rf & 2) {
|
|
32
|
+
const b_r1 = ctx;
|
|
33
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
34
|
+
i0.ɵɵstyleProp("top", b_r1.top, "px")("left", b_r1.left, "px")("width", b_r1.width, "px")("height", b_r1.height, "px");
|
|
35
|
+
i0.ɵɵadvance();
|
|
36
|
+
i0.ɵɵconditional(ctx_r1.roleLabel() ? 1 : -1);
|
|
37
|
+
i0.ɵɵadvance();
|
|
38
|
+
i0.ɵɵconditional(ctx_r1.tabLabel() ? 2 : -1);
|
|
22
39
|
} }
|
|
23
40
|
export class A11yOverlayHostComponent {
|
|
24
41
|
rendererService = inject(PrismRendererService);
|
|
25
42
|
keyboardService = inject(A11yKeyboardService);
|
|
43
|
+
elementRef = inject((ElementRef));
|
|
44
|
+
layoutTick = signal(0, ...(ngDevMode ? [{ debugName: "layoutTick" }] : []));
|
|
45
|
+
bounds = computed(() => {
|
|
46
|
+
const el = this.rendererService.renderedElement();
|
|
47
|
+
this.layoutTick();
|
|
48
|
+
if (!el)
|
|
49
|
+
return null;
|
|
50
|
+
const parent = this.elementRef.nativeElement.parentElement;
|
|
51
|
+
if (!parent)
|
|
52
|
+
return null;
|
|
53
|
+
const elRect = el.getBoundingClientRect();
|
|
54
|
+
const parentRect = parent.getBoundingClientRect();
|
|
55
|
+
return {
|
|
56
|
+
top: elRect.top - parentRect.top,
|
|
57
|
+
left: elRect.left - parentRect.left,
|
|
58
|
+
width: elRect.width,
|
|
59
|
+
height: elRect.height,
|
|
60
|
+
};
|
|
61
|
+
}, ...(ngDevMode ? [{ debugName: "bounds" }] : []));
|
|
26
62
|
roleLabel = computed(() => {
|
|
27
63
|
const el = this.rendererService.renderedElement();
|
|
28
64
|
if (!el)
|
|
@@ -40,34 +76,64 @@ export class A11yOverlayHostComponent {
|
|
|
40
76
|
return null;
|
|
41
77
|
return `Tab ${items[0].index}`;
|
|
42
78
|
}, ...(ngDevMode ? [{ debugName: "tabLabel" }] : []));
|
|
79
|
+
constructor() {
|
|
80
|
+
effect((onCleanup) => {
|
|
81
|
+
const el = this.rendererService.renderedElement();
|
|
82
|
+
if (!el)
|
|
83
|
+
return;
|
|
84
|
+
const ro = new ResizeObserver(() => this.layoutTick.update((v) => v + 1));
|
|
85
|
+
ro.observe(el);
|
|
86
|
+
const parent = this.elementRef.nativeElement.parentElement;
|
|
87
|
+
if (parent)
|
|
88
|
+
ro.observe(parent);
|
|
89
|
+
onCleanup(() => ro.disconnect());
|
|
90
|
+
});
|
|
91
|
+
effect(() => {
|
|
92
|
+
this.rendererService.inputValues();
|
|
93
|
+
this.rendererService.activeVariantIndex();
|
|
94
|
+
this.layoutTick.update((v) => v + 1);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
43
97
|
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);
|
|
98
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: A11yOverlayHostComponent, selectors: [["prism-a11y-overlay-host"]], 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) {
|
|
99
|
+
i0.ɵɵconditionalCreate(0, A11yOverlayHostComponent_Conditional_0_Template, 3, 10);
|
|
48
100
|
} if (rf & 2) {
|
|
49
|
-
|
|
50
|
-
i0.ɵɵconditional(ctx.
|
|
51
|
-
i0.ɵɵadvance();
|
|
52
|
-
i0.ɵɵconditional(ctx.tabLabel() ? 2 : -1);
|
|
101
|
+
let tmp_0_0;
|
|
102
|
+
i0.ɵɵconditional((tmp_0_0 = ctx.bounds()) ? 0 : -1, tmp_0_0);
|
|
53
103
|
} }, 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
104
|
}
|
|
55
105
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(A11yOverlayHostComponent, [{
|
|
56
106
|
type: Component,
|
|
57
107
|
args: [{ selector: 'prism-a11y-overlay-host', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
58
|
-
|
|
108
|
+
@if (bounds(); as b) {
|
|
109
|
+
<div
|
|
110
|
+
class="a11y-mark outline"
|
|
111
|
+
[style.top.px]="b.top"
|
|
112
|
+
[style.left.px]="b.left"
|
|
113
|
+
[style.width.px]="b.width"
|
|
114
|
+
[style.height.px]="b.height"
|
|
115
|
+
></div>
|
|
59
116
|
@if (roleLabel()) {
|
|
60
|
-
<div
|
|
117
|
+
<div
|
|
118
|
+
class="a11y-mark"
|
|
119
|
+
[style.top.px]="b.top - 22"
|
|
120
|
+
[style.left.px]="b.left - 2"
|
|
121
|
+
>
|
|
61
122
|
<span class="tag">{{ roleLabel() }}</span>
|
|
62
123
|
</div>
|
|
63
124
|
} @if (tabLabel()) {
|
|
64
|
-
<div
|
|
125
|
+
<div
|
|
126
|
+
class="a11y-mark kb"
|
|
127
|
+
[style.top.px]="b.top + b.height + 4"
|
|
128
|
+
[style.left.px]="b.left + b.width + 2"
|
|
129
|
+
style="transform: translateX(-100%)"
|
|
130
|
+
>
|
|
65
131
|
<span class="tag">{{ tabLabel() }}</span>
|
|
66
132
|
</div>
|
|
67
|
-
}
|
|
133
|
+
} }
|
|
68
134
|
`, 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:
|
|
135
|
+
}], () => [], null); })();
|
|
136
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(A11yOverlayHostComponent, { className: "A11yOverlayHostComponent", filePath: "app/panels/a11y/a11y-overlay-host.component.ts", lineNumber: 77 }); })();
|
|
71
137
|
function implicitRole(el) {
|
|
72
138
|
const tag = el.tagName.toLowerCase();
|
|
73
139
|
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 +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)];
|
|
@@ -39,7 +39,7 @@ export function createChangeHandler(options) {
|
|
|
39
39
|
function handleChange(filename) {
|
|
40
40
|
if (disposed)
|
|
41
41
|
return;
|
|
42
|
-
if (filename && !/\.
|
|
42
|
+
if (filename && !/\.ts$/.test(filename))
|
|
43
43
|
return;
|
|
44
44
|
if (timer)
|
|
45
45
|
clearTimeout(timer);
|
|
@@ -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
|
},
|
|
@@ -106,6 +125,7 @@ function addPrismAppProject(options) {
|
|
|
106
125
|
buildTarget: `${prismProjectName}:build:development`,
|
|
107
126
|
port,
|
|
108
127
|
hmr: true,
|
|
128
|
+
liveReload: true,
|
|
109
129
|
},
|
|
110
130
|
},
|
|
111
131
|
},
|
|
@@ -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"],
|