agora-appbuilder-core 4.0.13 → 4.0.14

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.
Files changed (71) hide show
  1. package/package.json +1 -1
  2. package/template/_package-lock.json +1364 -1576
  3. package/template/android/app/src/main/assets/fonts/icomoon.ttf +0 -0
  4. package/template/customization-api/sub-components.ts +6 -4
  5. package/template/customization-api/types.ts +0 -6
  6. package/template/defaultConfig.js +0 -3
  7. package/template/global.d.ts +0 -3
  8. package/template/ios/Podfile.lock +0 -10
  9. package/template/package-lock.json +1364 -1576
  10. package/template/package.json +0 -4
  11. package/template/src/SDKAppWrapper.tsx +8 -2
  12. package/template/src/app-state/useMessages.ts +9 -49
  13. package/template/src/assets/font-styles.css +125 -289
  14. package/template/src/assets/fonts/icomoon.ttf +0 -0
  15. package/template/src/assets/selection.json +1 -1
  16. package/template/src/atoms/ActionMenu.tsx +2 -5
  17. package/template/src/atoms/CustomIcon.tsx +1 -17
  18. package/template/src/atoms/ImageIcon.tsx +3 -19
  19. package/template/src/atoms/Popup.tsx +4 -13
  20. package/template/src/atoms/ToolbarPreset.tsx +57 -6
  21. package/template/src/auth/AuthProvider.tsx +0 -5
  22. package/template/src/auth/config.ts +3 -12
  23. package/template/src/components/Chat.tsx +1 -7
  24. package/template/src/components/ChatContext.ts +0 -12
  25. package/template/src/components/CommonStyles.ts +2 -2
  26. package/template/src/components/Controls.tsx +57 -29
  27. package/template/src/components/Leftbar.tsx +4 -4
  28. package/template/src/components/Navbar.tsx +54 -29
  29. package/template/src/components/NavbarMobile.tsx +23 -33
  30. package/template/src/components/PinnedVideo.tsx +1 -1
  31. package/template/src/components/RTMConfigure.tsx +0 -1
  32. package/template/src/components/SdkApiContext.tsx +4 -1
  33. package/template/src/components/chat-messages/useChatMessages.tsx +607 -411
  34. package/template/src/components/chat-ui/useChatUIControls.tsx +0 -53
  35. package/template/src/components/meeting-info-invite/MeetingInfoGridTile.tsx +1 -4
  36. package/template/src/components/participants/Participant.tsx +1 -0
  37. package/template/src/components/precall/joinWaitingRoomBtn.native.tsx +1 -6
  38. package/template/src/components/precall/joinWaitingRoomBtn.tsx +1 -6
  39. package/template/src/components/room-info/useRoomInfo.tsx +5 -5
  40. package/template/src/language/default-labels/videoCallScreenLabels.ts +6 -86
  41. package/template/src/pages/VideoCall.tsx +4 -3
  42. package/template/src/pages/video-call/ActionSheetContent.tsx +32 -3
  43. package/template/src/pages/video-call/VideoCallScreenWrapper.tsx +12 -22
  44. package/template/src/pages/video-call/VideoComponent.tsx +11 -5
  45. package/template/src/pages/video-call/index.ts +0 -8
  46. package/template/src/subComponents/ChatBubble.tsx +32 -252
  47. package/template/src/subComponents/ChatContainer.tsx +4 -14
  48. package/template/src/subComponents/ChatInput.ios.tsx +184 -0
  49. package/template/src/subComponents/ChatInput.tsx +100 -276
  50. package/template/src/subComponents/RemoteMutePopup.tsx +131 -12
  51. package/template/src/subComponents/caption/CaptionContainer.tsx +2 -6
  52. package/template/src/subComponents/recording/useRecording.tsx +1 -3
  53. package/template/src/utils/SdkMethodEvents.ts +1 -0
  54. package/template/src/utils/common.tsx +17 -0
  55. package/template/src/utils/index.tsx +0 -30
  56. package/template/src/utils/useEndCall.ts +0 -7
  57. package/template/src/utils/useJoinRoom.ts +7 -33
  58. package/template/android/link-assets-manifest.json +0 -13
  59. package/template/ios/link-assets-manifest.json +0 -13
  60. package/template/src/atoms/InlinePopup.tsx +0 -185
  61. package/template/src/components/chat/chatConfigure.native.tsx +0 -488
  62. package/template/src/components/chat/chatConfigure.tsx +0 -473
  63. package/template/src/subComponents/ChatInput.native.tsx +0 -269
  64. package/template/src/subComponents/chat/ChatActionMenu.tsx +0 -224
  65. package/template/src/subComponents/chat/ChatAttachment.native.tsx +0 -234
  66. package/template/src/subComponents/chat/ChatAttachment.tsx +0 -145
  67. package/template/src/subComponents/chat/ChatEmoji.native.tsx +0 -75
  68. package/template/src/subComponents/chat/ChatEmoji.tsx +0 -181
  69. package/template/src/subComponents/chat/ChatSendButton.tsx +0 -141
  70. package/template/src/subComponents/chat/ChatUploadStatus.tsx +0 -65
  71. package/template/src/subComponents/chat/ImagePopup.tsx +0 -400
