feat(frontend): chat widget

This commit is contained in:
syuilo 2025-04-15 15:37:29 +09:00
parent 7c0806f208
commit 525b6a7677
5 changed files with 60 additions and 0 deletions

View File

@ -4,6 +4,7 @@
-
### Client
- Feat: チャットウィジェットを追加
- Feat: デッキにチャットカラムを追加
- Fix: ログアウトした際に処理が終了しない問題を修正
- Fix: 自動バックアップが設定されている環境でログアウト直前に設定をバックアップするように

4
locales/index.d.ts vendored
View File

@ -9207,6 +9207,10 @@ export interface Locale extends ILocale {
*
*/
"birthdayFollowings": string;
/**
*
*/
"chat": string;
};
"_cw": {
/**

View File

@ -2421,6 +2421,7 @@ _widgets:
chooseList: "リストを選択"
clicker: "クリッカー"
birthdayFollowings: "今日誕生日のユーザー"
chat: "チャット"
_cw:
hide: "隠す"

View File

@ -0,0 +1,52 @@
<!--
SPDX-FileCopyrightText: syuilo and misskey-project
SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<MkContainer :showHeader="widgetProps.showHeader" class="mkw-chat">
<template #icon><i class="ti ti-users"></i></template>
<template #header>{{ i18n.ts._widgets.chat }}</template>
<template #func="{ buttonStyleClass }"><button class="_button" :class="buttonStyleClass" @click="configure()"><i class="ti ti-settings"></i></button></template>
<div>
<MkChatHistories/>
</div>
</MkContainer>
</template>
<script lang="ts" setup>
import { } from 'vue';
import { useWidgetPropsManager } from './widget.js';
import type { WidgetComponentEmits, WidgetComponentExpose, WidgetComponentProps } from './widget.js';
import type { GetFormResultType } from '@/utility/form.js';
import MkContainer from '@/components/MkContainer.vue';
import { i18n } from '@/i18n.js';
import MkChatHistories from '@/components/MkChatHistories.vue';
const name = 'chat';
const widgetPropsDef = {
showHeader: {
type: 'boolean' as const,
default: true,
},
};
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
const props = defineProps<WidgetComponentProps<WidgetProps>>();
const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const { widgetProps, configure, save } = useWidgetPropsManager(name,
widgetPropsDef,
props,
emit,
);
defineExpose<WidgetComponentExpose>({
name,
configure,
id: props.widget ? props.widget.id : null,
});
</script>

View File

@ -35,6 +35,7 @@ export default function(app: App) {
app.component('WidgetUserList', defineAsyncComponent(() => import('./WidgetUserList.vue')));
app.component('WidgetClicker', defineAsyncComponent(() => import('./WidgetClicker.vue')));
app.component('WidgetBirthdayFollowings', defineAsyncComponent(() => import('./WidgetBirthdayFollowings.vue')));
app.component('WidgetChat', defineAsyncComponent(() => import('./WidgetChat.vue')));
}
// 連合関連のウィジェット(連合無効時に隠す)
@ -70,6 +71,7 @@ export const widgets = [
'userList',
'clicker',
'birthdayFollowings',
'chat',
...federationWidgets,
];