agora-appbuilder-core 4.0.13 → 4.0.15

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 (71) hide show
  1. package/package.json +1 -1
  2. package/template/_package-lock.json +1364 -1576
  3. package/template/android/app/src/main/assets/fonts/icomoon.ttf +0 -0
  4. package/template/customization-api/sub-components.ts +6 -4
  5. package/template/customization-api/types.ts +0 -6
  6. package/template/defaultConfig.js +0 -3
  7. package/template/global.d.ts +0 -3
  8. package/template/ios/Podfile.lock +0 -10
  9. package/template/package-lock.json +1364 -1576
  10. package/template/package.json +0 -4
  11. package/template/src/SDKAppWrapper.tsx +8 -2
  12. package/template/src/app-state/useMessages.ts +9 -49
  13. package/template/src/assets/font-styles.css +125 -289
  14. package/template/src/assets/fonts/icomoon.ttf +0 -0
  15. package/template/src/assets/selection.json +1 -1
  16. package/template/src/atoms/ActionMenu.tsx +2 -5
  17. package/template/src/atoms/CustomIcon.tsx +1 -17
  18. package/template/src/atoms/ImageIcon.tsx +3 -19
  19. package/template/src/atoms/Popup.tsx +4 -13
  20. package/template/src/atoms/ToolbarPreset.tsx +57 -6
  21. package/template/src/auth/AuthProvider.tsx +0 -5
  22. package/template/src/auth/config.ts +3 -12
  23. package/template/src/components/Chat.tsx +1 -7
  24. package/template/src/components/ChatContext.ts +0 -12
  25. package/template/src/components/CommonStyles.ts +2 -2
  26. package/template/src/components/Controls.tsx +57 -29
  27. package/template/src/components/Leftbar.tsx +4 -4
  28. package/template/src/components/Navbar.tsx +54 -29
  29. package/template/src/components/NavbarMobile.tsx +23 -33
  30. package/template/src/components/PinnedVideo.tsx +1 -1
  31. package/template/src/components/RTMConfigure.tsx +0 -1
  32. package/template/src/components/SdkApiContext.tsx +4 -1
  33. package/template/src/components/chat-messages/useChatMessages.tsx +607 -411
  34. package/template/src/components/chat-ui/useChatUIControls.tsx +0 -53
  35. package/template/src/components/meeting-info-invite/MeetingInfoGridTile.tsx +1 -4
  36. package/template/src/components/participants/Participant.tsx +1 -0
  37. package/template/src/components/precall/joinWaitingRoomBtn.native.tsx +1 -6
  38. package/template/src/components/precall/joinWaitingRoomBtn.tsx +1 -6
  39. package/template/src/components/room-info/useRoomInfo.tsx +5 -5
  40. package/template/src/language/default-labels/videoCallScreenLabels.ts +6 -86
  41. package/template/src/pages/VideoCall.tsx +4 -3
  42. package/template/src/pages/video-call/ActionSheetContent.tsx +32 -3
  43. package/template/src/pages/video-call/VideoCallScreenWrapper.tsx +12 -22
  44. package/template/src/pages/video-call/VideoComponent.tsx +11 -5
  45. package/template/src/pages/video-call/index.ts +0 -8
  46. package/template/src/subComponents/ChatBubble.tsx +32 -252
  47. package/template/src/subComponents/ChatContainer.tsx +4 -14
  48. package/template/src/subComponents/ChatInput.ios.tsx +184 -0
  49. package/template/src/subComponents/ChatInput.tsx +100 -276
  50. package/template/src/subComponents/RemoteMutePopup.tsx +131 -12
  51. package/template/src/subComponents/caption/CaptionContainer.tsx +2 -6
  52. package/template/src/subComponents/recording/useRecording.tsx +1 -3
  53. package/template/src/utils/SdkMethodEvents.ts +1 -0
  54. package/template/src/utils/common.tsx +17 -0
  55. package/template/src/utils/index.tsx +0 -30
  56. package/template/src/utils/useEndCall.ts +0 -7
  57. package/template/src/utils/useJoinRoom.ts +7 -33
  58. package/template/android/link-assets-manifest.json +0 -13
  59. package/template/ios/link-assets-manifest.json +0 -13
  60. package/template/src/atoms/InlinePopup.tsx +0 -185
  61. package/template/src/components/chat/chatConfigure.native.tsx +0 -488
  62. package/template/src/components/chat/chatConfigure.tsx +0 -473
  63. package/template/src/subComponents/ChatInput.native.tsx +0 -269
  64. package/template/src/subComponents/chat/ChatActionMenu.tsx +0 -224
  65. package/template/src/subComponents/chat/ChatAttachment.native.tsx +0 -234
  66. package/template/src/subComponents/chat/ChatAttachment.tsx +0 -145
  67. package/template/src/subComponents/chat/ChatEmoji.native.tsx +0 -75
  68. package/template/src/subComponents/chat/ChatEmoji.tsx +0 -181
  69. package/template/src/subComponents/chat/ChatSendButton.tsx +0 -141
  70. package/template/src/subComponents/chat/ChatUploadStatus.tsx +0 -65
  71. package/template/src/subComponents/chat/ImagePopup.tsx +0 -400
