agora-appbuilder-core 3.0.10 → 3.0.12

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 (249) hide show
  1. package/Readme.md +0 -6
  2. package/package.json +2 -2
  3. package/template/_package-lock.json +4979 -7086
  4. package/template/agora-rn-uikit/src/Contexts/LocalUserContext.tsx +0 -4
  5. package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +0 -18
  6. package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +0 -2
  7. package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +26 -30
  8. package/template/agora-rn-uikit/src/Controls/Icons.ts +83 -30
  9. package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +6 -6
  10. package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +0 -1
  11. package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +0 -1
  12. package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +0 -1
  13. package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +0 -1
  14. package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +0 -1
  15. package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +0 -2
  16. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +0 -1
  17. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +0 -1
  18. package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +0 -1
  19. package/template/agora-rn-uikit/src/Reducer/index.ts +0 -3
  20. package/template/agora-rn-uikit/src/Rtc/Create.tsx +1 -89
  21. package/template/agora-rn-uikit/src/RtcConfigure.tsx +2 -39
  22. package/template/agora-rn-uikit/src/Views/MaxVideoView.native.tsx +5 -15
  23. package/template/agora-rn-uikit/src/Views/MaxVideoView.tsx +9 -15
  24. package/template/agora-rn-uikit/src/index.ts +1 -3
  25. package/template/android/app/build.gradle +0 -1
  26. package/template/android/app/src/main/AndroidManifest.xml +15 -22
  27. package/template/android/app/src/main/java/com/helloworld/MainActivity.java +0 -50
  28. package/template/android/build.gradle +3 -3
  29. package/template/babel.config.js +0 -1
  30. package/template/bridge/rtc/webNg/RtcEngine.ts +17 -110
  31. package/template/customization-api/sub-components.ts +1 -1
  32. package/template/customization-api/typeDefinition.ts +1 -2
  33. package/template/electron/index.html +27 -27
  34. package/template/electron/renderer/index.js +0 -1
  35. package/template/global.d.ts +4 -26
  36. package/template/index.js +0 -4
  37. package/template/index.rsdk.tsx +0 -1
  38. package/template/index.web.js +1 -7
  39. package/template/index.wsdk.tsx +1 -1
  40. package/template/ios/HelloWorld/Info.plist +1 -14
  41. package/template/ios/HelloWorld.xcodeproj/project.pbxproj +0 -17
  42. package/template/metro.config.js +1 -1
  43. package/template/package.json +7 -21
  44. package/template/react-native-toast-message/index.d.ts +43 -43
  45. package/template/react-native-toast-message/src/colors/index.js +2 -3
  46. package/template/react-native-toast-message/src/components/base/index.js +59 -46
  47. package/template/react-native-toast-message/src/components/base/styles.js +32 -16
  48. package/template/react-native-toast-message/src/components/error.js +2 -3
  49. package/template/react-native-toast-message/src/components/info.js +2 -3
  50. package/template/react-native-toast-message/src/components/success.js +2 -3
  51. package/template/react-native-toast-message/src/index.js +31 -122
  52. package/template/react-native-toast-message/src/index.sdk.tsx +35 -125
  53. package/template/react-native-toast-message/src/styles.js +4 -3
  54. package/template/react-native-toast-message/src/styles.sdk.ts +4 -3
  55. package/template/src/App.tsx +0 -6
  56. package/template/src/AppWrapper.tsx +28 -63
  57. package/template/src/assets/icons.ts +102 -0
  58. package/template/src/atoms/HorizontalRule.tsx +1 -3
  59. package/template/src/atoms/PrimaryButton.tsx +26 -51
  60. package/template/src/atoms/SecondaryButton.tsx +5 -8
  61. package/template/src/atoms/TextInput.tsx +14 -12
  62. package/template/src/components/Chat.tsx +214 -86
  63. package/template/src/components/ChatContext.ts +1 -8
  64. package/template/src/components/ColorConfigure.tsx +1 -1
  65. package/template/src/components/ColorContext.ts +1 -1
  66. package/template/src/components/{Controls1.native.tsx → Controls.native.tsx} +4 -6
  67. package/template/src/components/Controls.tsx +42 -342
  68. package/template/src/components/DeviceConfigure.tsx +101 -461
  69. package/template/src/components/DeviceContext.tsx +4 -8
  70. package/template/src/components/EventsConfigure.tsx +7 -144
  71. package/template/src/components/GraphQLProvider.tsx +1 -1
  72. package/template/src/components/GridVideo.tsx +44 -59
  73. package/template/src/components/HostControlView.tsx +35 -114
  74. package/template/src/components/Navbar.tsx +398 -216
  75. package/template/src/components/NetworkQualityContext.tsx +20 -20
  76. package/template/src/components/ParticipantsView.tsx +154 -177
  77. package/template/src/components/PinnedVideo.tsx +120 -207
  78. package/template/src/components/Precall.native.tsx +119 -358
  79. package/template/src/components/Precall.tsx +135 -269
  80. package/template/src/components/RTMConfigure.tsx +4 -27
  81. package/template/src/components/Router.electron.ts +0 -1
  82. package/template/src/components/Router.native.ts +0 -1
  83. package/template/src/components/Router.sdk.ts +0 -1
  84. package/template/src/components/Router.ts +0 -1
  85. package/template/src/components/Settings.tsx +95 -26
  86. package/template/src/components/SettingsView.tsx +56 -251
  87. package/template/src/components/Share.tsx +273 -302
  88. package/template/src/components/StorageContext.tsx +3 -30
  89. package/template/src/components/chat-messages/useChatMessages.tsx +23 -69
  90. package/template/src/components/chat-ui/useChatUIControl.tsx +0 -7
  91. package/template/src/components/common/Error.tsx +6 -20
  92. package/template/src/components/common/Logo.tsx +15 -16
  93. package/template/src/components/contexts/LiveStreamDataContext.tsx +5 -10
  94. package/template/src/components/contexts/VideoMeetingDataContext.tsx +7 -37
  95. package/template/src/components/livestream/LiveStreamContext.tsx +36 -270
  96. package/template/src/components/livestream/Types.ts +14 -39
  97. package/template/src/components/livestream/index.ts +0 -1
  98. package/template/src/components/livestream/views/LiveStreamControls.tsx +4 -12
  99. package/template/src/components/participants/AllAudienceParticipants.tsx +30 -101
  100. package/template/src/components/participants/AllHostParticipants.tsx +34 -103
  101. package/template/src/components/participants/MeParticipant.tsx +38 -0
  102. package/template/src/components/participants/ParticipantName.tsx +7 -13
  103. package/template/src/components/participants/ParticipantSectionTitle.tsx +10 -35
  104. package/template/src/components/participants/RemoteParticipants.tsx +71 -0
  105. package/template/src/components/participants/ScreenshareParticipants.tsx +12 -144
  106. package/template/src/components/precall/{LocalMute1.native.tsx → LocalMute.native.tsx} +5 -21
  107. package/template/src/components/precall/LocalMute.tsx +14 -84
  108. package/template/src/components/precall/VideoPreview.native.tsx +3 -48
  109. package/template/src/components/precall/VideoPreview.tsx +7 -163
  110. package/template/src/components/precall/joinCallBtn.tsx +2 -15
  111. package/template/src/components/precall/meetingTitle.tsx +12 -15
  112. package/template/src/components/precall/selectDevice.tsx +21 -1
  113. package/template/src/components/precall/textInput.tsx +4 -32
  114. package/template/src/components/precall/usePreCall.tsx +0 -16
  115. package/template/src/components/styles.ts +21 -42
  116. package/template/src/components/useShareLink.tsx +14 -12
  117. package/template/src/language/default-labels/precallScreenLabels.ts +3 -3
  118. package/template/src/pages/Authenticate.tsx +15 -5
  119. package/template/src/pages/Create.tsx +165 -293
  120. package/template/src/pages/Join.tsx +67 -93
  121. package/template/src/pages/VideoCall.tsx +64 -89
  122. package/template/src/pages/video-call/DefaultLayouts.ts +4 -4
  123. package/template/src/pages/video-call/NameWithMicIcon.tsx +44 -120
  124. package/template/src/pages/video-call/RenderComponent.tsx +2 -3
  125. package/template/src/pages/video-call/VideoCallScreen.tsx +9 -45
  126. package/template/src/pages/video-call/VideoComponent.tsx +3 -18
  127. package/template/src/pages/video-call/VideoRenderer.tsx +60 -218
  128. package/template/src/rtm-events/constants.ts +0 -2
  129. package/template/src/subComponents/ChatBubble.tsx +83 -123
  130. package/template/src/subComponents/ChatContainer.tsx +84 -257
  131. package/template/src/subComponents/ChatInput.tsx +46 -61
  132. package/template/src/subComponents/Checkbox.native.tsx +5 -16
  133. package/template/src/subComponents/Checkbox.tsx +2 -2
  134. package/template/src/subComponents/CopyJoinInfo.tsx +58 -36
  135. package/template/src/subComponents/FallbackLogo.tsx +40 -122
  136. package/template/src/subComponents/LanguageSelector.tsx +1 -1
  137. package/template/src/subComponents/{LayoutIconDropdown1.native.tsx → LayoutIconDropdown.native.tsx} +18 -4
  138. package/template/src/subComponents/LayoutIconDropdown.tsx +134 -131
  139. package/template/src/subComponents/LocalAudioMute.tsx +27 -119
  140. package/template/src/subComponents/LocalEndCall.tsx +33 -71
  141. package/template/src/subComponents/LocalSwitchCamera.tsx +30 -17
  142. package/template/src/subComponents/LocalVideoMute.tsx +27 -117
  143. package/template/src/subComponents/Logo.tsx +4 -3
  144. package/template/src/subComponents/LogoutButton.tsx +1 -1
  145. package/template/src/subComponents/NetworkQualityPill.tsx +63 -60
  146. package/template/src/subComponents/OpenInNativeButton.tsx +3 -3
  147. package/template/src/subComponents/Recording.tsx +29 -28
  148. package/template/src/subComponents/RemoteAudioMute.tsx +29 -83
  149. package/template/src/subComponents/RemoteEndCall.tsx +5 -8
  150. package/template/src/subComponents/RemoteVideoMute.tsx +21 -74
  151. package/template/src/subComponents/ScreenShareNotice.tsx +8 -83
  152. package/template/src/subComponents/SelectDevice.tsx +61 -404
  153. package/template/src/subComponents/SelectOAuth.tsx +8 -9
  154. package/template/src/subComponents/ToastConfig.tsx +10 -150
  155. package/template/src/subComponents/chat/ChatParticipants.tsx +78 -187
  156. package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +32 -95
  157. package/template/src/subComponents/livestream/controls/LocalRaiseHand.tsx +33 -29
  158. package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +6 -6
  159. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +11 -24
  160. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +10 -17
  161. package/template/src/subComponents/recording/useRecording.tsx +27 -79
  162. package/template/src/subComponents/screenshare/ScreenshareButton.tsx +70 -52
  163. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +2 -11
  164. package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +4 -26
  165. package/template/src/utils/common.tsx +1 -155
  166. package/template/src/utils/index.tsx +0 -19
  167. package/template/src/utils/isMobileOrTablet.ts +2 -7
  168. package/template/src/utils/useButtonTemplate.tsx +0 -1
  169. package/template/src/utils/useMuteToggleLocal.ts +3 -54
  170. package/template/web/index.html +0 -5
  171. package/template/webpack.commons.js +8 -13
  172. package/template/webpack.web.config.js +0 -1
  173. package/template/agora-rn-uikit/src/Reducer/ActiveSpeakerDetected.ts +0 -11
  174. package/template/agora-rn-uikit/src/Reducer/LocalPermissionState.ts +0 -24
  175. package/template/agora-rn-uikit/src/Reducer/UserPin.ts +0 -11
  176. package/template/android/app/src/main/assets/fonts/SourceSansPro-Regular.ttf +0 -0
  177. package/template/android/app/src/main/assets/fonts/icomoon.ttf +0 -0
  178. package/template/android/app/src/main/res/values/colors.xml +0 -7
  179. package/template/react-native-toast-message/src/components/checkbox.js +0 -178
  180. package/template/react-native.config.js +0 -7
  181. package/template/src/assets/font-styles.css +0 -329
  182. package/template/src/assets/fonts/SourceSansPro-Regular.ttf +0 -0
  183. package/template/src/assets/fonts/icomoon.ttf +0 -0
  184. package/template/src/assets/permission.png +0 -0
  185. package/template/src/assets/selection.json +0 -1
  186. package/template/src/atoms/ActionMenu.tsx +0 -236
  187. package/template/src/atoms/AnimatedActiveSpeaker.native.tsx +0 -71
  188. package/template/src/atoms/AnimatedActiveSpeaker.tsx +0 -84
  189. package/template/src/atoms/AnimatedRings.native.tsx +0 -68
  190. package/template/src/atoms/AnimatedRings.tsx +0 -70
  191. package/template/src/atoms/Card.tsx +0 -61
  192. package/template/src/atoms/CircularProgress.native.tsx +0 -121
  193. package/template/src/atoms/CircularProgress.tsx +0 -102
  194. package/template/src/atoms/CustomIcon.tsx +0 -88
  195. package/template/src/atoms/CustomSwitch.tsx +0 -287
  196. package/template/src/atoms/Dropdown.tsx +0 -306
  197. package/template/src/atoms/IconButton.tsx +0 -162
  198. package/template/src/atoms/ImageIcon.tsx +0 -98
  199. package/template/src/atoms/InfoBubble.tsx +0 -291
  200. package/template/src/atoms/Input.tsx +0 -87
  201. package/template/src/atoms/InviteInfo.tsx +0 -166
  202. package/template/src/atoms/LinkButton.tsx +0 -28
  203. package/template/src/atoms/OutlineButton.tsx +0 -61
  204. package/template/src/atoms/ParticipantsCount.tsx +0 -73
  205. package/template/src/atoms/Popup.tsx +0 -147
  206. package/template/src/atoms/RecordingInfo.tsx +0 -49
  207. package/template/src/atoms/Spacer.tsx +0 -22
  208. package/template/src/atoms/TertiaryButton.tsx +0 -78
  209. package/template/src/atoms/Toggle.tsx +0 -47
  210. package/template/src/atoms/Tooltip.native.tsx +0 -65
  211. package/template/src/atoms/Tooltip.tsx +0 -94
  212. package/template/src/atoms/UserAvatar.tsx +0 -60
  213. package/template/src/components/CommonStyles.ts +0 -44
  214. package/template/src/components/ToastComponent.tsx +0 -8
  215. package/template/src/components/participants/Participant.tsx +0 -302
  216. package/template/src/components/participants/UserActionMenuOptions.tsx +0 -398
  217. package/template/src/components/popups/InvitePopup.tsx +0 -115
  218. package/template/src/components/popups/StopRecordingPopup.tsx +0 -114
  219. package/template/src/components/precall/PermissionHelper.native.tsx +0 -5
  220. package/template/src/components/precall/PermissionHelper.tsx +0 -126
  221. package/template/src/components/precall/PreCallSettings.tsx +0 -52
  222. package/template/src/components/useToast.tsx +0 -41
  223. package/template/src/components/useVideoCall.tsx +0 -65
  224. package/template/src/pages/Endcall.tsx +0 -148
  225. package/template/src/pages/video-call/ActionSheet.native.tsx +0 -215
  226. package/template/src/pages/video-call/ActionSheet.tsx +0 -226
  227. package/template/src/pages/video-call/ActionSheetContent.tsx +0 -479
  228. package/template/src/pages/video-call/ActionSheetHandle.tsx +0 -38
  229. package/template/src/pages/video-call/ActionSheetStyles.css +0 -138
  230. package/template/src/pages/video-call/SidePanelHeader.tsx +0 -190
  231. package/template/src/pages/video-call/VideoCallMobileView.tsx +0 -139
  232. package/template/src/pages/video-call/VideoCallScreen.native.tsx +0 -37
  233. package/template/src/subComponents/ChatInput.ios.tsx +0 -237
  234. package/template/src/subComponents/EndcallPopup.tsx +0 -107
  235. package/template/src/subComponents/LayoutIconButton.tsx +0 -201
  236. package/template/src/subComponents/RemoteMutePopup.tsx +0 -193
  237. package/template/src/subComponents/RemoveMeetingPopup.tsx +0 -109
  238. package/template/src/subComponents/RemoveScreensharePopup.tsx +0 -109
  239. package/template/src/subComponents/SelectDeviceSettings.backup.tsx +0 -207
  240. package/template/src/subComponents/SidePanelHeader.tsx +0 -112
  241. package/template/src/theme/index.ts +0 -46
  242. package/template/src/utils/PlatformWrapper.tsx +0 -21
  243. package/template/src/utils/hexadecimalTransparency.ts +0 -108
  244. package/template/src/utils/pendingStateUpdateHelper.ts +0 -19
  245. package/template/src/utils/useFocus.tsx +0 -46
  246. package/template/src/utils/useIsActiveSpeaker.ts +0 -27
  247. package/template/src/utils/useIsHandRaised.ts +0 -13
  248. package/template/src/utils/useRemoteEndScreenshare.ts +0 -26
  249. package/template/src/utils/useRemoteRequest.ts +0 -84
