@holmdigital/engine 2.1.5 → 2.1.7

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.
@@ -0,0 +1,39 @@
1
+ {
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 Section 508 of the Rehabilitation Act, any known accessibility issues, and how you can report problems so that we can fix them.",
4
+ "sections": [
5
+ {
6
+ "id": "how-accessible",
7
+ "title": "How accessible is the website?",
8
+ "content": "{There are no known accessibility issues with this website./We know some parts of this website aren't fully accessible. See the section on non-accessible content below for more information./We know some parts of this website aren't fully accessible. See the section on non-accessible content below for more information.}"
9
+ },
10
+ {
11
+ "id": "what-to-do",
12
+ "title": "What to do if you can't access parts of this website?",
13
+ "content": "If you need content from this website that is not accessible for you, but is not within the scope of the accessibility regulations as described below, please contact us.\n\n[Our normal response time is {<response time>}.]\n\n[You can also contact us in the following ways:\n\n* email {<email address>}\n* call {<telephone number>}]"
14
+ },
15
+ {
16
+ "id": "reporting",
17
+ "title": "Reporting accessibility problems with this website",
18
+ "content": "We're always looking to improve the accessibility of this website. If you find any problems that aren't listed on this page or if we're not meeting the requirements of the accessibility regulations, contact us and let us know about the problem."
19
+ },
20
+ {
21
+ "id": "enforcement",
22
+ "title": "Enforcement procedure",
23
+ "content": "The {<enforcement_body>} is responsible for enforcing Section 508 of the Rehabilitation Act and the Americans with Disabilities Act (ADA). 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 Section 508 or the ADA, or if your request for accessible content has not been handled appropriately."
24
+ },
25
+ {
26
+ "id": "technical",
27
+ "title": "Technical information about this website's accessibility",
28
+ "content": "{This website is fully compliant with Section 508 of the Rehabilitation Act./This website is partially compliant with Section 508 of the Rehabilitation Act, due to the non-compliances listed below./This website is not compliant with Section 508 of the Rehabilitation Act. The non-accessible sections are listed below.}"
29
+ },
30
+ {
31
+ "content": "The content described below is, in one way or another, not fully accessible.\n\n[\n**Non-compliance with the accessibility regulations**\n\n{<issues>}\n]"
32
+ },
33
+ {
34
+ "id": "testing",
35
+ "title": "How we tested this website",
36
+ "content": "{We have performed a self-assessment (internal testing) of {<website>}./{<third party>} has tested {<website>}./We have estimated the accessibility without testing.}\n\nThe last assessment was made on {<assessment date>}.\n\n[Assessment method: {<method>}]\n\nThe website was published on {<publish date>}.\n\nThe statement was last updated on {<update date>}."
37
+ }
38
+ ]
39
+ }
@@ -1,4 +1,4 @@
1
- import "./chunk-Y6FXYEAI.mjs";
1
+ import "./chunk-DIBTSSLZ.mjs";
2
2
 
3
3
  // src/reporting/github-actions.ts
