diff options
| author | おさむのひと <46447427+samunohito@users.noreply.github.com> | 2023-12-14 14:11:20 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-14 14:11:20 +0900 |
| commit | a92795d90f9e55c7b7726725dceea979fd8940a3 (patch) | |
| tree | 48a0b7e34775e0ca796cdc702c5ff153a98f43ee /packages/frontend/src/scripts | |
| parent | 2023.12.0-beta.4 (diff) | |
| download | sharkey-a92795d90f9e55c7b7726725dceea979fd8940a3.tar.gz sharkey-a92795d90f9e55c7b7726725dceea979fd8940a3.tar.bz2 sharkey-a92795d90f9e55c7b7726725dceea979fd8940a3.zip | |
feat(frontend): 絵文字ピッカーの実装 (#12617)
* 絵文字デッキの作成
* 細かい不備を修正
* fix lint
* fix
* fix CHANGELOG.md
* fix setTimeout -> nextTick
* fix https://github.com/misskey-dev/misskey/pull/12617#issuecomment-1848952862
* fix bug
* fix CHANGELOG.md
* fix CHANGELOG.md
* wip
* Update CHANGELOG.md
* Update CHANGELOG.md
* wip
---------
Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
Diffstat (limited to 'packages/frontend/src/scripts')
| -rw-r--r-- | packages/frontend/src/scripts/emoji-picker.ts | 9 | ||||
| -rw-r--r-- | packages/frontend/src/scripts/reaction-picker.ts | 9 |
2 files changed, 12 insertions, 6 deletions
diff --git a/packages/frontend/src/scripts/emoji-picker.ts b/packages/frontend/src/scripts/emoji-picker.ts index d6d6bf1245..3cf653ea1b 100644 --- a/packages/frontend/src/scripts/emoji-picker.ts +++ b/packages/frontend/src/scripts/emoji-picker.ts @@ -3,8 +3,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { defineAsyncComponent, Ref, ref } from 'vue'; +import { defineAsyncComponent, Ref, ref, computed, ComputedRef } from 'vue'; import { popup } from '@/os.js'; +import { defaultStore } from '@/store.js'; /** * 絵文字ピッカーを表示する。 @@ -23,8 +24,10 @@ class EmojiPicker { } public async init() { + const emojisRef = defaultStore.reactiveState.pinnedEmojis; await popup(defineAsyncComponent(() => import('@/components/MkEmojiPickerDialog.vue')), { src: this.src, + pinnedEmojis: emojisRef, asReactionPicker: false, manualShowing: this.manualShowing, choseAndClose: false, @@ -44,8 +47,8 @@ class EmojiPicker { public show( src: HTMLElement, - onChosen: EmojiPicker['onChosen'], - onClosed: EmojiPicker['onClosed'], + onChosen?: EmojiPicker['onChosen'], + onClosed?: EmojiPicker['onClosed'], ) { this.src.value = src; this.manualShowing.value = true; diff --git a/packages/frontend/src/scripts/reaction-picker.ts b/packages/frontend/src/scripts/reaction-picker.ts index 19e1bfba2c..9b13e794f5 100644 --- a/packages/frontend/src/scripts/reaction-picker.ts +++ b/packages/frontend/src/scripts/reaction-picker.ts @@ -5,6 +5,7 @@ import { defineAsyncComponent, Ref, ref } from 'vue'; import { popup } from '@/os.js'; +import { defaultStore } from '@/store.js'; class ReactionPicker { private src: Ref<HTMLElement | null> = ref(null); @@ -17,25 +18,27 @@ class ReactionPicker { } public async init() { + const reactionsRef = defaultStore.reactiveState.reactions; await popup(defineAsyncComponent(() => import('@/components/MkEmojiPickerDialog.vue')), { src: this.src, + pinnedEmojis: reactionsRef, asReactionPicker: true, manualShowing: this.manualShowing, }, { done: reaction => { - this.onChosen!(reaction); + if (this.onChosen) this.onChosen(reaction); }, close: () => { this.manualShowing.value = false; }, closed: () => { this.src.value = null; - this.onClosed!(); + if (this.onClosed) this.onClosed(); }, }); } - public show(src: HTMLElement, onChosen: ReactionPicker['onChosen'], onClosed: ReactionPicker['onClosed']) { + public show(src: HTMLElement, onChosen?: ReactionPicker['onChosen'], onClosed?: ReactionPicker['onClosed']) { this.src.value = src; this.manualShowing.value = true; this.onChosen = onChosen; |