@@ -10,21 +10,11 @@
10
10
  *********************************************
11
11
  */
12
12
  import React from 'react';
13
- import {
14
- Platform as ReactNativePlatform,
15
- useWindowDimensions,
16
- } from 'react-native';
13
+ import {Platform as ReactNativePlatform} from 'react-native';
17
14
  import Platform from '../subComponents/Platform';
18
15
 
19
16
  import * as ReactIs from 'react-is';
20
17
 
21
- const trimText = (text: string, length: number = 25) => {
22
- if (!text) {
23
- return '';
24
- }
25
- return text?.substring(0, length) + (text?.length > length ? '...' : '');
26
- };
27
- const maxInputLimit = 60;
28
18
  const isValidReactComponent = <T,>(Component?: React.ComponentType<T>) =>
29
19
  Component && ReactIs.isValidElementType(Component) ? true : false;
30
20
 
@@ -67,150 +57,10 @@ const isIOS = () => Platform === 'native' && ReactNativePlatform.OS === 'ios';
67
57
  //@ts-ignore
68
58
  const isDesktop = () => Platform === 'electron';
69
59
 
70
- /**
71
- * Checks whether the application is running on mobile device (user agent) and returns true/false.
72
- * @returns function
73
- */
74
- //@ts-ignore
75
- const isMobileUA = () => {
76
- let check = false;
77
- (function (a) {
78
- if (
79
- /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(
80
- a,
81
- ) ||
82
- isAndroid() ||
83
- isIOS()
84
- )
85
- check = true;
86
- })(navigator?.userAgent || navigator?.vendor || window?.opera);
87
- return check;
88
- };
89
-
90
60
  const isArray = (data: any[]) =>
