-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
コンテキストメニューのVue化 #1374
Merged
Merged
コンテキストメニューのVue化 #1374
Changes from 16 commits
Commits
Show all changes
102 commits
Select commit
Hold shift + click to select a range
88c4ada
見た目上だけ整えた
thiramisu 7a48ed3
denseが抜けてたのを修正
thiramisu 6c853c2
各アイテム選択時の動作を追加
thiramisu 3b81808
コメントアウト内容修正
thiramisu 32ab2dc
読み更新処理が発火しないバグを修正
thiramisu 92e32eb
コメントアウト修正
thiramisu 742e258
未使用になったelectron/contextMenu.ts関連の記述を削除
thiramisu d928868
関数名の見直しと共通化
thiramisu c7a54e3
pasteOnAudioCell関数の一部を別関数に切り分け
thiramisu a35cc73
コメントアウトのミスの修正
thiramisu 5962c2c
複数行ペースト処理周りのリファクタリング
thiramisu 59701b8
コンテキストメニューにも複数行貼り付けを追加
thiramisu 5bff4f3
コメントアウト消し忘れ
thiramisu 2f0e943
no-focusを追加
thiramisu b46cb46
リファクタリング
thiramisu a027074
Merge branch 'main' into context-menu-vue
thiramisu e8e9645
コンフリクトの解消にし失敗してた箇所の修正
thiramisu 908074c
コンフリクトの解消に失敗していたのを修正
thiramisu 390fd6d
コンテキストメニュー開閉時に読みが更新されてしまうバグを修正
thiramisu 2f1bb26
変数名を見直し
thiramisu 3eb2d15
コンテキストメニューにヘッダー追加
thiramisu 4052464
省略時の見た目を少し改善
thiramisu 2c7c04e
未選択時の挙動を追加
thiramisu 9d0083b
リファクタリング
thiramisu d161cb6
範囲選択していない時にコピーと切り取りをdisabledに
thiramisu 186580f
型エラーに抗う
thiramisu 36a1725
型エラーを解決
thiramisu 2835030
setActiveAudioKeyからコンテキストメニュー関連の処理を分離
thiramisu 94bead3
裏技の使用をやめる
thiramisu deb6016
onhideをonbeforehideに
thiramisu be2a117
コンテキストメニュー関連の処理をbefore-show/before-hide/hideに統一
thiramisu 05618ae
コメントアウト修正
thiramisu 1011150
コメントアウトを改善
thiramisu e14a25d
変数名を変更
thiramisu 9d7cf53
変数名に合わせてtrue/falseを逆に
thiramisu 25076e8
バグ修正
thiramisu 11f92ee
実行タイミング変更の影響で貼り付けがバグっていたので修正
thiramisu d6172e5
`willSelectAll`と`cursorPosition`の抹消
thiramisu c0d873f
フラグ変更処理をContextMenu.vueのへ移動
thiramisu e36f40f
コメントアウト追加
thiramisu b77cff0
コードレビューを一部反映
thiramisu 60eeed8
lint的なtype error回避のための記述であることを明確に
thiramisu f11c768
。付け忘れ
thiramisu d6a4161
イベントを書く順番を調整
thiramisu b921081
no-focusを開く時に何を使ったかで切り替える
thiramisu 40ac6af
バグ修正
thiramisu d6e75b5
throwする意味なかさそうなので反転
thiramisu 3c1e24f
headerを元の使用に戻す
thiramisu e671d0b
コメントアウト追加とdiff減らし
thiramisu fa2bf39
コメントアウト更新
thiramisu af3728f
Merge branch 'VOICEVOX:main' into context-menu-vue
thiramisu d8e97b1
元からあった選択範囲の残るバグを多少強引に修正
thiramisu 4aa7791
Merge branch 'context-menu-vue' of https://github.com/thiramisu/voice…
thiramisu c2b25ad
それぞれ条件が抜けていたのを修正
thiramisu efa05e2
さらに修正
thiramisu 876f56a
さらに修正
thiramisu bbc2fb9
記述をコンパクトに
thiramisu 0a51a85
そもそも追加無しならblurされないように
thiramisu da45a19
Update src/helpers/QInputSelectionHelper.ts
thiramisu 0d9453e
Update src/components/ContextMenu.vue
thiramisu 79ddbda
unselectのreturn trueをなくす
thiramisu 5d51d17
Helperの名前を変更
thiramisu f25125c
empty()の名前をtoEmpty()に
thiramisu 414d6b1
Update src/components/AudioCell.vue
thiramisu a37729a
Merge branch 'context-menu-vue' of https://github.com/thiramisu/voice…
thiramisu 64349ac
Merge branch 'VOICEVOX:main' into context-menu-vue
thiramisu 89f2c6a
冗長な記述の削除とstartFragmentをsubstringBeforeに
thiramisu 9593ea6
textSplitterを関数内に移動
thiramisu 476f29a
定数を関数内に移動し所属を明確に
thiramisu c1de919
冗長だった`nextSelectionText`を削除
thiramisu 15bf892
ブラウザ版そもそも不要な宣言を削除して実質的なコンフリクトを解消
thiramisu baeb910
冗長な記述の変更
thiramisu 80569b9
nativeElの隠蔽
thiramisu f0cb1d9
onTabKeyUpの全選択処理を削除
thiramisu 11c2486
`unSelect`の名前を`clearInputSelection`に
thiramisu c3edcfe
関数名にIfNeededをつける
thiramisu 487b8d6
コードレビューを反映
thiramisu 6322b46
Merge branch 'VOICEVOX:main' into context-menu-vue
thiramisu c3a157f
`no-focus`付与条件の見直し
thiramisu 447092a
mousetrapに抗う
thiramisu 53494fb
元からあった誤字を修正し、ついでに表記をあさせる
thiramisu c9b6a1f
直しきれていなかったバグを修正
thiramisu 8b79075
`onMounted`を使用
thiramisu 65cc9f6
選択範囲が残らないようにするコードをグローバルに適用
thiramisu 067ce9f
コンテキストメニューを閉じる場合を除外
thiramisu 8a79dd9
コメントアウトを修正
thiramisu 2c626fc
コメントアウト修正
thiramisu 65a3f8a
``willDispatchFocusOrBlur`を`AudioCell.vue`に移動
thiramisu 0ed134b
Mousetrap回避策の見直し
thiramisu 973d7b8
選択範囲が残らないようにするコードをAudioCell内に戻す
thiramisu 645c10a
戻したのに伴って不要になったコードを削除
thiramisu 7b1b72a
コメントアウトのコピペミスを修正
thiramisu 8d5afc8
変数宣言をなるべく使用直前に
thiramisu 9e27cc9
hideすることを明示
thiramisu e46dba2
Merge branch 'context-menu-vue' of https://github.com/thiramisu/voice…
thiramisu c7deec7
不要な`<style>`を削除
thiramisu 0b1fa27
コメントアウトを修正
thiramisu 5775cc8
アニメーションをなくす
thiramisu 4d827fa
Merge branch 'context-menu-vue' of https://github.com/thiramisu/voice…
thiramisu 8f60536
`getMenuItemButton`を`readyForContextMenu`内に
thiramisu e762a04
contextmenuかcontextMenuかの表記揺れを修正
thiramisu cb11a25
コンフリクト解消
thiramisu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<template> | ||
<q-menu touch-position context-menu no-focus> | ||
<q-list dense> | ||
<menu-item | ||
v-for="(menu, index) of menudata" | ||
:key="index" | ||
:menudata="menu" | ||
:disable=" | ||
uiLocked && menu.type !== 'separator' && menu.disableWhenUiLocked | ||
" | ||
></menu-item> | ||
</q-list> | ||
</q-menu> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { computed } from "vue"; | ||
import MenuItem from "@/components/MenuItem.vue"; | ||
import { MenuItemButton, MenuItemSeparator } from "@/components/MenuBar.vue"; | ||
import { useStore } from "@/store"; | ||
|
||
defineProps<{ | ||
menudata: ContextMenuItemData[]; | ||
}>(); | ||
|
||
const store = useStore(); | ||
const uiLocked = computed(() => store.getters.UI_LOCKED); | ||
|
||
export type ContextMenuItemData = MenuItemSeparator | MenuItemButton; | ||
</script> | ||
|
||
<style lang="scss" scoped></style> | ||
thiramisu marked this conversation as resolved.
Show resolved
Hide resolved
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { QInput } from "quasar"; | ||
import { Ref } from "vue"; | ||
|
||
/** | ||
* QInput の選択範囲への操作を簡単にできるようにするクラス | ||
*/ | ||
export class QInputSelectionHelper { | ||
thiramisu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
private _nativeEl: HTMLInputElement | undefined = undefined; | ||
|
||
constructor(private textfield: Ref<QInput | undefined>) {} | ||
|
||
// this.start が number | null なので null も受け付ける | ||
setCursorPosition(index: number | null) { | ||
if (index === null) return; | ||
|
||
this.nativeEl.selectionStart = this.nativeEl.selectionEnd = index; | ||
} | ||
|
||
getReplacedStringTo(string: string, allowInsertOnly = false) { | ||
if (!allowInsertOnly && this.isEmpty) { | ||
return this.nativeEl.value; | ||
} | ||
|
||
const start = this.nativeEl.selectionStart ?? 0; | ||
const end = this.nativeEl.selectionEnd ?? 0; | ||
|
||
return `${this.nativeEl.value.substring( | ||
0, | ||
start | ||
)}${string}${this.nativeEl.value.substring(end)}`; | ||
} | ||
|
||
getAsString() { | ||
return this.nativeEl.value.substring( | ||
this.nativeEl.selectionStart ?? 0, | ||
this.nativeEl.selectionEnd ?? 0 | ||
); | ||
} | ||
|
||
empty() { | ||
thiramisu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
this.nativeEl.selectionEnd = this.nativeEl.selectionStart; | ||
} | ||
|
||
get nativeEl() { | ||
return this._nativeEl ?? this.getNativeEl(); | ||
} | ||
|
||
get start() { | ||
return this.nativeEl.selectionStart; | ||
} | ||
|
||
get end() { | ||
return this.nativeEl.selectionEnd; | ||
} | ||
Hiroshiba marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
get isEmpty() { | ||
const start = this.nativeEl.selectionStart; | ||
const end = this.nativeEl.selectionEnd; | ||
return start === null || end === null || start === end; | ||
} | ||
|
||
private getNativeEl() { | ||
const nativeEl = this.textfield.value?.nativeEl; | ||
if (!(nativeEl instanceof HTMLInputElement)) { | ||
throw new Error("nativeElの取得に失敗しました。"); | ||
} | ||
this._nativeEl = nativeEl; | ||
return nativeEl; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
なんか私が入れたやつが怒られてますね
ほんとに順番入れ替えれば治る問題なんだろうかw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
いったんこちらに関してだけコメントをば 🙇
これはエラーというよりワーニングで、並び順は順不同で複数人で書いてるとごちゃごちゃになっちゃうので、順番を作ってそれを守りましょうという感じの意図のメッセージです!