@@ -108,33 +108,3 @@ export const base64ToUint8Array = (base64Str: string) => {
108
108
  return result;
109
109
  }
110
110
  };
111
-
112
- export function timeAgo(timestamp: number) {
113
- const now = new Date().getTime();
114
- const diff = now - timestamp;
115
- const seconds = Math.floor(diff / 1000);
116
- const minutes = Math.floor(seconds / 60);
117
- const hours = Math.floor(minutes / 60);
118
- const days = Math.floor(hours / 24);
119
-
120
- if (days > 0) {
121
- return days === 1 ? '1 day ago' : `${days} days ago`;
122
- } else if (hours > 0) {
123
- return hours === 1 ? '1 hour ago' : `${hours} hours ago`;
124
- } else if (minutes > 0) {
125
- return minutes === 1 ? '1 minute ago' : `${minutes} minutes ago`;
126
- } else {
127
- return 'just now';
128
- }
129
- }
130
-
131
- export const containsOnlyEmojis = (text: string) => {
132
- const emojiRegex =
133
- /[\u{1F300}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}\u{1F1E6}-\u{1F1FF}\u{1F191}-\u{1F251}\u{1F004}\u{1F0CF}\u{1F170}-\u{1F251}\s]/gu;
134
- return (
135
- emojiRegex.test(text) &&
136
- !/[^\u{1F300}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}\u{1F1E6}-\u{1F1FF}\u{1F191}-\u{1F251}\u{1F004}\u{1F0CF}\u{1F170}-\u{1F251}\s]/gu.test(
137
- text,
138
- )
139
- );
140
- };
@@ -7,7 +7,6 @@ import {stopForegroundService} from '../subComponents/LocalEndCall';
7
7
  import RTMEngine from '../rtm/RTMEngine';
8
8
  import {ENABLE_AUTH} from '../auth/config';
9
9
  import {useAuth} from '../auth/AuthProvider';
10
- import {useChatConfigure} from '../components/chat/chatConfigure';
11
10
 
