@tencentcloud/chat-uikit-react 2.1.2 → 2.1.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/.eslintrc.js +0 -1
- package/CHANGELOG.md +10 -0
- package/dist/cjs/components/Avatar/Avatar.js +1 -1
- package/dist/cjs/components/Checkbox/index.d.ts +2 -1
- package/dist/cjs/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
- package/dist/cjs/components/ConversationCreate/ConversationCreate.js +1 -1
- package/dist/cjs/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
- package/dist/cjs/components/ConversationPreview/ConversationPreview.js +1 -1
- package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.d.ts +4 -1
- package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.js +1 -1
- package/dist/cjs/components/ConversationPreview/utils.js +1 -1
- package/dist/cjs/components/ConversationSearch/ConversationSearchInput.d.ts +2 -1
- package/dist/cjs/components/ConversationSearch/ConversationSearchResult.js +1 -1
- package/dist/cjs/components/DivWithEdit/DivWithEdit.d.ts +3 -2
- package/dist/cjs/components/DivWithEdit/DivWithEdit.js +1 -1
- package/dist/cjs/components/DivWithEdit/WithText.js +1 -1
- package/dist/cjs/components/EmptyStateIndicator/EmptyStateIndicator.d.ts +2 -1
- package/dist/cjs/components/Icon/Icon.d.ts +2 -1
- package/dist/cjs/components/Icon/Icon.js +1 -1
- package/dist/cjs/components/Input/Input.js +1 -1
- package/dist/cjs/components/Model/index.d.ts +1 -1
- package/dist/cjs/components/Model/index.js +1 -1
- package/dist/cjs/components/Plugins/index.js +1 -1
- package/dist/cjs/components/Popup/index.d.ts +1 -1
- package/dist/cjs/components/Popup/index.js +1 -1
- package/dist/cjs/components/Switch/Switch.d.ts +2 -6
- package/dist/cjs/components/Switch/Switch.js +1 -1
- package/dist/cjs/components/TUIChat/TUIChat.js +1 -1
- package/dist/cjs/components/TUIChat/TUIChatState.js +1 -1
- package/dist/cjs/components/TUIChat/hooks/useHandleMessage.js +1 -1
- package/dist/cjs/components/TUIChat/hooks/useHandleMessageList.js +1 -1
- package/dist/cjs/components/TUIChat/unitls.js +1 -1
- package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/addFriendInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
- package/dist/cjs/components/TUIContactSearch/TUIContactSearch.js +1 -1
- package/dist/cjs/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
- package/dist/cjs/components/TUIConversation/TUIConversation.js +1 -1
- package/dist/cjs/components/TUIConversationList/hooks/useConversationList.js +1 -1
- package/dist/cjs/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
- package/dist/cjs/components/TUIKit/TUIKit.d.ts +2 -2
- package/dist/cjs/components/TUIKit/TUIKit.js +1 -1
- package/dist/cjs/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +7 -7
- package/dist/cjs/components/TUIKit/hooks/useTUIKit.d.ts +2 -2
- package/dist/cjs/components/TUIKit/hooks/useTUIKit.js +1 -1
- package/dist/cjs/components/TUIManage/TUIManage.d.ts +4 -1
- package/dist/cjs/components/TUIManage/TUIManage.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageAudio.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageAvatar.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageBubble.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageContext.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageCustom.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageFace.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageFile.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageImage.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageLocation.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageMerger.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageName.js +1 -1
- package/dist/cjs/components/TUIMessage/MessagePlugins.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageProgress.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageRevoke.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageText.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageVideo.js +1 -1
- package/dist/cjs/components/TUIMessage/TUIMessage.js +1 -1
- package/dist/cjs/components/TUIMessage/TUIMessageDefault.js +1 -1
- package/dist/cjs/components/TUIMessage/hooks/useMessageHandler.js +1 -1
- package/dist/cjs/components/TUIMessage/hooks/useMessageReply.js +1 -1
- package/dist/cjs/components/TUIMessage/utils/index.js +1 -1
- package/dist/cjs/components/TUIMessageInput/EmojiPicker.js +1 -1
- package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
- package/dist/cjs/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIForward.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputState.d.ts +2 -2
- package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useUploadElement.js +1 -1
- package/dist/cjs/components/TUIMessageList/TUIMessageList.js +1 -1
- package/dist/cjs/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
- package/dist/cjs/components/TUIProfile/TUIProfile.js +1 -1
- package/dist/cjs/components/TUIProfile/TUIProfileDefault.d.ts +2 -2
- package/dist/cjs/components/TUIProfile/TUIProfileDefault.js +1 -1
- package/dist/cjs/components/TUIProfile/hooks/useMyProfile.js +1 -1
- package/dist/cjs/components/Toast/index.js +1 -1
- package/dist/cjs/context/ComponentContext.d.ts +3 -2
- package/dist/cjs/context/TUIChatActionContext.d.ts +1 -1
- package/dist/cjs/context/TUIChatStateContext.d.ts +4 -4
- package/dist/cjs/context/TUIContactContext.js +1 -1
- package/dist/cjs/context/TUIConversationContext.js +1 -1
- package/dist/cjs/context/TUIKitContext.d.ts +1 -1
- package/dist/cjs/context/TUIMessageContext.js +1 -1
- package/dist/cjs/context/TUIMessageInputContext.js +1 -1
- package/dist/cjs/hooks/useProfile.d.ts +1 -1
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.d.css +3 -3
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/Avatar/Avatar.js +1 -1
- package/dist/esm/components/Checkbox/index.d.ts +2 -1
- package/dist/esm/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
- package/dist/esm/components/ConversationCreate/ConversationCreate.js +1 -1
- package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
- package/dist/esm/components/ConversationPreview/ConversationPreview.js +1 -1
- package/dist/esm/components/ConversationPreview/ConversationPreviewContent.d.ts +4 -1
- package/dist/esm/components/ConversationPreview/ConversationPreviewContent.js +1 -1
- package/dist/esm/components/ConversationPreview/utils.js +1 -1
- package/dist/esm/components/ConversationSearch/ConversationSearchInput.d.ts +2 -1
- package/dist/esm/components/ConversationSearch/ConversationSearchResult.js +1 -1
- package/dist/esm/components/DivWithEdit/DivWithEdit.d.ts +3 -2
- package/dist/esm/components/DivWithEdit/DivWithEdit.js +1 -1
- package/dist/esm/components/DivWithEdit/WithText.js +1 -1
- package/dist/esm/components/EmptyStateIndicator/EmptyStateIndicator.d.ts +2 -1
- package/dist/esm/components/Icon/Icon.d.ts +2 -1
- package/dist/esm/components/Icon/Icon.js +1 -1
- package/dist/esm/components/Input/Input.js +1 -1
- package/dist/esm/components/Model/index.d.ts +1 -1
- package/dist/esm/components/Model/index.js +1 -1
- package/dist/esm/components/Plugins/index.js +1 -1
- package/dist/esm/components/Popup/index.d.ts +1 -1
- package/dist/esm/components/Popup/index.js +1 -1
- package/dist/esm/components/Switch/Switch.d.ts +2 -6
- package/dist/esm/components/Switch/Switch.js +1 -1
- package/dist/esm/components/TUIChat/TUIChat.js +1 -1
- package/dist/esm/components/TUIChat/TUIChatState.js +1 -1
- package/dist/esm/components/TUIChat/hooks/useHandleMessage.js +1 -1
- package/dist/esm/components/TUIChat/hooks/useHandleMessageList.js +1 -1
- package/dist/esm/components/TUIChat/unitls.js +1 -1
- package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/addFriendInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
- package/dist/esm/components/TUIContactSearch/TUIContactSearch.js +1 -1
- package/dist/esm/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
- package/dist/esm/components/TUIConversation/TUIConversation.js +1 -1
- package/dist/esm/components/TUIConversationList/hooks/useConversationList.js +1 -1
- package/dist/esm/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
- package/dist/esm/components/TUIKit/TUIKit.d.ts +2 -2
- package/dist/esm/components/TUIKit/TUIKit.js +1 -1
- package/dist/esm/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +7 -7
- package/dist/esm/components/TUIKit/hooks/useTUIKit.d.ts +2 -2
- package/dist/esm/components/TUIKit/hooks/useTUIKit.js +1 -1
- package/dist/esm/components/TUIManage/TUIManage.d.ts +4 -1
- package/dist/esm/components/TUIManage/TUIManage.js +1 -1
- package/dist/esm/components/TUIMessage/MessageAudio.js +1 -1
- package/dist/esm/components/TUIMessage/MessageAvatar.js +1 -1
- package/dist/esm/components/TUIMessage/MessageBubble.js +1 -1
- package/dist/esm/components/TUIMessage/MessageContext.js +1 -1
- package/dist/esm/components/TUIMessage/MessageCustom.js +1 -1
- package/dist/esm/components/TUIMessage/MessageFace.js +1 -1
- package/dist/esm/components/TUIMessage/MessageFile.js +1 -1
- package/dist/esm/components/TUIMessage/MessageImage.js +1 -1
- package/dist/esm/components/TUIMessage/MessageLocation.js +1 -1
- package/dist/esm/components/TUIMessage/MessageMerger.js +1 -1
- package/dist/esm/components/TUIMessage/MessageName.js +1 -1
- package/dist/esm/components/TUIMessage/MessagePlugins.js +1 -1
- package/dist/esm/components/TUIMessage/MessageProgress.js +1 -1
- package/dist/esm/components/TUIMessage/MessageRevoke.js +1 -1
- package/dist/esm/components/TUIMessage/MessageText.js +1 -1
- package/dist/esm/components/TUIMessage/MessageVideo.js +1 -1
- package/dist/esm/components/TUIMessage/TUIMessage.js +1 -1
- package/dist/esm/components/TUIMessage/TUIMessageDefault.js +1 -1
- package/dist/esm/components/TUIMessage/hooks/useMessageHandler.js +1 -1
- package/dist/esm/components/TUIMessage/hooks/useMessageReply.js +1 -1
- package/dist/esm/components/TUIMessage/utils/index.js +1 -1
- package/dist/esm/components/TUIMessageInput/EmojiPicker.js +1 -1
- package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
- package/dist/esm/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIForward.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useMessageInputState.d.ts +2 -2
- package/dist/esm/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useUploadElement.js +1 -1
- package/dist/esm/components/TUIMessageList/TUIMessageList.js +1 -1
- package/dist/esm/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
- package/dist/esm/components/TUIProfile/TUIProfile.js +1 -1
- package/dist/esm/components/TUIProfile/TUIProfileDefault.d.ts +2 -2
- package/dist/esm/components/TUIProfile/TUIProfileDefault.js +1 -1
- package/dist/esm/components/TUIProfile/hooks/useMyProfile.js +1 -1
- package/dist/esm/components/Toast/index.js +1 -1
- package/dist/esm/context/ComponentContext.d.ts +3 -2
- package/dist/esm/context/TUIChatActionContext.d.ts +1 -1
- package/dist/esm/context/TUIChatStateContext.d.ts +4 -4
- package/dist/esm/context/TUIContactContext.js +1 -1
- package/dist/esm/context/TUIConversationContext.js +1 -1
- package/dist/esm/context/TUIKitContext.d.ts +1 -1
- package/dist/esm/context/TUIMessageContext.js +1 -1
- package/dist/esm/context/TUIMessageInputContext.js +1 -1
- package/dist/esm/hooks/useProfile.d.ts +1 -1
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.d.css +3 -3
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/index.ts +1 -0
- package/package.json +7 -6
- package/rollup.config.js +2 -1
- package/src/components/Avatar/Avatar.tsx +7 -3
- package/src/components/Avatar/styles/index.scss +1 -1
- package/src/components/Checkbox/index.tsx +1 -1
- package/src/components/ConversationCreate/ConversationCreatGroupDetail.tsx +14 -7
- package/src/components/ConversationCreate/ConversationCreate.tsx +5 -1
- package/src/components/ConversationCreate/ConversationCreateSelectView.tsx +2 -2
- package/src/components/ConversationCreate/ConversationCreateUserSelectList.tsx +11 -10
- package/src/components/ConversationCreate/hooks/useConversationCreate.tsx +14 -12
- package/src/components/ConversationPreview/ConversationPreview.tsx +3 -3
- package/src/components/ConversationPreview/ConversationPreviewContent.tsx +9 -5
- package/src/components/ConversationPreview/utils.tsx +6 -3
- package/src/components/DivWithEdit/DivWithEdit.tsx +6 -5
- package/src/components/DivWithEdit/WithText.tsx +3 -1
- package/src/components/DivWithEdit/styles/index.scss +1 -1
- package/src/components/Icon/Icon.tsx +2 -2
- package/src/components/Input/Input.tsx +15 -12
- package/src/components/Model/index.tsx +2 -2
- package/src/components/Plugins/index.tsx +15 -12
- package/src/components/Popup/index.tsx +13 -9
- package/src/components/Profile/index.ts +1 -2
- package/src/components/Switch/Switch.tsx +5 -7
- package/src/components/TUIChat/TUIChat.tsx +20 -5
- package/src/components/TUIChat/TUIChatState.tsx +3 -3
- package/src/components/TUIChat/hooks/useHandleMessage.tsx +5 -5
- package/src/components/TUIChat/hooks/useHandleMessageList.tsx +2 -2
- package/src/components/TUIChat/unitls.ts +2 -2
- package/src/components/TUIChatHeader/TUIChatHeaderDefault.tsx +1 -1
- package/src/components/TUIContact/TUIContactInfo/addFriendInfo.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/friendInfo.tsx +1 -2
- package/src/components/TUIContact/TUIContactInfo/hooks/useContactInfo.tsx +0 -10
- package/src/components/TUIContact/TUIContactList/TUIContactList.tsx +5 -3
- package/src/components/TUIContact/hooks/useTUIContact.tsx +3 -4
- package/src/components/TUIContactSearch/TUIContactSearch.tsx +6 -7
- package/src/components/TUIContactSearch/hooks/useContactSearch.tsx +1 -3
- package/src/components/TUIConversationList/TUIConversationList.tsx +1 -1
- package/src/components/TUIConversationList/hooks/useConversationList.tsx +19 -24
- package/src/components/TUIConversationList/hooks/useConversationUpdate.tsx +2 -2
- package/src/components/TUIKit/TUIKit.tsx +31 -12
- package/src/components/TUIKit/hooks/useTUIKit.tsx +14 -10
- package/src/components/TUIManage/TUIManage.tsx +20 -13
- package/src/components/TUIMessage/MessageAudio.tsx +8 -6
- package/src/components/TUIMessage/MessageAvatar.tsx +2 -2
- package/src/components/TUIMessage/MessageBubble.tsx +7 -5
- package/src/components/TUIMessage/MessageContext.tsx +3 -3
- package/src/components/TUIMessage/MessageCustom.tsx +5 -3
- package/src/components/TUIMessage/MessageFace.tsx +2 -2
- package/src/components/TUIMessage/MessageFile.tsx +5 -5
- package/src/components/TUIMessage/MessageImage.tsx +4 -2
- package/src/components/TUIMessage/MessageLocation.tsx +3 -3
- package/src/components/TUIMessage/MessageMerger.tsx +3 -3
- package/src/components/TUIMessage/MessageName.tsx +1 -1
- package/src/components/TUIMessage/MessagePlugins.tsx +12 -10
- package/src/components/TUIMessage/MessageProgress.tsx +5 -4
- package/src/components/TUIMessage/MessageRevoke.tsx +1 -1
- package/src/components/TUIMessage/MessageText.tsx +4 -4
- package/src/components/TUIMessage/MessageVideo.tsx +3 -3
- package/src/components/TUIMessage/TUIMessage.tsx +1 -1
- package/src/components/TUIMessage/TUIMessageDefault.tsx +3 -1
- package/src/components/TUIMessage/hooks/useMessageHandler.ts +13 -13
- package/src/components/TUIMessage/hooks/useMessageReply.ts +6 -4
- package/src/components/TUIMessage/utils/decodeText.ts +2 -3
- package/src/components/TUIMessage/utils/index.ts +1 -2
- package/src/components/TUIMessageInput/EmojiPicker.tsx +4 -4
- package/src/components/TUIMessageInput/InputPluginsDefalut.tsx +8 -8
- package/src/components/TUIMessageInput/InputQuoteDefalut.tsx +4 -2
- package/src/components/TUIMessageInput/TUIForward.tsx +22 -15
- package/src/components/TUIMessageInput/TUIMessageInputDefault.tsx +15 -9
- package/src/components/TUIMessageInput/hooks/useEmojiPicker.tsx +2 -2
- package/src/components/TUIMessageInput/hooks/useHandleForwardMessage.tsx +4 -4
- package/src/components/TUIMessageInput/hooks/useHandleQuoteMessage.tsx +5 -5
- package/src/components/TUIMessageInput/hooks/useMessageInputState.tsx +3 -3
- package/src/components/TUIMessageInput/hooks/useMessageInputText.tsx +12 -9
- package/src/components/TUIMessageInput/hooks/useUploadElement.tsx +2 -2
- package/src/components/TUIMessageInput/hooks/useUploadPicker.tsx +1 -1
- package/src/components/TUIMessageList/TUIMessageList.tsx +5 -6
- package/src/components/TUIMessageList/hooks/useMessageListElement.tsx +5 -2
- package/src/components/TUIProfile/TUIProfile.tsx +3 -1
- package/src/components/TUIProfile/TUIProfileDefault.tsx +17 -17
- package/src/components/TUIProfile/hooks/useMyProfile.tsx +19 -37
- package/src/components/Toast/index.tsx +3 -3
- package/src/components/Toast/styles/layout.scss +1 -1
- package/src/components/untils.ts +1 -1
- package/src/context/TUIChatStateContext.tsx +4 -4
- package/src/context/TUIContactContext.tsx +1 -1
- package/src/context/TUIConversationContext.tsx +2 -2
- package/src/context/TUIMessageContext.tsx +1 -1
- package/src/context/TUIMessageInputContext.tsx +1 -1
- package/src/hooks/useConversation.tsx +1 -1
- package/src/hooks/useProfile.tsx +2 -2
- package/tsconfig.json +1 -0
- package/dist/cjs/components/TUIProfile/hooks/useMyProfile.d.ts +0 -17
- package/dist/esm/components/TUIProfile/hooks/useMyProfile.d.ts +0 -17
- package/src/components/Profile/hooks/useProfile.tsx +0 -28
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as o}from"tslib";import{jsx as t}from"react/jsx-runtime";import{useState as
|
|
1
|
+
import{__assign as o}from"tslib";import{jsx as t,Fragment as e}from"react/jsx-runtime";import{useState as n,useEffect as i}from"react";import{useTUIKitContext as r}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{ConversationPreviewContent as a}from"./ConversationPreviewContent.js";import{getDisplayImage as s,getDisplayTitle as v,getDisplayMessage as m,getDisplayTime as c}from"./utils.js";function u(u){var l=u.activeConversation,p=u.conversation,C=u.Preview,d=void 0===C?a:C,f=u.searchValue,x=u.conversationUpdateCount,I=r("TUIConversation").language,g=r("ConversationPreview"),j=g.setActiveConversation,y=g.myProfile,T=n(s(p)),P=T[0],U=T[1],w=n(v(p,f)),A=w[0],D=w[1],M=n(y&&m(p,y)),b=M[0],h=M[1],K=n(c(p,I)),V=K[0],k=K[1],q=n(p.unreadCount),z=q[0],B=q[1],E=(null==l?void 0:l.conversationID)===(null==p?void 0:p.conversationID);return d?(i((function(){D(v(p,f)),y&&h(m(p,y)),U(s(p)),k(c(p,I)),B(p.unreadCount)}),[p,f,x,I]),t(d,o({},u,{active:E,displayImage:P,displayTitle:A,displayMessage:b,displayTime:V,unread:z,setActiveConversation:j}))):t(e,{})}export{u as ConversationPreview};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ConversationPreviewUIComponentProps } from './ConversationPreview.js';
|
|
3
3
|
|
|
4
|
+
interface IPluginsRef {
|
|
5
|
+
closeMore?: () => void;
|
|
6
|
+
}
|
|
4
7
|
declare function unMemoConversationPreviewContent<T extends ConversationPreviewUIComponentProps>(props: T): React.ReactElement;
|
|
5
8
|
declare const ConversationPreviewContent: typeof unMemoConversationPreviewContent;
|
|
6
9
|
|
|
7
|
-
export { ConversationPreviewContent, unMemoConversationPreviewContent };
|
|
10
|
+
export { ConversationPreviewContent, IPluginsRef, unMemoConversationPreviewContent };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import t,{useRef as i,useState as r,useEffect as a}from"react";import{useTranslation as c}from"react-i18next";import{TUIConversationService as s}from"@tencentcloud/chat-uikit-engine";import{isPC as l}from"../../utils/env.js";import{Avatar as m}from"../Avatar/Avatar.js";import{Icon as v}from"../Icon/Icon.js";import{IconTypes as u}from"../Icon/type.js";import{Plugins as d}from"../Plugins/index.js";import{useConversation as p}from"../../hooks/useConversation.js";import{useTUIKitContext as h}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";function f(t){var f,C=t.conversation,I=t.Avatar,N=void 0===I?m:I,T=t.displayImage,x=t.displayTitle,g=t.displayMessage,w=t.displayTime,j=t.unread,b=t.active,y=t.activeConversationID,D=t.setActiveConversationID,
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import t,{useRef as i,useState as r,useEffect as a}from"react";import{useTranslation as c}from"react-i18next";import{TUIConversationService as s}from"@tencentcloud/chat-uikit-engine";import{isPC as l}from"../../utils/env.js";import{Avatar as m}from"../Avatar/Avatar.js";import{Icon as v}from"../Icon/Icon.js";import{IconTypes as u}from"../Icon/type.js";import{Plugins as d}from"../Plugins/index.js";import{useConversation as p}from"../../hooks/useConversation.js";import{useTUIKitContext as h}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";function f(t){var f,C=t.conversation,I=t.Avatar,N=void 0===I?m:I,T=t.displayImage,x=t.displayTitle,g=t.displayMessage,w=t.displayTime,j=t.unread,b=t.active,y=t.activeConversationID,D=t.setActiveConversationID,M=t.setActiveConversation,P=c().t,k=i(null),U=h("ConversationPreviewContent"),A=U.chat,E=U.conversation,F=p(A),z=F.pinConversation,K=F.deleteConversation,L=b?"conversation-preview-content--active":"",O=j&&j>=1?"conversation-preview-content--unread":"",R=C.isPinned?"conversation-preview-content--pin":"",S=r(!1),q=S[0],B=S[1],G=i(null);a((function(){y!==C.conversationID&&B(!1)}),[y]);var H=function(e){if(!l){var n=C.conversationID;switch(D&&D(n),e){case"touchstart":f=setTimeout(o,500);break;case"touchend":clearTimeout(f),setTimeout((function(){}),200)}}function o(){clearTimeout(f),B(!0)}},J=function(e,n){var o,t=C.conversationID,i=C.isPinned;switch(e.stopPropagation(),B(!1),(null===(o=null==G?void 0:G.current)||void 0===o?void 0:o.closeMore)&&G.current.closeMore(),n){case"pin":z({conversationID:t,isPinned:!i});break;case"delete":K(t),M&&C===E&&M(void 0)}};return n("button",e({type:"button","aria-selected":b,role:"option",className:"conversation-preview-container ".concat(L," ").concat(O," ").concat(R),onClick:function(){s.switchConversation(null==C?void 0:C.conversationID),M&&M(C),(null==k?void 0:k.current)&&k.current.blur()},onMouseEnter:function(){B(!0)},onMouseLeave:function(){B(!1)},onTouchStart:function(){return H("touchstart")},onTouchEnd:function(){return H("touchend")},ref:k},{children:[o("div",e({className:"avatar"},{children:o(N,{image:T,name:x,size:40})})),n("div",e({className:"content"},{children:[o("div",e({className:"title text-ellipsis"},{children:x})),o("div",e({className:"message"},{children:g}))]})),n("div",e({className:"external"},{children:[o("div",j?e({className:"unread"},{children:j<=99?j:"99+"}):{className:"unread"}),o("div",q?e({className:"".concat(q?"more--hover":"more")},{children:o(d,{customClass:"more-handle-box",ref:G,plugins:[o("div",e({role:"presentation",className:"more-handle-item",onClick:function(e){J(e,"pin")}},{children:P(C.isPinned?"TUIConversation.Unpin":"TUIConversation.Pin")})),o("div",e({className:"more-handle-item",style:{color:"#FF584C"},onClick:function(e){J(e,"delete")},role:"presentation"},{children:P("TUIConversation.Delete")}))],showNumber:0,MoreIcon:o(v,{className:"icon-more",width:16,height:16,type:u.MORE})})}):e({className:"time"},{children:w}))]}))]}))}var C=t.memo(f);export{C as ConversationPreviewContent,f as unMemoConversationPreviewContent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as r,jsx as a}from"react/jsx-runtime";import
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as r,jsx as a,Fragment as o}from"react/jsx-runtime";import t from"@tencentcloud/chat";import"react";import"../Icon/config.js";import"../Icon/type.js";import{defaultGroupAvatarWork as i,defaultUserAvatar as s}from"../Avatar/default.js";import{formatEmojiString as c}from"../TUIMessage/utils/emojiMap.js";import{getTimeStamp as n}from"../untils.js";var l=function(i,s,c){void 0===c&&(c="#147AFF");var n=d(i),l=n.name,p=n.nick,u=n.groupID,m=n.userID,f=i.type,v=i.remark,C="";switch(f){case t.TYPES.CONV_C2C:C=v||p||m;break;case t.TYPES.CONV_GROUP:C=l||u;break;default:C=""}var h,O,P;return s?(O=(h=C).toLocaleLowerCase(),""===(P=s&&O.indexOf(s.toLocaleLowerCase()))?a(o,{}):r("div",{children:[a("span",{children:h.slice(0,P)}),a("span",e({style:{color:c}},{children:P&&h.slice(P,P+s.length)})),a("span",{children:P&&h.slice(P+s.length)})]})):C},p=function(e){var r=e.type,a=d(e).avatar,o=a;if(!a)switch(r){case t.TYPES.CONV_C2C:o=s;break;case t.TYPES.CONV_GROUP:default:o=i}return o},u=function(o,i,s){var n,l=o.lastMessage,p=o.type,u=l.fromAccount,d=l.nick,m=l.nameCard,f=l.isRevoked,v=l.messageForShow;l.type===t.TYPES.MSG_CUSTOM&&(null===(n=l.payload)||void 0===n?void 0:n.description)&&(v=l.payload.description);var C="";switch(p){case t.TYPES.CONV_GROUP:C=(null==l?void 0:l.fromAccount)===(null==i?void 0:i.userID)?"You":"".concat(m||d||u||""),C="".concat(C?"".concat(C,":"):"");break;case t.TYPES.CONV_C2C:C=f?"you ":""}return r("div",e({style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:[a("span",{children:C}),a("span",{children:l.isRevoked?"recalled a message":c(v,1)})]}))},d=function(e){if(!e)return null;var r={},a=e.type,o=e.groupProfile,i=e.userProfile;switch(a){case t.TYPES.CONV_C2C:r=i;break;case t.TYPES.CONV_GROUP:r=o;case t.TYPES.CONV_SYSTEM:}return r},m=function(e,r){var a=e.lastMessage;return n(1e3*a.lastTime,r)};export{p as getDisplayImage,u as getDisplayMessage,m as getDisplayTime,l as getDisplayTitle,d as getMessageProfile};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import { InputProps } from '../Input/Input.js';
|
|
2
3
|
|
|
3
|
-
declare function ConversationSearchInput(props: InputProps): JSX.Element;
|
|
4
|
+
declare function ConversationSearchInput(props: InputProps): react_jsx_runtime.JSX.Element;
|
|
4
5
|
|
|
5
6
|
export { ConversationSearchInput };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import{ConversationPreview as s}from"../ConversationPreview/ConversationPreview.js";import"react";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import"../../utils/env.js";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as i}from"../Icon/type.js";import"@tencentcloud/chat";import"../TUIKit/TUIKit.js";import"../../context/TUIMessageContext.js";import"../ConversationCreate/ConversationCreate.js";import"../ConversationCreate/ConversationGroupTypeInfo.js";import"date-fns";import"date-fns/locale";import"../../constants.js";import"../TUIMessage/hooks/useMessageReply.js";import"../TUIMessage/MessagePlugins.js";import"../TUIMessage/MessageContext.js";import"../TUIMessageInput/hooks/useHandleQuoteMessage.js";import"../TUIProfile/TUIProfileDefault.js";
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import{ConversationPreview as s}from"../ConversationPreview/ConversationPreview.js";import"react";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import"../../utils/env.js";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as i}from"../Icon/type.js";import"@tencentcloud/chat";import"../TUIKit/TUIKit.js";import"../../context/TUIMessageContext.js";import"../ConversationCreate/ConversationCreate.js";import"../ConversationCreate/ConversationGroupTypeInfo.js";import"date-fns";import"date-fns/locale";import"../../constants.js";import"../TUIMessage/hooks/useMessageReply.js";import"../TUIMessage/MessagePlugins.js";import"../TUIMessage/MessageContext.js";import"../TUIMessageInput/hooks/useHandleQuoteMessage.js";import"../TUIProfile/TUIProfileDefault.js";function n(n){var a=n.result,m=n.searchValue,c=n.Preview;return t("div",{children:0===(null==a?void 0:a.length)?o("div",e({className:"conversation-search-result no-result"},{children:[t(r,{className:"no-result-icon",type:i.CRY,width:42,height:42}),t("span",e({className:"no-result-message"},{children:'No results for "'.concat(m,'"')}))]})):a.map((function(o){return t(s,e({searchValue:m},{conversation:o,Preview:c}),o.conversationID)}))})}export{n as ConversationSearchResult};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import { PropsWithChildren } from 'react';
|
|
2
3
|
|
|
3
4
|
interface DivWithEditProps {
|
|
@@ -9,8 +10,8 @@ interface DivWithEditProps {
|
|
|
9
10
|
type?: string;
|
|
10
11
|
isEdit?: boolean;
|
|
11
12
|
toggle?: (name: string) => void;
|
|
12
|
-
close
|
|
13
|
+
close: () => void;
|
|
13
14
|
}
|
|
14
|
-
declare function DivWithEdit<T extends DivWithEditProps>(props: PropsWithChildren<T>): JSX.Element;
|
|
15
|
+
declare function DivWithEdit<T extends DivWithEditProps>(props: PropsWithChildren<T>): react_jsx_runtime.JSX.Element;
|
|
15
16
|
|
|
16
17
|
export { DivWithEdit };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as i}from"tslib";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as o,useLayoutEffect as c}from"react";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as s}from"../Icon/type.js";import{Popup as m}from"../Popup/index.js";import{WithSelect as n}from"./WithSelect.js";import{WithText as a}from"./WithText.js";var l={text:a,select:n};function d(n){var d=n.value,p=n.className,h=n.classEditName,f=n.confirm,u=n.type,v=n.isEdit,N=n.toggle,j=n.children,w=n.name,x=n.close,I=o(d),g=I[0],y=I[1],E=l[u]||a;c((function(){y(d)}),[d]);return e("div",i({className:"div-with-edit ".concat(p)},{children:t(m,i({className:"div-with-edit-popup",show:!0,close:x},{children:[!v&&t("div",i({className:"show"},{children:[e("p",{children:g||"-"}),e("div",i({className:"icon"},{children:e(r,{className:"icon-edit",width:12,height:12,type:s.EDIT,onClick:function(){N(w)}})}))]})),v&&e(E,i({value:g,confirm:function(i){f({name:w,value:i})},className:h,close:x},{children:j}))]}))}))}export{d as DivWithEdit};
|
|
1
|
+
import{__assign as i}from"tslib";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as o,useLayoutEffect as c}from"react";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as s}from"../Icon/type.js";import{Popup as m}from"../Popup/index.js";import{WithSelect as n}from"./WithSelect.js";import{WithText as a}from"./WithText.js";var l={text:a,select:n};function d(n){var d=n.value,p=n.className,h=n.classEditName,f=n.confirm,u=n.type,v=n.isEdit,N=n.toggle,j=n.children,w=n.name,x=n.close,I=o(d),g=I[0],y=I[1],E=l[u]||a;c((function(){y(d)}),[d]);return e("div",i({className:"div-with-edit ".concat(p)},{children:t(m,i({className:"div-with-edit-popup",show:!0,close:x},{children:[!v&&t("div",i({className:"show"},{children:[e("p",{children:g||"-"}),e("div",i({className:"icon"},{children:e(r,{className:"icon-edit",width:12,height:12,type:s.EDIT,onClick:function(){N&&w&&N(w)}})}))]})),v&&e(E,i({value:g,confirm:function(i){f&&f({name:w,value:i})},className:h,close:x},{children:j}))]}))}))}export{d as DivWithEdit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsxs as o,jsx as n}from"react/jsx-runtime";import{useRef as r,useState as e,useLayoutEffect as i}from"react";import{Icon as c}from"../Icon/Icon.js";import{IconTypes as a}from"../Icon/type.js";function m(m){var u=m.value,l=m.confirm,f=m.className,s=r(),p=e(u),v=p[0],d=p[1];i((function(){var t;null===(t=null==s?void 0:s.current)||void 0===t||t.focus(),d(v)}),[s,u]);return o("div",t({className:"edit ".concat(f)},{children:[n("input",{ref:s,type:"text",value:v,onChange:function(t){d(t.target.value)}}),n(c,{className:"icon",width:15,height:10.5,type:a.CONFIRM,onClick:function(){l(v)}})]}))}export{m as WithText};
|
|
1
|
+
import{__assign as t}from"tslib";import{jsxs as o,jsx as n}from"react/jsx-runtime";import{useRef as r,useState as e,useLayoutEffect as i}from"react";import{Icon as c}from"../Icon/Icon.js";import{IconTypes as a}from"../Icon/type.js";function m(m){var u=m.value,l=m.confirm,f=m.className,s=r(),p=e(u),v=p[0],d=p[1];i((function(){var t;null===(t=null==s?void 0:s.current)||void 0===t||t.focus(),d(v)}),[s,u]);return o("div",t({className:"edit ".concat(f)},{children:[n("input",{ref:s,type:"text",value:v,onChange:function(t){d(t.target.value)}}),n(c,{className:"icon",width:15,height:10.5,type:a.CONFIRM,onClick:function(){l&&l(v)}})]}))}export{m as WithText};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import { PropsWithChildren } from 'react';
|
|
2
3
|
|
|
3
4
|
interface EmptyStateIndicatorProps {
|
|
4
5
|
/** List Type: conversation | message */
|
|
5
6
|
listType?: 'conversation' | 'message' | 'chat';
|
|
6
7
|
}
|
|
7
|
-
declare function UnMemoizedEmptyStateIndicator<T extends EmptyStateIndicatorProps>(props: PropsWithChildren<T>): JSX.Element;
|
|
8
|
+
declare function UnMemoizedEmptyStateIndicator<T extends EmptyStateIndicatorProps>(props: PropsWithChildren<T>): react_jsx_runtime.JSX.Element | null;
|
|
8
9
|
declare const EmptyStateIndicator: typeof UnMemoizedEmptyStateIndicator;
|
|
9
10
|
|
|
10
11
|
export { EmptyStateIndicator, EmptyStateIndicatorProps };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { IconTypes } from './type.js';
|
|
3
4
|
|
|
@@ -9,6 +10,6 @@ interface IconProps {
|
|
|
9
10
|
onClick?: (event: React.BaseSyntheticEvent) => void;
|
|
10
11
|
className?: string;
|
|
11
12
|
}
|
|
12
|
-
declare function Icon(props: React.PropsWithChildren<IconProps>): JSX.Element;
|
|
13
|
+
declare function Icon(props: React.PropsWithChildren<IconProps>): react_jsx_runtime.JSX.Element;
|
|
13
14
|
|
|
14
15
|
export { Icon, IconProps, changeTypeToIconClassName };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsx as i}from"react/jsx-runtime";import{ICON_CONFIG as n}from"./config.js";var o=function(t){var o=n[t].url||"";return i("img",{className:"icon-image icon-image-".concat(t),src:o,alt:t})},c=function(t){var i;return(null===(i=n[t])||void 0===i?void 0:i.className)||""};function r(n){var r=n.children,e=n.type,a=n.height,s=void 0===a?24:a,m=n.width,l=void 0===m?24:m,p=n.onClick,d=n.className,f=void 0===d?"":d,g={width:"string"==typeof l?l:"".concat(l,"px"),minWidth:"string"==typeof l?l:"".concat(l,"px"),height:"string"==typeof s?s:"".concat(s,"px"),minHeight:"string"==typeof s?s:"".concat(s,"px")};return i("div",t({className:"tui-kit-icon ".concat(c(e)," ").concat(f),role:"button",tabIndex:0,style:g,onClick:p},{children:r||o(e)}))}export{r as Icon,c as changeTypeToIconClassName};
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as i}from"react/jsx-runtime";import{ICON_CONFIG as n}from"./config.js";var o=function(t){var o=n[t].url||"";return i("img",{className:"icon-image icon-image-".concat(t),src:o,alt:t})},c=function(t){var i;return(null===(i=n[t])||void 0===i?void 0:i.className)||""};function r(n){var r=n.children,e=n.type,a=n.height,s=void 0===a?24:a,m=n.width,l=void 0===m?24:m,p=n.onClick,d=n.className,f=void 0===d?"":d,g={width:"string"==typeof l?l:"".concat(l,"px"),minWidth:"string"==typeof l?l:"".concat(l,"px"),height:"string"==typeof s?s:"".concat(s,"px"),minHeight:"string"==typeof s?s:"".concat(s,"px")};return i("div",t({className:"tui-kit-icon ".concat(e&&c(e)," ").concat(f),role:"button",tabIndex:0,style:g,onClick:p},{children:r||e&&o(e)}))}export{r as Icon,c as changeTypeToIconClassName};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as n}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import e,{useState as
|
|
1
|
+
import{__assign as n}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import e,{useState as u,useRef as i,useImperativeHandle as r}from"react";import{Icon as c}from"../Icon/Icon.js";import{IconTypes as l}from"../Icon/type.js";var a=e.forwardRef((function(e,a){var d=e.className,v=void 0===d?"":d,f=e.customClassName,s=void 0===f?"":f,p=e.placeholder,m=e.clearable,b=void 0!==m&&m,h=e.prefix,x=e.suffix,g=e.onChange,k=e.onBlur,N=e.onFocus,y=e.onKeyDown,C=e.value,j=void 0===C?"":C,w=e.border,D=void 0===w?"":w,E=e.disabled,I=void 0!==E&&E,L=e.maxLength,B=void 0===L?void 0:L,F=u(!1),K=F[0],O=F[1],R=["Enter","NumpadEnter"],A=u(j),T=A[0],q=A[1],z=i(null),G=function(){z.current&&z.current.focus()};return r(a,(function(){return{focus:G,blur:function(){var n;null===(n=z.current)||void 0===n||n.blur()},input:z.current}})),t("div",n({className:"".concat(v," tui-kit-input-container")},{children:o("div",n({className:"tui-kit-input-box ".concat(D&&"tui-kit-input-border--".concat(D)," ").concat(K?"tui-kit-input-box--focus":"tui-kit-input-box--blur")},{children:[h,t("input",{maxLength:B,disabled:I,className:"tui-kit-input ".concat(s),placeholder:p,ref:z,value:T,onFocus:function(n){O(!0),null==N||N(n)},onBlur:function(n){O(!1),null==k||k(n)},onChange:function(n){q(n.target.value),z.current&&(null==g||g(n))},onKeyDown:function(n){R.indexOf(null==n?void 0:n.key)>-1&&y&&(null==n||n.preventDefault(),y(n))}}),x,b&&T&&t(c,{type:l.CLEAR,height:13,width:13,onClick:function(n){!function(n){var t;q(""),G();var o=null===(t=null==z?void 0:z.current)||void 0===t?void 0:t.cloneNode(!0),e=Object.create(n,{target:{value:o},currentTarget:{value:o}});o.value="",null==g||g(e)}(n)}})]}))}))}));export{a as Input};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as r}from"tslib";import{jsx as
|
|
1
|
+
import{__assign as r}from"tslib";import{jsx as n}from"react/jsx-runtime";function t(t){var o=t.className,e=t.onClick,c=t.children;return n("div",r({role:"button",tabIndex:0,className:"model ".concat(o),onClick:function(r){return e&&e(r)}},{children:c}))}export{t as Model};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as n}from"tslib";import{jsxs as o,jsx as e}from"react/jsx-runtime";import{forwardRef as i,useImperativeHandle as l,useRef as t,useState as r}from"react";import{Icon as c}from"../Icon/Icon.js";import{IconTypes as u}from"../Icon/type.js";import{Popup as s}from"../Popup/index.js";import{usePluginsElement as d}from"./hooks/usePluginsElement.js";function a(i,a){var m=i.plugins,v=void 0===m?[]:m,p=i.showNumber,h=i.MoreIcon,f=i.className,g=void 0===f?"":f,N=i.style,b=i.customClass,w=void 0===b?"":b,x=i.root,y=i.handleVisible;l(a,(function(){return{closeMore:function(n){B(!1)}}}));var P=d({plugins:v,showNumber:p}),j=P.showPicker,I=P.elements,C=t(null),k=r(!1),E=k[0],B=k[1],D=function n(o){var e,i;o.stopPropagation(),B(!E),E||null===(i=null===(e=null==C?void 0:C.current)||void 0===e?void 0:e.offsetParent)||void 0===i||i.removeEventListener("scroll",n)};return(j&&j.length>0||I&&(null==I?void 0:I.length)>0)&&o("ul",n({className:"plugin ".concat(g)},{children:[j&&(null==j?void 0:j.length)>0&&j.map((function(o,i){var l="".concat(o).concat(i);return e("li",n({className:"plugin-item"},{children:o}),l)})),I&&(null==I?void 0:I.length)>0&&o("div",n({className:"plugin-popup",ref:C},{children:[o("div",n({role:"menuitem",tabIndex:0,className:"more",onClick:D},{children:[!h&&e(c,{width:20,height:20,type:u.ADD}),h&&h]})),e(s,n({className:"plugin-popup-box ".concat(w),style:N,show:E,close:D,root:x,handleVisible:function(o){var e,i,l,t;if(y){var r=(null===(e=null==C?void 0:C.current)||void 0===e?void 0:e.children[1].getBoundingClientRect())||{},c=r.width,u=r.height,s=(null===(i=null==C?void 0:C.current)||void 0===i?void 0:i.getBoundingClientRect())||{},d=s.x,a=void 0===d?0:d,m=s.y,v=void 0===m?0:m;null===(t=null===(l=C.current)||void 0===l?void 0:l.offsetParent)||void 0===t||t.addEventListener("scroll",D),y(n(n({},o),{width:c,height:u,x:a,y:v}))}}},{children:e("ul",{children:I.map((function(o,i){var l="".concat(o).concat(i);return e("li",n({className:"plugin-item"},{children:o}),l)}))})}))]}))]}))}var m=i(a);export{m as Plugins};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import{useRef as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as t,Fragment as n}from"react/jsx-runtime";import{useRef as o,useState as r,useLayoutEffect as i}from"react";function u(u){var l=u.show,d=u.close,c=u.children,s=u.className,v=u.style,a=u.root,m=u.handleVisible,p=o(),h=r(!1),f=h[0],w=h[1];i((function(){var e,t;return l?(window.addEventListener("mouseup",d,!1),null===(e=null==p?void 0:p.current)||void 0===e||e.addEventListener("mouseup",b)):(window.removeEventListener("mouseup",d,!1),null===(t=null==p?void 0:p.current)||void 0===t||t.removeEventListener("mouseup",b)),function(){var e;window.removeEventListener("mouseup",d,!1),null===(e=null==p?void 0:p.current)||void 0===e||e.removeEventListener("mouseup",b)}}),[l]),i((function(){var t=new IntersectionObserver((function(t){var n,o=t[0],r=o.boundingClientRect,i=o.rootBounds,u=o.intersectionRatio,l=(null===(n=p.current)||void 0===n?void 0:n.getBoundingClientRect())||{},d=(null==a?void 0:a.getBoundingClientRect())||{},c=e(e({},r),l),s=e(e({},i),d);m&&u<1&&m({left:c.left-c.width<s.left,top:c.bottom+c.height<s.bottom,width:c.width,height:c.height}),w(!0)}),{root:a,threshold:[1]});return(null==p?void 0:p.current)&&l&&t.observe(null==p?void 0:p.current),function(){t.disconnect(),w(!1)}}),[p,l]);var b=function(e){e.stopPropagation()};return t(n,{children:l&&t("div",e({role:"button",tabIndex:0,style:v,className:"popup ".concat(s," ").concat(f&&"popup-show"),ref:p},{children:c}))})}export{u as Popup};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
|
|
3
4
|
interface Props {
|
|
@@ -6,11 +7,6 @@ interface Props {
|
|
|
6
7
|
checkedColor?: string;
|
|
7
8
|
className?: string;
|
|
8
9
|
}
|
|
9
|
-
declare function Switch(props: Props): JSX.Element;
|
|
10
|
-
declare namespace Switch {
|
|
11
|
-
var defaultProps: {
|
|
12
|
-
checkedColor: string;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
10
|
+
declare function Switch(props: Props): react_jsx_runtime.JSX.Element;
|
|
15
11
|
|
|
16
12
|
export { Switch };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as c,jsxs as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as c,jsxs as t}from"react/jsx-runtime";import{useRef as r}from"react";import{creteNewId as i}from"./utils/newId.js";function s(s){var o=s.checked,l=s.onChange,a=s.checkedColor,n=void 0===a?"#34C759":a,m=s.className,u=r(i());return c("div",e({className:"self-ui-switch"},{children:t("label",e({style:{backgroundColor:o?n:void 0},className:"self-ui-switch-label ".concat(m),htmlFor:u.current},{children:[c("input",{checked:o,onChange:l,id:u.current,className:"self-ui-switch-input",type:"checkbox"}),c("span",{className:"self-ui-switch-button"})]}))}))}export{s as Switch};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as t,__generator as s}from"tslib";import o,{createElement as a,useReducer as n,useRef as i,useEffect as r,useMemo as u}from"react";import{jsx as c,jsxs as g,Fragment as m}from"react/jsx-runtime";import{TUIStore as p,StoreName as d,TUIChatService as l}from"@tencentcloud/chat-uikit-engine";import{JSONStringToParse as M}from"../untils.js";import{useTUIKitContext as I}from"../../context/TUIKitContext.js";import{TUIChatStateContextProvider as f}from"../../context/TUIChatStateContext.js";import{TUIChatActionProvider as h}from"../../context/TUIChatActionContext.js";import{ComponentProvider as v}from"../../context/ComponentContext.js";import T from"./hooks/useCreateTUIChatStateContext.js";import{TUIMessage as C}from"../TUIMessage/TUIMessage.js";import"../TUIMessage/MessagePlugins.js";import"../TUIMessage/MessageContext.js";import{CONSTANT_DISPATCH_TYPE as U}from"../../constants.js";import{chatReducer as j,initialState as S}from"./TUIChatState.js";import{useHandleMessageList as x}from"./hooks/useHandleMessageList.js";import{useHandleMessage as L}from"./hooks/useHandleMessage.js";import{TUIChatHeader as E}from"../TUIChatHeader/TUIChatHeader.js";import"@tencentcloud/chat";import"../Icon/config.js";import"../Icon/type.js";import"../../utils/env.js";import"../../context/TUIMessageContext.js";import{TUIMessageList as P}from"../TUIMessageList/TUIMessageList.js";import{TUIMessageInput as y}from"../TUIMessageInput/TUIMessageInput.js";import"react-i18next";import{EmptyStateIndicator as H}from"../EmptyStateIndicator/EmptyStateIndicator.js";function A(t){var s=t.conversation,o=t.EmptyPlaceholder,n=void 0===o?c(H,{listType:"chat"}):o,i=I("TUIChat"),r=i.conversation,u=i.chat,g=s||r;return(null==g?void 0:g.conversationID)?a(D,e({chat:u},t,{conversation:g,key:g.conversationID})):n}function D(o){var a=this,I=o.chat,H=o.conversation,A=o.className,D=o.children,k=o.TUIMessage,_=o.TUIChatHeader,R=o.TUIMessageInput,N=o.InputPlugins,w=o.MessagePlugins,F=o.MessageContext,G=o.MessageCustomPlugins,O=o.MessageTextPlugins,Q=o.InputQuote;o.onMessageRecevied,o.sendMessage;var V=o.revokeMessage;o.selectedConversation;var b=o.filterMessage,K=o.messageConfig,q=o.cloudCustomData,z=o.TUIMessageInputConfig,B=o.TUIMessageListConfig,J=n(j,e(e({},S),{conversation:H})),W=J[0],X=J[1],Y=i(null),Z=i(),$=T(e({chat:I,conversation:H,messageListRef:Y,textareaRef:Z,messageConfig:K,cloudCustomData:q,TUIMessageInputConfig:z,TUIMessageListConfig:B},W)),ee=x({chat:I,conversation:H,state:W,dispatch:X,filterMessage:b}),te=ee.editLocalMessage,se=ee.updateUploadPendingMessageList,oe=L({state:W,dispatch:X}),ae=oe.operateMessage,ne=oe.setAudioSource,ie=oe.setVideoSource,re=oe.setHighlightedMessageId,ue=oe.setActiveMessageID;r((function(){return p.watch(d.CHAT,{messageList:ce,isCompleted:ge}),function(){p.unwatch(d.CHAT,{messageList:ce,isCompleted:ge})}}),[]);var ce=function(e){var t=e.filter((function(e){return!e.isDeleted}));X({type:U.SET_MESSAGELIST,value:b?b(t):t})},ge=function(e){e&&X({type:U.SET_NO_MORE,value:e})},me=function(){return t(a,void 0,void 0,(function(){return s(this,(function(e){return l.getMessageList(),[2]}))}))},pe=function(e){return t(a,void 0,void 0,(function(){var t;return s(this,(function(s){return"TIMCustomElem"===e.type&&7===(null===(t=M(e.payload.data))||void 0===t?void 0:t.src)||W.firstSendMessage||X({type:U.SET_FIRST_SEND_MESSAGE,value:e}),[2]}))}))},de=u((function(){return{editLocalMessage:te,operateMessage:ae,loadMore:me,revokeMessage:V,setAudioSource:ne,setVideoSource:ie,setHighlightedMessageId:re,setActiveMessageID:ue,updateUploadPendingMessageList:se,setFirstSendMessage:pe}}),[te,ae,me,V,ne,ie,re,ue,se,pe]),le=u((function(){return{TUIMessage:k||C,MessageContext:F,InputPlugins:N,MessagePlugins:w,MessageCustomPlugins:G,MessageTextPlugins:O,TUIChatHeader:_,TUIMessageInput:R,InputQuote:Q}}),[]);return c("div",e({className:"chat ".concat(A)},{children:c(f,e({value:$},{children:c(h,e({value:de},{children:c(v,e({value:le},{children:D||g(m,{children:[c(E,{}),c(P,{}),c(y,{})]})}))}))}))}))}var k=o.memo(A);export{k as TUIChat};
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as s}from"tslib";import o,{createElement as a,useReducer as n,useRef as i,useEffect as r,useMemo as u}from"react";import{jsx as c,jsxs as g,Fragment as m}from"react/jsx-runtime";import{TUIStore as p,StoreName as d,TUIChatService as l}from"@tencentcloud/chat-uikit-engine";import{JSONStringToParse as M}from"../untils.js";import{useTUIKitContext as I}from"../../context/TUIKitContext.js";import{TUIChatStateContextProvider as f}from"../../context/TUIChatStateContext.js";import{TUIChatActionProvider as h}from"../../context/TUIChatActionContext.js";import{ComponentProvider as v}from"../../context/ComponentContext.js";import T from"./hooks/useCreateTUIChatStateContext.js";import{TUIMessage as C}from"../TUIMessage/TUIMessage.js";import"../TUIMessage/MessagePlugins.js";import"../TUIMessage/MessageContext.js";import{CONSTANT_DISPATCH_TYPE as U}from"../../constants.js";import{chatReducer as j,initialState as S}from"./TUIChatState.js";import{useHandleMessageList as x}from"./hooks/useHandleMessageList.js";import{useHandleMessage as L}from"./hooks/useHandleMessage.js";import{TUIChatHeader as E}from"../TUIChatHeader/TUIChatHeader.js";import"@tencentcloud/chat";import"../Icon/config.js";import"../Icon/type.js";import"../../utils/env.js";import"../../context/TUIMessageContext.js";import{TUIMessageList as P}from"../TUIMessageList/TUIMessageList.js";import{TUIMessageInput as y}from"../TUIMessageInput/TUIMessageInput.js";import"react-i18next";import{EmptyStateIndicator as H}from"../EmptyStateIndicator/EmptyStateIndicator.js";function A(t){var s=t.conversation,o=t.EmptyPlaceholder,n=void 0===o?c(H,{listType:"chat"}):o,i=I("TUIChat"),r=i.conversation,u=i.chat,g=s||r;return(null==g?void 0:g.conversationID)?a(D,e({chat:u},t,{conversation:g,key:g.conversationID})):n}function D(o){var a=this,I=o.chat,H=o.conversation,A=o.className,D=o.children,k=o.TUIMessage,_=o.TUIChatHeader,R=o.TUIMessageInput,N=o.InputPlugins,w=o.MessagePlugins,F=o.MessageContext,G=o.MessageCustomPlugins,O=o.MessageTextPlugins,Q=o.InputQuote;o.onMessageRecevied,o.sendMessage;var V=o.revokeMessage;o.selectedConversation;var b=o.filterMessage,K=o.messageConfig,q=o.cloudCustomData,z=o.TUIMessageInputConfig,B=o.TUIMessageListConfig,J=n(j,e(e({},S),{conversation:H})),W=J[0],X=J[1],Y=i(null),Z=i(),$=W&&T(e({chat:I,conversation:H,messageListRef:Y,textareaRef:Z,messageConfig:K,cloudCustomData:q,TUIMessageInputConfig:z,TUIMessageListConfig:B},W)),ee=x({chat:I,conversation:H,state:W,dispatch:X,filterMessage:b}),te=ee.editLocalMessage,se=ee.updateUploadPendingMessageList,oe=L({state:W,dispatch:X}),ae=oe.operateMessage,ne=oe.setAudioSource,ie=oe.setVideoSource,re=oe.setHighlightedMessageId,ue=oe.setActiveMessageID;r((function(){return p.watch(d.CHAT,{messageList:ce,isCompleted:ge}),function(){p.unwatch(d.CHAT,{messageList:ce,isCompleted:ge})}}),[]);var ce=function(e){var t=e.filter((function(e){return!e.isDeleted}));X({type:U.SET_MESSAGELIST,value:b?b(t):t})},ge=function(e){e&&X({type:U.SET_NO_MORE,value:e})},me=function(){return t(a,void 0,void 0,(function(){return s(this,(function(e){return l.getMessageList(),[2]}))}))},pe=function(e){return t(a,void 0,void 0,(function(){var t;return s(this,(function(s){return"TIMCustomElem"===e.type&&7===(null===(t=M(e.payload.data))||void 0===t?void 0:t.src)||W.firstSendMessage||X({type:U.SET_FIRST_SEND_MESSAGE,value:e}),[2]}))}))},de=u((function(){return{editLocalMessage:te,operateMessage:ae,loadMore:me,revokeMessage:V,setAudioSource:ne,setVideoSource:ie,setHighlightedMessageId:re,setActiveMessageID:ue,updateUploadPendingMessageList:se,setFirstSendMessage:pe}}),[te,ae,me,V,ne,ie,re,ue,se,pe]),le=u((function(){return{TUIMessage:k||C,MessageContext:F,InputPlugins:N,MessagePlugins:w,MessageCustomPlugins:G,MessageTextPlugins:O,TUIChatHeader:_,TUIMessageInput:R,InputQuote:Q}}),[]);return c("div",e({className:"chat ".concat(A)},{children:c(f,e({value:$},{children:c(h,e({value:de},{children:c(v,e({value:le},{children:D||g(m,{children:[c(E,{}),c(P,{}),c(y,{})]})}))}))}))}))}var k=o.memo(A);export{k as TUIChat};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e,__spreadArray as s}from"tslib";import{CONSTANT_DISPATCH_TYPE as a}from"../../constants.js";import{handleUploadPendingMessage as t,handleEditMessage as r}from"./unitls.js";var
|
|
1
|
+
import{__assign as e,__spreadArray as s}from"tslib";import{CONSTANT_DISPATCH_TYPE as a}from"../../constants.js";import{handleUploadPendingMessage as t,handleEditMessage as r}from"./unitls.js";var u=function(u,i){switch(null==i?void 0:i.type){case a.SET_CONVERSATION_PRPFILE:return e(e({},u),{conversation:i.value});case a.SET_MESSAGELIST:return e(e({},u),{messageList:i.value});case a.SET_EDIT_MESSAGE:return u.messageList&&i.value&&e(e({},u),{messageList:s([],r(u.messageList,i.value),!0)});case a.SET_IS_COMPLETE:return e(e({},u),{isCompleted:i.value});case a.RESET:return e({},E);case a.SET_HIGH_LIGHTED_MESSAGE_ID:return e(e({},u),{highlightedMessageId:i.value});case a.OPERATE_MESSAGE:return e(e({},u),{operateData:e({},i.value)});case a.SET_NO_MORE:return e(e({},u),{noMore:i.value});case a.SET_AUDIO_SOURCE:return e(e({},u),{audioSource:i.value});case a.SET_VIDEO_SOURCE:return e(e({},u),{vidoeSource:i.value});case a.UPDATE_UPLOAD_PENDING_MESSAGE_LIST:return(null==u?void 0:u.uploadPendingMessageList)&&i.value&&e(e({},u),{uploadPendingMessageList:s([],t(u.uploadPendingMessageList,i.value),!0)});case a.SET_FIRST_SEND_MESSAGE:return e(e({},u),{firstSendMessage:i.value});case a.SET_ACTIVE_MESSAGE_ID:return e(e({},u),{activeMessageID:i.value})}},E={conversation:{},messageList:[],nextReqMessageID:"",isCompleted:!1,init:!1,highlightedMessageId:"",lastMessageID:"",isSameLastMessageID:!1,operateData:{},noMore:!1,audioSource:null,vidoeSource:null,uploadPendingMessageList:[],firstSendMessage:null,activeMessageID:""};export{u as chatReducer,E as initialState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as e}from"react";import{CONSTANT_DISPATCH_TYPE as t}from"../../../constants.js";function o(o){o.state;var E=o.dispatch;return{operateMessage:e((function(e){E({type:t.OPERATE_MESSAGE,value:e})}),[E]),setAudioSource:e((function(e){E({type:t.SET_AUDIO_SOURCE,value:e})}),[E]),setVideoSource:e((function(e){E({type:t.SET_VIDEO_SOURCE,value:e})}),[E]),setHighlightedMessageId:e((function(e){E({type:t.SET_HIGH_LIGHTED_MESSAGE_ID,value:e})}),[E]),setActiveMessageID:e((function(e){E({type:t.SET_ACTIVE_MESSAGE_ID,value:e})}),[E])}}export{o as useHandleMessage};
|
|
1
|
+
import{useCallback as e}from"react";import{CONSTANT_DISPATCH_TYPE as t}from"../../../constants.js";function o(o){o.state;var E=o.dispatch;return{operateMessage:e((function(e){E&&E({type:t.OPERATE_MESSAGE,value:e})}),[E]),setAudioSource:e((function(e){E&&E({type:t.SET_AUDIO_SOURCE,value:e})}),[E]),setVideoSource:e((function(e){E&&E({type:t.SET_VIDEO_SOURCE,value:e})}),[E]),setHighlightedMessageId:e((function(e){E&&E({type:t.SET_HIGH_LIGHTED_MESSAGE_ID,value:e})}),[E]),setActiveMessageID:e((function(e){E&&E({type:t.SET_ACTIVE_MESSAGE_ID,value:e})}),[E])}}export{o as useHandleMessage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as t}from"react";import{CONSTANT_DISPATCH_TYPE as e}from"../../../constants.js";function a(a){a.chat,a.conversation,a.state;var n=a.dispatch;return a.filterMessage,{editLocalMessage:t((function(t){n({type:e.SET_EDIT_MESSAGE,value:t})}),[n]),updateUploadPendingMessageList:t((function(t){n({type:e.UPDATE_UPLOAD_PENDING_MESSAGE_LIST,value:t})}),[n])}}export{a as useHandleMessageList};
|
|
1
|
+
import{useCallback as t}from"react";import{CONSTANT_DISPATCH_TYPE as e}from"../../../constants.js";function a(a){a.chat,a.conversation,a.state;var n=a.dispatch;return a.filterMessage,{editLocalMessage:t((function(t){n&&n({type:e.SET_EDIT_MESSAGE,value:t})}),[n]),updateUploadPendingMessageList:t((function(t){n&&n({type:e.UPDATE_UPLOAD_PENDING_MESSAGE_LIST,value:t})}),[n])}}export{a as useHandleMessageList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__spreadArray as n}from"tslib";import"@tencentcloud/chat";import"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat-uikit-engine";import"react/jsx-runtime";import"react";import"../Icon/config.js";import"../Icon/type.js";var t=function(t,o){var r=n([],t,!0),i=r.findIndex((function(n){return(null==n?void 0:n.ID)===(null==o?void 0:o.ID)}));return r[i]=o,r},o=function(t,o){var r=n([],t,!0);r.some((function(n){return n.ID===o.ID}))||r.push(o);var i=r.findIndex((function(n){return(null==n?void 0:n.ID)===(null==o?void 0:o.ID)}));return r[i]=o,r};export{t as handleEditMessage,o as handleUploadPendingMessage};
|
|
1
|
+
import{__spreadArray as n}from"tslib";import"@tencentcloud/chat";import"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat-uikit-engine";import"react/jsx-runtime";import"react";import"../Icon/config.js";import"../Icon/type.js";var t=function(t,o){var r=n([],t,!0),i=r.findIndex((function(n){return(null==n?void 0:n.ID)===(null==o?void 0:o.ID)}));return r[i]=o,r},o=function(t,o){var r=n([],t,!0);r.some((function(n){return n.ID===(null==o?void 0:o.ID)}))||r.push(o);var i=r.findIndex((function(n){return(null==n?void 0:n.ID)===(null==o?void 0:o.ID)}));return r[i]=o,r};export{t as handleEditMessage,o as handleUploadPendingMessage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as t,jsxs as i}from"react/jsx-runtime";import a,{useState as o,useEffect as r}from"react";import n from"@tencentcloud/chat";import{TUIConversationService as c}from"@tencentcloud/chat-uikit-engine";import{Avatar as l}from"../Avatar/Avatar.js";import{handleDisplayAvatar as s}from"../untils.js";import{isH5 as m}from"../../utils/env.js";import{Icon as d}from"../Icon/Icon.js";import{IconTypes as h}from"../Icon/type.js";import{useTUIKitContext as u}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";function v(a){var v=a.title,p=void 0===v?"":v,f=a.avatar;a.isOnline;var C=a.conversation,S=a.isLive,N=a.opateIcon,T=u("TUIContact").setActiveContact,g=o(p),I=g[0],E=g[1],P=o(""),y=P[0],O=P[1];r((function(){switch(E(p),f&&O(f),null==C?void 0:C.type){case n.TYPES.CONV_C2C:Y(C.userProfile,null==C?void 0:C.remark);break;case n.TYPES.CONV_GROUP:j(C.groupProfile);break;case n.TYPES.CONV_SYSTEM:E("System Notice");break;default:E("")}}),[C]);var Y=function(e,i){I||E(i||(null==e?void 0:e.nick)||(null==e?void 0:e.userID)),f||O(t(l,{size:32,image:s(e.avatar)}))},j=function(e){I||E((null==e?void 0:e.name)||(null==e?void 0:e.groupID)),f||O(t(l,{size:32,image:s(e.avatar,n.TYPES.CONV_GROUP)}))},k=u().setTUIManageShow;return i("header",e({className:"tui-chat-header ".concat(S?"tui-chat-live-header":"")},{children:[m&&t("div",e({style:{paddingRight:"10px"}},{children:t(d,{onClick:function(){c.switchConversation(""),T()},type:h.BACK,width:9,height:16})})),t("div",e({className:"tui-chat-header-left ".concat((null==C?void 0:C.type)===n.TYPES.CONV_SYSTEM?"system":"")},{children:(null==C?void 0:C.type)!==n.TYPES.CONV_SYSTEM&&y})),t("div",e({className:"header-content"},{children:t("h3",e({className:"title"},{children:I}))})),t("div",e({className:"tui-chat-header-right"},{children:t("div",e({className:"header-handle"},{children:N||t(d,{className:"header-handle-more",onClick:function(){k(!0)},type:h.ELLIPSE,width:18,height:5})}))}))]}),null==C?void 0:C.conversationID)}var p=a.memo(v);function f(i){var a=e({},i);return t(p,e({},a))}export{f as TUIChatHeaderDefault};
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as t,jsxs as i}from"react/jsx-runtime";import a,{useState as o,useEffect as r}from"react";import n from"@tencentcloud/chat";import{TUIConversationService as c}from"@tencentcloud/chat-uikit-engine";import{Avatar as l}from"../Avatar/Avatar.js";import{handleDisplayAvatar as s}from"../untils.js";import{isH5 as m}from"../../utils/env.js";import{Icon as d}from"../Icon/Icon.js";import{IconTypes as h}from"../Icon/type.js";import{useTUIKitContext as u}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";function v(a){var v=a.title,p=void 0===v?"":v,f=a.avatar;a.isOnline;var C=a.conversation,S=a.isLive,N=a.opateIcon,T=u("TUIContact").setActiveContact,g=o(p),I=g[0],E=g[1],P=o(""),y=P[0],O=P[1];r((function(){switch(E(p),f&&O(f),null==C?void 0:C.type){case n.TYPES.CONV_C2C:Y(C.userProfile,null==C?void 0:C.remark);break;case n.TYPES.CONV_GROUP:j(C.groupProfile);break;case n.TYPES.CONV_SYSTEM:E("System Notice");break;default:E("")}}),[C]);var Y=function(e,i){I||E(i||(null==e?void 0:e.nick)||(null==e?void 0:e.userID)),f||O(t(l,{size:32,image:s(e.avatar)}))},j=function(e){I||E((null==e?void 0:e.name)||(null==e?void 0:e.groupID)),f||O(t(l,{size:32,image:s(e.avatar,n.TYPES.CONV_GROUP)}))},k=u().setTUIManageShow;return i("header",e({className:"tui-chat-header ".concat(S?"tui-chat-live-header":"")},{children:[m&&t("div",e({style:{paddingRight:"10px"}},{children:t(d,{onClick:function(){c.switchConversation(""),T()},type:h.BACK,width:9,height:16})})),t("div",e({className:"tui-chat-header-left ".concat((null==C?void 0:C.type)===n.TYPES.CONV_SYSTEM?"system":"")},{children:(null==C?void 0:C.type)!==n.TYPES.CONV_SYSTEM&&y})),t("div",e({className:"header-content"},{children:t("h3",e({className:"title"},{children:I}))})),t("div",e({className:"tui-chat-header-right"},{children:t("div",e({className:"header-handle"},{children:N||t(d,{className:"header-handle-more",onClick:function(){k&&k(!0)},type:h.ELLIPSE,width:18,height:5})}))}))]}),null==C?void 0:C.conversationID)}var p=a.memo(v);function f(i){var a=e({},i);return t(p,e({},a))}export{f as TUIChatHeaderDefault};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t,__awaiter as e,__generator as n}from"tslib";import{jsxs as i,Fragment as o,jsx as c}from"react/jsx-runtime";import r,{useState as a}from"react";import{useTranslation as m}from"react-i18next";import l from"./hooks/useContactInfo.js";import{BasicInfo as s}from"./basicInfo.js";import{DivWithEdit as d}from"../../DivWithEdit/DivWithEdit.js";function f(r){var f=this,u=r.profile,h=u.userID,v=m().t,p=a(""),N=p[0],b=p[1],x=a(""),I=x[0],g=x[1],k=a(""),C=k[0],j=k[1],w=a(!1),D=w[0],E=w[1],T=l().addFriend;return i(o,{children:[c(s,{profile:u}),D?c("div",t({className:"tui-contact-info-content"},{children:i("div",t({className:"content-item"},{children:[c("p",t({className:"content-item-label"},{children:v("TUIContact.verification info")})),c("p",t({className:"content-item-text"},{children:C}))]}))})):i("div",t({className:"tui-contact-info-content"},{children:[i("div",t({className:"content-item-wording"},{children:[c("p",t({className:"content-item-label"},{children:v("TUIContact.Enter the verification info")})),c("textarea",{className:"content-item-wording-text",value:C,onChange:function(t){j(t.target.value)}})]})),i("div",t({className:"content-item"},{children:[c("p",t({className:"content-item-label"},{children:v("TUIContact.remark")})),c(d,{name:"remark",className:"content-item-text",value:I,type:"text",toggle:function(){b("remark")},isEdit:"remark"===N,confirm:function(t){g(null==t?void 0:t.value),b("")},close:function(){b("")}})]})),c("div",t({className:"content-btn-container"},{children:c("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){return e(f,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,T({userID:h,remark:I,wording:C})];case 1:return t.sent(),E(!0),[2]}}))}))}},{children:v("TUIContact.Send application")}))}))]}))]})}var u=r.memo(f);export{u as AddFriendInfo,f as UnMemoizedAddFriendInfo};
|
|
1
|
+
import{__assign as t,__awaiter as e,__generator as n}from"tslib";import{jsxs as i,Fragment as o,jsx as c}from"react/jsx-runtime";import r,{useState as a}from"react";import{useTranslation as m}from"react-i18next";import l from"./hooks/useContactInfo.js";import{BasicInfo as s}from"./basicInfo.js";import{DivWithEdit as d}from"../../DivWithEdit/DivWithEdit.js";function f(r){var f=this,u=r.profile,h=u.userID,v=m().t,p=a(""),N=p[0],b=p[1],x=a(""),I=x[0],g=x[1],k=a(""),C=k[0],j=k[1],w=a(!1),D=w[0],E=w[1],T=l().addFriend;return i(o,{children:[c(s,{profile:u}),D?c("div",t({className:"tui-contact-info-content"},{children:i("div",t({className:"content-item"},{children:[c("p",t({className:"content-item-label"},{children:v("TUIContact.verification info")})),c("p",t({className:"content-item-text"},{children:C}))]}))})):i("div",t({className:"tui-contact-info-content"},{children:[i("div",t({className:"content-item-wording"},{children:[c("p",t({className:"content-item-label"},{children:v("TUIContact.Enter the verification info")})),c("textarea",{className:"content-item-wording-text",value:C,onChange:function(t){!function(t){j(t.target.value)}(t)}})]})),i("div",t({className:"content-item"},{children:[c("p",t({className:"content-item-label"},{children:v("TUIContact.remark")})),c(d,{name:"remark",className:"content-item-text",value:I,type:"text",toggle:function(){b("remark")},isEdit:"remark"===N,confirm:function(t){g(null==t?void 0:t.value),b("")},close:function(){b("")}})]})),c("div",t({className:"content-btn-container"},{children:c("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){return e(f,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,T({userID:h,remark:I,wording:C})];case 1:return t.sent(),E(!0),[2]}}))}))}},{children:v("TUIContact.Send application")}))}))]}))]})}var u=r.memo(f);export{u as AddFriendInfo,f as UnMemoizedAddFriendInfo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t,__awaiter as e,__generator as n}from"tslib";import{jsxs as o,Fragment as i,jsx as r}from"react/jsx-runtime";import c,{useState as a,useEffect as s}from"react";import{useTranslation as m}from"react-i18next";import{TUIConversationService as l}from"@tencentcloud/chat-uikit-engine";import{useTUIKitContext as u}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{BasicInfo as d}from"./basicInfo.js";import{Switch as f}from"../../Switch/Switch.js";import h from"./hooks/useContactInfo.js";import{DivWithEdit as v}from"../../DivWithEdit/DivWithEdit.js";import{useConversation as p}from"../../../hooks/useConversation.js";function C(c){var C=this,b=u("TUIContact"),k=b.chat,I=b.contactData,x=b.setActiveContact,N=b.setActiveConversation,j=m().t,T=c.friend,U=c.openChat,g=T.userID,w=T.profile,D=T.remark,E=a(""),S=E[0],A=E[1],F=a(""),M=F[0],W=F[1],y=a(!1),B=y[0],K=y[1],q=h(),z=q.addToBlocklist,G=q.deleteFriend,H=p(k).createConversation;s((function(){K(!1),W(D)}),[I,D]);return o(i,{children:[r(d,{profile:w}),o("div",t({className:"tui-contact-info-content"},{children:[o("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:j("TUIContact.remark")})),r(v,{name:"remark",className:"content-item-text",value:M,type:"text",toggle:function(){A("remark")},isEdit:"remark"===S,confirm:function(t){k.updateFriend({userID:g,remark:null==t?void 0:t.value}),W(null==t?void 0:t.value),A("")},close:function(){A("")}})]})),o("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:j("TUIContact.block")})),r(f,{className:"content-item-text",onChange:function(){return e(C,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,z(g)];case 1:return t.sent(),K(!0),x(),[2]}}))}))},checked:B})]})),o("div",t({className:"content-btn-container"},{children:[r("div",t({className:"content-item-btn delete-btn",role:"button",tabIndex:0,onClick:function(){return e(C,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,G(g)];case 1:return t.sent(),x(),[2]}}))}))}},{children:j("TUIContact.Delete friend")})),r("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){return e(C,void 0,void 0,(function(){var t,e;return n(this,(function(n){switch(n.label){case 0:return t="C2C".concat(g),[4,H(t)];case 1:return e=n.sent(),l.switchConversation(t),N(e),U(),[2]}}))}))}},{children:j("TUIContact.Send Message")}))]}))]}))]})}var b=c.memo(C);export{b as FriendInfo,C as UnMemoizedFriendInfo};
|
|
1
|
+
import{__assign as t,__awaiter as e,__generator as n}from"tslib";import{jsxs as o,Fragment as i,jsx as r}from"react/jsx-runtime";import c,{useState as a,useEffect as s}from"react";import{useTranslation as m}from"react-i18next";import{TUIConversationService as l}from"@tencentcloud/chat-uikit-engine";import{useTUIKitContext as u}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{BasicInfo as d}from"./basicInfo.js";import{Switch as f}from"../../Switch/Switch.js";import h from"./hooks/useContactInfo.js";import{DivWithEdit as v}from"../../DivWithEdit/DivWithEdit.js";import{useConversation as p}from"../../../hooks/useConversation.js";function C(c){var C=this,b=u("TUIContact"),k=b.chat,I=b.contactData,x=b.setActiveContact,N=b.setActiveConversation,j=m().t,T=c.friend,U=c.openChat,g=T.userID,w=T.profile,D=T.remark,E=a(""),S=E[0],A=E[1],F=a(""),M=F[0],W=F[1],y=a(!1),B=y[0],K=y[1],q=h(),z=q.addToBlocklist,G=q.deleteFriend,H=p(k).createConversation;s((function(){K(!1),W(D)}),[I,D]);return o(i,{children:[r(d,{profile:w}),o("div",t({className:"tui-contact-info-content"},{children:[o("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:j("TUIContact.remark")})),r(v,{name:"remark",className:"content-item-text",value:M,type:"text",toggle:function(){A("remark")},isEdit:"remark"===S,confirm:function(t){k.updateFriend({userID:g,remark:null==t?void 0:t.value}),W(null==t?void 0:t.value),A("")},close:function(){A("")}})]})),o("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:j("TUIContact.block")})),r(f,{className:"content-item-text",onChange:function(){return e(C,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,z(g)];case 1:return t.sent(),K(!0),x(),[2]}}))}))},checked:B})]})),o("div",t({className:"content-btn-container"},{children:[r("div",t({className:"content-item-btn delete-btn",role:"button",tabIndex:0,onClick:function(){return e(C,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,G(g)];case 1:return t.sent(),x(),[2]}}))}))}},{children:j("TUIContact.Delete friend")})),r("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){return e(C,void 0,void 0,(function(){var t,e;return n(this,(function(n){switch(n.label){case 0:return t="C2C".concat(g),[4,H(t)];case 1:return e=n.sent(),l.switchConversation(t),N(e),U&&U(),[2]}}))}))}},{children:j("TUIContact.Send Message")}))]}))]}))]})}var b=c.memo(C);export{b as FriendInfo,C as UnMemoizedFriendInfo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsxs as i,jsx as n}from"react/jsx-runtime";import c,{useState as a}from"react";import{useTranslation as e}from"react-i18next";import o from"@tencentcloud/chat";import{isH5 as s}from"../../../utils/env.js";import{useTUIKitContext as r}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{useTUIContactContext as l}from"../../../context/TUIContactContext.js";import m from"../TUIContactInfo/hooks/useContactInfo.js";import{Avatar as d}from"../../Avatar/Avatar.js";import{defaultUserAvatar as u}from"../../Avatar/default.js";import p from"../../Icon/images/right-arrow.svg.js";import f from"../../Icon/images/down-arrow.png.js";function v(){var c=r().setActiveContact,v=e().t,N=l("TUIContactList"),h=N.isShowContactList,I=N.friendList,C=N.blocklistProfile,x=N.friendApplicationList,b=m().acceptFriendApplication,g=a(!1),T=g[0],k=g[1],A=a(!1),j=A[0],U=A[1],P=a(!1),S=P[0],_=P[1];return h&&i("div",t({className:"tui-contacts-list ".concat(s?"tui-contacts-list-h5":""," ")},{children:[i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return k(!T)}},{children:[n("p",t({className:"tui-contacts-list-title"},{children:v("TUIContact.New Contacts")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:T?f:p,alt:""})}))]})),T&&x.map((function(a,e){var s=a.userID,r=a.avatar,l=a.nick,m=a.wording,p=a.type;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(t){t.stopPropagation(),c({type:"friendApplication",data:a})}},{children:[n(d,{size:30,image:r||u}),i("div",t({className:"tui-contacts-list-item-card"},{children:[i("div",{children:[n("p",t({className:"tui-contacts-list-item-name text-ellipsis"},{children:l||s})),""!==m&&n("p",t({className:"tui-contacts-list-item-text text-ellipsis"},{children:m}))]}),p===o.TYPES.SNS_APPLICATION_SENT_BY_ME&&n("p",t({className:"tui-contacts-list-btn-text text-ellipsis"},{children:v("TUIContact.waiting for verification")})),p===o.TYPES.SNS_APPLICATION_SENT_TO_ME&&n("div",t({className:"application-btn",role:"button",tabIndex:0,onClick:function(t){!function(t,i){t.stopPropagation(),b(i),c()}(t,s)}},{children:v("TUIContact.Agree")}))]}))]}),s)})),i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return _(!S)}},{children:[n("div",t({className:"tui-contacts-list-title"},{children:v("TUIContact.Blocked List")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:S?f:p,alt:""})}))]})),S&&C.map((function(a,e){var o=a.userID,s=a.avatar,r=a.nick;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(){c({type:"block",data:a})}},{children:[n(d,{size:30,image:s||u}),n("div",t({className:"tui-contacts-list-item-container"},{children:n("p",t({className:"tui-contacts-list-item-name"},{children:r||o}))}))]}),o)})),i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return U(!j)}},{children:[n("div",t({className:"tui-contacts-list-title"},{children:v("TUIContact.Friends")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:j?f:p,alt:""})}))]})),j&&I.map((function(a,e){var o=a.profile,s=o.userID,r=o.avatar,l=o.nick;return i("div",t({className:"tui-contacts-list-item",role:"button",tabIndex:0,onClick:function(){c({type:"friend",data:a})}},{children:[n(d,{size:30,image:r||u}),n("div",t({className:"tui-contacts-list-item-container"},{children:n("p",t({className:"tui-contacts-list-item-name"},{children:a.remark||l||s}))}))]}),s)}))]}))}var N=c.memo(v);export{N as TUIContactList};
|
|
1
|
+
import{__assign as t}from"tslib";import{jsxs as i,jsx as n}from"react/jsx-runtime";import c,{useState as a}from"react";import{useTranslation as e}from"react-i18next";import o from"@tencentcloud/chat";import{isH5 as s}from"../../../utils/env.js";import{useTUIKitContext as r}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{useTUIContactContext as l}from"../../../context/TUIContactContext.js";import m from"../TUIContactInfo/hooks/useContactInfo.js";import{Avatar as d}from"../../Avatar/Avatar.js";import{defaultUserAvatar as u}from"../../Avatar/default.js";import p from"../../Icon/images/right-arrow.svg.js";import f from"../../Icon/images/down-arrow.png.js";function v(){var c=r().setActiveContact,v=e().t,N=l("TUIContactList"),h=N.isShowContactList,I=N.friendList,C=N.blocklistProfile,x=N.friendApplicationList,b=m().acceptFriendApplication,g=a(!1),T=g[0],k=g[1],A=a(!1),j=A[0],U=A[1],P=a(!1),S=P[0],_=P[1];return h&&i("div",t({className:"tui-contacts-list ".concat(s?"tui-contacts-list-h5":""," ")},{children:[i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return k(!T)}},{children:[n("p",t({className:"tui-contacts-list-title"},{children:v("TUIContact.New Contacts")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:T?f:p,alt:""})}))]})),T&&(null==x?void 0:x.map((function(a,e){var s=a.userID,r=a.avatar,l=a.nick,m=a.wording,p=a.type;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(t){t.stopPropagation(),c({type:"friendApplication",data:a})}},{children:[n(d,{size:30,image:r||u}),i("div",t({className:"tui-contacts-list-item-card"},{children:[i("div",{children:[n("p",t({className:"tui-contacts-list-item-name text-ellipsis"},{children:l||s})),""!==m&&n("p",t({className:"tui-contacts-list-item-text text-ellipsis"},{children:m}))]}),p===o.TYPES.SNS_APPLICATION_SENT_BY_ME&&n("p",t({className:"tui-contacts-list-btn-text text-ellipsis"},{children:v("TUIContact.waiting for verification")})),p===o.TYPES.SNS_APPLICATION_SENT_TO_ME&&n("div",t({className:"application-btn",role:"button",tabIndex:0,onClick:function(t){!function(t,i){t.stopPropagation(),b(i),c()}(t,s)}},{children:v("TUIContact.Agree")}))]}))]}),s)}))),i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return _(!S)}},{children:[n("div",t({className:"tui-contacts-list-title"},{children:v("TUIContact.Blocked List")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:S?f:p,alt:""})}))]})),S&&(null==C?void 0:C.map((function(a,e){var o=a.userID,s=a.avatar,r=a.nick;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(){c({type:"block",data:a})}},{children:[n(d,{size:30,image:s||u}),n("div",t({className:"tui-contacts-list-item-container"},{children:n("p",t({className:"tui-contacts-list-item-name"},{children:r||o}))}))]}),o)}))),i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return U(!j)}},{children:[n("div",t({className:"tui-contacts-list-title"},{children:v("TUIContact.Friends")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:j?f:p,alt:""})}))]})),j&&(null==I?void 0:I.map((function(a,e){var o=a.profile,s=o.userID,r=o.avatar,l=o.nick;return i("div",t({className:"tui-contacts-list-item",role:"button",tabIndex:0,onClick:function(){c({type:"friend",data:a})}},{children:[n(d,{size:30,image:r||u}),n("div",t({className:"tui-contacts-list-item-container"},{children:n("p",t({className:"tui-contacts-list-item-name"},{children:a.remark||l||s}))}))]}),s)})))]}))}var N=c.memo(v);export{N as TUIContactList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t,__awaiter as e,__generator as r}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import a,{useState as i}from"react";import{useTranslation as c}from"react-i18next";import{useTUIKitContext as s}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{useTUIContactContext as u}from"../../context/TUIContactContext.js";import m from"./hooks/useContactSearch.js";import{Icon as l}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";import{Avatar as v}from"../Avatar/Avatar.js";import{defaultUserAvatar as f}from"../Avatar/default.js";import{Input as h}from"../Input/Input.js";function p(){var a=this,p=s("TUIContactSearch");p.chat;var I=p.setActiveContact,C=c().t,x=u("TUIContactList"),j=x.friendList,g=x.setShowContactList,U=i(!1),T=U[0],b=U[1],k=m(),y=k.checkFriend,N=k.isBlock,A=k.getUserProfile,D=i(""),w=D[0],S=D[1],F=i([]),L=F[0],B=F[1];return n("div",t({className:"tui-contact-search"},{children:[o(h,{className:"tui-contact-search-input",placeholder:C("TUIContact.Enter a userID"),clearable:!0,value:w,onBlur:function(t){var e;S(null===(e=t.target)||void 0===e?void 0:e.value)},onFocus:function(){I()},onChange:function(t){var e,r;if(""===(null===(e=t.target)||void 0===e?void 0:e.value))return g(!0),b(!1),void B([]);b(!0),S(null===(r=t.target)||void 0===r?void 0:r.value),g(!1)},onKeyDown:function(){return e(a,void 0,void 0,(function(){return r(this,(function(t){return w&&A(w).then((function(t){var e=t.data;B(e)})),[2]}))}))},prefix:o(l,{type:d.SEARCH,height:16,width:16})}),T&&0===L.length?o("div",t({className:"tui-contact-search-item"},{children:C("TUIContact.No Result")})):L.map((function(i,c){var s=i.userID,u=i.avatar,m=i.nick;return n("div",t({className:"tui-contact-search-item",role:"button",tabIndex:0,onClick:function(){var t;t=i,e(a,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return[4,y(t)];case 1:return r.sent()?(e=j.find((function(t){return t.userID===w}))
|
|
1
|
+
import{__assign as t,__awaiter as e,__generator as r}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import a,{useState as i}from"react";import{useTranslation as c}from"react-i18next";import{useTUIKitContext as s}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{useTUIContactContext as u}from"../../context/TUIContactContext.js";import m from"./hooks/useContactSearch.js";import{Icon as l}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";import{Avatar as v}from"../Avatar/Avatar.js";import{defaultUserAvatar as f}from"../Avatar/default.js";import{Input as h}from"../Input/Input.js";function p(){var a=this,p=s("TUIContactSearch");p.chat;var I=p.setActiveContact,C=c().t,x=u("TUIContactList"),j=x.friendList,g=x.setShowContactList,U=i(!1),T=U[0],b=U[1],k=m(),y=k.checkFriend,N=k.isBlock,A=k.getUserProfile,D=i(""),w=D[0],S=D[1],F=i([]),L=F[0],B=F[1];return n("div",t({className:"tui-contact-search"},{children:[o(h,{className:"tui-contact-search-input",placeholder:C("TUIContact.Enter a userID"),clearable:!0,value:w,onBlur:function(t){var e;S(null===(e=t.target)||void 0===e?void 0:e.value)},onFocus:function(){I()},onChange:function(t){var e,r;if(""===(null===(e=t.target)||void 0===e?void 0:e.value))return g&&g(!0),b(!1),void B([]);b(!0),S(null===(r=t.target)||void 0===r?void 0:r.value),g&&g(!1)},onKeyDown:function(){return e(a,void 0,void 0,(function(){return r(this,(function(t){return w&&A(w).then((function(t){var e=t.data;B(e)})),[2]}))}))},prefix:o(l,{type:d.SEARCH,height:16,width:16})}),T&&0===L.length?o("div",t({className:"tui-contact-search-item"},{children:C("TUIContact.No Result")})):L.map((function(i,c){var s=i.userID,u=i.avatar,m=i.nick;return n("div",t({className:"tui-contact-search-item",role:"button",tabIndex:0,onClick:function(){var t;t=i,e(a,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return[4,y(t)];case 1:return r.sent()?((e=null==j?void 0:j.find((function(t){return t.userID===w})))&&I({type:"friend",data:e}),[2]):N(t.userID)?(I({type:"block",data:t}),[2]):(I({type:"addFriend",data:t}),[2])}}))}))}},{children:[o(v,{size:30,image:u||f}),o("div",t({className:"search-item-name"},{children:m||s}))]}),s)}))]}))}var I=a.memo(p);export{I as TUIContactSearch,p as UnMemoizedTUIContactSearch};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@tencentcloud/chat";import{useTUIKitContext as e}from"../../../context/TUIKitContext.js";import"tslib";import"react/jsx-runtime";import"react";import"../../../context/TUIMessageContext.js";import{useTUIContactContext as
|
|
1
|
+
import t from"@tencentcloud/chat";import{useTUIKitContext as e}from"../../../context/TUIKitContext.js";import"tslib";import"react/jsx-runtime";import"react";import"../../../context/TUIMessageContext.js";import{useTUIContactContext as o}from"../../../context/TUIContactContext.js";function r(){var r=o("TUIContactList").blockList,n=e("TUIContactSearch").chat;return{checkFriend:function(e){return n.checkFriend({userIDList:[null==e?void 0:e.userID],type:t.TYPES.SNS_CHECK_TYPE_BOTH}).then((function(e){var o,r;return(null===(r=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.successUserIDList[0])||void 0===r?void 0:r.relation)===t.TYPES.SNS_TYPE_BOTH_WAY}))},isBlock:function(t){return null==r?void 0:r.includes(t)},getUserProfile:function(t){return n.getUserProfile({userIDList:[t]})}}}export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsx as
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import o,{useMemo as r}from"react";import{TUIConversationProvider as n}from"../../context/TUIConversationContext.js";import{TUIConversationList as i}from"../TUIConversationList/TUIConversationList.js";import"@tencentcloud/chat";import"@tencentcloud/chat-uikit-engine";function a(o){var a=o.children,c=o.createConversation,m=o.deleteConversation,s=o.filterConversation,v=r((function(){return{createConversation:c,deleteConversation:m,filterConversation:s}}),[c,m,s]);return e(n,t({value:v},{children:a||e(i,{})}))}var c=o.memo(a);export{c as TUIConversation,a as UnMemoizedTUIConversation};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useState as t,useEffect as n}from"react";import o from"@tencentcloud/chat";import{TUIStore as r,StoreName as e}from"@tencentcloud/chat-uikit-engine";function i(i,c,a){var u=t([]),f=u[0],s=u[1],m=function(t){var n=[];n=a?a(t):t.filter((function(t){return t.type!==o.TYPES.CONV_SYSTEM})),s(n),c&&c(n,s)};return n((function(){r.watch(e.CONV,{conversationList:m})}),[i]),{conversationList:f,setConversationList:s}}export{i as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as t}from"react";import n from"@tencentcloud/chat";import{useTUIKitContext as o}from"../../../context/TUIKitContext.js";import"tslib";import"react/jsx-runtime";import"../../../context/TUIMessageContext.js";var r=function(r,e,i,a){var c=o("useConversationUpdate").chat;t((function(){var t=function(t){r&&r(a?a(t.data):t.data.filter((function(t){return t.type!==n.TYPES.CONV_SYSTEM}))),i&&i(),e&&"function"==typeof e&&e(r,t)};return null==c||c.on(n.EVENT.CONVERSATION_LIST_UPDATED,t),function(){null==c||c.off(n.EVENT.CONVERSATION_LIST_UPDATED,t)}}),[c,e])};export{r as useConversationUpdate};
|
|
1
|
+
import{useEffect as t}from"react";import n from"@tencentcloud/chat";import{useTUIKitContext as o}from"../../../context/TUIKitContext.js";import"tslib";import"react/jsx-runtime";import"../../../context/TUIMessageContext.js";var r=function(r,e,i,a){var c=o("useConversationUpdate").chat;t((function(){var t=function(t){r&&r(a?a(t.data):t.data.filter((function(t){return t.type!==n.TYPES.CONV_SYSTEM}))),i&&i(),e&&"function"==typeof e&&r&&e(r,t)};return null==c||c.on(n.EVENT.CONVERSATION_LIST_UPDATED,t),function(){null==c||c.off(n.EVENT.CONVERSATION_LIST_UPDATED,t)}}),[c,e])};export{r as useConversationUpdate};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Conversation } from '@tencentcloud/chat';
|
|
3
3
|
|
|
4
4
|
interface ChatProps {
|
|
5
|
-
chat?:
|
|
5
|
+
chat?: any;
|
|
6
6
|
language?: string;
|
|
7
7
|
customClasses?: unknown;
|
|
8
8
|
activeConversation?: Conversation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsx as e,jsxs as o,Fragment as a}from"react/jsx-runtime";import{useState as n,useEffect as r}from"react";import{TUIStore as i,StoreName as c}from"@tencentcloud/chat-uikit-engine";import{
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e,jsxs as o,Fragment as a}from"react/jsx-runtime";import{useState as n,useEffect as r}from"react";import{TUIStore as i,StoreName as c}from"@tencentcloud/chat-uikit-engine";import{TUILogin as s}from"@tencentcloud/tui-core";import{useTranslation as l}from"react-i18next";import{isPC as m,isH5 as u}from"../../utils/env.js";import{useTUIKit as C}from"./hooks/useTUIKit.js";import{useCreateTUIKitContext as h}from"./hooks/useCreateTUIKitContext.js";import{TUIKitProvider as d}from"../../context/TUIKitContext.js";import{TUIConversation as f}from"../TUIConversation/TUIConversation.js";import{TUIChat as T}from"../TUIChat/TUIChat.js";import{TUIManage as v}from"../TUIManage/TUIManage.js";import{TUIProfile as p}from"../TUIProfile/TUIProfile.js";import"../TUIProfile/TUIProfileDefault.js";import"@tencentcloud/chat";import"../../context/TUIMessageContext.js";import"../Icon/config.js";import"../Icon/type.js";import{TUIContactInfo as I}from"../TUIContact/TUIContactInfo/TUIContactInfo.js";import{TUIContact as g}from"../TUIContact/TUIContact.js";import{TUIKIT_TABBAR as U}from"../../constants.js";import"../../locales/index.js";import S from"../Icon/images/chats.svg.js";import j from"../Icon/images/chats-selected.svg.js";import A from"../Icon/images/contacts.svg.js";import N from"../Icon/images/contacts-selected.svg.js";var w=[{id:1,name:U.CHATS,icon:S,selectedIcon:j,value:U.CHATS},{id:2,name:U.CONTACTS,icon:A,selectedIcon:N,value:U.CONTACTS}],b={className:"sample-h5-input",isTransmitter:!0};function x(n){var r=n.moduleValue,i=n.tabbarRender,c=n.setModuleValue;return o(a,{children:[o("div",t({className:"sample-chat-left-container"},{children:[e(p,{className:"sample-chat-profile"}),i,r===U.CHATS&&e(f,{}),r===U.CONTACTS&&e(g,{})]})),r===U.CHATS&&o(a,{children:[e(T,{}),e(v,{})]}),r===U.CONTACTS&&e(g,{children:e(I,{showChat:function(){c(U.CHATS)}})})]})}function M(n){var r=n.moduleValue,i=n.contactData,c=n.tabbarRender,s=n.currentConversationID,l=n.setModuleValue;return o(a,{children:[!s&&!i&&o("div",t({className:"sample-chat-h5-container"},{children:[e(p,{className:"sample-profile"}),c,r===U.CHATS&&e(f,{}),r===U.CONTACTS&&e(g,{})]})),r===U.CHATS&&s&&o(a,{children:[e(T,{TUIMessageInputConfig:b}),e(v,{})]}),r===U.CONTACTS&&i&&e(g,{children:e(I,{showChat:function(){l(U.CHATS)}})})]})}function P(a){var f=n("chats"),T=f[0],v=f[1],p=l().t,I=a.children,g=a.chat,U=void 0===g?s.getContext().chat:g,S=a.customClasses,j=a.activeConversation,A=a.language,N=void 0===A?"en":A;window.tencent_cloud_im_csig_react_uikit_23F_xa=!0;var b=C({chat:U,activeConversation:j,language:N}),P=b.conversation,V=b.contactData,D=b.setActiveConversation,H=b.myProfile,O=b.TUIManageShow,_=b.setTUIManageShow,k=b.TUIProfileShow,R=b.setTUIProfileShow,y=b.setActiveContact,K=h({chat:U,language:N,conversation:P,contactData:V,setActiveConversation:D,customClasses:S,myProfile:H,TUIManageShow:O,setTUIManageShow:_,TUIProfileShow:k,setTUIProfileShow:R,setActiveContact:y});r((function(){return i.watch(c.CONV,{currentConversation:F}),function(){i.unwatch(c.CONV,{currentConversation:F})}}),[]);var F=function(t){D(null==t?void 0:t.getConversation())},q=e("div",t({className:"sample-chat-tab"},{children:w.map((function(a){return o("div",t({className:"sample-chat-tab-container",role:"presentation",onClick:function(){var t;t=a.value,v(t)}},{children:[e("img",{src:T===a.value?a.selectedIcon:a.icon,alt:""}),e("p",t({className:"sample-chat-tab-text ".concat(T===a.value?"sample-chat-tab-active":"")},{children:p(a.name)}))]}),a.id)}))}));return e(d,t({value:K},{children:e("div",t({className:"tui-kit"},{children:I||m&&e(x,{moduleValue:T,tabbarRender:q,setModuleValue:v})||u&&e(M,{contactData:V,moduleValue:T,tabbarRender:q,currentConversationID:(null==P?void 0:P.conversationID)||"",setModuleValue:v})}))}))}export{P as TUIKit};
|
|
@@ -6,15 +6,15 @@ import { TUIKitContextValue } from '../../../context/TUIKitContext.js';
|
|
|
6
6
|
declare const useCreateTUIKitContext: (value: TUIKitContextValue) => {
|
|
7
7
|
chat: _tencentcloud_chat.ChatSDK;
|
|
8
8
|
language: string;
|
|
9
|
-
conversation: _tencentcloud_chat.Conversation;
|
|
9
|
+
conversation: _tencentcloud_chat.Conversation | undefined;
|
|
10
10
|
contactData: UseContactParams;
|
|
11
11
|
customClasses: unknown;
|
|
12
|
-
setActiveConversation: (conversation?: _tencentcloud_chat.Conversation) => void;
|
|
13
|
-
myProfile: _tencentcloud_chat.Profile;
|
|
14
|
-
TUIManageShow: boolean;
|
|
15
|
-
setTUIManageShow: React.Dispatch<React.SetStateAction<boolean
|
|
16
|
-
TUIProfileShow: boolean;
|
|
17
|
-
setTUIProfileShow: React.Dispatch<React.SetStateAction<boolean
|
|
12
|
+
setActiveConversation: (conversation?: _tencentcloud_chat.Conversation | undefined) => void;
|
|
13
|
+
myProfile: _tencentcloud_chat.Profile | undefined;
|
|
14
|
+
TUIManageShow: boolean | undefined;
|
|
15
|
+
setTUIManageShow: React.Dispatch<React.SetStateAction<boolean>> | undefined;
|
|
16
|
+
TUIProfileShow: boolean | undefined;
|
|
17
|
+
setTUIProfileShow: React.Dispatch<React.SetStateAction<boolean>> | undefined;
|
|
18
18
|
setActiveContact: (UseContactParams?: UseContactParams) => void;
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -24,10 +24,10 @@ interface UseChatParams {
|
|
|
24
24
|
language?: string;
|
|
25
25
|
}
|
|
26
26
|
declare const useTUIKit: ({ chat, activeConversation: paramsActiveConversation, language, }: UseChatParams) => {
|
|
27
|
-
conversation: Conversation;
|
|
27
|
+
conversation: Conversation | undefined;
|
|
28
28
|
contactData: UseContactParams;
|
|
29
29
|
setActiveConversation: (activeConversation?: Conversation) => void;
|
|
30
|
-
myProfile: Profile;
|
|
30
|
+
myProfile: Profile | undefined;
|
|
31
31
|
TUIManageShow: boolean;
|
|
32
32
|
setTUIManageShow: React.Dispatch<React.SetStateAction<boolean>>;
|
|
33
33
|
TUIProfileShow: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useState as n,useEffect as t,useCallback as o}from"react";import{TUIStore as e,StoreName as a}from"@tencentcloud/chat-uikit-engine";import{useTranslation as i}from"react-i18next";var r=function(r){var c=r.chat,s=r.activeConversation,u=r.language,v=i().i18n,f=n(s),l=f[0],g=f[1],h=n(),I=h[0],m=h[1],w=n(!1),D=w[0],S=w[1],U=n(!1),p=U[0],P=U[1],T=n(),d=T[0],C=T[1];t((function(){v.changeLanguage(u),e.watch(a.USER,{userProfile:function(n){m(n)}})}),[u]);var M=o((function(n){n&&(null==c||c.setMessageRead({conversationID:n.conversationID})),l&&(null==n?void 0:n.conversationID)!==l.conversationID&&S(!1),n&&g(n)}),[c]);return t((function(){s&&g(s)}),[s]),{conversation:l,contactData:d,setActiveConversation:M,myProfile:I,TUIManageShow:D,setTUIManageShow:S,TUIProfileShow:p,setTUIProfileShow:P,setActiveContact:function(n){C(n)}}};export{r as useTUIKit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as n}from"tslib";import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useState as
|
|
1
|
+
import{__assign as n}from"tslib";import{jsxs as e,jsx as i}from"react/jsx-runtime";import o,{useState as t,useEffect as a}from"react";import{useTranslation as r}from"react-i18next";import{Icon as s}from"../Icon/Icon.js";import{IconTypes as c}from"../Icon/type.js";import{Avatar as l}from"../Avatar/Avatar.js";import{defaultGroupAvatarWork as m,defaultUserAvatar as d}from"../Avatar/default.js";import{Switch as v}from"../Switch/Switch.js";import{useTUIKitContext as h}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{isH5 as u,isPC as f}from"../../utils/env.js";import{getMessageProfile as p}from"../ConversationPreview/utils.js";import{useConversationUpdate as g}from"../TUIConversationList/hooks/useConversationUpdate.js";import{useConversation as I}from"../../hooks/useConversation.js";function C(){var o=r().t,C=t(),N=C[0],j=C[1],x=t(),D=x[0],U=x[1],k=t(!1),T=k[0],w=k[1],A=t(0),y=A[0],M=A[1],P=h("TUIManage"),S=P.conversation,b=P.setActiveConversation,L=P.chat,K=P.TUIManageShow,z=P.setTUIManageShow;g(void 0,(function(){M((function(n){return n+1}))}));var B=I(L),E=B.pinConversation,q=B.deleteConversation,F=function(){z&&z(!1)};return a((function(){j(S),S&&U(p(S)),w(!!S&&S.isPinned)}),[S,y]),K&&S&&e("div",n({className:"tui-manage ".concat(u?"tui-h5-manage":"")},{children:[e("div",n({className:"tui-manage-title"},{children:[f&&i(s,{onClick:F,type:c.CANCEL,width:9,height:16}),u&&i(s,{onClick:F,type:c.BACK,width:9,height:16}),i("span",n({style:{marginLeft:"10px"}},{children:o("TUIConversation.Conversation Information")}))]})),e("div",n({className:"tui-manage-container"},{children:[e("div",n({className:"tui-manage-info"},{children:[i("div",n({className:"info-avatar"},{children:i(l,{size:64,image:(null==D?void 0:D.avatar)||((null==D?void 0:D.groupID)?m:d)})})),i("div",n({className:"info-name"},{children:(null==D?void 0:D.nick)||(null==D?void 0:D.name)})),e("div",n({className:"info-id"},{children:["ID:",(null==D?void 0:D.userID)||(null==D?void 0:D.groupID)]}))]})),e("div",n({className:"tui-manage-handle"},{children:[e("div",n({className:"manage-handle-box"},{children:[i("div",n({className:"manage-handle-title"},{children:o("TUIConversation.Pin")})),i(v,{onChange:function(n){!function(n){w(n.target.checked),(null==N?void 0:N.conversationID)&&E({conversationID:N.conversationID,isPinned:n.target.checked})}(n)},checked:T})]})),f&&i("div",n({className:"manage-handle-box",role:"presentation",onClick:function(){(null==N?void 0:N.conversationID)&&q(N.conversationID),b(void 0)}},{children:i("div",n({className:"manage-handle-title red"},{children:o("TUIConversation.Delete")}))}))]}))]}))]}))}var N=o.memo(C);export{N as TUIManage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as n,jsxs as t}from"react/jsx-runtime";import r,{useState as o,useRef as c,useCallback as i,useEffect as u}from"react";import{useTUIChatStateContext as a}from"../../context/TUIChatStateContext.js";import{useTUIChatActionContext as s}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{Icon as l}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";function m(r){var m=r.context,p=r.message,
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as n,jsxs as t}from"react/jsx-runtime";import r,{useState as o,useRef as c,useCallback as i,useEffect as u}from"react";import{useTUIChatStateContext as a}from"../../context/TUIChatStateContext.js";import{useTUIChatActionContext as s}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{Icon as l}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";function m(r){var m=r.context,p=r.message,v=r.children,f=s().setAudioSource,h=a("MessageAudioWithContext").audioSource,x=o(0),g=x[0],C=x[1],I=c(null),j=o(!1),E=j[0],y=j[1],L=i((function(){h&&h!==(null==I?void 0:I.current)&&(h.pause(),h.currentTime=0,f&&f(null)),(null==I?void 0:I.current)&&(I.current.paused?(I.current.play(),y(!0),f&&f(I.current)):(I.current.pause(),N()))}),[I,h]),T=function(){y(!1)},N=function(){f&&f(null),I.current&&(I.current.currentTime=0),T()};return u((function(){return(null==I?void 0:I.current)&&(I.current.addEventListener("pause",T),I.current.addEventListener("ended",N),I.current.addEventListener("canplay",(function(){var e;C(parseInt("".concat(null===(e=I.current)||void 0===e?void 0:e.duration),10))}))),function(){(null==I?void 0:I.current)&&(I.current.removeEventListener("pause",T),I.current.removeEventListener("ended",N))}}),[I]),t("div",e({className:"message-audio"},{children:[t("div",e({className:"message-audio-content message-audio-".concat(null==p?void 0:p.flow)},{children:[n(l,{className:"".concat(null==p?void 0:p.flow," ").concat(E?"playing":""),type:d.VOICE,width:16,height:16,onClick:L}),n("span",{children:"".concat(g,"s")})]})),n("audio",e({src:null==m?void 0:m.url,ref:I,controls:!0,className:"message-audio-none"},{children:n("track",{kind:"captions"})})),v]}))}var p=r.memo(m);function v(t){return n(p,e({},t))}export{v as MessageAudio};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import"tslib";import"react";import{messageShowType as
|
|
1
|
+
import{jsx as t,Fragment as r}from"react/jsx-runtime";import"tslib";import"react";import{messageShowType as o}from"../../context/TUIMessageContext.js";import{Avatar as a}from"../Avatar/Avatar.js";import{handleDisplayAvatar as e}from"../untils.js";function m(m){m.className;var s=m.CustomAvatar,i=m.message,n=m.showType;return(n===o.ALL||(null==i?void 0:i.flow)===n)&&n!==o.NONE?s||t(a,{size:32,image:e(null==i?void 0:i.avatar)}):t(r,{})}export{m as MessageAvatar};
|