refactor: 移除自定义状态栏 — 使用 MetonaEditor 自带底栏
- editor 自带底栏(wordCount: true)已显示字符数/词数/行数/阅读时间 - 删除自定义 StatusBar 组件、editorStore 的 stats/cursor 状态与事件绑定 - 保留 zenMode 同步(Toolbar 专注按钮消费);自动保存状态由 Toolbar 按钮显示
This commit is contained in:
@@ -16,21 +16,6 @@ export function getMetonaEditor(): MarkdownEditor | null {
|
||||
|
||||
const THEME_CYCLE: ThemeMode[] = ['light', 'dark', 'warm']
|
||||
|
||||
/** v0.6.0: 编辑器实时状态(由 Editor 组件绑定事件写入,状态栏消费) */
|
||||
export interface EditorLiveStats {
|
||||
characters: number
|
||||
words: number
|
||||
chineseChars: number
|
||||
englishWords: number
|
||||
lines: number
|
||||
readingTime: number
|
||||
}
|
||||
|
||||
export interface EditorCursor {
|
||||
line: number
|
||||
column: number
|
||||
}
|
||||
|
||||
interface EditorState {
|
||||
viewMode: ViewMode
|
||||
themeMode: ThemeMode
|
||||
@@ -38,9 +23,7 @@ interface EditorState {
|
||||
externallyModified: { filePath: string } | null
|
||||
// UX-02: 全局加载状态
|
||||
loadingStates: Record<string, boolean>
|
||||
// v0.6.0: 编辑器实时状态
|
||||
stats: EditorLiveStats | null
|
||||
cursor: EditorCursor | null
|
||||
// v0.6.0: Zen 模式状态(Toolbar 消费)
|
||||
zenMode: boolean
|
||||
|
||||
setViewMode: (mode: ViewMode) => void
|
||||
@@ -50,9 +33,6 @@ interface EditorState {
|
||||
// UX-02: 加载状态管理
|
||||
setLoading: (key: string, loading: boolean) => void
|
||||
isLoading: (key: string) => boolean
|
||||
// v0.6.0: 编辑器状态同步
|
||||
setStats: (stats: EditorLiveStats | null) => void
|
||||
setCursor: (cursor: EditorCursor | null) => void
|
||||
setZenMode: (zen: boolean) => void
|
||||
}
|
||||
|
||||
@@ -61,8 +41,6 @@ export const useEditorStore = create<EditorState>((set, get) => ({
|
||||
themeMode: 'light',
|
||||
externallyModified: null,
|
||||
loadingStates: {},
|
||||
stats: null,
|
||||
cursor: null,
|
||||
zenMode: false,
|
||||
|
||||
setViewMode: (mode: ViewMode) => set({ viewMode: mode }),
|
||||
@@ -80,7 +58,5 @@ export const useEditorStore = create<EditorState>((set, get) => ({
|
||||
loadingStates: { ...state.loadingStates, [key]: loading },
|
||||
})),
|
||||
isLoading: (key: string) => get().loadingStates[key] ?? false,
|
||||
setStats: (stats: EditorLiveStats | null) => set({ stats }),
|
||||
setCursor: (cursor: EditorCursor | null) => set({ cursor }),
|
||||
setZenMode: (zenMode: boolean) => set({ zenMode }),
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user