@markuplint/ml-spec 4.0.0-dev.28 → 4.0.0-rc.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/LICENSE
CHANGED
|
@@ -5,7 +5,7 @@ export function getExplicitRole(specs,
|
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
6
6
|
el, version) {
|
|
7
7
|
const roleValue = el.getAttribute('role');
|
|
8
|
-
const roleNames = roleValue?.toLowerCase().trim().split(/\s+/
|
|
8
|
+
const roleNames = roleValue?.toLowerCase().trim().split(/\s+/) ?? [];
|
|
9
9
|
const permittedRoles = getPermittedRoles(el, version, specs);
|
|
10
10
|
const { namespaceURI } = resolveNamespace(el.localName, el.namespaceURI);
|
|
11
11
|
let error = 'NO_EXPLICIT';
|
|
@@ -188,7 +188,7 @@ el) {
|
|
|
188
188
|
return false;
|
|
189
189
|
}
|
|
190
190
|
// TODO: Improve accuracy
|
|
191
|
-
return /display\s*:\s*none|visibility\s*:\s*hidden/
|
|
191
|
+
return /display\s*:\s*none|visibility\s*:\s*hidden/i.test(style);
|
|
192
192
|
}
|
|
193
193
|
function isExposedElement(
|
|
194
194
|
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
@@ -7,7 +7,7 @@ ownedEl, specs, version) {
|
|
|
7
7
|
function matchesCondition(condition,
|
|
8
8
|
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
9
9
|
parentEl, specs, version) {
|
|
10
|
-
const conditions = condition.split(/\s+>\s+/
|
|
10
|
+
const conditions = condition.split(/\s+>\s+/).reverse();
|
|
11
11
|
while (conditions.length > 0) {
|
|
12
12
|
if (!parentEl) {
|
|
13
13
|
return false;
|
|
@@ -16,8 +16,6 @@ const voidElements = new Set([
|
|
|
16
16
|
'track',
|
|
17
17
|
'wbr',
|
|
18
18
|
]);
|
|
19
|
-
export function isVoidElement(
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
21
|
-
el) {
|
|
19
|
+
export function isVoidElement(el) {
|
|
22
20
|
return voidElements.has(el.localName);
|
|
23
21
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/ml-spec",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-rc.1",
|
|
4
4
|
"description": "Types and schema that specs of the Markup languages for markuplint",
|
|
5
5
|
"repository": "git@github.com:markuplint/markuplint.git",
|
|
6
6
|
"author": "Yusuke Hirao <yusukehirao@me.com>",
|
|
@@ -23,22 +23,24 @@
|
|
|
23
23
|
"build": "tsc",
|
|
24
24
|
"dev": "tsc --build --watch",
|
|
25
25
|
"clean": "tsc --build --clean",
|
|
26
|
-
"schema
|
|
27
|
-
"schema:
|
|
28
|
-
"schema:
|
|
29
|
-
"schema:
|
|
30
|
-
"schema": "
|
|
26
|
+
"schema": "run-s schema:json schema:content-models schema:attributes schema:aria schema:prettier schema:eslint schema:prettier",
|
|
27
|
+
"schema:json": "node --loader ts-node/esm ./gen/gen.ts",
|
|
28
|
+
"schema:content-models": "json2ts ./schemas/content-models.schema.json > ./src/types/permitted-structures.ts",
|
|
29
|
+
"schema:attributes": "json2ts ./schemas/attributes.schema.json --cwd ./schemas > ./src/types/attributes.ts",
|
|
30
|
+
"schema:aria": "json2ts ./schemas/aria.schema.json --cwd ./schemas > ./src/types/aria.ts",
|
|
31
|
+
"schema:eslint": "eslint --fix --config ../../../.eslintrc \"./src/types/*.ts\"",
|
|
32
|
+
"schema:prettier": "prettier --write \"./schemas/*.json\" \"./src/types/*.ts\" --log-level warn"
|
|
31
33
|
},
|
|
32
34
|
"dependencies": {
|
|
33
|
-
"@markuplint/ml-ast": "4.0.0-
|
|
34
|
-
"@markuplint/types": "4.0.0-
|
|
35
|
+
"@markuplint/ml-ast": "4.0.0-rc.1",
|
|
36
|
+
"@markuplint/types": "4.0.0-rc.1",
|
|
35
37
|
"dom-accessibility-api": "^0.6.3",
|
|
36
38
|
"is-plain-object": "^5.0.0",
|
|
37
|
-
"type-fest": "^4.
|
|
39
|
+
"type-fest": "^4.10.2"
|
|
38
40
|
},
|
|
39
41
|
"devDependencies": {
|
|
40
|
-
"@markuplint/test-tools": "4.0.0-
|
|
41
|
-
"json-schema-to-typescript": "13.1.
|
|
42
|
+
"@markuplint/test-tools": "4.0.0-rc.1",
|
|
43
|
+
"json-schema-to-typescript": "13.1.2"
|
|
42
44
|
},
|
|
43
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "3a9dbbf4c3c05de66d402802919ee94a46a5eb67"
|
|
44
46
|
}
|