reactive-md 0.5.2 → 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.
Files changed (110) hide show
  1. package/CHANGELOG-ch.md +47 -15
  2. package/CHANGELOG.md +47 -15
  3. package/CONTRIBUTING-ch.md +10 -5
  4. package/CONTRIBUTING.md +10 -5
  5. package/README-ch.md +38 -36
  6. package/README-en.md +45 -42
  7. package/README.md +45 -42
  8. package/SECURITY-ch.md +1 -1
  9. package/SECURITY.md +1 -1
  10. package/THIRD_PARTY_NOTICES.md +481 -1
  11. package/cli/build.mjs +1 -1
  12. package/cli/package.mjs +1 -0
  13. package/dist-library/authoring-DSC0VsNK.js +842 -0
  14. package/dist-library/{runtime-UiQPz5ZV.js → compiler-CRD88BMt.js} +8944 -5847
  15. package/dist-library/react-Dk94rcOp.js +59658 -0
  16. package/dist-library/reactive-md-authoring.js +1514 -0
  17. package/dist-library/reactive-md-editor.js +589 -570
  18. package/dist-library/reactive-md-print.css +284 -0
  19. package/dist-library/reactive-md-react-unstyled.js +1 -0
  20. package/dist-library/reactive-md-react.js +1 -13208
  21. package/dist-library/reactive-md.css +1 -1
  22. package/dist-library/reactive-md.js +308 -1126
  23. package/dist-library/runtime-D8KbnCd0.js +498 -0
  24. package/dist-library/types/authoring/index.d.ts +24 -0
  25. package/dist-library/types/editor/command-types.d.ts +10 -0
  26. package/dist-library/types/editor/editor-commands.d.ts +2 -2
  27. package/dist-library/types/editor/editor-i18n.d.ts +1 -1
  28. package/dist-library/types/editor/native-components.d.ts +1 -1
  29. package/dist-library/types/editor/source-authoring.d.ts +5 -3
  30. package/dist-library/types/editor/types.d.ts +7 -10
  31. package/dist-library/types/local/LocalDocumentView.d.ts +4 -2
  32. package/dist-library/types/local/authoring.d.ts +9 -5
  33. package/dist-library/types/local/code-block.d.ts +3 -1
  34. package/dist-library/types/local/code-languages.d.ts +7 -0
  35. package/dist-library/types/local/compiled-data.d.ts +6 -0
  36. package/dist-library/types/local/compiler.d.ts +1 -0
  37. package/dist-library/types/local/diagnostics.d.ts +71 -0
  38. package/dist-library/types/local/diagram-layout.d.ts +69 -0
  39. package/dist-library/types/local/html-names.d.ts +6 -0
  40. package/dist-library/types/local/html-table.d.ts +25 -0
  41. package/dist-library/types/local/index.d.ts +1 -0
  42. package/dist-library/types/local/math-display.d.ts +73 -0
  43. package/dist-library/types/local/math-view.d.ts +2 -0
  44. package/dist-library/types/local/options.d.ts +3 -1
  45. package/dist-library/types/local/table-surface.d.ts +10 -0
  46. package/dist-library/types/local/types.d.ts +12 -0
  47. package/dist-library/types/local/visuals.d.ts +9 -0
  48. package/dist-library/types/local/worker.d.ts +3 -2
  49. package/dist-library/types/react/index.d.ts +1 -1
  50. package/dist-standalone/reactive-md-standalone.css +1 -1
  51. package/dist-standalone/reactive-md-standalone.js +79 -51
  52. package/docs/README.md +84 -0
  53. package/docs/{compatibility-ch.md → compatibility/compatibility-ch.md} +28 -18
  54. package/docs/{compatibility-en.md → compatibility/compatibility-en.md} +28 -18
  55. package/docs/{source-versioning-ch.md → compatibility/source-versioning-ch.md} +2 -2
  56. package/docs/{source-versioning-en.md → compatibility/source-versioning-en.md} +2 -2
  57. package/docs/{component-development-ch.md → development/component-development-ch.md} +7 -7
  58. package/docs/{component-development-en.md → development/component-development-en.md} +7 -7
  59. package/docs/{component-protocol-ch.md → development/component-protocol-ch.md} +17 -17
  60. package/docs/{component-protocol-en.md → development/component-protocol-en.md} +17 -17
  61. package/docs/{performance-ch.md → development/performance-ch.md} +2 -2
  62. package/docs/{performance-en.md → development/performance-en.md} +2 -2
  63. package/docs/{releasing-ch.md → development/releasing-ch.md} +12 -12
  64. package/docs/{releasing-en.md → development/releasing-en.md} +12 -12
  65. package/docs/guides/local-guide-ch.md +513 -0
  66. package/docs/guides/local-guide-en.md +513 -0
  67. package/docs/{author-tools-ch.md → integration/author-tools-ch.md} +13 -7
  68. package/docs/{author-tools-en.md → integration/author-tools-en.md} +13 -7
  69. package/docs/{editor-ch.md → integration/editor-ch.md} +238 -235
  70. package/docs/{editor-en.md → integration/editor-en.md} +238 -235
  71. package/docs/{local-integration-ch.md → integration/local-integration-ch.md} +410 -390
  72. package/docs/{local-integration-en.md → integration/local-integration-en.md} +410 -390
  73. package/docs/{shareable-export-ch.md → integration/shareable-export-ch.md} +16 -4
  74. package/docs/{shareable-export-en.md → integration/shareable-export-en.md} +16 -4
  75. package/docs/{computations-formatting-ch.md → reference/computations-formatting-ch.md} +2 -2
  76. package/docs/{computations-formatting-en.md → reference/computations-formatting-en.md} +2 -2
  77. package/docs/{constraints-collections-ch.md → reference/constraints-collections-ch.md} +2 -2
  78. package/docs/{constraints-collections-en.md → reference/constraints-collections-en.md} +2 -2
  79. package/docs/{diagnostics-counting-ch.md → reference/diagnostics-counting-ch.md} +22 -2
  80. package/docs/{diagnostics-counting-en.md → reference/diagnostics-counting-en.md} +22 -2
  81. package/docs/{html-compatibility-ch.md → reference/html-compatibility-ch.md} +42 -4
  82. package/docs/{html-compatibility-en.md → reference/html-compatibility-en.md} +42 -4
  83. package/docs/{local-components-v2-ch.md → reference/local-components-v2-ch.md} +2 -2
  84. package/docs/{local-components-v2-en.md → reference/local-components-v2-en.md} +2 -2
  85. package/docs/{local-interaction-syntax-ch.md → reference/local-interaction-syntax-ch.md} +26 -7
  86. package/docs/{local-interaction-syntax-en.md → reference/local-interaction-syntax-en.md} +26 -7
  87. package/docs/{theme-protocol-ch.md → reference/theme-protocol-ch.md} +1 -1
  88. package/docs/{theme-protocol-en.md → reference/theme-protocol-en.md} +1 -1
  89. package/docs/{release-0.4.0-ch.md → releases/release-0.4.0-ch.md} +6 -6
  90. package/docs/{release-0.4.0-en.md → releases/release-0.4.0-en.md} +6 -6
  91. package/docs/{release-0.4.1-ch.md → releases/release-0.4.1-ch.md} +2 -2
  92. package/docs/{release-0.4.1-en.md → releases/release-0.4.1-en.md} +2 -2
  93. package/docs/{release-0.5.0-ch.md → releases/release-0.5.0-ch.md} +4 -4
  94. package/docs/{release-0.5.0-en.md → releases/release-0.5.0-en.md} +4 -4
  95. package/docs/{release-0.5.1-ch.md → releases/release-0.5.1-ch.md} +4 -4
  96. package/docs/{release-0.5.1-en.md → releases/release-0.5.1-en.md} +4 -4
  97. package/docs/{release-0.5.2-ch.md → releases/release-0.5.2-ch.md} +3 -3
  98. package/docs/{release-0.5.2-en.md → releases/release-0.5.2-en.md} +3 -3
  99. package/docs/releases/release-0.5.3-ch.md +25 -0
  100. package/docs/releases/release-0.5.3-en.md +25 -0
  101. package/docs/releases/release-0.6.0-ch.md +57 -0
  102. package/docs/releases/release-0.6.0-en.md +57 -0
  103. package/examples/conformance/README.md +4 -4
  104. package/examples/integration/README.md +10 -8
  105. package/examples/integration/worker/package.json +1 -1
  106. package/examples/local/README.md +5 -5
  107. package/examples/local/html-compat.reactive.md +19 -0
  108. package/package.json +20 -3
  109. package/docs/local-guide-ch.md +0 -967
  110. package/docs/local-guide-en.md +0 -967
