agora-appbuilder-core 4.0.0-api.5 → 4.0.0-api.6

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 (406) hide show
  1. package/package.json +2 -2
  2. package/template/.bundle/config +2 -0
  3. package/template/Gemfile +4 -0
  4. package/template/Gulpfile.js +29 -29
  5. package/template/_eslintrc.js +3 -3
  6. package/template/_gitignore +12 -11
  7. package/template/_package-lock.json +26471 -22749
  8. package/template/_prettierrc.js +2 -2
  9. package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +30 -10
  10. package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +19 -0
  11. package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +1 -0
  12. package/template/agora-rn-uikit/src/Controls/Icons.ts +45 -0
  13. package/template/agora-rn-uikit/src/Controls/Local/EndCall.tsx +6 -4
  14. package/template/agora-rn-uikit/src/Controls/Local/FullScreen.tsx +3 -1
  15. package/template/agora-rn-uikit/src/Controls/Local/LocalAudioMute.tsx +1 -0
  16. package/template/agora-rn-uikit/src/Controls/Local/LocalVideoMute.tsx +1 -0
  17. package/template/agora-rn-uikit/src/Controls/Local/SwitchCamera.tsx +1 -0
  18. package/template/agora-rn-uikit/src/Controls/Remote/RemoteAudioMute.tsx +1 -0
  19. package/template/agora-rn-uikit/src/Controls/Remote/RemoteSwap.tsx +3 -1
  20. package/template/agora-rn-uikit/src/Controls/Remote/RemoteVideoMute.tsx +1 -0
  21. package/template/agora-rn-uikit/src/Reducer/ActiveSpeaker.ts +30 -0
  22. package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +3 -1
  23. package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +3 -1
  24. package/template/agora-rn-uikit/src/Reducer/LocalPermissionState.ts +1 -1
  25. package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +3 -3
  26. package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +5 -4
  27. package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +1 -1
  28. package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +8 -5
  29. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +1 -1
  30. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +1 -1
  31. package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +1 -1
  32. package/template/agora-rn-uikit/src/Reducer/UserPin.ts +18 -1
  33. package/template/agora-rn-uikit/src/Reducer/UserSecondaryPin.ts +23 -0
  34. package/template/agora-rn-uikit/src/Reducer/index.ts +2 -0
  35. package/template/agora-rn-uikit/src/Rtc/Create.tsx +47 -21
  36. package/template/agora-rn-uikit/src/Rtc/Join.tsx +37 -15
  37. package/template/agora-rn-uikit/src/RtcConfigure.tsx +122 -12
  38. package/template/agora-rn-uikit/src/Views/MaxVideoView.native.tsx +32 -4
  39. package/template/agora-rn-uikit/src/Views/MaxVideoView.tsx +21 -2
  40. package/template/agora-rn-uikit/src/Views/MinVideoView.tsx +2 -0
  41. package/template/android/app/build.gradle +59 -156
  42. package/template/android/app/src/debug/AndroidManifest.xml +6 -1
  43. package/template/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java +7 -4
  44. package/template/android/app/src/main/AndroidManifest.xml +6 -19
  45. package/template/android/app/src/main/assets/fonts/icomoon.ttf +0 -0
  46. package/template/android/app/src/main/java/com/helloworld/MainActivity.java +17 -0
  47. package/template/android/app/src/main/java/com/helloworld/MainApplication.java +19 -36
  48. package/template/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java +20 -0
  49. package/template/android/build.gradle +19 -33
  50. package/template/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  51. package/template/android/gradle/wrapper/gradle-wrapper.properties +3 -2
  52. package/template/android/gradle.properties +18 -4
  53. package/template/android/gradlew +165 -104
  54. package/template/android/gradlew.bat +12 -23
  55. package/template/android/settings.gradle +1 -0
  56. package/template/bridge/rtc/webNg/RtcEngine.ts +131 -16
  57. package/template/bridge/rtc/webNg/index.ts +72 -1
  58. package/template/bridge/rtm/web/index.ts +5 -3
  59. package/template/configTransform.js +16 -1
  60. package/template/customization-api/action-library.ts +0 -8
  61. package/template/customization-api/app-state.ts +11 -2
  62. package/template/customization-api/customEvents.ts +6 -1
  63. package/template/customization-api/index.ts +4 -0
  64. package/template/customization-api/sub-components.ts +6 -3
  65. package/template/customization-api/temp.ts +50 -0
  66. package/template/customization-api/typeDefinition.ts +26 -14
  67. package/template/customization-api/types.ts +26 -0
  68. package/template/customization-api/utils.ts +2 -0
  69. package/template/customization-implementation/index.ts +0 -1
  70. package/template/defaultConfig.js +72 -0
  71. package/template/global.d.ts +13 -1
  72. package/template/index.js +0 -4
  73. package/template/index.web.js +0 -5
  74. package/template/index.wsdk.tsx +1 -19
  75. package/template/ios/.xcode.env +11 -0
  76. package/template/ios/HelloWorld/AppDelegate.h +2 -4
  77. package/template/ios/HelloWorld/AppDelegate.mm +42 -0
  78. package/template/ios/HelloWorld/Info.plist +1 -1
  79. package/template/ios/HelloWorld/main.m +2 -1
  80. package/template/ios/HelloWorld.xcodeproj/project.pbxproj +529 -17
  81. package/template/ios/HelloWorld.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  82. package/template/ios/HelloWorld.xcworkspace/contents.xcworkspacedata +10 -0
  83. package/template/ios/HelloWorld.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  84. package/template/ios/HelloWorldTests/HelloWorldTests.m +14 -13
  85. package/template/ios/HelloWorldTests/Info.plist +2 -2
  86. package/template/ios/Podfile +53 -20
  87. package/template/ios/Podfile.lock +873 -0
  88. package/template/ios/ScreenSharing/Info.plist +15 -0
  89. package/template/ios/ScreenSharing/SampleHandler.h +9 -0
  90. package/template/ios/ScreenSharing/SampleHandler.m +70 -0
  91. package/template/jest.config.js +4 -0
  92. package/template/metro.config.js +7 -32
  93. package/template/package.json +52 -39
  94. package/template/react-native-toast-message/index.d.ts +3 -1
  95. package/template/react-native-toast-message/index.js +1 -0
  96. package/template/react-native-toast-message/src/components/base/index.js +20 -32
  97. package/template/react-native-toast-message/src/components/base/styles.js +18 -21
  98. package/template/react-native-toast-message/src/components/checkbox.js +24 -19
  99. package/template/react-native-toast-message/src/index.js +3 -1
  100. package/template/react-native-toast-message/src/index.sdk.tsx +4 -1
  101. package/template/src/App.tsx +13 -85
  102. package/template/src/AppRoutes.tsx +77 -0
  103. package/template/src/AppWrapper.tsx +38 -33
  104. package/template/src/SDKAppWrapper.tsx +79 -43
  105. package/template/src/app-state/useNoiseSupression.native.tsx +67 -0
  106. package/template/src/app-state/useNoiseSupression.tsx +107 -0
  107. package/template/src/app-state/useVideoQuality.tsx +39 -0
  108. package/template/src/assets/font-styles.css +171 -3
  109. package/template/src/assets/fonts/icomoon.ttf +0 -0
  110. package/template/src/assets/selection.json +1 -1
  111. package/template/src/atoms/ActionMenu.tsx +50 -11
  112. package/template/src/atoms/Avatar.tsx +51 -0
  113. package/template/src/atoms/Card.tsx +21 -8
  114. package/template/src/atoms/Carousel.native.tsx +105 -0
  115. package/template/src/atoms/Carousel.tsx +103 -0
  116. package/template/src/atoms/Checkbox.tsx +98 -0
  117. package/template/src/atoms/CircularProgress.tsx +0 -1
  118. package/template/src/atoms/ClipboardIconButton.tsx +91 -0
  119. package/template/src/atoms/CustomIcon.tsx +45 -0
  120. package/template/src/atoms/DropDownMulti.tsx +349 -0
  121. package/template/src/atoms/Dropdown.tsx +3 -3
  122. package/template/src/atoms/IconButton.tsx +52 -9
  123. package/template/src/atoms/ImageIcon.tsx +6 -3
  124. package/template/src/atoms/InlineNotification.tsx +81 -0
  125. package/template/src/atoms/MeetingLink.tsx +160 -0
  126. package/template/src/atoms/ParticipantsCount.tsx +18 -7
  127. package/template/src/atoms/Popup.tsx +49 -27
  128. package/template/src/atoms/PrimaryButton.tsx +19 -5
  129. package/template/src/atoms/RecordingInfo.tsx +2 -2
  130. package/template/src/atoms/SecondaryButton.tsx +2 -0
  131. package/template/src/atoms/Spacer.tsx +1 -0
  132. package/template/src/atoms/TertiaryButton.tsx +35 -5
  133. package/template/src/atoms/TextInput.tsx +2 -1
  134. package/template/src/atoms/Toolbar.tsx +64 -30
  135. package/template/src/atoms/ToolbarItem.tsx +11 -5
  136. package/template/src/atoms/ToolbarPreset.tsx +13 -2
  137. package/template/src/atoms/Tooltip.tsx +26 -4
  138. package/template/src/auth/AuthProvider.tsx +500 -0
  139. package/template/src/auth/AuthRoute.tsx +94 -0
  140. package/template/src/auth/IDPAuth.electron.tsx +31 -0
  141. package/template/src/auth/IDPAuth.tsx +67 -0
  142. package/template/src/auth/IDPLogoutComponent.tsx +158 -0
  143. package/template/src/auth/UserCancelPopup.tsx +115 -0
  144. package/template/src/auth/config.ts +52 -0
  145. package/template/src/auth/openIDPURL.electron.tsx +39 -0
  146. package/template/src/auth/openIDPURL.native.tsx +51 -0
  147. package/template/src/auth/openIDPURL.tsx +20 -0
  148. package/template/src/auth/useIDPAuth.electron.tsx +65 -0
  149. package/template/src/auth/useIDPAuth.native.tsx +70 -0
  150. package/template/src/auth/useIDPAuth.tsx +63 -0
  151. package/template/src/auth/useTokenAuth.tsx +194 -0
  152. package/template/src/components/Chat.tsx +5 -8
  153. package/template/src/components/ChatContext.ts +4 -0
  154. package/template/src/components/ColorConfigure.tsx +0 -1
  155. package/template/src/components/CommonStyles.ts +9 -2
  156. package/template/src/components/Controls.tsx +659 -52
  157. package/template/src/components/DeviceConfigure.tsx +362 -156
  158. package/template/src/components/DeviceContext.tsx +2 -0
  159. package/template/src/components/EventsConfigure.tsx +713 -109
  160. package/template/src/components/GraphQLProvider.tsx +62 -36
  161. package/template/src/components/GridVideo.tsx +23 -13
  162. package/template/src/components/HostControlView.tsx +11 -14
  163. package/template/src/components/JoinPhrase.tsx +0 -1
  164. package/template/src/components/Leftbar.tsx +4 -3
  165. package/template/src/components/Navbar.tsx +110 -42
  166. package/template/src/components/NavbarMobile.tsx +47 -36
  167. package/template/src/components/Navigation.native.tsx +1 -15
  168. package/template/src/{subComponents/screenshare/ScreenshareButton.native.tsx → components/Navigation.sdk.tsx} +17 -3
  169. package/template/src/components/Navigation.tsx +1 -15
  170. package/template/src/components/ParticipantsView.tsx +56 -48
  171. package/template/src/components/PinnedVideo.tsx +188 -114
  172. package/template/src/components/Precall.native.tsx +169 -67
  173. package/template/src/components/Precall.tsx +237 -71
  174. package/template/src/components/RTMConfigure.tsx +167 -55
  175. package/template/src/components/Rightbar.tsx +4 -3
  176. package/template/src/components/Router.electron.ts +1 -0
  177. package/template/src/components/Router.native.ts +1 -0
  178. package/template/src/components/Router.sdk.ts +1 -0
  179. package/template/src/components/Router.ts +1 -0
  180. package/template/src/components/SdkApiContext.tsx +179 -27
  181. package/template/src/components/SdkMuteToggleListener.tsx +88 -0
  182. package/template/src/components/SessionContext.tsx +0 -1
  183. package/template/src/components/Settings.tsx +25 -3
  184. package/template/src/components/SettingsView.tsx +44 -9
  185. package/template/src/components/Share.tsx +149 -71
  186. package/template/src/components/StorageContext.tsx +19 -5
  187. package/template/src/components/ToastComponent.tsx +3 -0
  188. package/template/src/components/WhiteboardLayout.tsx +291 -0
  189. package/template/src/components/chat-messages/useChatMessages.tsx +420 -207
  190. package/template/src/components/common/Error.tsx +2 -0
  191. package/template/src/components/common/Logo.tsx +2 -2
  192. package/template/src/components/contexts/LiveStreamDataContext.tsx +5 -4
  193. package/template/src/components/contexts/ScreenShareContext.tsx +15 -1
  194. package/template/src/components/contexts/WaitingRoomContext.tsx +50 -0
  195. package/template/src/components/contexts/WhiteboardContext.tsx +54 -54
  196. package/template/src/components/disable-chat/useDisableChat.tsx +32 -0
  197. package/template/src/components/livestream/LiveStreamContext.tsx +262 -177
  198. package/template/src/components/livestream/Types.ts +34 -18
  199. package/template/src/components/livestream/views/LiveStreamAttendeeLandingTile.tsx +295 -0
  200. package/template/src/components/livestream/views/LiveStreamControls.tsx +2 -4
  201. package/template/src/components/meeting-info-invite/MeetingInfo.tsx +82 -0
  202. package/template/src/components/meeting-info-invite/MeetingInfoCardHeader.tsx +86 -0
  203. package/template/src/components/meeting-info-invite/MeetingInfoGridTile.tsx +218 -0
  204. package/template/src/components/meeting-info-invite/MeetingInfoLinks.tsx +122 -0
  205. package/template/src/components/participants/AllAudienceParticipants.tsx +4 -5
  206. package/template/src/components/participants/AllHostParticipants.tsx +5 -6
  207. package/template/src/components/participants/Participant.tsx +40 -9
  208. package/template/src/components/participants/ParticipantSectionTitle.tsx +5 -2
  209. package/template/src/components/participants/ScreenshareParticipants.tsx +15 -17
  210. package/template/src/components/participants/UserActionMenuOptions.tsx +157 -49
  211. package/template/src/components/participants/WaitingRoomParticipants.tsx +74 -0
  212. package/template/src/components/popups/InvitePopup.tsx +110 -45
  213. package/template/src/components/popups/StartScreenSharePopup.native.tsx +182 -0
  214. package/template/src/components/popups/StartScreenSharePopup.tsx +6 -0
  215. package/template/src/components/popups/StopRecordingPopup.tsx +11 -5
  216. package/template/src/components/popups/StopScreenSharePopup.native.tsx +135 -0
  217. package/template/src/components/popups/StopScreenSharePopup.tsx +6 -0
  218. package/template/src/components/popups/WhiteboardClearAllPopup.tsx +123 -0
  219. package/template/src/components/precall/LocalMute.tsx +69 -45
  220. package/template/src/components/precall/PermissionHelper.tsx +52 -24
  221. package/template/src/components/precall/PreCallSettings.tsx +1 -0
  222. package/template/src/components/precall/VideoFallback.tsx +173 -0
  223. package/template/src/components/precall/VideoPreview.native.tsx +16 -50
  224. package/template/src/components/precall/VideoPreview.tsx +27 -162
  225. package/template/src/components/precall/index.tsx +2 -0
  226. package/template/src/components/precall/joinCallBtn.native.tsx +10 -3
  227. package/template/src/components/precall/joinCallBtn.tsx +11 -2
  228. package/template/src/components/precall/joinWaitingRoomBtn.native.tsx +210 -0
  229. package/template/src/components/precall/joinWaitingRoomBtn.tsx +250 -0
  230. package/template/src/components/precall/meetingTitle.tsx +35 -9
  231. package/template/src/components/precall/selectDevice.tsx +5 -5
  232. package/template/src/components/precall/textInput.tsx +16 -18
  233. package/template/src/components/precall/usePreCall.tsx +14 -4
  234. package/template/src/components/room-info/useRoomInfo.tsx +34 -0
  235. package/template/src/components/useShareLink.tsx +24 -59
  236. package/template/src/components/useUserPreference.tsx +73 -10
  237. package/template/src/components/useVideoCall.tsx +76 -3
  238. package/template/src/components/virtual-background/VBButton.tsx +64 -0
  239. package/template/src/components/virtual-background/VBCard.native.tsx +282 -0
  240. package/template/src/components/virtual-background/VBCard.tsx +272 -0
  241. package/template/src/components/virtual-background/VBPanel.tsx +279 -0
  242. package/template/src/components/virtual-background/VButils.native.ts +37 -0
  243. package/template/src/components/virtual-background/VButils.ts +104 -0
  244. package/template/src/components/virtual-background/VideoPreview.native.tsx +43 -0
  245. package/template/src/components/virtual-background/VideoPreview.tsx +106 -0
  246. package/template/src/components/virtual-background/imagePaths.ts +87 -0
  247. package/template/src/components/virtual-background/images/beachImageBase64.ts +1 -0
  248. package/template/src/components/virtual-background/images/bedroomImageBase64.ts +1 -0
  249. package/template/src/components/virtual-background/images/bookImageBase64.ts +1 -0
  250. package/template/src/components/virtual-background/images/earthImageBase64.ts +1 -0
  251. package/template/src/components/virtual-background/images/index.ts +37 -0
  252. package/template/src/components/virtual-background/images/lampImageBase64.ts +1 -0
  253. package/template/src/components/virtual-background/images/mountainsImageBase64.ts +1 -0
  254. package/template/src/components/virtual-background/images/office1ImageBase64.ts +1 -0
  255. package/template/src/components/virtual-background/images/officeImageBase64.ts +1 -0
  256. package/template/src/components/virtual-background/images/plantsImageBase64.ts +1 -0
  257. package/template/src/components/virtual-background/images/skyImageBase64.ts +1 -0
  258. package/template/src/components/virtual-background/images/wallImageBase64.ts +1 -0
  259. package/template/src/components/virtual-background/useVB.native.tsx +188 -0
  260. package/template/src/components/virtual-background/useVB.tsx +267 -0
  261. package/template/src/components/whiteboard/StrokeWidthTool.tsx +137 -0
  262. package/template/src/components/whiteboard/WhiteboardButton.tsx +93 -0
  263. package/template/src/components/whiteboard/WhiteboardCanvas.tsx +99 -0
  264. package/template/src/components/whiteboard/WhiteboardConfigure.native.tsx +137 -0
  265. package/template/src/components/whiteboard/WhiteboardConfigure.tsx +441 -0
  266. package/template/src/components/whiteboard/WhiteboardCursor.tsx +152 -0
  267. package/template/src/components/whiteboard/WhiteboardToolBox.tsx +1246 -0
  268. package/template/src/components/whiteboard/WhiteboardView.native.tsx +109 -0
  269. package/template/src/components/whiteboard/WhiteboardView.tsx +81 -0
  270. package/template/src/components/whiteboard/WhiteboardWidget.tsx +674 -0
  271. package/template/src/components/whiteboard/WhiteboardWrapper.tsx +38 -0
  272. package/template/src/language/default-labels/commonLabels.ts +51 -14
  273. package/template/src/language/default-labels/createScreenLabels.ts +97 -17
  274. package/template/src/language/default-labels/joinScreenLabels.ts +45 -6
  275. package/template/src/language/default-labels/precallScreenLabels.ts +145 -23
  276. package/template/src/language/default-labels/shareLinkScreenLabels.ts +85 -37
  277. package/template/src/language/default-labels/videoCallScreenLabels.ts +1137 -158
  278. package/template/src/pages/Create.tsx +125 -80
  279. package/template/src/pages/Join.tsx +76 -34
  280. package/template/src/pages/Login.tsx +26 -0
  281. package/template/src/pages/VideoCall.tsx +229 -114
  282. package/template/src/pages/video-call/ActionSheet.native.tsx +54 -7
  283. package/template/src/pages/video-call/ActionSheet.tsx +55 -16
  284. package/template/src/pages/video-call/ActionSheetContent.tsx +366 -291
  285. package/template/src/pages/video-call/ActionSheetHandle.tsx +7 -1
  286. package/template/src/pages/video-call/DefaultLayouts.ts +11 -5
  287. package/template/src/pages/video-call/NameWithMicIcon.tsx +17 -9
  288. package/template/src/pages/video-call/PinchableView.tsx +119 -0
  289. package/template/src/pages/video-call/RenderComponent.tsx +12 -3
  290. package/template/src/pages/video-call/SidePanelHeader.tsx +208 -6
  291. package/template/src/pages/video-call/VideoCallMobileView.tsx +140 -106
  292. package/template/src/pages/video-call/VideoCallScreen.native.tsx +3 -2
  293. package/template/src/pages/video-call/VideoCallScreen.tsx +113 -66
  294. package/template/src/pages/video-call/VideoComponent.tsx +53 -5
  295. package/template/src/pages/video-call/VideoRenderer.tsx +309 -52
  296. package/template/src/pages/video-call/VisibilitySensor.tsx +104 -0
  297. package/template/src/pages/video-call/ZoomableWrapper.native.tsx +34 -0
  298. package/template/src/pages/video-call/ZoomableWrapper.tsx +5 -0
  299. package/template/src/pages/video-call/index.ts +2 -0
  300. package/template/src/rtm/RTMEngine.ts +9 -4
  301. package/template/src/rtm-events/constants.ts +20 -0
  302. package/template/src/rtm-events-api/Events.ts +2 -0
  303. package/template/src/rtm-events-api/LocalEvents.ts +8 -0
  304. package/template/src/selection.json +1 -0
  305. package/template/src/subComponents/ChatBubble.tsx +81 -64
  306. package/template/src/subComponents/ChatContainer.tsx +20 -13
  307. package/template/src/subComponents/ChatInput.ios.tsx +11 -2
  308. package/template/src/subComponents/ChatInput.tsx +12 -3
  309. package/template/src/subComponents/Checkbox.native.tsx +46 -46
  310. package/template/src/subComponents/Checkbox.tsx +7 -6
  311. package/template/src/subComponents/CopyJoinInfo.tsx +26 -11
  312. package/template/src/subComponents/EndcallPopup.tsx +83 -12
  313. package/template/src/subComponents/LanguageSelector.tsx +34 -30
  314. package/template/src/subComponents/LayoutIconButton.tsx +30 -8
  315. package/template/src/subComponents/LayoutIconDropdown.tsx +19 -3
  316. package/template/src/subComponents/Loading.tsx +60 -0
  317. package/template/src/subComponents/LocalAudioMute.tsx +106 -30
  318. package/template/src/subComponents/LocalEndCall.tsx +91 -15
  319. package/template/src/subComponents/LocalSwitchCamera.tsx +50 -11
  320. package/template/src/subComponents/LocalVideoMute.tsx +126 -32
  321. package/template/src/subComponents/LogoutButton.tsx +1 -1
  322. package/template/src/subComponents/NetworkQualityPill.tsx +14 -31
  323. package/template/src/subComponents/Recording.tsx +23 -6
  324. package/template/src/subComponents/RemoteAudioMute.tsx +3 -3
  325. package/template/src/subComponents/RemoteMutePopup.tsx +55 -14
  326. package/template/src/subComponents/RemoteVideoMute.tsx +3 -3
  327. package/template/src/subComponents/RemoveMeetingPopup.tsx +19 -6
  328. package/template/src/subComponents/RemoveScreensharePopup.tsx +20 -5
  329. package/template/src/subComponents/ScreenShareNotice.tsx +11 -6
  330. package/template/src/subComponents/SelectDevice.tsx +98 -32
  331. package/template/src/subComponents/SidePanelEnum.tsx +2 -0
  332. package/template/src/subComponents/SidePanelHeader.tsx +97 -63
  333. package/template/src/subComponents/ToastConfig.tsx +70 -61
  334. package/template/src/subComponents/caption/Caption.tsx +130 -0
  335. package/template/src/subComponents/caption/CaptionContainer.tsx +302 -0
  336. package/template/src/subComponents/caption/CaptionIcon.tsx +111 -0
  337. package/template/src/subComponents/caption/CaptionText.tsx +182 -0
  338. package/template/src/subComponents/caption/DownloadTranscriptBtn.tsx +65 -0
  339. package/template/src/subComponents/caption/LanguageSelectorPopup.tsx +192 -0
  340. package/template/src/subComponents/caption/Transcript.tsx +449 -0
  341. package/template/src/subComponents/caption/TranscriptIcon.tsx +123 -0
  342. package/template/src/subComponents/caption/TranscriptText.tsx +98 -0
  343. package/template/src/subComponents/caption/index.ts +3 -0
  344. package/template/src/subComponents/caption/proto/ptoto.js +91 -0
  345. package/template/src/subComponents/caption/proto/test.proto +23 -0
  346. package/template/src/subComponents/caption/useCaption.tsx +123 -0
  347. package/template/src/subComponents/caption/useCaptionWidth.ts +27 -0
  348. package/template/src/subComponents/caption/useSTTAPI.tsx +179 -0
  349. package/template/src/subComponents/caption/useStreamMessageUtils.native.ts +211 -0
  350. package/template/src/subComponents/caption/useStreamMessageUtils.ts +235 -0
  351. package/template/src/subComponents/caption/useTranscriptDownload.native.ts +68 -0
  352. package/template/src/subComponents/caption/useTranscriptDownload.ts +52 -0
  353. package/template/src/subComponents/caption/utils.ts +125 -0
  354. package/template/src/subComponents/chat/ChatParticipants.tsx +53 -17
  355. package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +11 -13
  356. package/template/src/subComponents/livestream/controls/LocalRaiseHand.tsx +33 -9
  357. package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +1 -0
  358. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +10 -6
  359. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +28 -19
  360. package/template/src/subComponents/recording/useRecording.tsx +49 -20
  361. package/template/src/subComponents/recording/useRecordingLayoutQuery.tsx +0 -1
  362. package/template/src/subComponents/screenshare/ScreenshareButton.tsx +29 -10
  363. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +270 -66
  364. package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +182 -95
  365. package/template/src/subComponents/screenshare/useScreenshare.tsx +2 -0
  366. package/template/src/subComponents/waiting-rooms/WaitingRoomControls.tsx +85 -0
  367. package/template/src/subComponents/waiting-rooms/useWaitingRoomAPI.ts +75 -0
  368. package/template/src/theme/index.ts +9 -0
  369. package/template/src/utils/SdkEvents.ts +14 -0
  370. package/template/src/utils/SdkMethodEvents.ts +23 -3
  371. package/template/src/utils/axiomLogger.ts +117 -0
  372. package/template/src/utils/book.jpg +0 -0
  373. package/template/src/utils/common.tsx +118 -6
  374. package/template/src/utils/endCallEveryOne.ts +7 -0
  375. package/template/src/utils/getCustomRoute.ts +7 -0
  376. package/template/src/utils/index.tsx +23 -0
  377. package/template/src/utils/useActionSheet.tsx +50 -0
  378. package/template/src/utils/useActiveSpeaker.ts +3 -7
  379. package/template/src/utils/useAppState.ts +17 -0
  380. package/template/src/utils/useAsyncEffect.ts +138 -0
  381. package/template/src/utils/useCreateRoom.ts +8 -12
  382. package/template/src/utils/useDisableButton.tsx +37 -0
  383. package/template/src/utils/useFindActiveSpeaker.native.ts +4 -0
  384. package/template/src/utils/useFindActiveSpeaker.ts +335 -0
  385. package/template/src/utils/useIsLocalUserSpeaking.native.ts +4 -0
  386. package/template/src/utils/useIsLocalUserSpeaking.ts +98 -0
  387. package/template/src/utils/useJoinRoom.ts +97 -36
  388. package/template/src/utils/useMuteToggleLocal.ts +114 -96
  389. package/template/src/utils/useString.ts +13 -3
  390. package/template/static.d.ts +42 -0
  391. package/template/tsconfig_rsdk_index.json +3 -3
  392. package/template/tsconfig_wsdk_index.json +1 -1
  393. package/template/web/index.html +20 -0
  394. package/template/webpack.commons.js +21 -10
  395. package/template/webpack.web.config.js +7 -3
  396. package/template/_buckconfig +0 -6
  397. package/template/_gitattributes +0 -1
  398. package/template/android/app/_BUCK +0 -55
  399. package/template/android/app/build_defs.bzl +0 -19
  400. package/template/ios/HelloWorld/AppDelegate.m +0 -74
  401. package/template/src/components/OAuth.electron.tsx +0 -41
  402. package/template/src/components/OAuth.native.tsx +0 -55
  403. package/template/src/components/OAuth.tsx +0 -30
  404. package/template/src/components/OAuthConfig.ts +0 -77
  405. package/template/src/components/Settings.native.tsx +0 -21
  406. package/template/src/components/StoreToken.tsx +0 -39
