agora-appbuilder-core 2.3.0-beta.9 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/Readme.md +11 -6
  2. package/package.json +1 -1
  3. package/template/Gulpfile.js +121 -83
  4. package/template/_gitignore +2 -2
  5. package/template/_package-lock.json +12959 -13248
  6. package/template/agora-rn-uikit/src/AgoraUIKit.tsx +2 -2
  7. package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +2 -0
  8. package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +3 -3
  9. package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +4 -5
  10. package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +3 -1
  11. package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +2 -2
  12. package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +1 -1
  13. package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +1 -1
  14. package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +1 -1
  15. package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +1 -1
  16. package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +4 -4
  17. package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +7 -5
  18. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +1 -1
  19. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +1 -1
  20. package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +2 -2
  21. package/template/agora-rn-uikit/src/Rtc/Create.tsx +88 -43
  22. package/template/agora-rn-uikit/src/Rtc/Join.tsx +13 -4
  23. package/template/agora-rn-uikit/src/RtcConfigure.tsx +36 -19
  24. package/template/agora-rn-uikit/src/Utils/permission.ts +17 -6
  25. package/template/babel.config.js +9 -9
  26. package/template/bridge/rtc/webNg/RtcEngine.ts +51 -26
  27. package/template/customization-api/action-library.ts +22 -0
  28. package/template/{fpe-api/context.ts → customization-api/app-state.ts} +16 -14
  29. package/template/customization-api/customEvents.ts +9 -0
  30. package/template/{fpe-api/install.ts → customization-api/customize.ts} +27 -26
  31. package/template/{fpe-api → customization-api}/index.ts +11 -6
  32. package/template/{fpe-api/components.ts → customization-api/sub-components.ts} +22 -3
  33. package/template/{fpe-api → customization-api}/typeDefinition.ts +13 -14
  34. package/template/customization-api/utils.ts +30 -0
  35. package/template/{fpe-implementation → customization-implementation}/createHook.ts +0 -0
  36. package/template/{fpe-implementation/dummyFpe.ts → customization-implementation/dummyConfig.ts} +4 -4
  37. package/template/customization-implementation/index.ts +4 -0
  38. package/template/{fpe-api/useFpe.tsx → customization-implementation/useCustomization.tsx} +12 -12
  39. package/template/{fpe.config.js → customization.config.js} +11 -11
  40. package/template/electron/main/index.js +42 -35
  41. package/template/esbuild.rsdk.go +8 -17
  42. package/template/global.d.ts +4 -3
  43. package/template/index.rsdk.tsx +13 -5
  44. package/template/index.wsdk.tsx +21 -5
  45. package/template/package.json +3 -0
  46. package/template/react-native-toast-message/src/index.js +3 -7
  47. package/template/react-native-toast-message/src/{index.wsdk.js → index.sdk.tsx} +1 -1
  48. package/template/react-native-toast-message/src/styles.sdk.ts +17 -0
  49. package/template/src/App.tsx +8 -4
  50. package/template/src/AppWrapper.tsx +8 -6
  51. package/template/src/SDKAppWrapper.tsx +28 -21
  52. package/template/src/app-state/useLocalUserInfo.ts +8 -0
  53. package/template/src/app-state/useMessages.ts +52 -0
  54. package/template/src/atoms/PrimaryButton.tsx +2 -2
  55. package/template/src/atoms/SecondaryButton.tsx +12 -4
  56. package/template/src/atoms/TextInput.tsx +2 -2
  57. package/template/src/components/Chat.tsx +22 -11
  58. package/template/src/components/ChatContext.ts +10 -27
  59. package/template/src/components/Controls.native.tsx +13 -7
  60. package/template/src/components/Controls.tsx +15 -24
  61. package/template/src/components/DeviceConfigure.tsx +4 -3
  62. package/template/src/components/EventsConfigure.tsx +54 -0
  63. package/template/src/components/GridVideo.tsx +5 -6
  64. package/template/src/components/HostControlView.tsx +13 -19
  65. package/template/src/components/Navbar.tsx +54 -41
  66. package/template/src/components/NetworkQualityContext.tsx +4 -3
  67. package/template/src/components/ParticipantsView.tsx +7 -7
  68. package/template/src/components/PinnedVideo.tsx +3 -4
  69. package/template/src/components/Precall.native.tsx +3 -3
  70. package/template/src/components/Precall.tsx +14 -10
  71. package/template/src/components/RTMConfigure.tsx +61 -219
  72. package/template/src/components/SettingsView.tsx +6 -3
  73. package/template/src/components/Share.tsx +24 -18
  74. package/template/src/components/chat-messages/useChatMessages.tsx +397 -80
  75. package/template/src/components/chat-notification/useChatNotification.tsx +2 -2
  76. package/template/src/components/chat-ui/useChatUIControl.tsx +1 -1
  77. package/template/src/components/common/Logo.tsx +3 -2
  78. package/template/src/components/contexts/LiveStreamDataContext.tsx +3 -3
  79. package/template/src/components/contexts/ScreenShareContext.tsx +3 -1
  80. package/template/src/components/contexts/VideoMeetingDataContext.tsx +85 -0
  81. package/template/src/components/contexts/WhiteboardContext.tsx +8 -8
  82. package/template/src/components/livestream/LiveStreamContext.tsx +88 -74
  83. package/template/src/components/meeting-info/useMeetingInfo.tsx +23 -19
  84. package/template/src/components/meeting-info/useSetMeetingInfo.tsx +1 -1
  85. package/template/src/components/participants/AllAudienceParticipants.tsx +2 -2
  86. package/template/src/components/participants/AllHostParticipants.tsx +4 -4
  87. package/template/src/components/participants/MeParticipant.tsx +5 -3
  88. package/template/src/components/participants/ParticipantName.tsx +2 -2
  89. package/template/src/components/participants/RemoteParticipants.tsx +9 -7
  90. package/template/src/components/precall/LocalMute.native.tsx +14 -10
  91. package/template/src/components/precall/LocalMute.tsx +7 -5
  92. package/template/src/components/precall/VideoPreview.native.tsx +6 -6
  93. package/template/src/components/precall/VideoPreview.tsx +3 -3
  94. package/template/src/components/precall/joinCallBtn.tsx +3 -3
  95. package/template/src/components/precall/meetingTitle.tsx +3 -1
  96. package/template/src/components/precall/selectDevice.tsx +2 -2
  97. package/template/src/components/precall/usePreCall.tsx +1 -1
  98. package/template/src/components/styles.ts +3 -3
  99. package/template/src/components/useShareLink.tsx +69 -29
  100. package/template/src/components/useUserPreference.tsx +16 -15
  101. package/template/src/components/useWakeLock.tsx +3 -3
  102. package/template/src/language/i18nTypes.ts +1 -1
  103. package/template/src/language/index.ts +2 -2
  104. package/template/src/language/useLanguage.tsx +2 -3
  105. package/template/src/pages/Authenticate.tsx +3 -2
  106. package/template/src/pages/Create.tsx +18 -20
  107. package/template/src/pages/Join.tsx +6 -7
  108. package/template/src/pages/VideoCall.tsx +74 -66
  109. package/template/src/pages/create/useCreate.tsx +1 -1
  110. package/template/src/pages/video-call/CustomUserContextHolder.tsx +14 -6
  111. package/template/src/pages/video-call/DefaultLayouts.ts +8 -8
  112. package/template/src/pages/video-call/{NameWithMicStatus.tsx → NameWithMicIcon.tsx} +8 -1
  113. package/template/src/pages/video-call/RenderComponent.tsx +7 -10
  114. package/template/src/pages/video-call/VideoCallScreen.tsx +31 -22
  115. package/template/src/pages/video-call/VideoComponent.tsx +13 -15
  116. package/template/src/pages/video-call/VideoRenderer.tsx +6 -6
  117. package/template/src/pages/video-call/useLayoutsData.ts +23 -0
  118. package/template/src/rtm/RTMEngine.ts +13 -0
  119. package/template/src/rtm-events/EventUtils.ts +20 -20
  120. package/template/src/rtm-events/EventsQueue.ts +9 -3
  121. package/template/src/rtm-events/constants.ts +5 -0
  122. package/template/src/rtm-events/index.tsx +1 -3
  123. package/template/src/{custom-events/CustomEvents.ts → rtm-events-api/Events.ts} +67 -61
  124. package/template/src/rtm-events-api/index.tsx +6 -0
  125. package/template/src/rtm-events-api/types.ts +22 -0
  126. package/template/src/subComponents/ChatBubble.tsx +24 -8
  127. package/template/src/subComponents/ChatContainer.tsx +24 -15
  128. package/template/src/subComponents/ChatInput.tsx +56 -42
  129. package/template/src/subComponents/LanguageSelector.tsx +2 -2
  130. package/template/src/subComponents/LayoutIconDropdown.native.tsx +5 -5
  131. package/template/src/subComponents/LayoutIconDropdown.tsx +7 -7
  132. package/template/src/subComponents/LocalAudioMute.tsx +3 -4
  133. package/template/src/subComponents/LocalEndCall.tsx +3 -6
  134. package/template/src/subComponents/LocalSwitchCamera.tsx +3 -4
  135. package/template/src/subComponents/LocalVideoMute.tsx +3 -3
  136. package/template/src/subComponents/NetworkQualityPill.tsx +8 -9
  137. package/template/src/subComponents/OpenInNativeButton.tsx +2 -3
  138. package/template/src/subComponents/RemoteAudioMute.tsx +5 -11
  139. package/template/src/subComponents/RemoteEndCall.tsx +3 -10
  140. package/template/src/subComponents/RemoteVideoMute.tsx +3 -10
  141. package/template/src/subComponents/SelectDevice.tsx +1 -1
  142. package/template/src/subComponents/SelectOAuth.tsx +3 -2
  143. package/template/src/subComponents/SidePanelButtons.ts +6 -5
  144. package/template/src/subComponents/TextWithTooltip.tsx +6 -2
  145. package/template/src/subComponents/{toastConfig.tsx → ToastConfig.tsx} +2 -2
  146. package/template/src/subComponents/chat/ChatParticipants.tsx +6 -5
  147. package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +2 -2
  148. package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +4 -3
  149. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +2 -2
  150. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +2 -4
  151. package/template/src/subComponents/livestream/index.ts +2 -2
  152. package/template/src/subComponents/recording/useRecording.tsx +44 -23
  153. package/template/src/subComponents/recording/useRecordingLayoutQuery.tsx +11 -5
  154. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +46 -34
  155. package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +97 -38
  156. package/template/src/subComponents/screenshare/useScreenshare.tsx +1 -1
  157. package/template/src/utils/SdkEvents.ts +9 -46
  158. package/template/src/utils/common.tsx +25 -9
  159. package/template/src/utils/getUniqueID.ts +5 -0
  160. package/template/src/utils/isMobileOrTablet.native.ts +2 -2
  161. package/template/src/utils/isMobileOrTablet.ts +21 -8
  162. package/template/src/utils/useButtonTemplate.tsx +1 -1
  163. package/template/src/utils/useCreateMeeting.ts +21 -10
  164. package/template/src/utils/useGetMeetingPhrase.ts +11 -8
  165. package/template/src/utils/{IsAttendeeUser.ts → useIsAttendee.ts} +3 -1
  166. package/template/src/utils/{isAudioEnabled.ts → useIsAudioEnabled.ts} +4 -4
  167. package/template/src/utils/{isHostUser.ts → useIsHost.ts} +13 -16
  168. package/template/src/utils/{isPSTNUser.ts → useIsPSTN.ts} +2 -2
  169. package/template/src/utils/{isScreenShareUser.ts → useIsScreenShare.ts} +0 -0
  170. package/template/src/utils/{isVideoEnabled.ts → useIsVideoEnabled.ts} +5 -6
  171. package/template/src/utils/useJoinMeeting.ts +8 -6
  172. package/template/src/utils/useLayout.tsx +5 -5
  173. package/template/src/utils/useMutePSTN.ts +5 -3
  174. package/template/src/utils/useMuteToggleLocal.ts +3 -4
  175. package/template/src/utils/useRemoteEndCall.ts +11 -10
  176. package/template/src/utils/useRemoteMute.ts +42 -20
  177. package/template/src/utils/useSidePanel.tsx +1 -1
  178. package/template/src/utils/useString.ts +2 -2
  179. package/template/src/utils/useUserName.ts +11 -0
  180. package/template/tsconfig_fpeApi.json +8 -9
  181. package/template/tsconfig_rsdk_index.json +8 -9
  182. package/template/tsconfig_wsdk_index.json +8 -9
  183. package/template/webpack.commons.js +9 -9
  184. package/template/webpack.rsdk.config.js +4 -2
  185. package/template/webpack.ts.config.js +6 -6
  186. package/template/webpack.wsdk.config.js +2 -1
  187. package/template/fpe-api/fpeEvents.ts +0 -9
  188. package/template/fpe-api/utils.ts +0 -61
  189. package/template/fpe-implementation/index.ts +0 -1
  190. package/template/fpe-todo.txt +0 -14
  191. package/template/src/components/RTMEvents.tsx +0 -84
  192. package/template/src/custom-events/index.tsx +0 -4
  193. package/template/src/custom-events/types.ts +0 -51
  194. package/template/src/pages/video-call/CustomLayout.ts +0 -17
  195. package/template/src/rtm-events/types.ts +0 -7
  196. package/template/src/utils/getMeetingInvite.ts +0 -53
  197. package/template/src/utils/useGroupMessages.ts +0 -24
  198. package/template/src/utils/useNavParams.ts +0 -6
  199. package/template/src/utils/useNavigateTo.ts +0 -8
  200. package/template/src/utils/usePrivateMessages.ts +0 -33
  201. package/template/src/utils/useSendControlMessage.ts +0 -51
  202. package/template/src/utils/useSendMessage.ts +0 -40
  203. package/template/src/utils/useSetUnreadMessageCount.ts +0 -43
  204. package/template/src/utils/useUnreadMessageCount.ts +0 -50
  205. package/template/src/utils/useUserList.ts +0 -26
