reactive-md 0.5.3 → 0.6.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.
Files changed (95) hide show
  1. package/CHANGELOG-ch.md +45 -24
  2. package/CHANGELOG.md +45 -24
  3. package/CONTRIBUTING-ch.md +10 -5
  4. package/CONTRIBUTING.md +10 -5
  5. package/README-ch.md +38 -36
  6. package/README-en.md +45 -42
  7. package/README.md +45 -42
  8. package/SECURITY-ch.md +1 -1
  9. package/SECURITY.md +1 -1
  10. package/THIRD_PARTY_NOTICES.md +481 -1
  11. package/dist-library/{authoring-DJJjKYg9.js → authoring-DSC0VsNK.js} +58 -58
  12. package/dist-library/{compiler-UyPwGzJZ.js → compiler-CRD88BMt.js} +6218 -3363
  13. package/dist-library/react-Dk94rcOp.js +59658 -0
  14. package/dist-library/reactive-md-authoring.js +2 -2
  15. package/dist-library/reactive-md-editor.js +13 -0
  16. package/dist-library/reactive-md-react-unstyled.js +1 -1
  17. package/dist-library/reactive-md-react.js +1 -1
  18. package/dist-library/reactive-md.css +1 -1
  19. package/dist-library/reactive-md.js +123 -123
  20. package/dist-library/{runtime-DXtle_6c.js → runtime-D8KbnCd0.js} +151 -151
  21. package/dist-library/types/editor/types.d.ts +2 -0
  22. package/dist-library/types/local/code-block.d.ts +3 -1
  23. package/dist-library/types/local/code-languages.d.ts +7 -0
  24. package/dist-library/types/local/compiled-data.d.ts +6 -0
  25. package/dist-library/types/local/compiler.d.ts +1 -0
  26. package/dist-library/types/local/diagnostics.d.ts +31 -0
  27. package/dist-library/types/local/diagram-layout.d.ts +69 -0
  28. package/dist-library/types/local/html-names.d.ts +6 -0
  29. package/dist-library/types/local/html-table.d.ts +25 -0
  30. package/dist-library/types/local/math-display.d.ts +1 -0
  31. package/dist-library/types/local/table-surface.d.ts +10 -0
  32. package/dist-library/types/local/types.d.ts +2 -0
  33. package/dist-library/types/local/visuals.d.ts +9 -0
  34. package/dist-standalone/reactive-md-standalone.css +1 -1
  35. package/dist-standalone/reactive-md-standalone.js +75 -51
  36. package/docs/README.md +84 -0
  37. package/docs/{compatibility-ch.md → compatibility/compatibility-ch.md} +28 -18
  38. package/docs/{compatibility-en.md → compatibility/compatibility-en.md} +28 -18
  39. package/docs/{source-versioning-ch.md → compatibility/source-versioning-ch.md} +2 -2
  40. package/docs/{source-versioning-en.md → compatibility/source-versioning-en.md} +2 -2
  41. package/docs/{component-development-ch.md → development/component-development-ch.md} +7 -7
  42. package/docs/{component-development-en.md → development/component-development-en.md} +7 -7
  43. package/docs/{component-protocol-ch.md → development/component-protocol-ch.md} +17 -17
  44. package/docs/{component-protocol-en.md → development/component-protocol-en.md} +17 -17
  45. package/docs/{performance-ch.md → development/performance-ch.md} +2 -2
  46. package/docs/{performance-en.md → development/performance-en.md} +2 -2
  47. package/docs/{releasing-ch.md → development/releasing-ch.md} +12 -12
  48. package/docs/{releasing-en.md → development/releasing-en.md} +12 -12
  49. package/docs/guides/local-guide-ch.md +513 -0
  50. package/docs/guides/local-guide-en.md +513 -0
  51. package/docs/{author-tools-ch.md → integration/author-tools-ch.md} +8 -8
  52. package/docs/{author-tools-en.md → integration/author-tools-en.md} +8 -8
  53. package/docs/{editor-ch.md → integration/editor-ch.md} +7 -6
  54. package/docs/{editor-en.md → integration/editor-en.md} +7 -6
  55. package/docs/{local-integration-ch.md → integration/local-integration-ch.md} +33 -15
  56. package/docs/{local-integration-en.md → integration/local-integration-en.md} +33 -15
  57. package/docs/{shareable-export-ch.md → integration/shareable-export-ch.md} +16 -4
  58. package/docs/{shareable-export-en.md → integration/shareable-export-en.md} +16 -4
  59. package/docs/{computations-formatting-ch.md → reference/computations-formatting-ch.md} +2 -2
  60. package/docs/{computations-formatting-en.md → reference/computations-formatting-en.md} +2 -2
  61. package/docs/{constraints-collections-ch.md → reference/constraints-collections-ch.md} +2 -2
  62. package/docs/{constraints-collections-en.md → reference/constraints-collections-en.md} +2 -2
  63. package/docs/{diagnostics-counting-ch.md → reference/diagnostics-counting-ch.md} +22 -2
  64. package/docs/{diagnostics-counting-en.md → reference/diagnostics-counting-en.md} +22 -2
  65. package/docs/{html-compatibility-ch.md → reference/html-compatibility-ch.md} +42 -4
  66. package/docs/{html-compatibility-en.md → reference/html-compatibility-en.md} +42 -4
  67. package/docs/{local-components-v2-ch.md → reference/local-components-v2-ch.md} +2 -2
  68. package/docs/{local-components-v2-en.md → reference/local-components-v2-en.md} +2 -2
  69. package/docs/{local-interaction-syntax-ch.md → reference/local-interaction-syntax-ch.md} +26 -7
  70. package/docs/{local-interaction-syntax-en.md → reference/local-interaction-syntax-en.md} +26 -7
  71. package/docs/{theme-protocol-ch.md → reference/theme-protocol-ch.md} +1 -1
  72. package/docs/{theme-protocol-en.md → reference/theme-protocol-en.md} +1 -1
  73. package/docs/{release-0.4.0-ch.md → releases/release-0.4.0-ch.md} +6 -6
  74. package/docs/{release-0.4.0-en.md → releases/release-0.4.0-en.md} +6 -6
  75. package/docs/{release-0.4.1-ch.md → releases/release-0.4.1-ch.md} +2 -2
  76. package/docs/{release-0.4.1-en.md → releases/release-0.4.1-en.md} +2 -2
  77. package/docs/{release-0.5.0-ch.md → releases/release-0.5.0-ch.md} +4 -4
  78. package/docs/{release-0.5.0-en.md → releases/release-0.5.0-en.md} +4 -4
  79. package/docs/{release-0.5.1-ch.md → releases/release-0.5.1-ch.md} +4 -4
  80. package/docs/{release-0.5.1-en.md → releases/release-0.5.1-en.md} +4 -4
  81. package/docs/{release-0.5.2-ch.md → releases/release-0.5.2-ch.md} +3 -3
  82. package/docs/{release-0.5.2-en.md → releases/release-0.5.2-en.md} +3 -3
  83. package/docs/{release-0.5.3-ch.md → releases/release-0.5.3-ch.md} +1 -1
  84. package/docs/{release-0.5.3-en.md → releases/release-0.5.3-en.md} +1 -1
  85. package/docs/releases/release-0.6.0-ch.md +57 -0
  86. package/docs/releases/release-0.6.0-en.md +57 -0
  87. package/examples/conformance/README.md +4 -4
  88. package/examples/integration/README.md +10 -8
  89. package/examples/integration/worker/package.json +1 -1
  90. package/examples/local/README.md +5 -5
  91. package/examples/local/html-compat.reactive.md +19 -0
  92. package/package.json +9 -2
  93. package/dist-library/react-fizgU3i8.js +0 -12764
  94. package/docs/local-guide-ch.md +0 -967
  95. package/docs/local-guide-en.md +0 -967
package/CHANGELOG-ch.md CHANGED
@@ -1,21 +1,42 @@
1
1
  # 变更记录
2
2
 
3
- ## 0.5.3(2026-10-26,next 渠道)
4
-
5
- 参见 [0.5.3 发布说明](docs/release-0.5.3-ch.md)。语法与协议修订保持不变。
6
-
7
- - 新增可选 `markdownBreaks`,贯通编译、渲染、worker 和缓存键,保留源码范围。
8
- - 拆出无样式 React 入口、屏幕 CSS 和可选打印 CSS,屏幕样式移除全局 `@page`。
9
- - 导出 `localCompileOptionsKey`、`LocalRenderContext`,新增无需 React 的 `reactive-md/authoring` 入口。
10
- - 分析、补全、重命名和格式化接受与预览一致的编译配置。
11
- - 数学显示因不支持的命令、环境或预算降级时,报告带源码范围的诊断。
3
+ ## 0.6.0(2026-10-27,latest 与 next 渠道)
12
4
 
