From 4ab4108bc5f4178f8ccebf54aa3dc23571f89a01 Mon Sep 17 00:00:00 2001 From: ayangweb <75017711+ayangweb@users.noreply.github.com> Date: Sat, 4 Jan 2025 21:12:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E3=80=8C=E5=89=AA?= =?UTF-8?q?=E8=B4=B4=E6=9D=BF=20>=20=E5=86=85=E5=AE=B9=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=20>=20=E8=87=AA=E5=8A=A8=E6=8E=92=E5=BA=8F=E3=80=8D=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=A1=B9=20(#925)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/en-US.json | 6 ++++-- src/locales/ja-JP.json | 6 ++++-- src/locales/zh-CN.json | 6 ++++-- src/locales/zh-TW.json | 6 ++++-- src/pages/Clipboard/Panel/index.tsx | 2 ++ src/pages/Clipboard/Settings/index.tsx | 11 +++++++++++ src/stores/clipboard.ts | 1 + src/types/store.d.ts | 1 + 8 files changed, 31 insertions(+), 8 deletions(-) diff --git a/src/locales/en-US.json b/src/locales/en-US.json index 7d95002958..2bab88584c 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -68,7 +68,8 @@ "delete": "Delete" }, "auto_favorite": "Auto Favorite", - "delete_confirm": "Delete Confirmation" + "delete_confirm": "Delete Confirmation", + "auto_sort": "Auto Sort" }, "hints": { "auto_paste": "Quickly paste content to the input field when using the left mouse button", @@ -77,7 +78,8 @@ "paste_as_plain": "Rich text and HTML formatting retains only plain text content when pasting", "operation_button": "Customize icon buttons to operate on clipboard content", "auto_favorite": "Auto-favorite after adding or editing a note", - "delete_confirm": "Pop-up confirmation dialog when deleting clipboard contents" + "delete_confirm": "Pop-up confirmation dialog when deleting clipboard contents", + "auto_sort": "Alignment to the top when copying existing content" } } }, diff --git a/src/locales/ja-JP.json b/src/locales/ja-JP.json index 6ca8511217..e74603a3bd 100644 --- a/src/locales/ja-JP.json +++ b/src/locales/ja-JP.json @@ -68,7 +68,8 @@ "delete": "削除" }, "auto_favorite": "自動コレクション", - "delete_confirm": "削除確認" + "delete_confirm": "削除確認", + "auto_sort": "自動整列" }, "hints": { "auto_paste": "左クリック時に、内容を素早く入力フィールドに貼り付けます", @@ -77,7 +78,8 @@ "paste_as_plain": "リッチテキストとHTMLの書式設定は、貼り付け時にプレーンテキストの内容だけを保持する", "operation_button": "クリップボード内容を操作するためのアイコンボタンをカスタマイズします", "auto_favorite": "メモの追加・編集後に自動お気に入り登録", - "delete_confirm": "クリップボードの内容を削除する際のポップアップ確認ダイアログ" + "delete_confirm": "クリップボードの内容を削除する際に確認ダイアログを表示する", + "auto_sort": "既存の内容をコピーして最前面に配置する" } } }, diff --git a/src/locales/zh-CN.json b/src/locales/zh-CN.json index 29d3cb3fa3..cdea400997 100644 --- a/src/locales/zh-CN.json +++ b/src/locales/zh-CN.json @@ -68,7 +68,8 @@ "delete": "删除" }, "auto_favorite": "自动收藏", - "delete_confirm": "删除确认" + "delete_confirm": "删除确认", + "auto_sort": "自动排序" }, "hints": { "auto_paste": "鼠标左键操作时,快速粘贴内容至输入位置", @@ -77,7 +78,8 @@ "paste_as_plain": "富文本和HTML格式在粘贴时仅保留纯文本内容", "operation_button": "自定义操作剪贴板内容的图标按钮", "auto_favorite": "新增或编辑备注后自动收藏", - "delete_confirm": "删除剪贴板内容时弹出确认对话框" + "delete_confirm": "删除剪贴板内容时弹出确认对话框", + "auto_sort": "复制已存在的内容时排列到最前面" } } }, diff --git a/src/locales/zh-TW.json b/src/locales/zh-TW.json index 3cdaf37d53..ea15fc590c 100644 --- a/src/locales/zh-TW.json +++ b/src/locales/zh-TW.json @@ -68,7 +68,8 @@ "delete": "刪除" }, "auto_favorite": "自動收藏", - "delete_confirm": "删除確認" + "delete_confirm": "删除確認", + "auto_sort": "自動排序" }, "hints": { "auto_paste": "當使用滑鼠左鍵時,快速將內容貼上到輸入位置", @@ -77,7 +78,8 @@ "paste_as_plain": "富文字和HTML格式在粘貼時僅保留純文字內容", "operation_button": "自定義操作剪貼簿內容的圖示按鈕", "auto_favorite": "新增或編輯備註後自動收藏", - "delete_confirm": "删除剪貼板內容時彈出確認對話方塊" + "delete_confirm": "删除剪貼板內容時彈出確認對話方塊", + "auto_sort": "複製已存在的內容時排列到最前面" } } }, diff --git a/src/pages/Clipboard/Panel/index.tsx b/src/pages/Clipboard/Panel/index.tsx index 22731fe3e3..7fa29f0417 100644 --- a/src/pages/Clipboard/Panel/index.tsx +++ b/src/pages/Clipboard/Panel/index.tsx @@ -60,6 +60,8 @@ const ClipboardPanel = () => { const createTime = formatDate(); if (findItem) { + if (!clipboardStore.content.autoSort) return; + const { id } = findItem; const index = findIndex(state.list, { id }); diff --git a/src/pages/Clipboard/Settings/index.tsx b/src/pages/Clipboard/Settings/index.tsx index 95ab3ab942..cb533b3904 100644 --- a/src/pages/Clipboard/Settings/index.tsx +++ b/src/pages/Clipboard/Settings/index.tsx @@ -150,6 +150,17 @@ const ClipboardSettings = () => { clipboardStore.content.deleteConfirm = value; }} /> + + { + clipboardStore.content.autoSort = value; + }} + /> ); diff --git a/src/stores/clipboard.ts b/src/stores/clipboard.ts index 3e30dfe31a..580b948393 100644 --- a/src/stores/clipboard.ts +++ b/src/stores/clipboard.ts @@ -27,6 +27,7 @@ export const clipboardStore = proxy({ operationButtons: ["copy", "star", "delete"], autoFavorite: false, deleteConfirm: true, + autoSort: false, }, history: { diff --git a/src/types/store.d.ts b/src/types/store.d.ts index b6b730fa08..a5c116b976 100644 --- a/src/types/store.d.ts +++ b/src/types/store.d.ts @@ -89,6 +89,7 @@ export interface ClipboardStore { operationButtons: OperationButton[]; autoFavorite: boolean; deleteConfirm: boolean; + autoSort: boolean; }; // 历史记录