2024-01-13 08:25:11 +02:00
|
|
|
<!--
|
2024-02-12 04:37:45 +02:00
|
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
2024-01-13 08:25:11 +02:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<MkModalWindow ref="dialogEl" @close="cancel()" @closed="$emit('closed')">
|
|
|
|
<template #header>:{{ emoji.name }}:</template>
|
|
|
|
<template #default>
|
|
|
|
<MkSpacer>
|
|
|
|
<div style="display: flex; flex-direction: column; gap: 1em;">
|
|
|
|
<div :class="$style.emojiImgWrapper">
|
2024-01-17 07:29:24 +02:00
|
|
|
<MkCustomEmoji :name="emoji.name" :normal="true" :useOriginalSize="true" style="height: 100%;"></MkCustomEmoji>
|
2024-01-13 08:25:11 +02:00
|
|
|
</div>
|
2024-01-17 07:29:24 +02:00
|
|
|
<MkKeyValue :copy="`:${emoji.name}:`">
|
2024-01-13 08:25:11 +02:00
|
|
|
<template #key>{{ i18n.ts.name }}</template>
|
|
|
|
<template #value>{{ emoji.name }}</template>
|
|
|
|
</MkKeyValue>
|
|
|
|
<MkKeyValue>
|
|
|
|
<template #key>{{ i18n.ts.tags }}</template>
|
|
|
|
<template #value>
|
|
|
|
<div v-if="emoji.aliases.length === 0">{{ i18n.ts.none }}</div>
|
|
|
|
<div v-else :class="$style.aliases">
|
|
|
|
<span v-for="alias in emoji.aliases" :key="alias" :class="$style.alias">
|
|
|
|
{{ alias }}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</MkKeyValue>
|
|
|
|
<MkKeyValue>
|
|
|
|
<template #key>{{ i18n.ts.category }}</template>
|
|
|
|
<template #value>{{ emoji.category ?? i18n.ts.none }}</template>
|
|
|
|
</MkKeyValue>
|
|
|
|
<MkKeyValue>
|
|
|
|
<template #key>{{ i18n.ts.sensitive }}</template>
|
|
|
|
<template #value>{{ emoji.isSensitive ? i18n.ts.yes : i18n.ts.no }}</template>
|
|
|
|
</MkKeyValue>
|
|
|
|
<MkKeyValue>
|
|
|
|
<template #key>{{ i18n.ts.localOnly }}</template>
|
|
|
|
<template #value>{{ emoji.localOnly ? i18n.ts.yes : i18n.ts.no }}</template>
|
|
|
|
</MkKeyValue>
|
|
|
|
<MkKeyValue>
|
|
|
|
<template #key>{{ i18n.ts.license }}</template>
|
2024-01-17 07:29:24 +02:00
|
|
|
<template #value><Mfm :text="emoji.license ?? i18n.ts.none" /></template>
|
2024-01-13 08:25:11 +02:00
|
|
|
</MkKeyValue>
|
|
|
|
<MkKeyValue :copy="emoji.url">
|
|
|
|
<template #key>{{ i18n.ts.emojiUrl }}</template>
|
|
|
|
<template #value>
|
2024-01-17 07:29:24 +02:00
|
|
|
<MkLink :url="emoji.url" target="_blank">{{ emoji.url }}</MkLink>
|
2024-01-13 08:25:11 +02:00
|
|
|
</template>
|
|
|
|
</MkKeyValue>
|
|
|
|
</div>
|
|
|
|
</MkSpacer>
|
|
|
|
</template>
|
|
|
|
</MkModalWindow>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import * as Misskey from 'misskey-js';
|
|
|
|
import { defineProps, shallowRef } from 'vue';
|
|
|
|
import { i18n } from '@/i18n.js';
|
|
|
|
import MkModalWindow from '@/components/MkModalWindow.vue';
|
|
|
|
import MkKeyValue from '@/components/MkKeyValue.vue';
|
2024-01-17 07:29:24 +02:00
|
|
|
import MkLink from './MkLink.vue';
|
2024-01-13 08:25:11 +02:00
|
|
|
const props = defineProps<{
|
|
|
|
emoji: Misskey.entities.EmojiDetailed,
|
|
|
|
}>();
|
|
|
|
const emit = defineEmits<{
|
|
|
|
(ev: 'ok', cropped: Misskey.entities.DriveFile): void;
|
|
|
|
(ev: 'cancel'): void;
|
|
|
|
(ev: 'closed'): void;
|
|
|
|
}>();
|
|
|
|
const dialogEl = shallowRef<InstanceType<typeof MkModalWindow>>();
|
|
|
|
const cancel = () => {
|
|
|
|
emit('cancel');
|
|
|
|
dialogEl.value!.close();
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
.emojiImgWrapper {
|
|
|
|
max-width: 100%;
|
|
|
|
height: 40cqh;
|
|
|
|
background-image: repeating-linear-gradient(45deg, transparent, transparent 8px, var(--X5) 8px, var(--X5) 14px);
|
|
|
|
border-radius: var(--radius);
|
|
|
|
margin: auto;
|
|
|
|
overflow-y: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
.aliases {
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
gap: 3px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.alias {
|
|
|
|
display: inline-block;
|
2024-01-17 07:29:24 +02:00
|
|
|
word-break: break-all;
|
2024-01-13 08:25:11 +02:00
|
|
|
padding: 3px 10px;
|
|
|
|
background-color: var(--X5);
|
|
|
|
border: solid 1px var(--divider);
|
|
|
|
border-radius: var(--radius);
|
|
|
|
}
|
|
|
|
</style>
|