fix some lints automatically

This commit is contained in:
Johann150 2022-08-10 22:42:30 +02:00
parent e82d12f44b
commit 609fb91ca1
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1
186 changed files with 878 additions and 833 deletions

View file

@ -51,7 +51,7 @@ function send() {
}).then(res => { }).then(res => {
os.alert({ os.alert({
type: 'success', type: 'success',
text: i18n.ts.abuseReported text: i18n.ts.abuseReported,
}); });
uiWindow.value?.close(); uiWindow.value?.close();
emit('closed'); emit('closed');

View file

@ -63,7 +63,7 @@ let forward = $ref(props.report.forwarded);
function resolve() { function resolve() {
os.apiWithDialog('admin/resolve-abuse-user-report', { os.apiWithDialog('admin/resolve-abuse-user-report', {
forward: forward, forward,
reportId: props.report.id, reportId: props.report.id,
}).then(() => { }).then(() => {
emit('resolved', props.report.id); emit('resolved', props.report.id);

View file

@ -1,6 +1,7 @@
<template> <template>
<svg class="mbcofsoe" viewBox="0 0 10 10" preserveAspectRatio="none"> <svg class="mbcofsoe" viewBox="0 0 10 10" preserveAspectRatio="none">
<circle v-for="(angle, i) in graduations" <circle
v-for="(angle, i) in graduations"
:key="i" :key="i"
:cx="5 + (Math.sin(angle) * (5 - graduationsPadding))" :cx="5 + (Math.sin(angle) * (5 - graduationsPadding))"
:cy="5 - (Math.cos(angle) * (5 - graduationsPadding))" :cy="5 - (Math.cos(angle) * (5 - graduationsPadding))"

View file

@ -86,7 +86,7 @@ for (const x of customEmojis) {
name: x.name, name: x.name,
emoji: `:${x.name}:`, emoji: `:${x.name}:`,
url: x.url, url: x.url,
isCustomEmoji: true isCustomEmoji: true,
}); });
if (x.aliases) { if (x.aliases) {
@ -96,7 +96,7 @@ for (const x of customEmojis) {
aliasOf: x.name, aliasOf: x.name,
emoji: `:${x.name}:`, emoji: `:${x.name}:`,
url: x.url, url: x.url,
isCustomEmoji: true isCustomEmoji: true,
}); });
} }
} }
@ -193,7 +193,7 @@ function exec() {
os.api('users/search-by-username-and-host', { os.api('users/search-by-username-and-host', {
username: props.q, username: props.q,
limit: 10, limit: 10,
detail: false detail: false,
}).then(searchedUsers => { }).then(searchedUsers => {
users.value = searchedUsers as any[]; users.value = searchedUsers as any[];
fetching.value = false; fetching.value = false;
@ -215,7 +215,7 @@ function exec() {
} else { } else {
os.api('hashtags/search', { os.api('hashtags/search', {
query: props.q, query: props.q,
limit: 30 limit: 30,
}).then(searchedHashtags => { }).then(searchedHashtags => {
hashtags.value = searchedHashtags as any[]; hashtags.value = searchedHashtags as any[];
fetching.value = false; fetching.value = false;

View file

@ -18,7 +18,7 @@ const users = ref([]);
onMounted(async () => { onMounted(async () => {
users.value = await os.api('users/show', { users.value = await os.api('users/show', {
userIds: props.userIds userIds: props.userIds,
}); });
}); });
</script> </script>

View file

@ -82,7 +82,7 @@ function requestRender() {
captcha.value.render(captchaEl.value, { captcha.value.render(captchaEl.value, {
sitekey: props.sitekey, sitekey: props.sitekey,
theme: defaultStore.state.darkMode ? 'dark' : 'light', theme: defaultStore.state.darkMode ? 'dark' : 'light',
callback: callback, callback,
'expired-callback': callback, 'expired-callback': callback,
'error-callback': callback, 'error-callback': callback,
}); });

View file

@ -1,5 +1,6 @@
<template> <template>
<button class="hdcaacmi _button" <button
class="hdcaacmi _button"
:class="{ wait, active: isFollowing, full }" :class="{ wait, active: isFollowing, full }"
:disabled="wait" :disabled="wait"
@click="onClick" @click="onClick"
@ -39,12 +40,12 @@ async function onClick() {
try { try {
if (isFollowing.value) { if (isFollowing.value) {
await os.api('channels/unfollow', { await os.api('channels/unfollow', {
channelId: props.channel.id channelId: props.channel.id,
}); });
isFollowing.value = false; isFollowing.value = false;
} else { } else {
await os.api('channels/follow', { await os.api('channels/follow', {
channelId: props.channel.id channelId: props.channel.id,
}); });
isFollowing.value = true; isFollowing.value = true;
} }

View file

@ -25,7 +25,7 @@ const label = computed(() => {
return concat([ return concat([
props.note.text ? [i18n.t('_cw.chars', { count: length(props.note.text) })] : [], props.note.text ? [i18n.t('_cw.chars', { count: length(props.note.text) })] : [],
props.note.files && props.note.files.length !== 0 ? [i18n.t('_cw.files', { count: props.note.files.length }) ] : [], props.note.files && props.note.files.length !== 0 ? [i18n.t('_cw.files', { count: props.note.files.length }) ] : [],
props.note.poll != null ? [i18n.ts.poll] : [] props.note.poll != null ? [i18n.ts.poll] : [],
] as string[][]).join(' / '); ] as string[][]).join(' / ');
}); });

View file

@ -12,17 +12,17 @@ export default defineComponent({
direction: { direction: {
type: String, type: String,
required: false, required: false,
default: 'down' default: 'down',
}, },
reversed: { reversed: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false,
}, },
noGap: { noGap: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false,
}, },
}, },
@ -32,7 +32,7 @@ export default defineComponent({
const month = new Date(time).getMonth() + 1; const month = new Date(time).getMonth() + 1;
return i18n.t('monthAndDay', { return i18n.t('monthAndDay', {
month: month.toString(), month: month.toString(),
day: date.toString() day: date.toString(),
}); });
} }
@ -42,7 +42,7 @@ export default defineComponent({
if (!slots || !slots.default) return; if (!slots || !slots.default) return;
const el = slots.default({ const el = slots.default({
item: item item,
})[0]; })[0];
if (el.key == null && item.id) el.key = item.id; if (el.key == null && item.id) el.key = item.id;
@ -54,20 +54,20 @@ export default defineComponent({
class: 'separator', class: 'separator',
key: item.id + ':separator', key: item.id + ':separator',
}, h('p', { }, h('p', {
class: 'date' class: 'date',
}, [ }, [
h('span', [ h('span', [
h('i', { h('i', {
class: 'fas fa-angle-up icon', class: 'fas fa-angle-up icon',
}), }),
getDateText(item.createdAt) getDateText(item.createdAt),
]), ]),
h('span', [ h('span', [
getDateText(props.items[i + 1].createdAt), getDateText(props.items[i + 1].createdAt),
h('i', { h('i', {
class: 'fas fa-angle-down icon', class: 'fas fa-angle-down icon',
}) }),
]) ]),
])); ]));
return [el, separator]; return [el, separator];
@ -88,7 +88,7 @@ export default defineComponent({
class: 'sqadhkmv' + (props.noGap ? ' noGap' : ''), class: 'sqadhkmv' + (props.noGap ? ' noGap' : ''),
}, },
{ default: renderChildren }); { default: renderChildren });
} },
}); });
</script> </script>

View file

@ -1,5 +1,6 @@
<template> <template>
<XModalWindow ref="dialog" <XModalWindow
ref="dialog"
:width="800" :width="800"
:height="500" :height="500"
:with-ok-button="true" :with-ok-button="true"

View file

@ -1,5 +1,6 @@
<template> <template>
<XWindow ref="window" <XWindow
ref="window"
:initial-width="800" :initial-width="800"
:initial-height="500" :initial-height="500"
:can-resize="true" :can-resize="true"

View file

@ -1,5 +1,6 @@
<template> <template>
<div class="ncvczrfv" <div
class="ncvczrfv"
:class="{ isSelected }" :class="{ isSelected }"
draggable="true" draggable="true"
:title="title" :title="title"
@ -33,8 +34,8 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, defineAsyncComponent, ref } from 'vue'; import { computed, defineAsyncComponent, ref } from 'vue';
import * as Misskey from 'misskey-js'; import * as Misskey from 'misskey-js';
import copyToClipboard from '@/scripts/copy-to-clipboard';
import MkDriveFileThumbnail from './drive-file-thumbnail.vue'; import MkDriveFileThumbnail from './drive-file-thumbnail.vue';
import copyToClipboard from '@/scripts/copy-to-clipboard';
import bytes from '@/filters/bytes'; import bytes from '@/filters/bytes';
import * as os from '@/os'; import * as os from '@/os';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
@ -63,31 +64,31 @@ function getMenu() {
return [{ return [{
text: i18n.ts.rename, text: i18n.ts.rename,
icon: 'fas fa-i-cursor', icon: 'fas fa-i-cursor',
action: rename action: rename,
}, { }, {
text: props.file.isSensitive ? i18n.ts.unmarkAsSensitive : i18n.ts.markAsSensitive, text: props.file.isSensitive ? i18n.ts.unmarkAsSensitive : i18n.ts.markAsSensitive,
icon: props.file.isSensitive ? 'fas fa-eye' : 'fas fa-eye-slash', icon: props.file.isSensitive ? 'fas fa-eye' : 'fas fa-eye-slash',
action: toggleSensitive action: toggleSensitive,
}, { }, {
text: i18n.ts.describeFile, text: i18n.ts.describeFile,
icon: 'fas fa-i-cursor', icon: 'fas fa-i-cursor',
action: describe action: describe,
}, null, { }, null, {
text: i18n.ts.copyUrl, text: i18n.ts.copyUrl,
icon: 'fas fa-link', icon: 'fas fa-link',
action: copyUrl action: copyUrl,
}, { }, {
type: 'a', type: 'a',
href: props.file.url, href: props.file.url,
target: '_blank', target: '_blank',
text: i18n.ts.download, text: i18n.ts.download,
icon: 'fas fa-download', icon: 'fas fa-download',
download: props.file.name download: props.file.name,
}, null, { }, null, {
text: i18n.ts.delete, text: i18n.ts.delete,
icon: 'fas fa-trash-alt', icon: 'fas fa-trash-alt',
danger: true, danger: true,
action: deleteFile action: deleteFile,
}]; }];
} }
@ -127,7 +128,7 @@ function rename() {
if (canceled) return; if (canceled) return;
os.api('drive/files/update', { os.api('drive/files/update', {
fileId: props.file.id, fileId: props.file.id,
name: name name,
}); });
}); });
} }
@ -139,23 +140,23 @@ function describe() {
placeholder: i18n.ts.inputNewDescription, placeholder: i18n.ts.inputNewDescription,
default: props.file.comment != null ? props.file.comment : '', default: props.file.comment != null ? props.file.comment : '',
}, },
image: props.file image: props.file,
}, { }, {
done: result => { done: result => {
if (!result || result.canceled) return; if (!result || result.canceled) return;
let comment = result.result; let comment = result.result;
os.api('drive/files/update', { os.api('drive/files/update', {
fileId: props.file.id, fileId: props.file.id,
comment: comment.length === 0 ? null : comment comment: comment.length === 0 ? null : comment,
}); });
} },
}, 'closed'); }, 'closed');
} }
function toggleSensitive() { function toggleSensitive() {
os.api('drive/files/update', { os.api('drive/files/update', {
fileId: props.file.id, fileId: props.file.id,
isSensitive: !props.file.isSensitive isSensitive: !props.file.isSensitive,
}); });
} }
@ -176,7 +177,7 @@ async function deleteFile() {
if (canceled) return; if (canceled) return;
os.api('drive/files/delete', { os.api('drive/files/delete', {
fileId: props.file.id fileId: props.file.id,
}); });
} }
</script> </script>

View file