5
+ 参见 [0.6.0 发布说明](docs/releases/release-0.6.0-ch.md)。语法修订 `local-draft-2`、组块协议 `component-protocol-2` 和主题协议 `reactive-md-theme-1` 保持不变。
13
6
 
14
- 本文件记录用户可见变更。项目处于 0.x 预览阶段,版本与迁移规则见[版本与兼容性](docs/compatibility-ch.md)。
7
+ ### 新增
8
+
9
+ - 默认 P0 HTML 路径新增原生表格,支持 `caption`、`colgroup`、`colspan`、`rowspan`、`scope`、`headers` 和共享表格样式,无需开启扩展 HTML。
10
+ - `div`、`p` 和标题支持静态 `align`;链接支持 `target`/`rel`,并对 `_blank` 合并安全关系词。
11
+ - 新增 `\(...\)` 和 `\[...\]` 公式定界符,`aligned`、`align`、`align*`、`pmatrix`、`bmatrix`、`vmatrix` 环境与 `\tag`,以及更多字体、箭头、定界符尺寸、函数命令和 mhchem `\ce{...}`。
12
+ - 代码围栏新增 `cattca`、`mermaid` 和 `vue` 高亮。
13
+ - node/edge 图解改用 ELK 分层布局,同时保留确定性的同步首屏。
14
+ - 编辑器 ref 句柄新增 `insertText(text)`。
15
+
16
+ ### 调整
17
+
18
+ - `compileLocal` 只返回普通对象和数组,可安全跨 React Server Components 边界传递。
19
+ - tooltip 限制在视口内,并在滚动、缩放和内容变化时重新定位,配色跟随文档主题。
20
+ - 必填控件改用 `aria-required` 和本地校验,不再用原生 `required` 阻止宿主表单提交。
21
+ - 无法解析的原生 HTML 回退为惰性源码,不再导致整篇文档失败;新增 `local.html.fallback` 和 `local.html.fallbackAttribute` 警告。
22
+ - 新增两个随包构建的依赖 `elkjs` 与 `mhchemparser`,更新 `THIRD_PARTY_NOTICES.md`。
23
+
24
+ ## 0.5.3(2026-10-26,next 渠道)
25
+
26
+ 参见 [0.5.3 发布说明](docs/releases/release-0.5.3-ch.md)。语法与协议修订保持不变。
27
+
28
+ - 新增可选 `markdownBreaks`,贯通编译、渲染、worker 和缓存键,保留源码范围。
29
+ - 拆出无样式 React 入口、屏幕 CSS 和可选打印 CSS,屏幕样式移除全局 `@page`。
30
+ - 导出 `localCompileOptionsKey`、`LocalRenderContext`,新增无需 React 的 `reactive-md/authoring` 入口。
31
+ - 分析、补全、重命名和格式化接受与预览一致的编译配置。
32
+ - 数学显示因不支持的命令、环境或预算降级时,报告带源码范围的诊断。
33
+
34
+
35
+ 本文件记录用户可见变更。项目处于 0.x 预览阶段,版本与迁移规则见[版本与兼容性](docs/compatibility/compatibility-ch.md)。
15
36
 
16
37
  ## 0.5.2(2026-10-26,next 渠道)
17
38
 
18
- 兼容 0.5.1。语法仍为 `local-draft-2`,组块协议为 `component-protocol-2`,主题协议为 `reactive-md-theme-1`。见[0.5.2 发布说明](docs/release-0.5.2-ch.md)。
39
+ 兼容 0.5.1。语法仍为 `local-draft-2`,组块协议为 `component-protocol-2`,主题协议为 `reactive-md-theme-1`。见[0.5.2 发布说明](docs/releases/release-0.5.2-ch.md)。
19
40
 
20
41
  ### 新增
21
42
 
@@ -33,12 +54,12 @@
33
54
 
34
55
  ## 0.5.1(2026-10-25,next 渠道)
35
56
 
36
- 兼容 0.5.0。语法仍为 `local-draft-2`,组块协议为 `component-protocol-1`,主题协议为 `reactive-md-theme-1`。见[0.5.1 发布说明](docs/release-0.5.1-ch.md)。
57
+ 兼容 0.5.0。语法仍为 `local-draft-2`,组块协议为 `component-protocol-1`,主题协议为 `reactive-md-theme-1`。见[0.5.1 发布说明](docs/releases/release-0.5.1-ch.md)。
37
58
 
38
59
  ### 新增
39
60
 
40
61
  - 默认 ReactiveMD 渲染路径新增 P0 HTML 兼容,包含富文本折叠、容器、标题、代码、列表、链接和图片。
41
- - 新增宿主选项 `enableCss`、`enableJavaScript` 和 `enableExtendedHtml`,默认全部关闭。任意开启一个,整篇文档分流到隔离的原生 HTML 路径;该路径停止解析 Markdown 和 ReactiveMD。见 [HTML 部分兼容与暂时性分流政策](docs/html-compatibility-ch.md)。
62
+ - 新增宿主选项 `enableCss`、`enableJavaScript` 和 `enableExtendedHtml`,默认全部关闭。任意开启一个,整篇文档分流到隔离的原生 HTML 路径;该路径停止解析 Markdown 和 ReactiveMD。见 [HTML 部分兼容与暂时性分流政策](docs/reference/html-compatibility-ch.md)。
42
63
  - Demo 新增中英文能力开关,导出保留 HTML 模式;静态导出禁用作者 JavaScript。
43
64
  - 编辑器内置底栏,显示 Unicode 字数、键盘提示,并提供编辑、并排和预览三种视图。预览内容由宿主提供。切换视图会保留源码选区、撤销记录和预览状态。
44
65
  - 窄屏只提供编辑和预览;仅编辑源码时保留字数与键盘提示。
@@ -49,7 +70,7 @@
49
70
 
50
71
  ## 0.5.0(2026-10-25,next 渠道)
51
72
 
52
- 兼容 0.4.1。语法仍为 `local-draft-2`,组块协议为 `component-protocol-1`,主题协议为 `reactive-md-theme-1`。现有 `reactive-md`、`reactive-md/react` 和 `reactive-md/styles.css` 导入保持不变,渲染器入口 API 不变。见[0.5.0 发布说明](docs/release-0.5.0-ch.md)。
73
+ 兼容 0.4.1。语法仍为 `local-draft-2`,组块协议为 `component-protocol-1`,主题协议为 `reactive-md-theme-1`。现有 `reactive-md`、`reactive-md/react` 和 `reactive-md/styles.css` 导入保持不变,渲染器入口 API 不变。见[0.5.0 发布说明](docs/releases/release-0.5.0-ch.md)。
53
74
 
54
75
  ### 新增
55
76
 
@@ -64,7 +85,7 @@
64
85
 
65
86
  ## 0.4.1(2026-10-25)
66
87
 
67
- 兼容 0.4.0;语法仍为 `local-draft-2`,组块协议为 `component-protocol-1`,主题协议为 `reactive-md-theme-1`。见[0.4.1 发布说明](docs/release-0.4.1-ch.md)。
88
+ 兼容 0.4.0;语法仍为 `local-draft-2`,组块协议为 `component-protocol-1`,主题协议为 `reactive-md-theme-1`。见[0.4.1 发布说明](docs/releases/release-0.4.1-ch.md)。
68
89
 
69
90
  ### 调整
70
91
 
@@ -81,7 +102,7 @@
81
102
 
82
103
  ## 0.4.0(2026-10-24,next 渠道)
83
104
 
84
- `0.4.0` 是同时提供于 `latest` 和 `next` 渠道的 0.x 预览版,语法修订为 `local-draft-2`,从 `0.3.1` / `local-draft-1` 升级;包版本、语法修订、`component-protocol-1` 组块协议和 `reactive-md-theme-1` 主题协议是彼此独立的版本轴。完整升级清单见[0.4.0 发布与迁移](docs/release-0.4.0-ch.md)。
105
+ `0.4.0` 是同时提供于 `latest` 和 `next` 渠道的 0.x 预览版,语法修订为 `local-draft-2`,从 `0.3.1` / `local-draft-1` 升级;包版本、语法修订、`component-protocol-1` 组块协议和 `reactive-md-theme-1` 主题协议是彼此独立的版本轴。完整升级清单见[0.4.0 发布与迁移](docs/releases/release-0.4.0-ch.md)。
85
106
 
86
107
  ### 修复
87
108
 
@@ -94,19 +115,19 @@
94
115
  - 新增按依赖更新的渲染优化,浏览器等价检查覆盖参数更新、重置、可视化选择和语言切换。
95
116
  - 新增 `npm run verify:release` 与对应 CI 分片,覆盖组合文档和仓库外的真实 tarball 消费;保留经过验证的安装包、SHA256 与 npm integrity 记录。
96
117
  - 新增跨字段 `<validation>` 规则、关联的可访问提示及 `runtime.validate()`;`alert` 和 `badge` 支持按条件选择现有 `tone` 枚举。
