agora-appbuilder-core 4.0.11 → 4.0.13

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 (61) hide show
  1. package/package.json +1 -1
  2. package/template/_package-lock.json +1576 -1364
  3. package/template/agora-rn-uikit/package-lock.json +25024 -0
  4. package/template/android/app/src/main/assets/fonts/icomoon.ttf +0 -0
  5. package/template/android/link-assets-manifest.json +13 -0
  6. package/template/customization-api/sub-components.ts +4 -0
  7. package/template/customization-api/types.ts +6 -0
  8. package/template/defaultConfig.js +3 -0
  9. package/template/global.d.ts +3 -0
  10. package/template/ios/Podfile.lock +10 -0
  11. package/template/ios/link-assets-manifest.json +13 -0
  12. package/template/package-lock.json +57732 -0
  13. package/template/package.json +4 -0
  14. package/template/react-native-toast-message/package-lock.json +10553 -0
  15. package/template/src/app-state/useMessages.ts +49 -9
  16. package/template/src/assets/font-styles.css +289 -125
  17. package/template/src/assets/fonts/icomoon.ttf +0 -0
  18. package/template/src/assets/selection.json +1 -1
  19. package/template/src/atoms/ActionMenu.tsx +5 -2
  20. package/template/src/atoms/CustomIcon.tsx +17 -1
  21. package/template/src/atoms/ImageIcon.tsx +19 -3
  22. package/template/src/atoms/InlinePopup.tsx +185 -0
  23. package/template/src/atoms/Popup.tsx +13 -4
  24. package/template/src/auth/AuthProvider.tsx +5 -0
  25. package/template/src/auth/config.ts +12 -3
  26. package/template/src/components/Chat.tsx +7 -1
  27. package/template/src/components/ChatContext.ts +12 -0
  28. package/template/src/components/CommonStyles.ts +2 -2
  29. package/template/src/components/RTMConfigure.tsx +1 -0
  30. package/template/src/components/chat/chatConfigure.native.tsx +488 -0
  31. package/template/src/components/chat/chatConfigure.tsx +473 -0
  32. package/template/src/components/chat-messages/useChatMessages.tsx +411 -607
  33. package/template/src/components/chat-ui/useChatUIControls.tsx +53 -0
  34. package/template/src/components/meeting-info-invite/MeetingInfoGridTile.tsx +4 -1
  35. package/template/src/components/participants/Participant.tsx +0 -1
  36. package/template/src/components/precall/joinWaitingRoomBtn.native.tsx +6 -1
  37. package/template/src/components/precall/joinWaitingRoomBtn.tsx +6 -1
  38. package/template/src/components/room-info/useRoomInfo.tsx +5 -0
  39. package/template/src/language/default-labels/videoCallScreenLabels.ts +86 -6
  40. package/template/src/pages/VideoCall.tsx +2 -1
  41. package/template/src/pages/video-call/VideoCallScreenWrapper.tsx +22 -12
  42. package/template/src/pages/video-call/index.ts +8 -0
  43. package/template/src/subComponents/ChatBubble.tsx +252 -32
  44. package/template/src/subComponents/ChatContainer.tsx +14 -4
  45. package/template/src/subComponents/ChatInput.native.tsx +269 -0
  46. package/template/src/subComponents/ChatInput.tsx +276 -100
  47. package/template/src/subComponents/RemoteMutePopup.tsx +12 -131
  48. package/template/src/subComponents/caption/CaptionContainer.tsx +6 -2
  49. package/template/src/subComponents/chat/ChatActionMenu.tsx +224 -0
  50. package/template/src/subComponents/chat/ChatAttachment.native.tsx +234 -0
  51. package/template/src/subComponents/chat/ChatAttachment.tsx +145 -0
  52. package/template/src/subComponents/chat/ChatEmoji.native.tsx +75 -0
  53. package/template/src/subComponents/chat/ChatEmoji.tsx +181 -0
  54. package/template/src/subComponents/chat/ChatSendButton.tsx +141 -0
  55. package/template/src/subComponents/chat/ChatUploadStatus.tsx +65 -0
  56. package/template/src/subComponents/chat/ImagePopup.tsx +400 -0
  57. package/template/src/subComponents/recording/useRecording.tsx +3 -1
  58. package/template/src/utils/index.tsx +30 -0
  59. package/template/src/utils/useEndCall.ts +7 -0
  60. package/template/src/utils/useJoinRoom.ts +32 -0
  61. package/template/src/subComponents/ChatInput.ios.tsx +0 -184
