2023-07-27 05:31:52 +00:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2023-01-08 08:41:09 +00:00
|
|
|
<template>
|
2023-05-19 07:20:53 +00:00
|
|
|
<MkContainer :showHeader="widgetProps.showHeader" class="mkw-clicker">
|
2023-09-30 19:53:52 +00:00
|
|
|
<template #icon><i class="ph-cookie ph-bold pg-lg"></i></template>
|
2023-01-14 23:30:29 +00:00
|
|
|
<template #header>Clicker</template>
|
2023-01-08 08:41:09 +00:00
|
|
|
<MkClickerGame/>
|
|
|
|
</MkContainer>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2023-09-29 02:22:59 +00:00
|
|
|
import { useWidgetPropsManager, Widget, WidgetComponentEmits, WidgetComponentExpose, WidgetComponentProps } from './widget.js';
|
2023-09-19 07:37:43 +00:00
|
|
|
import { GetFormResultType } from '@/scripts/form.js';
|
2023-01-08 08:41:09 +00:00
|
|
|
import MkContainer from '@/components/MkContainer.vue';
|
|
|
|
import MkClickerGame from '@/components/MkClickerGame.vue';
|
|
|
|
|
|
|
|
const name = 'clicker';
|
|
|
|
|
|
|
|
const widgetPropsDef = {
|
|
|
|
showHeader: {
|
|
|
|
type: 'boolean' as const,
|
2023-01-09 00:04:35 +00:00
|
|
|
default: false,
|
2023-01-08 08:41:09 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
|
|
|
|
|
2023-05-19 07:20:53 +00:00
|
|
|
const props = defineProps<WidgetComponentProps<WidgetProps>>();
|
|
|
|
const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
|
2023-07-07 22:08:16 +00:00
|
|
|
|
2023-01-08 08:41:09 +00:00
|
|
|
const { widgetProps, configure } = useWidgetPropsManager(name,
|
|
|
|
widgetPropsDef,
|
|
|
|
props,
|
|
|
|
emit,
|
|
|
|
);
|
|
|
|
|
|
|
|
defineExpose<WidgetComponentExpose>({
|
|
|
|
name,
|
|
|
|
configure,
|
|
|
|
id: props.widget ? props.widget.id : null,
|
|
|
|
});
|
|
|
|
</script>
|