reactive-md 0.5.2 → 0.5.3

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 (45) hide show
  1. package/CHANGELOG-ch.md +11 -0
  2. package/CHANGELOG.md +11 -0
  3. package/README-ch.md +7 -7
  4. package/README-en.md +8 -8
  5. package/README.md +8 -8
  6. package/cli/build.mjs +1 -1
  7. package/cli/package.mjs +1 -0
  8. package/dist-library/authoring-DJJjKYg9.js +842 -0
  9. package/dist-library/{runtime-UiQPz5ZV.js → compiler-UyPwGzJZ.js} +5631 -5389
  10. package/dist-library/react-fizgU3i8.js +12764 -0
  11. package/dist-library/reactive-md-authoring.js +1514 -0
  12. package/dist-library/reactive-md-editor.js +577 -571
  13. package/dist-library/reactive-md-print.css +284 -0
  14. package/dist-library/reactive-md-react-unstyled.js +1 -0
  15. package/dist-library/reactive-md-react.js +1 -13208
  16. package/dist-library/reactive-md.css +1 -1
  17. package/dist-library/reactive-md.js +244 -1062
  18. package/dist-library/runtime-DXtle_6c.js +498 -0
  19. package/dist-library/types/authoring/index.d.ts +24 -0
  20. package/dist-library/types/editor/command-types.d.ts +10 -0
  21. package/dist-library/types/editor/editor-commands.d.ts +2 -2
  22. package/dist-library/types/editor/editor-i18n.d.ts +1 -1
  23. package/dist-library/types/editor/native-components.d.ts +1 -1
  24. package/dist-library/types/editor/source-authoring.d.ts +5 -3
  25. package/dist-library/types/editor/types.d.ts +5 -10
  26. package/dist-library/types/local/LocalDocumentView.d.ts +4 -2
  27. package/dist-library/types/local/authoring.d.ts +9 -5
  28. package/dist-library/types/local/diagnostics.d.ts +40 -0
  29. package/dist-library/types/local/index.d.ts +1 -0
  30. package/dist-library/types/local/math-display.d.ts +72 -0
  31. package/dist-library/types/local/math-view.d.ts +2 -0
  32. package/dist-library/types/local/options.d.ts +3 -1
  33. package/dist-library/types/local/types.d.ts +10 -0
  34. package/dist-library/types/local/worker.d.ts +3 -2
  35. package/dist-library/types/react/index.d.ts +1 -1
  36. package/dist-standalone/reactive-md-standalone.js +54 -50
  37. package/docs/author-tools-ch.md +11 -5
  38. package/docs/author-tools-en.md +11 -5
  39. package/docs/editor-ch.md +237 -235
  40. package/docs/editor-en.md +237 -235
  41. package/docs/local-integration-ch.md +392 -390
  42. package/docs/local-integration-en.md +392 -390
  43. package/docs/release-0.5.3-ch.md +25 -0
  44. package/docs/release-0.5.3-en.md +25 -0
  45. package/package.json +12 -2
