@markuplint/ml-spec 2.1.1 → 3.0.0-alpha.1
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/accname-computation.d.ts +1 -0
- package/lib/dom-traverse/accname-computation.js +8 -0
- package/lib/dom-traverse/get-attr-specs.d.ts +2 -0
- package/lib/dom-traverse/get-attr-specs.js +8 -0
- package/lib/dom-traverse/get-computed-role.d.ts +2 -0
- package/lib/dom-traverse/get-computed-role.js +170 -0
- package/lib/dom-traverse/get-content-model.d.ts +3 -0
- package/lib/dom-traverse/get-content-model.js +28 -0
- package/lib/dom-traverse/get-explicit-role.d.ts +2 -0
- package/lib/dom-traverse/get-explicit-role.js +102 -0
- package/lib/dom-traverse/get-implicit-role.d.ts +3 -0
- package/lib/dom-traverse/get-implicit-role.js +37 -0
- package/lib/dom-traverse/get-non-presentational-ancestor.d.ts +5 -0
- package/lib/dom-traverse/get-non-presentational-ancestor.js +21 -0
- package/lib/dom-traverse/get-permitted-roles.d.ts +5 -0
- package/lib/dom-traverse/get-permitted-roles.js +8 -0
- package/lib/dom-traverse/get-spec.d.ts +2 -0
- package/lib/dom-traverse/get-spec.js +8 -0
- package/lib/dom-traverse/has-required-owned-elements.d.ts +3 -0
- package/lib/dom-traverse/has-required-owned-elements.js +81 -0
- package/lib/dom-traverse/may-be-focusable.d.ts +2 -0
- package/lib/dom-traverse/may-be-focusable.js +22 -0
- package/lib/index.d.ts +18 -6
- package/lib/index.js +18 -6
- package/lib/specs/aria-specs.d.ts +6 -0
- package/lib/specs/aria-specs.js +8 -0
- package/lib/specs/content-model-category-to-tag-names.d.ts +3 -0
- package/lib/specs/content-model-category-to-tag-names.js +15 -0
- package/lib/specs/get-aria.d.ts +3 -0
- package/lib/specs/get-aria.js +71 -0
- package/lib/specs/get-attr-specs.d.ts +8 -0
- package/lib/{get-attr-specs.js → specs/get-attr-specs.js} +8 -6
- package/lib/specs/get-implicit-role.d.ts +2 -0
- package/lib/specs/get-implicit-role.js +12 -0
- package/lib/specs/get-permitted-roles.d.ts +12 -0
- package/lib/specs/get-permitted-roles.js +61 -0
- package/lib/specs/get-role-spec.d.ts +5 -0
- package/lib/specs/get-role-spec.js +52 -0
- package/lib/specs/get-selectors-by-content-model-category.d.ts +3 -0
- package/lib/specs/get-selectors-by-content-model-category.js +8 -0
- package/lib/specs/get-spec-by-tag-name.d.ts +2 -0
- package/lib/specs/get-spec-by-tag-name.js +16 -0
- package/lib/specs/is-presentational.d.ts +1 -0
- package/lib/specs/is-presentational.js +10 -0
- package/lib/specs/resolve-version.d.ts +3 -0
- package/lib/specs/resolve-version.js +21 -0
- package/lib/specs/schema-to-spec.d.ts +13 -0
- package/lib/{get-spec.js → specs/schema-to-spec.js} +19 -11
- package/lib/types/aria.d.ts +136 -0
- package/lib/{attributes.js → types/aria.js} +0 -0
- package/lib/{attributes.d.ts → types/attributes.d.ts} +95 -48
- package/lib/{permitted-structres.js → types/attributes.js} +0 -0
- package/lib/{types.d.ts → types/index.d.ts} +55 -70
- package/lib/{types.js → types/index.js} +0 -0
- package/lib/types/permitted-structres.d.ts +58 -0
- package/lib/types/permitted-structres.js +8 -0
- package/lib/types/permitted-structures.d.ts +54 -0
- package/lib/types/permitted-structures.js +8 -0
- package/lib/utils/get-ns.d.ts +2 -0
- package/lib/{get-ns.js → utils/get-ns.js} +3 -0
- package/lib/{utils.d.ts → utils/merge-array.d.ts} +0 -0
- package/lib/{utils.js → utils/merge-array.js} +0 -0
- package/lib/utils/resolve-namespace.d.ts +9 -0
- package/lib/utils/resolve-namespace.js +31 -0
- package/package.json +12 -8
- package/schema.json +6 -6
- package/schemas/aria.schema.json +258 -0
- package/schemas/attributes.schema.json +3 -22
- package/schemas/content-models.schema.json +200 -0
- package/schemas/element.schema.json +11 -0
- package/src/dom-traverse/accname-computation.spec.ts +69 -0
- package/src/dom-traverse/accname-computation.ts +5 -0
- package/src/dom-traverse/get-attr-specs.ts +8 -0
- package/src/dom-traverse/get-computed-role.spec.ts +134 -0
- package/src/dom-traverse/get-computed-role.ts +181 -0
- package/src/dom-traverse/get-content-model.ts +32 -0
- package/src/dom-traverse/get-explicit-role.ts +112 -0
- package/src/dom-traverse/get-implicit-role.ts +36 -0
- package/src/dom-traverse/get-non-presentational-ancestor.ts +20 -0
- package/src/dom-traverse/get-permitted-roles.ts +7 -0
- package/src/dom-traverse/get-spec.ts +7 -0
- package/src/dom-traverse/has-required-owned-elements.spec.ts +36 -0
- package/src/dom-traverse/has-required-owned-elements.ts +85 -0
- package/src/dom-traverse/may-be-focusable.ts +21 -0
- package/src/index.ts +18 -6
- package/src/specs/aria-specs.ts +6 -0
- package/src/specs/content-model-category-to-tag-names.ts +15 -0
- package/src/specs/get-aria.ts +85 -0
- package/src/{get-attr-specs.spec.ts → specs/get-attr-specs.spec.ts} +4 -7
- package/src/{get-attr-specs.ts → specs/get-attr-specs.ts} +12 -7
- package/src/specs/get-implicit-role.spec.ts +81 -0
- package/src/specs/get-implicit-role.ts +17 -0
- package/src/specs/get-permitted-roles.spec.ts +420 -0
- package/src/specs/get-permitted-roles.ts +87 -0
- package/src/specs/get-role-spec.spec.ts +67 -0
- package/src/specs/get-role-spec.ts +72 -0
- package/src/specs/get-selectors-by-content-model-category.ts +10 -0
- package/src/specs/get-spec-by-tag-name.spec.ts +68 -0
- package/src/specs/get-spec-by-tag-name.ts +20 -0
- package/src/specs/is-presentational.ts +6 -0
- package/src/specs/resolve-version.ts +20 -0
- package/src/{get-spec.spec.ts → specs/schema-to-spec.spec.ts} +2 -2
- package/src/{get-spec.ts → specs/schema-to-spec.ts} +23 -9
- package/src/types/aria.ts +153 -0
- package/src/{attributes.ts → types/attributes.ts} +162 -117
- package/src/{types.ts → types/index.ts} +75 -74
- package/src/types/permitted-structres.ts +101 -0
- package/src/types/permitted-structures.ts +97 -0
- package/src/{get-ns.ts → utils/get-ns.ts} +6 -1
- package/src/{utils.ts → utils/merge-array.ts} +0 -0
- package/src/utils/resolve-namespace.spec.ts +37 -0
- package/src/utils/resolve-namespace.ts +40 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/get-attr-specs.d.ts +0 -7
- package/lib/get-ns.d.ts +0 -1
- package/lib/get-spec-by-tag-name.d.ts +0 -2
- package/lib/get-spec-by-tag-name.js +0 -31
- package/lib/get-spec.d.ts +0 -13
- package/lib/permitted-structres.d.ts +0 -73
- package/schemas/permitted-structures.schema.json +0 -244
- package/schemas/wai-aria.schema.json +0 -87
- package/src/get-spec-by-tag-name.ts +0 -32
- package/src/permitted-structres.ts +0 -118
|
@@ -1013,123 +1013,13 @@ export type AttributeType =
|
|
|
1013
1013
|
)
|
|
1014
1014
|
| 'Boolean'
|
|
1015
1015
|
)
|
|
1016
|
-
|
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
| 'NoEmptyAny'
|
|
1021
|
-
| 'OneLineAny'
|
|
1022
|
-
| 'Zero'
|
|
1023
|
-
| 'Number'
|
|
1024
|
-
| 'Int'
|
|
1025
|
-
| 'Uint'
|
|
1026
|
-
| 'XMLName'
|
|
1027
|
-
| 'DOMID'
|
|
1028
|
-
| 'FunctionBody'
|
|
1029
|
-
| 'Pattern'
|
|
1030
|
-
| 'DateTime'
|
|
1031
|
-
| 'TabIndex'
|
|
1032
|
-
| 'BCP47'
|
|
1033
|
-
| 'URL'
|
|
1034
|
-
| 'AbsoluteURL'
|
|
1035
|
-
| 'HashName'
|
|
1036
|
-
| 'OneCodePointChar'
|
|
1037
|
-
| 'CustomElementName'
|
|
1038
|
-
| 'BrowsingContextName'
|
|
1039
|
-
| 'BrowsingContextNameOrKeyword'
|
|
1040
|
-
| 'HTTPSchemaURL'
|
|
1041
|
-
| 'MIMEType'
|
|
1042
|
-
| 'ItemProp'
|
|
1043
|
-
| 'Srcset'
|
|
1044
|
-
| 'SourceSizeList'
|
|
1045
|
-
| 'IconSize'
|
|
1046
|
-
| 'AutoComplete'
|
|
1047
|
-
| 'Accept'
|
|
1048
|
-
| 'SerializedPermissionsPolicy'
|
|
1049
|
-
| '<css-declaration-list>'
|
|
1050
|
-
| '<class-list>'
|
|
1051
|
-
| '<svg-font-size>'
|
|
1052
|
-
| '<svg-font-size-adjust>'
|
|
1053
|
-
| "<'color-profile'>"
|
|
1054
|
-
| "<'color-rendering'>"
|
|
1055
|
-
| "<'enable-background'>"
|
|
1056
|
-
| '<list-of-svg-feature-string>'
|
|
1057
|
-
| '<animatable-value>'
|
|
1058
|
-
| '<begin-value-list>'
|
|
1059
|
-
| '<end-value-list>'
|
|
1060
|
-
| '<list-of-value>'
|
|
1061
|
-
| '<clock-value>'
|
|
1062
|
-
| '<color-matrix>'
|
|
1063
|
-
| '<dasharray>'
|
|
1064
|
-
| '<key-points>'
|
|
1065
|
-
| '<key-splines>'
|
|
1066
|
-
| '<key-times>'
|
|
1067
|
-
| '<system-language>'
|
|
1068
|
-
| '<origin>'
|
|
1069
|
-
| '<svg-path>'
|
|
1070
|
-
| '<points>'
|
|
1071
|
-
| '<preserve-aspect-ratio>'
|
|
1072
|
-
| '<view-box>'
|
|
1073
|
-
| '<rotate>'
|
|
1074
|
-
| '<text-coordinate>'
|
|
1075
|
-
| '<list-of-lengths>'
|
|
1076
|
-
| '<list-of-numbers>'
|
|
1077
|
-
| '<list-of-percentages>'
|
|
1078
|
-
| '<number-optional-number>'
|
|
1079
|
-
)
|
|
1080
|
-
| {
|
|
1081
|
-
enum: [string, ...string[]];
|
|
1082
|
-
disallowToSurroundBySpaces?: boolean;
|
|
1083
|
-
caseInsensitive?: boolean;
|
|
1084
|
-
invalidValueDefault?: string;
|
|
1085
|
-
missingValueDefault?: string;
|
|
1086
|
-
sameStates?: {
|
|
1087
|
-
[k: string]: unknown;
|
|
1088
|
-
};
|
|
1089
|
-
};
|
|
1090
|
-
disallowToSurroundBySpaces?: boolean;
|
|
1091
|
-
allowEmpty?: boolean;
|
|
1092
|
-
ordered?: boolean;
|
|
1093
|
-
unique?: boolean;
|
|
1094
|
-
caseInsensitive?: boolean;
|
|
1095
|
-
number?:
|
|
1096
|
-
| ('zeroOrMore' | 'oneOrMore')
|
|
1097
|
-
| {
|
|
1098
|
-
min: number;
|
|
1099
|
-
max: number;
|
|
1100
|
-
};
|
|
1101
|
-
separator: 'space' | 'comma';
|
|
1102
|
-
}
|
|
1103
|
-
| {
|
|
1104
|
-
enum: [string, ...string[]];
|
|
1105
|
-
disallowToSurroundBySpaces?: boolean;
|
|
1106
|
-
caseInsensitive?: boolean;
|
|
1107
|
-
invalidValueDefault?: string;
|
|
1108
|
-
missingValueDefault?: string;
|
|
1109
|
-
sameStates?: {
|
|
1110
|
-
[k: string]: unknown;
|
|
1111
|
-
};
|
|
1112
|
-
}
|
|
1113
|
-
| {
|
|
1114
|
-
type: 'float' | 'integer';
|
|
1115
|
-
gt?: number;
|
|
1116
|
-
gte?: number;
|
|
1117
|
-
lt?: number;
|
|
1118
|
-
lte?: number;
|
|
1119
|
-
clampable?: boolean;
|
|
1120
|
-
};
|
|
1121
|
-
export type AttributeCondition =
|
|
1122
|
-
| {
|
|
1123
|
-
ancestor: Selectors;
|
|
1124
|
-
}
|
|
1125
|
-
| {
|
|
1126
|
-
self: Selectors;
|
|
1127
|
-
};
|
|
1128
|
-
export type Selectors = string | [string, string, ...string[]];
|
|
1016
|
+
| List
|
|
1017
|
+
| Enum
|
|
1018
|
+
| Number;
|
|
1019
|
+
export type AttributeCondition = string | [string, string, ...string[]];
|
|
1129
1020
|
|
|
1130
1021
|
export interface AttributesSchema {
|
|
1131
1022
|
tag: string;
|
|
1132
|
-
ref: string;
|
|
1133
1023
|
global?: GlobalAttributes;
|
|
1134
1024
|
attributes: Attributes;
|
|
1135
1025
|
}
|
|
@@ -1216,6 +1106,9 @@ export interface GlobalAttributes {
|
|
|
1216
1106
|
| 'onwheel'
|
|
1217
1107
|
)[];
|
|
1218
1108
|
'#DocumentElementEventAttrs'?: boolean | ('oncopy' | 'oncut' | 'onpaste')[];
|
|
1109
|
+
/**
|
|
1110
|
+
* @minItems 0
|
|
1111
|
+
*/
|
|
1219
1112
|
'#HTMLLinkAndFetchingAttrs'?: (
|
|
1220
1113
|
| 'crossorigin'
|
|
1221
1114
|
| 'download'
|
|
@@ -1231,6 +1124,9 @@ export interface GlobalAttributes {
|
|
|
1231
1124
|
| 'type'
|
|
1232
1125
|
| 'fetchpriority'
|
|
1233
1126
|
)[];
|
|
1127
|
+
/**
|
|
1128
|
+
* @minItems 0
|
|
1129
|
+
*/
|
|
1234
1130
|
'#HTMLEmbededAndMediaContentAttrs'?: (
|
|
1235
1131
|
| 'autoplay'
|
|
1236
1132
|
| 'controls'
|
|
@@ -1243,6 +1139,9 @@ export interface GlobalAttributes {
|
|
|
1243
1139
|
| 'srcset'
|
|
1244
1140
|
| 'width'
|
|
1245
1141
|
)[];
|
|
1142
|
+
/**
|
|
1143
|
+
* @minItems 0
|
|
1144
|
+
*/
|
|
1246
1145
|
'#HTMLFormControlElementAttrs'?: (
|
|
1247
1146
|
| 'autocomplete'
|
|
1248
1147
|
| 'dirname'
|
|
@@ -1259,12 +1158,30 @@ export interface GlobalAttributes {
|
|
|
1259
1158
|
| 'readonly'
|
|
1260
1159
|
| 'required'
|
|
1261
1160
|
)[];
|
|
1161
|
+
/**
|
|
1162
|
+
* @minItems 0
|
|
1163
|
+
*/
|
|
1262
1164
|
'#HTMLTableCellElementAttrs'?: ('colspan' | 'headers' | 'rowspan')[];
|
|
1263
1165
|
'#ARIAAttrs'?: boolean;
|
|
1166
|
+
/**
|
|
1167
|
+
* @minItems 0
|
|
1168
|
+
*/
|
|
1264
1169
|
'#SVGAnimationAdditionAttrs'?: ('additive' | 'accumulate')[];
|
|
1170
|
+
/**
|
|
1171
|
+
* @minItems 0
|
|
1172
|
+
*/
|
|
1265
1173
|
'#SVGAnimationAttributeTargetAttrs'?: ('attributeName' | 'attributeType')[];
|
|
1174
|
+
/**
|
|
1175
|
+
* @minItems 0
|
|
1176
|
+
*/
|
|
1266
1177
|
'#SVGAnimationEventAttrs'?: ('onbegin' | 'onend' | 'onrepeat')[];
|
|
1178
|
+
/**
|
|
1179
|
+
* @minItems 0
|
|
1180
|
+
*/
|
|
1267
1181
|
'#SVGAnimationTargetElementAttrs'?: ('href' | 'xlink:href')[];
|
|
1182
|
+
/**
|
|
1183
|
+
* @minItems 0
|
|
1184
|
+
*/
|
|
1268
1185
|
'#SVGAnimationTimingAttrs'?: (
|
|
1269
1186
|
| 'begin'
|
|
1270
1187
|
| 'dur'
|
|
@@ -1276,6 +1193,9 @@ export interface GlobalAttributes {
|
|
|
1276
1193
|
| 'repeatDur'
|
|
1277
1194
|
| 'fill'
|
|
1278
1195
|
)[];
|
|
1196
|
+
/**
|
|
1197
|
+
* @minItems 0
|
|
1198
|
+
*/
|
|
1279
1199
|
'#SVGAnimationValueAttrs'?: (
|
|
1280
1200
|
| 'calcMode'
|
|
1281
1201
|
| 'values'
|
|
@@ -1289,7 +1209,13 @@ export interface GlobalAttributes {
|
|
|
1289
1209
|
| 'autoReverse'
|
|
1290
1210
|
| 'speed'
|
|
1291
1211
|
)[];
|
|
1212
|
+
/**
|
|
1213
|
+
* @minItems 0
|
|
1214
|
+
*/
|
|
1292
1215
|
'#SVGConditionalProcessingAttrs'?: ('requiredExtensions' | 'systemLanguage' | 'requiredFeatures')[];
|
|
1216
|
+
/**
|
|
1217
|
+
* @minItems 0
|
|
1218
|
+
*/
|
|
1293
1219
|
'#SVGCoreAttrs'?: (
|
|
1294
1220
|
| 'id'
|
|
1295
1221
|
| 'tabindex'
|
|
@@ -1302,7 +1228,13 @@ export interface GlobalAttributes {
|
|
|
1302
1228
|
| 'xml:lang'
|
|
1303
1229
|
| 'xml:base'
|
|
1304
1230
|
)[];
|
|
1231
|
+
/**
|
|
1232
|
+
* @minItems 0
|
|
1233
|
+
*/
|
|
1305
1234
|
'#SVGFilterPrimitiveAttrs'?: ('x' | 'y' | 'width' | 'height' | 'result' | 'in')[];
|
|
1235
|
+
/**
|
|
1236
|
+
* @minItems 0
|
|
1237
|
+
*/
|
|
1306
1238
|
'#SVGPresentationAttrs'?: (
|
|
1307
1239
|
| 'cx'
|
|
1308
1240
|
| 'cy'
|
|
@@ -1386,6 +1318,9 @@ export interface GlobalAttributes {
|
|
|
1386
1318
|
| 'enable-background'
|
|
1387
1319
|
| 'kerning'
|
|
1388
1320
|
)[];
|
|
1321
|
+
/**
|
|
1322
|
+
* @minItems 0
|
|
1323
|
+
*/
|
|
1389
1324
|
'#SVGTransferFunctionAttrs'?: (
|
|
1390
1325
|
| 'type'
|
|
1391
1326
|
| 'tableValues'
|
|
@@ -1395,6 +1330,9 @@ export interface GlobalAttributes {
|
|
|
1395
1330
|
| 'exponent'
|
|
1396
1331
|
| 'offset'
|
|
1397
1332
|
)[];
|
|
1333
|
+
/**
|
|
1334
|
+
* @minItems 0
|
|
1335
|
+
*/
|
|
1398
1336
|
'#XLinkAttrs'?: (
|
|
1399
1337
|
| 'xlink:href'
|
|
1400
1338
|
| 'xlink:title'
|
|
@@ -1413,8 +1351,6 @@ export interface Attributes {
|
|
|
1413
1351
|
* via the `patternProperty` ".*".
|
|
1414
1352
|
*/
|
|
1415
1353
|
export interface AttributeJSON {
|
|
1416
|
-
_TODO_?: string;
|
|
1417
|
-
ref: string;
|
|
1418
1354
|
type?: AttributeType | [AttributeType, ...AttributeType[]];
|
|
1419
1355
|
defaultValue?: string;
|
|
1420
1356
|
deprecated?: boolean;
|
|
@@ -1422,7 +1358,116 @@ export interface AttributeJSON {
|
|
|
1422
1358
|
requiredEither?: string[];
|
|
1423
1359
|
noUse?: boolean;
|
|
1424
1360
|
condition?: AttributeCondition;
|
|
1425
|
-
ineffective?:
|
|
1361
|
+
ineffective?: AttributeCondition;
|
|
1426
1362
|
animatable?: boolean;
|
|
1427
1363
|
experimental?: boolean;
|
|
1428
1364
|
}
|
|
1365
|
+
/**
|
|
1366
|
+
* - [Space-separated tokens](https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#space-separated-tokens)
|
|
1367
|
+
* - [Comma-separated tokens](https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#comma-separated-tokens)
|
|
1368
|
+
*/
|
|
1369
|
+
export interface List {
|
|
1370
|
+
token:
|
|
1371
|
+
| (
|
|
1372
|
+
| 'Any'
|
|
1373
|
+
| 'NoEmptyAny'
|
|
1374
|
+
| 'OneLineAny'
|
|
1375
|
+
| 'Zero'
|
|
1376
|
+
| 'Number'
|
|
1377
|
+
| 'Int'
|
|
1378
|
+
| 'Uint'
|
|
1379
|
+
| 'XMLName'
|
|
1380
|
+
| 'DOMID'
|
|
1381
|
+
| 'FunctionBody'
|
|
1382
|
+
| 'Pattern'
|
|
1383
|
+
| 'DateTime'
|
|
1384
|
+
| 'TabIndex'
|
|
1385
|
+
| 'BCP47'
|
|
1386
|
+
| 'URL'
|
|
1387
|
+
| 'AbsoluteURL'
|
|
1388
|
+
| 'HashName'
|
|
1389
|
+
| 'OneCodePointChar'
|
|
1390
|
+
| 'CustomElementName'
|
|
1391
|
+
| 'BrowsingContextName'
|
|
1392
|
+
| 'BrowsingContextNameOrKeyword'
|
|
1393
|
+
| 'HTTPSchemaURL'
|
|
1394
|
+
| 'MIMEType'
|
|
1395
|
+
| 'ItemProp'
|
|
1396
|
+
| 'Srcset'
|
|
1397
|
+
| 'SourceSizeList'
|
|
1398
|
+
| 'IconSize'
|
|
1399
|
+
| 'AutoComplete'
|
|
1400
|
+
| 'Accept'
|
|
1401
|
+
| 'SerializedPermissionsPolicy'
|
|
1402
|
+
| '<css-declaration-list>'
|
|
1403
|
+
| '<class-list>'
|
|
1404
|
+
| '<svg-font-size>'
|
|
1405
|
+
| '<svg-font-size-adjust>'
|
|
1406
|
+
| "<'color-profile'>"
|
|
1407
|
+
| "<'color-rendering'>"
|
|
1408
|
+
| "<'enable-background'>"
|
|
1409
|
+
| '<list-of-svg-feature-string>'
|
|
1410
|
+
| '<animatable-value>'
|
|
1411
|
+
| '<begin-value-list>'
|
|
1412
|
+
| '<end-value-list>'
|
|
1413
|
+
| '<list-of-value>'
|
|
1414
|
+
| '<clock-value>'
|
|
1415
|
+
| '<color-matrix>'
|
|
1416
|
+
| '<dasharray>'
|
|
1417
|
+
| '<key-points>'
|
|
1418
|
+
| '<key-splines>'
|
|
1419
|
+
| '<key-times>'
|
|
1420
|
+
| '<system-language>'
|
|
1421
|
+
| '<origin>'
|
|
1422
|
+
| '<svg-path>'
|
|
1423
|
+
| '<points>'
|
|
1424
|
+
| '<preserve-aspect-ratio>'
|
|
1425
|
+
| '<view-box>'
|
|
1426
|
+
| '<rotate>'
|
|
1427
|
+
| '<text-coordinate>'
|
|
1428
|
+
| '<list-of-lengths>'
|
|
1429
|
+
| '<list-of-numbers>'
|
|
1430
|
+
| '<list-of-percentages>'
|
|
1431
|
+
| '<number-optional-number>'
|
|
1432
|
+
)
|
|
1433
|
+
| Enum;
|
|
1434
|
+
disallowToSurroundBySpaces?: boolean;
|
|
1435
|
+
allowEmpty?: boolean;
|
|
1436
|
+
ordered?: boolean;
|
|
1437
|
+
unique?: boolean;
|
|
1438
|
+
caseInsensitive?: boolean;
|
|
1439
|
+
number?:
|
|
1440
|
+
| ('zeroOrMore' | 'oneOrMore')
|
|
1441
|
+
| {
|
|
1442
|
+
min: number;
|
|
1443
|
+
max: number;
|
|
1444
|
+
};
|
|
1445
|
+
separator: 'space' | 'comma';
|
|
1446
|
+
}
|
|
1447
|
+
/**
|
|
1448
|
+
* [Enumerated attributes](https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute)
|
|
1449
|
+
*/
|
|
1450
|
+
export interface Enum {
|
|
1451
|
+
/**
|
|
1452
|
+
* @minItems 1
|
|
1453
|
+
*/
|
|
1454
|
+
enum: [string, ...string[]];
|
|
1455
|
+
disallowToSurroundBySpaces?: boolean;
|
|
1456
|
+
caseInsensitive?: boolean;
|
|
1457
|
+
invalidValueDefault?: string;
|
|
1458
|
+
missingValueDefault?: string;
|
|
1459
|
+
sameStates?: {
|
|
1460
|
+
[k: string]: unknown;
|
|
1461
|
+
};
|
|
1462
|
+
}
|
|
1463
|
+
/**
|
|
1464
|
+
* [Numbers](https://html.spec.whatwg.org/dev/common-microsyntaxes.html#numbers)
|
|
1465
|
+
*/
|
|
1466
|
+
export interface Number {
|
|
1467
|
+
type: 'float' | 'integer';
|
|
1468
|
+
gt?: number;
|
|
1469
|
+
gte?: number;
|
|
1470
|
+
lt?: number;
|
|
1471
|
+
lte?: number;
|
|
1472
|
+
clampable?: boolean;
|
|
1473
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { AttributeType, GlobalAttributes } from './attributes';
|
|
3
|
-
import type { ContentModel,
|
|
1
|
+
import type { ARIA } from './aria';
|
|
2
|
+
import type { AttributeJSON, AttributeType, GlobalAttributes } from './attributes';
|
|
3
|
+
import type { ContentModel, Category } from './permitted-structures';
|
|
4
|
+
import type { NamespaceURI } from '@markuplint/ml-ast';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
+
* markuplint Markup-language spec
|
|
7
8
|
*/
|
|
8
9
|
export interface MLMLSpec {
|
|
9
10
|
cites: Cites;
|
|
@@ -33,9 +34,17 @@ export type SpecDefs = {
|
|
|
33
34
|
'#HTMLGlobalAttrs': Record<string, Partial<Attribute>>;
|
|
34
35
|
[OtherGlobalAttrs: string]: Record<string, Partial<Attribute>>;
|
|
35
36
|
}>;
|
|
36
|
-
'#
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
'#aria': {
|
|
38
|
+
'1.2': ARIASpec;
|
|
39
|
+
'1.1': ARIASpec;
|
|
40
|
+
};
|
|
41
|
+
'#contentModels': { [model in Category]?: string[] };
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
type ARIASpec = {
|
|
45
|
+
roles: ARIARoleInSchema[];
|
|
46
|
+
graphicsRoles: ARIARoleInSchema[];
|
|
47
|
+
props: ARIAProperty[];
|
|
39
48
|
};
|
|
40
49
|
|
|
41
50
|
/**
|
|
@@ -51,7 +60,7 @@ export type ElementSpec = {
|
|
|
51
60
|
* Namespaces in XML
|
|
52
61
|
* @see https://www.w3.org/TR/xml-names/
|
|
53
62
|
*/
|
|
54
|
-
namespace?:
|
|
63
|
+
namespace?: NamespaceURI;
|
|
55
64
|
|
|
56
65
|
/**
|
|
57
66
|
* Reference URL
|
|
@@ -88,43 +97,19 @@ export type ElementSpec = {
|
|
|
88
97
|
nonStandard?: true;
|
|
89
98
|
|
|
90
99
|
/**
|
|
91
|
-
* Element
|
|
100
|
+
* Element categories
|
|
92
101
|
*/
|
|
93
|
-
categories:
|
|
102
|
+
categories: Category[];
|
|
94
103
|
|
|
95
104
|
/**
|
|
96
105
|
* Permitted contents and permitted parents
|
|
97
106
|
*/
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Permitted ARIA roles
|
|
102
|
-
*/
|
|
103
|
-
permittedRoles: {
|
|
104
|
-
summary: string;
|
|
105
|
-
roles: PermittedRoles;
|
|
106
|
-
conditions?: {
|
|
107
|
-
condition: string;
|
|
108
|
-
roles: PermittedRoles;
|
|
109
|
-
}[];
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Implicit ARIA role
|
|
114
|
-
*/
|
|
115
|
-
implicitRole: {
|
|
116
|
-
summary: string;
|
|
117
|
-
role: ImplicitRole;
|
|
118
|
-
conditions?: {
|
|
119
|
-
condition: string;
|
|
120
|
-
role: ImplicitRole;
|
|
121
|
-
}[];
|
|
122
|
-
};
|
|
107
|
+
contentModel: ContentModel;
|
|
123
108
|
|
|
124
109
|
/**
|
|
125
|
-
* Tag
|
|
110
|
+
* Tag omission
|
|
126
111
|
*/
|
|
127
|
-
|
|
112
|
+
omission: ElementSpecOmission;
|
|
128
113
|
|
|
129
114
|
/**
|
|
130
115
|
* Global Attributes
|
|
@@ -136,6 +121,11 @@ export type ElementSpec = {
|
|
|
136
121
|
*/
|
|
137
122
|
attributes: Record<string, Attribute>;
|
|
138
123
|
|
|
124
|
+
/**
|
|
125
|
+
* WAI-ARIA role and properties
|
|
126
|
+
*/
|
|
127
|
+
aria: ARIA;
|
|
128
|
+
|
|
139
129
|
/**
|
|
140
130
|
* If true, it is possible to add any properties as attributes,
|
|
141
131
|
* for example, when using a template engine or a view language.
|
|
@@ -147,20 +137,9 @@ export type ElementSpec = {
|
|
|
147
137
|
possibleToAddProperties?: true;
|
|
148
138
|
};
|
|
149
139
|
|
|
150
|
-
|
|
151
|
-
* If `false`, this mean is "No corresponding role".
|
|
152
|
-
*/
|
|
153
|
-
type ImplicitRole = string | false;
|
|
140
|
+
type ElementSpecOmission = false | ElementSpecOmissionTags;
|
|
154
141
|
|
|
155
|
-
|
|
156
|
-
* If `true`, this mean is "Any".
|
|
157
|
-
* If `false`, this mean is "No".
|
|
158
|
-
*/
|
|
159
|
-
export type PermittedRoles = string[] | boolean;
|
|
160
|
-
|
|
161
|
-
type ElementSpecOmittion = false | ElementSpecOmittionTags;
|
|
162
|
-
|
|
163
|
-
type ElementSpecOmittionTags = {
|
|
142
|
+
type ElementSpecOmissionTags = {
|
|
164
143
|
startTag: boolean | ElementCondition;
|
|
165
144
|
endTag: boolean | ElementCondition;
|
|
166
145
|
};
|
|
@@ -180,31 +159,39 @@ export type Attribute = {
|
|
|
180
159
|
nonStandard?: true;
|
|
181
160
|
} & ExtendableAttributeSpec;
|
|
182
161
|
|
|
183
|
-
type ExtendableAttributeSpec = Omit<AttributeJSON, '
|
|
162
|
+
type ExtendableAttributeSpec = Omit<AttributeJSON, 'type'>;
|
|
184
163
|
|
|
185
|
-
export type
|
|
164
|
+
export type ARIARole = {
|
|
186
165
|
name: string;
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
requiredContextRole?: string[];
|
|
166
|
+
isAbstract: boolean;
|
|
167
|
+
requiredContextRole: string[];
|
|
168
|
+
requiredOwnedElements: string[];
|
|
191
169
|
accessibleNameRequired: boolean;
|
|
170
|
+
accessibleNameFromAuthor: boolean;
|
|
192
171
|
accessibleNameFromContent: boolean;
|
|
193
172
|
accessibleNameProhibited: boolean;
|
|
194
|
-
|
|
195
|
-
|
|
173
|
+
childrenPresentational: boolean;
|
|
174
|
+
ownedProperties: ARIARoleOwnedProperties[];
|
|
175
|
+
prohibitedProperties: string[];
|
|
196
176
|
};
|
|
197
177
|
|
|
198
|
-
export type
|
|
178
|
+
export type ARIARoleInSchema = Partial<
|
|
179
|
+
ARIARole & {
|
|
180
|
+
description: string;
|
|
181
|
+
generalization: string[];
|
|
182
|
+
}
|
|
183
|
+
> & {
|
|
184
|
+
name: string;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
export type ARIARoleOwnedProperties = {
|
|
199
188
|
name: string;
|
|
200
189
|
inherited?: true;
|
|
201
190
|
required?: true;
|
|
202
191
|
deprecated?: true;
|
|
203
|
-
prohibited?: true;
|
|
204
|
-
defaultValue?: boolean | string | number;
|
|
205
192
|
};
|
|
206
193
|
|
|
207
|
-
export type
|
|
194
|
+
export type ARIAProperty = {
|
|
208
195
|
name: string;
|
|
209
196
|
type: 'property' | 'state';
|
|
210
197
|
deprecated?: true;
|
|
@@ -233,22 +220,36 @@ export type ARIAAttributeValue =
|
|
|
233
220
|
| 'token list'
|
|
234
221
|
| 'URI';
|
|
235
222
|
|
|
223
|
+
export type ARIAVersion = '1.1' | '1.2';
|
|
224
|
+
|
|
236
225
|
export type EquivalentHtmlAttr = {
|
|
237
226
|
htmlAttrName: string;
|
|
238
227
|
isNotStrictEquivalent?: true;
|
|
239
228
|
value: string | null;
|
|
240
229
|
};
|
|
241
230
|
|
|
242
|
-
export
|
|
243
|
-
|
|
244
|
-
|
|
231
|
+
export type Matches = (selector: string) => boolean;
|
|
232
|
+
|
|
233
|
+
export type ComputedRole = {
|
|
234
|
+
el: Element;
|
|
235
|
+
role:
|
|
236
|
+
| (ARIARole & {
|
|
237
|
+
superClassRoles: ARIARoleInSchema[];
|
|
238
|
+
isImplicit?: boolean;
|
|
239
|
+
})
|
|
240
|
+
| null;
|
|
241
|
+
errorType?: RoleComputationError;
|
|
242
|
+
};
|
|
245
243
|
|
|
246
|
-
export
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
244
|
+
export type RoleComputationError =
|
|
245
|
+
| 'ABSTRACT'
|
|
246
|
+
| 'GLOBAL_PROP_MUST_NOT_BE_PRESENTATIONAL'
|
|
247
|
+
| 'IMPLICIT_ROLE_NAMESPACE_ERROR'
|
|
248
|
+
| 'INTERACTIVE_ELEMENT_MUST_NOT_BE_PRESENTATIONAL'
|
|
249
|
+
| 'INVALID_LANDMARK'
|
|
250
|
+
| 'INVALID_REQUIRED_CONTEXT_ROLE'
|
|
251
|
+
| 'NO_EXPLICIT'
|
|
252
|
+
| 'NO_OWNER'
|
|
253
|
+
| 'NO_PERMITTED'
|
|
254
|
+
| 'REQUIRED_OWNED_ELEMENT_MUST_NOT_BE_PRESENTATIONAL'
|
|
255
|
+
| 'ROLE_NO_EXISTS';
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
4
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
5
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export type PermittedContentPattern =
|
|
9
|
+
| PermittedContentRequire
|
|
10
|
+
| PermittedContentOptional
|
|
11
|
+
| PermittedContentOneOrMore
|
|
12
|
+
| PermittedContentZeroOrMore
|
|
13
|
+
| PermittedContentChoice
|
|
14
|
+
| PermittedContentTransparent;
|
|
15
|
+
export type Model = ContentType | ContentType[];
|
|
16
|
+
export type ContentType = string | Category;
|
|
17
|
+
export type Category =
|
|
18
|
+
| '#text'
|
|
19
|
+
| '#phrasing'
|
|
20
|
+
| '#flow'
|
|
21
|
+
| '#interactive'
|
|
22
|
+
| '#heading'
|
|
23
|
+
| '#sectioning'
|
|
24
|
+
| '#metadata'
|
|
25
|
+
| '#embedded'
|
|
26
|
+
| '#palpable'
|
|
27
|
+
| '#script-supporting'
|
|
28
|
+
| '#SVGAnimation'
|
|
29
|
+
| '#SVGBasicShapes'
|
|
30
|
+
| '#SVGContainer'
|
|
31
|
+
| '#SVGDescriptive'
|
|
32
|
+
| '#SVGFilterPrimitive'
|
|
33
|
+
| '#SVGFont'
|
|
34
|
+
| '#SVGGradient'
|
|
35
|
+
| '#SVGGraphics'
|
|
36
|
+
| '#SVGGraphicsReferencing'
|
|
37
|
+
| '#SVGLightSource'
|
|
38
|
+
| '#SVGNeverRendered'
|
|
39
|
+
| '#SVGNone'
|
|
40
|
+
| '#SVGPaintServer'
|
|
41
|
+
| '#SVGRenderable'
|
|
42
|
+
| '#SVGShape'
|
|
43
|
+
| '#SVGStructural'
|
|
44
|
+
| '#SVGStructurallyExternal'
|
|
45
|
+
| '#SVGTextContent'
|
|
46
|
+
| '#SVGTextContentChild'
|
|
47
|
+
| '#SVGOtherXMLNamespace';
|
|
48
|
+
|
|
49
|
+
export interface ContentModelsSchema {
|
|
50
|
+
__contentModel?: ContentModel;
|
|
51
|
+
}
|
|
52
|
+
export interface ContentModel {
|
|
53
|
+
contents: PermittedContentPattern[] | boolean;
|
|
54
|
+
descendantOf?: string;
|
|
55
|
+
conditional?: {
|
|
56
|
+
condition: string;
|
|
57
|
+
contents: PermittedContentPattern[] | boolean;
|
|
58
|
+
}[];
|
|
59
|
+
}
|
|
60
|
+
export interface PermittedContentRequire {
|
|
61
|
+
require: Model;
|
|
62
|
+
max?: number;
|
|
63
|
+
min?: number;
|
|
64
|
+
_TODO_?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface PermittedContentOptional {
|
|
67
|
+
optional: Model;
|
|
68
|
+
max?: number;
|
|
69
|
+
_TODO_?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface PermittedContentOneOrMore {
|
|
72
|
+
oneOrMore: Model | PermittedContentPattern[];
|
|
73
|
+
max?: number;
|
|
74
|
+
_TODO_?: string;
|
|
75
|
+
}
|
|
76
|
+
export interface PermittedContentZeroOrMore {
|
|
77
|
+
zeroOrMore: Model | PermittedContentPattern[];
|
|
78
|
+
max?: number;
|
|
79
|
+
_TODO_?: string;
|
|
80
|
+
}
|
|
81
|
+
export interface PermittedContentChoice {
|
|
82
|
+
/**
|
|
83
|
+
* @minItems 2
|
|
84
|
+
* @maxItems 5
|
|
85
|
+
*/
|
|
86
|
+
choice:
|
|
87
|
+
| [PermittedContentPattern[], PermittedContentPattern[]]
|
|
88
|
+
| [PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[]]
|
|
89
|
+
| [PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[]]
|
|
90
|
+
| [
|
|
91
|
+
PermittedContentPattern[],
|
|
92
|
+
PermittedContentPattern[],
|
|
93
|
+
PermittedContentPattern[],
|
|
94
|
+
PermittedContentPattern[],
|
|
95
|
+
PermittedContentPattern[],
|
|
96
|
+
];
|
|
97
|
+
_TODO_?: string;
|
|
98
|
+
}
|
|
99
|
+
export interface PermittedContentTransparent {
|
|
100
|
+
transparent: string;
|
|
101
|
+
}
|