agora-appbuilder-core 3.0.9 → 4.0.0-api.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 (305) hide show
  1. package/Readme.md +6 -0
  2. package/package.json +2 -2
  3. package/template/_package-lock.json +5871 -4728
  4. package/template/agora-rn-uikit/src/AgoraUIKit.tsx +6 -6
  5. package/template/agora-rn-uikit/src/Contexts/ContentContext.tsx +10 -0
  6. package/template/agora-rn-uikit/src/Contexts/DispatchContext.tsx +22 -0
  7. package/template/agora-rn-uikit/src/Contexts/LocalUserContext.tsx +10 -6
  8. package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +28 -8
  9. package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +7 -15
  10. package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +30 -26
  11. package/template/agora-rn-uikit/src/Controls/Icons.ts +30 -83
  12. package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +6 -6
  13. package/template/agora-rn-uikit/src/Controls/Local/LocalAudioMute.tsx +4 -2
  14. package/template/agora-rn-uikit/src/Controls/Local/LocalVideoMute.tsx +4 -2
  15. package/template/agora-rn-uikit/src/Controls/Local/Recording.tsx +0 -2
  16. package/template/agora-rn-uikit/src/Controls/Local/SwitchCamera.tsx +6 -6
  17. package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +5 -5
  18. package/template/agora-rn-uikit/src/Controls/Remote/RemoteAudioMute.tsx +4 -4
  19. package/template/agora-rn-uikit/src/Controls/Remote/RemoteVideoMute.tsx +4 -4
  20. package/template/agora-rn-uikit/src/Controls/RemoteControls.tsx +2 -2
  21. package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +6 -6
  22. package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +6 -6
  23. package/template/agora-rn-uikit/src/Reducer/LocalPermissionState.ts +23 -0
  24. package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +6 -6
  25. package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +7 -7
  26. package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +7 -7
  27. package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +10 -10
  28. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +6 -6
  29. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +6 -6
  30. package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +5 -5
  31. package/template/agora-rn-uikit/src/Reducer/UserPin.ts +11 -0
  32. package/template/agora-rn-uikit/src/Reducer/index.ts +2 -0
  33. package/template/agora-rn-uikit/src/Rtc/Create.tsx +74 -7
  34. package/template/agora-rn-uikit/src/Rtc/Join.tsx +5 -4
  35. package/template/agora-rn-uikit/src/RtcConfigure.tsx +76 -49
  36. package/template/agora-rn-uikit/src/Views/MaxVideoView.native.tsx +17 -7
  37. package/template/agora-rn-uikit/src/Views/MaxVideoView.tsx +17 -11
  38. package/template/agora-rn-uikit/src/Views/MinVideoView.tsx +2 -2
  39. package/template/agora-rn-uikit/src/index.ts +17 -9
  40. package/template/android/app/build.gradle +1 -0
  41. package/template/android/app/src/main/AndroidManifest.xml +22 -15
  42. package/template/android/app/src/main/assets/fonts/SourceSansPro-Regular.ttf +0 -0
  43. package/template/android/app/src/main/assets/fonts/icomoon.ttf +0 -0
  44. package/template/android/app/src/main/java/com/helloworld/MainActivity.java +50 -0
  45. package/template/android/app/src/main/res/values/colors.xml +7 -0
  46. package/template/android/build.gradle +3 -3
  47. package/template/babel.config.js +1 -0
  48. package/template/bridge/rtc/webNg/RtcEngine.ts +110 -17
  49. package/template/customization-api/action-library.ts +10 -14
  50. package/template/customization-api/app-state.ts +4 -6
  51. package/template/customization-api/customEvents.ts +2 -2
  52. package/template/customization-api/customize.ts +1 -1
  53. package/template/customization-api/sub-components.ts +4 -12
  54. package/template/customization-api/typeDefinition.ts +15 -38
  55. package/template/customization-implementation/createHook.ts +24 -6
  56. package/template/customization-implementation/index.ts +1 -1
  57. package/template/customization-implementation/useCustomization.tsx +5 -7
  58. package/template/electron/index.html +27 -27
  59. package/template/electron/renderer/index.js +1 -0
  60. package/template/global.d.ts +26 -4
  61. package/template/index.rsdk.tsx +1 -0
  62. package/template/index.web.js +2 -1
  63. package/template/index.wsdk.tsx +9 -2
  64. package/template/ios/HelloWorld/Info.plist +14 -1
  65. package/template/ios/HelloWorld.xcodeproj/project.pbxproj +17 -0
  66. package/template/metro.config.js +1 -1
  67. package/template/package.json +18 -7
  68. package/template/react-native-toast-message/index.d.ts +43 -43
  69. package/template/react-native-toast-message/src/colors/index.js +3 -2
  70. package/template/react-native-toast-message/src/components/base/index.js +46 -59
  71. package/template/react-native-toast-message/src/components/base/styles.js +16 -32
  72. package/template/react-native-toast-message/src/components/checkbox.js +178 -0
  73. package/template/react-native-toast-message/src/components/error.js +3 -2
  74. package/template/react-native-toast-message/src/components/info.js +3 -2
  75. package/template/react-native-toast-message/src/components/success.js +3 -2
  76. package/template/react-native-toast-message/src/index.js +122 -31
  77. package/template/react-native-toast-message/src/index.sdk.tsx +125 -35
  78. package/template/react-native-toast-message/src/styles.js +3 -4
  79. package/template/react-native-toast-message/src/styles.sdk.ts +3 -4
  80. package/template/react-native.config.js +7 -0
  81. package/template/src/App.tsx +19 -14
  82. package/template/src/AppWrapper.tsx +74 -29
  83. package/template/src/SDKAppWrapper.tsx +60 -64
  84. package/template/src/app-state/useLocalUserInfo.ts +3 -3
  85. package/template/src/assets/font-styles.css +329 -0
  86. package/template/src/assets/fonts/SourceSansPro-Regular.ttf +0 -0
  87. package/template/src/assets/fonts/icomoon.ttf +0 -0
  88. package/template/src/assets/permission.png +0 -0
  89. package/template/src/assets/selection.json +1 -0
  90. package/template/src/atoms/ActionMenu.tsx +236 -0
  91. package/template/src/atoms/AnimatedActiveSpeaker.native.tsx +71 -0
  92. package/template/src/atoms/AnimatedActiveSpeaker.tsx +84 -0
  93. package/template/src/atoms/AnimatedRings.native.tsx +68 -0
  94. package/template/src/atoms/AnimatedRings.tsx +70 -0
  95. package/template/src/atoms/Card.tsx +61 -0
  96. package/template/src/atoms/CircularProgress.native.tsx +121 -0
  97. package/template/src/atoms/CircularProgress.tsx +102 -0
  98. package/template/src/atoms/CustomIcon.tsx +88 -0
  99. package/template/src/atoms/CustomSwitch.tsx +287 -0
  100. package/template/src/atoms/Dropdown.tsx +306 -0
  101. package/template/src/atoms/HorizontalRule.tsx +3 -1
  102. package/template/src/atoms/IconButton.tsx +162 -0
  103. package/template/src/atoms/ImageIcon.tsx +98 -0
  104. package/template/src/atoms/InfoBubble.tsx +291 -0
  105. package/template/src/atoms/Input.tsx +87 -0
  106. package/template/src/atoms/InviteInfo.tsx +166 -0
  107. package/template/src/atoms/LinkButton.tsx +28 -0
  108. package/template/src/atoms/OutlineButton.tsx +61 -0
  109. package/template/src/atoms/ParticipantsCount.tsx +74 -0
  110. package/template/src/atoms/Popup.tsx +147 -0
  111. package/template/src/atoms/PrimaryButton.tsx +51 -26
  112. package/template/src/atoms/RecordingInfo.tsx +52 -0
  113. package/template/src/atoms/SecondaryButton.tsx +8 -5
  114. package/template/src/atoms/Spacer.tsx +22 -0
  115. package/template/src/atoms/TertiaryButton.tsx +78 -0
  116. package/template/src/atoms/TextInput.tsx +12 -14
  117. package/template/src/atoms/Toggle.tsx +47 -0
  118. package/template/src/atoms/Toolbar.tsx +68 -0
  119. package/template/src/atoms/ToolbarItem.tsx +63 -0
  120. package/template/src/atoms/Tooltip.native.tsx +65 -0
  121. package/template/src/atoms/Tooltip.tsx +94 -0
  122. package/template/src/atoms/UserAvatar.tsx +60 -0
  123. package/template/src/components/Chat.tsx +164 -278
  124. package/template/src/components/ChatContext.ts +8 -1
  125. package/template/src/components/ColorConfigure.tsx +1 -1
  126. package/template/src/components/ColorContext.ts +1 -1
  127. package/template/src/components/CommonStyles.ts +44 -0
  128. package/template/src/components/Controls.tsx +331 -73
  129. package/template/src/components/{Controls.native.tsx → Controls1.native.tsx} +8 -6
  130. package/template/src/components/DeviceConfigure.tsx +511 -106
  131. package/template/src/components/DeviceContext.tsx +8 -4
  132. package/template/src/components/EventsConfigure.tsx +192 -10
  133. package/template/src/components/GraphQLProvider.tsx +1 -1
  134. package/template/src/components/GridVideo.tsx +60 -45
  135. package/template/src/components/HostControlView.tsx +114 -35
  136. package/template/src/components/Navbar.tsx +219 -437
  137. package/template/src/components/Navigation.tsx +15 -1
  138. package/template/src/components/NetworkQualityContext.tsx +22 -22
  139. package/template/src/components/ParticipantsView.tsx +178 -156
  140. package/template/src/components/PinnedVideo.tsx +206 -121
  141. package/template/src/components/Precall.native.tsx +358 -119
  142. package/template/src/components/Precall.tsx +272 -138
  143. package/template/src/components/RTMConfigure.tsx +66 -19
  144. package/template/src/components/Router.electron.ts +1 -0
  145. package/template/src/components/Router.native.ts +1 -0
  146. package/template/src/components/Router.sdk.ts +1 -0
  147. package/template/src/components/Router.ts +1 -0
  148. package/template/src/components/SdkApiContext.tsx +161 -0
  149. package/template/src/components/Settings.tsx +26 -95
  150. package/template/src/components/SettingsView.tsx +251 -56
  151. package/template/src/components/Share.tsx +305 -276
  152. package/template/src/components/StorageContext.tsx +30 -3
  153. package/template/src/components/ToastComponent.tsx +8 -0
  154. package/template/src/components/chat-messages/useChatMessages.tsx +97 -50
  155. package/template/src/components/chat-ui/useChatUIControls.tsx +76 -0
  156. package/template/src/components/common/Error.tsx +20 -6
  157. package/template/src/components/common/Logo.tsx +16 -15
  158. package/template/src/components/contexts/LiveStreamDataContext.tsx +16 -11
  159. package/template/src/components/contexts/VideoMeetingDataContext.tsx +41 -11
  160. package/template/src/components/contexts/WhiteboardContext.tsx +3 -3
  161. package/template/src/components/livestream/LiveStreamContext.tsx +284 -50
  162. package/template/src/components/livestream/Types.ts +39 -14
  163. package/template/src/components/livestream/index.ts +1 -0
  164. package/template/src/components/livestream/views/LiveStreamControls.tsx +9 -4
  165. package/template/src/components/participants/AllAudienceParticipants.tsx +102 -31
  166. package/template/src/components/participants/AllHostParticipants.tsx +106 -35
  167. package/template/src/components/participants/Participant.tsx +300 -0
  168. package/template/src/components/participants/ParticipantName.tsx +13 -7
  169. package/template/src/components/participants/ParticipantSectionTitle.tsx +35 -10
  170. package/template/src/components/participants/ScreenshareParticipants.tsx +144 -12
  171. package/template/src/components/participants/UserActionMenuOptions.tsx +396 -0
  172. package/template/src/components/popups/InvitePopup.tsx +115 -0
  173. package/template/src/components/popups/StopRecordingPopup.tsx +114 -0
  174. package/template/src/components/precall/LocalMute.tsx +84 -14
  175. package/template/src/components/precall/{LocalMute.native.tsx → LocalMute1.native.tsx} +21 -5
  176. package/template/src/components/precall/PermissionHelper.native.tsx +5 -0
  177. package/template/src/components/precall/PermissionHelper.tsx +126 -0
  178. package/template/src/components/precall/PreCallSettings.tsx +52 -0
  179. package/template/src/components/precall/VideoPreview.native.tsx +51 -6
  180. package/template/src/components/precall/VideoPreview.tsx +164 -8
  181. package/template/src/components/precall/joinCallBtn.native.tsx +2 -2
  182. package/template/src/components/precall/joinCallBtn.tsx +17 -4
  183. package/template/src/components/precall/meetingTitle.tsx +17 -14
  184. package/template/src/components/precall/selectDevice.tsx +1 -21
  185. package/template/src/components/precall/textInput.tsx +34 -6
  186. package/template/src/components/precall/usePreCall.tsx +39 -1
  187. package/template/src/components/{meeting-info/useMeetingInfo.tsx → room-info/useRoomInfo.tsx} +34 -10
  188. package/template/src/components/{meeting-info/useSetMeetingInfo.tsx → room-info/useSetRoomInfo.tsx} +12 -12
  189. package/template/src/components/styles.ts +42 -21
  190. package/template/src/components/useShareLink.tsx +19 -21
  191. package/template/src/components/useToast.tsx +41 -0
  192. package/template/src/components/useUserPreference.tsx +9 -6
  193. package/template/src/components/useVideoCall.tsx +84 -0
  194. package/template/src/language/default-labels/createScreenLabels.ts +3 -3
  195. package/template/src/language/default-labels/joinScreenLabels.ts +2 -2
  196. package/template/src/language/default-labels/precallScreenLabels.ts +3 -3
  197. package/template/src/language/default-labels/shareLinkScreenLabels.ts +5 -5
  198. package/template/src/language/default-labels/videoCallScreenLabels.ts +5 -5
  199. package/template/src/pages/Authenticate.tsx +5 -15
  200. package/template/src/pages/Create.tsx +304 -191
  201. package/template/src/pages/Endcall.tsx +148 -0
  202. package/template/src/pages/Join.tsx +96 -70
  203. package/template/src/pages/VideoCall.tsx +179 -69
  204. package/template/src/pages/video-call/ActionSheet.native.tsx +215 -0
  205. package/template/src/pages/video-call/ActionSheet.tsx +226 -0
  206. package/template/src/pages/video-call/ActionSheetContent.tsx +479 -0
  207. package/template/src/pages/video-call/ActionSheetHandle.tsx +38 -0
  208. package/template/src/pages/video-call/ActionSheetStyles.css +138 -0
  209. package/template/src/pages/video-call/DefaultLayouts.ts +6 -6
  210. package/template/src/pages/video-call/NameWithMicIcon.tsx +93 -49
  211. package/template/src/pages/video-call/RenderComponent.tsx +6 -30
  212. package/template/src/pages/video-call/SidePanelHeader.tsx +186 -0
  213. package/template/src/pages/video-call/VideoCallMobileView.tsx +138 -0
  214. package/template/src/pages/video-call/VideoCallScreen.native.tsx +37 -0
  215. package/template/src/pages/video-call/VideoCallScreen.tsx +109 -66
  216. package/template/src/pages/video-call/VideoComponent.tsx +20 -4
  217. package/template/src/pages/video-call/VideoRenderer.tsx +227 -61
  218. package/template/src/pages/video-call/index.ts +35 -7
  219. package/template/src/rtm/RTMEngine.ts +8 -0
  220. package/template/src/rtm-events/constants.ts +3 -1
  221. package/template/src/rtm-events-api/Events.ts +5 -4
  222. package/template/src/rtm-events-api/LocalEvents.ts +6 -0
  223. package/template/src/rtm-events-api/types.ts +5 -5
  224. package/template/src/subComponents/ChatBubble.tsx +125 -84
  225. package/template/src/subComponents/ChatContainer.tsx +280 -93
  226. package/template/src/subComponents/ChatInput.ios.tsx +175 -0
  227. package/template/src/subComponents/ChatInput.tsx +72 -115
  228. package/template/src/subComponents/Checkbox.native.tsx +16 -5
  229. package/template/src/subComponents/Checkbox.tsx +2 -2
  230. package/template/src/subComponents/CopyJoinInfo.tsx +36 -58
  231. package/template/src/subComponents/EndcallPopup.tsx +107 -0
  232. package/template/src/subComponents/FallbackLogo.tsx +122 -40
  233. package/template/src/subComponents/LanguageSelector.tsx +1 -1
  234. package/template/src/subComponents/LayoutIconButton.tsx +201 -0
  235. package/template/src/subComponents/LayoutIconDropdown.tsx +131 -134
  236. package/template/src/subComponents/{LayoutIconDropdown.native.tsx → LayoutIconDropdown1.native.tsx} +4 -18
  237. package/template/src/subComponents/LocalAudioMute.tsx +119 -27
  238. package/template/src/subComponents/LocalEndCall.tsx +73 -35
  239. package/template/src/subComponents/LocalSwitchCamera.tsx +19 -32
  240. package/template/src/subComponents/LocalVideoMute.tsx +117 -27
  241. package/template/src/subComponents/Logo.tsx +3 -4
  242. package/template/src/subComponents/LogoutButton.tsx +1 -1
  243. package/template/src/subComponents/NetworkQualityPill.tsx +66 -68
  244. package/template/src/subComponents/OpenInNativeButton.tsx +3 -3
  245. package/template/src/subComponents/Recording.tsx +28 -29
  246. package/template/src/subComponents/RemoteAudioMute.tsx +83 -29
  247. package/template/src/subComponents/RemoteEndCall.tsx +8 -5
  248. package/template/src/subComponents/RemoteMutePopup.tsx +193 -0
  249. package/template/src/subComponents/RemoteVideoMute.tsx +74 -21
  250. package/template/src/subComponents/RemoveMeetingPopup.tsx +109 -0
  251. package/template/src/subComponents/RemoveScreensharePopup.tsx +109 -0
  252. package/template/src/subComponents/ScreenShareNotice.tsx +83 -8
  253. package/template/src/subComponents/SelectDevice.tsx +404 -61
  254. package/template/src/subComponents/SelectDeviceSettings.backup.tsx +207 -0
  255. package/template/src/subComponents/SelectOAuth.tsx +9 -8
  256. package/template/src/subComponents/SidePanelButtons.ts +0 -3
  257. package/template/src/subComponents/SidePanelHeader.tsx +112 -0
  258. package/template/src/subComponents/ToastConfig.tsx +150 -10
  259. package/template/src/subComponents/chat/ChatParticipants.tsx +188 -79
  260. package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +97 -34
  261. package/template/src/subComponents/livestream/controls/LocalRaiseHand.tsx +29 -33
  262. package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +8 -8
  263. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +24 -11
  264. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +17 -10
  265. package/template/src/subComponents/recording/useRecording.tsx +81 -29
  266. package/template/src/subComponents/screenshare/ScreenshareButton.tsx +52 -70
  267. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +23 -12
  268. package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +44 -19
  269. package/template/src/theme/index.ts +46 -0
  270. package/template/src/utils/PlatformWrapper.tsx +21 -0
  271. package/template/src/utils/SdkEvents.ts +23 -14
  272. package/template/src/utils/SdkMethodEvents.ts +81 -0
  273. package/template/src/utils/common.tsx +155 -1
  274. package/template/src/utils/hexadecimalTransparency.ts +108 -0
  275. package/template/src/utils/index.tsx +19 -0
  276. package/template/src/utils/isMobileOrTablet.ts +7 -2
  277. package/template/src/utils/pendingStateUpdateHelper.ts +19 -0
  278. package/template/src/utils/useActiveSpeaker.ts +42 -0
  279. package/template/src/utils/{useCreateMeeting.ts → useCreateRoom.ts} +19 -14
  280. package/template/src/utils/{useButtonTemplate.tsx → useFocus.tsx} +19 -16
  281. package/template/src/utils/useGetMeetingPhrase.ts +10 -10
  282. package/template/src/utils/useIsAudioEnabled.ts +3 -3
  283. package/template/src/utils/useIsHandRaised.ts +13 -0
  284. package/template/src/utils/useIsPSTN.ts +3 -3
  285. package/template/src/utils/useIsVideoEnabled.ts +3 -3
  286. package/template/src/utils/{useJoinMeeting.ts → useJoinRoom.ts} +27 -21
  287. package/template/src/utils/useMutePSTN.ts +2 -2
  288. package/template/src/utils/useMuteToggleLocal.ts +58 -5
  289. package/template/src/utils/useRemoteEndCall.ts +4 -4
  290. package/template/src/utils/useRemoteEndScreenshare.ts +26 -0
  291. package/template/src/utils/useRemoteMute.ts +7 -7
  292. package/template/src/utils/useRemoteRequest.ts +84 -0
  293. package/template/src/utils/useSwitchCamera.native.tsx +25 -0
  294. package/template/src/utils/useSwitchCamera.tsx +19 -0
  295. package/template/src/utils/useToolbar.tsx +59 -0
  296. package/template/web/index.html +5 -0
  297. package/template/webpack.commons.js +13 -8
  298. package/template/webpack.rsdk.config.js +1 -2
  299. package/template/webpack.web.config.js +1 -0
  300. package/template/agora-rn-uikit/src/Contexts/RenderContext.tsx +0 -10
  301. package/template/src/assets/icons.ts +0 -102
  302. package/template/src/components/chat-ui/useChatUIControl.tsx +0 -69
  303. package/template/src/components/participants/MeParticipant.tsx +0 -38
  304. package/template/src/components/participants/RemoteParticipants.tsx +0 -71
  305. package/template/src/pages/video-call/CustomUserContextHolder.tsx +0 -20
