@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.
Files changed (138) hide show
  1. package/README.md +8 -3
  2. package/lib/constant/aria-version.d.ts +2 -0
  3. package/lib/constant/aria-version.js +5 -0
  4. package/lib/dom-traverse/accname-computation.js +3 -1
  5. package/lib/dom-traverse/get-attr-specs.d.ts +1 -1
  6. package/lib/dom-traverse/get-attr-specs.js +3 -1
  7. package/lib/dom-traverse/get-computed-aria-props.d.ts +12 -0
  8. package/lib/dom-traverse/get-computed-aria-props.js +108 -0
  9. package/lib/dom-traverse/get-computed-role.d.ts +6 -1
  10. package/lib/dom-traverse/get-computed-role.js +54 -35
  11. package/lib/dom-traverse/get-content-model.d.ts +29 -0
  12. package/lib/dom-traverse/get-content-model.js +30 -0
  13. package/lib/dom-traverse/get-explicit-role.js +9 -4
  14. package/lib/dom-traverse/get-implicit-role.d.ts +6 -2
  15. package/lib/dom-traverse/get-implicit-role.js +6 -2
  16. package/lib/dom-traverse/get-non-presentational-ancestor.d.ts +10 -4
  17. package/lib/dom-traverse/get-non-presentational-ancestor.js +10 -2
  18. package/lib/dom-traverse/get-permitted-roles.d.ts +7 -3
  19. package/lib/dom-traverse/get-permitted-roles.js +3 -1
  20. package/lib/dom-traverse/get-spec.d.ts +5 -2
  21. package/lib/dom-traverse/get-spec.js +4 -2
  22. package/lib/dom-traverse/has-required-owned-elements.d.ts +8 -2
  23. package/lib/dom-traverse/has-required-owned-elements.js +26 -8
  24. package/lib/dom-traverse/is-exposed.d.ts +11 -0
  25. package/lib/dom-traverse/is-exposed.js +217 -0
  26. package/lib/dom-traverse/matches-context-role.d.ts +7 -0
  27. package/lib/dom-traverse/matches-context-role.js +27 -0
  28. package/lib/dom-traverse/may-be-focusable.d.ts +2 -0
  29. package/lib/dom-traverse/may-be-focusable.js +24 -0
  30. package/lib/index.d.ts +11 -1
  31. package/lib/index.js +11 -1
  32. package/lib/specs/aria-specs.d.ts +7 -4
  33. package/lib/specs/content-model-category-to-tag-names.d.ts +5 -2
  34. package/lib/specs/content-model-category-to-tag-names.js +2 -2
  35. package/lib/specs/get-aria.d.ts +8 -1
  36. package/lib/specs/get-aria.js +11 -5
  37. package/lib/specs/get-attr-specs.d.ts +7 -3
  38. package/lib/specs/get-attr-specs.js +2 -14
  39. package/lib/specs/get-implicit-role.d.ts +7 -1
  40. package/lib/specs/get-permitted-roles.d.ts +9 -3
  41. package/lib/specs/get-permitted-roles.js +19 -15
  42. package/lib/specs/get-role-spec.d.ts +10 -3
  43. package/lib/specs/get-role-spec.js +2 -2
  44. package/lib/specs/get-selectors-by-content-model-category.d.ts +2 -2
  45. package/lib/specs/get-selectors-by-content-model-category.js +1 -1
  46. package/lib/specs/get-spec-by-tag-name.d.ts +6 -2
  47. package/lib/specs/get-spec-by-tag-name.js +3 -2
  48. package/lib/specs/is-nothing-content-model.d.ts +5 -0
  49. package/lib/specs/is-nothing-content-model.js +14 -0
  50. package/lib/specs/is-palpable-elements.d.ts +9 -0
  51. package/lib/specs/is-palpable-elements.js +49 -0
  52. package/lib/specs/is-void-element.d.ts +1 -0
  53. package/lib/specs/is-void-element.js +27 -0
  54. package/lib/specs/resolve-version.d.ts +5 -1
  55. package/lib/specs/resolve-version.js +1 -1
  56. package/lib/specs/schema-to-spec.d.ts +4 -4
  57. package/lib/specs/schema-to-spec.js +29 -18
  58. package/lib/types/aria.d.ts +150 -109
  59. package/lib/types/attributes.d.ts +1507 -73
  60. package/lib/types/index.d.ts +195 -166
  61. package/{src/types/permitted-structres.ts → lib/types/permitted-structures.d.ts} +24 -35
  62. package/lib/utils/get-ns.d.ts +2 -1
  63. package/lib/utils/get-ns.js +3 -0
  64. package/lib/utils/merge-array.d.ts +9 -4
  65. package/lib/utils/resolve-namespace.d.ts +7 -7
  66. package/lib/utils/resolve-namespace.js +19 -13
  67. package/lib/utils/validateAriaVersion.d.ts +2 -0
  68. package/lib/utils/validateAriaVersion.js +8 -0
  69. package/package.json +13 -8
  70. package/schema.json +6 -6
  71. package/{src/dom-traverse/accname-computation.spec.ts → test/dom-traverse/accname-computation.spec.js} +8 -8
  72. package/test/dom-traverse/get-computed-aria-props.spec.js +758 -0
  73. package/test/dom-traverse/get-computed-role.spec.js +294 -0
  74. package/test/dom-traverse/get-implicit-role.spec.js +40 -0
  75. package/{src/dom-traverse/has-required-owned-elements.spec.ts → test/dom-traverse/has-required-owned-elements.spec.js} +7 -9
  76. package/test/dom-traverse/is-exposed.spec.js +70 -0
  77. package/test/dom-traverse/matches-context-role.spec.js +60 -0
  78. package/{src/specs/get-attr-specs.spec.ts → test/specs/get-attr-specs.spec.js} +2 -8
  79. package/{src/specs/get-implicit-role.spec.ts → test/specs/get-implicit-role.spec.js} +9 -11
  80. package/{src/specs/get-permitted-roles.spec.ts → test/specs/get-permitted-roles.spec.js} +8 -10
  81. package/{src/specs/get-role-spec.spec.ts → test/specs/get-role-spec.spec.js} +4 -4
  82. package/{src/specs/get-spec-by-tag-name.spec.ts → test/specs/get-spec-by-tag-name.spec.js} +11 -11
  83. package/test/specs/resolve-version.spec.js +34 -0
  84. package/test/specs/schema-to-spec.spec.js +61 -0
  85. package/test/utils/resolve-namespace.spec.js +37 -0
  86. package/lib/dom-traverse/focusability-computation.d.ts +0 -1
  87. package/lib/dom-traverse/focusability-computation.js +0 -8
  88. package/lib/dom-traverse/get-aria.d.ts +0 -9
  89. package/lib/dom-traverse/get-aria.js +0 -54
  90. package/lib/specs/aria-spec.d.ts +0 -5
  91. package/lib/specs/aria-spec.js +0 -12
  92. package/lib/specs/get-spec.d.ts +0 -13
  93. package/lib/specs/get-spec.js +0 -85
  94. package/lib/specs/html-spec.d.ts +0 -6
  95. package/lib/specs/html-spec.js +0 -16
  96. package/lib/specs/resolve-namespace.d.ts +0 -9
  97. package/lib/specs/resolve-namespace.js +0 -26
  98. package/lib/types/permitted-structres.d.ts +0 -64
  99. package/lib/utils.d.ts +0 -8
  100. package/lib/utils.js +0 -50
  101. package/schemas/aria.schema.json +0 -258
  102. package/schemas/attributes.schema.json +0 -204
  103. package/schemas/content-models.schema.json +0 -215
  104. package/schemas/element.schema.json +0 -11
  105. package/schemas/global-attributes.schema.json +0 -761
  106. package/src/dom-traverse/accname-computation.ts +0 -5
  107. package/src/dom-traverse/get-attr-specs.ts +0 -8
  108. package/src/dom-traverse/get-computed-role.spec.ts +0 -134
  109. package/src/dom-traverse/get-computed-role.ts +0 -193
  110. package/src/dom-traverse/get-explicit-role.ts +0 -112
  111. package/src/dom-traverse/get-implicit-role.ts +0 -36
  112. package/src/dom-traverse/get-non-presentational-ancestor.ts +0 -20
  113. package/src/dom-traverse/get-permitted-roles.ts +0 -7
  114. package/src/dom-traverse/get-spec.ts +0 -7
  115. package/src/dom-traverse/has-required-owned-elements.ts +0 -72
  116. package/src/index.ts +0 -17
  117. package/src/specs/aria-specs.ts +0 -6
  118. package/src/specs/content-model-category-to-tag-names.ts +0 -15
  119. package/src/specs/get-aria.ts +0 -85
  120. package/src/specs/get-attr-specs.ts +0 -116
  121. package/src/specs/get-implicit-role.ts +0 -17
  122. package/src/specs/get-permitted-roles.ts +0 -87
  123. package/src/specs/get-role-spec.ts +0 -72
  124. package/src/specs/get-selectors-by-content-model-category.ts +0 -10
  125. package/src/specs/get-spec-by-tag-name.ts +0 -16
  126. package/src/specs/is-presentational.ts +0 -6
  127. package/src/specs/resolve-version.ts +0 -20
  128. package/src/specs/schema-to-spec.spec.ts +0 -39
  129. package/src/specs/schema-to-spec.ts +0 -103
  130. package/src/types/aria.ts +0 -147
  131. package/src/types/attributes.ts +0 -1418
  132. package/src/types/index.ts +0 -255
  133. package/src/utils/get-ns.ts +0 -13
  134. package/src/utils/merge-array.ts +0 -35
  135. package/src/utils/resolve-namespace.ts +0 -36
  136. package/tsconfig.test.json +0 -3
  137. package/tsconfig.tsbuildinfo +0 -1
  138. /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
