agora-appbuilder-core 4.0.0-api.5 → 4.0.0-api.6
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/package.json +2 -2
- package/template/.bundle/config +2 -0
- package/template/Gemfile +4 -0
- package/template/Gulpfile.js +29 -29
- package/template/_eslintrc.js +3 -3
- package/template/_gitignore +12 -11
- package/template/_package-lock.json +26471 -22749
- package/template/_prettierrc.js +2 -2
- package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +30 -10
- package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +19 -0
- package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +1 -0
- package/template/agora-rn-uikit/src/Controls/Icons.ts +45 -0
- package/template/agora-rn-uikit/src/Controls/Local/EndCall.tsx +6 -4
- package/template/agora-rn-uikit/src/Controls/Local/FullScreen.tsx +3 -1
- package/template/agora-rn-uikit/src/Controls/Local/LocalAudioMute.tsx +1 -0
- package/template/agora-rn-uikit/src/Controls/Local/LocalVideoMute.tsx +1 -0
- package/template/agora-rn-uikit/src/Controls/Local/SwitchCamera.tsx +1 -0
- package/template/agora-rn-uikit/src/Controls/Remote/RemoteAudioMute.tsx +1 -0
- package/template/agora-rn-uikit/src/Controls/Remote/RemoteSwap.tsx +3 -1
- package/template/agora-rn-uikit/src/Controls/Remote/RemoteVideoMute.tsx +1 -0
- package/template/agora-rn-uikit/src/Reducer/ActiveSpeaker.ts +30 -0
- package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +3 -1
- package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +3 -1
- package/template/agora-rn-uikit/src/Reducer/LocalPermissionState.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +3 -3
- package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +5 -4
- package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +8 -5
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/UserPin.ts +18 -1
- package/template/agora-rn-uikit/src/Reducer/UserSecondaryPin.ts +23 -0
- package/template/agora-rn-uikit/src/Reducer/index.ts +2 -0
- package/template/agora-rn-uikit/src/Rtc/Create.tsx +47 -21
- package/template/agora-rn-uikit/src/Rtc/Join.tsx +37 -15
- package/template/agora-rn-uikit/src/RtcConfigure.tsx +122 -12
- package/template/agora-rn-uikit/src/Views/MaxVideoView.native.tsx +32 -4
- package/template/agora-rn-uikit/src/Views/MaxVideoView.tsx +21 -2
- package/template/agora-rn-uikit/src/Views/MinVideoView.tsx +2 -0
- package/template/android/app/build.gradle +59 -156
- package/template/android/app/src/debug/AndroidManifest.xml +6 -1
- package/template/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java +7 -4
- package/template/android/app/src/main/AndroidManifest.xml +6 -19
- package/template/android/app/src/main/assets/fonts/icomoon.ttf +0 -0
- package/template/android/app/src/main/java/com/helloworld/MainActivity.java +17 -0
- package/template/android/app/src/main/java/com/helloworld/MainApplication.java +19 -36
- package/template/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java +20 -0
- package/template/android/build.gradle +19 -33
- package/template/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/template/android/gradle/wrapper/gradle-wrapper.properties +3 -2
- package/template/android/gradle.properties +18 -4
- package/template/android/gradlew +165 -104
- package/template/android/gradlew.bat +12 -23
- package/template/android/settings.gradle +1 -0
- package/template/bridge/rtc/webNg/RtcEngine.ts +131 -16
- package/template/bridge/rtc/webNg/index.ts +72 -1
- package/template/bridge/rtm/web/index.ts +5 -3
- package/template/configTransform.js +16 -1
- package/template/customization-api/action-library.ts +0 -8
- package/template/customization-api/app-state.ts +11 -2
- package/template/customization-api/customEvents.ts +6 -1
- package/template/customization-api/index.ts +4 -0
- package/template/customization-api/sub-components.ts +6 -3
- package/template/customization-api/temp.ts +50 -0
- package/template/customization-api/typeDefinition.ts +26 -14
- package/template/customization-api/types.ts +26 -0
- package/template/customization-api/utils.ts +2 -0
- package/template/customization-implementation/index.ts +0 -1
- package/template/defaultConfig.js +72 -0
- package/template/global.d.ts +13 -1
- package/template/index.js +0 -4
- package/template/index.web.js +0 -5
- package/template/index.wsdk.tsx +1 -19
- package/template/ios/.xcode.env +11 -0
- package/template/ios/HelloWorld/AppDelegate.h +2 -4
- package/template/ios/HelloWorld/AppDelegate.mm +42 -0
- package/template/ios/HelloWorld/Info.plist +1 -1
- package/template/ios/HelloWorld/main.m +2 -1
- package/template/ios/HelloWorld.xcodeproj/project.pbxproj +529 -17
- package/template/ios/HelloWorld.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/template/ios/HelloWorld.xcworkspace/contents.xcworkspacedata +10 -0
- package/template/ios/HelloWorld.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/template/ios/HelloWorldTests/HelloWorldTests.m +14 -13
- package/template/ios/HelloWorldTests/Info.plist +2 -2
- package/template/ios/Podfile +53 -20
- package/template/ios/Podfile.lock +873 -0
- package/template/ios/ScreenSharing/Info.plist +15 -0
- package/template/ios/ScreenSharing/SampleHandler.h +9 -0
- package/template/ios/ScreenSharing/SampleHandler.m +70 -0
- package/template/jest.config.js +4 -0
- package/template/metro.config.js +7 -32
- package/template/package.json +52 -39
- package/template/react-native-toast-message/index.d.ts +3 -1
- package/template/react-native-toast-message/index.js +1 -0
- package/template/react-native-toast-message/src/components/base/index.js +20 -32
- package/template/react-native-toast-message/src/components/base/styles.js +18 -21
- package/template/react-native-toast-message/src/components/checkbox.js +24 -19
- package/template/react-native-toast-message/src/index.js +3 -1
- package/template/react-native-toast-message/src/index.sdk.tsx +4 -1
- package/template/src/App.tsx +13 -85
- package/template/src/AppRoutes.tsx +77 -0
- package/template/src/AppWrapper.tsx +38 -33
- package/template/src/SDKAppWrapper.tsx +79 -43
- package/template/src/app-state/useNoiseSupression.native.tsx +67 -0
- package/template/src/app-state/useNoiseSupression.tsx +107 -0
- package/template/src/app-state/useVideoQuality.tsx +39 -0
- package/template/src/assets/font-styles.css +171 -3
- package/template/src/assets/fonts/icomoon.ttf +0 -0
- package/template/src/assets/selection.json +1 -1
- package/template/src/atoms/ActionMenu.tsx +50 -11
- package/template/src/atoms/Avatar.tsx +51 -0
- package/template/src/atoms/Card.tsx +21 -8
- package/template/src/atoms/Carousel.native.tsx +105 -0
- package/template/src/atoms/Carousel.tsx +103 -0
- package/template/src/atoms/Checkbox.tsx +98 -0
- package/template/src/atoms/CircularProgress.tsx +0 -1
- package/template/src/atoms/ClipboardIconButton.tsx +91 -0
- package/template/src/atoms/CustomIcon.tsx +45 -0
- package/template/src/atoms/DropDownMulti.tsx +349 -0
- package/template/src/atoms/Dropdown.tsx +3 -3
- package/template/src/atoms/IconButton.tsx +52 -9
- package/template/src/atoms/ImageIcon.tsx +6 -3
- package/template/src/atoms/InlineNotification.tsx +81 -0
- package/template/src/atoms/MeetingLink.tsx +160 -0
- package/template/src/atoms/ParticipantsCount.tsx +18 -7
- package/template/src/atoms/Popup.tsx +49 -27
- package/template/src/atoms/PrimaryButton.tsx +19 -5
- package/template/src/atoms/RecordingInfo.tsx +2 -2
- package/template/src/atoms/SecondaryButton.tsx +2 -0
- package/template/src/atoms/Spacer.tsx +1 -0
- package/template/src/atoms/TertiaryButton.tsx +35 -5
- package/template/src/atoms/TextInput.tsx +2 -1
- package/template/src/atoms/Toolbar.tsx +64 -30
- package/template/src/atoms/ToolbarItem.tsx +11 -5
- package/template/src/atoms/ToolbarPreset.tsx +13 -2
- package/template/src/atoms/Tooltip.tsx +26 -4
- package/template/src/auth/AuthProvider.tsx +500 -0
- package/template/src/auth/AuthRoute.tsx +94 -0
- package/template/src/auth/IDPAuth.electron.tsx +31 -0
- package/template/src/auth/IDPAuth.tsx +67 -0
- package/template/src/auth/IDPLogoutComponent.tsx +158 -0
- package/template/src/auth/UserCancelPopup.tsx +115 -0
- package/template/src/auth/config.ts +52 -0
- package/template/src/auth/openIDPURL.electron.tsx +39 -0
- package/template/src/auth/openIDPURL.native.tsx +51 -0
- package/template/src/auth/openIDPURL.tsx +20 -0
- package/template/src/auth/useIDPAuth.electron.tsx +65 -0
- package/template/src/auth/useIDPAuth.native.tsx +70 -0
- package/template/src/auth/useIDPAuth.tsx +63 -0
- package/template/src/auth/useTokenAuth.tsx +194 -0
- package/template/src/components/Chat.tsx +5 -8
- package/template/src/components/ChatContext.ts +4 -0
- package/template/src/components/ColorConfigure.tsx +0 -1
- package/template/src/components/CommonStyles.ts +9 -2
- package/template/src/components/Controls.tsx +659 -52
- package/template/src/components/DeviceConfigure.tsx +362 -156
- package/template/src/components/DeviceContext.tsx +2 -0
- package/template/src/components/EventsConfigure.tsx +713 -109
- package/template/src/components/GraphQLProvider.tsx +62 -36
- package/template/src/components/GridVideo.tsx +23 -13
- package/template/src/components/HostControlView.tsx +11 -14
- package/template/src/components/JoinPhrase.tsx +0 -1
- package/template/src/components/Leftbar.tsx +4 -3
- package/template/src/components/Navbar.tsx +110 -42
- package/template/src/components/NavbarMobile.tsx +47 -36
- package/template/src/components/Navigation.native.tsx +1 -15
- package/template/src/{subComponents/screenshare/ScreenshareButton.native.tsx → components/Navigation.sdk.tsx} +17 -3
- package/template/src/components/Navigation.tsx +1 -15
- package/template/src/components/ParticipantsView.tsx +56 -48
- package/template/src/components/PinnedVideo.tsx +188 -114
- package/template/src/components/Precall.native.tsx +169 -67
- package/template/src/components/Precall.tsx +237 -71
- package/template/src/components/RTMConfigure.tsx +167 -55
- package/template/src/components/Rightbar.tsx +4 -3
- package/template/src/components/Router.electron.ts +1 -0
- package/template/src/components/Router.native.ts +1 -0
- package/template/src/components/Router.sdk.ts +1 -0
- package/template/src/components/Router.ts +1 -0
- package/template/src/components/SdkApiContext.tsx +179 -27
- package/template/src/components/SdkMuteToggleListener.tsx +88 -0
- package/template/src/components/SessionContext.tsx +0 -1
- package/template/src/components/Settings.tsx +25 -3
- package/template/src/components/SettingsView.tsx +44 -9
- package/template/src/components/Share.tsx +149 -71
- package/template/src/components/StorageContext.tsx +19 -5
- package/template/src/components/ToastComponent.tsx +3 -0
- package/template/src/components/WhiteboardLayout.tsx +291 -0
- package/template/src/components/chat-messages/useChatMessages.tsx +420 -207
- package/template/src/components/common/Error.tsx +2 -0
- package/template/src/components/common/Logo.tsx +2 -2
- package/template/src/components/contexts/LiveStreamDataContext.tsx +5 -4
- package/template/src/components/contexts/ScreenShareContext.tsx +15 -1
- package/template/src/components/contexts/WaitingRoomContext.tsx +50 -0
- package/template/src/components/contexts/WhiteboardContext.tsx +54 -54
- package/template/src/components/disable-chat/useDisableChat.tsx +32 -0
- package/template/src/components/livestream/LiveStreamContext.tsx +262 -177
- package/template/src/components/livestream/Types.ts +34 -18
- package/template/src/components/livestream/views/LiveStreamAttendeeLandingTile.tsx +295 -0
- package/template/src/components/livestream/views/LiveStreamControls.tsx +2 -4
- package/template/src/components/meeting-info-invite/MeetingInfo.tsx +82 -0
- package/template/src/components/meeting-info-invite/MeetingInfoCardHeader.tsx +86 -0
- package/template/src/components/meeting-info-invite/MeetingInfoGridTile.tsx +218 -0
- package/template/src/components/meeting-info-invite/MeetingInfoLinks.tsx +122 -0
- package/template/src/components/participants/AllAudienceParticipants.tsx +4 -5
- package/template/src/components/participants/AllHostParticipants.tsx +5 -6
- package/template/src/components/participants/Participant.tsx +40 -9
- package/template/src/components/participants/ParticipantSectionTitle.tsx +5 -2
- package/template/src/components/participants/ScreenshareParticipants.tsx +15 -17
- package/template/src/components/participants/UserActionMenuOptions.tsx +157 -49
- package/template/src/components/participants/WaitingRoomParticipants.tsx +74 -0
- package/template/src/components/popups/InvitePopup.tsx +110 -45
- package/template/src/components/popups/StartScreenSharePopup.native.tsx +182 -0
- package/template/src/components/popups/StartScreenSharePopup.tsx +6 -0
- package/template/src/components/popups/StopRecordingPopup.tsx +11 -5
- package/template/src/components/popups/StopScreenSharePopup.native.tsx +135 -0
- package/template/src/components/popups/StopScreenSharePopup.tsx +6 -0
- package/template/src/components/popups/WhiteboardClearAllPopup.tsx +123 -0
- package/template/src/components/precall/LocalMute.tsx +69 -45
- package/template/src/components/precall/PermissionHelper.tsx +52 -24
- package/template/src/components/precall/PreCallSettings.tsx +1 -0
- package/template/src/components/precall/VideoFallback.tsx +173 -0
- package/template/src/components/precall/VideoPreview.native.tsx +16 -50
- package/template/src/components/precall/VideoPreview.tsx +27 -162
- package/template/src/components/precall/index.tsx +2 -0
- package/template/src/components/precall/joinCallBtn.native.tsx +10 -3
- package/template/src/components/precall/joinCallBtn.tsx +11 -2
- package/template/src/components/precall/joinWaitingRoomBtn.native.tsx +210 -0
- package/template/src/components/precall/joinWaitingRoomBtn.tsx +250 -0
- package/template/src/components/precall/meetingTitle.tsx +35 -9
- package/template/src/components/precall/selectDevice.tsx +5 -5
- package/template/src/components/precall/textInput.tsx +16 -18
- package/template/src/components/precall/usePreCall.tsx +14 -4
- package/template/src/components/room-info/useRoomInfo.tsx +34 -0
- package/template/src/components/useShareLink.tsx +24 -59
- package/template/src/components/useUserPreference.tsx +73 -10
- package/template/src/components/useVideoCall.tsx +76 -3
- package/template/src/components/virtual-background/VBButton.tsx +64 -0
- package/template/src/components/virtual-background/VBCard.native.tsx +282 -0
- package/template/src/components/virtual-background/VBCard.tsx +272 -0
- package/template/src/components/virtual-background/VBPanel.tsx +279 -0
- package/template/src/components/virtual-background/VButils.native.ts +37 -0
- package/template/src/components/virtual-background/VButils.ts +104 -0
- package/template/src/components/virtual-background/VideoPreview.native.tsx +43 -0
- package/template/src/components/virtual-background/VideoPreview.tsx +106 -0
- package/template/src/components/virtual-background/imagePaths.ts +87 -0
- package/template/src/components/virtual-background/images/beachImageBase64.ts +1 -0
- package/template/src/components/virtual-background/images/bedroomImageBase64.ts +1 -0
- package/template/src/components/virtual-background/images/bookImageBase64.ts +1 -0
- package/template/src/components/virtual-background/images/earthImageBase64.ts +1 -0
- package/template/src/components/virtual-background/images/index.ts +37 -0
- package/template/src/components/virtual-background/images/lampImageBase64.ts +1 -0
- package/template/src/components/virtual-background/images/mountainsImageBase64.ts +1 -0
- package/template/src/components/virtual-background/images/office1ImageBase64.ts +1 -0
- package/template/src/components/virtual-background/images/officeImageBase64.ts +1 -0
- package/template/src/components/virtual-background/images/plantsImageBase64.ts +1 -0
- package/template/src/components/virtual-background/images/skyImageBase64.ts +1 -0
- package/template/src/components/virtual-background/images/wallImageBase64.ts +1 -0
- package/template/src/components/virtual-background/useVB.native.tsx +188 -0
- package/template/src/components/virtual-background/useVB.tsx +267 -0
- package/template/src/components/whiteboard/StrokeWidthTool.tsx +137 -0
- package/template/src/components/whiteboard/WhiteboardButton.tsx +93 -0
- package/template/src/components/whiteboard/WhiteboardCanvas.tsx +99 -0
- package/template/src/components/whiteboard/WhiteboardConfigure.native.tsx +137 -0
- package/template/src/components/whiteboard/WhiteboardConfigure.tsx +441 -0
- package/template/src/components/whiteboard/WhiteboardCursor.tsx +152 -0
- package/template/src/components/whiteboard/WhiteboardToolBox.tsx +1246 -0
- package/template/src/components/whiteboard/WhiteboardView.native.tsx +109 -0
- package/template/src/components/whiteboard/WhiteboardView.tsx +81 -0
- package/template/src/components/whiteboard/WhiteboardWidget.tsx +674 -0
- package/template/src/components/whiteboard/WhiteboardWrapper.tsx +38 -0
- package/template/src/language/default-labels/commonLabels.ts +51 -14
- package/template/src/language/default-labels/createScreenLabels.ts +97 -17
- package/template/src/language/default-labels/joinScreenLabels.ts +45 -6
- package/template/src/language/default-labels/precallScreenLabels.ts +145 -23
- package/template/src/language/default-labels/shareLinkScreenLabels.ts +85 -37
- package/template/src/language/default-labels/videoCallScreenLabels.ts +1137 -158
- package/template/src/pages/Create.tsx +125 -80
- package/template/src/pages/Join.tsx +76 -34
- package/template/src/pages/Login.tsx +26 -0
- package/template/src/pages/VideoCall.tsx +229 -114
- package/template/src/pages/video-call/ActionSheet.native.tsx +54 -7
- package/template/src/pages/video-call/ActionSheet.tsx +55 -16
- package/template/src/pages/video-call/ActionSheetContent.tsx +366 -291
- package/template/src/pages/video-call/ActionSheetHandle.tsx +7 -1
- package/template/src/pages/video-call/DefaultLayouts.ts +11 -5
- package/template/src/pages/video-call/NameWithMicIcon.tsx +17 -9
- package/template/src/pages/video-call/PinchableView.tsx +119 -0
- package/template/src/pages/video-call/RenderComponent.tsx +12 -3
- package/template/src/pages/video-call/SidePanelHeader.tsx +208 -6
- package/template/src/pages/video-call/VideoCallMobileView.tsx +140 -106
- package/template/src/pages/video-call/VideoCallScreen.native.tsx +3 -2
- package/template/src/pages/video-call/VideoCallScreen.tsx +113 -66
- package/template/src/pages/video-call/VideoComponent.tsx +53 -5
- package/template/src/pages/video-call/VideoRenderer.tsx +309 -52
- package/template/src/pages/video-call/VisibilitySensor.tsx +104 -0
- package/template/src/pages/video-call/ZoomableWrapper.native.tsx +34 -0
- package/template/src/pages/video-call/ZoomableWrapper.tsx +5 -0
- package/template/src/pages/video-call/index.ts +2 -0
- package/template/src/rtm/RTMEngine.ts +9 -4
- package/template/src/rtm-events/constants.ts +20 -0
- package/template/src/rtm-events-api/Events.ts +2 -0
- package/template/src/rtm-events-api/LocalEvents.ts +8 -0
- package/template/src/selection.json +1 -0
- package/template/src/subComponents/ChatBubble.tsx +81 -64
- package/template/src/subComponents/ChatContainer.tsx +20 -13
- package/template/src/subComponents/ChatInput.ios.tsx +11 -2
- package/template/src/subComponents/ChatInput.tsx +12 -3
- package/template/src/subComponents/Checkbox.native.tsx +46 -46
- package/template/src/subComponents/Checkbox.tsx +7 -6
- package/template/src/subComponents/CopyJoinInfo.tsx +26 -11
- package/template/src/subComponents/EndcallPopup.tsx +83 -12
- package/template/src/subComponents/LanguageSelector.tsx +34 -30
- package/template/src/subComponents/LayoutIconButton.tsx +30 -8
- package/template/src/subComponents/LayoutIconDropdown.tsx +19 -3
- package/template/src/subComponents/Loading.tsx +60 -0
- package/template/src/subComponents/LocalAudioMute.tsx +106 -30
- package/template/src/subComponents/LocalEndCall.tsx +91 -15
- package/template/src/subComponents/LocalSwitchCamera.tsx +50 -11
- package/template/src/subComponents/LocalVideoMute.tsx +126 -32
- package/template/src/subComponents/LogoutButton.tsx +1 -1
- package/template/src/subComponents/NetworkQualityPill.tsx +14 -31
- package/template/src/subComponents/Recording.tsx +23 -6
- package/template/src/subComponents/RemoteAudioMute.tsx +3 -3
- package/template/src/subComponents/RemoteMutePopup.tsx +55 -14
- package/template/src/subComponents/RemoteVideoMute.tsx +3 -3
- package/template/src/subComponents/RemoveMeetingPopup.tsx +19 -6
- package/template/src/subComponents/RemoveScreensharePopup.tsx +20 -5
- package/template/src/subComponents/ScreenShareNotice.tsx +11 -6
- package/template/src/subComponents/SelectDevice.tsx +98 -32
- package/template/src/subComponents/SidePanelEnum.tsx +2 -0
- package/template/src/subComponents/SidePanelHeader.tsx +97 -63
- package/template/src/subComponents/ToastConfig.tsx +70 -61
- package/template/src/subComponents/caption/Caption.tsx +130 -0
- package/template/src/subComponents/caption/CaptionContainer.tsx +302 -0
- package/template/src/subComponents/caption/CaptionIcon.tsx +111 -0
- package/template/src/subComponents/caption/CaptionText.tsx +182 -0
- package/template/src/subComponents/caption/DownloadTranscriptBtn.tsx +65 -0
- package/template/src/subComponents/caption/LanguageSelectorPopup.tsx +192 -0
- package/template/src/subComponents/caption/Transcript.tsx +449 -0
- package/template/src/subComponents/caption/TranscriptIcon.tsx +123 -0
- package/template/src/subComponents/caption/TranscriptText.tsx +98 -0
- package/template/src/subComponents/caption/index.ts +3 -0
- package/template/src/subComponents/caption/proto/ptoto.js +91 -0
- package/template/src/subComponents/caption/proto/test.proto +23 -0
- package/template/src/subComponents/caption/useCaption.tsx +123 -0
- package/template/src/subComponents/caption/useCaptionWidth.ts +27 -0
- package/template/src/subComponents/caption/useSTTAPI.tsx +179 -0
- package/template/src/subComponents/caption/useStreamMessageUtils.native.ts +211 -0
- package/template/src/subComponents/caption/useStreamMessageUtils.ts +235 -0
- package/template/src/subComponents/caption/useTranscriptDownload.native.ts +68 -0
- package/template/src/subComponents/caption/useTranscriptDownload.ts +52 -0
- package/template/src/subComponents/caption/utils.ts +125 -0
- package/template/src/subComponents/chat/ChatParticipants.tsx +53 -17
- package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +11 -13
- package/template/src/subComponents/livestream/controls/LocalRaiseHand.tsx +33 -9
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +1 -0
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +10 -6
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +28 -19
- package/template/src/subComponents/recording/useRecording.tsx +49 -20
- package/template/src/subComponents/recording/useRecordingLayoutQuery.tsx +0 -1
- package/template/src/subComponents/screenshare/ScreenshareButton.tsx +29 -10
- package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +270 -66
- package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +182 -95
- package/template/src/subComponents/screenshare/useScreenshare.tsx +2 -0
- package/template/src/subComponents/waiting-rooms/WaitingRoomControls.tsx +85 -0
- package/template/src/subComponents/waiting-rooms/useWaitingRoomAPI.ts +75 -0
- package/template/src/theme/index.ts +9 -0
- package/template/src/utils/SdkEvents.ts +14 -0
- package/template/src/utils/SdkMethodEvents.ts +23 -3
- package/template/src/utils/axiomLogger.ts +117 -0
- package/template/src/utils/book.jpg +0 -0
- package/template/src/utils/common.tsx +118 -6
- package/template/src/utils/endCallEveryOne.ts +7 -0
- package/template/src/utils/getCustomRoute.ts +7 -0
- package/template/src/utils/index.tsx +23 -0
- package/template/src/utils/useActionSheet.tsx +50 -0
- package/template/src/utils/useActiveSpeaker.ts +3 -7
- package/template/src/utils/useAppState.ts +17 -0
- package/template/src/utils/useAsyncEffect.ts +138 -0
- package/template/src/utils/useCreateRoom.ts +8 -12
- package/template/src/utils/useDisableButton.tsx +37 -0
- package/template/src/utils/useFindActiveSpeaker.native.ts +4 -0
- package/template/src/utils/useFindActiveSpeaker.ts +335 -0
- package/template/src/utils/useIsLocalUserSpeaking.native.ts +4 -0
- package/template/src/utils/useIsLocalUserSpeaking.ts +98 -0
- package/template/src/utils/useJoinRoom.ts +97 -36
- package/template/src/utils/useMuteToggleLocal.ts +114 -96
- package/template/src/utils/useString.ts +13 -3
- package/template/static.d.ts +42 -0
- package/template/tsconfig_rsdk_index.json +3 -3
- package/template/tsconfig_wsdk_index.json +1 -1
- package/template/web/index.html +20 -0
- package/template/webpack.commons.js +21 -10
- package/template/webpack.web.config.js +7 -3
- package/template/_buckconfig +0 -6
- package/template/_gitattributes +0 -1
- package/template/android/app/_BUCK +0 -55
- package/template/android/app/build_defs.bzl +0 -19
- package/template/ios/HelloWorld/AppDelegate.m +0 -74
- package/template/src/components/OAuth.electron.tsx +0 -41
- package/template/src/components/OAuth.native.tsx +0 -55
- package/template/src/components/OAuth.tsx +0 -30
- package/template/src/components/OAuthConfig.ts +0 -77
- package/template/src/components/Settings.native.tsx +0 -21
- package/template/src/components/StoreToken.tsx +0 -39
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
import {
|
|
2
|
+
StyleSheet,
|
|
3
|
+
View,
|
|
4
|
+
TextInput,
|
|
5
|
+
TouchableOpacity,
|
|
6
|
+
Text,
|
|
7
|
+
Platform,
|
|
8
|
+
NativeSyntheticEvent,
|
|
9
|
+
NativeScrollEvent,
|
|
10
|
+
VirtualizedList,
|
|
11
|
+
} from 'react-native';
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import CommonStyles from '../../components/CommonStyles';
|
|
14
|
+
import {getGridLayoutName} from '../../pages/video-call/DefaultLayouts';
|
|
15
|
+
import {useLayout} from '../../utils/useLayout';
|
|
16
|
+
import {
|
|
17
|
+
calculatePosition,
|
|
18
|
+
debounceFn,
|
|
19
|
+
isMobileUA,
|
|
20
|
+
isWebInternal,
|
|
21
|
+
useIsSmall,
|
|
22
|
+
} from '../../utils/common';
|
|
23
|
+
import {TranscriptHeader} from '../../pages/video-call/SidePanelHeader';
|
|
24
|
+
import {useRtc, useContent} from 'customization-api';
|
|
25
|
+
import {useCaption} from './useCaption';
|
|
26
|
+
import {TranscriptText} from './TranscriptText';
|
|
27
|
+
import PrimaryButton from '../../atoms/PrimaryButton';
|
|
28
|
+
import ThemeConfig from '../../theme';
|
|
29
|
+
import Loading from '../Loading';
|
|
30
|
+
import ImageIcon from '../../atoms/ImageIcon';
|
|
31
|
+
import hexadecimalTransparency from '../../../src/utils/hexadecimalTransparency';
|
|
32
|
+
import Spacer from '../../atoms/Spacer';
|
|
33
|
+
import useStreamMessageUtils from './useStreamMessageUtils';
|
|
34
|
+
import {StreamMessageCallback} from 'react-native-agora/lib/typescript/common/RtcEvents';
|
|
35
|
+
import useCaptionWidth from './useCaptionWidth';
|
|
36
|
+
import DownloadTranscriptBtn from './DownloadTranscriptBtn';
|
|
37
|
+
import {useString} from '../../../src/utils/useString';
|
|
38
|
+
import {
|
|
39
|
+
sttSettingSpokenLanguageText,
|
|
40
|
+
sttTranscriptPanelNoSearchResultsFoundText,
|
|
41
|
+
sttTranscriptPanelSearchText,
|
|
42
|
+
sttTranscriptPanelViewLatestText,
|
|
43
|
+
} from '../../../src/language/default-labels/videoCallScreenLabels';
|
|
44
|
+
|
|
45
|
+
interface TranscriptProps {
|
|
46
|
+
showHeader?: boolean;
|
|
47
|
+
}
|
|
48
|
+
const Transcript = (props: TranscriptProps) => {
|
|
49
|
+
const settingSpokenLanguageLabel = useString(sttSettingSpokenLanguageText)();
|
|
50
|
+
const searchText = useString(sttTranscriptPanelSearchText)();
|
|
51
|
+
const noresults = useString(sttTranscriptPanelNoSearchResultsFoundText)();
|
|
52
|
+
const viewlatest = useString(sttTranscriptPanelViewLatestText)();
|
|
53
|
+
|
|
54
|
+
const isSmall = useIsSmall();
|
|
55
|
+
const {currentLayout} = useLayout();
|
|
56
|
+
const {showHeader = true} = props;
|
|
57
|
+
const {
|
|
58
|
+
meetingTranscript,
|
|
59
|
+
isLangChangeInProgress,
|
|
60
|
+
isSTTListenerAdded,
|
|
61
|
+
setIsSTTListenerAdded,
|
|
62
|
+
} = useCaption();
|
|
63
|
+
|
|
64
|
+
const data = meetingTranscript; // Object.entries(transcript);
|
|
65
|
+
|
|
66
|
+
const [showButton, setShowButton] = React.useState(false);
|
|
67
|
+
|
|
68
|
+
const contentHeightRef = React.useRef(0);
|
|
69
|
+
const flatListRef = React.useRef(null);
|
|
70
|
+
const [searchQuery, setSearchQuery] = React.useState('');
|
|
71
|
+
const [searchResults, setSearchResults] = React.useState([]);
|
|
72
|
+
const {RtcEngineUnsafe} = useRtc();
|
|
73
|
+
const {defaultContent} = useContent();
|
|
74
|
+
const {streamMessageCallback} = useStreamMessageUtils();
|
|
75
|
+
|
|
76
|
+
const [isFocused, setIsFocused] = React.useState(false);
|
|
77
|
+
|
|
78
|
+
const {transcriptHeight} = useCaptionWidth();
|
|
79
|
+
const isScrolledToEnd = React.useRef(false);
|
|
80
|
+
|
|
81
|
+
const handleFocus = () => {
|
|
82
|
+
setIsFocused(true);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const handleBlur = () => {
|
|
86
|
+
setIsFocused(false);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const handleLayout = () => {
|
|
90
|
+
if (flatListRef.current && !isWebInternal()) {
|
|
91
|
+
flatListRef.current.scrollToOffset({
|
|
92
|
+
offset: contentHeightRef.current,
|
|
93
|
+
animated: false,
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
isScrolledToEnd.current = true;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const renderItem = ({item}) => {
|
|
101
|
+
return item.uid.toString().indexOf('langUpdate') !== -1 ? (
|
|
102
|
+
<View style={styles.langChangeContainer}>
|
|
103
|
+
<ImageIcon
|
|
104
|
+
iconType="plain"
|
|
105
|
+
iconSize={20}
|
|
106
|
+
tintColor={$config.PRIMARY_ACTION_BRAND_COLOR}
|
|
107
|
+
name={'lang-select'}
|
|
108
|
+
/>
|
|
109
|
+
|
|
110
|
+
<Text style={styles.langChange}>
|
|
111
|
+
{defaultContent[item?.uid?.split('-')[1]].name + ' ' + item.text}
|
|
112
|
+
</Text>
|
|
113
|
+
</View>
|
|
114
|
+
) : (
|
|
115
|
+
<TranscriptText
|
|
116
|
+
user={defaultContent[item.uid].name}
|
|
117
|
+
time={item?.time}
|
|
118
|
+
value={item.text}
|
|
119
|
+
searchQuery={searchQuery}
|
|
120
|
+
/>
|
|
121
|
+
);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const handleViewLatest = () => {
|
|
125
|
+
// flatListRef.current.scrollToOffset({
|
|
126
|
+
// offset: contentHeightRef.current,
|
|
127
|
+
// animated: false,
|
|
128
|
+
// });
|
|
129
|
+
if (flatListRef.current) {
|
|
130
|
+
flatListRef.current.scrollToEnd({animated: false});
|
|
131
|
+
setShowButton(false);
|
|
132
|
+
isScrolledToEnd.current = true;
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const handleContentSizeChange = (contentWidth, contentHeight) => {
|
|
137
|
+
contentHeightRef.current = contentHeight;
|
|
138
|
+
if (!showButton && searchQuery.length === 0) {
|
|
139
|
+
flatListRef.current.scrollToOffset({
|
|
140
|
+
offset: contentHeightRef.current,
|
|
141
|
+
animated: false,
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
isScrolledToEnd.current = true;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
const handleScroll = (event: NativeSyntheticEvent<NativeScrollEvent>) => {
|
|
149
|
+
if (isScrolledToEnd.current) {
|
|
150
|
+
isScrolledToEnd.current = false;
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const {contentOffset, contentSize, layoutMeasurement} = event.nativeEvent;
|
|
155
|
+
const isAtBottom =
|
|
156
|
+
contentOffset.y + layoutMeasurement.height >= contentSize.height - 1; // -1 threshold when the exact bottom position not calcualted , diff ~.5
|
|
157
|
+
setShowButton(!isAtBottom);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const handleSearch = (text: string) => {
|
|
161
|
+
setSearchQuery(text);
|
|
162
|
+
// Filter the data based on the search query
|
|
163
|
+
const filteredResults = meetingTranscript.filter(item =>
|
|
164
|
+
item.text.toLowerCase().includes(text.toLowerCase()),
|
|
165
|
+
);
|
|
166
|
+
setShowButton(false);
|
|
167
|
+
setSearchResults(filteredResults);
|
|
168
|
+
// Scroll to the top of the FlatList when searching
|
|
169
|
+
flatListRef.current.scrollToOffset({offset: 0, animated: false});
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
const renderedData = searchQuery ? searchResults : data;
|
|
173
|
+
|
|
174
|
+
const NoResultsMsg = () => {
|
|
175
|
+
return <Text style={styles.emptyMsg}>{noresults}</Text>;
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
const handleStreamMessageCallback = (
|
|
179
|
+
...args: [number, Uint8Array] | [number, string, Uint8Array]
|
|
180
|
+
) => {
|
|
181
|
+
setIsSTTListenerAdded(true);
|
|
182
|
+
if (isWebInternal()) {
|
|
183
|
+
streamMessageCallback(args as [number, Uint8Array]);
|
|
184
|
+
} else {
|
|
185
|
+
const [uid, , data] = args;
|
|
186
|
+
const streamBuffer = Object.values(data);
|
|
187
|
+
streamMessageCallback([uid, new Uint8Array(streamBuffer)]);
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
React.useEffect(() => {
|
|
192
|
+
if (!isSTTListenerAdded) {
|
|
193
|
+
RtcEngineUnsafe.addListener(
|
|
194
|
+
'StreamMessage',
|
|
195
|
+
handleStreamMessageCallback as unknown as StreamMessageCallback,
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
}, []);
|
|
199
|
+
|
|
200
|
+
return (
|
|
201
|
+
<View
|
|
202
|
+
// onLayout={handleLayout}
|
|
203
|
+
style={[
|
|
204
|
+
isMobileUA()
|
|
205
|
+
? //mobile and mobile web
|
|
206
|
+
CommonStyles.sidePanelContainerNative
|
|
207
|
+
: isSmall()
|
|
208
|
+
? // desktop minimized
|
|
209
|
+
CommonStyles.sidePanelContainerWebMinimzed
|
|
210
|
+
: // desktop maximized
|
|
211
|
+
CommonStyles.sidePanelContainerWeb,
|
|
212
|
+
isWebInternal() && !isSmall() && currentLayout === getGridLayoutName()
|
|
213
|
+
? {marginVertical: 4}
|
|
214
|
+
: {},
|
|
215
|
+
//@ts-ignore
|
|
216
|
+
transcriptHeight && !isMobileUA() && {height: transcriptHeight},
|
|
217
|
+
{paddingBottom: 20},
|
|
218
|
+
]}>
|
|
219
|
+
{showHeader && <TranscriptHeader />}
|
|
220
|
+
<View style={[styles.searchContainer, isFocused && styles.inputFocused]}>
|
|
221
|
+
{!searchQuery && (
|
|
222
|
+
<>
|
|
223
|
+
<ImageIcon
|
|
224
|
+
name="search"
|
|
225
|
+
iconSize={20}
|
|
226
|
+
iconType="plain"
|
|
227
|
+
tintColor={$config.FONT_COLOR + hexadecimalTransparency['30%']}
|
|
228
|
+
/>
|
|
229
|
+
<Spacer size={4} horizontal />
|
|
230
|
+
</>
|
|
231
|
+
)}
|
|
232
|
+
<TextInput
|
|
233
|
+
style={styles.searchInput}
|
|
234
|
+
placeholder={searchText}
|
|
235
|
+
value={searchQuery}
|
|
236
|
+
onChangeText={handleSearch}
|
|
237
|
+
placeholderTextColor={
|
|
238
|
+
$config.FONT_COLOR + hexadecimalTransparency['30%']
|
|
239
|
+
}
|
|
240
|
+
onFocus={handleFocus}
|
|
241
|
+
onBlur={handleBlur}
|
|
242
|
+
/>
|
|
243
|
+
{searchQuery ? (
|
|
244
|
+
<TouchableOpacity
|
|
245
|
+
onPress={() => {
|
|
246
|
+
setSearchQuery('');
|
|
247
|
+
}}>
|
|
248
|
+
<ImageIcon
|
|
249
|
+
name="close"
|
|
250
|
+
iconSize={20}
|
|
251
|
+
iconType="plain"
|
|
252
|
+
tintColor={$config.FONT_COLOR + hexadecimalTransparency['30%']}
|
|
253
|
+
/>
|
|
254
|
+
</TouchableOpacity>
|
|
255
|
+
) : null}
|
|
256
|
+
</View>
|
|
257
|
+
{isLangChangeInProgress ? (
|
|
258
|
+
<View style={{flex: 1}}>
|
|
259
|
+
<Loading
|
|
260
|
+
text={settingSpokenLanguageLabel}
|
|
261
|
+
background="transparent"
|
|
262
|
+
indicatorColor={$config.FONT_COLOR + hexadecimalTransparency['70%']}
|
|
263
|
+
textColor={$config.FONT_COLOR + hexadecimalTransparency['70%']}
|
|
264
|
+
/>
|
|
265
|
+
</View>
|
|
266
|
+
) : (
|
|
267
|
+
<>
|
|
268
|
+
<View style={{flex: 1}}>
|
|
269
|
+
{/* <FlatList
|
|
270
|
+
ref={flatListRef}
|
|
271
|
+
style={styles.contentContainer}
|
|
272
|
+
data={renderedData}
|
|
273
|
+
renderItem={renderItem}
|
|
274
|
+
keyExtractor={item => item.uid + '-' + item.time}
|
|
275
|
+
onContentSizeChange={handleContentSizeChange}
|
|
276
|
+
onScroll={handleScroll}
|
|
277
|
+
onLayout={handleLayout}
|
|
278
|
+
ListEmptyComponent={searchQuery && <NoResultsMsg />}
|
|
279
|
+
ListFooterComponent={DownloadTranscriptBtn}
|
|
280
|
+
ListFooterComponentStyle={styles.footer}
|
|
281
|
+
contentContainerStyle={styles.content}
|
|
282
|
+
/> */}
|
|
283
|
+
<VirtualizedList
|
|
284
|
+
ref={flatListRef}
|
|
285
|
+
style={styles.contentContainer}
|
|
286
|
+
data={renderedData}
|
|
287
|
+
renderItem={renderItem}
|
|
288
|
+
keyExtractor={item => item.uid + '-' + item?.time}
|
|
289
|
+
onContentSizeChange={handleContentSizeChange}
|
|
290
|
+
onScroll={
|
|
291
|
+
isWebInternal()
|
|
292
|
+
? debounceFn(handleScroll, isMobileUA() ? 500 : 300)
|
|
293
|
+
: handleScroll
|
|
294
|
+
}
|
|
295
|
+
onLayout={handleLayout}
|
|
296
|
+
ListEmptyComponent={searchQuery && <NoResultsMsg />}
|
|
297
|
+
ListFooterComponent={DownloadTranscriptBtn}
|
|
298
|
+
ListFooterComponentStyle={styles.footer}
|
|
299
|
+
contentContainerStyle={styles.content}
|
|
300
|
+
getItemCount={() => renderedData.length}
|
|
301
|
+
getItem={(data, index) => renderedData[index]}
|
|
302
|
+
/>
|
|
303
|
+
|
|
304
|
+
{showButton ? (
|
|
305
|
+
<View
|
|
306
|
+
style={{
|
|
307
|
+
position: 'absolute',
|
|
308
|
+
bottom: 0,
|
|
309
|
+
left: 0,
|
|
310
|
+
right: 0,
|
|
311
|
+
alignItems: 'center',
|
|
312
|
+
zIndex: 9999,
|
|
313
|
+
}}>
|
|
314
|
+
<PrimaryButton
|
|
315
|
+
iconName={'view-last'}
|
|
316
|
+
containerStyle={styles.showLatestBtn}
|
|
317
|
+
textStyle={styles.textStyleBtn}
|
|
318
|
+
onPress={handleViewLatest}
|
|
319
|
+
iconSize={20}
|
|
320
|
+
text={viewlatest}
|
|
321
|
+
/>
|
|
322
|
+
</View>
|
|
323
|
+
) : null}
|
|
324
|
+
</View>
|
|
325
|
+
</>
|
|
326
|
+
)}
|
|
327
|
+
</View>
|
|
328
|
+
);
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
export default Transcript;
|
|
332
|
+
|
|
333
|
+
export const styles = StyleSheet.create({
|
|
334
|
+
contentContainer: {
|
|
335
|
+
paddingHorizontal: 20,
|
|
336
|
+
},
|
|
337
|
+
container: {
|
|
338
|
+
alignItems: 'flex-start',
|
|
339
|
+
},
|
|
340
|
+
btnContainerStyle: {
|
|
341
|
+
paddingVertical: 0,
|
|
342
|
+
paddingHorizontal: 0,
|
|
343
|
+
backgroundColor: 'transparent',
|
|
344
|
+
borderRadius: 4,
|
|
345
|
+
},
|
|
346
|
+
btnContainer: {
|
|
347
|
+
// margin: 20,
|
|
348
|
+
},
|
|
349
|
+
|
|
350
|
+
btnTxtStyle: {
|
|
351
|
+
fontSize: ThemeConfig.FontSize.small,
|
|
352
|
+
lineHeight: ThemeConfig.FontSize.small,
|
|
353
|
+
fontWeight: '600',
|
|
354
|
+
textTransform: 'capitalize',
|
|
355
|
+
},
|
|
356
|
+
|
|
357
|
+
showLatestBtn: {
|
|
358
|
+
backgroundColor: $config.CARD_LAYER_5_COLOR,
|
|
359
|
+
paddingVertical: 8,
|
|
360
|
+
paddingLeft: 12,
|
|
361
|
+
paddingRight: 16,
|
|
362
|
+
minWidth: 'auto',
|
|
363
|
+
borderRadius: 28,
|
|
364
|
+
},
|
|
365
|
+
textStyleBtn: {
|
|
366
|
+
color: $config.SECONDARY_ACTION_COLOR,
|
|
367
|
+
fontFamily: ThemeConfig.FontFamily.sansPro,
|
|
368
|
+
fontSize: ThemeConfig.FontSize.small,
|
|
369
|
+
lineHeight: 19,
|
|
370
|
+
fontWeight: '400',
|
|
371
|
+
textTransform: 'capitalize',
|
|
372
|
+
},
|
|
373
|
+
/* search results*/
|
|
374
|
+
searchContainer: {
|
|
375
|
+
flexDirection: 'row',
|
|
376
|
+
alignItems: 'center',
|
|
377
|
+
padding: 10,
|
|
378
|
+
|
|
379
|
+
marginHorizontal: 20,
|
|
380
|
+
marginVertical: 16,
|
|
381
|
+
borderRadius: 4,
|
|
382
|
+
height: 40,
|
|
383
|
+
borderWidth: 1,
|
|
384
|
+
|
|
385
|
+
borderColor: $config.INPUT_FIELD_BORDER_COLOR,
|
|
386
|
+
backgroundColor: $config.INPUT_FIELD_BACKGROUND_COLOR,
|
|
387
|
+
},
|
|
388
|
+
searchInput: {
|
|
389
|
+
flex: 1,
|
|
390
|
+
height: 40,
|
|
391
|
+
borderRadius: 4,
|
|
392
|
+
marginRight: 10,
|
|
393
|
+
color: $config.FONT_COLOR,
|
|
394
|
+
fontFamily: ThemeConfig.FontFamily.sansPro,
|
|
395
|
+
fontWeight: '400',
|
|
396
|
+
fontSize: ThemeConfig.FontSize.small,
|
|
397
|
+
lineHeight: ThemeConfig.FontSize.medium,
|
|
398
|
+
width: '100%',
|
|
399
|
+
borderWidth: 0,
|
|
400
|
+
|
|
401
|
+
...Platform.select({
|
|
402
|
+
web: {
|
|
403
|
+
outlineStyle: 'none',
|
|
404
|
+
},
|
|
405
|
+
}),
|
|
406
|
+
},
|
|
407
|
+
inputFocused: {
|
|
408
|
+
borderColor: $config.PRIMARY_ACTION_BRAND_COLOR,
|
|
409
|
+
},
|
|
410
|
+
searchButton: {
|
|
411
|
+
backgroundColor: $config.PRIMARY_ACTION_BRAND_COLOR,
|
|
412
|
+
borderRadius: 4,
|
|
413
|
+
paddingVertical: 8,
|
|
414
|
+
paddingHorizontal: 12,
|
|
415
|
+
},
|
|
416
|
+
searchButtonText: {
|
|
417
|
+
color: $config.FONT_COLOR,
|
|
418
|
+
fontSize: 14,
|
|
419
|
+
},
|
|
420
|
+
emptyMsg: {
|
|
421
|
+
color: $config.FONT_COLOR + hexadecimalTransparency['40%'],
|
|
422
|
+
alignSelf: 'center',
|
|
423
|
+
fontSize: 14,
|
|
424
|
+
fontStyle: 'italic',
|
|
425
|
+
},
|
|
426
|
+
langChange: {
|
|
427
|
+
marginLeft: 4,
|
|
428
|
+
color: $config.PRIMARY_ACTION_BRAND_COLOR,
|
|
429
|
+
fontFamily: ThemeConfig.FontFamily.sansPro,
|
|
430
|
+
fontWeight: '400',
|
|
431
|
+
fontSize: 12,
|
|
432
|
+
lineHeight: 16,
|
|
433
|
+
fontStyle: 'italic',
|
|
434
|
+
},
|
|
435
|
+
langChangeContainer: {
|
|
436
|
+
marginBottom: 20,
|
|
437
|
+
flexDirection: 'row',
|
|
438
|
+
},
|
|
439
|
+
footer: {
|
|
440
|
+
borderWidth: 1,
|
|
441
|
+
paddingVertical: 8,
|
|
442
|
+
borderColor: $config.SECONDARY_ACTION_COLOR,
|
|
443
|
+
borderRadius: 4,
|
|
444
|
+
marginTop: 'auto',
|
|
445
|
+
},
|
|
446
|
+
content: {
|
|
447
|
+
flexGrow: 1,
|
|
448
|
+
},
|
|
449
|
+
});
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import {StyleSheet, View} from 'react-native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import {SidePanelType, useSidePanel} from 'customization-api';
|
|
4
|
+
import IconButton, {IconButtonProps} from '../../atoms/IconButton';
|
|
5
|
+
import LanguageSelectorPopup from './LanguageSelectorPopup';
|
|
6
|
+
import {useCaption} from './useCaption';
|
|
7
|
+
import useSTTAPI from './useSTTAPI';
|
|
8
|
+
import {useString} from '../../utils/useString';
|
|
9
|
+
import {toolbarItemTranscriptText} from '../../language/default-labels/videoCallScreenLabels';
|
|
10
|
+
|
|
11
|
+
interface TranscriptIconProps {
|
|
12
|
+
plainIconHoverEffect?: boolean;
|
|
13
|
+
showToolTip?: boolean;
|
|
14
|
+
showLabel?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
isOnActionSheet?: boolean;
|
|
17
|
+
isMobileView?: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const TranscriptIcon = (props: TranscriptIconProps) => {
|
|
21
|
+
const {setSidePanel, sidePanel} = useSidePanel();
|
|
22
|
+
const {
|
|
23
|
+
showToolTip = false,
|
|
24
|
+
showLabel = $config.ICON_TEXT,
|
|
25
|
+
disabled = false,
|
|
26
|
+
isOnActionSheet = false,
|
|
27
|
+
isMobileView = false,
|
|
28
|
+
} = props;
|
|
29
|
+
|
|
30
|
+
const {start, restart, isAuthorizedSTTUser} = useSTTAPI();
|
|
31
|
+
const {isSTTActive, language: prevLang, isSTTError} = useCaption();
|
|
32
|
+
const isDisabled = !isAuthorizedSTTUser();
|
|
33
|
+
const [isLanguagePopupOpen, setLanguagePopup] =
|
|
34
|
+
React.useState<boolean>(false);
|
|
35
|
+
const isFirstTimePopupOpen = React.useRef(false);
|
|
36
|
+
|
|
37
|
+
const isTranscriptON = sidePanel === SidePanelType.Transcript;
|
|
38
|
+
const onPress = () => {
|
|
39
|
+
if (isSTTError) {
|
|
40
|
+
setSidePanel(
|
|
41
|
+
isTranscriptON ? SidePanelType.None : SidePanelType.Transcript,
|
|
42
|
+
);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (isSTTActive) {
|
|
46
|
+
setSidePanel(
|
|
47
|
+
isTranscriptON ? SidePanelType.None : SidePanelType.Transcript,
|
|
48
|
+
);
|
|
49
|
+
} else {
|
|
50
|
+
isFirstTimePopupOpen.current = true;
|
|
51
|
+
setLanguagePopup(true);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const label = useString<boolean>(toolbarItemTranscriptText);
|
|
56
|
+
const iconButtonProps: IconButtonProps = {
|
|
57
|
+
onPress,
|
|
58
|
+
iconProps: {
|
|
59
|
+
name: 'transcript',
|
|
60
|
+
iconBackgroundColor: isTranscriptON
|
|
61
|
+
? $config.PRIMARY_ACTION_BRAND_COLOR
|
|
62
|
+
: '',
|
|
63
|
+
tintColor: isDisabled
|
|
64
|
+
? $config.SEMANTIC_NEUTRAL
|
|
65
|
+
: isTranscriptON
|
|
66
|
+
? $config.PRIMARY_ACTION_TEXT_COLOR
|
|
67
|
+
: $config.SECONDARY_ACTION_COLOR,
|
|
68
|
+
},
|
|
69
|
+
disabled: isDisabled,
|
|
70
|
+
btnTextProps: {
|
|
71
|
+
text: showLabel
|
|
72
|
+
? isOnActionSheet
|
|
73
|
+
? label(isTranscriptON)?.replace(' ', '\n')
|
|
74
|
+
: label(isTranscriptON)
|
|
75
|
+
: '',
|
|
76
|
+
textColor: $config.FONT_COLOR,
|
|
77
|
+
numberOfLines: 2,
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
iconButtonProps.isOnActionSheet = isOnActionSheet;
|
|
81
|
+
if (!isOnActionSheet) {
|
|
82
|
+
iconButtonProps.toolTipMessage = label(isTranscriptON);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const onConfirm = async (langChanged, language) => {
|
|
86
|
+
setLanguagePopup(false);
|
|
87
|
+
|
|
88
|
+
isFirstTimePopupOpen.current = false;
|
|
89
|
+
const method = isTranscriptON ? 'stop' : 'start';
|
|
90
|
+
if (method === 'stop') return; // not closing the stt service as it will stop for whole channel
|
|
91
|
+
if (method === 'start' && isSTTActive === true) return; // not triggering the start service if STT Service already started by anyone else in the channel
|
|
92
|
+
if (!isTranscriptON) {
|
|
93
|
+
setSidePanel(SidePanelType.Transcript);
|
|
94
|
+
} else {
|
|
95
|
+
setSidePanel(SidePanelType.None);
|
|
96
|
+
}
|
|
97
|
+
try {
|
|
98
|
+
const res = await start(language);
|
|
99
|
+
if (res?.message.includes('STARTED')) {
|
|
100
|
+
// channel is already started now restart
|
|
101
|
+
await restart(language);
|
|
102
|
+
}
|
|
103
|
+
} catch (error) {
|
|
104
|
+
console.log('eror in starting stt', error);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<View>
|
|
110
|
+
<IconButton {...iconButtonProps} />
|
|
111
|
+
<LanguageSelectorPopup
|
|
112
|
+
modalVisible={isLanguagePopupOpen}
|
|
113
|
+
setModalVisible={setLanguagePopup}
|
|
114
|
+
onConfirm={onConfirm}
|
|
115
|
+
isFirstTimePopupOpen={isFirstTimePopupOpen.current}
|
|
116
|
+
/>
|
|
117
|
+
</View>
|
|
118
|
+
);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export default TranscriptIcon;
|
|
122
|
+
|
|
123
|
+
const styles = StyleSheet.create({});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import {Text, View, StyleSheet} from 'react-native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import ThemeConfig from '../../../src/theme';
|
|
5
|
+
import hexadecimalTransparency from '../../../src/utils/hexadecimalTransparency';
|
|
6
|
+
import {formatTime} from './utils';
|
|
7
|
+
|
|
8
|
+
interface TranscriptTextProps {
|
|
9
|
+
user: string;
|
|
10
|
+
time: number;
|
|
11
|
+
value: string;
|
|
12
|
+
searchQuery?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const TranscriptText = ({
|
|
16
|
+
user,
|
|
17
|
+
time,
|
|
18
|
+
value,
|
|
19
|
+
searchQuery = '',
|
|
20
|
+
}: TranscriptTextProps) => {
|
|
21
|
+
const t = time ? formatTime(Number(time)) : '';
|
|
22
|
+
const regex = searchQuery ? new RegExp(`(${searchQuery})`, 'gi') : ' ';
|
|
23
|
+
const parts = value.split(regex);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<View key={user} style={styles.transcriptTextContainer}>
|
|
27
|
+
<View style={styles.nameTimeContainer}>
|
|
28
|
+
<Text
|
|
29
|
+
numberOfLines={1}
|
|
30
|
+
textBreakStrategy="simple"
|
|
31
|
+
ellipsizeMode="tail"
|
|
32
|
+
style={[styles.transcriptName]}>
|
|
33
|
+
{user}
|
|
34
|
+
</Text>
|
|
35
|
+
<Text style={styles.timestamp}>{t}</Text>
|
|
36
|
+
</View>
|
|
37
|
+
|
|
38
|
+
<View>
|
|
39
|
+
<Text style={[styles.transciptText]}>
|
|
40
|
+
{/* If substring matches search query then highlight it */}
|
|
41
|
+
{parts.map((part, index) =>
|
|
42
|
+
part.toLowerCase() === searchQuery.toLowerCase() &&
|
|
43
|
+
searchQuery !== '' ? (
|
|
44
|
+
<Text key={index} style={styles.highlightedText}>
|
|
45
|
+
{searchQuery ? part : part + ' '}
|
|
46
|
+
</Text>
|
|
47
|
+
) : (
|
|
48
|
+
<Text key={index}>{searchQuery ? part : part + ' '}</Text>
|
|
49
|
+
),
|
|
50
|
+
)}
|
|
51
|
+
</Text>
|
|
52
|
+
</View>
|
|
53
|
+
</View>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const styles = StyleSheet.create({
|
|
58
|
+
nameTimeContainer: {
|
|
59
|
+
flexDirection: 'row',
|
|
60
|
+
alignItems: 'baseline',
|
|
61
|
+
marginBottom: 4,
|
|
62
|
+
justifyContent: 'flex-start',
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
transcriptTextContainer: {
|
|
66
|
+
alignItems: 'flex-start',
|
|
67
|
+
marginBottom: 20,
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
transciptText: {
|
|
71
|
+
fontSize: 16,
|
|
72
|
+
lineHeight: 22,
|
|
73
|
+
fontFamily: ThemeConfig.FontFamily.sansPro,
|
|
74
|
+
fontWeight: '400',
|
|
75
|
+
color: $config.FONT_COLOR + hexadecimalTransparency['70%'],
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
transcriptName: {
|
|
79
|
+
fontSize: 16,
|
|
80
|
+
lineHeight: 19,
|
|
81
|
+
fontWeight: '600',
|
|
82
|
+
fontFamily: ThemeConfig.FontFamily.sansPro,
|
|
83
|
+
color: $config.FONT_COLOR,
|
|
84
|
+
maxWidth: 160,
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
timestamp: {
|
|
88
|
+
fontSize: 12,
|
|
89
|
+
lineHeight: 16,
|
|
90
|
+
marginLeft: 8,
|
|
91
|
+
color: $config.FONT_COLOR + hexadecimalTransparency['40%'],
|
|
92
|
+
fontFamily: ThemeConfig.FontFamily.sansPro,
|
|
93
|
+
fontWeight: '400',
|
|
94
|
+
},
|
|
95
|
+
highlightedText: {
|
|
96
|
+
backgroundColor: $config.SEMANTIC_NEUTRAL,
|
|
97
|
+
},
|
|
98
|
+
});
|