@@ -39,6 +39,7 @@ import {
39
39
  isValidReactComponent,
40
40
  isWebInternal,
41
41
  trimText,
42
+ updateToolbarDefaultConfig,
42
43
  useIsDesktop,
43
44
  } from '../utils/common';
44
45
  import {useChangeDefaultLayout} from '../pages/video-call/DefaultLayouts';
@@ -61,7 +62,11 @@ import styles from 'react-native-toast-message/src/styles';
61
62
  import RecordingInfo from '../atoms/RecordingInfo';
62
63
  import Toolbar from '../atoms/Toolbar';
63
64
  import ToolbarItem from '../atoms/ToolbarItem';
64
- import {ToolbarCustomItem} from '../atoms/ToolbarPreset';
65
+ import {
66
+ ToolbarCustomItem,
67
+ ToolbarDefaultItem,
68
+ ToolbarDefaultItemConfig,
69
+ } from '../atoms/ToolbarPreset';
65
70
  import {useToolbarMenu} from '../utils/useMenu';
66
71
  import ToolbarMenuItem from '../atoms/ToolbarMenuItem';
67
72
  import {useActionSheet} from '../utils/useActionSheet';
@@ -435,27 +440,6 @@ export const RecordingStatusToolbarItem = () => {
435
440
  <></>
436
441
  );
437
442
  };
438
- const defaultStartItems: ToolbarCustomItem[] = [
439
- {
440
- align: 'start',
441
- component: MeetingTitleToolbarItem,
442
- order: 0,
443
- hide: 'no',
444
- },
445
- {
446
- align: 'start',
447
- component: ParticipantCountToolbarItem,
448
- order: 1,
449
- hide: 'no',
450
- },
451
- {
452
- align: 'start',
453
- component: RecordingStatusToolbarItem,
454
- order: 2,
455
- hide: 'no',
456
- },
457
- ];
458
- const defaultCenterItems: ToolbarCustomItem[] = [];
459
443
 
