agora-appbuilder-core 2.3.0-beta.23 → 2.3.0-beta.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/Gulpfile.js +63 -79
- package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +2 -2
- package/template/babel.config.js +9 -9
- package/template/bridge/rtc/webNg/RtcEngine.ts +2 -2
- package/template/{fpe-api/context.ts → customization-api/app-state.ts} +7 -11
- package/template/customization-api/customEvents.ts +9 -0
- package/template/{fpe-api/install.ts → customization-api/customize.ts} +11 -11
- package/template/{fpe-api → customization-api}/index.ts +11 -6
- package/template/{fpe-api/components.ts → customization-api/sub-components.ts} +3 -3
- package/template/{fpe-api → customization-api}/typeDefinition.ts +1 -1
- package/template/{fpe-api → customization-api}/utils.ts +31 -26
- 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/esbuild.rsdk.go +5 -15
- package/template/global.d.ts +2 -2
- package/template/index.rsdk.tsx +3 -6
- package/template/index.wsdk.tsx +3 -6
- package/template/src/App.tsx +6 -4
- package/template/src/AppWrapper.tsx +2 -3
- package/template/src/SDKAppWrapper.tsx +26 -15
- package/template/src/app-state/useLocalUserInfo.ts +8 -0
- package/template/src/atoms/PrimaryButton.tsx +2 -2
- package/template/src/atoms/SecondaryButton.tsx +12 -4
- package/template/src/atoms/TextInput.tsx +4 -2
- package/template/src/components/Chat.tsx +12 -9
- package/template/src/components/ChatContext.ts +0 -24
- package/template/src/components/Controls.native.tsx +3 -1
- package/template/src/components/Controls.tsx +15 -7
- package/template/src/components/DeviceConfigure.tsx +4 -3
- package/template/src/components/EventsConfigure.tsx +54 -0
- package/template/src/components/GridVideo.tsx +6 -6
- package/template/src/components/HostControlView.tsx +8 -16
- package/template/src/components/Navbar.tsx +38 -30
- package/template/src/components/NetworkQualityContext.tsx +4 -3
- package/template/src/components/ParticipantsView.tsx +7 -5
- package/template/src/components/PinnedVideo.tsx +3 -4
- package/template/src/components/Precall.native.tsx +3 -3
- package/template/src/components/Precall.tsx +14 -9
- package/template/src/components/RTMConfigure.tsx +50 -194
- package/template/src/components/SettingsView.tsx +6 -3
- package/template/src/components/Share.tsx +12 -10
- package/template/src/components/chat-messages/useChatMessages.tsx +69 -51
- package/template/src/components/chat-notification/useChatNotification.tsx +1 -1
- 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 +1 -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 +2 -2
- package/template/src/components/participants/ParticipantName.tsx +3 -2
- package/template/src/components/precall/LocalMute.native.tsx +2 -2
- package/template/src/components/precall/LocalMute.tsx +2 -2
- package/template/src/components/precall/VideoPreview.native.tsx +5 -5
- package/template/src/components/precall/VideoPreview.tsx +2 -2
- package/template/src/components/precall/joinCallBtn.tsx +6 -4
- package/template/src/components/precall/meetingTitle.tsx +3 -1
- package/template/src/components/precall/selectDevice.tsx +3 -2
- package/template/src/components/precall/usePreCall.tsx +1 -1
- package/template/src/components/styles.ts +4 -3
- package/template/src/components/useShareLink.tsx +69 -29
- package/template/src/components/useUserPreference.tsx +12 -11
- package/template/src/components/useWakeLock.tsx +5 -3
- package/template/src/language/useLanguage.tsx +2 -3
- package/template/src/pages/Authenticate.tsx +3 -2
- package/template/src/pages/Create.tsx +18 -16
- package/template/src/pages/Join.tsx +6 -7
- package/template/src/pages/VideoCall.tsx +64 -58
- package/template/src/pages/create/useCreate.tsx +1 -1
- package/template/src/pages/video-call/CustomUserContextHolder.tsx +2 -2
- 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 +12 -9
- package/template/src/pages/video-call/VideoComponent.tsx +12 -14
- package/template/src/pages/video-call/VideoRenderer.tsx +6 -6
- package/template/src/pages/video-call/useLayoutsData.ts +23 -0
- package/template/src/rtm-events/EventUtils.ts +17 -20
- 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} +61 -54
- 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 +5 -4
- package/template/src/subComponents/ChatContainer.tsx +9 -8
- package/template/src/subComponents/ChatInput.tsx +43 -41
- package/template/src/subComponents/LanguageSelector.tsx +2 -2
- package/template/src/subComponents/LayoutIconDropdown.native.tsx +5 -5
- package/template/src/subComponents/LayoutIconDropdown.tsx +8 -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 +9 -9
- package/template/src/subComponents/OpenInNativeButton.tsx +3 -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/SelectOAuth.tsx +3 -2
- package/template/src/subComponents/SidePanelButtons.ts +6 -5
- package/template/src/subComponents/TextWithTooltip.tsx +7 -2
- package/template/src/subComponents/chat/ChatParticipants.tsx +7 -6
- 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 +29 -19
- package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +14 -11
- package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +29 -19
- package/template/src/subComponents/screenshare/useScreenshare.tsx +1 -1
- package/template/src/subComponents/toastConfig.tsx +2 -2
- package/template/src/utils/SdkEvents.ts +5 -1
- package/template/src/utils/common.tsx +23 -9
- package/template/src/utils/useButtonTemplate.tsx +1 -1
- package/template/src/utils/useCreateMeeting.ts +17 -13
- package/template/src/utils/useDeleteMessage.ts +2 -1
- package/template/src/utils/useEditMessage.ts +2 -1
- package/template/src/utils/useGetMeetingPhrase.ts +11 -8
- package/template/src/utils/useGroupMessages.ts +3 -2
- 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/useIsMobileOrTablet.native.ts +8 -0
- package/template/src/utils/useIsMobileOrTablet.ts +25 -0
- 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/usePrivateMessages.ts +2 -2
- package/template/src/utils/useRemoteEndCall.ts +11 -10
- package/template/src/utils/useRemoteMute.ts +42 -20
- package/template/src/utils/useSendMessage.ts +2 -1
- package/template/src/utils/useSetUnreadMessageCount.ts +4 -3
- package/template/src/utils/useSidePanel.tsx +1 -1
- package/template/src/utils/useString.ts +2 -2
- package/template/src/utils/useUnreadMessageCount.ts +7 -4
- 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 +8 -8
- package/template/webpack.rsdk.config.js +1 -0
- package/template/webpack.ts.config.js +6 -6
- package/template/webpack.wsdk.config.js +1 -0
- package/template/fpe-api/fpeEvents.ts +0 -9
- 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/isMobileOrTablet.native.ts +0 -5
- package/template/src/utils/isMobileOrTablet.ts +0 -10
- package/template/src/utils/useNavParams.ts +0 -6
- package/template/src/utils/useNavigateTo.ts +0 -8
- package/template/src/utils/useSendControlMessage.ts +0 -51
- package/template/src/utils/useUserList.ts +0 -26
package/package.json
CHANGED
package/template/Gulpfile.js
CHANGED
|
@@ -24,35 +24,33 @@ const WebpackDevServer = require('webpack-dev-server');
|
|
|
24
24
|
const webpackConfig = require('./webpack.renderer.config');
|
|
25
25
|
const webpackRsdkConfig = require('./webpack.rsdk.config');
|
|
26
26
|
|
|
27
|
-
const outPathArg = process.argv.indexOf('--outpath')
|
|
27
|
+
const outPathArg = process.argv.indexOf('--outpath');
|
|
28
28
|
getBuildPath = () => {
|
|
29
29
|
if (outPathArg == -1) {
|
|
30
30
|
return process.env.TARGET === 'wsdk'
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
? path.join(__dirname, '../Builds/web-sdk')
|
|
32
|
+
: process.env.TARGET === 'rsdk'
|
|
33
|
+
? path.join(__dirname, '../Builds/react-sdk')
|
|
34
|
+
: process.env.TARGET === 'android'
|
|
35
|
+
? path.join(__dirname, '../Builds/android')
|
|
36
|
+
: path.join(__dirname, '../Builds/.electron');
|
|
37
37
|
} else {
|
|
38
|
-
return process.argv[outPathArg+1].split('/').slice(0, -1).join('/')
|
|
38
|
+
return process.argv[outPathArg + 1].split('/').slice(0, -1).join('/');
|
|
39
39
|
}
|
|
40
|
-
}
|
|
40
|
+
};
|
|
41
41
|
const BUILD_PATH = getBuildPath();
|
|
42
|
-
const TS_DEFS_BUILD_PATH =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const pkgNameArg = process.argv.indexOf('--pkgname')
|
|
51
|
-
const PACKAGE_NAME = pkgNameArg == -1
|
|
52
|
-
? 'agora-app-builder-sdk'
|
|
53
|
-
: process.argv[pkgNameArg+1]
|
|
42
|
+
const TS_DEFS_BUILD_PATH =
|
|
43
|
+
process.env.TARGET === 'wsdk'
|
|
44
|
+
? path.join(__dirname, '../Builds/ts-defs/web-sdk')
|
|
45
|
+
: process.env.TARGET === 'rsdk'
|
|
46
|
+
? path.join(__dirname, '../Builds/ts-defs/react-sdk')
|
|
47
|
+
: process.env.TARGET === 'android'
|
|
48
|
+
? path.join(__dirname, '../Builds/ts-defs/android')
|
|
49
|
+
: path.join(__dirname, '../Builds/ts-defs/.electron');
|
|
54
50
|
|
|
55
|
-
|
|
51
|
+
const pkgNameArg = process.argv.indexOf('--pkgname');
|
|
52
|
+
const PACKAGE_NAME =
|
|
53
|
+
pkgNameArg == -1 ? 'agora-app-builder-sdk' : process.argv[pkgNameArg + 1];
|
|
56
54
|
|
|
57
55
|
const runCli = (cmd, cb) => {
|
|
58
56
|
const [arg1, ...arg2] = cmd.split(' ');
|
|
@@ -68,28 +66,9 @@ const general = {
|
|
|
68
66
|
return del([`${BUILD_PATH}/**/*`], {force: true});
|
|
69
67
|
},
|
|
70
68
|
packageJson: async (cb) => {
|
|
71
|
-
let
|
|
69
|
+
let {version, private, author, description, dependencies} = JSON.parse(
|
|
72
70
|
await fs.readFile(path.join(__dirname, 'package.json')),
|
|
73
71
|
);
|
|
74
|
-
let {
|
|
75
|
-
name,
|
|
76
|
-
version,
|
|
77
|
-
private,
|
|
78
|
-
author,
|
|
79
|
-
description,
|
|
80
|
-
dependencies,
|
|
81
|
-
optionalDependencies,
|
|
82
|
-
} = package;
|
|
83
|
-
PRODUCT_NAME = name;
|
|
84
|
-
let nativeDeps = require('./nativeDeps').default;
|
|
85
|
-
let natives = {};
|
|
86
|
-
let searchDeps = {
|
|
87
|
-
...dependencies,
|
|
88
|
-
...optionalDependencies,
|
|
89
|
-
};
|
|
90
|
-
nativeDeps.map((k) => {
|
|
91
|
-
natives[k] = searchDeps[k];
|
|
92
|
-
});
|
|
93
72
|
|
|
94
73
|
let newPackage = {
|
|
95
74
|
name: PACKAGE_NAME,
|
|
@@ -97,16 +76,14 @@ const general = {
|
|
|
97
76
|
private,
|
|
98
77
|
author,
|
|
99
78
|
description,
|
|
100
|
-
// dependencies: natives,
|
|
101
|
-
// agora_electron: {
|
|
102
|
-
// electron_version: '5.0.8',
|
|
103
|
-
// prebuilt: true,
|
|
104
|
-
// },
|
|
105
79
|
};
|
|
106
80
|
|
|
107
81
|
// Target specific changes
|
|
108
82
|
|
|
109
83
|
if (process.env.TARGET === 'rsdk') {
|
|
84
|
+
if(pkgNameArg == -1){
|
|
85
|
+
newPackage.name = "@appbuilder/react"
|
|
86
|
+
}
|
|
110
87
|
newPackage.main = 'index.js';
|
|
111
88
|
newPackage.types = 'index.d.ts';
|
|
112
89
|
|
|
@@ -121,6 +98,9 @@ const general = {
|
|
|
121
98
|
}
|
|
122
99
|
|
|
123
100
|
if (process.env.TARGET === 'wsdk') {
|
|
101
|
+
if(pkgNameArg == -1){
|
|
102
|
+
newPackage.name = "@appbuilder/web"
|
|
103
|
+
}
|
|
124
104
|
newPackage.main = 'app-builder-web-sdk.umd2.js';
|
|
125
105
|
newPackage.types = 'index.d.ts';
|
|
126
106
|
}
|
|
@@ -136,13 +116,13 @@ const general = {
|
|
|
136
116
|
},
|
|
137
117
|
typescript: (cb) => {
|
|
138
118
|
runCli(
|
|
139
|
-
'npx -p typescript tsc --project tsconfig_fpeApi.json --outFile ../Builds/
|
|
119
|
+
'npx -p typescript tsc --project tsconfig_fpeApi.json --outFile ../Builds/customization-api.d.ts',
|
|
140
120
|
() => cb(),
|
|
141
121
|
);
|
|
142
122
|
},
|
|
143
123
|
typescriptFix: () => {
|
|
144
|
-
return src(['../Builds/
|
|
145
|
-
.pipe(concat('./
|
|
124
|
+
return src(['../Builds/customization-api.d.ts', './global.d.ts'])
|
|
125
|
+
.pipe(concat('./customization-api.d.ts'))
|
|
146
126
|
.pipe(
|
|
147
127
|
replace(
|
|
148
128
|
`declare var $config: ConfigInterface;
|
|
@@ -160,14 +140,17 @@ declare module 'test-fpe' {
|
|
|
160
140
|
return del([`${path.join(BUILD_PATH, '../', '/')}*.d.ts`], {force: true});
|
|
161
141
|
},
|
|
162
142
|
genTsDefs: (cb) => {
|
|
163
|
-
runCli(
|
|
143
|
+
runCli(
|
|
144
|
+
`mkdir -p ${TS_DEFS_BUILD_PATH} && cp ${BUILD_PATH}/index.d.ts ${TS_DEFS_BUILD_PATH}/index.d.ts`,
|
|
145
|
+
cb,
|
|
146
|
+
);
|
|
164
147
|
},
|
|
165
148
|
useTsDefs: (cb) => {
|
|
166
|
-
runCli(`cp ${TS_DEFS_BUILD_PATH}/index.d.ts ${BUILD_PATH}/index.d.ts`, cb)
|
|
149
|
+
runCli(`cp ${TS_DEFS_BUILD_PATH}/index.d.ts ${BUILD_PATH}/index.d.ts`, cb);
|
|
167
150
|
},
|
|
168
151
|
npmPack: (cb) => {
|
|
169
|
-
runCli(`cd ${BUILD_PATH} && npm pack`, cb)
|
|
170
|
-
}
|
|
152
|
+
runCli(`cd ${BUILD_PATH} && npm pack`, cb);
|
|
153
|
+
},
|
|
171
154
|
};
|
|
172
155
|
|
|
173
156
|
const electron = {
|
|
@@ -208,15 +191,19 @@ const reactSdk = {
|
|
|
208
191
|
esbuild: (cb) => {
|
|
209
192
|
let outPath = '';
|
|
210
193
|
if (outPathArg != -1) {
|
|
211
|
-
outPath = ` --outpath ${process.argv[outPathArg+1]}
|
|
194
|
+
outPath = ` --outpath ${process.argv[outPathArg + 1]}`;
|
|
212
195
|
}
|
|
213
196
|
let configTransformerPath = '';
|
|
214
|
-
const configTransformerPathArg = process.argv.indexOf(
|
|
197
|
+
const configTransformerPathArg = process.argv.indexOf(
|
|
198
|
+
'--configtransformerpath',
|
|
199
|
+
);
|
|
215
200
|
if (configTransformerPathArg != -1) {
|
|
216
|
-
configTransformerPath = ` --configtransformerpath ${
|
|
201
|
+
configTransformerPath = ` --configtransformerpath ${
|
|
202
|
+
process.argv[configTransformerPathArg + 1]
|
|
203
|
+
}`;
|
|
217
204
|
}
|
|
218
|
-
let esbuildCmd = `go build -o ../esbuild-bin/rsdk ./esbuild.rsdk.go && ../esbuild-bin/rsdk${outPath}${configTransformerPath}
|
|
219
|
-
console.log(esbuildCmd)
|
|
205
|
+
let esbuildCmd = `go build -o ../esbuild-bin/rsdk ./esbuild.rsdk.go && ../esbuild-bin/rsdk${outPath}${configTransformerPath}`;
|
|
206
|
+
console.log(esbuildCmd);
|
|
220
207
|
runCli(esbuildCmd, cb);
|
|
221
208
|
},
|
|
222
209
|
typescript: (cb) => {
|
|
@@ -227,7 +214,7 @@ const reactSdk = {
|
|
|
227
214
|
);
|
|
228
215
|
},
|
|
229
216
|
typescriptFix: () => {
|
|
230
|
-
return src(['../Builds/
|
|
217
|
+
return src(['../Builds/customization-api.d.ts', '../Builds/reactSdk.d.ts'])
|
|
231
218
|
.pipe(concat('index.d.ts'))
|
|
232
219
|
.pipe(
|
|
233
220
|
replace(
|
|
@@ -235,11 +222,11 @@ const reactSdk = {
|
|
|
235
222
|
'declare module "agora-app-builder-sdk"',
|
|
236
223
|
),
|
|
237
224
|
)
|
|
238
|
-
.pipe(replace("'
|
|
239
|
-
.pipe(replace('"
|
|
225
|
+
.pipe(replace("'customization-api'", "'customization-api/index'"))
|
|
226
|
+
.pipe(replace('"customization-api"', '"customization-api/index"'))
|
|
240
227
|
.pipe(header('// @ts-nocheck\n'))
|
|
241
228
|
.pipe(dest(BUILD_PATH));
|
|
242
|
-
}
|
|
229
|
+
},
|
|
243
230
|
};
|
|
244
231
|
|
|
245
232
|
const webSdk = {
|
|
@@ -253,7 +240,7 @@ const webSdk = {
|
|
|
253
240
|
);
|
|
254
241
|
},
|
|
255
242
|
typescriptFix: () => {
|
|
256
|
-
return src(['../Builds/
|
|
243
|
+
return src(['../Builds/customization-api.d.ts', '../Builds/webSdk.d.ts'])
|
|
257
244
|
.pipe(concat('index.d.ts'))
|
|
258
245
|
.pipe(
|
|
259
246
|
replace(
|
|
@@ -261,14 +248,14 @@ const webSdk = {
|
|
|
261
248
|
'declare module "agora-app-builder-sdk"',
|
|
262
249
|
),
|
|
263
250
|
)
|
|
264
|
-
.pipe(replace("'
|
|
265
|
-
.pipe(replace('"
|
|
251
|
+
.pipe(replace("'customization-api'", "'customization-api/index'"))
|
|
252
|
+
.pipe(replace('"customization-api"', '"customization-api/index"'))
|
|
266
253
|
.pipe(header('// @ts-nocheck\n'))
|
|
267
254
|
.pipe(dest(BUILD_PATH));
|
|
268
255
|
},
|
|
269
256
|
npmPack: (cb) => {
|
|
270
|
-
runCli('cd ../Builds/web-sdk && npm pack',cb)
|
|
271
|
-
}
|
|
257
|
+
runCli('cd ../Builds/web-sdk && npm pack', cb);
|
|
258
|
+
},
|
|
272
259
|
};
|
|
273
260
|
|
|
274
261
|
const android = {
|
|
@@ -335,7 +322,7 @@ module.exports.reactSdk = series(
|
|
|
335
322
|
);
|
|
336
323
|
|
|
337
324
|
// react-sdk-esbuild
|
|
338
|
-
module.exports.reactSdkEsbuild = series
|
|
325
|
+
module.exports.reactSdkEsbuild = series(
|
|
339
326
|
general.clean,
|
|
340
327
|
general.createBuildDirectory,
|
|
341
328
|
general.packageJson,
|
|
@@ -346,31 +333,31 @@ module.exports.reactSdkEsbuild = series (
|
|
|
346
333
|
reactSdk.typescriptFix,
|
|
347
334
|
general.typescriptClean,
|
|
348
335
|
general.npmPack,
|
|
349
|
-
)
|
|
336
|
+
);
|
|
350
337
|
|
|
351
338
|
// generate typescript definitions
|
|
352
|
-
module.exports.makeRsdkTsDefs = series
|
|
339
|
+
module.exports.makeRsdkTsDefs = series(
|
|
353
340
|
general.clean,
|
|
354
341
|
general.createBuildDirectory,
|
|
355
342
|
general.packageJson,
|
|
356
|
-
reactSdk.
|
|
343
|
+
reactSdk.webpack,
|
|
357
344
|
general.typescript,
|
|
358
345
|
general.typescriptFix,
|
|
359
346
|
reactSdk.typescript,
|
|
360
347
|
reactSdk.typescriptFix,
|
|
361
348
|
general.typescriptClean,
|
|
362
349
|
general.genTsDefs,
|
|
363
|
-
)
|
|
350
|
+
);
|
|
364
351
|
|
|
365
352
|
// react-sdk-esbuild with cached type definitions
|
|
366
|
-
module.exports.reactSdkEsbuildCachedTsc = series
|
|
353
|
+
module.exports.reactSdkEsbuildCachedTsc = series(
|
|
367
354
|
general.clean,
|
|
368
355
|
general.createBuildDirectory,
|
|
369
356
|
general.packageJson,
|
|
370
357
|
reactSdk.esbuild,
|
|
371
358
|
general.useTsDefs,
|
|
372
359
|
general.npmPack,
|
|
373
|
-
)
|
|
360
|
+
);
|
|
374
361
|
|
|
375
362
|
// web-sdk
|
|
376
363
|
module.exports.webSdk = series(
|
|
@@ -411,10 +398,7 @@ module.exports.webSdkCachedTsc = series(
|
|
|
411
398
|
general.clean,
|
|
412
399
|
general.createBuildDirectory,
|
|
413
400
|
general.packageJson,
|
|
414
|
-
parallel(
|
|
415
|
-
webSdk.webpack,
|
|
416
|
-
general.useTsDefs,
|
|
417
|
-
),
|
|
401
|
+
parallel(webSdk.webpack, general.useTsDefs),
|
|
418
402
|
general.npmPack,
|
|
419
403
|
);
|
|
420
404
|
|
|
@@ -5,12 +5,12 @@ import type {DualStreamMode, RenderInterface} from './PropsContext';
|
|
|
5
5
|
|
|
6
6
|
export type UidType = number;
|
|
7
7
|
|
|
8
|
-
export interface
|
|
8
|
+
export interface RenderObjects {
|
|
9
9
|
[key: number]: RenderInterface;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export interface RenderStateInterface {
|
|
13
|
-
renderList:
|
|
13
|
+
renderList: RenderObjects;
|
|
14
14
|
renderPosition: Array<UidType>;
|
|
15
15
|
}
|
|
16
16
|
|
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
|
+
'test-fpe': getCustomizationApiPath(),
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
32
|
],
|
|
33
33
|
};
|
|
@@ -33,8 +33,8 @@ import {ChannelProfile, ClientRole} from '../../../agora-rn-uikit';
|
|
|
33
33
|
import {role, mode} from './Types';
|
|
34
34
|
import {LOG_ENABLED, GEO_FENCING} from '../../../config.json';
|
|
35
35
|
import {Platform} from 'react-native';
|
|
36
|
-
import
|
|
37
|
-
|
|
36
|
+
import useIsMobileOrTablet from '../../../src/utils/useIsMobileOrTablet';
|
|
37
|
+
const isMobileOrTablet = useIsMobileOrTablet();
|
|
38
38
|
interface MediaDeviceInfo {
|
|
39
39
|
readonly deviceId: string;
|
|
40
40
|
readonly label: string;
|
|
@@ -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);
|
|
@@ -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) {
|
|
@@ -59,14 +59,14 @@ function validateComponents(components: any) {
|
|
|
59
59
|
}
|
|
60
60
|
} else {
|
|
61
61
|
console.error(
|
|
62
|
-
`
|
|
62
|
+
`Customize:Error ${key} should be a react component or object`,
|
|
63
63
|
);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
} else {
|
|
67
67
|
let comp = components[key];
|
|
68
68
|
if (comp && !isFunction(comp)) {
|
|
69
|
-
console.error(`
|
|
69
|
+
console.error(`Customize:Error ${key} should be an function`);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -77,7 +77,7 @@ function validateLifecycle(data: any) {
|
|
|
77
77
|
const callback = data[key];
|
|
78
78
|
if (callback && !isFunction(callback)) {
|
|
79
79
|
console.error(
|
|
80
|
-
`
|
|
80
|
+
`Customize:Error ${key} should be a function that return async function`,
|
|
81
81
|
);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -85,20 +85,20 @@ function validateLifecycle(data: any) {
|
|
|
85
85
|
|
|
86
86
|
function validateCustomRoutes(routes: any) {
|
|
87
87
|
if (routes && !Array.isArray(routes)) {
|
|
88
|
-
console.error(`
|
|
88
|
+
console.error(`Customize:Error customRoutes should be an array`);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
function validateAppRoot(data: any) {
|
|
93
93
|
if (data && !isComponent(data)) {
|
|
94
|
-
console.error(`
|
|
94
|
+
console.error(`Customize:Error appRoot should be a react component`);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
function validatei18n(data: any) {
|
|
99
99
|
if (data) {
|
|
100
100
|
if (!Array.isArray(data)) {
|
|
101
|
-
console.error(`
|
|
101
|
+
console.error(`Customize:Error i18n should be an array`);
|
|
102
102
|
} else {
|
|
103
103
|
data.map((item) => {
|
|
104
104
|
const langData = item.data;
|
|
@@ -107,7 +107,7 @@ function validatei18n(data: any) {
|
|
|
107
107
|
if (value) {
|
|
108
108
|
if (!(isString(value) || isFunction(value))) {
|
|
109
109
|
console.error(
|
|
110
|
-
`
|
|
110
|
+
`Customize:Error ${item.locale} ${key} should be a string or function`,
|
|
111
111
|
);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
@@ -116,7 +116,7 @@ function validatei18n(data: any) {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
export const
|
|
119
|
+
export const customize = (config: CustomizationApiInterface) => {
|
|
120
120
|
//validating the components
|
|
121
121
|
config?.components && validateComponents(config.components);
|
|
122
122
|
|
|
@@ -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
|
+
|
|
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';
|
|
@@ -33,10 +33,10 @@ export {
|
|
|
33
33
|
export {default as GridLayout} from '../src/components/GridVideo';
|
|
34
34
|
export {default as PinnedLayout} from '../src/components/PinnedVideo';
|
|
35
35
|
export {default as VideoComponent} from '../src/pages/video-call/VideoComponent';
|
|
36
|
-
export {
|
|
36
|
+
export {default as MaxVideoView} from '../src/pages/video-call/VideoRenderer';
|
|
37
37
|
export {default as RenderComponent} from '../src/pages/video-call/RenderComponent';
|
|
38
|
-
export {
|
|
39
|
-
export {NetworkQualityPill} from '../src/subComponents/NetworkQualityPill';
|
|
38
|
+
export {default as NameWithMicIcon} from '../src/pages/video-call/NameWithMicIcon';
|
|
39
|
+
export {default as NetworkQualityPill} from '../src/subComponents/NetworkQualityPill';
|
|
40
40
|
//videocall screen
|
|
41
41
|
export {default as VideocallScreen} from '../src/pages/video-call/VideoCallScreen';
|
|
42
42
|
|
|
@@ -115,7 +115,7 @@ export interface CustomRoutesInterface {
|
|
|
115
115
|
|
|
116
116
|
export type CustomHookType = () => () => Promise<void>;
|
|
117
117
|
|
|
118
|
-
export interface
|
|
118
|
+
export interface CustomizationApiInterface {
|
|
119
119
|
/**
|
|
120
120
|
* components used to replace whole screen or subcomponents
|
|
121
121
|
*/
|
|
@@ -10,18 +10,19 @@
|
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
12
|
// commented for v1 release
|
|
13
|
-
//export {default as useIsScreenShare} from '../src/utils/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export {default as
|
|
17
|
-
export {default as
|
|
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 used to get/set username
|
|
21
|
+
export {default as useUserName} from '../src/utils/useUserName';
|
|
22
|
+
|
|
23
|
+
//hooks used to manage messages
|
|
18
24
|
export {default as useGroupMessages} from '../src/utils/useGroupMessages';
|
|
19
25
|
export {default as usePrivateMessages} from '../src/utils/usePrivateMessages';
|
|
20
|
-
export {default as useIsAudioEnabled} from '../src/utils/isAudioEnabled';
|
|
21
|
-
export {default as useIsVideoEnabled} from '../src/utils/isVideoEnabled';
|
|
22
|
-
export {default as useSetName} from '../src/utils/useSetName';
|
|
23
|
-
export {default as useGetName} from '../src/utils/useGetName';
|
|
24
|
-
export {useSidePanel} from '../src/utils/useSidePanel';
|
|
25
26
|
export {
|
|
26
27
|
default as useUnreadMessageCount,
|
|
27
28
|
UNREAD_MESSAGE_COUNT_TYPE,
|
|
@@ -30,10 +31,6 @@ export {
|
|
|
30
31
|
default as useSetUnreadMessageCount,
|
|
31
32
|
SET_UNREAD_MESSAGE_COUNT_TYPE,
|
|
32
33
|
} from '../src/utils/useSetUnreadMessageCount';
|
|
33
|
-
export {default as useNavigateTo} from '../src/utils/useNavigateTo';
|
|
34
|
-
export {default as useNavParams} from '../src/utils/useNavParams';
|
|
35
|
-
export {default as useCreateMeeting} from '../src/utils/useCreateMeeting';
|
|
36
|
-
export {default as useJoinMeeting} from '../src/utils/useJoinMeeting';
|
|
37
34
|
export {
|
|
38
35
|
default as useSendMessage,
|
|
39
36
|
MESSAGE_TYPE,
|
|
@@ -41,10 +38,10 @@ export {
|
|
|
41
38
|
export {default as useEditMessage} from '../src/utils/useEditMessage';
|
|
42
39
|
export {default as useDeleteMessage} from '../src/utils/useDeleteMessage';
|
|
43
40
|
export {controlMessageEnum} from '../src/components/ChatContext';
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
} from '../src/utils/
|
|
41
|
+
|
|
42
|
+
//hook to manage audio/video states
|
|
43
|
+
export {default as useIsAudioEnabled} from '../src/utils/useIsAudioEnabled';
|
|
44
|
+
export {default as useIsVideoEnabled} from '../src/utils/useIsVideoEnabled';
|
|
48
45
|
export {
|
|
49
46
|
MUTE_LOCAL_TYPE,
|
|
50
47
|
default as useMuteToggleLocal,
|
|
@@ -56,15 +53,23 @@ export {
|
|
|
56
53
|
} from '../src/utils/useRemoteMute';
|
|
57
54
|
export {ToggleState} from '../agora-rn-uikit/src/Contexts/PropsContext';
|
|
58
55
|
|
|
56
|
+
//
|
|
57
|
+
export {useSidePanel} from '../src/utils/useSidePanel';
|
|
58
|
+
|
|
59
|
+
//hooks used for navigation
|
|
60
|
+
export {useHistory, useParams} from '../src/components/Router';
|
|
61
|
+
|
|
62
|
+
//hooks used for manage meeting data
|
|
63
|
+
export {default as useCreateMeeting} from '../src/utils/useCreateMeeting';
|
|
64
|
+
export {default as useJoinMeeting} from '../src/utils/useJoinMeeting';
|
|
65
|
+
|
|
59
66
|
//export common function
|
|
60
67
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
isWeb,
|
|
67
|
-
shouldAuthenticate,
|
|
68
|
+
useIsWeb,
|
|
69
|
+
useIsIOS,
|
|
70
|
+
useIsAndroid,
|
|
71
|
+
useIsDestop,
|
|
72
|
+
useHasBrandLogo,
|
|
68
73
|
} from '../src/utils/common';
|
|
69
|
-
export {default as
|
|
74
|
+
export {default as useIsMobileOrTablet} from '../src/utils/useIsMobileOrTablet';
|
|
70
75
|
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;
|