2023-07-27 07:31:52 +02:00
|
|
|
|
<!--
|
2024-02-13 16:59:27 +01:00
|
|
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-27 07:31:52 +02:00
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
-->
|
|
|
|
|
|
2020-01-29 20:37:25 +01:00
|
|
|
|
<template>
|
2023-01-07 06:44:50 +01:00
|
|
|
|
<div class="omfetrab" :class="['s' + size, 'w' + width, 'h' + height, { asDrawer, asWindow }]" :style="{ maxHeight: maxHeight ? maxHeight + 'px' : undefined }">
|
2023-10-25 14:20:36 +02:00
|
|
|
|
<input ref="searchEl" :value="q" class="search" data-prevent-emoji-insert :class="{ filled: q != null && q != '' }" :placeholder="i18n.ts.search" type="search" autocapitalize="off" @input="input()" @paste.stop="paste" @keydown.stop.prevent.enter="onEnter">
|
2023-05-31 07:03:54 +02:00
|
|
|
|
<!-- FirefoxのTabフォーカスが想定外の挙動となるためtabindex="-1"を追加 https://github.com/misskey-dev/misskey/issues/10744 -->
|
|
|
|
|
<div ref="emojisEl" class="emojis" tabindex="-1">
|
2021-02-27 05:08:34 +01:00
|
|
|
|
<section class="result">
|
2022-07-06 00:30:56 +02:00
|
|
|
|
<div v-if="searchResultCustom.length > 0" class="body">
|
2022-07-05 16:01:23 +02:00
|
|
|
|
<button
|
|
|
|
|
v-for="emoji in searchResultCustom"
|
2023-01-09 07:50:25 +01:00
|
|
|
|
:key="emoji.name"
|
2022-07-06 00:30:56 +02:00
|
|
|
|
class="_button item"
|
2024-02-24 02:22:23 +01:00
|
|
|
|
:disabled="!canReact(emoji)"
|
2021-02-27 05:08:34 +01:00
|
|
|
|
:title="emoji.name"
|
|
|
|
|
tabindex="0"
|
2021-11-19 11:36:12 +01:00
|
|
|
|
@click="chosen(emoji, $event)"
|
2021-02-27 05:08:34 +01:00
|
|
|
|
>
|
2024-03-02 08:05:17 +01:00
|
|
|
|
<MkCustomEmoji class="emoji" :name="emoji.name" :fallbackToImage="true"/>
|
2021-02-27 05:08:34 +01:00
|
|
|
|
</button>
|
2020-11-07 02:43:27 +01:00
|
|
|
|
</div>
|
2022-07-06 00:30:56 +02:00
|
|
|
|
<div v-if="searchResultUnicode.length > 0" class="body">
|
2022-07-05 16:01:23 +02:00
|
|
|
|
<button
|
|
|
|
|
v-for="emoji in searchResultUnicode"
|
2021-11-19 11:36:12 +01:00
|
|
|
|
:key="emoji.name"
|
2022-07-06 00:30:56 +02:00
|
|
|
|
class="_button item"
|
2021-02-27 05:08:34 +01:00
|
|
|
|
:title="emoji.name"
|
|
|
|
|
tabindex="0"
|
2021-11-19 11:36:12 +01:00
|
|
|
|
@click="chosen(emoji, $event)"
|
2021-02-27 05:08:34 +01:00
|
|
|
|
>
|
2022-07-06 00:30:56 +02:00
|
|
|
|
<MkEmoji class="emoji" :emoji="emoji.char"/>
|
2021-02-27 05:08:34 +01:00
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
2020-11-07 02:43:27 +01:00
|
|
|
|
|
2022-07-06 00:30:56 +02:00
|
|
|
|
<div v-if="tab === 'index'" class="group index">
|
2024-01-30 11:53:53 +01:00
|
|
|
|
<section v-if="showPinned && (pinned && pinned.length > 0)">
|
2022-07-06 00:30:56 +02:00
|
|
|
|
<div class="body">
|
2022-07-05 16:01:23 +02:00
|
|
|
|
<button
|
2024-02-24 02:22:23 +01:00
|
|
|
|
v-for="emoji in pinnedEmojisDef"
|
|
|
|
|
:key="getKey(emoji)"
|
|
|
|
|
:data-emoji="getKey(emoji)"
|
2022-07-06 00:30:56 +02:00
|
|
|
|
class="_button item"
|
2024-02-24 02:22:23 +01:00
|
|
|
|
:disabled="!canReact(emoji)"
|
2021-02-27 05:08:34 +01:00
|
|
|
|
tabindex="0"
|
2023-03-10 06:15:49 +01:00
|
|
|
|
@pointerenter="computeButtonTitle"
|
2021-11-19 11:36:12 +01:00
|
|
|
|
@click="chosen(emoji, $event)"
|
2020-11-07 02:43:27 +01:00
|
|
|
|
>
|
2024-02-24 02:22:23 +01:00
|
|
|
|
<MkCustomEmoji v-if="!emoji.hasOwnProperty('char')" class="emoji" :name="getKey(emoji)" :normal="true"/>
|
|
|
|
|
<MkEmoji v-else class="emoji" :emoji="getKey(emoji)" :normal="true"/>
|
2020-11-07 02:43:27 +01:00
|
|
|
|
</button>
|
2020-01-29 20:37:25 +01:00
|
|
|
|
</div>
|
2020-11-07 02:43:27 +01:00
|
|
|
|
</section>
|
|
|
|
|
|
2021-02-27 05:08:34 +01:00
|
|
|
|
<section>
|
2022-12-20 07:24:31 +01:00
|
|
|
|
<header class="_acrylic"><i class="ti ti-clock ti-fw"></i> {{ i18n.ts.recentUsed }}</header>
|
2022-07-06 00:30:56 +02:00
|
|
|
|
<div class="body">
|
2022-07-05 16:01:23 +02:00
|
|
|
|
<button
|
2024-02-24 02:22:23 +01:00
|
|
|
|
v-for="emoji in recentlyUsedEmojisDef"
|
|
|
|
|
:key="getKey(emoji)"
|
2022-07-06 00:30:56 +02:00
|
|
|
|
class="_button item"
|
2024-02-24 02:22:23 +01:00
|
|
|
|
:disabled="!canReact(emoji)"
|
|
|
|
|
:data-emoji="getKey(emoji)"
|
2023-03-10 06:15:49 +01:00
|
|
|
|
@pointerenter="computeButtonTitle"
|
2020-11-07 02:43:27 +01:00
|
|
|
|
@click="chosen(emoji, $event)"
|
|
|
|
|
>
|
2024-02-24 02:22:23 +01:00
|
|
|
|
<MkCustomEmoji v-if="!emoji.hasOwnProperty('char')" class="emoji" :name="getKey(emoji)" :normal="true"/>
|
|
|
|
|
<MkEmoji v-else class="emoji" :emoji="getKey(emoji)" :normal="true"/>
|
2020-11-07 02:43:27 +01:00
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
2020-01-29 20:37:25 +01:00
|
|
|
|
</div>
|
2022-07-06 00:54:04 +02:00
|
|
|
|
<div v-once class="group">
|
2022-01-28 03:39:49 +01:00
|
|
|
|
<header class="_acrylic">{{ i18n.ts.customEmojis }}</header>
|
2023-01-22 18:33:20 +01:00
|
|
|
|
<XSection
|
2023-12-02 07:26:46 +01:00
|
|
|
|
v-for="child in customEmojiFolderRoot.children"
|
|
|
|
|
:key="`custom:${child.value}`"
|
2023-05-18 13:17:32 +02:00
|
|
|
|
:initialShown="false"
|
2024-02-24 02:22:23 +01:00
|
|
|
|
:emojis="computed(() => customEmojis.filter(e => filterCategory(e, child.value)).map(e => `:${e.name}:`))"
|
|
|
|
|
:disabledEmojis="computed(() => customEmojis.filter(e => filterCategory(e, child.value)).filter(e => !canReact(e)).map(e => `:${e.name}:`))"
|
2023-12-09 18:11:17 +01:00
|
|
|
|
:hasChildSection="child.children.length !== 0"
|
|
|
|
|
:customEmojiTree="child.children"
|
2023-01-22 18:33:20 +01:00
|
|
|
|
@chosen="chosen"
|
|
|
|
|
>
|
2023-12-02 07:26:46 +01:00
|
|
|
|
{{ child.value || i18n.ts.other }}
|
2023-01-22 18:33:20 +01:00
|
|
|
|
</XSection>
|
2021-02-27 11:53:20 +01:00
|
|
|
|
</div>
|
2022-07-06 00:54:04 +02:00
|
|
|
|
<div v-once class="group">
|
2022-01-28 03:39:49 +01:00
|
|
|
|
<header class="_acrylic">{{ i18n.ts.emoji }}</header>
|
2023-12-02 07:26:46 +01:00
|
|
|
|
<XSection v-for="category in categories" :key="category" :emojis="emojiCharByCategory.get(category) ?? []" :hasChildSection="false" @chosen="chosen">{{ category }}</XSection>
|
2021-02-27 11:53:20 +01:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tabs">
|
2022-12-20 00:35:49 +01:00
|
|
|
|
<button class="_button tab" :class="{ active: tab === 'index' }" @click="tab = 'index'"><i class="ti ti-asterisk ti-fw"></i></button>
|
2022-12-19 11:01:30 +01:00
|
|
|
|
<button class="_button tab" :class="{ active: tab === 'custom' }" @click="tab = 'custom'"><i class="ti ti-mood-happy ti-fw"></i></button>
|
2022-12-20 00:35:49 +01:00
|
|
|
|
<button class="_button tab" :class="{ active: tab === 'unicode' }" @click="tab = 'unicode'"><i class="ti ti-leaf ti-fw"></i></button>
|
2022-12-19 11:01:30 +01:00
|
|
|
|
<button class="_button tab" :class="{ active: tab === 'tags' }" @click="tab = 'tags'"><i class="ti ti-hash ti-fw"></i></button>
|
2020-01-29 20:37:25 +01:00
|
|
|
|
</div>
|
2021-02-27 05:08:34 +01:00
|
|
|
|
</div>
|
2020-01-29 20:37:25 +01:00
|
|
|
|
</template>
|
|
|
|
|
|
2022-01-18 15:06:16 +01:00
|
|
|
|
<script lang="ts" setup>
|
2023-01-03 02:12:37 +01:00
|
|
|
|
import { ref, shallowRef, computed, watch, onMounted } from 'vue';
|
2022-01-18 15:06:16 +01:00
|
|
|
|
import * as Misskey from 'misskey-js';
|
2022-08-30 17:24:33 +02:00
|
|
|
|
import XSection from '@/components/MkEmojiPicker.section.vue';
|
2023-12-02 07:26:46 +01:00
|
|
|
|
import {
|
2023-12-09 18:11:17 +01:00
|
|
|
|
emojilist,
|
|
|
|
|
emojiCharByCategory,
|
|
|
|
|
UnicodeEmojiDef,
|
|
|
|
|
unicodeEmojiCategories as categories,
|
|
|
|
|
getEmojiName,
|
2023-12-11 12:31:23 +01:00
|
|
|
|
CustomEmojiFolderTree,
|
2024-02-29 12:47:24 +01:00
|
|
|
|
getUnicodeEmoji,
|
2023-12-02 07:26:46 +01:00
|
|
|
|
} from '@/scripts/emojilist.js';
|
2023-01-01 04:28:30 +01:00
|
|
|
|
import MkRippleEffect from '@/components/MkRippleEffect.vue';
|
2023-09-19 09:37:43 +02:00
|
|
|
|
import * as os from '@/os.js';
|
|
|
|
|
import { isTouchUsing } from '@/scripts/touch.js';
|
|
|
|
|
import { deviceKind } from '@/scripts/device-kind.js';
|
|
|
|
|
import { i18n } from '@/i18n.js';
|
|
|
|
|
import { defaultStore } from '@/store.js';
|
|
|
|
|
import { customEmojiCategories, customEmojis, customEmojisMap } from '@/custom-emojis.js';
|
|
|
|
|
import { $i } from '@/account.js';
|
2024-02-06 08:45:21 +01:00
|
|
|
|
import { checkReactionPermissions } from '@/scripts/check-reaction-permissions.js';
|
2022-01-18 15:06:16 +01:00
|
|
|
|
|
|
|
|
|
const props = withDefaults(defineProps<{
|
|
|
|
|
showPinned?: boolean;
|
2023-12-14 06:11:20 +01:00
|
|
|
|
pinnedEmojis?: string[];
|
2022-01-18 15:06:16 +01:00
|
|
|
|
maxHeight?: number;
|
|
|
|
|
asDrawer?: boolean;
|
2023-01-07 06:44:50 +01:00
|
|
|
|
asWindow?: boolean;
|
2023-12-14 06:11:20 +01:00
|
|
|
|
asReactionPicker?: boolean; // 今は使われてないが将来的に使いそう
|
2024-02-06 08:45:21 +01:00
|
|
|
|
targetNote?: Misskey.entities.Note;
|
2022-01-18 15:06:16 +01:00
|
|
|
|
}>(), {
|
|
|
|
|
showPinned: true,
|
|
|
|
|
});
|
2020-01-29 20:37:25 +01:00
|
|
|
|
|
2022-01-18 15:06:16 +01:00
|
|
|
|
const emit = defineEmits<{
|
2022-05-07 10:00:05 +02:00
|
|
|
|
(ev: 'chosen', v: string): void;
|
2022-01-18 15:06:16 +01:00
|
|
|
|
}>();
|
|
|
|
|
|
2023-01-09 09:04:52 +01:00
|
|
|
|
const searchEl = shallowRef<HTMLInputElement>();
|
2023-01-09 08:27:09 +01:00
|
|
|
|
const emojisEl = shallowRef<HTMLDivElement>();
|
2022-01-18 15:06:16 +01:00
|
|
|
|
|
|
|
|
|
const {
|
2023-12-14 06:11:20 +01:00
|
|
|
|
emojiPickerScale,
|
|
|
|
|
emojiPickerWidth,
|
|
|
|
|
emojiPickerHeight,
|
2022-01-18 15:06:16 +01:00
|
|
|
|
recentlyUsedEmojis,
|
|
|
|
|
} = defaultStore.reactiveState;
|
|
|
|
|
|
2024-02-24 02:22:23 +01:00
|
|
|
|
const recentlyUsedEmojisDef = computed(() => {
|
|
|
|
|
return recentlyUsedEmojis.value.map(getDef);
|
|
|
|
|
});
|
|
|
|
|
const pinnedEmojisDef = computed(() => {
|
|
|
|
|
return pinned.value?.map(getDef);
|
|
|
|
|
});
|
|
|
|
|
|
2023-12-14 06:11:20 +01:00
|
|
|
|
const pinned = computed(() => props.pinnedEmojis);
|
|
|
|
|
const size = computed(() => emojiPickerScale.value);
|
|
|
|
|
const width = computed(() => emojiPickerWidth.value);
|
|
|
|
|
const height = computed(() => emojiPickerHeight.value);
|
2022-12-22 06:28:13 +01:00
|
|
|
|
const q = ref<string>('');
|
2023-12-02 13:00:05 +01:00
|
|
|
|
const searchResultCustom = ref<Misskey.entities.EmojiSimple[]>([]);
|
2022-01-18 15:06:16 +01:00
|
|
|
|
const searchResultUnicode = ref<UnicodeEmojiDef[]>([]);
|
|
|
|
|
const tab = ref<'index' | 'custom' | 'unicode' | 'tags'>('index');
|
|
|
|
|
|
2023-12-14 06:11:20 +01:00
|
|
|
|
const customEmojiFolderRoot: CustomEmojiFolderTree = { value: '', category: '', children: [] };
|
2023-12-02 07:26:46 +01:00
|
|
|
|
|
|
|
|
|
function parseAndMergeCategories(input: string, root: CustomEmojiFolderTree): CustomEmojiFolderTree {
|
|
|
|
|
const parts = input.split('/').map(p => p.trim());
|
|
|
|
|
let currentNode: CustomEmojiFolderTree = root;
|
|
|
|
|
|
|
|
|
|
for (const part of parts) {
|
|
|
|
|
let existingNode = currentNode.children.find((node) => node.value === part);
|
|
|
|
|
|
|
|
|
|
if (!existingNode) {
|
|
|
|
|
const newNode: CustomEmojiFolderTree = { value: part, category: input, children: [] };
|
|
|
|
|
currentNode.children.push(newNode);
|
|
|
|
|
existingNode = newNode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
currentNode = existingNode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return currentNode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
customEmojiCategories.value.forEach(ec => {
|
2023-12-09 18:11:17 +01:00
|
|
|
|
if (ec !== null) {
|
|
|
|
|
parseAndMergeCategories(ec, customEmojiFolderRoot);
|
|
|
|
|
}
|
2023-12-02 07:26:46 +01:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
parseAndMergeCategories('', customEmojiFolderRoot);
|
|
|
|
|
|
2022-01-18 15:06:16 +01:00
|
|
|
|
watch(q, () => {
|
2023-01-09 08:27:09 +01:00
|
|
|
|
if (emojisEl.value) emojisEl.value.scrollTop = 0;
|
2022-01-18 15:06:16 +01:00
|
|
|
|
|
2022-12-22 06:28:13 +01:00
|
|
|
|
if (q.value === '') {
|
2022-01-18 15:06:16 +01:00
|
|
|
|
searchResultCustom.value = [];
|
|
|
|
|
searchResultUnicode.value = [];
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-19 01:00:45 +01:00
|
|
|
|
const newQ = q.value.replace(/:/g, '').toLowerCase();
|
2022-01-18 15:06:16 +01:00
|
|
|
|
|
|
|
|
|
const searchCustom = () => {
|
2023-08-05 07:05:32 +02:00
|
|
|
|
const max = 100;
|
2023-01-16 10:39:58 +01:00
|
|
|
|
const emojis = customEmojis.value;
|
2023-12-02 13:00:05 +01:00
|
|
|
|
const matches = new Set<Misskey.entities.EmojiSimple>();
|
2022-01-18 15:06:16 +01:00
|
|
|
|
|
2022-05-07 10:00:05 +02:00
|
|
|
|
const exactMatch = emojis.find(emoji => emoji.name === newQ);
|
2022-01-18 15:06:16 +01:00
|
|
|
|
if (exactMatch) matches.add(exactMatch);
|
|
|
|
|
|
|
|
|
|
if (newQ.includes(' ')) { // AND検索
|
|
|
|
|
const keywords = newQ.split(' ');
|
2020-01-29 20:37:25 +01:00
|
|
|
|
|
2022-01-18 15:06:16 +01:00
|
|
|
|
// 名前にキーワードが含まれている
|
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
|
if (keywords.every(keyword => emoji.name.includes(keyword))) {
|
|
|
|
|
matches.add(emoji);
|
|
|
|
|
if (matches.size >= max) break;
|
2020-11-07 02:43:27 +01:00
|
|
|
|
}
|
2022-01-18 15:06:16 +01:00
|
|
|
|
}
|
|
|
|
|
if (matches.size >= max) return matches;
|
2020-11-07 13:28:28 +01:00
|
|
|
|
|
2022-01-18 15:06:16 +01:00
|
|
|
|
// 名前またはエイリアスにキーワードが含まれている
|
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
|
if (keywords.every(keyword => emoji.name.includes(keyword) || emoji.aliases.some(alias => alias.includes(keyword)))) {
|
|
|
|
|
matches.add(emoji);
|
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2024-01-10 07:06:04 +01:00
|
|
|
|
if (customEmojisMap.has(newQ)) {
|
|
|
|
|
matches.add(customEmojisMap.get(newQ)!);
|
|
|
|
|
}
|
|
|
|
|
if (matches.size >= max) return matches;
|
|
|
|
|
|
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
|
if (emoji.aliases.some(alias => alias === newQ)) {
|
|
|
|
|
matches.add(emoji);
|
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (matches.size >= max) return matches;
|
|
|
|
|
|
2022-01-18 15:06:16 +01:00
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
|
if (emoji.name.startsWith(newQ)) {
|
|
|
|
|
matches.add(emoji);
|
|
|
|
|
if (matches.size >= max) break;
|
2020-11-07 02:43:27 +01:00
|
|
|
|
}
|
2022-01-18 15:06:16 +01:00
|
|
|
|
}
|
|
|
|
|
if (matches.size >= max) return matches;
|
2020-11-07 13:28:28 +01:00
|
|
|
|
|
2022-01-18 15:06:16 +01:00
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
|
if (emoji.aliases.some(alias => alias.startsWith(newQ))) {
|
|
|
|
|
matches.add(emoji);
|
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (matches.size >= max) return matches;
|
2020-11-07 02:43:27 +01:00
|
|
|
|
|
2022-01-18 15:06:16 +01:00
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
|
if (emoji.name.includes(newQ)) {
|
|
|
|
|
matches.add(emoji);
|
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
|
}
|
2021-02-27 17:09:59 +01:00
|
|
|
|
}
|
2022-01-18 15:06:16 +01:00
|
|
|
|
if (matches.size >= max) return matches;
|
|
|
|
|
|
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
|
if (emoji.aliases.some(alias => alias.includes(newQ))) {
|
|
|
|
|
matches.add(emoji);
|
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
|
}
|
2022-01-18 15:06:16 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return matches;
|
|
|
|
|
};
|
2020-01-29 20:37:25 +01:00
|
|
|
|
|
2022-01-18 15:06:16 +01:00
|
|
|
|
const searchUnicode = () => {
|
2023-08-05 07:05:32 +02:00
|
|
|
|
const max = 100;
|
2022-01-18 15:06:16 +01:00
|
|
|
|
const emojis = emojilist;
|
|
|
|
|
const matches = new Set<UnicodeEmojiDef>();
|
2020-11-07 02:43:27 +01:00
|
|
|
|
|
2022-05-07 10:00:05 +02:00
|
|
|
|
const exactMatch = emojis.find(emoji => emoji.name === newQ);
|
2022-01-18 15:06:16 +01:00
|
|
|
|
if (exactMatch) matches.add(exactMatch);
|
|
|
|
|
|
|
|
|
|
if (newQ.includes(' ')) { // AND検索
|
|
|
|
|
const keywords = newQ.split(' ');
|
|
|
|
|
|
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
|
if (keywords.every(keyword => emoji.name.includes(keyword))) {
|
|
|
|
|
matches.add(emoji);
|
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
|
}
|
2020-11-08 05:58:16 +01:00
|
|
|
|
}
|
2022-01-18 15:06:16 +01:00
|
|
|
|
if (matches.size >= max) return matches;
|
2020-11-07 02:43:27 +01:00
|
|
|
|
|
2023-06-01 10:10:53 +02:00
|
|
|
|
for (const index of Object.values(defaultStore.state.additionalUnicodeEmojiIndexes)) {
|
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
|
if (keywords.every(keyword => index[emoji.char].some(k => k.includes(keyword)))) {
|
|
|
|
|
matches.add(emoji);
|
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
|
}
|
2022-01-18 15:06:16 +01:00
|
|
|
|
}
|
2020-11-07 02:43:27 +01:00
|
|
|
|
}
|
2022-01-18 15:06:16 +01:00
|
|
|
|
} else {
|
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
|
if (emoji.name.startsWith(newQ)) {
|
|
|
|
|
matches.add(emoji);
|
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
|
}
|
2020-11-07 02:43:27 +01:00
|
|
|
|
}
|
2022-01-18 15:06:16 +01:00
|
|
|
|
if (matches.size >= max) return matches;
|
|
|
|
|
|
2023-06-01 10:10:53 +02:00
|
|
|
|
for (const index of Object.values(defaultStore.state.additionalUnicodeEmojiIndexes)) {
|
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
|
if (index[emoji.char].some(k => k.startsWith(newQ))) {
|
|
|
|
|
matches.add(emoji);
|
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-18 15:06:16 +01:00
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
|
if (emoji.name.includes(newQ)) {
|
|
|
|
|
matches.add(emoji);
|
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
|
}
|
2020-11-07 13:33:36 +01:00
|
|
|
|
}
|
2022-01-18 15:06:16 +01:00
|
|
|
|
if (matches.size >= max) return matches;
|
2023-06-01 10:10:53 +02:00
|
|
|
|
|
|
|
|
|
for (const index of Object.values(defaultStore.state.additionalUnicodeEmojiIndexes)) {
|
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
|
if (index[emoji.char].some(k => k.includes(newQ))) {
|
|
|
|
|
matches.add(emoji);
|
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-01-18 15:06:16 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return matches;
|
|
|
|
|
};
|
|
|
|
|
|
2024-02-24 02:22:23 +01:00
|
|
|
|
searchResultCustom.value = Array.from(searchCustom());
|
2022-01-18 15:06:16 +01:00
|
|
|
|
searchResultUnicode.value = Array.from(searchUnicode());
|
|
|
|
|
});
|
|
|
|
|
|
2024-03-02 05:28:10 +01:00
|
|
|
|
function canReact(emoji: Misskey.entities.EmojiSimple | UnicodeEmojiDef | string): boolean {
|
2024-02-06 08:45:21 +01:00
|
|
|
|
return !props.targetNote || checkReactionPermissions($i!, props.targetNote, emoji);
|
2023-05-18 13:17:32 +02:00
|
|
|
|
}
|
|
|
|
|
|
2024-02-24 02:22:23 +01:00
|
|
|
|
function filterCategory(emoji: Misskey.entities.EmojiSimple, category: string): boolean {
|
|
|
|
|
return category === '' ? (emoji.category === 'null' || !emoji.category) : emoji.category === category;
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-18 15:06:16 +01:00
|
|
|
|
function focus() {
|
2022-02-08 10:46:39 +01:00
|
|
|
|
if (!['smartphone', 'tablet'].includes(deviceKind) && !isTouchUsing) {
|
2023-01-09 09:04:52 +01:00
|
|
|
|
searchEl.value?.focus({
|
2022-07-05 16:01:23 +02:00
|
|
|
|
preventScroll: true,
|
2022-01-18 15:06:16 +01:00
|
|
|
|
});
|
2020-01-29 20:37:25 +01:00
|
|
|
|
}
|
2022-01-18 15:06:16 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function reset() {
|
2023-01-09 08:27:09 +01:00
|
|
|
|
if (emojisEl.value) emojisEl.value.scrollTop = 0;
|
2022-01-18 15:06:16 +01:00
|
|
|
|
q.value = '';
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-02 13:00:05 +01:00
|
|
|
|
function getKey(emoji: string | Misskey.entities.EmojiSimple | UnicodeEmojiDef): string {
|
2022-12-22 06:28:13 +01:00
|
|
|
|
return typeof emoji === 'string' ? emoji : 'char' in emoji ? emoji.char : `:${emoji.name}:`;
|
2022-01-18 15:06:16 +01:00
|
|
|
|
}
|
|
|
|
|
|
2024-03-02 05:28:10 +01:00
|
|
|
|
function getDef(emoji: string): string | Misskey.entities.EmojiSimple | UnicodeEmojiDef {
|
2024-02-24 02:22:23 +01:00
|
|
|
|
if (emoji.includes(':')) {
|
2024-03-02 05:28:10 +01:00
|
|
|
|
// カスタム絵文字が存在する場合はその情報を持つオブジェクトを返し、
|
|
|
|
|
// サーバの管理画面から削除された等で情報が見つからない場合は名前の文字列をそのまま返しておく(undefinedを返すとエラーになるため)
|
|
|
|
|
const name = emoji.replaceAll(':', '');
|
|
|
|
|
return customEmojisMap.get(name) ?? emoji;
|
2024-02-24 02:22:23 +01:00
|
|
|
|
} else {
|
2024-03-02 05:28:10 +01:00
|
|
|
|
return getUnicodeEmoji(emoji);
|
2024-02-24 02:22:23 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-10 06:15:49 +01:00
|
|
|
|
/** @see MkEmojiPicker.section.vue */
|
|
|
|
|
function computeButtonTitle(ev: MouseEvent): void {
|
|
|
|
|
const elm = ev.target as HTMLElement;
|
|
|
|
|
const emoji = elm.dataset.emoji as string;
|
2024-03-02 05:28:10 +01:00
|
|
|
|
elm.title = getEmojiName(emoji);
|
2023-03-10 06:15:49 +01:00
|
|
|
|
}
|
|
|
|
|
|
2022-01-18 15:06:16 +01:00
|
|
|
|
function chosen(emoji: any, ev?: MouseEvent) {
|
2022-01-28 03:53:12 +01:00
|
|
|
|
const el = ev && (ev.currentTarget ?? ev.target) as HTMLElement | null | undefined;
|
2022-01-18 15:06:16 +01:00
|
|
|
|
if (el) {
|
|
|
|
|
const rect = el.getBoundingClientRect();
|
|
|
|
|
const x = rect.left + (el.offsetWidth / 2);
|
|
|
|
|
const y = rect.top + (el.offsetHeight / 2);
|
2024-07-04 06:14:49 +02:00
|
|
|
|
const { dispose } = os.popup(MkRippleEffect, { x, y }, {
|
|
|
|
|
end: () => dispose(),
|
|
|
|
|
});
|
2022-01-18 15:06:16 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const key = getKey(emoji);
|
|
|
|
|
emit('chosen', key);
|
|
|
|
|
|
|
|
|
|
// 最近使った絵文字更新
|
2023-12-14 06:11:20 +01:00
|
|
|
|
if (!pinned.value?.includes(key)) {
|
2022-01-18 15:06:16 +01:00
|
|
|
|
let recents = defaultStore.state.recentlyUsedEmojis;
|
2022-05-07 10:00:05 +02:00
|
|
|
|
recents = recents.filter((emoji: any) => emoji !== key);
|
2022-01-18 15:06:16 +01:00
|
|
|
|
recents.unshift(key);
|
|
|
|
|
defaultStore.set('recentlyUsedEmojis', recents.splice(0, 32));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-22 06:28:13 +01:00
|
|
|
|
function input(): void {
|
|
|
|
|
// Using custom input event instead of v-model to respond immediately on
|
|
|
|
|
// Android, where composition happens on all languages
|
|
|
|
|
// (v-model does not update during composition)
|
2023-01-09 09:04:52 +01:00
|
|
|
|
q.value = searchEl.value?.value.trim() ?? '';
|
2022-12-22 06:28:13 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function paste(event: ClipboardEvent): void {
|
|
|
|
|
const pasted = event.clipboardData?.getData('text') ?? '';
|
|
|
|
|
if (done(pasted)) {
|
2022-01-18 15:06:16 +01:00
|
|
|
|
event.preventDefault();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-06 13:05:33 +01:00
|
|
|
|
function onEnter(ev: KeyboardEvent) {
|
|
|
|
|
if (ev.isComposing || ev.key === 'Process' || ev.keyCode === 229) return;
|
|
|
|
|
done();
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-22 06:28:13 +01:00
|
|
|
|
function done(query?: string): boolean | void {
|
2022-01-18 15:06:16 +01:00
|
|
|
|
if (query == null) query = q.value;
|
|
|
|
|
if (query == null || typeof query !== 'string') return;
|
|
|
|
|
|
|
|
|
|
const q2 = query.replace(/:/g, '');
|
2023-05-31 05:42:24 +02:00
|
|
|
|
const exactMatchCustom = customEmojisMap.get(q2);
|
2022-01-18 15:06:16 +01:00
|
|
|
|
if (exactMatchCustom) {
|
|
|
|
|
chosen(exactMatchCustom);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2022-05-07 10:00:05 +02:00
|
|
|
|
const exactMatchUnicode = emojilist.find(emoji => emoji.char === q2 || emoji.name === q2);
|
2022-01-18 15:06:16 +01:00
|
|
|
|
if (exactMatchUnicode) {
|
|
|
|
|
chosen(exactMatchUnicode);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
if (searchResultCustom.value.length > 0) {
|
|
|
|
|
chosen(searchResultCustom.value[0]);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
if (searchResultUnicode.value.length > 0) {
|
|
|
|
|
chosen(searchResultUnicode.value[0]);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
focus();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
defineExpose({
|
|
|
|
|
focus,
|
|
|
|
|
reset,
|
2020-01-29 20:37:25 +01:00
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
2022-12-27 10:29:39 +01:00
|
|
|
|
<style lang="scss" scoped>
|
2020-01-29 20:37:25 +01:00
|
|
|
|
.omfetrab {
|
2020-11-14 03:47:30 +01:00
|
|
|
|
$pad: 8px;
|
|
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
2022-02-11 05:38:47 +01:00
|
|
|
|
&.s1 {
|
|
|
|
|
--eachSize: 40px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.s2 {
|
|
|
|
|
--eachSize: 45px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.s3 {
|
|
|
|
|
--eachSize: 50px;
|
2020-11-18 04:09:14 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.w1 {
|
|
|
|
|
width: calc((var(--eachSize) * 5) + (#{$pad} * 2));
|
2021-12-16 18:14:40 +01:00
|
|
|
|
--columns: 1fr 1fr 1fr 1fr 1fr;
|
2020-11-18 04:09:14 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.w2 {
|
|
|
|
|
width: calc((var(--eachSize) * 6) + (#{$pad} * 2));
|
2021-12-16 18:14:40 +01:00
|
|
|
|
--columns: 1fr 1fr 1fr 1fr 1fr 1fr;
|
2020-11-18 04:09:14 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.w3 {
|
|
|
|
|
width: calc((var(--eachSize) * 7) + (#{$pad} * 2));
|
2021-12-16 18:14:40 +01:00
|
|
|
|
--columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
2020-11-18 04:09:14 +01:00
|
|
|
|
}
|
|
|
|
|
|
2022-02-11 05:53:02 +01:00
|
|
|
|
&.w4 {
|
|
|
|
|
width: calc((var(--eachSize) * 8) + (#{$pad} * 2));
|
|
|
|
|
--columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.w5 {
|
|
|
|
|
width: calc((var(--eachSize) * 9) + (#{$pad} * 2));
|
|
|
|
|
--columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-18 04:09:14 +01:00
|
|
|
|
&.h1 {
|
2021-12-16 18:14:40 +01:00
|
|
|
|
height: calc((var(--eachSize) * 4) + (#{$pad} * 2));
|
2020-11-18 04:09:14 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.h2 {
|
2021-12-16 18:14:40 +01:00
|
|
|
|
height: calc((var(--eachSize) * 6) + (#{$pad} * 2));
|
2020-11-18 04:09:14 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.h3 {
|
2021-12-16 18:14:40 +01:00
|
|
|
|
height: calc((var(--eachSize) * 8) + (#{$pad} * 2));
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-11 05:53:02 +01:00
|
|
|
|
&.h4 {
|
|
|
|
|
height: calc((var(--eachSize) * 10) + (#{$pad} * 2));
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-16 18:14:40 +01:00
|
|
|
|
&.asDrawer {
|
|
|
|
|
width: 100% !important;
|
|
|
|
|
|
|
|
|
|
> .emojis {
|
|
|
|
|
::v-deep(section) {
|
2021-12-17 08:14:43 +01:00
|
|
|
|
> header {
|
|
|
|
|
height: 32px;
|
|
|
|
|
line-height: 32px;
|
|
|
|
|
padding: 0 12px;
|
|
|
|
|
font-size: 15px;
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-06 00:30:56 +02:00
|
|
|
|
> .body {
|
2021-12-16 18:14:40 +01:00
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: var(--columns);
|
2022-07-06 00:30:56 +02:00
|
|
|
|
font-size: 30px;
|
2021-12-16 18:14:40 +01:00
|
|
|
|
|
2022-07-06 00:30:56 +02:00
|
|
|
|
> .item {
|
2023-01-07 06:44:50 +01:00
|
|
|
|
aspect-ratio: 1 / 1;
|
|
|
|
|
width: auto;
|
|
|
|
|
height: auto;
|
|
|
|
|
min-width: 0;
|
2024-02-24 02:22:23 +01:00
|
|
|
|
|
|
|
|
|
&:disabled {
|
|
|
|
|
cursor: not-allowed;
|
|
|
|
|
background: linear-gradient(-45deg, transparent 0% 48%, var(--X6) 48% 52%, transparent 52% 100%);
|
|
|
|
|
opacity: 1;
|
|
|
|
|
|
|
|
|
|
> .emoji {
|
|
|
|
|
filter: grayscale(1);
|
|
|
|
|
mix-blend-mode: exclusion;
|
|
|
|
|
opacity: 0.8;
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-01-07 06:44:50 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.asWindow {
|
|
|
|
|
width: 100% !important;
|
|
|
|
|
height: 100% !important;
|
|
|
|
|
|
|
|
|
|
> .emojis {
|
|
|
|
|
::v-deep(section) {
|
|
|
|
|
> .body {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: var(--columns);
|
|
|
|
|
font-size: 30px;
|
|
|
|
|
|
|
|
|
|
> .item {
|
2021-12-16 18:14:40 +01:00
|
|
|
|
aspect-ratio: 1 / 1;
|
|
|
|
|
width: auto;
|
|
|
|
|
height: auto;
|
|
|
|
|
min-width: 0;
|
2024-02-24 02:22:23 +01:00
|
|
|
|
|
|
|
|
|
&:disabled {
|
|
|
|
|
cursor: not-allowed;
|
|
|
|
|
background: linear-gradient(-45deg, transparent 0% 48%, var(--X6) 48% 52%, transparent 52% 100%);
|
|
|
|
|
opacity: 1;
|
|
|
|
|
|
|
|
|
|
> .emoji {
|
|
|
|
|
filter: grayscale(1);
|
|
|
|
|
mix-blend-mode: exclusion;
|
|
|
|
|
opacity: 0.8;
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-12-16 18:14:40 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-11-14 03:47:30 +01:00
|
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
|
|
2020-11-07 02:43:27 +01:00
|
|
|
|
> .search {
|
|
|
|
|
width: 100%;
|
|
|
|
|
padding: 12px;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
font-size: 1em;
|
|
|
|
|
outline: none;
|
|
|
|
|
border: none;
|
|
|
|
|
background: transparent;
|
|
|
|
|
color: var(--fg);
|
2020-11-14 03:47:30 +01:00
|
|
|
|
|
2023-04-10 18:42:44 +02:00
|
|
|
|
&:not(:focus):not(.filled) {
|
|
|
|
|
margin-bottom: env(safe-area-inset-bottom, 0px);
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-14 03:47:30 +01:00
|
|
|
|
&:not(.filled) {
|
|
|
|
|
order: 1;
|
|
|
|
|
z-index: 2;
|
|
|
|
|
box-shadow: 0px -1px 0 0px var(--divider);
|
|
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
|
}
|
|
|
|
|
|
2021-02-27 11:53:20 +01:00
|
|
|
|
> .tabs {
|
|
|
|
|
display: flex;
|
|
|
|
|
display: none;
|
|
|
|
|
|
|
|
|
|
> .tab {
|
|
|
|
|
flex: 1;
|
|
|
|
|
height: 38px;
|
2021-04-10 05:40:50 +02:00
|
|
|
|
border-top: solid 0.5px var(--divider);
|
2021-02-27 11:53:20 +01:00
|
|
|
|
|
|
|
|
|
&.active {
|
|
|
|
|
border-top: solid 1px var(--accent);
|
|
|
|
|
color: var(--accent);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-29 20:37:25 +01:00
|
|
|
|
> .emojis {
|
2021-12-16 18:14:40 +01:00
|
|
|
|
height: 100%;
|
2020-01-29 20:37:25 +01:00
|
|
|
|
overflow-y: auto;
|
|
|
|
|
overflow-x: hidden;
|
|
|
|
|
|
2020-11-14 03:47:30 +01:00
|
|
|
|
scrollbar-width: none;
|
|
|
|
|
|
|
|
|
|
&::-webkit-scrollbar {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-06 00:30:56 +02:00
|
|
|
|
> .group {
|
2021-02-27 11:53:20 +01:00
|
|
|
|
&:not(.index) {
|
|
|
|
|
padding: 4px 0 8px 0;
|
2021-04-10 05:40:50 +02:00
|
|
|
|
border-top: solid 0.5px var(--divider);
|
2021-02-27 11:53:20 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> header {
|
|
|
|
|
/*position: sticky;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;*/
|
|
|
|
|
height: 32px;
|
|
|
|
|
line-height: 32px;
|
|
|
|
|
z-index: 2;
|
|
|
|
|
padding: 0 8px;
|
|
|
|
|
font-size: 12px;
|
2020-11-07 02:43:27 +01:00
|
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
|
}
|
|
|
|
|
|
2021-02-27 11:53:20 +01:00
|
|
|
|
::v-deep(section) {
|
2020-11-07 02:43:27 +01:00
|
|
|
|
> header {
|
|
|
|
|
position: sticky;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
2023-12-02 07:26:46 +01:00
|
|
|
|
line-height: 28px;
|
2020-11-07 02:43:27 +01:00
|
|
|
|
z-index: 1;
|
2021-02-27 11:53:20 +01:00
|
|
|
|
padding: 0 8px;
|
2020-11-07 02:43:27 +01:00
|
|
|
|
font-size: 12px;
|
2021-02-27 11:53:20 +01:00
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
color: var(--accent);
|
|
|
|
|
}
|
2020-11-07 02:43:27 +01:00
|
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
|
|
2022-07-06 00:30:56 +02:00
|
|
|
|
> .body {
|
2021-02-27 11:53:20 +01:00
|
|
|
|
position: relative;
|
2020-11-14 03:47:30 +01:00
|
|
|
|
padding: $pad;
|
2020-01-29 20:37:25 +01:00
|
|
|
|
|
2022-07-06 00:30:56 +02:00
|
|
|
|
> .item {
|
2020-11-07 02:43:27 +01:00
|
|
|
|
position: relative;
|
|
|
|
|
padding: 0;
|
2020-11-18 04:09:14 +01:00
|
|
|
|
width: var(--eachSize);
|
|
|
|
|
height: var(--eachSize);
|
2022-07-06 00:30:56 +02:00
|
|
|
|
contain: strict;
|
2020-11-14 03:47:30 +01:00
|
|
|
|
border-radius: 4px;
|
2022-07-06 00:30:56 +02:00
|
|
|
|
font-size: 24px;
|
2020-01-29 20:37:25 +01:00
|
|
|
|
|
2021-10-02 19:46:58 +02:00
|
|
|
|
&:focus-visible {
|
2020-11-07 02:43:27 +01:00
|
|
|
|
outline: solid 2px var(--focus);
|
|
|
|
|
z-index: 1;
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-14 03:47:30 +01:00
|
|
|
|
&:hover {
|
|
|
|
|
background: rgba(0, 0, 0, 0.05);
|
2020-11-07 02:43:27 +01:00
|
|
|
|
}
|
|
|
|
|
|
2020-11-14 03:47:30 +01:00
|
|
|
|
&:active {
|
|
|
|
|
background: var(--accent);
|
|
|
|
|
box-shadow: inset 0 0.15em 0.3em rgba(27, 31, 35, 0.15);
|
2020-11-07 02:43:27 +01:00
|
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
|
|
2024-02-24 02:22:23 +01:00
|
|
|
|
&:disabled {
|
|
|
|
|
cursor: not-allowed;
|
|
|
|
|
background: linear-gradient(-45deg, transparent 0% 48%, var(--X6) 48% 52%, transparent 52% 100%);
|
|
|
|
|
opacity: 1;
|
|
|
|
|
|
|
|
|
|
> .emoji {
|
|
|
|
|
filter: grayscale(1);
|
|
|
|
|
mix-blend-mode: exclusion;
|
|
|
|
|
opacity: 0.8;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-06 00:30:56 +02:00
|
|
|
|
> .emoji {
|
2020-11-14 03:47:30 +01:00
|
|
|
|
height: 1.25em;
|
|
|
|
|
vertical-align: -.25em;
|
2020-11-07 02:43:27 +01:00
|
|
|
|
pointer-events: none;
|
2023-10-11 10:58:40 +02:00
|
|
|
|
width: 100%;
|
|
|
|
|
object-fit: contain;
|
2020-01-29 20:37:25 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2020-11-07 02:43:27 +01:00
|
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
|
|
2020-11-07 02:43:27 +01:00
|
|
|
|
&.result {
|
2021-04-10 05:40:50 +02:00
|
|
|
|
border-bottom: solid 0.5px var(--divider);
|
2020-11-14 03:47:30 +01:00
|
|
|
|
|
|
|
|
|
&:empty {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
2020-11-07 02:43:27 +01:00
|
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|