From 733e7f9cba6cffe4a79d4b835b8e98865d7cc260 Mon Sep 17 00:00:00 2001 From: dufan1032 <18518213665@163.com> Date: Wed, 7 Oct 2026 13:32:06 +0800 Subject: [PATCH] =?UTF-8?q?Update=20plugin=20Markdown=20=E7=AC=94=E8=AE=B0?= =?UTF-8?q?=20v0.1.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - feat: 发布 Markdown 笔记 v0.1.0 - feat: UI优化和导入导出功能 - release: publish Markdown Notes v0.1.1 - release: publish Markdown Notes v0.1.1 - fix: 修复发布脚本 PR 地址 - feat: 增强文本高亮与媒体编辑体验 - release: publish Markdown Notes v0.1.2 - fix: 调整更新日志版本标题格式 - fix: 补充插件作者信息 --- plugins/ztools-markdown-notes/CHANGELOG.md | 13 +- plugins/ztools-markdown-notes/package.json | 2 +- plugins/ztools-markdown-notes/plugin.json | 3 +- .../ztools-markdown-notes/public/plugin.json | 3 +- .../scripts/publish-update.ps1 | 2 +- plugins/ztools-markdown-notes/src/App.vue | 31 +- .../src/components/MarkdownEditor.vue | 546 ++++++++++++++++-- .../src/imageSizeMetadata.ts | 193 +++++++ plugins/ztools-markdown-notes/src/styles.css | 47 +- .../src/workspaceSession.ts | 34 +- .../tests/imageSizeMetadata.test.cjs | 101 ++++ .../tests/workspace.test.cjs | 10 +- 12 files changed, 927 insertions(+), 58 deletions(-) create mode 100644 plugins/ztools-markdown-notes/src/imageSizeMetadata.ts create mode 100644 plugins/ztools-markdown-notes/tests/imageSizeMetadata.test.cjs diff --git a/plugins/ztools-markdown-notes/CHANGELOG.md b/plugins/ztools-markdown-notes/CHANGELOG.md index 515be4210..72380af25 100644 --- a/plugins/ztools-markdown-notes/CHANGELOG.md +++ b/plugins/ztools-markdown-notes/CHANGELOG.md @@ -1,13 +1,20 @@ -# Changelog +# 更新日志 +## 0.1.2 - 2026-09-26 -## 0.1.1 - 2026-09-03 +- 新增文本高亮,以及高亮颜色和透明度设置。 +- 新增代码块语言选择、过滤和一键复制。 +- 新增图片右键调整大小、恢复自动大小和删除功能。 +- 优化编辑器正文间距,以及代码块和图片的聚焦体验。 +- 修复高亮文本边界连续退格可能破坏 Markdown 标记的问题。 + +## 0.1.1 - 新增 Markdown 导入、Markdown 导出和 HTML 导出。 - 优化编辑器工具栏、更多操作菜单和内容区域布局。 - 修正生产包清单,移除开发服务器入口。 -## 0.1.0 - 2026-09-02 +## 0.1.0 - 支持真实 Markdown 文件与多工作区管理。 - 支持 Vditor 即时渲染和源码编辑,编辑内容自动保存。 diff --git a/plugins/ztools-markdown-notes/package.json b/plugins/ztools-markdown-notes/package.json index 11ff721df..ad975f075 100644 --- a/plugins/ztools-markdown-notes/package.json +++ b/plugins/ztools-markdown-notes/package.json @@ -1,7 +1,7 @@ { "name": "ztools-markdown-notes", "private": true, - "version": "0.1.1", + "version": "0.1.2", "type": "module", "scripts": { "dev": "vite", diff --git a/plugins/ztools-markdown-notes/plugin.json b/plugins/ztools-markdown-notes/plugin.json index 721e577f6..ecf5e53c4 100644 --- a/plugins/ztools-markdown-notes/plugin.json +++ b/plugins/ztools-markdown-notes/plugin.json @@ -2,7 +2,8 @@ "name": "ztools-markdown-notes", "title": "Markdown 笔记", "description": "基于真实本地 Markdown 文件的轻量笔记插件", - "version": "0.1.1", + "author": "dufan1032", + "version": "0.1.2", "main": "index.html", "development": { "main": "http://localhost:5173" diff --git a/plugins/ztools-markdown-notes/public/plugin.json b/plugins/ztools-markdown-notes/public/plugin.json index 721e577f6..ecf5e53c4 100644 --- a/plugins/ztools-markdown-notes/public/plugin.json +++ b/plugins/ztools-markdown-notes/public/plugin.json @@ -2,7 +2,8 @@ "name": "ztools-markdown-notes", "title": "Markdown 笔记", "description": "基于真实本地 Markdown 文件的轻量笔记插件", - "version": "0.1.1", + "author": "dufan1032", + "version": "0.1.2", "main": "index.html", "development": { "main": "http://localhost:5173" diff --git a/plugins/ztools-markdown-notes/scripts/publish-update.ps1 b/plugins/ztools-markdown-notes/scripts/publish-update.ps1 index 2d116578f..13709c2a8 100644 --- a/plugins/ztools-markdown-notes/scripts/publish-update.ps1 +++ b/plugins/ztools-markdown-notes/scripts/publish-update.ps1 @@ -158,7 +158,7 @@ if (-not $forkChanges) { Invoke-Git -Repository $forkPath -Arguments @('commit', '-m', "Update plugin Markdown Notes v$version") Invoke-Git -Repository $forkPath -Arguments @('push', '-u', 'origin', $branch) -$pullRequestUrl = "https://github.com/dufan1032/ZTools-plugins/compare/main...$branch?expand=1" +$pullRequestUrl = "https://github.com/ZToolsCenter/ZTools-plugins/compare/main...dufan1032:${branch}?expand=1" Write-Host '' Write-Host 'Release branch pushed. Create the pull request:' -ForegroundColor Green Write-Host $pullRequestUrl diff --git a/plugins/ztools-markdown-notes/src/App.vue b/plugins/ztools-markdown-notes/src/App.vue index 799d0d64e..4d12795a8 100644 --- a/plugins/ztools-markdown-notes/src/App.vue +++ b/plugins/ztools-markdown-notes/src/App.vue @@ -8,7 +8,7 @@ import TrashPanel from './components/TrashPanel.vue' import WorkspaceTree from './components/WorkspaceTree.vue' import { extractOutline } from './outline' import { endWorkspaceDrag, getWorkspaceDragPath } from './workspaceDrag' -import { clearNoteDraft, clearNoteDraftPath, defaultEditorSettings, loadEditorMode, loadEditorSettings, loadGlobalNoteSearchEnabled, loadGlobalWorkspaceSearchEnabled, loadHiddenGlobalNotePaths, loadLastWorkspacePath, loadNoteDraft, loadPinnedNotePaths, loadRegisteredWorkspaces, loadTrashRetentionDays, replaceNoteDraftPath, saveEditorMode, saveEditorSettings, saveGlobalNoteSearchEnabled, saveGlobalWorkspaceSearchEnabled, saveHiddenGlobalNotePaths, saveLastWorkspacePath, saveNoteDraft, savePinnedNotePaths, saveRegisteredWorkspaces, saveTrashRetentionDays, type NoteDraft, type RegisteredWorkspace } from './workspaceSession' +import { clearNoteDraft, clearNoteDraftPath, defaultEditorSettings, loadEditorMode, loadEditorSettings, loadGlobalNoteSearchEnabled, loadGlobalWorkspaceSearchEnabled, loadHiddenGlobalNotePaths, loadLastWorkspacePath, loadNoteDraft, loadPinnedNotePaths, loadRegisteredWorkspaces, loadTrashRetentionDays, normalizeHexColor, replaceNoteDraftPath, saveEditorMode, saveEditorSettings, saveGlobalNoteSearchEnabled, saveGlobalWorkspaceSearchEnabled, saveHiddenGlobalNotePaths, saveLastWorkspacePath, saveNoteDraft, savePinnedNotePaths, saveRegisteredWorkspaces, saveTrashRetentionDays, type NoteDraft, type RegisteredWorkspace } from './workspaceSession' const workspace = ref(null) const previousWorkspace = ref(null) @@ -144,6 +144,8 @@ const editorStyle = computed(() => ({ '--editor-font-size': `${editorSettings.value.fontSize}px`, '--editor-line-height': String(editorSettings.value.lineHeight), '--find-highlight-color': editorSettings.value.findHighlightColor, + '--text-highlight-color': editorSettings.value.textHighlightColor, + '--text-highlight-opacity': `${editorSettings.value.textHighlightOpacity}%`, })) const pinnedNotes = computed(() => { const notes = new Map(flattenNoteEntries(workspace.value?.entries ?? []).map((note) => [note.relativePath, note])) @@ -428,10 +430,15 @@ function dropIntoRoot(event: DragEvent) { if (allowed) void moveEntry(sourcePath, '') } -function showOperationError(message: string) { +function showOperationError(message: string, autoDismiss = false) { window.clearTimeout(operationTimer) operationTone.value = 'error' operationMessage.value = message + if (autoDismiss) { + operationTimer = window.setTimeout(() => { + operationMessage.value = '' + }, 2200) + } } function showOperationSuccess(message: string) { @@ -477,6 +484,20 @@ function updateEditorSettings() { saveEditorSettings(editorSettings.value) } +function updateHighlightColor(setting: 'findHighlightColor' | 'textHighlightColor', event: Event) { + const input = event.target as HTMLInputElement + const color = normalizeHexColor(input.value) + if (!color) return + editorSettings.value[setting] = color + input.value = color + updateEditorSettings() +} + +function restoreHighlightColor(setting: 'findHighlightColor' | 'textHighlightColor', event: Event) { + const input = event.target as HTMLInputElement + input.value = editorSettings.value[setting] +} + function resetDefaultSettings() { editorSettings.value = { ...defaultEditorSettings } saveEditorSettings(editorSettings.value) @@ -2237,10 +2258,12 @@ watch(activeNotePath, () => {
-

编辑器

调整正文显示和当前笔记查找效果。
+

编辑器

调整正文显示、文本高亮和当前笔记查找效果。
- + + +

zTools 集成

控制哪些内容可以从 zTools 主搜索中直接打开。
diff --git a/plugins/ztools-markdown-notes/src/components/MarkdownEditor.vue b/plugins/ztools-markdown-notes/src/components/MarkdownEditor.vue index b64877f16..62b95173f 100644 --- a/plugins/ztools-markdown-notes/src/components/MarkdownEditor.vue +++ b/plugins/ztools-markdown-notes/src/components/MarkdownEditor.vue @@ -1,7 +1,8 @@