popup(import -> popup(defineAsyncComponent(() => import

This commit is contained in:
tamaina 2022-04-27 05:31:33 +00:00
parent 555d42f7a7
commit 6e344ad301
30 changed files with 75 additions and 73 deletions

View File

@ -31,7 +31,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ref } from 'vue'; import { computed, defineAsyncComponent, ref } from 'vue';
import * as Misskey from 'misskey-js'; import * as Misskey from 'misskey-js';
import copyToClipboard from '@/scripts/copy-to-clipboard'; import copyToClipboard from '@/scripts/copy-to-clipboard';
import MkDriveFileThumbnail from './drive-file-thumbnail.vue'; import MkDriveFileThumbnail from './drive-file-thumbnail.vue';
@ -133,7 +133,7 @@ function rename() {
} }
function describe() { function describe() {
os.popup(import('@/components/media-caption.vue'), { os.popup(defineAsyncComponent(() => import('@/components/media-caption.vue')), {
title: i18n.ts.describeFile, title: i18n.ts.describeFile,
input: { input: {
placeholder: i18n.ts.inputNewDescription, placeholder: i18n.ts.inputNewDescription,

View File

@ -27,7 +27,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ref } from 'vue'; import { computed, defineAsyncComponent, ref } 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 { i18n } from '@/i18n'; import { i18n } from '@/i18n';
@ -230,7 +230,7 @@ function onContextmenu(ev: MouseEvent) {
text: i18n.ts.openInWindow, text: i18n.ts.openInWindow,
icon: 'fas fa-window-restore', icon: 'fas fa-window-restore',
action: () => { action: () => {
os.popup(import('./drive-window.vue'), { os.popup(defineAsyncComponent(() => import('./drive-window.vue')), {
initialFolder: props.folder initialFolder: props.folder
}, { }, {
}, 'closed'); }, 'closed');

View File

@ -16,7 +16,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { computed, defineComponent, onMounted, onUnmounted, ref, watch } from 'vue'; import { computed, defineAsyncComponent, defineComponent, onMounted, onUnmounted, ref, watch } from 'vue';
import * as os from '@/os'; import * as os from '@/os';
export default defineComponent({ export default defineComponent({
@ -112,7 +112,7 @@ export default defineComponent({
ev.preventDefault(); ev.preventDefault();
const tooltipShowing = ref(true); const tooltipShowing = ref(true);
os.popup(import('@/components/ui/tooltip.vue'), { os.popup(defineAsyncComponent(() => import('@/components/ui/tooltip.vue')), {
showing: tooltipShowing, showing: tooltipShowing,
text: computed(() => { text: computed(() => {
return props.textConverter(finalValue.value); return props.textConverter(finalValue.value);

View File

@ -18,7 +18,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, ref } from 'vue'; import { defineAsyncComponent, defineComponent, ref } from 'vue';
import { toUnicode as decodePunycode } from 'punycode/'; import { toUnicode as decodePunycode } from 'punycode/';
import { url as local } from '@/config'; import { url as local } from '@/config';
import * as os from '@/os'; import * as os from '@/os';
@ -50,7 +50,7 @@ export default defineComponent({
const el = ref(); const el = ref();
useTooltip(el, (showing) => { useTooltip(el, (showing) => {
os.popup(import('@/components/url-preview-popup.vue'), { os.popup(defineAsyncComponent(() => import('@/components/url-preview-popup.vue')), {
showing, showing,
url: props.url, url: props.url,
source: el.value, source: el.value,

View File

@ -8,7 +8,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { } from 'vue'; import { defineAsyncComponent } from 'vue';
import { url as local } from '@/config'; import { url as local } from '@/config';
import { useTooltip } from '@/scripts/use-tooltip'; import { useTooltip } from '@/scripts/use-tooltip';
import * as os from '@/os'; import * as os from '@/os';
@ -26,7 +26,7 @@ const target = self ? null : '_blank';
const el = $ref(); const el = $ref();
useTooltip($$(el), (showing) => { useTooltip($$(el), (showing) => {
os.popup(import('@/components/url-preview-popup.vue'), { os.popup(defineAsyncComponent(() => import('@/components/url-preview-popup.vue')), {
showing, showing,
url: props.url, url: props.url,
source: el, source: el,

View File

@ -88,7 +88,7 @@ export default defineComponent({
}, },
async describe(file) { async describe(file) {
os.popup(import("@/components/media-caption.vue"), { os.popup(defineAsyncComponent(() => import("@/components/media-caption.vue")), {
title: this.$ts.describeFile, title: this.$ts.describeFile,
input: { input: {
placeholder: this.$ts.inputNewDescription, placeholder: this.$ts.inputNewDescription,

View File

@ -62,7 +62,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { inject, watch, nextTick, onMounted } from 'vue'; import { inject, watch, nextTick, onMounted, defineAsyncComponent } 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 insertTextAtCursor from 'insert-text-at-cursor'; import insertTextAtCursor from 'insert-text-at-cursor';
@ -383,7 +383,7 @@ function setVisibility() {
return; return;
} }
os.popup(import('./visibility-picker.vue'), { os.popup(defineAsyncComponent(() => import('./visibility-picker.vue')), {
currentVisibility: visibility, currentVisibility: visibility,
currentLocalOnly: localOnly, currentLocalOnly: localOnly,
src: visibilityButton, src: visibilityButton,

View File

@ -46,7 +46,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineAsyncComponent, defineComponent } from 'vue';
import { toUnicode } from 'punycode/'; import { toUnicode } from 'punycode/';
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';
@ -224,7 +224,7 @@ export default defineComponent({
}, },
resetPassword() { resetPassword() {
os.popup(import('@/components/forgot-password.vue'), {}, { os.popup(defineAsyncComponent(() => import('@/components/forgot-password.vue')), {}, {
}, 'closed'); }, 'closed');
} }
} }

View File

@ -1,7 +1,7 @@
// TODO: useTooltip関数使うようにしたい // TODO: useTooltip関数使うようにしたい
// ただディレクティブ内でonUnmountedなどのcomposition api使えるのか不明 // ただディレクティブ内でonUnmountedなどのcomposition api使えるのか不明
import { Directive, ref } from 'vue'; import { defineAsyncComponent, Directive, ref } from 'vue';
import { isTouchUsing } from '@/scripts/touch'; import { isTouchUsing } from '@/scripts/touch';
import { popup, alert } from '@/os'; import { popup, alert } from '@/os';
@ -45,7 +45,7 @@ export default {
if (self.text == null) return; if (self.text == null) return;
const showing = ref(true); const showing = ref(true);
popup(import('@/components/ui/tooltip.vue'), { popup(defineAsyncComponent(() => import('@/components/ui/tooltip.vue')), {
showing, showing,
text: self.text, text: self.text,
targetElement: el, targetElement: el,

View File

@ -1,4 +1,4 @@
import { Directive, ref } from 'vue'; import { defineAsyncComponent, Directive, ref } from 'vue';
import autobind from 'autobind-decorator'; import autobind from 'autobind-decorator';
import { popup } from '@/os'; import { popup } from '@/os';
@ -24,7 +24,7 @@ export class UserPreview {
const showing = ref(true); const showing = ref(true);
popup(import('@/components/user-preview.vue'), { popup(defineAsyncComponent(() => import('@/components/user-preview.vue')), {
showing, showing,
q: this.user, q: this.user,
source: this.el source: this.el

View File

@ -166,7 +166,7 @@ export function pageWindow(path: string) {
export function modalPageWindow(path: string) { export function modalPageWindow(path: string) {
const { component, props } = resolve(path); const { component, props } = resolve(path);
popup(import('@/components/modal-page-window.vue'), { popup(defineAsyncComponent(() => import('@/components/modal-page-window.vue')), {
initialPath: path, initialPath: path,
initialComponent: markRaw(component), initialComponent: markRaw(component),
initialProps: props, initialProps: props,
@ -174,7 +174,7 @@ export function modalPageWindow(path: string) {
} }
export function toast(message: string) { export function toast(message: string) {
popup(import('@/components/toast.vue'), { popup(defineAsyncComponent(() => import('@/components/toast.vue')), {
message message
}, {}, 'closed'); }, {}, 'closed');
} }
@ -185,7 +185,7 @@ export function alert(props: {
text?: string | null; text?: string | null;
}): Promise<void> { }): Promise<void> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup(import('@/components/dialog.vue'), props, { popup(defineAsyncComponent(() => import('@/components/dialog.vue')), props, {
done: result => { done: result => {
resolve(); resolve();
}, },
@ -199,7 +199,7 @@ export function confirm(props: {
text?: string | null; text?: string | null;
}): Promise<{ canceled: boolean }> { }): Promise<{ canceled: boolean }> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup(import('@/components/dialog.vue'), { popup(defineAsyncComponent(() => import('@/components/dialog.vue')), {
...props, ...props,
showCancelButton: true, showCancelButton: true,
}, { }, {
@ -220,7 +220,7 @@ export function inputText(props: {
canceled: false; result: string; canceled: false; result: string;
}> { }> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup(import('@/components/dialog.vue'), { popup(defineAsyncComponent(() => import('@/components/dialog.vue')), {
title: props.title, title: props.title,
text: props.text, text: props.text,
input: { input: {
@ -245,7 +245,7 @@ export function inputNumber(props: {
canceled: false; result: number; canceled: false; result: number;
}> { }> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup(import('@/components/dialog.vue'), { popup(defineAsyncComponent(() => import('@/components/dialog.vue')), {
title: props.title, title: props.title,
text: props.text, text: props.text,
input: { input: {
@ -270,7 +270,7 @@ export function inputDate(props: {
canceled: false; result: Date; canceled: false; result: Date;
}> { }> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup(import('@/components/dialog.vue'), { popup(defineAsyncComponent(() => import('@/components/dialog.vue')), {
title: props.title, title: props.title,
text: props.text, text: props.text,
input: { input: {
@ -307,7 +307,7 @@ export function select<C extends any = any>(props: {
canceled: false; result: C; canceled: false; result: C;
}> { }> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup(import('@/components/dialog.vue'), { popup(defineAsyncComponent(() => import('@/components/dialog.vue')), {
title: props.title, title: props.title,
text: props.text, text: props.text,
select: { select: {
@ -329,7 +329,7 @@ export function success() {
window.setTimeout(() => { window.setTimeout(() => {
showing.value = false; showing.value = false;
}, 1000); }, 1000);
popup(import('@/components/waiting-dialog.vue'), { popup(defineAsyncComponent(() => import('@/components/waiting-dialog.vue')), {
success: true, success: true,
showing: showing showing: showing
}, { }, {
@ -341,7 +341,7 @@ export function success() {
export function waiting() { export function waiting() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const showing = ref(true); const showing = ref(true);
popup(import('@/components/waiting-dialog.vue'), { popup(defineAsyncComponent(() => import('@/components/waiting-dialog.vue')), {
success: false, success: false,
showing: showing showing: showing
}, { }, {
@ -352,7 +352,7 @@ export function waiting() {
export function form(title, form) { export function form(title, form) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup(import('@/components/form-dialog.vue'), { title, form }, { popup(defineAsyncComponent(() => import('@/components/form-dialog.vue')), { title, form }, {
done: result => { done: result => {
resolve(result); resolve(result);
}, },
@ -362,7 +362,7 @@ export function form(title, form) {
export async function selectUser() { export async function selectUser() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup(import('@/components/user-select-dialog.vue'), {}, { popup(defineAsyncComponent(() => import('@/components/user-select-dialog.vue')), {}, {
ok: user => { ok: user => {
resolve(user); resolve(user);
}, },
@ -372,7 +372,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, reject) => {
popup(import('@/components/drive-select-dialog.vue'), { popup(defineAsyncComponent(() => import('@/components/drive-select-dialog.vue')), {
type: 'file', type: 'file',
multiple multiple
}, { }, {
@ -387,7 +387,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, reject) => {
popup(import('@/components/drive-select-dialog.vue'), { popup(defineAsyncComponent(() => import('@/components/drive-select-dialog.vue')), {
type: 'folder', type: 'folder',
multiple multiple
}, { }, {
@ -402,7 +402,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, reject) => {
popup(import('@/components/emoji-picker-dialog.vue'), { popup(defineAsyncComponent(() => import('@/components/emoji-picker-dialog.vue')), {
src, src,
...opts ...opts
}, { }, {
@ -452,7 +452,7 @@ export async function openEmojiPicker(src?: HTMLElement, opts, initialTextarea:
characterData: false, characterData: false,
}); });
openingEmojiPicker = await popup(import('@/components/emoji-picker-window.vue'), { openingEmojiPicker = await popup(defineAsyncComponent(() => import('@/components/emoji-picker-window.vue')), {
src, src,
...opts ...opts
}, { }, {
@ -474,7 +474,7 @@ export function popupMenu(items: MenuItem[] | Ref<MenuItem[]>, src?: HTMLElement
}) { }) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let dispose; let dispose;
popup(import('@/components/ui/popup-menu.vue'), { popup(defineAsyncComponent(() => import('@/components/ui/popup-menu.vue')), {
items, items,
src, src,
width: options?.width, width: options?.width,
@ -495,7 +495,7 @@ export function contextMenu(items: MenuItem[] | Ref<MenuItem[]>, ev: MouseEvent)
ev.preventDefault(); ev.preventDefault();
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let dispose; let dispose;
popup(import('@/components/ui/context-menu.vue'), { popup(defineAsyncComponent(() => import('@/components/ui/context-menu.vue')), {
items, items,
ev, ev,
}, { }, {

View File

@ -63,7 +63,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, defineComponent, ref, toRef } from 'vue'; import { computed, defineAsyncComponent, defineComponent, ref, toRef } from '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';
@ -130,7 +130,7 @@ const add = async (ev: MouseEvent) => {
}; };
const edit = (emoji) => { const edit = (emoji) => {
os.popup(import('./emoji-edit-dialog.vue'), { os.popup(defineAsyncComponent(() => import('./emoji-edit-dialog.vue')), {
emoji: emoji emoji: emoji
}, { }, {
done: result => { done: result => {

View File

@ -55,7 +55,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed } from 'vue'; import { computed, defineAsyncComponent } from '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 MkSelect from '@/components/form/select.vue'; import MkSelect from '@/components/form/select.vue';
@ -93,7 +93,7 @@ function clear() {
} }
function show(file) { function show(file) {
os.popup(import('./file-dialog.vue'), { os.popup(defineAsyncComponent(() => import('./file-dialog.vue')), {
fileId: file.id fileId: file.id
}, {}, 'closed'); }, {}, 'closed');
} }

View File

@ -12,7 +12,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted } from 'vue'; import { defineAsyncComponent, onMounted } from 'vue';
import FormInput from '@/components/form/input.vue'; import FormInput from '@/components/form/input.vue';
import FormButton from '@/components/ui/button.vue'; import FormButton from '@/components/ui/button.vue';
import * as os from '@/os'; import * as os from '@/os';
@ -36,7 +36,7 @@ async function save() {
onMounted(() => { onMounted(() => {
if (props.token == null) { if (props.token == null) {
os.popup(import('@/components/forgot-password.vue'), {}, {}, 'closed'); os.popup(defineAsyncComponent(() => import('@/components/forgot-password.vue')), {}, {}, 'closed');
router.push('/'); router.push('/');
} }
}); });

View File

@ -21,7 +21,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineAsyncComponent, defineComponent } from 'vue';
import FormSuspense from '@/components/form/suspense.vue'; import FormSuspense from '@/components/form/suspense.vue';
import FormButton from '@/components/ui/button.vue'; import FormButton from '@/components/ui/button.vue';
import * as os from '@/os'; import * as os from '@/os';
@ -78,7 +78,7 @@ export default defineComponent({
}, },
addExistingAccount() { addExistingAccount() {
os.popup(import('@/components/signin-dialog.vue'), {}, { os.popup(defineAsyncComponent(() => import('@/components/signin-dialog.vue')), {}, {
done: res => { done: res => {
addAccount(res.id, res.i); addAccount(res.id, res.i);
os.success(); os.success();
@ -87,7 +87,7 @@ export default defineComponent({
}, },
createAccount() { createAccount() {
os.popup(import('@/components/signup-dialog.vue'), {}, { os.popup(defineAsyncComponent(() => import('@/components/signup-dialog.vue')), {}, {
done: res => { done: res => {
addAccount(res.id, res.i); addAccount(res.id, res.i);
this.switchAccountWithToken(res.i); this.switchAccountWithToken(res.i);

View File

@ -7,7 +7,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineAsyncComponent, defineComponent } from 'vue';
import FormLink from '@/components/form/link.vue'; import FormLink from '@/components/form/link.vue';
import FormButton from '@/components/ui/button.vue'; import FormButton from '@/components/ui/button.vue';
import * as os from '@/os'; import * as os from '@/os';
@ -34,7 +34,7 @@ export default defineComponent({
methods: { methods: {
generateToken() { generateToken() {
os.popup(import('@/components/token-generate-window.vue'), {}, { os.popup(defineAsyncComponent(() => import('@/components/token-generate-window.vue')), {}, {
done: async result => { done: async result => {
const { name, permissions } = result; const { name, permissions } = result;
const { token } = await os.api('miauth/gen-token', { const { token } = await os.api('miauth/gen-token', {

View File

@ -10,7 +10,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineAsyncComponent, defineComponent } from 'vue';
import FormButton from '@/components/ui/button.vue'; import FormButton from '@/components/ui/button.vue';
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';
@ -52,7 +52,7 @@ export default defineComponent({
configure() { configure() {
const includingTypes = notificationTypes.filter(x => !this.$i.mutingNotificationTypes.includes(x)); const includingTypes = notificationTypes.filter(x => !this.$i.mutingNotificationTypes.includes(x));
os.popup(import('@/components/notification-setting-window.vue'), { os.popup(defineAsyncComponent(() => import('@/components/notification-setting-window.vue')), {
includingTypes, includingTypes,
showGlobalToggle: false, showGlobalToggle: false,
}, { }, {

View File

@ -13,7 +13,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineAsyncComponent, defineComponent } from 'vue';
import { AiScript, parse } from '@syuilo/aiscript'; import { AiScript, parse } from '@syuilo/aiscript';
import { serialize } from '@syuilo/aiscript/built/serializer'; import { serialize } from '@syuilo/aiscript/built/serializer';
import { v4 as uuid } from 'uuid'; import { v4 as uuid } from 'uuid';
@ -94,7 +94,7 @@ export default defineComponent({
} }
const token = permissions == null || permissions.length === 0 ? null : await new Promise((res, rej) => { const token = permissions == null || permissions.length === 0 ? null : await new Promise((res, rej) => {
os.popup(import('@/components/token-generate-window.vue'), { os.popup(defineAsyncComponent(() => import('@/components/token-generate-window.vue')), {
title: this.$ts.tokenRequested, title: this.$ts.tokenRequested,
information: this.$ts.pluginTokenRequestedDescription, information: this.$ts.pluginTokenRequestedDescription,
initialName: name, initialName: name,

View File

@ -54,7 +54,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { watch } from 'vue'; import { defineAsyncComponent, watch } from 'vue';
import XDraggable from 'vuedraggable'; import XDraggable from 'vuedraggable';
import FormInput from '@/components/form/input.vue'; import FormInput from '@/components/form/input.vue';
import FormRadios from '@/components/form/radios.vue'; import FormRadios from '@/components/form/radios.vue';
@ -88,7 +88,7 @@ function remove(reaction, ev: MouseEvent) {
} }
function preview(ev: MouseEvent) { function preview(ev: MouseEvent) {
os.popup(import('@/components/emoji-picker-dialog.vue'), { os.popup(defineAsyncComponent(() => import('@/components/emoji-picker-dialog.vue')), {
asReactionPicker: true, asReactionPicker: true,
src: ev.currentTarget ?? ev.target, src: ev.currentTarget ?? ev.target,
}, {}, 'closed'); }, {}, 'closed');

View File

@ -1,4 +1,4 @@
import { nextTick, Ref, ref } from 'vue'; import { nextTick, Ref, ref, defineAsyncComponent } from 'vue';
import getCaretCoordinates from 'textarea-caret'; import getCaretCoordinates from 'textarea-caret';
import { toASCII } from 'punycode/'; import { toASCII } from 'punycode/';
import { popup } from '@/os'; import { popup } from '@/os';
@ -157,7 +157,7 @@ export class Autocomplete {
const _y = ref(y); const _y = ref(y);
const _q = ref(q); const _q = ref(q);
const { dispose } = await popup(import('@/components/autocomplete.vue'), { const { dispose } = await popup(defineAsyncComponent(() => import('@/components/autocomplete.vue')), {
textarea: this.textarea, textarea: this.textarea,
close: this.close, close: this.close,
type: type, type: type,

View File

@ -1,4 +1,4 @@
import { Ref } from 'vue'; import { defineAsyncComponent, Ref } from 'vue';
import * as misskey from 'misskey-js'; import * as misskey from 'misskey-js';
import { $i } from '@/account'; import { $i } from '@/account';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
@ -253,7 +253,7 @@ export function getNoteMenu(props: {
text: i18n.ts.reportAbuse, text: i18n.ts.reportAbuse,
action: () => { action: () => {
const u = appearNote.url || appearNote.uri || `${url}/notes/${appearNote.id}`; const u = appearNote.url || appearNote.uri || `${url}/notes/${appearNote.id}`;
os.popup(import('@/components/abuse-report-window.vue'), { os.popup(defineAsyncComponent(() => import('@/components/abuse-report-window.vue')), {
user: appearNote.user, user: appearNote.user,
initialComment: `Note: ${u}\n-----\n` initialComment: `Note: ${u}\n-----\n`
}, {}, 'closed'); }, {}, 'closed');

View File

@ -6,6 +6,7 @@ import * as os from '@/os';
import { userActions } from '@/store'; import { userActions } from '@/store';
import { router } from '@/router'; import { router } from '@/router';
import { $i, iAmModerator } from '@/account'; import { $i, iAmModerator } from '@/account';
import { defineAsyncComponent } from 'vue';
export function getUserMenu(user) { export function getUserMenu(user) {
const meId = $i ? $i.id : null; const meId = $i ? $i.id : null;
@ -127,7 +128,7 @@ export function getUserMenu(user) {
} }
function reportAbuse() { function reportAbuse() {
os.popup(import('@/components/abuse-report-window.vue'), { os.popup(defineAsyncComponent(() => import('@/components/abuse-report-window.vue')), {
user: user, user: user,
}, {}, 'closed'); }, {}, 'closed');
} }

View File

@ -1,4 +1,4 @@
import { Ref, ref } from 'vue'; import { defineAsyncComponent, Ref, ref } from 'vue';
import { popup } from '@/os'; import { popup } from '@/os';
class ReactionPicker { class ReactionPicker {
@ -12,7 +12,7 @@ class ReactionPicker {
} }
public async init() { public async init() {
await popup(import('@/components/emoji-picker-dialog.vue'), { await popup(defineAsyncComponent(() => import('@/components/emoji-picker-dialog.vue')), {
src: this.src, src: this.src,
asReactionPicker: true, asReactionPicker: true,
manualShowing: this.manualShowing manualShowing: this.manualShowing

View File

@ -38,7 +38,7 @@ export default defineComponent({
id: notification.id id: notification.id
}); });
popup(import('@/components/notification-toast.vue'), { popup(defineAsyncComponent(() => import('@/components/notification-toast.vue')), {
notification notification
}, {}, 'closed'); }, {}, 'closed');
} }

View File

@ -33,7 +33,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { computed, defineComponent, ref, toRef, watch } from 'vue'; import { computed, defineAsyncComponent, defineComponent, ref, toRef, watch } from 'vue';
import { host } from '@/config'; import { host } from '@/config';
import { search } from '@/scripts/search'; import { search } from '@/scripts/search';
import * as os from '@/os'; import * as os from '@/os';
@ -67,7 +67,7 @@ export default defineComponent({
}, ev); }, ev);
}, },
more: () => { more: () => {
os.popup(import('@/components/launch-pad.vue'), {}, { os.popup(defineAsyncComponent(() => import('@/components/launch-pad.vue')), {}, {
}, 'closed'); }, 'closed');
}, },
}; };

View File

@ -33,7 +33,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ref, watch } from 'vue'; import { computed, defineAsyncComponent, ref, watch } from 'vue';
import * as os from '@/os'; import * as os from '@/os';
import { menuDef } from '@/menu'; import { menuDef } from '@/menu';
import { $i, openAccountMenu as openAccountMenu_ } from '@/account'; import { $i, openAccountMenu as openAccountMenu_ } from '@/account';
@ -69,7 +69,7 @@ function openAccountMenu(ev: MouseEvent) {
} }
function more(ev: MouseEvent) { function more(ev: MouseEvent) {
os.popup(import('@/components/launch-pad.vue'), { os.popup(defineAsyncComponent(() => import('@/components/launch-pad.vue')), {
src: ev.currentTarget ?? ev.target, src: ev.currentTarget ?? ev.target,
}, { }, {
}, 'closed'); }, 'closed');

View File

@ -39,7 +39,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineAsyncComponent, defineComponent } from 'vue';
import { host } from '@/config'; import { host } from '@/config';
import { search } from '@/scripts/search'; import { search } from '@/scripts/search';
import * as os from '@/os'; import * as os from '@/os';
@ -101,7 +101,7 @@ export default defineComponent({
}, },
more(ev) { more(ev) {
os.popup(import('@/components/launch-pad.vue'), { os.popup(defineAsyncComponent(() => import('@/components/launch-pad.vue')), {
src: ev.currentTarget ?? ev.target, src: ev.currentTarget ?? ev.target,
anchor: { x: 'center', y: 'bottom' }, anchor: { x: 'center', y: 'bottom' },
}, { }, {

View File

@ -41,7 +41,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineAsyncComponent, defineComponent } from 'vue';
import { host } from '@/config'; import { host } from '@/config';
import { search } from '@/scripts/search'; import { search } from '@/scripts/search';
import * as os from '@/os'; import * as os from '@/os';
@ -121,7 +121,7 @@ export default defineComponent({
}, },
more(ev) { more(ev) {
os.popup(import('@/components/launch-pad.vue'), { os.popup(defineAsyncComponent(() => import('@/components/launch-pad.vue')), {
src: ev.currentTarget ?? ev.target, src: ev.currentTarget ?? ev.target,
}, {}, 'closed'); }, {}, 'closed');
}, },

View File

@ -7,7 +7,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { } from 'vue'; import { defineAsyncComponent } from 'vue';
import XColumn from './column.vue'; import XColumn from './column.vue';
import XNotifications from '@/components/notifications.vue'; import XNotifications from '@/components/notifications.vue';
import * as os from '@/os'; import * as os from '@/os';
@ -24,7 +24,7 @@ const emit = defineEmits<{
}>(); }>();
function func() { function func() {
os.popup(import('@/components/notification-setting-window.vue'), { os.popup(defineAsyncComponent(() => import('@/components/notification-setting-window.vue')), {
includingTypes: props.column.includingTypes, includingTypes: props.column.includingTypes,
}, { }, {
done: async (res) => { done: async (res) => {

View File

@ -15,6 +15,7 @@ import { useWidgetPropsManager, Widget, WidgetComponentEmits, WidgetComponentExp
import MkContainer from '@/components/ui/container.vue'; import MkContainer from '@/components/ui/container.vue';
import XNotifications from '@/components/notifications.vue'; import XNotifications from '@/components/notifications.vue';
import * as os from '@/os'; import * as os from '@/os';
import { defineAsyncComponent } from 'vue';
const name = 'notifications'; const name = 'notifications';
@ -49,7 +50,7 @@ const { widgetProps, configure, save } = useWidgetPropsManager(name,
); );
const configureNotification = () => { const configureNotification = () => {
os.popup(import('@/components/notification-setting-window.vue'), { os.popup(defineAsyncComponent(() => import('@/components/notification-setting-window.vue')), {
includingTypes: widgetProps.includingTypes, includingTypes: widgetProps.includingTypes,
}, { }, {
done: async (res) => { done: async (res) => {