agora-appbuilder-core 2.3.0-beta.9 → 3.0.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.md +11 -6
- package/package.json +1 -1
- package/template/Gulpfile.js +121 -83
- package/template/_gitignore +2 -2
- package/template/_package-lock.json +12959 -13248
- package/template/agora-rn-uikit/src/AgoraUIKit.tsx +2 -2
- package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +2 -0
- package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +3 -3
- package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +4 -5
- package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +3 -1
- package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +2 -2
- package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +4 -4
- package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +7 -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 +2 -2
- package/template/agora-rn-uikit/src/Rtc/Create.tsx +88 -43
- package/template/agora-rn-uikit/src/Rtc/Join.tsx +13 -4
- package/template/agora-rn-uikit/src/RtcConfigure.tsx +36 -19
- package/template/agora-rn-uikit/src/Utils/permission.ts +17 -6
- package/template/babel.config.js +9 -9
- package/template/bridge/rtc/webNg/RtcEngine.ts +51 -26
- package/template/customization-api/action-library.ts +22 -0
- package/template/{fpe-api/context.ts → customization-api/app-state.ts} +16 -14
- package/template/customization-api/customEvents.ts +9 -0
- package/template/{fpe-api/install.ts → customization-api/customize.ts} +27 -26
- package/template/{fpe-api → customization-api}/index.ts +11 -6
- package/template/{fpe-api/components.ts → customization-api/sub-components.ts} +22 -3
- package/template/{fpe-api → customization-api}/typeDefinition.ts +13 -14
- package/template/customization-api/utils.ts +30 -0
- package/template/{fpe-implementation → customization-implementation}/createHook.ts +0 -0
- package/template/{fpe-implementation/dummyFpe.ts → customization-implementation/dummyConfig.ts} +4 -4
- package/template/customization-implementation/index.ts +4 -0
- package/template/{fpe-api/useFpe.tsx → customization-implementation/useCustomization.tsx} +12 -12
- package/template/{fpe.config.js → customization.config.js} +11 -11
- package/template/electron/main/index.js +42 -35
- package/template/esbuild.rsdk.go +8 -17
- package/template/global.d.ts +4 -3
- package/template/index.rsdk.tsx +13 -5
- package/template/index.wsdk.tsx +21 -5
- package/template/package.json +3 -0
- package/template/react-native-toast-message/src/index.js +3 -7
- package/template/react-native-toast-message/src/{index.wsdk.js → index.sdk.tsx} +1 -1
- package/template/react-native-toast-message/src/styles.sdk.ts +17 -0
- package/template/src/App.tsx +8 -4
- package/template/src/AppWrapper.tsx +8 -6
- package/template/src/SDKAppWrapper.tsx +28 -21
- package/template/src/app-state/useLocalUserInfo.ts +8 -0
- package/template/src/app-state/useMessages.ts +52 -0
- package/template/src/atoms/PrimaryButton.tsx +2 -2
- package/template/src/atoms/SecondaryButton.tsx +12 -4
- package/template/src/atoms/TextInput.tsx +2 -2
- package/template/src/components/Chat.tsx +22 -11
- package/template/src/components/ChatContext.ts +10 -27
- package/template/src/components/Controls.native.tsx +13 -7
- package/template/src/components/Controls.tsx +15 -24
- package/template/src/components/DeviceConfigure.tsx +4 -3
- package/template/src/components/EventsConfigure.tsx +54 -0
- package/template/src/components/GridVideo.tsx +5 -6
- package/template/src/components/HostControlView.tsx +13 -19
- package/template/src/components/Navbar.tsx +54 -41
- package/template/src/components/NetworkQualityContext.tsx +4 -3
- package/template/src/components/ParticipantsView.tsx +7 -7
- package/template/src/components/PinnedVideo.tsx +3 -4
- package/template/src/components/Precall.native.tsx +3 -3
- package/template/src/components/Precall.tsx +14 -10
- package/template/src/components/RTMConfigure.tsx +61 -219
- package/template/src/components/SettingsView.tsx +6 -3
- package/template/src/components/Share.tsx +24 -18
- package/template/src/components/chat-messages/useChatMessages.tsx +397 -80
- package/template/src/components/chat-notification/useChatNotification.tsx +2 -2
- package/template/src/components/chat-ui/useChatUIControl.tsx +1 -1
- package/template/src/components/common/Logo.tsx +3 -2
- package/template/src/components/contexts/LiveStreamDataContext.tsx +3 -3
- package/template/src/components/contexts/ScreenShareContext.tsx +3 -1
- package/template/src/components/contexts/VideoMeetingDataContext.tsx +85 -0
- package/template/src/components/contexts/WhiteboardContext.tsx +8 -8
- package/template/src/components/livestream/LiveStreamContext.tsx +88 -74
- package/template/src/components/meeting-info/useMeetingInfo.tsx +23 -19
- package/template/src/components/meeting-info/useSetMeetingInfo.tsx +1 -1
- package/template/src/components/participants/AllAudienceParticipants.tsx +2 -2
- package/template/src/components/participants/AllHostParticipants.tsx +4 -4
- package/template/src/components/participants/MeParticipant.tsx +5 -3
- package/template/src/components/participants/ParticipantName.tsx +2 -2
- package/template/src/components/participants/RemoteParticipants.tsx +9 -7
- package/template/src/components/precall/LocalMute.native.tsx +14 -10
- package/template/src/components/precall/LocalMute.tsx +7 -5
- package/template/src/components/precall/VideoPreview.native.tsx +6 -6
- package/template/src/components/precall/VideoPreview.tsx +3 -3
- package/template/src/components/precall/joinCallBtn.tsx +3 -3
- package/template/src/components/precall/meetingTitle.tsx +3 -1
- package/template/src/components/precall/selectDevice.tsx +2 -2
- package/template/src/components/precall/usePreCall.tsx +1 -1
- package/template/src/components/styles.ts +3 -3
- package/template/src/components/useShareLink.tsx +69 -29
- package/template/src/components/useUserPreference.tsx +16 -15
- package/template/src/components/useWakeLock.tsx +3 -3
- package/template/src/language/i18nTypes.ts +1 -1
- package/template/src/language/index.ts +2 -2
- package/template/src/language/useLanguage.tsx +2 -3
- package/template/src/pages/Authenticate.tsx +3 -2
- package/template/src/pages/Create.tsx +18 -20
- package/template/src/pages/Join.tsx +6 -7
- package/template/src/pages/VideoCall.tsx +74 -66
- package/template/src/pages/create/useCreate.tsx +1 -1
- package/template/src/pages/video-call/CustomUserContextHolder.tsx +14 -6
- package/template/src/pages/video-call/DefaultLayouts.ts +8 -8
- package/template/src/pages/video-call/{NameWithMicStatus.tsx → NameWithMicIcon.tsx} +8 -1
- package/template/src/pages/video-call/RenderComponent.tsx +7 -10
- package/template/src/pages/video-call/VideoCallScreen.tsx +31 -22
- package/template/src/pages/video-call/VideoComponent.tsx +13 -15
- package/template/src/pages/video-call/VideoRenderer.tsx +6 -6
- package/template/src/pages/video-call/useLayoutsData.ts +23 -0
- package/template/src/rtm/RTMEngine.ts +13 -0
- package/template/src/rtm-events/EventUtils.ts +20 -20
- package/template/src/rtm-events/EventsQueue.ts +9 -3
- package/template/src/rtm-events/constants.ts +5 -0
- package/template/src/rtm-events/index.tsx +1 -3
- package/template/src/{custom-events/CustomEvents.ts → rtm-events-api/Events.ts} +67 -61
- package/template/src/rtm-events-api/index.tsx +6 -0
- package/template/src/rtm-events-api/types.ts +22 -0
- package/template/src/subComponents/ChatBubble.tsx +24 -8
- package/template/src/subComponents/ChatContainer.tsx +24 -15
- package/template/src/subComponents/ChatInput.tsx +56 -42
- package/template/src/subComponents/LanguageSelector.tsx +2 -2
- package/template/src/subComponents/LayoutIconDropdown.native.tsx +5 -5
- package/template/src/subComponents/LayoutIconDropdown.tsx +7 -7
- package/template/src/subComponents/LocalAudioMute.tsx +3 -4
- package/template/src/subComponents/LocalEndCall.tsx +3 -6
- package/template/src/subComponents/LocalSwitchCamera.tsx +3 -4
- package/template/src/subComponents/LocalVideoMute.tsx +3 -3
- package/template/src/subComponents/NetworkQualityPill.tsx +8 -9
- package/template/src/subComponents/OpenInNativeButton.tsx +2 -3
- package/template/src/subComponents/RemoteAudioMute.tsx +5 -11
- package/template/src/subComponents/RemoteEndCall.tsx +3 -10
- package/template/src/subComponents/RemoteVideoMute.tsx +3 -10
- package/template/src/subComponents/SelectDevice.tsx +1 -1
- package/template/src/subComponents/SelectOAuth.tsx +3 -2
- package/template/src/subComponents/SidePanelButtons.ts +6 -5
- package/template/src/subComponents/TextWithTooltip.tsx +6 -2
- package/template/src/subComponents/{toastConfig.tsx → ToastConfig.tsx} +2 -2
- package/template/src/subComponents/chat/ChatParticipants.tsx +6 -5
- package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +2 -2
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +4 -3
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +2 -2
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +2 -4
- package/template/src/subComponents/livestream/index.ts +2 -2
- package/template/src/subComponents/recording/useRecording.tsx +44 -23
- package/template/src/subComponents/recording/useRecordingLayoutQuery.tsx +11 -5
- package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +46 -34
- package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +97 -38
- package/template/src/subComponents/screenshare/useScreenshare.tsx +1 -1
- package/template/src/utils/SdkEvents.ts +9 -46
- package/template/src/utils/common.tsx +25 -9
- package/template/src/utils/getUniqueID.ts +5 -0
- package/template/src/utils/isMobileOrTablet.native.ts +2 -2
- package/template/src/utils/isMobileOrTablet.ts +21 -8
- package/template/src/utils/useButtonTemplate.tsx +1 -1
- package/template/src/utils/useCreateMeeting.ts +21 -10
- package/template/src/utils/useGetMeetingPhrase.ts +11 -8
- package/template/src/utils/{IsAttendeeUser.ts → useIsAttendee.ts} +3 -1
- package/template/src/utils/{isAudioEnabled.ts → useIsAudioEnabled.ts} +4 -4
- package/template/src/utils/{isHostUser.ts → useIsHost.ts} +13 -16
- package/template/src/utils/{isPSTNUser.ts → useIsPSTN.ts} +2 -2
- package/template/src/utils/{isScreenShareUser.ts → useIsScreenShare.ts} +0 -0
- package/template/src/utils/{isVideoEnabled.ts → useIsVideoEnabled.ts} +5 -6
- package/template/src/utils/useJoinMeeting.ts +8 -6
- package/template/src/utils/useLayout.tsx +5 -5
- package/template/src/utils/useMutePSTN.ts +5 -3
- package/template/src/utils/useMuteToggleLocal.ts +3 -4
- package/template/src/utils/useRemoteEndCall.ts +11 -10
- package/template/src/utils/useRemoteMute.ts +42 -20
- package/template/src/utils/useSidePanel.tsx +1 -1
- package/template/src/utils/useString.ts +2 -2
- package/template/src/utils/useUserName.ts +11 -0
- package/template/tsconfig_fpeApi.json +8 -9
- package/template/tsconfig_rsdk_index.json +8 -9
- package/template/tsconfig_wsdk_index.json +8 -9
- package/template/webpack.commons.js +9 -9
- package/template/webpack.rsdk.config.js +4 -2
- package/template/webpack.ts.config.js +6 -6
- package/template/webpack.wsdk.config.js +2 -1
- package/template/fpe-api/fpeEvents.ts +0 -9
- package/template/fpe-api/utils.ts +0 -61
- package/template/fpe-implementation/index.ts +0 -1
- package/template/fpe-todo.txt +0 -14
- package/template/src/components/RTMEvents.tsx +0 -84
- package/template/src/custom-events/index.tsx +0 -4
- package/template/src/custom-events/types.ts +0 -51
- package/template/src/pages/video-call/CustomLayout.ts +0 -17
- package/template/src/rtm-events/types.ts +0 -7
- package/template/src/utils/getMeetingInvite.ts +0 -53
- package/template/src/utils/useGroupMessages.ts +0 -24
- package/template/src/utils/useNavParams.ts +0 -6
- package/template/src/utils/useNavigateTo.ts +0 -8
- package/template/src/utils/usePrivateMessages.ts +0 -33
- package/template/src/utils/useSendControlMessage.ts +0 -51
- package/template/src/utils/useSendMessage.ts +0 -40
- package/template/src/utils/useSetUnreadMessageCount.ts +0 -43
- package/template/src/utils/useUnreadMessageCount.ts +0 -50
- package/template/src/utils/useUserList.ts +0 -26
|
@@ -10,17 +10,17 @@
|
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import
|
|
13
|
+
import {useRender, useRtc} from 'customization-api';
|
|
14
|
+
import React from 'react';
|
|
14
15
|
import {View} from 'react-native';
|
|
15
|
-
import {MaxVideoView
|
|
16
|
-
import useUserList from '../../utils/useUserList';
|
|
16
|
+
import {MaxVideoView} from '../../../agora-rn-uikit';
|
|
17
17
|
|
|
18
18
|
const VideoPreview: React.FC = () => {
|
|
19
|
-
const rtc =
|
|
19
|
+
const rtc = useRtc();
|
|
20
20
|
rtc?.RtcEngine?.startPreview();
|
|
21
21
|
|
|
22
|
-
const {renderList,
|
|
23
|
-
const [maxUid] =
|
|
22
|
+
const {renderList, activeUids} = useRender();
|
|
23
|
+
const [maxUid] = activeUids;
|
|
24
24
|
|
|
25
25
|
if (!maxUid) {
|
|
26
26
|
return null;
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import {useRender} from 'customization-api';
|
|
13
14
|
import React from 'react';
|
|
14
15
|
import {View} from 'react-native';
|
|
15
16
|
import {MaxVideoView} from '../../../agora-rn-uikit';
|
|
16
|
-
import useUserList from '../../utils/useUserList';
|
|
17
17
|
|
|
18
18
|
const VideoPreview: React.FC = () => {
|
|
19
|
-
const {renderList,
|
|
19
|
+
const {renderList, activeUids} = useRender();
|
|
20
20
|
|
|
21
|
-
const [maxUid] =
|
|
21
|
+
const [maxUid] = activeUids;
|
|
22
22
|
|
|
23
23
|
if (!maxUid) {
|
|
24
24
|
return null;
|
|
@@ -20,7 +20,7 @@ import {useMeetingInfo} from '../meeting-info/useMeetingInfo';
|
|
|
20
20
|
import useGetName from '../../utils/useGetName';
|
|
21
21
|
import {useWakeLock} from '../../components/useWakeLock';
|
|
22
22
|
import isMobileOrTablet from '../../utils/isMobileOrTablet';
|
|
23
|
-
import {
|
|
23
|
+
import {isWebInternal} from '../../utils/common';
|
|
24
24
|
|
|
25
25
|
const audio = new Audio(
|
|
26
26
|
'https://dl.dropboxusercontent.com/s/1cdwpm3gca9mlo0/kick.mp3',
|
|
@@ -53,7 +53,7 @@ const JoinCallBtn = (props: PreCallJoinCallBtnProps) => {
|
|
|
53
53
|
const onSubmit = () => {
|
|
54
54
|
setCallActive(true);
|
|
55
55
|
// Play a sound to avoid autoblocking in safari
|
|
56
|
-
if (
|
|
56
|
+
if (isWebInternal() || isMobileOrTablet()) {
|
|
57
57
|
audio.volume = 0;
|
|
58
58
|
audio.play().then(() => {
|
|
59
59
|
// pause directly once played
|
|
@@ -61,7 +61,7 @@ const JoinCallBtn = (props: PreCallJoinCallBtnProps) => {
|
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
// Avoid Sleep only on mobile browsers
|
|
64
|
-
if (
|
|
64
|
+
if (isWebInternal() && isMobileOrTablet() && !awake) {
|
|
65
65
|
// Request wake lock
|
|
66
66
|
request();
|
|
67
67
|
}
|
|
@@ -3,7 +3,9 @@ import {Text, StyleSheet, View} from 'react-native';
|
|
|
3
3
|
import {useMeetingInfo} from '../meeting-info/useMeetingInfo';
|
|
4
4
|
|
|
5
5
|
const MeetingTitle: React.FC = () => {
|
|
6
|
-
const {
|
|
6
|
+
const {
|
|
7
|
+
data: {meetingTitle},
|
|
8
|
+
} = useMeetingInfo();
|
|
7
9
|
return (
|
|
8
10
|
<>
|
|
9
11
|
<Text style={[style.titleHeading, {color: $config.PRIMARY_COLOR}]}>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import {View, StyleSheet, Text} from 'react-native';
|
|
15
|
-
import {
|
|
15
|
+
import {isWebInternal} from '../../utils/common';
|
|
16
16
|
import SelectDevice from '../../subComponents/SelectDevice';
|
|
17
17
|
import {useString} from '../../utils/useString';
|
|
18
18
|
|
|
@@ -26,7 +26,7 @@ const selectDevice: React.FC = () => {
|
|
|
26
26
|
<View
|
|
27
27
|
style={{
|
|
28
28
|
flex: 1,
|
|
29
|
-
maxWidth:
|
|
29
|
+
maxWidth: isWebInternal() ? '25vw' : 'auto',
|
|
30
30
|
marginVertical: 30,
|
|
31
31
|
}}>
|
|
32
32
|
<SelectDevice />
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
12
|
import React, {createContext} from 'react';
|
|
13
|
-
import {createHook} from '
|
|
13
|
+
import {createHook} from 'customization-implementation';
|
|
14
14
|
import {ApolloError} from '@apollo/client';
|
|
15
15
|
|
|
16
16
|
export interface PreCallContextInterface {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
information visit https://appbuilder.agora.io.
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
|
-
import {
|
|
12
|
+
import {isWebInternal} from '../utils/common';
|
|
13
13
|
|
|
14
14
|
const styles = {
|
|
15
15
|
temp: {
|
|
@@ -19,8 +19,8 @@ const styles = {
|
|
|
19
19
|
borderRadius: 15,
|
|
20
20
|
},
|
|
21
21
|
bottomBar: {
|
|
22
|
-
flex:
|
|
23
|
-
paddingHorizontal:
|
|
22
|
+
flex: isWebInternal() ? 1.3 : 1.6,
|
|
23
|
+
paddingHorizontal: isWebInternal() ? '20%' : '1%',
|
|
24
24
|
backgroundColor: $config.SECONDARY_FONT_COLOR + 80,
|
|
25
25
|
flexDirection: 'row',
|
|
26
26
|
justifyContent: 'space-evenly',
|
|
@@ -10,20 +10,68 @@
|
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {createHook} from '
|
|
13
|
+
import {createHook} from 'customization-implementation';
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import {useString} from '../utils/useString';
|
|
16
16
|
import isSDKCheck from '../utils/isSDK';
|
|
17
17
|
import Toast from '../../react-native-toast-message';
|
|
18
18
|
import {useMeetingInfo} from './meeting-info/useMeetingInfo';
|
|
19
19
|
import platform from '../subComponents/Platform';
|
|
20
|
-
import {
|
|
21
|
-
GetMeetingInviteID,
|
|
22
|
-
GetMeetingInviteURL,
|
|
23
|
-
} from '../utils/getMeetingInvite';
|
|
24
20
|
import {MeetingInviteInterface} from '../language/default-labels/videoCallScreenLabels';
|
|
25
21
|
import Clipboard from '../subComponents/Clipboard';
|
|
26
22
|
|
|
23
|
+
export const GetMeetingInviteURL = (
|
|
24
|
+
baseUrl: string,
|
|
25
|
+
isHost: boolean,
|
|
26
|
+
roomId: {
|
|
27
|
+
host?: string;
|
|
28
|
+
attendee?: string;
|
|
29
|
+
},
|
|
30
|
+
isSeparateHostLink: boolean,
|
|
31
|
+
) => {
|
|
32
|
+
if (isHost) {
|
|
33
|
+
if (isSeparateHostLink) {
|
|
34
|
+
return {
|
|
35
|
+
host: `${baseUrl}/${roomId.host}`,
|
|
36
|
+
attendee: `${baseUrl}/${roomId.attendee}`,
|
|
37
|
+
};
|
|
38
|
+
} else {
|
|
39
|
+
return {
|
|
40
|
+
host: `${baseUrl}/${roomId.host}`,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
} else {
|
|
44
|
+
return {
|
|
45
|
+
attendee: `${baseUrl}/${roomId.attendee}`,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
export const GetMeetingInviteID = (
|
|
50
|
+
isHost: boolean,
|
|
51
|
+
roomId: {
|
|
52
|
+
host?: string;
|
|
53
|
+
attendee?: string;
|
|
54
|
+
},
|
|
55
|
+
isSeparateHostLink: boolean,
|
|
56
|
+
) => {
|
|
57
|
+
if (isHost) {
|
|
58
|
+
if (isSeparateHostLink) {
|
|
59
|
+
return {
|
|
60
|
+
host: `${roomId.host}`,
|
|
61
|
+
attendee: `${roomId.attendee}`,
|
|
62
|
+
};
|
|
63
|
+
} else {
|
|
64
|
+
return {
|
|
65
|
+
host: `${roomId.host}`,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
} else {
|
|
69
|
+
return {
|
|
70
|
+
attendee: `${roomId.attendee}`,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
27
75
|
export enum SHARE_LINK_CONTENT_TYPE {
|
|
28
76
|
ATTENDEE = 1,
|
|
29
77
|
HOST,
|
|
@@ -45,8 +93,9 @@ interface ShareLinkProvideProps {
|
|
|
45
93
|
}
|
|
46
94
|
|
|
47
95
|
const ShareLinkProvider = (props: ShareLinkProvideProps) => {
|
|
48
|
-
const {
|
|
49
|
-
|
|
96
|
+
const {
|
|
97
|
+
data: {meetingTitle, roomId, pstn, isSeparateHostLink, isHost},
|
|
98
|
+
} = useMeetingInfo();
|
|
50
99
|
|
|
51
100
|
//commmented for v1 release
|
|
52
101
|
// const copiedToClipboardText = useString(
|
|
@@ -111,20 +160,15 @@ const ShareLinkProvider = (props: ShareLinkProvideProps) => {
|
|
|
111
160
|
let stringToCopy = meetingInviteText({
|
|
112
161
|
meetingName: meetingTitle,
|
|
113
162
|
url: baseURL
|
|
114
|
-
? GetMeetingInviteURL(
|
|
115
|
-
baseURL,
|
|
116
|
-
isHost,
|
|
117
|
-
meetingPassphrase,
|
|
118
|
-
isSeparateHostLink,
|
|
119
|
-
)
|
|
163
|
+
? GetMeetingInviteURL(baseURL, isHost, roomId, isSeparateHostLink)
|
|
120
164
|
: undefined,
|
|
121
165
|
id: !baseURL
|
|
122
|
-
? GetMeetingInviteID(isHost,
|
|
166
|
+
? GetMeetingInviteID(isHost, roomId, isSeparateHostLink)
|
|
123
167
|
: undefined,
|
|
124
|
-
pstn:
|
|
168
|
+
pstn: pstn
|
|
125
169
|
? {
|
|
126
|
-
number:
|
|
127
|
-
pin:
|
|
170
|
+
number: pstn.number,
|
|
171
|
+
pin: pstn.pin,
|
|
128
172
|
}
|
|
129
173
|
: undefined,
|
|
130
174
|
isHost,
|
|
@@ -144,11 +188,11 @@ const ShareLinkProvider = (props: ShareLinkProvideProps) => {
|
|
|
144
188
|
const getAttendeeURLOrId = () => {
|
|
145
189
|
let stringToCopy = '';
|
|
146
190
|
let baseURL = getBaseURL();
|
|
147
|
-
if (
|
|
191
|
+
if (roomId?.attendee) {
|
|
148
192
|
if (baseURL) {
|
|
149
|
-
stringToCopy += `${baseURL}/${
|
|
193
|
+
stringToCopy += `${baseURL}/${roomId.attendee}`;
|
|
150
194
|
} else {
|
|
151
|
-
stringToCopy += `${
|
|
195
|
+
stringToCopy += `${roomId.attendee}`;
|
|
152
196
|
}
|
|
153
197
|
}
|
|
154
198
|
return stringToCopy;
|
|
@@ -156,12 +200,12 @@ const ShareLinkProvider = (props: ShareLinkProvideProps) => {
|
|
|
156
200
|
|
|
157
201
|
const getHostUrlOrId = () => {
|
|
158
202
|
let stringToCopy = '';
|
|
159
|
-
if (
|
|
203
|
+
if (roomId?.host) {
|
|
160
204
|
let baseURL = getBaseURL();
|
|
161
205
|
if (baseURL) {
|
|
162
|
-
stringToCopy += `${baseURL}/${
|
|
206
|
+
stringToCopy += `${baseURL}/${roomId.host}`;
|
|
163
207
|
} else {
|
|
164
|
-
stringToCopy += `${
|
|
208
|
+
stringToCopy += `${roomId.host}`;
|
|
165
209
|
}
|
|
166
210
|
}
|
|
167
211
|
return stringToCopy;
|
|
@@ -169,12 +213,8 @@ const ShareLinkProvider = (props: ShareLinkProvideProps) => {
|
|
|
169
213
|
|
|
170
214
|
const getPstn = () => {
|
|
171
215
|
let stringToCopy = '';
|
|
172
|
-
if (
|
|
173
|
-
|
|
174
|
-
meetingPassphrase.pstn?.number &&
|
|
175
|
-
meetingPassphrase.pstn?.pin
|
|
176
|
-
) {
|
|
177
|
-
stringToCopy += `${PSTNNumberText}: ${meetingPassphrase.pstn.number} ${PSTNPinText}: ${meetingPassphrase.pstn.pin}`;
|
|
216
|
+
if (pstn && pstn?.number && pstn?.pin) {
|
|
217
|
+
stringToCopy += `${PSTNNumberText}: ${pstn.number} ${PSTNPinText}: ${pstn.pin}`;
|
|
178
218
|
}
|
|
179
219
|
|
|
180
220
|
return stringToCopy;
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import React, {useState, useContext, useEffect} from 'react';
|
|
13
13
|
import {RenderInterface, useLocalUid} from '../../agora-rn-uikit';
|
|
14
|
-
import {RtcContext} from '../../agora-rn-uikit';
|
|
15
14
|
import {useString} from '../utils/useString';
|
|
16
15
|
import StorageContext from './StorageContext';
|
|
17
|
-
import
|
|
16
|
+
import events, {EventPersistLevel} from '../rtm-events-api';
|
|
18
17
|
import {EventNames} from '../rtm-events';
|
|
19
18
|
import useLocalScreenShareUid from '../utils/useLocalShareScreenUid';
|
|
20
|
-
import {createHook} from '
|
|
19
|
+
import {createHook} from 'customization-implementation';
|
|
21
20
|
import ChatContext from './ChatContext';
|
|
21
|
+
import {useRtc} from 'customization-api';
|
|
22
22
|
|
|
23
23
|
interface UserPreferenceContextInterface {
|
|
24
24
|
displayName: string;
|
|
@@ -34,7 +34,7 @@ const UserPreferenceContext =
|
|
|
34
34
|
const UserPreferenceProvider = (props: {children: React.ReactNode}) => {
|
|
35
35
|
const localUid = useLocalUid();
|
|
36
36
|
const screenShareUid = useLocalScreenShareUid();
|
|
37
|
-
const {dispatch} =
|
|
37
|
+
const {dispatch} = useRtc();
|
|
38
38
|
|
|
39
39
|
const {store, setStore} = useContext(StorageContext);
|
|
40
40
|
const {hasUserJoinedRTM} = useContext(ChatContext);
|
|
@@ -51,8 +51,8 @@ const UserPreferenceProvider = (props: {children: React.ReactNode}) => {
|
|
|
51
51
|
const getScreenShareName = (name: string) => `${name}'s screenshare`;
|
|
52
52
|
|
|
53
53
|
useEffect(() => {
|
|
54
|
-
|
|
55
|
-
const value = JSON.parse(data?.payload
|
|
54
|
+
events.on(EventNames.NAME_ATTRIBUTE, (data) => {
|
|
55
|
+
const value = JSON.parse(data?.payload);
|
|
56
56
|
if (value) {
|
|
57
57
|
if (value?.uid) {
|
|
58
58
|
updateRenderListState(value?.uid, {
|
|
@@ -64,13 +64,13 @@ const UserPreferenceProvider = (props: {children: React.ReactNode}) => {
|
|
|
64
64
|
}
|
|
65
65
|
if (value?.screenShareUid) {
|
|
66
66
|
updateRenderListState(value?.screenShareUid, {
|
|
67
|
-
name: getScreenShareName(value?.name),
|
|
67
|
+
name: getScreenShareName(value?.name || userText),
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
return () => {
|
|
73
|
-
|
|
73
|
+
events.off(EventNames.NAME_ATTRIBUTE);
|
|
74
74
|
};
|
|
75
75
|
}, []);
|
|
76
76
|
|
|
@@ -84,21 +84,22 @@ const UserPreferenceProvider = (props: {children: React.ReactNode}) => {
|
|
|
84
84
|
});
|
|
85
85
|
|
|
86
86
|
//update local state for user and screenshare
|
|
87
|
-
updateRenderListState(localUid, {name: displayName});
|
|
87
|
+
updateRenderListState(localUid, {name: displayName || userText});
|
|
88
88
|
updateRenderListState(screenShareUid, {
|
|
89
|
-
name: getScreenShareName(displayName),
|
|
89
|
+
name: getScreenShareName(displayName || userText),
|
|
90
90
|
});
|
|
91
91
|
|
|
92
92
|
if (hasUserJoinedRTM) {
|
|
93
93
|
//update remote state for user and screenshare
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
events.send(
|
|
95
|
+
EventNames.NAME_ATTRIBUTE,
|
|
96
|
+
JSON.stringify({
|
|
96
97
|
uid: localUid,
|
|
97
98
|
screenShareUid: screenShareUid,
|
|
98
|
-
name: displayName,
|
|
99
|
+
name: displayName || userText,
|
|
99
100
|
}),
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
EventPersistLevel.LEVEL2,
|
|
102
|
+
);
|
|
102
103
|
}
|
|
103
104
|
}, [displayName, hasUserJoinedRTM]);
|
|
104
105
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import NoSleep from 'nosleep.js';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
3
|
+
import isMobileOrTablet from '../utils/isMobileOrTablet';
|
|
4
|
+
import {isWebInternal} from '../utils/common';
|
|
5
5
|
|
|
6
6
|
const useWakeLock = () => {
|
|
7
|
-
if (
|
|
7
|
+
if (isMobileOrTablet() && isWebInternal()) {
|
|
8
8
|
const noSleep = React.useMemo(() => new NoSleep(), []);
|
|
9
9
|
const [awake, set] = React.useState(noSleep.isEnabled);
|
|
10
10
|
|
|
@@ -3,7 +3,7 @@ import {TextDataInterface} from './default-labels/index';
|
|
|
3
3
|
export type I18nBaseType<T = any> = string | ((template: T) => string);
|
|
4
4
|
export type I18nDynamicType = I18nBaseType<string>;
|
|
5
5
|
export type I18nConditionalType = I18nBaseType<boolean>;
|
|
6
|
-
export interface
|
|
6
|
+
export interface I18nInterface {
|
|
7
7
|
locale: string;
|
|
8
8
|
label?: string;
|
|
9
9
|
data: TextDataInterface;
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
information visit https://appbuilder.agora.io.
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
|
-
import {
|
|
12
|
+
import {I18nInterface} from './i18nTypes';
|
|
13
13
|
import {DEFAULT_LABELS} from './default-labels/index';
|
|
14
|
-
export const DEFAULT_I18_DATA:
|
|
14
|
+
export const DEFAULT_I18_DATA: I18nInterface = {
|
|
15
15
|
label: 'English US',
|
|
16
16
|
locale: 'en-us',
|
|
17
17
|
data: DEFAULT_LABELS,
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
12
|
import React, {createContext, useContext, useEffect, useState} from 'react';
|
|
13
|
-
import {createHook} from '
|
|
14
|
-
import {useFpe} from 'fpe-api';
|
|
13
|
+
import {createHook, useCustomization} from 'customization-implementation';
|
|
15
14
|
import {DEFAULT_I18_DATA} from './index';
|
|
16
15
|
import StorageContext from '../components/StorageContext';
|
|
17
16
|
|
|
@@ -31,7 +30,7 @@ const LanguageContext = createContext<LanguageContextInterface>({
|
|
|
31
30
|
|
|
32
31
|
const LanguageProvider = (props: LanguagePropsInterface) => {
|
|
33
32
|
const {store, setStore} = useContext(StorageContext);
|
|
34
|
-
const i18nData =
|
|
33
|
+
const i18nData = useCustomization((data) => data?.i18n);
|
|
35
34
|
|
|
36
35
|
//If language code is stored in the localstorage no longer available in fpe data
|
|
37
36
|
//then we will update the localstorage value to default value
|
|
@@ -20,11 +20,12 @@ import {
|
|
|
20
20
|
import Logo from '../subComponents/Logo';
|
|
21
21
|
import OAuth from '../components/OAuth';
|
|
22
22
|
import Illustration from '../subComponents/Illustration';
|
|
23
|
-
import {
|
|
23
|
+
import {useHasBrandLogo} from '../utils/common';
|
|
24
24
|
import DimensionContext from '../components/dimension/DimensionContext';
|
|
25
25
|
import {useString} from '../utils/useString';
|
|
26
26
|
|
|
27
27
|
const Authenticate = () => {
|
|
28
|
+
const hasBrandLogo = useHasBrandLogo();
|
|
28
29
|
const {getDimensionData} = useContext(DimensionContext);
|
|
29
30
|
const [isDesktop, setIsDesktop] = useState(false);
|
|
30
31
|
let onLayout = (e: LayoutChangeEvent) => {
|
|
@@ -46,7 +47,7 @@ const Authenticate = () => {
|
|
|
46
47
|
style={style.full}
|
|
47
48
|
resizeMode={'cover'}>
|
|
48
49
|
<View style={style.main}>
|
|
49
|
-
<View style={style.nav}>{hasBrandLogo && <Logo />}</View>
|
|
50
|
+
<View style={style.nav}>{hasBrandLogo() && <Logo />}</View>
|
|
50
51
|
<View style={style.content}>
|
|
51
52
|
<View style={style.leftContent}>
|
|
52
53
|
<Text style={style.heading}>{oauthLoginLabel}</Text>
|
|
@@ -21,8 +21,8 @@ import Toast from '../../react-native-toast-message';
|
|
|
21
21
|
import {ErrorContext} from '../components/common';
|
|
22
22
|
import ShareLink from '../components/Share';
|
|
23
23
|
import Logo from '../components/common/Logo';
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
24
|
+
import {isWebInternal, isValidReactComponent} from '../utils/common';
|
|
25
|
+
import {useCustomization} from 'customization-implementation';
|
|
26
26
|
import {useString} from '../utils/useString';
|
|
27
27
|
import useCreateMeeting from '../utils/useCreateMeeting';
|
|
28
28
|
import {CreateProvider} from './create/useCreate';
|
|
@@ -32,7 +32,7 @@ import {MeetingInfoDefaultValue} from '../components/meeting-info/useMeetingInfo
|
|
|
32
32
|
import {useSetMeetingInfo} from '../components/meeting-info/useSetMeetingInfo';
|
|
33
33
|
|
|
34
34
|
const Create = () => {
|
|
35
|
-
const {CreateComponent} =
|
|
35
|
+
const {CreateComponent} = useCustomization((data) => {
|
|
36
36
|
let components: {
|
|
37
37
|
CreateComponent?: React.ElementType;
|
|
38
38
|
} = {};
|
|
@@ -61,9 +61,6 @@ const Create = () => {
|
|
|
61
61
|
const [roomCreated, setRoomCreated] = useState(false);
|
|
62
62
|
const createRoomFun = useCreateMeeting();
|
|
63
63
|
const {setMeetingInfo} = useSetMeetingInfo();
|
|
64
|
-
const {
|
|
65
|
-
meetingPassphrase: {attendee, host, pstn},
|
|
66
|
-
} = useMeetingInfo();
|
|
67
64
|
//commented for v1 release
|
|
68
65
|
// const createdText = useString('meetingCreatedNotificationLabel')();
|
|
69
66
|
// const hostControlsToggle = useString<boolean>('hostControlsToggle');
|
|
@@ -86,17 +83,24 @@ const Create = () => {
|
|
|
86
83
|
const haveMeetingID = 'Have a Meeting ID?';
|
|
87
84
|
|
|
88
85
|
useEffect(() => {
|
|
89
|
-
if (
|
|
86
|
+
if (isWebInternal()) {
|
|
90
87
|
document.title = $config.APP_NAME;
|
|
91
88
|
}
|
|
92
|
-
SDKEvents.on(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
89
|
+
const unbind = SDKEvents.on(
|
|
90
|
+
'joinMeetingWithPhrase',
|
|
91
|
+
(phrase, resolve, reject) => {
|
|
92
|
+
console.log('SDKEvents: joinMeetingWithPhrase event called', phrase);
|
|
93
|
+
try {
|
|
94
|
+
setMeetingInfo(MeetingInfoDefaultValue);
|
|
95
|
+
history.push(phrase);
|
|
96
|
+
resolve();
|
|
97
|
+
} catch (error) {
|
|
98
|
+
reject(error);
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
);
|
|
98
102
|
return () => {
|
|
99
|
-
|
|
103
|
+
unbind();
|
|
100
104
|
};
|
|
101
105
|
}, []);
|
|
102
106
|
|
|
@@ -104,12 +108,6 @@ const Create = () => {
|
|
|
104
108
|
setRoomCreated(true);
|
|
105
109
|
};
|
|
106
110
|
|
|
107
|
-
useEffect(() => {
|
|
108
|
-
if (attendee) {
|
|
109
|
-
SDKEvents.emit('create', host, attendee, pstn);
|
|
110
|
-
}
|
|
111
|
-
}, [attendee]);
|
|
112
|
-
|
|
113
111
|
const createRoomAndNavigateToShare = async (
|
|
114
112
|
roomTitle: string,
|
|
115
113
|
enablePSTN: boolean,
|
|
@@ -17,7 +17,7 @@ import Logo from '../subComponents/Logo';
|
|
|
17
17
|
import {
|
|
18
18
|
isValidReactComponent,
|
|
19
19
|
shouldAuthenticate,
|
|
20
|
-
|
|
20
|
+
useHasBrandLogo,
|
|
21
21
|
} from '../utils/common';
|
|
22
22
|
import LogoutButton from '../subComponents/LogoutButton';
|
|
23
23
|
import PrimaryButton from '../atoms/PrimaryButton';
|
|
@@ -26,12 +26,12 @@ import HorizontalRule from '../atoms/HorizontalRule';
|
|
|
26
26
|
import TextInput from '../atoms/TextInput';
|
|
27
27
|
import Error from '../subComponents/Error';
|
|
28
28
|
import {useString} from '../utils/useString';
|
|
29
|
-
import
|
|
30
|
-
import {useFpe} from 'fpe-api';
|
|
29
|
+
import {useCustomization} from 'customization-implementation';
|
|
31
30
|
import {useSetMeetingInfo} from '../components/meeting-info/useSetMeetingInfo';
|
|
32
31
|
import {MeetingInfoDefaultValue} from '../components/meeting-info/useMeetingInfo';
|
|
33
32
|
|
|
34
33
|
const Join = () => {
|
|
34
|
+
const hasBrandLogo = useHasBrandLogo();
|
|
35
35
|
//commented for v1 release
|
|
36
36
|
// const meetingIdInputPlaceholder = useString('meetingIdInputPlaceholder')();
|
|
37
37
|
// const enterMeetingButton = useString('enterMeetingButton')();
|
|
@@ -41,7 +41,6 @@ const Join = () => {
|
|
|
41
41
|
const createMeetingButton = 'Create Meeting';
|
|
42
42
|
const history = useHistory();
|
|
43
43
|
const [phrase, setPhrase] = useState('');
|
|
44
|
-
const navigateTo = useNavigateTo();
|
|
45
44
|
const [error, setError] = useState<null | {name: string; message: string}>(
|
|
46
45
|
null,
|
|
47
46
|
);
|
|
@@ -52,9 +51,9 @@ const Join = () => {
|
|
|
52
51
|
|
|
53
52
|
const startCall = async () => {
|
|
54
53
|
setMeetingInfo(MeetingInfoDefaultValue);
|
|
55
|
-
|
|
54
|
+
history.push(phrase);
|
|
56
55
|
};
|
|
57
|
-
const {JoinComponent} =
|
|
56
|
+
const {JoinComponent} = useCustomization((data) => {
|
|
58
57
|
let components: {
|
|
59
58
|
JoinComponent?: React.ComponentType;
|
|
60
59
|
} = {};
|
|
@@ -74,7 +73,7 @@ const Join = () => {
|
|
|
74
73
|
) : (
|
|
75
74
|
<ScrollView contentContainerStyle={style.main}>
|
|
76
75
|
<View style={style.nav}>
|
|
77
|
-
{hasBrandLogo && <Logo />}
|
|
76
|
+
{hasBrandLogo() && <Logo />}
|
|
78
77
|
{error ? <Error error={error} /> : <></>}
|
|
79
78
|
</View>
|
|
80
79
|
<View style={style.content}>
|