2023-07-07 19:22:30 +00:00
|
|
|
<template>
|
2023-07-23 13:31:28 +00:00
|
|
|
<XPostForm
|
|
|
|
class="_panel mkw-postForm"
|
|
|
|
:fixed="true"
|
|
|
|
:autofocus="false"
|
|
|
|
:show-mfm-cheat-sheet="true"
|
|
|
|
/>
|
2023-07-07 19:22:30 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import {} from "vue";
|
|
|
|
import { GetFormResultType } from "@/scripts/form";
|
|
|
|
import {
|
2023-07-23 13:31:28 +00:00
|
|
|
useWidgetPropsManager,
|
|
|
|
Widget,
|
|
|
|
WidgetComponentEmits,
|
|
|
|
WidgetComponentExpose,
|
|
|
|
WidgetComponentProps,
|
2023-07-07 19:22:30 +00:00
|
|
|
} from "./widget";
|
|
|
|
import XPostForm from "@/components/MkPostForm.vue";
|
|
|
|
|
|
|
|
const name = "postForm";
|
|
|
|
|
|
|
|
const widgetPropsDef = {};
|
|
|
|
|
|
|
|
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
|
|
|
|
|
|
|
|
// 現時点ではvueの制限によりimportしたtypeをジェネリックに渡せない
|
|
|
|
//const props = defineProps<WidgetComponentProps<WidgetProps>>();
|
|
|
|
//const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
|
|
|
|
const props = defineProps<{ widget?: Widget<WidgetProps> }>();
|
|
|
|
const emit = defineEmits<{ (ev: "updateProps", props: WidgetProps) }>();
|
|
|
|
|
|
|
|
const { widgetProps, configure } = useWidgetPropsManager(
|
2023-07-23 13:31:28 +00:00
|
|
|
name,
|
|
|
|
widgetPropsDef,
|
|
|
|
props,
|
2024-04-08 01:10:23 +00:00
|
|
|
emit,
|
2023-07-07 19:22:30 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
defineExpose<WidgetComponentExpose>({
|
2023-07-23 13:31:28 +00:00
|
|
|
name,
|
|
|
|
configure,
|
|
|
|
id: props.widget ? props.widget.id : null,
|
2023-07-07 19:22:30 +00:00
|
|
|
});
|
|
|
|
</script>
|