@markuplint/ml-spec 3.0.0-canary.5 → 3.0.0-dev.176
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/README.md +1 -1
- package/lib/constant/aria-version.d.ts +2 -0
- package/lib/constant/aria-version.js +5 -0
- package/lib/dom-traverse/accname-computation.js +3 -1
- package/lib/dom-traverse/get-attr-specs.d.ts +1 -1
- package/lib/dom-traverse/get-attr-specs.js +3 -1
- package/lib/dom-traverse/get-computed-aria-props.d.ts +6 -6
- package/lib/dom-traverse/get-computed-aria-props.js +4 -2
- package/lib/dom-traverse/get-computed-role.d.ts +6 -1
- package/lib/dom-traverse/get-computed-role.js +41 -10
- package/lib/dom-traverse/get-content-model.d.ts +28 -2
- package/lib/dom-traverse/get-content-model.js +4 -2
- package/lib/dom-traverse/get-explicit-role.js +9 -4
- package/lib/dom-traverse/get-implicit-role.d.ts +6 -2
- package/lib/dom-traverse/get-implicit-role.js +6 -2
- package/lib/dom-traverse/get-non-presentational-ancestor.d.ts +10 -4
- package/lib/dom-traverse/get-non-presentational-ancestor.js +10 -2
- package/lib/dom-traverse/get-permitted-roles.d.ts +7 -3
- package/lib/dom-traverse/get-permitted-roles.js +3 -1
- package/lib/dom-traverse/get-spec.d.ts +4 -1
- package/lib/dom-traverse/get-spec.js +3 -1
- package/lib/dom-traverse/has-required-owned-elements.d.ts +8 -2
- package/lib/dom-traverse/has-required-owned-elements.js +14 -8
- package/lib/dom-traverse/is-exposed.d.ts +1 -1
- package/lib/dom-traverse/is-exposed.js +43 -7
- package/lib/dom-traverse/matches-context-role.d.ts +7 -0
- package/lib/dom-traverse/matches-context-role.js +27 -0
- package/lib/dom-traverse/may-be-focusable.d.ts +1 -1
- package/lib/dom-traverse/may-be-focusable.js +3 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.js +4 -0
- package/lib/specs/aria-specs.d.ts +7 -4
- package/lib/specs/content-model-category-to-tag-names.d.ts +4 -1
- package/lib/specs/get-aria.d.ts +8 -1
- package/lib/specs/get-aria.js +8 -2
- package/lib/specs/get-attr-specs.d.ts +6 -2
- package/lib/specs/get-attr-specs.js +2 -14
- package/lib/specs/get-implicit-role.d.ts +7 -1
- package/lib/specs/get-permitted-roles.d.ts +9 -3
- package/lib/specs/get-permitted-roles.js +19 -15
- package/lib/specs/get-role-spec.d.ts +10 -3
- package/lib/specs/get-role-spec.js +2 -2
- package/lib/specs/get-selectors-by-content-model-category.d.ts +1 -1
- package/lib/specs/get-selectors-by-content-model-category.js +1 -1
- package/lib/specs/get-spec-by-tag-name.d.ts +5 -1
- package/lib/specs/get-spec-by-tag-name.js +3 -2
- package/lib/specs/is-nothing-content-model.d.ts +5 -0
- package/lib/specs/is-nothing-content-model.js +14 -0
- package/lib/specs/is-palpable-elements.d.ts +8 -4
- package/lib/specs/is-palpable-elements.js +6 -4
- package/lib/specs/is-void-element.js +3 -1
- package/lib/specs/resolve-version.d.ts +5 -1
- package/lib/specs/resolve-version.js +1 -1
- package/lib/specs/schema-to-spec.d.ts +4 -4
- package/lib/specs/schema-to-spec.js +29 -18
- package/lib/types/aria.d.ts +149 -114
- package/lib/types/attributes.d.ts +1490 -111
- package/lib/types/index.d.ts +178 -149
- package/lib/types/permitted-structures.d.ts +74 -31
- package/lib/utils/merge-array.d.ts +9 -4
- package/lib/utils/resolve-namespace.d.ts +4 -4
- package/lib/utils/resolve-namespace.js +3 -2
- package/lib/utils/validateAriaVersion.d.ts +2 -0
- package/lib/utils/validateAriaVersion.js +8 -0
- package/package.json +13 -8
- package/{src/dom-traverse/accname-computation.spec.ts → test/dom-traverse/accname-computation.spec.js} +4 -4
- package/test/dom-traverse/get-computed-aria-props.spec.js +758 -0
- package/test/dom-traverse/get-computed-role.spec.js +294 -0
- package/test/dom-traverse/get-implicit-role.spec.js +40 -0
- package/{src/dom-traverse/has-required-owned-elements.spec.ts → test/dom-traverse/has-required-owned-elements.spec.js} +7 -9
- package/{src/dom-traverse/is-exposed.spec.ts → test/dom-traverse/is-exposed.spec.js} +29 -9
- package/test/dom-traverse/matches-context-role.spec.js +60 -0
- package/{src/specs/get-attr-specs.spec.ts → test/specs/get-attr-specs.spec.js} +2 -8
- package/{src/specs/get-implicit-role.spec.ts → test/specs/get-implicit-role.spec.js} +9 -11
- package/{src/specs/get-permitted-roles.spec.ts → test/specs/get-permitted-roles.spec.js} +8 -10
- package/{src/specs/get-role-spec.spec.ts → test/specs/get-role-spec.spec.js} +4 -4
- package/{src/specs/get-spec-by-tag-name.spec.ts → test/specs/get-spec-by-tag-name.spec.js} +2 -2
- package/test/specs/resolve-version.spec.js +34 -0
- package/test/specs/schema-to-spec.spec.js +61 -0
- package/{src/utils/resolve-namespace.spec.ts → test/utils/resolve-namespace.spec.js} +1 -1
- package/lib/types/permitted-structres.d.ts +0 -58
- package/lib/types/permitted-structres.js +0 -8
- package/schemas/aria.schema.json +0 -258
- package/schemas/attributes.schema.json +0 -204
- package/schemas/content-models.schema.json +0 -199
- package/schemas/element.schema.json +0 -11
- package/schemas/global-attributes.schema.json +0 -761
- package/src/dom-traverse/accname-computation.ts +0 -5
- package/src/dom-traverse/get-attr-specs.ts +0 -8
- package/src/dom-traverse/get-computed-aria-props.spec.ts +0 -368
- package/src/dom-traverse/get-computed-aria-props.ts +0 -130
- package/src/dom-traverse/get-computed-role.spec.ts +0 -134
- package/src/dom-traverse/get-computed-role.ts +0 -181
- package/src/dom-traverse/get-content-model.ts +0 -32
- package/src/dom-traverse/get-explicit-role.ts +0 -112
- package/src/dom-traverse/get-implicit-role.ts +0 -36
- package/src/dom-traverse/get-non-presentational-ancestor.ts +0 -20
- package/src/dom-traverse/get-permitted-roles.ts +0 -7
- package/src/dom-traverse/get-spec.ts +0 -7
- package/src/dom-traverse/has-required-owned-elements.ts +0 -85
- package/src/dom-traverse/is-exposed.ts +0 -196
- package/src/dom-traverse/may-be-focusable.ts +0 -21
- package/src/index.ts +0 -23
- package/src/specs/aria-specs.ts +0 -6
- package/src/specs/content-model-category-to-tag-names.ts +0 -15
- package/src/specs/get-aria.ts +0 -85
- package/src/specs/get-attr-specs.ts +0 -116
- package/src/specs/get-implicit-role.ts +0 -17
- package/src/specs/get-permitted-roles.ts +0 -87
- package/src/specs/get-role-spec.ts +0 -72
- package/src/specs/get-selectors-by-content-model-category.ts +0 -10
- package/src/specs/get-spec-by-tag-name.ts +0 -20
- package/src/specs/is-palpable-elements.ts +0 -55
- package/src/specs/is-presentational.ts +0 -6
- package/src/specs/is-void-element.ts +0 -22
- package/src/specs/resolve-version.ts +0 -20
- package/src/specs/schema-to-spec.spec.ts +0 -39
- package/src/specs/schema-to-spec.ts +0 -103
- package/src/types/aria.ts +0 -153
- package/src/types/attributes.ts +0 -1473
- package/src/types/index.ts +0 -255
- package/src/types/permitted-structres.ts +0 -100
- package/src/types/permitted-structures.ts +0 -96
- package/src/utils/get-ns.ts +0 -18
- package/src/utils/merge-array.ts +0 -35
- package/src/utils/resolve-namespace.ts +0 -40
- package/tsconfig.test.json +0 -3
- package/tsconfig.tsbuildinfo +0 -1
package/lib/types/aria.d.ts
CHANGED
|
@@ -10,127 +10,162 @@ export type ImplicitRole = false | string;
|
|
|
10
10
|
/**
|
|
11
11
|
* If `true`, this mean is "Any". If `false`, this mean is "No".
|
|
12
12
|
*/
|
|
13
|
-
export type PermittedRoles =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
export type PermittedRoles =
|
|
14
|
+
| boolean
|
|
15
|
+
| (
|
|
16
|
+
| string
|
|
17
|
+
| {
|
|
18
|
+
name: string;
|
|
19
|
+
deprecated?: true;
|
|
20
|
+
[k: string]: unknown;
|
|
21
|
+
}
|
|
22
|
+
)[]
|
|
23
|
+
| PermittedARIAAAMInfo;
|
|
21
24
|
/**
|
|
22
25
|
* If set false:
|
|
23
26
|
* > No role or aria-* attributes
|
|
24
27
|
*/
|
|
25
|
-
export type PermittedARIAProperties =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
28
|
+
export type PermittedARIAProperties =
|
|
29
|
+
| false
|
|
30
|
+
| {
|
|
31
|
+
global?: true;
|
|
32
|
+
/**
|
|
33
|
+
* Set true if the spec says "and any aria-* attributes applicable to the allowed roles."
|
|
34
|
+
*/
|
|
35
|
+
role?: true | string | [string, ...string[]];
|
|
36
|
+
/**
|
|
37
|
+
* @minItems 1
|
|
38
|
+
*/
|
|
39
|
+
only?: [
|
|
40
|
+
(
|
|
41
|
+
| string
|
|
42
|
+
| {
|
|
43
|
+
name: string;
|
|
44
|
+
value?: string;
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
...(
|
|
48
|
+
| string
|
|
49
|
+
| {
|
|
50
|
+
name: string;
|
|
51
|
+
value?: string;
|
|
52
|
+
}
|
|
53
|
+
)[],
|
|
54
|
+
];
|
|
55
|
+
/**
|
|
56
|
+
* @minItems 1
|
|
57
|
+
*/
|
|
58
|
+
without?: [
|
|
59
|
+
{
|
|
60
|
+
type: 'not-recommended' | 'should-not' | 'must-not';
|
|
61
|
+
name: string;
|
|
62
|
+
value?: string;
|
|
63
|
+
alt?: {
|
|
64
|
+
method: 'remove-attr' | 'set-attr';
|
|
65
|
+
target: string;
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
...{
|
|
69
|
+
type: 'not-recommended' | 'should-not' | 'must-not';
|
|
70
|
+
name: string;
|
|
71
|
+
value?: string;
|
|
72
|
+
alt?: {
|
|
73
|
+
method: 'remove-attr' | 'set-attr';
|
|
74
|
+
target: string;
|
|
75
|
+
};
|
|
76
|
+
}[],
|
|
77
|
+
];
|
|
78
|
+
};
|
|
68
79
|
export interface AriaSchema {
|
|
69
|
-
|
|
70
|
-
|
|
80
|
+
_?: ARIA;
|
|
81
|
+
[k: string]: unknown;
|
|
71
82
|
}
|
|
72
83
|
export interface ARIA {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
84
|
+
implicitRole: ImplicitRole;
|
|
85
|
+
permittedRoles: PermittedRoles;
|
|
86
|
+
namingProhibited?: true;
|
|
87
|
+
implicitProperties?: ImplicitProperties;
|
|
88
|
+
properties?: PermittedARIAProperties;
|
|
89
|
+
conditions?: {
|
|
90
|
+
/**
|
|
91
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
92
|
+
* via the `patternProperty` ".+".
|
|
93
|
+
*/
|
|
94
|
+
[k: string]: {
|
|
95
|
+
implicitRole?: ImplicitRole;
|
|
96
|
+
permittedRoles?: PermittedRoles;
|
|
97
|
+
namingProhibited?: true;
|
|
98
|
+
implicitProperties?: ImplicitProperties;
|
|
99
|
+
properties?: PermittedARIAProperties;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
'1.3'?: {
|
|
103
|
+
implicitRole?: ImplicitRole;
|
|
104
|
+
permittedRoles?: PermittedRoles;
|
|
105
|
+
namingProhibited?: true;
|
|
106
|
+
implicitProperties?: ImplicitProperties;
|
|
107
|
+
properties?: PermittedARIAProperties;
|
|
108
|
+
conditions?: {
|
|
109
|
+
/**
|
|
110
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
111
|
+
* via the `patternProperty` ".+".
|
|
112
|
+
*/
|
|
113
|
+
[k: string]: {
|
|
114
|
+
implicitRole?: ImplicitRole;
|
|
115
|
+
permittedRoles?: PermittedRoles;
|
|
116
|
+
namingProhibited?: true;
|
|
117
|
+
implicitProperties?: ImplicitProperties;
|
|
118
|
+
properties?: PermittedARIAProperties;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
'1.2'?: {
|
|
123
|
+
implicitRole?: ImplicitRole;
|
|
124
|
+
permittedRoles?: PermittedRoles;
|
|
125
|
+
namingProhibited?: true;
|
|
126
|
+
implicitProperties?: ImplicitProperties;
|
|
127
|
+
properties?: PermittedARIAProperties;
|
|
128
|
+
conditions?: {
|
|
129
|
+
/**
|
|
130
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
131
|
+
* via the `patternProperty` ".+".
|
|
132
|
+
*/
|
|
133
|
+
[k: string]: {
|
|
134
|
+
implicitRole?: ImplicitRole;
|
|
135
|
+
permittedRoles?: PermittedRoles;
|
|
136
|
+
namingProhibited?: true;
|
|
137
|
+
implicitProperties?: ImplicitProperties;
|
|
138
|
+
properties?: PermittedARIAProperties;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
'1.1'?: {
|
|
143
|
+
implicitRole?: ImplicitRole;
|
|
144
|
+
permittedRoles?: PermittedRoles;
|
|
145
|
+
implicitProperties?: ImplicitProperties;
|
|
146
|
+
properties?: PermittedARIAProperties;
|
|
147
|
+
conditions?: {
|
|
148
|
+
/**
|
|
149
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
150
|
+
* via the `patternProperty` ".+".
|
|
151
|
+
*/
|
|
152
|
+
[k: string]: {
|
|
153
|
+
implicitRole?: ImplicitRole;
|
|
154
|
+
permittedRoles?: PermittedRoles;
|
|
155
|
+
implicitProperties?: ImplicitProperties;
|
|
156
|
+
properties?: PermittedARIAProperties;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
export interface PermittedARIAAAMInfo {
|
|
162
|
+
'core-aam'?: true;
|
|
163
|
+
'graphics-aam'?: true;
|
|
129
164
|
}
|
|
130
165
|
export interface ImplicitProperties {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
166
|
+
/**
|
|
167
|
+
* This interface was referenced by `ImplicitProperties`'s JSON-Schema definition
|
|
168
|
+
* via the `patternProperty` "^aria-.+".
|
|
169
|
+
*/
|
|
170
|
+
[k: string]: string;
|
|
136
171
|
}
|