@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,27 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import { ButtonPanelConfig } from '../components/common/ButtonPanel/config';
|
|
3
|
+
import { findValues } from '../util';
|
|
4
|
+
import { CustomUIConfigContext } from '../context';
|
|
5
|
+
|
|
6
|
+
export default function useCustomButtonUIConfig() {
|
|
7
|
+
const { button: buttonConfig } = useContext(CustomUIConfigContext);
|
|
8
|
+
const results = [];
|
|
9
|
+
|
|
10
|
+
function condition(value) {
|
|
11
|
+
return Object.keys(buttonConfig).includes(value);
|
|
12
|
+
}
|
|
13
|
+
function formatResults({ key, value }) {
|
|
14
|
+
const valueArr = value.split('.');
|
|
15
|
+
let path = valueArr.slice(0, valueArr.length - 1);
|
|
16
|
+
path.push('props');
|
|
17
|
+
path.push('show');
|
|
18
|
+
path = path.join('.');
|
|
19
|
+
return {
|
|
20
|
+
path,
|
|
21
|
+
value: buttonConfig[key]?.show,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
findValues(ButtonPanelConfig, condition, '', results, formatResults);
|
|
26
|
+
return results;
|
|
27
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { NAME, StoreName, TUIStore } from '../../TUICallService';
|
|
3
|
+
import { DeviceType } from '../../TUICallService/const';
|
|
4
|
+
|
|
5
|
+
const useDeviceList = (deviceType: DeviceType) => {
|
|
6
|
+
const [deviceList, setDeviceList] = useState<any[]>([]);
|
|
7
|
+
const [currentDeviceId, setCurrentDeviceId] = useState<string>();
|
|
8
|
+
const handleDeviceListChange = (value: any) => {
|
|
9
|
+
switch (deviceType) {
|
|
10
|
+
case DeviceType.CAMERA:
|
|
11
|
+
setDeviceList(value?.cameraList || []);
|
|
12
|
+
setCurrentDeviceId(value?.currentCamera?.deviceId || '');
|
|
13
|
+
break;
|
|
14
|
+
|
|
15
|
+
case DeviceType.MICROPHONE:
|
|
16
|
+
setCurrentDeviceId(value?.currentMicrophone?.deviceId || '');
|
|
17
|
+
setDeviceList(value?.microphoneList || []);
|
|
18
|
+
break;
|
|
19
|
+
|
|
20
|
+
case DeviceType.SPEAKER:
|
|
21
|
+
setCurrentDeviceId(value?.currentSpeaker?.deviceId || '');
|
|
22
|
+
setDeviceList(value?.speakerList || []);
|
|
23
|
+
break;
|
|
24
|
+
|
|
25
|
+
default:
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const watchOptions = {
|
|
31
|
+
[NAME.DEVICE_LIST]: handleDeviceListChange,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
TUIStore.watch(
|
|
36
|
+
StoreName.CALL,
|
|
37
|
+
watchOptions,
|
|
38
|
+
{
|
|
39
|
+
notifyRangeWhenWatch: NAME.MYSELF,
|
|
40
|
+
},
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
return () => {
|
|
44
|
+
TUIStore.unwatch(
|
|
45
|
+
StoreName.CALL,
|
|
46
|
+
watchOptions,
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
}, []);
|
|
50
|
+
return [{ deviceList, currentDeviceId }, { setCurrentDeviceId }] as const;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export default useDeviceList;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { isEqual } from 'lodash-es';
|
|
3
|
+
import { NAME, StoreName, TUIStore } from '../../TUICallService';
|
|
4
|
+
|
|
5
|
+
const MIN_VOLUMN_THRESHOLD = 10;
|
|
6
|
+
|
|
7
|
+
export default function useGetSpeakers() {
|
|
8
|
+
const [
|
|
9
|
+
localUserInfoIncludeVolumn,
|
|
10
|
+
setLocalUserInfoIncludeVolumn,
|
|
11
|
+
] = useState(TUIStore.getData(StoreName.CALL, NAME.LOCAL_USER_INFO));
|
|
12
|
+
const [
|
|
13
|
+
remoteListIncludeVolumn,
|
|
14
|
+
setRemoteListIncludeVolumn,
|
|
15
|
+
] = useState(TUIStore.getData(StoreName.CALL, NAME.REMOTE_USER_INFO_LIST));
|
|
16
|
+
const [speakerList, updateSpeakerList] = useState([]);
|
|
17
|
+
const handleLocalUserInfoIncludeVolumnChange = (value) => {
|
|
18
|
+
if (localUserInfoIncludeVolumn.volume !== value.volume) {
|
|
19
|
+
setLocalUserInfoIncludeVolumn(value);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const handleRemoteUserInfoIncludeVolumnListChange = (value) => {
|
|
23
|
+
if (value.length !== remoteListIncludeVolumn.length) {
|
|
24
|
+
setRemoteListIncludeVolumn(value);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (!isEqual(value, remoteListIncludeVolumn)) {
|
|
29
|
+
setRemoteListIncludeVolumn(value);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const watchOptions = {
|
|
34
|
+
[NAME.LOCAL_USER_INFO]: handleLocalUserInfoIncludeVolumnChange,
|
|
35
|
+
[NAME.REMOTE_USER_INFO_LIST]: handleRemoteUserInfoIncludeVolumnListChange,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
TUIStore.watch(
|
|
40
|
+
StoreName.CALL,
|
|
41
|
+
watchOptions,
|
|
42
|
+
{
|
|
43
|
+
notifyRangeWhenWatch: NAME.MYSELF,
|
|
44
|
+
},
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
return () => {
|
|
48
|
+
TUIStore.unwatch(
|
|
49
|
+
StoreName.CALL,
|
|
50
|
+
watchOptions,
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
}, []);
|
|
54
|
+
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
const rs = [];
|
|
57
|
+
[localUserInfoIncludeVolumn, ...remoteListIncludeVolumn].forEach(item => {
|
|
58
|
+
if (item.isAudioAvailable && item.volume >= MIN_VOLUMN_THRESHOLD) {
|
|
59
|
+
rs.push(item.domId);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
if (rs.length === 0 && speakerList.length === 0) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
updateSpeakerList(rs);
|
|
66
|
+
}, [localUserInfoIncludeVolumn, remoteListIncludeVolumn]);
|
|
67
|
+
|
|
68
|
+
return speakerList;
|
|
69
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { isEqual } from 'lodash-es';
|
|
3
|
+
import { NAME, StoreName, TUIStore } from '../../TUICallService';
|
|
4
|
+
|
|
5
|
+
export default function useGetVolumeMap() {
|
|
6
|
+
const [
|
|
7
|
+
localUserInfoIncludeVolumn,
|
|
8
|
+
setLocalUserInfoIncludeVolumn,
|
|
9
|
+
] = useState(TUIStore.getData(StoreName.CALL, NAME.LOCAL_USER_INFO));
|
|
10
|
+
const [
|
|
11
|
+
remoteListIncludeVolumn,
|
|
12
|
+
setRemoteListIncludeVolumn,
|
|
13
|
+
] = useState(TUIStore.getData(StoreName.CALL, NAME.REMOTE_USER_INFO_LIST));
|
|
14
|
+
const [volumnMap, updateVolumnMap] = useState<{ [key: string]: number }>({});
|
|
15
|
+
const handleLocalUserInfoIncludeVolumnChange = (value) => {
|
|
16
|
+
if (localUserInfoIncludeVolumn.volume !== value.volume) {
|
|
17
|
+
setLocalUserInfoIncludeVolumn(value);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const handleRemoteUserInfoIncludeVolumnListChange = (value) => {
|
|
21
|
+
if (value.length !== remoteListIncludeVolumn.length) {
|
|
22
|
+
setRemoteListIncludeVolumn(value);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (!isEqual(value, remoteListIncludeVolumn)) {
|
|
27
|
+
setRemoteListIncludeVolumn(value);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const watchOptions = {
|
|
32
|
+
[NAME.LOCAL_USER_INFO]: handleLocalUserInfoIncludeVolumnChange,
|
|
33
|
+
[NAME.REMOTE_USER_INFO_LIST]: handleRemoteUserInfoIncludeVolumnListChange,
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
TUIStore.watch(
|
|
38
|
+
StoreName.CALL,
|
|
39
|
+
watchOptions,
|
|
40
|
+
{
|
|
41
|
+
notifyRangeWhenWatch: NAME.MYSELF,
|
|
42
|
+
},
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
return () => {
|
|
46
|
+
TUIStore.unwatch(
|
|
47
|
+
StoreName.CALL,
|
|
48
|
+
watchOptions,
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
}, [watchOptions]);
|
|
52
|
+
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
const rs: { [key: string]: number } = {};
|
|
55
|
+
[localUserInfoIncludeVolumn, ...remoteListIncludeVolumn].forEach(item => {
|
|
56
|
+
if (item.isAudioAvailable) {
|
|
57
|
+
rs[item.domId] = item.volume;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
if (Object.keys(rs).length === 0) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
updateVolumnMap(rs);
|
|
64
|
+
}, [localUserInfoIncludeVolumn, remoteListIncludeVolumn]);
|
|
65
|
+
|
|
66
|
+
return volumnMap;
|
|
67
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { NAME, StoreName, TUIStore } from '../../TUICallService';
|
|
3
|
+
|
|
4
|
+
export default function useNetWorkStatus() {
|
|
5
|
+
const [
|
|
6
|
+
netWorkQualityList,
|
|
7
|
+
setNetWorkQualityList,
|
|
8
|
+
] = useState(TUIStore.getData(StoreName.CALL, NAME.NETWORK_STATUS));
|
|
9
|
+
const handleNetWorkStatusChange = (value) => {
|
|
10
|
+
setNetWorkQualityList(value);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const watchOptions = {
|
|
14
|
+
[NAME.NETWORK_STATUS]: handleNetWorkStatusChange,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
TUIStore.watch(
|
|
19
|
+
StoreName.CALL,
|
|
20
|
+
watchOptions,
|
|
21
|
+
{
|
|
22
|
+
notifyRangeWhenWatch: NAME.MYSELF,
|
|
23
|
+
},
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
return () => {
|
|
27
|
+
TUIStore.unwatch(
|
|
28
|
+
StoreName.CALL,
|
|
29
|
+
watchOptions,
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
}, []);
|
|
33
|
+
return netWorkQualityList;
|
|
34
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@mixin button-size($height, $font-size, $icon-size, $padding-horizontal) {
|
|
2
|
+
height: $height;
|
|
3
|
+
width: $icon-size;
|
|
4
|
+
font-size: $font-size;
|
|
5
|
+
padding-left: $padding-horizontal;
|
|
6
|
+
padding-right: $padding-horizontal;
|
|
7
|
+
|
|
8
|
+
.#{$prefix}-icon {
|
|
9
|
+
width: $icon-size;
|
|
10
|
+
height: $icon-size;
|
|
11
|
+
|
|
12
|
+
.img {
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 100%;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.#{$prefix}-loading {
|
|
19
|
+
// font-size: $btn-loading-size;
|
|
20
|
+
font-size: $icon-size;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// common prefix
|
|
2
|
+
$prefix: 'tk';
|
|
3
|
+
|
|
4
|
+
// Font 12 14 16 40
|
|
5
|
+
$font-size: 10px;
|
|
6
|
+
$font-size-s: 10px;
|
|
7
|
+
$font-size-base: 12px;
|
|
8
|
+
$font-size-m: 14px;
|
|
9
|
+
$font-size-l: 16px;
|
|
10
|
+
$font-size-xl: 18px;
|
|
11
|
+
$font-size-xxl: 40px;
|
|
12
|
+
|
|
13
|
+
// rounded corners
|
|
14
|
+
$radius-small: 3px;
|
|
15
|
+
$radius-default: 6px;
|
|
16
|
+
$radius-large: 9px;
|
|
17
|
+
$radius-extra-large: 12px;
|
|
18
|
+
$radius-round: 999px;
|
|
19
|
+
$radius-circle: 50%;
|
|
20
|
+
|
|
21
|
+
$grid-columns: 12;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
$dark-colors: (
|
|
2
|
+
// bg
|
|
3
|
+
--uikit-theme-dark-bg-color-topbar: #16171a,
|
|
4
|
+
--uikit-theme-dark-bg-color-operate: #1f2024,
|
|
5
|
+
--uikit-theme-dark-bg-color-input: #2b2c30,
|
|
6
|
+
--uikit-theme-dark-bg-color-bubble-reciprocal: #2b2c30,
|
|
7
|
+
--uikit-theme-dark-bg-color-bubble-own: #5c9dff,
|
|
8
|
+
--uikit-theme-dark-bg-color-default: #16171a,
|
|
9
|
+
--uikit-theme-dark-bg-color-tag-mask: rgba(0, 0, 0, 55%),
|
|
10
|
+
--uikit-theme-dark-bg-color-mask: rgba(0, 0, 0, 55%),
|
|
11
|
+
// text
|
|
12
|
+
--uikit-theme-dark-text-color-primary: rgba(255, 255, 255, 93%),
|
|
13
|
+
--uikit-theme-dark-text-color-secondary: rgba(255, 255, 255, 66%),
|
|
14
|
+
--uikit-theme-dark-text-color-tertiary: rgba(255, 255, 255, 40%),
|
|
15
|
+
--uikit-theme-dark-text-color-disable: rgba(255, 255, 255, 28%),
|
|
16
|
+
--uikit-theme-dark-text-color-link: #4086ff,
|
|
17
|
+
--uikit-theme-dark-text-color-link-hover: #2b6ad6,
|
|
18
|
+
--uikit-theme-dark-text-color-link-disabled: #243047,
|
|
19
|
+
--uikit-theme-dark-text-color-anti-primary: rgba(0, 0, 0, 90%),
|
|
20
|
+
--uikit-theme-dark-text-color-anti-secondary: rgba(0, 0, 0, 55%),
|
|
21
|
+
--uikit-theme-dark-text-color-warning: #e37f32,
|
|
22
|
+
--uikit-theme-dark-text-color-success: #38a673,
|
|
23
|
+
--uikit-theme-dark-text-color-error: #e6594c,
|
|
24
|
+
// dropdown
|
|
25
|
+
--uikit-theme-dark-dropdown-color-default: #2b2c30,
|
|
26
|
+
--uikit-theme-dark-dropdown-color-hover: #3a3c42,
|
|
27
|
+
--uikit-theme-dark-dropdown-color-active: #1f2024,
|
|
28
|
+
// list
|
|
29
|
+
--uikit-theme-dark-list-color-default: #1f2024,
|
|
30
|
+
--uikit-theme-dark-list-color-hover: #2b2c30,
|
|
31
|
+
--uikit-theme-dark-list-color-active: #243047,
|
|
32
|
+
// border
|
|
33
|
+
--uikit-theme-dark-stroke-color-primary: #3a3c42,
|
|
34
|
+
--uikit-theme-dark-stroke-color-secondary: #2b2c30,
|
|
35
|
+
// box-shadow
|
|
36
|
+
--uikit-theme-dark-shadow-color: rgba(0, 0, 0, 6%),
|
|
37
|
+
// floatWindow
|
|
38
|
+
--uikit-theme-dark-floating-color-default: #2B2C30,
|
|
39
|
+
--uikit-theme-dark-floating-color-operate: #3A3C42,
|
|
40
|
+
// toast
|
|
41
|
+
--uikit-theme-dark-toast-color-default: #243047,
|
|
42
|
+
--uikit-theme-dark-toast-color-success: #22352C,
|
|
43
|
+
--uikit-theme-dark-toast-color-warning: #35231A,
|
|
44
|
+
--uikit-theme-dark-toast-color-error: #422324,
|
|
45
|
+
// btn
|
|
46
|
+
--uikit-theme-dark-button-color-hangup: #E6594C,
|
|
47
|
+
--uikit-theme-dark-button-color-accept: #38A673,
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
:root {
|
|
51
|
+
@each $name, $color in $dark-colors {
|
|
52
|
+
#{$name}: $color;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
color-scheme: light dark;
|
|
56
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
$light-colors: (
|
|
2
|
+
// bg
|
|
3
|
+
--uikit-theme-light-bg-color-topbar: #f9fafc,
|
|
4
|
+
--uikit-theme-light-bg-color-operate: #fff,
|
|
5
|
+
--uikit-theme-light-bg-color-input: #f0f2f7,
|
|
6
|
+
--uikit-theme-light-bg-color-bubble-reciprocal: #f0f2f7,
|
|
7
|
+
--uikit-theme-light-bg-color-bubble-own: #cce2ff,
|
|
8
|
+
--uikit-theme-light-bg-color-default: #f0f2f7,
|
|
9
|
+
--uikit-theme-light-bg-color-tag-mask: rgba(255, 255, 255, 55%),
|
|
10
|
+
--uikit-theme-light-bg-color-mask: rgba(0, 0, 0, 55%),
|
|
11
|
+
// text
|
|
12
|
+
--uikit-theme-light-text-color-primary: rgba(0, 0, 0, 93%),
|
|
13
|
+
--uikit-theme-light-text-color-secondary: rgba(0, 0, 0, 66%),
|
|
14
|
+
--uikit-theme-light-text-color-tertiary: rgba(0, 0, 0, 40%),
|
|
15
|
+
--uikit-theme-light-text-color-disable: rgba(0, 0, 0, 28%),
|
|
16
|
+
--uikit-theme-light-text-color-link: #1c66e5,
|
|
17
|
+
--uikit-theme-light-text-color-link-hover: #4588f5,
|
|
18
|
+
--uikit-theme-light-text-color-link-disabled: #cce2ff,
|
|
19
|
+
--uikit-theme-light-text-color-anti-primary: rgba(0, 0, 0, 90%),
|
|
20
|
+
--uikit-theme-light-text-color-anti-secondary: rgba(0, 0, 0, 55%),
|
|
21
|
+
--uikit-theme-light-text-color-warning: #ff7200,
|
|
22
|
+
--uikit-theme-light-text-color-success: #0abf77,
|
|
23
|
+
--uikit-theme-light-text-color-error: #e54545,
|
|
24
|
+
// dropdown
|
|
25
|
+
--uikit-theme-light-dropdown-color-default: #fff,
|
|
26
|
+
--uikit-theme-light-dropdown-color-hover: #f9fafc,
|
|
27
|
+
--uikit-theme-light-dropdown-color-active: #ebf3ff,
|
|
28
|
+
// list
|
|
29
|
+
--uikit-theme-light-list-color-default: #fff,
|
|
30
|
+
--uikit-theme-light-list-color-hover: #f9fafc,
|
|
31
|
+
--uikit-theme-light-list-color-active: #ebf3ff,
|
|
32
|
+
// border
|
|
33
|
+
--uikit-theme-light-stroke-color-primary: #f9fafc,
|
|
34
|
+
--uikit-theme-light-stroke-color-secondary: rgba(0, 0, 0, 55%),
|
|
35
|
+
// box-shadow
|
|
36
|
+
--uikit-theme-light-shadow-color: rgba(0, 0, 0, 6%),
|
|
37
|
+
// floatWindow
|
|
38
|
+
--uikit-theme-light-floating-color-default: #ffffff,
|
|
39
|
+
--uikit-theme-light-floating-color-operate: #F0F2F7,
|
|
40
|
+
// toast
|
|
41
|
+
--uikit-theme-light-toast-color-default: #EBF3FF,
|
|
42
|
+
--uikit-theme-light-toast-color-success: #DCFAE9,
|
|
43
|
+
--uikit-theme-light-toast-color-warning: #FFEEDB,
|
|
44
|
+
--uikit-theme-light-toast-color-error: #FFE7E5,
|
|
45
|
+
// btn
|
|
46
|
+
--uikit-theme-light-button-color-hangup: #E54545,
|
|
47
|
+
--uikit-theme-light-button-color-accept: #0ABF77,
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
:root {
|
|
51
|
+
@each $name, $color in $light-colors {
|
|
52
|
+
#{$name}: $color;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
color-scheme: light dark;
|
|
56
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "sass:list";
|
|
3
|
+
|
|
4
|
+
$prefix: "--uikit-theme";
|
|
5
|
+
|
|
6
|
+
$themes: (
|
|
7
|
+
"light",
|
|
8
|
+
"dark",
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
$colors: (
|
|
12
|
+
"bg-color-topbar",
|
|
13
|
+
"bg-color-operate",
|
|
14
|
+
"bg-color-input",
|
|
15
|
+
"bg-color-bubble-reciprocal",
|
|
16
|
+
"bg-color-bubble-own",
|
|
17
|
+
"bg-color-default",
|
|
18
|
+
"bg-color-tag-mask",
|
|
19
|
+
"bg-color-mask",
|
|
20
|
+
"text-color-primary",
|
|
21
|
+
"text-color-secondary",
|
|
22
|
+
"text-color-tertiary",
|
|
23
|
+
"text-color-disable",
|
|
24
|
+
"text-color-link",
|
|
25
|
+
"text-color-link-hover",
|
|
26
|
+
"text-color-link-disabled",
|
|
27
|
+
"text-color-anti-primary",
|
|
28
|
+
"text-color-anti-secondary",
|
|
29
|
+
"text-color-warning",
|
|
30
|
+
"text-color-success",
|
|
31
|
+
"text-color-error",
|
|
32
|
+
"dropdown-color-default",
|
|
33
|
+
"dropdown-color-hover",
|
|
34
|
+
"dropdown-color-active",
|
|
35
|
+
"list-color-default",
|
|
36
|
+
"list-color-hover",
|
|
37
|
+
"list-color-active",
|
|
38
|
+
"stroke-color-primary",
|
|
39
|
+
"stroke-color-secondary",
|
|
40
|
+
"shadow-color",
|
|
41
|
+
"floating-color-default",
|
|
42
|
+
"floating-color-operate",
|
|
43
|
+
"toast-color-default",
|
|
44
|
+
"toast-color-success",
|
|
45
|
+
"toast-color-warning",
|
|
46
|
+
"toast-color-error",
|
|
47
|
+
"button-color-hangup",
|
|
48
|
+
"button-color-accept",
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
$color-map: ();
|
|
52
|
+
|
|
53
|
+
@mixin theme() {
|
|
54
|
+
@each $theme in $themes {
|
|
55
|
+
|
|
56
|
+
$color-map: () !global;
|
|
57
|
+
|
|
58
|
+
[data-uikit-theme="#{$theme}"] & {
|
|
59
|
+
@each $color in $colors {
|
|
60
|
+
$value: --uikit-theme-#{$theme}-#{$color};
|
|
61
|
+
$color-map: map.merge($color-map, ($color: var($value))) !global;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@content;
|
|
65
|
+
|
|
66
|
+
transition:
|
|
67
|
+
background-color 0.3s ease-out,
|
|
68
|
+
border-color 0.3s ease-out;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@function get($color) {
|
|
74
|
+
@if map.get($color-map, $color) {
|
|
75
|
+
@return map.get($color-map, $color);
|
|
76
|
+
} @else {
|
|
77
|
+
@return var(--uikit-basic-color-#{$color});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
$prefix: "uikit";
|
|
2
|
+
|
|
3
|
+
$basic-colors: (
|
|
4
|
+
white-1: #FFFFFF,
|
|
5
|
+
white-2:rgba(255, 255, 255, 0.9),
|
|
6
|
+
white-4: rgba(255, 255, 255, 0.55),
|
|
7
|
+
white-6: rgba(255, 255, 255, 0.3),
|
|
8
|
+
white-7: rgba(255, 255, 255, 0.14),
|
|
9
|
+
black-1: rgba(0, 0, 0, 1),
|
|
10
|
+
black-2: rgba(0, 0, 0, 0.9),
|
|
11
|
+
black-3: rgba(0, 0, 0, 0.72),
|
|
12
|
+
black-4: rgba(0, 0, 0, 0.55),
|
|
13
|
+
black-5: rgba(0, 0, 0, 0.4),
|
|
14
|
+
black-8: rgba(0, 0, 0, 0.06),
|
|
15
|
+
gray-dark-3: rgba(43, 44, 48, 1),
|
|
16
|
+
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
:root {
|
|
20
|
+
@each $name, $color in $basic-colors {
|
|
21
|
+
--#{$prefix}-basic-color-#{$name}: #{$color};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
2
|
+
export function classNames(...rest) {
|
|
3
|
+
const classes = [];
|
|
4
|
+
const hasOwn = {}.hasOwnProperty;
|
|
5
|
+
for (let i = 0; i < rest.length; i++) {
|
|
6
|
+
const arg = rest[i];
|
|
7
|
+
if (!arg) continue;
|
|
8
|
+
|
|
9
|
+
const argType = typeof arg;
|
|
10
|
+
|
|
11
|
+
if (argType === 'string' || argType === 'number') {
|
|
12
|
+
classes.push(arg);
|
|
13
|
+
} else if (Array.isArray(arg)) {
|
|
14
|
+
if (arg.length) {
|
|
15
|
+
const inner = classNames.apply(null, arg);
|
|
16
|
+
if (inner) {
|
|
17
|
+
classes.push(inner);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
} else if (argType === 'object') {
|
|
21
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
22
|
+
classes.push(arg.toString());
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
for (const key in arg) {
|
|
27
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
28
|
+
classes.push(key);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return classes.join(' ');
|
|
35
|
+
}
|