@@ -8,13 +8,13 @@
8
8
  - `actions` finds controls by `bind` and submits `value`; when `codes` is present the write is expected to be rejected, otherwise it is expected to succeed.
9
9
  - `text` is evaluated with the updated state and the result should equal `expectedText`.
10
10
 
11
- The runner lives at `tests/conformance.test.ts` in the repository; run `npm test` to check it. This suite covers shared parameters, hidden initialization, write constraints, code isolation, diagnostics, multi-slot controls, multiple selection, generated-table selection and a computed-value aggregate recalculation. It does not cover validation hints, generated table rendering, HTML export, author tooling or browser behavior; those have dedicated tests and the release gate. Full syntax conformance also includes other language tests and browser checks, with rules in the [syntax specification](../../docs/local-interaction-syntax-en.md). See the [compatibility notes](../../docs/compatibility-en.md) for cross-version guarantees on diagnostic codes.
11
+ The runner lives at `tests/conformance.test.ts` in the repository; run `npm test` to check it. This suite covers shared parameters, hidden initialization, write constraints, code isolation, diagnostics, multi-slot controls, multiple selection, generated-table selection and a computed-value aggregate recalculation. It does not cover validation hints, generated table rendering, HTML export, author tooling or browser behavior; those have dedicated tests and the release gate. Full syntax conformance also includes other language tests and browser checks, with rules in the [syntax specification](../../docs/reference/local-interaction-syntax-en.md). See the [compatibility notes](../../docs/compatibility/compatibility-en.md) for cross-version guarantees on diagnostic codes.
12
12
 