@@ -1,45 +1,54 @@
1
+ /* eslint-disable react-native/no-inline-styles */
1
2
  import {StyleSheet, Text, TouchableOpacity, View} from 'react-native';
2
3
  import React, {useContext} from 'react';
3
4
  import ImageIcon from '../../atoms/ImageIcon';
4
- import LocalAudioMute, {
5
- LocalAudioMuteProps,
6
- } from '../../subComponents/LocalAudioMute';
7
- import LocalVideoMute, {
8
- LocalVideoMuteProps,
9
- } from '../../subComponents/LocalVideoMute';
10
- import LocalEndcall, {
11
- LocalEndcallProps,
12
- } from '../../subComponents/LocalEndCall';
5
+ import LocalAudioMute from '../../subComponents/LocalAudioMute';
6
+ import LocalVideoMute from '../../subComponents/LocalVideoMute';
7
+ import LocalEndcall from '../../subComponents/LocalEndCall';
13
8
  import CopyJoinInfo from '../../subComponents/CopyJoinInfo';
14
9
  import LocalSwitchCamera from '../../subComponents/LocalSwitchCamera';
15
10
  import Recording from '../../subComponents/Recording';
16
11
  import ChatContext from '../../components/ChatContext';
17
- import {numFormatter} from '../../utils';
18
- import IconButton from '../../atoms/IconButton';
19
- import {useLayout} from '../../utils/useLayout';
20
- import useLayoutsData from '../../pages/video-call/useLayoutsData';
21
- import {useChangeDefaultLayout} from '../../pages/video-call/DefaultLayouts';
22
12
  import {PropsContext, ToggleState} from '../../../agora-rn-uikit';
