@histoire/plugin-a11y 0.0.0-stage → 1.0.0-beta.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/LICENSE +21 -0
- package/NOTICE +433 -0
- package/README.md +97 -2
- package/dist/build/scan.d.ts +11 -0
- package/dist/build/scan.js +85 -0
- package/dist/chunks/_histoire-a11y-axe-BL07tEuN.js +53627 -0
- package/dist/chunks/messages-KjPUArEa.js +12 -0
- package/dist/chunks/results-C0vYpcmy.js +41 -0
- package/dist/chunks/run-lct8FHuk.js +134 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.js +1368 -0
- package/dist/frame/highlight.d.ts +6 -0
- package/dist/frame.d.ts +2 -0
- package/dist/frame.js +211 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +44 -0
- package/dist/messages.d.ts +43 -0
- package/dist/messages.js +11 -0
- package/dist/options.d.ts +41 -0
- package/dist/options.js +22 -0
- package/dist/results.d.ts +6 -0
- package/dist/results.js +6 -0
- package/dist/scanner/policy.d.ts +11 -0
- package/dist/scanner/run.d.ts +24 -0
- package/dist/test.d.ts +13 -0
- package/dist/test.js +25 -0
- package/dist/workbench/AuditPanel.vue.d.ts +11 -0
- package/dist/workbench/FindingRow.vue.d.ts +15 -0
- package/dist/workbench/ProjectPanel.vue.d.ts +16 -0
- package/dist/workbench/VariantGroup.vue.d.ts +17 -0
- package/dist/workbench/filters.d.ts +26 -0
- package/dist/workbench/fix-summary.d.ts +33 -0
- package/dist/workbench/locate.d.ts +26 -0
- package/dist/workbench/model.d.ts +42 -0
- package/dist/workbench/project-model.d.ts +66 -0
- package/dist/workbench/project-source.d.ts +51 -0
- package/dist/workbench/sources.d.ts +40 -0
- package/dist/workbench/sources.js +62 -0
- package/package.json +170 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Guillaume Chau
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
This package bundles axe-core 4.14.0 by Deque Systems, Inc.
|
|
2
|
+
Source: https://github.com/dequelabs/axe-core/tree/v4.14.0
|
|
3
|
+
|
|
4
|
+
Mozilla Public License, version 2.0
|
|
5
|
+
|
|
6
|
+
1. Definitions
|
|
7
|
+
|
|
8
|
+
1.1. "Contributor"
|
|
9
|
+
|
|
10
|
+
means each individual or legal entity that creates, contributes to the
|
|
11
|
+
creation of, or owns Covered Software.
|
|
12
|
+
|
|
13
|
+
1.2. "Contributor Version"
|
|
14
|
+
|
|
15
|
+
means the combination of the Contributions of others (if any) used by a
|
|
16
|
+
Contributor and that particular Contributor's Contribution.
|
|
17
|
+
|
|
18
|
+
1.3. "Contribution"
|
|
19
|
+
|
|
20
|
+
means Covered Software of a particular Contributor.
|
|
21
|
+
|
|
22
|
+
1.4. "Covered Software"
|
|
23
|
+
|
|
24
|
+
means Source Code Form to which the initial Contributor has attached the
|
|
25
|
+
notice in Exhibit A, the Executable Form of such Source Code Form, and
|
|
26
|
+
Modifications of such Source Code Form, in each case including portions
|
|
27
|
+
thereof.
|
|
28
|
+
|
|
29
|
+
1.5. "Incompatible With Secondary Licenses"
|
|
30
|
+
means
|
|
31
|
+
|
|
32
|
+
a. that the initial Contributor has attached the notice described in
|
|
33
|
+
Exhibit B to the Covered Software; or
|
|
34
|
+
|
|
35
|
+
b. that the Covered Software was made available under the terms of
|
|
36
|
+
version 1.1 or earlier of the License, but not also under the terms of
|
|
37
|
+
a Secondary License.
|
|
38
|
+
|
|
39
|
+
1.6. "Executable Form"
|
|
40
|
+
|
|
41
|
+
means any form of the work other than Source Code Form.
|
|
42
|
+
|
|
43
|
+
1.7. "Larger Work"
|
|
44
|
+
|
|
45
|
+
means a work that combines Covered Software with other material, in a
|
|
46
|
+
separate file or files, that is not Covered Software.
|
|
47
|
+
|
|
48
|
+
1.8. "License"
|
|
49
|
+
|
|
50
|
+
means this document.
|
|
51
|
+
|
|
52
|
+
1.9. "Licensable"
|
|
53
|
+
|
|
54
|
+
means having the right to grant, to the maximum extent possible, whether
|
|
55
|
+
at the time of the initial grant or subsequently, any and all of the
|
|
56
|
+
rights conveyed by this License.
|
|
57
|
+
|
|
58
|
+
1.10. "Modifications"
|
|
59
|
+
|
|
60
|
+
means any of the following:
|
|
61
|
+
|
|
62
|
+
a. any file in Source Code Form that results from an addition to,
|
|
63
|
+
deletion from, or modification of the contents of Covered Software; or
|
|
64
|
+
|
|
65
|
+
b. any new file in Source Code Form that contains any Covered Software.
|
|
66
|
+
|
|
67
|
+
1.11. "Patent Claims" of a Contributor
|
|
68
|
+
|
|
69
|
+
means any patent claim(s), including without limitation, method,
|
|
70
|
+
process, and apparatus claims, in any patent Licensable by such
|
|
71
|
+
Contributor that would be infringed, but for the grant of the License,
|
|
72
|
+
by the making, using, selling, offering for sale, having made, import,
|
|
73
|
+
or transfer of either its Contributions or its Contributor Version.
|
|
74
|
+
|
|
75
|
+
1.12. "Secondary License"
|
|
76
|
+
|
|
77
|
+
means either the GNU General Public License, Version 2.0, the GNU Lesser
|
|
78
|
+
General Public License, Version 2.1, the GNU Affero General Public
|
|
79
|
+
License, Version 3.0, or any later versions of those licenses.
|
|
80
|
+
|
|
81
|
+
1.13. "Source Code Form"
|
|
82
|
+
|
|
83
|
+
means the form of the work preferred for making modifications.
|
|
84
|
+
|
|
85
|
+
1.14. "You" (or "Your")
|
|
86
|
+
|
|
87
|
+
means an individual or a legal entity exercising rights under this
|
|
88
|
+
License. For legal entities, "You" includes any entity that controls, is
|
|
89
|
+
controlled by, or is under common control with You. For purposes of this
|
|
90
|
+
definition, "control" means (a) the power, direct or indirect, to cause
|
|
91
|
+
the direction or management of such entity, whether by contract or
|
|
92
|
+
otherwise, or (b) ownership of more than fifty percent (50%) of the
|
|
93
|
+
outstanding shares or beneficial ownership of such entity.
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
2. License Grants and Conditions
|
|
97
|
+
|
|
98
|
+
2.1. Grants
|
|
99
|
+
|
|
100
|
+
Each Contributor hereby grants You a world-wide, royalty-free,
|
|
101
|
+
non-exclusive license:
|
|
102
|
+
|
|
103
|
+
a. under intellectual property rights (other than patent or trademark)
|
|
104
|
+
Licensable by such Contributor to use, reproduce, make available,
|
|
105
|
+
modify, display, perform, distribute, and otherwise exploit its
|
|
106
|
+
Contributions, either on an unmodified basis, with Modifications, or
|
|
107
|
+
as part of a Larger Work; and
|
|
108
|
+
|
|
109
|
+
b. under Patent Claims of such Contributor to make, use, sell, offer for
|
|
110
|
+
sale, have made, import, and otherwise transfer either its
|
|
111
|
+
Contributions or its Contributor Version.
|
|
112
|
+
|
|
113
|
+
2.2. Effective Date
|
|
114
|
+
|
|
115
|
+
The licenses granted in Section 2.1 with respect to any Contribution
|
|
116
|
+
become effective for each Contribution on the date the Contributor first
|
|
117
|
+
distributes such Contribution.
|
|
118
|
+
|
|
119
|
+
2.3. Limitations on Grant Scope
|
|
120
|
+
|
|
121
|
+
The licenses granted in this Section 2 are the only rights granted under
|
|
122
|
+
this License. No additional rights or licenses will be implied from the
|
|
123
|
+
distribution or licensing of Covered Software under this License.
|
|
124
|
+
Notwithstanding Section 2.1(b) above, no patent license is granted by a
|
|
125
|
+
Contributor:
|
|
126
|
+
|
|
127
|
+
a. for any code that a Contributor has removed from Covered Software; or
|
|
128
|
+
|
|
129
|
+
b. for infringements caused by: (i) Your and any other third party's
|
|
130
|
+
modifications of Covered Software, or (ii) the combination of its
|
|
131
|
+
Contributions with other software (except as part of its Contributor
|
|
132
|
+
Version); or
|
|
133
|
+
|
|
134
|
+
c. under Patent Claims infringed by Covered Software in the absence of
|
|
135
|
+
its Contributions.
|
|
136
|
+
|
|
137
|
+
This License does not grant any rights in the trademarks, service marks,
|
|
138
|
+
or logos of any Contributor (except as may be necessary to comply with
|
|
139
|
+
the notice requirements in Section 3.4).
|
|
140
|
+
|
|
141
|
+
2.4. Subsequent Licenses
|
|
142
|
+
|
|
143
|
+
No Contributor makes additional grants as a result of Your choice to
|
|
144
|
+
distribute the Covered Software under a subsequent version of this
|
|
145
|
+
License (see Section 10.2) or under the terms of a Secondary License (if
|
|
146
|
+
permitted under the terms of Section 3.3).
|
|
147
|
+
|
|
148
|
+
2.5. Representation
|
|
149
|
+
|
|
150
|
+
Each Contributor represents that the Contributor believes its
|
|
151
|
+
Contributions are its original creation(s) or it has sufficient rights to
|
|
152
|
+
grant the rights to its Contributions conveyed by this License.
|
|
153
|
+
|
|
154
|
+
2.6. Fair Use
|
|
155
|
+
|
|
156
|
+
This License is not intended to limit any rights You have under
|
|
157
|
+
applicable copyright doctrines of fair use, fair dealing, or other
|
|
158
|
+
equivalents.
|
|
159
|
+
|
|
160
|
+
2.7. Conditions
|
|
161
|
+
|
|
162
|
+
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
|
|
163
|
+
Section 2.1.
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
3. Responsibilities
|
|
167
|
+
|
|
168
|
+
3.1. Distribution of Source Form
|
|
169
|
+
|
|
170
|
+
All distribution of Covered Software in Source Code Form, including any
|
|
171
|
+
Modifications that You create or to which You contribute, must be under
|
|
172
|
+
the terms of this License. You must inform recipients that the Source
|
|
173
|
+
Code Form of the Covered Software is governed by the terms of this
|
|
174
|
+
License, and how they can obtain a copy of this License. You may not
|
|
175
|
+
attempt to alter or restrict the recipients' rights in the Source Code
|
|
176
|
+
Form.
|
|
177
|
+
|
|
178
|
+
3.2. Distribution of Executable Form
|
|
179
|
+
|
|
180
|
+
If You distribute Covered Software in Executable Form then:
|
|
181
|
+
|
|
182
|
+
a. such Covered Software must also be made available in Source Code Form,
|
|
183
|
+
as described in Section 3.1, and You must inform recipients of the
|
|
184
|
+
Executable Form how they can obtain a copy of such Source Code Form by
|
|
185
|
+
reasonable means in a timely manner, at a charge no more than the cost
|
|
186
|
+
of distribution to the recipient; and
|
|
187
|
+
|
|
188
|
+
b. You may distribute such Executable Form under the terms of this
|
|
189
|
+
License, or sublicense it under different terms, provided that the
|
|
190
|
+
license for the Executable Form does not attempt to limit or alter the
|
|
191
|
+
recipients' rights in the Source Code Form under this License.
|
|
192
|
+
|
|
193
|
+
3.3. Distribution of a Larger Work
|
|
194
|
+
|
|
195
|
+
You may create and distribute a Larger Work under terms of Your choice,
|
|
196
|
+
provided that You also comply with the requirements of this License for
|
|
197
|
+
the Covered Software. If the Larger Work is a combination of Covered
|
|
198
|
+
Software with a work governed by one or more Secondary Licenses, and the
|
|
199
|
+
Covered Software is not Incompatible With Secondary Licenses, this
|
|
200
|
+
License permits You to additionally distribute such Covered Software
|
|
201
|
+
under the terms of such Secondary License(s), so that the recipient of
|
|
202
|
+
the Larger Work may, at their option, further distribute the Covered
|
|
203
|
+
Software under the terms of either this License or such Secondary
|
|
204
|
+
License(s).
|
|
205
|
+
|
|
206
|
+
3.4. Notices
|
|
207
|
+
|
|
208
|
+
You may not remove or alter the substance of any license notices
|
|
209
|
+
(including copyright notices, patent notices, disclaimers of warranty, or
|
|
210
|
+
limitations of liability) contained within the Source Code Form of the
|
|
211
|
+
Covered Software, except that You may alter any license notices to the
|
|
212
|
+
extent required to remedy known factual inaccuracies.
|
|
213
|
+
|
|
214
|
+
3.5. Application of Additional Terms
|
|
215
|
+
|
|
216
|
+
You may choose to offer, and to charge a fee for, warranty, support,
|
|
217
|
+
indemnity or liability obligations to one or more recipients of Covered
|
|
218
|
+
Software. However, You may do so only on Your own behalf, and not on
|
|
219
|
+
behalf of any Contributor. You must make it absolutely clear that any
|
|
220
|
+
such warranty, support, indemnity, or liability obligation is offered by
|
|
221
|
+
You alone, and You hereby agree to indemnify every Contributor for any
|
|
222
|
+
liability incurred by such Contributor as a result of warranty, support,
|
|
223
|
+
indemnity or liability terms You offer. You may include additional
|
|
224
|
+
disclaimers of warranty and limitations of liability specific to any
|
|
225
|
+
jurisdiction.
|
|
226
|
+
|
|
227
|
+
4. Inability to Comply Due to Statute or Regulation
|
|
228
|
+
|
|
229
|
+
If it is impossible for You to comply with any of the terms of this License
|
|
230
|
+
with respect to some or all of the Covered Software due to statute,
|
|
231
|
+
judicial order, or regulation then You must: (a) comply with the terms of
|
|
232
|
+
this License to the maximum extent possible; and (b) describe the
|
|
233
|
+
limitations and the code they affect. Such description must be placed in a
|
|
234
|
+
text file included with all distributions of the Covered Software under
|
|
235
|
+
this License. Except to the extent prohibited by statute or regulation,
|
|
236
|
+
such description must be sufficiently detailed for a recipient of ordinary
|
|
237
|
+
skill to be able to understand it.
|
|
238
|
+
|
|
239
|
+
5. Termination
|
|
240
|
+
|
|
241
|
+
5.1. The rights granted under this License will terminate automatically if You
|
|
242
|
+
fail to comply with any of its terms. However, if You become compliant,
|
|
243
|
+
then the rights granted under this License from a particular Contributor
|
|
244
|
+
are reinstated (a) provisionally, unless and until such Contributor
|
|
245
|
+
explicitly and finally terminates Your grants, and (b) on an ongoing
|
|
246
|
+
basis, if such Contributor fails to notify You of the non-compliance by
|
|
247
|
+
some reasonable means prior to 60 days after You have come back into
|
|
248
|
+
compliance. Moreover, Your grants from a particular Contributor are
|
|
249
|
+
reinstated on an ongoing basis if such Contributor notifies You of the
|
|
250
|
+
non-compliance by some reasonable means, this is the first time You have
|
|
251
|
+
received notice of non-compliance with this License from such
|
|
252
|
+
Contributor, and You become compliant prior to 30 days after Your receipt
|
|
253
|
+
of the notice.
|
|
254
|
+
|
|
255
|
+
5.2. If You initiate litigation against any entity by asserting a patent
|
|
256
|
+
infringement claim (excluding declaratory judgment actions,
|
|
257
|
+
counter-claims, and cross-claims) alleging that a Contributor Version
|
|
258
|
+
directly or indirectly infringes any patent, then the rights granted to
|
|
259
|
+
You by any and all Contributors for the Covered Software under Section
|
|
260
|
+
2.1 of this License shall terminate.
|
|
261
|
+
|
|
262
|
+
5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
|
|
263
|
+
license agreements (excluding distributors and resellers) which have been
|
|
264
|
+
validly granted by You or Your distributors under this License prior to
|
|
265
|
+
termination shall survive termination.
|
|
266
|
+
|
|
267
|
+
6. Disclaimer of Warranty
|
|
268
|
+
|
|
269
|
+
Covered Software is provided under this License on an "as is" basis,
|
|
270
|
+
without warranty of any kind, either expressed, implied, or statutory,
|
|
271
|
+
including, without limitation, warranties that the Covered Software is free
|
|
272
|
+
of defects, merchantable, fit for a particular purpose or non-infringing.
|
|
273
|
+
The entire risk as to the quality and performance of the Covered Software
|
|
274
|
+
is with You. Should any Covered Software prove defective in any respect,
|
|
275
|
+
You (not any Contributor) assume the cost of any necessary servicing,
|
|
276
|
+
repair, or correction. This disclaimer of warranty constitutes an essential
|
|
277
|
+
part of this License. No use of any Covered Software is authorized under
|
|
278
|
+
this License except under this disclaimer.
|
|
279
|
+
|
|
280
|
+
7. Limitation of Liability
|
|
281
|
+
|
|
282
|
+
Under no circumstances and under no legal theory, whether tort (including
|
|
283
|
+
negligence), contract, or otherwise, shall any Contributor, or anyone who
|
|
284
|
+
distributes Covered Software as permitted above, be liable to You for any
|
|
285
|
+
direct, indirect, special, incidental, or consequential damages of any
|
|
286
|
+
character including, without limitation, damages for lost profits, loss of
|
|
287
|
+
goodwill, work stoppage, computer failure or malfunction, or any and all
|
|
288
|
+
other commercial damages or losses, even if such party shall have been
|
|
289
|
+
informed of the possibility of such damages. This limitation of liability
|
|
290
|
+
shall not apply to liability for death or personal injury resulting from
|
|
291
|
+
such party's negligence to the extent applicable law prohibits such
|
|
292
|
+
limitation. Some jurisdictions do not allow the exclusion or limitation of
|
|
293
|
+
incidental or consequential damages, so this exclusion and limitation may
|
|
294
|
+
not apply to You.
|
|
295
|
+
|
|
296
|
+
8. Litigation
|
|
297
|
+
|
|
298
|
+
Any litigation relating to this License may be brought only in the courts
|
|
299
|
+
of a jurisdiction where the defendant maintains its principal place of
|
|
300
|
+
business and such litigation shall be governed by laws of that
|
|
301
|
+
jurisdiction, without reference to its conflict-of-law provisions. Nothing
|
|
302
|
+
in this Section shall prevent a party's ability to bring cross-claims or
|
|
303
|
+
counter-claims.
|
|
304
|
+
|
|
305
|
+
9. Miscellaneous
|
|
306
|
+
|
|
307
|
+
This License represents the complete agreement concerning the subject
|
|
308
|
+
matter hereof. If any provision of this License is held to be
|
|
309
|
+
unenforceable, such provision shall be reformed only to the extent
|
|
310
|
+
necessary to make it enforceable. Any law or regulation which provides that
|
|
311
|
+
the language of a contract shall be construed against the drafter shall not
|
|
312
|
+
be used to construe this License against a Contributor.
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
10. Versions of the License
|
|
316
|
+
|
|
317
|
+
10.1. New Versions
|
|
318
|
+
|
|
319
|
+
Mozilla Foundation is the license steward. Except as provided in Section
|
|
320
|
+
10.3, no one other than the license steward has the right to modify or
|
|
321
|
+
publish new versions of this License. Each version will be given a
|
|
322
|
+
distinguishing version number.
|
|
323
|
+
|
|
324
|
+
10.2. Effect of New Versions
|
|
325
|
+
|
|
326
|
+
You may distribute the Covered Software under the terms of the version
|
|
327
|
+
of the License under which You originally received the Covered Software,
|
|
328
|
+
or under the terms of any subsequent version published by the license
|
|
329
|
+
steward.
|
|
330
|
+
|
|
331
|
+
10.3. Modified Versions
|
|
332
|
+
|
|
333
|
+
If you create software not governed by this License, and you want to
|
|
334
|
+
create a new license for such software, you may create and use a
|
|
335
|
+
modified version of this License if you rename the license and remove
|
|
336
|
+
any references to the name of the license steward (except to note that
|
|
337
|
+
such modified license differs from this License).
|
|
338
|
+
|
|
339
|
+
10.4. Distributing Source Code Form that is Incompatible With Secondary
|
|
340
|
+
Licenses If You choose to distribute Source Code Form that is
|
|
341
|
+
Incompatible With Secondary Licenses under the terms of this version of
|
|
342
|
+
the License, the notice described in Exhibit B of this License must be
|
|
343
|
+
attached.
|
|
344
|
+
|
|
345
|
+
Exhibit A - Source Code Form License Notice
|
|
346
|
+
|
|
347
|
+
This Source Code Form is subject to the
|
|
348
|
+
terms of the Mozilla Public License, v.
|
|
349
|
+
2.0. If a copy of the MPL was not
|
|
350
|
+
distributed with this file, You can
|
|
351
|
+
obtain one at
|
|
352
|
+
http://mozilla.org/MPL/2.0/.
|
|
353
|
+
|
|
354
|
+
If it is not possible or desirable to put the notice in a particular file,
|
|
355
|
+
then You may include the notice in a location (such as a LICENSE file in a
|
|
356
|
+
relevant directory) where a recipient would be likely to look for such a
|
|
357
|
+
notice.
|
|
358
|
+
|
|
359
|
+
You may add additional accurate notices of copyright ownership.
|
|
360
|
+
|
|
361
|
+
Exhibit B - "Incompatible With Secondary Licenses" Notice
|
|
362
|
+
|
|
363
|
+
This Source Code Form is "Incompatible
|
|
364
|
+
With Secondary Licenses", as defined by
|
|
365
|
+
the Mozilla Public License, v. 2.0.
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
-----------------------------------------------------------------------------
|
|
369
|
+
MIT License
|
|
370
|
+
Applies to:
|
|
371
|
+
- colorjs.io; Copyright (c) 2021 Lea Verou, Chris Lilley
|
|
372
|
+
- core-js-pure; Copyright (c) 2014-2023 Denis Pushkarev
|
|
373
|
+
- css-selector-parser; Copyright (c) 2013 Dulin Marat
|
|
374
|
+
- doT.js; Copyright (c) 2011 Laura Doktorova
|
|
375
|
+
Software includes portions from jQote2 Copyright (c) 2010 aefxx,
|
|
376
|
+
http://aefxx.com/ licensed under the MIT license.
|
|
377
|
+
- emoji-regex; Copyright (c) Mathias Bynens <https://mathiasbynens.be/>
|
|
378
|
+
- es6-iterator; Copyright (c) 2013-2017 Mariusz Nowak (www.medikoo.com)
|
|
379
|
+
- es6-promise;
|
|
380
|
+
Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors
|
|
381
|
+
- event-emitter; Copyright (C) 2012-2015 Mariusz Nowak (www.medikoo.com)
|
|
382
|
+
- is-promise; Copyright (c) 2014 Forbes Lindesay
|
|
383
|
+
- lru-queue; Copyright (C) 2014 Mariusz Nowak (www.medikoo.com)
|
|
384
|
+
- typedarray;
|
|
385
|
+
Copyright (c) 2010, Linden Research, Inc.
|
|
386
|
+
Copyright (c) 2012, Joshua Bell
|
|
387
|
+
- weakmap-polyfill; Copyright (c) 2015-2021 polygonplanet
|
|
388
|
+
-----------------------------------------------------------------------------
|
|
389
|
+
|
|
390
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
391
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
392
|
+
in the Software without restriction, including without limitation the rights
|
|
393
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
394
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
395
|
+
furnished to do so, subject to the following conditions:
|
|
396
|
+
|
|
397
|
+
The above copyright notice and this permission notice shall be included in
|
|
398
|
+
all copies or substantial portions of the Software.
|
|
399
|
+
|
|
400
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
401
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
402
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
403
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
404
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
405
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
406
|
+
THE SOFTWARE.
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
-----------------------------------------------------------------------------
|
|
410
|
+
ISC License
|
|
411
|
+
Applies to:
|
|
412
|
+
- d; Copyright (c) 2013-2019, Mariusz Nowak, @medikoo, medikoo.com
|
|
413
|
+
- es5-ext; Copyright (c) 2011-2022, Mariusz Nowak, @medikoo, medikoo.com
|
|
414
|
+
- es6-symbol; Copyright (c) 2013-2019, Mariusz Nowak, @medikoo, medikoo.com
|
|
415
|
+
- es6-weak-map; Copyright (c) 2013-2018, Mariusz Nowak, @medikoo, medikoo.com
|
|
416
|
+
- ext; Copyright (c) 2011-2022, Mariusz Nowak, @medikoo, medikoo.com
|
|
417
|
+
- memoizee; Copyright (c) 2012-2018, Mariusz Nowak, @medikoo, medikoo.com
|
|
418
|
+
- next-tick; Copyright (c) 2012-2020, Mariusz Nowak, @medikoo, medikoo.com
|
|
419
|
+
- timers-ext; Copyright (c) 2013-2018, Mariusz Nowak, @medikoo, medikoo.com
|
|
420
|
+
- type; Copyright (c) 2019, Mariusz Nowak, @medikoo, medikoo.com
|
|
421
|
+
-----------------------------------------------------------------------------
|
|
422
|
+
|
|
423
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
424
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
425
|
+
copyright notice and this permission notice appear in all copies.
|
|
426
|
+
|
|
427
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
428
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
429
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
430
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
431
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
|
432
|
+
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
433
|
+
PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,98 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Accessibility plugin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@histoire/plugin-a11y` adds axe-core audits to Histoire’s **Accessibility** inspector tab. Works with Vue, React, Svelte, and vanilla stories in development and static books. No remote inspection configuration required.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pnpm add -D @histoire/plugin-a11y
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { HstA11y } from '@histoire/plugin-a11y'
|
|
11
|
+
import { HstVue } from '@histoire/plugin-vue'
|
|
12
|
+
import { defineConfig } from 'histoire'
|
|
13
|
+
|
|
14
|
+
export default defineConfig({
|
|
15
|
+
plugins: [HstVue(), HstA11y({ test: true })],
|
|
16
|
+
})
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Inspector
|
|
20
|
+
|
|
21
|
+
Select a variant and open **Accessibility**. Auto-run checks current rendered content and debounces DOM/state changes while tab stays open. Close tab to stop automatic work. Disable **Auto-run** for manual checks with **Run**.
|
|
22
|
+
|
|
23
|
+
Expand a rule to read affected selectors, failure details, and rule guidance. **Highlight** locates affected element without changing focus. Violations and checks needing manual review stay separate. Outcome, severity, and auto-run preferences persist per project; they never change CI policy.
|
|
24
|
+
|
|
25
|
+
Each canvas frame header shows its violation count, colored by the worst impact: from the frame's live check when the inspector ran one, otherwise from the latest project results (see below).
|
|
26
|
+
|
|
27
|
+
Old results remain available during reruns or recoverable failures, marked outdated. Truncated results show omitted-detail count. Automated checks do not establish accessibility compliance; test interaction states and perform manual checks too.
|
|
28
|
+
|
|
29
|
+
## Project pane
|
|
30
|
+
|
|
31
|
+
The **Accessibility** rail pane lists findings across every story and variant, worst impact first. Filters are shared with the inspector tab. **Open variant** selects the variant and opens its inspector tab for live checks. **Highlight** on an element does the same, checks the variant live when its result is missing or outdated, then highlights the matching element; it reports when the element changed since the run.
|
|
32
|
+
|
|
33
|
+
- Development: requires `test: true`. **Run all** runs project tests on the dev server, the same run as the Tests pane **Run all**, and the pane reads the accessibility results of each variant. Results from Tests pane runs show up too.
|
|
34
|
+
- Static books: requires `build: true`. `histoire build` checks every variant in headless Chromium and embeds `a11y-report.json` into the book; the pane shows it read-only with the build time. Needs `playwright` with Chromium installed (`npx playwright install chromium`). A check that fails is reported for its variant without failing the build.
|
|
35
|
+
|
|
36
|
+
## Options
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
HstA11y({
|
|
40
|
+
enabled: true,
|
|
41
|
+
devOnly: false,
|
|
42
|
+
autoRun: true,
|
|
43
|
+
timeoutMs: 10000,
|
|
44
|
+
exclude: ['[data-a11y-ignore]'],
|
|
45
|
+
axe: {
|
|
46
|
+
runOnly: { type: 'tag', values: ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'] },
|
|
47
|
+
rules: { 'color-contrast': { enabled: false } },
|
|
48
|
+
},
|
|
49
|
+
test: { minimumImpact: 'serious' },
|
|
50
|
+
build: true,
|
|
51
|
+
})
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
- `enabled`: defaults to `true`; false disables UI and automatic tests.
|
|
55
|
+
- `devOnly`: defaults to `false`; true omits UI/scanner from static books. Does not disable opted-in tests.
|
|
56
|
+
- `autoRun`: defaults to `true`; initial user preference for live checks while tab open.
|
|
57
|
+
- `timeoutMs`: defaults to `10000`, range `1–30000`; includes waiting for another audit in same document.
|
|
58
|
+
- `exclude`: defaults to `[]`; selectors resolve only within variant root. Excluding root checks no content.
|
|
59
|
+
- `axe`: `runOnly` and `rules` from axe-core `RunOptions`. Omitted uses axe defaults. Selection precedence follows axe; explicitly selected `runOnly` rules take precedence over per-rule disabled overrides.
|
|
60
|
+
- `test`: defaults to `false`. `true` or object registers accessibility test per variant. Optional `minimumImpact` accepts `minor`, `moderate`, `serious`, or `critical`. Unknown impact always fails.
|
|
61
|
+
- `build`: defaults to `false`. `true` checks every variant during `histoire build` and embeds the report for the project pane. Ignored with `devOnly`.
|
|
62
|
+
|
|
63
|
+
Scanner uses bundled axe-core **4.14.0**, loaded lazily and locally. No CDN, network service, or runtime dependency installation. Story-owned `window.axe` stays unchanged. Reports exclude raw HTML and are bounded; unsupported nested selector paths are omitted rather than resolved against wrong elements.
|
|
64
|
+
|
|
65
|
+
## `histoire test`
|
|
66
|
+
|
|
67
|
+
Enable `test: true`, install project’s [Vitest browser prerequisites](https://histoire.dev/guide/testing.html), then run:
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
pnpm histoire test
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Each variant receives independent **Accessibility (axe-core)** test on fresh rendered mount, including variants without authored tests. All violations fail by default; incomplete checks remain informational. Failure includes rule IDs, severities, affected selectors, and guidance links. Severity threshold changes failure policy, not which rules run.
|
|
74
|
+
|
|
75
|
+
Automatic tests also appear in development test UI. Discovery registers definitions without scanning. Existing runner owns filtering, reporting, concurrency, cleanup, and exit status. Installing plugin supplies axe, not Vitest or browser binaries.
|
|
76
|
+
|
|
77
|
+
For interaction states, use explicit assertion inside existing `onTest` registration:
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
import { assertA11y } from '@histoire/plugin-a11y/test'
|
|
81
|
+
import { onTest } from 'histoire/client'
|
|
82
|
+
import { it } from 'vitest'
|
|
83
|
+
|
|
84
|
+
onTest(({ canvas }) => {
|
|
85
|
+
it('keeps open menu accessible', async () => {
|
|
86
|
+
canvas.querySelector<HTMLButtonElement>('button')!.click()
|
|
87
|
+
await assertA11y(canvas)
|
|
88
|
+
})
|
|
89
|
+
})
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Wait for interaction’s rendered state before asserting. `assertA11y(canvas, options?, context?)` accepts `axe`, `exclude`, `timeoutMs`, and `minimumImpact`; it does not read workbench preferences. Complete axe output determines failure before diagnostics are bounded. Pass the test context (`it('…', async (context) => …)`) to attach findings to the test result; the project pane only lists the automatic **Accessibility (axe-core)** test.
|
|
93
|
+
|
|
94
|
+
## Embedded hosts
|
|
95
|
+
|
|
96
|
+
Import default workbench definition from `@histoire/plugin-a11y/client` into caller-owned extension host. Source book must install `HstA11y()` so `@histoire/plugin-a11y/frame` runs inside its story documents. Configure host plugin options to match source settings. Vue views use workbench runtime; native hosts render through their existing Vue integration.
|
|
97
|
+
|
|
98
|
+
Public entries ship precompiled ESM and declarations. No Vue compiler or manual stylesheet import required.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PreviewStoryCallback } from '@histoire/shared';
|
|
2
|
+
import type { BrowserOptions } from '../options.js';
|
|
3
|
+
/**
|
|
4
|
+
* Checks every variant rendered by `histoire build` and writes the report the static book's
|
|
5
|
+
* Accessibility pane reads. Variants are checked one at a time in a shared browser.
|
|
6
|
+
* @param options Scan settings shared with the workbench.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createBuildScanner(options: BrowserOptions): {
|
|
9
|
+
scan: PreviewStoryCallback;
|
|
10
|
+
write: (outputDir: string) => Promise<void>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { readFile, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { normalizeAccessibility } from '@histoire/shared/accessibility';
|
|
5
|
+
import { A11Y_BUILD_REPORT_FILE } from '../results.js';
|
|
6
|
+
/** Page size used for every variant; matches the screenshot plugin default. */
|
|
7
|
+
const VIEWPORT = { width: 1280, height: 800 };
|
|
8
|
+
/** Wraps the axe source so it lands on a private global and never replaces a story-owned `window.axe`. */
|
|
9
|
+
function privateAxeScript(source) {
|
|
10
|
+
return `(() => { const owned = window.axe; ${source}\n;window.__histoireA11yAxe = window.axe; window.axe = owned })()`;
|
|
11
|
+
}
|
|
12
|
+
/** Launch Chromium through the project's Playwright, with an actionable message when missing. */
|
|
13
|
+
async function launchBrowser() {
|
|
14
|
+
let playwright;
|
|
15
|
+
try {
|
|
16
|
+
playwright = await import('playwright');
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
throw new Error('[HstA11y] The `build` option needs the `playwright` package. Install it and run `npx playwright install chromium`.', { cause: error });
|
|
20
|
+
}
|
|
21
|
+
return playwright.chromium.launch({ headless: true });
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Checks every variant rendered by `histoire build` and writes the report the static book's
|
|
25
|
+
* Accessibility pane reads. Variants are checked one at a time in a shared browser.
|
|
26
|
+
* @param options Scan settings shared with the workbench.
|
|
27
|
+
*/
|
|
28
|
+
export function createBuildScanner(options) {
|
|
29
|
+
const results = [];
|
|
30
|
+
let browser;
|
|
31
|
+
let axeSource;
|
|
32
|
+
/** Check one variant document; failures become per-variant errors instead of failing the build. */
|
|
33
|
+
const scan = async ({ story, variant, url }) => {
|
|
34
|
+
const target = { storyId: story.id, variantId: variant.id };
|
|
35
|
+
browser ??= launchBrowser();
|
|
36
|
+
axeSource ??= readFile(createRequire(import.meta.url).resolve('axe-core'), 'utf8').then(privateAxeScript);
|
|
37
|
+
const page = await (await browser).newPage({ viewport: VIEWPORT });
|
|
38
|
+
try {
|
|
39
|
+
page.setDefaultTimeout(options.timeoutMs);
|
|
40
|
+
await page.goto(url);
|
|
41
|
+
// The runtime marks the mounted variant root; wait for it, then for pending requests.
|
|
42
|
+
await page.waitForFunction(id => document.querySelector(`[data-histoire-runtime-content][data-histoire-variant-id="${CSS.escape(id)}"]`), variant.id);
|
|
43
|
+
await page.waitForLoadState('networkidle').catch(() => { });
|
|
44
|
+
await page.addScriptTag({ content: await axeSource });
|
|
45
|
+
const raw = await page.evaluate(async ({ id, exclude, axe }) => {
|
|
46
|
+
const engine = window.__histoireA11yAxe;
|
|
47
|
+
const root = document.querySelector(`[data-histoire-runtime-content][data-histoire-variant-id="${CSS.escape(id)}"]`);
|
|
48
|
+
const excluded = exclude.flatMap(selector => [...root.matches(selector) ? [root] : [], ...root.querySelectorAll(selector)]);
|
|
49
|
+
const empty = { version: engine.version, violations: [], incomplete: [], passes: [], inapplicable: [] };
|
|
50
|
+
// A root exclusion means no eligible content, like the live scanner.
|
|
51
|
+
if (excluded.includes(root))
|
|
52
|
+
return empty;
|
|
53
|
+
const result = await engine.run({ include: [root], exclude: excluded }, axe ?? {});
|
|
54
|
+
// Only what normalization reads crosses the page boundary.
|
|
55
|
+
const finding = (rule) => ({ id: rule.id, impact: rule.impact, help: rule.help, helpUrl: rule.helpUrl, nodes: rule.nodes.map((node) => ({ target: node.target, failureSummary: node.failureSummary })) });
|
|
56
|
+
return { ...empty, violations: result.violations.map(finding), incomplete: result.incomplete.map(finding), passes: result.passes.map(() => 0), inapplicable: result.inapplicable.map(() => 0) };
|
|
57
|
+
}, { id: variant.id, exclude: options.exclude, axe: options.axe });
|
|
58
|
+
const report = { ...normalizeAccessibility(raw.version, true, raw), violationsCount: raw.violations.length, incompleteCount: raw.incomplete.length };
|
|
59
|
+
results.push({ target, report });
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
results.push({ target, error: `Accessibility check failed: ${error instanceof Error ? error.message.split('\n')[0] : String(error)}` });
|
|
63
|
+
}
|
|
64
|
+
finally {
|
|
65
|
+
await page.close().catch(() => { });
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Write the report into the book and release the browser.
|
|
70
|
+
* @param outputDir Static book directory.
|
|
71
|
+
*/
|
|
72
|
+
async function write(outputDir) {
|
|
73
|
+
try {
|
|
74
|
+
const report = { version: 1, generatedAt: new Date().toISOString(), results };
|
|
75
|
+
await writeFile(join(outputDir, A11Y_BUILD_REPORT_FILE), JSON.stringify(report));
|
|
76
|
+
const affected = results.filter(result => result.report?.violationsCount).length;
|
|
77
|
+
// eslint-disable-next-line no-console -- Build summary line, like other build plugins.
|
|
78
|
+
console.log(`[Accessibility] ${results.length} variants checked, ${affected} with violations`);
|
|
79
|
+
}
|
|
80
|
+
finally {
|
|
81
|
+
await (await browser)?.close();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return { scan, write };
|
|
85
|
+
}
|