13
- The conformance sources are unversioned and use the current `local-draft-2` revision. The optional prologue version declaration is compile metadata and does not change these semantic cases. Version rejection and migration behavior have dedicated tests and historical fixtures. See [Source revisions and migration](../../docs/source-versioning-en.md).
13
+ The conformance sources are unversioned and use the current `local-draft-2` revision. The optional prologue version declaration is compile metadata and does not change these semantic cases. Version rejection and migration behavior have dedicated tests and historical fixtures. See [Source revisions and migration](../../docs/compatibility/source-versioning-en.md).
14
14
 
15
15
  ## Component protocol conformance
16
16
 
17
- [component-protocol-1.json](component-protocol-1.json) provides representative cases for the [component protocol](../../docs/component-protocol-en.md), covering `slider`, `tabs`, `plot` and lazy degradation of unknown components. The existing `component-protocol-1.json` remains the frozen author-component baseline now that the protocol revision is `component-protocol-2`. The [JSON Schema](component-protocol-1.schema.json) defines the conformance file format so tools from other implementations can read it. This JSON is test input and expected results; see the [development guide](../../docs/component-development-en.md) for the declaration template of a component proposal.
17
+ [component-protocol-1.json](component-protocol-1.json) provides representative cases for the [component protocol](../../docs/development/component-protocol-en.md), covering `slider`, `tabs`, `plot` and lazy degradation of unknown components. The existing `component-protocol-1.json` remains the frozen author-component baseline now that the protocol revision is `component-protocol-2`. The [JSON Schema](component-protocol-1.schema.json) defines the conformance file format so tools from other implementations can read it. This JSON is test input and expected results; see the [development guide](../../docs/development/component-development-en.md) for the declaration template of a component proposal.
18
18
 
