@webability/core 1.7.0 → 1.9.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/NOTICES.md +0 -16
- package/README.md +1 -1
- package/dist/dom.cjs +51 -29
- package/dist/dom.d.cts +8 -5
- package/dist/dom.d.ts +8 -5
- package/dist/dom.js +51 -29
- package/dist/engine.cjs +414 -0
- package/dist/engine.d.cts +565 -0
- package/dist/engine.d.ts +565 -0
- package/dist/engine.js +414 -0
- package/dist/index.cjs +61 -43
- package/dist/index.d.cts +59 -3
- package/dist/index.d.ts +59 -3
- package/dist/index.js +61 -43
- package/dist/playwright.cjs +51 -33
- package/dist/playwright.d.cts +1 -1
- package/dist/playwright.d.ts +1 -1
- package/dist/playwright.js +51 -33
- package/dist/types-g-bI_MhR.d.cts +514 -0
- package/dist/types-g-bI_MhR.d.ts +514 -0
- package/package.json +17 -3
- package/dist/types-CbNyAKbT.d.cts +0 -257
- package/dist/types-CbNyAKbT.d.ts +0 -257
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PageLike,
|
|
2
|
-
export { B as BrowserDetector,
|
|
1
|
+
import { P as PageLike, S as ScanOptions, a as ScanResult, W as WcagLevel, b as SiteTheme, F as FixDetector, I as InternalBug, D as DetectedIssue, c as ScanIssue } from './types-g-bI_MhR.cjs';
|
|
2
|
+
export { B as BrowserDetector, d as DEFAULT_JUDGE_BASE_URL, e as DEFAULT_JUDGE_TEXT_MODEL, f as DEFAULT_JUDGE_VISION_MODEL, g as FixIssueType, h as IssueImpact, i as IssueSource, J as JUDGE_DEFAULT_TIMEOUT_MS, j as JUDGE_SYSTEM_PROMPT, k as JudgeChatBody, l as JudgeItem, m as JudgeOptions, n as JudgeRequest, o as JudgeTransport, p as JudgeVerdict, q as JudgedEntry, V as VIEWPORT_SIZES, r as ViewportPreset, s as WCAG_BY_ISSUE, t as buildJudgeChatBody, u as hostedJudgeTransport, v as judgeUndecided, w as openAiCompatibleTransport, x as resetJudgeCache } from './types-g-bI_MhR.cjs';
|
|
3
3
|
|
|
4
4
|
declare function scan(target: string | PageLike, options?: ScanOptions): Promise<ScanResult>;
|
|
5
5
|
|
|
@@ -55,10 +55,55 @@ interface RunDetectorsOptions {
|
|
|
55
55
|
* page.keyboard those checks mostly land in needs-review anyway.
|
|
56
56
|
*/
|
|
57
57
|
skipFocusMutating?: boolean;
|
|
58
|
+
/** Test seam: extra detectors run serially after the focus detectors, each guarded. */
|
|
59
|
+
extraSerialDetectors?: FixDetector[];
|
|
60
|
+
/** Out: invariant-P entries (state a detector left behind, unmarked injections). */
|
|
61
|
+
internalBugs?: InternalBug[];
|
|
58
62
|
}
|
|
59
63
|
declare function runDetectors(page: PageLike, outTruncated?: TruncationEntry[], outWarnings?: string[], options?: RunDetectorsOptions): Promise<DetectedIssue[]>;
|
|
60
64
|
declare function extractSiteTheme(page: PageLike): Promise<SiteTheme>;
|
|
61
65
|
|
|
66
|
+
declare const REASON_TEXT: {
|
|
67
|
+
readonly 'not-found': "selector matched no elements";
|
|
68
|
+
readonly 'not-verifiable': "not checked by any WebAbility tool";
|
|
69
|
+
readonly unknown_rule: "not a known rule id";
|
|
70
|
+
readonly 'unsupported-selector': "selectors that pierce shadow DOM (\">>>\") or iframes cannot be scoped by verify_fix";
|
|
71
|
+
};
|
|
72
|
+
/** Shadow-piercing / frame-piercing selector joiners (axe-style `>>>`, `>>`). */
|
|
73
|
+
declare function isPiercingSelector(selector: string): boolean;
|
|
74
|
+
interface CoverageSources {
|
|
75
|
+
axeRules: () => Array<{
|
|
76
|
+
tags?: string[];
|
|
77
|
+
}> | Promise<Array<{
|
|
78
|
+
tags?: string[];
|
|
79
|
+
}>>;
|
|
80
|
+
detectorCriteria: () => readonly string[];
|
|
81
|
+
/** Every rule id verify_fix accepts as `wcag` besides a criterion: axe ids + detector issue types. */
|
|
82
|
+
ruleIds: () => readonly string[] | Promise<readonly string[]>;
|
|
83
|
+
}
|
|
84
|
+
/** Union of every engine's criteria. Throws if any registry cannot be read. */
|
|
85
|
+
declare function coveredCriteria(sources?: CoverageSources): Promise<Set<string>>;
|
|
86
|
+
type Verifiability = {
|
|
87
|
+
verifiable: true;
|
|
88
|
+
} | {
|
|
89
|
+
verifiable: false;
|
|
90
|
+
reason: 'not-verifiable';
|
|
91
|
+
};
|
|
92
|
+
/** Fail closed: empty or unbuildable coverage, or an uncovered criterion, is not-verifiable. */
|
|
93
|
+
declare function criterionVerifiability(wcag: string, sources?: CoverageSources): Promise<Verifiability>;
|
|
94
|
+
interface VerifyFixRefusal {
|
|
95
|
+
reason: keyof typeof REASON_TEXT;
|
|
96
|
+
text: string;
|
|
97
|
+
isError?: boolean;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The pre-scan refusals verify_fix applies, in one place: a rule id no engine
|
|
101
|
+
* knows (an unknown id matches nothing, which would read as VERIFIED), a
|
|
102
|
+
* criterion no engine can fail, and a selector that crosses a shadow root or
|
|
103
|
+
* iframe. Returns null when verification may proceed.
|
|
104
|
+
*/
|
|
105
|
+
declare function verifyFixRefusal(wcag: string | undefined, selector: string, sources?: CoverageSources): Promise<VerifyFixRefusal | null>;
|
|
106
|
+
|
|
62
107
|
interface AxeViolation {
|
|
63
108
|
id: string;
|
|
64
109
|
impact: string;
|
|
@@ -74,6 +119,17 @@ interface AxeViolation {
|
|
|
74
119
|
data?: {
|
|
75
120
|
messageKey?: string;
|
|
76
121
|
};
|
|
122
|
+
relatedNodes?: Array<{
|
|
123
|
+
target?: unknown;
|
|
124
|
+
}>;
|
|
125
|
+
}>;
|
|
126
|
+
none?: Array<{
|
|
127
|
+
data?: {
|
|
128
|
+
messageKey?: string;
|
|
129
|
+
};
|
|
130
|
+
relatedNodes?: Array<{
|
|
131
|
+
target?: unknown;
|
|
132
|
+
}>;
|
|
77
133
|
}>;
|
|
78
134
|
}>;
|
|
79
135
|
}
|
|
@@ -163,4 +219,4 @@ interface DevSuggestion {
|
|
|
163
219
|
}
|
|
164
220
|
declare function generateDevSuggestion(issue: ScanIssue, framework: Framework, elementClasses?: string, fgColor?: string, bgColor?: string): DevSuggestion;
|
|
165
221
|
|
|
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 };
|
|
222
|
+
export { type ContrastSuggestion, type CoverageSources, DetectedIssue, type DevSuggestion, FixDetector, type Framework, type FrameworkInfo, InternalBug, PageLike, REASON_TEXT, ScanIssue, ScanOptions, ScanResult, SiteTheme, type TailwindSuggestion, type Verifiability, WCAG_LEVEL_MAP, WcagLevel, coveredCriteria, criterionVerifiability, detectFramework, dismissModals, extractSiteTheme, generateDevSuggestion, getContrastRatio, getWcagLevel, isPiercingSelector, issueLevel, runAxe, runDetectors, scan, solveContrast, suggestTailwindFix, toHtmlReport, verifyFixRefusal, withinLevel };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PageLike,
|
|
2
|
-
export { B as BrowserDetector,
|
|
1
|
+
import { P as PageLike, S as ScanOptions, a as ScanResult, W as WcagLevel, b as SiteTheme, F as FixDetector, I as InternalBug, D as DetectedIssue, c as ScanIssue } from './types-g-bI_MhR.js';
|
|
2
|
+
export { B as BrowserDetector, d as DEFAULT_JUDGE_BASE_URL, e as DEFAULT_JUDGE_TEXT_MODEL, f as DEFAULT_JUDGE_VISION_MODEL, g as FixIssueType, h as IssueImpact, i as IssueSource, J as JUDGE_DEFAULT_TIMEOUT_MS, j as JUDGE_SYSTEM_PROMPT, k as JudgeChatBody, l as JudgeItem, m as JudgeOptions, n as JudgeRequest, o as JudgeTransport, p as JudgeVerdict, q as JudgedEntry, V as VIEWPORT_SIZES, r as ViewportPreset, s as WCAG_BY_ISSUE, t as buildJudgeChatBody, u as hostedJudgeTransport, v as judgeUndecided, w as openAiCompatibleTransport, x as resetJudgeCache } from './types-g-bI_MhR.js';
|
|
3
3
|
|
|
4
4
|
declare function scan(target: string | PageLike, options?: ScanOptions): Promise<ScanResult>;
|
|
5
5
|
|
|
@@ -55,10 +55,55 @@ interface RunDetectorsOptions {
|
|
|
55
55
|
* page.keyboard those checks mostly land in needs-review anyway.
|
|
56
56
|
*/
|
|
57
57
|
skipFocusMutating?: boolean;
|
|
58
|
+
/** Test seam: extra detectors run serially after the focus detectors, each guarded. */
|
|
59
|
+
extraSerialDetectors?: FixDetector[];
|
|
60
|
+
/** Out: invariant-P entries (state a detector left behind, unmarked injections). */
|
|
61
|
+
internalBugs?: InternalBug[];
|
|
58
62
|
}
|
|
59
63
|
declare function runDetectors(page: PageLike, outTruncated?: TruncationEntry[], outWarnings?: string[], options?: RunDetectorsOptions): Promise<DetectedIssue[]>;
|
|
60
64
|
declare function extractSiteTheme(page: PageLike): Promise<SiteTheme>;
|
|
61
65
|
|
|
66
|
+
declare const REASON_TEXT: {
|
|
67
|
+
readonly 'not-found': "selector matched no elements";
|
|
68
|
+
readonly 'not-verifiable': "not checked by any WebAbility tool";
|
|
69
|
+
readonly unknown_rule: "not a known rule id";
|
|
70
|
+
readonly 'unsupported-selector': "selectors that pierce shadow DOM (\">>>\") or iframes cannot be scoped by verify_fix";
|
|
71
|
+
};
|
|
72
|
+
/** Shadow-piercing / frame-piercing selector joiners (axe-style `>>>`, `>>`). */
|
|
73
|
+
declare function isPiercingSelector(selector: string): boolean;
|
|
74
|
+
interface CoverageSources {
|
|
75
|
+
axeRules: () => Array<{
|
|
76
|
+
tags?: string[];
|
|
77
|
+
}> | Promise<Array<{
|
|
78
|
+
tags?: string[];
|
|
79
|
+
}>>;
|
|
80
|
+
detectorCriteria: () => readonly string[];
|
|
81
|
+
/** Every rule id verify_fix accepts as `wcag` besides a criterion: axe ids + detector issue types. */
|
|
82
|
+
ruleIds: () => readonly string[] | Promise<readonly string[]>;
|
|
83
|
+
}
|
|
84
|
+
/** Union of every engine's criteria. Throws if any registry cannot be read. */
|
|
85
|
+
declare function coveredCriteria(sources?: CoverageSources): Promise<Set<string>>;
|
|
86
|
+
type Verifiability = {
|
|
87
|
+
verifiable: true;
|
|
88
|
+
} | {
|
|
89
|
+
verifiable: false;
|
|
90
|
+
reason: 'not-verifiable';
|
|
91
|
+
};
|
|
92
|
+
/** Fail closed: empty or unbuildable coverage, or an uncovered criterion, is not-verifiable. */
|
|
93
|
+
declare function criterionVerifiability(wcag: string, sources?: CoverageSources): Promise<Verifiability>;
|
|
94
|
+
interface VerifyFixRefusal {
|
|
95
|
+
reason: keyof typeof REASON_TEXT;
|
|
96
|
+
text: string;
|
|
97
|
+
isError?: boolean;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The pre-scan refusals verify_fix applies, in one place: a rule id no engine
|
|
101
|
+
* knows (an unknown id matches nothing, which would read as VERIFIED), a
|
|
102
|
+
* criterion no engine can fail, and a selector that crosses a shadow root or
|
|
103
|
+
* iframe. Returns null when verification may proceed.
|
|
104
|
+
*/
|
|
105
|
+
declare function verifyFixRefusal(wcag: string | undefined, selector: string, sources?: CoverageSources): Promise<VerifyFixRefusal | null>;
|
|
106
|
+
|
|
62
107
|
interface AxeViolation {
|
|
63
108
|
id: string;
|
|
64
109
|
impact: string;
|
|
@@ -74,6 +119,17 @@ interface AxeViolation {
|
|
|
74
119
|
data?: {
|
|
75
120
|
messageKey?: string;
|
|
76
121
|
};
|
|
122
|
+
relatedNodes?: Array<{
|
|
123
|
+
target?: unknown;
|
|
124
|
+
}>;
|
|
125
|
+
}>;
|
|
126
|
+
none?: Array<{
|
|
127
|
+
data?: {
|
|
128
|
+
messageKey?: string;
|
|
129
|
+
};
|
|
130
|
+
relatedNodes?: Array<{
|
|
131
|
+
target?: unknown;
|
|
132
|
+
}>;
|
|
77
133
|
}>;
|
|
78
134
|
}>;
|
|
79
135
|
}
|
|
@@ -163,4 +219,4 @@ interface DevSuggestion {
|
|
|
163
219
|
}
|
|
164
220
|
declare function generateDevSuggestion(issue: ScanIssue, framework: Framework, elementClasses?: string, fgColor?: string, bgColor?: string): DevSuggestion;
|
|
165
221
|
|
|
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 };
|
|
222
|
+
export { type ContrastSuggestion, type CoverageSources, DetectedIssue, type DevSuggestion, FixDetector, type Framework, type FrameworkInfo, InternalBug, PageLike, REASON_TEXT, ScanIssue, ScanOptions, ScanResult, SiteTheme, type TailwindSuggestion, type Verifiability, WCAG_LEVEL_MAP, WcagLevel, coveredCriteria, criterionVerifiability, detectFramework, dismissModals, extractSiteTheme, generateDevSuggestion, getContrastRatio, getWcagLevel, isPiercingSelector, issueLevel, runAxe, runDetectors, scan, solveContrast, suggestTailwindFix, toHtmlReport, verifyFixRefusal, withinLevel };
|