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