@markuplint/ml-spec 3.0.0-alpha.82 → 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 +8 -3
- 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 +12 -0
- package/lib/dom-traverse/get-computed-aria-props.js +108 -0
- package/lib/dom-traverse/get-computed-role.d.ts +6 -1
- package/lib/dom-traverse/get-computed-role.js +54 -35
- package/lib/dom-traverse/get-content-model.d.ts +29 -0
- package/lib/dom-traverse/get-content-model.js +30 -0
- 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 +5 -2
- package/lib/dom-traverse/get-spec.js +4 -2
- package/lib/dom-traverse/has-required-owned-elements.d.ts +8 -2
- package/lib/dom-traverse/has-required-owned-elements.js +26 -8
- package/lib/dom-traverse/is-exposed.d.ts +11 -0
- package/lib/dom-traverse/is-exposed.js +217 -0
- 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 +2 -0
- package/lib/dom-traverse/may-be-focusable.js +24 -0
- package/lib/index.d.ts +11 -1
- package/lib/index.js +11 -1
- package/lib/specs/aria-specs.d.ts +7 -4
- package/lib/specs/content-model-category-to-tag-names.d.ts +5 -2
- package/lib/specs/content-model-category-to-tag-names.js +2 -2
- package/lib/specs/get-aria.d.ts +8 -1
- package/lib/specs/get-aria.js +11 -5
- package/lib/specs/get-attr-specs.d.ts +7 -3
- 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 +2 -2
- package/lib/specs/get-selectors-by-content-model-category.js +1 -1
- package/lib/specs/get-spec-by-tag-name.d.ts +6 -2
- 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 +9 -0
- package/lib/specs/is-palpable-elements.js +49 -0
- package/lib/specs/is-void-element.d.ts +1 -0
- package/lib/specs/is-void-element.js +27 -0
- 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 +150 -109
- package/lib/types/attributes.d.ts +1507 -73
- package/lib/types/index.d.ts +195 -166
- package/{src/types/permitted-structres.ts → lib/types/permitted-structures.d.ts} +24 -35
- package/lib/utils/get-ns.d.ts +2 -1
- package/lib/utils/get-ns.js +3 -0
- package/lib/utils/merge-array.d.ts +9 -4
- package/lib/utils/resolve-namespace.d.ts +7 -7
- package/lib/utils/resolve-namespace.js +19 -13
- package/lib/utils/validateAriaVersion.d.ts +2 -0
- package/lib/utils/validateAriaVersion.js +8 -0
- package/package.json +13 -8
- package/schema.json +6 -6
- package/{src/dom-traverse/accname-computation.spec.ts → test/dom-traverse/accname-computation.spec.js} +8 -8
- 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/test/dom-traverse/is-exposed.spec.js +70 -0
- 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} +11 -11
- package/test/specs/resolve-version.spec.js +34 -0
- package/test/specs/schema-to-spec.spec.js +61 -0
- package/test/utils/resolve-namespace.spec.js +37 -0
- package/lib/dom-traverse/focusability-computation.d.ts +0 -1
- package/lib/dom-traverse/focusability-computation.js +0 -8
- package/lib/dom-traverse/get-aria.d.ts +0 -9
- package/lib/dom-traverse/get-aria.js +0 -54
- package/lib/specs/aria-spec.d.ts +0 -5
- package/lib/specs/aria-spec.js +0 -12
- package/lib/specs/get-spec.d.ts +0 -13
- package/lib/specs/get-spec.js +0 -85
- package/lib/specs/html-spec.d.ts +0 -6
- package/lib/specs/html-spec.js +0 -16
- package/lib/specs/resolve-namespace.d.ts +0 -9
- package/lib/specs/resolve-namespace.js +0 -26
- package/lib/types/permitted-structres.d.ts +0 -64
- package/lib/utils.d.ts +0 -8
- package/lib/utils.js +0 -50
- package/schemas/aria.schema.json +0 -258
- package/schemas/attributes.schema.json +0 -204
- package/schemas/content-models.schema.json +0 -215
- 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-role.spec.ts +0 -134
- package/src/dom-traverse/get-computed-role.ts +0 -193
- 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 -72
- package/src/index.ts +0 -17
- 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 -16
- package/src/specs/is-presentational.ts +0 -6
- 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 -147
- package/src/types/attributes.ts +0 -1418
- package/src/types/index.ts +0 -255
- package/src/utils/get-ns.ts +0 -13
- package/src/utils/merge-array.ts +0 -35
- package/src/utils/resolve-namespace.ts +0 -36
- package/tsconfig.test.json +0 -3
- package/tsconfig.tsbuildinfo +0 -1
- /package/lib/types/{permitted-structres.js → permitted-structures.js} +0 -0
|
@@ -4,12 +4,13 @@ exports.getSpecByTagName = void 0;
|
|
|
4
4
|
const resolve_namespace_1 = require("../utils/resolve-namespace");
|
|
5
5
|
const cache = new Map();
|
|
6
6
|
function getSpecByTagName(specs, localName, namespace) {
|
|
7
|
-
|
|
7
|
+
var _a;
|
|
8
|
+
const { localNameWithNS } = (0, resolve_namespace_1.resolveNamespace)(localName, namespace !== null && namespace !== void 0 ? namespace : undefined);
|
|
8
9
|
let spec = cache.get(localNameWithNS);
|
|
9
10
|
if (spec !== undefined) {
|
|
10
11
|
return spec;
|
|
11
12
|
}
|
|
12
|
-
spec = specs.
|
|
13
|
+
spec = (_a = specs.find(spec => spec.name === localNameWithNS)) !== null && _a !== void 0 ? _a : null;
|
|
13
14
|
cache.set(localNameWithNS, spec);
|
|
14
15
|
return spec;
|
|
15
16
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isNothingContentModel = void 0;
|
|
4
|
+
const is_void_element_1 = require("./is-void-element");
|
|
5
|
+
/**
|
|
6
|
+
* @see https://html.spec.whatwg.org/multipage/dom.html#the-nothing-content-model
|
|
7
|
+
* @see https://html.spec.whatwg.org/multipage/indices.html#elements-3
|
|
8
|
+
*/
|
|
9
|
+
function isNothingContentModel(
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
11
|
+
el) {
|
|
12
|
+
return (0, is_void_element_1.isVoidElement)(el) || ['iframe', 'template'].includes(el.localName);
|
|
13
|
+
}
|
|
14
|
+
exports.isNothingContentModel = isNothingContentModel;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isPalpableElement = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Exposable content models and elements
|
|
6
|
+
*
|
|
7
|
+
* **WARNING**:
|
|
8
|
+
* This implementation is through the author's interpretation.
|
|
9
|
+
* Want a issue request.
|
|
10
|
+
* https://github.com/markuplint/markuplint/issues/new
|
|
11
|
+
*
|
|
12
|
+
* @see https://html.spec.whatwg.org/multipage/indices.html#elements-3
|
|
13
|
+
*/
|
|
14
|
+
const exposableElementsThatAreNoBelongingAModel = [
|
|
15
|
+
'body',
|
|
16
|
+
'dd',
|
|
17
|
+
'dt',
|
|
18
|
+
'figcaption',
|
|
19
|
+
'html',
|
|
20
|
+
'legend',
|
|
21
|
+
'li',
|
|
22
|
+
'optgroup',
|
|
23
|
+
'option',
|
|
24
|
+
'rp',
|
|
25
|
+
'rt',
|
|
26
|
+
'summary',
|
|
27
|
+
'tbody',
|
|
28
|
+
'td',
|
|
29
|
+
'tfoot',
|
|
30
|
+
'th',
|
|
31
|
+
'thead',
|
|
32
|
+
'tr',
|
|
33
|
+
];
|
|
34
|
+
function isPalpableElement(
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
36
|
+
el, specs, options) {
|
|
37
|
+
var _a, _b, _c, _d;
|
|
38
|
+
const conditions = [(_b = (_a = specs.def['#contentModels']['#palpable']) === null || _a === void 0 ? void 0 : _a.join(',')) !== null && _b !== void 0 ? _b : ''];
|
|
39
|
+
if ((options === null || options === void 0 ? void 0 : options.extendsSvg) !== false /* default true */) {
|
|
40
|
+
conditions.push((_d = (_c = specs.def['#contentModels']['#SVGRenderable']) === null || _c === void 0 ? void 0 : _c.join(',')) !== null && _d !== void 0 ? _d : '');
|
|
41
|
+
}
|
|
42
|
+
if (options === null || options === void 0 ? void 0 : options.extendsExposableElements /* default false */) {
|
|
43
|
+
conditions.push(exposableElementsThatAreNoBelongingAModel.join(','));
|
|
44
|
+
}
|
|
45
|
+
return conditions.some(condition => {
|
|
46
|
+
return el.matches(condition);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
exports.isPalpableElement = isPalpableElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isVoidElement(el: Element): boolean;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isVoidElement = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @see https://html.spec.whatwg.org/multipage/syntax.html#void-elements
|
|
6
|
+
*/
|
|
7
|
+
const voidElements = [
|
|
8
|
+
'area',
|
|
9
|
+
'base',
|
|
10
|
+
'br',
|
|
11
|
+
'col',
|
|
12
|
+
'embed',
|
|
13
|
+
'hr',
|
|
14
|
+
'img',
|
|
15
|
+
'input',
|
|
16
|
+
'link',
|
|
17
|
+
'meta',
|
|
18
|
+
'source',
|
|
19
|
+
'track',
|
|
20
|
+
'wbr',
|
|
21
|
+
];
|
|
22
|
+
function isVoidElement(
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
24
|
+
el) {
|
|
25
|
+
return voidElements.includes(el.localName);
|
|
26
|
+
}
|
|
27
|
+
exports.isVoidElement = isVoidElement;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { ARIAVersion } from '../types';
|
|
2
2
|
import type { ARIA } from '../types/aria';
|
|
3
|
-
|
|
3
|
+
import type { ReadonlyDeep } from 'type-fest';
|
|
4
|
+
export declare function resolveVersion(
|
|
5
|
+
aria: ReadonlyDeep<ARIA>,
|
|
6
|
+
version: ARIAVersion,
|
|
7
|
+
): Omit<ReadonlyDeep<ARIA>, ARIAVersion>;
|
|
@@ -7,7 +7,7 @@ function resolveVersion(aria, version) {
|
|
|
7
7
|
const permittedRoles = (_d = (_c = aria[version]) === null || _c === void 0 ? void 0 : _c.permittedRoles) !== null && _d !== void 0 ? _d : aria.permittedRoles;
|
|
8
8
|
const implicitProperties = (_f = (_e = aria[version]) === null || _e === void 0 ? void 0 : _e.implicitProperties) !== null && _f !== void 0 ? _f : aria.implicitProperties;
|
|
9
9
|
const properties = (_h = (_g = aria[version]) === null || _g === void 0 ? void 0 : _g.properties) !== null && _h !== void 0 ? _h : aria.properties;
|
|
10
|
-
const namingProhibited = version === '1.
|
|
10
|
+
const namingProhibited = version === '1.1' ? aria.namingProhibited : (_k = (_j = aria[version]) === null || _j === void 0 ? void 0 : _j.namingProhibited) !== null && _k !== void 0 ? _k : aria.namingProhibited;
|
|
11
11
|
const conditions = (_m = (_l = aria[version]) === null || _l === void 0 ? void 0 : _l.conditions) !== null && _m !== void 0 ? _m : aria.conditions;
|
|
12
12
|
return {
|
|
13
13
|
implicitRole,
|
|
@@ -2,12 +2,12 @@ import type { ElementSpec, ExtendedSpec, MLMLSpec } from '../types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Merging HTML-spec schema and extended spec schemas
|
|
4
4
|
*
|
|
5
|
-
* Ex: `@markuplint/html-spec` + `{ specs:
|
|
5
|
+
* Ex: `@markuplint/html-spec` + `{ specs: { "\\.vue$": "@markuplint/vue-spec" } }` in configure files.
|
|
6
6
|
*
|
|
7
7
|
* @param schemas `MLDocument.schemas`
|
|
8
8
|
*/
|
|
9
9
|
export declare function schemaToSpec(schemas: readonly [MLMLSpec, ...ExtendedSpec[]]): {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
cites: import('../types').Cites;
|
|
11
|
+
def: import('../types').SpecDefs;
|
|
12
|
+
specs: readonly ElementSpec[];
|
|
13
13
|
};
|
|
@@ -5,12 +5,12 @@ const merge_array_1 = require("../utils/merge-array");
|
|
|
5
5
|
/**
|
|
6
6
|
* Merging HTML-spec schema and extended spec schemas
|
|
7
7
|
*
|
|
8
|
-
* Ex: `@markuplint/html-spec` + `{ specs:
|
|
8
|
+
* Ex: `@markuplint/html-spec` + `{ specs: { "\\.vue$": "@markuplint/vue-spec" } }` in configure files.
|
|
9
9
|
*
|
|
10
10
|
* @param schemas `MLDocument.schemas`
|
|
11
11
|
*/
|
|
12
12
|
function schemaToSpec(schemas) {
|
|
13
|
-
var _a, _b, _c;
|
|
13
|
+
var _a, _b, _c, _d, _e;
|
|
14
14
|
const [main, ...extendedSpecs] = schemas;
|
|
15
15
|
const result = { ...main };
|
|
16
16
|
for (const extendedSpec of extendedSpecs) {
|
|
@@ -18,37 +18,48 @@ function schemaToSpec(schemas) {
|
|
|
18
18
|
result.cites = [...result.cites, ...extendedSpec.cites];
|
|
19
19
|
}
|
|
20
20
|
if (extendedSpec.def) {
|
|
21
|
+
const def = { ...result.def };
|
|
21
22
|
if ((_a = extendedSpec.def['#globalAttrs']) === null || _a === void 0 ? void 0 : _a['#extends']) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
...((
|
|
23
|
+
const gAttrs = { ...def['#globalAttrs'] };
|
|
24
|
+
gAttrs['#HTMLGlobalAttrs'] = {
|
|
25
|
+
...((_c = (_b = def['#globalAttrs']) === null || _b === void 0 ? void 0 : _b['#HTMLGlobalAttrs']) !== null && _c !== void 0 ? _c : {}),
|
|
26
|
+
...((_e = (_d = extendedSpec.def['#globalAttrs']) === null || _d === void 0 ? void 0 : _d['#extends']) !== null && _e !== void 0 ? _e : {}),
|
|
25
27
|
};
|
|
28
|
+
def['#globalAttrs'] = gAttrs;
|
|
26
29
|
}
|
|
27
30
|
if (extendedSpec.def['#aria']) {
|
|
28
|
-
|
|
31
|
+
def['#aria'] = {
|
|
29
32
|
'1.1': {
|
|
30
|
-
roles: (0, merge_array_1.mergeArray)(
|
|
31
|
-
props: (0, merge_array_1.mergeArray)(
|
|
32
|
-
graphicsRoles: (0, merge_array_1.mergeArray)(
|
|
33
|
+
roles: (0, merge_array_1.mergeArray)(def['#aria']['1.1'].roles, extendedSpec.def['#aria']['1.1'].roles),
|
|
34
|
+
props: (0, merge_array_1.mergeArray)(def['#aria']['1.1'].props, extendedSpec.def['#aria']['1.1'].props),
|
|
35
|
+
graphicsRoles: (0, merge_array_1.mergeArray)(def['#aria']['1.1'].graphicsRoles, extendedSpec.def['#aria']['1.1'].graphicsRoles),
|
|
33
36
|
},
|
|
34
37
|
'1.2': {
|
|
35
|
-
roles: (0, merge_array_1.mergeArray)(
|
|
36
|
-
props: (0, merge_array_1.mergeArray)(
|
|
37
|
-
graphicsRoles: (0, merge_array_1.mergeArray)(
|
|
38
|
+
roles: (0, merge_array_1.mergeArray)(def['#aria']['1.2'].roles, extendedSpec.def['#aria']['1.2'].roles),
|
|
39
|
+
props: (0, merge_array_1.mergeArray)(def['#aria']['1.2'].props, extendedSpec.def['#aria']['1.2'].props),
|
|
40
|
+
graphicsRoles: (0, merge_array_1.mergeArray)(def['#aria']['1.2'].graphicsRoles, extendedSpec.def['#aria']['1.2'].graphicsRoles),
|
|
41
|
+
},
|
|
42
|
+
'1.3': {
|
|
43
|
+
roles: (0, merge_array_1.mergeArray)(def['#aria']['1.3'].roles, extendedSpec.def['#aria']['1.3'].roles),
|
|
44
|
+
props: (0, merge_array_1.mergeArray)(def['#aria']['1.3'].props, extendedSpec.def['#aria']['1.3'].props),
|
|
45
|
+
graphicsRoles: (0, merge_array_1.mergeArray)(def['#aria']['1.3'].graphicsRoles, extendedSpec.def['#aria']['1.3'].graphicsRoles),
|
|
38
46
|
},
|
|
39
47
|
};
|
|
40
48
|
}
|
|
41
49
|
if (extendedSpec.def['#contentModels']) {
|
|
50
|
+
const models = { ...def['#contentModels'] };
|
|
42
51
|
const keys = new Set([
|
|
43
|
-
...Object.keys(
|
|
52
|
+
...Object.keys(def['#contentModels']),
|
|
44
53
|
...Object.keys(extendedSpec.def['#contentModels']),
|
|
45
54
|
]);
|
|
46
55
|
for (const modelName of keys) {
|
|
47
|
-
const mainModel =
|
|
56
|
+
const mainModel = def['#contentModels'][modelName];
|
|
48
57
|
const exModel = extendedSpec.def['#contentModels'][modelName];
|
|
49
|
-
|
|
58
|
+
models[modelName] = [...(mainModel !== null && mainModel !== void 0 ? mainModel : []), ...(exModel !== null && exModel !== void 0 ? exModel : [])];
|
|
50
59
|
}
|
|
60
|
+
def['#contentModels'] = models;
|
|
51
61
|
}
|
|
62
|
+
result.def = def;
|
|
52
63
|
}
|
|
53
64
|
if (extendedSpec.specs) {
|
|
54
65
|
const exSpecs = extendedSpec.specs.slice();
|
|
@@ -66,10 +77,10 @@ function schemaToSpec(schemas) {
|
|
|
66
77
|
...exSpec,
|
|
67
78
|
globalAttrs: {
|
|
68
79
|
...elSpec.globalAttrs,
|
|
69
|
-
...exSpec.globalAttrs,
|
|
80
|
+
...exSpec === null || exSpec === void 0 ? void 0 : exSpec.globalAttrs,
|
|
70
81
|
},
|
|
71
|
-
attributes: mergeAttrSpec(elSpec.attributes, exSpec.attributes),
|
|
72
|
-
categories: (0, merge_array_1.mergeArray)(elSpec.categories, exSpec.categories),
|
|
82
|
+
attributes: mergeAttrSpec(elSpec.attributes, exSpec === null || exSpec === void 0 ? void 0 : exSpec.attributes),
|
|
83
|
+
categories: (0, merge_array_1.mergeArray)(elSpec.categories, exSpec === null || exSpec === void 0 ? void 0 : exSpec.categories),
|
|
73
84
|
});
|
|
74
85
|
}
|
|
75
86
|
result.specs = specs;
|
package/lib/types/aria.d.ts
CHANGED
|
@@ -6,125 +6,166 @@
|
|
|
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
|
+
| PermittedARIAAAMInfo;
|
|
21
24
|
/**
|
|
22
25
|
* If set false:
|
|
23
26
|
* > No role or aria-* attributes
|
|
24
27
|
*/
|
|
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
|
-
|
|
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
|
+
};
|
|
62
79
|
export interface AriaSchema {
|
|
63
|
-
|
|
64
|
-
|
|
80
|
+
_?: ARIA;
|
|
81
|
+
[k: string]: unknown;
|
|
65
82
|
}
|
|
66
83
|
export interface ARIA {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
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;
|
|
123
164
|
}
|
|
124
165
|
export interface ImplicitProperties {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
166
|
+
/**
|
|
167
|
+
* This interface was referenced by `ImplicitProperties`'s JSON-Schema definition
|
|
168
|
+
* via the `patternProperty` "^aria-.+".
|
|
169
|
+
*/
|
|
170
|
+
[k: string]: string;
|
|
130
171
|
}
|