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.
Files changed (66) hide show
  1. package/package.json +1 -1
  2. package/template/Gulpfile.js +56 -16
  3. package/template/_gitignore +2 -2
  4. package/template/agora-rn-uikit/src/AgoraUIKit.tsx +2 -2
  5. package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +1 -1
  6. package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +2 -2
  7. package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +1 -1
  8. package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +1 -1
  9. package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +1 -1
  10. package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +1 -1
  11. package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +4 -4
  12. package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +7 -7
  13. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +1 -1
  14. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +1 -1
  15. package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +2 -2
  16. package/template/agora-rn-uikit/src/Rtc/Join.tsx +2 -2
  17. package/template/agora-rn-uikit/src/RtcConfigure.tsx +18 -20
  18. package/template/babel.config.js +1 -1
  19. package/template/bridge/rtc/webNg/RtcEngine.ts +2 -2
  20. package/template/customization-api/app-state.ts +1 -1
  21. package/template/customization-api/index.ts +2 -2
  22. package/template/customization-api/typeDefinition.ts +2 -2
  23. package/template/customization-api/utils.ts +2 -7
  24. package/template/customization-implementation/index.ts +1 -1
  25. package/template/customization-implementation/useCustomization.tsx +1 -1
  26. package/template/customization.config.js +3 -3
  27. package/template/esbuild.rsdk.go +2 -2
  28. package/template/global.d.ts +1 -1
  29. package/template/src/AppWrapper.tsx +2 -3
  30. package/template/src/atoms/TextInput.tsx +11 -15
  31. package/template/src/components/Chat.tsx +136 -144
  32. package/template/src/components/Controls.tsx +10 -15
  33. package/template/src/components/GridVideo.tsx +1 -2
  34. package/template/src/components/Navbar.tsx +162 -179
  35. package/template/src/components/ParticipantsView.tsx +88 -93
  36. package/template/src/components/Precall.tsx +2 -3
  37. package/template/src/components/RTMConfigure.tsx +5 -7
  38. package/template/src/components/SettingsView.tsx +1 -2
  39. package/template/src/components/participants/AllHostParticipants.tsx +3 -3
  40. package/template/src/components/participants/ParticipantName.tsx +1 -2
  41. package/template/src/components/precall/VideoPreview.native.tsx +2 -2
  42. package/template/src/components/precall/VideoPreview.tsx +2 -2
  43. package/template/src/components/precall/joinCallBtn.tsx +2 -4
  44. package/template/src/components/precall/selectDevice.tsx +1 -2
  45. package/template/src/components/styles.ts +3 -6
  46. package/template/src/components/useWakeLock.tsx +2 -4
  47. package/template/src/language/i18nTypes.ts +1 -1
  48. package/template/src/language/index.ts +2 -2
  49. package/template/src/pages/Create.tsx +1 -2
  50. package/template/src/pages/video-call/VideoCallScreen.tsx +1 -2
  51. package/template/src/pages/video-call/VideoComponent.tsx +2 -2
  52. package/template/src/subComponents/ChatBubble.tsx +1 -2
  53. package/template/src/subComponents/ChatContainer.tsx +45 -48
  54. package/template/src/subComponents/LayoutIconDropdown.tsx +1 -2
  55. package/template/src/subComponents/NetworkQualityPill.tsx +1 -2
  56. package/template/src/subComponents/OpenInNativeButton.tsx +1 -2
  57. package/template/src/subComponents/{useToastConfig.tsx → ToastConfig.tsx} +24 -27
  58. package/template/src/subComponents/chat/ChatParticipants.tsx +36 -40
  59. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +1 -1
  60. package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +1 -1
  61. package/template/src/utils/common.tsx +12 -15
  62. package/template/src/utils/isMobileOrTablet.native.ts +5 -0
  63. package/template/src/utils/isMobileOrTablet.ts +23 -0
  64. package/template/webpack.commons.js +1 -1
  65. package/template/src/utils/useIsMobileOrTablet.native.ts +0 -8
  66. package/template/src/utils/useIsMobileOrTablet.ts +0 -25
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-appbuilder-core",
3
- "version": "2.3.0-beta.30",
3
+ "version": "2.3.0-beta.31",
4
4
  "description": "React Native template for RTE app builder",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -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 ? 'agora-app-builder-sdk' : process.argv[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 {version, private, author, description, dependencies} = JSON.parse(
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 'test-fpe' {
130
- const data: {};
131
- export default data;
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
- 'declare module "agora-app-builder-sdk"',
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
- 'declare module "agora-app-builder-sdk"',
291
+ `declare module "${PACKAGE_NAME}"`,
252
292
  ),
253
293
  )
254
294
  .pipe(replace("'customization-api'", "'customization-api/index'"))
@@ -73,5 +73,5 @@ dist/
73
73
  .webpack/
74
74
  out/
75
75
 
76
- #FPE plugin folder
77
- template/test-fpe/*
76
+ #Customization plugin folder
77
+ template/customization/*
@@ -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, renderPosition}) => {
21
- const [maxUid, ...minUids] = renderPosition;
20
+ {({renderList, activeUids}) => {
21
+ const [maxUid, ...minUids] = activeUids;
22
22
  return (
23
23
  <>
24
24
  <MaxVideoView user={renderList[maxUid]} key={maxUid} />
@@ -11,7 +11,7 @@ export interface RenderObjects {
11
11
 
12
12
  export interface RenderStateInterface {
13
13
  renderList: RenderObjects;
14
- renderPosition: Array<UidType>;
14
+ activeUids: Array<UidType>;
15
15
  }
16
16
 
17
17
  export interface ActionInterface<T extends keyof CallbacksInterface> {
@@ -30,10 +30,10 @@ function Controls(props: ControlsPropsInterface) {
30
30
  </View>
31
31
  {showButton ? (
32
32
  <RenderConsumer>
33
- {({renderList, renderPosition}) => (
33
+ {({renderList, activeUids}) => (
34
34
  <View style={{...styles.Controls, top: styles.Controls.top - 100}}>
35
35
  <RemoteControls
36
- user={renderList[renderPosition[0]]}
36
+ user={renderList[activeUids[0]]}
37
37
  showRemoteSwap={false}
38
38
  />
39
39
  </View>
@@ -17,7 +17,7 @@ export default function LocalMuteAudio(
17
17
  audio: action.value[0],
18
18
  },
19
19
  },
20
- renderPosition: [...state.renderPosition],
20
+ activeUids: [...state.activeUids],
21
21
  };
22
22
  return stateUpdate;
23
23
  }
@@ -17,7 +17,7 @@ export default function LocalMuteVideo(
17
17
  video: action.value[0],
18
18
  },
19
19
  },
20
- renderPosition: [...state.renderPosition],
20
+ activeUids: [...state.activeUids],
21
21
  };
22
22
  return stateUpdate;
23
23
  }
@@ -20,7 +20,7 @@ export default function RemoteAudioStateChanged(
20
20
  audio: audioState,
21
21
  },
22
22
  },
23
- renderPosition: [...state.renderPosition],
23
+ activeUids: [...state.activeUids],
24
24
  };
25
25
  return stateUpdate;
26
26
  }
@@ -23,7 +23,7 @@ export default function RemoteVideoStateChanged(
23
23
  : state.renderList[action.value[0]].video,
24
24
  },
25
25
  },
26
- renderPosition: [...state.renderPosition],
26
+ activeUids: [...state.activeUids],
27
27
  };
28
28
  return stateUpdate;
29
29
  }
@@ -22,12 +22,12 @@ export default function UpdateDualStreamMode(
22
22
 
23
23
  if (newMode === DualStreamMode.HIGH) {
24
24
  // Update everybody to high
25
- state.renderPosition.forEach(setHighStreamType);
25
+ state.activeUids.forEach(setHighStreamType);
26
26
  } else if (newMode === DualStreamMode.LOW) {
27
27
  // Update everybody to low
28
- state.renderPosition.forEach(setLowStreamType);
28
+ state.activeUids.forEach(setLowStreamType);
29
29
  } else {
30
- const [maxUid, ...minUids] = state.renderPosition;
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
- renderPosition: [...state.renderPosition],
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 renderPosition = state.renderPosition.filter((i) => i === newUid).length
36
- ? [...state.renderPosition]
37
- : [...state.renderPosition, newUid];
38
- const [maxUid] = renderPosition;
39
- if (renderPosition.length === 2 && maxUid === localUid) {
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
- renderPosition: renderPosition.reverse(),
48
+ activeUids: activeUids.reverse(),
49
49
  };
50
50
  } else {
51
51
  //More than one remote
52
52
  stateUpdate = {
53
53
  renderList: renderList,
54
- renderPosition: renderPosition,
54
+ activeUids: activeUids,
55
55
  };
56
56
  }
57
57
 
@@ -12,7 +12,7 @@ export default function UserMuteRemoteAudio(
12
12
  audio: action.value[1],
13
13
  },
14
14
  },
15
- renderPosition: [...state.renderPosition],
15
+ activeUids: [...state.activeUids],
16
16
  };
17
17
  return stateUpdate;
18
18
  }
@@ -12,7 +12,7 @@ export default function UserMuteRemoteVideo(
12
12
  video: action.value[1],
13
13
  },
14
14
  },
15
- renderPosition: [...state.renderPosition],
15
+ activeUids: [...state.activeUids],
16
16
  };
17
17
  return stateUpdate;
18
18
  }
@@ -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 updatedRenderPosition = [...state.renderPosition].filter(
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
- renderPosition: updatedRenderPosition,
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, renderPosition} = uidState;
34
- const [maxUid] = renderPosition;
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
- renderPosition: [localUid],
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
- renderPosition: [...state.renderPosition, action.value[0]],
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?.renderPosition?.indexOf(newMaxUid) === -1) {
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 renderPosition: RenderStateInterface['renderPosition'] = [
211
- ...state.renderPosition,
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] = renderPosition;
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 = renderPosition.findIndex(
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
- renderPosition[0] = newMaxUid;
246
- renderPosition[newMaxUidOldPosition] = currentMaxUid;
243
+ activeUids[0] = newMaxUid;
244
+ activeUids[newMaxUidOldPosition] = currentMaxUid;
247
245
 
248
246
  return {
249
- renderPosition: renderPosition,
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?.renderPosition?.indexOf(newMaxUid) === -1) {
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 renderPosition: RenderStateInterface['renderPosition'] = [
266
- ...state.renderPosition,
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] = renderPosition;
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 = renderPosition.filter(
287
+ const minIds = activeUids.filter(
290
288
  (uid) => uid !== newMaxUid && uid !== currentMaxUid,
291
289
  );
292
290
 
293
- renderPosition = [newMaxUid, currentMaxUid, ...minIds];
291
+ activeUids = [newMaxUid, currentMaxUid, ...minIds];
294
292
 
295
293
  return {
296
- renderPosition: renderPosition,
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
- renderPosition: uidState.renderPosition,
323
+ activeUids: uidState.activeUids,
326
324
  }}>
327
325
  {props.children}
328
326
  </RenderProvider>
@@ -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
- 'test-fpe': getCustomizationApiPath(),
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 useIsMobileOrTablet from '../../../src/utils/useIsMobileOrTablet';
37
- const isMobileOrTablet = useIsMobileOrTablet();
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 type {SidePanelType} from '../src/subComponents/SidePanelEnum';
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 {i18nInterface} from '../src/language/i18nTypes';
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?: i18nInterface[];
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
- useIsWeb,
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 'test-fpe';
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 'test-fpe';
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 test-fpe if exists otherwise it will return the dummy customization path
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 = './test-fpe/index.ts';
18
- const customizationPathTsx = './test-fpe/index.tsx';
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)) {
@@ -72,9 +72,9 @@ func commonAliasResolver() api.Plugin {
72
72
  },
73
73
  )
74
74
 
75
- pb.OnResolve(api.OnResolveOptions{Filter: "test-fpe"},
75
+ pb.OnResolve(api.OnResolveOptions{Filter: "customization"},
76
76
  func(args api.OnResolveArgs) (api.OnResolveResult, error) {
77
- fpePath, err := filepath.Abs("./test-fpe/index.ts")
77
+ fpePath, err := filepath.Abs("./customization/index.ts")
78
78
  if err != nil {
79
79
  log.Fatalln(err)
80
80
  }
@@ -78,7 +78,7 @@ interface ConfigInterface {
78
78
  AUDIO_ROOM: boolean;
79
79
  }
80
80
  declare var $config: ConfigInterface;
81
- declare module 'test-fpe' {
81
+ declare module 'customization' {
82
82
  const customizationConfig: {};
83
83
  export default customizationConfig;
84
84
  }
@@ -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 useToastConfig from './subComponents/useToastConfig';
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={toastConfig} />
51
+ <Toast ref={(ref) => Toast.setRef(ref)} config={ToastConfig} />
53
52
  <StorageProvider>
54
53
  <GraphQLProvider>
55
54
  <Router>