agora-appbuilder-core 4.0.0-beta.32 → 4.0.0-beta.33

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 (93) hide show
  1. package/package.json +1 -1
  2. package/template/agora-rn-uikit/src/Views/MaxVideoView.tsx +12 -2
  3. package/template/bridge/rtc/webNg/RtcEngine.ts +27 -1
  4. package/template/react-native-toast-message/index.d.ts +2 -1
  5. package/template/react-native-toast-message/src/components/base/index.js +20 -32
  6. package/template/react-native-toast-message/src/components/base/styles.js +18 -21
  7. package/template/react-native-toast-message/src/components/checkbox.js +23 -18
  8. package/template/react-native-toast-message/src/index.js +3 -1
  9. package/template/react-native-toast-message/src/index.sdk.tsx +4 -1
  10. package/template/src/assets/font-styles.css +122 -95
  11. package/template/src/assets/fonts/icomoon.ttf +0 -0
  12. package/template/src/assets/selection.json +1 -1
  13. package/template/src/atoms/Avatar.tsx +51 -0
  14. package/template/src/atoms/Card.tsx +21 -8
  15. package/template/src/atoms/ClipboardIconButton.tsx +89 -0
  16. package/template/src/atoms/CustomIcon.tsx +2 -0
  17. package/template/src/atoms/Dropdown.tsx +3 -3
  18. package/template/src/atoms/InlineNotification.tsx +47 -0
  19. package/template/src/atoms/MeetingLink.tsx +160 -0
  20. package/template/src/atoms/TertiaryButton.tsx +35 -5
  21. package/template/src/atoms/Toolbar.tsx +0 -1
  22. package/template/src/auth/AuthProvider.tsx +5 -0
  23. package/template/src/auth/AuthRoute.tsx +2 -1
  24. package/template/src/auth/IDPAuth.tsx +1 -0
  25. package/template/src/auth/openIDPURL.electron.tsx +3 -2
  26. package/template/src/components/ChatContext.ts +2 -0
  27. package/template/src/components/Controls.tsx +97 -24
  28. package/template/src/components/DeviceConfigure.tsx +8 -1
  29. package/template/src/components/DeviceContext.tsx +2 -0
  30. package/template/src/components/EventsConfigure.tsx +116 -63
  31. package/template/src/components/GridVideo.tsx +3 -5
  32. package/template/src/components/ParticipantsView.tsx +2 -2
  33. package/template/src/components/Precall.tsx +126 -58
  34. package/template/src/components/RTMConfigure.tsx +4 -1
  35. package/template/src/components/chat-messages/useChatMessages.tsx +146 -31
  36. package/template/src/components/common/Error.tsx +1 -0
  37. package/template/src/components/common/Logo.tsx +2 -2
  38. package/template/src/components/livestream/LiveStreamContext.tsx +19 -18
  39. package/template/src/components/livestream/views/LiveStreamAttendeeLandingTile.tsx +273 -0
  40. package/template/src/components/meeting-info-invite/MeetingInfo.tsx +82 -0
  41. package/template/src/components/meeting-info-invite/MeetingInfoCardHeader.tsx +86 -0
  42. package/template/src/components/meeting-info-invite/MeetingInfoGridTile.tsx +170 -0
  43. package/template/src/components/meeting-info-invite/MeetingInfoLinks.tsx +141 -0
  44. package/template/src/components/participants/Participant.tsx +1 -0
  45. package/template/src/components/participants/ParticipantSectionTitle.tsx +3 -0
  46. package/template/src/components/participants/ScreenshareParticipants.tsx +15 -17
  47. package/template/src/components/participants/UserActionMenuOptions.tsx +1 -0
  48. package/template/src/components/precall/LocalMute.tsx +2 -2
  49. package/template/src/components/precall/VideoPreview.tsx +102 -49
  50. package/template/src/components/precall/joinWaitingRoomBtn.native.tsx +9 -66
  51. package/template/src/components/precall/joinWaitingRoomBtn.tsx +9 -11
  52. package/template/src/components/precall/meetingTitle.tsx +4 -2
  53. package/template/src/components/precall/selectDevice.tsx +2 -2
  54. package/template/src/components/precall/textInput.tsx +11 -2
  55. package/template/src/components/room-info/useRoomInfo.tsx +1 -0
  56. package/template/src/components/useShareLink.tsx +3 -2
  57. package/template/src/components/virtual-background/VBPanel.tsx +76 -25
  58. package/template/src/components/virtual-background/VideoPreview.tsx +20 -5
  59. package/template/src/components/virtual-background/useVB.tsx +4 -5
  60. package/template/src/components/whiteboard/WhiteboardConfigure.tsx +18 -2
  61. package/template/src/pages/Create.tsx +4 -2
  62. package/template/src/pages/Join.tsx +5 -4
  63. package/template/src/pages/video-call/ActionSheetContent.tsx +11 -1
  64. package/template/src/pages/video-call/NameWithMicIcon.tsx +3 -1
  65. package/template/src/pages/video-call/VideoCallScreen.tsx +5 -1
  66. package/template/src/pages/video-call/VideoComponent.tsx +47 -1
  67. package/template/src/pages/video-call/VideoRenderer.tsx +4 -2
  68. package/template/src/rtm/RTMEngine.ts +7 -2
  69. package/template/src/rtm-events-api/LocalEvents.ts +2 -0
  70. package/template/src/subComponents/ChatBubble.tsx +79 -61
  71. package/template/src/subComponents/ChatContainer.tsx +5 -2
  72. package/template/src/subComponents/ChatInput.ios.tsx +1 -1
  73. package/template/src/subComponents/ChatInput.tsx +2 -2
  74. package/template/src/subComponents/LocalAudioMute.tsx +1 -1
  75. package/template/src/subComponents/LocalVideoMute.tsx +1 -1
  76. package/template/src/subComponents/SelectDevice.tsx +38 -13
  77. package/template/src/subComponents/ToastConfig.tsx +70 -61
  78. package/template/src/subComponents/caption/CaptionIcon.tsx +6 -1
  79. package/template/src/subComponents/caption/TranscriptIcon.tsx +7 -1
  80. package/template/src/subComponents/caption/useCaption.tsx +10 -3
  81. package/template/src/subComponents/caption/useSTTAPI.tsx +13 -0
  82. package/template/src/subComponents/caption/utils.ts +6 -1
  83. package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +4 -3
  84. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +6 -4
  85. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +25 -18
  86. package/template/src/subComponents/recording/useRecording.tsx +1 -0
  87. package/template/src/subComponents/waiting-rooms/WaitingRoomControls.tsx +2 -2
  88. package/template/src/theme/index.ts +9 -0
  89. package/template/src/utils/common.tsx +3 -1
  90. package/template/src/utils/index.tsx +9 -0
  91. package/template/agora-rn-uikit/package-lock.json +0 -7612
  92. package/template/package-lock.json +0 -55696
  93. package/template/react-native-toast-message/package-lock.json +0 -10553
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-appbuilder-core",
3
- "version": "4.0.0-beta.32",
3
+ "version": "4.0.0-beta.33",
4
4
  "description": "React Native template for RTE app builder",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -13,13 +13,18 @@ interface MaxViewInterface {
13
13
  fallback?: React.ComponentType;
14
14
  containerStyle?: ViewStyle;
15
15
  landscapeMode?: boolean;
16
+ isPrecallScreen?: boolean;
16
17
  }
