diff --git a/plugins/clipboard/CHANGELOG.md b/plugins/clipboard/CHANGELOG.md new file mode 100644 index 000000000..867f5347e --- /dev/null +++ b/plugins/clipboard/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +## 1.4.0 - 2026-08-31 + +- 新增剪贴板文本掩码/明文显示切换。 +- 掩码仅隐藏中间内容,保留首尾识别字符。 +- 掩码仅影响界面展示,复制和粘贴仍使用原始明文。 + diff --git a/plugins/clipboard/README.md b/plugins/clipboard/README.md index 185ec2b62..f13592b35 100644 --- a/plugins/clipboard/README.md +++ b/plugins/clipboard/README.md @@ -21,6 +21,7 @@ - **实时监听** - 自动监听系统剪贴板变化,实时同步最新内容 - **分页加载** - 支持无限滚动,自动加载更多历史记录 - **多选合并** - 支持批量合并文字、图片和文件后一次复制或粘贴 +- **掩码显示** - 可一键隐藏文本记录的中间内容并保留首尾识别字符,复制和粘贴仍使用原始明文 ### 🔍 高效查找 diff --git a/plugins/clipboard/public/plugin.json b/plugins/clipboard/public/plugin.json index ac2907908..cdf4bc12e 100644 --- a/plugins/clipboard/public/plugin.json +++ b/plugins/clipboard/public/plugin.json @@ -1,7 +1,7 @@ { "name": "clipboard", "description": "剪贴板", - "version": "1.3.2", + "version": "1.4.0", "main": "index.html", "preload": "preload.js", "logo": "logo.png", diff --git a/plugins/clipboard/src/App.vue b/plugins/clipboard/src/App.vue index 91c435f40..46ec51c88 100644 --- a/plugins/clipboard/src/App.vue +++ b/plugins/clipboard/src/App.vue @@ -18,6 +18,22 @@ import ConfirmDialog from '@/components/ConfirmDialog.vue' // ---- 状态 ---- const activeTab = ref('all') const searchText = ref('') +const TEXT_MASK_STORAGE_KEY = 'clipboard.isTextMasked' + +const getInitialTextMaskState = () => { + try { + return window.localStorage.getItem(TEXT_MASK_STORAGE_KEY) === 'true' + } catch (error) { + console.warn('读取掩码显示设置失败:', error) + return false + } +} + +const isTextMasked = ref(getInitialTextMaskState()) + +const toggleTextMask = () => { + isTextMasked.value = !isTextMasked.value +} const getCurrentAppVersion = () => { try { @@ -258,6 +274,14 @@ const resetSearchAndFocus = async () => { // ---- 监听 & 生命周期 ---- watch(activeTab, doReload) +watch(isTextMasked, (masked) => { + try { + window.localStorage.setItem(TEXT_MASK_STORAGE_KEY, String(masked)) + } catch (error) { + console.warn('保存掩码显示设置失败:', error) + } + checkTextOverflow() +}) // 当对话框打开时,阻止全局键盘快捷键(如 Enter 粘贴) const isAnyModalOpen = computed(() => @@ -325,6 +349,7 @@ onUnmounted(() => { :active-tab="activeTab" :expanded-items="expandedItems" :needs-expand="needsExpand" + :is-text-masked="isTextMasked" @select="handleItemClick" @toggle-selection="handleToggleClick" @dblclick="handleDoubleClick" @@ -338,8 +363,10 @@ onUnmounted(() => { diff --git a/plugins/clipboard/src/components/ClipboardList.vue b/plugins/clipboard/src/components/ClipboardList.vue index 145b31ee3..38688eabe 100644 --- a/plugins/clipboard/src/components/ClipboardList.vue +++ b/plugins/clipboard/src/components/ClipboardList.vue @@ -13,7 +13,8 @@ const props = defineProps({ selectedItems: { type: Set, default: () => new Set() }, activeTab: { type: String, required: true }, expandedItems: { type: Set, default: () => new Set() }, - needsExpand: { type: Object, default: () => ({}) } + needsExpand: { type: Object, default: () => ({}) }, + isTextMasked: { type: Boolean, default: false } }) const emit = defineEmits([ @@ -254,6 +255,7 @@ onBeforeUnmount(resetDragState) :is-expanded="expandedItems.has(item.id)" :needs-expand="!!needsExpand[item.id]" :is-favorite-tab="activeTab === 'favorite'" + :is-text-masked="isTextMasked" @toggle-expand="emit('toggle-expand', item.id)" @delete-favorite="emit('delete-favorite', index)" /> diff --git a/plugins/clipboard/src/components/SideBar.vue b/plugins/clipboard/src/components/SideBar.vue index b242de5ce..8820c2b95 100644 --- a/plugins/clipboard/src/components/SideBar.vue +++ b/plugins/clipboard/src/components/SideBar.vue @@ -1,9 +1,10 @@