reactive-md 0.5.3 → 0.6.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 (141) hide show
  1. package/CHANGELOG-ch.md +195 -165
  2. package/CHANGELOG.md +195 -165
  3. package/CONTRIBUTING-ch.md +67 -62
  4. package/CONTRIBUTING.md +69 -64
  5. package/README-ch.md +157 -155
  6. package/README-en.md +184 -181
  7. package/README.md +184 -181
  8. package/SECURITY-ch.md +81 -81
  9. package/SECURITY.md +81 -81
  10. package/THIRD_PARTY_NOTICES.md +585 -1
  11. package/bin/reactive-md.mjs +39 -39
  12. package/cli/args.mjs +181 -181
  13. package/cli/assets.mjs +390 -390
  14. package/cli/build.mjs +268 -268
  15. package/cli/document.mjs +130 -130
  16. package/cli/errors.mjs +61 -61
  17. package/cli/fs-utils.mjs +133 -133
  18. package/cli/glob.mjs +203 -203
  19. package/cli/help.mjs +138 -138
  20. package/cli/lint.mjs +177 -177
  21. package/cli/main.mjs +55 -55
  22. package/cli/migrate.mjs +368 -368
  23. package/cli/package.mjs +210 -210
  24. package/dist-library/{authoring-DJJjKYg9.js → authoring-BEVyth5X.js} +58 -58
  25. package/dist-library/compiler-Cm3ppMxG.js +46044 -0
  26. package/dist-library/react-Bh7_oxZp.js +59655 -0
  27. package/dist-library/reactive-md-authoring.js +2 -2
  28. package/dist-library/reactive-md-editor.js +13 -0
  29. package/dist-library/reactive-md-print.css +284 -284
  30. package/dist-library/reactive-md-react-unstyled.js +1 -1
  31. package/dist-library/reactive-md-react.js +1 -1
  32. package/dist-library/reactive-md.css +1 -1
  33. package/dist-library/reactive-md.js +123 -123
  34. package/dist-library/{runtime-DXtle_6c.js → runtime-DlFYQ4s_.js} +151 -151
  35. package/dist-library/types/editor/types.d.ts +2 -0
  36. package/dist-library/types/local/code-block.d.ts +3 -1
  37. package/dist-library/types/local/code-languages.d.ts +7 -0
  38. package/dist-library/types/local/compiled-data.d.ts +6 -0
  39. package/dist-library/types/local/compiler.d.ts +1 -0
  40. package/dist-library/types/local/diagnostics.d.ts +31 -0
  41. package/dist-library/types/local/diagram-layout.d.ts +69 -0
  42. package/dist-library/types/local/html-names.d.ts +6 -0
  43. package/dist-library/types/local/html-table.d.ts +25 -0
  44. package/dist-library/types/local/math-display.d.ts +22 -22
  45. package/dist-library/types/local/math-view.d.ts +6 -7
  46. package/dist-library/types/local/table-surface.d.ts +10 -0
  47. package/dist-library/types/local/types.d.ts +2 -0
  48. package/dist-library/types/local/visuals.d.ts +9 -0
  49. package/dist-standalone/reactive-md-standalone.css +1 -1
  50. package/dist-standalone/reactive-md-standalone.js +331 -51
  51. package/docs/README.md +84 -0
  52. package/docs/{compatibility-ch.md → compatibility/compatibility-ch.md} +121 -109
  53. package/docs/{compatibility-en.md → compatibility/compatibility-en.md} +121 -109
  54. package/docs/{source-versioning-ch.md → compatibility/source-versioning-ch.md} +159 -159
  55. package/docs/{source-versioning-en.md → compatibility/source-versioning-en.md} +159 -159
  56. package/docs/{component-development-ch.md → development/component-development-ch.md} +210 -210
  57. package/docs/{component-development-en.md → development/component-development-en.md} +210 -210
  58. package/docs/{component-protocol-ch.md → development/component-protocol-ch.md} +747 -747
  59. package/docs/{component-protocol-en.md → development/component-protocol-en.md} +747 -747
  60. package/docs/{performance-ch.md → development/performance-ch.md} +76 -76
  61. package/docs/{performance-en.md → development/performance-en.md} +76 -76
  62. package/docs/{releasing-ch.md → development/releasing-ch.md} +108 -108
  63. package/docs/{releasing-en.md → development/releasing-en.md} +108 -108
  64. package/docs/guides/local-guide-ch.md +513 -0
  65. package/docs/guides/local-guide-en.md +513 -0
  66. package/docs/{author-tools-ch.md → integration/author-tools-ch.md} +57 -57
  67. package/docs/{author-tools-en.md → integration/author-tools-en.md} +57 -57
  68. package/docs/{editor-ch.md → integration/editor-ch.md} +7 -6
  69. package/docs/{editor-en.md → integration/editor-en.md} +7 -6
  70. package/docs/{local-integration-ch.md → integration/local-integration-ch.md} +33 -15
  71. package/docs/{local-integration-en.md → integration/local-integration-en.md} +33 -15
  72. package/docs/{shareable-export-ch.md → integration/shareable-export-ch.md} +221 -209
  73. package/docs/{shareable-export-en.md → integration/shareable-export-en.md} +223 -211
  74. package/docs/{computations-formatting-ch.md → reference/computations-formatting-ch.md} +87 -87
  75. package/docs/{computations-formatting-en.md → reference/computations-formatting-en.md} +87 -87
  76. package/docs/{constraints-collections-ch.md → reference/constraints-collections-ch.md} +84 -84
  77. package/docs/{constraints-collections-en.md → reference/constraints-collections-en.md} +84 -84
  78. package/docs/{diagnostics-counting-ch.md → reference/diagnostics-counting-ch.md} +104 -84
  79. package/docs/{diagnostics-counting-en.md → reference/diagnostics-counting-en.md} +104 -84
  80. package/docs/{html-compatibility-ch.md → reference/html-compatibility-ch.md} +42 -4
  81. package/docs/{html-compatibility-en.md → reference/html-compatibility-en.md} +42 -4
  82. package/docs/{local-components-v2-ch.md → reference/local-components-v2-ch.md} +138 -138
  83. package/docs/{local-components-v2-en.md → reference/local-components-v2-en.md} +104 -104
  84. package/docs/{local-interaction-syntax-ch.md → reference/local-interaction-syntax-ch.md} +515 -492
  85. package/docs/{local-interaction-syntax-en.md → reference/local-interaction-syntax-en.md} +511 -488
  86. package/docs/{theme-protocol-ch.md → reference/theme-protocol-ch.md} +107 -107
  87. package/docs/{theme-protocol-en.md → reference/theme-protocol-en.md} +107 -107
  88. package/docs/{release-0.4.0-ch.md → releases/release-0.4.0-ch.md} +89 -89
  89. package/docs/{release-0.4.0-en.md → releases/release-0.4.0-en.md} +89 -89
  90. package/docs/{release-0.4.1-ch.md → releases/release-0.4.1-ch.md} +23 -23
  91. package/docs/{release-0.4.1-en.md → releases/release-0.4.1-en.md} +23 -23
  92. package/docs/{release-0.5.0-ch.md → releases/release-0.5.0-ch.md} +4 -4
  93. package/docs/{release-0.5.0-en.md → releases/release-0.5.0-en.md} +4 -4
  94. package/docs/{release-0.5.1-ch.md → releases/release-0.5.1-ch.md} +4 -4
  95. package/docs/{release-0.5.1-en.md → releases/release-0.5.1-en.md} +4 -4
  96. package/docs/{release-0.5.2-ch.md → releases/release-0.5.2-ch.md} +3 -3
  97. package/docs/{release-0.5.2-en.md → releases/release-0.5.2-en.md} +3 -3
  98. package/docs/{release-0.5.3-ch.md → releases/release-0.5.3-ch.md} +1 -1
  99. package/docs/{release-0.5.3-en.md → releases/release-0.5.3-en.md} +1 -1
  100. package/docs/releases/release-0.6.0-ch.md +57 -0
  101. package/docs/releases/release-0.6.0-en.md +57 -0
  102. package/docs/releases/release-0.6.1-ch.md +27 -0
  103. package/docs/releases/release-0.6.1-en.md +27 -0
  104. package/examples/conformance/README.md +53 -53
  105. package/examples/conformance/component-protocol-1.json +482 -482
  106. package/examples/conformance/component-protocol-1.schema.json +76 -76
  107. package/examples/conformance/local-draft-1.json +50 -50
  108. package/examples/conformance/local-draft-2.json +212 -212
  109. package/examples/integration/README.md +47 -45
  110. package/examples/integration/core/index.mjs +32 -32
  111. package/examples/integration/worker/index.html +19 -19
  112. package/examples/integration/worker/main.js +61 -61
  113. package/examples/integration/worker/package.json +13 -13
  114. package/examples/integration/worker/worker.js +3 -3
  115. package/examples/local/README.md +74 -74
  116. package/examples/local/charts.reactive.md +73 -73
  117. package/examples/local/html-compat.reactive.md +19 -0
  118. package/examples/local/recipes/invoice-zh.reactive.md +36 -36
  119. package/examples/local/recipes/invoice.reactive.md +36 -36
  120. package/examples/local/recipes/workshop-zh.reactive.md +33 -33
  121. package/examples/local/recipes/workshop.reactive.md +33 -33
  122. package/examples/local/showcase/README.md +25 -25
  123. package/examples/local/showcase/explore.reactive.md +102 -102
  124. package/examples/local/showcase/flow.reactive.md +86 -86
  125. package/examples/local/showcase/forms.reactive.md +126 -126
  126. package/examples/local/showcase/functions.reactive.md +119 -119
  127. package/examples/local/showcase/layout.reactive.md +100 -100
  128. package/examples/local/showcase/statistics.reactive.md +108 -108
  129. package/examples/local/showcase/tasks.reactive.md +89 -89
  130. package/examples/local/showcase/zh/explore.reactive.md +102 -102
  131. package/examples/local/showcase/zh/flow.reactive.md +86 -86
  132. package/examples/local/showcase/zh/forms.reactive.md +126 -126
  133. package/examples/local/showcase/zh/functions.reactive.md +119 -119
  134. package/examples/local/showcase/zh/layout.reactive.md +100 -100
  135. package/examples/local/showcase/zh/statistics.reactive.md +108 -108
  136. package/examples/local/showcase/zh/tasks.reactive.md +89 -89
  137. package/package.json +152 -145
  138. package/dist-library/compiler-UyPwGzJZ.js +0 -22109
  139. package/dist-library/react-fizgU3i8.js +0 -12764
  140. package/docs/local-guide-ch.md +0 -967
  141. package/docs/local-guide-en.md +0 -967