23
13
  import {ClientRole} from '../../../agora-rn-uikit';
24
- import {useRoomInfo} from '../../components/room-info/useRoomInfo';
14
+ import {
15
+ RoomInfoContextInterface,
16
+ useRoomInfo,
17
+ } from '../../components/room-info/useRoomInfo';
25
18
  import LiveStreamControls from '../../components/livestream/views/LiveStreamControls';
26
19
  import LiveStreamContext, {RaiseHandValue} from '../../components/livestream';
27
20
  import {
28
21
  ChatIconButton,
29
- ParticipantsCountView,
30
22
  ParticipantsIconButton,
31
23
  } from '../../../src/components/Navbar';
32
24
  import {useChatNotification} from '../../components/chat-notification/useChatNotification';
33
25
  import {SidePanelType} from '../../subComponents/SidePanelEnum';
34
26
  import {useSidePanel} from '../../utils/useSidePanel';
27
+ import {useContent, useLocalUserInfo, ToolbarItem} from 'customization-api';
28
+ import LayoutIconButton from '../../subComponents/LayoutIconButton';
29
+ import CaptionIcon from '../../../src/subComponents/caption/CaptionIcon';
30
+ import TranscriptIcon from '../../../src/subComponents/caption/TranscriptIcon';
31
+ import useSTTAPI from '../../../src/subComponents/caption/useSTTAPI';
32
+ import Carousel from '../../atoms/Carousel';
33
+ import {useCaption} from '../../subComponents/caption/useCaption';
35
34
  import Settings from '../../components/Settings';
35
+ import ScreenshareButton from '../../subComponents/screenshare/ScreenshareButton';
36
+ import {useScreenshare} from '../../subComponents/screenshare/useScreenshare';
37
+ import {EventNames} from '../../rtm-events';
38
+ import events from '../../rtm-events-api';
39
+ import {getLanguageLabel} from '../../subComponents/caption/utils';
40
+ import Toast from '../../../react-native-toast-message';
41
+ import {CustomToolbarSort} from '../../utils/common';
42
+ import {ActionSheetProvider} from '../../utils/useActionSheet';
43
+ import {useWaitingRoomContext} from '../../components/contexts/WaitingRoomContext';
44
+ import {useSetRoomInfo} from '../../components/room-info/useSetRoomInfo';
45
+ import VBButton from '../../components/virtual-background/VBButton';
46
+ import {useVB} from '../../components/virtual-background/useVB';
47
+ import {useString} from '../../utils/useString';
36
48
  import {
37
- ToolbarCustomItem,
38
- ToolbarItem,
39
- useLocalUserInfo,
40
- } from 'customization-api';
41
- import LayoutIconButton from '../../subComponents/LayoutIconButton';
42
-
49
+ sttSpokenLanguageToastHeading,
50
+ sttSpokenLanguageToastSubHeading,
51
+ } from '../../language/default-labels/videoCallScreenLabels';
43
52
  //Icon for expanding Action Sheet
