@diegovelasquezweb/a11y-engine 0.6.3 → 0.6.5
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/assets/knowledge/knowledge.mjs +9 -9
- package/package.json +1 -1
- package/src/index.d.mts +83 -29
|
@@ -107,7 +107,7 @@ export default {
|
|
|
107
107
|
{
|
|
108
108
|
id: "A",
|
|
109
109
|
label: "Level A",
|
|
110
|
-
|
|
110
|
+
tag: "Minimum",
|
|
111
111
|
description: "The baseline: essential requirements that remove the most severe barriers.",
|
|
112
112
|
shortDescription: "Minimum baseline",
|
|
113
113
|
hint: "Failing Level A means some users cannot access the content at all.",
|
|
@@ -116,7 +116,7 @@ export default {
|
|
|
116
116
|
{
|
|
117
117
|
id: "AA",
|
|
118
118
|
label: "Level AA",
|
|
119
|
-
|
|
119
|
+
tag: "Standard",
|
|
120
120
|
description: "The recommended target for most websites — required by most accessibility laws.",
|
|
121
121
|
shortDescription: "Recommended for most websites",
|
|
122
122
|
hint: "Referenced by ADA, Section 508, EN 301 549, and EAA.",
|
|
@@ -125,7 +125,7 @@ export default {
|
|
|
125
125
|
{
|
|
126
126
|
id: "AAA",
|
|
127
127
|
label: "Level AAA",
|
|
128
|
-
|
|
128
|
+
tag: "Enhanced",
|
|
129
129
|
description: "The highest conformance level — not required but beneficial for specialized audiences.",
|
|
130
130
|
shortDescription: "Strictest — not required by most regulations",
|
|
131
131
|
hint: "Full AAA conformance is not recommended as a general policy for entire sites.",
|
|
@@ -251,21 +251,21 @@ export default {
|
|
|
251
251
|
{
|
|
252
252
|
id: "wcag-2-0",
|
|
253
253
|
title: "WCAG 2.0",
|
|
254
|
-
|
|
254
|
+
tag: "2008",
|
|
255
255
|
summary: "The original W3C recommendation that established the foundation for web accessibility.",
|
|
256
256
|
body: "Introduced the four principles (Perceivable, Operable, Understandable, Robust) and three conformance levels (A, AA, AAA). Covers core requirements like text alternatives, keyboard access, color contrast, and form labels. Still widely referenced in legal frameworks worldwide.",
|
|
257
257
|
},
|
|
258
258
|
{
|
|
259
259
|
id: "wcag-2-1",
|
|
260
260
|
title: "WCAG 2.1",
|
|
261
|
-
|
|
261
|
+
tag: "2018",
|
|
262
262
|
summary: "Extended 2.0 with 17 new success criteria for mobile, low vision, and cognitive disabilities.",
|
|
263
263
|
body: "Added criteria for touch targets (2.5.5), text spacing (1.4.12), content reflow (1.4.10), orientation (1.3.4), and input purpose (1.3.5). Required by the European Accessibility Act (EAA) and referenced in updated ADA guidance. All 2.0 criteria remain \u2014 2.1 is a superset.",
|
|
264
264
|
},
|
|
265
265
|
{
|
|
266
266
|
id: "wcag-2-2",
|
|
267
267
|
title: "WCAG 2.2",
|
|
268
|
-
|
|
268
|
+
tag: "2023",
|
|
269
269
|
summary: "The latest version, adding 9 new criteria focused on cognitive accessibility and consistent help.",
|
|
270
270
|
body: "Key additions include consistent help (3.2.6), accessible authentication (3.3.8), dragging movements (2.5.7), and focus appearance (2.4.11/2.4.12). Removed criterion 4.1.1 (Parsing) as it\u2019s now handled by modern browsers. Supersedes both 2.0 and 2.1 \u2014 all prior criteria are included.",
|
|
271
271
|
},
|
|
@@ -278,21 +278,21 @@ export default {
|
|
|
278
278
|
{
|
|
279
279
|
id: "level-a",
|
|
280
280
|
title: "Level A",
|
|
281
|
-
|
|
281
|
+
tag: "Minimum",
|
|
282
282
|
summary: "The baseline: essential requirements that remove the most severe barriers.",
|
|
283
283
|
body: "Covers fundamentals like non-text content alternatives (1.1.1), keyboard operability (2.1.1), page titles (2.4.2), and language of the page (3.1.1). Failing Level A means some users cannot access the content at all. Every site should meet Level A at minimum.",
|
|
284
284
|
},
|
|
285
285
|
{
|
|
286
286
|
id: "level-aa",
|
|
287
287
|
title: "Level AA",
|
|
288
|
-
|
|
288
|
+
tag: "Standard",
|
|
289
289
|
summary: "The recommended target for most websites \u2014 required by most accessibility laws.",
|
|
290
290
|
body: "Includes all Level A criteria plus requirements for color contrast (1.4.3 \u2014 4.5:1 ratio), resize text (1.4.4), focus visible (2.4.7), error suggestion (3.3.3), and consistent navigation (3.2.3). Referenced by ADA, Section 508, EN 301 549, and EAA. This is the standard the scanner defaults to.",
|
|
291
291
|
},
|
|
292
292
|
{
|
|
293
293
|
id: "level-aaa",
|
|
294
294
|
title: "Level AAA",
|
|
295
|
-
|
|
295
|
+
tag: "Enhanced",
|
|
296
296
|
summary: "The highest conformance level \u2014 not required but beneficial for specialized audiences.",
|
|
297
297
|
body: "Adds stricter contrast (1.4.6 \u2014 7:1 ratio), sign language for audio (1.2.6), extended audio description (1.2.7), and reading level (3.1.5). Full AAA conformance is not recommended as a general policy because some criteria cannot be satisfied for all content types. Useful for targeted sections like education or government services.",
|
|
298
298
|
},
|
package/package.json
CHANGED
package/src/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
4
|
|
|
5
5
|
export interface Finding {
|
|
6
6
|
id: string;
|
|
@@ -135,9 +135,9 @@ export interface AuditSummary {
|
|
|
135
135
|
totalFindings: number;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
141
|
|
|
142
142
|
export interface ScanPayload {
|
|
143
143
|
findings: Finding[] | Record<string, unknown>[];
|
|
@@ -209,9 +209,9 @@ export interface SourcePatternOptions {
|
|
|
209
209
|
onlyPattern?: string;
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
215
|
|
|
216
216
|
export interface ScannerEngineHelp {
|
|
217
217
|
id: "axe" | "cdp" | "pa11y" | string;
|
|
@@ -222,25 +222,53 @@ export interface ScannerEngineHelp {
|
|
|
222
222
|
defaultEnabled: boolean;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
export interface EnumOptionValue {
|
|
226
|
-
value: string;
|
|
227
|
-
label: string;
|
|
228
|
-
description?: string;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
225
|
export interface ScannerOptionHelp {
|
|
232
226
|
id: string;
|
|
233
227
|
label: string;
|
|
234
228
|
description: string;
|
|
235
229
|
defaultValue: unknown;
|
|
236
230
|
type: string;
|
|
237
|
-
allowedValues?: unknown[]
|
|
231
|
+
allowedValues?: unknown[];
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export interface GlossaryEntry {
|
|
235
|
+
term: string;
|
|
236
|
+
definition: string;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export interface ConceptEntry {
|
|
240
|
+
title: string;
|
|
241
|
+
body: string;
|
|
242
|
+
context?: string;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export interface PersonaReferenceItem {
|
|
246
|
+
id: string;
|
|
247
|
+
icon: string;
|
|
248
|
+
label: string;
|
|
249
|
+
description: string;
|
|
250
|
+
keywords: string[];
|
|
251
|
+
mappedRules: string[];
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export interface PersonaReference {
|
|
255
|
+
locale: string;
|
|
256
|
+
version: string;
|
|
257
|
+
personas: PersonaReferenceItem[];
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export interface ScannerHelp {
|
|
261
|
+
locale: string;
|
|
262
|
+
version: string;
|
|
263
|
+
title: string;
|
|
264
|
+
engines: ScannerEngineHelp[];
|
|
265
|
+
options: ScannerOptionHelp[];
|
|
238
266
|
}
|
|
239
267
|
|
|
240
268
|
export interface ConformanceLevel {
|
|
241
269
|
id: "A" | "AA" | "AAA";
|
|
242
270
|
label: string;
|
|
243
|
-
|
|
271
|
+
tag: string;
|
|
244
272
|
description: string;
|
|
245
273
|
shortDescription: string;
|
|
246
274
|
hint: string;
|
|
@@ -263,6 +291,32 @@ export interface SeverityLevel {
|
|
|
263
291
|
order: number;
|
|
264
292
|
}
|
|
265
293
|
|
|
294
|
+
export interface DocArticle {
|
|
295
|
+
id: string;
|
|
296
|
+
title: string;
|
|
297
|
+
icon?: string;
|
|
298
|
+
tag?: string;
|
|
299
|
+
summary: string;
|
|
300
|
+
body: string;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export interface DocGroup {
|
|
304
|
+
id: string;
|
|
305
|
+
label: string;
|
|
306
|
+
articles: DocArticle[];
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export interface DocSection {
|
|
310
|
+
id: string;
|
|
311
|
+
heading: string;
|
|
312
|
+
articles?: DocArticle[];
|
|
313
|
+
groups?: DocGroup[];
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export interface KnowledgeDocs {
|
|
317
|
+
sections: DocSection[];
|
|
318
|
+
}
|
|
319
|
+
|
|
266
320
|
export interface ConformanceLevelsResult {
|
|
267
321
|
locale: string;
|
|
268
322
|
version: string;
|
|
@@ -309,9 +363,9 @@ export interface KnowledgeOptions {
|
|
|
309
363
|
locale?: string;
|
|
310
364
|
}
|
|
311
365
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
|
|
315
369
|
|
|
316
370
|
export interface EngineSelection {
|
|
317
371
|
axe?: boolean;
|
|
@@ -319,9 +373,9 @@ export interface EngineSelection {
|
|
|
319
373
|
pa11y?: boolean;
|
|
320
374
|
}
|
|
321
375
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
|
|
325
379
|
|
|
326
380
|
export interface RunAuditOptions {
|
|
327
381
|
baseUrl: string;
|
|
@@ -346,17 +400,17 @@ export interface RunAuditOptions {
|
|
|
346
400
|
onProgress?: (step: string, status: string, extra?: Record<string, unknown>) => void;
|
|
347
401
|
}
|
|
348
402
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
|
|
352
406
|
|
|
353
407
|
export interface EnrichmentOptions {
|
|
354
408
|
screenshotUrlBuilder?: (rawPath: string) => string;
|
|
355
409
|
}
|
|
356
410
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
|
|
360
414
|
|
|
361
415
|
export function runAudit(options: RunAuditOptions): Promise<ScanPayload>;
|
|
362
416
|
|