From 01729f45a70f86aff2a43842d56eb68a1e5c4159 Mon Sep 17 00:00:00 2001 From: tiramisu_oTATo Date: Tue, 1 Aug 2023 06:18:05 +0900 Subject: [PATCH] =?UTF-8?q?=E3=80=8C=E5=86=85=E5=AE=B9=E3=82=92=E3=83=86?= =?UTF-8?q?=E3=82=AD=E3=82=B9=E3=83=88=E3=81=AE=E3=81=BF=E3=81=AB=E9=81=A9?= =?UTF-8?q?=E7=94=A8=E3=80=8D=E3=82=92=E3=82=B3=E3=83=B3=E3=83=86=E3=82=AD?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=A1=E3=83=8B=E3=83=A5=E3=83=BC=E3=81=AB?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20(#1433)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Hiroshiba --- src/components/AudioCell.vue | 17 +++++++++++++++++ src/store/audio.ts | 13 +++++++++++++ src/store/type.ts | 4 ++++ 3 files changed, 34 insertions(+) diff --git a/src/components/AudioCell.vue b/src/components/AudioCell.vue index e671a7b365..8b2082cb51 100644 --- a/src/components/AudioCell.vue +++ b/src/components/AudioCell.vue @@ -328,6 +328,8 @@ const contextMenudata = ref< MenuItemButton, MenuItemButton, MenuItemSeparator, + MenuItemButton, + MenuItemSeparator, MenuItemButton ] >([ @@ -378,6 +380,21 @@ const contextMenudata = ref< }, disableWhenUiLocked: true, }, + { type: "separator" }, + { + type: "button", + label: "内容をテキストのみに適用", + onClick: async () => { + contextMenu.value?.hide(); + isChangeFlag.value = false; + await store.dispatch("COMMAND_CHANGE_DISPLAY_TEXT", { + audioKey: props.audioKey, + text: audioTextBuffer.value, + }); + textfield.value?.blur(); + }, + disableWhenUiLocked: true, + }, ]); /** * コンテキストメニューの開閉によりFocusやBlurが発生する可能性のある間は`true`。 diff --git a/src/store/audio.ts b/src/store/audio.ts index 720e095870..895dd71ce7 100644 --- a/src/store/audio.ts +++ b/src/store/audio.ts @@ -1966,6 +1966,19 @@ export const audioCommandStore = transformCommandStore( }, }, + COMMAND_CHANGE_DISPLAY_TEXT: { + /** + * 読みを変えずにテキストだけを変える + */ + action({ commit }, payload: { audioKey: AudioKey; text: string }) { + commit("COMMAND_CHANGE_AUDIO_TEXT", { + audioKey: payload.audioKey, + text: payload.text, + update: "Text", + }); + }, + }, + COMMAND_CHANGE_AUDIO_TEXT: { mutation( draft, diff --git a/src/store/type.ts b/src/store/type.ts index cfd16fbabf..121347261f 100644 --- a/src/store/type.ts +++ b/src/store/type.ts @@ -509,6 +509,10 @@ export type AudioCommandStoreTypes = { action(payload: { audioKeys: AudioKey[] }): void; }; + COMMAND_CHANGE_DISPLAY_TEXT: { + action(payload: { audioKey: AudioKey; text: string }): void; + }; + COMMAND_CHANGE_AUDIO_TEXT: { mutation: { audioKey: AudioKey; text: string } & ( | { update: "Text" }