This commit is contained in:
syuilo 2024-09-01 17:11:25 +09:00
parent c08ccb65ba
commit cd665be463
87 changed files with 277 additions and 92 deletions

View file

@ -27,7 +27,9 @@ SPDX-License-Identifier: AGPL-3.0-only
import { computed, inject, ref } from 'vue';
import { customEmojisMap } from '@/custom-emojis.js';
const mediaProxy = inject('mediaProxy');
import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy);
const props = defineProps<{
name: string;

View file

@ -13,7 +13,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { computed, inject } from 'vue';
const mediaProxy = inject('mediaProxy');
import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy);
const props = defineProps<{
instance: {

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 '@/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

@ -201,7 +201,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

@ -237,7 +237,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

@ -33,7 +33,9 @@ import { useStream } from '@/stream.js';
import { i18n } from '@/i18n.js';
import { notificationTypes } from '@/const.js';
import { inject } from 'vue';
const serverMetadata = inject('serverMetadata');
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 '@/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,14 +141,16 @@ 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;
}>();
const dialog = shallowRef<InstanceType<typeof MkModalWindow>>();
const page = ref(defaultStore.state.accountSetupWizard);
watch(page, () => {

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 '@/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 '@/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 '@/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 '@/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 '@/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 '@/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);