@markuplint/react-spec 5.0.0-alpha.0 → 5.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.
@@ -8,9 +8,13 @@
8
8
 
9
9
  ## ExtendedSpec の内容
10
10
 
11
- ### `useIDLAttributeNames`
11
+ ### `acceptedAttrNames`
12
12
 
13
- この spec は `useIDLAttributeNames: true` を設定しており、`@markuplint/ml-core` の `MLAttr` コンストラクタに IDL 属性名を HTML コンテンツ属性名に解決するよう指示します(例: `className` -> `class`、`htmlFor` -> `for`)。この解決はパーサーではなくコアレベルで行われます。
13
+ この spec は `acceptedAttrNames: 'idl'` を設定しており、`@markuplint/ml-core` の `MLAttr` コンストラクタに IDL 属性名を HTML コンテンツ属性名に解決するよう指示します(例: `className` -> `class`、`htmlFor` -> `for`)。`'idl'` モードでは IDL 名のみが受け入れられ、コンテンツ属性名を使うと候補として IDL 名が提示されます。この解決はパーサーではなくコアレベルで行われます。
14
+
15
+ ### `contenteditable` オーバーライド
16
+
17
+ React は `contentEditable` 属性の値として `"inherit"` を受け付けます(ContentEditable インターフェースの IDL 状態値)。この仕様はグローバル属性 `contenteditable` の型を拡張し、`"inherit"` を有効な列挙値として追加します。
14
18
 
15
19
  ### グローバル属性
16
20
 
package/ARCHITECTURE.md CHANGED
@@ -8,21 +8,22 @@ This package contains no parsing logic -- it is purely a data definition consume
8
8
 
9
9
  ## ExtendedSpec Content
10
10
 
11
- ### `useIDLAttributeNames`
11
+ ### `acceptedAttrNames`
12
12
 
13
- The spec sets `useIDLAttributeNames: true`, which instructs `@markuplint/ml-core`'s `MLAttr` constructor to resolve IDL attribute names to their HTML content attribute equivalents (e.g., `className` -> `class`, `htmlFor` -> `for`). This resolution is performed at the core level, not in the parser.
13
+ The spec sets `acceptedAttrNames: 'idl'`, which instructs `@markuplint/ml-core`'s `MLAttr` constructor to resolve IDL attribute names to their HTML content attribute equivalents (e.g., `className` -> `class`, `htmlFor` -> `for`) and to suggest IDL names as candidates when content attribute names are used (e.g., `tabindex` -> "Did you mean `tabIndex`?"). This resolution is performed at the core level, not in the parser.
14
14
 
15
15
  ### Global Attributes
16
16
 
17
17
  Global attributes are defined under `def['#globalAttrs']['#extends']` and are available on every JSX element:
18
18
 
19
- | Attribute | Type | Description |
20
- | -------------------------------- | --------- | ------------------------------------------------------------------------- |
21
- | `key` | `Any` | Special attribute for list rendering to help React identify changed items |
22
- | `ref` | `Any` | Attribute for accessing child component instances and DOM elements |
23
- | `dangerouslySetInnerHTML` | `Any` | React's replacement for using `innerHTML` in the browser DOM |
24
- | `suppressContentEditableWarning` | `Boolean` | Suppresses the warning when an element with children is `contentEditable` |
25
- | `suppressHydrationWarning` | `Boolean` | Suppresses React hydration mismatch warnings for attributes and content |
19
+ | Attribute | Type | Description |
20
+ | -------------------------------- | ----------------- | ------------------------------------------------------------------------- |
21
+ | `key` | `Any` | Special attribute for list rendering to help React identify changed items |
22
+ | `ref` | `Any` | Attribute for accessing child component instances and DOM elements |
23
+ | `dangerouslySetInnerHTML` | `Any` | React's replacement for using `innerHTML` in the browser DOM |
24
+ | `suppressContentEditableWarning` | `Boolean` | Suppresses the warning when an element with children is `contentEditable` |
25
+ | `suppressHydrationWarning` | `Boolean` | Suppresses React hydration mismatch warnings for attributes and content |
26
+ | `contenteditable` | `Enum` (extended) | Overrides the HTML spec to accept `"inherit"` as a valid IDL state value |
26
27
 
27
28
  ### Element-Specific Overrides
28
29
 
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [5.0.0-alpha.1](https://github.com/markuplint/markuplint/compare/v5.0.0-alpha.0...v5.0.0-alpha.1) (2026-02-22)
7
+
8
+ ### Features
9
+
10
+ - **react-spec:** use acceptedAttrNames and add contenteditable override ([62656e5](https://github.com/markuplint/markuplint/commit/62656e56771d88cf79976750bf261b4d217ca464))
11
+
6
12
  # [5.0.0-alpha.0](https://github.com/markuplint/markuplint/compare/v4.14.1...v5.0.0-alpha.0) (2026-02-20)
7
13
 
8
14
  ### Features
package/lib/index.js CHANGED
@@ -17,7 +17,7 @@
17
17
  * `defaultValue`, `value`).
18
18
  */
19
19
  const spec = {
20
- useIDLAttributeNames: true,
20
+ acceptedAttrNames: 'idl',
21
21
  def: {
22
22
  '#globalAttrs': {
23
23
  '#extends': {
@@ -35,14 +35,14 @@ const spec = {
35
35
  type: 'Any',
36
36
  },
37
37
  /**
38
- * Reacts replacement for using innerHTML in the browser DOM
38
+ * React's replacement for using innerHTML in the browser DOM
39
39
  */
40
40
  dangerouslySetInnerHTML: {
41
41
  type: 'Any',
42
42
  },
43
43
  /**
44
44
  * Normally, there is a warning when an element with children
45
- * is also marked as contentEditable, because it wont work.
45
+ * is also marked as contentEditable, because it won't work.
46
46
  * This attribute suppresses that warning.
47
47
  */
48
48
  suppressContentEditableWarning: {
@@ -56,6 +56,19 @@ const spec = {
56
56
  suppressHydrationWarning: {
57
57
  type: 'Boolean',
58
58
  },
59
+ /**
60
+ * React accepts "inherit" as a valid contentEditable value
61
+ * (IDL state value from the ContentEditable interface).
62
+ */
63
+ contenteditable: {
64
+ type: {
65
+ enum: ['', 'true', 'false', 'plaintext-only', 'inherit'],
66
+ disallowToSurroundBySpaces: true,
67
+ invalidValueDefault: 'inherit',
68
+ missingValueDefault: 'inherit',
69
+ sameStates: { true: [''] },
70
+ },
71
+ },
59
72
  },
60
73
  },
61
74
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/react-spec",
3
- "version": "5.0.0-alpha.0",
3
+ "version": "5.0.0-alpha.1",
4
4
  "description": "Extended specification for tags and attributes in React",
5
5
  "repository": "git@github.com:markuplint/markuplint.git",
6
6
  "author": "Yusuke Hirao <yusukehirao@me.com>",
@@ -24,7 +24,7 @@
24
24
  "clean": "tsc --build --clean tsconfig.build.json"
25
25
  },
26
26
  "dependencies": {
27
- "@markuplint/ml-spec": "5.0.0-alpha.0"
27
+ "@markuplint/ml-spec": "5.0.0-alpha.1"
28
28
  },
29
- "gitHead": "13dcfc84ec83d87360c720e253383b60767e1b56"
29
+ "gitHead": "78a295e73a097a1ce09c777c06fa21ab68136387"
30
30
  }