reactive-md 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/CHANGELOG-ch.md +203 -194
  2. package/CHANGELOG.md +203 -194
  3. package/CONTRIBUTING-ch.md +67 -67
  4. package/CONTRIBUTING.md +69 -69
  5. package/README-ch.md +157 -157
  6. package/README-en.md +184 -184
  7. package/README.md +184 -184
  8. package/SECURITY-ch.md +81 -81
  9. package/SECURITY.md +81 -81
  10. package/THIRD_PARTY_NOTICES.md +313 -209
  11. package/bin/reactive-md.mjs +39 -39
  12. package/cli/args.mjs +181 -181
  13. package/cli/assets.mjs +390 -390
  14. package/cli/build.mjs +268 -268
  15. package/cli/document.mjs +130 -130
  16. package/cli/errors.mjs +61 -61
  17. package/cli/fs-utils.mjs +133 -133
  18. package/cli/glob.mjs +203 -203
  19. package/cli/help.mjs +138 -138
  20. package/cli/lint.mjs +177 -177
  21. package/cli/main.mjs +55 -55
  22. package/cli/migrate.mjs +368 -368
  23. package/cli/package.mjs +210 -210
  24. package/dist-library/{authoring-DSC0VsNK.js → authoring-BEVyth5X.js} +1 -1
  25. package/dist-library/compiler-Cm3ppMxG.js +46044 -0
  26. package/dist-library/{react-Dk94rcOp.js → react-Bh7_oxZp.js} +20110 -20113
  27. package/dist-library/reactive-md-authoring.js +2 -2
  28. package/dist-library/reactive-md-print.css +284 -284
  29. package/dist-library/reactive-md-react-unstyled.js +1 -1
  30. package/dist-library/reactive-md-react.js +1 -1
  31. package/dist-library/reactive-md.css +1 -1
  32. package/dist-library/reactive-md.js +3 -3
  33. package/dist-library/{runtime-D8KbnCd0.js → runtime-DlFYQ4s_.js} +1 -1
  34. package/dist-library/types/local/math-display.d.ts +22 -23
  35. package/dist-library/types/local/math-view.d.ts +6 -7
  36. package/dist-standalone/reactive-md-standalone.css +1 -1
  37. package/dist-standalone/reactive-md-standalone.js +318 -62
  38. package/docs/compatibility/compatibility-ch.md +121 -119
  39. package/docs/compatibility/compatibility-en.md +121 -119
  40. package/docs/compatibility/source-versioning-ch.md +159 -159
  41. package/docs/compatibility/source-versioning-en.md +159 -159
  42. package/docs/development/component-development-ch.md +210 -210
  43. package/docs/development/component-development-en.md +210 -210
  44. package/docs/development/component-protocol-ch.md +747 -747
  45. package/docs/development/component-protocol-en.md +747 -747
  46. package/docs/development/performance-ch.md +76 -76
  47. package/docs/development/performance-en.md +76 -76
  48. package/docs/development/releasing-ch.md +108 -108
  49. package/docs/development/releasing-en.md +108 -108
  50. package/docs/integration/author-tools-ch.md +62 -62
  51. package/docs/integration/author-tools-en.md +62 -62
  52. package/docs/integration/shareable-export-ch.md +209 -209
  53. package/docs/integration/shareable-export-en.md +211 -211
  54. package/docs/reference/computations-formatting-ch.md +87 -87
  55. package/docs/reference/computations-formatting-en.md +87 -87
  56. package/docs/reference/constraints-collections-ch.md +84 -84
  57. package/docs/reference/constraints-collections-en.md +84 -84
  58. package/docs/reference/diagnostics-counting-ch.md +104 -104
  59. package/docs/reference/diagnostics-counting-en.md +104 -104
  60. package/docs/reference/local-components-v2-ch.md +138 -138
  61. package/docs/reference/local-components-v2-en.md +104 -104
  62. package/docs/reference/local-interaction-syntax-ch.md +515 -511
  63. package/docs/reference/local-interaction-syntax-en.md +511 -507
  64. package/docs/reference/theme-protocol-ch.md +107 -107
  65. package/docs/reference/theme-protocol-en.md +107 -107
  66. package/docs/releases/release-0.4.0-ch.md +89 -89
  67. package/docs/releases/release-0.4.0-en.md +89 -89
  68. package/docs/releases/release-0.4.1-ch.md +23 -23
  69. package/docs/releases/release-0.4.1-en.md +23 -23
  70. package/docs/releases/release-0.6.1-ch.md +27 -0
  71. package/docs/releases/release-0.6.1-en.md +27 -0
  72. package/examples/conformance/README.md +53 -53
  73. package/examples/conformance/component-protocol-1.json +482 -482
  74. package/examples/conformance/component-protocol-1.schema.json +76 -76
  75. package/examples/conformance/local-draft-1.json +50 -50
  76. package/examples/conformance/local-draft-2.json +212 -212
  77. package/examples/integration/README.md +47 -47
  78. package/examples/integration/core/index.mjs +32 -32
  79. package/examples/integration/worker/index.html +19 -19
  80. package/examples/integration/worker/main.js +61 -61
  81. package/examples/integration/worker/package.json +13 -13
  82. package/examples/integration/worker/worker.js +3 -3
  83. package/examples/local/README.md +74 -74
  84. package/examples/local/charts.reactive.md +73 -73
  85. package/examples/local/recipes/invoice-zh.reactive.md +36 -36
  86. package/examples/local/recipes/invoice.reactive.md +36 -36
  87. package/examples/local/recipes/workshop-zh.reactive.md +33 -33
  88. package/examples/local/recipes/workshop.reactive.md +33 -33
  89. package/examples/local/showcase/README.md +25 -25
  90. package/examples/local/showcase/explore.reactive.md +102 -102
  91. package/examples/local/showcase/flow.reactive.md +86 -86
  92. package/examples/local/showcase/forms.reactive.md +126 -126
  93. package/examples/local/showcase/functions.reactive.md +119 -119
  94. package/examples/local/showcase/layout.reactive.md +100 -100
  95. package/examples/local/showcase/statistics.reactive.md +108 -108
  96. package/examples/local/showcase/tasks.reactive.md +89 -89
  97. package/examples/local/showcase/zh/explore.reactive.md +102 -102
  98. package/examples/local/showcase/zh/flow.reactive.md +86 -86
  99. package/examples/local/showcase/zh/forms.reactive.md +126 -126
  100. package/examples/local/showcase/zh/functions.reactive.md +119 -119
  101. package/examples/local/showcase/zh/layout.reactive.md +100 -100
  102. package/examples/local/showcase/zh/statistics.reactive.md +108 -108
  103. package/examples/local/showcase/zh/tasks.reactive.md +89 -89
  104. package/package.json +152 -152
  105. package/dist-library/compiler-CRD88BMt.js +0 -24964
