@trtc/calls-uikit-vue 4.1.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 (483) hide show
  1. package/README-zh_CN.md +83 -0
  2. package/README.md +89 -0
  3. package/debug/GenerateTestUserSig-es.js +26 -0
  4. package/debug/lib-generate-test-usersig-es.min.js +2 -0
  5. package/package.json +42 -0
  6. package/src/Components/TUICallKit.vue +334 -0
  7. package/src/Components/assets/MicrophoneVolume/desktop/mic-off.svg +5 -0
  8. package/src/Components/assets/MicrophoneVolume/desktop/mic-on.svg +5 -0
  9. package/src/Components/assets/base/close.svg +1 -0
  10. package/src/Components/assets/base/error.svg +1 -0
  11. package/src/Components/assets/base/info.svg +1 -0
  12. package/src/Components/assets/base/loading-circle.svg +1 -0
  13. package/src/Components/assets/base/success.svg +1 -0
  14. package/src/Components/assets/base/waring.svg +1 -0
  15. package/src/Components/assets/button/accept.svg +1 -0
  16. package/src/Components/assets/button/background-blur-close.svg +1 -0
  17. package/src/Components/assets/button/background-blur-open.svg +1 -0
  18. package/src/Components/assets/button/camera-close.svg +1 -0
  19. package/src/Components/assets/button/camera-open.svg +1 -0
  20. package/src/Components/assets/button/desktop/arrow.png +0 -0
  21. package/src/Components/assets/button/desktop/fullScreen.svg +4 -0
  22. package/src/Components/assets/button/desktop/inviteUser.svg +1 -0
  23. package/src/Components/assets/button/desktop/minimize.svg +6 -0
  24. package/src/Components/assets/button/hangup.svg +1 -0
  25. package/src/Components/assets/button/microphone-close.svg +1 -0
  26. package/src/Components/assets/button/microphone-open.svg +1 -0
  27. package/src/Components/assets/button/mobile/down.svg +1 -0
  28. package/src/Components/assets/button/mobile/inviteUser.svg +1 -0
  29. package/src/Components/assets/button/mobile/minimize.svg +1 -0
  30. package/src/Components/assets/button/mobile/switch-camera.svg +1 -0
  31. package/src/Components/assets/button/mobile/up.svg +1 -0
  32. package/src/Components/assets/button/speaker-close.svg +1 -0
  33. package/src/Components/assets/button/speaker-open.svg +1 -0
  34. package/src/Components/assets/button/switch-audio.svg +1 -0
  35. package/src/Components/assets/common/arrows.svg +1 -0
  36. package/src/Components/assets/common/call.svg +1 -0
  37. package/src/Components/assets/common/close.svg +1 -0
  38. package/src/Components/assets/common/defaultAvatar.svg +1 -0
  39. package/src/Components/assets/common/loading-audio.svg +1 -0
  40. package/src/Components/assets/common/loading-video.png +0 -0
  41. package/src/Components/assets/common/microphone-volumn-close.svg +1 -0
  42. package/src/Components/assets/desktop/acceptAudio.svg +4 -0
  43. package/src/Components/assets/desktop/acceptVideo.svg +8 -0
  44. package/src/Components/assets/desktop/arrow.png +0 -0
  45. package/src/Components/assets/desktop/camera-false.svg +5 -0
  46. package/src/Components/assets/desktop/camera.svg +6 -0
  47. package/src/Components/assets/desktop/floatCallEnd.svg +3 -0
  48. package/src/Components/assets/desktop/floatFullScreen.svg +3 -0
  49. package/src/Components/assets/desktop/floatMicrophone.svg +4 -0
  50. package/src/Components/assets/desktop/floatMicrophoneClosed.svg +3 -0
  51. package/src/Components/assets/desktop/fullScreen.svg +4 -0
  52. package/src/Components/assets/desktop/hangup.svg +4 -0
  53. package/src/Components/assets/desktop/invite_user.svg +5 -0
  54. package/src/Components/assets/desktop/microphone-false.svg +8 -0
  55. package/src/Components/assets/desktop/microphone.svg +9 -0
  56. package/src/Components/assets/desktop/minimize.svg +6 -0
  57. package/src/Components/assets/desktop/permission/index.ts +11 -0
  58. package/src/Components/assets/desktop/permission/mac/permit-en.jpg +0 -0
  59. package/src/Components/assets/desktop/permission/mac/permit-zh.jpg +0 -0
  60. package/src/Components/assets/desktop/permission/win/permit-en.png +0 -0
  61. package/src/Components/assets/desktop/permission/win/permit-zh.png +0 -0
  62. package/src/Components/assets/desktop/switchScreen.svg +5 -0
  63. package/src/Components/assets/desktop/trans.svg +6 -0
  64. package/src/Components/assets/floatingWindow/desktop/floatCallEnd.svg +3 -0
  65. package/src/Components/assets/floatingWindow/desktop/floatFullScreen.svg +3 -0
  66. package/src/Components/assets/floatingWindow/desktop/floatMicrophone.svg +4 -0
  67. package/src/Components/assets/floatingWindow/desktop/floatMicrophoneClosed.svg +3 -0
  68. package/src/Components/assets/floatingWindow/mobile/camera-close.svg +1 -0
  69. package/src/Components/assets/floatingWindow/mobile/camera-open.svg +1 -0
  70. package/src/Components/assets/floatingWindow/mobile/earphone.svg +1 -0
  71. package/src/Components/assets/floatingWindow/mobile/microphone-close.svg +1 -0
  72. package/src/Components/assets/floatingWindow/mobile/microphone-open.svg +1 -0
  73. package/src/Components/assets/permission/desktop/index.ts +11 -0
  74. package/src/Components/assets/permission/desktop/mac/permit-en.jpg +0 -0
  75. package/src/Components/assets/permission/desktop/mac/permit-zh.jpg +0 -0
  76. package/src/Components/assets/permission/desktop/win/permit-en.png +0 -0
  77. package/src/Components/assets/permission/desktop/win/permit-zh.png +0 -0
  78. package/src/Components/assets/streamInfo/mobile/mic-off-h5.svg +1 -0
  79. package/src/Components/assets/streamInfo/mobile/mic-on-h5.svg +1 -0
  80. package/src/Components/assets/streamInfo/mobile/microphone-close-group.svg +1 -0
  81. package/src/Components/assets/streamInfo/mobile/microphone-close-single.svg +1 -0
  82. package/src/Components/assets/streamInfo/mobile/volumn.svg +1 -0
  83. package/src/Components/assets/streamInfo/networkStatus.png +0 -0
  84. package/src/Components/components/GroupCall/BackGround/BackGround.vue +20 -0
  85. package/src/Components/components/GroupCall/GroupCall.vue +129 -0
  86. package/src/Components/components/GroupCall/MediaContainer/MediaContainer.vue +267 -0
  87. package/src/Components/components/GroupCall/MediaContainer/StreamLoading/StreamLoading.vue +22 -0
  88. package/src/Components/components/SingleCall/MediaContainer/MediaContainer.vue +165 -0
  89. package/src/Components/components/SingleCall/SingleCall.vue +28 -0
  90. package/src/Components/components/SingleCall/hooks/useGetLargeViewName.ts +32 -0
  91. package/src/Components/components/base/Avatar/Avatar.ts +38 -0
  92. package/src/Components/components/base/Avatar/Avatar.vue +53 -0
  93. package/src/Components/components/base/Avatar/style/Avatar.scss +40 -0
  94. package/src/Components/components/base/Button/Button.ts +60 -0
  95. package/src/Components/components/base/Button/Button.vue +61 -0
  96. package/src/Components/components/base/Button/style/Button.scss +42 -0
  97. package/src/Components/components/base/Grid/Grid.ts +26 -0
  98. package/src/Components/components/base/Grid/Grid.vue +40 -0
  99. package/src/Components/components/base/Grid/GridItem/GridItem.vue +81 -0
  100. package/src/Components/components/base/Grid/GridItem/style/GridItem.scss +13 -0
  101. package/src/Components/components/base/Icon/Icon.ts +9 -0
  102. package/src/Components/components/base/Icon/Icon.vue +21 -0
  103. package/src/Components/components/base/Layout/Col/Col.ts +23 -0
  104. package/src/Components/components/base/Layout/Col/Col.vue +46 -0
  105. package/src/Components/components/base/Layout/Col/style/Col.scss +9 -0
  106. package/src/Components/components/base/Layout/Row/Row.ts +23 -0
  107. package/src/Components/components/base/Layout/Row/Row.vue +38 -0
  108. package/src/Components/components/base/Layout/Row/style/Row.scss +10 -0
  109. package/src/Components/components/base/Layout/constant.ts +1 -0
  110. package/src/Components/components/base/Loading/Circle/Circle.ts +13 -0
  111. package/src/Components/components/base/Loading/Circle/Circle.vue +36 -0
  112. package/src/Components/components/base/Loading/Circle/style/Circle.scss +26 -0
  113. package/src/Components/components/base/Loading/Dot/Dot.ts +13 -0
  114. package/src/Components/components/base/Loading/Dot/Dot.vue +44 -0
  115. package/src/Components/components/base/Loading/Dot/style/Dot.scss +61 -0
  116. package/src/Components/components/base/Loading/Loading.ts +29 -0
  117. package/src/Components/components/base/Loading/Loading.vue +36 -0
  118. package/src/Components/components/base/Loading/style/Loading.scss +18 -0
  119. package/src/Components/components/base/Message/Message.ts +117 -0
  120. package/src/Components/components/base/Message/Message.vue +60 -0
  121. package/src/Components/components/base/Message/style/Message.scss +49 -0
  122. package/src/Components/components/base/MessageGroup/MessageGroup.vue +37 -0
  123. package/src/Components/components/base/Overlay/Overlay.ts +46 -0
  124. package/src/Components/components/base/Overlay/Overlay.vue +75 -0
  125. package/src/Components/components/base/Overlay/style/Overlay.scss +40 -0
  126. package/src/Components/components/base/Popover/Popover.ts +36 -0
  127. package/src/Components/components/base/Popover/Popover.vue +40 -0
  128. package/src/Components/components/base/Popover/PopoverWeb/PopoverWeb.vue +110 -0
  129. package/src/Components/components/base/Popover/PopoverWx/PopoverWx.vue +15 -0
  130. package/src/Components/components/base/Popover/style/Popover.scss +30 -0
  131. package/src/Components/components/base/Popover/utils/calculatePosition.ts +50 -0
  132. package/src/Components/components/base/Portal/Portal.ts +14 -0
  133. package/src/Components/components/base/Portal/Portal.vue +22 -0
  134. package/src/Components/components/base/Portal/miniprogram/Portal.vue +20 -0
  135. package/src/Components/components/base/Portal/vue2/Portal.vue +53 -0
  136. package/src/Components/components/base/Portal/vue3/Portal.vue +19 -0
  137. package/src/Components/components/base/TKImage/TKImage.ts +34 -0
  138. package/src/Components/components/base/TKImage/TKImage.vue +77 -0
  139. package/src/Components/components/base/TKImage/style/TKImage.scss +20 -0
  140. package/src/Components/components/base/TKText/TKText.ts +24 -0
  141. package/src/Components/components/base/TKText/TKText.vue +43 -0
  142. package/src/Components/components/base/TKText/style/TKText.scss +19 -0
  143. package/src/Components/components/base/ToggleWindow/ToggleWindow.ts +19 -0
  144. package/src/Components/components/base/ToggleWindow/ToggleWindow.vue +46 -0
  145. package/src/Components/components/base/ToggleWindow/ToggleWindowItem/ToggleWindowItem.ts +5 -0
  146. package/src/Components/components/base/ToggleWindow/ToggleWindowItem/ToggleWindowItem.vue +62 -0
  147. package/src/Components/components/base/ToggleWindow/ToggleWindowItem/style/ToggleWindowItem.scss +38 -0
  148. package/src/Components/components/base/ToggleWindow/constant.ts +1 -0
  149. package/src/Components/components/base/ToggleWindow/style/ToggleWindow.scss +7 -0
  150. package/src/Components/components/base/assets/message/close.svg +5 -0
  151. package/src/Components/components/base/assets/message/error.svg +1 -0
  152. package/src/Components/components/base/assets/message/info.svg +1 -0
  153. package/src/Components/components/base/assets/message/success.svg +1 -0
  154. package/src/Components/components/base/assets/message/warning.svg +1 -0
  155. package/src/Components/components/base/constants/index.ts +8 -0
  156. package/src/Components/components/base/hooks/useListenerEvent.ts +36 -0
  157. package/src/Components/components/base/hooks/useOnClickOutSide.ts +27 -0
  158. package/src/Components/components/base/styles/common.scss +43 -0
  159. package/src/Components/components/base/styles/var.scss +132 -0
  160. package/src/Components/components/base/util/checkEnv.ts +51 -0
  161. package/src/Components/components/base/util/checkVueVersion.ts +11 -0
  162. package/src/Components/components/base/util/classNames.ts +34 -0
  163. package/src/Components/components/base/util/filterObject.ts +11 -0
  164. package/src/Components/components/base/util/index.ts +10 -0
  165. package/src/Components/components/common/AudioStream/AudioStream.ts +29 -0
  166. package/src/Components/components/common/AudioStream/AudioStream.vue +65 -0
  167. package/src/Components/components/common/Button/Accept.vue +66 -0
  168. package/src/Components/components/common/Button/Camera.vue +115 -0
  169. package/src/Components/components/common/Button/FullScreen.vue +32 -0
  170. package/src/Components/components/common/Button/Hangup.vue +57 -0
  171. package/src/Components/components/common/Button/InviteUser.vue +52 -0
  172. package/src/Components/components/common/Button/Microphone.vue +109 -0
  173. package/src/Components/components/common/Button/Minimize.vue +39 -0
  174. package/src/Components/components/common/Button/Reject.vue +52 -0
  175. package/src/Components/components/common/Button/Speaker.vue +98 -0
  176. package/src/Components/components/common/Button/SwitchCamera.vue +58 -0
  177. package/src/Components/components/common/Button/ToggleButtonPanel.vue +44 -0
  178. package/src/Components/components/common/Button/VirtualBackground.vue +76 -0
  179. package/src/Components/components/common/Button/hooks/useConfig.ts +33 -0
  180. package/src/Components/components/common/Button/props/Button.ts +15 -0
  181. package/src/Components/components/common/Button/style/common.scss +5 -0
  182. package/src/Components/components/common/Button/style/desktop.scss +49 -0
  183. package/src/Components/components/common/Button/style/index.scss +2 -0
  184. package/src/Components/components/common/Button/style/mobile.scss +63 -0
  185. package/src/Components/components/common/ButtonPanel/ButtonPanel.vue +238 -0
  186. package/src/Components/components/common/ButtonPanel/config/InitConfig.ts +248 -0
  187. package/src/Components/components/common/ButtonPanel/config/VirtualBackgroundMobileConfig.ts +29 -0
  188. package/src/Components/components/common/ButtonPanel/hooks/useButtonPanelLayout.ts +63 -0
  189. package/src/Components/components/common/DeviceSelect/DeviceSelect.ts +11 -0
  190. package/src/Components/components/common/DeviceSelect/DeviceSelect.vue +158 -0
  191. package/src/Components/components/common/FloatWindow/FloatWindow.vue +64 -0
  192. package/src/Components/components/common/FloatWindow/desktop/FloatWindow.vue +106 -0
  193. package/src/Components/components/common/FloatWindow/mobile/FloatWindow.vue +28 -0
  194. package/src/Components/components/common/FloatWindow/mobile/FloatWindowGroupCall.vue +141 -0
  195. package/src/Components/components/common/FloatWindow/mobile/FloatWindowSingleCall.vue +109 -0
  196. package/src/Components/components/common/JoinGroupCard/JoinGroupCard.vue +51 -0
  197. package/src/Components/components/common/JoinGroupCard/desktop/JoinGroupCard.scss +80 -0
  198. package/src/Components/components/common/JoinGroupCard/desktop/JoinGroupCard.vue +57 -0
  199. package/src/Components/components/common/JoinGroupCard/mobile/JoinGroupCard.scss +60 -0
  200. package/src/Components/components/common/JoinGroupCard/mobile/JoinGroupCard.vue +65 -0
  201. package/src/Components/components/common/MicVolume/MicVolume.vue +37 -0
  202. package/src/Components/components/common/MicVolume/MicVolumeClosed.vue +11 -0
  203. package/src/Components/components/common/MicrophoneVolume/MicrophoneVolume.ts +10 -0
  204. package/src/Components/components/common/MicrophoneVolume/MicrophoneVolume.vue +61 -0
  205. package/src/Components/components/common/OverlayStream/OverlayStream.ts +102 -0
  206. package/src/Components/components/common/OverlayStream/OverlayStream.vue +104 -0
  207. package/src/Components/components/common/OverlayStream/style/OverlayStream.scss +12 -0
  208. package/src/Components/components/common/OverlayStream/style/mobile.scss +32 -0
  209. package/src/Components/components/common/OverlayStream/style/pc.scss +21 -0
  210. package/src/Components/components/common/PermitTip/CloseIcon.vue +3 -0
  211. package/src/Components/components/common/PermitTip/PermitTip.ts +33 -0
  212. package/src/Components/components/common/PermitTip/PermitTip.vue +62 -0
  213. package/src/Components/components/common/PermitTip/SystemPermitTip.vue +160 -0
  214. package/src/Components/components/common/Player/Player.ts +18 -0
  215. package/src/Components/components/common/Player/Player.vue +59 -0
  216. package/src/Components/components/common/Player/WeChatPlayer/WeChatPlayer.vue +101 -0
  217. package/src/Components/components/common/Player/WeChatPlayer/style/index.scss +38 -0
  218. package/src/Components/components/common/Popover/Popover.vue +85 -0
  219. package/src/Components/components/common/Pusher/Pusher.ts +18 -0
  220. package/src/Components/components/common/Pusher/Pusher.vue +78 -0
  221. package/src/Components/components/common/Pusher/WeChatPusher/WeChatPusher.vue +70 -0
  222. package/src/Components/components/common/Pusher/WeChatPusher/style/index.scss +37 -0
  223. package/src/Components/components/common/SelectUser/SelectUser.vue +74 -0
  224. package/src/Components/components/common/SelectUser/components/Dialog/TDialog.vue +94 -0
  225. package/src/Components/components/common/SelectUser/components/Dialog/style/color.css +43 -0
  226. package/src/Components/components/common/SelectUser/components/Dialog/style/dialog.css +3 -0
  227. package/src/Components/components/common/SelectUser/components/Dialog/style/h5.css +49 -0
  228. package/src/Components/components/common/SelectUser/components/Dialog/style/web.css +55 -0
  229. package/src/Components/components/common/SelectUser/components/Icon/TIcon.vue +44 -0
  230. package/src/Components/components/common/SelectUser/components/Icon/style/icon.css +6 -0
  231. package/src/Components/components/common/SelectUser/components/Transfer/TTransfer.vue +304 -0
  232. package/src/Components/components/common/SelectUser/components/Transfer/icon/back.svg +16 -0
  233. package/src/Components/components/common/SelectUser/components/Transfer/icon/cancel.svg +23 -0
  234. package/src/Components/components/common/SelectUser/components/Transfer/icon/selected.svg +27 -0
  235. package/src/Components/components/common/SelectUser/components/Transfer/style/color.css +64 -0
  236. package/src/Components/components/common/SelectUser/components/Transfer/style/h5.css +86 -0
  237. package/src/Components/components/common/SelectUser/components/Transfer/style/transfer.css +17 -0
  238. package/src/Components/components/common/SelectUser/components/Transfer/style/web.css +146 -0
  239. package/src/Components/components/common/SelectUser/index.ts +12 -0
  240. package/src/Components/components/common/Swiper/Swiper.vue +145 -0
  241. package/src/Components/components/common/Swiper/SwiperSlider.vue +55 -0
  242. package/src/Components/components/common/Swiper/index.ts +10 -0
  243. package/src/Components/components/common/Swiper/useSlide.ts +56 -0
  244. package/src/Components/components/common/Swiper/useSwiperSliders.ts +34 -0
  245. package/src/Components/components/common/SwiperWx/Swiper.vue +123 -0
  246. package/src/Components/components/common/SwiperWx/SwiperSlider.vue +87 -0
  247. package/src/Components/components/common/SwiperWx/index.ts +5 -0
  248. package/src/Components/components/common/TKStreamInfo/StreamInfo.ts +34 -0
  249. package/src/Components/components/common/TKStreamInfo/StreamInfoMobile.vue +82 -0
  250. package/src/Components/components/common/TKStreamInfo/StreamInfoPC.vue +58 -0
  251. package/src/Components/components/common/TKStreamInfo/TKStreamInfo.vue +43 -0
  252. package/src/Components/components/common/Timer/Timer.ts +14 -0
  253. package/src/Components/components/common/Timer/Timer.vue +24 -0
  254. package/src/Components/components/common/Tip/Tip.ts +5 -0
  255. package/src/Components/components/common/Tip/Tip.vue +67 -0
  256. package/src/Components/components/common/Toast/Toast.ts +84 -0
  257. package/src/Components/components/common/Toast/Toast.vue +133 -0
  258. package/src/Components/components/common/Toast/index.ts +6 -0
  259. package/src/Components/components/common/Toast/type.ts +16 -0
  260. package/src/Components/components/common/TopBar/TopBar.ts +8 -0
  261. package/src/Components/components/common/TopBar/TopBar.vue +116 -0
  262. package/src/Components/components/common/Waiting/Waiting.vue +126 -0
  263. package/src/Components/components/config/button/ClosedPanelUI.ts +109 -0
  264. package/src/Components/components/config/button/DefaultUI.ts +544 -0
  265. package/src/Components/components/config/button/index.ts +2 -0
  266. package/src/Components/context/ButtonPanelContext.ts +6 -0
  267. package/src/Components/context/CallInfoContext.ts +15 -0
  268. package/src/Components/context/CallerUserInfoContext.ts +9 -0
  269. package/src/Components/context/CustomUIConfigContext.ts +1 -0
  270. package/src/Components/context/FloatWindowContext.ts +5 -0
  271. package/src/Components/context/FocusItemContext.ts +1 -0
  272. package/src/Components/context/IsClickableContext.ts +1 -0
  273. package/src/Components/context/PopoverContext.ts +1 -0
  274. package/src/Components/context/TranslateContext.ts +1 -0
  275. package/src/Components/context/UserInfoContextExcludeVolume.ts +8 -0
  276. package/src/Components/context/index.ts +10 -0
  277. package/src/Components/hooks/index.ts +20 -0
  278. package/src/Components/hooks/useButtonPanelStatus.ts +6 -0
  279. package/src/Components/hooks/useCallDuration.ts +32 -0
  280. package/src/Components/hooks/useCallInfoContext.ts +6 -0
  281. package/src/Components/hooks/useCallerUserInfoContext.ts +6 -0
  282. package/src/Components/hooks/useCustomUI.ts +7 -0
  283. package/src/Components/hooks/useCustomUIButtonConfig.ts +96 -0
  284. package/src/Components/hooks/useDeviceList.ts +51 -0
  285. package/src/Components/hooks/useFloatWindowContext.ts +6 -0
  286. package/src/Components/hooks/useFocusContext.ts +6 -0
  287. package/src/Components/hooks/useGetVolumeMap.ts +59 -0
  288. package/src/Components/hooks/useGroupCallLayout.ts +142 -0
  289. package/src/Components/hooks/useIsClickableContext.ts +6 -0
  290. package/src/Components/hooks/useJoinGroupCall.ts +69 -0
  291. package/src/Components/hooks/useNetWorkStatus.ts +30 -0
  292. package/src/Components/hooks/usePlayer.ts +32 -0
  293. package/src/Components/hooks/usePopover.ts +6 -0
  294. package/src/Components/hooks/useTip.ts +42 -0
  295. package/src/Components/hooks/useTranslate.ts +7 -0
  296. package/src/Components/hooks/useUserInfoContextExcludeVolume.ts +6 -0
  297. package/src/Components/hooks/useViewBackgroundConfig.ts +12 -0
  298. package/src/Components/util/deepClone.ts +15 -0
  299. package/src/Components/util/findValues.ts +21 -0
  300. package/src/Components/util/index.ts +6 -0
  301. package/src/Components/util/isEmpty.ts +15 -0
  302. package/src/Components/util/isEqual.ts +40 -0
  303. package/src/Components/util/isObject.ts +3 -0
  304. package/src/Components/util/stringToPath.ts +78 -0
  305. package/src/Components/util/toggleScreen.ts +10 -0
  306. package/src/Components/util/uiConfig.ts +74 -0
  307. package/src/TUICallService/CallService/UIDesign.ts +174 -0
  308. package/src/TUICallService/CallService/bellContext.ts +88 -0
  309. package/src/TUICallService/CallService/chatCombine.ts +313 -0
  310. package/src/TUICallService/CallService/engineEventHandler.ts +404 -0
  311. package/src/TUICallService/CallService/index.ts +799 -0
  312. package/src/TUICallService/CallService/miniProgram.ts +65 -0
  313. package/src/TUICallService/CallService/utils.ts +281 -0
  314. package/src/TUICallService/TUIGlobal/tuiGlobal.ts +43 -0
  315. package/src/TUICallService/TUIStore/callStore.ts +93 -0
  316. package/src/TUICallService/TUIStore/tuiStore.ts +167 -0
  317. package/src/TUICallService/assets/phone_dialing.mp3 +0 -0
  318. package/src/TUICallService/assets/phone_ringing.mp3 +0 -0
  319. package/src/TUICallService/const/call.ts +157 -0
  320. package/src/TUICallService/const/error.ts +20 -0
  321. package/src/TUICallService/const/index.ts +103 -0
  322. package/src/TUICallService/const/log.ts +9 -0
  323. package/src/TUICallService/index.ts +37 -0
  324. package/src/TUICallService/interface/ICallService.ts +70 -0
  325. package/src/TUICallService/interface/ICallStore.ts +55 -0
  326. package/src/TUICallService/interface/ITUIGlobal.ts +36 -0
  327. package/src/TUICallService/interface/ITUIStore.ts +87 -0
  328. package/src/TUICallService/interface/index.ts +4 -0
  329. package/src/TUICallService/locales/en.ts +135 -0
  330. package/src/TUICallService/locales/index.ts +57 -0
  331. package/src/TUICallService/locales/ja_JP.ts +134 -0
  332. package/src/TUICallService/locales/zh-cn.ts +130 -0
  333. package/src/TUICallService/serve/callManager.ts +109 -0
  334. package/src/TUICallService/utils/common-utils.ts +269 -0
  335. package/src/TUICallService/utils/decorators/promise-retry.ts +51 -0
  336. package/src/TUICallService/utils/env.ts +51 -0
  337. package/src/TUICallService/utils/index.ts +32 -0
  338. package/src/TUICallService/utils/is-empty.ts +31 -0
  339. package/src/TUICallService/utils/retry.ts +88 -0
  340. package/src/TUICallService/utils/timer.ts +162 -0
  341. package/src/TUICallService/utils/validate/avoidRepeatedCall.ts +39 -0
  342. package/src/TUICallService/utils/validate/index.ts +7 -0
  343. package/src/adapter-vue.ts +4 -0
  344. package/src/index.ts +65 -0
  345. package/stats.html +4949 -0
  346. package/tuicall-uikit-vue.es.js +8568 -0
  347. package/tuicall-uikit-vue.umd.js +2 -0
  348. package/types/Components/assets/desktop/permission/index.d.ts +5 -0
  349. package/types/Components/assets/permission/desktop/index.d.ts +5 -0
  350. package/types/Components/components/SingleCall/hooks/useGetLargeViewName.d.ts +2 -0
  351. package/types/Components/components/base/Avatar/Avatar.d.ts +34 -0
  352. package/types/Components/components/base/Button/Button.d.ts +56 -0
  353. package/types/Components/components/base/Grid/Grid.d.ts +23 -0
  354. package/types/Components/components/base/Icon/Icon.d.ts +9 -0
  355. package/types/Components/components/base/Layout/Col/Col.d.ts +20 -0
  356. package/types/Components/components/base/Layout/Row/Row.d.ts +20 -0
  357. package/types/Components/components/base/Layout/constant.d.ts +1 -0
  358. package/types/Components/components/base/Loading/Circle/Circle.d.ts +13 -0
  359. package/types/Components/components/base/Loading/Dot/Dot.d.ts +13 -0
  360. package/types/Components/components/base/Loading/Loading.d.ts +26 -0
  361. package/types/Components/components/base/Message/Message.d.ts +50 -0
  362. package/types/Components/components/base/Overlay/Overlay.d.ts +45 -0
  363. package/types/Components/components/base/Popover/Popover.d.ts +34 -0
  364. package/types/Components/components/base/Popover/utils/calculatePosition.d.ts +4 -0
  365. package/types/Components/components/base/Portal/Portal.d.ts +14 -0
  366. package/types/Components/components/base/TKImage/TKImage.d.ts +33 -0
  367. package/types/Components/components/base/TKText/TKText.d.ts +24 -0
  368. package/types/Components/components/base/ToggleWindow/ToggleWindow.d.ts +18 -0
  369. package/types/Components/components/base/ToggleWindow/ToggleWindowItem/ToggleWindowItem.d.ts +5 -0
  370. package/types/Components/components/base/ToggleWindow/constant.d.ts +1 -0
  371. package/types/Components/components/base/constants/index.d.ts +7 -0
  372. package/types/Components/components/base/hooks/useListenerEvent.d.ts +13 -0
  373. package/types/Components/components/base/hooks/useOnClickOutSide.d.ts +1 -0
  374. package/types/Components/components/base/util/checkEnv.d.ts +10 -0
  375. package/types/Components/components/base/util/checkVueVersion.d.ts +4 -0
  376. package/types/Components/components/base/util/classNames.d.ts +1 -0
  377. package/types/Components/components/base/util/filterObject.d.ts +1 -0
  378. package/types/Components/components/base/util/index.d.ts +5 -0
  379. package/types/Components/components/common/AudioStream/AudioStream.d.ts +29 -0
  380. package/types/Components/components/common/Button/hooks/useConfig.d.ts +2 -0
  381. package/types/Components/components/common/Button/props/Button.d.ts +15 -0
  382. package/types/Components/components/common/ButtonPanel/config/InitConfig.d.ts +89 -0
  383. package/types/Components/components/common/ButtonPanel/config/VirtualBackgroundMobileConfig.d.ts +66 -0
  384. package/types/Components/components/common/ButtonPanel/hooks/useButtonPanelLayout.d.ts +4 -0
  385. package/types/Components/components/common/DeviceSelect/DeviceSelect.d.ts +11 -0
  386. package/types/Components/components/common/MicrophoneVolume/MicrophoneVolume.d.ts +10 -0
  387. package/types/Components/components/common/OverlayStream/OverlayStream.d.ts +92 -0
  388. package/types/Components/components/common/PermitTip/PermitTip.d.ts +3 -0
  389. package/types/Components/components/common/Player/Player.d.ts +18 -0
  390. package/types/Components/components/common/Pusher/Pusher.d.ts +18 -0
  391. package/types/Components/components/common/SelectUser/index.d.ts +6 -0
  392. package/types/Components/components/common/Swiper/index.d.ts +7 -0
  393. package/types/Components/components/common/Swiper/useSlide.d.ts +7 -0
  394. package/types/Components/components/common/Swiper/useSwiperSliders.d.ts +1 -0
  395. package/types/Components/components/common/SwiperWx/index.d.ts +4 -0
  396. package/types/Components/components/common/TKStreamInfo/StreamInfo.d.ts +34 -0
  397. package/types/Components/components/common/Timer/Timer.d.ts +14 -0
  398. package/types/Components/components/common/Tip/Tip.d.ts +5 -0
  399. package/types/Components/components/common/Toast/Toast.d.ts +4 -0
  400. package/types/Components/components/common/Toast/index.d.ts +2 -0
  401. package/types/Components/components/common/Toast/type.d.ts +16 -0
  402. package/types/Components/components/common/TopBar/TopBar.d.ts +8 -0
  403. package/types/Components/components/config/button/ClosedPanelUI.d.ts +3380 -0
  404. package/types/Components/components/config/button/DefaultUI.d.ts +14751 -0
  405. package/types/Components/components/config/button/index.d.ts +2 -0
  406. package/types/Components/context/ButtonPanelContext.d.ts +4 -0
  407. package/types/Components/context/CallInfoContext.d.ts +13 -0
  408. package/types/Components/context/CallerUserInfoContext.d.ts +8 -0
  409. package/types/Components/context/CustomUIConfigContext.d.ts +1 -0
  410. package/types/Components/context/FloatWindowContext.d.ts +4 -0
  411. package/types/Components/context/FocusItemContext.d.ts +1 -0
  412. package/types/Components/context/IsClickableContext.d.ts +1 -0
  413. package/types/Components/context/PopoverContext.d.ts +1 -0
  414. package/types/Components/context/TranslateContext.d.ts +1 -0
  415. package/types/Components/context/UserInfoContextExcludeVolume.d.ts +6 -0
  416. package/types/Components/context/index.d.ts +10 -0
  417. package/types/Components/hooks/index.d.ts +20 -0
  418. package/types/Components/hooks/useButtonPanelStatus.d.ts +2 -0
  419. package/types/Components/hooks/useCallDuration.d.ts +3 -0
  420. package/types/Components/hooks/useCallInfoContext.d.ts +2 -0
  421. package/types/Components/hooks/useCallerUserInfoContext.d.ts +2 -0
  422. package/types/Components/hooks/useCustomUI.d.ts +3 -0
  423. package/types/Components/hooks/useCustomUIButtonConfig.d.ts +1 -0
  424. package/types/Components/hooks/useDeviceList.d.ts +7 -0
  425. package/types/Components/hooks/useFloatWindowContext.d.ts +2 -0
  426. package/types/Components/hooks/useFocusContext.d.ts +1 -0
  427. package/types/Components/hooks/useGetVolumeMap.d.ts +1 -0
  428. package/types/Components/hooks/useGroupCallLayout.d.ts +1 -0
  429. package/types/Components/hooks/useIsClickableContext.d.ts +2 -0
  430. package/types/Components/hooks/useJoinGroupCall.d.ts +9 -0
  431. package/types/Components/hooks/useNetWorkStatus.d.ts +3 -0
  432. package/types/Components/hooks/usePlayer.d.ts +1 -0
  433. package/types/Components/hooks/usePopover.d.ts +2 -0
  434. package/types/Components/hooks/useTip.d.ts +5 -0
  435. package/types/Components/hooks/useTranslate.d.ts +2 -0
  436. package/types/Components/hooks/useUserInfoContextExcludeVolume.d.ts +2 -0
  437. package/types/Components/hooks/useViewBackgroundConfig.d.ts +1 -0
  438. package/types/Components/util/deepClone.d.ts +1 -0
  439. package/types/Components/util/findValues.d.ts +1 -0
  440. package/types/Components/util/index.d.ts +6 -0
  441. package/types/Components/util/isEmpty.d.ts +1 -0
  442. package/types/Components/util/isEqual.d.ts +1 -0
  443. package/types/Components/util/isObject.d.ts +1 -0
  444. package/types/Components/util/stringToPath.d.ts +12 -0
  445. package/types/Components/util/toggleScreen.d.ts +1 -0
  446. package/types/Components/util/uiConfig.d.ts +3 -0
  447. package/types/TUICallService/CallService/UIDesign.d.ts +28 -0
  448. package/types/TUICallService/CallService/bellContext.d.ts +19 -0
  449. package/types/TUICallService/CallService/chatCombine.d.ts +50 -0
  450. package/types/TUICallService/CallService/engineEventHandler.d.ts +35 -0
  451. package/types/TUICallService/CallService/index.d.ts +98 -0
  452. package/types/TUICallService/CallService/miniProgram.d.ts +7 -0
  453. package/types/TUICallService/CallService/utils.d.ts +42 -0
  454. package/types/TUICallService/TUIGlobal/tuiGlobal.d.ts +21 -0
  455. package/types/TUICallService/TUIStore/callStore.d.ts +10 -0
  456. package/types/TUICallService/TUIStore/tuiStore.d.ts +57 -0
  457. package/types/TUICallService/const/call.d.ts +141 -0
  458. package/types/TUICallService/const/error.d.ts +2 -0
  459. package/types/TUICallService/const/index.d.ts +27 -0
  460. package/types/TUICallService/const/log.d.ts +7 -0
  461. package/types/TUICallService/index.d.ts +5 -0
  462. package/types/TUICallService/interface/ICallService.d.ts +69 -0
  463. package/types/TUICallService/interface/ICallStore.d.ts +47 -0
  464. package/types/TUICallService/interface/ITUIGlobal.d.ts +36 -0
  465. package/types/TUICallService/interface/ITUIStore.d.ts +83 -0
  466. package/types/TUICallService/interface/index.d.ts +4 -0
  467. package/types/TUICallService/locales/en.d.ts +128 -0
  468. package/types/TUICallService/locales/index.d.ts +10 -0
  469. package/types/TUICallService/locales/ja_JP.d.ts +127 -0
  470. package/types/TUICallService/locales/zh-cn.d.ts +123 -0
  471. package/types/TUICallService/serve/callManager.d.ts +11 -0
  472. package/types/TUICallService/utils/common-utils.d.ts +62 -0
  473. package/types/TUICallService/utils/decorators/promise-retry.d.ts +32 -0
  474. package/types/TUICallService/utils/env.d.ts +10 -0
  475. package/types/TUICallService/utils/index.d.ts +2 -0
  476. package/types/TUICallService/utils/is-empty.d.ts +2 -0
  477. package/types/TUICallService/utils/retry.d.ts +36 -0
  478. package/types/TUICallService/utils/timer.d.ts +64 -0
  479. package/types/TUICallService/utils/validate/avoidRepeatedCall.d.ts +10 -0
  480. package/types/TUICallService/utils/validate/index.d.ts +2 -0
  481. package/types/adapter-vue.d.ts +4 -0
  482. package/types/index.d.ts +11 -0
  483. package/types/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,8 @@
