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>
This commit is contained in:
parent
364efbe58b
commit
a92795d90f
15 changed files with 354 additions and 198 deletions
|
@ -121,10 +121,11 @@ import { $i } from '@/account.js';
|
|||
|
||||
const props = withDefaults(defineProps<{
|
||||
showPinned?: boolean;
|
||||
asReactionPicker?: boolean;
|
||||
pinnedEmojis?: string[];
|
||||
maxHeight?: number;
|
||||
asDrawer?: boolean;
|
||||
asWindow?: boolean;
|
||||
asReactionPicker?: boolean; // 今は使われてないが将来的に使いそう
|
||||
}>(), {
|
||||
showPinned: true,
|
||||
});
|
||||
|
@ -137,24 +138,22 @@ const searchEl = shallowRef<HTMLInputElement>();
|
|||
const emojisEl = shallowRef<HTMLDivElement>();
|
||||
|
||||
const {
|
||||
reactions: pinnedReactions,
|
||||
reactionPickerSize,
|
||||
reactionPickerWidth,
|
||||
reactionPickerHeight,
|
||||
disableShowingAnimatedImages,
|
||||
emojiPickerScale,
|
||||
emojiPickerWidth,
|
||||
emojiPickerHeight,
|
||||
recentlyUsedEmojis,
|
||||
} = defaultStore.reactiveState;
|
||||
|
||||
const pinned = computed(() => props.asReactionPicker ? pinnedReactions.value : []); // TODO: 非リアクションの絵文字ピッカー用のpinned絵文字を設定可能にする?
|
||||
const size = computed(() => props.asReactionPicker ? reactionPickerSize.value : 1);
|
||||
const width = computed(() => props.asReactionPicker ? reactionPickerWidth.value : 3);
|
||||
const height = computed(() => props.asReactionPicker ? reactionPickerHeight.value : 2);
|
||||
const pinned = computed(() => props.pinnedEmojis);
|
||||
const size = computed(() => emojiPickerScale.value);
|
||||
const width = computed(() => emojiPickerWidth.value);
|
||||
const height = computed(() => emojiPickerHeight.value);
|
||||
const q = ref<string>('');
|
||||
const searchResultCustom = ref<Misskey.entities.EmojiSimple[]>([]);
|
||||
const searchResultUnicode = ref<UnicodeEmojiDef[]>([]);
|
||||
const tab = ref<'index' | 'custom' | 'unicode' | 'tags'>('index');
|
||||
|
||||
const customEmojiFolderRoot: CustomEmojiFolderTree = { value: "", category: "", children: [] };
|
||||
const customEmojiFolderRoot: CustomEmojiFolderTree = { value: '', category: '', children: [] };
|
||||
|
||||
function parseAndMergeCategories(input: string, root: CustomEmojiFolderTree): CustomEmojiFolderTree {
|
||||
const parts = input.split('/').map(p => p.trim());
|
||||
|
@ -368,7 +367,7 @@ function chosen(emoji: any, ev?: MouseEvent) {
|
|||
emit('chosen', key);
|
||||
|
||||
// 最近使った絵文字更新
|
||||
if (!pinned.value.includes(key)) {
|
||||
if (!pinned.value?.includes(key)) {
|
||||
let recents = defaultStore.state.recentlyUsedEmojis;
|
||||
recents = recents.filter((emoji: any) => emoji !== key);
|
||||
recents.unshift(key);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue