reactive-md 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG-ch.md +34 -0
  2. package/CHANGELOG.md +34 -0
  3. package/README-ch.md +10 -7
  4. package/README-en.md +12 -7
  5. package/README.md +12 -7
  6. package/SECURITY-ch.md +4 -3
  7. package/SECURITY.md +4 -3
  8. package/THIRD_PARTY_NOTICES.md +45 -1
  9. package/dist-library/reactive-md-editor.css +1 -1
  10. package/dist-library/reactive-md-editor.js +739 -615
  11. package/dist-library/reactive-md-react.js +2111 -1903
  12. package/dist-library/reactive-md.js +462 -326
  13. package/dist-library/{runtime-DPuMxM_y.js → runtime-UiQPz5ZV.js} +8780 -2718
  14. package/dist-library/types/editor/editor-i18n.d.ts +7 -0
  15. package/dist-library/types/editor/editor-view-bar.d.ts +11 -0
  16. package/dist-library/types/editor/index.d.ts +1 -1
  17. package/dist-library/types/editor/types.d.ts +8 -1
  18. package/dist-library/types/local/LocalDocumentView.d.ts +19 -4
  19. package/dist-library/types/local/code-block.d.ts +3 -1
  20. package/dist-library/types/local/diagnostics.d.ts +65 -0
  21. package/dist-library/types/local/heading-anchors.d.ts +2 -0
  22. package/dist-library/types/local/html-names.d.ts +6 -0
  23. package/dist-library/types/local/html.d.ts +16 -0
  24. package/dist-library/types/local/image-view.d.ts +3 -1
  25. package/dist-library/types/local/index.d.ts +1 -1
  26. package/dist-library/types/local/limits.d.ts +8 -0
  27. package/dist-library/types/local/options.d.ts +34 -0
  28. package/dist-library/types/local/render-types.d.ts +11 -0
  29. package/dist-library/types/local/types.d.ts +53 -1
  30. package/dist-library/types/local/worker.d.ts +21 -6
  31. package/dist-library/types/react/index.d.ts +1 -1
  32. package/dist-library/types/shareable.d.ts +9 -1
  33. package/dist-standalone/reactive-md-standalone.js +49 -49
  34. package/docs/compatibility-ch.md +8 -6
  35. package/docs/compatibility-en.md +8 -6
  36. package/docs/component-development-ch.md +4 -4
  37. package/docs/component-development-en.md +3 -3
  38. package/docs/component-protocol-ch.md +48 -11
  39. package/docs/component-protocol-en.md +48 -11
  40. package/docs/editor-ch.md +235 -216
  41. package/docs/editor-en.md +235 -216
  42. package/docs/html-compatibility-ch.md +98 -0
  43. package/docs/html-compatibility-en.md +98 -0
  44. package/docs/local-integration-ch.md +29 -2
  45. package/docs/local-integration-en.md +29 -2
  46. package/docs/local-interaction-syntax-ch.md +3 -1
  47. package/docs/local-interaction-syntax-en.md +1 -1
  48. package/docs/release-0.5.1-ch.md +39 -0
  49. package/docs/release-0.5.1-en.md +39 -0
  50. package/docs/release-0.5.2-ch.md +35 -0
  51. package/docs/release-0.5.2-en.md +35 -0
  52. package/docs/releasing-ch.md +7 -7
  53. package/docs/releasing-en.md +8 -8
  54. package/docs/shareable-export-ch.md +2 -0
  55. package/docs/shareable-export-en.md +2 -0
  56. package/examples/conformance/README.md +1 -1
  57. package/examples/local/README.md +2 -0
  58. package/examples/local/html-compat.reactive.md +24 -0
  59. package/package.json +3 -1
@@ -0,0 +1,98 @@
1
+ # Partial HTML compatibility and temporary routing policy
2
+
3
+ This feature targets the next release. Documents use Markdown, ReactiveMD controls and expressions by default, with the P0 HTML subset below. Host applications can enable author CSS, JavaScript and extended HTML separately. All three options default to `false`.
4
+
5
+ ## Temporary routing policy
6
+
7
+ This release routes whole documents to avoid mixed parsing and rendering conflicts between author CSS, JavaScript, extended HTML and ReactiveMD.
8
+
9
+ | Compile options | Document behavior |
10
+ | --- | --- |
11
+ | All three options omitted or `false` | ReactiveMD parsing and the existing React renderer, including P0 HTML |
12
+ | Any option `true` | Native HTML for the entire source, rendered in an isolated iframe |
13
+
14
+ In native HTML mode, `# headings`, `**emphasis**`, LaTeX and `{{ expressions }}` remain ordinary text. Elements such as `input` and `table` use HTML semantics. ReactiveMD components establish no bindings. Turning all options off recompiles the document in the default mode. This is a transitional policy for this release; mixed compatibility can be evaluated later.
15
+
16
+ Options are host capabilities. Source tags and parameter state files cannot grant them. The demo displays the active mode and resets all three capabilities when the page reloads.
17
+
18
+ ## Options and API
19
+
20
+ ```ts
21
+ import { compileLocal } from 'reactive-md';
22
+
23
+ // Markdown, ReactiveMD and P0 HTML.
24
+ const reactive = compileLocal(source);
25
+
26
+ // Native HTML for the entire source; author CSS is enabled.
27
+ const html = compileLocal(source, {
28
+ enableCss: true,
29
+ enableJavaScript: false,
30
+ enableExtendedHtml: false,
31
+ });
32
+ ```
33
+
34
+ | Option | Default | Capability |
35
+ | --- | --- | --- |
36
+ | `enableCss` | `false` | Author CSS |
37
+ | `enableJavaScript` | `false` | Author scripts and event handlers |
38
+ | `enableExtendedHtml` | `false` | P1 elements, embeds, forms, SVG/MathML and whole-page HTML features |
39
+
40
+ Each option must be boolean. Enabling one does not enable the others. Styled extended elements require both extended HTML and CSS; scripts in extended elements require both extended HTML and JavaScript. Built-in styles, interactions, chart SVG and formula MathML continue to work independently of these author capabilities.
41
+
42
+ Source-length limits and `limits.maxSyntaxNodes` still apply. The HTML path counts traversed parse-tree nodes, with a cumulative budget shared by nested `srcdoc` documents.
43
+
44
+ The React convenience component accepts the same settings through `compileOptions`:
45
+
46
+ ```tsx
47
+ <LocalReactiveDocument
48
+ source={source}
49
+ compileOptions={{ enableCss: true }}
50
+ />
51
+ ```
52
+
53
+ Lower-level hosts pass the compiled document to `LocalDocumentView`. Native HTML documents have a `document.html` field with the three normalized flags and empty parameter and binding collections. This field is runtime metadata. Store the original source and host settings when saving a document.
54
+
55
+ ## P0 HTML in the default mode
56
+
57
+ | Purpose | Elements |
58
+ | --- | --- |
59
+ | Inline text | `b`, `strong`, `i`, `em`, `s`, `del`, `u`, `mark`, `sup`, `sub` |
60
+ | Breaks | `br`, `hr` |
61
+ | Paragraphs and headings | `p`, `h1` through `h6` |
62
+ | Containers | `div`, `span` |
63
+ | Disclosures | `details`, `summary` |
64
+ | Quotations | `blockquote` |
65
+ | Code | `code`, `pre`, and `code` inside `pre` |
66
+ | Lists | `ul`, `ol`, `li`, including `ol[start]` |
67
+ | Links and images | `a`, `img`, using the default path's URL policy |
68
+ | Other forms | HTML comments, named and numeric character references, case-insensitive HTML names and void-element spelling |
69
+
70
+ 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
+ See the runnable [HTML and ReactiveMD example](../examples/local/html-compat.reactive.md).
73
+
74
+ 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
+
76
+ ## Extended HTML
77
+
78
+ `enableExtendedHtml` controls the following author syntax:
79
+
80
+ - Tables and their structure: `table`, `caption`, `thead`, `tbody`, `tfoot`, `tr`, `th`, `td`.
81
+ - Definition lists: `dl`, `dt`, `dd`.
82
+ - Additional text semantics: `small`, `kbd`, `samp`, `var`, `abbr`, `q`, `cite`, `ins`.
83
+ - Figures and structure: `figure`, `figcaption`, `article`, `section`, `aside`, `header`, `footer`, `ruby`, `rt`, `rp`, `wbr`.
84
+ - Native forms, `iframe`, `object`, `embed`, `dialog`, arbitrary SVG/MathML and whole-page HTML features.
85
+
86
+ In the default mode, existing ReactiveMD components such as `table`, `section`, `input` and `select` retain their current meanings. In native HTML mode, these names use browser semantics.
87
+
88
+ ## Isolation and export
89
+
90
+ Author HTML runs inside a sandboxed iframe without `allow-same-origin`. Whole-page structure, styles and scripts apply to this isolated document. CSP and sandbox restrictions still govern resources, form submission and navigation. Extended HTML does not grant unrestricted network access.
91
+
92
+ This release supports inline CSS and JavaScript. Enabling the options does not automatically load external scripts, stylesheets, images, media or embedded resources. Extended HTML permits HTTP(S) form submission and `base` URL resolution inside the isolated document while retaining host-access and top-navigation restrictions. Iframes can use `srcdoc` for inline content; external `object` and `embed` resources remain subject to CSP.
93
+
94
+ Once arbitrary JavaScript is enabled, scripts can create elements and styles dynamically. The other options primarily constrain author source; they do not promise to block individual runtime DOM operations. Host isolation remains in place.
95
+
96
+ 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
+
98
+ See [integration](local-integration-en.md), [shareable export](shareable-export-en.md) and [security](../SECURITY.md).
@@ -4,6 +4,8 @@
4
4
 
