@webability/core 1.5.0 → 1.7.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/index.d.cts CHANGED
@@ -1,8 +1,41 @@
1
- import { P as PageLike, a as ScanOptions, S as ScanResult, b as SiteTheme, D as DetectedIssue, c as ScanIssue } from './types-C6Lhzod6.cjs';
2
- export { B as BrowserDetector, F as FixDetector, d as FixIssueType, I as IssueImpact, e as IssueSource, V as VIEWPORT_SIZES, f as ViewportPreset, W as WCAG_BY_ISSUE, g as WcagLevel } from './types-C6Lhzod6.cjs';
1
+ import { P as PageLike, a as ScanOptions, S as ScanResult, W as WcagLevel, b as SiteTheme, D as DetectedIssue, c as ScanIssue } from './types-CbNyAKbT.cjs';
2
+ export { B as BrowserDetector, F as FixDetector, d as FixIssueType, I as IssueImpact, e as IssueSource, V as VIEWPORT_SIZES, f as ViewportPreset, g as WCAG_BY_ISSUE } from './types-CbNyAKbT.cjs';
3
3
 
4
4
  declare function scan(target: string | PageLike, options?: ScanOptions): Promise<ScanResult>;
5
5
 
6
+ /**
7
+ * Pure issue-shaping utilities shared by the Playwright scan path
8
+ * (scanner.ts) and the in-DOM scan path (dom.ts). Moved verbatim from
9
+ * scanner.ts — no behavior changes.
10
+ */
11
+
12
+ /**
13
+ * Conformance level of every WCAG 2.2 success criterion (plus the obsolete
14
+ * 4.1.1, still reported by older engines). The ONE level table in core: the
15
+ * default AA scan drops findings whose criteria are all AAA, so a missing or
16
+ * wrong row here leaks AAA into AA reports — the set is pinned by a test.
17
+ */
18
+ declare const WCAG_LEVEL_MAP: Record<string, WcagLevel>;
19
+ declare function getWcagLevel(criterion: string): WcagLevel;
20
+ /**
21
+ * The conformance level an issue belongs to: the LOWEST level among the
22
+ * criteria it names ("2.4.4,2.4.9" is an A finding), or the engine's own
23
+ * level when it names none.
24
+ */
25
+ declare function issueLevel(issue: {
26
+ wcag?: string;
27
+ level?: WcagLevel;
28
+ }): WcagLevel;
29
+ /**
30
+ * Keep findings at `level` and below. Default scans are AA: AAA criteria are
31
+ * not reported at all (owner decision 2026-10-04 — not in issues[],
32
+ * incomplete[] or the summary); a caller opts in with `level: 'AAA'`.
33
+ */
34
+ declare function withinLevel<T extends {
35
+ wcag?: string;
36
+ level?: WcagLevel;
37
+ }>(issues: T[], level?: WcagLevel): T[];
38
+
6
39
  type TruncationEntry = {
7
40
  detector: string;
8
41
  cap: number;
@@ -37,6 +70,11 @@ interface AxeViolation {
37
70
  html: string;
38
71
  target: string[];
39
72
  failureSummary?: string;
73
+ any?: Array<{
74
+ data?: {
75
+ messageKey?: string;
76
+ };
77
+ }>;
40
78
  }>;
41
79
  }
