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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/Readme.md +11 -6
  2. package/package.json +1 -1
  3. package/template/Gulpfile.js +121 -83
  4. package/template/_gitignore +2 -2
  5. package/template/_package-lock.json +12959 -13248
  6. package/template/agora-rn-uikit/src/AgoraUIKit.tsx +2 -2
  7. package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +2 -0
  8. package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +3 -3
  9. package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +4 -5
  10. package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +3 -1
  11. package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +2 -2
  12. package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +1 -1
  13. package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +1 -1
  14. package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +1 -1
  15. package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +1 -1
  16. package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +4 -4
  17. package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +7 -5
  18. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +1 -1
  19. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +1 -1
  20. package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +2 -2
  21. package/template/agora-rn-uikit/src/Rtc/Create.tsx +88 -43
  22. package/template/agora-rn-uikit/src/Rtc/Join.tsx +13 -4
  23. package/template/agora-rn-uikit/src/RtcConfigure.tsx +36 -19
  24. package/template/agora-rn-uikit/src/Utils/permission.ts +17 -6
  25. package/template/babel.config.js +9 -9
  26. package/template/bridge/rtc/webNg/RtcEngine.ts +51 -26
  27. package/template/customization-api/action-library.ts +22 -0
  28. package/template/{fpe-api/context.ts → customization-api/app-state.ts} +16 -14
  29. package/template/customization-api/customEvents.ts +9 -0
  30. package/template/{fpe-api/install.ts → customization-api/customize.ts} +27 -26
  31. package/template/{fpe-api → customization-api}/index.ts +11 -6
  32. package/template/{fpe-api/components.ts → customization-api/sub-components.ts} +22 -3
  33. package/template/{fpe-api → customization-api}/typeDefinition.ts +13 -14
  34. package/template/customization-api/utils.ts +30 -0
  35. package/template/{fpe-implementation → customization-implementation}/createHook.ts +0 -0
  36. package/template/{fpe-implementation/dummyFpe.ts → customization-implementation/dummyConfig.ts} +4 -4
  37. package/template/customization-implementation/index.ts +4 -0
  38. package/template/{fpe-api/useFpe.tsx → customization-implementation/useCustomization.tsx} +12 -12
  39. package/template/{fpe.config.js → customization.config.js} +11 -11
  40. package/template/electron/main/index.js +42 -35
  41. package/template/esbuild.rsdk.go +8 -17
  42. package/template/global.d.ts +4 -3
  43. package/template/index.rsdk.tsx +13 -5
  44. package/template/index.wsdk.tsx +21 -5
  45. package/template/package.json +3 -0
  46. package/template/react-native-toast-message/src/index.js +3 -7
  47. package/template/react-native-toast-message/src/{index.wsdk.js → index.sdk.tsx} +1 -1
  48. package/template/react-native-toast-message/src/styles.sdk.ts +17 -0
  49. package/template/src/App.tsx +8 -4
  50. package/template/src/AppWrapper.tsx +8 -6
  51. package/template/src/SDKAppWrapper.tsx +28 -21
  52. package/template/src/app-state/useLocalUserInfo.ts +8 -0
  53. package/template/src/app-state/useMessages.ts +52 -0
  54. package/template/src/atoms/PrimaryButton.tsx +2 -2
  55. package/template/src/atoms/SecondaryButton.tsx +12 -4
  56. package/template/src/atoms/TextInput.tsx +2 -2
  57. package/template/src/components/Chat.tsx +22 -11
  58. package/template/src/components/ChatContext.ts +10 -27
  59. package/template/src/components/Controls.native.tsx +13 -7
  60. package/template/src/components/Controls.tsx +15 -24
  61. package/template/src/components/DeviceConfigure.tsx +4 -3
  62. package/template/src/components/EventsConfigure.tsx +54 -0
  63. package/template/src/components/GridVideo.tsx +5 -6
  64. package/template/src/components/HostControlView.tsx +13 -19
  65. package/template/src/components/Navbar.tsx +54 -41
  66. package/template/src/components/NetworkQualityContext.tsx +4 -3
  67. package/template/src/components/ParticipantsView.tsx +7 -7
  68. package/template/src/components/PinnedVideo.tsx +3 -4
  69. package/template/src/components/Precall.native.tsx +3 -3
  70. package/template/src/components/Precall.tsx +14 -10
  71. package/template/src/components/RTMConfigure.tsx +61 -219
  72. package/template/src/components/SettingsView.tsx +6 -3
  73. package/template/src/components/Share.tsx +24 -18
  74. package/template/src/components/chat-messages/useChatMessages.tsx +397 -80
  75. package/template/src/components/chat-notification/useChatNotification.tsx +2 -2
  76. package/template/src/components/chat-ui/useChatUIControl.tsx +1 -1
  77. package/template/src/components/common/Logo.tsx +3 -2
  78. package/template/src/components/contexts/LiveStreamDataContext.tsx +3 -3
  79. package/template/src/components/contexts/ScreenShareContext.tsx +3 -1
  80. package/template/src/components/contexts/VideoMeetingDataContext.tsx +85 -0
  81. package/template/src/components/contexts/WhiteboardContext.tsx +8 -8
  82. package/template/src/components/livestream/LiveStreamContext.tsx +88 -74
  83. package/template/src/components/meeting-info/useMeetingInfo.tsx +23 -19
  84. package/template/src/components/meeting-info/useSetMeetingInfo.tsx +1 -1
  85. package/template/src/components/participants/AllAudienceParticipants.tsx +2 -2
  86. package/template/src/components/participants/AllHostParticipants.tsx +4 -4
  87. package/template/src/components/participants/MeParticipant.tsx +5 -3
  88. package/template/src/components/participants/ParticipantName.tsx +2 -2
  89. package/template/src/components/participants/RemoteParticipants.tsx +9 -7
  90. package/template/src/components/precall/LocalMute.native.tsx +14 -10
  91. package/template/src/components/precall/LocalMute.tsx +7 -5
  92. package/template/src/components/precall/VideoPreview.native.tsx +6 -6
  93. package/template/src/components/precall/VideoPreview.tsx +3 -3
  94. package/template/src/components/precall/joinCallBtn.tsx +3 -3
  95. package/template/src/components/precall/meetingTitle.tsx +3 -1
  96. package/template/src/components/precall/selectDevice.tsx +2 -2
  97. package/template/src/components/precall/usePreCall.tsx +1 -1
  98. package/template/src/components/styles.ts +3 -3
  99. package/template/src/components/useShareLink.tsx +69 -29
  100. package/template/src/components/useUserPreference.tsx +16 -15
  101. package/template/src/components/useWakeLock.tsx +3 -3
  102. package/template/src/language/i18nTypes.ts +1 -1
  103. package/template/src/language/index.ts +2 -2
  104. package/template/src/language/useLanguage.tsx +2 -3
  105. package/template/src/pages/Authenticate.tsx +3 -2
  106. package/template/src/pages/Create.tsx +18 -20
  107. package/template/src/pages/Join.tsx +6 -7
  108. package/template/src/pages/VideoCall.tsx +74 -66
  109. package/template/src/pages/create/useCreate.tsx +1 -1
  110. package/template/src/pages/video-call/CustomUserContextHolder.tsx +14 -6
  111. package/template/src/pages/video-call/DefaultLayouts.ts +8 -8
  112. package/template/src/pages/video-call/{NameWithMicStatus.tsx → NameWithMicIcon.tsx} +8 -1
  113. package/template/src/pages/video-call/RenderComponent.tsx +7 -10
  114. package/template/src/pages/video-call/VideoCallScreen.tsx +31 -22
  115. package/template/src/pages/video-call/VideoComponent.tsx +13 -15
  116. package/template/src/pages/video-call/VideoRenderer.tsx +6 -6
  117. package/template/src/pages/video-call/useLayoutsData.ts +23 -0
  118. package/template/src/rtm/RTMEngine.ts +13 -0
  119. package/template/src/rtm-events/EventUtils.ts +20 -20
  120. package/template/src/rtm-events/EventsQueue.ts +9 -3
  121. package/template/src/rtm-events/constants.ts +5 -0
  122. package/template/src/rtm-events/index.tsx +1 -3
  123. package/template/src/{custom-events/CustomEvents.ts → rtm-events-api/Events.ts} +67 -61
  124. package/template/src/rtm-events-api/index.tsx +6 -0
  125. package/template/src/rtm-events-api/types.ts +22 -0
  126. package/template/src/subComponents/ChatBubble.tsx +24 -8
  127. package/template/src/subComponents/ChatContainer.tsx +24 -15
  128. package/template/src/subComponents/ChatInput.tsx +56 -42
  129. package/template/src/subComponents/LanguageSelector.tsx +2 -2
  130. package/template/src/subComponents/LayoutIconDropdown.native.tsx +5 -5
  131. package/template/src/subComponents/LayoutIconDropdown.tsx +7 -7
  132. package/template/src/subComponents/LocalAudioMute.tsx +3 -4
  133. package/template/src/subComponents/LocalEndCall.tsx +3 -6
  134. package/template/src/subComponents/LocalSwitchCamera.tsx +3 -4
  135. package/template/src/subComponents/LocalVideoMute.tsx +3 -3
  136. package/template/src/subComponents/NetworkQualityPill.tsx +8 -9
  137. package/template/src/subComponents/OpenInNativeButton.tsx +2 -3
  138. package/template/src/subComponents/RemoteAudioMute.tsx +5 -11
  139. package/template/src/subComponents/RemoteEndCall.tsx +3 -10
  140. package/template/src/subComponents/RemoteVideoMute.tsx +3 -10
  141. package/template/src/subComponents/SelectDevice.tsx +1 -1
  142. package/template/src/subComponents/SelectOAuth.tsx +3 -2
  143. package/template/src/subComponents/SidePanelButtons.ts +6 -5
  144. package/template/src/subComponents/TextWithTooltip.tsx +6 -2
  145. package/template/src/subComponents/{toastConfig.tsx → ToastConfig.tsx} +2 -2
  146. package/template/src/subComponents/chat/ChatParticipants.tsx +6 -5
  147. package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +2 -2
  148. package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +4 -3
  149. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +2 -2
  150. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +2 -4
  151. package/template/src/subComponents/livestream/index.ts +2 -2
  152. package/template/src/subComponents/recording/useRecording.tsx +44 -23
  153. package/template/src/subComponents/recording/useRecordingLayoutQuery.tsx +11 -5
  154. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +46 -34
  155. package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +97 -38
  156. package/template/src/subComponents/screenshare/useScreenshare.tsx +1 -1
  157. package/template/src/utils/SdkEvents.ts +9 -46
  158. package/template/src/utils/common.tsx +25 -9
  159. package/template/src/utils/getUniqueID.ts +5 -0
  160. package/template/src/utils/isMobileOrTablet.native.ts +2 -2
  161. package/template/src/utils/isMobileOrTablet.ts +21 -8
  162. package/template/src/utils/useButtonTemplate.tsx +1 -1
  163. package/template/src/utils/useCreateMeeting.ts +21 -10
  164. package/template/src/utils/useGetMeetingPhrase.ts +11 -8
  165. package/template/src/utils/{IsAttendeeUser.ts → useIsAttendee.ts} +3 -1
  166. package/template/src/utils/{isAudioEnabled.ts → useIsAudioEnabled.ts} +4 -4
  167. package/template/src/utils/{isHostUser.ts → useIsHost.ts} +13 -16
  168. package/template/src/utils/{isPSTNUser.ts → useIsPSTN.ts} +2 -2
  169. package/template/src/utils/{isScreenShareUser.ts → useIsScreenShare.ts} +0 -0
  170. package/template/src/utils/{isVideoEnabled.ts → useIsVideoEnabled.ts} +5 -6
  171. package/template/src/utils/useJoinMeeting.ts +8 -6
  172. package/template/src/utils/useLayout.tsx +5 -5
  173. package/template/src/utils/useMutePSTN.ts +5 -3
  174. package/template/src/utils/useMuteToggleLocal.ts +3 -4
  175. package/template/src/utils/useRemoteEndCall.ts +11 -10
  176. package/template/src/utils/useRemoteMute.ts +42 -20
  177. package/template/src/utils/useSidePanel.tsx +1 -1
  178. package/template/src/utils/useString.ts +2 -2
  179. package/template/src/utils/useUserName.ts +11 -0
  180. package/template/tsconfig_fpeApi.json +8 -9
  181. package/template/tsconfig_rsdk_index.json +8 -9
  182. package/template/tsconfig_wsdk_index.json +8 -9
  183. package/template/webpack.commons.js +9 -9
  184. package/template/webpack.rsdk.config.js +4 -2
  185. package/template/webpack.ts.config.js +6 -6
  186. package/template/webpack.wsdk.config.js +2 -1
  187. package/template/fpe-api/fpeEvents.ts +0 -9
  188. package/template/fpe-api/utils.ts +0 -61
  189. package/template/fpe-implementation/index.ts +0 -1
  190. package/template/fpe-todo.txt +0 -14
  191. package/template/src/components/RTMEvents.tsx +0 -84
  192. package/template/src/custom-events/index.tsx +0 -4
  193. package/template/src/custom-events/types.ts +0 -51
  194. package/template/src/pages/video-call/CustomLayout.ts +0 -17
  195. package/template/src/rtm-events/types.ts +0 -7
  196. package/template/src/utils/getMeetingInvite.ts +0 -53
  197. package/template/src/utils/useGroupMessages.ts +0 -24
  198. package/template/src/utils/useNavParams.ts +0 -6
  199. package/template/src/utils/useNavigateTo.ts +0 -8
  200. package/template/src/utils/usePrivateMessages.ts +0 -33
  201. package/template/src/utils/useSendControlMessage.ts +0 -51
  202. package/template/src/utils/useSendMessage.ts +0 -40
  203. package/template/src/utils/useSetUnreadMessageCount.ts +0 -43
  204. package/template/src/utils/useUnreadMessageCount.ts +0 -50
  205. package/template/src/utils/useUserList.ts +0 -26