460
444
  export const ParticipantToolbarItem = () => {
461
445
  return (
@@ -484,21 +468,45 @@ export const SettingsToobarItem = () => {
484
468
  );
485
469
  };
486
470
 
487
- const defaultEndItems: ToolbarCustomItem[] = [
471
+ const defaultItems: ToolbarDefaultItem[] = [
488
472
  {
489
473
  align: 'start',
490
- component: ParticipantToolbarItem,
474
+ componentName: 'meeting-title',
475
+ component: MeetingTitleToolbarItem,
491
476
  order: 0,
492
477
  hide: 'no',
493
478
  },
494
479
  {
495
480
  align: 'start',
496
- component: ChatToolbarItem,
481
+ componentName: 'participant-count',
482
+ component: ParticipantCountToolbarItem,
497
483
  order: 1,
498
484
  hide: 'no',
499
485
  },
500
486
  {
501
487
  align: 'start',
488
+ componentName: 'recording-status',
489
+ component: RecordingStatusToolbarItem,
490
+ order: 2,
491
+ hide: 'no',
492
+ },
493
+ {
494
+ align: 'end',
495
+ componentName: 'participant',
496
+ component: ParticipantToolbarItem,
497
+ order: 0,
498
+ hide: 'no',
499
+ },
500
+ {
501
+ align: 'end',
502
+ componentName: 'chat',
503
+ component: ChatToolbarItem,
504
+ order: 1,
505
+ hide: 'no',
506
+ },
507
+ {
508
+ align: 'end',
509
+ componentName: 'settings',
502
510
  component: SettingsToobarItem,
503
511
  order: 2,
504
512
  hide: 'no',
@@ -508,9 +516,14 @@ const defaultEndItems: ToolbarCustomItem[] = [
508
516
  export interface NavbarProps {
509
517
  customItems?: ToolbarCustomItem[];
510
518
  includeDefaultItems?: boolean;
519
+ defaultItemsConfig?: ToolbarDefaultItemConfig;
511
520
  }
512
521
  const Navbar = (props: NavbarProps) => {
513
- const {customItems = [], includeDefaultItems = true} = props;
522
+ const {
523
+ customItems = [],
524
+ includeDefaultItems = true,
525
+ defaultItemsConfig = {},
526
+ } = props;
514
527
  const {width} = useWindowDimensions();
515
528
 
516
529
  const isHidden = i => {
@@ -518,18 +531,30 @@ const Navbar = (props: NavbarProps) => {
518
531
  };
519
532
 
520
533
  const customStartItems = customItems
534
+ ?.concat(
535
+ includeDefaultItems
536
+ ? updateToolbarDefaultConfig(defaultItems, defaultItemsConfig)
537
+ : [],
538
+ )
521
539
  ?.filter(i => i.align === 'start' && !isHidden(i))
522
- ?.concat(includeDefaultItems ? defaultStartItems : [])
523
540
  ?.sort(CustomToolbarSort);
524
541
 
525
542
  const customCenterItems = customItems
543
+ ?.concat(
544
+ includeDefaultItems
545
+ ? updateToolbarDefaultConfig(defaultItems, defaultItemsConfig)
546
+ : [],
547
+ )
526
548
  ?.filter(i => i.align === 'center' && !isHidden(i))
527
- ?.concat(includeDefaultItems ? defaultCenterItems : [])
528
549
  ?.sort(CustomToolbarSort);
529
550
 
530
551
  const customEndItems = customItems
552
+ ?.concat(
553
+ includeDefaultItems
554
+ ? updateToolbarDefaultConfig(defaultItems, defaultItemsConfig)
555
+ : [],
556
+ )
531
557
  ?.filter(i => i.align === 'end' && !isHidden(i))
532
- ?.concat(includeDefaultItems ? defaultEndItems : [])
533
558
  ?.sort(CustomToolbarSort);
534
559
 
535
560
  const renderContent = (
@@ -1,67 +1,66 @@
1
1
  import React from 'react';
2
2
  import {View, StyleSheet} from 'react-native';
3
3
  import Toolbar from '../atoms/Toolbar';
4
- import {ToolbarCustomItem} from '../atoms/ToolbarPreset';
4
+ import {
5
+ ToolbarCustomItem,
6
+ ToolbarDefaultItem,
7
+ ToolbarDefaultItemConfig,
8
+ } from '../atoms/ToolbarPreset';
5
9
  import {
6
10
  MeetingTitleToolbarItem,
7
11
  ParticipantCountToolbarItem,
8
12
  RecordingStatusToolbarItem,
9
13
  } from './Navbar';
10
14
  import {useRecording} from '../subComponents/recording/useRecording';
11
- import {CustomToolbarSort} from '../utils/common';
15
+ import {CustomToolbarSort, updateToolbarDefaultConfig} from '../utils/common';
12
16
 
13
17
  export interface NavbarProps {
14
18
  customItems?: ToolbarCustomItem[];
15
19
  includeDefaultItems?: boolean;
20
+ defaultItemsConfig?: ToolbarDefaultItemConfig;
16
21
  }
17
22
 
18
23
  const NavbarMobile = (props: NavbarProps) => {
19
24
  const {isRecordingActive} = useRecording();
20
- const defaultStartItems: ToolbarCustomItem[] = [
25
+ const defaultItems: ToolbarDefaultItem[] = [
21
26
  {
22
27
  align: 'start',
28
+ componentName: 'meeting-title',
23
29
  component: MeetingTitleToolbarItem,
24
30
  order: 0,
25
31
  hide: 'no',
26
32
  },
27
33
  {
28
34
  align: 'start',
35
+ componentName: 'participant-count',
29
36
  component: ParticipantCountToolbarItem,
30
37
  order: 1,
31
38
  hide: 'no',
32
39
  },
33
40
  {
34
41
  align: 'start',
42
+ componentName: 'recording-status',
35
43
  component: isRecordingActive ? RecordingStatusToolbarItem : null,
36
44
  order: 2,
37
45
  hide: 'no',
38
46
  },
39
47
  ];
40
- const defaultCenterItems: ToolbarCustomItem[] = [];
41
- const defaultEndItems: ToolbarCustomItem[] = [];
42
- const {customItems = [], includeDefaultItems = true} = props;
43
- const isHidden = (i) => {
48
+ const {
49
+ customItems = [],
50
+ includeDefaultItems = true,
51
+ defaultItemsConfig = {},
52
+ } = props;
53
+ const isHidden = i => {
44
54
  return i?.hide === 'yes';
45
55
  };
46
56
 
47
- // const customStartItems = customItems
48
- // ?.filter((i) => i.align === 'start' && !isHidden(i))
49
- // ?.concat(includeDefaultItems ? defaultStartItems : [])
50
- // ?.sort((a, b) => a?.order - b?.order);
51
-
52
- // const customCenterItems = customItems
53
- // ?.filter((i) => i.align === 'center' && !isHidden(i))
54
- // ?.concat(includeDefaultItems ? defaultCenterItems : [])
55
- // ?.sort((a, b) => a?.order - b?.order);
56
-
57
- // const customEndItems = customItems
58
- // ?.filter((i) => i.align === 'end' && !isHidden(i))
59
- // ?.concat(includeDefaultItems ? defaultEndItems : [])
60
- // ?.sort((a, b) => a?.order - b?.order);
61
-
62
57
  const customTopBarItems = customItems
63
- ?.concat(includeDefaultItems ? defaultStartItems : [])
64
- ?.filter((i) => !isHidden(i) && i?.component)
58
+ ?.concat(
59
+ includeDefaultItems
60
+ ? updateToolbarDefaultConfig(defaultItems, defaultItemsConfig)
61
+ : [],
62
+ )
63
+ ?.filter(i => !isHidden(i) && i?.component)
65
64
  ?.sort(CustomToolbarSort);
66
65
 
67
66
  const renderContent = (
@@ -82,15 +81,6 @@ const NavbarMobile = (props: NavbarProps) => {
82
81
  <View style={style.startContent}>
83
82
  {renderContent(customTopBarItems, 'start')}
84
83
  </View>
85
- {/*<View style={style.startContent}>
86
- {renderContent(customStartItems, 'start')}
87
- </View>
88
- <View style={style.centerContent}>
89
- {renderContent(customCenterItems, 'center')}
90
- </View>
91
- <View style={style.endContent}>
92
- {renderContent(customEndItems, 'end')}
93
- </View> */}
94
84
  </Toolbar>
95
85
  );
96
86
  };
@@ -45,7 +45,7 @@ const PinnedVideo = ({renderData}) => {
45
45
  const {pinnedUid, secondaryPinnedUid} = useContent();
46
46
  const [collapse, setCollapse] = useState(false);
47
47
  const {width} = useWindowDimensions();
48
- const isDesktop = width > BREAKPOINTS.xl;
48
+ const isDesktop = width > BREAKPOINTS.lg;
49
49
  const isSidePinnedlayout = topPinned === true ? false : isDesktop; // if either explicity set to false or auto evaluation
50
50
  const [maxUid, ...minUids] = renderData;
51
51
  const activeSpeaker = useActiveSpeaker();
@@ -641,7 +641,6 @@ const RtmConfigure = (props: any) => {
641
641
  mainUser: data.data.data.mainUser,
642
642
  screenShare: data.data.data.screenShare,
643
643
  whiteboard: data.data.data.whiteboard,
644
- chat: data.data.data?.chat,
645
644
  }),
646
645
  persistLevel: 1,
647
646
  source: 'core',
@@ -27,6 +27,7 @@ type SdkApiContextInterface = {
27
27
  meetingDetails?: Partial<RoomInfoContextInterface['data']>;
28
28
  userName: string;
29
29
  skipPrecall: boolean;
30
+ preference: {disableShareTile: boolean};
30
31
  promise: extractPromises<_InternalSDKMethodEventsMap['join']>;
31
32
  }
32
33
  | {
@@ -99,7 +100,7 @@ const commonEventHandlers: commonEventHandlers = {
99
100
  join: setter => {
100
101
  return SDKMethodEventsManager.on(
101
102
  'join',
102
- (res, rej, roomDetail, skipPrecall, userName) => {
103
+ (res, rej, roomDetail, skipPrecall, userName, preference) => {
103
104
  if (typeof roomDetail === 'object') {
104
105
  if (!validateMeetingInfoData(roomDetail)) {
105
106
  rej(new Error('Invalid meeting details'));
@@ -111,6 +112,7 @@ const commonEventHandlers: commonEventHandlers = {
111
112
  meetingDetails: roomDetail,
112
113
  skipPrecall,
113
114
  userName,
115
+ preference,
114
116
  promise: {res, rej},
115
117
  });
116
118
  } else if (
@@ -122,6 +124,7 @@ const commonEventHandlers: commonEventHandlers = {
122
124
  phrase: roomDetail,
123
125
  skipPrecall,
124
126
  userName,
127
+ preference,
125
128
  promise: {res, rej},
126
129
  });
127
130
  } else {