agora-appbuilder-core 4.0.0-beta.63 → 4.0.0-beta.65

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.63",
3
+ "version": "4.0.0-beta.65",
4
4
  "description": "React Native template for RTE app builder",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -6,6 +6,7 @@ import {useToolbarMenu} from '../../utils/useMenu';
6
6
  import IconButton, {IconButtonProps} from '../../atoms/IconButton';
7
7
  import {useActionSheet} from '../../utils/useActionSheet';
8
8
  import {useString} from '../../utils/useString';
9
+ import {toolbarItemVirtualBackgroundText} from '../../language/default-labels/videoCallScreenLabels';
9
10
 
10
11
  interface VBButtonProps {
11
12
  isVBOpen: boolean;
@@ -18,7 +19,7 @@ const VBButton = (props: VBButtonProps) => {
18
19
  const {isVBOpen, setIsVBOpen, showLabel = false} = props;
19
20
  const {isToolbarMenuItem} = useToolbarMenu();
20
21
  const {isOnActionSheet} = useActionSheet();
21
- const vbLabel = useString('toolbarItemVirtualBackgroundText')();
22
+ const vbLabel = useString(toolbarItemVirtualBackgroundText)();
22
23
 
23
24
  const onPress = () => {
24
25
  setIsVBOpen(prev => !prev);
@@ -25,12 +25,14 @@ import {
25
25
  vbPanelImageUploadErrorToastHeading,
26
26
  vbPanelImageUploadErrorToastSubHeading,
27
27
  } from '../../../src/language/default-labels/videoCallScreenLabels';
28
+ import {TextDataInterface} from 'customization-api';
28
29
 
29
30
  interface VBCardProps {
30
31
  type: VBMode;
31
32
  icon: keyof IconsInterface;
32
33
  path?: ImageSourcePropType;
33
34
  label?: string;
35
+ translationKey?: keyof TextDataInterface;
34
36
  position?: number;
35
37
  isOnPrecall?: boolean;
36
38
  isMobile?: boolean;
@@ -59,6 +61,7 @@ const VBCard: React.FC<VBCardProps> = ({
59
61
  position,
60
62
  isOnPrecall,
61
63
  isMobile,
64
+ translationKey,
62
65
  }) => {
63
66
  const {
64
67
  setVBmode,
@@ -80,6 +83,7 @@ const VBCard: React.FC<VBCardProps> = ({
80
83
  const uploadErrorSubHeading = useString(
81
84
  vbPanelImageUploadErrorToastSubHeading,
82
85
  )();
86
+ const translation = useString(translationKey)();
83
87
 
84
88
  const isSelected = path ? path == selectedImage : vbMode === type;
85
89
 
@@ -197,7 +201,7 @@ const VBCard: React.FC<VBCardProps> = ({
197
201
  name={icon}
198
202
  tintColor={$config.SECONDARY_ACTION_COLOR}
199
203
  />
200
- {label ? (
204
+ {label && translation ? (
201
205
  <View>
202
206
  <Text
203
207
  style={{
@@ -207,7 +211,7 @@ const VBCard: React.FC<VBCardProps> = ({
207
211
  color: $config.SECONDARY_ACTION_COLOR,
208
212
  paddingVertical: 4,
209
213
  }}>
210
- {label}
214
+ {translation}
211
215
  </Text>
212
216
  </View>
213
217
  ) : (
@@ -807,6 +807,7 @@ export const VideoCallScreenLabels: I18nVideoCallScreenLabelsInterface = {
807
807
  active ? 'Hide Transcript' : 'Show Transcript',
808
808
 
809
809
  [toolbarItemRaiseHandText]: active => (active ? 'Lower Hand' : 'Raise Hand'),
810
+ [toolbarItemSwitchCameraText]: 'Switch Camera',
810
811
 
811
812
  [inviteTileWelcomeText]: 'Welcome',
812
813
  [inviteTileNoElseJoinedYetText]: 'No one else has joined yet',
@@ -45,7 +45,10 @@ import {useSetRoomInfo} from '../../components/room-info/useSetRoomInfo';
45
45
  import VBButton from '../../components/virtual-background/VBButton';
46
46
  import {useVB} from '../../components/virtual-background/useVB';
47
47
  import {useString} from '../../utils/useString';
48
- import {sttSpokenLanguageToastSubHeading} from '../../language/default-labels/videoCallScreenLabels';
48
+ import {
49
+ sttSpokenLanguageToastHeading,
50
+ sttSpokenLanguageToastSubHeading,
51
+ } from '../../language/default-labels/videoCallScreenLabels';
49
52
  //Icon for expanding Action Sheet
50
53
  interface ShowMoreIconProps {
51
54
  isExpanded: boolean;
@@ -198,42 +201,13 @@ const CaptionIconBtn = (props: CaptionIconBtnProps) => {
198
201
  (isHost || (!isHost && isSTTActive))
199
202
  );
200
203
  return (
201
- <View style={styles.iconWithText}>
202
- <View style={styles.iconContainer}>
203
- <CaptionIcon
204
- isOnActionSheet={true}
205
- showLabel={false}
206
- closeActionSheet={onPress}
207
- />
208
- </View>
209
- {showLabel && (
210
- <View>
211
- <Text
212
- style={[
213
- styles.iconText,
214
- {
215
- color: isDisabled
216
- ? $config.SEMANTIC_NEUTRAL
217
- : $config.FONT_COLOR,
218
- },
219
- ]}>
220
- {isCaptionON ? 'Hide' : 'Show'}
221
- </Text>
222
- <Text
223
- style={[
224
- styles.iconText,
225
- {
226
- color: isDisabled
227
- ? $config.SEMANTIC_NEUTRAL
228
- : $config.FONT_COLOR,
229
- marginTop: 0,
230
- },
231
- ]}>
232
- Caption
233
- </Text>
234
- </View>
235
- )}
236
- </View>
204
+ <ToolbarItem>
205
+ <CaptionIcon
206
+ isOnActionSheet={true}
207
+ showLabel={true}
208
+ closeActionSheet={onPress}
209
+ />
210
+ </ToolbarItem>
237
211
  );
238
212
  };
239
213
 
@@ -254,38 +228,9 @@ const TranscriptIconBtn = (props: TranscriptIconProps) => {
254
228
  (isHost || (!isHost && isSTTActive))
255
229
  );
256
230
  return (
257
- <View style={styles.iconWithText}>
258
- <View style={styles.iconContainer}>
259
- <TranscriptIcon isOnActionSheet={true} showLabel={false} />
260
- </View>
261
- {showLabel && (
262
- <View>
263
- <Text
264
- style={[
265
- styles.iconText,
266
- {
267
- color: isDisabled
268
- ? $config.SEMANTIC_NEUTRAL
269
- : $config.FONT_COLOR,
270
- },
271
- ]}>
272
- {isTranscriptON ? 'Hide' : 'Show'}
273
- </Text>
274
- <Text
275
- style={[
276
- styles.iconText,
277
- {
278
- color: isDisabled
279
- ? $config.SEMANTIC_NEUTRAL
280
- : $config.FONT_COLOR,
281
- marginTop: 0,
282
- },
283
- ]}>
284
- Transcript
285
- </Text>
286
- </View>
287
- )}
288
- </View>
231
+ <ToolbarItem>
232
+ <TranscriptIcon isOnActionSheet={true} showLabel={true} />
233
+ </ToolbarItem>
289
234
  );
290
235
  };
291
236
 
@@ -296,9 +241,7 @@ const ToastIcon = ({color}) => (
296
241
  );
297
242
 
298
243
  const ActionSheetContent = props => {
299
- const heading = useString<'Set' | 'Changed'>(
300
- sttSpokenLanguageToastSubHeading,
301
- );
244
+ const heading = useString<'Set' | 'Changed'>(sttSpokenLanguageToastHeading);
302
245
  const subheading = useString<{
303
246
  action: 'Set' | 'Changed';
304
247
  newLanguage: string;
@@ -540,16 +483,16 @@ const ActionSheetContent = props => {
540
483
  order: 8,
541
484
  hide: 'no',
542
485
  align: 'start',
543
- component: <LayoutIcon />,
486
+ component:
487
+ !isAudioRoom &&
488
+ (isAudioVideoControlsDisabled ? null : <SwitchCameraIcon />),
544
489
  },
545
490
  {
546
491
  default: true,
547
492
  order: 9,
548
493
  hide: 'no',
549
494
  align: 'start',
550
- component:
551
- !isAudioRoom &&
552
- (isAudioVideoControlsDisabled ? null : <SwitchCameraIcon />),
495
+ component: <LayoutIcon />,
553
496
  },
554
497
  {
555
498
  default: true,
@@ -62,8 +62,13 @@ const CaptionIcon = (props: CaptionIconProps) => {
62
62
  : $config.SECONDARY_ACTION_COLOR,
63
63
  },
64
64
  btnTextProps: {
65
- text: showLabel ? label : '',
65
+ text: showLabel
66
+ ? isOnActionSheet
67
+ ? label?.replace(' ', '\n')
68
+ : label
69
+ : '',
66
70
  textColor: $config.FONT_COLOR,
71
+ numberOfLines: 2,
67
72
  },
68
73
  };
69
74
  iconButtonProps.isOnActionSheet = isOnActionSheet;
@@ -68,8 +68,13 @@ const TranscriptIcon = (props: TranscriptIconProps) => {
68
68
  },
69
69
  disabled: isDisabled,
70
70
  btnTextProps: {
71
- text: showLabel ? label(isTranscriptON) : '',
71
+ text: showLabel
72
+ ? isOnActionSheet
73
+ ? label(isTranscriptON)?.replace(' ', '\n')
74
+ : label(isTranscriptON)
75
+ : '',
72
76
  textColor: $config.FONT_COLOR,
77
+ numberOfLines: 2,
73
78
  },
74
79
  };
75
80
  iconButtonProps.isOnActionSheet = isOnActionSheet;
@@ -68,6 +68,7 @@ const LocalRaiseHand = (props: LocalRaiseHandProps) => {
68
68
  }
69
69
  },
70
70
  };
71
+ iconButtonProps.isOnActionSheet = isOnActionSheet;
71
72
  if (isOnActionSheet) {
72
73
  // iconButtonProps.containerStyle = {
73
74
  // backgroundColor: $config.CARD_LAYER_2_COLOR,