@@ -17,7 +17,7 @@ import icons from '../assets/icons';
17
17
  import {useString} from '../utils/useString';
18
18
  import {useChatMessages} from '../components/chat-messages/useChatMessages';
19
19
  import {isValidReactComponent} from '../utils/common';
20
- import {useFpe} from 'fpe-api';
20
+ import {useCustomization} from 'customization-implementation';
21
21
  import {useChatUIControl} from '../components/chat-ui/useChatUIControl';
22
22
 
23
23
  export interface ChatSendButtonProps {
@@ -119,48 +119,62 @@ export const ChatTextInput = (props: ChatTextInputProps) => {
119
119
  /**
120
120
  * Input component for the Chat interface
121
121
  */
122
- const ChatInput = () => {
122
+ const ChatInput = (props: {
123
+ chatInput?: React.ComponentType<ChatTextInputProps>;
124
+ chatSendButton?: React.ComponentType<ChatSendButtonProps>;
125
+ }) => {
123
126
  const {primaryColor} = useContext(ColorContext);
124
- const {ChatInputComponent, ChatSendButtonComponent} = useFpe((data) => {
125
- let components: {
126
- ChatInputComponent: React.ComponentType<ChatTextInputProps>;
127
- ChatSendButtonComponent: React.ComponentType<ChatSendButtonProps>;
128
- } = {
129
- ChatInputComponent: ChatTextInput,
130
- ChatSendButtonComponent: ChatSendButton,
131
- };
132
- if (
133
- data?.components?.videoCall &&
134
- typeof data?.components?.videoCall === 'object'
135
- ) {
136
- // commented for v1 release
137
- // if (
138
- // data?.components?.videoCall?.chat &&
139
- // typeof data?.components?.videoCall?.chat === 'object'
140
- // ) {
141
- // if (
142
- // data?.components?.videoCall?.chat?.chatInput &&
143
- // typeof data?.components?.videoCall?.chat?.chatInput !== 'object' &&
144
- // isValidReactComponent(data?.components?.videoCall?.chat?.chatInput)
145
- // ) {
146
- // components.ChatInputComponent =
147
- // data?.components?.videoCall?.chat?.chatInput;
148
- // }
149
- // if (
150
- // data?.components?.videoCall?.chat?.chatSentButton &&
151
- // typeof data?.components?.videoCall?.chat?.chatSentButton !==
152
- // 'object' &&
153
- // isValidReactComponent(
154
- // data?.components?.videoCall?.chat?.chatSentButton,
155
- // )
156
- // ) {
157
- // components.ChatSendButtonComponent =
158
- // data?.components?.videoCall?.chat?.chatSentButton;
159
- // }
160
- // }
161
- }
162
- return components;
163
- });
127
+ const {ChatInputComponent, ChatSendButtonComponent} = useCustomization(
128
+ (data) => {
129
+ let components: {
130
+ ChatInputComponent: React.ComponentType<ChatTextInputProps>;
131
+ ChatSendButtonComponent: React.ComponentType<ChatSendButtonProps>;
132
+ } = {
133
+ ChatInputComponent: ChatTextInput,
134
+ ChatSendButtonComponent: ChatSendButton,
135
+ };
136
+ if (
137
+ data?.components?.videoCall &&
138
+ typeof data?.components?.videoCall === 'object'
139
+ ) {
140
+ if (
141
+ data?.components?.videoCall?.chat &&
142
+ typeof data?.components?.videoCall?.chat === 'object'
143
+ ) {
144
+ if (
145
+ data?.components?.videoCall?.chat?.chatInput &&
146
+ typeof data?.components?.videoCall?.chat?.chatInput !== 'object' &&
147
+ isValidReactComponent(data?.components?.videoCall?.chat?.chatInput)
148
+ ) {
149
+ components.ChatInputComponent =
150
+ data?.components?.videoCall?.chat?.chatInput;
151
+ }
152
+ if (
153
+ data?.components?.videoCall?.chat?.chatSendButton &&
154
+ typeof data?.components?.videoCall?.chat?.chatSendButton !==
155
+ 'object' &&
156
+ isValidReactComponent(
157
+ data?.components?.videoCall?.chat?.chatSendButton,
158
+ )
159
+ ) {
160
+ components.ChatSendButtonComponent =
161
+ data?.components?.videoCall?.chat?.chatSendButton;
162
+ }
163
+ }
164
+ } else {
165
+ if (props?.chatInput && isValidReactComponent(props.chatInput)) {
166
+ components.ChatInputComponent = props.chatInput;
167
+ }
168
+ if (
169
+ props?.chatSendButton &&
170
+ isValidReactComponent(props.chatSendButton)
171
+ ) {
172
+ components.ChatSendButtonComponent = props.chatSendButton;
173
+ }
174
+ }
175
+ return components;
176
+ },
177
+ );
164
178
 
165
179
  return (
166
180
  <View style={[style.inputView, {borderColor: primaryColor, height: 40}]}>
@@ -13,14 +13,14 @@ import React, {useContext} from 'react';
13
13
  import {Picker, StyleSheet, Text} from 'react-native';
14
14
  import ColorContext from '../components/ColorContext';
15
15
  import {useLanguage} from '../language/useLanguage';
16
- import {useFpe} from 'fpe-api';
16
+ import {useCustomization} from 'customization-implementation';
17
17
  import {useString} from '../utils/useString';
18
18
  import {DEFAULT_I18_DATA} from '../language';
19
19
 
20
20
  const LanguageSelector = () => {
21
21
  const {primaryColor} = useContext(ColorContext);
22
22
  const {languageCode, setLanguageCode} = useLanguage();
23
- const languageData = useFpe((data) => data?.i18n);
23
+ const languageData = useCustomization((data) => data?.i18n);
24
24
  //commented for v1 release
25
25
  //const languageText = useString('language')();
26
26
  const languageText = 'Language';
@@ -9,7 +9,7 @@ import {
9
9
  Dimensions,
10
10
  } from 'react-native';
11
11
  import {ImageIcon} from '../../agora-rn-uikit';
12
- import useCustomLayout from '../pages/video-call/CustomLayout';
12
+ import useLayoutsData from '../pages/video-call/useLayoutsData';
13
13
  import {useLayout} from '../utils/useLayout';
14
14
 
15
15
  const deviceHeight = Dimensions.get('screen').height;
@@ -24,15 +24,15 @@ interface LayoutIconDropdownProps {
24
24
 
25
25
  const LayoutIconDropdown = (props: LayoutIconDropdownProps) => {
26
26
  const {showDropdown, setShowDropdown} = props;
27
- const layouts = useCustomLayout();
28
- const {activeLayoutName, setActiveLayoutName} = useLayout();
27
+ const layouts = useLayoutsData();
28
+ const {currentLayout, setLayout} = useLayout();
29
29
  const selectedItemHighlighter = (isSelected: boolean) => {
30
30
  return <View style={isSelected ? style.highlighter : {}} />;
31
31
  };
32
32
  const renderDropdown = () => {
33
33
  const data = layouts.map((item, index) => {
34
34
  let onPress = () => {
35
- setActiveLayoutName(item.name);
35
+ setLayout(item.name);
36
36
  setShowDropdown(false);
37
37
  };
38
38
  let content = [];
@@ -58,7 +58,7 @@ const LayoutIconDropdown = (props: LayoutIconDropdownProps) => {
58
58
  key={'dropdownLayoutIcon' + index}>
59
59
  <>
60
60
  <View style={style.highlighterContainer}>
61
- {selectedItemHighlighter(item.name === activeLayoutName)}
61
+ {selectedItemHighlighter(item.name === currentLayout)}
62
62
  </View>
63
63
  <View style={{flex: 1}}>{BtnTemplateLocal}</View>
64
64
  <View style={style.layoutNameContainer}>
@@ -7,9 +7,9 @@ import {
7
7
  TouchableWithoutFeedback,
8
8
  Modal,
9
9
  } from 'react-native';
10
- import {isWeb} from '../utils/common';
10
+ import {isWebInternal} from '../utils/common';
11
11
  import {ImageIcon} from '../../agora-rn-uikit';
12
- import useCustomLayout from '../pages/video-call/CustomLayout';
12
+ import useLayoutsData from '../pages/video-call/useLayoutsData';
13
13
  import {useLayout} from '../utils/useLayout';
14
14
  import DimensionContext from '../components/dimension/DimensionContext';
15
15
 
@@ -33,10 +33,10 @@ const LayoutIconDropdown = (props: LayoutIconDropdownProps) => {
33
33
  const {getDimensionData} = useContext(DimensionContext);
34
34
  const {isDesktop, dim} = getDimensionData();
35
35
 
36
- const layouts = useCustomLayout();
37
- const {activeLayoutName, setActiveLayoutName} = useLayout();
36
+ const layouts = useLayoutsData();
37
+ const {currentLayout, setLayout} = useLayout();
38
38
  const renderSeparatorHorizontal = () => {
39
- return isWeb && isDesktop ? (
39
+ return isWebInternal() && isDesktop ? (
40
40
  <View style={style.navItem}>
41
41
  <View style={style.navItemSeparatorHorizontal}></View>
42
42
  </View>
@@ -50,7 +50,7 @@ const LayoutIconDropdown = (props: LayoutIconDropdownProps) => {
50
50
  const renderDropdown = () => {
51
51
  const data = layouts.map((item, index) => {
52
52
  let onPress = () => {
53
- setActiveLayoutName(item.name);
53
+ setLayout(item.name);
54
54
  setShowDropdown(false);
55
55
  };
56
56
  let content = [];
@@ -76,7 +76,7 @@ const LayoutIconDropdown = (props: LayoutIconDropdownProps) => {
76
76
  onPress={onPress}>
77
77
  <>
78
78
  <View style={style.highlighterContainer}>
79
- {selectedItemHighlighter(item.name === activeLayoutName)}
79
+ {selectedItemHighlighter(item.name === currentLayout)}
80
80
  </View>
81
81
  <View style={{flex: 1}}>{BtnTemplateLocal}</View>
82
82
  <View style={style.layoutNameContainer}>
@@ -9,11 +9,10 @@
9
9
  information visit https://appbuilder.agora.io.
10
10
  *********************************************
11
11
  */
12
- import React, {useContext} from 'react';
12
+ import React from 'react';
13
13
  import {
14
14
  BtnTemplate,
15
15
  ToggleState,
16
- LocalContext,
17
16
  BtnTemplateInterface,
18
17
  } from '../../agora-rn-uikit';
19
18
  import useMuteToggleLocal, {MUTE_LOCAL_TYPE} from '../utils/useMuteToggleLocal';
@@ -23,7 +22,7 @@ import {
23
22
  useButtonTemplate,
24
23
  } from '../utils/useButtonTemplate';
25
24
  import {useString} from '../utils/useString';
26
-
25
+ import {useLocalUserInfo} from 'customization-api';
27
26
  /**
28
27
  * A component to mute / unmute the local audio
29
28
  */
@@ -37,7 +36,7 @@ export interface LocalAudioMuteProps {
37
36
  }
38
37
 
39
38
  function LocalAudioMute(props: LocalAudioMuteProps) {
40
- const local = useContext(LocalContext);
39
+ const local = useLocalUserInfo();
41
40
  const localMute = useMuteToggleLocal();
42
41
  //commented for v1 release
43
42
  //const audioLabel = useString('toggleAudioButton')();
@@ -3,13 +3,10 @@ import {
3
3
  ButtonTemplateName,
4
4
  useButtonTemplate,
5
5
  } from '../utils/useButtonTemplate';
6
- import {
7
- BtnTemplate,
8
- BtnTemplateInterface,
9
- RtcContext,
10
- } from '../../agora-rn-uikit';
6
+ import {BtnTemplate, BtnTemplateInterface} from '../../agora-rn-uikit';
11
7
  import Styles from '../components/styles';
12
8
  import {useString} from '../utils/useString';
9
+ import {useRtc} from 'customization-api';
13
10
 
14
11
  export interface LocalEndcallProps {
15
12
  buttonTemplateName?: ButtonTemplateName;
@@ -20,7 +17,7 @@ export interface LocalEndcallProps {
20
17
  }
21
18
 
22
19
  const LocalEndcall = (props: LocalEndcallProps) => {
23
- const {dispatch} = useContext(RtcContext);
20
+ const {dispatch} = useRtc();
24
21
  //commented for v1 release
25
22
  //const endCallLabel = useString('endCallButton')();
26
23
  const endCallLabel = 'Hang Up';
@@ -6,13 +6,12 @@ import {
6
6
  import {useString} from '../utils/useString';
7
7
  import {
8
8
  BtnTemplate,
9
- RtcContext,
10
9
  PropsContext,
11
- LocalContext,
12
10
  ToggleState,
13
11
  BtnTemplateInterface,
14
12
  } from '../../agora-rn-uikit';
15
13
  import Styles from '../components/styles';
14
+ import {useLocalUserInfo, useRtc} from 'customization-api';
16
15
 
17
16
  export interface LocalSwitchCameraProps {
18
17
  buttonTemplateName?: ButtonTemplateName;
@@ -25,8 +24,8 @@ export interface LocalSwitchCameraProps {
25
24
 
26
25
  function LocalSwitchCamera(props: LocalSwitchCameraProps) {
27
26
  const {callbacks} = useContext(PropsContext);
28
- const {RtcEngine} = useContext(RtcContext);
29
- const local = useContext(LocalContext);
27
+ const {RtcEngine} = useRtc();
28
+ const local = useLocalUserInfo();
30
29
  //commented for v1 release
31
30
  //const switchCameraButtonText = useString('switchCameraButton')();
32
31
  const switchCameraButtonText = 'Switch';
@@ -9,11 +9,10 @@
9
9
  information visit https://appbuilder.agora.io.
10
10
  *********************************************
11
11
  */
12
- import React, {useContext} from 'react';
12
+ import React from 'react';
13
13
  import {
14
14
  BtnTemplate,
15
15
  ToggleState,
16
- LocalContext,
17
16
  BtnTemplateInterface,
18
17
  } from '../../agora-rn-uikit';
19
18
  import useMuteToggleLocal, {MUTE_LOCAL_TYPE} from '../utils/useMuteToggleLocal';
@@ -23,6 +22,7 @@ import {
23
22
  useButtonTemplate,
24
23
  } from '../utils/useButtonTemplate';
25
24
  import {useString} from '../utils/useString';
25
+ import {useLocalUserInfo} from 'customization-api';
26
26
 
27
27
  /**
28
28
  * A component to mute / unmute the local video
@@ -37,7 +37,7 @@ export interface LocalVideoMuteProps {
37
37
  }
38
38
 
39
39
  function LocalVideoMute(props: LocalVideoMuteProps) {
40
- const local = useContext(LocalContext);
40
+ const local = useLocalUserInfo();
41
41
  const localMute = useMuteToggleLocal();
42
42
  //commented for v1 release
43
43
  //const videoLabel = useString('toggleVideoButton')();
@@ -13,7 +13,7 @@ import {
13
13
  import {useString} from '../utils/useString';
14
14
  import {networkIconsObject} from '../components/NetworkQualityContext';
15
15
  import {NetworkQualities} from 'src/language/default-labels/videoCallScreenLabels';
16
- import {isWeb} from '../utils/common';
16
+ import {isWebInternal} from '../utils/common';
17
17
  import NetworkQualityContext from '../components/NetworkQualityContext';
18
18
  import {RenderInterface, UidType} from '../../agora-rn-uikit';
19
19
 
@@ -27,17 +27,14 @@ import {RenderInterface, UidType} from '../../agora-rn-uikit';
27
27
  * hover to show network quality text [ ex. Excellent, Good, Bad etc ]
28
28
  *
29
29
  */
30
- export const NetworkQualityPill = ({
31
- user,
32
- primaryColor,
33
- small,
34
- rootStyle,
35
- }: {
30
+ interface NetworkQualityPillProps {
36
31
  user: RenderInterface;
37
32
  primaryColor: any;
38
33
  small?: boolean;
39
34
  rootStyle?: StyleProp<ViewStyle>;
40
- }) => {
35
+ }
36
+ const NetworkQualityPill = (props: NetworkQualityPillProps) => {
37
+ const {user, primaryColor, small, rootStyle} = props;
41
38
  const [networkTextVisible, setNetworkTextVisible] = useState(false);
42
39
  //commented for v1 release
43
40
  //const getLabel = useString<NetworkQualities>('networkQualityLabel');
@@ -115,7 +112,7 @@ const PlatformSpecificWrapper = ({
115
112
  setNetworkTextVisible,
116
113
  children,
117
114
  }: any) => {
118
- return !isWeb ? (
115
+ return !isWebInternal() ? (
119
116
  <Pressable
120
117
  style={{
121
118
  height: '100%',
@@ -189,3 +186,5 @@ const style = StyleSheet.create({
189
186
  justifyContent: 'center',
190
187
  },
191
188
  });
189
+
190
+ export default NetworkQualityPill;
@@ -11,7 +11,7 @@
11
11
  */
12
12
  import React, {useContext} from 'react';
13
13
  import {View, TouchableOpacity, Text, StyleSheet} from 'react-native';
14
- import {isWeb} from '../utils/common';
14
+ import {isWebInternal} from '../utils/common';
15
15
  import ColorContext from '../components/ColorContext';
16
16
 
17
17
  /**
@@ -22,8 +22,7 @@ import ColorContext from '../components/ColorContext';
22
22
  const OpenInNativeButton = () => {
23
23
  const {primaryColor} = useContext(ColorContext);
24
24
  const openInNative = () => {};
25
-
26
- return isWeb ? (
25
+ return isWebInternal() ? (
27
26
  <View style={{position: 'absolute', right: 0}}>
28
27
  <TouchableOpacity
29
28
  style={[style.btn, {borderColor: primaryColor}]}
@@ -11,13 +11,10 @@
11
11
  */
12
12
  import React from 'react';
13
13
  import {StyleSheet} from 'react-native';
14
- import {controlMessageEnum} from '../components/ChatContext';
15
14
  import {BtnTemplate, UidType} from '../../agora-rn-uikit';
16
- import useIsPSTN from '../utils/isPSTNUser';
15
+ import useIsPSTN from '../utils/useIsPSTN';
17
16
  import useMutePSTN from '../utils/useMutePSTN';
18
- import useSendControlMessage, {
19
- CONTROL_MESSAGE_TYPE,
20
- } from '../utils/useSendControlMessage';
17
+ import useRemoteMute, {MUTE_REMOTE_TYPE} from '../utils/useRemoteMute';
21
18
 
22
19
  export interface RemoteAudioMuteProps {
23
20
  uid: UidType;
@@ -31,7 +28,8 @@ export interface RemoteAudioMuteProps {
31
28
  */
32
29
  const RemoteAudioMute = (props: RemoteAudioMuteProps) => {
33
30
  const {isHost = false} = props;
34
- const sendCtrlMsgToUid = useSendControlMessage();
31
+ const muteRemoteAudio = useRemoteMute();
32
+
35
33
  const isPSTN = useIsPSTN();
36
34
  const mutePSTN = useMutePSTN();
37
35
  return (
@@ -45,11 +43,7 @@ const RemoteAudioMute = (props: RemoteAudioMuteProps) => {
45
43
  console.error('An error occurred while muting the PSTN user.');
46
44
  }
47
45
  } else {
48
- sendCtrlMsgToUid(
49
- CONTROL_MESSAGE_TYPE.controlMessageToUid,
50
- controlMessageEnum.muteAudio,
51
- props.uid,
52
- );
46
+ muteRemoteAudio(MUTE_REMOTE_TYPE.audio, props.uid);
53
47
  }
54
48
  }}
55
49
  style={style.buttonIconMic}
@@ -11,27 +11,20 @@
11
11
  */
12
12
  import React from 'react';
13
13
  import {StyleSheet} from 'react-native';
14
- import {controlMessageEnum} from '../components/ChatContext';
15
14
  import {BtnTemplate, UidType} from '../../agora-rn-uikit';
16
- import useSendControlMessage, {
17
- CONTROL_MESSAGE_TYPE,
18
- } from '../utils/useSendControlMessage';
15
+ import useRemoteEndCall from '../utils/useRemoteEndCall';
19
16
 
20
17
  export interface RemoteEndCallProps {
21
18
  uid: UidType;
22
19
  isHost: boolean;
23
20
  }
24
21
  const RemoteEndCall = (props: RemoteEndCallProps) => {
25
- const sendCtrlMsgToUid = useSendControlMessage();
22
+ const endRemoteCall = useRemoteEndCall();
26
23
  return props.isHost && String(props.uid)[0] !== '1' ? (
27
24
  <BtnTemplate
28
25
  style={style.remoteButton}
29
26
  onPress={() => {
30
- sendCtrlMsgToUid(
31
- CONTROL_MESSAGE_TYPE.controlMessageToUid,
32
- controlMessageEnum.kickUser,
33
- props.uid,
34
- );
27
+ endRemoteCall(props.uid);
35
28
  }}
36
29
  color="#FD0845"
37
30
  name={'remoteEndCall'} // earlier was endCall, added remoteEndCall
@@ -11,11 +11,8 @@
11
11
  */
12
12
  import React from 'react';
13
13
  import {StyleSheet} from 'react-native';
14
- import {controlMessageEnum} from '../components/ChatContext';
15
14
  import {BtnTemplate, UidType} from '../../agora-rn-uikit';
16
- import useSendControlMessage, {
17
- CONTROL_MESSAGE_TYPE,
18
- } from '../utils/useSendControlMessage';
15
+ import useRemoteMute, {MUTE_REMOTE_TYPE} from '../utils/useRemoteMute';
19
16
 
20
17
  /**
21
18
  * Component to mute / unmute remote video.
@@ -29,17 +26,13 @@ export interface RemoteVideoMuteProps {
29
26
  }
30
27
  const RemoteVideoMute = (props: RemoteVideoMuteProps) => {
31
28
  const {isHost = false} = props;
32
- const sendCtrlMsgToUid = useSendControlMessage();
29
+ const muteRemoteVideo = useRemoteMute();
33
30
 
34
31
  return String(props.uid)[0] !== '1' ? (
35
32
  <BtnTemplate
36
33
  disabled={!isHost}
37
34
  onPress={() => {
38
- sendCtrlMsgToUid(
39
- CONTROL_MESSAGE_TYPE.controlMessageToUid,
40
- controlMessageEnum.muteVideo,
41
- props.uid,
42
- );
35
+ muteRemoteVideo(MUTE_REMOTE_TYPE.video, props.uid);
43
36
  }}
44
37
  style={style.buttonIconCam}
45
38
  name={props.video ? 'videocam' : 'videocamOff'}
@@ -117,7 +117,7 @@ const SelectDevice = () => {
117
117
  <View>
118
118
  <View style={{marginTop: 15}}></View>
119
119
  <View>
120
- <SelectVideoDevice />
120
+ {!$config.AUDIO_ROOM && <SelectVideoDevice />}
121
121
  <SelectAudioDevice />
122
122
  </View>
123
123
  <View style={{marginTop: 15}}></View>
@@ -21,10 +21,11 @@ import slack from '../assets/slack.png';
21
21
  // @ts-ignore
22
22
  import microsoft from '../assets/microsoft.png';
23
23
  import Logo from './Logo';
24
- import {hasBrandLogo} from '../utils/common';
24
+ import {useHasBrandLogo} from '../utils/common';
25
25
  import {useString} from '../utils/useString';
26
26
 
27
27
  const SelectOAuth = ({onSelectOAuth}) => {
28
+ const hasBrandLogo = useHasBrandLogo();
28
29
  // Linking.openURL(url);
29
30
  const {primaryColor} = useContext(ColorContext);
30
31
  //commented for v1 release
@@ -40,7 +41,7 @@ const SelectOAuth = ({onSelectOAuth}) => {
40
41
  const appleAuthButton = 'Apple';
41
42
  return (
42
43
  <View style={style.main}>
43
- <View style={style.nav}>{hasBrandLogo && <Logo />}</View>
44
+ <View style={style.nav}>{hasBrandLogo() && <Logo />}</View>
44
45
  <View style={style.content}>
45
46
  <View style={style.leftContent}>
46
47
  <Text style={style.heading}>{$config.APP_NAME}</Text>
@@ -4,7 +4,7 @@ import {
4
4
  RemoteLiveStreamRequestApprove,
5
5
  RemoteLiveStreamRequestReject,
6
6
  RemoteLiveStreamApprovedRequestRecallProps,
7
- RemoteLiveStreamControlInterface,
7
+ RemoteLiveStreamControlProps,
8
8
  } from './livestream';
9
9
  import RemoteAudioMute, {RemoteAudioMuteProps} from './RemoteAudioMute';
10
10
  import RemoteVideoMute, {RemoteVideoMuteProps} from './RemoteVideoMute';
@@ -16,17 +16,18 @@ import {
16
16
  MuteAllVideoButtonProps,
17
17
  } from '../components/HostControlView';
18
18
 
19
- export const SidePanelButtonsArray: [
19
+ type SidePanelButtonsArrayProps = [
20
20
  (props: RemoteAudioMuteProps) => JSX.Element,
21
21
  (props: RemoteVideoMuteProps) => JSX.Element,
22
22
  (props: RemoteEndCallProps) => JSX.Element,
23
23
  (props: RemoteLiveStreamApprovedRequestRecallProps) => JSX.Element,
24
- (props: RemoteLiveStreamControlInterface) => JSX.Element,
25
- (props: RemoteLiveStreamControlInterface) => JSX.Element,
24
+ (props: RemoteLiveStreamControlProps) => JSX.Element,
25
+ (props: RemoteLiveStreamControlProps) => JSX.Element,
26
26
  (props: ChatSendButtonProps) => JSX.Element,
27
27
  (props: MuteAllAudioButtonProps) => JSX.Element,
28
28
  (props: MuteAllVideoButtonProps) => JSX.Element,
29
- ] = [
29
+ ];
30
+ export const SidePanelButtonsArray: SidePanelButtonsArrayProps = [
30
31
  RemoteAudioMute,
31
32
  RemoteVideoMute,
32
33
  RemoteEndCall,
@@ -11,13 +11,17 @@
11
11
  */
12
12
  import React from 'react';
13
13
  import {Text} from 'react-native';
14
- import isMobileOrTablet from '../utils/isMobileOrTablet';
15
14
  import TextWithToolTipNative from './TextWithTooltip.native';
15
+ import isMobileOrTablet from '../utils/isMobileOrTablet';
16
16
  /**
17
17
  * Text with tooltip
18
18
  * web - used title attribute to show the tooltip
19
19
  */
20
- const TextWithToolTip = (props: {touchable?: boolean;value: string; style: object}) => {
20
+ const TextWithToolTip = (props: {
21
+ touchable?: boolean;
22
+ value: string;
23
+ style: object;
24
+ }) => {
21
25
  return (
22
26
  <div style={style.containerStyle} title={props.value}>
23
27
  <Text numberOfLines={1} textBreakStrategy="simple" style={[props.style]}>
@@ -15,7 +15,7 @@ import {Platform} from 'react-native';
15
15
  import Toast, {BaseToast} from '../../react-native-toast-message';
16
16
  import isMobileOrTablet from '../utils/isMobileOrTablet';
17
17
 
18
- const toastConfig = {
18
+ const ToastConfig = {
19
19
  /*
20
20
  overwrite 'success' type,
21
21
  modifying the existing `BaseToast` component
@@ -42,4 +42,4 @@ const toastConfig = {
42
42
  ),
43
43
  };
44
44
 
45
- export default toastConfig;
45
+ export default ToastConfig;
@@ -10,10 +10,10 @@ import {
10
10
  import {RFValue} from 'react-native-responsive-fontsize';
11
11
  import TextWithTooltip from '../TextWithTooltip';
12
12
  import {useString} from '../../utils/useString';
13
- import {isIOS, isWeb} from '../../utils/common';
13
+ import {isIOS, isWebInternal} from '../../utils/common';
14
14
  import {useChatNotification} from '../../components/chat-notification/useChatNotification';
15
- import useUserList from '../../utils/useUserList';
16
15
  import {UidType, useLocalUid} from '../../../agora-rn-uikit';
16
+ import {useRender} from 'customization-api';
17
17
 
18
18
  const ChatParticipants = (props: any) => {
19
19
  //commented for v1 release
@@ -21,7 +21,7 @@ const ChatParticipants = (props: any) => {
21
21
  const remoteUserDefaultLabel = 'User';
22
22
  const {selectUser} = props;
23
23
  const {height, width} = useWindowDimensions();
24
- const {renderList} = useUserList();
24
+ const {renderList} = useRender();
25
25
  const localUid = useLocalUid();
26
26
  const {unreadIndividualMessageCount} = useChatNotification();
27
27
  const isChatUser = (userId: UidType, userInfo: any) => {
@@ -95,7 +95,7 @@ const style = StyleSheet.create({
95
95
  },
96
96
  participantText: {
97
97
  flex: 1,
98
- fontWeight: isWeb ? '500' : '700',
98
+ fontWeight: isWebInternal() ? '500' : '700',
99
99
  flexDirection: 'row',
100
100
  color: $config.PRIMARY_FONT_COLOR,
101
101
  textAlign: 'left',
@@ -110,11 +110,12 @@ const style = StyleSheet.create({
110
110
  justifyContent: 'center',
111
111
  backgroundColor: $config.PRIMARY_COLOR,
112
112
  color: $config.SECONDARY_FONT_COLOR,
113
- fontFamily: isIOS ? 'Helvetica' : 'sans-serif',
113
+ fontFamily: isIOS() ? 'Helvetica' : 'sans-serif',
114
114
  borderRadius: 10,
115
115
  position: 'absolute',
116
116
  right: 20,
117
117
  top: 0,
118
118
  },
119
119
  });
120
+
120
121
  export default ChatParticipants;