97
- - 新增同类型字符串/数字数组字面量、数组索引、`sum`、`average`、`minOf`、`maxOf`,以及带稳定行键和数量预算的 `<data-table>`/`<column>`。见[条件、校验与本地集合](docs/constraints-collections-ch.md)。`LocalValueKind` 增加 `number-array`,新增聚合函数名成为保留字。
118
+ - 新增同类型字符串/数字数组字面量、数组索引、`sum`、`average`、`minOf`、`maxOf`,以及带稳定行键和数量预算的 `<data-table>`/`<column>`。见[条件、校验与本地集合](docs/reference/constraints-collections-ch.md)。`LocalValueKind` 增加 `number-array`,新增聚合函数名成为保留字。
98
119
 
99
120
  - 新增不可见、只读的 `<computed>` 与 `<const>` 声明,支持依赖排序、类型推断、循环检测和各运行时独立的计算缓存。正文、条件、公式与图表可共享中间结果。
100
- - 新增数字、百分比、科学计数法与货币格式化,常用字符串函数及 UTC 日期比较、日期差。默认值、舍入、空值和地区规则见[复用计算与格式化数值](docs/computations-formatting-ch.md)。新函数名成为保留字;升级到本版本前需重命名同名旧绑定。
121
+ - 新增数字、百分比、科学计数法与货币格式化,常用字符串函数及 UTC 日期比较、日期差。默认值、舍入、空值和地区规则见[复用计算与格式化数值](docs/reference/computations-formatting-ch.md)。新函数名成为保留字;升级到本版本前需重命名同名旧绑定。
101
122
 
102
- - 新增可选的 `<!-- reactive-md: local-draft-2 -->` 源码修订指令。显式旧修订、未知、格式错误、重复或位置错误的声明会以 `local.version.*` 诊断拒绝,不创建运行时;无指令源码保持当前修订行为。早于该指令的读者会忽略它。见[源码修订与迁移](docs/source-versioning-ch.md)。
123
+ - 新增可选的 `<!-- reactive-md: local-draft-2 -->` 源码修订指令。显式旧修订、未知、格式错误、重复或位置错误的声明会以 `local.version.*` 诊断拒绝,不创建运行时;无指令源码保持当前修订行为。早于该指令的读者会忽略它。见[源码修订与迁移](docs/compatibility/source-versioning-ch.md)。
103
124
  - 新增 `inspectLocalSourceVersion`、`checkLocalUpgrade`、`migrateLocalSource`,以及带 `--from`、`--check`、`--json`、`-o/--output`、`--accept-semantic-changes` 和 `--locale` 的 `reactive-md migrate`。迁移只改指令,保留正文原始字节、BOM 和 CRLF,幂等;阻止保留绑定、新增可识别标签、编译错误和文本长度语义变化,且从不改写状态文件。
104
125
 
105
126
  - 增加统一的中英文诊断模板,同一 minor 系列内保持现有诊断码含义稳定。Playground、React 渲染器与 `lint --locale en|zh` 按语言显示诊断,保留机器字段。
106
- - 文本控件长度约束改为按 Unicode 码点计数,与字符串 `len()` 一致;源码定位和资源预算继续使用 UTF-16。原先因 emoji 占用两个代码单元而被拒绝的值,现在可满足对应码点上限。详见[诊断与计数规则](docs/diagnostics-counting-ch.md)。
127
+ - 文本控件长度约束改为按 Unicode 码点计数,与字符串 `len()` 一致;源码定位和资源预算继续使用 UTF-16。原先因 emoji 占用两个代码单元而被拒绝的值,现在可满足对应码点上限。详见[诊断与计数规则](docs/reference/diagnostics-counting-ch.md)。
107
128
 
108
- - 增加文档开头的 `<theme name="…">` 声明、宿主主题登记和 `reactive-md-theme-1` 主题协议。两个 React 组件支持独立深浅模式和系统偏好;现有外观保留为 `default`。见[主题协议](docs/theme-protocol-ch.md)。
109
- - 新增可分享单文件 HTML 导出:`reactive-md build`/`lint` CLI、交互与静态模式、静态首屏水合、可打印的当前值、版本化 `reactive-md-state/v1` 状态文件、经过校验的本地位图内联、standalone `ReactiveMD.mount`/`mountAll` IIFE 和 `<reactive-md-doc>`。见[可分享文档与静态导出](docs/shareable-export-ch.md)。
129
+ - 增加文档开头的 `<theme name="…">` 声明、宿主主题登记和 `reactive-md-theme-1` 主题协议。两个 React 组件支持独立深浅模式和系统偏好;现有外观保留为 `default`。见[主题协议](docs/reference/theme-protocol-ch.md)。
130
+ - 新增可分享单文件 HTML 导出:`reactive-md build`/`lint` CLI、交互与静态模式、静态首屏水合、可打印的当前值、版本化 `reactive-md-state/v1` 状态文件、经过校验的本地位图内联、standalone `ReactiveMD.mount`/`mountAll` IIFE 和 `<reactive-md-doc>`。见[可分享文档与静态导出](docs/integration/shareable-export-ch.md)。
110
131
  - 新增宿主状态 API:`LocalRuntime` 可按名称访问公开参数(`parameterNames`、`getParameter`、`getParameters`、`setParameter`、`setParameters`),并提供 `exportLocalState`/`importLocalState` 读写 `reactive-md-state/v1` 状态文件。写入先统一校验再一次性提交,失败时不改变状态。
111
132
  - 新增源码变更时的参数保留工具:`planLocalStateRetention` 和 `applyLocalStateRetention` 仅保留类型与初始定义未变、绑定可安全保留的公开参数;匿名 `@` 绑定、计时器和位置清单会被丢弃,被拒绝的值会记录原因。
112
133
  - 新增可选的后台编译适配器:`LocalCompileScheduler` 提供 150 ms 防抖、一个进行中任务加最新源码、永久回退到主线程 `compileLocal`,并新增 `startLocalCompileWorker`;回退失败使用 `local.worker.compile` 诊断码。
@@ -116,7 +137,7 @@
116
137
  - 新增文档跳转与锚点、正文颜色、多选、区间与二维坐标输入、练习题及分步阅读。
117
138
  - 清单勾选后划线,新增组件主色及表格/图表稳定标识的共享选择。
118
139
  - runtime.get/set 支持可选槽位,新增原子 setMany;新增槽位绑定为独占。
119
- - 新增双语功能馆及编辑器插入模板。见[迁移说明](docs/local-components-v2-ch.md)。预览版发布在 `next` 渠道。
140
+ - 新增双语功能馆及编辑器插入模板。见[迁移说明](docs/reference/local-components-v2-ch.md)。预览版发布在 `next` 渠道。
120
141
 
121
142
  - Playground 新增中英文切换,界面、示例、指南和内置控件文案会同步切换,选择保存在浏览器中。
122
143
  - `LocalDocumentView` 和 `LocalReactiveDocument` 支持 `locale: 'en' | 'zh'`(默认 `'en'`),用于内置 UI 文案。显示用编译与运行时诊断通过中英文共享目录本地化,回调仍收到带稳定机器字段的结构化诊断。
@@ -155,7 +176,7 @@
155
176
  ### 兼容性
156
177
 
157
178
  - 首次预览,没有已发布的 npm 版本可供升级。
158
- - 旧版 directive、YAML `state`/`data`/`computed`/`actions` 和事件属性不属于 `local-draft-1`;迁移方式见[版本与兼容性](docs/compatibility-ch.md)。
179
+ - 旧版 directive、YAML `state`/`data`/`computed`/`actions` 和事件属性不属于 `local-draft-1`;迁移方式见[版本与兼容性](docs/compatibility/compatibility-ch.md)。
159
180
  - 持久化原始 `.reactive.md` 源码,不持久化 `LocalDocument`、节点 ID 或运行时状态。
160
181
  - 诊断的 `line`、`column` 和 `range` 可用于程序定位;`code` 在 0.x 中不承诺跨版本稳定;`message` 是显示文本,不保证稳定。
161
182
 
package/CHANGELOG.md CHANGED
@@ -1,21 +1,42 @@
1
1
  # Changelog
2
2
 
3
- ## 0.5.3 (2026-10-26, next channel)
4
-
5
- See [0.5.3 release notes](docs/release-0.5.3-en.md). Syntax and protocol revisions are unchanged.
6
-
7
- - Add opt-in `markdownBreaks` across compilation, rendering, workers and cache keys while preserving source ranges.
8
- - Add an unstyled React entry, screen CSS and optional print CSS; remove global `@page` from screen styles.
9
- - Export `localCompileOptionsKey` and `LocalRenderContext`, and add the React-free `reactive-md/authoring` entry.
10
- - Accept preview compile options in analysis, completion, rename and formatting.
11
- - Report source-ranged diagnostics when display math falls back for unsupported commands, environments or budgets.
3
+ ## 0.6.0 (2026-10-27, latest and next channels)
12
4
 
