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,9 +1,9 @@
1
1
  import { defineComponent as B, ref as g, computed as K, watch as x, nextTick as V, onMounted as w, onUnmounted as L, createElementBlock as n, openBlock as l, normalizeClass as d, unref as r, createElementVNode as h, createCommentVNode as E, renderSlot as I, toDisplayString as M } from "vue";
2
2
  import { useUIKit as U, TUIToast as A } from "@tencentcloud/uikit-base-component-vue3";
3
- import { ERROR_MESSAGE as D } from "../constants.js";
4
- import { createEditor as N } from "./EditorCore.js";
5
- import { useConversationListState as $ } from "../../../states/ConversationListState/ConversationListState.js";
6
- import { useMessageInputState as z } from "../../../states/MessageInputState/MessageInputState.js";
3
+ import { useMessageInputState as D } from "../MessageInputState.js";
4
+ import { ERROR_MESSAGE as N } from "../constants.js";
5
+ import { createEditor as $ } from "./EditorCore.js";
6
+ import { useConversationListState as z } from "../../../states/ConversationListState/ConversationListState.js";
7
7
  const G = "_disabled_jp6u3_13", O = "_editor_jp6u3_30", s = {
8
8
  "input-wrapper": "_input-wrapper_jp6u3_1",
9
9
  disabled: G,
@@ -21,11 +21,11 @@ const G = "_disabled_jp6u3_13", O = "_editor_jp6u3_30", s = {
21
21
  },
22
22
  emits: ["focus", "blur"],
23
23
  setup(R, { emit: S }) {
24
- const o = R, c = S, { t: p } = U(), { activeConversation: j } = $(), { inputRawValue: k, updateRawValue: F, sendMessage: T, setEditorInstance: f, setContent: m } = z(), u = g(null), _ = g(o.autoFocus), b = K(() => o.placeholder || p("Say something"));
24
+ const o = R, c = S, { t: p } = U(), { activeConversation: j } = z(), { inputRawValue: k, updateRawValue: F, sendMessage: T, setEditorInstance: f, setContent: m } = D(), u = g(null), _ = g(o.autoFocus), b = K(() => o.placeholder || p("Say something"));
25
25
  let i = null;
26
26
  const v = (e) => {
27
27
  const t = u.value;
28
- !t || e.disabled || t.dataset.editorCreated || (i = N({
28
+ !t || e.disabled || t.dataset.editorCreated || (i = $({
29
29
  element: t,
30
30
  placeholder: b.value,
31
31
  autoFocus: e.autoFocus,
@@ -40,7 +40,7 @@ const G = "_disabled_jp6u3_13", O = "_editor_jp6u3_30", s = {
40
40
  m(""), await T(a);
41
41
  } catch (a) {
42
42
  A.error({
43
- message: p(D[a.code] || "send message failed")
43
+ message: p(N[a.code] || "send message failed")
44
44
  });
45
45
  }
46
46
  },
@@ -0,0 +1,17 @@
1
+ declare enum MessageContentType {
2
+ TEXT = "text",
3
+ EMOJI = "emoji"
4
+ }
5
+ type ContentTypeMap = {
6
+ [key in MessageContentType]: key extends MessageContentType.TEXT ? string : key extends MessageContentType.EMOJI ? {
7
+ url: string;
8
+ key: string;
9
+ text: string;
10
+ } : never;
11
+ };
12
+ interface InputContent<T extends MessageContentType = MessageContentType> {
13
+ type: T;
14
+ content: ContentTypeMap[T];
15
+ }
16
+ export { MessageContentType, };
17
+ export type { ContentTypeMap, InputContent, };
@@ -0,0 +1,4 @@
1
+ var t = /* @__PURE__ */ ((r) => (r.TEXT = "text", r.EMOJI = "emoji", r))(t || {});
2
+ export {
3
+ t as MessageContentType
4
+ };
@@ -0,0 +1,30 @@
1
+ import { MessageContentType, InputContent } from './type';
2
+
3
+ declare function convertInputContentToEditorNode(item: InputContent): {
4
+ type: string;
5
+ text: string | {
6
+ url: string;
7
+ key: string;
8
+ text: string;
9
+ };
10
+ attrs?: undefined;
11
+ } | {
12
+ type: any;
13
+ attrs: {
14
+ src: string;
15
+ alt: string;
16
+ fileData: File;
17
+ title: string;
18
+ };
19
+ text?: undefined;
20
+ } | {
21
+ type: MessageContentType;
22
+ attrs: {
23
+ src: string;
24
+ alt: string;
25
+ title: string;
26
+ fileData?: undefined;
27
+ };
28
+ text?: undefined;
29
+ };
30
+ export { convertInputContentToEditorNode, };
@@ -0,0 +1,41 @@
1
+ import { MessageContentType as n } from "./type.js";
2
+ function c(e) {
3
+ switch (e.type) {
4
+ case n.TEXT:
5
+ return {
6
+ type: "text",
7
+ text: e.content
8
+ };
9
+ case n.IMAGE: {
10
+ const t = e.content, r = URL.createObjectURL(t);
11
+ return {
12
+ type: n.IMAGE,
13
+ attrs: {
14
+ src: r,
15
+ alt: t == null ? void 0 : t.name,
16
+ fileData: t,
17
+ title: t == null ? void 0 : t.name
18
+ }
19
+ };
20
+ }
21
+ case n.EMOJI: {
22
+ const t = e.content;
23
+ return {
24
+ type: n.EMOJI,
25
+ attrs: {
26
+ src: t.url,
27
+ alt: t.key,
28
+ title: t.text
29
+ }
30
+ };
31
+ }
32
+ default:
33
+ return {
34
+ type: "text",
35
+ text: String(e.content)
36
+ };
37
+ }
38
+ }
39
+ export {
40
+ c as convertInputContentToEditorNode
41
+ };
@@ -1,154 +1,124 @@
1
- import { defineComponent as q, useSlots as J, ref as i, provide as Q, watch as N, nextTick as $, onMounted as W, onUnmounted as X, createElementBlock as k, openBlock as v, Fragment as z, createElementVNode as m, createVNode as E, createBlock as O, createCommentVNode as T, normalizeStyle as x, unref as s, withCtx as Y, renderList as Z, resolveDynamicComponent as ee, toDisplayString as I } from "vue";
2
- import te from "../../baseComp/ObserverView/ObserverView.js";
3
- import { throttle as oe } from "../../utils/lodash.js";
4
- import { useScroll as le } from "../../hooks/useScroll.js";
5
- import { Message as se } from "./Message/index.js";
6
- import re from "./MessageForward/MessageForward.js";
7
- import { MessageListContextSymbol as ae } from "./MessageListContext.js";
8
- import { useUIKit as ie } from "@tencentcloud/uikit-base-component-vue3";
1
+ import { defineComponent as K, ref as i, useSlots as j, provide as J, watch as F, nextTick as Q, onMounted as R, onUnmounted as W, createElementBlock as k, openBlock as c, Fragment as H, createElementVNode as h, createBlock as O, createCommentVNode as M, normalizeStyle as C, renderList as X, unref as l, resolveDynamicComponent as Y, toDisplayString as T } from "vue";
2
+ import { useUIKit as Z } from "@tencentcloud/uikit-base-component-vue3";
3
+ import { useScroll as ee } from "../../hooks/useScroll.js";
4
+ import { useLoginState as te } from "../../states/LoginState.js";
5
+ import { throttle as se } from "../../utils/lodash.js";
6
+ import { useBarrageListState as oe } from "./BarrageListState.js";
9
7
  import ne from "./ClickAction/UserActionMenu.js";
10
- import { useLoginState as ue } from "../../states/LoginState.js";
11
- import { useLiveState as ce } from "../../states/LiveState/index.js";
12
- import { useBarrageListState as ve } from "../../states/BarrageListState/BarrageListState.js";
13
- import { _ as me } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
14
- const de = { class: "message-chunk" }, fe = {
8
+ import { Message as le } from "./Message/index.js";
9
+ import { MessageListContextSymbol as re } from "./MessageListContext.js";
10
+ import { useLiveListState as ae } from "../../states/LiveListState/LiveListState.js";
11
+ import { _ as ie } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
12
+ const ue = { class: "message-chunk" }, ce = {
15
13
  key: 0,
16
14
  class: "empty-message"
17
- }, pe = {
15
+ }, ve = {
18
16
  key: 0,
19
17
  class: "message-group-tip"
20
- }, ge = { class: "message-group-tip-name" }, he = { class: "message-group-tip-action" }, M = 150, ye = /* @__PURE__ */ q({
18
+ }, me = { class: "message-group-tip-name" }, de = { class: "message-group-tip-action" }, b = 150, fe = /* @__PURE__ */ K({
21
19
  __name: "BarrageList",
22
20
  props: {
23
- messageAggregationTime: { default: 5 * 60 },
24
- filter: { type: Function, default: void 0 },
25
21
  Message: { default: void 0 },
26
- MessageTimeDivider: { default: void 0 },
27
- LocalNoticeMessage: { default: void 0 },
28
22
  containerStyle: {},
29
23
  itemStyle: {},
30
24
  height: {},
31
25
  style: {}
32
26
  },
33
- setup(U) {
34
- const { t: C } = ie(), d = U, V = J(), { loginUserInfo: B } = ue(), { currentLive: P } = ce(), c = i({}), L = i(!1), H = i({}), b = i(null), G = (o) => {
35
- if (!e.value)
27
+ setup(P) {
28
+ const { t: I } = Z(), v = P, o = i(null), V = j(), { loginUserInfo: L } = te(), { currentLive: A } = ae(), u = i(), x = i(!1), $ = i({}), N = i(null), B = i(!1), y = i(!1), _ = i(0), { messageList: m, messageGroupTip: d } = oe(), { scrollToBottom: U } = ee(), G = (e) => {
29
+ if (!o.value)
36
30
  return {
37
31
  position: "fixed",
38
- top: `${o.bottom + 5}px`,
39
- left: `${o.left}px`,
32
+ top: `${e.bottom + 5}px`,
33
+ left: `${e.left}px`,
40
34
  zIndex: 1e3
41
35
  };
42
- const t = e.value.getBoundingClientRect(), l = 120, r = 10, n = 5;
43
- let a = o.bottom + n;
44
- return a + l > t.bottom - r && (a = o.top - l - n), a < t.top + r && (a = t.top + r), {
36
+ const t = o.value.getBoundingClientRect(), s = 120, n = 10, a = 5;
37
+ let r = e.bottom + a;
38
+ return r + s > t.bottom - n && (r = e.top - s - a), r < t.top + n && (r = t.top + n), {
45
39
  position: "fixed",
46
- top: `${a}px`,
47
- left: `${o.left}px`,
40
+ top: `${r}px`,
41
+ left: `${e.left}px`,
48
42
  zIndex: 1e3
49
43
  };
50
44
  };
51
- Q(ae, {
45
+ J(re, {
52
46
  slots: V,
53
- nickClick: (o) => {
54
- var p, u, F;
55
- const { message: t, event: l } = o, r = ((p = B.value) == null ? void 0 : p.userId) === ((u = P.value) == null ? void 0 : u.liveOwner.userId), n = ((F = B.value) == null ? void 0 : F.userId) === t.from;
56
- if (!r || n)
47
+ nickClick: (e) => {
48
+ var f, p, g;
49
+ const { message: t, event: s } = e, n = ((f = L.value) == null ? void 0 : f.userId) === ((p = A.value) == null ? void 0 : p.liveOwner.userId), a = ((g = L.value) == null ? void 0 : g.userId) === t.sender.userId;
50
+ if (!n || a)
57
51
  return;
58
- c.value = t, b.value = l.currentTarget;
59
- const a = l.currentTarget.getBoundingClientRect();
60
- H.value = G(a), L.value = !0;
52
+ u.value = t, N.value = s.currentTarget;
53
+ const r = s.currentTarget.getBoundingClientRect();
54
+ $.value = G(r), x.value = !0;
61
55
  }
62
56
  });
63
- const g = i(!1), h = i(!1), y = i(0), S = i(!1), e = i(null), { messageGroupTip: f, messageList: _, loadMoreMessage: K, currentConversationID: R } = ve(), { scrollToBottom: A } = le(), D = oe(() => {
64
- e.value && (y.value = e.value.scrollHeight - e.value.scrollTop - e.value.clientHeight, y.value > M && (h.value = !0), y.value < M && (h.value = !1));
65
- }, 100), w = async () => {
66
- g.value = !1, h.value = !1;
67
- }, j = async () => {
68
- var t;
69
- if (!g.value || S.value || !((t = _.value) != null && t.length))
70
- return;
71
- if (S.value = !0, !e.value) {
72
- S.value = !1;
73
- return;
74
- }
75
- const o = e.value.scrollHeight - e.value.scrollTop - e.value.clientHeight;
76
- if (await K(), await $(), e.value) {
77
- const l = e.value.scrollHeight - e.value.clientHeight - o;
78
- e.value.scrollTop = Math.max(
79
- 0,
80
- Math.min(e.value.scrollHeight - e.value.clientHeight, l)
81
- );
82
- }
83
- S.value = !1;
57
+ const z = se(() => {
58
+ o.value && (_.value = o.value.scrollHeight - o.value.scrollTop - o.value.clientHeight, _.value > b && (y.value = !0), _.value < b && (y.value = !1));
59
+ }, 100), E = async () => {
60
+ B.value = !1, y.value = !1;
84
61
  };
85
- return N(R, () => {
86
- w();
87
- }), N(_, (o, t) => {
88
- if (t === void 0 && o && !g.value && $(() => {
89
- A({ behavior: "instant" }), g.value = !0;
90
- }), !t || !o || !o.length)
91
- return;
92
- const l = o[o.length - 1], r = t[t.length - 1];
93
- (l == null ? void 0 : l.ID) !== (r == null ? void 0 : r.ID) && (l.flow === "out" || !h.value && y.value < M) && A({ behavior: "smooth" });
62
+ return F(() => {
63
+ var e;
64
+ return (e = A.value) == null ? void 0 : e.liveId;
65
+ }, () => {
66
+ E();
67
+ }), F(() => {
68
+ var e;
69
+ return (e = m.value) == null ? void 0 : e.length;
70
+ }, (e) => {
71
+ var n;
72
+ const t = m.value[e - 1], s = m.value[e - 2];
73
+ s === void 0 && t && !B.value && Q(() => {
74
+ U({ behavior: "instant" }), B.value = !0;
75
+ }), !(!s || !t || !e) && (t == null ? void 0 : t.sequence) !== (s == null ? void 0 : s.sequence) && (t.sender.userId === ((n = L.value) == null ? void 0 : n.userId) || !y.value && _.value < b) && U({ behavior: "smooth" });
76
+ }), R(() => {
77
+ o.value && o.value.addEventListener("scroll", z), E();
94
78
  }), W(() => {
95
- e.value && e.value.addEventListener("scroll", D), w();
96
- }), X(() => {
97
- e.value && e.value.removeEventListener("scroll", D);
98
- }), (o, t) => {
99
- var l, r, n, a, p;
100
- return v(), k(z, null, [
101
- m("div", {
79
+ o.value && o.value.removeEventListener("scroll", z);
80
+ }), (e, t) => {
81
+ var s, n, a, r, f, p, g, q, w, D;
82
+ return c(), k(H, null, [
83
+ h("div", {
102
84
  class: "message-list",
103
- style: x({ height: d.height, ...d.style })
85
+ style: C({ height: v.height, ...v.style })
104
86
  }, [
105
- m("div", {
87
+ h("div", {
106
88
  id: "messageScrollList",
107
89
  ref_key: "scrollContainer",
108
- ref: e,
90
+ ref: o,
109
91
  class: "message-list-container",
110
- style: x(d.containerStyle)
92
+ style: C(v.containerStyle)
111
93
  }, [
112
- E(s(te), {
113
- root: "#messageScrollList",
114
- rootMargin: "50px 0px 0px 0px",
115
- threshold: 0.1,
116
- onOnShow: j
117
- }, {
118
- default: Y(() => [...t[1] || (t[1] = [
119
- m("div", { id: "loadMore" }, null, -1)
120
- ])]),
121
- _: 1
122
- }),
123
- m("div", de, [
124
- (v(!0), k(z, null, Z(s(_), (u) => (v(), O(ee(d.Message || s(se)), {
125
- key: u.ID + u.isRevoked + u.status,
126
- style: x(d.itemStyle),
127
- message: u,
94
+ h("div", ue, [
95
+ (c(!0), k(H, null, X(l(m), (S) => (c(), O(Y(v.Message || l(le)), {
96
+ key: S.sequence + S.timestampInSecond,
97
+ style: C(v.itemStyle),
98
+ message: S,
128
99
  "is-last-in-chunk": !0
129
100
  }, null, 8, ["style", "message"]))), 128))
130
101
  ]),
131
- (l = s(_)) != null && l.length ? T("", !0) : (v(), k("div", fe, I(s(C)("No message yet")), 1))
102
+ (s = l(m)) != null && s.length ? M("", !0) : (c(), k("div", ce, T(l(I)("No message yet")), 1))
132
103
  ], 4),
133
- s(f) ? (v(), k("div", pe, [
134
- m("div", ge, I(((r = s(f)) == null ? void 0 : r.nameCard) || ((n = s(f)) == null ? void 0 : n.userName) || ((a = s(f)) == null ? void 0 : a.userId)), 1),
135
- m("div", he, I(((p = s(f)) == null ? void 0 : p.displayAction) === "enter" ? s(C)("Come in") : s(C)("Leave")), 1)
136
- ])) : T("", !0)
104
+ l(d) ? (c(), k("div", ve, [
105
+ h("div", me, T(((n = l(d)) == null ? void 0 : n.nameCard) || ((a = l(d)) == null ? void 0 : a.userName) || ((r = l(d)) == null ? void 0 : r.userId)), 1),
106
+ h("div", de, T(((f = l(d)) == null ? void 0 : f.displayAction) === "enter" ? l(I)("Come in") : l(I)("Leave")), 1)
107
+ ])) : M("", !0)
137
108
  ], 4),
138
- E(s(re)),
139
- L.value ? (v(), O(ne, {
109
+ x.value && u.value ? (c(), O(ne, {
140
110
  key: 0,
141
- "user-id": c.value.from,
142
- "user-name": c.value.nameCard || c.value.nick || c.value.from,
143
- "avatar-url": c.value.avatar,
144
- style: x(H.value),
145
- "click-target": b.value,
146
- onClose: t[0] || (t[0] = (u) => L.value = !1)
147
- }, null, 8, ["user-id", "user-name", "avatar-url", "style", "click-target"])) : T("", !0)
111
+ "user-id": (p = u.value) == null ? void 0 : p.sender.userId,
112
+ "user-name": ((g = u.value) == null ? void 0 : g.sender.nameCard) || ((q = u.value) == null ? void 0 : q.sender.userName) || ((w = u.value) == null ? void 0 : w.sender.userId),
113
+ "avatar-url": (D = u.value) == null ? void 0 : D.sender.avatarUrl,
114
+ style: C($.value),
115
+ "click-target": N.value,
116
+ onClose: t[0] || (t[0] = (S) => x.value = !1)
117
+ }, null, 8, ["user-id", "user-name", "avatar-url", "style", "click-target"])) : M("", !0)
148
118
  ], 64);
149
119
  };
150
120
  }
151
- }), De = /* @__PURE__ */ me(ye, [["__scopeId", "data-v-022ab526"]]);
121
+ }), Be = /* @__PURE__ */ ie(fe, [["__scopeId", "data-v-5b9fdfa7"]]);
152
122
  export {
153
- De as default
123
+ Be as default
154
124
  };
@@ -1,47 +1,18 @@
1
1
  import { Component, CSSProperties } from 'vue';
2
- import { IMessageModel } from '@tencentcloud/chat-uikit-engine';
3
2
 
4
3
  interface IMessageListProps {
5
- /** message actions e.g. recall, delete, etc. */
6
- /** max time between message group */
7
- messageAggregationTime?: number | undefined;
8
- /** custom filter function */
9
- filter?: ((message: IMessageModel) => boolean) | undefined;
10
- /** custom message component */
11
4
  Message?: Component | undefined;
12
- /** custom message timeline component */
13
- MessageTimeDivider?: Component | undefined;
14
- /** custom local notification message component */
15
- LocalNoticeMessage?: Component | undefined;
16
5
  containerStyle?: CSSProperties | undefined;
17
6
  itemStyle?: CSSProperties | undefined;
18
7
  height?: string;
19
8
  style?: CSSProperties;
20
9
  }
21
10
  declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<IMessageListProps>, {
22
- /** props */
23
- filter: undefined;
24
- enableReadReceipt: boolean;
25
- messageAggregationTime: number;
26
- /** custom components */
27
11
  Message: undefined;
28
- MessageTimeDivider: undefined;
29
- LocalNoticeMessage: undefined;
30
12
  }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<IMessageListProps>, {
31
- /** props */
32
- filter: undefined;
33
- enableReadReceipt: boolean;
34
- messageAggregationTime: number;
35
- /** custom components */
36
13
  Message: undefined;
37
- MessageTimeDivider: undefined;
38
- LocalNoticeMessage: undefined;
39
14
  }>>> & Readonly<{}>, {
40
- filter: (message: IMessageModel) => boolean;
41
15
  Message: Component;
42
- messageAggregationTime: number;
43
- MessageTimeDivider: Component;
44
- LocalNoticeMessage: Component;
45
16
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
46
17
  export default _default;
47
18
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;