@tencentcloud/chat-uikit-react 2.1.2 → 2.1.3
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 +5 -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/TUIConversationList/hooks/useConversationUpdate.js +1 -1
- package/dist/cjs/components/TUIKit/TUIKit.d.ts +2 -2
- 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.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/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/TUIConversationList/hooks/useConversationUpdate.js +1 -1
- package/dist/esm/components/TUIKit/TUIKit.d.ts +2 -2
- 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.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/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/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 +1 -1
- package/src/components/TUIConversationList/hooks/useConversationUpdate.tsx +2 -2
- package/src/components/TUIKit/TUIKit.tsx +1 -1
- package/src/components/TUIKit/hooks/useTUIKit.tsx +4 -4
- 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 +15 -15
- package/src/components/TUIProfile/hooks/useMyProfile.tsx +6 -6
- 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
|
@@ -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{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;
|
|
@@ -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{__awaiter as n,__generator as t}from"tslib";import{useState as o,useEffect as e,useCallback as a}from"react";import{useTranslation as i}from"react-i18next";var r=function(r){var c=r.chat,s=r.activeConversation,v=r.language,u=i().i18n,
|
|
1
|
+
import{__awaiter as n,__generator as t}from"tslib";import{useState as o,useEffect as e,useCallback as a}from"react";import{useTranslation as i}from"react-i18next";var r=function(r){var c=r.chat,s=r.activeConversation,v=r.language,u=i().i18n,l=o(s),f=l[0],g=l[1],d=o(),h=d[0],I=d[1],m=o(!1),w=m[0],D=m[1],p=o(!1),M=p[0],P=p[1],S=o(),T=S[0],U=S[1];e((function(){u.changeLanguage(v);n(void 0,void 0,void 0,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return[4,null==c?void 0:c.getMyProfile()];case 1:return n=t.sent(),I(null==n?void 0:n.data),[2]}}))}))}),[c,v]);var C=a((function(n){n&&(null==c||c.setMessageRead({conversationID:n.conversationID})),f&&(null==n?void 0:n.conversationID)!==f.conversationID&&D(!1),n&&g(n)}),[c]);return e((function(){s&&g(s)}),[s]),{conversation:f,contactData:T,setActiveConversation:C,myProfile:h,TUIManageShow:w,setTUIManageShow:D,TUIProfileShow:M,setTUIProfileShow:P,setActiveContact:function(n){U(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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as t,jsxs as s}from"react/jsx-runtime";import o,{useState as n,useEffect as i}from"react";import
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as t,jsxs as s}from"react/jsx-runtime";import o,{useState as n,useEffect as i}from"react";import l from"@tencentcloud/chat";import{MESSAGE_STATUS as a}from"../../constants.js";import{useTUIChatStateContext as c}from"../../context/TUIChatStateContext.js";import{useTUIChatActionContext as r}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{Icon as m}from"../Icon/Icon.js";import{IconTypes as u}from"../Icon/type.js";import{useMessageReply as d}from"./hooks/useMessageReply.js";import{MessageProgress as g}from"./MessageProgress.js";function p(o){var p=o.message,b=o.children,v=o.Context,f=o.Plugins,I=n(!1),h=I[0],x=I[1],M=d({message:p}),N=M.messageReply,y=M.replyMessage,S=M.sender,D=r(),E=D.setHighlightedMessageId,j=D.setActiveMessageID,C=c("MessageBubbleWithContext").activeMessageID;i((function(){C!==(null==p?void 0:p.ID)&&x(!1)}),[C]);return s("div",e({className:"meesage-bubble"},{children:[s("div",e({className:"meesage-bubble-context ".concat(null==p?void 0:p.flow),role:"button",tabIndex:0,onMouseEnter:function(){j&&p&&j(null==p?void 0:p.ID),x(!0)},onMouseLeave:function(){j&&p&&j(p.ID),x(!1)},onClick:function(){j&&p&&j(p.ID)}},{children:[s("div",e({className:"message-context\n ".concat(N?"meesage-bubble-reply meesage-bubble-reply-".concat(null==p?void 0:p.flow):"","\n ").concat((null==p?void 0:p.type)!==l.TYPES.MSG_IMAGE&&(null==p?void 0:p.type)!==l.TYPES.MSG_VIDEO&&(null==p?void 0:p.type)!==l.TYPES.MSG_FILE||(null==p?void 0:p.status)!==a.UNSEND?"":"loading")},{children:[N&&s("div",e({className:"meesage-bubble-reply-main",role:"menuitem",tabIndex:0,onClick:function(){E&&E(null==y?void 0:y.ID)}},{children:[t("header",e({className:"title"},{children:S})),v&&t(v,{message:y})]})),b,t(g,{message:p})]})),f&&t("div",e({className:"message-plugin"},{children:h&&t(f,{message:p})}))]})),s("div",e({className:"message-bubble-status icon"},{children:[(null==p?void 0:p.status)===a.FAIL&&t("i",{className:"icon-fail"}),(null==p?void 0:p.status)===a.UNSEND&&t(m,{width:10,height:10,type:u.PROGRESS})]}))]}))}var b=o.memo(p);function v(s){return t(b,e({},s))}export{v as MessageBubble};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import o from"react";import s from"@tencentcloud/chat";import{MessageAudio as m}from"./MessageAudio.js";import{MessageCustom as r}from"./MessageCustom.js";import{MessageFace as i}from"./MessageFace.js";import{MessageFile as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import o from"react";import s from"@tencentcloud/chat";import{MessageAudio as m}from"./MessageAudio.js";import{MessageCustom as r}from"./MessageCustom.js";import{MessageFace as i}from"./MessageFace.js";import{MessageFile as E}from"./MessageFile.js";import{MessageImage as n}from"./MessageImage.js";import{MessageLocation as M}from"./MessageLocation.js";import{MessageMerger as S}from"./MessageMerger.js";import{MessageText as a}from"./MessageText.js";import{MessageVideo as T}from"./MessageVideo.js";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import"../../constants.js";import"date-fns";import"date-fns/locale";import"../Icon/config.js";import"../Icon/type.js";import{useTUIMessageContext as p}from"../../context/TUIMessageContext.js";import{useMessageContextHandler as c}from"./hooks/useMessageContextHandler.js";import{MessageStatus as g}from"./MessageStatus.js";var G,f=((G={})[s.TYPES.MSG_TEXT]=a,G[s.TYPES.MSG_FACE]=i,G[s.TYPES.MSG_IMAGE]=n,G[s.TYPES.MSG_AUDIO]=m,G[s.TYPES.MSG_VIDEO]=T,G[s.TYPES.MSG_FILE]=E,G[s.TYPES.MSG_CUSTOM]=r,G[s.TYPES.MSG_MERGER]=S,G[s.TYPES.MSG_LOCATION]=M,G);function l(o){var m,r=o.message,i=c({message:r}).context,E=p("MessageCustom"),n=E.CustemElement,M=E.TextElement,S=E.FaceElement,a=E.ImageElement,T=E.AudioElement,G=E.VideoElement,l=E.FileElement,P=E.MergerElement,Y=E.LocationElement,_=((m={})[s.TYPES.MSG_TEXT]=M,m[s.TYPES.MSG_FACE]=S,m[s.TYPES.MSG_IMAGE]=a,m[s.TYPES.MSG_AUDIO]=T,m[s.TYPES.MSG_VIDEO]=G,m[s.TYPES.MSG_FILE]=l,m[s.TYPES.MSG_CUSTOM]=n,m[s.TYPES.MSG_MERGER]=P,m[s.TYPES.MSG_LOCATION]=Y,m),j=(null==r?void 0:r.type)&&(_[r.type]||f[r.type]);return j&&t(j,e({context:i,message:r},{children:t(g,{message:r})}))}var P=o.memo(l);function Y(o){return t(P,e({},o))}export{Y as MessageContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as t,jsxs as r,Fragment as n}from"react/jsx-runtime";import o from"react";import l from"@tencentcloud/chat";import{useTranslation as i}from"react-i18next";import{JSONStringToParse as a}from"../untils.js";import"../../context/TUIMessageContext.js";import{useComponentContext as u}from"../../context/ComponentContext.js";function c(o){var c=o.context,m=o.message,s=o.children,d=i().t,v=u().MessageCustomPlugins;return r("div",e({className:"bubble message-custom bubble-".concat(m.flow," ").concat((null==m?void 0:m.conversationType)===l.TYPES.CONV_GROUP?"group":"")},{children:[function(o){if("Hyperlink"===o.data){var l=a(null==o?void 0:o.extension);if(null==l?void 0:l.item)return null==l?void 0:l.item.map((function(r){return t("a",e({target:"_blank",href:r.value,rel:"noreferrer"},{children:r.value}),r.value)}));if(null==l?void 0:l.hyperlinks_text){var i=l.hyperlinks_text;return r(n,{children:[l.title," ",t("a",e({target:"_blank",href:null==i?void 0:i.value,rel:"noreferrer"},{children:i.key}),null==i?void 0:i.value)]})}}if("group_create"===o.data)return"".concat((null==m?void 0:m.nick)||(null==m?void 0:m.from)," Create a group");var u=a(o.data);return 1!==(null==u?void 0:u.chatbotPlugin)||15!==(null==u?void 0:u.src)||"welcome_msg"!==(null==u?void 0:u.subtype)&&"clarify_msg"!==(null==u?void 0:u.subtype)?"[".concat(d("TUIChat.Custom message"),"]"):t(v,{data:a(o.data).content})}(null==c?void 0:c.custom),s]}))}var m=o.memo(c);function s(r){return t(m,e({},r))}export{s as MessageCustom};
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as t,jsxs as r,Fragment as n}from"react/jsx-runtime";import o from"react";import l from"@tencentcloud/chat";import{useTranslation as i}from"react-i18next";import{JSONStringToParse as a}from"../untils.js";import"../../context/TUIMessageContext.js";import{useComponentContext as u}from"../../context/ComponentContext.js";function c(o){var c=o.context,m=o.message,s=o.children,d=i().t,v=u().MessageCustomPlugins;return r("div",e({className:"bubble message-custom bubble-".concat(null==m?void 0:m.flow," ").concat((null==m?void 0:m.conversationType)===l.TYPES.CONV_GROUP?"group":"")},{children:[function(o){if("Hyperlink"===o.data){var l=a(null==o?void 0:o.extension);if(null==l?void 0:l.item)return null==l?void 0:l.item.map((function(r){return t("a",e({target:"_blank",href:r.value,rel:"noreferrer"},{children:r.value}),r.value)}));if(null==l?void 0:l.hyperlinks_text){var i=l.hyperlinks_text;return r(n,{children:[l.title," ",t("a",e({target:"_blank",href:null==i?void 0:i.value,rel:"noreferrer"},{children:i.key}),null==i?void 0:i.value)]})}}if("group_create"===o.data)return"".concat((null==m?void 0:m.nick)||(null==m?void 0:m.from)," Create a group");var u=a(o.data);return 1!==(null==u?void 0:u.chatbotPlugin)||15!==(null==u?void 0:u.src)||"welcome_msg"!==(null==u?void 0:u.subtype)&&"clarify_msg"!==(null==u?void 0:u.subtype)?"[".concat(d("TUIChat.Custom message"),"]"):t(v,{data:a(o.data).content})}(null==c?void 0:c.custom),s]}))}var m=o.memo(c);function s(r){return t(m,e({},r))}export{s as MessageCustom};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as r}from"tslib";import{jsx as e,jsxs as t}from"react/jsx-runtime";import m from"react";function
|
|
1
|
+
import{__assign as r}from"tslib";import{jsx as e,jsxs as t}from"react/jsx-runtime";import m from"react";function o(m){var o=m.context,i=m.message,l=m.children;return t("div",r({className:"bubble message-face bubble-".concat(null==i?void 0:i.flow)},{children:[e("img",{className:"img",src:null==o?void 0:o.url,alt:""}),l]}))}var i=m.memo(o);function l(t){return e(i,r({},t))}export{l as MessageFace};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as r,jsxs as o}from"react/jsx-runtime";import
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as r,jsxs as o}from"react/jsx-runtime";import l from"react";import n from"@tencentcloud/chat";import{Icon as i}from"../Icon/Icon.js";import{IconTypes as a}from"../Icon/type.js";function t(l){var t=l.context,m=l.message,s=l.children;return o("a",e({href:null==t?void 0:t.url,download:null==t?void 0:t.name,target:"_parent",className:"bubble message-file bubble-".concat(null==m?void 0:m.flow," ").concat((null==m?void 0:m.conversationType)===n.TYPES.CONV_GROUP?"group":""),rel:"noreferrer"},{children:[o("main",e({className:"message-file-main"},{children:[r(i,{className:"icon",width:15,height:20,type:a.FILE}),r("label",e({htmlFor:"message-file"},{children:null==t?void 0:t.name}))]})),o("div",e({className:"message-file-footer"},{children:[r("span",e({className:"message-file-size"},{children:null==t?void 0:t.size})),s]}))]}))}var m=l.memo(t);function s(o){return r(m,e({},o))}export{s as MessageFile};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as o}from"tslib";import{jsx as i,jsxs as n}from"react/jsx-runtime";import r,{useState as
|
|
1
|
+
import{__assign as o}from"tslib";import{jsx as i,jsxs as n}from"react/jsx-runtime";import r,{useState as l}from"react";import t from"@tencentcloud/chat";import{isH5 as e}from"../../utils/env.js";import{Model as c}from"../Model/index.js";function m(r){var m,a,u,d=r.context,s=r.message,v=r.children,f=l(!1),g=f[0],p=f[1],b=null===(a=null===(m=null==s?void 0:s.payload)||void 0===m?void 0:m.imageInfoArray)||void 0===a?void 0:a.filter((function(o){return 0===o.type}));return n("div",o({className:"message-image"},{children:[i("div",o({role:"button",tabIndex:0,onClick:function(){p(!0)}},{children:i("img",{className:"img ".concat(e?"img-h5":""," bubble-").concat(null==s?void 0:s.flow," \n ").concat((null==s?void 0:s.conversationType)===t.TYPES.CONV_GROUP?"group":""),src:null==d?void 0:d.url,alt:""})})),v,g&&i(c,o({onClick:function(){p(!1)}},{children:i("img",{className:"big-image",src:null===(u=b[0])||void 0===u?void 0:u.url,alt:""})}))]}))}var a=r.memo(m);function u(n){return i(a,o({},n))}export{u as MessageImage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as r}from"tslib";import{jsx as e,jsxs as t}from"react/jsx-runtime";import n from"react";function
|
|
1
|
+
import{__assign as r}from"tslib";import{jsx as e,jsxs as t}from"react/jsx-runtime";import n from"react";function i(n){var i=n.context;n.message;var l=n.children;return t("a",r({className:"bubble message-location",href:null==i?void 0:i.href,target:"_blank",title:"点击查看详情",rel:"noreferrer"},{children:[e("span",{children:null==i?void 0:i.description}),e("img",{src:null==i?void 0:i.url,alt:""}),l]}))}var l=n.memo(i);function o(t){return e(l,r({},t))}export{o as MessageLocation};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as r,jsxs as t}from"react/jsx-runtime";import
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as r,jsxs as t}from"react/jsx-runtime";import l from"react";import n from"@tencentcloud/chat";function i(l){var i=l.context,o=l.message,a=l.children;return t("div",e({className:"bubble message-merger bubble-".concat(null==o?void 0:o.flow," ").concat((null==o?void 0:o.conversationType)===n.TYPES.CONV_GROUP?"group":"")},{children:[r("h3",{children:null==i?void 0:i.title}),r("ul",e({className:"message-merger-list"},{children:(null==i?void 0:i.abstractList.length)>0&&(null==i?void 0:i.abstractList.map((function(t,l){var n=t+l;return r("li",e({className:"message-merger-item"},{children:t}),n)})))})),a]}))}var o=l.memo(i);function a(t){return r(o,e({},t))}export{a as MessageMerger};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as o}from"tslib";import{jsx as t}from"react/jsx-runtime";import
|
|
1
|
+
import{__assign as o}from"tslib";import{jsx as t,Fragment as e}from"react/jsx-runtime";import r from"@tencentcloud/chat";import"react";import{messageShowType as l}from"../../context/TUIMessageContext.js";function n(n){n.className;var m=n.CustomName,i=n.message,s=n.showType;return(s===l.ALL||(null==i?void 0:i.flow)===s)&&(null==i?void 0:i.conversationType)===r.TYPES.CONV_GROUP&&s!==l.NONE?m||t("label",o({htmlFor:"content",className:"text-ellipsis name"},{children:(null==i?void 0:i.nick)||(null==i?void 0:i.from)})):t(e,{})}export{n as MessageName};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as o,jsx as s}from"react/jsx-runtime";import{useState as l,useRef as i}from"react";import{useTranslation as n}from"react-i18next";import t from"@tencentcloud/chat";import{Plugins as r}from"../Plugins/index.js";import{Icon as a}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";import{useTUIChatStateContext as u}from"../../context/TUIChatStateContext.js";import{useTUIMessageContext as c}from"../../context/TUIMessageContext.js";import{useMessageHandler as h}from"./hooks/useMessageHandler.js";import{MESSAGE_STATUS as v,MESSAGE_FLOW as g}from"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat-uikit-engine";import{useMessagePluginElement as p}from"./hooks/useMessagePluginElement.js";var m;function f(m){var f,M,S,w,y,C,T=m.plugins,U=m.showNumber,x=m.MoreIcon,E=m.config,I=n().t,N=l(""),R=N[0];N[1];var k=l({}),j=k[0],b=k[1],q=i(),O=c("MessagePlugins"),P=O.message,D=O.plugin,F=u("MessageBubbleWithContext").messageListRef,L=h({message:P}),W=L.handleDelMessage,Y=L.handleRevokeMessage,A=L.handleReplyMessage,V=L.handleCopyMessage,B=L.handleResendMessage,G=L.handleForWardMessage,H={quote:e(e({isShow:!0},null==E?void 0:E.quote),null===(f=null==D?void 0:D.config)||void 0===f?void 0:f.quote),forward:e(e({isShow:!0},null==E?void 0:E.forward),null===(M=null==D?void 0:D.config)||void 0===M?void 0:M.forward),copy:e(e({isShow:!0,relateMessageType:[t.TYPES.MSG_TEXT]},null==E?void 0:E.copy),null===(S=null==D?void 0:D.config)||void 0===S?void 0:S.copy),delete:e(e({isShow:!0},null==E?void 0:E.delete),null===(w=null==D?void 0:D.config)||void 0===w?void 0:w.delete),revoke:e(e({isShow:!0},null==E?void 0:E.revoke),null===(y=null==D?void 0:D.config)||void 0===y?void 0:y.revoke),resend:e(e({isShow:!0},null==E?void 0:E.resend),null===(C=null==D?void 0:D.config)||void 0===C?void 0:C.resend)},Q=p({children:o("div",e({className:"message-plugin-item"},{children:[s("span",{children:I("TUIChat.Recall")}),s(a,{width:20,height:20,type:d.REVOCATION})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),Y(e)},message:P,isShow:H.revoke.isShow&&(null==P?void 0:P.status)===v.SUCCESS&&P.flow===g.OUT,relateMessageType:H.revoke.relateMessageType}),X=p({children:o("div",e({className:"message-plugin-item"},{children:[s("span",e({className:"del"},{children:I("TUIChat.Delete")})),s(a,{width:20,height:20,type:d.DEL})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),W(e)},message:P,isShow:H.delete.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.delete.relateMessageType}),_=p({children:o("div",e({className:"message-plugin-item"},{children:[s("span",{children:I("TUIChat.Reference")}),s(a,{width:20,height:20,type:d.QUOTE})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),A(e)},message:P,isShow:H.quote.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.quote.relateMessageType}),z=p({children:o("div",e({className:"message-plugin-item"},{children:[s("span",{children:I("TUIChat.Copy")}),s(a,{width:20,height:20,type:d.COPY})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),V(e)},message:P,isShow:H.copy.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.copy.relateMessageType}),J=p({children:o("div",e({className:"message-plugin-item"},{children:[s("span",{children:I("TUIChat.Resend")}),s(a,{width:20,height:20,type:d.REPLY})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),B()},message:P,isShow:H.resend.isShow&&(null==P?void 0:P.status)!==v.SUCCESS,relateMessageType:H.resend.relateMessageType}),K=p({children:o("div",e({className:"message-plugin-item"},{children:[s("span",{children:I("TUIChat.Forward")}),s(a,{width:20,height:20,type:d.FORWARD})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),G(e)},message:P,isShow:H.forward.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.forward.relateMessageType}),Z=[Q,_,K,X,J,z],$=(T||(null==D?void 0:D.plugins)||Z).filter((function(e){return e})),ee=x||(null==D?void 0:D.MoreIcon)||s(a,{className:"icon-more",width:16,height:16,type:d.MORE}),oe=U||(null==D?void 0:D.showNumber)||0;return(null==P?void 0:P.status)!==v.UNSEND&&s(r,{className:"message-plugin",customClass:R,style:j,ref:q,plugins:$,showNumber:oe,MoreIcon:ee,root:null==F?void 0:F.current,handleVisible:function(e){if(e.x&&e.y){var o=e.y<e.height||e.top,s=e.x<e.width||e.left;b({position:"fixed",left:"".concat(s?e.x:e.x-e.width,"px"),top:"".concat(o?e.y:e.y-e.height,"px")})}}})}!function(e){e.quote="quote",e.forward="forward",e.copy="copy",e.delete="delete",e.resend="resend",e.revoke="revoke"}(m||(m={}));export{f as MessagePlugins};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as o}from"tslib";import{jsx as t,Fragment as e,jsxs as s}from"react/jsx-runtime";import r,{useState as n,useEffect as i}from"react";import a from"@tencentcloud/chat";import{MESSAGE_STATUS as l}from"../../constants.js";import{useTUIChatStateContext as m}from"../../context/TUIChatStateContext.js";import{useTUIMessageContext as c}from"../../context/TUIMessageContext.js";function p(r){var p=r.message,u=r.children,g=r.Progress,d=r.isShow,v=void 0!==d&&d,f=n(),h=f[0],S=f[1],x=n(0),P=x[0],M=x[1],E=m("MessageProgressWithContext").uploadPendingMessageList,I=c("MessageProgressWithContext"),C=I.isShowProgress,T=void 0!==C&&C,j=I.Progress,y=g||j,D=v||T;return i((function(){E&&E.length>0&&E.map((function(o){return(null==o?void 0:o.ID)===(null==p?void 0:p.ID)&&(S(o),(null==o?void 0:o.progress)&&M(o.progress)),o}))}),[E]),D?y&&h?t(y,{message:h}):!((null==p?void 0:p.type)!==a.TYPES.MSG_IMAGE&&(null==p?void 0:p.type)!==a.TYPES.MSG_VIDEO&&(null==p?void 0:p.type)!==a.TYPES.MSG_FILE||(null==p?void 0:p.status)!==l.UNSEND)&&s("div",o({className:"progress-box"},{children:[t("span",{className:"progress",style:{width:"".concat(100*P,"%")}}),u]})):t(e,{})}var u=r.memo(p);function g(e){return t(u,o({},e))}export{g as MessageProgress};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsx as e,jsxs as o}from"react/jsx-runtime";import n,{useCallback as r}from"react";import{useTranslation as i}from"react-i18next";import a from"@tencentcloud/chat";import{MESSAGE_OPERATE as l,MESSAGE_FLOW as s}from"../../constants.js";import{useTUIChatActionContext as m}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";function c(n){var c=n.message,d=i().t,p=m().operateMessage,u=r((function(){var t;p(((t={})[l.REVOKE]=c,t))}),[p]);return o("div",t({className:"bubble message-system message-revoke"},{children:[(null==c?void 0:c.flow)===s.IN&&e("span",{children:(null==c?void 0:c.nick)||(null==c?void 0:c.from)}),(null==c?void 0:c.flow)!==s.IN&&e("span",t({style:{marginRight:"5px"}},{children:d("TUIChat.You")})),e("span",t({style:{marginRight:"5px"}},{children:d("TUIChat.recalled a message")})),(null==c?void 0:c.flow)===s.OUT&&(null==c?void 0:c.type)===a.TYPES.MSG_TEXT&&e("span",t({className:"edit",role:"button",tabIndex:0,onClick:u},{children:d("TUIChat.Re-edit")}))]}))}var d=n.memo(c);function p(o){return e(d,t({},o))}export{p as MessageRevoke};
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e,jsxs as o}from"react/jsx-runtime";import n,{useCallback as r}from"react";import{useTranslation as i}from"react-i18next";import a from"@tencentcloud/chat";import{MESSAGE_OPERATE as l,MESSAGE_FLOW as s}from"../../constants.js";import{useTUIChatActionContext as m}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";function c(n){var c=n.message,d=i().t,p=m().operateMessage,u=r((function(){var t;p&&c&&p(((t={})[l.REVOKE]=c,t))}),[p]);return o("div",t({className:"bubble message-system message-revoke"},{children:[(null==c?void 0:c.flow)===s.IN&&e("span",{children:(null==c?void 0:c.nick)||(null==c?void 0:c.from)}),(null==c?void 0:c.flow)!==s.IN&&e("span",t({style:{marginRight:"5px"}},{children:d("TUIChat.You")})),e("span",t({style:{marginRight:"5px"}},{children:d("TUIChat.recalled a message")})),(null==c?void 0:c.flow)===s.OUT&&(null==c?void 0:c.type)===a.TYPES.MSG_TEXT&&e("span",t({className:"edit",role:"button",tabIndex:0,onClick:u},{children:d("TUIChat.Re-edit")}))]}))}var d=n.memo(c);function p(o){return e(d,t({},o))}export{p as MessageRevoke};
|