@ -1,5 +1,6 @@
<template> <template>
<div class="rghtznwe" <div
class="rghtznwe"
:class="{ draghover }" :class="{ draghover }"
draggable="true" draggable="true"
:title="title" :title="title"
@ -123,7 +124,7 @@ function onDrop(ev: DragEvent) {
emit('removeFile', file.id); emit('removeFile', file.id);
os.api('drive/files/update', { os.api('drive/files/update', {
fileId: file.id, fileId: file.id,
folderId: props.folder.id folderId: props.folder.id,
}); });
} }
//#endregion //#endregion
@ -139,7 +140,7 @@ function onDrop(ev: DragEvent) {
emit('removeFolder', folder.id); emit('removeFolder', folder.id);
os.api('drive/folders/update', { os.api('drive/folders/update', {
folderId: folder.id, folderId: folder.id,
parentId: props.folder.id parentId: props.folder.id,
}).then(() => { }).then(() => {
// noop // noop
}).catch(err => { }).catch(err => {
@ -147,13 +148,13 @@ function onDrop(ev: DragEvent) {
case 'detected-circular-definition': case 'detected-circular-definition':
os.alert({ os.alert({
title: i18n.ts.unableToProcess, title: i18n.ts.unableToProcess,
text: i18n.ts.circularReferenceFolder text: i18n.ts.circularReferenceFolder,
}); });
break; break;
default: default:
os.alert({ os.alert({
type: 'error', type: 'error',
text: i18n.ts.somethingHappened text: i18n.ts.somethingHappened,
}); });
} }
}); });
@ -186,19 +187,19 @@ function rename() {
os.inputText({ os.inputText({
title: i18n.ts.renameFolder, title: i18n.ts.renameFolder,
placeholder: i18n.ts.inputNewFolderName, placeholder: i18n.ts.inputNewFolderName,
default: props.folder.name default: props.folder.name,
}).then(({ canceled, result: name }) => { }).then(({ canceled, result: name }) => {
if (canceled) return; if (canceled) return;
os.api('drive/folders/update', { os.api('drive/folders/update', {
folderId: props.folder.id, folderId: props.folder.id,
name: name name,
}); });
}); });
} }
function deleteFolder() { function deleteFolder() {
os.api('drive/folders/delete', { os.api('drive/folders/delete', {
folderId: props.folder.id folderId: props.folder.id,
}).then(() => { }).then(() => {
if (defaultStore.state.uploadFolder === props.folder.id) { if (defaultStore.state.uploadFolder === props.folder.id) {
defaultStore.set('uploadFolder', null); defaultStore.set('uploadFolder', null);
@ -209,13 +210,13 @@ function deleteFolder() {
os.alert({ os.alert({
type: 'error', type: 'error',
title: i18n.ts.unableToDelete, title: i18n.ts.unableToDelete,
text: i18n.ts.hasChildFilesOrFolders text: i18n.ts.hasChildFilesOrFolders,
}); });
break; break;
default: default:
os.alert({ os.alert({
type: 'error', type: 'error',
text: i18n.ts.unableToDelete text: i18n.ts.unableToDelete,
}); });
} }
}); });
@ -231,10 +232,10 @@ function onContextmenu(ev: MouseEvent) {
icon: 'fas fa-window-restore', icon: 'fas fa-window-restore',
action: () => { action: () => {
os.popup(defineAsyncComponent(() => import('./drive-window.vue')), { os.popup(defineAsyncComponent(() => import('./drive-window.vue')), {
initialFolder: props.folder initialFolder: props.folder,
}, { }, {
}, 'closed'); }, 'closed');
} },
}, null, { }, null, {
text: i18n.ts.rename, text: i18n.ts.rename,
icon: 'fas fa-i-cursor', icon: 'fas fa-i-cursor',

View file

@ -1,5 +1,6 @@
<template> <template>
<div class="drylbebk" <div
class="drylbebk"
:class="{ draghover }" :class="{ draghover }"
@click="onClick" @click="onClick"
@dragover.prevent.stop="onDragover" @dragover.prevent.stop="onDragover"
@ -94,7 +95,7 @@ function onDrop(ev: DragEvent) {
emit('removeFile', file.id); emit('removeFile', file.id);
os.api('drive/files/update', { os.api('drive/files/update', {
fileId: file.id, fileId: file.id,
folderId: props.folder ? props.folder.id : null folderId: props.folder ? props.folder.id : null,
}); });
} }
//#endregion //#endregion
@ -108,7 +109,7 @@ function onDrop(ev: DragEvent) {
emit('removeFolder', folder.id); emit('removeFolder', folder.id);
os.api('drive/folders/update', { os.api('drive/folders/update', {
folderId: folder.id, folderId: folder.id,
parentId: props.folder ? props.folder.id : null parentId: props.folder ? props.folder.id : null,
}); });
} }
//#endregion //#endregion

View file

@ -26,7 +26,8 @@
</div> </div>
<button class="menu _button" @click="showMenu"><i class="fas fa-ellipsis-h"></i></button> <button class="menu _button" @click="showMenu"><i class="fas fa-ellipsis-h"></i></button>
</nav> </nav>
<div ref="main" class="main" <div
ref="main" class="main"
:class="{ uploading: uploadings.length > 0, fetching }" :class="{ uploading: uploadings.length > 0, fetching }"
@dragover.prevent.stop="onDragover" @dragover.prevent.stop="onDragover"
@dragenter="onDragenter" @dragenter="onDragenter"
@ -142,7 +143,7 @@ const isDragSource = ref(false);
const fetching = ref(true); const fetching = ref(true);
const ilFilesObserver = new IntersectionObserver( const ilFilesObserver = new IntersectionObserver(
(entries) => entries.some((entry) => entry.isIntersecting) && !fetching.value && moreFiles.value && fetchMoreFiles() (entries) => entries.some((entry) => entry.isIntersecting) && !fetching.value && moreFiles.value && fetchMoreFiles(),
); );
watch(folder, () => emit('cd', folder.value)); watch(folder, () => emit('cd', folder.value));
@ -232,7 +233,7 @@ function onDrop(ev: DragEvent): any {
removeFile(file.id); removeFile(file.id);
os.api('drive/files/update', { os.api('drive/files/update', {
fileId: file.id, fileId: file.id,
folderId: folder.value ? folder.value.id : null folderId: folder.value ? folder.value.id : null,
}); });
} }
//#endregion //#endregion
@ -248,7 +249,7 @@ function onDrop(ev: DragEvent): any {
removeFolder(droppedFolder.id); removeFolder(droppedFolder.id);
os.api('drive/folders/update', { os.api('drive/folders/update', {
folderId: droppedFolder.id, folderId: droppedFolder.id,
parentId: folder.value ? folder.value.id : null parentId: folder.value ? folder.value.id : null,
}).then(() => { }).then(() => {
// noop // noop
}).catch(err => { }).catch(err => {
@ -256,13 +257,13 @@ function onDrop(ev: DragEvent): any {
case 'detected-circular-definition': case 'detected-circular-definition':
os.alert({ os.alert({
title: i18n.ts.unableToProcess, title: i18n.ts.unableToProcess,
text: i18n.ts.circularReferenceFolder text: i18n.ts.circularReferenceFolder,
}); });
break; break;
default: default:
os.alert({ os.alert({
type: 'error', type: 'error',
text: i18n.ts.somethingHappened text: i18n.ts.somethingHappened,
}); });
} }
}); });
@ -278,17 +279,17 @@ function urlUpload() {
os.inputText({ os.inputText({
title: i18n.ts.uploadFromUrl, title: i18n.ts.uploadFromUrl,
type: 'url', type: 'url',
placeholder: i18n.ts.uploadFromUrlDescription placeholder: i18n.ts.uploadFromUrlDescription,
}).then(({ canceled, result: url }) => { }).then(({ canceled, result: url }) => {
if (canceled || !url) return; if (canceled || !url) return;
os.api('drive/files/upload-from-url', { os.api('drive/files/upload-from-url', {
url: url, url,
folderId: folder.value ? folder.value.id : undefined folderId: folder.value ? folder.value.id : undefined,
}); });
os.alert({ os.alert({
title: i18n.ts.uploadFromUrlRequested, title: i18n.ts.uploadFromUrlRequested,
text: i18n.ts.uploadFromUrlMayTakeTime text: i18n.ts.uploadFromUrlMayTakeTime,
}); });
}); });
} }
@ -296,12 +297,12 @@ function urlUpload() {
function createFolder() { function createFolder() {
os.inputText({ os.inputText({
title: i18n.ts.createFolder, title: i18n.ts.createFolder,
placeholder: i18n.ts.folderName placeholder: i18n.ts.folderName,
}).then(({ canceled, result: name }) => { }).then(({ canceled, result: name }) => {
if (canceled) return; if (canceled) return;
os.api('drive/folders/create', { os.api('drive/folders/create', {
name: name, name,
parentId: folder.value ? folder.value.id : undefined parentId: folder.value ? folder.value.id : undefined,
}).then(createdFolder => { }).then(createdFolder => {
addFolder(createdFolder, true); addFolder(createdFolder, true);
}); });
@ -312,12 +313,12 @@ function renameFolder(folderToRename: Misskey.entities.DriveFolder) {
os.inputText({ os.inputText({
title: i18n.ts.renameFolder, title: i18n.ts.renameFolder,
placeholder: i18n.ts.inputNewFolderName, placeholder: i18n.ts.inputNewFolderName,
default: folderToRename.name default: folderToRename.name,
}).then(({ canceled, result: name }) => { }).then(({ canceled, result: name }) => {
if (canceled) return; if (canceled) return;
os.api('drive/folders/update', { os.api('drive/folders/update', {
folderId: folderToRename.id, folderId: folderToRename.id,
name: name name,
}).then(updatedFolder => { }).then(updatedFolder => {
// FIXME: // FIXME:
move(updatedFolder); move(updatedFolder);
@ -327,7 +328,7 @@ function renameFolder(folderToRename: Misskey.entities.DriveFolder) {
function deleteFolder(folderToDelete: Misskey.entities.DriveFolder) { function deleteFolder(folderToDelete: Misskey.entities.DriveFolder) {
os.api('drive/folders/delete', { os.api('drive/folders/delete', {
folderId: folderToDelete.id folderId: folderToDelete.id,
}).then(() => { }).then(() => {
// //
move(folderToDelete.parentId); move(folderToDelete.parentId);
@ -337,13 +338,13 @@ function deleteFolder(folderToDelete: Misskey.entities.DriveFolder) {
os.alert({ os.alert({
type: 'error', type: 'error',
title: i18n.ts.unableToDelete, title: i18n.ts.unableToDelete,
text: i18n.ts.hasChildFilesOrFolders text: i18n.ts.hasChildFilesOrFolders,
}); });
break; break;
default: default:
os.alert({ os.alert({
type: 'error', type: 'error',
text: i18n.ts.unableToDelete text: i18n.ts.unableToDelete,
}); });
} }
}); });
@ -510,7 +511,7 @@ async function fetch() {
const foldersPromise = os.api('drive/folders', { const foldersPromise = os.api('drive/folders', {
folderId: folder.value ? folder.value.id : null, folderId: folder.value ? folder.value.id : null,
limit: foldersMax + 1 limit: foldersMax + 1,
}).then(fetchedFolders => { }).then(fetchedFolders => {
if (fetchedFolders.length === foldersMax + 1) { if (fetchedFolders.length === foldersMax + 1) {
moreFolders.value = true; moreFolders.value = true;
@ -522,7 +523,7 @@ async function fetch() {
const filesPromise = os.api('drive/files', { const filesPromise = os.api('drive/files', {
folderId: folder.value ? folder.value.id : null, folderId: folder.value ? folder.value.id : null,
type: props.type, type: props.type,
limit: filesMax + 1 limit: filesMax + 1,
}).then(fetchedFiles => { }).then(fetchedFiles => {
if (fetchedFiles.length === filesMax + 1) { if (fetchedFiles.length === filesMax + 1) {
moreFiles.value = true; moreFiles.value = true;
@ -549,7 +550,7 @@ function fetchMoreFiles() {
folderId: folder.value ? folder.value.id : null, folderId: folder.value ? folder.value.id : null,
type: props.type, type: props.type,
untilId: files.value[files.value.length - 1].id, untilId: files.value[files.value.length - 1].id,
limit: max + 1 limit: max + 1,
}).then(files => { }).then(files => {
if (files.length === max + 1) { if (files.length === max + 1) {
moreFiles.value = true; moreFiles.value = true;
@ -569,30 +570,30 @@ function getMenu() {
ref: keepOriginal, ref: keepOriginal,
}, null, { }, null, {
text: i18n.ts.addFile, text: i18n.ts.addFile,
type: 'label' type: 'label',
}, { }, {
text: i18n.ts.upload, text: i18n.ts.upload,
icon: 'fas fa-upload', icon: 'fas fa-upload',
action: () => { selectLocalFile(); } action: () => { selectLocalFile(); },
}, { }, {
text: i18n.ts.fromUrl, text: i18n.ts.fromUrl,
icon: 'fas fa-link', icon: 'fas fa-link',
action: () => { urlUpload(); } action: () => { urlUpload(); },
}, null, { }, null, {
text: folder.value ? folder.value.name : i18n.ts.drive, text: folder.value ? folder.value.name : i18n.ts.drive,
type: 'label' type: 'label',
}, folder.value ? { }, folder.value ? {
text: i18n.ts.renameFolder, text: i18n.ts.renameFolder,
icon: 'fas fa-i-cursor', icon: 'fas fa-i-cursor',
action: () => { renameFolder(folder.value); } action: () => { renameFolder(folder.value); },
} : undefined, folder.value ? { } : undefined, folder.value ? {
text: i18n.ts.deleteFolder, text: i18n.ts.deleteFolder,
icon: 'fas fa-trash-alt', icon: 'fas fa-trash-alt',
action: () => { deleteFolder(folder.value as Misskey.entities.DriveFolder); } action: () => { deleteFolder(folder.value as Misskey.entities.DriveFolder); },
} : undefined, { } : undefined, {
text: i18n.ts.createFolder, text: i18n.ts.createFolder,
icon: 'fas fa-folder-plus', icon: 'fas fa-folder-plus',
action: () => { createFolder(); } action: () => { createFolder(); },
}]; }];
} }

View file

@ -1,5 +1,6 @@
<template> <template>
<MkWindow ref="window" <MkWindow
ref="window"
:initial-width="null" :initial-width="null"
:initial-height="null" :initial-height="null"
:can-resize="false" :can-resize="false"

View file

@ -4,7 +4,8 @@
<i class="toggle fa-fw" :class="shown ? 'fas fa-chevron-down' : 'fas fa-chevron-up'"></i> <slot></slot> ({{ emojis.length }}) <i class="toggle fa-fw" :class="shown ? 'fas fa-chevron-down' : 'fas fa-chevron-up'"></i> <slot></slot> ({{ emojis.length }})
</header> </header>
<div v-if="shown"> <div v-if="shown">
<button v-for="emoji in emojis" <button
v-for="emoji in emojis"
:key="emoji" :key="emoji"
class="_button" class="_button"
@click="emit('chosen', emoji, $event)" @click="emit('chosen', emoji, $event)"

View file

@ -4,7 +4,8 @@
<div ref="emojis" class="emojis"> <div ref="emojis" class="emojis">
<section class="result"> <section class="result">
<div v-if="searchResultCustom.length > 0"> <div v-if="searchResultCustom.length > 0">
<button v-for="emoji in searchResultCustom" <button
v-for="emoji in searchResultCustom"
:key="emoji.id" :key="emoji.id"
class="_button" class="_button"
:title="emoji.name" :title="emoji.name"
@ -16,7 +17,8 @@
</button> </button>
</div> </div>
<div v-if="searchResultUnicode.length > 0"> <div v-if="searchResultUnicode.length > 0">
<button v-for="emoji in searchResultUnicode" <button
v-for="emoji in searchResultUnicode"
:key="emoji.name" :key="emoji.name"
class="_button" class="_button"
:title="emoji.name" :title="emoji.name"
@ -31,7 +33,8 @@
<div v-if="tab === 'index'" class="index"> <div v-if="tab === 'index'" class="index">
<section v-if="showPinned"> <section v-if="showPinned">
<div> <div>
<button v-for="emoji in pinned" <button
v-for="emoji in pinned"
:key="emoji" :key="emoji"
class="_button" class="_button"
tabindex="0" tabindex="0"
@ -45,7 +48,8 @@
<section> <section>
<header class="_acrylic"><i class="far fa-clock fa-fw"></i> {{ i18n.ts.recentUsed }}</header> <header class="_acrylic"><i class="far fa-clock fa-fw"></i> {{ i18n.ts.recentUsed }}</header>
<div> <div>
<button v-for="emoji in recentlyUsedEmojis" <button
v-for="emoji in recentlyUsedEmojis"
:key="emoji" :key="emoji"
class="_button" class="_button"
@click="chosen(emoji, $event)" @click="chosen(emoji, $event)"
@ -76,6 +80,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed, watch, onMounted } from 'vue'; import { ref, computed, watch, onMounted } from 'vue';
import * as Misskey from 'misskey-js'; import * as Misskey from 'misskey-js';
import XSection from './emoji-picker.section.vue';
import { emojilist, UnicodeEmojiDef, unicodeEmojiCategories as categories } from '@/scripts/emojilist'; import { emojilist, UnicodeEmojiDef, unicodeEmojiCategories as categories } from '@/scripts/emojilist';
import { getStaticImageUrl } from '@/scripts/get-static-image-url'; import { getStaticImageUrl } from '@/scripts/get-static-image-url';
import Ripple from '@/components/ripple.vue'; import Ripple from '@/components/ripple.vue';
@ -83,7 +88,6 @@ import * as os from '@/os';
import { isTouchUsing } from '@/scripts/touch'; import { isTouchUsing } from '@/scripts/touch';
import { deviceKind } from '@/scripts/device-kind'; import { deviceKind } from '@/scripts/device-kind';
import { emojiCategories, instance } from '@/instance'; import { emojiCategories, instance } from '@/instance';
import XSection from './emoji-picker.section.vue';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
import { defaultStore } from '@/store'; import { defaultStore } from '@/store';
@ -266,7 +270,7 @@ watch(q, () => {
function focus() { function focus() {
if (!['smartphone', 'tablet'].includes(deviceKind) && !isTouchUsing) { if (!['smartphone', 'tablet'].includes(deviceKind) && !isTouchUsing) {
search.value?.focus({ search.value?.focus({
preventScroll: true preventScroll: true,
}); });
} }
} }

View file

@ -1,5 +1,6 @@
<template> <template>
<button class="kpoogebi _button" <button
class="kpoogebi _button"
:class="{ wait, active: isFollowing || hasPendingFollowRequestFromYou, full, large }" :class="{ wait, active: isFollowing || hasPendingFollowRequestFromYou, full, large }"
:disabled="wait" :disabled="wait"
@click="onClick" @click="onClick"
@ -8,7 +9,8 @@
<template v-if="hasPendingFollowRequestFromYou && user.isLocked"> <template v-if="hasPendingFollowRequestFromYou && user.isLocked">
<span v-if="full">{{ i18n.ts.followRequestPending }}</span><i class="fas fa-hourglass-half"></i> <span v-if="full">{{ i18n.ts.followRequestPending }}</span><i class="fas fa-hourglass-half"></i>
</template> </template>
<template v-else-if="hasPendingFollowRequestFromYou && !user.isLocked"> <!-- つまりリモートフォローの場合 --> <template v-else-if="hasPendingFollowRequestFromYou && !user.isLocked">
<!-- つまりリモートフォローの場合 -->
<span v-if="full">{{ i18n.ts.processing }}</span><i class="fas fa-spinner fa-pulse"></i> <span v-if="full">{{ i18n.ts.processing }}</span><i class="fas fa-spinner fa-pulse"></i>
</template> </template>
<template v-else-if="isFollowing"> <template v-else-if="isFollowing">
@ -50,7 +52,7 @@ const connection = stream.useChannel('main');
if (props.user.isFollowing == null) { if (props.user.isFollowing == null) {
os.api('users/show', { os.api('users/show', {
userId: props.user.id userId: props.user.id,
}) })
.then(onFollowChange); .then(onFollowChange);
} }
@ -75,17 +77,17 @@ async function onClick() {
if (canceled) return; if (canceled) return;
await os.api('following/delete', { await os.api('following/delete', {
userId: props.user.id userId: props.user.id,
}); });
} else { } else {
if (hasPendingFollowRequestFromYou) { if (hasPendingFollowRequestFromYou) {
await os.api('following/requests/cancel', { await os.api('following/requests/cancel', {
userId: props.user.id userId: props.user.id,
}); });
hasPendingFollowRequestFromYou = false; hasPendingFollowRequestFromYou = false;
} else { } else {
await os.api('following/create', { await os.api('following/create', {
userId: props.user.id userId: props.user.id,
}); });
hasPendingFollowRequestFromYou = true; hasPendingFollowRequestFromYou = true;
} }

View file

@ -1,5 +1,6 @@
<template> <template>
<XModalWindow ref="dialog" <XModalWindow
ref="dialog"
:width="370" :width="370"
:height="400" :height="400"
@close="dialog.close()" @close="dialog.close()"

View file

@ -28,7 +28,7 @@ const process = () => {
// this might be a retry so reset the state // this might be a retry so reset the state
state = 'pending'; state = 'pending';
props.p?.().then((_result) => { props.p().then((_result) => {
result = _result; result = _result;
state = 'resolved'; state = 'resolved';
}, () => { }, () => {
@ -39,7 +39,7 @@ const process = () => {
watch(() => props.p, () => { watch(() => props.p, () => {
process(); process();
}, { }, {
immediate: true immediate: true,
}); });
</script> </script>

View file

@ -12,20 +12,20 @@ export default defineComponent({
props: { props: {
formula: { formula: {
type: String, type: String,
required: true required: true,
}, },
block: { block: {
type: Boolean, type: Boolean,
required: true required: true,
} },
}, },
computed: { computed: {
compiledFormula(): any { compiledFormula(): any {
return katex.renderToString(this.formula, { return katex.renderToString(this.formula, {
throwOnError: false throwOnError: false,
} as any); } as any);
} },
} },
}); });
</script> </script>

View file

@ -1,5 +1,5 @@
<template> <template>
<XFormula :formula="formula" :block="block" /> <XFormula :formula="formula" :block="block"/>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -8,17 +8,17 @@ import * as os from '@/os';
export default defineComponent({ export default defineComponent({
components: { components: {
XFormula: defineAsyncComponent(() => import('./formula-core.vue')) XFormula: defineAsyncComponent(() => import('./formula-core.vue')),
}, },
props: { props: {
formula: { formula: {
type: String, type: String,
required: true required: true,
}, },
block: { block: {
type: Boolean, type: Boolean,
required: true required: true,
} },
} },
}); });
</script> </script>

View file

@ -22,17 +22,17 @@ import * as os from '@/os';
export default defineComponent({ export default defineComponent({
components: { components: {
ImgWithBlurhash ImgWithBlurhash,
}, },
props: { props: {
post: { post: {
type: Object, type: Object,
required: true required: true,
}, },
}, },
methods: { methods: {
userName userName,
} },
}); });
</script> </script>

View file

@ -1,7 +1,7 @@
<template> <template>
<span class="mk-ellipsis"> <span class="mk-ellipsis">
<span>.</span><span>.</span><span>.</span> <span>.</span><span>.</span><span>.</span>
</span> </span>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>

View file

@ -16,24 +16,24 @@ export default defineComponent({
props: { props: {
emoji: { emoji: {
type: String, type: String,
required: true required: true,
}, },
normal: { normal: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false,
}, },
noStyle: { noStyle: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false,
}, },
customEmojis: { customEmojis: {
required: false required: false,
}, },
isReaction: { isReaction: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
}, },

View file

@ -30,7 +30,7 @@ export default defineComponent({
} else { } else {
if (nextBracketOpen > 0) parsed.push(str.substr(0, nextBracketOpen)); if (nextBracketOpen > 0) parsed.push(str.substr(0, nextBracketOpen));
parsed.push({ parsed.push({
arg: str.substring(nextBracketOpen + 1, nextBracketClose) arg: str.substring(nextBracketOpen + 1, nextBracketClose),
}); });
} }
@ -38,5 +38,5 @@ export default defineComponent({
} }
return h(this.tag, parsed.map(x => typeof x === 'string' ? (this.textTag ? h(this.textTag, x) : x) : this.$slots[x.arg]())); return h(this.tag, parsed.map(x => typeof x === 'string' ? (this.textTag ? h(this.textTag, x) : x) : this.$slots[x.arg]()));
} },
}); });

View file

@ -1,5 +1,5 @@
<template> <template>
<MfmCore :text="text" :plain="plain" :nowrap="nowrap" :author="author" :customEmojis="customEmojis" :isNote="isNote" class="havbbuyv" :class="{ nowrap }"/> <MfmCore :text="text" :plain="plain" :nowrap="nowrap" :author="author" :custom-emojis="customEmojis" :is-note="isNote" class="havbbuyv" :class="{ nowrap }"/>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>

View file

@ -59,7 +59,7 @@ export default defineComponent({
pathname: safeURIDecode(url.pathname), pathname: safeURIDecode(url.pathname),
query: safeURIDecode(url.search), query: safeURIDecode(url.search),
hash: safeURIDecode(url.hash), hash: safeURIDecode(url.hash),
self: self, self,
attr: self ? 'to' : 'href', attr: self ? 'to' : 'href',
target: self ? null : '_blank', target: self ? null : '_blank',
el, el,

View file

@ -21,13 +21,13 @@ const props = defineProps<{
const instance = props.instance ?? { const instance = props.instance ?? {
faviconUrl: '/favicon.ico', faviconUrl: '/favicon.ico',
name: instanceName, name: instanceName,
themeColor: (document.querySelector('meta[name="theme-color-orig"]') as HTMLMetaElement)?.content themeColor: (document.querySelector('meta[name="theme-color-orig"]') as HTMLMetaElement).content,
}; };
const themeColor = instance.themeColor ?? '#777777'; const themeColor = instance.themeColor ?? '#777777';
const bg = { const bg = {
background: `linear-gradient(90deg, ${themeColor}, ${themeColor}00)` background: `linear-gradient(90deg, ${themeColor}, ${themeColor}00)`,
}; };
</script> </script>

View file

@ -1,5 +1,6 @@
<template> <template>
<component :is="self ? 'MkA' : 'a'" ref="el" class="xlcxczvw _link" :[attr]="self ? url.substr(local.length) : url" :rel="rel" :target="target" <component
:is="self ? 'MkA' : 'a'" ref="el" class="xlcxczvw _link" :[attr]="self ? url.substr(local.length) : url" :rel="rel" :target="target"
:title="url" :title="url"
> >
<slot></slot> <slot></slot>

View file

@ -6,15 +6,18 @@
<span>{{ i18n.ts.clickToShow }}</span> <span>{{ i18n.ts.clickToShow }}</span>
</div> </div>
<div v-else-if="media.type.startsWith('audio') && media.type !== 'audio/midi'" class="audio"> <div v-else-if="media.type.startsWith('audio') && media.type !== 'audio/midi'" class="audio">
<audio ref="audioEl" <audio
ref="audioEl"
class="audio" class="audio"
:src="media.url" :src="media.url"
:title="media.name" :title="media.name"
controls controls
preload="metadata" preload="metadata"
@volumechange="volumechange" /> @volumechange="volumechange"
/>
</div> </div>
<a v-else class="download" <a
v-else class="download"
:href="media.url" :href="media.url"
:title="media.name" :title="media.name"
:download="media.name" :download="media.name"

View file

@ -215,7 +215,7 @@ function react(viaKeyboard = false): void {
reactionPicker.show(reactButton.value, reaction => { reactionPicker.show(reactButton.value, reaction => {
os.api('notes/reactions/create', { os.api('notes/reactions/create', {
noteId: appearNote.id, noteId: appearNote.id,
reaction: reaction, reaction,
}); });
}, () => { }, () => {
focus(); focus();
@ -244,12 +244,12 @@ function onContextmenu(ev: MouseEvent): void {
ev.preventDefault(); ev.preventDefault();
react(); react();
} else { } else {
os.contextMenu(getNoteMenu({ note: note, translating, translation, menuButton, isDeleted }), ev).then(focus); os.contextMenu(getNoteMenu({ note, translating, translation, menuButton, isDeleted }), ev).then(focus);
} }
} }
function menu(viaKeyboard = false): void { function menu(viaKeyboard = false): void {
os.popupMenu(getNoteMenu({ note: note, translating, translation, menuButton, isDeleted }), menuButton.value, { os.popupMenu(getNoteMenu({ note, translating, translation, menuButton, isDeleted }), menuButton.value, {
viaKeyboard, viaKeyboard,
}).then(focus); }).then(focus);
} }
@ -267,7 +267,7 @@ function showRenoteMenu(viaKeyboard = false): void {
isDeleted.value = true; isDeleted.value = true;
}, },
}], renoteTime.value, { }], renoteTime.value, {
viaKeyboard: viaKeyboard, viaKeyboard,
}); });
} }

View file

@ -209,7 +209,7 @@ function react(viaKeyboard = false): void {
reactionPicker.show(reactButton.value, reaction => { reactionPicker.show(reactButton.value, reaction => {
os.api('notes/reactions/create', { os.api('notes/reactions/create', {
noteId: appearNote.id, noteId: appearNote.id,
reaction: reaction, reaction,
}); });
}, () => { }, () => {
focus(); focus();
@ -240,12 +240,12 @@ function onContextmenu(ev: MouseEvent): void {
ev.preventDefault(); ev.preventDefault();
react(); react();
} else { } else {
os.contextMenu(getNoteMenu({ note: note, translating, translation, menuButton, isDeleted, currentClipPage }), ev).then(focus); os.contextMenu(getNoteMenu({ note, translating, translation, menuButton, isDeleted, currentClipPage }), ev).then(focus);
} }
} }
function menu(viaKeyboard = false): void { function menu(viaKeyboard = false): void {
os.popupMenu(getNoteMenu({ note: note, translating, translation, menuButton, isDeleted, currentClipPage }), menuButton.value, { os.popupMenu(getNoteMenu({ note, translating, translation, menuButton, isDeleted, currentClipPage }), menuButton.value, {
viaKeyboard, viaKeyboard,
}).then(focus); }).then(focus);
} }
@ -263,7 +263,7 @@ function showRenoteMenu(viaKeyboard = false): void {
isDeleted.value = true; isDeleted.value = true;
}, },
}], renoteTime.value, { }], renoteTime.value, {
viaKeyboard: viaKeyboard, viaKeyboard,
}); });
} }

View file

@ -23,12 +23,12 @@ export default defineComponent({
props: { props: {
page: { page: {
type: Object, type: Object,
required: true required: true,
}, },
}, },
methods: { methods: {
userName userName,
} },
}); });
</script> </script>

View file

@ -24,21 +24,21 @@ import { Block } from '@/scripts/hpml/block';
export default defineComponent({ export default defineComponent({
components: { components: {
XText, XSection, XImage, XButton, XNumberInput, XTextInput, XTextareaInput, XTextarea, XPost, XSwitch, XIf, XCounter, XRadioButton, XCanvas, XNote XText, XSection, XImage, XButton, XNumberInput, XTextInput, XTextareaInput, XTextarea, XPost, XSwitch, XIf, XCounter, XRadioButton, XCanvas, XNote,
}, },
props: { props: {
block: { block: {
type: Object as PropType<Block>, type: Object as PropType<Block>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
}, },
h: { h: {
type: Number, type: Number,
required: true required: true,
} },
}, },
}); });
</script> </script>

View file

@ -13,24 +13,24 @@ import { Hpml } from '@/scripts/hpml/evaluator';
export default defineComponent({ export default defineComponent({
components: { components: {
MkButton MkButton,
}, },
props: { props: {
block: { block: {
type: Object as PropType<ButtonBlock>, type: Object as PropType<ButtonBlock>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
} },
}, },
methods: { methods: {
click() { click() {
if (this.block.action === 'dialog') { if (this.block.action === 'dialog') {
this.hpml.eval(); this.hpml.eval();
os.alert({ os.alert({
text: this.hpml.interpolate(this.block.content) text: this.hpml.interpolate(this.block.content),
}); });
} else if (this.block.action === 'resetRandom') { } else if (this.block.action === 'resetRandom') {
this.hpml.updateRandomSeed(Math.random()); this.hpml.updateRandomSeed(Math.random());
@ -40,19 +40,19 @@ export default defineComponent({
pageId: this.hpml.page.id, pageId: this.hpml.page.id,
event: this.block.event, event: this.block.event,
...(this.block.var ? { ...(this.block.var ? {
var: unref(this.hpml.vars)[this.block.var] var: unref(this.hpml.vars)[this.block.var],
} : {}) } : {}),
}); });
os.alert({ os.alert({
type: 'success', type: 'success',
text: this.hpml.interpolate(this.block.message) text: this.hpml.interpolate(this.block.message),
}); });
} else if (this.block.action === 'callAiScript') { } else if (this.block.action === 'callAiScript') {
this.hpml.callAiScript(this.block.fn); this.hpml.callAiScript(this.block.fn);
} }
} },
} },
}); });
</script> </script>

View file

@ -14,12 +14,12 @@ export default defineComponent({
props: { props: {
block: { block: {
type: Object as PropType<CanvasBlock>, type: Object as PropType<CanvasBlock>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
} },
}, },
setup(props, ctx) { setup(props, ctx) {
const canvas: Ref<any> = ref(null); const canvas: Ref<any> = ref(null);
@ -29,9 +29,9 @@ export default defineComponent({
}); });
return { return {
canvas canvas,
}; };
} },
}); });
</script> </script>

View file

@ -13,17 +13,17 @@ import { Hpml } from '@/scripts/hpml/evaluator';
export default defineComponent({ export default defineComponent({
components: { components: {
MkButton MkButton,
}, },
props: { props: {
block: { block: {
type: Object as PropType<CounterVarBlock>, type: Object as PropType<CounterVarBlock>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
} },
}, },
setup(props, ctx) { setup(props, ctx) {
const value = computed(() => { const value = computed(() => {
@ -36,9 +36,9 @@ export default defineComponent({
} }
return { return {
click click,
}; };
} },
}); });
</script> </script>

View file

@ -5,27 +5,27 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, defineAsyncComponent, PropType } from 'vue';
import { IfBlock } from '@/scripts/hpml/block'; import { IfBlock } from '@/scripts/hpml/block';
import { Hpml } from '@/scripts/hpml/evaluator'; import { Hpml } from '@/scripts/hpml/evaluator';
import { defineComponent, defineAsyncComponent, PropType } from 'vue';
export default defineComponent({ export default defineComponent({
components: { components: {
XBlock: defineAsyncComponent(() => import('./page.block.vue')) XBlock: defineAsyncComponent(() => import('./page.block.vue')),
}, },
props: { props: {
block: { block: {
type: Object as PropType<IfBlock>, type: Object as PropType<IfBlock>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
}, },
h: { h: {
type: Number, type: Number,
required: true required: true,
} },
}, },
}); });
</script> </script>

View file

@ -20,8 +20,8 @@ export default defineComponent({
props: { props: {
block: { block: {
type: Object as PropType<NoteBlock>, type: Object as PropType<NoteBlock>,
required: true required: true,
} },
}, },
setup(props, ctx) { setup(props, ctx) {
const note: Ref<Record<string, any> | null> = ref(null); const note: Ref<Record<string, any> | null> = ref(null);
@ -34,9 +34,9 @@ export default defineComponent({
}); });
return { return {
note note,
}; };
} },
}); });
</script> </script>

View file

@ -15,17 +15,17 @@ import { NumberInputVarBlock } from '@/scripts/hpml/block';
export default defineComponent({ export default defineComponent({
components: { components: {
MkInput MkInput,
}, },
props: { props: {
block: { block: {
type: Object as PropType<NumberInputVarBlock>, type: Object as PropType<NumberInputVarBlock>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
} },
}, },
setup(props, ctx) { setup(props, ctx) {
const value = computed(() => { const value = computed(() => {
@ -39,9 +39,9 @@ export default defineComponent({
return { return {
value, value,
updateValue updateValue,
}; };
} },
}); });
</script> </script>

View file

@ -25,12 +25,12 @@ export default defineComponent({
props: { props: {
block: { block: {
type: Object as PropType<PostBlock>, type: Object as PropType<PostBlock>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
} },
}, },
data() { data() {
return { return {
@ -44,8 +44,8 @@ export default defineComponent({
handler() { handler() {
this.text = this.hpml.interpolate(this.block.text); this.text = this.hpml.interpolate(this.block.text);
}, },
deep: true deep: true,
} },
}, },
methods: { methods: {
upload() { upload() {
@ -83,8 +83,8 @@ export default defineComponent({
}).then(() => { }).then(() => {
this.posted = true; this.posted = true;
}); });
} },
} },
}); });
</script> </script>

View file

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<div>{{ hpml.interpolate(block.title) }}</div> <div>{{ hpml.interpolate(block.title) }}</div>
<MkRadio v-for="item in block.values" :key="item" :modelValue="value" :value="item" @update:modelValue="updateValue($event)">{{ item }}</MkRadio> <MkRadio v-for="item in block.values" :key="item" :model-value="value" :value="item" @update:modelValue="updateValue($event)">{{ item }}</MkRadio>
</div> </div>
</template> </template>
@ -14,17 +14,17 @@ import { RadioButtonVarBlock } from '@/scripts/hpml/block';
export default defineComponent({ export default defineComponent({
components: { components: {
MkRadio MkRadio,
}, },
props: { props: {
block: { block: {
type: Object as PropType<RadioButtonVarBlock>, type: Object as PropType<RadioButtonVarBlock>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
} },
}, },
setup(props, ctx) { setup(props, ctx) {
const value = computed(() => { const value = computed(() => {
@ -38,8 +38,8 @@ export default defineComponent({
return { return {
value, value,
updateValue updateValue,
}; };
} },
}); });
</script> </script>

View file

@ -16,20 +16,20 @@ import { Hpml } from '@/scripts/hpml/evaluator';
export default defineComponent({ export default defineComponent({
components: { components: {
XBlock: defineAsyncComponent(() => import('./page.block.vue')) XBlock: defineAsyncComponent(() => import('./page.block.vue')),
}, },
props: { props: {
block: { block: {
type: Object as PropType<SectionBlock>, type: Object as PropType<SectionBlock>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
}, },
h: { h: {
required: true required: true,
} },
}, },
}); });
</script> </script>

View file

@ -13,17 +13,17 @@ import { SwitchVarBlock } from '@/scripts/hpml/block';
export default defineComponent({ export default defineComponent({
components: { components: {
MkSwitch MkSwitch,
}, },
props: { props: {
block: { block: {
type: Object as PropType<SwitchVarBlock>, type: Object as PropType<SwitchVarBlock>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
} },
}, },
setup(props, ctx) { setup(props, ctx) {
const value = computed(() => { const value = computed(() => {
@ -37,9 +37,9 @@ export default defineComponent({
return { return {
value, value,
updateValue updateValue,
}; };
} },
}); });
</script> </script>

View file

@ -15,17 +15,17 @@ import { TextInputVarBlock } from '@/scripts/hpml/block';
export default defineComponent({ export default defineComponent({
components: { components: {
MkInput MkInput,
}, },
props: { props: {
block: { block: {
type: Object as PropType<TextInputVarBlock>, type: Object as PropType<TextInputVarBlock>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
} },
}, },
setup(props, ctx) { setup(props, ctx) {
const value = computed(() => { const value = computed(() => {
@ -39,9 +39,9 @@ export default defineComponent({
return { return {
value, value,
updateValue updateValue,
}; };
} },
}); });
</script> </script>

View file

@ -16,17 +16,17 @@ import { TextInputVarBlock } from '@/scripts/hpml/block';
export default defineComponent({ export default defineComponent({
components: { components: {
MkTextarea MkTextarea,
}, },
props: { props: {
block: { block: {
type: Object as PropType<TextInputVarBlock>, type: Object as PropType<TextInputVarBlock>,
required: true required: true,
}, },
hpml: { hpml: {
type: Object as PropType<Hpml>, type: Object as PropType<Hpml>,
required: true required: true,
} },
}, },
setup(props, ctx) { setup(props, ctx) {
const value = computed(() => { const value = computed(() => {
@ -40,8 +40,8 @@ export default defineComponent({
return { return {
value, value,
updateValue updateValue,
}; };
} },
}); });
</script> </script>

View file

@ -15,20 +15,20 @@ import { defaultStore } from '@/store';
export default defineComponent({ export default defineComponent({
components: { components: {
XBlock XBlock,
}, },
props: { props: {
page: { page: {
type: Object as PropType<Record<string, any>>, type: Object as PropType<Record<string, any>>,
required: true required: true,
}, },
}, },
setup(props, ctx) { setup(props, ctx) {
const hpml = new Hpml(props.page, { const hpml = new Hpml(props.page, {
randomSeed: Math.random(), randomSeed: Math.random(),
visitor: $i, visitor: $i,
url: url, url,
enableAiScript: !defaultStore.state.disablePagesScript enableAiScript: !defaultStore.state.disablePagesScript,
}); });
onMounted(() => { onMounted(() => {

View file

@ -22,18 +22,18 @@ import * as os from '@/os';
export default defineComponent({ export default defineComponent({
components: { components: {
XDraggable: defineAsyncComponent(() => import('vuedraggable').then(x => x.default)), XDraggable: defineAsyncComponent(() => import('vuedraggable').then(x => x.default)),
MkDriveFileThumbnail MkDriveFileThumbnail,
}, },
props: { props: {
files: { files: {
type: Array, type: Array,
required: true required: true,
}, },
detachMediaFn: { detachMediaFn: {
type: Function, type: Function,
required: false required: false,
} },
}, },
emits: ['updated', 'detach', 'changeSensitive', 'changeName'], emits: ['updated', 'detach', 'changeSensitive', 'changeName'],
@ -51,8 +51,8 @@ export default defineComponent({
}, },
set(value) { set(value) {
this.$emit('updated', value); this.$emit('updated', value);
} },
} },
}, },
methods: { methods: {
@ -66,7 +66,7 @@ export default defineComponent({
toggleSensitive(file) { toggleSensitive(file) {
os.api('drive/files/update', { os.api('drive/files/update', {
fileId: file.id, fileId: file.id,
isSensitive: !file.isSensitive isSensitive: !file.isSensitive,
}).then(() => { }).then(() => {
this.$emit('changeSensitive', file, !file.isSensitive); this.$emit('changeSensitive', file, !file.isSensitive);
}); });
@ -75,12 +75,12 @@ export default defineComponent({
const { canceled, result } = await os.inputText({ const { canceled, result } = await os.inputText({
title: this.$ts.enterFileName, title: this.$ts.enterFileName,
default: file.name, default: file.name,
allowEmpty: false allowEmpty: false,
}); });
if (canceled) return; if (canceled) return;
os.api('drive/files/update', { os.api('drive/files/update', {
fileId: file.id, fileId: file.id,
name: result name: result,
}).then(() => { }).then(() => {
this.$emit('changeName', file, result); this.$emit('changeName', file, result);
file.name = result; file.name = result;
@ -94,18 +94,18 @@ export default defineComponent({
placeholder: this.$ts.inputNewDescription, placeholder: this.$ts.inputNewDescription,
default: file.comment !== null ? file.comment : '', default: file.comment !== null ? file.comment : '',
}, },
image: file image: file,
}, { }, {
done: result => { done: result => {
if (!result || result.canceled) return; if (!result || result.canceled) return;
let comment = result.result.length === 0 ? null : result.result; let comment = result.result.length === 0 ? null : result.result;
os.api('drive/files/update', { os.api('drive/files/update', {
fileId: file.id, fileId: file.id,
comment: comment, comment,
}).then(() => { }).then(() => {
file.comment = comment; file.comment = comment;
}); });
} },
}, 'closed'); }, 'closed');
}, },
@ -114,22 +114,22 @@ export default defineComponent({
this.menu = os.popupMenu([{ this.menu = os.popupMenu([{
text: this.$ts.renameFile, text: this.$ts.renameFile,
icon: 'fas fa-i-cursor', icon: 'fas fa-i-cursor',
action: () => { this.rename(file); } action: () => { this.rename(file); },
}, { }, {
text: file.isSensitive ? this.$ts.unmarkAsSensitive : this.$ts.markAsSensitive, text: file.isSensitive ? this.$ts.unmarkAsSensitive : this.$ts.markAsSensitive,
icon: file.isSensitive ? 'fas fa-eye-slash' : 'fas fa-eye', icon: file.isSensitive ? 'fas fa-eye-slash' : 'fas fa-eye',
action: () => { this.toggleSensitive(file); } action: () => { this.toggleSensitive(file); },
}, { }, {
text: this.$ts.describeFile, text: this.$ts.describeFile,
icon: 'fas fa-i-cursor', icon: 'fas fa-i-cursor',
action: () => { this.describe(file); } action: () => { this.describe(file); },
}, { }, {
text: this.$ts.attachCancel, text: this.$ts.attachCancel,
icon: 'fas fa-times-circle', icon: 'fas fa-times-circle',
action: () => { this.detachMedia(file.id); } action: () => { this.detachMedia(file.id); },
}], ev.currentTarget ?? ev.target).then(() => this.menu = null); }], ev.currentTarget ?? ev.target).then(() => this.menu = null);
} },
} },
}); });
</script> </script>

View file

@ -1,5 +1,6 @@
<template> <template>
<div v-size="{ max: [310, 500] }" class="gafaadew" <div
v-size="{ max: [310, 500] }" class="gafaadew"
:class="{ modal, _popup: modal }" :class="{ modal, _popup: modal }"
@dragover.stop="onDragover" @dragover.stop="onDragover"
@dragenter="onDragenter" @dragenter="onDragenter"
@ -68,6 +69,8 @@ import * as misskey from 'misskey-js';
import insertTextAtCursor from 'insert-text-at-cursor'; import insertTextAtCursor from 'insert-text-at-cursor';
import { length } from 'stringz'; import { length } from 'stringz';
import { toASCII } from 'punycode/'; import { toASCII } from 'punycode/';
import * as Acct from 'misskey-js/built/acct';
import { throttle } from 'throttle-debounce';
import XNoteSimple from './note-simple.vue'; import XNoteSimple from './note-simple.vue';
import XNotePreview from './note-preview.vue'; import XNotePreview from './note-preview.vue';
import XPostFormAttaches from './post-form-attaches.vue'; import XPostFormAttaches from './post-form-attaches.vue';
@ -75,14 +78,12 @@ import XPollEditor from './poll-editor.vue';
import { host, url } from '@/config'; import { host, url } from '@/config';
import { erase, unique } from '@/scripts/array'; import { erase, unique } from '@/scripts/array';
import { extractMentions } from '@/scripts/extract-mentions'; import { extractMentions } from '@/scripts/extract-mentions';
import * as Acct from 'misskey-js/built/acct';
import { formatTimeString } from '@/scripts/format-time-string'; import { formatTimeString } from '@/scripts/format-time-string';
import { Autocomplete } from '@/scripts/autocomplete'; import { Autocomplete } from '@/scripts/autocomplete';
import * as os from '@/os'; import * as os from '@/os';
import { stream } from '@/stream'; import { stream } from '@/stream';
import { selectFiles } from '@/scripts/select-file'; import { selectFiles } from '@/scripts/select-file';
import { defaultStore, notePostInterruptors, postFormActions } from '@/store'; import { defaultStore, notePostInterruptors, postFormActions } from '@/store';
import { throttle } from 'throttle-debounce';
import MkInfo from '@/components/ui/info.vue'; import MkInfo from '@/components/ui/info.vue';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
import { instance } from '@/instance'; import { instance } from '@/instance';
@ -181,7 +182,7 @@ const placeholder = $computed((): string => {
i18n.ts._postForm._placeholders.c, i18n.ts._postForm._placeholders.c,
i18n.ts._postForm._placeholders.d, i18n.ts._postForm._placeholders.d,
i18n.ts._postForm._placeholders.e, i18n.ts._postForm._placeholders.e,
i18n.ts._postForm._placeholders.f i18n.ts._postForm._placeholders.f,
]; ];
return xs[Math.floor(Math.random() * xs.length)]; return xs[Math.floor(Math.random() * xs.length)];
} }
@ -263,7 +264,7 @@ if (props.reply && ['home', 'followers', 'specified'].includes(props.reply.visib
visibility = props.reply.visibility; visibility = props.reply.visibility;
if (props.reply.visibility === 'specified') { if (props.reply.visibility === 'specified') {
os.api('users/show', { os.api('users/show', {
userIds: props.reply.visibleUserIds.filter(uid => uid !== $i.id && uid !== props.reply.userId) userIds: props.reply.visibleUserIds.filter(uid => uid !== $i.id && uid !== props.reply.userId),
}).then(users => { }).then(users => {
users.forEach(pushVisibleUser); users.forEach(pushVisibleUser);
}); });
@ -399,7 +400,7 @@ function setVisibility() {
if (defaultStore.state.rememberNoteVisibility) { if (defaultStore.state.rememberNoteVisibility) {
defaultStore.set('localOnly', localOnly); defaultStore.set('localOnly', localOnly);
} }
} },
}, 'closed'); }, 'closed');
} }
@ -516,14 +517,14 @@ function saveDraft() {
draftData[draftKey] = { draftData[draftKey] = {
updatedAt: new Date(), updatedAt: new Date(),
data: { data: {
text: text, text,
useCw: useCw, useCw,
cw: cw, cw,
visibility: visibility, visibility,
localOnly: localOnly, localOnly,
files: files, files,
poll: poll poll,
} },
}; };
localStorage.setItem('drafts', JSON.stringify(draftData)); localStorage.setItem('drafts', JSON.stringify(draftData));
@ -544,10 +545,10 @@ async function post() {
replyId: props.reply ? props.reply.id : undefined, replyId: props.reply ? props.reply.id : undefined,
renoteId: props.renote ? props.renote.id : quoteId ? quoteId : undefined, renoteId: props.renote ? props.renote.id : quoteId ? quoteId : undefined,
channelId: props.channel ? props.channel.id : undefined, channelId: props.channel ? props.channel.id : undefined,
poll: poll, poll,
cw: useCw ? cw || '' : undefined, cw: useCw ? cw || '' : undefined,
localOnly: localOnly, localOnly,
visibility: visibility, visibility,
visibleUserIds: visibility === 'specified' ? visibleUsers.map(u => u.id) : undefined, visibleUserIds: visibility === 'specified' ? visibleUsers.map(u => u.id) : undefined,
}; };
@ -612,11 +613,11 @@ function showActions(ev) {
text: action.title, text: action.title,
action: () => { action: () => {
action.handler({ action.handler({
text: text text,
}, (key, value) => { }, (key, value) => {
if (key === 'text') { text = value; } if (key === 'text') { text = value; }
}); });
} },
})), ev.currentTarget ?? ev.target); })), ev.currentTarget ?? ev.target);
} }

View file

@ -67,7 +67,7 @@ onMounted(() => {
borderJoinStyle: 'round', borderJoinStyle: 'round',
borderColor: '#00E396', borderColor: '#00E396',
backgroundColor: '#00E3961A', backgroundColor: '#00E3961A',
data: [] data: [],
}, { }, {
label: 'Active', label: 'Active',
pointRadius: 0, pointRadius: 0,
@ -76,7 +76,7 @@ onMounted(() => {
borderJoinStyle: 'round', borderJoinStyle: 'round',
borderColor: '#00BCD4', borderColor: '#00BCD4',
backgroundColor: '#00BCD41A', backgroundColor: '#00BCD41A',
data: [] data: [],
}, { }, {
label: 'Waiting', label: 'Waiting',
pointRadius: 0, pointRadius: 0,
@ -86,7 +86,7 @@ onMounted(() => {
borderColor: '#FFB300', borderColor: '#FFB300',
backgroundColor: '#FFB3001A', backgroundColor: '#FFB3001A',
yAxisID: 'y2', yAxisID: 'y2',
data: [] data: [],
}, { }, {
label: 'Delayed', label: 'Delayed',
pointRadius: 0, pointRadius: 0,
@ -97,7 +97,7 @@ onMounted(() => {
borderDash: [5, 5], borderDash: [5, 5],
fill: false, fill: false,
yAxisID: 'y2', yAxisID: 'y2',
data: [] data: [],
}], }],
}, },
options: { options: {
@ -119,7 +119,7 @@ onMounted(() => {
}, },
ticks: { ticks: {
display: false, display: false,
maxTicksLimit: 10 maxTicksLimit: 10,
}, },
}, },
y: { y: {

View file

@ -7,8 +7,8 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed } from 'vue'; import { computed } from 'vue';
import * as misskey from 'misskey-js'; import * as misskey from 'misskey-js';
import { $i } from '@/account';
import XReaction from './reactions-viewer.reaction.vue'; import XReaction from './reactions-viewer.reaction.vue';
import { $i } from '@/account';
const props = defineProps<{ const props = defineProps<{
note: misskey.entities.Note; note: misskey.entities.Note;

View file

@ -1,5 +1,6 @@
<template> <template>
<button v-if="canRenote" <button
v-if="canRenote"
ref="buttonRef" ref="buttonRef"
class="eddddedb _button canRenote" class="eddddedb _button canRenote"
@click="renote()" @click="renote()"
@ -41,7 +42,7 @@ export default defineComponent({
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,
limit: 11 limit: 11,
}); });
const users = renotes.map(x => x.user); const users = renotes.map(x => x.user);
@ -52,7 +53,7 @@ export default defineComponent({
showing, showing,
users, users,
count: props.count, count: props.count,
targetElement: buttonRef.value targetElement: buttonRef.value,
}, {}, 'closed'); }, {}, 'closed');
}); });
@ -66,7 +67,7 @@ export default defineComponent({
renoteId: props.note.id, renoteId: props.note.id,
visibility: props.note.visibility, visibility: props.note.visibility,
}); });
} },
}, { }, {
text: i18n.ts.quote, text: i18n.ts.quote,
icon: 'fas fa-quote-right', icon: 'fas fa-quote-right',
@ -74,9 +75,9 @@ export default defineComponent({
os.post({ os.post({
renote: props.note, renote: props.note,
}); });
} },
}], buttonRef.value, { }], buttonRef.value, {
viaKeyboard viaKeyboard,
}); });
}; };

View file

@ -2,7 +2,8 @@
<div class="vswabwbm" :style="{ zIndex, top: `${y - 64}px`, left: `${x - 64}px` }" :class="{ active }"> <div class="vswabwbm" :style="{ zIndex, top: `${y - 64}px`, left: `${x - 64}px` }" :class="{ active }">
<svg width="128" height="128" viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg"> <svg width="128" height="128" viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg">
<circle fill="none" cx="64" cy="64"> <circle fill="none" cx="64" cy="64">
<animate attributeName="r" <animate
attributeName="r"
begin="0s" dur="0.5s" begin="0s" dur="0.5s"
values="4; 32" values="4; 32"
calcMode="spline" calcMode="spline"
@ -10,7 +11,8 @@
keySplines="0.165, 0.84, 0.44, 1" keySplines="0.165, 0.84, 0.44, 1"
repeatCount="1" repeatCount="1"
/> />
<animate attributeName="stroke-width" <animate
attributeName="stroke-width"
begin="0s" dur="0.5s" begin="0s" dur="0.5s"
values="16; 0" values="16; 0"
calcMode="spline" calcMode="spline"
@ -21,7 +23,8 @@
</circle> </circle>
<g fill="none" fill-rule="evenodd"> <g fill="none" fill-rule="evenodd">
<circle v-for="(particle, i) in particles" :key="i" :fill="particle.color"> <circle v-for="(particle, i) in particles" :key="i" :fill="particle.color">
<animate attributeName="r" <animate
attributeName="r"
begin="0s" dur="0.8s" begin="0s" dur="0.8s"
:values="`${particle.size}; 0`" :values="`${particle.size}; 0`"
calcMode="spline" calcMode="spline"
@ -29,7 +32,8 @@
keySplines="0.165, 0.84, 0.44, 1" keySplines="0.165, 0.84, 0.44, 1"
repeatCount="1" repeatCount="1"
/> />
<animate attributeName="cx" <animate
attributeName="cx"
begin="0s" dur="0.8s" begin="0s" dur="0.8s"
:values="`${particle.xA}; ${particle.xB}`" :values="`${particle.xA}; ${particle.xB}`"
calcMode="spline" calcMode="spline"
@ -37,7 +41,8 @@
keySplines="0.3, 0.61, 0.355, 1" keySplines="0.3, 0.61, 0.355, 1"
repeatCount="1" repeatCount="1"
/> />
<animate attributeName="cy" <animate
attributeName="cy"
begin="0s" dur="0.8s" begin="0s" dur="0.8s"
:values="`${particle.yA}; ${particle.yB}`" :values="`${particle.yA}; ${particle.yB}`"
calcMode="spline" calcMode="spline"
@ -59,17 +64,17 @@ export default defineComponent({
props: { props: {
x: { x: {
type: Number, type: Number,
required: true required: true,
}, },
y: { y: {
type: Number, type: Number,
required: true required: true,
}, },
particle: { particle: {
type: Boolean, type: Boolean,
required: false, required: false,
default: true, default: true,
} },
}, },
emits: ['end'], emits: ['end'],
setup(props, context) { setup(props, context) {
@ -88,7 +93,7 @@ export default defineComponent({
yA: origin + (Math.cos(angle) * pos), yA: origin + (Math.cos(angle) * pos),
xB: origin + (Math.sin(angle) * (pos + velocity)), xB: origin + (Math.sin(angle) * (pos + velocity)),
yB: origin + (Math.cos(angle) * (pos + velocity)), yB: origin + (Math.cos(angle) * (pos + velocity)),
color: colors[Math.floor(Math.random() * colors.length)] color: colors[Math.floor(Math.random() * colors.length)],
}); });
} }
} }

View file

@ -77,7 +77,7 @@ function openDrive(): void {
function openMenu(ev): void { function openMenu(ev): void {
os.popupMenu([{ os.popupMenu([{
type: 'label', type: 'label',
text: 'Fruits' text: 'Fruits',
}, { }, {
text: 'Create some apples', text: 'Create some apples',
action: (): void => {}, action: (): void => {},

View file

@ -51,6 +51,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { defineAsyncComponent } from 'vue'; import { defineAsyncComponent } from 'vue';
import { toUnicode } from 'punycode/'; import { toUnicode } from 'punycode/';
import { showSuspendedDialog } from '../scripts/show-suspended-dialog';
import MkButton from '@/components/ui/button.vue'; import MkButton from '@/components/ui/button.vue';
import MkInput from '@/components/form/input.vue'; import MkInput from '@/components/form/input.vue';
import MkInfo from '@/components/ui/info.vue'; import MkInfo from '@/components/ui/info.vue';
@ -58,7 +59,6 @@ import { apiUrl, host as configHost } from '@/config';
import { byteify, hexify } from '@/scripts/2fa'; import { byteify, hexify } from '@/scripts/2fa';
import * as os from '@/os'; import * as os from '@/os';
import { login } from '@/account'; import { login } from '@/account';
import { showSuspendedDialog } from '../scripts/show-suspended-dialog';
import { instance } from '@/instance'; import { instance } from '@/instance';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
@ -85,7 +85,7 @@ const props = defineProps({
withAvatar: { withAvatar: {
type: Boolean, type: Boolean,
required: false, required: false,
default: true default: true,
}, },
autoSet: { autoSet: {
type: Boolean, type: Boolean,
@ -95,13 +95,13 @@ const props = defineProps({
message: { message: {
type: String, type: String,
required: false, required: false,
default: '' default: '',
} },
}); });
function onUsernameChange() { function onUsernameChange() {
os.api('users/show', { os.api('users/show', {
username: username username,
}).then(userResponse => { }).then(userResponse => {
user = userResponse; user = userResponse;
}, () => { }, () => {
@ -123,10 +123,10 @@ function queryKey() {
allowCredentials: challengeData.securityKeys.map(key => ({ allowCredentials: challengeData.securityKeys.map(key => ({
id: byteify(key.id, 'hex'), id: byteify(key.id, 'hex'),
type: 'public-key', type: 'public-key',
transports: ['usb', 'nfc', 'ble', 'internal'] transports: ['usb', 'nfc', 'ble', 'internal'],
})), })),
timeout: 60 * 1000 timeout: 60 * 1000,
} },
}).catch(() => { }).catch(() => {
queryingKey = false; queryingKey = false;
return Promise.reject(null); return Promise.reject(null);
@ -151,7 +151,7 @@ function queryKey() {
if (err === null) return; if (err === null) return;
os.alert({ os.alert({
type: 'error', type: 'error',
text: i18n.ts.signinFailed text: i18n.ts.signinFailed,
}); });
signing = false; signing = false;
}); });
@ -183,7 +183,7 @@ function onSubmit() {
password, password,
'hcaptcha-response': hCaptchaResponse, 'hcaptcha-response': hCaptchaResponse,
'g-recaptcha-response': reCaptchaResponse, 'g-recaptcha-response': reCaptchaResponse,
token: user && user.twoFactorEnabled ? token : undefined token: user && user.twoFactorEnabled ? token : undefined,
}).then(res => { }).then(res => {
emit('login', res); emit('login', res);
onLogin(res); onLogin(res);
@ -197,7 +197,7 @@ function loginFailed(err) {
os.alert({ os.alert({
type: 'error', type: 'error',
title: i18n.ts.loginFailed, title: i18n.ts.loginFailed,
text: i18n.ts.noSuchUser text: i18n.ts.noSuchUser,
}); });
break; break;
} }
@ -226,7 +226,7 @@ function loginFailed(err) {
os.alert({ os.alert({
type: 'error', type: 'error',
title: i18n.ts.loginFailed, title: i18n.ts.loginFailed,
text: JSON.stringify(err) text: JSON.stringify(err),
}); });
} }
} }

View file

@ -18,13 +18,13 @@ export default defineComponent({
disabled: this.modelValue === option.props.value, disabled: this.modelValue === option.props.value,
onClick: () => { onClick: () => {
this.$emit('update:modelValue', option.props.value); this.$emit('update:modelValue', option.props.value);
} },
}, option.children), [ }, option.children), [
[resolveDirective('click-anime')] [resolveDirective('click-anime')],
]))), [ ]))), [
[resolveDirective('size'), { max: [500] }] [resolveDirective('size'), { max: [500] }],
]); ]);
} },
}); });
</script> </script>

View file

@ -59,10 +59,10 @@ let connection2;
if (props.src === 'antenna') { if (props.src === 'antenna') {
endpoint = 'antennas/notes'; endpoint = 'antennas/notes';
query = { query = {
antennaId: props.antenna antennaId: props.antenna,
}; };
connection = stream.useChannel('antenna', { connection = stream.useChannel('antenna', {
antennaId: props.antenna antennaId: props.antenna,
}); });
connection.on('note', prepend); connection.on('note', prepend);
} else if (props.src === 'home') { } else if (props.src === 'home') {
@ -92,7 +92,7 @@ if (props.src === 'antenna') {
} else if (props.src === 'directs') { } else if (props.src === 'directs') {
endpoint = 'notes/mentions'; endpoint = 'notes/mentions';
query = { query = {
visibility: 'specified' visibility: 'specified',
}; };
const onNote = note => { const onNote = note => {
if (note.visibility === 'specified') { if (note.visibility === 'specified') {
@ -104,10 +104,10 @@ if (props.src === 'antenna') {
} else if (props.src === 'list') { } else if (props.src === 'list') {
endpoint = 'notes/user-list-timeline'; endpoint = 'notes/user-list-timeline';
query = { query = {
listId: props.list listId: props.list,
}; };
connection = stream.useChannel('userList', { connection = stream.useChannel('userList', {
listId: props.list listId: props.list,
}); });
connection.on('note', prepend); connection.on('note', prepend);
connection.on('userAdded', onUserAdded); connection.on('userAdded', onUserAdded);
@ -115,16 +115,16 @@ if (props.src === 'antenna') {
} else if (props.src === 'channel') { } else if (props.src === 'channel') {
endpoint = 'channels/timeline'; endpoint = 'channels/timeline';
query = { query = {
channelId: props.channel channelId: props.channel,
}; };
connection = stream.useChannel('channel', { connection = stream.useChannel('channel', {
channelId: props.channel channelId: props.channel,
}); });
connection.on('note', prepend); connection.on('note', prepend);
} }
const pagination = { const pagination = {
endpoint: endpoint, endpoint,
limit: 10, limit: 10,
params: query, params: query,
}; };

View file

@ -1,5 +1,6 @@
<template> <template>
<XModalWindow ref="dialog" <XModalWindow
ref="dialog"
:width="400" :width="400"
:height="450" :height="450"
:with-ok-button="true" :with-ok-button="true"
@ -30,12 +31,12 @@
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import { permissions } from 'misskey-js'; import { permissions } from 'misskey-js';
import XModalWindow from '@/components/ui/modal-window.vue';
import MkInput from './form/input.vue'; import MkInput from './form/input.vue';
import MkTextarea from './form/textarea.vue'; import MkTextarea from './form/textarea.vue';
import MkSwitch from './form/switch.vue'; import MkSwitch from './form/switch.vue';
import MkButton from './ui/button.vue'; import MkButton from './ui/button.vue';
import MkInfo from './ui/info.vue'; import MkInfo from './ui/info.vue';
import XModalWindow from '@/components/ui/modal-window.vue';
export default defineComponent({ export default defineComponent({
components: { components: {
@ -51,23 +52,23 @@ export default defineComponent({
title: { title: {
type: String, type: String,
required: false, required: false,
default: null default: null,
}, },
information: { information: {
type: String, type: String,
required: false, required: false,
default: null default: null,
}, },
initialName: { initialName: {
type: String, type: String,
required: false, required: false,
default: null default: null,
}, },
initialPermissions: { initialPermissions: {
type: Array, type: Array,
required: false, required: false,
default: null default: null,
} },
}, },
emits: ['done', 'closed'], emits: ['done', 'closed'],
@ -76,7 +77,7 @@ export default defineComponent({
return { return {
name: this.initialName, name: this.initialName,
permissions: {}, permissions: {},
kinds: permissions kinds: permissions,
}; };
}, },
@ -96,7 +97,7 @@ export default defineComponent({
ok() { ok() {
this.$emit('done', { this.$emit('done', {
name: this.name, name: this.name,
permissions: Object.keys(this.permissions).filter(p => this.permissions[p]) permissions: Object.keys(this.permissions).filter(p => this.permissions[p]),
}); });
this.$refs.dialog.close(); this.$refs.dialog.close();
}, },
@ -111,7 +112,7 @@ export default defineComponent({
for (const p in this.permissions) { for (const p in this.permissions) {
this.permissions[p] = true; this.permissions[p] = true;
} }
} },
} },
}); });
</script> </script>

View file

@ -1,5 +1,6 @@
<template> <template>
<button v-if="!link" class="bghgjjyj _button" <button
v-if="!link" class="bghgjjyj _button"
:class="{ inline, primary, gradate, danger, rounded, full }" :class="{ inline, primary, gradate, danger, rounded, full }"
:type="type" :type="type"
@click="$emit('click', $event)" @click="$emit('click', $event)"
@ -10,7 +11,8 @@
<slot></slot> <slot></slot>
</div> </div>
</button> </button>
<MkA v-else class="bghgjjyj _button" <MkA
v-else class="bghgjjyj _button"
:class="{ inline, primary, gradate, danger, rounded, full }" :class="{ inline, primary, gradate, danger, rounded, full }"
:to="to" :to="to"
@mousedown="onMousedown" @mousedown="onMousedown"
@ -29,56 +31,56 @@ export default defineComponent({
props: { props: {
type: { type: {
type: String, type: String,
required: false required: false,
}, },
primary: { primary: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false,
}, },
gradate: { gradate: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false,
}, },
rounded: { rounded: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false,
}, },
inline: { inline: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false,
}, },
link: { link: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false,
}, },
to: { to: {
type: String, type: String,
required: false required: false,
}, },
autofocus: { autofocus: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false,
}, },
wait: { wait: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false,
}, },
danger: { danger: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false,
}, },
full: { full: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false,
}, },
}, },
emits: ['click'], emits: ['click'],
@ -127,8 +129,8 @@ export default defineComponent({
window.setTimeout(() => { window.setTimeout(() => {
if (this.$refs.ripples) this.$refs.ripples.removeChild(ripple); if (this.$refs.ripples) this.$refs.ripples.removeChild(ripple);
}, 2000); }, 2000);
} },
} },
}); });
</script> </script>

View file

@ -10,7 +10,8 @@
</button> </button>
</div> </div>
</header> </header>
<transition :name="$store.state.animation ? 'container-toggle' : ''" <transition
:name="$store.state.animation ? 'container-toggle' : ''"
@enter="enter" @enter="enter"
@after-enter="afterEnter" @after-enter="afterEnter"
@leave="leave" @leave="leave"
@ -34,37 +35,37 @@ export default defineComponent({
showHeader: { showHeader: {
type: Boolean, type: Boolean,
required: false, required: false,
default: true default: true,
}, },
thin: { thin: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false,
}, },
naked: { naked: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false,
}, },
foldable: { foldable: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false,
}, },
expanded: { expanded: {
type: Boolean, type: Boolean,
required: false, required: false,
default: true default: true,
}, },
scrollable: { scrollable: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false,
}, },
maxHeight: { maxHeight: {
type: Number, type: Number,
required: false, required: false,
default: null default: null,
}, },
}, },
data() { data() {
@ -84,7 +85,7 @@ export default defineComponent({
this.$el.style.flexBasis = `${headerHeight}px`; this.$el.style.flexBasis = `${headerHeight}px`;
} }
}, { }, {
immediate: true immediate: true,
}); });
this.$el.style.setProperty('--maxHeight', this.maxHeight + 'px'); this.$el.style.setProperty('--maxHeight', this.maxHeight + 'px');
@ -124,7 +125,7 @@ export default defineComponent({
afterLeave(el) { afterLeave(el) {
el.style.height = null; el.style.height = null;
}, },
} },
}); });
</script> </script>

