tuikit-atomicx-vue3 3.4.2 → 4.3.0

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 +2 -2
  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,254 +0,0 @@
1
- import { ref as f, watch as I, nextTick as U } from "vue";
2
- import T, { TUIRoomEvents as d, TUILiveLayoutManagerEvents as M, TUILiveListManagerEvents as C, TUILiveModifyFlag as c, TUIRoomType as D } from "@tencentcloud/tuiroom-engine-js";
3
- import { useRoomEngine as O } from "../../hooks/useRoomEngine.js";
4
- import V from "../../rtc/server.js";
5
- import { LiveType as m, LiveStatus as l } from "../../types/live.js";
6
- import { TUISeatMode as R } from "../../types/types.js";
7
- import { useConversationListState as P } from "../ConversationListState/ConversationListState.js";
8
- const b = V.getInstance(), { setActiveConversation: k } = P(), r = O(), g = f([]), w = f(""), y = {
9
- liveId: "",
10
- liveName: "",
11
- liveType: m.kLive,
12
- liveDescription: "",
13
- categoryList: [],
14
- coverUrl: "",
15
- backgroundUrl: "",
16
- liveOwner: {
17
- userId: "",
18
- userName: "",
19
- avatarUrl: "",
20
- customInfo: {}
21
- },
22
- currentViewerCount: 0,
23
- totalViewerCount: 0,
24
- createTime: 0,
25
- isMessageDisable: !1,
26
- isGiftEnabled: !1,
27
- isPublicVisible: !1,
28
- isSeatEnabled: !1,
29
- seatMode: R.kFreeToTake,
30
- maxSeatCount: 0,
31
- layoutTemplate: 0,
32
- customInfo: {}
33
- }, E = (e) => ({
34
- liveId: e.roomId,
35
- liveName: e.name,
36
- liveType: m.kLive,
37
- // todo
38
- liveDescription: "",
39
- // todo
40
- categoryList: e.categoryList,
41
- coverUrl: e.coverUrl,
42
- backgroundUrl: e.backgroundUrl,
43
- liveOwner: {
44
- userId: e.roomOwner || "",
45
- userName: e.ownerName || "",
46
- avatarUrl: e.ownerAvatarUrl || "",
47
- customInfo: {}
48
- // todo
49
- },
50
- currentViewerCount: e.totalViewers || 0,
51
- totalViewerCount: e.totalViewers || 0,
52
- createTime: e.createTime || 0,
53
- isMessageDisable: e.isMessageDisableForAllUser,
54
- isGiftEnabled: e.isGiftEnabled,
55
- isPublicVisible: e.isPublicVisible,
56
- isSeatEnabled: e.isSeatEnabled,
57
- seatMode: e.seatMode,
58
- maxSeatCount: e.maxSeatCount,
59
- layoutTemplate: e.seatLayoutTemplateId,
60
- customInfo: {}
61
- }), a = f({ ...y }), s = f(l.IDLE), S = (e) => {
62
- a.value = { ...E(e) };
63
- }, G = async (e) => {
64
- var o, t;
65
- b.isLogin.value || await b.login();
66
- try {
67
- console.log("[liveState createLive] create live", e);
68
- const i = await ((t = (o = r.instance) == null ? void 0 : o.getLiveListManager()) == null ? void 0 : t.startLive({
69
- roomId: e.liveId,
70
- roomType: D.kLive,
71
- name: e.liveName,
72
- notice: e.notice,
73
- isMessageDisableForAllUser: e.isMessageDisableForAllUser,
74
- isGiftEnabled: e.isGiftEnabled,
75
- isLikeEnabled: e.isLikeEnabled,
76
- isPublicVisible: e.isPublicVisible,
77
- isSeatEnabled: e.isSeatEnabled,
78
- keepOwnerOnSeat: e.keepOwnerOnSeat,
79
- seatLayoutTemplateId: e.seatLayoutTemplateId,
80
- maxSeatCount: e.maxSeatCount,
81
- seatMode: e.seatMode,
82
- coverUrl: e.coverUrl,
83
- backgroundUrl: e.backgroundUrl,
84
- categoryList: e.categoryList,
85
- activityStatus: e.activityStatus
86
- }));
87
- if (!i)
88
- throw new Error("[liveState createLive] create live failed");
89
- S(i), s.value = l.NotStarted;
90
- } catch (i) {
91
- throw console.error("[liveState createLive] error", i), i;
92
- }
93
- }, N = async ({ liveId: e }) => {
94
- var t;
95
- b.isLogin.value || await b.login(), console.log("[liveState joinLive] enter room", e);
96
- const o = (t = r.instance) == null ? void 0 : t.getLiveListManager();
97
- try {
98
- await k(`GROUP${e}`);
99
- const i = await (o == null ? void 0 : o.joinLive(e));
100
- if (!i)
101
- throw new Error("[liveState joinLive] join live failed");
102
- S(i), s.value = l.Live;
103
- } catch (i) {
104
- throw console.error("[liveState joinLive] error", i), i;
105
- }
106
- }, x = async () => {
107
- var e, o;
108
- try {
109
- console.log("[liveState leaveLive] leave room"), await ((o = (e = r.instance) == null ? void 0 : e.getLiveListManager()) == null ? void 0 : o.leaveLive()), s.value = l.IDLE, a.value = { ...y };
110
- } catch (t) {
111
- throw console.error("[liveState leaveLive] error", t), t;
112
- }
113
- }, j = async () => {
114
- var e, o;
115
- try {
116
- console.log("[liveState endLive] destroy room"), await ((o = (e = r.instance) == null ? void 0 : e.getLiveListManager()) == null ? void 0 : o.stopLive()), a.value = { ...y }, s.value = l.IDLE;
117
- } catch (t) {
118
- throw console.error("[liveState endLive] error", t), t;
119
- }
120
- }, p = async (e) => {
121
- var o;
122
- if (!a.value) {
123
- a.value = { ...y, ...e };
124
- return;
125
- }
126
- if (!a.value.liveId) {
127
- Object.assign(a.value, { ...e });
128
- return;
129
- }
130
- try {
131
- console.log("[liveState updateLiveInfo]", JSON.stringify(e));
132
- const t = (o = r.instance) == null ? void 0 : o.getLiveListManager(), i = {
133
- roomId: e.liveId || a.value.liveId
134
- };
135
- e.activityStatus && (i.activityStatus = e.activityStatus), e.categoryList && (i.categoryList = e.categoryList), e.coverUrl && (i.coverUrl = e.coverUrl), e.backgroundUrl && (i.backgroundUrl = e.backgroundUrl), e.isPublicVisible && (i.isPublicVisible = e.isPublicVisible), e.layoutTemplate && (i.seatLayoutTemplateId = e.layoutTemplate), await (t == null ? void 0 : t.setLiveInfo(i));
136
- const n = await (t == null ? void 0 : t.getLiveInfo({ roomId: i.roomId }));
137
- if (!n)
138
- throw new Error("[liveState updateLiveInfo] update live info failed");
139
- S(n);
140
- } catch (t) {
141
- throw console.error("[liveState updateLiveInfo] error", t), t;
142
- }
143
- }, A = async ({
144
- category: e,
145
- cursor: o = "",
146
- count: t = 20
147
- }) => {
148
- if (!r.instance) {
149
- console.error("[liveState fetchLiveList] RoomEngine instance is not ready");
150
- return;
151
- }
152
- try {
153
- const i = r.instance.getLiveListManager();
154
- if (!i)
155
- throw console.error("[liveState fetchLiveList] get live list manager failed"), new Error("[liveState fetchLiveList] get live list manager failed");
156
- const n = await i.fetchLiveList({
157
- cursor: o,
158
- count: t
159
- }), v = n.liveInfoList.map((u) => E(u)), L = new Set(g.value.map((u) => u.liveId)), h = v.filter((u) => !L.has(u.liveId));
160
- g.value = [...g.value, ...h], w.value = n.cursor;
161
- } catch (i) {
162
- throw console.error("[liveState fetchLiveList] error", i), i;
163
- }
164
- }, F = async (e) => {
165
- console.log("[liveState onRoomDismissed]", e), s.value = l.Ended, a.value = null, await U(), s.value = l.IDLE;
166
- }, K = ({ roomId: e, seatMode: o }) => {
167
- a.value && a.value.liveId === e && (a.value.seatMode = o);
168
- }, B = ({ liveInfo: e, modifyFlag: o }) => {
169
- if (console.log("[liveState onLiveInfoChanged]", e, o), !!a.value)
170
- switch (o) {
171
- case c.kActivityStatus:
172
- break;
173
- case c.kBackgroundUrl:
174
- a.value.backgroundUrl = e.backgroundUrl;
175
- break;
176
- case c.kCategory:
177
- break;
178
- case c.kCoverUrl:
179
- a.value.coverUrl = e.coverUrl;
180
- break;
181
- case c.kEnableGift:
182
- a.value.isGiftEnabled = e.isGiftEnabled;
183
- break;
184
- case c.kEnableLike:
185
- break;
186
- case c.kNone:
187
- break;
188
- case c.kPublic:
189
- a.value.isPublicVisible = e.isPublicVisible;
190
- break;
191
- }
192
- }, J = ({ roomId: e, seatLayout: o }) => {
193
- var t;
194
- e === ((t = a.value) == null ? void 0 : t.liveId) && a.value && (a.value.layoutTemplate = o.templateId);
195
- }, $ = () => {
196
- s.value = l.IDLE, a.value = null;
197
- }, q = () => {
198
- s.value = l.IDLE, a.value = null;
199
- }, z = [
200
- { event: d.onRoomDismissed, handler: F },
201
- { event: d.onKickedOutOfRoom, handler: $ },
202
- { event: d.onKickedOffLine, handler: q },
203
- {
204
- event: d.onRoomSeatModeChanged,
205
- handler: K
206
- }
207
- ], H = [
208
- {
209
- event: C.onLiveInfoChanged,
210
- handler: B
211
- }
212
- ], Q = [
213
- {
214
- event: M.onSeatLayoutChanged,
215
- handler: J
216
- }
217
- ], W = () => {
218
- var t, i;
219
- const e = (t = r.instance) == null ? void 0 : t.getLiveLayoutManager(), o = (i = r.instance) == null ? void 0 : i.getLiveListManager();
220
- z.forEach(({ event: n, handler: v }) => {
221
- var L;
222
- (L = r.instance) == null || L.on(n, v);
223
- }), e && Q.forEach(({ event: n, handler: v }) => {
224
- e.on(n, v);
225
- }), o && H.forEach(({ event: n, handler: v }) => {
226
- o.on(n, v);
227
- });
228
- };
229
- I(s, (e) => {
230
- e === l.IDLE && k("");
231
- });
232
- T.once("ready", () => {
233
- W();
234
- });
235
- function oe() {
236
- return {
237
- // 响应式数据
238
- liveList: g,
239
- currentCursor: w,
240
- currentLive: a,
241
- localLiveStatus: s,
242
- // 操作接口
243
- fetchLiveList: A,
244
- createLive: G,
245
- joinLive: N,
246
- leaveLive: x,
247
- endLive: j,
248
- updateLiveInfo: p
249
- };
250
- }
251
- export {
252
- oe as default,
253
- oe as useLiveState
254
- };
@@ -1,260 +0,0 @@
1
- import { computed as R, ref as g, watch as U } from "vue";
2
- import L, { TRTCVideoResolutionMode as h, TRTCVideoResolution as u, TUIRoomDeviceMangerEvents as O, TRTCMediaMixingEvent as f, TUIResolutionMode as w, TUIMediaDeviceType as B, TUIMediaDeviceState as j, TRTCMediaSourceType as c, TRTCVideoRotation as Q, TRTCVideoMirrorType as P, TRTCVideoFillMode as V } from "@tencentcloud/tuiroom-engine-js";
3
- import { useRoomEngine as H } from "../hooks/useRoomEngine.js";
4
- import { useLiveState as W } from "./LiveState/index.js";
5
- import { objectMerge as A } from "../utils/utils.js";
6
- import { LiveOrientation as v } from "../types/live.js";
7
- import { TUIVideoQuality as a, TUIVideoStreamType as $ } from "../types/types.js";
8
- const M = H(), { currentLive: m } = W(), C = R(() => {
9
- var e, i;
10
- return m.value && ((e = m.value) == null ? void 0 : e.layoutTemplate) >= 200 && ((i = m.value) == null ? void 0 : i.layoutTemplate) <= 599 ? v.Landscape : v.Portrait;
11
- });
12
- function Z(e) {
13
- return {
14
- [a.kVideoQuality_1080p]: {
15
- fps: 20,
16
- bitrate: 3e3
17
- },
18
- [a.kVideoQuality_720p]: {
19
- fps: 15,
20
- bitrate: 1800
21
- },
22
- [a.kVideoQuality_540p]: {
23
- fps: 15,
24
- bitrate: 1200
25
- },
26
- [a.kVideoQuality_360p]: {
27
- fps: 15,
28
- bitrate: 800
29
- }
30
- }[e];
31
- }
32
- function z(e) {
33
- return {
34
- [a.kVideoQuality_1080p]: {
35
- width: 1920,
36
- height: 1080
37
- },
38
- [a.kVideoQuality_720p]: {
39
- width: 1280,
40
- height: 720
41
- },
42
- [a.kVideoQuality_540p]: {
43
- width: 960,
44
- height: 540
45
- },
46
- [a.kVideoQuality_360p]: {
47
- width: 640,
48
- height: 360
49
- }
50
- }[e];
51
- }
52
- function q(e) {
53
- return {
54
- [u.TRTCVideoResolution_480_270]: { width: 480, height: 270 },
55
- [u.TRTCVideoResolution_640_360]: { width: 640, height: 360 },
56
- [u.TRTCVideoResolution_960_540]: { width: 960, height: 540 },
57
- [u.TRTCVideoResolution_1280_720]: { width: 1280, height: 720 },
58
- [u.TRTCVideoResolution_1920_1080]: { width: 1920, height: 1080 }
59
- }[e] || { width: 1280, height: 720 };
60
- }
61
- const y = g(a.kVideoQuality_720p), G = R(() => {
62
- const { width: e, height: i } = z(y.value);
63
- return C.value === v.Portrait ? i : e;
64
- }), J = R(() => {
65
- const { width: e, height: i } = z(y.value);
66
- return C.value === v.Portrait ? e : i;
67
- });
68
- function K(e) {
69
- return {
70
- [a.kVideoQuality_1080p]: u.TRTCVideoResolution_1920_1080,
71
- [a.kVideoQuality_720p]: u.TRTCVideoResolution_1280_720,
72
- [a.kVideoQuality_540p]: u.TRTCVideoResolution_960_540,
73
- [a.kVideoQuality_360p]: u.TRTCVideoResolution_640_360
74
- }[e];
75
- }
76
- function N(e) {
77
- return {
78
- [u.TRTCVideoResolution_1920_1080]: a.kVideoQuality_1080p,
79
- [u.TRTCVideoResolution_1280_720]: a.kVideoQuality_720p,
80
- [u.TRTCVideoResolution_960_540]: a.kVideoQuality_540p,
81
- [u.TRTCVideoResolution_640_360]: a.kVideoQuality_360p
82
- }[e];
83
- }
84
- function X(e) {
85
- return {
86
- [h.TRTCVideoResolutionModePortrait]: w.kResolutionMode_Portrait,
87
- [h.TRTCVideoResolutionModeLandscape]: w.kResolutionMode_Landscape
88
- }[e];
89
- }
90
- const T = R(() => {
91
- const { fps: e, bitrate: i } = Z(y.value);
92
- return {
93
- videoEncoderParams: {
94
- videoResolution: K(y.value),
95
- resMode: C.value === v.Portrait ? h.TRTCVideoResolutionModePortrait : h.TRTCVideoResolutionModeLandscape,
96
- videoFps: e,
97
- videoBitrate: i
98
- }
99
- };
100
- }), S = g(!1), n = g([]), _ = R(() => n.value.find((e) => e.isSelected) || null);
101
- let l;
102
- function k(e) {
103
- if (_.value) {
104
- const i = n.value.find((o) => o.id === _.value.id) || null;
105
- i && (i.isSelected = !1);
106
- }
107
- if (e) {
108
- const i = n.value.find((o) => o.id === e.id) || null;
109
- i && (i.isSelected = !0);
110
- }
111
- }
112
- async function I() {
113
- var e;
114
- T.value && await ((e = M.instance) == null ? void 0 : e.updateVideoQualityEx({
115
- streamType: $.kCameraStream,
116
- encoderParams: {
117
- videoResolution: N(T.value.videoEncoderParams.videoResolution),
118
- fps: T.value.videoEncoderParams.videoFps,
119
- bitrate: T.value.videoEncoderParams.videoBitrate,
120
- resolutionMode: X(T.value.videoEncoderParams.resMode)
121
- }
122
- }));
123
- }
124
- U(
125
- () => T.value,
126
- async () => {
127
- await l && l.updatePublishParams(T.value), await I();
128
- },
129
- { immediate: !0, deep: !0 }
130
- );
131
- let p = 1;
132
- function x(e) {
133
- var i, o;
134
- if (e.type === c.kCamera || e.type === c.kScreen) {
135
- let t, d;
136
- e.type === c.kCamera ? (t = ((i = e.camera) == null ? void 0 : i.resolution) || u.TRTCVideoResolution_1280_720, d = V.TRTCVideoFillMode_Fill) : e.type === c.kScreen && (t = ((o = e.screen) == null ? void 0 : o.resolution) || u.TRTCVideoResolution_1920_1080, d = V.TRTCVideoFillMode_Fit);
137
- const { width: r, height: s } = q(t), b = Math.min(G.value / r, J.value / s), F = {
138
- rect: {
139
- left: 0,
140
- top: 0,
141
- right: r * b,
142
- bottom: s * b
143
- },
144
- zOrder: p,
145
- fillMode: d,
146
- mirror: P.TRTCVideoMirrorType_Disable,
147
- rotation: Q.TRTCVideoRotation_0
148
- };
149
- return p += 1, F;
150
- }
151
- if (e.type === c.kText) {
152
- const t = {
153
- rect: {
154
- left: 20,
155
- top: 400,
156
- right: 220,
157
- bottom: 500
158
- },
159
- zOrder: p
160
- };
161
- return p += 1, t;
162
- }
163
- if (e.type === c.kImage || e.type === c.kVideo) {
164
- const t = {
165
- rect: {
166
- left: 0,
167
- top: 0,
168
- right: 400,
169
- bottom: 300
170
- },
171
- zOrder: p,
172
- fillMode: V.TRTCVideoFillMode_Fit,
173
- mirror: P.TRTCVideoMirrorType_Disable,
174
- rotation: Q.TRTCVideoRotation_0
175
- };
176
- return p += 1, t;
177
- }
178
- return null;
179
- }
180
- async function Y(e) {
181
- var i, o, t, d;
182
- if (e.type === c.kCamera)
183
- try {
184
- (await navigator.mediaDevices.getUserMedia({ audio: !1, video: !0 })).getVideoTracks()[0].stop();
185
- } catch (r) {
186
- throw r;
187
- }
188
- e.layout ? e.layout = Object.assign({}, x(e), e.layout) : e.layout = x(e), e.type === c.kText && (e.text = {
189
- content: ((i = e.text) == null ? void 0 : i.content) || "",
190
- color: (o = e.text) == null ? void 0 : o.fontColor,
191
- font: `${(t = e.text) == null ? void 0 : t.fontSize}px ${(d = e.text) == null ? void 0 : d.fontFamily}`
192
- }), await l.addMediaSource(e), n.value.push(e), k(e);
193
- }
194
- async function ee(e, i) {
195
- const o = A(e, i);
196
- await l.updateMediaSource(o), e.isSelected && k(o);
197
- const t = n.value.findIndex((d) => d.id === e.id);
198
- t !== -1 && (n.value[t] = o);
199
- }
200
- async function ie(e) {
201
- await l.removeMediaSource(e), n.value = n.value.filter((i) => i.id !== e.id);
202
- }
203
- function te() {
204
- S.value = !0, E();
205
- }
206
- function oe() {
207
- n.value.forEach(async (e) => {
208
- await l.removeMediaSource(e);
209
- }), n.value = [];
210
- }
211
- async function ae(e) {
212
- const { deviceId: i, type: o, state: t } = e;
213
- o === B.kMediaDeviceTypeVideoCamera && t === j.kMediaDeviceStateAdd && n.value.filter((r) => {
214
- var s;
215
- return ((s = r.camera) == null ? void 0 : s.cameraId) === i;
216
- }).forEach(async (r) => {
217
- await l.updateMediaSource(r);
218
- });
219
- }
220
- async function E() {
221
- var i, o;
222
- if (!M.instance) return;
223
- ((i = M.instance) == null ? void 0 : i.getMediaDeviceManager()).on(O.onDeviceChanged, ae), l = (o = M.instance) == null ? void 0 : o.getTRTCCloud().getMediaMixingManager(), l.updatePublishParams(T.value), l.on(f.onSourceSelected, (t) => {
224
- k(t);
225
- }), l.on(f.onSourceDisconnected, (t) => {
226
- t && t.id && (n.value = n.value.filter((d) => d.id !== t.id));
227
- }), l.on(f.onSourceMoved, (t, d) => {
228
- const r = n.value.find((s) => s.id === t.id && s.type === t.type) || null;
229
- r && (r.layout.rect = d);
230
- }), l.on(f.onSourceResized, (t, d) => {
231
- const r = n.value.find((s) => s.id === t.id && s.type === t.type) || null;
232
- r && (r.layout.rect = d);
233
- }), l.on(f.onRightButtonClicked, (t) => {
234
- });
235
- }
236
- L.once("ready", async () => {
237
- S.value && await E();
238
- });
239
- let D = !1;
240
- function ne() {
241
- D || (L.once("ready", async () => {
242
- await I();
243
- }), D = !0);
244
- }
245
- function pe() {
246
- return ne(), {
247
- isVideoMixerEnabled: S,
248
- publishVideoQuality: y,
249
- mediaSourceList: n,
250
- activeMediaSource: _,
251
- enableLocalVideoMixer: te,
252
- addMediaSource: Y,
253
- updateMediaSource: ee,
254
- removeMediaSource: ie,
255
- clearMediaSource: oe
256
- };
257
- }
258
- export {
259
- pe as useVideoMixerState
260
- };
@@ -1,43 +0,0 @@
1
- <template>
2
- <div :class="cs('face-message')">
3
- <img
4
- :src="messageContent.url"
5
- :alt="messageContent.name"
6
- >
7
- </div>
8
- </template>
9
-
10
- <script lang="ts" setup>
11
- import cs from 'classnames';
12
- import type { IMessageModel } from '@tencentcloud/chat-uikit-engine';
13
-
14
- interface IFaceMessageProps {
15
- message: IMessageModel;
16
- }
17
-
18
- interface IFaceMessageContent {
19
- /** sender show name */
20
- showName: string;
21
- /** face image name [yz00@2x] */
22
- name: string;
23
- /** face image type[duplicate] */
24
- type: string;
25
- /** face image url */
26
- url: string;
27
- }
28
-
29
- const props = withDefaults(defineProps<IFaceMessageProps>(), {
30
- message: () => ({} as IMessageModel),
31
- });
32
-
33
- const messageContent = props.message.getMessageContent() as IFaceMessageContent;
34
- </script>
35
-
36
- <style lang="scss" scoped>
37
- .face-message {
38
- // Face message styles will be implemented here
39
- width: 150px;
40
- height: 150px;
41
- padding: 10px;
42
- }
43
- </style>
@@ -1,3 +0,0 @@
1
- import FaceMessage from './FaceMessage.vue';
2
-
3
- export { FaceMessage };
@@ -1,55 +0,0 @@
1
- <script lang="ts" setup>
2
- import { defineProps } from 'vue';
3
- import { useUIKit } from '@tencentcloud/uikit-base-component-vue3';
4
- import cs from 'classnames';
5
- import type { IMessageModel as MessageModel } from '@tencentcloud/chat-uikit-engine';
6
-
7
- interface GroupTipMessageProps {
8
- message: MessageModel;
9
- }
10
-
11
- interface GroupTipMessageContent {
12
- text: string;
13
- businessID?: string;
14
- showName?: string;
15
- }
16
-
17
- interface CustomMessageContent {
18
- businessID?: string;
19
- showName?: string;
20
- custom?: string;
21
- }
22
-
23
- enum CustomMessageAsGroupTipEnum {
24
- GROUP_CREATE = 'group_create',
25
- }
26
-
27
- const props = defineProps<GroupTipMessageProps>();
28
-
29
- const { t } = useUIKit();
30
-
31
- const messageContent = props.message.getMessageContent() as GroupTipMessageContent & CustomMessageContent;
32
-
33
- const renderText = () => {
34
- switch (messageContent.businessID) {
35
- case CustomMessageAsGroupTipEnum.GROUP_CREATE:
36
- return `${messageContent.showName || ''} ${t('TUIChat.create group')}`;
37
- default:
38
- return messageContent.text;
39
- }
40
- };
41
- </script>
42
-
43
- <template>
44
- <div :class="cs('group-tip-message')">
45
- {{ renderText() }}
46
- </div>
47
- </template>
48
-
49
- <style lang="scss">
50
- .group-tip-message {
51
- color: var(--text-color-secondary);
52
- text-align: center;
53
- font-size: 12px;
54
- }
55
- </style>
@@ -1,3 +0,0 @@
1
- import GroupTipMessage from "./GroupTipMessage.vue";
2
-
3
- export { GroupTipMessage };