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,81 +1,71 @@
1
- var F = Object.defineProperty;
2
- var K = (f, e, n) => e in f ? F(f, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : f[e] = n;
3
- var $ = (f, e, n) => K(f, typeof e != "symbol" ? e + "" : e, n);
4
- import _, { TUIChangeReason as w, TUIVideoStreamType as L, TUIRole as v, TUIRequestAction as u, TUIRoomEvents as m, TUIKickedOutOfRoomReason as R } from "@tencentcloud/tuiroom-engine-js";
1
+ var V = Object.defineProperty;
2
+ var F = (f, o, e) => o in f ? V(f, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : f[o] = e;
3
+ var L = (f, o, e) => F(f, typeof o != "symbol" ? o + "" : o, e);
4
+ import K, { TUIRole as v, TUIRequestAction as m, TUIRoomEvents as l, TUIVideoStreamType as _, TUIKickedOutOfRoomReason as R } from "@tencentcloud/tuiroom-engine-js";
5
5
  import { useRoomEngine as B } from "../../hooks/useRoomEngine.js";
6
- import { eventCenter as r } from "../../utils/eventCenter.js";
6
+ import { eventCenter as s } from "../../utils/eventCenter.js";
7
7
  import { useLoginState as Q } from "../LoginState.js";
8
8
  import { useRoomState as x } from "../RoomState/index.js";
9
9
  import { participantTransfer as g } from "./common.js";
10
10
  import { useRoomParticipantStore as G } from "./store.js";
11
- import { RoomParticipantEvent as i, RoomParticipantRole as U, KickedOutOfRoomReason as C } from "../../types/participant.js";
12
- import { DeviceStatus as I, DeviceType as a } from "../../types/device.js";
11
+ import { RoomParticipantEvent as t, RoomParticipantRole as U, KickedOutOfRoomReason as I } from "../../types/participant.js";
12
+ import { DeviceStatus as C, DeviceType as a } from "../../types/device.js";
13
13
  const {
14
14
  speakingUsers: J,
15
15
  networkQualities: j,
16
- receivedRequestMap: p,
16
+ receivedRequestMap: h,
17
17
  getParticipantInfo: b,
18
- addParticipantInfo: k,
19
- updateParticipantInfo: A,
18
+ addParticipantInfo: D,
19
+ updateParticipantInfo: k,
20
20
  removeParticipantInfo: z,
21
21
  reset: H,
22
22
  removePendingParticipantInfo: W
23
- } = G(), l = B(), { loginUserInfo: X } = Q(), { currentRoom: E } = x(), S = class S {
23
+ } = G(), u = B(), { loginUserInfo: A } = Q(), { currentRoom: T } = x(), S = class S {
24
24
  constructor() {
25
25
  S.instance || (S.instance = this), this.onRemoteUserEnterRoom = this.onRemoteUserEnterRoom.bind(this), this.onRemoteUserLeaveRoom = this.onRemoteUserLeaveRoom.bind(this), this.onUserAudioStateChanged = this.onUserAudioStateChanged.bind(this), this.onUserVideoStateChanged = this.onUserVideoStateChanged.bind(this), this.onUserVoiceVolumeChanged = this.onUserVoiceVolumeChanged.bind(this), this.onUserInfoChanged = this.onUserInfoChanged.bind(this), this.onSendMessageForUserDisableChanged = this.onSendMessageForUserDisableChanged.bind(this), this.onKickedOutOfRoom = this.onKickedOutOfRoom.bind(this), this.onAllUserCameraDisableChanged = this.onAllUserCameraDisableChanged.bind(this), this.onAllUserMicrophoneDisableChanged = this.onAllUserMicrophoneDisableChanged.bind(this), this.onScreenShareForAllUserDisableChanged = this.onScreenShareForAllUserDisableChanged.bind(this), this.onSendMessageForAllUserDisableChanged = this.onSendMessageForAllUserDisableChanged.bind(this), this.onUserNetworkQualityChanged = this.onUserNetworkQualityChanged.bind(this), this.onRequestReceived = this.onRequestReceived.bind(this), this.onRequestCancelled = this.onRequestCancelled.bind(this), this.onRequestProcessed = this.onRequestProcessed.bind(this), this.bindRoomEngineEvents();
26
26
  }
27
- onRemoteUserEnterRoom(e) {
28
- const { userInfo: n } = e, o = g.transformTUIUserInfoToParticipantInfo(n);
29
- W({ userId: o.userId }), k(o), r.emit(i.onParticipantJoined, { userInfo: {
30
- userId: o.userId,
31
- userName: o.userName,
32
- avatarUrl: o.avatarUrl
27
+ onRemoteUserEnterRoom(o) {
28
+ const { userInfo: e } = o, n = g.transformTUIUserInfoToParticipantInfo(e);
29
+ W({ userId: n.userId }), D(n), s.emit(t.onParticipantJoined, { userInfo: {
30
+ userId: n.userId,
31
+ userName: n.userName,
32
+ avatarUrl: n.avatarUrl
33
33
  } });
34
34
  }
35
- onRemoteUserLeaveRoom(e) {
36
- const { userInfo: n } = e, { userId: o } = n;
37
- z({ userId: o });
38
- const s = g.transformTUIUserInfoToParticipantInfo(n);
39
- r.emit(i.onParticipantLeft, {
35
+ onRemoteUserLeaveRoom(o) {
36
+ const { userInfo: e } = o, { userId: n } = e;
37
+ z({ userId: n });
38
+ const r = g.transformTUIUserInfoToParticipantInfo(e);
39
+ s.emit(t.onParticipantLeft, {
40
40
  userInfo: {
41
- userId: s.userId,
42
- userName: s.userName,
43
- avatarUrl: s.avatarUrl
41
+ userId: r.userId,
42
+ userName: r.userName,
43
+ avatarUrl: r.avatarUrl
44
44
  }
45
45
  });
46
46
  }
47
- onUserAudioStateChanged(e) {
48
- var d;
49
- const { userId: n, hasAudio: o, reason: s } = e;
50
- let t = b({ userId: n });
51
- !t && o && k({ userId: n }), t = b({ userId: n }), t && (A({ userId: n, microphoneStatus: o ? I.On : I.Off }), s === w.kChangedByAdmin && o === !1 && r.emit(i.onParticipantDeviceClosed, {
52
- userId: n,
53
- device: a.Microphone,
54
- operator: ((d = E.value) == null ? void 0 : d.roomOwner) || { userId: "", userName: "", avatarUrl: "" }
55
- }));
47
+ onUserAudioStateChanged(o) {
48
+ const { userId: e, hasAudio: n } = o;
49
+ let r = b({ userId: e });
50
+ !r && n && D({ userId: e }), r = b({ userId: e }), r && k({ userId: e, microphoneStatus: n ? C.On : C.Off });
56
51
  }
57
- onUserVideoStateChanged(e) {
58
- var c;
59
- const { userId: n, streamType: o, hasVideo: s, reason: t } = e;
60
- let d = b({ userId: n });
61
- if (!d && s && k({ userId: n }), d = b({ userId: n }), !d)
52
+ onUserVideoStateChanged(o) {
53
+ const { userId: e, streamType: n, hasVideo: r } = o;
54
+ let i = b({ userId: e });
55
+ if (!i && r && D({ userId: e }), i = b({ userId: e }), !i)
62
56
  return;
63
- const h = o === L.kScreenStream ? { screenShareStatus: s ? I.On : I.Off } : { cameraStatus: s ? I.On : I.Off };
64
- A({ userId: n, ...h }), t === w.kChangedByAdmin && s === !1 && r.emit(i.onParticipantDeviceClosed, {
65
- userId: n,
66
- device: o === L.kScreenStream ? a.ScreenShare : a.Camera,
67
- operator: ((c = E.value) == null ? void 0 : c.roomOwner) || { userId: "", userName: "", avatarUrl: "" }
68
- });
57
+ const d = n === _.kScreenStream ? { screenShareStatus: r ? C.On : C.Off } : { cameraStatus: r ? C.On : C.Off };
58
+ k({ userId: e, ...d });
69
59
  }
70
- onUserVoiceVolumeChanged(e) {
71
- const { userVolumeList: n } = e;
72
- n.forEach((o) => {
73
- const { userId: s, volume: t } = o;
74
- J.value.set(s, t);
60
+ onUserVoiceVolumeChanged(o) {
61
+ const { userVolumeList: e } = o;
62
+ e.forEach((n) => {
63
+ const { userId: r, volume: i } = n;
64
+ J.value.set(r, i);
75
65
  });
76
66
  }
77
- transformRoleToParticipantRole(e) {
78
- switch (e) {
67
+ transformRoleToParticipantRole(o) {
68
+ switch (o) {
79
69
  case v.kRoomOwner:
80
70
  return U.Owner;
81
71
  case v.kAdministrator:
@@ -86,241 +76,263 @@ const {
86
76
  return U.GeneralUser;
87
77
  }
88
78
  }
89
- onUserInfoChanged({ userInfo: e }) {
90
- var h;
91
- const { userId: n, nameCard: o, roomCustomInfo: s, userRole: t } = e, d = (h = b({ userId: n })) == null ? void 0 : h.role;
92
- if (A({ userId: n, nameCard: o, metaData: s || {}, role: this.transformRoleToParticipantRole(t) }), d !== U.Owner && e.userRole === v.kRoomOwner) {
93
- const c = g.transformTUIUserInfoToParticipantInfo(e);
94
- r.emit(i.onOwnerChanged, {
79
+ onUserInfoChanged({ userInfo: o }) {
80
+ var p;
81
+ const { userId: e, nameCard: n, roomCustomInfo: r, userRole: i } = o, d = (p = b({ userId: e })) == null ? void 0 : p.role;
82
+ if (k({ userId: e, nameCard: n, metaData: r || {}, role: this.transformRoleToParticipantRole(i) }), d !== U.Owner && o.userRole === v.kRoomOwner) {
83
+ const c = g.transformTUIUserInfoToParticipantInfo(o);
84
+ s.emit(t.onOwnerChanged, {
95
85
  newOwner: { userId: c.userId, userName: c.userName, avatarUrl: c.avatarUrl }
96
86
  });
97
87
  }
98
- if (d !== U.Admin && e.userRole === v.kAdministrator) {
99
- const c = g.transformTUIUserInfoToParticipantInfo(e);
100
- r.emit(i.onAdminSet, {
88
+ if (d !== U.Admin && o.userRole === v.kAdministrator) {
89
+ const c = g.transformTUIUserInfoToParticipantInfo(o);
90
+ s.emit(t.onAdminSet, {
101
91
  userInfo: { userId: c.userId, userName: c.userName, avatarUrl: c.avatarUrl }
102
92
  });
103
93
  }
104
- if (d === U.Admin && e.userRole !== v.kAdministrator) {
105
- const c = g.transformTUIUserInfoToParticipantInfo(e);
106
- r.emit(i.onAdminRevoked, {
94
+ if (d === U.Admin && o.userRole !== v.kAdministrator) {
95
+ const c = g.transformTUIUserInfoToParticipantInfo(o);
96
+ s.emit(t.onAdminRevoked, {
107
97
  userInfo: { userId: c.userId, userName: c.userName, avatarUrl: c.avatarUrl }
108
98
  });
109
99
  }
110
100
  }
111
- onSendMessageForUserDisableChanged(e) {
112
- var s;
113
- const { userId: n, isDisable: o } = e;
114
- A({
115
- userId: n,
116
- isMessageDisabled: o
117
- }), n === ((s = X.value) == null ? void 0 : s.userId) && r.emit(i.onParticipantMessageMuted, {
118
- userId: n,
119
- muted: o,
101
+ onSendMessageForUserDisableChanged(o) {
102
+ var r;
103
+ const { userId: e, isDisable: n } = o;
104
+ k({
105
+ userId: e,
106
+ isMessageDisabled: n
107
+ }), e === ((r = A.value) == null ? void 0 : r.userId) && s.emit(t.onParticipantMessageMuted, {
108
+ userId: e,
109
+ muted: n,
120
110
  operator: { userId: "", userName: "", avatarUrl: "" }
121
111
  });
122
112
  }
123
- onAllUserCameraDisableChanged(e) {
124
- const { isDisable: n } = e;
125
- r.emit(i.onAllDevicesDisabled, { device: a.Camera, disable: n });
113
+ onAllUserCameraDisableChanged(o) {
114
+ var n;
115
+ const { isDisable: e } = o;
116
+ s.emit(t.onAllDevicesDisabled, { device: a.Camera, disable: e, operator: ((n = T.value) == null ? void 0 : n.roomOwner) || { userId: "", userName: "", avatarUrl: "" } });
126
117
  }
127
- onAllUserMicrophoneDisableChanged(e) {
128
- const { isDisable: n } = e;
129
- r.emit(i.onAllDevicesDisabled, { device: a.Microphone, disable: n });
118
+ onAllUserMicrophoneDisableChanged(o) {
119
+ var n;
120
+ const { isDisable: e } = o;
121
+ s.emit(t.onAllDevicesDisabled, { device: a.Microphone, disable: e, operator: ((n = T.value) == null ? void 0 : n.roomOwner) || { userId: "", userName: "", avatarUrl: "" } });
130
122
  }
131
- onScreenShareForAllUserDisableChanged(e) {
132
- const { isDisable: n } = e;
133
- r.emit(i.onAllDevicesDisabled, { device: a.ScreenShare, disable: n });
123
+ onScreenShareForAllUserDisableChanged(o) {
124
+ var n;
125
+ const { isDisable: e } = o;
126
+ s.emit(t.onAllDevicesDisabled, { device: a.ScreenShare, disable: e, operator: ((n = T.value) == null ? void 0 : n.roomOwner) || { userId: "", userName: "", avatarUrl: "" } });
134
127
  }
135
- onSendMessageForAllUserDisableChanged(e) {
136
- const { isDisable: n } = e;
137
- r.emit(i.onAllMessagesDisabled, { disable: n });
128
+ onSendMessageForAllUserDisableChanged(o) {
129
+ var n;
130
+ const { isDisable: e } = o;
131
+ s.emit(t.onAllMessagesDisabled, { disable: e, operator: ((n = T.value) == null ? void 0 : n.roomOwner) || { userId: "", userName: "", avatarUrl: "" } });
138
132
  }
139
- onKickedOutOfRoom(e) {
140
- const { reason: n, message: o } = e, s = {
141
- [R.kKickedByAdmin]: C.KickedByAdmin,
142
- [R.kKickedByLoggedOnOtherDevice]: C.ReplacedByAnotherDevice,
143
- [R.kKickedByServer]: C.KickedByServer,
144
- [R.kNetworkDisconnected]: C.ConnectionTimeout,
145
- [R.kJoinRoomStatusInvalidDuringOffline]: C.InvalidStatusOnReconnect,
146
- [R.kCountOfJoinedRoomsExceedLimit]: C.RoomLimitExceeded
133
+ onKickedOutOfRoom(o) {
134
+ const { reason: e, message: n } = o, r = {
135
+ [R.kKickedByAdmin]: I.KickedByAdmin,
136
+ [R.kKickedByLoggedOnOtherDevice]: I.ReplacedByAnotherDevice,
137
+ [R.kKickedByServer]: I.KickedByServer,
138
+ [R.kNetworkDisconnected]: I.ConnectionTimeout,
139
+ [R.kJoinRoomStatusInvalidDuringOffline]: I.InvalidStatusOnReconnect,
140
+ [R.kCountOfJoinedRoomsExceedLimit]: I.RoomLimitExceeded
147
141
  };
148
- H(), r.emit(i.onKickedFromRoom, { reason: s[n], message: o });
142
+ H(), s.emit(t.onKickedFromRoom, { reason: r[e], message: n });
149
143
  }
150
- onUserNetworkQualityChanged(e) {
151
- const { userNetworkList: n } = e;
152
- n.forEach((o) => {
153
- const { userId: s, quality: t, upLoss: d, downLoss: h, delay: c } = o;
154
- j.value.set(s, { quality: t, upLoss: d, downLoss: h, delay: c });
144
+ onUserNetworkQualityChanged(o) {
145
+ const { userNetworkList: e } = o;
146
+ e.forEach((n) => {
147
+ const { userId: r, quality: i, upLoss: d, downLoss: p, delay: c } = n;
148
+ j.value.set(r, { quality: i, upLoss: d, downLoss: p, delay: c });
155
149
  });
156
150
  }
157
- onRequestReceived({ request: e }) {
158
- const { fromUser: n } = e, o = {
159
- timestamp: Date.now(),
160
- senderUserId: n.userId,
161
- senderUserName: n.userName,
162
- senderNameCard: n.nameCard,
163
- senderAvatarUrl: n.avatarUrl,
164
- content: e.content
151
+ onRequestReceived({ request: o }) {
152
+ var i, d, p;
153
+ const { fromUser: e, toUser: n } = o, r = {
154
+ timestamp: o.timestamp,
155
+ senderUserId: e.userId,
156
+ senderUserName: e.userName,
157
+ senderNameCard: e.nameCard,
158
+ senderAvatarUrl: e.avatarUrl,
159
+ content: o.content
165
160
  };
166
- switch (e.requestAction) {
167
- case u.kRequestToOpenRemoteCamera:
168
- p.set(`${a.Camera}_${n.userId}`, e), r.emit(i.onDeviceInvitationReceived, {
169
- invitation: { ...o, deviceType: a.Camera }
161
+ switch (o.requestAction) {
162
+ case m.kRequestToOpenRemoteCamera:
163
+ h.set(`${a.Camera}_${e.userId}`, o), s.emit(t.onDeviceInvitationReceived, {
164
+ invitation: { ...r, deviceType: a.Camera }
165
+ });
166
+ break;
167
+ case m.kRequestToOpenRemoteMicrophone:
168
+ h.set(`${a.Microphone}_${e.userId}`, o), s.emit(t.onDeviceInvitationReceived, {
169
+ invitation: { ...r, deviceType: a.Microphone }
170
+ });
171
+ break;
172
+ case m.kApplyToAdminToOpenLocalCamera:
173
+ h.set(`${a.Camera}_${e.userId}`, o), s.emit(t.onDeviceRequestReceived, {
174
+ request: { ...r, deviceType: a.Camera }
175
+ });
176
+ break;
177
+ case m.kApplyToAdminToOpenLocalMicrophone:
178
+ h.set(`${a.Microphone}_${e.userId}`, o), s.emit(t.onDeviceRequestReceived, {
179
+ request: { ...r, deviceType: a.Microphone }
170
180
  });
171
181
  break;
172
- case u.kRequestToOpenRemoteMicrophone:
173
- p.set(`${a.Microphone}_${n.userId}`, e), r.emit(i.onDeviceInvitationReceived, {
174
- invitation: { ...o, deviceType: a.Microphone }
182
+ case m.kApplyToAdminToOpenLocalScreenShare:
183
+ h.set(`${a.ScreenShare}_${e.userId}`, o), s.emit(t.onDeviceRequestReceived, {
184
+ request: { ...r, deviceType: a.ScreenShare }
175
185
  });
176
186
  break;
177
- case u.kApplyToAdminToOpenLocalCamera:
178
- p.set(`${a.Camera}_${n.userId}`, e), r.emit(i.onDeviceRequestReceived, {
179
- request: { ...o, deviceType: a.Camera }
187
+ case m.kCloseRemoteCamera:
188
+ n.userId === ((i = A.value) == null ? void 0 : i.userId) && s.emit(t.onParticipantDeviceClosed, {
189
+ device: a.Camera,
190
+ operator: { userId: e.userId, userName: e.userName, avatarUrl: e.avatarUrl }
180
191
  });
181
192
  break;
182
- case u.kApplyToAdminToOpenLocalMicrophone:
183
- p.set(`${a.Microphone}_${n.userId}`, e), r.emit(i.onDeviceRequestReceived, {
184
- request: { ...o, deviceType: a.Microphone }
193
+ case m.kCloseRemoteMicrophone:
194
+ n.userId === ((d = A.value) == null ? void 0 : d.userId) && s.emit(t.onParticipantDeviceClosed, {
195
+ device: a.Microphone,
196
+ operator: { userId: e.userId, userName: e.userName, avatarUrl: e.avatarUrl }
185
197
  });
186
198
  break;
187
- case u.kApplyToAdminToOpenLocalScreenShare:
188
- p.set(`${a.ScreenShare}_${n.userId}`, e), r.emit(i.onDeviceRequestReceived, {
189
- request: { ...o, deviceType: a.ScreenShare }
199
+ case m.kCloseRemoteScreenShare:
200
+ n.userId === ((p = A.value) == null ? void 0 : p.userId) && s.emit(t.onParticipantDeviceClosed, {
201
+ device: a.ScreenShare,
202
+ operator: { userId: e.userId, userName: e.userName, avatarUrl: e.avatarUrl }
190
203
  });
191
204
  break;
192
205
  }
193
206
  }
194
- onRequestCancelled({ request: e, userInfo: n }) {
195
- const { requestAction: o, fromUser: s } = e, t = {
196
- timestamp: Date.now(),
197
- senderUserId: s.userId,
198
- senderUserName: s.userName,
199
- senderNameCard: s.nameCard,
200
- senderAvatarUrl: s.avatarUrl,
207
+ onRequestCancelled({ request: o }) {
208
+ const { requestAction: e, fromUser: n } = o, r = {
209
+ timestamp: o.timestamp,
210
+ senderUserId: n.userId,
211
+ senderUserName: n.userName,
212
+ senderNameCard: n.nameCard,
213
+ senderAvatarUrl: n.avatarUrl,
201
214
  content: "",
202
215
  deviceType: a.Camera
203
- }, d = i.onDeviceInvitationCancelled, h = i.onDeviceRequestCancelled;
204
- switch (o) {
205
- case u.kRequestToOpenRemoteCamera:
206
- p.delete(`${a.Camera}_${s.userId}`), r.emit(d, {
207
- invitation: { ...t, deviceType: a.Camera }
216
+ }, i = t.onDeviceInvitationCancelled, d = t.onDeviceRequestCancelled;
217
+ switch (e) {
218
+ case m.kRequestToOpenRemoteCamera:
219
+ h.delete(`${a.Camera}_${n.userId}`), s.emit(i, {
220
+ invitation: { ...r, deviceType: a.Camera }
208
221
  });
209
222
  break;
210
- case u.kRequestToOpenRemoteMicrophone:
211
- p.delete(`${a.Microphone}_${s.userId}`), r.emit(d, {
212
- invitation: { ...t, deviceType: a.Microphone }
223
+ case m.kRequestToOpenRemoteMicrophone:
224
+ h.delete(`${a.Microphone}_${n.userId}`), s.emit(i, {
225
+ invitation: { ...r, deviceType: a.Microphone }
213
226
  });
214
227
  break;
215
- case u.kApplyToAdminToOpenLocalCamera:
216
- p.delete(`${a.Camera}_${s.userId}`), r.emit(h, {
217
- request: { ...t, deviceType: a.Camera }
228
+ case m.kApplyToAdminToOpenLocalCamera:
229
+ h.delete(`${a.Camera}_${n.userId}`), s.emit(d, {
230
+ request: { ...r, deviceType: a.Camera }
218
231
  });
219
232
  break;
220
- case u.kApplyToAdminToOpenLocalMicrophone:
221
- p.delete(`${a.Microphone}_${s.userId}`), r.emit(h, {
222
- request: { ...t, deviceType: a.Microphone }
233
+ case m.kApplyToAdminToOpenLocalMicrophone:
234
+ h.delete(`${a.Microphone}_${n.userId}`), s.emit(d, {
235
+ request: { ...r, deviceType: a.Microphone }
223
236
  });
224
237
  break;
225
- case u.kApplyToAdminToOpenLocalScreenShare:
226
- p.delete(`${a.ScreenShare}_${s.userId}`), r.emit(h, {
227
- request: { ...t, deviceType: a.ScreenShare }
238
+ case m.kApplyToAdminToOpenLocalScreenShare:
239
+ h.delete(`${a.ScreenShare}_${n.userId}`), s.emit(d, {
240
+ request: { ...r, deviceType: a.ScreenShare }
228
241
  });
229
242
  break;
230
243
  }
231
244
  }
232
- onRequestProcessed({ request: e, userInfo: n }) {
233
- const { requestAction: o, fromUser: s } = e, t = {
234
- timestamp: Date.now(),
245
+ onRequestProcessed({ request: o, userInfo: e }) {
246
+ const { requestAction: n, fromUser: r } = o, i = {
247
+ timestamp: o.timestamp,
248
+ senderUserId: r.userId,
249
+ senderUserName: r.userName,
250
+ senderNameCard: r.nameCard,
251
+ senderAvatarUrl: r.avatarUrl,
252
+ content: o.content
253
+ }, d = {
235
254
  userId: e.userId,
236
255
  userName: e.userName,
237
- nameCard: e.nameCard,
238
- avatarUrl: e.avatarUrl,
239
- content: "",
240
- deviceType: a.Camera
241
- }, d = {
242
- userId: n.userId,
243
- userName: n.userName,
244
- avatarUrl: n.avatarUrl
256
+ avatarUrl: e.avatarUrl
245
257
  };
246
- switch (o) {
247
- case u.kApplyToAdminToOpenLocalCamera:
248
- p.delete(`${a.Camera}_${s.userId}`), r.emit(i.onDeviceRequestProcessed, {
249
- request: { ...t, deviceType: a.Camera },
258
+ switch (n) {
259
+ case m.kApplyToAdminToOpenLocalCamera:
260
+ h.delete(`${a.Camera}_${r.userId}`), s.emit(t.onDeviceRequestProcessed, {
261
+ request: { ...i, deviceType: a.Camera },
250
262
  operator: d
251
263
  });
252
264
  break;
253
- case u.kApplyToAdminToOpenLocalMicrophone:
254
- p.delete(`${a.Microphone}_${s.userId}`), r.emit(i.onDeviceRequestProcessed, {
255
- request: { ...t, deviceType: a.Microphone },
265
+ case m.kApplyToAdminToOpenLocalMicrophone:
266
+ h.delete(`${a.Microphone}_${r.userId}`), s.emit(t.onDeviceRequestProcessed, {
267
+ request: { ...i, deviceType: a.Microphone },
256
268
  operator: d
257
269
  });
258
270
  break;
259
- case u.kApplyToAdminToOpenLocalScreenShare:
260
- p.delete(`${a.ScreenShare}_${s.userId}`), r.emit(i.onDeviceRequestProcessed, {
261
- request: { ...t, deviceType: a.ScreenShare },
271
+ case m.kApplyToAdminToOpenLocalScreenShare:
272
+ h.delete(`${a.ScreenShare}_${r.userId}`), s.emit(t.onDeviceRequestProcessed, {
273
+ request: { ...i, deviceType: a.ScreenShare },
262
274
  operator: d
263
275
  });
264
276
  break;
265
277
  }
266
278
  }
267
279
  bindRoomEngineEvents() {
268
- _.once("ready", () => {
269
- var e, n, o, s, t, d, h, c, T, D, O, y, M, q, N, P;
270
- (e = l.instance) == null || e.on(
271
- m.onRemoteUserEnterRoom,
280
+ K.once("ready", () => {
281
+ var o, e, n, r, i, d, p, c, O, N, y, M, q, P, $, w;
282
+ (o = u.instance) == null || o.on(
283
+ l.onRemoteUserEnterRoom,
272
284
  this.onRemoteUserEnterRoom
273
- ), (n = l.instance) == null || n.on(
274
- m.onRemoteUserLeaveRoom,
285
+ ), (e = u.instance) == null || e.on(
286
+ l.onRemoteUserLeaveRoom,
275
287
  this.onRemoteUserLeaveRoom
276
- ), (o = l.instance) == null || o.on(
277
- m.onUserVideoStateChanged,
288
+ ), (n = u.instance) == null || n.on(
289
+ l.onUserVideoStateChanged,
278
290
  this.onUserVideoStateChanged
279
- ), (s = l.instance) == null || s.on(
280
- m.onUserAudioStateChanged,
291
+ ), (r = u.instance) == null || r.on(
292
+ l.onUserAudioStateChanged,
281
293
  this.onUserAudioStateChanged
282
- ), (t = l.instance) == null || t.on(
283
- m.onUserVoiceVolumeChanged,
294
+ ), (i = u.instance) == null || i.on(
295
+ l.onUserVoiceVolumeChanged,
284
296
  this.onUserVoiceVolumeChanged
285
- ), (d = l.instance) == null || d.on(
286
- m.onUserInfoChanged,
297
+ ), (d = u.instance) == null || d.on(
298
+ l.onUserInfoChanged,
287
299
  this.onUserInfoChanged
288
- ), (h = l.instance) == null || h.on(
289
- m.onSendMessageForUserDisableChanged,
300
+ ), (p = u.instance) == null || p.on(
301
+ l.onSendMessageForUserDisableChanged,
290
302
  this.onSendMessageForUserDisableChanged
291
- ), (c = l.instance) == null || c.on(
292
- m.onUserNetworkQualityChanged,
303
+ ), (c = u.instance) == null || c.on(
304
+ l.onUserNetworkQualityChanged,
293
305
  this.onUserNetworkQualityChanged
294
- ), (T = l.instance) == null || T.on(
295
- m.onKickedOutOfRoom,
306
+ ), (O = u.instance) == null || O.on(
307
+ l.onKickedOutOfRoom,
296
308
  this.onKickedOutOfRoom
297
- ), (D = l.instance) == null || D.on(
298
- m.onAllUserCameraDisableChanged,
309
+ ), (N = u.instance) == null || N.on(
310
+ l.onAllUserCameraDisableChanged,
299
311
  this.onAllUserCameraDisableChanged
300
- ), (O = l.instance) == null || O.on(
301
- m.onAllUserMicrophoneDisableChanged,
312
+ ), (y = u.instance) == null || y.on(
313
+ l.onAllUserMicrophoneDisableChanged,
302
314
  this.onAllUserMicrophoneDisableChanged
303
- ), (y = l.instance) == null || y.on(
304
- m.onScreenShareForAllUserDisableChanged,
315
+ ), (M = u.instance) == null || M.on(
316
+ l.onScreenShareForAllUserDisableChanged,
305
317
  this.onScreenShareForAllUserDisableChanged
306
- ), (M = l.instance) == null || M.on(
307
- m.onSendMessageForAllUserDisableChanged,
318
+ ), (q = u.instance) == null || q.on(
319
+ l.onSendMessageForAllUserDisableChanged,
308
320
  this.onSendMessageForAllUserDisableChanged
309
- ), (q = l.instance) == null || q.on(
310
- m.onRequestReceived,
321
+ ), (P = u.instance) == null || P.on(
322
+ l.onRequestReceived,
311
323
  this.onRequestReceived
312
- ), (N = l.instance) == null || N.on(
313
- m.onRequestCancelled,
324
+ ), ($ = u.instance) == null || $.on(
325
+ l.onRequestCancelled,
314
326
  this.onRequestCancelled
315
- ), (P = l.instance) == null || P.on(
316
- m.onRequestProcessed,
327
+ ), (w = u.instance) == null || w.on(
328
+ l.onRequestProcessed,
317
329
  this.onRequestProcessed
318
330
  );
319
331
  });
320
332
  }
321
333
  };
322
- $(S, "instance");
323
- let V = S;
334
+ L(S, "instance");
335
+ let E = S;
324
336
  export {
325
- V as default
337
+ E as default
326
338
  };
@@ -74,6 +74,8 @@ export interface IParticipantManager {
74
74
  device: DeviceType;
75
75
  userId: string;
76
76
  }): Promise<void>;
77
+ muteMicrophone(): Promise<void>;
78
+ unmuteMicrophone(): Promise<void>;
77
79
  }
78
80
  /**
79
81
  * 用户自定义信息类型
@@ -266,6 +268,8 @@ export default class ParticipantManager implements IParticipantManager {
266
268
  device: DeviceType;
267
269
  userId: string;
268
270
  }): Promise<void>;
271
+ muteMicrophone(): Promise<void>;
272
+ unmuteMicrophone(): Promise<void>;
269
273
  private onRequestReceived;
270
274
  /**
271
275
  * 处理请求取消事件