View file

@ -8,9 +8,9 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, onBeforeUnmount } from 'vue'; import { onMounted, onBeforeUnmount } from 'vue';
import contains from '@/scripts/contains';
import MkMenu from './menu.vue'; import MkMenu from './menu.vue';
import { MenuItem } from './types/menu.vue'; import { MenuItem } from './types/menu.vue';
import contains from '@/scripts/contains';
import * as os from '@/os'; import * as os from '@/os';
const props = defineProps<{ const props = defineProps<{

View file

@ -8,7 +8,8 @@
<template v-else><i class="fas fa-angle-down"></i></template> <template v-else><i class="fas fa-angle-down"></i></template>
</button> </button>
</header> </header>
<transition :name="$store.state.animation ? 'folder-toggle' : ''" <transition
:name="$store.state.animation ? 'folder-toggle' : ''"
@enter="enter" @enter="enter"
@after-enter="afterEnter" @after-enter="afterEnter"
@leave="leave" @leave="leave"
@ -32,12 +33,12 @@ export default defineComponent({
expanded: { expanded: {
type: Boolean, type: Boolean,
required: false, required: false,
default: true default: true,
}, },
persistKey: { persistKey: {
type: String, type: String,
required: false, required: false,
default: null default: null,
}, },
}, },
data() { data() {
@ -51,7 +52,7 @@ export default defineComponent({
if (this.persistKey) { if (this.persistKey) {
localStorage.setItem(localStoragePrefix + this.persistKey, this.showBody ? 't' : 'f'); localStorage.setItem(localStoragePrefix + this.persistKey, this.showBody ? 't' : 'f');
} }
} },
}, },
mounted() { mounted() {
function getParentBg(el: Element | null): string { function getParentBg(el: Element | null): string {
@ -91,7 +92,7 @@ export default defineComponent({
afterLeave(el) { afterLeave(el) {
el.style.height = null; el.style.height = null;
}, },
} },
}); });
</script> </script>

View file

@ -15,13 +15,13 @@ export default defineComponent({
warn: { warn: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false,
}, },
}, },
data() { data() {
return { return {
}; };
} },
}); });
</script> </script>

