@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,46 @@
|
|
|
1
|
+
import React, { useContext, useState } from 'react';
|
|
2
|
+
import Button from '../../../../base/Button';
|
|
3
|
+
import Icon from '../../../../base/Icon/Icon';
|
|
4
|
+
import { TUICallKitAPI, TUIGlobal } from '../../../../../../TUICallService';
|
|
5
|
+
import { useTranslate } from '../../../../../hooks';
|
|
6
|
+
import backgroundBlurCloseSrc from '../../../../../assets/button/backgroundBlurClose.svg';
|
|
7
|
+
import backgroundBlurOpenSrc from '../../../../../assets/button/backgroundBlurOpen.svg';
|
|
8
|
+
import { classNames } from '../../../../../util/classnames';
|
|
9
|
+
import { CallInfoContext } from '../../../../../context';
|
|
10
|
+
import { classPrefix } from '../../../../base/common';
|
|
11
|
+
import backGroundBlurStyle from './BackgroundBlur.module.scss';
|
|
12
|
+
import commonStyle from '../common.module.scss';
|
|
13
|
+
|
|
14
|
+
export default function BackgroundBlur() {
|
|
15
|
+
const { enableVirtualBackground } = useContext(CallInfoContext);
|
|
16
|
+
const [isClickable, setIsClickable] = useState(true);
|
|
17
|
+
const { t } = useTranslate();
|
|
18
|
+
const backgroundBlurIcon = <Icon url={enableVirtualBackground ? backgroundBlurOpenSrc : backgroundBlurCloseSrc} className={commonStyle['btn-icon']} />;
|
|
19
|
+
const iconClassName = classNames([
|
|
20
|
+
commonStyle['btn-icon-container'],
|
|
21
|
+
backGroundBlurStyle['background-blur-icon-container'],
|
|
22
|
+
{
|
|
23
|
+
mobile: !TUIGlobal.isPC,
|
|
24
|
+
pc: TUIGlobal.isPC,
|
|
25
|
+
close: !enableVirtualBackground,
|
|
26
|
+
},
|
|
27
|
+
]);
|
|
28
|
+
|
|
29
|
+
const handleClick = async () => {
|
|
30
|
+
setIsClickable(false);
|
|
31
|
+
await TUICallKitAPI.setBlurBackground(!enableVirtualBackground);
|
|
32
|
+
setIsClickable(true);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Button
|
|
37
|
+
loading={!isClickable}
|
|
38
|
+
className={commonStyle[`${classPrefix}-btn`]}
|
|
39
|
+
iconClassName={iconClassName}
|
|
40
|
+
icon={backgroundBlurIcon}
|
|
41
|
+
onClick={handleClick}
|
|
42
|
+
>
|
|
43
|
+
{t('virtual-background')}
|
|
44
|
+
</Button>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
useCallback,
|
|
3
|
+
useContext,
|
|
4
|
+
useMemo,
|
|
5
|
+
useState,
|
|
6
|
+
} from 'react';
|
|
7
|
+
import Button from '../../../base/Button';
|
|
8
|
+
import Icon from '../../../base/Icon/Icon';
|
|
9
|
+
import { classNames } from '../../../../util/classnames';
|
|
10
|
+
import Popup from '../../../base/Popup/Popup';
|
|
11
|
+
import DeviceSelector from '../../DeviceSelector/DeviceSelector';
|
|
12
|
+
import { DeviceType } from '../../../../../TUICallService/const';
|
|
13
|
+
import { UserInfoContext } from '../../../../context';
|
|
14
|
+
import { TUICallKitAPI, TUIGlobal } from '../../../../../TUICallService';
|
|
15
|
+
import { useTranslate } from '../../../../hooks';
|
|
16
|
+
import CameraOpenSrc from '../../../../assets/button/camera-open.svg';
|
|
17
|
+
import CameraCloseSrc from '../../../../assets/button/camera-close.svg';
|
|
18
|
+
import { classPrefix } from '../../../base/common';
|
|
19
|
+
import useDeviceList from '../../../../hooks/useDeviceList';
|
|
20
|
+
import commonStyle from './common.module.scss';
|
|
21
|
+
|
|
22
|
+
interface ICameraProps {
|
|
23
|
+
isMobile?: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default function Camera(props: ICameraProps) {
|
|
27
|
+
const { localUserInfo } = useContext(UserInfoContext);
|
|
28
|
+
const isCameraOpen = useMemo(
|
|
29
|
+
() => localUserInfo?.isVideoAvailable,
|
|
30
|
+
[localUserInfo?.isVideoAvailable],
|
|
31
|
+
);
|
|
32
|
+
const [isClickable, setIsClickable] = useState(true);
|
|
33
|
+
const { t } = useTranslate();
|
|
34
|
+
const [{ deviceList }] = useDeviceList(DeviceType.CAMERA);
|
|
35
|
+
const handleClick = useCallback(
|
|
36
|
+
async () => {
|
|
37
|
+
setIsClickable(false);
|
|
38
|
+
|
|
39
|
+
if (isCameraOpen) {
|
|
40
|
+
await TUICallKitAPI.closeCamera();
|
|
41
|
+
} else {
|
|
42
|
+
await TUICallKitAPI.openCamera('localVideo');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
setIsClickable(true);
|
|
46
|
+
},
|
|
47
|
+
[isCameraOpen],
|
|
48
|
+
);
|
|
49
|
+
const iconClassName = classNames([
|
|
50
|
+
commonStyle['btn-icon-container'],
|
|
51
|
+
{
|
|
52
|
+
mobile: !TUIGlobal.isPC,
|
|
53
|
+
pc: TUIGlobal.isPC,
|
|
54
|
+
close: !isCameraOpen,
|
|
55
|
+
disabled: !isClickable,
|
|
56
|
+
},
|
|
57
|
+
]);
|
|
58
|
+
const CameraIcon = <Icon url={isCameraOpen ? CameraOpenSrc : CameraCloseSrc} className={commonStyle['btn-icon']} />;
|
|
59
|
+
const btnText = isCameraOpen ? t('camera enabled') : t('camera disabled');
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<Popup
|
|
63
|
+
content={<DeviceSelector deviceType={DeviceType.CAMERA} />}
|
|
64
|
+
disabled={!TUIGlobal.isPC || !(deviceList?.length > 0)}
|
|
65
|
+
teleported={false}
|
|
66
|
+
>
|
|
67
|
+
<div style={{ display: 'flex' }}>
|
|
68
|
+
<Button
|
|
69
|
+
className={commonStyle[`${classPrefix}-btn`]}
|
|
70
|
+
iconClassName={iconClassName}
|
|
71
|
+
icon={CameraIcon}
|
|
72
|
+
loading={!isClickable}
|
|
73
|
+
onClick={handleClick}
|
|
74
|
+
{...props}
|
|
75
|
+
>
|
|
76
|
+
{btnText}
|
|
77
|
+
</Button>
|
|
78
|
+
</div>
|
|
79
|
+
</Popup>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@import "../../../../../style/common/var.scss";
|
|
2
|
+
|
|
3
|
+
.full-screen-container {
|
|
4
|
+
width: 20px !important;
|
|
5
|
+
height: 20px !important;
|
|
6
|
+
margin-right: 10px;
|
|
7
|
+
|
|
8
|
+
:global(.#{$prefix}-icon) {
|
|
9
|
+
line-height: 20px;
|
|
10
|
+
width: 20px !important;
|
|
11
|
+
height: 20px !important;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Button from '../../../../base/Button';
|
|
3
|
+
import Icon from '../../../../base/Icon/Icon';
|
|
4
|
+
import { toggleScreen } from '../../../../base/util/index';
|
|
5
|
+
import FullScreenSrc from '../../../../../assets/button/desktop/fullScreen.svg';
|
|
6
|
+
import fullScreenStyle from './FullScreen.module.scss';
|
|
7
|
+
|
|
8
|
+
interface IFullScreenProps {
|
|
9
|
+
domID?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default function FullScreen(props: IFullScreenProps) {
|
|
13
|
+
const { domID } = props;
|
|
14
|
+
const FullScreenIcon = <Icon url={FullScreenSrc} />;
|
|
15
|
+
return (
|
|
16
|
+
<Button
|
|
17
|
+
className={fullScreenStyle['full-screen-container']}
|
|
18
|
+
icon={FullScreenIcon}
|
|
19
|
+
onClick={() => {
|
|
20
|
+
if (typeof domID === 'string') {
|
|
21
|
+
toggleScreen(domID);
|
|
22
|
+
}
|
|
23
|
+
}}
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import { TUICallKitAPI, TUIGlobal } from '../../../../../../TUICallService';
|
|
3
|
+
import Button from '../../../../base/Button';
|
|
4
|
+
import Icon from '../../../../base/Icon/Icon';
|
|
5
|
+
import { classNames } from '../../../../../util/classnames';
|
|
6
|
+
import { useTranslate } from '../../../../../hooks';
|
|
7
|
+
import HangupSrc from '../../../../../assets/button/hangup.svg';
|
|
8
|
+
import { IsClickableContext } from '../../../../../context';
|
|
9
|
+
import { classPrefix } from '../../../../base/common';
|
|
10
|
+
import hangupStyle from './Hangup.module.scss';
|
|
11
|
+
import commonStyle from '../common.module.scss';
|
|
12
|
+
|
|
13
|
+
interface IHangupProps {
|
|
14
|
+
isMobile?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default function Hangup(props: IHangupProps) {
|
|
18
|
+
const isClickable = useContext(IsClickableContext);
|
|
19
|
+
const { t } = useTranslate();
|
|
20
|
+
const handleClick = () => TUICallKitAPI.hangup();
|
|
21
|
+
const iconClassName = classNames([
|
|
22
|
+
commonStyle['btn-icon-container'],
|
|
23
|
+
hangupStyle['hangup-icon-container'],
|
|
24
|
+
{
|
|
25
|
+
mobile: !TUIGlobal.isPC,
|
|
26
|
+
pc: TUIGlobal.isPC,
|
|
27
|
+
},
|
|
28
|
+
]);
|
|
29
|
+
const hangupIcon = <Icon className={commonStyle['btn-icon']} url={HangupSrc} />;
|
|
30
|
+
return (
|
|
31
|
+
<Button
|
|
32
|
+
loading={!isClickable}
|
|
33
|
+
className={commonStyle[`${classPrefix}-btn`]}
|
|
34
|
+
iconClassName={iconClassName}
|
|
35
|
+
icon={hangupIcon}
|
|
36
|
+
onClick={handleClick}
|
|
37
|
+
{...props}
|
|
38
|
+
>
|
|
39
|
+
{t('hangup')}
|
|
40
|
+
</Button>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
useCallback,
|
|
3
|
+
useContext,
|
|
4
|
+
useMemo,
|
|
5
|
+
useState,
|
|
6
|
+
} from 'react';
|
|
7
|
+
import Button from '../../../base/Button';
|
|
8
|
+
import Icon from '../../../base/Icon/Icon';
|
|
9
|
+
import { TUICallKitAPI, TUIGlobal } from '../../../../../TUICallService';
|
|
10
|
+
import { UserInfoContext } from '../../../../context';
|
|
11
|
+
import { classNames } from '../../../../util/classnames';
|
|
12
|
+
import Popup from '../../../base/Popup/Popup';
|
|
13
|
+
import DeviceSelector from '../../DeviceSelector/DeviceSelector';
|
|
14
|
+
import { useTranslate, useDeviceList } from '../../../../hooks';
|
|
15
|
+
import { DeviceType } from '../../../../../TUICallService/const';
|
|
16
|
+
import MicrophoneOpenSrc from '../../../../assets/button/microphone-open.svg';
|
|
17
|
+
import MicrophoneCloseSrc from '../../../../assets/button/microphone-close.svg';
|
|
18
|
+
import { classPrefix } from '../../../base/common';
|
|
19
|
+
import commonStyle from './common.module.scss';
|
|
20
|
+
|
|
21
|
+
interface IMicrophoneProps {
|
|
22
|
+
isMobile?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default function Microphone(props: IMicrophoneProps) {
|
|
26
|
+
const { localUserInfo } = useContext(UserInfoContext);
|
|
27
|
+
const isOpen = useMemo(() => localUserInfo?.isAudioAvailable, [localUserInfo]);
|
|
28
|
+
const [{ deviceList }] = useDeviceList(DeviceType.MICROPHONE);
|
|
29
|
+
const [isClickable, setIsClickable] = useState(true);
|
|
30
|
+
const { t } = useTranslate();
|
|
31
|
+
|
|
32
|
+
const handleClick = useCallback(
|
|
33
|
+
async () => {
|
|
34
|
+
setIsClickable(false);
|
|
35
|
+
|
|
36
|
+
if (isOpen) {
|
|
37
|
+
await TUICallKitAPI.closeMicrophone();
|
|
38
|
+
} else {
|
|
39
|
+
await TUICallKitAPI.openMicrophone();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
setIsClickable(true);
|
|
43
|
+
},
|
|
44
|
+
[isOpen, setIsClickable],
|
|
45
|
+
);
|
|
46
|
+
const iconClassName = classNames([
|
|
47
|
+
commonStyle['btn-icon-container'],
|
|
48
|
+
{
|
|
49
|
+
mobile: !TUIGlobal.isPC,
|
|
50
|
+
pc: TUIGlobal.isPC,
|
|
51
|
+
close: !isOpen,
|
|
52
|
+
disabled: !isClickable,
|
|
53
|
+
},
|
|
54
|
+
]);
|
|
55
|
+
const btnText = isOpen ? t('microphone enabled') : t('microphone disabled');
|
|
56
|
+
const MicrophoneIcon = <Icon className={commonStyle['btn-icon']} url={isOpen ? MicrophoneOpenSrc : MicrophoneCloseSrc}/>;
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<Popup
|
|
60
|
+
content={<DeviceSelector deviceType={DeviceType.MICROPHONE} />}
|
|
61
|
+
disabled={!TUIGlobal.isPC || !(deviceList?.length > 0)}
|
|
62
|
+
teleported={false}
|
|
63
|
+
>
|
|
64
|
+
<div style={{ display: 'flex' }}>
|
|
65
|
+
<Button
|
|
66
|
+
className={commonStyle[`${classPrefix}-btn`]}
|
|
67
|
+
iconClassName={iconClassName}
|
|
68
|
+
icon={MicrophoneIcon}
|
|
69
|
+
loading={!isClickable}
|
|
70
|
+
onClick={handleClick}
|
|
71
|
+
{...props}
|
|
72
|
+
>
|
|
73
|
+
{btnText}
|
|
74
|
+
</Button>
|
|
75
|
+
</div>
|
|
76
|
+
</Popup>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@import "../../../../../style/common/var.scss";
|
|
2
|
+
|
|
3
|
+
.minimize-desk-container {
|
|
4
|
+
margin-right: 10px;
|
|
5
|
+
width: 20px !important;
|
|
6
|
+
height: 20px !important;
|
|
7
|
+
|
|
8
|
+
:global(.tk-icon) {
|
|
9
|
+
width: 20px !important;
|
|
10
|
+
height: 20px !important;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.minimize-mobile-container {
|
|
15
|
+
margin-left: 10px;
|
|
16
|
+
width: 24px !important;
|
|
17
|
+
height: 24px !important;
|
|
18
|
+
|
|
19
|
+
:global(.tk-icon) {
|
|
20
|
+
width: 24px !important;
|
|
21
|
+
height: 24px !important;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Button from '../../../../base/Button';
|
|
3
|
+
import Icon from '../../../../base/Icon/Icon';
|
|
4
|
+
import { TUIGlobal, TUICallKitAPI } from '../../../../../../TUICallService';
|
|
5
|
+
import MinimizeDeskSrc from '../../../../../assets/button/desktop/minimize.svg';
|
|
6
|
+
import MinimizeMobileSrc from '../../../../../assets/button/mobile/minimize.svg';
|
|
7
|
+
import minimizeStyle from './Minimize.module.scss';
|
|
8
|
+
|
|
9
|
+
export default function Minimize() {
|
|
10
|
+
const isMobile = !TUIGlobal.isPC;
|
|
11
|
+
|
|
12
|
+
const handleClick = () => {
|
|
13
|
+
try {
|
|
14
|
+
if (document.fullscreenElement) {
|
|
15
|
+
document.exitFullscreen();
|
|
16
|
+
}
|
|
17
|
+
} catch (err) {
|
|
18
|
+
console.debug(err);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
TUICallKitAPI.toggleMinimize();
|
|
22
|
+
};
|
|
23
|
+
const MinimizeIcon = (
|
|
24
|
+
<Icon url={isMobile ? MinimizeMobileSrc : MinimizeDeskSrc} />
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<Button
|
|
29
|
+
className={isMobile ? minimizeStyle['minimize-mobile-container'] : minimizeStyle['minimize-desk-container']}
|
|
30
|
+
icon={MinimizeIcon}
|
|
31
|
+
onClick={handleClick}
|
|
32
|
+
isMobile={isMobile}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Button from '../../../../base/Button';
|
|
3
|
+
import { TUICallKitAPI, TUIGlobal } from '../../../../../../TUICallService';
|
|
4
|
+
import Icon from '../../../../base/Icon/Icon';
|
|
5
|
+
import { useTranslate } from '../../../../../hooks';
|
|
6
|
+
import { classNames } from '../../../../../util/classnames';
|
|
7
|
+
import HangupSrc from '../../../../../assets/button/hangup.svg';
|
|
8
|
+
import { classPrefix } from '../../../../base/common';
|
|
9
|
+
import commonStyle from '../common.module.scss';
|
|
10
|
+
import rejectStyle from './Reject.module.scss';
|
|
11
|
+
|
|
12
|
+
interface IRejectProps {
|
|
13
|
+
isMobile?: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default function Reject(props: IRejectProps) {
|
|
17
|
+
const { t } = useTranslate();
|
|
18
|
+
const handleClick = () => TUICallKitAPI.reject();
|
|
19
|
+
const iconClassName = classNames([
|
|
20
|
+
commonStyle['btn-icon-container'],
|
|
21
|
+
rejectStyle['reject-icon-container'],
|
|
22
|
+
{
|
|
23
|
+
mobile: !TUIGlobal.isPC,
|
|
24
|
+
pc: TUIGlobal.isPC,
|
|
25
|
+
},
|
|
26
|
+
]);
|
|
27
|
+
const hangupIcon = <Icon className={commonStyle['btn-icon']} url={HangupSrc} />;
|
|
28
|
+
return (
|
|
29
|
+
<Button
|
|
30
|
+
className={commonStyle[`${classPrefix}-btn`]}
|
|
31
|
+
icon={hangupIcon}
|
|
32
|
+
iconClassName={iconClassName}
|
|
33
|
+
onClick={handleClick}
|
|
34
|
+
{...props}
|
|
35
|
+
>
|
|
36
|
+
{t('reject')}
|
|
37
|
+
</Button>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React, { useCallback, useContext } from 'react';
|
|
2
|
+
import Button from '../../../base/Button';
|
|
3
|
+
import { TUICallKitAPI, TUIGlobal } from '../../../../../TUICallService/index';
|
|
4
|
+
import { CallInfoContext } from '../../../../context';
|
|
5
|
+
import Icon from '../../../base/Icon/Icon';
|
|
6
|
+
import { classNames } from '../../../../util/classnames';
|
|
7
|
+
import Popup from '../../../base/Popup/Popup';
|
|
8
|
+
import DeviceSelector from '../../DeviceSelector/DeviceSelector';
|
|
9
|
+
import { useTranslate, useDeviceList } from '../../../../hooks';
|
|
10
|
+
import { DeviceType } from '../../../../../TUICallService/const';
|
|
11
|
+
import SpeakerOpenSrc from '../../../../assets/button/speaker-open.svg';
|
|
12
|
+
import SpeakerCloseSrc from '../../../../assets/button/speaker-close.svg';
|
|
13
|
+
import { classPrefix } from '../../../base/common';
|
|
14
|
+
import commonStyle from './common.module.scss';
|
|
15
|
+
|
|
16
|
+
interface ISpeakerProps {
|
|
17
|
+
isMobile?: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default function Speaker(props: ISpeakerProps) {
|
|
21
|
+
const [{ deviceList, currentDeviceId }] = useDeviceList(DeviceType.SPEAKER);
|
|
22
|
+
const { isMuteSpeaker } = useContext(CallInfoContext);
|
|
23
|
+
const { t } = useTranslate();
|
|
24
|
+
const getLabelByDeviceId = (deviceId: any) => {
|
|
25
|
+
if (TUIGlobal.isPC) {
|
|
26
|
+
const result = deviceList.find((item) => item.deviceId === deviceId);
|
|
27
|
+
return result ? result.label : t('speaker enabled');
|
|
28
|
+
} else {
|
|
29
|
+
return isMuteSpeaker ? t('speaker disabled') : t('speaker enabled');
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const handleClick = useCallback(
|
|
34
|
+
() => {
|
|
35
|
+
if (isMuteSpeaker) {
|
|
36
|
+
TUICallKitAPI.unMuteSpeaker();
|
|
37
|
+
} else {
|
|
38
|
+
TUICallKitAPI.muteSpeaker();
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
[isMuteSpeaker],
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const SpeakerIcon = <Icon url={isMuteSpeaker ? SpeakerCloseSrc : SpeakerOpenSrc} className={commonStyle['btn-icon']} />;
|
|
45
|
+
|
|
46
|
+
const iconClassName = classNames([
|
|
47
|
+
commonStyle['btn-icon-container'],
|
|
48
|
+
{
|
|
49
|
+
mobile: !TUIGlobal.isPC,
|
|
50
|
+
pc: TUIGlobal.isPC,
|
|
51
|
+
close: isMuteSpeaker,
|
|
52
|
+
},
|
|
53
|
+
]);
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<Popup
|
|
57
|
+
trigger={TUIGlobal.isPC ? 'hover' : 'click'}
|
|
58
|
+
disabled={!(deviceList.length > 0 && TUIGlobal.isPC)}
|
|
59
|
+
content={<DeviceSelector deviceType={DeviceType.SPEAKER} />}
|
|
60
|
+
teleported={false}
|
|
61
|
+
>
|
|
62
|
+
<div style={{ display: 'flex' }}>
|
|
63
|
+
<Button
|
|
64
|
+
className={commonStyle[`${classPrefix}-btn`]}
|
|
65
|
+
iconClassName={iconClassName}
|
|
66
|
+
icon={SpeakerIcon}
|
|
67
|
+
onClick={handleClick}
|
|
68
|
+
{...props}
|
|
69
|
+
>
|
|
70
|
+
{getLabelByDeviceId(currentDeviceId)}
|
|
71
|
+
</Button>
|
|
72
|
+
</div>
|
|
73
|
+
</Popup>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Button from '../../../base/Button';
|
|
3
|
+
import { TUICallKitAPI, TUIGlobal, t } from '../../../../../TUICallService';
|
|
4
|
+
import Icon from '../../../base/Icon/Icon';
|
|
5
|
+
import { classNames } from '../../../../util/classnames';
|
|
6
|
+
import SwitchAudioCallSrc from '../../../../assets/button/switch-audio.svg';
|
|
7
|
+
import { classPrefix } from '../../../base/common';
|
|
8
|
+
import commonStyle from './common.module.scss';
|
|
9
|
+
|
|
10
|
+
export default function SwitchAudioCall(props) {
|
|
11
|
+
const handleClick = () => TUICallKitAPI.switchCallMediaType();
|
|
12
|
+
const iconClassName = classNames([
|
|
13
|
+
commonStyle['btn-icon-container'],
|
|
14
|
+
{
|
|
15
|
+
mobile: !TUIGlobal.isPC,
|
|
16
|
+
pc: TUIGlobal.isPC,
|
|
17
|
+
close: true,
|
|
18
|
+
},
|
|
19
|
+
]);
|
|
20
|
+
const SwitchAudioCallIcon = <Icon className={commonStyle['btn-icon']} url={SwitchAudioCallSrc} />;
|
|
21
|
+
return (
|
|
22
|
+
<Button
|
|
23
|
+
className={commonStyle[`${classPrefix}-btn`]}
|
|
24
|
+
iconClassName={iconClassName}
|
|
25
|
+
icon={SwitchAudioCallIcon}
|
|
26
|
+
onClick={handleClick}
|
|
27
|
+
{...props}
|
|
28
|
+
>
|
|
29
|
+
{t('video-to-audio')}
|
|
30
|
+
</Button>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TUICallKitAPI } from '../../../../../TUICallService';
|
|
3
|
+
import Button from '../../../base/Button';
|
|
4
|
+
import Icon from '../../../base/Icon/Icon';
|
|
5
|
+
import switchCameraSrc from '../../../../assets/button/mobile/switch-camera.svg';
|
|
6
|
+
|
|
7
|
+
export default function SwitchCamera(props) {
|
|
8
|
+
const handleSwitchCamera = () => TUICallKitAPI.switchCamera();
|
|
9
|
+
const hangupIcon = <Icon url={switchCameraSrc} />;
|
|
10
|
+
return (
|
|
11
|
+
<Button
|
|
12
|
+
style={{ width: '28px', height: '28px' }}
|
|
13
|
+
iconSize='28px'
|
|
14
|
+
icon={hangupIcon}
|
|
15
|
+
onClick={handleSwitchCamera}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
|
|
2
|
+
@use "../../../../style/theme/util" as *;
|
|
3
|
+
@import "../../../../style/common/var.scss";
|
|
4
|
+
|
|
5
|
+
.btn-icon {
|
|
6
|
+
width: 50% !important;
|
|
7
|
+
height: 50% !important;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.btn-icon-container {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
border-radius: 50%;
|
|
15
|
+
border: 0px;
|
|
16
|
+
@include theme() {
|
|
17
|
+
background-color: get(white-1);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&:global(.close) {
|
|
21
|
+
@include theme() {
|
|
22
|
+
background-color: get(black-5);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:global(.disabled) {
|
|
27
|
+
@include theme() {
|
|
28
|
+
background-color: get(black-5);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.arrow-btn {
|
|
34
|
+
padding: 4px;
|
|
35
|
+
width: 12px !important;
|
|
36
|
+
height: 12px !important;
|
|
37
|
+
margin: 20px 0px 0px 0px;
|
|
38
|
+
transform: translateY(-50%);
|
|
39
|
+
|
|
40
|
+
:global(.tk-icon) {
|
|
41
|
+
width: 12px !important;
|
|
42
|
+
height: 12px !important;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.#{$prefix}-btn {
|
|
47
|
+
transition-property: width,height,left,top;
|
|
48
|
+
transition-duration: 0.3s;
|
|
49
|
+
transition-timing-function: ease-in;
|
|
50
|
+
width: 70px !important;
|
|
51
|
+
}
|