@a11y-hud/angular 0.1.1 → 0.2.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.
|
@@ -12,11 +12,12 @@ class A11yHudService {
|
|
|
12
12
|
instance = null;
|
|
13
13
|
el = null;
|
|
14
14
|
init(options = {}) {
|
|
15
|
-
const { theme, autoScan, debounce } = options;
|
|
15
|
+
const { theme, autoScan, debounce, runOnly } = options;
|
|
16
16
|
this.instance = mount({
|
|
17
17
|
...(theme !== undefined && { theme }),
|
|
18
18
|
...(autoScan !== undefined && { autoScan }),
|
|
19
19
|
...(debounce !== undefined && { debounce }),
|
|
20
|
+
...(runOnly !== undefined && { runOnly }),
|
|
20
21
|
});
|
|
21
22
|
this.el = document.querySelector("a11y-hud");
|
|
22
23
|
if (this.el) {
|
|
@@ -56,6 +57,9 @@ class A11yHudService {
|
|
|
56
57
|
setTheme(theme) {
|
|
57
58
|
this.instance?.setTheme(theme);
|
|
58
59
|
}
|
|
60
|
+
setRunOnly(tags) {
|
|
61
|
+
this.instance?.setRunOnly(tags);
|
|
62
|
+
}
|
|
59
63
|
get initialized() {
|
|
60
64
|
return this.instance !== null;
|
|
61
65
|
}
|
|
@@ -76,6 +80,7 @@ class A11yHudComponent {
|
|
|
76
80
|
scope = null;
|
|
77
81
|
autoScan;
|
|
78
82
|
debounce;
|
|
83
|
+
runOnly;
|
|
79
84
|
service = inject(A11yHudService);
|
|
80
85
|
constructor() {
|
|
81
86
|
// Render-settled rescan: mirrors React's useEffect(fn) (no deps). Fires after
|
|
@@ -94,6 +99,7 @@ class A11yHudComponent {
|
|
|
94
99
|
scope: this.scope,
|
|
95
100
|
...(this.autoScan !== undefined && { autoScan: this.autoScan }),
|
|
96
101
|
...(this.debounce !== undefined && { debounce: this.debounce }),
|
|
102
|
+
...(this.runOnly !== undefined && { runOnly: this.runOnly }),
|
|
97
103
|
});
|
|
98
104
|
void this.service.runScan();
|
|
99
105
|
}
|
|
@@ -113,6 +119,9 @@ class A11yHudComponent {
|
|
|
113
119
|
if ("debounce" in changes) {
|
|
114
120
|
this.service.syncDebounce(this.debounce);
|
|
115
121
|
}
|
|
122
|
+
if ("runOnly" in changes) {
|
|
123
|
+
this.service.setRunOnly(this.runOnly ?? []);
|
|
124
|
+
}
|
|
116
125
|
}
|
|
117
126
|
runScan() {
|
|
118
127
|
return this.service.runScan();
|
|
@@ -120,8 +129,11 @@ class A11yHudComponent {
|
|
|
120
129
|
setTheme(theme) {
|
|
121
130
|
this.service.setTheme(theme);
|
|
122
131
|
}
|
|
132
|
+
setRunOnly(tags) {
|
|
133
|
+
this.service.setRunOnly(tags);
|
|
134
|
+
}
|
|
123
135
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: A11yHudComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
124
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.11", type: A11yHudComponent, isStandalone: true, selector: "a11y-hud-angular", inputs: { theme: "theme", scope: "scope", autoScan: "autoScan", debounce: "debounce" }, providers: [A11yHudService], usesOnChanges: true, ngImport: i0, template: "", isInline: true });
|
|
136
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.11", type: A11yHudComponent, isStandalone: true, selector: "a11y-hud-angular", inputs: { theme: "theme", scope: "scope", autoScan: "autoScan", debounce: "debounce", runOnly: "runOnly" }, providers: [A11yHudService], usesOnChanges: true, ngImport: i0, template: "", isInline: true });
|
|
125
137
|
}
|
|
126
138
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: A11yHudComponent, decorators: [{
|
|
127
139
|
type: Component,
|
|
@@ -139,6 +151,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
139
151
|
type: Input
|
|
140
152
|
}], debounce: [{
|
|
141
153
|
type: Input
|
|
154
|
+
}], runOnly: [{
|
|
155
|
+
type: Input
|
|
142
156
|
}] } });
|
|
143
157
|
|
|
144
158
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a11y-hud-angular.mjs","sources":["../../src/service.ts","../../src/component.ts","../../src/a11y-hud-angular.ts"],"sourcesContent":["import { type ElementRef, Injectable, inject, NgZone, type OnDestroy } from \"@angular/core\";\nimport type { A11yHudElement, A11yHudInstance, AxeResults, Theme } from \"a11y-hud\";\nimport { mount } from \"a11y-hud\";\nimport type { ScopeInput, UseA11yHudOptions } from \"./types.js\";\n\nfunction resolveScope(scope: ScopeInput): Element | undefined {\n if (scope == null) return undefined;\n return scope instanceof Element ? scope : (scope as ElementRef<Element>).nativeElement;\n}\n\n@Injectable()\nexport class A11yHudService implements OnDestroy {\n private readonly ngZone = inject(NgZone);\n private instance: A11yHudInstance | null = null;\n private el: A11yHudElement | null = null;\n\n init(options: UseA11yHudOptions = {}): void {\n const { theme, autoScan, debounce } = options;\n this.instance = mount({\n ...(theme !== undefined && { theme }),\n ...(autoScan !== undefined && { autoScan }),\n ...(debounce !== undefined && { debounce }),\n });\n this.el = document.querySelector<A11yHudElement>(\"a11y-hud\");\n if (this.el) {\n this.el.scopeElement = resolveScope(options.scope);\n }\n }\n\n syncScope(scope: ScopeInput): void {\n const el = this.el;\n if (!el) return;\n el.scopeElement = resolveScope(scope);\n }\n\n syncTheme(theme: Theme | undefined): void {\n if (theme !== undefined) this.instance?.setTheme(theme);\n }\n\n syncAutoScan(autoScan: boolean | undefined): void {\n const el = this.el;\n if (!el || autoScan === undefined) return;\n if (autoScan === false) {\n el.removeAttribute(\"auto-scan\");\n } else {\n el.setAttribute(\"auto-scan\", \"\");\n }\n }\n\n syncDebounce(debounce: number | undefined): void {\n const el = this.el;\n if (!el || debounce === undefined) return;\n el.setAttribute(\"debounce\", String(debounce));\n }\n\n runScan(): Promise<AxeResults> {\n return this.ngZone.runOutsideAngular(\n () => this.instance?.runScan() ?? Promise.resolve(null as unknown as AxeResults)\n );\n }\n\n setTheme(theme: Theme): void {\n this.instance?.setTheme(theme);\n }\n\n get initialized(): boolean {\n return this.instance !== null;\n }\n\n ngOnDestroy(): void {\n this.instance?.unmount();\n this.instance = null;\n this.el = null;\n }\n}\n","import {\n type AfterViewInit,\n afterEveryRender,\n Component,\n Input,\n inject,\n type OnChanges,\n type SimpleChanges,\n} from \"@angular/core\";\nimport type { AxeResults, Theme } from \"a11y-hud\";\nimport { A11yHudService } from \"./service.js\";\nimport type { ScopeInput } from \"./types.js\";\n\n@Component({\n standalone: true,\n selector: \"a11y-hud-angular\",\n template: \"\",\n providers: [A11yHudService],\n})\nexport class A11yHudComponent implements AfterViewInit, OnChanges {\n @Input() theme?: Theme;\n @Input() scope: ScopeInput = null;\n @Input() autoScan?: boolean;\n @Input() debounce?: number;\n\n private readonly service = inject(A11yHudService);\n\n constructor() {\n // Render-settled rescan: mirrors React's useEffect(fn) (no deps). Fires after\n // every Angular render commit — catches route changes and any re-render that\n // does not alter @Input() values, which ngOnChanges would otherwise miss.\n afterEveryRender(() => {\n if (!this.service.initialized) return;\n this.service.syncScope(this.scope);\n void this.service.runScan();\n });\n }\n\n ngAfterViewInit(): void {\n this.service.init({\n ...(this.theme !== undefined && { theme: this.theme }),\n scope: this.scope,\n ...(this.autoScan !== undefined && { autoScan: this.autoScan }),\n ...(this.debounce !== undefined && { debounce: this.debounce }),\n });\n void this.service.runScan();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (!this.service.initialized) return;\n\n if (\"scope\" in changes) {\n this.service.syncScope(this.scope);\n void this.service.runScan();\n }\n if (\"theme\" in changes) {\n this.service.syncTheme(this.theme);\n }\n if (\"autoScan\" in changes) {\n this.service.syncAutoScan(this.autoScan);\n }\n if (\"debounce\" in changes) {\n this.service.syncDebounce(this.debounce);\n }\n }\n\n runScan(): Promise<AxeResults> {\n return this.service.runScan();\n }\n\n setTheme(theme: Theme): void {\n this.service.setTheme(theme);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAKA,SAAS,YAAY,CAAC,KAAiB,EAAA;IACrC,IAAI,KAAK,IAAI,IAAI;AAAE,QAAA,OAAO,SAAS;AACnC,IAAA,OAAO,KAAK,YAAY,OAAO,GAAG,KAAK,GAAI,KAA6B,CAAC,aAAa;AACxF;MAGa,cAAc,CAAA;AACR,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAChC,QAAQ,GAA2B,IAAI;IACvC,EAAE,GAA0B,IAAI;IAExC,IAAI,CAAC,UAA6B,EAAE,EAAA;QAClC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO;
|
|
1
|
+
{"version":3,"file":"a11y-hud-angular.mjs","sources":["../../src/service.ts","../../src/component.ts","../../src/a11y-hud-angular.ts"],"sourcesContent":["import { type ElementRef, Injectable, inject, NgZone, type OnDestroy } from \"@angular/core\";\nimport type { A11yHudElement, A11yHudInstance, AxeResults, Theme } from \"a11y-hud\";\nimport { mount } from \"a11y-hud\";\nimport type { ScopeInput, UseA11yHudOptions } from \"./types.js\";\n\nfunction resolveScope(scope: ScopeInput): Element | undefined {\n if (scope == null) return undefined;\n return scope instanceof Element ? scope : (scope as ElementRef<Element>).nativeElement;\n}\n\n@Injectable()\nexport class A11yHudService implements OnDestroy {\n private readonly ngZone = inject(NgZone);\n private instance: A11yHudInstance | null = null;\n private el: A11yHudElement | null = null;\n\n init(options: UseA11yHudOptions = {}): void {\n const { theme, autoScan, debounce, runOnly } = options;\n this.instance = mount({\n ...(theme !== undefined && { theme }),\n ...(autoScan !== undefined && { autoScan }),\n ...(debounce !== undefined && { debounce }),\n ...(runOnly !== undefined && { runOnly }),\n });\n this.el = document.querySelector<A11yHudElement>(\"a11y-hud\");\n if (this.el) {\n this.el.scopeElement = resolveScope(options.scope);\n }\n }\n\n syncScope(scope: ScopeInput): void {\n const el = this.el;\n if (!el) return;\n el.scopeElement = resolveScope(scope);\n }\n\n syncTheme(theme: Theme | undefined): void {\n if (theme !== undefined) this.instance?.setTheme(theme);\n }\n\n syncAutoScan(autoScan: boolean | undefined): void {\n const el = this.el;\n if (!el || autoScan === undefined) return;\n if (autoScan === false) {\n el.removeAttribute(\"auto-scan\");\n } else {\n el.setAttribute(\"auto-scan\", \"\");\n }\n }\n\n syncDebounce(debounce: number | undefined): void {\n const el = this.el;\n if (!el || debounce === undefined) return;\n el.setAttribute(\"debounce\", String(debounce));\n }\n\n runScan(): Promise<AxeResults> {\n return this.ngZone.runOutsideAngular(\n () => this.instance?.runScan() ?? Promise.resolve(null as unknown as AxeResults)\n );\n }\n\n setTheme(theme: Theme): void {\n this.instance?.setTheme(theme);\n }\n\n setRunOnly(tags: string[]): void {\n this.instance?.setRunOnly(tags);\n }\n\n get initialized(): boolean {\n return this.instance !== null;\n }\n\n ngOnDestroy(): void {\n this.instance?.unmount();\n this.instance = null;\n this.el = null;\n }\n}\n","import {\n type AfterViewInit,\n afterEveryRender,\n Component,\n Input,\n inject,\n type OnChanges,\n type SimpleChanges,\n} from \"@angular/core\";\nimport type { AxeResults, Theme } from \"a11y-hud\";\nimport { A11yHudService } from \"./service.js\";\nimport type { ScopeInput } from \"./types.js\";\n\n@Component({\n standalone: true,\n selector: \"a11y-hud-angular\",\n template: \"\",\n providers: [A11yHudService],\n})\nexport class A11yHudComponent implements AfterViewInit, OnChanges {\n @Input() theme?: Theme;\n @Input() scope: ScopeInput = null;\n @Input() autoScan?: boolean;\n @Input() debounce?: number;\n @Input() runOnly?: string[];\n\n private readonly service = inject(A11yHudService);\n\n constructor() {\n // Render-settled rescan: mirrors React's useEffect(fn) (no deps). Fires after\n // every Angular render commit — catches route changes and any re-render that\n // does not alter @Input() values, which ngOnChanges would otherwise miss.\n afterEveryRender(() => {\n if (!this.service.initialized) return;\n this.service.syncScope(this.scope);\n void this.service.runScan();\n });\n }\n\n ngAfterViewInit(): void {\n this.service.init({\n ...(this.theme !== undefined && { theme: this.theme }),\n scope: this.scope,\n ...(this.autoScan !== undefined && { autoScan: this.autoScan }),\n ...(this.debounce !== undefined && { debounce: this.debounce }),\n ...(this.runOnly !== undefined && { runOnly: this.runOnly }),\n });\n void this.service.runScan();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (!this.service.initialized) return;\n\n if (\"scope\" in changes) {\n this.service.syncScope(this.scope);\n void this.service.runScan();\n }\n if (\"theme\" in changes) {\n this.service.syncTheme(this.theme);\n }\n if (\"autoScan\" in changes) {\n this.service.syncAutoScan(this.autoScan);\n }\n if (\"debounce\" in changes) {\n this.service.syncDebounce(this.debounce);\n }\n if (\"runOnly\" in changes) {\n this.service.setRunOnly(this.runOnly ?? []);\n }\n }\n\n runScan(): Promise<AxeResults> {\n return this.service.runScan();\n }\n\n setTheme(theme: Theme): void {\n this.service.setTheme(theme);\n }\n\n setRunOnly(tags: string[]): void {\n this.service.setRunOnly(tags);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAKA,SAAS,YAAY,CAAC,KAAiB,EAAA;IACrC,IAAI,KAAK,IAAI,IAAI;AAAE,QAAA,OAAO,SAAS;AACnC,IAAA,OAAO,KAAK,YAAY,OAAO,GAAG,KAAK,GAAI,KAA6B,CAAC,aAAa;AACxF;MAGa,cAAc,CAAA;AACR,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAChC,QAAQ,GAA2B,IAAI;IACvC,EAAE,GAA0B,IAAI;IAExC,IAAI,CAAC,UAA6B,EAAE,EAAA;QAClC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO;AACtD,QAAA,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YACpB,IAAI,KAAK,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE,CAAC;YACrC,IAAI,QAAQ,KAAK,SAAS,IAAI,EAAE,QAAQ,EAA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|
|
8
8
|
scope?: ScopeInput;
|
|
9
9
|
autoScan?: boolean;
|
|
10
10
|
debounce?: number;
|
|
11
|
+
runOnly?: string[];
|
|
11
12
|
}
|
|
12
13
|
type A11yHudProps = UseA11yHudOptions;
|
|
13
14
|
interface UseA11yHudReturn {
|
|
14
15
|
runScan(): Promise<AxeResults>;
|
|
15
16
|
setTheme(theme: Theme): void;
|
|
17
|
+
setRunOnly(tags: string[]): void;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
declare class A11yHudComponent implements AfterViewInit, OnChanges {
|
|
@@ -20,14 +22,16 @@ declare class A11yHudComponent implements AfterViewInit, OnChanges {
|
|
|
20
22
|
scope: ScopeInput;
|
|
21
23
|
autoScan?: boolean;
|
|
22
24
|
debounce?: number;
|
|
25
|
+
runOnly?: string[];
|
|
23
26
|
private readonly service;
|
|
24
27
|
constructor();
|
|
25
28
|
ngAfterViewInit(): void;
|
|
26
29
|
ngOnChanges(changes: SimpleChanges): void;
|
|
27
30
|
runScan(): Promise<AxeResults>;
|
|
28
31
|
setTheme(theme: Theme): void;
|
|
32
|
+
setRunOnly(tags: string[]): void;
|
|
29
33
|
static ɵfac: i0.ɵɵFactoryDeclaration<A11yHudComponent, never>;
|
|
30
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<A11yHudComponent, "a11y-hud-angular", never, { "theme": { "alias": "theme"; "required": false; }; "scope": { "alias": "scope"; "required": false; }; "autoScan": { "alias": "autoScan"; "required": false; }; "debounce": { "alias": "debounce"; "required": false; }; }, {}, never, never, true, never>;
|
|
34
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<A11yHudComponent, "a11y-hud-angular", never, { "theme": { "alias": "theme"; "required": false; }; "scope": { "alias": "scope"; "required": false; }; "autoScan": { "alias": "autoScan"; "required": false; }; "debounce": { "alias": "debounce"; "required": false; }; "runOnly": { "alias": "runOnly"; "required": false; }; }, {}, never, never, true, never>;
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
declare class A11yHudService implements OnDestroy {
|
|
@@ -41,6 +45,7 @@ declare class A11yHudService implements OnDestroy {
|
|
|
41
45
|
syncDebounce(debounce: number | undefined): void;
|
|
42
46
|
runScan(): Promise<AxeResults>;
|
|
43
47
|
setTheme(theme: Theme): void;
|
|
48
|
+
setRunOnly(tags: string[]): void;
|
|
44
49
|
get initialized(): boolean;
|
|
45
50
|
ngOnDestroy(): void;
|
|
46
51
|
static ɵfac: i0.ɵɵFactoryDeclaration<A11yHudService, never>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a11y-hud/angular",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Angular adapter for a11y-hud — run axe-core accessibility audits in your Angular app with no DevTools required.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"tslib": "^2.3.0",
|
|
22
|
-
"a11y-hud": "0.
|
|
22
|
+
"a11y-hud": "0.2.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@angular/core": ">=20.0.0 <23.0.0"
|