Revert "Merge pull request 'Add support for CW boosting' (#10047) from supakaity/hajkey:hk/cw-boost into develop"
This reverts commit5e86bafb24
, reversing changes made tod1977fc320
.
This commit is contained in:
parent
d0d49696e2
commit
988b530745
@ -886,7 +886,6 @@ global: "Global"
|
|||||||
recommended: "Recommended"
|
recommended: "Recommended"
|
||||||
squareAvatars: "Display squared avatars"
|
squareAvatars: "Display squared avatars"
|
||||||
seperateRenoteQuote: "Separate boost and quote buttons"
|
seperateRenoteQuote: "Separate boost and quote buttons"
|
||||||
highlightCw: "Highlight content warned posts"
|
|
||||||
sent: "Sent"
|
sent: "Sent"
|
||||||
received: "Received"
|
received: "Received"
|
||||||
searchResult: "Search results"
|
searchResult: "Search results"
|
||||||
|
@ -606,7 +606,8 @@ export default async (
|
|||||||
});
|
});
|
||||||
|
|
||||||
async function renderNoteOrRenoteActivity(data: Option, note: Note) {
|
async function renderNoteOrRenoteActivity(data: Option, note: Note) {
|
||||||
if (data.localOnly || note.visibility !== "hidden") return null;
|
if (data.localOnly ||
|
||||||
|
note.visibility !== "hidden") return null;
|
||||||
|
|
||||||
const content =
|
const content =
|
||||||
data.renote &&
|
data.renote &&
|
||||||
|
@ -144,7 +144,10 @@ export default async (
|
|||||||
});
|
});
|
||||||
|
|
||||||
//#region deliver
|
//#region deliver
|
||||||
if (Users.isLocalUser(user) && !note.localOnly) {
|
if (
|
||||||
|
Users.isLocalUser(user) &&
|
||||||
|
!note.localOnly
|
||||||
|
) {
|
||||||
const content = renderActivity(await renderLike(record, note));
|
const content = renderActivity(await renderLike(record, note));
|
||||||
const dm = new DeliverManager(user, content);
|
const dm = new DeliverManager(user, content);
|
||||||
if (note.userHost !== null) {
|
if (note.userHost !== null) {
|
||||||
|
@ -13,12 +13,6 @@
|
|||||||
>
|
>
|
||||||
<template v-for="(item, i) in items2">
|
<template v-for="(item, i) in items2">
|
||||||
<div v-if="item === null" class="divider"></div>
|
<div v-if="item === null" class="divider"></div>
|
||||||
<template
|
|
||||||
v-else-if="
|
|
||||||
item.hidden ||
|
|
||||||
(item.visible !== undefined && !item.visible)
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
<span v-else-if="item.type === 'label'" class="label item">
|
<span v-else-if="item.type === 'label'" class="label item">
|
||||||
<span :style="item.textStyle || ''">{{
|
<span :style="item.textStyle || ''">{{
|
||||||
item.text
|
item.text
|
||||||
@ -27,7 +21,6 @@
|
|||||||
<span
|
<span
|
||||||
v-else-if="item.type === 'pending'"
|
v-else-if="item.type === 'pending'"
|
||||||
class="pending item"
|
class="pending item"
|
||||||
:class="classMap(item.classes)"
|
|
||||||
>
|
>
|
||||||
<span><MkEllipsis /></span>
|
<span><MkEllipsis /></span>
|
||||||
</span>
|
</span>
|
||||||
@ -35,7 +28,6 @@
|
|||||||
v-else-if="item.type === 'link'"
|
v-else-if="item.type === 'link'"
|
||||||
:to="item.to"
|
:to="item.to"
|
||||||
class="_button item"
|
class="_button item"
|
||||||
:class="classMap(item.classes)"
|
|
||||||
@click.passive="close(true)"
|
@click.passive="close(true)"
|
||||||
@mouseenter.passive="onItemMouseEnter(item)"
|
@mouseenter.passive="onItemMouseEnter(item)"
|
||||||
@mouseleave.passive="onItemMouseLeave(item)"
|
@mouseleave.passive="onItemMouseLeave(item)"
|
||||||
@ -64,7 +56,6 @@
|
|||||||
:target="item.target"
|
:target="item.target"
|
||||||
:download="item.download"
|
:download="item.download"
|
||||||
class="_button item"
|
class="_button item"
|
||||||
:class="classMap(item.classes)"
|
|
||||||
@click="close(true)"
|
@click="close(true)"
|
||||||
@mouseenter.passive="onItemMouseEnter(item)"
|
@mouseenter.passive="onItemMouseEnter(item)"
|
||||||
@mouseleave.passive="onItemMouseLeave(item)"
|
@mouseleave.passive="onItemMouseLeave(item)"
|
||||||
@ -82,12 +73,9 @@
|
|||||||
></span>
|
></span>
|
||||||
</a>
|
</a>
|
||||||
<button
|
<button
|
||||||
v-else-if="item.type === 'user'"
|
v-else-if="item.type === 'user' && !items.hidden"
|
||||||
class="_button item"
|
class="_button item"
|
||||||
:class="{
|
:class="{ active: item.active }"
|
||||||
active: item.active,
|
|
||||||
...classMap(item.classes),
|
|
||||||
}"
|
|
||||||
:disabled="item.active"
|
:disabled="item.active"
|
||||||
@click="clicked(item.action, $event)"
|
@click="clicked(item.action, $event)"
|
||||||
@mouseenter.passive="onItemMouseEnter(item)"
|
@mouseenter.passive="onItemMouseEnter(item)"
|
||||||
@ -105,7 +93,6 @@
|
|||||||
<span
|
<span
|
||||||
v-else-if="item.type === 'switch'"
|
v-else-if="item.type === 'switch'"
|
||||||
class="item"
|
class="item"
|
||||||
:class="classMap(item.classes)"
|
|
||||||
@mouseenter.passive="onItemMouseEnter(item)"
|
@mouseenter.passive="onItemMouseEnter(item)"
|
||||||
@mouseleave.passive="onItemMouseLeave(item)"
|
@mouseleave.passive="onItemMouseLeave(item)"
|
||||||
>
|
>
|
||||||
@ -117,29 +104,10 @@
|
|||||||
>{{ item.text }}</FormSwitch
|
>{{ item.text }}</FormSwitch
|
||||||
>
|
>
|
||||||
</span>
|
</span>
|
||||||
<span
|
|
||||||
v-else-if="item.type === 'input'"
|
|
||||||
:tabindex="i"
|
|
||||||
class="item"
|
|
||||||
:class="classMap(item.classes)"
|
|
||||||
@mouseenter.passive="onItemMouseEnter(item)"
|
|
||||||
@mouseleave.passive="onItemMouseLeave(item)"
|
|
||||||
>
|
|
||||||
<FormInput
|
|
||||||
v-model="item.ref"
|
|
||||||
:disabled="item.disabled"
|
|
||||||
class="form-input"
|
|
||||||
:required="item.required"
|
|
||||||
:placeholder="item.placeholder"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
<button
|
<button
|
||||||
v-else-if="item.type === 'parent'"
|
v-else-if="item.type === 'parent'"
|
||||||
class="_button item parent"
|
class="_button item parent"
|
||||||
:class="{
|
:class="{ childShowing: childShowingItem === item }"
|
||||||
childShowing: childShowingItem === item,
|
|
||||||
...classMap(item.classes),
|
|
||||||
}"
|
|
||||||
@mouseenter="showChildren(item, $event)"
|
@mouseenter="showChildren(item, $event)"
|
||||||
@click="showChildren(item, $event)"
|
@click="showChildren(item, $event)"
|
||||||
>
|
>
|
||||||
@ -158,13 +126,9 @@
|
|||||||
></span>
|
></span>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
v-else
|
v-else-if="!item.hidden"
|
||||||
class="_button item"
|
class="_button item"
|
||||||
:class="{
|
:class="{ danger: item.danger, active: item.active }"
|
||||||
danger: item.danger,
|
|
||||||
active: item.active,
|
|
||||||
...classMap(item.classes),
|
|
||||||
}"
|
|
||||||
:disabled="item.active"
|
:disabled="item.active"
|
||||||
@click="clicked(item.action, $event)"
|
@click="clicked(item.action, $event)"
|
||||||
@mouseenter.passive="onItemMouseEnter(item)"
|
@mouseenter.passive="onItemMouseEnter(item)"
|
||||||
@ -222,14 +186,7 @@ import {
|
|||||||
} from "vue";
|
} from "vue";
|
||||||
import { focusPrev, focusNext } from "@/scripts/focus";
|
import { focusPrev, focusNext } from "@/scripts/focus";
|
||||||
import FormSwitch from "@/components/form/switch.vue";
|
import FormSwitch from "@/components/form/switch.vue";
|
||||||
import FormInput from "@/components/form/input.vue";
|
import { MenuItem, InnerMenuItem, MenuPending, MenuAction } from "@/types/menu";
|
||||||
import {
|
|
||||||
MenuItem,
|
|
||||||
InnerMenuItem,
|
|
||||||
MenuPending,
|
|
||||||
MenuAction,
|
|
||||||
MenuClasses,
|
|
||||||
} from "@/types/menu";
|
|
||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
import { FocusTrap } from "focus-trap-vue";
|
import { FocusTrap } from "focus-trap-vue";
|
||||||
@ -287,18 +244,6 @@ watch(
|
|||||||
let childMenu = $ref<MenuItem[] | null>();
|
let childMenu = $ref<MenuItem[] | null>();
|
||||||
let childTarget = $ref<HTMLElement | null>();
|
let childTarget = $ref<HTMLElement | null>();
|
||||||
|
|
||||||
function classMap(classes?: MenuClasses) {
|
|
||||||
if (!classes) return {};
|
|
||||||
|
|
||||||
return (Array.isArray(classes) ? classes : classes.value).reduce(
|
|
||||||
(acc, cls) => {
|
|
||||||
acc[cls] = true;
|
|
||||||
return acc;
|
|
||||||
},
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function closeChild() {
|
function closeChild() {
|
||||||
childMenu = null;
|
childMenu = null;
|
||||||
childShowingItem = null;
|
childShowingItem = null;
|
||||||
|
@ -79,7 +79,7 @@
|
|||||||
<div class="body">
|
<div class="body">
|
||||||
<MkSubNoteContent
|
<MkSubNoteContent
|
||||||
class="text"
|
class="text"
|
||||||
:note="note"
|
:note="appearNote"
|
||||||
:detailed="true"
|
:detailed="true"
|
||||||
:detailedView="detailedView"
|
:detailedView="detailedView"
|
||||||
:parentId="appearNote.parentId"
|
:parentId="appearNote.parentId"
|
||||||
@ -139,7 +139,6 @@
|
|||||||
class="button"
|
class="button"
|
||||||
:note="appearNote"
|
:note="appearNote"
|
||||||
:count="appearNote.renoteCount"
|
:count="appearNote.renoteCount"
|
||||||
:renoteCw="note.cw"
|
|
||||||
/>
|
/>
|
||||||
<XStarButtonNoEmoji
|
<XStarButtonNoEmoji
|
||||||
v-if="!enableEmojiReactions"
|
v-if="!enableEmojiReactions"
|
||||||
|
@ -69,7 +69,6 @@
|
|||||||
class="button"
|
class="button"
|
||||||
:note="appearNote"
|
:note="appearNote"
|
||||||
:count="appearNote.renoteCount"
|
:count="appearNote.renoteCount"
|
||||||
:renoteCw="note.cw"
|
|
||||||
/>
|
/>
|
||||||
<XStarButtonNoEmoji
|
<XStarButtonNoEmoji
|
||||||
v-if="!enableEmojiReactions"
|
v-if="!enableEmojiReactions"
|
||||||
|
@ -17,19 +17,17 @@
|
|||||||
:max-height="maxHeight"
|
:max-height="maxHeight"
|
||||||
:as-drawer="type === 'drawer'"
|
:as-drawer="type === 'drawer'"
|
||||||
class="sfhdhdhq"
|
class="sfhdhdhq"
|
||||||
:class="{
|
:class="{ drawer: type === 'drawer' }"
|
||||||
drawer: type === 'drawer',
|
|
||||||
...classMap(classes),
|
|
||||||
}"
|
|
||||||
@close="modal.close()"
|
@close="modal.close()"
|
||||||
/>
|
/>
|
||||||
</MkModal>
|
</MkModal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import {} from "vue";
|
||||||
import MkModal from "./MkModal.vue";
|
import MkModal from "./MkModal.vue";
|
||||||
import MkMenu from "./MkMenu.vue";
|
import MkMenu from "./MkMenu.vue";
|
||||||
import { MenuClasses, MenuItem } from "@/types/menu";
|
import { MenuItem } from "@/types/menu";
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
items: MenuItem[];
|
items: MenuItem[];
|
||||||
@ -37,7 +35,6 @@ defineProps<{
|
|||||||
width?: number;
|
width?: number;
|
||||||
viaKeyboard?: boolean;
|
viaKeyboard?: boolean;
|
||||||
src?: any;
|
src?: any;
|
||||||
classes?: MenuClasses;
|
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
@ -45,18 +42,6 @@ const emit = defineEmits<{
|
|||||||
}>();
|
}>();
|
||||||
|
|
||||||
let modal = $ref<InstanceType<typeof MkModal>>();
|
let modal = $ref<InstanceType<typeof MkModal>>();
|
||||||
|
|
||||||
function classMap(classes?: MenuClasses) {
|
|
||||||
if (!classes) return {};
|
|
||||||
|
|
||||||
return (Array.isArray(classes) ? classes : classes.value).reduce(
|
|
||||||
(acc, cls) => {
|
|
||||||
acc[cls] = true;
|
|
||||||
return acc;
|
|
||||||
},
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
ref="buttonRef"
|
ref="buttonRef"
|
||||||
v-tooltip.noDelay.bottom="i18n.ts.renote"
|
v-tooltip.noDelay.bottom="i18n.ts.renote"
|
||||||
class="eddddedb _button canRenote"
|
class="eddddedb _button canRenote"
|
||||||
:class="{ addCw }"
|
|
||||||
@click="renote(false, $event)"
|
@click="renote(false, $event)"
|
||||||
>
|
>
|
||||||
<i class="ph-repeat ph-bold ph-lg"></i>
|
<i class="ph-repeat ph-bold ph-lg"></i>
|
||||||
@ -26,27 +25,20 @@ import { $i } from "@/account";
|
|||||||
import { useTooltip } from "@/scripts/use-tooltip";
|
import { useTooltip } from "@/scripts/use-tooltip";
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
import { defaultStore } from "@/store";
|
import { defaultStore } from "@/store";
|
||||||
import { MenuItem } from "@/types/menu";
|
|
||||||
import { add } from "date-fns";
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
note: misskey.entities.Note;
|
note: misskey.entities.Note;
|
||||||
count: number;
|
count: number;
|
||||||
renoteCw?: string | null;
|
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const buttonRef = ref<HTMLElement>();
|
const buttonRef = ref<HTMLElement>();
|
||||||
const addCw = ref<boolean>(!!props.renoteCw);
|
|
||||||
const cwInput = ref<string>(props.renoteCw ?? "");
|
|
||||||
|
|
||||||
const canRenote = computed(
|
const canRenote = computed(
|
||||||
() =>
|
() =>
|
||||||
["public", "home", "hidden"].includes(props.note.visibility) ||
|
["public", "home","hidden"].includes(props.note.visibility) ||
|
||||||
props.note.userId === $i.id
|
props.note.userId === $i.id
|
||||||
);
|
);
|
||||||
|
|
||||||
const getCw = () => (addCw.value ? cwInput.value : props.note.cw ?? undefined);
|
|
||||||
|
|
||||||
useTooltip(buttonRef, async (showing) => {
|
useTooltip(buttonRef, async (showing) => {
|
||||||
const renotes = await os.api("notes/renotes", {
|
const renotes = await os.api("notes/renotes", {
|
||||||
noteId: props.note.id,
|
noteId: props.note.id,
|
||||||
@ -81,12 +73,9 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => {
|
|||||||
const users = renotes.map((x) => x.user.id);
|
const users = renotes.map((x) => x.user.id);
|
||||||
const hasRenotedBefore = users.includes($i.id);
|
const hasRenotedBefore = users.includes($i.id);
|
||||||
|
|
||||||
let buttonActions: Array<MenuItem> = [];
|
let buttonActions = [];
|
||||||
|
|
||||||
if (
|
if (props.note.visibility === "public" || props.note.visibility === "hidden") {
|
||||||
props.note.visibility === "public" ||
|
|
||||||
props.note.visibility === "hidden"
|
|
||||||
) {
|
|
||||||
buttonActions.push({
|
buttonActions.push({
|
||||||
text: i18n.ts.renote,
|
text: i18n.ts.renote,
|
||||||
textStyle: "font-weight: bold",
|
textStyle: "font-weight: bold",
|
||||||
@ -96,7 +85,6 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => {
|
|||||||
os.api("notes/create", {
|
os.api("notes/create", {
|
||||||
renoteId: props.note.id,
|
renoteId: props.note.id,
|
||||||
visibility: "public",
|
visibility: "public",
|
||||||
cw: getCw(),
|
|
||||||
});
|
});
|
||||||
const el =
|
const el =
|
||||||
ev &&
|
ev &&
|
||||||
@ -114,7 +102,7 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (["public", "home", "hidden"].includes(props.note.visibility)) {
|
if (["public", "home","hidden"].includes(props.note.visibility)) {
|
||||||
buttonActions.push({
|
buttonActions.push({
|
||||||
text: `${i18n.ts.renote} (${i18n.ts._visibility.home})`,
|
text: `${i18n.ts.renote} (${i18n.ts._visibility.home})`,
|
||||||
icon: "ph-house ph-bold ph-lg",
|
icon: "ph-house ph-bold ph-lg",
|
||||||
@ -123,7 +111,6 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => {
|
|||||||
os.api("notes/create", {
|
os.api("notes/create", {
|
||||||
renoteId: props.note.id,
|
renoteId: props.note.id,
|
||||||
visibility: "home",
|
visibility: "home",
|
||||||
cw: getCw(),
|
|
||||||
});
|
});
|
||||||
const el =
|
const el =
|
||||||
ev &&
|
ev &&
|
||||||
@ -151,7 +138,6 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => {
|
|||||||
renoteId: props.note.id,
|
renoteId: props.note.id,
|
||||||
visibility: "specified",
|
visibility: "specified",
|
||||||
visibleUserIds: props.note.visibleUserIds,
|
visibleUserIds: props.note.visibleUserIds,
|
||||||
cw: getCw(),
|
|
||||||
});
|
});
|
||||||
const el =
|
const el =
|
||||||
ev &&
|
ev &&
|
||||||
@ -176,7 +162,6 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => {
|
|||||||
os.api("notes/create", {
|
os.api("notes/create", {
|
||||||
renoteId: props.note.id,
|
renoteId: props.note.id,
|
||||||
visibility: "followers",
|
visibility: "followers",
|
||||||
cw: getCw(),
|
|
||||||
});
|
});
|
||||||
const el =
|
const el =
|
||||||
ev &&
|
ev &&
|
||||||
@ -194,30 +179,7 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const showQuote = !defaultStore.state.seperateRenoteQuote;
|
if (!defaultStore.state.seperateRenoteQuote) {
|
||||||
|
|
||||||
if (!props.note.cw || props.note.cw === "") {
|
|
||||||
buttonActions.push({
|
|
||||||
type: "switch",
|
|
||||||
ref: addCw,
|
|
||||||
text: "Add content warning",
|
|
||||||
hidden: addCw,
|
|
||||||
});
|
|
||||||
|
|
||||||
buttonActions.push({
|
|
||||||
type: "input",
|
|
||||||
ref: cwInput,
|
|
||||||
placeholder: "Content warning",
|
|
||||||
required: true,
|
|
||||||
visible: addCw,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (showQuote || hasRenotedBefore) {
|
|
||||||
buttonActions.push(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (showQuote) {
|
|
||||||
buttonActions.push({
|
buttonActions.push({
|
||||||
text: i18n.ts.quote,
|
text: i18n.ts.quote,
|
||||||
icon: "ph-quotes ph-bold ph-lg",
|
icon: "ph-quotes ph-bold ph-lg",
|
||||||
@ -242,10 +204,7 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
os.popupMenu(buttonActions, buttonRef.value, { viaKeyboard });
|
||||||
os.popupMenu(buttonActions, buttonRef.value, {
|
|
||||||
viaKeyboard,
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -1,14 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<p v-if="note.cw != null" class="cw">
|
||||||
:class="{
|
|
||||||
hasCw: !!cw,
|
|
||||||
cwHighlight,
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
<p v-if="cw != null" class="cw">
|
|
||||||
<MkA
|
<MkA
|
||||||
v-if="!detailed && appearNote.replyId"
|
v-if="!detailed && note.replyId"
|
||||||
:to="`/notes/${appearNote.replyId}`"
|
:to="`/notes/${note.replyId}`"
|
||||||
class="reply-icon"
|
class="reply-icon"
|
||||||
@click.stop
|
@click.stop
|
||||||
>
|
>
|
||||||
@ -17,35 +11,35 @@
|
|||||||
<MkA
|
<MkA
|
||||||
v-if="
|
v-if="
|
||||||
conversation &&
|
conversation &&
|
||||||
appearNote.renoteId &&
|
note.renoteId &&
|
||||||
appearNote.renoteId != parentId &&
|
note.renoteId != parentId &&
|
||||||
!appearNote.replyId
|
!note.replyId
|
||||||
"
|
"
|
||||||
:to="`/notes/${appearNote.renoteId}`"
|
:to="`/notes/${note.renoteId}`"
|
||||||
class="reply-icon"
|
class="reply-icon"
|
||||||
@click.stop
|
@click.stop
|
||||||
>
|
>
|
||||||
<i class="ph-quotes ph-bold ph-lg"></i>
|
<i class="ph-quotes ph-bold ph-lg"></i>
|
||||||
</MkA>
|
</MkA>
|
||||||
<Mfm
|
<Mfm
|
||||||
v-if="cw != ''"
|
v-if="note.cw != ''"
|
||||||
class="text"
|
class="text"
|
||||||
:text="cw"
|
:text="note.cw"
|
||||||
:author="appearNote.user"
|
:author="note.user"
|
||||||
:i="$i"
|
:i="$i"
|
||||||
:custom-emojis="appearNote.emojis"
|
:custom-emojis="note.emojis"
|
||||||
/>
|
/>
|
||||||
</p>
|
</p>
|
||||||
<div class="wrmlmaau">
|
<div class="wrmlmaau">
|
||||||
<div
|
<div
|
||||||
class="content"
|
class="content"
|
||||||
:class="{ collapsed, isLong, showContent: cw && !showContent }"
|
:class="{ collapsed, isLong, showContent: note.cw && !showContent }"
|
||||||
>
|
>
|
||||||
<XCwButton
|
<XCwButton
|
||||||
ref="cwButton"
|
ref="cwButton"
|
||||||
v-if="cw && !showContent"
|
v-if="note.cw && !showContent"
|
||||||
v-model="showContent"
|
v-model="showContent"
|
||||||
:note="appearNote"
|
:note="note"
|
||||||
v-on:keydown="focusFooter"
|
v-on:keydown="focusFooter"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
@ -55,13 +49,13 @@
|
|||||||
tabindex: !showContent ? '-1' : null,
|
tabindex: !showContent ? '-1' : null,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<span v-if="appearNote.deletedAt" style="opacity: 0.5"
|
<span v-if="note.deletedAt" style="opacity: 0.5"
|
||||||
>({{ i18n.ts.deleted }})</span
|
>({{ i18n.ts.deleted }})</span
|
||||||
>
|
>
|
||||||
<template v-if="!cw">
|
<template v-if="!note.cw">
|
||||||
<MkA
|
<MkA
|
||||||
v-if="!detailed && appearNote.replyId"
|
v-if="!detailed && note.replyId"
|
||||||
:to="`/notes/${appearNote.replyId}`"
|
:to="`/notes/${note.replyId}`"
|
||||||
class="reply-icon"
|
class="reply-icon"
|
||||||
@click.stop
|
@click.stop
|
||||||
>
|
>
|
||||||
@ -70,11 +64,11 @@
|
|||||||
<MkA
|
<MkA
|
||||||
v-if="
|
v-if="
|
||||||
conversation &&
|
conversation &&
|
||||||
appearNote.renoteId &&
|
note.renoteId &&
|
||||||
appearNote.renoteId != parentId &&
|
note.renoteId != parentId &&
|
||||||
!appearNote.replyId
|
!note.replyId
|
||||||
"
|
"
|
||||||
:to="`/notes/${appearNote.renoteId}`"
|
:to="`/notes/${note.renoteId}`"
|
||||||
class="reply-icon"
|
class="reply-icon"
|
||||||
@click.stop
|
@click.stop
|
||||||
>
|
>
|
||||||
@ -82,26 +76,22 @@
|
|||||||
</MkA>
|
</MkA>
|
||||||
</template>
|
</template>
|
||||||
<Mfm
|
<Mfm
|
||||||
v-if="appearNote.text"
|
v-if="note.text"
|
||||||
:text="appearNote.text"
|
:text="note.text"
|
||||||
:author="appearNote.user"
|
:author="note.user"
|
||||||
:i="$i"
|
:i="$i"
|
||||||
:custom-emojis="appearNote.emojis"
|
:custom-emojis="note.emojis"
|
||||||
/>
|
/>
|
||||||
<MkA
|
<MkA
|
||||||
v-if="!detailed && appearNote.renoteId"
|
v-if="!detailed && note.renoteId"
|
||||||
class="rp"
|
class="rp"
|
||||||
:to="`/notes/${appearNote.renoteId}`"
|
:to="`/notes/${note.renoteId}`"
|
||||||
>{{ i18n.ts.quoteAttached }}: ...</MkA
|
>{{ i18n.ts.quoteAttached }}: ...</MkA
|
||||||
>
|
>
|
||||||
<div v-if="appearNote.files.length > 0" class="files">
|
<div v-if="note.files.length > 0" class="files">
|
||||||
<XMediaList :media-list="appearNote.files" />
|
<XMediaList :media-list="note.files" />
|
||||||
</div>
|
</div>
|
||||||
<XPoll
|
<XPoll v-if="note.poll" :note="note" class="poll" />
|
||||||
v-if="appearNote.poll"
|
|
||||||
:note="appearNote"
|
|
||||||
class="poll"
|
|
||||||
/>
|
|
||||||
<template v-if="detailed">
|
<template v-if="detailed">
|
||||||
<MkUrlPreview
|
<MkUrlPreview
|
||||||
v-for="url in urls"
|
v-for="url in urls"
|
||||||
@ -112,15 +102,15 @@
|
|||||||
class="url-preview"
|
class="url-preview"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
v-if="appearNote.renote"
|
v-if="note.renote"
|
||||||
class="renote"
|
class="renote"
|
||||||
@click.stop="emit('push', appearNote.renote)"
|
@click.stop="emit('push', note.renote)"
|
||||||
>
|
>
|
||||||
<XNoteSimple :note="appearNote.renote" />
|
<XNoteSimple :note="note.renote" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div
|
<div
|
||||||
v-if="cw && !showContent"
|
v-if="note.cw && !showContent"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
v-on:focus="cwButton?.focus()"
|
v-on:focus="cwButton?.focus()"
|
||||||
></div>
|
></div>
|
||||||
@ -129,8 +119,7 @@
|
|||||||
v-if="isLong"
|
v-if="isLong"
|
||||||
v-model="collapsed"
|
v-model="collapsed"
|
||||||
></XShowMoreButton>
|
></XShowMoreButton>
|
||||||
<XCwButton v-if="cw" v-model="showContent" :note="appearNote" />
|
<XCwButton v-if="note.cw" v-model="showContent" :note="note" />
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -147,7 +136,6 @@ import XShowMoreButton from "@/components/MkShowMoreButton.vue";
|
|||||||
import XCwButton from "@/components/MkCwButton.vue";
|
import XCwButton from "@/components/MkCwButton.vue";
|
||||||
import { extractUrlFromMfm } from "@/scripts/extract-url-from-mfm";
|
import { extractUrlFromMfm } from "@/scripts/extract-url-from-mfm";
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
import { defaultStore } from "@/store";
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
note: misskey.entities.Note;
|
note: misskey.entities.Note;
|
||||||
@ -162,30 +150,16 @@ const emit = defineEmits<{
|
|||||||
(ev: "focusfooter"): void;
|
(ev: "focusfooter"): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const note = props.note;
|
|
||||||
|
|
||||||
const isRenote =
|
|
||||||
note.renote != null &&
|
|
||||||
note.text == null &&
|
|
||||||
note.fileIds.length === 0 &&
|
|
||||||
note.poll == null;
|
|
||||||
|
|
||||||
let appearNote = $computed(() =>
|
|
||||||
isRenote ? (note.renote as misskey.entities.Note) : note
|
|
||||||
);
|
|
||||||
let cw = $computed(() => appearNote.cw || note.cw);
|
|
||||||
const cwHighlight = defaultStore.state.highlightCw;
|
|
||||||
|
|
||||||
const cwButton = ref<HTMLElement>();
|
const cwButton = ref<HTMLElement>();
|
||||||
const isLong =
|
const isLong =
|
||||||
!props.detailedView &&
|
!props.detailedView &&
|
||||||
!cw &&
|
props.note.cw == null &&
|
||||||
appearNote.text != null &&
|
props.note.text != null &&
|
||||||
(appearNote.text.split("\n").length > 9 || appearNote.text.length > 500);
|
(props.note.text.split("\n").length > 9 || props.note.text.length > 500);
|
||||||
const collapsed = $ref(!cw && isLong);
|
const collapsed = $ref(props.note.cw == null && isLong);
|
||||||
|
|
||||||
const urls = appearNote.text
|
const urls = props.note.text
|
||||||
? extractUrlFromMfm(mfm.parse(appearNote.text)).slice(0, 5)
|
? extractUrlFromMfm(mfm.parse(props.note.text)).slice(0, 5)
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
let showContent = $ref(false);
|
let showContent = $ref(false);
|
||||||
@ -219,23 +193,6 @@ function focusFooter(ev) {
|
|||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
> .text {
|
> .text {
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
padding-inline-start: 0.25em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.cwHighlight.hasCw {
|
|
||||||
outline: 1px dotted var(--cwFg);
|
|
||||||
border-radius: 5px;
|
|
||||||
> .wrmlmaau {
|
|
||||||
padding-inline-start: 0.25em;
|
|
||||||
}
|
|
||||||
> .cw {
|
|
||||||
background-color: var(--cwFg);
|
|
||||||
color: var(--cwBg);
|
|
||||||
border-top-left-radius: 5px;
|
|
||||||
border-top-right-radius: 5px;
|
|
||||||
> .reply-icon {
|
|
||||||
color: var(--cwBg);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.wrmlmaau {
|
.wrmlmaau {
|
||||||
@ -267,9 +224,11 @@ function focusFooter(ev) {
|
|||||||
> .url-preview {
|
> .url-preview {
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
> .poll {
|
> .poll {
|
||||||
font-size: 80%;
|
font-size: 80%;
|
||||||
}
|
}
|
||||||
|
|
||||||
> .renote {
|
> .renote {
|
||||||
padding-top: 8px;
|
padding-top: 8px;
|
||||||
> * {
|
> * {
|
||||||
@ -284,6 +243,7 @@ function focusFooter(ev) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.collapsed,
|
&.collapsed,
|
||||||
&.showContent {
|
&.showContent {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
@ -1,13 +1,6 @@
|
|||||||
// TODO: なんでもかんでもos.tsに突っ込むのやめたいのでよしなに分割する
|
// TODO: なんでもかんでもos.tsに突っ込むのやめたいのでよしなに分割する
|
||||||
|
|
||||||
import {
|
import { Component, markRaw, Ref, ref, defineAsyncComponent } from "vue";
|
||||||
Component,
|
|
||||||
markRaw,
|
|
||||||
Ref,
|
|
||||||
ref,
|
|
||||||
defineAsyncComponent,
|
|
||||||
ComputedRef,
|
|
||||||
} from "vue";
|
|
||||||
import { EventEmitter } from "eventemitter3";
|
import { EventEmitter } from "eventemitter3";
|
||||||
import insertTextAtCursor from "insert-text-at-cursor";
|
import insertTextAtCursor from "insert-text-at-cursor";
|
||||||
import * as Misskey from "calckey-js";
|
import * as Misskey from "calckey-js";
|
||||||
@ -771,7 +764,6 @@ export function popupMenu(
|
|||||||
align?: string;
|
align?: string;
|
||||||
width?: number;
|
width?: number;
|
||||||
viaKeyboard?: boolean;
|
viaKeyboard?: boolean;
|
||||||
classes?: string[] | Ref<Array<string>> | ComputedRef<Array<string>>;
|
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
@ -784,7 +776,6 @@ export function popupMenu(
|
|||||||
width: options?.width,
|
width: options?.width,
|
||||||
align: options?.align,
|
align: options?.align,
|
||||||
viaKeyboard: options?.viaKeyboard,
|
viaKeyboard: options?.viaKeyboard,
|
||||||
classes: options?.classes,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
closed: () => {
|
closed: () => {
|
||||||
|
@ -123,9 +123,6 @@
|
|||||||
<FormSwitch v-model="seperateRenoteQuote" class="_formBlock">{{
|
<FormSwitch v-model="seperateRenoteQuote" class="_formBlock">{{
|
||||||
i18n.ts.seperateRenoteQuote
|
i18n.ts.seperateRenoteQuote
|
||||||
}}</FormSwitch>
|
}}</FormSwitch>
|
||||||
<FormSwitch v-model="highlightCw" class="_formBlock">{{
|
|
||||||
i18n.ts.highlightCw
|
|
||||||
}}</FormSwitch>
|
|
||||||
<FormSwitch v-model="useSystemFont" class="_formBlock">{{
|
<FormSwitch v-model="useSystemFont" class="_formBlock">{{
|
||||||
i18n.ts.useSystemFont
|
i18n.ts.useSystemFont
|
||||||
}}</FormSwitch>
|
}}</FormSwitch>
|
||||||
@ -305,7 +302,6 @@ const useReactionPickerForContextMenu = computed(
|
|||||||
const seperateRenoteQuote = computed(
|
const seperateRenoteQuote = computed(
|
||||||
defaultStore.makeGetterSetter("seperateRenoteQuote")
|
defaultStore.makeGetterSetter("seperateRenoteQuote")
|
||||||
);
|
);
|
||||||
const highlightCw = computed(defaultStore.makeGetterSetter("highlightCw"));
|
|
||||||
const squareAvatars = computed(defaultStore.makeGetterSetter("squareAvatars"));
|
const squareAvatars = computed(defaultStore.makeGetterSetter("squareAvatars"));
|
||||||
const showUpdates = computed(defaultStore.makeGetterSetter("showUpdates"));
|
const showUpdates = computed(defaultStore.makeGetterSetter("showUpdates"));
|
||||||
const swipeOnDesktop = computed(
|
const swipeOnDesktop = computed(
|
||||||
|
@ -146,10 +146,6 @@ export const defaultStore = markRaw(
|
|||||||
where: "device",
|
where: "device",
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
highlightCw: {
|
|
||||||
where: "device",
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
nsfw: {
|
nsfw: {
|
||||||
where: "device",
|
where: "device",
|
||||||
default: "respect" as "respect" | "force" | "ignore",
|
default: "respect" as "respect" | "force" | "ignore",
|
||||||
|
@ -1,26 +1,16 @@
|
|||||||
import * as Misskey from "calckey-js";
|
import * as Misskey from "calckey-js";
|
||||||
import { ComputedRef, Ref } from "vue";
|
import { Ref } from "vue";
|
||||||
|
|
||||||
export type MenuClasses =
|
|
||||||
| Array<string>
|
|
||||||
| Ref<Array<string>>
|
|
||||||
| ComputedRef<Array<string>>;
|
|
||||||
export type MenuBase = {
|
|
||||||
classes?: MenuClasses;
|
|
||||||
hidden?: boolean | Ref<boolean>;
|
|
||||||
visible?: boolean | Ref<boolean>;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type MenuAction = (ev: MouseEvent) => void;
|
export type MenuAction = (ev: MouseEvent) => void;
|
||||||
|
|
||||||
export type MenuDivider = null;
|
export type MenuDivider = null;
|
||||||
export type MenuNull = undefined;
|
export type MenuNull = undefined;
|
||||||
export type MenuLabel = MenuBase & {
|
export type MenuLabel = {
|
||||||
type: "label";
|
type: "label";
|
||||||
text: string;
|
text: string;
|
||||||
textStyle?: string;
|
textStyle?: string;
|
||||||
};
|
};
|
||||||
export type MenuLink = MenuBase & {
|
export type MenuLink = {
|
||||||
type: "link";
|
type: "link";
|
||||||
to: string;
|
to: string;
|
||||||
text: string;
|
text: string;
|
||||||
@ -29,7 +19,7 @@ export type MenuLink = MenuBase & {
|
|||||||
indicate?: boolean;
|
indicate?: boolean;
|
||||||
avatar?: Misskey.entities.User;
|
avatar?: Misskey.entities.User;
|
||||||
};
|
};
|
||||||
export type MenuA = MenuBase & {
|
export type MenuA = {
|
||||||
type: "a";
|
type: "a";
|
||||||
href: string;
|
href: string;
|
||||||
target?: string;
|
target?: string;
|
||||||
@ -39,21 +29,22 @@ export type MenuA = MenuBase & {
|
|||||||
icon?: string;
|
icon?: string;
|
||||||
indicate?: boolean;
|
indicate?: boolean;
|
||||||
};
|
};
|
||||||
export type MenuUser = MenuBase & {
|
export type MenuUser = {
|
||||||
type: "user";
|
type: "user";
|
||||||
user: Misskey.entities.User;
|
user: Misskey.entities.User;
|
||||||
active?: boolean;
|
active?: boolean;
|
||||||
indicate?: boolean;
|
indicate?: boolean;
|
||||||
|
hidden?: boolean;
|
||||||
action: MenuAction;
|
action: MenuAction;
|
||||||
};
|
};
|
||||||
export type MenuSwitch = MenuBase & {
|
export type MenuSwitch = {
|
||||||
type: "switch";
|
type: "switch";
|
||||||
ref: Ref<boolean>;
|
ref: Ref<boolean>;
|
||||||
text: string;
|
text: string;
|
||||||
textStyle?: string;
|
textStyle?: string;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
};
|
};
|
||||||
export type MenuButton = MenuBase & {
|
export type MenuButton = {
|
||||||
type?: "button";
|
type?: "button";
|
||||||
text: string;
|
text: string;
|
||||||
textStyle?: string;
|
textStyle?: string;
|
||||||
@ -61,28 +52,11 @@ export type MenuButton = MenuBase & {
|
|||||||
indicate?: boolean;
|
indicate?: boolean;
|
||||||
danger?: boolean;
|
danger?: boolean;
|
||||||
active?: boolean;
|
active?: boolean;
|
||||||
|
hidden?: boolean;
|
||||||
avatar?: Misskey.entities.User;
|
avatar?: Misskey.entities.User;
|
||||||
action: MenuAction;
|
action: MenuAction;
|
||||||
};
|
};
|
||||||
export type MenuButtonMultipleIcons = MenuBase & {
|
export type MenuParent = {
|
||||||
type?: "button";
|
|
||||||
text: string;
|
|
||||||
textStyle?: string;
|
|
||||||
icons: string[];
|
|
||||||
indicate?: boolean;
|
|
||||||
danger?: boolean;
|
|
||||||
active?: boolean;
|
|
||||||
avatar?: Misskey.entities.User;
|
|
||||||
action: MenuAction;
|
|
||||||
};
|
|
||||||
export type MenuInput = MenuBase & {
|
|
||||||
type: "input";
|
|
||||||
ref: Ref<string>;
|
|
||||||
placeholder: string;
|
|
||||||
disabled?: boolean;
|
|
||||||
required?: boolean | Ref<boolean>;
|
|
||||||
};
|
|
||||||
export type MenuParent = MenuBase & {
|
|
||||||
type: "parent";
|
type: "parent";
|
||||||
text: string;
|
text: string;
|
||||||
textStyle?: string;
|
textStyle?: string;
|
||||||
@ -90,9 +64,7 @@ export type MenuParent = MenuBase & {
|
|||||||
children: OuterMenuItem[];
|
children: OuterMenuItem[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type MenuPending = MenuBase & {
|
export type MenuPending = { type: "pending" };
|
||||||
type: "pending";
|
|
||||||
};
|
|
||||||
|
|
||||||
type OuterMenuItem =
|
type OuterMenuItem =
|
||||||
| MenuDivider
|
| MenuDivider
|
||||||
@ -103,19 +75,9 @@ type OuterMenuItem =
|
|||||||
| MenuUser
|
| MenuUser
|
||||||
| MenuSwitch
|
| MenuSwitch
|
||||||
| MenuButton
|
| MenuButton
|
||||||
| MenuButtonMultipleIcons
|
|
||||||
| MenuInput
|
|
||||||
| MenuParent;
|
| MenuParent;
|
||||||
type OuterPromiseMenuItem = Promise<
|
type OuterPromiseMenuItem = Promise<
|
||||||
| MenuLabel
|
MenuLabel | MenuLink | MenuA | MenuUser | MenuSwitch | MenuButton | MenuParent
|
||||||
| MenuLink
|
|
||||||
| MenuA
|
|
||||||
| MenuUser
|
|
||||||
| MenuSwitch
|
|
||||||
| MenuButton
|
|
||||||
| MenuButtonMultipleIcons
|
|
||||||
| MenuInput
|
|
||||||
| MenuParent
|
|
||||||
>;
|
>;
|
||||||
export type MenuItem = OuterMenuItem | OuterPromiseMenuItem;
|
export type MenuItem = OuterMenuItem | OuterPromiseMenuItem;
|
||||||
export type InnerMenuItem =
|
export type InnerMenuItem =
|
||||||
@ -127,6 +89,4 @@ export type InnerMenuItem =
|
|||||||
| MenuUser
|
| MenuUser
|
||||||
| MenuSwitch
|
| MenuSwitch
|
||||||
| MenuButton
|
| MenuButton
|
||||||
| MenuButtonMultipleIcons
|
|
||||||
| MenuInput
|
|
||||||
| MenuParent;
|
| MenuParent;
|
||||||
|
Loading…
Reference in New Issue
Block a user