agora-appbuilder-core 2.3.0-beta.30 → 2.3.0-beta.31
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 +56 -16
- package/template/_gitignore +2 -2
- package/template/agora-rn-uikit/src/AgoraUIKit.tsx +2 -2
- package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +1 -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 -7
- 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/Join.tsx +2 -2
- package/template/agora-rn-uikit/src/RtcConfigure.tsx +18 -20
- package/template/babel.config.js +1 -1
- package/template/bridge/rtc/webNg/RtcEngine.ts +2 -2
- package/template/customization-api/app-state.ts +1 -1
- package/template/customization-api/index.ts +2 -2
- package/template/customization-api/typeDefinition.ts +2 -2
- package/template/customization-api/utils.ts +2 -7
- package/template/customization-implementation/index.ts +1 -1
- package/template/customization-implementation/useCustomization.tsx +1 -1
- package/template/customization.config.js +3 -3
- package/template/esbuild.rsdk.go +2 -2
- package/template/global.d.ts +1 -1
- package/template/src/AppWrapper.tsx +2 -3
- package/template/src/atoms/TextInput.tsx +11 -15
- package/template/src/components/Chat.tsx +136 -144
- package/template/src/components/Controls.tsx +10 -15
- package/template/src/components/GridVideo.tsx +1 -2
- package/template/src/components/Navbar.tsx +162 -179
- package/template/src/components/ParticipantsView.tsx +88 -93
- package/template/src/components/Precall.tsx +2 -3
- package/template/src/components/RTMConfigure.tsx +5 -7
- package/template/src/components/SettingsView.tsx +1 -2
- package/template/src/components/participants/AllHostParticipants.tsx +3 -3
- package/template/src/components/participants/ParticipantName.tsx +1 -2
- package/template/src/components/precall/VideoPreview.native.tsx +2 -2
- package/template/src/components/precall/VideoPreview.tsx +2 -2
- package/template/src/components/precall/joinCallBtn.tsx +2 -4
- package/template/src/components/precall/selectDevice.tsx +1 -2
- package/template/src/components/styles.ts +3 -6
- package/template/src/components/useWakeLock.tsx +2 -4
- package/template/src/language/i18nTypes.ts +1 -1
- package/template/src/language/index.ts +2 -2
- package/template/src/pages/Create.tsx +1 -2
- package/template/src/pages/video-call/VideoCallScreen.tsx +1 -2
- package/template/src/pages/video-call/VideoComponent.tsx +2 -2
- package/template/src/subComponents/ChatBubble.tsx +1 -2
- package/template/src/subComponents/ChatContainer.tsx +45 -48
- package/template/src/subComponents/LayoutIconDropdown.tsx +1 -2
- package/template/src/subComponents/NetworkQualityPill.tsx +1 -2
- package/template/src/subComponents/OpenInNativeButton.tsx +1 -2
- package/template/src/subComponents/{useToastConfig.tsx → ToastConfig.tsx} +24 -27
- package/template/src/subComponents/chat/ChatParticipants.tsx +36 -40
- package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +1 -1
- package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +1 -1
- package/template/src/utils/common.tsx +12 -15
- package/template/src/utils/isMobileOrTablet.native.ts +5 -0
- package/template/src/utils/isMobileOrTablet.ts +23 -0
- package/template/webpack.commons.js +1 -1
- package/template/src/utils/useIsMobileOrTablet.native.ts +0 -8
- package/template/src/utils/useIsMobileOrTablet.ts +0 -25
package/package.json
CHANGED
package/template/Gulpfile.js
CHANGED
|
@@ -18,6 +18,7 @@ const config = require('./config.json');
|
|
|
18
18
|
const replace = require('gulp-replace');
|
|
19
19
|
const concat = require('gulp-concat');
|
|
20
20
|
const header = require('gulp-header');
|
|
21
|
+
const semver = require('semver');
|
|
21
22
|
|
|
22
23
|
const webpack = require('webpack');
|
|
23
24
|
const WebpackDevServer = require('webpack-dev-server');
|
|
@@ -48,9 +49,17 @@ const TS_DEFS_BUILD_PATH =
|
|
|
48
49
|
? path.join(__dirname, '../Builds/ts-defs/android')
|
|
49
50
|
: path.join(__dirname, '../Builds/ts-defs/.electron');
|
|
50
51
|
|
|
52
|
+
const debugFlag = process.argv.indexOf('--debug') !== -1;
|
|
53
|
+
|
|
51
54
|
const pkgNameArg = process.argv.indexOf('--pkgname');
|
|
52
55
|
const PACKAGE_NAME =
|
|
53
|
-
pkgNameArg == -1
|
|
56
|
+
pkgNameArg == -1
|
|
57
|
+
? process.env.TARGET === 'rsdk'
|
|
58
|
+
? '@appbuilder/react'
|
|
59
|
+
: process.env.TARGET === 'wsdk'
|
|
60
|
+
? '@appbuilder/web'
|
|
61
|
+
: 'agora-app-builder-sdk'
|
|
62
|
+
: process.argv[pkgNameArg + 1];
|
|
54
63
|
|
|
55
64
|
const runCli = (cmd, cb) => {
|
|
56
65
|
const [arg1, ...arg2] = cmd.split(' ');
|
|
@@ -61,15 +70,49 @@ const runCli = (cmd, cb) => {
|
|
|
61
70
|
proc.on('exit', cb);
|
|
62
71
|
};
|
|
63
72
|
|
|
73
|
+
const runCliNoOutput = (cmd, cb) => {
|
|
74
|
+
const [arg1, ...arg2] = cmd.split(' ');
|
|
75
|
+
const proc = spawn(arg1, arg2, {
|
|
76
|
+
stdio: 'ignore',
|
|
77
|
+
shell: true,
|
|
78
|
+
});
|
|
79
|
+
proc.on('exit', cb);
|
|
80
|
+
};
|
|
81
|
+
|
|
64
82
|
const general = {
|
|
65
83
|
clean: () => {
|
|
66
84
|
return del([`${BUILD_PATH}/**/*`], {force: true});
|
|
67
85
|
},
|
|
68
86
|
packageJson: async (cb) => {
|
|
69
|
-
let {
|
|
87
|
+
let {private, author, description, dependencies} = JSON.parse(
|
|
70
88
|
await fs.readFile(path.join(__dirname, 'package.json')),
|
|
71
89
|
);
|
|
72
90
|
|
|
91
|
+
// Tries to fetch version and dependencies from parent package.json
|
|
92
|
+
|
|
93
|
+
let {dependencies: parentDependencies, version: parentVersion} = JSON.parse(
|
|
94
|
+
await fs.readFile(path.join(__dirname, '..', 'package.json')),
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
// If parentDependencies present derives base version from cli version ( prod )
|
|
98
|
+
// otherwise uses version number from parent package.json ( dev )
|
|
99
|
+
|
|
100
|
+
let baseVersion = parentDependencies
|
|
101
|
+
? parentDependencies['agora-app-builder-cli']
|
|
102
|
+
: parentVersion;
|
|
103
|
+
|
|
104
|
+
// Generates unique hash
|
|
105
|
+
|
|
106
|
+
const nanoid = await import('nanoid');
|
|
107
|
+
const alphabet =
|
|
108
|
+
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
|
109
|
+
|
|
110
|
+
let versionHash = nanoid.customAlphabet(alphabet, 10)();
|
|
111
|
+
|
|
112
|
+
// Hash appended to base version to create unique version for every build.
|
|
113
|
+
|
|
114
|
+
let version = semver.minVersion(`${baseVersion}-${versionHash}`).version;
|
|
115
|
+
|
|
73
116
|
let newPackage = {
|
|
74
117
|
name: PACKAGE_NAME,
|
|
75
118
|
version,
|
|
@@ -81,9 +124,6 @@ const general = {
|
|
|
81
124
|
// Target specific changes
|
|
82
125
|
|
|
83
126
|
if (process.env.TARGET === 'rsdk') {
|
|
84
|
-
if (pkgNameArg == -1) {
|
|
85
|
-
newPackage.name = '@appbuilder/react';
|
|
86
|
-
}
|
|
87
127
|
newPackage.main = 'index.js';
|
|
88
128
|
newPackage.types = 'index.d.ts';
|
|
89
129
|
|
|
@@ -98,9 +138,6 @@ const general = {
|
|
|
98
138
|
}
|
|
99
139
|
|
|
100
140
|
if (process.env.TARGET === 'wsdk') {
|
|
101
|
-
if (pkgNameArg == -1) {
|
|
102
|
-
newPackage.name = '@appbuilder/web';
|
|
103
|
-
}
|
|
104
141
|
newPackage.main = 'app-builder-web-sdk.umd2.js';
|
|
105
142
|
newPackage.types = 'index.d.ts';
|
|
106
143
|
}
|
|
@@ -115,7 +152,8 @@ const general = {
|
|
|
115
152
|
return fs.mkdir(BUILD_PATH, {recursive: true});
|
|
116
153
|
},
|
|
117
154
|
typescript: (cb) => {
|
|
118
|
-
runCli
|
|
155
|
+
const cli = debugFlag ? runCli : runCliNoOutput;
|
|
156
|
+
cli(
|
|
119
157
|
'npx -p typescript tsc --project tsconfig_fpeApi.json --outFile ../Builds/customization-api.d.ts',
|
|
120
158
|
() => cb(),
|
|
121
159
|
);
|
|
@@ -126,9 +164,9 @@ const general = {
|
|
|
126
164
|
.pipe(
|
|
127
165
|
replace(
|
|
128
166
|
`declare var $config: ConfigInterface;
|
|
129
|
-
declare module '
|
|
130
|
-
const
|
|
131
|
-
export default
|
|
167
|
+
declare module 'customization' {
|
|
168
|
+
const customizationConfig: {};
|
|
169
|
+
export default customizationConfig;
|
|
132
170
|
}`,
|
|
133
171
|
' ',
|
|
134
172
|
),
|
|
@@ -210,7 +248,8 @@ const reactSdk = {
|
|
|
210
248
|
runCli(esbuildCmd, cb);
|
|
211
249
|
},
|
|
212
250
|
typescript: (cb) => {
|
|
213
|
-
runCli
|
|
251
|
+
const cli = debugFlag ? runCli : runCliNoOutput;
|
|
252
|
+
cli(
|
|
214
253
|
//'npx -p typescript tsc index.rsdk.tsx --declaration --emitDeclarationOnly --noResolve --outFile ../Builds/temp.d.ts',
|
|
215
254
|
'npx -p typescript tsc --project tsconfig_rsdk_index.json --outFile ../Builds/reactSdk.d.ts',
|
|
216
255
|
() => cb(),
|
|
@@ -222,7 +261,7 @@ const reactSdk = {
|
|
|
222
261
|
.pipe(
|
|
223
262
|
replace(
|
|
224
263
|
'declare module "index.rsdk"',
|
|
225
|
-
|
|
264
|
+
`declare module "${PACKAGE_NAME}"`,
|
|
226
265
|
),
|
|
227
266
|
)
|
|
228
267
|
.pipe(replace("'customization-api'", "'customization-api/index'"))
|
|
@@ -237,7 +276,8 @@ const webSdk = {
|
|
|
237
276
|
runCli('webpack --config ./webpack.wsdk.config.js', cb);
|
|
238
277
|
},
|
|
239
278
|
typescript: (cb) => {
|
|
240
|
-
runCli
|
|
279
|
+
const cli = debugFlag ? runCli : runCliNoOutput;
|
|
280
|
+
cli(
|
|
241
281
|
'npx -p typescript tsc --project tsconfig_wsdk_index.json --outFile ../Builds/webSdk.d.ts',
|
|
242
282
|
() => cb(),
|
|
243
283
|
);
|
|
@@ -248,7 +288,7 @@ const webSdk = {
|
|
|
248
288
|
.pipe(
|
|
249
289
|
replace(
|
|
250
290
|
'declare module "index.wsdk"',
|
|
251
|
-
|
|
291
|
+
`declare module "${PACKAGE_NAME}"`,
|
|
252
292
|
),
|
|
253
293
|
)
|
|
254
294
|
.pipe(replace("'customization-api'", "'customization-api/index'"))
|
package/template/_gitignore
CHANGED
|
@@ -17,8 +17,8 @@ const AgoraUIKit: React.FC<PropsInterface> = (props) => {
|
|
|
17
17
|
<View style={{backgroundColor: '#000', flex: 1}}>
|
|
18
18
|
<RtcConfigure>
|
|
19
19
|
<RenderConsumer>
|
|
20
|
-
{({renderList,
|
|
21
|
-
const [maxUid, ...minUids] =
|
|
20
|
+
{({renderList, activeUids}) => {
|
|
21
|
+
const [maxUid, ...minUids] = activeUids;
|
|
22
22
|
return (
|
|
23
23
|
<>
|
|
24
24
|
<MaxVideoView user={renderList[maxUid]} key={maxUid} />
|
|
@@ -30,10 +30,10 @@ function Controls(props: ControlsPropsInterface) {
|
|
|
30
30
|
</View>
|
|
31
31
|
{showButton ? (
|
|
32
32
|
<RenderConsumer>
|
|
33
|
-
{({renderList,
|
|
33
|
+
{({renderList, activeUids}) => (
|
|
34
34
|
<View style={{...styles.Controls, top: styles.Controls.top - 100}}>
|
|
35
35
|
<RemoteControls
|
|
36
|
-
user={renderList[
|
|
36
|
+
user={renderList[activeUids[0]]}
|
|
37
37
|
showRemoteSwap={false}
|
|
38
38
|
/>
|
|
39
39
|
</View>
|
|
@@ -22,12 +22,12 @@ export default function UpdateDualStreamMode(
|
|
|
22
22
|
|
|
23
23
|
if (newMode === DualStreamMode.HIGH) {
|
|
24
24
|
// Update everybody to high
|
|
25
|
-
state.
|
|
25
|
+
state.activeUids.forEach(setHighStreamType);
|
|
26
26
|
} else if (newMode === DualStreamMode.LOW) {
|
|
27
27
|
// Update everybody to low
|
|
28
|
-
state.
|
|
28
|
+
state.activeUids.forEach(setLowStreamType);
|
|
29
29
|
} else {
|
|
30
|
-
const [maxUid, ...minUids] = state.
|
|
30
|
+
const [maxUid, ...minUids] = state.activeUids;
|
|
31
31
|
// if (newMode === DualStreamMode.DYNAMIC)
|
|
32
32
|
// Max users are high other are low
|
|
33
33
|
//setting high for maxuid
|
|
@@ -37,7 +37,7 @@ export default function UpdateDualStreamMode(
|
|
|
37
37
|
}
|
|
38
38
|
stateUpdate = {
|
|
39
39
|
renderList: renderList,
|
|
40
|
-
|
|
40
|
+
activeUids: [...state.activeUids],
|
|
41
41
|
};
|
|
42
42
|
return stateUpdate;
|
|
43
43
|
}
|
|
@@ -32,11 +32,11 @@ export default function UserJoined(
|
|
|
32
32
|
...typeData,
|
|
33
33
|
},
|
|
34
34
|
};
|
|
35
|
-
let
|
|
36
|
-
? [...state.
|
|
37
|
-
: [...state.
|
|
38
|
-
const [maxUid] =
|
|
39
|
-
if (
|
|
35
|
+
let activeUids = state.activeUids.filter((i) => i === newUid).length
|
|
36
|
+
? [...state.activeUids]
|
|
37
|
+
: [...state.activeUids, newUid];
|
|
38
|
+
const [maxUid] = activeUids;
|
|
39
|
+
if (activeUids.length === 2 && maxUid === localUid) {
|
|
40
40
|
//Only one remote and local is maximized
|
|
41
41
|
//Change stream type to high if dualStreaMode is DYNAMIC
|
|
42
42
|
if (dualStreamMode === DualStreamMode.DYNAMIC) {
|
|
@@ -45,13 +45,13 @@ export default function UserJoined(
|
|
|
45
45
|
//Swap render positions
|
|
46
46
|
stateUpdate = {
|
|
47
47
|
renderList: renderList,
|
|
48
|
-
|
|
48
|
+
activeUids: activeUids.reverse(),
|
|
49
49
|
};
|
|
50
50
|
} else {
|
|
51
51
|
//More than one remote
|
|
52
52
|
stateUpdate = {
|
|
53
53
|
renderList: renderList,
|
|
54
|
-
|
|
54
|
+
activeUids: activeUids,
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -12,12 +12,12 @@ export default function UserOffline(
|
|
|
12
12
|
// if (updatedRenderList[action.value[0]]) {
|
|
13
13
|
// delete updatedRenderList[action.value[0]];
|
|
14
14
|
// }
|
|
15
|
-
const
|
|
15
|
+
const updatedActiveUids = [...state.activeUids].filter(
|
|
16
16
|
(uid) => uid !== action.value[0],
|
|
17
17
|
);
|
|
18
18
|
const stateUpdate: RenderStateInterface = {
|
|
19
19
|
renderList: state.renderList,
|
|
20
|
-
|
|
20
|
+
activeUids: updatedActiveUids,
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
return stateUpdate;
|
|
@@ -30,8 +30,8 @@ const Join: React.FC<{
|
|
|
30
30
|
console.error('Cannot leave the channel:', err);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
const {renderList,
|
|
34
|
-
const [maxUid] =
|
|
33
|
+
const {renderList, activeUids} = uidState;
|
|
34
|
+
const [maxUid] = activeUids;
|
|
35
35
|
const videoState = renderList[maxUid].video;
|
|
36
36
|
async function join() {
|
|
37
37
|
if (
|
|
@@ -46,7 +46,7 @@ const RtcConfigure = (props: {children: React.ReactNode}) => {
|
|
|
46
46
|
type: 'rtc',
|
|
47
47
|
},
|
|
48
48
|
},
|
|
49
|
-
|
|
49
|
+
activeUids: [localUid],
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
const [initialState, setInitialState] = React.useState(
|
|
@@ -97,7 +97,7 @@ const RtcConfigure = (props: {children: React.ReactNode}) => {
|
|
|
97
97
|
) => {
|
|
98
98
|
const newState = {
|
|
99
99
|
...state,
|
|
100
|
-
|
|
100
|
+
activeUids: [...state.activeUids, action.value[0]],
|
|
101
101
|
renderList: {
|
|
102
102
|
...state.renderList,
|
|
103
103
|
[action.value[0]]: {
|
|
@@ -203,28 +203,26 @@ const RtcConfigure = (props: {children: React.ReactNode}) => {
|
|
|
203
203
|
|
|
204
204
|
const swapVideo = useCallback(
|
|
205
205
|
(state: RenderStateInterface, newMaxUid: UidType) => {
|
|
206
|
-
if (state?.
|
|
206
|
+
if (state?.activeUids?.indexOf(newMaxUid) === -1) {
|
|
207
207
|
//skip the update if new max uid is not joined yet.
|
|
208
208
|
return {};
|
|
209
209
|
}
|
|
210
|
-
let
|
|
211
|
-
...state.
|
|
210
|
+
let activeUids: RenderStateInterface['activeUids'] = [
|
|
211
|
+
...state.activeUids,
|
|
212
212
|
];
|
|
213
213
|
let renderList: RenderStateInterface['renderList'] = {
|
|
214
214
|
...state.renderList,
|
|
215
215
|
};
|
|
216
216
|
|
|
217
217
|
// Element which is currently maximized
|
|
218
|
-
const [currentMaxUid] =
|
|
218
|
+
const [currentMaxUid] = activeUids;
|
|
219
219
|
|
|
220
220
|
if (currentMaxUid === newMaxUid) {
|
|
221
221
|
//skip the update if new max uid is already maximized
|
|
222
222
|
return {};
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
const newMaxUidOldPosition =
|
|
226
|
-
(i) => i === newMaxUid,
|
|
227
|
-
);
|
|
225
|
+
const newMaxUidOldPosition = activeUids.findIndex((i) => i === newMaxUid);
|
|
228
226
|
|
|
229
227
|
if (!newMaxUidOldPosition) {
|
|
230
228
|
return {};
|
|
@@ -242,11 +240,11 @@ const RtcConfigure = (props: {children: React.ReactNode}) => {
|
|
|
242
240
|
* else push newMaxUid at last position
|
|
243
241
|
*/
|
|
244
242
|
|
|
245
|
-
|
|
246
|
-
|
|
243
|
+
activeUids[0] = newMaxUid;
|
|
244
|
+
activeUids[newMaxUidOldPosition] = currentMaxUid;
|
|
247
245
|
|
|
248
246
|
return {
|
|
249
|
-
|
|
247
|
+
activeUids: activeUids,
|
|
250
248
|
renderList: renderList,
|
|
251
249
|
};
|
|
252
250
|
},
|
|
@@ -258,12 +256,12 @@ const RtcConfigure = (props: {children: React.ReactNode}) => {
|
|
|
258
256
|
*/
|
|
259
257
|
const dequeVideo = useCallback(
|
|
260
258
|
(state: RenderStateInterface, newMaxUid: UidType) => {
|
|
261
|
-
if (state?.
|
|
259
|
+
if (state?.activeUids?.indexOf(newMaxUid) === -1) {
|
|
262
260
|
//skip the update if new max uid is not joined yet.
|
|
263
261
|
return {};
|
|
264
262
|
}
|
|
265
|
-
let
|
|
266
|
-
...state.
|
|
263
|
+
let activeUids: RenderStateInterface['activeUids'] = [
|
|
264
|
+
...state.activeUids,
|
|
267
265
|
];
|
|
268
266
|
let renderList: RenderStateInterface['renderList'] = {
|
|
269
267
|
...state.renderList,
|
|
@@ -273,7 +271,7 @@ const RtcConfigure = (props: {children: React.ReactNode}) => {
|
|
|
273
271
|
return {};
|
|
274
272
|
}
|
|
275
273
|
// Element which is currently maximized
|
|
276
|
-
const [currentMaxUid] =
|
|
274
|
+
const [currentMaxUid] = activeUids;
|
|
277
275
|
|
|
278
276
|
if (currentMaxUid === newMaxUid) {
|
|
279
277
|
//skip the update if new max uid is already maximized
|
|
@@ -286,14 +284,14 @@ const RtcConfigure = (props: {children: React.ReactNode}) => {
|
|
|
286
284
|
// No need to modify the streamType if the mode is not dynamic
|
|
287
285
|
}
|
|
288
286
|
|
|
289
|
-
const minIds =
|
|
287
|
+
const minIds = activeUids.filter(
|
|
290
288
|
(uid) => uid !== newMaxUid && uid !== currentMaxUid,
|
|
291
289
|
);
|
|
292
290
|
|
|
293
|
-
|
|
291
|
+
activeUids = [newMaxUid, currentMaxUid, ...minIds];
|
|
294
292
|
|
|
295
293
|
return {
|
|
296
|
-
|
|
294
|
+
activeUids: activeUids,
|
|
297
295
|
renderList: renderList,
|
|
298
296
|
};
|
|
299
297
|
},
|
|
@@ -322,7 +320,7 @@ const RtcConfigure = (props: {children: React.ReactNode}) => {
|
|
|
322
320
|
<RenderProvider
|
|
323
321
|
value={{
|
|
324
322
|
renderList: uidState.renderList,
|
|
325
|
-
|
|
323
|
+
activeUids: uidState.activeUids,
|
|
326
324
|
}}>
|
|
327
325
|
{props.children}
|
|
328
326
|
</RenderProvider>
|
package/template/babel.config.js
CHANGED
|
@@ -25,7 +25,7 @@ module.exports = {
|
|
|
25
25
|
'customization-api': './customization-api/index.ts',
|
|
26
26
|
'customization-implementation':
|
|
27
27
|
'./customization-implementation/index.ts',
|
|
28
|
-
|
|
28
|
+
customization: getCustomizationApiPath(),
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
],
|
|
@@ -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 isMobileOrTablet from '../../../src/utils/isMobileOrTablet';
|
|
37
|
+
|
|
38
38
|
interface MediaDeviceInfo {
|
|
39
39
|
readonly deviceId: string;
|
|
40
40
|
readonly label: string;
|
|
@@ -40,7 +40,7 @@ export {useChatUIControl} from '../src/components/chat-ui/useChatUIControl';
|
|
|
40
40
|
export type {ChatUIControlInterface} from '../src/components/chat-ui/useChatUIControl';
|
|
41
41
|
export {useMessages} from '../src/app-state/useMessages';
|
|
42
42
|
export type {messageInterface} from '../src/app-state/useMessages';
|
|
43
|
-
export
|
|
43
|
+
export {SidePanelType} from '../src/subComponents/SidePanelEnum';
|
|
44
44
|
export {useSidePanel} from '../src/utils/useSidePanel';
|
|
45
45
|
|
|
46
46
|
//hook used to get/set username
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
import {customize} from './customize';
|
|
16
16
|
import configJSON from '../config.json';
|
|
17
17
|
|
|
18
|
-
let config = configJSON as unknown as ConfigInterface;
|
|
18
|
+
let $config = configJSON as unknown as ConfigInterface;
|
|
19
19
|
|
|
20
|
-
export {customize, config};
|
|
20
|
+
export {customize, $config};
|
|
21
21
|
export * from './action-library';
|
|
22
22
|
export * from './app-state';
|
|
23
23
|
export * from './customEvents';
|
|
@@ -17,7 +17,7 @@ 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
22
|
export type {RenderInterface, RenderStateInterface, UidType};
|
|
23
23
|
export type {
|
|
@@ -132,7 +132,7 @@ export interface CustomizationApiInterface {
|
|
|
132
132
|
/**
|
|
133
133
|
* Internationlization
|
|
134
134
|
*/
|
|
135
|
-
i18n?:
|
|
135
|
+
i18n?: I18nInterface[];
|
|
136
136
|
/**
|
|
137
137
|
* Life cycle events
|
|
138
138
|
*/
|
|
@@ -25,11 +25,6 @@ export {default as useIsVideoEnabled} from '../src/utils/useIsVideoEnabled';
|
|
|
25
25
|
export {useHistory, useParams} from '../src/components/Router';
|
|
26
26
|
|
|
27
27
|
//export common function
|
|
28
|
-
export {
|
|
29
|
-
|
|
30
|
-
useIsIOS,
|
|
31
|
-
useIsAndroid,
|
|
32
|
-
useIsDestop,
|
|
33
|
-
} from '../src/utils/common';
|
|
34
|
-
export {default as useIsMobileOrTablet} from '../src/utils/useIsMobileOrTablet';
|
|
28
|
+
export {isWeb, isIOS, isAndroid, isDestop} from '../src/utils/common';
|
|
29
|
+
export {default as isMobileOrTablet} from '../src/utils/isMobileOrTablet';
|
|
35
30
|
export {useLocalUid} from '../agora-rn-uikit';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export {default as createHook} from './createHook';
|
|
2
2
|
export {CustomizationProvider, useCustomization} from './useCustomization';
|
|
3
3
|
export type {CustomizationProviderProps} from './useCustomization';
|
|
4
|
-
export {default as customizationConfig} from '
|
|
4
|
+
export {default as customizationConfig} from 'customization';
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import {CustomizationApiInterface} from 'customization-api';
|
|
14
|
-
import customizationConfig from '
|
|
14
|
+
import customizationConfig from 'customization';
|
|
15
15
|
import createHook from './createHook';
|
|
16
16
|
|
|
17
17
|
const CustomizationContext: React.Context<CustomizationApiInterface> =
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
/*
|
|
14
|
-
getCustomizationApiPath - will return
|
|
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 customizationPathTs = './
|
|
18
|
-
const customizationPathTsx = './
|
|
17
|
+
const customizationPathTs = './customization/index.ts';
|
|
18
|
+
const customizationPathTsx = './customization/index.tsx';
|
|
19
19
|
const customizationDummyPath = './customization-implementation/dummyConfig.ts';
|
|
20
20
|
const getCustomizationApiPath = () => {
|
|
21
21
|
if (fs.existsSync(customizationPathTs)) {
|
package/template/esbuild.rsdk.go
CHANGED
|
@@ -72,9 +72,9 @@ func commonAliasResolver() api.Plugin {
|
|
|
72
72
|
},
|
|
73
73
|
)
|
|
74
74
|
|
|
75
|
-
pb.OnResolve(api.OnResolveOptions{Filter: "
|
|
75
|
+
pb.OnResolve(api.OnResolveOptions{Filter: "customization"},
|
|
76
76
|
func(args api.OnResolveArgs) (api.OnResolveResult, error) {
|
|
77
|
-
fpePath, err := filepath.Abs("./
|
|
77
|
+
fpePath, err := filepath.Abs("./customization/index.ts")
|
|
78
78
|
if err != nil {
|
|
79
79
|
log.Fatalln(err)
|
|
80
80
|
}
|
package/template/global.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ import {SessionProvider} from './components/SessionContext';
|
|
|
18
18
|
import {ImageBackground, SafeAreaView, StatusBar, Platform} from 'react-native';
|
|
19
19
|
import ColorConfigure from './components/ColorConfigure';
|
|
20
20
|
import Toast from '../react-native-toast-message';
|
|
21
|
-
import
|
|
21
|
+
import ToastConfig from './subComponents/ToastConfig';
|
|
22
22
|
import {isValidReactComponent} from './utils/common';
|
|
23
23
|
import DimensionProvider from './components/dimension/DimensionProvider';
|
|
24
24
|
import Error from './components/common/Error';
|
|
@@ -37,7 +37,6 @@ const AppWrapper = (props: AppWrapperProps) => {
|
|
|
37
37
|
}
|
|
38
38
|
return React.Fragment;
|
|
39
39
|
});
|
|
40
|
-
const toastConfig = useToastConfig();
|
|
41
40
|
|
|
42
41
|
return (
|
|
43
42
|
<AppRoot>
|
|
@@ -49,7 +48,7 @@ const AppWrapper = (props: AppWrapperProps) => {
|
|
|
49
48
|
// @ts-ignore textAlign not supported by TS definitions but is applied to web regardless
|
|
50
49
|
style={[{flex: 1}, Platform.select({web: {textAlign: 'left'}})]}>
|
|
51
50
|
<StatusBar hidden={true} />
|
|
52
|
-
<Toast ref={(ref) => Toast.setRef(ref)} config={
|
|
51
|
+
<Toast ref={(ref) => Toast.setRef(ref)} config={ToastConfig} />
|
|
53
52
|
<StorageProvider>
|
|
54
53
|
<GraphQLProvider>
|
|
55
54
|
<Router>
|