agora-appbuilder-core 4.1.19-beta.3 → 4.1.19-beta.4

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.1.19-beta.3",
3
+ "version": "4.1.19-beta.4",
4
4
  "description": "React Native template for RTE app builder",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -53,6 +53,7 @@ export interface SidePanelItem {
53
53
  name: string;
54
54
  title: string;
55
55
  component: React.ComponentType;
56
+ headerRightSlot?: React.ReactNode;
56
57
  onClose?: () => void;
57
58
  }
58
59
 
@@ -77,8 +77,8 @@ const DefaultConfig = {
77
77
  CHAT_ORG_NAME: "",
78
78
  CHAT_APP_NAME: "",
79
79
  CHAT_URL: "",
80
- CLI_VERSION: "3.1.19-beta.3",
81
- CORE_VERSION: "4.1.19-beta.3",
80
+ CLI_VERSION: "3.1.19-beta.4",
81
+ CORE_VERSION: "4.1.19-beta.4",
82
82
  DISABLE_LANDSCAPE_MODE: false,
83
83
  STT_AUTO_START: false,
84
84
  CLOUD_RECORDING_AUTO_START: false,
@@ -10,23 +10,18 @@
10
10
  *********************************************
11
11
  */
12
12
  import React from 'react';
13
- import {View, Text, StyleSheet, ScrollView} from 'react-native';
13
+ import {View, StyleSheet, ScrollView} from 'react-native';
14
14
  import {isMobileUA, isWebInternal, useIsSmall} from '../utils/common';
15
15
  import CommonStyles from './CommonStyles';
16
- import SidePanelHeader, {
17
- SidePanelStyles,
18
- } from '../subComponents/SidePanelHeader';
19
- import {useLayout} from '../utils/useLayout';
20
- import {getGridLayoutName} from '../pages/video-call/DefaultLayouts';
21
16
  import useCaptionWidth from '../subComponents/caption/useCaptionWidth';
22
- import {useSidePanel} from '../utils/useSidePanel';
23
- import {SidePanelType} from '../subComponents/SidePanelEnum';
24
17
  import {CustomSidePanelHeader} from '../pages/video-call/SidePanelHeader';
25
-
18
+ import {useLayout} from '../utils/useLayout';
19
+ import {getGridLayoutName} from '../pages/video-call/DefaultLayouts';
26
20
  export interface CustomSidePanelViewInterface {
27
21
  name: string;
28
22
  title?: string;
29
23
  content: React.ComponentType;
24
+ headerRightSlot?: React.ReactNode;
30
25
  onClose?: () => void;
31
26
  showHeader?: boolean;
32
27
  }
@@ -37,12 +32,12 @@ const CustomSidePanelView = (props: CustomSidePanelViewInterface) => {
37
32
  showHeader = true,
38
33
  name,
39
34
  title,
35
+ headerRightSlot,
40
36
  onClose,
41
37
  } = props;
42
- const {currentLayout} = useLayout();
43
38
  const {transcriptHeight} = useCaptionWidth();
44
- const {setSidePanel} = useSidePanel();
45
39
  const isSmall = useIsSmall();
40
+ const {currentLayout} = useLayout();
46
41
 
47
42
  return (
48
43
  <View
@@ -57,13 +52,18 @@ const CustomSidePanelView = (props: CustomSidePanelViewInterface) => {
57
52
  : // desktop maximized
58
53
  CommonStyles.sidePanelContainerWeb,
59
54
  isWebInternal() && !isSmall() && currentLayout === getGridLayoutName()
60
- ? {marginVertical: 4}
55
+ ? {marginTop: 4}
61
56
  : {},
62
57
  //@ts-ignore
63
58
  transcriptHeight && !isMobileUA() && {height: transcriptHeight},
64
59
  ]}>
65
60
  {showHeader && (
66
- <CustomSidePanelHeader name={name} title={title} onClose={onClose} />
61
+ <CustomSidePanelHeader
62
+ name={name}
63
+ title={title}
64
+ headerRightSlot={headerRightSlot}
65
+ onClose={onClose}
66
+ />
67
67
  )}
68
68
  <ScrollView contentContainerStyle={[style.bodyContainer]}>
69
69
  {CustomSidePanelContent ? <CustomSidePanelContent /> : <></>}
@@ -958,6 +958,19 @@ const RtmConfigure = (props: any) => {
958
958
  );
959
959
  return;
960
960
  }
961
+ if (
962
+ !parsedValue ||
963
+ typeof parsedValue !== 'object' ||
964
+ Array.isArray(parsedValue)
965
+ ) {
966
+ logger.debug(
967
+ LogSource.Events,
968
+ 'CUSTOM_EVENTS',
969
+ 'Ignoring non custom-event RTM payload',
970
+ {evt, sender, ts},
971
+ );
972
+ return;
973
+ }
961
974
  const {payload, persistLevel, source} = parsedValue;
962
975
  // Step 1: Set local attributes