5
5
  ## 运行环境与入口
6
6
 
7
+ 下个发行版的 P0 HTML 和三个宿主能力开关见 [HTML 部分兼容](html-compatibility-ch.md)。本版采用暂时性分流政策:任意开启作者 CSS、JavaScript 或扩展 HTML,整篇文档即按原生 HTML 渲染,停止解析 Markdown 和 ReactiveMD。
8
+
7
9
  | 入口 | 内容 | 依赖 |
8
10
  | --- | --- | --- |
9
11
  | `reactive-md` | `compileLocal`、`createLocalRuntime`、表达式与数学工具 | 不依赖 React |
@@ -42,6 +44,7 @@ export function Article() {
42
44
  | 属性 | 类型 | 组件 | 说明 |
43
45
  | --- | --- | --- | --- |
44
46
  | `source` | `string` | `LocalReactiveDocument` | 源码变化时重新编译并创建新运行时;旧实例状态不保留。见[源码变化时保留参数](#源码变化时保留参数) |
47
+ | `compileOptions` | `LocalCompileOptions` | `LocalReactiveDocument` | 单次编译预算、HTML 能力开关和宿主组件 schema;省略时使用默认 ReactiveMD 模式 |
45
48
  | `document` | `LocalDocument` | `LocalDocumentView` | 已编译文档;由宿主编译一次 |
46
49
  | `runtime` | `LocalRuntime` | `LocalDocumentView` | 宿主创建并负责销毁 |
47
50
  | `onDiagnostics` | `(diagnostics: Diagnostic[]) => void` | 两者 | 接收编译诊断和控件写入被拒绝时的运行时诊断 |
@@ -49,6 +52,8 @@ export function Article() {
49
52
  | `locale` | `'en' \| 'zh'` | 两者 | 内置控件、标签和诊断显示的语言,默认 `'en'`;回调保留原始结构化诊断 |
50
53
  | `themes` | `readonly LocalThemeDefinition[]` | 两者 | 宿主登记的主题;CSS 单独加载,内置 `default` 始终可用 |
51
54
  | `colorScheme` | `'light' \| 'dark' \| 'auto'` | 两者 | 默认 `auto`,跟随最近祖先的显式模式或系统偏好 |
55
+ | `hostData` | `Readonly<Record<string, unknown>>` | 两者 | 按 `${kind}:${ref}` 索引的 JSON 安全宿主数据,用于 `hostComponent` 节点;不进入 worker |
56
+ | `hostRenderer` | `LocalHostRenderer` | 两者 | `hostComponent` 的客户端渲染函数;缺少 renderer 或数据时显示占位 |
52
57
 
53
58
  两个组件都没有 `className`、`style` 或插槽属性。`LocalReactiveDocument` 渲染 `<article class="md-document local-document">`;`LocalDocumentView` 使用同样的文档容器。样式覆盖见下文。
54
59
 
@@ -114,6 +119,28 @@ const result = compileLocal(source, options);
114
119
 
115
120
  需要在 React 中使用自定义预算时,先调用 `compileLocal`,再把编译文档和运行时交给 `LocalDocumentView`。`LocalReactiveDocument` 和 Playground 的编译线程使用默认预算。提高节点预算后,宿主应结合实际文档测量内存和预览渲染耗时。
116
121
 
122
+ ### 宿主组件
123
+
124
+ 宿主可以为单次编译登记叶子标签,不改变 `local-draft-2` 语法修订:
125
+
126
+ ```ts
127
+ import { compileLocal, type LocalHostComponentSchema } from 'reactive-md';
128
+
129
+ const hostComponents: LocalHostComponentSchema[] = [
130
+ {
131
+ name: 'host-weather',
132
+ form: 'leaf',
133
+ props: {
134
+ kind: { kind: 'enum', required: true, enum: ['weather'] },
135
+ ref: { kind: 'string', required: true, pattern: '^[a-z-]+$' },
136
+ },
137
+ },
138
+ ];
139
+ const result = compileLocal(source, { hostComponents });
140
+ ```
141
+
142
+ 不传 `hostComponents` 时,这些标签仍是未知标签并按原文降级。名称必须是唯一的小写 kebab-case,且不得复用 48 个作者标签名、P0 HTML 标签名或 `theme`;一次最多接受 32 个 schema。`pattern` 只接受线性时间安全的正则子集(拒绝反向引用、环视、命名组、嵌套量词和被量词修饰的分支)。schema 不合法返回 `local.options.invalid`,作者写出的属性不合法返回 `local.host.attribute`。一个合法宿主节点计为一个语法节点。把 `hostData`(按 `${kind}:${ref}` 索引)和 `hostRenderer` 传给 `LocalDocumentView`;两者都不进入 worker。缺少 renderer、缺少数据或 renderer 抛错时显示可见占位,不会让整个文档失败。`mode="static"` 走同一分派,并把 `ctx.mode` 传给 renderer。
143
+
117
144
  ### 版本查看与迁移
118
145
 
119
146
  三个纯函数在不创建运行时的情况下检查和迁移源码,均从 `reactive-md` 导出:
@@ -278,7 +305,7 @@ scheduler.schedule(source);
278
305
  - 源码修订:`inspectLocalSourceVersion`、`checkLocalUpgrade` 和 `migrateLocalSource`;`LocalUpgradeOptions` 配置源修订和语义变化许可。
279
306
  - 参数保留:`planLocalStateRetention` 和 `applyLocalStateRetention`。
280
307
  - 后台编译:`LocalCompileScheduler`、`LOCAL_COMPILE_DELAY_MS` 和 `startLocalCompileWorker`。
281
- - 类型导出:`Diagnostic`、`SourceRange`、`LocalValue`、`LocalValueKind`、`LocalNode`、`LocalBinding`、`LocalComputation`、`LocalValidation`、`LocalDocument`、`LocalCompileLimits`、`LocalCompileOptions`、`LocalCompileResult`、`LocalUpgradeOptions`、`LocalRuntime`、`LocalSnapshot`、`LocalStateFile`、`LocalStateGenerator`、`LocalStateParseResult`、`LocalStateResolution`、`LocalRetainedState`、`LocalStateRetentionReason`、`LocalStateRetentionDrop`、`LocalStateRetentionInput`、`LocalStateRetentionResult`、`LocalCompileWorker`、`LocalCompileWorkerScope`、`LocalCompileRequest`、`LocalCompileResponse`、`LocalCompileOutcome`、`LocalCompileMode`、`LocalCompileSchedulerOptions`。
308
+ - 类型导出:`Diagnostic`、`SourceRange`、`LocalValue`、`LocalValueKind`、`LocalNode`、`LocalBinding`、`LocalComputation`、`LocalValidation`、`LocalDocument`、`LocalCompileLimits`、`LocalCompileOptions`、`LocalCompileResult`、`LocalHostPropKind`、`LocalHostPropSchema`、`LocalHostComponentSchema`、`LocalUpgradeOptions`、`LocalRuntime`、`LocalSnapshot`、`LocalStateFile`、`LocalStateGenerator`、`LocalStateParseResult`、`LocalStateResolution`、`LocalRetainedState`、`LocalStateRetentionReason`、`LocalStateRetentionDrop`、`LocalStateRetentionInput`、`LocalStateRetentionResult`、`LocalCompileWorker`、`LocalCompileWorkerScope`、`LocalCompileRequest`、`LocalCompileResponse`、`LocalCompileOutcome`、`LocalCompileMode`、`LocalCompileSchedulerOptions`。
282
309
 
283
310
  `compileExpression`、`compileLatex` 和 `samplePlot` 是较低层的工具,稳定级别与核心 API 相同;通常只需要 `compileLocal` 和 `createLocalRuntime`。
284
311
 
@@ -357,7 +384,7 @@ const urlPolicy: LocalUrlPolicy = (raw, kind) => {
357
384
 
358
385
  ## 不提供的功能
359
386
 
360
- 本地模式不提供自动状态持久化或网络访问,也不提供插件或自定义组件注册、任意 HTML、作者 CSS、事件处理器、外部数据接口、表单提交、Vue 支持、React 18 支持或 CommonJS 入口。状态导出与导入是宿主的显式调用;运行时本身不会保存或发送状态。`LocalReactiveDocument` 在源码变化时仍从初值开始;请使用参数保留工具,或自行提供运行时和文档。宿主不应把这些能力当作可配置项。
387
+ 默认 ReactiveMD 路径支持 P0 HTML。作者 CSS、JavaScript 和扩展 HTML 的宿主开关使用独立的原生 HTML 路径,见 [HTML 部分兼容](html-compatibility-ch.md)。本地模式仍不提供自动状态持久化或不受限的网络访问、插件或自定义组件注册、外部数据接口、Vue 支持、React 18 支持或 CommonJS 入口。状态导出与导入是宿主的显式调用。`LocalReactiveDocument` 在源码变化时从初值开始;需要保留参数时使用保留工具,或自行管理运行时和文档。
361
388
 
362
389
 
363
390
  新增组块、颜色、槽位状态与迁移规则见[local-draft-2 扩展说明](local-components-v2-ch.md),升级清单见[0.4.0 发布与迁移](release-0.4.0-ch.md)。`0.4.0` 是 `next` 渠道的预览版。
@@ -4,6 +4,8 @@ Local interaction mode uses HTML-style tags, in-place parameters and `{{ express
4
4
 
5
5
  ## Runtime and entries
6
6
 
7
+ See [HTML compatibility](html-compatibility-en.md) for the next release's P0 HTML support and host capability options. The temporary routing policy sends the entire document to native HTML when author CSS, JavaScript or extended HTML is enabled. Markdown and ReactiveMD interpretation stop in that path.
8
+
7
9
  | Entry | Contents | Dependency |
8
10
  | --- | --- | --- |
9
11
  | `reactive-md` | `compileLocal`, `createLocalRuntime`, expression and math utilities | No React dependency |
@@ -42,6 +44,7 @@ export function Article() {
42
44
  | Prop | Type | Component | Notes |
43
45
  | --- | --- | --- | --- |
44
46
  | `source` | `string` | `LocalReactiveDocument` | Recompiles and creates a new runtime when the source changes; old instance state is not kept. See [Keeping values when source changes](#keeping-values-when-source-changes) |
47
+ | `compileOptions` | `LocalCompileOptions` | `LocalReactiveDocument` | Per-compilation limits, HTML capability flags and host component schemas; omitted options use the default ReactiveMD path |
45
48
  | `document` | `LocalDocument` | `LocalDocumentView` | Compiled document; compiled once by the host |
46
49
  | `runtime` | `LocalRuntime` | `LocalDocumentView` | Created by the host, which is responsible for disposal |
47
50
  | `onDiagnostics` | `(diagnostics: Diagnostic[]) => void` | Both | Receives compile diagnostics and runtime diagnostics when control writes are rejected |
@@ -49,6 +52,8 @@ export function Article() {
49
52
  | `locale` | `'en' \| 'zh'` | Both | Language for built-in labels, controls and displayed diagnostics; defaults to `'en'`. Callbacks keep structured diagnostics |
50
53
  | `themes` | `readonly LocalThemeDefinition[]` | Both | Host registrations; CSS loads separately; built-in `default` is always available |
51
54
  | `colorScheme` | `'light' \| 'dark' \| 'auto'` | Both | Defaults to `auto`, following the nearest explicit ancestor preference or the system |
55
+ | `hostData` | `Readonly<Record<string, unknown>>` | Both | JSON-safe host data keyed `${kind}:${ref}` for `hostComponent` nodes; never enters the worker |
56
+ | `hostRenderer` | `LocalHostRenderer` | Both | Client-only renderer for `hostComponent` nodes; a missing renderer or data renders a visible placeholder |
52
57
 
53
58
  Neither component has `className`, `style` or slot props. `LocalReactiveDocument` renders `<article class="md-document local-document">`; `LocalDocumentView` uses the same document container. See below for style overrides.
54
59
 
@@ -114,6 +119,28 @@ The budget counts `LocalNode` instances created cumulatively during parsing, inc
114
119
 
115
120
  To use a custom budget in React, call `compileLocal` first and pass the compiled document and runtime to `LocalDocumentView`. `LocalReactiveDocument` and the Playground compilation thread use the default budget. After raising the node budget, hosts should measure memory and preview rendering time with their actual documents.
116
121
 
122
+ ### Host components
123
+
124
+ A host can register leaf tags for one compilation without changing the `local-draft-2` syntax revision:
125
+
126
+ ```ts
127
+ import { compileLocal, type LocalHostComponentSchema } from 'reactive-md';
128
+
129
+ const hostComponents: LocalHostComponentSchema[] = [
130
+ {
131
+ name: 'host-weather',
132
+ form: 'leaf',
133
+ props: {
134
+ kind: { kind: 'enum', required: true, enum: ['weather'] },
135
+ ref: { kind: 'string', required: true, pattern: '^[a-z-]+$' },
136
+ },
137
+ },
138
+ ];
139
+ const result = compileLocal(source, { hostComponents });
140
+ ```
141
+
142
+ Without `hostComponents`, those tags remain unknown and fall back to source. Names must be unique lowercase kebab-case and cannot reuse one of the 48 author tag names, a P0 HTML tag name or `theme`; at most 32 schemas are accepted. `pattern` accepts only a linear-time-safe regex subset (no backreferences, lookarounds, named groups, nested quantifiers or quantified alternation). An invalid schema returns `local.options.invalid`, and an invalid authored attribute returns `local.host.attribute`. A valid host node counts as one syntax node. Pass `hostData`, keyed `${kind}:${ref}`, and `hostRenderer` to `LocalDocumentView`; neither enters the worker. A missing renderer, missing data or a throwing renderer renders a visible placeholder instead of failing the document. `mode="static"` uses the same dispatch and passes `ctx.mode` to the renderer.
143
+
117
144
  ### Version inspection and migration
118
145
 
119
146
  Three pure functions inspect and migrate source without creating a runtime. They are exported from `reactive-md`:
@@ -278,7 +305,7 @@ scheduler.schedule(source);
278
305
  - Source revisions: `inspectLocalSourceVersion`, `checkLocalUpgrade` and `migrateLocalSource`; `LocalUpgradeOptions` configures the source revision and semantic-change allowance.
279
306
  - Retention: `planLocalStateRetention` and `applyLocalStateRetention`.
280
307
  - Background compilation: `LocalCompileScheduler`, `LOCAL_COMPILE_DELAY_MS` and `startLocalCompileWorker`.
281
- - Type exports: `Diagnostic`, `SourceRange`, `LocalValue`, `LocalValueKind`, `LocalNode`, `LocalBinding`, `LocalComputation`, `LocalValidation`, `LocalDocument`, `LocalCompileLimits`, `LocalCompileOptions`, `LocalCompileResult`, `LocalUpgradeOptions`, `LocalRuntime`, `LocalSnapshot`, `LocalStateFile`, `LocalStateGenerator`, `LocalStateParseResult`, `LocalStateResolution`, `LocalRetainedState`, `LocalStateRetentionReason`, `LocalStateRetentionDrop`, `LocalStateRetentionInput`, `LocalStateRetentionResult`, `LocalCompileWorker`, `LocalCompileWorkerScope`, `LocalCompileRequest`, `LocalCompileResponse`, `LocalCompileOutcome`, `LocalCompileMode`, `LocalCompileSchedulerOptions`.
308
+ - Type exports: `Diagnostic`, `SourceRange`, `LocalValue`, `LocalValueKind`, `LocalNode`, `LocalBinding`, `LocalComputation`, `LocalValidation`, `LocalDocument`, `LocalCompileLimits`, `LocalCompileOptions`, `LocalCompileResult`, `LocalHostPropKind`, `LocalHostPropSchema`, `LocalHostComponentSchema`, `LocalUpgradeOptions`, `LocalRuntime`, `LocalSnapshot`, `LocalStateFile`, `LocalStateGenerator`, `LocalStateParseResult`, `LocalStateResolution`, `LocalRetainedState`, `LocalStateRetentionReason`, `LocalStateRetentionDrop`, `LocalStateRetentionInput`, `LocalStateRetentionResult`, `LocalCompileWorker`, `LocalCompileWorkerScope`, `LocalCompileRequest`, `LocalCompileResponse`, `LocalCompileOutcome`, `LocalCompileMode`, `LocalCompileSchedulerOptions`.
282
309
 
283
310
  `compileExpression`, `compileLatex` and `samplePlot` are lower-level utilities with the same stability level as the core API; usually only `compileLocal` and `createLocalRuntime` are needed.
284
311
 
@@ -357,7 +384,7 @@ These limits bound the work for a single document; they do not replace host cont
357
384
 
358
385
  ## Features not provided
359
386
 
360
- Local mode does not provide automatic state persistence or network access, plugins or custom component registration, arbitrary HTML, author CSS, event handlers, external data APIs, form submission, Vue support, React 18 support or a CommonJS entry. State export and import are explicit host calls; the runtime never saves or sends state by itself. `LocalReactiveDocument` still starts from initial values when the source changes; use the retention helpers or supply your own runtime and document. Hosts should not treat these capabilities as configuration options.
387
+ The default ReactiveMD path supports P0 HTML. Host options for author CSS, JavaScript and extended HTML use the separate native HTML path described in [HTML compatibility](html-compatibility-en.md). Local mode still provides no automatic state persistence or unrestricted network access, plugins or custom component registration, external data APIs, Vue support, React 18 support or a CommonJS entry. State export and import are explicit host calls. `LocalReactiveDocument` starts from initial values when the source changes; use retention helpers or manage the runtime and document yourself.
361
388
 
362
389
 
363
390
  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.4.0` is the preview release on the `next` channel.
@@ -6,6 +6,8 @@
6
6
 
7
7
  ## 1. 定位与范围
8
8
 
9
+ 下个发行版新增的 P0 HTML 和作者能力开关见 [HTML 部分兼容](html-compatibility-ch.md)。本规范描述三个开关全部关闭的默认路径;任意开启作者 CSS、JavaScript 或扩展 HTML 时,按照暂时性分流政策将整篇源码交给原生 HTML 路径。
10
+
9
11
  `0.4.0` 新增不可见的 `computed`/`const` 声明与数字、字符串、日期函数。声明语法、依赖与错误规则、函数签名及固定默认值见[复用计算与格式化数值](computations-formatting-ch.md)。
10
12
 
11
13
  跨字段校验、条件样式、数组与有限表格行生成见[条件、校验与本地集合](constraints-collections-ch.md)。
@@ -98,7 +100,7 @@ Reactive MD 用于本地交互文档:作者写 Markdown、放置输入控件
98
100
 
99
101
  正文中的 `Array<T>`、`Map<string, number>`、`x<y` 和货币 `$5`、`$10` 按文字处理;完整公式仍使用 `$...$` 或 `$$...$$`。单个未配对美元符号按文字显示。
100
102
 
101
- 支持无属性的 `<b>...</b>`、`<i>...</i>`、`<u>...</u>`、`<s>...</s>`、`<mark>...</mark>` 和 `<br>` / `<br/>`,分别生成加粗、斜体、下划线、删除线、高亮和硬换行节点。它们属于正文格式,不是交互组件;普通单换行仍按 Markdown 软换行处理。
103
+ 默认路径支持 [P0 HTML 清单](html-compatibility-ch.md#默认支持的-p0-html)中的文字格式、标题、容器、折叠、引用、代码、列表、链接和图片。它们生成受控节点,复用现有主题和渲染方式。普通单换行仍按 Markdown 软换行处理。
102
104
 
103
105
  脚注用 `[^note]` 引用,定义写为 `[^note]: 内容`,续写段落、列表和代码块按 Markdown 缩进。定义支持 Markdown 与上述基础 HTML。按首次引用顺序生成文末编号列表,重复引用共享编号并分别提供返回链接;标识符不区分大小写,重复定义采用第一条。未定义引用保留为文字,未引用定义不显示。脚注内的控件和插值保持为文字,不建立绑定或执行表达式。
104
106
 
@@ -96,7 +96,7 @@ Unknown components, unknown attributes, wrong positions or wrong attribute types
96
96
 
97
97
  Prose such as `Array<T>`, `Map<string, number>`, `x<y` and currency `$5` or `$10` stays text. Complete formulas still use `$...$` or `$$...$$`; an unmatched single dollar sign stays literal.
98
98
 
99
- Attribute-free `<b>...</b>`, `<i>...</i>`, `<u>...</u>`, `<s>...</s>`, `<mark>...</mark>` and `<br>` / `<br/>` produce bold, italic, underline, strikethrough, highlight and hard-break nodes. These are prose formatting, not interaction components. Ordinary single newlines remain Markdown soft breaks.
99
+ The default path accepts the [P0 HTML subset](html-compatibility-en.md#p0-html-in-the-default-mode): text formatting, headings, containers, disclosures, quotations, code, lists, links and images. It produces controlled nodes and reuses the current theme and renderer. Ordinary single newlines remain Markdown soft breaks. Under the temporary routing policy, enabling author CSS, JavaScript or extended HTML sends the entire source to native HTML and stops Markdown and ReactiveMD interpretation.
100
100
 
101
101
  Reference a footnote with `[^note]` and define it with `[^note]: Note text`. Continuation paragraphs, lists and code blocks use Markdown indentation. Definitions support Markdown and the basic HTML above. Notes appear at the end in first-reference order; repeated references share a number and each has a return link. Identifiers are case-insensitive and the first duplicate definition wins. Undefined references stay literal; unused definitions stay hidden. Controls and interpolations inside notes remain text and create no bindings or executable expressions.
102
102
 
@@ -0,0 +1,39 @@
1
+ # 0.5.1 预览版发布说明
2
+
3
+ `reactive-md@0.5.1` 是面向 `next` 渠道的 0.x 预览版。语法仍为 `local-draft-2`,组块协议为 `component-protocol-1`,主题协议为 `reactive-md-theme-1`。现有 0.5.x 导入和文档无需迁移。`latest` 仍为 `0.4.0`。
4
+
5
+ ```sh
6
+ npm install reactive-md@next
7
+ # 或固定预览版
8
+ npm install reactive-md@0.5.1
9
+ ```
10
+
11
+ 离线安装可下载 [npm 安装包](https://registry.npmjs.org/reactive-md/-/reactive-md-0.5.1.tgz)。
12
+
13
+ ## 编辑器视图与主题
14
+
15
+ `ReactiveMarkdownEditor` 在编辑区下方新增底栏,显示 Unicode 字数和键盘提示,并提供编辑、并排和预览三种视图。传入 `preview` 后,宿主内容会渲染在编辑器框架内;`viewMode` 和 `onViewModeChange` 用于受控切换,`defaultViewMode` 设置非受控实例的初始视图。切换视图会保留源码选区、撤销记录和预览组件的状态。
16
+
17
+ 容器宽度不超过 600px 时只提供编辑和预览。仅编辑源码的实例保留字数和键盘提示。在源码中先按 Esc 再按 Tab 可把焦点移到工具栏。
18
+
19
+ 编辑区、行号、语法高亮、工具栏和菜单跟随实例主题。浅色模式使用白色编辑区,深色模式保留深蓝底色,`auto` 跟随系统设置。宿主页面主题与编辑器主题相互独立。
20
+
21
+ 完整属性表和视图行为见 [React 源码编辑器](editor-ch.md)。
22
+
23
+ ## HTML 兼容
24
+
25
+ 默认渲染器新增 P0 HTML 子集,包括富文本折叠、容器、标题、代码、列表、链接和图片。宿主可额外开启作者 CSS、JavaScript 和扩展 HTML;三个选项默认全部关闭。任意开启一个,整篇文档分流到隔离的原生 HTML 路径,该路径停止解析 Markdown 和 ReactiveMD。
26
+
27
+ 这项分流是下一版本前的暂时策略。静态导出禁用作者 JavaScript。支持的子集、选项和冲突规则见 [HTML 部分兼容](html-compatibility-ch.md)。
28
+
29
+ ## 兼容性
30
+
31
+ 现有 `reactive-md`、`reactive-md/react`、`reactive-md/editor` 和 `reactive-md/styles.css` 导入保持不变。为 `0.4.x` 和 `0.5.0` 编写的文档无需修改。语法修订、组块协议和主题协议版本不变。
32
+
33
+ 编辑器需要 React 19;核心 `reactive-md` 入口仍不依赖 React。版本轴说明见[变更记录](../CHANGELOG-ch.md)和[版本与兼容性](compatibility-ch.md)。
34
+
35
+ ## 验证与限制
36
+
37
+ 0.5.1 发布门禁覆盖核心与渲染器测试、编辑器入口及其视图、类型检查、包入口、文档链接、离线安装包消费、静态渲染和浏览器交互。CI 使用 Node 22.12 和 24 搭配 Chromium;本机浏览器检查使用 Microsoft Edge。导出 HTML 之外的通用 SSR 水合、Firefox 和 WebKit 尚未验证。
38
+
39
+ 项目仍处于 0.x 预览阶段。安全边界和宿主责任见 [SECURITY-ch.md](../SECURITY-ch.md)。
@@ -0,0 +1,39 @@
1
+ # 0.5.1 preview release
2
+
3
+ `reactive-md@0.5.1` is a 0.x preview that targets the `next` channel. It keeps syntax revision `local-draft-2`, component protocol `component-protocol-1` and theme protocol `reactive-md-theme-1`. Existing 0.5.x imports and documents need no migration. `latest` remains `0.4.0`.
4
+
5
+ ```sh
6
+ npm install reactive-md@next
7
+ # or pin the preview
8
+ npm install reactive-md@0.5.1
9
+ ```
10
+
11
+ For offline installation, use the [npm tarball](https://registry.npmjs.org/reactive-md/-/reactive-md-0.5.1.tgz).
12
+
13
+ ## Editor views and themes
14
+
15
+ `ReactiveMarkdownEditor` adds a status bar below the editing area. It shows the Unicode character count and a keyboard hint, and switches between Edit, Split and Preview. Pass `preview` to render host content inside the editor frame; `viewMode` and `onViewModeChange` control the mode from the host, while `defaultViewMode` sets the initial mode for an uncontrolled instance. Switching views keeps the source selection, undo history and preview component state.
16
+
17
+ Containers up to 600px wide offer only Edit and Preview. A source-only editor keeps the count and keyboard hint. Press Esc, then Tab in the source to move focus to the toolbar.
18
+
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
+
21
+ See [React source editor](editor-en.md) for the full prop table and view behavior.
22
+
23
+ ## HTML compatibility
24
+
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
+
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.
28
+
29
+ ## Compatibility
30
+
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
+
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-en.md) for the version axes.
34
+
35
+ ## Validation and limits
36
+
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
+
39
+ The project remains a 0.x preview. Security boundaries and host responsibilities are documented in [SECURITY.md](../SECURITY.md).
@@ -0,0 +1,35 @@
1
+ # 0.5.2 预览版发布
2
+
3
+ `reactive-md@0.5.2` 是面向 `next` 渠道的 0.x 预览版。语法修订仍为 `local-draft-2`,主题协议仍为 `reactive-md-theme-1`;因新增宿主组件扩展轴,组块协议提升到 `component-protocol-2`。现有 0.5.x 导入和文档无需迁移。`latest` 仍为 `0.4.0`。
4
+
5
+ ```sh
6
+ npm install reactive-md@next
7
+ # 或固定预览版
8
+ npm install reactive-md@0.5.2
9
+ ```
10
+
11
+ 离线安装可使用 [npm tarball](https://registry.npmjs.org/reactive-md/-/reactive-md-0.5.2.tgz)。
12
+
13
+ ## 宿主组件
14
+
15
+ `compileLocal(source, { hostComponents })` 增加一条可选的宿主叶子标签扩展轴。Schema 是普通数据:名称、`form: 'leaf'`,以及声明 `kind`、`required`、`static`、`enum` 和 `pattern` 的属性表。名称必须是唯一的小写 kebab-case,不能复用 48 个作者标签名、P0 HTML 标签名或主题名;单次编译最多接受 32 个 Schema。
16
+
17
+ 不传 `hostComponents` 时行为不变:标签仍是未知标签并按原文降级。传入后,解析器生成 `hostComponent` 叶子节点,编译器校验其属性。属性失败使用 `local.host.attribute`,Schema 非法使用 `local.options.invalid`。合法宿主节点计为一个语法节点,宿主属性同样受共享字符串长度预算约束。`pattern` 限制在线性时间安全子集内,拒绝反向引用、环视、命名组、嵌套量词和被量词修饰的分支。
18
+
19
+ `LocalDocumentView` 和 `LocalReactiveDocument` 接受 `hostData`(按 `${kind}:${ref}` 索引的 JSON 安全数据)与仅客户端的 `hostRenderer(node, data, ctx)`。缺少 renderer、缺少数据或 renderer 抛错时显示可见占位,不会让文档失败。`mode="static"` 走同一分派。Schema 会随编译请求进入 worker;renderer 和宿主数据不会。
20
+
21
+ 完整契约见[本地模式集成](local-integration-ch.md#宿主组件)与[组块协议](component-protocol-ch.md)。
22
+
23
+ ## 协议修订
24
+
25
+ 组块协议现为 `component-protocol-2`。语法修订仍为 `local-draft-2`,机器验收基线 `component-protocol-1.json` 继续冻结,用于 48 个作者组块。宿主组件不提供可移植机器用例,因为渲染由宿主拥有。
26
+
27
+ ## 兼容性
28
+
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-ch.md)。
30
+
31
+ ## 验证与限制
32
+
33
+ 发布门槛覆盖类型检查、完整测试套件、文档链接、包构建和打包安装冒烟检查。单文件导出之外的通用 SSR 水合、Firefox 和 WebKit 仍未验证。
34
+
35
+ 项目仍是 0.x 预览版。安全边界与宿主责任见[SECURITY-ch.md](../SECURITY-ch.md)。
@@ -0,0 +1,35 @@
1
+ # 0.5.2 preview release
2
+
3
+ `reactive-md@0.5.2` is a 0.x preview that targets the `next` channel. It keeps syntax revision `local-draft-2` and theme protocol `reactive-md-theme-1`, and raises the component protocol to `component-protocol-2` for the host component extension axis. Existing 0.5.x imports and documents need no migration. `latest` remains `0.4.0`.
4
+
5
+ ```sh
6
+ npm install reactive-md@next
7
+ # or pin the preview
8
+ npm install reactive-md@0.5.2
9
+ ```
10
+
11
+ For offline installation, use the [npm tarball](https://registry.npmjs.org/reactive-md/-/reactive-md-0.5.2.tgz).
12
+
13
+ ## Host components
14
+
15
+ `compileLocal(source, { hostComponents })` adds an opt-in extension axis for host-defined leaf tags. A schema is plain data: a name, `form: 'leaf'` and a property table declaring `kind`, `required`, `static`, `enum` and `pattern`. Names must be unique lowercase kebab-case and cannot reuse the 48 author tag names, P0 HTML tag names or the theme name; one compilation accepts at most 32 schemas.
16
+
17
+ Without `hostComponents`, behavior is unchanged: the tag remains unknown and falls back to source. With the option, the parser produces a `hostComponent` leaf node and the compiler validates its attributes. Attribute failures use `local.host.attribute`; invalid schemas use `local.options.invalid`. A valid host node counts as one syntax node, and host attributes obey the shared string-length budget. `pattern` is restricted to a linear-time-safe regex subset that rejects backreferences, lookarounds, named groups, nested quantifiers and quantified alternation.
18
+
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
+
21
+ See [Local mode integration](local-integration-en.md#host-components) and [Component protocol](component-protocol-en.md) for the full contract.
22
+
23
+ ## Protocol revision
24
+
25
+ The component protocol is now `component-protocol-2`. The syntax revision remains `local-draft-2`, and the machine conformance baseline `component-protocol-1.json` stays frozen for the 48 author components. Host components have no portable machine cases because rendering is host-owned.
26
+
27
+ ## Compatibility
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](../CHANGELOG.md) and [Versions and compatibility](compatibility-en.md).
30
+
31
+ ## Validation and limits
32
+
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
+
35
+ The project remains a 0.x preview. Security boundaries and host responsibilities are documented in [SECURITY.md](../SECURITY.md).
@@ -1,19 +1,19 @@
1
1
  # 发布清单
2
2
 
3
- 本文件是维护者的手动发布流程。本清单覆盖 `0.5.0` 预览版,目标渠道为 `next`,`latest` 仍为 `0.4.0`。版本规则见[版本与兼容性](compatibility-ch.md),面向使用者的说明见[0.5.0 发布说明](release-0.5.0-ch.md)。
3
+ 本文件是维护者的手动发布流程。本清单覆盖 `0.5.2` 预览版,目标渠道为 `next`,`latest` 仍为 `0.4.0`。版本规则见[版本与兼容性](compatibility-ch.md),面向使用者的说明见[0.5.2 发布说明](release-0.5.2-ch.md)。
4
4
 
5
5
  ## 发布前确认
6
6
 
7
7
  ### 包身份与元数据
8
8
 
9
- 非 scope 名称 `reactive-md` 已由已发布的 `0.3.0`、`0.3.1` 建立,`reactive-md/react` 和 `reactive-md/styles.css` 子路径也随这些版本生效。`0.5.0` 新增 `reactive-md/editor` 和 `reactive-md/editor/styles.css`。不要把改名当作常规发布准备:改名会破坏导入、状态工具和文档。
9
+ 非 scope 名称 `reactive-md` 已由已发布的 `0.3.0`、`0.3.1` 建立,`reactive-md/react` 和 `reactive-md/styles.css` 子路径也随这些版本生效。`0.5.0` 新增 `reactive-md/editor` 和 `reactive-md/editor/styles.css`,`0.5.1` 与 `0.5.2` 保持这些入口。不要把改名当作常规发布准备:改名会破坏导入、状态工具和文档。
10
10
 
11
11
  1. 除非维护者明确决定改用 scope,否则保持 `reactive-md`。scope 需要对应的 npm 账号或组织权限。
12
12
  2. 如果改名,同时更新 `package.json` 的 `name`、文档中的导入语句、tarball 文件名说明、示例和相关子路径,并在变更记录中按破坏性变更说明。
13
13
  3. 核对 `package.json` 的 `repository`、`homepage`、`bugs`、`license`、`engines` 等发布元数据;当前已设置,发布前确认 URL 和最低 Node 版本仍然正确,并确认 `private` 保持移除状态。
14
14
  4. 确认 `files` 覆盖发布所需内容。当前包含 `dist-library`、`dist-standalone`、`bin`、`cli`、README(`README.md`、`README-en.md`、`README-ch.md`)、中英文贡献指南、变更记录与安全策略、`THIRD_PARTY_NOTICES.md`、`docs` 和 `examples`;新增文档或 notice 时同步加入 `files`。
15
15
 
16
- 包名和版本决定 tarball 名称。当前 `0.5.0` 的预期文件名是 `reactive-md-0.5.0.tgz`;改名或改版本后以 `npm pack` 的实际输出为准。
16
+ 包名和版本决定 tarball 名称。当前 `0.5.2` 的预期文件名是 `reactive-md-0.5.2.tgz`;改名或改版本后以 `npm pack` 的实际输出为准。
17
17
 
18
18
  ### 第三方 notice
19
19
 
@@ -51,7 +51,7 @@ npm pack
51
51
  mkdir /tmp/reactive-md-consumer
52
52
  cd /tmp/reactive-md-consumer
53
53
  npm init -y
54
- npm install /path/to/reactive-md-0.5.0.tgz
54
+ npm install /path/to/reactive-md-0.5.2.tgz
55
55
  ```
56
56
 
57
57
  核心入口可在 Node 中直接检查:
@@ -96,12 +96,12 @@ import 'reactive-md/editor/styles.css';
96
96
 
97
97
  1. 确认工作区干净,变更已审查;`npm ci` 从锁文件安装成功。
98
98
  2. 在 Node 22.12 和受支持的较新 LTS(当前为 24)上运行 `npm run verify:release`。这是维护者和 CI 共用的完整门禁,不要用一组自行挑选的命令代替。
99
- 3. 确认版本号、`CHANGELOG-ch.md` 和发布说明一致。`0.5.0` 新增编辑器入口,但 `LOCAL_SYNTAX_VERSION`、组块协议和主题协议修订不变。仅在某条版本轴自身的契约变化时更新它。
99
+ 3. 确认版本号、`CHANGELOG-ch.md` 和发布说明一致。`0.5.2` 新增宿主组件,并把组块协议提升到 `component-protocol-2`;`LOCAL_SYNTAX_VERSION` 和主题协议不变。仅在某条版本轴自身的契约变化时更新它。
100
100
  4. 检查门禁保留的安装包,包括文件列表、大小和许可文件。手动重新运行 `npm pack` 会产生新候选包,需要单独完成安装验证。
101
101
  5. 核对安装包的 SHA256 与 `artifacts/release-package/package-verification.json` 一致,并记录到发布说明或内部发布记录。
102
102
  6. 合并发布提交,等待 `main` 上的 CI 全部通过。
103
- 7. 手动创建并推送 tag,例如 `v0.5.0`。不要在自动发布工作流中保存 npm token。
104
- 8. 在维护者本机完成 npm 登录和双因素认证后,手动发布已经验证的预览版安装包:`npm publish artifacts/release-package/reactive-md-0.5.0.tgz --access public --tag next`。预览版先发布到 `next`,本次 `latest` 保持 `0.4.0`。提升 `0.5.0` 需要单独决定:`npm dist-tag add reactive-md@0.5.0 latest`。
103
+ 7. 手动创建并推送 tag,例如 `v0.5.2`。不要在自动发布工作流中保存 npm token。
104
+ 8. 在维护者本机完成 npm 登录和双因素认证后,手动发布已经验证的预览版安装包:`npm publish artifacts/release-package/reactive-md-0.5.2.tgz --access public --tag next`。预览版先发布到 `next`,本次 `latest` 保持 `0.4.0`。提升 `0.5.2` 需要单独决定:`npm dist-tag add reactive-md@0.5.2 latest`。
105
105
  9. 在 npm 和 GitHub Releases 上核对包内容、版本、README、许可与发布说明;从公开 registry 重新安装一次。
106
106
  10. 从 registry 验证 README 中的安装命令可用,核对 registry 的完整性摘要与发布 tarball 一致。
107
107
 
@@ -1,19 +1,19 @@
1
1
  # Release checklist
2
2
 
3
- This file is the maintainers' manual release process. This checklist covers the `0.5.0` preview release, which targets the `next` channel; `latest` remains `0.4.0`. See [Versions and compatibility](compatibility-en.md) for version rules and [0.5.0 release notes](release-0.5.0-en.md) for the user-facing summary.
3
+ This file is the maintainers' manual release process. This checklist covers the `0.5.2` preview release, which targets the `next` channel; `latest` remains `0.4.0`. See [Versions and compatibility](compatibility-en.md) for version rules and [0.5.2 release notes](release-0.5.2-en.md) for the user-facing summary.
4
4
 
5
5
  ## Before release
6
6
 
7
7
  ### Package identity and metadata
8
8
 
9
- The unscoped name `reactive-md` is already established by the published `0.3.0` and `0.3.1` releases, together with the `reactive-md/react` and `reactive-md/styles.css` subpaths. `0.5.0` adds `reactive-md/editor` and `reactive-md/editor/styles.css`. Do not treat a rename as routine release preparation: changing the name is a breaking change for imports, state tooling and documentation.
9
+ The unscoped name `reactive-md` is already established by the published `0.3.0` and `0.3.1` releases, together with the `reactive-md/react` and `reactive-md/styles.css` subpaths. `0.5.0` adds `reactive-md/editor` and `reactive-md/editor/styles.css`; `0.5.1` and `0.5.2` keep those entries. Do not treat a rename as routine release preparation: changing the name is a breaking change for imports, state tooling and documentation.
10
10
 
11
11
  1. Keep `reactive-md` unless maintainers explicitly decide on a scoped rename. A scope requires the corresponding npm account or organization permissions.
12
12
  2. If renaming, update `name` in `package.json`, import statements in the documentation, tarball filename references, examples and the relevant subpaths, then record the change as breaking in the changelog.
13
13
  3. Check release metadata in `package.json`: `repository`, `homepage`, `bugs`, `license`, `engines` and similar fields. They are currently set; before releasing, confirm the URLs and minimum Node version are still correct and that `private` remains removed.
14
14
  4. Confirm `files` covers what needs to be published. It currently includes `dist-library`, `dist-standalone`, `bin`, `cli`, the READMEs (`README.md`, `README-en.md`, `README-ch.md`), the contributing, changelog and security guides in both languages, `THIRD_PARTY_NOTICES.md`, `docs` and `examples`; add any new documentation or notices to `files` as well.
15
15
 
16
- The package name and version determine the tarball name. The expected filename for `0.5.0` is `reactive-md-0.5.0.tgz`; after renaming or changing the version, use the actual output of `npm pack`.
16
+ The package name and version determine the tarball name. The expected filename for `0.5.2` is `reactive-md-0.5.2.tgz`; after renaming or changing the version, use the actual output of `npm pack`.
17
17
 
18
18
  ### Third-party notices
19
19
 
@@ -51,7 +51,7 @@ npm pack
51
51
  mkdir /tmp/reactive-md-consumer
52
52
  cd /tmp/reactive-md-consumer
53
53
  npm init -y
54
- npm install /path/to/reactive-md-0.5.0.tgz
54
+ npm install /path/to/reactive-md-0.5.2.tgz
55
55
  ```
56
56
 
57
57
  The core entry can be checked directly in Node:
@@ -86,7 +86,7 @@ Release notes are for users and must include at least:
86
86
 
87
87
  - The package version, `LOCAL_SYNTAX_VERSION`, component protocol revision and theme protocol revision; these are different version numbers.
88
88
  - The install command `npm install reactive-md@next`, or `npm install reactive-md@<version>` to pin the release, with a downloadable tarball as an offline installation option.
89
- - User-visible changes, breaking changes and migration steps; link directly to the [changelog](../CHANGELOG.md) and the [0.5.0 release notes](release-0.5.0-en.md) for this cycle.
89
+ - User-visible changes, breaking changes and migration steps; link directly to the [changelog](../CHANGELOG.md) and the [0.5.2 release notes](release-0.5.2-en.md) for this cycle.
90
90
  - Verified platforms, plus unverified browsers, general SSR hydration and other scope.
91
91
  - Known limitations and a link to [SECURITY.md](../SECURITY.md).
92
92
 
@@ -96,12 +96,12 @@ Do not write results for checks that have not run, and do not present the existe
96
96
 
97
97
  1. Confirm the working tree is clean, changes have been reviewed, and `npm ci` installs successfully from the lockfile.
98
98
  2. On Node 22.12 and a supported newer LTS (currently 24), run `npm run verify:release`. This is the same complete gate local maintainers and CI use; do not replace it with a list of hand-picked commands.
99
- 3. Confirm the version number, `CHANGELOG.md` and the release notes agree. `0.5.0` adds the editor entry but keeps `LOCAL_SYNTAX_VERSION` and the component and theme protocol revisions. Update a version axis only when its own contract changes.
99
+ 3. Confirm the version number, `CHANGELOG.md` and the release notes agree. `0.5.2` adds host components and raises the component protocol to `component-protocol-2`; `LOCAL_SYNTAX_VERSION` and the theme protocol are unchanged. Update a version axis only when its own contract changes.
100
100
  4. Inspect the verified archive retained by the gate, including its file list, size and license files. A fresh manual `npm pack` produces a new candidate that needs its own installation verification.
101
101
  5. Compare the archive's SHA256 with `artifacts/release-package/package-verification.json` and record it in the release notes or an internal release record.
102
102
  6. Merge the release commit and wait for all CI on `main` to pass.
103
- 7. Create and push the tag manually, for example `v0.5.0`. Do not store npm tokens in an automated release workflow.
104
- 8. After signing in to npm and completing two-factor authentication on the maintainer's machine, publish the verified preview tarball manually: `npm publish artifacts/release-package/reactive-md-0.5.0.tgz --access public --tag next`. Preview releases start on `next`, and this release keeps `latest` on `0.4.0`. Promoting `0.5.0` requires a separate decision: `npm dist-tag add reactive-md@0.5.0 latest`.
103
+ 7. Create and push the tag manually, for example `v0.5.2`. Do not store npm tokens in an automated release workflow.
104
+ 8. After signing in to npm and completing two-factor authentication on the maintainer's machine, publish the verified preview tarball manually: `npm publish artifacts/release-package/reactive-md-0.5.2.tgz --access public --tag next`. Preview releases start on `next`, and this release keeps `latest` on `0.4.0`. Promoting `0.5.2` requires a separate decision: `npm dist-tag add reactive-md@0.5.2 latest`.
105
105
  9. Verify the package contents, version, README, license and release notes on npm and GitHub Releases; reinstall once from the public registry.
106
106
  10. Verify that the install command in the README works from the registry, and that the registry integrity digest matches the released tarball.
107
107
 
@@ -4,6 +4,8 @@
4
4
 
5
5
  ## 两种产物
6
6
 
7
+ 默认 ReactiveMD 文档遵循下述导出规则。原生 HTML 文档的交互导出保留 `compileOptions` 和整篇 HTML 路径,静态导出禁用作者 JavaScript;这类文档没有 ReactiveMD 参数。编译开关、隔离和暂时性分流政策见 [HTML 部分兼容](html-compatibility-ch.md)。
8
+
7
9
  **交互式 HTML** 是一个自包含的 `.html` 文件。它内嵌原始源码、独立浏览器运行时、React 19、样式表和打印样式。读者通过 `file://` 打开即可交互,不需要 Node.js、React、reactive-md 包或网络连接。
8
10
 
9
11
  首次渲染是静态内容;内嵌运行时水合完成后再增强为控件。禁用 JavaScript 时,正文、当前值、表格、公式和图表仍然可读。读者刷新后回到导出基线,后续修改不会自动保存。
@@ -4,6 +4,8 @@ This guide covers the single-file HTML exporter introduced with `local-draft-2`.
4
4
 
5
5
  ## Output modes
6
6
 
7
+ The rules below describe default ReactiveMD documents. Native HTML interactive export preserves `compileOptions` and whole-document HTML routing; static export disables author JavaScript. These documents have no ReactiveMD parameters. See [HTML compatibility](html-compatibility-en.md) for capability flags, isolation and the temporary routing policy.
8
+
7
9
  **Interactive HTML** is one self-contained `.html` file. It embeds the original source, the standalone browser runtime, React 19, the current stylesheet and print styles. Readers can open it through `file://` without Node.js, React, the reactive-md package or network access.
8
10
 
9
11
  The first rendered pass is static. After the embedded runtime hydrates it, controls become interactive. With JavaScript disabled the same static values, tables, formulas and charts remain readable. Refreshing restores the exported baseline; the reader's changes are not persisted.
@@ -14,7 +14,7 @@ The conformance sources are unversioned and use the current `local-draft-2` revi
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 [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/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.
18
18
 
19
19
  ```sh
20
20
  npm run test:components
@@ -4,6 +4,8 @@ These are standalone authoring examples for `local-draft-2`, described in the [l
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.
8
+
7
9
  ## Start with the short examples
8
10
 
9
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.