agora-appbuilder-core 4.0.27 → 4.0.28-beta-2
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.
- package/package.json +2 -2
- package/template/_package-lock.json +10 -7
- package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +9 -0
- package/template/bridge/rtm/web/index.ts +44 -26
- package/template/customization-api/app-state.ts +1 -0
- package/template/customization-api/atoms.ts +8 -0
- package/template/customization-api/index.ts +1 -0
- package/template/customization-api/sub-components.ts +4 -1
- package/template/customization-api/temp.ts +1 -2
- package/template/customization-api/typeDefinition.ts +8 -0
- package/template/customization-api/types.ts +3 -0
- package/template/customization-api/utils.ts +10 -1
- package/template/defaultConfig.js +2 -2
- package/template/ios/HelloWorld.xcodeproj/project.pbxproj +102 -50
- package/template/ios/HelloWorld.xcodeproj/xcshareddata/xcschemes/ScreenSharing.xcscheme +95 -0
- package/template/ios/Podfile +1 -1
- package/template/ios/Podfile.lock +200 -44
- package/template/ios/ScreenSharing/SampleHandler.h +2 -6
- package/template/ios/ScreenSharing/SampleHandler.m +17 -48
- package/template/package-lock.json +10 -7
- package/template/package.json +1 -1
- package/template/src/AppWrapper.tsx +2 -2
- package/template/src/assets/selection.json +3491 -1
- package/template/src/atoms/ActionMenu.tsx +96 -113
- package/template/src/atoms/LinkButton.tsx +4 -3
- package/template/src/atoms/ToolbarItem.tsx +36 -22
- package/template/src/atoms/ToolbarPreset.tsx +18 -3
- package/template/src/components/Controls.tsx +72 -49
- package/template/src/components/CustomSidePanel.tsx +82 -0
- package/template/src/components/EventsConfigure.tsx +11 -27
- package/template/src/components/Navbar.tsx +51 -86
- package/template/src/components/NavbarMobile.tsx +27 -3
- package/template/src/components/PinnedVideo.tsx +9 -0
- package/template/src/components/RTMConfigure.tsx +69 -1
- package/template/src/components/Settings.tsx +6 -29
- package/template/src/components/chat/chatConfigure.native.tsx +123 -119
- package/template/src/components/chat/chatConfigure.tsx +59 -46
- package/template/src/components/chat-messages/useChatMessages.tsx +5 -4
- package/template/src/components/chat-ui/useChatUIControls.tsx +4 -1
- package/template/src/components/livestream/views/LiveStreamControls.tsx +2 -1
- package/template/src/components/participants/UserActionMenuOptions.tsx +10 -10
- package/template/src/components/virtual-background/VBButton.tsx +5 -7
- package/template/src/language/default-labels/videoCallScreenLabels.ts +9 -2
- package/template/src/language/i18nTypes.ts +1 -1
- package/template/src/pages/video-call/ActionSheet.native.tsx +110 -34
- package/template/src/pages/video-call/ActionSheet.tsx +109 -27
- package/template/src/pages/video-call/ActionSheetContent.tsx +67 -49
- package/template/src/pages/video-call/ActionSheetHandle.tsx +12 -2
- package/template/src/pages/video-call/SidePanelHeader.tsx +28 -2
- package/template/src/pages/video-call/VideoCallScreen.tsx +70 -16
- package/template/src/pages/video-call/VideoRenderer.tsx +1 -0
- package/template/src/rtm-events-api/Events.ts +37 -3
- package/template/src/rtm-events-api/LocalEvents.ts +1 -0
- package/template/src/rtm-events-api/types.ts +5 -0
- package/template/src/subComponents/ChatBubble.tsx +15 -1
- package/template/src/subComponents/ChatInput.tsx +18 -7
- package/template/src/subComponents/CopyJoinInfo.tsx +5 -13
- package/template/src/subComponents/LayoutIconButton.tsx +6 -14
- package/template/src/subComponents/LocalAudioMute.tsx +7 -11
- package/template/src/subComponents/LocalEndCall.tsx +6 -4
- package/template/src/subComponents/LocalSwitchCamera.tsx +5 -4
- package/template/src/subComponents/LocalVideoMute.tsx +10 -36
- package/template/src/subComponents/Recording.tsx +4 -10
- package/template/src/subComponents/ScreenShareNotice.tsx +3 -0
- package/template/src/subComponents/SidePanelEnum.tsx +6 -6
- package/template/src/subComponents/caption/CaptionContainer.tsx +2 -2
- package/template/src/subComponents/caption/CaptionIcon.tsx +21 -17
- package/template/src/subComponents/caption/TranscriptIcon.tsx +6 -3
- package/template/src/subComponents/chat/ChatActionMenu.tsx +3 -3
- package/template/src/subComponents/chat/ChatAttachment.tsx +107 -51
- package/template/src/subComponents/chat/ChatEmoji.tsx +8 -4
- package/template/src/subComponents/chat/ChatSendButton.tsx +52 -30
- package/template/src/subComponents/chat/ChatUploadStatus.tsx +22 -3
- package/template/src/subComponents/chat/ImagePopup.tsx +4 -4
- package/template/src/subComponents/livestream/controls/LocalRaiseHand.tsx +14 -25
- package/template/src/subComponents/screenshare/ScreenshareButton.tsx +8 -7
- package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +333 -163
- package/template/src/utils/common.tsx +22 -9
- package/template/src/utils/useEndCall.ts +6 -4
- package/template/src/utils/useFullScreen.native.ts +12 -0
- package/template/src/utils/useOrientation.tsx +46 -46
- package/template/src/utils/useSidePanel.tsx +2 -2
- package/template/src/utils/useString.ts +6 -4
|
@@ -112,89 +112,73 @@ const ChatConfigure = ({children}) => {
|
|
|
112
112
|
}
|
|
113
113
|
},
|
|
114
114
|
onMessagesReceived: (messages: ChatMessage[]) => {
|
|
115
|
-
// all types of msg
|
|
116
|
-
console.warn('on msg rcvd
|
|
117
|
-
const isGroupChat =
|
|
118
|
-
messages[0].chatType === ChatMessageChatType.GroupChat;
|
|
119
|
-
const isPeerChat =
|
|
120
|
-
messages[0].chatType === ChatMessageChatType.PeerChat;
|
|
121
|
-
const {msgId, from, body, localTime} = messages[0];
|
|
122
|
-
const chatType = body.type;
|
|
123
|
-
const fromUser = from;
|
|
124
|
-
const {file_ext, file_name, file_url, from_platform, channel} =
|
|
125
|
-
messages[0].attributes as ChatMessageAttributes;
|
|
115
|
+
// all types of msg received: text, image, video, etc.
|
|
116
|
+
console.warn('on msg rcvd: Native', messages);
|
|
126
117
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
118
|
+
messages.forEach(message => {
|
|
119
|
+
const isGroupChat =
|
|
120
|
+
message.chatType === ChatMessageChatType.GroupChat;
|
|
121
|
+
const isPeerChat =
|
|
122
|
+
message.chatType === ChatMessageChatType.PeerChat;
|
|
123
|
+
const {msgId, from, body, localTime} = message;
|
|
124
|
+
const chatType = body.type;
|
|
125
|
+
const fromUser = from;
|
|
126
|
+
const {file_ext, file_name, file_url, from_platform, channel} =
|
|
127
|
+
message.attributes as ChatMessageAttributes;
|
|
128
|
+
|
|
129
|
+
// prevent cross-channel messages
|
|
130
|
+
if (channel !== data.channel) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
131
133
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
msg: chatContent.replace(/^(\n)+|(\n)+$/g, ''),
|
|
140
|
-
createdTimestamp: localTime,
|
|
141
|
-
msgId: msgId,
|
|
142
|
-
isDeleted: false,
|
|
143
|
-
type: ChatMessageType.TXT,
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
if (isPeerChat) {
|
|
147
|
-
showMessageNotification(chatContent, fromUser, true);
|
|
148
|
-
addMessageToPrivateStore(
|
|
149
|
-
Number(fromUser),
|
|
150
|
-
{
|
|
134
|
+
switch (chatType) {
|
|
135
|
+
case ChatMessageType.TXT:
|
|
136
|
+
//@ts-ignore
|
|
137
|
+
const chatContent = body.content;
|
|
138
|
+
if (isGroupChat) {
|
|
139
|
+
showMessageNotification(chatContent, fromUser, false);
|
|
140
|
+
addMessageToStore(Number(fromUser), {
|
|
151
141
|
msg: chatContent.replace(/^(\n)+|(\n)+$/g, ''),
|
|
152
142
|
createdTimestamp: localTime,
|
|
153
143
|
msgId: msgId,
|
|
154
144
|
isDeleted: false,
|
|
155
145
|
type: ChatMessageType.TXT,
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
)
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
fromUser,
|
|
192
|
-
true,
|
|
193
|
-
ChatMessageType.IMAGE,
|
|
194
|
-
);
|
|
195
|
-
addMessageToPrivateStore(
|
|
196
|
-
Number(fromUser),
|
|
197
|
-
{
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
if (isPeerChat) {
|
|
149
|
+
showMessageNotification(chatContent, fromUser, true);
|
|
150
|
+
addMessageToPrivateStore(
|
|
151
|
+
Number(fromUser),
|
|
152
|
+
{
|
|
153
|
+
msg: chatContent.replace(/^(\n)+|(\n)+$/g, ''),
|
|
154
|
+
createdTimestamp: localTime,
|
|
155
|
+
msgId: msgId,
|
|
156
|
+
isDeleted: false,
|
|
157
|
+
type: ChatMessageType.TXT,
|
|
158
|
+
},
|
|
159
|
+
false,
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
break;
|
|
163
|
+
|
|
164
|
+
case ChatMessageType.IMAGE:
|
|
165
|
+
const thumb =
|
|
166
|
+
from_platform === 'web'
|
|
167
|
+
? file_url + '&thumbnail=true'
|
|
168
|
+
: (body as {thumbnailRemotePath?: string})
|
|
169
|
+
.thumbnailRemotePath;
|
|
170
|
+
//@ts-ignore
|
|
171
|
+
const url =
|
|
172
|
+
from_platform === 'web' ? file_url : body.remotePath;
|
|
173
|
+
console.warn('url ==>', url);
|
|
174
|
+
if (isGroupChat) {
|
|
175
|
+
showMessageNotification(
|
|
176
|
+
file_name,
|
|
177
|
+
fromUser,
|
|
178
|
+
false,
|
|
179
|
+
ChatMessageType.IMAGE,
|
|
180
|
+
);
|
|
181
|
+
addMessageToStore(Number(fromUser), {
|
|
198
182
|
msg: '',
|
|
199
183
|
createdTimestamp: localTime,
|
|
200
184
|
msgId: msgId,
|
|
@@ -203,43 +187,43 @@ const ChatConfigure = ({children}) => {
|
|
|
203
187
|
thumb: thumb,
|
|
204
188
|
url: url,
|
|
205
189
|
fileName: file_name,
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
)
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
if (isPeerChat) {
|
|
193
|
+
showMessageNotification(
|
|
194
|
+
'You got a private image message',
|
|
195
|
+
fromUser,
|
|
196
|
+
true,
|
|
197
|
+
ChatMessageType.IMAGE,
|
|
198
|
+
);
|
|
199
|
+
addMessageToPrivateStore(
|
|
200
|
+
Number(fromUser),
|
|
201
|
+
{
|
|
202
|
+
msg: '',
|
|
203
|
+
createdTimestamp: localTime,
|
|
204
|
+
msgId: msgId,
|
|
205
|
+
isDeleted: false,
|
|
206
|
+
type: ChatMessageType.IMAGE,
|
|
207
|
+
thumb: thumb,
|
|
208
|
+
url: url,
|
|
209
|
+
fileName: file_name,
|
|
210
|
+
},
|
|
211
|
+
false,
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
break;
|
|
213
215
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
msgId: msgId,
|
|
226
|
-
isDeleted: false,
|
|
227
|
-
type: ChatMessageType.FILE,
|
|
228
|
-
url: file_url,
|
|
229
|
-
ext: file_ext,
|
|
230
|
-
fileName: file_name,
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
if (isPeerChat) {
|
|
234
|
-
showMessageNotification(
|
|
235
|
-
file_name,
|
|
236
|
-
fromUser,
|
|
237
|
-
true,
|
|
238
|
-
ChatMessageType.FILE,
|
|
239
|
-
);
|
|
240
|
-
addMessageToPrivateStore(
|
|
241
|
-
Number(fromUser),
|
|
242
|
-
{
|
|
216
|
+
case ChatMessageType.FILE:
|
|
217
|
+
//@ts-ignore
|
|
218
|
+
console.warn('message', JSON.stringify(message, null, 2));
|
|
219
|
+
if (isGroupChat) {
|
|
220
|
+
showMessageNotification(
|
|
221
|
+
file_name,
|
|
222
|
+
fromUser,
|
|
223
|
+
false,
|
|
224
|
+
ChatMessageType.FILE,
|
|
225
|
+
);
|
|
226
|
+
addMessageToStore(Number(fromUser), {
|
|
243
227
|
msg: '',
|
|
244
228
|
createdTimestamp: localTime,
|
|
245
229
|
msgId: msgId,
|
|
@@ -248,13 +232,33 @@ const ChatConfigure = ({children}) => {
|
|
|
248
232
|
url: file_url,
|
|
249
233
|
ext: file_ext,
|
|
250
234
|
fileName: file_name,
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
)
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
if (isPeerChat) {
|
|
238
|
+
showMessageNotification(
|
|
239
|
+
file_name,
|
|
240
|
+
fromUser,
|
|
241
|
+
true,
|
|
242
|
+
ChatMessageType.FILE,
|
|
243
|
+
);
|
|
244
|
+
addMessageToPrivateStore(
|
|
245
|
+
Number(fromUser),
|
|
246
|
+
{
|
|
247
|
+
msg: '',
|
|
248
|
+
createdTimestamp: localTime,
|
|
249
|
+
msgId: msgId,
|
|
250
|
+
isDeleted: false,
|
|
251
|
+
type: ChatMessageType.FILE,
|
|
252
|
+
url: file_url,
|
|
253
|
+
ext: file_ext,
|
|
254
|
+
fileName: file_name,
|
|
255
|
+
},
|
|
256
|
+
false,
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
break;
|
|
260
|
+
}
|
|
261
|
+
});
|
|
258
262
|
},
|
|
259
263
|
};
|
|
260
264
|
console.warn('setup listener');
|
|
@@ -166,6 +166,7 @@ const ChatConfigure = ({children}) => {
|
|
|
166
166
|
);
|
|
167
167
|
}
|
|
168
168
|
},
|
|
169
|
+
|
|
169
170
|
onImageMessage: message => {
|
|
170
171
|
if (message?.ext?.channel !== data?.channel) {
|
|
171
172
|
return;
|
|
@@ -325,7 +326,6 @@ const ChatConfigure = ({children}) => {
|
|
|
325
326
|
) => {
|
|
326
327
|
if (connRef.current) {
|
|
327
328
|
//TODO thumb and url of actual image uploaded available in file upload complete
|
|
328
|
-
const localFileUrl = option?.ext?.file_url || '';
|
|
329
329
|
//add channel name so to prevent cross channel message mixup when same user joins two diff channels
|
|
330
330
|
// this is filtered on msgRecived event
|
|
331
331
|
option.ext = {...option?.ext, channel: data?.channel};
|
|
@@ -341,7 +341,6 @@ const ChatConfigure = ({children}) => {
|
|
|
341
341
|
option,
|
|
342
342
|
);
|
|
343
343
|
|
|
344
|
-
// update local messagre store
|
|
345
344
|
const messageData = {
|
|
346
345
|
msg: option.msg.replace(/^(\n)+|(\n)+$/g, ''),
|
|
347
346
|
createdTimestamp: timeNow(),
|
|
@@ -353,8 +352,8 @@ const ChatConfigure = ({children}) => {
|
|
|
353
352
|
ext: option?.ext?.file_ext,
|
|
354
353
|
fileName: option?.ext?.file_name,
|
|
355
354
|
};
|
|
356
|
-
|
|
357
|
-
//
|
|
355
|
+
|
|
356
|
+
// update local user message store
|
|
358
357
|
if (option.chatType === SDKChatType.SINGLE_CHAT) {
|
|
359
358
|
addMessageToPrivateStore(Number(option?.to), messageData, true);
|
|
360
359
|
} else {
|
|
@@ -418,51 +417,65 @@ const ChatConfigure = ({children}) => {
|
|
|
418
417
|
anchor.remove();
|
|
419
418
|
};
|
|
420
419
|
|
|
421
|
-
const uploadAttachment = uploadFiles => {
|
|
422
|
-
const {
|
|
423
|
-
uploadFiles;
|
|
420
|
+
const uploadAttachment = async uploadFiles => {
|
|
421
|
+
const {file_obj} = uploadFiles;
|
|
424
422
|
const CHAT_APP_KEY = `${$config.CHAT_ORG_NAME}#${$config.CHAT_APP_NAME}`;
|
|
425
|
-
const uploadObj = {
|
|
426
|
-
onFileUploadProgress: (data: ProgressEvent) => {
|
|
427
|
-
setUploadStatus(UploadStatus.IN_PROGRESS);
|
|
428
|
-
},
|
|
429
|
-
onFileUploadComplete: (data: any) => {
|
|
430
|
-
const url = `${data.uri}/${data.entities[0].uuid}?em-redirect=true&share-secret=${data.entities[0]['share-secret']}`;
|
|
431
|
-
//TODO: handle for multiple uploads
|
|
432
|
-
setUploadedFiles(prev => {
|
|
433
|
-
return [{...prev[0], file_url: url}];
|
|
434
|
-
});
|
|
435
|
-
setUploadStatus(UploadStatus.SUCCESS);
|
|
436
|
-
},
|
|
437
|
-
onFileUploadError: (error: any) => {
|
|
438
|
-
logger.error(
|
|
439
|
-
LogSource.Internals,
|
|
440
|
-
'CHAT',
|
|
441
|
-
'Attachment upload failed',
|
|
442
|
-
error,
|
|
443
|
-
);
|
|
444
|
-
setUploadStatus(UploadStatus.FAILURE);
|
|
445
|
-
},
|
|
446
|
-
onFileUploadCanceled: () => {
|
|
447
|
-
//setUploadStatus(UploadStatus.NOT_STARTED);
|
|
448
|
-
},
|
|
449
|
-
accessToken: data?.chat?.user_token,
|
|
450
|
-
appKey: CHAT_APP_KEY,
|
|
451
|
-
file: file_obj,
|
|
452
|
-
apiUrl: $config.CHAT_URL,
|
|
453
|
-
};
|
|
454
423
|
|
|
455
|
-
|
|
424
|
+
return new Promise((resolve, reject) => {
|
|
425
|
+
const uploadObj = {
|
|
426
|
+
onFileUploadProgress: (data: ProgressEvent) => {
|
|
427
|
+
setUploadedFiles(prev => {
|
|
428
|
+
const updatedFiles = [...prev];
|
|
429
|
+
updatedFiles[updatedFiles.length - 1] = {
|
|
430
|
+
...updatedFiles[updatedFiles.length - 1],
|
|
431
|
+
upload_status: UploadStatus.IN_PROGRESS,
|
|
432
|
+
};
|
|
433
|
+
return updatedFiles;
|
|
434
|
+
});
|
|
435
|
+
},
|
|
436
|
+
onFileUploadComplete: (data: any) => {
|
|
437
|
+
const url = `${data.uri}/${data.entities[0].uuid}?em-redirect=true&share-secret=${data.entities[0]['share-secret']}`;
|
|
438
|
+
|
|
439
|
+
setUploadedFiles(prev => {
|
|
440
|
+
const updatedFiles = [...prev];
|
|
441
|
+
updatedFiles[updatedFiles.length - 1] = {
|
|
442
|
+
...updatedFiles[updatedFiles.length - 1],
|
|
443
|
+
file_url: url,
|
|
444
|
+
upload_status: UploadStatus.SUCCESS,
|
|
445
|
+
};
|
|
446
|
+
return updatedFiles;
|
|
447
|
+
});
|
|
448
|
+
resolve(url);
|
|
449
|
+
},
|
|
450
|
+
onFileUploadError: (error: any) => {
|
|
451
|
+
logger.error(
|
|
452
|
+
LogSource.Internals,
|
|
453
|
+
'CHAT',
|
|
454
|
+
'Attachment upload failed',
|
|
455
|
+
error,
|
|
456
|
+
);
|
|
457
|
+
//setUploadStatus(UploadStatus.FAILURE);
|
|
458
|
+
setUploadedFiles(prev => {
|
|
459
|
+
const updatedFiles = [...prev];
|
|
460
|
+
updatedFiles[updatedFiles.length - 1] = {
|
|
461
|
+
...updatedFiles[updatedFiles.length - 1],
|
|
462
|
+
upload_status: UploadStatus.FAILURE,
|
|
463
|
+
};
|
|
464
|
+
return updatedFiles;
|
|
465
|
+
});
|
|
466
|
+
reject(error);
|
|
467
|
+
},
|
|
468
|
+
onFileUploadCanceled: () => {
|
|
469
|
+
//setUploadStatus(UploadStatus.NOT_STARTED);
|
|
470
|
+
},
|
|
471
|
+
accessToken: data?.chat?.user_token,
|
|
472
|
+
appKey: CHAT_APP_KEY,
|
|
473
|
+
file: file_obj,
|
|
474
|
+
apiUrl: $config.CHAT_URL,
|
|
475
|
+
};
|
|
476
|
+
|
|
456
477
|
AgoraChat.utils.uploadFile(uploadObj);
|
|
457
|
-
}
|
|
458
|
-
logger.debug(
|
|
459
|
-
LogSource.Internals,
|
|
460
|
-
'CHAT',
|
|
461
|
-
'Attachment upload failed',
|
|
462
|
-
error,
|
|
463
|
-
);
|
|
464
|
-
console.error(error);
|
|
465
|
-
}
|
|
478
|
+
});
|
|
466
479
|
};
|
|
467
480
|
|
|
468
481
|
const deleteAttachment = (
|
|
@@ -111,11 +111,12 @@ export interface ChatOption {
|
|
|
111
111
|
msg?: string;
|
|
112
112
|
file?: object;
|
|
113
113
|
ext?: {
|
|
114
|
-
file_length
|
|
115
|
-
file_ext
|
|
116
|
-
file_name
|
|
117
|
-
file_url
|
|
114
|
+
file_length?: number;
|
|
115
|
+
file_ext?: string;
|
|
116
|
+
file_name?: string;
|
|
117
|
+
file_url?: string;
|
|
118
118
|
from_platform?: string;
|
|
119
|
+
channel?: string;
|
|
119
120
|
};
|
|
120
121
|
url?: string;
|
|
121
122
|
}
|
|
@@ -28,12 +28,14 @@ export enum UploadStatus {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export interface File {
|
|
31
|
+
file_id: string;
|
|
31
32
|
file_length: number;
|
|
32
33
|
file_ext: string;
|
|
33
34
|
file_url: string;
|
|
34
35
|
file_name: string;
|
|
35
36
|
file_type: string;
|
|
36
37
|
file_obj: object;
|
|
38
|
+
upload_status: UploadStatus;
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
export interface ChatUIControlsInterface {
|
|
@@ -49,7 +51,7 @@ export interface ChatUIControlsInterface {
|
|
|
49
51
|
setInputHeight: React.Dispatch<SetStateAction<number>>;
|
|
50
52
|
showEmojiPicker: boolean;
|
|
51
53
|
setShowEmojiPicker: React.Dispatch<SetStateAction<boolean>>;
|
|
52
|
-
uploadStatus: UploadStatus;
|
|
54
|
+
uploadStatus: UploadStatus; // for mobile, where only one attchment per message sent
|
|
53
55
|
setUploadStatus: React.Dispatch<SetStateAction<UploadStatus>>;
|
|
54
56
|
uploadedFiles: File[];
|
|
55
57
|
setUploadedFiles: React.Dispatch<SetStateAction<File[]>>;
|
|
@@ -83,6 +85,7 @@ export const MAX_HEIGHT = 92;
|
|
|
83
85
|
export const LINE_HEIGHT = 17;
|
|
84
86
|
export const MAX_UPLOAD_SIZE = 10; //MB
|
|
85
87
|
export const MAX_TEXT_MESSAGE_SIZE = 5; //KB
|
|
88
|
+
export const MAX_FILES_UPLOAD = 5;
|
|
86
89
|
|
|
87
90
|
const ChatUIControlsProvider = (props: ChatUIControlsProviderProps) => {
|
|
88
91
|
const [chatType, setChatType] = useState<ChatType>(ChatType.Group);
|
|
@@ -16,6 +16,7 @@ import ToolbarItem from '../../../atoms/ToolbarItem';
|
|
|
16
16
|
export interface LiveStreamControlsProps {
|
|
17
17
|
showControls: boolean;
|
|
18
18
|
showLabel?: boolean;
|
|
19
|
+
customProps?: any;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
const LiveStreamControls = (props: LiveStreamControlsProps) => {
|
|
@@ -24,7 +25,7 @@ const LiveStreamControls = (props: LiveStreamControlsProps) => {
|
|
|
24
25
|
if (!showControls) return <></>;
|
|
25
26
|
return (
|
|
26
27
|
<>
|
|
27
|
-
<ToolbarItem>
|
|
28
|
+
<ToolbarItem toolbarProps={props?.customProps}>
|
|
28
29
|
<LocalRaiseHand />
|
|
29
30
|
</ToolbarItem>
|
|
30
31
|
</>
|
|
@@ -172,7 +172,7 @@ export default function UserActionMenuOptionsOptions(
|
|
|
172
172
|
: user.uid === getWhiteboardUid()
|
|
173
173
|
? viewWhiteboardLabel
|
|
174
174
|
: viewInLargeLabel,
|
|
175
|
-
|
|
175
|
+
onPress: () => {
|
|
176
176
|
setActionMenuVisible(false);
|
|
177
177
|
dispatch({
|
|
178
178
|
type: 'UserPin',
|
|
@@ -196,7 +196,7 @@ export default function UserActionMenuOptionsOptions(
|
|
|
196
196
|
? removeFromTopLabel
|
|
197
197
|
: pinToTopLabel
|
|
198
198
|
: pinToTopLabel,
|
|
199
|
-
|
|
199
|
+
onPress: () => {
|
|
200
200
|
setActionMenuVisible(false);
|
|
201
201
|
dispatch({
|
|
202
202
|
type: 'UserSecondaryPin',
|
|
@@ -226,7 +226,7 @@ export default function UserActionMenuOptionsOptions(
|
|
|
226
226
|
iconColor: $config.SECONDARY_ACTION_COLOR,
|
|
227
227
|
textColor: $config.SECONDARY_ACTION_COLOR,
|
|
228
228
|
title: messagePrivatelyLabel,
|
|
229
|
-
|
|
229
|
+
onPress: () => {
|
|
230
230
|
setActionMenuVisible(false);
|
|
231
231
|
openPrivateChat(user.uid);
|
|
232
232
|
},
|
|
@@ -257,7 +257,7 @@ export default function UserActionMenuOptionsOptions(
|
|
|
257
257
|
iconColor: $config.SECONDARY_ACTION_COLOR,
|
|
258
258
|
textColor: $config.SECONDARY_ACTION_COLOR,
|
|
259
259
|
title: audioLabel(user.audio),
|
|
260
|
-
|
|
260
|
+
onPress: () => {
|
|
261
261
|
setActionMenuVisible(false);
|
|
262
262
|
user.audio
|
|
263
263
|
? setShowAudioMuteModal(true)
|
|
@@ -271,7 +271,7 @@ export default function UserActionMenuOptionsOptions(
|
|
|
271
271
|
iconColor: $config.SECONDARY_ACTION_COLOR,
|
|
272
272
|
textColor: $config.SECONDARY_ACTION_COLOR,
|
|
273
273
|
title: videoLabel(user.video),
|
|
274
|
-
|
|
274
|
+
onPress: () => {
|
|
275
275
|
setActionMenuVisible(false);
|
|
276
276
|
user.video
|
|
277
277
|
? setShowVideoMuteModal(true)
|
|
@@ -295,7 +295,7 @@ export default function UserActionMenuOptionsOptions(
|
|
|
295
295
|
iconColor: $config.SECONDARY_ACTION_COLOR,
|
|
296
296
|
textColor: $config.SECONDARY_ACTION_COLOR,
|
|
297
297
|
title: addAsPresenterLabel,
|
|
298
|
-
|
|
298
|
+
onPress: () => {
|
|
299
299
|
setActionMenuVisible(false);
|
|
300
300
|
promoteAudienceAsCoHost(user.uid);
|
|
301
301
|
},
|
|
@@ -314,7 +314,7 @@ export default function UserActionMenuOptionsOptions(
|
|
|
314
314
|
iconColor: $config.SECONDARY_ACTION_COLOR,
|
|
315
315
|
textColor: $config.SECONDARY_ACTION_COLOR,
|
|
316
316
|
title: removeAsPresenterLabel,
|
|
317
|
-
|
|
317
|
+
onPress: () => {
|
|
318
318
|
setActionMenuVisible(false);
|
|
319
319
|
events.send(
|
|
320
320
|
LiveStreamControlMessageEnum.raiseHandRequestRejected,
|
|
@@ -332,7 +332,7 @@ export default function UserActionMenuOptionsOptions(
|
|
|
332
332
|
iconColor: $config.SEMANTIC_ERROR,
|
|
333
333
|
textColor: $config.SEMANTIC_ERROR,
|
|
334
334
|
title: removeFromRoomLabel,
|
|
335
|
-
|
|
335
|
+
onPress: () => {
|
|
336
336
|
setActionMenuVisible(false);
|
|
337
337
|
setRemoveMeetingPopupVisible(true);
|
|
338
338
|
},
|
|
@@ -350,7 +350,7 @@ export default function UserActionMenuOptionsOptions(
|
|
|
350
350
|
iconColor: $config.SECONDARY_ACTION_COLOR,
|
|
351
351
|
textColor: $config.SECONDARY_ACTION_COLOR,
|
|
352
352
|
title: changeNameLabel,
|
|
353
|
-
|
|
353
|
+
onPress: () => {
|
|
354
354
|
setFocus(prevState => {
|
|
355
355
|
return {
|
|
356
356
|
...prevState,
|
|
@@ -376,7 +376,7 @@ export default function UserActionMenuOptionsOptions(
|
|
|
376
376
|
localuid === user?.parentUid
|
|
377
377
|
? stopScreenShareLabel
|
|
378
378
|
: removeScreenShareLabel,
|
|
379
|
-
|
|
379
|
+
onPress: () => {
|
|
380
380
|
setActionMenuVisible(false);
|
|
381
381
|
//for local user directly stop the screenshare
|
|
382
382
|
if (localuid === user.parentUid) {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {StyleSheet, Text, View} from 'react-native';
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import {ToolbarItem} from 'customization-api';
|
|
4
2
|
import ToolbarMenuItem from '../../atoms/ToolbarMenuItem';
|
|
5
3
|
import {useToolbarMenu} from '../../utils/useMenu';
|
|
6
4
|
import IconButton, {IconButtonProps} from '../../atoms/IconButton';
|
|
7
5
|
import {useActionSheet} from '../../utils/useActionSheet';
|
|
8
6
|
import {useString} from '../../utils/useString';
|
|
9
7
|
import {toolbarItemVirtualBackgroundText} from '../../language/default-labels/videoCallScreenLabels';
|
|
8
|
+
import {useToolbarProps} from '../../atoms/ToolbarItem';
|
|
10
9
|
|
|
11
10
|
interface VBButtonProps {
|
|
12
11
|
isVBOpen: boolean;
|
|
@@ -16,7 +15,8 @@ interface VBButtonProps {
|
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
const VBButton = (props: VBButtonProps) => {
|
|
19
|
-
const {
|
|
18
|
+
const {label = null, onPress: onPressCustom = null} = useToolbarProps();
|
|
19
|
+
const {setIsVBOpen, showLabel = false} = props;
|
|
20
20
|
const {isToolbarMenuItem} = useToolbarMenu();
|
|
21
21
|
const {isOnActionSheet} = useActionSheet();
|
|
22
22
|
const vbLabel = useString(toolbarItemVirtualBackgroundText)();
|
|
@@ -26,14 +26,14 @@ const VBButton = (props: VBButtonProps) => {
|
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
let iconButtonProps: IconButtonProps = {
|
|
29
|
-
onPress: onPress,
|
|
29
|
+
onPress: onPressCustom || onPress,
|
|
30
30
|
iconProps: {
|
|
31
31
|
tintColor: $config.SECONDARY_ACTION_COLOR,
|
|
32
32
|
name: 'vb',
|
|
33
33
|
},
|
|
34
34
|
|
|
35
35
|
btnTextProps: {
|
|
36
|
-
text: showLabel ? vbLabel?.replace(' ', '\n') : '',
|
|
36
|
+
text: showLabel ? label || vbLabel?.replace(' ', '\n') : '',
|
|
37
37
|
numberOfLines: 2,
|
|
38
38
|
textStyle: {
|
|
39
39
|
marginTop: 8,
|
|
@@ -60,5 +60,3 @@ const VBButton = (props: VBButtonProps) => {
|
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
export default VBButton;
|
|
63
|
-
|
|
64
|
-
const styles = StyleSheet.create({});
|
|
@@ -65,6 +65,10 @@ export interface I18nRequestConfirmation {
|
|
|
65
65
|
name: string;
|
|
66
66
|
type: I18nMuteType;
|
|
67
67
|
}
|
|
68
|
+
export interface I18nFileSize {
|
|
69
|
+
name: string;
|
|
70
|
+
size: number;
|
|
71
|
+
}
|
|
68
72
|
export interface I18nMuteConfirmation {
|
|
69
73
|
name: string;
|
|
70
74
|
type: I18nMuteType;
|
|
@@ -239,6 +243,7 @@ export const chatPrivateMessageDeletePopupText =
|
|
|
239
243
|
'chatPrivateMessageDeletePopupText';
|
|
240
244
|
export const chatUploadStatusInProgress = 'chatUploadStatusInProgress';
|
|
241
245
|
export const chatUploadStatusFailure = 'chatUploadStatusFailure';
|
|
246
|
+
export const chatUploadMaxLimit = 'chatUploadMaxLimit';
|
|
242
247
|
|
|
243
248
|
export const peoplePanelTurnoffAllCameraBtnText =
|
|
244
249
|
'peoplePanelTurnoffAllCameraBtnText';
|
|
@@ -651,6 +656,7 @@ export interface I18nVideoCallScreenLabelsInterface {
|
|
|
651
656
|
[chatUploadErrorFileTypeToastSubHeading]?: I18nBaseType;
|
|
652
657
|
[chatUploadStatusInProgress]?: I18nBaseType;
|
|
653
658
|
[chatUploadStatusFailure]?: I18nBaseType;
|
|
659
|
+
[chatUploadMaxLimit]?: I18nBaseType;
|
|
654
660
|
|
|
655
661
|
[peoplePanelTurnoffAllCameraBtnText]?: I18nBaseType;
|
|
656
662
|
[peoplePanelMuteAllMicBtnText]?: I18nBaseType;
|
|
@@ -1037,13 +1043,14 @@ export const VideoCallScreenLabels: I18nVideoCallScreenLabelsInterface = {
|
|
|
1037
1043
|
[chatUploadErrorToastHeading]: 'Attachment Upload Error',
|
|
1038
1044
|
[chatUploadErrorFileSizeToastHeading]: 'File size is too large',
|
|
1039
1045
|
[chatSendErrorTextSizeToastHeading]: 'Text size is too large',
|
|
1040
|
-
[chatUploadErrorFileSizeToastSubHeading]: size =>
|
|
1041
|
-
`
|
|
1046
|
+
[chatUploadErrorFileSizeToastSubHeading]: (size, fileName) =>
|
|
1047
|
+
` ${fileName} exceeds ${size}MB size limit`,
|
|
1042
1048
|
[chatSendErrorTextSizeToastSubHeading]: size =>
|
|
1043
1049
|
`You can send text message upto ${size}KB in size`,
|
|
1044
1050
|
[chatUploadErrorFileTypeToastSubHeading]: type => `${type} is not supported`,
|
|
1045
1051
|
[chatUploadStatusInProgress]: `Uploading... Please wait`,
|
|
1046
1052
|
[chatUploadStatusFailure]: `Something went wrong while sharing.Let'as try again`,
|
|
1053
|
+
[chatUploadMaxLimit]: `Up to 5 files can be uploaded at a time`,
|
|
1047
1054
|
[chatMessageDeleteConfirmBtnText]: `Delete`,
|
|
1048
1055
|
[chatPublicMessageDeletePopupText]: `Are you sure you want to delete this message for everyone in the public chat? `,
|
|
1049
1056
|
[chatPrivateMessageDeletePopupText]: (name: string) =>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {TextDataInterface} from './default-labels/index';
|
|
2
2
|
|
|
3
|
-
export type I18nBaseType<T = any> = string | ((
|
|
3
|
+
export type I18nBaseType<T = any> = string | ((...args: T[]) => string);
|
|
4
4
|
export type I18nDynamicType = I18nBaseType<string>;
|
|
5
5
|
export type I18nConditionalType = I18nBaseType<boolean>;
|
|
6
6
|
export interface I18nInterface {
|