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