tuikit-atomicx-vue3 4.5.1 → 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/{PopoverPortal-DghpKKm8.js → PopoverPortal-DV6zFXcf.js} +3 -3
- package/dist/{PopoverTrigger-BajjNkGO.js → PopoverTrigger-DIjW4PKa.js} +4 -4
- package/dist/{PopperContent-SLoFuK7k.js → PopperContent-D__dbwpA.js} +1 -1
- package/dist/{Teleport-DFrneqLM.js → Teleport-98QrIYDI.js} +278 -268
- package/dist/baseComp/Modal/Modal.js +3 -3
- package/dist/components/AudioSettingPanel/index.js +14 -14
- package/dist/components/BarrageInput/EmojiPicker/EmojiPicker.js +2 -2
- package/dist/components/BarrageInput/TextEditor/CharacterCountExtension.js +1 -1
- package/dist/components/BarrageInput/TextEditor/EditorCore.js +4 -4
- 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 +18 -18
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTimestamp.js +13 -13
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTitle.js +11 -11
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.js +84 -75
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.vue.d.ts +4 -0
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUnread.js +14 -14
- package/dist/components/ConversationList/i18n/en-US.d.ts +1 -0
- package/dist/components/ConversationList/i18n/en-US.js +2 -1
- package/dist/components/ConversationList/i18n/zh-CN.d.ts +1 -0
- package/dist/components/ConversationList/i18n/zh-CN.js +2 -1
- package/dist/components/ConversationList/index.d.ts +48 -0
- package/dist/components/LiveScenePanel/index.js +9 -10
- package/dist/components/MessageInput/AttachmentPicker/index.js +2 -2
- package/dist/components/MessageInput/EmojiPicker/EmojiPicker.js +2 -2
- package/dist/components/MessageInput/MessageInput.js +1 -1
- package/dist/components/MessageInput/TextEditor/EditorCore.js +1 -1
- package/dist/components/MessageInput/TextEditor/extensions/MentionSuggestion.js +3 -3
- package/dist/components/MessageInput/TextEditor/extensions/characterCountExtension.js +1 -1
- package/dist/components/MessageInput/TextEditor/extensions/emojiExtension.js +1 -1
- package/dist/components/MessageInput/TextEditor/extensions/enterKeyExtension.js +1 -1
- package/dist/components/MessageInput/TextEditor/extensions/imageExtension.js +2 -2
- package/dist/components/MessageInput/TextEditor/extensions/mentionExtension.js +2 -2
- package/dist/components/MessageInput/TextEditor/index.js +1 -1
- package/dist/components/MessageInput/index.js +1 -1
- package/dist/components/MessageList/Message/MessageLayout/MessageActionDropdown/MessageActionDropdown.js +3 -3
- package/dist/components/MessageList/Message/MessageLayout/MessageMeta/MessageMeta.js +37 -28
- package/dist/components/MessageList/MessageList.js +77 -67
- 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/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-CzCDLp99.js → index-DXC5bPY4.js} +32 -32
- package/dist/{index-C8Jw_xE4.js → index-DuAffztD.js} +1731 -1648
- package/dist/{index-CiYL_XsE.js → index-hHVD-MG2.js} +1 -1
- package/dist/index.js +59 -58
- package/dist/states/GroupSettingState/GroupSettingState.js +109 -102
- package/dist/states/LoginState.js +43 -43
- package/dist/states/MessageInputState/MessageInputState.js +75 -78
- 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/subEntry/chat/chat.d.ts +48 -0
- 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-D5WE76CM.js → useId-B1VwPJLm.js} +1 -1
- package/dist/utils/call.js +77 -71
- package/dist/{utils-CttDpxqz.js → utils-BU8IkP_V.js} +1 -1
- package/package.json +5 -6
- 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 +2 -2
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewUI.vue +15 -0
- package/src/components/ConversationList/i18n/en-US.ts +1 -0
- package/src/components/ConversationList/i18n/zh-CN.ts +1 -0
- package/src/components/LiveScenePanel/index.vue +0 -1
- package/src/components/MessageInput/MessageInput.module.scss +1 -0
- package/src/components/MessageList/Message/MessageLayout/MessageMeta/MessageMeta.vue +12 -3
- package/src/components/MessageList/MessageList.vue +14 -0
- 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/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/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/index-BvFYOUyz.js +0 -2936
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ref as d } from "vue";
|
|
2
|
-
import { TUIStore as h, StoreName as
|
|
3
|
-
import { MessageContentType as
|
|
4
|
-
import { convertInputContentToEditorNode as f, trimInputContent as
|
|
2
|
+
import { TUIStore as h, StoreName as w, TUIChatService as r } from "@tencentcloud/chat-uikit-engine";
|
|
3
|
+
import { MessageContentType as c } from "./type.js";
|
|
4
|
+
import { convertInputContentToEditorNode as f, trimInputContent as T } from "./utils.js";
|
|
5
|
+
import "../../components/UIKitModal/chatErrorModal/index.js";
|
|
5
6
|
import { useMessageListState as M } from "../MessageListState/MessageListState.js";
|
|
6
7
|
import { transformTextWithEmojiNameToKey as p } from "../../utils/emoji.js";
|
|
7
|
-
|
|
8
|
+
import { handleChatErrorWithModal as I } from "../../components/UIKitModal/chatErrorModal/chatErrorModal.js";
|
|
9
|
+
const a = d(null), u = d(""), m = d(!1), C = (e) => {
|
|
8
10
|
if (typeof e != "string" && !Array.isArray(e)) {
|
|
9
11
|
console.warn("Invalid input type for updateRawValue");
|
|
10
12
|
return;
|
|
@@ -13,132 +15,127 @@ const s = d(null), u = d(""), g = d(!1), C = (e) => {
|
|
|
13
15
|
r.leaveTypingState();
|
|
14
16
|
}, 3e3);
|
|
15
17
|
}, v = (e) => {
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
if (
|
|
18
|
+
a.value && a.value.destroy(), a.value = e;
|
|
19
|
+
}, E = (e) => {
|
|
20
|
+
if (a.value) {
|
|
19
21
|
if (typeof e == "string")
|
|
20
|
-
|
|
22
|
+
a.value.commands.setContent(e, !0);
|
|
21
23
|
else {
|
|
22
24
|
const n = e.map(f);
|
|
23
|
-
|
|
25
|
+
a.value.commands.setContent(n, !0);
|
|
24
26
|
}
|
|
25
|
-
|
|
27
|
+
a.value.commands.focus();
|
|
26
28
|
}
|
|
27
|
-
},
|
|
28
|
-
if (
|
|
29
|
+
}, x = (e, n = !0) => {
|
|
30
|
+
if (a.value) {
|
|
29
31
|
if (typeof e == "string")
|
|
30
|
-
|
|
32
|
+
a.value.commands.insertContent(e);
|
|
31
33
|
else {
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
+
const s = e.map(f);
|
|
35
|
+
a.value.commands.insertContent(s);
|
|
34
36
|
}
|
|
35
|
-
n &&
|
|
37
|
+
n && a.value.commands.focus();
|
|
36
38
|
}
|
|
37
39
|
}, S = () => {
|
|
38
40
|
var e;
|
|
39
|
-
(e =
|
|
41
|
+
(e = a.value) == null || e.commands.focus();
|
|
40
42
|
}, k = () => {
|
|
41
43
|
var e;
|
|
42
|
-
(e =
|
|
44
|
+
(e = a.value) == null || e.commands.blur();
|
|
43
45
|
}, b = async (e) => {
|
|
44
|
-
const { enableReadReceipt: n } = M(),
|
|
46
|
+
const { enableReadReceipt: n } = M(), s = {
|
|
45
47
|
needReadReceipt: n.value || !1
|
|
46
48
|
}, o = R(e ?? u.value);
|
|
47
|
-
if (o)
|
|
48
|
-
|
|
49
|
-
await r.sendTextMessage({
|
|
49
|
+
if (o)
|
|
50
|
+
try {
|
|
51
|
+
typeof o == "string" ? await r.sendTextMessage({
|
|
50
52
|
payload: { text: p(o) },
|
|
51
|
-
...
|
|
52
|
-
});
|
|
53
|
-
|
|
53
|
+
...s
|
|
54
|
+
}) : await A(o, s);
|
|
55
|
+
} catch (i) {
|
|
56
|
+
throw I(i), i;
|
|
54
57
|
}
|
|
55
|
-
await A(o, a);
|
|
56
|
-
}
|
|
57
58
|
};
|
|
58
59
|
function R(e) {
|
|
59
60
|
if (typeof e == "string")
|
|
60
61
|
return e.trim() || null;
|
|
61
|
-
const n =
|
|
62
|
+
const n = T(e);
|
|
62
63
|
return n.length > 0 ? n : null;
|
|
63
64
|
}
|
|
64
65
|
async function A(e, n) {
|
|
65
|
-
const
|
|
66
|
-
if (
|
|
66
|
+
const s = [], o = [], i = async () => {
|
|
67
|
+
if (s.length === 0)
|
|
67
68
|
return;
|
|
68
|
-
const t =
|
|
69
|
-
|
|
69
|
+
const t = s.join("");
|
|
70
|
+
s.length = 0, o.length > 0 ? (await r.sendTextAtMessage({
|
|
70
71
|
payload: { text: t, atUserList: o },
|
|
71
72
|
...n
|
|
72
73
|
}), o.length = 0) : await r.sendTextMessage({
|
|
73
74
|
payload: { text: p(t) },
|
|
74
75
|
...n
|
|
75
76
|
});
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
break;
|
|
109
|
-
}
|
|
110
|
-
} catch (w) {
|
|
111
|
-
console.error("[MessageInput] Failed to send message item:", t, w);
|
|
77
|
+
}, g = async (t) => {
|
|
78
|
+
switch (t.type) {
|
|
79
|
+
case c.TEXT:
|
|
80
|
+
s.push(t.content);
|
|
81
|
+
break;
|
|
82
|
+
case c.EMOJI:
|
|
83
|
+
s.push(t.content.key);
|
|
84
|
+
break;
|
|
85
|
+
case c.MENTION:
|
|
86
|
+
o.push(t.content.id), s.push(t.content.mentionSuggestionChar + t.content.label);
|
|
87
|
+
break;
|
|
88
|
+
case c.IMAGE:
|
|
89
|
+
await i(), await r.sendImageMessage({
|
|
90
|
+
payload: { file: t.content },
|
|
91
|
+
...n
|
|
92
|
+
});
|
|
93
|
+
break;
|
|
94
|
+
case c.VIDEO:
|
|
95
|
+
await i(), await r.sendVideoMessage({
|
|
96
|
+
payload: { file: t.content },
|
|
97
|
+
...n
|
|
98
|
+
});
|
|
99
|
+
break;
|
|
100
|
+
case c.FILE:
|
|
101
|
+
await i(), await r.sendFileMessage({
|
|
102
|
+
payload: { file: t.content },
|
|
103
|
+
...n
|
|
104
|
+
});
|
|
105
|
+
break;
|
|
106
|
+
default:
|
|
107
|
+
console.warn(`[MessageInput] Unknown message type: ${t == null ? void 0 : t.type}, skipping`);
|
|
108
|
+
break;
|
|
112
109
|
}
|
|
113
110
|
};
|
|
114
111
|
let l = 0;
|
|
115
112
|
const y = e.length;
|
|
116
113
|
for (; l < y; )
|
|
117
|
-
await
|
|
118
|
-
await
|
|
114
|
+
await g(e[l]), l++;
|
|
115
|
+
await i();
|
|
119
116
|
}
|
|
120
|
-
function
|
|
117
|
+
function z() {
|
|
121
118
|
return {
|
|
122
119
|
inputRawValue: u,
|
|
123
|
-
isPeerTyping:
|
|
120
|
+
isPeerTyping: m,
|
|
124
121
|
updateRawValue: C,
|
|
125
122
|
setEditorInstance: v,
|
|
126
|
-
setContent:
|
|
127
|
-
insertContent:
|
|
123
|
+
setContent: E,
|
|
124
|
+
insertContent: x,
|
|
128
125
|
focusEditor: S,
|
|
129
126
|
blurEditor: k,
|
|
130
127
|
sendMessage: b
|
|
131
128
|
};
|
|
132
129
|
}
|
|
133
130
|
function N() {
|
|
134
|
-
h.watch(
|
|
131
|
+
h.watch(w.CHAT, {
|
|
135
132
|
typingStatus: (e) => {
|
|
136
|
-
|
|
133
|
+
m.value = e;
|
|
137
134
|
}
|
|
138
135
|
});
|
|
139
136
|
}
|
|
140
137
|
N();
|
|
141
138
|
export {
|
|
142
|
-
|
|
143
|
-
|
|
139
|
+
c as MessageContentType,
|
|
140
|
+
z as useMessageInputState
|
|
144
141
|
};
|
|
@@ -1,46 +1,49 @@
|
|
|
1
1
|
import { ref as o } from "vue";
|
|
2
|
-
import { TUIStore as
|
|
3
|
-
let
|
|
4
|
-
const d = o(void 0), a = o(void 0), u = o(void 0),
|
|
2
|
+
import { TUIStore as r, StoreName as v, TUIChatService as m } from "@tencentcloud/chat-uikit-engine";
|
|
3
|
+
let f;
|
|
4
|
+
const d = o(void 0), a = o(void 0), u = o(void 0), l = o(void 0), p = o(void 0), c = o(void 0), R = o(/* @__PURE__ */ new Set()), n = o(/* @__PURE__ */ new Set());
|
|
5
5
|
function M() {
|
|
6
|
-
d.value = void 0, a.value = void 0, u.value = void 0,
|
|
6
|
+
d.value = void 0, a.value = void 0, u.value = void 0, l.value = void 0, c.value = void 0, n.value = /* @__PURE__ */ new Set();
|
|
7
7
|
}
|
|
8
8
|
function L(t) {
|
|
9
|
-
|
|
9
|
+
p.value = t;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function D(t) {
|
|
12
12
|
c.value = t;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function w({ messageID: t, duration: i }) {
|
|
15
15
|
n.value.add(t), setTimeout(() => {
|
|
16
16
|
n.value.delete(t);
|
|
17
17
|
}, i);
|
|
18
18
|
}
|
|
19
|
+
async function k() {
|
|
20
|
+
return m.getMessageList();
|
|
21
|
+
}
|
|
19
22
|
function g() {
|
|
20
23
|
return {
|
|
21
24
|
// state
|
|
22
25
|
activeConversationID: d,
|
|
23
26
|
messageList: a,
|
|
24
27
|
hasMoreOlderMessage: u,
|
|
25
|
-
hasMoreNewerMessage:
|
|
26
|
-
enableReadReceipt:
|
|
28
|
+
hasMoreNewerMessage: l,
|
|
29
|
+
enableReadReceipt: p,
|
|
27
30
|
isDisableScroll: c,
|
|
28
|
-
recalledMessageIDSet:
|
|
31
|
+
recalledMessageIDSet: R,
|
|
29
32
|
highlightMessageIDSet: n,
|
|
30
33
|
// actions
|
|
31
|
-
loadMoreOlderMessage:
|
|
34
|
+
loadMoreOlderMessage: k,
|
|
32
35
|
// TODO
|
|
33
36
|
// loadMoreNewerMessage: TUIChatService.getMessageList,
|
|
34
37
|
setEnableReadReceipt: L,
|
|
35
|
-
setIsDisableScroll:
|
|
36
|
-
highlightMessage:
|
|
38
|
+
setIsDisableScroll: D,
|
|
39
|
+
highlightMessage: w
|
|
37
40
|
};
|
|
38
41
|
}
|
|
39
|
-
const
|
|
42
|
+
const y = () => {
|
|
40
43
|
function t(s) {
|
|
41
44
|
if (!d.value)
|
|
42
45
|
return;
|
|
43
|
-
function
|
|
46
|
+
function S(e) {
|
|
44
47
|
return {
|
|
45
48
|
...e,
|
|
46
49
|
// 🎯 re-create frequently changing properties to ensure React can detect changes
|
|
@@ -66,25 +69,25 @@ const k = () => {
|
|
|
66
69
|
replyMessage: () => e.replyMessage()
|
|
67
70
|
};
|
|
68
71
|
}
|
|
69
|
-
const C = s.map(
|
|
72
|
+
const C = s.map(S);
|
|
70
73
|
a.value = C, a.value.forEach((e) => {
|
|
71
|
-
e.isRevoked &&
|
|
74
|
+
e.isRevoked && R.value.add(e.ID);
|
|
72
75
|
});
|
|
73
76
|
}
|
|
74
77
|
function i(s) {
|
|
75
78
|
u.value = !s;
|
|
76
79
|
}
|
|
77
|
-
function
|
|
78
|
-
(!s || s !==
|
|
80
|
+
function I(s) {
|
|
81
|
+
(!s || s !== f) && (M(), d.value = s), f = s || void 0;
|
|
79
82
|
}
|
|
80
|
-
|
|
81
|
-
currentConversationID:
|
|
82
|
-
}),
|
|
83
|
+
r.watch(v.CONV, {
|
|
84
|
+
currentConversationID: I
|
|
85
|
+
}), r.watch(v.CHAT, {
|
|
83
86
|
messageList: t,
|
|
84
87
|
isCompleted: i
|
|
85
88
|
});
|
|
86
89
|
};
|
|
87
|
-
|
|
90
|
+
y();
|
|
88
91
|
export {
|
|
89
92
|
g as useMessageListState
|
|
90
93
|
};
|
|
@@ -2,46 +2,46 @@ import { watch as I } from "vue";
|
|
|
2
2
|
import { useRoomEngine as D } from "../../hooks/useRoomEngine.js";
|
|
3
3
|
import { dataReport as P } from "../../report/dataReport.js";
|
|
4
4
|
import { MetricsKey as g } from "../../report/MetricsKey.js";
|
|
5
|
-
import { eventCenter as
|
|
5
|
+
import { eventCenter as v } from "../../utils/eventCenter.js";
|
|
6
6
|
import { useLoginState as O } from "../LoginState.js";
|
|
7
|
-
import { useRoomState as
|
|
8
|
-
import
|
|
9
|
-
import { participantTransfer as
|
|
7
|
+
import { useRoomState as M } from "../RoomState/index.js";
|
|
8
|
+
import T from "./callEventManager.js";
|
|
9
|
+
import { participantTransfer as R } from "./common.js";
|
|
10
10
|
import A from "./participantEventManager.js";
|
|
11
11
|
import E from "./participantManager.js";
|
|
12
|
-
import
|
|
13
|
-
import { useRoomParticipantStore as
|
|
14
|
-
let
|
|
15
|
-
async function
|
|
12
|
+
import h from "./scheduleEventManager.js";
|
|
13
|
+
import { useRoomParticipantStore as s } from "./store.js";
|
|
14
|
+
let p = null, u = !1;
|
|
15
|
+
async function w() {
|
|
16
16
|
var a, r, c;
|
|
17
|
-
const e = D(), { loginUserInfo: i } = O(), { addParticipantInfo: t } =
|
|
17
|
+
const e = D(), { loginUserInfo: i } = O(), { addParticipantInfo: t } = s();
|
|
18
18
|
if (!((a = i.value) != null && a.userId))
|
|
19
19
|
return;
|
|
20
|
-
const n = await ((c = e.instance) == null ? void 0 : c.getUserInfo({ userId: (r = i.value) == null ? void 0 : r.userId })), o =
|
|
20
|
+
const n = await ((c = e.instance) == null ? void 0 : c.getUserInfo({ userId: (r = i.value) == null ? void 0 : r.userId })), o = R.transformTUIUserInfoToParticipantInfo(n);
|
|
21
21
|
t(o);
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
const { currentRoom: e } =
|
|
23
|
+
function C() {
|
|
24
|
+
if (p || (p = new E(), new A(), new T(), new h()), !u) {
|
|
25
|
+
u = !0;
|
|
26
|
+
const { currentRoom: e } = M(), { reset: i } = s();
|
|
27
27
|
I(() => {
|
|
28
28
|
var t;
|
|
29
29
|
return (t = e.value) == null ? void 0 : t.roomId;
|
|
30
30
|
}, async (t, n) => {
|
|
31
|
-
!n && t && await
|
|
31
|
+
!n && t && await w(), n && !t && i();
|
|
32
32
|
}, { immediate: !0 });
|
|
33
33
|
}
|
|
34
|
-
return
|
|
34
|
+
return p;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
|
|
36
|
+
function d(e, i) {
|
|
37
|
+
v.on(e, i);
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
|
|
39
|
+
function m(e, i) {
|
|
40
|
+
v.off(e, i);
|
|
41
41
|
}
|
|
42
42
|
function Q() {
|
|
43
43
|
P.reportCount(g.T_METRICS_STATE_ROOM_PARTICIPANT_STATE_COUNT);
|
|
44
|
-
const e =
|
|
44
|
+
const e = C(), {
|
|
45
45
|
participantList: i,
|
|
46
46
|
participantListCursor: t,
|
|
47
47
|
participantListWithVideo: n,
|
|
@@ -52,7 +52,7 @@ function Q() {
|
|
|
52
52
|
speakingUsers: l,
|
|
53
53
|
networkQualities: f,
|
|
54
54
|
pendingParticipantList: b
|
|
55
|
-
} =
|
|
55
|
+
} = s();
|
|
56
56
|
return {
|
|
57
57
|
participantList: i,
|
|
58
58
|
participantListCursor: t,
|
|
@@ -83,8 +83,67 @@ function Q() {
|
|
|
83
83
|
cancelOpenDeviceInvitation: e.cancelOpenDeviceInvitation.bind(e),
|
|
84
84
|
acceptOpenDeviceInvitation: e.acceptOpenDeviceInvitation.bind(e),
|
|
85
85
|
declineOpenDeviceInvitation: e.declineOpenDeviceInvitation.bind(e),
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
/**
|
|
87
|
+
* 静音本地麦克风
|
|
88
|
+
* @description 静音本地麦克风, 常用于打开麦克风场景下但不向远端推音频流
|
|
89
|
+
* @example
|
|
90
|
+
* ```typescript
|
|
91
|
+
* // 打开麦克风但不向远端推音频流(常用于会议场景下短暂静音场景)
|
|
92
|
+
* import { useDeviceState } from 'tuikit-atomicx-vue3/room';
|
|
93
|
+
* import { useRoomParticipantState } from 'tuikit-atomicx-vue3/room';
|
|
94
|
+
* const { openLocalMicrophone } = useDeviceState();
|
|
95
|
+
* const { muteMicrophone, unmuteMicrophone } = useRoomParticipantState();
|
|
96
|
+
* await openLocalMicrophone();
|
|
97
|
+
* await muteMicrophone();
|
|
98
|
+
* ```
|
|
99
|
+
* @returns {Promise<void>}
|
|
100
|
+
*/
|
|
101
|
+
muteMicrophone: e.muteMicrophone.bind(e),
|
|
102
|
+
/**
|
|
103
|
+
* 取消静音本地麦克风
|
|
104
|
+
* @description 取消静音本地麦克风,恢复 muteMicrophone 操作导致的音频传输中断。
|
|
105
|
+
* @example
|
|
106
|
+
* ```typescript
|
|
107
|
+
* import { useDeviceState } from 'tuikit-atomicx-vue3/room';
|
|
108
|
+
* import { useRoomParticipantState } from 'tuikit-atomicx-vue3/room';
|
|
109
|
+
* const { openLocalMicrophone } = useDeviceState();
|
|
110
|
+
* const { muteMicrophone, unmuteMicrophone } = useRoomParticipantState();
|
|
111
|
+
* await openLocalMicrophone();
|
|
112
|
+
* await unmuteMicrophone();
|
|
113
|
+
* ```
|
|
114
|
+
* @returns {Promise<void>}
|
|
115
|
+
*/
|
|
116
|
+
unmuteMicrophone: e.unmuteMicrophone.bind(e),
|
|
117
|
+
/**
|
|
118
|
+
* 订阅房间参与者事件
|
|
119
|
+
* @description 订阅房间参与者相关的事件,当事件触发时会调用回调函数
|
|
120
|
+
* @param {RoomParticipantEvent} event - 要订阅的事件名称,可选值包括:
|
|
121
|
+
* - onParticipantJoined: 参与者加入房间
|
|
122
|
+
* - onParticipantLeft: 参与者离开房间
|
|
123
|
+
* - onOwnerChanged: 房间所有者变更
|
|
124
|
+
* - onAdminSet: 用户被设为管理员
|
|
125
|
+
* - onAdminRevoked: 用户管理员权限被撤销
|
|
126
|
+
* - onKickedFromRoom: 被踢出房间
|
|
127
|
+
* - onParticipantDeviceClosed: 设备被关闭
|
|
128
|
+
* - onParticipantMessageMuted: 被禁言/解禁
|
|
129
|
+
* - onAllDevicesDisabled: 全体设备被禁用/启用
|
|
130
|
+
* - onAllMessagesDisabled: 全体消息被禁用/启用
|
|
131
|
+
* - onDeviceRequestReceived: 收到设备开启申请
|
|
132
|
+
* - onDeviceRequestCancelled: 设备开启申请被取消
|
|
133
|
+
* - onDeviceRequestTimeout: 设备开启申请超时
|
|
134
|
+
* - onDeviceRequestApproved: 设备开启申请被批准
|
|
135
|
+
* - onDeviceRequestRejected: 设备开启申请被拒绝
|
|
136
|
+
* - onDeviceRequestProcessed: 设备开启申请已被处理
|
|
137
|
+
* - onDeviceInvitationReceived: 收到设备开启邀请
|
|
138
|
+
* - onDeviceInvitationCancelled: 设备开启邀请被取消
|
|
139
|
+
* - onDeviceInvitationTimeout: 设备开启邀请超时
|
|
140
|
+
* - onDeviceInvitationAccepted: 设备开启邀请被接受
|
|
141
|
+
* - onDeviceInvitationDeclined: 设备开启邀请被拒绝
|
|
142
|
+
* @param {Function} callback - 事件回调函数,参数类型根据事件类型而定
|
|
143
|
+
* @returns {void}
|
|
144
|
+
*/
|
|
145
|
+
subscribeEvent: d.bind(d),
|
|
146
|
+
unsubscribeEvent: m.bind(m)
|
|
88
147
|
};
|
|
89
148
|
}
|
|
90
149
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TUIVideoStreamType, TUIRole, TUIKickedOutOfRoomReason, TUIUserInfo, TUIRequest, TUIChangeReason } from '@tencentcloud/tuiroom-engine-js';
|
|
2
2
|
import { RoomParticipantRole } from '../../types';
|
|
3
3
|
|
|
4
4
|
export default class ParticipantEventManager {
|
|
@@ -54,7 +54,7 @@ export default class ParticipantEventManager {
|
|
|
54
54
|
onRequestReceived({ request }: {
|
|
55
55
|
request: TUIRequest;
|
|
56
56
|
}): void;
|
|
57
|
-
onRequestCancelled({ request
|
|
57
|
+
onRequestCancelled({ request }: {
|
|
58
58
|
request: TUIRequest;
|
|
59
59
|
userInfo: TUIUserInfo;
|
|
60
60
|
}): void;
|