42
80
  interface AxeRunResult {
@@ -125,4 +163,4 @@ interface DevSuggestion {
125
163
  }
126
164
  declare function generateDevSuggestion(issue: ScanIssue, framework: Framework, elementClasses?: string, fgColor?: string, bgColor?: string): DevSuggestion;
127
165
 
128
- export { type ContrastSuggestion, DetectedIssue, type DevSuggestion, type Framework, type FrameworkInfo, PageLike, ScanIssue, ScanOptions, ScanResult, SiteTheme, type TailwindSuggestion, detectFramework, dismissModals, extractSiteTheme, generateDevSuggestion, getContrastRatio, runAxe, runDetectors, scan, solveContrast, suggestTailwindFix, toHtmlReport };
166
+ export { type ContrastSuggestion, DetectedIssue, type DevSuggestion, type Framework, type FrameworkInfo, PageLike, ScanIssue, ScanOptions, ScanResult, SiteTheme, type TailwindSuggestion, WCAG_LEVEL_MAP, WcagLevel, detectFramework, dismissModals, extractSiteTheme, generateDevSuggestion, getContrastRatio, getWcagLevel, issueLevel, runAxe, runDetectors, scan, solveContrast, suggestTailwindFix, toHtmlReport, withinLevel };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,41 @@
1
- import { P as PageLike, a as ScanOptions, S as ScanResult, b as SiteTheme, D as DetectedIssue, c as ScanIssue } from './types-C6Lhzod6.js';
2
- export { B as BrowserDetector, F as FixDetector, d as FixIssueType, I as IssueImpact, e as IssueSource, V as VIEWPORT_SIZES, f as ViewportPreset, W as WCAG_BY_ISSUE, g as WcagLevel } from './types-C6Lhzod6.js';
1
+ import { P as PageLike, a as ScanOptions, S as ScanResult, W as WcagLevel, b as SiteTheme, D as DetectedIssue, c as ScanIssue } from './types-CbNyAKbT.js';
2
+ export { B as BrowserDetector, F as FixDetector, d as FixIssueType, I as IssueImpact, e as IssueSource, V as VIEWPORT_SIZES, f as ViewportPreset, g as WCAG_BY_ISSUE } from './types-CbNyAKbT.js';
3
3
 
4
4
  declare function scan(target: string | PageLike, options?: ScanOptions): Promise<ScanResult>;
5
5
 
6
+ /**
7
+ * Pure issue-shaping utilities shared by the Playwright scan path
8
+ * (scanner.ts) and the in-DOM scan path (dom.ts). Moved verbatim from
9
+ * scanner.ts — no behavior changes.
10
+ */
11
+
12
+ /**
13
+ * Conformance level of every WCAG 2.2 success criterion (plus the obsolete
14
+ * 4.1.1, still reported by older engines). The ONE level table in core: the
15
+ * default AA scan drops findings whose criteria are all AAA, so a missing or
16
+ * wrong row here leaks AAA into AA reports — the set is pinned by a test.
17
+ */
18
+ declare const WCAG_LEVEL_MAP: Record<string, WcagLevel>;
19
+ declare function getWcagLevel(criterion: string): WcagLevel;
20
+ /**
21
+ * The conformance level an issue belongs to: the LOWEST level among the
22
+ * criteria it names ("2.4.4,2.4.9" is an A finding), or the engine's own
23
+ * level when it names none.
24
+ */
25
+ declare function issueLevel(issue: {
26
+ wcag?: string;
27
+ level?: WcagLevel;
28
+ }): WcagLevel;
29
+ /**
30
+ * Keep findings at `level` and below. Default scans are AA: AAA criteria are
31
+ * not reported at all (owner decision 2026-10-04 — not in issues[],
32
+ * incomplete[] or the summary); a caller opts in with `level: 'AAA'`.
33
+ */
34
+ declare function withinLevel<T extends {
35
+ wcag?: string;
36
+ level?: WcagLevel;
37
+ }>(issues: T[], level?: WcagLevel): T[];
38
+
6
39
  type TruncationEntry = {
7
40
  detector: string;
8
41
  cap: number;
@@ -37,6 +70,11 @@ interface AxeViolation {
37
70
  html: string;
38
71
  target: string[];
39
72
  failureSummary?: string;
73
+ any?: Array<{
74
+ data?: {
75
+ messageKey?: string;
76
+ };
77
+ }>;
40
78
  }>;
41
79
  }
42
80
  interface AxeRunResult {
@@ -125,4 +163,4 @@ interface DevSuggestion {
125
163
  }
126
164
  declare function generateDevSuggestion(issue: ScanIssue, framework: Framework, elementClasses?: string, fgColor?: string, bgColor?: string): DevSuggestion;
127
165
 
128
- export { type ContrastSuggestion, DetectedIssue, type DevSuggestion, type Framework, type FrameworkInfo, PageLike, ScanIssue, ScanOptions, ScanResult, SiteTheme, type TailwindSuggestion, detectFramework, dismissModals, extractSiteTheme, generateDevSuggestion, getContrastRatio, runAxe, runDetectors, scan, solveContrast, suggestTailwindFix, toHtmlReport };
166
+ export { type ContrastSuggestion, DetectedIssue, type DevSuggestion, type Framework, type FrameworkInfo, PageLike, ScanIssue, ScanOptions, ScanResult, SiteTheme, type TailwindSuggestion, WCAG_LEVEL_MAP, WcagLevel, detectFramework, dismissModals, extractSiteTheme, generateDevSuggestion, getContrastRatio, getWcagLevel, issueLevel, runAxe, runDetectors, scan, solveContrast, suggestTailwindFix, toHtmlReport, withinLevel };