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
|
@@ -188,6 +188,32 @@ export const VBHeader = () => {
|
|
|
188
188
|
);
|
|
189
189
|
};
|
|
190
190
|
|
|
191
|
+
export const CustomSidePanelHeader = (props: {
|
|
192
|
+
title: string;
|
|
193
|
+
onClose?: () => void;
|
|
194
|
+
name: string;
|
|
195
|
+
}) => {
|
|
196
|
+
const {setSidePanel} = useSidePanel();
|
|
197
|
+
return (
|
|
198
|
+
<SidePanelHeader
|
|
199
|
+
centerComponent={
|
|
200
|
+
<Text style={SidePanelStyles.heading}>{props?.title}</Text>
|
|
201
|
+
}
|
|
202
|
+
trailingIconName="close"
|
|
203
|
+
trailingIconOnPress={() => {
|
|
204
|
+
setSidePanel(SidePanelType.None);
|
|
205
|
+
try {
|
|
206
|
+
props?.onClose && props?.onClose();
|
|
207
|
+
} catch (error) {
|
|
208
|
+
console.error(
|
|
209
|
+
`Error on calling onClose in custom side panel ${name}`,
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
}}
|
|
213
|
+
/>
|
|
214
|
+
);
|
|
215
|
+
};
|
|
216
|
+
|
|
191
217
|
export const TranscriptHeader = props => {
|
|
192
218
|
const {setSidePanel} = useSidePanel();
|
|
193
219
|
const moreIconRef = React.useRef<View>(null);
|
|
@@ -255,7 +281,7 @@ const TranscriptHeaderActionMenu = (props: TranscriptHeaderActionMenuProps) => {
|
|
|
255
281
|
textColor: $config.FONT_COLOR,
|
|
256
282
|
title: changeSpokenLanguage + ' ',
|
|
257
283
|
disabled: isLangChangeInProgress,
|
|
258
|
-
|
|
284
|
+
onPress: () => {
|
|
259
285
|
setActionMenuVisible(false);
|
|
260
286
|
setLanguagePopup(true);
|
|
261
287
|
},
|
|
@@ -267,7 +293,7 @@ const TranscriptHeaderActionMenu = (props: TranscriptHeaderActionMenuProps) => {
|
|
|
267
293
|
textColor: $config.FONT_COLOR,
|
|
268
294
|
title: downloadTranscriptLabel,
|
|
269
295
|
disabled: meetingTranscript.length === 0,
|
|
270
|
-
|
|
296
|
+
onPress: () => {
|
|
271
297
|
downloadTranscript();
|
|
272
298
|
setActionMenuVisible(false);
|
|
273
299
|
},
|
|
@@ -26,7 +26,12 @@ import {videoView} from '../../../theme.json';
|
|
|
26
26
|
import {ToolbarProvider, ToolbarPosition} from '../../utils/useToolbar';
|
|
27
27
|
import SDKEvents from '../../utils/SdkEvents';
|
|
28
28
|
import {useRoomInfo} from '../../components/room-info/useRoomInfo';
|
|
29
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
controlMessageEnum,
|
|
31
|
+
SidePanelItem,
|
|
32
|
+
useCaption,
|
|
33
|
+
useUserName,
|
|
34
|
+
} from 'customization-api';
|
|
30
35
|
import events, {PersistanceLevel} from '../../rtm-events-api';
|
|
31
36
|
import VideoCallMobileView from './VideoCallMobileView';
|
|
32
37
|
import CaptionContainer from '../../subComponents/caption/CaptionContainer';
|
|
@@ -47,16 +52,16 @@ import VBPanel, {
|
|
|
47
52
|
} from '../../components/virtual-background/VBPanel';
|
|
48
53
|
import {LogSource, logger} from '../../logger/AppBuilderLogger';
|
|
49
54
|
import {useIsRecordingBot} from '../../subComponents/recording/useIsRecordingBot';
|
|
50
|
-
import {
|
|
51
|
-
|
|
52
|
-
ToolbarLeftPresetProps,
|
|
53
|
-
ToolbarRightPresetProps,
|
|
54
|
-
ToolbarTopPresetProps,
|
|
55
|
-
} from 'src/atoms/ToolbarPreset';
|
|
55
|
+
import {ToolbarPresetProps} from '../../atoms/ToolbarPreset';
|
|
56
|
+
import CustomSidePanelView from '../../components/CustomSidePanel';
|
|
56
57
|
|
|
57
58
|
const VideoCallScreen = () => {
|
|
58
59
|
useFindActiveSpeaker();
|
|
59
60
|
const {sidePanel} = useSidePanel();
|
|
61
|
+
const [showCustomSidePanel, setShowCustomSidePanel] = useState(false);
|
|
62
|
+
const [customSidePanelIndex, setCustomSidePanelIndex] = useState<
|
|
63
|
+
undefined | number
|
|
64
|
+
>(undefined);
|
|
60
65
|
const [name] = useUserName();
|
|
61
66
|
const {
|
|
62
67
|
data: {meetingTitle, isHost},
|
|
@@ -81,6 +86,7 @@ const VideoCallScreen = () => {
|
|
|
81
86
|
LeftbarProps,
|
|
82
87
|
RightbarProps,
|
|
83
88
|
VideocallWrapper,
|
|
89
|
+
SidePanelArray,
|
|
84
90
|
} = useCustomization(data => {
|
|
85
91
|
let components: {
|
|
86
92
|
VideocallWrapper: React.ComponentType;
|
|
@@ -97,10 +103,11 @@ const VideoCallScreen = () => {
|
|
|
97
103
|
VideocallAfterView: React.ComponentType;
|
|
98
104
|
LeftbarComponent: React.ComponentType<LeftbarPropsInterface>;
|
|
99
105
|
RightbarComponent: React.ComponentType<RightbarInterface>;
|
|
100
|
-
BottombarProps?:
|
|
101
|
-
TopbarProps?:
|
|
102
|
-
LeftbarProps?:
|
|
103
|
-
RightbarProps?:
|
|
106
|
+
BottombarProps?: ToolbarPresetProps['items'];
|
|
107
|
+
TopbarProps?: ToolbarPresetProps['items'];
|
|
108
|
+
LeftbarProps?: ToolbarPresetProps['items'];
|
|
109
|
+
RightbarProps?: ToolbarPresetProps['items'];
|
|
110
|
+
SidePanelArray?: SidePanelItem[];
|
|
104
111
|
} = {
|
|
105
112
|
BottombarComponent: Controls,
|
|
106
113
|
TopbarComponent: Navbar,
|
|
@@ -119,6 +126,7 @@ const VideoCallScreen = () => {
|
|
|
119
126
|
TopbarProps: {},
|
|
120
127
|
LeftbarProps: {},
|
|
121
128
|
RightbarProps: {},
|
|
129
|
+
SidePanelArray: [],
|
|
122
130
|
};
|
|
123
131
|
if (
|
|
124
132
|
data?.components?.videoCall &&
|
|
@@ -265,6 +273,14 @@ const VideoCallScreen = () => {
|
|
|
265
273
|
components.VideocallWrapper = data?.components?.videoCall.wrapper;
|
|
266
274
|
}
|
|
267
275
|
|
|
276
|
+
if (
|
|
277
|
+
data?.components?.videoCall.customSidePanel &&
|
|
278
|
+
typeof data?.components?.videoCall.customSidePanel === 'function'
|
|
279
|
+
) {
|
|
280
|
+
components.SidePanelArray =
|
|
281
|
+
data?.components?.videoCall?.customSidePanel();
|
|
282
|
+
}
|
|
283
|
+
|
|
268
284
|
// commented for v1 release
|
|
269
285
|
// if (
|
|
270
286
|
// data?.components?.videoCall.settingsPanel &&
|
|
@@ -280,7 +296,6 @@ const VideoCallScreen = () => {
|
|
|
280
296
|
});
|
|
281
297
|
|
|
282
298
|
const isDesktop = useIsDesktop();
|
|
283
|
-
const isSmall = useIsSmall();
|
|
284
299
|
|
|
285
300
|
useEffect(() => {
|
|
286
301
|
logger.log(
|
|
@@ -289,6 +304,24 @@ const VideoCallScreen = () => {
|
|
|
289
304
|
'User has landed on video call room',
|
|
290
305
|
);
|
|
291
306
|
}, []);
|
|
307
|
+
|
|
308
|
+
useEffect(() => {
|
|
309
|
+
const selectedIndex = SidePanelArray?.findIndex(item => {
|
|
310
|
+
if (item?.name === sidePanel && item?.component) {
|
|
311
|
+
return true;
|
|
312
|
+
} else {
|
|
313
|
+
return false;
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
if (selectedIndex < 0) {
|
|
317
|
+
setShowCustomSidePanel(false);
|
|
318
|
+
setCustomSidePanelIndex(undefined);
|
|
319
|
+
} else {
|
|
320
|
+
setShowCustomSidePanel(true);
|
|
321
|
+
setCustomSidePanelIndex(selectedIndex);
|
|
322
|
+
}
|
|
323
|
+
}, [sidePanel, SidePanelArray]);
|
|
324
|
+
|
|
292
325
|
const {isRecordingBot, recordingBotUIConfig} = useIsRecordingBot();
|
|
293
326
|
|
|
294
327
|
return VideocallComponent ? (
|
|
@@ -305,7 +338,7 @@ const VideoCallScreen = () => {
|
|
|
305
338
|
<View
|
|
306
339
|
style={$config.ICON_TEXT ? style.fullRow : style.fullRowWithoutIcon}>
|
|
307
340
|
<ToolbarProvider value={{position: ToolbarPosition.left}}>
|
|
308
|
-
{LeftbarProps?.length ? (
|
|
341
|
+
{Object.keys(LeftbarProps)?.length ? (
|
|
309
342
|
<LeftbarComponent
|
|
310
343
|
items={LeftbarProps}
|
|
311
344
|
includeDefaultItems={false}
|
|
@@ -322,7 +355,7 @@ const VideoCallScreen = () => {
|
|
|
322
355
|
style.zeroHeight
|
|
323
356
|
}>
|
|
324
357
|
<ToolbarProvider value={{position: ToolbarPosition.top}}>
|
|
325
|
-
{TopbarProps?.length ? (
|
|
358
|
+
{Object.keys(TopbarProps)?.length ? (
|
|
326
359
|
<TopbarComponent
|
|
327
360
|
items={TopbarProps}
|
|
328
361
|
includeDefaultItems={false}
|
|
@@ -344,6 +377,27 @@ const VideoCallScreen = () => {
|
|
|
344
377
|
: {marginVertical: 20},
|
|
345
378
|
]}>
|
|
346
379
|
<VideoComponent />
|
|
380
|
+
{/**
|
|
381
|
+
* To display custom side panel
|
|
382
|
+
* it will be shown when customer inject the custom side panel content
|
|
383
|
+
* and call setSidePanel using the name they given
|
|
384
|
+
*/}
|
|
385
|
+
{showCustomSidePanel && customSidePanelIndex !== undefined ? (
|
|
386
|
+
SidePanelArray &&
|
|
387
|
+
SidePanelArray?.length &&
|
|
388
|
+
SidePanelArray[customSidePanelIndex]?.component ? (
|
|
389
|
+
<CustomSidePanelView
|
|
390
|
+
content={SidePanelArray[customSidePanelIndex]?.component}
|
|
391
|
+
title={SidePanelArray[customSidePanelIndex]?.title}
|
|
392
|
+
name={SidePanelArray[customSidePanelIndex]?.name}
|
|
393
|
+
onClose={SidePanelArray[customSidePanelIndex]?.onClose}
|
|
394
|
+
/>
|
|
395
|
+
) : (
|
|
396
|
+
<></>
|
|
397
|
+
)
|
|
398
|
+
) : (
|
|
399
|
+
<></>
|
|
400
|
+
)}
|
|
347
401
|
{sidePanel === SidePanelType.Participants ? (
|
|
348
402
|
<ParticipantsComponent />
|
|
349
403
|
) : (
|
|
@@ -382,7 +436,7 @@ const VideoCallScreen = () => {
|
|
|
382
436
|
<></>
|
|
383
437
|
) : (
|
|
384
438
|
<ToolbarProvider value={{position: ToolbarPosition.bottom}}>
|
|
385
|
-
{BottombarProps?.length ? (
|
|
439
|
+
{Object.keys(BottombarProps)?.length ? (
|
|
386
440
|
<BottombarComponent
|
|
387
441
|
items={BottombarProps}
|
|
388
442
|
includeDefaultItems={false}
|
|
@@ -405,7 +459,7 @@ const VideoCallScreen = () => {
|
|
|
405
459
|
)}
|
|
406
460
|
</View>
|
|
407
461
|
<ToolbarProvider value={{position: ToolbarPosition.right}}>
|
|
408
|
-
{RightbarProps?.length ? (
|
|
462
|
+
{Object.keys(RightbarProps)?.length ? (
|
|
409
463
|
<RightbarComponent
|
|
410
464
|
items={RightbarProps}
|
|
411
465
|
includeDefaultItems={false}
|
|
@@ -217,6 +217,7 @@ const VideoRenderer: React.FC<VideoRendererProps> = ({
|
|
|
217
217
|
{(enableExpandButton &&
|
|
218
218
|
screenShareData &&
|
|
219
219
|
screenShareData?.[user.uid] &&
|
|
220
|
+
user.uid !== rtcProps?.screenShareUid &&
|
|
220
221
|
isMobileUA()) ||
|
|
221
222
|
(isMobileUA() && enableExpandButton && user?.type == 'whiteboard') ? (
|
|
222
223
|
<IconButton
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
EventCallback,
|
|
20
20
|
EventSource,
|
|
21
21
|
PersistanceLevel,
|
|
22
|
+
RTMAttributePayload,
|
|
22
23
|
} from './types';
|
|
23
24
|
import {adjustUID} from '../rtm/utils';
|
|
24
25
|
import {LogSource, logger} from '../logger/AppBuilderLogger';
|
|
@@ -98,7 +99,10 @@ class Events {
|
|
|
98
99
|
* @param {ReceiverUid} toUid uid or uids[] of user
|
|
99
100
|
* @api private
|
|
100
101
|
*/
|
|
101
|
-
private _send = async (
|
|
102
|
+
private _send = async (
|
|
103
|
+
rtmPayload: RTMAttributePayload,
|
|
104
|
+
toUid?: ReceiverUid,
|
|
105
|
+
) => {
|
|
102
106
|
const to = typeof toUid == 'string' ? parseInt(toUid) : toUid;
|
|
103
107
|
const rtmEngine: RtmEngine = RTMEngine.getInstance().engine;
|
|
104
108
|
|
|
@@ -180,6 +184,32 @@ class Events {
|
|
|
180
184
|
}
|
|
181
185
|
};
|
|
182
186
|
|
|
187
|
+
private _sendAsChannelAttribute = async (rtmPayload: RTMAttributePayload) => {
|
|
188
|
+
// Case 1: send to channel
|
|
189
|
+
logger.debug(
|
|
190
|
+
LogSource.Events,
|
|
191
|
+
'CUSTOM_EVENTS',
|
|
192
|
+
'updating channel attributes',
|
|
193
|
+
);
|
|
194
|
+
try {
|
|
195
|
+
const rtmEngine: RtmEngine = RTMEngine.getInstance().engine;
|
|
196
|
+
const channelId = RTMEngine.getInstance().channelUid;
|
|
197
|
+
const rtmAttribute = [{key: rtmPayload.evt, value: rtmPayload.value}];
|
|
198
|
+
// Step 1: Call RTM API to update local attributes
|
|
199
|
+
await rtmEngine.addOrUpdateChannelAttributes(channelId, rtmAttribute, {
|
|
200
|
+
enableNotificationToChannelMembers: true,
|
|
201
|
+
});
|
|
202
|
+
} catch (error) {
|
|
203
|
+
logger.error(
|
|
204
|
+
LogSource.Events,
|
|
205
|
+
'CUSTOM_EVENTS',
|
|
206
|
+
'updating channel attributes error',
|
|
207
|
+
error,
|
|
208
|
+
);
|
|
209
|
+
throw error;
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
|
|
183
213
|
/**
|
|
184
214
|
* Listen on a new event by eventName and listener.
|
|
185
215
|
* When the specified event happens, the Events API triggers the callback that you pass.
|
|
@@ -275,7 +305,7 @@ class Events {
|
|
|
275
305
|
source: this.source,
|
|
276
306
|
});
|
|
277
307
|
|
|
278
|
-
const rtmPayload = {
|
|
308
|
+
const rtmPayload: RTMAttributePayload = {
|
|
279
309
|
evt: eventName,
|
|
280
310
|
value: persistValue,
|
|
281
311
|
};
|
|
@@ -297,7 +327,11 @@ class Events {
|
|
|
297
327
|
`sending event -> ${eventName}`,
|
|
298
328
|
persistValue,
|
|
299
329
|
);
|
|
300
|
-
|
|
330
|
+
if (persistLevel === PersistanceLevel.Channel) {
|
|
331
|
+
await this._sendAsChannelAttribute(rtmPayload);
|
|
332
|
+
} else {
|
|
333
|
+
await this._send(rtmPayload, receiver);
|
|
334
|
+
}
|
|
301
335
|
} catch (error) {
|
|
302
336
|
logger.error(
|
|
303
337
|
LogSource.Events,
|
|
@@ -9,6 +9,7 @@ export enum LocalEventsEnum {
|
|
|
9
9
|
WHITEBOARD_OFF = 'WHITEBOARD_OFF',
|
|
10
10
|
MIC_CHANGED = 'MIC_CHANGED',
|
|
11
11
|
CLEAR_WHITEBOARD = 'CLEAR_WHITEBOARD',
|
|
12
|
+
USER_KICKED_OFF_BY_REMOTE_HOST = 'USER_KICKED_OFF_BY_REMOTE_HOST',
|
|
12
13
|
}
|
|
13
14
|
const LocalEventEmitter = new EventEmitter();
|
|
14
15
|
export default LocalEventEmitter;
|
|
@@ -19,6 +19,8 @@ import {
|
|
|
19
19
|
Pressable,
|
|
20
20
|
TouchableOpacity,
|
|
21
21
|
ActivityIndicator,
|
|
22
|
+
StyleProp,
|
|
23
|
+
ViewStyle,
|
|
22
24
|
} from 'react-native';
|
|
23
25
|
import Hyperlink from 'react-native-hyperlink';
|
|
24
26
|
import {useString} from '../utils/useString';
|
|
@@ -38,18 +40,29 @@ import {
|
|
|
38
40
|
videoRoomUserFallbackText,
|
|
39
41
|
} from '../language/default-labels/videoCallScreenLabels';
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
type AttachmentBubbleProps = {
|
|
44
|
+
fileName: string;
|
|
45
|
+
fileExt: string;
|
|
46
|
+
isFullWidth?: boolean;
|
|
47
|
+
fileType?: string;
|
|
48
|
+
secondaryComponent?: React.ReactNode;
|
|
49
|
+
containerStyle?: StyleProp<ViewStyle>; // Accepting external styles
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const AttachmentBubble: React.FC<AttachmentBubbleProps> = ({
|
|
42
53
|
fileName,
|
|
43
54
|
fileExt,
|
|
44
55
|
isFullWidth = false,
|
|
45
56
|
fileType = '',
|
|
46
57
|
secondaryComponent,
|
|
58
|
+
containerStyle,
|
|
47
59
|
}) => {
|
|
48
60
|
const {uploadStatus} = useChatUIControls();
|
|
49
61
|
|
|
50
62
|
return (
|
|
51
63
|
<View
|
|
52
64
|
style={[
|
|
65
|
+
containerStyle,
|
|
53
66
|
style.fileContainer,
|
|
54
67
|
isFullWidth && {width: '100%'},
|
|
55
68
|
uploadStatus === UploadStatus.FAILURE && {
|
|
@@ -104,6 +117,7 @@ const ChatBubble = (props: ChatBubbleProps) => {
|
|
|
104
117
|
url,
|
|
105
118
|
thumb,
|
|
106
119
|
fileName,
|
|
120
|
+
fileType,
|
|
107
121
|
ext,
|
|
108
122
|
} = props;
|
|
109
123
|
|
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
MAX_HEIGHT,
|
|
29
29
|
LINE_HEIGHT,
|
|
30
30
|
MAX_TEXT_MESSAGE_SIZE,
|
|
31
|
+
MAX_FILES_UPLOAD,
|
|
31
32
|
} from '../components/chat-ui/useChatUIControls';
|
|
32
33
|
import {useContent, useRoomInfo, useUserName} from 'customization-api';
|
|
33
34
|
import ImageIcon from '../atoms/ImageIcon';
|
|
@@ -110,8 +111,11 @@ export const ChatTextInput = (props: ChatTextInputProps) => {
|
|
|
110
111
|
const errorSubHeadingSize = useString(chatSendErrorTextSizeToastSubHeading);
|
|
111
112
|
|
|
112
113
|
const isUploadStatusShown =
|
|
113
|
-
|
|
114
|
-
|
|
114
|
+
uploadedFiles.filter(
|
|
115
|
+
file =>
|
|
116
|
+
file.upload_status === UploadStatus.IN_PROGRESS ||
|
|
117
|
+
file.upload_status === UploadStatus.FAILURE,
|
|
118
|
+
).length > 0 || uploadedFiles.length === MAX_FILES_UPLOAD;
|
|
115
119
|
|
|
116
120
|
const groupChatInputPlaceHolder = $config.EVENT_MODE
|
|
117
121
|
? useString(groupChatLiveInputPlaceHolderText)
|
|
@@ -201,19 +205,19 @@ export const ChatTextInput = (props: ChatTextInputProps) => {
|
|
|
201
205
|
]}>
|
|
202
206
|
{uploadedFiles.map((file, index) => (
|
|
203
207
|
<AttachmentBubble
|
|
204
|
-
key={
|
|
208
|
+
key={file.file_id}
|
|
205
209
|
fileName={file.file_name}
|
|
206
210
|
fileExt={file.file_ext}
|
|
207
211
|
isFullWidth={true}
|
|
208
212
|
fileType={file.file_type}
|
|
209
213
|
secondaryComponent={
|
|
210
|
-
|
|
214
|
+
file.upload_status === UploadStatus.IN_PROGRESS ? (
|
|
211
215
|
<ActivityIndicator />
|
|
212
|
-
) :
|
|
216
|
+
) : file.upload_status === UploadStatus.FAILURE ? (
|
|
213
217
|
<TouchableOpacity onPress={handleUploadRetry}>
|
|
214
218
|
<Text style={style.btnRetry}>{'Retry'}</Text>
|
|
215
219
|
</TouchableOpacity>
|
|
216
|
-
) :
|
|
220
|
+
) : file.upload_status === UploadStatus.SUCCESS ? (
|
|
217
221
|
<View>
|
|
218
222
|
<IconButton
|
|
219
223
|
hoverEffect={true}
|
|
@@ -233,12 +237,19 @@ export const ChatTextInput = (props: ChatTextInputProps) => {
|
|
|
233
237
|
tintColor: $config.SECONDARY_ACTION_COLOR,
|
|
234
238
|
}}
|
|
235
239
|
onPress={() => {
|
|
236
|
-
setUploadedFiles(
|
|
240
|
+
setUploadedFiles(files =>
|
|
241
|
+
files.filter(uploadedFile => {
|
|
242
|
+
return uploadedFile.file_id !== file.file_id;
|
|
243
|
+
}),
|
|
244
|
+
);
|
|
237
245
|
}}
|
|
238
246
|
/>
|
|
239
247
|
</View>
|
|
240
248
|
) : null
|
|
241
249
|
}
|
|
250
|
+
containerStyle={{
|
|
251
|
+
marginBottom: index !== uploadedFiles.length - 1 ? 6 : 0,
|
|
252
|
+
}}
|
|
242
253
|
/>
|
|
243
254
|
))}
|
|
244
255
|
</View>
|
|
@@ -9,9 +9,7 @@
|
|
|
9
9
|
information visit https://appbuilder.agora.io.
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
|
-
import React
|
|
13
|
-
import {useParams} from '../components/Router';
|
|
14
|
-
import useGetMeetingPhrase from '../utils/useGetMeetingPhrase';
|
|
12
|
+
import React from 'react';
|
|
15
13
|
import TertiaryButton from '../atoms/TertiaryButton';
|
|
16
14
|
import IconButton, {IconButtonProps} from '../atoms/IconButton';
|
|
17
15
|
import {useVideoCall} from '../components/useVideoCall';
|
|
@@ -20,6 +18,7 @@ import ToolbarMenuItem from '../atoms/ToolbarMenuItem';
|
|
|
20
18
|
import {useActionSheet} from '../utils/useActionSheet';
|
|
21
19
|
import {useString} from '../utils/useString';
|
|
22
20
|
import {toolbarItemInviteText} from '../language/default-labels/videoCallScreenLabels';
|
|
21
|
+
import {useToolbarProps} from '../atoms/ToolbarItem';
|
|
23
22
|
|
|
24
23
|
export interface CopyJoinInfoProps {
|
|
25
24
|
showTeritaryButton?: boolean;
|
|
@@ -27,6 +26,7 @@ export interface CopyJoinInfoProps {
|
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
const CopyJoinInfo = (props: CopyJoinInfoProps) => {
|
|
29
|
+
const {label = null, onPress: onPressCustom = null} = useToolbarProps();
|
|
30
30
|
const {isOnActionSheet, showLabel} = useActionSheet();
|
|
31
31
|
const {isToolbarMenuItem} = useToolbarMenu();
|
|
32
32
|
|
|
@@ -38,26 +38,18 @@ const CopyJoinInfo = (props: CopyJoinInfoProps) => {
|
|
|
38
38
|
setShowInvitePopup(true);
|
|
39
39
|
};
|
|
40
40
|
let iconButtonProps: IconButtonProps = {
|
|
41
|
-
onPress: onPress,
|
|
41
|
+
onPress: onPressCustom || onPress,
|
|
42
42
|
iconProps: {
|
|
43
43
|
name: 'share',
|
|
44
44
|
tintColor: $config.SECONDARY_ACTION_COLOR,
|
|
45
45
|
},
|
|
46
46
|
btnTextProps: {
|
|
47
47
|
textColor: $config.FONT_COLOR,
|
|
48
|
-
text: showLabel ? copyMeetingInviteButton : '',
|
|
48
|
+
text: showLabel ? label || copyMeetingInviteButton : '',
|
|
49
49
|
},
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
if (isOnActionSheet) {
|
|
53
|
-
// iconButtonProps.containerStyle = {
|
|
54
|
-
// backgroundColor: $config.CARD_LAYER_2_COLOR,
|
|
55
|
-
// width: 52,
|
|
56
|
-
// height: 52,
|
|
57
|
-
// borderRadius: 26,
|
|
58
|
-
// justifyContent: 'center',
|
|
59
|
-
// alignItems: 'center',
|
|
60
|
-
// };
|
|
61
53
|
iconButtonProps.btnTextProps.textStyle = {
|
|
62
54
|
color: $config.FONT_COLOR,
|
|
63
55
|
marginTop: 8,
|
|
@@ -12,20 +12,20 @@ import {useContent} from 'customization-api';
|
|
|
12
12
|
import {useActionSheet} from '../utils/useActionSheet';
|
|
13
13
|
import {useString} from '../utils/useString';
|
|
14
14
|
import {toolbarItemLayoutText} from '../language/default-labels/videoCallScreenLabels';
|
|
15
|
+
import {useToolbarProps} from '../atoms/ToolbarItem';
|
|
15
16
|
|
|
16
17
|
export interface LayoutIconButtonInterface {
|
|
17
18
|
render?: (onPress: () => void) => JSX.Element;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
const LayoutIconButton = (props: LayoutIconButtonInterface) => {
|
|
21
|
-
const {activeUids
|
|
22
|
-
|
|
22
|
+
const {activeUids} = useContent();
|
|
23
|
+
const {label} = useToolbarProps();
|
|
23
24
|
const {height: windowHeight} = useWindowDimensions();
|
|
24
25
|
const [modalPosition, setModalPosition] = useState(null);
|
|
25
26
|
const layoutBtnRef = useRef();
|
|
26
27
|
const [isHovered, setIsHoveredLocal] = useState(false);
|
|
27
28
|
const [isHoveredOnModal, setIsHoveredOnModal] = useState(false);
|
|
28
|
-
const isMobileView = isMobileUA();
|
|
29
29
|
const {isOnActionSheet} = useActionSheet();
|
|
30
30
|
const showLabel = $config.ICON_TEXT ? true : false;
|
|
31
31
|
const setIsHovered = (hovered: boolean) => {
|
|
@@ -45,7 +45,7 @@ const LayoutIconButton = (props: LayoutIconButtonInterface) => {
|
|
|
45
45
|
const layoutLabel = useString(toolbarItemLayoutText)('');
|
|
46
46
|
const layouts = useLayoutsData();
|
|
47
47
|
const changeLayout = useChangeDefaultLayout();
|
|
48
|
-
const {currentLayout
|
|
48
|
+
const {currentLayout} = useLayout();
|
|
49
49
|
|
|
50
50
|
const layout = layouts.findIndex(item => item.name === currentLayout);
|
|
51
51
|
const renderLayoutIcon = (showDropdown?: boolean) => {
|
|
@@ -66,20 +66,12 @@ const LayoutIconButton = (props: LayoutIconButtonInterface) => {
|
|
|
66
66
|
let iconButtonProps: Partial<IconButtonProps> = {
|
|
67
67
|
onPress: onPress,
|
|
68
68
|
btnTextProps: {
|
|
69
|
-
text: showLabel ? layoutLabel : '',
|
|
69
|
+
text: showLabel ? label || layoutLabel : '',
|
|
70
70
|
textColor: $config.FONT_COLOR,
|
|
71
71
|
},
|
|
72
72
|
};
|
|
73
73
|
iconButtonProps.isOnActionSheet = isOnActionSheet;
|
|
74
74
|
if (isOnActionSheet) {
|
|
75
|
-
// iconButtonProps.containerStyle = {
|
|
76
|
-
// backgroundColor: $config.CARD_LAYER_2_COLOR,
|
|
77
|
-
// width: 52,
|
|
78
|
-
// height: 52,
|
|
79
|
-
// borderRadius: 26,
|
|
80
|
-
// justifyContent: 'center',
|
|
81
|
-
// alignItems: 'center',
|
|
82
|
-
// };
|
|
83
75
|
iconButtonProps.btnTextProps.textStyle = {
|
|
84
76
|
color: $config.FONT_COLOR,
|
|
85
77
|
marginTop: 8,
|
|
@@ -89,7 +81,7 @@ const LayoutIconButton = (props: LayoutIconButtonInterface) => {
|
|
|
89
81
|
textAlign: 'center',
|
|
90
82
|
};
|
|
91
83
|
}
|
|
92
|
-
|
|
84
|
+
renderContent.push(
|
|
93
85
|
props?.render ? (
|
|
94
86
|
props.render(onPress)
|
|
95
87
|
) : (
|
|
@@ -9,28 +9,22 @@
|
|
|
9
9
|
information visit https://appbuilder.agora.io.
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
|
-
import React, {useContext
|
|
12
|
+
import React, {useContext} from 'react';
|
|
13
13
|
import {
|
|
14
14
|
ToggleState,
|
|
15
15
|
PermissionState,
|
|
16
|
-
ImageIcon as UIKitImageIcon,
|
|
17
16
|
ClientRoleType,
|
|
18
17
|
PropsContext,
|
|
19
|
-
useLocalUid,
|
|
20
|
-
DispatchContext,
|
|
21
|
-
RtcContext,
|
|
22
18
|
} from '../../agora-rn-uikit';
|
|
23
19
|
import useMuteToggleLocal, {MUTE_LOCAL_TYPE} from '../utils/useMuteToggleLocal';
|
|
24
|
-
import Styles from '../components/styles';
|
|
25
20
|
import {useString} from '../utils/useString';
|
|
26
21
|
import {useLocalUserInfo, useRoomInfo} from 'customization-api';
|
|
27
22
|
import IconButton, {IconButtonProps} from '../atoms/IconButton';
|
|
28
|
-
import ThemeConfig from '../theme';
|
|
29
23
|
import {ImageIconProps} from '../atoms/ImageIcon';
|
|
30
24
|
import useIsHandRaised from '../utils/useIsHandRaised';
|
|
31
25
|
import {useToolbarMenu} from '../utils/useMenu';
|
|
32
26
|
import ToolbarMenuItem from '../atoms/ToolbarMenuItem';
|
|
33
|
-
import {
|
|
27
|
+
import {useToolbar} from '../utils/useToolbar';
|
|
34
28
|
import {useActionSheet} from '../utils/useActionSheet';
|
|
35
29
|
import {isMobileUA} from '../utils/common';
|
|
36
30
|
import {
|
|
@@ -40,6 +34,7 @@ import {
|
|
|
40
34
|
toolbarItemMicrophoneTooltipText,
|
|
41
35
|
} from '../language/default-labels/videoCallScreenLabels';
|
|
42
36
|
import {LogSource, logger} from '../logger/AppBuilderLogger';
|
|
37
|
+
import {useToolbarProps} from '../atoms/ToolbarItem';
|
|
43
38
|
|
|
44
39
|
/**
|
|
45
40
|
* A component to mute / unmute the local audio
|
|
@@ -57,6 +52,7 @@ export interface LocalAudioMuteProps {
|
|
|
57
52
|
}
|
|
58
53
|
|
|
59
54
|
function LocalAudioMute(props: LocalAudioMuteProps) {
|
|
55
|
+
const {label = null, onPress: onPressCustom = null} = useToolbarProps();
|
|
60
56
|
const {isToolbarMenuItem} = useToolbarMenu();
|
|
61
57
|
const {rtcProps} = useContext(PropsContext);
|
|
62
58
|
const {
|
|
@@ -67,7 +63,7 @@ function LocalAudioMute(props: LocalAudioMuteProps) {
|
|
|
67
63
|
const local = useLocalUserInfo();
|
|
68
64
|
const isHandRaised = useIsHandRaised();
|
|
69
65
|
const localMute = useMuteToggleLocal();
|
|
70
|
-
const {isOnActionSheet,
|
|
66
|
+
const {isOnActionSheet, showLabel} = useActionSheet();
|
|
71
67
|
const {showToolTip = false, disabled = false, showWarningIcon = true} = props;
|
|
72
68
|
const micButtonLabel = useString<I18nDeviceStatus>(toolbarItemMicrophoneText);
|
|
73
69
|
const micButtonTooltip = useString<I18nDeviceStatus>(
|
|
@@ -132,10 +128,10 @@ function LocalAudioMute(props: LocalAudioMuteProps) {
|
|
|
132
128
|
hoverEffectStyle: props?.plainIconHoverEffect
|
|
133
129
|
? {backgroundColor: $config.ICON_BG_COLOR, borderRadius: 20}
|
|
134
130
|
: {},
|
|
135
|
-
onPress,
|
|
131
|
+
onPress: onPressCustom || onPress,
|
|
136
132
|
iconProps,
|
|
137
133
|
btnTextProps: {
|
|
138
|
-
text: showLabel && callActive && !isMobileUA() ? audioLabel : '',
|
|
134
|
+
text: showLabel && callActive && !isMobileUA() ? label || audioLabel : '',
|
|
139
135
|
textColor: $config.FONT_COLOR,
|
|
140
136
|
},
|
|
141
137
|
disabled: permissionDenied || disabled ? true : false,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import {isAndroid, isIOS
|
|
1
|
+
import React, {useEffect, useState} from 'react';
|
|
2
|
+
import {isAndroid, isIOS} from 'customization-api';
|
|
3
3
|
import EndcallPopup from './EndcallPopup';
|
|
4
4
|
import {Prompt} from '../components/Router';
|
|
5
5
|
import IconButton, {IconButtonProps} from '../atoms/IconButton';
|
|
@@ -13,6 +13,7 @@ import {useString} from '../../src/utils/useString';
|
|
|
13
13
|
import {toolbarItemLeaveText} from '../../src/language/default-labels/videoCallScreenLabels';
|
|
14
14
|
import {LogSource, logger} from '../logger/AppBuilderLogger';
|
|
15
15
|
import useEndCall from '../utils/useEndCall';
|
|
16
|
+
import {useToolbarProps} from '../atoms/ToolbarItem';
|
|
16
17
|
|
|
17
18
|
export interface LocalEndcallProps {
|
|
18
19
|
render?: (onPress: () => void) => JSX.Element;
|
|
@@ -32,6 +33,7 @@ export const stopForegroundService = () => {
|
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
const LocalEndcall = (props: LocalEndcallProps) => {
|
|
36
|
+
const {label = null, onPress: onPressCustom = null} = useToolbarProps();
|
|
35
37
|
const {isScreenshareActive, stopScreenshare} = useScreenshare();
|
|
36
38
|
const {isToolbarMenuItem} = useToolbarMenu();
|
|
37
39
|
const {isOnActionSheet, showLabel} = useActionSheet();
|
|
@@ -73,9 +75,9 @@ const LocalEndcall = (props: LocalEndcallProps) => {
|
|
|
73
75
|
height: $config.ICON_TEXT ? 52 : 48,
|
|
74
76
|
},
|
|
75
77
|
},
|
|
76
|
-
onPress,
|
|
78
|
+
onPress: onPressCustom || onPress,
|
|
77
79
|
btnTextProps: {
|
|
78
|
-
text: showLabel ? endCallLabel : '',
|
|
80
|
+
text: showLabel ? label || endCallLabel : '',
|
|
79
81
|
textColor: $config.FONT_COLOR,
|
|
80
82
|
},
|
|
81
83
|
};
|