5
+ See [0.6.0 release notes](docs/releases/release-0.6.0-en.md). Syntax revision `local-draft-2`, component protocol `component-protocol-2` and theme protocol `reactive-md-theme-1` are unchanged.
13
6
 
14
- This file records user-visible changes. The project is in a 0.x preview; version and migration rules are in [Versions and compatibility](docs/compatibility-en.md).
7
+ ### Added
8
+
9
+ - Add native HTML tables to the default P0 HTML path, including `caption`, `colgroup`, `colspan`, `rowspan`, `scope`, `headers` and shared table styling. No extended HTML switch is needed.
10
+ - Add static `align` on `div`, `p` and headings, and `target`/`rel` on links with safe handling for `_blank`.
11
+ - Add `\(...\)` and `\[...\]` math delimiters, the `aligned`, `align`, `align*`, `pmatrix`, `bmatrix` and `vmatrix` environments, `\tag`, additional alphabets, arrows, delimiter sizes and functions, and mhchem `\ce{...}`.
12
+ - Add `cattca`, `mermaid` and `vue` fenced-code highlighting.
13
+ - Lay out node/edge diagrams with ELK layered routing while keeping the deterministic synchronous first paint.
14
+ - Add `insertText(text)` to the editor ref handle.
15
+
16
+ ### Changed
17
+
18
+ - Return only plain objects and arrays from `compileLocal` so results can cross a React Server Components boundary.
19
+ - Clamp tooltips to the viewport, reposition them on scroll, resize and content changes, and follow document themes.
20
+ - Use `aria-required` and local validation instead of the native `required` attribute so required controls do not block host form submission.
21
+ - Unparseable native HTML now falls back to inert source instead of failing the document; add `local.html.fallback` and `local.html.fallbackAttribute` warnings.
22
+ - Add two bundled dependencies, `elkjs` and `mhchemparser`, and update `THIRD_PARTY_NOTICES.md`.
23
+
24
+ ## 0.5.3 (2026-10-26, next channel)
25
+
26
+ See [0.5.3 release notes](docs/releases/release-0.5.3-en.md). Syntax and protocol revisions are unchanged.
27
+
28
+ - Add opt-in `markdownBreaks` across compilation, rendering, workers and cache keys while preserving source ranges.
29
+ - Add an unstyled React entry, screen CSS and optional print CSS; remove global `@page` from screen styles.
30
+ - Export `localCompileOptionsKey` and `LocalRenderContext`, and add the React-free `reactive-md/authoring` entry.
31
+ - Accept preview compile options in analysis, completion, rename and formatting.
32
+ - Report source-ranged diagnostics when display math falls back for unsupported commands, environments or budgets.
33
+
34
+
35
+ This file records user-visible changes. The project is in a 0.x preview; version and migration rules are in [Versions and compatibility](docs/compatibility/compatibility-en.md).
15
36
 
16
37
  ## 0.5.2 (2026-10-26, next channel)
17
38
 
18
- Compatible with 0.5.1. Syntax remains `local-draft-2`, the component protocol is `component-protocol-2` and the theme protocol is `reactive-md-theme-1`. See [0.5.2 release notes](docs/release-0.5.2-en.md).
39
+ Compatible with 0.5.1. Syntax remains `local-draft-2`, the component protocol is `component-protocol-2` and the theme protocol is `reactive-md-theme-1`. See [0.5.2 release notes](docs/releases/release-0.5.2-en.md).
19
40
 
20
41
  ### Added
21
42
 
@@ -33,12 +54,12 @@ Compatible with 0.5.1. Syntax remains `local-draft-2`, the component protocol is
33
54
 
34
55
  ## 0.5.1 (2026-10-25, next channel)
35
56
 
36
- Compatible with 0.5.0. Syntax remains `local-draft-2`, with `component-protocol-1` and `reactive-md-theme-1`. See [0.5.1 release notes](docs/release-0.5.1-en.md).
57
+ Compatible with 0.5.0. Syntax remains `local-draft-2`, with `component-protocol-1` and `reactive-md-theme-1`. See [0.5.1 release notes](docs/releases/release-0.5.1-en.md).
37
58
 
38
59
  ### Added
39
60
 
40
61
  - Add P0 HTML compatibility to the default ReactiveMD rendering path, including rich disclosures, containers, headings, code, lists, links and images.
41
- - Add host-owned `enableCss`, `enableJavaScript` and `enableExtendedHtml` options, all off by default. Any enabled option routes the entire document to isolated native HTML. This temporary routing policy disables Markdown and ReactiveMD interpretation in that path; see [HTML compatibility](docs/html-compatibility-en.md).
62
+ - Add host-owned `enableCss`, `enableJavaScript` and `enableExtendedHtml` options, all off by default. Any enabled option routes the entire document to isolated native HTML. This temporary routing policy disables Markdown and ReactiveMD interpretation in that path; see [HTML compatibility](docs/reference/html-compatibility-en.md).
42
63
  - Add localized Demo controls and preserve HTML mode in export. Static export disables author JavaScript.
43
64
  - Add a built-in editor status bar with Unicode character count, a keyboard hint and Edit, Split and Preview views. The host supplies preview content. View changes keep the source selection, undo history and preview state.
44
65
  - Narrow editor containers offer only Edit and Preview, and source-only editors keep the count and keyboard hint.
@@ -49,7 +70,7 @@ Compatible with 0.5.0. Syntax remains `local-draft-2`, with `component-protocol-
49
70
 
50
71
  ## 0.5.0 (2026-10-25, next channel)
51
72
 
52
- Compatible with 0.4.1. Syntax remains `local-draft-2`, with `component-protocol-1` and `reactive-md-theme-1`. Existing `reactive-md`, `reactive-md/react` and `reactive-md/styles.css` imports are unchanged, and the renderer entry keeps its API. See [0.5.0 release notes](docs/release-0.5.0-en.md).
73
+ Compatible with 0.4.1. Syntax remains `local-draft-2`, with `component-protocol-1` and `reactive-md-theme-1`. Existing `reactive-md`, `reactive-md/react` and `reactive-md/styles.css` imports are unchanged, and the renderer entry keeps its API. See [0.5.0 release notes](docs/releases/release-0.5.0-en.md).
53
74
 
54
75
  ### Added
55
76
 
@@ -64,7 +85,7 @@ Compatible with 0.4.1. Syntax remains `local-draft-2`, with `component-protocol-
64
85
 
65
86
  ## 0.4.1 (2026-10-25)
66
87
 
67
- Compatible with 0.4.0; syntax remains `local-draft-2`, with `component-protocol-1` and `reactive-md-theme-1`. See [0.4.1 release notes](docs/release-0.4.1-en.md).
88
+ Compatible with 0.4.0; syntax remains `local-draft-2`, with `component-protocol-1` and `reactive-md-theme-1`. See [0.4.1 release notes](docs/releases/release-0.4.1-en.md).
68
89
 
69
90
  ### Changed
70
91
 
@@ -81,7 +102,7 @@ Compatible with 0.4.0; syntax remains `local-draft-2`, with `component-protocol-
81
102
 
82
103
  ## 0.4.0 (2026-10-24, next channel)
83
104
 
84
- `0.4.0` is a 0.x preview available on both `latest` and `next`. It uses syntax revision `local-draft-2` and upgrades from `0.3.1` / `local-draft-1`; the package version, syntax revision, `component-protocol-1` component protocol and `reactive-md-theme-1` theme protocol are independent version axes. See [0.4.0 release and migration](docs/release-0.4.0-en.md) for the complete upgrade checklist.
105
+ `0.4.0` is a 0.x preview available on both `latest` and `next`. It uses syntax revision `local-draft-2` and upgrades from `0.3.1` / `local-draft-1`; the package version, syntax revision, `component-protocol-1` component protocol and `reactive-md-theme-1` theme protocol are independent version axes. See [0.4.0 release and migration](docs/releases/release-0.4.0-en.md) for the complete upgrade checklist.
85
106
 
86
107
  ### Fixed
87
108
 
@@ -94,19 +115,19 @@ Compatible with 0.4.0; syntax remains `local-draft-2`, with `component-protocol-
94
115
  - Add dependency-aware rendering with browser equivalence checks for updates, resets, visual selections and locale changes.
95
116
  - Add `npm run verify:release` and matching CI shards, including combined-feature documents and actual tarball consumers outside the repository. Retain the verified archive with SHA256 and npm integrity records.
96
117
  - Add advisory cross-field `<validation>` rules with associated accessible hints and `runtime.validate()`. `alert` and `badge` accept conditional values from their existing tone enums.
97
- - Add homogeneous string/numeric array literals, array indexing, `sum`, `average`, `minOf` and `maxOf`, plus `<data-table>`/`<column>` for bounded local row generation with stable keys. See [constraints and collections](docs/constraints-collections-en.md). `LocalValueKind` gains `number-array`; aggregate names become reserved identifiers.
118
+ - Add homogeneous string/numeric array literals, array indexing, `sum`, `average`, `minOf` and `maxOf`, plus `<data-table>`/`<column>` for bounded local row generation with stable keys. See [constraints and collections](docs/reference/constraints-collections-en.md). `LocalValueKind` gains `number-array`; aggregate names become reserved identifiers.
98
119
 
99
120
  - Add invisible, read-only `<computed>` and `<const>` declarations with dependency ordering, inferred types, cycle detection and per-runtime calculation caching. Prose, conditions, formulas and charts can share intermediate results.
100
- - Add number, percentage, scientific and currency formatting, common string functions and UTC date comparison/differences. Defaults, rounding, nulls and accepted regions are specified in [Reusing calculations and formatting values](docs/computations-formatting-en.md). New function names are reserved; rename any existing bindings with those names before upgrading to this release.
121
+ - Add number, percentage, scientific and currency formatting, common string functions and UTC date comparison/differences. Defaults, rounding, nulls and accepted regions are specified in [Reusing calculations and formatting values](docs/reference/computations-formatting-en.md). New function names are reserved; rename any existing bindings with those names before upgrading to this release.
101
122
 
102
- - Add an optional `<!-- reactive-md: local-draft-2 -->` source revision directive. Explicit older, unknown, malformed, duplicate or misplaced revisions fail with `local.version.*` diagnostics and create no runtime; unversioned source keeps current-revision behavior. Readers built before the directive ignore it. See [Source revisions and migration](docs/source-versioning-en.md).
123
+ - Add an optional `<!-- reactive-md: local-draft-2 -->` source revision directive. Explicit older, unknown, malformed, duplicate or misplaced revisions fail with `local.version.*` diagnostics and create no runtime; unversioned source keeps current-revision behavior. Readers built before the directive ignore it. See [Source revisions and migration](docs/compatibility/source-versioning-en.md).
103
124
  - Add `inspectLocalSourceVersion`, `checkLocalUpgrade` and `migrateLocalSource`, plus `reactive-md migrate` with `--from`, `--check`, `--json`, `-o/--output`, `--accept-semantic-changes` and `--locale`. Migration changes only the directive, preserves body bytes, BOM and CRLF, is idempotent, blocks reserved bindings, newly recognized tags, compile errors and text-length semantic changes, and never rewrites state files.
104
125
 
105
126
  - Add a shared English/Chinese diagnostic catalogue and stable code meanings within a minor series. The Playground, React renderer and `lint --locale en|zh` localize displayed diagnostics while preserving machine fields.
106
- - Make text-control length constraints count Unicode code points, matching string `len()`. Source positions and resource budgets keep UTF-16 units. Existing emoji values may now satisfy limits that previously rejected them. See [Diagnostics and counting rules](docs/diagnostics-counting-en.md).
127
+ - Make text-control length constraints count Unicode code points, matching string `len()`. Source positions and resource budgets keep UTF-16 units. Existing emoji values may now satisfy limits that previously rejected them. See [Diagnostics and counting rules](docs/reference/diagnostics-counting-en.md).
107
128
 
108
- - Add leading `<theme name="…">` declarations, host theme registration and the `reactive-md-theme-1` protocol. Both React components support independent color schemes and system preferences; `default` preserves the existing design. See the [theme protocol](docs/theme-protocol-en.md).
109
- - Add shareable single-file HTML export: the `reactive-md build` and `reactive-md lint` CLI, interactive and static modes, static-first hydration, printable current values, versioned `reactive-md-state/v1` files, verified local raster inlining, the standalone `ReactiveMD.mount`/`mountAll` IIFE and `<reactive-md-doc>`. See [Shareable documents and static export](docs/shareable-export-en.md).
129
+ - Add leading `<theme name="…">` declarations, host theme registration and the `reactive-md-theme-1` protocol. Both React components support independent color schemes and system preferences; `default` preserves the existing design. See the [theme protocol](docs/reference/theme-protocol-en.md).
130
+ - Add shareable single-file HTML export: the `reactive-md build` and `reactive-md lint` CLI, interactive and static modes, static-first hydration, printable current values, versioned `reactive-md-state/v1` files, verified local raster inlining, the standalone `ReactiveMD.mount`/`mountAll` IIFE and `<reactive-md-doc>`. See [Shareable documents and static export](docs/integration/shareable-export-en.md).
110
131
  - Add host state APIs: name-based public parameter access on `LocalRuntime` (`parameterNames`, `getParameter`, `getParameters`, `setParameter`, `setParameters`) and `exportLocalState`/`importLocalState` for `reactive-md-state/v1` files. Writes validate before a single commit and leave state unchanged on failure.
111
132
  - Add retention helpers for source changes: `planLocalStateRetention` and `applyLocalStateRetention` keep only public parameters whose type and initial definition are unchanged and whose bindings are safely retainable; anonymous `@` bindings, timers and positional checklists are dropped, and rejected values are reported with a reason.
112
133
  - Add an optional background compile adapter: `LocalCompileScheduler` with a 150 ms debounce, one in-flight job plus the latest source, a permanent main-thread `compileLocal` fallback, and `startLocalCompileWorker`; fallback failures use the `local.worker.compile` diagnostic code.
@@ -116,7 +137,7 @@ Compatible with 0.4.0; syntax remains `local-draft-2`, with `component-protocol-
116
137
  - Add document jumps/anchors, text/section color, multiple selection, interval and coordinate inputs, practice questions and guided steps.
117
138
  - Add checked-item strike-through, component accent colors and stable shared table/chart selection.
118
139
  - Extend runtime get/set with optional slots and add atomic setMany. New slot bindings are exclusive.
119
- - Add a bilingual feature tour and editor insertion templates. See [migration](docs/local-components-v2-en.md). The preview is published on the `next` channel.
140
+ - Add a bilingual feature tour and editor insertion templates. See [migration](docs/reference/local-components-v2-en.md). The preview is published on the `next` channel.
120
141
 
121
142
  - The Playground adds a Chinese/English toggle that localizes the interface, examples, guide and built-in control labels, and saves the choice in the browser.
122
143
  - `LocalDocumentView` and `LocalReactiveDocument` accept `locale: 'en' | 'zh'` (default `'en'`) for built-in UI labels. Displayed compile and runtime diagnostics use the shared English/Chinese catalogue; callbacks still receive structured diagnostics with stable machine fields.
@@ -155,7 +176,7 @@ The first public preview, with syntax revision `local-draft-1`. Install: `npm in
155
176
  ### Compatibility
156
177
 
157
178
  - First preview; there is no published npm version to upgrade from.
158
- - Legacy directives and YAML `state`/`data`/`computed`/`actions` and event attributes are not part of `local-draft-1`; see [Versions and compatibility](docs/compatibility-en.md) for migration.
179
+ - Legacy directives and YAML `state`/`data`/`computed`/`actions` and event attributes are not part of `local-draft-1`; see [Versions and compatibility](docs/compatibility/compatibility-en.md) for migration.
159
180
  - Persist the original `.reactive.md` source; do not persist `LocalDocument`, node IDs or runtime state.
160
181
  - Diagnostic `line`, `column` and `range` can be used for programmatic location; `code` is not promised to be stable across versions in 0.x; `message` is display text and not guaranteed stable.
161
182
 
@@ -1,8 +1,8 @@
1
1
  # 贡献指南
2
2
 
3
- Reactive MD 是 `local-draft-2` 的 0.x 预览实现。贡献可以包括语法、编译器、运行时、React 渲染器、文档、示例和 Demo。开始前先读[版本与兼容性](docs/compatibility-ch.md)和[本地交互语法规范](docs/local-interaction-syntax-ch.md)。
3
+ Reactive MD 是 `local-draft-2` 的 0.x 预览实现。贡献可以包括语法、编译器、运行时、React 渲染器、文档、示例和 Demo。开始前先读[版本与兼容性](docs/compatibility/compatibility-ch.md)和[本地交互语法规范](docs/reference/local-interaction-syntax-ch.md)。
4
4
 
5
- 新增或修改组块时,按[组块协议](docs/component-protocol-ch.md)明确行为,使用[开发指南中的提案模板](docs/component-development-ch.md)记录声明、兼容性和验收证据。这里的组块包括控件、容器、可视化和结构子项。
5
+ 新增或修改组块时,按[组块协议](docs/development/component-protocol-ch.md)明确行为,使用[开发指南中的提案模板](docs/development/component-development-ch.md)记录声明、兼容性和验收证据。这里的组块包括控件、容器、可视化和结构子项。
6
6
 
7
7
  ## 环境
8
8
 
@@ -28,12 +28,17 @@ npm run verify:release
28
28
  | `npm run benchmark` | Node 编译、运行时和绘图性能;报告写入 `artifacts/benchmark.json` |
29
29
  | `npm run test:docs` | 文档相对链接和标题锚点 |
30
30
  | `npm run build:demo`、`npm run test:demo` | Demo 构建与示例索引 |
