agora-appbuilder-core 2.3.0-beta.4 → 2.3.0-beta.7

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 (30) hide show
  1. package/package.json +2 -2
  2. package/template/Gulpfile.js +100 -12
  3. package/template/_package-lock.json +75 -49
  4. package/template/agora-rn-uikit/src/Rtc/Create.tsx +8 -1
  5. package/template/esbuild.rsdk.go +20 -6
  6. package/template/fpe-api/components.ts +1 -0
  7. package/template/fpe-api/typeDefinition.ts +7 -5
  8. package/template/package.json +3 -2
  9. package/template/src/components/Chat.tsx +9 -0
  10. package/template/src/components/ChatContext.ts +6 -2
  11. package/template/src/components/RTMConfigure.tsx +11 -29
  12. package/template/src/components/contexts/LiveStreamDataContext.tsx +3 -3
  13. package/template/src/components/livestream/LiveStreamContext.tsx +6 -3
  14. package/template/src/components/precall/textInput.tsx +1 -1
  15. package/template/src/components/useShareLink.tsx +37 -39
  16. package/template/src/components/useUserPreference.tsx +125 -0
  17. package/template/src/custom-events/CustomEvents.ts +28 -13
  18. package/template/src/language/default-labels/videoCallScreenLabels.ts +4 -2
  19. package/template/src/pages/Create.tsx +5 -1
  20. package/template/src/pages/Join.tsx +4 -1
  21. package/template/src/pages/VideoCall.tsx +51 -48
  22. package/template/src/rtm-events/constants.ts +3 -1
  23. package/template/src/subComponents/ChatBubble.tsx +3 -1
  24. package/template/src/subComponents/ChatContainer.tsx +15 -15
  25. package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +10 -9
  26. package/template/src/utils/getMeetingInvite.ts +38 -15
  27. package/template/src/utils/useGetName.ts +2 -3
  28. package/template/src/utils/useJoinMeeting.ts +22 -14
  29. package/template/src/utils/useLocalShareScreenUid.ts +19 -0
  30. package/template/src/utils/useSetName.ts +2 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-appbuilder-core",
3
- "version": "2.3.0-beta.4",
3
+ "version": "2.3.0-beta.7",
4
4
  "description": "React Native template for RTE app builder",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -13,7 +13,7 @@
13
13
  "deps": "cd template && npm i",
14
14
  "dev-setup": "npm run uikit && npm run deps && node devSetup.js",
15
15
  "web-build": "cd template && npm run web:build && cd .. && npm run copy-vercel",
16
- "copy-vercel": "cp vercel.json Builds/web",
16
+ "copy-vercel": "cp -r Builds/web template/dist && cp vercel.json template/dist",
17
17
  "pre-release": "cd template && cp package-lock.json _package-lock.json"
18
18
  },
19
19
  "author": {
@@ -24,14 +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 BUILD_PATH =
28
- process.env.TARGET === 'wsdk'
27
+ const outPathArg = process.argv.indexOf('--outpath')
28
+ getBuildPath = () => {
29
+ if (outPathArg == -1) {
30
+ return process.env.TARGET === 'wsdk'
29
31
  ? path.join(__dirname, '../Builds/web-sdk')
30
32
  : process.env.TARGET === 'rsdk'
31
33
  ? path.join(__dirname, '../Builds/react-sdk')
32
34
  : process.env.TARGET === 'android'
33
35
  ? path.join(__dirname, '../Builds/android')
34
36
  : path.join(__dirname, '../Builds/.electron');
37
+ } else {
38
+ return process.argv[outPathArg+1].split('/').slice(0, -1).join('/')
39
+ }
40
+ }
41
+ const BUILD_PATH = getBuildPath();
42
+ const TS_DEFS_BUILD_PATH = process.env.TARGET === 'wsdk'
43
+ ? path.join(__dirname, '../Builds/ts-defs/web-sdk')
44
+ : process.env.TARGET === 'rsdk'
45
+ ? path.join(__dirname, '../Builds/ts-defs/react-sdk')
46
+ : process.env.TARGET === 'android'
47
+ ? path.join(__dirname, '../Builds/ts-defs/android')
48
+ : path.join(__dirname, '../Builds/ts-defs/.electron');
49
+
50
+ const pkgNameArg = process.argv.indexOf('--pkgname')
51
+ const PACKAGE_NAME = pkgNameArg == -1
52
+ ? 'agora-app-builder-sdk'
53
+ : process.argv[pkgNameArg+1]
35
54
 
36
55
  let PRODUCT_NAME;
37
56
 
@@ -73,7 +92,7 @@ const general = {
73
92
  });
