2018-02-20 11:29:52 +00:00
|
|
|
<template>
|
2020-10-17 11:12:00 +00:00
|
|
|
<div class="swhvrteh _popup _shadow" @contextmenu.prevent="() => {}">
|
2021-11-19 10:36:12 +00:00
|
|
|
<ol v-if="type === 'user'" ref="suggests" class="users">
|
|
|
|
<li v-for="user in users" tabindex="-1" class="user" @click="complete(type, user)" @keydown="onKeydown">
|
2020-02-16 13:46:51 +00:00
|
|
|
<img class="avatar" :src="user.avatarUrl"/>
|
2018-12-06 01:02:04 +00:00
|
|
|
<span class="name">
|
2021-11-19 10:36:12 +00:00
|
|
|
<MkUserName :key="user.id" :user="user"/>
|
2018-12-06 01:02:04 +00:00
|
|
|
</span>
|
2020-10-17 11:12:00 +00:00
|
|
|
<span class="username">@{{ acct(user) }}</span>
|
2018-02-20 11:29:52 +00:00
|
|
|
</li>
|
2021-11-19 10:36:12 +00:00
|
|
|
<li tabindex="-1" class="choose" @click="chooseUser()" @keydown="onKeydown">{{ $ts.selectUser }}</li>
|
2018-02-20 11:29:52 +00:00
|
|
|
</ol>
|
2021-11-19 10:36:12 +00:00
|
|
|
<ol v-else-if="hashtags.length > 0" ref="suggests" class="hashtags">
|
|
|
|
<li v-for="hashtag in hashtags" tabindex="-1" @click="complete(type, hashtag)" @keydown="onKeydown">
|
2018-07-17 22:19:24 +00:00
|
|
|
<span class="name">{{ hashtag }}</span>
|
|
|
|
</li>
|
|
|
|
</ol>
|
2021-11-19 10:36:12 +00:00
|
|
|
<ol v-else-if="emojis.length > 0" ref="suggests" class="emojis">
|
|
|
|
<li v-for="emoji in emojis" tabindex="-1" @click="complete(type, emoji.emoji)" @keydown="onKeydown">
|
|
|
|
<span v-if="emoji.isCustomEmoji" class="emoji"><img :src="$store.state.disableShowingAnimatedImages ? getStaticImageUrl(emoji.url) : emoji.url" :alt="emoji.emoji"/></span>
|
|
|
|
<span v-else-if="!$store.state.useOsNativeEmojis" class="emoji"><img :src="emoji.url" :alt="emoji.emoji"/></span>
|
|
|
|
<span v-else class="emoji">{{ emoji.emoji }}</span>
|
2019-06-10 14:09:36 +00:00
|
|
|
<span class="name" v-html="emoji.name.replace(q, `<b>${q}</b>`)"></span>
|
2021-11-19 10:36:12 +00:00
|
|
|
<span v-if="emoji.aliasOf" class="alias">({{ emoji.aliasOf }})</span>
|
2018-02-24 16:55:49 +00:00
|
|
|
</li>
|
|
|
|
</ol>
|
2021-11-19 10:36:12 +00:00
|
|
|
<ol v-else-if="mfmTags.length > 0" ref="suggests" class="mfmTags">
|
|
|
|
<li v-for="tag in mfmTags" tabindex="-1" @click="complete(type, tag)" @keydown="onKeydown">
|
2021-09-25 17:55:11 +00:00
|
|
|
<span class="tag">{{ tag }}</span>
|
|
|
|
</li>
|
|
|
|
</ol>
|
2018-02-20 11:29:52 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-11-03 06:49:31 +00:00
|
|
|
import { defineComponent, markRaw } from 'vue';
|
2021-11-11 17:02:25 +00:00
|
|
|
import { emojilist } from '@/scripts/emojilist';
|
|
|
|
import contains from '@/scripts/contains';
|
|
|
|
import { twemojiSvgBase } from '@/scripts/twemoji-base';
|
|
|
|
import { getStaticImageUrl } from '@/scripts/get-static-image-url';
|
|
|
|
import { acct } from '@/filters/user';
|
|
|
|
import * as os from '@/os';
|
|
|
|
import { instance } from '@/instance';
|
|
|
|
import { MFM_TAGS } from '@/scripts/mfm-tags';
|
2018-02-20 11:29:52 +00:00
|
|
|
|
2018-11-01 12:28:39 +00:00
|
|
|
type EmojiDef = {
|
|
|
|
emoji: string;
|
|
|
|
name: string;
|
|
|
|
aliasOf?: string;
|
|
|
|
url?: string;
|
2018-11-05 10:20:35 +00:00
|
|
|
isCustomEmoji?: boolean;
|
2018-11-01 12:28:39 +00:00
|
|
|
};
|
|
|
|
|
2019-09-21 12:31:38 +00:00
|
|
|
const lib = emojilist.filter(x => x.category !== 'flags');
|
2018-04-09 09:52:29 +00:00
|
|
|
|
2018-11-06 05:09:40 +00:00
|
|
|
const char2file = (char: string) => {
|
2018-12-07 08:21:34 +00:00
|
|
|
let codes = Array.from(char).map(x => x.codePointAt(0).toString(16));
|
2018-11-06 05:09:40 +00:00
|
|
|
if (!codes.includes('200d')) codes = codes.filter(x => x != 'fe0f');
|
2018-12-07 08:21:34 +00:00
|
|
|
codes = codes.filter(x => x && x.length);
|
2018-11-06 05:09:40 +00:00
|
|
|
return codes.join('-');
|
|
|
|
};
|
|
|
|
|
2019-09-21 12:31:38 +00:00
|
|
|
const emjdb: EmojiDef[] = lib.map(x => ({
|
|
|
|
emoji: x.char,
|
|
|
|
name: x.name,
|
2018-11-05 02:19:40 +00:00
|
|
|
aliasOf: null,
|
2019-09-21 12:31:38 +00:00
|
|
|
url: `${twemojiSvgBase}/${char2file(x.char)}.svg`
|
2018-02-25 08:03:39 +00:00
|
|
|
}));
|
2018-04-09 09:52:29 +00:00
|
|
|
|
2019-09-21 12:31:38 +00:00
|
|
|
for (const x of lib) {
|
|
|
|
if (x.keywords) {
|
|
|
|
for (const k of x.keywords) {
|
2018-02-25 08:03:39 +00:00
|
|
|
emjdb.push({
|
2019-09-21 12:31:38 +00:00
|
|
|
emoji: x.char,
|
2018-02-25 08:03:39 +00:00
|
|
|
name: k,
|
2019-09-21 12:31:38 +00:00
|
|
|
aliasOf: x.name,
|
|
|
|
url: `${twemojiSvgBase}/${char2file(x.char)}.svg`
|
2018-02-25 08:03:39 +00:00
|
|
|
});
|
2018-12-11 11:36:55 +00:00
|
|
|
}
|
2018-02-25 08:03:39 +00:00
|
|
|
}
|
2018-12-11 11:36:55 +00:00
|
|
|
}
|
2018-04-09 09:52:29 +00:00
|
|
|
|
2018-02-25 08:03:39 +00:00
|
|
|
emjdb.sort((a, b) => a.name.length - b.name.length);
|
|
|
|
|
2021-08-12 03:41:57 +00:00
|
|
|
//#region Construct Emoji DB
|
|
|
|
const customEmojis = instance.emojis;
|
|
|
|
const emojiDefinitions: EmojiDef[] = [];
|
|
|
|
|
|
|
|
for (const x of customEmojis) {
|
|
|
|
emojiDefinitions.push({
|
|
|
|
name: x.name,
|
|
|
|
emoji: `:${x.name}:`,
|
|
|
|
url: x.url,
|
|
|
|
isCustomEmoji: true
|
|
|
|
});
|
|
|
|
|
|
|
|
if (x.aliases) {
|
|
|
|
for (const alias of x.aliases) {
|
|
|
|
emojiDefinitions.push({
|
|
|
|
name: alias,
|
|
|
|
aliasOf: x.name,
|
|
|
|
emoji: `:${x.name}:`,
|
|
|
|
url: x.url,
|
|
|
|
isCustomEmoji: true
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
emojiDefinitions.sort((a, b) => a.name.length - b.name.length);
|
|
|
|
|
|
|
|
const emojiDb = markRaw(emojiDefinitions.concat(emjdb));
|
|
|
|
//#endregion
|
|
|
|
|
2020-10-17 11:12:00 +00:00
|
|
|
export default defineComponent({
|
2020-01-31 22:38:40 +00:00
|
|
|
props: {
|
|
|
|
type: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
q: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
},
|
|
|
|
|
|
|
|
textarea: {
|
|
|
|
type: HTMLTextAreaElement,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
close: {
|
|
|
|
type: Function,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
x: {
|
|
|
|
type: Number,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
y: {
|
|
|
|
type: Number,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
2018-07-17 22:19:24 +00:00
|
|
|
|
2020-10-17 11:12:00 +00:00
|
|
|
emits: ['done', 'closed'],
|
|
|
|
|
2018-02-20 11:29:52 +00:00
|
|
|
data() {
|
|
|
|
return {
|
2019-06-16 07:04:27 +00:00
|
|
|
getStaticImageUrl,
|
2018-02-20 11:29:52 +00:00
|
|
|
fetching: true,
|
|
|
|
users: [],
|
2018-07-17 22:19:24 +00:00
|
|
|
hashtags: [],
|
2018-02-24 16:55:49 +00:00
|
|
|
emojis: [],
|
2020-10-31 00:43:28 +00:00
|
|
|
items: [],
|
2021-09-25 17:55:11 +00:00
|
|
|
mfmTags: [],
|
2018-02-24 16:55:49 +00:00
|
|
|
select: -1,
|
|
|
|
}
|
|
|
|
},
|
2018-07-17 22:19:24 +00:00
|
|
|
|
2018-02-24 17:57:19 +00:00
|
|
|
updated() {
|
2020-01-31 22:38:40 +00:00
|
|
|
this.setPosition();
|
2020-10-31 00:43:28 +00:00
|
|
|
this.items = (this.$refs.suggests as Element | undefined)?.children || [];
|
2018-02-24 17:57:19 +00:00
|
|
|
},
|
2018-07-17 22:19:24 +00:00
|
|
|
|
2018-02-20 11:29:52 +00:00
|
|
|
mounted() {
|
2020-01-31 22:38:40 +00:00
|
|
|
this.setPosition();
|
|
|
|
|
2018-02-20 11:29:52 +00:00
|
|
|
this.textarea.addEventListener('keydown', this.onKeydown);
|
|
|
|
|
2020-01-31 22:38:40 +00:00
|
|
|
for (const el of Array.from(document.querySelectorAll('body *'))) {
|
2018-02-20 11:29:52 +00:00
|
|
|
el.addEventListener('mousedown', this.onMousedown);
|
2018-12-11 11:36:55 +00:00
|
|
|
}
|
2018-02-20 11:29:52 +00:00
|
|
|
|
2018-02-25 09:40:39 +00:00
|
|
|
this.$nextTick(() => {
|
|
|
|
this.exec();
|
2018-02-25 08:38:16 +00:00
|
|
|
|
2018-02-25 09:40:39 +00:00
|
|
|
this.$watch('q', () => {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.exec();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2018-02-20 11:29:52 +00:00
|
|
|
},
|
2018-07-17 22:19:24 +00:00
|
|
|
|
2020-10-17 11:12:00 +00:00
|
|
|
beforeUnmount() {
|
2018-02-20 11:29:52 +00:00
|
|
|
this.textarea.removeEventListener('keydown', this.onKeydown);
|
|
|
|
|
2020-01-31 22:38:40 +00:00
|
|
|
for (const el of Array.from(document.querySelectorAll('body *'))) {
|
2018-02-20 11:29:52 +00:00
|
|
|
el.removeEventListener('mousedown', this.onMousedown);
|
2018-12-11 11:36:55 +00:00
|
|
|
}
|
2018-02-20 11:29:52 +00:00
|
|
|
},
|
2018-07-17 22:19:24 +00:00
|
|
|
|
2018-02-20 11:29:52 +00:00
|
|
|
methods: {
|
2020-10-17 11:12:00 +00:00
|
|
|
complete(type, value) {
|
|
|
|
this.$emit('done', { type, value });
|
|
|
|
this.$emit('closed');
|
2021-08-12 03:41:57 +00:00
|
|
|
|
|
|
|
if (type === 'emoji') {
|
|
|
|
let recents = this.$store.state.recentlyUsedEmojis;
|
|
|
|
recents = recents.filter((e: any) => e !== value);
|
|
|
|
recents.unshift(value);
|
|
|
|
this.$store.set('recentlyUsedEmojis', recents.splice(0, 32));
|
|
|
|
}
|
2020-10-17 11:12:00 +00:00
|
|
|
},
|
|
|
|
|
2020-01-31 22:38:40 +00:00
|
|
|
setPosition() {
|
|
|
|
if (this.x + this.$el.offsetWidth > window.innerWidth) {
|
|
|
|
this.$el.style.left = (window.innerWidth - this.$el.offsetWidth) + 'px';
|
|
|
|
} else {
|
|
|
|
this.$el.style.left = this.x + 'px';
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.y + this.$el.offsetHeight > window.innerHeight) {
|
|
|
|
this.$el.style.top = (this.y - this.$el.offsetHeight) + 'px';
|
|
|
|
this.$el.style.marginTop = '0';
|
|
|
|
} else {
|
|
|
|
this.$el.style.top = this.y + 'px';
|
|
|
|
this.$el.style.marginTop = 'calc(1em + 8px)';
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2018-02-25 08:38:16 +00:00
|
|
|
exec() {
|
2018-02-25 09:40:39 +00:00
|
|
|
this.select = -1;
|
|
|
|
if (this.$refs.suggests) {
|
2018-12-11 11:36:55 +00:00
|
|
|
for (const el of Array.from(this.items)) {
|
2018-02-25 09:40:39 +00:00
|
|
|
el.removeAttribute('data-selected');
|
2018-12-11 11:36:55 +00:00
|
|
|
}
|
2018-02-25 09:40:39 +00:00
|
|
|
}
|
|
|
|
|
2021-09-25 17:55:11 +00:00
|
|
|
if (this.type === 'user') {
|
2020-01-31 22:38:40 +00:00
|
|
|
if (this.q == null) {
|
|
|
|
this.users = [];
|
|
|
|
this.fetching = false;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-09-01 14:12:51 +00:00
|
|
|
const cacheKey = `autocomplete:user:${this.q}`;
|
2018-07-17 22:19:24 +00:00
|
|
|
const cache = sessionStorage.getItem(cacheKey);
|
2018-02-25 08:38:16 +00:00
|
|
|
if (cache) {
|
|
|
|
const users = JSON.parse(cache);
|
|
|
|
this.users = users;
|
|
|
|
this.fetching = false;
|
|
|
|
} else {
|
2020-10-17 11:12:00 +00:00
|
|
|
os.api('users/search-by-username-and-host', {
|
|
|
|
username: this.q,
|
2018-12-01 21:44:18 +00:00
|
|
|
limit: 10,
|
|
|
|
detail: false
|
2018-02-25 08:38:16 +00:00
|
|
|
}).then(users => {
|
|
|
|
this.users = users;
|
|
|
|
this.fetching = false;
|
|
|
|
|
|
|
|
// キャッシュ
|
2018-07-17 22:19:24 +00:00
|
|
|
sessionStorage.setItem(cacheKey, JSON.stringify(users));
|
|
|
|
});
|
|
|
|
}
|
2021-09-25 17:55:11 +00:00
|
|
|
} else if (this.type === 'hashtag') {
|
2018-07-20 18:15:31 +00:00
|
|
|
if (this.q == null || this.q == '') {
|
|
|
|
this.hashtags = JSON.parse(localStorage.getItem('hashtags') || '[]');
|
2018-07-17 22:19:24 +00:00
|
|
|
this.fetching = false;
|
|
|
|
} else {
|
2018-09-01 14:12:51 +00:00
|
|
|
const cacheKey = `autocomplete:hashtag:${this.q}`;
|
2018-07-20 18:15:31 +00:00
|
|
|
const cache = sessionStorage.getItem(cacheKey);
|
|
|
|
if (cache) {
|
|
|
|
const hashtags = JSON.parse(cache);
|
2018-07-17 22:19:24 +00:00
|
|
|
this.hashtags = hashtags;
|
|
|
|
this.fetching = false;
|
2018-07-20 18:15:31 +00:00
|
|
|
} else {
|
2020-10-17 11:12:00 +00:00
|
|
|
os.api('hashtags/search', {
|
2018-07-20 18:15:31 +00:00
|
|
|
query: this.q,
|
|
|
|
limit: 30
|
|
|
|
}).then(hashtags => {
|
|
|
|
this.hashtags = hashtags;
|
|
|
|
this.fetching = false;
|
|
|
|
|
|
|
|
// キャッシュ
|
|
|
|
sessionStorage.setItem(cacheKey, JSON.stringify(hashtags));
|
|
|
|
});
|
|
|
|
}
|
2018-02-25 08:38:16 +00:00
|
|
|
}
|
2021-09-25 17:55:11 +00:00
|
|
|
} else if (this.type === 'emoji') {
|
2018-11-05 17:05:16 +00:00
|
|
|
if (this.q == null || this.q == '') {
|
2021-08-12 03:41:57 +00:00
|
|
|
// 最近使った絵文字をサジェスト
|
|
|
|
this.emojis = this.$store.state.recentlyUsedEmojis.map(emoji => emojiDb.find(e => e.emoji == emoji)).filter(x => x != null);
|
2018-11-05 17:05:16 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-02-25 08:38:16 +00:00
|
|
|
const matched = [];
|
2018-11-01 02:51:49 +00:00
|
|
|
const max = 30;
|
|
|
|
|
2021-08-12 03:41:57 +00:00
|
|
|
emojiDb.some(x => {
|
2018-11-01 12:28:39 +00:00
|
|
|
if (x.name.startsWith(this.q) && !x.aliasOf && !matched.some(y => y.emoji == x.emoji)) matched.push(x);
|
2018-11-01 02:51:49 +00:00
|
|
|
return matched.length == max;
|
2018-02-25 08:38:16 +00:00
|
|
|
});
|
2018-11-01 02:51:49 +00:00
|
|
|
if (matched.length < max) {
|
2021-08-12 03:41:57 +00:00
|
|
|
emojiDb.some(x => {
|
2018-11-01 12:01:47 +00:00
|
|
|
if (x.name.startsWith(this.q) && !matched.some(y => y.emoji == x.emoji)) matched.push(x);
|
2018-11-01 02:51:49 +00:00
|
|
|
return matched.length == max;
|
2018-02-27 05:11:18 +00:00
|
|
|
});
|
|
|
|
}
|
2018-11-01 02:51:49 +00:00
|
|
|
if (matched.length < max) {
|
2021-08-12 03:41:57 +00:00
|
|
|
emojiDb.some(x => {
|
2018-11-01 12:01:47 +00:00
|
|
|
if (x.name.includes(this.q) && !matched.some(y => y.emoji == x.emoji)) matched.push(x);
|
2018-11-01 02:51:49 +00:00
|
|
|
return matched.length == max;
|
2018-02-27 05:11:18 +00:00
|
|
|
});
|
|
|
|
}
|
2018-11-01 02:51:49 +00:00
|
|
|
|
2018-02-25 08:38:16 +00:00
|
|
|
this.emojis = matched;
|
2021-09-25 17:55:11 +00:00
|
|
|
} else if (this.type === 'mfmTag') {
|
|
|
|
if (this.q == null || this.q == '') {
|
|
|
|
this.mfmTags = MFM_TAGS;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.mfmTags = MFM_TAGS.filter(tag => tag.startsWith(this.q));
|
2018-02-25 08:38:16 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2018-02-20 11:29:52 +00:00
|
|
|
onMousedown(e) {
|
|
|
|
if (!contains(this.$el, e.target) && (this.$el != e.target)) this.close();
|
|
|
|
},
|
|
|
|
|
|
|
|
onKeydown(e) {
|
|
|
|
const cancel = () => {
|
|
|
|
e.preventDefault();
|
|
|
|
e.stopPropagation();
|
|
|
|
};
|
|
|
|
|
|
|
|
switch (e.which) {
|
|
|
|
case 10: // [ENTER]
|
|
|
|
case 13: // [ENTER]
|
|
|
|
if (this.select !== -1) {
|
|
|
|
cancel();
|
2018-02-24 16:55:49 +00:00
|
|
|
(this.items[this.select] as any).click();
|
2018-02-20 11:29:52 +00:00
|
|
|
} else {
|
|
|
|
this.close();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 27: // [ESC]
|
|
|
|
cancel();
|
|
|
|
this.close();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 38: // [↑]
|
|
|
|
if (this.select !== -1) {
|
|
|
|
cancel();
|
|
|
|
this.selectPrev();
|
|
|
|
} else {
|
|
|
|
this.close();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 9: // [TAB]
|
|
|
|
case 40: // [↓]
|
|
|
|
cancel();
|
|
|
|
this.selectNext();
|
|
|
|
break;
|
2018-02-25 09:40:39 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
e.stopPropagation();
|
|
|
|
this.textarea.focus();
|
2018-02-20 11:29:52 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
selectNext() {
|
2018-02-24 16:55:49 +00:00
|
|
|
if (++this.select >= this.items.length) this.select = 0;
|
2020-10-31 00:43:28 +00:00
|
|
|
if (this.items.length === 0) this.select = -1;
|
2018-02-20 11:29:52 +00:00
|
|
|
this.applySelect();
|
|
|
|
},
|
|
|
|
|
|
|
|
selectPrev() {
|
2018-02-24 16:55:49 +00:00
|
|
|
if (--this.select < 0) this.select = this.items.length - 1;
|
2018-02-20 11:29:52 +00:00
|
|
|
this.applySelect();
|
|
|
|
},
|
|
|
|
|
|
|
|
applySelect() {
|
2018-12-11 11:36:55 +00:00
|
|
|
for (const el of Array.from(this.items)) {
|
2018-02-20 11:29:52 +00:00
|
|
|
el.removeAttribute('data-selected');
|
2018-12-11 11:36:55 +00:00
|
|
|
}
|
2018-02-20 11:29:52 +00:00
|
|
|
|
2020-10-31 00:43:28 +00:00
|
|
|
if (this.select !== -1) {
|
|
|
|
this.items[this.select].setAttribute('data-selected', 'true');
|
|
|
|
(this.items[this.select] as any).focus();
|
|
|
|
}
|
2020-01-31 22:38:40 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
chooseUser() {
|
|
|
|
this.close();
|
2020-10-17 11:12:00 +00:00
|
|
|
os.selectUser().then(user => {
|
2020-01-31 22:38:40 +00:00
|
|
|
this.complete('user', user);
|
2020-01-31 22:42:21 +00:00
|
|
|
this.textarea.focus();
|
|
|
|
});
|
2020-10-17 11:12:00 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
acct
|
2018-02-20 11:29:52 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
<style lang="scss" scoped>
|
2020-01-31 22:38:40 +00:00
|
|
|
.swhvrteh {
|
2020-01-29 19:37:25 +00:00
|
|
|
position: fixed;
|
|
|
|
z-index: 65535;
|
|
|
|
max-width: 100%;
|
|
|
|
margin-top: calc(1em + 8px);
|
2021-03-02 13:57:16 +00:00
|
|
|
overflow: hidden;
|
2020-01-29 19:37:25 +00:00
|
|
|
transition: top 0.1s ease, left 0.1s ease;
|
|
|
|
|
|
|
|
> ol {
|
|
|
|
display: block;
|
|
|
|
margin: 0;
|
|
|
|
padding: 4px 0;
|
|
|
|
max-height: 190px;
|
|
|
|
max-width: 500px;
|
|
|
|
overflow: auto;
|
|
|
|
list-style: none;
|
|
|
|
|
|
|
|
> li {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
padding: 4px 12px;
|
|
|
|
white-space: nowrap;
|
2021-03-02 13:57:16 +00:00
|
|
|
overflow: hidden;
|
2020-01-29 19:37:25 +00:00
|
|
|
font-size: 0.9em;
|
|
|
|
cursor: default;
|
|
|
|
|
|
|
|
&, * {
|
|
|
|
user-select: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
* {
|
2021-03-02 13:57:16 +00:00
|
|
|
overflow: hidden;
|
2020-01-29 19:37:25 +00:00
|
|
|
text-overflow: ellipsis;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
2020-07-04 18:49:58 +00:00
|
|
|
background: var(--X3);
|
2020-01-29 19:37:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&[data-selected='true'] {
|
|
|
|
background: var(--accent);
|
|
|
|
|
|
|
|
&, * {
|
|
|
|
color: #fff !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&:active {
|
|
|
|
background: var(--accentDarken);
|
|
|
|
|
|
|
|
&, * {
|
|
|
|
color: #fff !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .users > li {
|
|
|
|
|
|
|
|
.avatar {
|
|
|
|
min-width: 28px;
|
|
|
|
min-height: 28px;
|
|
|
|
max-width: 28px;
|
|
|
|
max-height: 28px;
|
|
|
|
margin: 0 8px 0 0;
|
|
|
|
border-radius: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.name {
|
|
|
|
margin: 0 8px 0 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .emojis > li {
|
|
|
|
|
|
|
|
.emoji {
|
|
|
|
display: inline-block;
|
|
|
|
margin: 0 4px 0 0;
|
|
|
|
width: 24px;
|
|
|
|
|
|
|
|
> img {
|
|
|
|
width: 24px;
|
|
|
|
vertical-align: bottom;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.alias {
|
|
|
|
margin: 0 0 0 8px;
|
|
|
|
}
|
|
|
|
}
|
2021-09-25 17:55:11 +00:00
|
|
|
|
|
|
|
> .mfmTags > li {
|
|
|
|
|
|
|
|
.name {
|
|
|
|
}
|
|
|
|
}
|
2020-01-29 19:37:25 +00:00
|
|
|
}
|
2018-02-20 11:29:52 +00:00
|
|
|
</style>
|