31
+ | `npm run test:browser:core` | Firefox 与 WebKit 在 1280px、375px 下的核心流程;使用已构建 Demo,并自行管理预览服务 |
31
32
  | `npm run verify:release` | 完整发布门禁:核心与 Demo 测试、类型、第三方声明、包与文档检查、仓库外真实 tarball 消费,以及计算、集合、作者工具、状态恢复、HTML 导出和渲染等价的浏览器检查。自行管理预览服务生命周期 |
32
33
 
33
34
  CI 通过 `npm run verify:release:node` 和 `npm run verify:release:browser` 分片运行同一门禁。汇总与逐步日志写入 `artifacts/release-verification.json` 和 `artifacts/release-verification/`;经过验证的原始 tarball 及 SHA256 记录保留在 `artifacts/release-package/`。本机需已安装浏览器,门禁不会自动安装。
34
35
 
35
36
  浏览器检查需要先启动 Demo,并准备本机浏览器。完整门禁会自行管理这些依赖;单独运行浏览器脚本时,默认地址是 `http://127.0.0.1:5173`,可用 `DEMO_URL` 指向其他地址。报告写入 `demo/artifacts/`。本地默认使用 Edge,CI 在 Linux 上使用 Playwright 的 Chromium(`PLAYWRIGHT_CHANNEL=chromium`)。
36
37
 
38
+ 浏览器发布门禁保留 Chromium 完整验证,并增加 Playwright Firefox、WebKit 的核心流程。通过 `npm exec --workspace=@reactive-md/demo -- playwright install firefox webkit` 安装匹配的运行时;CI 使用 `--with-deps` 安装三个引擎。先运行 `npm run build:demo`,再运行 `npm run test:browser:core`;也可用 `node scripts/verify-browser-core.mjs --browser=webkit` 选择单个引擎,或用 `DEMO_URL` 复用已有服务。报告、截图与下载的 HTML 按引擎写入 `artifacts/browser-core/`。缺少浏览器或检查失败时,命令会失败。
39
+
40
+ 核心流程覆盖示例、控件与计算、条件、日期、表格、图表、图解、编辑与诊断、个人文档保存与副本、语言切换、指南代码块主题、键盘菜单,以及 Markdown 和交互 HTML 下载。导出的 HTML 从磁盘重新打开,在阻止外部请求的条件下验证交互。WebKit 引擎检查不等同于 Apple 设备上的 Safari 实机测试。
41
+
37
42
  ```sh
38
43
  npm run dev
39
44
  # 另一个终端
@@ -42,12 +47,12 @@ npm run test:browser
42
47
 
43
48
  修改语言包后重新运行 `npm run build:lib`,或使用 `npm run dev:lib` 监听重建。
44
49
 
45
- 性能测量条件与当前基线见[性能说明](docs/performance-ch.md),跨实现可复用的输入与预期结果见[语言验收数据](examples/conformance/README.md)。
50
+ 性能测量条件与当前基线见[性能说明](docs/development/performance-ch.md),跨实现可复用的输入与预期结果见[语言验收数据](examples/conformance/README.md)。
46
51
 
47
52
  ## 改动要求
48
53
 
49
54
  - 保持改动聚焦。行为变化附带测试;用户可见变化更新文档和相关示例。
50
- - 语法或公开 API 的破坏性变化先更新[版本与兼容性](docs/compatibility-ch.md)和[变更记录](CHANGELOG-ch.md),说明旧写法、新写法和迁移方式。不要在没有语法修订的情况下悄悄改变作者语法。
55
+ - 语法或公开 API 的破坏性变化先更新[版本与兼容性](docs/compatibility/compatibility-ch.md)和[变更记录](CHANGELOG-ch.md),说明旧写法、新写法和迁移方式。不要在没有语法修订的情况下悄悄改变作者语法。
51
56
  - 新组件或新属性必须同时实现编译校验、运行时约束、渲染、可访问名称和资源边界。不要只加展示样式。
52
57
  - 组块提案须给出属性与子内容声明、状态与生命周期规则、诊断、资源预算、兼容分类和对应验收结果;参考 `slider`、`tabs`、`plot` 的[协议验收数据](examples/conformance/README.md)。协议修订不自动改变包版本、语法修订或公开 API。
53
58
  - 资源上限集中在 `src/local/limits.ts`;新增无界输入、循环、递归或绘图计算时,先定义预算。
@@ -59,4 +64,4 @@ npm run test:browser
59
64
 
60
65
  - PR 说明写清目的、受影响范围和验证命令及结果。没有运行的检查要明确写出,不要写成已通过。
61
66
  - 涉及安全的问题不要开公开 issue,按[安全策略](SECURITY-ch.md)处理。
62
- - 发布是维护者的手工流程,见[发布清单](docs/releasing-ch.md)。贡献者不需要接触 npm 凭据。
67
+ - 发布是维护者的手工流程,见[发布清单](docs/development/releasing-ch.md)。贡献者不需要接触 npm 凭据。
package/CONTRIBUTING.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Contributing
2
2
 
3
- Reactive MD is a 0.x preview implementation of `local-draft-2`. Contributions can cover syntax, the compiler, the runtime, the React renderer, documentation, examples and the demo. Before starting, read [Versions and compatibility](docs/compatibility-en.md) and the [local interaction syntax specification](docs/local-interaction-syntax-en.md).
3
+ Reactive MD is a 0.x preview implementation of `local-draft-2`. Contributions can cover syntax, the compiler, the runtime, the React renderer, documentation, examples and the demo. Before starting, read [Versions and compatibility](docs/compatibility/compatibility-en.md) and the [local interaction syntax specification](docs/reference/local-interaction-syntax-en.md).
4
4
 
5
- When adding or changing a component, define its behavior according to the [component protocol](docs/component-protocol-en.md), and use the [proposal template in the development guide](docs/component-development-en.md) to record declarations, compatibility and acceptance evidence. Components here include input controls, containers, visualizations and structural children.
5
+ When adding or changing a component, define its behavior according to the [component protocol](docs/development/component-protocol-en.md), and use the [proposal template in the development guide](docs/development/component-development-en.md) to record declarations, compatibility and acceptance evidence. Components here include input controls, containers, visualizations and structural children.
6
6
 
7
7
  ## Environment
8
8
 
@@ -30,12 +30,17 @@ npm run verify:release
30
30
  | `npm run benchmark` | Node compile, runtime and plotting performance; the report is written to `artifacts/benchmark.json` |
31
31
  | `npm run test:docs` | Documentation relative links and heading anchors |
32
32
  | `npm run build:demo`, `npm run test:demo` | Demo build and example index |
33
+ | `npm run test:browser:core` | Firefox and WebKit core workflows at 1280px and 375px; uses the built demo and manages its preview server |
33
34
  | `npm run verify:release` | Complete release gate: core and demo tests, types, notices, package and documentation checks, packed consumption outside the repository, and browser checks for calculations, collections, authoring, state restoration, HTML export and rendering equivalence. It manages the preview server lifecycle |
34
35
 
35
36
  CI uses `npm run verify:release:node` and `npm run verify:release:browser` to split the same gate. Reports and step logs go to `artifacts/release-verification.json` and `artifacts/release-verification/`; the exact verified tarball and its SHA256 record go to `artifacts/release-package/`. A local browser must already be installed; the gate does not install one.
36
37
 
37
38
  Browser checks require the demo to be running and a local browser available. The complete gate manages those dependencies itself; when running individual browser scripts, the default address is `http://127.0.0.1:5173` and `DEMO_URL` can point at another address. Reports are written to `demo/artifacts/`. Local runs use Edge by default; CI uses Playwright Chromium on Linux (`PLAYWRIGHT_CHANNEL=chromium`).
38
39
 
