@holmdigital/engine 2.4.0 → 2.5.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 +13 -4
- package/dist/{chunk-K7ZWJXHC.mjs → chunk-4AM7NVKM.mjs} +43 -13
- package/dist/cli/index.js +42 -12
- package/dist/cli/index.mjs +1 -1
- package/dist/cli/templates/en-us.json +2 -2
- package/dist/index.js +42 -12
- package/dist/index.mjs +1 -1
- package/dist/templates/en-us.json +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,16 +14,19 @@ Most accessibility tools give you technical errors (e.g., "Color contrast must b
|
|
|
14
14
|
It handles the heavy lifting of:
|
|
15
15
|
1. **Mapping** technical failures to specific legal clauses.
|
|
16
16
|
2. **Validating** HTML structure to ensure test accuracy.
|
|
17
|
-
3. **Reporting** in multiple languages (EN, SV, NO, FI, DA, NL, DE, FR, ES
|
|
17
|
+
3. **Reporting** in multiple languages — 9 CLI output locales (EN, SV, NO, FI, DA, NL, DE, FR, ES) and 16 accessibility statement template locales (adds IT, PT, PL, EN-GB, EN-US, EN-CA, EN-AU) — for non-technical stakeholders.
|
|
18
18
|
4. **CI/CD Pipeline Integration** with automatic enforcement.
|
|
19
19
|
|
|
20
20
|
For a comprehensive guide on CLI flags, CI/CD integration, and configuration files, see the **[Engine Library Catalog](../../docs/reference/engine.md)**.
|
|
21
21
|
|
|
22
22
|
## Features
|
|
23
23
|
|
|
24
|
-
- **Regulatory Mapping**: Maps technical failures to EU laws (EN 301 549, EAA)
|
|
24
|
+
- **Regulatory Mapping**: Maps technical failures to EU laws (EN 301 549, EAA), international laws (Australian DDA), and **U.S. ADA (Title II state/local, Title III private sector) + Section 508 (federal agencies)**.
|
|
25
|
+
- **Sector-Aware US Routing**: `--country US --sector public` references **ADA Title II + Section 508** (DOJ enforcement); `--sector private` references **ADA Title III** (DOJ enforcement).
|
|
25
26
|
- **HTML Structure Validation**: Built-in `html-validate` checks to prevent false positives/negatives.
|
|
26
|
-
- **Internationalization (i18n)**:
|
|
27
|
+
- **Internationalization (i18n)**:
|
|
28
|
+
- **CLI output**: 9 locale files (`en`, `sv`, `no`, `fi`, `da`, `de`, `fr`, `es`, `nl`) + 4 English aliases (`en-gb`, `en-us`, `en-ca`, `en-au`) that fall back to `en`.
|
|
29
|
+
- **Statement templates**: 16 locale files — adds `it`, `pt`, `pl`, and separate templates for each English variant (`en-gb`, `en-us`, `en-ca`, `en-au`).
|
|
27
30
|
- **Template-Driven Accessibility Statements**: Generates modern, glassmorphism-styled statements using externalized JSON templates for each language, allowing for professional legal phrasing and deep customization.
|
|
28
31
|
- **Multi-Company Metadata**: Easily customize statements via CLI flags or `.a11yrc` for scalable client generation.
|
|
29
32
|
- **Enriched JUnit XML**: Professional CI/CD reports including scan duration, page title, engine metadata, and **detailed failing node** snippets (Target + HTML).
|
|
@@ -49,7 +52,7 @@ npx hd-a11y-scan <url> [options]
|
|
|
49
52
|
**Options:**
|
|
50
53
|
| Option | Description |
|
|
51
54
|
|--------|-------------|
|
|
52
|
-
| `--lang <code>` | Language code
|
|
55
|
+
| `--lang <code>` | Language code. CLI output: `en`, `sv`, `no`, `fi`, `da`, `de`, `fr`, `es`, `nl` (+ aliases `en-gb`, `en-us`, `en-ca`, `en-au` fall back to `en`). Statement templates also accept `it`, `pt`, `pl`. |
|
|
53
56
|
| `--threshold <level>` | Severity threshold for compliance (`critical`, `high`, `medium`, `low`). Default: `high` |
|
|
54
57
|
| `--ci` | Run in CI mode (exit code 1 on failure) |
|
|
55
58
|
| `--json` | Output results as JSON |
|
|
@@ -91,6 +94,12 @@ npx hd-a11y-scan https://example.com --light
|
|
|
91
94
|
|
|
92
95
|
# Light scan with JSON output (perfect for scan-server integration)
|
|
93
96
|
npx hd-a11y-scan https://example.com --light --json
|
|
97
|
+
|
|
98
|
+
# U.S. state/local government statement (ADA Title II + Section 508, DOJ)
|
|
99
|
+
npx hd-a11y-scan https://example.gov --country US --sector public --statement statement.md --lang en-us
|
|
100
|
+
|
|
101
|
+
# U.S. private sector / public accommodation statement (ADA Title III, DOJ)
|
|
102
|
+
npx hd-a11y-scan https://shop.example.com --country US --sector private --statement statement.md --lang en-us
|
|
94
103
|
```
|
|
95
104
|
|
|
96
105
|
## JSON Output
|
|
@@ -138,7 +138,7 @@ var HtmlValidator = class {
|
|
|
138
138
|
// src/core/regulatory-scanner.ts
|
|
139
139
|
import { readFileSync } from "fs";
|
|
140
140
|
function getEngineVersion() {
|
|
141
|
-
return "2.
|
|
141
|
+
return "2.5.0";
|
|
142
142
|
}
|
|
143
143
|
function getStandardsVersion() {
|
|
144
144
|
try {
|
|
@@ -289,7 +289,7 @@ var RegulatoryScanner = class {
|
|
|
289
289
|
const risk = impactToRisk[impact] || "medium";
|
|
290
290
|
return {
|
|
291
291
|
ruleId: violation.id,
|
|
292
|
-
wcagCriteria: violation.tags.find((t) => t.startsWith("wcag")) || "Unknown",
|
|
292
|
+
wcagCriteria: violation.tags.find((t) => t.startsWith("wcag")) || (violation.tags.includes("best-practice") ? "Best Practice" : "Unknown"),
|
|
293
293
|
en301549Criteria: "",
|
|
294
294
|
dosLagenReference: "",
|
|
295
295
|
diggRisk: risk,
|
|
@@ -352,25 +352,38 @@ var RegulatoryScanner = class {
|
|
|
352
352
|
}))
|
|
353
353
|
});
|
|
354
354
|
} else {
|
|
355
|
+
const isBestPractice = violation.tags.includes("best-practice");
|
|
356
|
+
const riskLevel = isBestPractice ? "low" : "medium";
|
|
357
|
+
const FALLBACK_STRINGS = {
|
|
358
|
+
sv: { bestPracticeRef: "Rekommendation (ej lagkrav)", manualRef: "Kr\xE4ver manuell bed\xF6mning", bestPracticeRationale: "Best practice \u2014 rekommenderas f\xF6r b\xE4ttre tillg\xE4nglighet men \xE4r inget specifikt WCAG-krav.", unmappedRationale: "Detta fel uppt\xE4cktes av scannern men saknar specifik mappning i HolmDigital-databasen." },
|
|
359
|
+
no: { bestPracticeRef: "Anbefaling (ikke lovkrav)", manualRef: "Krever manuell vurdering", bestPracticeRationale: "Best practice \u2014 anbefales for bedre tilgjengelighet, men er ikke et spesifikt WCAG-krav.", unmappedRationale: "Denne feilen ble oppdaget av skanneren, men mangler spesifikk kartlegging i HolmDigital-databasen." },
|
|
360
|
+
fi: { bestPracticeRef: "Suositus (ei lakis\xE4\xE4teinen)", manualRef: "Vaatii manuaalisen arvioinnin", bestPracticeRationale: "Best practice \u2014 suositellaan paremman saavutettavuuden vuoksi, mutta ei ole erityinen WCAG-vaatimus.", unmappedRationale: "T\xE4m\xE4 virhe havaittiin skannerilla, mutta sille ei ole tarkkaa kartoitusta HolmDigital-tietokannassa." },
|
|
361
|
+
de: { bestPracticeRef: "Empfehlung (keine gesetzliche Pflicht)", manualRef: "Erfordert manuelle Bewertung", bestPracticeRationale: "Best Practice \u2014 empfohlen f\xFCr bessere Barrierefreiheit, aber keine spezifische WCAG-Anforderung.", unmappedRationale: "Dieser Fehler wurde vom Scanner erkannt, hat aber keine spezifische Zuordnung in der HolmDigital-Datenbank." },
|
|
362
|
+
fr: { bestPracticeRef: "Recommandation (non obligatoire)", manualRef: "N\xE9cessite une \xE9valuation manuelle", bestPracticeRationale: "Bonne pratique \u2014 recommand\xE9e pour une meilleure accessibilit\xE9, mais pas une exigence WCAG sp\xE9cifique.", unmappedRationale: "Cette erreur a \xE9t\xE9 d\xE9tect\xE9e par le scanner mais n'a pas de correspondance sp\xE9cifique dans la base HolmDigital." },
|
|
363
|
+
es: { bestPracticeRef: "Recomendaci\xF3n (no obligatorio)", manualRef: "Requiere evaluaci\xF3n manual", bestPracticeRationale: "Buena pr\xE1ctica \u2014 recomendada para mejor accesibilidad, pero no es un requisito WCAG espec\xEDfico.", unmappedRationale: "Este error fue detectado por el esc\xE1ner pero no tiene una correspondencia espec\xEDfica en la base de datos de HolmDigital." },
|
|
364
|
+
nl: { bestPracticeRef: "Aanbeveling (geen wettelijke verplichting)", manualRef: "Vereist handmatige beoordeling", bestPracticeRationale: "Best practice \u2014 aanbevolen voor betere toegankelijkheid, maar geen specifieke WCAG-eis.", unmappedRationale: "Deze fout is gedetecteerd door de scanner maar heeft geen specifieke toewijzing in de HolmDigital-database." },
|
|
365
|
+
da: { bestPracticeRef: "Anbefaling (ikke lovkrav)", manualRef: "Kr\xE6ver manuel vurdering", bestPracticeRationale: "Best practice \u2014 anbefales for bedre tilg\xE6ngelighed, men er ikke et specifikt WCAG-krav.", unmappedRationale: "Denne fejl blev opdaget af scanneren, men mangler specifik kortl\xE6gning i HolmDigital-databasen." },
|
|
366
|
+
en: { bestPracticeRef: "Recommendation (not a legal requirement)", manualRef: "Requires manual assessment", bestPracticeRationale: "Best practice \u2014 recommended for better accessibility but not a specific WCAG requirement.", unmappedRationale: "This issue was detected by the scanner but has no specific mapping in the HolmDigital database." }
|
|
367
|
+
};
|
|
368
|
+
const fallback = FALLBACK_STRINGS[lang] || FALLBACK_STRINGS["en"];
|
|
355
369
|
reports.push({
|
|
356
370
|
ruleId: violation.id,
|
|
357
|
-
wcagCriteria: "Unknown",
|
|
358
|
-
en301549Criteria: "Unknown",
|
|
359
|
-
dosLagenReference:
|
|
360
|
-
diggRisk:
|
|
361
|
-
|
|
362
|
-
eaaImpact: "medium",
|
|
371
|
+
wcagCriteria: isBestPractice ? "Best Practice" : "Unknown",
|
|
372
|
+
en301549Criteria: isBestPractice ? "N/A" : "Unknown",
|
|
373
|
+
dosLagenReference: isBestPractice ? fallback.bestPracticeRef : fallback.manualRef,
|
|
374
|
+
diggRisk: riskLevel,
|
|
375
|
+
eaaImpact: riskLevel,
|
|
363
376
|
remediation: {
|
|
364
377
|
description: violation.help,
|
|
365
378
|
technicalGuidance: violation.description,
|
|
366
379
|
component: void 0
|
|
367
380
|
},
|
|
368
381
|
holmdigitalInsight: {
|
|
369
|
-
diggRisk:
|
|
370
|
-
eaaImpact:
|
|
382
|
+
diggRisk: riskLevel,
|
|
383
|
+
eaaImpact: riskLevel,
|
|
371
384
|
reasoning: violation.help,
|
|
372
385
|
swedishInterpretation: violation.help,
|
|
373
|
-
priorityRationale:
|
|
386
|
+
priorityRationale: isBestPractice ? fallback.bestPracticeRationale : fallback.unmappedRationale
|
|
374
387
|
},
|
|
375
388
|
testability: {
|
|
376
389
|
automated: true,
|
|
@@ -544,7 +557,7 @@ function generateBadgeMarkdown(score) {
|
|
|
544
557
|
import React from "react";
|
|
545
558
|
import { renderToStaticMarkup } from "react-dom/server";
|
|
546
559
|
import { AccessibilityStatement } from "@holmdigital/components";
|
|
547
|
-
import { getEnforcementBody, getNationalLawByFramework } from "@holmdigital/standards";
|
|
560
|
+
import { getEnforcementBody, getNationalLawByFramework, getNationalLaws } from "@holmdigital/standards";
|
|
548
561
|
import fs from "fs/promises";
|
|
549
562
|
import path from "path";
|
|
550
563
|
var EVALUATION_METHOD = {
|
|
@@ -790,12 +803,29 @@ async function generateStatementContent(result, lang = "en", format = "html", me
|
|
|
790
803
|
"{<tiers externe>}": props.generatorTool?.name || "HolmDigital Engine",
|
|
791
804
|
"{<tercero externo>}": props.generatorTool?.name || "HolmDigital Engine",
|
|
792
805
|
"{<third party>}": props.generatorTool?.name || "HolmDigital Engine",
|
|
793
|
-
"{<enforcement_body>}":
|
|
806
|
+
"{<enforcement_body>}": (() => {
|
|
807
|
+
if (country === "US") {
|
|
808
|
+
const adaLaw = getNationalLaws("US").find((l) => l.euFramework === "ADA" && l.scope === sector);
|
|
809
|
+
if (adaLaw) return adaLaw.enforcement.authorityName;
|
|
810
|
+
}
|
|
811
|
+
return getEnforcementBody(country, sector);
|
|
812
|
+
})(),
|
|
794
813
|
"{<national_law>}": (() => {
|
|
795
814
|
if (country === "AU") {
|
|
796
815
|
const ddaLaw = getNationalLawByFramework("DDA", "AU");
|
|
797
816
|
return ddaLaw ? `${ddaLaw.fullName}` : "Disability Discrimination Act 1992 (Cth)";
|
|
798
817
|
}
|
|
818
|
+
if (country === "US") {
|
|
819
|
+
const usLaws = getNationalLaws("US");
|
|
820
|
+
const adaLaw = usLaws.find((l) => l.euFramework === "ADA" && l.scope === sector);
|
|
821
|
+
if (adaLaw) {
|
|
822
|
+
if (sector === "public") {
|
|
823
|
+
const s508 = usLaws.find((l) => l.id === "us-508");
|
|
824
|
+
return s508 ? `${adaLaw.fullName} (${adaLaw.law}) & ${s508.fullName} (${s508.law})` : `${adaLaw.fullName} (${adaLaw.law})`;
|
|
825
|
+
}
|
|
826
|
+
return `${adaLaw.fullName} (${adaLaw.law})`;
|
|
827
|
+
}
|
|
828
|
+
}
|
|
799
829
|
const law = getNationalLawByFramework(sector === "private" ? "EAA" : "WAD", country);
|
|
800
830
|
return law ? `${law.fullName} (${law.law})` : "";
|
|
801
831
|
})(),
|
package/dist/cli/index.js
CHANGED
|
@@ -783,7 +783,7 @@ var HtmlValidator = class {
|
|
|
783
783
|
// src/core/regulatory-scanner.ts
|
|
784
784
|
var import_node_fs = require("fs");
|
|
785
785
|
function getEngineVersion() {
|
|
786
|
-
return "2.
|
|
786
|
+
return "2.5.0";
|
|
787
787
|
}
|
|
788
788
|
function getStandardsVersion() {
|
|
789
789
|
try {
|
|
@@ -934,7 +934,7 @@ var RegulatoryScanner = class {
|
|
|
934
934
|
const risk = impactToRisk[impact] || "medium";
|
|
935
935
|
return {
|
|
936
936
|
ruleId: violation.id,
|
|
937
|
-
wcagCriteria: violation.tags.find((t2) => t2.startsWith("wcag")) || "Unknown",
|
|
937
|
+
wcagCriteria: violation.tags.find((t2) => t2.startsWith("wcag")) || (violation.tags.includes("best-practice") ? "Best Practice" : "Unknown"),
|
|
938
938
|
en301549Criteria: "",
|
|
939
939
|
dosLagenReference: "",
|
|
940
940
|
diggRisk: risk,
|
|
@@ -997,25 +997,38 @@ var RegulatoryScanner = class {
|
|
|
997
997
|
}))
|
|
998
998
|
});
|
|
999
999
|
} else {
|
|
1000
|
+
const isBestPractice = violation.tags.includes("best-practice");
|
|
1001
|
+
const riskLevel = isBestPractice ? "low" : "medium";
|
|
1002
|
+
const FALLBACK_STRINGS = {
|
|
1003
|
+
sv: { bestPracticeRef: "Rekommendation (ej lagkrav)", manualRef: "Kr\xE4ver manuell bed\xF6mning", bestPracticeRationale: "Best practice \u2014 rekommenderas f\xF6r b\xE4ttre tillg\xE4nglighet men \xE4r inget specifikt WCAG-krav.", unmappedRationale: "Detta fel uppt\xE4cktes av scannern men saknar specifik mappning i HolmDigital-databasen." },
|
|
1004
|
+
no: { bestPracticeRef: "Anbefaling (ikke lovkrav)", manualRef: "Krever manuell vurdering", bestPracticeRationale: "Best practice \u2014 anbefales for bedre tilgjengelighet, men er ikke et spesifikt WCAG-krav.", unmappedRationale: "Denne feilen ble oppdaget av skanneren, men mangler spesifikk kartlegging i HolmDigital-databasen." },
|
|
1005
|
+
fi: { bestPracticeRef: "Suositus (ei lakis\xE4\xE4teinen)", manualRef: "Vaatii manuaalisen arvioinnin", bestPracticeRationale: "Best practice \u2014 suositellaan paremman saavutettavuuden vuoksi, mutta ei ole erityinen WCAG-vaatimus.", unmappedRationale: "T\xE4m\xE4 virhe havaittiin skannerilla, mutta sille ei ole tarkkaa kartoitusta HolmDigital-tietokannassa." },
|
|
1006
|
+
de: { bestPracticeRef: "Empfehlung (keine gesetzliche Pflicht)", manualRef: "Erfordert manuelle Bewertung", bestPracticeRationale: "Best Practice \u2014 empfohlen f\xFCr bessere Barrierefreiheit, aber keine spezifische WCAG-Anforderung.", unmappedRationale: "Dieser Fehler wurde vom Scanner erkannt, hat aber keine spezifische Zuordnung in der HolmDigital-Datenbank." },
|
|
1007
|
+
fr: { bestPracticeRef: "Recommandation (non obligatoire)", manualRef: "N\xE9cessite une \xE9valuation manuelle", bestPracticeRationale: "Bonne pratique \u2014 recommand\xE9e pour une meilleure accessibilit\xE9, mais pas une exigence WCAG sp\xE9cifique.", unmappedRationale: "Cette erreur a \xE9t\xE9 d\xE9tect\xE9e par le scanner mais n'a pas de correspondance sp\xE9cifique dans la base HolmDigital." },
|
|
1008
|
+
es: { bestPracticeRef: "Recomendaci\xF3n (no obligatorio)", manualRef: "Requiere evaluaci\xF3n manual", bestPracticeRationale: "Buena pr\xE1ctica \u2014 recomendada para mejor accesibilidad, pero no es un requisito WCAG espec\xEDfico.", unmappedRationale: "Este error fue detectado por el esc\xE1ner pero no tiene una correspondencia espec\xEDfica en la base de datos de HolmDigital." },
|
|
1009
|
+
nl: { bestPracticeRef: "Aanbeveling (geen wettelijke verplichting)", manualRef: "Vereist handmatige beoordeling", bestPracticeRationale: "Best practice \u2014 aanbevolen voor betere toegankelijkheid, maar geen specifieke WCAG-eis.", unmappedRationale: "Deze fout is gedetecteerd door de scanner maar heeft geen specifieke toewijzing in de HolmDigital-database." },
|
|
1010
|
+
da: { bestPracticeRef: "Anbefaling (ikke lovkrav)", manualRef: "Kr\xE6ver manuel vurdering", bestPracticeRationale: "Best practice \u2014 anbefales for bedre tilg\xE6ngelighed, men er ikke et specifikt WCAG-krav.", unmappedRationale: "Denne fejl blev opdaget af scanneren, men mangler specifik kortl\xE6gning i HolmDigital-databasen." },
|
|
1011
|
+
en: { bestPracticeRef: "Recommendation (not a legal requirement)", manualRef: "Requires manual assessment", bestPracticeRationale: "Best practice \u2014 recommended for better accessibility but not a specific WCAG requirement.", unmappedRationale: "This issue was detected by the scanner but has no specific mapping in the HolmDigital database." }
|
|
1012
|
+
};
|
|
1013
|
+
const fallback = FALLBACK_STRINGS[lang] || FALLBACK_STRINGS["en"];
|
|
1000
1014
|
reports.push({
|
|
1001
1015
|
ruleId: violation.id,
|
|
1002
|
-
wcagCriteria: "Unknown",
|
|
1003
|
-
en301549Criteria: "Unknown",
|
|
1004
|
-
dosLagenReference:
|
|
1005
|
-
diggRisk:
|
|
1006
|
-
|
|
1007
|
-
eaaImpact: "medium",
|
|
1016
|
+
wcagCriteria: isBestPractice ? "Best Practice" : "Unknown",
|
|
1017
|
+
en301549Criteria: isBestPractice ? "N/A" : "Unknown",
|
|
1018
|
+
dosLagenReference: isBestPractice ? fallback.bestPracticeRef : fallback.manualRef,
|
|
1019
|
+
diggRisk: riskLevel,
|
|
1020
|
+
eaaImpact: riskLevel,
|
|
1008
1021
|
remediation: {
|
|
1009
1022
|
description: violation.help,
|
|
1010
1023
|
technicalGuidance: violation.description,
|
|
1011
1024
|
component: void 0
|
|
1012
1025
|
},
|
|
1013
1026
|
holmdigitalInsight: {
|
|
1014
|
-
diggRisk:
|
|
1015
|
-
eaaImpact:
|
|
1027
|
+
diggRisk: riskLevel,
|
|
1028
|
+
eaaImpact: riskLevel,
|
|
1016
1029
|
reasoning: violation.help,
|
|
1017
1030
|
swedishInterpretation: violation.help,
|
|
1018
|
-
priorityRationale:
|
|
1031
|
+
priorityRationale: isBestPractice ? fallback.bestPracticeRationale : fallback.unmappedRationale
|
|
1019
1032
|
},
|
|
1020
1033
|
testability: {
|
|
1021
1034
|
automated: true,
|
|
@@ -1775,12 +1788,29 @@ async function generateStatementContent(result, lang = "en", format = "html", me
|
|
|
1775
1788
|
"{<tiers externe>}": props.generatorTool?.name || "HolmDigital Engine",
|
|
1776
1789
|
"{<tercero externo>}": props.generatorTool?.name || "HolmDigital Engine",
|
|
1777
1790
|
"{<third party>}": props.generatorTool?.name || "HolmDigital Engine",
|
|
1778
|
-
"{<enforcement_body>}": (
|
|
1791
|
+
"{<enforcement_body>}": (() => {
|
|
1792
|
+
if (country === "US") {
|
|
1793
|
+
const adaLaw = (0, import_standards.getNationalLaws)("US").find((l) => l.euFramework === "ADA" && l.scope === sector);
|
|
1794
|
+
if (adaLaw) return adaLaw.enforcement.authorityName;
|
|
1795
|
+
}
|
|
1796
|
+
return (0, import_standards.getEnforcementBody)(country, sector);
|
|
1797
|
+
})(),
|
|
1779
1798
|
"{<national_law>}": (() => {
|
|
1780
1799
|
if (country === "AU") {
|
|
1781
1800
|
const ddaLaw = (0, import_standards.getNationalLawByFramework)("DDA", "AU");
|
|
1782
1801
|
return ddaLaw ? `${ddaLaw.fullName}` : "Disability Discrimination Act 1992 (Cth)";
|
|
1783
1802
|
}
|
|
1803
|
+
if (country === "US") {
|
|
1804
|
+
const usLaws = (0, import_standards.getNationalLaws)("US");
|
|
1805
|
+
const adaLaw = usLaws.find((l) => l.euFramework === "ADA" && l.scope === sector);
|
|
1806
|
+
if (adaLaw) {
|
|
1807
|
+
if (sector === "public") {
|
|
1808
|
+
const s508 = usLaws.find((l) => l.id === "us-508");
|
|
1809
|
+
return s508 ? `${adaLaw.fullName} (${adaLaw.law}) & ${s508.fullName} (${s508.law})` : `${adaLaw.fullName} (${adaLaw.law})`;
|
|
1810
|
+
}
|
|
1811
|
+
return `${adaLaw.fullName} (${adaLaw.law})`;
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1784
1814
|
const law = (0, import_standards.getNationalLawByFramework)(sector === "private" ? "EAA" : "WAD", country);
|
|
1785
1815
|
return law ? `${law.fullName} (${law.law})` : "";
|
|
1786
1816
|
})(),
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"title": "Accessibility of {<website>}",
|
|
3
|
-
"intro": "This website is run by {<organisation>}. We want as many people as possible to be able to use it, and this document describes how {<website>} complies with
|
|
3
|
+
"intro": "This website is run by {<organisation>}. We want as many people as possible to be able to use it, and this document describes how {<website>} complies with {<national_law>}, any known accessibility issues, and how you can report problems so that we can fix them.",
|
|
4
4
|
"sections": [
|
|
5
5
|
{
|
|
6
6
|
"id": "how-accessible",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
{
|
|
21
21
|
"id": "enforcement",
|
|
22
22
|
"title": "Enforcement procedure",
|
|
23
|
-
"content": "The {<enforcement_body>} is responsible for enforcing
|
|
23
|
+
"content": "The {<enforcement_body>} is responsible for enforcing {<national_law>}. If you experience accessibility issues on our website, you can submit a complaint to {<enforcement_body>}.\n\nYou can also file a complaint with {<enforcement_body>} if you believe our website does not comply with the applicable law, or if your request for accessible content has not been handled appropriately."
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"id": "technical",
|
package/dist/index.js
CHANGED
|
@@ -677,7 +677,7 @@ var HtmlValidator = class {
|
|
|
677
677
|
// src/core/regulatory-scanner.ts
|
|
678
678
|
var import_node_fs = require("fs");
|
|
679
679
|
function getEngineVersion() {
|
|
680
|
-
return "2.
|
|
680
|
+
return "2.5.0";
|
|
681
681
|
}
|
|
682
682
|
function getStandardsVersion() {
|
|
683
683
|
try {
|
|
@@ -828,7 +828,7 @@ var RegulatoryScanner = class {
|
|
|
828
828
|
const risk = impactToRisk[impact] || "medium";
|
|
829
829
|
return {
|
|
830
830
|
ruleId: violation.id,
|
|
831
|
-
wcagCriteria: violation.tags.find((t2) => t2.startsWith("wcag")) || "Unknown",
|
|
831
|
+
wcagCriteria: violation.tags.find((t2) => t2.startsWith("wcag")) || (violation.tags.includes("best-practice") ? "Best Practice" : "Unknown"),
|
|
832
832
|
en301549Criteria: "",
|
|
833
833
|
dosLagenReference: "",
|
|
834
834
|
diggRisk: risk,
|
|
@@ -891,25 +891,38 @@ var RegulatoryScanner = class {
|
|
|
891
891
|
}))
|
|
892
892
|
});
|
|
893
893
|
} else {
|
|
894
|
+
const isBestPractice = violation.tags.includes("best-practice");
|
|
895
|
+
const riskLevel = isBestPractice ? "low" : "medium";
|
|
896
|
+
const FALLBACK_STRINGS = {
|
|
897
|
+
sv: { bestPracticeRef: "Rekommendation (ej lagkrav)", manualRef: "Kr\xE4ver manuell bed\xF6mning", bestPracticeRationale: "Best practice \u2014 rekommenderas f\xF6r b\xE4ttre tillg\xE4nglighet men \xE4r inget specifikt WCAG-krav.", unmappedRationale: "Detta fel uppt\xE4cktes av scannern men saknar specifik mappning i HolmDigital-databasen." },
|
|
898
|
+
no: { bestPracticeRef: "Anbefaling (ikke lovkrav)", manualRef: "Krever manuell vurdering", bestPracticeRationale: "Best practice \u2014 anbefales for bedre tilgjengelighet, men er ikke et spesifikt WCAG-krav.", unmappedRationale: "Denne feilen ble oppdaget av skanneren, men mangler spesifikk kartlegging i HolmDigital-databasen." },
|
|
899
|
+
fi: { bestPracticeRef: "Suositus (ei lakis\xE4\xE4teinen)", manualRef: "Vaatii manuaalisen arvioinnin", bestPracticeRationale: "Best practice \u2014 suositellaan paremman saavutettavuuden vuoksi, mutta ei ole erityinen WCAG-vaatimus.", unmappedRationale: "T\xE4m\xE4 virhe havaittiin skannerilla, mutta sille ei ole tarkkaa kartoitusta HolmDigital-tietokannassa." },
|
|
900
|
+
de: { bestPracticeRef: "Empfehlung (keine gesetzliche Pflicht)", manualRef: "Erfordert manuelle Bewertung", bestPracticeRationale: "Best Practice \u2014 empfohlen f\xFCr bessere Barrierefreiheit, aber keine spezifische WCAG-Anforderung.", unmappedRationale: "Dieser Fehler wurde vom Scanner erkannt, hat aber keine spezifische Zuordnung in der HolmDigital-Datenbank." },
|
|
901
|
+
fr: { bestPracticeRef: "Recommandation (non obligatoire)", manualRef: "N\xE9cessite une \xE9valuation manuelle", bestPracticeRationale: "Bonne pratique \u2014 recommand\xE9e pour une meilleure accessibilit\xE9, mais pas une exigence WCAG sp\xE9cifique.", unmappedRationale: "Cette erreur a \xE9t\xE9 d\xE9tect\xE9e par le scanner mais n'a pas de correspondance sp\xE9cifique dans la base HolmDigital." },
|
|
902
|
+
es: { bestPracticeRef: "Recomendaci\xF3n (no obligatorio)", manualRef: "Requiere evaluaci\xF3n manual", bestPracticeRationale: "Buena pr\xE1ctica \u2014 recomendada para mejor accesibilidad, pero no es un requisito WCAG espec\xEDfico.", unmappedRationale: "Este error fue detectado por el esc\xE1ner pero no tiene una correspondencia espec\xEDfica en la base de datos de HolmDigital." },
|
|
903
|
+
nl: { bestPracticeRef: "Aanbeveling (geen wettelijke verplichting)", manualRef: "Vereist handmatige beoordeling", bestPracticeRationale: "Best practice \u2014 aanbevolen voor betere toegankelijkheid, maar geen specifieke WCAG-eis.", unmappedRationale: "Deze fout is gedetecteerd door de scanner maar heeft geen specifieke toewijzing in de HolmDigital-database." },
|
|
904
|
+
da: { bestPracticeRef: "Anbefaling (ikke lovkrav)", manualRef: "Kr\xE6ver manuel vurdering", bestPracticeRationale: "Best practice \u2014 anbefales for bedre tilg\xE6ngelighed, men er ikke et specifikt WCAG-krav.", unmappedRationale: "Denne fejl blev opdaget af scanneren, men mangler specifik kortl\xE6gning i HolmDigital-databasen." },
|
|
905
|
+
en: { bestPracticeRef: "Recommendation (not a legal requirement)", manualRef: "Requires manual assessment", bestPracticeRationale: "Best practice \u2014 recommended for better accessibility but not a specific WCAG requirement.", unmappedRationale: "This issue was detected by the scanner but has no specific mapping in the HolmDigital database." }
|
|
906
|
+
};
|
|
907
|
+
const fallback = FALLBACK_STRINGS[lang] || FALLBACK_STRINGS["en"];
|
|
894
908
|
reports.push({
|
|
895
909
|
ruleId: violation.id,
|
|
896
|
-
wcagCriteria: "Unknown",
|
|
897
|
-
en301549Criteria: "Unknown",
|
|
898
|
-
dosLagenReference:
|
|
899
|
-
diggRisk:
|
|
900
|
-
|
|
901
|
-
eaaImpact: "medium",
|
|
910
|
+
wcagCriteria: isBestPractice ? "Best Practice" : "Unknown",
|
|
911
|
+
en301549Criteria: isBestPractice ? "N/A" : "Unknown",
|
|
912
|
+
dosLagenReference: isBestPractice ? fallback.bestPracticeRef : fallback.manualRef,
|
|
913
|
+
diggRisk: riskLevel,
|
|
914
|
+
eaaImpact: riskLevel,
|
|
902
915
|
remediation: {
|
|
903
916
|
description: violation.help,
|
|
904
917
|
technicalGuidance: violation.description,
|
|
905
918
|
component: void 0
|
|
906
919
|
},
|
|
907
920
|
holmdigitalInsight: {
|
|
908
|
-
diggRisk:
|
|
909
|
-
eaaImpact:
|
|
921
|
+
diggRisk: riskLevel,
|
|
922
|
+
eaaImpact: riskLevel,
|
|
910
923
|
reasoning: violation.help,
|
|
911
924
|
swedishInterpretation: violation.help,
|
|
912
|
-
priorityRationale:
|
|
925
|
+
priorityRationale: isBestPractice ? fallback.bestPracticeRationale : fallback.unmappedRationale
|
|
913
926
|
},
|
|
914
927
|
testability: {
|
|
915
928
|
automated: true,
|
|
@@ -1330,12 +1343,29 @@ async function generateStatementContent(result, lang = "en", format = "html", me
|
|
|
1330
1343
|
"{<tiers externe>}": props.generatorTool?.name || "HolmDigital Engine",
|
|
1331
1344
|
"{<tercero externo>}": props.generatorTool?.name || "HolmDigital Engine",
|
|
1332
1345
|
"{<third party>}": props.generatorTool?.name || "HolmDigital Engine",
|
|
1333
|
-
"{<enforcement_body>}": (
|
|
1346
|
+
"{<enforcement_body>}": (() => {
|
|
1347
|
+
if (country === "US") {
|
|
1348
|
+
const adaLaw = (0, import_standards.getNationalLaws)("US").find((l) => l.euFramework === "ADA" && l.scope === sector);
|
|
1349
|
+
if (adaLaw) return adaLaw.enforcement.authorityName;
|
|
1350
|
+
}
|
|
1351
|
+
return (0, import_standards.getEnforcementBody)(country, sector);
|
|
1352
|
+
})(),
|
|
1334
1353
|
"{<national_law>}": (() => {
|
|
1335
1354
|
if (country === "AU") {
|
|
1336
1355
|
const ddaLaw = (0, import_standards.getNationalLawByFramework)("DDA", "AU");
|
|
1337
1356
|
return ddaLaw ? `${ddaLaw.fullName}` : "Disability Discrimination Act 1992 (Cth)";
|
|
1338
1357
|
}
|
|
1358
|
+
if (country === "US") {
|
|
1359
|
+
const usLaws = (0, import_standards.getNationalLaws)("US");
|
|
1360
|
+
const adaLaw = usLaws.find((l) => l.euFramework === "ADA" && l.scope === sector);
|
|
1361
|
+
if (adaLaw) {
|
|
1362
|
+
if (sector === "public") {
|
|
1363
|
+
const s508 = usLaws.find((l) => l.id === "us-508");
|
|
1364
|
+
return s508 ? `${adaLaw.fullName} (${adaLaw.law}) & ${s508.fullName} (${s508.law})` : `${adaLaw.fullName} (${adaLaw.law})`;
|
|
1365
|
+
}
|
|
1366
|
+
return `${adaLaw.fullName} (${adaLaw.law})`;
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1339
1369
|
const law = (0, import_standards.getNationalLawByFramework)(sector === "private" ? "EAA" : "WAD", country);
|
|
1340
1370
|
return law ? `${law.fullName} (${law.law})` : "";
|
|
1341
1371
|
})(),
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"title": "Accessibility of {<website>}",
|
|
3
|
-
"intro": "This website is run by {<organisation>}. We want as many people as possible to be able to use it, and this document describes how {<website>} complies with
|
|
3
|
+
"intro": "This website is run by {<organisation>}. We want as many people as possible to be able to use it, and this document describes how {<website>} complies with {<national_law>}, any known accessibility issues, and how you can report problems so that we can fix them.",
|
|
4
4
|
"sections": [
|
|
5
5
|
{
|
|
6
6
|
"id": "how-accessible",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
{
|
|
21
21
|
"id": "enforcement",
|
|
22
22
|
"title": "Enforcement procedure",
|
|
23
|
-
"content": "The {<enforcement_body>} is responsible for enforcing
|
|
23
|
+
"content": "The {<enforcement_body>} is responsible for enforcing {<national_law>}. If you experience accessibility issues on our website, you can submit a complaint to {<enforcement_body>}.\n\nYou can also file a complaint with {<enforcement_body>} if you believe our website does not comply with the applicable law, or if your request for accessible content has not been handled appropriately."
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"id": "technical",
|