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
package/template/babel.config.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
12
|
const configVars = require('./configTransform');
|
|
13
|
-
const
|
|
13
|
+
const getCustomizationApiPath = require('./customization.config');
|
|
14
14
|
|
|
15
15
|
// This file is read only by react native for IOS & Android. Doesn't apply to electron, Web targets
|
|
16
16
|
module.exports = {
|
|
@@ -20,14 +20,14 @@ module.exports = {
|
|
|
20
20
|
[
|
|
21
21
|
require.resolve('babel-plugin-module-resolver'),
|
|
22
22
|
{
|
|
23
|
-
root: [
|
|
23
|
+
root: ['./'],
|
|
24
24
|
alias: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
]
|
|
25
|
+
'customization-api': './customization-api/index.ts',
|
|
26
|
+
'customization-implementation':
|
|
27
|
+
'./customization-implementation/index.ts',
|
|
28
|
+
customization: getCustomizationApiPath(),
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
32
|
],
|
|
33
33
|
};
|
|
@@ -31,6 +31,10 @@ import type {
|
|
|
31
31
|
import {VideoProfile} from '../quality';
|
|
32
32
|
import {ChannelProfile, ClientRole} from '../../../agora-rn-uikit';
|
|
33
33
|
import {role, mode} from './Types';
|
|
34
|
+
import {LOG_ENABLED, GEO_FENCING} from '../../../config.json';
|
|
35
|
+
import {Platform} from 'react-native';
|
|
36
|
+
import isMobileOrTablet from '../../../src/utils/isMobileOrTablet';
|
|
37
|
+
|
|
34
38
|
interface MediaDeviceInfo {
|
|
35
39
|
readonly deviceId: string;
|
|
36
40
|
readonly label: string;
|
|
@@ -127,7 +131,7 @@ export enum RnEncryptionEnum {
|
|
|
127
131
|
*
|
|
128
132
|
* @since v3.3.1
|
|
129
133
|
*/
|
|
130
|
-
AES256GCM = 6
|
|
134
|
+
AES256GCM = 6,
|
|
131
135
|
}
|
|
132
136
|
|
|
133
137
|
export enum VideoStreamType {
|
|
@@ -161,11 +165,6 @@ if ($config.LOG_ENABLED) {
|
|
|
161
165
|
AgoraRTC.disableLogUpload();
|
|
162
166
|
}
|
|
163
167
|
|
|
164
|
-
interface CustomEvents {
|
|
165
|
-
ScreenshareStopped: callbackType
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
169
168
|
export default class RtcEngine {
|
|
170
169
|
public appId: string;
|
|
171
170
|
// public AgoraRTC: any;
|
|
@@ -214,20 +213,42 @@ export default class RtcEngine {
|
|
|
214
213
|
this.videoProfile = profile;
|
|
215
214
|
}
|
|
216
215
|
|
|
216
|
+
async enableAudio(): Promise<void> {
|
|
217
|
+
try {
|
|
218
|
+
let localAudio = await AgoraRTC.createMicrophoneAudioTrack({});
|
|
219
|
+
this.localStream.audio = localAudio;
|
|
220
|
+
} catch (e) {
|
|
221
|
+
let audioError = e;
|
|
222
|
+
e.status = {audioError};
|
|
223
|
+
throw e;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
217
227
|
async enableVideo(): Promise<void> {
|
|
228
|
+
/**
|
|
229
|
+
* Issue: Backgrounding the browser or app causes the audio streaming to be cut off.
|
|
230
|
+
* Impact: All browsers and apps that use WKWebView on iOS 15.x, such as Safari and Chrome.
|
|
231
|
+
* Solution:
|
|
232
|
+
* Upgrade to the Web SDK v4.7.3 or later versions.
|
|
233
|
+
* When calling createMicrophoneAudioTrack, set bypassWebAudio as true.
|
|
234
|
+
* The Web SDK directly publishes the local audio stream without processing it through WebAudio.
|
|
235
|
+
*/
|
|
236
|
+
|
|
237
|
+
const audioConfig =
|
|
238
|
+
Platform.OS == 'web' && isMobileOrTablet() ? {bypassWebAudio: true} : {};
|
|
218
239
|
try {
|
|
219
240
|
let [localAudio, localVideo] =
|
|
220
|
-
await AgoraRTC.createMicrophoneAndCameraTracks(
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
);
|
|
241
|
+
await AgoraRTC.createMicrophoneAndCameraTracks(audioConfig, {
|
|
242
|
+
encoderConfig: this.videoProfile,
|
|
243
|
+
});
|
|
224
244
|
this.localStream.audio = localAudio;
|
|
225
245
|
this.localStream.video = localVideo;
|
|
226
246
|
} catch (e) {
|
|
227
247
|
let audioError = false;
|
|
228
248
|
let videoError = false;
|
|
229
249
|
try {
|
|
230
|
-
let localAudio = await AgoraRTC.createMicrophoneAudioTrack(
|
|
250
|
+
let localAudio = await AgoraRTC.createMicrophoneAudioTrack(audioConfig);
|
|
251
|
+
|
|
231
252
|
this.localStream.audio = localAudio;
|
|
232
253
|
} catch (error) {
|
|
233
254
|
audioError = error;
|
|
@@ -673,6 +694,8 @@ export default class RtcEngine {
|
|
|
673
694
|
break;
|
|
674
695
|
case RnEncryptionEnum.SM4128ECB:
|
|
675
696
|
mode = 'sm4-128-ecb';
|
|
697
|
+
default:
|
|
698
|
+
mode = 'none';
|
|
676
699
|
}
|
|
677
700
|
} else {
|
|
678
701
|
mode = 'none';
|
|
@@ -688,7 +711,7 @@ export default class RtcEngine {
|
|
|
688
711
|
},
|
|
689
712
|
): Promise<void> {
|
|
690
713
|
let mode: EncryptionMode;
|
|
691
|
-
mode = this.getEncryptionMode(enabled, config
|
|
714
|
+
mode = this.getEncryptionMode(enabled, config?.encryptionMode);
|
|
692
715
|
try {
|
|
693
716
|
await Promise.all([
|
|
694
717
|
this.client.setEncryptionConfig(mode, config.encryptionKey),
|
|
@@ -784,20 +807,22 @@ export default class RtcEngine {
|
|
|
784
807
|
try {
|
|
785
808
|
console.log('[screenshare]: creating stream');
|
|
786
809
|
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
810
|
+
if (encryption && encryption.screenKey && encryption.mode) {
|
|
811
|
+
let mode: EncryptionMode;
|
|
812
|
+
mode = this.getEncryptionMode(true, encryption?.mode);
|
|
813
|
+
try {
|
|
814
|
+
/**
|
|
815
|
+
* Since version 4.7.0, if client leaves a call
|
|
816
|
+
* and joins again the encryption needs to be
|
|
817
|
+
* set again
|
|
818
|
+
*/
|
|
819
|
+
await this.screenClient.setEncryptionConfig(
|
|
820
|
+
mode,
|
|
821
|
+
encryption.screenKey,
|
|
822
|
+
);
|
|
823
|
+
} catch (e) {
|
|
824
|
+
console.log('e: Encryption for screenshare failed', e);
|
|
825
|
+
}
|
|
801
826
|
}
|
|
802
827
|
|
|
803
828
|
const screenTracks = await AgoraRTC.createScreenVideoTrack(
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//hooks used for create/join meeting
|
|
2
|
+
export {default as useCreateMeeting} from '../src/utils/useCreateMeeting';
|
|
3
|
+
export {default as useJoinMeeting} from '../src/utils/useJoinMeeting';
|
|
4
|
+
|
|
5
|
+
//mute local audio state
|
|
6
|
+
export {
|
|
7
|
+
MUTE_LOCAL_TYPE,
|
|
8
|
+
default as useMuteToggleLocal,
|
|
9
|
+
} from '../src/utils/useMuteToggleLocal';
|
|
10
|
+
|
|
11
|
+
//remove remote user from the call
|
|
12
|
+
export {default as useRemoteEndcall} from '../src/utils/useRemoteEndCall';
|
|
13
|
+
|
|
14
|
+
//mute remote user audio/video
|
|
15
|
+
export {
|
|
16
|
+
default as useRemoteMute,
|
|
17
|
+
MUTE_REMOTE_TYPE,
|
|
18
|
+
} from '../src/utils/useRemoteMute';
|
|
19
|
+
|
|
20
|
+
export {controlMessageEnum} from '../src/components/ChatContext';
|
|
21
|
+
//audio/video toggle state
|
|
22
|
+
export {ToggleState} from '../agora-rn-uikit/src/Contexts/PropsContext';
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Core contexts
|
|
3
3
|
*/
|
|
4
|
-
import {createHook} from '
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
RenderContext,
|
|
8
|
-
PropsContext,
|
|
9
|
-
LocalContext,
|
|
10
|
-
} from '../agora-rn-uikit';
|
|
4
|
+
import {createHook} from 'customization-implementation';
|
|
5
|
+
import {RtcContext, RenderContext} from '../agora-rn-uikit';
|
|
6
|
+
|
|
11
7
|
// commented for v1 release
|
|
12
8
|
//import {default as DeviceContext} from '../src/components/DeviceContext';
|
|
13
9
|
//import {default as StorageContext} from '../src/components/StorageContext';
|
|
14
10
|
|
|
15
|
-
export const
|
|
16
|
-
export const
|
|
17
|
-
export
|
|
18
|
-
|
|
11
|
+
export const useRtc = createHook(RtcContext);
|
|
12
|
+
export const useRender = createHook(RenderContext);
|
|
13
|
+
export {useLocalUserInfo} from '../src/app-state/useLocalUserInfo';
|
|
14
|
+
|
|
19
15
|
// commented for v1 release
|
|
20
16
|
//export const useDeviceContext = createHook(DeviceContext);
|
|
21
17
|
//export const useStorageContext = createHook(StorageContext);
|
|
@@ -40,6 +36,12 @@ export {useRecording} from '../src/subComponents/recording/useRecording';
|
|
|
40
36
|
export type {RecordingContextInterface} from '../src/subComponents/recording/useRecording';
|
|
41
37
|
export {useMeetingInfo} from '../src/components/meeting-info/useMeetingInfo';
|
|
42
38
|
export type {MeetingInfoContextInterface} from '../src/components/meeting-info/useMeetingInfo';
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
export {useChatUIControl} from '../src/components/chat-ui/useChatUIControl';
|
|
40
|
+
export type {ChatUIControlInterface} from '../src/components/chat-ui/useChatUIControl';
|
|
41
|
+
export {useMessages} from '../src/app-state/useMessages';
|
|
42
|
+
export type {messageInterface} from '../src/app-state/useMessages';
|
|
43
|
+
export {SidePanelType} from '../src/subComponents/SidePanelEnum';
|
|
44
|
+
export {useSidePanel} from '../src/utils/useSidePanel';
|
|
45
|
+
|
|
46
|
+
//hook used to get/set username
|
|
47
|
+
export {default as useUserName} from '../src/utils/useUserName';
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
information visit https://appbuilder.agora.io.
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
|
-
import {
|
|
12
|
+
import {CustomizationApiInterface} from './typeDefinition';
|
|
13
13
|
import ReactIs from 'react-is';
|
|
14
14
|
/**
|
|
15
15
|
*
|
|
16
|
-
* @param config
|
|
17
|
-
* @returns
|
|
16
|
+
* @param config customization options to override the UI components and customize the application
|
|
17
|
+
* @returns customization options
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
function isString(data: any) {
|
|
@@ -45,18 +45,28 @@ function isComponent(data: any) {
|
|
|
45
45
|
return false;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
//These keys value are not react component. so doing indexOf and checking whether its function or not
|
|
49
|
+
const ignoreTheseKeys = ['customLayout', 'useUserContext'];
|
|
50
|
+
|
|
48
51
|
function validateComponents(components: any) {
|
|
49
52
|
for (const key in components) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (
|
|
53
|
-
if (isObject(comp)) {
|
|
54
|
-
|
|
53
|
+
if (ignoreTheseKeys.indexOf(key) === -1) {
|
|
54
|
+
let comp = components[key];
|
|
55
|
+
if (comp) {
|
|
56
|
+
if (isComponent(comp) || isObject(comp)) {
|
|
57
|
+
if (isObject(comp)) {
|
|
58
|
+
validateComponents(comp);
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
console.error(
|
|
62
|
+
`Customize:Error ${key} should be a react component or object`,
|
|
63
|
+
);
|
|
55
64
|
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
let comp = components[key];
|
|
68
|
+
if (comp && !isFunction(comp)) {
|
|
69
|
+
console.error(`Customize:Error ${key} should be an function`);
|
|
60
70
|
}
|
|
61
71
|
}
|
|
62
72
|
}
|
|
@@ -67,7 +77,7 @@ function validateLifecycle(data: any) {
|
|
|
67
77
|
const callback = data[key];
|
|
68
78
|
if (callback && !isFunction(callback)) {
|
|
69
79
|
console.error(
|
|
70
|
-
`
|
|
80
|
+
`Customize:Error ${key} should be a function that return async function`,
|
|
71
81
|
);
|
|
72
82
|
}
|
|
73
83
|
}
|
|
@@ -75,20 +85,14 @@ function validateLifecycle(data: any) {
|
|
|
75
85
|
|
|
76
86
|
function validateCustomRoutes(routes: any) {
|
|
77
87
|
if (routes && !Array.isArray(routes)) {
|
|
78
|
-
console.error(`
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function validateAppRoot(data: any) {
|
|
83
|
-
if (data && !isComponent(data)) {
|
|
84
|
-
console.error(`InstallFPE:Error appRoot should be a react component`);
|
|
88
|
+
console.error(`Customize:Error customRoutes should be an array`);
|
|
85
89
|
}
|
|
86
90
|
}
|
|
87
91
|
|
|
88
92
|
function validatei18n(data: any) {
|
|
89
93
|
if (data) {
|
|
90
94
|
if (!Array.isArray(data)) {
|
|
91
|
-
console.error(`
|
|
95
|
+
console.error(`Customize:Error i18n should be an array`);
|
|
92
96
|
} else {
|
|
93
97
|
data.map((item) => {
|
|
94
98
|
const langData = item.data;
|
|
@@ -97,7 +101,7 @@ function validatei18n(data: any) {
|
|
|
97
101
|
if (value) {
|
|
98
102
|
if (!(isString(value) || isFunction(value))) {
|
|
99
103
|
console.error(
|
|
100
|
-
`
|
|
104
|
+
`Customize:Error ${item.locale} ${key} should be a string or function`,
|
|
101
105
|
);
|
|
102
106
|
}
|
|
103
107
|
}
|
|
@@ -106,7 +110,7 @@ function validatei18n(data: any) {
|
|
|
106
110
|
}
|
|
107
111
|
}
|
|
108
112
|
}
|
|
109
|
-
export const
|
|
113
|
+
export const customize = (config: CustomizationApiInterface) => {
|
|
110
114
|
//validating the components
|
|
111
115
|
config?.components && validateComponents(config.components);
|
|
112
116
|
|
|
@@ -114,9 +118,6 @@ export const installFPE = (config: FpeApiInterface) => {
|
|
|
114
118
|
//commented for v1 release
|
|
115
119
|
//config?.customRoutes && validateCustomRoutes(config.customRoutes);
|
|
116
120
|
|
|
117
|
-
//validating the app root
|
|
118
|
-
config?.appRoot && validateAppRoot(config.appRoot);
|
|
119
|
-
|
|
120
121
|
//validating the i18n
|
|
121
122
|
config?.i18n && validatei18n(config.i18n);
|
|
122
123
|
|
|
@@ -9,13 +9,18 @@
|
|
|
9
9
|
information visit https://appbuilder.agora.io.
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
|
-
import fpeConfig from 'test-fpe';
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
// TODO: Investigate further
|
|
14
|
+
// Exported like so to prevent error while bundling as react-sdk. Cause: some webpack Edgecase
|
|
15
|
+
import {customize} from './customize';
|
|
16
|
+
import configJSON from '../config.json';
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export
|
|
18
|
+
let $config = configJSON as unknown as ConfigInterface;
|
|
19
|
+
|
|
20
|
+
export {customize, $config};
|
|
21
|
+
export * from './action-library';
|
|
22
|
+
export * from './app-state';
|
|
23
|
+
export * from './customEvents';
|
|
24
|
+
export * from './sub-components';
|
|
19
25
|
export * from './typeDefinition';
|
|
20
26
|
export * from './utils';
|
|
21
|
-
export * from './fpeEvents';
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
//Common components
|
|
2
|
+
export {default as HorizontalRule} from '../src/atoms/HorizontalRule';
|
|
3
|
+
export {default as PrimaryButton} from '../src/atoms/PrimaryButton';
|
|
4
|
+
export {default as SecondaryButton} from '../src/atoms/SecondaryButton';
|
|
5
|
+
export {default as TextInput} from '../src/atoms/TextInput';
|
|
1
6
|
//Icons
|
|
2
7
|
export {default as icons} from '../src/assets/icons';
|
|
3
8
|
|
|
@@ -18,15 +23,21 @@ export {
|
|
|
18
23
|
ParticipantsView,
|
|
19
24
|
Controls,
|
|
20
25
|
ControlsComponentsArray,
|
|
26
|
+
Navbar,
|
|
27
|
+
NavBarComponentsArray,
|
|
21
28
|
ChatBubble,
|
|
29
|
+
ChatSendButton,
|
|
30
|
+
ChatTextInput,
|
|
31
|
+
Chat,
|
|
32
|
+
SettingsView,
|
|
22
33
|
} from '../src/pages/video-call/index';
|
|
23
34
|
export {default as GridLayout} from '../src/components/GridVideo';
|
|
24
35
|
export {default as PinnedLayout} from '../src/components/PinnedVideo';
|
|
25
36
|
export {default as VideoComponent} from '../src/pages/video-call/VideoComponent';
|
|
26
|
-
export {
|
|
37
|
+
export {default as MaxVideoView} from '../src/pages/video-call/VideoRenderer';
|
|
27
38
|
export {default as RenderComponent} from '../src/pages/video-call/RenderComponent';
|
|
28
|
-
export {
|
|
29
|
-
export {NetworkQualityPill} from '../src/subComponents/NetworkQualityPill';
|
|
39
|
+
export {default as NameWithMicIcon} from '../src/pages/video-call/NameWithMicIcon';
|
|
40
|
+
export {default as NetworkQualityPill} from '../src/subComponents/NetworkQualityPill';
|
|
30
41
|
//videocall screen
|
|
31
42
|
export {default as VideocallScreen} from '../src/pages/video-call/VideoCallScreen';
|
|
32
43
|
|
|
@@ -41,3 +52,11 @@ export {default as VideocallScreen} from '../src/pages/video-call/VideoCallScree
|
|
|
41
52
|
|
|
42
53
|
//Sidepanel buttons
|
|
43
54
|
export {SidePanelButtonsArray} from '../src/subComponents/SidePanelButtons';
|
|
55
|
+
export {
|
|
56
|
+
ImageIcon as UiKitImageIcon,
|
|
57
|
+
MaxVideoView as UiKitMaxVideoView,
|
|
58
|
+
BtnTemplate as UiKitBtnTemplate,
|
|
59
|
+
ClientRole as UikitClientRole,
|
|
60
|
+
ChannelProfile as UikitChannelProfile,
|
|
61
|
+
} from '../agora-rn-uikit';
|
|
62
|
+
export type {BtnTemplateInterface as UikitBtnTemplateInterface} from '../agora-rn-uikit';
|
|
@@ -17,8 +17,9 @@ import {
|
|
|
17
17
|
RenderStateInterface,
|
|
18
18
|
UidType,
|
|
19
19
|
} from '../agora-rn-uikit';
|
|
20
|
-
import {
|
|
20
|
+
import {I18nInterface} from '../src/language/i18nTypes';
|
|
21
21
|
import {IconsInterface} from '../agora-rn-uikit/src/Controls/Icons';
|
|
22
|
+
export type {RenderInterface, RenderStateInterface, UidType};
|
|
22
23
|
export type {
|
|
23
24
|
ChatTextInputProps,
|
|
24
25
|
ChatSendButtonProps,
|
|
@@ -49,9 +50,8 @@ export interface ChatCmpInterface {
|
|
|
49
50
|
//commented for v1 release
|
|
50
51
|
//extends BeforeAndAfterInterface
|
|
51
52
|
chatBubble?: React.ComponentType<ChatBubbleProps>;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
//chatSentButton?: React.ComponentType<ChatSendButtonProps>;
|
|
53
|
+
chatInput?: React.ComponentType<ChatTextInputProps>;
|
|
54
|
+
chatSendButton?: React.ComponentType<ChatSendButtonProps>;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
export interface renderComponentInterface {
|
|
@@ -63,7 +63,7 @@ export interface renderComponentObjectInterface {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
export type layoutComponent = React.ComponentType<{
|
|
66
|
-
renderData: RenderStateInterface['
|
|
66
|
+
renderData: RenderStateInterface['activeUids'];
|
|
67
67
|
}>;
|
|
68
68
|
|
|
69
69
|
export interface layoutObjectBase {
|
|
@@ -84,16 +84,21 @@ export type layoutObjectType = layoutObjectWithIcon | layoutObjectWithIconName;
|
|
|
84
84
|
|
|
85
85
|
export interface VideoCallInterface extends BeforeAndAfterInterface {
|
|
86
86
|
// commented for v1 release
|
|
87
|
-
|
|
87
|
+
topBar?: React.ComponentType;
|
|
88
88
|
//settingsPanel?: React.ComponentType;
|
|
89
89
|
participantsPanel?: React.ComponentType;
|
|
90
90
|
bottomBar?: React.ComponentType;
|
|
91
91
|
chat?: ChatCmpInterface;
|
|
92
92
|
customContent?: renderComponentObjectInterface;
|
|
93
93
|
customLayout?: (layouts: layoutObjectType[]) => layoutObjectType[];
|
|
94
|
+
useUserContext?: () => void;
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
export type ComponentsInterface = {
|
|
98
|
+
/**
|
|
99
|
+
* Custom context/api provider wrapped in root level
|
|
100
|
+
*/
|
|
101
|
+
appRoot?: React.ComponentType;
|
|
97
102
|
// commented for v1 release
|
|
98
103
|
//precall?: PreCallInterface | React.ComponentType;
|
|
99
104
|
//create?: React.ComponentType;
|
|
@@ -114,7 +119,7 @@ export interface CustomRoutesInterface {
|
|
|
114
119
|
|
|
115
120
|
export type CustomHookType = () => () => Promise<void>;
|
|
116
121
|
|
|
117
|
-
export interface
|
|
122
|
+
export interface CustomizationApiInterface {
|
|
118
123
|
/**
|
|
119
124
|
* components used to replace whole screen or subcomponents
|
|
120
125
|
*/
|
|
@@ -124,14 +129,10 @@ export interface FpeApiInterface {
|
|
|
124
129
|
*/
|
|
125
130
|
// commented for v1 release
|
|
126
131
|
//customRoutes?: CustomRoutesInterface[];
|
|
127
|
-
/**
|
|
128
|
-
* Custom context/api provider wrapped in root level
|
|
129
|
-
*/
|
|
130
|
-
appRoot?: React.ComponentType;
|
|
131
132
|
/**
|
|
132
133
|
* Internationlization
|
|
133
134
|
*/
|
|
134
|
-
i18n?:
|
|
135
|
+
i18n?: I18nInterface[];
|
|
135
136
|
/**
|
|
136
137
|
* Life cycle events
|
|
137
138
|
*/
|
|
@@ -140,6 +141,4 @@ export interface FpeApiInterface {
|
|
|
140
141
|
// useBeforeJoin?: CustomHookType;
|
|
141
142
|
// useBeforeCreate?: CustomHookType;
|
|
142
143
|
// };
|
|
143
|
-
// commented for v1 release
|
|
144
|
-
//customUserContext?: () => any;
|
|
145
144
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
********************************************
|
|
3
|
+
Copyright © 2021 Agora Lab, Inc., all rights reserved.
|
|
4
|
+
AppBuilder and all associated components, source code, APIs, services, and documentation
|
|
5
|
+
(the “Materials”) are owned by Agora Lab, Inc. and its licensors. The Materials may not be
|
|
6
|
+
accessed, used, modified, or distributed for any purpose without a license from Agora Lab, Inc.
|
|
7
|
+
Use without a license or in violation of any license terms and conditions (including use for
|
|
8
|
+
any purpose competitive to Agora Lab, Inc.’s business) is strictly prohibited. For more
|
|
9
|
+
information visit https://appbuilder.agora.io.
|
|
10
|
+
*********************************************
|
|
11
|
+
*/
|
|
12
|
+
// commented for v1 release
|
|
13
|
+
//export {default as useIsScreenShare} from '../src/utils/useIsScreenShare';
|
|
14
|
+
|
|
15
|
+
//hooks used to check user type
|
|
16
|
+
export {default as useIsHost} from '../src/utils/useIsHost';
|
|
17
|
+
export {default as useIsAttendee} from '../src/utils/useIsAttendee';
|
|
18
|
+
export {default as useIsPSTN} from '../src/utils/useIsPSTN';
|
|
19
|
+
|
|
20
|
+
//hook to manage audio/video states
|
|
21
|
+
export {default as useIsAudioEnabled} from '../src/utils/useIsAudioEnabled';
|
|
22
|
+
export {default as useIsVideoEnabled} from '../src/utils/useIsVideoEnabled';
|
|
23
|
+
|
|
24
|
+
//hooks used for navigation
|
|
25
|
+
export {useHistory, useParams} from '../src/components/Router';
|
|
26
|
+
|
|
27
|
+
//export common function
|
|
28
|
+
export {isWeb, isIOS, isAndroid, isDestop} from '../src/utils/common';
|
|
29
|
+
export {default as isMobileOrTablet} from '../src/utils/isMobileOrTablet';
|
|
30
|
+
export {useLocalUid} from '../agora-rn-uikit';
|
|
File without changes
|
package/template/{fpe-implementation/dummyFpe.ts → customization-implementation/dummyConfig.ts}
RENAMED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
information visit https://appbuilder.agora.io.
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
|
-
import {
|
|
12
|
+
import {customize} from 'customization-api';
|
|
13
13
|
/**
|
|
14
|
-
* Dummy
|
|
14
|
+
* Dummy Config used to load when project doesn't have the customization.
|
|
15
15
|
*/
|
|
16
|
-
const
|
|
17
|
-
export default
|
|
16
|
+
const dummyConfig = customize({});
|
|
17
|
+
export default dummyConfig;
|
|
@@ -10,26 +10,26 @@
|
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
12
|
import React from 'react';
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
13
|
+
import {CustomizationApiInterface} from 'customization-api';
|
|
14
|
+
import customizationConfig from 'customization';
|
|
15
|
+
import createHook from './createHook';
|
|
16
16
|
|
|
17
|
-
const
|
|
18
|
-
React.createContext(
|
|
17
|
+
const CustomizationContext: React.Context<CustomizationApiInterface> =
|
|
18
|
+
React.createContext(customizationConfig);
|
|
19
19
|
|
|
20
|
-
export interface
|
|
20
|
+
export interface CustomizationProviderProps {
|
|
21
21
|
children: React.ReactNode;
|
|
22
|
-
value:
|
|
22
|
+
value: CustomizationApiInterface;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
const
|
|
25
|
+
const CustomizationProvider = (props: CustomizationProviderProps) => {
|
|
26
26
|
return (
|
|
27
|
-
<
|
|
27
|
+
<CustomizationContext.Provider value={props.value}>
|
|
28
28
|
{props.children}
|
|
29
|
-
</
|
|
29
|
+
</CustomizationContext.Provider>
|
|
30
30
|
);
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
const
|
|
33
|
+
const useCustomization = createHook(CustomizationContext);
|
|
34
34
|
|
|
35
|
-
export {
|
|
35
|
+
export {useCustomization, CustomizationProvider};
|
|
@@ -11,19 +11,19 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
/*
|
|
14
|
-
|
|
14
|
+
getCustomizationApiPath - will return customization if exists otherwise it will return the dummy customization path
|
|
15
15
|
*/
|
|
16
16
|
const fs = require('fs');
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
if (fs.existsSync(
|
|
22
|
-
return
|
|
17
|
+
const customizationPathTs = './customization/index.ts';
|
|
18
|
+
const customizationPathTsx = './customization/index.tsx';
|
|
19
|
+
const customizationDummyPath = './customization-implementation/dummyConfig.ts';
|
|
20
|
+
const getCustomizationApiPath = () => {
|
|
21
|
+
if (fs.existsSync(customizationPathTs)) {
|
|
22
|
+
return customizationPathTs;
|
|
23
23
|
}
|
|
24
|
-
if (fs.existsSync(
|
|
25
|
-
return
|
|
24
|
+
if (fs.existsSync(customizationPathTsx)) {
|
|
25
|
+
return customizationPathTsx;
|
|
26
26
|
}
|
|
27
|
-
return
|
|
27
|
+
return customizationDummyPath;
|
|
28
28
|
};
|
|
29
|
-
module.exports =
|
|
29
|
+
module.exports = getCustomizationApiPath;
|