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.
Files changed (122) hide show
  1. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-jPzZ5INK.js → MessageInput.vue_vue_type_script_setup_true_lang-3RVYOdkv.js} +38 -38
  2. package/dist/{PopoverPortal-DghpKKm8.js → PopoverPortal-DV6zFXcf.js} +3 -3
  3. package/dist/{PopoverTrigger-BajjNkGO.js → PopoverTrigger-DIjW4PKa.js} +4 -4
  4. package/dist/{PopperContent-SLoFuK7k.js → PopperContent-D__dbwpA.js} +1 -1
  5. package/dist/{Teleport-DFrneqLM.js → Teleport-98QrIYDI.js} +278 -268
  6. package/dist/baseComp/Modal/Modal.js +3 -3
  7. package/dist/components/AudioSettingPanel/index.js +14 -14
  8. package/dist/components/BarrageInput/EmojiPicker/EmojiPicker.js +2 -2
  9. package/dist/components/BarrageInput/TextEditor/CharacterCountExtension.js +1 -1
  10. package/dist/components/BarrageInput/TextEditor/EditorCore.js +4 -4
  11. package/dist/components/ConversationList/ConversationActions/ConversationActions.js +53 -50
  12. package/dist/components/ConversationList/ConversationActions/ConversationActions.vue.d.ts +2 -0
  13. package/dist/components/ConversationList/ConversationCreate/ConversationCreate.js +25 -25
  14. package/dist/components/ConversationList/ConversationList.vue.d.ts +16 -0
  15. package/dist/components/ConversationList/ConversationPreview/ConversationPreview.vue.d.ts +16 -0
  16. package/dist/components/ConversationList/ConversationPreview/ConversationPreviewAbstract.js +18 -18
  17. package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTimestamp.js +13 -13
  18. package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTitle.js +11 -11
  19. package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.js +84 -75
  20. package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.vue.d.ts +4 -0
  21. package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUnread.js +14 -14
  22. package/dist/components/ConversationList/i18n/en-US.d.ts +1 -0
  23. package/dist/components/ConversationList/i18n/en-US.js +2 -1
  24. package/dist/components/ConversationList/i18n/zh-CN.d.ts +1 -0
  25. package/dist/components/ConversationList/i18n/zh-CN.js +2 -1
  26. package/dist/components/ConversationList/index.d.ts +48 -0
  27. package/dist/components/LiveScenePanel/index.js +9 -10
  28. package/dist/components/MessageInput/AttachmentPicker/index.js +2 -2
  29. package/dist/components/MessageInput/EmojiPicker/EmojiPicker.js +2 -2
  30. package/dist/components/MessageInput/MessageInput.js +1 -1
  31. package/dist/components/MessageInput/TextEditor/EditorCore.js +1 -1
  32. package/dist/components/MessageInput/TextEditor/extensions/MentionSuggestion.js +3 -3
  33. package/dist/components/MessageInput/TextEditor/extensions/characterCountExtension.js +1 -1
  34. package/dist/components/MessageInput/TextEditor/extensions/emojiExtension.js +1 -1
  35. package/dist/components/MessageInput/TextEditor/extensions/enterKeyExtension.js +1 -1
  36. package/dist/components/MessageInput/TextEditor/extensions/imageExtension.js +2 -2
  37. package/dist/components/MessageInput/TextEditor/extensions/mentionExtension.js +2 -2
  38. package/dist/components/MessageInput/TextEditor/index.js +1 -1
  39. package/dist/components/MessageInput/index.js +1 -1
  40. package/dist/components/MessageList/Message/MessageLayout/MessageActionDropdown/MessageActionDropdown.js +3 -3
  41. package/dist/components/MessageList/Message/MessageLayout/MessageMeta/MessageMeta.js +37 -28
  42. package/dist/components/MessageList/MessageList.js +77 -67
  43. package/dist/components/ScheduleRoomPanel/RoomDetail.js +22 -22
  44. package/dist/components/ScheduleRoomPanel/RoomEdit.js +1 -1
  45. package/dist/components/ScheduleRoomPanel/RoomShare.js +4 -4
  46. package/dist/components/ScheduleRoomPanel/ScheduleRoomPanel.js +1 -1
  47. package/dist/components/ScheduleRoomPanel/ScheduledRoomList.js +1 -1
  48. package/dist/components/UIKitModal/chatErrorModal/chatErrorModal.d.ts +72 -0
  49. package/dist/components/UIKitModal/chatErrorModal/chatErrorModal.js +95 -0
  50. package/dist/components/UIKitModal/chatErrorModal/i18n/en-US/index.d.ts +40 -0
  51. package/dist/components/UIKitModal/chatErrorModal/i18n/en-US/index.js +51 -0
  52. package/dist/components/UIKitModal/chatErrorModal/i18n/index.d.ts +4 -0
  53. package/dist/components/UIKitModal/chatErrorModal/i18n/index.js +6 -0
  54. package/dist/components/UIKitModal/chatErrorModal/i18n/zh-CN/index.d.ts +40 -0
  55. package/dist/components/UIKitModal/chatErrorModal/i18n/zh-CN/index.js +51 -0
  56. package/dist/components/UIKitModal/chatErrorModal/index.d.ts +3 -0
  57. package/dist/components/UIKitModal/chatErrorModal/index.js +11 -0
  58. package/dist/components/VideoSettingPanel/index.js +1 -1
  59. package/dist/hooks/useReadReceipt/useReadReceipt.js +44 -41
  60. package/dist/index-CTthrJb2.js +1461 -0
  61. package/dist/{index-CzCDLp99.js → index-DXC5bPY4.js} +32 -32
  62. package/dist/{index-C8Jw_xE4.js → index-DuAffztD.js} +1731 -1648
  63. package/dist/{index-CiYL_XsE.js → index-hHVD-MG2.js} +1 -1
  64. package/dist/index.js +59 -58
  65. package/dist/states/GroupSettingState/GroupSettingState.js +109 -102
  66. package/dist/states/LoginState.js +43 -43
  67. package/dist/states/MessageInputState/MessageInputState.js +75 -78
  68. package/dist/states/MessageListState/MessageListState.js +26 -23
  69. package/dist/states/RoomParticipantState/index.js +83 -24
  70. package/dist/states/RoomParticipantState/participantEventManager.d.ts +2 -2
  71. package/dist/states/RoomParticipantState/participantEventManager.js +217 -205
  72. package/dist/states/RoomParticipantState/participantManager.d.ts +4 -0
  73. package/dist/states/RoomParticipantState/participantManager.js +159 -127
  74. package/dist/states/RoomState/callManager.d.ts +3 -3
  75. package/dist/states/RoomState/callManager.js +20 -20
  76. package/dist/states/RoomState/common.d.ts +3 -2
  77. package/dist/states/RoomState/common.js +34 -24
  78. package/dist/states/RoomState/roomManager.d.ts +0 -1
  79. package/dist/states/RoomState/roomManager.js +21 -27
  80. package/dist/states/RoomState/scheduleManager.js +2 -2
  81. package/dist/styles/index.css +1 -1
  82. package/dist/subEntry/chat/chat.d.ts +48 -0
  83. package/dist/subEntry/live/index.js +46 -45
  84. package/dist/subEntry/room/index.js +39 -38
  85. package/dist/types/beauty.d.ts +20 -0
  86. package/dist/types/index.js +37 -36
  87. package/dist/types/participant.d.ts +2 -0
  88. package/dist/types/room.d.ts +45 -1
  89. package/dist/types/room.js +4 -3
  90. package/dist/{useId-D5WE76CM.js → useId-B1VwPJLm.js} +1 -1
  91. package/dist/utils/call.js +77 -71
  92. package/dist/{utils-CttDpxqz.js → utils-BU8IkP_V.js} +1 -1
  93. package/package.json +5 -6
  94. package/src/components/AudioSettingPanel/index.vue +4 -5
  95. package/src/components/ConversationList/ConversationActions/ConversationActions.vue +7 -1
  96. package/src/components/ConversationList/ConversationCreate/ConversationCreate.vue +5 -1
  97. package/src/components/ConversationList/ConversationList.vue +0 -1
  98. package/src/components/ConversationList/ConversationPreview/ConversationPreview.scss +2 -2
  99. package/src/components/ConversationList/ConversationPreview/ConversationPreviewUI.vue +15 -0
  100. package/src/components/ConversationList/i18n/en-US.ts +1 -0
  101. package/src/components/ConversationList/i18n/zh-CN.ts +1 -0
  102. package/src/components/LiveScenePanel/index.vue +0 -1
  103. package/src/components/MessageInput/MessageInput.module.scss +1 -0
  104. package/src/components/MessageList/Message/MessageLayout/MessageMeta/MessageMeta.vue +12 -3
  105. package/src/components/MessageList/MessageList.vue +14 -0
  106. package/src/components/ScheduleRoomPanel/RoomDetail.vue +1 -0
  107. package/src/components/ScheduleRoomPanel/RoomEdit.vue +2 -1
  108. package/src/components/ScheduleRoomPanel/RoomShare.vue +1 -0
  109. package/src/components/ScheduleRoomPanel/ScheduleRoomPanel.vue +1 -0
  110. package/src/components/ScheduleRoomPanel/ScheduledRoomList.vue +1 -0
  111. package/src/components/UIKitModal/chatErrorModal/chatErrorModal.ts +205 -0
  112. package/src/components/UIKitModal/chatErrorModal/i18n/en-US/index.ts +56 -0
  113. package/src/components/UIKitModal/chatErrorModal/i18n/index.ts +4 -0
  114. package/src/components/UIKitModal/chatErrorModal/i18n/zh-CN/index.ts +56 -0
  115. package/src/components/UIKitModal/chatErrorModal/index.ts +16 -0
  116. package/src/components/VideoSettingPanel/index.vue +1 -0
  117. package/src/hooks/useReadReceipt/useReadReceipt.ts +5 -4
  118. package/src/types/beauty.ts +20 -0
  119. package/src/types/participant.ts +3 -0
  120. package/src/types/room.ts +49 -1
  121. package/src/utils/call.ts +8 -0
  122. 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 T, TUIChatService as r } from "@tencentcloud/chat-uikit-engine";
