@markuplint/ml-spec 4.0.2 → 4.1.0

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.
@@ -3,5 +3,9 @@ import { computeAccessibleName } from 'dom-accessibility-api';
3
3
  export function getAccname(
4
4
  // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
5
5
  el) {
6
- return computeAccessibleName(el);
6
+ const name = computeAccessibleName(el);
7
+ if (!name.trim() && el.nodeName === 'INPUT') {
8
+ return el.getAttribute('placeholder')?.trim() ?? '';
9
+ }
10
+ return name;
7
11
  }
@@ -8,6 +8,7 @@ export function getRoleSpec(specs, roleName, namespace, version) {
8
8
  return {
9
9
  name: role.name,
10
10
  isAbstract: !!role.isAbstract,
11
+ deprecated: !!role.deprecated,
11
12
  requiredContextRole: role.requiredContextRole ?? [],
12
13
  requiredOwnedElements: role.requiredOwnedElements ?? [],
13
14
  accessibleNameRequired: !!role.accessibleNameRequired,
@@ -138,6 +138,7 @@ type ExtendableAttributeSpec = Omit<ReadonlyDeep<AttributeJSON>, 'type'>;
138
138
  export type ARIARole = {
139
139
  readonly name: string;
140
140
  readonly isAbstract: boolean;
141
+ readonly deprecated: boolean;
141
142
  readonly requiredContextRole: readonly string[];
142
143
  readonly requiredOwnedElements: readonly string[];
143
144
  readonly accessibleNameRequired: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/ml-spec",
3
- "version": "4.0.2",
3
+ "version": "4.1.0",
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>",
@@ -39,8 +39,8 @@
39
39
  "type-fest": "^4.10.2"
40
40
  },
41
41
  "devDependencies": {
42
- "@markuplint/test-tools": "4.0.2",
42
+ "@markuplint/test-tools": "4.1.0",
43
43
  "json-schema-to-typescript": "13.1.2"
44
44
  },
45
- "gitHead": "10ce6c8374106f311eeaaffbae8f3fdcbb40f877"
45
+ "gitHead": "d5d99c5d84b676f8b2bb84684533ed74cf2f1da6"
46
46
  }