40
+ The browser release gate keeps the full Chromium suite and adds core workflows in Playwright Firefox and WebKit. Install the matching runtimes with `npm exec --workspace=@reactive-md/demo -- playwright install firefox webkit` (CI installs all three engines with `--with-deps`). After `npm run build:demo`, run `npm run test:browser:core`, or select one engine with `node scripts/verify-browser-core.mjs --browser=webkit`. `DEMO_URL` can reuse an existing server. Reports, screenshots and downloaded HTML go to `artifacts/browser-core/`, grouped by engine. A missing browser or failed check makes the command fail.
41
+
42
+ The core gate covers examples, controls and calculations, conditions, dates, tables, charts, diagrams, editing and diagnostics, personal document persistence and copies, language switching, guide code themes, keyboard menus, and Markdown/interactive HTML downloads. Exported HTML is reopened from disk and exercised with external requests blocked. WebKit engine checks do not substitute for testing Safari on an Apple device.
43
+
39
44
  ```sh
40
45
  npm run dev
41
46
  # another terminal
@@ -44,12 +49,12 @@ npm run test:browser
44
49
 
45
50
  After changing the language package, rerun `npm run build:lib`, or use `npm run dev:lib` to watch and rebuild.
46
51
 
47
- Performance measurement conditions and current baselines are in [Performance measurements](docs/performance-en.md); reusable inputs and expected results across implementations are in the [language conformance data](examples/conformance/README.md).
52
+ Performance measurement conditions and current baselines are in [Performance measurements](docs/development/performance-en.md); reusable inputs and expected results across implementations are in the [language conformance data](examples/conformance/README.md).
48
53
 
49
54
  ## Change requirements
50
55
 
51
56
  - Keep changes focused. Add tests for behavior changes; update documentation and relevant examples for user-visible changes.
52
- - For breaking changes to syntax or the public API, first update [Versions and compatibility](docs/compatibility-en.md) and the [changelog](CHANGELOG.md), describing the old form, the new form and the migration path. Do not silently change author syntax without a syntax revision.
57
+ - For breaking changes to syntax or the public API, first update [Versions and compatibility](docs/compatibility/compatibility-en.md) and the [changelog](CHANGELOG.md), describing the old form, the new form and the migration path. Do not silently change author syntax without a syntax revision.
53
58
  - New components or attributes must implement compile validation, runtime constraints, rendering, accessible names and resource boundaries together. Do not add display styling only.
54
59
  - A component proposal must state attribute and child-content declarations, state and lifecycle rules, diagnostics, resource budgets, compatibility classification and corresponding acceptance results; see the [protocol acceptance data](examples/conformance/README.md) for `slider`, `tabs` and `plot`. A protocol revision does not automatically change the package version, syntax revision or public API.
55
60
  - Resource limits are centralized in `src/local/limits.ts`; when adding unbounded input, loops, recursion or plotting computation, define a budget first.
@@ -61,4 +66,4 @@ Performance measurement conditions and current baselines are in [Performance mea
61
66
 
62
67
  - Describe the purpose, affected scope, verification commands and results in the PR. State any checks you did not run explicitly instead of presenting them as passed.
63
68
  - Do not open a public issue for security matters; follow the [security policy](SECURITY.md).
64
- - Releases are a manual maintainer process; see the [release checklist](docs/releasing-en.md). Contributors do not need npm credentials.
69
+ - Releases are a manual maintainer process; see the [release checklist](docs/development/releasing-en.md). Contributors do not need npm credentials.
package/README-ch.md CHANGED
@@ -4,26 +4,28 @@
4
4
 
5
5
  用 Markdown 写本地交互文档。放入输入控件,用 `bind` 命名参数,用 `{{ 表达式 }}` 连接文字、公式、图表和图解。文档作者无需编写 JavaScript 或 CSS。
6
6
 
7
- 本地模式采用 HTML 风格标签,参数和表格数据直接写在正文中,LaTeX 公式可用于函数绘图。TypeScript 核心和 React 渲染器可独立集成。`0.5.3` 是面向 `next` 渠道的预览版,补齐宿主作者工具、编译选项与数学降级诊断;`latest` 仍为 `0.4.0`。语法修订继续为 `local-draft-2`,组块协议为 `component-protocol-2`。
7
+ 本地模式采用 HTML 风格标签,参数和表格数据直接写在正文中,LaTeX 公式可用于函数绘图。TypeScript 核心和 React 渲染器可独立集成。`0.6.0` 同时提供于 `latest` 与 `next` 渠道,新增原生 HTML 表格、扩展数学与代码高亮、分层图解和表单修复。语法修订继续为 `local-draft-2`,组块协议为 `component-protocol-2`。
8
8
 
9
9
  ## 从这里开始
10
10
 
11
- - [新用户入门指南](docs/local-guide-ch.md):从 Markdown 过渡到交互文档,含完整练习与错误速查。
12
- - [本地交互语法规范](docs/local-interaction-syntax-ch.md) · [功能演示与示例](examples/local/README.md):48 个标签名、标签、就地参数与 LaTeX 绘图。
13
- - [本地模式集成](docs/local-integration-ch.md):`compileLocal`、状态运行时、React 嵌入、URL 策略与样式作用域。
14
- - [HTML 部分兼容](docs/html-compatibility-ch.md):P0 HTML 与下个发行版针对作者 CSS、JavaScript 和扩展 HTML 的暂时性分流政策。
15
- - [可分享文档与静态导出](docs/shareable-export-ch.md):单文件交互 HTML、静态输出、版本化状态文件、图片资源、CLI 与独立浏览器 API。
16
- - [主题协议](docs/theme-protocol-ch.md):文档主题选择、自定义 CSS 与深浅模式。
17
- - [作者工具](docs/author-tools-ch.md):源码高亮、补全、绑定定位、重命名、格式化与命令行检查。
18
- - [React 源码编辑器](docs/editor-ch.md):受控编辑器、属性、ref 句柄、诊断、语言、主题与历史。
11
+ - [文档导航](docs/README.md):按入门、参考、集成、兼容、开发维护与发布记录查阅。
12
+ - [新用户入门指南](docs/guides/local-guide-ch.md):从 Markdown 过渡到交互文档,含完整练习与错误速查。
13
+ - [本地交互语法规范](docs/reference/local-interaction-syntax-ch.md) · [功能演示与示例](examples/local/README.md):48 个标签名、标签、就地参数与 LaTeX 绘图。
14
+ - [本地模式集成](docs/integration/local-integration-ch.md):`compileLocal`、状态运行时、React 嵌入、URL 策略与样式作用域。
15
+ - [HTML 部分兼容](docs/reference/html-compatibility-ch.md):P0 HTML 与下个发行版针对作者 CSS、JavaScript 和扩展 HTML 的暂时性分流政策。
16
+ - [可分享文档与静态导出](docs/integration/shareable-export-ch.md):单文件交互 HTML、静态输出、版本化状态文件、图片资源、CLI 与独立浏览器 API。
17
+ - [主题协议](docs/reference/theme-protocol-ch.md):文档主题选择、自定义 CSS 与深浅模式。
18
+ - [作者工具](docs/integration/author-tools-ch.md):源码高亮、补全、绑定定位、重命名、格式化与命令行检查。
19
+ - [React 源码编辑器](docs/integration/editor-ch.md):受控编辑器、属性、ref 句柄、诊断、语言、主题与历史。
19
20
  - [独立接入示例](examples/integration/README.md):可复制到仓库外运行的 Node 核心和 React 页面。
20
- - [版本与兼容性](docs/compatibility-ch.md):0.x 规则、迁移、诊断契约和平台范围。
21
- - [组块协议](docs/component-protocol-ch.md) · [组块开发指南](docs/component-development-ch.md):新增组件的声明、行为契约和兼容性验收。
22
- - [0.5.3 发布说明](docs/release-0.5.3-ch.md):宿主集成补丁与作者工具。
23
- - [0.5.1 发布说明](docs/release-0.5.1-ch.md):编辑器视图与主题,以及 HTML 兼容。
24
- - [0.5.0 发布说明](docs/release-0.5.0-ch.md):编辑器入口与文档渲染修复。
25
- - [0.4.1 发布说明](docs/release-0.4.1-ch.md):界面与交互修复,兼容 0.4.0。
26
- - [0.4.0 发布与迁移](docs/release-0.4.0-ch.md):本 minor 系列包含的能力,以及从 `0.3.1` / `local-draft-1` 升级的方法。
21
+ - [版本与兼容性](docs/compatibility/compatibility-ch.md):0.x 规则、迁移、诊断契约和平台范围。
22
+ - [组块协议](docs/development/component-protocol-ch.md) · [组块开发指南](docs/development/component-development-ch.md):新增组件的声明、行为契约和兼容性验收。
23
+ - [0.6.0 发布说明](docs/releases/release-0.6.0-ch.md):原生 HTML 表格、数学与代码高亮、分层图解和宿主修复。
24
+ - [0.5.3 发布说明](docs/releases/release-0.5.3-ch.md):宿主集成补丁与作者工具。
25
+ - [0.5.1 发布说明](docs/releases/release-0.5.1-ch.md):编辑器视图与主题,以及 HTML 兼容。
26
+ - [0.5.0 发布说明](docs/releases/release-0.5.0-ch.md):编辑器入口与文档渲染修复。
27
+ - [0.4.1 发布说明](docs/releases/release-0.4.1-ch.md):界面与交互修复,兼容 0.4.0。
28
+ - [0.4.0 发布与迁移](docs/releases/release-0.4.0-ch.md):本 minor 系列包含的能力,以及从 `0.3.1` / `local-draft-1` 升级的方法。
27
29
 
28
30
  ## 写一份文档
29
31
 
@@ -38,7 +40,7 @@
38
40
 
39
41
  输入立即更新结果,面板自带“恢复默认”。独立使用的计数器只需一行 `<counter label="人数">`。
40
42
 
41
- `0.4.0` 新增 `local-draft-2`、命名计算、校验、集合、主题和离线 HTML 导出;旧版 `0.3.1` 使用 `local-draft-1`。见[0.4.0 发布与迁移](docs/release-0.4.0-ch.md)。
43
+ `0.4.0` 新增 `local-draft-2`、命名计算、校验、集合、主题和离线 HTML 导出;旧版 `0.3.1` 使用 `local-draft-1`。见[0.4.0 发布与迁移](docs/releases/release-0.4.0-ch.md)。
42
44
 
43
45
  ## 安装
44
46
 
@@ -48,17 +50,17 @@
48
50
  npm install reactive-md
49
51
  ```