@@ -1,8 +1,7 @@
1
- const {app, BrowserWindow, session, Menu, Notification } = require('electron');
1
+ const {app, BrowserWindow, session, Menu, Notification} = require('electron');
2
2
 
3
3
  const log = require('electron-log');
4
- const {autoUpdater} = require("electron-updater");
5
-
4
+ const {autoUpdater} = require('electron-updater');
6
5
 
7
6
  const path = require('path');
8
7
  const isDevelopment = process.env.NODE_ENV === 'development';
@@ -20,8 +19,8 @@ autoUpdater.logger.transports.file.level = 'info';
20
19
  log.info('App starting...');
21
20
 
22
21
  const intr = setInterval(() => {
23
- autoUpdater.checkForUpdates()
24
- }, 30000)
22
+ app.isPackaged && autoUpdater.checkForUpdates();
23
+ }, 30000);
25
24
 
26
25
  let mainWindow;
27
26
 
@@ -31,34 +30,42 @@ function sendStatusToWindow(text) {
31
30
  }
32
31
  autoUpdater.on('checking-for-update', () => {
33
32
  sendStatusToWindow('Checking for update...');
34
- })
33
+ });
35
34
  autoUpdater.on('update-available', (info) => {
36
35
  sendStatusToWindow('Update available.');
37
- })
36
+ });
38
37
  autoUpdater.on('update-not-available', (info) => {
39
38
  sendStatusToWindow('Update not available.');
40
- })
39
+ });
41
40
  autoUpdater.on('error', (err) => {
42
41
  sendStatusToWindow('Error in auto-updater. ' + err);
43
- })
42
+ });
44
43
  autoUpdater.on('download-progress', (progressObj) => {
45
- let log_message = "Download speed: " + progressObj.bytesPerSecond;
44
+ let log_message = 'Download speed: ' + progressObj.bytesPerSecond;
46
45
  log_message = log_message + ' - Downloaded ' + progressObj.percent + '%';
47
- log_message = log_message + ' (' + progressObj.transferred + "/" + progressObj.total + ')';
46
+ log_message =
47
+ log_message +
48
+ ' (' +
49
+ progressObj.transferred +
50
+ '/' +
51
+ progressObj.total +
52
+ ')';
48
53
  sendStatusToWindow(log_message);
49
- })
54
+ });
50
55
  autoUpdater.on('update-downloaded', (info) => {
51
56
  sendStatusToWindow('Update downloaded');
52
57
  // autoUpdater.quitAndInstall();
53
58
 
54
- const NOTIFICATION_TITLE = 'An update is ready'
55
- const NOTIFICATION_BODY = 'Please restart your app to complete the update'
59
+ const NOTIFICATION_TITLE = 'An update is ready';
60
+ const NOTIFICATION_BODY = 'Please restart your app to complete the update';
56
61
 
57
- function showNotification () {
58
- new Notification({ title: NOTIFICATION_TITLE, body: NOTIFICATION_BODY }).show()
62
+ function showNotification() {
63
+ new Notification({
64
+ title: NOTIFICATION_TITLE,
65
+ body: NOTIFICATION_BODY,
66
+ }).show();
59
67
  }
60
68
  showNotification();
61
-
62
69
  });
63
70
 
64
71
  const createWindow = () => {
@@ -98,7 +105,7 @@ const createWindow = () => {
98
105
  ],
99
106
  },
100
107
  ];