@@ -3,24 +3,39 @@ import {
3
3
  useChatNotification,
4
4
  } from '../components/chat-notification/useChatNotification';
5
5
  import {
6
+ ChatOption,
7
+ MessageStatusCallback,
6
8
  messageStoreInterface,
7
9
  useChatMessages,
10
+ SDKChatType,
8
11
  } from '../components/chat-messages/useChatMessages';
12
+ import {useChatConfigure} from '../components/chat/chatConfigure';
13
+ import {isWeb} from '../utils/common';
14
+ import type {UidType} from '../../agora-rn-uikit';
9
15
 
10
16
  export interface messageInterface {
11
17
  groupMessages: messageStoreInterface[];
12
18
  privateMessages: {
13
19
  [key: string]: messageStoreInterface[];
14
20
  };
15
- sendMessage: (msg: string, toUid?: number) => void;
16
- editMessage: (msgId: string, msg: string, toUid?: number) => void;
17
- deleteMessage: (msgId: string, toUid?: number) => void;
21
+ sendMessage: (
22
+ option: ChatOption,
23
+ messageStatusCallback?: MessageStatusCallback,
24
+ ) => void;
25
+ // editMessage: (msgId: string, msg: string, toUid?: number) => void;
26
+ deleteMessage: (msgId: string, to?: string, chatType?: SDKChatType) => void;
18
27
  groupUnreadCount: number;
19
28
  individualUnreadCount: individualUnreadMessageCount;
20
29
  setGroupUnreadCount: React.Dispatch<React.SetStateAction<number>>;
21
30
  setIndividualUnreadCount: React.Dispatch<
22
31
  React.SetStateAction<individualUnreadMessageCount>
23
32
  >;
33
+
34
+ removeMessageFromStore: (msgId: string, isMsgRecalled: boolean) => void;
35
+ removeMessageFromPrivateStore: (
36
+ msgId: string,
37
+ isMsgRecalled: boolean,
38
+ ) => void;
24
39
  }
25
40
 
26
41
  /**
@@ -28,12 +43,12 @@ export interface messageInterface {
28
43
  */
29
44
  export const useMessages: () => messageInterface = () => {
30
45
  const {
31
- deleteChatMessage: deleteMessage,
32
- editChatMessage: editMessage,
33
46
  messageStore: groupMessages,
34
47
  privateMessageStore: privateMessages,
35
- sendChatMessage: sendMessage,
48
+ removeMessageFromPrivateStore,
49
+ removeMessageFromStore,
36
50
  } = useChatMessages();
51
+ const {sendChatSDKMessage, deleteAttachment} = useChatConfigure();
37
52
  const {
38
53
  setUnreadIndividualMessageCount: setIndividualUnreadCount,
39
54
  setUnreadGroupMessageCount: setGroupUnreadCount,
@@ -41,15 +56,40 @@ export const useMessages: () => messageInterface = () => {
41
56
  unreadIndividualMessageCount: individualUnreadCount,
42
57
  } = useChatNotification();
43
58
 
59
+ const sendMessageWrapper = (
60
+ option: ChatOption,
61
+ messageStatusCallback?: MessageStatusCallback,
62
+ ) => {
63
+ if (isWeb()) {
64
+ sendChatSDKMessage(option);
65
+ } else {
66
+ sendChatSDKMessage(option, messageStatusCallback);
67
+ }
68
+ };
69
+
70
+ const deleteMessageWrapper = (
71
+ msgId: string,
72
+ to?: string,
73
+ chatType?: SDKChatType,
74
+ ) => {
75
+ if (isWeb()) {
76
+ deleteAttachment(msgId, to, chatType);
77
+ } else {
78
+ deleteAttachment(msgId);
79
+ }
80
+ };
81
+
44
82
  return {
45
83
  groupMessages,
46
84
  privateMessages,
47
- sendMessage,
48
- editMessage,
49
- deleteMessage,
85
+ sendMessage: sendMessageWrapper,
86
+ //editMessage,
87
+ deleteMessage: deleteMessageWrapper,
50
88
  groupUnreadCount,
51
89
  individualUnreadCount,
52
90
  setGroupUnreadCount,
53
91
  setIndividualUnreadCount,
92
+ removeMessageFromStore,
93
+ removeMessageFromPrivateStore,
54
94
  };
55
95
  };