@uuv/a11y 1.0.0-beta.1 → 1.0.0-beta.10
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 +72 -0
- package/CONTRIBUTING.md +46 -0
- package/LICENSE +1 -1
- package/README.md +49 -69
- package/STRUCTURE.md +10 -0
- package/bundle/uuv-a11y.bundle.js +2 -2
- package/bundle/uuv-a11y.bundle.js.LICENSE.txt +1 -19
- package/dist/CHANGELOG.md +116 -0
- package/dist/CONTRIBUTING.md +46 -0
- package/dist/README.md +49 -69
- package/dist/STRUCTURE.md +10 -0
- package/dist/lib/engine/engine.js +28 -16
- package/dist/lib/model/index.d.ts +1 -1
- package/dist/lib/model/index.js +1 -1
- package/dist/lib/model/result.d.ts +2 -1
- package/dist/lib/model/rule.d.ts +0 -7
- package/dist/lib/model/rule.js +0 -2
- package/dist/lib/query/00-query.d.ts +6 -1
- package/dist/lib/query/00-query.js +10 -0
- package/dist/lib/query/accessible-name.query.d.ts +2 -2
- package/dist/lib/query/accessible-name.query.js +4 -7
- package/dist/lib/query/by-role.query.d.ts +4 -3
- package/dist/lib/query/by-role.query.js +22 -6
- package/dist/lib/query/by-sibling.query.d.ts +12 -0
- package/dist/lib/query/by-sibling.query.js +100 -0
- package/dist/lib/query/by-tag.query.d.ts +2 -2
- package/dist/lib/query/by-tag.query.js +4 -5
- package/dist/lib/query/compliant-attributes/attribut-specification.d.ts +25 -0
- package/dist/lib/query/compliant-attributes/attribut-specification.js +71 -0
- package/dist/lib/query/compliant-attributes/attribute-checker.d.ts +35 -0
- package/dist/lib/query/compliant-attributes/attribute-checker.js +55 -0
- package/dist/lib/query/compliant-attributes/compliant-attributes.query.d.ts +9 -0
- package/dist/lib/query/compliant-attributes/compliant-attributes.query.js +24 -0
- package/dist/lib/query/doctype.query.d.ts +2 -2
- package/dist/lib/query/doctype.query.js +2 -1
- package/dist/lib/query/form.query.d.ts +2 -2
- package/dist/lib/query/index.d.ts +7 -0
- package/dist/lib/query/index.js +7 -0
- package/dist/lib/query/operators/and-query.d.ts +8 -0
- package/dist/lib/query/operators/and-query.js +25 -0
- package/dist/lib/query/operators/operator-query.d.ts +8 -0
- package/dist/lib/query/operators/operator-query.js +14 -0
- package/dist/lib/query/operators/or-query.d.ts +8 -0
- package/dist/lib/query/operators/or-query.js +24 -0
- package/dist/lib/reference/rgaa/coverage/coverage-helper.js +1 -1
- package/dist/lib/reference/rgaa/coverage/coverage-statement.json +36 -16
- package/dist/lib/reference/rgaa/rules/1-image.d.ts +0 -1
- package/dist/lib/reference/rgaa/rules/1-image.js +51 -77
- package/dist/lib/reference/rgaa/rules/11-form.d.ts +0 -1
- package/dist/lib/reference/rgaa/rules/11-form.js +0 -1
- package/dist/lib/reference/rgaa/rules/2-frame.d.ts +0 -1
- package/dist/lib/reference/rgaa/rules/2-frame.js +8 -7
- package/dist/lib/reference/rgaa/rules/3-color.d.ts +0 -1
- package/dist/lib/reference/rgaa/rules/3-color.js +0 -3
- package/dist/lib/reference/rgaa/rules/5-table.d.ts +12 -1
- package/dist/lib/reference/rgaa/rules/5-table.js +292 -1
- package/dist/lib/reference/rgaa/rules/8-required-element.d.ts +0 -1
- package/dist/lib/reference/rgaa/rules/8-required-element.js +0 -6
- package/dist/lib/reference/rgaa/selector-helper.d.ts +40 -1
- package/dist/lib/reference/rgaa/selector-helper.js +82 -10
- package/dist/package.json +14 -3
- package/package.json +14 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,75 @@
|
|
|
1
|
+
## [1.0.0-beta.10](https://github.com/Orange-OpenSource/uuv/compare/a11y-v1.0.0-beta.9...a11y-v1.0.0-beta.10) (2024-02-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **runner-playwright:** update dependency axe-core to v4.8.4 ([1db34e2](https://github.com/Orange-OpenSource/uuv/commit/1db34e26b498bfc83d47cfd98064faa1aa65f558))
|
|
7
|
+
|
|
8
|
+
## [1.0.0-beta.9](https://github.com/Orange-OpenSource/uuv/compare/a11y-v1.0.0-beta.8...a11y-v1.0.0-beta.9) (2024-02-13)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* update dependency multiple-cucumber-html-reporter to v3.6.2 ([95d85c3](https://github.com/Orange-OpenSource/uuv/commit/95d85c3f29ff261232f75c83175d795b63766a89))
|
|
14
|
+
|
|
15
|
+
## [1.0.0-beta.8](https://github.com/Orange-OpenSource/uuv/compare/a11y-v1.0.0-beta.7...a11y-v1.0.0-beta.8) (2024-02-13)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **a11y:** add rgaa criteria 5.1 to 5.5, [#451](https://github.com/Orange-OpenSource/uuv/issues/451) ([fa3b369](https://github.com/Orange-OpenSource/uuv/commit/fa3b3693e102b54e1d72321aba573e66c864f4e3))
|
|
21
|
+
* **a11y:** add rgaa criteria 5.6 to 5.8, [#451](https://github.com/Orange-OpenSource/uuv/issues/451) ([9cdf4ad](https://github.com/Orange-OpenSource/uuv/commit/9cdf4ad0e5ba16d7b8ddb90e014d96fc741acc17))
|
|
22
|
+
|
|
23
|
+
## [1.0.0-beta.7](https://github.com/Orange-OpenSource/uuv/compare/a11y-v1.0.0-beta.6...a11y-v1.0.0-beta.7) (2024-01-24)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Features
|
|
27
|
+
|
|
28
|
+
* **a11y:** add rgaa topic 2, [#432](https://github.com/Orange-OpenSource/uuv/issues/432) ([#450](https://github.com/Orange-OpenSource/uuv/issues/450)) ([231d95b](https://github.com/Orange-OpenSource/uuv/commit/231d95b48ecfbeb0c86f44d0de0ca8c68df7b9f1))
|
|
29
|
+
|
|
30
|
+
## [1.0.0-beta.6](https://github.com/Orange-OpenSource/uuv/compare/a11y-v1.0.0-beta.5...a11y-v1.0.0-beta.6) (2024-01-23)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Features
|
|
34
|
+
|
|
35
|
+
* **a11y:** add RGAA 1.1.6 and 1.1.3, [#429](https://github.com/Orange-OpenSource/uuv/issues/429) ([0e65889](https://github.com/Orange-OpenSource/uuv/commit/0e65889b479651c27e16c29fdb8e5123fe689f03))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Bug Fixes
|
|
39
|
+
|
|
40
|
+
* **runner-playwright:** update dependency axe-core to v4.8.3 ([4623485](https://github.com/Orange-OpenSource/uuv/commit/46234851677cf0e5f0479fe30bc786ae2a607f1e))
|
|
41
|
+
|
|
42
|
+
## [1.0.0-beta.5](https://github.com/Orange-OpenSource/uuv/compare/a11y-v1.0.0-beta.4...a11y-v1.0.0-beta.5) (2024-01-21)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Bug Fixes
|
|
46
|
+
|
|
47
|
+
* **a11y:** update dependency @testing-library/dom to v9.3.4 ([368b6b4](https://github.com/Orange-OpenSource/uuv/commit/368b6b4210f83d2da7695a0bfedd8ac593df171a))
|
|
48
|
+
* **assistant:** fix assistant and enable uuv test for assistant, [#437](https://github.com/Orange-OpenSource/uuv/issues/437) ([da82e1b](https://github.com/Orange-OpenSource/uuv/commit/da82e1b588a391eb24573ac8c3f2db18cfdbf5a5))
|
|
49
|
+
* **deps:** update dependency @easyops-cn/docusaurus-search-local to v0.40.1 ([d5ed3d7](https://github.com/Orange-OpenSource/uuv/commit/d5ed3d75f44e2b83af81fcd7227521dea00371e6))
|
|
50
|
+
|
|
51
|
+
## [1.0.0-beta.4](https://github.com/Orange-OpenSource/uuv/compare/a11y-v1.0.0-beta.3...a11y-v1.0.0-beta.4) (2024-01-11)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
### Features
|
|
55
|
+
|
|
56
|
+
* **a11y:** add a contains sentence for a11y rgaa, [#424](https://github.com/Orange-OpenSource/uuv/issues/424) ([297cc33](https://github.com/Orange-OpenSource/uuv/commit/297cc3378798d1eb9c973a2038423ae6f874f70f))
|
|
57
|
+
|
|
58
|
+
## [1.0.0-beta.3](https://github.com/Orange-OpenSource/uuv/compare/a11y-v1.0.0-beta.2...a11y-v1.0.0-beta.3) (2024-01-08)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
### Features
|
|
62
|
+
|
|
63
|
+
* **a11y:** reduce @uuv/a11y bundle size, [#330](https://github.com/Orange-OpenSource/uuv/issues/330) ([139b85a](https://github.com/Orange-OpenSource/uuv/commit/139b85a56e2ce4b8f370df4f6d410a9a1807e3b6))
|
|
64
|
+
|
|
65
|
+
## [1.0.0-beta.2](https://github.com/Orange-OpenSource/uuv/compare/a11y-v1.0.0-beta.1...a11y-v1.0.0-beta.2) (2024-01-08)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
### Bug Fixes
|
|
69
|
+
|
|
70
|
+
* **a11y:** fix post first publish, [#330](https://github.com/Orange-OpenSource/uuv/issues/330) ([76cf65b](https://github.com/Orange-OpenSource/uuv/commit/76cf65ba219f6128c58ecdec608d3cb4fe72bcc9))
|
|
71
|
+
* **a11y:** update unpkg usage and stackblitz link, [#330](https://github.com/Orange-OpenSource/uuv/issues/330) ([6032415](https://github.com/Orange-OpenSource/uuv/commit/6032415fdf16ae1be23e96785e7c66b779d8cbf9))
|
|
72
|
+
|
|
1
73
|
## 1.0.0-beta.1 (2024-01-08)
|
|
2
74
|
|
|
3
75
|
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Contributors guide
|
|
2
|
+
|
|
3
|
+
First, read the general [CONTRIBUTING](../../CONTRIBUTING.md) file
|
|
4
|
+
|
|
5
|
+
## How Contribue to @uuv/a11y ?
|
|
6
|
+
This [page](./STRUCTURE.md) gives you an overview of the @uuv/a11y module structure.
|
|
7
|
+
|
|
8
|
+
### Add new RGAA rules
|
|
9
|
+
1. Identify the file concerned by the new rule you want to add <br>
|
|
10
|
+
For example :
|
|
11
|
+
- a rule on test **1**.1.4 will concern the file `a11y/src/lib/reference/rgaa/rules/1-image.ts`
|
|
12
|
+
- a rule on test **7**.1.1 will concern the file `a11y/src/lib/reference/rgaa/rules/7-script.ts`
|
|
13
|
+
2. Make sure the rule doesn't already exist in the file
|
|
14
|
+
3. Add your rule to the file, a rule can be :
|
|
15
|
+
- `Auto` : it can be checked automatically, then you can follow the example below :
|
|
16
|
+
```typescript
|
|
17
|
+
AutoCheckA11yRule.from({
|
|
18
|
+
reference: "RGAA",
|
|
19
|
+
criterion: "1.1",
|
|
20
|
+
id: "1.1.5",
|
|
21
|
+
elementType: "svg",
|
|
22
|
+
query: new ByTagQuery([
|
|
23
|
+
"svg:not([role=img])"
|
|
24
|
+
]),
|
|
25
|
+
description: "svg has no image role",
|
|
26
|
+
help: "set image role to svg"
|
|
27
|
+
})
|
|
28
|
+
```
|
|
29
|
+
- `Manual` : It must be checked manually by a human, then you can follow the example below :
|
|
30
|
+
```typescript
|
|
31
|
+
ManualCheckA11yRule.from({
|
|
32
|
+
reference: "RGAA",
|
|
33
|
+
criterion: "1.3",
|
|
34
|
+
wcag: "4.1.2 A",
|
|
35
|
+
id: "1.3.1",
|
|
36
|
+
elementType: "image",
|
|
37
|
+
query: new ByTagQuery(informativeContent.image.buildSelectorWithAttributes()),
|
|
38
|
+
attributes: informativeContent.image.ATTRIBUTES,
|
|
39
|
+
description: "if present, attributes alt, title, aria-label, aria-labelledby must be relevant",
|
|
40
|
+
help: "adapt these attributes to be relevant"
|
|
41
|
+
})
|
|
42
|
+
```
|
|
43
|
+
**Adding a new rule may require you to create a new query, in which case remember to write the corresponding automated tests in the `a11y/test/query/**` directory and export it `index.ts` of same directory.**
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
4. Create or enhance the automated topic test file in the directory `a11y/test/checker/**`.
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -68,7 +68,7 @@ The following references are available :
|
|
|
68
68
|
|
|
69
69
|
For each criterion of the RGAA, the following algorithm is executed :
|
|
70
70
|
|
|
71
|
-

|
|
71
|
+

|
|
72
72
|
|
|
73
73
|
**Consult [this page](https://orange-opensource.github.io/uuv/docs/tools/uuv-a11y#rgaa) to find out which RGAA verifications are implemented in the library**
|
|
74
74
|
</p>
|
|
@@ -77,21 +77,21 @@ For each criterion of the RGAA, the following algorithm is executed :
|
|
|
77
77
|
### With UNPKG
|
|
78
78
|
1. Add script tag to import @uuv/a11y in your html page :
|
|
79
79
|
```html
|
|
80
|
-
<script src="https://unpkg.com/@uuv/a11y/
|
|
80
|
+
<script src="https://unpkg.com/@uuv/a11y/bundle/uuv-a11y.bundle.js">
|
|
81
81
|
</script>
|
|
82
82
|
```
|
|
83
83
|
2. Add script tag to execute
|
|
84
84
|
```html
|
|
85
|
-
<script>
|
|
86
|
-
const rgaaChecker = new uuvA11y.RgaaChecker(url
|
|
85
|
+
<script type="module">
|
|
86
|
+
const rgaaChecker = new uuvA11y.RgaaChecker(window.location.url);
|
|
87
87
|
const result = await rgaaChecker.validate().toPromise();
|
|
88
88
|
// Print complete result
|
|
89
|
-
console.log(result);
|
|
89
|
+
console.log('result', result);
|
|
90
90
|
// Print result summary group by criteria
|
|
91
|
-
console.log(result.summary());
|
|
91
|
+
console.log('summary', result.summary());
|
|
92
92
|
</script>
|
|
93
93
|
```
|
|
94
|
-
[Stackblitz example](https://stackblitz.com/edit/web-platform-fihgra?file=index.html)
|
|
94
|
+
[Stackblitz example](https://stackblitz.com/edit/web-platform-fihgra?devToolsHeight=33&file=index.html)
|
|
95
95
|
|
|
96
96
|
### As a dependency
|
|
97
97
|
1. Import @uuv/a11y npm dependency
|
|
@@ -113,77 +113,57 @@ For each criterion of the RGAA, the following algorithm is executed :
|
|
|
113
113
|
// Print result summary group by criteria
|
|
114
114
|
console.log(result.summary());
|
|
115
115
|
```
|
|
116
|
-
### During E2E Testing (recommended usage
|
|
116
|
+
### During E2E Testing (recommended usage because it allows DOM nodes to be visualized)
|
|
117
117
|
1. add `@uuv/cypress` npm dependency :
|
|
118
118
|
```shell
|
|
119
119
|
npm install --save-dev @uuv/cypress
|
|
120
120
|
```
|
|
121
|
-
2. create the file `uuv/e2e/a11y.feature` in the project root with the following content and replace url `https://e2e-test-quest.github.io/simple-webapp/a11y-test.html` by yours :
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
"8.3": {
|
|
161
|
-
"status": "success"
|
|
162
|
-
},
|
|
163
|
-
"8.4": {
|
|
164
|
-
"status": "manual"
|
|
165
|
-
},
|
|
166
|
-
"8.5": {
|
|
167
|
-
"status": "error"
|
|
168
|
-
},
|
|
169
|
-
"8.6": {
|
|
170
|
-
"status": "manual"
|
|
171
|
-
},
|
|
172
|
-
"8.10": {
|
|
173
|
-
"status": "error"
|
|
174
|
-
},
|
|
175
|
-
"11.1": {
|
|
176
|
-
"status": "success"
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
"""
|
|
181
|
-
```
|
|
121
|
+
2. create the file `uuv/e2e/a11y.feature` in the project root with the following content and replace url `https://e2e-test-quest.github.io/simple-webapp/a11y-test.html` by yours :
|
|
122
|
+
```gherkin
|
|
123
|
+
Feature: A11y validation
|
|
124
|
+
|
|
125
|
+
Scenario: Default RGAA
|
|
126
|
+
When I visit path "https://e2e-test-quest.github.io/simple-webapp/a11y-test.html"
|
|
127
|
+
Then I should not have any rgaa accessibility issue
|
|
128
|
+
|
|
129
|
+
Scenario: RGAA with partial result
|
|
130
|
+
When I visit path "https://e2e-test-quest.github.io/simple-webapp/a11y-test.html"
|
|
131
|
+
Then I should have the following partial result based on the rgaa reference
|
|
132
|
+
"""json
|
|
133
|
+
{
|
|
134
|
+
"status": "error",
|
|
135
|
+
"criteria": {
|
|
136
|
+
"1.5": {
|
|
137
|
+
"status": "manual"
|
|
138
|
+
},
|
|
139
|
+
"1.6": {
|
|
140
|
+
"status": "manual",
|
|
141
|
+
"tests": {
|
|
142
|
+
"1.6.5": {
|
|
143
|
+
"status": "success"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"11.1": {
|
|
148
|
+
"status": "success",
|
|
149
|
+
"tests": {
|
|
150
|
+
"11.1.1": {
|
|
151
|
+
"status": "success"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
"""
|
|
158
|
+
```
|
|
159
|
+
You can also see the [French example](https://github.com/Orange-OpenSource/uuv/blob/main/example/fr-rgaa.feature) or the complete [English example](https://github.com/Orange-OpenSource/uuv/blob/main/example/en-rgaa.feature).
|
|
182
160
|
3. Then execute your tests :
|
|
183
161
|
```shell
|
|
184
162
|
npx uuv e2e
|
|
185
163
|
```
|
|
186
164
|
|
|
165
|
+
## Want to contribute ?
|
|
166
|
+
Your help is welcome, see the [Contributors guide](https://github.com/Orange-OpenSource/uuv/blob/main/packages/a11y/CONTRIBUTING.md).
|
|
187
167
|
|
|
188
168
|
## License
|
|
189
169
|
|
package/STRUCTURE.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Structure of the source
|
|
2
|
+
|
|
3
|
+
The a11y sources are mainly located in the `packages/a11y/src/lib` directory :
|
|
4
|
+
|
|
5
|
+
| Directory | Description |
|
|
6
|
+
|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
7
|
+
| `engine` | Represents execution engine |
|
|
8
|
+
| `model` | Contains classes and interfaces to describe rules and results |
|
|
9
|
+
| `query` | A query is a component used to retrieve dom elements according to certain criteria.<br> Exemple : <br> - `by-role.query` : retrieve dom nodes based on their accessible role<br> - `by-tag.query` : retrieve dom nodes based on their html tag name |
|
|
10
|
+
| `reference` | Contains declarations of accessibility standards supported by the `@uuv/a11y` solution, in particular RGAA |
|