tuikit-atomicx-vue3 3.4.2 → 4.3.1

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 (297) hide show
  1. package/.eslintrc.cjs +1 -0
  2. package/dist/baseComp/Modal/Modal.js +431 -23
  3. package/dist/chat/index.d.ts +18 -18
  4. package/dist/components/AudioSetting/AudioMediaControl.js +39 -41
  5. package/dist/components/AudioSetting/AudioSettingTab.js +10 -10
  6. package/dist/components/AudioSetting/MicrophoneSelect.js +8 -8
  7. package/dist/components/AudioSetting/SpeakerSelect.js +9 -9
  8. package/dist/components/AudioSettingPanel/i18n/en-US/index.d.ts +1 -0
  9. package/dist/components/AudioSettingPanel/i18n/en-US/index.js +2 -1
  10. package/dist/components/AudioSettingPanel/i18n/zh-CN/index.d.ts +1 -0
  11. package/dist/components/AudioSettingPanel/i18n/zh-CN/index.js +2 -1
  12. package/dist/components/AudioSettingPanel/index.js +81 -73
  13. package/dist/components/BarrageInput/BarrageInputH5.js +9 -9
  14. package/dist/components/BarrageInput/EmojiPicker/EmojiPicker.js +3 -3
  15. package/dist/components/BarrageInput/MessageInputState.d.ts +28 -0
  16. package/dist/components/BarrageInput/MessageInputState.js +82 -0
  17. package/dist/components/BarrageInput/TextEditor/CharacterCountExtension.js +1 -1
  18. package/dist/components/BarrageInput/TextEditor/EditorCore.js +2 -2
  19. package/dist/components/BarrageInput/TextEditor/index.js +7 -7
  20. package/dist/components/BarrageInput/type.d.ts +17 -0
  21. package/dist/components/BarrageInput/type.js +4 -0
  22. package/dist/components/BarrageInput/utils.d.ts +30 -0
  23. package/dist/components/BarrageInput/utils.js +41 -0
  24. package/dist/components/BarrageList/BarrageList.js +80 -110
  25. package/dist/components/BarrageList/BarrageList.vue.d.ts +0 -29
  26. package/dist/components/BarrageList/BarrageListH5.js +95 -122
  27. package/dist/components/BarrageList/BarrageListH5.vue.d.ts +0 -29
  28. package/dist/components/BarrageList/BarrageListState.d.ts +58 -0
  29. package/dist/components/BarrageList/BarrageListState.js +106 -0
  30. package/dist/components/BarrageList/Message/MessageLayout/MessageBubble/MessageBubble.js +16 -24
  31. package/dist/components/BarrageList/Message/MessageLayout/MessageBubble/MessageBubble.vue.d.ts +5 -5
  32. package/dist/components/BarrageList/Message/MessageLayout/MessageLayout.js +48 -73
  33. package/dist/components/BarrageList/Message/MessageLayout/MessageLayout.vue.d.ts +5 -7
  34. package/dist/components/BarrageList/Message/TextMessage/TextMessage.js +70 -76
  35. package/dist/components/BarrageList/Message/TextMessage/TextMessage.vue.d.ts +6 -6
  36. package/dist/components/BarrageList/Message/TextMessage/emoji.d.ts +5 -0
  37. package/dist/components/BarrageList/Message/TextMessage/emoji.js +134 -0
  38. package/dist/components/BarrageList/index.d.ts +0 -36
  39. package/dist/components/CameraButton/index.js +18 -19
  40. package/dist/components/CoGuestPanel/CoGuestPanel.js +60 -60
  41. package/dist/components/CoHostPanel/BattlePanel.js +11 -11
  42. package/dist/components/CoHostPanel/CoHostPanel.js +10 -10
  43. package/dist/components/CoHostPanel/ConfigSettingPanel.js +49 -55
  44. package/dist/components/CoHostPanel/ConnectionPanel.js +132 -123
  45. package/dist/components/CoHostPanel/RecommendHostList.js +39 -36
  46. package/dist/components/CoHostPanel/constants.d.ts +3 -0
  47. package/dist/components/CoHostPanel/constants.js +6 -0
  48. package/dist/components/CoHostPanel/i18n/en-US/index.d.ts +1 -0
  49. package/dist/components/CoHostPanel/i18n/en-US/index.js +2 -1
  50. package/dist/components/CoHostPanel/i18n/zh-CN/index.d.ts +1 -0
  51. package/dist/components/CoHostPanel/i18n/zh-CN/index.js +3 -2
  52. package/dist/components/LiveAudienceList/LiveAudienceList.js +44 -45
  53. package/dist/components/LiveAudienceList/LiveAudienceListH5.js +7 -7
  54. package/dist/components/LiveAudienceList/UserActionMenu.js +57 -64
  55. package/dist/components/LiveList/LiveList.js +23 -23
  56. package/dist/components/LiveList/LiveListH5.js +38 -38
  57. package/dist/components/LiveScenePanel/CameraSettingDialog.js +10 -10
  58. package/dist/components/LiveScenePanel/MaterialItem.js +15 -15
  59. package/dist/components/LiveScenePanel/index.js +4 -4
  60. package/dist/components/LiveView/CoreViewDecorate/BattleDecorate.js +58 -58
  61. package/dist/components/LiveView/CoreViewDecorate/BattleUserDecorate.js +6 -6
  62. package/dist/components/LiveView/CoreViewDecorate/CoHostDecorate.js +5 -5
  63. package/dist/components/LiveView/DefaultStreamViewUI.js +44 -41
  64. package/dist/components/LiveView/PlayerControl/AudioControl.js +20 -20
  65. package/dist/components/LiveView/PlayerControl/MultiResolution.js +49 -48
  66. package/dist/components/LiveView/PlayerControl/MultiResolution.vue.d.ts +7 -1
  67. package/dist/components/LiveView/PlayerControl/PlayerControl.js +90 -86
  68. package/dist/components/LiveView/PlayerControl/PlayerControlState.js +127 -131
  69. package/dist/components/LiveView/PlayerControl/utils/domHelpers.d.ts +6 -0
  70. package/dist/components/LiveView/PlayerControl/utils/domHelpers.js +54 -22
  71. package/dist/components/LiveView/i18n/en-US/index.d.ts +2 -2
  72. package/dist/components/LiveView/i18n/en-US/index.js +2 -2
  73. package/dist/components/LiveView/i18n/zh-CN/index.d.ts +2 -2
  74. package/dist/components/LiveView/i18n/zh-CN/index.js +2 -2
  75. package/dist/components/LiveView/index.js +17 -17
  76. package/dist/components/MessageInput/TextEditor/EditorCore.js +2 -2
  77. package/dist/components/MessageList/MessageList.vue.d.ts +2 -2
  78. package/dist/components/MessageList/index.d.ts +18 -18
  79. package/dist/components/MicButton/index.js +11 -11
  80. package/dist/components/StreamMixer/LocalMixer/MixerControl.js +12 -12
  81. package/dist/components/StreamMixer/LocalMixer/index.js +66 -63
  82. package/dist/components/StreamView/Layout/CustomLayout.js +8 -8
  83. package/dist/components/StreamView/Layout/FloatLayout.js +124 -127
  84. package/dist/components/StreamView/Layout/GridLayout.js +5 -5
  85. package/dist/components/StreamView/index.js +25 -33
  86. package/dist/components/StreamView/manager/mediaManager.js +54 -60
  87. package/dist/components/VideoSetting/CameraSelect.js +8 -8
  88. package/dist/components/VideoSetting/VideoMediaControl.js +10 -10
  89. package/dist/components/VideoSetting/VideoPreview.js +9 -9
  90. package/dist/components/VideoSetting/VideoProfile.js +6 -6
  91. package/dist/components/VideoSetting/VideoSettingTab.js +40 -39
  92. package/dist/components/VideoSettingPanel/CameraSelect.js +8 -8
  93. package/dist/components/VideoSettingPanel/VideoPreview.js +1 -1
  94. package/dist/components/VideoSettingPanel/VideoProfile.js +18 -18
  95. package/dist/hooks/useRoomEngine.js +6 -6
  96. package/dist/{index-D2OVtqc8.js → index-BfIEeWMg.js} +191 -181
  97. package/dist/{index-Bm-QfV5o.js → index-DTi1fL-x.js} +460 -457
  98. package/dist/index.js +162 -144
  99. package/dist/report/MetricsKey.d.ts +16 -0
  100. package/dist/report/MetricsKey.js +4 -0
  101. package/dist/report/dataReport.d.ts +12 -0
  102. package/dist/report/dataReport.js +45 -0
  103. package/dist/report/index.d.ts +4 -0
  104. package/dist/report/index.js +6 -0
  105. package/dist/rtc/index.d.ts +5 -43
  106. package/dist/rtc/index.js +48 -48
  107. package/dist/states/BarrageState/BarrageState.d.ts +74 -0
  108. package/dist/states/BarrageState/BarrageState.js +80 -0
  109. package/dist/states/BarrageState/index.d.ts +1 -0
  110. package/dist/states/BarrageState/index.js +5 -0
  111. package/dist/states/{BattleState.d.ts → BattleState/BattleState.d.ts} +10 -11
  112. package/dist/states/BattleState/BattleState.js +203 -0
  113. package/dist/states/BattleState/index.d.ts +1 -0
  114. package/dist/states/BattleState/index.js +4 -0
  115. package/dist/states/CoGuestState.d.ts +24 -94
  116. package/dist/states/CoGuestState.js +297 -189
  117. package/dist/states/CoHostState/CoHostState.d.ts +2 -2
  118. package/dist/states/CoHostState/CoHostState.js +135 -131
  119. package/dist/states/{DeviceState.d.ts → DeviceState/DeviceState.d.ts} +25 -13
  120. package/dist/states/DeviceState/DeviceState.js +314 -0
  121. package/dist/states/DeviceState/index.d.ts +1 -0
  122. package/dist/states/DeviceState/index.js +4 -0
  123. package/dist/states/LiveAudienceState.d.ts +3 -1
  124. package/dist/states/LiveAudienceState.js +106 -63
  125. package/dist/states/{LiveState/index.d.ts → LiveListState/LiveListState.d.ts} +13 -8
  126. package/dist/states/LiveListState/LiveListState.js +285 -0
  127. package/dist/states/LiveListState/index.d.ts +1 -0
  128. package/dist/states/LiveListState/index.js +4 -0
  129. package/dist/states/LiveMonitorState/api/http.js +147 -129
  130. package/dist/states/LiveMonitorState/index.js +67 -62
  131. package/dist/states/LiveSeatState/index.d.ts +46 -11
  132. package/dist/states/LiveSeatState/index.js +34 -15
  133. package/dist/states/LiveSeatState/seatEventManager.d.ts +2 -0
  134. package/dist/states/LiveSeatState/seatEventManager.js +63 -42
  135. package/dist/states/LiveSeatState/seatManager.d.ts +34 -5
  136. package/dist/states/LiveSeatState/seatManager.js +131 -29
  137. package/dist/states/LiveSeatState/store.d.ts +5 -5
  138. package/dist/states/LiveSeatState/store.js +12 -10
  139. package/dist/states/LiveSeatState/usePlayStream/RTCStreamManager.js +1 -1
  140. package/dist/states/LiveSeatState/usePlayStream/RTCStreamPlayer.js +1 -1
  141. package/dist/states/LiveSeatState/usePlayStream/index.js +30 -28
  142. package/dist/states/LoginState.js +39 -34
  143. package/dist/states/SeatStore.js +82 -83
  144. package/dist/states/{VideoMixerState.d.ts → VideoMixerState/VideoMixerState.d.ts} +1 -1
  145. package/dist/states/VideoMixerState/VideoMixerState.js +269 -0
  146. package/dist/states/VideoMixerState/index.d.ts +1 -0
  147. package/dist/states/VideoMixerState/index.js +4 -0
  148. package/dist/styles/index.css +1 -1
  149. package/dist/types/audience.d.ts +21 -0
  150. package/dist/types/audience.js +4 -1
  151. package/dist/types/battle.d.ts +75 -3
  152. package/dist/types/battle.js +5 -1
  153. package/dist/types/coGuest.d.ts +72 -5
  154. package/dist/types/coGuest.js +4 -2
  155. package/dist/types/device.d.ts +38 -17
  156. package/dist/types/device.js +10 -8
  157. package/dist/types/index.d.ts +2 -2
  158. package/dist/types/index.js +96 -80
  159. package/dist/types/live.d.ts +36 -21
  160. package/dist/types/live.js +6 -4
  161. package/dist/types/seat.d.ts +23 -4
  162. package/dist/types/seat.js +7 -1
  163. package/dist/utils/eventCenter.d.ts +88 -0
  164. package/dist/utils/eventCenter.js +161 -0
  165. package/package.json +3 -3
  166. package/src/components/AudioSetting/AudioMediaControl.vue +1 -3
  167. package/src/components/AudioSetting/AudioSettingTab.vue +1 -2
  168. package/src/components/AudioSetting/MicrophoneSelect.vue +1 -2
  169. package/src/components/AudioSetting/SpeakerSelect.vue +1 -2
  170. package/src/components/AudioSettingPanel/i18n/en-US/index.ts +1 -0
  171. package/src/components/AudioSettingPanel/i18n/zh-CN/index.ts +1 -0
  172. package/src/components/AudioSettingPanel/index.vue +4 -2
  173. package/src/components/BarrageInput/BarrageInputH5.vue +1 -1
  174. package/src/components/BarrageInput/EmojiPicker/EmojiPicker.vue +1 -1
  175. package/src/components/BarrageInput/MessageInputState.ts +160 -0
  176. package/src/components/BarrageInput/TextEditor/TextEditor.vue +1 -1
  177. package/src/components/BarrageInput/type.ts +26 -0
  178. package/src/components/BarrageInput/utils.ts +45 -0
  179. package/src/components/BarrageList/BarrageList.vue +61 -117
  180. package/src/components/BarrageList/BarrageListH5.vue +75 -159
  181. package/src/components/BarrageList/BarrageListState.ts +223 -0
  182. package/src/components/BarrageList/Message/MessageLayout/MessageBubble/MessageBubble.vue +8 -55
  183. package/src/components/BarrageList/Message/MessageLayout/MessageLayout.vue +19 -44
  184. package/src/components/BarrageList/Message/TextMessage/TextMessage.vue +69 -96
  185. package/src/components/BarrageList/Message/TextMessage/emoji.ts +132 -0
  186. package/src/components/CameraButton/index.vue +0 -1
  187. package/src/components/CoGuestPanel/CoGuestPanel.vue +16 -91
  188. package/src/components/CoHostPanel/BattlePanel.vue +1 -4
  189. package/src/components/CoHostPanel/ConfigSettingPanel.vue +2 -8
  190. package/src/components/CoHostPanel/ConnectionPanel.vue +37 -33
  191. package/src/components/CoHostPanel/RecommendHostList.vue +12 -13
  192. package/src/components/CoHostPanel/constants.ts +3 -0
  193. package/src/components/CoHostPanel/i18n/en-US/index.ts +1 -0
  194. package/src/components/CoHostPanel/i18n/zh-CN/index.ts +2 -1
  195. package/src/components/LiveAudienceList/LiveAudienceList.vue +4 -5
  196. package/src/components/LiveAudienceList/LiveAudienceListH5.vue +2 -2
  197. package/src/components/LiveAudienceList/UserActionMenu.vue +7 -48
  198. package/src/components/LiveList/LiveList.vue +5 -5
  199. package/src/components/LiveList/LiveListH5.vue +6 -6
  200. package/src/components/LiveScenePanel/index.vue +2 -2
  201. package/src/components/LiveView/CoreViewDecorate/BattleDecorate.vue +10 -15
  202. package/src/components/LiveView/CoreViewDecorate/BattleUserDecorate.vue +2 -2
  203. package/src/components/LiveView/DefaultStreamViewUI.vue +5 -3
  204. package/src/components/LiveView/PlayerControl/AudioControl.vue +1 -1
  205. package/src/components/LiveView/PlayerControl/MultiResolution.vue +9 -3
  206. package/src/components/LiveView/PlayerControl/PlayerControl.vue +10 -2
  207. package/src/components/LiveView/PlayerControl/PlayerControlState.ts +233 -259
  208. package/src/components/LiveView/PlayerControl/utils/domHelpers.ts +64 -0
  209. package/src/components/LiveView/i18n/en-US/index.ts +2 -2
  210. package/src/components/LiveView/i18n/zh-CN/index.ts +2 -2
  211. package/src/components/LiveView/index.vue +2 -2
  212. package/src/components/MicButton/index.vue +3 -3
  213. package/src/components/StreamMixer/LocalMixer/index.vue +6 -8
  214. package/src/components/StreamView/Layout/CustomLayout.vue +2 -2
  215. package/src/components/StreamView/Layout/FloatLayout.vue +88 -83
  216. package/src/components/StreamView/index.vue +28 -14
  217. package/src/components/StreamView/manager/mediaManager.ts +38 -42
  218. package/src/components/VideoSetting/CameraSelect.vue +1 -2
  219. package/src/components/VideoSetting/VideoMediaControl.vue +1 -1
  220. package/src/components/VideoSetting/VideoPreview.vue +1 -2
  221. package/src/components/VideoSetting/VideoProfile.vue +1 -1
  222. package/src/components/VideoSetting/VideoSettingTab.vue +9 -5
  223. package/src/components/VideoSettingPanel/CameraSelect.vue +1 -2
  224. package/src/components/VideoSettingPanel/VideoProfile.vue +7 -7
  225. package/src/hooks/useRoomEngine.ts +1 -1
  226. package/src/report/MetricsKey.ts +16 -0
  227. package/src/report/dataReport.ts +55 -0
  228. package/src/report/index.ts +7 -0
  229. package/src/rtc/index.ts +7 -9
  230. package/src/types/audience.ts +27 -1
  231. package/src/types/battle.ts +87 -4
  232. package/src/types/coGuest.ts +87 -5
  233. package/src/types/device.ts +41 -16
  234. package/src/types/index.ts +2 -2
  235. package/src/types/live.ts +41 -22
  236. package/src/types/seat.ts +28 -4
  237. package/src/utils/eventCenter.ts +249 -0
  238. package/dist/DialogPortal-CvJcEAsn.js +0 -417
  239. package/dist/components/BarrageList/Message/FaceMessage/FaceMessage.js +0 -23
  240. package/dist/components/BarrageList/Message/FaceMessage/FaceMessage.vue.d.ts +0 -30
  241. package/dist/components/BarrageList/Message/FaceMessage/index.d.ts +0 -3
  242. package/dist/components/BarrageList/Message/FaceMessage/index.js +0 -4
  243. package/dist/components/BarrageList/Message/GroupTipMessage/GroupTipMessage.js +0 -4
  244. package/dist/components/BarrageList/Message/GroupTipMessage/GroupTipMessage.vue.d.ts +0 -16
  245. package/dist/components/BarrageList/Message/GroupTipMessage/index.d.ts +0 -3
  246. package/dist/components/BarrageList/Message/GroupTipMessage/index.js +0 -25
  247. package/dist/components/BarrageList/Message/ImageMessage/ImageMessage.js +0 -71
  248. package/dist/components/BarrageList/Message/ImageMessage/ImageMessage.vue.d.ts +0 -34
  249. package/dist/components/BarrageList/Message/ImageMessage/index.d.ts +0 -3
  250. package/dist/components/BarrageList/Message/ImageMessage/index.js +0 -4
  251. package/dist/components/BarrageList/Message/MergerMessage/MergerMessage.js +0 -9
  252. package/dist/components/BarrageList/Message/MergerMessage/MergerMessage.vue.d.ts +0 -2
  253. package/dist/components/BarrageList/Message/MergerMessage/index.d.ts +0 -3
  254. package/dist/components/BarrageList/Message/MergerMessage/index.js +0 -4
  255. package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/MessageMeta.js +0 -40
  256. package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/MessageMeta.vue.d.ts +0 -54
  257. package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/MessageStatusIcon.js +0 -26
  258. package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/MessageStatusIcon.vue.d.ts +0 -15
  259. package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/index.d.ts +0 -3
  260. package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/index.js +0 -4
  261. package/dist/components/BarrageList/Message/RecalledMessage/RecalledMessage.js +0 -41
  262. package/dist/components/BarrageList/Message/RecalledMessage/RecalledMessage.vue.d.ts +0 -35
  263. package/dist/components/BarrageList/Message/RecalledMessage/index.d.ts +0 -3
  264. package/dist/components/BarrageList/Message/RecalledMessage/index.js +0 -4
  265. package/dist/components/BarrageList/MessageForward/ForwardListItem.js +0 -45
  266. package/dist/components/BarrageList/MessageForward/ForwardListItem.vue.d.ts +0 -17
  267. package/dist/components/BarrageList/MessageForward/MessageForward.js +0 -203
  268. package/dist/components/BarrageList/MessageForward/MessageForward.vue.d.ts +0 -2
  269. package/dist/components/BarrageList/MessageForward/index.d.ts +0 -3
  270. package/dist/components/BarrageList/MessageForward/index.js +0 -4
  271. package/dist/components/StreamView/Layout/MixLayout.js +0 -89
  272. package/dist/components/StreamView/Layout/MixLayout.vue.d.ts +0 -31
  273. package/dist/states/BarrageListState/BarrageListState.d.ts +0 -26
  274. package/dist/states/BarrageListState/BarrageListState.js +0 -122
  275. package/dist/states/BarrageListState/index.d.ts +0 -1
  276. package/dist/states/BarrageListState/index.js +0 -4
  277. package/dist/states/BattleState.js +0 -117
  278. package/dist/states/DeviceState.js +0 -296
  279. package/dist/states/LiveState/index.js +0 -254
  280. package/dist/states/VideoMixerState.js +0 -260
  281. package/src/components/BarrageList/Message/FaceMessage/FaceMessage.vue +0 -43
  282. package/src/components/BarrageList/Message/FaceMessage/index.ts +0 -3
  283. package/src/components/BarrageList/Message/GroupTipMessage/GroupTipMessage.vue +0 -55
  284. package/src/components/BarrageList/Message/GroupTipMessage/index.ts +0 -3
  285. package/src/components/BarrageList/Message/ImageMessage/ImageMessage.vue +0 -181
  286. package/src/components/BarrageList/Message/ImageMessage/index.ts +0 -3
  287. package/src/components/BarrageList/Message/MergerMessage/MergerMessage.vue +0 -6
  288. package/src/components/BarrageList/Message/MergerMessage/index.ts +0 -3
  289. package/src/components/BarrageList/Message/MessageLayout/MessageMeta/MessageMeta.vue +0 -70
  290. package/src/components/BarrageList/Message/MessageLayout/MessageMeta/MessageStatusIcon.vue +0 -40
  291. package/src/components/BarrageList/Message/MessageLayout/MessageMeta/index.ts +0 -3
  292. package/src/components/BarrageList/Message/RecalledMessage/RecalledMessage.vue +0 -82
  293. package/src/components/BarrageList/Message/RecalledMessage/index.ts +0 -3
  294. package/src/components/BarrageList/MessageForward/ForwardListItem.vue +0 -67
  295. package/src/components/BarrageList/MessageForward/MessageForward.vue +0 -388
  296. package/src/components/BarrageList/MessageForward/index.ts +0 -3
  297. package/src/components/StreamView/Layout/MixLayout.vue +0 -144
