(cherry picked from commit cd665be463)
This commit is contained in:
syuilo 2024-09-01 17:11:25 +09:00 committed by kakkokari-gtyih
parent 71c36db2db
commit 8899d558f6
85 changed files with 270 additions and 88 deletions

View File

@ -25,6 +25,7 @@ import { miLocalStorage } from '@/local-storage.js';
import { fetchCustomEmojis } from '@/custom-emojis.js';
import { setupRouter } from '@/router/main.js';
import { createMainRouter } from '@/router/definition.js';
import { DI } from '@/di.js';
export async function common(createVue: () => App<Element>) {
console.info(`Misskey v${version}`);
@ -234,8 +235,8 @@ export async function common(createVue: () => App<Element>) {
} catch (err) { /* empty */ }
const app = createVue();
app.provide('serverMetadata', serverMetadata);
app.provide('mediaProxy', new MediaProxy(serverMetadata, url));
app.provide(DI.serverMetadata, serverMetadata);
app.provide(DI.mediaProxy, new MediaProxy(serverMetadata, url));
setupRouter(app, createMainRouter);

View File

@ -24,7 +24,9 @@ import MkChannelPreview from '@/components/MkChannelPreview.vue';
import MkPagination, { Paging } from '@/components/MkPagination.vue';
import { i18n } from '@/i18n.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const props = withDefaults(defineProps<{
pagination: Paging;

View File

@ -42,7 +42,9 @@ import { defaultStore } from '@/store.js';
import { apiUrl } from '@@/js/config.js';
import { i18n } from '@/i18n.js';
const mediaProxy = inject('mediaProxy');
import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy);
const emit = defineEmits<{
(ev: 'ok', cropped: Misskey.entities.DriveFile): void;

View File

@ -44,7 +44,9 @@ import { i18n } from '@/i18n.js';
import * as os from '@/os.js';
import { miLocalStorage } from '@/local-storage.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const emit = defineEmits<{
(ev: 'closed'): void;

View File

@ -9,7 +9,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { inject } from 'vue';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
</script>
<style lang="scss" module>

View File

@ -47,7 +47,9 @@ import MkInfo from '@/components/MkInfo.vue';
import * as os from '@/os.js';
import { i18n } from '@/i18n.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const emit = defineEmits<{
(ev: 'done'): void;

View File

@ -84,7 +84,9 @@ import XFile from './MkFormDialog.file.vue';
import type { Form } from '@/scripts/form.js';
import MkModalWindow from '@/components/MkModalWindow.vue';
import { i18n } from '@/i18n.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const props = defineProps<{
title: string;

View File

@ -20,7 +20,9 @@ import * as Misskey from 'misskey-js';
import MkMiniChart from '@/components/MkMiniChart.vue';
import { misskeyApiGet } from '@/scripts/misskey-api.js';
const mediaProxy = inject('mediaProxy');
import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy);
const props = defineProps<{
instance: Misskey.entities.FederationInstance;

View File

@ -14,7 +14,9 @@ SPDX-License-Identifier: AGPL-3.0-only
import { computed, inject } from 'vue';
import { instanceName } from '@/config.js';
const mediaProxy = inject('mediaProxy');
import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy);
const props = defineProps<{
instance?: {

View File

@ -21,7 +21,9 @@ import { useTooltip } from '@/scripts/use-tooltip.js';
import * as os from '@/os.js';
import { MkABehavior } from '@/components/global/MkA.vue';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const props = withDefaults(defineProps<{
url: string;

View File

@ -60,7 +60,9 @@ import { i18n } from '@/i18n.js';
import * as os from '@/os.js';
import { $i, iAmModerator } from '@/account.js';
const mediaProxy = inject('mediaProxy');
import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy);
const props = withDefaults(defineProps<{
image: Misskey.entities.DriveFile;

View File

@ -22,7 +22,9 @@ import { $i } from '@/account.js';
import { defaultStore } from '@/store.js';
import { MkABehavior } from '@/components/global/MkA.vue';
const mediaProxy = inject('mediaProxy');
import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy);
const props = defineProps<{
username: string;

View File

@ -202,7 +202,9 @@ import { type Keymap } from '@/scripts/hotkey.js';
import { focusPrev, focusNext } from '@/scripts/focus.js';
import { getAppearNote } from '@/scripts/get-appear-note.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const props = withDefaults(defineProps<{
note: Misskey.entities.Note;

View File

@ -238,7 +238,9 @@ import MkButton from '@/components/MkButton.vue';
import { getAppearNote } from '@/scripts/get-appear-note.js';
import { type Keymap } from '@/scripts/hotkey.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const props = withDefaults(defineProps<{
note: Misskey.entities.Note;

View File

@ -38,7 +38,9 @@ import MkNote from '@/components/MkNote.vue';
import MkDateSeparatedList from '@/components/MkDateSeparatedList.vue';
import MkPagination, { Paging } from '@/components/MkPagination.vue';
import { i18n } from '@/i18n.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const props = defineProps<{
pagination: Paging;

View File

@ -149,7 +149,9 @@ import { i18n } from '@/i18n.js';
import { misskeyApi } from '@/scripts/misskey-api.js';
import { signinRequired } from '@/account.js';
import { inject } from 'vue';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const $i = signinRequired();

View File

@ -32,6 +32,9 @@ import MkNote from '@/components/MkNote.vue';
import { useStream } from '@/stream.js';
import { i18n } from '@/i18n.js';
import { notificationTypes } from '@@/js/const.js';
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
import { defaultStore } from '@/store.js';
import MkPullToRefresh from '@/components/MkPullToRefresh.vue';
import * as Misskey from 'misskey-js';

View File

@ -91,7 +91,9 @@ function concatMapWithArray(map: MisskeyEntityMap, entities: MisskeyEntity[]): M
</script>
<script lang="ts" setup>
import { inject } from 'vue';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
import MkButton from '@/components/MkButton.vue';
const props = withDefaults(defineProps<{

View File

@ -129,7 +129,9 @@ import { claimAchievement } from '@/scripts/achievements.js';
import { emojiPicker } from '@/scripts/emoji-picker.js';
import { mfmFunctionPicker } from '@/scripts/mfm-function-picker.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const $i = signinRequired();

View File

@ -48,7 +48,9 @@ import { apiWithDialog, promiseDialog } from '@/os.js';
import { misskeyApi } from '@/scripts/misskey-api.js';
import { i18n } from '@/i18n.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
defineProps<{
primary?: boolean;

View File

@ -90,7 +90,9 @@ import { misskeyApi } from '@/scripts/misskey-api.js';
import { login } from '@/account.js';
import { i18n } from '@/i18n.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const props = withDefaults(defineProps<{
autoSet?: boolean;

View File

@ -70,7 +70,9 @@ import MkSwitch from '@/components/MkSwitch.vue';
import MkInfo from '@/components/MkInfo.vue';
import * as os from '@/os.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const availableServerRules = serverMetadata.serverRules.length > 0;
const availableTos = serverMetadata.tosUrl != null && serverMetadata.tosUrl !== '';

View File

@ -47,7 +47,9 @@ import { i18n } from '@/i18n.js';
import { miLocalStorage } from '@/local-storage.js';
import * as os from '@/os.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const emit = defineEmits<{
(ev: 'closed'): void;

View File

@ -28,7 +28,9 @@ import { $i } from '@/account.js';
import { defaultStore } from '@/store.js';
import { Paging } from '@/components/MkPagination.vue';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const props = withDefaults(defineProps<{
src: BasicTimelineType | 'mentions' | 'directs' | 'list' | 'antenna' | 'channel' | 'role';

View File

@ -161,7 +161,9 @@ import { host } from '@@/js/config.js';
import { claimAchievement } from '@/scripts/achievements.js';
import * as os from '@/os.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const props = defineProps<{
initialPage?: number;

View File

@ -44,7 +44,9 @@ import { $i } from '@/account.js';
import { isFollowingVisibleForMe, isFollowersVisibleForMe } from '@/scripts/isFfVisibleForMe.js';
import { defaultStore } from '@/store.js';
const mediaProxy = inject('mediaProxy');
import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy);
defineProps<{
user: Misskey.entities.UserDetailed;

View File

@ -26,7 +26,9 @@ import MkUserInfo from '@/components/MkUserInfo.vue';
import MkPagination, { Paging } from '@/components/MkPagination.vue';
import { i18n } from '@/i18n.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const props = withDefaults(defineProps<{
pagination: Paging;

View File

@ -67,9 +67,10 @@ import { i18n } from '@/i18n.js';
import { defaultStore } from '@/store.js';
import { $i } from '@/account.js';
import { isFollowingVisibleForMe, isFollowersVisibleForMe } from '@/scripts/isFfVisibleForMe.js';
import { DI } from '@/di.js';
const serverMetadata = inject('serverMetadata');
const mediaProxy = inject('mediaProxy');
const serverMetadata = inject(DI.serverMetadata);
const mediaProxy = inject(DI.mediaProxy);
const props = defineProps<{
showing: boolean;

View File

@ -141,7 +141,9 @@ import MkPushNotificationAllowButton from '@/components/MkPushNotificationAllowB
import { defaultStore } from '@/store.js';
import * as os from '@/os.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const emit = defineEmits<{
(ev: 'closed'): void;

View File

@ -66,7 +66,9 @@ import MkNumber from '@/components/MkNumber.vue';
import XActiveUsersChart from '@/components/MkVisitorDashboard.ActiveUsersChart.vue';
import { openInstanceMenu } from '@/ui/_common_/common.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const stats = ref<Misskey.entities.StatsResponse | null>(null);

View File

@ -50,7 +50,9 @@ import { defaultStore } from '@/store.js';
import * as os from '@/os.js';
import { $i } from '@/account.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
type Ad = (typeof serverMetadata)['ads'][number];

View File

@ -49,7 +49,9 @@ import { acct, userPage } from '@/filters/user.js';
import MkUserOnlineIndicator from '@/components/MkUserOnlineIndicator.vue';
import { defaultStore } from '@/store.js';
const mediaProxy = inject('mediaProxy');
import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy);
const animation = ref(defaultStore.state.animation);
const squareAvatars = ref(defaultStore.state.squareAvatars);

View File

@ -35,7 +35,9 @@ import * as sound from '@/scripts/sound.js';
import { i18n } from '@/i18n.js';
import MkCustomEmojiDetailedDialog from '@/components/MkCustomEmojiDetailedDialog.vue';
const mediaProxy = inject('mediaProxy');
import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy);
const props = defineProps<{
name: string;

View File

@ -19,7 +19,9 @@ import MkButton from '@/components/MkButton.vue';
import { i18n } from '@/i18n.js';
import { defaultStore } from '@/store.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const emit = defineEmits<{
(ev: 'retry'): void;

View File

@ -32,7 +32,9 @@ import * as os from '@/os.js';
import { useTooltip } from '@/scripts/use-tooltip.js';
import { MkABehavior } from '@/components/global/MkA.vue';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
function safeURIDecode(str: string): string {
try {

View File

@ -18,7 +18,9 @@ import * as mfm from 'mfm-js';
import * as Misskey from 'misskey-js';
import { extractUrlFromMfm } from '@/scripts/extract-url-from-mfm.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const MkUrlPreview = defineAsyncComponent(() => import('@/components/MkUrlPreview.vue'));

View File

@ -0,0 +1,13 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { InjectionKey } from 'vue';
import * as Misskey from 'misskey-js';
import { MediaProxy } from '@@/js/media-proxy.js';
export const DI = {
serverMetadata: Symbol() as InjectionKey<Misskey.entities.MetaDetailed>,
mediaProxy: Symbol() as InjectionKey<MediaProxy>,
};

View File

@ -37,7 +37,9 @@ import { definePageMetadata } from '@/scripts/page-metadata.js';
import { miLocalStorage } from '@/local-storage.js';
import { defaultStore } from '@/store.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const props = withDefaults(defineProps<{
error?: Error;

View File

@ -145,7 +145,9 @@ import { definePageMetadata } from '@/scripts/page-metadata.js';
import { claimAchievement, claimedAchievements } from '@/scripts/achievements.js';
import { $i } from '@/account.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const patronsWithIcon = [{
name: 'カイヤン',

View File

@ -139,7 +139,9 @@ import MkFolder from '@/components/MkFolder.vue';
import MkKeyValue from '@/components/MkKeyValue.vue';
import MkLink from '@/components/MkLink.vue';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const initStats = () => misskeyApi('stats', {});
</script>

View File

@ -119,7 +119,9 @@ import MkButton from '@/components/MkButton.vue';
import MkColorInput from '@/components/MkColorInput.vue';
import { host } from '@@/js/config.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const iconUrl = ref<string | null>(null);
const app192IconUrl = ref<string | null>(null);

View File

@ -42,7 +42,9 @@ import { lookupUser, lookupUserByEmail, lookupFile } from '@/scripts/admin-looku
import { PageMetadata, definePageMetadata, provideMetadataReceiver, provideReactiveMetadata } from '@/scripts/page-metadata.js';
import { useRouter } from '@/router/supplier.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const isEmpty = (x: string | null) => x == null || x === '';

View File

@ -611,7 +611,9 @@ import { i18n } from '@/i18n.js';
import { ROLE_POLICIES } from '@@/js/const.js';
import { deepClone } from '@/scripts/clone.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const emit = defineEmits<{
(ev: 'update:modelValue', v: any): void;

View File

@ -75,7 +75,9 @@ import MkUserCardMini from '@/components/MkUserCardMini.vue';
import MkInfo from '@/components/MkInfo.vue';
import MkPagination from '@/components/MkPagination.vue';
import { inject } from 'vue';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
import { useRouter } from '@/router/supplier.js';
const router = useRouter();

View File

@ -256,7 +256,9 @@ import MkFoldableSection from '@/components/MkFoldableSection.vue';
import { ROLE_POLICIES } from '@@/js/const.js';
import { useRouter } from '@/router/supplier.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const router = useRouter();
const baseRoleQ = ref('');

View File

@ -50,7 +50,9 @@ import { definePageMetadata } from '@/scripts/page-metadata.js';
import MkButton from '@/components/MkButton.vue';
import MkInput from '@/components/MkInput.vue';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const Sortable = defineAsyncComponent(() => import('vuedraggable').then(x => x.default));

View File

@ -223,7 +223,9 @@ import MkButton from '@/components/MkButton.vue';
import MkFolder from '@/components/MkFolder.vue';
import MkSelect from '@/components/MkSelect.vue';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const name = ref<string | null>(null);
const shortName = ref<string | null>(null);

View File

@ -20,7 +20,9 @@ import { inject } from 'vue';
import { definePageMetadata } from '@/scripts/page-metadata.js';
import { i18n } from '@/i18n.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
definePageMetadata(() => ({
title: i18n.ts.ads,

View File

@ -41,7 +41,9 @@ import { definePageMetadata } from '@/scripts/page-metadata.js';
import MkKeyValue from '@/components/MkKeyValue.vue';
import MkLink from '@/components/MkLink.vue';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
definePageMetadata(() => ({
title: i18n.ts.inquiry,

View File

@ -83,7 +83,9 @@ import MkMediaList from '@/components/MkMediaList.vue';
import MkKeyValue from '@/components/MkKeyValue.vue';
import bytes from '@/filters/bytes.js';
import { inject } from 'vue';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
import { i18n } from '@/i18n.js';
import * as os from '@/os.js';
import { misskeyApi } from '@/scripts/misskey-api.js';

View File

@ -32,7 +32,9 @@ import MkDateSeparatedList from '@/components/MkDateSeparatedList.vue';
import { i18n } from '@/i18n.js';
import { definePageMetadata } from '@/scripts/page-metadata.js';
import { inject } from 'vue';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const pagination = {
endpoint: 'i/favorites' as const,

View File

@ -45,7 +45,9 @@ import { misskeyApi } from '@/scripts/misskey-api.js';
import { i18n } from '@/i18n.js';
import { definePageMetadata } from '@/scripts/page-metadata.js';
import { inject } from 'vue';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const paginationComponent = shallowRef<InstanceType<typeof MkPagination>>();

View File

@ -155,7 +155,9 @@ import MkHorizontalSwipe from '@/components/MkHorizontalSwipe.vue';
import { dateString } from '@/filters/date.js';
import MkTextarea from '@/components/MkTextarea.vue';
const mediaProxy = inject('mediaProxy');
import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy);
const props = defineProps<{
host: string;

View File

@ -47,7 +47,9 @@ import MkInviteCode from '@/components/MkInviteCode.vue';
import { definePageMetadata } from '@/scripts/page-metadata.js';
import { $i } from '@/account.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const pagingComponent = shallowRef<InstanceType<typeof MkPagination>>();
const currentInviteLimit = ref<null | number>(null);

View File

@ -44,7 +44,9 @@ import MkUserCardMini from '@/components/MkUserCardMini.vue';
import MkButton from '@/components/MkButton.vue';
import { definePageMetadata } from '@/scripts/page-metadata.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const props = defineProps<{
listId: string;

View File

@ -34,7 +34,9 @@ import { i18n } from '@/i18n.js';
import { definePageMetadata } from '@/scripts/page-metadata.js';
import { antennasCache } from '@/cache.js';
import { inject } from 'vue';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const antennas = computed(() => antennasCache.value.value ?? []);

View File

@ -37,7 +37,9 @@ import { i18n } from '@/i18n.js';
import { definePageMetadata } from '@/scripts/page-metadata.js';
import { userListsCache } from '@/cache.js';
import { inject } from 'vue';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
import { signinRequired } from '@/account.js';
const $i = signinRequired();

View File

@ -18,7 +18,9 @@ import { i18n } from '@/i18n.js';
import { definePageMetadata } from '@/scripts/page-metadata.js';
import { pleaseLogin } from '@/scripts/please-login.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const props = defineProps<{
showLoginPopup?: boolean;

View File

@ -121,8 +121,12 @@ import { copyToClipboard } from '@/scripts/copy-to-clipboard.js';
import { useRouter } from '@/router/supplier.js';
import { MenuItem } from '@/types/menu';
const serverMetadata = inject('serverMetadata');
const mediaProxy = inject('mediaProxy');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy);
const router = useRouter();

View File

@ -45,7 +45,9 @@ import { i18n } from '@/i18n.js';
import MkTimeline from '@/components/MkTimeline.vue';
import { instanceName } from '@@/js/config.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const props = withDefaults(defineProps<{
role: string;

View File

@ -67,7 +67,9 @@ import MkUserCardMini from '@/components/MkUserCardMini.vue';
import MkRadios from '@/components/MkRadios.vue';
import { $i } from '@/account.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const props = withDefaults(defineProps<{
query?: string;

View File

@ -32,7 +32,9 @@ import { isNotesSearchAvailable } from '@/scripts/check-permissions.js';
import MkInfo from '@/components/MkInfo.vue';
import MkHorizontalSwipe from '@/components/MkHorizontalSwipe.vue';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const props = withDefaults(defineProps<{
query?: string,

View File

@ -53,7 +53,9 @@ import { definePageMetadata } from '@/scripts/page-metadata.js';
import MkKeyValue from '@/components/MkKeyValue.vue';
import MkButton from '@/components/MkButton.vue';
import { inject } from 'vue';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const list = ref<InstanceType<typeof FormPagination>>();

View File

@ -59,7 +59,9 @@ import { signinRequired } from '@/account.js';
import { i18n } from '@/i18n.js';
import { definePageMetadata } from '@/scripts/page-metadata.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const $i = signinRequired();

View File

@ -38,7 +38,9 @@ import { PageMetadata, definePageMetadata, provideMetadataReceiver, provideReact
import * as os from '@/os.js';
import { useRouter } from '@/router/supplier.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const indexInfo = {
title: i18n.ts.settings,

View File

@ -137,7 +137,9 @@ import MkUserCardMini from '@/components/MkUserCardMini.vue';
import * as os from '@/os.js';
import { misskeyApi } from '@/scripts/misskey-api.js';
import { inject } from 'vue';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
import { signinRequired } from '@/account.js';
import MkFolder from '@/components/MkFolder.vue';

View File

@ -90,7 +90,9 @@ import { miLocalStorage } from '@/local-storage.js';
import { unisonReload } from '@/scripts/unison-reload.js';
import * as os from '@/os.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
async function reloadAsk() {
const { canceled } = await os.confirm({

View File

@ -57,7 +57,9 @@ import { availableBasicTimelines, hasWithReplies, isAvailableBasicTimeline, isBa
provide('shouldOmitHeaderTitle', true);
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const tlComponent = shallowRef<InstanceType<typeof MkTimeline>>();
const rootEl = shallowRef<HTMLElement>();

View File

@ -175,8 +175,10 @@ import { misskeyApi } from '@/scripts/misskey-api.js';
import { isFollowingVisibleForMe, isFollowersVisibleForMe } from '@/scripts/isFfVisibleForMe.js';
import { useRouter } from '@/router/supplier.js';
const serverMetadata = inject('serverMetadata');
const mediaProxy = inject('mediaProxy');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const mediaProxy = inject(DI.mediaProxy);
function calcAge(birthdate: string): number {
const date = new Date(birthdate);

View File

@ -42,7 +42,9 @@ import ImgWithBlurhash from '@/components/MkImgWithBlurhash.vue';
import { defaultStore } from '@/store.js';
import { i18n } from '@/i18n.js';
const mediaProxy = inject('mediaProxy');
import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy);
const props = defineProps<{
user: Misskey.entities.UserDetailed;

View File

@ -45,8 +45,10 @@ import misskeysvg from '/client-assets/misskey.svg';
import { misskeyApiGet } from '@/scripts/misskey-api.js';
import MkVisitorDashboard from '@/components/MkVisitorDashboard.vue';
const serverMetadata = inject('serverMetadata');
const mediaProxy = inject('mediaProxy');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const mediaProxy = inject(DI.mediaProxy);
const instances = ref<Misskey.entities.FederationInstance[]>();

View File

@ -57,7 +57,9 @@ import { $i, openAccountMenu as openAccountMenu_ } from '@/account.js';
import { defaultStore } from '@/store.js';
import { i18n } from '@/i18n.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const menu = toRef(defaultStore.state, 'menu');
const otherMenuItemIndicated = computed(() => {

View File

@ -68,7 +68,9 @@ import { $i, openAccountMenu as openAccountMenu_ } from '@/account.js';
import { defaultStore } from '@/store.js';
import { i18n } from '@/i18n.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const iconOnly = ref(false);

View File

@ -37,7 +37,9 @@ import { useInterval } from '@@/js/use-interval.js';
import MarqueeText from '@/components/MkMarquee.vue';
import { misskeyApi } from '@/scripts/misskey-api.js';
const mediaProxy = inject('mediaProxy');
import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy);
const props = defineProps<{
display?: 'marquee' | 'oneByOne';

View File

@ -56,7 +56,9 @@ import MkButton from '@/components/MkButton.vue';
import { defaultStore } from '@/store.js';
import { i18n } from '@/i18n.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const WINDOW_THRESHOLD = 1400;

View File

@ -62,7 +62,9 @@ import MkButton from '@/components/MkButton.vue';
import { defaultStore } from '@/store.js';
import { i18n } from '@/i18n.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const WINDOW_THRESHOLD = 1400;

View File

@ -43,7 +43,9 @@ import { SoundStore } from '@/store.js';
import { soundSettingsButton } from '@/ui/deck/tl-note-notification.js';
import * as sound from '@/scripts/sound.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const props = defineProps<{
column: Column;

View File

@ -81,7 +81,9 @@ import { i18n } from '@/i18n.js';
import MkVisitorDashboard from '@/components/MkVisitorDashboard.vue';
import { mainRouter } from '@/router/main.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const isRoot = computed(() => mainRouter.currentRoute.value.name === 'index');

View File

@ -32,7 +32,9 @@ import MkContainer from '@/components/MkContainer.vue';
import { misskeyApi } from '@/scripts/misskey-api.js';
import { i18n } from '@/i18n.js';
import { inject } from 'vue';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
import { $i } from '@/account.js';
const name = i18n.ts._widgets.birthdayFollowings;

View File

@ -56,7 +56,9 @@ const { widgetProps, configure } = useWidgetPropsManager(name,
emit,
);
const mediaProxy = inject('mediaProxy');
import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy);
const instances = ref<Misskey.entities.FederationInstance[]>([]);
const charts = ref<Misskey.entities.ChartsInstanceResponse[]>([]);

View File

@ -48,7 +48,9 @@ const { widgetProps, configure } = useWidgetPropsManager(name,
emit,
);
const mediaProxy = inject('mediaProxy');
import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy);
const cloud = shallowRef<InstanceType<typeof MkTagCloud> | null>();
const activeInstances = shallowRef<Misskey.entities.FederationInstance[] | null>(null);

View File

@ -25,7 +25,9 @@ import { useWidgetPropsManager, WidgetComponentEmits, WidgetComponentExpose, Wid
import { GetFormResultType } from '@/scripts/form.js';
import { host } from '@@/js/config.js';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const name = 'instanceInfo';

View File

@ -56,7 +56,9 @@ const { widgetProps, configure } = useWidgetPropsManager(name,
emit,
);
const mediaProxy = inject('mediaProxy');
import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy);
const connection = useStream().useChannel('main');
const images = ref<Misskey.entities.DriveFile[]>([]);

View File

@ -32,7 +32,9 @@ import { url as base } from '@@/js/config.js';
import { i18n } from '@/i18n.js';
import { useInterval } from '@@/js/use-interval.js';
import { inject } from 'vue';
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const name = 'rss';

View File

@ -80,7 +80,9 @@ const { widgetProps, configure, save } = useWidgetPropsManager(name,
emit,
);
const serverMetadata = inject('serverMetadata');
import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata);
const menuOpened = ref(false);