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
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
// --------------------------------------------------------
|
|
3
3
|
// Use with webpack loader
|
|
4
|
-
// "files":["./
|
|
4
|
+
// "files":["./customization-api/index.ts","./global.d.ts","./bridge/rtm/web/index.ts","./bridge/rtc/webNg/index.ts"],
|
|
5
5
|
// --------------------------------------------------------
|
|
6
6
|
// Use with typescript tsc command
|
|
7
|
-
"files":["./
|
|
7
|
+
"files": ["./customization-api/index.ts", "./global.d.ts"],
|
|
8
8
|
// --------------------------------------------------------
|
|
9
9
|
"compilerOptions": {
|
|
10
10
|
/* Basic Options */
|
|
@@ -83,21 +83,20 @@
|
|
|
83
83
|
"agora-react-native-rtm": ["./bridge/rtm/web/index.ts"],
|
|
84
84
|
"react-native-agora": ["./bridge/rtc/webNg/index.ts"],
|
|
85
85
|
"react-native": ["react-native-web"],
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
|
|
86
|
+
"customization-api": ["./customization-api/index.ts"],
|
|
87
|
+
"customization-implementation": [
|
|
88
|
+
"./customization-implementation/index.ts"
|
|
89
|
+
],
|
|
89
90
|
"./RtcContext": ["agora-rn-uikit/src/index"]
|
|
90
91
|
}
|
|
91
92
|
// --------------------------------------------------------
|
|
92
93
|
},
|
|
93
|
-
// "references": [{"path": "./
|
|
94
|
+
// "references": [{"path": "./customization-api", "prepend": true}],
|
|
94
95
|
"exclude": [
|
|
95
96
|
//"node_modules",
|
|
96
97
|
"babel.config.js",
|
|
97
98
|
"metro.config.js",
|
|
98
99
|
"jest.config.js"
|
|
99
100
|
],
|
|
100
|
-
"include": [
|
|
101
|
-
"node_modules/agora"
|
|
102
|
-
]
|
|
101
|
+
"include": ["node_modules/agora"]
|
|
103
102
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
// --------------------------------------------------------
|
|
3
3
|
// Use with webpack loader
|
|
4
|
-
// "files":["./
|
|
4
|
+
// "files":["./customization-api/index.ts","./global.d.ts","./bridge/rtm/web/index.ts","./bridge/rtc/webNg/index.ts"],
|
|
5
5
|
// --------------------------------------------------------
|
|
6
6
|
// Use with typescript tsc command
|
|
7
|
-
"files":["./src/SDKAppWrapper.tsx","./index.rsdk.tsx","./global.d.ts"],
|
|
7
|
+
"files": ["./src/SDKAppWrapper.tsx", "./index.rsdk.tsx", "./global.d.ts"],
|
|
8
8
|
// --------------------------------------------------------
|
|
9
9
|
"compilerOptions": {
|
|
10
10
|
/* Basic Options */
|
|
@@ -85,21 +85,20 @@
|
|
|
85
85
|
"agora-react-native-rtm": ["./bridge/rtm/web/index.ts"],
|
|
86
86
|
"react-native-agora": ["./bridge/rtc/webNg/index.ts"],
|
|
87
87
|
"react-native": ["react-native-web"],
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
|
|
88
|
+
"customization-api": ["./customization-api/index.ts"],
|
|
89
|
+
"customization-implementation": [
|
|
90
|
+
"./customization-implementation/index.ts"
|
|
91
|
+
],
|
|
91
92
|
"./RtcContext": ["agora-rn-uikit/src/index"]
|
|
92
93
|
}
|
|
93
94
|
// --------------------------------------------------------
|
|
94
95
|
},
|
|
95
|
-
// "references": [{"path": "./
|
|
96
|
+
// "references": [{"path": "./customization-api", "prepend": true}],
|
|
96
97
|
"exclude": [
|
|
97
98
|
//"node_modules",
|
|
98
99
|
"babel.config.js",
|
|
99
100
|
"metro.config.js",
|
|
100
101
|
"jest.config.js"
|
|
101
102
|
],
|
|
102
|
-
"include": [
|
|
103
|
-
"node_modules/agora"
|
|
104
|
-
]
|
|
103
|
+
"include": ["node_modules/agora"]
|
|
105
104
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
// --------------------------------------------------------
|
|
3
3
|
// Use with webpack loader
|
|
4
|
-
// "files":["./
|
|
4
|
+
// "files":["./customization-api/index.ts","./global.d.ts","./bridge/rtm/web/index.ts","./bridge/rtc/webNg/index.ts"],
|
|
5
5
|
// --------------------------------------------------------
|
|
6
6
|
// Use with typescript tsc command
|
|
7
|
-
"files":["./src/SDKAppWrapper.tsx","./index.wsdk.tsx","./global.d.ts"],
|
|
7
|
+
"files": ["./src/SDKAppWrapper.tsx", "./index.wsdk.tsx", "./global.d.ts"],
|
|
8
8
|
// --------------------------------------------------------
|
|
9
9
|
"compilerOptions": {
|
|
10
10
|
/* Basic Options */
|
|
@@ -84,21 +84,20 @@
|
|
|
84
84
|
"agora-react-native-rtm": ["./bridge/rtm/web/index.ts"],
|
|
85
85
|
"react-native-agora": ["./bridge/rtc/webNg/index.ts"],
|
|
86
86
|
"react-native": ["react-native-web"],
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
|
|
87
|
+
"customization-api": ["./customization-api/index.ts"],
|
|
88
|
+
"customization-implementation": [
|
|
89
|
+
"./customization-implementation/index.ts"
|
|
90
|
+
],
|
|
90
91
|
"./RtcContext": ["agora-rn-uikit/src/index"]
|
|
91
92
|
}
|
|
92
93
|
// --------------------------------------------------------
|
|
93
94
|
},
|
|
94
|
-
// "references": [{"path": "./
|
|
95
|
+
// "references": [{"path": "./customization-api", "prepend": true}],
|
|
95
96
|
"exclude": [
|
|
96
97
|
//"node_modules",
|
|
97
98
|
"babel.config.js",
|
|
98
99
|
"metro.config.js",
|
|
99
100
|
"jest.config.js"
|
|
100
101
|
],
|
|
101
|
-
"include": [
|
|
102
|
-
"node_modules/agora"
|
|
103
|
-
]
|
|
102
|
+
"include": ["node_modules/agora"]
|
|
104
103
|
}
|
|
@@ -19,7 +19,7 @@ const isDevelopment = process.env.NODE_ENV === 'development';
|
|
|
19
19
|
const path = require('path');
|
|
20
20
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
21
21
|
const configVars = require('./configTransform');
|
|
22
|
-
const
|
|
22
|
+
const getCustomizationApiPath = require('./customization.config');
|
|
23
23
|
|
|
24
24
|
const isElectron = ['linux', 'windows', 'mac'].includes(process.env.TARGET);
|
|
25
25
|
const isReactSdk = process.env.TARGET === 'rsdk';
|
|
@@ -33,9 +33,7 @@ module.exports = {
|
|
|
33
33
|
!isSdk &&
|
|
34
34
|
new HtmlWebpackPlugin({
|
|
35
35
|
title: configVars['$config.APP_NAME'],
|
|
36
|
-
template: isElectron
|
|
37
|
-
? 'electron/index.html'
|
|
38
|
-
: 'web/index.html',
|
|
36
|
+
template: isElectron ? 'electron/index.html' : 'web/index.html',
|
|
39
37
|
}),
|
|
40
38
|
isDevelopment &&
|
|
41
39
|
!isSdk &&
|
|
@@ -55,10 +53,12 @@ module.exports = {
|
|
|
55
53
|
// Using rtc bridge to translate React Native RTC SDK calls to web SDK calls for web and linux
|
|
56
54
|
// Using rtc bridge to translate React Native RTC SDK calls to electron SDK calls for windows and mac
|
|
57
55
|
'react-native-agora$': path.join(__dirname, 'bridge/rtc/webNg/index.ts'),
|
|
58
|
-
'
|
|
59
|
-
'
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
'customization-api': path.join(__dirname, 'customization-api/index.ts'),
|
|
57
|
+
'customization-implementation': path.join(
|
|
58
|
+
__dirname,
|
|
59
|
+
'customization-implementation/index.ts',
|
|
60
|
+
),
|
|
61
|
+
customization: path.join(__dirname, getCustomizationApiPath()),
|
|
62
62
|
'agora-react-native-rtm/lib/typescript/src': path.join(
|
|
63
63
|
__dirname,
|
|
64
64
|
'bridge/rtm/web/index.ts',
|
|
@@ -85,7 +85,7 @@ module.exports = {
|
|
|
85
85
|
].filter(Boolean),
|
|
86
86
|
},
|
|
87
87
|
// Enable source maps during development
|
|
88
|
-
|
|
88
|
+
devtool: isDevelopment ? 'eval-cheap-module-source-map' : undefined,
|
|
89
89
|
module: {
|
|
90
90
|
rules: [
|
|
91
91
|
{
|
|
@@ -7,6 +7,7 @@ const isDevelopment = process.env.NODE_ENV === 'development';
|
|
|
7
7
|
module.exports = merge(commons, {
|
|
8
8
|
// Enable optimizations in production
|
|
9
9
|
mode: isDevelopment ? 'development' : 'production',
|
|
10
|
+
devtool: isDevelopment ? 'eval-cheap-module-source-map' : 'source-map',
|
|
10
11
|
// externals: [
|
|
11
12
|
// nodeExternals({allowlist: [/agora.*/, /fpe.*/]}),
|
|
12
13
|
// ],
|
|
@@ -16,6 +17,7 @@ module.exports = merge(commons, {
|
|
|
16
17
|
'react-router': 'react-router',
|
|
17
18
|
'react-router-dom': 'react-router-dom',
|
|
18
19
|
'@apollo/client': '@apollo/client',
|
|
20
|
+
nanoid: 'nanoid',
|
|
19
21
|
},
|
|
20
22
|
// Main entry point for the web application
|
|
21
23
|
entry: {
|
|
@@ -25,9 +27,9 @@ module.exports = merge(commons, {
|
|
|
25
27
|
output: {
|
|
26
28
|
path: path.resolve(__dirname, `../Builds/react-sdk`),
|
|
27
29
|
filename: 'index.js',
|
|
28
|
-
library:{
|
|
30
|
+
library: {
|
|
29
31
|
type: 'commonjs2',
|
|
30
|
-
}
|
|
32
|
+
},
|
|
31
33
|
},
|
|
32
34
|
// watch: isDevelopment
|
|
33
35
|
});
|
|
@@ -20,8 +20,8 @@ module.exports = merge(commons, {
|
|
|
20
20
|
// Enable optimizations in production
|
|
21
21
|
mode: isDevelopment ? 'development' : 'production',
|
|
22
22
|
// Main entry point for the web application
|
|
23
|
-
module:{
|
|
24
|
-
rules:[
|
|
23
|
+
module: {
|
|
24
|
+
rules: [
|
|
25
25
|
{
|
|
26
26
|
test: /\.tsx?$/,
|
|
27
27
|
loader: 'ts-loader',
|
|
@@ -29,9 +29,9 @@ module.exports = merge(commons, {
|
|
|
29
29
|
exclude: /node_modules|\.d\.ts$/,
|
|
30
30
|
options: {
|
|
31
31
|
configFile: 'tsconfig.json',
|
|
32
|
-
ignoreDiagnostics: [2339,2554,2539,1005]
|
|
32
|
+
ignoreDiagnostics: [2339, 2554, 2539, 1005],
|
|
33
33
|
// ignoreDiagnostics: [2554,2539,2339,2551,2769,2305,2614,2322,2362,2369,2698]
|
|
34
|
-
}
|
|
34
|
+
},
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
// Use babel to transpile all js, ts, jsx and tsx files
|
|
@@ -78,10 +78,10 @@ module.exports = merge(commons, {
|
|
|
78
78
|
},
|
|
79
79
|
],
|
|
80
80
|
},
|
|
81
|
-
]
|
|
81
|
+
],
|
|
82
82
|
},
|
|
83
83
|
entry: {
|
|
84
|
-
main: './
|
|
84
|
+
main: './customization-api/index.ts',
|
|
85
85
|
},
|
|
86
86
|
output: {
|
|
87
87
|
path: path.resolve(__dirname, `../Builds/ts`),
|
|
@@ -9,6 +9,8 @@ const libraryTargets = ['commonjs2', 'var','umd2'];
|
|
|
9
9
|
const baseConfig = {
|
|
10
10
|
// Enable optimizations in production
|
|
11
11
|
mode: isDevelopment ? 'development' : 'production',
|
|
12
|
+
// Angular doesn't support cheap-eval-module-source-maps
|
|
13
|
+
devtool:'source-map',
|
|
12
14
|
// Main entry point for the web application
|
|
13
15
|
entry: {
|
|
14
16
|
main: './index.wsdk.tsx',
|
|
@@ -20,7 +22,6 @@ const baseConfig = {
|
|
|
20
22
|
name: 'AgoraAppBuilder',
|
|
21
23
|
},
|
|
22
24
|
},
|
|
23
|
-
watch: isDevelopment
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
const mappedConfigs = libraryTargets.map((target, _) => {
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// 1. Import customEvents
|
|
2
|
-
import CustomEvents from '../src/custom-events/CustomEvents';
|
|
3
|
-
import {EventSourceEnum} from '../src/custom-events';
|
|
4
|
-
|
|
5
|
-
// 2. Initialize with source "fpe"
|
|
6
|
-
const fpeEvents = new CustomEvents(EventSourceEnum.fpe);
|
|
7
|
-
|
|
8
|
-
// 3. export
|
|
9
|
-
export {fpeEvents as CustomEvents};
|
|
@@ -1,61 +0,0 @@
|
|
|
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/isScreenShareUser';
|
|
14
|
-
export {default as useIsHost} from '../src/utils/isHostUser';
|
|
15
|
-
export {default as useIsAttendee} from '../src/utils/IsAttendeeUser';
|
|
16
|
-
export {default as useIsPSTN} from '../src/utils/isPSTNUser';
|
|
17
|
-
export {default as useUserList} from '../src/utils/useUserList';
|
|
18
|
-
// commented for v1 release
|
|
19
|
-
//export {default as useGroupMessages} from '../src/utils/useGroupMessages';
|
|
20
|
-
//export {default as usePrivateMessages} from '../src/utils/usePrivateMessages';
|
|
21
|
-
export {default as useIsAudioEnabled} from '../src/utils/isAudioEnabled';
|
|
22
|
-
export {default as useIsVideoEnabled} from '../src/utils/isVideoEnabled';
|
|
23
|
-
export {default as useSetName} from '../src/utils/useSetName';
|
|
24
|
-
export {default as useGetName} from '../src/utils/useGetName';
|
|
25
|
-
export {useSidePanel} from '../src/utils/useSidePanel';
|
|
26
|
-
// commented for v1 release
|
|
27
|
-
// export {
|
|
28
|
-
// default as useUnreadMessageCount,
|
|
29
|
-
// UNREAD_MESSAGE_COUNT_TYPE,
|
|
30
|
-
// } from '../src/utils/useUnreadMessageCount';
|
|
31
|
-
// export {
|
|
32
|
-
// default as useSetUnreadMessageCount,
|
|
33
|
-
// SET_UNREAD_MESSAGE_COUNT_TYPE,
|
|
34
|
-
// } from '../src/utils/useSetUnreadMessageCount';
|
|
35
|
-
export {default as useNavigateTo} from '../src/utils/useNavigateTo';
|
|
36
|
-
export {default as useNavParams} from '../src/utils/useNavParams';
|
|
37
|
-
export {default as useCreateMeeting} from '../src/utils/useCreateMeeting';
|
|
38
|
-
export {default as useJoinMeeting} from '../src/utils/useJoinMeeting';
|
|
39
|
-
// commented for v1 release
|
|
40
|
-
// export {
|
|
41
|
-
// default as useSendMessage,
|
|
42
|
-
// MESSAGE_TYPE,
|
|
43
|
-
// } from '../src/utils/useSendMessage';
|
|
44
|
-
// export {controlMessageEnum} from '../src/components/ChatContext';
|
|
45
|
-
// export {
|
|
46
|
-
// default as useSendControlMessage,
|
|
47
|
-
// CONTROL_MESSAGE_TYPE,
|
|
48
|
-
// } from '../src/utils/useSendControlMessage';
|
|
49
|
-
export {
|
|
50
|
-
MUTE_LOCAL_TYPE,
|
|
51
|
-
default as useMuteToggleLocal,
|
|
52
|
-
} from '../src/utils/useMuteToggleLocal';
|
|
53
|
-
export {default as useRemoteEndcall} from '../src/utils/useRemoteEndCall';
|
|
54
|
-
export {
|
|
55
|
-
default as useRemoteMute,
|
|
56
|
-
MUTE_REMOTE_TYPE,
|
|
57
|
-
} from '../src/utils/useRemoteMute';
|
|
58
|
-
export {ToggleState} from '../agora-rn-uikit/src/Contexts/PropsContext';
|
|
59
|
-
|
|
60
|
-
//export common function
|
|
61
|
-
export * from '../src/utils/common';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as createHook } from './createHook';
|
package/template/fpe-todo.txt
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
1. test-fpe name should be changed
|
|
2
|
-
- template/_gitignore
|
|
3
|
-
- babel.config.js
|
|
4
|
-
- webpack.config.js
|
|
5
|
-
- fpe.config.js
|
|
6
|
-
- fpe-api index.ts
|
|
7
|
-
- fpe-api useFPE
|
|
8
|
-
2. What if user called custom context without wrapping provider
|
|
9
|
-
- useContext will return the default vaule. so we can't identify whether is wrapped with the provider or not.
|
|
10
|
-
3. CustomUserContext
|
|
11
|
-
4. Add sibling into view without overriding
|
|
12
|
-
5. Translation labels
|
|
13
|
-
- some of keys
|
|
14
|
-
6.Layout dropdown implementation
|
|
@@ -1,84 +0,0 @@
|
|
|
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
|
-
|
|
13
|
-
import {messageChannelType, messageEventInterface} from './ChatContext';
|
|
14
|
-
|
|
15
|
-
const RTM_ERROR_TEMPLATE = 'RTMError:';
|
|
16
|
-
|
|
17
|
-
type eventsMapInterface = {
|
|
18
|
-
[key in messageChannelType]: Record<string, any>;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
type errorObjectInterface = {
|
|
22
|
-
msg: string;
|
|
23
|
-
cause: any;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
type eventKeyType = keyof eventsMapInterface;
|
|
27
|
-
|
|
28
|
-
const eventsMap: eventsMapInterface = {
|
|
29
|
-
[messageChannelType.Private]: new Map<string, any>(),
|
|
30
|
-
[messageChannelType.Public]: new Map<string, any>(),
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export interface rtmEventsInterface {
|
|
34
|
-
on: (
|
|
35
|
-
messageChannel: messageChannelType,
|
|
36
|
-
evtName: string,
|
|
37
|
-
callback: any,
|
|
38
|
-
) => void;
|
|
39
|
-
emit: (
|
|
40
|
-
messageChannel: messageChannelType,
|
|
41
|
-
data: messageEventInterface | any | null,
|
|
42
|
-
error?: errorObjectInterface | null | undefined,
|
|
43
|
-
) => void;
|
|
44
|
-
off: (messageChannel: messageChannelType, evtName: string) => void;
|
|
45
|
-
destroyAll: () => void;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const events: rtmEventsInterface = {
|
|
49
|
-
on: (messageChannel: messageChannelType, evtName: string, callback: any) => {
|
|
50
|
-
eventsMap[messageChannel].set(evtName, callback);
|
|
51
|
-
},
|
|
52
|
-
emit: (
|
|
53
|
-
messageChannel: messageChannelType,
|
|
54
|
-
data: messageEventInterface | any | null,
|
|
55
|
-
error: errorObjectInterface | null | undefined,
|
|
56
|
-
) => {
|
|
57
|
-
// Handle error, if error found return error in callback
|
|
58
|
-
if (error) {
|
|
59
|
-
let err = new Error(`${RTM_ERROR_TEMPLATE}: ${error.msg}`);
|
|
60
|
-
err.stack += '\nCaused by: ' + error.cause;
|
|
61
|
-
|
|
62
|
-
for (const [key] of eventsMap[messageChannel].entries()) {
|
|
63
|
-
eventsMap[messageChannel].get(`${key}`)(null, err);
|
|
64
|
-
}
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
// Handle success, return data in callback
|
|
68
|
-
for (const [key] of eventsMap[messageChannel].entries()) {
|
|
69
|
-
eventsMap[messageChannel].get(`${key}`)(data, null);
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
off: (messageChannel: messageChannelType, evtName: string) => {
|
|
73
|
-
eventsMap[messageChannel].delete(evtName);
|
|
74
|
-
},
|
|
75
|
-
destroyAll: () => {
|
|
76
|
-
for (const key of Object.keys(eventsMap) as Array<eventKeyType>) {
|
|
77
|
-
eventsMap[key].clear();
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
Object.freeze(events);
|
|
83
|
-
|
|
84
|
-
export default events;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import {UidType} from '../../agora-rn-uikit';
|
|
2
|
-
type Simplify<T> = T extends infer S ? {[K in keyof S]: S[K]} : never;
|
|
3
|
-
type NoneOf<T> = Simplify<{[K in keyof T]?: never}>;
|
|
4
|
-
type AtMostOneOf<T> =
|
|
5
|
-
| NoneOf<T>
|
|
6
|
-
| {[K in keyof T]: Simplify<Pick<T, K> & NoneOf<Omit<T, K>>>}[keyof T];
|
|
7
|
-
|
|
8
|
-
// export type TEventOptions = AtMostOneOf<IMessageOptions> & IEventOptions;
|
|
9
|
-
|
|
10
|
-
export type ToOptions = UidType | UidType[];
|
|
11
|
-
|
|
12
|
-
interface IEventPayloadBase {
|
|
13
|
-
action?: any;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
interface IEventPayloadWithoutAttributes extends IEventPayloadBase {
|
|
17
|
-
level?: never;
|
|
18
|
-
value: string;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
interface IEventPayloadWithAttributes extends IEventPayloadBase {
|
|
22
|
-
level: 2 | 3;
|
|
23
|
-
value: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export type EventPayload =
|
|
27
|
-
| IEventPayloadWithoutAttributes
|
|
28
|
-
| IEventPayloadWithAttributes
|
|
29
|
-
| Record<string, never>;
|
|
30
|
-
|
|
31
|
-
export enum EventSourceEnum {
|
|
32
|
-
core = 'core',
|
|
33
|
-
fpe = 'fpe',
|
|
34
|
-
}
|
|
35
|
-
export enum EventLevel {
|
|
36
|
-
'LEVEL1' = 1,
|
|
37
|
-
'LEVEL2',
|
|
38
|
-
'LEVEL3',
|
|
39
|
-
}
|
|
40
|
-
interface dataPayload {
|
|
41
|
-
action: string;
|
|
42
|
-
level: 1 | 2 | 3;
|
|
43
|
-
value: string;
|
|
44
|
-
}
|
|
45
|
-
interface EvtCbPayload {
|
|
46
|
-
payload: dataPayload;
|
|
47
|
-
sender: string;
|
|
48
|
-
ts: number;
|
|
49
|
-
source: EventSourceEnum;
|
|
50
|
-
}
|
|
51
|
-
export type TEventCallback = (args: EvtCbPayload) => void;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {useFpe} from 'fpe-api';
|
|
2
|
-
import {DefaultLayouts} from './DefaultLayouts';
|
|
3
|
-
|
|
4
|
-
function useCustomLayout() {
|
|
5
|
-
const fpeLayouts = useFpe((config) => {
|
|
6
|
-
if (
|
|
7
|
-
typeof config?.components?.videoCall === 'object' &&
|
|
8
|
-
config?.components?.videoCall?.customLayout
|
|
9
|
-
) {
|
|
10
|
-
return config.components.videoCall.customLayout(DefaultLayouts);
|
|
11
|
-
} else {
|
|
12
|
-
return DefaultLayouts;
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
return fpeLayouts;
|
|
16
|
-
}
|
|
17
|
-
export default useCustomLayout;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
const GetMeetingInviteURL = (
|
|
2
|
-
baseUrl: string,
|
|
3
|
-
isHost: boolean,
|
|
4
|
-
meetingPassphrase: {
|
|
5
|
-
host?: string;
|
|
6
|
-
attendee?: string;
|
|
7
|
-
},
|
|
8
|
-
isSeparateHostLink: boolean,
|
|
9
|
-
) => {
|
|
10
|
-
if (isHost) {
|
|
11
|
-
if (isSeparateHostLink) {
|
|
12
|
-
return {
|
|
13
|
-
host: `${baseUrl}/${meetingPassphrase.host}`,
|
|
14
|
-
attendee: `${baseUrl}/${meetingPassphrase.attendee}`,
|
|
15
|
-
};
|
|
16
|
-
} else {
|
|
17
|
-
return {
|
|
18
|
-
host: `${baseUrl}/${meetingPassphrase.host}`,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
} else {
|
|
22
|
-
return {
|
|
23
|
-
attendee: `${baseUrl}/${meetingPassphrase.attendee}`,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
const GetMeetingInviteID = (
|
|
28
|
-
isHost: boolean,
|
|
29
|
-
meetingPassphrase: {
|
|
30
|
-
host?: string;
|
|
31
|
-
attendee?: string;
|
|
32
|
-
},
|
|
33
|
-
isSeparateHostLink: boolean,
|
|
34
|
-
) => {
|
|
35
|
-
if (isHost) {
|
|
36
|
-
if (isSeparateHostLink) {
|
|
37
|
-
return {
|
|
38
|
-
host: `${meetingPassphrase.host}`,
|
|
39
|
-
attendee: `${meetingPassphrase.attendee}`,
|
|
40
|
-
};
|
|
41
|
-
} else {
|
|
42
|
-
return {
|
|
43
|
-
host: `${meetingPassphrase.host}`,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
} else {
|
|
47
|
-
return {
|
|
48
|
-
attendee: `${meetingPassphrase.attendee}`,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export {GetMeetingInviteURL, GetMeetingInviteID};
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
|
|
13
|
-
import {useChatMessages} from '../components/chat-messages/useChatMessages';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* This hook will fetch the group messages
|
|
17
|
-
* @returns userList
|
|
18
|
-
*/
|
|
19
|
-
function useGroupMessages() {
|
|
20
|
-
const {messageStore} = useChatMessages();
|
|
21
|
-
return messageStore;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default useGroupMessages;
|
|
@@ -1,33 +0,0 @@
|
|
|
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
|
-
|
|
13
|
-
import {useChatMessages} from '../components/chat-messages/useChatMessages';
|
|
14
|
-
import {UidType} from '../../agora-rn-uikit';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* This hook will return function to find the private message by uid
|
|
18
|
-
* @returns private message
|
|
19
|
-
*/
|
|
20
|
-
function usePrivateMessages() {
|
|
21
|
-
const {privateMessageStore} = useChatMessages();
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
* @param uid - User id
|
|
25
|
-
* @returns If uid is passed then it will return particular private message data
|
|
26
|
-
* otherwise it will return whole private message store
|
|
27
|
-
*/
|
|
28
|
-
const getPrivateMessage = (uid?: UidType) =>
|
|
29
|
-
uid ? privateMessageStore[uid] : privateMessageStore;
|
|
30
|
-
return getPrivateMessage;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export default usePrivateMessages;
|