@@ -18,22 +18,22 @@ Containers up to 600px wide offer only Edit and Preview. A source-only editor ke
18
18
 
19
19
  The editor source surface, gutter, syntax highlighting, toolbar and menus now follow the instance theme. Light mode uses a white editor surface, dark mode keeps the deep blue surface, and `auto` follows the system preference. The host page theme and the editor theme remain independent.
20
20
 
21
- See [React source editor](editor-en.md) for the full prop table and view behavior.
21
+ See [React source editor](../integration/editor-en.md) for the full prop table and view behavior.
22
22
 
23
23
  ## HTML compatibility
24
24
 
25
25
  The default renderer now accepts a P0 HTML subset, including disclosures, containers, headings, code, lists, links and images. Three host-owned options add author CSS, JavaScript and extended HTML. All three are off by default. Enabling any one routes the whole document to isolated native HTML, which stops Markdown and ReactiveMD interpretation for that path.
26
26
 
27
- This routing is a temporary policy for the next release. Static export disables author JavaScript. See [HTML compatibility](html-compatibility-en.md) for the supported subset, options and conflict rules.
27
+ This routing is a temporary policy for the next release. Static export disables author JavaScript. See [HTML compatibility](../reference/html-compatibility-en.md) for the supported subset, options and conflict rules.
28
28
 
