lint and type fixes
This commit is contained in:
parent
54071efaea
commit
6ac37b4d6c
84 changed files with 188 additions and 374 deletions
|
|
@ -17,7 +17,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
|
||||
<script setup lang="ts">
|
||||
import * as Misskey from 'misskey-js';
|
||||
import { computed, defineAsyncComponent, shallowRef } from 'vue';
|
||||
import { computed, defineAsyncComponent, useTemplateRef } from 'vue';
|
||||
import type { ComponentExposed } from 'vue-component-type-helpers';
|
||||
import type MkNote from '@/components/MkNote.vue';
|
||||
import type SkNote from '@/components/SkNote.vue';
|
||||
|
|
@ -31,7 +31,7 @@ const XNote = computed(() =>
|
|||
),
|
||||
);
|
||||
|
||||
const rootEl = shallowRef<ComponentExposed<typeof MkNote | typeof SkNote>>();
|
||||
const rootEl = useTemplateRef<ComponentExposed<typeof MkNote | typeof SkNote>>('rootEl');
|
||||
|
||||
defineExpose({ rootEl });
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
|
||||
<script setup lang="ts">
|
||||
import * as Misskey from 'misskey-js';
|
||||
import { computed, defineAsyncComponent, shallowRef } from 'vue';
|
||||
import { computed, defineAsyncComponent, useTemplateRef } from 'vue';
|
||||
import type { ComponentExposed } from 'vue-component-type-helpers';
|
||||
import type MkNoteDetailed from '@/components/MkNoteDetailed.vue';
|
||||
import type SkNoteDetailed from '@/components/SkNoteDetailed.vue';
|
||||
|
|
@ -28,7 +28,7 @@ const XNoteDetailed = computed(() =>
|
|||
),
|
||||
);
|
||||
|
||||
const rootEl = shallowRef<ComponentExposed<typeof MkNoteDetailed | typeof SkNoteDetailed>>();
|
||||
const rootEl = useTemplateRef<ComponentExposed<typeof MkNoteDetailed | typeof SkNoteDetailed>>('rootEl');
|
||||
|
||||
defineExpose({ rootEl });
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
|
||||
<script setup lang="ts">
|
||||
import * as Misskey from 'misskey-js';
|
||||
import { computed, defineAsyncComponent, shallowRef } from 'vue';
|
||||
import { computed, defineAsyncComponent, useTemplateRef } from 'vue';
|
||||
import type { ComponentExposed } from 'vue-component-type-helpers';
|
||||
import type MkNoteSimple from '@/components/MkNoteSimple.vue';
|
||||
import type SkNoteSimple from '@/components/SkNoteSimple.vue';
|
||||
|
|
@ -29,7 +29,7 @@ const XNoteSimple = computed(() =>
|
|||
),
|
||||
);
|
||||
|
||||
const rootEl = shallowRef<ComponentExposed<typeof MkNoteSimple | typeof SkNoteSimple>>();
|
||||
const rootEl = useTemplateRef<ComponentExposed<typeof MkNoteSimple | typeof SkNoteSimple>>('rootEl');
|
||||
|
||||
defineExpose({ rootEl });
|
||||
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ const src = computed(() => {
|
|||
case 'fc': return 'https://cdn.jsdelivr.net/npm/friendly-challenge@0.9.18/widget.min.js';
|
||||
case 'mcaptcha': return null;
|
||||
case 'testcaptcha': return null;
|
||||
default: return null;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -135,7 +135,9 @@ function waitForDecode() {
|
|||
.then(() => img.value?.decode())
|
||||
.then(() => {
|
||||
loaded.value = true;
|
||||
});
|
||||
})
|
||||
// Ignore decoding errors
|
||||
.catch(() => {});
|
||||
} else {
|
||||
loaded.value = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -805,8 +805,8 @@ function onContextmenu(ev: MouseEvent): void {
|
|||
ev.preventDefault();
|
||||
react();
|
||||
} else {
|
||||
const { popupMenu, cleanup } = getNoteMenu({ note: note.value, translating, translation, isDeleted, currentClip: currentClip?.value });
|
||||
os.contextMenu(popupMenu, ev).then(focus).finally(cleanup);
|
||||
const { menu, cleanup } = getNoteMenu({ note: note.value, translating, translation, isDeleted, currentClip: currentClip?.value });
|
||||
os.contextMenu(menu, ev).then(focus).finally(cleanup);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -815,8 +815,8 @@ function showMenu(): void {
|
|||
return;
|
||||
}
|
||||
|
||||
const { popupMenu, cleanup } = getNoteMenu({ note: note.value, translating, translation, isDeleted, currentClip: currentClip?.value });
|
||||
os.popupMenu(popupMenu, menuButton.value).then(focus).finally(cleanup);
|
||||
const { menu, cleanup } = getNoteMenu({ note: note.value, translating, translation, isDeleted, currentClip: currentClip?.value });
|
||||
os.popupMenu(menu, menuButton.value).then(focus).finally(cleanup);
|
||||
}
|
||||
|
||||
async function menuVersions(): Promise<void> {
|
||||
|
|
|
|||
|
|
@ -749,14 +749,14 @@ function onContextmenu(ev: MouseEvent): void {
|
|||
ev.preventDefault();
|
||||
react();
|
||||
} else {
|
||||
const { popupMenu, cleanup } = getNoteMenu({ note: note.value, translating, translation, isDeleted });
|
||||
os.contextMenu(popupMenu, ev).then(focus).finally(cleanup);
|
||||
const { menu, cleanup } = getNoteMenu({ note: note.value, translating, translation, isDeleted });
|
||||
os.contextMenu(menu, ev).then(focus).finally(cleanup);
|
||||
}
|
||||
}
|
||||
|
||||
function showMenu(): void {
|
||||
const { popupMenu, cleanup } = getNoteMenu({ note: note.value, translating, translation, isDeleted });
|
||||
os.popupMenu(popupMenu, menuButton.value).then(focus).finally(cleanup);
|
||||
const { menu, cleanup } = getNoteMenu({ note: note.value, translating, translation, isDeleted });
|
||||
os.popupMenu(menu, menuButton.value).then(focus).finally(cleanup);
|
||||
}
|
||||
|
||||
async function menuVersions(): Promise<void> {
|
||||
|
|
|
|||
|
|
@ -54,11 +54,9 @@ const props = defineProps<{
|
|||
|
||||
const menuVersionsButton = shallowRef<HTMLElement>();
|
||||
|
||||
async function menuVersions(viaKeyboard = false): Promise<void> {
|
||||
const { menu, cleanup } = await getNoteVersionsMenu({ note: props.note, menuVersionsButton });
|
||||
popupMenu(menu, menuVersionsButton.value, {
|
||||
viaKeyboard,
|
||||
}).then(focus).finally(cleanup);
|
||||
async function menuVersions(): Promise<void> {
|
||||
const { menu, cleanup } = await getNoteVersionsMenu({ note: props.note, menuButton: menuVersionsButton });
|
||||
popupMenu(menu, menuVersionsButton.value).then(focus).finally(cleanup);
|
||||
}
|
||||
|
||||
const mock = inject(DI.mock, false);
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ const props = defineProps<{
|
|||
hideFiles?: boolean;
|
||||
}>();
|
||||
|
||||
let showContent = ref(prefer.s.uncollapseCW);
|
||||
const showContent = ref(prefer.s.uncollapseCW);
|
||||
const isDeleted = ref(false);
|
||||
|
||||
const mergedCW = computed(() => computeMergedCw(props.note));
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ const props = withDefaults(defineProps<{
|
|||
const canRenote = computed(() => ['public', 'home'].includes(props.note.visibility) || props.note.userId === $i?.id);
|
||||
|
||||
const el = shallowRef<HTMLElement>();
|
||||
const muted = ref($i ? checkWordMute(props.note, $i, $i.mutedWords) : false);
|
||||
const muted = computed(() => $i ? checkWordMute(props.note, $i, $i.mutedWords) : false);
|
||||
const translation = ref<any>(null);
|
||||
const translating = ref(false);
|
||||
const isDeleted = ref(false);
|
||||
|
|
@ -142,7 +142,7 @@ const likeButton = shallowRef<HTMLElement>();
|
|||
|
||||
const renoteTooltip = computeRenoteTooltip(renoted);
|
||||
|
||||
let appearNote = computed(() => isRenote ? props.note.renote as Misskey.entities.Note : props.note);
|
||||
const appearNote = computed(() => isRenote ? props.note.renote as Misskey.entities.Note : props.note);
|
||||
const defaultLike = computed(() => prefer.s.like ? prefer.s.like : null);
|
||||
const replies = ref<Misskey.entities.Note[]>([]);
|
||||
|
||||
|
|
@ -377,8 +377,8 @@ function quote() {
|
|||
}
|
||||
|
||||
function menu(): void {
|
||||
const { popupMenu, cleanup } = getNoteMenu({ note: props.note, translating, translation, isDeleted });
|
||||
os.popupMenu(popupMenu, menuButton.value).then(focus).finally(cleanup);
|
||||
const { menu, cleanup } = getNoteMenu({ note: props.note, translating, translation, isDeleted });
|
||||
os.popupMenu(menu, menuButton.value).then(focus).finally(cleanup);
|
||||
}
|
||||
|
||||
if (props.detail) {
|
||||
|
|
|
|||
|
|
@ -219,9 +219,22 @@ const props = withDefaults(defineProps<{
|
|||
full: false,
|
||||
});
|
||||
|
||||
const userDetailed: Ref<UserDetailed | null> = ref(null);
|
||||
type ExportCompletedNotification = Misskey.entities.Notification & { type: 'exportCompleted' };
|
||||
|
||||
const exportEntityName = {
|
||||
antenna: i18n.ts.antennas,
|
||||
blocking: i18n.ts.blockedUsers,
|
||||
clip: i18n.ts.clips,
|
||||
customEmoji: i18n.ts.customEmojis,
|
||||
favorite: i18n.ts.favorites,
|
||||
following: i18n.ts.following,
|
||||
muting: i18n.ts.mutedUsers,
|
||||
note: i18n.ts.notes,
|
||||
userList: i18n.ts.lists,
|
||||
} as const satisfies Record<ExportCompletedNotification['exportedEntity'], string>;
|
||||
|
||||
const followRequestDone = ref(true);
|
||||
const userDetailed: Ref<UserDetailed | null> = ref(null);
|
||||
|
||||
// watch() is required because computed() doesn't support async.
|
||||
watch(props, async () => {
|
||||
|
|
@ -241,20 +254,6 @@ watch(props, async () => {
|
|||
}
|
||||
}, { immediate: true });
|
||||
|
||||
type ExportCompletedNotification = Misskey.entities.Notification & { type: 'exportCompleted' };
|
||||
|
||||
const exportEntityName = {
|
||||
antenna: i18n.ts.antennas,
|
||||
blocking: i18n.ts.blockedUsers,
|
||||
clip: i18n.ts.clips,
|
||||
customEmoji: i18n.ts.customEmojis,
|
||||
favorite: i18n.ts.favorites,
|
||||
following: i18n.ts.following,
|
||||
muting: i18n.ts.mutedUsers,
|
||||
note: i18n.ts.notes,
|
||||
userList: i18n.ts.lists,
|
||||
} as const satisfies Record<ExportCompletedNotification['exportedEntity'], string>;
|
||||
|
||||
const acceptFollowRequest = () => {
|
||||
if (!('user' in props.notification)) return;
|
||||
followRequestDone.value = true;
|
||||
|
|
|
|||
|
|
@ -62,7 +62,6 @@ onUnmounted(() => {
|
|||
left: 0;
|
||||
width: 100%;
|
||||
height: 64px;
|
||||
//background: linear-gradient(0deg, var(--MI_THEME-panel), color(from var(--MI_THEME-panel) srgb r g b / 0));
|
||||
|
||||
> .fadeLabel {
|
||||
display: inline-block;
|
||||
|
|
|
|||
|
|
@ -110,7 +110,6 @@ watch(() => props.expandAllCws, (expandAllCws) => {
|
|||
left: 0;
|
||||
width: 100%;
|
||||
height: 64px;
|
||||
// background: linear-gradient(0deg, var(--MI_THEME-panel), color(from var(--MI_THEME-panel) srgb r g b / 0));
|
||||
|
||||
> .fadeLabel {
|
||||
display: inline-block;
|
||||
|
|
|
|||
|
|
@ -805,8 +805,8 @@ function onContextmenu(ev: MouseEvent): void {
|
|||
ev.preventDefault();
|
||||
react();
|
||||
} else {
|
||||
const { popupMenu, cleanup } = getNoteMenu({ note: note.value, translating, translation, isDeleted, currentClip: currentClip?.value });
|
||||
os.contextMenu(popupMenu, ev).then(focus).finally(cleanup);
|
||||
const { menu, cleanup } = getNoteMenu({ note: note.value, translating, translation, isDeleted, currentClip: currentClip?.value });
|
||||
os.contextMenu(menu, ev).then(focus).finally(cleanup);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -815,8 +815,8 @@ function showMenu(): void {
|
|||
return;
|
||||
}
|
||||
|
||||
const { popupMenu, cleanup } = getNoteMenu({ note: note.value, translating, translation, isDeleted, currentClip: currentClip?.value });
|
||||
os.popupMenu(popupMenu, menuButton.value).then(focus).finally(cleanup);
|
||||
const { menu, cleanup } = getNoteMenu({ note: note.value, translating, translation, isDeleted, currentClip: currentClip?.value });
|
||||
os.popupMenu(menu, menuButton.value).then(focus).finally(cleanup);
|
||||
}
|
||||
|
||||
async function menuVersions(): Promise<void> {
|
||||
|
|
|
|||
|
|
@ -755,14 +755,14 @@ function onContextmenu(ev: MouseEvent): void {
|
|||
ev.preventDefault();
|
||||
react();
|
||||
} else {
|
||||
const { popupMenu, cleanup } = getNoteMenu({ note: note.value, translating, translation, isDeleted });
|
||||
os.contextMenu(popupMenu, ev).then(focus).finally(cleanup);
|
||||
const { menu, cleanup } = getNoteMenu({ note: note.value, translating, translation, isDeleted });
|
||||
os.contextMenu(menu, ev).then(focus).finally(cleanup);
|
||||
}
|
||||
}
|
||||
|
||||
function showMenu(): void {
|
||||
const { popupMenu, cleanup } = getNoteMenu({ note: note.value, translating, translation, isDeleted });
|
||||
os.popupMenu(popupMenu, menuButton.value).then(focus).finally(cleanup);
|
||||
const { menu, cleanup } = getNoteMenu({ note: note.value, translating, translation, isDeleted });
|
||||
os.popupMenu(menu, menuButton.value).then(focus).finally(cleanup);
|
||||
}
|
||||
|
||||
async function menuVersions(): Promise<void> {
|
||||
|
|
|
|||
|
|
@ -391,8 +391,8 @@ function quote() {
|
|||
}
|
||||
|
||||
function menu(): void {
|
||||
const { popupMenu, cleanup } = getNoteMenu({ note: props.note, translating, translation, isDeleted });
|
||||
os.popupMenu(popupMenu, menuButton.value).then(focus).finally(cleanup);
|
||||
const { menu, cleanup } = getNoteMenu({ note: props.note, translating, translation, isDeleted });
|
||||
os.popupMenu(menu, menuButton.value).then(focus).finally(cleanup);
|
||||
}
|
||||
|
||||
if (props.detail) {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { defineAsyncComponent } from 'vue';
|
||||
import { defineAsyncComponent, computed } from 'vue';
|
||||
import * as mfm from '@transfem-org/sfm-js';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import { extractUrlFromMfm } from '@/utility/extract-url-from-mfm.js';
|
||||
|
|
@ -26,7 +26,10 @@ const props = defineProps<{
|
|||
page: Misskey.entities.Page,
|
||||
}>();
|
||||
|
||||
const urls = props.block.text ? extractUrlFromMfm(mfm.parse(props.block.text)) : [];
|
||||
const urls = computed(() => {
|
||||
if (!props.block.text) return [];
|
||||
return extractUrlFromMfm(mfm.parse(props.block.text));
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue