@ngbracket/a11y-devtools 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +9 -1
- package/dist/inpage.global.js +7 -3
- package/dist/overlay.js +13 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.7.1
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
|
|
10
|
+
- **Tab-order badges no longer collide with the findings labels.** A numbered
|
|
11
|
+
tab-order badge was anchored on each control's top-left corner — exactly where
|
|
12
|
+
the severity-coloured finding labels sit — so on a flagged control the two
|
|
13
|
+
overlapped and obscured each other. Badges now sit just outside the control's
|
|
14
|
+
left edge, vertically centred (clamped into the viewport for controls flush to
|
|
15
|
+
the left), and the connector path threads those points.
|
|
16
|
+
|
|
6
17
|
## 0.7.0
|
|
7
18
|
|
|
8
19
|
### Added
|
package/README.md
CHANGED
|
@@ -161,7 +161,15 @@ component that placed it and notes the primitive as `(via …)`.
|
|
|
161
161
|
axe covers the machine-testable third of WCAG. **Keyboard & Focus Mode** starts on
|
|
162
162
|
the rest — keyboard operability — still naming the component that owns each issue.
|
|
163
163
|
Turn it on with `keyboard: true` (provider / `runA11yScan` / `scan` / `scanPages`)
|
|
164
|
-
or `--keyboard` on the CLI.
|
|
164
|
+
or `--keyboard` on the CLI.
|
|
165
|
+
|
|
166
|
+

|
|
171
|
+
|
|
172
|
+
It adds:
|
|
165
173
|
|
|
166
174
|
- **Tab-order visualisation** (overlay): numbered badges at each tab stop and a
|
|
167
175
|
connector path showing the order focus actually moves. A positive-`tabindex` stop
|
package/dist/inpage.global.js
CHANGED
|
@@ -34226,6 +34226,8 @@
|
|
|
34226
34226
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
34227
34227
|
var TAB_ORDER_COLOR = "#0b8f8f";
|
|
34228
34228
|
var TAB_ORDER_WARN_COLOR = "#e8710a";
|
|
34229
|
+
var TAB_BADGE_GUTTER = 10;
|
|
34230
|
+
var TAB_BADGE_MIN_X = 9;
|
|
34229
34231
|
var OVERLAY_ATTR = "data-ngb-a11y-overlay";
|
|
34230
34232
|
var OVERLAY_EXCLUDE_SELECTOR = `[${OVERLAY_ATTR}]`;
|
|
34231
34233
|
var IMPACT_COLOR = {
|
|
@@ -34298,9 +34300,11 @@
|
|
|
34298
34300
|
const points = [];
|
|
34299
34301
|
for (const { target, badge } of tabBadges) {
|
|
34300
34302
|
const rect = target.getBoundingClientRect();
|
|
34301
|
-
|
|
34302
|
-
|
|
34303
|
-
|
|
34303
|
+
const y = rect.top + rect.height / 2;
|
|
34304
|
+
const x = Math.max(TAB_BADGE_MIN_X, rect.left - TAB_BADGE_GUTTER);
|
|
34305
|
+
badge.style.top = `${y}px`;
|
|
34306
|
+
badge.style.left = `${x}px`;
|
|
34307
|
+
points.push(`${x},${y}`);
|
|
34304
34308
|
}
|
|
34305
34309
|
connector.setAttribute("points", points.join(" "));
|
|
34306
34310
|
}
|
package/dist/overlay.js
CHANGED
|
@@ -2,6 +2,9 @@ const SVG_NS = 'http://www.w3.org/2000/svg';
|
|
|
2
2
|
/** Tab-order path + badge colours: normal teal, warning orange for positive tabindex. */
|
|
3
3
|
const TAB_ORDER_COLOR = '#0b8f8f';
|
|
4
4
|
const TAB_ORDER_WARN_COLOR = '#e8710a';
|
|
5
|
+
/** How far outside a control's left edge the tab-order badge sits, and its min viewport x. */
|
|
6
|
+
const TAB_BADGE_GUTTER = 10;
|
|
7
|
+
const TAB_BADGE_MIN_X = 9;
|
|
5
8
|
/**
|
|
6
9
|
* Attribute marking the overlay's own DOM. `scan()` excludes anything under it
|
|
7
10
|
* so the tool never reports violations against its own highlights.
|
|
@@ -92,9 +95,16 @@ export function createOverlay(options = {}) {
|
|
|
92
95
|
const points = [];
|
|
93
96
|
for (const { target, badge } of tabBadges) {
|
|
94
97
|
const rect = target.getBoundingClientRect();
|
|
95
|
-
badge
|
|
96
|
-
|
|
97
|
-
|
|
98
|
+
// Anchor the badge just OUTSIDE the left edge, vertically centred, so it
|
|
99
|
+
// clears the findings labels that sit along the top-left corner (a
|
|
100
|
+
// corner-anchored badge collided with them). Clamp x into the viewport so a
|
|
101
|
+
// control flush to the left edge still shows its badge. The connector
|
|
102
|
+
// threads these same points.
|
|
103
|
+
const y = rect.top + rect.height / 2;
|
|
104
|
+
const x = Math.max(TAB_BADGE_MIN_X, rect.left - TAB_BADGE_GUTTER);
|
|
105
|
+
badge.style.top = `${y}px`;
|
|
106
|
+
badge.style.left = `${x}px`;
|
|
107
|
+
points.push(`${x},${y}`);
|
|
98
108
|
}
|
|
99
109
|
connector.setAttribute('points', points.join(' '));
|
|
100
110
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngbracket/a11y-devtools",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
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",
|