@@ -1,36 +1,102 @@
1
1
  import React, {useContext} from 'react';
2
- import {View, Text} from 'react-native';
3
- import RemoteEndCall from '../../subComponents/RemoteEndCall';
4
- import ParticipantName from '../../components/participants/ParticipantName';
2
+ import {Text} from 'react-native';
5
3
  import chatContext from '../ChatContext';
6
4
  import {useString} from '../../utils/useString';
7
- import {useRender} from 'customization-api';
5
+ import {
6
+ ContentInterface,
7
+ UidType,
8
+ useRoomInfo,
9
+ useContent,
10
+ } from 'customization-api';
11
+ import Participant from './Participant';
12
+ import {useLiveStreamDataContext} from '../contexts/LiveStreamDataContext';
13
+ import {useScreenContext} from '../contexts/ScreenShareContext';
14
+ import ScreenshareParticipants from './ScreenshareParticipants';
15
+ import hexadecimalTransparency from '../../utils/hexadecimalTransparency';
8
16
 
9
17
  const AllAudienceParticipants = (props: any) => {
10
- const {p_style, isHost, uids} = props;
11
- const {renderList} = useRender();
18
+ const {screenShareData} = useScreenContext();
19
+ const {
20
+ uids,
21
+ isMobile = false,
22
+ handleClose,
23
+ updateActionSheet,
24
+ emptyMessage,
25
+ } = props;
26
+ const {defaultContent} = useContent();
12
27
  const {localUid} = useContext(chatContext);
13
28
  //commented for v1 release
14
29
  //const participantListPlaceholder = useString('participantListPlaceholder')();
15
- const participantListPlaceholder = 'No one has joined yet';
30
+ const remoteUserDefaultLabel = 'User';
31
+ const getParticipantName = (uid: UidType) => {
32
+ return defaultContent[uid]?.name || remoteUserDefaultLabel;
33
+ };
34
+ const {
35
+ data: {isHost},
36
+ } = useRoomInfo();
37
+ const {hostUids} = useLiveStreamDataContext();
38
+
39
+ const renderScreenShare = (user: ContentInterface) => {
40
+ if (screenShareData[user.screenUid]?.isActive) {
41
+ return (
42
+ <ScreenshareParticipants
43
+ user={defaultContent[user.screenUid]}
44
+ key={user.screenUid}
45
+ />
46
+ );
47
+ } else {
48
+ <></>;
49
+ }
50
+ };
51
+
16
52
  return (
17
- <View style={p_style.participantContainer}>
53
+ <>
18
54
  {uids.length == 0 ? (
19
- <Text style={p_style.infoText}>{participantListPlaceholder}</Text>
55
+ emptyMessage ? (
56
+ <Text
57
+ style={{
58
+ alignSelf: 'center',
59
+ paddingVertical: 20,
60
+ fontFamily: 'Source Sans Pro',
61
+ fontWeight: '400',
62
+ fontSize: 14,
63
+ color: $config.FONT_COLOR + hexadecimalTransparency['40%'],
64
+ }}>
65
+ {emptyMessage}
66
+ </Text>
67
+ ) : (
68
+ <></>
69
+ )
20
70
  ) : (
21
71
  <>
22
- {/* Audience should see his name first */}
72
+ {/**Audience should see his name first */}
23
73
  {uids.filter((i) => i === localUid).length ? (
24
- <View style={p_style.participantRow} key={'local' + 0}>
25
- <ParticipantName value={renderList[localUid]?.name} />
26
- {isHost && (
27
- <View style={p_style.participantActionContainer}>
28
- <View style={[p_style.actionBtnIcon]}>
29
- <RemoteEndCall uid={localUid} isHost={isHost} />
30
- </View>
31
- </View>
32
- )}
33
- </View>
74
+ <>
75
+ <Participant
76
+ isLocal={true}
77
+ name={getParticipantName(localUid)}
78
+ user={defaultContent[localUid]}
79
+ isAudienceUser={
80
+ $config.EVENT_MODE && hostUids.indexOf(localUid) !== -1
81
+ ? false
82
+ : true
83
+ }
84
+ showControls={
85
+ (defaultContent[localUid]?.type === 'rtc' && isHost) ||
86
+ (defaultContent[localUid]?.type === 'rtc' &&
87
+ $config.EVENT_MODE &&
88
+ hostUids.indexOf(localUid) !== -1)
89
+ ? true
90
+ : false
91
+ }
92
+ isHostUser={false}
93
+ key={localUid}
94
+ isMobile={isMobile}
95
+ handleClose={handleClose}
96
+ updateActionSheet={updateActionSheet}
97
+ />
98
+ {renderScreenShare(defaultContent[localUid])}
99
+ </>
34
100
  ) : (
35
101
  <></>
36
102
  )}
@@ -38,20 +104,25 @@ const AllAudienceParticipants = (props: any) => {
38
104
  {uids
39
105
  .filter((i) => i !== localUid)
40
106
  .map((uid: any, index: number) => (
41
- <View style={p_style.participantRow} key={index}>
42
- <ParticipantName value={renderList[uid]?.name} />
43
- {isHost && (
44
- <View style={p_style.participantActionContainer}>
45
- <View style={[p_style.actionBtnIcon]}>
46
- <RemoteEndCall uid={uid} isHost={isHost} />
47
- </View>
48
- </View>
49
- )}
50
- </View>
107
+ <>
108
+ <Participant
109
+ isLocal={false}
110
+ name={getParticipantName(uid)}
111
+ user={defaultContent[uid]}
112
+ showControls={defaultContent[uid]?.type === 'rtc' && isHost}
113
+ isAudienceUser={true}
114
+ isHostUser={false}
115
+ key={uid}
116
+ isMobile={isMobile}
117
+ handleClose={handleClose}
118
+ updateActionSheet={updateActionSheet}
119
+ />
120
+ {renderScreenShare(defaultContent[uid])}
121
+ </>
51
122
  ))}
52
123
  </>
53
124
  )}
54
- </View>
125
+ </>
55
126
  );
56
127
  };
57
128
 
@@ -1,53 +1,124 @@
1
1
  import React from 'react';
2
- import MeParticipant from './MeParticipant';
2
+ import {Text} from 'react-native';
3
3
  import ScreenshareParticipants from './ScreenshareParticipants';
4
- import RemoteParticipants from './RemoteParticipants';
4
+ import Participant from './Participant';
5
5
  import {useString} from '../../utils/useString';
6
- import {UidType, useLocalUid} from '../../../agora-rn-uikit';
7
- import {useRender} from 'customization-api';
6
+ import {ContentInterface, UidType, useLocalUid} from '../../../agora-rn-uikit';
7
+ import {useRoomInfo, useContent} from 'customization-api';
8
+ import Spacer from '../../atoms/Spacer';
9
+ import {useVideoMeetingData} from '../contexts/VideoMeetingDataContext';
10
+ import {useScreenContext} from '../contexts/ScreenShareContext';
11
+ import hexadecimalTransparency from '../../utils/hexadecimalTransparency';
8
12
 
9
13
  export default function AllHostParticipants(props: any) {
10
- const {p_style, isHost} = props;
11
14
  const localUid = useLocalUid();
15
+ const {screenShareData} = useScreenContext();
12
16
  //commented for v1 release
13
17
  //const remoteUserDefaultLabel = useString('remoteUserDefaultLabel')();
14
18
  const remoteUserDefaultLabel = 'User';
15
- const {renderList, activeUids} = useRender();
19
+ const {defaultContent} = useContent();
16
20
  const getParticipantName = (uid: UidType) => {
17
- return renderList[uid]?.name || remoteUserDefaultLabel;
21
+ return defaultContent[uid]?.name || remoteUserDefaultLabel;
22
+ };
23
+ const {hostUids} = useVideoMeetingData();
24
+ const {
25
+ data: {isHost},
26
+ } = useRoomInfo();
27
+ const {
28
+ isMobile = false,
29
+ handleClose,
30
+ updateActionSheet,
31
+ uids,
32
+ emptyMessage,
33
+ } = props;
34
+
35
+ const renderScreenShare = (user: ContentInterface) => {
36
+ if (screenShareData[user.screenUid]?.isActive) {
37
+ return (
38
+ <ScreenshareParticipants
39
+ user={defaultContent[user.screenUid]}
40
+ key={user.screenUid}
41
+ />
42
+ );
43
+ } else {
44
+ <></>;
45
+ }
18
46
  };
19
47
 
20
48
  return (
21
49
  <>
22
- {/* User should see his name first */}
23
- {activeUids.filter((uid) => uid === localUid).length > 0 && (
24
- <MeParticipant
25
- name={getParticipantName(localUid)}
26
- p_style={p_style}
27
- key={localUid}
28
- />
29
- )}
30
- {/* Others Users in the call */}
31
- {activeUids
32
- .filter((uid) => uid !== localUid)
33
- .map((uid) =>
34
- renderList[uid]?.type === 'screenshare' ? (
35
- <ScreenshareParticipants
36
- name={getParticipantName(uid)}
37
- p_styles={p_style}
38
- key={uid}
39
- />
50
+ {uids.length == 0 ? (
51
+ emptyMessage ? (
52
+ <Text
53
+ style={{
54
+ alignSelf: 'center',
55
+ paddingVertical: 20,
56
+ fontFamily: 'Source Sans Pro',
57
+ fontWeight: '400',
58
+ fontSize: 14,
59
+ color: $config.FONT_COLOR + hexadecimalTransparency['40%'],
60
+ }}>
61
+ {emptyMessage}
62
+ </Text>
63
+ ) : (
64
+ <></>
65
+ )
66
+ ) : (
67
+ <>
68
+ <Spacer size={4} />
69
+ {/* User should see his name first */}
70
+ {uids.filter((uid) => uid === localUid).length > 0 ? (
71
+ <>
72
+ <Participant
73
+ isLocal={true}
74
+ isAudienceUser={false}
75
+ name={getParticipantName(localUid)}
76
+ user={defaultContent[localUid]}
77
+ showControls={true}
78
+ isHostUser={hostUids.indexOf(localUid) !== -1}
79
+ key={localUid}
80
+ isMobile={isMobile}
81
+ handleClose={handleClose}
82
+ updateActionSheet={updateActionSheet}
83
+ />
84
+ {renderScreenShare(defaultContent[localUid])}
85
+ </>
40
86
  ) : (
41
- <RemoteParticipants
42
- name={getParticipantName(uid)}
43
- p_styles={p_style}
44
- user={renderList[uid]}
45
- showControls={renderList[uid]?.type === 'rtc'}
46
- isHost={isHost}
47
- key={uid}
48
- />
49
- ),
50
- )}
87
+ <></>
88
+ )}
89
+ {/* Others Users in the call */}
90
+ {uids
91
+ .filter(
92
+ (uid) => uid !== localUid && defaultContent[uid].type === 'rtc',
93
+ )
94
+ .map(
95
+ (uid) => (
96
+ // defaultContent[uid]?.type === 'screenshare' ? (
97
+ // <ScreenshareParticipants
98
+ // name={getParticipantName(uid)}
99
+ // key={uid}
100
+ // />
101
+ // ) : (
102
+ <>
103
+ <Participant
104
+ isLocal={false}
105
+ isAudienceUser={false}
106
+ name={getParticipantName(uid)}
107
+ user={defaultContent[uid]}
108
+ showControls={defaultContent[uid]?.type === 'rtc' && isHost}
109
+ isHostUser={hostUids.indexOf(uid) !== -1}
110
+ key={uid}
111
+ isMobile={isMobile}
112
+ handleClose={handleClose}
113
+ updateActionSheet={updateActionSheet}
114
+ />
115
+ {renderScreenShare(defaultContent[uid])}
116
+ </>
117
+ ),
118
+ //),
119
+ )}
120
+ </>
121
+ )}
51
122
  </>
52
123
  );
53
124
  }
@@ -0,0 +1,300 @@
1
+ /*
2
+ ********************************************
3
+ Copyright © 2021 Agora Lab, Inc., all rights reserved.
4
+ AppBuilder and all associated components, source code, APIs, services, and documentation
5
+ (the “Materials”) are owned by Agora Lab, Inc. and its licensors. The Materials may not be
6
+ accessed, used, modified, or distributed for any purpose without a license from Agora Lab, Inc.
7
+ Use without a license or in violation of any license terms and conditions (including use for
8
+ any purpose competitive to Agora Lab, Inc.’s business) is strictly prohibited. For more
9
+ information visit https://appbuilder.agora.io.
10
+ *********************************************
11
+ */
12
+ import React, {useContext, useRef, useState} from 'react';
13
+ import {View, StyleSheet, Text, TouchableOpacity} from 'react-native';
14
+ import RemoteAudioMute from '../../subComponents/RemoteAudioMute';
15
+ import RemoteVideoMute from '../../subComponents/RemoteVideoMute';
16
+ import {ClientRole, ContentInterface} from '../../../agora-rn-uikit';
17
+ import UserAvatar from '../../atoms/UserAvatar';
18
+ import {isMobileUA, isWebInternal} from '../../utils/common';
19
+ import ActionMenu, {ActionMenuItem} from '../../atoms/ActionMenu';
20
+ import Spacer from '../../atoms/Spacer';
21
+ import useRemoteEndCall from '../../utils/useRemoteEndCall';
22
+ import {useChatMessages} from '../chat-messages/useChatMessages';
23
+ import LocalVideoMute from '../../subComponents/LocalVideoMute';
24
+ import LocalAudioMute from '../../subComponents/LocalAudioMute';
25
+ import RemoveMeetingPopup from '../../subComponents/RemoveMeetingPopup';
26
+ import {useRoomInfo} from '../room-info/useRoomInfo';
27
+ import {
28
+ RaiseHandValue,
29
+ LiveStreamContext,
30
+ LiveStreamControlMessageEnum,
31
+ } from '../livestream';
32
+ import events, {PersistanceLevel} from '../../rtm-events-api';
33
+ import IconButton from '../../atoms/IconButton';
34
+ import ThemeConfig from '../../theme';
35
+ import hexadecimalTransparency from '../../utils/hexadecimalTransparency';
36
+ import useRemoteRequest, {
37
+ REQUEST_REMOTE_TYPE,
38
+ } from '../../utils/useRemoteRequest';
39
+ import useRemoteMute, {MUTE_REMOTE_TYPE} from '../../utils/useRemoteMute';
40
+ import {useLiveStreamDataContext} from '../contexts/LiveStreamDataContext';
41
+ import {
42
+ SidePanelType,
43
+ useLayout,
44
+ useContent,
45
+ useSidePanel,
46
+ } from 'customization-api';
47
+ import {getPinnedLayoutName} from '../../pages/video-call/DefaultLayouts';
48
+ import UserActionMenuOptionsOptions from './UserActionMenuOptions';
49
+ interface ParticipantInterface {
50
+ isLocal: boolean;
51
+ name: string;
52
+ user: ContentInterface;
53
+ showControls: boolean;
54
+ isHostUser: boolean;
55
+ isAudienceUser: boolean;
56
+ isMobile?: boolean;
57
+ handleClose: () => {};
58
+ updateActionSheet: (screenName: 'chat' | 'participants' | 'settings') => {};
59
+ }
60
+
61
+ const Participant = (props: ParticipantInterface) => {
62
+ const {coHostUids} = useContext(LiveStreamContext);
63
+ const [isHovered, setIsHovered] = React.useState(false);
64
+ const [actionMenuVisible, setActionMenuVisible] = React.useState(false);
65
+ const usercontainerRef = useRef(null);
66
+ const moreIconRef = useRef(null);
67
+ const {
68
+ user,
69
+ name,
70
+ showControls,
71
+ isHostUser,
72
+ isLocal,
73
+ isAudienceUser,
74
+ isMobile = false,
75
+ handleClose,
76
+ updateActionSheet,
77
+ } = props;
78
+ const {
79
+ data: {isHost},
80
+ } = useRoomInfo();
81
+
82
+ const showModal = () => {
83
+ setActionMenuVisible((state) => !state);
84
+ };
85
+ return (
86
+ <>
87
+ <UserActionMenuOptionsOptions
88
+ actionMenuVisible={actionMenuVisible}
89
+ setActionMenuVisible={setActionMenuVisible}
90
+ user={props.user}
91
+ btnRef={moreIconRef}
92
+ from={'partcipant'}
93
+ />
94
+ <PlatformWrapper showModal={showModal} setIsHovered={setIsHovered}>
95
+ <View style={styles.container} ref={usercontainerRef}>
96
+ <View style={styles.bgContainerStyle}>
97
+ <UserAvatar
98
+ name={name}
99
+ containerStyle={styles.containerStyle}
100
+ textStyle={styles.textStyle}
101
+ />
102
+ </View>
103
+ <View style={{flex: 1, marginHorizontal: 8, alignSelf: 'center'}}>
104
+ <Text style={styles.participantNameText} numberOfLines={1}>
105
+ {name}
106
+ </Text>
107
+ {isLocal && <Text style={styles.subText}>{'Me'}</Text>}
108
+ {!isLocal &&
109
+ $config.EVENT_MODE &&
110
+ coHostUids.indexOf(user.uid) !== -1 ? (
111
+ <Text style={styles.subText}>{'Presenter'}</Text>
112
+ ) : (
113
+ <></>
114
+ )}
115
+ </View>
116
+ <View style={styles.iconContainer}>
117
+ {isHovered || actionMenuVisible || isMobileUA() ? (
118
+ <View
119
+ ref={moreIconRef}
120
+ collapsable={false}
121
+ style={{
122
+ width: 24,
123
+ height: 24,
124
+ alignSelf: 'center',
125
+ justifyContent: 'center',
126
+ alignItems: 'center',
127
+ borderRadius: 20,
128
+ }}>
129
+ <IconButton
130
+ hoverEffect={true}
131
+ hoverEffectStyle={{
132
+ backgroundColor:
133
+ $config.CARD_LAYER_5_COLOR +
134
+ hexadecimalTransparency['20%'],
135
+ borderRadius: 20,
136
+ padding: 5,
137
+ }}
138
+ iconProps={{
139
+ iconType: 'plain',
140
+ name: 'more-menu',
141
+ iconSize: 20,
142
+ tintColor: $config.SECONDARY_ACTION_COLOR,
143
+ }}
144
+ onPress={() => {
145
+ showModal();
146
+ }}
147
+ />
148
+ </View>
149
+ ) : (
150
+ <Spacer size={24} horizontal={true} />
151
+ )}
152
+ {showControls ? (
153
+ <>
154
+ <Spacer horizontal={true} size={8} />
155
+ {!$config.AUDIO_ROOM &&
156
+ (isLocal
157
+ ? !isAudienceUser && (
158
+ <View>
159
+ <LocalVideoMute
160
+ plainIconHoverEffect={true}
161
+ iconProps={(isVideoEnabled, isPermissionDenied) => {
162
+ return {
163
+ iconSize: 20,
164
+ iconType: 'plain',
165
+ iconContainerStyle: {padding: 8},
166
+ showWarningIcon: false,
167
+ tintColor: isVideoEnabled
168
+ ? $config.PRIMARY_ACTION_BRAND_COLOR
169
+ : isPermissionDenied
170
+ ? $config.SEMANTIC_NEUTRAL
171
+ : $config.SEMANTIC_ERROR,
172
+ };
173
+ }}
174
+ showLabel={false}
175
+ isMobileView={isMobile}
176
+ />
177
+ </View>
178
+ )
179
+ : !isAudienceUser && (
180
+ <View>
181
+ <RemoteVideoMute
182
+ uid={user.uid}
183
+ video={user.video}
184
+ isHost={isHost}
185
+ userContainerRef={usercontainerRef}
186
+ />
187
+ </View>
188
+ ))}
189
+ {isLocal
190
+ ? !isAudienceUser && (
191
+ <View>
192
+ <LocalAudioMute
193
+ plainIconHoverEffect={true}
194
+ iconProps={(isAudioEnabled, isPermissionDenied) => {
195
+ return {
196
+ iconSize: 20,
197
+ iconType: 'plain',
198
+ iconContainerStyle: {padding: 8},
199
+ showWarningIcon: false,
200
+ tintColor: isAudioEnabled
201
+ ? $config.PRIMARY_ACTION_BRAND_COLOR
202
+ : isPermissionDenied
203
+ ? $config.SEMANTIC_NEUTRAL
204
+ : $config.SEMANTIC_ERROR,
205
+ };
206
+ }}
207
+ showLabel={false}
208
+ isMobileView={isMobile}
209
+ />
210
+ </View>
211
+ )
212
+ : !isAudienceUser && (
213
+ <View>
214
+ <RemoteAudioMute
215
+ uid={user.uid}
216
+ audio={user.audio}
217
+ isHost={isHost}
218
+ userContainerRef={usercontainerRef}
219
+ />
220
+ </View>
221
+ )}
222
+ </>
223
+ ) : (
224
+ <></>
225
+ )}
226
+ </View>
227
+ </View>
228
+ </PlatformWrapper>
229
+ </>
230
+ );
231
+ };
232
+ export default Participant;
233
+
234
+ const PlatformWrapper = ({children, showModal, setIsHovered}) => {
235
+ return isWebInternal() ? (
236
+ <div
237
+ style={{}}
238
+ onMouseEnter={() => {
239
+ setIsHovered(true);
240
+ }}
241
+ onMouseLeave={() => {
242
+ setIsHovered(false);
243
+ }}>
244
+ {children}
245
+ </div>
246
+ ) : (
247
+ <>{children}</>
248
+ );
249
+ };
250
+
251
+ const styles = StyleSheet.create({
252
+ bgContainerStyle: {
253
+ backgroundColor: $config.VIDEO_AUDIO_TILE_AVATAR_COLOR,
254
+ width: 36,
255
+ height: 36,
256
+ borderRadius: 18,
257
+ },
258
+ containerStyle: {
259
+ width: 36,
260
+ height: 36,
261
+ borderRadius: 18,
262
+ },
263
+ textStyle: {
264
+ fontSize: ThemeConfig.FontSize.tiny,
265
+ lineHeight: 12,
266
+ fontWeight: '400',
267
+ color: $config.CARD_LAYER_1_COLOR,
268
+ },
269
+ participantNameText: {
270
+ fontWeight: '400',
271
+ fontSize: ThemeConfig.FontSize.tiny,
272
+ fontFamily: ThemeConfig.FontFamily.sansPro,
273
+ flexDirection: 'row',
274
+ color: $config.FONT_COLOR,
275
+ textAlign: 'left',
276
+ },
277
+ subText: {
278
+ fontSize: ThemeConfig.FontSize.tiny,
279
+ lineHeight: ThemeConfig.FontSize.tiny,
280
+ fontFamily: ThemeConfig.FontFamily.sansPro,
281
+ fontWeight: '400',
282
+ color: $config.FONT_COLOR + ThemeConfig.EmphasisPlus.disabled,
283
+ marginTop: 4,
284
+ },
285
+ container: {
286
+ flexDirection: 'row',
287
+ justifyContent: 'space-between',
288
+ paddingHorizontal: 20,
289
+ paddingVertical: 8,
290
+ },
291
+ userInfoContainer: {
292
+ flexDirection: 'row',
293
+ },
294
+ iconContainer: {
295
+ flexDirection: 'row',
296
+ },
297
+ controlsContainer: {
298
+ backgroundColor: 'red',
299
+ },
300
+ });
@@ -10,7 +10,13 @@
10
10
  *********************************************
11
11
  */
12
12
  import React from 'react';
13
- import {View, StyleSheet, useWindowDimensions, Platform} from 'react-native';
13
+ import {
14
+ View,
15
+ StyleSheet,
16
+ useWindowDimensions,
17
+ Platform,
18
+ Text,
19
+ } from 'react-native';
14
20
  import TextWithToolTip from '../../subComponents/TextWithTooltip';
15
21
  import {RFValue} from 'react-native-responsive-fontsize';
16
22
  import {isWebInternal} from '../../utils/common';
@@ -36,13 +42,13 @@ export default ParticipantName;
36
42
 
37
43
  const style = StyleSheet.create({
38
44
  participantText: {
39
- flex: 1,
40
- fontWeight: '500',
45
+ fontWeight: '400',
46
+ fontSize: 12,
47
+ lineHeight: 15,
48
+ fontFamily: 'Source Sans Pro',
41
49
  flexDirection: 'row',
42
- color: $config.PRIMARY_FONT_COLOR,
43
- lineHeight: 20,
44
- paddingHorizontal: 5,
50
+ color: $config.FONT_COLOR,
45
51
  textAlign: 'left',
46
- flexShrink: 1,
52
+ textTransform: 'capitalize',
47
53
  },
48
54
  });