@a11ied/support-data 0.0.0-placeholder → 0.1.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/LICENSE +21 -0
  3. package/NOTICE.md +13 -0
  4. package/README.md +14 -0
  5. package/data/aria-at/plans/apg-accordion.json +8543 -0
  6. package/data/aria-at/plans/apg-alert.json +659 -0
  7. package/data/aria-at/plans/apg-checkbox.json +4500 -0
  8. package/data/aria-at/plans/apg-command-button.json +2184 -0
  9. package/data/aria-at/plans/apg-disclosure-faq.json +4155 -0
  10. package/data/aria-at/plans/apg-disclosure-navigation.json +13217 -0
  11. package/data/aria-at/plans/apg-horizontal-slider.json +6310 -0
  12. package/data/aria-at/plans/apg-link-css.json +2062 -0
  13. package/data/aria-at/plans/apg-link-img-alt.json +1952 -0
  14. package/data/aria-at/plans/apg-link-span-text.json +1638 -0
  15. package/data/aria-at/plans/apg-menu-button-actions-active-descendant.json +9267 -0
  16. package/data/aria-at/plans/apg-menu-button-actions.json +7156 -0
  17. package/data/aria-at/plans/apg-menu-button-navigation.json +6971 -0
  18. package/data/aria-at/plans/apg-minimal-data-grid.json +4768 -0
  19. package/data/aria-at/plans/apg-modal-dialog.json +5124 -0
  20. package/data/aria-at/plans/apg-quantity-spin-button.json +3719 -0
  21. package/data/aria-at/plans/apg-radiogroup-aria-activedescendant.json +12665 -0
  22. package/data/aria-at/plans/apg-radiogroup-roving-tabindex.json +16098 -0
  23. package/data/aria-at/plans/apg-rating-radio-group.json +9074 -0
  24. package/data/aria-at/plans/apg-seek-slider.json +4818 -0
  25. package/data/aria-at/plans/apg-switch-button.json +5306 -0
  26. package/data/aria-at/plans/apg-switch-checkbox.json +4462 -0
  27. package/data/aria-at/plans/apg-switch.json +4408 -0
  28. package/data/aria-at/plans/apg-tabs-manual-activation.json +7024 -0
  29. package/data/aria-at/plans/apg-toggle-button.json +5998 -0
  30. package/data/aria-at/plans/apg-vertical-temperature-slider.json +6642 -0
  31. package/data/aria-at/plans/html-button.json +1336 -0
  32. package/data/aria-at/summary.json +1189 -0
  33. package/data/results/android-13-chrome-talkback.json +2617 -0
  34. package/data/results/android-13-firefox-talkback.json +22 -0
  35. package/data/results/android-13-webview-talkback.json +2617 -0
  36. package/data/results/ios-safari-voiceover.json +22 -0
  37. package/data/results/ios-wkwebview-voiceover.json +22 -0
  38. package/data/results/macos-26.3.1-chrome-157.0.8103.79-voiceover.json +2770 -0
  39. package/data/results/macos-26.3.1-firefox-156.0.1-voiceover.json +2769 -0
  40. package/data/results/macos-26.3.1-safari-26.3.1-voiceover.json +2749 -0
  41. package/data/results/macos-26.3.1-wkwebview-21623-voiceover.json +2761 -0
  42. package/data/results/virtual-chromium-0.32.1.json +3212 -0
  43. package/dist/chunk-FGZPBJAW.js +127 -0
  44. package/dist/index.d.ts +212 -0
  45. package/dist/index.js +1607 -0
  46. package/dist/types.d.ts +185 -0
  47. package/dist/types.js +16 -0
  48. package/package.json +53 -1
