zt-react-milkdown 0.1.30 → 0.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/index.cjs +58 -57
- package/dist/index.mjs +49619 -37097
- package/dist/src/core/createEditor.d.ts +2 -0
- package/dist/src/core/createEditor.d.ts.map +1 -1
- package/dist/src/local/message-updates.d.ts +6 -0
- package/dist/src/local/message-updates.d.ts.map +1 -0
- package/dist/src/plugins/custom/code-block/code-block-editable.d.ts.map +1 -1
- package/dist/src/plugins/custom/code-block/code-block-highlighter.d.ts +8 -0
- package/dist/src/plugins/custom/code-block/code-block-highlighter.d.ts.map +1 -0
- package/dist/src/plugins/custom/code-block/code-block-language-picker.d.ts.map +1 -1
- package/dist/src/plugins/custom/code-block/code-block-prism-refresh.d.ts +6 -0
- package/dist/src/plugins/custom/code-block/code-block-prism-refresh.d.ts.map +1 -0
- package/dist/src/plugins/custom/code-block/index.d.ts +0 -2
- package/dist/src/plugins/custom/code-block/index.d.ts.map +1 -1
- package/dist/src/plugins/custom/image/image-editable.d.ts.map +1 -1
- package/dist/src/plugins/custom/image/image-upload-dialog/ImageUploadDialog.d.ts.map +1 -1
- package/dist/src/plugins/custom/image/image-upload-dialog/index.d.ts +1 -1
- package/dist/src/plugins/custom/image/image-upload-dialog/index.d.ts.map +1 -1
- package/dist/src/plugins/custom/math/math-block-editable.d.ts.map +1 -1
- package/dist/src/plugins/custom/math/math-inline-edit-plugin.d.ts.map +1 -1
- package/dist/src/plugins/custom/math/math-inline-editable.d.ts.map +1 -1
- package/dist/src/plugins/custom/selection-tooltip/index.d.ts.map +1 -1
- package/dist/src/plugins/custom/slash-menu/slash-menu.d.ts +2 -0
- package/dist/src/plugins/custom/slash-menu/slash-menu.d.ts.map +1 -1
- package/dist/src/plugins/custom/table/table-focus-actions.d.ts.map +1 -1
- package/dist/src/react/hooks/useMilkdownEditor.d.ts +1 -1
- package/dist/src/react/hooks/useMilkdownEditor.d.ts.map +1 -1
- package/package.json +2 -1
- package/dist/src/plugins/custom/code-block/code-block-prism.d.ts +0 -5
- package/dist/src/plugins/custom/code-block/code-block-prism.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -64,6 +64,7 @@ export default function Demo() {
|
|
|
64
64
|
|
|
65
65
|
- 代码块能力
|
|
66
66
|
- 支持代码块编辑、语言选择与语法高亮。
|
|
67
|
+
- 语法高亮使用 Milkdown 官方 `@milkdown/plugin-prism`,通过 `refractor/all` 同步加载当前安装版本提供的全部语法及别名(包括 Dart、Scala、Elixir);语言菜单与高亮共用注册配置。纯文本不着色,库未提供的语言保留源码和语言标识。全量加载会增加包体积与初始化开销。
|
|
67
68
|
|
|
68
69
|
- 图片能力
|
|
69
70
|
- 支持图片插入。
|
|
@@ -128,6 +129,9 @@ export default function Demo() {
|
|
|
128
129
|
说明:
|
|
129
130
|
- `placeholder` 优先级高于 `messages.placeholder`。
|
|
130
131
|
- 未传 `locale` 时默认使用 `zh-CN`。
|
|
132
|
+
- 运行时修改 `locale`、`messages` 或 `placeholder` 会同步更新内置界面文案,保留编辑器实例、文档、选区、撤销/重做历史、搜索状态及编辑区滚动位置;已展开的菜单和弹层也会更新,保留当前输入。
|
|
133
|
+
- 移除某个 `messages` 覆盖字段后恢复当前语言默认值;移除显式 `placeholder` 后回退到 `messages.placeholder` 或当前语言默认值。
|
|
134
|
+
- 多个编辑器的语言与文案独立。自定义 `slashMenu.items` 的标签和分组由使用者提供,不随内置语言切换自动翻译。
|
|
131
135
|
- 未传 `readOnly` 时默认使用 `false`。
|
|
132
136
|
- 未传 `debounceMs` 时默认使用 `160`(毫秒)。
|
|
133
137
|
- `slashMenu` 对应 Slash 菜单行为配置。
|