reactive-md 0.6.0 → 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 (105) hide show
  1. package/CHANGELOG-ch.md +203 -194
  2. package/CHANGELOG.md +203 -194
  3. package/CONTRIBUTING-ch.md +67 -67
  4. package/CONTRIBUTING.md +69 -69
  5. package/README-ch.md +157 -157
  6. package/README-en.md +184 -184
  7. package/README.md +184 -184
  8. package/SECURITY-ch.md +81 -81
  9. package/SECURITY.md +81 -81
  10. package/THIRD_PARTY_NOTICES.md +313 -209
  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-DSC0VsNK.js → authoring-BEVyth5X.js} +1 -1
  25. package/dist-library/compiler-Cm3ppMxG.js +46044 -0
  26. package/dist-library/{react-Dk94rcOp.js → react-Bh7_oxZp.js} +20110 -20113
  27. package/dist-library/reactive-md-authoring.js +2 -2
  28. package/dist-library/reactive-md-print.css +284 -284
  29. package/dist-library/reactive-md-react-unstyled.js +1 -1
  30. package/dist-library/reactive-md-react.js +1 -1
  31. package/dist-library/reactive-md.css +1 -1
  32. package/dist-library/reactive-md.js +3 -3
  33. package/dist-library/{runtime-D8KbnCd0.js → runtime-DlFYQ4s_.js} +1 -1
  34. package/dist-library/types/local/math-display.d.ts +22 -23
  35. package/dist-library/types/local/math-view.d.ts +6 -7
  36. package/dist-standalone/reactive-md-standalone.css +1 -1
  37. package/dist-standalone/reactive-md-standalone.js +318 -62
  38. package/docs/compatibility/compatibility-ch.md +121 -119
  39. package/docs/compatibility/compatibility-en.md +121 -119
  40. package/docs/compatibility/source-versioning-ch.md +159 -159
  41. package/docs/compatibility/source-versioning-en.md +159 -159
  42. package/docs/development/component-development-ch.md +210 -210
  43. package/docs/development/component-development-en.md +210 -210
  44. package/docs/development/component-protocol-ch.md +747 -747
  45. package/docs/development/component-protocol-en.md +747 -747
  46. package/docs/development/performance-ch.md +76 -76
  47. package/docs/development/performance-en.md +76 -76
  48. package/docs/development/releasing-ch.md +108 -108
  49. package/docs/development/releasing-en.md +108 -108
  50. package/docs/integration/author-tools-ch.md +62 -62
  51. package/docs/integration/author-tools-en.md +62 -62
  52. package/docs/integration/shareable-export-ch.md +209 -209
  53. package/docs/integration/shareable-export-en.md +211 -211
  54. package/docs/reference/computations-formatting-ch.md +87 -87
  55. package/docs/reference/computations-formatting-en.md +87 -87
  56. package/docs/reference/constraints-collections-ch.md +84 -84
  57. package/docs/reference/constraints-collections-en.md +84 -84
  58. package/docs/reference/diagnostics-counting-ch.md +104 -104
  59. package/docs/reference/diagnostics-counting-en.md +104 -104
  60. package/docs/reference/local-components-v2-ch.md +138 -138
  61. package/docs/reference/local-components-v2-en.md +104 -104
  62. package/docs/reference/local-interaction-syntax-ch.md +515 -511
  63. package/docs/reference/local-interaction-syntax-en.md +511 -507
  64. package/docs/reference/theme-protocol-ch.md +107 -107
  65. package/docs/reference/theme-protocol-en.md +107 -107
  66. package/docs/releases/release-0.4.0-ch.md +89 -89
  67. package/docs/releases/release-0.4.0-en.md +89 -89
  68. package/docs/releases/release-0.4.1-ch.md +23 -23
  69. package/docs/releases/release-0.4.1-en.md +23 -23
  70. package/docs/releases/release-0.6.1-ch.md +27 -0
  71. package/docs/releases/release-0.6.1-en.md +27 -0
  72. package/examples/conformance/README.md +53 -53
  73. package/examples/conformance/component-protocol-1.json +482 -482
  74. package/examples/conformance/component-protocol-1.schema.json +76 -76
  75. package/examples/conformance/local-draft-1.json +50 -50
  76. package/examples/conformance/local-draft-2.json +212 -212
  77. package/examples/integration/README.md +47 -47
  78. package/examples/integration/core/index.mjs +32 -32
  79. package/examples/integration/worker/index.html +19 -19
  80. package/examples/integration/worker/main.js +61 -61
  81. package/examples/integration/worker/package.json +13 -13
  82. package/examples/integration/worker/worker.js +3 -3
  83. package/examples/local/README.md +74 -74
  84. package/examples/local/charts.reactive.md +73 -73
  85. package/examples/local/recipes/invoice-zh.reactive.md +36 -36
  86. package/examples/local/recipes/invoice.reactive.md +36 -36
  87. package/examples/local/recipes/workshop-zh.reactive.md +33 -33
  88. package/examples/local/recipes/workshop.reactive.md +33 -33
  89. package/examples/local/showcase/README.md +25 -25
  90. package/examples/local/showcase/explore.reactive.md +102 -102
  91. package/examples/local/showcase/flow.reactive.md +86 -86
  92. package/examples/local/showcase/forms.reactive.md +126 -126
  93. package/examples/local/showcase/functions.reactive.md +119 -119
  94. package/examples/local/showcase/layout.reactive.md +100 -100
  95. package/examples/local/showcase/statistics.reactive.md +108 -108
  96. package/examples/local/showcase/tasks.reactive.md +89 -89
  97. package/examples/local/showcase/zh/explore.reactive.md +102 -102
  98. package/examples/local/showcase/zh/flow.reactive.md +86 -86
  99. package/examples/local/showcase/zh/forms.reactive.md +126 -126
  100. package/examples/local/showcase/zh/functions.reactive.md +119 -119
  101. package/examples/local/showcase/zh/layout.reactive.md +100 -100
  102. package/examples/local/showcase/zh/statistics.reactive.md +108 -108
  103. package/examples/local/showcase/zh/tasks.reactive.md +89 -89
  104. package/package.json +152 -152
  105. package/dist-library/compiler-CRD88BMt.js +0 -24964