package/README-en.md CHANGED
@@ -1,184 +1,184 @@
1
- # Reactive MD
2
-
3
- [中文](README-ch.md)
4
-
5
- Write local interactive documents in Markdown. Add input controls, name parameters with `bind`, and connect prose, formulas, charts and diagrams with `{{ expressions }}`. Document authors do not write JavaScript or CSS.
6
-
7
- Local mode uses HTML-style tags, with parameters and table data written directly in the prose; LaTeX formulas can drive function plots. The TypeScript core and the React renderer can be integrated independently. `0.6.0` is available on both `latest` and `next` and adds native HTML tables, expanded math and code highlighting, layered diagrams and form fixes. Syntax revision stays `local-draft-2`, and the component protocol is `component-protocol-2`. See [README-ch.md](README-ch.md) for the Chinese overview.
8
-
9
- ## Start here
10
-
11
- - [Documentation index](docs/README.md): guides, references, integration, compatibility, development and releases.
12
- - [Beginner guide](docs/guides/local-guide-en.md): move from Markdown to interactive documents, with a complete exercise and an error quick reference.
13
- - [Local interaction syntax specification](docs/reference/local-interaction-syntax-en.md) · [Feature tours and examples](examples/local/README.md): 48 tag names, tags, in-place parameters and LaTeX plots.
14
- - [Local mode integration](docs/integration/local-integration-en.md): `compileLocal`, the state runtime, React embedding, URL policy and style scoping.
15
- - [HTML compatibility](docs/reference/html-compatibility-en.md): P0 HTML and the next release's temporary routing policy for author CSS, JavaScript and extended HTML.
16
- - [Shareable documents and static export](docs/integration/shareable-export-en.md): single-file interactive HTML, static output, versioned state files, assets, the CLI and the standalone browser API.
17
- - [Theme protocol](docs/reference/theme-protocol-en.md): document theme selection, custom CSS and light/dark modes.
18
- - [Author tools](docs/integration/author-tools-en.md): source highlighting, completion, binding navigation, rename, formatting and command-line lint.
19
- - [React source editor](docs/integration/editor-en.md): controlled editor, props, ref handle, diagnostics, locale, theme and history.
20
- - [Standalone integration examples](examples/integration/README.md): Node core and React pages you can copy and run outside the repository.
21
- - [Versions and compatibility](docs/compatibility/compatibility-en.md): 0.x rules, migration, the diagnostics contract and supported platforms.
22
- - [Component protocol](docs/development/component-protocol-en.md) · [Component development guide](docs/development/component-development-en.md): declarations, behavior contracts and compatibility acceptance for new components.
23
- - [0.6.0 release notes](docs/releases/release-0.6.0-en.md): native HTML tables, math and code highlighting, layered diagrams and host fixes.
24
- - [0.5.3 release notes](docs/releases/release-0.5.3-en.md): host integration and authoring patches.
25
- - [0.5.1 release notes](docs/releases/release-0.5.1-en.md): editor views and themes, plus HTML compatibility.
26
- - [0.5.0 release notes](docs/releases/release-0.5.0-en.md): the editor entry and document rendering fixes.
27
- - [0.4.1 release notes](docs/releases/release-0.4.1-en.md): visual and interaction fixes, compatible with 0.4.0.
28
- - [0.4.0 release and migration](docs/releases/release-0.4.0-en.md): what the minor series adds and how to upgrade from `0.3.1` / `local-draft-1`.
29
-
30
- ## Write a document
31
-
32
- ```markdown
33
- <panel title="Cost estimate">
34
- <slider bind="people" label="People" initial="2" min="1" max="20">
35
- <toggle bind="annual" label="Annual billing">
36
- </panel>
37
-
38
- Monthly cost: **{{ people * (annual ? 80 : 100) }} USD**.
39
- ```
40
-
41
- Inputs update the result immediately, and the panel includes a restore-defaults action. A standalone counter is a single line: `<counter label="People">`.
42
-
43
- `0.4.0` adds `local-draft-2`, named calculations, validation, collections, themes and offline HTML export. The earlier `0.3.1` release uses `local-draft-1`. See [0.4.0 release and migration](docs/releases/release-0.4.0-en.md).
44
-
45
- ## Install
46
-
47
- Reactive MD requires Node.js 22.12 or newer and ships only ESM entries:
48
-
49
- ```sh
50
- npm install reactive-md
51
- ```
52
-
53
- `latest` and `next` both resolve to `0.6.0`:
54
-
55
- ```sh
56
- npm install reactive-md
57
- # or pin the version
58
- npm install reactive-md@0.6.0
59
- ```
60
-
61
- Read the [0.6.0 release notes](docs/releases/release-0.6.0-en.md) for this release, and the [migration guide](docs/releases/release-0.4.0-en.md) before upgrading from `0.3.1` / `local-draft-1`.
62
-
63
- The `reactive-md` entry provides the local compiler, expressions and runtime; `reactive-md/react` provides the React renderer. Import component styles from `reactive-md/styles.css`. The `reactive-md/editor` entry provides the source editor with its own stylesheet at `reactive-md/editor/styles.css`. Existing renderer and style imports are unchanged in 0.6.0.
64
-
65
- The core `reactive-md` entry does not depend on React:
66
-
67
- ```js
68
- import { compileLocal, createLocalRuntime } from 'reactive-md';
69
-
70
- const result = compileLocal('<number bind="n" label="Count" initial="2">');
71
- if (result.ok) {
72
- const runtime = createLocalRuntime(result.document);
73
- try { console.log(runtime.text('Total: {{ n * 100 }}')); }
74
- finally { runtime.dispose(); }
75
- }
76
- ```
77
-
78
- See [Local mode integration](docs/integration/local-integration-en.md) for the full compile and runtime APIs, host URL policy, lifecycle and style overrides.
79
-
80
- 0.x minor releases may contain breaking changes. Before upgrading, read the [changelog](CHANGELOG.md) and [compatibility rules](docs/compatibility/compatibility-en.md), and keep the original `.reactive.md` sources.
81
-
82
- ## Use with React
83
-
84
- The React entry requires React 19:
85
-
86
- ```sh
87
- npm install react@19 react-dom@19
88
- ```
89
-
90
- ```tsx
91
- import { LocalReactiveDocument } from 'reactive-md/react';
92
- import 'reactive-md/styles.css';
93
-
94
- export function Article({ source }: { source: string }) {
95
- return <LocalReactiveDocument source={source} />;
96
- }
97
- ```
98
-
99
- `LocalReactiveDocument` compiles and manages the runtime for you. To control compilation, lifecycle or URL policy yourself, use `LocalDocumentView` as described in [Local mode integration](docs/integration/local-integration-en.md).
100
-
101
- ## Edit source with React
102
-
103
- The 0.5.x preview adds a reusable source editor at `reactive-md/editor`, with its own stylesheet at `reactive-md/editor/styles.css`. The component is controlled and requires React 19:
104
-
105
- ```tsx
106
- import { useState } from 'react';
107
- import { ReactiveMarkdownEditor } from 'reactive-md/editor';
108
- import 'reactive-md/editor/styles.css';
109
-
110
- export function Editor() {
111
- const [source, setSource] = useState('# Notes');
112
- return <ReactiveMarkdownEditor value={source} onChange={setSource} />;
113
- }
114
- ```
115
-
116
- The editor handles highlighting, formatting and insertion tools, completion, binding tools, undo and redo, and line numbers. It does not compile or render a preview; keep the source in your app and render it with `reactive-md/react`. See [React source editor](docs/integration/editor-en.md) for the props, ref handle, diagnostics, themes, locales and history.
117
-
118
- ## Share documents
119
-
120
- Build a self-contained HTML file that readers can open offline, or a script-free static snapshot:
121
-
122
- ```sh
123
- npm run build
124
- npx reactive-md build examples/local/counter.reactive.md -o counter.html
125
- npx reactive-md build examples/local/counter.reactive.md -o counter-static.html --mode static
126
- ```
127
-
128
- The interactive file embeds the original source, React 19, the runtime, styles and any verified local images. It hydrates a static first screen, so it remains readable with JavaScript disabled. Use `--state-file doc.state.json` to export a saved `reactive-md-state/v1` baseline; without it, the author initial values are used and become the reader's reset baseline. The demo export dialog can save the current preview parameters as such a file.
129
-
130
- See [Shareable documents and static export](docs/integration/shareable-export-en.md) for image limits, CSP/security, printing, exit codes, `ReactiveMD.mount`/`mountAll` and `<reactive-md-doc>`.
131
-
132
- ## Try the demo
133
-
134
- ```sh
135
- npm ci
136
- npm run dev
137
- ```
138
-
139
- The command builds the language package first, then starts the standalone `demo/` app at `http://127.0.0.1:5173`. `/embed.html` demonstrates the embedding approach. The masthead language toggle switches the demo between English and Chinese, and the choice is saved in the browser. The demo pages, editor, demo server, assets and browser checks all live in `demo/` and integrate through the package's public entries.
140
-
141
- ## Repository layout
142
-
143
- ```text
144
- src/ Local syntax compilation, expressions, runtime and React renderer
145
- examples/ Copyable local interactive examples, independent of the demo app
146
- docs/ Local syntax specification, integration and release documentation
147
- tests/ Language and renderer tests
148
- demo/ Standalone Playground app
149
- ```
150
-
151
- ## Documentation
152
-
153
- - [Beginner guide](docs/guides/local-guide-en.md) and [local interaction syntax specification](docs/reference/local-interaction-syntax-en.md).
154
- - [Local mode integration](docs/integration/local-integration-en.md): core and React API, URL policy, lifecycle, styling and version pinning.
155
- - [Shareable documents and static export](docs/integration/shareable-export-en.md): CLI build/lint, state files, local image inlining, printing and the standalone browser runtime.
156
- - [Feature tours and examples](examples/local/README.md) and [standalone integrations](examples/integration/README.md).
157
- - [React source editor](docs/integration/editor-en.md): controlled editor for `.reactive.md` source, with its own stylesheet.
158
- - [Versions and compatibility](docs/compatibility/compatibility-en.md): 0.x rules, migration, diagnostics and supported platforms.
159
- - [0.6.0 release notes](docs/releases/release-0.6.0-en.md): native HTML tables, math and code highlighting, layered diagrams and host fixes.
160
- - [0.5.3 release notes](docs/releases/release-0.5.3-en.md): host integration and authoring patches.
161
- - [0.5.1 release notes](docs/releases/release-0.5.1-en.md): editor views and themes, plus HTML compatibility.
162
- - [0.5.0 release notes](docs/releases/release-0.5.0-en.md): the editor entry and document rendering fixes.
163
- - [0.4.0 release and migration](docs/releases/release-0.4.0-en.md): the upgrade checklist for that minor series.
164
- - [Component protocol](docs/development/component-protocol-en.md) and [component development guide](docs/development/component-development-en.md): contribution contracts, a proposal template and acceptance cases.
165
- - [Performance measurements](docs/development/performance-en.md) and [release checklist](docs/development/releasing-en.md).
166
-
167
- See the [contributing guide](CONTRIBUTING.md) for development and test commands.
168
-
169
- ## Support and status
170
-
171
- - CI targets Node 22.12 and Node 24 with Playwright Chromium for the full browser gate and Firefox/WebKit for core workflows; local browser checks use Microsoft Edge. The packed check covers static SSR, and `npm run test:shareable` covers the single-file export's static-first hydration. General SSR hydration outside that path and the full Firefox/WebKit interaction suites remain unverified.
172
- - 0.x minor releases may contain breaking changes. Persist the original `.reactive.md` source, not the runtime AST or in-memory state.
173
- - `latest` and `next` are both `0.6.0`. Security fixes may ship in minor releases.
174
-
175
- ## Contributing and security
176
-
177
- - [Contributing guide](CONTRIBUTING.md): environment, check commands and change requirements.
178
- - [Security policy](SECURITY.md): threat boundary, resource limits, host responsibilities and vulnerability reporting.
179
- - [Changelog](CHANGELOG.md).
180
- - [Release checklist](docs/development/releasing-en.md): the verification gate, notices, tarball and the manual release flow for maintainers.
181
-
182
- ## License
183
-
184
- [MIT](LICENSE)
1
+ # Reactive MD
2
+
3
+ [中文](README-ch.md)
4
+
5
+ Write local interactive documents in Markdown. Add input controls, name parameters with `bind`, and connect prose, formulas, charts and diagrams with `{{ expressions }}`. Document authors do not write JavaScript or CSS.
6
+
7
+ Local mode uses HTML-style tags, with parameters and table data written directly in the prose; LaTeX formulas can drive function plots. The TypeScript core and the React renderer can be integrated independently. `0.6.1` is available on both `latest` and `next` and switches formula display to KaTeX with bundled math fonts and offline HTML support. Syntax revision stays `local-draft-2`, and the component protocol is `component-protocol-2`. See [README-ch.md](README-ch.md) for the Chinese overview.
8
+
9
+ ## Start here
10
+
11
+ - [Documentation index](docs/README.md): guides, references, integration, compatibility, development and releases.
12
+ - [Beginner guide](docs/guides/local-guide-en.md): move from Markdown to interactive documents, with a complete exercise and an error quick reference.
13
+ - [Local interaction syntax specification](docs/reference/local-interaction-syntax-en.md) · [Feature tours and examples](examples/local/README.md): 48 tag names, tags, in-place parameters and LaTeX plots.
14
+ - [Local mode integration](docs/integration/local-integration-en.md): `compileLocal`, the state runtime, React embedding, URL policy and style scoping.
15
+ - [HTML compatibility](docs/reference/html-compatibility-en.md): P0 HTML and the next release's temporary routing policy for author CSS, JavaScript and extended HTML.
16
+ - [Shareable documents and static export](docs/integration/shareable-export-en.md): single-file interactive HTML, static output, versioned state files, assets, the CLI and the standalone browser API.
17
+ - [Theme protocol](docs/reference/theme-protocol-en.md): document theme selection, custom CSS and light/dark modes.
18
+ - [Author tools](docs/integration/author-tools-en.md): source highlighting, completion, binding navigation, rename, formatting and command-line lint.
19
+ - [React source editor](docs/integration/editor-en.md): controlled editor, props, ref handle, diagnostics, locale, theme and history.
20
+ - [Standalone integration examples](examples/integration/README.md): Node core and React pages you can copy and run outside the repository.
21
+ - [Versions and compatibility](docs/compatibility/compatibility-en.md): 0.x rules, migration, the diagnostics contract and supported platforms.
22
+ - [Component protocol](docs/development/component-protocol-en.md) · [Component development guide](docs/development/component-development-en.md): declarations, behavior contracts and compatibility acceptance for new components.
23
+ - [0.6.1 release notes](docs/releases/release-0.6.1-en.md): KaTeX formula display, bundled fonts and offline math.
24
+ - [0.5.3 release notes](docs/releases/release-0.5.3-en.md): host integration and authoring patches.
25
+ - [0.5.1 release notes](docs/releases/release-0.5.1-en.md): editor views and themes, plus HTML compatibility.
26
+ - [0.5.0 release notes](docs/releases/release-0.5.0-en.md): the editor entry and document rendering fixes.
27
+ - [0.4.1 release notes](docs/releases/release-0.4.1-en.md): visual and interaction fixes, compatible with 0.4.0.
28
+ - [0.4.0 release and migration](docs/releases/release-0.4.0-en.md): what the minor series adds and how to upgrade from `0.3.1` / `local-draft-1`.
29
+
30
+ ## Write a document
31
+
32
+ ```markdown
33
+ <panel title="Cost estimate">
34
+ <slider bind="people" label="People" initial="2" min="1" max="20">
35
+ <toggle bind="annual" label="Annual billing">
36
+ </panel>
37
+
38
+ Monthly cost: **{{ people * (annual ? 80 : 100) }} USD**.
39
+ ```
40
+
41
+ Inputs update the result immediately, and the panel includes a restore-defaults action. A standalone counter is a single line: `<counter label="People">`.
42
+
43
+ `0.4.0` adds `local-draft-2`, named calculations, validation, collections, themes and offline HTML export. The earlier `0.3.1` release uses `local-draft-1`. See [0.4.0 release and migration](docs/releases/release-0.4.0-en.md).
44
+
45
+ ## Install
46
+
47
+ Reactive MD requires Node.js 22.12 or newer and ships only ESM entries:
48
+
49
+ ```sh
50
+ npm install reactive-md
51
+ ```
52
+
53
+ `latest` and `next` both resolve to `0.6.1`:
54
+
55
+ ```sh
56
+ npm install reactive-md
57
+ # or pin the version
58
+ npm install reactive-md@0.6.1
59
+ ```
60
+
61
+ Read the [0.6.1 release notes](docs/releases/release-0.6.1-en.md) for this release, and the [migration guide](docs/releases/release-0.4.0-en.md) before upgrading from `0.3.1` / `local-draft-1`.
62
+
63
+ The `reactive-md` entry provides the local compiler, expressions and runtime; `reactive-md/react` provides the React renderer. Import component styles from `reactive-md/styles.css`. The `reactive-md/editor` entry provides the source editor with its own stylesheet at `reactive-md/editor/styles.css`. Existing renderer and style imports are unchanged in 0.6.1.
64
+
65
+ The core `reactive-md` entry does not depend on React:
66
+
67
+ ```js
68
+ import { compileLocal, createLocalRuntime } from 'reactive-md';
69
+
70
+ const result = compileLocal('<number bind="n" label="Count" initial="2">');
71
+ if (result.ok) {
72
+ const runtime = createLocalRuntime(result.document);
73
+ try { console.log(runtime.text('Total: {{ n * 100 }}')); }
74
+ finally { runtime.dispose(); }
75
+ }
76
+ ```
77
+
78
+ See [Local mode integration](docs/integration/local-integration-en.md) for the full compile and runtime APIs, host URL policy, lifecycle and style overrides.
79
+
80
+ 0.x minor releases may contain breaking changes. Before upgrading, read the [changelog](CHANGELOG.md) and [compatibility rules](docs/compatibility/compatibility-en.md), and keep the original `.reactive.md` sources.
81
+
82
+ ## Use with React
83
+
84
+ The React entry requires React 19:
85
+
86
+ ```sh
87
+ npm install react@19 react-dom@19
88
+ ```
89
+
90
+ ```tsx
91
+ import { LocalReactiveDocument } from 'reactive-md/react';
92
+ import 'reactive-md/styles.css';
93
+
94
+ export function Article({ source }: { source: string }) {
95
+ return <LocalReactiveDocument source={source} />;
96
+ }
97
+ ```
98
+
99
+ `LocalReactiveDocument` compiles and manages the runtime for you. To control compilation, lifecycle or URL policy yourself, use `LocalDocumentView` as described in [Local mode integration](docs/integration/local-integration-en.md).
100
+
101
+ ## Edit source with React
102
+
103
+ The 0.5.x preview adds a reusable source editor at `reactive-md/editor`, with its own stylesheet at `reactive-md/editor/styles.css`. The component is controlled and requires React 19:
104
+
105
+ ```tsx
106
+ import { useState } from 'react';
107
+ import { ReactiveMarkdownEditor } from 'reactive-md/editor';
108
+ import 'reactive-md/editor/styles.css';
109
+
110
+ export function Editor() {
111
+ const [source, setSource] = useState('# Notes');
112
+ return <ReactiveMarkdownEditor value={source} onChange={setSource} />;
113
+ }
114
+ ```
115
+
116
+ The editor handles highlighting, formatting and insertion tools, completion, binding tools, undo and redo, and line numbers. It does not compile or render a preview; keep the source in your app and render it with `reactive-md/react`. See [React source editor](docs/integration/editor-en.md) for the props, ref handle, diagnostics, themes, locales and history.
117
+
118
+ ## Share documents
119
+
120
+ Build a self-contained HTML file that readers can open offline, or a script-free static snapshot:
121
+
122
+ ```sh
123
+ npm run build
124
+ npx reactive-md build examples/local/counter.reactive.md -o counter.html
125
+ npx reactive-md build examples/local/counter.reactive.md -o counter-static.html --mode static
126
+ ```
127
+
128
+ The interactive file embeds the original source, React 19, the runtime, styles and any verified local images. It hydrates a static first screen, so it remains readable with JavaScript disabled. Use `--state-file doc.state.json` to export a saved `reactive-md-state/v1` baseline; without it, the author initial values are used and become the reader's reset baseline. The demo export dialog can save the current preview parameters as such a file.
129
+
130
+ See [Shareable documents and static export](docs/integration/shareable-export-en.md) for image limits, CSP/security, printing, exit codes, `ReactiveMD.mount`/`mountAll` and `<reactive-md-doc>`.
131
+
132
+ ## Try the demo
133
+
134
+ ```sh
135
+ npm ci
136
+ npm run dev
137
+ ```
138
+
139
+ The command builds the language package first, then starts the standalone `demo/` app at `http://127.0.0.1:5173`. `/embed.html` demonstrates the embedding approach. The masthead language toggle switches the demo between English and Chinese, and the choice is saved in the browser. The demo pages, editor, demo server, assets and browser checks all live in `demo/` and integrate through the package's public entries.
140
+
141
+ ## Repository layout
142
+
143
+ ```text
144
+ src/ Local syntax compilation, expressions, runtime and React renderer
145
+ examples/ Copyable local interactive examples, independent of the demo app
146
+ docs/ Local syntax specification, integration and release documentation
147
+ tests/ Language and renderer tests
148
+ demo/ Standalone Playground app
149
+ ```
150
+
151
+ ## Documentation
152
+
153
+ - [Beginner guide](docs/guides/local-guide-en.md) and [local interaction syntax specification](docs/reference/local-interaction-syntax-en.md).
154
+ - [Local mode integration](docs/integration/local-integration-en.md): core and React API, URL policy, lifecycle, styling and version pinning.
155
+ - [Shareable documents and static export](docs/integration/shareable-export-en.md): CLI build/lint, state files, local image inlining, printing and the standalone browser runtime.
156
+ - [Feature tours and examples](examples/local/README.md) and [standalone integrations](examples/integration/README.md).
157
+ - [React source editor](docs/integration/editor-en.md): controlled editor for `.reactive.md` source, with its own stylesheet.
158
+ - [Versions and compatibility](docs/compatibility/compatibility-en.md): 0.x rules, migration, diagnostics and supported platforms.
159
+ - [0.6.1 release notes](docs/releases/release-0.6.1-en.md): KaTeX formula display, bundled fonts and offline math.
160
+ - [0.5.3 release notes](docs/releases/release-0.5.3-en.md): host integration and authoring patches.
161
+ - [0.5.1 release notes](docs/releases/release-0.5.1-en.md): editor views and themes, plus HTML compatibility.
162
+ - [0.5.0 release notes](docs/releases/release-0.5.0-en.md): the editor entry and document rendering fixes.
163
+ - [0.4.0 release and migration](docs/releases/release-0.4.0-en.md): the upgrade checklist for that minor series.
164
+ - [Component protocol](docs/development/component-protocol-en.md) and [component development guide](docs/development/component-development-en.md): contribution contracts, a proposal template and acceptance cases.
165
+ - [Performance measurements](docs/development/performance-en.md) and [release checklist](docs/development/releasing-en.md).
166
+
167
+ See the [contributing guide](CONTRIBUTING.md) for development and test commands.
168
+
169
+ ## Support and status
170
+
171
+ - CI targets Node 22.12 and Node 24 with Playwright Chromium for the full browser gate and Firefox/WebKit for core workflows; local browser checks use Microsoft Edge. The packed check covers static SSR, and `npm run test:shareable` covers the single-file export's static-first hydration. General SSR hydration outside that path and the full Firefox/WebKit interaction suites remain unverified.
172
+ - 0.x minor releases may contain breaking changes. Persist the original `.reactive.md` source, not the runtime AST or in-memory state.
173
+ - `latest` and `next` are both `0.6.1`. Security fixes may ship in minor releases.
174
+
175
+ ## Contributing and security
176
+
177
+ - [Contributing guide](CONTRIBUTING.md): environment, check commands and change requirements.
178
+ - [Security policy](SECURITY.md): threat boundary, resource limits, host responsibilities and vulnerability reporting.
179
+ - [Changelog](CHANGELOG.md).
180
+ - [Release checklist](docs/development/releasing-en.md): the verification gate, notices, tarball and the manual release flow for maintainers.
181
+
182
+ ## License
183
+
184
+ [MIT](LICENSE)