client: fix some lints
Some checks failed
ci/woodpecker/push/build Pipeline failed
ci/woodpecker/push/test Pipeline failed
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed

Mostly focused on "@typescript-eslint/no-unused-vars" but also fixed some
other lints along the way.
This commit is contained in:
Johann150 2022-08-12 08:35:22 +02:00
parent a267e7afdc
commit 5b4c0ffdf3
Signed by: Johann150
GPG key ID: 9EE6577A2A06F8F1
99 changed files with 174 additions and 310 deletions

View file

@ -33,16 +33,16 @@ import XNoteHeader from './note-header.vue';
import MkNoteSubNoteContent from './sub-note-content.vue'; import MkNoteSubNoteContent from './sub-note-content.vue';
import XCwButton from './cw-button.vue'; import XCwButton from './cw-button.vue';
import { notePage } from '@/filters/note'; import { notePage } from '@/filters/note';
import * as os from '@/os';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
note: misskey.entities.Note; note: misskey.entities.Note;
conversation?: misskey.entities.Note[]; conversation?: misskey.entities.Note[] | null;
// how many notes are in between this one and the note being viewed in detail // how many notes are in between this one and the note being viewed in detail
depth?: number; depth?: number;
}>(), { }>(), {
conversation: null,
depth: 1, depth: 1,
}); });

View file