@@ -0,0 +1,127 @@
1
+ // src/types.ts
2
+ function normalizeKeySegment(value) {
3
+ return value.trim().toLowerCase().replaceAll(/\s+/gu, "-");
4
+ }
5
+ function buildEnvironmentKey(environment) {
6
+ return [
7
+ environment.device,
8
+ environment.os,
9
+ environment.osVersion,
10
+ environment.browser,
11
+ environment.browserVersion,
12
+ environment.screenReader,
13
+ environment.screenReaderVersion
14
+ ].map((segment) => normalizeKeySegment(segment)).join(" | ");
15
+ }
16
+ function formatOutcomeLabel(outcome) {
17
+ switch (outcome) {
18
+ case "pass": {
19
+ return "Pass";
20
+ }
21
+ case "partial": {
22
+ return "Partial";
23
+ }
24
+ case "fail": {
25
+ return "Fail";
26
+ }
27
+ case "not-applicable": {
28
+ return "N/A";
29
+ }
30
+ case "untested": {
31
+ return "Untested";
32
+ }
33
+ default: {
34
+ return String(outcome);
35
+ }
36
+ }
37
+ }
38
+ function formatCategoryLabel(category) {
39
+ return category.toUpperCase();
40
+ }
41
+ function createEmptyPriorityCounts() {
42
+ return {
43
+ passed: 0,
44
+ failed: 0,
45
+ untestable: 0,
46
+ unsupported: 0,
47
+ total: 0
48
+ };
49
+ }
50
+ function accumulateCount(target, verdict) {
51
+ target.total += 1;
52
+ if (verdict === "pass") {
53
+ target.passed += 1;
54
+ } else if (verdict === "fail") {
55
+ target.failed += 1;
56
+ } else if (verdict === "untestable") {
57
+ target.untestable += 1;
58
+ } else if (verdict === "unsupported") {
59
+ target.unsupported += 1;
60
+ }
61
+ }
62
+ function summarizeAssertions(results, sideEffects = []) {
63
+ const must = {
64
+ passed: 0,
65
+ failed: 0,
66
+ untestable: 0,
67
+ unsupported: 0,
68
+ total: 0
69
+ };
70
+ const should = {
71
+ passed: 0,
72
+ failed: 0,
73
+ untestable: 0,
74
+ unsupported: 0,
75
+ total: 0
76
+ };
77
+ const may = {
78
+ passed: 0,
79
+ failed: 0,
80
+ untestable: 0,
81
+ unsupported: 0,
82
+ total: 0
83
+ };
84
+ for (const item of results) {
85
+ if (item.priority === "MUST") {
86
+ accumulateCount(must, item.verdict);
87
+ } else if (item.priority === "SHOULD") {
88
+ accumulateCount(should, item.verdict);
89
+ } else {
90
+ accumulateCount(may, item.verdict);
91
+ }
92
+ }
93
+ let moderateSideEffects = 0;
94
+ let severeSideEffects = 0;
95
+ for (const effect of sideEffects) {
96
+ if (effect.impact === "SEVERE") {
97
+ severeSideEffects += 1;
98
+ } else {
99
+ moderateSideEffects += 1;
100
+ }
101
+ }
102
+ return {
103
+ must,
104
+ should,
105
+ may,
106
+ severeSideEffects,
107
+ moderateSideEffects
108
+ };
109
+ }
110
+ function deriveOutcomeFromSummary(summary) {
111
+ if (summary.must.failed > 0 || summary.severeSideEffects > 0) {
112
+ return "fail";
113
+ }
114
+ if (summary.should.failed > 0 || summary.moderateSideEffects > 0) {
115
+ return "partial";
116
+ }
117
+ return "pass";
118
+ }
119
+
120
+ export {
121
+ buildEnvironmentKey,
122
+ formatOutcomeLabel,
123
+ formatCategoryLabel,
124
+ createEmptyPriorityCounts,
125
+ summarizeAssertions,
126
+ deriveOutcomeFromSummary
127
+ };
@@ -0,0 +1,212 @@
1
+ import { AssertionResultRecord, SideEffectRecord, AssertionSummary, ScreenReaderTestCase, TestCategory, SpecAssertion, TestRunRecord, TestOutcome, EnvironmentResultFile, TestEnvironment, TranscriptEntry, FeatureType } from './types.js';
2
+ export { AssertionBugRef, AssertionPriority, AssertionVerdict, FeatureRefEntry, PlatformGroup, PriorityCounts, SideEffectImpact, SpecAssertionRule, SpecReference, TestEvaluationRule, TestInteractionMode, buildEnvironmentKey, createEmptyPriorityCounts, deriveOutcomeFromSummary, formatCategoryLabel, formatOutcomeLabel, summarizeAssertions } from './types.js';
3
+
4
+ interface AriaAtCommandSpec {
5
+ readonly text: string;
6
+ readonly mode: string;
7
+ }
8
+ interface AriaAtCommandResult {
9
+ readonly commands: readonly AriaAtCommandSpec[];
10
+ readonly output: string;
11
+ readonly untestable: boolean;
12
+ readonly assertions: readonly AssertionResultRecord[];
13
+ readonly negativeSideEffects: readonly SideEffectRecord[];
14
+ }
15
+ interface AriaAtTestResult {
16
+ readonly testTitle: string;
17
+ readonly rowNumber: number;
18
+ readonly renderedUrl?: string;
19
+ readonly completedAt?: string;
20
+ readonly atVersion: string;
21
+ readonly browserVersion: string;
22
+ readonly commandResults: readonly AriaAtCommandResult[];
23
+ }
24
+ interface AriaAtEnvironmentReport {
25
+ readonly reportID: string;
26
+ readonly markedFinalAt?: string;
27
+ readonly atKey: string;
28
+ readonly atName: string;
29
+ readonly atVersion: string;
30
+ readonly browserKey: string;
31
+ readonly browserName: string;
32
+ readonly browserVersion: string;
33
+ readonly os: string;
34
+ readonly osVersion: string;
35
+ readonly device: string;
36
+ readonly summary: AssertionSummary;
37
+ readonly tests: readonly AriaAtTestResult[];
38
+ }
39
+ interface AriaAtFeatureRef {
40
+ readonly refId: string;
41
+ readonly type: 'aria' | 'html';
42
+ readonly linkText: string;
43
+ readonly specURL: string;
44
+ }
45
+ interface AriaAtPlanFile {
46
+ readonly schemaVersion: 1;
47
+ readonly planVersionID: string;
48
+ readonly slug: string;
49
+ readonly directory: string;
50
+ readonly title: string;
51
+ readonly versionString: string;
52
+ readonly phase: string;
53
+ readonly gitSha: string;
54
+ readonly updatedAt: string;
55
+ readonly exampleURL?: string;
56
+ readonly designPatternURL?: string;
57
+ readonly upstreamURL: string;
58
+ readonly featureRefs: readonly AriaAtFeatureRef[];
59
+ readonly reports: readonly AriaAtEnvironmentReport[];
60
+ }
61
+ interface AriaAtFeatureSummary {
62
+ readonly refId: string;
63
+ readonly type: 'aria' | 'html';
64
+ readonly linkText: string;
65
+ readonly specURL: string;
66
+ readonly total: number;
67
+ readonly passed: number;
68
+ readonly failed: number;
69
+ readonly untestable: number;
70
+ readonly passedPercentage: number;
71
+ readonly planSlugs: readonly string[];
72
+ }
73
+ interface AriaAtPlanSummary {
74
+ readonly slug: string;
75
+ readonly directory: string;
76
+ readonly title: string;
77
+ readonly versionString: string;
78
+ readonly phase: string;
79
+ readonly planVersionID: string;
80
+ readonly reportsCount: number;
81
+ readonly featureRefs: readonly string[];
82
+ }
83
+ interface AriaAtSummaryFile {
84
+ readonly schemaVersion: 1;
85
+ readonly syncedAt: string;
86
+ readonly upstreamURL: string;
87
+ readonly license: string;
88
+ readonly plansCount: number;
89
+ readonly reportsCount: number;
90
+ readonly features: readonly AriaAtFeatureSummary[];
91
+ readonly plans: readonly AriaAtPlanSummary[];
92
+ }
93
+
94
+ declare function resetAriaAtCache(): void;
95
+ declare function getAriaAtSummary(): AriaAtSummaryFile;
96
+ declare function listAriaAtPlans(): readonly AriaAtPlanFile[];
97
+ declare function getAriaAtPlanBySlug(slug: string): AriaAtPlanFile | undefined;
98
+ interface AriaAtVersionedEnvironment {
99
+ readonly key: string;
100
+ readonly screenReader: string;
101
+ readonly screenReaderVersion: string;
102
+ readonly browser: string;
103
+ readonly browserVersion: string;
104
+ readonly os: string;
105
+ readonly osVersion: string;
106
+ readonly device: string;
107
+ readonly planCount: number;
108
+ readonly latestTestedAt?: string;
109
+ }
110
+ declare function listAriaAtEnvironments(): readonly AriaAtVersionedEnvironment[];
111
+
112
+ declare const screenReaderTests: readonly ScreenReaderTestCase[];
113
+ declare function listTestCases(): readonly ScreenReaderTestCase[];
114
+ declare function getTestCaseBySlug(slug: string): ScreenReaderTestCase | undefined;
115
+ declare function listAttributes(): readonly string[];
116
+ declare function listCategories(): readonly TestCategory[];
117
+
118
+ /**
119
+ * Resolves explicit RFC-2119 assertions for a test case, deriving spec assertions from
120
+ * the evaluation rules when explicit assertions are not declared inline.
121
+ */
122
+ declare function resolveCaseAssertions(testCase: ScreenReaderTestCase): readonly SpecAssertion[];
123
+
124
+ interface SupportDataDirectories {
125
+ readonly rootDir: string;
126
+ readonly resultsDir: string;
127
+ readonly ariaAtDir: string;
128
+ readonly ariaAtPlansDir: string;
129
+ readonly ariaAtSummaryPath: string;
130
+ }
131
+ /** Resolves the `data/` directory containing local results and W3C ARIA-AT JSON files. */
132
+ declare function resolveSupportDataRoot(): string;
133
+ declare function getSupportDataDirectories(): SupportDataDirectories;
134
+
135
+ declare function resetResultsCache(): void;
136
+ declare function listEnvironmentFiles(): readonly EnvironmentResultFile[];
137
+ declare function listEnvironments(): readonly TestEnvironment[];
138
+ declare function getRunForTestAndEnvironment(testSlug: string, environmentKey: string): TestRunRecord | undefined;
139
+ declare function getRunsForTest(testSlug: string): readonly TestRunRecord[];
140
+ declare function getSummaryCounts(): Readonly<Record<TestOutcome, number>> & {
141
+ readonly totalRuns: number;
142
+ readonly testedEnvironments: number;
143
+ readonly trackedEnvironments: number;
144
+ };
145
+
146
+ interface LocalFeatureDrilldownItem {
147
+ readonly kind: 'local';
148
+ readonly testSlug: string;
149
+ readonly testTitle: string;
150
+ readonly outcome: TestOutcome;
151
+ readonly keyAnnouncement: string;
152
+ readonly notes: string;
153
+ readonly summary: AssertionSummary;
154
+ readonly assertions: readonly AssertionResultRecord[];
155
+ readonly transcript: readonly TranscriptEntry[];
156
+ readonly driver: string;
157
+ readonly runAt: string;
158
+ }
159
+ interface AriaAtFeatureDrilldownItem {
160
+ readonly kind: 'w3c-aria-at';
161
+ readonly planSlug: string;
162
+ readonly planTitle: string;
163
+ readonly planVersionString: string;
164
+ readonly planPhase: string;
165
+ readonly reportID: string;
166
+ readonly upstreamReportURL: string;
167
+ readonly testTitle: string;
168
+ readonly commandResults: readonly AriaAtCommandResult[];
169
+ }
170
+ type FeatureDrilldownItem = LocalFeatureDrilldownItem | AriaAtFeatureDrilldownItem;
171
+ interface FeatureEnvironmentResult {
172
+ readonly source: 'local' | 'w3c-aria-at';
173
+ readonly environmentKey: string;
174
+ readonly environmentID: string;
175
+ readonly screenReader: string;
176
+ readonly screenReaderVersion: string;
177
+ readonly browser: string;
178
+ readonly browserVersion: string;
179
+ readonly browserType: 'browser' | 'webview';
180
+ readonly os: string;
181
+ readonly osVersion: string;
182
+ readonly device: string;
183
+ readonly testedAt?: string;
184
+ readonly status: 'tested' | 'untested';
185
+ readonly statusNote?: string;
186
+ readonly summary: AssertionSummary;
187
+ readonly items: readonly FeatureDrilldownItem[];
188
+ }
189
+ interface FeatureReport {
190
+ readonly key: string;
191
+ readonly type: FeatureType;
192
+ readonly refId: string;
193
+ readonly title: string;
194
+ readonly linkText: string;
195
+ readonly specURL: string;
196
+ readonly sourceCoverage: 'both' | 'local' | 'w3c-aria-at';
197
+ readonly localCases: readonly ScreenReaderTestCase[];
198
+ readonly ariaAtPlans: readonly AriaAtPlanFile[];
199
+ readonly versionedEnvironments: readonly FeatureEnvironmentResult[];
200
+ readonly testedEnvironmentCount: number;
201
+ readonly localEnvironmentCount: number;
202
+ readonly ariaAtEnvironmentCount: number;
203
+ }
204
+ declare function resetFeaturesCache(): void;
205
+ declare function listFeatures(): readonly FeatureReport[];
206
+ declare function getFeatureReport(type: FeatureType, refId: string): FeatureReport | undefined;
207
+ declare function listFeatureSummaryForTestAttribute(attribute: string): FeatureReport | undefined;
208
+
209
+ /** Clears cached dataset indices so subsequent reads reload JSON files from disk. */
210
+ declare function resetSupportDataCache(): void;
211
+
212
+ export { type AriaAtCommandResult, type AriaAtCommandSpec, type AriaAtEnvironmentReport, type AriaAtFeatureDrilldownItem, type AriaAtFeatureRef, type AriaAtFeatureSummary, type AriaAtPlanFile, type AriaAtPlanSummary, type AriaAtSummaryFile, type AriaAtTestResult, type AriaAtVersionedEnvironment, AssertionResultRecord, AssertionSummary, EnvironmentResultFile, type FeatureDrilldownItem, type FeatureEnvironmentResult, type FeatureReport, FeatureType, type LocalFeatureDrilldownItem, ScreenReaderTestCase, SideEffectRecord, SpecAssertion, type SupportDataDirectories, TestCategory, TestEnvironment, TestOutcome, TestRunRecord, TranscriptEntry, getAriaAtPlanBySlug, getAriaAtSummary, getFeatureReport, getRunForTestAndEnvironment, getRunsForTest, getSummaryCounts, getSupportDataDirectories, getTestCaseBySlug, listAriaAtEnvironments, listAriaAtPlans, listAttributes, listCategories, listEnvironmentFiles, listEnvironments, listFeatureSummaryForTestAttribute, listFeatures, listTestCases, resetAriaAtCache, resetFeaturesCache, resetResultsCache, resetSupportDataCache, resolveCaseAssertions, resolveSupportDataRoot, screenReaderTests };