@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.
Files changed (123) hide show
  1. package/lib/dom-traverse/accname-computation.d.ts +1 -0
  2. package/lib/dom-traverse/accname-computation.js +8 -0
  3. package/lib/dom-traverse/get-attr-specs.d.ts +2 -0
  4. package/lib/dom-traverse/get-attr-specs.js +8 -0
  5. package/lib/dom-traverse/get-computed-role.d.ts +2 -0
  6. package/lib/dom-traverse/get-computed-role.js +170 -0
  7. package/lib/dom-traverse/get-content-model.d.ts +3 -0
  8. package/lib/dom-traverse/get-content-model.js +28 -0
  9. package/lib/dom-traverse/get-explicit-role.d.ts +2 -0
  10. package/lib/dom-traverse/get-explicit-role.js +102 -0
  11. package/lib/dom-traverse/get-implicit-role.d.ts +3 -0
  12. package/lib/dom-traverse/get-implicit-role.js +37 -0
  13. package/lib/dom-traverse/get-non-presentational-ancestor.d.ts +5 -0
  14. package/lib/dom-traverse/get-non-presentational-ancestor.js +21 -0
  15. package/lib/dom-traverse/get-permitted-roles.d.ts +5 -0
  16. package/lib/dom-traverse/get-permitted-roles.js +8 -0
  17. package/lib/dom-traverse/get-spec.d.ts +2 -0
  18. package/lib/dom-traverse/get-spec.js +8 -0
  19. package/lib/dom-traverse/has-required-owned-elements.d.ts +3 -0
  20. package/lib/dom-traverse/has-required-owned-elements.js +81 -0
  21. package/lib/dom-traverse/may-be-focusable.d.ts +2 -0
  22. package/lib/dom-traverse/may-be-focusable.js +22 -0
  23. package/lib/index.d.ts +18 -6
  24. package/lib/index.js +18 -6
  25. package/lib/specs/aria-specs.d.ts +6 -0
  26. package/lib/specs/aria-specs.js +8 -0
  27. package/lib/specs/content-model-category-to-tag-names.d.ts +3 -0
  28. package/lib/specs/content-model-category-to-tag-names.js +15 -0
  29. package/lib/specs/get-aria.d.ts +3 -0
  30. package/lib/specs/get-aria.js +71 -0
  31. package/lib/specs/get-attr-specs.d.ts +8 -0
  32. package/lib/{get-attr-specs.js → specs/get-attr-specs.js} +8 -6
  33. package/lib/specs/get-implicit-role.d.ts +2 -0
  34. package/lib/specs/get-implicit-role.js +12 -0
  35. package/lib/specs/get-permitted-roles.d.ts +12 -0
  36. package/lib/specs/get-permitted-roles.js +61 -0
  37. package/lib/specs/get-role-spec.d.ts +5 -0
  38. package/lib/specs/get-role-spec.js +52 -0
  39. package/lib/specs/get-selectors-by-content-model-category.d.ts +3 -0
  40. package/lib/specs/get-selectors-by-content-model-category.js +8 -0
  41. package/lib/specs/get-spec-by-tag-name.d.ts +2 -0
  42. package/lib/specs/get-spec-by-tag-name.js +16 -0
  43. package/lib/specs/is-presentational.d.ts +1 -0
  44. package/lib/specs/is-presentational.js +10 -0
  45. package/lib/specs/resolve-version.d.ts +3 -0
  46. package/lib/specs/resolve-version.js +21 -0
  47. package/lib/specs/schema-to-spec.d.ts +13 -0
  48. package/lib/{get-spec.js → specs/schema-to-spec.js} +19 -11
  49. package/lib/types/aria.d.ts +136 -0
  50. package/lib/{attributes.js → types/aria.js} +0 -0
  51. package/lib/{attributes.d.ts → types/attributes.d.ts} +95 -48
  52. package/lib/{permitted-structres.js → types/attributes.js} +0 -0
  53. package/lib/{types.d.ts → types/index.d.ts} +55 -70
  54. package/lib/{types.js → types/index.js} +0 -0
  55. package/lib/types/permitted-structres.d.ts +58 -0
  56. package/lib/types/permitted-structres.js +8 -0
  57. package/lib/types/permitted-structures.d.ts +54 -0
  58. package/lib/types/permitted-structures.js +8 -0
  59. package/lib/utils/get-ns.d.ts +2 -0
  60. package/lib/{get-ns.js → utils/get-ns.js} +3 -0
  61. package/lib/{utils.d.ts → utils/merge-array.d.ts} +0 -0
  62. package/lib/{utils.js → utils/merge-array.js} +0 -0
  63. package/lib/utils/resolve-namespace.d.ts +9 -0
  64. package/lib/utils/resolve-namespace.js +31 -0
  65. package/package.json +12 -8
  66. package/schema.json +6 -6
  67. package/schemas/aria.schema.json +258 -0
  68. package/schemas/attributes.schema.json +3 -22
  69. package/schemas/content-models.schema.json +200 -0
  70. package/schemas/element.schema.json +11 -0
  71. package/src/dom-traverse/accname-computation.spec.ts +69 -0
  72. package/src/dom-traverse/accname-computation.ts +5 -0
  73. package/src/dom-traverse/get-attr-specs.ts +8 -0
  74. package/src/dom-traverse/get-computed-role.spec.ts +134 -0
  75. package/src/dom-traverse/get-computed-role.ts +181 -0
  76. package/src/dom-traverse/get-content-model.ts +32 -0
  77. package/src/dom-traverse/get-explicit-role.ts +112 -0
  78. package/src/dom-traverse/get-implicit-role.ts +36 -0
  79. package/src/dom-traverse/get-non-presentational-ancestor.ts +20 -0
  80. package/src/dom-traverse/get-permitted-roles.ts +7 -0
  81. package/src/dom-traverse/get-spec.ts +7 -0
  82. package/src/dom-traverse/has-required-owned-elements.spec.ts +36 -0
  83. package/src/dom-traverse/has-required-owned-elements.ts +85 -0
  84. package/src/dom-traverse/may-be-focusable.ts +21 -0
  85. package/src/index.ts +18 -6
  86. package/src/specs/aria-specs.ts +6 -0
  87. package/src/specs/content-model-category-to-tag-names.ts +15 -0
  88. package/src/specs/get-aria.ts +85 -0
  89. package/src/{get-attr-specs.spec.ts → specs/get-attr-specs.spec.ts} +4 -7
  90. package/src/{get-attr-specs.ts → specs/get-attr-specs.ts} +12 -7
  91. package/src/specs/get-implicit-role.spec.ts +81 -0
  92. package/src/specs/get-implicit-role.ts +17 -0
  93. package/src/specs/get-permitted-roles.spec.ts +420 -0
  94. package/src/specs/get-permitted-roles.ts +87 -0
  95. package/src/specs/get-role-spec.spec.ts +67 -0
  96. package/src/specs/get-role-spec.ts +72 -0
  97. package/src/specs/get-selectors-by-content-model-category.ts +10 -0
  98. package/src/specs/get-spec-by-tag-name.spec.ts +68 -0
  99. package/src/specs/get-spec-by-tag-name.ts +20 -0
  100. package/src/specs/is-presentational.ts +6 -0
  101. package/src/specs/resolve-version.ts +20 -0
  102. package/src/{get-spec.spec.ts → specs/schema-to-spec.spec.ts} +2 -2
  103. package/src/{get-spec.ts → specs/schema-to-spec.ts} +23 -9
  104. package/src/types/aria.ts +153 -0
  105. package/src/{attributes.ts → types/attributes.ts} +162 -117
  106. package/src/{types.ts → types/index.ts} +75 -74
  107. package/src/types/permitted-structres.ts +101 -0
  108. package/src/types/permitted-structures.ts +97 -0
  109. package/src/{get-ns.ts → utils/get-ns.ts} +6 -1
  110. package/src/{utils.ts → utils/merge-array.ts} +0 -0
  111. package/src/utils/resolve-namespace.spec.ts +37 -0
  112. package/src/utils/resolve-namespace.ts +40 -0
  113. package/tsconfig.tsbuildinfo +1 -1
  114. package/lib/get-attr-specs.d.ts +0 -7
  115. package/lib/get-ns.d.ts +0 -1
  116. package/lib/get-spec-by-tag-name.d.ts +0 -2
  117. package/lib/get-spec-by-tag-name.js +0 -31
  118. package/lib/get-spec.d.ts +0 -13
  119. package/lib/permitted-structres.d.ts +0 -73
  120. package/schemas/permitted-structures.schema.json +0 -244
  121. package/schemas/wai-aria.schema.json +0 -87
  122. package/src/get-spec-by-tag-name.ts +0 -32
  123. package/src/permitted-structres.ts +0 -118
