2023-07-27 08:31:52 +03:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2020-01-29 21:37:25 +02:00
|
|
|
<template>
|
2023-05-19 07:58:09 +03:00
|
|
|
<MkModal ref="modal" :preferType="'dialog'" @click="modal.close()" @closed="onModalClosed()">
|
2023-07-08 12:55:02 +03:00
|
|
|
<MkPostForm ref="form" :class="$style.form" v-bind="props" autofocus freezeAfterPosted @posted="onPosted" @cancel="modal.close()" @esc="modal.close()"/>
|
2020-10-17 14:12:00 +03:00
|
|
|
</MkModal>
|
2020-01-29 21:37:25 +02:00
|
|
|
</template>
|
|
|
|
|
2022-12-31 12:46:16 +02:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { } from 'vue';
|
2023-09-04 07:33:38 +03:00
|
|
|
import * as Misskey from 'misskey-js';
|
2022-09-06 12:21:49 +03:00
|
|
|
import MkModal from '@/components/MkModal.vue';
|
2022-08-30 18:24:33 +03:00
|
|
|
import MkPostForm from '@/components/MkPostForm.vue';
|
2020-01-29 21:37:25 +02:00
|
|
|
|
2022-12-31 12:46:16 +02:00
|
|
|
const props = defineProps<{
|
2023-09-04 07:33:38 +03:00
|
|
|
reply?: Misskey.entities.Note;
|
|
|
|
renote?: Misskey.entities.Note;
|
2022-12-31 12:46:16 +02:00
|
|
|
channel?: any; // TODO
|
2023-09-04 07:33:38 +03:00
|
|
|
mention?: Misskey.entities.User;
|
|
|
|
specified?: Misskey.entities.User;
|
2022-12-31 12:46:16 +02:00
|
|
|
initialText?: string;
|
2023-09-04 07:33:38 +03:00
|
|
|
initialVisibility?: typeof Misskey.noteVisibilities;
|
|
|
|
initialFiles?: Misskey.entities.DriveFile[];
|
2022-12-31 12:46:16 +02:00
|
|
|
initialLocalOnly?: boolean;
|
2023-09-04 07:33:38 +03:00
|
|
|
initialVisibleUsers?: Misskey.entities.User[];
|
|
|
|
initialNote?: Misskey.entities.Note;
|
2022-12-31 12:46:16 +02:00
|
|
|
instant?: boolean;
|
|
|
|
fixed?: boolean;
|
|
|
|
autofocus?: boolean;
|
2023-09-22 23:33:18 +03:00
|
|
|
editId?: Misskey.entities.Note["id"];
|
2022-12-31 12:46:16 +02:00
|
|
|
}>();
|
|
|
|
|
|
|
|
const emit = defineEmits<{
|
|
|
|
(ev: 'closed'): void;
|
|
|
|
}>();
|
|
|
|
|
2023-01-03 06:37:32 +02:00
|
|
|
let modal = $shallowRef<InstanceType<typeof MkModal>>();
|
|
|
|
let form = $shallowRef<InstanceType<typeof MkPostForm>>();
|
2022-12-31 12:46:16 +02:00
|
|
|
|
|
|
|
function onPosted() {
|
|
|
|
modal.close({
|
|
|
|
useSendAnimation: true,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function onModalClosed() {
|
|
|
|
emit('closed');
|
|
|
|
}
|
2020-01-29 21:37:25 +02:00
|
|
|
</script>
|
2023-07-08 12:55:02 +03:00
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
.form {
|
|
|
|
max-height: 100%;
|
|
|
|
margin: 0 auto auto auto;
|
|
|
|
}
|
|
|
|
</style>
|