29
29
  ## Compatibility
30
30
 
31
31
  Existing `reactive-md`, `reactive-md/react`, `reactive-md/editor` and `reactive-md/styles.css` imports keep working. Documents written for `0.4.x` and `0.5.0` need no edit. The syntax revision, component protocol and theme protocol keep their current versions.
32
32
 
33
- The editor requires React 19. The core `reactive-md` entry still does not depend on React. See the [changelog](../CHANGELOG.md) and [Versions and compatibility](compatibility-en.md) for the version axes.
33
+ The editor requires React 19. The core `reactive-md` entry still does not depend on React. See the [changelog](../../CHANGELOG.md) and [Versions and compatibility](../compatibility/compatibility-en.md) for the version axes.
34
34
 
35
35
  ## Validation and limits
36
36
 
37
37
  The 0.5.1 release gate covers core and renderer tests, the editor entry and its views, type checking, package exports, documentation links, offline tarball consumers, static rendering and browser interaction. CI targets Node 22.12 and 24 with Chromium; local browser checks use Microsoft Edge. General SSR hydration outside exported HTML, Firefox and WebKit remain unverified.
38
38
 
39
- The project remains a 0.x preview. Security boundaries and host responsibilities are documented in [SECURITY.md](../SECURITY.md).
39
+ The project remains a 0.x preview. Security boundaries and host responsibilities are documented in [SECURITY.md](../../SECURITY.md).
@@ -18,7 +18,7 @@ npm install reactive-md@0.5.2
18
18
 
19
19
  `LocalDocumentView` 和 `LocalReactiveDocument` 接受 `hostData`(按 `${kind}:${ref}` 索引的 JSON 安全数据)与仅客户端的 `hostRenderer(node, data, ctx)`。缺少 renderer、缺少数据或 renderer 抛错时显示可见占位,不会让文档失败。`mode="static"` 走同一分派。Schema 会随编译请求进入 worker;renderer 和宿主数据不会。
20
20
 
