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