50
52
 
51
- `latest` 当前为 `0.4.0`。0.5.3 预览版面向 `next` 渠道:
53
+ `latest` 与 `next` 当前都指向 `0.6.0`:
52
54
 
53
55
  ```sh
54
- npm install reactive-md@next
55
- # 或固定预览版
56
- npm install reactive-md@0.5.3
56
+ npm install reactive-md
57
+ # 或固定版本
58
+ npm install reactive-md@0.6.0
57
59
  ```
58
60
 
59
- 使用预览版前请阅读[0.5.3 发布说明](docs/release-0.5.3-ch.md);从 `0.3.1` / `local-draft-1` 升级前请阅读[迁移说明](docs/release-0.4.0-ch.md)。
61
+ 本版本说明见[0.6.0 发布说明](docs/releases/release-0.6.0-ch.md);从 `0.3.1` / `local-draft-1` 升级前请阅读[迁移说明](docs/releases/release-0.4.0-ch.md)。
60
62
 
61
- `reactive-md` 入口提供本地编译器、表达式和运行时,`reactive-md/react` 提供 React 渲染器。组件样式通过 `reactive-md/styles.css` 引入。`reactive-md/editor` 提供源码编辑器,并使用独立样式 `reactive-md/editor/styles.css`。现有渲染器和样式导入在 0.5.3 中保持不变。
63
+ `reactive-md` 入口提供本地编译器、表达式和运行时,`reactive-md/react` 提供 React 渲染器。组件样式通过 `reactive-md/styles.css` 引入。`reactive-md/editor` 提供源码编辑器,并使用独立样式 `reactive-md/editor/styles.css`。现有渲染器和样式导入在 0.6.0 中保持不变。
62
64
 
63
65
  React 入口需要 React 19:
64
66
 
@@ -75,7 +77,7 @@ export function Article({ source }: { source: string }) {
75
77
  }
76
78
  ```
77
79
 
78
- `reactive-md` 核心入口不依赖 React。完整的编译与运行时 API、宿主 URL 策略、生命周期和样式覆盖见[本地模式集成](docs/local-integration-ch.md)。
80
+ `reactive-md` 核心入口不依赖 React。完整的编译与运行时 API、宿主 URL 策略、生命周期和样式覆盖见[本地模式集成](docs/integration/local-integration-ch.md)。
79
81
 
80
82
  ## 用 React 编辑源码
81
83
 
@@ -92,9 +94,9 @@ export function Editor() {
92
94
  }
93
95
  ```
94
96
 
95
- 编辑器处理高亮、格式与插入工具、补全、绑定工具、撤销重做及行号。它不编译、不渲染预览;源码由应用保存,并用 `reactive-md/react` 渲染。属性、ref 句柄、诊断、主题、语言和历史规则见 [React 源码编辑器](docs/editor-ch.md)。
97
+ 编辑器处理高亮、格式与插入工具、补全、绑定工具、撤销重做及行号。它不编译、不渲染预览;源码由应用保存,并用 `reactive-md/react` 渲染。属性、ref 句柄、诊断、主题、语言和历史规则见 [React 源码编辑器](docs/integration/editor-ch.md)。
96
98
 
97
- 0.x 次版本可能包含破坏性变更。升级前阅读[变更记录](CHANGELOG-ch.md)与[兼容规则](docs/compatibility-ch.md),并保存原始 `.reactive.md` 源码。
99
+ 0.x 次版本可能包含破坏性变更。升级前阅读[变更记录](CHANGELOG-ch.md)与[兼容规则](docs/compatibility/compatibility-ch.md),并保存原始 `.reactive.md` 源码。
98
100
 
99
101
  ## 分享文档
100
102
 
@@ -108,7 +110,7 @@ npx reactive-md build examples/local/counter.reactive.md -o counter-static.html
108
110
 
109
111
  交互文件内嵌原始源码、React 19、运行时、样式以及经过校验的本地图片。它先渲染静态首屏,因此禁用 JavaScript 时仍可阅读。使用 `--state-file doc.state.json` 导出已保存的 `reactive-md-state/v1` 基线;省略时使用作者初值,并把它作为读者的重置基线。Demo 导出对话框可以把当前预览参数保存成此类状态文件。
110
112
 
111
- 图片上限、CSP/安全、打印、退出码、`ReactiveMD.mount`/`mountAll` 与 `<reactive-md-doc>` 见[可分享文档与静态导出](docs/shareable-export-ch.md)。单文件导出的静态首屏水合由 Playwright Chromium 和本地 Edge 检查覆盖;Firefox、Safari/WebKit 与通用 SSR 水合仍未验证。
113
+ 图片上限、CSP/安全、打印、退出码、`ReactiveMD.mount`/`mountAll` 与 `<reactive-md-doc>` 见[可分享文档与静态导出](docs/integration/shareable-export-ch.md)。CI 在 Chromium 上运行完整浏览器门禁,并使用 Firefox 与 WebKit 运行核心工作流;本机浏览器检查使用 Microsoft Edge。Firefox 与 WebKit 的完整交互套件和通用 SSR 水合仍未验证。
112
114
 
113
115
  ## 体验 Demo
114
116
 
@@ -131,15 +133,15 @@ demo/ 独立的 Playground 应用
131
133
 
132
134
  ## 文档
133
135
 
134
- - [新用户入门指南](docs/local-guide-ch.md)与[本地交互语法规范](docs/local-interaction-syntax-ch.md)。
135
- - [本地模式集成](docs/local-integration-ch.md):核心与 React API、URL 策略、生命周期、样式和版本固定。
136
- - [可分享文档与静态导出](docs/shareable-export-ch.md):CLI build/lint、状态文件、本地图片内联、打印与独立浏览器运行时。
136
+ - [新用户入门指南](docs/guides/local-guide-ch.md)与[本地交互语法规范](docs/reference/local-interaction-syntax-ch.md)。
137
+ - [本地模式集成](docs/integration/local-integration-ch.md):核心与 React API、URL 策略、生命周期、样式和版本固定。
138
+ - [可分享文档与静态导出](docs/integration/shareable-export-ch.md):CLI build/lint、状态文件、本地图片内联、打印与独立浏览器运行时。
137
139
  - [功能演示与示例](examples/local/README.md)与[独立接入示例](examples/integration/README.md)。
138
- - [React 源码编辑器](docs/editor-ch.md):编辑 `.reactive.md` 源码的受控组件,使用独立样式表。
139
- - [版本与兼容性](docs/compatibility-ch.md)、[0.5.3 发布说明](docs/release-0.5.3-ch.md)与[0.5.1 发布说明](docs/release-0.5.1-ch.md)。
140
- - [0.4.0 发布与迁移](docs/release-0.4.0-ch.md)。
141
- - [组块协议](docs/component-protocol-ch.md)与[组块开发指南](docs/component-development-ch.md)。
142
- - [性能说明](docs/performance-ch.md)与[发布清单](docs/releasing-ch.md)。
140
+ - [React 源码编辑器](docs/integration/editor-ch.md):编辑 `.reactive.md` 源码的受控组件,使用独立样式表。
141
+ - [版本与兼容性](docs/compatibility/compatibility-ch.md)、[0.6.0 发布说明](docs/releases/release-0.6.0-ch.md)与[0.5.1 发布说明](docs/releases/release-0.5.1-ch.md)。
142
+ - [0.4.0 发布与迁移](docs/releases/release-0.4.0-ch.md)。
143
+ - [组块协议](docs/development/component-protocol-ch.md)与[组块开发指南](docs/development/component-development-ch.md)。
144
+ - [性能说明](docs/development/performance-ch.md)与[发布清单](docs/development/releasing-ch.md)。
143
145
 
144
146
  更多开发与测试命令见[贡献指南](CONTRIBUTING-ch.md)。
145
147
 
@@ -148,7 +150,7 @@ demo/ 独立的 Playground 应用
148
150
  - [贡献指南](CONTRIBUTING-ch.md):环境、检查命令和改动要求。
149
151
  - [安全策略](SECURITY-ch.md):威胁边界、资源上限、宿主责任和漏洞报告渠道。
150
152
  - [变更记录](CHANGELOG-ch.md)。
151
- - [发布清单](docs/releasing-ch.md):验证门禁、notice、tarball 和人工发布流程。
153
+ - [发布清单](docs/development/releasing-ch.md):验证门禁、notice、tarball 和人工发布流程。
152
154
 
153
155
  ## 许可证
154
156