@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.
- package/README-zh_CN.md +97 -0
- package/README.md +104 -0
- package/debug/GenerateTestUserSig-es.js +26 -0
- package/debug/lib-generate-test-usersig-es.min.js +2 -0
- package/package.json +42 -0
- package/src/Components/TUICallKit/TUICallKit.module.scss +21 -0
- package/src/Components/TUICallKit/TUICallKit.tsx +267 -0
- package/src/Components/TUICallKit/index.ts +3 -0
- package/src/Components/assets/base/close.svg +1 -0
- package/src/Components/assets/base/error.svg +1 -0
- package/src/Components/assets/base/info.svg +1 -0
- package/src/Components/assets/base/loading-circle.svg +1 -0
- package/src/Components/assets/base/success.svg +1 -0
- package/src/Components/assets/base/waring.svg +1 -0
- package/src/Components/assets/button/accept.svg +10 -0
- package/src/Components/assets/button/backgroundBlurClose.svg +3 -0
- package/src/Components/assets/button/backgroundBlurOpen.svg +3 -0
- package/src/Components/assets/button/camera-close.svg +8 -0
- package/src/Components/assets/button/camera-open.svg +3 -0
- package/src/Components/assets/button/desktop/arrow.png +0 -0
- package/src/Components/assets/button/desktop/fullScreen.svg +4 -0
- package/src/Components/assets/button/desktop/minimize.svg +6 -0
- package/src/Components/assets/button/hangup.svg +3 -0
- package/src/Components/assets/button/microphone-close.svg +4 -0
- package/src/Components/assets/button/microphone-open.svg +4 -0
- package/src/Components/assets/button/mobile/down.svg +4 -0
- package/src/Components/assets/button/mobile/minimize.svg +4 -0
- package/src/Components/assets/button/mobile/switch-camera.svg +3 -0
- package/src/Components/assets/button/mobile/up.svg +4 -0
- package/src/Components/assets/button/speaker-close.svg +4 -0
- package/src/Components/assets/button/speaker-open.svg +3 -0
- package/src/Components/assets/button/switch-audio.svg +3 -0
- package/src/Components/assets/callMessage/audioCall.svg +3 -0
- package/src/Components/assets/callMessage/videoCall.svg +3 -0
- package/src/Components/assets/common/defaultAvatar.svg +11 -0
- package/src/Components/assets/common/microphone-volumn-close.svg +9 -0
- package/src/Components/assets/floatingWindow/desktop/floatCallEnd.svg +3 -0
- package/src/Components/assets/floatingWindow/desktop/floatFullScreen.svg +3 -0
- package/src/Components/assets/floatingWindow/desktop/floatMicrophone.svg +4 -0
- package/src/Components/assets/floatingWindow/desktop/floatMicrophoneClosed.svg +3 -0
- package/src/Components/assets/floatingWindow/mobile/camera-close.svg +14 -0
- package/src/Components/assets/floatingWindow/mobile/camera-open.svg +14 -0
- package/src/Components/assets/floatingWindow/mobile/earphone.svg +3 -0
- package/src/Components/assets/floatingWindow/mobile/microphone-close.svg +4 -0
- package/src/Components/assets/floatingWindow/mobile/microphone-open.svg +4 -0
- package/src/Components/assets/permission/desktop/index.ts +11 -0
- package/src/Components/assets/permission/desktop/mac/permit-en.jpg +0 -0
- package/src/Components/assets/permission/desktop/mac/permit-zh.jpg +0 -0
- package/src/Components/assets/permission/desktop/win/permit-en.png +0 -0
- package/src/Components/assets/permission/desktop/win/permit-zh.png +0 -0
- package/src/Components/assets/streamInfo/mobile/microphone-close-group.svg +19 -0
- package/src/Components/assets/streamInfo/mobile/microphone-close-single.svg +6 -0
- package/src/Components/assets/streamInfo/mobile/volumn.svg +20 -0
- package/src/Components/assets/streamInfo/networkStatus.svg +22 -0
- package/src/Components/components/GroupCall/GroupCall.module.scss +13 -0
- package/src/Components/components/GroupCall/GroupCall.tsx +82 -0
- package/src/Components/components/GroupCall/MediaContainer/AudioStream/AudioStream.tsx +41 -0
- package/src/Components/components/GroupCall/MediaContainer/MediaContainer.module.scss +74 -0
- package/src/Components/components/GroupCall/MediaContainer/MediaContainer.tsx +138 -0
- package/src/Components/components/GroupCall/MediaContainer/StreamLoading/StreamLoading.tsx +48 -0
- package/src/Components/components/GroupCall/MediaContainer/index.ts +3 -0
- package/src/Components/components/GroupCall/Waiting/Waiting.module.scss +44 -0
- package/src/Components/components/GroupCall/Waiting/Waiting.tsx +89 -0
- package/src/Components/components/SingleCall/MediaContainer/AudioStream/AudioStream.tsx +86 -0
- package/src/Components/components/SingleCall/MediaContainer/MediaContainer.module.scss +33 -0
- package/src/Components/components/SingleCall/MediaContainer/MediaContainer.tsx +121 -0
- package/src/Components/components/SingleCall/MediaContainer/hooks/useGetLargeViewName.ts +29 -0
- package/src/Components/components/SingleCall/MediaContainer/index.ts +3 -0
- package/src/Components/components/SingleCall/SingleCall.module.scss +28 -0
- package/src/Components/components/SingleCall/SingleCall.tsx +54 -0
- package/src/Components/components/SingleCall/Waiting/Waiting.module.scss +3 -0
- package/src/Components/components/SingleCall/Waiting/Waiting.tsx +45 -0
- package/src/Components/components/base/Avatar/Avatar.scss +28 -0
- package/src/Components/components/base/Avatar/Avatar.tsx +52 -0
- package/src/Components/components/base/Avatar/index.ts +3 -0
- package/src/Components/components/base/Button/Button.scss +122 -0
- package/src/Components/components/base/Button/Button.tsx +107 -0
- package/src/Components/components/base/Button/index.ts +3 -0
- package/src/Components/components/base/Drag/Drag.tsx +155 -0
- package/src/Components/components/base/Drag/index.tsx +3 -0
- package/src/Components/components/base/Grid/Col/Col.scss +31 -0
- package/src/Components/components/base/Grid/Col/Col.tsx +52 -0
- package/src/Components/components/base/Grid/Col/index.ts +3 -0
- package/src/Components/components/base/Grid/Row/Row.scss +27 -0
- package/src/Components/components/base/Grid/Row/Row.tsx +51 -0
- package/src/Components/components/base/Grid/Row/index.ts +5 -0
- package/src/Components/components/base/Grid/style/mixin.scss +61 -0
- package/src/Components/components/base/GridLayout/GridLayout.tsx +189 -0
- package/src/Components/components/base/GridLayout/GridPlusItem/GridPlusItem.scss +11 -0
- package/src/Components/components/base/GridLayout/GridPlusItem/GridPlusItem.tsx +37 -0
- package/src/Components/components/base/GridLayout/index.ts +7 -0
- package/src/Components/components/base/Icon/Icon.tsx +25 -0
- package/src/Components/components/base/Loading/Circle/Cilrcle.tsx +20 -0
- package/src/Components/components/base/Loading/Circle/Circle.scss +29 -0
- package/src/Components/components/base/Loading/Dot/Dot.scss +69 -0
- package/src/Components/components/base/Loading/Dot/Dot.tsx +21 -0
- package/src/Components/components/base/Loading/Loading.scss +22 -0
- package/src/Components/components/base/Loading/Loading.tsx +47 -0
- package/src/Components/components/base/Loading/index.ts +3 -0
- package/src/Components/components/base/Message/Message.scss +61 -0
- package/src/Components/components/base/Message/Message.tsx +94 -0
- package/src/Components/components/base/Message/MessageIcon/Error.tsx +7 -0
- package/src/Components/components/base/Message/MessageIcon/Info.tsx +7 -0
- package/src/Components/components/base/Message/MessageIcon/Success.tsx +8 -0
- package/src/Components/components/base/Message/MessageIcon/Warning.tsx +7 -0
- package/src/Components/components/base/Message/MessagePlugin.tsx +148 -0
- package/src/Components/components/base/Overlayer/Overlayer.scss +17 -0
- package/src/Components/components/base/Overlayer/Overlayer.tsx +49 -0
- package/src/Components/components/base/Popup/Popup.scss +34 -0
- package/src/Components/components/base/Popup/Popup.tsx +91 -0
- package/src/Components/components/base/Popup/hooks/useTrigger.tsx +67 -0
- package/src/Components/components/base/Portal/Portal.tsx +74 -0
- package/src/Components/components/base/Text/Text.scss +15 -0
- package/src/Components/components/base/Text/Text.tsx +30 -0
- package/src/Components/components/base/Time/Time.scss +14 -0
- package/src/Components/components/base/Time/Time.tsx +13 -0
- package/src/Components/components/base/ToggleWindow/ToggleWindow.scss +9 -0
- package/src/Components/components/base/ToggleWindow/ToggleWindow.tsx +83 -0
- package/src/Components/components/base/ToggleWindow/ToggleWindowItem/ToggleWindowItem.scss +51 -0
- package/src/Components/components/base/ToggleWindow/ToggleWindowItem/ToggleWindowItem.tsx +50 -0
- package/src/Components/components/base/ToggleWindow/index.ts +7 -0
- package/src/Components/components/base/common.ts +13 -0
- package/src/Components/components/base/hooks/useControlled.ts +31 -0
- package/src/Components/components/base/hooks/useDrag.ts +96 -0
- package/src/Components/components/base/hooks/useListenerEvent.ts +37 -0
- package/src/Components/components/base/hooks/useMutationObserver.ts +38 -0
- package/src/Components/components/base/hooks/useOnClickOutSide.ts +24 -0
- package/src/Components/components/base/util/index.ts +26 -0
- package/src/Components/components/common/ButtonPanel/ButtonPanel.tsx +127 -0
- package/src/Components/components/common/ButtonPanel/ButtonPanelH5/ButtonPanelH5.module.scss +67 -0
- package/src/Components/components/common/ButtonPanel/ButtonPanelH5/ButtonPanelH5.tsx +153 -0
- package/src/Components/components/common/ButtonPanel/ButtonPanelPC/ButtonPanelPC.module.scss +9 -0
- package/src/Components/components/common/ButtonPanel/ButtonPanelPC/ButtonPanelPC.tsx +32 -0
- package/src/Components/components/common/ButtonPanel/button/Accept/Accept.module.scss +7 -0
- package/src/Components/components/common/ButtonPanel/button/Accept/Accept.tsx +39 -0
- package/src/Components/components/common/ButtonPanel/button/Accept/index.ts +3 -0
- package/src/Components/components/common/ButtonPanel/button/BackgroundBlur/BackgroundBlur.module.scss +15 -0
- package/src/Components/components/common/ButtonPanel/button/BackgroundBlur/BackgroundBlur.tsx +46 -0
- package/src/Components/components/common/ButtonPanel/button/BackgroundBlur/index.ts +3 -0
- package/src/Components/components/common/ButtonPanel/button/Camera.tsx +81 -0
- package/src/Components/components/common/ButtonPanel/button/FullScreen/FullScreen.module.scss +13 -0
- package/src/Components/components/common/ButtonPanel/button/FullScreen/FullScreen.tsx +26 -0
- package/src/Components/components/common/ButtonPanel/button/FullScreen/index.ts +3 -0
- package/src/Components/components/common/ButtonPanel/button/Hangup/Hangup.module.scss +7 -0
- package/src/Components/components/common/ButtonPanel/button/Hangup/Hangup.tsx +42 -0
- package/src/Components/components/common/ButtonPanel/button/Hangup/index.ts +3 -0
- package/src/Components/components/common/ButtonPanel/button/Microphone.tsx +78 -0
- package/src/Components/components/common/ButtonPanel/button/Minimize/Minimize.module.scss +23 -0
- package/src/Components/components/common/ButtonPanel/button/Minimize/Minimize.tsx +35 -0
- package/src/Components/components/common/ButtonPanel/button/Minimize/index.ts +3 -0
- package/src/Components/components/common/ButtonPanel/button/Reject/Reject.module.scss +7 -0
- package/src/Components/components/common/ButtonPanel/button/Reject/Reject.tsx +39 -0
- package/src/Components/components/common/ButtonPanel/button/Reject/index.ts +3 -0
- package/src/Components/components/common/ButtonPanel/button/Speaker.tsx +75 -0
- package/src/Components/components/common/ButtonPanel/button/SwitchAudioCall.tsx +32 -0
- package/src/Components/components/common/ButtonPanel/button/SwitchCamera.tsx +19 -0
- package/src/Components/components/common/ButtonPanel/button/common.module.scss +51 -0
- package/src/Components/components/common/ButtonPanel/config.ts +505 -0
- package/src/Components/components/common/ButtonPanel/index.ts +3 -0
- package/src/Components/components/common/CallMessage/CallMessage.tsx +18 -0
- package/src/Components/components/common/CallMessage/CallMessageC2C/CallMessageC2C.module.scss +19 -0
- package/src/Components/components/common/CallMessage/CallMessageC2C/CallMessageC2C.tsx +84 -0
- package/src/Components/components/common/CallMessage/CallMessageGroup/CallMessageGroup.module.scss +5 -0
- package/src/Components/components/common/CallMessage/CallMessageGroup/CallMessageGroup.tsx +37 -0
- package/src/Components/components/common/CallMessage/index.ts +3 -0
- package/src/Components/components/common/DeviceSelector/DeviceSelector.module.scss +62 -0
- package/src/Components/components/common/DeviceSelector/DeviceSelector.tsx +105 -0
- package/src/Components/components/common/FloatingWindow/FloatingWindow.tsx +37 -0
- package/src/Components/components/common/FloatingWindow/FloatingWindowGroupCall/FloatingWindowGroupCall.tsx +97 -0
- package/src/Components/components/common/FloatingWindow/FloatingWindowGroupCall/style/FloatingWindowGroupCall.module.scss +2 -0
- package/src/Components/components/common/FloatingWindow/FloatingWindowGroupCall/style/mobile.module.scss +126 -0
- package/src/Components/components/common/FloatingWindow/FloatingWindowGroupCall/style/pc.module.scss +126 -0
- package/src/Components/components/common/FloatingWindow/FloatingWindowSingleCall/FloatingWindowSingleCall.tsx +75 -0
- package/src/Components/components/common/FloatingWindow/FloatingWindowSingleCall/style/FloatingWindowSingleCall.module.scss +2 -0
- package/src/Components/components/common/FloatingWindow/FloatingWindowSingleCall/style/mobile.module.scss +117 -0
- package/src/Components/components/common/FloatingWindow/FloatingWindowSingleCall/style/pc.module.scss +123 -0
- package/src/Components/components/common/FloatingWindow/index.ts +3 -0
- package/src/Components/components/common/MicrophoneVolumn/MicrophoneVolumn.module.scss +9 -0
- package/src/Components/components/common/MicrophoneVolumn/MicrophoneVolumn.tsx +50 -0
- package/src/Components/components/common/OverlayStream/OverlayStream.module.scss +165 -0
- package/src/Components/components/common/OverlayStream/OverlayStream.tsx +119 -0
- package/src/Components/components/common/Player/Player.module.scss +11 -0
- package/src/Components/components/common/Player/Player.tsx +75 -0
- package/src/Components/components/common/Pusher/Pusher.module.scss +10 -0
- package/src/Components/components/common/Pusher/Pusher.tsx +96 -0
- package/src/Components/components/common/StreamInfo/StreamInfo.tsx +10 -0
- package/src/Components/components/common/StreamInfo/StreamInfoH5/StreamInfoH5.module.scss +21 -0
- package/src/Components/components/common/StreamInfo/StreamInfoH5/StreamInfoH5.tsx +95 -0
- package/src/Components/components/common/StreamInfo/StreamInfoPC/StreamInfoPC.module.scss +38 -0
- package/src/Components/components/common/StreamInfo/StreamInfoPC/StreamInfoPC.tsx +35 -0
- package/src/Components/components/common/StreamInfo/index.ts +3 -0
- package/src/Components/components/common/Tip/Tip.tsx +68 -0
- package/src/Components/components/common/TopBar/TopBar.tsx +17 -0
- package/src/Components/components/common/TopBar/h5/TopBarH5.module.scss +12 -0
- package/src/Components/components/common/TopBar/h5/TopBarH5.tsx +40 -0
- package/src/Components/components/common/TopBar/pc/TopBarPC.module.scss +8 -0
- package/src/Components/components/common/TopBar/pc/TopBarPC.tsx +36 -0
- package/src/Components/const/common.ts +15 -0
- package/src/Components/context/CallUserInfoContext.ts +21 -0
- package/src/Components/context/CallerUserInfoContext.ts +11 -0
- package/src/Components/context/CustomUIConfigContext.ts +6 -0
- package/src/Components/context/FocusItemContext.ts +13 -0
- package/src/Components/context/IsClickableContext.ts +5 -0
- package/src/Components/context/TranslateContext.ts +6 -0
- package/src/Components/context/UserInfoContext.ts +9 -0
- package/src/Components/context/index.ts +17 -0
- package/src/Components/hooks/index.ts +9 -0
- package/src/Components/hooks/useCallDuration.ts +34 -0
- package/src/Components/hooks/useCustomButtonUIConfig.ts +27 -0
- package/src/Components/hooks/useDeviceList.ts +53 -0
- package/src/Components/hooks/useGetSpeakers.ts +69 -0
- package/src/Components/hooks/useGetVolumeMap.ts +67 -0
- package/src/Components/hooks/useNetWorkStatus.ts +34 -0
- package/src/Components/hooks/useTranslate.ts +7 -0
- package/src/Components/hooks/useViewBackgroundConfig.ts +8 -0
- package/src/Components/style/common/mixin.scss +22 -0
- package/src/Components/style/common/var.scss +21 -0
- package/src/Components/style/index.scss +5 -0
- package/src/Components/style/theme/_dark.scss +56 -0
- package/src/Components/style/theme/_light.scss +56 -0
- package/src/Components/style/theme/_util.scss +79 -0
- package/src/Components/style/theme/color.scss +23 -0
- package/src/Components/util/classnames.ts +35 -0
- package/src/Components/util/index.ts +138 -0
- package/src/Components/util/uiDesign.ts +45 -0
- package/src/TUICallService/CallService/UIDesign.ts +174 -0
- package/src/TUICallService/CallService/bellContext.ts +88 -0
- package/src/TUICallService/CallService/chatCombine.ts +313 -0
- package/src/TUICallService/CallService/engineEventHandler.ts +404 -0
- package/src/TUICallService/CallService/index.ts +797 -0
- package/src/TUICallService/CallService/miniProgram.ts +65 -0
- package/src/TUICallService/CallService/utils.ts +281 -0
- package/src/TUICallService/TUIGlobal/tuiGlobal.ts +43 -0
- package/src/TUICallService/TUIStore/callStore.ts +93 -0
- package/src/TUICallService/TUIStore/tuiStore.ts +167 -0
- package/src/TUICallService/assets/phone_dialing.mp3 +0 -0
- package/src/TUICallService/assets/phone_ringing.mp3 +0 -0
- package/src/TUICallService/const/call.ts +157 -0
- package/src/TUICallService/const/error.ts +20 -0
- package/src/TUICallService/const/index.ts +103 -0
- package/src/TUICallService/const/log.ts +9 -0
- package/src/TUICallService/index.ts +37 -0
- package/src/TUICallService/interface/ICallService.ts +70 -0
- package/src/TUICallService/interface/ICallStore.ts +55 -0
- package/src/TUICallService/interface/ITUIGlobal.ts +36 -0
- package/src/TUICallService/interface/ITUIStore.ts +87 -0
- package/src/TUICallService/interface/index.ts +4 -0
- package/src/TUICallService/locales/en.ts +135 -0
- package/src/TUICallService/locales/index.ts +61 -0
- package/src/TUICallService/locales/ja_JP.ts +134 -0
- package/src/TUICallService/locales/zh-cn.ts +130 -0
- package/src/TUICallService/serve/callManager.ts +109 -0
- package/src/TUICallService/utils/common-utils.ts +269 -0
- package/src/TUICallService/utils/decorators/promise-retry.ts +51 -0
- package/src/TUICallService/utils/env.ts +51 -0
- package/src/TUICallService/utils/index.ts +32 -0
- package/src/TUICallService/utils/is-empty.ts +31 -0
- package/src/TUICallService/utils/retry.ts +88 -0
- package/src/TUICallService/utils/timer.ts +162 -0
- package/src/TUICallService/utils/validate/avoidRepeatedCall.ts +39 -0
- package/src/TUICallService/utils/validate/index.ts +7 -0
- package/src/TUICallService/utils/validate/validateConfig.ts +188 -0
- package/src/TUICallService/utils/validate/validateParams.ts +88 -0
- package/src/TUICallService/utils/validate/validateStatus.ts +26 -0
- package/src/image.d.ts +8 -0
- package/src/index.ts +63 -0
- package/src/style.d.ts +1 -0
- package/tuicall-uikit-react.es.js +13177 -0
- package/tuicall-uikit-react.umd.js +133 -0
- package/types/Components/TUICallKit/TUICallKit.d.ts +15 -0
- package/types/Components/TUICallKit/index.d.ts +2 -0
- package/types/Components/assets/permission/desktop/index.d.ts +5 -0
- package/types/Components/components/GroupCall/GroupCall.d.ts +1 -0
- package/types/Components/components/GroupCall/MediaContainer/AudioStream/AudioStream.d.ts +10 -0
- package/types/Components/components/GroupCall/MediaContainer/MediaContainer.d.ts +1 -0
- package/types/Components/components/GroupCall/MediaContainer/StreamLoading/StreamLoading.d.ts +7 -0
- package/types/Components/components/GroupCall/MediaContainer/index.d.ts +2 -0
- package/types/Components/components/GroupCall/Waiting/Waiting.d.ts +8 -0
- package/types/Components/components/SingleCall/MediaContainer/AudioStream/AudioStream.d.ts +11 -0
- package/types/Components/components/SingleCall/MediaContainer/MediaContainer.d.ts +1 -0
- package/types/Components/components/SingleCall/MediaContainer/hooks/useGetLargeViewName.d.ts +3 -0
- package/types/Components/components/SingleCall/MediaContainer/index.d.ts +2 -0
- package/types/Components/components/SingleCall/SingleCall.d.ts +3 -0
- package/types/Components/components/SingleCall/Waiting/Waiting.d.ts +9 -0
- package/types/Components/components/base/Avatar/Avatar.d.ts +12 -0
- package/types/Components/components/base/Avatar/index.d.ts +2 -0
- package/types/Components/components/base/Button/Button.d.ts +25 -0
- package/types/Components/components/base/Button/index.d.ts +2 -0
- package/types/Components/components/base/Drag/Drag.d.ts +14 -0
- package/types/Components/components/base/Drag/index.d.ts +2 -0
- package/types/Components/components/base/Grid/Col/Col.d.ts +14 -0
- package/types/Components/components/base/Grid/Col/index.d.ts +2 -0
- package/types/Components/components/base/Grid/Row/Row.d.ts +14 -0
- package/types/Components/components/base/Grid/Row/index.d.ts +3 -0
- package/types/Components/components/base/GridLayout/GridLayout.d.ts +11 -0
- package/types/Components/components/base/GridLayout/GridPlusItem/GridPlusItem.d.ts +14 -0
- package/types/Components/components/base/GridLayout/index.d.ts +3 -0
- package/types/Components/components/base/Icon/Icon.d.ts +9 -0
- package/types/Components/components/base/Loading/Circle/Cilrcle.d.ts +6 -0
- package/types/Components/components/base/Loading/Dot/Dot.d.ts +6 -0
- package/types/Components/components/base/Loading/Loading.d.ts +14 -0
- package/types/Components/components/base/Loading/index.d.ts +2 -0
- package/types/Components/components/base/Message/Message.d.ts +16 -0
- package/types/Components/components/base/Message/MessageIcon/Error.d.ts +1 -0
- package/types/Components/components/base/Message/MessageIcon/Info.d.ts +1 -0
- package/types/Components/components/base/Message/MessageIcon/Success.d.ts +1 -0
- package/types/Components/components/base/Message/MessageIcon/Warning.d.ts +1 -0
- package/types/Components/components/base/Message/MessagePlugin.d.ts +14 -0
- package/types/Components/components/base/Overlayer/Overlayer.d.ts +14 -0
- package/types/Components/components/base/Popup/Popup.d.ts +13 -0
- package/types/Components/components/base/Popup/hooks/useTrigger.d.ts +10 -0
- package/types/Components/components/base/Portal/Portal.d.ts +19 -0
- package/types/Components/components/base/Text/Text.d.ts +10 -0
- package/types/Components/components/base/Time/Time.d.ts +7 -0
- package/types/Components/components/base/ToggleWindow/ToggleWindow.d.ts +15 -0
- package/types/Components/components/base/ToggleWindow/ToggleWindowItem/ToggleWindowItem.d.ts +14 -0
- package/types/Components/components/base/ToggleWindow/index.d.ts +3 -0
- package/types/Components/components/base/common.d.ts +7 -0
- package/types/Components/components/base/hooks/useControlled.d.ts +8 -0
- package/types/Components/components/base/hooks/useDrag.d.ts +6 -0
- package/types/Components/components/base/hooks/useListenerEvent.d.ts +13 -0
- package/types/Components/components/base/hooks/useMutationObserver.d.ts +4 -0
- package/types/Components/components/base/hooks/useOnClickOutSide.d.ts +1 -0
- package/types/Components/components/base/util/index.d.ts +5 -0
- package/types/Components/components/common/ButtonPanel/ButtonPanel.d.ts +1 -0
- package/types/Components/components/common/ButtonPanel/ButtonPanelH5/ButtonPanelH5.d.ts +8 -0
- package/types/Components/components/common/ButtonPanel/ButtonPanelPC/ButtonPanelPC.d.ts +6 -0
- package/types/Components/components/common/ButtonPanel/button/Accept/Accept.d.ts +5 -0
- package/types/Components/components/common/ButtonPanel/button/Accept/index.d.ts +2 -0
- package/types/Components/components/common/ButtonPanel/button/BackgroundBlur/BackgroundBlur.d.ts +1 -0
- package/types/Components/components/common/ButtonPanel/button/BackgroundBlur/index.d.ts +2 -0
- package/types/Components/components/common/ButtonPanel/button/Camera.d.ts +5 -0
- package/types/Components/components/common/ButtonPanel/button/FullScreen/FullScreen.d.ts +5 -0
- package/types/Components/components/common/ButtonPanel/button/FullScreen/index.d.ts +2 -0
- package/types/Components/components/common/ButtonPanel/button/Hangup/Hangup.d.ts +5 -0
- package/types/Components/components/common/ButtonPanel/button/Hangup/index.d.ts +2 -0
- package/types/Components/components/common/ButtonPanel/button/Microphone.d.ts +5 -0
- package/types/Components/components/common/ButtonPanel/button/Minimize/Minimize.d.ts +1 -0
- package/types/Components/components/common/ButtonPanel/button/Minimize/index.d.ts +2 -0
- package/types/Components/components/common/ButtonPanel/button/Reject/Reject.d.ts +5 -0
- package/types/Components/components/common/ButtonPanel/button/Reject/index.d.ts +2 -0
- package/types/Components/components/common/ButtonPanel/button/Speaker.d.ts +5 -0
- package/types/Components/components/common/ButtonPanel/button/SwitchAudioCall.d.ts +1 -0
- package/types/Components/components/common/ButtonPanel/button/SwitchCamera.d.ts +1 -0
- package/types/Components/components/common/ButtonPanel/config.d.ts +254 -0
- package/types/Components/components/common/ButtonPanel/index.d.ts +2 -0
- package/types/Components/components/common/CallMessage/CallMessage.d.ts +10 -0
- package/types/Components/components/common/CallMessage/CallMessageC2C/CallMessageC2C.d.ts +2 -0
- package/types/Components/components/common/CallMessage/CallMessageGroup/CallMessageGroup.d.ts +2 -0
- package/types/Components/components/common/CallMessage/index.d.ts +2 -0
- package/types/Components/components/common/DeviceSelector/DeviceSelector.d.ts +7 -0
- package/types/Components/components/common/FloatingWindow/FloatingWindow.d.ts +10 -0
- package/types/Components/components/common/FloatingWindow/FloatingWindowGroupCall/FloatingWindowGroupCall.d.ts +9 -0
- package/types/Components/components/common/FloatingWindow/FloatingWindowSingleCall/FloatingWindowSingleCall.d.ts +10 -0
- package/types/Components/components/common/FloatingWindow/index.d.ts +2 -0
- package/types/Components/components/common/MicrophoneVolumn/MicrophoneVolumn.d.ts +8 -0
- package/types/Components/components/common/OverlayStream/OverlayStream.d.ts +28 -0
- package/types/Components/components/common/Player/Player.d.ts +15 -0
- package/types/Components/components/common/Pusher/Pusher.d.ts +13 -0
- package/types/Components/components/common/StreamInfo/StreamInfo.d.ts +1 -0
- package/types/Components/components/common/StreamInfo/StreamInfoH5/StreamInfoH5.d.ts +10 -0
- package/types/Components/components/common/StreamInfo/StreamInfoPC/StreamInfoPC.d.ts +9 -0
- package/types/Components/components/common/StreamInfo/index.d.ts +2 -0
- package/types/Components/components/common/Tip/Tip.d.ts +7 -0
- package/types/Components/components/common/TopBar/TopBar.d.ts +1 -0
- package/types/Components/components/common/TopBar/h5/TopBarH5.d.ts +5 -0
- package/types/Components/components/common/TopBar/pc/TopBarPC.d.ts +5 -0
- package/types/Components/const/common.d.ts +11 -0
- package/types/Components/context/CallUserInfoContext.d.ts +17 -0
- package/types/Components/context/CallerUserInfoContext.d.ts +7 -0
- package/types/Components/context/CustomUIConfigContext.d.ts +3 -0
- package/types/Components/context/FocusItemContext.d.ts +8 -0
- package/types/Components/context/IsClickableContext.d.ts +2 -0
- package/types/Components/context/TranslateContext.d.ts +4 -0
- package/types/Components/context/UserInfoContext.d.ts +6 -0
- package/types/Components/context/index.d.ts +8 -0
- package/types/Components/hooks/index.d.ts +4 -0
- package/types/Components/hooks/useCallDuration.d.ts +1 -0
- package/types/Components/hooks/useCustomButtonUIConfig.d.ts +1 -0
- package/types/Components/hooks/useDeviceList.d.ts +8 -0
- package/types/Components/hooks/useGetSpeakers.d.ts +1 -0
- package/types/Components/hooks/useGetVolumeMap.d.ts +3 -0
- package/types/Components/hooks/useNetWorkStatus.d.ts +1 -0
- package/types/Components/hooks/useTranslate.d.ts +3 -0
- package/types/Components/hooks/useViewBackgroundConfig.d.ts +1 -0
- package/types/Components/util/classnames.d.ts +1 -0
- package/types/Components/util/index.d.ts +15 -0
- package/types/Components/util/uiDesign.d.ts +2 -0
- package/types/TUICallService/CallService/UIDesign.d.ts +28 -0
- package/types/TUICallService/CallService/bellContext.d.ts +19 -0
- package/types/TUICallService/CallService/chatCombine.d.ts +50 -0
- package/types/TUICallService/CallService/engineEventHandler.d.ts +35 -0
- package/types/TUICallService/CallService/index.d.ts +98 -0
- package/types/TUICallService/CallService/miniProgram.d.ts +7 -0
- package/types/TUICallService/CallService/utils.d.ts +42 -0
- package/types/TUICallService/TUIGlobal/tuiGlobal.d.ts +21 -0
- package/types/TUICallService/TUIStore/callStore.d.ts +10 -0
- package/types/TUICallService/TUIStore/tuiStore.d.ts +57 -0
- package/types/TUICallService/const/call.d.ts +141 -0
- package/types/TUICallService/const/error.d.ts +2 -0
- package/types/TUICallService/const/index.d.ts +27 -0
- package/types/TUICallService/const/log.d.ts +7 -0
- package/types/TUICallService/index.d.ts +5 -0
- package/types/TUICallService/interface/ICallService.d.ts +69 -0
- package/types/TUICallService/interface/ICallStore.d.ts +47 -0
- package/types/TUICallService/interface/ITUIGlobal.d.ts +36 -0
- package/types/TUICallService/interface/ITUIStore.d.ts +83 -0
- package/types/TUICallService/interface/index.d.ts +4 -0
- package/types/TUICallService/locales/en.d.ts +128 -0
- package/types/TUICallService/locales/index.d.ts +10 -0
- package/types/TUICallService/locales/ja_JP.d.ts +127 -0
- package/types/TUICallService/locales/zh-cn.d.ts +123 -0
- package/types/TUICallService/serve/callManager.d.ts +11 -0
- package/types/TUICallService/utils/common-utils.d.ts +62 -0
- package/types/TUICallService/utils/decorators/promise-retry.d.ts +32 -0
- package/types/TUICallService/utils/env.d.ts +10 -0
- package/types/TUICallService/utils/index.d.ts +2 -0
- package/types/TUICallService/utils/is-empty.d.ts +2 -0
- package/types/TUICallService/utils/retry.d.ts +36 -0
- package/types/TUICallService/utils/timer.d.ts +63 -0
- package/types/TUICallService/utils/validate/avoidRepeatedCall.d.ts +10 -0
- package/types/TUICallService/utils/validate/index.d.ts +2 -0
- package/types/TUICallService/utils/validate/validateConfig.d.ts +173 -0
- package/types/TUICallService/utils/validate/validateParams.d.ts +1 -0
- package/types/TUICallService/utils/validate/validateStatus.d.ts +5 -0
- package/types/index.d.ts +11 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
@use "../../../style/theme/util" as *;
|
|
2
|
+
|
|
3
|
+
.device-selector-container {
|
|
4
|
+
width: 180px;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
padding: 6px;
|
|
9
|
+
font-weight: 500;
|
|
10
|
+
|
|
11
|
+
.device-item {
|
|
12
|
+
width: 100%;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
padding: 5px 3px;
|
|
15
|
+
text-overflow: ellipsis;
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
text-align: left;
|
|
19
|
+
line-height: 20px;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
|
|
22
|
+
&.control-item {
|
|
23
|
+
@include theme() {
|
|
24
|
+
border-top: 1px solid get(white-7);
|
|
25
|
+
}
|
|
26
|
+
padding-left: 6px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&.btn {
|
|
30
|
+
@include theme() {
|
|
31
|
+
border-top: 1px solid get(white-2);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&:hover {
|
|
36
|
+
border-radius: 5px;
|
|
37
|
+
@include theme() {
|
|
38
|
+
background: get(white-7);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&.select {
|
|
43
|
+
@include theme() {
|
|
44
|
+
background-color: get(white-6);
|
|
45
|
+
}
|
|
46
|
+
border-radius: 3px;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.scroll-container {
|
|
52
|
+
width: 100%;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
border-radius: 3px;
|
|
55
|
+
|
|
56
|
+
.scroll-content {
|
|
57
|
+
max-height: 60px;
|
|
58
|
+
margin-right: -20px;
|
|
59
|
+
overflow: hidden auto;
|
|
60
|
+
padding-right: 20px;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import { DeviceType } from '../../../../TUICallService/const';
|
|
3
|
+
import { useTranslate, useDeviceList } from '../../../hooks';
|
|
4
|
+
import { TUICallKitAPI } from '../../../../TUICallService';
|
|
5
|
+
import { classNames } from '../../../util/classnames';
|
|
6
|
+
import { UserInfoContext, CallInfoContext } from '../../../context';
|
|
7
|
+
import deviceSelectorStyle from './DeviceSelector.module.scss';
|
|
8
|
+
|
|
9
|
+
interface IDeviceSelectorProps {
|
|
10
|
+
deviceType?: DeviceType;
|
|
11
|
+
isShowControlBtn?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default function DeviceSelector(props: IDeviceSelectorProps) {
|
|
15
|
+
const { deviceType, isShowControlBtn = true } = props;
|
|
16
|
+
const { localUserInfo } = useContext(UserInfoContext);
|
|
17
|
+
const { isMuteSpeaker } = useContext(CallInfoContext);
|
|
18
|
+
const [{ deviceList, currentDeviceId }, { setCurrentDeviceId }] = useDeviceList(deviceType);
|
|
19
|
+
const { t } = useTranslate();
|
|
20
|
+
const controlBtnClassName = classNames([
|
|
21
|
+
deviceSelectorStyle['device-item'],
|
|
22
|
+
deviceSelectorStyle['control-item'],
|
|
23
|
+
]);
|
|
24
|
+
const handleClickDeviceItem = async (deviceId: string) => {
|
|
25
|
+
try {
|
|
26
|
+
await TUICallKitAPI.switchDevice({
|
|
27
|
+
deviceType,
|
|
28
|
+
deviceId,
|
|
29
|
+
});
|
|
30
|
+
setCurrentDeviceId(deviceId);
|
|
31
|
+
} catch (err) {
|
|
32
|
+
console.debug(err);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const switchStatus = async () => {
|
|
36
|
+
if (deviceType === DeviceType.CAMERA) {
|
|
37
|
+
if (localUserInfo?.isVideoAvailable) {
|
|
38
|
+
await TUICallKitAPI.closeCamera();
|
|
39
|
+
} else {
|
|
40
|
+
await TUICallKitAPI.openCamera('localVideo');
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (deviceType === DeviceType.MICROPHONE) {
|
|
45
|
+
if (localUserInfo?.isAudioAvailable) {
|
|
46
|
+
await TUICallKitAPI.closeMicrophone();
|
|
47
|
+
} else {
|
|
48
|
+
await TUICallKitAPI.openMicrophone();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (deviceType === DeviceType.SPEAKER) {
|
|
53
|
+
if (isMuteSpeaker) {
|
|
54
|
+
await TUICallKitAPI.unMuteSpeaker();
|
|
55
|
+
} else {
|
|
56
|
+
await TUICallKitAPI.muteSpeaker();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const DeviceText = () => {
|
|
61
|
+
if (deviceType === DeviceType.CAMERA) {
|
|
62
|
+
return localUserInfo?.isVideoAvailable ? t('close camera') : t('open camera');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (deviceType === DeviceType.MICROPHONE) {
|
|
66
|
+
return localUserInfo?.isAudioAvailable ? t('close microphone') : t('open microphone');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (deviceType === DeviceType.SPEAKER) {
|
|
70
|
+
return isMuteSpeaker ? t('open speaker') : t('close speaker');
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
function renderDeviceList() {
|
|
74
|
+
if (deviceList?.length > 0) {
|
|
75
|
+
return deviceList?.map((device) => {
|
|
76
|
+
const { deviceId, label } = device;
|
|
77
|
+
return (
|
|
78
|
+
<div
|
|
79
|
+
className={classNames([
|
|
80
|
+
deviceSelectorStyle['device-item'],
|
|
81
|
+
{ [deviceSelectorStyle.select]: currentDeviceId === deviceId },
|
|
82
|
+
])}
|
|
83
|
+
key={deviceId}
|
|
84
|
+
onClick={() => handleClickDeviceItem(deviceId)}
|
|
85
|
+
>
|
|
86
|
+
{label}
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return <div className={deviceSelectorStyle['device-item']}>{t('failed to obtain speakers')}</div>;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<div className={deviceSelectorStyle['device-selector-container']}>
|
|
96
|
+
<div className={deviceSelectorStyle['scroll-container']}>
|
|
97
|
+
<div className={deviceSelectorStyle['scroll-content']}>
|
|
98
|
+
{renderDeviceList()}
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
{isShowControlBtn
|
|
102
|
+
&& <div onClick={switchStatus} className={controlBtnClassName}>{DeviceText()}</div>}
|
|
103
|
+
</div>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { ReactNode, useContext, useRef, useState } from 'react';
|
|
2
|
+
import { CallInfoContext } from '../../../context';
|
|
3
|
+
import FloatingWindowGroupCall from './FloatingWindowGroupCall/FloatingWindowGroupCall';
|
|
4
|
+
import FloatingWindowSingleCall from './FloatingWindowSingleCall/FloatingWindowSingleCall';
|
|
5
|
+
import Drag from '../../base/Drag/Drag';
|
|
6
|
+
|
|
7
|
+
interface IFloatingWindowProps {
|
|
8
|
+
showVideo?: boolean;
|
|
9
|
+
hasVideo?: boolean;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
isAudioAvailable?: boolean;
|
|
12
|
+
show?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default function FloatingWindow(props: IFloatingWindowProps) {
|
|
16
|
+
const { isGroupCall } = useContext(CallInfoContext);
|
|
17
|
+
const nodeRef = useRef<any>();
|
|
18
|
+
const [clickable, setClickable] = useState(true);
|
|
19
|
+
const visibility: any = props.show ? '' : 'hidden';
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<Drag
|
|
23
|
+
nodeRef={nodeRef}
|
|
24
|
+
initialPosition={{ right: '0px', top: '100px' }}
|
|
25
|
+
onMoveStart={() => setClickable(false)}
|
|
26
|
+
onMoveEnd={() => setClickable(true)}
|
|
27
|
+
>
|
|
28
|
+
<div ref={nodeRef} style={{ visibility }}>
|
|
29
|
+
{
|
|
30
|
+
isGroupCall
|
|
31
|
+
? <FloatingWindowGroupCall clickable={clickable} {...props} />
|
|
32
|
+
: <FloatingWindowSingleCall clickable={clickable} {...props} />
|
|
33
|
+
}
|
|
34
|
+
</div>
|
|
35
|
+
</Drag>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import React, { ReactNode, useContext } from 'react';
|
|
2
|
+
import { classNames } from '../../../../util/classnames';
|
|
3
|
+
import Icon from '../../../base/Icon/Icon';
|
|
4
|
+
import { CallInfoContext, UserInfoContext } from '../../../../context';
|
|
5
|
+
import {
|
|
6
|
+
CallStatus, TUICallKitAPI, TUIGlobal,
|
|
7
|
+
} from '../../../../../TUICallService';
|
|
8
|
+
import { useTranslate, useCallDuration } from '../../../../hooks';
|
|
9
|
+
import EarphoneSrc from '../../../../assets/floatingWindow/mobile/earphone.svg';
|
|
10
|
+
import CameraOpenSrc from '../../../../assets/floatingWindow/mobile/camera-open.svg';
|
|
11
|
+
import MicrophoneOpenSrc from '../../../../assets/floatingWindow/mobile/microphone-open.svg';
|
|
12
|
+
import CameraCloseSrc from '../../../../assets/floatingWindow/mobile/camera-close.svg';
|
|
13
|
+
import MicrophoneCloseSrc from '../../../../assets/floatingWindow/mobile/microphone-close.svg';
|
|
14
|
+
import floatingWindowGroupCallStyle from './style/FloatingWindowGroupCall.module.scss';
|
|
15
|
+
|
|
16
|
+
interface IFloatingWindowH5Props {
|
|
17
|
+
showVideo?: boolean;
|
|
18
|
+
hasVideo?: boolean;
|
|
19
|
+
clickable?: boolean;
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default function FloatingWindowGroupCall(props: IFloatingWindowH5Props) {
|
|
24
|
+
const { hasVideo, clickable } = props;
|
|
25
|
+
const { isGroupCall, callStatus } = useContext(CallInfoContext);
|
|
26
|
+
const { isFloat } = useContext(CallInfoContext);
|
|
27
|
+
const { localUserInfo: { isAudioAvailable, isVideoAvailable } } = useContext(UserInfoContext);
|
|
28
|
+
const duration = useCallDuration();
|
|
29
|
+
const { t } = useTranslate();
|
|
30
|
+
const cameraSrc = isVideoAvailable ? CameraOpenSrc : CameraCloseSrc;
|
|
31
|
+
const microphoneSrc = isAudioAvailable ? MicrophoneOpenSrc : MicrophoneCloseSrc;
|
|
32
|
+
|
|
33
|
+
const renderCallStatus = () => {
|
|
34
|
+
const classnames = classNames([
|
|
35
|
+
floatingWindowGroupCallStyle['video-stream'],
|
|
36
|
+
]);
|
|
37
|
+
return (
|
|
38
|
+
<>
|
|
39
|
+
<div
|
|
40
|
+
className={classnames}
|
|
41
|
+
id='float'
|
|
42
|
+
/>
|
|
43
|
+
{!hasVideo && (
|
|
44
|
+
<div className={floatingWindowGroupCallStyle['audio-stream']}>
|
|
45
|
+
<div className={floatingWindowGroupCallStyle.earphone}><Icon url={EarphoneSrc} /></div>
|
|
46
|
+
<div className={floatingWindowGroupCallStyle.info}>
|
|
47
|
+
{callStatus === CallStatus.CONNECTED ? duration : t('wait to be called')}
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
)}
|
|
51
|
+
</>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const floatingWindowGroupCallClassNames = classNames([
|
|
56
|
+
{
|
|
57
|
+
[floatingWindowGroupCallStyle['floating-window-h5-groupcall-container']]: !TUIGlobal.isPC,
|
|
58
|
+
[floatingWindowGroupCallStyle['floating-window-pc-groupcall-container']]: TUIGlobal.isPC,
|
|
59
|
+
},
|
|
60
|
+
]);
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<div
|
|
64
|
+
onClick={() => clickable && TUICallKitAPI.toggleMinimize()}
|
|
65
|
+
className={floatingWindowGroupCallClassNames}
|
|
66
|
+
>
|
|
67
|
+
<div className={floatingWindowGroupCallStyle['click-overlay']} />
|
|
68
|
+
<div className={classNames([
|
|
69
|
+
floatingWindowGroupCallStyle['call-status'],
|
|
70
|
+
{
|
|
71
|
+
[floatingWindowGroupCallStyle.float]: isFloat,
|
|
72
|
+
[floatingWindowGroupCallStyle.video]: hasVideo,
|
|
73
|
+
}])}
|
|
74
|
+
>
|
|
75
|
+
{renderCallStatus()}
|
|
76
|
+
</div>
|
|
77
|
+
{isGroupCall && isFloat && (
|
|
78
|
+
<div className={floatingWindowGroupCallStyle['device-status']}>
|
|
79
|
+
<div className={classNames([
|
|
80
|
+
floatingWindowGroupCallStyle.icon,
|
|
81
|
+
floatingWindowGroupCallStyle.camera,
|
|
82
|
+
])}
|
|
83
|
+
>
|
|
84
|
+
<Icon url={cameraSrc} />
|
|
85
|
+
</div>
|
|
86
|
+
<div className={classNames([
|
|
87
|
+
floatingWindowGroupCallStyle.icon,
|
|
88
|
+
floatingWindowGroupCallStyle.micphone,
|
|
89
|
+
])}
|
|
90
|
+
>
|
|
91
|
+
<Icon url={microphoneSrc} />
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
)}
|
|
95
|
+
</div>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
@use "../../../../../style/theme/util" as *;
|
|
2
|
+
|
|
3
|
+
.floating-window-h5-groupcall-container {
|
|
4
|
+
width: 72px;
|
|
5
|
+
height: 90px;
|
|
6
|
+
top: 100px;
|
|
7
|
+
right: 0;
|
|
8
|
+
display: flex;
|
|
9
|
+
z-index: 99;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
align-items: center;
|
|
12
|
+
border-radius: 12px;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
@include theme() {
|
|
16
|
+
background-color: get(floating-color-default);
|
|
17
|
+
box-shadow: 0px 0px 10px 0px get(black-8);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.click-overlay {
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: 0;
|
|
23
|
+
left: 0;
|
|
24
|
+
right: 0;
|
|
25
|
+
bottom: 0;
|
|
26
|
+
opacity: 0;
|
|
27
|
+
z-index: 11;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.call-status {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
align-content: center;
|
|
34
|
+
align-items: center;
|
|
35
|
+
width: 100%;
|
|
36
|
+
height: 100%;
|
|
37
|
+
|
|
38
|
+
.video-stream {
|
|
39
|
+
position: absolute;
|
|
40
|
+
width: 100%;
|
|
41
|
+
height: 100%;
|
|
42
|
+
top: 0;
|
|
43
|
+
left: 0;
|
|
44
|
+
// padding: 8px;
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
|
|
47
|
+
&.hidden {
|
|
48
|
+
visibility: hidden !important;
|
|
49
|
+
opacity: 0;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.audio-stream {
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
position: absolute;
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 100%;
|
|
60
|
+
top: 0;
|
|
61
|
+
left: 0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.call-status {
|
|
66
|
+
height: 70px;
|
|
67
|
+
width: 100%;
|
|
68
|
+
position: relative;
|
|
69
|
+
padding: 8px 18px 8px 18px;
|
|
70
|
+
box-sizing: border-box;
|
|
71
|
+
|
|
72
|
+
&.video {
|
|
73
|
+
padding: 8px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.earphone {
|
|
77
|
+
height: 36px;
|
|
78
|
+
width: 36px;
|
|
79
|
+
top: 8px;
|
|
80
|
+
position: absolute;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.info {
|
|
84
|
+
@include theme() {
|
|
85
|
+
color: get(text-color-success);
|
|
86
|
+
}
|
|
87
|
+
text-align: center;
|
|
88
|
+
font-family: PingFang SC;
|
|
89
|
+
font-size: 12px;
|
|
90
|
+
font-style: normal;
|
|
91
|
+
font-weight: 500;
|
|
92
|
+
line-height: 16px; /* 133.333% */
|
|
93
|
+
position: absolute;
|
|
94
|
+
bottom: 8px;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.device-status {
|
|
99
|
+
display: flex;
|
|
100
|
+
flex-direction: row;
|
|
101
|
+
align-items: center;
|
|
102
|
+
height: 20px;
|
|
103
|
+
width: 100%;
|
|
104
|
+
position: relative;
|
|
105
|
+
justify-content: space-evenly;
|
|
106
|
+
|
|
107
|
+
@include theme() {
|
|
108
|
+
background-color: get(floating-color-operate);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.icon {
|
|
112
|
+
display: flex;
|
|
113
|
+
width: 16px;
|
|
114
|
+
height: 16px;
|
|
115
|
+
position: absolute;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.camera {
|
|
119
|
+
left: 14px;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.micphone {
|
|
123
|
+
right: 14px;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
package/src/Components/components/common/FloatingWindow/FloatingWindowGroupCall/style/pc.module.scss
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
@use "../../../../../style/theme/util" as *;
|
|
2
|
+
|
|
3
|
+
.floating-window-pc-groupcall-container {
|
|
4
|
+
width: 80px;
|
|
5
|
+
height: 100px;
|
|
6
|
+
top: 100px;
|
|
7
|
+
right: 10px;
|
|
8
|
+
display: flex;
|
|
9
|
+
z-index: 99;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
align-items: center;
|
|
12
|
+
border-radius: 12px;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
|
|
16
|
+
@include theme() {
|
|
17
|
+
background-color: get(floating-color-default);
|
|
18
|
+
box-shadow: 0px 0px 10px 0px get(black-8);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.click-overlay {
|
|
22
|
+
position: absolute;
|
|
23
|
+
top: 0;
|
|
24
|
+
left: 0;
|
|
25
|
+
right: 0;
|
|
26
|
+
bottom: 0;
|
|
27
|
+
opacity: 0;
|
|
28
|
+
z-index: 11;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.call-status {
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
align-content: center;
|
|
35
|
+
align-items: center;
|
|
36
|
+
width: 100%;
|
|
37
|
+
height: 100%;
|
|
38
|
+
|
|
39
|
+
.video-stream {
|
|
40
|
+
position: absolute;
|
|
41
|
+
width: 100%;
|
|
42
|
+
height: 100%;
|
|
43
|
+
top: 0;
|
|
44
|
+
left: 0;
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
|
|
47
|
+
&.hidden {
|
|
48
|
+
visibility: hidden !important;
|
|
49
|
+
opacity: 0;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.audio-stream {
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
position: absolute;
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 100%;
|
|
60
|
+
top: 0;
|
|
61
|
+
left: 0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.call-status {
|
|
66
|
+
height: 80px;
|
|
67
|
+
width: 100%;
|
|
68
|
+
position: relative;
|
|
69
|
+
padding: 8px 18px 8px 18px;
|
|
70
|
+
box-sizing: border-box;
|
|
71
|
+
|
|
72
|
+
&.video {
|
|
73
|
+
padding: 8px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.earphone {
|
|
77
|
+
height: 36px;
|
|
78
|
+
width: 36px;
|
|
79
|
+
top: 8px;
|
|
80
|
+
position: absolute;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.info {
|
|
84
|
+
@include theme() {
|
|
85
|
+
color: get(text-color-success);
|
|
86
|
+
}
|
|
87
|
+
text-align: center;
|
|
88
|
+
font-family: PingFang SC;
|
|
89
|
+
font-size: 12px;
|
|
90
|
+
font-style: normal;
|
|
91
|
+
font-weight: 500;
|
|
92
|
+
line-height: 16px; /* 133.333% */
|
|
93
|
+
position: absolute;
|
|
94
|
+
bottom: 8px;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.device-status {
|
|
99
|
+
display: flex;
|
|
100
|
+
flex-direction: row;
|
|
101
|
+
align-items: center;
|
|
102
|
+
height: 20px;
|
|
103
|
+
width: 100%;
|
|
104
|
+
position: relative;
|
|
105
|
+
justify-content: space-evenly;
|
|
106
|
+
|
|
107
|
+
@include theme() {
|
|
108
|
+
background-color: get(floating-color-operate);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.icon {
|
|
112
|
+
display: flex;
|
|
113
|
+
width: 16px;
|
|
114
|
+
height: 16px;
|
|
115
|
+
position: absolute;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.camera {
|
|
119
|
+
left: 14px;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.micphone {
|
|
123
|
+
right: 14px;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React, { ReactNode, useContext } from 'react';
|
|
2
|
+
import { classNames } from '../../../../util/classnames';
|
|
3
|
+
import Icon from '../../../base/Icon/Icon';
|
|
4
|
+
import { CallInfoContext } from '../../../../context';
|
|
5
|
+
import { useTranslate, useCallDuration } from '../../../../hooks';
|
|
6
|
+
import {
|
|
7
|
+
CallMediaType, CallStatus, TUICallKitAPI, TUIGlobal,
|
|
8
|
+
} from '../../../../../TUICallService';
|
|
9
|
+
import EarphoneSrc from '../../../../assets/floatingWindow/mobile/earphone.svg';
|
|
10
|
+
import floatingWindowSingleCallStyle from './style/FloatingWindowSingleCall.module.scss';
|
|
11
|
+
|
|
12
|
+
interface IFloatingWindowProps {
|
|
13
|
+
showVideo?: boolean;
|
|
14
|
+
enable?: boolean;
|
|
15
|
+
hasVideo?: boolean;
|
|
16
|
+
clickable?: boolean;
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default function FloatingWindowSingleCall(props: IFloatingWindowProps) {
|
|
21
|
+
const { hasVideo, clickable } = props;
|
|
22
|
+
const { callStatus, callType } = useContext(CallInfoContext);
|
|
23
|
+
const { isFloat } = useContext(CallInfoContext);
|
|
24
|
+
const duration = useCallDuration();
|
|
25
|
+
const { t } = useTranslate();
|
|
26
|
+
|
|
27
|
+
const renderCallStatus = () => {
|
|
28
|
+
const classnames = classNames([
|
|
29
|
+
floatingWindowSingleCallStyle['video-stream'],
|
|
30
|
+
{
|
|
31
|
+
[floatingWindowSingleCallStyle.hidden]: !hasVideo,
|
|
32
|
+
},
|
|
33
|
+
]);
|
|
34
|
+
return (
|
|
35
|
+
<>
|
|
36
|
+
<div className={classnames} id='float' />
|
|
37
|
+
{!hasVideo ? (
|
|
38
|
+
<div className={floatingWindowSingleCallStyle['audio-stream']}>
|
|
39
|
+
<div className={floatingWindowSingleCallStyle.earphone}><Icon url={EarphoneSrc} /></div>
|
|
40
|
+
<div className={floatingWindowSingleCallStyle.info}>
|
|
41
|
+
{callStatus === CallStatus.CONNECTED ? duration : t('wait to be called')}
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
) : (
|
|
45
|
+
<div className={floatingWindowSingleCallStyle.info}>
|
|
46
|
+
{callStatus === CallStatus.CONNECTED ? '' : t('wait to be called')}
|
|
47
|
+
</div>
|
|
48
|
+
)}
|
|
49
|
+
</>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const classnames = classNames([
|
|
54
|
+
{
|
|
55
|
+
[floatingWindowSingleCallStyle['floating-window-h5-singlecall-container']]: !TUIGlobal.isPC,
|
|
56
|
+
[floatingWindowSingleCallStyle['floating-window-pc-singlecall-container']]: TUIGlobal.isPC,
|
|
57
|
+
[floatingWindowSingleCallStyle['audio-call']]: callType === CallMediaType.AUDIO,
|
|
58
|
+
},
|
|
59
|
+
]);
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<div onClick={() => {clickable && TUICallKitAPI.toggleMinimize()}} className={classnames}>
|
|
63
|
+
<div className={floatingWindowSingleCallStyle['click-overlay']} />
|
|
64
|
+
<div className={classNames([
|
|
65
|
+
[floatingWindowSingleCallStyle['call-status']],
|
|
66
|
+
{
|
|
67
|
+
[floatingWindowSingleCallStyle.float]: isFloat,
|
|
68
|
+
[floatingWindowSingleCallStyle.video]: hasVideo,
|
|
69
|
+
}])}
|
|
70
|
+
>
|
|
71
|
+
{renderCallStatus()}
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
}
|