4
4
  function generateGitHubActionsAnnotations(reports) {
@@ -2,8 +2,8 @@ import {
2
2
  getCurrentLang,
3
3
  setLanguage,
4
4
  t
5
- } from "./chunk-32WU5BD6.mjs";
6
- import "./chunk-Y6FXYEAI.mjs";
5
+ } from "./chunk-MGIEQZMZ.mjs";
6
+ import "./chunk-DIBTSSLZ.mjs";
7
7
  export {
8
8
  getCurrentLang,
9
9
  setLanguage,
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { RegulatoryReport } from '@holmdigital/standards';
1
+ import { EnrichedReport, RegulatoryReport } from '@holmdigital/standards';
2
2
  import { Page } from 'puppeteer';
3
3
 
4
4
  interface ValidationResult {
@@ -38,7 +38,7 @@ interface ScanResult {
38
38
  url: string;
39
39
  timestamp: string;
40
40
  metadata: ScanMetadata;
41
- reports: RegulatoryReport[];
41
+ reports: EnrichedReport[];
42
42
  stats: {
43
43
  passed: number;
44
44
  critical: number;
@@ -137,7 +137,7 @@ var report = {
137
137
  detailed_violations: "Detailed Violations",
138
138
  prescriptive_fix: "💡 Prescriptive Fix",
139
139
  use: "Use",
140
- footer: "Generated by @holmdigital/engine v0.1.0 • Standards: WCAG 2.1 AA, EN 301 549, DOS-lagen"
140
+ footer: "Generated by @holmdigital/engine v{version} • Standards: WCAG 2.1 AA, EN 301 549, DOS-lagen"
141
141
  };
142
142
  var en = {
143
143
  cli: cli,
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { RegulatoryReport } from '@holmdigital/standards';
1
+ import { EnrichedReport, RegulatoryReport } from '@holmdigital/standards';
2
2
  import { Page } from 'puppeteer';
3
3
 
4
4
  interface ValidationResult {
@@ -38,7 +38,7 @@ interface ScanResult {
38
38
  url: string;
39
39
  timestamp: string;
40
40
  metadata: ScanMetadata;
41
- reports: RegulatoryReport[];
41
+ reports: EnrichedReport[];
42
42
  stats: {
43
43
  passed: number;
44
44
  critical: number;
@@ -137,7 +137,7 @@ var report = {
137
137
  detailed_violations: "Detailed Violations",
138
138
  prescriptive_fix: "💡 Prescriptive Fix",
139
139
  use: "Use",
140
- footer: "Generated by @holmdigital/engine v0.1.0 • Standards: WCAG 2.1 AA, EN 301 549, DOS-lagen"
140
+ footer: "Generated by @holmdigital/engine v{version} • Standards: WCAG 2.1 AA, EN 301 549, DOS-lagen"
141
141
  };
142
142
  var en = {
143
143
  cli: cli,
package/dist/index.js CHANGED
@@ -30,6 +30,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  ));
31
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
32
 
33
+ // ../../node_modules/tsup/assets/cjs_shims.js
34
+ var init_cjs_shims = __esm({
35
+ "../../node_modules/tsup/assets/cjs_shims.js"() {
36
+ "use strict";
37
+ }
38
+ });
39
+
33
40
  // src/locales/en.json
34
41
  var en_default;
35
42
  var init_en = __esm({
@@ -69,7 +76,7 @@ var init_en = __esm({
69
76
  detailed_violations: "Detailed Violations",
70
77
  prescriptive_fix: "\u{1F4A1} Prescriptive Fix",
71
78
  use: "Use",
72
- footer: "Generated by @holmdigital/engine v0.1.0 \u2022 Standards: WCAG 2.1 AA, EN 301 549, DOS-lagen"
79
+ footer: "Generated by @holmdigital/engine v{version} \u2022 Standards: WCAG 2.1 AA, EN 301 549, DOS-lagen"
73
80
  }
74
81
  };
75
82
  }
@@ -114,7 +121,7 @@ var init_sv = __esm({
114
121
  detailed_violations: "Detaljerade brister",
115
122
  prescriptive_fix: "\u{1F4A1} Preskriptiv L\xF6sning",
116
123
  use: "Anv\xE4nd",
117
- footer: "Genererad av @holmdigital/engine v0.1.0 \u2022 Standarder: WCAG 2.1 AA, EN 301 549, DOS-lagen"
124
+ footer: "Genererad av @holmdigital/engine v{version} \u2022 Standarder: WCAG 2.1 AA, EN 301 549, DOS-lagen"
118
125
  }
119
126
  };
120
127
  }
@@ -159,7 +166,7 @@ var init_de = __esm({
159
166
  detailed_violations: "Detaillierte Verst\xF6\xDFe",
160
167
  prescriptive_fix: "\u{1F4A1} Vorschriftsm\xE4\xDFige L\xF6sung",
161
168
  use: "Verwenden",
162
- footer: "Generiert von @holmdigital/engine v0.1.0 \u2022 Standards: WCAG 2.1 AA, EN 301 549, BITV 2.0"
169
+ footer: "Generiert von @holmdigital/engine v{version} \u2022 Standards: WCAG 2.1 AA, EN 301 549, BITV 2.0"
163
170
  }
164
171
  };
165
172
  }
@@ -204,7 +211,7 @@ var init_fr = __esm({
204
211
  detailed_violations: "Violations D\xE9taill\xE9es",
205
212
  prescriptive_fix: "\u{1F4A1} Solution Prescriptive",
206
213
  use: "Utiliser",
207
- footer: "G\xE9n\xE9r\xE9 par @holmdigital/engine v0.1.0 \u2022 Standards : WCAG 2.1 AA, EN 301 549, RGAA"
214
+ footer: "G\xE9n\xE9r\xE9 par @holmdigital/engine v{version} \u2022 Standards : WCAG 2.1 AA, EN 301 549, RGAA"
208
215
  }
209
216
  };
210
217
  }
@@ -249,7 +256,7 @@ var init_es = __esm({
249
256
  detailed_violations: "Violaciones Detalladas",
250
257
  prescriptive_fix: "\u{1F4A1} Soluci\xF3n Prescriptiva",
251
258
  use: "Usar",
252
- footer: "Generado por @holmdigital/engine v0.1.0 \u2022 Est\xE1ndares: WCAG 2.1 AA, EN 301 549, UNE 139803"
259
+ footer: "Generado por @holmdigital/engine v{version} \u2022 Est\xE1ndares: WCAG 2.1 AA, EN 301 549, UNE 139803"
253
260
  }
254
261
  };
255
262
  }
@@ -294,7 +301,7 @@ var init_fi = __esm({
294
301
  detailed_violations: "Yksityiskohtaiset rikkomukset",
295
302
  prescriptive_fix: "\u{1F4A1} Ehdotettu korjaus",
296
303
  use: "K\xE4yt\xE4",
297
- footer: "Luonut @holmdigital/engine v0.1.0 \u2022 Standardit: WCAG 2.1 AA, EN 301 549, Digipalvelulaki"
304
+ footer: "Luonut @holmdigital/engine v{version} \u2022 Standardit: WCAG 2.1 AA, EN 301 549, Digipalvelulaki"
298
305
  }
299
306
  };
300
307
  }
@@ -339,7 +346,7 @@ var init_dk = __esm({
339
346
  detailed_violations: "Detaljerede Overtr\xE6delser",
340
347
  prescriptive_fix: "\u{1F4A1} Foresl\xE5et L\xF8sning",
341
348
  use: "Brug",
342
- footer: "Genereret af @holmdigital/engine v0.1.0 \u2022 Standarder: WCAG 2.1 AA, EN 301 549, Lov om tilg\xE6ngelighed"
349
+ footer: "Genereret af @holmdigital/engine v{version} \u2022 Standarder: WCAG 2.1 AA, EN 301 549, Lov om tilg\xE6ngelighed"
343
350
  }
344
351
  };
345
352
  }
@@ -384,7 +391,7 @@ var init_no = __esm({
384
391
  detailed_violations: "Detaljerte Brudd",
385
392
  prescriptive_fix: "\u{1F4A1} Foresl\xE5tt L\xF8sning",
386
393
  use: "Bruk",
387
- footer: "Generert av @holmdigital/engine v0.1.0 \u2022 Standarder: WCAG 2.1 AA, EN 301 549, Uu-tilsynet"
394
+ footer: "Generert av @holmdigital/engine v{version} \u2022 Standarder: WCAG 2.1 AA, EN 301 549, Uu-tilsynet"
388
395
  }
389
396
  };
390
397
  }
@@ -429,7 +436,7 @@ var init_nl = __esm({
429
436
  detailed_violations: "Gedetailleerde overtredingen",
430
437
  prescriptive_fix: "\u{1F4A1} Voorgeschreven oplossing",
431
438
  use: "Gebruik",
432
- footer: "Gegenereerd door @holmdigital/engine v0.1.0 \u2022 Standaarden: WCAG 2.1 AA, EN 301 549, Besluit digitale toegankelijkheid overheid"
439
+ footer: "Gegenereerd door @holmdigital/engine v{version} \u2022 Standaarden: WCAG 2.1 AA, EN 301 549, Besluit digitale toegankelijkheid overheid"
433
440
  }
434
441
  };
435
442
  }
