From b4455924a4dd55f56d56af6ad76580856e91744f Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Sat, 21 Dec 2024 22:31:41 +0900 Subject: [PATCH 1/5] =?UTF-8?q?Refactoring:=20=E3=83=9B=E3=83=83=E3=83=88?= =?UTF-8?q?=E3=82=AD=E3=83=BC=E5=91=A8=E3=82=8A=E3=81=AE=E5=88=9D=E6=9C=9F?= =?UTF-8?q?=E5=80=A4=E3=81=AA=E3=81=A9=E3=82=92domain=E3=81=AB=E5=88=87?= =?UTF-8?q?=E3=82=8A=E5=87=BA=E3=81=99=20(#2366)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/browser/sandbox.ts | 2 +- src/backend/common/ConfigManager.ts | 8 +- .../Dialog/HotkeyRecordingDialog.vue | 2 +- src/components/Dialog/HotkeySettingDialog.vue | 8 +- src/components/Menu/MenuItem.vue | 2 +- src/components/Talk/TalkEditor.vue | 6 +- src/domain/hotkeyAction.ts | 199 +++++++++++++++++ src/plugins/hotkeyPlugin.ts | 2 +- src/store/setting.ts | 2 +- src/store/type.ts | 2 +- src/type/ipc.ts | 2 +- src/type/preload.ts | 204 +----------------- tests/unit/lib/hotkeyManager.spec.ts | 2 +- 13 files changed, 225 insertions(+), 216 deletions(-) create mode 100644 src/domain/hotkeyAction.ts diff --git a/src/backend/browser/sandbox.ts b/src/backend/browser/sandbox.ts index a722a36189..38b0f12e7a 100644 --- a/src/backend/browser/sandbox.ts +++ b/src/backend/browser/sandbox.ts @@ -13,10 +13,10 @@ import { EngineId, EngineSettingType, EngineSettings, - HotkeySettingType, Sandbox, } from "@/type/preload"; import { AssetTextFileNames } from "@/type/staticResources"; +import { HotkeySettingType } from "@/domain/hotkeyAction"; const toStaticPath = (fileName: string) => `${import.meta.env.BASE_URL}/${fileName}`.replaceAll(/\/\/+/g, "/"); diff --git a/src/backend/common/ConfigManager.ts b/src/backend/common/ConfigManager.ts index 22f5db1d28..ac23b792dd 100644 --- a/src/backend/common/ConfigManager.ts +++ b/src/backend/common/ConfigManager.ts @@ -5,15 +5,17 @@ import { ConfigType, configSchema, DefaultStyleId, - defaultHotkeySettings, - HotkeySettingType, ExperimentalSettingType, - HotkeyCombination, VoiceId, PresetKey, } from "@/type/preload"; import { ensureNotNullish } from "@/helpers/errorHelper"; import { loadEnvEngineInfos } from "@/domain/defaultEngine/envEngineInfo"; +import { + HotkeyCombination, + defaultHotkeySettings, + HotkeySettingType, +} from "@/domain/hotkeyAction"; const lockKey = "save"; diff --git a/src/components/Dialog/HotkeyRecordingDialog.vue b/src/components/Dialog/HotkeyRecordingDialog.vue index 46047b9b65..b54bcc0d9e 100644 --- a/src/components/Dialog/HotkeyRecordingDialog.vue +++ b/src/components/Dialog/HotkeyRecordingDialog.vue @@ -83,7 +83,7 @@