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
@@ -3,8 +3,8 @@ import q from "./MicrophoneSelect.js";
3
3
  import z from "./SpeakerSelect.js";
4
4
  import { useI18n as F } from "../../locales/index.js";
5
5
  import { TUIButton as b } from "@tencentcloud/uikit-base-component-vue3";
6
- import { useDeviceState as O } from "../../states/DeviceState.js";
7
- import { MediaSettingDisplayMode as d } from "../../types/device.js";
6
+ import { MediaSettingDisplayMode as u } from "../../types/device.js";
7
+ import { useDeviceState as O } from "../../states/DeviceState/DeviceState.js";
8
8
  import { _ as W } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
9
9
  const $ = { class: "audio-setting-tab" }, G = {
10
10
  key: 0,
@@ -20,23 +20,23 @@ const $ = { class: "audio-setting-tab" }, G = {
20
20
  setup(oe) {
21
21
  const { t: o } = F(), {
22
22
  captureVolume: E,
23
- isMicrophoneTesting: u,
23
+ isMicrophoneTesting: d,
24
24
  isSpeakerTesting: p,
25
25
  startMicrophoneTest: w,
26
26
  stopMicrophoneTest: x,
27
27
  startSpeakerTest: A,
28
28
  stopSpeakerTest: m
29
29
  } = O(), t = P("audioSettingProps"), C = l(
30
- () => (t == null ? void 0 : t.displayMode) === d.IconWithPanel
30
+ () => (t == null ? void 0 : t.displayMode) === u.IconWithPanel
31
31
  ), r = l(
32
- () => (t == null ? void 0 : t.displayMode) === d.Panel
32
+ () => (t == null ? void 0 : t.displayMode) === u.Panel
33
33
  ), _ = l(() => r.value ? 36 : 28), N = l(
34
34
  () => E.value * _.value / 100
35
35
  ), V = l(
36
- () => C.value || r.value && u.value
36
+ () => C.value || r.value && d.value
37
37
  );
38
38
  function B() {
39
- u.value ? x() : w({ interval: 200 });
39
+ d.value ? x() : w({ interval: 200 });
40
40
  }
41
41
  async function D() {
42
42
  p.value ? m() : A({ filePath: "https://web.sdk.qcloud.com/trtc/electron/download/resources/media/TestSpeaker.mp3" });
@@ -55,7 +55,7 @@ const $ = { class: "audio-setting-tab" }, G = {
55
55
  onClick: B
56
56
  }, {
57
57
  default: y(() => [
58
- g(n(e(u) ? e(o)("Stop") : e(o)("Test")), 1)
58
+ g(n(e(d) ? e(o)("Stop") : e(o)("Test")), 1)
59
59
  ]),
60
60
  _: 1
61
61
  })) : c("", !0)
@@ -78,7 +78,7 @@ const $ = { class: "audio-setting-tab" }, G = {
78
78
  i("div", te, [
79
79
  T(z, {
80
80
  class: "select",
81
- disabled: ((S = e(t)) == null ? void 0 : S.displayMode) === e(d).Panel
81
+ disabled: ((S = e(t)) == null ? void 0 : S.displayMode) === e(u).Panel
82
82
  }, null, 8, ["disabled"]),
83
83
  r.value ? (s(), M(e(b), {
84
84
  key: 0,
@@ -94,7 +94,7 @@ const $ = { class: "audio-setting-tab" }, G = {
94
94
  ]);
95
95
  };
96
96
  }
97
- }), _e = /* @__PURE__ */ W(se, [["__scopeId", "data-v-0577050a"]]);
97
+ }), _e = /* @__PURE__ */ W(se, [["__scopeId", "data-v-d822f4ad"]]);
98
98
  export {
99
99
  _e as default
100
100
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as I, ref as _, watch as b, onBeforeMount as g, createBlock as v, openBlock as r, unref as d, withCtx as y, createElementBlock as M, Fragment as B, renderList as k } from "vue";
1
+ import { defineComponent as I, ref as _, watch as b, onBeforeMount as g, createBlock as v, openBlock as r, unref as c, withCtx as y, createElementBlock as M, Fragment as B, renderList as k } from "vue";
2
2
  import w from "../../baseComp/Select/SelectPC.js";
3
3
  import x from "../../baseComp/Option/OptionPC.js";
4
- import { useDeviceState as S } from "../../states/DeviceState.js";
4
+ import { useDeviceState as S } from "../../states/DeviceState/DeviceState.js";
5
5
  import { _ as L } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
6
6
  const V = /* @__PURE__ */ I({
7
7
  __name: "MicrophoneSelect",
@@ -9,9 +9,9 @@ const V = /* @__PURE__ */ I({
9
9
  onChange: {},
10
10
  disabled: { type: Boolean, default: !1 }
11
11
  },
12
- setup(c) {
12
+ setup(d) {
13
13
  var u;
14
- const { microphoneList: i, currentMicrophone: o, setCurrentMicrophone: m, getMicrophoneList: f } = S(), n = c, t = _((u = o.value) == null ? void 0 : u.deviceId);
14
+ const { microphoneList: i, currentMicrophone: o, setCurrentMicrophone: m, getMicrophoneList: f } = S(), n = d, t = _((u = o.value) == null ? void 0 : u.deviceId);
15
15
  b(
16
16
  () => {
17
17
  var e;
@@ -33,18 +33,18 @@ const V = /* @__PURE__ */ I({
33
33
  }
34
34
  return g(async () => {
35
35
  await f();
36
- }), (e, l) => (r(), v(d(w), {
36
+ }), (e, l) => (r(), v(c(w), {
37
37
  modelValue: t.value,
38
38
  "onUpdate:modelValue": l[0] || (l[0] = (a) => t.value = a),
39
39
  placeholder: "placeholder",
40
40
  class: "select",
41
- disabled: c.disabled,
41
+ disabled: d.disabled,
42
42
  teleported: !1,
43
43
  "popper-append-to-body": !1,
44
44
  onChange: h
45
45
  }, {
46
46
  default: y(() => [
47
- (r(!0), M(B, null, k(d(i), (a) => (r(), v(d(x), {
47
+ (r(!0), M(B, null, k(c(i), (a) => (r(), v(c(x), {
48
48
  key: a.deviceId,
49
49
  label: a.deviceName,
50
50
  value: a.deviceId
@@ -53,7 +53,7 @@ const V = /* @__PURE__ */ I({
53
53
  _: 1
54
54
  }, 8, ["modelValue", "disabled"]));
55
55
  }
56
- }), U = /* @__PURE__ */ L(V, [["__scopeId", "data-v-45e2de0d"]]);
56
+ }), U = /* @__PURE__ */ L(V, [["__scopeId", "data-v-54429c40"]]);
57
57
  export {
58
58
  U as default
59
59
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as C, ref as I, watch as S, onBeforeMount as b, createBlock as v, openBlock as o, unref as n, withCtx as _, createElementBlock as g, Fragment as y, renderList as B } from "vue";
1
+ import { defineComponent as C, ref as I, watch as S, onBeforeMount as _, createBlock as v, openBlock as d, unref as n, withCtx as b, createElementBlock as g, Fragment as y, renderList as B } from "vue";
2
2
  import w from "../../baseComp/Select/SelectPC.js";
3
3
  import x from "../../baseComp/Option/OptionPC.js";
4
- import { useDeviceState as L } from "../../states/DeviceState.js";
4
+ import { useDeviceState as L } from "../../states/DeviceState/DeviceState.js";
5
5
  import { _ as V } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
6
6
  const D = /* @__PURE__ */ C({
7
7
  __name: "SpeakerSelect",
@@ -11,7 +11,7 @@ const D = /* @__PURE__ */ C({
11
11
  },
12
12
  setup(c) {
13
13
  var i;
14
- const d = c, { speakerList: u, currentSpeaker: t, setCurrentSpeaker: f, getSpeakerList: m } = L(), l = I((i = t.value) == null ? void 0 : i.deviceId);
14
+ const o = c, { speakerList: u, currentSpeaker: t, setCurrentSpeaker: f, getSpeakerList: m } = L(), l = I((i = t.value) == null ? void 0 : i.deviceId);
15
15
  S(
16
16
  () => {
17
17
  var e;
@@ -24,16 +24,16 @@ const D = /* @__PURE__ */ C({
24
24
  );
25
25
  async function k(e) {
26
26
  var r, a, s, p;
27
- (r = d.onChange) == null || r.call(d, e);
27
+ (r = o.onChange) == null || r.call(o, e);
28
28
  try {
29
29
  await f({ deviceId: e });
30
30
  } catch {
31
31
  (a = t.value) != null && a.deviceId && u.value.map((h) => h.deviceId).includes((s = t.value) == null ? void 0 : s.deviceId) && (l.value = (p = t.value) == null ? void 0 : p.deviceId);
32
32
  }
33
33
  }
34
- return b(async () => {
34
+ return _(async () => {
35
35
  await m();
36
- }), (e, r) => (o(), v(n(w), {
36
+ }), (e, r) => (d(), v(n(w), {
37
37
  modelValue: l.value,
38
38
  "onUpdate:modelValue": r[0] || (r[0] = (a) => l.value = a),
39
39
  placeholder: "placeholder",
@@ -43,8 +43,8 @@ const D = /* @__PURE__ */ C({
43
43
  "popper-append-to-body": !1,
44
44
  onChange: k
45
45
  }, {
46
- default: _(() => [
47
- (o(!0), g(y, null, B(n(u), (a) => (o(), v(n(x), {
46
+ default: b(() => [
47
+ (d(!0), g(y, null, B(n(u), (a) => (d(), v(n(x), {
48
48
  key: a.deviceId,
49
49
  label: a.deviceName,
50
50
  value: a.deviceId
@@ -53,7 +53,7 @@ const D = /* @__PURE__ */ C({
53
53
  _: 1
54
54
  }, 8, ["modelValue", "disabled"]));
55
55
  }
56
- }), U = /* @__PURE__ */ V(D, [["__scopeId", "data-v-1cdf3bd1"]]);
56
+ }), U = /* @__PURE__ */ V(D, [["__scopeId", "data-v-00c43451"]]);
57
57
  export {
58
58
  U as default
59
59
  };
@@ -4,4 +4,5 @@ export declare const resource: {
4
4
  'Input volume': string;
5
5
  Speaker: string;
6
6
  'Output volume': string;
7
+ 'Unrecognized device': string;
7
8
  };
@@ -3,7 +3,8 @@ const e = {
3
3
  "Select device": "Select device",
4
4
  "Input volume": "Input volume",
5
5
  Speaker: "Speaker",
6
- "Output volume": "输出音量"
6
+ "Output volume": "输出音量",
7
+ "Unrecognized device": "Unrecognized device"
7
8
  };
8
9
  export {
9
10
  e as resource
@@ -4,4 +4,5 @@ export declare const resource: {
4
4
  'Input volume': string;
5
5
  Speaker: string;
6
6
  'Output volume': string;
7
+ 'Unrecognized device': string;
7
8
  };
@@ -3,7 +3,8 @@ const e = {
3
3
  "Select device": "选择设备",
4
4
  "Input volume": "输入音量",
5
5
  Speaker: "扬声器",
6
- "Output volume": "输出音量"
6
+ "Output volume": "输出音量",
7
+ "Unrecognized device": "未识别设备"
7
8
  };
8
9
  export {
9
10
  e as resource
@@ -1,108 +1,116 @@
1
- import { defineComponent as D, ref as r, onMounted as E, watch as u, createElementBlock as I, openBlock as c, createElementVNode as o, toDisplayString as a, unref as t, createVNode as v, withCtx as S, Fragment as k, renderList as w, createBlock as U } from "vue";
2
- import { useUIKit as P, TUISelect as b, TUIOption as g, TUISlider as x } from "@tencentcloud/uikit-base-component-vue3";
3
- import { useDeviceState as z } from "../../states/DeviceState.js";
4
- import { _ as F } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
5
- import { addI18n as C } from "../../i18n/index.js";
6
- import { resource as K } from "./i18n/en-US/index.js";
7
- import { resource as $ } from "./i18n/zh-CN/index.js";
8
- const j = { class: "audio-setting-panel" }, q = { class: "section" }, G = { class: "section-title" }, H = { class: "row" }, J = { class: "label" }, Q = { class: "row" }, R = { class: "label" }, W = { class: "volume-value" }, X = { class: "section" }, Y = { class: "section-title" }, Z = { class: "row" }, ee = { class: "label" }, te = { class: "row" }, le = { class: "label" }, oe = { class: "volume-value" }, se = /* @__PURE__ */ D({
1
+ import { defineComponent as D, ref as v, onMounted as E, watch as c, createElementBlock as r, openBlock as d, createElementVNode as o, createCommentVNode as g, toDisplayString as n, unref as e, createVNode as p, withCtx as U, Fragment as w, renderList as b, createBlock as y } from "vue";
2
+ import { useUIKit as P, TUISelect as C, TUIOption as x, TUISlider as M } from "@tencentcloud/uikit-base-component-vue3";
3
+ import { useDeviceState as F } from "../../states/DeviceState/DeviceState.js";
4
+ import { _ as K } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
5
+ import { addI18n as N } from "../../i18n/index.js";
6
+ import { resource as $ } from "./i18n/en-US/index.js";
7
+ import { resource as j } from "./i18n/zh-CN/index.js";
8
+ const q = { class: "audio-setting-panel" }, G = { class: "section" }, H = { class: "section-title" }, J = {
9
+ key: 0,
10
+ class: "row"
11
+ }, Q = { class: "label" }, R = { class: "row" }, W = { class: "label" }, X = { class: "volume-value" }, Y = { class: "section" }, Z = { class: "section-title" }, ee = {
12
+ key: 0,
13
+ class: "row"
14
+ }, te = { class: "label" }, le = { class: "row" }, oe = { class: "label" }, ae = { class: "volume-value" }, se = /* @__PURE__ */ D({
9
15
  __name: "index",
10
- setup(ae) {
11
- const { t: n } = P(), {
12
- microphoneList: y,
13
- currentMicrophone: p,
14
- setCurrentMicrophone: M,
15
- speakerList: L,
16
- currentSpeaker: m,
17
- setCurrentSpeaker: N,
16
+ setup(ne) {
17
+ const { t: s } = P(), {
18
+ microphoneList: I,
19
+ currentMicrophone: m,
20
+ setCurrentMicrophone: L,
21
+ speakerList: f,
22
+ currentSpeaker: _,
23
+ setCurrentSpeaker: z,
18
24
  getMicrophoneList: B,
19
25
  getSpeakerList: O,
20
- captureVolume: f,
21
- outputVolume: h,
26
+ captureVolume: S,
27
+ outputVolume: k,
22
28
  setCaptureVolume: T,
23
29
  setOutputVolume: A
24
- } = z(), i = r(""), d = r(""), _ = r(f.value), V = r(h.value);
30
+ } = F(), i = v(""), u = v(""), V = v(S.value), h = v(k.value);
25
31
  return E(async () => {
26
- await B(), await O(), p.value && (i.value = p.value.deviceId), m.value && (d.value = m.value.deviceId);
27
- }), u(p, (e) => {
28
- e && e.deviceId !== i.value && (i.value = e.deviceId);
29
- }), u(m, (e) => {
30
- e && e.deviceId !== d.value && (d.value = e.deviceId);
31
- }), u(_, async (e) => {
32
- await T(e);
33
- }), u(V, async (e) => {
34
- await A(e);
35
- }), u(i, (e) => {
36
- M({ deviceId: e });
37
- }), u(d, (e) => {
38
- N({ deviceId: e });
39
- }), (e, s) => (c(), I("div", j, [
40
- o("div", q, [
41
- o("div", G, a(t(n)("Microphone")), 1),
42
- o("div", H, [
43
- o("span", J, a(t(n)("Select device")), 1),
44
- v(t(b), {
32
+ await B(), await O(), m.value && (i.value = m.value.deviceId), _.value && (u.value = _.value.deviceId);
33
+ }), c(m, (t) => {
34
+ t && t.deviceId !== i.value && (i.value = t.deviceId);
35
+ }), c(_, (t) => {
36
+ t && t.deviceId !== u.value && (u.value = t.deviceId);
37
+ }), c(V, async (t) => {
38
+ await T(t);
39
+ }), c(h, async (t) => {
40
+ await A(t);
41
+ }), c(i, (t) => {
42
+ L({ deviceId: t });
43
+ }), c(u, (t) => {
44
+ z({ deviceId: t });
45
+ }), (t, a) => (d(), r("div", q, [
46
+ o("div", G, [
47
+ o("div", H, n(e(s)("Microphone")), 1),
48
+ e(I).length > 0 ? (d(), r("div", J, [
49
+ o("span", Q, n(e(s)("Select device")), 1),
50
+ p(e(C), {
45
51
  modelValue: i.value,
46
- "onUpdate:modelValue": s[0] || (s[0] = (l) => i.value = l),
47
- class: "select"
52
+ "onUpdate:modelValue": a[0] || (a[0] = (l) => i.value = l),
53
+ class: "select",
54
+ placeholder: e(s)("Unrecognized device")
48
55
  }, {
49
- default: S(() => [
50
- (c(!0), I(k, null, w(t(y), (l) => (c(), U(t(g), {
56
+ default: U(() => [
57
+ (d(!0), r(w, null, b(e(I), (l) => (d(), y(e(x), {
51
58
  key: l.deviceId,
52
59
  label: l.deviceName,
53
60
  value: l.deviceId
54
61
  }, null, 8, ["label", "value"]))), 128))
55
62
  ]),
56
63
  _: 1
57
- }, 8, ["modelValue"])
58
- ]),
59
- o("div", Q, [
60
- o("span", R, a(t(n)("Input volume")), 1),
61
- v(t(x), {
62
- modelValue: _.value,
63
- "onUpdate:modelValue": s[1] || (s[1] = (l) => _.value = l),
64
+ }, 8, ["modelValue", "placeholder"])
65
+ ])) : g("", !0),
66
+ o("div", R, [
67
+ o("span", W, n(e(s)("Input volume")), 1),
68
+ p(e(M), {
69
+ modelValue: V.value,
70
+ "onUpdate:modelValue": a[1] || (a[1] = (l) => V.value = l),
64
71
  min: 0,
65
72
  max: 100
66
73
  }, null, 8, ["modelValue"]),
67
- o("span", W, a(t(f)), 1)
74
+ o("span", X, n(e(S)), 1)
68
75
  ])
69
76
  ]),
70
- s[4] || (s[4] = o("div", { class: "divider" }, null, -1)),
71
- o("div", X, [
72
- o("div", Y, a(t(n)("Speaker")), 1),
73
- o("div", Z, [
74
- o("span", ee, a(t(n)("Select device")), 1),
75
- v(t(b), {
76
- modelValue: d.value,
77
- "onUpdate:modelValue": s[2] || (s[2] = (l) => d.value = l),
78
- class: "select"
77
+ a[4] || (a[4] = o("div", { class: "divider" }, null, -1)),
78
+ o("div", Y, [
79
+ o("div", Z, n(e(s)("Speaker")), 1),
80
+ e(f).length > 0 ? (d(), r("div", ee, [
81
+ o("span", te, n(e(s)("Select device")), 1),
82
+ p(e(C), {
83
+ modelValue: u.value,
84
+ "onUpdate:modelValue": a[2] || (a[2] = (l) => u.value = l),
85
+ class: "select",
86
+ placeholder: e(s)("Unrecognized device")
79
87
  }, {
80
- default: S(() => [
81
- (c(!0), I(k, null, w(t(L), (l) => (c(), U(t(g), {
88
+ default: U(() => [
89
+ (d(!0), r(w, null, b(e(f), (l) => (d(), y(e(x), {
82
90
  key: l.deviceId,
83
91
  label: l.deviceName,
84
92
  value: l.deviceId
85
93
  }, null, 8, ["label", "value"]))), 128))
86
94
  ]),
87
95
  _: 1
88
- }, 8, ["modelValue"])
89
- ]),
90
- o("div", te, [
91
- o("span", le, a(t(n)("Output volume")), 1),
92
- v(t(x), {
93
- modelValue: V.value,
94
- "onUpdate:modelValue": s[3] || (s[3] = (l) => V.value = l),
96
+ }, 8, ["modelValue", "placeholder"])
97
+ ])) : g("", !0),
98
+ o("div", le, [
99
+ o("span", oe, n(e(s)("Output volume")), 1),
100
+ p(e(M), {
101
+ modelValue: h.value,
102
+ "onUpdate:modelValue": a[3] || (a[3] = (l) => h.value = l),
95
103
  min: 0,
96
104
  max: 100
97
105
  }, null, 8, ["modelValue"]),
98
- o("span", oe, a(t(h)), 1)
106
+ o("span", ae, n(e(k)), 1)
99
107
  ])
100
108
  ])
101
109
  ]));
102
110
  }
103
- }), pe = /* @__PURE__ */ F(se, [["__scopeId", "data-v-d773f311"]]);
104
- C("en-US", { translation: K });
105
- C("zh-CN", { translation: $ });
111
+ }), me = /* @__PURE__ */ K(se, [["__scopeId", "data-v-824562f9"]]);
112
+ N("en-US", { translation: $ });
113
+ N("zh-CN", { translation: j });
106
114
  export {
107
- pe as AudioSettingPanel
115
+ me as AudioSettingPanel
108
116
  };
@@ -2,10 +2,10 @@ import { defineComponent as R, computed as i, ref as r, createElementBlock as g,
2
2
  import { useUIKit as z, TUIButton as G, TUIToast as K } from "@tencentcloud/uikit-base-component-vue3";
3
3
  import { useLiveAudienceState as O } from "../../states/LiveAudienceState.js";
4
4
  import { useLoginState as q } from "../../states/LoginState.js";
5
- import J from "./BarrageInput.js";
6
- import Q from "./EmojiPicker/EmojiPicker.js";
7
- import { ERROR_MESSAGE as W } from "./constants.js";
8
- import { useMessageInputState as X } from "../../states/MessageInputState/MessageInputState.js";
5
+ import { useMessageInputState as J } from "./MessageInputState.js";
6
+ import Q from "./BarrageInput.js";
7
+ import W from "./EmojiPicker/EmojiPicker.js";
8
+ import { ERROR_MESSAGE as X } from "./constants.js";
9
9
  import { _ as Y } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
10
10
  const Z = { class: "live-message-input-h5" }, $ = { class: "input-actions" }, ee = /* @__PURE__ */ R({
11
11
  __name: "BarrageInputH5",
@@ -29,7 +29,7 @@ const Z = { class: "live-message-input-h5" }, $ = { class: "input-actions" }, ee
29
29
  return p.userId === ((f = b.value) == null ? void 0 : f.userId);
30
30
  });
31
31
  return e.disabled || (t == null ? void 0 : t.isMessageDisabled);
32
- }), { inputRawValue: m, setContent: I, sendMessage: T, blurEditor: E, focusEditor: H } = X(), n = r(!1), s = r(!1), l = r(!1), k = () => {
32
+ }), { inputRawValue: m, setContent: I, sendMessage: T, blurEditor: E, focusEditor: H } = J(), n = r(!1), s = r(!1), l = r(!1), k = () => {
33
33
  l.value = !0;
34
34
  }, F = async () => {
35
35
  if (m.value) {
@@ -39,7 +39,7 @@ const Z = { class: "live-message-input-h5" }, $ = { class: "input-actions" }, ee
39
39
  I(""), await T(t);
40
40
  } catch (t) {
41
41
  K.error({
42
- message: o(W[t.code] || "send message failed")
42
+ message: o(X[t.code] || "send message failed")
43
43
  });
44
44
  }
45
45
  }
@@ -60,14 +60,14 @@ const Z = { class: "live-message-input-h5" }, $ = { class: "input-actions" }, ee
60
60
  onClick: N
61
61
  }, [
62
62
  y("div", $, [
63
- j(Q, {
63
+ j(W, {
64
64
  disabled: h.value,
65
65
  "trigger-style": { display: "flex" }
66
66
  }, null, 8, ["disabled"])
67
67
  ]),
68
68
  y("span", null, S(d.value), 1)
69
69
  ], 4)),
70
- s.value ? (a(), v(J, {
70
+ s.value ? (a(), v(Q, {
71
71
  key: 1,
72
72
  autoFocus: e.autoFocus,
73
73
  containerClass: C.value,
@@ -95,7 +95,7 @@ const Z = { class: "live-message-input-h5" }, $ = { class: "input-actions" }, ee
95
95
  })) : u("", !0)
96
96
  ]));
97
97
  }
98
- }), ce = /* @__PURE__ */ Y(ee, [["__scopeId", "data-v-9fd6640c"]]);
98
+ }), ce = /* @__PURE__ */ Y(ee, [["__scopeId", "data-v-fcdaa865"]]);
99
99
  export {
100
100
  ce as default
101
101
  };
@@ -3,8 +3,8 @@ import { useUIKit as y, IconEmoji as C } from "@tencentcloud/uikit-base-componen
3
3
  import { P, a as h, b as I, c as z } from "../../../PopoverTrigger-L8abAry7.js";
4
4
  import { emojiUrlMap as l, emojiBaseUrl as m } from "../../../constants/emoji.js";
5
5
  import { transformTextWithEmojiKeyToName as M } from "../../../utils/emoji.js";
6
- import { useMessageInputState as T } from "../../../states/MessageInputState/MessageInputState.js";
7
- import { MessageContentType as B } from "../../../states/MessageInputState/type.js";
6
+ import { useMessageInputState as T } from "../MessageInputState.js";
7
+ import { MessageContentType as B } from "../type.js";
8
8
  import { _ as S } from "../../../_plugin-vue_export-helper-CHgC5LLL.js";
9
9
  const n = {
10
10
  "emoji-picker__icon": "_emoji-picker__icon_77iku_1",
@@ -96,7 +96,7 @@ const n = {
96
96
  })
97
97
  ]));
98
98
  }
99
- }), D = /* @__PURE__ */ S(w, [["__scopeId", "data-v-6d8acff6"]]);
99
+ }), D = /* @__PURE__ */ S(w, [["__scopeId", "data-v-e11cd753"]]);
100
100
  export {
101
101
  D as default
102
102
  };
@@ -0,0 +1,28 @@
1
+ import { Ref } from 'vue';
2
+ import { MessageContentType, InputContent } from './type';
3
+ import { Editor } from '@tiptap/vue-3';
4
+
5
+ /**
6
+ * Message Input Store
7
+ *
8
+ * This store manages the state and operations related to the chat message input, including:
9
+ * - Raw input value (text or structured content)
10
+ * - Editor instance management
11
+ * - Content manipulation (insertion, updating, etc.)
12
+ * - Message sending functionality
13
+ */
14
+ interface MessageInputState {
15
+ inputRawValue: Ref<string | InputContent[]>;
16
+ }
17
+ interface MessageInputAction {
18
+ updateRawValue: (value: string | InputContent[]) => void;
19
+ setEditorInstance: (editor: Editor | null) => void;
20
+ setContent: (value: string | InputContent[]) => void;
21
+ insertContent: (value: string | InputContent[], focus?: boolean) => void;
22
+ focusEditor: () => void;
23
+ blurEditor: () => void;
24
+ sendMessage: (msg?: string | InputContent[]) => void;
25
+ }
26
+ declare function useMessageInputState(): MessageInputState & MessageInputAction;
27
+ export { useMessageInputState, MessageContentType };
28
+ export type { InputContent };
@@ -0,0 +1,82 @@
1
+ import { ref as m } from "vue";
2
+ import { MessageContentType as r } from "./type.js";
3
+ import { convertInputContentToEditorNode as f } from "./utils.js";
4
+ import { useBarrageState as y } from "../../states/BarrageState/BarrageState.js";
5
+ import { transformTextWithEmojiNameToKey as u } from "../../utils/emoji.js";
6
+ const { sendTextMessage: c } = y(), e = m(null), a = m(""), g = (t) => {
7
+ if (typeof t != "string" && !Array.isArray(t)) {
8
+ console.warn("Invalid input type for updateRawValue");
9
+ return;
10
+ }
11
+ typeof t == "string" ? a.value = t.trim() : a.value = (t == null ? void 0 : t.length) > 0 ? t : "";
12
+ }, T = (t) => {
13
+ e.value && e.value.destroy(), e.value = t;
14
+ }, v = (t) => {
15
+ if (e.value) {
16
+ if (typeof t == "string")
17
+ e.value.commands.setContent(t, !0);
18
+ else {
19
+ const n = t.map(f);
20
+ e.value.commands.setContent(n, !0);
21
+ }
22
+ e.value.commands.focus();
23
+ }
24
+ }, C = (t, n = !0) => {
25
+ if (e.value) {
26
+ if (typeof t == "string")
27
+ e.value.commands.insertContent(t);
28
+ else {
29
+ const s = t.map(f);
30
+ e.value.commands.insertContent(s);
31
+ }
32
+ n && e.value.commands.focus();
33
+ }
34
+ }, E = () => {
35
+ var t;
36
+ (t = e.value) == null || t.commands.focus();
37
+ }, w = () => {
38
+ var t;
39
+ (t = e.value) == null || t.commands.blur();
40
+ }, x = async (t) => {
41
+ const n = t ?? a.value;
42
+ if (!n)
43
+ return;
44
+ if (typeof n == "string") {
45
+ c({
46
+ text: u(n)
47
+ });
48
+ return;
49
+ }
50
+ let s = "";
51
+ const d = async () => {
52
+ s && (await c({
53
+ text: u(s)
54
+ }), s = "");
55
+ }, i = {
56
+ [r.TEXT]: (o) => o,
57
+ [r.EMOJI]: (o) => o.key
58
+ };
59
+ for (const o of n) {
60
+ if (!o.type || !i[o.type])
61
+ throw new Error(`Invalid message type: ${o.type}`);
62
+ const p = i[o.type], l = await p(o.content);
63
+ [r.TEXT, r.EMOJI].includes(o.type) && (s += l);
64
+ }
65
+ await d();
66
+ };
67
+ function S() {
68
+ return {
69
+ inputRawValue: a,
70
+ updateRawValue: g,
71
+ setEditorInstance: T,
72
+ setContent: v,
73
+ insertContent: C,
74
+ focusEditor: E,
75
+ blurEditor: w,
76
+ sendMessage: x
77
+ };
78
+ }
79
+ export {
80
+ r as MessageContentType,
81
+ S as useMessageInputState
82
+ };
@@ -1,4 +1,4 @@
1
- import { E as l, P as h, a as f } from "../../../index-D2OVtqc8.js";
1
+ import { E as l, P as h, a as f } from "../../../index-BfIEeWMg.js";
2
2
  const m = l.create({
3
3
  name: "characterCount",
4
4
  addOptions() {
@@ -1,7 +1,7 @@
1
- import { S as g, P as x, E as p, I as o } from "../../../index-Bm-QfV5o.js";
1
+ import { S as g, P as x, E as p, I as o } from "../../../index-DTi1fL-x.js";
2
2
  import { isMobile as y } from "../../../utils/environment.js";
3
3
  import { CharacterCount as M } from "./CharacterCountExtension.js";
4
- import { E as T } from "../../../index-D2OVtqc8.js";
4
+ import { E as T } from "../../../index-BfIEeWMg.js";
5
5
  import { MessageContentType as a } from "../../../states/MessageInputState/type.js";
6
6
  function b() {
7
7
  return o.extend({