@holmdigital/engine 2.10.0 → 2.11.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/dist/{chunk-KGUYOQMY.mjs → chunk-CE5CPK4U.mjs} +18 -9
- package/dist/chunk-IMRWWO5R.mjs +66 -0
- package/dist/{chunk-O5RJOSBZ.mjs → chunk-RVJPW54H.mjs} +2 -2
- package/dist/cli/index.js +106 -65
- package/dist/cli/index.mjs +35 -52
- package/dist/{i18n-BXFF6TW2.mjs → i18n-7WMKI7JK.mjs} +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +19 -10
- package/dist/index.mjs +2 -2
- package/dist/{plain-report-AWMBH6TM.mjs → plain-report-WIL7FGCM.mjs} +9 -4
- package/package.json +8 -8
- package/dist/chunk-VNNYP4NV.mjs +0 -26
|
@@ -59,7 +59,8 @@ var en_default = {
|
|
|
59
59
|
occurrences: "{count} occurrences",
|
|
60
60
|
gate_blocked: "Plain-language (klarspr\xE5k) output is not yet available in '{lang}'.",
|
|
61
61
|
gate_supported: "Languages with klarspr\xE5k: {langs}.",
|
|
62
|
-
gate_howto: "Run without --plain for the developer report, or use a supported language (e.g. --lang sv)."
|
|
62
|
+
gate_howto: "Run without --plain for the developer report, or use a supported language (e.g. --lang sv).",
|
|
63
|
+
gate_fallback: "Plain language is not yet available in {lang}, so this report is shown in English. We add languages one country at a time."
|
|
63
64
|
}
|
|
64
65
|
};
|
|
65
66
|
|
|
@@ -124,7 +125,8 @@ var sv_default = {
|
|
|
124
125
|
occurrences: "{count} f\xF6rekomster",
|
|
125
126
|
gate_blocked: "Klarspr\xE5k st\xF6ds \xE4nnu inte p\xE5 '{lang}'.",
|
|
126
127
|
gate_supported: "Spr\xE5k med klarspr\xE5k: {langs}.",
|
|
127
|
-
gate_howto: "K\xF6r utan --plain f\xF6r utvecklarrapporten, eller v\xE4lj ett spr\xE5k som st\xF6ds (t.ex. --lang sv)."
|
|
128
|
+
gate_howto: "K\xF6r utan --plain f\xF6r utvecklarrapporten, eller v\xE4lj ett spr\xE5k som st\xF6ds (t.ex. --lang sv).",
|
|
129
|
+
gate_fallback: "Klarspr\xE5k finns \xE4nnu inte p\xE5 {lang}, s\xE5 den h\xE4r rapporten visas p\xE5 engelska. Vi l\xE4gger till spr\xE5k land f\xF6r land."
|
|
128
130
|
}
|
|
129
131
|
};
|
|
130
132
|
|
|
@@ -189,7 +191,8 @@ var de_default = {
|
|
|
189
191
|
occurrences: "{count} occurrences",
|
|
190
192
|
gate_blocked: "Verst\xE4ndliche Sprache (Klarspr\xE5k) ist f\xFCr '{lang}' noch nicht verf\xFCgbar.",
|
|
191
193
|
gate_supported: "Sprachen mit verst\xE4ndlicher Sprache: {langs}.",
|
|
192
|
-
gate_howto: "Ohne --plain ausf\xFChren f\xFCr den Entwicklerbericht, oder eine unterst\xFCtzte Sprache verwenden (z. B. --lang sv)."
|
|
194
|
+
gate_howto: "Ohne --plain ausf\xFChren f\xFCr den Entwicklerbericht, oder eine unterst\xFCtzte Sprache verwenden (z. B. --lang sv).",
|
|
195
|
+
gate_fallback: "Einfache Sprache ist f\xFCr {lang} noch nicht verf\xFCgbar, daher wird dieser Bericht auf Englisch angezeigt. Wir erg\xE4nzen Sprachen Land f\xFCr Land."
|
|
193
196
|
}
|
|
194
197
|
};
|
|
195
198
|
|
|
@@ -254,7 +257,8 @@ var fr_default = {
|
|
|
254
257
|
occurrences: "{count} occurrences",
|
|
255
258
|
gate_blocked: "Le langage clair (klarspr\xE5k) n'est pas encore disponible en \xAB {lang} \xBB.",
|
|
256
259
|
gate_supported: "Langues avec langage clair : {langs}.",
|
|
257
|
-
gate_howto: "Lancez sans --plain pour le rapport d\xE9veloppeur, ou utilisez une langue prise en charge (par ex. --lang sv)."
|
|
260
|
+
gate_howto: "Lancez sans --plain pour le rapport d\xE9veloppeur, ou utilisez une langue prise en charge (par ex. --lang sv).",
|
|
261
|
+
gate_fallback: "Le langage clair n\u2019est pas encore disponible en {lang}, ce rapport est donc affich\xE9 en anglais. Nous ajoutons les langues pays par pays."
|
|
258
262
|
}
|
|
259
263
|
};
|
|
260
264
|
|
|
@@ -319,7 +323,8 @@ var es_default = {
|
|
|
319
323
|
occurrences: "{count} occurrences",
|
|
320
324
|
gate_blocked: "El lenguaje claro (klarspr\xE5k) a\xFAn no est\xE1 disponible en '{lang}'.",
|
|
321
325
|
gate_supported: "Idiomas con lenguaje claro: {langs}.",
|
|
322
|
-
gate_howto: "Ejecuta sin --plain para el informe para desarrolladores, o usa un idioma compatible (p. ej. --lang sv)."
|
|
326
|
+
gate_howto: "Ejecuta sin --plain para el informe para desarrolladores, o usa un idioma compatible (p. ej. --lang sv).",
|
|
327
|
+
gate_fallback: "El lenguaje claro a\xFAn no est\xE1 disponible en {lang}, por lo que este informe se muestra en ingl\xE9s. A\xF1adimos idiomas pa\xEDs por pa\xEDs."
|
|
323
328
|
}
|
|
324
329
|
};
|
|
325
330
|
|
|
@@ -384,7 +389,8 @@ var fi_default = {
|
|
|
384
389
|
occurrences: "{count} occurrences",
|
|
385
390
|
gate_blocked: "Selkokielinen (klarspr\xE5k) raportti ei ole viel\xE4 saatavilla kielell\xE4 '{lang}'.",
|
|
386
391
|
gate_supported: "Kielet, joilla selkokielinen raportti on saatavilla: {langs}.",
|
|
387
|
-
gate_howto: "Aja ilman --plain-valitsinta kehitt\xE4j\xE4raporttia varten tai k\xE4yt\xE4 tuettua kielt\xE4 (esim. --lang sv)."
|
|
392
|
+
gate_howto: "Aja ilman --plain-valitsinta kehitt\xE4j\xE4raporttia varten tai k\xE4yt\xE4 tuettua kielt\xE4 (esim. --lang sv).",
|
|
393
|
+
gate_fallback: "Selkokieli ei ole viel\xE4 saatavilla kielell\xE4 {lang}, joten t\xE4m\xE4 raportti n\xE4ytet\xE4\xE4n englanniksi. Lis\xE4\xE4mme kieli\xE4 maa kerrallaan."
|
|
388
394
|
}
|
|
389
395
|
};
|
|
390
396
|
|
|
@@ -449,7 +455,8 @@ var dk_default = {
|
|
|
449
455
|
occurrences: "{count} occurrences",
|
|
450
456
|
gate_blocked: "Klarsprog (klarspr\xE5k) er endnu ikke tilg\xE6ngeligt p\xE5 '{lang}'.",
|
|
451
457
|
gate_supported: "Sprog med klarsprog: {langs}.",
|
|
452
|
-
gate_howto: "K\xF8r uden --plain for udviklerrapporten, eller brug et underst\xF8ttet sprog (f.eks. --lang sv)."
|
|
458
|
+
gate_howto: "K\xF8r uden --plain for udviklerrapporten, eller brug et underst\xF8ttet sprog (f.eks. --lang sv).",
|
|
459
|
+
gate_fallback: "Klarsprog er endnu ikke tilg\xE6ngeligt p\xE5 {lang}, s\xE5 denne rapport vises p\xE5 engelsk. Vi tilf\xF8jer sprog land for land."
|
|
453
460
|
}
|
|
454
461
|
};
|
|
455
462
|
|
|
@@ -514,7 +521,8 @@ var no_default = {
|
|
|
514
521
|
occurrences: "{count} occurrences",
|
|
515
522
|
gate_blocked: "Klarspr\xE5k er enn\xE5 ikke tilgjengelig p\xE5 '{lang}'.",
|
|
516
523
|
gate_supported: "Spr\xE5k med klarspr\xE5k: {langs}.",
|
|
517
|
-
gate_howto: "Kj\xF8r uten --plain for utviklerrapporten, eller bruk et st\xF8ttet spr\xE5k (f.eks. --lang sv)."
|
|
524
|
+
gate_howto: "Kj\xF8r uten --plain for utviklerrapporten, eller bruk et st\xF8ttet spr\xE5k (f.eks. --lang sv).",
|
|
525
|
+
gate_fallback: "Klarspr\xE5k er enn\xE5 ikke tilgjengelig p\xE5 {lang}, s\xE5 denne rapporten vises p\xE5 engelsk. Vi legger til spr\xE5k land for land."
|
|
518
526
|
}
|
|
519
527
|
};
|
|
520
528
|
|
|
@@ -579,7 +587,8 @@ var nl_default = {
|
|
|
579
587
|
occurrences: "{count} occurrences",
|
|
580
588
|
gate_blocked: "Begrijpelijke taal (klarspr\xE5k) is nog niet beschikbaar in '{lang}'.",
|
|
581
589
|
gate_supported: "Talen met begrijpelijke taal: {langs}.",
|
|
582
|
-
gate_howto: "Voer uit zonder --plain voor het ontwikkelaarsrapport, of gebruik een ondersteunde taal (bijv. --lang sv)."
|
|
590
|
+
gate_howto: "Voer uit zonder --plain voor het ontwikkelaarsrapport, of gebruik een ondersteunde taal (bijv. --lang sv).",
|
|
591
|
+
gate_fallback: "Duidelijke taal is nog niet beschikbaar in {lang}, daarom wordt dit rapport in het Engels getoond. We voegen talen land voor land toe."
|
|
583
592
|
}
|
|
584
593
|
};
|
|
585
594
|
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// src/reporting/plain-group.ts
|
|
2
|
+
function groupReportsByRule(reports) {
|
|
3
|
+
const groups = /* @__PURE__ */ new Map();
|
|
4
|
+
for (const report of reports) {
|
|
5
|
+
const existing = groups.get(report.ruleId);
|
|
6
|
+
if (existing) {
|
|
7
|
+
existing.count += 1;
|
|
8
|
+
} else {
|
|
9
|
+
groups.set(report.ruleId, { report, count: 1 });
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return [...groups.values()];
|
|
13
|
+
}
|
|
14
|
+
function impactBreakdown(reports, levelOf, order) {
|
|
15
|
+
const counts = /* @__PURE__ */ new Map();
|
|
16
|
+
for (const report of reports) {
|
|
17
|
+
const level = levelOf(report);
|
|
18
|
+
counts.set(level, (counts.get(level) ?? 0) + 1);
|
|
19
|
+
}
|
|
20
|
+
return [...counts.entries()].map(([level, count]) => ({ level, count })).sort((a, b) => (order[a.level] ?? 4) - (order[b.level] ?? 4));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// src/reporting/plain-language-support.ts
|
|
24
|
+
import { getAllConvergenceRules } from "@holmdigital/standards";
|
|
25
|
+
var PLAIN_LANGUAGE_CORE_RULES = [
|
|
26
|
+
"color-contrast",
|
|
27
|
+
"keyboard-accessible",
|
|
28
|
+
"alt-text",
|
|
29
|
+
"form-labels",
|
|
30
|
+
"link-purpose",
|
|
31
|
+
"language-of-page",
|
|
32
|
+
"name-role-value",
|
|
33
|
+
"landmark-one-main",
|
|
34
|
+
"heading-order",
|
|
35
|
+
"region",
|
|
36
|
+
"target-size"
|
|
37
|
+
];
|
|
38
|
+
function isEnglish(lang) {
|
|
39
|
+
return /^en(-|$)/i.test(lang.trim());
|
|
40
|
+
}
|
|
41
|
+
function isPlainLanguageSupported(lang) {
|
|
42
|
+
if (isEnglish(lang)) return true;
|
|
43
|
+
const byId = new Map(getAllConvergenceRules(lang).map((r) => [r.ruleId, r]));
|
|
44
|
+
return PLAIN_LANGUAGE_CORE_RULES.every((id) => Boolean(byId.get(id)?.plainLanguage?.headline));
|
|
45
|
+
}
|
|
46
|
+
var LANG_DISPLAY_NAME = {
|
|
47
|
+
de: "German",
|
|
48
|
+
fr: "French",
|
|
49
|
+
es: "Spanish",
|
|
50
|
+
nl: "Dutch",
|
|
51
|
+
no: "Norwegian",
|
|
52
|
+
nb: "Norwegian",
|
|
53
|
+
fi: "Finnish",
|
|
54
|
+
da: "Danish",
|
|
55
|
+
dk: "Danish"
|
|
56
|
+
};
|
|
57
|
+
function languageDisplayName(code) {
|
|
58
|
+
return LANG_DISPLAY_NAME[code.toLowerCase()] ?? code;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export {
|
|
62
|
+
groupReportsByRule,
|
|
63
|
+
impactBreakdown,
|
|
64
|
+
isPlainLanguageSupported,
|
|
65
|
+
languageDisplayName
|
|
66
|
+
};
|
|
@@ -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.11.0";
|
|
142
142
|
}
|
|
143
143
|
function getStandardsVersion() {
|
|
144
144
|
try {
|
|
@@ -330,7 +330,7 @@ var RegulatoryScanner = class {
|
|
|
330
330
|
async enrichResults(axeResults) {
|
|
331
331
|
const reports = [];
|
|
332
332
|
const { searchRulesByTags, generateRegulatoryReport, getConvergenceRule } = await import("@holmdigital/standards");
|
|
333
|
-
const { getCurrentLang } = await import("./i18n-
|
|
333
|
+
const { getCurrentLang } = await import("./i18n-7WMKI7JK.mjs");
|
|
334
334
|
const lang = getCurrentLang();
|
|
335
335
|
for (const violation of axeResults.violations) {
|
|
336
336
|
let report = generateRegulatoryReport(violation.id, lang);
|
package/dist/cli/index.js
CHANGED
|
@@ -101,7 +101,8 @@ var init_en = __esm({
|
|
|
101
101
|
occurrences: "{count} occurrences",
|
|
102
102
|
gate_blocked: "Plain-language (klarspr\xE5k) output is not yet available in '{lang}'.",
|
|
103
103
|
gate_supported: "Languages with klarspr\xE5k: {langs}.",
|
|
104
|
-
gate_howto: "Run without --plain for the developer report, or use a supported language (e.g. --lang sv)."
|
|
104
|
+
gate_howto: "Run without --plain for the developer report, or use a supported language (e.g. --lang sv).",
|
|
105
|
+
gate_fallback: "Plain language is not yet available in {lang}, so this report is shown in English. We add languages one country at a time."
|
|
105
106
|
}
|
|
106
107
|
};
|
|
107
108
|
}
|
|
@@ -171,7 +172,8 @@ var init_sv = __esm({
|
|
|
171
172
|
occurrences: "{count} f\xF6rekomster",
|
|
172
173
|
gate_blocked: "Klarspr\xE5k st\xF6ds \xE4nnu inte p\xE5 '{lang}'.",
|
|
173
174
|
gate_supported: "Spr\xE5k med klarspr\xE5k: {langs}.",
|
|
174
|
-
gate_howto: "K\xF6r utan --plain f\xF6r utvecklarrapporten, eller v\xE4lj ett spr\xE5k som st\xF6ds (t.ex. --lang sv)."
|
|
175
|
+
gate_howto: "K\xF6r utan --plain f\xF6r utvecklarrapporten, eller v\xE4lj ett spr\xE5k som st\xF6ds (t.ex. --lang sv).",
|
|
176
|
+
gate_fallback: "Klarspr\xE5k finns \xE4nnu inte p\xE5 {lang}, s\xE5 den h\xE4r rapporten visas p\xE5 engelska. Vi l\xE4gger till spr\xE5k land f\xF6r land."
|
|
175
177
|
}
|
|
176
178
|
};
|
|
177
179
|
}
|
|
@@ -241,7 +243,8 @@ var init_de = __esm({
|
|
|
241
243
|
occurrences: "{count} occurrences",
|
|
242
244
|
gate_blocked: "Verst\xE4ndliche Sprache (Klarspr\xE5k) ist f\xFCr '{lang}' noch nicht verf\xFCgbar.",
|
|
243
245
|
gate_supported: "Sprachen mit verst\xE4ndlicher Sprache: {langs}.",
|
|
244
|
-
gate_howto: "Ohne --plain ausf\xFChren f\xFCr den Entwicklerbericht, oder eine unterst\xFCtzte Sprache verwenden (z. B. --lang sv)."
|
|
246
|
+
gate_howto: "Ohne --plain ausf\xFChren f\xFCr den Entwicklerbericht, oder eine unterst\xFCtzte Sprache verwenden (z. B. --lang sv).",
|
|
247
|
+
gate_fallback: "Einfache Sprache ist f\xFCr {lang} noch nicht verf\xFCgbar, daher wird dieser Bericht auf Englisch angezeigt. Wir erg\xE4nzen Sprachen Land f\xFCr Land."
|
|
245
248
|
}
|
|
246
249
|
};
|
|
247
250
|
}
|
|
@@ -311,7 +314,8 @@ var init_fr = __esm({
|
|
|
311
314
|
occurrences: "{count} occurrences",
|
|
312
315
|
gate_blocked: "Le langage clair (klarspr\xE5k) n'est pas encore disponible en \xAB {lang} \xBB.",
|
|
313
316
|
gate_supported: "Langues avec langage clair : {langs}.",
|
|
314
|
-
gate_howto: "Lancez sans --plain pour le rapport d\xE9veloppeur, ou utilisez une langue prise en charge (par ex. --lang sv)."
|
|
317
|
+
gate_howto: "Lancez sans --plain pour le rapport d\xE9veloppeur, ou utilisez une langue prise en charge (par ex. --lang sv).",
|
|
318
|
+
gate_fallback: "Le langage clair n\u2019est pas encore disponible en {lang}, ce rapport est donc affich\xE9 en anglais. Nous ajoutons les langues pays par pays."
|
|
315
319
|
}
|
|
316
320
|
};
|
|
317
321
|
}
|
|
@@ -381,7 +385,8 @@ var init_es = __esm({
|
|
|
381
385
|
occurrences: "{count} occurrences",
|
|
382
386
|
gate_blocked: "El lenguaje claro (klarspr\xE5k) a\xFAn no est\xE1 disponible en '{lang}'.",
|
|
383
387
|
gate_supported: "Idiomas con lenguaje claro: {langs}.",
|
|
384
|
-
gate_howto: "Ejecuta sin --plain para el informe para desarrolladores, o usa un idioma compatible (p. ej. --lang sv)."
|
|
388
|
+
gate_howto: "Ejecuta sin --plain para el informe para desarrolladores, o usa un idioma compatible (p. ej. --lang sv).",
|
|
389
|
+
gate_fallback: "El lenguaje claro a\xFAn no est\xE1 disponible en {lang}, por lo que este informe se muestra en ingl\xE9s. A\xF1adimos idiomas pa\xEDs por pa\xEDs."
|
|
385
390
|
}
|
|
386
391
|
};
|
|
387
392
|
}
|
|
@@ -451,7 +456,8 @@ var init_fi = __esm({
|
|
|
451
456
|
occurrences: "{count} occurrences",
|
|
452
457
|
gate_blocked: "Selkokielinen (klarspr\xE5k) raportti ei ole viel\xE4 saatavilla kielell\xE4 '{lang}'.",
|
|
453
458
|
gate_supported: "Kielet, joilla selkokielinen raportti on saatavilla: {langs}.",
|
|
454
|
-
gate_howto: "Aja ilman --plain-valitsinta kehitt\xE4j\xE4raporttia varten tai k\xE4yt\xE4 tuettua kielt\xE4 (esim. --lang sv)."
|
|
459
|
+
gate_howto: "Aja ilman --plain-valitsinta kehitt\xE4j\xE4raporttia varten tai k\xE4yt\xE4 tuettua kielt\xE4 (esim. --lang sv).",
|
|
460
|
+
gate_fallback: "Selkokieli ei ole viel\xE4 saatavilla kielell\xE4 {lang}, joten t\xE4m\xE4 raportti n\xE4ytet\xE4\xE4n englanniksi. Lis\xE4\xE4mme kieli\xE4 maa kerrallaan."
|
|
455
461
|
}
|
|
456
462
|
};
|
|
457
463
|
}
|
|
@@ -521,7 +527,8 @@ var init_dk = __esm({
|
|
|
521
527
|
occurrences: "{count} occurrences",
|
|
522
528
|
gate_blocked: "Klarsprog (klarspr\xE5k) er endnu ikke tilg\xE6ngeligt p\xE5 '{lang}'.",
|
|
523
529
|
gate_supported: "Sprog med klarsprog: {langs}.",
|
|
524
|
-
gate_howto: "K\xF8r uden --plain for udviklerrapporten, eller brug et underst\xF8ttet sprog (f.eks. --lang sv)."
|
|
530
|
+
gate_howto: "K\xF8r uden --plain for udviklerrapporten, eller brug et underst\xF8ttet sprog (f.eks. --lang sv).",
|
|
531
|
+
gate_fallback: "Klarsprog er endnu ikke tilg\xE6ngeligt p\xE5 {lang}, s\xE5 denne rapport vises p\xE5 engelsk. Vi tilf\xF8jer sprog land for land."
|
|
525
532
|
}
|
|
526
533
|
};
|
|
527
534
|
}
|
|
@@ -591,7 +598,8 @@ var init_no = __esm({
|
|
|
591
598
|
occurrences: "{count} occurrences",
|
|
592
599
|
gate_blocked: "Klarspr\xE5k er enn\xE5 ikke tilgjengelig p\xE5 '{lang}'.",
|
|
593
600
|
gate_supported: "Spr\xE5k med klarspr\xE5k: {langs}.",
|
|
594
|
-
gate_howto: "Kj\xF8r uten --plain for utviklerrapporten, eller bruk et st\xF8ttet spr\xE5k (f.eks. --lang sv)."
|
|
601
|
+
gate_howto: "Kj\xF8r uten --plain for utviklerrapporten, eller bruk et st\xF8ttet spr\xE5k (f.eks. --lang sv).",
|
|
602
|
+
gate_fallback: "Klarspr\xE5k er enn\xE5 ikke tilgjengelig p\xE5 {lang}, s\xE5 denne rapporten vises p\xE5 engelsk. Vi legger til spr\xE5k land for land."
|
|
595
603
|
}
|
|
596
604
|
};
|
|
597
605
|
}
|
|
@@ -661,7 +669,8 @@ var init_nl = __esm({
|
|
|
661
669
|
occurrences: "{count} occurrences",
|
|
662
670
|
gate_blocked: "Begrijpelijke taal (klarspr\xE5k) is nog niet beschikbaar in '{lang}'.",
|
|
663
671
|
gate_supported: "Talen met begrijpelijke taal: {langs}.",
|
|
664
|
-
gate_howto: "Voer uit zonder --plain voor het ontwikkelaarsrapport, of gebruik een ondersteunde taal (bijv. --lang sv)."
|
|
672
|
+
gate_howto: "Voer uit zonder --plain voor het ontwikkelaarsrapport, of gebruik een ondersteunde taal (bijv. --lang sv).",
|
|
673
|
+
gate_fallback: "Duidelijke taal is nog niet beschikbaar in {lang}, daarom wordt dit rapport in het Engels getoond. We voegen talen land voor land toe."
|
|
665
674
|
}
|
|
666
675
|
};
|
|
667
676
|
}
|
|
@@ -776,6 +785,51 @@ var init_plain_group = __esm({
|
|
|
776
785
|
}
|
|
777
786
|
});
|
|
778
787
|
|
|
788
|
+
// src/reporting/plain-language-support.ts
|
|
789
|
+
function isEnglish(lang) {
|
|
790
|
+
return /^en(-|$)/i.test(lang.trim());
|
|
791
|
+
}
|
|
792
|
+
function isPlainLanguageSupported(lang) {
|
|
793
|
+
if (isEnglish(lang)) return true;
|
|
794
|
+
const byId = new Map((0, import_standards.getAllConvergenceRules)(lang).map((r) => [r.ruleId, r]));
|
|
795
|
+
return PLAIN_LANGUAGE_CORE_RULES.every((id) => Boolean(byId.get(id)?.plainLanguage?.headline));
|
|
796
|
+
}
|
|
797
|
+
function languageDisplayName(code) {
|
|
798
|
+
return LANG_DISPLAY_NAME[code.toLowerCase()] ?? code;
|
|
799
|
+
}
|
|
800
|
+
var import_standards, PLAIN_LANGUAGE_CORE_RULES, LANG_DISPLAY_NAME;
|
|
801
|
+
var init_plain_language_support = __esm({
|
|
802
|
+
"src/reporting/plain-language-support.ts"() {
|
|
803
|
+
"use strict";
|
|
804
|
+
init_cjs_shims();
|
|
805
|
+
import_standards = require("@holmdigital/standards");
|
|
806
|
+
PLAIN_LANGUAGE_CORE_RULES = [
|
|
807
|
+
"color-contrast",
|
|
808
|
+
"keyboard-accessible",
|
|
809
|
+
"alt-text",
|
|
810
|
+
"form-labels",
|
|
811
|
+
"link-purpose",
|
|
812
|
+
"language-of-page",
|
|
813
|
+
"name-role-value",
|
|
814
|
+
"landmark-one-main",
|
|
815
|
+
"heading-order",
|
|
816
|
+
"region",
|
|
817
|
+
"target-size"
|
|
818
|
+
];
|
|
819
|
+
LANG_DISPLAY_NAME = {
|
|
820
|
+
de: "German",
|
|
821
|
+
fr: "French",
|
|
822
|
+
es: "Spanish",
|
|
823
|
+
nl: "Dutch",
|
|
824
|
+
no: "Norwegian",
|
|
825
|
+
nb: "Norwegian",
|
|
826
|
+
fi: "Finnish",
|
|
827
|
+
da: "Danish",
|
|
828
|
+
dk: "Danish"
|
|
829
|
+
};
|
|
830
|
+
}
|
|
831
|
+
});
|
|
832
|
+
|
|
779
833
|
// src/reporting/plain-report.ts
|
|
780
834
|
var plain_report_exports = {};
|
|
781
835
|
__export(plain_report_exports, {
|
|
@@ -784,8 +838,12 @@ __export(plain_report_exports, {
|
|
|
784
838
|
function levelOf(report) {
|
|
785
839
|
return report.plainLanguage?.impactLevel ?? RISK_TO_IMPACT[report.holmdigitalInsight.diggRisk] ?? "putsning";
|
|
786
840
|
}
|
|
787
|
-
function renderPlainReport(result, lang = "en") {
|
|
841
|
+
function renderPlainReport(result, lang = "en", plainFallbackFrom) {
|
|
788
842
|
setLanguage(lang);
|
|
843
|
+
if (plainFallbackFrom) {
|
|
844
|
+
console.log(import_chalk.default.yellow(t("plain.gate_fallback", { lang: languageDisplayName(plainFallbackFrom) })));
|
|
845
|
+
console.log("");
|
|
846
|
+
}
|
|
789
847
|
if (result.reports.length === 0) {
|
|
790
848
|
console.log(t("plain.empty_state"));
|
|
791
849
|
console.log("");
|
|
@@ -839,6 +897,7 @@ var init_plain_report = __esm({
|
|
|
839
897
|
import_chalk = __toESM(require("chalk"));
|
|
840
898
|
init_i18n();
|
|
841
899
|
init_plain_group();
|
|
900
|
+
init_plain_language_support();
|
|
842
901
|
IMPACT_ORDER = {
|
|
843
902
|
"stoppar-kop": 0,
|
|
844
903
|
"hindrar": 1,
|
|
@@ -1126,7 +1185,7 @@ var HtmlValidator = class {
|
|
|
1126
1185
|
// src/core/regulatory-scanner.ts
|
|
1127
1186
|
var import_node_fs = require("fs");
|
|
1128
1187
|
function getEngineVersion() {
|
|
1129
|
-
return "2.
|
|
1188
|
+
return "2.11.0";
|
|
1130
1189
|
}
|
|
1131
1190
|
function getStandardsVersion() {
|
|
1132
1191
|
try {
|
|
@@ -1558,6 +1617,7 @@ function generateBadgeMarkdown(score) {
|
|
|
1558
1617
|
// src/reporting/html-template.ts
|
|
1559
1618
|
init_i18n();
|
|
1560
1619
|
init_plain_group();
|
|
1620
|
+
init_plain_language_support();
|
|
1561
1621
|
var LOCALE_TO_INTL = {
|
|
1562
1622
|
sv: "sv-SE",
|
|
1563
1623
|
en: "en-US",
|
|
@@ -1587,9 +1647,9 @@ function formatDate(dateString) {
|
|
|
1587
1647
|
function escapeHtml(str) {
|
|
1588
1648
|
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
1589
1649
|
}
|
|
1590
|
-
function generateReportHTML(result, sector = "public", audience = "developer") {
|
|
1650
|
+
function generateReportHTML(result, sector = "public", audience = "developer", plainFallbackFrom) {
|
|
1591
1651
|
if (audience === "plain") {
|
|
1592
|
-
return generatePlainReportHTML(result);
|
|
1652
|
+
return generatePlainReportHTML(result, plainFallbackFrom);
|
|
1593
1653
|
}
|
|
1594
1654
|
const criticalCount = result.stats.critical;
|
|
1595
1655
|
const highCount = result.stats.high;
|
|
@@ -1918,10 +1978,12 @@ function getLogoDataUri() {
|
|
|
1918
1978
|
cachedLogoDataUri = "";
|
|
1919
1979
|
return cachedLogoDataUri;
|
|
1920
1980
|
}
|
|
1921
|
-
function generatePlainReportHTML(result) {
|
|
1981
|
+
function generatePlainReportHTML(result, plainFallbackFrom) {
|
|
1922
1982
|
const lang = getCurrentLang();
|
|
1923
1983
|
const safeUrl = escapeHtml(result.url);
|
|
1924
1984
|
const logoDataUri = getLogoDataUri();
|
|
1985
|
+
const fallbackName = plainFallbackFrom ? languageDisplayName(plainFallbackFrom) : "";
|
|
1986
|
+
const noticeHtml = fallbackName ? `<p class="plain-fallback-notice">${escapeHtml(t("plain.gate_fallback", { lang: fallbackName }))}</p>` : "";
|
|
1925
1987
|
const sortedGroups = groupReportsByRule(result.reports).sort((a, b) => {
|
|
1926
1988
|
const aLevel = PLAIN_IMPACT_ORDER[plainLevelOf(a.report)] ?? 4;
|
|
1927
1989
|
const bLevel = PLAIN_IMPACT_ORDER[plainLevelOf(b.report)] ?? 4;
|
|
@@ -2060,6 +2122,23 @@ ${sortedGroups.map((group) => {
|
|
|
2060
2122
|
color: #0f172a;
|
|
2061
2123
|
}
|
|
2062
2124
|
|
|
2125
|
+
/* ---- Fallback notice: calm, informational banner shown when the report
|
|
2126
|
+
is served in English because the requested language is not yet
|
|
2127
|
+
covered. Amber note, not an error. ---- */
|
|
2128
|
+
.plain-fallback-notice {
|
|
2129
|
+
background: #fffbeb;
|
|
2130
|
+
border: 1px solid #fde68a;
|
|
2131
|
+
border-left: 4px solid #d97706;
|
|
2132
|
+
border-radius: 8px;
|
|
2133
|
+
padding: 0.85rem 1.1rem;
|
|
2134
|
+
margin-bottom: 1.6rem;
|
|
2135
|
+
font-size: 0.85rem;
|
|
2136
|
+
color: #713f12;
|
|
2137
|
+
line-height: 1.55;
|
|
2138
|
+
-webkit-print-color-adjust: exact;
|
|
2139
|
+
print-color-adjust: exact;
|
|
2140
|
+
}
|
|
2141
|
+
|
|
2063
2142
|
/* ---- Issue list ---- */
|
|
2064
2143
|
.issue-list {
|
|
2065
2144
|
list-style: none;
|
|
@@ -2195,6 +2274,7 @@ ${sortedGroups.map((group) => {
|
|
|
2195
2274
|
</header>
|
|
2196
2275
|
|
|
2197
2276
|
<div class="report-body">
|
|
2277
|
+
${noticeHtml}
|
|
2198
2278
|
<div class="intro">
|
|
2199
2279
|
<p>${t("plain.intro_framing")}</p>
|
|
2200
2280
|
<p>${t("plain.intro_found", { count, unit })}</p>
|
|
@@ -2249,7 +2329,7 @@ init_cjs_shims();
|
|
|
2249
2329
|
var import_react = __toESM(require("react"));
|
|
2250
2330
|
var import_server = require("react-dom/server");
|
|
2251
2331
|
var import_components = require("@holmdigital/components");
|
|
2252
|
-
var
|
|
2332
|
+
var import_standards2 = require("@holmdigital/standards");
|
|
2253
2333
|
var import_promises = __toESM(require("fs/promises"));
|
|
2254
2334
|
var import_path = __toESM(require("path"));
|
|
2255
2335
|
var EVALUATION_METHOD = {
|
|
@@ -2499,18 +2579,18 @@ async function generateStatementContent(result, lang = "en", format = "html", me
|
|
|
2499
2579
|
"{<third party>}": props.generatorTool?.name || "HolmDigital Engine",
|
|
2500
2580
|
"{<enforcement_body>}": (() => {
|
|
2501
2581
|
if (country === "US") {
|
|
2502
|
-
const adaLaw = (0,
|
|
2582
|
+
const adaLaw = (0, import_standards2.getNationalLaws)("US").find((l) => l.euFramework === "ADA" && l.scope === sector);
|
|
2503
2583
|
if (adaLaw) return adaLaw.enforcement.authorityName;
|
|
2504
2584
|
}
|
|
2505
|
-
return (0,
|
|
2585
|
+
return (0, import_standards2.getEnforcementBody)(country, sector);
|
|
2506
2586
|
})(),
|
|
2507
2587
|
"{<national_law>}": (() => {
|
|
2508
2588
|
if (country === "AU") {
|
|
2509
|
-
const ddaLaw = (0,
|
|
2589
|
+
const ddaLaw = (0, import_standards2.getNationalLawByFramework)("DDA", "AU");
|
|
2510
2590
|
return ddaLaw ? `${ddaLaw.fullName}` : "Disability Discrimination Act 1992 (Cth)";
|
|
2511
2591
|
}
|
|
2512
2592
|
if (country === "US") {
|
|
2513
|
-
const usLaws = (0,
|
|
2593
|
+
const usLaws = (0, import_standards2.getNationalLaws)("US");
|
|
2514
2594
|
const adaLaw = usLaws.find((l) => l.euFramework === "ADA" && l.scope === sector);
|
|
2515
2595
|
if (adaLaw) {
|
|
2516
2596
|
if (sector === "public") {
|
|
@@ -2521,7 +2601,7 @@ async function generateStatementContent(result, lang = "en", format = "html", me
|
|
|
2521
2601
|
return hhs504 ? `${adaLaw.fullName} (${adaLaw.law}) & ${hhs504.fullName} (${hhs504.law})` : `${adaLaw.fullName} (${adaLaw.law})`;
|
|
2522
2602
|
}
|
|
2523
2603
|
}
|
|
2524
|
-
const law = (0,
|
|
2604
|
+
const law = (0, import_standards2.getNationalLawByFramework)(sector === "private" ? "EAA" : "WAD", country);
|
|
2525
2605
|
return law ? `${law.fullName} (${law.law})` : "";
|
|
2526
2606
|
})(),
|
|
2527
2607
|
"{<ahrc_url>}": "https://www.humanrights.gov.au/complaints",
|
|
@@ -2591,45 +2671,7 @@ async function generateStatement(result, outputPath, lang = "en", format = "html
|
|
|
2591
2671
|
|
|
2592
2672
|
// src/cli/index.ts
|
|
2593
2673
|
init_i18n();
|
|
2594
|
-
|
|
2595
|
-
// src/reporting/plain-language-support.ts
|
|
2596
|
-
init_cjs_shims();
|
|
2597
|
-
var import_standards2 = require("@holmdigital/standards");
|
|
2598
|
-
var PLAIN_LANGUAGE_CORE_RULES = [
|
|
2599
|
-
"color-contrast",
|
|
2600
|
-
"keyboard-accessible",
|
|
2601
|
-
"alt-text",
|
|
2602
|
-
"form-labels",
|
|
2603
|
-
"link-purpose",
|
|
2604
|
-
"language-of-page",
|
|
2605
|
-
"name-role-value",
|
|
2606
|
-
"landmark-one-main",
|
|
2607
|
-
"heading-order",
|
|
2608
|
-
"region",
|
|
2609
|
-
"target-size"
|
|
2610
|
-
];
|
|
2611
|
-
var CANDIDATE_LANGS = [
|
|
2612
|
-
"en",
|
|
2613
|
-
"sv",
|
|
2614
|
-
"de",
|
|
2615
|
-
"fr",
|
|
2616
|
-
"es",
|
|
2617
|
-
"nl",
|
|
2618
|
-
"no",
|
|
2619
|
-
"fi",
|
|
2620
|
-
"da"
|
|
2621
|
-
];
|
|
2622
|
-
function isEnglish(lang) {
|
|
2623
|
-
return /^en(-|$)/i.test(lang.trim());
|
|
2624
|
-
}
|
|
2625
|
-
function isPlainLanguageSupported(lang) {
|
|
2626
|
-
if (isEnglish(lang)) return true;
|
|
2627
|
-
const byId = new Map((0, import_standards2.getAllConvergenceRules)(lang).map((r) => [r.ruleId, r]));
|
|
2628
|
-
return PLAIN_LANGUAGE_CORE_RULES.every((id) => Boolean(byId.get(id)?.plainLanguage?.headline));
|
|
2629
|
-
}
|
|
2630
|
-
function getPlainLanguageSupportedLanguages() {
|
|
2631
|
-
return CANDIDATE_LANGS.filter((lang) => isPlainLanguageSupported(lang));
|
|
2632
|
-
}
|
|
2674
|
+
init_plain_language_support();
|
|
2633
2675
|
|
|
2634
2676
|
// src/cli/cloud-client.ts
|
|
2635
2677
|
init_cjs_shims();
|
|
@@ -2754,11 +2796,10 @@ program.argument("<url>", "URL to scan").option("--lang <code>", "Language code
|
|
|
2754
2796
|
audience: cliOptions.plain ? "plain" : cliOptions.audience || fileConfig.audience || "developer"
|
|
2755
2797
|
};
|
|
2756
2798
|
setLanguage(options.lang);
|
|
2799
|
+
let plainFallbackFrom;
|
|
2757
2800
|
if (options.audience === "plain" && !options.json && !isPlainLanguageSupported(options.lang)) {
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
console.error(import_chalk2.default.gray(` ${t("plain.gate_howto")}`));
|
|
2761
|
-
process.exit(1);
|
|
2801
|
+
plainFallbackFrom = options.lang;
|
|
2802
|
+
setLanguage("en");
|
|
2762
2803
|
}
|
|
2763
2804
|
if (!isValidUrl(url)) {
|
|
2764
2805
|
}
|
|
@@ -2796,7 +2837,7 @@ program.argument("<url>", "URL to scan").option("--lang <code>", "Language code
|
|
|
2796
2837
|
if (spinner) spinner.succeed(t("cli.complete"));
|
|
2797
2838
|
if (options.pdf) {
|
|
2798
2839
|
if (spinner) spinner.start(t("cli.generating_pdf"));
|
|
2799
|
-
const html = options.audience === "plain" ? generateReportHTML(result, options.sector, "plain") : generateReportHTML(result, options.sector);
|
|
2840
|
+
const html = options.audience === "plain" ? generateReportHTML(result, options.sector, "plain", plainFallbackFrom) : generateReportHTML(result, options.sector);
|
|
2800
2841
|
await generatePDF(html, options.pdf);
|
|
2801
2842
|
if (spinner) spinner.succeed(t("cli.pdf_saved", { path: options.pdf }));
|
|
2802
2843
|
}
|
|
@@ -2853,7 +2894,7 @@ program.argument("<url>", "URL to scan").option("--lang <code>", "Language code
|
|
|
2853
2894
|
Scan: ${result.metadata.scanDuration}ms | ${result.metadata.engineVersion}`));
|
|
2854
2895
|
} else if (options.audience === "plain") {
|
|
2855
2896
|
const { renderPlainReport: renderPlainReport2 } = await Promise.resolve().then(() => (init_plain_report(), plain_report_exports));
|
|
2856
|
-
renderPlainReport2(result, options.lang);
|
|
2897
|
+
renderPlainReport2(result, plainFallbackFrom ? "en" : options.lang, plainFallbackFrom);
|
|
2857
2898
|
} else {
|
|
2858
2899
|
console.log("\n");
|
|
2859
2900
|
const scoreColor = result.score >= 90 ? import_chalk2.default.green : result.score >= 70 ? import_chalk2.default.yellow : import_chalk2.default.red;
|
package/dist/cli/index.mjs
CHANGED
|
@@ -7,16 +7,18 @@ import {
|
|
|
7
7
|
generateStatement,
|
|
8
8
|
generateStatementContent,
|
|
9
9
|
getEngineVersion
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-RVJPW54H.mjs";
|
|
11
11
|
import {
|
|
12
12
|
groupReportsByRule,
|
|
13
|
-
impactBreakdown
|
|
14
|
-
|
|
13
|
+
impactBreakdown,
|
|
14
|
+
isPlainLanguageSupported,
|
|
15
|
+
languageDisplayName
|
|
16
|
+
} from "../chunk-IMRWWO5R.mjs";
|
|
15
17
|
import {
|
|
16
18
|
getCurrentLang,
|
|
17
19
|
setLanguage,
|
|
18
20
|
t
|
|
19
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-CE5CPK4U.mjs";
|
|
20
22
|
import {
|
|
21
23
|
__dirname
|
|
22
24
|
} from "../chunk-DIBTSSLZ.mjs";
|
|
@@ -58,9 +60,9 @@ function formatDate(dateString) {
|
|
|
58
60
|
function escapeHtml(str) {
|
|
59
61
|
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
60
62
|
}
|
|
61
|
-
function generateReportHTML(result, sector = "public", audience = "developer") {
|
|
63
|
+
function generateReportHTML(result, sector = "public", audience = "developer", plainFallbackFrom) {
|
|
62
64
|
if (audience === "plain") {
|
|
63
|
-
return generatePlainReportHTML(result);
|
|
65
|
+
return generatePlainReportHTML(result, plainFallbackFrom);
|
|
64
66
|
}
|
|
65
67
|
const criticalCount = result.stats.critical;
|
|
66
68
|
const highCount = result.stats.high;
|
|
@@ -389,10 +391,12 @@ function getLogoDataUri() {
|
|
|
389
391
|
cachedLogoDataUri = "";
|
|
390
392
|
return cachedLogoDataUri;
|
|
391
393
|
}
|
|
392
|
-
function generatePlainReportHTML(result) {
|
|
394
|
+
function generatePlainReportHTML(result, plainFallbackFrom) {
|
|
393
395
|
const lang = getCurrentLang();
|
|
394
396
|
const safeUrl = escapeHtml(result.url);
|
|
395
397
|
const logoDataUri = getLogoDataUri();
|
|
398
|
+
const fallbackName = plainFallbackFrom ? languageDisplayName(plainFallbackFrom) : "";
|
|
399
|
+
const noticeHtml = fallbackName ? `<p class="plain-fallback-notice">${escapeHtml(t("plain.gate_fallback", { lang: fallbackName }))}</p>` : "";
|
|
396
400
|
const sortedGroups = groupReportsByRule(result.reports).sort((a, b) => {
|
|
397
401
|
const aLevel = PLAIN_IMPACT_ORDER[plainLevelOf(a.report)] ?? 4;
|
|
398
402
|
const bLevel = PLAIN_IMPACT_ORDER[plainLevelOf(b.report)] ?? 4;
|
|
@@ -531,6 +535,23 @@ ${sortedGroups.map((group) => {
|
|
|
531
535
|
color: #0f172a;
|
|
532
536
|
}
|
|
533
537
|
|
|
538
|
+
/* ---- Fallback notice: calm, informational banner shown when the report
|
|
539
|
+
is served in English because the requested language is not yet
|
|
540
|
+
covered. Amber note, not an error. ---- */
|
|
541
|
+
.plain-fallback-notice {
|
|
542
|
+
background: #fffbeb;
|
|
543
|
+
border: 1px solid #fde68a;
|
|
544
|
+
border-left: 4px solid #d97706;
|
|
545
|
+
border-radius: 8px;
|
|
546
|
+
padding: 0.85rem 1.1rem;
|
|
547
|
+
margin-bottom: 1.6rem;
|
|
548
|
+
font-size: 0.85rem;
|
|
549
|
+
color: #713f12;
|
|
550
|
+
line-height: 1.55;
|
|
551
|
+
-webkit-print-color-adjust: exact;
|
|
552
|
+
print-color-adjust: exact;
|
|
553
|
+
}
|
|
554
|
+
|
|
534
555
|
/* ---- Issue list ---- */
|
|
535
556
|
.issue-list {
|
|
536
557
|
list-style: none;
|
|
@@ -666,6 +687,7 @@ ${sortedGroups.map((group) => {
|
|
|
666
687
|
</header>
|
|
667
688
|
|
|
668
689
|
<div class="report-body">
|
|
690
|
+
${noticeHtml}
|
|
669
691
|
<div class="intro">
|
|
670
692
|
<p>${t("plain.intro_framing")}</p>
|
|
671
693
|
<p>${t("plain.intro_found", { count, unit })}</p>
|
|
@@ -714,44 +736,6 @@ async function generatePDF(htmlContent, outputPath) {
|
|
|
714
736
|
}
|
|
715
737
|
}
|
|
716
738
|
|
|
717
|
-
// src/reporting/plain-language-support.ts
|
|
718
|
-
import { getAllConvergenceRules } from "@holmdigital/standards";
|
|
719
|
-
var PLAIN_LANGUAGE_CORE_RULES = [
|
|
720
|
-
"color-contrast",
|
|
721
|
-
"keyboard-accessible",
|
|
722
|
-
"alt-text",
|
|
723
|
-
"form-labels",
|
|
724
|
-
"link-purpose",
|
|
725
|
-
"language-of-page",
|
|
726
|
-
"name-role-value",
|
|
727
|
-
"landmark-one-main",
|
|
728
|
-
"heading-order",
|
|
729
|
-
"region",
|
|
730
|
-
"target-size"
|
|
731
|
-
];
|
|
732
|
-
var CANDIDATE_LANGS = [
|
|
733
|
-
"en",
|
|
734
|
-
"sv",
|
|
735
|
-
"de",
|
|
736
|
-
"fr",
|
|
737
|
-
"es",
|
|
738
|
-
"nl",
|
|
739
|
-
"no",
|
|
740
|
-
"fi",
|
|
741
|
-
"da"
|
|
742
|
-
];
|
|
743
|
-
function isEnglish(lang) {
|
|
744
|
-
return /^en(-|$)/i.test(lang.trim());
|
|
745
|
-
}
|
|
746
|
-
function isPlainLanguageSupported(lang) {
|
|
747
|
-
if (isEnglish(lang)) return true;
|
|
748
|
-
const byId = new Map(getAllConvergenceRules(lang).map((r) => [r.ruleId, r]));
|
|
749
|
-
return PLAIN_LANGUAGE_CORE_RULES.every((id) => Boolean(byId.get(id)?.plainLanguage?.headline));
|
|
750
|
-
}
|
|
751
|
-
function getPlainLanguageSupportedLanguages() {
|
|
752
|
-
return CANDIDATE_LANGS.filter((lang) => isPlainLanguageSupported(lang));
|
|
753
|
-
}
|
|
754
|
-
|
|
755
739
|
// src/cli/cloud-client.ts
|
|
756
740
|
function transformToCloudPayload(result) {
|
|
757
741
|
const violations = result.reports.map((report) => {
|
|
@@ -874,11 +858,10 @@ program.argument("<url>", "URL to scan").option("--lang <code>", "Language code
|
|
|
874
858
|
audience: cliOptions.plain ? "plain" : cliOptions.audience || fileConfig.audience || "developer"
|
|
875
859
|
};
|
|
876
860
|
setLanguage(options.lang);
|
|
861
|
+
let plainFallbackFrom;
|
|
877
862
|
if (options.audience === "plain" && !options.json && !isPlainLanguageSupported(options.lang)) {
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
console.error(chalk.gray(` ${t("plain.gate_howto")}`));
|
|
881
|
-
process.exit(1);
|
|
863
|
+
plainFallbackFrom = options.lang;
|
|
864
|
+
setLanguage("en");
|
|
882
865
|
}
|
|
883
866
|
if (!isValidUrl(url)) {
|
|
884
867
|
}
|
|
@@ -916,7 +899,7 @@ program.argument("<url>", "URL to scan").option("--lang <code>", "Language code
|
|
|
916
899
|
if (spinner) spinner.succeed(t("cli.complete"));
|
|
917
900
|
if (options.pdf) {
|
|
918
901
|
if (spinner) spinner.start(t("cli.generating_pdf"));
|
|
919
|
-
const html = options.audience === "plain" ? generateReportHTML(result, options.sector, "plain") : generateReportHTML(result, options.sector);
|
|
902
|
+
const html = options.audience === "plain" ? generateReportHTML(result, options.sector, "plain", plainFallbackFrom) : generateReportHTML(result, options.sector);
|
|
920
903
|
await generatePDF(html, options.pdf);
|
|
921
904
|
if (spinner) spinner.succeed(t("cli.pdf_saved", { path: options.pdf }));
|
|
922
905
|
}
|
|
@@ -972,8 +955,8 @@ program.argument("<url>", "URL to scan").option("--lang <code>", "Language code
|
|
|
972
955
|
console.log(chalk.gray(`
|
|
973
956
|
Scan: ${result.metadata.scanDuration}ms | ${result.metadata.engineVersion}`));
|
|
974
957
|
} else if (options.audience === "plain") {
|
|
975
|
-
const { renderPlainReport } = await import("../plain-report-
|
|
976
|
-
renderPlainReport(result, options.lang);
|
|
958
|
+
const { renderPlainReport } = await import("../plain-report-WIL7FGCM.mjs");
|
|
959
|
+
renderPlainReport(result, plainFallbackFrom ? "en" : options.lang, plainFallbackFrom);
|
|
977
960
|
} else {
|
|
978
961
|
console.log("\n");
|
|
979
962
|
const scoreColor = result.score >= 90 ? chalk.green : result.score >= 70 ? chalk.yellow : chalk.red;
|
package/dist/index.d.mts
CHANGED
|
@@ -165,7 +165,8 @@ var plain = {
|
|
|
165
165
|
occurrences: "{count} occurrences",
|
|
166
166
|
gate_blocked: "Plain-language (klarspråk) output is not yet available in '{lang}'.",
|
|
167
167
|
gate_supported: "Languages with klarspråk: {langs}.",
|
|
168
|
-
gate_howto: "Run without --plain for the developer report, or use a supported language (e.g. --lang sv)."
|
|
168
|
+
gate_howto: "Run without --plain for the developer report, or use a supported language (e.g. --lang sv).",
|
|
169
|
+
gate_fallback: "Plain language is not yet available in {lang}, so this report is shown in English. We add languages one country at a time."
|
|
169
170
|
};
|
|
170
171
|
var en = {
|
|
171
172
|
cli: cli,
|
package/dist/index.d.ts
CHANGED
|
@@ -165,7 +165,8 @@ var plain = {
|
|
|
165
165
|
occurrences: "{count} occurrences",
|
|
166
166
|
gate_blocked: "Plain-language (klarspråk) output is not yet available in '{lang}'.",
|
|
167
167
|
gate_supported: "Languages with klarspråk: {langs}.",
|
|
168
|
-
gate_howto: "Run without --plain for the developer report, or use a supported language (e.g. --lang sv)."
|
|
168
|
+
gate_howto: "Run without --plain for the developer report, or use a supported language (e.g. --lang sv).",
|
|
169
|
+
gate_fallback: "Plain language is not yet available in {lang}, so this report is shown in English. We add languages one country at a time."
|
|
169
170
|
};
|
|
170
171
|
var en = {
|
|
171
172
|
cli: cli,
|
package/dist/index.js
CHANGED
|
@@ -101,7 +101,8 @@ var init_en = __esm({
|
|
|
101
101
|
occurrences: "{count} occurrences",
|
|
102
102
|
gate_blocked: "Plain-language (klarspr\xE5k) output is not yet available in '{lang}'.",
|
|
103
103
|
gate_supported: "Languages with klarspr\xE5k: {langs}.",
|
|
104
|
-
gate_howto: "Run without --plain for the developer report, or use a supported language (e.g. --lang sv)."
|
|
104
|
+
gate_howto: "Run without --plain for the developer report, or use a supported language (e.g. --lang sv).",
|
|
105
|
+
gate_fallback: "Plain language is not yet available in {lang}, so this report is shown in English. We add languages one country at a time."
|
|
105
106
|
}
|
|
106
107
|
};
|
|
107
108
|
}
|
|
@@ -171,7 +172,8 @@ var init_sv = __esm({
|
|
|
171
172
|
occurrences: "{count} f\xF6rekomster",
|
|
172
173
|
gate_blocked: "Klarspr\xE5k st\xF6ds \xE4nnu inte p\xE5 '{lang}'.",
|
|
173
174
|
gate_supported: "Spr\xE5k med klarspr\xE5k: {langs}.",
|
|
174
|
-
gate_howto: "K\xF6r utan --plain f\xF6r utvecklarrapporten, eller v\xE4lj ett spr\xE5k som st\xF6ds (t.ex. --lang sv)."
|
|
175
|
+
gate_howto: "K\xF6r utan --plain f\xF6r utvecklarrapporten, eller v\xE4lj ett spr\xE5k som st\xF6ds (t.ex. --lang sv).",
|
|
176
|
+
gate_fallback: "Klarspr\xE5k finns \xE4nnu inte p\xE5 {lang}, s\xE5 den h\xE4r rapporten visas p\xE5 engelska. Vi l\xE4gger till spr\xE5k land f\xF6r land."
|
|
175
177
|
}
|
|
176
178
|
};
|
|
177
179
|
}
|
|
@@ -241,7 +243,8 @@ var init_de = __esm({
|
|
|
241
243
|
occurrences: "{count} occurrences",
|
|
242
244
|
gate_blocked: "Verst\xE4ndliche Sprache (Klarspr\xE5k) ist f\xFCr '{lang}' noch nicht verf\xFCgbar.",
|
|
243
245
|
gate_supported: "Sprachen mit verst\xE4ndlicher Sprache: {langs}.",
|
|
244
|
-
gate_howto: "Ohne --plain ausf\xFChren f\xFCr den Entwicklerbericht, oder eine unterst\xFCtzte Sprache verwenden (z. B. --lang sv)."
|
|
246
|
+
gate_howto: "Ohne --plain ausf\xFChren f\xFCr den Entwicklerbericht, oder eine unterst\xFCtzte Sprache verwenden (z. B. --lang sv).",
|
|
247
|
+
gate_fallback: "Einfache Sprache ist f\xFCr {lang} noch nicht verf\xFCgbar, daher wird dieser Bericht auf Englisch angezeigt. Wir erg\xE4nzen Sprachen Land f\xFCr Land."
|
|
245
248
|
}
|
|
246
249
|
};
|
|
247
250
|
}
|
|
@@ -311,7 +314,8 @@ var init_fr = __esm({
|
|
|
311
314
|
occurrences: "{count} occurrences",
|
|
312
315
|
gate_blocked: "Le langage clair (klarspr\xE5k) n'est pas encore disponible en \xAB {lang} \xBB.",
|
|
313
316
|
gate_supported: "Langues avec langage clair : {langs}.",
|
|
314
|
-
gate_howto: "Lancez sans --plain pour le rapport d\xE9veloppeur, ou utilisez une langue prise en charge (par ex. --lang sv)."
|
|
317
|
+
gate_howto: "Lancez sans --plain pour le rapport d\xE9veloppeur, ou utilisez une langue prise en charge (par ex. --lang sv).",
|
|
318
|
+
gate_fallback: "Le langage clair n\u2019est pas encore disponible en {lang}, ce rapport est donc affich\xE9 en anglais. Nous ajoutons les langues pays par pays."
|
|
315
319
|
}
|
|
316
320
|
};
|
|
317
321
|
}
|
|
@@ -381,7 +385,8 @@ var init_es = __esm({
|
|
|
381
385
|
occurrences: "{count} occurrences",
|
|
382
386
|
gate_blocked: "El lenguaje claro (klarspr\xE5k) a\xFAn no est\xE1 disponible en '{lang}'.",
|
|
383
387
|
gate_supported: "Idiomas con lenguaje claro: {langs}.",
|
|
384
|
-
gate_howto: "Ejecuta sin --plain para el informe para desarrolladores, o usa un idioma compatible (p. ej. --lang sv)."
|
|
388
|
+
gate_howto: "Ejecuta sin --plain para el informe para desarrolladores, o usa un idioma compatible (p. ej. --lang sv).",
|
|
389
|
+
gate_fallback: "El lenguaje claro a\xFAn no est\xE1 disponible en {lang}, por lo que este informe se muestra en ingl\xE9s. A\xF1adimos idiomas pa\xEDs por pa\xEDs."
|
|
385
390
|
}
|
|
386
391
|
};
|
|
387
392
|
}
|
|
@@ -451,7 +456,8 @@ var init_fi = __esm({
|
|
|
451
456
|
occurrences: "{count} occurrences",
|
|
452
457
|
gate_blocked: "Selkokielinen (klarspr\xE5k) raportti ei ole viel\xE4 saatavilla kielell\xE4 '{lang}'.",
|
|
453
458
|
gate_supported: "Kielet, joilla selkokielinen raportti on saatavilla: {langs}.",
|
|
454
|
-
gate_howto: "Aja ilman --plain-valitsinta kehitt\xE4j\xE4raporttia varten tai k\xE4yt\xE4 tuettua kielt\xE4 (esim. --lang sv)."
|
|
459
|
+
gate_howto: "Aja ilman --plain-valitsinta kehitt\xE4j\xE4raporttia varten tai k\xE4yt\xE4 tuettua kielt\xE4 (esim. --lang sv).",
|
|
460
|
+
gate_fallback: "Selkokieli ei ole viel\xE4 saatavilla kielell\xE4 {lang}, joten t\xE4m\xE4 raportti n\xE4ytet\xE4\xE4n englanniksi. Lis\xE4\xE4mme kieli\xE4 maa kerrallaan."
|
|
455
461
|
}
|
|
456
462
|
};
|
|
457
463
|
}
|
|
@@ -521,7 +527,8 @@ var init_dk = __esm({
|
|
|
521
527
|
occurrences: "{count} occurrences",
|
|
522
528
|
gate_blocked: "Klarsprog (klarspr\xE5k) er endnu ikke tilg\xE6ngeligt p\xE5 '{lang}'.",
|
|
523
529
|
gate_supported: "Sprog med klarsprog: {langs}.",
|
|
524
|
-
gate_howto: "K\xF8r uden --plain for udviklerrapporten, eller brug et underst\xF8ttet sprog (f.eks. --lang sv)."
|
|
530
|
+
gate_howto: "K\xF8r uden --plain for udviklerrapporten, eller brug et underst\xF8ttet sprog (f.eks. --lang sv).",
|
|
531
|
+
gate_fallback: "Klarsprog er endnu ikke tilg\xE6ngeligt p\xE5 {lang}, s\xE5 denne rapport vises p\xE5 engelsk. Vi tilf\xF8jer sprog land for land."
|
|
525
532
|
}
|
|
526
533
|
};
|
|
527
534
|
}
|
|
@@ -591,7 +598,8 @@ var init_no = __esm({
|
|
|
591
598
|
occurrences: "{count} occurrences",
|
|
592
599
|
gate_blocked: "Klarspr\xE5k er enn\xE5 ikke tilgjengelig p\xE5 '{lang}'.",
|
|
593
600
|
gate_supported: "Spr\xE5k med klarspr\xE5k: {langs}.",
|
|
594
|
-
gate_howto: "Kj\xF8r uten --plain for utviklerrapporten, eller bruk et st\xF8ttet spr\xE5k (f.eks. --lang sv)."
|
|
601
|
+
gate_howto: "Kj\xF8r uten --plain for utviklerrapporten, eller bruk et st\xF8ttet spr\xE5k (f.eks. --lang sv).",
|
|
602
|
+
gate_fallback: "Klarspr\xE5k er enn\xE5 ikke tilgjengelig p\xE5 {lang}, s\xE5 denne rapporten vises p\xE5 engelsk. Vi legger til spr\xE5k land for land."
|
|
595
603
|
}
|
|
596
604
|
};
|
|
597
605
|
}
|
|
@@ -661,7 +669,8 @@ var init_nl = __esm({
|
|
|
661
669
|
occurrences: "{count} occurrences",
|
|
662
670
|
gate_blocked: "Begrijpelijke taal (klarspr\xE5k) is nog niet beschikbaar in '{lang}'.",
|
|
663
671
|
gate_supported: "Talen met begrijpelijke taal: {langs}.",
|
|
664
|
-
gate_howto: "Voer uit zonder --plain voor het ontwikkelaarsrapport, of gebruik een ondersteunde taal (bijv. --lang sv)."
|
|
672
|
+
gate_howto: "Voer uit zonder --plain voor het ontwikkelaarsrapport, of gebruik een ondersteunde taal (bijv. --lang sv).",
|
|
673
|
+
gate_fallback: "Duidelijke taal is nog niet beschikbaar in {lang}, daarom wordt dit rapport in het Engels getoond. We voegen talen land voor land toe."
|
|
665
674
|
}
|
|
666
675
|
};
|
|
667
676
|
}
|
|
@@ -902,7 +911,7 @@ var HtmlValidator = class {
|
|
|
902
911
|
// src/core/regulatory-scanner.ts
|
|
903
912
|
var import_node_fs = require("fs");
|
|
904
913
|
function getEngineVersion() {
|
|
905
|
-
return "2.
|
|
914
|
+
return "2.11.0";
|
|
906
915
|
}
|
|
907
916
|
function getStandardsVersion() {
|
|
908
917
|
try {
|
package/dist/index.mjs
CHANGED
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
generateStatement,
|
|
6
6
|
generateStatementContent,
|
|
7
7
|
getEngineVersion
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-RVJPW54H.mjs";
|
|
9
9
|
import {
|
|
10
10
|
getCurrentLang,
|
|
11
11
|
setLanguage,
|
|
12
12
|
t
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-CE5CPK4U.mjs";
|
|
14
14
|
import "./chunk-DIBTSSLZ.mjs";
|
|
15
15
|
export {
|
|
16
16
|
PseudoAutomationEngine,
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
groupReportsByRule,
|
|
3
|
-
impactBreakdown
|
|
4
|
-
|
|
3
|
+
impactBreakdown,
|
|
4
|
+
languageDisplayName
|
|
5
|
+
} from "./chunk-IMRWWO5R.mjs";
|
|
5
6
|
import {
|
|
6
7
|
getCurrentLang,
|
|
7
8
|
setLanguage,
|
|
8
9
|
t
|
|
9
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CE5CPK4U.mjs";
|
|
10
11
|
import "./chunk-DIBTSSLZ.mjs";
|
|
11
12
|
|
|
12
13
|
// src/reporting/plain-report.ts
|
|
@@ -38,8 +39,12 @@ var BADGE_KEY = {
|
|
|
38
39
|
function levelOf(report) {
|
|
39
40
|
return report.plainLanguage?.impactLevel ?? RISK_TO_IMPACT[report.holmdigitalInsight.diggRisk] ?? "putsning";
|
|
40
41
|
}
|
|
41
|
-
function renderPlainReport(result, lang = "en") {
|
|
42
|
+
function renderPlainReport(result, lang = "en", plainFallbackFrom) {
|
|
42
43
|
setLanguage(lang);
|
|
44
|
+
if (plainFallbackFrom) {
|
|
45
|
+
console.log(chalk.yellow(t("plain.gate_fallback", { lang: languageDisplayName(plainFallbackFrom) })));
|
|
46
|
+
console.log("");
|
|
47
|
+
}
|
|
43
48
|
if (result.reports.length === 0) {
|
|
44
49
|
console.log(t("plain.empty_state"));
|
|
45
50
|
console.log("");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holmdigital/engine",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -83,21 +83,21 @@
|
|
|
83
83
|
"license": "MIT",
|
|
84
84
|
"dependencies": {
|
|
85
85
|
"@holmdigital/components": "^3.0.0",
|
|
86
|
-
"@holmdigital/standards": "^2.
|
|
86
|
+
"@holmdigital/standards": "^2.10.0",
|
|
87
87
|
"axe-core": "^4.12.1",
|
|
88
88
|
"chalk": "^5.3.0",
|
|
89
|
-
"commander": "^
|
|
89
|
+
"commander": "^15.0.0",
|
|
90
90
|
"cosmiconfig": "^9.0.2",
|
|
91
|
-
"html-validate": "11.5.
|
|
92
|
-
"ora": "^
|
|
93
|
-
"puppeteer": "25.2.
|
|
91
|
+
"html-validate": "11.5.4",
|
|
92
|
+
"ora": "^9.4.1",
|
|
93
|
+
"puppeteer": "25.2.1",
|
|
94
94
|
"react": "^18.3.1 || ^19.0.0",
|
|
95
95
|
"react-dom": "^18.3.1 || ^19.0.0",
|
|
96
96
|
"ws": "^8.18.0"
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
|
-
"@types/cosmiconfig": "^
|
|
100
|
-
"@types/node": "^26.0.
|
|
99
|
+
"@types/cosmiconfig": "^6.0.3",
|
|
100
|
+
"@types/node": "^26.0.1",
|
|
101
101
|
"@types/react": "^18.3.1 || ^19.0.0",
|
|
102
102
|
"@types/react-dom": "^18.3.1 || ^19.0.0",
|
|
103
103
|
"@types/ws": "^8.5.13",
|
package/dist/chunk-VNNYP4NV.mjs
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// src/reporting/plain-group.ts
|
|
2
|
-
function groupReportsByRule(reports) {
|
|
3
|
-
const groups = /* @__PURE__ */ new Map();
|
|
4
|
-
for (const report of reports) {
|
|
5
|
-
const existing = groups.get(report.ruleId);
|
|
6
|
-
if (existing) {
|
|
7
|
-
existing.count += 1;
|
|
8
|
-
} else {
|
|
9
|
-
groups.set(report.ruleId, { report, count: 1 });
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
return [...groups.values()];
|
|
13
|
-
}
|
|
14
|
-
function impactBreakdown(reports, levelOf, order) {
|
|
15
|
-
const counts = /* @__PURE__ */ new Map();
|
|
16
|
-
for (const report of reports) {
|
|
17
|
-
const level = levelOf(report);
|
|
18
|
-
counts.set(level, (counts.get(level) ?? 0) + 1);
|
|
19
|
-
}
|
|
20
|
-
return [...counts.entries()].map(([level, count]) => ({ level, count })).sort((a, b) => (order[a.level] ?? 4) - (order[b.level] ?? 4));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export {
|
|
24
|
-
groupReportsByRule,
|
|
25
|
-
impactBreakdown
|
|
26
|
-
};
|