@holmdigital/engine 3.3.5 → 3.3.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.
@@ -260,7 +260,7 @@ function isInterstitialPage(pageTitle, hasMetaRefresh, bodyTextLength) {
260
260
  return false;
261
261
  }
262
262
  function getEngineVersion() {
263
- return "3.3.5";
263
+ return "3.3.7";
264
264
  }
265
265
  function getStandardsVersion() {
266
266
  try {
@@ -894,7 +894,7 @@ function isBadgeWithheldByRobustness(noScript) {
894
894
  import React from "react";
895
895
  import { renderToStaticMarkup } from "react-dom/server";
896
896
  import { AccessibilityStatement } from "@holmdigital/components";
897
- import { getEnforcementBody, getNationalLawByFramework, getNationalLaws } from "@holmdigital/standards";
897
+ import { getEnforcementBody, getNationalLawForSector, getNationalLaws } from "@holmdigital/standards";
898
898
  import fs from "fs/promises";
899
899
  import path from "path";
900
900
  var EVALUATION_METHOD = {
@@ -969,12 +969,13 @@ var NATIONAL_LAW_FALLBACK = {
969
969
  pl: "obowi\u0105zuj\u0105ce wymagania dost\u0119pno\u015Bci"
970
970
  };
971
971
  function resolveNationalLawReference(country, sector, lang = "en") {
972
+ const inForce = (law2) => !!law2 && law2.inForce !== false;
972
973
  if (country === "AU") {
973
- const ddaLaw = getNationalLawByFramework("DDA", "AU");
974
+ const ddaLaw = getNationalLaws("AU").find((l) => l.euFramework === "DDA" && inForce(l));
974
975
  return ddaLaw ? `${ddaLaw.fullName}` : "Disability Discrimination Act 1992 (Cth)";
975
976
  }
976
977
  if (country === "US") {
977
- const usLaws = getNationalLaws("US");
978
+ const usLaws = getNationalLaws("US").filter(inForce);
978
979
  const adaLaw = usLaws.find((l) => l.euFramework === "ADA" && l.scope === sector);
979
980
  if (adaLaw) {
980
981
  if (sector === "public") {
@@ -985,7 +986,7 @@ function resolveNationalLawReference(country, sector, lang = "en") {
985
986
  return hhs504 ? `${adaLaw.fullName} (${adaLaw.law}) & ${hhs504.fullName} (${hhs504.law})` : `${adaLaw.fullName} (${adaLaw.law})`;
986
987
  }
987
988
  }
988
- const law = getNationalLawByFramework(sector === "private" ? "EAA" : "WAD", country);
989
+ const law = getNationalLawForSector(country, sector);
989
990
  if (law) return `${law.fullName} (${law.law})`;
990
991
  const langKey = lang.split("-")[0];
991
992
  return NATIONAL_LAW_FALLBACK[langKey] ?? NATIONAL_LAW_FALLBACK.en;
@@ -1180,8 +1181,8 @@ async function generateStatementContent(result, lang = "en", format = "html", me
1180
1181
  "{<third party>}": props.generatorTool?.name || "HolmDigital Engine",
1181
1182
  "{<enforcement_body>}": (() => {
1182
1183
  if (country === "US") {
1183
- const adaLaw = getNationalLaws("US").find((l) => l.euFramework === "ADA" && l.scope === sector);
1184
- if (adaLaw) return adaLaw.enforcement.authorityName;
1184
+ const adaLaw = getNationalLaws("US").find((l) => l.euFramework === "ADA" && l.scope === sector && l.inForce !== false);
1185
+ if (adaLaw?.enforcement) return adaLaw.enforcement.authorityName;
1185
1186
  }
1186
1187
  return getEnforcementBody(country, sector);
1187
1188
  })(),
package/dist/cli/index.js CHANGED
@@ -1620,7 +1620,7 @@ function isInterstitialPage(pageTitle, hasMetaRefresh, bodyTextLength) {
1620
1620
  return false;
1621
1621
  }
1622
1622
  function getEngineVersion() {
1623
- return "3.3.5";
1623
+ return "3.3.7";
1624
1624
  }
1625
1625
  function getStandardsVersion() {
1626
1626
  try {
@@ -3194,12 +3194,13 @@ var NATIONAL_LAW_FALLBACK = {
3194
3194
  pl: "obowi\u0105zuj\u0105ce wymagania dost\u0119pno\u015Bci"
3195
3195
  };
3196
3196
  function resolveNationalLawReference(country, sector, lang = "en") {
3197
+ const inForce = (law2) => !!law2 && law2.inForce !== false;
3197
3198
  if (country === "AU") {
3198
- const ddaLaw = (0, import_standards3.getNationalLawByFramework)("DDA", "AU");
3199
+ const ddaLaw = (0, import_standards3.getNationalLaws)("AU").find((l) => l.euFramework === "DDA" && inForce(l));
3199
3200
  return ddaLaw ? `${ddaLaw.fullName}` : "Disability Discrimination Act 1992 (Cth)";
3200
3201
  }
3201
3202
  if (country === "US") {
3202
- const usLaws = (0, import_standards3.getNationalLaws)("US");
3203
+ const usLaws = (0, import_standards3.getNationalLaws)("US").filter(inForce);
3203
3204
  const adaLaw = usLaws.find((l) => l.euFramework === "ADA" && l.scope === sector);
3204
3205
  if (adaLaw) {
3205
3206
  if (sector === "public") {
@@ -3210,7 +3211,7 @@ function resolveNationalLawReference(country, sector, lang = "en") {
3210
3211
  return hhs504 ? `${adaLaw.fullName} (${adaLaw.law}) & ${hhs504.fullName} (${hhs504.law})` : `${adaLaw.fullName} (${adaLaw.law})`;
3211
3212
  }
3212
3213
  }
3213
- const law = (0, import_standards3.getNationalLawByFramework)(sector === "private" ? "EAA" : "WAD", country);
3214
+ const law = (0, import_standards3.getNationalLawForSector)(country, sector);
3214
3215
  if (law) return `${law.fullName} (${law.law})`;
3215
3216
  const langKey = lang.split("-")[0];
3216
3217
  return NATIONAL_LAW_FALLBACK[langKey] ?? NATIONAL_LAW_FALLBACK.en;
@@ -3405,8 +3406,8 @@ async function generateStatementContent(result, lang = "en", format = "html", me
3405
3406
  "{<third party>}": props.generatorTool?.name || "HolmDigital Engine",
3406
3407
  "{<enforcement_body>}": (() => {
3407
3408
  if (country === "US") {
3408
- const adaLaw = (0, import_standards3.getNationalLaws)("US").find((l) => l.euFramework === "ADA" && l.scope === sector);
3409
- if (adaLaw) return adaLaw.enforcement.authorityName;
3409
+ const adaLaw = (0, import_standards3.getNationalLaws)("US").find((l) => l.euFramework === "ADA" && l.scope === sector && l.inForce !== false);
3410
+ if (adaLaw?.enforcement) return adaLaw.enforcement.authorityName;
3410
3411
  }
3411
3412
  return (0, import_standards3.getEnforcementBody)(country, sector);
3412
3413
  })(),
@@ -8,7 +8,7 @@ import {
8
8
  generateStatementContent,
9
9
  getEngineVersion,
10
10
  isBadgeWithheldByRobustness
11
- } from "../chunk-IIMWQT4T.mjs";
11
+ } from "../chunk-3Q67AFEW.mjs";
12
12
  import {
13
13
  groupReportsByRule,
14
14
  impactBreakdown,
package/dist/index.js CHANGED
@@ -1228,7 +1228,7 @@ function isInterstitialPage(pageTitle, hasMetaRefresh, bodyTextLength) {
1228
1228
  return false;
1229
1229
  }
1230
1230
  function getEngineVersion() {
1231
- return "3.3.5";
1231
+ return "3.3.7";
1232
1232
  }
1233
1233
  function getStandardsVersion() {
1234
1234
  try {
@@ -1940,12 +1940,13 @@ var NATIONAL_LAW_FALLBACK = {
1940
1940
  pl: "obowi\u0105zuj\u0105ce wymagania dost\u0119pno\u015Bci"
1941
1941
  };
1942
1942
  function resolveNationalLawReference(country, sector, lang = "en") {
1943
+ const inForce = (law2) => !!law2 && law2.inForce !== false;
1943
1944
  if (country === "AU") {
1944
- const ddaLaw = (0, import_standards.getNationalLawByFramework)("DDA", "AU");
1945
+ const ddaLaw = (0, import_standards.getNationalLaws)("AU").find((l) => l.euFramework === "DDA" && inForce(l));
1945
1946
  return ddaLaw ? `${ddaLaw.fullName}` : "Disability Discrimination Act 1992 (Cth)";
1946
1947
  }
1947
1948
  if (country === "US") {
1948
- const usLaws = (0, import_standards.getNationalLaws)("US");
1949
+ const usLaws = (0, import_standards.getNationalLaws)("US").filter(inForce);
1949
1950
  const adaLaw = usLaws.find((l) => l.euFramework === "ADA" && l.scope === sector);
1950
1951
  if (adaLaw) {
1951
1952
  if (sector === "public") {
@@ -1956,7 +1957,7 @@ function resolveNationalLawReference(country, sector, lang = "en") {
1956
1957
  return hhs504 ? `${adaLaw.fullName} (${adaLaw.law}) & ${hhs504.fullName} (${hhs504.law})` : `${adaLaw.fullName} (${adaLaw.law})`;
1957
1958
  }
1958
1959
  }
1959
- const law = (0, import_standards.getNationalLawByFramework)(sector === "private" ? "EAA" : "WAD", country);
1960
+ const law = (0, import_standards.getNationalLawForSector)(country, sector);
1960
1961
  if (law) return `${law.fullName} (${law.law})`;
1961
1962
  const langKey = lang.split("-")[0];
1962
1963
  return NATIONAL_LAW_FALLBACK[langKey] ?? NATIONAL_LAW_FALLBACK.en;
@@ -2151,8 +2152,8 @@ async function generateStatementContent(result, lang = "en", format = "html", me
2151
2152
  "{<third party>}": props.generatorTool?.name || "HolmDigital Engine",
2152
2153
  "{<enforcement_body>}": (() => {
2153
2154
  if (country === "US") {
2154
- const adaLaw = (0, import_standards.getNationalLaws)("US").find((l) => l.euFramework === "ADA" && l.scope === sector);
2155
- if (adaLaw) return adaLaw.enforcement.authorityName;
2155
+ const adaLaw = (0, import_standards.getNationalLaws)("US").find((l) => l.euFramework === "ADA" && l.scope === sector && l.inForce !== false);
2156
+ if (adaLaw?.enforcement) return adaLaw.enforcement.authorityName;
2156
2157
  }
2157
2158
  return (0, import_standards.getEnforcementBody)(country, sector);
2158
2159
  })(),
package/dist/index.mjs CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  resolveNationalLawReference,
18
18
  selectMappedRuleId,
19
19
  wcagTagToCriterion
20
- } from "./chunk-IIMWQT4T.mjs";
20
+ } from "./chunk-3Q67AFEW.mjs";
21
21
  import {
22
22
  getCurrentLang,
23
23
  setLanguage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holmdigital/engine",
3
- "version": "3.3.5",
3
+ "version": "3.3.7",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -85,8 +85,8 @@
85
85
  "node": ">=22.22.0"
86
86
  },
87
87
  "dependencies": {
88
- "@holmdigital/components": "^4.0.0",
89
- "@holmdigital/standards": "^3.0.6",
88
+ "@holmdigital/components": "^4.0.1",
89
+ "@holmdigital/standards": "^4.0.0",
90
90
  "axe-core": "^4.13.0",
91
91
  "chalk": "^6.0.0",
92
92
  "commander": "^15.0.0",
@@ -100,9 +100,9 @@
100
100
  },
101
101
  "devDependencies": {
102
102
  "@types/cosmiconfig": "^6.0.3",
103
- "@types/node": "^26.1.1",
104
- "@types/react": "^18.3.1 || ^19.0.0",
105
- "@types/react-dom": "^18.3.1 || ^19.0.0",
103
+ "@types/node": "^26.4.1",
104
+ "@types/react": "^19.2.18",
105
+ "@types/react-dom": "^19.2.7",
106
106
  "@types/ws": "^8.5.13",
107
107
  "tsup": "^8.3.5",
108
108
  "typescript": "^6.0.3",