@ngbracket/a11y-devtools 0.12.2 → 0.12.3
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/CHANGELOG.md +21 -0
- package/dist/inpage.global.js +1 -0
- package/dist/overlay.js +6 -0
- package/dist/report/format.d.ts +14 -0
- package/dist/report/format.js +20 -2
- package/dist/report/html.js +8 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,27 @@
|
|
|
3
3
|
All notable changes to `@ngbracket/a11y-devtools` are documented here.
|
|
4
4
|
This project adheres to [Semantic Versioning](https://semver.org/).
|
|
5
5
|
|
|
6
|
+
## 0.12.3
|
|
7
|
+
|
|
8
|
+
### Changed
|
|
9
|
+
|
|
10
|
+
- **Reports say what they aren't.** The Markdown and HTML reports are now titled
|
|
11
|
+
"Automated accessibility scan" (was "Accessibility report") and open with a
|
|
12
|
+
scope note: automated checks cover only part of WCAG, and the report is not a
|
|
13
|
+
conformance report or a VPAT/ACR. The note links to
|
|
14
|
+
[What it checks (and what it can't)](https://ngbracket.com/tools/a11y-devtools/docs/coverage).
|
|
15
|
+
JSON reports carry the same note as a top-level `scope` field. A clean page now
|
|
16
|
+
reads "No automated violations found." The in-app **Download report** gets the
|
|
17
|
+
same changes.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- **The overlay no longer adds text to the page's accessibility tree.** Finding
|
|
22
|
+
labels, tab-order numbers and the accessibility-tree preview panel were exposed
|
|
23
|
+
to screen readers, mixing rule ids and badge numbers into the app being tested.
|
|
24
|
+
The overlay layer is now `aria-hidden`. The on/off pill and its menu are in a
|
|
25
|
+
separate layer and stay fully accessible.
|
|
26
|
+
|
|
6
27
|
## 0.12.2
|
|
7
28
|
|
|
8
29
|
### Changed
|
package/dist/inpage.global.js
CHANGED
|
@@ -34321,6 +34321,7 @@
|
|
|
34321
34321
|
const doc = options.document ?? document;
|
|
34322
34322
|
const container = doc.createElement("div");
|
|
34323
34323
|
container.setAttribute(OVERLAY_ATTR, "");
|
|
34324
|
+
container.setAttribute("aria-hidden", "true");
|
|
34324
34325
|
Object.assign(container.style, {
|
|
34325
34326
|
position: "fixed",
|
|
34326
34327
|
inset: "0",
|
package/dist/overlay.js
CHANGED
|
@@ -38,6 +38,12 @@ export function createOverlay(options = {}) {
|
|
|
38
38
|
const doc = options.document ?? document;
|
|
39
39
|
const container = doc.createElement('div');
|
|
40
40
|
container.setAttribute(OVERLAY_ATTR, '');
|
|
41
|
+
// The highlights, badges and preview panel are a visual aid for sighted
|
|
42
|
+
// developers. Hide them from assistive tech so their text (rule ids, tab
|
|
43
|
+
// numbers, panel rows) doesn't pollute the page's own accessibility tree. The
|
|
44
|
+
// on/off pill lives in a separate layer and stays exposed. Nothing in here is
|
|
45
|
+
// focusable, so this can't create an aria-hidden focus trap.
|
|
46
|
+
container.setAttribute('aria-hidden', 'true');
|
|
41
47
|
Object.assign(container.style, {
|
|
42
48
|
position: 'fixed',
|
|
43
49
|
inset: '0',
|
package/dist/report/format.d.ts
CHANGED
|
@@ -24,6 +24,20 @@ export interface PageReport {
|
|
|
24
24
|
}
|
|
25
25
|
/** One-line explanation for a dark-only page, shared by the Markdown and HTML reports. */
|
|
26
26
|
export declare const DARK_ONLY_NOTE = "Dark mode: lists only issues that don\u2019t also appear in light mode on this route.";
|
|
27
|
+
/**
|
|
28
|
+
* Report title, shared by every format. Says "automated scan" on purpose: a file
|
|
29
|
+
* titled "Accessibility report" is easy to hand to procurement as if it were a
|
|
30
|
+
* conformance report.
|
|
31
|
+
*/
|
|
32
|
+
export declare const REPORT_TITLE = "Automated accessibility scan";
|
|
33
|
+
/** Docs page explaining what automated checks cover and what they can't. */
|
|
34
|
+
export declare const COVERAGE_URL = "https://ngbracket.com/tools/a11y-devtools/docs/coverage";
|
|
35
|
+
/**
|
|
36
|
+
* What the report is and isn't, shown under the title in every format (and as
|
|
37
|
+
* `scope` in JSON). Automated checks cover part of WCAG; a clean run is not a
|
|
38
|
+
* conformance claim, and a VPAT/ACR needs a person to judge every criterion.
|
|
39
|
+
*/
|
|
40
|
+
export declare const REPORT_SCOPE_NOTE: string;
|
|
27
41
|
/** A whole report-mode run across one or more pages. */
|
|
28
42
|
export interface ScanReport {
|
|
29
43
|
/** ISO timestamp of the run. */
|
package/dist/report/format.js
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
/** One-line explanation for a dark-only page, shared by the Markdown and HTML reports. */
|
|
2
2
|
export const DARK_ONLY_NOTE = 'Dark mode: lists only issues that don’t also appear in light mode on this route.';
|
|
3
|
+
/**
|
|
4
|
+
* Report title, shared by every format. Says "automated scan" on purpose: a file
|
|
5
|
+
* titled "Accessibility report" is easy to hand to procurement as if it were a
|
|
6
|
+
* conformance report.
|
|
7
|
+
*/
|
|
8
|
+
export const REPORT_TITLE = 'Automated accessibility scan';
|
|
9
|
+
/** Docs page explaining what automated checks cover and what they can't. */
|
|
10
|
+
export const COVERAGE_URL = 'https://ngbracket.com/tools/a11y-devtools/docs/coverage';
|
|
11
|
+
/**
|
|
12
|
+
* What the report is and isn't, shown under the title in every format (and as
|
|
13
|
+
* `scope` in JSON). Automated checks cover part of WCAG; a clean run is not a
|
|
14
|
+
* conformance claim, and a VPAT/ACR needs a person to judge every criterion.
|
|
15
|
+
*/
|
|
16
|
+
export const REPORT_SCOPE_NOTE = 'Automated checks cover only part of WCAG. This is not a conformance report or a VPAT/ACR: ' +
|
|
17
|
+
'manual keyboard, screen-reader and content review is still required.';
|
|
3
18
|
/**
|
|
4
19
|
* Group findings by the component that rendered them — the readable form the
|
|
5
20
|
* attribution makes possible ("♿ HeaderComponent — 2 issues" beats a list of
|
|
@@ -43,6 +58,7 @@ export function toJson(report, diff) {
|
|
|
43
58
|
const all = report.pages.flatMap((p) => p.findings);
|
|
44
59
|
return JSON.stringify({
|
|
45
60
|
generatedAt: report.generatedAt,
|
|
61
|
+
scope: `${REPORT_SCOPE_NOTE} ${COVERAGE_URL}`,
|
|
46
62
|
summary: {
|
|
47
63
|
pages: report.pages.length,
|
|
48
64
|
distinctRules: distinctRuleCount(all),
|
|
@@ -91,10 +107,12 @@ export function addedBySeverity(diff) {
|
|
|
91
107
|
export function toMarkdown(report, diff) {
|
|
92
108
|
const all = report.pages.flatMap((p) => p.findings);
|
|
93
109
|
const lines = [];
|
|
94
|
-
lines.push(
|
|
110
|
+
lines.push(`# ${REPORT_TITLE}`);
|
|
95
111
|
lines.push('');
|
|
96
112
|
lines.push(`_Generated ${report.generatedAt} · @ngbracket/a11y-devtools report-mode_`);
|
|
97
113
|
lines.push('');
|
|
114
|
+
lines.push(`> ${REPORT_SCOPE_NOTE} [What automated checks cover](${COVERAGE_URL}).`);
|
|
115
|
+
lines.push('');
|
|
98
116
|
// Summary table — distinct rules alongside raw node-instances, so the headline
|
|
99
117
|
// count can't be read as "how bad is it" on its own.
|
|
100
118
|
lines.push('## Summary');
|
|
@@ -131,7 +149,7 @@ export function toMarkdown(report, diff) {
|
|
|
131
149
|
continue;
|
|
132
150
|
}
|
|
133
151
|
if (page.findings.length === 0) {
|
|
134
|
-
lines.push('No violations found. ✅');
|
|
152
|
+
lines.push('No automated violations found. ✅');
|
|
135
153
|
lines.push('');
|
|
136
154
|
continue;
|
|
137
155
|
}
|
package/dist/report/html.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addedBySeverity, DARK_ONLY_NOTE, bySeverity, distinctRuleCount, groupByComponent, viaNames, } from './format.js';
|
|
1
|
+
import { addedBySeverity, COVERAGE_URL, DARK_ONLY_NOTE, REPORT_SCOPE_NOTE, REPORT_TITLE, bySeverity, distinctRuleCount, groupByComponent, viaNames, } from './format.js';
|
|
2
2
|
/**
|
|
3
3
|
* A single self-contained HTML report: inline CSS, no scripts, no external
|
|
4
4
|
* requests — so it can be attached to a CI run, emailed, or opened offline.
|
|
@@ -46,7 +46,9 @@ main { max-width: 960px; margin: 0 auto; padding: 32px 16px 64px; }
|
|
|
46
46
|
h1 { font-size: 1.6rem; margin: 0 0 4px; }
|
|
47
47
|
h2 { font-size: 1.25rem; margin: 40px 0 12px; padding-top: 16px; border-top: 1px solid var(--line); }
|
|
48
48
|
h3 { font-size: 1.05rem; margin: 0 0 4px; }
|
|
49
|
-
.meta { color: var(--muted); margin: 0 0
|
|
49
|
+
.meta { color: var(--muted); margin: 0 0 12px; }
|
|
50
|
+
.scope { background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
|
|
51
|
+
margin: 0 0 24px; padding: 10px 14px; }
|
|
50
52
|
a { color: var(--link); }
|
|
51
53
|
code { font: 0.9em/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
|
|
52
54
|
table { border-collapse: collapse; width: 100%; margin: 8px 0 16px; }
|
|
@@ -85,13 +87,14 @@ export function toHtml(report, diff) {
|
|
|
85
87
|
out.push('<head>');
|
|
86
88
|
out.push('<meta charset="utf-8">');
|
|
87
89
|
out.push('<meta name="viewport" content="width=device-width, initial-scale=1">');
|
|
88
|
-
out.push(
|
|
90
|
+
out.push(`<title>${REPORT_TITLE}</title>`);
|
|
89
91
|
out.push(`<style>${STYLES}</style>`);
|
|
90
92
|
out.push('</head>');
|
|
91
93
|
out.push('<body>');
|
|
92
94
|
out.push('<main>');
|
|
93
|
-
out.push(
|
|
95
|
+
out.push(`<h1>${REPORT_TITLE}</h1>`);
|
|
94
96
|
out.push(`<p class="meta">Generated <time datetime="${escapeHtml(report.generatedAt)}">${escapeHtml(report.generatedAt)}</time> · @ngbracket/a11y-devtools report-mode</p>`);
|
|
97
|
+
out.push(`<p class="scope">${escapeHtml(REPORT_SCOPE_NOTE)} <a href="${COVERAGE_URL}">What automated checks cover</a>.</p>`);
|
|
95
98
|
// Summary — distinct rules next to raw node-instances, so the bigger number
|
|
96
99
|
// can't be read on its own as "how bad is it".
|
|
97
100
|
out.push('<section aria-labelledby="summary">');
|
|
@@ -131,7 +134,7 @@ export function toHtml(report, diff) {
|
|
|
131
134
|
return;
|
|
132
135
|
}
|
|
133
136
|
if (page.findings.length === 0) {
|
|
134
|
-
out.push('<p class="ok">No violations found.</p>');
|
|
137
|
+
out.push('<p class="ok">No automated violations found.</p>');
|
|
135
138
|
out.push('</section>');
|
|
136
139
|
return;
|
|
137
140
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngbracket/a11y-devtools",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.3",
|
|
4
4
|
"description": "Dev-only in-app accessibility auditing for Angular that maps each axe violation back to the component that rendered it — the attribution React overlay tools can't do.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Duncan Faulkner",
|