21
- 完整契约见[本地模式集成](local-integration-ch.md#宿主组件)与[组块协议](component-protocol-ch.md)。
21
+ 完整契约见[本地模式集成](../integration/local-integration-ch.md#宿主组件)与[组块协议](../development/component-protocol-ch.md)。
22
22
 
23
23
  ## 协议修订
24
24
 
@@ -26,10 +26,10 @@ npm install reactive-md@0.5.2
26
26
 
27
27
  ## 兼容性
28
28
 
29
- 现有 `reactive-md`、`reactive-md/react`、`reactive-md/editor`、`reactive-md/styles.css` 和 `reactive-md/editor/styles.css` 导入继续有效。为 `0.5.x` 编写的文档无需修改;宿主扩展为可选能力。核心入口仍不依赖 React。详见[变更日志](../CHANGELOG-ch.md)与[版本与兼容性](compatibility-ch.md)。
29
+ 现有 `reactive-md`、`reactive-md/react`、`reactive-md/editor`、`reactive-md/styles.css` 和 `reactive-md/editor/styles.css` 导入继续有效。为 `0.5.x` 编写的文档无需修改;宿主扩展为可选能力。核心入口仍不依赖 React。详见[变更日志](../../CHANGELOG-ch.md)与[版本与兼容性](../compatibility/compatibility-ch.md)。
30
30
 
31
31
  ## 验证与限制
32
32
 
33
33
  发布门槛覆盖类型检查、完整测试套件、文档链接、包构建和打包安装冒烟检查。单文件导出之外的通用 SSR 水合、Firefox 和 WebKit 仍未验证。
34
34
 
35
- 项目仍是 0.x 预览版。安全边界与宿主责任见[SECURITY-ch.md](../SECURITY-ch.md)。
35
+ 项目仍是 0.x 预览版。安全边界与宿主责任见[SECURITY-ch.md](../../SECURITY-ch.md)。
@@ -18,7 +18,7 @@ Without `hostComponents`, behavior is unchanged: the tag remains unknown and fal
18
18
 
19
19
  `LocalDocumentView` and `LocalReactiveDocument` accept `hostData`, JSON-safe data keyed `${kind}:${ref}`, and a client-only `hostRenderer(node, data, ctx)`. A missing renderer, missing data or a throwing renderer renders a visible placeholder instead of failing the document. `mode="static"` uses the same dispatch. Schemas travel through the compile worker; the renderer and host data never do.
20
20
 
21
- See [Local mode integration](local-integration-en.md#host-components) and [Component protocol](component-protocol-en.md) for the full contract.
21
+ See [Local mode integration](../integration/local-integration-en.md#host-components) and [Component protocol](../development/component-protocol-en.md) for the full contract.
22
22
 
23
23
  ## Protocol revision
24
24
 
@@ -26,10 +26,10 @@ The component protocol is now `component-protocol-2`. The syntax revision remain
26
26
 
27
27
  ## Compatibility
28
28
 
29
- Existing `reactive-md`, `reactive-md/react`, `reactive-md/editor`, `reactive-md/styles.css` and `reactive-md/editor/styles.css` imports keep working. Documents written for `0.5.x` need no edit; the host extension is opt-in. The core entry still does not depend on React. See the [changelog](../CHANGELOG.md) and [Versions and compatibility](compatibility-en.md).
29
+ Existing `reactive-md`, `reactive-md/react`, `reactive-md/editor`, `reactive-md/styles.css` and `reactive-md/editor/styles.css` imports keep working. Documents written for `0.5.x` need no edit; the host extension is opt-in. The core entry still does not depend on React. See the [changelog](../../CHANGELOG.md) and [Versions and compatibility](../compatibility/compatibility-en.md).
30
30
 
31
31
  ## Validation and limits
32
32
 
33
33
  The release gate covers type checking, the full test suite, documentation links, the package build and a packed-package smoke check. General SSR hydration outside exported HTML, Firefox and WebKit remain unverified.
34
34
 
35
- The project remains a 0.x preview. Security boundaries and host responsibilities are documented in [SECURITY.md](../SECURITY.md).
35
+ The project remains a 0.x preview. Security boundaries and host responsibilities are documented in [SECURITY.md](../../SECURITY.md).
@@ -22,4 +22,4 @@
22
22
 
23
23
  已有入口继续可用。需要文档打印布局的宿主须显式导入可选打印样式,无需迁移文档语法或协议。
24
24
 
25
- 参见[更新日志](../CHANGELOG-ch.md)、[作者工具](author-tools-ch.md)和[集成指南](local-integration-ch.md)。
25
+ 参见[更新日志](../../CHANGELOG-ch.md)、[作者工具](../integration/author-tools-ch.md)和[集成指南](../integration/local-integration-ch.md)。
@@ -22,4 +22,4 @@ Display math reports source-ranged warnings for unsupported commands or environm
22
22
 
23
23
  Existing package entries remain available. Hosts that need document print layout should explicitly import the optional print stylesheet. No source syntax or protocol migration is required.
24
24
 
25
- See the [changelog](../CHANGELOG.md), [author tools](author-tools-en.md) and [integration guide](local-integration-en.md).
25
+ See the [changelog](../../CHANGELOG.md), [author tools](../integration/author-tools-en.md) and [integration guide](../integration/local-integration-en.md).
@@ -0,0 +1,57 @@
1
+ # 0.6.0 发布说明
2
+
3
+ `reactive-md@0.6.0` 是同时更新 `latest` 与 `next` 的 0.x 预览版。语法修订保持 `local-draft-2`,组块协议保持 `component-protocol-2`,主题协议保持 `reactive-md-theme-1`。现有导入和文档无需迁移。
4
+
5
+ ```sh
6
+ npm install reactive-md
7
+ # 或固定版本
8
+ npm install reactive-md@0.6.0
9
+ ```
10
+
11
+ 离线安装可下载 [npm 安装包](https://registry.npmjs.org/reactive-md/-/reactive-md-0.6.0.tgz)。
12
+
13
+ ## 原生 HTML
14
+
15
+ 默认渲染路径的 P0 HTML 新增原生表格。`<table>` 的正文出现 `caption`、`colgroup`、`thead`、`tbody`、`tr`、`th` 或 `td` 时按 HTML 表格渲染,支持 `colspan`、`rowspan`、`scope`、`headers` 及列组 `span`,无需开启扩展 HTML。原生表格与 Markdown 表格共用框架、标题、单元格样式和窄屏滚动;普通数字列自动右对齐。原生表格不提供搜索、排序、分页或行选择,单元格内的 Markdown、公式、插值和控件继续工作。混用 Markdown 表格行与 HTML 结构会给出诊断,并按原文显示该表格。
16
+
17
+ `div`、`p` 和 `h1` 至 `h6` 支持静态 `align` 属性,取值为 `left`、`center`、`right` 或 `justify`。链接支持显式 `target` 和 `rel`:未指定属性的 HTTP(S) 链接仍在新窗口打开,`target="_blank"` 会保留作者关系词、合并 `noopener noreferrer` 并移除 `opener`,相对链接仍在当前页面打开。
18
+
19
+ 无法解析的局部原生 HTML 现在按原文显示,不再导致整篇文档失败;其余 Markdown、公式和控件继续渲染。新增 `local.html.fallback` 和 `local.html.fallbackAttribute` 警告,分别表示元素因不支持的标签或属性转为惰性源码。React 预览和 standalone 挂载在整篇 HTML 解析失败时显示完整源码,保留换行并转义标签。
20
+
21
+ ## 数学排版
22
+
23
+ 正文支持 `\(...\)` 行内公式和 `\[...\]` 独立公式,与美元定界符共用同一渲染器;plot 仍只接受 `$$...$$`。
24
+
25
+ 排版新增 `aligned`、`align`、`align*`、`pmatrix`、`bmatrix` 和 `vmatrix` 环境,并支持 `\tag` 编号。补充 `\mathbb`、`\mathcal`、`\mathscr`、`\mathfrak`、`\textbf`、`\textit`、上下标注箭头、`\big` 系列定界符,以及 `\sec`、`\sinh`、`\pmod` 等命令。
26
+
27
+ 化学式通过 mhchem 的 `\ce{...}` 编写,例如 `$\ce{H2O}$` 或 `$$\ce{2 H2 + O2 -> 2 H2O}$$`。分子下标、离子电荷、同位素、物态和反应箭头由 `mhchemparser` 转换后进入同一 MathML 渲染器;转换受长度、记号和嵌套预算限制,未支持的命令给出 `local.math.display` 诊断。
28
+
29
+ ## 代码围栏
30
+
31
+ 新增 `cattca`、`mermaid` 和 `vue` 高亮。Vue 单文件组件的模板、JavaScript/TypeScript、CSS/SCSS 分段高亮;Cattca 按 Markdown 正文与命令块高亮;Mermaid 围栏只高亮源码,不渲染图表。无语言标注时继续在受限语言集合中自动识别,未知语言和超过 20,000 字符的代码块保留纯文本。
32
+
33
+ ## 图解与提示
34
+
35
+ node/edge 图解改用分层布局:源码顺序决定同层顺序,环路整体分组,平行边和标签位置由布局计算,连线使用平滑路径。服务端渲染和首屏仍先输出确定性的同步布局,组件挂载后再切换为最终布局。
36
+
37
+ tooltip 气泡会限制在视口内,并在滚动、缩放和内容尺寸变化时重新定位;配色跟随文档的浅色、深色和自定义主题。
38
+
39
+ ## 表单与宿主 API
40
+
41
+ 带 `required` 的文本、多行文本和日期控件不再设置原生 `required` 属性,改用 `aria-required` 和现有本地校验。嵌入宿主表单时,未填写的控件不会再以浏览器原生气泡阻止表单提交或 Enter 操作。
42
+
43
+ `compileLocal` 的返回值现在只包含普通对象和数组,可安全跨 React Server Components 边界传递,冻结元数据与共享引用保持不变。
44
+
45
+ 编辑器 ref 句柄新增 `insertText(text)`:用文本替换当前选区,记录为一次可撤销编辑,并把光标放到插入内容之后。
46
+
47
+ ## 兼容性
48
+
49
+ 现有入口、导入和文档语法保持不变,为 `0.5.x` 编写的文档无需修改。原生 HTML 表格和新数学命令只增加可识别写法;此前作为普通文字显示的相关源码现在可能按 HTML 或公式渲染。新增两个随包构建的依赖:`elkjs`(EPL-2.0 OR GPL-3.0-or-later)与 `mhchemparser`(Apache-2.0),许可声明已更新到 `THIRD_PARTY_NOTICES.md`。
50
+
51
+ `latest` 从 `0.4.0` 更新到 `0.6.0`,`next` 从 `0.5.3` 更新到 `0.6.0`。版本轴与迁移规则见[变更记录](../../CHANGELOG-ch.md)和[版本与兼容性](../compatibility/compatibility-ch.md)。
52
+
53
+ ## 验证与限制
54
+
55
+ 发布使用完整 `npm run verify:release` 门禁,覆盖核心与 Demo 测试、类型检查、构建、第三方 notice、包入口、文档链接、仓库外真实安装包消费和浏览器交互。CI 在 Node 22.12 和 24 上运行 Node 门禁,浏览器门禁在 Chromium 上运行完整检查,并使用 Firefox 与 WebKit 运行核心工作流;本机浏览器检查使用 Microsoft Edge。Firefox 与 WebKit 的完整交互套件和导出 HTML 之外的通用 SSR 水合仍未验证。
56
+
57
+ 项目仍处于 0.x 预览阶段。安全边界和宿主职责见 [SECURITY-ch.md](../../SECURITY-ch.md)。
@@ -0,0 +1,57 @@
1
+ # 0.6.0 release
2
+
3
+ `reactive-md@0.6.0` is a 0.x preview that updates both `latest` and `next`. It keeps syntax revision `local-draft-2`, component protocol `component-protocol-2` and theme protocol `reactive-md-theme-1`. Existing imports and documents need no migration.
4
+
5
+ ```sh
6
+ npm install reactive-md
7
+ # or pin the version
8
+ npm install reactive-md@0.6.0
9
+ ```
10
+
11
+ For offline installation, use the [npm tarball](https://registry.npmjs.org/reactive-md/-/reactive-md-0.6.0.tgz).
12
+
13
+ ## Native HTML
14
+
15
+ The default P0 HTML path now supports native tables. When a `<table>` body contains `caption`, `colgroup`, `thead`, `tbody`, `tr`, `th` or `td`, it renders as an HTML table with `colspan`, `rowspan`, `scope`, `headers` and column-group `span`, without enabling extended HTML. Native and Markdown tables share the frame, caption, cell styles and narrow-screen scrolling; numeric columns keep the same automatic alignment. Native tables do not add search, sort, paging or row selection, and Markdown, formulas, interpolation and controls inside cells keep working. Mixing Markdown table rows with HTML structure produces a diagnostic and shows that table as source.
16
+
17
+ `div`, `p` and `h1` through `h6` accept a static `align` attribute with `left`, `center`, `right` or `justify`. Links accept explicit `target` and `rel`: HTTP(S) links without attributes still open in a new window, `target="_blank"` keeps author relationship words, merges `noopener noreferrer` and removes `opener`, and relative links still open in the current page.
18
+
19
+ Unparseable native HTML fragments now display as source instead of failing the whole document; the remaining Markdown, formulas and controls keep rendering. New `local.html.fallback` and `local.html.fallbackAttribute` warnings mark elements converted to inert source because of an unsupported tag or attribute. React previews and standalone mounts show the full source, with line breaks preserved and tags escaped, when whole-document HTML parsing fails.
20
+
21
+ ## Math layout
22
+
23
+ Prose accepts `\(...\)` for inline math and `\[...\]` for display math through the same renderer as the dollar delimiters; plots still accept only `$$...$$`.
24
+
25
+ Display adds the `aligned`, `align`, `align*`, `pmatrix`, `bmatrix` and `vmatrix` environments with `\tag` numbering. It also adds `\mathbb`, `\mathcal`, `\mathscr`, `\mathfrak`, `\textbf`, `\textit`, labeled arrows, `\big` delimiter sizes and commands such as `\sec`, `\sinh` and `\pmod`.
26
+
27
+ Chemistry uses mhchem `\ce{...}`, for example `$\ce{H2O}$` or `$$\ce{2 H2 + O2 -> 2 H2O}$$`. `mhchemparser` converts subscripts, ionic charges, isotopes, states and reaction arrows before the shared MathML renderer; conversion is bounded by length, token and nesting budgets, and unsupported commands produce `local.math.display` diagnostics.
28
+
29
+ ## Code fences
30
+
31
+ New highlighting covers `cattca`, `mermaid` and `vue`. Vue single-file components highlight templates, JavaScript/TypeScript and CSS/SCSS as separate regions; Cattca highlights Markdown prose and command blocks; Mermaid fences highlight source only and do not render diagrams. Unlabeled blocks keep the restricted automatic detection, and unknown languages or blocks longer than 20,000 characters stay plain text.
32
+
33
+ ## Diagrams and tooltips
34
+
35
+ Node/edge diagrams now use a layered layout: source order sets order within a layer, cycles are grouped, parallel edges and label positions are computed by the layout, and edges use smooth paths. Server rendering and the first paint still emit a deterministic synchronous layout, then swap to the final layout after mount.
36
+
37
+ Tooltips stay inside the viewport and reposition on scroll, zoom and content-size changes. Their colors follow the document's light, dark and custom themes.
38
+
39
+ ## Forms and host APIs
40
+
41
+ Required text, textarea and date controls no longer set the native `required` attribute. They use `aria-required` and the existing local validation instead. Inside a host form, an empty control no longer blocks submission or the Enter action with a browser validation bubble.
42
+
43
+ `compileLocal` now returns only plain objects and arrays, so results can cross a React Server Components boundary safely while frozen metadata and shared references stay intact.
44
+
45
+ The editor ref handle adds `insertText(text)`, which replaces the current selection, records one undoable edit and places the caret after the inserted text.
46
+
47
+ ## Compatibility
48
+
49
+ Existing entries, imports and document syntax are unchanged; documents written for `0.5.x` need no edit. Native HTML tables and the new math commands only add recognized forms; source that previously displayed as ordinary text may now render as HTML or a formula. Two dependencies are bundled into the build: `elkjs` (EPL-2.0 OR GPL-3.0-or-later) and `mhchemparser` (Apache-2.0); `THIRD_PARTY_NOTICES.md` is updated.
50
+
51
+ `latest` moves from `0.4.0` to `0.6.0`, and `next` moves from `0.5.3` to `0.6.0`. See the [changelog](../../CHANGELOG.md) and [Versions and compatibility](../compatibility/compatibility-en.md) for the version axes and migration rules.
52
+
53
+ ## Validation and limits
54
+
55
+ The release uses the full `npm run verify:release` gate: core and Demo tests, type checking, builds, third-party notices, package entries, documentation links, real tarball consumption outside the repository and browser interaction. CI runs the Node gate on Node 22.12 and 24; the browser gate runs the full suite on Chromium and core workflows on Firefox and WebKit. Local browser checks use Microsoft Edge. The full Firefox and WebKit interaction suites and general SSR hydration outside exported HTML remain unverified.
56
+
57
+ The project remains a 0.x preview. Security boundaries and host responsibilities are documented in [SECURITY.md](../../SECURITY.md).
@@ -0,0 +1,27 @@
1
+ # 0.6.1 发布说明
2
+
3
+ `reactive-md@0.6.1` 将公式展示从原生 MathML 切换为 KaTeX,同时更新 `latest` 与 `next`。语法修订 `local-draft-2`、组块协议 `component-protocol-2` 和主题协议 `reactive-md-theme-1` 保持不变。
4
+
5
+ ```sh
6
+ npm install reactive-md
7
+ # 或固定版本
8
+ npm install reactive-md@0.6.1
9
+ ```
10
+
11
+ 离线安装可下载 [npm 安装包](https://registry.npmjs.org/reactive-md/-/reactive-md-0.6.1.tgz)。
12
+
13
+ ## 公式展示
14
+
15
+ KaTeX 使用配套数学字体排版行内与独立公式,输出可视 HTML、用于辅助技术的 MathML,以及保留原始 LaTeX 的注释。积分、分式、矩阵、多行对齐、公式编号与 mhchem 化学式使用同一渲染器。编译诊断与实际展示共用 KaTeX 的语法支持范围,新增有效写法包括 `matrix`、`\overset`、`\displaystyle` 和 `\limits`。
16
+
17
+ 标准样式内嵌 20 个 WOFF2 字体文件,预览、打印及单文件 HTML 均可离线显示公式;禁用 JavaScript 的静态 HTML 也保留排版。行内公式跟随文字基线,并在 KaTeX 允许的位置换行。超宽独立公式可横向滚动,编号与正文之间预留间距。
18
+
19
+ ## 兼容性
20
+
21
+ 现有导入继续有效。使用无样式 React 入口时,加载 `reactive-md/styles.css`,或由宿主提供 KaTeX 样式和字体。内嵌渲染器与字体会增加下载体积。
22
+
23
+ `align` 现在自动按行编号;无需自动编号时使用 `align*` 或 `aligned`。显式 `\tag` 用于独立公式。无效或不支持的公式现在整条回退为有界原文,并在对应源码位置给出 `local.math.display` 警告。
24
+
25
+ 绘图求值保留现有解析器、函数支持范围和参数更新逻辑。作者自定义宏、HTML、文件与网络命令继续关闭;输入长度、嵌套、记号数、宏展开与作者指定尺寸均受预算限制。详见[语法参考](../reference/local-interaction-syntax-ch.md)和[安全策略](../../SECURITY-ch.md)。
26
+
27
+ KaTeX 及其字体替代独立的 `mhchemparser` 依赖;随包 mhchem 扩展的上游版权与 Apache-2.0 声明保留在 `THIRD_PARTY_NOTICES.md`。
@@ -0,0 +1,27 @@
1
+ # 0.6.1 release
2
+
3
+ `reactive-md@0.6.1` replaces native MathML formula display with KaTeX. It updates both `latest` and `next`. Syntax revision `local-draft-2`, component protocol `component-protocol-2` and theme protocol `reactive-md-theme-1` stay unchanged.
4
+
5
+ ```sh
6
+ npm install reactive-md
7
+ # or pin the version
8
+ npm install reactive-md@0.6.1
9
+ ```
10
+
11
+ For offline installation, use the [npm tarball](https://registry.npmjs.org/reactive-md/-/reactive-md-0.6.1.tgz).
12
+
13
+ ## Formula display
14
+
15
+ KaTeX typesets inline and display formulas with its math fonts. Visual HTML is paired with MathML for assistive technology and an annotation containing the original LaTeX. Integrals, fractions, matrices, alignment, equation tags and mhchem chemistry use the same renderer. Formula display and compiler diagnostics now share KaTeX's supported syntax, including `matrix`, `\overset`, `\displaystyle` and `\limits`.
16
+
17
+ The standard stylesheet embeds 20 WOFF2 font faces. Preview, print and single-file HTML exports can display formulas offline, including static HTML with JavaScript disabled. Inline formulas follow the text baseline and wrap at KaTeX break points. Wide display formulas scroll horizontally; equation tags reserve space beside the formula.
18
+
19
+ ## Compatibility
20
+
21
+ Existing imports keep working. Load `reactive-md/styles.css` when using the unstyled React entry, or provide KaTeX styles and fonts in the host. The bundled renderer and fonts increase download size.
22
+
23
+ `align` numbers rows automatically. Use `align*` or `aligned` for unnumbered alignment. Explicit `\tag` belongs in display formulas. Invalid or unsupported formulas now fall back to bounded source text for the whole formula, with a `local.math.display` warning at the source range.
24
+
25
+ Plot evaluation keeps the existing parser, supported functions and parameter updates. Author-defined macros, HTML, file and network commands remain disabled. Input size, nesting, token count, macro expansion and user-specified dimensions are bounded. See the [syntax reference](../reference/local-interaction-syntax-en.md) and [security policy](../../SECURITY.md).
26
+
27
+ KaTeX and its fonts replace the separate `mhchemparser` dependency. The bundled mhchem extension's upstream copyright and Apache-2.0 notice are retained in `THIRD_PARTY_NOTICES.md`.
@@ -1,53 +1,53 @@
1
- # Language conformance data
2
-
3
- [local-draft-2.json](local-draft-2.json) is a copyable minimal semantic conformance suite containing source documents, compilation results, initial parameters, state writes and expected text. The data is distributed with the npm package so other tools or implementations can read the same JSON.
4
-
5
- - `syntaxVersion` matches the core export `LOCAL_SYNTAX_VERSION`.
6
- - `ok` is the expected compilation result; `codes` is the deduplicated set of expected diagnostic codes, and when omitted no diagnostics are expected. A successful compile can still contain degradation warnings.
7
- - `initial` checks the initial values of public parameters; `bindingNames`, when present, checks the complete set of binding names.
8
- - `actions` finds controls by `bind` and submits `value`; when `codes` is present the write is expected to be rejected, otherwise it is expected to succeed.
9
- - `text` is evaluated with the updated state and the result should equal `expectedText`.
10
-
11
- The runner lives at `tests/conformance.test.ts` in the repository; run `npm test` to check it. This suite covers shared parameters, hidden initialization, write constraints, code isolation, diagnostics, multi-slot controls, multiple selection, generated-table selection and a computed-value aggregate recalculation. It does not cover validation hints, generated table rendering, HTML export, author tooling or browser behavior; those have dedicated tests and the release gate. Full syntax conformance also includes other language tests and browser checks, with rules in the [syntax specification](../../docs/local-interaction-syntax-en.md). See the [compatibility notes](../../docs/compatibility-en.md) for cross-version guarantees on diagnostic codes.
12
-
13
- The conformance sources are unversioned and use the current `local-draft-2` revision. The optional prologue version declaration is compile metadata and does not change these semantic cases. Version rejection and migration behavior have dedicated tests and historical fixtures. See [Source revisions and migration](../../docs/source-versioning-en.md).
14
-
15
- ## Component protocol conformance
16
-
17
- [component-protocol-1.json](component-protocol-1.json) provides representative cases for the [component protocol](../../docs/component-protocol-en.md), covering `slider`, `tabs`, `plot` and lazy degradation of unknown components. The existing `component-protocol-1.json` remains the frozen author-component baseline now that the protocol revision is `component-protocol-2`. The [JSON Schema](component-protocol-1.schema.json) defines the conformance file format so tools from other implementations can read it. This JSON is test input and expected results; see the [development guide](../../docs/component-development-en.md) for the declaration template of a component proposal.
18
-
19
- ```sh
20
- npm run test:components
21
- ```
22
-
23
- That command runs the component protocol cases and the existing language conformance data. A new component should add its own cases, unit tests and affected renderer checks; passing this suite only proves these specific cases pass.
24
-
25
- ### File and case fields
26
-
27
- The file root object contains `protocolVersion`, `syntaxVersion` and a non-empty `cases` array. Currently these are `component-protocol-1` and `local-draft-2`. The package version is identified separately by `package.json` and is not inferred from these two fields.
28
-
29
- | Field | Rule |
30
- | --- | --- |
31
- | `id` | Required, unique within the file; describes one observable behavior |
32
- | `component` | Required, names the component primarily under test; the source may use other components too |
33
- | `source` | Required, the original document source |
34
- | `ok` | Required, whether compilation is expected to succeed |
35
- | `codes` | Required, the deduplicated set of compilation diagnostic codes; `[]` when there are none, order ignored, the set compared exactly |
36
- | `initial` | Optional, initial state expectations after successful compilation, partially matched by the given keys |
37
- | `bindingNames` | Optional, the complete set of public binding names; excludes internal state keys of anonymous components |
38
- | `actions` | Optional, writes to named bindings in order; each entry requires `bind`, `value`, `codes` and may include `expectedState` |
39
- | `reset` | Optional, resets the named node after the writes; requires `component` and `expectedState`, `index` defaults to the 0th in source order among components with that name |
40
- | `text`, `expectedText` | Optional, must be paired; evaluated after writes and reset with the result compared exactly |
41
- | `htmlIncludes`, `htmlExcludes` | Optional, performs React static rendering in the final state and checks each listed fragment is present or absent |
42
-
43
- `initial` and `expectedState` values use the language's existing `LocalValue`: a string, finite number, boolean, `null` or string array. Public writable controls do not produce numeric arrays; numeric arrays are available to expressions and computed values. `actions[].codes` is the set of diagnostic codes returned by that write; still write `[]` when there are none. A rejected write should keep the last valid state. The runner finds compiled controls by `bind` and calls `runtime.set`; it does not simulate browser input events.
44
-
45
- Execution order is fixed: validate the data format and unique IDs, compile and compare diagnostics, check the initial state and public binding names, perform writes in order, then reset, and finally check text and optional rendering results. Every created runtime is disposed at the end. Cases with `ok: false` may only use compile-time fields and cannot add state, action or rendering expectations; unknown fields, missing fields and invalid values should fail conformance.
46
-
47
- `reset` calls `runtime.reset(node)` on the current instance; nodes are found by component name and index, and the conformance file does not store `node.id`. This check verifies runtime reset semantics; clicking a reset button still needs a renderer or browser check.
48
-
49
- ### Portable scope
50
-
51
- Compilation results, diagnostic sets, state changes and expression text are portable semantic expectations. HTML fragments only check this repository's React reference renderer; other renderers should verify equivalent user behavior and need not generate the same DOM or CSS class names.
52
-
53
- These cases do not prove real keyboard operation, focus movement, Chinese input methods, 375px layout, timer pause, or timer cleanup after disposal. Contributions involving those behaviors still need corresponding browser evidence; see the [development guide](../../docs/component-development-en.md) for verification methods. Cross-version stability of diagnostic codes continues to follow the [compatibility notes](../../docs/compatibility-en.md).
1
+ # Language conformance data
2
+
3
+ [local-draft-2.json](local-draft-2.json) is a copyable minimal semantic conformance suite containing source documents, compilation results, initial parameters, state writes and expected text. The data is distributed with the npm package so other tools or implementations can read the same JSON.
4
+
5
+ - `syntaxVersion` matches the core export `LOCAL_SYNTAX_VERSION`.
6
+ - `ok` is the expected compilation result; `codes` is the deduplicated set of expected diagnostic codes, and when omitted no diagnostics are expected. A successful compile can still contain degradation warnings.
7
+ - `initial` checks the initial values of public parameters; `bindingNames`, when present, checks the complete set of binding names.
8
+ - `actions` finds controls by `bind` and submits `value`; when `codes` is present the write is expected to be rejected, otherwise it is expected to succeed.
9
+ - `text` is evaluated with the updated state and the result should equal `expectedText`.
10
+
11
+ The runner lives at `tests/conformance.test.ts` in the repository; run `npm test` to check it. This suite covers shared parameters, hidden initialization, write constraints, code isolation, diagnostics, multi-slot controls, multiple selection, generated-table selection and a computed-value aggregate recalculation. It does not cover validation hints, generated table rendering, HTML export, author tooling or browser behavior; those have dedicated tests and the release gate. Full syntax conformance also includes other language tests and browser checks, with rules in the [syntax specification](../../docs/reference/local-interaction-syntax-en.md). See the [compatibility notes](../../docs/compatibility/compatibility-en.md) for cross-version guarantees on diagnostic codes.
12
+
13
+ The conformance sources are unversioned and use the current `local-draft-2` revision. The optional prologue version declaration is compile metadata and does not change these semantic cases. Version rejection and migration behavior have dedicated tests and historical fixtures. See [Source revisions and migration](../../docs/compatibility/source-versioning-en.md).
14
+
15
+ ## Component protocol conformance
16
+
17
+ [component-protocol-1.json](component-protocol-1.json) provides representative cases for the [component protocol](../../docs/development/component-protocol-en.md), covering `slider`, `tabs`, `plot` and lazy degradation of unknown components. The existing `component-protocol-1.json` remains the frozen author-component baseline now that the protocol revision is `component-protocol-2`. The [JSON Schema](component-protocol-1.schema.json) defines the conformance file format so tools from other implementations can read it. This JSON is test input and expected results; see the [development guide](../../docs/development/component-development-en.md) for the declaration template of a component proposal.
18
+
19
+ ```sh
20
+ npm run test:components
21
+ ```
22
+
23
+ That command runs the component protocol cases and the existing language conformance data. A new component should add its own cases, unit tests and affected renderer checks; passing this suite only proves these specific cases pass.
24
+
25
+ ### File and case fields
26
+
27
+ The file root object contains `protocolVersion`, `syntaxVersion` and a non-empty `cases` array. Currently these are `component-protocol-1` and `local-draft-2`. The package version is identified separately by `package.json` and is not inferred from these two fields.
28
+
29
+ | Field | Rule |
30
+ | --- | --- |
31
+ | `id` | Required, unique within the file; describes one observable behavior |
32
+ | `component` | Required, names the component primarily under test; the source may use other components too |
33
+ | `source` | Required, the original document source |
34
+ | `ok` | Required, whether compilation is expected to succeed |
35
+ | `codes` | Required, the deduplicated set of compilation diagnostic codes; `[]` when there are none, order ignored, the set compared exactly |
36
+ | `initial` | Optional, initial state expectations after successful compilation, partially matched by the given keys |
37
+ | `bindingNames` | Optional, the complete set of public binding names; excludes internal state keys of anonymous components |
38
+ | `actions` | Optional, writes to named bindings in order; each entry requires `bind`, `value`, `codes` and may include `expectedState` |
39
+ | `reset` | Optional, resets the named node after the writes; requires `component` and `expectedState`, `index` defaults to the 0th in source order among components with that name |
40
+ | `text`, `expectedText` | Optional, must be paired; evaluated after writes and reset with the result compared exactly |
41
+ | `htmlIncludes`, `htmlExcludes` | Optional, performs React static rendering in the final state and checks each listed fragment is present or absent |
42
+
43
+ `initial` and `expectedState` values use the language's existing `LocalValue`: a string, finite number, boolean, `null` or string array. Public writable controls do not produce numeric arrays; numeric arrays are available to expressions and computed values. `actions[].codes` is the set of diagnostic codes returned by that write; still write `[]` when there are none. A rejected write should keep the last valid state. The runner finds compiled controls by `bind` and calls `runtime.set`; it does not simulate browser input events.
44
+
45
+ Execution order is fixed: validate the data format and unique IDs, compile and compare diagnostics, check the initial state and public binding names, perform writes in order, then reset, and finally check text and optional rendering results. Every created runtime is disposed at the end. Cases with `ok: false` may only use compile-time fields and cannot add state, action or rendering expectations; unknown fields, missing fields and invalid values should fail conformance.
46
+
47
+ `reset` calls `runtime.reset(node)` on the current instance; nodes are found by component name and index, and the conformance file does not store `node.id`. This check verifies runtime reset semantics; clicking a reset button still needs a renderer or browser check.
48
+
49
+ ### Portable scope
50
+
51
+ Compilation results, diagnostic sets, state changes and expression text are portable semantic expectations. HTML fragments only check this repository's React reference renderer; other renderers should verify equivalent user behavior and need not generate the same DOM or CSS class names.
52
+
53
+ These cases do not prove real keyboard operation, focus movement, Chinese input methods, 375px layout, timer pause, or timer cleanup after disposal. Contributions involving those behaviors still need corresponding browser evidence; see the [development guide](../../docs/development/component-development-en.md) for verification methods. Cross-version stability of diagnostic codes continues to follow the [compatibility notes](../../docs/compatibility/compatibility-en.md).