74
93
 
75
94
  let newPackage = {
76
- name: 'agora-app-builder-sdk',
95
+ name: PACKAGE_NAME,
77
96
  version,
78
97
  private,
79
98
  author,
@@ -129,6 +148,15 @@ const general = {
129
148
  typescriptClean: () => {
130
149
  return del([`${path.join(BUILD_PATH, '../', '/')}*.d.ts`], {force: true});
131
150
  },
151
+ genTsDefs: (cb) => {
152
+ runCli(`mkdir -p ${TS_DEFS_BUILD_PATH} && cp ${BUILD_PATH}/index.d.ts ${TS_DEFS_BUILD_PATH}/index.d.ts`, cb);
153
+ },
154
+ useTsDefs: (cb) => {
155
+ runCli(`cp ${TS_DEFS_BUILD_PATH}/index.d.ts ${BUILD_PATH}/index.d.ts`, cb)
156
+ },
157
+ npmPack: (cb) => {
158
+ runCli(`cd ${BUILD_PATH} && npm pack`, cb)
159
+ }
132
160
  };
133
161
 
134
162
  const electron = {
@@ -167,7 +195,18 @@ const reactSdk = {
167
195
  runCli('webpack --config ./webpack.rsdk.config.js', cb);
168
196
  },
169
197
  esbuild: (cb) => {
170
- runCli('go build -o ../esbuild-bin/rsdk ./esbuild.rsdk.go && ../esbuild-bin/rsdk', cb);
198
+ let outPath = '';
199
+ if (outPathArg != -1) {
200
+ outPath = ` --outpath ${process.argv[outPathArg+1]}`
201
+ }
202
+ let configTransformerPath = '';
203
+ const configTransformerPathArg = process.argv.indexOf('--configtransformerpath')
204
+ if (configTransformerPathArg != -1) {
205
+ configTransformerPath = ` --configtransformerpath ${process.argv[configTransformerPathArg+1]}`
206
+ }
207
+ let esbuildCmd = `go build -o ../esbuild-bin/rsdk ./esbuild.rsdk.go && ../esbuild-bin/rsdk${outPath}${configTransformerPath}`
208
+ console.log(esbuildCmd)
209
+ runCli(esbuildCmd, cb);
171
210
  },
172
211
  typescript: (cb) => {
173
212
  runCli(
@@ -189,9 +228,6 @@ const reactSdk = {
189
228
  .pipe(replace('"fpe-api"', '"fpe-api/index"'))
190
229
  .pipe(header('// @ts-nocheck\n'))
191
230
  .pipe(dest(BUILD_PATH));
192
- },
193
- npmPack: (cb) => {
194
- runCli('cd ../Builds/react-sdk && npm pack',cb)
195
231
  }
196
232
  };
197
233
 
@@ -284,7 +320,7 @@ module.exports.reactSdk = series(
284
320
  reactSdk.typescript,
285
321
  reactSdk.typescriptFix,
286
322
  general.typescriptClean,
287
- reactSdk.npmPack,
323
+ general.npmPack,
288
324
  );
289
325
 
290
326
  // react-sdk-esbuild
@@ -298,7 +334,31 @@ module.exports.reactSdkEsbuild = series (
298
334
  reactSdk.typescript,
299
335
  reactSdk.typescriptFix,
300
336
  general.typescriptClean,
301
- reactSdk.npmPack,
337
+ general.npmPack,
338
+ )
339
+
340
+ // generate typescript definitions
341
+ module.exports.makeRsdkTsDefs = series (
342
+ general.clean,
343
+ general.createBuildDirectory,
344
+ general.packageJson,
345
+ reactSdk.esbuild,
346
+ general.typescript,
347
+ general.typescriptFix,
348
+ reactSdk.typescript,
349
+ reactSdk.typescriptFix,
350
+ general.typescriptClean,
351
+ general.genTsDefs,
352
+ )
353
+
354
+ // react-sdk-esbuild with cached type definitions
355
+ module.exports.reactSdkEsbuildCachedTsc = series (
356
+ general.clean,
357
+ general.createBuildDirectory,
358
+ general.packageJson,
359
+ reactSdk.esbuild,
360
+ general.useTsDefs,
361
+ general.npmPack,
302
362
  )
303
363
 
304
364
  // web-sdk
@@ -316,13 +376,41 @@ module.exports.webSdk = series(
316
376
  general.typescriptClean,
317
377
  ),
318
378
  ),
319
- webSdk.npmPack,
379
+ general.npmPack,
380
+ );
381
+
382
+ module.exports.makeWsdkTsDefs = series(
383
+ general.clean,
384
+ general.createBuildDirectory,
385
+ general.packageJson,
386
+ parallel(
387
+ webSdk.webpack,
388
+ series(
389
+ general.typescript,
390
+ general.typescriptFix,
391
+ webSdk.typescript,
392
+ webSdk.typescriptFix,
393
+ general.typescriptClean,
394
+ ),
395
+ ),
396
+ general.genTsDefs,
397
+ );
398
+
399
+ module.exports.webSdkCachedTsc = series(
400
+ general.clean,
401
+ general.createBuildDirectory,
402
+ general.packageJson,
403
+ parallel(
404
+ webSdk.webpack,
405
+ general.useTsDefs,
406
+ ),
407
+ general.npmPack,
320
408
  );
321
409
 
322
410
  module.exports.androidUnix = series(
323
411
  general.clean,
324
412
  general.createBuildDirectory,
325
- // android.gradleBuildUnix,
413
+ android.gradleBuildUnix,
326
414
  android.copyBuild,
327
415
  );
328
416
 
@@ -334,7 +422,7 @@ module.exports.androidWin = series(
334
422
  );
335
423
 
336
424
  module.exports.test = series(
337
- reactSdk.npmPack,
425
+ general.npmPack,
338
426
  // general.typescript,
339
427
  // general.typescriptFix,
340
428
  // reactSdk.typescript,
@@ -6631,9 +6631,9 @@
6631
6631
  }
6632
6632
  },