@ -43,12 +43,12 @@ const emit = defineEmits<{
const uiWindow = ref<InstanceType<typeof XWindow>>(); const uiWindow = ref<InstanceType<typeof XWindow>>();
const comment = ref(''); const comment = ref('');
function send() { function send(): void {
os.apiWithDialog('users/report-abuse', { os.apiWithDialog('users/report-abuse', {
userId: props.user.id, userId: props.user.id,
urls: props.urls || [], urls: props.urls || [],
comment: comment.value, comment: comment.value,
}).then(res => { }).then(() => {
os.alert({ os.alert({
type: 'success', type: 'success',
text: i18n.ts.abuseReported, text: i18n.ts.abuseReported,

View file

@ -21,7 +21,7 @@
<div v-if="report.urls.length > 0"> <div v-if="report.urls.length > 0">
{{ i18n.ts.notes }}: {{ i18n.ts.notes }}:
<ul> <ul>
<li v-for="url in report.urls"><MkUrl :url="url"/></li> <li v-for="url in report.urls" :key="url"><MkUrl :url="url"/></li>
</ul> </ul>
</div> </div>
<hr/> <hr/>
@ -47,12 +47,11 @@ import MkButton from '@/components/ui/button.vue';
import MkSwitch from '@/components/form/switch.vue'; import MkSwitch from '@/components/form/switch.vue';
import MkKeyValue from '@/components/key-value.vue'; import MkKeyValue from '@/components/key-value.vue';
import MkUrl from '@/components/global/url.vue'; import MkUrl from '@/components/global/url.vue';
import { acct, userPage } from '@/filters/user';
import * as os from '@/os'; import * as os from '@/os';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
const props = defineProps<{ const props = defineProps<{
report: any; report: Record<string, any>;
}>(); }>();
const emit = defineEmits<{ const emit = defineEmits<{
@ -61,7 +60,7 @@ const emit = defineEmits<{
let forward = $ref(props.report.forwarded); let forward = $ref(props.report.forwarded);
function resolve() { function resolve(): void {
os.apiWithDialog('admin/resolve-abuse-user-report', { os.apiWithDialog('admin/resolve-abuse-user-report', {
forward, forward,
reportId: props.report.id, reportId: props.report.id,

View file

@ -83,7 +83,7 @@ const graduations = computed(() => {
return angles; return angles;
}); });
function tick() { function tick(): void {
now.value = new Date(); now.value = new Date();
} }

View file

@ -16,7 +16,7 @@
import { } from 'vue'; import { } from 'vue';
import MkTooltip from './ui/tooltip.vue'; import MkTooltip from './ui/tooltip.vue';
const props = defineProps<{ defineProps<{
showing: boolean; showing: boolean;
x: number; x: number;
y: number; y: number;

View file

@ -13,7 +13,7 @@
id-denylist violation when setting it. This is causing about 60+ lint issues. id-denylist violation when setting it. This is causing about 60+ lint issues.
As this is part of Chart.js's API it makes sense to disable the check here. As this is part of Chart.js's API it makes sense to disable the check here.
*/ */
import { onMounted, ref, watch, PropType, onUnmounted } from 'vue'; import { onMounted, ref, watch, PropType } from 'vue';
import { import {
Chart, Chart,
ArcElement, ArcElement,
@ -173,7 +173,7 @@ const render = () => {
// //
Chart.defaults.color = getComputedStyle(document.documentElement).getPropertyValue('--fg'); Chart.defaults.color = getComputedStyle(document.documentElement).getPropertyValue('--fg');
const maxes = chartData.series.map((x, i) => Math.max(...x.data.map(d => d.y))); const maxes = chartData.series.map((x) => Math.max(...x.data.map(d => d.y)));
chartInstance = new Chart(chartEl.value, { chartInstance = new Chart(chartEl.value, {
type: props.bar ? 'bar' : 'line', type: props.bar ? 'bar' : 'line',
@ -315,7 +315,7 @@ const render = () => {
}, },
plugins: [{ plugins: [{
id: 'vLine', id: 'vLine',
beforeDraw(chart, args, options) { beforeDraw(chart) {
if (chart.tooltip._active && chart.tooltip._active.length) { if (chart.tooltip._active && chart.tooltip._active.length) {
const activePoint = chart.tooltip._active[0]; const activePoint = chart.tooltip._active[0];
const ctx = chart.ctx; const ctx = chart.ctx;
@ -337,10 +337,6 @@ const render = () => {
}); });
}; };
const exportData = () => {
// TODO
};
const fetchFederationChart = async (): Promise<typeof chartData> => { const fetchFederationChart = async (): Promise<typeof chartData> => {
const raw = await os.apiGet('charts/federation', { limit: props.limit, span: props.span }); const raw = await os.apiGet('charts/federation', { limit: props.limit, span: props.span });
return { return {

View file

@ -26,7 +26,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { nextTick, onMounted } from 'vue'; import { onMounted } from 'vue';
import * as misskey from 'misskey-js'; import * as misskey from 'misskey-js';
import Cropper from 'cropperjs'; import Cropper from 'cropperjs';
import tinycolor from 'tinycolor2'; import tinycolor from 'tinycolor2';

View file

@ -26,7 +26,7 @@ export default defineComponent({
}, },
}, },
setup(props, { slots, expose }) { setup(props, { slots }) {
function getDateText(time: string) { function getDateText(time: string) {
const date = new Date(time).getDate(); const date = new Date(time).getDate();
const month = new Date(time).getMonth() + 1; const month = new Date(time).getMonth() + 1;

View file

@ -179,10 +179,6 @@ function onDragend() {
emit('dragend'); emit('dragend');
} }
function go() {
emit('move', props.folder.id);
}
function rename() { function rename() {
os.inputText({ os.inputText({
title: i18n.ts.renameFolder, title: i18n.ts.renameFolder,
@ -222,10 +218,6 @@ function deleteFolder() {
}); });
} }
function setAsUploadFolder() {
defaultStore.set('uploadFolder', props.folder.id);
}
function onContextmenu(ev: MouseEvent) { function onContextmenu(ev: MouseEvent) {
os.contextMenu([{ os.contextMenu([{
text: i18n.ts.openInWindow, text: i18n.ts.openInWindow,

View file

@ -38,14 +38,6 @@ function onClick() {
emit('move', props.folder); emit('move', props.folder);
} }
function onMouseover() {
hover.value = true;
}
function onMouseout() {
hover.value = false;
}
function onDragover(ev: DragEvent) { function onDragover(ev: DragEvent) {
if (!ev.dataTransfer) return; if (!ev.dataTransfer) return;

View file

@ -88,7 +88,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { markRaw, nextTick, onActivated, onBeforeUnmount, onMounted, ref, watch } from 'vue'; import { nextTick, onActivated, onBeforeUnmount, onMounted, ref, watch } from 'vue';
import * as Misskey from 'misskey-js'; import * as Misskey from 'misskey-js';
import XNavFolder from './drive.nav-folder.vue'; import XNavFolder from './drive.nav-folder.vue';
import XFolder from './drive.folder.vue'; import XFolder from './drive.folder.vue';

View file

@ -31,17 +31,14 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed } from 'vue';
import * as Acct from 'misskey-js/built/acct'; import * as Acct from 'misskey-js/built/acct';
import MkSwitch from '@/components/ui/switch.vue';
import MkPagination from '@/components/ui/pagination.vue'; import MkPagination from '@/components/ui/pagination.vue';
import MkDriveFileThumbnail from '@/components/drive-file-thumbnail.vue'; import MkDriveFileThumbnail from '@/components/drive-file-thumbnail.vue';
import bytes from '@/filters/bytes'; import bytes from '@/filters/bytes';
import * as os from '@/os';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
const props = defineProps<{ defineProps<{
pagination: any; pagination: Record<string, any>;
viewMode: 'grid' | 'list'; viewMode: 'grid' | 'list';
}>(); }>();
</script> </script>

View file

@ -34,7 +34,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, onUnmounted, nextTick, ref, watch, computed, toRefs } from 'vue'; import { onMounted, nextTick, ref, watch, computed, toRefs } from 'vue';
import { debounce } from 'throttle-debounce'; import { debounce } from 'throttle-debounce';
import MkButton from '@/components/ui/button.vue'; import MkButton from '@/components/ui/button.vue';
import { useInterval } from '@/scripts/use-interval'; import { useInterval } from '@/scripts/use-interval';
@ -73,7 +73,6 @@ const id = Math.random().toString(); // TODO: uuid?
const focused = ref(false); const focused = ref(false);
const changed = ref(false); const changed = ref(false);
const invalid = ref(false); const invalid = ref(false);
const filled = computed(() => v.value !== '' && v.value != null);
const inputEl = ref<HTMLElement>(); const inputEl = ref<HTMLElement>();
const prefixEl = ref<HTMLElement>(); const prefixEl = ref<HTMLElement>();
const suffixEl = ref<HTMLElement>(); const suffixEl = ref<HTMLElement>();
@ -110,7 +109,7 @@ watch(modelValue, newValue => {
v.value = newValue; v.value = newValue;
}); });
watch(v, newValue => { watch(v, () => {
if (!props.manualSave) { if (!props.manualSave) {
if (props.debounce) { if (props.debounce) {
debouncedUpdated(); debouncedUpdated();

View file

@ -74,7 +74,7 @@ watch([steppedRawValue, containerEl], calcThumbPosition);
let ro: ResizeObserver | undefined; let ro: ResizeObserver | undefined;
onMounted(() => { onMounted(() => {
ro = new ResizeObserver((entries, observer) => { ro = new ResizeObserver(() => {
calcThumbPosition(); calcThumbPosition();
}); });
ro.observe(containerEl.value); ro.observe(containerEl.value);

View file

@ -27,7 +27,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, onUnmounted, nextTick, ref, watch, computed, toRefs, VNode, useSlots } from 'vue'; import { onMounted, nextTick, ref, watch, computed, toRefs, VNode, useSlots } from 'vue';
import MkButton from '@/components/ui/button.vue'; import MkButton from '@/components/ui/button.vue';
import * as os from '@/os'; import * as os from '@/os';
import { useInterval } from '@/scripts/use-interval'; import { useInterval } from '@/scripts/use-interval';
@ -58,7 +58,6 @@ const v = ref(modelValue.value);
const focused = ref(false); const focused = ref(false);
const changed = ref(false); const changed = ref(false);
const invalid = ref(false); const invalid = ref(false);
const filled = computed(() => v.value !== '' && v.value != null);
const inputEl = ref(null); const inputEl = ref(null);
const prefixEl = ref(null); const prefixEl = ref(null);
const suffixEl = ref(null); const suffixEl = ref(null);
@ -83,7 +82,7 @@ watch(modelValue, newValue => {
v.value = newValue; v.value = newValue;
}); });
watch(v, newValue => { watch(v, () => {
if (!props.manualSave) { if (!props.manualSave) {
updated(); updated();
} }
@ -117,7 +116,7 @@ onMounted(() => {
}); });
}); });
const onClick = (ev: MouseEvent) => { const onClick = () => {
focused.value = true; focused.value = true;
const menu = []; const menu = [];

View file

@ -14,7 +14,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { watch } from 'vue'; import { watch } from 'vue';
import MkButton from '@/components/ui/button.vue';
import { defaultStore } from '@/store'; import { defaultStore } from '@/store';
const props = defineProps<{ const props = defineProps<{

View file

@ -22,7 +22,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { toRefs, Ref } from 'vue'; import { toRefs, Ref } from 'vue';
import * as os from '@/os';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
const props = defineProps<{ const props = defineProps<{

View file

@ -27,7 +27,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { defineComponent, onMounted, onUnmounted, nextTick, ref, watch, computed, toRefs } from 'vue'; import { onMounted, nextTick, watch, computed, toRefs } from 'vue';
import { debounce } from 'throttle-debounce'; import { debounce } from 'throttle-debounce';
import MkButton from '@/components/ui/button.vue'; import MkButton from '@/components/ui/button.vue';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
@ -41,11 +41,10 @@ const emit = defineEmits<{
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
modelValue: string; modelValue: string;
type?: string;
required?: boolean; required?: boolean;
readonly?: boolean; readonly?: boolean;
disabled?: boolean; disabled?: boolean;
pattern?: string; pattern?: string | undefined;
placeholder?: string; placeholder?: string;
autofocus?: boolean; autofocus?: boolean;
autocomplete?: boolean; autocomplete?: boolean;
@ -56,6 +55,8 @@ const props = withDefaults(defineProps<{
debounce?: boolean; debounce?: boolean;
manualSave?: boolean; manualSave?: boolean;
}>(), { }>(), {
pattern: undefined,
placeholder: '',
autofocus: false, autofocus: false,
tall: false, tall: false,
pre: false, pre: false,
@ -68,11 +69,8 @@ const v = $ref(modelValue.value);
let focused = $ref(false); let focused = $ref(false);
let changed = $ref(false); let changed = $ref(false);
let invalid = $ref(false);
let inputEl: HTMLTextAreaElement | null = $ref(null); let inputEl: HTMLTextAreaElement | null = $ref(null);
const filled = computed(() => modelValue.value !== '' && modelValue.value != null);
const focus = (): void => { const focus = (): void => {
inputEl?.focus(); inputEl?.focus();
}; };
@ -103,8 +101,6 @@ watch($$(v), () => {
updated(); updated();
} }
} }
invalid = inputEl?.validity.badInput ?? false;
}); });
onMounted(() => { onMounted(() => {

View file

@ -4,7 +4,6 @@
<script lang="ts"> <script lang="ts">
import { defineComponent, defineAsyncComponent } from 'vue'; import { defineComponent, defineAsyncComponent } from 'vue';
import * as os from '@/os';
export default defineComponent({ export default defineComponent({
components: { components: {

View file

@ -18,7 +18,6 @@
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import { userName } from '@/filters/user'; import { userName } from '@/filters/user';
import ImgWithBlurhash from '@/components/img-with-blurhash.vue'; import ImgWithBlurhash from '@/components/img-with-blurhash.vue';
import * as os from '@/os';
export default defineComponent({ export default defineComponent({
components: { components: {

View file

@ -5,11 +5,9 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { inject } from 'vue';
import * as os from '@/os'; import * as os from '@/os';
import copyToClipboard from '@/scripts/copy-to-clipboard'; import copyToClipboard from '@/scripts/copy-to-clipboard';
import { url } from '@/config'; import { url } from '@/config';
import { popout as popout_ } from '@/scripts/popout';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
import { useRouter } from '@/router'; import { useRouter } from '@/router';
@ -67,32 +65,15 @@ function onContextmenu(ev) {
}], ev); }], ev);
} }
function openWindow() {
os.pageWindow(props.to);
}
function modalWindow() {
os.modalPageWindow(props.to);
}
function popout() {
popout_(props.to);
}
function nav() { function nav() {
if (props.behavior === 'browser') { if (props.behavior === 'browser') {
location.href = props.to; location.href = props.to;
return; } else if (props.behavior === 'window') {
} os.pageWindow(props.to);
if (props.behavior) {
if (props.behavior === 'window') {
return openWindow();
} else if (props.behavior === 'modalWindow') { } else if (props.behavior === 'modalWindow') {
return modalWindow(); os.modalPageWindow(props.to);
} } else {
}
router.push(props.to); router.push(props.to);
} }
}
</script> </script>

View file

@ -10,7 +10,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, watch } from 'vue'; import { watch } from 'vue';
import * as misskey from 'misskey-js'; import * as misskey from 'misskey-js';
import { getStaticImageUrl } from '@/scripts/get-static-image-url'; import { getStaticImageUrl } from '@/scripts/get-static-image-url';
import { extractAvgColorFromBlurhash } from '@/scripts/extract-avg-color-from-blurhash'; import { extractAvgColorFromBlurhash } from '@/scripts/extract-avg-color-from-blurhash';

View file

@ -6,7 +6,7 @@ char2filePath<template>
</template> </template>
<script lang="ts"> <script lang="ts">
import { computed, defineComponent, ref, watch } from 'vue'; import { computed, defineComponent } from 'vue';
import { getStaticImageUrl } from '@/scripts/get-static-image-url'; import { getStaticImageUrl } from '@/scripts/get-static-image-url';
import { char2filePath } from '@/scripts/twemoji-base'; import { char2filePath } from '@/scripts/twemoji-base';
import { defaultStore } from '@/store'; import { defaultStore } from '@/store';

View file

@ -20,7 +20,7 @@ import { useCssModule } from 'vue';
useCssModule(); useCssModule();
const props = withDefaults(defineProps<{ withDefaults(defineProps<{
inline?: boolean; inline?: boolean;
colored?: boolean; colored?: boolean;
mini?: boolean; mini?: boolean;

View file

@ -6,7 +6,7 @@
import { } from 'vue'; import { } from 'vue';
import MfmCore from '@/components/mfm'; import MfmCore from '@/components/mfm';
const props = withDefaults(defineProps<{ withDefaults(defineProps<{
text: string; text: string;
plain?: boolean; plain?: boolean;
nowrap?: boolean; nowrap?: boolean;

View file

@ -18,7 +18,7 @@
</div> </div>
</div> </div>
<div v-if="!narrow || hideTitle" class="tabs"> <div v-if="!narrow || hideTitle" class="tabs">
<button v-for="tab in tabs" :ref="(el) => tabRefs[tab.key] = el" v-tooltip="tab.title" class="tab _button" :class="{ active: tab.key != null && tab.key === props.tab }" @mousedown="(ev) => onTabMousedown(tab, ev)" @click="(ev) => onTabClick(tab, ev)"> <button v-for="tab in tabs" :ref="(el) => tabRefs[tab.key] = el" v-tooltip="tab.title" class="tab _button" :class="{ active: tab.key != null && tab.key === props.tab }" @mousedown="() => onTabMousedown(tab)" @click="(ev) => onTabClick(tab, ev)">
<i v-if="tab.icon" class="icon" :class="tab.icon"></i> <i v-if="tab.icon" class="icon" :class="tab.icon"></i>
<span v-if="!tab.iconOnly" class="title">{{ tab.title }}</span> <span v-if="!tab.iconOnly" class="title">{{ tab.title }}</span>
</button> </button>
@ -34,11 +34,10 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, onMounted, onUnmounted, ref, inject, watch, shallowReactive, nextTick, reactive } from 'vue'; import { onMounted, onUnmounted, ref, inject, watch, nextTick } from 'vue';
import tinycolor from 'tinycolor2'; import tinycolor from 'tinycolor2';
import { popupMenu } from '@/os'; import { popupMenu } from '@/os';
import { scrollToTop } from '@/scripts/scroll'; import { scrollToTop } from '@/scripts/scroll';
import { i18n } from '@/i18n';
import { globalEvents } from '@/events'; import { globalEvents } from '@/events';
import { injectPageMetadata } from '@/scripts/page-metadata'; import { injectPageMetadata } from '@/scripts/page-metadata';
@ -106,7 +105,7 @@ const onClick = () => {
scrollToTop(el, { behavior: 'smooth' }); scrollToTop(el, { behavior: 'smooth' });
}; };
function onTabMousedown(tab: Tab, ev: MouseEvent): void { function onTabMousedown(tab: Tab): void {
// mousedownonClick // mousedownonClick
if (tab.key) { if (tab.key) {
emit('update:tab', tab.key); emit('update:tab', tab.key);
@ -155,7 +154,7 @@ onMounted(() => {
if (el && el.parentElement) { if (el && el.parentElement) {
narrow = el.parentElement.offsetWidth < 500; narrow = el.parentElement.offsetWidth < 500;
ro = new ResizeObserver((entries, observer) => { ro = new ResizeObserver(() => {
if (el.parentElement && document.body.contains(el)) { if (el.parentElement && document.body.contains(el)) {
narrow = el.parentElement.offsetWidth < 500; narrow = el.parentElement.offsetWidth < 500;
} }

View file

@ -11,7 +11,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { inject, nextTick, onMounted, onUnmounted, watch } from 'vue'; import { inject, onUnmounted, watch } from 'vue';
import { Router } from '@/nirax'; import { Router } from '@/nirax';
import { defaultStore } from '@/store'; import { defaultStore } from '@/store';
@ -29,7 +29,7 @@ let currentPageComponent = $shallowRef(router.getCurrentComponent());
let currentPageProps = $ref(router.getCurrentProps()); let currentPageProps = $ref(router.getCurrentProps());
let key = $ref(router.getCurrentKey()); let key = $ref(router.getCurrentKey());
function onChange({ route, props: newProps, key: newKey }) { function onChange({ route, props: newProps, key: newKey }): void {
currentPageComponent = route.component; currentPageComponent = route.component;
currentPageProps = newProps; currentPageProps = newProps;
key = newKey; key = newKey;

View file

@ -7,7 +7,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { inject, onMounted, onUnmounted, ref } from 'vue'; import { inject, onMounted, onUnmounted } from 'vue';
import { deviceKind } from '@/scripts/device-kind'; import { deviceKind } from '@/scripts/device-kind';
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
@ -40,7 +40,7 @@ const adjust = (rect: { width: number; height: number; }) => {
}; };
onMounted(() => { onMounted(() => {
ro = new ResizeObserver((entries) => { ro = new ResizeObserver(() => {
/* iOS /* iOS
adjust({ adjust({
width: entries[0].borderBoxSize[0].inlineSize, width: entries[0].borderBoxSize[0].inlineSize,

View file

@ -6,7 +6,7 @@
import { } from 'vue'; import { } from 'vue';
import * as misskey from 'misskey-js'; import * as misskey from 'misskey-js';
const props = withDefaults(defineProps<{ withDefaults(defineProps<{
user: misskey.entities.User; user: misskey.entities.User;
nowrap?: boolean; nowrap?: boolean;
}>(), { }>(), {

View file

@ -91,7 +91,7 @@ Chart.register(
Filler, Filler,
); );
const props = withDefaults(defineProps<{ withDefaults(defineProps<{
chartLimit?: number; chartLimit?: number;
detailed?: boolean; detailed?: boolean;
}>(), { }>(), {
@ -103,8 +103,7 @@ const chartSrc = $ref('active-users');
let subDoughnutEl = $ref<HTMLCanvasElement>(); let subDoughnutEl = $ref<HTMLCanvasElement>();
let pubDoughnutEl = $ref<HTMLCanvasElement>(); let pubDoughnutEl = $ref<HTMLCanvasElement>();
const { handler: externalTooltipHandler1 } = useChartTooltip(); const { handler: externalTooltipHandler } = useChartTooltip();
const { handler: externalTooltipHandler2 } = useChartTooltip();
function createDoughnut(chartEl, tooltip, data) { function createDoughnut(chartEl, tooltip, data) {
return new Chart(chartEl, { return new Chart(chartEl, {
@ -148,8 +147,8 @@ function createDoughnut(chartEl, tooltip, data) {
onMounted(() => { onMounted(() => {
os.apiGet('federation/stats', { limit: 15 }).then(fedStats => { os.apiGet('federation/stats', { limit: 15 }).then(fedStats => {
createDoughnut(subDoughnutEl, externalTooltipHandler1, fedStats.topSubInstances.map(x => ({ name: x.host, color: x.themeColor, value: x.followersCount })).concat([{ name: '(other)', color: '#80808080', value: fedStats.otherFollowersCount }])); createDoughnut(subDoughnutEl, externalTooltipHandler, fedStats.topSubInstances.map(x => ({ name: x.host, color: x.themeColor, value: x.followersCount })).concat([{ name: '(other)', color: '#80808080', value: fedStats.otherFollowersCount }]));
createDoughnut(pubDoughnutEl, externalTooltipHandler1, fedStats.topPubInstances.map(x => ({ name: x.host, color: x.themeColor, value: x.followingCount })).concat([{ name: '(other)', color: '#80808080', value: fedStats.otherFollowingCount }])); createDoughnut(pubDoughnutEl, externalTooltipHandler, fedStats.topPubInstances.map(x => ({ name: x.host, color: x.themeColor, value: x.followingCount })).concat([{ name: '(other)', color: '#80808080', value: fedStats.otherFollowingCount }]));
}); });
}); });
</script> </script>

View file

@ -47,7 +47,7 @@ export default {
}, },
render({ render({
$slots, $style, $props: { $slots, $style, $props: {
duration, repeat, paused, reverse, repeat, paused, reverse,
}, },
}) { }) {
return h('div', { class: [$style.wrap] }, [ return h('div', { class: [$style.wrap] }, [

View file

@ -34,15 +34,14 @@ import * as misskey from 'misskey-js';
import { ColdDeviceStorage } from '@/store'; import { ColdDeviceStorage } from '@/store';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
const props = withDefaults(defineProps<{ defineProps<{
media: misskey.entities.DriveFile; media: misskey.entities.DriveFile;
}>(), { }>();
});
const audioEl = $ref<HTMLAudioElement | null>(); const audioEl = $ref<HTMLAudioElement | null>();
let hide = $ref(true); let hide = $ref(true);
function volumechange() { function volumechange(): void {
if (audioEl) ColdDeviceStorage.set('mediaVolume', audioEl.volume); if (audioEl) ColdDeviceStorage.set('mediaVolume', audioEl.volume);
} }

View file

@ -23,7 +23,6 @@ import XImage from './media-image.vue';
import XVideo from './media-video.vue'; import XVideo from './media-video.vue';
import * as os from '@/os'; import * as os from '@/os';
import { FILE_TYPE_BROWSERSAFE } from '@/const'; import { FILE_TYPE_BROWSERSAFE } from '@/const';
import { defaultStore } from '@/store';
const props = defineProps<{ const props = defineProps<{
mediaList: misskey.entities.DriveFile[]; mediaList: misskey.entities.DriveFile[];
@ -31,7 +30,6 @@ const props = defineProps<{
}>(); }>();
const gallery = ref(null); const gallery = ref(null);
const pswpZIndex = os.claimZIndex('middle');
onMounted(() => { onMounted(() => {
const lightbox = new PhotoSwipeLightbox({ const lightbox = new PhotoSwipeLightbox({
@ -183,7 +181,6 @@ const previewable = (file: misskey.entities.DriveFile): boolean => {
<style lang="scss"> <style lang="scss">
.pswp { .pswp {
// //
//z-index: v-bind(pswpZIndex);
z-index: 2000000; z-index: 2000000;
} }
</style> </style>

View file

@ -26,7 +26,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onUnmounted, watch } from 'vue'; import { watch } from 'vue';
import { v4 as uuid } from 'uuid'; import { v4 as uuid } from 'uuid';
import tinycolor from 'tinycolor2'; import tinycolor from 'tinycolor2';
import { useInterval } from '@/scripts/use-interval'; import { useInterval } from '@/scripts/use-interval';
@ -42,7 +42,6 @@ let polylinePoints = $ref('');
let polygonPoints = $ref(''); let polygonPoints = $ref('');
let headX = $ref<number | null>(null); let headX = $ref<number | null>(null);
let headY = $ref<number | null>(null); let headY = $ref<number | null>(null);
let clock = $ref<number | null>(null);
const accent = tinycolor(getComputedStyle(document.documentElement).getPropertyValue('--accent')); const accent = tinycolor(getComputedStyle(document.documentElement).getPropertyValue('--accent'));
const color = accent.toRgbString(); const color = accent.toRgbString();

View file

@ -29,7 +29,7 @@ import { url } from '@/config';
import * as os from '@/os'; import * as os from '@/os';
import { mainRouter, routes } from '@/router'; import { mainRouter, routes } from '@/router';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
import { PageMetadata, provideMetadataReceiver, setPageMetadata } from '@/scripts/page-metadata'; import { PageMetadata, provideMetadataReceiver } from '@/scripts/page-metadata';
import { Router } from '@/nirax'; import { Router } from '@/nirax';
const props = defineProps<{ const props = defineProps<{
@ -43,10 +43,6 @@ defineEmits<{
const router = new Router(routes, props.initialPath); const router = new Router(routes, props.initialPath);
router.addListener('push', ctx => {
});
let pageMetadata = $ref<null | ComputedRef<PageMetadata>>(); let pageMetadata = $ref<null | ComputedRef<PageMetadata>>();
let rootEl = $ref(); let rootEl = $ref();
let modal = $ref<InstanceType<typeof MkModal>>(); let modal = $ref<InstanceType<typeof MkModal>>();

View file

@ -113,7 +113,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, inject, onMounted, onUnmounted, reactive, ref } from 'vue'; import { inject, onMounted, ref } from 'vue';
import * as mfm from 'mfm-js'; import * as mfm from 'mfm-js';
import * as misskey from 'misskey-js'; import * as misskey from 'misskey-js';
import MkNoteSub from './MkNoteSub.vue'; import MkNoteSub from './MkNoteSub.vue';
@ -186,7 +186,7 @@ const directReplies = ref<misskey.entities.Note[]>([]);
const keymap = { const keymap = {
'r': () => reply(true), 'r': () => reply(true),
'e|a|plus': () => react(true), 'e|a|plus': () => react(),
'q': () => renoteButton.value.renote(true), 'q': () => renoteButton.value.renote(true),
'esc': blur, 'esc': blur,
'm|o': () => menu(true), 'm|o': () => menu(true),
@ -209,7 +209,7 @@ function reply(viaKeyboard = false): void {
}); });
} }
function react(viaKeyboard = false): void { function react(): void {
pleaseLogin(); pleaseLogin();
blur(); blur();
reactionPicker.show(reactButton.value, reaction => { reactionPicker.show(reactButton.value, reaction => {

View file

@ -17,7 +17,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { } from 'vue'; import { } from 'vue';
const props = defineProps<{ defineProps<{
text: string; text: string;
}>(); }>();
</script> </script>

View file

@ -23,7 +23,7 @@ import XNoteHeader from './note-header.vue';
import MkNoteSubNoteContent from './sub-note-content.vue'; import MkNoteSubNoteContent from './sub-note-content.vue';
import XCwButton from './cw-button.vue'; import XCwButton from './cw-button.vue';
const props = defineProps<{ defineProps<{
note: misskey.entities.Note; note: misskey.entities.Note;
pinned?: boolean; pinned?: boolean;
}>(); }>();

View file

@ -80,7 +80,7 @@
<button v-if="appearNote.myReaction == null" ref="reactButton" class="button _button" @click="react()"> <button v-if="appearNote.myReaction == null" ref="reactButton" class="button _button" @click="react()">
<i class="fas fa-plus"></i> <i class="fas fa-plus"></i>
</button> </button>
<button v-if="appearNote.myReaction != null" ref="reactButton" class="button _button reacted" @click="undoReact(appearNote)"> <button v-if="appearNote.myReaction != null" ref="reactButton" class="button _button reacted" @click="undoReact()">
<i class="fas fa-minus"></i> <i class="fas fa-minus"></i>
</button> </button>
<button ref="menuButton" class="button _button" @click="menu()"> <button ref="menuButton" class="button _button" @click="menu()">
@ -102,7 +102,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, inject, onMounted, onUnmounted, reactive, ref, Ref } from 'vue'; import { inject, onMounted, ref, Ref } from 'vue';
import * as mfm from 'mfm-js'; import * as mfm from 'mfm-js';
import * as misskey from 'misskey-js'; import * as misskey from 'misskey-js';
import MkNoteSub from './MkNoteSub.vue'; import MkNoteSub from './MkNoteSub.vue';
@ -178,7 +178,7 @@ const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultS
const keymap = { const keymap = {
'r': () => reply(true), 'r': () => reply(true),
'e|a|plus': () => react(true), 'e|a|plus': () => react(),
'q': () => renoteButton.value.renote(true), 'q': () => renoteButton.value.renote(true),
'up|k|shift+tab': focusBefore, 'up|k|shift+tab': focusBefore,
'down|j|tab': focusAfter, 'down|j|tab': focusAfter,
@ -203,7 +203,7 @@ function reply(viaKeyboard = false): void {
}); });
} }
function react(viaKeyboard = false): void { function react(): void {
pleaseLogin(); pleaseLogin();
blur(); blur();
reactionPicker.show(reactButton.value, reaction => { reactionPicker.show(reactButton.value, reaction => {
@ -216,11 +216,10 @@ function react(viaKeyboard = false): void {
}); });
} }
function undoReact(note): void { function undoReact(): void {
const oldReaction = note.myReaction; if (!appearNote.myReaction) return;
if (!oldReaction) return;
os.api('notes/reactions/delete', { os.api('notes/reactions/delete', {
noteId: note.id, noteId: appearNote.id,
}); });
} }

View file

@ -24,7 +24,7 @@ import XList from '@/components/date-separated-list.vue';
import MkPagination, { Paging } from '@/components/ui/pagination.vue'; import MkPagination, { Paging } from '@/components/ui/pagination.vue';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
const props = defineProps<{ defineProps<{
pagination: Paging; pagination: Paging;
noGap?: boolean; noGap?: boolean;
}>(); }>();

View file

@ -1,6 +1,6 @@
<template> <template>
<div class="mk-notification-toast" :style="{ zIndex }"> <div class="mk-notification-toast" :style="{ zIndex }">
<transition :name="$store.state.animation ? 'notification-toast' : ''" appear @after-leave="$emit('closed')"> <transition :name="$store.state.animation ? 'notification-toast' : ''" appear @after-leave="emit('closed')">
<XNotification v-if="showing" :notification="notification" class="notification _acrylic"/> <XNotification v-if="showing" :notification="notification" class="notification _acrylic"/>
</transition> </transition>
</div> </div>

View file

@ -17,13 +17,12 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { defineComponent, markRaw, onUnmounted, onMounted, computed, ref } from 'vue'; import { onUnmounted, onMounted, computed, ref } from 'vue';
import { notificationTypes } from 'misskey-js'; import { notificationTypes } from 'misskey-js';
import MkPagination, { Paging } from '@/components/ui/pagination.vue'; import MkPagination, { Paging } from '@/components/ui/pagination.vue';
import XNotification from '@/components/notification.vue'; import XNotification from '@/components/notification.vue';
import XList from '@/components/date-separated-list.vue'; import XList from '@/components/date-separated-list.vue';
import XNote from '@/components/note.vue'; import XNote from '@/components/note.vue';
import * as os from '@/os';
import { stream } from '@/stream'; import { stream } from '@/stream';
import { $i } from '@/account'; import { $i } from '@/account';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
@ -45,7 +44,7 @@ const pagination: Paging = {
})), })),
}; };
const onNotification = (notification) => { const onNotification = (notification): void => {
const isMuted = props.includeTypes ? !props.includeTypes.includes(notification.type) : $i.mutingNotificationTypes.includes(notification.type); const isMuted = props.includeTypes ? !props.includeTypes.includes(notification.type) : $i.mutingNotificationTypes.includes(notification.type);
if (isMuted || document.visibilityState === 'visible') { if (isMuted || document.visibilityState === 'visible') {
stream.send('readNotification', { stream.send('readNotification', {

View file

@ -8,7 +8,7 @@
import { } from 'vue'; import { } from 'vue';
import XValue from './object-view.value.vue'; import XValue from './object-view.value.vue';
const props = defineProps<{ defineProps<{
value: Record<string, unknown>; value: Record<string, unknown>;
}>(); }>();
</script> </script>

View file

@ -17,7 +17,6 @@
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import { userName } from '@/filters/user'; import { userName } from '@/filters/user';
import * as os from '@/os';
export default defineComponent({ export default defineComponent({
props: { props: {

View file

@ -24,7 +24,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ComputedRef, inject, provide } from 'vue'; import { ComputedRef, provide } from 'vue';
import RouterView from './global/router-view.vue'; import RouterView from './global/router-view.vue';
import XWindow from '@/components/ui/window.vue'; import XWindow from '@/components/ui/window.vue';
import { popout as _popout } from '@/scripts/popout'; import { popout as _popout } from '@/scripts/popout';
@ -34,7 +34,7 @@ import * as os from '@/os';
import { mainRouter, routes } from '@/router'; import { mainRouter, routes } from '@/router';
import { Router } from '@/nirax'; import { Router } from '@/nirax';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
import { PageMetadata, provideMetadataReceiver, setPageMetadata } from '@/scripts/page-metadata'; import { PageMetadata, provideMetadataReceiver } from '@/scripts/page-metadata';
const props = defineProps<{ const props = defineProps<{
initialPath: string; initialPath: string;
@ -108,10 +108,6 @@ const contextmenu = $computed(() => ([{
}, },
}])); }]));
function menu(ev) {
os.popupMenu(contextmenu, ev.currentTarget ?? ev.target);
}
function back() { function back() {
history.pop(); history.pop();
router.change(history[history.length - 1].path, history[history.length - 1].key); router.change(history[history.length - 1].path, history[history.length - 1].key);

View file

@ -22,7 +22,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, onUnmounted, ref, toRef } from 'vue'; import { computed, ref } from 'vue';
import * as misskey from 'misskey-js'; import * as misskey from 'misskey-js';
import { sum } from '@/scripts/array'; import { sum } from '@/scripts/array';
import { pleaseLogin } from '@/scripts/please-login'; import { pleaseLogin } from '@/scripts/please-login';

View file

@ -3,8 +3,6 @@
v-size="{ max: [310, 500] }" class="gafaadew" v-size="{ max: [310, 500] }" class="gafaadew"
:class="{ modal, _popup: modal }" :class="{ modal, _popup: modal }"
@dragover.stop="onDragover" @dragover.stop="onDragover"
@dragenter="onDragenter"
@dragleave="onDragleave"
@drop.stop="onDrop" @drop.stop="onDrop"
> >
<header> <header>
@ -141,8 +139,6 @@ let visibleUsers = $ref([]);
if (props.initialVisibleUsers) { if (props.initialVisibleUsers) {
props.initialVisibleUsers.forEach(pushVisibleUser); props.initialVisibleUsers.forEach(pushVisibleUser);
} }
let autocomplete = $ref(null);
let draghover = $ref(false);
let quoteId = $ref(null); let quoteId = $ref(null);
let hasNotSpecifiedMentions = $ref(false); let hasNotSpecifiedMentions = $ref(false);
let recentHashtags = $ref(JSON.parse(localStorage.getItem('hashtags') || '[]')); let recentHashtags = $ref(JSON.parse(localStorage.getItem('hashtags') || '[]'));
@ -337,10 +333,6 @@ function togglePoll() {
} }
} }
function addTag(tag: string) {
insertTextAtCursor(textareaEl, ` #${tag} `);
}
function focus() { function focus() {
if (textareaEl) { if (textareaEl) {
textareaEl.focus(); textareaEl.focus();
@ -438,7 +430,7 @@ function onCompositionUpdate(ev: CompositionEvent) {
typing(); typing();
} }
function onCompositionEnd(ev: CompositionEvent) { function onCompositionEnd() {
imeText = ''; imeText = '';
} }
@ -478,22 +470,11 @@ function onDragover(ev) {
const isDriveFile = ev.dataTransfer.types[0] === _DATA_TRANSFER_DRIVE_FILE_; const isDriveFile = ev.dataTransfer.types[0] === _DATA_TRANSFER_DRIVE_FILE_;
if (isFile || isDriveFile) { if (isFile || isDriveFile) {
ev.preventDefault(); ev.preventDefault();
draghover = true;
ev.dataTransfer.dropEffect = ev.dataTransfer.effectAllowed === 'all' ? 'copy' : 'move'; ev.dataTransfer.dropEffect = ev.dataTransfer.effectAllowed === 'all' ? 'copy' : 'move';
} }
} }
function onDragenter(ev) {
draghover = true;
}
function onDragleave(ev) {
draghover = false;
}
function onDrop(ev): void { function onDrop(ev): void {
draghover = false;
// //
if (ev.dataTransfer.files.length > 0) { if (ev.dataTransfer.files.length > 0) {
ev.preventDefault(); ev.preventDefault();

View file

@ -21,8 +21,6 @@ import {
SubTitle, SubTitle,
Filler, Filler,
} from 'chart.js'; } from 'chart.js';
import number from '@/filters/number';
import * as os from '@/os';
import { defaultStore } from '@/store'; import { defaultStore } from '@/store';
Chart.register( Chart.register(

View file

@ -1,13 +1,15 @@
<template> <template>
<MkEmoji :emoji="reaction" :custom-emojis="customEmojis || []" :is-reaction="true" :normal="true" :no-style="noStyle"/> <MkEmoji :emoji="reaction" :custom-emojis="customEmojis" :is-reaction="true" :normal="true" :no-style="noStyle"/>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { } from 'vue'; import { } from 'vue';
const props = defineProps<{ withDefaults(defineProps<{
reaction: string; reaction: string;
customEmojis?: any[]; // TODO customEmojis?: Record<string, any>[]; // TODO
noStyle?: boolean; noStyle?: boolean;
}>(); }>(), {
customEmojis: [];
});
</script> </script>

View file

@ -12,9 +12,9 @@ import { } from 'vue';
import MkTooltip from './ui/tooltip.vue'; import MkTooltip from './ui/tooltip.vue';
import XReactionIcon from './reaction-icon.vue'; import XReactionIcon from './reaction-icon.vue';
const props = defineProps<{ defineProps<{
reaction: string; reaction: string;
emojis: any[]; // TODO emojis: Record<string, any>[]; // TODO
targetElement: HTMLElement; targetElement: HTMLElement;
}>(); }>();

View file

@ -21,11 +21,11 @@ import { } from 'vue';
import MkTooltip from './ui/tooltip.vue'; import MkTooltip from './ui/tooltip.vue';
import XReactionIcon from './reaction-icon.vue'; import XReactionIcon from './reaction-icon.vue';
const props = defineProps<{ defineProps<{
reaction: string; reaction: string;
users: any[]; // TODO users: Record<string, any>[]; // TODO
count: number; count: number;
emojis: any[]; // TODO emojis: Record<string, any>[]; // TODO
targetElement: HTMLElement; targetElement: HTMLElement;
}>(); }>();

View file

@ -18,7 +18,7 @@ import MkSignin from './signin.vue';
import XModalWindow from '@/components/ui/modal-window.vue'; import XModalWindow from '@/components/ui/modal-window.vue';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
const props = withDefaults(defineProps<{ withDefaults(defineProps<{
autoSet?: boolean; autoSet?: boolean;
message?: string, message?: string,
}>(), { }>(), {
@ -34,12 +34,12 @@ const emit = defineEmits<{
const dialog = $ref<InstanceType<typeof XModalWindow>>(); const dialog = $ref<InstanceType<typeof XModalWindow>>();
function onClose() { function onClose(): void {
emit('cancelled'); emit('cancelled');
dialog.close(); dialog.close();
} }
function onLogin(res) { function onLogin(res): void {
emit('done', res); emit('done', res);
dialog.close(); dialog.close();
} }

View file

@ -69,7 +69,6 @@ let password = $ref('');
let token = $ref(''); let token = $ref('');
let host = $ref(toUnicode(configHost)); let host = $ref(toUnicode(configHost));
let totpLogin = $ref(false); let totpLogin = $ref(false);
let credential = $ref(null);
let challengeData = $ref(null); let challengeData = $ref(null);
let queryingKey = $ref(false); let queryingKey = $ref(false);
let hCaptchaResponse = $ref(null); let hCaptchaResponse = $ref(null);

View file

@ -10,7 +10,7 @@
<div class="_monolithic_"> <div class="_monolithic_">
<div class="_section"> <div class="_section">
<XSignup :auto-set="autoSet" @signup="onSignup" @signupEmailPending="onSignupEmailPending"/> <XSignup :auto-set="autoSet" @signup="onSignup" @signup-email-pending="onSignupEmailPending"/>
</div> </div>
</div> </div>
</XModalWindow> </XModalWindow>
@ -22,7 +22,7 @@ import XSignup from './signup.vue';
import XModalWindow from '@/components/ui/modal-window.vue'; import XModalWindow from '@/components/ui/modal-window.vue';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
const props = withDefaults(defineProps<{ withDefaults(defineProps<{
autoSet?: boolean; autoSet?: boolean;
}>(), { }>(), {
autoSet: false, autoSet: false,
@ -35,12 +35,12 @@ const emit = defineEmits<{
const dialog = $ref<InstanceType<typeof XModalWindow>>(); const dialog = $ref<InstanceType<typeof XModalWindow>>();
function onSignup(res) { function onSignup(res): void {
emit('done', res); emit('done', res);
dialog.close(); dialog.close();
} }
function onSignupEmailPending() { function onSignupEmailPending(): void {
dialog.close(); dialog.close();
} }
</script> </script>

View file

@ -65,7 +65,6 @@
<script lang="ts"> <script lang="ts">
import { defineComponent, onMounted, onUnmounted, ref } from 'vue'; import { defineComponent, onMounted, onUnmounted, ref } from 'vue';
import * as os from '@/os';
export default defineComponent({ export default defineComponent({
setup() { setup() {
@ -78,7 +77,7 @@ export default defineComponent({
let ro: ResizeObserver | undefined; let ro: ResizeObserver | undefined;
onMounted(() => { onMounted(() => {
ro = new ResizeObserver((entries, observer) => { ro = new ResizeObserver(() => {
width.value = el.value?.offsetWidth + 64; width.value = el.value?.offsetWidth + 64;
height.value = el.value?.offsetHeight + 64; height.value = el.value?.offsetHeight + 64;
}); });

View file

@ -3,9 +3,8 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed, provide, onUnmounted } from 'vue'; import { computed, provide, onUnmounted } from 'vue';
import XNotes from './notes.vue'; import XNotes from './notes.vue';
import * as os from '@/os';
import { stream } from '@/stream'; import { stream } from '@/stream';
import * as sound from '@/scripts/sound'; import * as sound from '@/scripts/sound';
import { $i } from '@/account'; import { $i } from '@/account';

View file

@ -97,7 +97,7 @@ export default defineComponent({
}; };
calcOmit(); calcOmit();
new ResizeObserver((entries, observer) => { new ResizeObserver(() => {
calcOmit(); calcOmit();
}).observe(this.$refs.content); }).observe(this.$refs.content);
}, },

View file

@ -8,7 +8,6 @@
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import * as os from '@/os';
export default defineComponent({ export default defineComponent({
props: { props: {

View file

@ -20,7 +20,7 @@
import { onMounted, onUnmounted } from 'vue'; import { onMounted, onUnmounted } from 'vue';
import MkModal from './modal.vue'; import MkModal from './modal.vue';
const props = withDefaults(defineProps<{ withDefaults(defineProps<{
withOkButton: boolean; withOkButton: boolean;
okButtonDisabled: boolean; okButtonDisabled: boolean;
width: number; width: number;
@ -63,7 +63,7 @@ const onKeydown = (evt) => {
} }
}; };
const ro = new ResizeObserver((entries, observer) => { const ro = new ResizeObserver(() => {
bodyWidth = rootEl.offsetWidth; bodyWidth = rootEl.offsetWidth;
bodyHeight = rootEl.offsetHeight - headerEl.offsetHeight; bodyHeight = rootEl.offsetHeight - headerEl.offsetHeight;
}); });

View file

@ -217,9 +217,9 @@ const onOpened = () => {
// //
const el = content!.children[0]; const el = content!.children[0];
el.addEventListener('mousedown', ev => { el.addEventListener('mousedown', () => {
contentClicking = true; contentClicking = true;
window.addEventListener('mouseup', ev => { window.addEventListener('mouseup', () => {
// click mouseup // click mouseup
window.setTimeout(() => { window.setTimeout(() => {
contentClicking = false; contentClicking = false;
@ -242,7 +242,7 @@ onMounted(() => {
}, { immediate: true }); }, { immediate: true });
nextTick(() => { nextTick(() => {
new ResizeObserver((entries, observer) => { new ResizeObserver(() => {
align(); align();
}).observe(content!); }).observe(content!);
}); });

View file

@ -32,7 +32,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ComputedRef, isRef, markRaw, onActivated, onDeactivated, Ref, ref, watch } from 'vue'; import { computed, ComputedRef, isRef, onActivated, onDeactivated, ref, watch } from 'vue';
import * as misskey from 'misskey-js'; import * as misskey from 'misskey-js';
import * as os from '@/os'; import * as os from '@/os';
import { onScrollTop, isTopVisible, getScrollPosition, getScrollContainer } from '@/scripts/scroll'; import { onScrollTop, isTopVisible, getScrollPosition, getScrollContainer } from '@/scripts/scroll';
@ -105,7 +105,7 @@ const init = async (): Promise<void> => {
offset.value = res.length; offset.value = res.length;
error.value = false; error.value = false;
fetching.value = false; fetching.value = false;
}, err => { }, () => {
error.value = true; error.value = true;
fetching.value = false; fetching.value = false;
}); });
@ -142,7 +142,7 @@ const fetchMore = async (): Promise<void> => {
} }
offset.value += res.length; offset.value += res.length;
moreFetching.value = false; moreFetching.value = false;
}, err => { }, () => {
moreFetching.value = false; moreFetching.value = false;
}); });
}; };
@ -172,7 +172,7 @@ const fetchMoreAhead = async (): Promise<void> => {
} }
offset.value += res.length; offset.value += res.length;
moreFetching.value = false; moreFetching.value = false;
}, err => { }, () => {
moreFetching.value = false; moreFetching.value = false;
}); });
}; };

View file

@ -24,7 +24,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, ref, unref } from 'vue'; import { defineComponent } from 'vue';
export default defineComponent({ export default defineComponent({
props: { props: {

View file

@ -33,7 +33,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, onUnmounted } from 'vue'; import { onUnmounted } from 'vue';
import { url as local, lang } from '@/config'; import { url as local, lang } from '@/config';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';

View file

@ -19,10 +19,9 @@
import { ref } from 'vue'; import { ref } from 'vue';
import MkUserInfo from '@/components/user-info.vue'; import MkUserInfo from '@/components/user-info.vue';
import MkPagination, { Paging } from '@/components/ui/pagination.vue'; import MkPagination, { Paging } from '@/components/ui/pagination.vue';
import { userPage } from '@/filters/user';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
const props = defineProps<{ defineProps<{
pagination: Paging; pagination: Paging;
noGap?: boolean; noGap?: boolean;
}>(); }>();

View file

@ -52,7 +52,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { nextTick, onMounted } from 'vue'; import { onMounted } from 'vue';
import * as misskey from 'misskey-js'; import * as misskey from 'misskey-js';
import MkInput from '@/components/form/input.vue'; import MkInput from '@/components/form/input.vue';
import FormSplit from '@/components/form/split.vue'; import FormSplit from '@/components/form/split.vue';

View file

@ -14,8 +14,8 @@
import { } from 'vue'; import { } from 'vue';
import MkTooltip from './ui/tooltip.vue'; import MkTooltip from './ui/tooltip.vue';
const props = defineProps<{ defineProps<{
users: any[]; // TODO users: Record<string, any>[]; // TODO
count: number; count: number;
targetElement: HTMLElement; targetElement: HTMLElement;
}>(); }>();

View file

@ -8,7 +8,6 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue';
import XDetails from '@/components/users-tooltip.vue'; import XDetails from '@/components/users-tooltip.vue';
import * as os from '@/os'; import * as os from '@/os';
import { useTooltip } from '@/scripts/use-tooltip'; import { useTooltip } from '@/scripts/use-tooltip';

View file

@ -1,7 +1,7 @@
import { Directive } from 'vue'; import { Directive } from 'vue';
export default { export default {
mounted(src, binding, vn) { mounted(src) {
const getBgColor = (el: HTMLElement) => { const getBgColor = (el: HTMLElement) => {
const style = window.getComputedStyle(el); const style = window.getComputedStyle(el);
if (style.backgroundColor && !['rgba(0, 0, 0, 0)', 'rgba(0,0,0,0)', 'transparent'].includes(style.backgroundColor)) { if (style.backgroundColor && !['rgba(0, 0, 0, 0)', 'rgba(0,0,0,0)', 'transparent'].includes(style.backgroundColor)) {

View file

@ -1,7 +1,7 @@
import { Directive } from 'vue'; import { Directive } from 'vue';
export default { export default {
beforeMount(src, binding, vn) { beforeMount(src) {
src.style.opacity = '0'; src.style.opacity = '0';
src.style.transform = 'scale(0.9)'; src.style.transform = 'scale(0.9)';
// ページネーションと相性が悪いので // ページネーションと相性が悪いので
@ -9,7 +9,7 @@ export default {
src.classList.add('_zoom'); src.classList.add('_zoom');
}, },
mounted(src, binding, vn) { mounted(src) {
window.setTimeout(() => { window.setTimeout(() => {
src.style.opacity = '1'; src.style.opacity = '1';
src.style.transform = 'none'; src.style.transform = 'none';

View file

@ -1,7 +1,7 @@
import { Directive } from 'vue'; import { Directive } from 'vue';
export default { export default {
mounted(src, binding, vn) { mounted(src, binding) {
const fn = binding.value; const fn = binding.value;
if (fn == null) return; if (fn == null) return;
@ -16,7 +16,7 @@ export default {
src._observer_ = observer; src._observer_ = observer;
}, },
unmounted(src, binding, vn) { unmounted(src) {
if (src._observer_) src._observer_.disconnect(); if (src._observer_) src._observer_.disconnect();
}, },
} as Directive; } as Directive;

View file

@ -33,8 +33,8 @@ function calc(src: Element) {
} }
export default { export default {
mounted(src, binding, vn) { mounted(src) {
const resize = new ResizeObserver((entries, observer) => { const resize = new ResizeObserver(() => {
calc(src); calc(src);
}); });
resize.observe(src); resize.observe(src);
@ -43,7 +43,7 @@ export default {
calc(src); calc(src);
}, },
unmounted(src, binding, vn) { unmounted(src) {
binding.value(0, 0); binding.value(0, 0);
const info = mountings.get(src); const info = mountings.get(src);
if (!info) return; if (!info) return;

View file

@ -1,7 +1,7 @@
import { Directive } from 'vue'; import { Directive } from 'vue';
export default { export default {
mounted(src, binding, vn) { mounted(src) {
const getBgColor = (el: HTMLElement) => { const getBgColor = (el: HTMLElement) => {
const style = window.getComputedStyle(el); const style = window.getComputedStyle(el);
if (style.backgroundColor && !['rgba(0, 0, 0, 0)', 'rgba(0,0,0,0)', 'transparent'].includes(style.backgroundColor)) { if (style.backgroundColor && !['rgba(0, 0, 0, 0)', 'rgba(0,0,0,0)', 'transparent'].includes(style.backgroundColor)) {

View file

@ -2,7 +2,7 @@ import Ripple from '@/components/ripple.vue';
import { popup } from '@/os'; import { popup } from '@/os';
export default { export default {
mounted(el, binding, vn) { mounted(el, binding) {
// 明示的に false であればバインドしない // 明示的に false であればバインドしない
if (binding.value === false) return; if (binding.value === false) return;

View file

@ -77,8 +77,8 @@ function calc(el: Element) {
} }
export default { export default {
mounted(src, binding, vn) { mounted(src, binding) {
const resize = new ResizeObserver((entries, observer) => { const resize = new ResizeObserver(() => {
calc(src); calc(src);
}); });
@ -92,12 +92,12 @@ export default {
resize.observe(src); resize.observe(src);
}, },
updated(src, binding, vn) { updated(src, binding) {
mountings.set(src, Object.assign({}, mountings.get(src), { value: binding.value })); mountings.set(src, Object.assign({}, mountings.get(src), { value: binding.value }));
calc(src); calc(src);
}, },
unmounted(src, binding, vn) { unmounted(src) {
const info = mountings.get(src); const info = mountings.get(src);
if (!info) return; if (!info) return;
info.resize.disconnect(); info.resize.disconnect();

View file

@ -1,9 +1,7 @@
import { Directive } from 'vue'; import { Directive } from 'vue';
export default { export default {
mounted(src, binding, vn) { mounted(src) {
//const query = binding.value;
const header = src.children[0]; const header = src.children[0];
const body = src.children[1]; const body = src.children[1];
const currentStickyTop = getComputedStyle(src).getPropertyValue('--stickyTop') || '0px'; const currentStickyTop = getComputedStyle(src).getPropertyValue('--stickyTop') || '0px';

View file

@ -10,7 +10,7 @@ const end = isTouchUsing ? 'touchend' : 'mouseleave';
const delay = 100; const delay = 100;
export default { export default {
mounted(el: HTMLElement, binding, vn) { mounted(el: HTMLElement, binding) {
const self = (el as any)._tooltipDirective_ = {} as any; const self = (el as any)._tooltipDirective_ = {} as any;
self.text = binding.value as string; self.text = binding.value as string;
@ -84,7 +84,7 @@ export default {
self.text = binding.value as string; self.text = binding.value as string;
}, },
unmounted(el, binding, vn) { unmounted(el) {
const self = el._tooltipDirective_; const self = el._tooltipDirective_;
window.clearInterval(self.checkTimer); window.clearInterval(self.checkTimer);
}, },

View file

@ -99,7 +99,7 @@ export class UserPreview {
} }
export default { export default {
mounted(el: HTMLElement, binding, vn) { mounted(el: HTMLElement, binding) {
if (binding.value == null) return; if (binding.value == null) return;
// TODO: 新たにプロパティを作るのをやめMapを使う // TODO: 新たにプロパティを作るのをやめMapを使う
@ -109,7 +109,7 @@ export default {
self.preview = new UserPreview(el, binding.value); self.preview = new UserPreview(el, binding.value);
}, },
unmounted(el, binding, vn) { unmounted(el, binding) {
if (binding.value == null) return; if (binding.value == null) return;
const self = el._userPreviewDirective_; const self = el._userPreviewDirective_;

View file

@ -20,7 +20,7 @@ import JSON5 from 'json5';
import widgets from '@/widgets'; import widgets from '@/widgets';
import directives from '@/directives'; import directives from '@/directives';
import components from '@/components'; import components from '@/components';
import { version, ui, lang, host } from '@/config'; import { version, ui, lang } from '@/config';
import { applyTheme } from '@/scripts/theme'; import { applyTheme } from '@/scripts/theme';
import { isDeviceDarkmode } from '@/scripts/is-device-darkmode'; import { isDeviceDarkmode } from '@/scripts/is-device-darkmode';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';

View file

@ -194,7 +194,7 @@ export const menuDef = reactive({
reload: { reload: {
title: 'reload', title: 'reload',
icon: 'fas fa-refresh', icon: 'fas fa-refresh',
action: (ev) => { action: () => {
location.reload(); location.reload();
}, },
}, },

View file

@ -1,7 +1,7 @@
// NIRAX --- A lightweight router // NIRAX --- A lightweight router
import { EventEmitter } from 'eventemitter3'; import { EventEmitter } from 'eventemitter3';
import { Ref, Component, ref, shallowRef, ShallowRef } from 'vue'; import { Component, shallowRef, ShallowRef } from 'vue';
import { pleaseLogin } from '@/scripts/please-login'; import { pleaseLogin } from '@/scripts/please-login';
import { safeURIDecode } from '@/scripts/safe-uri-decode'; import { safeURIDecode } from '@/scripts/safe-uri-decode';
@ -165,7 +165,6 @@ export class Router extends EventEmitter<{
private navigate(path: string, key: string | null | undefined, initial = false) { private navigate(path: string, key: string | null | undefined, initial = false) {
const beforePath = this.currentPath; const beforePath = this.currentPath;
const beforeRoute = this.currentRoute.value;
this.currentPath = path; this.currentPath = path;
const res = this.resolve(this.currentPath); const res = this.resolve(this.currentPath);

View file

@ -207,11 +207,9 @@ export function alert(props: {
title?: string | null; title?: string | null;
text?: string | null; text?: string | null;
}): Promise<void> { }): Promise<void> {
return new Promise((resolve, reject) => { return new Promise((resolve) => {
popup(defineAsyncComponent(() => import('@/components/dialog.vue')), props, { popup(defineAsyncComponent(() => import('@/components/dialog.vue')), props, {
done: result => { done: resolve,
resolve();
},
}, 'closed'); }, 'closed');
}); });
} }
@ -221,7 +219,7 @@ export function confirm(props: {
title?: string | null; title?: string | null;
text?: string | null; text?: string | null;
}): Promise<{ canceled: boolean }> { }): Promise<{ canceled: boolean }> {
return new Promise((resolve, reject) => { return new Promise((resolve) => {
popup(defineAsyncComponent(() => import('@/components/dialog.vue')), { popup(defineAsyncComponent(() => import('@/components/dialog.vue')), {
...props, ...props,
showCancelButton: true, showCancelButton: true,
@ -242,7 +240,7 @@ export function inputText(props: {
}): Promise<{ canceled: true; result: undefined; } | { }): Promise<{ canceled: true; result: undefined; } | {
canceled: false; result: string; canceled: false; result: string;
}> { }> {
return new Promise((resolve, reject) => { return new Promise((resolve) => {
popup(defineAsyncComponent(() => import('@/components/dialog.vue')), { popup(defineAsyncComponent(() => import('@/components/dialog.vue')), {
title: props.title, title: props.title,
text: props.text, text: props.text,
@ -267,7 +265,7 @@ export function inputNumber(props: {
}): Promise<{ canceled: true; result: undefined; } | { }): Promise<{ canceled: true; result: undefined; } | {
canceled: false; result: number; canceled: false; result: number;
}> { }> {
return new Promise((resolve, reject) => { return new Promise((resolve) => {
popup(defineAsyncComponent(() => import('@/components/dialog.vue')), { popup(defineAsyncComponent(() => import('@/components/dialog.vue')), {
title: props.title, title: props.title,
text: props.text, text: props.text,
@ -292,7 +290,7 @@ export function inputDate(props: {
}): Promise<{ canceled: true; result: undefined; } | { }): Promise<{ canceled: true; result: undefined; } | {
canceled: false; result: Date; canceled: false; result: Date;
}> { }> {
return new Promise((resolve, reject) => { return new Promise((resolve) => {
popup(defineAsyncComponent(() => import('@/components/dialog.vue')), { popup(defineAsyncComponent(() => import('@/components/dialog.vue')), {
title: props.title, title: props.title,
text: props.text, text: props.text,
@ -329,7 +327,7 @@ export function select<C = any>(props: {
})): Promise<{ canceled: true; result: undefined; } | { })): Promise<{ canceled: true; result: undefined; } | {
canceled: false; result: C; canceled: false; result: C;
}> { }> {
return new Promise((resolve, reject) => { return new Promise((resolve) => {
popup(defineAsyncComponent(() => import('@/components/dialog.vue')), { popup(defineAsyncComponent(() => import('@/components/dialog.vue')), {
title: props.title, title: props.title,
text: props.text, text: props.text,
@ -347,7 +345,7 @@ export function select<C = any>(props: {
} }
export function success() { export function success() {
return new Promise((resolve, reject) => { return new Promise((resolve) => {
const showing = ref(true); const showing = ref(true);
window.setTimeout(() => { window.setTimeout(() => {
showing.value = false; showing.value = false;
@ -362,7 +360,7 @@ export function success() {
} }
export function waiting() { export function waiting() {
return new Promise((resolve, reject) => { return new Promise((resolve) => {
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,
@ -374,7 +372,7 @@ export function waiting() {
} }
export function form(title, form) { export function form(title, form) {
return new Promise((resolve, reject) => { return new Promise((resolve) => {
popup(defineAsyncComponent(() => import('@/components/form-dialog.vue')), { title, form }, { popup(defineAsyncComponent(() => import('@/components/form-dialog.vue')), { title, form }, {
done: result => { done: result => {
resolve(result); resolve(result);
@ -384,7 +382,7 @@ export function form(title, form) {
} }
export async function selectUser() { export async function selectUser() {
return new Promise((resolve, reject) => { return new Promise((resolve) => {
popup(defineAsyncComponent(() => import('@/components/user-select-dialog.vue')), {}, { popup(defineAsyncComponent(() => import('@/components/user-select-dialog.vue')), {}, {
ok: user => { ok: user => {
resolve(user); resolve(user);
@ -394,7 +392,7 @@ export async function selectUser() {
} }
export async function selectDriveFile(multiple: boolean) { export async function selectDriveFile(multiple: boolean) {
return new Promise((resolve, reject) => { return new Promise((resolve) => {
popup(defineAsyncComponent(() => import('@/components/drive-select-dialog.vue')), { popup(defineAsyncComponent(() => import('@/components/drive-select-dialog.vue')), {
type: 'file', type: 'file',
multiple, multiple,
@ -409,7 +407,7 @@ export async function selectDriveFile(multiple: boolean) {
} }
export async function selectDriveFolder(multiple: boolean) { export async function selectDriveFolder(multiple: boolean) {
return new Promise((resolve, reject) => { return new Promise((resolve) => {
popup(defineAsyncComponent(() => import('@/components/drive-select-dialog.vue')), { popup(defineAsyncComponent(() => import('@/components/drive-select-dialog.vue')), {
type: 'folder', type: 'folder',
multiple, multiple,
@ -424,7 +422,7 @@ export async function selectDriveFolder(multiple: boolean) {
} }
export async function pickEmoji(src: HTMLElement | null, opts) { export async function pickEmoji(src: HTMLElement | null, opts) {
return new Promise((resolve, reject) => { return new Promise((resolve) => {
popup(defineAsyncComponent(() => import('@/components/emoji-picker-dialog.vue')), { popup(defineAsyncComponent(() => import('@/components/emoji-picker-dialog.vue')), {
src, src,
...opts, ...opts,
@ -439,7 +437,7 @@ export async function pickEmoji(src: HTMLElement | null, opts) {
export async function cropImage(image: Misskey.entities.DriveFile, options: { export async function cropImage(image: Misskey.entities.DriveFile, options: {
aspectRatio: number; aspectRatio: number;
}): Promise<Misskey.entities.DriveFile> { }): Promise<Misskey.entities.DriveFile> {
return new Promise((resolve, reject) => { return new Promise((resolve) => {
popup(defineAsyncComponent(() => import('@/components/cropper-dialog.vue')), { popup(defineAsyncComponent(() => import('@/components/cropper-dialog.vue')), {
file: image, file: image,
aspectRatio: options.aspectRatio, aspectRatio: options.aspectRatio,
@ -510,7 +508,7 @@ export function popupMenu(items: MenuItem[] | Ref<MenuItem[]>, src?: HTMLElement
width?: number; width?: number;
viaKeyboard?: boolean; viaKeyboard?: boolean;
}) { }) {
return new Promise((resolve, reject) => { return new Promise((resolve) => {
let dispose; let dispose;
popup(defineAsyncComponent(() => import('@/components/ui/popup-menu.vue')), { popup(defineAsyncComponent(() => import('@/components/ui/popup-menu.vue')), {
items, items,
@ -531,7 +529,7 @@ export function popupMenu(items: MenuItem[] | Ref<MenuItem[]>, src?: HTMLElement
export function contextMenu(items: MenuItem[] | Ref<MenuItem[]>, ev: MouseEvent) { export function contextMenu(items: MenuItem[] | Ref<MenuItem[]>, ev: MouseEvent) {
ev.preventDefault(); ev.preventDefault();
return new Promise((resolve, reject) => { return new Promise((resolve) => {
let dispose; let dispose;
popup(defineAsyncComponent(() => import('@/components/ui/context-menu.vue')), { popup(defineAsyncComponent(() => import('@/components/ui/context-menu.vue')), {
items, items,
@ -548,7 +546,7 @@ export function contextMenu(items: MenuItem[] | Ref<MenuItem[]>, ev: MouseEvent)
} }
export function post(props: Record<string, any> = {}) { export function post(props: Record<string, any> = {}) {
return new Promise((resolve, reject) => { return new Promise((resolve) => {
// NOTE: MkPostFormDialogをdynamic importするとiOSでテキストエリアに自動フォーカスできない // NOTE: MkPostFormDialogをdynamic importするとiOSでテキストエリアに自動フォーカスできない
// NOTE: ただ、dynamic importしない場合、MkPostFormDialogインスタンスが使いまわされ、 // NOTE: ただ、dynamic importしない場合、MkPostFormDialogインスタンスが使いまわされ、
// Vueが渡されたコンポーネントに内部的に__propsというプロパティを生やす影響で、 // Vueが渡されたコンポーネントに内部的に__propsというプロパティを生やす影響で、
@ -570,7 +568,7 @@ export const deckGlobalEvents = new EventEmitter();
/* /*
export function checkExistence(fileData: ArrayBuffer): Promise<any> { export function checkExistence(fileData: ArrayBuffer): Promise<any> {
return new Promise((resolve, reject) => { return new Promise((resolve) => {
const data = new FormData(); const data = new FormData();
data.append('md5', getMD5(fileData)); data.append('md5', getMD5(fileData));

View file

@ -27,9 +27,10 @@ import { unisonReload } from '@/scripts/unison-reload';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
import { definePageMetadata } from '@/scripts/page-metadata'; import { definePageMetadata } from '@/scripts/page-metadata';
const props = withDefaults(defineProps<{ withDefaults(defineProps<{
error?: Error; error?: Error | undefined;
}>(), { }>(), {
error: undefined,
}); });
let loaded = $ref(false); let loaded = $ref(false);
@ -52,10 +53,6 @@ function reload() {
unisonReload(); unisonReload();
} }
const headerActions = $computed(() => []);
const headerTabs = $computed(() => []);
definePageMetadata({ definePageMetadata({
title: i18n.ts.error, title: i18n.ts.error,
icon: 'fas fa-exclamation-triangle', icon: 'fas fa-exclamation-triangle',

View file

@ -80,8 +80,8 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed } from 'vue'; import { computed } from 'vue';
import { version, instanceName , host } from '@/config'; import { version, host } from '@/config';
import FormLink from '@/components/form/link.vue'; import FormLink from '@/components/form/link.vue';
import FormSection from '@/components/form/section.vue'; import FormSection from '@/components/form/section.vue';
import FormSuspense from '@/components/form/suspense.vue'; import FormSuspense from '@/components/form/suspense.vue';

View file

@ -54,13 +54,11 @@ import MkSwitch from '@/components/form/switch.vue';
import MkObjectView from '@/components/object-view.vue'; import MkObjectView from '@/components/object-view.vue';
import MkDriveFileThumbnail from '@/components/drive-file-thumbnail.vue'; import MkDriveFileThumbnail from '@/components/drive-file-thumbnail.vue';
import MkKeyValue from '@/components/key-value.vue'; import MkKeyValue from '@/components/key-value.vue';
import FormLink from '@/components/form/link.vue';
import MkUserCardMini from '@/components/user-card-mini.vue'; import MkUserCardMini from '@/components/user-card-mini.vue';
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';
import { definePageMetadata } from '@/scripts/page-metadata'; import { definePageMetadata } from '@/scripts/page-metadata';
import { acct } from '@/filters/user';
let tab = $ref('overview'); let tab = $ref('overview');
let file: any = $ref(null); let file: any = $ref(null);

View file

@ -9,7 +9,7 @@
</div> </div>
</div> </div>
<div class="tabs"> <div class="tabs">
<button v-for="tab in tabs" :ref="(el) => tabRefs[tab.key] = el" v-tooltip="tab.title" class="tab _button" :class="{ active: tab.key != null && tab.key === props.tab }" @mousedown="(ev) => onTabMousedown(tab, ev)" @click="(ev) => onTabClick(tab, ev)"> <button v-for="tab in tabs" :ref="(el) => tabRefs[tab.key] = el" v-tooltip="tab.title" class="tab _button" :class="{ active: tab.key != null && tab.key === props.tab }" @mousedown="() => onTabMousedown(tab)" @click="(ev) => onTabClick(tab, ev)">
<i v-if="tab.icon" class="icon" :class="tab.icon"></i> <i v-if="tab.icon" class="icon" :class="tab.icon"></i>
<span v-if="!tab.iconOnly" class="title">{{ tab.title }}</span> <span v-if="!tab.iconOnly" class="title">{{ tab.title }}</span>
</button> </button>
@ -28,13 +28,11 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, onMounted, onUnmounted, ref, inject, watch, nextTick } from 'vue'; import { computed, onMounted, onUnmounted, ref, watch, nextTick } from 'vue';
import tinycolor from 'tinycolor2'; import tinycolor from 'tinycolor2';
import { popupMenu } from '@/os'; import { popupMenu } from '@/os';
import { url } from '@/config';
import { scrollToTop } from '@/scripts/scroll'; import { scrollToTop } from '@/scripts/scroll';
import MkButton from '@/components/ui/button.vue'; import MkButton from '@/components/ui/button.vue';
import { i18n } from '@/i18n';
import { globalEvents } from '@/events'; import { globalEvents } from '@/events';
import { injectPageMetadata } from '@/scripts/page-metadata'; import { injectPageMetadata } from '@/scripts/page-metadata';
@ -68,7 +66,6 @@ const el = ref<HTMLElement>(null);
const tabRefs = {}; const tabRefs = {};
const tabHighlightEl = $ref<HTMLElement | null>(null); const tabHighlightEl = $ref<HTMLElement | null>(null);
const bg = ref(null); const bg = ref(null);
const height = ref(0);
const hasTabs = computed(() => { const hasTabs = computed(() => {
return props.tabs && props.tabs.length > 0; return props.tabs && props.tabs.length > 0;
}); });
@ -96,7 +93,7 @@ const onClick = () => {
scrollToTop(el.value, { behavior: 'smooth' }); scrollToTop(el.value, { behavior: 'smooth' });
}; };
function onTabMousedown(tab: Tab, ev: MouseEvent): void { function onTabMousedown(tab: Tab): void {
// mousedownonClick // mousedownonClick
if (tab.key) { if (tab.key) {
emit('update:tab', tab.key); emit('update:tab', tab.key);

View file

@ -25,16 +25,6 @@
<option value="remote">{{ i18n.ts.remote }}</option> <option value="remote">{{ i18n.ts.remote }}</option>
</MkSelect> </MkSelect>
</div> </div>
<!-- TODO
<div class="inputs" style="display: flex; padding-top: 1.2em;">
<MkInput v-model="searchUsername" style="margin: 0; flex: 1;" type="text" :spellcheck="false">
<span>{{ i18n.ts.username }}</span>
</MkInput>
<MkInput v-model="searchHost" style="margin: 0; flex: 1;" type="text" :spellcheck="false" :disabled="pagination.params().origin === 'local'">
<span>{{ i18n.ts.host }}</span>
</MkInput>
</div>
-->
<MkPagination v-slot="{items}" ref="reports" :pagination="pagination" style="margin-top: var(--margin);"> <MkPagination v-slot="{items}" ref="reports" :pagination="pagination" style="margin-top: var(--margin);">
<XAbuseReport v-for="report in items" :key="report.id" :report="report" @resolved="resolved"/> <XAbuseReport v-for="report in items" :key="report.id" :report="report" @resolved="resolved"/>
@ -50,7 +40,6 @@
import { computed } from 'vue'; import { computed } from 'vue';
import XHeader from './_header_.vue'; import XHeader from './_header_.vue';
import MkInput from '@/components/form/input.vue';
import MkSelect from '@/components/form/select.vue'; import MkSelect from '@/components/form/select.vue';
import MkPagination from '@/components/ui/pagination.vue'; import MkPagination from '@/components/ui/pagination.vue';
import XAbuseReport from '@/components/abuse-report.vue'; import XAbuseReport from '@/components/abuse-report.vue';
@ -63,8 +52,6 @@ let reports = $ref<InstanceType<typeof MkPagination>>();
let state = $ref('unresolved'); let state = $ref('unresolved');
let reporterOrigin = $ref('combined'); let reporterOrigin = $ref('combined');
let targetUserOrigin = $ref('combined'); let targetUserOrigin = $ref('combined');
let searchUsername = $ref('');
let searchHost = $ref('');
const pagination = { const pagination = {
endpoint: 'admin/abuse-user-reports' as const, endpoint: 'admin/abuse-user-reports' as const,

View file

@ -34,7 +34,6 @@ import XModalWindow from '@/components/ui/modal-window.vue';
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 * as os from '@/os'; import * as os from '@/os';
import { unique } from '@/scripts/array';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
import { emojiCategories } from '@/instance'; import { emojiCategories } from '@/instance';

View file

@ -68,12 +68,11 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, defineAsyncComponent, defineComponent, ref, toRef } from 'vue'; import { computed, defineAsyncComponent, ref } from 'vue';
import XHeader from './_header_.vue'; import XHeader from './_header_.vue';
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 MkPagination from '@/components/ui/pagination.vue'; import MkPagination from '@/components/ui/pagination.vue';
import MkTab from '@/components/tab.vue';
import MkSwitch from '@/components/form/switch.vue'; import MkSwitch from '@/components/form/switch.vue';
import FormSplit from '@/components/form/split.vue'; import FormSplit from '@/components/form/split.vue';
import { selectFile, selectFiles } from '@/scripts/select-file'; import { selectFile, selectFiles } from '@/scripts/select-file';

View file

@ -33,14 +33,11 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, defineAsyncComponent } from 'vue'; import { computed } from 'vue';
import * as Acct from 'misskey-js/built/acct';
import XHeader from './_header_.vue'; import XHeader from './_header_.vue';
import MkButton from '@/components/ui/button.vue';
import MkInput from '@/components/form/input.vue'; import MkInput from '@/components/form/input.vue';
import MkSelect from '@/components/form/select.vue'; import MkSelect from '@/components/form/select.vue';
import MkFileListForAdmin from '@/components/file-list-for-admin.vue'; import MkFileListForAdmin from '@/components/file-list-for-admin.vue';
import bytes from '@/filters/bytes';
import * as os from '@/os'; import * as os from '@/os';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
import { definePageMetadata } from '@/scripts/page-metadata'; import { definePageMetadata } from '@/scripts/page-metadata';
@ -105,8 +102,6 @@ const headerActions = $computed(() => [{
handler: clear, handler: clear,
}]); }]);
const headerTabs = $computed(() => []);
definePageMetadata(computed(() => ({ definePageMetadata(computed(() => ({
title: i18n.ts.files, title: i18n.ts.files,
icon: 'fas fa-cloud', icon: 'fas fa-cloud',

View file

@ -32,7 +32,7 @@ import { instance } from '@/instance';
import * as os from '@/os'; import * as os from '@/os';
import { lookupUser } from '@/scripts/lookup-user'; import { lookupUser } from '@/scripts/lookup-user';
import { useRouter } from '@/router'; import { useRouter } from '@/router';
import { definePageMetadata, provideMetadataReceiver, setPageMetadata } from '@/scripts/page-metadata'; import { definePageMetadata, provideMetadataReceiver } from '@/scripts/page-metadata';
const isEmpty = (x: string | null) => x == null || x === ''; const isEmpty = (x: string | null) => x == null || x === '';
@ -294,10 +294,6 @@ const lookup = (ev) => {
}], ev.currentTarget ?? ev.target); }], ev.currentTarget ?? ev.target);
}; };
const headerActions = $computed(() => []);
const headerTabs = $computed(() => []);
definePageMetadata(INFO); definePageMetadata(INFO);
defineExpose({ defineExpose({

View file

@ -18,7 +18,7 @@ export function install(plugin) {
return new Promise(ok => { return new Promise(ok => {
inputText({ inputText({
title: q, title: q,
}).then(({ canceled, result: a }) => { }).then(({ result: a }) => {
ok(a); ok(a);
}); });
}); });
@ -26,8 +26,7 @@ export function install(plugin) {
out: (value) => { out: (value) => {
console.log(value); console.log(value);
}, },
log: (type, params) => { log: (type, params) => {},
},
}); });
initPlugin({ plugin, aiscript }); initPlugin({ plugin, aiscript });

View file

@ -3,7 +3,6 @@ import { Router } from '@/nirax';
import { $i, iAmModerator } from '@/account'; import { $i, iAmModerator } from '@/account';
import MkLoading from '@/pages/_loading_.vue'; import MkLoading from '@/pages/_loading_.vue';
import MkError from '@/pages/_error_.vue'; import MkError from '@/pages/_error_.vue';
import { ui } from '@/config';
const page = (loader: AsyncComponentLoader<any>) => defineAsyncComponent({ const page = (loader: AsyncComponentLoader<any>) => defineAsyncComponent({
loader, loader,

View file

@ -1,6 +1,5 @@
import { defineAsyncComponent, Ref, inject } from 'vue'; import { defineAsyncComponent, Ref } from 'vue';
import * as misskey from 'misskey-js'; import * as misskey from 'misskey-js';
import { pleaseLogin } from './please-login';
import { $i } from '@/account'; import { $i } from '@/account';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
import { instance } from '@/instance'; import { instance } from '@/instance';

View file

@ -49,7 +49,7 @@ import { StickySidebar } from '@/scripts/sticky-sidebar';
import * as os from '@/os'; import * as os from '@/os';
import { menuDef } from '@/menu'; import { menuDef } from '@/menu';
import { mainRouter } from '@/router'; import { mainRouter } from '@/router';
import { PageMetadata, provideMetadataReceiver, setPageMetadata } from '@/scripts/page-metadata'; import { PageMetadata, provideMetadataReceiver } from '@/scripts/page-metadata';
import { defaultStore } from '@/store'; import { defaultStore } from '@/store';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
const XHeaderMenu = defineAsyncComponent(() => import('./classic.header.vue')); const XHeaderMenu = defineAsyncComponent(() => import('./classic.header.vue'));

View file

@ -18,7 +18,7 @@ import { deckStore, Column } from '@/ui/deck/deck-store';
import * as os from '@/os'; import * as os from '@/os';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
import { mainRouter } from '@/router'; import { mainRouter } from '@/router';
import { PageMetadata, provideMetadataReceiver, setPageMetadata } from '@/scripts/page-metadata'; import { PageMetadata, provideMetadataReceiver } from '@/scripts/page-metadata';
defineProps<{ defineProps<{
column: Column; column: Column;

View file

@ -68,7 +68,7 @@ import { i18n } from '@/i18n';
import { $i } from '@/account'; import { $i } from '@/account';
import { Router } from '@/nirax'; import { Router } from '@/nirax';
import { mainRouter } from '@/router'; import { mainRouter } from '@/router';
import { PageMetadata, provideMetadataReceiver, setPageMetadata } from '@/scripts/page-metadata'; import { PageMetadata, provideMetadataReceiver } from '@/scripts/page-metadata';
const XWidgets = defineAsyncComponent(() => import('./universal.widgets.vue')); const XWidgets = defineAsyncComponent(() => import('./universal.widgets.vue'));
const XSidebar = defineAsyncComponent(() => import('@/ui/_common_/sidebar.vue')); const XSidebar = defineAsyncComponent(() => import('@/ui/_common_/sidebar.vue'));

View file

@ -58,7 +58,7 @@ import XSignupDialog from '@/components/signup-dialog.vue';
import MkButton from '@/components/ui/button.vue'; import MkButton from '@/components/ui/button.vue';
import { ColdDeviceStorage, defaultStore } from '@/store'; import { ColdDeviceStorage, defaultStore } from '@/store';
import { mainRouter } from '@/router'; import { mainRouter } from '@/router';
import { PageMetadata, provideMetadataReceiver, setPageMetadata } from '@/scripts/page-metadata'; import { PageMetadata, provideMetadataReceiver } from '@/scripts/page-metadata';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
const DESKTOP_THRESHOLD = 1100; const DESKTOP_THRESHOLD = 1100;

View file

@ -10,7 +10,7 @@
import { provide, ComputedRef } from 'vue'; import { provide, ComputedRef } from 'vue';
import XCommon from './_common_/common.vue'; import XCommon from './_common_/common.vue';
import { mainRouter } from '@/router'; import { mainRouter } from '@/router';
import { PageMetadata, provideMetadataReceiver, setPageMetadata } from '@/scripts/page-metadata'; import { PageMetadata, provideMetadataReceiver } from '@/scripts/page-metadata';
import { instanceName } from '@/config'; import { instanceName } from '@/config';
let pageMetadata = $ref<null | ComputedRef<PageMetadata>>(); let pageMetadata = $ref<null | ComputedRef<PageMetadata>>();

View file

@ -68,7 +68,7 @@ module.exports = {
'@typescript-eslint/no-inferrable-types': ['warn'], '@typescript-eslint/no-inferrable-types': ['warn'],
'@typescript-eslint/no-empty-function': ['off'], '@typescript-eslint/no-empty-function': ['off'],
'@typescript-eslint/no-non-null-assertion': ['warn'], '@typescript-eslint/no-non-null-assertion': ['warn'],
'@typescript-eslint/explicit-function-return-type': ['warn'], '@typescript-eslint/explicit-function-return-type': ['warn', { allowExpressions: true }],
'@typescript-eslint/no-misused-promises': ['error', { '@typescript-eslint/no-misused-promises': ['error', {
'checksVoidReturn': false, 'checksVoidReturn': false,
}], }],