@@ -1,19 +1,18 @@
1
- import { computed as p, ref as t, watch as g } from "vue";
2
- import S, { TUIRoomEvents as c, TUIRequestAction as s, TUIMediaDevice as l } from "@tencentcloud/tuiroom-engine-js";
3
- import { useRoomEngine as A } from "../hooks/useRoomEngine.js";
4
- import { useLiveState as C } from "./LiveState/index.js";
5
- import { useLoginState as q } from "./LoginState.js";
6
- import { LiveStatus as M } from "../types/live.js";
1
+ import { computed as v, ref as t, watch as A } from "vue";
2
+ import S, { TUIRoomEvents as c, TUIRequestAction as a } from "@tencentcloud/tuiroom-engine-js";
3
+ import { useRoomEngine as g } from "../hooks/useRoomEngine.js";
4
+ import { useLoginState as C } from "./LoginState.js";
5
+ import { useLiveListState as O } from "./LiveListState/LiveListState.js";
7
6
  import { DeviceStatus as f } from "../types/device.js";
8
- const { localLiveStatus: O, currentLive: w } = C(), { loginUserInfo: $ } = q(), k = A(), u = p(() => {
7
+ const { currentLive: k } = O(), { loginUserInfo: q } = C(), h = g(), m = v(() => {
9
8
  var e, o;
10
- return ((o = (e = w.value) == null ? void 0 : e.liveOwner) == null ? void 0 : o.userId) || "";
11
- }), y = p(() => {
9
+ return ((o = (e = k.value) == null ? void 0 : e.liveOwner) == null ? void 0 : o.userId) || "";
10
+ }), w = v(() => {
12
11
  var e;
13
- return ((e = $.value) == null ? void 0 : e.userId) || "";
14
- }), R = t(/* @__PURE__ */ new Map()), n = t(/* @__PURE__ */ new Map()), h = t(/* @__PURE__ */ new Map()), I = t([]), L = t([]), U = t([]), d = t(/* @__PURE__ */ new Set()), m = t(/* @__PURE__ */ new Set()), T = async (e) => {
12
+ return ((e = q.value) == null ? void 0 : e.userId) || "";
13
+ }), R = t(/* @__PURE__ */ new Map()), n = t(/* @__PURE__ */ new Map()), p = t(/* @__PURE__ */ new Map()), I = t([]), L = t([]), T = t([]), u = t(/* @__PURE__ */ new Set()), l = t(/* @__PURE__ */ new Set()), U = async (e) => {
15
14
  var i;
16
- const o = await ((i = k.instance) == null ? void 0 : i.getUserInfo({
15
+ const o = await ((i = h.instance) == null ? void 0 : i.getUserInfo({
17
16
  userId: e
18
17
  }));
19
18
  return {
@@ -24,17 +23,14 @@ const { localLiveStatus: O, currentLive: w } = C(), { loginUserInfo: $ } = q(),
24
23
  userRole: o.userRole,
25
24
  isMessageDisabled: o.isMessageDisabled
26
25
  };
27
- }, b = (e) => ({
26
+ }, y = (e) => ({
28
27
  userId: e.userId,
29
28
  userName: e.userName,
30
29
  avatarUrl: e.avatarUrl,
31
30
  customInfo: e.roomCustomInfo,
32
31
  userRole: e.userRole,
33
32
  isMessageDisabled: e.isMessageDisabled
34
- }), v = (e, o) => {
35
- const a = m.value.has(e) || d.value.has(e);
36
- return n.value.has(`${u.value}-${o}`) || R.value.has(`${e}-${o}`) ? f.AdminInviting : a ? f.On : f.Off;
37
- }, N = p(() => I.value.map((e) => {
33
+ }), d = (e, o) => l.value.has(e) || u.value.has(e) ? f.On : f.Off, M = v(() => I.value.map((e) => {
38
34
  const o = e.userId !== "";
39
35
  return {
40
36
  index: e.index,
@@ -46,14 +42,14 @@ const { localLiveStatus: O, currentLive: w } = C(), { loginUserInfo: $ } = q(),
46
42
  userId: e.userId,
47
43
  userName: e.userName,
48
44
  avatarUrl: e.avatarUrl,
49
- microphoneStatus: v(e.userId, l.kMicrophone),
50
- cameraStatus: v(e.userId, l.kCamera),
45
+ microphoneStatus: d(e.userId),
46
+ cameraStatus: d(e.userId),
51
47
  onSeatTimestamp: 0,
52
48
  customInfo: {}
53
49
  } : void 0
54
50
  };
55
- })), D = p(() => L.value.map((e) => {
56
- const o = h.value.get(e.userId);
51
+ })), $ = v(() => L.value.map((e) => {
52
+ const o = p.value.get(e.userId);
57
53
  return {
58
54
  index: 0,
59
55
  // todo engine 未提供
@@ -68,112 +64,115 @@ const { localLiveStatus: O, currentLive: w } = C(), { loginUserInfo: $ } = q(),
68
64
  userId: o.userId,
69
65
  userName: o.userName,
70
66
  avatarUrl: o.avatarUrl,
71
- microphoneStatus: v(o.userId, l.kMicrophone),
72
- cameraStatus: v(o.userId, l.kCamera),
67
+ microphoneStatus: d(o.userId),
68
+ cameraStatus: d(o.userId),
73
69
  onSeatTimestamp: e.joinConnectionTime,
74
70
  networkQuality: void 0,
75
71
  customInfo: o.customInfo
76
72
  } : void 0
77
73
  };
78
- })), E = async ({ request: e }) => {
79
- const { userId: o, requestAction: a } = e;
80
- switch (h.value.set(o, await T(o)), a) {
81
- case s.kRequestToOpenRemoteCamera:
82
- case s.kRequestToOpenRemoteMicrophone:
83
- n.value.set(`${u.value}-${a}`, e);
74
+ })), b = async ({ request: e }) => {
75
+ const { userId: o, requestAction: s } = e;
76
+ switch (p.value.set(o, await U(o)), s) {
77
+ case a.kRequestToOpenRemoteCamera:
78
+ case a.kRequestToOpenRemoteMicrophone:
79
+ n.value.set(`${m.value}-${s}`, e);
84
80
  break;
85
- case s.kApplyToAdminToOpenLocalCamera:
86
- case s.kApplyToAdminToOpenLocalMicrophone:
87
- n.value.set(`${o}-${a}`, e);
81
+ case a.kApplyToAdminToOpenLocalCamera:
82
+ case a.kApplyToAdminToOpenLocalMicrophone:
83
+ n.value.set(`${o}-${s}`, e);
88
84
  break;
89
85
  }
90
- }, V = ({
86
+ }, N = ({
91
87
  requestId: e,
92
88
  userId: o,
93
- request: a,
89
+ request: s,
94
90
  userInfo: i
95
91
  }) => {
96
- const { requestAction: r } = a;
92
+ const { requestAction: r } = s;
97
93
  switch (r) {
98
- case s.kRequestToOpenRemoteCamera:
99
- case s.kRequestToOpenRemoteMicrophone:
100
- n.value.delete(`${u.value}-${r}`);
94
+ case a.kRequestToOpenRemoteCamera:
95
+ case a.kRequestToOpenRemoteMicrophone:
96
+ n.value.delete(`${m.value}-${r}`);
101
97
  break;
102
- case s.kApplyToAdminToOpenLocalCamera:
103
- case s.kApplyToAdminToOpenLocalMicrophone:
98
+ case a.kApplyToAdminToOpenLocalCamera:
99
+ case a.kApplyToAdminToOpenLocalMicrophone:
104
100
  n.value.delete(`${o}-${r}`);
105
101
  break;
106
102
  }
107
- }, x = ({
103
+ }, D = ({
108
104
  requestId: e,
109
105
  userId: o,
110
- request: a,
106
+ request: s,
111
107
  userInfo: i
112
108
  }) => {
113
- const { requestAction: r } = a;
109
+ const { requestAction: r } = s;
114
110
  switch (r) {
115
- case s.kRequestToOpenRemoteCamera:
116
- case s.kRequestToOpenRemoteMicrophone:
117
- n.value.delete(`${u.value}-${r}`);
111
+ case a.kRequestToOpenRemoteCamera:
112
+ case a.kRequestToOpenRemoteMicrophone:
113
+ n.value.delete(`${m.value}-${r}`);
118
114
  break;
119
- case s.kApplyToAdminToOpenLocalCamera:
120
- case s.kApplyToAdminToOpenLocalMicrophone:
115
+ case a.kApplyToAdminToOpenLocalCamera:
116
+ case a.kApplyToAdminToOpenLocalMicrophone:
121
117
  n.value.delete(`${o}-${r}`);
122
118
  break;
123
119
  }
124
- }, P = async (e) => {
120
+ }, E = async (e) => {
125
121
  I.value = e.seatList;
126
- }, Q = ({ userNetworkList: e }) => {
127
- U.value = e;
128
- }, H = ({
122
+ }, V = ({ userNetworkList: e }) => {
123
+ T.value = e;
124
+ }, x = ({
129
125
  userId: e,
130
126
  streamType: o,
131
- hasVideo: a,
127
+ hasVideo: s,
132
128
  reason: i
133
129
  }) => {
134
- a ? d.value.add(e) : d.value.delete(e);
135
- }, j = ({
130
+ s ? u.value.add(e) : u.value.delete(e);
131
+ }, Q = ({
136
132
  userId: e,
137
133
  hasAudio: o,
138
- reason: a
134
+ reason: s
139
135
  }) => {
140
- o ? m.value.add(e) : m.value.delete(e);
141
- }, z = [
142
- { event: c.onRequestReceived, handler: E },
143
- { event: c.onRequestProcessed, handler: V },
144
- { event: c.onRequestCancelled, handler: x },
145
- { event: c.onSeatListChanged, handler: P },
146
- { event: c.onUserNetworkQualityChanged, handler: Q },
147
- { event: c.onUserVideoStateChanged, handler: H },
148
- { event: c.onUserAudioStateChanged, handler: j }
149
- ], B = () => {
150
- z.forEach(({ event: e, handler: o }) => {
151
- var a;
152
- (a = k.instance) == null || a.on(e, o);
136
+ o ? l.value.add(e) : l.value.delete(e);
137
+ }, H = [
138
+ { event: c.onRequestReceived, handler: b },
139
+ { event: c.onRequestProcessed, handler: N },
140
+ { event: c.onRequestCancelled, handler: D },
141
+ { event: c.onSeatListChanged, handler: E },
142
+ { event: c.onUserNetworkQualityChanged, handler: V },
143
+ { event: c.onUserVideoStateChanged, handler: x },
144
+ { event: c.onUserAudioStateChanged, handler: Q }
145
+ ], P = () => {
146
+ H.forEach(({ event: e, handler: o }) => {
147
+ var s;
148
+ (s = h.instance) == null || s.on(e, o);
153
149
  });
154
- }, F = () => {
155
- R.value.clear(), n.value.clear(), h.value.clear(), I.value = [], L.value = [], U.value = [], d.value.clear(), m.value.clear();
150
+ }, j = () => {
151
+ R.value.clear(), n.value.clear(), p.value.clear(), I.value = [], L.value = [], T.value = [], u.value.clear(), l.value.clear();
156
152
  };
157
- g(O, async (e) => {
153
+ A(() => {
154
+ var e;
155
+ return (e = k.value) == null ? void 0 : e.liveId;
156
+ }, async (e) => {
158
157
  var o;
159
- e === M.Live ? I.value = await ((o = k.instance) == null ? void 0 : o.getSeatList()) || [] : F();
158
+ e ? I.value = await ((o = h.instance) == null ? void 0 : o.getSeatList()) || [] : j();
160
159
  });
161
160
  S.once("ready", () => {
162
- B();
161
+ P();
163
162
  });
164
- function _() {
163
+ function W() {
165
164
  return {
166
- liveOwnerUserId: u,
167
- localUserId: y,
168
- seatList: N,
169
- coHostUserList: D,
165
+ liveOwnerUserId: m,
166
+ localUserId: w,
167
+ seatList: M,
168
+ coHostUserList: $,
170
169
  sentDeviceRequestMap: R,
171
170
  receivedDeviceRequestMap: n,
172
- userInfoMap: h,
173
- getUserInfo: T,
174
- convertUserInfoToAudienceInfo: b
171
+ userInfoMap: p,
172
+ getUserInfo: U,
173
+ convertUserInfoToAudienceInfo: y
175
174
  };
176
175
  }
177
176
  export {
178
- _ as useSeatStore
177
+ W as useSeatStore
179
178
  };
@@ -1,4 +1,4 @@
1
- import { TUIVideoQuality, MediaSource } from '../types';
1
+ import { TUIVideoQuality, MediaSource } from '../../types';
2
2
 
3
3
  declare function addMediaSource(source: MediaSource): Promise<void>;
4
4
  declare function updateMediaSource(source: MediaSource, config: Partial<MediaSource>): Promise<void>;
@@ -0,0 +1,269 @@
1
+ import { computed as v, ref as C, watch as F } from "vue";
2
+ import L, { TRTCVideoResolutionMode as m, TRTCVideoResolution as u, TUIRoomDeviceMangerEvents as B, TRTCMediaMixingEvent as f, TUIResolutionMode as w, TUIMediaDeviceType as j, TUIMediaDeviceState as H, TRTCMediaSourceType as c, TRTCVideoRotation as E, TRTCVideoMirrorType as I, TRTCVideoFillMode as _ } from "@tencentcloud/tuiroom-engine-js";
3
+ import { useRoomEngine as W } from "../../hooks/useRoomEngine.js";
4
+ import { objectMerge as K } from "../../utils/utils.js";
5
+ import { dataReport as Q } from "../../report/dataReport.js";
6
+ import { MetricsKey as D } from "../../report/MetricsKey.js";
7
+ import { useLiveListState as N } from "../LiveListState/LiveListState.js";
8
+ import { LiveOrientation as R } from "../../types/live.js";
9
+ import { TUIVideoQuality as a, TUIVideoStreamType as X } from "../../types/types.js";
10
+ const M = W(), { currentLive: h } = N(), S = v(() => {
11
+ var e, i;
12
+ return h.value && ((e = h.value) == null ? void 0 : e.layoutTemplate) >= 200 && ((i = h.value) == null ? void 0 : i.layoutTemplate) <= 599 ? R.Landscape : R.Portrait;
13
+ });
14
+ function $(e) {
15
+ return {
16
+ [a.kVideoQuality_1080p]: {
17
+ fps: 20,
18
+ bitrate: 3e3
19
+ },
20
+ [a.kVideoQuality_720p]: {
21
+ fps: 15,
22
+ bitrate: 1800
23
+ },
24
+ [a.kVideoQuality_540p]: {
25
+ fps: 15,
26
+ bitrate: 1200
27
+ },
28
+ [a.kVideoQuality_360p]: {
29
+ fps: 15,
30
+ bitrate: 800
31
+ }
32
+ }[e];
33
+ }
34
+ function z(e) {
35
+ return {
36
+ [a.kVideoQuality_1080p]: {
37
+ width: 1920,
38
+ height: 1080
39
+ },
40
+ [a.kVideoQuality_720p]: {
41
+ width: 1280,
42
+ height: 720
43
+ },
44
+ [a.kVideoQuality_540p]: {
45
+ width: 960,
46
+ height: 540
47
+ },
48
+ [a.kVideoQuality_360p]: {
49
+ width: 640,
50
+ height: 360
51
+ }
52
+ }[e];
53
+ }
54
+ function Z(e) {
55
+ return {
56
+ [u.TRTCVideoResolution_480_270]: { width: 480, height: 270 },
57
+ [u.TRTCVideoResolution_640_360]: { width: 640, height: 360 },
58
+ [u.TRTCVideoResolution_960_540]: { width: 960, height: 540 },
59
+ [u.TRTCVideoResolution_1280_720]: { width: 1280, height: 720 },
60
+ [u.TRTCVideoResolution_1920_1080]: { width: 1920, height: 1080 }
61
+ }[e] || { width: 1280, height: 720 };
62
+ }
63
+ const y = C(a.kVideoQuality_720p), q = v(() => {
64
+ const { width: e, height: i } = z(y.value);
65
+ return S.value === R.Portrait ? i : e;
66
+ }), G = v(() => {
67
+ const { width: e, height: i } = z(y.value);
68
+ return S.value === R.Portrait ? e : i;
69
+ });
70
+ function J(e) {
71
+ return {
72
+ [a.kVideoQuality_1080p]: u.TRTCVideoResolution_1920_1080,
73
+ [a.kVideoQuality_720p]: u.TRTCVideoResolution_1280_720,
74
+ [a.kVideoQuality_540p]: u.TRTCVideoResolution_960_540,
75
+ [a.kVideoQuality_360p]: u.TRTCVideoResolution_640_360
76
+ }[e];
77
+ }
78
+ function Y(e) {
79
+ return {
80
+ [u.TRTCVideoResolution_1920_1080]: a.kVideoQuality_1080p,
81
+ [u.TRTCVideoResolution_1280_720]: a.kVideoQuality_720p,
82
+ [u.TRTCVideoResolution_960_540]: a.kVideoQuality_540p,
83
+ [u.TRTCVideoResolution_640_360]: a.kVideoQuality_360p
84
+ }[e];
85
+ }
86
+ function ee(e) {
87
+ return {
88
+ [m.TRTCVideoResolutionModePortrait]: w.kResolutionMode_Portrait,
89
+ [m.TRTCVideoResolutionModeLandscape]: w.kResolutionMode_Landscape
90
+ }[e];
91
+ }
92
+ const T = v(() => {
93
+ const { fps: e, bitrate: i } = $(y.value);
94
+ return {
95
+ videoEncoderParams: {
96
+ videoResolution: J(y.value),
97
+ resMode: S.value === R.Portrait ? m.TRTCVideoResolutionModePortrait : m.TRTCVideoResolutionModeLandscape,
98
+ videoFps: e,
99
+ videoBitrate: i
100
+ }
101
+ };
102
+ }), g = C(!1), d = C([]), V = v(() => d.value.find((e) => e.isSelected) || null);
103
+ let s;
104
+ function k(e) {
105
+ if (V.value) {
106
+ const i = d.value.find((o) => o.id === V.value.id) || null;
107
+ i && (i.isSelected = !1);
108
+ }
109
+ if (e) {
110
+ const i = d.value.find((o) => o.id === e.id) || null;
111
+ i && (i.isSelected = !0);
112
+ }
113
+ }
114
+ async function O() {
115
+ var e;
116
+ T.value && await ((e = M.instance) == null ? void 0 : e.updateVideoQualityEx({
117
+ streamType: X.kCameraStream,
118
+ encoderParams: {
119
+ videoResolution: Y(T.value.videoEncoderParams.videoResolution),
120
+ fps: T.value.videoEncoderParams.videoFps,
121
+ bitrate: T.value.videoEncoderParams.videoBitrate,
122
+ resolutionMode: ee(T.value.videoEncoderParams.resMode)
123
+ }
124
+ }));
125
+ }
126
+ F(
127
+ () => T.value,
128
+ async () => {
129
+ await s && s.updatePublishParams(T.value), await O();
130
+ },
131
+ { immediate: !0, deep: !0 }
132
+ );
133
+ let p = 1;
134
+ function P(e) {
135
+ var i, o;
136
+ if (e.type === c.kCamera || e.type === c.kScreen) {
137
+ let t, r;
138
+ e.type === c.kCamera ? (t = ((i = e.camera) == null ? void 0 : i.resolution) || u.TRTCVideoResolution_1280_720, r = _.TRTCVideoFillMode_Fill) : e.type === c.kScreen && (t = ((o = e.screen) == null ? void 0 : o.resolution) || u.TRTCVideoResolution_1920_1080, r = _.TRTCVideoFillMode_Fit);
139
+ const { width: n, height: l } = Z(t), b = Math.min(q.value / n, G.value / l), A = {
140
+ rect: {
141
+ left: 0,
142
+ top: 0,
143
+ right: n * b,
144
+ bottom: l * b
145
+ },
146
+ zOrder: p,
147
+ fillMode: r,
148
+ mirror: I.TRTCVideoMirrorType_Disable,
149
+ rotation: E.TRTCVideoRotation_0
150
+ };
151
+ return p += 1, A;
152
+ }
153
+ if (e.type === c.kText) {
154
+ const t = {
155
+ rect: {
156
+ left: 20,
157
+ top: 400,
158
+ right: 220,
159
+ bottom: 500
160
+ },
161
+ zOrder: p
162
+ };
163
+ return p += 1, t;
164
+ }
165
+ if (e.type === c.kImage || e.type === c.kVideo) {
166
+ const t = {
167
+ rect: {
168
+ left: 0,
169
+ top: 0,
170
+ right: 400,
171
+ bottom: 300
172
+ },
173
+ zOrder: p,
174
+ fillMode: _.TRTCVideoFillMode_Fit,
175
+ mirror: I.TRTCVideoMirrorType_Disable,
176
+ rotation: E.TRTCVideoRotation_0
177
+ };
178
+ return p += 1, t;
179
+ }
180
+ return null;
181
+ }
182
+ async function ie(e) {
183
+ var i, o, t, r;
184
+ if (e.type === c.kCamera) {
185
+ const n = D.T_METRICS_STATE_API_VIDEO_MIXER_ADD_MEDIA_CAMERA_COUNT;
186
+ Q.reportCount(n);
187
+ try {
188
+ (await navigator.mediaDevices.getUserMedia({ audio: !1, video: !0 })).getVideoTracks()[0].stop();
189
+ } catch (l) {
190
+ throw l;
191
+ }
192
+ }
193
+ if (e.type === c.kScreen) {
194
+ const n = D.T_METRICS_STATE_API_VIDEO_MIXER_ADD_MEDIA_SCREEN_COUNT;
195
+ Q.reportCount(n);
196
+ }
197
+ e.layout ? e.layout = Object.assign({}, P(e), e.layout) : e.layout = P(e), e.type === c.kText && (e.text = {
198
+ content: ((i = e.text) == null ? void 0 : i.content) || "",
199
+ color: (o = e.text) == null ? void 0 : o.fontColor,
200
+ font: `${(t = e.text) == null ? void 0 : t.fontSize}px ${(r = e.text) == null ? void 0 : r.fontFamily}`
201
+ }), await s.addMediaSource(e), d.value.push(e), k(e);
202
+ }
203
+ async function te(e, i) {
204
+ const o = K(e, i);
205
+ await s.updateMediaSource(o), e.isSelected && k(o);
206
+ const t = d.value.findIndex((r) => r.id === e.id);
207
+ t !== -1 && (d.value[t] = o);
208
+ }
209
+ async function oe(e) {
210
+ await s.removeMediaSource(e), d.value = d.value.filter((i) => i.id !== e.id);
211
+ }
212
+ function ae() {
213
+ g.value = !0, U();
214
+ }
215
+ function ne() {
216
+ d.value.forEach(async (e) => {
217
+ await s.removeMediaSource(e);
218
+ }), d.value = [];
219
+ }
220
+ async function de(e) {
221
+ const { deviceId: i, type: o, state: t } = e;
222
+ o === j.kMediaDeviceTypeVideoCamera && t === H.kMediaDeviceStateAdd && d.value.filter((n) => {
223
+ var l;
224
+ return ((l = n.camera) == null ? void 0 : l.cameraId) === i;
225
+ }).forEach(async (n) => {
226
+ await s.updateMediaSource(n);
227
+ });
228
+ }
229
+ async function U() {
230
+ var i, o;
231
+ if (!M.instance) return;
232
+ ((i = M.instance) == null ? void 0 : i.getMediaDeviceManager()).on(B.onDeviceChanged, de), s = (o = M.instance) == null ? void 0 : o.getTRTCCloud().getMediaMixingManager(), s.updatePublishParams(T.value), s.on(f.onSourceSelected, (t) => {
233
+ k(t);
234
+ }), s.on(f.onSourceDisconnected, (t) => {
235
+ t && t.id && (d.value = d.value.filter((r) => r.id !== t.id));
236
+ }), s.on(f.onSourceMoved, (t, r) => {
237
+ const n = d.value.find((l) => l.id === t.id && l.type === t.type) || null;
238
+ n && (n.layout.rect = r);
239
+ }), s.on(f.onSourceResized, (t, r) => {
240
+ const n = d.value.find((l) => l.id === t.id && l.type === t.type) || null;
241
+ n && (n.layout.rect = r);
242
+ }), s.on(f.onRightButtonClicked, (t) => {
243
+ });
244
+ }
245
+ L.once("ready", async () => {
246
+ g.value && await U();
247
+ });
248
+ let x = !1;
249
+ function re() {
250
+ x || (L.once("ready", async () => {
251
+ await O();
252
+ }), x = !0);
253
+ }
254
+ function ve() {
255
+ return re(), {
256
+ isVideoMixerEnabled: g,
257
+ publishVideoQuality: y,
258
+ mediaSourceList: d,
259
+ activeMediaSource: V,
260
+ enableLocalVideoMixer: ae,
261
+ addMediaSource: ie,
262
+ updateMediaSource: te,
263
+ removeMediaSource: oe,
264
+ clearMediaSource: ne
265
+ };
266
+ }
267
+ export {
268
+ ve as useVideoMixerState
269
+ };
@@ -0,0 +1 @@
1
+ export { useVideoMixerState } from './VideoMixerState';
@@ -0,0 +1,4 @@
1
+ import { useVideoMixerState as r } from "./VideoMixerState.js";
2
+ export {
3
+ r as useVideoMixerState
4
+ };