agora-appbuilder-core 4.0.0-beta.47 → 4.0.0-beta.49

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-appbuilder-core",
3
- "version": "4.0.0-beta.47",
3
+ "version": "4.0.0-beta.49",
4
4
  "description": "React Native template for RTE app builder",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -33,7 +33,8 @@ export {default as NetworkQualityPill} from '../src/subComponents/NetworkQuality
33
33
  //videocall screen
34
34
  export {default as VideocallScreen} from '../src/pages/video-call/VideoCallScreen';
35
35
  export {default as PrecallScreen} from '../src/components/Precall';
36
- //export {default as VBPanel} from '../src/components/virtual-background/VBPanel';
36
+ export {default as VBPanel} from '../src/components/virtual-background/VBPanel';
37
+ export {WhiteboardListener} from '../src/components/Controls';
37
38
 
38
39
  // commented for v1 release
39
40
  //Settings screen
@@ -19,6 +19,7 @@ import useMuteToggleLocal, {
19
19
  import {RoomPhase} from 'white-web-sdk';
20
20
  import {useScreenContext} from '../src/components/contexts/ScreenShareContext';
21
21
  import {filterObject} from '../src/utils/index';
22
+ import {useToggleWhiteboard} from '../src/components/Controls';
22
23
  export {
23
24
  VideoRenderer,
24
25
  DispatchContext,
@@ -36,4 +37,5 @@ export {
36
37
  RoomPhase,
37
38
  useScreenContext,
38
39
  filterObject,
40
+ useToggleWhiteboard,
39
41
  };
@@ -82,7 +82,46 @@ import LocalEventEmitter, {
82
82
  } from '../rtm-events-api/LocalEvents';
83
83
  import {useSetRoomInfo} from './room-info/useSetRoomInfo';
84
84
 
85
- const WhiteboardListener = () => {
85
+ export const useToggleWhiteboard = () => {
86
+ const {
87
+ whiteboardActive,
88
+ joinWhiteboardRoom,
89
+ leaveWhiteboardRoom,
90
+ getWhiteboardUid,
91
+ } = useContext(whiteboardContext);
92
+ const {setCustomContent} = useContent();
93
+ const {setLayout} = useLayout();
94
+ const {dispatch} = useContext(DispatchContext);
95
+ return () => {
96
+ if ($config.ENABLE_WHITEBOARD) {
97
+ if (whiteboardActive) {
98
+ leaveWhiteboardRoom();
99
+ setCustomContent(getWhiteboardUid(), false);
100
+ setLayout('grid');
101
+ events.send(
102
+ EventNames.WHITEBOARD_ACTIVE,
103
+ JSON.stringify({status: false}),
104
+ PersistanceLevel.Session,
105
+ );
106
+ } else {
107
+ joinWhiteboardRoom();
108
+ setCustomContent(getWhiteboardUid(), WhiteboardWrapper, {}, true);
109
+ dispatch({
110
+ type: 'UserPin',
111
+ value: [getWhiteboardUid()],
112
+ });
113
+ setLayout('pinned');
114
+ events.send(
115
+ EventNames.WHITEBOARD_ACTIVE,
116
+ JSON.stringify({status: true}),
117
+ PersistanceLevel.Session,
118
+ );
119
+ }
120
+ }
121
+ };
122
+ };
123
+
124
+ export const WhiteboardListener = () => {
86
125
  const {dispatch} = useContext(DispatchContext);
87
126
  const {setCustomContent} = useContent();
88
127
  const {currentLayout, setLayout} = useLayout();
@@ -812,10 +851,16 @@ export const MoreButtonToolbarItem = () => {
812
851
  <WhiteboardListener />
813
852
  );
814
853
  };
815
- export const LocalEndcallToolbarItem = () => {
854
+ export interface LocalEndcallToolbarItemProps {
855
+ customExit?: () => void;
856
+ }
857
+ export const LocalEndcallToolbarItem = (
858
+ props?: LocalEndcallToolbarItemProps,
859
+ ) => {
816
860
  return (
817
- <ToolbarItem testID="endCall-btn">
818
- <LocalEndcall />
861
+ <ToolbarItem
862
+ testID={props?.customExit ? 'endCall-btn-custom' : 'endCall-btn'}>
863
+ <LocalEndcall {...props} />
819
864
  </ToolbarItem>
820
865
  );
821
866
  };
@@ -18,7 +18,9 @@ import WhiteboardToolBox from './WhiteboardToolBox';
18
18
  import WhiteboardCanvas from './WhiteboardCanvas';
19
19
  import {useContent, useLayout} from 'customization-api';
20
20
 
21
- interface WhiteboardViewInterface {}
21
+ interface WhiteboardViewInterface {
22
+ showToolbox: boolean;
23
+ }
22
24
 
23
25
  const WhiteboardView: React.FC<WhiteboardViewInterface> = () => {
24
26
  const wbSurfaceRef = useRef();
@@ -74,6 +74,8 @@ const WhiteboardWidget = ({whiteboardRoom}) => {
74
74
  type: 'error',
75
75
  text1: 'Failed to export the whiteboard',
76
76
  visibilityTime: 3000,
77
+ primaryBtn: null,
78
+ secondaryBtn: null,
77
79
  });
78
80
  };
79
81
 
@@ -86,6 +88,8 @@ const WhiteboardWidget = ({whiteboardRoom}) => {
86
88
  text1:
87
89
  'Please wait few seconds to get the screenshot link of the whiteboard',
88
90
  visibilityTime: 3000,
91
+ primaryBtn: null,
92
+ secondaryBtn: null,
89
93
  });
90
94
  const myHeaders2 = new Headers();
91
95
  myHeaders2.append('Content-Type', 'application/json');
@@ -111,6 +115,8 @@ const WhiteboardWidget = ({whiteboardRoom}) => {
111
115
  text1:
112
116
  'Whiteboard exported as an image. Link copied to your clipboard.',
113
117
  visibilityTime: 3000,
118
+ primaryBtn: null,
119
+ secondaryBtn: null,
114
120
  });
115
121
  Clipboard.setString(parsedUrl);
116
122
  setTimeout(() => {
@@ -226,7 +232,8 @@ const WhiteboardWidget = ({whiteboardRoom}) => {
226
232
  <></>
227
233
  )}
228
234
  <ScaleController room={whiteboardRoom.current} />
229
- {whiteboardRoom.current?.isWritable ? (
235
+ {whiteboardRoom.current?.isWritable &&
236
+ $config.ENABLE_WHITEBOARD_FILE_UPLOAD ? (
230
237
  <>
231
238
  <Seperator />
232
239
  <TouchableOpacity
@@ -18,6 +18,7 @@ import {ENABLE_AUTH} from '../../src/auth/config';
18
18
 
19
19
  export interface LocalEndcallProps {
20
20
  render?: (onPress: () => void) => JSX.Element;
21
+ customExit?: () => void;
21
22
  }
22
23
 
23
24
  /* For android only, bg audio */
@@ -76,11 +77,15 @@ const LocalEndcall = (props: LocalEndcallProps) => {
76
77
  }, [isScreenshareActive, endCallState]);
77
78
 
78
79
  const endCall = async () => {
79
- if ((isAndroid() || isIOS()) && isScreenshareActive) {
80
- stopUserScreenShare();
81
- setEndCallState(true);
80
+ if (props?.customExit) {
81
+ props.customExit();
82
82
  } else {
83
- executeEndCall();
83
+ if ((isAndroid() || isIOS()) && isScreenshareActive) {
84
+ stopUserScreenShare();
85
+ setEndCallState(true);
86
+ } else {
87
+ executeEndCall();
88
+ }
84
89
  }
85
90
  };
86
91
 
@@ -32,6 +32,7 @@ import {
32
32
  useRtc,
33
33
  } from 'customization-api';
34
34
  import {filterObject} from '../../utils';
35
+ import Toast from '../../../react-native-toast-message';
35
36
 
36
37
  export const ScreenshareContextConsumer = ScreenshareContext.Consumer;
37
38
 
@@ -339,6 +340,15 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
339
340
  } catch (e) {
340
341
  console.error("can't start the screen share", e);
341
342
  executeNormalQuery();
343
+ Toast.show({
344
+ leadingIconName: 'alert',
345
+ type: 'error',
346
+ text1: 'Failed to start the screen sharing',
347
+ text2: 'Please allow the permission to start the screen sharing',
348
+ visibilityTime: 1000 * 10,
349
+ primaryBtn: null,
350
+ secondaryBtn: null
351
+ });
342
352
  }
343
353
  };
344
354