@@ -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` 升级的步骤。具体规则仍以链接的参考页为准;本页是升级清单。显式修订声明和迁移工具见[源码修订与迁移](../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
+ # 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](../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
+ # 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).
@@ -0,0 +1,27 @@
1
+ # 0.6.1 发布说明
2
+
3
+ `reactive-md@0.6.1` 将公式展示从原生 MathML 切换为 KaTeX,同时更新 `latest` 与 `next`。语法修订 `local-draft-2`、组块协议 `component-protocol-2` 和主题协议 `reactive-md-theme-1` 保持不变。
4
+
5
+ ```sh
6
+ npm install reactive-md
7
+ # 或固定版本
8
+ npm install reactive-md@0.6.1
9
+ ```
10
+
11
+ 离线安装可下载 [npm 安装包](https://registry.npmjs.org/reactive-md/-/reactive-md-0.6.1.tgz)。
12
+
13
+ ## 公式展示
14
+
15
+ KaTeX 使用配套数学字体排版行内与独立公式,输出可视 HTML、用于辅助技术的 MathML,以及保留原始 LaTeX 的注释。积分、分式、矩阵、多行对齐、公式编号与 mhchem 化学式使用同一渲染器。编译诊断与实际展示共用 KaTeX 的语法支持范围,新增有效写法包括 `matrix`、`\overset`、`\displaystyle` 和 `\limits`。
16
+
17
+ 标准样式内嵌 20 个 WOFF2 字体文件,预览、打印及单文件 HTML 均可离线显示公式;禁用 JavaScript 的静态 HTML 也保留排版。行内公式跟随文字基线,并在 KaTeX 允许的位置换行。超宽独立公式可横向滚动,编号与正文之间预留间距。
18
+
19
+ ## 兼容性
20
+
21
+ 现有导入继续有效。使用无样式 React 入口时,加载 `reactive-md/styles.css`,或由宿主提供 KaTeX 样式和字体。内嵌渲染器与字体会增加下载体积。
22
+
23
+ `align` 现在自动按行编号;无需自动编号时使用 `align*` 或 `aligned`。显式 `\tag` 用于独立公式。无效或不支持的公式现在整条回退为有界原文,并在对应源码位置给出 `local.math.display` 警告。
24
+
25
+ 绘图求值保留现有解析器、函数支持范围和参数更新逻辑。作者自定义宏、HTML、文件与网络命令继续关闭;输入长度、嵌套、记号数、宏展开与作者指定尺寸均受预算限制。详见[语法参考](../reference/local-interaction-syntax-ch.md)和[安全策略](../../SECURITY-ch.md)。
26
+
27
+ KaTeX 及其字体替代独立的 `mhchemparser` 依赖;随包 mhchem 扩展的上游版权与 Apache-2.0 声明保留在 `THIRD_PARTY_NOTICES.md`。
@@ -0,0 +1,27 @@
1
+ # 0.6.1 release
2
+
3
+ `reactive-md@0.6.1` replaces native MathML formula display with KaTeX. It updates both `latest` and `next`. Syntax revision `local-draft-2`, component protocol `component-protocol-2` and theme protocol `reactive-md-theme-1` stay unchanged.
4
+
5
+ ```sh
6
+ npm install reactive-md
7
+ # or pin the version
8
+ npm install reactive-md@0.6.1
9
+ ```
10
+
11
+ For offline installation, use the [npm tarball](https://registry.npmjs.org/reactive-md/-/reactive-md-0.6.1.tgz).
12
+
13
+ ## Formula display
14
+
15
+ KaTeX typesets inline and display formulas with its math fonts. Visual HTML is paired with MathML for assistive technology and an annotation containing the original LaTeX. Integrals, fractions, matrices, alignment, equation tags and mhchem chemistry use the same renderer. Formula display and compiler diagnostics now share KaTeX's supported syntax, including `matrix`, `\overset`, `\displaystyle` and `\limits`.
16
+
17
+ The standard stylesheet embeds 20 WOFF2 font faces. Preview, print and single-file HTML exports can display formulas offline, including static HTML with JavaScript disabled. Inline formulas follow the text baseline and wrap at KaTeX break points. Wide display formulas scroll horizontally; equation tags reserve space beside the formula.
18
+
19
+ ## Compatibility
20
+
21
+ Existing imports keep working. Load `reactive-md/styles.css` when using the unstyled React entry, or provide KaTeX styles and fonts in the host. The bundled renderer and fonts increase download size.
22
+
23
+ `align` numbers rows automatically. Use `align*` or `aligned` for unnumbered alignment. Explicit `\tag` belongs in display formulas. Invalid or unsupported formulas now fall back to bounded source text for the whole formula, with a `local.math.display` warning at the source range.
24
+
25
+ Plot evaluation keeps the existing parser, supported functions and parameter updates. Author-defined macros, HTML, file and network commands remain disabled. Input size, nesting, token count, macro expansion and user-specified dimensions are bounded. See the [syntax reference](../reference/local-interaction-syntax-en.md) and [security policy](../../SECURITY.md).
26
+
27
+ KaTeX and its fonts replace the separate `mhchemparser` dependency. The bundled mhchem extension's upstream copyright and Apache-2.0 notice are retained in `THIRD_PARTY_NOTICES.md`.