@trtc/calls-uikit-react 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 (426) hide show
  1. package/README-zh_CN.md +97 -0
  2. package/README.md +104 -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/TUICallKit.module.scss +21 -0
  7. package/src/Components/TUICallKit/TUICallKit.tsx +267 -0
  8. package/src/Components/TUICallKit/index.ts +3 -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 +10 -0
  16. package/src/Components/assets/button/backgroundBlurClose.svg +3 -0
  17. package/src/Components/assets/button/backgroundBlurOpen.svg +3 -0
  18. package/src/Components/assets/button/camera-close.svg +8 -0
  19. package/src/Components/assets/button/camera-open.svg +3 -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/minimize.svg +6 -0
  23. package/src/Components/assets/button/hangup.svg +3 -0
  24. package/src/Components/assets/button/microphone-close.svg +4 -0
  25. package/src/Components/assets/button/microphone-open.svg +4 -0
  26. package/src/Components/assets/button/mobile/down.svg +4 -0
  27. package/src/Components/assets/button/mobile/minimize.svg +4 -0
  28. package/src/Components/assets/button/mobile/switch-camera.svg +3 -0
  29. package/src/Components/assets/button/mobile/up.svg +4 -0
  30. package/src/Components/assets/button/speaker-close.svg +4 -0
  31. package/src/Components/assets/button/speaker-open.svg +3 -0
  32. package/src/Components/assets/button/switch-audio.svg +3 -0
  33. package/src/Components/assets/callMessage/audioCall.svg +3 -0
  34. package/src/Components/assets/callMessage/videoCall.svg +3 -0
  35. package/src/Components/assets/common/defaultAvatar.svg +11 -0
  36. package/src/Components/assets/common/microphone-volumn-close.svg +9 -0
  37. package/src/Components/assets/floatingWindow/desktop/floatCallEnd.svg +3 -0
  38. package/src/Components/assets/floatingWindow/desktop/floatFullScreen.svg +3 -0
  39. package/src/Components/assets/floatingWindow/desktop/floatMicrophone.svg +4 -0
  40. package/src/Components/assets/floatingWindow/desktop/floatMicrophoneClosed.svg +3 -0
  41. package/src/Components/assets/floatingWindow/mobile/camera-close.svg +14 -0
  42. package/src/Components/assets/floatingWindow/mobile/camera-open.svg +14 -0
  43. package/src/Components/assets/floatingWindow/mobile/earphone.svg +3 -0
  44. package/src/Components/assets/floatingWindow/mobile/microphone-close.svg +4 -0
  45. package/src/Components/assets/floatingWindow/mobile/microphone-open.svg +4 -0
  46. package/src/Components/assets/permission/desktop/index.ts +11 -0
  47. package/src/Components/assets/permission/desktop/mac/permit-en.jpg +0 -0
  48. package/src/Components/assets/permission/desktop/mac/permit-zh.jpg +0 -0
  49. package/src/Components/assets/permission/desktop/win/permit-en.png +0 -0
  50. package/src/Components/assets/permission/desktop/win/permit-zh.png +0 -0
  51. package/src/Components/assets/streamInfo/mobile/microphone-close-group.svg +19 -0
  52. package/src/Components/assets/streamInfo/mobile/microphone-close-single.svg +6 -0
  53. package/src/Components/assets/streamInfo/mobile/volumn.svg +20 -0
  54. package/src/Components/assets/streamInfo/networkStatus.svg +22 -0
  55. package/src/Components/components/GroupCall/GroupCall.module.scss +13 -0
  56. package/src/Components/components/GroupCall/GroupCall.tsx +82 -0
  57. package/src/Components/components/GroupCall/MediaContainer/AudioStream/AudioStream.tsx +41 -0
  58. package/src/Components/components/GroupCall/MediaContainer/MediaContainer.module.scss +74 -0
  59. package/src/Components/components/GroupCall/MediaContainer/MediaContainer.tsx +138 -0
  60. package/src/Components/components/GroupCall/MediaContainer/StreamLoading/StreamLoading.tsx +48 -0
  61. package/src/Components/components/GroupCall/MediaContainer/index.ts +3 -0
  62. package/src/Components/components/GroupCall/Waiting/Waiting.module.scss +44 -0
  63. package/src/Components/components/GroupCall/Waiting/Waiting.tsx +89 -0
  64. package/src/Components/components/SingleCall/MediaContainer/AudioStream/AudioStream.tsx +86 -0
  65. package/src/Components/components/SingleCall/MediaContainer/MediaContainer.module.scss +33 -0
  66. package/src/Components/components/SingleCall/MediaContainer/MediaContainer.tsx +121 -0
  67. package/src/Components/components/SingleCall/MediaContainer/hooks/useGetLargeViewName.ts +29 -0
  68. package/src/Components/components/SingleCall/MediaContainer/index.ts +3 -0
  69. package/src/Components/components/SingleCall/SingleCall.module.scss +28 -0
  70. package/src/Components/components/SingleCall/SingleCall.tsx +54 -0
  71. package/src/Components/components/SingleCall/Waiting/Waiting.module.scss +3 -0
  72. package/src/Components/components/SingleCall/Waiting/Waiting.tsx +45 -0
  73. package/src/Components/components/base/Avatar/Avatar.scss +28 -0
  74. package/src/Components/components/base/Avatar/Avatar.tsx +52 -0
  75. package/src/Components/components/base/Avatar/index.ts +3 -0
  76. package/src/Components/components/base/Button/Button.scss +122 -0
  77. package/src/Components/components/base/Button/Button.tsx +107 -0
  78. package/src/Components/components/base/Button/index.ts +3 -0
  79. package/src/Components/components/base/Drag/Drag.tsx +155 -0
  80. package/src/Components/components/base/Drag/index.tsx +3 -0
  81. package/src/Components/components/base/Grid/Col/Col.scss +31 -0
  82. package/src/Components/components/base/Grid/Col/Col.tsx +52 -0
  83. package/src/Components/components/base/Grid/Col/index.ts +3 -0
  84. package/src/Components/components/base/Grid/Row/Row.scss +27 -0
  85. package/src/Components/components/base/Grid/Row/Row.tsx +51 -0
  86. package/src/Components/components/base/Grid/Row/index.ts +5 -0
  87. package/src/Components/components/base/Grid/style/mixin.scss +61 -0
  88. package/src/Components/components/base/GridLayout/GridLayout.tsx +189 -0
  89. package/src/Components/components/base/GridLayout/GridPlusItem/GridPlusItem.scss +11 -0
  90. package/src/Components/components/base/GridLayout/GridPlusItem/GridPlusItem.tsx +37 -0
  91. package/src/Components/components/base/GridLayout/index.ts +7 -0
  92. package/src/Components/components/base/Icon/Icon.tsx +25 -0
  93. package/src/Components/components/base/Loading/Circle/Cilrcle.tsx +20 -0
  94. package/src/Components/components/base/Loading/Circle/Circle.scss +29 -0
  95. package/src/Components/components/base/Loading/Dot/Dot.scss +69 -0
  96. package/src/Components/components/base/Loading/Dot/Dot.tsx +21 -0
  97. package/src/Components/components/base/Loading/Loading.scss +22 -0
  98. package/src/Components/components/base/Loading/Loading.tsx +47 -0
  99. package/src/Components/components/base/Loading/index.ts +3 -0
  100. package/src/Components/components/base/Message/Message.scss +61 -0
  101. package/src/Components/components/base/Message/Message.tsx +94 -0
  102. package/src/Components/components/base/Message/MessageIcon/Error.tsx +7 -0
  103. package/src/Components/components/base/Message/MessageIcon/Info.tsx +7 -0
  104. package/src/Components/components/base/Message/MessageIcon/Success.tsx +8 -0
  105. package/src/Components/components/base/Message/MessageIcon/Warning.tsx +7 -0
  106. package/src/Components/components/base/Message/MessagePlugin.tsx +148 -0
  107. package/src/Components/components/base/Overlayer/Overlayer.scss +17 -0
  108. package/src/Components/components/base/Overlayer/Overlayer.tsx +49 -0
  109. package/src/Components/components/base/Popup/Popup.scss +34 -0
  110. package/src/Components/components/base/Popup/Popup.tsx +91 -0
  111. package/src/Components/components/base/Popup/hooks/useTrigger.tsx +67 -0
  112. package/src/Components/components/base/Portal/Portal.tsx +74 -0
  113. package/src/Components/components/base/Text/Text.scss +15 -0
  114. package/src/Components/components/base/Text/Text.tsx +30 -0
  115. package/src/Components/components/base/Time/Time.scss +14 -0
  116. package/src/Components/components/base/Time/Time.tsx +13 -0
  117. package/src/Components/components/base/ToggleWindow/ToggleWindow.scss +9 -0
  118. package/src/Components/components/base/ToggleWindow/ToggleWindow.tsx +83 -0
  119. package/src/Components/components/base/ToggleWindow/ToggleWindowItem/ToggleWindowItem.scss +51 -0
  120. package/src/Components/components/base/ToggleWindow/ToggleWindowItem/ToggleWindowItem.tsx +50 -0
  121. package/src/Components/components/base/ToggleWindow/index.ts +7 -0
  122. package/src/Components/components/base/common.ts +13 -0
  123. package/src/Components/components/base/hooks/useControlled.ts +31 -0
  124. package/src/Components/components/base/hooks/useDrag.ts +96 -0
  125. package/src/Components/components/base/hooks/useListenerEvent.ts +37 -0
  126. package/src/Components/components/base/hooks/useMutationObserver.ts +38 -0
  127. package/src/Components/components/base/hooks/useOnClickOutSide.ts +24 -0
  128. package/src/Components/components/base/util/index.ts +26 -0
  129. package/src/Components/components/common/ButtonPanel/ButtonPanel.tsx +127 -0
  130. package/src/Components/components/common/ButtonPanel/ButtonPanelH5/ButtonPanelH5.module.scss +67 -0
  131. package/src/Components/components/common/ButtonPanel/ButtonPanelH5/ButtonPanelH5.tsx +153 -0
  132. package/src/Components/components/common/ButtonPanel/ButtonPanelPC/ButtonPanelPC.module.scss +9 -0
  133. package/src/Components/components/common/ButtonPanel/ButtonPanelPC/ButtonPanelPC.tsx +32 -0
  134. package/src/Components/components/common/ButtonPanel/button/Accept/Accept.module.scss +7 -0
  135. package/src/Components/components/common/ButtonPanel/button/Accept/Accept.tsx +39 -0
  136. package/src/Components/components/common/ButtonPanel/button/Accept/index.ts +3 -0
  137. package/src/Components/components/common/ButtonPanel/button/BackgroundBlur/BackgroundBlur.module.scss +15 -0
  138. package/src/Components/components/common/ButtonPanel/button/BackgroundBlur/BackgroundBlur.tsx +46 -0
  139. package/src/Components/components/common/ButtonPanel/button/BackgroundBlur/index.ts +3 -0
  140. package/src/Components/components/common/ButtonPanel/button/Camera.tsx +81 -0
  141. package/src/Components/components/common/ButtonPanel/button/FullScreen/FullScreen.module.scss +13 -0
  142. package/src/Components/components/common/ButtonPanel/button/FullScreen/FullScreen.tsx +26 -0
  143. package/src/Components/components/common/ButtonPanel/button/FullScreen/index.ts +3 -0
  144. package/src/Components/components/common/ButtonPanel/button/Hangup/Hangup.module.scss +7 -0
  145. package/src/Components/components/common/ButtonPanel/button/Hangup/Hangup.tsx +42 -0
  146. package/src/Components/components/common/ButtonPanel/button/Hangup/index.ts +3 -0
  147. package/src/Components/components/common/ButtonPanel/button/Microphone.tsx +78 -0
  148. package/src/Components/components/common/ButtonPanel/button/Minimize/Minimize.module.scss +23 -0
  149. package/src/Components/components/common/ButtonPanel/button/Minimize/Minimize.tsx +35 -0
  150. package/src/Components/components/common/ButtonPanel/button/Minimize/index.ts +3 -0
  151. package/src/Components/components/common/ButtonPanel/button/Reject/Reject.module.scss +7 -0
  152. package/src/Components/components/common/ButtonPanel/button/Reject/Reject.tsx +39 -0
  153. package/src/Components/components/common/ButtonPanel/button/Reject/index.ts +3 -0
  154. package/src/Components/components/common/ButtonPanel/button/Speaker.tsx +75 -0
  155. package/src/Components/components/common/ButtonPanel/button/SwitchAudioCall.tsx +32 -0
  156. package/src/Components/components/common/ButtonPanel/button/SwitchCamera.tsx +19 -0
  157. package/src/Components/components/common/ButtonPanel/button/common.module.scss +51 -0
  158. package/src/Components/components/common/ButtonPanel/config.ts +505 -0
  159. package/src/Components/components/common/ButtonPanel/index.ts +3 -0
  160. package/src/Components/components/common/CallMessage/CallMessage.tsx +18 -0
  161. package/src/Components/components/common/CallMessage/CallMessageC2C/CallMessageC2C.module.scss +19 -0
  162. package/src/Components/components/common/CallMessage/CallMessageC2C/CallMessageC2C.tsx +84 -0
  163. package/src/Components/components/common/CallMessage/CallMessageGroup/CallMessageGroup.module.scss +5 -0
  164. package/src/Components/components/common/CallMessage/CallMessageGroup/CallMessageGroup.tsx +37 -0
  165. package/src/Components/components/common/CallMessage/index.ts +3 -0
  166. package/src/Components/components/common/DeviceSelector/DeviceSelector.module.scss +62 -0
  167. package/src/Components/components/common/DeviceSelector/DeviceSelector.tsx +105 -0
  168. package/src/Components/components/common/FloatingWindow/FloatingWindow.tsx +37 -0
  169. package/src/Components/components/common/FloatingWindow/FloatingWindowGroupCall/FloatingWindowGroupCall.tsx +97 -0
  170. package/src/Components/components/common/FloatingWindow/FloatingWindowGroupCall/style/FloatingWindowGroupCall.module.scss +2 -0
  171. package/src/Components/components/common/FloatingWindow/FloatingWindowGroupCall/style/mobile.module.scss +126 -0
  172. package/src/Components/components/common/FloatingWindow/FloatingWindowGroupCall/style/pc.module.scss +126 -0
  173. package/src/Components/components/common/FloatingWindow/FloatingWindowSingleCall/FloatingWindowSingleCall.tsx +75 -0
  174. package/src/Components/components/common/FloatingWindow/FloatingWindowSingleCall/style/FloatingWindowSingleCall.module.scss +2 -0
  175. package/src/Components/components/common/FloatingWindow/FloatingWindowSingleCall/style/mobile.module.scss +117 -0
  176. package/src/Components/components/common/FloatingWindow/FloatingWindowSingleCall/style/pc.module.scss +123 -0
  177. package/src/Components/components/common/FloatingWindow/index.ts +3 -0
  178. package/src/Components/components/common/MicrophoneVolumn/MicrophoneVolumn.module.scss +9 -0
  179. package/src/Components/components/common/MicrophoneVolumn/MicrophoneVolumn.tsx +50 -0
  180. package/src/Components/components/common/OverlayStream/OverlayStream.module.scss +165 -0
  181. package/src/Components/components/common/OverlayStream/OverlayStream.tsx +119 -0
  182. package/src/Components/components/common/Player/Player.module.scss +11 -0
  183. package/src/Components/components/common/Player/Player.tsx +75 -0
  184. package/src/Components/components/common/Pusher/Pusher.module.scss +10 -0
  185. package/src/Components/components/common/Pusher/Pusher.tsx +96 -0
  186. package/src/Components/components/common/StreamInfo/StreamInfo.tsx +10 -0
  187. package/src/Components/components/common/StreamInfo/StreamInfoH5/StreamInfoH5.module.scss +21 -0
  188. package/src/Components/components/common/StreamInfo/StreamInfoH5/StreamInfoH5.tsx +95 -0
  189. package/src/Components/components/common/StreamInfo/StreamInfoPC/StreamInfoPC.module.scss +38 -0
  190. package/src/Components/components/common/StreamInfo/StreamInfoPC/StreamInfoPC.tsx +35 -0
  191. package/src/Components/components/common/StreamInfo/index.ts +3 -0
  192. package/src/Components/components/common/Tip/Tip.tsx +68 -0
  193. package/src/Components/components/common/TopBar/TopBar.tsx +17 -0
  194. package/src/Components/components/common/TopBar/h5/TopBarH5.module.scss +12 -0
  195. package/src/Components/components/common/TopBar/h5/TopBarH5.tsx +40 -0
  196. package/src/Components/components/common/TopBar/pc/TopBarPC.module.scss +8 -0
  197. package/src/Components/components/common/TopBar/pc/TopBarPC.tsx +36 -0
  198. package/src/Components/const/common.ts +15 -0
  199. package/src/Components/context/CallUserInfoContext.ts +21 -0
  200. package/src/Components/context/CallerUserInfoContext.ts +11 -0
  201. package/src/Components/context/CustomUIConfigContext.ts +6 -0
  202. package/src/Components/context/FocusItemContext.ts +13 -0
  203. package/src/Components/context/IsClickableContext.ts +5 -0
  204. package/src/Components/context/TranslateContext.ts +6 -0
  205. package/src/Components/context/UserInfoContext.ts +9 -0
  206. package/src/Components/context/index.ts +17 -0
  207. package/src/Components/hooks/index.ts +9 -0
  208. package/src/Components/hooks/useCallDuration.ts +34 -0
  209. package/src/Components/hooks/useCustomButtonUIConfig.ts +27 -0
  210. package/src/Components/hooks/useDeviceList.ts +53 -0
  211. package/src/Components/hooks/useGetSpeakers.ts +69 -0
  212. package/src/Components/hooks/useGetVolumeMap.ts +67 -0
  213. package/src/Components/hooks/useNetWorkStatus.ts +34 -0
  214. package/src/Components/hooks/useTranslate.ts +7 -0
  215. package/src/Components/hooks/useViewBackgroundConfig.ts +8 -0
  216. package/src/Components/style/common/mixin.scss +22 -0
  217. package/src/Components/style/common/var.scss +21 -0
  218. package/src/Components/style/index.scss +5 -0
  219. package/src/Components/style/theme/_dark.scss +56 -0
  220. package/src/Components/style/theme/_light.scss +56 -0
  221. package/src/Components/style/theme/_util.scss +79 -0
  222. package/src/Components/style/theme/color.scss +23 -0
  223. package/src/Components/util/classnames.ts +35 -0
  224. package/src/Components/util/index.ts +138 -0
  225. package/src/Components/util/uiDesign.ts +45 -0
  226. package/src/TUICallService/CallService/UIDesign.ts +174 -0
  227. package/src/TUICallService/CallService/bellContext.ts +88 -0
  228. package/src/TUICallService/CallService/chatCombine.ts +313 -0
  229. package/src/TUICallService/CallService/engineEventHandler.ts +404 -0
  230. package/src/TUICallService/CallService/index.ts +797 -0
  231. package/src/TUICallService/CallService/miniProgram.ts +65 -0
  232. package/src/TUICallService/CallService/utils.ts +281 -0
  233. package/src/TUICallService/TUIGlobal/tuiGlobal.ts +43 -0
  234. package/src/TUICallService/TUIStore/callStore.ts +93 -0
  235. package/src/TUICallService/TUIStore/tuiStore.ts +167 -0
  236. package/src/TUICallService/assets/phone_dialing.mp3 +0 -0
  237. package/src/TUICallService/assets/phone_ringing.mp3 +0 -0
  238. package/src/TUICallService/const/call.ts +157 -0
  239. package/src/TUICallService/const/error.ts +20 -0
  240. package/src/TUICallService/const/index.ts +103 -0
  241. package/src/TUICallService/const/log.ts +9 -0
  242. package/src/TUICallService/index.ts +37 -0
  243. package/src/TUICallService/interface/ICallService.ts +70 -0
  244. package/src/TUICallService/interface/ICallStore.ts +55 -0
  245. package/src/TUICallService/interface/ITUIGlobal.ts +36 -0
  246. package/src/TUICallService/interface/ITUIStore.ts +87 -0
  247. package/src/TUICallService/interface/index.ts +4 -0
  248. package/src/TUICallService/locales/en.ts +135 -0
  249. package/src/TUICallService/locales/index.ts +61 -0
  250. package/src/TUICallService/locales/ja_JP.ts +134 -0
  251. package/src/TUICallService/locales/zh-cn.ts +130 -0
  252. package/src/TUICallService/serve/callManager.ts +109 -0
  253. package/src/TUICallService/utils/common-utils.ts +269 -0
  254. package/src/TUICallService/utils/decorators/promise-retry.ts +51 -0
  255. package/src/TUICallService/utils/env.ts +51 -0
  256. package/src/TUICallService/utils/index.ts +32 -0
  257. package/src/TUICallService/utils/is-empty.ts +31 -0
  258. package/src/TUICallService/utils/retry.ts +88 -0
  259. package/src/TUICallService/utils/timer.ts +162 -0
  260. package/src/TUICallService/utils/validate/avoidRepeatedCall.ts +39 -0
  261. package/src/TUICallService/utils/validate/index.ts +7 -0
  262. package/src/TUICallService/utils/validate/validateConfig.ts +188 -0
  263. package/src/TUICallService/utils/validate/validateParams.ts +88 -0
  264. package/src/TUICallService/utils/validate/validateStatus.ts +26 -0
  265. package/src/image.d.ts +8 -0
  266. package/src/index.ts +63 -0
  267. package/src/style.d.ts +1 -0
  268. package/tuicall-uikit-react.es.js +13177 -0
  269. package/tuicall-uikit-react.umd.js +133 -0
  270. package/types/Components/TUICallKit/TUICallKit.d.ts +15 -0
  271. package/types/Components/TUICallKit/index.d.ts +2 -0
  272. package/types/Components/assets/permission/desktop/index.d.ts +5 -0
  273. package/types/Components/components/GroupCall/GroupCall.d.ts +1 -0
  274. package/types/Components/components/GroupCall/MediaContainer/AudioStream/AudioStream.d.ts +10 -0
  275. package/types/Components/components/GroupCall/MediaContainer/MediaContainer.d.ts +1 -0
  276. package/types/Components/components/GroupCall/MediaContainer/StreamLoading/StreamLoading.d.ts +7 -0
  277. package/types/Components/components/GroupCall/MediaContainer/index.d.ts +2 -0
  278. package/types/Components/components/GroupCall/Waiting/Waiting.d.ts +8 -0
  279. package/types/Components/components/SingleCall/MediaContainer/AudioStream/AudioStream.d.ts +11 -0
  280. package/types/Components/components/SingleCall/MediaContainer/MediaContainer.d.ts +1 -0
  281. package/types/Components/components/SingleCall/MediaContainer/hooks/useGetLargeViewName.d.ts +3 -0
  282. package/types/Components/components/SingleCall/MediaContainer/index.d.ts +2 -0
  283. package/types/Components/components/SingleCall/SingleCall.d.ts +3 -0
  284. package/types/Components/components/SingleCall/Waiting/Waiting.d.ts +9 -0
  285. package/types/Components/components/base/Avatar/Avatar.d.ts +12 -0
  286. package/types/Components/components/base/Avatar/index.d.ts +2 -0
  287. package/types/Components/components/base/Button/Button.d.ts +25 -0
  288. package/types/Components/components/base/Button/index.d.ts +2 -0
  289. package/types/Components/components/base/Drag/Drag.d.ts +14 -0
  290. package/types/Components/components/base/Drag/index.d.ts +2 -0
  291. package/types/Components/components/base/Grid/Col/Col.d.ts +14 -0
  292. package/types/Components/components/base/Grid/Col/index.d.ts +2 -0
  293. package/types/Components/components/base/Grid/Row/Row.d.ts +14 -0
  294. package/types/Components/components/base/Grid/Row/index.d.ts +3 -0
  295. package/types/Components/components/base/GridLayout/GridLayout.d.ts +11 -0
  296. package/types/Components/components/base/GridLayout/GridPlusItem/GridPlusItem.d.ts +14 -0
  297. package/types/Components/components/base/GridLayout/index.d.ts +3 -0
  298. package/types/Components/components/base/Icon/Icon.d.ts +9 -0
  299. package/types/Components/components/base/Loading/Circle/Cilrcle.d.ts +6 -0
  300. package/types/Components/components/base/Loading/Dot/Dot.d.ts +6 -0
  301. package/types/Components/components/base/Loading/Loading.d.ts +14 -0
  302. package/types/Components/components/base/Loading/index.d.ts +2 -0
  303. package/types/Components/components/base/Message/Message.d.ts +16 -0
  304. package/types/Components/components/base/Message/MessageIcon/Error.d.ts +1 -0
  305. package/types/Components/components/base/Message/MessageIcon/Info.d.ts +1 -0
  306. package/types/Components/components/base/Message/MessageIcon/Success.d.ts +1 -0
  307. package/types/Components/components/base/Message/MessageIcon/Warning.d.ts +1 -0
  308. package/types/Components/components/base/Message/MessagePlugin.d.ts +14 -0
  309. package/types/Components/components/base/Overlayer/Overlayer.d.ts +14 -0
  310. package/types/Components/components/base/Popup/Popup.d.ts +13 -0
  311. package/types/Components/components/base/Popup/hooks/useTrigger.d.ts +10 -0
  312. package/types/Components/components/base/Portal/Portal.d.ts +19 -0
  313. package/types/Components/components/base/Text/Text.d.ts +10 -0
  314. package/types/Components/components/base/Time/Time.d.ts +7 -0
  315. package/types/Components/components/base/ToggleWindow/ToggleWindow.d.ts +15 -0
  316. package/types/Components/components/base/ToggleWindow/ToggleWindowItem/ToggleWindowItem.d.ts +14 -0
  317. package/types/Components/components/base/ToggleWindow/index.d.ts +3 -0
  318. package/types/Components/components/base/common.d.ts +7 -0
  319. package/types/Components/components/base/hooks/useControlled.d.ts +8 -0
  320. package/types/Components/components/base/hooks/useDrag.d.ts +6 -0
  321. package/types/Components/components/base/hooks/useListenerEvent.d.ts +13 -0
  322. package/types/Components/components/base/hooks/useMutationObserver.d.ts +4 -0
  323. package/types/Components/components/base/hooks/useOnClickOutSide.d.ts +1 -0
  324. package/types/Components/components/base/util/index.d.ts +5 -0
  325. package/types/Components/components/common/ButtonPanel/ButtonPanel.d.ts +1 -0
  326. package/types/Components/components/common/ButtonPanel/ButtonPanelH5/ButtonPanelH5.d.ts +8 -0
  327. package/types/Components/components/common/ButtonPanel/ButtonPanelPC/ButtonPanelPC.d.ts +6 -0
  328. package/types/Components/components/common/ButtonPanel/button/Accept/Accept.d.ts +5 -0
  329. package/types/Components/components/common/ButtonPanel/button/Accept/index.d.ts +2 -0
  330. package/types/Components/components/common/ButtonPanel/button/BackgroundBlur/BackgroundBlur.d.ts +1 -0
  331. package/types/Components/components/common/ButtonPanel/button/BackgroundBlur/index.d.ts +2 -0
  332. package/types/Components/components/common/ButtonPanel/button/Camera.d.ts +5 -0
  333. package/types/Components/components/common/ButtonPanel/button/FullScreen/FullScreen.d.ts +5 -0
  334. package/types/Components/components/common/ButtonPanel/button/FullScreen/index.d.ts +2 -0
  335. package/types/Components/components/common/ButtonPanel/button/Hangup/Hangup.d.ts +5 -0
  336. package/types/Components/components/common/ButtonPanel/button/Hangup/index.d.ts +2 -0
  337. package/types/Components/components/common/ButtonPanel/button/Microphone.d.ts +5 -0
  338. package/types/Components/components/common/ButtonPanel/button/Minimize/Minimize.d.ts +1 -0
  339. package/types/Components/components/common/ButtonPanel/button/Minimize/index.d.ts +2 -0
  340. package/types/Components/components/common/ButtonPanel/button/Reject/Reject.d.ts +5 -0
  341. package/types/Components/components/common/ButtonPanel/button/Reject/index.d.ts +2 -0
  342. package/types/Components/components/common/ButtonPanel/button/Speaker.d.ts +5 -0
  343. package/types/Components/components/common/ButtonPanel/button/SwitchAudioCall.d.ts +1 -0
  344. package/types/Components/components/common/ButtonPanel/button/SwitchCamera.d.ts +1 -0
  345. package/types/Components/components/common/ButtonPanel/config.d.ts +254 -0
  346. package/types/Components/components/common/ButtonPanel/index.d.ts +2 -0
  347. package/types/Components/components/common/CallMessage/CallMessage.d.ts +10 -0
  348. package/types/Components/components/common/CallMessage/CallMessageC2C/CallMessageC2C.d.ts +2 -0
  349. package/types/Components/components/common/CallMessage/CallMessageGroup/CallMessageGroup.d.ts +2 -0
  350. package/types/Components/components/common/CallMessage/index.d.ts +2 -0
  351. package/types/Components/components/common/DeviceSelector/DeviceSelector.d.ts +7 -0
  352. package/types/Components/components/common/FloatingWindow/FloatingWindow.d.ts +10 -0
  353. package/types/Components/components/common/FloatingWindow/FloatingWindowGroupCall/FloatingWindowGroupCall.d.ts +9 -0
  354. package/types/Components/components/common/FloatingWindow/FloatingWindowSingleCall/FloatingWindowSingleCall.d.ts +10 -0
  355. package/types/Components/components/common/FloatingWindow/index.d.ts +2 -0
  356. package/types/Components/components/common/MicrophoneVolumn/MicrophoneVolumn.d.ts +8 -0
  357. package/types/Components/components/common/OverlayStream/OverlayStream.d.ts +28 -0
  358. package/types/Components/components/common/Player/Player.d.ts +15 -0
  359. package/types/Components/components/common/Pusher/Pusher.d.ts +13 -0
  360. package/types/Components/components/common/StreamInfo/StreamInfo.d.ts +1 -0
  361. package/types/Components/components/common/StreamInfo/StreamInfoH5/StreamInfoH5.d.ts +10 -0
  362. package/types/Components/components/common/StreamInfo/StreamInfoPC/StreamInfoPC.d.ts +9 -0
  363. package/types/Components/components/common/StreamInfo/index.d.ts +2 -0
  364. package/types/Components/components/common/Tip/Tip.d.ts +7 -0
  365. package/types/Components/components/common/TopBar/TopBar.d.ts +1 -0
  366. package/types/Components/components/common/TopBar/h5/TopBarH5.d.ts +5 -0
  367. package/types/Components/components/common/TopBar/pc/TopBarPC.d.ts +5 -0
  368. package/types/Components/const/common.d.ts +11 -0
  369. package/types/Components/context/CallUserInfoContext.d.ts +17 -0
  370. package/types/Components/context/CallerUserInfoContext.d.ts +7 -0
  371. package/types/Components/context/CustomUIConfigContext.d.ts +3 -0
  372. package/types/Components/context/FocusItemContext.d.ts +8 -0
  373. package/types/Components/context/IsClickableContext.d.ts +2 -0
  374. package/types/Components/context/TranslateContext.d.ts +4 -0
  375. package/types/Components/context/UserInfoContext.d.ts +6 -0
  376. package/types/Components/context/index.d.ts +8 -0
  377. package/types/Components/hooks/index.d.ts +4 -0
  378. package/types/Components/hooks/useCallDuration.d.ts +1 -0
  379. package/types/Components/hooks/useCustomButtonUIConfig.d.ts +1 -0
  380. package/types/Components/hooks/useDeviceList.d.ts +8 -0
  381. package/types/Components/hooks/useGetSpeakers.d.ts +1 -0
  382. package/types/Components/hooks/useGetVolumeMap.d.ts +3 -0
  383. package/types/Components/hooks/useNetWorkStatus.d.ts +1 -0
  384. package/types/Components/hooks/useTranslate.d.ts +3 -0
  385. package/types/Components/hooks/useViewBackgroundConfig.d.ts +1 -0
  386. package/types/Components/util/classnames.d.ts +1 -0
  387. package/types/Components/util/index.d.ts +15 -0
  388. package/types/Components/util/uiDesign.d.ts +2 -0
  389. package/types/TUICallService/CallService/UIDesign.d.ts +28 -0
  390. package/types/TUICallService/CallService/bellContext.d.ts +19 -0
  391. package/types/TUICallService/CallService/chatCombine.d.ts +50 -0
  392. package/types/TUICallService/CallService/engineEventHandler.d.ts +35 -0
  393. package/types/TUICallService/CallService/index.d.ts +98 -0
  394. package/types/TUICallService/CallService/miniProgram.d.ts +7 -0
  395. package/types/TUICallService/CallService/utils.d.ts +42 -0
  396. package/types/TUICallService/TUIGlobal/tuiGlobal.d.ts +21 -0
  397. package/types/TUICallService/TUIStore/callStore.d.ts +10 -0
  398. package/types/TUICallService/TUIStore/tuiStore.d.ts +57 -0
  399. package/types/TUICallService/const/call.d.ts +141 -0
  400. package/types/TUICallService/const/error.d.ts +2 -0
  401. package/types/TUICallService/const/index.d.ts +27 -0
  402. package/types/TUICallService/const/log.d.ts +7 -0
  403. package/types/TUICallService/index.d.ts +5 -0
  404. package/types/TUICallService/interface/ICallService.d.ts +69 -0
  405. package/types/TUICallService/interface/ICallStore.d.ts +47 -0
  406. package/types/TUICallService/interface/ITUIGlobal.d.ts +36 -0
  407. package/types/TUICallService/interface/ITUIStore.d.ts +83 -0
  408. package/types/TUICallService/interface/index.d.ts +4 -0
  409. package/types/TUICallService/locales/en.d.ts +128 -0
  410. package/types/TUICallService/locales/index.d.ts +10 -0
  411. package/types/TUICallService/locales/ja_JP.d.ts +127 -0
  412. package/types/TUICallService/locales/zh-cn.d.ts +123 -0
  413. package/types/TUICallService/serve/callManager.d.ts +11 -0
  414. package/types/TUICallService/utils/common-utils.d.ts +62 -0
  415. package/types/TUICallService/utils/decorators/promise-retry.d.ts +32 -0
  416. package/types/TUICallService/utils/env.d.ts +10 -0
  417. package/types/TUICallService/utils/index.d.ts +2 -0
  418. package/types/TUICallService/utils/is-empty.d.ts +2 -0
  419. package/types/TUICallService/utils/retry.d.ts +36 -0
  420. package/types/TUICallService/utils/timer.d.ts +63 -0
  421. package/types/TUICallService/utils/validate/avoidRepeatedCall.d.ts +10 -0
  422. package/types/TUICallService/utils/validate/index.d.ts +2 -0
  423. package/types/TUICallService/utils/validate/validateConfig.d.ts +173 -0
  424. package/types/TUICallService/utils/validate/validateParams.d.ts +1 -0
  425. package/types/TUICallService/utils/validate/validateStatus.d.ts +5 -0
  426. package/types/index.d.ts +11 -0
