@holmdigital/engine 3.3.0 → 3.3.1
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-56LAC5FY.mjs → chunk-VCZZMEKN.mjs} +15 -3
- package/dist/cli/index.js +14 -3
- package/dist/cli/index.mjs +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +16 -3
- package/dist/index.mjs +3 -1
- package/package.json +1 -1
|
@@ -213,6 +213,13 @@ function wcagTagToCriterion(tag) {
|
|
|
213
213
|
function criteriaFromTags(tags) {
|
|
214
214
|
return tags.map(wcagTagToCriterion).filter((c) => c !== null);
|
|
215
215
|
}
|
|
216
|
+
function en301549FromTags(tags) {
|
|
217
|
+
for (const tag of tags) {
|
|
218
|
+
const m = /^EN-(9(?:\.\d+){1,3})$/.exec(tag);
|
|
219
|
+
if (m) return m[1];
|
|
220
|
+
}
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
216
223
|
function compareCriteria(a, b) {
|
|
217
224
|
const pa = a.split(".").map(Number);
|
|
218
225
|
const pb = b.split(".").map(Number);
|
|
@@ -253,7 +260,7 @@ function isInterstitialPage(pageTitle, hasMetaRefresh, bodyTextLength) {
|
|
|
253
260
|
return false;
|
|
254
261
|
}
|
|
255
262
|
function getEngineVersion() {
|
|
256
|
-
return "3.3.
|
|
263
|
+
return "3.3.1";
|
|
257
264
|
}
|
|
258
265
|
function getStandardsVersion() {
|
|
259
266
|
try {
|
|
@@ -511,7 +518,9 @@ var RegulatoryScanner = class {
|
|
|
511
518
|
wcagCriteria: report?.wcagCriteria || criteriaFromTags(violation.tags)[0] || (violation.tags.includes("best-practice") ? "Best Practice" : "Unknown"),
|
|
512
519
|
// Intern #29: fyll från rapporten. Omappat fynd → okänt lagrum, aldrig
|
|
513
520
|
// tom sträng och aldrig en fras som utger sig för att vara ett lagrum.
|
|
514
|
-
|
|
521
|
+
// Intern #39: för omappade fynd, använd EN-9.x ur axes egen tagg som
|
|
522
|
+
// fallback innan 'Unknown' — matchad regeldata går alltid först.
|
|
523
|
+
en301549Criteria: report?.en301549Criteria || en301549FromTags(violation.tags) || "Unknown",
|
|
515
524
|
dosLagenReference: report?.dosLagenReference || (lang === "sv" ? "Lagrum ok\xE4nt" : "Legal basis unknown"),
|
|
516
525
|
diggRisk: risk,
|
|
517
526
|
eaaImpact: risk,
|
|
@@ -593,7 +602,9 @@ var RegulatoryScanner = class {
|
|
|
593
602
|
reports.push({
|
|
594
603
|
ruleId: violation.id,
|
|
595
604
|
wcagCriteria: isBestPractice ? "Best Practice" : "Unknown",
|
|
596
|
-
|
|
605
|
+
// Intern #39: omappat fynd → EN-9.x ur axes egen tagg som fallback
|
|
606
|
+
// före 'Unknown'. Best practice behåller 'N/A'. Rör aldrig matchade.
|
|
607
|
+
en301549Criteria: isBestPractice ? "N/A" : en301549FromTags(violation.tags) || "Unknown",
|
|
597
608
|
dosLagenReference: isBestPractice ? fallback.bestPracticeRef : fallback.manualRef,
|
|
598
609
|
diggRisk: riskLevel,
|
|
599
610
|
eaaImpact: riskLevel,
|
|
@@ -1254,6 +1265,7 @@ export {
|
|
|
1254
1265
|
probeWithoutJavaScript,
|
|
1255
1266
|
wcagTagToCriterion,
|
|
1256
1267
|
criteriaFromTags,
|
|
1268
|
+
en301549FromTags,
|
|
1257
1269
|
getSelfMatchingRuleIds,
|
|
1258
1270
|
selectMappedRuleId,
|
|
1259
1271
|
isInterstitialPage,
|
package/dist/cli/index.js
CHANGED
|
@@ -1535,6 +1535,13 @@ function wcagTagToCriterion(tag) {
|
|
|
1535
1535
|
function criteriaFromTags(tags) {
|
|
1536
1536
|
return tags.map(wcagTagToCriterion).filter((c) => c !== null);
|
|
1537
1537
|
}
|
|
1538
|
+
function en301549FromTags(tags) {
|
|
1539
|
+
for (const tag of tags) {
|
|
1540
|
+
const m = /^EN-(9(?:\.\d+){1,3})$/.exec(tag);
|
|
1541
|
+
if (m) return m[1];
|
|
1542
|
+
}
|
|
1543
|
+
return null;
|
|
1544
|
+
}
|
|
1538
1545
|
function compareCriteria(a, b) {
|
|
1539
1546
|
const pa = a.split(".").map(Number);
|
|
1540
1547
|
const pb = b.split(".").map(Number);
|
|
@@ -1575,7 +1582,7 @@ function isInterstitialPage(pageTitle, hasMetaRefresh, bodyTextLength) {
|
|
|
1575
1582
|
return false;
|
|
1576
1583
|
}
|
|
1577
1584
|
function getEngineVersion() {
|
|
1578
|
-
return "3.3.
|
|
1585
|
+
return "3.3.1";
|
|
1579
1586
|
}
|
|
1580
1587
|
function getStandardsVersion() {
|
|
1581
1588
|
try {
|
|
@@ -1833,7 +1840,9 @@ var RegulatoryScanner = class {
|
|
|
1833
1840
|
wcagCriteria: report?.wcagCriteria || criteriaFromTags(violation.tags)[0] || (violation.tags.includes("best-practice") ? "Best Practice" : "Unknown"),
|
|
1834
1841
|
// Intern #29: fyll från rapporten. Omappat fynd → okänt lagrum, aldrig
|
|
1835
1842
|
// tom sträng och aldrig en fras som utger sig för att vara ett lagrum.
|
|
1836
|
-
|
|
1843
|
+
// Intern #39: för omappade fynd, använd EN-9.x ur axes egen tagg som
|
|
1844
|
+
// fallback innan 'Unknown' — matchad regeldata går alltid först.
|
|
1845
|
+
en301549Criteria: report?.en301549Criteria || en301549FromTags(violation.tags) || "Unknown",
|
|
1837
1846
|
dosLagenReference: report?.dosLagenReference || (lang === "sv" ? "Lagrum ok\xE4nt" : "Legal basis unknown"),
|
|
1838
1847
|
diggRisk: risk,
|
|
1839
1848
|
eaaImpact: risk,
|
|
@@ -1915,7 +1924,9 @@ var RegulatoryScanner = class {
|
|
|
1915
1924
|
reports.push({
|
|
1916
1925
|
ruleId: violation.id,
|
|
1917
1926
|
wcagCriteria: isBestPractice ? "Best Practice" : "Unknown",
|
|
1918
|
-
|
|
1927
|
+
// Intern #39: omappat fynd → EN-9.x ur axes egen tagg som fallback
|
|
1928
|
+
// före 'Unknown'. Best practice behåller 'N/A'. Rör aldrig matchade.
|
|
1929
|
+
en301549Criteria: isBestPractice ? "N/A" : en301549FromTags(violation.tags) || "Unknown",
|
|
1919
1930
|
dosLagenReference: isBestPractice ? fallback.bestPracticeRef : fallback.manualRef,
|
|
1920
1931
|
diggRisk: riskLevel,
|
|
1921
1932
|
eaaImpact: riskLevel,
|
package/dist/cli/index.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -44,6 +44,7 @@ declare function probeWithoutJavaScript(browser: Browser, options: NoScriptProbe
|
|
|
44
44
|
|
|
45
45
|
declare function wcagTagToCriterion(tag: string): string | null;
|
|
46
46
|
declare function criteriaFromTags(tags: string[]): string[];
|
|
47
|
+
declare function en301549FromTags(tags: string[]): string | null;
|
|
47
48
|
declare function getSelfMatchingRuleIds(rules: ConvergenceRule[]): Set<string>;
|
|
48
49
|
declare function selectMappedRuleId(ruleId: string, tags: string[], rules: ConvergenceRule[], selfMatchingIds?: Set<string>): string | null;
|
|
49
50
|
declare function isInterstitialPage(pageTitle: string | undefined, hasMetaRefresh: boolean, bodyTextLength: number): boolean;
|
|
@@ -258,4 +259,4 @@ declare function resolveNationalLawReference(country: Country, sector: 'public'
|
|
|
258
259
|
declare function generateStatementContent(result: ScanResult, lang?: string, format?: 'html' | 'md' | 'markdown', metadata?: StatementMetadata): Promise<string>;
|
|
259
260
|
declare function generateStatement(result: ScanResult, outputPath: string, lang?: string, format?: 'html' | 'md' | 'markdown', metadata?: StatementMetadata): Promise<void>;
|
|
260
261
|
|
|
261
|
-
export { NOSCRIPT_EMPTY_THRESHOLD, NOSCRIPT_PARTIAL_THRESHOLD, type NoScriptProbeMeasurement, type NoScriptProbeOptions, type NoScriptResult, type NoScriptVerdict, PseudoAutomationEngine, RegulatoryScanner, type ScanMetadata, type ScanResult, type ScannerOptions, type StatementMetadata, VirtualDOMBuilder, type VirtualDOMConfig, type VirtualNode, criteriaFromTags, evaluateNoScriptCoverage, generateStatement, generateStatementContent, getCurrentLang, getEngineVersion, getSelfMatchingRuleIds, getStandardsVersion, isInterstitialPage, probeWithoutJavaScript, resolveNationalLawReference, selectMappedRuleId, setLanguage, t, wcagTagToCriterion };
|
|
262
|
+
export { NOSCRIPT_EMPTY_THRESHOLD, NOSCRIPT_PARTIAL_THRESHOLD, type NoScriptProbeMeasurement, type NoScriptProbeOptions, type NoScriptResult, type NoScriptVerdict, PseudoAutomationEngine, RegulatoryScanner, type ScanMetadata, type ScanResult, type ScannerOptions, type StatementMetadata, VirtualDOMBuilder, type VirtualDOMConfig, type VirtualNode, criteriaFromTags, en301549FromTags, evaluateNoScriptCoverage, generateStatement, generateStatementContent, getCurrentLang, getEngineVersion, getSelfMatchingRuleIds, getStandardsVersion, isInterstitialPage, probeWithoutJavaScript, resolveNationalLawReference, selectMappedRuleId, setLanguage, t, wcagTagToCriterion };
|
package/dist/index.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ declare function probeWithoutJavaScript(browser: Browser, options: NoScriptProbe
|
|
|
44
44
|
|
|
45
45
|
declare function wcagTagToCriterion(tag: string): string | null;
|
|
46
46
|
declare function criteriaFromTags(tags: string[]): string[];
|
|
47
|
+
declare function en301549FromTags(tags: string[]): string | null;
|
|
47
48
|
declare function getSelfMatchingRuleIds(rules: ConvergenceRule[]): Set<string>;
|
|
48
49
|
declare function selectMappedRuleId(ruleId: string, tags: string[], rules: ConvergenceRule[], selfMatchingIds?: Set<string>): string | null;
|
|
49
50
|
declare function isInterstitialPage(pageTitle: string | undefined, hasMetaRefresh: boolean, bodyTextLength: number): boolean;
|
|
@@ -258,4 +259,4 @@ declare function resolveNationalLawReference(country: Country, sector: 'public'
|
|
|
258
259
|
declare function generateStatementContent(result: ScanResult, lang?: string, format?: 'html' | 'md' | 'markdown', metadata?: StatementMetadata): Promise<string>;
|
|
259
260
|
declare function generateStatement(result: ScanResult, outputPath: string, lang?: string, format?: 'html' | 'md' | 'markdown', metadata?: StatementMetadata): Promise<void>;
|
|
260
261
|
|
|
261
|
-
export { NOSCRIPT_EMPTY_THRESHOLD, NOSCRIPT_PARTIAL_THRESHOLD, type NoScriptProbeMeasurement, type NoScriptProbeOptions, type NoScriptResult, type NoScriptVerdict, PseudoAutomationEngine, RegulatoryScanner, type ScanMetadata, type ScanResult, type ScannerOptions, type StatementMetadata, VirtualDOMBuilder, type VirtualDOMConfig, type VirtualNode, criteriaFromTags, evaluateNoScriptCoverage, generateStatement, generateStatementContent, getCurrentLang, getEngineVersion, getSelfMatchingRuleIds, getStandardsVersion, isInterstitialPage, probeWithoutJavaScript, resolveNationalLawReference, selectMappedRuleId, setLanguage, t, wcagTagToCriterion };
|
|
262
|
+
export { NOSCRIPT_EMPTY_THRESHOLD, NOSCRIPT_PARTIAL_THRESHOLD, type NoScriptProbeMeasurement, type NoScriptProbeOptions, type NoScriptResult, type NoScriptVerdict, PseudoAutomationEngine, RegulatoryScanner, type ScanMetadata, type ScanResult, type ScannerOptions, type StatementMetadata, VirtualDOMBuilder, type VirtualDOMConfig, type VirtualNode, criteriaFromTags, en301549FromTags, evaluateNoScriptCoverage, generateStatement, generateStatementContent, getCurrentLang, getEngineVersion, getSelfMatchingRuleIds, getStandardsVersion, isInterstitialPage, probeWithoutJavaScript, resolveNationalLawReference, selectMappedRuleId, setLanguage, t, wcagTagToCriterion };
|
package/dist/index.js
CHANGED
|
@@ -951,6 +951,7 @@ __export(index_exports, {
|
|
|
951
951
|
RegulatoryScanner: () => RegulatoryScanner,
|
|
952
952
|
VirtualDOMBuilder: () => VirtualDOMBuilder,
|
|
953
953
|
criteriaFromTags: () => criteriaFromTags,
|
|
954
|
+
en301549FromTags: () => en301549FromTags,
|
|
954
955
|
evaluateNoScriptCoverage: () => evaluateNoScriptCoverage,
|
|
955
956
|
generateStatement: () => generateStatement,
|
|
956
957
|
generateStatementContent: () => generateStatementContent,
|
|
@@ -1180,6 +1181,13 @@ function wcagTagToCriterion(tag) {
|
|
|
1180
1181
|
function criteriaFromTags(tags) {
|
|
1181
1182
|
return tags.map(wcagTagToCriterion).filter((c) => c !== null);
|
|
1182
1183
|
}
|
|
1184
|
+
function en301549FromTags(tags) {
|
|
1185
|
+
for (const tag of tags) {
|
|
1186
|
+
const m = /^EN-(9(?:\.\d+){1,3})$/.exec(tag);
|
|
1187
|
+
if (m) return m[1];
|
|
1188
|
+
}
|
|
1189
|
+
return null;
|
|
1190
|
+
}
|
|
1183
1191
|
function compareCriteria(a, b) {
|
|
1184
1192
|
const pa = a.split(".").map(Number);
|
|
1185
1193
|
const pb = b.split(".").map(Number);
|
|
@@ -1220,7 +1228,7 @@ function isInterstitialPage(pageTitle, hasMetaRefresh, bodyTextLength) {
|
|
|
1220
1228
|
return false;
|
|
1221
1229
|
}
|
|
1222
1230
|
function getEngineVersion() {
|
|
1223
|
-
return "3.3.
|
|
1231
|
+
return "3.3.1";
|
|
1224
1232
|
}
|
|
1225
1233
|
function getStandardsVersion() {
|
|
1226
1234
|
try {
|
|
@@ -1478,7 +1486,9 @@ var RegulatoryScanner = class {
|
|
|
1478
1486
|
wcagCriteria: report?.wcagCriteria || criteriaFromTags(violation.tags)[0] || (violation.tags.includes("best-practice") ? "Best Practice" : "Unknown"),
|
|
1479
1487
|
// Intern #29: fyll från rapporten. Omappat fynd → okänt lagrum, aldrig
|
|
1480
1488
|
// tom sträng och aldrig en fras som utger sig för att vara ett lagrum.
|
|
1481
|
-
|
|
1489
|
+
// Intern #39: för omappade fynd, använd EN-9.x ur axes egen tagg som
|
|
1490
|
+
// fallback innan 'Unknown' — matchad regeldata går alltid först.
|
|
1491
|
+
en301549Criteria: report?.en301549Criteria || en301549FromTags(violation.tags) || "Unknown",
|
|
1482
1492
|
dosLagenReference: report?.dosLagenReference || (lang === "sv" ? "Lagrum ok\xE4nt" : "Legal basis unknown"),
|
|
1483
1493
|
diggRisk: risk,
|
|
1484
1494
|
eaaImpact: risk,
|
|
@@ -1560,7 +1570,9 @@ var RegulatoryScanner = class {
|
|
|
1560
1570
|
reports.push({
|
|
1561
1571
|
ruleId: violation.id,
|
|
1562
1572
|
wcagCriteria: isBestPractice ? "Best Practice" : "Unknown",
|
|
1563
|
-
|
|
1573
|
+
// Intern #39: omappat fynd → EN-9.x ur axes egen tagg som fallback
|
|
1574
|
+
// före 'Unknown'. Best practice behåller 'N/A'. Rör aldrig matchade.
|
|
1575
|
+
en301549Criteria: isBestPractice ? "N/A" : en301549FromTags(violation.tags) || "Unknown",
|
|
1564
1576
|
dosLagenReference: isBestPractice ? fallback.bestPracticeRef : fallback.manualRef,
|
|
1565
1577
|
diggRisk: riskLevel,
|
|
1566
1578
|
eaaImpact: riskLevel,
|
|
@@ -2223,6 +2235,7 @@ async function generateStatement(result, outputPath, lang = "en", format = "html
|
|
|
2223
2235
|
RegulatoryScanner,
|
|
2224
2236
|
VirtualDOMBuilder,
|
|
2225
2237
|
criteriaFromTags,
|
|
2238
|
+
en301549FromTags,
|
|
2226
2239
|
evaluateNoScriptCoverage,
|
|
2227
2240
|
generateStatement,
|
|
2228
2241
|
generateStatementContent,
|
package/dist/index.mjs
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
RegulatoryScanner,
|
|
6
6
|
VirtualDOMBuilder,
|
|
7
7
|
criteriaFromTags,
|
|
8
|
+
en301549FromTags,
|
|
8
9
|
evaluateNoScriptCoverage,
|
|
9
10
|
generateStatement,
|
|
10
11
|
generateStatementContent,
|
|
@@ -16,7 +17,7 @@ import {
|
|
|
16
17
|
resolveNationalLawReference,
|
|
17
18
|
selectMappedRuleId,
|
|
18
19
|
wcagTagToCriterion
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-VCZZMEKN.mjs";
|
|
20
21
|
import {
|
|
21
22
|
getCurrentLang,
|
|
22
23
|
setLanguage,
|
|
@@ -31,6 +32,7 @@ export {
|
|
|
31
32
|
RegulatoryScanner,
|
|
32
33
|
VirtualDOMBuilder,
|
|
33
34
|
criteriaFromTags,
|
|
35
|
+
en301549FromTags,
|
|
34
36
|
evaluateNoScriptCoverage,
|
|
35
37
|
generateStatement,
|
|
36
38
|
generateStatementContent,
|