12
11
  const useEndCall = () => {
13
12
  const history = useHistory();
@@ -17,7 +16,6 @@ const useEndCall = () => {
17
16
  data: {isHost},
18
17
  } = useRoomInfo();
19
18
  const {authLogin} = useAuth();
20
- const {deleteChatUser} = useChatConfigure();
21
19
 
22
20
  const {rtcProps} = useContext(PropsContext);
23
21
  const {dispatch} = useContext(DispatchContext);
@@ -51,16 +49,11 @@ const useEndCall = () => {
51
49
  item => item[1].type === 'rtc',
52
50
  );
53
51
  usersInCall.length === 1 && isSTTActive && stop();
54
- // removing user from chat server
55
- if ($config.CHAT) {
56
- deleteChatUser();
57
- }
58
52
  RTMEngine.getInstance().engine.leaveChannel(rtcProps.channel);
59
53
  if (!ENABLE_AUTH) {
60
54
  // await authLogout();
61
55
  await authLogin();
62
56
  }
63
-
64
57
  try {
65
58
  await afterEndCall(isHost, history as unknown as History);
66
59
  } catch (error) {
@@ -16,11 +16,6 @@ const JOIN_CHANNEL_PHRASE_AND_GET_USER = gql`
16
16
  title
17
17
  isHost
18
18
  secret
19
- chat {
20
- groupId
21
- userToken
22
- isGroupOwner
23
- }
24
19
  secretSalt
25
20
  mainUser {
26
21
  rtc
@@ -51,11 +46,6 @@ const JOIN_CHANNEL_PHRASE = gql`
51
46
  title
52
47
  isHost
53
48
  secret
54
- chat {
55
- groupId
56
- userToken
57
- isGroupOwner
58
- }
59
49
  secretSalt
60
50
  mainUser {
61
51
  rtc
@@ -77,6 +67,11 @@ const JOIN_CHANNEL_PHRASE = gql`
77
67
  /**
78
68
  * Returns an asynchronous function to join a meeting with the given phrase.
79
69
  */
70
+
71
+ export interface joinRoomPreference {
72
+ disableShareTile: boolean;
73
+ }
74
+
80
75
  export default function useJoinRoom() {
81
76
  const {store} = useContext(StorageContext);
82
77
  const {setRoomInfo} = useSetRoomInfo();
@@ -86,7 +81,7 @@ export default function useJoinRoom() {
86
81
  const {request: requestToJoin} = useWaitingRoomAPI();
87
82
  const isWaitingRoomEnabled = $config.ENABLE_WAITING_ROOM;
88
83
 
89
- return async (phrase: string) => {
84
+ return async (phrase: string, preference?: joinRoomPreference) => {
90
85
  setRoomInfo(prevState => {
91
86
  return {
92
87
  ...prevState,
@@ -187,28 +182,6 @@ export default function useJoinRoom() {
187
182
  ? data.screenShare.rtc
188
183
  : data.joinChannel.screenShare.rtc;
189
184
  }
190
-
191
- if (data?.joinChannel?.mainUser?.rtm || data?.mainUser?.rtm) {
192
- roomInfo.rtmToken = isWaitingRoomEnabled
193
- ? data.mainUser.rtm
194
- : data.joinChannel.mainUser.rtm;
195
- }
196
- if (data?.joinChannel?.chat || data?.chat) {
197
- const chat: RoomInfoContextInterface['data']['chat'] = {
198
- user_token: isWaitingRoomEnabled
199
- ? data.chat.userToken
200
- : data?.joinChannel?.chat?.userToken,
201
- group_id: isWaitingRoomEnabled
202
- ? data.chat.groupId
203
- : data?.joinChannel?.chat?.groupId,
204
- is_group_owner: isWaitingRoomEnabled
205
- ? data.chat.isGroupOwner
206
- : data?.joinChannel?.chat?.isGroupOwner,
207
- };
208
-
209
- roomInfo.chat = chat;
210
- }
211
-
212
185
  roomInfo.isHost = isWaitingRoomEnabled
213
186
  ? data.isHost
214
187
  : data.joinChannel.isHost;
@@ -244,6 +217,7 @@ export default function useJoinRoom() {
244
217
  ...prevState,
245
218
  isJoinDataFetched: true,
246
219
  data: compiledMeetingInfo,
220
+ roomPreference: {...preference},
247
221
  };
248
222
  });
249
223
  return roomInfo;
@@ -1,13 +0,0 @@
1
- {
2
- "migIndex": 1,
3
- "data": [
4
- {
5
- "path": "src/assets/fonts/SourceSansPro-Regular.ttf",
6
- "sha1": "48d6928e08ba5e2ca1e15d754c146580b1c8febd"
7
- },
8
- {
9
- "path": "src/assets/fonts/icomoon.ttf",
10
- "sha1": "34c4430f715233c0d8dbfa183f83cc169248329b"
11
- }
12
- ]
13
- }
@@ -1,13 +0,0 @@
1
- {
2
- "migIndex": 1,
3
- "data": [
4
- {
5
- "path": "src/assets/fonts/SourceSansPro-Regular.ttf",
6
- "sha1": "48d6928e08ba5e2ca1e15d754c146580b1c8febd"
7
- },
8
- {
9
- "path": "src/assets/fonts/icomoon.ttf",
10
- "sha1": "34c4430f715233c0d8dbfa183f83cc169248329b"
11
- }
12
- ]
13
- }
@@ -1,185 +0,0 @@
1
- import {
2
- StyleSheet,
3
- Text,
4
- View,
5
- Modal,
6
- TouchableWithoutFeedback,
7
- TouchableOpacity,
8
- useWindowDimensions,
9
- TextStyle,
10
- } from 'react-native';
11
- import React, {SetStateAction} from 'react';
12
-
13
- import {isMobileOrTablet} from 'customization-api';
14
- import hexadecimalTransparency from '../utils/hexadecimalTransparency';
15
- import PlatformWrapper from '../../src/utils/PlatformWrapper';
16
- import Spacer from './Spacer';
17
- import ThemeConfig from '../../src/theme';
18
-
19
- interface InlinePopupProps {
20
- actionMenuVisible: boolean;
21
- setActionMenuVisible: React.Dispatch<SetStateAction<boolean>>;
22
- modalPosition?: {
23
- top?: number;
24
- right?: number;
25
- left?: number;
26
- bottom?: number;
27
- };
28
- onConfirmClick: () => void;
29
- message: string;
30
- cancelLabel: string;
31
- confirmLabel: string;
32
- cancelLabelStyle?: TextStyle;
33
- confirmLabelStyle?: TextStyle;
34
- }
35
-
36
- const InlinePopup = (props: InlinePopupProps) => {
37
- const {
38
- actionMenuVisible,
39
- setActionMenuVisible,
40
- modalPosition,
41
- message,
42
- cancelLabel,
43
- confirmLabel,
44
- onConfirmClick,
45
- cancelLabelStyle = {},
46
- confirmLabelStyle = {},
47
- } = props;
48
- const {height} = useWindowDimensions();
49
- return (
50
- <View>
51
- <Modal
52
- testID="action-menu"
53
- animationType="none"
54
- transparent={true}
55
- visible={actionMenuVisible}>
56
- <TouchableWithoutFeedback
57
- onPress={() => {
58
- setActionMenuVisible(false);
59
- }}>
60
- <View
61
- style={[
62
- styles.backDrop,
63
- isMobileOrTablet()
64
- ? {
65
- backgroundColor:
66
- $config.HARD_CODED_BLACK_COLOR +
67
- hexadecimalTransparency['50%'],
68
- }
69
- : {},
70
- ]}
71
- />
72
- </TouchableWithoutFeedback>
73
- <View
74
- style={
75
- isMobileOrTablet()
76
- ? [styles.modalViewUA, {marginTop: height / 3}]
77
- : [styles.modalView, modalPosition]
78
- }>
79
- <View style={styles.container}>
80
- <Text style={styles.messageStyle}>{message}</Text>
81
- <View style={styles.btnContainer}>
82
- <PlatformWrapper>
83
- {(isHovered: boolean) => {
84
- return (
85
- <TouchableOpacity
86
- style={isHovered ? styles.onHoverBtnStyle : {}}
87
- onPress={() => setActionMenuVisible(false)}>
88
- <Text style={[styles.btnText, cancelLabelStyle]}>
89
- {cancelLabel}
90
- </Text>
91
- </TouchableOpacity>
92
- );
93
- }}
94
- </PlatformWrapper>
95
- <Spacer size={8} horizontal={true} />
96
- <PlatformWrapper>
97
- {(isHovered: boolean) => {
98
- return (
99
- <TouchableOpacity
100
- style={isHovered ? styles.onHoverBtnStyle : {}}
101
- onPress={onConfirmClick}>
102
- <Text style={[styles.btnText, confirmLabelStyle]}>
103
- {confirmLabel}
104
- </Text>
105
- </TouchableOpacity>
106
- );
107
- }}
108
- </PlatformWrapper>
109
- </View>
110
- </View>
111
- </View>
112
- </Modal>
113
- </View>
114
- );
115
- };
116
-
117
- export default InlinePopup;
118
-
119
- const styles = StyleSheet.create({
120
- onHoverBtnStyle: {
121
- backgroundColor: $config.CARD_LAYER_3_COLOR,
122
- borderRadius: 8,
123
- },
124
- container: {
125
- paddingHorizontal: 12,
126
- paddingTop: 24,
127
- paddingBottom: 14,
128
- },
129
- messageStyle: {
130
- fontFamily: ThemeConfig.FontFamily.sansPro,
131
- fontWeight: '400',
132
- fontSize: ThemeConfig.FontSize.normal,
133
- color: $config.FONT_COLOR,
134
- paddingBottom: 18,
135
- },
136
- btnText: {
137
- paddingHorizontal: 12,
138
- paddingVertical: 10,
139
- fontFamily: ThemeConfig.FontFamily.sansPro,
140
- fontWeight: '400',
141
- fontSize: ThemeConfig.FontSize.normal,
142
- color: $config.PRIMARY_ACTION_BRAND_COLOR,
143
- },
144
- btnContainer: {
145
- flexDirection: 'row',
146
- justifyContent: 'flex-end',
147
- },
148
- modalView: {
149
- position: 'absolute',
150
- width: 290,
151
- backgroundColor: $config.CARD_LAYER_4_COLOR,
152
- borderRadius: 4,
153
- shadowColor: $config.HARD_CODED_BLACK_COLOR,
154
- shadowOffset: {
155
- width: 0,
156
- height: 4,
157
- },
158
- shadowOpacity: 0.1,
159
- shadowRadius: 8,
160
- zIndex: 1,
161
- elevation: 1,
162
- },
163
- modalViewUA: {
164
- alignSelf: 'center',
165
- maxWidth: '80%',
166
- backgroundColor: $config.CARD_LAYER_4_COLOR,
167
- borderRadius: 4,
168
- shadowColor: $config.HARD_CODED_BLACK_COLOR,
169
- shadowOffset: {
170
- width: 0,
171
- height: 4,
172
- },
173
- shadowOpacity: 0.1,
174
- shadowRadius: 8,
175
- zIndex: 1,
176
- elevation: 1,
177
- },
178
- backDrop: {
179
- position: 'absolute',
180
- top: 0,
181
- bottom: 0,
182
- left: 0,
183
- right: 0,
184
- },
185
- });