3
- import { MessageContentType as i } from "./type.js";
4
- import { convertInputContentToEditorNode as f, trimInputContent as I } from "./utils.js";
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
- const s = d(null), u = d(""), g = d(!1), C = (e) => {
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
- s.value && s.value.destroy(), s.value = e;
17
- }, x = (e) => {
18
- if (s.value) {
18
+ a.value && a.value.destroy(), a.value = e;
19
+ }, E = (e) => {
20
+ if (a.value) {
19
21
  if (typeof e == "string")
20
- s.value.commands.setContent(e, !0);
22
+ a.value.commands.setContent(e, !0);
21
23
  else {
22
24
  const n = e.map(f);
23
- s.value.commands.setContent(n, !0);
25
+ a.value.commands.setContent(n, !0);
24
26
  }
25
- s.value.commands.focus();
27
+ a.value.commands.focus();
26
28
  }
27
- }, E = (e, n = !0) => {
28
- if (s.value) {
29
+ }, x = (e, n = !0) => {
30
+ if (a.value) {
29
31
  if (typeof e == "string")
30
- s.value.commands.insertContent(e);
32
+ a.value.commands.insertContent(e);
31
33
  else {
32
- const a = e.map(f);
33
- s.value.commands.insertContent(a);
34
+ const s = e.map(f);
35
+ a.value.commands.insertContent(s);
34
36
  }
35
- n && s.value.commands.focus();
37
+ n && a.value.commands.focus();
36
38
  }
37
39
  }, S = () => {
38
40
  var e;
39
- (e = s.value) == null || e.commands.focus();
41
+ (e = a.value) == null || e.commands.focus();
40
42
  }, k = () => {
41
43
  var e;
42
- (e = s.value) == null || e.commands.blur();
44
+ (e = a.value) == null || e.commands.blur();
43
45
  }, b = async (e) => {
44
- const { enableReadReceipt: n } = M(), a = {
46
+ const { enableReadReceipt: n } = M(), s = {
45
47
  needReadReceipt: n.value || !1
46
48
  }, o = R(e ?? u.value);
47
- if (o) {
48
- if (typeof o == "string") {
49
- await r.sendTextMessage({
49
+ if (o)
50
+ try {
51
+ typeof o == "string" ? await r.sendTextMessage({
50
52
  payload: { text: p(o) },
51
- ...a
52
- });
53
- return;
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 = I(e);
62
+ const n = T(e);
62
63
  return n.length > 0 ? n : null;
63
64
  }
64
65
  async function A(e, n) {
65
- const a = [], o = [], c = async () => {
66
- if (a.length === 0)
66
+ const s = [], o = [], i = async () => {
67
+ if (s.length === 0)
67
68
  return;
68
- const t = a.join("");
69
- a.length = 0, o.length > 0 ? (await r.sendTextAtMessage({
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
- }, m = async (t) => {
77
- try {
78
- switch (t.type) {
79
- case i.TEXT:
80
- a.push(t.content);
81
- break;
82
- case i.EMOJI:
83
- a.push(t.content.key);
84
- break;
85
- case i.MENTION:
86
- o.push(t.content.id), a.push(t.content.mentionSuggestionChar + t.content.label);
87
- break;
88
- case i.IMAGE:
89
- await c(), await r.sendImageMessage({
90
- payload: { file: t.content },
91
- ...n
92
- });
93
- break;
94
- case i.VIDEO:
95
- await c(), await r.sendVideoMessage({
96
- payload: { file: t.content },
97
- ...n
98
- });
99
- break;
100
- case i.FILE:
101
- await c(), 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;
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 m(e[l]), l++;
118
- await c();
114
+ await g(e[l]), l++;
115
+ await i();
119
116
  }
120
- function D() {
117
+ function z() {
121
118
  return {
122
119
  inputRawValue: u,
123
- isPeerTyping: g,
120
+ isPeerTyping: m,
124
121
  updateRawValue: C,
125
122
  setEditorInstance: v,
126
- setContent: x,
127
- insertContent: E,
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(T.CHAT, {
131
+ h.watch(w.CHAT, {
135
132
  typingStatus: (e) => {
136
- g.value = e;
133
+ m.value = e;
137
134
  }
138
135
  });
139
136
  }
140
137
  N();
141
138
  export {
142
- i as MessageContentType,
143
- D as useMessageInputState
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 f, StoreName as l, TUIChatService as m } from "@tencentcloud/chat-uikit-engine";
3
- let p;
4
- const d = o(void 0), a = o(void 0), u = o(void 0), R = o(void 0), v = o(void 0), c = o(void 0), r = o(/* @__PURE__ */ new Set()), n = o(/* @__PURE__ */ new Set());
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, R.value = void 0, v.value = void 0, c.value = void 0, r.value = /* @__PURE__ */ new Set(), n.value = /* @__PURE__ */ new Set();
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
- v.value = t;
9
+ p.value = t;
10
10
  }
11
- function w(t) {
11
+ function D(t) {
12
12
  c.value = t;
13
13
  }
14
- function D({ messageID: t, duration: i }) {
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: R,
26
- enableReadReceipt: v,
28
+ hasMoreNewerMessage: l,
29
+ enableReadReceipt: p,
27
30
  isDisableScroll: c,
28
- recalledMessageIDSet: r,
31
+ recalledMessageIDSet: R,
29
32
  highlightMessageIDSet: n,
30
33
  // actions
31
- loadMoreOlderMessage: m.getMessageList,
34
+ loadMoreOlderMessage: k,
32
35
  // TODO
33
36
  // loadMoreNewerMessage: TUIChatService.getMessageList,
34
37
  setEnableReadReceipt: L,
35
- setIsDisableScroll: w,
36
- highlightMessage: D
38
+ setIsDisableScroll: D,
39
+ highlightMessage: w
37
40
  };
38
41
  }
39
- const k = () => {
42
+ const y = () => {
40
43
  function t(s) {
41
44
  if (!d.value)
42
45
  return;
43
- function I(e) {
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(I);
72
+ const C = s.map(S);
70
73
  a.value = C, a.value.forEach((e) => {
71
- e.isRevoked && r.value.add(e.ID);
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 S(s) {
78
- (!s || s !== p) && (M(), d.value = s), p = s || void 0;
80
+ function I(s) {
81
+ (!s || s !== f) && (M(), d.value = s), f = s || void 0;
79
82
  }
80
- f.watch(l.CONV, {
81
- currentConversationID: S
82
- }), f.watch(l.CHAT, {
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
- k();
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 m } from "../../utils/eventCenter.js";
5
+ import { eventCenter as v } from "../../utils/eventCenter.js";
6
6
  import { useLoginState as O } from "../LoginState.js";
7
- import { useRoomState as T } from "../RoomState/index.js";
8
- import R from "./callEventManager.js";
9
- import { participantTransfer as M } from "./common.js";
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 w from "./scheduleEventManager.js";
13
- import { useRoomParticipantStore as p } from "./store.js";
14
- let s = null, d = !1;
15
- async function C() {
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 } = p();
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 = M.transformTUIUserInfoToParticipantInfo(n);
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 S() {
24
- if (s || (s = new E(), new A(), new R(), new w()), !d) {
25
- d = !0;
26
- const { currentRoom: e } = T(), { reset: i } = p();
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 C(), n && !t && i();
31
+ !n && t && await w(), n && !t && i();
32
32
  }, { immediate: !0 });
33
33
  }
34
- return s;
34
+ return p;
35
35
  }
36
- function u(e, i) {
37
- m.on(e, i);
36
+ function d(e, i) {
37
+ v.on(e, i);
38
38
  }
39
- function v(e, i) {
40
- m.off(e, i);
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 = S(), {
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
- } = p();
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
- subscribeEvent: u.bind(u),
87
- unsubscribeEvent: v.bind(v)
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 { TUIChangeReason, TUIVideoStreamType, TUIRole, TUIKickedOutOfRoomReason, TUIUserInfo, TUIRequest } from '@tencentcloud/tuiroom-engine-js';
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, userInfo }: {
57
+ onRequestCancelled({ request }: {
58
58
  request: TUIRequest;
59
59
  userInfo: TUIUserInfo;
60
60
  }): void;