gbu-accessibility-package 1.5.0 → 3.0.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 +97 -51
- package/cli.js +196 -101
- package/demo/advanced-test.html +44 -0
- package/demo/advanced-test.html.backup +44 -0
- package/demo/aria-label-test.html +32 -0
- package/demo/backup-test.html +18 -0
- package/demo/backup-test2.html +13 -0
- package/demo/backup-test3.html +12 -0
- package/demo/comprehensive-test.html +21 -0
- package/demo/comprehensive-test.html.backup +21 -0
- package/lib/fixer.js +725 -11
- package/package.json +8 -1
- package/demo/duplicate-roles.html.backup +0 -45
- package/demo/picture-test.html +0 -37
- package/demo/picture-test.html.backup +0 -37
- package/demo/sample.html.backup +0 -47
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gbu-accessibility-package",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Automated accessibility fixes for HTML files - Alt attributes, Lang attributes, Role attributes. Smart context-aware alt text generation with individual fix options and comprehensive role attribute management.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -15,7 +15,14 @@
|
|
|
15
15
|
"alt-only": "node cli.js --alt-only",
|
|
16
16
|
"lang-only": "node cli.js --lang-only",
|
|
17
17
|
"role-only": "node cli.js --role-only",
|
|
18
|
+
"forms-only": "node cli.js --forms-only",
|
|
19
|
+
"buttons-only": "node cli.js --buttons-only",
|
|
20
|
+
"links-only": "node cli.js --links-only",
|
|
21
|
+
"landmarks-only": "node cli.js --landmarks-only",
|
|
22
|
+
"headings-only": "node cli.js --headings-only",
|
|
18
23
|
"cleanup-only": "node cli.js --cleanup-only",
|
|
24
|
+
"no-backup": "node cli.js --no-backup",
|
|
25
|
+
"cleanup-backups": "find . -name '*.backup' -type f -delete",
|
|
19
26
|
"test": "node test-package.js",
|
|
20
27
|
"demo": "node cli.js --dry-run demo",
|
|
21
28
|
"prepublishOnly": "npm run test"
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="ja">
|
|
3
|
-
<head>
|
|
4
|
-
<title>Test Duplicate Roles</title>
|
|
5
|
-
</head>
|
|
6
|
-
<body>
|
|
7
|
-
<h1>Test Duplicate Role Attributes</h1>
|
|
8
|
-
|
|
9
|
-
<!-- Images with duplicate roles -->
|
|
10
|
-
<img src="logo.png" alt="Logo" role="img" role="img" role="img" role="img">
|
|
11
|
-
<img src="banner.jpg" alt="Banner" role="img" role="img" role="img" role="img" role="img">
|
|
12
|
-
|
|
13
|
-
<!-- Links with duplicate roles -->
|
|
14
|
-
<a href="/home" role="link" role="link" role="link" role="link">Home</a>
|
|
15
|
-
<a href="/about" role="link" role="link" role="link" role="link" role="link">About</a>
|
|
16
|
-
|
|
17
|
-
<!-- Buttons with duplicate roles -->
|
|
18
|
-
<button onclick="submit()" role="button" role="button" role="button" role="button">Submit</button>
|
|
19
|
-
<button type="button" role="button" role="button" role="button">Click Me</button>
|
|
20
|
-
|
|
21
|
-
<!-- Mixed quotes -->
|
|
22
|
-
<div onclick="toggle()" role="button" role='button' role="button" role="button">Toggle</div>
|
|
23
|
-
<span onclick="show()" role='button' role="button" role="button" role="button">Show</span>
|
|
24
|
-
|
|
25
|
-
<!-- Navigation with duplicates -->
|
|
26
|
-
<nav>
|
|
27
|
-
<ul class="nav-menu" role="menubar" role="menubar" role="menubar" role="menubar">
|
|
28
|
-
<li class="nav-item" role="menuitem" role="menuitem" role="menuitem" role="menuitem">
|
|
29
|
-
<a href="/products" role="link" role="link" role="link" role="link">Products</a>
|
|
30
|
-
</li>
|
|
31
|
-
<li class="nav-item" role="menuitem" role="menuitem" role="menuitem" role="menuitem" role="menuitem">
|
|
32
|
-
<a href="/services" role="link" role="link" role="link" role="link" role="link">Services</a>
|
|
33
|
-
</li>
|
|
34
|
-
</ul>
|
|
35
|
-
</nav>
|
|
36
|
-
|
|
37
|
-
<!-- Complex duplicates -->
|
|
38
|
-
<article>
|
|
39
|
-
<h2>Article with Issues</h2>
|
|
40
|
-
<img src="article1.jpg" alt="Article Image" role="img" role="img" role="img" role="img">
|
|
41
|
-
<p>Some content...</p>
|
|
42
|
-
<a href="/read-more" role="link" role="link" role="link" role="link" role="link" role="link">Read More</a>
|
|
43
|
-
</article>
|
|
44
|
-
</body>
|
|
45
|
-
</html>
|
package/demo/picture-test.html
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="ja">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title>Picture Role Test</title>
|
|
7
|
-
</head>
|
|
8
|
-
<body>
|
|
9
|
-
<h1>Picture Role Test Cases</h1>
|
|
10
|
-
|
|
11
|
-
<!-- Test case 1: Picture with role="img" containing img without role -->
|
|
12
|
-
<picture>
|
|
13
|
-
<source srcset="image.webp" type="image/webp">
|
|
14
|
-
<img src="image.jpg" alt="Test image" role="img">
|
|
15
|
-
</picture>
|
|
16
|
-
|
|
17
|
-
<!-- Test case 2: Picture with role="img" containing img with role (should not change) -->
|
|
18
|
-
<picture role="img">
|
|
19
|
-
<source srcset="image2.webp" type="image/webp">
|
|
20
|
-
<img src="image2.jpg" alt="Test image 2" role="img">
|
|
21
|
-
</picture>
|
|
22
|
-
|
|
23
|
-
<!-- Test case 3: Picture without role containing img without role (should add role to img) -->
|
|
24
|
-
<picture>
|
|
25
|
-
<source srcset="image3.webp" type="image/webp">
|
|
26
|
-
<img src="image3.jpg" alt="Test image 3" role="img">
|
|
27
|
-
</picture>
|
|
28
|
-
|
|
29
|
-
<!-- Test case 4: Regular img without role (should add role) -->
|
|
30
|
-
<img src="regular.jpg" alt="Regular image" role="img">
|
|
31
|
-
|
|
32
|
-
<!-- Test case 5: Picture with role="img" but no img inside (should not change) -->
|
|
33
|
-
<picture role="img">
|
|
34
|
-
<source srcset="video.webp" type="image/webp">
|
|
35
|
-
</picture>
|
|
36
|
-
</body>
|
|
37
|
-
</html>
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="ja">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title>Picture Role Test</title>
|
|
7
|
-
</head>
|
|
8
|
-
<body>
|
|
9
|
-
<h1>Picture Role Test Cases</h1>
|
|
10
|
-
|
|
11
|
-
<!-- Test case 1: Picture with role="img" containing img without role -->
|
|
12
|
-
<picture role="img">
|
|
13
|
-
<source srcset="image.webp" type="image/webp">
|
|
14
|
-
<img src="image.jpg" alt="Test image">
|
|
15
|
-
</picture>
|
|
16
|
-
|
|
17
|
-
<!-- Test case 2: Picture with role="img" containing img with role (should not change) -->
|
|
18
|
-
<picture role="img">
|
|
19
|
-
<source srcset="image2.webp" type="image/webp">
|
|
20
|
-
<img src="image2.jpg" alt="Test image 2" role="img">
|
|
21
|
-
</picture>
|
|
22
|
-
|
|
23
|
-
<!-- Test case 3: Picture without role containing img without role (should add role to img) -->
|
|
24
|
-
<picture>
|
|
25
|
-
<source srcset="image3.webp" type="image/webp">
|
|
26
|
-
<img src="image3.jpg" alt="Test image 3">
|
|
27
|
-
</picture>
|
|
28
|
-
|
|
29
|
-
<!-- Test case 4: Regular img without role (should add role) -->
|
|
30
|
-
<img src="regular.jpg" alt="Regular image">
|
|
31
|
-
|
|
32
|
-
<!-- Test case 5: Picture with role="img" but no img inside (should not change) -->
|
|
33
|
-
<picture role="img">
|
|
34
|
-
<source srcset="video.webp" type="image/webp">
|
|
35
|
-
</picture>
|
|
36
|
-
</body>
|
|
37
|
-
</html>
|
package/demo/sample.html.backup
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="ja">
|
|
3
|
-
<head>
|
|
4
|
-
<title>Demo HTML for Accessibility Testing</title>
|
|
5
|
-
</head>
|
|
6
|
-
<body>
|
|
7
|
-
<h1>Sample Website</h1>
|
|
8
|
-
|
|
9
|
-
<!-- Images without alt or role -->
|
|
10
|
-
<img src="logo.png" alt="Sample Website" role="img" role="img" role="img">
|
|
11
|
-
<img src="banner.jpg" alt="Sample Website" role="img" role="img" role="img">
|
|
12
|
-
<img src="icon.svg" alt="Home Icon" role="img" role="img" role="img">
|
|
13
|
-
|
|
14
|
-
<!-- Links without role -->
|
|
15
|
-
<a href="/home" role="link" role="link" role="link">Home</a>
|
|
16
|
-
<a href="/about" role="link" role="link" role="link">About Us</a>
|
|
17
|
-
|
|
18
|
-
<!-- Buttons without role -->
|
|
19
|
-
<button onclick="submit()" role="button" role="button" role="button">Submit Form</button>
|
|
20
|
-
<button type="button">Regular Button</button>
|
|
21
|
-
|
|
22
|
-
<!-- Clickable elements -->
|
|
23
|
-
<div onclick="navigate()" class="btn" role="button" role="button" role="button" role="button" role="button" role="button">Click Me</div>
|
|
24
|
-
<span onclick="toggle()" role="button" role="button" role="button">Toggle</span>
|
|
25
|
-
|
|
26
|
-
<!-- Navigation -->
|
|
27
|
-
<nav>
|
|
28
|
-
<ul class="nav-menu" role="menubar" role="menubar" role="menubar">
|
|
29
|
-
<li class="nav-item"><a href="/products" role="link" role="link" role="link">Products</a></li>
|
|
30
|
-
<li class="nav-item"><a href="/services" role="link" role="link" role="link">Services</a></li>
|
|
31
|
-
</ul>
|
|
32
|
-
</nav>
|
|
33
|
-
|
|
34
|
-
<!-- More content -->
|
|
35
|
-
<main>
|
|
36
|
-
<article>
|
|
37
|
-
<h2>Article Title</h2>
|
|
38
|
-
<p>Some content here...</p>
|
|
39
|
-
<img src="article-image.jpg" alt="Article Title" role="img" role="img" role="img">
|
|
40
|
-
</article>
|
|
41
|
-
</main>
|
|
42
|
-
|
|
43
|
-
<footer>
|
|
44
|
-
<p>© 2024 Demo Company</p>
|
|
45
|
-
</footer>
|
|
46
|
-
</body>
|
|
47
|
-
</html>
|