91
61
  data && Array.isArray(data) && data.length ? true : false ? true : false;
92
-
93
- interface calculatedPositionProps {
94
- px: number;
95
- py: number;
96
- localWidth: number;
97
- localHeight: number;
98
- globalWidth: number;
99
- globalHeight: number;
100
- extra?: {
101
- top?: number;
102
- bottom?: number;
103
- left?: number;
104
- right?: number;
105
- };
106
- popupWidth?: number;
107
- }
108
- const calculatePosition = (params: calculatedPositionProps) => {
109
- const {
110
- px,
111
- py,
112
- localWidth,
113
- localHeight,
114
- globalWidth,
115
- globalHeight,
116
- extra: {top = 0, bottom = 0, left = 0, right = 0} = {},
117
- popupWidth = 220,
118
- } = params;
119
- //right hand side
120
- if (px > globalWidth / 2) {
121
- // if actionmenu overflow - horizontal
122
- const w = globalWidth - px + popupWidth;
123
- let minus = 0;
124
- if (w > globalWidth) {
125
- minus = w - globalWidth + 10;
126
- }
127
- //right bottom
128
- if (py > globalHeight / 2) {
129
- return {
130
- bottom: globalHeight - py + bottom,
131
- right: globalWidth - px - minus + right,
132
- };
133
- }
134
- //right top
135
- else {
136
- return {
137
- top: py + localHeight + top,
138
- right: globalWidth - px - minus + right,
139
- };
140
- }
141
- }
142
- //left hand side
143
- else {
144
- // if actionmenu overflow - horizontal
145
- const w = px + localWidth + popupWidth;
146
- let minus = 0;
147
- if (w > globalWidth) {
148
- minus = w - globalWidth + 10;
149
- }
150
- //left bottom
151
- if (py > globalHeight / 2) {
152
- return {
153
- bottom: globalHeight - py + bottom,
154
- left: px + localWidth - minus + left,
155
- };
156
- }
157
- //left top
158
- else {
159
- return {
160
- top: py + localHeight + top + top,
161
- left: px + localWidth - minus + left,
162
- };
163
- }
164
- }
165
- };
166
-
167
- const BREAKPOINTS = {
168
- xs: 360,
169
- sm: 576,
170
- md: 768,
171
- lg: 992,
172
- xl: 1330,
173
- xxl: 1400,
174
- };
175
-
176
- const useIsDesktop = () => {
177
- const {width, height} = useWindowDimensions();
178
- return (from: 'default' | 'toolbar' | 'popup' = 'default') => {
179
- if (from === 'default') {
180
- return width > height ? true : false;
181
- } else if (from === 'toolbar') {
182
- return width > BREAKPOINTS.xl;
183
- } else if (from === 'popup') {
184
- return width > BREAKPOINTS.md;
185
- }
186
- return width >= BREAKPOINTS.xl;
187
- };
188
- };
189
- const useIsSmall = () => {
190
- const {width} = useWindowDimensions();
191
- return (number = BREAKPOINTS.sm) => {
192
- return width < number;
193
- };
194
- };
195
-
196
- const useResponsive = () => {
197
- const {width} = useWindowDimensions();
198
- return (input: number) => {
199
- if (width < BREAKPOINTS.xs) {
200
- return input / 3;
201
- } else if (width < BREAKPOINTS.md) {
202
- return input / 2;
203
- } else {
204
- return input;
205
- }
206
- };
207
- };
208
62
  export {
209
- useIsDesktop,
210
- useIsSmall,
211
- BREAKPOINTS,
212
63
  useHasBrandLogo,
213
- isMobileUA,
214
64
  isAndroid,
215
65
  isIOS,
216
66
  isWebInternal,
@@ -219,8 +69,4 @@ export {
219
69
  shouldAuthenticate,
220
70
  isArray,
221
71
  isValidReactComponent,
222
- maxInputLimit,
223
- trimText,
224
- calculatePosition,
225
- useResponsive,
226
72
  };
@@ -55,22 +55,3 @@ export function isEmptyObject(obj: object) {
55
55
  }
56
56
  return true;
57
57
  }