6633
6633
  "node_modules/acorn": {
6634
- "version": "7.4.1",
6635
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
6636
- "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
6634
+ "version": "8.8.0",
6635
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz",
6636
+ "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==",
6637
6637
  "dev": true,
6638
6638
  "bin": {
6639
6639
  "acorn": "bin/acorn"
@@ -12231,6 +12231,18 @@
12231
12231
  "node": ">=6.0.0"
12232
12232
  }
12233
12233
  },
12234
+ "node_modules/espree/node_modules/acorn": {
12235
+ "version": "7.4.1",
12236
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
12237
+ "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
12238
+ "dev": true,
12239
+ "bin": {
12240
+ "acorn": "bin/acorn"
12241
+ },
12242
+ "engines": {
12243
+ "node": ">=0.4.0"
12244
+ }
12245
+ },
12234
12246
  "node_modules/esprima": {
12235
12247
  "version": "4.0.1",
12236
12248
  "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
@@ -20243,6 +20255,18 @@
20243
20255
  }
20244
20256
  }
20245
20257
  },
20258
+ "node_modules/jsdom/node_modules/acorn": {
20259
+ "version": "7.4.1",
20260
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
20261
+ "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
20262
+ "dev": true,
20263
+ "bin": {
20264
+ "acorn": "bin/acorn"
20265
+ },
20266
+ "engines": {
20267
+ "node": ">=0.4.0"
20268
+ }
20269
+ },
20246
20270
  "node_modules/jsdom/node_modules/tough-cookie": {
20247
20271
  "version": "3.0.1",
20248
20272
  "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz",
@@ -26213,6 +26237,14 @@
26213
26237
  "node": ">=6"
26214
26238
  }
26215
26239
  },
26240
+ "node_modules/stacktrace-parser/node_modules/type-fest": {
26241
+ "version": "0.7.1",
26242
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz",
26243
+ "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==",
26244
+ "engines": {
26245
+ "node": ">=8"
26246
+ }
26247
+ },
26216
26248
  "node_modules/stat-mode": {
26217
26249
  "version": "1.0.0",
26218
26250
  "resolved": "https://registry.npmjs.org/stat-mode/-/stat-mode-1.0.0.tgz",
@@ -26770,18 +26802,6 @@
26770
26802
  }
26771
26803
  }
26772
26804
  },
26773
- "node_modules/terser-webpack-plugin/node_modules/acorn": {
26774
- "version": "8.8.0",
26775
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz",
26776
- "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==",
26777
- "dev": true,
26778
- "bin": {
26779
- "acorn": "bin/acorn"
26780
- },
26781
- "engines": {
26782
- "node": ">=0.4.0"
26783
- }
26784
- },
26785
26805
  "node_modules/terser-webpack-plugin/node_modules/has-flag": {
26786
26806
  "version": "4.0.0",
26787
26807
  "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
@@ -27325,11 +27345,17 @@
27325
27345
  }
