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
@@ -1,89 +1,89 @@
1
- # 0.4.0 预览与迁移
2
-
3
- 状态:同时提供于 `latest` 和 `next` 渠道的 0.x 预览版。包版本 `0.4.0`,语法修订 `local-draft-2`,组块协议 `component-protocol-1`,主题协议 `reactive-md-theme-1`。这些是彼此独立的版本轴;`local-draft-2`、`component-protocol-1` 和 `reactive-md-theme-1` 都不是包版本。
4
-
5
- 使用 `npm install reactive-md` 安装,或用 `npm install reactive-md@0.4.0` 固定版本。`latest` 和 `next` 均指向 `0.4.0`。
6
-
7
- 本文汇总 0.4.0 包含的能力、对现有文档和宿主的变化,以及从 `0.3.1` / `local-draft-1` 升级的步骤。具体规则仍以链接的参考页为准;本页是升级清单。显式修订声明和迁移工具见[源码修订与迁移](source-versioning-ch.md)。
8
-
9
- ## 适合哪些项目
10
-
11
- - 需要命名计算、格式化、校验、集合、新输入类型、主题或离线 HTML 导出的作者。
12
- - 可以把宿主更新到 `local-draft-2`,并愿意补充 `LocalValueKind` 穷举、运行时适配器和状态处理的宿主。
13
- - 固定使用 `0.3.1`、只需要 `local-draft-1` 的项目可以继续固定使用该版本。当前构建只接受一个语法修订,不提供独立的 `local-draft-1` 模式;使用受支持旧写法的无指令源码按 `local-draft-2` 规则读取,显式 `local-draft-1` 声明必须先迁移。
14
-
15
- ## 0.4.0 包含的能力
16
-
17
- | 范围 | 内容 |
18
- | --- | --- |
19
- | 语法 | 十个 `local-draft-2` 组块:`jump`、`anchor`、`text`、`section`、`multi-select`、`range-slider`、`coordinate`、`quiz`、`steps`、`step` |
20
- | 源码修订 | 可选的 `local-draft-2` 指令、版本查看与升级检查、单份源码的元数据迁移 |
21
- | 计算 | 顶层 `<const>` 与 `<computed>` 声明,支持依赖排序、类型推断、循环检测和运行时独立缓存 |
22
- | 表达式 | 字符串与数字数组字面量、索引、`sum`/`average`/`minOf`/`maxOf`、数字/百分比/科学计数法/货币格式化、文本函数及 UTC 日期比较与日期差 |
23
- | 校验与数据 | 提示型 `<validation>` 规则、`runtime.validate()`、`alert`/`badge` 动态 `tone`、带稳定行键的 `<data-table>`/`<column>` |
24
- | 外观 | `<theme name="…">`、宿主主题登记、文档深浅模式、组块主色和清单完成样式 |
25
- | 诊断 | 中英文共享诊断目录,渲染器、Playground 与 CLI 按语言显示,机器字段保持稳定 |
26
- | 宿主状态 | 按名称读写公开参数、`exportLocalState`/`importLocalState`、参数保留工具和可选的 Worker 编译 |
27
- | 导出 | `reactive-md build`/`lint`、交互与静态单文件 HTML、版本化状态文件、经校验的本地位图内联、standalone `ReactiveMD.mount`/`mountAll` 和 `<reactive-md-doc>` |
28
- | 作者工具 | 高亮、补全、绑定定位、重命名、格式化及 `lint --locale en|zh` |
29
- | 渲染 | 依赖感知的渲染,避免重算未受影响的文档子树 |
30
-
31
- 可运行示例见[示例索引](../examples/local/README.md),包括六个双语功能场景、账单示例和工作坊示例。全部可接受的标签名见[语法规范](local-interaction-syntax-ch.md#12-组件速查与语法裁剪)。
32
-
33
- ## 从 0.3.1 / local-draft-1 升级
34
-
35
- 无指令源码中,`local-draft-1` 已支持的写法继续有效;下面这些变化仍需要检查源码和宿主。
36
-
37
- ### 新增保留标识符
38
-
39
- 新增表达式函数名不能再用作控件绑定名。升级前请重命名以下同名旧绑定并同步修改引用:
40
-
41
- `sum`、`average`、`minOf`、`maxOf`、`formatNumber`、`formatPercent`、`formatScientific`、`formatCurrency`、`trim`、`lower`、`upper`、`startsWith`、`endsWith`、`replace`、`slice`、`dateCompare`、`dateDiff`。
42
-
43
- 它们与原有保留名共同生效:数学与集合函数(`abs`、`sqrt`、`floor`、`ceil`、`round`、`min`、`max`、`pow`、`sin`、`cos`、`tan`、`asin`、`acos`、`atan`、`exp`、`log`、`len`、`contains`、`clamp`)、常量 `pi` 与 `e`、绘图名 `x` 与 `y`、字面量 `true`、`false`、`null`,以及 `__proto__`、`prototype`、`constructor`。详见[复用计算与格式化数值](computations-formatting-ch.md#兼容性)。
44
-
45
- ### 新增可识别标签名
46
-
47
- 当前构建会把以下名称解释为标签:`jump`、`anchor`、`text`、`section`、`multi-select`、`range-slider`、`coordinate`、`quiz`、`steps`、`step`、`computed`、`const`、`validation`、`data-table`、`column`。
48
-
49
- 如果旧文档把这些名称当作普通正文,或作为“未知标签按原文显示”的示例,现在会被解析为组块或声明。请把这类示例放进行内代码、代码围栏,或转义标签,并核对新增保留名与下列行为变化。
50
-
51
- 开头的 `<theme name="…">` 是文档元数据,不是组块;它同样只允许在正文前声明一次。
52
-
53
- ### 修订声明与迁移
54
-
55
- 源码可以在前导区声明 `<!-- reactive-md: local-draft-2 -->`。无指令源码保持当前修订的行为。显式 `local-draft-1` 或未知修订会以 `local.version.*` 诊断拒绝,不创建运行时;声明旧修订不会选择旧解析器。
56
-
57
- `reactive-md migrate` 或纯核心 `migrateLocalSource` 把单份源码迁移到 `local-draft-2`。迁移只替换或补上元数据注释,保留正文原始字节、BOM 和 CRLF。写出结果前会阻止新增保留绑定、新增可识别标签、当前编译错误和文本控件长度语义变化;不重命名标识符,也不激活原先按原文显示的标签。清单完成样式属于兼容例外,不阻止迁移。迁移会改变源码摘要,之后应重新导出状态文件。在这一声明之前构建的读者(包括 `0.3.1`)会把它当作普通注释,不执行检查,因此应先迁移旧文档。
58
-
59
- ### 行为变化
60
-
61
- - 清单中已勾选的条目现在加删除线并变淡,包括初始 `[x]` 条目。
62
- - `alert` 与 `badge` 可以在现有枚举内使用动态 `tone` 表达式。
63
- - 提供 `key`(稳定标识列)时,`table` 和 `chart` 可通过 `bind` 公开选择状态;没有 `key` 的旧表格仍只在渲染器内部保存选择。
64
- - 文本控件的 `min-length` 与 `max-length` 按 Unicode 码点计数,与字符串 `len()` 一致。原先因 emoji 占两个 UTF-16 代码单元而失败的值现在可能通过;源码位置和资源预算仍按 UTF-16 计算。
65
- - `document.bindings` 与 `document.initialState` 仍只描述可写控件;`runtime.snapshot().state` 还会包含成功求值的命名计算结果,宿主不能假设快照里只有控件。
66
- - `LocalValueKind` 增加 `number-array`,`LocalValue` 增加 `number[]`;可写的清单与多选控件仍产生字符串数组。
67
- - 自定义运行时适配器需要补充 `validate()`;多槽控件使用 `get(node, slot?)`、`set(node, value, slot?)` 和 `setMany(node, values)`。
68
- - 状态文件携带 `syntax: "local-draft-2"` 和源码摘要。语法修订、摘要或公开参数集合不一致时会拒绝整个文件。
69
- - 显示用诊断通过共享目录本地化;回调仍收到结构化诊断。`message` 是显示文本,不是 API。
70
-
71
- ## 升级清单
72
-
73
- 1. 使用 `npm install reactive-md` 安装 `0.4.0` 或固定 `0.4.0`,保存原始 `.reactive.md` 源码,并记录 `LOCAL_SYNTAX_VERSION`。
74
- 2. 对每份源码运行 `reactive-md migrate <file> --check` 或 `migrateLocalSource`。无版本声明的历史文档要加 `--from local-draft-1`;写出结果前处理全部阻止项。
75
- 3. 在代码区域之外搜索 15 个新增可识别标签名,按需要转义或放进代码。
76
- 4. 搜索 `bind`、`bind-start`、`bind-end`、`bind-x`、`bind-y` 的值,确认没有 17 个新增保留标识符;如有则重命名绑定和引用。核心入口的 `renameLocalBinding` 和编辑器重命名会同时更新声明、表达式引用与绘图参数。
77
- 5. 重新编译全部文档,处理新增的位置或结构诊断,尤其是顶层 `computed`/`const`、`validation`、`data-table`/`column`、`steps`/`step` 和 `quiz`。
78
- 6. 更新宿主对 `number-array`、`validate()`、槽位 API 和包含计算值的快照的处理。
79
- 7. 重新检查状态导入导出、参数保留和宿主内的 HTML 导出。迁移会改变源码摘要,应重新导出状态文件。
80
- 8. 检查可见变化:清单完成样式、表格/图表选择和主题 CSS。
81
- 9. 运行[发布验证入口](../CONTRIBUTING-ch.md),并用自己的文档和浏览器检查复验。
82
-
83
- ## 验证范围
84
-
85
- `0.4.0` 面向 Node.js 22.12 与 Node 24;CI 门禁使用 Playwright Chromium,本地检查使用 Microsoft Edge。`npm run verify:release` 是完整发布门禁:覆盖核心与 Demo 测试、类型、包与文档检查、仓库外真实 tarball 消费,以及计算、集合、作者工具、状态恢复、HTML 导出的浏览器检查和渲染等价检查。单项命令仍列在[贡献指南](../CONTRIBUTING-ch.md)。
86
-
87
- 静态 SSR 由 packed 检查覆盖。单文件导出的静态首屏水合由 Playwright Chromium 和本地 Edge 检查覆盖。该路径之外的通用 SSR 水合、Firefox 与 Safari/WebKit 尚未验证,不作支持声明。
88
-
89
- 版本规则与诊断契约见[版本与兼容性](compatibility-ch.md),修订指令与迁移工具见[源码修订与迁移](source-versioning-ch.md),HTML 与状态格式见[可分享文档与静态导出](shareable-export-ch.md),组块新增见[local-draft-2 扩展说明](local-components-v2-ch.md)。
1
+ # 0.4.0 预览与迁移
2
+
3
+ 状态:同时提供于 `latest` 和 `next` 渠道的 0.x 预览版。包版本 `0.4.0`,语法修订 `local-draft-2`,组块协议 `component-protocol-1`,主题协议 `reactive-md-theme-1`。这些是彼此独立的版本轴;`local-draft-2`、`component-protocol-1` 和 `reactive-md-theme-1` 都不是包版本。
4
+
5
+ 使用 `npm install reactive-md` 安装,或用 `npm install reactive-md@0.4.0` 固定版本。`latest` 和 `next` 均指向 `0.4.0`。
6
+
7
+ 本文汇总 0.4.0 包含的能力、对现有文档和宿主的变化,以及从 `0.3.1` / `local-draft-1` 升级的步骤。具体规则仍以链接的参考页为准;本页是升级清单。显式修订声明和迁移工具见[源码修订与迁移](../compatibility/source-versioning-ch.md)。
8
+
9
+ ## 适合哪些项目
10
+
11
+ - 需要命名计算、格式化、校验、集合、新输入类型、主题或离线 HTML 导出的作者。
12
+ - 可以把宿主更新到 `local-draft-2`,并愿意补充 `LocalValueKind` 穷举、运行时适配器和状态处理的宿主。
13
+ - 固定使用 `0.3.1`、只需要 `local-draft-1` 的项目可以继续固定使用该版本。当前构建只接受一个语法修订,不提供独立的 `local-draft-1` 模式;使用受支持旧写法的无指令源码按 `local-draft-2` 规则读取,显式 `local-draft-1` 声明必须先迁移。
14
+
15
+ ## 0.4.0 包含的能力
16
+
17
+ | 范围 | 内容 |
18
+ | --- | --- |
19
+ | 语法 | 十个 `local-draft-2` 组块:`jump`、`anchor`、`text`、`section`、`multi-select`、`range-slider`、`coordinate`、`quiz`、`steps`、`step` |
20
+ | 源码修订 | 可选的 `local-draft-2` 指令、版本查看与升级检查、单份源码的元数据迁移 |
21
+ | 计算 | 顶层 `<const>` 与 `<computed>` 声明,支持依赖排序、类型推断、循环检测和运行时独立缓存 |
22
+ | 表达式 | 字符串与数字数组字面量、索引、`sum`/`average`/`minOf`/`maxOf`、数字/百分比/科学计数法/货币格式化、文本函数及 UTC 日期比较与日期差 |
23
+ | 校验与数据 | 提示型 `<validation>` 规则、`runtime.validate()`、`alert`/`badge` 动态 `tone`、带稳定行键的 `<data-table>`/`<column>` |
24
+ | 外观 | `<theme name="…">`、宿主主题登记、文档深浅模式、组块主色和清单完成样式 |
25
+ | 诊断 | 中英文共享诊断目录,渲染器、Playground 与 CLI 按语言显示,机器字段保持稳定 |
26
+ | 宿主状态 | 按名称读写公开参数、`exportLocalState`/`importLocalState`、参数保留工具和可选的 Worker 编译 |
27
+ | 导出 | `reactive-md build`/`lint`、交互与静态单文件 HTML、版本化状态文件、经校验的本地位图内联、standalone `ReactiveMD.mount`/`mountAll` 和 `<reactive-md-doc>` |
28
+ | 作者工具 | 高亮、补全、绑定定位、重命名、格式化及 `lint --locale en|zh` |
29
+ | 渲染 | 依赖感知的渲染,避免重算未受影响的文档子树 |
30
+
31
+ 可运行示例见[示例索引](../../examples/local/README.md),包括六个双语功能场景、账单示例和工作坊示例。全部可接受的标签名见[语法规范](../reference/local-interaction-syntax-ch.md#12-组件速查与语法裁剪)。
32
+
33
+ ## 从 0.3.1 / local-draft-1 升级
34
+
35
+ 无指令源码中,`local-draft-1` 已支持的写法继续有效;下面这些变化仍需要检查源码和宿主。
36
+
37
+ ### 新增保留标识符
38
+
39
+ 新增表达式函数名不能再用作控件绑定名。升级前请重命名以下同名旧绑定并同步修改引用:
40
+
41
+ `sum`、`average`、`minOf`、`maxOf`、`formatNumber`、`formatPercent`、`formatScientific`、`formatCurrency`、`trim`、`lower`、`upper`、`startsWith`、`endsWith`、`replace`、`slice`、`dateCompare`、`dateDiff`。
42
+
43
+ 它们与原有保留名共同生效:数学与集合函数(`abs`、`sqrt`、`floor`、`ceil`、`round`、`min`、`max`、`pow`、`sin`、`cos`、`tan`、`asin`、`acos`、`atan`、`exp`、`log`、`len`、`contains`、`clamp`)、常量 `pi` 与 `e`、绘图名 `x` 与 `y`、字面量 `true`、`false`、`null`,以及 `__proto__`、`prototype`、`constructor`。详见[复用计算与格式化数值](../reference/computations-formatting-ch.md#兼容性)。
44
+
45
+ ### 新增可识别标签名
46
+
47
+ 当前构建会把以下名称解释为标签:`jump`、`anchor`、`text`、`section`、`multi-select`、`range-slider`、`coordinate`、`quiz`、`steps`、`step`、`computed`、`const`、`validation`、`data-table`、`column`。
48
+
49
+ 如果旧文档把这些名称当作普通正文,或作为“未知标签按原文显示”的示例,现在会被解析为组块或声明。请把这类示例放进行内代码、代码围栏,或转义标签,并核对新增保留名与下列行为变化。
50
+
51
+ 开头的 `<theme name="…">` 是文档元数据,不是组块;它同样只允许在正文前声明一次。
52
+
53
+ ### 修订声明与迁移
54
+
55
+ 源码可以在前导区声明 `<!-- reactive-md: local-draft-2 -->`。无指令源码保持当前修订的行为。显式 `local-draft-1` 或未知修订会以 `local.version.*` 诊断拒绝,不创建运行时;声明旧修订不会选择旧解析器。
56
+
57
+ `reactive-md migrate` 或纯核心 `migrateLocalSource` 把单份源码迁移到 `local-draft-2`。迁移只替换或补上元数据注释,保留正文原始字节、BOM 和 CRLF。写出结果前会阻止新增保留绑定、新增可识别标签、当前编译错误和文本控件长度语义变化;不重命名标识符,也不激活原先按原文显示的标签。清单完成样式属于兼容例外,不阻止迁移。迁移会改变源码摘要,之后应重新导出状态文件。在这一声明之前构建的读者(包括 `0.3.1`)会把它当作普通注释,不执行检查,因此应先迁移旧文档。
58
+
59
+ ### 行为变化
60
+
61
+ - 清单中已勾选的条目现在加删除线并变淡,包括初始 `[x]` 条目。
62
+ - `alert` 与 `badge` 可以在现有枚举内使用动态 `tone` 表达式。
63
+ - 提供 `key`(稳定标识列)时,`table` 和 `chart` 可通过 `bind` 公开选择状态;没有 `key` 的旧表格仍只在渲染器内部保存选择。
64
+ - 文本控件的 `min-length` 与 `max-length` 按 Unicode 码点计数,与字符串 `len()` 一致。原先因 emoji 占两个 UTF-16 代码单元而失败的值现在可能通过;源码位置和资源预算仍按 UTF-16 计算。
65
+ - `document.bindings` 与 `document.initialState` 仍只描述可写控件;`runtime.snapshot().state` 还会包含成功求值的命名计算结果,宿主不能假设快照里只有控件。
66
+ - `LocalValueKind` 增加 `number-array`,`LocalValue` 增加 `number[]`;可写的清单与多选控件仍产生字符串数组。
67
+ - 自定义运行时适配器需要补充 `validate()`;多槽控件使用 `get(node, slot?)`、`set(node, value, slot?)` 和 `setMany(node, values)`。
68
+ - 状态文件携带 `syntax: "local-draft-2"` 和源码摘要。语法修订、摘要或公开参数集合不一致时会拒绝整个文件。
69
+ - 显示用诊断通过共享目录本地化;回调仍收到结构化诊断。`message` 是显示文本,不是 API。
70
+
71
+ ## 升级清单
72
+
73
+ 1. 使用 `npm install reactive-md` 安装 `0.4.0` 或固定 `0.4.0`,保存原始 `.reactive.md` 源码,并记录 `LOCAL_SYNTAX_VERSION`。
74
+ 2. 对每份源码运行 `reactive-md migrate <file> --check` 或 `migrateLocalSource`。无版本声明的历史文档要加 `--from local-draft-1`;写出结果前处理全部阻止项。
75
+ 3. 在代码区域之外搜索 15 个新增可识别标签名,按需要转义或放进代码。
76
+ 4. 搜索 `bind`、`bind-start`、`bind-end`、`bind-x`、`bind-y` 的值,确认没有 17 个新增保留标识符;如有则重命名绑定和引用。核心入口的 `renameLocalBinding` 和编辑器重命名会同时更新声明、表达式引用与绘图参数。
77
+ 5. 重新编译全部文档,处理新增的位置或结构诊断,尤其是顶层 `computed`/`const`、`validation`、`data-table`/`column`、`steps`/`step` 和 `quiz`。
78
+ 6. 更新宿主对 `number-array`、`validate()`、槽位 API 和包含计算值的快照的处理。
79
+ 7. 重新检查状态导入导出、参数保留和宿主内的 HTML 导出。迁移会改变源码摘要,应重新导出状态文件。
80
+ 8. 检查可见变化:清单完成样式、表格/图表选择和主题 CSS。
81
+ 9. 运行[发布验证入口](../../CONTRIBUTING-ch.md),并用自己的文档和浏览器检查复验。
82
+
83
+ ## 验证范围
84
+
85
+ `0.4.0` 面向 Node.js 22.12 与 Node 24;CI 门禁使用 Playwright Chromium,本地检查使用 Microsoft Edge。`npm run verify:release` 是完整发布门禁:覆盖核心与 Demo 测试、类型、包与文档检查、仓库外真实 tarball 消费,以及计算、集合、作者工具、状态恢复、HTML 导出的浏览器检查和渲染等价检查。单项命令仍列在[贡献指南](../../CONTRIBUTING-ch.md)。
86
+
87
+ 静态 SSR 由 packed 检查覆盖。单文件导出的静态首屏水合由 Playwright Chromium 和本地 Edge 检查覆盖。该路径之外的通用 SSR 水合、Firefox 与 Safari/WebKit 尚未验证,不作支持声明。
88
+
89
+ 版本规则与诊断契约见[版本与兼容性](../compatibility/compatibility-ch.md),修订指令与迁移工具见[源码修订与迁移](../compatibility/source-versioning-ch.md),HTML 与状态格式见[可分享文档与静态导出](../integration/shareable-export-ch.md),组块新增见[local-draft-2 扩展说明](../reference/local-components-v2-ch.md)。
@@ -1,89 +1,89 @@
1
- # 0.4.0 preview and migration
2
-
3
- Status: 0.x preview available on both `latest` and `next`. Package version `0.4.0`, syntax revision `local-draft-2`, component protocol `component-protocol-1`, theme protocol `reactive-md-theme-1`. These are separate version axes; `local-draft-2`, `component-protocol-1` and `reactive-md-theme-1` are not package versions.
4
-
5
- Install with `npm install reactive-md`, or pin it with `npm install reactive-md@0.4.0`. Both `latest` and `next` resolve to `0.4.0`.
6
-
7
- This page summarizes what 0.4.0 contains, what changes for existing documents and hosts, and how to move from `0.3.1` / `local-draft-1`. Detailed rules remain in the linked reference pages; this page is the upgrade checklist. Explicit revision declarations and the migration tools are specified in [Source revisions and migration](source-versioning-en.md).
8
-
9
- ## Who should upgrade
10
-
11
- - Authors who need named calculations, formatting, validation, collections, new input types, themes or offline HTML export.
12
- - Hosts that can adopt `local-draft-2` and update exhaustive `LocalValueKind` checks, runtime adapters and state handling.
13
- - Projects that pin `0.3.1` and only need `local-draft-1` can stay on that pinned version. The build accepts one syntax revision and has no separate `local-draft-1` mode; unversioned source in supported old forms is read under `local-draft-2` rules, while an explicit `local-draft-1` declaration must be migrated first.
14
-
15
- ## What 0.4.0 contains
16
-
17
- | Area | Included |
18
- | --- | --- |
19
- | Syntax | Ten `local-draft-2` components: `jump`, `anchor`, `text`, `section`, `multi-select`, `range-slider`, `coordinate`, `quiz`, `steps`, `step` |
20
- | Source revisions | Optional `local-draft-2` directive, version inspection and upgrade checks, and single-source metadata migration |
21
- | Calculations | Top-level `<const>` and `<computed>` declarations with dependency ordering, inferred types, cycle detection and per-runtime caching |
22
- | Expressions | String and numeric array literals, indexing, `sum`/`average`/`minOf`/`maxOf`, number/percent/scientific/currency formatting, text functions and UTC date comparison/differences |
23
- | Validation and data | Advisory `<validation>` rules, `runtime.validate()`, dynamic `alert`/`badge` tones, `<data-table>`/`<column>` row generation with stable keys |
24
- | Appearance | `<theme name="…">`, host theme registration, document color schemes, component accent colors and completed-checklist styling |
25
- | Diagnostics | Shared English/Chinese catalogue and localization in the renderer, Playground and CLI, with stable machine fields |
26
- | Host state | Public parameter access by name, `exportLocalState`/`importLocalState`, retention helpers and optional Worker compilation |
27
- | Export | `reactive-md build`/`lint`, interactive and static single-file HTML, versioned state files, verified local raster inlining, standalone `ReactiveMD.mount`/`mountAll` and `<reactive-md-doc>` |
28
- | Author tools | Highlighting, completion, binding navigation, rename, formatting and `lint --locale en|zh` |
29
- | Rendering | Dependency-aware rendering that avoids recomputing unaffected document subtrees |
30
-
31
- The runnable examples are in the [example index](../examples/local/README.md), including the six bilingual feature tours, the invoice recipe and the workshop recipe. Every accepted tag name is listed in the [syntax specification](local-interaction-syntax-en.md#12-component-reference-and-syntax-scope).
32
-
33
- ## Upgrade from 0.3.1 / local-draft-1
34
-
35
- Unversioned source in previously supported `local-draft-1` forms keeps its supported forms. The changes below still require a source and host review.
36
-
37
- ### Newly reserved identifiers
38
-
39
- The new expression functions are reserved binding names. Rename any existing control binding with one of these names and update its references before upgrading:
40
-
41
- `sum`, `average`, `minOf`, `maxOf`, `formatNumber`, `formatPercent`, `formatScientific`, `formatCurrency`, `trim`, `lower`, `upper`, `startsWith`, `endsWith`, `replace`, `slice`, `dateCompare`, `dateDiff`.
42
-
43
- These join the existing reserved names: math and collection functions (`abs`, `sqrt`, `floor`, `ceil`, `round`, `min`, `max`, `pow`, `sin`, `cos`, `tan`, `asin`, `acos`, `atan`, `exp`, `log`, `len`, `contains`, `clamp`), the constants `pi` and `e`, the plot names `x` and `y`, the literals `true`, `false` and `null`, and `__proto__`, `prototype` and `constructor`. See [Reusing calculations and formatting values](computations-formatting-en.md#compatibility).
44
-
45
- ### Newly recognized tag names
46
-
47
- The build now interprets these names as tags: `jump`, `anchor`, `text`, `section`, `multi-select`, `range-slider`, `coordinate`, `quiz`, `steps`, `step`, `computed`, `const`, `validation`, `data-table` and `column`.
48
-
49
- Source that used one of these names as literal prose, or as an inert unknown-tag example, now parses as a component or declaration. Put literal examples inside code spans or fences, or escape the tag. Also check reserved identifiers and the behaviour changes below.
50
-
51
- The leading `<theme name="…">` declaration is document metadata, not a component. It joins the same placement rule: one declaration before the body.
52
-
53
- ### Version declarations and migration
54
-
55
- A source may declare `<!-- reactive-md: local-draft-2 -->` in its prologue. Unversioned source keeps current-revision behavior. An explicit `local-draft-1` or unknown revision is rejected with a `local.version.*` diagnostic and creates no runtime; declaring an old revision does not select an old parser.
56
-
57
- `reactive-md migrate` or the pure core `migrateLocalSource` moves one source to `local-draft-2`. Migration replaces or adds only the metadata comment and preserves body bytes, BOM and CRLF. It blocks newly reserved bindings, newly recognized tags, current compile errors and text-control length changes before writing output. It does not rename identifiers or activate formerly inert tags. Completed checklist styling is a compatibility exception and does not block migration. Because migration changes the source digest, export fresh state files afterwards. Readers built before this declaration, including `0.3.1`, treat it as an ordinary comment and do not enforce the check, so migrate old documents first.
58
-
59
- ### Behaviour changes
60
-
61
- - Completed checklist items are now struck through and muted, including `[x]` items in the initial state.
62
- - `alert` and `badge` accept a dynamic `tone` expression within their existing enums.
63
- - `table` and `chart` expose selection through `bind` when `key` names a stable identifier column. Existing tables without `key` keep renderer-local selection.
64
- - Text-control `min-length` and `max-length` count Unicode code points, matching string `len()`. Values that previously failed because an emoji occupied two UTF-16 code units can now pass. Source positions and resource budgets still use UTF-16 units.
65
- - `document.bindings` and `document.initialState` still describe writable controls. `runtime.snapshot().state` also contains successful named calculation results. Do not assume the snapshot contains controls only.
66
- - `LocalValueKind` gains `number-array`; `LocalValue` gains `number[]`. Writable checklist and multi-select controls still produce string arrays.
67
- - Custom runtime adapters need `validate()`; multi-slot controls use `get(node, slot?)`, `set(node, value, slot?)` and `setMany(node, values)`.
68
- - State files carry `syntax: "local-draft-2"` and a source digest. A file is rejected when either the revision, digest or exact public parameter set differs.
69
- - Displayed diagnostics are localized through the shared catalogue; callbacks still receive structured diagnostics. `message` remains display text, not an API.
70
-
71
- ## Upgrade checklist
72
-
73
- 1. Install `0.4.0` with `npm install reactive-md` or pin `0.4.0`, keep the original `.reactive.md` sources and record `LOCAL_SYNTAX_VERSION`.
74
- 2. Run `reactive-md migrate <file> --check` or `migrateLocalSource` on each source. Unversioned historical documents need `--from local-draft-1`; resolve every reported blocker before writing output.
75
- 3. Search prose and examples for the 15 newly recognized tag names outside code regions; escape them or move them into code.
76
- 4. Search `bind`, `bind-start`, `bind-end`, `bind-x` and `bind-y` values for the 17 newly reserved identifiers; rename the bindings and their references. The core `renameLocalBinding` helper and the editor rename action update declarations, expression references and plot parameters together.
77
- 5. Recompile every document and fix new placement or structure diagnostics, especially top-level `computed`/`const`, `validation`, `data-table`/`column`, `steps`/`step` and `quiz`.
78
- 6. Update hosts for `number-array`, `validate()`, slot APIs and snapshots that include calculated values.
79
- 7. Recheck state import/export, retention and any HTML export inside the host. Migration changes the source digest; export fresh state files.
80
- 8. Check the visible changes: checklist completion styling, table/chart selection and theme CSS.
81
- 9. Run the [release verification gate](../CONTRIBUTING.md) and your own document and browser checks.
82
-
83
- ## Verification scope
84
-
85
- The `0.4.0` build targets Node.js 22.12 and Node 24; its CI gate uses Playwright Chromium and local checks use Microsoft Edge. `npm run verify:release` is the complete release gate: it covers core and demo tests, types, package and documentation checks, packed consumption outside the repository, and the browser checks for calculations, collections, authoring, state restoration, HTML export and rendering equivalence. Individual commands remain in the [contributing guide](../CONTRIBUTING.md).
86
-
87
- Static SSR is covered by the packed check. Single-file export static-first hydration is covered by the Playwright Chromium and local Edge checks. General SSR hydration outside that path, Firefox and Safari/WebKit are unverified and are not claimed as supported.
88
-
89
- Use [Versions and compatibility](compatibility-en.md) for the version rules and diagnostics contract, [Source revisions and migration](source-versioning-en.md) for the directive and migration tools, [Shareable documents and static export](shareable-export-en.md) for the HTML and state formats, and [local-draft-2 components and migration](local-components-v2-en.md) for the component additions.
1
+ # 0.4.0 preview and migration
2
+
3
+ Status: 0.x preview available on both `latest` and `next`. Package version `0.4.0`, syntax revision `local-draft-2`, component protocol `component-protocol-1`, theme protocol `reactive-md-theme-1`. These are separate version axes; `local-draft-2`, `component-protocol-1` and `reactive-md-theme-1` are not package versions.
4
+
5
+ Install with `npm install reactive-md`, or pin it with `npm install reactive-md@0.4.0`. Both `latest` and `next` resolve to `0.4.0`.
6
+
7
+ This page summarizes what 0.4.0 contains, what changes for existing documents and hosts, and how to move from `0.3.1` / `local-draft-1`. Detailed rules remain in the linked reference pages; this page is the upgrade checklist. Explicit revision declarations and the migration tools are specified in [Source revisions and migration](../compatibility/source-versioning-en.md).
8
+
9
+ ## Who should upgrade
10
+
11
+ - Authors who need named calculations, formatting, validation, collections, new input types, themes or offline HTML export.
12
+ - Hosts that can adopt `local-draft-2` and update exhaustive `LocalValueKind` checks, runtime adapters and state handling.
13
+ - Projects that pin `0.3.1` and only need `local-draft-1` can stay on that pinned version. The build accepts one syntax revision and has no separate `local-draft-1` mode; unversioned source in supported old forms is read under `local-draft-2` rules, while an explicit `local-draft-1` declaration must be migrated first.
14
+
15
+ ## What 0.4.0 contains
16
+
17
+ | Area | Included |
18
+ | --- | --- |
19
+ | Syntax | Ten `local-draft-2` components: `jump`, `anchor`, `text`, `section`, `multi-select`, `range-slider`, `coordinate`, `quiz`, `steps`, `step` |
20
+ | Source revisions | Optional `local-draft-2` directive, version inspection and upgrade checks, and single-source metadata migration |
21
+ | Calculations | Top-level `<const>` and `<computed>` declarations with dependency ordering, inferred types, cycle detection and per-runtime caching |
22
+ | Expressions | String and numeric array literals, indexing, `sum`/`average`/`minOf`/`maxOf`, number/percent/scientific/currency formatting, text functions and UTC date comparison/differences |
23
+ | Validation and data | Advisory `<validation>` rules, `runtime.validate()`, dynamic `alert`/`badge` tones, `<data-table>`/`<column>` row generation with stable keys |
24
+ | Appearance | `<theme name="…">`, host theme registration, document color schemes, component accent colors and completed-checklist styling |
25
+ | Diagnostics | Shared English/Chinese catalogue and localization in the renderer, Playground and CLI, with stable machine fields |
26
+ | Host state | Public parameter access by name, `exportLocalState`/`importLocalState`, retention helpers and optional Worker compilation |
27
+ | Export | `reactive-md build`/`lint`, interactive and static single-file HTML, versioned state files, verified local raster inlining, standalone `ReactiveMD.mount`/`mountAll` and `<reactive-md-doc>` |
28
+ | Author tools | Highlighting, completion, binding navigation, rename, formatting and `lint --locale en|zh` |
29
+ | Rendering | Dependency-aware rendering that avoids recomputing unaffected document subtrees |
30
+
31
+ The runnable examples are in the [example index](../../examples/local/README.md), including the six bilingual feature tours, the invoice recipe and the workshop recipe. Every accepted tag name is listed in the [syntax specification](../reference/local-interaction-syntax-en.md#12-component-reference-and-syntax-scope).
32
+
33
+ ## Upgrade from 0.3.1 / local-draft-1
34
+
35
+ Unversioned source in previously supported `local-draft-1` forms keeps its supported forms. The changes below still require a source and host review.
36
+
37
+ ### Newly reserved identifiers
38
+
39
+ The new expression functions are reserved binding names. Rename any existing control binding with one of these names and update its references before upgrading:
40
+
41
+ `sum`, `average`, `minOf`, `maxOf`, `formatNumber`, `formatPercent`, `formatScientific`, `formatCurrency`, `trim`, `lower`, `upper`, `startsWith`, `endsWith`, `replace`, `slice`, `dateCompare`, `dateDiff`.
42
+
43
+ These join the existing reserved names: math and collection functions (`abs`, `sqrt`, `floor`, `ceil`, `round`, `min`, `max`, `pow`, `sin`, `cos`, `tan`, `asin`, `acos`, `atan`, `exp`, `log`, `len`, `contains`, `clamp`), the constants `pi` and `e`, the plot names `x` and `y`, the literals `true`, `false` and `null`, and `__proto__`, `prototype` and `constructor`. See [Reusing calculations and formatting values](../reference/computations-formatting-en.md#compatibility).
44
+
45
+ ### Newly recognized tag names
46
+
47
+ The build now interprets these names as tags: `jump`, `anchor`, `text`, `section`, `multi-select`, `range-slider`, `coordinate`, `quiz`, `steps`, `step`, `computed`, `const`, `validation`, `data-table` and `column`.
48
+
49
+ Source that used one of these names as literal prose, or as an inert unknown-tag example, now parses as a component or declaration. Put literal examples inside code spans or fences, or escape the tag. Also check reserved identifiers and the behaviour changes below.
50
+
51
+ The leading `<theme name="…">` declaration is document metadata, not a component. It joins the same placement rule: one declaration before the body.
52
+
53
+ ### Version declarations and migration
54
+
55
+ A source may declare `<!-- reactive-md: local-draft-2 -->` in its prologue. Unversioned source keeps current-revision behavior. An explicit `local-draft-1` or unknown revision is rejected with a `local.version.*` diagnostic and creates no runtime; declaring an old revision does not select an old parser.
56
+
57
+ `reactive-md migrate` or the pure core `migrateLocalSource` moves one source to `local-draft-2`. Migration replaces or adds only the metadata comment and preserves body bytes, BOM and CRLF. It blocks newly reserved bindings, newly recognized tags, current compile errors and text-control length changes before writing output. It does not rename identifiers or activate formerly inert tags. Completed checklist styling is a compatibility exception and does not block migration. Because migration changes the source digest, export fresh state files afterwards. Readers built before this declaration, including `0.3.1`, treat it as an ordinary comment and do not enforce the check, so migrate old documents first.
58
+
59
+ ### Behaviour changes
60
+
61
+ - Completed checklist items are now struck through and muted, including `[x]` items in the initial state.
62
+ - `alert` and `badge` accept a dynamic `tone` expression within their existing enums.
63
+ - `table` and `chart` expose selection through `bind` when `key` names a stable identifier column. Existing tables without `key` keep renderer-local selection.
64
+ - Text-control `min-length` and `max-length` count Unicode code points, matching string `len()`. Values that previously failed because an emoji occupied two UTF-16 code units can now pass. Source positions and resource budgets still use UTF-16 units.
65
+ - `document.bindings` and `document.initialState` still describe writable controls. `runtime.snapshot().state` also contains successful named calculation results. Do not assume the snapshot contains controls only.
66
+ - `LocalValueKind` gains `number-array`; `LocalValue` gains `number[]`. Writable checklist and multi-select controls still produce string arrays.
67
+ - Custom runtime adapters need `validate()`; multi-slot controls use `get(node, slot?)`, `set(node, value, slot?)` and `setMany(node, values)`.
68
+ - State files carry `syntax: "local-draft-2"` and a source digest. A file is rejected when either the revision, digest or exact public parameter set differs.
69
+ - Displayed diagnostics are localized through the shared catalogue; callbacks still receive structured diagnostics. `message` remains display text, not an API.
70
+
71
+ ## Upgrade checklist
72
+
73
+ 1. Install `0.4.0` with `npm install reactive-md` or pin `0.4.0`, keep the original `.reactive.md` sources and record `LOCAL_SYNTAX_VERSION`.
74
+ 2. Run `reactive-md migrate <file> --check` or `migrateLocalSource` on each source. Unversioned historical documents need `--from local-draft-1`; resolve every reported blocker before writing output.
75
+ 3. Search prose and examples for the 15 newly recognized tag names outside code regions; escape them or move them into code.
76
+ 4. Search `bind`, `bind-start`, `bind-end`, `bind-x` and `bind-y` values for the 17 newly reserved identifiers; rename the bindings and their references. The core `renameLocalBinding` helper and the editor rename action update declarations, expression references and plot parameters together.
77
+ 5. Recompile every document and fix new placement or structure diagnostics, especially top-level `computed`/`const`, `validation`, `data-table`/`column`, `steps`/`step` and `quiz`.
78
+ 6. Update hosts for `number-array`, `validate()`, slot APIs and snapshots that include calculated values.
79
+ 7. Recheck state import/export, retention and any HTML export inside the host. Migration changes the source digest; export fresh state files.
80
+ 8. Check the visible changes: checklist completion styling, table/chart selection and theme CSS.
81
+ 9. Run the [release verification gate](../../CONTRIBUTING.md) and your own document and browser checks.
82
+
83
+ ## Verification scope
84
+
85
+ The `0.4.0` build targets Node.js 22.12 and Node 24; its CI gate uses Playwright Chromium and local checks use Microsoft Edge. `npm run verify:release` is the complete release gate: it covers core and demo tests, types, package and documentation checks, packed consumption outside the repository, and the browser checks for calculations, collections, authoring, state restoration, HTML export and rendering equivalence. Individual commands remain in the [contributing guide](../../CONTRIBUTING.md).
86
+
87
+ Static SSR is covered by the packed check. Single-file export static-first hydration is covered by the Playwright Chromium and local Edge checks. General SSR hydration outside that path, Firefox and Safari/WebKit are unverified and are not claimed as supported.
88
+
89
+ Use [Versions and compatibility](../compatibility/compatibility-en.md) for the version rules and diagnostics contract, [Source revisions and migration](../compatibility/source-versioning-en.md) for the directive and migration tools, [Shareable documents and static export](../integration/shareable-export-en.md) for the HTML and state formats, and [local-draft-2 components and migration](../reference/local-components-v2-en.md) for the component additions.
@@ -1,23 +1,23 @@
1
- # 0.4.1 发布说明
2
-
3
- `reactive-md@0.4.1` 是兼容 0.4.0 的补丁版。语法仍为 `local-draft-2`,组块协议为 `component-protocol-1`,主题协议为 `reactive-md-theme-1`;现有 0.4.0 文档无需迁移。
4
-
5
- ```sh
6
- npm install reactive-md@0.4.1
7
- ```
8
-
9
- 本版本发布于 `latest` 和 `next`。离线安装可下载 [npm 安装包](https://registry.npmjs.org/reactive-md/-/reactive-md-0.4.1.tgz)。
10
-
11
- ## 变化
12
-
13
- 文档采用更柔和的底色、较少的边框、低饱和图表配色和更平滑的控件动效。输入框和按钮使用气泡圆角;滑块轨道采用统一样式,并支持 `color` 设置背景色。表格占满容器并均衡分配列宽,用三角形表示排序方向;环形图更充分地利用可用空间。
14
-
15
- LaTeX 使用正文字号和黑白文字颜色,分段函数的表达式与条件保持分离。坐标控件增加网格、箭头轴、虚线投影和可拖动的坐标标注点。quiz 输入框占满可用宽度,题目和操作区整体垂直居中。Playground 在工具栏插入后保留编辑器滚动位置,日期输入框适应窄屏。
16
-
17
- 本次更新调整外观和交互,编译器、运行时与状态文件契约保持不变。使用自定义样式的宿主应检查新的默认外观。完整变化见[变更记录](../CHANGELOG-ch.md);从较早 minor 版本升级时,参阅[0.4.0 迁移指南](release-0.4.0-ch.md)。
18
-
19
- ## 验证与限制
20
-
21
- 发布检查覆盖核心与 Demo 测试、类型、包入口、文档链接、离线安装包消费、静态 SSR、独立 HTML 和浏览器交互。CI 目标为 Node 22.12、24 与 Chromium;本地浏览器检查使用 Windows 上的 Microsoft Edge。导出 HTML 以外的通用 SSR 水合、Firefox 和 WebKit 尚未验证。
22
-
23
- 项目仍处于 0.x 预览阶段。安全边界和宿主职责见 [SECURITY-ch.md](../SECURITY-ch.md)。
1
+ # 0.4.1 发布说明
2
+
3
+ `reactive-md@0.4.1` 是兼容 0.4.0 的补丁版。语法仍为 `local-draft-2`,组块协议为 `component-protocol-1`,主题协议为 `reactive-md-theme-1`;现有 0.4.0 文档无需迁移。
4
+
5
+ ```sh
6
+ npm install reactive-md@0.4.1
7
+ ```
8
+
9
+ 本版本发布于 `latest` 和 `next`。离线安装可下载 [npm 安装包](https://registry.npmjs.org/reactive-md/-/reactive-md-0.4.1.tgz)。
10
+
11
+ ## 变化
12
+
13
+ 文档采用更柔和的底色、较少的边框、低饱和图表配色和更平滑的控件动效。输入框和按钮使用气泡圆角;滑块轨道采用统一样式,并支持 `color` 设置背景色。表格占满容器并均衡分配列宽,用三角形表示排序方向;环形图更充分地利用可用空间。
14
+
15
+ LaTeX 使用正文字号和黑白文字颜色,分段函数的表达式与条件保持分离。坐标控件增加网格、箭头轴、虚线投影和可拖动的坐标标注点。quiz 输入框占满可用宽度,题目和操作区整体垂直居中。Playground 在工具栏插入后保留编辑器滚动位置,日期输入框适应窄屏。
16
+
17
+ 本次更新调整外观和交互,编译器、运行时与状态文件契约保持不变。使用自定义样式的宿主应检查新的默认外观。完整变化见[变更记录](../../CHANGELOG-ch.md);从较早 minor 版本升级时,参阅[0.4.0 迁移指南](release-0.4.0-ch.md)。
18
+
19
+ ## 验证与限制
20
+
21
+ 发布检查覆盖核心与 Demo 测试、类型、包入口、文档链接、离线安装包消费、静态 SSR、独立 HTML 和浏览器交互。CI 目标为 Node 22.12、24 与 Chromium;本地浏览器检查使用 Windows 上的 Microsoft Edge。导出 HTML 以外的通用 SSR 水合、Firefox 和 WebKit 尚未验证。
22
+
23
+ 项目仍处于 0.x 预览阶段。安全边界和宿主职责见 [SECURITY-ch.md](../../SECURITY-ch.md)。
@@ -1,23 +1,23 @@
1
- # 0.4.1 release notes
2
-
3
- `reactive-md@0.4.1` is a compatible patch for 0.4.0. It keeps `local-draft-2`, `component-protocol-1` and `reactive-md-theme-1`; existing 0.4.0 documents need no migration.
4
-
5
- ```sh
6
- npm install reactive-md@0.4.1
7
- ```
8
-
9
- The release is available on `latest` and `next`. For offline installation, use the [npm tarball](https://registry.npmjs.org/reactive-md/-/reactive-md-0.4.1.tgz).
10
-
11
- ## Changes
12
-
13
- Documents use quieter surfaces, fewer borders, muted chart colors and smoother control transitions. Fields and buttons have rounded ends; sliders have custom tracks that honor their `color` attribute. Tables fill their container with balanced columns and triangle sort indicators. Donut charts use more of the available space.
14
-
15
- LaTeX uses the body font size and black/white ink, and piecewise expressions keep their conditions separate. Coordinate controls gain a grid, arrow axes, dashed projections and a labeled draggable point. Quiz inputs fill the container and the question and actions are vertically centered. The Playground preserves editor scroll after toolbar insertion and fits date inputs on narrow screens.
16
-
17
- These are visual and interaction changes; the compiler, runtime and state-file contracts remain unchanged. Hosts with custom styles should review the revised defaults. See the [changelog](../CHANGELOG.md) and the [0.4.0 migration guide](release-0.4.0-en.md) when upgrading from an earlier minor release.
18
-
19
- ## Validation and limits
20
-
21
- Release verification covers core and demo tests, types, package exports, documentation links, offline tarball consumers, static SSR, standalone HTML and browser interactions. CI targets Node 22.12 and 24 with Chromium; local browser checks use Microsoft Edge on Windows. General SSR hydration outside exported HTML, Firefox and WebKit remain unverified.
22
-
23
- The project remains a 0.x preview. Security boundaries and host responsibilities are documented in [SECURITY.md](../SECURITY.md).
1
+ # 0.4.1 release notes
2
+
3
+ `reactive-md@0.4.1` is a compatible patch for 0.4.0. It keeps `local-draft-2`, `component-protocol-1` and `reactive-md-theme-1`; existing 0.4.0 documents need no migration.
4
+
5
+ ```sh
6
+ npm install reactive-md@0.4.1
7
+ ```
8
+
9
+ The release is available on `latest` and `next`. For offline installation, use the [npm tarball](https://registry.npmjs.org/reactive-md/-/reactive-md-0.4.1.tgz).
10
+
11
+ ## Changes
12
+
13
+ Documents use quieter surfaces, fewer borders, muted chart colors and smoother control transitions. Fields and buttons have rounded ends; sliders have custom tracks that honor their `color` attribute. Tables fill their container with balanced columns and triangle sort indicators. Donut charts use more of the available space.
14
+
15
+ LaTeX uses the body font size and black/white ink, and piecewise expressions keep their conditions separate. Coordinate controls gain a grid, arrow axes, dashed projections and a labeled draggable point. Quiz inputs fill the container and the question and actions are vertically centered. The Playground preserves editor scroll after toolbar insertion and fits date inputs on narrow screens.
16
+
17
+ These are visual and interaction changes; the compiler, runtime and state-file contracts remain unchanged. Hosts with custom styles should review the revised defaults. See the [changelog](../../CHANGELOG.md) and the [0.4.0 migration guide](release-0.4.0-en.md) when upgrading from an earlier minor release.
18
+
19
+ ## Validation and limits
20
+
21
+ Release verification covers core and demo tests, types, package exports, documentation links, offline tarball consumers, static SSR, standalone HTML and browser interactions. CI targets Node 22.12 and 24 with Chromium; local browser checks use Microsoft Edge on Windows. General SSR hydration outside exported HTML, Firefox and WebKit remain unverified.
22
+
23
+ The project remains a 0.x preview. Security boundaries and host responsibilities are documented in [SECURITY.md](../../SECURITY.md).
@@ -16,7 +16,7 @@ npm install reactive-md@0.5.0
16
16
 
17
17
  编辑器使用独立样式表 `reactive-md/editor/styles.css`,规则限定在编辑器根节点,因此可以在不加载文档渲染样式时使用。需要显示预览的宿主仍按原有方式引入 `reactive-md/styles.css`。
18
18
 
19
- `ReactiveMarkdownEditor` 接收 `value` 和 `onChange`,并通过 ref 句柄提供聚焦、选区、textarea 访问、撤销和重做。可选的 `diagnostics` 和 `document` 属性增加行号标记与绑定值类型。作者工具在本地分析源码;宿主通过 `onExport` 接入工具栏导出操作,并自行连接预览与存储。完整属性表、历史规则、只读模式和服务端渲染说明见 [React 源码编辑器](editor-ch.md)。
19
+ `ReactiveMarkdownEditor` 接收 `value` 和 `onChange`,并通过 ref 句柄提供聚焦、选区、textarea 访问、撤销和重做。可选的 `diagnostics` 和 `document` 属性增加行号标记与绑定值类型。作者工具在本地分析源码;宿主通过 `onExport` 接入工具栏导出操作,并自行连接预览与存储。完整属性表、历史规则、只读模式和服务端渲染说明见 [React 源码编辑器](../integration/editor-ch.md)。
20
20
 
21
21
  ## 文档渲染
22
22
 
@@ -26,16 +26,16 @@ npm install reactive-md@0.5.0
26
26
 
27
27
  代码围栏支持 JavaScript、TypeScript、Python、JSON、Bash、HTML、CSS 等常见语言高亮。复制按钮保留原文,并显示成功或失败反馈。未知语言及超过 20,000 字符的代码块按纯文本显示。静态输出保留高亮;静态输出与打印不显示复制控件。
28
28
 
29
- 通过宿主 URL 策略的图片可以点击放大,也可用 Enter 或空格打开;关闭按钮、Esc 和遮罩都能关闭预览,并恢复原图焦点。带链接的图片保留链接导航,静态输出保留普通图片。用法见[作者指南](local-guide-ch.md)与[图片策略](local-integration-ch.md#图片与链接策略)。
29
+ 通过宿主 URL 策略的图片可以点击放大,也可用 Enter 或空格打开;关闭按钮、Esc 和遮罩都能关闭预览,并恢复原图焦点。带链接的图片保留链接导航,静态输出保留普通图片。用法见[作者指南](../guides/local-guide-ch.md)与[图片策略](../integration/local-integration-ch.md#图片与链接策略)。
30
30
 
31
31
  ## 兼容性
32
32
 
33
33
  现有 `reactive-md`、`reactive-md/react` 和 `reactive-md/styles.css` 导入继续有效,渲染器入口未变。为 `0.4.x` 编写的文档无需修改。本版本新增公开入口;只渲染文档的项目可以直接升级。
34
34
 
35
- 编辑器需要 React 19,核心 `reactive-md` 入口仍不依赖 React。版本轴与迁移规则见[变更记录](../CHANGELOG-ch.md)和[版本与兼容性](compatibility-ch.md)。
35
+ 编辑器需要 React 19,核心 `reactive-md` 入口仍不依赖 React。版本轴与迁移规则见[变更记录](../../CHANGELOG-ch.md)和[版本与兼容性](../compatibility/compatibility-ch.md)。
36
36
 
37
37
  ## 验证与限制
38
38
 
39
39
  0.5.0 发布门禁覆盖核心与渲染器测试、编辑器入口、类型检查、包入口、文档链接、离线安装包消费、静态渲染和浏览器交互。CI 目标为 Node 22.12、24 与 Chromium;本地浏览器检查使用 Windows 上的 Microsoft Edge。导出 HTML 以外的通用 SSR 水合、Firefox 和 WebKit 尚未验证。
40
40
 
41
- 项目仍处于 0.x 预览阶段。安全边界和宿主职责见 [SECURITY-ch.md](../SECURITY-ch.md)。
41
+ 项目仍处于 0.x 预览阶段。安全边界和宿主职责见 [SECURITY-ch.md](../../SECURITY-ch.md)。
@@ -16,7 +16,7 @@ For offline installation, use the [npm tarball](https://registry.npmjs.org/react
16
16
 
17
17
  The editor has an independent stylesheet at `reactive-md/editor/styles.css`. Its rules are scoped to the editor root, so it can be loaded without the document renderer styles. A host that shows a preview imports `reactive-md/styles.css` as before.
18
18
 
19
- `ReactiveMarkdownEditor` takes `value` and `onChange` and exposes a ref handle for focus, selection, textarea access, undo and redo. Optional `diagnostics` and `document` props add gutter markers and binding value types. Authoring tools analyze source locally; the host manages preview, storage and the toolbar export action through `onExport`. See [React source editor](editor-en.md) for the full prop table, history rules, read-only modes and server rendering notes.
19
+ `ReactiveMarkdownEditor` takes `value` and `onChange` and exposes a ref handle for focus, selection, textarea access, undo and redo. Optional `diagnostics` and `document` props add gutter markers and binding value types. Authoring tools analyze source locally; the host manages preview, storage and the toolbar export action through `onExport`. See [React source editor](../integration/editor-en.md) for the full prop table, history rules, read-only modes and server rendering notes.
20
20
 
21
21
  ## Document rendering
22
22
 
@@ -26,16 +26,16 @@ These additions extend prose parsing and document rendering. The syntax revision
26
26
 
27
27
  Fenced code blocks highlight common languages, including JavaScript, TypeScript, Python, JSON, Bash, HTML and CSS. A copy button copies the original text with success or failure feedback. Unknown languages and blocks longer than 20,000 characters remain plain text. Static output keeps highlighting; copy controls are omitted from static output and printing.
28
28
 
29
- Images approved by the host URL policy open in a modal viewer. Enter or Space opens the image; the close button, Escape or the backdrop dismisses it and restores focus. Linked images keep their link navigation. Static output keeps ordinary images. See the [author guide](local-guide-en.md) and [host integration](local-integration-en.md) for usage.
29
+ Images approved by the host URL policy open in a modal viewer. Enter or Space opens the image; the close button, Escape or the backdrop dismisses it and restores focus. Linked images keep their link navigation. Static output keeps ordinary images. See the [author guide](../guides/local-guide-en.md) and [host integration](../integration/local-integration-en.md) for usage.
30
30
 
31
31
  ## Compatibility
32
32
 
33
33
  Existing `reactive-md`, `reactive-md/react` and `reactive-md/styles.css` imports keep working, and the renderer entry is unchanged. Documents written for `0.4.x` need no edit. The release adds a public entry; projects that only render documents can upgrade without changes.
34
34
 
35
- 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.
35
+ 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.
36
36
 
37
37
  ## Validation and limits
38
38
 
39
39
  The 0.5.0 release gate covers core and renderer tests, the editor entry, 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.
40
40
 
41
- The project remains a 0.x preview. Security boundaries and host responsibilities are documented in [SECURITY.md](../SECURITY.md).
41
+ The project remains a 0.x preview. Security boundaries and host responsibilities are documented in [SECURITY.md](../../SECURITY.md).
@@ -18,22 +18,22 @@ npm install reactive-md@0.5.1
18
18
 
19
19
  编辑区、行号、语法高亮、工具栏和菜单跟随实例主题。浅色模式使用白色编辑区,深色模式保留深蓝底色,`auto` 跟随系统设置。宿主页面主题与编辑器主题相互独立。
20
20
 
21
- 完整属性表和视图行为见 [React 源码编辑器](editor-ch.md)。
21
+ 完整属性表和视图行为见 [React 源码编辑器](../integration/editor-ch.md)。
22
22
 
23
23
  ## HTML 兼容
24
24
 
25
25
  默认渲染器新增 P0 HTML 子集,包括富文本折叠、容器、标题、代码、列表、链接和图片。宿主可额外开启作者 CSS、JavaScript 和扩展 HTML;三个选项默认全部关闭。任意开启一个,整篇文档分流到隔离的原生 HTML 路径,该路径停止解析 Markdown 和 ReactiveMD。
26
26
 
27
- 这项分流是下一版本前的暂时策略。静态导出禁用作者 JavaScript。支持的子集、选项和冲突规则见 [HTML 部分兼容](html-compatibility-ch.md)。
27
+ 这项分流是下一版本前的暂时策略。静态导出禁用作者 JavaScript。支持的子集、选项和冲突规则见 [HTML 部分兼容](../reference/html-compatibility-ch.md)。
28
28
 
29
29
  ## 兼容性
30
30
 
31
31
  现有 `reactive-md`、`reactive-md/react`、`reactive-md/editor` 和 `reactive-md/styles.css` 导入保持不变。为 `0.4.x` 和 `0.5.0` 编写的文档无需修改。语法修订、组块协议和主题协议版本不变。
32
32
 
33
- 编辑器需要 React 19;核心 `reactive-md` 入口仍不依赖 React。版本轴说明见[变更记录](../CHANGELOG-ch.md)和[版本与兼容性](compatibility-ch.md)。
33
+ 编辑器需要 React 19;核心 `reactive-md` 入口仍不依赖 React。版本轴说明见[变更记录](../../CHANGELOG-ch.md)和[版本与兼容性](../compatibility/compatibility-ch.md)。
34
34
 
35
35
  ## 验证与限制
36
36
 
37
37
  0.5.1 发布门禁覆盖核心与渲染器测试、编辑器入口及其视图、类型检查、包入口、文档链接、离线安装包消费、静态渲染和浏览器交互。CI 使用 Node 22.12 和 24 搭配 Chromium;本机浏览器检查使用 Microsoft Edge。导出 HTML 之外的通用 SSR 水合、Firefox 和 WebKit 尚未验证。
38
38
 
39
- 项目仍处于 0.x 预览阶段。安全边界和宿主责任见 [SECURITY-ch.md](../SECURITY-ch.md)。
39
+ 项目仍处于 0.x 预览阶段。安全边界和宿主责任见 [SECURITY-ch.md](../../SECURITY-ch.md)。