58
-
59
- export const randomNameGenerator = (num: number) => {
60
- let res = '';
61
- for (let i = 0; i < num; i++) {
62
- const random = Math.floor(Math.random() * 10);
63
- res += String.fromCharCode(97 + random);
64
- }
65
- return res;
66
- };
67
- export function formatAMPM(date) {
68
- var hours = date.getHours();
69
- var minutes = date.getMinutes();
70
- var ampm = hours >= 12 ? 'pm' : 'am';
71
- hours = hours % 12;
72
- hours = hours ? hours : 12; // the hour '0' should be '12'
73
- minutes = minutes < 10 ? '0' + minutes : minutes;
74
- var strTime = hours + ':' + minutes + ' ' + ampm;
75
- return strTime;
76
- }
@@ -13,19 +13,14 @@ const isMobileOrTablet = () => {
13
13
  (function (a) {
14
14
  if (
15
15
  /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(
16
- a
16
+ a,
17
17
  ) ||
18
18
  /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(
19
- a.substr(0, 4)
19
+ a.substr(0, 4),
20
20
  )
21
21
  )
22
22
  check = true;
23
23
  })(navigator?.userAgent || navigator?.vendor || window?.opera);
24
- check =
25
- (/Macintosh/i.test(navigator?.userAgent) &&
26
- navigator?.maxTouchPoints &&
27
- navigator?.maxTouchPoints > 1) ||
28
- check;
29
24
  return check;
30
25
  };
