@markuplint/ml-spec 3.0.0-alpha.82 → 3.0.0-dev.24
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/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-computed-role.js +13 -25
- 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.js +1 -1
- package/lib/dom-traverse/get-spec.d.ts +2 -2
- package/lib/dom-traverse/get-spec.js +2 -2
- package/lib/dom-traverse/has-required-owned-elements.js +12 -0
- package/lib/dom-traverse/is-exposed.d.ts +11 -0
- package/lib/dom-traverse/is-exposed.js +181 -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 +8 -1
- package/lib/index.js +8 -1
- package/lib/specs/content-model-category-to-tag-names.d.ts +2 -2
- package/lib/specs/content-model-category-to-tag-names.js +2 -2
- package/lib/specs/get-aria.js +3 -3
- package/lib/specs/get-attr-specs.d.ts +1 -1
- package/lib/specs/get-selectors-by-content-model-category.d.ts +1 -1
- package/lib/specs/get-spec-by-tag-name.d.ts +2 -2
- package/lib/specs/get-spec-by-tag-name.js +1 -1
- package/lib/specs/is-nothing-content-model.d.ts +5 -0
- package/lib/specs/is-nothing-content-model.js +12 -0
- package/lib/specs/is-palpable-elements.d.ts +5 -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 +1 -1
- package/lib/specs/schema-to-spec.js +1 -1
- package/lib/types/aria.d.ts +10 -4
- package/lib/types/attributes.d.ts +94 -39
- package/lib/types/index.d.ts +27 -27
- package/lib/types/permitted-structres.d.ts +22 -28
- 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 -1
- package/lib/utils/get-ns.js +3 -0
- package/lib/utils/merge-array.d.ts +1 -1
- package/lib/utils/resolve-namespace.d.ts +4 -4
- package/lib/utils/resolve-namespace.js +18 -13
- package/package.json +7 -7
- package/schema.json +6 -6
- package/schemas/aria.schema.json +1 -1
- package/schemas/content-models.schema.json +33 -49
- package/src/dom-traverse/accname-computation.spec.ts +6 -6
- 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/get-computed-role.spec.ts +1 -1
- package/src/dom-traverse/get-computed-role.ts +13 -25
- package/src/dom-traverse/get-content-model.ts +32 -0
- package/src/dom-traverse/get-explicit-role.ts +1 -1
- package/src/dom-traverse/get-spec.ts +3 -3
- package/src/dom-traverse/has-required-owned-elements.ts +13 -0
- package/src/dom-traverse/is-exposed.spec.ts +50 -0
- package/src/dom-traverse/is-exposed.ts +196 -0
- package/src/dom-traverse/may-be-focusable.ts +21 -0
- package/src/index.ts +8 -1
- package/src/specs/content-model-category-to-tag-names.ts +3 -3
- package/src/specs/get-aria.ts +3 -3
- package/src/specs/get-selectors-by-content-model-category.ts +1 -1
- package/src/specs/get-spec-by-tag-name.spec.ts +10 -10
- package/src/specs/get-spec-by-tag-name.ts +9 -5
- package/src/specs/is-nothing-content-model.ts +9 -0
- package/src/specs/is-palpable-elements.ts +55 -0
- package/src/specs/is-void-element.ts +22 -0
- package/src/specs/schema-to-spec.ts +1 -1
- package/src/types/aria.ts +7 -1
- package/src/types/attributes.ts +227 -121
- package/src/types/index.ts +8 -8
- package/src/types/permitted-structres.ts +24 -32
- package/src/types/permitted-structures.ts +96 -0
- package/src/utils/get-ns.ts +6 -1
- package/src/utils/resolve-namespace.spec.ts +37 -0
- package/src/utils/resolve-namespace.ts +22 -18
- package/tsconfig.tsbuildinfo +1 -1
- 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/utils.d.ts +0 -8
- package/lib/utils.js +0 -50
package/lib/utils.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
declare type NamedDefinition =
|
|
2
|
-
| string
|
|
3
|
-
| {
|
|
4
|
-
name: string;
|
|
5
|
-
};
|
|
6
|
-
export declare function getNS(namespaceURI: string | null): 'svg' | 'mml' | 'html';
|
|
7
|
-
export declare function mergeArray<T extends NamedDefinition>(a: T[], b: T[] | null | undefined): T[];
|
|
8
|
-
export {};
|
package/lib/utils.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mergeArray = exports.getNS = void 0;
|
|
4
|
-
function getNS(namespaceURI) {
|
|
5
|
-
switch (namespaceURI) {
|
|
6
|
-
case 'http://www.w3.org/2000/svg': {
|
|
7
|
-
return 'svg';
|
|
8
|
-
}
|
|
9
|
-
case 'http://www.w3.org/1998/Math/MathML': {
|
|
10
|
-
return 'mml';
|
|
11
|
-
}
|
|
12
|
-
default: {
|
|
13
|
-
return 'html';
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.getNS = getNS;
|
|
18
|
-
function mergeArray(a, b) {
|
|
19
|
-
if (!b) {
|
|
20
|
-
return a;
|
|
21
|
-
}
|
|
22
|
-
const result = a.slice();
|
|
23
|
-
for (const bItem of b) {
|
|
24
|
-
const bName = getName(bItem);
|
|
25
|
-
const aIndex = result.findIndex(item => getName(item) === bName);
|
|
26
|
-
if (aIndex === -1) {
|
|
27
|
-
result.push(bItem);
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
const aItem = result.splice(aIndex, 1)[0];
|
|
31
|
-
if (typeof bItem === 'string') {
|
|
32
|
-
continue;
|
|
33
|
-
}
|
|
34
|
-
if (typeof aItem === 'string') {
|
|
35
|
-
result.push(bItem);
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
38
|
-
const exItem = {
|
|
39
|
-
...aItem,
|
|
40
|
-
...bItem,
|
|
41
|
-
};
|
|
42
|
-
result.push(exItem);
|
|
43
|
-
}
|
|
44
|
-
return result;
|
|
45
|
-
}
|
|
46
|
-
exports.mergeArray = mergeArray;
|
|
47
|
-
function getName(def) {
|
|
48
|
-
const result = typeof def === 'string' ? def : def.name;
|
|
49
|
-
return result.toLowerCase().trim();
|
|
50
|
-
}
|