@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,135 @@
1
+ export const en = {
2
+ // 按钮文案
3
+ 'hangup': 'Hang up',
4
+ 'reject': 'Decline',
5
+ 'accept': 'Accept',
6
+ 'camera': 'Camera',
7
+ 'microphone': 'Microphone',
8
+ 'speaker': 'speaker',
9
+ 'open camera': 'Open Camera',
10
+ 'close camera': 'Close Camera',
11
+ 'open microphone': 'Open Microphone',
12
+ 'close microphone': 'Close Microphone',
13
+ 'video-to-audio': 'Switch to audio',
14
+ 'virtual-background': 'Blur Background',
15
+ // 通话结果
16
+ 'other side reject call': 'other side reject call',
17
+ 'reject call': '{{ userList }} Reject Call',
18
+ 'cancel': 'Cancel Call',
19
+ 'other side line busy': 'other side line busy',
20
+ 'in busy': '{{ userList }} in busy',
21
+ 'call timeout': 'call timeout',
22
+ 'no response from the other side': 'no response from the other side',
23
+ 'end call': '{{ userList }} end call',
24
+ // 通话提示语
25
+ 'caller calling message': 'Awaiting response',
26
+ 'callee calling video message': 'invites you to a video call',
27
+ 'callee calling audio message': 'invites you to a voice call',
28
+ 'no microphone access': 'no microphone access',
29
+ 'no camera access': 'no camera access',
30
+ 'invite member': 'Invite Member',
31
+ 'Invited group call': 'invites you to a group call',
32
+ 'waiting': 'Calling...',
33
+ 'me': '(me)',
34
+ // 弹出层文案
35
+ 'browser-authorization': 'Browser authorization',
36
+ 'mac-privacy': 'System Preferences -> Security and Privacy -> Privacy',
37
+ 'win-privacy': 'Setting -> Privacy and Security -> App permissions',
38
+ 'mac-preferences': 'Open System Preferences',
39
+ 'win-preferences': 'Open Setting',
40
+ 'Please enter userID': 'Please enter userID',
41
+ 'View more': 'View more',
42
+ 'people selected': 'people selected',
43
+ 'Select all': 'Select all',
44
+ 'Cancel': 'Cancel',
45
+ 'Done': 'Done',
46
+ 'exist group call': 'A group call already exists in the current group',
47
+ // UI3.0 新增
48
+ 'camera enabled': 'Camera On',
49
+ 'camera disabled': 'Camera Off',
50
+ 'microphone enabled': 'Unmuted',
51
+ 'microphone disabled': 'Muted',
52
+ 'speaker enabled': 'Speaker On',
53
+ 'speaker disabled': 'Speaker Off',
54
+ 'open speaker': 'Turn on speaker',
55
+ 'close speaker': 'Turn off speaker',
56
+ 'wait to be called': 'Waiting',
57
+ 'answered': 'Connected',
58
+ 'people in the call': ' other(s) in the call',
59
+ 'failed to obtain speakers': 'failed to obtain speakers',
60
+ 'you have a new call': 'You have a new call',
61
+ 'switch camera': 'Switch',
62
+ 'join': 'Join',
63
+ 'people on the call': 'people on the call',
64
+ "Supports a maximum of 9 people for simultaneous calls": "Supports a maximum of 9 people for simultaneous calls",
65
+ 'you': '(you)',
66
+ "The network is poor during your current call": "The network is poor during your current call",
67
+ "The other user network is poor during the current call": "The other party's network is poor during the current call",
68
+ "TUICallKit init is not complete": "TUICallKit init is not complete. You need to use this API after the init API is finished.",
69
+ // combine chat
70
+ "Video call": "Video call",
71
+ "Voice call": "Voice call",
72
+ "Call End": "Call End",
73
+ "Switch voice call": "Switch voice call",
74
+ "Switch video call": "Switch video call",
75
+ "Call duration": "Duration",
76
+ "Call Cancel": "Canceled",
77
+ "Other Side Cancel": "Call canceled by caller",
78
+ "Decline": "Declined",
79
+ "Other Side Decline": "Call declined by user",
80
+ "No answer": "Call not answered",
81
+ "Other Side No Answer": "Call wasn't answered",
82
+ "Answered": "Answered",
83
+ "Other Side Line Busy": "Line busy",
84
+ "Line Busy": "Line busy. Call not received.",
85
+ // 待废弃文案
86
+ 'Those involved': 'Those involved in the call are',
87
+ 'call': 'call',
88
+ 'video-call': 'video call',
89
+ 'audio-call': 'audio call',
90
+ 'search': 'search',
91
+ 'search-result': 'search result',
92
+ 'no-user': 'user not found',
93
+ 'member-not-added': 'member not added',
94
+ 'input-phone-userID': 'phone number or userID',
95
+ 'not-login': 'not logged in',
96
+ 'login-status-expire': 'login status is invalid, please refresh the page and try again',
97
+ 'experience-multi-call': 'experience multi-person calls, please download the full-featured demo: ',
98
+ 'not-support-multi-call': 'multi-person call interface is not open',
99
+ 'userID': 'userID',
100
+ 'already-enter': 'entered the call',
101
+ 'camera-opened': 'Camera on',
102
+ 'camera-closed': 'Camera off',
103
+ 'microphone-opened': 'Mic on',
104
+ 'microphone-closed': 'Mic off',
105
+ 'timeout': '{{ userList }} timeout',
106
+ 'kick out': 'kick out',
107
+ 'image-resolution': 'Resolution',
108
+ 'default-image-resolution': 'Default',
109
+ 'invited-person': 'Invite',
110
+ 'be-rejected': 'Call declined, ',
111
+ 'be-no-response': 'No response, ',
112
+ 'be-line-busy': 'Line busy, ',
113
+ 'be-canceled': 'The call is canceled, ',
114
+ 'voice-call-end': 'Voice call ended',
115
+ 'video-call-end': 'Video call ended',
116
+ 'method-call-failed': 'Failed to sync the operation',
117
+ 'failed-to-obtain-permission': 'Failed to obtain permissions',
118
+ 'environment-detection-failed': 'Failed to check the environment',
119
+ 'switchToAudioCall-call-failed': 'switch to audio call method failed',
120
+ 'switchToVideoCall-call-failed': 'switch to video call method failed',
121
+ 'microphone-unavailable': 'No mic found',
122
+ 'camera-unavailable': 'No camera found',
123
+ 'ban-device': 'Device access denied',
124
+ 'not-supported-webrtc': 'Your current environment does not support WebRTC',
125
+ 'blacklist-user-tips': 'The identifier is in blacklist. Failed to send this message!',
126
+ 'is-already-calling': 'TUICallKit is already on a call',
127
+ 'need-init': 'Before initiating a call with TUICallKit, ensure that the TUICallKitAPI.init() method has executed successfully. ',
128
+ "can't call yourself": "Can't call yourself", // eslint-disable-line
129
+ 'Use-phone-and-computer': 'Use your mobile phone and computer to experience video calls',
130
+ 'Wechat scan right QR code': 'Wechat scan right QR code',
131
+ 'Scan the QR code above': 'Scan the QR code above',
132
+ 'accept-error': 'Accept failed',
133
+ 'accept-device-error': 'Accept failed, unable to auth calling device',
134
+ 'call-error': 'Start call failed',
135
+ };
@@ -0,0 +1,61 @@
1
+ import { TUIStore } from '../CallService/index';
2
+ import { NAME, StoreName } from '../const/index';
3
+ import { zh } from './zh-cn';
4
+ // @if process.env.BUILD_TARGET!='MINI'
5
+ import { en } from './en';
6
+ import { ja_JP } from './ja_JP';
7
+ // @endif
8
+ import { interpolate, isString, isPlainObject } from '../utils/common-utils';
9
+
10
+
11
+ export const CallTips: any = {
12
+ OTHER_SIDE: 'other side',
13
+ CANCEL: 'cancel',
14
+ OTHER_SIDE_REJECT_CALL: 'other side reject call',
15
+ REJECT_CALL: 'reject call',
16
+ OTHER_SIDE_LINE_BUSY: 'other side line busy',
17
+ IN_BUSY: 'in busy',
18
+ CALL_TIMEOUT: 'call timeout',
19
+ END_CALL: 'end call',
20
+ TIMEOUT: 'timeout',
21
+ KICK_OUT: 'kick out',
22
+ CALLER_CALLING_MSG: 'caller calling message',
23
+ CALLER_GROUP_CALLING_MSG: 'wait to be called',
24
+ CALLEE_CALLING_VIDEO_MSG: 'callee calling video message',
25
+ CALLEE_CALLING_AUDIO_MSG: 'callee calling audio message',
26
+ NO_MICROPHONE_DEVICE_PERMISSION: 'no microphone access',
27
+ NO_CAMERA_DEVICE_PERMISSION: 'no camera access',
28
+ EXIST_GROUP_CALL: 'exist group call',
29
+ LOCAL_NETWORK_IS_POOR: 'The network is poor during your current call',
30
+ REMOTE_NETWORK_IS_POOR: 'The other user network is poor during the current call',
31
+ };
32
+
33
+ export const languageData: languageDataType = {
34
+ 'zh-cn': zh,
35
+ // @if process.env.BUILD_TARGET!='MINI'
36
+ en,
37
+ ja_JP,
38
+ // @endif
39
+ };
40
+
41
+ // language translate
42
+ export function t(args): string {
43
+ const language = TUIStore.getData(StoreName.CALL, NAME.LANGUAGE);
44
+ let translationContent = '';
45
+ if (isString(args)) {
46
+ translationContent = languageData?.[language]?.[args] || '';
47
+ } else if (isPlainObject(args)) {
48
+ const { key, options } = args;
49
+ translationContent = languageData?.[language]?.[key] || '';
50
+ translationContent = interpolate(translationContent, options);
51
+ }
52
+
53
+ return translationContent;
54
+ }
55
+
56
+ interface languageItemType {
57
+ [key: string]: string;
58
+ }
59
+ interface languageDataType {
60
+ [key: string]: languageItemType;
61
+ }
@@ -0,0 +1,134 @@
1
+ export const ja_JP = {
2
+ // 按钮文案
3
+ 'hangup': '通話終了',
4
+ 'reject': '拒否',
5
+ 'accept': '応答',
6
+ 'camera': 'カメラ',
7
+ 'microphone': 'マイク',
8
+ 'speaker': 'スピーカー',
9
+ 'virtual-background': 'ボケ背景',
10
+ // 通话结果
11
+ 'other side reject call': '通話が拒否されました',
12
+ 'reject call': '{{ userList }} 通話拒否',
13
+ 'cancel': '通話をキャンセル',
14
+ 'other side line busy': '相手が通話中です',
15
+ 'in busy': '{{ userList }} 通話中',
16
+ 'call timeout': '呼び出しタイムアウト',
17
+ 'end call': '{{ userList }} 通話終了',
18
+ // 通话提示语
19
+ 'caller calling message': '応答を待っています',
20
+ 'callee calling video message': 'ビデオ通話に招待されました',
21
+ 'callee calling audio message': '音声通話に招待されました',
22
+ 'no microphone access': 'マイクにアクセスできません',
23
+ 'no camera access': 'カメラにアクセスできません',
24
+ 'invite member': 'メンバーを招待する',
25
+ // 弹出层文案
26
+ 'browser-authorization': 'ブラウザ認証',
27
+ 'mac-privacy': 'システム環境設定 -> セキュリティとプライバシー ->プライバシー',
28
+ 'win-privacy': '設定 -> セキュリティとプライバシー ->アプリのアクセス許可',
29
+ 'mac-preferences': 'システム環境設定を開く',
30
+ 'win-preferences': 'システム設定を開く',
31
+ 'Please enter userID': 'ユーザーIDを入力してください',
32
+ 'View more': 'もっと見る',
33
+ 'people selected': '人が選択されました',
34
+ 'Select all': 'すべて選択',
35
+ 'Cancel': 'キャンセル',
36
+ 'Done': '完了',
37
+ 'exist group call': '現在のグループには既にグループ通話が存在しています',
38
+ // combine chat
39
+ "Video call": "ビデオ通話を開始",
40
+ "Voice call": "音声通話を開始",
41
+ "Call End": "通話終了",
42
+ "Switch audio call": "音声通話に切り替える",
43
+ "Switch video call": "ビデオ通話に切り替える",
44
+ "Call duration": "通話時間",
45
+ "Call Cancel": "通話をキャンセルする",
46
+ "Other Side Cancel": "相手がキャンセルしました",
47
+ "Decline": "通話を拒否する",
48
+ "Other Side Decline": "相手が拒否しました",
49
+ "No answer": "無応答",
50
+ "Other Side No Answer": "相手からの返答はありません",
51
+ "Answered": "応答しました",
52
+ "Other Side Line Busy": "相手は現在忙しくて対応できません",
53
+ "Line Busy": "忙しいので応答できません",
54
+ // UI3.0文案
55
+ 'open camera': 'オープンカメラ',
56
+ 'close camera': 'カメラを閉じる',
57
+ 'open microphone': 'オープンマイク',
58
+ 'close microphone': 'マイクを閉じる',
59
+ 'camera enabled': 'カメラオン',
60
+ 'camera disabled': 'カメラオフ',
61
+ 'microphone enabled': 'マイクオン',
62
+ 'microphone disabled': 'マイクオフ',
63
+ 'speaker enabled': 'スピーカーオン',
64
+ 'speaker disabled': 'スピーカーオフ',
65
+ 'open speaker': 'スピーカーをオンにする',
66
+ 'close speaker': 'スピーカーの電源を切ります',
67
+ 'wait to be called': '待機中',
68
+ 'answered': '接続済み',
69
+ 'people in the call': '通話に参加している人たち',
70
+ 'failed to obtain speakers': 'スピーカーが見つかりません',
71
+ 'you have a new call': '新しい通話があります',
72
+ 'switch camera': '切り替え',
73
+ 'join': '参加する',
74
+ 'people on the call': '人が通話中です',
75
+ "Supports a maximum of 9 people for simultaneous calls": "最大で9人まで同時通話が可能です",
76
+ 'you': '(あなた)',
77
+ "The network is poor during your current call": "現在の通話で、あなたのネットワークは不良です",
78
+ "The other user network is poor during the current call": "現在の通話で、相手側のネットワークが不良です",
79
+ "TUICallKit init is not complete": "TUICallKitの初期化ログインが完了していません。init が完了した後にこのAPIを使用する必要があります。",
80
+ // 待废弃文案
81
+ 'timeout': '{{ userList }} タイムアウト',
82
+ 'kick out': 'キックアウトされました',
83
+ 'Invited group call': 'グループ通話に招待されました。',
84
+ 'Those involved': '参加者:',
85
+ 'call': '通話',
86
+ 'video-call': 'ビデオ通話',
87
+ 'audio-call': '音声通話',
88
+ 'search': '検索',
89
+ 'search-result': '検索結果',
90
+ 'Wechat scan right QR code': 'WeChatで右側にあるQRコードを読み取ります。',
91
+ 'Use-phone-and-computer': '携帯電話とコンピュータを使用してビデオ通話を体験してください',
92
+ 'Scan the QR code above': '上のQRコードを読み取ります。',
93
+ 'no-user': 'ユーザーが見つかりませんでした',
94
+ 'member-not-added': 'メンバーが追加されていません',
95
+ 'not-login': 'ログインしていません',
96
+ 'login-status-expire': 'ログインの有効期限が過ぎています。ページを更新してもう一度お試しください',
97
+ 'experience-multi-call': '複数人で同時に音声通話できるグループ通話機能を体験するには、全機能のデモをダウンロードしてください',
98
+ 'not-support-multi-call': 'グループ通話インターフェイスが開いていません',
99
+ 'input-phone-userID': '携帯電話番号/ユーザーIDを入力してください',
100
+ 'userID': 'ユーザーID',
101
+ 'already-enter': 'すでに通話に参加しています',
102
+ 'waiting': '応答を待っています...',
103
+ 'camera-opened': 'カメラがオンになっています',
104
+ 'camera-closed': 'カメラがオフになっています',
105
+ 'microphone-opened': 'マイクがオンになっています',
106
+ 'microphone-closed': 'マイクがオフになっています',
107
+ 'image-resolution': '解像度',
108
+ 'default-image-resolution': 'デフォルト解像度',
109
+ 'invited-person': 'メンバーを招待',
110
+ 'video-to-audio': '音声通話に切り替えます',
111
+ 'me': '(自分)',
112
+ 'be-rejected': '通話が拒否されました, ',
113
+ 'be-no-response': '応答なし, ',
114
+ 'be-line-busy': '相手が通話中です, ',
115
+ 'be-canceled': '相手が通話をキャンセルしました',
116
+ 'voice-call-end': '音声通話が終了しました',
117
+ 'video-call-end': 'ビデオ通話が終了しました',
118
+ 'method-call-failed': '操作の同期に失敗しました',
119
+ 'failed-to-obtain-permission': '権限の取得に失敗しました',
120
+ 'environment-detection-failed': '環境の検出に失敗しました',
121
+ 'switchToAudioCall-call-failed': '音声通話に切り替えることはできません',
122
+ 'switchToVideoCall-call-failed': 'ビデオ通話に切り替えることはできません',
123
+ 'microphone-unavailable': '使用できるマイクがありません',
124
+ 'camera-unavailable': '使用できるカメラがありません',
125
+ 'ban-device': 'デバイスへのアクセスが拒否されました',
126
+ 'not-supported-webrtc': '現在の環境はWebRTCをサポートしていません',
127
+ 'blacklist-user-tips': 'ユーザーはブラックリストに登録され、通話が開始できませんでした',
128
+ 'is-already-calling': 'TUICallKit はすでに通話中です',
129
+ 'need-init': 'TUICallKitで通話を開始する前に、TUICallKitAPI.init() メソッドが正常に実行されたことを確認してください。',
130
+ "can't call yourself": '自分に電話をかけることができません',
131
+ 'accept-error': '接続できませんでした',
132
+ 'accept-device-error': '接続できませんでした。発信側デバイスを認証できません',
133
+ 'call-error': '通話が開始できませんでした',
134
+ };
@@ -0,0 +1,130 @@
1
+ export const zh = {
2
+ // 按钮文案
3
+ 'hangup': '挂断',
4
+ 'reject': '拒绝',
5
+ 'accept': '接受',
6
+ 'camera': '摄像头',
7
+ 'microphone': '麦克风',
8
+ 'speaker': '扬声器',
9
+ 'open camera': '打开摄像头',
10
+ 'close camera': '关闭摄像头',
11
+ 'open microphone': '打开麦克风',
12
+ 'close microphone': '关闭麦克风',
13
+ 'video-to-audio': '转语音通话',
14
+ 'virtual-background': '模糊背景',
15
+ // 通话结果
16
+ 'other side reject call': '对方已拒绝',
17
+ 'reject call': '{{ userList }} 拒绝通话',
18
+ 'cancel': '取消通话',
19
+ 'other side line busy': '对方忙线',
20
+ 'in busy': '{{ userList }} 正在忙',
21
+ 'call timeout': '呼叫超时',
22
+ 'end call': '{{ userList }} 结束通话',
23
+ // 通话提示语
24
+ 'caller calling message': '等待对方接受邀请',
25
+ 'callee calling video message': '邀请你视频通话',
26
+ 'callee calling audio message': '邀请你语音通话',
27
+ 'no microphone access': '没有麦克风权限',
28
+ 'no camera access': '没有摄像头权限',
29
+ 'invite member': '邀请成员',
30
+ 'Invited group call': '邀请你加入多人通话',
31
+ 'Those involved': '参与通话的有:',
32
+ 'waiting': '等待接听...',
33
+ 'me': '(我)',
34
+ // 弹出层文案
35
+ 'browser-authorization': '浏览器授权',
36
+ 'mac-privacy': '系统偏好设置 -> 安全与隐私 -> 隐私',
37
+ 'win-privacy': '设置 -> 隐私和安全性 -> 应用权限',
38
+ 'mac-preferences': '打开系统偏好设置',
39
+ 'win-preferences': '打开系统设置',
40
+ 'Please enter userID': '请输入 userID',
41
+ 'View more': '查看更多',
42
+ 'people selected': '人已选中',
43
+ 'Select all': '全选',
44
+ 'Cancel': '取消',
45
+ 'Done': '完成',
46
+ 'exist group call': '当前群组中已经存在群组通话',
47
+ // UI3.0 新增
48
+ 'camera enabled': '摄像头已开',
49
+ 'camera disabled': '摄像头已关',
50
+ 'microphone enabled': '麦克风已开',
51
+ 'microphone disabled': '麦克风已关',
52
+ 'speaker enabled': '扬声器已开',
53
+ 'speaker disabled': '扬声器已关',
54
+ 'open speaker': '开启扬声器',
55
+ 'close speaker': '关闭扬声器',
56
+ 'wait to be called': '等待接听',
57
+ 'answered': '已接通',
58
+ 'people in the call': '人参与通话',
59
+ 'failed to obtain speakers': '无法获取扬声器',
60
+ 'you have a new call': '您有一个新的通话',
61
+ 'switch camera': '翻转',
62
+ 'join': '加入',
63
+ 'people on the call': '人正在通话',
64
+ "Supports a maximum of 9 people for simultaneous calls": "最多支持9人同时通话",
65
+ 'you': '(你)',
66
+ "The network is poor during your current call": "当前通话你的网络不佳",
67
+ "The other user network is poor during the current call": "当前通话对方网络不佳",
68
+ "TUICallKit init is not complete": "TUICallKit 初始化登录未完成,需要在 init 完成后使用此 API",
69
+ // combine chat
70
+ "Video call": "发起视频通话",
71
+ "Voice call": "发起语音通话",
72
+ "Call End": "通话结束",
73
+ "Switch voice call": "切换语音通话",
74
+ "Switch video call": "切换视频通话",
75
+ "Call duration": "通话时长",
76
+ "Call Cancel": "已取消",
77
+ "Other Side Cancel": "对方已取消",
78
+ "Decline": "已拒绝",
79
+ "Other Side Decline": "对方已拒绝",
80
+ "No answer": "超时无应答",
81
+ "Other Side No Answer": "对方无应答",
82
+ "Answered": "已接听",
83
+ "Other Side Line Busy": "对方忙线中",
84
+ "Line Busy": "忙线无应答",
85
+ // 待废弃文案
86
+ 'timeout': '{{ userList }} 超时',
87
+ 'kick out': '被踢',
88
+ 'call': '通话',
89
+ 'video-call': '视频通话',
90
+ 'audio-call': '音频通话',
91
+ 'search': '搜索',
92
+ 'search-result': '搜索结果',
93
+ 'Wechat scan right QR code': '微信扫右二维码',
94
+ 'Use-phone-and-computer': '用手机与电脑互打体验视频通话',
95
+ 'Scan the QR code above': '扫描上方二维码',
96
+ 'no-user': '未搜索到用户',
97
+ 'member-not-added': '未添加成员',
98
+ 'not-login': '未登录',
99
+ 'login-status-expire': '登录状态已失效,请刷新网页重试',
100
+ 'experience-multi-call': '体验多人通话请下载全功能demo:',
101
+ 'not-support-multi-call': '多人通话接口未开放',
102
+ 'input-phone-userID': '请输入手机号/用户ID',
103
+ 'userID': '用户ID',
104
+ 'already-enter': '已经进入当前通话',
105
+ 'image-resolution': '分辨率',
106
+ 'default-image-resolution': '默认分辨率',
107
+ 'invited-person': '添加成员',
108
+ 'be-rejected': '对方已拒绝,',
109
+ 'be-no-response': '对方无应答,',
110
+ 'be-line-busy': '对方忙线中,',
111
+ 'be-canceled': '对方已取消',
112
+ 'voice-call-end': '语音通话结束',
113
+ 'video-call-end': '视频通话结束',
114
+ 'method-call-failed': '同步操作失败',
115
+ 'failed-to-obtain-permission': '权限获取失败',
116
+ 'environment-detection-failed': '环境检测失败',
117
+ 'switchToAudioCall-call-failed': '切语音调用失败',
118
+ 'switchToVideoCall-call-failed': '切视频调用失败',
119
+ 'microphone-unavailable': '没有可用的麦克风设备',
120
+ 'camera-unavailable': '没有可用的摄像头设备',
121
+ 'ban-device': '用户禁止使用设备',
122
+ 'not-supported-webrtc': '当前环境不支持 WebRTC',
123
+ 'blacklist-user-tips': '发起通话失败,被对方拉入黑名单,禁止发起!',
124
+ 'is-already-calling': 'TUICallKit 已在通话状态',
125
+ 'need-init': 'TUICallKit 发起通话前需保证 TUICallKitAPI.init() 方法执行成功',
126
+ "can't call yourself": '不能呼叫自己', // eslint-disable-line
127
+ 'accept-error': '接通失败',
128
+ 'accept-device-error': '接通失败,通话设备获取失败',
129
+ 'call-error': '发起通话失败',
130
+ };
@@ -0,0 +1,109 @@
1
+ import { TUICallKitAPI, NAME, TUIStore, StoreName } from '../../index';
2
+ import { CallStatus } from '../const/index';
3
+ import { avoidRepeatedCall } from '../utils/validate/index';
4
+ import { IN_WX_MINI_APP } from '../utils/env';
5
+ /**
6
+ * @param {Number} sdkAppID 用户的sdkAppID 必传
7
+ * @param {String} userID 用户的userID 必传
8
+ * @param {String} userSig 用户的userSig 必传
9
+ * @param {String} globalCallPagePath 跳转的路径 必传
10
+ * @param {ChatSDK} tim tim实例 非必传
11
+ */
12
+ const PREFIX = 'callManager';
13
+ export class CallManager {
14
+ private _globalCallPagePath:string = '';
15
+ @avoidRepeatedCall()
16
+ public async init(params) {
17
+ const { sdkAppID, userID, userSig, globalCallPagePath, tim } = params;
18
+ if (!globalCallPagePath) {
19
+ console.error(`${PREFIX} globalCallPagePath Can not be empty!`);
20
+ return;
21
+ };
22
+ this._globalCallPagePath = globalCallPagePath;
23
+ try {
24
+ await TUICallKitAPI.init({
25
+ sdkAppID,
26
+ userID,
27
+ userSig,
28
+ tim,
29
+ });
30
+ this._watchTUIStore();
31
+ // uniApp 小程序全局监听下,关闭悬浮窗
32
+ if (!IN_WX_MINI_APP) {
33
+ TUICallKitAPI.enableFloatWindow(false);
34
+ };
35
+ console.log(`${PREFIX} init Ready!`);
36
+ } catch (error) {
37
+ console.error(`${PREFIX} init fail!`, error);
38
+ throw error;
39
+ }
40
+ }
41
+
42
+ // =========================【监听 TUIStore 中的状态】=========================
43
+ private _watchTUIStore() {
44
+ TUIStore?.watch(StoreName.CALL, {
45
+ [NAME.CALL_STATUS]: this._handleCallStatusChange,
46
+ }, {
47
+ notifyRangeWhenWatch: NAME.MYSELF,
48
+ });
49
+ }
50
+
51
+ private _unwatchTUIStore() {
52
+ TUIStore?.unwatch(StoreName.CALL, {
53
+ [NAME.CALL_STATUS]: this._handleCallStatusChange,
54
+ });
55
+ }
56
+
57
+ private _handleCallStatusChange = async (value: CallStatus) => {
58
+ switch (value) {
59
+ case CallStatus.CALLING:
60
+ case CallStatus.CONNECTED:
61
+ this._handleCallStatusToCalling();
62
+ break;
63
+
64
+ case CallStatus.IDLE:
65
+ this._handleCallStatusToIdle();
66
+ break;
67
+ }
68
+ };
69
+
70
+ private _handleCallStatusToCalling() {
71
+ if (this.getRoute() === this._globalCallPagePath) return;
72
+ // @ts-ignore
73
+ wx.navigateTo({
74
+ url: `/${this._globalCallPagePath}`,
75
+ success: () => {},
76
+ fail: () => {
77
+ console.error(`${PREFIX} navigateTo fail!`);
78
+ },
79
+ complete: () => {},
80
+ });
81
+ }
82
+
83
+ private _handleCallStatusToIdle() {
84
+ if (this.getRoute() !== this._globalCallPagePath) return;
85
+ // @ts-ignore
86
+ wx.navigateBack({
87
+ success: () => {},
88
+ fail: () => {
89
+ console.error(`${PREFIX} navigateBack fail!`);
90
+ },
91
+ complete: () => {},
92
+ });
93
+ }
94
+
95
+ // 获取当前的页面地址
96
+ getRoute() {
97
+ // @ts-ignore
98
+ const pages = getCurrentPages();
99
+ const currentPage = pages[pages.length - 1];
100
+ return currentPage.route;
101
+ }
102
+
103
+ // 卸载 callManger
104
+ public async destroyed() {
105
+ this._globalCallPagePath = '';
106
+ this._unwatchTUIStore();
107
+ await TUICallKitAPI.destroyed();
108
+ }
109
+ }