@a11y-skills/audit 0.3.0 → 0.4.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/CHANGELOG.md +23 -0
- package/README.ja.md +64 -0
- package/README.md +64 -0
- package/dist/cli.d.ts +13 -0
- package/dist/cli.js +407 -0
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +99 -21
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/playwright/index.d.ts +1 -1
- package/dist/playwright/index.js +1 -1
- package/dist/playwright/runAutoPlayDetection.js +7 -2
- package/dist/playwright/runAutocompleteAudit.js +7 -2
- package/dist/playwright/runFocusIndicatorCheck.d.ts +7 -0
- package/dist/playwright/runFocusIndicatorCheck.js +45 -21
- package/dist/playwright/runReflowCheck.js +4 -1
- package/dist/playwright/runTargetSizeCheck.js +8 -3
- package/dist/playwright/runTextSpacingCheck.js +14 -4
- package/dist/playwright/runTimeLimitDetector.js +21 -15
- package/dist/playwright/runZoomCheck.js +12 -5
- package/dist/schemas/index.js +11 -2
- package/dist/utils/axe-format.js +12 -3
- package/dist/utils/layout.js +7 -2
- package/dist/utils/recommendations.js +2 -2
- package/package.json +5 -2
package/dist/utils/layout.js
CHANGED
|
@@ -17,7 +17,10 @@ export function createLayoutChecker(options) {
|
|
|
17
17
|
html = '';
|
|
18
18
|
}
|
|
19
19
|
if (!html) {
|
|
20
|
-
return {
|
|
20
|
+
return {
|
|
21
|
+
html: `<${element.tagName.toLowerCase()}>`,
|
|
22
|
+
htmlTruncated: false,
|
|
23
|
+
};
|
|
21
24
|
}
|
|
22
25
|
if (html.length > htmlSnippetMaxLength) {
|
|
23
26
|
return { html: html.slice(0, htmlSnippetMaxLength), htmlTruncated: true };
|
|
@@ -47,7 +50,9 @@ export function createLayoutChecker(options) {
|
|
|
47
50
|
current = parent;
|
|
48
51
|
}
|
|
49
52
|
// Append element index as fallback for guaranteed uniqueness
|
|
50
|
-
return path.length > 0
|
|
53
|
+
return path.length > 0
|
|
54
|
+
? path.join(' > ')
|
|
55
|
+
: `[data-index="${elementIndex}"]`;
|
|
51
56
|
}
|
|
52
57
|
function isAllowedOverflow(element) {
|
|
53
58
|
return allowedOverflowSelectors.some((selector) => {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Generate a recommendation based on detection results.
|
|
6
6
|
*/
|
|
7
7
|
export function generateRecommendation(ctx) {
|
|
8
|
-
const { hasAutoPlayContent, stopsWithin5Seconds, pauseControls, pauseVerification } = ctx;
|
|
8
|
+
const { hasAutoPlayContent, stopsWithin5Seconds, pauseControls, pauseVerification, } = ctx;
|
|
9
9
|
if (!hasAutoPlayContent) {
|
|
10
10
|
return 'No auto-playing content detected in viewport.';
|
|
11
11
|
}
|
|
@@ -32,7 +32,7 @@ export function generateRecommendation(ctx) {
|
|
|
32
32
|
* Print summary to console.
|
|
33
33
|
*/
|
|
34
34
|
export function printSummary(ctx, outputDir) {
|
|
35
|
-
const { hasAutoPlayContent, stopsWithin5Seconds, pauseControls, pauseVerification } = ctx;
|
|
35
|
+
const { hasAutoPlayContent, stopsWithin5Seconds, pauseControls, pauseVerification, } = ctx;
|
|
36
36
|
console.log('\n--- Summary ---');
|
|
37
37
|
if (!hasAutoPlayContent) {
|
|
38
38
|
console.log('✓ No auto-playing content detected in viewport');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a11y-skills/audit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Playwright + axe-core based WCAG 2.2 accessibility audit functions (axe, focus indicator, reflow, target size, text spacing, zoom, orientation, autocomplete, time limit, auto-play).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
|
-
"url": "https://github.com/masuP9/a11y-specialist-skills",
|
|
13
|
+
"url": "git+https://github.com/masuP9/a11y-specialist-skills.git",
|
|
14
14
|
"directory": "packages/a11y-audit"
|
|
15
15
|
},
|
|
16
16
|
"homepage": "https://github.com/masuP9/a11y-specialist-skills/tree/main/packages/a11y-audit",
|
|
@@ -29,6 +29,9 @@
|
|
|
29
29
|
"reflow",
|
|
30
30
|
"target-size"
|
|
31
31
|
],
|
|
32
|
+
"bin": {
|
|
33
|
+
"a11y-audit": "dist/cli.js"
|
|
34
|
+
},
|
|
32
35
|
"exports": {
|
|
33
36
|
".": {
|
|
34
37
|
"types": "./dist/index.d.ts",
|