27326
27346
  },
27327
27347
  "node_modules/type-fest": {
27328
- "version": "0.7.1",
27329
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz",
27330
- "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==",
27348
+ "version": "2.18.0",
27349
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.0.tgz",
27350
+ "integrity": "sha512-pRS+/yrW5TjPPHNOvxhbNZexr2bS63WjrMU8a+VzEBhUi9Tz1pZeD+vQz3ut0svZ46P+SRqMEPnJmk2XnvNzTw==",
27351
+ "dev": true,
27352
+ "optional": true,
27353
+ "peer": true,
27331
27354
  "engines": {
27332
- "node": ">=8"
27355
+ "node": ">=12.20"
27356
+ },
27357
+ "funding": {
27358
+ "url": "https://github.com/sponsors/sindresorhus"
27333
27359
  }
27334
27360
  },
27335
27361
  "node_modules/type-is": {
@@ -28750,18 +28776,6 @@
28750
28776
  "node": ">=10.13.0"
28751
28777
  }
28752
28778
  },
28753
- "node_modules/webpack/node_modules/acorn": {
28754
- "version": "8.8.0",
28755
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz",
28756
- "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==",
28757
- "dev": true,
28758
- "bin": {
28759
- "acorn": "bin/acorn"
28760
- },
28761
- "engines": {
28762
- "node": ">=0.4.0"
28763
- }
28764
- },
28765
28779
  "node_modules/webpack/node_modules/enhanced-resolve": {
28766
28780
  "version": "5.10.0",
28767
28781
  "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz",
@@ -34323,9 +34337,9 @@
34323
34337
  }
34324
34338
  },
34325
34339
  "acorn": {
34326
- "version": "7.4.1",
34327
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
34328
- "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
34340
+ "version": "8.8.0",
34341
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz",
34342
+ "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==",
34329
34343
  "dev": true
34330
34344
  },
34331
34345
  "acorn-globals": {
@@ -38670,6 +38684,14 @@
38670
38684
  "acorn": "^7.1.1",
38671
38685
  "acorn-jsx": "^5.2.0",
38672
38686
  "eslint-visitor-keys": "^1.1.0"
38687
+ },
38688
+ "dependencies": {
38689
+ "acorn": {
38690
+ "version": "7.4.1",
38691
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
38692
+ "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
38693
+ "dev": true
38694
+ }
38673
38695
  }
38674
38696
  },
38675
38697
  "esprima": {
@@ -44861,6 +44883,12 @@
44861
44883
  "xml-name-validator": "^3.0.0"
44862
44884
  },