View file

@ -30,7 +30,7 @@ export default defineComponent({
props: { props: {
def: { def: {
type: Array, type: Array,
required: true required: true,
}, },
grid: { grid: {
type: Boolean, type: Boolean,

View file

@ -13,20 +13,20 @@ import * as os from '@/os';
export default defineComponent({ export default defineComponent({
components: { components: {
MkUrlPreview MkUrlPreview,
}, },
props: { props: {
url: { url: {
type: String, type: String,
required: true required: true,
}, },
source: { source: {
required: true required: true,
}, },
showing: { showing: {
type: Boolean, type: Boolean,
required: true required: true,
}, },
}, },

View file

@ -58,7 +58,7 @@ let sitename = $ref<string | null>(null);
let player = $ref({ let player = $ref({
url: null, url: null,
width: null, width: null,
height: null height: null,
}); });
let playerEnabled = $ref(false); let playerEnabled = $ref(false);
let tweetId = $ref<string | null>(null); let tweetId = $ref<string | null>(null);

View file

@ -40,21 +40,21 @@ import * as os from '@/os';
export default defineComponent({ export default defineComponent({
components: { components: {
MkFollowButton MkFollowButton,
}, },
props: { props: {
showing: { showing: {
type: Boolean, type: Boolean,
required: true required: true,
}, },
q: { q: {
type: String, type: String,
required: true required: true,
}, },
source: { source: {
required: true required: true,
} },
}, },
emits: ['closed', 'mouseover', 'mouseleave'], emits: ['closed', 'mouseover', 'mouseleave'],
@ -94,8 +94,8 @@ export default defineComponent({
}, },
methods: { methods: {
userPage userPage,
} },
}); });
</script> </script>

View file

@ -80,8 +80,8 @@ const search = () => {
return; return;
} }
os.api('users/search-by-username-and-host', { os.api('users/search-by-username-and-host', {
username: username, username,
host: host, host,
limit: 10, limit: 10,
detail: false, detail: false,
}).then(_users => { }).then(_users => {

View file

@ -1,5 +1,5 @@
const address = new URL(location.href); const address = new URL(location.href);
const siteName = (document.querySelector('meta[property="og:site_name"]') as HTMLMetaElement)?.content; const siteName = (document.querySelector('meta[property="og:site_name"]') as HTMLMetaElement).content;
export const host = address.host; export const host = address.host;
export const hostname = address.hostname; export const hostname = address.hostname;

View file

@ -18,5 +18,5 @@ export default {
unmounted(src, binding, vn) { unmounted(src, binding, vn) {
if (src._observer_) src._observer_.disconnect(); if (src._observer_) src._observer_.disconnect();
} },
} as Directive; } as Directive;

View file

@ -27,5 +27,5 @@ export default {
el.classList.add('_anime_bounce_standBy'); el.classList.add('_anime_bounce_standBy');
}); });
*/ */
} },
} as Directive; } as Directive;

View file

@ -39,7 +39,7 @@ export default {
}); });
resize.observe(src); resize.observe(src);
mountings.set(src, { resize, fn: binding.value, }); mountings.set(src, { resize, fn: binding.value });
calc(src); calc(src);
}, },
@ -50,5 +50,5 @@ export default {
info.resize.disconnect(); info.resize.disconnect();
if (info.intersection) info.intersection.disconnect(); if (info.intersection) info.intersection.disconnect();
mountings.delete(src); mountings.delete(src);
} },
} as Directive<Element, (w: number, h: number) => void>; } as Directive<Element, (w: number, h: number) => void>;

View file

@ -20,5 +20,5 @@ export default {
} else { } else {
el.removeEventListener('keydown', el._keyHandler); el.removeEventListener('keydown', el._keyHandler);
} }
} },
} as Directive; } as Directive;

View file

@ -14,5 +14,5 @@ export default {
popup(Ripple, { x, y }, {}, 'end'); popup(Ripple, { x, y }, {}, 'end');
}); });
} },
}; };

View file

@ -29,7 +29,7 @@ function getClassOrder(width: number, queue: Value): ClassOrder {
remove: [ remove: [
...(queue.max ? queue.max.filter(v => width > v).map(getMaxClass) : []), ...(queue.max ? queue.max.filter(v => width > v).map(getMaxClass) : []),
...(queue.min ? queue.min.filter(v => width < v).map(getMinClass) : []), ...(queue.min ? queue.min.filter(v => width < v).map(getMinClass) : []),
] ],
}; };
} }
@ -103,5 +103,5 @@ export default {
info.resize.disconnect(); info.resize.disconnect();
if (info.intersection) info.intersection.disconnect(); if (info.intersection) info.intersection.disconnect();
mountings.delete(src); mountings.delete(src);
} },
} as Directive<Element, Value>; } as Directive<Element, Value>;

View file

@ -27,7 +27,7 @@ export class UserPreview {
popup(defineAsyncComponent(() => import('@/components/user-preview.vue')), { popup(defineAsyncComponent(() => import('@/components/user-preview.vue')), {
showing, showing,
q: this.user, q: this.user,
source: this.el source: this.el,
}, { }, {
mouseover: () => { mouseover: () => {
window.clearTimeout(this.hideTimer); window.clearTimeout(this.hideTimer);
@ -41,7 +41,7 @@ export class UserPreview {
this.promise = { this.promise = {
cancel: () => { cancel: () => {
showing.value = false; showing.value = false;
} },
}; };
this.checkTimer = window.setInterval(() => { this.checkTimer = window.setInterval(() => {
@ -114,5 +114,5 @@ export default {
const self = el._userPreviewDirective_; const self = el._userPreviewDirective_;
self.preview.detach(); self.preview.detach();
} },
} as Directive; } as Directive;

View file

@ -14,7 +14,7 @@ export const instance: Misskey.entities.InstanceMetadata = reactive(instanceData
export async function fetchInstance() { export async function fetchInstance() {
const meta = await api('meta', { const meta = await api('meta', {
detail: false detail: false,
}); });
for (const [k, v] of Object.entries(meta)) { for (const [k, v] of Object.entries(meta)) {

View file

@ -137,9 +137,9 @@ export function promiseDialog<T extends Promise<any>>(
// NOTE: dynamic importすると挙動がおかしくなる(showingの変更が伝播しない) // NOTE: dynamic importすると挙動がおかしくなる(showingの変更が伝播しない)
popup(MkWaitingDialog, { popup(MkWaitingDialog, {
success: success, success,
showing: showing, showing,
text: text, text,
}, {}, 'closed'); }, {}, 'closed');
return promise; return promise;
@ -354,7 +354,7 @@ export function success() {
}, 1000); }, 1000);
popup(defineAsyncComponent(() => import('@/components/waiting-dialog.vue')), { popup(defineAsyncComponent(() => import('@/components/waiting-dialog.vue')), {
success: true, success: true,
showing: showing, showing,
}, { }, {
done: () => resolve(), done: () => resolve(),
}, 'closed'); }, 'closed');
@ -366,7 +366,7 @@ export function waiting() {
const showing = ref(true); const showing = ref(true);
popup(defineAsyncComponent(() => import('@/components/waiting-dialog.vue')), { popup(defineAsyncComponent(() => import('@/components/waiting-dialog.vue')), {
success: false, success: false,
showing: showing, showing,
}, { }, {
done: () => resolve(), done: () => resolve(),
}, 'closed'); }, 'closed');

View file

@ -1,4 +1,5 @@
<template><MkStickyContainer> <template>
<MkStickyContainer>
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template> <template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :content-max="800" :margin-min="16" :margin-max="32"> <MkSpacer :content-max="800" :margin-min="16" :margin-max="32">
<FormSuspense v-slot="{ result: database }" :p="databasePromiseFactory"> <FormSuspense v-slot="{ result: database }" :p="databasePromiseFactory">
@ -7,7 +8,8 @@
<template #value>{{ bytes(table[1].size) }} ({{ number(table[1].count) }} recs)</template> <template #value>{{ bytes(table[1].size) }} ({{ number(table[1].count) }} recs)</template>
</MkKeyValue> </MkKeyValue>
</FormSuspense> </FormSuspense>
</MkSpacer></MkStickyContainer> </MkSpacer>
</MkStickyContainer>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>

View file

@ -137,7 +137,7 @@ const add = async (ev: MouseEvent) => {
const edit = (emoji) => { const edit = (emoji) => {
os.popup(defineAsyncComponent(() => import('./emoji-edit-dialog.vue')), { os.popup(defineAsyncComponent(() => import('./emoji-edit-dialog.vue')), {
emoji: emoji, emoji,
}, { }, {
done: result => { done: result => {
if (result.updated) { if (result.updated) {

View file

@ -56,7 +56,7 @@ const pagination = {
params: computed(() => ({ params: computed(() => ({
type: (type && type !== '') ? type : null, type: (type && type !== '') ? type : null,
userId: (userId && userId !== '') ? userId : null, userId: (userId && userId !== '') ? userId : null,
origin: origin, origin,
hostname: (searchHost && searchHost !== '') ? searchHost : null, hostname: (searchHost && searchHost !== '') ? searchHost : null,
})), })),
}; };

View file

@ -1,4 +1,5 @@
<template><MkStickyContainer> <template>
<MkStickyContainer>
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template> <template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :content-max="700" :margin-min="16" :margin-max="32"> <MkSpacer :content-max="700" :margin-min="16" :margin-max="32">
<FormSuspense :p="init"> <FormSuspense :p="init">
@ -21,7 +22,8 @@
<XDiscord/> <XDiscord/>
</FormFolder> </FormFolder>
</FormSuspense> </FormSuspense>
</MkSpacer></MkStickyContainer> </MkSpacer>
</MkStickyContainer>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>

View file

@ -1,4 +1,5 @@
<template><MkStickyContainer> <template>
<MkStickyContainer>
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template> <template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :content-max="700" :margin-min="16" :margin-max="32"> <MkSpacer :content-max="700" :margin-min="16" :margin-max="32">
<FormSuspense :p="init"> <FormSuspense :p="init">
@ -10,7 +11,8 @@
<FormButton primary class="_formBlock" @click="chooseProxyAccount">{{ i18n.ts.selectAccount }}</FormButton> <FormButton primary class="_formBlock" @click="chooseProxyAccount">{{ i18n.ts.selectAccount }}</FormButton>
</FormSuspense> </FormSuspense>
</MkSpacer></MkStickyContainer> </MkSpacer>
</MkStickyContainer>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -45,7 +47,7 @@ function chooseProxyAccount() {
function save() { function save() {
os.apiWithDialog('admin/update-meta', { os.apiWithDialog('admin/update-meta', {
proxyAccountId: proxyAccountId, proxyAccountId,
}).then(() => { }).then(() => {
fetchInstance(); fetchInstance();
}); });

View file

@ -75,9 +75,9 @@ const pagination = {
endpoint: 'admin/show-users' as const, endpoint: 'admin/show-users' as const,
limit: 10, limit: 10,
params: computed(() => ({ params: computed(() => ({
sort: sort, sort,
state: state, state,
origin: origin, origin,
username: searchUsername, username: searchUsername,
hostname: searchHost, hostname: searchHost,
})), })),
@ -103,8 +103,8 @@ async function addUser() {
if (canceled2) return; if (canceled2) return;
os.apiWithDialog('admin/accounts/create', { os.apiWithDialog('admin/accounts/create', {
username: username, username,
password: password, password,
}).then(res => { }).then(res => {
paginationComponent.reload(); paginationComponent.reload();
}); });

View file

@ -31,9 +31,9 @@ import { onMounted } from 'vue';
import XForm from './auth.form.vue'; import XForm from './auth.form.vue';
import MkSignin from '@/components/signin.vue'; import MkSignin from '@/components/signin.vue';
import * as os from '@/os'; import * as os from '@/os';
import { login } from '@/account'; import { login , $i } from '@/account';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
import { $i } from '@/account';
import { query, appendQuery } from '@/scripts/url'; import { query, appendQuery } from '@/scripts/url';
const props = defineProps<{ const props = defineProps<{

View file

@ -76,9 +76,9 @@ fetchChannel();
function save() { function save() {
const params = { const params = {
name: name, name,
description: description, description,
bannerId: bannerId, bannerId,
}; };
if (props.channelId) { if (props.channelId) {

View file

@ -24,11 +24,11 @@
<script lang="ts" setup> <script lang="ts" setup>
import { watch } from 'vue'; import { watch } from 'vue';
import XEmoji from './emojis.emoji.vue';
import MkInput from '@/components/form/input.vue'; import MkInput from '@/components/form/input.vue';
import MkFolder from '@/components/ui/folder.vue'; import MkFolder from '@/components/ui/folder.vue';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
import { emojiCategories, instance } from '@/instance'; import { emojiCategories, instance } from '@/instance';
import XEmoji from './emojis.emoji.vue';
let q: string = $ref(''); let q: string = $ref('');
let searchEmojis: null | Record<string, any>[] = $ref(null); let searchEmojis: null | Record<string, any>[] = $ref(null);

View file

@ -28,7 +28,7 @@ function menu(ev) {
action: () => { action: () => {
copyToClipboard(`:${props.emoji.name}:`); copyToClipboard(`:${props.emoji.name}:`);
os.success(); os.success();
} },
}], ev.currentTarget ?? ev.target); }], ev.currentTarget ?? ev.target);
} }
</script> </script>

View file

@ -71,7 +71,7 @@ const pagination = {
limit: 10, limit: 10,
offsetMode: true, offsetMode: true,
params: computed(() => ({ params: computed(() => ({
sort: sort, sort,
host: host !== '' ? host : null, host: host !== '' ? host : null,
...( ...(
state === 'federating' ? { federating: true } : state === 'federating' ? { federating: true } :

View file

@ -69,18 +69,18 @@ async function save() {
if (props.postId) { if (props.postId) {
await os.apiWithDialog('gallery/posts/update', { await os.apiWithDialog('gallery/posts/update', {
postId: props.postId, postId: props.postId,
title: title, title,
description: description, description,
fileIds: files.map(file => file.id), fileIds: files.map(file => file.id),
isSensitive: isSensitive, isSensitive,
}); });
router.push(`/gallery/${props.postId}`); router.push(`/gallery/${props.postId}`);
} else { } else {
const created = await os.apiWithDialog('gallery/posts/create', { const created = await os.apiWithDialog('gallery/posts/create', {
title: title, title,
description: description, description,
fileIds: files.map(file => file.id), fileIds: files.map(file => file.id),
isSensitive: isSensitive, isSensitive,
}); });
router.push(`/gallery/${created.id}`); router.push(`/gallery/${created.id}`);
} }

View file

@ -1,8 +1,10 @@
<template><MkStickyContainer> <template>
<MkStickyContainer>
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template> <template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :content-max="800"> <MkSpacer :content-max="800">
<XNotes :pagination="pagination"/> <XNotes :pagination="pagination"/>
</MkSpacer></MkStickyContainer> </MkSpacer>
</MkStickyContainer>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>

View file

@ -1,8 +1,10 @@
<template><MkStickyContainer> <template>
<MkStickyContainer>
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template> <template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :content-max="800"> <MkSpacer :content-max="800">
<XNotes :pagination="pagination"/> <XNotes :pagination="pagination"/>
</MkSpacer></MkStickyContainer> </MkSpacer>
</MkStickyContainer>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>

View file

@ -179,8 +179,8 @@ function saveDraft() {
updatedAt: new Date(), updatedAt: new Date(),
// eslint-disable-next-line id-denylist // eslint-disable-next-line id-denylist
data: { data: {
text: text, text,
file: file, file,
}, },
}; };

View file

@ -2,7 +2,7 @@
<div v-size="{ max: [400, 500] }" class="thvuemwp" :class="{ isMe }"> <div v-size="{ max: [400, 500] }" class="thvuemwp" :class="{ isMe }">
<MkAvatar class="avatar" :user="message.user" :show-indicator="true"/> <MkAvatar class="avatar" :user="message.user" :show-indicator="true"/>
<div class="content"> <div class="content">
<div class="balloon" :class="{ noText: message.text == null }" > <div class="balloon" :class="{ noText: message.text == null }">
<button v-if="isMe" class="delete-button" :title="$ts.delete" @click="del"> <button v-if="isMe" class="delete-button" :title="$ts.delete" @click="del">
<img src="/client-assets/remove.png" alt="Delete"/> <img src="/client-assets/remove.png" alt="Delete"/>
</button> </button>

View file

@ -1,4 +1,5 @@
<template><MkStickyContainer> <template>
<MkStickyContainer>
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template> <template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :content-max="700"> <MkSpacer :content-max="700">
<div class="ieepwinx"> <div class="ieepwinx">
@ -12,7 +13,8 @@
</MkPagination> </MkPagination>
</div> </div>
</div> </div>
</MkSpacer></MkStickyContainer> </MkSpacer>
</MkStickyContainer>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>

View file

@ -116,7 +116,7 @@ function acceptInvite(invitation): void {
function rejectInvite(invitation): void { function rejectInvite(invitation): void {
os.api('users/groups/invitations/reject', { os.api('users/groups/invitations/reject', {
invitationId: invitation.id invitationId: invitation.id,
}).then(() => { }).then(() => {
invitations.reload(); invitations.reload();
}); });

View file

@ -37,7 +37,7 @@ async function create() {
title: i18n.ts.enterListName, title: i18n.ts.enterListName,
}); });
if (canceled) return; if (canceled) return;
await os.apiWithDialog('users/lists/create', { name: name }); await os.apiWithDialog('users/lists/create', { name });
pagingComponent.reload(); pagingComponent.reload();
} }

View file

@ -94,7 +94,7 @@ async function renameList() {
await os.api('users/lists/update', { await os.api('users/lists/update', {
listId: list.id, listId: list.id,
name: name, name,
}); });
list.name = name; list.name = name;

Some files were not shown because too many files have changed in this diff Show more