44
53
  interface ShowMoreIconProps {
45
54
  isExpanded: boolean;
@@ -64,129 +73,64 @@ const ShowMoreIcon = (props: ShowMoreIconProps) => {
64
73
  };
65
74
 
66
75
  //Icon for Live Streaming Controls
67
- interface LiveStreamIconProps {
68
- isHandRaised: boolean;
69
- showLabel?: boolean;
70
- }
71
- const LiveStreamIcon = (props: LiveStreamIconProps) => {
72
- const {isHandRaised, showLabel = $config.ICON_TEXT} = props;
76
+ const LiveStreamIcon = () => {
77
+ //toolbaritem wrapped in the LiveStreamControls
78
+ return <LiveStreamControls showControls={true} />;
79
+ };
80
+
81
+ //Icon for Chat
82
+ const ChatIcon = () => {
73
83
  return (
74
84
  <ToolbarItem>
75
- <View style={styles.iconContainer}>
76
- <LiveStreamControls
77
- showControls={true}
78
- isDesktop={false}
79
- showLabel={false}
80
- />
81
- </View>
82
- {showLabel && (
83
- <Text style={styles.iconText}>
84
- {isHandRaised ? 'Lower\nHand' : 'Raise\nHand'}
85
- </Text>
86
- )}
85
+ <ChatIconButton />
87
86
  </ToolbarItem>
88
87
  );
89
88
  };
90
89
 
91
- //Icon for Chat
92
- interface ChatIconProps {
93
- showLabel?: boolean;
94
- }
95
- const ChatIcon = (props: ChatIconProps) => {
96
- const {showLabel = $config.ICON_TEXT} = props;
90
+ //Icon for Participants
91
+ const ParticipantsIcon = () => {
97
92
  return (
98
93
  <ToolbarItem>
99
- <View style={styles.iconContainer}>
100
- <ChatIconButton isOnActionSheet={true} />
101
- </View>
102
- {showLabel && <Text style={styles.iconText}>Chat</Text>}
94
+ <ParticipantsIconButton />
103
95
  </ToolbarItem>
104
96
  );
105
97
  };
106
98
 
107
- //Icon for Participants
108
- interface ParticipantsIconProps {
109
- showNotification: boolean;
110
- }
111
- const ParticipantsIcon = (props: ParticipantsIconProps) => {
112
- const {showNotification} = props;
99
+ //Icon for Recording
100
+
101
+ const RecordingIcon = () => {
113
102
  return (
114
103
  <ToolbarItem>
115
- <View style={styles.iconContainer}>
116
- <ParticipantsIconButton isOnActionSheet={true} />
117
- </View>
118
- {$config.ICON_TEXT && <Text style={styles.iconText}>People</Text>}
104
+ <Recording />
119
105
  </ToolbarItem>
120
106
  );
121
107
  };
122
108
 
123
- //Icon for Recording
124
- interface RecordingIconProps {
125
- showLabel?: boolean;
126
- }
127
- const RecordingIcon = (props: RecordingIconProps) => {
128
- const {showLabel = $config.ICON_TEXT} = props;
109
+ const VBIcon = () => {
110
+ const {isVBActive, setIsVBActive} = useVB();
129
111
  return (
130
112
  <ToolbarItem>
131
- <View style={styles.iconContainer}>
132
- <Recording showLabel={false} isOnActionSheet={true} />
133
- </View>
134
- {showLabel && <Text style={styles.iconText}>Record</Text>}
113
+ <VBButton
114
+ isVBOpen={isVBActive}
115
+ setIsVBOpen={setIsVBActive}
116
+ showLabel={true}
117
+ />
135
118
  </ToolbarItem>
136
119
  );
137
120
  };
138
121
 
139
- interface SwitchCameraIconProps {
140
- disabled: boolean;
141
- }
142
- const SwitchCameraIcon = (props: SwitchCameraIconProps) => {
143
- const {disabled} = props;
122
+ const SwitchCameraIcon = () => {
144
123
  return (
145
124
  <ToolbarItem>
146
- <View style={styles.iconContainer}>
147
- <LocalSwitchCamera showLabel={false} disabled={disabled} />
148
- </View>
149
- {$config.ICON_TEXT && (
150
- <View>
151
- <Text
152
- style={[
153
- styles.iconText,
154
- {
155
- color: disabled ? $config.SEMANTIC_NEUTRAL : $config.FONT_COLOR,
156
- },
157
- ]}>
158
- Switch
159
- </Text>
160
- <Text
161
- style={[
162
- styles.iconText,
163
- {
164
- color: disabled ? $config.SEMANTIC_NEUTRAL : $config.FONT_COLOR,
165
- marginTop: 0,
166
- },
167
- ]}>
168
- Camera
169
- </Text>
170
- </View>
171
- )}
125
+ <LocalSwitchCamera />
172
126
  </ToolbarItem>
173
127
  );
174
128
  };
175
129
 
176
- interface SettingsIconProps {
177
- onPress: () => void;
178
- }
179
- const SettingsIcon = (props: SettingsIconProps) => {
180
- const {onPress} = props;
130
+ const SettingsIcon = () => {
181
131
  return (
182
132
  <ToolbarItem>
183
- <TouchableOpacity style={styles.iconContainer} onPress={onPress}>
184
- <ImageIcon
185
- name={'settings'}
186
- tintColor={$config.SECONDARY_ACTION_COLOR}
187
- />
188
- </TouchableOpacity>
189
- {$config.ICON_TEXT && <Text style={styles.iconText}>Settings</Text>}
133
+ <Settings />
190
134
  </ToolbarItem>
191
135
  );
192
136
  };
@@ -194,135 +138,226 @@ const SettingsIcon = (props: SettingsIconProps) => {
194
138
  const ShareIcon = () => {
195
139
  return (
196
140
  <ToolbarItem>
141
+ <CopyJoinInfo />
142
+ </ToolbarItem>
143
+ );
144
+ };
145
+ const ScreenshareIcon = () => {
146
+ return (
147
+ <View style={styles.iconWithText}>
197
148
  <View style={styles.iconContainer}>
198
- <CopyJoinInfo showLabel={false} isOnActionSheet={true} />
149
+ <ScreenshareButton showLabel={false} isOnActionSheet={true} />
199
150
  </View>
200
- {$config.ICON_TEXT && <Text style={styles.iconText}>Invite</Text>}
151
+ {$config.ICON_TEXT && <Text style={styles.iconText}>Screen Share</Text>}
152
+ </View>
153
+ );
154
+ };
155
+
156
+ const AudioIcon = () => {
157
+ return (
158
+ <ToolbarItem>
159
+ <LocalAudioMute />
201
160
  </ToolbarItem>
202
161
  );
203
162
  };
204
163
 
205
- interface AudioIconProps {
206
- isMobileView: boolean;
207
- isOnActionSheet: boolean;
208
- showLabel: boolean;
209
- disabled: boolean;
210
- }
211
- const AudioIcon = (props: AudioIconProps) => {
164
+ const CamIcon = () => {
212
165
  return (
213
166
  <ToolbarItem>
214
- <View style={styles.iconContainer}>
215
- <LocalAudioMute {...props} />
216
- </View>
167
+ <LocalVideoMute />
217
168
  </ToolbarItem>
218
169
  );
219
170
  };
220
171
 
221
- interface CamIconProps {
222
- isMobileView: boolean;
223
- isOnActionSheet: boolean;
224
- showLabel: boolean;
225
- disabled: boolean;
226
- }
227
- const CamIcon = (props: CamIconProps) => {
172
+ const EndCallIcon = () => {
228
173
  return (
229
174
  <ToolbarItem>
230
- <View style={styles.iconContainer}>
231
- <LocalVideoMute {...props} />
232
- </View>
175
+ <LocalEndcall />
176
+ </ToolbarItem>
177
+ );
178
+ };
179
+
180
+ const LayoutIcon = () => {
181
+ return (
182
+ <ToolbarItem>
183
+ <LayoutIconButton />
233
184
  </ToolbarItem>
234
185
  );
235
186
  };
236
187
 
237
- interface EndCallIconProps {
238
- showLabel: boolean;
239
- isOnActionSheet: boolean;
188
+ interface CaptionIconBtnProps {
189
+ showLabel?: boolean;
190
+ onPress?: () => void;
240
191
  }
241
- const EndCallIcon = (props: EndCallIconProps) => {
192
+
193
+ const CaptionIconBtn = (props: CaptionIconBtnProps) => {
194
+ const {showLabel = $config.ICON_TEXT, onPress} = props;
195
+ const {isCaptionON, isSTTActive} = useCaption();
196
+ const {
197
+ data: {isHost},
198
+ } = useRoomInfo();
199
+ const isDisabled = !(
200
+ $config.ENABLE_STT &&
201
+ (isHost || (!isHost && isSTTActive))
202
+ );
242
203
  return (
243
204
  <ToolbarItem>
244
- <View
245
- style={[
246
- styles.iconContainer,
247
- {backgroundColor: $config.SEMANTIC_ERROR},
248
- ]}>
249
- <LocalEndcall {...props} />
250
- </View>
205
+ <CaptionIcon
206
+ isOnActionSheet={true}
207
+ showLabel={true}
208
+ closeActionSheet={onPress}
209
+ />
251
210
  </ToolbarItem>
252
211
  );
253
212
  };
254
213
 
255
- interface LayoutIconProps {
214
+ interface TranscriptIconProps {
256
215
  showLabel?: boolean;
257
216
  }
258
- const LayoutIcon = (props: LayoutIconProps) => {
217
+
218
+ const TranscriptIconBtn = (props: TranscriptIconProps) => {
259
219
  const {showLabel = $config.ICON_TEXT} = props;
220
+ const {sidePanel} = useSidePanel();
221
+ const isTranscriptON = sidePanel === SidePanelType.Transcript;
222
+ const {isSTTActive} = useCaption();
223
+ const {
224
+ data: {isHost},
225
+ } = useRoomInfo();
226
+ const isDisabled = !(
227
+ $config.ENABLE_STT &&
228
+ (isHost || (!isHost && isSTTActive))
229
+ );
260
230
  return (
261
231
  <ToolbarItem>
262
- <View style={styles.iconContainer}>
263
- <LayoutIconButton showLabel={false} />
264
- </View>
265
- {showLabel && <Text style={styles.iconText}>Layout</Text>}
232
+ <TranscriptIcon isOnActionSheet={true} showLabel={true} />
266
233
  </ToolbarItem>
267
234
  );
268
235
  };
269
236
 
270
- type ActionSheetComponentsProps = [
271
- (props: AudioIconProps) => JSX.Element,
272
- (props: CamIconProps) => JSX.Element,
273
- (props: EndCallIconProps) => JSX.Element,
274
- (props: ShowMoreIconProps) => JSX.Element,
275
- (props: ChatIconProps) => JSX.Element,
276
- (props: ParticipantsIconProps) => JSX.Element,
277
- (props) => JSX.Element,
278
- (props: SwitchCameraIconProps) => JSX.Element,
279
- (props: LayoutIconProps) => JSX.Element,
280
- (props: SettingsIconProps) => JSX.Element,
281
- (props) => JSX.Element,
282
- ];
283
-
284
- export const ActionSheetComponentsArray: ActionSheetComponentsProps = [
285
- AudioIcon,
286
- CamIcon,
287
- EndCallIcon,
288
- ShowMoreIcon,
289
- ChatIcon,
290
- ParticipantsIcon,
291
- RecordingIcon,
292
- SwitchCameraIcon,
293
- LayoutIcon,
294
- SettingsIcon,
295
- ShareIcon,
296
- ];
297
-
298
- const ActionSheetContent = (props) => {
237
+ const ToastIcon = ({color}) => (
238
+ <View style={{marginRight: 12, alignSelf: 'center', width: 24, height: 24}}>
239
+ <ImageIcon iconType="plain" tintColor={color} name={'lang-select'} />
240
+ </View>
241
+ );
242
+
243
+ const ActionSheetContent = props => {
244
+ const heading = useString<'Set' | 'Changed'>(sttSpokenLanguageToastHeading);
245
+ const subheading = useString<{
246
+ action: 'Set' | 'Changed';
247
+ newLanguage: string;
248
+ oldLanguage: string;
249
+ username: string;
250
+ }>(sttSpokenLanguageToastSubHeading);
251
+
299
252
  const {
300
253
  handleSheetChanges,
301
254
  isExpanded,
302
255
  customItems = [],
303
256
  includeDefaultItems = true,
257
+ displayCustomBottomSheetContent = false,
258
+ customBottomSheetContent,
259
+ native = false,
304
260
  } = props;
305
- const {onlineUsersCount, localUid} = useContext(ChatContext);
306
- const layouts = useLayoutsData();
307
- const {currentLayout} = useLayout();
308
- const changeLayout = useChangeDefaultLayout();
261
+
262
+ const {localUid} = useContext(ChatContext);
263
+ const {isScreenshareActive} = useScreenshare();
309
264
  const {rtcProps} = useContext(PropsContext);
310
- const {sidePanel, setSidePanel} = useSidePanel();
265
+ const {setSidePanel} = useSidePanel();
266
+ const {setRoomInfo} = useSetRoomInfo();
311
267
  const {
312
268
  data: {isHost},
269
+ sttLanguage,
270
+ isSTTActive,
313
271
  } = useRoomInfo();
314
272
  const {isPendingRequestToReview, raiseHandList} =
315
273
  useContext(LiveStreamContext);
316
274
  const {totalUnreadCount} = useChatNotification();
317
- const layout = layouts.findIndex((item) => item.name === currentLayout);
318
- const isLiveStream = $config.EVENT_MODE;
319
- const isAudience = rtcProps?.role == ClientRole.Audience;
320
- const isBroadCasting = rtcProps?.role == ClientRole.Broadcaster;
321
- const isHandRaised = raiseHandList[localUid]?.raised === RaiseHandValue.TRUE;
275
+ const {setIsSTTActive, setLanguage, setMeetingTranscript} = useCaption();
276
+ const {defaultContent} = useContent();
277
+ const {waitingRoomUids} = useWaitingRoomContext();
278
+ const defaultContentRef = React.useRef(defaultContent);
322
279
 
323
- const handleLayoutChange = () => {
324
- changeLayout();
325
- };
280
+ React.useEffect(() => {
281
+ defaultContentRef.current = defaultContent;
282
+ }, [defaultContent]);
283
+
284
+ //STT events on mount
285
+
286
+ React.useEffect(() => {
287
+ setIsSTTActive(isSTTActive);
288
+ }, [isSTTActive]);
289
+
290
+ React.useEffect(() => {
291
+ // for mobile events are set in ActionSheetContent
292
+ if (!sttLanguage) return;
293
+ const {
294
+ username,
295
+ prevLang,
296
+ newLang,
297
+ uid,
298
+ langChanged,
299
+ }: RoomInfoContextInterface['sttLanguage'] = sttLanguage;
300
+ if (!langChanged) return;
301
+ const actionText =
302
+ prevLang.indexOf('') !== -1
303
+ ? `has set the spoken language to "${getLanguageLabel(newLang)}" `
304
+ : `changed the spoken language from "${getLanguageLabel(
305
+ prevLang,
306
+ )}" to "${getLanguageLabel(newLang)}" `;
307
+ const msg = `${
308
+ defaultContentRef.current[uid]?.name || username
309
+ } ${actionText} `;
310
+
311
+ let subheadingObj: any = {};
312
+ if (prevLang.indexOf('') !== -1) {
313
+ subheadingObj = {
314
+ username: defaultContentRef.current[uid]?.name || username,
315
+ action: prevLang.indexOf('') !== -1 ? 'Set' : 'Changed',
316
+ newLanguage: getLanguageLabel(newLang),
317
+ };
318
+ } else {
319
+ subheadingObj = {
320
+ username: defaultContentRef.current[uid]?.name || username,
321
+ action: prevLang.indexOf('') !== -1 ? 'Set' : 'Changed',
322
+ newLanguage: getLanguageLabel(newLang),
323
+ oldLanguage: getLanguageLabel(prevLang),
324
+ };
325
+ }
326
+ Toast.show({
327
+ leadingIconName: 'lang-select',
328
+ type: 'info',
329
+ text1: heading(prevLang.indexOf('') !== -1 ? 'Set' : 'Changed'),
330
+ visibilityTime: 3000,
331
+ primaryBtn: null,
332
+ secondaryBtn: null,
333
+ text2: subheading(subheadingObj),
334
+ });
335
+ setRoomInfo(prev => {
336
+ return {
337
+ ...prev,
338
+ sttLanguage: {...sttLanguage, langChanged: false},
339
+ };
340
+ });
341
+ // syncing local set language
342
+ newLang && setLanguage(newLang);
343
+ // add spoken lang msg to transcript
344
+ setMeetingTranscript(prev => {
345
+ return [
346
+ ...prev,
347
+ {
348
+ name: 'langUpdate',
349
+ time: new Date().getTime(),
350
+ uid: `langUpdate-${uid}`,
351
+ text: actionText,
352
+ },
353
+ ];
354
+ });
355
+ }, [sttLanguage]);
356
+
357
+ const isLiveStream = $config.EVENT_MODE && !$config.AUDIO_ROOM;
358
+ const isAudience = rtcProps?.role === ClientRole.Audience;
359
+ const isBroadCasting = rtcProps?.role === ClientRole.Broadcaster;
360
+ const isHandRaised = raiseHandList[localUid]?.raised === RaiseHandValue.TRUE;
326
361
 
327
362
  const isAudioRoom = $config.AUDIO_ROOM;
328
363
  const isVoiceChatHost = !$config.EVENT_MODE && $config.AUDIO_ROOM && isHost;
@@ -334,7 +369,16 @@ const ActionSheetContent = (props) => {
334
369
 
335
370
  const isAudioVideoControlsDisabled =
336
371
  isAudience && $config.EVENT_MODE && !$config.RAISE_HAND;
337
- const isVideoDisabled = useLocalUserInfo().video === ToggleState.disabled;
372
+
373
+ const isConferencing = !$config.EVENT_MODE && !$config.AUDIO_ROOM;
374
+
375
+ const localUser = useLocalUserInfo();
376
+
377
+ const isVideoDisabled = native
378
+ ? localUser.video === ToggleState.disabled || isScreenshareActive
379
+ : localUser.video === ToggleState.disabled;
380
+
381
+ const isPendingWaitingRoomApproval = isHost && waitingRoomUids.length > 0;
338
382
 
339
383
  const defaultItems = [
340
384
  {
@@ -342,14 +386,7 @@ const ActionSheetContent = (props) => {
342
386
  order: 0,
343
387
  hide: 'no',
344
388
  align: 'start',
345
- component: isAudioVideoControlsDisabled ? null : (
346
- <AudioIcon
347
- isMobileView={true}
348
- isOnActionSheet={true}
349
- showLabel={false}
350
- disabled={isLiveStream && isAudience && !isBroadCasting}
351
- />
352
- ),
389
+ component: isAudioVideoControlsDisabled ? null : <AudioIcon />,
353
390
  },
354
391
  {
355
392
  default: true,
@@ -357,11 +394,11 @@ const ActionSheetContent = (props) => {
357
394
  hide: 'no',
358
395
  align: 'start',
359
396
  /*For AudioCast Host:Chat ,Attendee:Raise Hand
360
- For VoiceChat Host:Chat, Attendee:Chat
361
- */
397
+ For VoiceChat Host:Chat, Attendee:Chat
398
+ */
362
399
  component: (isAudioCastHost ||
363
400
  isVoiceChatHost ||
364
- isVoiceChatAudience) && <ChatIcon showLabel={false} />,
401
+ isVoiceChatAudience) && <ChatIcon />,
365
402
  },
366
403
 
367
404
  {
@@ -373,7 +410,7 @@ const ActionSheetContent = (props) => {
373
410
  (isAudioCastAudience && isLiveStream && isAudience) ||
374
411
  (isBroadCasting && !isHost) ? (
375
412
  $config.RAISE_HAND && isAudioRoom ? (
376
- <LiveStreamIcon isHandRaised={isHandRaised} showLabel={false} />
413
+ <LiveStreamIcon />
377
414
  ) : null
378
415
  ) : null,
379
416
  },
@@ -383,22 +420,14 @@ const ActionSheetContent = (props) => {
383
420
  hide: 'no',
384
421
  align: 'start',
385
422
  component:
386
- !isAudioRoom &&
387
- (isAudioVideoControlsDisabled ? null : (
388
- <CamIcon
389
- isOnActionSheet={true}
390
- isMobileView={true}
391
- showLabel={false}
392
- disabled={isLiveStream && isAudience && !isBroadCasting}
393
- />
394
- )),
423
+ !isAudioRoom && (isAudioVideoControlsDisabled ? null : <CamIcon />),
395
424
  },
396
425
  {
397
426
  default: true,
398
427
  order: 2,
399
428
  hide: 'no',
400
429
  align: 'start',
401
- component: <EndCallIcon showLabel={false} isOnActionSheet={true} />,
430
+ component: <EndCallIcon />,
402
431
  },
403
432
  //reset of the controls
404
433
  {
@@ -409,142 +438,188 @@ const ActionSheetContent = (props) => {
409
438
  component:
410
439
  (isLiveStream && isAudience) || (isBroadCasting && !isHost) ? (
411
440
  $config.RAISE_HAND && !isAudioRoom ? (
412
- <LiveStreamIcon isHandRaised={isHandRaised} />
441
+ <LiveStreamIcon />
413
442
  ) : null
414
443
  ) : null,
415
444
  },
445
+
416
446
  {
417
447
  default: true,
418
448
  order: 5,
419
449
  hide: 'no',
420
450
  align: 'start',
421
- component: <LayoutIcon />,
451
+ component: !(
452
+ isAudioCastHost ||
453
+ isVoiceChatHost ||
454
+ isVoiceChatAudience
455
+ ) && <ChatIcon />,
422
456
  },
423
457
  {
424
458
  default: true,
425
459
  order: 6,
426
460
  hide: 'no',
427
461
  align: 'start',
428
- component: !(
429
- isAudioCastHost ||
430
- isVoiceChatHost ||
431
- isVoiceChatAudience
432
- ) && <ChatIcon />,
462
+ component: <ParticipantsIcon />,
433
463
  },
434
464
  {
435
465
  default: true,
436
466
  order: 7,
437
467
  hide: 'no',
438
468
  align: 'start',
439
- component: (
440
- <ParticipantsIcon
441
- showNotification={$config.EVENT_MODE && isPendingRequestToReview}
442
- />
443
- ),
469
+ component: isHost && $config.CLOUD_RECORDING ? <RecordingIcon /> : null,
444
470
  },
445
471
  {
446
472
  default: true,
447
- order: 8,
473
+ order: 7,
448
474
  hide: 'no',
449
475
  align: 'start',
450
- component: isHost && $config.CLOUD_RECORDING ? <RecordingIcon /> : null,
476
+ component:
477
+ $config.ENABLE_VIRTUAL_BACKGROUND && !$config.AUDIO_ROOM ? (
478
+ <VBIcon />
479
+ ) : null,
451
480
  },
452
481
  {
453
482
  default: true,
454
- order: 9,
483
+ order: 8,
455
484
  hide: 'no',
456
485
  align: 'start',
457
486
  component:
458
487
  !isAudioRoom &&
459
- (isAudioVideoControlsDisabled ? null : (
460
- <SwitchCameraIcon
461
- disabled={
462
- (isLiveStream && isAudience && !isBroadCasting) || isVideoDisabled
463
- }
464
- />
465
- )),
488
+ (isAudioVideoControlsDisabled ? null : <SwitchCameraIcon />),
489
+ },
490
+ {
491
+ default: true,
492
+ order: 9,
493
+ hide: 'no',
494
+ align: 'start',
495
+ component: <LayoutIcon />,
466
496
  },
467
497
  {
468
498
  default: true,
469
499
  order: 10,
470
500
  hide: 'no',
471
501
  align: 'start',
502
+ component: <SettingsIcon />,
503
+ },
504
+ {
505
+ default: true,
506
+ order: 11,
507
+ hide: 'no',
508
+ align: 'start',
509
+ component: <ShareIcon />,
510
+ },
511
+ {
512
+ default: true,
513
+ order: 12,
514
+ hide: 'no',
515
+ align: 'start',
472
516
  component: (
473
- <SettingsIcon
474
- onPress={() => {
475
- setSidePanel(SidePanelType.Settings);
476
- }}
517
+ <CaptionIconBtn
518
+ onPress={() => handleSheetChanges(isExpanded ? 0 : 1)}
477
519
  />
478
520
  ),
479
521
  },
480
522
  {
481
523
  default: true,
482
- order: 11,
524
+ order: 13,
483
525
  hide: 'no',
484
526
  align: 'start',
485
- component: <ShareIcon />,
527
+ component: <TranscriptIconBtn />,
486
528
  },
487
529
  ];
488
530
 
489
- const isHidden = (i) => {
531
+ const isHidden = i => {
490
532
  return i?.hide === 'yes';
491
533
  };
492
534
  const combinedItems = customItems
493
- ?.filter((i) => !isHidden(i))
535
+ ?.filter(i => !isHidden(i))
494
536
  ?.concat(includeDefaultItems ? defaultItems : [])
495
537
  //to filter empty component because of some condition array will have empty component
496
- ?.filter((i) => i?.component)
497
- ?.sort((a, b) => a?.order - b?.order);
538
+ ?.filter(i => i?.component)
539
+ ?.sort(CustomToolbarSort);
498
540
 
541
+ if (displayCustomBottomSheetContent) {
542
+ return <View>{customBottomSheetContent}</View>;
543
+ }
499
544
  return (
500
545
  <View>
501
546
  {/* Row Always Visible */}
502
- <View
503
- style={[
504
- styles.row,
505
- {borderBottomWidth: 1, paddingTop: 4, justifyContent: 'center'},
506
- ]}>
507
- {/**If no items more than 4 then render firstrender first 3 items and render show more icon */}
508
- {/**If no items more less or equal to 4 then render n items and don't show more icon */}
509
- {combinedItems
510
- ?.slice(0, combinedItems?.length >= 4 ? 3 : 4)
511
- ?.map((i) => {
512
- const Component = i?.component;
513
- if (Component) {
514
- return i?.default ? Component : <Component />;
515
- } else {
516
- return null;
517
- }
518
- })}
519
- {combinedItems && combinedItems?.length >= 4 ? (
520
- <ShowMoreIcon
521
- isExpanded={isExpanded}
522
- showNotification={
523
- (!isExpanded && totalUnreadCount !== 0) ||
524
- ($config.EVENT_MODE && isPendingRequestToReview)
525
- }
526
- onPress={() => handleSheetChanges(isExpanded ? 0 : 1)}
527
- />
528
- ) : (
529
- <></>
530
- )}
531
- </View>
547
+ <ActionSheetProvider isOnFirstRow={true}>
548
+ <View
549
+ style={[
550
+ styles.row,
551
+ {borderBottomWidth: 1, paddingTop: 4, justifyContent: 'center'},
552
+ ]}>
553
+ {/**If no items more than 4 then render firstrender first 3 items and render show more icon */}
554
+ {/**If no items more less or equal to 4 then render n items and don't show more icon */}
555
+ {combinedItems
556
+ ?.slice(0, combinedItems?.length > 4 ? 3 : 4)
557
+ ?.map(i => {
558
+ const Component = i?.component;
559
+ if (Component) {
560
+ return i?.default ? Component : <Component />;
561
+ } else {
562
+ return null;
563
+ }
564
+ })}
565
+ {combinedItems && combinedItems?.length > 4 ? (
566
+ <ShowMoreIcon
567
+ isExpanded={isExpanded}
568
+ showNotification={
569
+ (!isExpanded && totalUnreadCount !== 0) ||
570
+ ($config.EVENT_MODE && isPendingRequestToReview) ||
571
+ isPendingWaitingRoomApproval
572
+ }
573
+ onPress={() => handleSheetChanges(isExpanded ? 0 : 1)}
574
+ />
575
+ ) : (
576
+ <></>
577
+ )}
578
+ </View>
579
+ </ActionSheetProvider>
532
580
 
533
- {/* Rest Of Controls */}
534
- <View style={styles.row}>
535
- {combinedItems?.length > 3 &&
536
- combinedItems?.slice(3, combinedItems?.length)?.map((i) => {
537
- const Component = i?.component;
538
- if (Component) {
539
- return i?.default ? Component : <Component />;
540
- } else {
541
- return null;
542
- }
543
- })}
544
- </View>
581
+ <CarouselWrapper data={combinedItems?.slice(3, combinedItems?.length)} />
545
582
  </View>
546
583
  );
547
584
  };
585
+ const CarouselWrapper = ({data}) => {
586
+ const createSlides = () => {
587
+ const slides = [];
588
+ const items = data || [];
589
+ // one slide can contain max of 8 icons
590
+ for (let i = 0; i < items.length; i += 8) {
591
+ const slideItems = items.slice(i, i + 8).map(item => {
592
+ const Component = item?.component;
593
+ return Component ? (
594
+ item.default ? (
595
+ Component
596
+ ) : (
597
+ <Component key={item.id} />
598
+ )
599
+ ) : null;
600
+ });
601
+
602
+ slides.push({
603
+ id: `slide_${Math.floor(i / 8) + 1}`,
604
+ component: <View style={styles.row}>{slideItems}</View>,
605
+ });
606
+ }
607
+
608
+ return slides;
609
+ };
610
+
611
+ const slides = createSlides();
612
+
613
+ const isPaginationRequired = slides.length > 1;
614
+
615
+ if (isPaginationRequired)
616
+ return (
617
+ <View style={{flexDirection: 'row'}}>
618
+ <Carousel data={slides} />
619
+ </View>
620
+ );
621
+ return <View style={styles.row}>{slides[0].component}</View>;
622
+ };
548
623
 
549
624
  export default ActionSheetContent;
550
625