101
- autoUpdater.checkForUpdatesAndNotify();
108
+ app.isPackaged && autoUpdater.checkForUpdatesAndNotify();
102
109
  const menu = Menu.buildFromTemplate(template);
103
110
  Menu.setApplicationMenu(menu);
104
111
 
@@ -170,7 +177,7 @@ if (isDevelopment && process.platform === 'win32') {
170
177
  // These two additional parameters are only available on windows.
171
178
  // Setting this is required to get this working in dev mode.
172
179
  app.setAsDefaultProtocolClient('appbuilder', process.execPath, [
173
- path.resolve(process.argv[1])
180
+ path.resolve(process.argv[1]),
174
181
  ]);
175
182
  } else {
176
183
  app.setAsDefaultProtocolClient('appbuilder');
@@ -185,38 +192,38 @@ if (gotTheLock) {
185
192
  // argv: An array of the second instance’s (command line / deep linked) arguments
186
193
  if (process.platform == 'win32') {
187
194
  // Keep only command line / deep linked arguments
188
- deeplinkingUrl = argv.slice(1)
195
+ deeplinkingUrl = argv.slice(1);
189
196
  }
190
- logEverywhere('app.makeSingleInstance# ' + deeplinkingUrl)
197
+ logEverywhere('app.makeSingleInstance# ' + deeplinkingUrl);
191
198
 
192
199
  if (mainWindow) {
193
- if (mainWindow.isMinimized()) mainWindow.restore()
194
- mainWindow.focus()
200
+ if (mainWindow.isMinimized()) mainWindow.restore();
201
+ mainWindow.focus();
195
202
  }
196
- })
197
- }
203
+ });
204
+ }
198
205
 