44863
44885
  "dependencies": {
44886
+ "acorn": {
44887
+ "version": "7.4.1",
44888
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
44889
+ "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
44890
+ "dev": true
44891
+ },
44864
44892
  "tough-cookie": {
44865
44893
  "version": "3.0.1",
44866
44894
  "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz",
@@ -49666,6 +49694,13 @@
49666
49694
  "integrity": "sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg==",
49667
49695
  "requires": {
49668
49696
  "type-fest": "^0.7.1"
49697
+ },
49698
+ "dependencies": {
49699
+ "type-fest": {
49700
+ "version": "0.7.1",
49701
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz",
49702
+ "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg=="
49703
+ }
49669
49704
  }
49670
49705
  },
49671
49706
  "stat-mode": {
@@ -50094,12 +50129,6 @@
50094
50129
  "terser": "^5.7.2"
50095
50130
  },
50096
50131
  "dependencies": {
50097
- "acorn": {
50098
- "version": "8.8.0",
50099
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz",
50100
- "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==",
50101
- "dev": true
50102
- },
50103
50132
  "has-flag": {
50104
50133
  "version": "4.0.0",
50105
50134
  "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
@@ -50515,9 +50544,12 @@
50515
50544
  "dev": true
50516
50545
  },
50517
50546
  "type-fest": {
50518
- "version": "0.7.1",
50519
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz",
50520
- "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg=="
50547
+ "version": "2.18.0",
50548
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.0.tgz",
50549
+ "integrity": "sha512-pRS+/yrW5TjPPHNOvxhbNZexr2bS63WjrMU8a+VzEBhUi9Tz1pZeD+vQz3ut0svZ46P+SRqMEPnJmk2XnvNzTw==",
50550
+ "dev": true,
50551
+ "optional": true,
50552
+ "peer": true
50521
50553
  },
50522
50554
  "type-is": {
50523
50555
  "version": "1.6.18",
@@ -51167,12 +51199,6 @@
51167
51199
  "webpack-sources": "^3.2.3"
51168
51200
  },
51169
51201
  "dependencies": {
51170
- "acorn": {
51171
- "version": "8.8.0",
51172
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz",
51173
- "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==",
51174
- "dev": true
51175
- },
51176
51202
  "enhanced-resolve": {
51177
51203
  "version": "5.10.0",
51178
51204
  "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz",
@@ -247,7 +247,14 @@ const Create = ({
247
247
  }
248
248
  init();
249
249
  return () => {
250
- engine.current!.destroy();
250
+ /**
251
+ * if condition add for websdk issue
252
+ * For some reason even if engine.current is defined somehow destroy gets undefined and
253
+ * causes a crash so thats why this check is needed before we call the method
254
+ */
255
+ if (engine.current.destroy) {
256
+ engine.current!.destroy();
257
+ }
251
258
  };
252
259
  }, [rtcProps.appId]);
253
260
 
@@ -1,6 +1,7 @@
1
1
  package main
2
2
 
3
3
  import (
4
+ "flag"
4
5
  "log"
5
6
  "os"
6
7
  "path/filepath"
@@ -9,6 +10,11 @@ import (
9
10
  "github.com/evanw/esbuild/pkg/api"
10
11
  )
11
12
 
13
+ type ioPaths struct {
14
+ outPath string
15
+ configTransformerPath string
16
+ }
17
+
12
18
  func commonAliasResolver() api.Plugin {
13
19
  aliasResolvers := api.Plugin{
14
20
  Name: "importAliases",
@@ -152,7 +158,7 @@ func commonLoader() map[string]api.Loader {
152
158
  return loader
153
159
  }
154
160
 
155
- func common() api.BuildOptions {
161
+ func common(iopath *ioPaths) api.BuildOptions {
156
162
  commonBuildOpts := api.BuildOptions{
157
163
  // we can safely ignore (webpack) plugins for now because they seem to be used only for not reactsdk
158
164
 
@@ -164,14 +170,14 @@ func common() api.BuildOptions {
164
170
  Define: map[string]string{
165
171
  "$config": "config",
166
172
  },
167
- Inject: []string{"./esbuildConfigTransform.js"},
173
+ Inject: []string{iopath.configTransformerPath},
168
174
  }
169
175
 
170
176
  return commonBuildOpts
171
177
  }
172
178
 
173
- func rsdk() api.BuildResult {
174
- commonBuildOpts := common()
179
+ func rsdk(iopath *ioPaths) api.BuildResult {
180
+ commonBuildOpts := common(iopath)
175
181
  rsdkBuildOpts := api.BuildOptions{
176
182
  // build options common to rsdk and other components
177
183
  Plugins: commonBuildOpts.Plugins,
@@ -197,7 +203,7 @@ func rsdk() api.BuildResult {
197
203
  // bundle in cjs format because this index.js is meant to be used by other host applications
198
204
  // like webpack which runs on node
199
205
  Format: api.FormatCommonJS,
200
- Outfile: "../Builds/react-sdk/index.js",
206
+ Outfile: iopath.outPath,
201
207
 
202
208
  // other esbuild options
203
209
  Write: true,
@@ -215,7 +221,15 @@ func rsdk() api.BuildResult {
215
221
  }
216
222
 
217
223
  func main() {
218
- rsdkRes := rsdk()
224
+ outPath := flag.String("outpath", "../Builds/react-sdk/index.js", "path to write bundled js file")
225
+ configTransformerPath := flag.String("configtransformerpath", "./esbuildConfigTransform.js", "path to inject file")
226
+ flag.Parse()
227
+ iopath := &ioPaths{
228
+ outPath: *outPath,
229
+ configTransformerPath: *configTransformerPath,
230
+ }
231
+ log.Println("esbuild args = ", iopath)
232
+ rsdkRes := rsdk(iopath)
219
233
  if len(rsdkRes.Errors) > 0 {
220
234
  spew.Dump(rsdkRes)
221
235
  log.Fatalln("build failed")
@@ -18,6 +18,7 @@ export {
18
18
  ParticipantsView,
19
19
  Controls,
20
20
  ControlsComponentsArray,
21
+ ChatBubble,
21
22
  } from '../src/pages/video-call/index';
22
23
  export {default as GridLayout} from '../src/components/GridVideo';
23
24
  export {default as PinnedLayout} from '../src/components/PinnedVideo';
@@ -45,10 +45,13 @@ export interface PreCallInterface extends BeforeAndAfterInterface {
45
45
  joinButton?: React.ComponentType;
46
46
  textBox?: React.ComponentType;
47
47
  }
48
- export interface ChatCmpInterface extends BeforeAndAfterInterface {
48
+ export interface ChatCmpInterface {
49
+ //commented for v1 release
50
+ //extends BeforeAndAfterInterface
49
51
  chatBubble?: React.ComponentType<ChatBubbleProps>;
50
- chatInput?: React.ComponentType<ChatTextInputProps>;
51
- chatSentButton?: React.ComponentType<ChatSendButtonProps>;
52
+ //commented for v1 release
53
+ //chatInput?: React.ComponentType<ChatTextInputProps>;
54
+ //chatSentButton?: React.ComponentType<ChatSendButtonProps>;
52
55
  }
53
56
 
54
57
  export interface renderComponentInterface {
@@ -85,8 +88,7 @@ export interface VideoCallInterface extends BeforeAndAfterInterface {
85
88
  //settingsPanel?: React.ComponentType;
86
89
  participantsPanel?: React.ComponentType;
87
90
  bottomBar?: React.ComponentType;
88
- // commented for v1 release
89
- //chat?: ChatCmpInterface;
91
+ chat?: ChatCmpInterface;
90
92
  customContent?: renderComponentObjectInterface;
91
93
  customLayout?: (layouts: layoutObjectType[]) => layoutObjectType[];
92
94
  }
@@ -18,7 +18,6 @@
18
18
  "web-sdk:build": "cross-env TARGET=wsdk NODE_ENV=production gulp webSdk",
19
19
  "react-sdk": "cross-env TARGET=rsdk NODE_ENV=development gulp reactSdk",
20
20
  "react-sdk:build": "cross-env TARGET=rsdk NODE_ENV=production gulp reactSdk",
21
- "react-sdk-esbuild": "cross-env TARGET=rsdk NODE_ENV=production gulp reactSdkEsbuild",
22
21
  "electron:start": "cross-env NODE_ENV=development gulp electron_development",
23
22
  "electron:build": "cross-env NODE_ENV=production gulp electron_build",
24
23
  "windows": "cross-env TARGET=windows npm run electron:start",
@@ -32,7 +31,9 @@
32
31
  "icons:android": "react-native set-icon --path ./build/icon.png",
33
32
  "icons:ios": "react-native set-icon --path ./build/icon.png",
34
33
  "package:mac": "npm run mac:build && electron-builder --publish=always",
35
- "release": "electron-builder --mac --windows --linux --publish always --config ./electron-builder.js "
34
+ "release": "electron-builder --mac --windows --linux --publish always --config ./electron-builder.js ",
35
+ "make-rsdk-ts-defs": "cross-env TARGET=rsdk NODE_ENV=production gulp makeRsdkTsDefs",
36
+ "make-wsdk-ts-defs": "cross-env TARGET=wsdk NODE_ENV=production gulp makeWsdkTsDefs"
36
37
  },
37
38
  "publish": [
38
39
  {
@@ -59,6 +59,15 @@ const Chat = () => {
59
59
 
60
60
  const {primaryColor} = useContext(ColorContext);
61
61
 
62
+ React.useEffect(() => {
63
+ return () => {
64
+ // reset both the active tabs
65
+ setGroupActive(false);
66
+ setPrivateActive(false);
67
+ setSelectedUser(0);
68
+ };
69
+ }, []);
70
+
62
71
  const selectGroup = () => {
63
72
  setPrivateActive(false);
64
73
  setGroupActive(true);
@@ -18,6 +18,12 @@ export interface ChatBubbleProps {
18
18
  message: string;
19
19
  timestamp: string;
20
20
  uid: UidType;
21
+ render?: (
22
+ isLocal: boolean,
23
+ message: string,
24
+ timestamp: string,
25
+ uid: UidType,
26
+ ) => JSX.Element;
21
27
  }
22
28
 
23
29
  export interface messageStoreInterface {
@@ -58,8 +64,6 @@ export interface chatContext {
58
64
  engine: RtmEngine;
59
65
  localUid: UidType;
60
66
  onlineUsersCount: number;
61
- displayName: string;
62
- setDisplayName: React.Dispatch<SetStateAction<string>>;
63
67
  }
64
68
 
65
69
  export enum controlMessageEnum {