@@ -0,0 +1,86 @@
1
+ import React, {
2
+ useContext, useEffect, useMemo, useState,
3
+ } from 'react';
4
+ import { CallInfoContext } from '../../../../context';
5
+ import { CallMediaType, TUIGlobal } from '../../../../../TUICallService';
6
+ import useViewBackgroundConfig from '../../../../hooks/useViewBackgroundConfig';
7
+ import OverlayStream from '../../../common/OverlayStream/OverlayStream';
8
+ import { TObjectFit } from '../../../../const/common';
9
+ import defaultAvatarSrc from '../../../../assets/common/defaultAvatar.svg';
10
+ import { classNames } from '../../../../util/classnames';
11
+
12
+ interface IRenderAudioStreamProps {
13
+ avatar?: string;
14
+ username?: string;
15
+ visible?: boolean;
16
+ isSmall?: boolean;
17
+ isVideoAvailable?: boolean;
18
+ userId?: string;
19
+ classnames?: string;
20
+ }
21
+
22
+ export default function AudioStream(props: IRenderAudioStreamProps) {
23
+ const {
24
+ avatar,
25
+ username,
26
+ isSmall,
27
+ isVideoAvailable,
28
+ userId,
29
+ classnames,
30
+ ...rest
31
+ } = props;
32
+ const [audioStreamVisible, setAudioStreamVisible] = useState('hidden');
33
+ const viewBackgroundConfigObj = useViewBackgroundConfig();
34
+ const { callType, isFloat } = useContext(CallInfoContext);
35
+ const isAudioCall = useMemo(() => callType === CallMediaType.AUDIO, [callType]);
36
+ const [showOverlayer, setShowOverlayer] = useState(!viewBackgroundConfigObj[userId]);
37
+ const [fit, setFit] = useState<TObjectFit>(viewBackgroundConfigObj[userId] ? 'fill' : 'cover');
38
+ const [background, setBackground] = useState(viewBackgroundConfigObj[userId] || avatar);
39
+ const [imgError, setImgError] = useState(false);
40
+ const audioStreamClassNames = classNames([
41
+ classnames,
42
+ ]);
43
+
44
+ useEffect(() => {
45
+ if (((isAudioCall && !isSmall) || (!isAudioCall && !isVideoAvailable))) {
46
+ setAudioStreamVisible('');
47
+ } else {
48
+ setAudioStreamVisible('hidden');
49
+ }
50
+ if (!imgError) {
51
+ if (isAudioCall) {
52
+ setShowOverlayer(!viewBackgroundConfigObj[userId]);
53
+ } else {
54
+ setShowOverlayer(!isVideoAvailable && !viewBackgroundConfigObj[userId]);
55
+ }
56
+
57
+ setFit(viewBackgroundConfigObj[userId] ? 'fill' : 'cover');
58
+ setBackground(viewBackgroundConfigObj[userId] || avatar || defaultAvatarSrc);
59
+ }
60
+ }, [isFloat, isSmall, isAudioCall, isVideoAvailable, viewBackgroundConfigObj]);
61
+
62
+ const handleImgError = () => {
63
+ setImgError(true);
64
+ setFit('cover');
65
+ };
66
+
67
+ return (
68
+ <OverlayStream
69
+ className={audioStreamClassNames}
70
+ showLoading={false}
71
+ avatar={avatar || defaultAvatarSrc}
72
+ showAvatar={!TUIGlobal.isPC}
73
+ username={username}
74
+ showVolumn={TUIGlobal.isPC && callType === CallMediaType.AUDIO}
75
+ isMobile={!TUIGlobal.isPC}
76
+ isSmall={isSmall}
77
+ background={background}
78
+ showOverlayer={showOverlayer}
79
+ fit={fit}
80
+ // @ts-ignore
81
+ style={{ visibility: audioStreamVisible, zIndex: 1 }}
82
+ {...rest}
83
+ onError={handleImgError}
84
+ />
85
+ );
86
+ }
@@ -0,0 +1,33 @@
1
+ @use "../../../style/theme/util" as *;
2
+
3
+ .single-stream-container {
4
+ width: 100%;
5
+ height: 100%;
6
+ position: absolute;
7
+ z-index: 0;
8
+ -webkit-user-select: none;
9
+ -moz-user-select: none;
10
+ -ms-user-select: none;
11
+ user-select: none;
12
+
13
+ &.pc {
14
+ border-radius: 12px;
15
+ overflow: hidden;
16
+
17
+ @include theme() {
18
+ background-color: get(black-2);
19
+ }
20
+
21
+ .single-call-audio-stream {
22
+ :global(.overlay) {
23
+ border-radius: 12px;
24
+ overflow: hidden;
25
+ }
26
+ }
27
+ }
28
+
29
+ &.float {
30
+ position: absolute;
31
+ visibility: hidden;
32
+ }
33
+ }
@@ -0,0 +1,121 @@
1
+ import React, {
2
+ useContext, useEffect, useMemo, useState,
3
+ } from 'react';
4
+ import { CallMediaType, CallStatus, TUIGlobal } from '../../../../TUICallService';
5
+ import { ToggleWindow, ToggleWindowItem } from '../../base/ToggleWindow';
6
+ import Player from '../../common/Player/Player';
7
+ import Pusher from '../../common/Pusher/Pusher';
8
+ import { CallInfoContext, UserInfoContext } from '../../../context';
9
+ import AudioStream from './AudioStream/AudioStream';
10
+ import { classNames } from '../../../util/classnames';
11
+ import Portal from '../../base/Portal/Portal';
12
+ import useGetLargeViewName from './hooks/useGetLargeViewName';
13
+ import { ViewName } from '../../../../TUICallService/const/index';
14
+ import mediaContainerStyle from './MediaContainer.module.scss';
15
+
16
+ interface IRenderAudioStreamProps {
17
+ avatar?: string;
18
+ username?: string;
19
+ visible?: boolean;
20
+ isSmall?: boolean;
21
+ isVideoAvailable?: boolean;
22
+ userId?: string;
23
+ classnames?: string;
24
+ }
25
+
26
+ export default function MediaContainer() {
27
+ const { remoteList, localUserInfo } = useContext(UserInfoContext);
28
+ const { callType, callStatus, isFloat } = useContext(CallInfoContext);
29
+ const [largeViewName, setLargeViewName] = useGetLargeViewName();
30
+ const isAudioCall = useMemo(() => callType === CallMediaType.AUDIO, [callType]);
31
+ const [showSmallWindow, setShowSmallWindow] = useState(false);
32
+
33
+ useEffect(() => {
34
+ if (remoteList?.[0]?.isEnter) {
35
+ if (!isAudioCall) {
36
+ setShowSmallWindow(true);
37
+ } else {
38
+ setShowSmallWindow(false);
39
+ }
40
+ }
41
+ }, [remoteList, isAudioCall]);
42
+
43
+ function renderAudioStream(props: IRenderAudioStreamProps) {
44
+ return <AudioStream {...props} />;
45
+ }
46
+
47
+ const attachId = useMemo(() => {
48
+ if (isFloat) {
49
+ return '#float';
50
+ }
51
+
52
+ return '#single-container';
53
+ }, [isFloat]);
54
+
55
+ const showPusherStreamInfo = TUIGlobal.isPC
56
+ && callStatus === CallStatus.CONNECTED
57
+ && !isAudioCall
58
+ && !isFloat;
59
+ const classnames = classNames([
60
+ mediaContainerStyle['single-stream-container'],
61
+ {
62
+ [mediaContainerStyle.mobile]: !TUIGlobal.isPC,
63
+ [mediaContainerStyle.pc]: TUIGlobal.isPC,
64
+ [mediaContainerStyle.float]: isFloat,
65
+ },
66
+ ]);
67
+
68
+ return (
69
+ <div id='single-container' className={classnames}>
70
+ <Portal attach={attachId} style={{ width: '100%', height: '100%', position: 'relative' }}>
71
+ <ToggleWindow
72
+ isMobile={!TUIGlobal.isPC}
73
+ bigWindow={largeViewName}
74
+ showSmallWindow={showSmallWindow}
75
+ onToggle={setLargeViewName}
76
+ >
77
+ <ToggleWindowItem key={ViewName.LOCAL} value={ViewName.LOCAL}>
78
+ <Pusher
79
+ loading={
80
+ callStatus === CallStatus.CALLING
81
+ && (callType === CallMediaType.VIDEO ? !localUserInfo?.isVideoAvailable : true)
82
+ }
83
+ renderAudioStream={() => renderAudioStream({
84
+ isVideoAvailable: localUserInfo.isVideoAvailable,
85
+ avatar: isAudioCall ? remoteList?.[0]?.avatar : localUserInfo.avatar,
86
+ username: isAudioCall
87
+ ? remoteList?.[0]?.displayUserInfo
88
+ : (localUserInfo.nick || localUserInfo.userId),
89
+ isSmall: largeViewName !== ViewName.LOCAL,
90
+ userId: isAudioCall ? remoteList?.[0]?.userId : localUserInfo.userId,
91
+ classnames: mediaContainerStyle['single-call-audio-stream'],
92
+ })}
93
+ showStreamInfo={showPusherStreamInfo}
94
+ />
95
+ </ToggleWindowItem>
96
+ <ToggleWindowItem
97
+ key={ViewName.REMOTE}
98
+ value={ViewName.REMOTE}
99
+ className={mediaContainerStyle.remote}
100
+ >
101
+ {remoteList.length !== 0 && callStatus === CallStatus.CONNECTED && (
102
+ <Player
103
+ renderAudioStream={(props) => renderAudioStream({
104
+ isVideoAvailable: remoteList[0].isVideoAvailable,
105
+ avatar: remoteList[0].avatar,
106
+ username: remoteList[0].displayUserInfo,
107
+ isSmall: largeViewName !== ViewName.REMOTE,
108
+ userId: remoteList[0].userId,
109
+ classnames: mediaContainerStyle['single-call-audio-stream'],
110
+ ...props,
111
+ })}
112
+ showStreamInfo={TUIGlobal.isPC && !isAudioCall && !isFloat}
113
+ streamInfo={remoteList[0]}
114
+ />
115
+ )}
116
+ </ToggleWindowItem>
117
+ </ToggleWindow>
118
+ </Portal>
119
+ </div>
120
+ );
121
+ }
@@ -0,0 +1,29 @@
1
+ import React, { useContext, useState, useEffect } from 'react';
2
+ import { CallInfoContext, CustomUIConfigContext, UserInfoContext } from '../../../../context';
3
+ import { CallStatus, LayoutMode, ViewName } from '../../../../../TUICallService/const';
4
+
5
+ export default function useGetLargeViewName() {
6
+ const { layoutMode } = useContext(CustomUIConfigContext);
7
+ const { remoteList } = useContext(UserInfoContext);
8
+ const { callStatus } = useContext(CallInfoContext);
9
+ const [largeViewName, setLargeViewName] = useState(ViewName.LOCAL);
10
+
11
+ useEffect(() => {
12
+ if (callStatus === CallStatus.CALLING) {
13
+ return;
14
+ }
15
+
16
+ const c2cLayoutModes = [LayoutMode.RemoteInLargeView, LayoutMode.LocalInLargeView];
17
+ if (c2cLayoutModes.includes(layoutMode)) {
18
+ // @ts-ignore
19
+ setLargeViewName(layoutMode);
20
+ return;
21
+ }
22
+
23
+ if (remoteList?.[0]?.isEnter) {
24
+ setLargeViewName(ViewName.REMOTE);
25
+ }
26
+ }, [remoteList, layoutMode, callStatus]);
27
+
28
+ return [largeViewName, setLargeViewName] as const;
29
+ }
@@ -0,0 +1,3 @@
1
+ import MediaContainer from './MediaContainer';
2
+
3
+ export default MediaContainer;
@@ -0,0 +1,28 @@
1
+ .single-container {
2
+ width: 100%;
3
+ height: 100%;
4
+ .singlecall-tip {
5
+ position: absolute;
6
+ top: 56%;
7
+ left: 50%;
8
+ transform: translateX(-50%);
9
+ z-index: 5;
10
+ }
11
+ &.mobile {
12
+ animation: pulldown 0.5s linear;
13
+
14
+ .singlecall-tip {
15
+ position: absolute;
16
+ max-width: 80%;
17
+ top: 53.6vh;
18
+ left: 50%;
19
+ transform: translateX(-50%);
20
+ z-index: 5;
21
+ }
22
+ }
23
+ }
24
+
25
+ @keyframes pulldown {
26
+ from {transform: translateY(-100%)}
27
+ to {transform: translateY(0%)}
28
+ }
@@ -0,0 +1,54 @@
1
+ import React, { useContext } from 'react';
2
+ import { CallStatus, TUIGlobal } from '../../../TUICallService';
3
+ import TopBar from '../common/TopBar/TopBar';
4
+ import ButtonPanel from '../common/ButtonPanel';
5
+ import Waiting from './Waiting/Waiting';
6
+ import { CallInfoContext, UserInfoContext } from '../../context';
7
+ import MediaContainer from './MediaContainer';
8
+ import { classNames } from '../../util/classnames';
9
+ import Tip from '../common/Tip/Tip';
10
+ import singleCallStyle from './SingleCall.module.scss';
11
+
12
+ const SingleCall = React.memo(() => {
13
+ const { remoteList } = useContext(UserInfoContext);
14
+ const { callRole, callStatus, isFloat } = useContext(CallInfoContext);
15
+ const classnames = classNames([
16
+ singleCallStyle['single-container'],
17
+ { [singleCallStyle.mobile]: !TUIGlobal.isPC },
18
+ ]);
19
+
20
+ const renderTopBar = () => {
21
+ if (!isFloat) {
22
+ return <TopBar />;
23
+ }
24
+ };
25
+ const renderWaiting = () => {
26
+ if (callStatus === CallStatus.CALLING && !isFloat) {
27
+ return (
28
+ <Waiting
29
+ avatar={remoteList?.[0]?.avatar}
30
+ username={remoteList?.[0]?.displayUserInfo}
31
+ callRole={callRole}
32
+ userId={remoteList?.[0]?.userId}
33
+ />
34
+ );
35
+ }
36
+ };
37
+ const renderButtonPanel = () => {
38
+ if (!isFloat) {
39
+ return <ButtonPanel />;
40
+ }
41
+ };
42
+
43
+ return (
44
+ <div className={classnames}>
45
+ {renderTopBar()}
46
+ {renderWaiting()}
47
+ <MediaContainer />
48
+ <Tip className={singleCallStyle['singlecall-tip']} />
49
+ {renderButtonPanel()}
50
+ </div>
51
+ );
52
+ });
53
+
54
+ export default SingleCall;
@@ -0,0 +1,3 @@
1
+ .singlecall-waiting-container {
2
+ z-index: 1;
3
+ }
@@ -0,0 +1,45 @@
1
+ import React, { useContext, useEffect, useState } from 'react';
2
+ import { CallRole, TUIGlobal } from '../../../../TUICallService';
3
+ import OverlayStream from '../../common/OverlayStream/OverlayStream';
4
+ import { UserInfoContext } from '../../../context';
5
+ import defaultAvatarSrc from '../../../assets/common/defaultAvatar.svg';
6
+ import useViewBackgroundConfig from '../../../hooks/useViewBackgroundConfig';
7
+ import waitingStyle from './Waiting.module.scss';
8
+
9
+ interface IWaitingProps {
10
+ avatar?: string;
11
+ username?: string;
12
+ callRole?: CallRole;
13
+ userId?: string;
14
+ }
15
+ type TObjectFit = 'fill' | 'contain' | 'cover' | 'none' | 'scale-down';
16
+
17
+ export default function Waiting(props: IWaitingProps) {
18
+ const { avatar, username, userId } = props;
19
+ const { localUserInfo } = useContext(UserInfoContext);
20
+ const viewBackgroundConfigObj = useViewBackgroundConfig();
21
+ const [background, setBackground] = useState(viewBackgroundConfigObj[userId] || avatar);
22
+ const [showOverlayer, setShowOverlayer] = useState(!viewBackgroundConfigObj[userId]);
23
+ const [fit, setFit] = useState<TObjectFit>(viewBackgroundConfigObj[userId] ? 'fill' : 'cover');
24
+
25
+ useEffect(() => {
26
+ setBackground(viewBackgroundConfigObj[userId] || avatar || defaultAvatarSrc);
27
+ setShowOverlayer(!localUserInfo.isVideoAvailable && !viewBackgroundConfigObj[userId]);
28
+ setFit(viewBackgroundConfigObj[userId] ? 'fill' : 'cover');
29
+ }, [viewBackgroundConfigObj, userId]);
30
+
31
+ return (
32
+ <OverlayStream
33
+ className={waitingStyle['singlecall-waiting-container']}
34
+ showLoading={false}
35
+ avatar={avatar || defaultAvatarSrc}
36
+ username={username}
37
+ showAvatar={!TUIGlobal.isPC}
38
+ background={background}
39
+ showBackground={!localUserInfo.isVideoAvailable}
40
+ isMobile={!TUIGlobal.isPC}
41
+ showOverlayer={showOverlayer}
42
+ fit={fit}
43
+ />
44
+ );
45
+ }
@@ -0,0 +1,28 @@
1
+ @use '../../../style/theme/util' as *;
2
+ @import '../../../style/common/var.scss';
3
+
4
+ .#{$prefix}-avatar-container {
5
+ display: flex;
6
+ align-items: center;
7
+ justify-content: center;
8
+ border: 0px;
9
+ padding: 0;
10
+ overflow: hidden;
11
+ @include theme() {
12
+ background-color: get(white-1);
13
+ }
14
+
15
+ &.#{$prefix}-avatar-shape-round {
16
+ border-radius: 6px;
17
+ }
18
+
19
+ &.#{$prefix}-avatar-shape-circle {
20
+ border-radius: 50%;
21
+ }
22
+
23
+ img {
24
+ width: 100%;
25
+ height: 100%;
26
+ object-fit: fill;
27
+ }
28
+ }
@@ -0,0 +1,52 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { classNames } from '../../../util/classnames';
3
+ import { classPrefix } from '../../../const/common';
4
+ import DefaultAvatarSrc from '../../../assets/common/defaultAvatar.svg';
5
+ import './Avatar.scss';
6
+
7
+ interface IAvatarProps {
8
+ shape?: 'round' | 'circle';
9
+ image?: string;
10
+ icon?: ReactNode;
11
+ children?: ReactNode;
12
+ className?: string;
13
+ style?: object;
14
+ }
15
+
16
+ export default function Avatar(props: IAvatarProps) {
17
+ const {
18
+ shape = 'round',
19
+ image,
20
+ icon,
21
+ children,
22
+ className,
23
+ style,
24
+ } = props;
25
+
26
+ const setDefaultImg = (e) => {
27
+ e.target.src = DefaultAvatarSrc;
28
+ };
29
+
30
+ const renderContent = () => {
31
+ if (typeof image === 'string') {
32
+ return <img src={image} onError={setDefaultImg} />;
33
+ }
34
+ if (icon) {
35
+ return icon;
36
+ }
37
+
38
+ return children;
39
+ };
40
+
41
+ const classnames = classNames([
42
+ className,
43
+ `${classPrefix}-avatar-container`,
44
+ `${classPrefix}-avatar-shape-${shape}`,
45
+ ]);
46
+
47
+ return (
48
+ <div className={classnames} style={style}>
49
+ {renderContent()}
50
+ </div>
51
+ );
52
+ }
@@ -0,0 +1,3 @@
1
+ import Avatar from './Avatar';
2
+
3
+ export default Avatar;
@@ -0,0 +1,122 @@
1
+ @use "../../../style/theme/util" as *;
2
+ @import '../../../style/common/var.scss';
3
+ @import '../../../style/common/mixin.scss';
4
+
5
+ // size
6
+ $btn-height-s: 36px;
7
+ $btn-height-m: 40px;
8
+ $btn-height-l: 60px;
9
+ $btn-height-auto: auto;
10
+
11
+ // Font size
12
+ $btn-font-large: $font-size-l;
13
+ $btn-font-middle: $font-size-base;
14
+ $btn-font-small: $font-size-base;
15
+
16
+ // icon size
17
+ $btn-icon-size-s: $font-size-base;
18
+ $btn-icon-size-m: $font-size-l;
19
+ $btn-icon-size-l: $font-size-xl;
20
+
21
+ .#{$prefix}-btn-container {
22
+ display: flex;
23
+ @include theme() {
24
+ color: get(white-2);
25
+ }
26
+ transition-property: width,height,left,top;
27
+ transition-duration: 0.3s;
28
+ transition-timing-function: ease-in;
29
+
30
+ &.pc {
31
+ cursor: pointer;
32
+ }
33
+
34
+ &.#{$prefix}-flex-vertical {
35
+ flex-direction: column;
36
+ align-items: center;
37
+
38
+ &.#{$prefix}-size-s {
39
+ &.pc {
40
+ @include button-size($btn-height-auto, $btn-font-small, 20px, 0);
41
+ }
42
+ &.mobile {
43
+ @include button-size($btn-height-auto, $btn-font-small, 40px, 0);
44
+ }
45
+ }
46
+
47
+ &.#{$prefix}-size-m {
48
+ &.pc {
49
+ @include button-size($btn-height-auto, $btn-font-small, 60px, 0);
50
+ .#{$prefix}-icon {
51
+ width: 40px;
52
+ height: 40px;
53
+ }
54
+ }
55
+ &.mobile {
56
+ @include button-size($btn-height-auto, $btn-font-small, 60px, 0);
57
+ .#{$prefix}-icon {
58
+ width: 60px;
59
+ height: 60px;
60
+ }
61
+ }
62
+ }
63
+
64
+ &.#{$prefix}-size-l {
65
+ &.pc {
66
+ @include button-size($btn-height-auto, $btn-font-small, 60px, 0);
67
+ }
68
+ &.mobile {
69
+ @include button-size($btn-height-auto, $btn-font-small, 80px, 0);
70
+ }
71
+ }
72
+ }
73
+
74
+ &.#{$prefix}-flex-horizontal {
75
+ flex-direction: row;
76
+ align-items: center;
77
+
78
+ &.#{$prefix}-size-s {
79
+ @include button-size($btn-height-s, $btn-font-small, $btn-icon-size-s, 0);
80
+ }
81
+
82
+ &.#{$prefix}-size-m {
83
+ @include button-size($btn-height-m, $btn-font-middle, $btn-icon-size-m, 0);
84
+ }
85
+
86
+ &.#{$prefix}-size-l {
87
+ @include button-size($btn-height-l, $btn-font-middle, $btn-icon-size-l, 0);
88
+ }
89
+ }
90
+
91
+ &.#{$prefix}-ghost {
92
+ background: none;
93
+ }
94
+
95
+ .#{$prefix}-content {
96
+ margin-top: 8px;
97
+ text-align: center;
98
+ line-height: 15px;
99
+ font-style: normal;
100
+ font-weight: 400;
101
+ max-height: 30px;
102
+ overflow: hidden;
103
+ user-select: none;
104
+ }
105
+
106
+ .#{$prefix}-icon {
107
+ transition-property: width,height,left,top;
108
+ transition-duration: 0.3s;
109
+ transition-timing-function: ease-in;
110
+ &.#{$prefix}-size-s {
111
+ @include button-size($btn-height-s, $btn-font-small, $btn-icon-size-s, 0);
112
+ }
113
+
114
+ &.#{$prefix}-size-m {
115
+ @include button-size($btn-height-m, $btn-font-middle, $btn-icon-size-m, 0);
116
+ }
117
+
118
+ &.#{$prefix}-size-l {
119
+ @include button-size($btn-height-l, $btn-font-middle, $btn-icon-size-l, 0);
120
+ }
121
+ }
122
+ }