@@ -0,0 +1,58 @@
1
+ /**
2
+ * This file was automatically generated by json-schema-to-typescript.
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
+ * and run json-schema-to-typescript to regenerate this file.
5
+ */
6
+ export declare type PermittedContentPattern = PermittedContentRequire | PermittedContentOptional | PermittedContentOneOrMore | PermittedContentZeroOrMore | PermittedContentChoice | PermittedContentTransparent;
7
+ export declare type Model = ContentType | ContentType[];
8
+ export declare type ContentType = string | Category;
9
+ export declare type Category = '#text' | '#phrasing' | '#flow' | '#interactive' | '#heading' | '#sectioning' | '#metadata' | '#embedded' | '#palpable' | '#script-supporting' | '#SVGAnimation' | '#SVGBasicShapes' | '#SVGContainer' | '#SVGDescriptive' | '#SVGFilterPrimitive' | '#SVGFont' | '#SVGGradient' | '#SVGGraphics' | '#SVGGraphicsReferencing' | '#SVGLightSource' | '#SVGNeverRendered' | '#SVGNone' | '#SVGPaintServer' | '#SVGRenderable' | '#SVGShape' | '#SVGStructural' | '#SVGStructurallyExternal' | '#SVGTextContent' | '#SVGTextContentChild' | '#SVGOtherXMLNamespace';
10
+ export interface ContentModelsSchema {
11
+ __contentModel?: ContentModel;
12
+ }
13
+ export interface ContentModel {
14
+ contents: PermittedContentPattern[] | boolean;
15
+ descendantOf?: string;
16
+ conditional?: {
17
+ condition: string;
18
+ contents: PermittedContentPattern[] | boolean;
19
+ }[];
20
+ }
21
+ export interface PermittedContentRequire {
22
+ require: Model;
23
+ max?: number;
24
+ min?: number;
25
+ _TODO_?: string;
26
+ }
27
+ export interface PermittedContentOptional {
28
+ optional: Model;
29
+ max?: number;
30
+ _TODO_?: string;
31
+ }
32
+ export interface PermittedContentOneOrMore {
33
+ oneOrMore: Model | PermittedContentPattern[];
34
+ max?: number;
35
+ _TODO_?: string;
36
+ }
37
+ export interface PermittedContentZeroOrMore {
38
+ zeroOrMore: Model | PermittedContentPattern[];
39
+ max?: number;
40
+ _TODO_?: string;
41
+ }
42
+ export interface PermittedContentChoice {
43
+ /**
44
+ * @minItems 2
45
+ * @maxItems 5
46
+ */
47
+ choice: [PermittedContentPattern[], PermittedContentPattern[]] | [PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[]] | [PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[]] | [
48
+ PermittedContentPattern[],
49
+ PermittedContentPattern[],
50
+ PermittedContentPattern[],
51
+ PermittedContentPattern[],
52
+ PermittedContentPattern[]
53
+ ];
54
+ _TODO_?: string;
55
+ }
56
+ export interface PermittedContentTransparent {
57
+ transparent: string;
58
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /**
4
+ * This file was automatically generated by json-schema-to-typescript.
5
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
6
+ * and run json-schema-to-typescript to regenerate this file.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,54 @@
1
+ /**
2
+ * This file was automatically generated by json-schema-to-typescript.
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
+ * and run json-schema-to-typescript to regenerate this file.
5
+ */
6
+ export declare type PermittedContentPattern = PermittedContentRequire | PermittedContentOptional | PermittedContentOneOrMore | PermittedContentZeroOrMore | PermittedContentChoice | PermittedContentTransparent;
7
+ export declare type Model = ContentType | ContentType[];
8
+ export declare type ContentType = string | Category;
9
+ export declare type Category = '#text' | '#phrasing' | '#flow' | '#interactive' | '#heading' | '#sectioning' | '#metadata' | '#embedded' | '#palpable' | '#script-supporting' | '#SVGAnimation' | '#SVGBasicShapes' | '#SVGContainer' | '#SVGDescriptive' | '#SVGFilterPrimitive' | '#SVGFont' | '#SVGGradient' | '#SVGGraphics' | '#SVGGraphicsReferencing' | '#SVGLightSource' | '#SVGNeverRendered' | '#SVGNone' | '#SVGPaintServer' | '#SVGRenderable' | '#SVGShape' | '#SVGStructural' | '#SVGStructurallyExternal' | '#SVGTextContent' | '#SVGTextContentChild' | '#SVGOtherXMLNamespace';
10
+ export interface ContentModelsSchema {
11
+ __contentModel?: ContentModel;
12
+ }
13
+ export interface ContentModel {
14
+ contents: PermittedContentPattern[] | boolean;
15
+ descendantOf?: string;
16
+ conditional?: {
17
+ condition: string;
18
+ contents: PermittedContentPattern[] | boolean;
19
+ }[];
20
+ }
21
+ export interface PermittedContentRequire {
22
+ require: Model;
23
+ max?: number;
24
+ min?: number;
25
+ _TODO_?: string;
26
+ }
27
+ export interface PermittedContentOptional {
28
+ optional: Model;
29
+ max?: number;
30
+ _TODO_?: string;
31
+ }
32
+ export interface PermittedContentOneOrMore {
33
+ oneOrMore: Model | PermittedContentPattern[];
34
+ max?: number;
35
+ _TODO_?: string;
36
+ }
37
+ export interface PermittedContentZeroOrMore {
38
+ zeroOrMore: Model | PermittedContentPattern[];
39
+ max?: number;
40
+ _TODO_?: string;
41
+ }
42
+ export interface PermittedContentChoice {
43
+ choice: [PermittedContentPattern[], PermittedContentPattern[]] | [PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[]] | [PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[]] | [
44
+ PermittedContentPattern[],
45
+ PermittedContentPattern[],
46
+ PermittedContentPattern[],
47
+ PermittedContentPattern[],
48
+ PermittedContentPattern[]
49
+ ];
50
+ _TODO_?: string;
51
+ }
52
+ export interface PermittedContentTransparent {
53
+ transparent: string;
54
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /**
4
+ * This file was automatically generated by json-schema-to-typescript.
5
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
6
+ * and run json-schema-to-typescript to regenerate this file.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ import type { Namespace } from '@markuplint/ml-ast';
2
+ export declare function getNS(namespaceURI: string | null): Namespace;
@@ -9,6 +9,9 @@ function getNS(namespaceURI) {
9
9
  case 'http://www.w3.org/1998/Math/MathML': {
10
10
  return 'mml';
11
11
  }
12
+ case 'http://www.w3.org/1999/xlink': {
13
+ return 'xlink';
14
+ }
12
15
  default: {
13
16
  return 'html';
14
17
  }
File without changes
File without changes
@@ -0,0 +1,9 @@
1
+ import type { NamespaceURI, Namespace } from '@markuplint/ml-ast';
2
+ declare type NamespacedElementName = {
3
+ localNameWithNS: string;
4
+ localName: string;
5
+ namespace: Namespace;
6
+ namespaceURI: NamespaceURI;
7
+ };
8
+ export declare function resolveNamespace(name: string, namespaceURI?: string | null): NamespacedElementName;
9
+ export {};
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveNamespace = void 0;
4
+ const get_ns_1 = require("./get-ns");
5
+ const cache = new Map();
6
+ const namespaceURIMap = {
7
+ html: 'http://www.w3.org/1999/xhtml',
8
+ svg: 'http://www.w3.org/2000/svg',
9
+ mml: 'http://www.w3.org/1998/Math/MathML',
10
+ xlink: 'http://www.w3.org/1999/xlink',
11
+ };
12
+ function resolveNamespace(name, namespaceURI = 'http://www.w3.org/1999/xhtml') {
13
+ const cached = cache.get(name + namespaceURI);
14
+ if (cached) {
15
+ return cached;
16
+ }
17
+ const [_explicitNS, _localName] = name.split(':');
18
+ const explicitNS = _localName ? _explicitNS : null;
19
+ const localName = _localName !== null && _localName !== void 0 ? _localName : _explicitNS;
20
+ const namespace = ['html', 'svg', 'mml', 'xlink'].find(_ns => _ns === (explicitNS || (0, get_ns_1.getNS)(namespaceURI || null))) ||
21
+ 'html';
22
+ const result = {
23
+ localNameWithNS: `${namespace === 'html' ? '' : `${namespace}:`}${localName}`,
24
+ localName,
25
+ namespace,
26
+ namespaceURI: namespaceURIMap[namespace],
27
+ };
28
+ cache.set(name + namespaceURI, result);
29
+ return result;
30
+ }
31
+ exports.resolveNamespace = resolveNamespace;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/ml-spec",
3
- "version": "2.1.1",
3
+ "version": "3.0.0-alpha.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>",
@@ -16,16 +16,20 @@
16
16
  "dev": "tsc --build --watch",
17
17
  "clean": "tsc --build --clean",
18
18
  "schema:gen": "ts-node ./gen/gen.ts; prettier --write './schemas/*.json';",
19
- "schema:structures": "json2ts ./schemas/permitted-structures.schema.json > ./src/permitted-structres.ts; prettier --write ./src/permitted-structres.ts; eslint --fix --config ../../../.eslintrc ./src/permitted-structres.ts",
20
- "schema:attributes": "json2ts ./schemas/attributes.schema.json --cwd ./schemas > ./src/attributes.ts; prettier --write ./src/attributes.ts; eslint --fix --config ../../../.eslintrc ./src/attributes.ts",
21
- "schema": "yarn schema:gen; yarn schema:structures; yarn schema:attributes; tsc;"
19
+ "schema:content-models": "json2ts ./schemas/content-models.schema.json > ./src/types/permitted-structres.ts; prettier --write ./src/types/permitted-structres.ts; eslint --fix --config ../../../.eslintrc ./src/types/permitted-structres.ts",
20
+ "schema:attributes": "json2ts ./schemas/attributes.schema.json --cwd ./schemas > ./src/types/attributes.ts; prettier --write ./src/types/attributes.ts; eslint --fix --config ../../../.eslintrc ./src/types/attributes.ts",
21
+ "schema:aria": "json2ts ./schemas/aria.schema.json --cwd ./schemas > ./src/types/aria.ts; prettier --write ./src/types/aria.ts; eslint --fix --config ../../../.eslintrc ./src/types/aria.ts",
22
+ "schema": "run-s schema:*"
22
23
  },
23
24
  "dependencies": {
24
- "tslib": "^2.3.1"
25
+ "@markuplint/ml-ast": "3.0.0-alpha.1",
26
+ "dom-accessibility-api": "^0.5.14",
27
+ "tslib": "^2.4.0"
25
28
  },
26
29
  "devDependencies": {
27
- "@markuplint/types": "2.2.0",
28
- "json-schema-to-typescript": "^10.1.5"
30
+ "@markuplint/test-tools": "3.0.0-alpha.1",
31
+ "@markuplint/types": "3.0.0-alpha.1",
32
+ "json-schema-to-typescript": "^11.0.2"
29
33
  },
30
- "gitHead": "c28258b756d8c42890698e26c03cdc02c6833489"
34
+ "gitHead": "56de89456146a06777eb5b6d4e8ba456147dd18b"
31
35
  }
package/schema.json CHANGED
@@ -17,7 +17,7 @@
17
17
  ],
18
18
  "type": "string"
19
19
  },
20
- "AttributeCtegory": {
20
+ "AttributeCategory": {
21
21
  "enum": ["aria", "eventhandler", "form", "global", "particular", "xml"],
22
22
  "type": "string"
23
23
  },
@@ -85,7 +85,7 @@
85
85
  "items": {
86
86
  "properties": {
87
87
  "category": {
88
- "$ref": "#/definitions/AttributeCtegory"
88
+ "$ref": "#/definitions/AttributeCategory"
89
89
  },
90
90
  "deprecated": {
91
91
  "enum": [true],
@@ -162,7 +162,7 @@
162
162
  {
163
163
  "properties": {
164
164
  "category": {
165
- "$ref": "#/definitions/AttributeCtegory"
165
+ "$ref": "#/definitions/AttributeCategory"
166
166
  },
167
167
  "deprecated": {
168
168
  "enum": [true],
@@ -211,7 +211,7 @@
211
211
  "type": "array"
212
212
  },
213
213
  "categories": {
214
- "description": "Element cateogries",
214
+ "description": "Element categories",
215
215
  "items": {
216
216
  "anyOf": [
217
217
  {
@@ -294,7 +294,7 @@
294
294
  ],
295
295
  "description": "Obsolete or alternative elements"
296
296
  },
297
- "omittion": {
297
+ "omission": {
298
298
  "anyOf": [
299
299
  {
300
300
  "properties": {
@@ -338,7 +338,7 @@
338
338
  "type": "boolean"
339
339
  }
340
340
  ],
341
- "description": "Tag omittion"
341
+ "description": "Tag omission"
342
342
  },
343
343
  "permittedContent": {
344
344
  "description": "Permitted content",
@@ -0,0 +1,258 @@
1
+ {
2
+ "definitions": {
3
+ "PermittedRoles": {
4
+ "description": "If `true`, this mean is \"Any\". If `false`, this mean is \"No\".",
5
+ "oneOf": [
6
+ {
7
+ "type": "boolean"
8
+ },
9
+ {
10
+ "type": "array",
11
+ "items": {
12
+ "oneOf": [
13
+ {
14
+ "type": "string"
15
+ },
16
+ {
17
+ "type": "object",
18
+ "required": ["name"],
19
+ "minProperties": 2,
20
+ "properties": {
21
+ "name": { "type": "string" },
22
+ "deprecated": { "type": "boolean", "enum": [true] }
23
+ }
24
+ }
25
+ ]
26
+ }
27
+ },
28
+ {
29
+ "type": "object",
30
+ "minProperties": 1,
31
+ "additionalProperties": false,
32
+ "properties": {
33
+ "core-aam": {
34
+ "type": "boolean",
35
+ "enum": [true]
36
+ },
37
+ "graphics-aam": {
38
+ "type": "boolean",
39
+ "enum": [true]
40
+ }
41
+ }
42
+ }
43
+ ]
44
+ },
45
+ "PermittedARIAProperties": {
46
+ "description": "If set false:\n> No role or aria-* attributes",
47
+ "oneOf": [
48
+ {
49
+ "type": "boolean",
50
+ "enum": [false]
51
+ },
52
+ {
53
+ "type": "object",
54
+ "minProperties": 1,
55
+ "additionalProperties": false,
56
+ "properties": {
57
+ "global": {
58
+ "type": "boolean",
59
+ "enum": [true]
60
+ },
61
+ "role": {
62
+ "description": "Set true if the spec says \"and any aria-* attributes applicable to the allowed roles.\"",
63
+ "oneOf": [
64
+ {
65
+ "type": "boolean",
66
+ "enum": [true]
67
+ },
68
+ {
69
+ "type": "string"
70
+ },
71
+ {
72
+ "type": "array",
73
+ "minItems": 1,
74
+ "items": { "type": "string" }
75
+ }
76
+ ]
77
+ },
78
+ "only": {
79
+ "type": "array",
80
+ "minItems": 1,
81
+ "items": {
82
+ "oneOf": [
83
+ {
84
+ "type": "string",
85
+ "pattern": "^aria-.+"
86
+ },
87
+ {
88
+ "type": "object",
89
+ "required": ["name"],
90
+ "additionalProperties": false,
91
+ "properties": {
92
+ "name": {
93
+ "type": "string",
94
+ "pattern": "^aria-.+"
95
+ },
96
+ "value": {
97
+ "type": "string"
98
+ }
99
+ }
100
+ }
101
+ ]
102
+ }
103
+ },
104
+ "without": {
105
+ "type": "array",
106
+ "minItems": 1,
107
+ "items": {
108
+ "type": "object",
109
+ "required": ["type", "name"],
110
+ "additionalProperties": false,
111
+ "properties": {
112
+ "type": {
113
+ "type": "string",
114
+ "enum": ["not-recommended", "should-not", "must-not"]
115
+ },
116
+ "name": {
117
+ "type": "string",
118
+ "pattern": "^aria-.+"
119
+ },
120
+ "value": {
121
+ "type": "string"
122
+ },
123
+ "alt": {
124
+ "type": "object",
125
+ "required": ["method", "target"],
126
+ "additionalProperties": false,
127
+ "properties": {
128
+ "method": {
129
+ "type": "string",
130
+ "enum": ["remove-attr", "set-attr"]
131
+ },
132
+ "target": {
133
+ "type": "string"
134
+ }
135
+ }
136
+ }
137
+ }
138
+ }
139
+ }
140
+ }
141
+ }
142
+ ]
143
+ },
144
+ "ImplicitRole": {
145
+ "description": "If `false`, this mean is \"No corresponding role\".",
146
+ "oneOf": [
147
+ {
148
+ "type": "boolean",
149
+ "enum": [false]
150
+ },
151
+ {
152
+ "type": "string"
153
+ }
154
+ ]
155
+ },
156
+ "ImplicitProperties": {
157
+ "type": "object",
158
+ "minProperties": 1,
159
+ "patternProperties": {
160
+ "^aria-.+": {
161
+ "type": "string"
162
+ }
163
+ }
164
+ },
165
+ "ARIA": {
166
+ "type": "object",
167
+ "additionalProperties": false,
168
+ "required": ["implicitRole", "permittedRoles"],
169
+ "properties": {
170
+ "implicitRole": { "$ref": "#/definitions/ImplicitRole" },
171
+ "permittedRoles": { "$ref": "#/definitions/PermittedRoles" },
172
+ "namingProhibited": { "type": "boolean", "enum": [true] },
173
+ "implicitProperties": { "$ref": "#/definitions/ImplicitProperties" },
174
+ "properties": { "$ref": "#/definitions/PermittedARIAProperties" },
175
+ "conditions": {
176
+ "type": "object",
177
+ "minProperties": 1,
178
+ "patternProperties": {
179
+ ".+": {
180
+ "type": "object",
181
+ "minProperties": 1,
182
+ "additionalProperties": false,
183
+ "properties": {
184
+ "implicitRole": { "$ref": "#/definitions/ImplicitRole" },
185
+ "permittedRoles": { "$ref": "#/definitions/PermittedRoles" },
186
+ "namingProhibited": { "type": "boolean", "enum": [true] },
187
+ "implicitProperties": { "$ref": "#/definitions/ImplicitProperties" },
188
+ "properties": { "$ref": "#/definitions/PermittedARIAProperties" }
189
+ }
190
+ }
191
+ }
192
+ },
193
+ "1.2": {
194
+ "type": "object",
195
+ "additionalProperties": false,
196
+ "minProperties": 1,
197
+ "properties": {
198
+ "implicitRole": { "$ref": "#/definitions/ImplicitRole" },
199
+ "permittedRoles": { "$ref": "#/definitions/PermittedRoles" },
200
+ "namingProhibited": { "type": "boolean", "enum": [true] },
201
+ "implicitProperties": { "$ref": "#/definitions/ImplicitProperties" },
202
+ "properties": { "$ref": "#/definitions/PermittedARIAProperties" },
203
+ "conditions": {
204
+ "type": "object",
205
+ "minProperties": 1,
206
+ "patternProperties": {
207
+ ".+": {
208
+ "type": "object",
209
+ "minProperties": 1,
210
+ "additionalProperties": false,
211
+ "properties": {
212
+ "implicitRole": { "$ref": "#/definitions/ImplicitRole" },
213
+ "permittedRoles": { "$ref": "#/definitions/PermittedRoles" },
214
+ "namingProhibited": { "type": "boolean", "enum": [true] },
215
+ "implicitProperties": { "$ref": "#/definitions/ImplicitProperties" },
216
+ "properties": { "$ref": "#/definitions/PermittedARIAProperties" }
217
+ }
218
+ }
219
+ }
220
+ }
221
+ }
222
+ },
223
+ "1.1": {
224
+ "type": "object",
225
+ "additionalProperties": false,
226
+ "minProperties": 1,
227
+ "properties": {
228
+ "implicitRole": { "$ref": "#/definitions/ImplicitRole" },
229
+ "permittedRoles": { "$ref": "#/definitions/PermittedRoles" },
230
+ "implicitProperties": { "$ref": "#/definitions/ImplicitProperties" },
231
+ "properties": { "$ref": "#/definitions/PermittedARIAProperties" },
232
+ "conditions": {
233
+ "type": "object",
234
+ "minProperties": 1,
235
+ "patternProperties": {
236
+ ".+": {
237
+ "type": "object",
238
+ "minProperties": 1,
239
+ "additionalProperties": false,
240
+ "properties": {
241
+ "implicitRole": { "$ref": "#/definitions/ImplicitRole" },
242
+ "permittedRoles": { "$ref": "#/definitions/PermittedRoles" },
243
+ "implicitProperties": { "$ref": "#/definitions/ImplicitProperties" },
244
+ "properties": { "$ref": "#/definitions/PermittedARIAProperties" }
245
+ }
246
+ }
247
+ }
248
+ }
249
+ }
250
+ }
251
+ }
252
+ }
253
+ },
254
+ "type": "object",
255
+ "properties": {
256
+ "_": { "$ref": "#/definitions/ARIA" }
257
+ }
258
+ }
@@ -1,22 +1,7 @@
1
1
  {
2
2
  "definitions": {
3
3
  "AttributeName": { "type": "string", "pattern": "^(?:(xml|xlink):)?[a-z][a-zA-Z0-9-]*$" },
4
- "AttributeCondition": {
5
- "oneOf": [
6
- {
7
- "type": "object",
8
- "additionalProperties": false,
9
- "required": ["ancestor"],
10
- "properties": { "ancestor": { "$ref": "#/definitions/Selectors" } }
11
- },
12
- {
13
- "type": "object",
14
- "additionalProperties": false,
15
- "required": ["self"],
16
- "properties": { "self": { "$ref": "#/definitions/Selectors" } }
17
- }
18
- ]
19
- },
4
+ "AttributeCondition": { "$ref": "#/definitions/Selectors" },
20
5
  "Selectors": {
21
6
  "oneOf": [{ "type": "string" }, { "type": "array", "minItems": 2, "items": { "type": "string" } }]
22
7
  },
@@ -24,11 +9,8 @@
24
9
  "AttributeJSON": {
25
10
  "type": "object",
26
11
  "additionalProperties": false,
27
- "required": ["ref"],
28
- "minProperties": 2,
12
+ "minProperties": 1,
29
13
  "properties": {
30
- "_TODO_": { "type": "string" },
31
- "ref": { "type": "string", "format": "uri" },
32
14
  "type": {
33
15
  "oneOf": [
34
16
  { "$ref": "#/definitions/AttributeType" },
@@ -213,10 +195,9 @@
213
195
  },
214
196
  "type": "object",
215
197
  "additionalProperties": false,
216
- "required": ["tag", "ref", "attributes"],
198
+ "required": ["tag", "attributes"],
217
199
  "properties": {
218
200
  "tag": { "type": "string" },
219
- "ref": { "type": "string", "format": "uri" },
220
201
  "global": { "$ref": "#/definitions/GlobalAttributes" },
221
202
  "attributes": { "$ref": "#/definitions/Attributes" }
222
203
  }