963
976
  if (persistLevel === PersistanceLevel.Session) {
@@ -291,6 +291,8 @@ const ActionSheet = props => {
291
291
  isCustomSidePanel={true}
292
292
  customSidePanelProps={{
293
293
  title: sidePanelArray[customSidePanelIndex]?.title,
294
+ headerRightSlot:
295
+ sidePanelArray[customSidePanelIndex]?.headerRightSlot,
294
296
  onClose: sidePanelArray[customSidePanelIndex]?.onClose,
295
297
  name: sidePanelArray[customSidePanelIndex]?.name,
296
298
  }}
@@ -326,6 +326,8 @@ const ActionSheet = props => {
326
326
  isCustomSidePanel={true}
327
327
  customSidePanelProps={{
328
328
  title: sidePanelArray[customSidePanelIndex]?.title,
329
+ headerRightSlot:
330
+ sidePanelArray[customSidePanelIndex]?.headerRightSlot,
329
331
  onClose: sidePanelArray[customSidePanelIndex]?.onClose,
330
332
  name: sidePanelArray[customSidePanelIndex]?.name,
331
333
  }}
@@ -16,6 +16,7 @@ const ActionSheetHandle = (props: {
16
16
  isCustomSidePanel?: boolean;
17
17
  customSidePanelProps?: {
18
18
  title: string;
19
+ headerRightSlot?: React.ReactNode;
19
20
  onClose?: () => void;
20
21
  name: string;
21
22
  };
@@ -208,6 +208,7 @@ export const VBHeader = () => {
208
208
 
209
209
  export const CustomSidePanelHeader = (props: {
210
210
  title: string;
211
+ headerRightSlot?: React.ReactNode;
211
212
  onClose?: () => void;
212
213
  name: string;
213
214
  }) => {
@@ -217,6 +218,7 @@ export const CustomSidePanelHeader = (props: {
217
218
  centerComponent={
218
219
  <Text style={SidePanelStyles.heading}>{props?.title}</Text>
219
220
  }
221
+ trailingComponent={props?.headerRightSlot}
220
222
  trailingIconName="close"
221
223
  trailingIconOnPress={() => {
222
224
  setSidePanel(SidePanelType.None);
@@ -224,7 +226,7 @@ export const CustomSidePanelHeader = (props: {
224
226
  props?.onClose && props?.onClose();
225
227
  } catch (error) {
226
228
  console.error(
227
- `Error on calling onClose in custom side panel ${name}`,
229
+ `Error on calling onClose in custom side panel ${props.name}`,
228
230
  );
229
231
  }
230
232
  }}
@@ -400,6 +400,9 @@ const VideoCallScreen = () => {
400
400
  <CustomSidePanelView
401
401
  content={SidePanelArray[customSidePanelIndex]?.component}
402
402
  title={SidePanelArray[customSidePanelIndex]?.title}
403
+ headerRightSlot={
404
+ SidePanelArray[customSidePanelIndex]?.headerRightSlot
405
+ }
403
406
  name={SidePanelArray[customSidePanelIndex]?.name}
404
407
  onClose={SidePanelArray[customSidePanelIndex]?.onClose}
405
408
  />
@@ -13,6 +13,7 @@ export interface SidePanelHeaderProps {
13
13
  leadingIconOnPress?: () => void;
14
14
  trailingIconName?: keyof IconsInterface;
15
15
  trailingIconOnPress?: () => void;
16
+ trailingComponent?: React.ReactNode;
16
17
  trailingIconName2?: keyof IconsInterface;
17
18
  trailingIconOnPress2?: () => void;
18
19
  isChat?: boolean;
@@ -56,9 +57,21 @@ const SidePanelHeader = React.forwardRef<View, SidePanelHeaderProps>(
56
57
  <View style={{width: 30, height: 'auto'}}></View>
57
58
  ) : null}
58
59
  {props?.centerComponent ? props.centerComponent : null}
59
- <View style={props?.trailingIconName2 && SidePanelStyles.row}>
60
+ <View
61
+ style={
62
+ (props?.trailingIconName2 || props?.trailingComponent) &&
63
+ SidePanelStyles.row
64
+ }>
65
+ {props?.trailingComponent ? props.trailingComponent : null}
60
66
  {props?.trailingIconName ? (
61
- <View ref={ref} collapsable={false} style={{flex: 1}}>
67
+ <View
68
+ ref={ref}
69
+ collapsable={false}
70
+ style={
71
+ props?.trailingIconName2 || props?.trailingComponent
72
+ ? {}
73
+ : {flex: 1}
74
+ }>
62
75
  <IconButton
63
76
  hoverEffect={true}
64
77
  hoverEffectStyle={{
@@ -116,6 +129,7 @@ export const SidePanelStyles = StyleSheet.create({
116
129
  borderBottomWidth: 1,
117
130
  borderBottomColor: $config.CARD_LAYER_3_COLOR,
118
131
  position: 'relative',
132
+ zIndex: 1000,
119
133
  },
120
134
  chatPadding: {
121
135
  paddingHorizontal: 16,