19
19
  ```sh
20
20
  npm run test:components
@@ -50,4 +50,4 @@ Execution order is fixed: validate the data format and unique IDs, compile and c
50
50
 
51
51
  Compilation results, diagnostic sets, state changes and expression text are portable semantic expectations. HTML fragments only check this repository's React reference renderer; other renderers should verify equivalent user behavior and need not generate the same DOM or CSS class names.
52
52
 
53
- These cases do not prove real keyboard operation, focus movement, Chinese input methods, 375px layout, timer pause, or timer cleanup after disposal. Contributions involving those behaviors still need corresponding browser evidence; see the [development guide](../../docs/component-development-en.md) for verification methods. Cross-version stability of diagnostic codes continues to follow the [compatibility notes](../../docs/compatibility-en.md).
53
+ These cases do not prove real keyboard operation, focus movement, Chinese input methods, 375px layout, timer pause, or timer cleanup after disposal. Contributions involving those behaviors still need corresponding browser evidence; see the [development guide](../../docs/development/component-development-en.md) for verification methods. Cross-version stability of diagnostic codes continues to follow the [compatibility notes](../../docs/compatibility/compatibility-en.md).
@@ -2,29 +2,27 @@
2
2
 
3
3
  These directories use the package's public entry points and can be copied outside the repository. The commands below start from the current directory.
4
4
 
5
- These examples target `0.4.0`, the preview release on the `next` channel. First run `npm pack` in the repository, then copy the desired example directory outside the repository. In each command below, replace `/path/to/reactive-md-0.4.0.tgz` with the tarball's absolute path. The install uses the built package; React and Vite are installed from the example's own dependencies where needed.
5
+ These examples target `reactive-md@0.6.0`, published on both `latest` and `next`. Copy the desired example directory outside the repository, then install the pinned version from npm as shown below. React and Vite are installed from the example's own dependencies where needed.
6
6
 
7
7
  ## Node core
8
8
 
9
- Requires Node.js 22.12 or newer. The core example needs no React and makes no network requests.
9
+ Requires Node.js 22.12 or newer. The core example runs without React or network access after installation.
10
10
 
11
11
  ```sh
12
12
  cd core
13
- npm install /path/to/reactive-md-0.4.0.tgz --ignore-scripts --no-audit --no-fund
13
+ npm install reactive-md@0.6.0 --ignore-scripts --no-audit --no-fund
14
14
  npm start
15
15
  ```
16
16
 
17
17
  It should print `People: 2, cost: 200` first, then `People: 5, cost: 500`. The source is in [core/index.mjs](core/index.mjs).
18
18
 
19
- The core and worker examples use host APIs added in the `0.4.0` preview.
20
-
21
19
  ## React page
22
20
 
23
21
  Requires Node.js 22.12 or newer. The first install fetches React 19 and Vite.
24
22
 
25
23
  ```sh
26
24
  cd react
27
- npm install /path/to/reactive-md-0.4.0.tgz
25
+ npm install reactive-md@0.6.0
28
26
  npm run dev
29
27
  ```
30
28
 
@@ -36,10 +34,14 @@ Open the local URL printed by the terminal, adjust the headcount and watch the c
36
34
 
37
35
  ```sh
38
36
  cd worker
39
- npm install /path/to/reactive-md-0.4.0.tgz
37
+ npm install reactive-md@0.6.0
40
38
  npm run dev
41
39
  ```
42
40
 
43
41
  The UI and scheduler wiring live in [worker/main.js](worker/main.js); the Worker entry is [worker/worker.js](worker/worker.js).
44
42
 
45
- From the source repository root, `npm run verify:release` runs the complete gate, including standalone offline installation from the packed tarball, strict type checking, combined-feature checks, React rendering and HTML export. Use `npm run test:packed` for the focused package check after building. See the [integration guide](../../docs/local-integration-en.md) for the API and host policies.
43
+ ## Local package verification
44
+
45
+ To try an unpublished build, run `npm pack` in the repository root and replace `reactive-md@0.6.0` in the install commands with the absolute path to the generated `reactive-md-0.6.0.tgz`.
46
+
47
+ From the source repository root, `npm run verify:release` runs the complete gate, including standalone offline installation from the packed tarball, strict type checking, combined-feature checks, React rendering and HTML export. Use `npm run test:packed` for the focused package check after building. See the [integration guide](../../docs/integration/local-integration-en.md) for the API and host policies.
@@ -8,6 +8,6 @@
8
8
  "build": "vite build",
9
9
  "preview": "vite preview --host 127.0.0.1"
10
10
  },
11
- "dependencies": { "reactive-md": "^0.4.0" },
11
+ "dependencies": { "reactive-md": "0.6.0" },
12
12
  "devDependencies": { "vite": "^8.3.5" }
13
13
  }
@@ -1,18 +1,18 @@
1
1
  # Local interaction syntax demo
2
2
 
3
- These are standalone authoring examples for `local-draft-2`, described in the [local interaction syntax specification](../../docs/local-interaction-syntax-en.md). The Playground starts with a [quick calculator](pricing.reactive.md), followed by six focused [feature tours](showcase/README.md). Components are distributed across these six scenarios; diagnostics has an auxiliary menu. Hosts can compile and render every document through the [local mode API](../../docs/local-integration-en.md).
3
+ These are standalone authoring examples for `local-draft-2`, described in the [local interaction syntax specification](../../docs/reference/local-interaction-syntax-en.md). The Playground starts with a [quick calculator](pricing.reactive.md), followed by six focused [feature tours](showcase/README.md). Components are distributed across these six scenarios; diagnostics has an auxiliary menu. Hosts can compile and render every document through the [local mode API](../../docs/integration/local-integration-en.md).
4
4
 
5
5
  The original eleven working examples and one intentionally broken diagnostics document remain in this directory, with Chinese versions in [zh/](zh/). The six feature tours live in [showcase/](showcase/README.md), with Chinese sources in [showcase/zh/](showcase/zh/). Each file runs independently. Controls, expressions and visualizations use local state.
6
6
 
7
- The new [HTML compatibility example](html-compat.reactive.md) combines rich disclosures, Markdown and a bound counter. See the [temporary HTML routing policy](../../docs/html-compatibility-en.md) before enabling author CSS, JavaScript or extended HTML.
7
+ The new [HTML compatibility example](html-compat.reactive.md) combines rich disclosures, Markdown and a bound counter. See the [temporary HTML routing policy](../../docs/reference/html-compatibility-en.md) before enabling author CSS, JavaScript or extended HTML.
8
8
 
9
9
  ## Start with the short examples
10
10
 
11
- The [workshop recipe](recipes/workshop.reactive.md) ([中文](recipes/workshop-zh.reactive.md)) combines cross-field validation, conditional tones, numeric aggregates and generated table rows. See the [constraints and collections reference](../../docs/constraints-collections-en.md) for rules and budgets.
11
+ The [workshop recipe](recipes/workshop.reactive.md) ([中文](recipes/workshop-zh.reactive.md)) combines cross-field validation, conditional tones, numeric aggregates and generated table rows. See the [constraints and collections reference](../../docs/reference/constraints-collections-en.md) for rules and budgets.
12
12
 
13
- The [invoice recipe](recipes/invoice.reactive.md) ([中文](recipes/invoice-zh.reactive.md)) demonstrates shared calculations, constants, formatting and UTC date differences. The [calculation reference](../../docs/computations-formatting-en.md) explains its rules.
13
+ The [invoice recipe](recipes/invoice.reactive.md) ([中文](recipes/invoice-zh.reactive.md)) demonstrates shared calculations, constants, formatting and UTC date differences. The [calculation reference](../../docs/reference/computations-formatting-en.md) explains its rules.
14
14
 
15
- Start with the [plan calculator](pricing.reactive.md), then choose a [feature tour](showcase/README.md). For the smallest possible state example, read the original [counter](counter.reactive.md). If you are new to the syntax, read the [new user guide](../../docs/local-guide-en.md).
15
+ Start with the [plan calculator](pricing.reactive.md), then choose a [feature tour](showcase/README.md). For the smallest possible state example, read the original [counter](counter.reactive.md). If you are new to the syntax, read the [new user guide](../../docs/guides/local-guide-en.md).
16
16
 
17
17
  ## Original standalone catalog
18
18
 
@@ -17,8 +17,27 @@
17
17
  </details>
18
18
  </details>
19
19
 
20
+ <div align="center">你好,**居中内容**。</div>
21
+
22
+ <p align="right">右对齐段落。</p>
23
+
20
24
  <blockquote>默认模式使用现有渲染器和主题。</blockquote>
21
25
 
22
26
  <ol start="3"><li>支持 HTML 列表。</li><li>代码按原样显示。</li></ol>
23
27
 
24
28
  <pre><code>&lt;counter label="这里是代码"&gt; {{ count }}</code></pre>
29
+
30
+ <table label="Markdown 表格" searchable="false" sortable="false">
31
+ | 项目 | 数值 |
32
+ | --- | ---: |
33
+ | 当前次数 | {{ count }} |
34
+ | 固定值 | 10 |
35
+ </table>
36
+
37
+ <table>
38
+ <caption>原生 HTML 表格</caption>
39
+ <tr><th scope="col">项目</th><th scope="col">数值</th></tr>
40
+ <tr><td>当前次数</td><td>{{ count }}</td></tr>
41
+ <tr><td>固定值</td><td>10</td></tr>
42
+ <tr><td colspan="2">**合并单元格**也支持 Markdown 和公式:\(x^2\)。</td></tr>
43
+ </table>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reactive-md",
3
- "version": "0.5.2",
3
+ "version": "0.6.0",
4
4
  "description": "Author interactive local documents in Markdown, with expression-bound inputs, charts and diagrams.",
5
5
  "keywords": [
6
6
  "markdown",
@@ -66,6 +66,9 @@
66
66
  "test:components": "vitest run --config vitest.config.ts tests/component-protocol.test.ts tests/conformance.test.ts",
67
67
  "test:demo": "npm run build:lib && npm run test --workspace=@reactive-md/demo",
68
68
  "test:browser": "npm run test:browser --workspace=@reactive-md/demo",
69
+ "test:browser:core": "node scripts/verify-browser-core.mjs",
70
+ "test:required-browser": "node scripts/verify-required-form-browser.mjs",
71
+ "test:tooltip-browser": "node scripts/verify-tooltip-browser.mjs",
69
72
  "test:shareable": "node scripts/verify-shareable.mjs",
70
73
  "test:toolbar": "npm run test:toolbar --workspace=@reactive-md/demo",
71
74
  "test:package": "node scripts/verify-package.mjs",
@@ -75,7 +78,8 @@
75
78
  "test:date-browser": "node scripts/verify-date-input-browser.mjs",
76
79
  "test:editor-browser": "node scripts/verify-editor-browser.mjs",
77
80
  "test:markdown-browser": "node scripts/verify-markdown-browser.mjs",
78
- "test:html-browser": "node scripts/verify-html-compat-browser.mjs",
81
+ "test:math-browser": "node scripts/verify-math-browser.mjs",
82
+ "test:html-browser": "node scripts/verify-html-compat-browser.mjs && node scripts/verify-html-table-browser.mjs",
79
83
  "test:media-browser": "node scripts/verify-media-browser.mjs",
80
84
  "test:computations-browser": "node scripts/verify-computations-browser.mjs",
81
85
  "test:constraints-browser": "node scripts/verify-constraints-browser.mjs",
@@ -103,7 +107,17 @@
103
107
  "types": "./dist-library/types/editor/index.d.ts",
104
108
  "import": "./dist-library/reactive-md-editor.js"
105
109
  },
106
- "./editor/styles.css": "./dist-library/reactive-md-editor.css"
110
+ "./editor/styles.css": "./dist-library/reactive-md-editor.css",
111
+ "./react/unstyled": {
112
+ "types": "./dist-library/types/react/index.d.ts",
113
+ "import": "./dist-library/reactive-md-react-unstyled.js"
114
+ },
115
+ "./screen.css": "./dist-library/reactive-md.css",
116
+ "./print.css": "./dist-library/reactive-md-print.css",
117
+ "./authoring": {
118
+ "types": "./dist-library/types/authoring/index.d.ts",
119
+ "import": "./dist-library/reactive-md-authoring.js"
120
+ }
107
121
  },
108
122
  "peerDependencies": {
109
123
  "react": "^19.0.0",
@@ -121,7 +135,10 @@
121
135
  "@types/node": "26.6.5",
122
136
  "@types/react": "19.3.0",
123
137
  "@types/react-dom": "19.3.0",
138
+ "elkjs": "0.12.0",
139
+ "highlight.js": "11.11.2",
124
140
  "lowlight": "3.3.0",
141
+ "mhchemparser": "4.2.1",
125
142
  "parse5": "8.0.1",
126
143
  "react": "19.3.1",
127
144
  "react-dom": "19.3.1",