2023-07-27 08:31:52 +03:00
|
|
|
<!--
|
2024-02-13 17:59:27 +02:00
|
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-27 08:31:52 +03:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2021-10-15 19:34:23 +03:00
|
|
|
<template>
|
2023-01-15 04:22:58 +02:00
|
|
|
<div :class="$style.root">
|
2023-10-22 09:51:48 +03:00
|
|
|
<MkAvatar :class="$style.avatar" :user="user" link preview/>
|
2023-01-15 04:22:58 +02:00
|
|
|
<div :class="$style.main">
|
|
|
|
<div :class="$style.header">
|
2023-10-22 09:51:48 +03:00
|
|
|
<MkUserName :user="user" :nowrap="true"/>
|
2021-10-15 19:34:23 +03:00
|
|
|
</div>
|
2023-01-15 04:22:58 +02:00
|
|
|
<div>
|
2023-11-30 06:49:31 +02:00
|
|
|
<p v-if="useCw" :class="$style.cw">
|
2024-01-30 12:53:53 +02:00
|
|
|
<Mfm v-if="cw != null && cw != ''" :text="cw" :author="user" :nyaize="'respect'" :i="user" style="margin-right: 8px;"/>
|
2023-11-30 06:49:31 +02:00
|
|
|
<MkCwButton v-model="showContent" :text="text.trim()" :files="files" :poll="poll" style="margin: 4px 0;"/>
|
|
|
|
</p>
|
|
|
|
<div v-show="!useCw || showContent">
|
2023-11-15 04:09:54 +02:00
|
|
|
<Mfm :text="text.trim()" :author="user" :nyaize="'respect'" :i="user"/>
|
2021-10-15 19:34:23 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-01-14 03:29:18 +02:00
|
|
|
<script lang="ts" setup>
|
2023-11-30 06:49:31 +02:00
|
|
|
import { ref } from 'vue';
|
2023-10-22 09:51:48 +03:00
|
|
|
import * as Misskey from 'misskey-js';
|
2024-01-30 12:53:53 +02:00
|
|
|
import type { PollEditorModelValue } from '@/components/MkPollEditor.vue';
|
2023-11-30 06:49:31 +02:00
|
|
|
import MkCwButton from '@/components/MkCwButton.vue';
|
|
|
|
|
|
|
|
const showContent = ref(false);
|
2021-10-15 19:34:23 +03:00
|
|
|
|
2022-01-14 03:29:18 +02:00
|
|
|
const props = defineProps<{
|
|
|
|
text: string;
|
2023-11-30 06:49:31 +02:00
|
|
|
files: Misskey.entities.DriveFile[];
|
2024-01-30 12:53:53 +02:00
|
|
|
poll?: PollEditorModelValue;
|
2023-11-30 06:49:31 +02:00
|
|
|
useCw: boolean;
|
|
|
|
cw: string | null;
|
2023-10-22 09:51:48 +03:00
|
|
|
user: Misskey.entities.User;
|
2022-01-14 03:29:18 +02:00
|
|
|
}>();
|
2021-10-15 19:34:23 +03:00
|
|
|
</script>
|
|
|
|
|
2023-01-15 04:22:58 +02:00
|
|
|
<style lang="scss" module>
|
|
|
|
.root {
|
2021-10-15 19:34:23 +03:00
|
|
|
display: flex;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
2022-07-13 15:41:06 +03:00
|
|
|
overflow: clip;
|
2021-10-15 19:34:23 +03:00
|
|
|
font-size: 0.95em;
|
2023-01-15 04:22:58 +02:00
|
|
|
}
|
2021-10-15 19:34:23 +03:00
|
|
|
|
2023-01-15 04:22:58 +02:00
|
|
|
.avatar {
|
|
|
|
flex-shrink: 0 !important;
|
|
|
|
display: block !important;
|
|
|
|
margin: 0 10px 0 0 !important;
|
|
|
|
width: 40px !important;
|
|
|
|
height: 40px !important;
|
|
|
|
border-radius: 8px !important;
|
|
|
|
pointer-events: none !important;
|
|
|
|
}
|
2021-10-15 19:34:23 +03:00
|
|
|
|
2023-01-15 04:22:58 +02:00
|
|
|
.main {
|
|
|
|
flex: 1;
|
|
|
|
min-width: 0;
|
|
|
|
}
|
2021-10-15 19:34:23 +03:00
|
|
|
|
2023-11-30 06:49:31 +02:00
|
|
|
.cw {
|
|
|
|
cursor: default;
|
|
|
|
display: block;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
overflow-wrap: break-word;
|
|
|
|
}
|
|
|
|
|
2023-01-15 04:22:58 +02:00
|
|
|
.header {
|
|
|
|
margin-bottom: 2px;
|
|
|
|
font-weight: bold;
|
2023-04-05 08:30:03 +03:00
|
|
|
width: 100%;
|
|
|
|
overflow: clip;
|
|
|
|
text-overflow: ellipsis;
|
2021-10-15 19:34:23 +03:00
|
|
|
}
|
2022-12-26 01:40:13 +02:00
|
|
|
|
|
|
|
@container (min-width: 350px) {
|
2023-01-15 04:22:58 +02:00
|
|
|
.avatar {
|
|
|
|
margin: 0 10px 0 0 !important;
|
|
|
|
width: 44px !important;
|
|
|
|
height: 44px !important;
|
2022-12-26 01:40:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@container (min-width: 500px) {
|
2023-01-15 04:22:58 +02:00
|
|
|
.avatar {
|
|
|
|
margin: 0 12px 0 0 !important;
|
|
|
|
width: 48px !important;
|
|
|
|
height: 48px !important;
|
2022-12-26 01:40:13 +02:00
|
|
|
}
|
|
|
|
}
|
2021-10-15 19:34:23 +03:00
|
|
|
</style>
|