199
- app.on('will-finish-launching', function() {
206
+ app.on('will-finish-launching', function () {
200
207
  // Protocol handler for osx
201
- app.on('open-url', function(event, url) {
202
- event.preventDefault()
203
- deeplinkingUrl = url
204
- logEverywhere('open-url# ' + deeplinkingUrl)
205
- })
206
- })
208
+ app.on('open-url', function (event, url) {
209
+ event.preventDefault();
210
+ deeplinkingUrl = url;
211
+ logEverywhere('open-url# ' + deeplinkingUrl);
212
+ });
213
+ });
207
214
 
208
215
  // Log both at dev console and at running node console instance
209
216
  function logEverywhere(s) {
210
- console.log(s)
217
+ console.log(s);
211
218
  if (mainWindow && mainWindow.webContents) {
212
- mainWindow.webContents.executeJavaScript(`console.log("${s}")`)
219
+ mainWindow.webContents.executeJavaScript(`console.log("${s}")`);
213
220
  }
214
221
  }
215
222
 
216
223
  // This method will be called when Electron has finished
217
224
  // initialization and is ready to create browser windows.
218
225
  // Some APIs can only be used after this event occurs.
219
- app.on('ready', ()=> {
226
+ app.on('ready', () => {
220
227
  createWindow();
221
228
  });
222
229
 
@@ -52,9 +52,9 @@ func commonAliasResolver() api.Plugin {
52
52
  },
53
53
  )
54
54
 
55
- pb.OnResolve(api.OnResolveOptions{Filter: "fpe-api/install"},
55
+ pb.OnResolve(api.OnResolveOptions{Filter: "customization-api"},
56
56
  func(args api.OnResolveArgs) (api.OnResolveResult, error) {
57
- path, err := filepath.Abs("./fpe-api/install.ts")
57
+ path, err := filepath.Abs("./customization-api/index.ts")
58
58
  if err != nil {
59
59
  log.Fatalln(err)
60
60
  }
@@ -62,9 +62,9 @@ func commonAliasResolver() api.Plugin {
62
62
  },
63
63
  )
64
64
 
65
- pb.OnResolve(api.OnResolveOptions{Filter: "fpe-api"},
65
+ pb.OnResolve(api.OnResolveOptions{Filter: "customization-implementation"},
66
66
  func(args api.OnResolveArgs) (api.OnResolveResult, error) {
67
- path, err := filepath.Abs("./fpe-api/index.ts")
67
+ path, err := filepath.Abs("./customization-implementation/index.ts")
68
68
  if err != nil {
69
69
  log.Fatalln(err)
70
70
  }
@@ -72,23 +72,13 @@ func commonAliasResolver() api.Plugin {
72
72
  },
73
73
  )
74
74
 
75
- pb.OnResolve(api.OnResolveOptions{Filter: "fpe-implementation"},
75
+ pb.OnResolve(api.OnResolveOptions{Filter: "customization"},
76
76
  func(args api.OnResolveArgs) (api.OnResolveResult, error) {
77
- path, err := filepath.Abs("./fpe-implementation/index.ts")
77
+ fpePath, err := filepath.Abs("./customization/index.ts")
78
78
  if err != nil {
79
79
  log.Fatalln(err)
80
80
  }
81
- return api.OnResolveResult{Path: path}, nil
82
- },
83
- )
84
-
85
- pb.OnResolve(api.OnResolveOptions{Filter: "test-fpe"},
86
- func(args api.OnResolveArgs) (api.OnResolveResult, error) {
87
- fpePath, err := filepath.Abs("./test-fpe/index.ts")
88
- if err != nil {
89
- log.Fatalln(err)
90
- }
91
- fpeDummyPath, err := filepath.Abs("./fpe-implementation/dummyFpe.ts")
81
+ fpeDummyPath, err := filepath.Abs("./customization-implementation/dummyConfig.ts")
92
82
  if err != nil {
93
83
  log.Fatalln(err)
94
84
  }
@@ -211,6 +201,7 @@ func rsdk(iopath *ioPaths) api.BuildResult {
211
201
  MinifyWhitespace: true,
212
202
  MinifyIdentifiers: true,
213
203
  MinifySyntax: true,
204
+ Sourcemap: api.SourceMapExternal,
214
205
 
215
206
  // debug options. does not affect bundle size
216
207
  // Metafile: true,
@@ -75,9 +75,10 @@ interface ConfigInterface {
75
75
  RAISE_HAND: boolean;
76
76
  GEO_FENCING: boolean;
77
77
  LOG_ENABLED: boolean;
78
+ AUDIO_ROOM: boolean;
78
79
  }
79
80
  declare var $config: ConfigInterface;
80
- declare module 'test-fpe'{
81
- const data:{}
82
- export default data;
81
+ declare module 'customization' {
82
+ const customizationConfig: {};
83
+ export default customizationConfig;
83
84
  }
@@ -12,16 +12,24 @@
12
12
  /**
13
13
  * @format
14
14
  */
15
- import SDKAppWrapper,{AppBuilderSdkApi,AppBuilderSdkApiInterface} from './src/SDKAppWrapper';
15
+ import SDKAppWrapper, {
16
+ AppBuilderSdkApi,
17
+ AppBuilderSdkApiInterface,
18
+ } from './src/SDKAppWrapper';
16
19
  import React from 'react';
17
- export * from 'fpe-api';
20
+ import * as RN from 'react-native-web';
21
+
22
+ export * from 'customization-api';
23
+ export * from 'customization-implementation';
18
24
 
19
25
  interface AppBuilderReactSdkInterface extends AppBuilderSdkApiInterface {
20
26
  View: React.FC;
21
27
  }
22
28
 
23
29
  const AppBuilderReactSdkApi: AppBuilderReactSdkInterface = {
24
- ...AppBuilderSdkApi,
25
- View: SDKAppWrapper,
26
- }
30
+ ...AppBuilderSdkApi,
31
+ View: SDKAppWrapper,
32
+ };
33
+
34
+ export {React, RN};
27
35
  export default AppBuilderReactSdkApi;
@@ -1,11 +1,26 @@
1
1
  import {AppRegistry} from 'react-native';
2
- import SDKAppWrapper,{AppBuilderSdkApi,AppBuilderSdkApiInterface} from './src/SDKAppWrapper';
3
- export * from 'fpe-api';
2
+ import SDKAppWrapper, {
3
+ AppBuilderSdkApi,
4
+ AppBuilderSdkApiInterface,
5
+ } from './src/SDKAppWrapper';
6
+ import SDKEvents from './src/utils/SdkEvents';
7
+ import React from 'react';
8
+ import * as RN from 'react-native-web';
4
9
 
5
- interface AppBuilderWebSdkInterface extends AppBuilderSdkApiInterface {
6
- }
10
+ export * from 'customization-api';
11
+ export * from 'customization-implementation';
12
+
13
+ interface AppBuilderWebSdkInterface extends AppBuilderSdkApiInterface {}
7
14
 
8
- const AppBuilderWebSdkApi: AppBuilderWebSdkInterface = AppBuilderSdkApi;
15
+ const AppBuilderWebSdkApi: AppBuilderWebSdkInterface = {
16
+ ...AppBuilderSdkApi,
17
+ // Override customize function for web-sdk
18
+ customize: (customization) => {
19
+ SDKEvents.on('addFpeInit', () => {
20
+ SDKEvents.emit('addFpe', customization);
21
+ });
22
+ },
23
+ };
9
24
 
10
25
  // init code
11
26
  class AppBuilder extends HTMLElement {
@@ -24,4 +39,5 @@ class AppBuilder extends HTMLElement {
24
39
 
25
40
  customElements.define('app-builder', AppBuilder);
26
41
 
42
+ export {React, RN};
27
43
  export default AppBuilderWebSdkApi;
@@ -18,6 +18,7 @@
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",
21
22
  "electron:start": "cross-env NODE_ENV=development gulp electron_development",
22
23
  "electron:build": "cross-env NODE_ENV=production gulp electron_build",
23
24
  "windows": "cross-env TARGET=windows npm run electron:start",
@@ -62,6 +63,8 @@
62
63
  "electron-updater": "4.3.9",
63
64
  "exponential-backoff": "3.1.0",
64
65
  "graphql": "15.5.0",
66
+ "nanoevents": "7.0.1",
67
+ "nanoid": "4.0.0",
65
68
  "nosleep.js": "0.12.0",
66
69
  "react": "16.13.1",
67
70
  "react-dom": "16.13.1",
@@ -353,14 +353,14 @@ class Toast extends Component {
353
353
 
354
354
  const translateY = animation.interpolate({
355
355
  inputRange: [0, 1, 2],
356
- outputRange: [0, 1, 0]
356
+ outputRange
357
357
  });
358
358
 
359
359
  return [
360
360
  styles.base,
361
361
  styles[position],
362
362
  {
363
- opacity: translateY
363
+ transform: [{ translateY }]
364
364
  }
365
365
  ];
366
366
  }
@@ -378,11 +378,7 @@ class Toast extends Component {
378
378
  <Animated.View
379
379
  testID='animatedView'
380
380
  onLayout={this.onLayout}
381
- style={[
382
- baseStyle,
383
- style,
384
- { zIndex: 100, display: this.state.isVisible || this.state.inProgress ? 'flex' : 'none' }
385
- ]} //added zindex
381
+ style={[baseStyle, style, { zIndex: 100 }]} //added zindex
386
382
  {...this.panResponder.panHandlers}>
387
383
  {this.renderContent(this.props)}
388
384
  </Animated.View>
@@ -381,7 +381,7 @@ class Toast extends Component {
381
381
  style={[
382
382
  baseStyle,
383
383
  style,
384
- { zIndex: 100, display: this.state.isVisible ? 'flex' : 'none', backgroundColor:'red' }
384
+ { zIndex: 100, display: this.state.isVisible ? 'flex' : 'none' }
385
385
  ]} //added zindex
386
386
  {...this.panResponder.panHandlers}>
387
387
  {this.renderContent(this.props)}
@@ -0,0 +1,17 @@
1
+ import { StyleSheet } from 'react-native';
2
+
3
+ export default StyleSheet.create({
4
+ base: {
5
+ position: 'absolute',
6
+ alignItems: 'center',
7
+ justifyContent: 'center',
8
+ left: 0,
9
+ right: 0
10
+ },
11
+ top: {
12
+ top: 30
13
+ },
14
+ bottom: {
15
+ bottom: 0
16
+ }
17
+ });
@@ -10,6 +10,7 @@
10
10
  *********************************************
11
11
  */
12
12
  import React, {useState} from 'react';
13
+ import {Platform} from 'react-native';
13
14
  import Join from './pages/Join';
14
15
  import VideoCall from './pages/VideoCall';
15
16
  import Create from './pages/Create';
@@ -17,10 +18,11 @@ import {Route, Switch, Redirect} from './components/Router';
17
18
  import PrivateRoute from './components/PrivateRoute';
18
19
  import OAuth from './components/OAuth';
19
20
  import StoreToken from './components/StoreToken';
20
- import {shouldAuthenticate, isIOS} from './utils/common';
21
+ import {shouldAuthenticate} from './utils/common';
21
22
  import KeyboardManager from 'react-native-keyboard-manager';
22
23
  // commented for v1 release
23
- //import {useFpe, CustomRoutesInterface, CUSTOM_ROUTES_PREFIX} from 'fpe-api';
24
+ //import {CustomRoutesInterface, CUSTOM_ROUTES_PREFIX} from 'customization-api';
25
+ //import {useCustomization} from 'customization-implementation';
24
26
  import AppWrapper from './AppWrapper';
25
27
  import {
26
28
  MeetingInfoContextInterface,
@@ -29,7 +31,9 @@ import {
29
31
  } from './components/meeting-info/useMeetingInfo';
30
32
  import {SetMeetingInfoProvider} from './components/meeting-info/useSetMeetingInfo';
31
33
  import {ShareLinkProvider} from './components/useShareLink';
32
- if (isIOS) {
34
+
35
+ //hook can't be used in the outside react function calls. so directly checking the platform.
36
+ if (Platform.OS === 'ios') {
33
37
  KeyboardManager.setEnable(true);
34
38
  KeyboardManager.setEnableAutoToolbar(false);
35
39
  KeyboardManager.setShouldShowToolbarPlaceholder(false);
@@ -51,7 +55,7 @@ declare module 'agora-rn-uikit' {
51
55
 
52
56
  const App: React.FC = () => {
53
57
  //commented for v1 release
54
- //const CustomRoutes = useFpe((data) => data?.customRoutes);
58
+ //const CustomRoutes = useCustomization((data) => data?.customRoutes);
55
59
  // const RenderCustomRoutes = () => {
56
60
  // try {
57
61
  // return (
@@ -18,23 +18,25 @@ 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 ToastConfig from './subComponents/toastConfig';
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';
25
25
  import {ErrorProvider} from './components/common';
26
- import {useFpe, FpeProvider, fpeConfig, FpeApiInterface} from 'fpe-api';
26
+ import {useCustomization} from 'customization-implementation';
27
27
  import {LanguageProvider} from './language/useLanguage';
28
28
 
29
29
  interface AppWrapperProps {
30
30
  children: React.ReactNode;
31
- fpeConfig?: FpeApiInterface;
32
31
  }
33
32
 
34
33
  const AppWrapper = (props: AppWrapperProps) => {
35
- const AppRoot = useFpe((data) => {
36
- if (data?.appRoot && isValidReactComponent(data.appRoot)) {
37
- return data.appRoot;
34
+ const AppRoot = useCustomization((data) => {
35
+ if (
36
+ data?.components?.appRoot &&
37
+ isValidReactComponent(data?.components?.appRoot)
38
+ ) {
39
+ return data.components.appRoot;
38
40
  }
39
41
  return React.Fragment;
40
42
  });
@@ -1,6 +1,9 @@
1
1
  import React, {useEffect, useState} from 'react';
2
- import {fpeConfig, FpeProvider, FpeApiInterface} from 'fpe-api';
3
- import {installFPE as createFPE} from 'fpe-api/install';
2
+ import {CustomizationApiInterface, customize} from 'customization-api';
3
+ import {
4
+ customizationConfig,
5
+ CustomizationProvider,
6
+ } from 'customization-implementation';
4
7
  import SDKEvents from './utils/SdkEvents';
5
8
  import App from './App';
6
9
 
@@ -9,9 +12,12 @@ export interface userEventsMapInterface {
9
12
  create: (
10
13
  hostPhrase: string,
11
14
  attendeePhrase?: string,
12
- pstnNumer?: string,
15
+ pstnNumer?: {
16
+ number: string;
17
+ pin: string;
18
+ },
13
19
  ) => void;
14
- preJoin: (meetingTitle: string, devices: MediaDeviceInfo[]) => void;
20
+ 'ready-to-join': (meetingTitle: string, devices: MediaDeviceInfo[]) => void;
15
21
  join: (
16
22
  meetingTitle: string,
17
23
  devices: MediaDeviceInfo[],
@@ -20,46 +26,47 @@ export interface userEventsMapInterface {
20
26
  }
21
27
 
22
28
  export interface AppBuilderSdkApiInterface {
23
- addFPE: (fpe: FpeApiInterface) => void;
24
- createFPE: (fpe: FpeApiInterface) => FpeApiInterface;
25
- joinMeeting: (joinPhrase: string) => void;
29
+ customize: (customization: CustomizationApiInterface) => void;
30
+ createCustomization: (
31
+ customization: CustomizationApiInterface,
32
+ ) => CustomizationApiInterface;
33
+ join: (roomid: string) => Promise<void>;
26
34
  on: <T extends keyof userEventsMapInterface>(
27
35
  userEventName: T,
28
36
  callBack: userEventsMapInterface[T],
29
37
  ) => void;
30
- off: (userEventName: keyof userEventsMapInterface) => void;
31
38
  }
32
39
 
33
40
  export const AppBuilderSdkApi: AppBuilderSdkApiInterface = {
34
- addFPE: (fpeConfig: FpeApiInterface) => {
35
- SDKEvents.emit('addFpe', fpeConfig);
41
+ customize: (customization: CustomizationApiInterface) => {
42
+ SDKEvents.emit('addFpe', customization);
36
43
  },
37
- joinMeeting: (joinPhrase: string) => {
38
- SDKEvents.emit('joinMeetingWithPhrase', joinPhrase);
39
- },
40
- createFPE,
44
+ join: (roomid: string) =>
45
+ new Promise((resolve, reject) => {
46
+ SDKEvents.emit('joinMeetingWithPhrase', roomid, resolve, reject);
47
+ }),
48
+ createCustomization: customize,
41
49
  on: (userEventName, cb) => {
42
50
  SDKEvents.on(userEventName, cb);
43
- },
44
- off: (userEventName) => {
45
- SDKEvents.off(userEventName);
51
+ console.log('SDKEvents: Event Registered', userEventName);
46
52
  },
47
53
  };
48
54
 
49
55
  const SDKAppWrapper = () => {
50
- const [fpe, setFpe] = useState(fpeConfig);
56
+ const [fpe, setFpe] = useState(customizationConfig);
51
57
  useEffect(() => {
52
58
  SDKEvents.on('addFpe', (sdkFpeConfig) => {
53
- console.log('DEBUG(aditya)-SDKEvents: addFpe event called');
59
+ console.log('SDKEvents: addFpe event called');
54
60
  setFpe(sdkFpeConfig);
55
61
  });
62
+ SDKEvents.emit('addFpeInit');
56
63
  // Join event consumed in Create.tsx
57
64
  }, []);
58
65
  return (
59
66
  <>
60
- <FpeProvider value={fpe}>
67
+ <CustomizationProvider value={fpe}>
61
68
  <App />
62
- </FpeProvider>
69
+ </CustomizationProvider>
63
70
  </>
64
71
  );
65
72
  };
@@ -0,0 +1,8 @@
1
+ import {useLocalUid} from '../../agora-rn-uikit';
2
+ import {useRender} from 'customization-api';
3
+
4
+ export const useLocalUserInfo = () => {
5
+ const localUid = useLocalUid();
6
+ const {renderList} = useRender();
7
+ return renderList[localUid];
8
+ };
@@ -0,0 +1,52 @@
1
+ import {
2
+ individualUnreadMessageCount,
3
+ useChatNotification,
4
+ } from '../components/chat-notification/useChatNotification';
5
+ import {
6
+ messageStoreInterface,
7
+ useChatMessages,
8
+ } from '../components/chat-messages/useChatMessages';
9
+
10
+ export interface messageInterface {
11
+ groupMessages: messageStoreInterface[];
12
+ privateMessages: {
13
+ [key: string]: messageStoreInterface[];
14
+ };
15
+ sendMessage: (msg: string, toUid?: number) => void;
16
+ editMessage: (msgId: string, msg: string, toUid?: number) => void;
17
+ deleteMessage: (msgId: string, toUid?: number) => void;
18
+ groupUnreadCount: number;
19
+ individualUnreadCount: individualUnreadMessageCount;
20
+ setGroupUnreadCount: React.Dispatch<React.SetStateAction<number>>;
21
+ setIndividualUnreadCount: React.Dispatch<
22
+ React.SetStateAction<individualUnreadMessageCount>
23
+ >;
24
+ }
25
+
26
+ export const useMessages: () => messageInterface = () => {
27
+ const {
28
+ deleteChatMessage: deleteMessage,
29
+ editChatMessage: editMessage,
30
+ messageStore: groupMessages,
31
+ privateMessageStore: privateMessages,
32
+ sendChatMessage: sendMessage,
33
+ } = useChatMessages();
34
+ const {
35
+ setUnreadIndividualMessageCount: setIndividualUnreadCount,
36
+ setUnreadGroupMessageCount: setGroupUnreadCount,
37
+ unreadGroupMessageCount: groupUnreadCount,
38
+ unreadIndividualMessageCount: individualUnreadCount,
39
+ } = useChatNotification();
40
+
41
+ return {
42
+ groupMessages,
43
+ privateMessages,
44
+ sendMessage,
45
+ editMessage,
46
+ deleteMessage,
47
+ groupUnreadCount,
48
+ individualUnreadCount,
49
+ setGroupUnreadCount,
50
+ setIndividualUnreadCount,
51
+ };
52
+ };
@@ -21,11 +21,11 @@ import {
21
21
  import {primaryButton, primaryButtonText} from '../../theme.json';
22
22
  import ColorContext from '../components/ColorContext';
23
23
 
24
- export interface ButtonProps extends PressableProps {
24
+ export interface PrimaryButtonProps extends PressableProps {
25
25
  text?: string;
26
26
  }
27
27
 
28
- export default function PrimaryButton(props: ButtonProps) {
28
+ export default function PrimaryButton(props: PrimaryButtonProps) {
29
29
  const {primaryColor} = useContext(ColorContext);
30
30
  const {children, ...otherProps} = props;
31
31
  return (
@@ -21,26 +21,34 @@ import {
21
21
  import {secondaryBtn, secondaryButtonText} from '../../theme.json';
22
22
  // import ColorContext from '../components/ColorContext';
23
23
 
24
- export interface ButtonProps extends TouchableOpacityProps {
24
+ export interface SecondaryButtonProps extends TouchableOpacityProps {
25
25
  text?: string;
26
26
  children?: React.ReactNode;
27
27
  }
28
28
 
29
- export default function SecondaryButton(props: ButtonProps) {
29
+ export default function SecondaryButton(props: SecondaryButtonProps) {
30
30
  // const primaryColor = $config.PRIMARY_FONT_COLOR; //useContext(ColorContext);
31
31
  const {children, ...otherProps} = props;
32
32
  return (
33
33
  <TouchableOpacity
34
34
  style={[
35
35
  styles.secondaryBtn,
36
- {borderColor: props.disabled ? $config.PRIMARY_COLOR + '80' : $config.PRIMARY_COLOR},
36
+ {
37
+ borderColor: props.disabled
38
+ ? $config.PRIMARY_COLOR + '80'
39
+ : $config.PRIMARY_COLOR,
40
+ },
37
41
  ]}
38
42
  {...otherProps}>
39
43
  {props.text ? (
40
44
  <Text
41
45
  style={[
42
46
  styles.secondaryButtonText as StyleProp<TextStyle>,
43
- {color: props.disabled ? $config.PRIMARY_COLOR + '80' : $config.PRIMARY_COLOR},
47
+ {
48
+ color: props.disabled
49
+ ? $config.PRIMARY_COLOR + '80'
50
+ : $config.PRIMARY_COLOR,
51
+ },
44
52
  ]}>
45
53
  {props.text}
46
54
  </Text>
@@ -11,7 +11,7 @@
11
11
  */
12
12
  import React, {useContext} from 'react';
13
13
  import {TextInputProps, StyleSheet, TextInput, Platform} from 'react-native';
14
- import {isWeb} from '../utils/common';
14
+ import {isWebInternal} from '../utils/common';
15
15
  import {textInput} from '../../theme.json';
16
16
  import ColorContext from '../components/ColorContext';
17
17
 
@@ -39,7 +39,7 @@ export default PrimaryButton;
39
39
  const styles = StyleSheet.create({
40
40
  textInput,
41
41
  // @ts-ignore
42
- noOutline: isWeb ? {outlineStyle: 'none'} : {},
42
+ noOutline: isWebInternal() ? {outlineStyle: 'none'} : {},
43
43
  textWrapFix: Platform.select({
44
44
  ios: {
45
45
  paddingVertical: 5,