diff --git a/README.md b/README.md index d27e4fc..1ac84d6 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ TypeScript React License - Version + Version

diff --git a/package.json b/package.json index c8abcf8..ab44c59 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "marklite", - "version": "0.3.5", + "version": "0.3.6", "description": "Lightweight Markdown Editor for Windows", "main": "./dist/main/index.js", "scripts": { diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index 74ccc84..893fee0 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -9,6 +9,7 @@ import { useUnsavedWarning } from './hooks/useUnsavedWarning' import { useFileWatch } from './hooks/useFileWatch' import { useFileOperations } from './hooks/useFileOperations' import { useDragDrop } from './hooks/useDragDrop' +import { useAutoSave } from './hooks/useAutoSave' import { useIpcListeners } from './hooks/useIpcListeners' import { useToast } from './hooks/useToast' import { useConfirm } from './hooks/useConfirm' @@ -49,6 +50,7 @@ export function App() { const { handleOpenFile, handleSave, handleSaveAs, handleOpenRecent } = useFileOperations(showToast) useDragDrop(showToast) useFileWatch() + const { isAutoSaving, autoSaveEnabled } = useAutoSave() // UX-01: 传入 confirm 函数替代原生 confirm() const handleConfirmClose = useCallback(async (message: string): Promise => { @@ -107,7 +109,7 @@ export function App() { )} - + {showAbout && } diff --git a/src/renderer/components/AboutDialog/AboutDialog.tsx b/src/renderer/components/AboutDialog/AboutDialog.tsx index f38067c..5c0f686 100644 --- a/src/renderer/components/AboutDialog/AboutDialog.tsx +++ b/src/renderer/components/AboutDialog/AboutDialog.tsx @@ -1,7 +1,7 @@ import React from 'react' import { AppIcon, Gitee } from '../Icons' -const APP_VERSION = 'v0.3.4' +const APP_VERSION = 'v0.3.6' interface AboutDialogProps { onClose: () => void diff --git a/src/renderer/components/OutlinePanel/OutlinePanel.tsx b/src/renderer/components/OutlinePanel/OutlinePanel.tsx index e545150..224c64a 100644 --- a/src/renderer/components/OutlinePanel/OutlinePanel.tsx +++ b/src/renderer/components/OutlinePanel/OutlinePanel.tsx @@ -36,25 +36,27 @@ export function parseHeadings(markdown: string): Heading[] { interface OutlinePanelProps { headings: Heading[] - onNavigate: (pos: number) => void + onNavigate: (heading: Heading, index: number) => void activeHeadingIndex: number | null } interface OutlineItemProps { heading: Heading + index: number isActive: boolean - onNavigate: (pos: number) => void + onNavigate: (heading: Heading, index: number) => void } const OutlineItem = memo(function OutlineItem({ heading, + index, isActive, onNavigate }: OutlineItemProps) { return (