tuikit-atomicx-vue3 4.5.0 → 4.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-jPzZ5INK.js → MessageInput.vue_vue_type_script_setup_true_lang-3RVYOdkv.js} +38 -38
- package/dist/{PopoverTrigger-L8abAry7.js → PopoverPortal-DV6zFXcf.js} +91 -136
- package/dist/PopoverTrigger-DIjW4PKa.js +54 -0
- package/dist/{PopperContent-XdhqL8Y2.js → PopperContent-D__dbwpA.js} +6 -6
- package/dist/{Teleport-CSEuZbpM.js → Teleport-98QrIYDI.js} +280 -270
- package/dist/baseComp/Modal/Modal.js +3 -3
- package/dist/components/AudioSettingPanel/index.js +14 -14
- package/dist/components/BarrageInput/EmojiPicker/EmojiPicker.js +10 -9
- package/dist/components/BarrageInput/TextEditor/CharacterCountExtension.js +1 -1
- package/dist/components/BarrageInput/TextEditor/EditorCore.js +16 -15
- package/dist/components/ConversationList/ConversationActions/ConversationActions.js +53 -50
- package/dist/components/ConversationList/ConversationActions/ConversationActions.vue.d.ts +2 -0
- package/dist/components/ConversationList/ConversationCreate/ConversationCreate.js +25 -25
- package/dist/components/ConversationList/ConversationList.vue.d.ts +16 -0
- package/dist/components/ConversationList/ConversationPreview/ConversationPreview.vue.d.ts +16 -0
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewAbstract.js +62 -40
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTimestamp.js +28 -26
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTitle.js +27 -23
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTitle.vue.d.ts +1 -1
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.js +81 -70
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.vue.d.ts +4 -0
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUnread.js +33 -31
- package/dist/components/ConversationList/ConversationPreview/utils.d.ts +2 -2
- package/dist/components/ConversationList/ConversationPreview/utils.js +81 -35
- package/dist/components/ConversationList/i18n/en-US.d.ts +11 -1
- package/dist/components/ConversationList/i18n/en-US.js +12 -2
- package/dist/components/ConversationList/i18n/zh-CN.d.ts +11 -1
- package/dist/components/ConversationList/i18n/zh-CN.js +12 -2
- package/dist/components/ConversationList/index.d.ts +48 -0
- package/dist/components/MessageInput/AttachmentPicker/index.js +10 -9
- package/dist/components/MessageInput/EmojiPicker/EmojiPicker.js +17 -16
- package/dist/components/MessageInput/MessageInput.js +1 -1
- package/dist/components/MessageInput/QuotedMessagePreview/index.js +35 -35
- package/dist/components/MessageInput/TextEditor/EditorCore.d.ts +13 -12
- package/dist/components/MessageInput/TextEditor/EditorCore.js +54 -89
- package/dist/components/MessageInput/TextEditor/extensions/MentionSuggestion.js +229 -0
- package/dist/components/MessageInput/TextEditor/extensions/MentionSuggestion.vue.d.ts +15 -0
- package/dist/components/MessageInput/TextEditor/extensions/characterCountExtension.js +1 -1
- package/dist/components/MessageInput/TextEditor/extensions/emojiExtension.d.ts +1 -0
- package/dist/components/MessageInput/TextEditor/extensions/emojiExtension.js +22 -0
- package/dist/components/MessageInput/TextEditor/extensions/enterKeyExtension.d.ts +3 -0
- package/dist/components/MessageInput/TextEditor/extensions/enterKeyExtension.js +15 -0
- package/dist/components/MessageInput/TextEditor/extensions/imageExtension.js +2 -2
- package/dist/components/MessageInput/TextEditor/extensions/index.d.ts +8 -0
- package/dist/components/MessageInput/TextEditor/extensions/index.js +12 -0
- package/dist/components/MessageInput/TextEditor/extensions/mentionExtension.d.ts +5 -0
- package/dist/components/MessageInput/TextEditor/extensions/mentionExtension.js +330 -0
- package/dist/components/MessageInput/TextEditor/index.js +62 -62
- package/dist/components/MessageInput/i18n/en-US.d.ts +3 -0
- package/dist/components/MessageInput/i18n/en-US.js +4 -1
- package/dist/components/MessageInput/i18n/index.d.ts +6 -0
- package/dist/components/MessageInput/i18n/zh-CN.d.ts +3 -0
- package/dist/components/MessageInput/i18n/zh-CN.js +4 -1
- package/dist/components/MessageInput/index.js +1 -1
- package/dist/components/MessageList/Message/ImageMessage/ImageMessage.js +119 -89
- package/dist/components/MessageList/Message/ImageMessage/ImagePreview.js +142 -0
- package/dist/components/MessageList/Message/ImageMessage/ImagePreview.vue.d.ts +20 -0
- package/dist/components/MessageList/Message/Message.vue.d.ts +8 -0
- package/dist/components/MessageList/Message/MessageLayout/MessageActionDropdown/MessageActionDropdown.js +3 -3
- package/dist/components/MessageList/Message/MessageLayout/MessageLayout.js +69 -58
- package/dist/components/MessageList/Message/MessageLayout/MessageLayout.vue.d.ts +8 -0
- package/dist/components/MessageList/Message/MessageLayout/MessageMeta/MessageMeta.js +37 -28
- package/dist/components/MessageList/Message/index.js +8 -4
- package/dist/components/MessageList/MessageList.js +109 -91
- package/dist/components/MessageList/MessageList.vue.d.ts +1 -1
- package/dist/components/MessageList/index.d.ts +21 -3
- package/dist/components/ScheduleRoomPanel/RoomDetail.js +22 -22
- package/dist/components/ScheduleRoomPanel/RoomEdit.js +1 -1
- package/dist/components/ScheduleRoomPanel/RoomShare.js +4 -4
- package/dist/components/ScheduleRoomPanel/ScheduleRoomPanel.js +1 -1
- package/dist/components/ScheduleRoomPanel/ScheduledRoomList.js +1 -1
- package/dist/components/Search/SearchResults/SearchResultsItem/Message/Message.js +6 -6
- package/dist/components/Search/SearchResults/SearchResultsItem/Message/Message.vue.d.ts +1 -1
- package/dist/components/UIKitModal/chatErrorModal/chatErrorModal.d.ts +72 -0
- package/dist/components/UIKitModal/chatErrorModal/chatErrorModal.js +95 -0
- package/dist/components/UIKitModal/chatErrorModal/i18n/en-US/index.d.ts +40 -0
- package/dist/components/UIKitModal/chatErrorModal/i18n/en-US/index.js +51 -0
- package/dist/components/UIKitModal/chatErrorModal/i18n/index.d.ts +4 -0
- package/dist/components/UIKitModal/chatErrorModal/i18n/index.js +6 -0
- package/dist/components/UIKitModal/chatErrorModal/i18n/zh-CN/index.d.ts +40 -0
- package/dist/components/UIKitModal/chatErrorModal/i18n/zh-CN/index.js +51 -0
- package/dist/components/UIKitModal/chatErrorModal/index.d.ts +3 -0
- package/dist/components/UIKitModal/chatErrorModal/index.js +11 -0
- package/dist/components/VideoSettingPanel/index.js +1 -1
- package/dist/hooks/useReadReceipt/useReadReceipt.js +44 -41
- package/dist/index-CTthrJb2.js +1461 -0
- package/dist/index-DXC5bPY4.js +2174 -0
- package/dist/{index-Do-2CngU.js → index-DuAffztD.js} +115 -142
- package/dist/{index-7vNB_Vx8.js → index-hHVD-MG2.js} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +150 -149
- package/dist/states/GroupSettingState/GroupSettingState.js +109 -102
- package/dist/states/LoginState.js +43 -43
- package/dist/states/MessageActionState/MessageActionState.js +83 -223
- package/dist/states/MessageInputState/MessageInputState.js +111 -82
- package/dist/states/MessageInputState/type.d.ts +36 -10
- package/dist/states/MessageInputState/utils.d.ts +1 -5
- package/dist/states/MessageListState/MessageListState.d.ts +1 -1
- package/dist/states/MessageListState/MessageListState.js +26 -23
- package/dist/states/RoomParticipantState/index.js +83 -24
- package/dist/states/RoomParticipantState/participantEventManager.d.ts +2 -2
- package/dist/states/RoomParticipantState/participantEventManager.js +217 -205
- package/dist/states/RoomParticipantState/participantManager.d.ts +4 -0
- package/dist/states/RoomParticipantState/participantManager.js +159 -127
- package/dist/states/RoomState/callManager.d.ts +3 -3
- package/dist/states/RoomState/callManager.js +20 -20
- package/dist/states/RoomState/common.d.ts +3 -2
- package/dist/states/RoomState/common.js +34 -24
- package/dist/states/RoomState/roomManager.d.ts +0 -1
- package/dist/states/RoomState/roomManager.js +21 -27
- package/dist/states/RoomState/scheduleManager.js +2 -2
- package/dist/styles/index.css +1 -1
- package/dist/{chat/index.d.ts → subEntry/chat/chat.d.ts} +2160 -2087
- package/dist/subEntry/chat/chat.js +89 -0
- package/dist/subEntry/chat/index.d.ts +11 -0
- package/dist/subEntry/chat/index.js +81 -0
- package/dist/{chat → subEntry/chat}/server.js +4 -4
- package/dist/subEntry/live/index.js +46 -45
- package/dist/subEntry/room/index.js +39 -38
- package/dist/types/beauty.d.ts +20 -0
- package/dist/types/index.js +37 -36
- package/dist/types/participant.d.ts +2 -0
- package/dist/types/room.d.ts +45 -1
- package/dist/types/room.js +4 -3
- package/dist/{useId-CtirfF0W.js → useId-B1VwPJLm.js} +1 -1
- package/dist/utils/call.js +77 -71
- package/dist/{utils-DaB7eSu5.js → utils-BU8IkP_V.js} +1 -1
- package/package.json +8 -7
- package/src/components/AudioSettingPanel/index.vue +4 -5
- package/src/components/ConversationList/ConversationActions/ConversationActions.vue +7 -1
- package/src/components/ConversationList/ConversationCreate/ConversationCreate.vue +5 -1
- package/src/components/ConversationList/ConversationList.vue +0 -1
- package/src/components/ConversationList/ConversationPreview/ConversationPreview.scss +10 -2
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewAbstract.vue +32 -1
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewTitle.vue +3 -2
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewUI.vue +15 -0
- package/src/components/ConversationList/ConversationPreview/utils.ts +98 -28
- package/src/components/ConversationList/i18n/en-US.ts +11 -1
- package/src/components/ConversationList/i18n/zh-CN.ts +11 -1
- package/src/components/MessageInput/MessageInput.module.scss +1 -0
- package/src/components/MessageInput/QuotedMessagePreview/QuotedMessagePreview.vue +19 -22
- package/src/components/MessageInput/TextEditor/Editor.scss +25 -0
- package/src/components/MessageInput/TextEditor/EditorCore.ts +79 -99
- package/src/components/MessageInput/TextEditor/TextEditor.vue +64 -68
- package/src/components/MessageInput/TextEditor/extensions/MentionSuggestion.vue +449 -0
- package/src/components/MessageInput/TextEditor/extensions/emojiExtension.ts +22 -0
- package/src/components/MessageInput/TextEditor/extensions/enterKeyExtension.ts +22 -0
- package/src/components/MessageInput/TextEditor/extensions/index.ts +8 -0
- package/src/components/MessageInput/TextEditor/extensions/mentionExtension.ts +87 -0
- package/src/components/MessageInput/i18n/en-US.ts +3 -0
- package/src/components/MessageInput/i18n/zh-CN.ts +3 -0
- package/src/components/MessageList/Message/ImageMessage/ImageMessage.vue +49 -0
- package/src/components/MessageList/Message/ImageMessage/ImagePreview.vue +344 -0
- package/src/components/MessageList/Message/Message.vue +6 -0
- package/src/components/MessageList/Message/MessageLayout/MessageLayout.vue +8 -1
- package/src/components/MessageList/Message/MessageLayout/MessageMeta/MessageMeta.vue +12 -3
- package/src/components/MessageList/MessageList.vue +50 -14
- package/src/components/ScheduleRoomPanel/RoomDetail.vue +1 -0
- package/src/components/ScheduleRoomPanel/RoomEdit.vue +2 -1
- package/src/components/ScheduleRoomPanel/RoomShare.vue +1 -0
- package/src/components/ScheduleRoomPanel/ScheduleRoomPanel.vue +1 -0
- package/src/components/ScheduleRoomPanel/ScheduledRoomList.vue +1 -0
- package/src/components/Search/SearchResults/SearchResultsItem/Message/Message.vue +30 -31
- package/src/components/UIKitModal/chatErrorModal/chatErrorModal.ts +205 -0
- package/src/components/UIKitModal/chatErrorModal/i18n/en-US/index.ts +56 -0
- package/src/components/UIKitModal/chatErrorModal/i18n/index.ts +4 -0
- package/src/components/UIKitModal/chatErrorModal/i18n/zh-CN/index.ts +56 -0
- package/src/components/UIKitModal/chatErrorModal/index.ts +16 -0
- package/src/components/VideoSettingPanel/index.vue +1 -0
- package/src/hooks/useReadReceipt/useReadReceipt.ts +5 -4
- package/src/index.ts +1 -1
- package/src/{chat/index.ts → subEntry/chat/chat.ts} +25 -18
- package/src/subEntry/chat/index.ts +13 -0
- package/src/{chat → subEntry/chat}/server.ts +3 -3
- package/src/types/beauty.ts +20 -0
- package/src/types/participant.ts +3 -0
- package/src/types/room.ts +49 -1
- package/src/utils/call.ts +8 -0
- package/dist/chat/index.js +0 -59
- package/dist/index-ZILx4LYk.js +0 -4826
- package/dist/states/SearchState.d.ts +0 -314
- /package/dist/{chat → subEntry/chat}/server.d.ts +0 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export const resource = {
|
|
2
|
+
ChatErrorModal: {
|
|
3
|
+
title: '错误',
|
|
4
|
+
|
|
5
|
+
// Login
|
|
6
|
+
login_invalid_sdk_app_id: '缺少正确的 SDKAppID,您可以通过<a target="_blank" href="https://console.cloud.tencent.com/im">即时通信 IM 控制台</a>获取。',
|
|
7
|
+
login_invalid_user_id: '缺少正确的 userID,userID 格式为非空字符串。',
|
|
8
|
+
login_invalid_secret_key: '缺少正确的 secretKey,您可以通过<a target="_blank" href="https://console.cloud.tencent.com/im">即时通信 IM 控制台</a>获取。',
|
|
9
|
+
login_invalid_user_sig: '缺少正确的 userSig,您可以通过<a target="_blank" href="https://console.cloud.tencent.com/im/tool-usersig">即时通信 IM 控制台 > 开发工具 > UserSig生成&校验</a>获取。',
|
|
10
|
+
login_user_sig_expired: 'userSig 已过期,您可以通过<a target="_blank" href="https://console.cloud.tencent.com/im/tool-usersig">即时通信 IM 控制台 > 开发工具 > UserSig生成&校验</a>重新获取。',
|
|
11
|
+
login_user_sig_invalid: 'UserSig 非法,请使用官网提供的 API 重新生成 UserSig(<a target="_blank" href="https://cloud.tencent.com/document/product/269/32688">文档</a>)。',
|
|
12
|
+
login_user_id_not_match_user_sig: '请求中的 UserID 与生成 UserSig 时使用的 UserID 不一致,您可以使用<a target="_blank" href="https://console.cloud.tencent.com/im/tool-usersig">即时通信 IM 控制台 > 开发工具 > UserSig生成&校验</a>校验 UserSig。',
|
|
13
|
+
login_sdk_app_id_not_match_user_sig: '请求中的 SDKAppID 与生成 UserSig 时使用的 SDKAppID 不一致。您可以使用<a target="_blank" href="https://console.cloud.tencent.com/im/tool-usersig">即时通信 IM 控制台 > 开发工具 > UserSig生成&校验</a>校验 UserSig。',
|
|
14
|
+
login_sdk_app_id_not_found: 'SDKAppID 未找到,请在<a target="_blank" href="https://console.cloud.tencent.com/im">即时通信 IM 控制台</a>确认应用信息。',
|
|
15
|
+
|
|
16
|
+
// Package
|
|
17
|
+
package_not_purchased: '您未购买套餐包,或套餐包已过期,或购买的套餐包正在配置中暂未生效。请登录<a target="_blank" href="https://buy.cloud.tencent.com/avc">即时通信 IM 购买页面</a>重新购买套餐包。购买后,将在5分钟后生效。',
|
|
18
|
+
package_group_read_receipt_not_enabled: '您当前购买使用的套餐包暂未开通群消息已读回执功能,您可以升级到套餐为<a target="_blank" href="https://buy.cloud.tencent.com/avc">旗舰版</a>。',
|
|
19
|
+
package_online_user_list_not_enabled: '您当前购买使用的套餐包暂未开通在线用户列表功能,您可以升级到套餐为<a target="_blank" href="https://buy.cloud.tencent.com/avc">旗舰版</a>。',
|
|
20
|
+
package_cloud_search_not_enabled: '您当前购买使用的套餐包暂未开通云端搜索功能,您可以开通<a target="_blank" href="https://cloud.tencent.com/document/product/269/101046">云端搜索</a>。',
|
|
21
|
+
package_text_translation_not_enabled: '您当前购买使用的套餐包暂未开通文本消息翻译功能,您可以开通<a target="_blank" href="https://cloud.tencent.com/document/product/269/92661">文本消息翻译</a>。',
|
|
22
|
+
package_speech_to_text_not_enabled: '您当前购买使用的套餐包暂未开通语音转文字功能,您可以开通<a target="_blank" href="https://cloud.tencent.com/document/product/269/110626">语音转文字</a>。',
|
|
23
|
+
|
|
24
|
+
// Call
|
|
25
|
+
call_kit_not_integrated: '检测到您暂未集成TUICallKit,无法体验音视频通话功能,可以参考:<a target="_blank" href="https://cloud.tencent.com/document/product/269/79861">接入 TUICallKit</a>。',
|
|
26
|
+
|
|
27
|
+
// Search
|
|
28
|
+
search_cloud_rate_limit: '云端搜索请求超过后台频率限制,单用户一秒内允许2次搜索请求,请稍后再试。',
|
|
29
|
+
|
|
30
|
+
// Message
|
|
31
|
+
message_voice_size_exceeded: '语音大小超出了限制,如果上传语音,最大限制是 20MB。',
|
|
32
|
+
message_image_invalid_format: '图片消息发送失败,无效的图片格式,图片格式支持:jpg、jpeg、gif、png、bmp、image、webp。',
|
|
33
|
+
message_image_size_exceeded: '图片大小超出了限制,如果上传文件,最大限制是 20MB。',
|
|
34
|
+
message_image_sensitive_content: '消息中图片存在敏感内容,发送失败。',
|
|
35
|
+
message_video_invalid_format: '视频消息发送失败,无效的视频格式,视频格式支持:mp4、quicktime、mov。',
|
|
36
|
+
message_video_size_exceeded: '视频大小超出了限制,如果上传视频,最大限制是 100MB。',
|
|
37
|
+
message_file_not_exist: '文件不存在,请检查文件路径是否正确。',
|
|
38
|
+
message_file_size_exceeded: '文件大小超出了限制,如果上传文件,最大限制是 100MB。',
|
|
39
|
+
message_file_sending_banned: '文件消息失败,禁止发送违规封禁的文件。',
|
|
40
|
+
message_text_sensitive_content: '消息或者资料中文本存在敏感内容,发送失败。',
|
|
41
|
+
message_length_exceeded: '消息长度超出限制,消息长度不要超过 12K。',
|
|
42
|
+
message_local_audit_blocked: '文本包含本地审核拦截词。',
|
|
43
|
+
message_recall_time_exceeded: '超过撤回时间限制。消息撤回超过了时间限制(默认2分钟)。',
|
|
44
|
+
|
|
45
|
+
// Reaction
|
|
46
|
+
reaction_emoji_limit_reached: '已达到表情回应上限数量。',
|
|
47
|
+
|
|
48
|
+
// Profile
|
|
49
|
+
profile_remark_length_exceeded: '修改备注失败:备注长度不得超过 96 字节。',
|
|
50
|
+
|
|
51
|
+
// Group
|
|
52
|
+
group_announcement_length_exceeded: '群公告字数超出限制,最大长度为 150。',
|
|
53
|
+
group_name_invalid: '群名称仅限中文、字母、数字和下划线,2-20个字。',
|
|
54
|
+
group_id_already_used: '群组 ID 已被使用。请选择其他的群组 ID。',
|
|
55
|
+
},
|
|
56
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { addI18n } from '../../../i18n';
|
|
2
|
+
import {
|
|
3
|
+
ChatErrorModalId,
|
|
4
|
+
showChatErrorModalById,
|
|
5
|
+
handleChatErrorWithModal,
|
|
6
|
+
} from './chatErrorModal';
|
|
7
|
+
import { enResource, zhResource } from './i18n';
|
|
8
|
+
|
|
9
|
+
addI18n('en-US', { translation: enResource });
|
|
10
|
+
addI18n('zh-CN', { translation: zhResource });
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
ChatErrorModalId,
|
|
14
|
+
showChatErrorModalById,
|
|
15
|
+
handleChatErrorWithModal,
|
|
16
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { onMounted, onUnmounted, watch } from 'vue';
|
|
2
2
|
import { TUIChatService, TUIStore } from '@tencentcloud/chat-uikit-engine';
|
|
3
|
+
import { handleChatErrorWithModal } from '../../components/UIKitModal/chatErrorModal';
|
|
3
4
|
import { throttle } from '../../utils/lodash';
|
|
4
5
|
import type { IMessageModel } from '@tencentcloud/chat-uikit-engine';
|
|
5
6
|
|
|
@@ -66,8 +67,8 @@ export function useReadReceipt({
|
|
|
66
67
|
.then(() => {
|
|
67
68
|
// Successfully sent read receipts
|
|
68
69
|
})
|
|
69
|
-
.catch(() => {
|
|
70
|
-
|
|
70
|
+
.catch((error) => {
|
|
71
|
+
handleChatErrorWithModal(error as unknown as any);
|
|
71
72
|
});
|
|
72
73
|
pendingReadReceiptMessages.clear();
|
|
73
74
|
}, delay, { leading: false, trailing: true });
|
|
@@ -99,7 +100,7 @@ export function useReadReceipt({
|
|
|
99
100
|
(entries) => {
|
|
100
101
|
entries.forEach((entry) => {
|
|
101
102
|
if (entry.isIntersecting && entry.intersectionRatio >= intersectionThreshold) {
|
|
102
|
-
const messageID = getMessageIDFromDom(entry.target);
|
|
103
|
+
const messageID = getMessageIDFromDom(entry.target as HTMLElement);
|
|
103
104
|
if (messageID) {
|
|
104
105
|
checkMessageAndSendReadReceipt(messageID);
|
|
105
106
|
}
|
|
@@ -144,7 +145,7 @@ export function useReadReceipt({
|
|
|
144
145
|
if (!container) {
|
|
145
146
|
return;
|
|
146
147
|
}
|
|
147
|
-
const messageElements = container.querySelectorAll(messageSelector);
|
|
148
|
+
const messageElements = container.querySelectorAll(messageSelector) as unknown as HTMLElement[];
|
|
148
149
|
messageElements.forEach((element) => {
|
|
149
150
|
const messageID = getMessageIDFromDom(element);
|
|
150
151
|
if (!messageID) {
|
package/src/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// Chat related exports
|
|
2
|
-
import { View as ViewComponent } from '
|
|
3
|
-
import { ChatSetting as ChatSettingComponent } from '
|
|
1
|
+
// Chat related exports (pure components, no initialization)
|
|
2
|
+
import { View as ViewComponent } from '../../baseComp/View';
|
|
3
|
+
import { ChatSetting as ChatSettingComponent } from '../../components/ChatSetting';
|
|
4
4
|
import {
|
|
5
5
|
ContactList as ContactListComponent,
|
|
6
6
|
ContactListItem as ContactListItemComponent,
|
|
7
7
|
ContactInfo as ContactInfoComponent,
|
|
8
|
-
} from '
|
|
8
|
+
} from '../../components/ContactList';
|
|
9
9
|
import {
|
|
10
10
|
ConversationList as ConversationListComponent,
|
|
11
11
|
ConversationActions as ConversationActionsComponent,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
ConversationPreview as ConversationPreviewComponent,
|
|
15
15
|
ConversationPreviewUI as ConversationPreviewUIComponent,
|
|
16
16
|
ConversationSearch as ConversationSearchComponent,
|
|
17
|
-
} from '
|
|
17
|
+
} from '../../components/ConversationList';
|
|
18
18
|
import {
|
|
19
19
|
MessageInput as MessageInputComponent,
|
|
20
20
|
EmojiPicker as EmojiPickerComponent,
|
|
@@ -24,11 +24,11 @@ import {
|
|
|
24
24
|
VideoPicker as VideoPickerComponent,
|
|
25
25
|
AudioCallPicker as AudioCallPickerComponent,
|
|
26
26
|
VideoCallPicker as VideoCallPickerComponent,
|
|
27
|
-
} from '
|
|
27
|
+
} from '../../components/MessageInput';
|
|
28
28
|
import {
|
|
29
29
|
MessageList as MessageListComponent,
|
|
30
30
|
Message as MessageComponent,
|
|
31
|
-
} from '
|
|
31
|
+
} from '../../components/MessageList';
|
|
32
32
|
import {
|
|
33
33
|
Search as SearchComponent,
|
|
34
34
|
SearchAdvanced as SearchAdvancedComponent,
|
|
@@ -37,17 +37,16 @@ import {
|
|
|
37
37
|
SearchResultItem as SearchResultItemComponent,
|
|
38
38
|
SearchBar as SearchBarComponent,
|
|
39
39
|
SearchResults as SearchResultsComponent,
|
|
40
|
-
} from '
|
|
41
|
-
import { useMessageActions as useMessageActionsHook } from '
|
|
42
|
-
import { useConversationListState as conversationListState } from '
|
|
43
|
-
import { useMessageActionState as messageActionState } from '
|
|
44
|
-
import { useMessageInputState as messageInputState } from '
|
|
45
|
-
import { useMessageListState as messageListState } from '
|
|
46
|
-
import { useSearchState as searchState } from '
|
|
47
|
-
import { useContactListState as contactListState } from
|
|
48
|
-
import { useC2CSettingState as c2cSettingState } from '
|
|
49
|
-
import { useGroupSettingState as groupSettingState } from '
|
|
50
|
-
|
|
40
|
+
} from '../../components/Search';
|
|
41
|
+
import { useMessageActions as useMessageActionsHook } from '../../hooks/useMessageActions';
|
|
42
|
+
import { useConversationListState as conversationListState } from '../../states/ConversationListState';
|
|
43
|
+
import { useMessageActionState as messageActionState } from '../../states/MessageActionState';
|
|
44
|
+
import { useMessageInputState as messageInputState } from '../../states/MessageInputState';
|
|
45
|
+
import { useMessageListState as messageListState } from '../../states/MessageListState';
|
|
46
|
+
import { useSearchState as searchState } from '../../states/SearchState';
|
|
47
|
+
import { useContactListState as contactListState } from '../../states/ContactListState';
|
|
48
|
+
import { useC2CSettingState as c2cSettingState } from '../../states/C2CSettingState';
|
|
49
|
+
import { useGroupSettingState as groupSettingState } from '../../states/GroupSettingState';
|
|
51
50
|
import ChatLoginServer from './server';
|
|
52
51
|
|
|
53
52
|
ChatLoginServer.getInstance().init();
|
|
@@ -142,3 +141,11 @@ export {
|
|
|
142
141
|
useC2CSettingState,
|
|
143
142
|
useGroupSettingState,
|
|
144
143
|
};
|
|
144
|
+
|
|
145
|
+
export * from '../../types/message';
|
|
146
|
+
export * from '../../types/search';
|
|
147
|
+
export * from '../../types/engine';
|
|
148
|
+
export * from '../../types/conversation';
|
|
149
|
+
export * from '../../types/contact';
|
|
150
|
+
export * from '../../types/call';
|
|
151
|
+
export * from '../../types/chatSetting';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { useLoginState } from '../../states/LoginState';
|
|
2
|
+
export * from '../../components/Avatar';
|
|
3
|
+
export * from '../../components/UserPicker';
|
|
4
|
+
export * from './chat';
|
|
5
|
+
|
|
6
|
+
// types
|
|
7
|
+
export * from '../../types/message';
|
|
8
|
+
export * from '../../types/search';
|
|
9
|
+
export * from '../../types/engine';
|
|
10
|
+
export * from '../../types/conversation';
|
|
11
|
+
export * from '../../types/contact';
|
|
12
|
+
export * from '../../types/call';
|
|
13
|
+
export * from '../../types/chatSetting';
|
|
@@ -2,9 +2,9 @@ import type { Ref } from 'vue';
|
|
|
2
2
|
import { ref } from 'vue';
|
|
3
3
|
import TUIChatEngine from '@tencentcloud/chat-uikit-engine';
|
|
4
4
|
import TUICore, { TUILogin, TUIConstants } from '@tencentcloud/tui-core';
|
|
5
|
-
import { useLoginState } from '
|
|
6
|
-
import { ChatSceneType, useStatistical } from '
|
|
7
|
-
import { isPC } from '
|
|
5
|
+
import { useLoginState } from '../../states/LoginState';
|
|
6
|
+
import { ChatSceneType, useStatistical } from '../../statistical';
|
|
7
|
+
import { isPC } from '../../utils';
|
|
8
8
|
|
|
9
9
|
const { setChatScene } = useStatistical();
|
|
10
10
|
|
package/src/types/beauty.ts
CHANGED
|
@@ -1,9 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module FreeBeautyConfigType
|
|
3
|
+
* @description 基础美颜配置
|
|
4
|
+
*
|
|
5
|
+
* 提供自由美颜相关的配置选项。
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* import { FreeBeautyConfig } from '@tuikit-atomicx-vue3';
|
|
9
|
+
*
|
|
10
|
+
* const config: FreeBeautyConfig = {
|
|
11
|
+
* beautyLevel: 0.5,
|
|
12
|
+
* whitenessLevel: 0.5,
|
|
13
|
+
* ruddinessLevel: 0.5,
|
|
14
|
+
* };
|
|
15
|
+
*/
|
|
1
16
|
export type FreeBeautyConfig = {
|
|
2
17
|
beautyLevel: number;
|
|
3
18
|
whitenessLevel: number;
|
|
4
19
|
ruddinessLevel: number;
|
|
5
20
|
};
|
|
6
21
|
|
|
22
|
+
/**
|
|
23
|
+
* 美颜风格
|
|
24
|
+
* @enum {number}
|
|
25
|
+
* @description 表示美颜风格。
|
|
26
|
+
*/
|
|
7
27
|
export enum TRTCBeautyStyle {
|
|
8
28
|
TRTCBeautyStyleSmooth = 0,
|
|
9
29
|
TRTCBeautyStyleNature = 1,
|
package/src/types/participant.ts
CHANGED
|
@@ -102,6 +102,9 @@ export interface IRoomParticipantState {
|
|
|
102
102
|
acceptOpenDeviceInvitation(options: { userId: string; device: DeviceType }): Promise<void>;
|
|
103
103
|
declineOpenDeviceInvitation(options: { userId: string; device: DeviceType }): Promise<void>;
|
|
104
104
|
|
|
105
|
+
muteMicrophone(): Promise<void>;
|
|
106
|
+
unmuteMicrophone(): Promise<void>;
|
|
107
|
+
|
|
105
108
|
subscribeEvent(event: RoomParticipantEvent, callback: RoomParticipantEventPayloads[keyof RoomParticipantEventPayloads]): void;
|
|
106
109
|
unsubscribeEvent(event: RoomParticipantEvent, callback: RoomParticipantEventPayloads[keyof RoomParticipantEventPayloads]): void;
|
|
107
110
|
}
|
package/src/types/room.ts
CHANGED
|
@@ -69,6 +69,23 @@ export enum RoomCallResult {
|
|
|
69
69
|
AlreadyInRoom = 2,
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
/**
|
|
73
|
+
* 呼叫拒绝原因枚举
|
|
74
|
+
* @enum {number}
|
|
75
|
+
* @description 表示呼叫被拒绝的原因。
|
|
76
|
+
*
|
|
77
|
+
*/
|
|
78
|
+
export enum CallRejectReason {
|
|
79
|
+
/**
|
|
80
|
+
* 用户拒绝呼叫
|
|
81
|
+
*/
|
|
82
|
+
Rejected = 0,
|
|
83
|
+
/**
|
|
84
|
+
* 用户已在其他房间中
|
|
85
|
+
*/
|
|
86
|
+
InOtherRoom = 1,
|
|
87
|
+
}
|
|
88
|
+
|
|
72
89
|
export interface RoomCall {
|
|
73
90
|
caller: RoomUser;
|
|
74
91
|
callee: RoomUser;
|
|
@@ -116,6 +133,22 @@ export enum RoomEvent {
|
|
|
116
133
|
onCallCancelled = 'onCallCancelled',
|
|
117
134
|
onCallTimeout = 'onCallTimeout',
|
|
118
135
|
onCallAccepted = 'onCallAccepted',
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* 当您发出的呼叫被被叫方拒绝时触发。
|
|
139
|
+
* @event
|
|
140
|
+
* @param {object} options - 事件参数对象
|
|
141
|
+
* @param {RoomInfo} options.roomInfo - 房间信息
|
|
142
|
+
* @param {RoomCall} options.call - 呼叫信息
|
|
143
|
+
* @param {string} options.extensionInfo - 被叫方拒绝的原因或附加信息
|
|
144
|
+
* @example
|
|
145
|
+
* import { useRoomState, RoomEvent } from 'tuikit-atomicx-vue3';
|
|
146
|
+
*
|
|
147
|
+
* const roomState = useRoomState();
|
|
148
|
+
* roomState.subscribeEvent(RoomEvent.onCallRejected, ({ roomInfo, call, reason }) => {
|
|
149
|
+
* console.log(`${call.callee.userName} 拒绝了您的呼叫: ${reason}`);
|
|
150
|
+
* });
|
|
151
|
+
*/
|
|
119
152
|
onCallRejected = 'onCallRejected',
|
|
120
153
|
onCallHandledByOtherDevice = 'onCallHandledByOtherDevice',
|
|
121
154
|
onCallRevokedByAdmin = 'onCallRevokedByAdmin',
|
|
@@ -132,7 +165,22 @@ export interface RoomEventHandlers {
|
|
|
132
165
|
onCallCancelled: (options: { roomInfo: RoomInfo; call: RoomCall }) => void;
|
|
133
166
|
onCallTimeout: (options: { roomInfo: RoomInfo; call: RoomCall }) => void;
|
|
134
167
|
onCallAccepted: (options: { roomInfo: RoomInfo; call: RoomCall }) => void;
|
|
135
|
-
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* onCallRejected 事件处理函数
|
|
171
|
+
* @param options - 事件数据
|
|
172
|
+
* @param options.roomInfo - 房间信息
|
|
173
|
+
* @param options.call - 呼叫信息
|
|
174
|
+
* @param options.reason - 被叫方拒绝原因
|
|
175
|
+
*/
|
|
176
|
+
onCallRejected: (options: { roomInfo: RoomInfo; call: RoomCall; reason: CallRejectReason }) => void;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* onCallHandledByOtherDevice 事件处理函数
|
|
180
|
+
* @param options - 事件数据
|
|
181
|
+
* @param options.roomInfo - 房间信息
|
|
182
|
+
* @param options.isAccepted - 呼叫是否在其他设备上被接受
|
|
183
|
+
*/
|
|
136
184
|
onCallHandledByOtherDevice: (options: { roomInfo: RoomInfo; isAccepted: boolean }) => void;
|
|
137
185
|
onCallRevokedByAdmin: (options: { roomInfo: RoomInfo; call: RoomCall; operator: RoomUser }) => void;
|
|
138
186
|
}
|
package/src/utils/call.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TUIFriendService, TUIUserService, TUIChatEngine } from '@tencentcloud/chat-uikit-engine';
|
|
2
2
|
import TUICore, { TUIConstants } from '@tencentcloud/tui-core';
|
|
3
3
|
import { safeJSONParse } from './json';
|
|
4
|
+
import { showChatErrorModalById, ChatErrorModalId } from '../components/UIKitModal/chatErrorModal';
|
|
4
5
|
import type { StartCallParams, CallMessagePayload } from '../types/call';
|
|
5
6
|
import type { MessageModel } from '../types/engine';
|
|
6
7
|
|
|
@@ -20,6 +21,13 @@ function isCallMessage(message: MessageModel) {
|
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
function startCall(params: StartCallParams) {
|
|
24
|
+
const result = TUICore.getService(TUIConstants.TUICalling.SERVICE.NAME);
|
|
25
|
+
|
|
26
|
+
if (!result) {
|
|
27
|
+
showChatErrorModalById(ChatErrorModalId.CALL_KIT_NOT_INTEGRATED);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
23
31
|
TUICore.callService({
|
|
24
32
|
serviceName: TUIConstants.TUICalling.SERVICE.NAME,
|
|
25
33
|
method: TUIConstants.TUICalling.SERVICE.METHOD.START_CALL,
|
package/dist/chat/index.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { View as t } from "../baseComp/View/index.js";
|
|
2
|
-
import { ChatSetting as e } from "../components/ChatSetting/index.js";
|
|
3
|
-
import { ContactList as s, ContactListItem as a, ContactInfo as o } from "../components/ContactList/index.js";
|
|
4
|
-
import { ConversationList as n, ConversationActions as i, ConversationListHeader as r, ConversationListContent as c, ConversationPreview as C, ConversationPreviewUI as S, ConversationSearch as m } from "../components/ConversationList/index.js";
|
|
5
|
-
import { MessageInput as u, EmojiPicker as v, AttachmentPicker as g, FilePicker as $, ImagePicker as d, VideoPicker as h, AudioCallPicker as L, VideoCallPicker as p } from "../components/MessageInput/index.js";
|
|
6
|
-
import { MessageList as P, Message as A } from "../components/MessageList/index.js";
|
|
7
|
-
import { Search as M, SearchAdvanced as I, UserAdvanced as f, MessageAdvanced as k, SearchResults as l, SearchResultItem as w, SearchBar as V } from "../components/Search/index.js";
|
|
8
|
-
import { useMessageActions as R } from "../hooks/useMessageActions.js";
|
|
9
|
-
import { useSearchState as U } from "../states/SearchState.js";
|
|
10
|
-
import j from "./server.js";
|
|
11
|
-
import { useContactListState as B } from "../states/ContactListState/ContactListState.js";
|
|
12
|
-
import { useC2CSettingState as E } from "../states/C2CSettingState/C2CSettingState.js";
|
|
13
|
-
import { useGroupSettingState as F } from "../states/GroupSettingState/GroupSettingState.js";
|
|
14
|
-
import { useMessageListState as G } from "../states/MessageListState/MessageListState.js";
|
|
15
|
-
import { useMessageInputState as H } from "../states/MessageInputState/MessageInputState.js";
|
|
16
|
-
import { useMessageActionState as _ } from "../states/MessageActionState/MessageActionState.js";
|
|
17
|
-
import { useConversationListState as x } from "../states/ConversationListState/ConversationListState.js";
|
|
18
|
-
j.getInstance().init();
|
|
19
|
-
const st = M, at = I, ot = k, nt = f, it = V, rt = l, ct = w, Ct = n, St = i, mt = r, ut = c, vt = C, gt = S, $t = m, dt = s, ht = a, Lt = o, pt = P, Pt = A, At = u, Mt = v, It = g, ft = $, kt = d, lt = h, wt = L, Vt = p, Rt = e, Ut = t, jt = R, Bt = x, Et = _, Ft = H, Gt = G, Ht = U, _t = B, xt = E, bt = F;
|
|
20
|
-
export {
|
|
21
|
-
It as AttachmentPicker,
|
|
22
|
-
wt as AudioCallPicker,
|
|
23
|
-
Rt as ChatSetting,
|
|
24
|
-
Lt as ContactInfo,
|
|
25
|
-
dt as ContactList,
|
|
26
|
-
ht as ContactListItem,
|
|
27
|
-
St as ConversationActions,
|
|
28
|
-
Ct as ConversationList,
|
|
29
|
-
ut as ConversationListContent,
|
|
30
|
-
mt as ConversationListHeader,
|
|
31
|
-
vt as ConversationPreview,
|
|
32
|
-
gt as ConversationPreviewUI,
|
|
33
|
-
$t as ConversationSearch,
|
|
34
|
-
Mt as EmojiPicker,
|
|
35
|
-
ft as FilePicker,
|
|
36
|
-
kt as ImagePicker,
|
|
37
|
-
Pt as Message,
|
|
38
|
-
ot as MessageAdvanced,
|
|
39
|
-
At as MessageInput,
|
|
40
|
-
pt as MessageList,
|
|
41
|
-
st as Search,
|
|
42
|
-
at as SearchAdvanced,
|
|
43
|
-
it as SearchBar,
|
|
44
|
-
ct as SearchResultItem,
|
|
45
|
-
rt as SearchResults,
|
|
46
|
-
nt as UserAdvanced,
|
|
47
|
-
Vt as VideoCallPicker,
|
|
48
|
-
lt as VideoPicker,
|
|
49
|
-
Ut as View,
|
|
50
|
-
xt as useC2CSettingState,
|
|
51
|
-
_t as useContactListState,
|
|
52
|
-
Bt as useConversationListState,
|
|
53
|
-
bt as useGroupSettingState,
|
|
54
|
-
Et as useMessageActionState,
|
|
55
|
-
jt as useMessageActions,
|
|
56
|
-
Ft as useMessageInputState,
|
|
57
|
-
Gt as useMessageListState,
|
|
58
|
-
Ht as useSearchState
|
|
59
|
-
};
|