@@ -0,0 +1,25 @@
1
+ # 0.5.3 预览版
2
+
3
+ 使用 `npm install reactive-md@0.5.3` 或 `npm install reactive-md@next` 安装。语法修订保持 `local-draft-2`,组块协议保持 `component-protocol-2`,主题协议保持 `reactive-md-theme-1`。`latest` 渠道仍为 `0.4.0`。
4
+
5
+ ## 宿主集成
6
+
7
+ - 在 `LocalCompileOptions` 中设置 `markdownBreaks: true`,把 Markdown 软换行显示为换行。配置贯通编译、React 预览、worker 与缓存键,源码 UTF-16 偏移保持不变;默认值为 `false`。
8
+ - 用 `reactive-md/react/unstyled` 加载无样式依赖的 React 渲染器。按需引入 `reactive-md/screen.css`(也可用原有 `reactive-md/styles.css`),打印时再引入 `reactive-md/print.css`。屏幕样式不再设置全局 `@page`;独立 HTML 保留自身的打印样式。
9
+ - 从 `reactive-md` 导入 `localCompileOptionsKey`,从任一 React 入口导入 `LocalRenderContext` 类型。
10
+
11
+ ## 作者工具
12
+
13
+ 新增 `reactive-md/authoring` 纯函数入口,提供 schema、组件目录、模板辅助函数、插入命令和类型,无需加载 React 或 CSS,可供 CM6 等宿主编辑器使用。
14
+
15
+ `analyzeLocalSource(source, options)`、`completeLocalSource(source, offset, options)`、`renameLocalBinding(source, oldName, newName, options)` 和 `formatLocalSource(source, options)` 接受可选 `LocalCompileOptions`。传入与预览相同的配置,即可统一宿主组件、原生 HTML 分流和资源预算的判断。
16
+
17
+ ## 数学诊断
18
+
19
+ 不支持的显示命令、环境及渲染预算降级会产生带源码范围的警告。降级时仍以转义文本保留公式内容;显示支持与计算支持分别判断。
20
+
21
+ ## 兼容性
22
+
23
+ 已有入口继续可用。需要文档打印布局的宿主须显式导入可选打印样式,无需迁移文档语法或协议。
24
+
25
+ 参见[更新日志](../CHANGELOG-ch.md)、[作者工具](author-tools-ch.md)和[集成指南](local-integration-ch.md)。
@@ -0,0 +1,25 @@
1
+ # 0.5.3 preview release
2
+
3
+ Install with `npm install reactive-md@0.5.3` or `npm install reactive-md@next`. This preview keeps syntax revision `local-draft-2`, component protocol `component-protocol-2` and theme protocol `reactive-md-theme-1`. The `latest` channel remains `0.4.0`.
4
+
5
+ ## Host integration
6
+
7
+ - Set `markdownBreaks: true` in `LocalCompileOptions` to render Markdown soft line breaks as line breaks. The option travels through compilation, React preview, workers and cache keys. Source offsets retain their original UTF-16 positions; the default is `false`.
8
+ - Use `reactive-md/react/unstyled` for the React renderer with no stylesheet dependency. Import `reactive-md/screen.css` (also available as `reactive-md/styles.css`) for document styles, and opt into `reactive-md/print.css` for print layout and page margins. Screen styles no longer set global `@page` rules. Standalone HTML retains its own print styling.
9
+ - Import `localCompileOptionsKey` from `reactive-md` and `LocalRenderContext` from either React entry.
10
+
11
+ ## Author tools
12
+
13
+ The `reactive-md/authoring` entry provides the schema, component catalog, template helpers, insertion commands and their types without loading React or CSS. CM6 and other host editors can use these functions independently of the built-in editor.
14
+
15
+ Pass the same optional `LocalCompileOptions` to `analyzeLocalSource(source, options)`, `completeLocalSource(source, offset, options)`, `renameLocalBinding(source, oldName, newName, options)` and `formatLocalSource(source, options)` as to preview compilation. Host schemas, native HTML routing and resource limits then use the same rules.
16
+
17
+ ## Math diagnostics
18
+
19
+ Display math reports source-ranged warnings for unsupported commands or environments and rendering-budget fallbacks. Formulas remain readable as escaped text when rendering falls back. Computation support and display support are checked separately.
20
+
21
+ ## Compatibility
22
+
23
+ Existing package entries remain available. Hosts that need document print layout should explicitly import the optional print stylesheet. No source syntax or protocol migration is required.
24
+
25
+ See the [changelog](../CHANGELOG.md), [author tools](author-tools-en.md) and [integration guide](local-integration-en.md).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reactive-md",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "Author interactive local documents in Markdown, with expression-bound inputs, charts and diagrams.",
5
5
  "keywords": [
6
6
  "markdown",
@@ -103,7 +103,17 @@
103
103
  "types": "./dist-library/types/editor/index.d.ts",
104
104
  "import": "./dist-library/reactive-md-editor.js"
105
105
  },
106
- "./editor/styles.css": "./dist-library/reactive-md-editor.css"
106
+ "./editor/styles.css": "./dist-library/reactive-md-editor.css",
107
+ "./react/unstyled": {
108
+ "types": "./dist-library/types/react/index.d.ts",
109
+ "import": "./dist-library/reactive-md-react-unstyled.js"
110
+ },
111
+ "./screen.css": "./dist-library/reactive-md.css",
112
+ "./print.css": "./dist-library/reactive-md-print.css",
113
+ "./authoring": {
114
+ "types": "./dist-library/types/authoring/index.d.ts",
115
+ "import": "./dist-library/reactive-md-authoring.js"
116
+ }
107
117
  },
108
118
  "peerDependencies": {
109
119
  "react": "^19.0.0",