1
+ import { IUserInfo } from '../../TUICallService/interface';
2
+
3
+ export type TUserInfoExcludeVolumeContextValue = {
4
+ localUserInfoExcludeVolume: IUserInfo,
5
+ remoteUserListExcludeVolume: IUserInfo[],
6
+ };
7
+
8
+ export const UserInfoExcludeVolumeContextKey = 'UserInfoExcludeVolumeContextKey';
@@ -0,0 +1,10 @@
1
+ export * from './CallInfoContext';
2
+ export * from './CallerUserInfoContext';
3
+ export * from './UserInfoContextExcludeVolume';
4
+ export * from './FocusItemContext';
5
+ export * from './ButtonPanelContext';
6
+ export * from './FloatWindowContext';
7
+ export * from './IsClickableContext';
8
+ export * from './PopoverContext';
9
+ export * from './CustomUIConfigContext';
10
+ export * from './TranslateContext';
@@ -0,0 +1,20 @@
1
+ export * from './useCallerUserInfoContext';
2
+ export * from './useCallInfoContext';
3
+ export * from './useDeviceList';
4
+ export * from './useGetVolumeMap';
5
+ export * from './useTip';
6
+ export * from './useNetWorkStatus';
7
+ export * from './usePlayer';
8
+ export * from './useUserInfoContextExcludeVolume';
9
+ export * from './useCallDuration';
10
+ export * from './useButtonPanelStatus';
11
+ export * from './useFocusContext';
12
+ export * from './useFloatWindowContext';
13
+ export * from './useIsClickableContext';
14
+ export * from './usePopover';
15
+ export * from './useGroupCallLayout';
16
+ export * from './useCustomUIButtonConfig';
17
+ export * from './useCustomUI';
18
+ export * from './useViewBackgroundConfig';
19
+ export * from './useJoinGroupCall';
20
+ export * from './useTranslate';
@@ -0,0 +1,6 @@
1
+ import { inject, ref } from '../../adapter-vue';
2
+ import { ButtonPanelContextKey, TButtonPanelContextValue } from '../context';
3
+
4
+ export function useButtonPanelStatus() {
5
+ return inject<TButtonPanelContextValue>(ButtonPanelContextKey, { status: ref('open') });
6
+ }
@@ -0,0 +1,32 @@
1
+ import { NAME, StoreName, TUIStore } from '../../TUICallService';
2
+ import { ref, onMounted, onUnmounted } from '../../adapter-vue';
3
+
4
+ export function useCallDuration() {
5
+ const callDuration = ref(TUIStore.getData(StoreName.CALL, NAME.CALL_DURATION));
6
+
7
+ const handleCallDurationChange = (value) => {
8
+ callDuration.value = value;
9
+ };
10
+
11
+ onMounted(() => {
12
+ TUIStore.watch(
13
+ StoreName.CALL,
14
+ {
15
+ [NAME.CALL_DURATION]: handleCallDurationChange,
16
+ },
17
+ {
18
+ notifyRangeWhenWatch: NAME.MYSELF,
19
+ },
20
+ );
21
+ });
22
+ onUnmounted(() => {
23
+ TUIStore.unwatch(
24
+ StoreName.CALL,
25
+ {
26
+ [NAME.CALL_DURATION]: handleCallDurationChange,
27
+ }
28
+ );
29
+ });
30
+
31
+ return { callDuration };
32
+ }
@@ -0,0 +1,6 @@
1
+ import { inject } from '../../adapter-vue';
2
+ import { CallInfoContextKey, TCallInfoContextValue } from '../context';
3
+
4
+ export function useCallInfoContext() {
5
+ return inject<TCallInfoContextValue>(CallInfoContextKey);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { inject } from '../../adapter-vue';
2
+ import { CallerUserInfoContextKey, TCallerUserInfoValue } from '../context';
3
+
4
+ export function useCallerUserInfoContext() {
5
+ return inject<TCallerUserInfoValue>(CallerUserInfoContextKey);
6
+ }
@@ -0,0 +1,7 @@
1
+ import { ICustomUIConfig } from "../../TUICallService/const";
2
+ import { inject, Ref } from "../../adapter-vue";
3
+ import { CustomUIConfigContextKey } from "../context";
4
+
5
+ export function useCustomUI() {
6
+ return inject<Ref<ICustomUIConfig>>(CustomUIConfigContextKey);
7
+ }
@@ -0,0 +1,96 @@
1
+ import { watch, ref, toRefs, computed } from '../../adapter-vue';
2
+ import { useCustomUI } from './useCustomUI';
3
+ import { TUIGlobal, CallStatus } from '../../TUICallService';
4
+ import { add, deepClone, findValues, modify } from '../util';
5
+ import { VirtualBackgroundMobileConfig } from '../components/common/ButtonPanel/config/VirtualBackgroundMobileConfig';
6
+ import { useCallInfoContext } from './useCallInfoContext';
7
+ import { useUserInfoExcludeVolumeContext } from './useUserInfoContextExcludeVolume';
8
+ import { ButtonPanelConfig } from '../components/common/ButtonPanel/config/InitConfig';
9
+
10
+ function setVirtualBackgroundConfig(config) {
11
+ const newConfig = deepClone(config);
12
+ modify(newConfig, 'mobile.singleCall.video', VirtualBackgroundMobileConfig);
13
+ add(newConfig, 'pc.singleCall.video.calling[0][2]', { name: 'virtualBackground', props: {} });
14
+ add(newConfig, 'pc.singleCall.video.accept[0][1]', { name: 'virtualBackground', props: {} });
15
+ add(newConfig, 'pc.singleCall.video.connected[0][3]', { name: 'virtualBackground', props: {} });
16
+ add(newConfig, 'pc.groupCall.video.calling[0][3]', { name: 'virtualBackground', props: {} });
17
+ add(newConfig, 'pc.groupCall.video.connected[0][4]', { name: 'virtualBackground', props: {} });
18
+ return newConfig;
19
+ }
20
+
21
+ function setCloseCameraConfig(config, isVideoAvailable, isShowVirtualBackgroundIcon) {
22
+ let newConfig = deepClone(config);
23
+ if(isVideoAvailable){
24
+ modify(newConfig, 'mobile.singleCall.video.connected[1][2].props.show', true);
25
+ if(isShowVirtualBackgroundIcon) {
26
+ setVirtualBackgroundConfig(newConfig);
27
+ }
28
+ } else {
29
+ modify(newConfig, 'mobile.singleCall.video.connected[1][2].props.show', false);
30
+ if(isShowVirtualBackgroundIcon) {
31
+ modify(newConfig, 'mobile.singleCall.video.connected[1][0].props.show', false);
32
+ modify(newConfig, 'pc.singleCall.video.connected[0][3].props.show', false);
33
+ modify(newConfig, 'pc.groupCall.video.connected[0][4].props.show', false);
34
+ }
35
+ }
36
+ return newConfig;
37
+ }
38
+
39
+ export function useCustomUIButtonConfig() {
40
+ const { isShowEnableVirtualBackground, callStatus } = toRefs(useCallInfoContext());
41
+ const customUIConfig = useCustomUI();
42
+ const { localUserInfoExcludeVolume: localUserInfo } = toRefs(useUserInfoExcludeVolumeContext());
43
+ const isVideoAvailable = computed(() => localUserInfo?.value.isVideoAvailable || false);
44
+ const isShowVirtualBackgroundIcon = computed(() => isShowEnableVirtualBackground.value && !TUIGlobal.isH5);
45
+ const results = ref([]);
46
+
47
+ watch([customUIConfig, isShowEnableVirtualBackground, isVideoAvailable], () => {
48
+ let initConfig = deepClone(ButtonPanelConfig);
49
+ if (isShowVirtualBackgroundIcon.value) {
50
+ initConfig = setVirtualBackgroundConfig(ButtonPanelConfig);
51
+ }
52
+ if(callStatus.value === CallStatus.CONNECTED) {
53
+ initConfig = setCloseCameraConfig(initConfig, isVideoAvailable.value, isShowVirtualBackgroundIcon.value);
54
+ }
55
+ const { button: buttonsConfig } = customUIConfig.value;
56
+ const rs = [];
57
+ function condition(value) {
58
+ return Object.keys(buttonsConfig).includes(value);
59
+ }
60
+
61
+ function formatResults({ key, value }) {
62
+ const valueArr = value.split('.');
63
+ let path = valueArr.slice(0, valueArr.length - 1);
64
+ const rowPath = valueArr.slice(0, valueArr.length - 2);
65
+ const rowIndex = rowPath[rowPath.length - 1];
66
+ if (rowIndex === '0') {
67
+ for(let i = 0; i < 3; i++) {
68
+ let newPath = rowPath.slice();
69
+ newPath.push(i);
70
+ newPath.push('customStyle');
71
+ newPath.push('justifyContent');
72
+ newPath = newPath.join('.');
73
+ rs.push({ path: newPath, value: 'center' });
74
+ }
75
+ }
76
+
77
+ path.push('props');
78
+ path.push('show');
79
+ path = path.join('.');
80
+ return {
81
+ path,
82
+ value: buttonsConfig?.[key]?.show,
83
+ };
84
+ }
85
+
86
+ findValues(initConfig, condition, '', rs, formatResults);
87
+ rs?.forEach((item) => {
88
+ modify(initConfig, item.path, item.value);
89
+ });
90
+ results.value = initConfig;
91
+ }, {
92
+ immediate: true,
93
+ });
94
+
95
+ return results;
96
+ }
@@ -0,0 +1,51 @@
1
+ import { ref, onMounted, onUnmounted } from '../../adapter-vue';
2
+ import { TUIStore } from '../../TUICallService';
3
+ import { DeviceType, NAME, StoreName } from '../../TUICallService/const';
4
+
5
+ export function useDeviceList(deviceType: DeviceType) {
6
+ const deviceList = ref([]);
7
+ const currentDeviceId = ref('');
8
+
9
+ const handleDeviceListChange = (value) => {
10
+ switch (deviceType) {
11
+ case DeviceType.CAMERA:
12
+ deviceList.value = value?.cameraList || [];
13
+ currentDeviceId.value = value?.currentCamera?.deviceId || '';
14
+ break;
15
+ case DeviceType.MICROPHONE:
16
+ deviceList.value = value?.microphoneList || [];
17
+ currentDeviceId.value = value?.currentMicrophone?.deviceId || '';
18
+ break;
19
+ case DeviceType.SPEAKER:
20
+ deviceList.value = value?.speakerList || [];
21
+ currentDeviceId.value = value?.currentSpeaker?.deviceId || '';
22
+ break;
23
+ default:
24
+ break;
25
+ }
26
+ };
27
+
28
+ const updateCurrentDeviceId = (value) => {
29
+ currentDeviceId.value = value;
30
+ };
31
+
32
+ onMounted(() => {
33
+ TUIStore.watch(
34
+ StoreName.CALL,
35
+ {
36
+ [NAME.DEVICE_LIST]: handleDeviceListChange,
37
+ },
38
+ {
39
+ notifyRangeWhenWatch: NAME.MYSELF,
40
+ },
41
+ );
42
+ });
43
+
44
+ onUnmounted(() => {
45
+ TUIStore.unwatch(StoreName.CALL, {
46
+ [NAME.DEVICE_LIST]: handleDeviceListChange,
47
+ });
48
+ });
49
+
50
+ return [{ deviceList, currentDeviceId }, { updateCurrentDeviceId }] as const;
51
+ }
@@ -0,0 +1,6 @@
1
+ import { inject } from '../../adapter-vue';
2
+ import { FloatWindowContextKey, TFloatWindowContextValue } from '../context';
3
+
4
+ export function useFloatWindowContext() {
5
+ return inject<TFloatWindowContextValue>(FloatWindowContextKey);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { inject, ref } from '../../adapter-vue';
2
+ import { FocusContextKey } from '../context';
3
+
4
+ export function useFocusContext() {
5
+ return inject(FocusContextKey, ref('open'));
6
+ }
@@ -0,0 +1,59 @@
1
+ import { ref, onMounted, onUnmounted } from '../../adapter-vue';
2
+ import { TUIStore, TUIGlobal } from '../../TUICallService';
3
+ import { NAME, StoreName } from '../../TUICallService/const';
4
+ import { isEqual } from '../util';
5
+
6
+ export function useGetVolumeMap() {
7
+ const volumeMap = ref();
8
+ const remoteUserInfoList = ref(TUIStore.getData(StoreName.CALL, NAME.REMOTE_USER_INFO_LIST));
9
+
10
+ const handleLocalUserInfoChange = (value) => {
11
+ const isAudioAvailable = TUIGlobal.isWeChat ? value.enableMic : value.isAudioAvailable;
12
+ if (isAudioAvailable) {
13
+ volumeMap.value = { ...volumeMap.value, localVideo: value.volume };
14
+ }
15
+ };
16
+ const handleRemoteUserInfoListChange = (value) => {
17
+ const rs = {};
18
+ if (value.length !== remoteUserInfoList.value.length || !isEqual(value, remoteUserInfoList.value)) {
19
+ remoteUserInfoList.value = value;
20
+ remoteUserInfoList.value.forEach(item => {
21
+ const isAudioAvailable = TUIGlobal.isWeChat ? item.hasAudio : item.isAudioAvailable;
22
+ if (isAudioAvailable) {
23
+ const domId = TUIGlobal.isWeChat ? item.userID : item.domId;
24
+ rs[domId] = item.volume;
25
+ }
26
+ });
27
+
28
+ volumeMap.value = { ...volumeMap.value, ...rs };
29
+ }
30
+ };
31
+
32
+ let watchOptions = {
33
+ [NAME.LOCAL_USER_INFO]: handleLocalUserInfoChange,
34
+ [NAME.REMOTE_USER_INFO_LIST]: handleRemoteUserInfoListChange,
35
+ };
36
+
37
+ if (TUIGlobal.isUniPlatform) {
38
+ watchOptions = {
39
+ [NAME.PUSHER]: handleLocalUserInfoChange,
40
+ [NAME.PLAYER]: handleRemoteUserInfoListChange,
41
+ };
42
+ }
43
+
44
+ onMounted(() => {
45
+ TUIStore.watch(
46
+ StoreName.CALL,
47
+ watchOptions,
48
+ {
49
+ notifyRangeWhenWatch: NAME.MYSELF,
50
+ },
51
+ );
52
+ });
53
+
54
+ onUnmounted(() => {
55
+ TUIStore.unwatch(StoreName.CALL, watchOptions);
56
+ });
57
+
58
+ return volumeMap;
59
+ }
@@ -0,0 +1,142 @@
1
+ import { watch, ref, toRefs } from '../../adapter-vue';
2
+ import { TUIGlobal } from '../../TUICallService';
3
+ import { useFloatWindowContext } from './useFloatWindowContext';
4
+
5
+ const generateDefaultLayout = (length: number, size: number) => {
6
+ const layout = [{
7
+ i: 0, x: 0, y: 0, w: size, h: size,
8
+ }];
9
+
10
+ for (let i = 1; i < length; i++) {
11
+ const isWrap = layout[i - 1].x + size === 12;
12
+ layout[i] = {
13
+ i,
14
+ x: layout[i - 1].x + size === 12 ? 0 : layout[i - 1].x + size,
15
+ y: layout[i - 1].y + (isWrap ? size : 0),
16
+ w: size,
17
+ h: size,
18
+ };
19
+ }
20
+
21
+ if (length === 3) {
22
+ layout[length - 1].x += 3;
23
+ }
24
+
25
+ if (length > 3 && TUIGlobal.isPC) {
26
+ if (length % 3 === 2) {
27
+ layout[length - 1].x += 2;
28
+ layout[length - 2].x += 2;
29
+ }
30
+ }
31
+
32
+ return layout;
33
+ };
34
+
35
+ export function useGroupCallLayout(focus, length) {
36
+ const { isFloatWindow } = toRefs(useFloatWindowContext());
37
+ const newLayout = ref();
38
+ watch([focus, length, isFloatWindow], () => {
39
+ if (isFloatWindow.value) {
40
+ const a = [];
41
+ for(let i = 0; i < length.value; i++) {
42
+ a[i] = {
43
+ i,
44
+ x: 0,
45
+ y: 0,
46
+ w: 12,
47
+ h: 12,
48
+ };
49
+ }
50
+ newLayout.value = a;
51
+ return;
52
+ }
53
+
54
+ const arr = Object.keys(Array.from({ length: length.value }));
55
+ const gridItemSize = length.value <= 4 ? 6 : 4;
56
+ const defaultLayout = generateDefaultLayout(length.value, gridItemSize);
57
+ newLayout.value = defaultLayout;
58
+ let colIndex;
59
+ let rowIndex;
60
+
61
+ if (focus.value !== null) {
62
+ if (arr.length < 5) {
63
+ const newArr = arr.concat();
64
+ newArr.splice(focus.value, 1);
65
+ newArr.unshift(focus.value);
66
+ } else {
67
+ rowIndex = focus.value % 3;
68
+ colIndex = Math.floor(focus.value / 3);
69
+ }
70
+
71
+ if (arr.length < 5) {
72
+ const focusIndex = defaultLayout.findIndex((item) => item.i === focus.value);
73
+
74
+ if (focusIndex !== -1) {
75
+ const temp = defaultLayout[0];
76
+ defaultLayout[0] = defaultLayout[focusIndex];
77
+ defaultLayout[focusIndex] = temp;
78
+ for (let i = 0; i < defaultLayout.length; i++) {
79
+ const item = defaultLayout[i];
80
+ if (i === 0) {
81
+ item.w += 6;
82
+ item.h += 6;
83
+ item.x = 0;
84
+ item.y = 0;
85
+ } else {
86
+ item.x = (i - 1) * 4;
87
+ item.y = 12;
88
+ item.w = 4;
89
+ item.h = 4;
90
+ }
91
+ }
92
+ }
93
+ } else {
94
+ let focusStyle;
95
+ if (rowIndex === 0) {
96
+ if (defaultLayout[focus.value + 1]) defaultLayout[focus.value + 1].x += 4;
97
+ if (defaultLayout[focus.value + 2]) defaultLayout[focus.value + 2].y += 4;
98
+ focusStyle = {
99
+ i: focus.value,
100
+ x: 0,
101
+ y: colIndex * 4,
102
+ w: 8,
103
+ h: 8,
104
+ };
105
+ } else if (rowIndex === 2) {
106
+ focusStyle = {
107
+ i: focus.value,
108
+ x: 4,
109
+ y: colIndex * 4,
110
+ w: 8,
111
+ h: 8,
112
+ };
113
+ defaultLayout[focus.value - 1].x = 0;
114
+ defaultLayout[focus.value - 1].y += 4;
115
+ } else if (rowIndex === 1) {
116
+ focusStyle = {
117
+ i: focus.value,
118
+ x: 4,
119
+ y: colIndex * 4,
120
+ w: 8,
121
+ h: 8,
122
+ };
123
+ if (defaultLayout[focus.value + 1]) {
124
+ defaultLayout[focus.value + 1].x = 0;
125
+ defaultLayout[focus.value + 1].y += 4;
126
+ }
127
+ }
128
+ const start = 3 - rowIndex;
129
+ for (let i = focus.value + start; i < defaultLayout.length; i++) {
130
+ const item = defaultLayout[i];
131
+ item.y += 4;
132
+ }
133
+ defaultLayout[focus.value] = focusStyle;
134
+ }
135
+ newLayout.value = defaultLayout;
136
+ }
137
+ }, {
138
+ immediate: true,
139
+ });
140
+
141
+ return newLayout;
142
+ }
@@ -0,0 +1,6 @@
1
+ import { inject, Ref } from '../../adapter-vue';
2
+ import { IsClickableContextKey } from '../context';
3
+
4
+ export function useIsClickableContext() {
5
+ return inject<Ref<boolean>>(IsClickableContextKey);
6
+ }
@@ -0,0 +1,69 @@
1
+ import { ref, onMounted, onUnmounted } from '../../adapter-vue';
2
+ import { TUIStore } from '../../TUICallService';
3
+ import { NAME, StoreName } from '../../TUICallService/const';
4
+
5
+ export function useJoinGroupCall() {
6
+ const roomId = ref(TUIStore.getData(StoreName.CALL, NAME.ROOM_ID));
7
+ const roomIdType = ref(TUIStore.getData(StoreName.CALL, NAME.ROOM_ID_TYPE));
8
+ const groupId = ref(TUIStore.getData(StoreName.CALL, NAME.GROUP_ID));
9
+ const callMediaType = ref(TUIStore.getData(StoreName.CALL, NAME.CALL_MEDIA_TYPE));
10
+ const groupCallMembers = ref(TUIStore.getData(StoreName.CALL, NAME.GROUP_CALL_MEMBERS));
11
+ const callStatus = ref(TUIStore.getData(StoreName.CALL, NAME.CALL_STATUS));
12
+ const callId = ref(TUIStore.getData(StoreName.CALL, NAME.CALL_ID));
13
+
14
+ const handleRoomIDChange = (value) => {
15
+ roomId.value = value;
16
+ };
17
+ const handleGroupIDChange = (value) => {
18
+ groupId.value = value;
19
+ };
20
+ const handleCallMediaTypeChange = (value) => {
21
+ callMediaType.value = value;
22
+ };
23
+ const handleGroupCallMembersChange = (value) => {
24
+ groupCallMembers.value = value;
25
+ };
26
+ const handleCallStatusChange = (value) => {
27
+ callStatus.value = value;
28
+ };
29
+ const handleRoomIdTypeChange = (value) => {
30
+ roomIdType.value = value;
31
+ };
32
+ const handleCallIDChange = (value) => {
33
+ callId.value = value;
34
+ };
35
+
36
+ const watchOptions = {
37
+ [NAME.ROOM_ID]: handleRoomIDChange,
38
+ [NAME.GROUP_ID]: handleGroupIDChange,
39
+ [NAME.CALL_MEDIA_TYPE]: handleCallMediaTypeChange,
40
+ [NAME.GROUP_CALL_MEMBERS]: handleGroupCallMembersChange,
41
+ [NAME.CALL_STATUS]: handleCallStatusChange,
42
+ [NAME.ROOM_ID_TYPE]: handleRoomIdTypeChange,
43
+ [NAME.CALL_ID]: handleCallIDChange,
44
+ };
45
+
46
+ onMounted(() => {
47
+ TUIStore.watch(
48
+ StoreName.CALL,
49
+ watchOptions,
50
+ {
51
+ notifyRangeWhenWatch: NAME.MYSELF,
52
+ },
53
+ );
54
+ });
55
+
56
+ onUnmounted(() => {
57
+ TUIStore.unwatch(StoreName.CALL, watchOptions);
58
+ });
59
+
60
+ return {
61
+ roomId,
62
+ roomIdType,
63
+ groupId,
64
+ callMediaType,
65
+ groupCallMembers,
66
+ callStatus,
67
+ callId,
68
+ };
69
+ };
@@ -0,0 +1,30 @@
1
+ import { ref, onMounted, onUnmounted } from '../../adapter-vue';
2
+ import { TUIStore } from '../../TUICallService';
3
+ import { NAME, StoreName } from '../../TUICallService/const';
4
+
5
+ export function useNetWorkStatus() {
6
+ const netWorkQualityList = ref(TUIStore.getData(StoreName.CALL, NAME.NETWORK_STATUS));
7
+
8
+ const handleNetWorkStatusChange = (value) => {
9
+ netWorkQualityList.value = value;
10
+ };
11
+
12
+ onMounted(() => {
13
+ TUIStore.watch(
14
+ StoreName.CALL,
15
+ {
16
+ [NAME.NETWORK_STATUS]: handleNetWorkStatusChange,
17
+ },
18
+ {
19
+ notifyRangeWhenWatch: NAME.MYSELF,
20
+ },
21
+ );
22
+ });
23
+ onUnmounted(() => {
24
+ TUIStore.unwatch(StoreName.CALL, {
25
+ [NAME.NETWORK_STATUS]: handleNetWorkStatusChange,
26
+ });
27
+ });
28
+
29
+ return { netWorkQualityList };
30
+ }
@@ -0,0 +1,32 @@
1
+ import { ref, onMounted, onUnmounted } from '../../adapter-vue';
2
+ import { TUIStore } from '../../TUICallService';
3
+ import { NAME, StoreName } from '../../TUICallService/const';
4
+
5
+ export function usePlayer() {
6
+ const player = ref(TUIStore.getData(StoreName.CALL, NAME.PLAYER));
7
+
8
+ const handlePlayerChange = (value) => {
9
+ player.value = value?.map((item) => {
10
+ const { userID, hasVideo, hasAudio } = item;
11
+
12
+ return { userID, hasVideo, hasAudio };
13
+ });
14
+ };
15
+
16
+ const watchOptions = {
17
+ [NAME.PLAYER]: handlePlayerChange,
18
+ };
19
+
20
+ onMounted(() => {
21
+ TUIStore.watch(
22
+ StoreName.CALL,
23
+ watchOptions,
24
+ { notifyRangeWhenWatch: NAME.MYSELF },
25
+ );
26
+ });
27
+ onUnmounted(() => {
28
+ TUIStore.unwatch(StoreName.CALL, watchOptions);
29
+ });
30
+
31
+ return player;
32
+ }
@@ -0,0 +1,6 @@
1
+ import { inject, Ref } from '../../adapter-vue';
2
+ import { PopoverContextKey } from '../context';
3
+
4
+ export function usePopover() {
5
+ return inject<Ref<string>>(PopoverContextKey);
6
+ }
@@ -0,0 +1,42 @@
1
+ import { ref, onMounted, onUnmounted } from '../../adapter-vue';
2
+ import { TUIStore } from '../../TUICallService';
3
+ import { NAME, StoreName } from '../../TUICallService/const';
4
+
5
+ export function useTip() {
6
+ const tip = ref('');
7
+ const show = ref(true);
8
+ const duration = ref(0);
9
+
10
+ const handleCallTipsChange = (value) => {
11
+ if (typeof value === 'object') {
12
+
13
+ tip.value = value.text;
14
+ duration.value = value.duration || 0;
15
+ } else {
16
+ tip.value = value;
17
+ }
18
+ };
19
+
20
+ onMounted(() => {
21
+ TUIStore.watch(
22
+ StoreName.CALL,
23
+ {
24
+ [NAME.CALL_TIPS]: handleCallTipsChange,
25
+ },
26
+ {
27
+ notifyRangeWhenWatch: NAME.MYSELF,
28
+ },
29
+ );
30
+ });
31
+
32
+ onUnmounted(() => {
33
+ TUIStore.unwatch(
34
+ StoreName.CALL,
35
+ {
36
+ [NAME.CALL_TIPS]: handleCallTipsChange,
37
+ },
38
+ );
39
+ });
40
+
41
+ return { tip, show, duration };
42
+ }
@@ -0,0 +1,7 @@
1
+ import { noop } from '../../TUICallService/utils/common-utils';
2
+ import { inject, Ref, ref } from '../../adapter-vue';
3
+ import { translateContextKey } from '../context';
4
+
5
+ export function useTranslate() {
6
+ return inject<Ref<Function>>(translateContextKey, ref(noop));
7
+ }
@@ -0,0 +1,6 @@
1
+ import { inject } from '../../adapter-vue';
2
+ import { TUserInfoExcludeVolumeContextValue, UserInfoExcludeVolumeContextKey } from '../context';
3
+
4
+ export function useUserInfoExcludeVolumeContext() {
5
+ return inject<TUserInfoExcludeVolumeContextValue>(UserInfoExcludeVolumeContextKey);
6
+ }