-
v0.4.4 Stable
released this
2026-07-25 16:24:13 +08:00 | 21 commits to master since this releasev0.4.4 发行说明
依赖升级
依赖 旧版本 新版本 @metona-team/metona-editor 0.1.14 0.2.4 @metona-team/metona-toast 0.1.2 0.2.1
MetonaEditor 0.2.4 新增特性
编辑器配置增强
- syncScroll: true — 编辑区和预览区同步滚动
- wordWrap: true — 默认启用自动换行
- historyLimit: 100 / historyDebounce: 400 — 优化历史栈性能
- outline: false — 保留 MarkLite 自研大纲面板
新增预设插件
- shortcutHelp — 按 ? 弹出快捷键速查面板
新增回调事件
- onLinkClick(href, text, editor) — 预览区链接安全打开
- onFocus() / onBlur() — 编辑器焦点状态追踪
Markdown 解析器升级
- 支持
***粗斜体***语法 - 支持引用链接
[text][ref]和引用图片 - 支持链接内行内格式
- 支持 registerBlockHandler 自定义块级语法
编辑器实例 API 新增
- getStats() — 字符/单词/行数/中文字符/英文单词/阅读时间
- getHTML() / refresh() — HTML 获取与强制重渲染
- exec(action) — 程序化执行格式化命令
- toggleFullscreen() / toggleZen() / toggleWordWrap() — 视图切换
- undo() / redo() / canUndo() / canRedo() — 历史栈
- enable() / disable() / isDisabled() — 启用禁用
- use(plugin) / unuse() / getPlugins() — 插件管理
- registerShortcut() / unregisterShortcut() / getShortcuts() — 快捷键管理
- toast(msg, opts) — 编辑器内置 Toast
MetonaToast 0.2.1 新增特性
内置插件
- keyboard — ESC 一键关闭所有 Toast
- accessibility — 屏幕阅读器支持
新增配置项
- width: 360 — 统一 Toast 宽度
新增高级 API(可供未来集成)
- loading() → LoadingControl — 加载状态链式转换
- promise() — Promise 生命周期追踪
- confirm() / prompt() — 内置确认/输入对话框
- progress() → ProgressControl — 进度条通知
- countdown() — 倒计时通知
- queue() / stack() — 消息队列/堆叠
- action(msg, actions) — 内嵌操作按钮
- group(name) → GroupAPI — 按场景分组
- dismiss(id) / clear(position) — 精确控制
- 11 种入场动画
- 自定义主题注册 themes.registerTheme()
代码适配
- 移除 ExtendedEditorOptions 类型 hack
- 本地声明 EditMode/ThemeName 类型
- 适配 onModeChange 签名:(mode: EditMode) → (mode: string)
- 适配 onLinkClick 签名:({ href }) → (href, text, editor)
质量保证
- TypeScript 严格模式类型检查:0 errors
- 单元测试:98/98 passed(6 个测试文件)
Downloads