release: v0.4.0 — MetonaEditor 集成与架构重构

feat(editor): 将 Milkdown/ProseMirror 替换为 @metona-team/metona-editor v0.1.3
  - 三模式视图 (edit/split/preview) 由编辑器内置工具栏切换
  - searchReplace + imagePaste 预设插件
  - unified/rehype 渲染管线通过 render 钩子集成
  - 主题双向同步 (应用暗色模式 ↔ 编辑器主题)

feat(toast): metona-toast 迁移为 @metona-team/metona-toast v2.0.1

refactor: 删除冗余组件与代码
  - 移除 SourceEditor、Preview、SearchReplace、EditorToolbar、useMilkdown
  - 移除 StatusBar 组件及状态栏扩展架构(编辑器内置底栏替代)
  - 移除 useSettings、useStatusBarItem、useStatusBarItems、statusBarStore
  - 移除 EditMode/PreviewMode/SourceMode 图标

refactor(ui): 简化布局
  - 工具栏移除模式切换按钮,新增自动保存开关
  - useKeyboard 移除 Ctrl+1/2/3/B/I 快捷键
  - Editor 三模式统一由 MetonaEditor 容器渲染

chore: 版本号 v0.3.13 → v0.4.0
docs: 全面更新 README/DESIGN/CONTRIBUTING/DEVSETUP
This commit is contained in:
thzxx
2026-07-23 22:55:45 +08:00
parent 43b0778849
commit 05e5667e48
33 changed files with 460 additions and 4335 deletions
+19 -9
View File
@@ -30,7 +30,7 @@
## 分支策略
- `main` — 稳定版本
- `master` — 稳定版本
- `dev` — 开发分支
- `feature/*` — 功能分支
- `fix/*` — 修复分支
@@ -98,16 +98,26 @@ src/
├── main/ # 主进程 (Node.js)
├── preload/ # 预加载脚本
├── renderer/ # 渲染进程 (React)
│ ├── components/ # UI 组件
│ ├── stores/ # Zustand 状态管理
│ ├── hooks/ # 自定义 Hooks
│ ├── lib/ # 工具库
│ ├── db/ # IndexedDB 持久化
│ ├── types/ # TypeScript 类型
│ └── styles/ # 全局样式
└── shared/ # 主进程/渲染进程共享
│ ├── components/ # UI 组件Toolbar · TabBar · Editor · Sidebar 等)
│ ├── stores/ # Zustand 状态管理tabStore · editorStore · sidebarStore · autoSaveStore
│ ├── hooks/ # 自定义 HooksuseTheme · useAutoSave · useKeyboard 等)
│ ├── lib/ # 工具库markdown · fileUtils · errorHandler · toast
│ ├── db/ # IndexedDB 持久化schema · repositories
│ ├── types/ # TypeScript 类型定义
│ └── styles/ # 全局样式variables · global · markdown-body
└── shared/ # 主进程/渲染进程共享(IPC 通道 · 共享类型 · 常量)
```
### 编辑器架构
MarkLite 使用 [MetonaEditor](https://git.metona.cn/MetonaTeam/MetonaEditor) v0.1.3 作为编辑器核心:
- **三模式视图**(编辑 / 分屏 / 预览),由 MetonaEditor 内置工具栏切换
- **渲染管线**:通过 `render` 钩子接入 unified/rehype 管线,处理图片路径修复和代码高亮
- **插件**searchReplace(搜索替换)+ imagePaste(粘贴图片)
- **自动保存**:自定义 `useAutoSave` hook,通过 Electron IPC 保存到文件系统(非 localStorage
- **主题同步**:应用暗色模式与编辑器主题双向同步
## 许可证
贡献的代码将遵循项目的 [MIT 许可证](LICENSE)。