@@ -484,6 +491,7 @@ var locales, currentLang;
484
491
  var init_i18n = __esm({
485
492
  "src/i18n/index.ts"() {
486
493
  "use strict";
494
+ init_cjs_shims();
487
495
  init_en();
488
496
  init_sv();
489
497
  init_de();
@@ -528,12 +536,15 @@ __export(index_exports, {
528
536
  t: () => t
529
537
  });
530
538
  module.exports = __toCommonJS(index_exports);
539
+ init_cjs_shims();
531
540
 
532
541
  // src/core/regulatory-scanner.ts
542
+ init_cjs_shims();
533
543
  var import_axe_core = __toESM(require("axe-core"));
534
544
  var import_puppeteer = __toESM(require("puppeteer"));
535
545
 
536
546
  // src/core/virtual-dom.ts
547
+ init_cjs_shims();
537
548
  var VirtualDOMBuilder = class {
538
549
  page;
539
550
  constructor(page) {
@@ -624,6 +635,7 @@ var VirtualDOMBuilder = class {
624
635
  };
625
636
 
626
637
  // src/core/html-validator.ts
638
+ init_cjs_shims();
627
639
  var import_html_validate = require("html-validate");
628
640
  var HtmlValidator = class {
629
641
  validator;
@@ -663,18 +675,8 @@ var HtmlValidator = class {
663
675
 
664
676
  // src/core/regulatory-scanner.ts
665
677
  var import_node_fs = require("fs");
666
- var import_node_path = require("path");
667
- var import_node_url = require("url");
668
- var import_meta = {};
669
678
  function getEngineVersion() {
670
- try {
671
- const dir = typeof __dirname !== "undefined" ? __dirname : (0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(import_meta.url));
672
- const pkgPath = (0, import_node_path.resolve)(dir, "..", "package.json");
673
- const pkg = JSON.parse((0, import_node_fs.readFileSync)(pkgPath, "utf-8"));
674
- return pkg.version;
675
- } catch {
676
- return "2.1.1";
677
- }
679
+ return "2.1.7";
678
680
  }
679
681
  function getStandardsVersion() {
680
682
  try {
@@ -732,7 +734,7 @@ var RegulatoryScanner = class {
732
734
  retries--;
733
735
  if (retries === 0) throw e;
734
736
  this.log(`Navigation failed, retrying... (${retries} attempts left)`);
735
- await new Promise((resolve2) => setTimeout(resolve2, 2e3));
737
+ await new Promise((resolve) => setTimeout(resolve, 2e3));
736
738
  }
737
739
  }
738
740
  try {
@@ -940,6 +942,7 @@ var RegulatoryScanner = class {
940
942
  };
941
943
 
942
944
  // src/automation/pseudo-automation.ts
945
+ init_cjs_shims();
943
946
  var PseudoAutomationEngine = class {
944
947
  /**
945
948
  * Generera ett Playwright-testskript baserat på en rapport
@@ -1011,15 +1014,16 @@ test('${testName}', async ({ page }) => {
1011
1014
  init_i18n();
1012
1015
 
1013
1016
  // src/reporting/statement-generator.ts
1017
+ init_cjs_shims();
1014
1018
  var import_react = __toESM(require("react"));
1015
1019
  var import_server = require("react-dom/server");
1016
1020
  var import_components = require("@holmdigital/components");
1017
1021
  var import_standards = require("@holmdigital/standards");
1018
1022
  var import_promises = __toESM(require("fs/promises"));
1019
1023
  var import_path = __toESM(require("path"));
1020
- var import_node_url2 = require("url");
1021
1024
 
1022
1025
  // src/reporting/badge-generator.ts
1026
+ init_cjs_shims();
1023
1027
  var BADGE_COLOR = "00703C";
1024
1028
  var BADGE_BASE_URL = "https://img.shields.io/badge/HolmDigital_Engine";
1025
1029
  function generateBadgeUrl(score) {
@@ -1030,45 +1034,61 @@ function generateBadgeUrl(score) {
1030
1034
  }
1031
1035
 
1032
1036
  // src/reporting/statement-generator.ts
1033
- var import_meta2 = {};
1034
- var __dirname_esm = typeof __dirname === "undefined" ? import_path.default.dirname((0, import_node_url2.fileURLToPath)(import_meta2.url)) : __dirname;
1037
+ var EVALUATION_METHOD = {
1038
+ sv: "Automatiserad granskning via @holmdigital/engine",
1039
+ en: "Automated scan via @holmdigital/engine",
1040
+ no: "Automatisert gjennomgang via @holmdigital/engine",
1041
+ nb: "Automatisert gjennomgang via @holmdigital/engine",
1042
+ fi: "Automaattinen tarkistus @holmdigital/engine-ty\xF6kalulla",
1043
+ da: "Automatiseret gennemgang via @holmdigital/engine",
1044
+ de: "Automatisierte Pr\xFCfung mit @holmdigital/engine",
1045
+ fr: "Analyse automatis\xE9e via @holmdigital/engine",
1046
+ es: "An\xE1lisis automatizado mediante @holmdigital/engine",
1047
+ nl: "Geautomatiseerde controle via @holmdigital/engine",
1048
+ "en-gb": "Automated scan via @holmdigital/engine",
1049
+ "en-us": "Automated scan via @holmdigital/engine",
1050
+ "en-ca": "Automated scan via @holmdigital/engine"
1051
+ };
1052
+ var STATUS_LABELS = {
1053
+ sv: { full: "Fullt ut f\xF6renlig", partial: "Delvis f\xF6renlig", "non-compliant": "Inte f\xF6renlig" },
1054
+ en: { full: "Fully compliant", partial: "Partially compliant", "non-compliant": "Non-compliant" },
1055
+ no: { full: "Helt i samsvar", partial: "Delvis i samsvar", "non-compliant": "Ikke i samsvar" },
1056
+ nb: { full: "Helt i samsvar", partial: "Delvis i samsvar", "non-compliant": "Ikke i samsvar" },
1057
+ fi: { full: "T\xE4ysin saavutettava", partial: "Osittain saavutettava", "non-compliant": "Ei saavutettava" },
1058
+ da: { full: "Fuldt ud i overensstemmelse", partial: "Delvist i overensstemmelse", "non-compliant": "Ikke i overensstemmelse" },
1059
+ de: { full: "Vollst\xE4ndig konform", partial: "Teilweise konform", "non-compliant": "Nicht konform" },
1060
+ fr: { full: "Totalement conforme", partial: "Partiellement conforme", "non-compliant": "Non conforme" },
1061
+ es: { full: "Plenamente conforme", partial: "Parcialmente conforme", "non-compliant": "No conforme" },
1062
+ nl: { full: "Volledig conform", partial: "Gedeeltelijk conform", "non-compliant": "Niet conform" },
1063
+ "en-gb": { full: "Fully compliant", partial: "Partially compliant", "non-compliant": "Non-compliant" },
1064
+ "en-us": { full: "Fully compliant", partial: "Partially compliant", "non-compliant": "Non-compliant" },
1065
+ "en-ca": { full: "Fully compliant", partial: "Partially compliant", "non-compliant": "Non-compliant" }
1066
+ };
1067
+ var RESPONSE_TIME_DEFAULT = {
1068
+ sv: "2 dagar",
1069
+ en: "2 days",
1070
+ no: "2 dager",
1071
+ nb: "2 dager",
1072
+ fi: "2 p\xE4iv\xE4\xE4",
1073
+ da: "2 dage",
1074
+ de: "2 Tage",
1075
+ fr: "2 jours",
1076
+ es: "2 d\xEDas",
1077
+ nl: "2 dagen",
1078
+ "en-gb": "2 days",
1079
+ "en-us": "2 days",
1080
+ "en-ca": "2 days"
1081
+ };
1035
1082
  async function generateStatementContent(result, lang = "en", format = "html", metadata) {
1083
+ const templatePath = import_path.default.join(__dirname, "templates", `${lang}.json`);
1036
1084
  let template;
1037
- const possibleTemplatePaths = [
1038
- import_path.default.join(__dirname_esm, "templates", `${lang}.json`),
1039
- import_path.default.join(__dirname_esm, "../src/reporting/templates", `${lang}.json`),
1040
- import_path.default.join(process.cwd(), "packages/engine/src/reporting/templates", `${lang}.json`)
1041
- ];
1042
- let loaded = false;
1043
- for (const p of possibleTemplatePaths) {
1044
- try {
1045
- const data = await import_promises.default.readFile(p, "utf-8");
1046
- template = JSON.parse(data);
1047
- loaded = true;
1048
- break;
1049
- } catch (e) {
1050
- continue;
1051
- }
1052
- }
1053
- if (!loaded) {
1054
- const fallbackPaths = [
1055
- import_path.default.join(__dirname_esm, "templates", "en.json"),
1056
- import_path.default.join(__dirname_esm, "../src/reporting/templates", "en.json"),
1057
- import_path.default.join(process.cwd(), "packages/engine/src/reporting/templates", "en.json")
1058
- ];
1059
- for (const p of fallbackPaths) {
1060
- try {
1061
- const data = await import_promises.default.readFile(p, "utf-8");
1062
- template = JSON.parse(data);
1063
- loaded = true;
1064
- break;
1065
- } catch (e) {
1066
- continue;
1067
- }
1068
- }
1069
- }
1070
- if (!loaded) {
1071
- throw new Error(`Accessibility statement templates missing. Looked in: ${possibleTemplatePaths.join(", ")}`);
1085
+ try {
1086
+ const data = await import_promises.default.readFile(templatePath, "utf-8");
1087
+ template = JSON.parse(data);
1088
+ } catch {
1089
+ throw new Error(
1090
+ `Accessibility statement template not found for locale "${lang}". Expected file at: ${templatePath}`
1091
+ );
1072
1092
  }
1073
1093
  let complianceLevel = "full";
1074
1094
  if (result.stats.critical > 0 || result.legalSummary && result.legalSummary.eaaDeadlineViolations > 0) {
@@ -1090,6 +1110,9 @@ async function generateStatementContent(result, lang = "en", format = "html", me
1090
1110
  if (result.url.endsWith(".dk")) country = "DK";
1091
1111
  if (result.url.endsWith(".fi")) country = "FI";
1092
1112
  if (result.url.endsWith(".de")) country = "DE";
1113
+ if (result.url.endsWith(".uk")) country = "GB";
1114
+ if (result.url.endsWith(".us")) country = "US";
1115
+ if (result.url.endsWith(".ca")) country = "CA";
1093
1116
  }
1094
1117
  const sector = "public";
1095
1118
  let logoUrl;
@@ -1119,7 +1142,7 @@ async function generateStatementContent(result, lang = "en", format = "html", me
1119
1142
  complianceLevel,
1120
1143
  lastReviewDate: /* @__PURE__ */ new Date(),
1121
1144
  assessmentDate: /* @__PURE__ */ new Date(),
1122
- evaluationMethod: lang === "sv" ? "Automatiserad granskning via @holmdigital/engine" : "Automated Scan via @holmdigital/engine",
1145
+ evaluationMethod: EVALUATION_METHOD[lang] || EVALUATION_METHOD["en"],
1123
1146
  generatorTool: {
1124
1147
  name: "HolmDigital Regulatory Engine",
1125
1148
  url: "https://holmdigital.se"
@@ -1127,7 +1150,7 @@ async function generateStatementContent(result, lang = "en", format = "html", me
1127
1150
  logoUrl,
1128
1151
  contactEmail: metadata?.contactEmail || "hej@holmdigital.se",
1129
1152
  phoneNumber: metadata?.phoneNumber || "070-123 45 67",
1130
- responseTime: metadata?.responseTime || (lang === "sv" ? "2 dagar" : "2 days"),
1153
+ responseTime: metadata?.responseTime || RESPONSE_TIME_DEFAULT[lang] || RESPONSE_TIME_DEFAULT["en"],
1131
1154
  nonComplianceItems,
1132
1155
  locale: lang,
1133
1156
  badgeUrl: generateBadgeUrl(result.score) || void 0,
@@ -1153,10 +1176,11 @@ async function generateStatementContent(result, lang = "en", format = "html", me
1153
1176
  </html>`;
1154
1177
  } else {
1155
1178
  const dateStr = props.lastReviewDate.toISOString().split("T")[0];
1179
+ const labels = STATUS_LABELS[lang] || STATUS_LABELS["en"];
1156
1180
  const statusMap = {
1157
- "full": lang === "sv" ? "Fullt ut f\xF6renlig" : lang === "no" || lang === "nb" ? "Helt i samsvar" : lang === "da" ? "Fuldt ud i overensstemmelse" : "Fully compliant",
1158
- "partial": lang === "sv" ? "Delvis f\xF6renlig" : lang === "no" || lang === "nb" ? "Delvis i samsvar" : lang === "da" ? "Delvist i overensstemmelse" : "Partially compliant",
1159
- "non-compliant": lang === "sv" ? "Inte f\xF6renlig" : lang === "no" || lang === "nb" ? "Ikke i samsvar" : lang === "da" ? "Ikke i overensstemmelse" : "Non-compliant"
1181
+ "full": labels["full"],
1182
+ "partial": labels["partial"],
1183
+ "non-compliant": labels["non-compliant"]
1160
1184
  };
1161
1185
  const substitutions = {
1162
1186
  statusString: statusMap[complianceLevel],
@@ -1168,6 +1192,8 @@ async function generateStatementContent(result, lang = "en", format = "html", me
1168
1192
  "{<e-postadress>}": props.contactEmail || "",
1169
1193
  "{<e-mailosoite>}": props.contactEmail || "",
1170
1194
  "{<e-mailadresse>}": props.contactEmail || "",
1195
+ "{<e-mailadres>}": props.contactEmail || "",
1196
+ "{<e-postadresse>}": props.contactEmail || "",
1171
1197
  "{<e-mail address>}": props.contactEmail || "",
1172
1198
  "{<email address>}": props.contactEmail || "",
1173
1199
  "{<telefonnummer>}": props.phoneNumber || "",
@@ -1187,6 +1213,7 @@ async function generateStatementContent(result, lang = "en", format = "html", me
1187
1213
  "{<assessment date>}": dateStr,
1188
1214
  "{<uppdateringsdatum>}": dateStr,
1189
1215
  "{<oppdateringsdato>}": dateStr,
1216
+ "{<opdateringsdato>}": dateStr,
1190
1217
  "{<p\xE4ivitysp\xE4iv\xE4>}": dateStr,
1191
1218
  "{<updatedatum>}": dateStr,
1192
1219
  "{<aktualisierungsdatum>}": dateStr,
@@ -1200,13 +1227,18 @@ async function generateStatementContent(result, lang = "en", format = "html", me
1200
1227
  "{<ver\xF6ffentlichungsdatum>}": props.publishDate?.toISOString().split("T")[0] || "2024-01-01",
1201
1228
  "{<date_publication>}": props.publishDate?.toISOString().split("T")[0] || "2024-01-01",
1202
1229
  "{<fecha_publicacion>}": props.publishDate?.toISOString().split("T")[0] || "2024-01-01",
1230
+ "{<offentligg\xF8relsesdato>}": props.publishDate?.toISOString().split("T")[0] || "2024-01-01",
1203
1231
  "{<publish date>}": props.publishDate?.toISOString().split("T")[0] || "2024-01-01",
1204
1232
  "{<metod>}": props.evaluationMethod || "Automated Scan",
1205
1233
  "{<metodi>}": props.evaluationMethod || "Automated Scan",
1206
1234
  "{<methode>}": props.evaluationMethod || "Automated Scan",
1235
+ "{<metode>}": props.evaluationMethod || "Automated Scan",
1236
+ "{<metodo>}": props.evaluationMethod || "Automated Scan",
1237
+ "{<m\xE9thode>}": props.evaluationMethod || "Automated Scan",
1207
1238
  "{<m\xE9todo>}": props.evaluationMethod || "Automated Scan",
1208
1239
  "{<method>}": props.evaluationMethod || "Automated Scan",
1209
1240
  "{<extern akt\xF6r>}": props.generatorTool?.name || "HolmDigital Engine",
1241
+ "{<ekstern akt\xF8r>}": props.generatorTool?.name || "HolmDigital Engine",
1210
1242
  "{<ekstern aktor>}": props.generatorTool?.name || "HolmDigital Engine",
1211
1243
  "{<ulkoinen taho>}": props.generatorTool?.name || "HolmDigital Engine",
1212
1244
  "{<externe partij>}": props.generatorTool?.name || "HolmDigital Engine",
@@ -1238,6 +1270,9 @@ async function generateStatementContent(result, lang = "en", format = "html", me
1238
1270
  }
1239
1271
  return content2;
1240
1272
  });
1273
+ processed = processed.replace(/\{<[^>]+>\}/g, (match) => {
1274
+ return substitutions[match] !== void 0 ? substitutions[match] : match;
1275
+ });
1241
1276
  processed = processed.replace(/\{([^{}]*?)\}/g, (_match, content2) => {
1242
1277
  const parts = content2.split("/");
1243
1278
  if (parts.length >= 2) {
@@ -1246,8 +1281,7 @@ async function generateStatementContent(result, lang = "en", format = "html", me
1246
1281
  if (complianceLevel === "non-compliant") idx = parts.length > 2 ? 2 : 1;
1247
1282
  return parts[idx].trim();
1248
1283
  }
1249
- const key = `{${content2}}`;
1250
- return substitutions[key] !== void 0 ? substitutions[key] : _match;
1284
+ return _match;
1251
1285
  });
1252
1286
  return processed;
1253
1287
  };
package/dist/index.mjs CHANGED
@@ -5,13 +5,13 @@ import {
5
5
  generateStatement,
6
6
  generateStatementContent,
7
7
  getEngineVersion
8
- } from "./chunk-SJF3O7SK.mjs";
8
+ } from "./chunk-BXSPTSSZ.mjs";
9
9
  import {
10
10
  getCurrentLang,
11
11
  setLanguage,
12
12
  t
13
- } from "./chunk-32WU5BD6.mjs";
14
- import "./chunk-Y6FXYEAI.mjs";
13
+ } from "./chunk-MGIEQZMZ.mjs";
14
+ import "./chunk-DIBTSSLZ.mjs";
15
15
  export {
16
16
  PseudoAutomationEngine,
17
17
  RegulatoryScanner,
@@ -1,4 +1,4 @@
1
- import "./chunk-Y6FXYEAI.mjs";
1
+ import "./chunk-DIBTSSLZ.mjs";
2
2
 
3
3
  // src/reporting/junit-generator.ts
4
4
  function generateJUnitXML(result) {
@@ -0,0 +1,39 @@
1
+ {
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 the Accessible Canada Act and the Accessibility for Ontarians with Disabilities Act, any known accessibility issues, and how you can report problems so that we can fix them.",
4
+ "sections": [
5
+ {
6
+ "id": "how-accessible",
7
+ "title": "How accessible is the website?",
8
+ "content": "{There are no known accessibility issues with this website./We know some parts of this website aren't fully accessible. See the section on non-accessible content below for more information./We know some parts of this website aren't fully accessible. See the section on non-accessible content below for more information.}"
9
+ },
10
+ {
11
+ "id": "what-to-do",
12
+ "title": "What to do if you can't access parts of this website?",
13
+ "content": "If you need content from this website that is not accessible for you, but is not within the scope of the accessibility regulations as described below, please contact us.\n\n[Our normal response time is {<response time>}.]\n\n[You can also contact us in the following ways:\n\n* email {<email address>}\n* call {<telephone number>}]"
14
+ },
15
+ {
16
+ "id": "reporting",
17
+ "title": "Reporting accessibility problems with this website",
18
+ "content": "We're always looking to improve the accessibility of this website. If you find any problems that aren't listed on this page or if we're not meeting the requirements of the accessibility regulations, contact us and let us know about the problem."
19
+ },
20
+ {
21
+ "id": "enforcement",
22
+ "title": "Enforcement procedure",
23
+ "content": "The {<enforcement_body>} is responsible for enforcing the Accessible Canada Act. 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 Accessible Canada Act or the Accessibility for Ontarians with Disabilities Act, or if your request for accessible content has not been handled appropriately."
24
+ },
25
+ {
26
+ "id": "technical",
27
+ "title": "Technical information about this website's accessibility",
28
+ "content": "{This website is fully compliant with the Accessible Canada Act and the Accessibility for Ontarians with Disabilities Act./This website is partially compliant with the Accessible Canada Act and the Accessibility for Ontarians with Disabilities Act, due to the non-compliances listed below./This website is not compliant with the Accessible Canada Act and the Accessibility for Ontarians with Disabilities Act. The non-accessible sections are listed below.}"
29
+ },
30
+ {
31
+ "content": "The content described below is, in one way or another, not fully accessible.\n\n[\n**Non-compliance with the accessibility regulations**\n\n{<issues>}\n]"
32
+ },
33
+ {
34
+ "id": "testing",
35
+ "title": "How we tested this website",
36
+ "content": "{We have performed a self-assessment (internal testing) of {<website>}./{<third party>} has tested {<website>}./We have estimated the accessibility without testing.}\n\nThe last assessment was made on {<assessment date>}.\n\n[Assessment method: {<method>}]\n\nThe website was published on {<publish date>}.\n\nThe statement was last updated on {<update date>}."
37
+ }
38
+ ]
39
+ }
@@ -0,0 +1,39 @@
1
+ {
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 the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018, any known accessibility issues, and how you can report problems so that we can fix them.",
4
+ "sections": [
5
+ {
6
+ "id": "how-accessible",
7
+ "title": "How accessible is the website?",
8
+ "content": "{There are no known accessibility issues with this website./We know some parts of this website aren't fully accessible. See the section on non-accessible content below for more information./We know some parts of this website aren't fully accessible. See the section on non-accessible content below for more information.}"
9
+ },
10
+ {
11
+ "id": "what-to-do",
12
+ "title": "What to do if you can't access parts of this website?",
13
+ "content": "If you need content from this website that is not accessible for you, but is not within the scope of the accessibility regulations as described below, please contact us.\n\n[Our normal response time is {<response time>}.]\n\n[You can also contact us in the following ways:\n\n* email {<email address>}\n* call {<telephone number>}]"
14
+ },
15
+ {
16
+ "id": "reporting",
17
+ "title": "Reporting accessibility problems with this website",
18
+ "content": "We're always looking to improve the accessibility of this website. If you find any problems that aren't listed on this page or if we're not meeting the requirements of the accessibility regulations, contact us and let us know about the problem."
19
+ },
20
+ {
21
+ "id": "enforcement",
22
+ "title": "Enforcement procedure",
23
+ "content": "The {<enforcement_body>} is responsible for enforcing the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018. If you experience accessibility issues on our website, you can submit a complaint to {<enforcement_body>}.\n\nYou can also submit a complaint to {<enforcement_body>} if you think that our assessment of what constitutes a disproportionate burden should be reviewed, if you think that our accessibility statement is inadequate, or if you think that your request for excluded content in an accessible format has not been handled correctly."
24
+ },
25
+ {
26
+ "id": "technical",
27
+ "title": "Technical information about this website's accessibility",
28
+ "content": "{This website is fully compliant with the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018./This website is partially compliant with the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018, due to the non-compliances listed below./This website is not compliant with the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018. The non-accessible sections are listed below.}"
29
+ },
30
+ {
31
+ "content": "The content described below is, in one way or another, not fully accessible.\n\n[\n**Non-compliance with the accessibility regulations**\n\n{<issues>}\n]"
32
+ },
33
+ {
34
+ "id": "testing",
35
+ "title": "How we tested this website",
36
+ "content": "{We have performed a self-assessment (internal testing) of {<website>}./{<third party>} has tested {<website>}./We have estimated the accessibility without testing.}\n\nThe last assessment was made on {<assessment date>}.\n\n[Assessment method: {<method>}]\n\nThe website was published on {<publish date>}.\n\nThe statement was last updated on {<update date>}."
37
+ }
38
+ ]
39
+ }
@@ -0,0 +1,39 @@
1
+ {
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 Section 508 of the Rehabilitation Act, any known accessibility issues, and how you can report problems so that we can fix them.",
4
+ "sections": [
5
+ {
6
+ "id": "how-accessible",
7
+ "title": "How accessible is the website?",
8
+ "content": "{There are no known accessibility issues with this website./We know some parts of this website aren't fully accessible. See the section on non-accessible content below for more information./We know some parts of this website aren't fully accessible. See the section on non-accessible content below for more information.}"
9
+ },
10
+ {
11
+ "id": "what-to-do",
12
+ "title": "What to do if you can't access parts of this website?",
13
+ "content": "If you need content from this website that is not accessible for you, but is not within the scope of the accessibility regulations as described below, please contact us.\n\n[Our normal response time is {<response time>}.]\n\n[You can also contact us in the following ways:\n\n* email {<email address>}\n* call {<telephone number>}]"
14
+ },
15
+ {
16
+ "id": "reporting",
17
+ "title": "Reporting accessibility problems with this website",
18
+ "content": "We're always looking to improve the accessibility of this website. If you find any problems that aren't listed on this page or if we're not meeting the requirements of the accessibility regulations, contact us and let us know about the problem."
19
+ },
20
+ {
21
+ "id": "enforcement",
22
+ "title": "Enforcement procedure",
23
+ "content": "The {<enforcement_body>} is responsible for enforcing Section 508 of the Rehabilitation Act and the Americans with Disabilities Act (ADA). 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 Section 508 or the ADA, or if your request for accessible content has not been handled appropriately."
24
+ },
25
+ {
26
+ "id": "technical",
27
+ "title": "Technical information about this website's accessibility",
28
+ "content": "{This website is fully compliant with Section 508 of the Rehabilitation Act./This website is partially compliant with Section 508 of the Rehabilitation Act, due to the non-compliances listed below./This website is not compliant with Section 508 of the Rehabilitation Act. The non-accessible sections are listed below.}"
29
+ },
30
+ {
31
+ "content": "The content described below is, in one way or another, not fully accessible.\n\n[\n**Non-compliance with the accessibility regulations**\n\n{<issues>}\n]"
32
+ },
33
+ {
34
+ "id": "testing",
35
+ "title": "How we tested this website",
36
+ "content": "{We have performed a self-assessment (internal testing) of {<website>}./{<third party>} has tested {<website>}./We have estimated the accessibility without testing.}\n\nThe last assessment was made on {<assessment date>}.\n\n[Assessment method: {<method>}]\n\nThe website was published on {<publish date>}.\n\nThe statement was last updated on {<update date>}."
37
+ }
38
+ ]
39
+ }