- const { localNameWithNS } = (0, resolve_namespace_1.resolveNamespace)(localName, namespace || undefined);
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.specs.find(spec => spec.name === localNameWithNS) || null;
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,5 @@
1
+ /**
2
+ * @see https://html.spec.whatwg.org/multipage/dom.html#the-nothing-content-model
3
+ * @see https://html.spec.whatwg.org/multipage/indices.html#elements-3
4
+ */
5
+ export declare function isNothingContentModel(el: Element): boolean;
@@ -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,9 @@
1
+ import type { MLMLSpec } from '../types';
2
+ export declare function isPalpableElement(
3
+ el: Element,
4
+ specs: MLMLSpec,
5
+ options?: {
6
+ readonly extendsSvg?: boolean;
7
+ readonly extendsExposableElements?: boolean;
8
+ },
9
+ ): boolean;
@@ -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
- export declare function resolveVersion(aria: ARIA, version: ARIAVersion): Omit<ARIA, ARIAVersion>;
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.2' ? (_k = (_j = aria[version]) === null || _j === void 0 ? void 0 : _j.namingProhibited) !== null && _k !== void 0 ? _k : aria.namingProhibited : aria.namingProhibited;
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: ["@markuplint/vue-spec"] }` in cofigure files.
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
- cites: import("../types").Cites;
11
- def: import("../types").SpecDefs;
12
- specs: ElementSpec[];
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: ["@markuplint/vue-spec"] }` in cofigure files.
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
- result.def['#globalAttrs']['#HTMLGlobalAttrs'] = {
23
- ...(((_b = result.def['#globalAttrs']) === null || _b === void 0 ? void 0 : _b['#HTMLGlobalAttrs']) || {}),
24
- ...(((_c = extendedSpec.def['#globalAttrs']) === null || _c === void 0 ? void 0 : _c['#extends']) || {}),
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
- result.def['#aria'] = {
31
+ def['#aria'] = {
29
32
  '1.1': {
30
- roles: (0, merge_array_1.mergeArray)(result.def['#aria']['1.1'].roles, extendedSpec.def['#aria']['1.1'].roles),
31
- props: (0, merge_array_1.mergeArray)(result.def['#aria']['1.1'].props, extendedSpec.def['#aria']['1.1'].props),
32
- graphicsRoles: (0, merge_array_1.mergeArray)(result.def['#aria']['1.1'].graphicsRoles, extendedSpec.def['#aria']['1.1'].graphicsRoles),
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)(result.def['#aria']['1.2'].roles, extendedSpec.def['#aria']['1.2'].roles),
36
- props: (0, merge_array_1.mergeArray)(result.def['#aria']['1.2'].props, extendedSpec.def['#aria']['1.2'].props),
37
- graphicsRoles: (0, merge_array_1.mergeArray)(result.def['#aria']['1.2'].graphicsRoles, extendedSpec.def['#aria']['1.2'].graphicsRoles),
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(result.def['#contentModels']),
52
+ ...Object.keys(def['#contentModels']),
44
53
  ...Object.keys(extendedSpec.def['#contentModels']),
45
54
  ]);
46
55
  for (const modelName of keys) {
47
- const mainModel = result.def['#contentModels'][modelName];
56
+ const mainModel = def['#contentModels'][modelName];
48
57
  const exModel = extendedSpec.def['#contentModels'][modelName];
49
- result.def['#contentModels'][modelName] = [...(mainModel || []), ...(exModel || [])];
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;
@@ -6,125 +6,166 @@
6
6
  /**
7
7
  * If `false`, this mean is "No corresponding role".
8
8
  */
9
- export declare type ImplicitRole = false | string;
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 declare type PermittedRoles = boolean | (string | {
14
- name: string;
15
- deprecated?: true;
16
- [k: string]: unknown;
17
- })[] | {
18
- 'core-aam'?: true;
19
- 'graphics-aam'?: true;
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 declare type PermittedARIAProperties = false | {
26
- global?: true;
27
- /**
28
- * Set true if the spec says "and any aria-* attributes applicable to the allowed roles."
29
- */
30
- role?: true | string | [string, ...string[]];
31
- only?: [
32
- (string | {
33
- name: string;
34
- value?: string;
35
- }),
36
- ...(string | {
37
- name: string;
38
- value?: string;
39
- })[]
40
- ];
41
- whithout?: [
42
- {
43
- type: 'not-recommended' | 'should-not' | 'must-not';
44
- name: string;
45
- value?: string;
46
- alt?: {
47
- method: 'remove-attr' | 'set-attr';
48
- target: string;
49
- };
50
- },
51
- ...{
52
- type: 'not-recommended' | 'should-not' | 'must-not';
53
- name: string;
54
- value?: string;
55
- alt?: {
56
- method: 'remove-attr' | 'set-attr';
57
- target: string;
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
- _?: ARIA;
64
- [k: string]: unknown;
80
+ _?: ARIA;
81
+ [k: string]: unknown;
65
82
  }
66
83
  export interface ARIA {
67
- implicitRole: ImplicitRole;
68
- permittedRoles: PermittedRoles;
69
- namingProhibited?: true;
70
- implicitProperties?: ImplicitProperties;
71
- properties?: PermittedARIAProperties;
72
- conditions?: {
73
- /**
74
- * This interface was referenced by `undefined`'s JSON-Schema definition
75
- * via the `patternProperty` ".+".
76
- */
77
- [k: string]: {
78
- implicitRole?: ImplicitRole;
79
- permittedRoles?: PermittedRoles;
80
- namingProhibited?: true;
81
- implicitProperties?: ImplicitProperties;
82
- properties?: PermittedARIAProperties;
83
- };
84
- };
85
- '1.2'?: {
86
- implicitRole?: ImplicitRole;
87
- permittedRoles?: PermittedRoles;
88
- namingProhibited?: true;
89
- implicitProperties?: ImplicitProperties;
90
- properties?: PermittedARIAProperties;
91
- conditions?: {
92
- /**
93
- * This interface was referenced by `undefined`'s JSON-Schema definition
94
- * via the `patternProperty` ".+".
95
- */
96
- [k: string]: {
97
- implicitRole?: ImplicitRole;
98
- permittedRoles?: PermittedRoles;
99
- namingProhibited?: true;
100
- implicitProperties?: ImplicitProperties;
101
- properties?: PermittedARIAProperties;
102
- };
103
- };
104
- };
105
- '1.1'?: {
106
- implicitRole?: ImplicitRole;
107
- permittedRoles?: PermittedRoles;
108
- implicitProperties?: ImplicitProperties;
109
- properties?: PermittedARIAProperties;
110
- conditions?: {
111
- /**
112
- * This interface was referenced by `undefined`'s JSON-Schema definition
113
- * via the `patternProperty` ".+".
114
- */
115
- [k: string]: {
116
- implicitRole?: ImplicitRole;
117
- permittedRoles?: PermittedRoles;
118
- implicitProperties?: ImplicitProperties;
119
- properties?: PermittedARIAProperties;
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
- * This interface was referenced by `ImplicitProperties`'s JSON-Schema definition
127
- * via the `patternProperty` "^aria-.+".
128
- */
129
- [k: string]: string;
166
+ /**
167
+ * This interface was referenced by `ImplicitProperties`'s JSON-Schema definition
168
+ * via the `patternProperty` "^aria-.+".
169
+ */
170
+ [k: string]: string;
130
171
  }