@ng-prism/core 21.4.4 → 21.5.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/README.md +1 -1
- package/dist/app/canvas/prism-canvas-rulers.component.d.ts +16 -0
- package/dist/app/canvas/prism-canvas-rulers.component.d.ts.map +1 -0
- package/dist/app/canvas/prism-canvas-rulers.component.js +177 -0
- package/dist/app/canvas/prism-canvas-toolbar.component.d.ts +14 -0
- package/dist/app/canvas/prism-canvas-toolbar.component.d.ts.map +1 -0
- package/dist/app/canvas/prism-canvas-toolbar.component.js +144 -0
- package/dist/app/canvas/prism-code-drawer.component.d.ts +12 -0
- package/dist/app/canvas/prism-code-drawer.component.d.ts.map +1 -0
- package/dist/app/canvas/prism-code-drawer.component.js +114 -0
- package/dist/app/component-head/prism-component-head.component.d.ts +15 -0
- package/dist/app/component-head/prism-component-head.component.d.ts.map +1 -0
- package/dist/app/component-head/prism-component-head.component.js +207 -0
- package/dist/app/component-head/prism-stat.component.d.ts +10 -0
- package/dist/app/component-head/prism-stat.component.d.ts.map +1 -0
- package/dist/app/component-head/prism-stat.component.js +52 -0
- package/dist/app/controls/boolean-control.component.d.ts.map +1 -1
- package/dist/app/controls/boolean-control.component.js +16 -44
- package/dist/app/controls/json-control.component.d.ts.map +1 -1
- package/dist/app/controls/json-control.component.js +33 -54
- package/dist/app/controls/number-control.component.d.ts.map +1 -1
- package/dist/app/controls/number-control.component.js +18 -35
- package/dist/app/controls/string-control.component.d.ts.map +1 -1
- package/dist/app/controls/string-control.component.js +14 -41
- package/dist/app/controls/union-control.component.d.ts.map +1 -1
- package/dist/app/controls/union-control.component.js +26 -50
- package/dist/app/directives/prism-resizer.directive.d.ts +14 -0
- package/dist/app/directives/prism-resizer.directive.d.ts.map +1 -0
- package/dist/app/directives/prism-resizer.directive.js +71 -0
- package/dist/app/header/prism-header.component.d.ts +3 -0
- package/dist/app/header/prism-header.component.d.ts.map +1 -1
- package/dist/app/header/prism-header.component.js +91 -215
- package/dist/app/icons/prism-icon.component.d.ts +10 -0
- package/dist/app/icons/prism-icon.component.d.ts.map +1 -0
- package/dist/app/icons/prism-icon.component.js +64 -0
- package/dist/app/index.d.ts +4 -3
- package/dist/app/index.d.ts.map +1 -1
- package/dist/app/index.js +4 -3
- package/dist/app/layout-menu/prism-layout-menu.component.d.ts.map +1 -1
- package/dist/app/layout-menu/prism-layout-menu.component.js +63 -69
- package/dist/app/panels/a11y/a11y-core.plugin.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-core.plugin.js +1 -0
- package/dist/app/panels/a11y/a11y-keyboard.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-keyboard.component.js +61 -100
- package/dist/app/panels/a11y/a11y-overlay-host.component.d.ts +4 -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 +87 -11
- package/dist/app/panels/a11y/a11y-panel.component.d.ts +0 -2
- package/dist/app/panels/a11y/a11y-panel.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-panel.component.js +70 -85
- package/dist/app/panels/a11y/a11y-score.component.d.ts +2 -1
- package/dist/app/panels/a11y/a11y-score.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-score.component.js +55 -49
- package/dist/app/panels/a11y/a11y-sr.component.d.ts +1 -9
- package/dist/app/panels/a11y/a11y-sr.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-sr.component.js +60 -208
- package/dist/app/panels/a11y/a11y-tree.component.d.ts +2 -4
- package/dist/app/panels/a11y/a11y-tree.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-tree.component.js +92 -137
- package/dist/app/panels/a11y/a11y-violations.component.d.ts +2 -6
- package/dist/app/panels/a11y/a11y-violations.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-violations.component.js +126 -373
- package/dist/app/panels/controls/controls-plugin.d.ts.map +1 -1
- package/dist/app/panels/controls/controls-plugin.js +1 -0
- package/dist/app/panels/controls/prism-controls-panel.component.d.ts.map +1 -1
- package/dist/app/panels/controls/prism-controls-panel.component.js +96 -88
- package/dist/app/panels/events/events-plugin.d.ts.map +1 -1
- package/dist/app/panels/events/events-plugin.js +1 -0
- package/dist/app/panels/events/prism-events-panel.component.d.ts +1 -0
- package/dist/app/panels/events/prism-events-panel.component.d.ts.map +1 -1
- package/dist/app/panels/events/prism-events-panel.component.js +44 -46
- package/dist/app/panels/panel-host/prism-panel-host.component.d.ts +7 -2
- 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 +102 -42
- package/dist/app/renderer/prism-renderer.component.d.ts +5 -6
- package/dist/app/renderer/prism-renderer.component.d.ts.map +1 -1
- package/dist/app/renderer/prism-renderer.component.js +84 -150
- package/dist/app/services/prism-canvas.service.d.ts +18 -0
- package/dist/app/services/prism-canvas.service.d.ts.map +1 -0
- package/dist/app/services/prism-canvas.service.js +63 -0
- package/dist/app/services/prism-theme.service.d.ts +13 -1
- package/dist/app/services/prism-theme.service.d.ts.map +1 -1
- package/dist/app/services/prism-theme.service.js +56 -9
- package/dist/app/shell/prism-shell.component.d.ts +1 -2
- package/dist/app/shell/prism-shell.component.d.ts.map +1 -1
- package/dist/app/shell/prism-shell.component.js +189 -178
- package/dist/app/sidebar/prism-sidebar.component.d.ts +16 -10
- package/dist/app/sidebar/prism-sidebar.component.d.ts.map +1 -1
- package/dist/app/sidebar/prism-sidebar.component.js +318 -204
- package/dist/app/theme/prism-default-theme.d.ts +1 -0
- package/dist/app/theme/prism-default-theme.d.ts.map +1 -1
- package/dist/app/theme/prism-default-theme.js +53 -34
- package/dist/app/variant-ribbon/prism-variant-ribbon.component.d.ts +13 -0
- package/dist/app/variant-ribbon/prism-variant-ribbon.component.d.ts.map +1 -0
- package/dist/app/variant-ribbon/prism-variant-ribbon.component.js +134 -0
- package/dist/app/view-tab-bar/prism-view-tab-bar.component.d.ts.map +1 -1
- package/dist/app/view-tab-bar/prism-view-tab-bar.component.js +15 -11
- package/dist/decorator/showcase.decorator.d.ts +1 -3
- package/dist/decorator/showcase.decorator.d.ts.map +1 -1
- package/dist/decorator/showcase.decorator.js +2 -6
- package/dist/plugin/plugin.types.d.ts +1 -0
- package/dist/plugin/plugin.types.d.ts.map +1 -1
- package/dist/schematics/ng-add/index.d.ts.map +1 -1
- package/dist/schematics/ng-add/index.js +2 -1
- package/package.json +6 -6
|
@@ -1,18 +1,94 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { ChangeDetectionStrategy, Component, computed, inject, } from '@angular/core';
|
|
2
|
+
import { A11yKeyboardService } from './a11y-keyboard.service.js';
|
|
3
|
+
import { PrismRendererService } from '../../services/prism-renderer.service.js';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
+
function A11yOverlayHostComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
6
|
+
i0.ɵɵdomElementStart(0, "div", 1)(1, "span", 3);
|
|
7
|
+
i0.ɵɵtext(2);
|
|
8
|
+
i0.ɵɵdomElementEnd()();
|
|
9
|
+
} if (rf & 2) {
|
|
10
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
11
|
+
i0.ɵɵadvance(2);
|
|
12
|
+
i0.ɵɵtextInterpolate(ctx_r0.roleLabel());
|
|
13
|
+
} }
|
|
14
|
+
function A11yOverlayHostComponent_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
15
|
+
i0.ɵɵdomElementStart(0, "div", 2)(1, "span", 3);
|
|
16
|
+
i0.ɵɵtext(2);
|
|
17
|
+
i0.ɵɵdomElementEnd()();
|
|
18
|
+
} if (rf & 2) {
|
|
19
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
20
|
+
i0.ɵɵadvance(2);
|
|
21
|
+
i0.ɵɵtextInterpolate(ctx_r0.tabLabel());
|
|
22
|
+
} }
|
|
5
23
|
export class A11yOverlayHostComponent {
|
|
24
|
+
rendererService = inject(PrismRendererService);
|
|
25
|
+
keyboardService = inject(A11yKeyboardService);
|
|
26
|
+
roleLabel = computed(() => {
|
|
27
|
+
const el = this.rendererService.renderedElement();
|
|
28
|
+
if (!el)
|
|
29
|
+
return null;
|
|
30
|
+
const role = el.getAttribute('role') ?? implicitRole(el);
|
|
31
|
+
return role ? `role="${role}"` : null;
|
|
32
|
+
}, ...(ngDevMode ? [{ debugName: "roleLabel" }] : []));
|
|
33
|
+
tabLabel = computed(() => {
|
|
34
|
+
const el = this.rendererService.renderedElement();
|
|
35
|
+
if (!el)
|
|
36
|
+
return null;
|
|
37
|
+
const doc = el.ownerDocument;
|
|
38
|
+
const items = this.keyboardService.extractTabOrder(el, doc ? (id) => doc.getElementById(id) : undefined);
|
|
39
|
+
if (items.length === 0)
|
|
40
|
+
return null;
|
|
41
|
+
return `Tab ${items[0].index}`;
|
|
42
|
+
}, ...(ngDevMode ? [{ debugName: "tabLabel" }] : []));
|
|
6
43
|
static ɵfac = function A11yOverlayHostComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || A11yOverlayHostComponent)(); };
|
|
7
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: A11yOverlayHostComponent, selectors: [["prism-a11y-overlay-host"]], decls:
|
|
8
|
-
i0.ɵɵ
|
|
9
|
-
|
|
44
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: A11yOverlayHostComponent, selectors: [["prism-a11y-overlay-host"]], decls: 3, vars: 2, consts: [[1, "a11y-mark", "outline", 2, "inset", "0"], [1, "a11y-mark", 2, "top", "-22px", "left", "-2px"], [1, "a11y-mark", "kb", 2, "bottom", "-24px", "right", "-2px"], [1, "tag"]], template: function A11yOverlayHostComponent_Template(rf, ctx) { if (rf & 1) {
|
|
45
|
+
i0.ɵɵdomElement(0, "div", 0);
|
|
46
|
+
i0.ɵɵconditionalCreate(1, A11yOverlayHostComponent_Conditional_1_Template, 3, 1, "div", 1);
|
|
47
|
+
i0.ɵɵconditionalCreate(2, A11yOverlayHostComponent_Conditional_2_Template, 3, 1, "div", 2);
|
|
48
|
+
} if (rf & 2) {
|
|
49
|
+
i0.ɵɵadvance();
|
|
50
|
+
i0.ɵɵconditional(ctx.roleLabel() ? 1 : -1);
|
|
51
|
+
i0.ɵɵadvance();
|
|
52
|
+
i0.ɵɵconditional(ctx.tabLabel() ? 2 : -1);
|
|
53
|
+
} }, 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: #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 });
|
|
10
54
|
}
|
|
11
55
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(A11yOverlayHostComponent, [{
|
|
12
56
|
type: Component,
|
|
13
|
-
args: [{ selector: 'prism-a11y-overlay-host', standalone: true,
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
57
|
+
args: [{ selector: 'prism-a11y-overlay-host', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
58
|
+
<div class="a11y-mark outline" style="inset: 0"></div>
|
|
59
|
+
@if (roleLabel()) {
|
|
60
|
+
<div class="a11y-mark" style="top: -22px; left: -2px">
|
|
61
|
+
<span class="tag">{{ roleLabel() }}</span>
|
|
62
|
+
</div>
|
|
63
|
+
} @if (tabLabel()) {
|
|
64
|
+
<div class="a11y-mark kb" style="bottom: -24px; right: -2px">
|
|
65
|
+
<span class="tag">{{ tabLabel() }}</span>
|
|
66
|
+
</div>
|
|
67
|
+
}
|
|
68
|
+
`, 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: #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 "] }]
|
|
17
69
|
}], null, null); })();
|
|
18
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(A11yOverlayHostComponent, { className: "A11yOverlayHostComponent", filePath: "app/panels/a11y/a11y-overlay-host.component.ts", lineNumber:
|
|
70
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(A11yOverlayHostComponent, { className: "A11yOverlayHostComponent", filePath: "app/panels/a11y/a11y-overlay-host.component.ts", lineNumber: 51 }); })();
|
|
71
|
+
function implicitRole(el) {
|
|
72
|
+
const tag = el.tagName.toLowerCase();
|
|
73
|
+
if (tag === 'button')
|
|
74
|
+
return 'button';
|
|
75
|
+
if (tag === 'a' && el.hasAttribute('href'))
|
|
76
|
+
return 'link';
|
|
77
|
+
if (tag === 'input') {
|
|
78
|
+
const type = el.getAttribute('type') ?? 'text';
|
|
79
|
+
if (type === 'checkbox')
|
|
80
|
+
return 'checkbox';
|
|
81
|
+
if (type === 'radio')
|
|
82
|
+
return 'radio';
|
|
83
|
+
if (type === 'range')
|
|
84
|
+
return 'slider';
|
|
85
|
+
return 'textbox';
|
|
86
|
+
}
|
|
87
|
+
if (tag === 'select')
|
|
88
|
+
return 'combobox';
|
|
89
|
+
if (tag === 'textarea')
|
|
90
|
+
return 'textbox';
|
|
91
|
+
if (tag === 'img')
|
|
92
|
+
return 'img';
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
@@ -2,12 +2,10 @@ import { A11yPanelStateService } from './a11y-panel-state.service.js';
|
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class A11yPanelComponent {
|
|
4
4
|
private readonly auditService;
|
|
5
|
-
private readonly rendererService;
|
|
6
5
|
protected readonly state: A11yPanelStateService;
|
|
7
6
|
readonly activeComponent: import("@angular/core").InputSignal<unknown>;
|
|
8
7
|
protected readonly disabled: import("@angular/core").Signal<boolean>;
|
|
9
8
|
protected readonly violationCount: import("@angular/core").Signal<number | null>;
|
|
10
|
-
protected readonly focusableCount: import("@angular/core").Signal<number | null>;
|
|
11
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<A11yPanelComponent, never>;
|
|
12
10
|
static ɵcmp: i0.ɵɵComponentDeclaration<A11yPanelComponent, "prism-a11y-panel", never, { "activeComponent": { "alias": "activeComponent"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
13
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a11y-panel.component.d.ts","sourceRoot":"","sources":["../../../../src/app/panels/a11y/a11y-panel.component.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;;
|
|
1
|
+
{"version":3,"file":"a11y-panel.component.d.ts","sourceRoot":"","sources":["../../../../src/app/panels/a11y/a11y-panel.component.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;;AAGtE,qBAgJa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA4B;IACzD,SAAS,CAAC,QAAQ,CAAC,KAAK,wBAAiC;IAEzD,QAAQ,CAAC,eAAe,+CAAwB;IAEhD,SAAS,CAAC,QAAQ,CAAC,QAAQ,0CAKxB;IAEH,SAAS,CAAC,QAAQ,CAAC,cAAc,gDAG9B;yCAhBQ,kBAAkB;2CAAlB,kBAAkB;CAiB9B"}
|
|
@@ -5,55 +5,45 @@ import { A11yKeyboardComponent } from './a11y-keyboard.component.js';
|
|
|
5
5
|
import { A11yTreeComponent } from './a11y-tree.component.js';
|
|
6
6
|
import { A11ySrComponent } from './a11y-sr.component.js';
|
|
7
7
|
import { A11yPanelStateService } from './a11y-panel-state.service.js';
|
|
8
|
-
import { PrismRendererService } from '../../services/prism-renderer.service.js';
|
|
9
8
|
import * as i0 from "@angular/core";
|
|
10
9
|
function A11yPanelComponent_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
11
|
-
i0.ɵɵelementStart(0, "span",
|
|
10
|
+
i0.ɵɵelementStart(0, "span", 6);
|
|
12
11
|
i0.ɵɵtext(1);
|
|
13
12
|
i0.ɵɵelementEnd();
|
|
14
13
|
} if (rf & 2) {
|
|
15
14
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
16
|
-
i0.ɵɵclassProp("
|
|
15
|
+
i0.ɵɵclassProp("st-badge--ok", ctx_r0.violationCount() === 0)("st-badge--warn", ctx_r0.violationCount() > 0);
|
|
17
16
|
i0.ɵɵadvance();
|
|
18
|
-
i0.ɵɵ
|
|
17
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r0.violationCount(), " ");
|
|
19
18
|
} }
|
|
20
|
-
function
|
|
21
|
-
i0.ɵɵelementStart(0, "
|
|
22
|
-
i0.ɵɵtext(1);
|
|
19
|
+
function A11yPanelComponent_Conditional_12_Template(rf, ctx) { if (rf & 1) {
|
|
20
|
+
i0.ɵɵelementStart(0, "div", 5);
|
|
21
|
+
i0.ɵɵtext(1, " Accessibility audit disabled for this component. ");
|
|
23
22
|
i0.ɵɵelementEnd();
|
|
24
|
-
} if (rf & 2) {
|
|
25
|
-
const ctx_r0 = i0.ɵɵnextContext();
|
|
26
|
-
i0.ɵɵadvance();
|
|
27
|
-
i0.ɵɵtextInterpolate1(" ", ctx_r0.focusableCount(), " ");
|
|
28
23
|
} }
|
|
29
|
-
function
|
|
30
|
-
i0.ɵɵelementStart(0, "div", 6);
|
|
31
|
-
i0.ɵɵtext(1, "Accessibility audit disabled for this component.");
|
|
32
|
-
i0.ɵɵelementEnd();
|
|
33
|
-
} }
|
|
34
|
-
function A11yPanelComponent_Conditional_14_Case_0_Template(rf, ctx) { if (rf & 1) {
|
|
24
|
+
function A11yPanelComponent_Conditional_13_Case_0_Template(rf, ctx) { if (rf & 1) {
|
|
35
25
|
i0.ɵɵelement(0, "prism-a11y-violations");
|
|
36
26
|
} }
|
|
37
|
-
function
|
|
38
|
-
i0.ɵɵelement(0, "prism-a11y-keyboard",
|
|
27
|
+
function A11yPanelComponent_Conditional_13_Case_1_Template(rf, ctx) { if (rf & 1) {
|
|
28
|
+
i0.ɵɵelement(0, "prism-a11y-keyboard", 7);
|
|
39
29
|
} if (rf & 2) {
|
|
40
30
|
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
41
31
|
i0.ɵɵproperty("activeComponent", ctx_r0.activeComponent());
|
|
42
32
|
} }
|
|
43
|
-
function
|
|
44
|
-
i0.ɵɵelement(0, "prism-a11y-tree",
|
|
33
|
+
function A11yPanelComponent_Conditional_13_Case_2_Template(rf, ctx) { if (rf & 1) {
|
|
34
|
+
i0.ɵɵelement(0, "prism-a11y-tree", 7);
|
|
45
35
|
} if (rf & 2) {
|
|
46
36
|
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
47
37
|
i0.ɵɵproperty("activeComponent", ctx_r0.activeComponent());
|
|
48
38
|
} }
|
|
49
|
-
function
|
|
50
|
-
i0.ɵɵelement(0, "prism-a11y-sr",
|
|
39
|
+
function A11yPanelComponent_Conditional_13_Case_3_Template(rf, ctx) { if (rf & 1) {
|
|
40
|
+
i0.ɵɵelement(0, "prism-a11y-sr", 7);
|
|
51
41
|
} if (rf & 2) {
|
|
52
42
|
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
53
43
|
i0.ɵɵproperty("activeComponent", ctx_r0.activeComponent());
|
|
54
44
|
} }
|
|
55
|
-
function
|
|
56
|
-
i0.ɵɵconditionalCreate(0,
|
|
45
|
+
function A11yPanelComponent_Conditional_13_Template(rf, ctx) { if (rf & 1) {
|
|
46
|
+
i0.ɵɵconditionalCreate(0, A11yPanelComponent_Conditional_13_Case_0_Template, 1, 0, "prism-a11y-violations")(1, A11yPanelComponent_Conditional_13_Case_1_Template, 1, 1, "prism-a11y-keyboard", 7)(2, A11yPanelComponent_Conditional_13_Case_2_Template, 1, 1, "prism-a11y-tree", 7)(3, A11yPanelComponent_Conditional_13_Case_3_Template, 1, 1, "prism-a11y-sr", 7);
|
|
57
47
|
} if (rf & 2) {
|
|
58
48
|
let tmp_1_0;
|
|
59
49
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
@@ -61,7 +51,6 @@ function A11yPanelComponent_Conditional_14_Template(rf, ctx) { if (rf & 1) {
|
|
|
61
51
|
} }
|
|
62
52
|
export class A11yPanelComponent {
|
|
63
53
|
auditService = inject(A11yAuditService);
|
|
64
|
-
rendererService = inject(PrismRendererService);
|
|
65
54
|
state = inject(A11yPanelStateService);
|
|
66
55
|
activeComponent = input(null, ...(ngDevMode ? [{ debugName: "activeComponent" }] : []));
|
|
67
56
|
disabled = computed(() => {
|
|
@@ -73,111 +62,107 @@ export class A11yPanelComponent {
|
|
|
73
62
|
const r = this.auditService.results();
|
|
74
63
|
return r ? r.violations.length : null;
|
|
75
64
|
}, ...(ngDevMode ? [{ debugName: "violationCount" }] : []));
|
|
76
|
-
focusableCount = computed(() => {
|
|
77
|
-
const el = this.rendererService.renderedElement();
|
|
78
|
-
if (!el)
|
|
79
|
-
return null;
|
|
80
|
-
return el.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]), [contenteditable="true"]').length;
|
|
81
|
-
}, ...(ngDevMode ? [{ debugName: "focusableCount" }] : []));
|
|
82
65
|
static ɵfac = function A11yPanelComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || A11yPanelComponent)(); };
|
|
83
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: A11yPanelComponent, selectors: [["prism-a11y-panel"]], inputs: { activeComponent: [1, "activeComponent"] }, decls:
|
|
66
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: A11yPanelComponent, selectors: [["prism-a11y-panel"]], inputs: { activeComponent: [1, "activeComponent"] }, decls: 14, vars: 10, consts: [[1, "a11y-panel"], [1, "subtabs"], [1, "st-tab", 3, "click"], [1, "st-badge", 3, "st-badge--ok", "st-badge--warn"], [1, "a11y-content"], [1, "a11y-disabled"], [1, "st-badge"], [3, "activeComponent"]], template: function A11yPanelComponent_Template(rf, ctx) { if (rf & 1) {
|
|
84
67
|
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "button", 2);
|
|
85
68
|
i0.ɵɵlistener("click", function A11yPanelComponent_Template_button_click_2_listener() { return ctx.state.activeTab.set("violations"); });
|
|
86
69
|
i0.ɵɵtext(3, " Violations ");
|
|
87
|
-
i0.ɵɵconditionalCreate(4, A11yPanelComponent_Conditional_4_Template, 2,
|
|
70
|
+
i0.ɵɵconditionalCreate(4, A11yPanelComponent_Conditional_4_Template, 2, 5, "span", 3);
|
|
88
71
|
i0.ɵɵelementEnd();
|
|
89
72
|
i0.ɵɵelementStart(5, "button", 2);
|
|
90
73
|
i0.ɵɵlistener("click", function A11yPanelComponent_Template_button_click_5_listener() { return ctx.state.activeTab.set("keyboard"); });
|
|
91
74
|
i0.ɵɵtext(6, " Keyboard ");
|
|
92
|
-
i0.ɵɵconditionalCreate(7, A11yPanelComponent_Conditional_7_Template, 2, 1, "span", 4);
|
|
93
75
|
i0.ɵɵelementEnd();
|
|
94
|
-
i0.ɵɵelementStart(
|
|
95
|
-
i0.ɵɵlistener("click", function
|
|
96
|
-
i0.ɵɵtext(
|
|
76
|
+
i0.ɵɵelementStart(7, "button", 2);
|
|
77
|
+
i0.ɵɵlistener("click", function A11yPanelComponent_Template_button_click_7_listener() { return ctx.state.activeTab.set("tree"); });
|
|
78
|
+
i0.ɵɵtext(8, " ARIA Tree ");
|
|
97
79
|
i0.ɵɵelementEnd();
|
|
98
|
-
i0.ɵɵelementStart(
|
|
99
|
-
i0.ɵɵlistener("click", function
|
|
100
|
-
i0.ɵɵtext(
|
|
80
|
+
i0.ɵɵelementStart(9, "button", 2);
|
|
81
|
+
i0.ɵɵlistener("click", function A11yPanelComponent_Template_button_click_9_listener() { return ctx.state.activeTab.set("sr"); });
|
|
82
|
+
i0.ɵɵtext(10, " Screen Reader ");
|
|
101
83
|
i0.ɵɵelementEnd()();
|
|
102
|
-
i0.ɵɵelementStart(
|
|
103
|
-
i0.ɵɵconditionalCreate(
|
|
84
|
+
i0.ɵɵelementStart(11, "div", 4);
|
|
85
|
+
i0.ɵɵconditionalCreate(12, A11yPanelComponent_Conditional_12_Template, 2, 0, "div", 5)(13, A11yPanelComponent_Conditional_13_Template, 4, 1);
|
|
104
86
|
i0.ɵɵelementEnd()();
|
|
105
87
|
} if (rf & 2) {
|
|
106
88
|
i0.ɵɵadvance(2);
|
|
107
|
-
i0.ɵɵclassProp("
|
|
89
|
+
i0.ɵɵclassProp("st-tab--active", ctx.state.activeTab() === "violations");
|
|
108
90
|
i0.ɵɵadvance(2);
|
|
109
91
|
i0.ɵɵconditional(ctx.violationCount() !== null ? 4 : -1);
|
|
110
92
|
i0.ɵɵadvance();
|
|
111
|
-
i0.ɵɵclassProp("
|
|
93
|
+
i0.ɵɵclassProp("st-tab--active", ctx.state.activeTab() === "keyboard");
|
|
112
94
|
i0.ɵɵadvance(2);
|
|
113
|
-
i0.ɵɵ
|
|
114
|
-
i0.ɵɵadvance();
|
|
115
|
-
i0.ɵɵclassProp("prism-a11y-panel__sub-tab--active", ctx.state.activeTab() === "tree");
|
|
95
|
+
i0.ɵɵclassProp("st-tab--active", ctx.state.activeTab() === "tree");
|
|
116
96
|
i0.ɵɵadvance(2);
|
|
117
|
-
i0.ɵɵclassProp("
|
|
97
|
+
i0.ɵɵclassProp("st-tab--active", ctx.state.activeTab() === "sr");
|
|
118
98
|
i0.ɵɵadvance(3);
|
|
119
|
-
i0.ɵɵconditional(ctx.disabled() ?
|
|
120
|
-
} }, dependencies: [A11yViolationsComponent,
|
|
99
|
+
i0.ɵɵconditional(ctx.disabled() ? 12 : 13);
|
|
100
|
+
} }, dependencies: [A11yViolationsComponent,
|
|
101
|
+
A11yKeyboardComponent,
|
|
102
|
+
A11yTreeComponent,
|
|
103
|
+
A11ySrComponent], styles: ["[_nghost-%COMP%] { display: flex; flex-direction: column; height: 100%; }\n\n .a11y-panel[_ngcontent-%COMP%] { display: flex; flex-direction: column; height: 100%; }\n\n .subtabs[_ngcontent-%COMP%] {\n display: flex;\n gap: 2px;\n padding: 10px 20px 0;\n border-bottom: 1px solid var(--prism-border);\n background: var(--prism-bg-elevated);\n position: sticky;\n top: 0;\n z-index: 2;\n }\n\n .st-tab[_ngcontent-%COMP%] {\n padding: 7px 12px;\n font-size: 12px;\n font-weight: 500;\n color: var(--prism-text-muted);\n border-radius: var(--radius-sm) var(--radius-sm) 0 0;\n position: relative;\n display: flex;\n align-items: center;\n gap: 6px;\n background: none;\n border: none;\n cursor: pointer;\n font-family: var(--font-sans);\n transition: color var(--dur-fast);\n }\n .st-tab[_ngcontent-%COMP%]:hover { color: var(--prism-text-2); }\n .st-tab--active[_ngcontent-%COMP%] { color: var(--prism-text); }\n .st-tab--active[_ngcontent-%COMP%]::after {\n content: '';\n position: absolute;\n left: 8px;\n right: 8px;\n bottom: -1px;\n height: 2px;\n background: var(--prism-primary);\n border-radius: 1px;\n }\n\n .st-badge[_ngcontent-%COMP%] {\n min-width: 16px;\n height: 16px;\n padding: 0 5px;\n border-radius: 8px;\n font-family: var(--font-mono);\n font-size: 10px;\n font-weight: 700;\n display: grid;\n place-items: center;\n background: color-mix(in srgb, var(--prism-primary) 18%, transparent);\n color: var(--prism-primary);\n }\n .st-badge--ok[_ngcontent-%COMP%] {\n background: color-mix(in srgb, var(--prism-success) 18%, transparent);\n color: var(--prism-success);\n }\n .st-badge--warn[_ngcontent-%COMP%] {\n background: color-mix(in srgb, var(--prism-warn) 18%, transparent);\n color: var(--prism-warn);\n }\n\n .a11y-content[_ngcontent-%COMP%] { flex: 1; overflow: auto; min-height: 0; }\n\n .a11y-disabled[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100px;\n color: var(--prism-text-muted);\n font-size: 13px;\n }"], changeDetection: 0 });
|
|
121
104
|
}
|
|
122
105
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(A11yPanelComponent, [{
|
|
123
106
|
type: Component,
|
|
124
|
-
args: [{ selector: 'prism-a11y-panel', standalone: true, imports: [
|
|
125
|
-
|
|
126
|
-
|
|
107
|
+
args: [{ selector: 'prism-a11y-panel', standalone: true, imports: [
|
|
108
|
+
A11yViolationsComponent,
|
|
109
|
+
A11yKeyboardComponent,
|
|
110
|
+
A11yTreeComponent,
|
|
111
|
+
A11ySrComponent,
|
|
112
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
113
|
+
<div class="a11y-panel">
|
|
114
|
+
<div class="subtabs">
|
|
127
115
|
<button
|
|
128
|
-
class="
|
|
129
|
-
[class.
|
|
116
|
+
class="st-tab"
|
|
117
|
+
[class.st-tab--active]="state.activeTab() === 'violations'"
|
|
130
118
|
(click)="state.activeTab.set('violations')"
|
|
131
119
|
>
|
|
132
|
-
Violations
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
120
|
+
Violations @if (violationCount() !== null) {
|
|
121
|
+
<span
|
|
122
|
+
class="st-badge"
|
|
123
|
+
[class.st-badge--ok]="violationCount() === 0"
|
|
124
|
+
[class.st-badge--warn]="violationCount()! > 0"
|
|
125
|
+
>
|
|
126
|
+
{{ violationCount() }}
|
|
127
|
+
</span>
|
|
138
128
|
}
|
|
139
129
|
</button>
|
|
140
130
|
<button
|
|
141
|
-
class="
|
|
142
|
-
[class.
|
|
131
|
+
class="st-tab"
|
|
132
|
+
[class.st-tab--active]="state.activeTab() === 'keyboard'"
|
|
143
133
|
(click)="state.activeTab.set('keyboard')"
|
|
144
134
|
>
|
|
145
135
|
Keyboard
|
|
146
|
-
@if (focusableCount() !== null) {
|
|
147
|
-
<span class="prism-a11y-panel__sub-badge prism-a11y-panel__sub-badge--kbd">
|
|
148
|
-
{{ focusableCount() }}
|
|
149
|
-
</span>
|
|
150
|
-
}
|
|
151
136
|
</button>
|
|
152
137
|
<button
|
|
153
|
-
class="
|
|
154
|
-
[class.
|
|
138
|
+
class="st-tab"
|
|
139
|
+
[class.st-tab--active]="state.activeTab() === 'tree'"
|
|
155
140
|
(click)="state.activeTab.set('tree')"
|
|
156
141
|
>
|
|
157
142
|
ARIA Tree
|
|
158
143
|
</button>
|
|
159
144
|
<button
|
|
160
|
-
class="
|
|
161
|
-
[class.
|
|
145
|
+
class="st-tab"
|
|
146
|
+
[class.st-tab--active]="state.activeTab() === 'sr'"
|
|
162
147
|
(click)="state.activeTab.set('sr')"
|
|
163
148
|
>
|
|
164
149
|
Screen Reader
|
|
165
150
|
</button>
|
|
166
151
|
</div>
|
|
167
152
|
|
|
168
|
-
<div class="
|
|
153
|
+
<div class="a11y-content">
|
|
169
154
|
@if (disabled()) {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
155
|
+
<div class="a11y-disabled">
|
|
156
|
+
Accessibility audit disabled for this component.
|
|
157
|
+
</div>
|
|
158
|
+
} @else { @switch (state.activeTab()) { @case ('violations') {
|
|
159
|
+
<prism-a11y-violations /> } @case ('keyboard') {
|
|
160
|
+
<prism-a11y-keyboard [activeComponent]="activeComponent()" /> } @case
|
|
161
|
+
('tree') { <prism-a11y-tree [activeComponent]="activeComponent()" /> }
|
|
162
|
+
@case ('sr') { <prism-a11y-sr [activeComponent]="activeComponent()" /> }
|
|
163
|
+
} }
|
|
179
164
|
</div>
|
|
180
165
|
</div>
|
|
181
|
-
`, styles: ["\n :host { display: flex; flex-direction: column; height: 100%; }\n\n .
|
|
166
|
+
`, styles: ["\n :host { display: flex; flex-direction: column; height: 100%; }\n\n .a11y-panel { display: flex; flex-direction: column; height: 100%; }\n\n .subtabs {\n display: flex;\n gap: 2px;\n padding: 10px 20px 0;\n border-bottom: 1px solid var(--prism-border);\n background: var(--prism-bg-elevated);\n position: sticky;\n top: 0;\n z-index: 2;\n }\n\n .st-tab {\n padding: 7px 12px;\n font-size: 12px;\n font-weight: 500;\n color: var(--prism-text-muted);\n border-radius: var(--radius-sm) var(--radius-sm) 0 0;\n position: relative;\n display: flex;\n align-items: center;\n gap: 6px;\n background: none;\n border: none;\n cursor: pointer;\n font-family: var(--font-sans);\n transition: color var(--dur-fast);\n }\n .st-tab:hover { color: var(--prism-text-2); }\n .st-tab--active { color: var(--prism-text); }\n .st-tab--active::after {\n content: '';\n position: absolute;\n left: 8px;\n right: 8px;\n bottom: -1px;\n height: 2px;\n background: var(--prism-primary);\n border-radius: 1px;\n }\n\n .st-badge {\n min-width: 16px;\n height: 16px;\n padding: 0 5px;\n border-radius: 8px;\n font-family: var(--font-mono);\n font-size: 10px;\n font-weight: 700;\n display: grid;\n place-items: center;\n background: color-mix(in srgb, var(--prism-primary) 18%, transparent);\n color: var(--prism-primary);\n }\n .st-badge--ok {\n background: color-mix(in srgb, var(--prism-success) 18%, transparent);\n color: var(--prism-success);\n }\n .st-badge--warn {\n background: color-mix(in srgb, var(--prism-warn) 18%, transparent);\n color: var(--prism-warn);\n }\n\n .a11y-content { flex: 1; overflow: auto; min-height: 0; }\n\n .a11y-disabled {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100px;\n color: var(--prism-text-muted);\n font-size: 13px;\n }\n "] }]
|
|
182
167
|
}], null, { activeComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeComponent", required: false }] }] }); })();
|
|
183
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(A11yPanelComponent, { className: "A11yPanelComponent", filePath: "app/panels/a11y/a11y-panel.component.ts", lineNumber:
|
|
168
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(A11yPanelComponent, { className: "A11yPanelComponent", filePath: "app/panels/a11y/a11y-panel.component.ts", lineNumber: 160 }); })();
|
|
@@ -2,9 +2,10 @@ import * as i0 from "@angular/core";
|
|
|
2
2
|
export declare class A11yScoreComponent {
|
|
3
3
|
readonly score: import("@angular/core").InputSignal<number>;
|
|
4
4
|
readonly compact: import("@angular/core").InputSignal<boolean>;
|
|
5
|
+
protected readonly gradientId: string;
|
|
6
|
+
protected readonly R = 54;
|
|
5
7
|
protected readonly CIRC: number;
|
|
6
8
|
protected readonly dashOffset: import("@angular/core").Signal<number>;
|
|
7
|
-
protected readonly level: import("@angular/core").Signal<"good" | "warn" | "bad">;
|
|
8
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<A11yScoreComponent, never>;
|
|
9
10
|
static ɵcmp: i0.ɵɵComponentDeclaration<A11yScoreComponent, "prism-a11y-score", never, { "score": { "alias": "score"; "required": true; "isSignal": true; }; "compact": { "alias": "compact"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
10
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a11y-score.component.d.ts","sourceRoot":"","sources":["../../../../src/app/panels/a11y/a11y-score.component.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"a11y-score.component.d.ts","sourceRoot":"","sources":["../../../../src/app/panels/a11y/a11y-score.component.ts"],"names":[],"mappings":";AAWA,qBAwFa,kBAAkB;IAC7B,QAAQ,CAAC,KAAK,8CAA4B;IAC1C,QAAQ,CAAC,OAAO,+CAAgB;IAEhC,SAAS,CAAC,QAAQ,CAAC,UAAU,SAA0B;IACvD,SAAS,CAAC,QAAQ,CAAC,CAAC,MAAK;IACzB,SAAS,CAAC,QAAQ,CAAC,IAAI,SAAiB;IAExC,SAAS,CAAC,QAAQ,CAAC,UAAU,yCAE3B;yCAVS,kBAAkB;2CAAlB,kBAAkB;CAW9B"}
|
|
@@ -1,72 +1,78 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
1
|
+
import { ChangeDetectionStrategy, Component, computed, input, } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
function
|
|
4
|
-
i0.ɵɵ
|
|
5
|
-
i0.ɵɵ
|
|
6
|
-
i0.ɵɵtext(1);
|
|
3
|
+
function A11yScoreComponent_Conditional_8_Template(rf, ctx) { if (rf & 1) {
|
|
4
|
+
i0.ɵɵdomElementStart(0, "div", 7)(1, "div", 8);
|
|
5
|
+
i0.ɵɵtext(2);
|
|
7
6
|
i0.ɵɵdomElementEnd();
|
|
7
|
+
i0.ɵɵdomElementStart(3, "div", 9);
|
|
8
|
+
i0.ɵɵtext(4, "/ 100");
|
|
9
|
+
i0.ɵɵdomElementEnd()();
|
|
8
10
|
} if (rf & 2) {
|
|
9
11
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
10
|
-
i0.ɵɵadvance();
|
|
12
|
+
i0.ɵɵadvance(2);
|
|
11
13
|
i0.ɵɵtextInterpolate(ctx_r0.score());
|
|
12
14
|
} }
|
|
13
|
-
const
|
|
15
|
+
const R = 54;
|
|
16
|
+
const CIRCUMFERENCE = 2 * Math.PI * R;
|
|
17
|
+
let nextId = 0;
|
|
14
18
|
export class A11yScoreComponent {
|
|
15
19
|
score = input.required(...(ngDevMode ? [{ debugName: "score" }] : []));
|
|
16
20
|
compact = input(false, ...(ngDevMode ? [{ debugName: "compact" }] : []));
|
|
21
|
+
gradientId = `prism-sg-${nextId++}`;
|
|
22
|
+
R = R;
|
|
17
23
|
CIRC = CIRCUMFERENCE;
|
|
18
24
|
dashOffset = computed(() => CIRCUMFERENCE - (this.score() / 100) * CIRCUMFERENCE, ...(ngDevMode ? [{ debugName: "dashOffset" }] : []));
|
|
19
|
-
level = computed(() => {
|
|
20
|
-
const s = this.score();
|
|
21
|
-
if (s >= 80)
|
|
22
|
-
return 'good';
|
|
23
|
-
if (s >= 50)
|
|
24
|
-
return 'warn';
|
|
25
|
-
return 'bad';
|
|
26
|
-
}, ...(ngDevMode ? [{ debugName: "level" }] : []));
|
|
27
25
|
static ɵfac = function A11yScoreComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || A11yScoreComponent)(); };
|
|
28
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: A11yScoreComponent, selectors: [["prism-a11y-score"]], inputs: { score: [1, "score"], compact: [1, "compact"] }, decls:
|
|
26
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: A11yScoreComponent, selectors: [["prism-a11y-score"]], inputs: { score: [1, "score"], compact: [1, "compact"] }, decls: 9, vars: 7, consts: [[1, "score-ring"], ["viewBox", "0 0 128 128"], ["x1", "0", "y1", "0", "x2", "1", "y2", "1", 3, "id"], ["offset", "0%", "stop-color", "#a78bfa"], ["offset", "100%", "stop-color", "#3b82f6"], ["cx", "64", "cy", "64", 1, "track"], ["cx", "64", "cy", "64", 1, "fill"], [1, "score-val"], [1, "score-num"], [1, "score-max"]], template: function A11yScoreComponent_Template(rf, ctx) { if (rf & 1) {
|
|
27
|
+
i0.ɵɵdomElementStart(0, "div", 0);
|
|
29
28
|
i0.ɵɵnamespaceSVG();
|
|
30
|
-
i0.ɵɵdomElementStart(
|
|
31
|
-
i0.ɵɵdomElement(
|
|
32
|
-
i0.ɵɵ
|
|
29
|
+
i0.ɵɵdomElementStart(1, "svg", 1)(2, "defs")(3, "linearGradient", 2);
|
|
30
|
+
i0.ɵɵdomElement(4, "stop", 3)(5, "stop", 4);
|
|
31
|
+
i0.ɵɵdomElementEnd()();
|
|
32
|
+
i0.ɵɵdomElement(6, "circle", 5)(7, "circle", 6);
|
|
33
|
+
i0.ɵɵdomElementEnd();
|
|
34
|
+
i0.ɵɵconditionalCreate(8, A11yScoreComponent_Conditional_8_Template, 5, 1, "div", 7);
|
|
33
35
|
i0.ɵɵdomElementEnd();
|
|
34
36
|
} if (rf & 2) {
|
|
35
|
-
i0.ɵɵ
|
|
36
|
-
i0.ɵɵ
|
|
37
|
-
i0.ɵɵ
|
|
37
|
+
i0.ɵɵadvance(3);
|
|
38
|
+
i0.ɵɵdomProperty("id", ctx.gradientId);
|
|
39
|
+
i0.ɵɵadvance(3);
|
|
40
|
+
i0.ɵɵattribute("r", ctx.R);
|
|
41
|
+
i0.ɵɵadvance();
|
|
42
|
+
i0.ɵɵattribute("r", ctx.R)("stroke-dasharray", ctx.CIRC)("stroke-dashoffset", ctx.dashOffset())("stroke", "url(#" + ctx.gradientId + ")");
|
|
38
43
|
i0.ɵɵadvance();
|
|
39
|
-
i0.ɵɵconditional(!ctx.compact() ?
|
|
40
|
-
} }, styles: ["[_nghost-%COMP%] { display: inline-flex; }\n\n .
|
|
44
|
+
i0.ɵɵconditional(!ctx.compact() ? 8 : -1);
|
|
45
|
+
} }, styles: ["[_nghost-%COMP%] { display: inline-flex; }\n\n .score-ring[_ngcontent-%COMP%] {\n position: relative;\n width: 128px;\n height: 128px;\n }\n .compact[_nghost-%COMP%] .score-ring[_ngcontent-%COMP%], .compact [_nghost-%COMP%] .score-ring[_ngcontent-%COMP%], \n [style*=\"width:18px\"][_nghost-%COMP%] .score-ring[_ngcontent-%COMP%] {\n width: 100%;\n height: 100%;\n }\n\n .score-ring[_ngcontent-%COMP%] svg[_ngcontent-%COMP%] {\n transform: rotate(-90deg);\n width: 100%;\n height: 100%;\n }\n\n .score-ring[_ngcontent-%COMP%] circle[_ngcontent-%COMP%] {\n fill: none;\n stroke-width: 10;\n }\n .track[_ngcontent-%COMP%] { stroke: var(--prism-input-bg); }\n .fill[_ngcontent-%COMP%] {\n stroke-linecap: round;\n transition: stroke-dashoffset 0.5s ease;\n }\n\n .score-val[_ngcontent-%COMP%] {\n position: absolute;\n inset: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 0;\n }\n .score-num[_ngcontent-%COMP%] {\n font-size: 30px;\n font-weight: 700;\n letter-spacing: -0.02em;\n background: linear-gradient(135deg, #a78bfa, #ec4899);\n -webkit-background-clip: text;\n background-clip: text;\n color: transparent;\n font-family: var(--font-mono);\n }\n .score-max[_ngcontent-%COMP%] {\n font-size: 11px;\n color: var(--prism-text-ghost);\n font-weight: 500;\n }"], changeDetection: 0 });
|
|
41
46
|
}
|
|
42
47
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(A11yScoreComponent, [{
|
|
43
48
|
type: Component,
|
|
44
49
|
args: [{ selector: 'prism-a11y-score', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
class="
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
[attr.stroke-dashoffset]="dashOffset()"
|
|
65
|
-
/>
|
|
50
|
+
<div class="score-ring">
|
|
51
|
+
<svg viewBox="0 0 128 128">
|
|
52
|
+
<defs>
|
|
53
|
+
<linearGradient [id]="gradientId" x1="0" y1="0" x2="1" y2="1">
|
|
54
|
+
<stop offset="0%" stop-color="#a78bfa" />
|
|
55
|
+
<stop offset="100%" stop-color="#3b82f6" />
|
|
56
|
+
</linearGradient>
|
|
57
|
+
</defs>
|
|
58
|
+
<circle class="track" cx="64" cy="64" [attr.r]="R" />
|
|
59
|
+
<circle
|
|
60
|
+
class="fill"
|
|
61
|
+
cx="64"
|
|
62
|
+
cy="64"
|
|
63
|
+
[attr.r]="R"
|
|
64
|
+
[attr.stroke-dasharray]="CIRC"
|
|
65
|
+
[attr.stroke-dashoffset]="dashOffset()"
|
|
66
|
+
[attr.stroke]="'url(#' + gradientId + ')'"
|
|
67
|
+
/>
|
|
68
|
+
</svg>
|
|
66
69
|
@if (!compact()) {
|
|
67
|
-
|
|
70
|
+
<div class="score-val">
|
|
71
|
+
<div class="score-num">{{ score() }}</div>
|
|
72
|
+
<div class="score-max">/ 100</div>
|
|
73
|
+
</div>
|
|
68
74
|
}
|
|
69
|
-
</
|
|
70
|
-
`, styles: ["\n :host { display: inline-flex; }\n\n .
|
|
75
|
+
</div>
|
|
76
|
+
`, styles: ["\n :host { display: inline-flex; }\n\n .score-ring {\n position: relative;\n width: 128px;\n height: 128px;\n }\n :host-context(.compact) .score-ring,\n :host([style*=\"width:18px\"]) .score-ring {\n width: 100%;\n height: 100%;\n }\n\n .score-ring svg {\n transform: rotate(-90deg);\n width: 100%;\n height: 100%;\n }\n\n .score-ring circle {\n fill: none;\n stroke-width: 10;\n }\n .track { stroke: var(--prism-input-bg); }\n .fill {\n stroke-linecap: round;\n transition: stroke-dashoffset 0.5s ease;\n }\n\n .score-val {\n position: absolute;\n inset: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 0;\n }\n .score-num {\n font-size: 30px;\n font-weight: 700;\n letter-spacing: -0.02em;\n background: linear-gradient(135deg, #a78bfa, #ec4899);\n -webkit-background-clip: text;\n background-clip: text;\n color: transparent;\n font-family: var(--font-mono);\n }\n .score-max {\n font-size: 11px;\n color: var(--prism-text-ghost);\n font-weight: 500;\n }\n "] }]
|
|
71
77
|
}], null, { score: [{ type: i0.Input, args: [{ isSignal: true, alias: "score", required: true }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }] }); })();
|
|
72
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(A11yScoreComponent, { className: "A11yScoreComponent", filePath: "app/panels/a11y/a11y-score.component.ts", lineNumber:
|
|
78
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(A11yScoreComponent, { className: "A11yScoreComponent", filePath: "app/panels/a11y/a11y-score.component.ts", lineNumber: 100 }); })();
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
import { A11yPerspectiveService } from './a11y-perspective.service.js';
|
|
2
1
|
import { PrismRendererService } from '../../services/prism-renderer.service.js';
|
|
3
|
-
import type { SrAnnouncement } from './a11y.types.js';
|
|
4
2
|
import * as i0 from "@angular/core";
|
|
5
3
|
export declare class A11ySrComponent {
|
|
6
4
|
protected readonly rendererService: PrismRendererService;
|
|
7
5
|
private readonly srService;
|
|
8
|
-
protected readonly perspective: A11yPerspectiveService;
|
|
9
6
|
readonly activeComponent: import("@angular/core").InputSignal<unknown>;
|
|
10
|
-
protected readonly
|
|
11
|
-
protected readonly announcements: import("@angular/core").Signal<SrAnnouncement[]>;
|
|
12
|
-
protected readonly active: import("@angular/core").Signal<SrAnnouncement | null>;
|
|
13
|
-
protected readonly activeStates: import("@angular/core").Signal<string[]>;
|
|
14
|
-
protected next(): void;
|
|
15
|
-
protected prev(): void;
|
|
7
|
+
protected readonly announcements: import("@angular/core").Signal<import("./a11y.types.js").SrAnnouncement[]>;
|
|
16
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<A11ySrComponent, never>;
|
|
17
9
|
static ɵcmp: i0.ɵɵComponentDeclaration<A11ySrComponent, "prism-a11y-sr", never, { "activeComponent": { "alias": "activeComponent"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
18
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a11y-sr.component.d.ts","sourceRoot":"","sources":["../../../../src/app/panels/a11y/a11y-sr.component.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"a11y-sr.component.d.ts","sourceRoot":"","sources":["../../../../src/app/panels/a11y/a11y-sr.component.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;;AAEhF,qBAkFa,eAAe;IAC1B,SAAS,CAAC,QAAQ,CAAC,eAAe,uBAAgC;IAClE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;IAEnD,QAAQ,CAAC,eAAe,+CAAwB;IAEhD,SAAS,CAAC,QAAQ,CAAC,aAAa,6EAQ7B;yCAdQ,eAAe;2CAAf,eAAe;CAe3B"}
|