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
|
@@ -65,25 +65,63 @@ React 快捷组件通过 `compileOptions` 接收同样的设置:
|
|
|
65
65
|
| 代码 | `code`、`pre`、`pre` 内的 `code` |
|
|
66
66
|
| 列表 | `ul`、`ol`、`li`,含 `ol[start]` |
|
|
67
67
|
| 链接与图片 | `a`、`img`,沿用默认路径的 URL 策略 |
|
|
68
|
+
| 原生表格 | `table`、`caption`、`colgroup`、`col`、`thead`、`tbody`、`tfoot`、`tr`、`th`、`td`,按正文结构与 ReactiveMD 表格区分 |
|
|
68
69
|
| 其他写法 | HTML 注释、命名及数字字符引用、HTML 大小写和空元素写法 |
|
|
69
70
|
|
|
70
71
|
容器中的正文继续解析 Markdown、公式、插值和 ReactiveMD 控件;`code`、`pre` 中的内容按字面显示。`details` 复用现有折叠组件的主题和交互,支持富文本标题、嵌套和 `open`,静态模式展开正文。HTML 布尔属性按存在与否判断,因此 `open="false"` 仍表示展开;现有 ReactiveMD 组件的布尔值规则保持不变。
|
|
71
72
|
|
|
72
|
-
可运行示例见 [HTML 与 ReactiveMD](
|
|
73
|
+
可运行示例见 [HTML 与 ReactiveMD](../../examples/local/html-compat.reactive.md)。
|
|
74
|
+
|
|
75
|
+
`div`、`p` 和 `h1` 至 `h6` 支持静态 `align` 属性,取值为 `left`、`center`、`right` 或 `justify`,忽略大小写和首尾空白。例如:
|
|
76
|
+
|
|
77
|
+
```html
|
|
78
|
+
<div align="center">你好</div>
|
|
79
|
+
<p align="right">右对齐的 **Markdown** 段落。</p>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
对齐不需要开启 CSS 或扩展 HTML,容器内的 Markdown 和绑定继续生效;嵌套元素可以设置自己的对齐。原生 HTML 路径同样接受这些限定值。
|
|
73
83
|
|
|
74
84
|
通用属性按允许列表接收,支持文档标识、标题、语言、方向和可访问性属性。默认模式中的作者 `style`、事件处理属性及不支持的标签保持惰性源码或产生定位诊断。图片仍需宿主明确允许后才加载。代码与不支持区域不执行脚本。
|
|
75
85
|
|
|
86
|
+
`a` 支持静态 `target`、`rel` 属性,例如 `<a href="https://example.com" target="_self" rel="nofollow">当前页面打开</a>`。显式 `target` 覆盖默认打开方式,`rel` 支持多个空白分隔的关系词。默认混排模式中,未指定属性的 HTTP(S) 链接仍使用 `_blank` 和 `noopener noreferrer`;相对链接仍在当前页面打开。`target="_blank"` 会保留作者关系词、合并 `noopener noreferrer` 并移除冲突的 `opener`。沙箱 HTML 路径也支持这两个属性,且继续限制 `_top`、`_parent` 导航及弹窗权限。
|
|
87
|
+
|
|
88
|
+
## 两种表格写法
|
|
89
|
+
|
|
90
|
+
`<table>` 的正文是 Markdown 表格时,继续使用 ReactiveMD 表格组件,保留搜索、排序、分页和行选择。正文出现原生表格结构时,解析为 HTML 表格,无需开启扩展 HTML,也不切换整篇文档的模式:
|
|
91
|
+
|
|
92
|
+
```html
|
|
93
|
+
<table>
|
|
94
|
+
<caption>价格表</caption>
|
|
95
|
+
<tr><th scope="col">商品</th><th scope="col">价格</th></tr>
|
|
96
|
+
<tr><td>苹果</td><td>5</td></tr>
|
|
97
|
+
<tr><td colspan="2">**说明**:价格可随参数更新。</td></tr>
|
|
98
|
+
</table>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
两种写法共用表格框架、标题、单元格样式和窄屏滚动。普通数字列使用相同的自动对齐规则;合并单元格保留其结构,单元格可用 `align` 明确设置对齐。原生表格默认不添加搜索、排序、分页或选择控件。
|
|
102
|
+
|
|
103
|
+
支持 `colspan`、`rowspan`、`scope`、`headers` 和 `col` / `colgroup` 的 `span`。`colspan` 与 `span` 为 1–1000;`rowspan` 为 0–65534,其中 0 表示延伸到当前行组末尾。单元格和标题内继续解析 Markdown、公式、插值、图片及控件;省略的行组、行和单元格结束标签按 HTML 规则补齐,原始源码位置保持不变。
|
|
104
|
+
|
|
105
|
+
同一表格混用 Markdown 表格行与 HTML 表格结构会产生诊断,并将该表格按原文显示。原生表格不接受 `bind`、`key`、`label`、`searchable`、`sortable`、`page-size` 等组件属性;标题用 `caption`,无障碍名称也可用 `aria-label`。代码示例中的结构标签不参与类型判断。
|
|
106
|
+
|
|
107
|
+
### 原文回退
|
|
108
|
+
|
|
109
|
+
成功转为惰性源码时发出 `local.html.fallback` 警告。未知 ReactiveMD 组件继续使用 `local.component.unknown`;致命编译失败仍返回 `ok: false`。宿主可以单独放行回退警告,同时保留对组件拼写错误的检查。详见[诊断契约](diagnostics-counting-ch.md#原生-html-安全回退)。
|
|
110
|
+
|
|
111
|
+
无法编译的局部原生 HTML 按原文显示,其余 Markdown、公式和控件继续工作。回退覆盖不支持的标签或属性、无效的原生表格,以及缺少完整结束标记的 HTML 片段。无法找到结束标签时,片段截至当前段落或外层 ReactiveMD 容器的结束标签。回退片段中的 Markdown、`{{ 表达式 }}`、组件和脚本均保留为文本。
|
|
112
|
+
|
|
113
|
+
原生 HTML 路径中,不支持的属性会使所在元素回退为原文;相邻元素继续渲染。整篇解析、序列化或编译预算检查失败时,React 预览和 standalone 挂载显示完整源码,保留换行并转义标签。`compileLocal` 的错误结果、资源限制和 `onDiagnostics` 诊断仍保留;配置错误及 ReactiveMD 组件语法错误继续按原规则处理。
|
|
114
|
+
|
|
76
115
|
## 扩展 HTML
|
|
77
116
|
|
|
78
117
|
`enableExtendedHtml` 管理以下作者语法:
|
|
79
118
|
|
|
80
|
-
- 表格及结构:`table`、`caption`、`thead`、`tbody`、`tfoot`、`tr`、`th`、`td`。
|
|
81
119
|
- 定义列表:`dl`、`dt`、`dd`。
|
|
82
120
|
- 补充文字语义:`small`、`kbd`、`samp`、`var`、`abbr`、`q`、`cite`、`ins`。
|
|
83
121
|
- 图文和结构:`figure`、`figcaption`、`article`、`section`、`aside`、`header`、`footer`、`ruby`、`rt`、`rp`、`wbr`。
|
|
84
122
|
- 原生表单、`iframe`、`object`、`embed`、`dialog`、任意 SVG/MathML 和整页 HTML 功能。
|
|
85
123
|
|
|
86
|
-
|
|
124
|
+
在默认模式中,ReactiveMD `<table>` 按正文结构与原生表格区分;`<section>`、`<input>`、`<select>` 等同名组件继续采用当前语义。在原生 HTML 模式中,同名元素采用浏览器语义。
|
|
87
125
|
|
|
88
126
|
## 隔离与导出
|
|
89
127
|
|
|
@@ -95,4 +133,4 @@ React 快捷组件通过 `compileOptions` 接收同样的设置:
|
|
|
95
133
|
|
|
96
134
|
交互导出保留本次编译选项和文档路径。原生 HTML 的静态导出保留浏览器内建的折叠和表单行为,并禁用作者 JavaScript。这类文档没有可保存的 ReactiveMD 参数。旧导出载荷省略编译选项时采用三个开关全部关闭的默认行为。
|
|
97
135
|
|
|
98
|
-
相关规则见[集成说明](local-integration-ch.md)、[可分享导出](shareable-export-ch.md)和[安全约定](
|
|
136
|
+
相关规则见[集成说明](../integration/local-integration-ch.md)、[可分享导出](../integration/shareable-export-ch.md)和[安全约定](../../SECURITY-ch.md)。
|
|
@@ -65,25 +65,63 @@ Lower-level hosts pass the compiled document to `LocalDocumentView`. Native HTML
|
|
|
65
65
|
| Code | `code`, `pre`, and `code` inside `pre` |
|
|
66
66
|
| Lists | `ul`, `ol`, `li`, including `ol[start]` |
|
|
67
67
|
| Links and images | `a`, `img`, using the default path's URL policy |
|
|
68
|
+
| Native tables | `table`, `caption`, `colgroup`, `col`, `thead`, `tbody`, `tfoot`, `tr`, `th`, `td`; distinguished from ReactiveMD tables by their body structure |
|
|
68
69
|
| Other forms | HTML comments, named and numeric character references, case-insensitive HTML names and void-element spelling |
|
|
69
70
|
|
|
70
71
|
Container bodies continue to parse Markdown, formulas, interpolation and ReactiveMD controls. Code elements preserve literal content. `details` reuses the existing disclosure theme and interaction, with rich summaries, nesting and the `open` attribute. Static rendering expands the body. HTML boolean attributes use presence semantics, so `open="false"` still means open. Existing ReactiveMD component boolean rules stay unchanged.
|
|
71
72
|
|
|
72
|
-
See the runnable [HTML and ReactiveMD example](
|
|
73
|
+
See the runnable [HTML and ReactiveMD example](../../examples/local/html-compat.reactive.md).
|
|
74
|
+
|
|
75
|
+
`div`, `p` and `h1` through `h6` accept a static `align` attribute with `left`, `center`, `right` or `justify`. Values ignore case and surrounding whitespace. For example:
|
|
76
|
+
|
|
77
|
+
```html
|
|
78
|
+
<div align="center">Hello</div>
|
|
79
|
+
<p align="right">A right-aligned **Markdown** paragraph.</p>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Alignment works without enabling CSS or extended HTML. Markdown and bindings inside the container remain active, and nested elements can override the inherited alignment. The native HTML route accepts the same bounded values.
|
|
73
83
|
|
|
74
84
|
Common attributes use an allowlist for document identifiers, titles, language, direction and accessibility. Author styles, event-handler attributes and unsupported elements in the default mode remain inert source or produce positioned diagnostics. Images still require explicit host approval. Code and unsupported regions execute no scripts.
|
|
75
85
|
|
|
86
|
+
Anchors accept static `target` and `rel` attributes, for example `<a href="https://example.com" target="_self" rel="nofollow">Open here</a>`. An explicit `target` overrides the default opening behavior; `rel` accepts whitespace-separated relationship tokens. In the default mixed mode, HTTP(S) links without these attributes retain `_blank` and `noopener noreferrer`, while relative links open in the current page. A `_blank` target preserves author relationship tokens, merges `noopener noreferrer` and removes the conflicting `opener` token. The sandboxed HTML route also accepts these attributes, retaining its restrictions on `_top`, `_parent` navigation and popups.
|
|
87
|
+
|
|
88
|
+
## Two table syntaxes
|
|
89
|
+
|
|
90
|
+
A `<table>` containing a Markdown table remains a ReactiveMD component, with its existing search, sorting, pagination and row selection. A body with native table structure is parsed as an HTML table without enabling extended HTML or changing the whole document's mode:
|
|
91
|
+
|
|
92
|
+
```html
|
|
93
|
+
<table>
|
|
94
|
+
<caption>Prices</caption>
|
|
95
|
+
<tr><th scope="col">Item</th><th scope="col">Price</th></tr>
|
|
96
|
+
<tr><td>Apple</td><td>5</td></tr>
|
|
97
|
+
<tr><td colspan="2">**Note**: prices can follow document parameters.</td></tr>
|
|
98
|
+
</table>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Both syntaxes share the table frame, title, cell styles and narrow-screen scrolling. Plain numeric columns use the same automatic alignment rules. Merged cells preserve their structure; cells can set `align` explicitly. Native tables add no search, sorting, pagination or selection controls by default.
|
|
102
|
+
|
|
103
|
+
Supported attributes include `colspan`, `rowspan`, `scope`, `headers` and `span` on `col` / `colgroup`. `colspan` and `span` accept 1–1000; `rowspan` accepts 0–65534, with 0 extending to the end of the current row group. Cells and captions support Markdown, formulas, interpolation, images and controls. Omitted row groups, row ends and cell ends are normalized using HTML rules, while source locations retain their original offsets.
|
|
104
|
+
|
|
105
|
+
Mixing Markdown table rows and HTML table structure in one table produces a diagnostic and displays that table as source. Native tables reject component attributes such as `bind`, `key`, `label`, `searchable`, `sortable` and `page-size`; use `caption` for a title or `aria-label` for an accessible name. Structural tags inside code examples never determine the table type.
|
|
106
|
+
|
|
107
|
+
### Source fallback
|
|
108
|
+
|
|
109
|
+
Successful conversion to inert source emits a `local.html.fallback` warning. Unknown ReactiveMD components retain `local.component.unknown`; fatal compilation still returns `ok: false`. Hosts can explicitly allow the fallback warning without allowing component spelling errors. See the [diagnostic contract](diagnostics-counting-en.md#safe-native-html-fallback).
|
|
110
|
+
|
|
111
|
+
Native HTML fragments that cannot compile are displayed as their original text, while surrounding Markdown, formulas and controls continue to work. This covers unsupported tags or attributes, invalid native tables and incomplete HTML fragments. An unclosed fragment ends at the current paragraph boundary or the enclosing ReactiveMD container's closing tag. Markdown, `{{ expressions }}`, components and scripts inside a fallback fragment stay literal.
|
|
112
|
+
|
|
113
|
+
In the native HTML route, an unsupported attribute makes its element fall back to source while neighboring elements continue to render. If whole-document parsing, serialization or compilation budget checks fail, React previews and standalone mounts display the complete source with preserved line breaks and escaped tags. Error results from `compileLocal`, resource limits and `onDiagnostics` reports are retained. Invalid host options and ReactiveMD component syntax errors keep their existing behavior.
|
|
114
|
+
|
|
76
115
|
## Extended HTML
|
|
77
116
|
|
|
78
117
|
`enableExtendedHtml` controls the following author syntax:
|
|
79
118
|
|
|
80
|
-
- Tables and their structure: `table`, `caption`, `thead`, `tbody`, `tfoot`, `tr`, `th`, `td`.
|
|
81
119
|
- Definition lists: `dl`, `dt`, `dd`.
|
|
82
120
|
- Additional text semantics: `small`, `kbd`, `samp`, `var`, `abbr`, `q`, `cite`, `ins`.
|
|
83
121
|
- Figures and structure: `figure`, `figcaption`, `article`, `section`, `aside`, `header`, `footer`, `ruby`, `rt`, `rp`, `wbr`.
|
|
84
122
|
- Native forms, `iframe`, `object`, `embed`, `dialog`, arbitrary SVG/MathML and whole-page HTML features.
|
|
85
123
|
|
|
86
|
-
In the default mode,
|
|
124
|
+
In the default mode, `table` distinguishes native and ReactiveMD syntax by its body; existing components such as `section`, `input` and `select` retain their current meanings. In native HTML mode, these names use browser semantics.
|
|
87
125
|
|
|
88
126
|
## Isolation and export
|
|
89
127
|
|
|
@@ -95,4 +133,4 @@ Once arbitrary JavaScript is enabled, scripts can create elements and styles dyn
|
|
|
95
133
|
|
|
96
134
|
Interactive export preserves compile options and the selected rendering path. Native HTML static export retains built-in browser disclosure and form behavior while disabling author JavaScript. These documents have no ReactiveMD parameters to save. Older export payloads without compile options use the default with all three capabilities off.
|
|
97
135
|
|
|
98
|
-
See [integration](local-integration-en.md), [shareable export](shareable-export-en.md) and [security](
|
|
136
|
+
See [integration](../integration/local-integration-en.md), [shareable export](../integration/shareable-export-en.md) and [security](../../SECURITY.md).
|
|
@@ -126,7 +126,7 @@ key 指定静态标识列,值必须非空、唯一且没有插值。提供 key
|
|
|
126
126
|
|
|
127
127
|
local-draft-1 中已支持的写法继续有效。本扩展引入 10 个新组块名:jump、anchor、text、section、multi-select、range-slider、coordinate、quiz、steps、step。同一版本还增加声明标签 computed、const、validation 和结构标签 data-table、column,`local-draft-2` 的完整集合为 48 个标签名;开头的 `<theme>` 声明是元数据,不计入组块。新名称以前会作为未知源码惰性显示,现在开始解释其中的受支持内容;若原文用于演示标签,放进代码围栏或行内代码。checklist 的完成样式是可见变化。
|
|
128
128
|
|
|
129
|
-
机器验收沿用 component-protocol-1 的格式,syntaxVersion 更新为 local-draft-2;旧 local-draft-1.json 留作历史数据,新构建运行 local-draft-2.json。新组件另有核心、渲染和可视化用例。错误仍使用带源码位置的 Diagnostic,未知标签、脚注、安全与资源预算保持已有契约。同一版本还新增表达式函数保留名;完整重命名清单见[0.4.0 发布与迁移](release-0.4.0-ch.md)。
|
|
129
|
+
机器验收沿用 component-protocol-1 的格式,syntaxVersion 更新为 local-draft-2;旧 local-draft-1.json 留作历史数据,新构建运行 local-draft-2.json。新组件另有核心、渲染和可视化用例。错误仍使用带源码位置的 Diagnostic,未知标签、脚注、安全与资源预算保持已有契约。同一版本还新增表达式函数保留名;完整重命名清单见[0.4.0 发布与迁移](../releases/release-0.4.0-ch.md)。
|
|
130
130
|
|
|
131
131
|
| 协议条款 | 实现与证据入口 |
|
|
132
132
|
| --- | --- |
|
|
@@ -135,4 +135,4 @@ local-draft-1 中已支持的写法继续有效。本扩展引入 10 个新组
|
|
|
135
135
|
| CP-A11Y、CP-STYLE | LocalDocumentView、visuals 及相应样式;SSR 与浏览器检查 |
|
|
136
136
|
| CP-CORE、CP-COMPAT、CP-ACCEPT | 独立 core/React 构建、机器验收、打包和本页迁移说明 |
|
|
137
137
|
|
|
138
|
-
双语可运行示例分布在[六个场景](
|
|
138
|
+
双语可运行示例分布在[六个场景](../../examples/local/showcase/README.md):函数场景包含区间、坐标与数值题;表单场景包含多选;统计场景包含表格与图表选择联动;布局场景包含跳转与正文颜色;流程场景包含分步阅读与选择题;清单场景包含待办与计时。自动检查命令为 `npm test`、`npm run test:components`、`npm run build:demo`、`npm run test:docs`;浏览器检查和完整发布门禁使用 `npm run verify:release`,见[贡献指南](../../CONTRIBUTING-ch.md)。实际结果以该门禁的执行记录为准,不要沿用旧脚本名。
|
|
@@ -99,6 +99,6 @@ key names a column of static, nonempty, unique text identifiers. Selection is en
|
|
|
99
99
|
|
|
100
100
|
Previously supported local-draft-1 source remains valid. Ten new names arrive with this extension: jump, anchor, text, section, multi-select, range-slider, coordinate, quiz, steps and step. The same release also adds the declaration tags computed, const and validation and the structural tags data-table and column, for 48 tag names in the complete `local-draft-2` set; the leading `<theme>` declaration is metadata, not a component. Old builds displayed these unknown regions as inert source; this build interprets their supported content. Put literal examples inside code spans or fences. Checklist completion appearance changes visibly.
|
|
101
101
|
|
|
102
|
-
Portable fixture syntaxVersion advances to local-draft-2; component-protocol-1 and its data format stay unchanged. local-draft-1.json is retained as historical data. New tests cover compiler/runtime, SSR rendering and visual selection. Canonical state, atomic rejection/reset, instance isolation, hidden-state retention, positioned diagnostics, existing resource budgets and the core/React boundary follow the component protocol. The same release also reserves new expression function names; see [0.4.0 release and migration](release-0.4.0-en.md) for the full rename list.
|
|
102
|
+
Portable fixture syntaxVersion advances to local-draft-2; component-protocol-1 and its data format stay unchanged. local-draft-1.json is retained as historical data. New tests cover compiler/runtime, SSR rendering and visual selection. Canonical state, atomic rejection/reset, instance isolation, hidden-state retention, positioned diagnostics, existing resource budgets and the core/React boundary follow the component protocol. The same release also reserves new expression function names; see [0.4.0 release and migration](../releases/release-0.4.0-en.md) for the full rename list.
|
|
103
103
|
|
|
104
|
-
Run `npm test`, `npm run test:components`, `npm run build:demo` and `npm run test:docs`. Browser checks and the complete release gate use `npm run verify:release`; see the [contributing guide](
|
|
104
|
+
Run `npm test`, `npm run test:components`, `npm run build:demo` and `npm run test:docs`. Browser checks and the complete release gate use `npm run verify:release`; see the [contributing guide](../../CONTRIBUTING.md). Record actual run results with the gate rather than copying an old script name. The bilingual [six scenarios](../../examples/local/showcase/README.md) cover all components: ranges, coordinates and numeric questions in Functions; multiple selection in Forms; linked selection in Data; jumps and prose colors in Layout; steps and choice questions in Flow; todos and timing in Checklists.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
本次新增的跳转、正文颜色、多选、区间、坐标、练习题、分步阅读和选择联动,见[新增组块与迁移](local-components-v2-ch.md)。
|
|
4
4
|
|
|
5
|
-
语法标识:`local-draft-2`,2026-10-23。第一次接触这套语法,建议先读 [新用户入门指南](local-guide-ch.md);本文是完整规范。宿主通过 `compileLocal` 和 `LocalReactiveDocument` 选择本地交互模式,见 [集成说明](local-integration-ch.md)。包版本关系、0.x 兼容规则和迁移见 [版本与兼容性](compatibility-ch.md),可选修订指令与 `reactive-md migrate` 见[源码修订与迁移](source-versioning-ch.md),从 `0.3.1` / `local-draft-1` 升级见[0.4.0 发布与迁移](release-0.4.0-ch.md)。完整示例见 [示例索引](
|
|
5
|
+
语法标识:`local-draft-2`,2026-10-23。第一次接触这套语法,建议先读 [新用户入门指南](../guides/local-guide-ch.md);本文是完整规范。宿主通过 `compileLocal` 和 `LocalReactiveDocument` 选择本地交互模式,见 [集成说明](../integration/local-integration-ch.md)。包版本关系、0.x 兼容规则和迁移见 [版本与兼容性](../compatibility/compatibility-ch.md),可选修订指令与 `reactive-md migrate` 见[源码修订与迁移](../compatibility/source-versioning-ch.md),从 `0.3.1` / `local-draft-1` 升级见[0.4.0 发布与迁移](../releases/release-0.4.0-ch.md)。完整示例见 [示例索引](../../examples/local/README.md)。
|
|
6
6
|
|
|
7
7
|
## 1. 定位与范围
|
|
8
8
|
|
|
@@ -20,7 +20,7 @@ Reactive MD 用于本地交互文档:作者写 Markdown、放置输入控件
|
|
|
20
20
|
|
|
21
21
|
本草案不包含外部服务调用、提交表单、异步资源、命名动作、事件处理器、可编程集合增删、通用循环模板或任意脚本。旧版 `state/data/computed/actions` 配置块不属于新语法。表达式可以产生字符串或数字数组,清单与多选组件继续产生字符串数组。表格可直接写为 Markdown,也可通过带预算的 `data-table` 从本地值生成行。
|
|
22
22
|
|
|
23
|
-
文档默认只保存当前实例的内存状态。重新打开从初值开始;持久化不属于作者语法。无需声明语言版本、导入组件或编写 YAML。文档可以在前导区、主题和正文之前用一行 `<!-- reactive-md: local-draft-2 -->` 可选地声明修订;无指令文档使用当前修订。见[源码修订与迁移](source-versioning-ch.md)。宿主应明确选择草案解析模式,不能把旧语法与新语法混合猜测解析。
|
|
23
|
+
文档默认只保存当前实例的内存状态。重新打开从初值开始;持久化不属于作者语法。无需声明语言版本、导入组件或编写 YAML。文档可以在前导区、主题和正文之前用一行 `<!-- reactive-md: local-draft-2 -->` 可选地声明修订;无指令文档使用当前修订。见[源码修订与迁移](../compatibility/source-versioning-ch.md)。宿主应明确选择草案解析模式,不能把旧语法与新语法混合猜测解析。
|
|
24
24
|
|
|
25
25
|
文档可在正文前用 `<theme name="default">` 选择整份文档的主题,省略时为 `default`。这是静态元数据声明,不是组件;自定义主题须由宿主登记并同时支持深浅模式,见[主题协议](theme-protocol-ch.md)。
|
|
26
26
|
|
|
@@ -47,6 +47,8 @@ Reactive MD 用于本地交互文档:作者写 Markdown、放置输入控件
|
|
|
47
47
|
|
|
48
48
|
标题、段落、强调、链接、图片、引用、列表、普通表格、行内代码和代码围栏继续使用 Markdown。组件标签可以位于段落或独立块中,其位置由组件类型决定。容器内部继续解析 Markdown,不要求作者额外添加 `markdown` 属性。
|
|
49
49
|
|
|
50
|
+
代码围栏支持常见编程语言,以及 `latex` / `tex`、`cattca`、`mermaid`、`jinja` / `jinja2`、`dockerfile` / `docker` 和 `vue` 的语法高亮。Vue 单文件组件中的模板、JavaScript / TypeScript、CSS / SCSS 分别高亮;Cattca 按 Markdown 正文与命令块高亮。Mermaid 围栏展示带高亮的源码。无语言标注时,在受限的常用语言集合中自动识别,并在工具栏显示识别出的语言;识别证据不足时保留纯文本。用 `text`、`txt`、`plaintext` 或 `nohighlight` 明确指定纯文本。未知语言和超过 20,000 字符的代码块保留原文;高亮与复制均保留源码空白。
|
|
51
|
+
|
|
50
52
|
块组件的开始与结束标签各占一行。开始标签的属性可以跨多行书写。标签内部的 `>` 只有在引号之外才结束标签。缩进只用于可读性:容器内容按共同缩进量去缩进,再按 Markdown 解析;代码围栏内部的缩进保持原样。
|
|
51
53
|
|
|
52
54
|
行内组件 `badge`、`tooltip`、`jump`、`text` 可以嵌入句子。其他组件为块组件;`option`、`tab`、`disclosure`、`node`、`edge` 是限定父容器内的子组件。
|
|
@@ -272,7 +274,7 @@ if 的 when 为假时不显示内容,内部参数仍按第 4 节初始化。
|
|
|
272
274
|
|
|
273
275
|
`jump.to` 与 `anchor.id` 匹配标题锚点或显式 ID。重复 anchor、与标题锚点冲突或目标不存在都是编译错误。`quiz` 的答案随源码提供,适合自学;草稿和反馈保留在组件内部,面板重置会清除。`steps` 中未激活的步骤仍参与初始化并保留状态;隐藏计时器暂停。颜色校验和槽位细节见[local-draft-2 扩展说明](local-components-v2-ch.md)。
|
|
274
276
|
|
|
275
|
-
基础排版使用 Markdown;图片用 ``,链接用 `[文字](../地址)`,分隔线用 `---`。图片需由宿主通过 URL 策略明确允许后才加载,默认不产生图片请求,集成方式见[图片与链接策略](../integration/local-integration-ch.md#图片与链接策略)。本草案不提供 row、stack、spacer、icon、image、link-button 等对应的作者标签,也不开放 class/style。
|
|
276
278
|
|
|
277
279
|
## 8. 可勾选清单
|
|
278
280
|
|
|
@@ -297,7 +299,9 @@ progress 是无正文组件,label/value 必填,max 默认 100,支持动态
|
|
|
297
299
|
|
|
298
300
|
### 9.1 共同的数据规则
|
|
299
301
|
|
|
300
|
-
table、chart、timeline
|
|
302
|
+
ReactiveMD 的 table、chart、timeline 组件正文各为一张 Markdown 表格。表头非空且唯一,每行列数一致;单元格可以有插值。第一列通常为标签,其他列根据组件要求读取类型。
|
|
303
|
+
|
|
304
|
+
`<table>` 也可使用原生 HTML 表格正文;两种语法按正文结构区分,共用渲染样式。HTML 写法支持合并单元格,默认不添加表格交互,详见 [HTML 表格兼容](html-compatibility-ch.md#两种表格写法)。
|
|
301
305
|
|
|
302
306
|
普通文本单元格显示 Markdown;纯十进制或科学计数法文本单元格可读为数值,单个完整插值保留其结果类型。混合文本如 `{{ price }} 元` 是显示字符串,不能用作图表的数值列。图例标签取表头的纯文本。
|
|
303
307
|
|
|
@@ -350,7 +354,22 @@ timeline 支持可选 title、unit(显示文本,默认“分钟”),正
|
|
|
350
354
|
|
|
351
355
|
### 10.1 显示与绘图
|
|
352
356
|
|
|
353
|
-
|
|
357
|
+
正文用 `$...$` 或 `\(...\)` 写行内公式,用 `$$...$$` 或 `\[...\]` 写独立公式。美元定界的行内公式在同一行配对,允许首尾空白,例如 `$ x $`、`$x $`、`$ x$`;内容须包含非空白字符。普通金额文本(如 `$5 and $10`)保持字面含义,普通美元符号也可写 `\$`。反斜线定界的公式允许首尾空白和跨行,例如句子中的 `\(\frac{a}{b}\)`,或独立公式 `\[x^2 + 1\]`。未闭合的公式定界符报错;没有配对的单个美元符号保留为文本。代码、注释和 Markdown 链接目标中的定界符保持字面含义;正文中展示写法时,转义开头的反斜线或使用代码。
|
|
358
|
+
|
|
359
|
+
独立公式用于排版,不创建状态、不发布函数。plot 容器内每个 `$$...$$` 块定义一条曲线,数学内容保持正常 LaTeX 写法,不需要 `{{ }}`。plot 仍只接受 `$$...$$`,不接受 `\(...\)` 或 `\[...\]`。
|
|
360
|
+
|
|
361
|
+
排版支持 `cases`、`aligned`、`align`、`align*`、`pmatrix`、`bmatrix`、`vmatrix` 环境。用 `&` 分列,`\\` 换行;对齐环境按右、左交替对齐列,矩阵单元格居中,并显示对应括号。`align` 与 `aligned` 均在公式定界符内使用;编号通过 `\tag{1}` 显式添加,`\tag*{A}` 不加括号。
|
|
362
|
+
|
|
363
|
+
| 排版内容 | 命令示例 |
|
|
364
|
+
| --- | --- |
|
|
365
|
+
| 字体与文本 | `\mathbb{R}`、`\mathcal{F}`、`\mathscr{L}`、`\mathfrak{g}`、`\textbf{文字}` |
|
|
366
|
+
| 组合数、标注与边框 | `\binom{n}{k}`、`\underbrace{a+b}_{n}`、`\overrightarrow{AB}`、`\underline{x}`、`\boxed{x}` |
|
|
367
|
+
| 上下标注与带标签箭头 | `\stackrel{!}{=}`、`\underset{x}{\lim}`、`\xrightarrow[下方]{上方}`、`\xrightleftharpoons[k_2]{k_1}` |
|
|
368
|
+
| 逻辑、关系与符号 | `\implies`、`\iff`、`\not\in`、`\cong`、`\mapsto`、`\mid`、`\ll`、`\oplus`、`\varnothing`、`\therefore`、`\because`、`\triangle`、`\circ`、`\dagger`、`\vdots`、`\ddots` |
|
|
369
|
+
| 箭头、定界符与尺寸 | `\rightleftharpoons`、`\longrightarrow`、`\Longleftrightarrow`、`\downarrow`、`\lfloor`、`\rfloor`、`\lceil`、`\rceil`、`\bigl(`、`\bigr)`、`\Bigg(` |
|
|
370
|
+
| 函数与同余 | `\sec`、`\csc`、`\cot`、`\sinh`、`\cosh`、`\lg`、`\pmod{n}` |
|
|
371
|
+
|
|
372
|
+
化学式使用 mhchem 语法 `\ce{...}`,例如 `$\ce{H2O}$`、`$\ce{SO4^2-}$`、`$\ce{^{14}_{6}C}$`、`$$\ce{2 H2 + O2 -> 2 H2O}$$`、`$$\ce{A <=>[正向][逆向] B}$$`。支持分子下标、离子电荷、同位素、系数、物态、化学键和反应箭头,由 `mhchemparser` 转换并通过同一 MathML 渲染器排版。未支持的转换命令会给出 `local.math.display` 诊断;所有文本经过转义,转换结果受长度、记号和嵌套预算限制。这些排版语法可在普通公式中使用;绘图计算支持的语法见下一节。
|
|
354
373
|
|
|
355
374
|
```markdown
|
|
356
375
|
<slider bind="a" label="振幅" initial="1" min="0" max="5">
|
|
@@ -486,7 +505,7 @@ node.id 为当前图解内唯一的 `[A-Za-z_][A-Za-z0-9_-]*`。edge 必填 from
|
|
|
486
505
|
9. 中文输入法、键盘操作、可访问名称和 375px 窄屏可用。
|
|
487
506
|
10. 文档实例独立、销毁清理、无意外网络动作;复杂或超量数学输入能够被执行预算中止。
|
|
488
507
|
|
|
489
|
-
这些规则用于编译器、运行时和浏览器验收。示例映射及预期观察点见[示例索引](
|
|
508
|
+
这些规则用于编译器、运行时和浏览器验收。示例映射及预期观察点见[示例索引](../../examples/local/README.md),机器可读的最小验收集见[语言验收数据](../../examples/conformance/README.md)。实际仓库检查记录保留在仓库内,不属于发布包。
|
|
490
509
|
|
|
491
510
|
|
|
492
|
-
新增组块、颜色、槽位状态与迁移规则见[local-draft-2 扩展说明](local-components-v2-ch.md),升级清单见[0.4.0 发布与迁移](release-0.4.0-ch.md)。`0.
|
|
511
|
+
新增组块、颜色、槽位状态与迁移规则见[local-draft-2 扩展说明](local-components-v2-ch.md),升级清单见[0.4.0 发布与迁移](../releases/release-0.4.0-ch.md)。`0.6.0` 同时提供于 `latest` 与 `next` 渠道。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Reactive MD local interaction syntax specification
|
|
2
2
|
|
|
3
|
-
Syntax identifier: `local-draft-2`, 2026-10-23. If this is your first time with the syntax, read the [beginner guide](local-guide-en.md) first; this document is the complete specification. Hosts select local interaction mode through `compileLocal` and `LocalReactiveDocument`, see [integration notes](local-integration-en.md). See [Versions and compatibility](compatibility-en.md) for package version relationships, 0.x compatibility rules and migration, [Source revisions and migration](source-versioning-en.md) for the optional revision directive and `reactive-md migrate`, and [0.4.0 release and migration](release-0.4.0-en.md) for the upgrade from `0.3.1` / `local-draft-1`. Complete examples are in the [example index](
|
|
3
|
+
Syntax identifier: `local-draft-2`, 2026-10-23. If this is your first time with the syntax, read the [beginner guide](../guides/local-guide-en.md) first; this document is the complete specification. Hosts select local interaction mode through `compileLocal` and `LocalReactiveDocument`, see [integration notes](../integration/local-integration-en.md). See [Versions and compatibility](../compatibility/compatibility-en.md) for package version relationships, 0.x compatibility rules and migration, [Source revisions and migration](../compatibility/source-versioning-en.md) for the optional revision directive and `reactive-md migrate`, and [0.4.0 release and migration](../releases/release-0.4.0-en.md) for the upgrade from `0.3.1` / `local-draft-1`. Complete examples are in the [example index](../../examples/local/README.md).
|
|
4
4
|
|
|
5
5
|
## 1. Positioning and scope
|
|
6
6
|
|
|
@@ -16,7 +16,7 @@ The base language requires only two connection rules: `bind` names an input, and
|
|
|
16
16
|
|
|
17
17
|
This draft does not include external service calls, form submission, asynchronous resources, named actions, event handlers, programmable collection edits, general loop templates or arbitrary scripts. Legacy `state/data/computed/actions` configuration blocks are not part of the new syntax. Expressions can produce string or numeric arrays; checklist and multi-select components produce string arrays. Tables can use prose Markdown or bounded local row generation through `data-table`.
|
|
18
18
|
|
|
19
|
-
By default a document only keeps in-memory state for the current instance. Reopening starts from initial values; persistence is not part of the author syntax. No language version declaration, component import or YAML is required. A document may optionally declare its revision with one `<!-- reactive-md: local-draft-2 -->` line in the prologue, before the theme and body; unversioned documents use the current revision. See [Source revisions and migration](source-versioning-en.md). Hosts should explicitly select draft parsing mode and must not guess by mixing old and new syntax.
|
|
19
|
+
By default a document only keeps in-memory state for the current instance. Reopening starts from initial values; persistence is not part of the author syntax. No language version declaration, component import or YAML is required. A document may optionally declare its revision with one `<!-- reactive-md: local-draft-2 -->` line in the prologue, before the theme and body; unversioned documents use the current revision. See [Source revisions and migration](../compatibility/source-versioning-en.md). Hosts should explicitly select draft parsing mode and must not guess by mixing old and new syntax.
|
|
20
20
|
|
|
21
21
|
Documents may select a theme with `<theme name="default">` before the body; omission uses `default`. This is static metadata, not a component. Custom themes must be registered by the host and support both color schemes; see the [theme protocol](theme-protocol-en.md).
|
|
22
22
|
|
|
@@ -43,6 +43,8 @@ When no cross-component linkage is needed, omit `bind`, for example `<counter la
|
|
|
43
43
|
|
|
44
44
|
Headings, paragraphs, emphasis, links, images, quotes, lists, plain tables, inline code and code fences continue to use Markdown. Component tags may sit in a paragraph or a standalone block, depending on component type. Container contents continue to parse as Markdown; authors do not need to add a `markdown` attribute.
|
|
45
45
|
|
|
46
|
+
Code fences highlight common programming languages plus `latex` / `tex`, `cattca`, `mermaid`, `jinja` / `jinja2`, `dockerfile` / `docker` and `vue`. Vue single-file components highlight templates, JavaScript / TypeScript and CSS / SCSS separately; Cattca highlights Markdown narrative and command blocks. Mermaid fences display highlighted source. Unlabeled code is detected within a bounded set of common languages, with the detected language shown in the toolbar. Blocks without sufficient detection evidence stay plain. Use `text`, `txt`, `plaintext` or `nohighlight` to request plain text explicitly. Unknown languages and blocks longer than 20,000 characters preserve the original text. Highlighting and copying retain source whitespace.
|
|
47
|
+
|
|
46
48
|
Block component start and end tags each occupy a line. Attributes in a start tag may span multiple lines. A `>` inside a tag ends the tag only when it is outside quotes. Indentation is only for readability: container content is dedented by the common indentation and then parsed as Markdown; indentation inside code fences is preserved.
|
|
47
49
|
|
|
48
50
|
The inline components `badge`, `tooltip`, `jump` and `text` can be embedded in sentences. Other components are block components; `option`, `tab`, `disclosure`, `node`, `edge` and `step` are child components restricted to specific parent containers.
|
|
@@ -268,7 +270,7 @@ When if's when is false, content is not displayed, but internal parameters are s
|
|
|
268
270
|
|
|
269
271
|
`jump.to` and `anchor.id` match heading slugs or explicit IDs. Duplicate anchors, heading collisions and missing targets are compile errors. `quiz` answers are supplied in source for self-study; drafts and feedback stay inside the component and panel reset clears them. `steps` keeps inactive step content initialized and preserves its state; hidden timers pause. See [local-draft-2 components and migration](local-components-v2-en.md) for color validation and slot details.
|
|
270
272
|
|
|
271
|
-
Base layout uses Markdown; images use ``, links use `[text](address)`, and horizontal rules use `---`. Images load only after the host explicitly allows them through a URL policy; by default no image requests are made. See [Image and link policy](local-integration-en.md#image-and-link-policy) for integration. This draft does not provide author tags for row, stack, spacer, icon, image or link-button, and does not expose class/style.
|
|
273
|
+
Base layout uses Markdown; images use ``, links use `[text](../address)`, and horizontal rules use `---`. Images load only after the host explicitly allows them through a URL policy; by default no image requests are made. See [Image and link policy](../integration/local-integration-en.md#image-and-link-policy) for integration. This draft does not provide author tags for row, stack, spacer, icon, image or link-button, and does not expose class/style.
|
|
272
274
|
|
|
273
275
|
## 8. Checklists
|
|
274
276
|
|
|
@@ -293,7 +295,9 @@ progress is a void component; label/value are required, max defaults to 100, and
|
|
|
293
295
|
|
|
294
296
|
### 9.1 Shared data rules
|
|
295
297
|
|
|
296
|
-
The
|
|
298
|
+
The ReactiveMD table, chart and timeline components each contain one Markdown table. Headers are non-empty and unique, and every row has the same number of columns; cells may contain interpolation. The first column is usually a label, and other columns read types according to the component.
|
|
299
|
+
|
|
300
|
+
`<table>` also accepts a native HTML table body. Body structure selects the syntax; both share the rendering styles. HTML tables support merged cells and add no table interactions by default. See [HTML table compatibility](html-compatibility-en.md#two-table-syntaxes).
|
|
297
301
|
|
|
298
302
|
Plain text cells display Markdown; plain decimal or scientific-notation text cells can be read as numbers, and a single complete interpolation keeps its result type. Mixed text such as `{{ price }} USD` is a display string and cannot be used as a numeric chart column. Legend labels take the plain text of headers.
|
|
299
303
|
|
|
@@ -346,7 +350,22 @@ timeline supports optional title and unit (display text, default "minutes"), and
|
|
|
346
350
|
|
|
347
351
|
### 10.1 Display and plotting
|
|
348
352
|
|
|
349
|
-
Prose `$...$`
|
|
353
|
+
Prose accepts `$...$` or `\(...\)` for inline math, and `$$...$$` or `\[...\]` for display formulas. Dollar-delimited inline math pairs on the same line and permits leading or trailing whitespace, as in `$ x $`, `$x $` and `$ x$`. Its content must include a non-whitespace character. Currency text such as `$5 and $10` stays literal; use `\$` for an explicit literal dollar sign. Backslash-delimited formulas may contain whitespace and span lines. For example, write `\(\frac{a}{b}\)` in a sentence or `\[x^2 + 1\]` as a display formula. Unclosed math delimiters are errors; an unmatched single dollar sign stays literal. Code, comments and Markdown destinations keep these delimiters literal; escape the opening backslash or use code to show an example in prose.
|
|
354
|
+
|
|
355
|
+
Standalone formulas are for layout and create no state or functions. Each `$$...$$` block inside a plot container defines one curve; the math content keeps normal LaTeX syntax and does not need `{{ }}`. Plot accepts only `$$...$$`, not `\(...\)` or `\[...\]`.
|
|
356
|
+
|
|
357
|
+
Display supports the `cases`, `aligned`, `align`, `align*`, `pmatrix`, `bmatrix` and `vmatrix` environments. Use `&` for columns and `\\` for rows. Alignment environments alternate right and left column alignment; matrices center their cells and show the corresponding delimiters. Both `align` and `aligned` belong inside math delimiters. Add explicit equation labels with `\tag{1}`, or `\tag*{A}` to omit parentheses.
|
|
358
|
+
|
|
359
|
+
| Display content | Example commands |
|
|
360
|
+
| --- | --- |
|
|
361
|
+
| Alphabets and text | `\mathbb{R}`, `\mathcal{F}`, `\mathscr{L}`, `\mathfrak{g}`, `\textbf{bold text}` |
|
|
362
|
+
| Binomials, annotations and boxes | `\binom{n}{k}`, `\underbrace{a+b}_{n}`, `\overrightarrow{AB}`, `\underline{x}`, `\boxed{x}` |
|
|
363
|
+
| Above/below labels and labeled arrows | `\stackrel{!}{=}`, `\underset{x}{\lim}`, `\xrightarrow[below]{above}`, `\xrightleftharpoons[k_2]{k_1}` |
|
|
364
|
+
| Logic, relations and symbols | `\implies`, `\iff`, `\not\in`, `\cong`, `\mapsto`, `\mid`, `\ll`, `\oplus`, `\varnothing`, `\therefore`, `\because`, `\triangle`, `\circ`, `\dagger`, `\vdots`, `\ddots` |
|
|
365
|
+
| Arrows, delimiters and sizes | `\rightleftharpoons`, `\longrightarrow`, `\Longleftrightarrow`, `\downarrow`, `\lfloor`, `\rfloor`, `\lceil`, `\rceil`, `\bigl(`, `\bigr)`, `\Bigg(` |
|
|
366
|
+
| Functions and congruences | `\sec`, `\csc`, `\cot`, `\sinh`, `\cosh`, `\lg`, `\pmod{n}` |
|
|
367
|
+
|
|
368
|
+
Use mhchem notation for chemistry: `$\ce{H2O}$`, `$\ce{SO4^2-}$`, `$\ce{^{14}_{6}C}$`, `$$\ce{2 H2 + O2 -> 2 H2O}$$` or `$$\ce{A <=>[forward][reverse] B}$$`. Molecular subscripts, ionic charges, isotopes, coefficients, physical states, bonds and reaction arrows are converted by `mhchemparser` and rendered through the same MathML renderer. Unsupported conversion commands produce `local.math.display` diagnostics. All text is escaped, and converted output is bounded by source, token and nesting budgets. These forms are available for formula display; plotting computation supports the syntax listed below.
|
|
350
369
|
|
|
351
370
|
```markdown
|
|
352
371
|
<slider bind="a" label="Amplitude" initial="1" min="0" max="5">
|
|
@@ -482,7 +501,7 @@ Implementation acceptance must cover:
|
|
|
482
501
|
9. Chinese IME input, keyboard operation, accessible names and 375px narrow screens work.
|
|
483
502
|
10. Document instances are independent, disposal cleans up, and no unintended network actions occur; complex or excessive math input can be halted by the execution budget.
|
|
484
503
|
|
|
485
|
-
These rules cover compiler, runtime and browser acceptance. See the [example index](
|
|
504
|
+
These rules cover compiler, runtime and browser acceptance. See the [example index](../../examples/local/README.md) for example mappings and expected observations, and the [language conformance data](../../examples/conformance/README.md) for the machine-readable minimum acceptance set. Actual repository check records stay in the repository and are not part of the package.
|
|
486
505
|
|
|
487
506
|
|
|
488
|
-
See [local-draft-2 components and migration](local-components-v2-en.md) for new tags, colors and slot state, and [0.4.0 release and migration](release-0.4.0-en.md) for the upgrade checklist. `0.
|
|
507
|
+
See [local-draft-2 components and migration](local-components-v2-en.md) for new tags, colors and slot state, and [0.4.0 release and migration](../releases/release-0.4.0-en.md) for the upgrade checklist. `0.6.0` is available on both the `latest` and `next` channels.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Reactive MD theme protocol
|
|
2
2
|
|
|
3
|
-
Protocol revision: `reactive-md-theme-1`. This feature
|
|
3
|
+
Protocol revision: `reactive-md-theme-1`. This feature was introduced in `0.4.0` and remains available in `0.6.0` on both `latest` and `next`. The built-in `default` preserves the existing appearance.
|
|
4
4
|
|
|
5
5
|
## Selecting a theme
|
|
6
6
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
使用 `npm install reactive-md` 安装,或用 `npm install reactive-md@0.4.0` 固定版本。`latest` 和 `next` 均指向 `0.4.0`。
|
|
6
6
|
|
|
7
|
-
本文汇总 0.4.0 包含的能力、对现有文档和宿主的变化,以及从 `0.3.1` / `local-draft-1` 升级的步骤。具体规则仍以链接的参考页为准;本页是升级清单。显式修订声明和迁移工具见[源码修订与迁移](source-versioning-ch.md)。
|
|
7
|
+
本文汇总 0.4.0 包含的能力、对现有文档和宿主的变化,以及从 `0.3.1` / `local-draft-1` 升级的步骤。具体规则仍以链接的参考页为准;本页是升级清单。显式修订声明和迁移工具见[源码修订与迁移](../compatibility/source-versioning-ch.md)。
|
|
8
8
|
|
|
9
9
|
## 适合哪些项目
|
|
10
10
|
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
| 作者工具 | 高亮、补全、绑定定位、重命名、格式化及 `lint --locale en|zh` |
|
|
29
29
|
| 渲染 | 依赖感知的渲染,避免重算未受影响的文档子树 |
|
|
30
30
|
|
|
31
|
-
可运行示例见[示例索引](
|
|
31
|
+
可运行示例见[示例索引](../../examples/local/README.md),包括六个双语功能场景、账单示例和工作坊示例。全部可接受的标签名见[语法规范](../reference/local-interaction-syntax-ch.md#12-组件速查与语法裁剪)。
|
|
32
32
|
|
|
33
33
|
## 从 0.3.1 / local-draft-1 升级
|
|
34
34
|
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
`sum`、`average`、`minOf`、`maxOf`、`formatNumber`、`formatPercent`、`formatScientific`、`formatCurrency`、`trim`、`lower`、`upper`、`startsWith`、`endsWith`、`replace`、`slice`、`dateCompare`、`dateDiff`。
|
|
42
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#兼容性)。
|
|
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
44
|
|
|
45
45
|
### 新增可识别标签名
|
|
46
46
|
|
|
@@ -78,12 +78,12 @@
|
|
|
78
78
|
6. 更新宿主对 `number-array`、`validate()`、槽位 API 和包含计算值的快照的处理。
|
|
79
79
|
7. 重新检查状态导入导出、参数保留和宿主内的 HTML 导出。迁移会改变源码摘要,应重新导出状态文件。
|
|
80
80
|
8. 检查可见变化:清单完成样式、表格/图表选择和主题 CSS。
|
|
81
|
-
9. 运行[发布验证入口](
|
|
81
|
+
9. 运行[发布验证入口](../../CONTRIBUTING-ch.md),并用自己的文档和浏览器检查复验。
|
|
82
82
|
|
|
83
83
|
## 验证范围
|
|
84
84
|
|
|
85
|
-
`0.4.0` 面向 Node.js 22.12 与 Node 24;CI 门禁使用 Playwright Chromium,本地检查使用 Microsoft Edge。`npm run verify:release` 是完整发布门禁:覆盖核心与 Demo 测试、类型、包与文档检查、仓库外真实 tarball 消费,以及计算、集合、作者工具、状态恢复、HTML 导出的浏览器检查和渲染等价检查。单项命令仍列在[贡献指南](
|
|
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
86
|
|
|
87
87
|
静态 SSR 由 packed 检查覆盖。单文件导出的静态首屏水合由 Playwright Chromium 和本地 Edge 检查覆盖。该路径之外的通用 SSR 水合、Firefox 与 Safari/WebKit 尚未验证,不作支持声明。
|
|
88
88
|
|
|
89
|
-
版本规则与诊断契约见[版本与兼容性](compatibility-ch.md),修订指令与迁移工具见[源码修订与迁移](source-versioning-ch.md),HTML 与状态格式见[可分享文档与静态导出](shareable-export-ch.md),组块新增见[local-draft-2 扩展说明](local-components-v2-ch.md)。
|
|
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)。
|
|
@@ -4,7 +4,7 @@ Status: 0.x preview available on both `latest` and `next`. Package version `0.4.
|
|
|
4
4
|
|
|
5
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
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).
|
|
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
8
|
|
|
9
9
|
## Who should upgrade
|
|
10
10
|
|
|
@@ -28,7 +28,7 @@ This page summarizes what 0.4.0 contains, what changes for existing documents an
|
|
|
28
28
|
| Author tools | Highlighting, completion, binding navigation, rename, formatting and `lint --locale en|zh` |
|
|
29
29
|
| Rendering | Dependency-aware rendering that avoids recomputing unaffected document subtrees |
|
|
30
30
|
|
|
31
|
-
The runnable examples are in the [example index](
|
|
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
32
|
|
|
33
33
|
## Upgrade from 0.3.1 / local-draft-1
|
|
34
34
|
|
|
@@ -40,7 +40,7 @@ The new expression functions are reserved binding names. Rename any existing con
|
|
|
40
40
|
|
|
41
41
|
`sum`, `average`, `minOf`, `maxOf`, `formatNumber`, `formatPercent`, `formatScientific`, `formatCurrency`, `trim`, `lower`, `upper`, `startsWith`, `endsWith`, `replace`, `slice`, `dateCompare`, `dateDiff`.
|
|
42
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).
|
|
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
44
|
|
|
45
45
|
### Newly recognized tag names
|
|
46
46
|
|
|
@@ -78,12 +78,12 @@ A source may declare `<!-- reactive-md: local-draft-2 -->` in its prologue. Unve
|
|
|
78
78
|
6. Update hosts for `number-array`, `validate()`, slot APIs and snapshots that include calculated values.
|
|
79
79
|
7. Recheck state import/export, retention and any HTML export inside the host. Migration changes the source digest; export fresh state files.
|
|
80
80
|
8. Check the visible changes: checklist completion styling, table/chart selection and theme CSS.
|
|
81
|
-
9. Run the [release verification gate](
|
|
81
|
+
9. Run the [release verification gate](../../CONTRIBUTING.md) and your own document and browser checks.
|
|
82
82
|
|
|
83
83
|
## Verification scope
|
|
84
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](
|
|
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
86
|
|
|
87
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
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.
|
|
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.
|
|
@@ -14,10 +14,10 @@ npm install reactive-md@0.4.1
|
|
|
14
14
|
|
|
15
15
|
LaTeX 使用正文字号和黑白文字颜色,分段函数的表达式与条件保持分离。坐标控件增加网格、箭头轴、虚线投影和可拖动的坐标标注点。quiz 输入框占满可用宽度,题目和操作区整体垂直居中。Playground 在工具栏插入后保留编辑器滚动位置,日期输入框适应窄屏。
|
|
16
16
|
|
|
17
|
-
本次更新调整外观和交互,编译器、运行时与状态文件契约保持不变。使用自定义样式的宿主应检查新的默认外观。完整变化见[变更记录](
|
|
17
|
+
本次更新调整外观和交互,编译器、运行时与状态文件契约保持不变。使用自定义样式的宿主应检查新的默认外观。完整变化见[变更记录](../../CHANGELOG-ch.md);从较早 minor 版本升级时,参阅[0.4.0 迁移指南](release-0.4.0-ch.md)。
|
|
18
18
|
|
|
19
19
|
## 验证与限制
|
|
20
20
|
|
|
21
21
|
发布检查覆盖核心与 Demo 测试、类型、包入口、文档链接、离线安装包消费、静态 SSR、独立 HTML 和浏览器交互。CI 目标为 Node 22.12、24 与 Chromium;本地浏览器检查使用 Windows 上的 Microsoft Edge。导出 HTML 以外的通用 SSR 水合、Firefox 和 WebKit 尚未验证。
|
|
22
22
|
|
|
23
|
-
项目仍处于 0.x 预览阶段。安全边界和宿主职责见 [SECURITY-ch.md](
|
|
23
|
+
项目仍处于 0.x 预览阶段。安全边界和宿主职责见 [SECURITY-ch.md](../../SECURITY-ch.md)。
|
|
@@ -14,10 +14,10 @@ Documents use quieter surfaces, fewer borders, muted chart colors and smoother c
|
|
|
14
14
|
|
|
15
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
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](
|
|
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
18
|
|
|
19
19
|
## Validation and limits
|
|
20
20
|
|
|
21
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
22
|
|
|
23
|
-
The project remains a 0.x preview. Security boundaries and host responsibilities are documented in [SECURITY.md](
|
|
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。版本轴与迁移规则见[变更记录](
|
|
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](
|
|
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](
|
|
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](
|
|
41
|
+
The project remains a 0.x preview. Security boundaries and host responsibilities are documented in [SECURITY.md](../../SECURITY.md).
|