2020-01-30 04:37:25 +09:00
|
|
|
<template>
|
2023-04-08 09:01:42 +09:00
|
|
|
<div
|
|
|
|
v-if="!muted.muted"
|
|
|
|
v-show="!isDeleted"
|
|
|
|
ref="el"
|
|
|
|
v-hotkey="keymap"
|
|
|
|
v-size="{ max: [500, 450, 350, 300] }"
|
|
|
|
class="tkcbzcuz"
|
|
|
|
:tabindex="!isDeleted ? '-1' : null"
|
|
|
|
:class="{ renote: isRenote }"
|
|
|
|
>
|
|
|
|
<MkNoteSub
|
2023-04-23 09:21:38 +09:00
|
|
|
v-if="appearNote.reply && !detailedView"
|
2023-04-08 09:01:42 +09:00
|
|
|
:note="appearNote.reply"
|
|
|
|
class="reply-to"
|
|
|
|
/>
|
2023-04-23 09:21:38 +09:00
|
|
|
<div v-if="!detailedView" class="note-context" @click="noteClick">
|
2023-04-08 09:01:42 +09:00
|
|
|
<div class="line"></div>
|
|
|
|
<div v-if="appearNote._prId_" class="info">
|
|
|
|
<i class="ph-megaphone-simple-bold ph-lg"></i>
|
|
|
|
{{ i18n.ts.promotion
|
|
|
|
}}<button class="_textButton hide" @click.stop="readPromo()">
|
|
|
|
{{ i18n.ts.hideThisNote }}
|
|
|
|
<i class="ph-x ph-bold ph-lg"></i>
|
2023-01-22 04:36:05 +09:00
|
|
|
</button>
|
|
|
|
</div>
|
2023-04-08 09:01:42 +09:00
|
|
|
<div v-if="appearNote._featuredId_" class="info">
|
|
|
|
<i class="ph-lightning ph-bold ph-lg"></i>
|
|
|
|
{{ i18n.ts.featured }}
|
2023-01-06 01:08:23 +09:00
|
|
|
</div>
|
2023-04-08 09:01:42 +09:00
|
|
|
<div v-if="pinned" class="info">
|
|
|
|
<i class="ph-push-pin ph-bold ph-lg"></i
|
|
|
|
>{{ i18n.ts.pinnedNote }}
|
|
|
|
</div>
|
|
|
|
<div v-if="isRenote" class="renote">
|
|
|
|
<i class="ph-repeat ph-bold ph-lg"></i>
|
|
|
|
<I18n :src="i18n.ts.renotedBy" tag="span">
|
|
|
|
<template #user>
|
|
|
|
<MkA
|
|
|
|
v-user-preview="note.userId"
|
|
|
|
class="name"
|
|
|
|
:to="userPage(note.user)"
|
|
|
|
@click.stop
|
|
|
|
>
|
|
|
|
<MkUserName :user="note.user" />
|
|
|
|
</MkA>
|
|
|
|
</template>
|
|
|
|
</I18n>
|
|
|
|
<div class="info">
|
|
|
|
<button
|
|
|
|
ref="renoteTime"
|
|
|
|
class="_button time"
|
|
|
|
@click.stop="showRenoteMenu()"
|
|
|
|
>
|
|
|
|
<i
|
|
|
|
v-if="isMyRenote"
|
|
|
|
class="ph-dots-three-outline ph-bold ph-lg dropdownIcon"
|
|
|
|
></i>
|
|
|
|
<MkTime :time="note.createdAt" />
|
|
|
|
</button>
|
|
|
|
<MkVisibility :note="note" />
|
|
|
|
</div>
|
2023-01-06 01:08:23 +09:00
|
|
|
</div>
|
2023-04-08 09:01:42 +09:00
|
|
|
</div>
|
|
|
|
<article
|
|
|
|
class="article"
|
|
|
|
@contextmenu.stop="onContextmenu"
|
|
|
|
@click="noteClick"
|
|
|
|
>
|
|
|
|
<div class="main">
|
|
|
|
<div class="header-container">
|
|
|
|
<MkAvatar class="avatar" :user="appearNote.user" />
|
|
|
|
<XNoteHeader
|
|
|
|
class="header"
|
|
|
|
:note="appearNote"
|
|
|
|
:mini="true"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div class="body">
|
2023-04-23 09:21:38 +09:00
|
|
|
<MkSubNoteContent
|
|
|
|
class="text"
|
|
|
|
:note="appearNote"
|
|
|
|
:detailed="true"
|
|
|
|
:detailedView="detailedView"
|
|
|
|
:parentId="appearNote.parentId"
|
|
|
|
@push="(e) => router.push(notePage(e))"
|
2023-04-29 08:28:25 +09:00
|
|
|
@focusfooter="footerEl.focus()"
|
2023-04-23 09:21:38 +09:00
|
|
|
></MkSubNoteContent>
|
2023-04-23 09:22:53 +09:00
|
|
|
<div v-if="translating || translation" class="translation">
|
2023-04-23 09:21:38 +09:00
|
|
|
<MkLoading v-if="translating" mini />
|
|
|
|
<div v-else class="translated">
|
|
|
|
<b
|
|
|
|
>{{
|
|
|
|
i18n.t("translatedFrom", {
|
|
|
|
x: translation.sourceLang,
|
|
|
|
})
|
|
|
|
}}:
|
|
|
|
</b>
|
2023-04-08 09:01:42 +09:00
|
|
|
<Mfm
|
2023-04-23 09:21:38 +09:00
|
|
|
:text="translation.text"
|
2023-04-08 09:01:42 +09:00
|
|
|
:author="appearNote.user"
|
|
|
|
:i="$i"
|
|
|
|
:custom-emojis="appearNote.emojis"
|
|
|
|
/>
|
2021-08-15 20:26:44 +09:00
|
|
|
</div>
|
2020-01-30 04:37:25 +09:00
|
|
|
</div>
|
2023-04-08 09:01:42 +09:00
|
|
|
<MkA
|
|
|
|
v-if="appearNote.channel && !inChannel"
|
|
|
|
class="channel"
|
|
|
|
:to="`/channels/${appearNote.channel.id}`"
|
|
|
|
@click.stop
|
|
|
|
><i class="ph-television ph-bold ph-lg"></i>
|
|
|
|
{{ appearNote.channel.name }}</MkA
|
|
|
|
>
|
|
|
|
</div>
|
2023-04-23 09:21:38 +09:00
|
|
|
<div v-if="detailedView" class="info">
|
|
|
|
<MkA class="created-at" :to="notePage(appearNote)">
|
2023-04-23 09:22:53 +09:00
|
|
|
<MkTime :time="appearNote.createdAt" mode="absolute" />
|
2023-04-23 09:21:38 +09:00
|
|
|
</MkA>
|
|
|
|
</div>
|
2023-04-29 08:28:25 +09:00
|
|
|
<footer ref="footerEl" class="footer" @click.stop tabindex="-1">
|
2023-04-08 09:01:42 +09:00
|
|
|
<XReactionsViewer
|
2023-04-20 11:53:28 +09:00
|
|
|
v-if="enableEmojiReactions"
|
2023-04-08 09:01:42 +09:00
|
|
|
ref="reactionsViewer"
|
|
|
|
:note="appearNote"
|
|
|
|
/>
|
|
|
|
<button
|
|
|
|
v-tooltip.noDelay.bottom="i18n.ts.reply"
|
|
|
|
class="button _button"
|
|
|
|
@click="reply()"
|
|
|
|
>
|
|
|
|
<i class="ph-arrow-u-up-left ph-bold ph-lg"></i>
|
|
|
|
<template v-if="appearNote.repliesCount > 0">
|
|
|
|
<p class="count">{{ appearNote.repliesCount }}</p>
|
|
|
|
</template>
|
2020-12-30 09:58:57 +09:00
|
|
|
</button>
|
2023-04-08 09:01:42 +09:00
|
|
|
<XRenoteButton
|
|
|
|
ref="renoteButton"
|
|
|
|
class="button"
|
|
|
|
:note="appearNote"
|
|
|
|
:count="appearNote.renoteCount"
|
|
|
|
/>
|
2023-04-20 11:53:28 +09:00
|
|
|
<XStarButtonNoEmoji
|
|
|
|
v-if="!enableEmojiReactions"
|
|
|
|
class="button"
|
|
|
|
:note="appearNote"
|
|
|
|
:count="
|
|
|
|
Object.values(appearNote.reactions).reduce(
|
|
|
|
(partialSum, val) => partialSum + val,
|
|
|
|
0
|
|
|
|
)
|
|
|
|
"
|
|
|
|
:reacted="appearNote.myReaction != null"
|
|
|
|
/>
|
2023-04-08 09:01:42 +09:00
|
|
|
<XStarButton
|
2023-04-20 11:53:28 +09:00
|
|
|
v-if="
|
|
|
|
enableEmojiReactions &&
|
|
|
|
appearNote.myReaction == null
|
|
|
|
"
|
2023-04-08 09:01:42 +09:00
|
|
|
ref="starButton"
|
|
|
|
class="button"
|
|
|
|
:note="appearNote"
|
|
|
|
/>
|
|
|
|
<button
|
2023-04-20 11:53:28 +09:00
|
|
|
v-if="
|
|
|
|
enableEmojiReactions &&
|
|
|
|
appearNote.myReaction == null
|
|
|
|
"
|
2023-04-08 09:01:42 +09:00
|
|
|
ref="reactButton"
|
|
|
|
v-tooltip.noDelay.bottom="i18n.ts.reaction"
|
|
|
|
class="button _button"
|
|
|
|
@click="react()"
|
|
|
|
>
|
|
|
|
<i class="ph-smiley ph-bold ph-lg"></i>
|
2022-08-01 17:55:24 +09:00
|
|
|
</button>
|
2023-04-08 09:01:42 +09:00
|
|
|
<button
|
2023-04-20 11:53:28 +09:00
|
|
|
v-if="
|
|
|
|
enableEmojiReactions &&
|
|
|
|
appearNote.myReaction != null
|
|
|
|
"
|
2023-04-08 09:01:42 +09:00
|
|
|
ref="reactButton"
|
|
|
|
class="button _button reacted"
|
|
|
|
@click="undoReact(appearNote)"
|
|
|
|
>
|
|
|
|
<i class="ph-minus ph-bold ph-lg"></i>
|
|
|
|
</button>
|
|
|
|
<XQuoteButton class="button" :note="appearNote" />
|
|
|
|
<button
|
|
|
|
ref="menuButton"
|
|
|
|
v-tooltip.noDelay.bottom="i18n.ts.more"
|
|
|
|
class="button _button"
|
|
|
|
@click="menu()"
|
|
|
|
>
|
|
|
|
<i class="ph-dots-three-outline ph-bold ph-lg"></i>
|
|
|
|
</button>
|
|
|
|
</footer>
|
2020-01-30 04:37:25 +09:00
|
|
|
</div>
|
2023-04-08 09:01:42 +09:00
|
|
|
</article>
|
|
|
|
</div>
|
|
|
|
<div v-else class="muted" @click="muted.muted = false">
|
|
|
|
<I18n :src="i18n.ts.userSaysSomethingReason" tag="small">
|
|
|
|
<template #name>
|
|
|
|
<MkA
|
|
|
|
v-user-preview="appearNote.userId"
|
|
|
|
class="name"
|
|
|
|
:to="userPage(appearNote.user)"
|
|
|
|
>
|
|
|
|
<MkUserName :user="appearNote.user" />
|
|
|
|
</MkA>
|
|
|
|
</template>
|
|
|
|
<template #reason>
|
|
|
|
<b class="_blur_text">{{ muted.matched.join(", ") }}</b>
|
|
|
|
</template>
|
|
|
|
</I18n>
|
|
|
|
</div>
|
2020-01-30 04:37:25 +09:00
|
|
|
</template>
|
|
|
|
|
2022-01-14 10:25:51 +09:00
|
|
|
<script lang="ts" setup>
|
2023-04-08 09:01:42 +09:00
|
|
|
import { computed, inject, onMounted, onUnmounted, reactive, ref } from "vue";
|
|
|
|
import * as mfm from "mfm-js";
|
|
|
|
import type { Ref } from "vue";
|
|
|
|
import type * as misskey from "calckey-js";
|
|
|
|
import MkNoteSub from "@/components/MkNoteSub.vue";
|
2023-04-23 09:21:38 +09:00
|
|
|
import MkSubNoteContent from "./MkSubNoteContent.vue";
|
2023-04-08 09:01:42 +09:00
|
|
|
import XNoteHeader from "@/components/MkNoteHeader.vue";
|
|
|
|
import XNoteSimple from "@/components/MkNoteSimple.vue";
|
|
|
|
import XMediaList from "@/components/MkMediaList.vue";
|
|
|
|
import XCwButton from "@/components/MkCwButton.vue";
|
|
|
|
import XPoll from "@/components/MkPoll.vue";
|
|
|
|
import XRenoteButton from "@/components/MkRenoteButton.vue";
|
|
|
|
import XReactionsViewer from "@/components/MkReactionsViewer.vue";
|
|
|
|
import XStarButton from "@/components/MkStarButton.vue";
|
2023-04-20 11:53:28 +09:00
|
|
|
import XStarButtonNoEmoji from "@/components/MkStarButtonNoEmoji.vue";
|
2023-04-08 09:01:42 +09:00
|
|
|
import XQuoteButton from "@/components/MkQuoteButton.vue";
|
|
|
|
import MkUrlPreview from "@/components/MkUrlPreview.vue";
|
|
|
|
import MkVisibility from "@/components/MkVisibility.vue";
|
|
|
|
import { pleaseLogin } from "@/scripts/please-login";
|
|
|
|
import { focusPrev, focusNext } from "@/scripts/focus";
|
|
|
|
import { getWordMute } from "@/scripts/check-word-mute";
|
|
|
|
import { useRouter } from "@/router";
|
|
|
|
import { userPage } from "@/filters/user";
|
|
|
|
import * as os from "@/os";
|
|
|
|
import { defaultStore, noteViewInterruptors } from "@/store";
|
|
|
|
import { reactionPicker } from "@/scripts/reaction-picker";
|
|
|
|
import { $i } from "@/account";
|
|
|
|
import { i18n } from "@/i18n";
|
|
|
|
import { getNoteMenu } from "@/scripts/get-note-menu";
|
|
|
|
import { useNoteCapture } from "@/scripts/use-note-capture";
|
|
|
|
import { notePage } from "@/filters/note";
|
|
|
|
import { deepClone } from "@/scripts/clone";
|
2022-08-17 15:53:47 +09:00
|
|
|
|
|
|
|
const router = useRouter();
|
2022-01-14 10:25:51 +09:00
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
note: misskey.entities.Note;
|
|
|
|
pinned?: boolean;
|
2023-04-23 09:21:38 +09:00
|
|
|
detailedView?: boolean;
|
2022-01-14 10:25:51 +09:00
|
|
|
}>();
|
|
|
|
|
2023-04-08 09:01:42 +09:00
|
|
|
const inChannel = inject("inChannel", null);
|
2022-01-14 10:25:51 +09:00
|
|
|
|
2023-05-02 18:30:05 +09:00
|
|
|
let note = $ref(props.note);
|
2023-05-02 18:32:36 +09:00
|
|
|
|
2022-03-05 01:22:57 +09:00
|
|
|
// plugin
|
|
|
|
if (noteViewInterruptors.length > 0) {
|
|
|
|
onMounted(async () => {
|
2022-11-17 09:31:07 +09:00
|
|
|
let result = deepClone(note);
|
2022-03-05 01:22:57 +09:00
|
|
|
for (const interruptor of noteViewInterruptors) {
|
|
|
|
result = await interruptor.handler(result);
|
|
|
|
}
|
|
|
|
note = result;
|
|
|
|
});
|
|
|
|
}
|
2022-02-11 21:35:28 +09:00
|
|
|
|
2023-04-08 09:01:42 +09:00
|
|
|
const isRenote =
|
2022-02-11 21:35:28 +09:00
|
|
|
note.renote != null &&
|
|
|
|
note.text == null &&
|
|
|
|
note.fileIds.length === 0 &&
|
2023-04-08 09:01:42 +09:00
|
|
|
note.poll == null;
|
2022-01-14 10:25:51 +09:00
|
|
|
|
|
|
|
const el = ref<HTMLElement>();
|
2023-05-01 05:27:27 +09:00
|
|
|
const footerEl = ref<HTMLElement>();
|
2022-01-14 10:25:51 +09:00
|
|
|
const menuButton = ref<HTMLElement>();
|
2022-10-26 12:20:41 +09:00
|
|
|
const starButton = ref<InstanceType<typeof XStarButton>>();
|
2022-01-14 10:25:51 +09:00
|
|
|
const renoteButton = ref<InstanceType<typeof XRenoteButton>>();
|
|
|
|
const renoteTime = ref<HTMLElement>();
|
|
|
|
const reactButton = ref<HTMLElement>();
|
2023-04-08 09:01:42 +09:00
|
|
|
let appearNote = $computed(() =>
|
|
|
|
isRenote ? (note.renote as misskey.entities.Note) : note
|
|
|
|
);
|
|
|
|
const isMyRenote = $i && $i.id === note.userId;
|
2022-01-14 10:25:51 +09:00
|
|
|
const showContent = ref(false);
|
|
|
|
const isDeleted = ref(false);
|
2023-01-20 11:11:27 +09:00
|
|
|
const muted = ref(getWordMute(appearNote, $i, defaultStore.state.mutedWords));
|
2022-01-14 10:25:51 +09:00
|
|
|
const translation = ref(null);
|
|
|
|
const translating = ref(false);
|
2023-04-20 11:53:28 +09:00
|
|
|
const enableEmojiReactions = defaultStore.state.enableEmojiReactions;
|
2022-01-14 10:25:51 +09:00
|
|
|
|
|
|
|
const keymap = {
|
2023-04-08 09:01:42 +09:00
|
|
|
r: () => reply(true),
|
|
|
|
"e|a|plus": () => react(true),
|
|
|
|
q: () => renoteButton.value.renote(true),
|
2023-04-29 08:06:21 +09:00
|
|
|
"up|k": focusBefore,
|
|
|
|
"down|j": focusAfter,
|
2023-04-08 09:01:42 +09:00
|
|
|
esc: blur,
|
|
|
|
"m|o": () => menu(true),
|
|
|
|
s: () => showContent.value !== showContent.value,
|
2022-01-14 10:25:51 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
useNoteCapture({
|
|
|
|
rootEl: el,
|
2022-02-11 21:35:28 +09:00
|
|
|
note: $$(appearNote),
|
2022-02-11 22:14:14 +09:00
|
|
|
isDeletedRef: isDeleted,
|
2022-01-14 10:25:51 +09:00
|
|
|
});
|
2020-10-17 20:12:00 +09:00
|
|
|
|
2022-01-14 10:25:51 +09:00
|
|
|
function reply(viaKeyboard = false): void {
|
|
|
|
pleaseLogin();
|
2023-04-08 09:01:42 +09:00
|
|
|
os.post(
|
|
|
|
{
|
|
|
|
reply: appearNote,
|
|
|
|
animation: !viaKeyboard,
|
|
|
|
},
|
|
|
|
() => {
|
|
|
|
focus();
|
|
|
|
}
|
|
|
|
);
|
2022-01-14 10:25:51 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
function react(viaKeyboard = false): void {
|
|
|
|
pleaseLogin();
|
|
|
|
blur();
|
2023-04-08 09:01:42 +09:00
|
|
|
reactionPicker.show(
|
|
|
|
reactButton.value,
|
|
|
|
(reaction) => {
|
|
|
|
os.api("notes/reactions/create", {
|
|
|
|
noteId: appearNote.id,
|
|
|
|
reaction: reaction,
|
|
|
|
});
|
|
|
|
},
|
|
|
|
() => {
|
|
|
|
focus();
|
|
|
|
}
|
|
|
|
);
|
2022-01-14 10:25:51 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
function undoReact(note): void {
|
|
|
|
const oldReaction = note.myReaction;
|
|
|
|
if (!oldReaction) return;
|
2023-04-08 09:01:42 +09:00
|
|
|
os.api("notes/reactions/delete", {
|
2022-06-05 12:26:36 +09:00
|
|
|
noteId: note.id,
|
2022-01-14 10:25:51 +09:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-04-08 09:01:42 +09:00
|
|
|
const currentClipPage = inject<Ref<misskey.entities.Clip> | null>(
|
|
|
|
"currentClipPage",
|
|
|
|
null
|
|
|
|
);
|
2022-06-18 18:27:09 +09:00
|
|
|
|
2022-01-18 21:35:57 +09:00
|
|
|
function onContextmenu(ev: MouseEvent): void {
|
2022-01-14 10:25:51 +09:00
|
|
|
const isLink = (el: HTMLElement) => {
|
2023-04-08 09:01:42 +09:00
|
|
|
if (el.tagName === "A") return true;
|
2022-01-14 10:25:51 +09:00
|
|
|
if (el.parentElement) {
|
|
|
|
return isLink(el.parentElement);
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
2022-01-14 10:25:51 +09:00
|
|
|
};
|
2022-01-18 21:35:57 +09:00
|
|
|
if (isLink(ev.target)) return;
|
2023-04-08 09:01:42 +09:00
|
|
|
if (window.getSelection().toString() !== "") return;
|
2022-01-14 10:25:51 +09:00
|
|
|
|
|
|
|
if (defaultStore.state.useReactionPickerForContextMenu) {
|
2022-01-18 21:35:57 +09:00
|
|
|
ev.preventDefault();
|
2022-01-14 10:25:51 +09:00
|
|
|
react();
|
|
|
|
} else {
|
2023-04-08 09:01:42 +09:00
|
|
|
os.contextMenu(
|
|
|
|
getNoteMenu({
|
|
|
|
note: note,
|
|
|
|
translating,
|
|
|
|
translation,
|
|
|
|
menuButton,
|
|
|
|
isDeleted,
|
|
|
|
currentClipPage,
|
|
|
|
}),
|
|
|
|
ev
|
|
|
|
).then(focus);
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
2022-01-14 10:25:51 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
function menu(viaKeyboard = false): void {
|
2023-04-08 09:01:42 +09:00
|
|
|
os.popupMenu(
|
|
|
|
getNoteMenu({
|
|
|
|
note: note,
|
|
|
|
translating,
|
|
|
|
translation,
|
|
|
|
menuButton,
|
|
|
|
isDeleted,
|
|
|
|
currentClipPage,
|
|
|
|
}),
|
|
|
|
menuButton.value,
|
|
|
|
{
|
|
|
|
viaKeyboard,
|
|
|
|
}
|
|
|
|
).then(focus);
|
2022-01-14 10:25:51 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
function showRenoteMenu(viaKeyboard = false): void {
|
|
|
|
if (!isMyRenote) return;
|
2023-04-08 09:01:42 +09:00
|
|
|
os.popupMenu(
|
|
|
|
[
|
|
|
|
{
|
|
|
|
text: i18n.ts.unrenote,
|
|
|
|
icon: "ph-trash ph-bold ph-lg",
|
|
|
|
danger: true,
|
|
|
|
action: () => {
|
|
|
|
os.api("notes/delete", {
|
|
|
|
noteId: note.id,
|
|
|
|
});
|
|
|
|
isDeleted.value = true;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
renoteTime.value,
|
|
|
|
{
|
|
|
|
viaKeyboard: viaKeyboard,
|
|
|
|
}
|
|
|
|
);
|
2022-01-14 10:25:51 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
function focus() {
|
|
|
|
el.value.focus();
|
|
|
|
}
|
|
|
|
|
|
|
|
function blur() {
|
|
|
|
el.value.blur();
|
|
|
|
}
|
|
|
|
|
|
|
|
function focusBefore() {
|
|
|
|
focusPrev(el.value);
|
|
|
|
}
|
|
|
|
|
|
|
|
function focusAfter() {
|
|
|
|
focusNext(el.value);
|
|
|
|
}
|
|
|
|
|
2023-03-20 11:31:02 +09:00
|
|
|
function noteClick(e) {
|
2023-04-23 09:21:38 +09:00
|
|
|
if (document.getSelection().type === "Range" || props.detailedView) {
|
2023-03-20 11:31:02 +09:00
|
|
|
e.stopPropagation();
|
|
|
|
} else {
|
2023-04-08 09:01:42 +09:00
|
|
|
router.push(notePage(appearNote));
|
2023-03-20 11:31:02 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-14 10:25:51 +09:00
|
|
|
function readPromo() {
|
2023-04-08 09:01:42 +09:00
|
|
|
os.api("promo/read", {
|
2022-06-05 12:26:36 +09:00
|
|
|
noteId: appearNote.id,
|
2022-01-14 10:25:51 +09:00
|
|
|
});
|
|
|
|
isDeleted.value = true;
|
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2021-02-15 17:17:19 +09:00
|
|
|
.tkcbzcuz {
|
2020-01-30 04:37:25 +09:00
|
|
|
position: relative;
|
|
|
|
transition: box-shadow 0.1s ease;
|
2021-11-28 20:07:37 +09:00
|
|
|
font-size: 1.05em;
|
2022-07-13 21:41:06 +09:00
|
|
|
overflow: clip;
|
2020-10-17 20:12:00 +09:00
|
|
|
contain: content;
|
2020-01-30 04:37:25 +09:00
|
|
|
|
2020-12-26 22:56:01 +09:00
|
|
|
// これらの指定はパフォーマンス向上には有効だが、ノートの高さは一定でないため、
|
|
|
|
// 下の方までスクロールすると上のノートの高さがここで決め打ちされたものに変化し、表示しているノートの位置が変わってしまう
|
|
|
|
// ノートがマウントされたときに自身の高さを取得し contain-intrinsic-size を設定しなおせばほぼ解決できそうだが、
|
|
|
|
// 今度はその処理自体がパフォーマンス低下の原因にならないか懸念される。また、被リアクションでも高さは変化するため、やはり多少のズレは生じる
|
|
|
|
// 一度レンダリングされた要素はブラウザがよしなにサイズを覚えておいてくれるような実装になるまで待った方が良さそう(なるのか?)
|
|
|
|
//content-visibility: auto;
|
2023-04-08 09:01:42 +09:00
|
|
|
//contain-intrinsic-size: 0 128px;
|
2020-12-26 22:56:01 +09:00
|
|
|
|
2021-10-03 02:46:58 +09:00
|
|
|
&:focus-visible {
|
2020-01-30 04:37:25 +09:00
|
|
|
outline: none;
|
2020-10-17 20:12:00 +09:00
|
|
|
|
|
|
|
&:after {
|
|
|
|
content: "";
|
|
|
|
pointer-events: none;
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
|
|
|
z-index: 10;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
|
|
|
margin: auto;
|
|
|
|
width: calc(100% - 8px);
|
|
|
|
height: calc(100% - 8px);
|
2022-07-28 02:07:52 +09:00
|
|
|
border: solid 1px var(--focus);
|
2020-10-17 20:12:00 +09:00
|
|
|
border-radius: var(--radius);
|
|
|
|
box-sizing: border-box;
|
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
|
|
|
|
2023-02-25 14:39:43 +09:00
|
|
|
& > .article > .main {
|
2023-04-08 09:01:42 +09:00
|
|
|
&:hover,
|
|
|
|
&:focus-within {
|
2023-02-25 14:39:43 +09:00
|
|
|
:deep(.footer .button) {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
|
|
|
|
2020-03-20 19:19:28 +09:00
|
|
|
> .reply-to {
|
2023-01-07 08:58:52 +09:00
|
|
|
& + .note-context {
|
|
|
|
.line::before {
|
|
|
|
content: "";
|
|
|
|
display: block;
|
2023-01-29 06:10:45 +09:00
|
|
|
margin-bottom: -10px;
|
2023-03-16 08:18:26 +09:00
|
|
|
margin-top: 16px;
|
2023-05-03 03:50:22 +09:00
|
|
|
border-left: 2px solid var(--X13);
|
2023-03-16 08:18:26 +09:00
|
|
|
margin-left: calc((var(--avatarSize) / 2) - 1px);
|
2023-01-07 08:58:52 +09:00
|
|
|
}
|
|
|
|
}
|
2020-03-20 19:19:28 +09:00
|
|
|
}
|
|
|
|
|
2023-01-07 08:58:52 +09:00
|
|
|
.note-context {
|
|
|
|
padding: 0 32px 0 32px;
|
2020-01-30 04:37:25 +09:00
|
|
|
display: flex;
|
2023-01-07 08:58:52 +09:00
|
|
|
&:first-child {
|
2023-01-08 16:30:42 +09:00
|
|
|
margin-top: 20px;
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
2023-01-07 08:58:52 +09:00
|
|
|
> :not(.line) {
|
|
|
|
width: 0;
|
|
|
|
flex-grow: 1;
|
|
|
|
position: relative;
|
2023-01-07 15:43:52 +09:00
|
|
|
line-height: 28px;
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
2023-01-07 08:58:52 +09:00
|
|
|
> .line {
|
2023-01-08 05:53:51 +09:00
|
|
|
width: var(--avatarSize);
|
2023-01-07 08:58:52 +09:00
|
|
|
display: flex;
|
|
|
|
margin-right: 14px;
|
|
|
|
margin-top: 0;
|
|
|
|
flex-grow: 0;
|
|
|
|
}
|
2023-04-08 09:01:42 +09:00
|
|
|
|
2023-01-07 08:58:52 +09:00
|
|
|
> div > i {
|
2023-04-08 09:01:42 +09:00
|
|
|
margin-left: -0.5px;
|
2023-01-07 08:58:52 +09:00
|
|
|
}
|
|
|
|
> .info {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
font-size: 90%;
|
|
|
|
white-space: pre;
|
|
|
|
color: #f6c177;
|
|
|
|
|
|
|
|
> i {
|
|
|
|
margin-right: 4px;
|
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
|
2023-01-07 08:58:52 +09:00
|
|
|
> .hide {
|
|
|
|
margin-left: auto;
|
|
|
|
color: inherit;
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-07 08:58:52 +09:00
|
|
|
> .renote {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
white-space: pre;
|
|
|
|
color: var(--renote);
|
2023-04-03 06:39:25 +09:00
|
|
|
cursor: pointer;
|
2023-01-07 08:58:52 +09:00
|
|
|
|
|
|
|
> i {
|
|
|
|
margin-right: 4px;
|
|
|
|
}
|
2020-05-15 20:39:11 +09:00
|
|
|
|
2023-01-07 08:58:52 +09:00
|
|
|
> span {
|
|
|
|
overflow: hidden;
|
|
|
|
flex-shrink: 1;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
white-space: nowrap;
|
2023-04-08 09:01:42 +09:00
|
|
|
|
2023-01-07 08:58:52 +09:00
|
|
|
> .name {
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .info {
|
|
|
|
margin-left: auto;
|
|
|
|
font-size: 0.9em;
|
2023-01-07 15:43:52 +09:00
|
|
|
display: flex;
|
2023-01-07 08:58:52 +09:00
|
|
|
|
|
|
|
> .time {
|
|
|
|
flex-shrink: 0;
|
|
|
|
color: inherit;
|
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
> .dropdownIcon {
|
|
|
|
margin-right: 4px;
|
|
|
|
}
|
2020-05-15 20:39:11 +09:00
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .article {
|
2023-03-26 12:33:44 +09:00
|
|
|
padding: 4px 32px 10px;
|
2022-11-25 06:55:23 +09:00
|
|
|
cursor: pointer;
|
2022-11-27 14:37:23 +09:00
|
|
|
|
2022-12-02 15:39:50 +09:00
|
|
|
@media (pointer: coarse) {
|
|
|
|
cursor: default;
|
|
|
|
}
|
|
|
|
|
2023-01-06 01:08:23 +09:00
|
|
|
.header-container {
|
|
|
|
display: flex;
|
|
|
|
> .avatar {
|
|
|
|
flex-shrink: 0;
|
|
|
|
display: block;
|
2023-01-07 08:58:52 +09:00
|
|
|
margin: 0 14px 0 0;
|
2023-01-08 05:53:51 +09:00
|
|
|
width: var(--avatarSize);
|
|
|
|
height: var(--avatarSize);
|
2023-01-06 01:08:23 +09:00
|
|
|
position: relative;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
}
|
|
|
|
> .header {
|
|
|
|
width: 0;
|
|
|
|
flex-grow: 1;
|
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
|
|
|
> .main {
|
|
|
|
flex: 1;
|
|
|
|
min-width: 0;
|
2023-01-04 03:16:02 +09:00
|
|
|
|
2020-01-30 04:37:25 +09:00
|
|
|
> .body {
|
2023-04-08 09:01:42 +09:00
|
|
|
margin-top: 0.7em;
|
2020-01-30 04:37:25 +09:00
|
|
|
|
|
|
|
> .content {
|
2023-04-23 09:21:38 +09:00
|
|
|
> .translation {
|
|
|
|
border: solid 0.5px var(--divider);
|
|
|
|
border-radius: var(--radius);
|
|
|
|
padding: 12px;
|
2020-01-30 04:37:25 +09:00
|
|
|
margin-top: 8px;
|
|
|
|
}
|
2023-04-23 09:21:38 +09:00
|
|
|
}
|
|
|
|
> .renote {
|
|
|
|
padding-top: 8px;
|
|
|
|
> * {
|
|
|
|
padding: 16px;
|
|
|
|
border: solid 1px var(--renote);
|
|
|
|
border-radius: 8px;
|
|
|
|
transition: background 0.2s;
|
|
|
|
&:hover,
|
|
|
|
&:focus-within {
|
|
|
|
background-color: var(--panelHighlight);
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-08-18 22:44:21 +09:00
|
|
|
|
|
|
|
> .channel {
|
|
|
|
opacity: 0.7;
|
|
|
|
font-size: 80%;
|
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
2023-04-23 09:21:38 +09:00
|
|
|
> .info {
|
|
|
|
margin-block: 16px;
|
|
|
|
opacity: 0.7;
|
|
|
|
font-size: 0.9em;
|
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
> .footer {
|
2023-03-21 05:26:05 +09:00
|
|
|
position: relative;
|
|
|
|
z-index: 2;
|
2023-01-10 09:55:40 +09:00
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
2023-03-21 05:26:05 +09:00
|
|
|
pointer-events: none; // Allow clicking anything w/out pointer-events: all; to open post
|
2023-04-23 09:22:53 +09:00
|
|
|
margin-top: 0.4em;
|
2020-01-30 04:37:25 +09:00
|
|
|
> .button {
|
|
|
|
margin: 0;
|
|
|
|
padding: 8px;
|
|
|
|
opacity: 0.7;
|
2023-01-10 09:55:40 +09:00
|
|
|
flex-grow: 1;
|
|
|
|
max-width: 3.5em;
|
2023-02-03 09:25:42 +09:00
|
|
|
width: max-content;
|
2023-01-10 09:55:40 +09:00
|
|
|
min-width: max-content;
|
2023-03-21 05:26:05 +09:00
|
|
|
pointer-events: all;
|
2023-04-08 09:01:42 +09:00
|
|
|
transition: opacity 0.2s;
|
2023-01-10 11:53:39 +09:00
|
|
|
&:first-of-type {
|
2023-04-08 09:01:42 +09:00
|
|
|
margin-left: -0.5em;
|
2023-01-10 11:53:39 +09:00
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
&:hover {
|
2020-02-15 01:18:48 +09:00
|
|
|
color: var(--fgHighlighted);
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
> .count {
|
|
|
|
display: inline;
|
|
|
|
margin: 0 0 0 8px;
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.reacted {
|
|
|
|
color: var(--accent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-03-21 12:32:40 +09:00
|
|
|
|
|
|
|
> .reply {
|
2021-04-10 12:40:50 +09:00
|
|
|
border-top: solid 0.5px var(--divider);
|
2020-03-21 12:32:40 +09:00
|
|
|
}
|
2020-07-11 10:13:11 +09:00
|
|
|
|
|
|
|
&.max-width_500px {
|
|
|
|
font-size: 0.9em;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.max-width_450px {
|
2023-01-08 05:53:51 +09:00
|
|
|
--avatarSize: 46px;
|
2023-02-04 05:44:40 +09:00
|
|
|
padding-top: 6px;
|
2023-01-07 08:58:52 +09:00
|
|
|
> .note-context {
|
|
|
|
padding-inline: 16px;
|
2023-03-26 12:33:44 +09:00
|
|
|
margin-top: 8px;
|
2023-01-07 12:15:32 +09:00
|
|
|
> :not(.line) {
|
2023-03-26 12:33:44 +09:00
|
|
|
margin-top: 0px;
|
2023-02-04 05:44:40 +09:00
|
|
|
}
|
|
|
|
> .line {
|
|
|
|
margin-right: 10px;
|
2023-04-03 06:39:25 +09:00
|
|
|
&::before {
|
|
|
|
margin-top: 8px;
|
|
|
|
}
|
2023-01-07 12:15:32 +09:00
|
|
|
}
|
2020-07-11 10:13:11 +09:00
|
|
|
}
|
|
|
|
> .article {
|
2023-03-26 12:33:44 +09:00
|
|
|
padding: 4px 16px 8px;
|
2023-01-07 08:58:52 +09:00
|
|
|
> .main > .header-container > .avatar {
|
|
|
|
margin-right: 10px;
|
2022-11-23 04:01:25 +09:00
|
|
|
// top: calc(14px + var(--stickyTop, 0px));
|
2020-07-11 10:13:11 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.max-width_300px {
|
2023-01-08 05:53:51 +09:00
|
|
|
--avatarSize: 40px;
|
2020-07-11 10:13:11 +09:00
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
2020-07-27 13:34:20 +09:00
|
|
|
|
|
|
|
.muted {
|
|
|
|
padding: 8px;
|
|
|
|
text-align: center;
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
</style>
|