reactive-md 0.5.3 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG-ch.md +45 -24
- package/CHANGELOG.md +45 -24
- package/CONTRIBUTING-ch.md +10 -5
- package/CONTRIBUTING.md +10 -5
- package/README-ch.md +38 -36
- package/README-en.md +45 -42
- package/README.md +45 -42
- package/SECURITY-ch.md +1 -1
- package/SECURITY.md +1 -1
- package/THIRD_PARTY_NOTICES.md +481 -1
- package/dist-library/{authoring-DJJjKYg9.js → authoring-DSC0VsNK.js} +58 -58
- package/dist-library/{compiler-UyPwGzJZ.js → compiler-CRD88BMt.js} +6218 -3363
- package/dist-library/react-Dk94rcOp.js +59658 -0
- package/dist-library/reactive-md-authoring.js +2 -2
- package/dist-library/reactive-md-editor.js +13 -0
- package/dist-library/reactive-md-react-unstyled.js +1 -1
- package/dist-library/reactive-md-react.js +1 -1
- package/dist-library/reactive-md.css +1 -1
- package/dist-library/reactive-md.js +123 -123
- package/dist-library/{runtime-DXtle_6c.js → runtime-D8KbnCd0.js} +151 -151
- package/dist-library/types/editor/types.d.ts +2 -0
- package/dist-library/types/local/code-block.d.ts +3 -1
- package/dist-library/types/local/code-languages.d.ts +7 -0
- package/dist-library/types/local/compiled-data.d.ts +6 -0
- package/dist-library/types/local/compiler.d.ts +1 -0
- package/dist-library/types/local/diagnostics.d.ts +31 -0
- package/dist-library/types/local/diagram-layout.d.ts +69 -0
- package/dist-library/types/local/html-names.d.ts +6 -0
- package/dist-library/types/local/html-table.d.ts +25 -0
- package/dist-library/types/local/math-display.d.ts +1 -0
- package/dist-library/types/local/table-surface.d.ts +10 -0
- package/dist-library/types/local/types.d.ts +2 -0
- package/dist-library/types/local/visuals.d.ts +9 -0
- package/dist-standalone/reactive-md-standalone.css +1 -1
- package/dist-standalone/reactive-md-standalone.js +75 -51
- package/docs/README.md +84 -0
- package/docs/{compatibility-ch.md → compatibility/compatibility-ch.md} +28 -18
- package/docs/{compatibility-en.md → compatibility/compatibility-en.md} +28 -18
- package/docs/{source-versioning-ch.md → compatibility/source-versioning-ch.md} +2 -2
- package/docs/{source-versioning-en.md → compatibility/source-versioning-en.md} +2 -2
- package/docs/{component-development-ch.md → development/component-development-ch.md} +7 -7
- package/docs/{component-development-en.md → development/component-development-en.md} +7 -7
- package/docs/{component-protocol-ch.md → development/component-protocol-ch.md} +17 -17
- package/docs/{component-protocol-en.md → development/component-protocol-en.md} +17 -17
- package/docs/{performance-ch.md → development/performance-ch.md} +2 -2
- package/docs/{performance-en.md → development/performance-en.md} +2 -2
- package/docs/{releasing-ch.md → development/releasing-ch.md} +12 -12
- package/docs/{releasing-en.md → development/releasing-en.md} +12 -12
- package/docs/guides/local-guide-ch.md +513 -0
- package/docs/guides/local-guide-en.md +513 -0
- package/docs/{author-tools-ch.md → integration/author-tools-ch.md} +8 -8
- package/docs/{author-tools-en.md → integration/author-tools-en.md} +8 -8
- package/docs/{editor-ch.md → integration/editor-ch.md} +7 -6
- package/docs/{editor-en.md → integration/editor-en.md} +7 -6
- package/docs/{local-integration-ch.md → integration/local-integration-ch.md} +33 -15
- package/docs/{local-integration-en.md → integration/local-integration-en.md} +33 -15
- package/docs/{shareable-export-ch.md → integration/shareable-export-ch.md} +16 -4
- package/docs/{shareable-export-en.md → integration/shareable-export-en.md} +16 -4
- package/docs/{computations-formatting-ch.md → reference/computations-formatting-ch.md} +2 -2
- package/docs/{computations-formatting-en.md → reference/computations-formatting-en.md} +2 -2
- package/docs/{constraints-collections-ch.md → reference/constraints-collections-ch.md} +2 -2
- package/docs/{constraints-collections-en.md → reference/constraints-collections-en.md} +2 -2
- package/docs/{diagnostics-counting-ch.md → reference/diagnostics-counting-ch.md} +22 -2
- package/docs/{diagnostics-counting-en.md → reference/diagnostics-counting-en.md} +22 -2
- package/docs/{html-compatibility-ch.md → reference/html-compatibility-ch.md} +42 -4
- package/docs/{html-compatibility-en.md → reference/html-compatibility-en.md} +42 -4
- package/docs/{local-components-v2-ch.md → reference/local-components-v2-ch.md} +2 -2
- package/docs/{local-components-v2-en.md → reference/local-components-v2-en.md} +2 -2
- package/docs/{local-interaction-syntax-ch.md → reference/local-interaction-syntax-ch.md} +26 -7
- package/docs/{local-interaction-syntax-en.md → reference/local-interaction-syntax-en.md} +26 -7
- package/docs/{theme-protocol-ch.md → reference/theme-protocol-ch.md} +1 -1
- package/docs/{theme-protocol-en.md → reference/theme-protocol-en.md} +1 -1
- package/docs/{release-0.4.0-ch.md → releases/release-0.4.0-ch.md} +6 -6
- package/docs/{release-0.4.0-en.md → releases/release-0.4.0-en.md} +6 -6
- package/docs/{release-0.4.1-ch.md → releases/release-0.4.1-ch.md} +2 -2
- package/docs/{release-0.4.1-en.md → releases/release-0.4.1-en.md} +2 -2
- package/docs/{release-0.5.0-ch.md → releases/release-0.5.0-ch.md} +4 -4
- package/docs/{release-0.5.0-en.md → releases/release-0.5.0-en.md} +4 -4
- package/docs/{release-0.5.1-ch.md → releases/release-0.5.1-ch.md} +4 -4
- package/docs/{release-0.5.1-en.md → releases/release-0.5.1-en.md} +4 -4
- package/docs/{release-0.5.2-ch.md → releases/release-0.5.2-ch.md} +3 -3
- package/docs/{release-0.5.2-en.md → releases/release-0.5.2-en.md} +3 -3
- package/docs/{release-0.5.3-ch.md → releases/release-0.5.3-ch.md} +1 -1
- package/docs/{release-0.5.3-en.md → releases/release-0.5.3-en.md} +1 -1
- package/docs/releases/release-0.6.0-ch.md +57 -0
- package/docs/releases/release-0.6.0-en.md +57 -0
- package/examples/conformance/README.md +4 -4
- package/examples/integration/README.md +10 -8
- package/examples/integration/worker/package.json +1 -1
- package/examples/local/README.md +5 -5
- package/examples/local/html-compat.reactive.md +19 -0
- package/package.json +9 -2
- package/dist-library/react-fizgU3i8.js +0 -12764
- package/docs/local-guide-ch.md +0 -967
- package/docs/local-guide-en.md +0 -967
|
@@ -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。版本轴说明见[变更记录](
|
|
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](
|
|
39
|
+
项目仍处于 0.x 预览阶段。安全边界和宿主责任见 [SECURITY-ch.md](../../SECURITY-ch.md)。
|
|
@@ -18,22 +18,22 @@ Containers up to 600px wide offer only Edit and Preview. A source-only editor ke
|
|
|
18
18
|
|
|
19
19
|
The editor source surface, gutter, syntax highlighting, toolbar and menus now follow the instance theme. Light mode uses a white editor surface, dark mode keeps the deep blue surface, and `auto` follows the system preference. The host page theme and the editor theme remain independent.
|
|
20
20
|
|
|
21
|
-
See [React source editor](editor-en.md) for the full prop table and view behavior.
|
|
21
|
+
See [React source editor](../integration/editor-en.md) for the full prop table and view behavior.
|
|
22
22
|
|
|
23
23
|
## HTML compatibility
|
|
24
24
|
|
|
25
25
|
The default renderer now accepts a P0 HTML subset, including disclosures, containers, headings, code, lists, links and images. Three host-owned options add author CSS, JavaScript and extended HTML. All three are off by default. Enabling any one routes the whole document to isolated native HTML, which stops Markdown and ReactiveMD interpretation for that path.
|
|
26
26
|
|
|
27
|
-
This routing is a temporary policy for the next release. Static export disables author JavaScript. See [HTML compatibility](html-compatibility-en.md) for the supported subset, options and conflict rules.
|
|
27
|
+
This routing is a temporary policy for the next release. Static export disables author JavaScript. See [HTML compatibility](../reference/html-compatibility-en.md) for the supported subset, options and conflict rules.
|
|
28
28
|
|
|
29
29
|
## Compatibility
|
|
30
30
|
|
|
31
31
|
Existing `reactive-md`, `reactive-md/react`, `reactive-md/editor` and `reactive-md/styles.css` imports keep working. Documents written for `0.4.x` and `0.5.0` need no edit. The syntax revision, component protocol and theme protocol keep their current versions.
|
|
32
32
|
|
|
33
|
-
The editor requires React 19. The core `reactive-md` entry still does not depend on React. See the [changelog](
|
|
33
|
+
The editor requires React 19. The core `reactive-md` entry still does not depend on React. See the [changelog](../../CHANGELOG.md) and [Versions and compatibility](../compatibility/compatibility-en.md) for the version axes.
|
|
34
34
|
|
|
35
35
|
## Validation and limits
|
|
36
36
|
|
|
37
37
|
The 0.5.1 release gate covers core and renderer tests, the editor entry and its views, type checking, package exports, documentation links, offline tarball consumers, static rendering and browser interaction. CI targets Node 22.12 and 24 with Chromium; local browser checks use Microsoft Edge. General SSR hydration outside exported HTML, Firefox and WebKit remain unverified.
|
|
38
38
|
|
|
39
|
-
The project remains a 0.x preview. Security boundaries and host responsibilities are documented in [SECURITY.md](
|
|
39
|
+
The project remains a 0.x preview. Security boundaries and host responsibilities are documented in [SECURITY.md](../../SECURITY.md).
|
|
@@ -18,7 +18,7 @@ npm install reactive-md@0.5.2
|
|
|
18
18
|
|
|
19
19
|
`LocalDocumentView` 和 `LocalReactiveDocument` 接受 `hostData`(按 `${kind}:${ref}` 索引的 JSON 安全数据)与仅客户端的 `hostRenderer(node, data, ctx)`。缺少 renderer、缺少数据或 renderer 抛错时显示可见占位,不会让文档失败。`mode="static"` 走同一分派。Schema 会随编译请求进入 worker;renderer 和宿主数据不会。
|
|
20
20
|
|
|
21
|
-
完整契约见[本地模式集成](local-integration-ch.md#宿主组件)与[组块协议](component-protocol-ch.md)。
|
|
21
|
+
完整契约见[本地模式集成](../integration/local-integration-ch.md#宿主组件)与[组块协议](../development/component-protocol-ch.md)。
|
|
22
22
|
|
|
23
23
|
## 协议修订
|
|
24
24
|
|
|
@@ -26,10 +26,10 @@ npm install reactive-md@0.5.2
|
|
|
26
26
|
|
|
27
27
|
## 兼容性
|
|
28
28
|
|
|
29
|
-
现有 `reactive-md`、`reactive-md/react`、`reactive-md/editor`、`reactive-md/styles.css` 和 `reactive-md/editor/styles.css` 导入继续有效。为 `0.5.x` 编写的文档无需修改;宿主扩展为可选能力。核心入口仍不依赖 React。详见[变更日志](
|
|
29
|
+
现有 `reactive-md`、`reactive-md/react`、`reactive-md/editor`、`reactive-md/styles.css` 和 `reactive-md/editor/styles.css` 导入继续有效。为 `0.5.x` 编写的文档无需修改;宿主扩展为可选能力。核心入口仍不依赖 React。详见[变更日志](../../CHANGELOG-ch.md)与[版本与兼容性](../compatibility/compatibility-ch.md)。
|
|
30
30
|
|
|
31
31
|
## 验证与限制
|
|
32
32
|
|
|
33
33
|
发布门槛覆盖类型检查、完整测试套件、文档链接、包构建和打包安装冒烟检查。单文件导出之外的通用 SSR 水合、Firefox 和 WebKit 仍未验证。
|
|
34
34
|
|
|
35
|
-
项目仍是 0.x 预览版。安全边界与宿主责任见[SECURITY-ch.md](
|
|
35
|
+
项目仍是 0.x 预览版。安全边界与宿主责任见[SECURITY-ch.md](../../SECURITY-ch.md)。
|
|
@@ -18,7 +18,7 @@ Without `hostComponents`, behavior is unchanged: the tag remains unknown and fal
|
|
|
18
18
|
|
|
19
19
|
`LocalDocumentView` and `LocalReactiveDocument` accept `hostData`, JSON-safe data keyed `${kind}:${ref}`, and a client-only `hostRenderer(node, data, ctx)`. A missing renderer, missing data or a throwing renderer renders a visible placeholder instead of failing the document. `mode="static"` uses the same dispatch. Schemas travel through the compile worker; the renderer and host data never do.
|
|
20
20
|
|
|
21
|
-
See [Local mode integration](local-integration-en.md#host-components) and [Component protocol](component-protocol-en.md) for the full contract.
|
|
21
|
+
See [Local mode integration](../integration/local-integration-en.md#host-components) and [Component protocol](../development/component-protocol-en.md) for the full contract.
|
|
22
22
|
|
|
23
23
|
## Protocol revision
|
|
24
24
|
|
|
@@ -26,10 +26,10 @@ The component protocol is now `component-protocol-2`. The syntax revision remain
|
|
|
26
26
|
|
|
27
27
|
## Compatibility
|
|
28
28
|
|
|
29
|
-
Existing `reactive-md`, `reactive-md/react`, `reactive-md/editor`, `reactive-md/styles.css` and `reactive-md/editor/styles.css` imports keep working. Documents written for `0.5.x` need no edit; the host extension is opt-in. The core entry still does not depend on React. See the [changelog](
|
|
29
|
+
Existing `reactive-md`, `reactive-md/react`, `reactive-md/editor`, `reactive-md/styles.css` and `reactive-md/editor/styles.css` imports keep working. Documents written for `0.5.x` need no edit; the host extension is opt-in. The core entry still does not depend on React. See the [changelog](../../CHANGELOG.md) and [Versions and compatibility](../compatibility/compatibility-en.md).
|
|
30
30
|
|
|
31
31
|
## Validation and limits
|
|
32
32
|
|
|
33
33
|
The release gate covers type checking, the full test suite, documentation links, the package build and a packed-package smoke check. General SSR hydration outside exported HTML, Firefox and WebKit remain unverified.
|
|
34
34
|
|
|
35
|
-
The project remains a 0.x preview. Security boundaries and host responsibilities are documented in [SECURITY.md](
|
|
35
|
+
The project remains a 0.x preview. Security boundaries and host responsibilities are documented in [SECURITY.md](../../SECURITY.md).
|
|
@@ -22,4 +22,4 @@
|
|
|
22
22
|
|
|
23
23
|
已有入口继续可用。需要文档打印布局的宿主须显式导入可选打印样式,无需迁移文档语法或协议。
|
|
24
24
|
|
|
25
|
-
参见[更新日志](
|
|
25
|
+
参见[更新日志](../../CHANGELOG-ch.md)、[作者工具](../integration/author-tools-ch.md)和[集成指南](../integration/local-integration-ch.md)。
|
|
@@ -22,4 +22,4 @@ Display math reports source-ranged warnings for unsupported commands or environm
|
|
|
22
22
|
|
|
23
23
|
Existing package entries remain available. Hosts that need document print layout should explicitly import the optional print stylesheet. No source syntax or protocol migration is required.
|
|
24
24
|
|
|
25
|
-
See the [changelog](
|
|
25
|
+
See the [changelog](../../CHANGELOG.md), [author tools](../integration/author-tools-en.md) and [integration guide](../integration/local-integration-en.md).
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# 0.6.0 发布说明
|
|
2
|
+
|
|
3
|
+
`reactive-md@0.6.0` 是同时更新 `latest` 与 `next` 的 0.x 预览版。语法修订保持 `local-draft-2`,组块协议保持 `component-protocol-2`,主题协议保持 `reactive-md-theme-1`。现有导入和文档无需迁移。
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm install reactive-md
|
|
7
|
+
# 或固定版本
|
|
8
|
+
npm install reactive-md@0.6.0
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
离线安装可下载 [npm 安装包](https://registry.npmjs.org/reactive-md/-/reactive-md-0.6.0.tgz)。
|
|
12
|
+
|
|
13
|
+
## 原生 HTML
|
|
14
|
+
|
|
15
|
+
默认渲染路径的 P0 HTML 新增原生表格。`<table>` 的正文出现 `caption`、`colgroup`、`thead`、`tbody`、`tr`、`th` 或 `td` 时按 HTML 表格渲染,支持 `colspan`、`rowspan`、`scope`、`headers` 及列组 `span`,无需开启扩展 HTML。原生表格与 Markdown 表格共用框架、标题、单元格样式和窄屏滚动;普通数字列自动右对齐。原生表格不提供搜索、排序、分页或行选择,单元格内的 Markdown、公式、插值和控件继续工作。混用 Markdown 表格行与 HTML 结构会给出诊断,并按原文显示该表格。
|
|
16
|
+
|
|
17
|
+
`div`、`p` 和 `h1` 至 `h6` 支持静态 `align` 属性,取值为 `left`、`center`、`right` 或 `justify`。链接支持显式 `target` 和 `rel`:未指定属性的 HTTP(S) 链接仍在新窗口打开,`target="_blank"` 会保留作者关系词、合并 `noopener noreferrer` 并移除 `opener`,相对链接仍在当前页面打开。
|
|
18
|
+
|
|
19
|
+
无法解析的局部原生 HTML 现在按原文显示,不再导致整篇文档失败;其余 Markdown、公式和控件继续渲染。新增 `local.html.fallback` 和 `local.html.fallbackAttribute` 警告,分别表示元素因不支持的标签或属性转为惰性源码。React 预览和 standalone 挂载在整篇 HTML 解析失败时显示完整源码,保留换行并转义标签。
|
|
20
|
+
|
|
21
|
+
## 数学排版
|
|
22
|
+
|
|
23
|
+
正文支持 `\(...\)` 行内公式和 `\[...\]` 独立公式,与美元定界符共用同一渲染器;plot 仍只接受 `$$...$$`。
|
|
24
|
+
|
|
25
|
+
排版新增 `aligned`、`align`、`align*`、`pmatrix`、`bmatrix` 和 `vmatrix` 环境,并支持 `\tag` 编号。补充 `\mathbb`、`\mathcal`、`\mathscr`、`\mathfrak`、`\textbf`、`\textit`、上下标注箭头、`\big` 系列定界符,以及 `\sec`、`\sinh`、`\pmod` 等命令。
|
|
26
|
+
|
|
27
|
+
化学式通过 mhchem 的 `\ce{...}` 编写,例如 `$\ce{H2O}$` 或 `$$\ce{2 H2 + O2 -> 2 H2O}$$`。分子下标、离子电荷、同位素、物态和反应箭头由 `mhchemparser` 转换后进入同一 MathML 渲染器;转换受长度、记号和嵌套预算限制,未支持的命令给出 `local.math.display` 诊断。
|
|
28
|
+
|
|
29
|
+
## 代码围栏
|
|
30
|
+
|
|
31
|
+
新增 `cattca`、`mermaid` 和 `vue` 高亮。Vue 单文件组件的模板、JavaScript/TypeScript、CSS/SCSS 分段高亮;Cattca 按 Markdown 正文与命令块高亮;Mermaid 围栏只高亮源码,不渲染图表。无语言标注时继续在受限语言集合中自动识别,未知语言和超过 20,000 字符的代码块保留纯文本。
|
|
32
|
+
|
|
33
|
+
## 图解与提示
|
|
34
|
+
|
|
35
|
+
node/edge 图解改用分层布局:源码顺序决定同层顺序,环路整体分组,平行边和标签位置由布局计算,连线使用平滑路径。服务端渲染和首屏仍先输出确定性的同步布局,组件挂载后再切换为最终布局。
|
|
36
|
+
|
|
37
|
+
tooltip 气泡会限制在视口内,并在滚动、缩放和内容尺寸变化时重新定位;配色跟随文档的浅色、深色和自定义主题。
|
|
38
|
+
|
|
39
|
+
## 表单与宿主 API
|
|
40
|
+
|
|
41
|
+
带 `required` 的文本、多行文本和日期控件不再设置原生 `required` 属性,改用 `aria-required` 和现有本地校验。嵌入宿主表单时,未填写的控件不会再以浏览器原生气泡阻止表单提交或 Enter 操作。
|
|
42
|
+
|
|
43
|
+
`compileLocal` 的返回值现在只包含普通对象和数组,可安全跨 React Server Components 边界传递,冻结元数据与共享引用保持不变。
|
|
44
|
+
|
|
45
|
+
编辑器 ref 句柄新增 `insertText(text)`:用文本替换当前选区,记录为一次可撤销编辑,并把光标放到插入内容之后。
|
|
46
|
+
|
|
47
|
+
## 兼容性
|
|
48
|
+
|
|
49
|
+
现有入口、导入和文档语法保持不变,为 `0.5.x` 编写的文档无需修改。原生 HTML 表格和新数学命令只增加可识别写法;此前作为普通文字显示的相关源码现在可能按 HTML 或公式渲染。新增两个随包构建的依赖:`elkjs`(EPL-2.0 OR GPL-3.0-or-later)与 `mhchemparser`(Apache-2.0),许可声明已更新到 `THIRD_PARTY_NOTICES.md`。
|
|
50
|
+
|
|
51
|
+
`latest` 从 `0.4.0` 更新到 `0.6.0`,`next` 从 `0.5.3` 更新到 `0.6.0`。版本轴与迁移规则见[变更记录](../../CHANGELOG-ch.md)和[版本与兼容性](../compatibility/compatibility-ch.md)。
|
|
52
|
+
|
|
53
|
+
## 验证与限制
|
|
54
|
+
|
|
55
|
+
发布使用完整 `npm run verify:release` 门禁,覆盖核心与 Demo 测试、类型检查、构建、第三方 notice、包入口、文档链接、仓库外真实安装包消费和浏览器交互。CI 在 Node 22.12 和 24 上运行 Node 门禁,浏览器门禁在 Chromium 上运行完整检查,并使用 Firefox 与 WebKit 运行核心工作流;本机浏览器检查使用 Microsoft Edge。Firefox 与 WebKit 的完整交互套件和导出 HTML 之外的通用 SSR 水合仍未验证。
|
|
56
|
+
|
|
57
|
+
项目仍处于 0.x 预览阶段。安全边界和宿主职责见 [SECURITY-ch.md](../../SECURITY-ch.md)。
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# 0.6.0 release
|
|
2
|
+
|
|
3
|
+
`reactive-md@0.6.0` is a 0.x preview that updates both `latest` and `next`. It keeps syntax revision `local-draft-2`, component protocol `component-protocol-2` and theme protocol `reactive-md-theme-1`. Existing imports and documents need no migration.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm install reactive-md
|
|
7
|
+
# or pin the version
|
|
8
|
+
npm install reactive-md@0.6.0
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
For offline installation, use the [npm tarball](https://registry.npmjs.org/reactive-md/-/reactive-md-0.6.0.tgz).
|
|
12
|
+
|
|
13
|
+
## Native HTML
|
|
14
|
+
|
|
15
|
+
The default P0 HTML path now supports native tables. When a `<table>` body contains `caption`, `colgroup`, `thead`, `tbody`, `tr`, `th` or `td`, it renders as an HTML table with `colspan`, `rowspan`, `scope`, `headers` and column-group `span`, without enabling extended HTML. Native and Markdown tables share the frame, caption, cell styles and narrow-screen scrolling; numeric columns keep the same automatic alignment. Native tables do not add search, sort, paging or row selection, and Markdown, formulas, interpolation and controls inside cells keep working. Mixing Markdown table rows with HTML structure produces a diagnostic and shows that table as source.
|
|
16
|
+
|
|
17
|
+
`div`, `p` and `h1` through `h6` accept a static `align` attribute with `left`, `center`, `right` or `justify`. Links accept explicit `target` and `rel`: HTTP(S) links without attributes still open in a new window, `target="_blank"` keeps author relationship words, merges `noopener noreferrer` and removes `opener`, and relative links still open in the current page.
|
|
18
|
+
|
|
19
|
+
Unparseable native HTML fragments now display as source instead of failing the whole document; the remaining Markdown, formulas and controls keep rendering. New `local.html.fallback` and `local.html.fallbackAttribute` warnings mark elements converted to inert source because of an unsupported tag or attribute. React previews and standalone mounts show the full source, with line breaks preserved and tags escaped, when whole-document HTML parsing fails.
|
|
20
|
+
|
|
21
|
+
## Math layout
|
|
22
|
+
|
|
23
|
+
Prose accepts `\(...\)` for inline math and `\[...\]` for display math through the same renderer as the dollar delimiters; plots still accept only `$$...$$`.
|
|
24
|
+
|
|
25
|
+
Display adds the `aligned`, `align`, `align*`, `pmatrix`, `bmatrix` and `vmatrix` environments with `\tag` numbering. It also adds `\mathbb`, `\mathcal`, `\mathscr`, `\mathfrak`, `\textbf`, `\textit`, labeled arrows, `\big` delimiter sizes and commands such as `\sec`, `\sinh` and `\pmod`.
|
|
26
|
+
|
|
27
|
+
Chemistry uses mhchem `\ce{...}`, for example `$\ce{H2O}$` or `$$\ce{2 H2 + O2 -> 2 H2O}$$`. `mhchemparser` converts subscripts, ionic charges, isotopes, states and reaction arrows before the shared MathML renderer; conversion is bounded by length, token and nesting budgets, and unsupported commands produce `local.math.display` diagnostics.
|
|
28
|
+
|
|
29
|
+
## Code fences
|
|
30
|
+
|
|
31
|
+
New highlighting covers `cattca`, `mermaid` and `vue`. Vue single-file components highlight templates, JavaScript/TypeScript and CSS/SCSS as separate regions; Cattca highlights Markdown prose and command blocks; Mermaid fences highlight source only and do not render diagrams. Unlabeled blocks keep the restricted automatic detection, and unknown languages or blocks longer than 20,000 characters stay plain text.
|
|
32
|
+
|
|
33
|
+
## Diagrams and tooltips
|
|
34
|
+
|
|
35
|
+
Node/edge diagrams now use a layered layout: source order sets order within a layer, cycles are grouped, parallel edges and label positions are computed by the layout, and edges use smooth paths. Server rendering and the first paint still emit a deterministic synchronous layout, then swap to the final layout after mount.
|
|
36
|
+
|
|
37
|
+
Tooltips stay inside the viewport and reposition on scroll, zoom and content-size changes. Their colors follow the document's light, dark and custom themes.
|
|
38
|
+
|
|
39
|
+
## Forms and host APIs
|
|
40
|
+
|
|
41
|
+
Required text, textarea and date controls no longer set the native `required` attribute. They use `aria-required` and the existing local validation instead. Inside a host form, an empty control no longer blocks submission or the Enter action with a browser validation bubble.
|
|
42
|
+
|
|
43
|
+
`compileLocal` now returns only plain objects and arrays, so results can cross a React Server Components boundary safely while frozen metadata and shared references stay intact.
|
|
44
|
+
|
|
45
|
+
The editor ref handle adds `insertText(text)`, which replaces the current selection, records one undoable edit and places the caret after the inserted text.
|
|
46
|
+
|
|
47
|
+
## Compatibility
|
|
48
|
+
|
|
49
|
+
Existing entries, imports and document syntax are unchanged; documents written for `0.5.x` need no edit. Native HTML tables and the new math commands only add recognized forms; source that previously displayed as ordinary text may now render as HTML or a formula. Two dependencies are bundled into the build: `elkjs` (EPL-2.0 OR GPL-3.0-or-later) and `mhchemparser` (Apache-2.0); `THIRD_PARTY_NOTICES.md` is updated.
|
|
50
|
+
|
|
51
|
+
`latest` moves from `0.4.0` to `0.6.0`, and `next` moves from `0.5.3` to `0.6.0`. See the [changelog](../../CHANGELOG.md) and [Versions and compatibility](../compatibility/compatibility-en.md) for the version axes and migration rules.
|
|
52
|
+
|
|
53
|
+
## Validation and limits
|
|
54
|
+
|
|
55
|
+
The release uses the full `npm run verify:release` gate: core and Demo tests, type checking, builds, third-party notices, package entries, documentation links, real tarball consumption outside the repository and browser interaction. CI runs the Node gate on Node 22.12 and 24; the browser gate runs the full suite on Chromium and core workflows on Firefox and WebKit. Local browser checks use Microsoft Edge. The full Firefox and WebKit interaction suites and general SSR hydration outside exported HTML remain unverified.
|
|
56
|
+
|
|
57
|
+
The project remains a 0.x preview. Security boundaries and host responsibilities are documented in [SECURITY.md](../../SECURITY.md).
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
- `actions` finds controls by `bind` and submits `value`; when `codes` is present the write is expected to be rejected, otherwise it is expected to succeed.
|
|
9
9
|
- `text` is evaluated with the updated state and the result should equal `expectedText`.
|
|
10
10
|
|
|
11
|
-
The runner lives at `tests/conformance.test.ts` in the repository; run `npm test` to check it. This suite covers shared parameters, hidden initialization, write constraints, code isolation, diagnostics, multi-slot controls, multiple selection, generated-table selection and a computed-value aggregate recalculation. It does not cover validation hints, generated table rendering, HTML export, author tooling or browser behavior; those have dedicated tests and the release gate. Full syntax conformance also includes other language tests and browser checks, with rules in the [syntax specification](../../docs/local-interaction-syntax-en.md). See the [compatibility notes](../../docs/compatibility-en.md) for cross-version guarantees on diagnostic codes.
|
|
11
|
+
The runner lives at `tests/conformance.test.ts` in the repository; run `npm test` to check it. This suite covers shared parameters, hidden initialization, write constraints, code isolation, diagnostics, multi-slot controls, multiple selection, generated-table selection and a computed-value aggregate recalculation. It does not cover validation hints, generated table rendering, HTML export, author tooling or browser behavior; those have dedicated tests and the release gate. Full syntax conformance also includes other language tests and browser checks, with rules in the [syntax specification](../../docs/reference/local-interaction-syntax-en.md). See the [compatibility notes](../../docs/compatibility/compatibility-en.md) for cross-version guarantees on diagnostic codes.
|
|
12
12
|
|
|
13
|
-
The conformance sources are unversioned and use the current `local-draft-2` revision. The optional prologue version declaration is compile metadata and does not change these semantic cases. Version rejection and migration behavior have dedicated tests and historical fixtures. See [Source revisions and migration](../../docs/source-versioning-en.md).
|
|
13
|
+
The conformance sources are unversioned and use the current `local-draft-2` revision. The optional prologue version declaration is compile metadata and does not change these semantic cases. Version rejection and migration behavior have dedicated tests and historical fixtures. See [Source revisions and migration](../../docs/compatibility/source-versioning-en.md).
|
|
14
14
|
|
|
15
15
|
## Component protocol conformance
|
|
16
16
|
|
|
17
|
-
[component-protocol-1.json](component-protocol-1.json) provides representative cases for the [component protocol](../../docs/component-protocol-en.md), covering `slider`, `tabs`, `plot` and lazy degradation of unknown components. The existing `component-protocol-1.json` remains the frozen author-component baseline now that the protocol revision is `component-protocol-2`. The [JSON Schema](component-protocol-1.schema.json) defines the conformance file format so tools from other implementations can read it. This JSON is test input and expected results; see the [development guide](../../docs/component-development-en.md) for the declaration template of a component proposal.
|
|
17
|
+
[component-protocol-1.json](component-protocol-1.json) provides representative cases for the [component protocol](../../docs/development/component-protocol-en.md), covering `slider`, `tabs`, `plot` and lazy degradation of unknown components. The existing `component-protocol-1.json` remains the frozen author-component baseline now that the protocol revision is `component-protocol-2`. The [JSON Schema](component-protocol-1.schema.json) defines the conformance file format so tools from other implementations can read it. This JSON is test input and expected results; see the [development guide](../../docs/development/component-development-en.md) for the declaration template of a component proposal.
|
|
18
18
|
|
|
19
19
|
```sh
|
|
20
20
|
npm run test:components
|
|
@@ -50,4 +50,4 @@ Execution order is fixed: validate the data format and unique IDs, compile and c
|
|
|
50
50
|
|
|
51
51
|
Compilation results, diagnostic sets, state changes and expression text are portable semantic expectations. HTML fragments only check this repository's React reference renderer; other renderers should verify equivalent user behavior and need not generate the same DOM or CSS class names.
|
|
52
52
|
|
|
53
|
-
These cases do not prove real keyboard operation, focus movement, Chinese input methods, 375px layout, timer pause, or timer cleanup after disposal. Contributions involving those behaviors still need corresponding browser evidence; see the [development guide](../../docs/component-development-en.md) for verification methods. Cross-version stability of diagnostic codes continues to follow the [compatibility notes](../../docs/compatibility-en.md).
|
|
53
|
+
These cases do not prove real keyboard operation, focus movement, Chinese input methods, 375px layout, timer pause, or timer cleanup after disposal. Contributions involving those behaviors still need corresponding browser evidence; see the [development guide](../../docs/development/component-development-en.md) for verification methods. Cross-version stability of diagnostic codes continues to follow the [compatibility notes](../../docs/compatibility/compatibility-en.md).
|
|
@@ -2,29 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
These directories use the package's public entry points and can be copied outside the repository. The commands below start from the current directory.
|
|
4
4
|
|
|
5
|
-
These examples target `0.
|
|
5
|
+
These examples target `reactive-md@0.6.0`, published on both `latest` and `next`. Copy the desired example directory outside the repository, then install the pinned version from npm as shown below. React and Vite are installed from the example's own dependencies where needed.
|
|
6
6
|
|
|
7
7
|
## Node core
|
|
8
8
|
|
|
9
|
-
Requires Node.js 22.12 or newer. The core example
|
|
9
|
+
Requires Node.js 22.12 or newer. The core example runs without React or network access after installation.
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
12
|
cd core
|
|
13
|
-
npm install
|
|
13
|
+
npm install reactive-md@0.6.0 --ignore-scripts --no-audit --no-fund
|
|
14
14
|
npm start
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
It should print `People: 2, cost: 200` first, then `People: 5, cost: 500`. The source is in [core/index.mjs](core/index.mjs).
|
|
18
18
|
|
|
19
|
-
The core and worker examples use host APIs added in the `0.4.0` preview.
|
|
20
|
-
|
|
21
19
|
## React page
|
|
22
20
|
|
|
23
21
|
Requires Node.js 22.12 or newer. The first install fetches React 19 and Vite.
|
|
24
22
|
|
|
25
23
|
```sh
|
|
26
24
|
cd react
|
|
27
|
-
npm install
|
|
25
|
+
npm install reactive-md@0.6.0
|
|
28
26
|
npm run dev
|
|
29
27
|
```
|
|
30
28
|
|
|
@@ -36,10 +34,14 @@ Open the local URL printed by the terminal, adjust the headcount and watch the c
|
|
|
36
34
|
|
|
37
35
|
```sh
|
|
38
36
|
cd worker
|
|
39
|
-
npm install
|
|
37
|
+
npm install reactive-md@0.6.0
|
|
40
38
|
npm run dev
|
|
41
39
|
```
|
|
42
40
|
|
|
43
41
|
The UI and scheduler wiring live in [worker/main.js](worker/main.js); the Worker entry is [worker/worker.js](worker/worker.js).
|
|
44
42
|
|
|
45
|
-
|
|
43
|
+
## Local package verification
|
|
44
|
+
|
|
45
|
+
To try an unpublished build, run `npm pack` in the repository root and replace `reactive-md@0.6.0` in the install commands with the absolute path to the generated `reactive-md-0.6.0.tgz`.
|
|
46
|
+
|
|
47
|
+
From the source repository root, `npm run verify:release` runs the complete gate, including standalone offline installation from the packed tarball, strict type checking, combined-feature checks, React rendering and HTML export. Use `npm run test:packed` for the focused package check after building. See the [integration guide](../../docs/integration/local-integration-en.md) for the API and host policies.
|
package/examples/local/README.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
# Local interaction syntax demo
|
|
2
2
|
|
|
3
|
-
These are standalone authoring examples for `local-draft-2`, described in the [local interaction syntax specification](../../docs/local-interaction-syntax-en.md). The Playground starts with a [quick calculator](pricing.reactive.md), followed by six focused [feature tours](showcase/README.md). Components are distributed across these six scenarios; diagnostics has an auxiliary menu. Hosts can compile and render every document through the [local mode API](../../docs/local-integration-en.md).
|
|
3
|
+
These are standalone authoring examples for `local-draft-2`, described in the [local interaction syntax specification](../../docs/reference/local-interaction-syntax-en.md). The Playground starts with a [quick calculator](pricing.reactive.md), followed by six focused [feature tours](showcase/README.md). Components are distributed across these six scenarios; diagnostics has an auxiliary menu. Hosts can compile and render every document through the [local mode API](../../docs/integration/local-integration-en.md).
|
|
4
4
|
|
|
5
5
|
The original eleven working examples and one intentionally broken diagnostics document remain in this directory, with Chinese versions in [zh/](zh/). The six feature tours live in [showcase/](showcase/README.md), with Chinese sources in [showcase/zh/](showcase/zh/). Each file runs independently. Controls, expressions and visualizations use local state.
|
|
6
6
|
|
|
7
|
-
The new [HTML compatibility example](html-compat.reactive.md) combines rich disclosures, Markdown and a bound counter. See the [temporary HTML routing policy](../../docs/html-compatibility-en.md) before enabling author CSS, JavaScript or extended HTML.
|
|
7
|
+
The new [HTML compatibility example](html-compat.reactive.md) combines rich disclosures, Markdown and a bound counter. See the [temporary HTML routing policy](../../docs/reference/html-compatibility-en.md) before enabling author CSS, JavaScript or extended HTML.
|
|
8
8
|
|
|
9
9
|
## Start with the short examples
|
|
10
10
|
|
|
11
|
-
The [workshop recipe](recipes/workshop.reactive.md) ([中文](recipes/workshop-zh.reactive.md)) combines cross-field validation, conditional tones, numeric aggregates and generated table rows. See the [constraints and collections reference](../../docs/constraints-collections-en.md) for rules and budgets.
|
|
11
|
+
The [workshop recipe](recipes/workshop.reactive.md) ([中文](recipes/workshop-zh.reactive.md)) combines cross-field validation, conditional tones, numeric aggregates and generated table rows. See the [constraints and collections reference](../../docs/reference/constraints-collections-en.md) for rules and budgets.
|
|
12
12
|
|
|
13
|
-
The [invoice recipe](recipes/invoice.reactive.md) ([中文](recipes/invoice-zh.reactive.md)) demonstrates shared calculations, constants, formatting and UTC date differences. The [calculation reference](../../docs/computations-formatting-en.md) explains its rules.
|
|
13
|
+
The [invoice recipe](recipes/invoice.reactive.md) ([中文](recipes/invoice-zh.reactive.md)) demonstrates shared calculations, constants, formatting and UTC date differences. The [calculation reference](../../docs/reference/computations-formatting-en.md) explains its rules.
|
|
14
14
|
|
|
15
|
-
Start with the [plan calculator](pricing.reactive.md), then choose a [feature tour](showcase/README.md). For the smallest possible state example, read the original [counter](counter.reactive.md). If you are new to the syntax, read the [new user guide](../../docs/local-guide-en.md).
|
|
15
|
+
Start with the [plan calculator](pricing.reactive.md), then choose a [feature tour](showcase/README.md). For the smallest possible state example, read the original [counter](counter.reactive.md). If you are new to the syntax, read the [new user guide](../../docs/guides/local-guide-en.md).
|
|
16
16
|
|
|
17
17
|
## Original standalone catalog
|
|
18
18
|
|
|
@@ -17,8 +17,27 @@
|
|
|
17
17
|
</details>
|
|
18
18
|
</details>
|
|
19
19
|
|
|
20
|
+
<div align="center">你好,**居中内容**。</div>
|
|
21
|
+
|
|
22
|
+
<p align="right">右对齐段落。</p>
|
|
23
|
+
|
|
20
24
|
<blockquote>默认模式使用现有渲染器和主题。</blockquote>
|
|
21
25
|
|
|
22
26
|
<ol start="3"><li>支持 HTML 列表。</li><li>代码按原样显示。</li></ol>
|
|
23
27
|
|
|
24
28
|
<pre><code><counter label="这里是代码"> {{ count }}</code></pre>
|
|
29
|
+
|
|
30
|
+
<table label="Markdown 表格" searchable="false" sortable="false">
|
|
31
|
+
| 项目 | 数值 |
|
|
32
|
+
| --- | ---: |
|
|
33
|
+
| 当前次数 | {{ count }} |
|
|
34
|
+
| 固定值 | 10 |
|
|
35
|
+
</table>
|
|
36
|
+
|
|
37
|
+
<table>
|
|
38
|
+
<caption>原生 HTML 表格</caption>
|
|
39
|
+
<tr><th scope="col">项目</th><th scope="col">数值</th></tr>
|
|
40
|
+
<tr><td>当前次数</td><td>{{ count }}</td></tr>
|
|
41
|
+
<tr><td>固定值</td><td>10</td></tr>
|
|
42
|
+
<tr><td colspan="2">**合并单元格**也支持 Markdown 和公式:\(x^2\)。</td></tr>
|
|
43
|
+
</table>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reactive-md",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Author interactive local documents in Markdown, with expression-bound inputs, charts and diagrams.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown",
|
|
@@ -66,6 +66,9 @@
|
|
|
66
66
|
"test:components": "vitest run --config vitest.config.ts tests/component-protocol.test.ts tests/conformance.test.ts",
|
|
67
67
|
"test:demo": "npm run build:lib && npm run test --workspace=@reactive-md/demo",
|
|
68
68
|
"test:browser": "npm run test:browser --workspace=@reactive-md/demo",
|
|
69
|
+
"test:browser:core": "node scripts/verify-browser-core.mjs",
|
|
70
|
+
"test:required-browser": "node scripts/verify-required-form-browser.mjs",
|
|
71
|
+
"test:tooltip-browser": "node scripts/verify-tooltip-browser.mjs",
|
|
69
72
|
"test:shareable": "node scripts/verify-shareable.mjs",
|
|
70
73
|
"test:toolbar": "npm run test:toolbar --workspace=@reactive-md/demo",
|
|
71
74
|
"test:package": "node scripts/verify-package.mjs",
|
|
@@ -75,7 +78,8 @@
|
|
|
75
78
|
"test:date-browser": "node scripts/verify-date-input-browser.mjs",
|
|
76
79
|
"test:editor-browser": "node scripts/verify-editor-browser.mjs",
|
|
77
80
|
"test:markdown-browser": "node scripts/verify-markdown-browser.mjs",
|
|
78
|
-
"test:
|
|
81
|
+
"test:math-browser": "node scripts/verify-math-browser.mjs",
|
|
82
|
+
"test:html-browser": "node scripts/verify-html-compat-browser.mjs && node scripts/verify-html-table-browser.mjs",
|
|
79
83
|
"test:media-browser": "node scripts/verify-media-browser.mjs",
|
|
80
84
|
"test:computations-browser": "node scripts/verify-computations-browser.mjs",
|
|
81
85
|
"test:constraints-browser": "node scripts/verify-constraints-browser.mjs",
|
|
@@ -131,7 +135,10 @@
|
|
|
131
135
|
"@types/node": "26.6.5",
|
|
132
136
|
"@types/react": "19.3.0",
|
|
133
137
|
"@types/react-dom": "19.3.0",
|
|
138
|
+
"elkjs": "0.12.0",
|
|
139
|
+
"highlight.js": "11.11.2",
|
|
134
140
|
"lowlight": "3.3.0",
|
|
141
|
+
"mhchemparser": "4.2.1",
|
|
135
142
|
"parse5": "8.0.1",
|
|
136
143
|
"react": "19.3.1",
|
|
137
144
|
"react-dom": "19.3.1",
|