2020-01-30 04:37:25 +09:00
|
|
|
<template>
|
2022-12-31 19:46:16 +09:00
|
|
|
<MkModal ref="modal" :prefer-type="'dialog:top'" @click="modal.close()" @closed="onModalClosed()">
|
|
|
|
<MkPostForm ref="form" v-bind="props" autofocus freeze-after-posted @posted="onPosted" @cancel="modal.close()" @esc="modal.close()"/>
|
2020-10-17 20:12:00 +09:00
|
|
|
</MkModal>
|
2020-01-30 04:37:25 +09:00
|
|
|
</template>
|
|
|
|
|
2022-12-31 19:46:16 +09:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { } from 'vue';
|
|
|
|
import * as misskey from 'misskey-js';
|
2022-09-06 18:21:49 +09:00
|
|
|
import MkModal from '@/components/MkModal.vue';
|
2022-08-31 00:24:33 +09:00
|
|
|
import MkPostForm from '@/components/MkPostForm.vue';
|
2020-01-30 04:37:25 +09:00
|
|
|
|
2022-12-31 19:46:16 +09:00
|
|
|
const props = defineProps<{
|
|
|
|
reply?: misskey.entities.Note;
|
|
|
|
renote?: misskey.entities.Note;
|
|
|
|
channel?: any; // TODO
|
|
|
|
mention?: misskey.entities.User;
|
|
|
|
specified?: misskey.entities.User;
|
|
|
|
initialText?: string;
|
|
|
|
initialVisibility?: typeof misskey.noteVisibilities;
|
|
|
|
initialFiles?: misskey.entities.DriveFile[];
|
|
|
|
initialLocalOnly?: boolean;
|
|
|
|
initialVisibleUsers?: misskey.entities.User[];
|
|
|
|
initialNote?: misskey.entities.Note;
|
|
|
|
instant?: boolean;
|
|
|
|
fixed?: boolean;
|
|
|
|
autofocus?: boolean;
|
|
|
|
}>();
|
|
|
|
|
|
|
|
const emit = defineEmits<{
|
|
|
|
(ev: 'closed'): void;
|
|
|
|
}>();
|
|
|
|
|
2023-01-03 13:37:32 +09:00
|
|
|
let modal = $shallowRef<InstanceType<typeof MkModal>>();
|
|
|
|
let form = $shallowRef<InstanceType<typeof MkPostForm>>();
|
2022-12-31 19:46:16 +09:00
|
|
|
|
|
|
|
function onPosted() {
|
|
|
|
modal.close({
|
|
|
|
useSendAnimation: true,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function onModalClosed() {
|
|
|
|
emit('closed');
|
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
</script>
|