feat(frontend): chat widget
This commit is contained in:
parent
7c0806f208
commit
525b6a7677
|
@ -4,6 +4,7 @@
|
||||||
-
|
-
|
||||||
|
|
||||||
### Client
|
### Client
|
||||||
|
- Feat: チャットウィジェットを追加
|
||||||
- Feat: デッキにチャットカラムを追加
|
- Feat: デッキにチャットカラムを追加
|
||||||
- Fix: ログアウトした際に処理が終了しない問題を修正
|
- Fix: ログアウトした際に処理が終了しない問題を修正
|
||||||
- Fix: 自動バックアップが設定されている環境でログアウト直前に設定をバックアップするように
|
- Fix: 自動バックアップが設定されている環境でログアウト直前に設定をバックアップするように
|
||||||
|
|
|
@ -9207,6 +9207,10 @@ export interface Locale extends ILocale {
|
||||||
* 今日誕生日のユーザー
|
* 今日誕生日のユーザー
|
||||||
*/
|
*/
|
||||||
"birthdayFollowings": string;
|
"birthdayFollowings": string;
|
||||||
|
/**
|
||||||
|
* チャット
|
||||||
|
*/
|
||||||
|
"chat": string;
|
||||||
};
|
};
|
||||||
"_cw": {
|
"_cw": {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2421,6 +2421,7 @@ _widgets:
|
||||||
chooseList: "リストを選択"
|
chooseList: "リストを選択"
|
||||||
clicker: "クリッカー"
|
clicker: "クリッカー"
|
||||||
birthdayFollowings: "今日誕生日のユーザー"
|
birthdayFollowings: "今日誕生日のユーザー"
|
||||||
|
chat: "チャット"
|
||||||
|
|
||||||
_cw:
|
_cw:
|
||||||
hide: "隠す"
|
hide: "隠す"
|
||||||
|
|
|
@ -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>
|
|
@ -35,6 +35,7 @@ export default function(app: App) {
|
||||||
app.component('WidgetUserList', defineAsyncComponent(() => import('./WidgetUserList.vue')));
|
app.component('WidgetUserList', defineAsyncComponent(() => import('./WidgetUserList.vue')));
|
||||||
app.component('WidgetClicker', defineAsyncComponent(() => import('./WidgetClicker.vue')));
|
app.component('WidgetClicker', defineAsyncComponent(() => import('./WidgetClicker.vue')));
|
||||||
app.component('WidgetBirthdayFollowings', defineAsyncComponent(() => import('./WidgetBirthdayFollowings.vue')));
|
app.component('WidgetBirthdayFollowings', defineAsyncComponent(() => import('./WidgetBirthdayFollowings.vue')));
|
||||||
|
app.component('WidgetChat', defineAsyncComponent(() => import('./WidgetChat.vue')));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 連合関連のウィジェット(連合無効時に隠す)
|
// 連合関連のウィジェット(連合無効時に隠す)
|
||||||
|
@ -70,6 +71,7 @@ export const widgets = [
|
||||||
'userList',
|
'userList',
|
||||||
'clicker',
|
'clicker',
|
||||||
'birthdayFollowings',
|
'birthdayFollowings',
|
||||||
|
'chat',
|
||||||
|
|
||||||
...federationWidgets,
|
...federationWidgets,
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue