2020-01-29 20:37:25 +01:00
|
|
|
<template>
|
2022-08-15 22:28:13 +02:00
|
|
|
<div class="wrmlmaau" :class="{ collapsed, isLong }">
|
2020-01-29 20:37:25 +01:00
|
|
|
<div class="body">
|
2022-07-20 15:24:26 +02:00
|
|
|
<span v-if="note.deletedAt" style="opacity: 0.5">({{ i18n.ts.deleted }})</span>
|
2023-01-07 21:53:51 +01:00
|
|
|
<MkA v-if="note.replyId" class="reply" :to="`/notes/${note.replyId}`"><i class="ph-arrow-bend-up-left-bold ph-lg"></i></MkA>
|
2020-12-19 02:55:52 +01:00
|
|
|
<Mfm v-if="note.text" :text="note.text" :author="note.user" :i="$i" :custom-emojis="note.emojis"/>
|
2023-01-09 21:49:46 +01:00
|
|
|
<MkA v-if="note.renoteId" class="rp" :to="`/notes/${note.renoteId}`">{{ i18n.ts.quoteAttached }}: ...</MkA>
|
2020-01-29 20:37:25 +01:00
|
|
|
</div>
|
2022-08-17 09:29:41 +02:00
|
|
|
<div v-if="note.files.length > 0">
|
2022-11-16 10:29:18 +01:00
|
|
|
<summary>({{ i18n.t('withNFiles', { n: note.files.length }) }})</summary>
|
2020-10-17 13:12:00 +02:00
|
|
|
<XMediaList :media-list="note.files"/>
|
2022-08-17 09:29:41 +02:00
|
|
|
</div>
|
|
|
|
<div v-if="note.poll">
|
2022-07-20 15:24:26 +02:00
|
|
|
<summary>{{ i18n.ts.poll }}</summary>
|
2020-10-17 13:12:00 +02:00
|
|
|
<XPoll :note="note"/>
|
2022-08-17 09:29:41 +02:00
|
|
|
</div>
|
2022-08-15 22:28:13 +02:00
|
|
|
<button v-if="isLong && collapsed" class="fade _button" @click="collapsed = false">
|
2022-07-20 15:24:26 +02:00
|
|
|
<span>{{ i18n.ts.showMore }}</span>
|
2021-11-19 10:56:30 +01:00
|
|
|
</button>
|
2022-08-15 22:28:13 +02:00
|
|
|
<button v-if="isLong && !collapsed" class="showLess _button" @click="collapsed = true">
|
|
|
|
<span>{{ i18n.ts.showLess }}</span>
|
|
|
|
</button>
|
2020-01-29 20:37:25 +01:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-01-14 04:02:10 +01:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { } from 'vue';
|
2022-12-12 04:24:12 +01:00
|
|
|
import * as misskey from 'calckey-js';
|
2022-08-30 17:24:33 +02:00
|
|
|
import XMediaList from '@/components/MkMediaList.vue';
|
|
|
|
import XPoll from '@/components/MkPoll.vue';
|
2022-07-20 15:24:26 +02:00
|
|
|
import { i18n } from '@/i18n';
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2022-01-14 04:02:10 +01:00
|
|
|
const props = defineProps<{
|
|
|
|
note: misskey.entities.Note;
|
|
|
|
}>();
|
|
|
|
|
2022-08-15 22:28:13 +02:00
|
|
|
|
|
|
|
const isLong = (
|
2022-01-14 04:02:10 +01:00
|
|
|
props.note.cw == null && props.note.text != null && (
|
|
|
|
(props.note.text.split('\n').length > 9) ||
|
|
|
|
(props.note.text.length > 500)
|
2022-08-15 22:28:13 +02:00
|
|
|
)
|
|
|
|
);
|
|
|
|
const collapsed = $ref(props.note.cw == null && isLong);
|
2020-01-29 20:37:25 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.wrmlmaau {
|
|
|
|
overflow-wrap: break-word;
|
|
|
|
|
|
|
|
> .body {
|
|
|
|
> .reply {
|
|
|
|
margin-right: 6px;
|
|
|
|
color: var(--accent);
|
|
|
|
}
|
|
|
|
|
|
|
|
> .rp {
|
|
|
|
margin-left: 4px;
|
|
|
|
font-style: oblique;
|
|
|
|
color: var(--renote);
|
|
|
|
}
|
|
|
|
}
|
2021-11-19 10:56:30 +01:00
|
|
|
|
|
|
|
&.collapsed {
|
|
|
|
position: relative;
|
|
|
|
max-height: 9em;
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
> .fade {
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: 64px;
|
|
|
|
background: linear-gradient(0deg, var(--panel), var(--X15));
|
|
|
|
|
|
|
|
> span {
|
|
|
|
display: inline-block;
|
|
|
|
background: var(--panel);
|
|
|
|
padding: 6px 10px;
|
|
|
|
font-size: 0.8em;
|
|
|
|
border-radius: 999px;
|
|
|
|
box-shadow: 0 2px 6px rgb(0 0 0 / 20%);
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
> span {
|
|
|
|
background: var(--panelHighlight);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-08-15 22:28:13 +02:00
|
|
|
|
|
|
|
&.isLong {
|
|
|
|
> .showLess {
|
|
|
|
width: 100%;
|
|
|
|
margin-top: 1em;
|
|
|
|
position: sticky;
|
|
|
|
bottom: 1em;
|
|
|
|
|
|
|
|
> span {
|
|
|
|
display: inline-block;
|
|
|
|
background: var(--panel);
|
|
|
|
padding: 6px 10px;
|
|
|
|
font-size: 0.8em;
|
|
|
|
border-radius: 999px;
|
|
|
|
box-shadow: 0 0 7px 7px var(--bg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
}
|
|
|
|
</style>
|