31
26
 
@@ -16,7 +16,6 @@ import {createHook} from 'customization-implementation';
16
16
  export enum ButtonTemplateName {
17
17
  topBar,
18
18
  bottomBar,
19
- actionBar,
20
19
  }
21
20
 
22
21
  export interface ButtonTemplateInferface {
@@ -10,11 +10,7 @@
10
10
  *********************************************
11
11
  */
12
12
  import {useLocalUserInfo, useRtc} from 'customization-api';
13
- import {useContext, useEffect, useRef, useState} from 'react';
14
-
15
13
  import {ToggleState} from '../../agora-rn-uikit/src/Contexts/PropsContext';
16
- import {isMobileUA, isWebInternal} from './common';
17
- import {AppState} from 'react-native';
18
14
 
19
15
  export enum MUTE_LOCAL_TYPE {
20
16
  audio,
@@ -27,48 +23,6 @@ function useMuteToggleLocal() {
27
23
  const {RtcEngine, dispatch} = useRtc();
28
24
  const local = useLocalUserInfo();
29
25
 
30
- const appState = useRef(AppState.currentState);
31
- const [appStateVisible, setAppStateVisible] = useState(appState.current);
32
- const isCamON = useRef(local.video);
33
-
34
- useEffect(() => {
35
- if ($config.AUDIO_ROOM || !isMobileUA()) return;
36
- const subscription = AppState.addEventListener('change', (nextAppState) => {
37
- appState.current = nextAppState;
38
- setAppStateVisible(appState.current);
39
- });
40
-
41
- return () => {
42
- subscription?.remove();
43
- };
44
- }, []);
45
-
46
- useEffect(() => {
47
- // console.log(`Video State ${local.video} in Mode ${appStateVisible}`);
48
- if (appStateVisible === 'background') {
49
- isCamON.current = local.video;
50
- if (isCamON.current) {
51
- isWebInternal()
52
- ? RtcEngine.muteLocalVideoStream(true)
53
- : RtcEngine.enableLocalVideo(false);
54
-
55
- dispatch({
56
- type: 'LocalMuteVideo',
57
- value: [0],
58
- });
59
- }
60
- }
61
- if (appStateVisible === 'active' && isCamON.current) {
62
- isWebInternal()
63
- ? RtcEngine.muteLocalVideoStream(false)
64
- : RtcEngine.enableLocalVideo(true);
65
- dispatch({
66
- type: 'LocalMuteVideo',
67
- value: [1],
68
- });
69
- }
70
- }, [appStateVisible]);
71
-
72
26
  return async (type: MUTE_LOCAL_TYPE) => {
73
27
  switch (type) {
74
28
  case MUTE_LOCAL_TYPE.audio:
@@ -128,14 +82,9 @@ function useMuteToggleLocal() {
128
82
  });
129
83
 
130
84
  try {
131
- //enableLocalVideo not available on web
132
- isWebInternal()
133
- ? await RtcEngine.muteLocalVideoStream(
134
- localVideoState === ToggleState.enabled ? true : false,
135
- )
136
- : await RtcEngine.enableLocalVideo(
137
- localVideoState === ToggleState.enabled ? false : true,
138
- );
85
+ await RtcEngine.muteLocalVideoStream(
86
+ localVideoState === ToggleState.enabled ? true : false,
87
+ );
139
88
 
140
89
  // Enable UI
141
90
  dispatch({
@@ -3,14 +3,9 @@
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <link rel="preconnect" href="https://fonts.googleapis.com">
7
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
8
- <!-- moved to template/src/assets/font-styles.css as it was not available for sdks-->
9
- <!-- <link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap" rel="stylesheet"> -->
10
6
 
11
7
  <base href="/">
12
8
  <title><%= htmlWebpackPlugin.options.title %></title>
13
-
14
9
  </head>
15
10
  <body>
16
11
  <style>
@@ -34,15 +34,15 @@ module.exports = {
34
34
  plugins: [
35
35
  // Using html webpack plugin to utilize our index.html
36
36
  !isSdk &&
37
- new HtmlWebpackPlugin({
38
- title: configVars['$config.APP_NAME'],
39
- template: isElectron ? 'electron/index.html' : 'web/index.html',
40
- }),
37
+ new HtmlWebpackPlugin({
38
+ title: configVars['$config.APP_NAME'],
39
+ template: isElectron ? 'electron/index.html' : 'web/index.html',
40
+ }),
41
41
  isDevelopment &&
42
- !isSdk &&
43
- new ReactRefreshWebpackPlugin({
44
- overlay: false,
45
- }),
42
+ !isSdk &&
43
+ new ReactRefreshWebpackPlugin({
44
+ overlay: false,
45
+ }),
46
46
  ].filter(Boolean),
47
47
  resolve: {
48
48
  alias: {
@@ -139,11 +139,6 @@ module.exports = {
139
139
  },
140
140
  ],
141
141
  },
142
- {
143
- test: /\.css$/i,
144
- use: ["style-loader", "css-loader"],
145
- },
146
-
147
142
  ],
148
143
  },
149
144
  };
@@ -28,7 +28,6 @@ module.exports = merge(commons, {
28
28
  // Webpack dev server config
29
29
  devServer: {
30
30
  port: 9000,
31
- // https: true,
32
31
  historyApiFallback: true, // Support for react-router
33
32
  static: './', // same as contentBase from webpack v4 config
34
33
  client:{
@@ -1,11 +0,0 @@
1
- import {ActionType, RenderStateInterface} from '../Contexts/RtcContext';
2
-
3
- export default function ActiveSpeakerDetected(
4
- state: RenderStateInterface,
5
- action: ActionType<'ActiveSpeakerDetected'>,
6
- ) {
7
- return {
8
- ...state,
9
- activeSpeaker: action?.value && action.value?.length ? action.value[0] : '',
10
- };
11
- }
@@ -1,24 +0,0 @@
1
- import {
2
- ActionType,
3
- RenderStateInterface,
4
- UidType,
5
- } from '../Contexts/RtcContext';
6
-
7
- export default function LocalPermissionState(
8
- state: RenderStateInterface,
9
- action: ActionType<'LocalPermissionState'>,
10
- localUid: UidType,
11
- ) {
12
- let stateUpdate: RenderStateInterface = {
13
- activeSpeaker: state.activeSpeaker,
14
- renderList: {
15
- ...state.renderList,
16
- [localUid]: {
17
- ...state.renderList[localUid],
18
- permissionStatus: action.value[0],
19
- },
20
- },
21
- activeUids: [...state.activeUids],
22
- };
23
- return stateUpdate;
24
- }
@@ -1,11 +0,0 @@
1
- import {ActionType, RenderStateInterface} from '../Contexts/RtcContext';
2
-
3
- export default function UserPin(
4
- state: RenderStateInterface,
5
- action: ActionType<'UserPin'>,
6
- ) {
7
- return {
8
- ...state,
9
- pinnedUid: action?.value && action.value?.length ? action.value[0] : '',
10
- };
11
- }
@@ -1,7 +0,0 @@
1
- <resources>
2
- <item name="blue" type="color">#099DFD
3
- </item>
4
- <integer-array name="androidcolors">
5
- <item>@color/blue</item>
6
- </integer-array>
7
- </resources>
@@ -1,178 +0,0 @@
1
- import React, { useState, useEffect } from 'react';
2
- import { View, TouchableOpacity, Text, Pressable } from 'react-native';
3
- import PropTypes from 'prop-types';
4
- import { stylePropType } from '../utils/prop-types';
5
- import styles, { HEIGHT } from './base/styles';
6
- import Checkbox from '../../../src/subComponents/Checkbox';
7
- import { PrimaryButton } from 'customization-api';
8
- import TertiaryButton from '../../../src/atoms/TertiaryButton';
9
-
10
- function BaseToast({
11
- leadingIcon,
12
- trailingIcon,
13
- text1,
14
- text2,
15
- onPress,
16
- style,
17
- contentContainerStyle,
18
- text1Style,
19
- text2Style,
20
- subTextStyle,
21
- activeOpacity,
22
- text1NumberOfLines,
23
- text2NumberOfLines,
24
- primaryBtn,
25
- secondaryBtn,
26
- checkbox
27
- }) {
28
- const [checked, setChecked] = useState(false);
29
-
30
- return (
31
- <TouchableOpacity
32
- testID='rootView'
33
- style={[styles.base, styles.borderTop, style]}
34
- onPress={onPress}
35
- activeOpacity={onPress ? activeOpacity : 1}>
36
- <View
37
- testID='contentContainer'
38
- style={[styles.contentContainer, contentContainerStyle]}>
39
- {(text1 || text1?.length > 0) && (
40
- <View
41
- style={{
42
- flex: 1,
43
- flexDirection: 'row',
44
- justifyContent: 'space-between'
45
- }}>
46
- <View
47
- style={{
48
- flexDirection: 'row',
49
- flex: 1
50
- }}>
51
- {leadingIcon ? leadingIcon : <></>}
52
- <Text
53
- testID='text1'
54
- style={[styles.text1, text1Style]}
55
- numberOfLines={text1NumberOfLines}>
56
- {text1}
57
- </Text>
58
- </View>
59
- <View style={{ justifyContent: 'flex-start', alignSelf: 'center' }}>
60
- {trailingIcon ? trailingIcon : <></>}
61
- </View>
62
- </View>
63
- )}
64
- {(text2 || text2?.length > 0) && (
65
- <View>
66
- <Text
67
- testID='text2'
68
- style={[styles.text2, text2Style]}
69
- numberOfLines={text2NumberOfLines}>
70
- {text2}
71
- </Text>
72
- </View>
73
- )}
74
- {checkbox && (
75
- <Pressable
76
- style={{
77
- flex: 1,
78
- flexDirection: 'row',
79
- paddingTop: 16,
80
- paddingBottom: 8,
81
- marginLeft: 4
82
- }}
83
- onPress={() => {
84
- setChecked((e) => !e);
85
- }}>
86
- <Checkbox
87
- {...checkbox}
88
- value={checked}
89
- onValueChange={setChecked}
90
- style={{
91
- marginRight: 8
92
- }}
93
- />
94
- <Text style={subTextStyle}>{checkbox.text}</Text>
95
- </Pressable>
96
- )}
97
- {primaryBtn || secondaryBtn ? (
98
- <View
99
- style={{
100
- flex: 1,
101
- flexDirection: 'row',
102
- paddingTop: 16,
103
- paddingBottom: 24
104
- }}>
105
- {primaryBtn && (
106
- <PrimaryButton
107
- textStyle={{ fontWeight: '600', fontSize: 16, paddingLeft: 0 }}
108
- containerStyle={{
109
- height: 40,
110
- borderRadius: 4,
111
- paddingVertical: 0,
112
- paddingHorizontal: 12,
113
- minWidth: 'unset'
114
- }}
115
- {...primaryBtn}
116
- onPress={(e) => {
117
- primaryBtn.onPress(checked, e);
118
- setChecked(false);
119
- }}
120
- />
121
- )}
122
- {secondaryBtn && (
123
- <TertiaryButton
124
- textStyle={{ fontWeight: '600', fontSize: 16, paddingLeft: 0 }}
125
- containerStyle={{
126
- height: 40,
127
- marginLeft: 16,
128
- paddingVertical: 0
129
- }}
130
- {...secondaryBtn}
131
- onPress={(e) => {
132
- secondaryBtn.onPress(checked, e);
133
- setChecked(false);
134
- }}
135
- />
136
- )}
137
- </View>
138
- ) : (
139
- <></>
140
- )}
141
- </View>
142
- </TouchableOpacity>
143
- );
144
- }
145
-
146
- BaseToast.HEIGHT = HEIGHT;
147
-
148
- BaseToast.propTypes = {
149
- leadingIcon: PropTypes.node,
150
- trailingIcon: PropTypes.node,
151
- text1: PropTypes.string,
152
- text2: PropTypes.string || PropTypes.element || PropTypes.any,
153
- onPress: PropTypes.func,
154
- style: stylePropType,
155
- contentContainerStyle: stylePropType,
156
- text1Style: stylePropType,
157
- text2Style: stylePropType,
158
- activeOpacity: PropTypes.number,
159
- text1NumberOfLines: PropTypes.number,
160
- text2NumberOfLines: PropTypes.number
161
- };
162
-
163
- BaseToast.defaultProps = {
164
- leadingIcon: null,
165
- trailingIcon: null,
166
- text1: undefined,
167
- text2: undefined,
168
- onPress: undefined,
169
- style: undefined,
170
- contentContainerStyle: undefined,
171
- text1Style: undefined,
172
- text2Style: undefined,
173
- activeOpacity: 0.8,
174
- text1NumberOfLines: 1,
175
- text2NumberOfLines: 2
176
- };
177
-
178
- export default BaseToast;
@@ -1,7 +0,0 @@
1
- module.exports = {
2
- project: {
3
- ios: {},
4
- android: {},
5
- },
6
- assets: ["./src/assets/fonts"]
7
- }