17
18
 
18
19
  const MaxVideoView: React.FC<MaxViewInterface> = (props) => {
19
20
  const {styleProps, rtcProps} = useContext(PropsContext);
20
21
  const {maxViewStyles} = styleProps || {};
21
22
  const Fallback = props.fallback;
22
- const {containerStyle = {}, landscapeMode = false} = props;
23
+ const {
24
+ containerStyle = {},
25
+ landscapeMode = false,
26
+ isPrecallScreen = false,
27
+ } = props;
23
28
  const localUid = useLocalUid();
24
29
  const uid = props.user.uid === rtcProps?.screenShareUid ? 1 : props.user.uid;
25
30
  let landscapeModeStyle = {};
@@ -32,7 +37,12 @@ const MaxVideoView: React.FC<MaxViewInterface> = (props) => {
32
37
  }
33
38
  return uid === localUid ? (
34
39
  props.user.video ? (
35
- <LocalView style={containerStyle} renderMode={VideoRenderMode.Fit} />
40
+ <LocalView
41
+ style={containerStyle}
42
+ renderMode={
43
+ isPrecallScreen ? VideoRenderMode.FILL : VideoRenderMode.Fit
44
+ }
45
+ />
36
46
  ) : Fallback ? (
37
47
  <Fallback />
38
48
  ) : (
@@ -320,7 +320,33 @@ export default class RtcEngine {
320
320
  localVideo = await AgoraRTC.createCameraVideoTrack(videoConfig);
321
321
  } catch (e) {
322
322
  videoConfig.cameraId = '';
323
- localVideo = await AgoraRTC.createCameraVideoTrack(videoConfig);
323
+ try {
324
+ localVideo = await AgoraRTC.createCameraVideoTrack(videoConfig);
325
+ } catch (e) {
326
+ console.log(
327
+ '[RTCEngineBridge]: Provided cameraId and default camera failed, trying other available devices',
328
+ );
329
+ const devices = await navigator.mediaDevices.enumerateDevices();
330
+ for (let device of devices) {
331
+ if (device.kind === 'videoinput') {
332
+ videoConfig.cameraId = device.deviceId;
333
+ try {
334
+ localVideo = await AgoraRTC.createCameraVideoTrack(
335
+ videoConfig,
336
+ );
337
+ break;
338
+ } catch (e) {
339
+ videoError = e;
340
+ console.log(
341
+ '[RTCEngineBridge]:',
342
+ 'Camera not available with deviceId' + device,
343
+ 'Reason: ',
344
+ e,
345
+ );
346
+ }
347
+ }
348
+ }
349
+ }
324
350
  }
325
351
  this.localStream.video = localVideo;
326
352
  this.videoDeviceId = localVideo
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ViewStyle, TextStyle, ImageSourcePropType } from 'react-native';
3
-
3
+ import { IconsInterface } from '../src/atoms/CustomIcon';
4
4
  declare module 'react-native-toast-message' {
5
5
  interface AnyObject {
6
6
  [key: string]: any;
@@ -57,6 +57,7 @@ declare module 'react-native-toast-message' {
57
57
  onHide?: () => void;
58
58
  onPress?: () => void;
59
59
  leadingIcon?: React.ReactNode;
60
+ leadingIconName?: keyof IconsInterface;
60
61
  }): void;
61
62
 
62
63
  static hide(): void;
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
5
5
  import Icon from '../icon';
6
6
  import { icons } from '../../assets';
7
7
  import { stylePropType } from '../../utils/prop-types';
8
- import styles, { HEIGHT } from './styles';
8
+ import styles from './styles';
9
9
 
10
10
  function BaseToast({
11
11
  leadingIcon,
@@ -26,7 +26,7 @@ function BaseToast({
26
26
  return (
27
27
  <TouchableOpacity
28
28
  testID='rootView'
29
- style={[styles.base, styles.borderTop, style]}
29
+ style={[styles.base, style]}
30
30
  onPress={onPress}
31
31
  activeOpacity={onPress ? activeOpacity : 1}>
32
32
  <View
@@ -37,43 +37,31 @@ function BaseToast({
37
37
  style={{
38
38
  flex: 1,
39
39
  flexDirection: 'row',
40
- justifyContent: 'space-between'
40
+ alignItems: 'center'
41
41
  }}>
42
- <View
43
- style={{
44
- flexDirection: 'row',
45
- flex: 1
46
- }}>
47
- {leadingIcon ? leadingIcon : <></>}
48
- <Text
49
- testID='text1'
50
- style={[styles.text1, text1Style]}
51
- numberOfLines={text1NumberOfLines}>
52
- {text1}
53
- </Text>
54
- </View>
55
- <View style={{ justifyContent: 'flex-start', alignSelf: 'center' }}>
56
- {trailingIcon ? trailingIcon : <></>}
57
- </View>
58
- </View>
59
- )}
60
- {(text2 || text2?.length > 0) && (
61
- <View>
42
+ {leadingIcon ? leadingIcon : <></>}
43
+
62
44
  <Text
63
- testID='text2'
64
- style={[styles.text2, text2Style]}
65
- numberOfLines={text2NumberOfLines}>
66
- {text2}
45
+ testID='text1'
46
+ style={[styles.text1, text1Style]}
47
+ numberOfLines={text1NumberOfLines}>
48
+ {text1}
67
49
  </Text>
68
50
  </View>
69
51
  )}
52
+ {(text2 || text2?.length > 0) && (
53
+ <Text
54
+ testID='text2'
55
+ style={[styles.text2, text2Style]}
56
+ numberOfLines={text2NumberOfLines}>
57
+ {text2}
58
+ </Text>
59
+ )}
70
60
  {primaryBtn || secondaryBtn ? (
71
61
  <View
72
62
  style={{
73
- flex: 1,
74
63
  flexDirection: 'row',
75
- paddingTop: 32,
76
- paddingBottom: 24
64
+ paddingTop: 16
77
65
  }}>
78
66
  {primaryBtn ? primaryBtn : <></>}
79
67
  {secondaryBtn ? secondaryBtn : <></>}
@@ -82,12 +70,11 @@ function BaseToast({
82
70
  <></>
83
71
  )}
84
72
  </View>
73
+ {trailingIcon ? trailingIcon : <></>}
85
74
  </TouchableOpacity>
86
75
  );
87
76
  }
88
77
 
89
- BaseToast.HEIGHT = HEIGHT;
90
-
91
78
  BaseToast.propTypes = {
92
79
  leadingIcon: PropTypes.node,
93
80
  trailingIcon: PropTypes.node,
@@ -106,6 +93,7 @@ BaseToast.propTypes = {
106
93
  BaseToast.defaultProps = {
107
94
  leadingIcon: null,
108
95
  trailingIcon: null,
96
+ leadingIconName: null,
109
97
  text1: undefined,
110
98
  text2: undefined,
111
99
  onPress: undefined,
@@ -1,40 +1,37 @@
1
- import { StyleSheet } from 'react-native';
2
- import colors from '../../colors';
3
-
4
- export const HEIGHT = 105;
1
+ import { StyleSheet, Platform } from 'react-native';
5
2
 
6
3
  export default StyleSheet.create({
7
4
  base: {
8
5
  flexDirection: 'row',
9
- height: HEIGHT,
10
- borderRadius: 6,
11
- backgroundColor: colors.white,
6
+ borderRadius: 4,
7
+ borderTopWidth: 4,
8
+ backgroundColor: $config.CARD_LAYER_4_COLOR,
9
+ width: '100%',
10
+ paddingHorizontal: Platform.OS === 'android' ? 16 : 24,
11
+ paddingVertical: 16,
12
+ height: 'auto',
12
13
  shadowOffset: { width: 0, height: 0 },
13
14
  shadowOpacity: 0.1,
14
15
  shadowRadius: 6,
15
16
  elevation: 2
16
17
  },
17
- borderTop: {
18
- borderTopWidth: 5,
19
- borderTopColor: colors.alto
20
- },
21
18
  contentContainer: {
22
- paddingLeft: 20,
23
19
  flex: 1,
24
- flexDirection: 'row',
20
+ overflow: 'hidden',
21
+ flexDirection: 'column',
25
22
  justifyContent: 'flex-start'
26
23
  },
27
24
  text1: {
28
- fontSize: 15,
25
+ fontSize: 14,
26
+ lineHeight: 22,
29
27
  fontFamily: 'Source Sans Pro',
30
- width: '100%',
31
- fontWeight: '600',
32
- marginRight: 2
28
+ fontWeight: '700'
33
29
  },
34
30
  text2: {
35
- fontSize: 15,
36
- fontFamily: 'Source Sans Pro',
37
- width: '100%',
38
- fontWeight: '400'
31
+ marginTop: 4,
32
+ fontSize: 14,
33
+ lineHeight: 22,
34
+ fontWeight: '400',
35
+ fontFamily: 'Source Sans Pro'
39
36
  }
40
37
  });
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
2
2
  import { View, TouchableOpacity, Text, Pressable } from 'react-native';
3
3
  import PropTypes from 'prop-types';
4
4
  import { stylePropType } from '../utils/prop-types';
5
- import styles, { HEIGHT } from './base/styles';
5
+ import styles from './base/styles';
6
6
  import Checkbox from '../../../src/subComponents/Checkbox';
7
7
  import PrimaryButton from '../../../src/atoms/PrimaryButton';
8
8
  import TertiaryButton from '../../../src/atoms/TertiaryButton';
@@ -30,7 +30,7 @@ function BaseToast({
30
30
  return (
31
31
  <TouchableOpacity
32
32
  testID='rootView'
33
- style={[styles.base, styles.borderTop, style]}
33
+ style={[styles.base, style]}
34
34
  onPress={onPress}
35
35
  activeOpacity={onPress ? activeOpacity : 1}>
36
36
  <View
@@ -76,9 +76,7 @@ function BaseToast({
76
76
  style={{
77
77
  flex: 1,
78
78
  flexDirection: 'row',
79
- paddingTop: 16,
80
- paddingBottom: 8,
81
- marginLeft: 4
79
+ paddingTop: 12
82
80
  }}
83
81
  onPress={() => {
84
82
  setChecked((e) => !e);
@@ -97,19 +95,22 @@ function BaseToast({
97
95
  {primaryBtn || secondaryBtn ? (
98
96
  <View
99
97
  style={{
100
- flex: 1,
101
98
  flexDirection: 'row',
102
- paddingTop: 16,
103
- paddingBottom: 24
99
+ marginTop: 16
104
100
  }}>
105
101
  {primaryBtn && (
106
102
  <PrimaryButton
107
- textStyle={{ fontWeight: '600', fontSize: 16, paddingLeft: 0 }}
103
+ textStyle={{
104
+ fontWeight: '600',
105
+ fontSize: 14,
106
+ lineHeight: 14,
107
+ paddingLeft: 0
108
+ }}
108
109
  containerStyle={{
109
- height: 40,
110
+ height: 32,
110
111
  borderRadius: 4,
111
- paddingVertical: 0,
112
- paddingHorizontal: 12,
112
+ paddingVertical: 9,
113
+ paddingHorizontal: 20,
113
114
  minWidth: 'unset'
114
115
  }}
115
116
  {...primaryBtn}
@@ -121,11 +122,17 @@ function BaseToast({
121
122
  )}
122
123
  {secondaryBtn && (
123
124
  <TertiaryButton
124
- textStyle={{ fontWeight: '600', fontSize: 16, paddingLeft: 0 }}
125
+ textStyle={{
126
+ fontWeight: '600',
127
+ fontSize: 14,
128
+ paddingLeft: 0,
129
+ lineHeight: 14
130
+ }}
125
131
  containerStyle={{
126
- height: 40,
127
- marginLeft: 16,
128
- paddingVertical: 0
132
+ height: 32,
133
+ marginLeft: 12,
134
+ paddingVertical: 9,
135
+ paddingHorizontal: 20
129
136
  }}
130
137
  {...secondaryBtn}
131
138
  onPress={(e) => {
@@ -143,8 +150,6 @@ function BaseToast({
143
150
  );
144
151
  }
145
152
 
146
- BaseToast.HEIGHT = HEIGHT;
147
-
148
153
  BaseToast.propTypes = {
149
154
  leadingIcon: PropTypes.node,
150
155
  trailingIcon: PropTypes.node,
@@ -255,8 +255,9 @@ class Toast extends Component {
255
255
  }
256
256
 
257
257
  async show(options = {}) {
258
+ const { update = false } = options;
258
259
  const { inProgress, isVisible } = this.state;
259
- if (inProgress || isVisible) {
260
+ if ((inProgress || isVisible) && !update) {
260
261
  await this.hide();
261
262
  }
262
263
 
@@ -381,6 +382,7 @@ class Toast extends Component {
381
382
  'text1',
382
383
  'text2',
383
384
  'leadingIcon',
385
+ 'leadingIconName',
384
386
  'hide',
385
387
  'show',
386
388
  'onPress',
@@ -254,8 +254,9 @@ class Toast extends Component {
254
254
  }
255
255
 
256
256
  async show(options = {}) {
257
+ const { update = false } = options;
257
258
  const { inProgress, isVisible } = this.state;
258
- if (inProgress || isVisible) {
259
+ if ((inProgress || isVisible) && !update) {
259
260
  await this.hide();
260
261
  }
261
262
 
@@ -379,6 +380,8 @@ class Toast extends Component {
379
380
  'isVisible',
380
381
  'text1',
381
382
  'text2',
383
+ 'leadingIcon',
384
+ 'leadingIconName',
382
385
  'hide',
383
386
  'show',
384
387
  'onPress',