easemob-chat-uikit 2.2.0 → 2.3.0-beta.1
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/ChatUI.esm.js +83632 -80580
- package/ChatUI.js +142 -132
- package/ChatUI.umd.js +142 -132
- package/README.md +388 -0
- package/package.json +1 -1
- package/style/blocklist/style/style.scss +2 -2
- package/style.css +1 -1
- package/types/eventHandler/index.d.ts +1 -1
- package/types/module/chat/MessageList.d.ts +15 -0
- package/types/module/chat/index.d.ts +1 -1
- package/types/module/empty/Empty.d.ts +1 -0
- package/types/module/imageMessage/ImageMessage.d.ts +7 -0
- package/types/module/index.d.ts +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChatSDK } from '../module/SDK';
|
|
2
|
-
export type EventName = 'joinChatRoom' | 'leaveChatRoom' | 'reportMessage' | 'getChatRoomDetails' | 'sendMessage' | 'fetchUserInfoById' | 'translateMessage' | 'recallMessage' | 'deleteConversation' | 'modifyMessage' | 'createChatThread' | 'destroyChatThread' | 'leaveChatThread' | 'setGroupMemberAttributes' | 'muteChatRoomMember' | 'getChatRoomMutelist' | 'unmuteChatRoomMember' | 'removeChatRoomMember' | 'getSilentModeForConversations' | 'setSilentModeForConversation' | 'clearRemindTypeForConversation' | 'getGroupInfo' | 'modifyGroup' | 'destroyGroup' | 'leaveGroup' | 'createGroup' | 'inviteToGroup' | 'removeGroupMembers' | 'changeGroupOwner' | 'pinConversation' | 'getServerPinnedConversations' | 'removeHistoryMessages' | 'addReaction' | 'deleteReaction' | 'getReactionDetail' | 'joinChatThread' | 'getChatThreads' | 'getChatThreadLastMessage' | 'getAllContacts' | 'getJoinedGroups' | 'open' | 'setContactRemark' | 'addContact' | 'deleteContact' | 'getPinnedMessages' | 'pinMessage' | 'unpinMessage' | 'jumpToPinnedMessage' | 'addUsersToBlocklist' | 'removeUserFromBlocklist' | 'publishPresence' | 'getBlockList';
|
|
2
|
+
export type EventName = 'joinChatRoom' | 'leaveChatRoom' | 'reportMessage' | 'getChatRoomDetails' | 'sendMessage' | 'fetchUserInfoById' | 'translateMessage' | 'recallMessage' | 'deleteConversation' | 'modifyMessage' | 'createChatThread' | 'destroyChatThread' | 'leaveChatThread' | 'setGroupMemberAttributes' | 'muteChatRoomMember' | 'getChatRoomMutelist' | 'unmuteChatRoomMember' | 'removeChatRoomMember' | 'getSilentModeForConversations' | 'setSilentModeForConversation' | 'clearRemindTypeForConversation' | 'getGroupInfo' | 'modifyGroup' | 'destroyGroup' | 'leaveGroup' | 'createGroup' | 'inviteToGroup' | 'removeGroupMembers' | 'changeGroupOwner' | 'pinConversation' | 'getServerPinnedConversations' | 'removeHistoryMessages' | 'addReaction' | 'deleteReaction' | 'getReactionDetail' | 'joinChatThread' | 'getChatThreads' | 'getChatThreadLastMessage' | 'getAllContacts' | 'getJoinedGroups' | 'open' | 'setContactRemark' | 'addContact' | 'deleteContact' | 'getPinnedMessages' | 'pinMessage' | 'unpinMessage' | 'jumpToPinnedMessage' | 'addUsersToBlocklist' | 'removeUserFromBlocklist' | 'publishPresence' | 'getBlockList' | 'getConversationlist';
|
|
3
3
|
export type EventHandlerData = {
|
|
4
4
|
[key in EventName]?: {
|
|
5
5
|
success?: () => void;
|
|
@@ -4,12 +4,27 @@ import { renderUserProfileProps } from '../baseMessage';
|
|
|
4
4
|
import { CurrentConversation } from '../store/ConversationStore';
|
|
5
5
|
import { BaseMessageProps } from '../baseMessage';
|
|
6
6
|
import { NoticeMessageBody } from '../noticeMessage/NoticeMessage';
|
|
7
|
+
export interface MessageRenderContext {
|
|
8
|
+
message: ChatSDK.MessageBody | NoticeMessageBody;
|
|
9
|
+
style: React.CSSProperties;
|
|
10
|
+
renderUserProfile?: (props: renderUserProfileProps) => React.ReactNode;
|
|
11
|
+
isThread?: boolean;
|
|
12
|
+
messageProps?: BaseMessageProps;
|
|
13
|
+
onOpenThreadPanel?: (threadId: string) => void;
|
|
14
|
+
onRtcInviteMessageClick?: (message: ChatSDK.MessageBody) => void;
|
|
15
|
+
scrollToBottom?: () => void;
|
|
16
|
+
}
|
|
17
|
+
export type MessageType = 'txt' | 'img' | 'audio' | 'video' | 'file' | 'loc' | 'combine' | 'custom' | 'notice' | 'recall';
|
|
18
|
+
export type MessageRenderer = (context: MessageRenderContext) => ReactNode;
|
|
7
19
|
export interface MsgListProps {
|
|
8
20
|
prefix?: string;
|
|
9
21
|
className?: string;
|
|
10
22
|
style?: React.CSSProperties;
|
|
11
23
|
isThread?: boolean;
|
|
24
|
+
/** @deprecated 使用 customRenderers 替代,支持按类型自定义 */
|
|
12
25
|
renderMessage?: (message: ChatSDK.MessageBody | NoticeMessageBody) => ReactNode;
|
|
26
|
+
/** 按消息类型自定义渲染器,只需要传入想自定义的类型即可,其他类型会使用默认渲染 */
|
|
27
|
+
customRenderers?: Partial<Record<MessageType, MessageRenderer>>;
|
|
13
28
|
renderUserProfile?: (props: renderUserProfileProps) => React.ReactNode;
|
|
14
29
|
conversation?: CurrentConversation;
|
|
15
30
|
messageProps?: BaseMessageProps;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Chat } from './Chat';
|
|
2
2
|
import { MessageList } from './MessageList';
|
|
3
3
|
export type { ChatProps } from './Chat';
|
|
4
|
-
export type { MsgListProps } from './MessageList';
|
|
4
|
+
export type { MsgListProps, MessageRenderContext, MessageRenderer, MessageType, } from './MessageList';
|
|
5
5
|
export { MessageList };
|
|
6
6
|
export default Chat;
|
|
@@ -12,6 +12,13 @@ export interface ImageMessageProps extends BaseMessageProps {
|
|
|
12
12
|
nickName?: string;
|
|
13
13
|
renderUserProfile?: (props: renderUserProfileProps) => React.ReactNode;
|
|
14
14
|
imgProps?: React.ImgHTMLAttributes<HTMLImageElement>;
|
|
15
|
+
/** 自定义图片预览组件,用于替换默认的预览弹窗 */
|
|
16
|
+
renderImagePreview?: (props: {
|
|
17
|
+
visible: boolean;
|
|
18
|
+
imageUrl: string;
|
|
19
|
+
onClose: () => void;
|
|
20
|
+
message: ImageMessageType;
|
|
21
|
+
}) => React.ReactNode;
|
|
15
22
|
}
|
|
16
23
|
export interface ImagePreviewProps {
|
|
17
24
|
visible: boolean;
|
package/types/module/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import MessageStatus, { MessageStatusProps } from './messageStatus';
|
|
|
10
10
|
import CombinedMessage, { CombinedMessageProps } from './combinedMessage';
|
|
11
11
|
import PinnedMessage, { PinnedMessageProps } from './pinnedMessage';
|
|
12
12
|
import { RepliedMsg, UnsentRepliedMsg, RepliedMsgProps, UnsentRepliedMsgProps } from './repliedMessage';
|
|
13
|
-
import Chat, { MessageList, ChatProps, MsgListProps } from './chat';
|
|
13
|
+
import Chat, { MessageList, ChatProps, MsgListProps, MessageRenderContext, MessageRenderer, MessageType } from './chat';
|
|
14
14
|
import { ConversationList, ConversationItem, ConversationItemProps, ConversationListProps, ConversationData } from './conversation';
|
|
15
15
|
import MessageInput, { MessageInputProps, MoreActionProps, RecorderProps, EmojiProps, SelectedControlsProps, SuggestListProps, TextareaProps } from './messageInput';
|
|
16
16
|
import Header, { HeaderProps } from './header';
|
|
@@ -44,6 +44,6 @@ import ChatroomMessage from './chatroomMessage';
|
|
|
44
44
|
import CallKit from './callkit';
|
|
45
45
|
import { CallKitProps, CallInfo, CallErrorCode, CallError } from './callkit';
|
|
46
46
|
import { CallKitRef } from './callkit/types/index';
|
|
47
|
-
export type { AudioMessageProps, BaseMessageProps, FileMessageProps, ImageMessageProps, ImagePreviewProps, NoticeMessageProps, TextMessageProps, VideoMessageProps, MessageStatusProps, CombinedMessageProps, PinnedMessageProps, RepliedMsgProps, UnsentRepliedMsgProps, ChatProps, MsgListProps, ConversationItemProps, ConversationListProps, ConversationData, MessageInputProps, MoreActionProps, RecorderProps, EmojiProps, SelectedControlsProps, SuggestListProps, TextareaProps, HeaderProps, EmptyProps, RecalledMessageProps, RootStore, InitConfig, MessageStore, Message, SelectedMessage, Typing, ConversationStore, AT_TYPE, Conversation, CurrentConversation, ById, AddressStore, MemberRole, MemberItem, GroupItem, AppUserInfo, ThreadStore, ThreadData, CurrentThread, ProviderProps, ContextProps, ThreadProps, UserProfileProps, BlocklistProps, ContactListProps, ContactDetailProps, GroupDetailProps, GroupMemberProps, UserCardMessageProps, UserSelectProps, CallKitProps, CallKitRef, CallInfo, CallErrorCode, CallError, };
|
|
47
|
+
export type { AudioMessageProps, BaseMessageProps, FileMessageProps, ImageMessageProps, ImagePreviewProps, NoticeMessageProps, TextMessageProps, VideoMessageProps, MessageStatusProps, CombinedMessageProps, PinnedMessageProps, RepliedMsgProps, UnsentRepliedMsgProps, ChatProps, MsgListProps, ConversationItemProps, ConversationListProps, ConversationData, MessageInputProps, MoreActionProps, RecorderProps, EmojiProps, SelectedControlsProps, SuggestListProps, TextareaProps, HeaderProps, EmptyProps, RecalledMessageProps, RootStore, InitConfig, MessageStore, Message, SelectedMessage, Typing, ConversationStore, AT_TYPE, Conversation, CurrentConversation, ById, AddressStore, MemberRole, MemberItem, GroupItem, AppUserInfo, ThreadStore, ThreadData, CurrentThread, ProviderProps, ContextProps, ThreadProps, UserProfileProps, BlocklistProps, ContactListProps, ContactDetailProps, GroupDetailProps, GroupMemberProps, UserCardMessageProps, UserSelectProps, CallKitProps, CallKitRef, CallInfo, CallErrorCode, CallError, MessageRenderContext, MessageRenderer, MessageType, };
|
|
48
48
|
declare const UIKitProvider: import("react").NamedExoticComponent<ProviderProps>;
|
|
49
49
|
export { AudioMessage, BaseMessage, FileMessage, ImageMessage, NoticeMessage, TextMessage, VideoMessage, CombinedMessage, PinnedMessage, RepliedMsg, UnsentRepliedMsg, MessageStatus, Chat, MessageList, ContactList, ConversationList, ConversationItem, MessageInput, Header, Empty, RecalledMessage, rootStore, RootContext, RootProvider, RootConsumer, Provider, UIKitProvider, Thread, UserProfile, Blocklist, useClient, useConversations, usePinnedMessage, useHistoryMessages, useSDK, useIsMobile, useScreen, useConversationContext, useChatContext, useAddressContext, useThreadContext, useChatroomContext, Chatroom, ChatroomMember, ChatroomMessage, ContactItem, ContactDetail, GroupDetail, GroupMember, UserCardMessage, UserSelect, CallKit, };
|