@tencentcloud/chat-uikit-react 2.1.2 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +0 -1
- package/CHANGELOG.md +10 -0
- package/dist/cjs/components/Avatar/Avatar.js +1 -1
- package/dist/cjs/components/Checkbox/index.d.ts +2 -1
- package/dist/cjs/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
- package/dist/cjs/components/ConversationCreate/ConversationCreate.js +1 -1
- package/dist/cjs/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
- package/dist/cjs/components/ConversationPreview/ConversationPreview.js +1 -1
- package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.d.ts +4 -1
- package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.js +1 -1
- package/dist/cjs/components/ConversationPreview/utils.js +1 -1
- package/dist/cjs/components/ConversationSearch/ConversationSearchInput.d.ts +2 -1
- package/dist/cjs/components/ConversationSearch/ConversationSearchResult.js +1 -1
- package/dist/cjs/components/DivWithEdit/DivWithEdit.d.ts +3 -2
- package/dist/cjs/components/DivWithEdit/DivWithEdit.js +1 -1
- package/dist/cjs/components/DivWithEdit/WithText.js +1 -1
- package/dist/cjs/components/EmptyStateIndicator/EmptyStateIndicator.d.ts +2 -1
- package/dist/cjs/components/Icon/Icon.d.ts +2 -1
- package/dist/cjs/components/Icon/Icon.js +1 -1
- package/dist/cjs/components/Input/Input.js +1 -1
- package/dist/cjs/components/Model/index.d.ts +1 -1
- package/dist/cjs/components/Model/index.js +1 -1
- package/dist/cjs/components/Plugins/index.js +1 -1
- package/dist/cjs/components/Popup/index.d.ts +1 -1
- package/dist/cjs/components/Popup/index.js +1 -1
- package/dist/cjs/components/Switch/Switch.d.ts +2 -6
- package/dist/cjs/components/Switch/Switch.js +1 -1
- package/dist/cjs/components/TUIChat/TUIChat.js +1 -1
- package/dist/cjs/components/TUIChat/TUIChatState.js +1 -1
- package/dist/cjs/components/TUIChat/hooks/useHandleMessage.js +1 -1
- package/dist/cjs/components/TUIChat/hooks/useHandleMessageList.js +1 -1
- package/dist/cjs/components/TUIChat/unitls.js +1 -1
- package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/addFriendInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
- package/dist/cjs/components/TUIContactSearch/TUIContactSearch.js +1 -1
- package/dist/cjs/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
- package/dist/cjs/components/TUIConversation/TUIConversation.js +1 -1
- package/dist/cjs/components/TUIConversationList/hooks/useConversationList.js +1 -1
- package/dist/cjs/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
- package/dist/cjs/components/TUIKit/TUIKit.d.ts +2 -2
- package/dist/cjs/components/TUIKit/TUIKit.js +1 -1
- package/dist/cjs/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +7 -7
- package/dist/cjs/components/TUIKit/hooks/useTUIKit.d.ts +2 -2
- package/dist/cjs/components/TUIKit/hooks/useTUIKit.js +1 -1
- package/dist/cjs/components/TUIManage/TUIManage.d.ts +4 -1
- package/dist/cjs/components/TUIManage/TUIManage.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageAudio.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageAvatar.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageBubble.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageContext.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageCustom.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageFace.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageFile.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageImage.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageLocation.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageMerger.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageName.js +1 -1
- package/dist/cjs/components/TUIMessage/MessagePlugins.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageProgress.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageRevoke.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageText.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageVideo.js +1 -1
- package/dist/cjs/components/TUIMessage/TUIMessage.js +1 -1
- package/dist/cjs/components/TUIMessage/TUIMessageDefault.js +1 -1
- package/dist/cjs/components/TUIMessage/hooks/useMessageHandler.js +1 -1
- package/dist/cjs/components/TUIMessage/hooks/useMessageReply.js +1 -1
- package/dist/cjs/components/TUIMessage/utils/index.js +1 -1
- package/dist/cjs/components/TUIMessageInput/EmojiPicker.js +1 -1
- package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
- package/dist/cjs/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIForward.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputState.d.ts +2 -2
- package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useUploadElement.js +1 -1
- package/dist/cjs/components/TUIMessageList/TUIMessageList.js +1 -1
- package/dist/cjs/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
- package/dist/cjs/components/TUIProfile/TUIProfile.js +1 -1
- package/dist/cjs/components/TUIProfile/TUIProfileDefault.d.ts +2 -2
- package/dist/cjs/components/TUIProfile/TUIProfileDefault.js +1 -1
- package/dist/cjs/components/TUIProfile/hooks/useMyProfile.js +1 -1
- package/dist/cjs/components/Toast/index.js +1 -1
- package/dist/cjs/context/ComponentContext.d.ts +3 -2
- package/dist/cjs/context/TUIChatActionContext.d.ts +1 -1
- package/dist/cjs/context/TUIChatStateContext.d.ts +4 -4
- package/dist/cjs/context/TUIContactContext.js +1 -1
- package/dist/cjs/context/TUIConversationContext.js +1 -1
- package/dist/cjs/context/TUIKitContext.d.ts +1 -1
- package/dist/cjs/context/TUIMessageContext.js +1 -1
- package/dist/cjs/context/TUIMessageInputContext.js +1 -1
- package/dist/cjs/hooks/useProfile.d.ts +1 -1
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.d.css +3 -3
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/Avatar/Avatar.js +1 -1
- package/dist/esm/components/Checkbox/index.d.ts +2 -1
- package/dist/esm/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
- package/dist/esm/components/ConversationCreate/ConversationCreate.js +1 -1
- package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
- package/dist/esm/components/ConversationPreview/ConversationPreview.js +1 -1
- package/dist/esm/components/ConversationPreview/ConversationPreviewContent.d.ts +4 -1
- package/dist/esm/components/ConversationPreview/ConversationPreviewContent.js +1 -1
- package/dist/esm/components/ConversationPreview/utils.js +1 -1
- package/dist/esm/components/ConversationSearch/ConversationSearchInput.d.ts +2 -1
- package/dist/esm/components/ConversationSearch/ConversationSearchResult.js +1 -1
- package/dist/esm/components/DivWithEdit/DivWithEdit.d.ts +3 -2
- package/dist/esm/components/DivWithEdit/DivWithEdit.js +1 -1
- package/dist/esm/components/DivWithEdit/WithText.js +1 -1
- package/dist/esm/components/EmptyStateIndicator/EmptyStateIndicator.d.ts +2 -1
- package/dist/esm/components/Icon/Icon.d.ts +2 -1
- package/dist/esm/components/Icon/Icon.js +1 -1
- package/dist/esm/components/Input/Input.js +1 -1
- package/dist/esm/components/Model/index.d.ts +1 -1
- package/dist/esm/components/Model/index.js +1 -1
- package/dist/esm/components/Plugins/index.js +1 -1
- package/dist/esm/components/Popup/index.d.ts +1 -1
- package/dist/esm/components/Popup/index.js +1 -1
- package/dist/esm/components/Switch/Switch.d.ts +2 -6
- package/dist/esm/components/Switch/Switch.js +1 -1
- package/dist/esm/components/TUIChat/TUIChat.js +1 -1
- package/dist/esm/components/TUIChat/TUIChatState.js +1 -1
- package/dist/esm/components/TUIChat/hooks/useHandleMessage.js +1 -1
- package/dist/esm/components/TUIChat/hooks/useHandleMessageList.js +1 -1
- package/dist/esm/components/TUIChat/unitls.js +1 -1
- package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/addFriendInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
- package/dist/esm/components/TUIContactSearch/TUIContactSearch.js +1 -1
- package/dist/esm/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
- package/dist/esm/components/TUIConversation/TUIConversation.js +1 -1
- package/dist/esm/components/TUIConversationList/hooks/useConversationList.js +1 -1
- package/dist/esm/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
- package/dist/esm/components/TUIKit/TUIKit.d.ts +2 -2
- package/dist/esm/components/TUIKit/TUIKit.js +1 -1
- package/dist/esm/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +7 -7
- package/dist/esm/components/TUIKit/hooks/useTUIKit.d.ts +2 -2
- package/dist/esm/components/TUIKit/hooks/useTUIKit.js +1 -1
- package/dist/esm/components/TUIManage/TUIManage.d.ts +4 -1
- package/dist/esm/components/TUIManage/TUIManage.js +1 -1
- package/dist/esm/components/TUIMessage/MessageAudio.js +1 -1
- package/dist/esm/components/TUIMessage/MessageAvatar.js +1 -1
- package/dist/esm/components/TUIMessage/MessageBubble.js +1 -1
- package/dist/esm/components/TUIMessage/MessageContext.js +1 -1
- package/dist/esm/components/TUIMessage/MessageCustom.js +1 -1
- package/dist/esm/components/TUIMessage/MessageFace.js +1 -1
- package/dist/esm/components/TUIMessage/MessageFile.js +1 -1
- package/dist/esm/components/TUIMessage/MessageImage.js +1 -1
- package/dist/esm/components/TUIMessage/MessageLocation.js +1 -1
- package/dist/esm/components/TUIMessage/MessageMerger.js +1 -1
- package/dist/esm/components/TUIMessage/MessageName.js +1 -1
- package/dist/esm/components/TUIMessage/MessagePlugins.js +1 -1
- package/dist/esm/components/TUIMessage/MessageProgress.js +1 -1
- package/dist/esm/components/TUIMessage/MessageRevoke.js +1 -1
- package/dist/esm/components/TUIMessage/MessageText.js +1 -1
- package/dist/esm/components/TUIMessage/MessageVideo.js +1 -1
- package/dist/esm/components/TUIMessage/TUIMessage.js +1 -1
- package/dist/esm/components/TUIMessage/TUIMessageDefault.js +1 -1
- package/dist/esm/components/TUIMessage/hooks/useMessageHandler.js +1 -1
- package/dist/esm/components/TUIMessage/hooks/useMessageReply.js +1 -1
- package/dist/esm/components/TUIMessage/utils/index.js +1 -1
- package/dist/esm/components/TUIMessageInput/EmojiPicker.js +1 -1
- package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
- package/dist/esm/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIForward.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useEmojiPicker.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useMessageInputState.d.ts +2 -2
- package/dist/esm/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useUploadElement.js +1 -1
- package/dist/esm/components/TUIMessageList/TUIMessageList.js +1 -1
- package/dist/esm/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
- package/dist/esm/components/TUIProfile/TUIProfile.js +1 -1
- package/dist/esm/components/TUIProfile/TUIProfileDefault.d.ts +2 -2
- package/dist/esm/components/TUIProfile/TUIProfileDefault.js +1 -1
- package/dist/esm/components/TUIProfile/hooks/useMyProfile.js +1 -1
- package/dist/esm/components/Toast/index.js +1 -1
- package/dist/esm/context/ComponentContext.d.ts +3 -2
- package/dist/esm/context/TUIChatActionContext.d.ts +1 -1
- package/dist/esm/context/TUIChatStateContext.d.ts +4 -4
- package/dist/esm/context/TUIContactContext.js +1 -1
- package/dist/esm/context/TUIConversationContext.js +1 -1
- package/dist/esm/context/TUIKitContext.d.ts +1 -1
- package/dist/esm/context/TUIMessageContext.js +1 -1
- package/dist/esm/context/TUIMessageInputContext.js +1 -1
- package/dist/esm/hooks/useProfile.d.ts +1 -1
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.d.css +3 -3
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/index.ts +1 -0
- package/package.json +7 -6
- package/rollup.config.js +2 -1
- package/src/components/Avatar/Avatar.tsx +7 -3
- package/src/components/Avatar/styles/index.scss +1 -1
- package/src/components/Checkbox/index.tsx +1 -1
- package/src/components/ConversationCreate/ConversationCreatGroupDetail.tsx +14 -7
- package/src/components/ConversationCreate/ConversationCreate.tsx +5 -1
- package/src/components/ConversationCreate/ConversationCreateSelectView.tsx +2 -2
- package/src/components/ConversationCreate/ConversationCreateUserSelectList.tsx +11 -10
- package/src/components/ConversationCreate/hooks/useConversationCreate.tsx +14 -12
- package/src/components/ConversationPreview/ConversationPreview.tsx +3 -3
- package/src/components/ConversationPreview/ConversationPreviewContent.tsx +9 -5
- package/src/components/ConversationPreview/utils.tsx +6 -3
- package/src/components/DivWithEdit/DivWithEdit.tsx +6 -5
- package/src/components/DivWithEdit/WithText.tsx +3 -1
- package/src/components/DivWithEdit/styles/index.scss +1 -1
- package/src/components/Icon/Icon.tsx +2 -2
- package/src/components/Input/Input.tsx +15 -12
- package/src/components/Model/index.tsx +2 -2
- package/src/components/Plugins/index.tsx +15 -12
- package/src/components/Popup/index.tsx +13 -9
- package/src/components/Profile/index.ts +1 -2
- package/src/components/Switch/Switch.tsx +5 -7
- package/src/components/TUIChat/TUIChat.tsx +20 -5
- package/src/components/TUIChat/TUIChatState.tsx +3 -3
- package/src/components/TUIChat/hooks/useHandleMessage.tsx +5 -5
- package/src/components/TUIChat/hooks/useHandleMessageList.tsx +2 -2
- package/src/components/TUIChat/unitls.ts +2 -2
- package/src/components/TUIChatHeader/TUIChatHeaderDefault.tsx +1 -1
- package/src/components/TUIContact/TUIContactInfo/addFriendInfo.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/friendInfo.tsx +1 -2
- package/src/components/TUIContact/TUIContactInfo/hooks/useContactInfo.tsx +0 -10
- package/src/components/TUIContact/TUIContactList/TUIContactList.tsx +5 -3
- package/src/components/TUIContact/hooks/useTUIContact.tsx +3 -4
- package/src/components/TUIContactSearch/TUIContactSearch.tsx +6 -7
- package/src/components/TUIContactSearch/hooks/useContactSearch.tsx +1 -3
- package/src/components/TUIConversationList/TUIConversationList.tsx +1 -1
- package/src/components/TUIConversationList/hooks/useConversationList.tsx +19 -24
- package/src/components/TUIConversationList/hooks/useConversationUpdate.tsx +2 -2
- package/src/components/TUIKit/TUIKit.tsx +31 -12
- package/src/components/TUIKit/hooks/useTUIKit.tsx +14 -10
- package/src/components/TUIManage/TUIManage.tsx +20 -13
- package/src/components/TUIMessage/MessageAudio.tsx +8 -6
- package/src/components/TUIMessage/MessageAvatar.tsx +2 -2
- package/src/components/TUIMessage/MessageBubble.tsx +7 -5
- package/src/components/TUIMessage/MessageContext.tsx +3 -3
- package/src/components/TUIMessage/MessageCustom.tsx +5 -3
- package/src/components/TUIMessage/MessageFace.tsx +2 -2
- package/src/components/TUIMessage/MessageFile.tsx +5 -5
- package/src/components/TUIMessage/MessageImage.tsx +4 -2
- package/src/components/TUIMessage/MessageLocation.tsx +3 -3
- package/src/components/TUIMessage/MessageMerger.tsx +3 -3
- package/src/components/TUIMessage/MessageName.tsx +1 -1
- package/src/components/TUIMessage/MessagePlugins.tsx +12 -10
- package/src/components/TUIMessage/MessageProgress.tsx +5 -4
- package/src/components/TUIMessage/MessageRevoke.tsx +1 -1
- package/src/components/TUIMessage/MessageText.tsx +4 -4
- package/src/components/TUIMessage/MessageVideo.tsx +3 -3
- package/src/components/TUIMessage/TUIMessage.tsx +1 -1
- package/src/components/TUIMessage/TUIMessageDefault.tsx +3 -1
- package/src/components/TUIMessage/hooks/useMessageHandler.ts +13 -13
- package/src/components/TUIMessage/hooks/useMessageReply.ts +6 -4
- package/src/components/TUIMessage/utils/decodeText.ts +2 -3
- package/src/components/TUIMessage/utils/index.ts +1 -2
- package/src/components/TUIMessageInput/EmojiPicker.tsx +4 -4
- package/src/components/TUIMessageInput/InputPluginsDefalut.tsx +8 -8
- package/src/components/TUIMessageInput/InputQuoteDefalut.tsx +4 -2
- package/src/components/TUIMessageInput/TUIForward.tsx +22 -15
- package/src/components/TUIMessageInput/TUIMessageInputDefault.tsx +15 -9
- package/src/components/TUIMessageInput/hooks/useEmojiPicker.tsx +2 -2
- package/src/components/TUIMessageInput/hooks/useHandleForwardMessage.tsx +4 -4
- package/src/components/TUIMessageInput/hooks/useHandleQuoteMessage.tsx +5 -5
- package/src/components/TUIMessageInput/hooks/useMessageInputState.tsx +3 -3
- package/src/components/TUIMessageInput/hooks/useMessageInputText.tsx +12 -9
- package/src/components/TUIMessageInput/hooks/useUploadElement.tsx +2 -2
- package/src/components/TUIMessageInput/hooks/useUploadPicker.tsx +1 -1
- package/src/components/TUIMessageList/TUIMessageList.tsx +5 -6
- package/src/components/TUIMessageList/hooks/useMessageListElement.tsx +5 -2
- package/src/components/TUIProfile/TUIProfile.tsx +3 -1
- package/src/components/TUIProfile/TUIProfileDefault.tsx +17 -17
- package/src/components/TUIProfile/hooks/useMyProfile.tsx +19 -37
- package/src/components/Toast/index.tsx +3 -3
- package/src/components/Toast/styles/layout.scss +1 -1
- package/src/components/untils.ts +1 -1
- package/src/context/TUIChatStateContext.tsx +4 -4
- package/src/context/TUIContactContext.tsx +1 -1
- package/src/context/TUIConversationContext.tsx +2 -2
- package/src/context/TUIMessageContext.tsx +1 -1
- package/src/context/TUIMessageInputContext.tsx +1 -1
- package/src/hooks/useConversation.tsx +1 -1
- package/src/hooks/useProfile.tsx +2 -2
- package/tsconfig.json +1 -0
- package/dist/cjs/components/TUIProfile/hooks/useMyProfile.d.ts +0 -17
- package/dist/esm/components/TUIProfile/hooks/useMyProfile.d.ts +0 -17
- package/src/components/Profile/hooks/useProfile.tsx +0 -28
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as 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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsx as e,jsxs as n}from"react/jsx-runtime";import
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e,jsxs as n}from"react/jsx-runtime";import o from"react";import r from"@tencentcloud/chat";import{useTUIChatStateContext as a}from"../../context/TUIChatStateContext.js";import"../../context/TUIMessageContext.js";import{useComponentContext as s}from"../../context/ComponentContext.js";function c(o){var c=o.context,i=o.message,l=o.children,m=s().MessageTextPlugins,u=a("MessageText").firstSendMessage;if(m&&"in"===(null==i?void 0:i.flow)&&u&&(null==u?void 0:u.time)<=(null==i?void 0:i.time))return e("div",t({className:"bubble message-text bubble-".concat(i.flow," ").concat((null==i?void 0:i.conversationType)===r.TYPES.CONV_GROUP?"group":"")},{children:e(m,{data:i})}));var f=function(t){if(!t)return t;return t.replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi,(function(t){return"<a class='website' href='".concat(t,"' target='_blank'>").concat(t,"</a>")}))};return e("div",t({className:"bubble message-text bubble-".concat(null==i?void 0:i.flow," ").concat((null==i?void 0:i.conversationType)===r.TYPES.CONV_GROUP?"group":"")},{children:n("div",t({className:"message-text-content"},{children:[null==c?void 0:c.text.map((function(t,n){var o=i&&(null==i?void 0:i.ID)+n;return"text"===t.name?e("p",{className:"message-text-content-p",dangerouslySetInnerHTML:{__html:f(t.text)}},t.src+o):e("img",{className:"text-img",src:t.src,alt:""},t.src+o)})),l]}))}))}var i=o.memo(c);function l(n){return e(i,t({},n))}export{l as MessageText};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as o}from"tslib";import{jsx as t,jsxs as e}from"react/jsx-runtime";import r,{useState as s}from"react";import{MESSAGE_STATUS as i}from"../../constants.js";import{isH5 as n,isPC as a}from"../../utils/env.js";import{Model as
|
|
1
|
+
import{__assign as o}from"tslib";import{jsx as t,jsxs as e}from"react/jsx-runtime";import r,{useState as s}from"react";import{MESSAGE_STATUS as i}from"../../constants.js";import{isH5 as n,isPC as a}from"../../utils/env.js";import{Model as l}from"../Model/index.js";function c(r){var c=r.context,m=r.message,d=r.children,u=s(!1),p=u[0],v=u[1];return e("div",o({className:"message-video ".concat(n?"message-video-h5":"")},{children:[e("div",o({className:"".concat((null==m?void 0:m.status)===i.SUCCESS?"snap-video":""),role:"button",tabIndex:0,onClick:function(){v(!0)}},{children:[a&&t("video",{muted:!0,controls:!1,src:null==c?void 0:c.url}),n&&t("img",{src:(null==m?void 0:m.payload.snapshotUrl)||"https://web.sdk.qcloud.com/im/assets/images/transparent.png",style:{maxHeight:"200px",maxWidth:"200px",borderRadius:"10px"}})]})),d,p&&t(l,o({onClick:function(o){o.stopPropagation(),v(!1)}},{children:t("video",{className:"play-video",autoPlay:!0,controls:!0,src:null==c?void 0:c.url})}))]}))}var m=r.memo(c);function d(e){return t(m,o({},e))}export{d as MessageVideo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import o from"react";import{useTUIChatStateContext as l}from"../../context/TUIChatStateContext.js";import{TUIMessageContextProvider as s}from"../../context/TUIMessageContext.js";import{useComponentContext as n}from"../../context/ComponentContext.js";import{useMessageHandler as i}from"./hooks/useMessageHandler.js";import"@tencentcloud/chat";import"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat-uikit-engine";import"../Icon/config.js";import"../Icon/type.js";import{TUIMessageDefault as m}from"./TUIMessageDefault.js";import{MessagePlugins as a}from"./MessagePlugins.js";import{MessageContext as r}from"./MessageContext.js";function u(o){var i=o.message,u=o.TUIMessage,d=o.MessagePlugins,g=o.MessageContext,v=o.handleDelete,c=o.CustemElement,f=o.TextElement,E=o.ImageElement,p=o.VideoElement,h=o.AudioElement,x=o.FileElement,M=o.MergerElement,w=o.LocationElement,C=o.FaceElement,j=o.className,T=o.filter,I=o.isShowTime,P=o.isShowRead,S=o.plugin,A=o.prefix,N=o.suffix,D=o.customName,F=o.showAvatar,U=o.showName,L=o.customAvatar,R=o.isShowProgress,V=o.Progress,k=n(),b=k.MessagePlugins,y=k.MessageContext,H=l("TUIMessage").messageConfig,q=u||m,z=d||b||a,B=g||y||r,G=T||(null==H?void 0:H.filter),J=i||(null==H?void 0:H.message);G&&G(J);var K={message:J,handleDelete:v||(null==H?void 0:H.handleDelete),CustemElement:c||(null==H?void 0:H.CustemElement),TextElement:f||(null==H?void 0:H.TextElement),ImageElement:E||(null==H?void 0:H.ImageElement),VideoElement:p||(null==H?void 0:H.VideoElement),AudioElement:h||(null==H?void 0:H.AudioElement),FileElement:x||(null==H?void 0:H.FileElement),MergerElement:M||(null==H?void 0:H.MergerElement),LocationElement:w||(null==H?void 0:H.LocationElement),FaceElement:C||(null==H?void 0:H.FaceElement),isShowTime:I||(null==H?void 0:H.isShowTime),isShowRead:P||(null==H?void 0:H.isShowRead),plugin:S||(null==H?void 0:H.plugin),prefix:A||(null==H?void 0:H.prefix),suffix:N||(null==H?void 0:H.suffix),customName:D||(null==H?void 0:H.customName),showAvatar:F||(null==H?void 0:H.showAvatar),showName:U||(null==H?void 0:H.showName),customAvatar:L||(null==H?void 0:H.customAvatar),isShowProgress:R||(null==H?void 0:H.isShowProgress),Progress:V||(null==H?void 0:H.Progress)};return t(s,e({value:K},{children:t(q,{message:J,MessageContext:B,MessagePlugins:z,className:j||(null==H?void 0:H.className)})}))}var d=o.memo(u);function g(o){var l=o.message,s=i({message:l}).handleDelMessage;return t(d,e({handleDelete:s},o))}export{g as TUIMessage};
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import o from"react";import{useTUIChatStateContext as l}from"../../context/TUIChatStateContext.js";import{TUIMessageContextProvider as s}from"../../context/TUIMessageContext.js";import{useComponentContext as n}from"../../context/ComponentContext.js";import{useMessageHandler as i}from"./hooks/useMessageHandler.js";import"@tencentcloud/chat";import"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat-uikit-engine";import"../Icon/config.js";import"../Icon/type.js";import{TUIMessageDefault as m}from"./TUIMessageDefault.js";import{MessagePlugins as a}from"./MessagePlugins.js";import{MessageContext as r}from"./MessageContext.js";function u(o){var i=o.message,u=o.TUIMessage,d=o.MessagePlugins,g=o.MessageContext,v=o.handleDelete,c=o.CustemElement,f=o.TextElement,E=o.ImageElement,p=o.VideoElement,h=o.AudioElement,x=o.FileElement,M=o.MergerElement,w=o.LocationElement,C=o.FaceElement,j=o.className,T=o.filter,I=o.isShowTime,P=o.isShowRead,S=o.plugin,A=o.prefix,N=o.suffix,D=o.customName,F=o.showAvatar,U=o.showName,L=o.customAvatar,R=o.isShowProgress,V=o.Progress,k=n(),b=k.MessagePlugins,y=k.MessageContext,H=l("TUIMessage").messageConfig,q=u||m,z=d||b||a,B=g||y||r,G=T||(null==H?void 0:H.filter),J=i||(null==H?void 0:H.message);G&&J&&G(J);var K={message:J,handleDelete:v||(null==H?void 0:H.handleDelete),CustemElement:c||(null==H?void 0:H.CustemElement),TextElement:f||(null==H?void 0:H.TextElement),ImageElement:E||(null==H?void 0:H.ImageElement),VideoElement:p||(null==H?void 0:H.VideoElement),AudioElement:h||(null==H?void 0:H.AudioElement),FileElement:x||(null==H?void 0:H.FileElement),MergerElement:M||(null==H?void 0:H.MergerElement),LocationElement:w||(null==H?void 0:H.LocationElement),FaceElement:C||(null==H?void 0:H.FaceElement),isShowTime:I||(null==H?void 0:H.isShowTime),isShowRead:P||(null==H?void 0:H.isShowRead),plugin:S||(null==H?void 0:H.plugin),prefix:A||(null==H?void 0:H.prefix),suffix:N||(null==H?void 0:H.suffix),customName:D||(null==H?void 0:H.customName),showAvatar:F||(null==H?void 0:H.showAvatar),showName:U||(null==H?void 0:H.showName),customAvatar:L||(null==H?void 0:H.customAvatar),isShowProgress:R||(null==H?void 0:H.isShowProgress),Progress:V||(null==H?void 0:H.Progress)};return t(s,e({value:K},{children:t(q,{message:J,MessageContext:B,MessagePlugins:z,className:j||(null==H?void 0:H.className)})}))}var d=o.memo(u);function g(o){var l=o.message,s=i({message:l}).handleDelMessage;return t(d,e({handleDelete:s},o))}export{g as TUIMessage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as s,jsxs as o}from"react/jsx-runtime";import t from"react";import a from"@tencentcloud/chat";import{MessageBubble as m}from"./MessageBubble.js";import{MessageTip as i}from"./MessageTip.js";import{useTUIMessageContext as n,messageShowType as r}from"../../context/TUIMessageContext.js";import{useComponentContext as l}from"../../context/ComponentContext.js";import{MessageSystem as u}from"./MessageSystem.js";import{MessageRevoke as d}from"./MessageRevoke.js";import{MessageName as c}from"./MessageName.js";import{MessageAvatar as g}from"./MessageAvatar.js";function v(t){var v=t.message,p=t.MessageContext,f=t.MessagePlugins,M=t.className,P=l(),S=P.MessageContext,T=P.MessagePlugins,N=n("TUIMessage"),_=N.prefix,x=N.suffix,I=N.customName,C=N.showAvatar,G=void 0===C?r.IN:C,h=N.showName,j=void 0===h?r.IN:h,R=N.customAvatar,y=p||S,E=f||T;return o("div",e({className:"message-default\n ".concat((null==v?void 0:v.type)===a.TYPES.MSG_GRP_TIP||(null==v?void 0:v.isRevoked)?"tip":null==v?void 0:v.flow,"\n ").concat(M,"\n ")},{children:[(null==v?void 0:v.type)===a.TYPES.MSG_GRP_TIP&&s(i,{message:v}),(null==v?void 0:v.type)===a.TYPES.MSG_GRP_SYS_NOTICE&&s(u,{message:v}),(null==v?void 0:v.isRevoked)&&s(d,{message:v}),(null==v?void 0:v.type)!==a.TYPES.MSG_GRP_TIP&&(null==v?void 0:v.type)!==a.TYPES.MSG_GRP_SYS_NOTICE&&!(null==v?void 0:v.isRevoked)&&o("div",e({className:"".concat(null==v?void 0:v.flow)},{children:[_,s(g,{message:v,CustomAvatar:R,showType:G}),o("main",e({"data-message-id":null==v?void 0:v.ID,className:"content"},{children:[s(c,{message:v,CustomName:I,showType:j}),s(m,e({message:v,Context:y,Plugins:E},{children:s(y,{message:v})}))]})),x]}),null==v?void 0:v.ID)]}))}var p=t.memo(v);function f(o){return o.message,s(p,e({},o))}export{f as TUIMessageDefault};
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as s,jsxs as o}from"react/jsx-runtime";import t from"react";import a from"@tencentcloud/chat";import{MessageBubble as m}from"./MessageBubble.js";import{MessageTip as i}from"./MessageTip.js";import{useTUIMessageContext as n,messageShowType as r}from"../../context/TUIMessageContext.js";import{useComponentContext as l}from"../../context/ComponentContext.js";import{MessageSystem as u}from"./MessageSystem.js";import{MessageRevoke as d}from"./MessageRevoke.js";import{MessageName as c}from"./MessageName.js";import{MessageAvatar as g}from"./MessageAvatar.js";function v(t){var v=t.message,p=t.MessageContext,f=t.MessagePlugins,M=t.className,P=l(),S=P.MessageContext,T=P.MessagePlugins,N=n("TUIMessage"),_=N.prefix,x=N.suffix,I=N.customName,C=N.showAvatar,G=void 0===C?r.IN:C,h=N.showName,j=void 0===h?r.IN:h,R=N.customAvatar,y=p||S,E=f||T;return o("div",e({className:"message-default\n ".concat((null==v?void 0:v.type)===a.TYPES.MSG_GRP_TIP||(null==v?void 0:v.isRevoked)?"tip":null==v?void 0:v.flow,"\n ").concat(M,"\n ")},{children:[(null==v?void 0:v.type)===a.TYPES.MSG_GRP_TIP&&s(i,{message:v}),(null==v?void 0:v.type)===a.TYPES.MSG_GRP_SYS_NOTICE&&s(u,{message:v}),(null==v?void 0:v.isRevoked)&&s(d,{message:v}),(null==v?void 0:v.type)!==a.TYPES.MSG_GRP_TIP&&(null==v?void 0:v.type)!==a.TYPES.MSG_GRP_SYS_NOTICE&&!(null==v?void 0:v.isRevoked)&&o("div",e({className:"".concat(null==v?void 0:v.flow)},{children:[_,v&&s(g,{message:v,CustomAvatar:R,showType:G}),o("main",e({"data-message-id":null==v?void 0:v.ID,className:"content"},{children:[s(c,{message:v,CustomName:I,showType:j}),s(m,e({message:v,Context:y,Plugins:E},{children:s(y,{message:v})}))]})),x]}),null==v?void 0:v.ID)]}))}var p=t.memo(v);function f(o){return o.message,s(p,e({},o))}export{f as TUIMessageDefault};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from"tslib";import{useCallback as r}from"react";import{useTranslation as o}from"react-i18next";import{TUIStore as n}from"@tencentcloud/chat-uikit-engine";import{MESSAGE_FLOW as a,MESSAGE_OPERATE as i}from"../../../constants.js";import{enableSampleTaskStatus as s}from"../../untils.js";import{useTUIKitContext as
|
|
1
|
+
import{__awaiter as e,__generator as t}from"tslib";import{useCallback as r}from"react";import{useTranslation as o}from"react-i18next";import{TUIStore as n}from"@tencentcloud/chat-uikit-engine";import{MESSAGE_FLOW as a,MESSAGE_OPERATE as i}from"../../../constants.js";import{enableSampleTaskStatus as s}from"../../untils.js";import{useTUIKitContext as l}from"../../../context/TUIKitContext.js";import"react/jsx-runtime";import{useTUIChatActionContext as u}from"../../../context/TUIChatActionContext.js";import"../../../context/TUIMessageContext.js";import{Toast as d}from"../../Toast/index.js";var c=function(c){var v=c.message,f=c.handleError,m=u(),p=m.editLocalMessage,g=m.operateMessage;m.revokeMessage;var h=o().t,M=l("useDeleteHandler").chat,x=r((function(r){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return r.preventDefault(),v?(n.getMessageModel(null==v?void 0:v.ID).deleteMessage(),[2]):[2]}))}))}),[v]),y=r((function(r){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return r.preventDefault(),v?(n.getMessageModel(null==v?void 0:v.ID).revokeMessage().then((function(){p&&p(v),s("revokeMessage")})).catch((function(e){if(!f){var t=v.flow===a.OUT?h("TUIChat.The message recall exceeded the time limit (default 2 minutes)"):h("TUIChat.Error revoke Message");throw d({text:t,type:"error"}),new Error(e)}f({functionName:"revokeMessage",error:e})})),[2]):[2]}))}))}),[v]),D=r((function(e){var t;e.preventDefault(),(null==v?void 0:v.ID)&&M&&g&&g(((t={})[i.QUOTE]=v,t))}),[v]),C=r((function(e){if(e.preventDefault(),navigator.clipboard)navigator.clipboard.writeText(null==v?void 0:v.payload.text);else{var t=document.createElement("textarea");document.body.appendChild(t),t.style.position="fixed",t.style.clip="rect(0 0 0 0)",t.style.top="10px",t.value=null==v?void 0:v.payload.text,t.select(),document.execCommand("copy",!0),document.body.removeChild(t)}}),[v]),T=r((function(){return e(void 0,void 0,void 0,(function(){var e,r,o,n;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),(r=v)?[4,M.resendMessage(v)]:[3,2];case 1:r=t.sent(),t.label=2;case 2:return e=r,p&&p(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.message),[3,4];case 3:if(o=t.sent(),!f)throw d({text:o,type:"error"}),new Error(o);return f({functionName:"resendMessage",error:o}),[3,4];case 4:return[2]}}))}))}),[v]),I=r((function(r){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){return r.preventDefault(),(null==v?void 0:v.ID)&&M&&g?(g(((e={})[i.FORWARD]=v,e)),[2]):[2]}))}))}),[v]);return{handleDelMessage:x,handleRevokeMessage:y,handleReplyMessage:D,handleCopyMessage:C,handleResendMessage:T,handleForWardMessage:I}};export{c as useMessageHandler};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useState as e,useLayoutEffect as t}from"react";import s from"@tencentcloud/chat";import{useTUIKitContext as o}from"../../../context/TUIKitContext.js";import{useTUIChatStateContext as a}from"../../../context/TUIChatStateContext.js";import"tslib";import"react/jsx-runtime";import"../../../context/TUIMessageContext.js";import{JSONStringToParse as n}from"../../untils.js";var r,l=((r={})[s.TYPES.MSG_TEXT]=1,r[s.TYPES.MSG_FACE]=8,r[s.TYPES.MSG_IMAGE]=3,r[s.TYPES.MSG_AUDIO]=4,r[s.TYPES.MSG_VIDEO]=5,r[s.TYPES.MSG_FILE]=6,r[s.TYPES.MSG_CUSTOM]=2,r),i=function(r){var i=r.message,m=e(null),u=m[0],S=m[1],T=e(""),p=T[0],c=T[1],g=e(null),d=g[0],
|
|
1
|
+
import{useState as e,useLayoutEffect as t}from"react";import s from"@tencentcloud/chat";import{useTUIKitContext as o}from"../../../context/TUIKitContext.js";import{useTUIChatStateContext as a}from"../../../context/TUIChatStateContext.js";import"tslib";import"react/jsx-runtime";import"../../../context/TUIMessageContext.js";import{JSONStringToParse as n}from"../../untils.js";var r,l=((r={})[s.TYPES.MSG_TEXT]=1,r[s.TYPES.MSG_FACE]=8,r[s.TYPES.MSG_IMAGE]=3,r[s.TYPES.MSG_AUDIO]=4,r[s.TYPES.MSG_VIDEO]=5,r[s.TYPES.MSG_FILE]=6,r[s.TYPES.MSG_CUSTOM]=2,r),i=function(r){var i=r.message,m=e(null),u=m[0],S=m[1],T=e(""),p=T[0],c=T[1],g=e(null),d=g[0],v=g[1],E=e(""),M=E[0],f=E[1],I=o("TUIChat").chat,x=a("useMessageReply").messageList;t((function(){i&&C(i)}),[i]);var C=function(e){if(null==e?void 0:e.cloudCustomData){var t=n(null==e?void 0:e.cloudCustomData),o=(null==t?void 0:t.messageReply)||"";if(o){S(o),c(null==o?void 0:o.messageSender),f(null==o?void 0:o.messageID);var a=null==x?void 0:x.filter((function(e){var t=e.ID===(null==o?void 0:o.messageID),a=t&&l[e.type]===o.messageType,n=e.type!==s.TYPES.MSG_TEXT||e.payload.text===o.messageAbstract;return t&&a&&n}));v(a[0]||I.findMessage(null==o?void 0:o.messageID))}}};return{messageReply:u,sender:p,replyMessage:d,messageID:M,message:i}};export{i as useMessageReply};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as a}from"tslib";import t from"@tencentcloud/chat";import{decodeText as e}from"./decodeText.js";import{MESSAGE_STATUS as c}from"../../../constants.js";import{JSONStringToParse as o}from"../../untils.js";function n(a){var t=a.split(".");return t[t.length-1]}function s(a){var e,c,o,s,r,i={message:a,text:""},p=a.nick||(null===(e=null==a?void 0:a.payload)||void 0===e?void 0:e.userIDList.join(","));switch((null===(o=null===(c=null==a?void 0:a.payload)||void 0===c?void 0:c.memberList)||void 0===o?void 0:o.length)>0&&(p="",null===(r=null===(s=null==a?void 0:a.payload)||void 0===s?void 0:s.memberList)||void 0===r||r.map((function(a){return p+="".concat((null==a?void 0:a.nick)||(null==a?void 0:a.userID),","),a})),p=p.slice(0,-1)),a.payload.operationType){case t.TYPES.GRP_TIP_MBR_JOIN:i.text="".concat(p," ").concat(n("message.tip.Join in group"));break;case t.TYPES.GRP_TIP_MBR_QUIT:i.text="".concat(n("message.tip.member"),":").concat(p," ").concat(n("message.tip.quit group"));break;case t.TYPES.GRP_TIP_MBR_KICKED_OUT:i.text="".concat(n("message.tip.member"),":").concat(p," ").concat(n("message.tip.by")," ").concat(a.payload.operatorID," ").concat(n("message.tip.kicked out of group"));break;case t.TYPES.GRP_TIP_MBR_SET_ADMIN:i.text="".concat(n("message.tip.member"),":").concat(p," ").concat(n("message.tip.become admin"));break;case t.TYPES.GRP_TIP_MBR_CANCELED_ADMIN:i.text="".concat(n("message.tip.member"),":").concat(p," ").concat(n("message.tip.by revoked administrator"));break;case t.TYPES.GRP_TIP_GRP_PROFILE_UPDATED:i.text=function(a){var t=a.payload,e=t.newGroupProfile,c=t.operatorID,o="",s=Object.keys(e)[0];switch(s){case"muteAllMembers":o=e[s]?"".concat(n("message.tip.admin")," ").concat(c," ").concat(n("message.tip.enable all staff mute")):"".concat(n("message.tip.admin")," ").concat(c," ").concat(n("message.tip.unmute everyone"));break;case"ownerID":o="".concat(e[s]," ").concat(n("message.tip.become the new owner"));break;case"groupName":o="".concat(c," ").concat(n("message.tip.modify group name")," ").concat(e[s]);break;case"notification":o="".concat(c," ").concat(n("message.tip.post a new announcement"))}return o}(a);break;case t.TYPES.GRP_TIP_MBR_PROFILE_UPDATED:a.payload.memberList.map((function(a){return a.muteTime>0?i.text="".concat(n("message.tip.member"),":").concat(a.userID).concat(n("message.tip.muted")):i.text="".concat(n("message.tip.member"),":").concat(a.userID).concat(n("message.tip.unmuted")),a}));break;default:i.text="[".concat(n("message.tip.reminder message"),"]")}return i}function r(a){return{text:e(a.payload)}}function i(a){var t={message:a,name:"",url:""};return t.name=a.payload.data,a.payload.data.indexOf("@2x")<0&&(t.name="".concat(t.name,"@2x")),t.url="https://web.sdk.qcloud.com/im/assets/face-elem/".concat(t.name,".png"),t}function p(a){var t={lon:"",lat:"",href:"",url:"",description:"",message:a};return t.lon=a.payload.longitude.toFixed(6),t.lat=a.payload.latitude.toFixed(6),t.href="https://map.qq.com/?type=marker&isopeninfowin=1&markertype=1&"+"pointx=".concat(t.lon,"&pointy=").concat(t.lat,"&name=").concat(a.payload.description),t.url="https://apis.map.qq.com/ws/staticmap/v2/?"+"center=".concat(t.lat,",").concat(t.lon,"&zoom=10&size=300*150&maptype=roadmap&")+"markers=size:large|color:0xFFCCFF|label:k|".concat(t.lat,",").concat(t.lon,"&")+"key=UBNBZ-PTP3P-TE7DB-LHRTI-Y4YLE-VWBBD",t.description=a.payload.description,t}function m(a){return{progress:(null==a?void 0:a.status)===c.UNSEND&&a.progress,url:a.payload.imageInfoArray[1].url,message:a}}function l(a){var t,e;return{progress:(null==a?void 0:a.status)===c.UNSEND&&(null==a?void 0:a.progress),url:null===(t=null==a?void 0:a.payload)||void 0===t?void 0:t.videoUrl,snapshotUrl:null===(e=null==a?void 0:a.payload)||void 0===e?void 0:e.snapshotUrl,message:a}}function u(a){return{progress:(null==a?void 0:a.status)===c.UNSEND&&a.progress,url:a.payload.url,message:a,second:a.payload.second}}function d(a){var t="";return t=a.payload.fileSize>=1048576?"".concat((a.payload.fileSize/1048576).toFixed(2)," Mb"):a.payload.fileSize>=1024?"".concat((a.payload.fileSize/1024).toFixed(2)," Kb"):"".concat(a.payload.fileSize.toFixed(2),"B"),{progress:(null==a?void 0:a.status)===c.UNSEND&&a.progress,url:a.payload.fileUrl,message:a,name:a.payload.fileName,size:t}}function g(t){return a({message:t},t.payload)}function y(a){var t={},e={};try{t=o(a.payload.data)}catch(a){t={}}if(1!==t.businessID)return"";try{e=o(t.data)}catch(a){e={}}switch(t.actionType){case 1:return e.call_end>=0&&!t.groupID?"".concat(n("message.custom.talkTime"),":").concat(v(e.call_end)):t.groupID?"".concat(n("message.custom.groupCallEnd")):e.data&&"switchToAudio"===e.data.cmd?"".concat(n("message.custom.switchToAudioCall")):e.data&&"switchToVideo"===e.data.cmd?"".concat(n("message.custom.switchToVideoCall")):"".concat(n("message.custom.all"));case 2:return"".concat(n("message.custom.cancel"));case 3:return e.data&&"switchToAudio"===e.data.cmd?"".concat(n("message.custom.switchToAudioCall")):e.data&&"switchToVideo"===e.data.cmd?"".concat(n("message.custom.switchToVideoCall")):"".concat(n("message.custom.accepted"));case 4:return"".concat(n("message.custom.rejected"));case 5:return e.data&&"switchToAudio"===e.data.cmd?"".concat(n("message.custom.switchToAudioCall")):e.data&&"switchToVideo"===e.data.cmd?"".concat(n("message.custom.switchToVideoCall")):"".concat(n("message.custom.noResp"));default:return""}}function
|
|
1
|
+
import{__assign as a}from"tslib";import t from"@tencentcloud/chat";import{decodeText as e}from"./decodeText.js";import{MESSAGE_STATUS as c}from"../../../constants.js";import{JSONStringToParse as o}from"../../untils.js";function n(a){var t=a.split(".");return t[t.length-1]}function s(a){var e,c,o,s,r,i={message:a,text:""},p=a.nick||(null===(e=null==a?void 0:a.payload)||void 0===e?void 0:e.userIDList.join(","));switch((null===(o=null===(c=null==a?void 0:a.payload)||void 0===c?void 0:c.memberList)||void 0===o?void 0:o.length)>0&&(p="",null===(r=null===(s=null==a?void 0:a.payload)||void 0===s?void 0:s.memberList)||void 0===r||r.map((function(a){return p+="".concat((null==a?void 0:a.nick)||(null==a?void 0:a.userID),","),a})),p=p.slice(0,-1)),a.payload.operationType){case t.TYPES.GRP_TIP_MBR_JOIN:i.text="".concat(p," ").concat(n("message.tip.Join in group"));break;case t.TYPES.GRP_TIP_MBR_QUIT:i.text="".concat(n("message.tip.member"),":").concat(p," ").concat(n("message.tip.quit group"));break;case t.TYPES.GRP_TIP_MBR_KICKED_OUT:i.text="".concat(n("message.tip.member"),":").concat(p," ").concat(n("message.tip.by")," ").concat(a.payload.operatorID," ").concat(n("message.tip.kicked out of group"));break;case t.TYPES.GRP_TIP_MBR_SET_ADMIN:i.text="".concat(n("message.tip.member"),":").concat(p," ").concat(n("message.tip.become admin"));break;case t.TYPES.GRP_TIP_MBR_CANCELED_ADMIN:i.text="".concat(n("message.tip.member"),":").concat(p," ").concat(n("message.tip.by revoked administrator"));break;case t.TYPES.GRP_TIP_GRP_PROFILE_UPDATED:i.text=function(a){var t=a.payload,e=t.newGroupProfile,c=t.operatorID,o="",s=Object.keys(e)[0];switch(s){case"muteAllMembers":o=e[s]?"".concat(n("message.tip.admin")," ").concat(c," ").concat(n("message.tip.enable all staff mute")):"".concat(n("message.tip.admin")," ").concat(c," ").concat(n("message.tip.unmute everyone"));break;case"ownerID":o="".concat(e[s]," ").concat(n("message.tip.become the new owner"));break;case"groupName":o="".concat(c," ").concat(n("message.tip.modify group name")," ").concat(e[s]);break;case"notification":o="".concat(c," ").concat(n("message.tip.post a new announcement"))}return o}(a);break;case t.TYPES.GRP_TIP_MBR_PROFILE_UPDATED:a.payload.memberList.map((function(a){return a.muteTime>0?i.text="".concat(n("message.tip.member"),":").concat(a.userID).concat(n("message.tip.muted")):i.text="".concat(n("message.tip.member"),":").concat(a.userID).concat(n("message.tip.unmuted")),a}));break;default:i.text="[".concat(n("message.tip.reminder message"),"]")}return i}function r(a){return{text:e(a.payload)}}function i(a){var t={message:a,name:"",url:""};return t.name=a.payload.data,a.payload.data.indexOf("@2x")<0&&(t.name="".concat(t.name,"@2x")),t.url="https://web.sdk.qcloud.com/im/assets/face-elem/".concat(t.name,".png"),t}function p(a){var t={lon:"",lat:"",href:"",url:"",description:"",message:a};return t.lon=a.payload.longitude.toFixed(6),t.lat=a.payload.latitude.toFixed(6),t.href="https://map.qq.com/?type=marker&isopeninfowin=1&markertype=1&"+"pointx=".concat(t.lon,"&pointy=").concat(t.lat,"&name=").concat(a.payload.description),t.url="https://apis.map.qq.com/ws/staticmap/v2/?"+"center=".concat(t.lat,",").concat(t.lon,"&zoom=10&size=300*150&maptype=roadmap&")+"markers=size:large|color:0xFFCCFF|label:k|".concat(t.lat,",").concat(t.lon,"&")+"key=UBNBZ-PTP3P-TE7DB-LHRTI-Y4YLE-VWBBD",t.description=a.payload.description,t}function m(a){return{progress:(null==a?void 0:a.status)===c.UNSEND&&a.progress,url:a.payload.imageInfoArray[1].url,message:a}}function l(a){var t,e;return{progress:(null==a?void 0:a.status)===c.UNSEND&&(null==a?void 0:a.progress),url:null===(t=null==a?void 0:a.payload)||void 0===t?void 0:t.videoUrl,snapshotUrl:null===(e=null==a?void 0:a.payload)||void 0===e?void 0:e.snapshotUrl,message:a}}function u(a){return{progress:(null==a?void 0:a.status)===c.UNSEND&&a.progress,url:a.payload.url,message:a,second:a.payload.second}}function d(a){var t="";return t=a.payload.fileSize>=1048576?"".concat((a.payload.fileSize/1048576).toFixed(2)," Mb"):a.payload.fileSize>=1024?"".concat((a.payload.fileSize/1024).toFixed(2)," Kb"):"".concat(a.payload.fileSize.toFixed(2),"B"),{progress:(null==a?void 0:a.status)===c.UNSEND&&a.progress,url:a.payload.fileUrl,message:a,name:a.payload.fileName,size:t}}function g(t){return a({message:t},t.payload)}function y(a){var t={},e={};try{t=o(a.payload.data)}catch(a){t={}}if(1!==t.businessID)return"";try{e=o(t.data)}catch(a){e={}}switch(t.actionType){case 1:return e.call_end>=0&&!t.groupID?"".concat(n("message.custom.talkTime"),":").concat(v(e.call_end)):t.groupID?"".concat(n("message.custom.groupCallEnd")):e.data&&"switchToAudio"===e.data.cmd?"".concat(n("message.custom.switchToAudioCall")):e.data&&"switchToVideo"===e.data.cmd?"".concat(n("message.custom.switchToVideoCall")):"".concat(n("message.custom.all"));case 2:return"".concat(n("message.custom.cancel"));case 3:return e.data&&"switchToAudio"===e.data.cmd?"".concat(n("message.custom.switchToAudioCall")):e.data&&"switchToVideo"===e.data.cmd?"".concat(n("message.custom.switchToVideoCall")):"".concat(n("message.custom.accepted"));case 4:return"".concat(n("message.custom.rejected"));case 5:return e.data&&"switchToAudio"===e.data.cmd?"".concat(n("message.custom.switchToAudioCall")):e.data&&"switchToVideo"===e.data.cmd?"".concat(n("message.custom.switchToVideoCall")):"".concat(n("message.custom.noResp"));default:return""}}function I(a){return{message:a,custom:y(a)||(null==a?void 0:a.payload)||"[".concat(n("message.custom.custom"),"]")}}function f(a){var t=a.payload.groupProfile.name||a.payload.groupProfile.groupID;switch(a.payload.operationType){case 1:return"".concat(a.payload.operatorID," ").concat(n("message.tip.申请加入群组"),":").concat(t);case 2:return"".concat(n("message.tip.成功加入群组"),":").concat(t);case 3:return"".concat(n("message.tip.申请加入群组"),":").concat(t," ").concat(n("message.tip.被拒绝"));case 4:return"".concat(n("message.tip.你被管理员")).concat(a.payload.operatorID," ").concat(n("message.tip.踢出群组"),":").concat(t);case 5:return"".concat(n("message.tip.群"),":").concat(t," ").concat(n("message.tip.被")," ").concat(a.payload.operatorID," ").concat(n("message.tip.解散"));case 6:return"".concat(a.payload.operatorID," ").concat(n("message.tip.创建群"),":").concat(t);case 7:case 12:return"".concat(a.payload.operatorID," ").concat(n("message.tip.邀请你加群"),":").concat(t);case 8:return"".concat(n("message.tip.你退出群组"),":").concat(t);case 9:return"".concat(n("message.tip.你被")).concat(a.payload.operatorID," ").concat(n("message.tip.设置为群"),":").concat(t," ").concat(n("message.tip.的管理员"));case 10:return"".concat(n("message.tip.你被")).concat(a.payload.operatorID," ").concat(n("message.tip.撤销群"),":").concat(t," ").concat(n("message.tip.的管理员身份"));case 13:return"".concat(a.payload.operatorID," ").concat(n("message.tip.同意加群"),":").concat(t);case 14:return"".concat(a.payload.operatorID," ").concat(n("message.tip.拒接加群"),":").concat(t);case 255:return"".concat(n("message.tip.自定义群系统通知"),": ").concat(a.payload.userDefinedField);default:return""}}function v(a){var t,e,c,o,n=a;return n>=3600?(e=parseInt("".concat(n/3600),10)<10?"0".concat(parseInt("".concat(n/3600),10)):parseInt("".concat(n/3600),10),c=parseInt("".concat(n%60/60),10)<10?"0".concat(parseInt("".concat(n%60/60),10)):parseInt("".concat(n%60/60),10),(o=n%3600<10?parseInt("0".concat(n%3600)):n%3600)>60&&(c=parseInt("".concat(o/60),10)<10?"0".concat(parseInt("".concat(o/60),10)):parseInt("".concat(o/60),10),o=o%60<10?"0".concat(o%60):o%60),t="".concat(e,":").concat(c,":").concat(o)):n>=60&&n<3600?(c=parseInt("".concat(n/60),10)<10?"0".concat(parseInt("".concat(n/60),10)):parseInt("".concat(n/60),10),o=n%60<10?"0".concat(n%60):n%60,t="00:".concat(c,":").concat(o)):n<60&&(o=n<10?"0".concat(n):n,t="00:00:".concat(o)),t}export{y as extractCallingInfoFromMessage,v as formatTime,u as handleAudioMessageShowContext,I as handleCustomMessageShowContext,i as handleFaceMessageShowContext,d as handleFileMessageShowContext,m as handleImageMessageShowContext,p as handleLocationMessageShowContext,g as handleMergerMessageShowContext,r as handleTextMessageShowContext,s as handleTipMessageShowContext,l as handleVideoMessageShowContext,f as translateGroupSystemNotice};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useState as o}from"react";import{useTUIMessageInputContext as a}from"../../context/TUIMessageInputContext.js";import{Icon as n}from"../Icon/Icon.js";import{IconTypes as r}from"../Icon/type.js";import{Popup as c}from"../Popup/index.js";import{emojiName as p,emojiUrl as s,emojiMap as m}from"../TUIMessage/utils/emojiMap.js";function l(){var l=o(!1),u=l[0],f=l[1],d=o(0),g=d[0];d[1];var j=o(""),h=j[0],I=j[1],x=function(){f(!u)},M=a("TUIMessageInputDefault"),v=M.onSelectEmoji,N=M.sendFaceMessage,b=function(t){var e={index:g,data:t.target.dataset.data};e.data&&(0===g?v(e):(N(e),x()))};return e("div",t({className:"emoji-picker input-plugin-popup"},{children:[i(n,{width:20,height:20,type:r.EMOJI,onClick:x}),i(c,t({className:"input-plugin-popup-box ".concat(h),show:u,close:x,handleVisible:function(t){I("".concat(!t.top&&"emoji-plugin-top"," ").concat(!t.left&&"emoji-plugin-right"))}},{children:i("ul",t({className:"face-list"},{children:0===g&&p.map((function(e,o){var a=e+o;return i("li",t({role:"menuitem",className:"face-list-item",onClick:b},{children:i("img",{src:"".concat(s+m[e]),alt:"","data-data":e})}),a)}))}))}))]}))}export{l as EmojiPicker};
|
|
1
|
+
import{__assign as t}from"tslib";import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useState as o}from"react";import{useTUIMessageInputContext as a}from"../../context/TUIMessageInputContext.js";import{Icon as n}from"../Icon/Icon.js";import{IconTypes as r}from"../Icon/type.js";import{Popup as c}from"../Popup/index.js";import{emojiName as p,emojiUrl as s,emojiMap as m}from"../TUIMessage/utils/emojiMap.js";function l(){var l=o(!1),u=l[0],f=l[1],d=o(0),g=d[0];d[1];var j=o(""),h=j[0],I=j[1],x=function(){f(!u)},M=a("TUIMessageInputDefault"),v=M.onSelectEmoji,N=M.sendFaceMessage,b=function(t){var e={index:g,data:t.target.dataset.data};e.data&&(0===g?v&&v(e):(N&&N(e),x()))};return e("div",t({className:"emoji-picker input-plugin-popup"},{children:[i(n,{width:20,height:20,type:r.EMOJI,onClick:x}),i(c,t({className:"input-plugin-popup-box ".concat(h),show:u,close:x,handleVisible:function(t){I("".concat(!t.top&&"emoji-plugin-top"," ").concat(!t.left&&"emoji-plugin-right"))}},{children:i("ul",t({className:"face-list"},{children:0===g&&p.map((function(e,o){var a=e+o;return i("li",t({role:"menuitem",className:"face-list-item",onClick:b},{children:i("img",{src:"".concat(s+m[e]),alt:"","data-data":e})}),a)}))}))}))]}))}export{l as EmojiPicker};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as i,__spreadArray as o}from"tslib";import{jsxs as e,jsx as n}from"react/jsx-runtime";import{useRef as l}from"react";import{useTranslation as t}from"react-i18next";import{EmojiPicker as r}from"./EmojiPicker.js";import{Plugins as u}from"../Plugins/index.js";import{useUploadElement as
|
|
1
|
+
import{__assign as i,__spreadArray as o}from"tslib";import{jsxs as e,jsx as n}from"react/jsx-runtime";import{useRef as l}from"react";import{useTranslation as t}from"react-i18next";import{EmojiPicker as r}from"./EmojiPicker.js";import{Plugins as u}from"../Plugins/index.js";import{useUploadElement as d}from"./hooks/useUploadElement.js";import{MESSAGE_TYPE_NAME as c}from"../../constants.js";import{useTUIMessageInputContext as s}from"../../context/TUIMessageInputContext.js";import{Icon as p}from"../Icon/Icon.js";import{IconTypes as v}from"../Icon/type.js";import{useTUIChatStateContext as a}from"../../context/TUIChatStateContext.js";import"../../context/TUIMessageContext.js";function m(){var m,g,f,h,I,C,M,j=s("TUIMessageInputDefault"),U=j.sendUploadMessage,k=j.pluginConfig,x=t().t,E=a("TUIMessageInput").TUIMessageInputConfig,P=(null==k?void 0:k.plugins)||(null===(m=null==E?void 0:E.pluginConfig)||void 0===m?void 0:m.plugins)||[],T=(null==k?void 0:k.showNumber)||(null===(g=null==E?void 0:E.pluginConfig)||void 0===g?void 0:g.showNumber)||1,y=(null==k?void 0:k.MoreIcon)||(null===(f=null==E?void 0:E.pluginConfig)||void 0===f?void 0:f.MoreIcon),N=function(i,o,e){return"boolean"==typeof i?i:"boolean"==typeof o?o:e},b=N(null==k?void 0:k.isEmojiPicker,null===(h=null==E?void 0:E.pluginConfig)||void 0===h?void 0:h.isEmojiPicker,!0),w=N(null==k?void 0:k.isImagePicker,null===(I=null==E?void 0:E.pluginConfig)||void 0===I?void 0:I.isImagePicker,!0),V=N(null==k?void 0:k.isVideoPicker,null===(C=null==E?void 0:E.pluginConfig)||void 0===C?void 0:C.isVideoPicker,!0),D=N(null==k?void 0:k.isFilePicker,null===(M=null==E?void 0:E.pluginConfig)||void 0===M?void 0:M.isFilePicker,!0),F=l(),O=w&&d({children:e("div",i({className:"input-plugin-item"},{children:[n(p,{width:20,height:20,type:v.IMAGE}),n("span",{children:x("TUIChat.Image")})]})),type:"image",accept:"image/*",onChange:function(i){var o;(null===(o=null==F?void 0:F.current)||void 0===o?void 0:o.closeMore)&&F.current.closeMore(),U&&U({file:i},c.IMAGE)}}),A=V&&d({children:e("div",i({className:"input-plugin-item"},{children:[n(p,{width:20,height:20,type:v.VIDEO}),n("span",{children:x("TUIChat.Video")})]})),type:"video",accept:"video/*",onChange:function(i){var o;(null===(o=null==F?void 0:F.current)||void 0===o?void 0:o.closeMore)&&F.current.closeMore(),U&&U({file:i},c.VIDEO)}}),G=D&&d({children:e("div",i({className:"input-plugin-item"},{children:[n(p,{width:20,height:20,type:v.DOCUMENT}),n("span",{children:x("TUIChat.File")})]})),type:"file",accept:"file/*",onChange:function(i){var o;(null===(o=null==F?void 0:F.current)||void 0===o?void 0:o.closeMore)&&F.current.closeMore(),U&&U({file:i},c.FILE)}}),L=o([b&&n(r,{}),O,A,G],P,!0).filter((function(i){return i}));return n(u,{ref:F,plugins:L,showNumber:T,MoreIcon:y})}export{m as InputPluginsDefalut};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsxs as o,jsx as e}from"react/jsx-runtime";import{useCallback as s}from"react";import{useTUIChatActionContext as n}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{Icon as i}from"../Icon/Icon.js";import{IconTypes as r}from"../Icon/type.js";import{MESSAGE_OPERATE as m}from"../../constants.js";import{useHandleQuoteMessage as a}from"./hooks/useHandleQuoteMessage.js";import{formatEmojiString as l}from"../TUIMessage/utils/emojiMap.js";function c(c){var p=c.message,u=n().operateMessage,d=a(p),f=d.cloudCustomData,h=d.message,g=s((function(){var t;u(((t={})[m.QUOTE]=null,t))}),[u]),j=null==f?void 0:f.messageReply;return j&&o("div",t({className:"input-quote"},{children:[o("div",t({className:"input-quote-content"},{children:[e("label",t({htmlFor:"input-quote-content"},{children:(null==h?void 0:h.nick)||(null==h?void 0:h.from)})),e("span",{children:l(null==j?void 0:j.messageAbstract,1)})]})),e(i,{className:"icon",width:12,height:12,type:r.CLOSE,onClick:g})]}))}export{c as InputQuoteDefalut};
|
|
1
|
+
import{__assign as t}from"tslib";import{jsxs as o,jsx as e}from"react/jsx-runtime";import{useCallback as s}from"react";import{useTUIChatActionContext as n}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{Icon as i}from"../Icon/Icon.js";import{IconTypes as r}from"../Icon/type.js";import{MESSAGE_OPERATE as m}from"../../constants.js";import{useHandleQuoteMessage as a}from"./hooks/useHandleQuoteMessage.js";import{formatEmojiString as l}from"../TUIMessage/utils/emojiMap.js";function c(c){var p=c.message,u=n().operateMessage,d=a(p),f=d.cloudCustomData,h=d.message,g=s((function(){var t;u&&u(((t={})[m.QUOTE]=null,t))}),[u]),j=null==f?void 0:f.messageReply;return j&&o("div",t({className:"input-quote"},{children:[o("div",t({className:"input-quote-content"},{children:[e("label",t({htmlFor:"input-quote-content"},{children:(null==h?void 0:h.nick)||(null==h?void 0:h.from)})),e("span",{children:l(null==j?void 0:j.messageAbstract,1)})]})),e(i,{className:"icon",width:12,height:12,type:r.CLOSE,onClick:g})]}))}export{c as InputQuoteDefalut};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e,__spreadArray as t}from"tslib";import{jsx as o,jsxs as r}from"react/jsx-runtime";import{useState as a,useCallback as i,useEffect as n}from"react";import{useTranslation as l}from"react-i18next";import{useTUIChatActionContext as s}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{Model as c}from"../Model/index.js";import{Icon as d}from"../Icon/Icon.js";import{IconTypes as m}from"../Icon/type.js";import{Input as u}from"../Input/Input.js";import{Checkbox as h}from"../Checkbox/index.js";import{Avatar as f}from"../Avatar/Avatar.js";import{getDisplayImage as
|
|
1
|
+
import{__assign as e,__spreadArray as t}from"tslib";import{jsx as o,jsxs as r}from"react/jsx-runtime";import{useState as a,useCallback as i,useEffect as n}from"react";import{useTranslation as l}from"react-i18next";import{useTUIChatActionContext as s}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{Model as c}from"../Model/index.js";import{Icon as d}from"../Icon/Icon.js";import{IconTypes as m}from"../Icon/type.js";import{Input as u}from"../Input/Input.js";import{Checkbox as h}from"../Checkbox/index.js";import{Avatar as f}from"../Avatar/Avatar.js";import{getDisplayImage as p,getDisplayTitle as v}from"../ConversationPreview/utils.js";import{MESSAGE_OPERATE as g}from"../../constants.js";import"@tencentcloud/chat-uikit-engine";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat";import"./hooks/useHandleQuoteMessage.js";import{useHandleForwardMessage as w}from"./hooks/useHandleForwardMessage.js";function C(C){var N,I=C.handleForward,j=l().t,x=a([]),b=x[0],k=x[1],F=a([]),D=F[0],A=F[1],L=a(""),M=L[0],T=L[1],U=s().operateMessage,R=w(),y=R.message,S=R.sendForwardMessage,H=R.conversationList,z=void 0===H?[]:H,E=i((function(){var e;U&&U(((e={})[g.FORWARD]=null,e))}),[U]),P=z,O=function(e){e.checked?k(t(t([],b,!0),[e.value],!1)):k(b.filter((function(t){return t!==e.value})))};return n((function(){k([]),A([]),T("")}),[y]),y&&z.length>0&&o(c,e({onClick:E},{children:r("div",e({role:"button",tabIndex:0,className:"tui-forward",onClick:function(e){!function(e){e.stopPropagation()}(e)}},{children:[r("header",e({className:"tui-forward-header"},{children:[o(d,{type:m.CANCEL,width:16,height:16,onClick:E}),o("h2",e({className:"tui-forward-title"},{children:j("TUIChat.Forward to")}))]})),o("div",e({className:"tui-forward-search"},{children:o(u,{className:"tui-forward-search-input",placeholder:"Search",clearable:!0,value:M,onChange:function(e){var t,o;if(T(null===(t=e.target)||void 0===t?void 0:t.value),null===(o=e.target)||void 0===o?void 0:o.value){var r=z.filter((function(t){var o,r=v(t).toLocaleLowerCase(),a=null===(o=e.target)||void 0===o?void 0:o.value.toLocaleLowerCase();return r.includes(a)}));A(r)}else A([])},prefix:o(d,{type:m.SEARCH,height:16,width:16})})})),r("main",e({className:"tui-forward-main"},{children:[M&&r("ul",e({className:"tui-forward-list"},{children:[o("h3",e({className:"tui-forward-list-title"},{children:j("TUIChat.Search Result")})),D.length>0&&D.map((function(t){return r("li",e({className:"tui-forward-list-item"},{children:[r("label",e({htmlFor:"".concat(t.conversationID),className:"info"},{children:[o(f,{image:p(t),size:40}),o("div",e({className:"info-nick"},{children:v(t)}))]})),o(h,{onChange:function(e){O(e)},id:"".concat(t.conversationID),value:t})]}),t.conversationID)})),0===D.length&&o("p",e({className:"no-result"},{children:j("TUIChat.No Result")}))]})),!M&&P.length>0&&o("ul",e({className:"tui-forward-list"},{children:P.map((function(t){return r("li",e({className:"tui-forward-list-item"},{children:[r("label",e({htmlFor:"".concat(t.conversationID),className:"info"},{children:[o(f,{image:p(t),size:40}),o("div",e({className:"info-nick"},{children:v(t)}))]})),o(h,{onChange:O,id:"".concat(t.conversationID),value:t})]}),t.conversationID)}))}))]})),r("footer",e({className:"tui-forward-footer"},{children:[o("div",e({className:"tui-forward-footer-name"},{children:b.length>0&&(N=b,(null==N?void 0:N.map((function(e){return v(e)}))).toString())})),o("button",e({type:"button",className:"button",onClick:function(){I?I({list:b,message:y}):S(b),E()},disabled:0===b.length},{children:j("TUIChat.Forward")}))]}))]}))}))}export{C as TUIForward};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsxs as e,jsx as n}from"react/jsx-runtime";import{useEffect as o,useState as r}from"react";import{useTranslation as a}from"react-i18next";import{MESSAGE_OPERATE as i}from"../../constants.js";import{useTUIChatStateContext as s}from"../../context/TUIChatStateContext.js";import"../../context/TUIMessageContext.js";import{useTUIMessageInputContext as u}from"../../context/TUIMessageInputContext.js";import{isPC as
|
|
1
|
+
import{__assign as t}from"tslib";import{jsxs as e,jsx as n}from"react/jsx-runtime";import{useEffect as o,useState as r}from"react";import{useTranslation as a}from"react-i18next";import{MESSAGE_OPERATE as i}from"../../constants.js";import{useTUIChatStateContext as s}from"../../context/TUIChatStateContext.js";import"../../context/TUIMessageContext.js";import{useTUIMessageInputContext as u}from"../../context/TUIMessageInputContext.js";import{isPC as l}from"../../utils/env.js";import{formatEmojiString as c}from"../TUIMessage/utils/emojiMap.js";function d(){var d=u("TUIMessageInputDefault"),m=d.text,f=d.disabled,p=d.handleChange,v=d.handleKeyDown,x=d.handlePasete,g=d.textareaRef,h=d.focus,I=d.setText,b=d.setCursorPos,j=a().t,C=s("TUIMessageInputDefault").operateData;o((function(){C&&C[i.REVOKE]&&I&&I(c(C[i.REVOKE].payload.text,1))}),[C]),o((function(){var t,e;return h&&g&&g.current&&(g.current.autofocus=!0,l&&(null===(t=null==g?void 0:g.current)||void 0===t||t.focus()),null===(e=null==g?void 0:g.current)||void 0===e||e.addEventListener("paste",x)),function(){var t;null===(t=null==g?void 0:g.current)||void 0===t||t.removeEventListener("paste",x)}}),[h,g]);var E=r(!1),T=E[0],U=E[1];return e("div",t({className:"input-box ".concat(f?"disabled":""," ").concat(T?"tui-kit-input-box--focus":"tui-kit-input-box--blur")},{children:[n("div",t({className:"input-visibility-content"},{children:m})),!f&&n("textarea",{placeholder:j("TUIChat.Enter a message"),rows:1,value:m,ref:g,onChange:p,onKeyDown:v,onFocus:function(){U(!0)},onBlur:function(t){!function(t){var e;b&&b({start:null===(e=null==t?void 0:t.target)||void 0===e?void 0:e.selectionStart,end:t.target.selectionEnd}),U(!1)}(t)}})]}))}export{d as TUIMessageInputDefault};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as e}from"react";import{useTranslation as t}from"react-i18next";import{TUIChatService as a}from"@tencentcloud/chat-uikit-engine";import{emojiEnKey as n}from"../../TUIMessage/utils/emojiMap.js";function o(o){o.textareaRef;var i=o.insertText,r=t().i18n;return{onSelectEmoji:function(e){"zh"===r.language?i(e.data):i(n[e.data])},sendFaceMessage:e((function(e){a.sendFaceMessage({payload:e})}),[])}}export{o as useEmojiPicker};
|
|
1
|
+
import{useCallback as e}from"react";import{useTranslation as t}from"react-i18next";import{TUIChatService as a}from"@tencentcloud/chat-uikit-engine";import{emojiEnKey as n}from"../../TUIMessage/utils/emojiMap.js";function o(o){o.textareaRef;var i=o.insertText,r=t().i18n;return{onSelectEmoji:function(e){"zh"===r.language?i&&i(e.data):i&&i(n[e.data])},sendFaceMessage:e((function(e){a.sendFaceMessage({payload:e})}),[])}}export{o as useEmojiPicker};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e}from"tslib";import{useState as n,useEffect as o}from"react";import r from"@tencentcloud/chat";import{TUIChatService as i}from"@tencentcloud/chat-uikit-engine";import{MESSAGE_OPERATE as s}from"../../../constants.js";import{useTUIKitContext as a}from"../../../context/TUIKitContext.js";import{useTUIChatStateContext as c}from"../../../context/TUIChatStateContext.js";import"react/jsx-runtime";import"../../../context/TUIMessageContext.js";function u(u){var m=this,f=c("TUIMessageInputDefault").operateData,p=n([]),d=p[0],l=p[1],v=a("TUIChat").chat,h=u||f[s.FORWARD];return o((function(){t(m,void 0,void 0,(function(){var t,n;return e(this,(function(e){switch(e.label){case 0:return[4,v.getConversationList()];case 1:return t=e.sent(),l(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.conversationList.filter((function(t){return t.type!==r.TYPES.CONV_SYSTEM}))),[2]}}))}))}),[v]),{message:h,conversationList:d,sendForwardMessage:function(t){t.map((function(t){return i.sendForwardMessage([t],[h]),t}))}}}export{u as useHandleForwardMessage};
|
|
1
|
+
import{__awaiter as t,__generator as e}from"tslib";import{useState as n,useEffect as o}from"react";import r from"@tencentcloud/chat";import{TUIChatService as i}from"@tencentcloud/chat-uikit-engine";import{MESSAGE_OPERATE as s}from"../../../constants.js";import{useTUIKitContext as a}from"../../../context/TUIKitContext.js";import{useTUIChatStateContext as c}from"../../../context/TUIChatStateContext.js";import"react/jsx-runtime";import"../../../context/TUIMessageContext.js";function u(u){var m=this,f=c("TUIMessageInputDefault").operateData,p=n([]),d=p[0],l=p[1],v=a("TUIChat").chat,h=u||f&&f[s.FORWARD];return o((function(){t(m,void 0,void 0,(function(){var t,n;return e(this,(function(e){switch(e.label){case 0:return[4,v.getConversationList()];case 1:return t=e.sent(),l(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.conversationList.filter((function(t){return t.type!==r.TYPES.CONV_SYSTEM}))),[2]}}))}))}),[v]),{message:h,conversationList:d,sendForwardMessage:function(t){t.map((function(t){return h&&i.sendForwardMessage([t],[h]),t}))}}}export{u as useHandleForwardMessage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useState as e,useEffect as t}from"react";import o from"@tencentcloud/chat";import{MESSAGE_OPERATE as a}from"../../../constants.js";import"tslib";import"react/jsx-runtime";import{useTUIChatStateContext as n}from"../../../context/TUIChatStateContext.js";import"../../../context/TUIMessageContext.js";var S,s,l=((S={})[o.TYPES.MSG_TEXT]=1,S[o.TYPES.MSG_CUSTOM]=2,S[o.TYPES.MSG_IMAGE]=3,S[o.TYPES.MSG_AUDIO]=4,S[o.TYPES.MSG_VIDEO]=5,S[o.TYPES.MSG_FILE]=6,S[o.TYPES.MSG_FACE]=8,S),r=((s={})[o.TYPES.MSG_CUSTOM]="[custom]",s[o.TYPES.MSG_IMAGE]="[image]",s[o.TYPES.MSG_AUDIO]="[audio]",s[o.TYPES.MSG_VIDEO]="[video]",s[o.TYPES.MSG_FILE]="[file]",s[o.TYPES.MSG_FACE]="[face]",s);function i(S){var s=n("TUIMessageInputDefault").operateData,i=e({messageReply:null}),E=i[0],T=i[1],u=function(e){var t,a=l[null==e?void 0:e.type];return{messageAbstract:(null==e?void 0:e.type)===o.TYPES.MSG_TEXT?null===(t=null==e?void 0:e.payload)||void 0===t?void 0:t.text:r[null==e?void 0:e.type],messageSender:(null==e?void 0:e.nick)||(null==e?void 0:e.from),messageID:null==e?void 0:e.ID,messageType:a,version:1}};return t((function(){var e=S||s[a.QUOTE];T({messageReply:e?u(e):null})}),[s,S]),{cloudCustomData:E,handleQuoteMessage:u,message:S||s[a.QUOTE]}}export{i as useHandleQuoteMessage};
|
|
1
|
+
import{useState as e,useEffect as t}from"react";import o from"@tencentcloud/chat";import{MESSAGE_OPERATE as a}from"../../../constants.js";import"tslib";import"react/jsx-runtime";import{useTUIChatStateContext as n}from"../../../context/TUIChatStateContext.js";import"../../../context/TUIMessageContext.js";var S,s,l=((S={})[o.TYPES.MSG_TEXT]=1,S[o.TYPES.MSG_CUSTOM]=2,S[o.TYPES.MSG_IMAGE]=3,S[o.TYPES.MSG_AUDIO]=4,S[o.TYPES.MSG_VIDEO]=5,S[o.TYPES.MSG_FILE]=6,S[o.TYPES.MSG_FACE]=8,S),r=((s={})[o.TYPES.MSG_CUSTOM]="[custom]",s[o.TYPES.MSG_IMAGE]="[image]",s[o.TYPES.MSG_AUDIO]="[audio]",s[o.TYPES.MSG_VIDEO]="[video]",s[o.TYPES.MSG_FILE]="[file]",s[o.TYPES.MSG_FACE]="[face]",s);function i(S){var s=n("TUIMessageInputDefault").operateData,i=e({messageReply:null}),E=i[0],T=i[1],u=function(e){var t,a=l[null==e?void 0:e.type];return{messageAbstract:(null==e?void 0:e.type)===o.TYPES.MSG_TEXT?null===(t=null==e?void 0:e.payload)||void 0===t?void 0:t.text:r[null==e?void 0:e.type],messageSender:(null==e?void 0:e.nick)||(null==e?void 0:e.from),messageID:null==e?void 0:e.ID,messageType:a,version:1}};return t((function(){var e=S||s&&s[a.QUOTE];T({messageReply:e?u(e):null})}),[s,S]),{cloudCustomData:E,handleQuoteMessage:u,message:S||s&&s[a.QUOTE]}}export{i as useHandleQuoteMessage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e}from"tslib";import{useCallback as n}from"react";import{TUIChatService as
|
|
1
|
+
import{__awaiter as t,__generator as e}from"tslib";import{useCallback as n}from"react";import{TUIChatService as o}from"@tencentcloud/chat-uikit-engine";import{CONSTANT_DISPATCH_TYPE as r,MESSAGE_TYPE_NAME as i,MESSAGE_OPERATE as u}from"../../../constants.js";import{useTUIKitContext as a}from"../../../context/TUIKitContext.js";import"react/jsx-runtime";import{useTUIChatActionContext as s}from"../../../context/TUIChatActionContext.js";import"../../../context/TUIMessageContext.js";import{enableSampleTaskStatus as l}from"../../untils.js";import{formatEmojiString as c}from"../../TUIMessage/utils/emojiMap.js";import{useHandleQuoteMessage as d}from"./useHandleQuoteMessage.js";var f=function(f){var v=f.state,p=f.dispatch;f.focus;var T=f.textareaRef,m=f.sendUploadMessage,g=a("useMessageInputText").chat,x=s(),y=x.operateMessage,E=x.setFirstSendMessage,h=d().cloudCustomData,S=["Enter","NumpadEnter"],C=n((function(t){t.preventDefault(),t&&t.target&&p({type:r.SET_TEXT,getNewText:function(e){return t.target.value}})}),[g]),M=function(n){return t(void 0,void 0,void 0,(function(){var t,i;return e(this,(function(e){return null==n||n.preventDefault(),v.text?(t={payload:{text:c(v.text)}},h.messageReply&&(t.cloudCustomData=JSON.stringify(h)),o.sendTextMessage(t).then((function(t){var e=t.data.message;E&&E(e)})),l("sendMessage"),p({getNewText:function(t){return""},type:r.SET_TEXT}),y&&y(((i={})[u.QUOTE]=null,i)),[2]):[2]}))}))},D=n((function(t){!(null==t?void 0:t.ctrlKey)&&(null==t?void 0:t.code)&&S.indexOf(null==t?void 0:t.code)>-1&&13===t.keyCode&&(null==t||t.preventDefault(),M(t)),(null==t?void 0:t.ctrlKey)&&S.indexOf(null==t?void 0:t.code)>-1&&13===t.keyCode&&p({type:r.SET_TEXT,getNewText:function(t){return"".concat(t,"\n")}})}),[M,p]),P=n((function(n){return t(void 0,void 0,void 0,(function(){var t,o,u;return e(this,(function(e){return n.preventDefault(),n.clipboardData&&n.clipboardData.items?(t=n.clipboardData,o=t.types,u=t.items,o.find((function(t,e){var n=u[e];switch(t){case"text/plain":return n.getAsString((function(t){p({type:r.SET_TEXT,getNewText:function(e){return"".concat(e).concat(t)}})})),!0;case"Files":var o=n.getAsFile();return n&&"file"===n.kind&&n.type.match(/^image\//i)&&m&&m({file:o},i.IMAGE),!0;default:return!1}})),[2]):[2]}))}))}),[T]),_=n((function(t){var e,n,o;p({type:r.SET_TEXT,getNewText:function(e){var n,o;return"".concat(e.slice(0,(null===(n=null==v?void 0:v.cursorPos)||void 0===n?void 0:n.start)||0)).concat(t).concat(e.slice((null===(o=null==v?void 0:v.cursorPos)||void 0===o?void 0:o.start)||0))}}),p({type:r.SET_CURSOR_POS,value:{start:(null===(e=null==v?void 0:v.cursorPos)||void 0===e?void 0:e.start)&&v.cursorPos.start+t.length,end:(null===(n=null==v?void 0:v.cursorPos)||void 0===n?void 0:n.end)&&v.cursorPos.end+t.length}}),null===(o=null==T?void 0:T.current)||void 0===o||o.focus()}),[T,v]),j=n((function(t){var e;p({type:r.SET_TEXT,getNewText:function(){return"".concat(t)}}),null===(e=null==T?void 0:T.current)||void 0===e||e.focus()}),[T]),w=n((function(t){p({type:r.SET_CURSOR_POS,value:t})}),[T]);return{handleChange:C,handleSubmit:M,handleKeyDown:D,handlePasete:P,insertText:_,setText:j,setCursorPos:w}};export{f as useMessageInputText};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as t,jsx as a}from"react/jsx-runtime";function i(i){var n=i.children,r=i.type,
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as t,jsx as a}from"react/jsx-runtime";function i(i){var n=i.children,r=i.type,l=i.accept,c=i.onChange;return t("div",e({className:"upload-picker"},{children:[a("main",e({className:"upload-picker-content"},{children:n})),a("input",{title:"图片",type:"file","data-type":r,accept:l,onChange:function(e){if(e.target.files&&e.target.files.length>0){var t=e.target.files,a={type:t[0].type},i=new File(t,t[0].name,a);c&&c(i)}e.target.value=""}})]}))}export{i as useUploadElement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as t,__generator as i}from"tslib";import{jsx as o,jsxs as n}from"react/jsx-runtime";import s,{useState as l,useEffect as r}from"react";import{useTranslation as a}from"react-i18next";import{useTUIChatStateContext as c}from"../../context/TUIChatStateContext.js";import{useTUIChatActionContext as m}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{useComponentContext as d}from"../../context/ComponentContext.js";import h from"./hooks/useMessageListElement.js";import{InfiniteScroll as g}from"../InfiniteScrollPaginator/InfiniteScroll.js";import{EmptyStateIndicator as u}from"../EmptyStateIndicator/EmptyStateIndicator.js";function f(s){var f=this,v=s.highlightedMessageId,p=s.loadMore,I=s.intervalsTimer,M=s.className,T=a().t,x=l(null),C=x[0],L=x[1],j=l(!1),S=j[0],U=j[1],E=c("TUIMessageList"),
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as i}from"tslib";import{jsx as o,jsxs as n}from"react/jsx-runtime";import s,{useState as l,useEffect as r}from"react";import{useTranslation as a}from"react-i18next";import{useTUIChatStateContext as c}from"../../context/TUIChatStateContext.js";import{useTUIChatActionContext as m}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{useComponentContext as d}from"../../context/ComponentContext.js";import h from"./hooks/useMessageListElement.js";import{InfiniteScroll as g}from"../InfiniteScrollPaginator/InfiniteScroll.js";import{EmptyStateIndicator as u}from"../EmptyStateIndicator/EmptyStateIndicator.js";function f(s){var f=this,v=s.highlightedMessageId,p=s.loadMore,I=s.intervalsTimer,M=s.className,T=a().t,x=l(null),C=x[0],L=x[1],j=l(!1),S=j[0],U=j[1],E=c("TUIMessageList"),b=E.messageList,y=E.highlightedMessageId,N=E.isCompleted;E.isSameLastMessageID;var w=E.messageListRef,H=E.noMore,k=E.TUIMessageListConfig,V=m(),q=V.loadMore,A=V.setHighlightedMessageId,D=d(),P=D.TUIMessage,R=D.EmptyStateIndicator,z=void 0===R?u:R,B=v||(null==k?void 0:k.highlightedMessageId)||y,F=60*(I||(null==k?void 0:k.intervalsTimer)||30),G=p||(null==k?void 0:k.loadMore)||q,J=b&&h({enrichedMessageList:b,TUIMessage:P,intervalsTimer:F});return r((function(){t(f,void 0,void 0,(function(){var e,t,o,n,s;return i(this,(function(i){switch(i.label){case 0:return e=null===(s=null==C?void 0:C.parentElement)||void 0===s?void 0:s.parentElement,!N&&e&&(null==e?void 0:e.clientHeight)>=(null==C?void 0:C.clientHeight)?G?[4,G()]:[3,2]:[3,3];case 1:i.sent(),i.label=2;case 2:i.label=3;case 3:return(null==C?void 0:C.children)&&(t=(null==C?void 0:C.children)||[],o=t[t.length-1],n=setTimeout((function(){null==o||o.scrollIntoView(),U(!0),clearTimeout(n)}),100)),[2]}}))}))}),[J,S]),r((function(){if(B){var e=null==C?void 0:C.querySelector("[data-message-id='".concat(B,"']"));if(!e)return;var t=e.children;t[t.length-1].classList.add("high-lighted"),null==e||e.scrollIntoView({block:"center"});var i=setTimeout((function(){t[t.length-1].classList.remove("high-lighted"),clearTimeout(i),A&&A("")}),1e3)}}),[B]),n("div",e({className:"message-list ".concat(M," ").concat(S?"":"hide"),ref:w},{children:[H,H&&o("p",e({className:"no-more"},{children:T("TUIChat.No More")})),o(g,e({className:"message-list-infinite-scroll",hasMore:!0,loadMore:G,threshold:1},{children:o("ul",e({ref:L},{children:(null==J?void 0:J.length)&&J.length>0?J:o(z,{listType:"message"})}))}))]}))}var v=s.memo(f);function p(t){return o(v,e({},t))}export{p as TUIMessageList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useMemo as r}from"react";import{useTUIKitContext as n}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{getTimeStamp as o}from"../../untils.js";function s(s){var a=s.enrichedMessageList,m=s.TUIMessage,c=s.intervalsTimer,l=n("TUIConversation").language;return r((function(){return null==a?void 0:a.map((function(r,n){var s,u="".concat(r.ID,"-").concat(n),d=n>0?null===(s=a[n-1])||void 0===s?void 0:s.time:-1,f=(null==r?void 0:r.time)||0;return e("li",t({className:"message-list-item"},{children:[
|
|
1
|
+
import{__assign as t}from"tslib";import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useMemo as r}from"react";import{useTUIKitContext as n}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{getTimeStamp as o}from"../../untils.js";function s(s){var a=s.enrichedMessageList,m=s.TUIMessage,c=s.intervalsTimer,l=n("TUIConversation").language;return r((function(){return null==a?void 0:a.map((function(r,n){var s,u="".concat(r.ID,"-").concat(n),d=n>0?null===(s=a[n-1])||void 0===s?void 0:s.time:-1,f=(null==r?void 0:r.time)||0;return e("li",t({className:"message-list-item"},{children:[!(!c||-1===d)&&f-d>=c&&i("div",t({className:"message-list-time"},{children:f?o(1e3*f,l):0}),"".concat(f+n)),i(m,{message:r})]}),u)}))}),[a])}export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as o,Fragment as r,jsx as e}from"react/jsx-runtime";import t from"react";import{Profile as i}from"../Profile/Profile.js";import
|
|
1
|
+
import{jsxs as o,Fragment as r,jsx as e}from"react/jsx-runtime";import t from"react";import{Profile as i}from"../Profile/Profile.js";import{useMyProfile as f}from"./hooks/useMyProfile.js";import{TUIProfileDefault as m}from"./TUIProfileDefault.js";import{useTUIKitContext as l}from"../../context/TUIKitContext.js";import"tslib";import"../../context/TUIMessageContext.js";function s(t){var s=t.className,a=t.TUIProfile,n=f(),p=n.myProfile,P=n.updateMyProfile,c=l("TUIProfile"),u=c.setTUIProfileShow,I=c.TUIProfileShow,T=a||m;return o(r,{children:[e(i,{profile:p,handleAvatar:function(){u&&u(!0)}}),I&&e(T,{className:s,userInfo:p,update:P})]})}var a=t.memo(s);export{a as TUIProfile};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Profile } from '@tencentcloud/chat';
|
|
3
|
-
import {
|
|
3
|
+
import { UpdateMyProfileParams } from '@tencentcloud/chat-uikit-engine';
|
|
4
4
|
|
|
5
5
|
interface TUIProfileDefaultProps {
|
|
6
6
|
userInfo?: Profile;
|
|
7
|
-
update?: (option:
|
|
7
|
+
update?: (option: UpdateMyProfileParams) => void;
|
|
8
8
|
className?: string;
|
|
9
9
|
}
|
|
10
10
|
declare function TUIProfileDefault(props: TUIProfileDefaultProps): React.ReactElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as t,jsxs as a}from"react/jsx-runtime";import l,{useState as i}from"react";import{useTranslation as n}from"react-i18next";import o from"react-date-picker";import r from"@tencentcloud/chat";import{isH5 as c}from"../../utils/env.js";import{useTUIKitContext as u}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{Avatar as d}from"../Avatar/Avatar.js";import{DivWithEdit as s}from"../DivWithEdit/DivWithEdit.js";import{Icon as m}from"../Icon/Icon.js";import{IconTypes as v}from"../Icon/type.js";import{handleDisplayAvatar as p}from"../untils.js";var f,h,E=((f={})[r.TYPES.GENDER_UNKNOWN]="unknow",f[r.TYPES.GENDER_MALE]="male",f[r.TYPES.GENDER_FEMALE]="female",f),N=((h={})[r.TYPES.ALLOW_TYPE_ALLOW_ANY]="allowAny",h[r.TYPES.ALLOW_TYPE_NEED_CONFIRM]="needConfirm",h[r.TYPES.ALLOW_TYPE_DENY_ANY]="denyAny",h),g=["https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_1.png","https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_2.png","https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_3.png","https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_4.png","https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_5.png","https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_6.png"],T=[{label:"Male",value:r.TYPES.GENDER_MALE},{label:"Female",value:r.TYPES.GENDER_FEMALE}],y=[{label:"AllowAny",value:r.TYPES.ALLOW_TYPE_ALLOW_ANY},{label:"NeedConfirm",value:r.TYPES.ALLOW_TYPE_NEED_CONFIRM},{label:"DenyAny",value:r.TYPES.ALLOW_TYPE_DENY_ANY}];function _(l){var r,f,h,_,P,b,k=l.userInfo,A=l.className,Y=l.update,L=n().t,D=u("TUIProfileDefault").setTUIProfileShow,I=i(""),w=I[0],S=I[1],C=[{name:"Signature",value:null==k?void 0:k.selfSignature,type:"text",children:null},{name:"Gender",value:L((null===(r=E[null==k?void 0:k.gender])||void 0===r?void 0:r.replace(E[null==k?void 0:k.gender][0],null===(f=E[null==k?void 0:k.gender][0])||void 0===f?void 0:f.toLocaleUpperCase()))?"TUIProfile.".concat(null===(h=E[null==k?void 0:k.gender])||void 0===h?void 0:h.replace(E[null==k?void 0:k.gender][0],null===(_=E[null==k?void 0:k.gender][0])||void 0===_?void 0:_.toLocaleUpperCase())):""),type:"select",children:t("ul",e({className:"select-list"},{children:null==T?void 0:T.map((function(a,l){var i="".concat(a.value).concat(l);return t("li",e({className:"select-list-item",role:"menuitem",tabIndex:l,onClick:function(){x(a)}},{children:L("TUIProfile.".concat(a.label))}),i)}))}))},{name:"AllowType",value:L("TUIProfile.".concat(null===(P=N[null==k?void 0:k.allowType])||void 0===P?void 0:P.replace(N[null==k?void 0:k.allowType][0],null===(b=N[null==k?void 0:k.allowType][0])||void 0===b?void 0:b.toLocaleUpperCase()))),type:"select",children:t("ul",e({className:"select-list"},{children:null==y?void 0:y.map((function(a,l){var i="".concat(a.value).concat(l);return t("li",e({className:"select-list-item",role:"menuitem",tabIndex:l,onClick:function(){W(a)}},{children:L("TUIProfile.".concat(a.label))}),i)}))}))},{name:"Birthday",value:(null==k?void 0:k.birthday)?function(e){var t=String(e);if(8===t.length){var a=t.substring(0,4),l=t.substring(4,6),i=t.substring(6,8);return"".concat(a,"/").concat(l,"/").concat(i)}return"".concat(e)}(k.birthday):"",type:"select",children:t(o,{className:"tui-profile-birthday",calendarClassName:"tui-profile-birthday-calendar",isOpen:!0,format:"y-MM-dd",onChange:function(e){j(e)},value:function(e){if(8===(null==e?void 0:e.length)){var t=Number(e.slice(0,4)),a=Number(e.slice(4,6)),l=Number(e.slice(-2));return new Date(t,a-1,l)}return new Date}("".concat(null==k?void 0:k.birthday))})}];c&&(C=C.filter((function(e){return"Birthday"!==e.name})));var U=function(e){S(e)},M=function(e){Y(e),S("")},O=function(e){var t,a="";switch(null==e?void 0:e.name){case"nick":a="nick";break;case"Signature":a="selfSignature";break;default:return void S("")}var l=((t={})[a]=e.value,t);M(l)},x=function(e){M({gender:e.value})},W=function(e){M({allowType:e.value})},j=function(e){var t,a,l,i;M({birthday:Number((t=e,a=t.getDate()>9?t.getDate():"0".concat(t.getDate()),l=t.getMonth()>8?t.getMonth()+1:"0".concat(t.getMonth()+1),i=t.getFullYear(),"".concat(i).concat(l).concat(a)))})};return a("div",e({className:"".concat(A," tui-profile")},{children:[a("header",e({className:"tui-profile-header"},{children:[t(m,{width:9,height:16,type:v.BACK,onClick:function(){D(!1)}}),t("h1",{children:L("TUIProfile.Personal information")})]})),a("main",e({className:"tui-profile-main"},{children:[t("div",e({className:"tui-profile-avatar"},{children:t(d,{image:p(null==k?void 0:k.avatar),size:94,update:function(e){M({avatar:e})},list:g})})),t(s,{name:"nick",className:"tui-profile-nick",value:null==k?void 0:k.nick,type:"text",toggle:U,isEdit:"nick"===w,confirm:O,close:function(){S("")}}),a("div",e({className:"tui-profile-ID"},{children:[t("h5",{children:"ID:"}),t("span",{children:null==k?void 0:k.userID})]}))]})),t("ul",e({className:"tui-profile-list"},{children:C.map((function(l){var i="".concat(l.name);return a("li",e({className:"tui-profile-list-item"},{children:[t("h4",{children:L("TUIProfile.".concat(l.name))}),t(s,e({className:"tui-profile-div-with-edit",classEditName:"tui-profile-edit",name:l.name,value:l.value,type:l.type,toggle:U,isEdit:w===l.name,confirm:O,close:function(){S("")}},{children:null==l?void 0:l.children}))]}),i)}))}))]}))}var P=l.memo(_);function b(a){var l=e({},a);return t(P,e({},l))}export{b as TUIProfileDefault};
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as t,jsxs as a}from"react/jsx-runtime";import l,{useState as i}from"react";import{useTranslation as n}from"react-i18next";import o from"react-date-picker";import r from"@tencentcloud/chat";import{isH5 as c}from"../../utils/env.js";import{useTUIKitContext as u}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{Avatar as d}from"../Avatar/Avatar.js";import{DivWithEdit as s}from"../DivWithEdit/DivWithEdit.js";import{Icon as m}from"../Icon/Icon.js";import{IconTypes as v}from"../Icon/type.js";import{handleDisplayAvatar as p}from"../untils.js";var f,h,E=((f={})[r.TYPES.GENDER_UNKNOWN]="unknow",f[r.TYPES.GENDER_MALE]="male",f[r.TYPES.GENDER_FEMALE]="female",f),N=((h={})[r.TYPES.ALLOW_TYPE_ALLOW_ANY]="allowAny",h[r.TYPES.ALLOW_TYPE_NEED_CONFIRM]="needConfirm",h[r.TYPES.ALLOW_TYPE_DENY_ANY]="denyAny",h),g=["https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_1.png","https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_2.png","https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_3.png","https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_4.png","https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_5.png","https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_6.png"],T=[{label:"Male",value:r.TYPES.GENDER_MALE},{label:"Female",value:r.TYPES.GENDER_FEMALE}],y=[{label:"AllowAny",value:r.TYPES.ALLOW_TYPE_ALLOW_ANY},{label:"NeedConfirm",value:r.TYPES.ALLOW_TYPE_NEED_CONFIRM},{label:"DenyAny",value:r.TYPES.ALLOW_TYPE_DENY_ANY}];function _(l){var r,f,h,_,P,b,k=l.userInfo,A=l.className,Y=l.update,L=n().t,D=u("TUIProfileDefault").setTUIProfileShow,I=i(""),w=I[0],S=I[1],C=[{name:"Signature",value:null==k?void 0:k.selfSignature,type:"text",children:null},{name:"Gender",value:L((null==k?void 0:k.gender)&&(null===(r=E[null==k?void 0:k.gender])||void 0===r?void 0:r.replace(E[null==k?void 0:k.gender][0],null===(f=E[null==k?void 0:k.gender][0])||void 0===f?void 0:f.toLocaleUpperCase()))?"TUIProfile.".concat(null===(h=E[null==k?void 0:k.gender])||void 0===h?void 0:h.replace(E[null==k?void 0:k.gender][0],null===(_=E[null==k?void 0:k.gender][0])||void 0===_?void 0:_.toLocaleUpperCase())):""),type:"select",children:t("ul",e({className:"select-list"},{children:null==T?void 0:T.map((function(a,l){var i="".concat(a.value).concat(l);return t("li",e({className:"select-list-item",role:"menuitem",tabIndex:l,onClick:function(){x(a)}},{children:L("TUIProfile.".concat(a.label))}),i)}))}))},{name:"AllowType",value:L("TUIProfile.".concat(null===(P=N[(null==k?void 0:k.allowType)||""])||void 0===P?void 0:P.replace(k&&N[null==k?void 0:k.allowType][0],k&&(null===(b=N[null==k?void 0:k.allowType][0])||void 0===b?void 0:b.toLocaleUpperCase())))),type:"select",children:t("ul",e({className:"select-list"},{children:null==y?void 0:y.map((function(a,l){var i="".concat(a.value).concat(l);return t("li",e({className:"select-list-item",role:"menuitem",tabIndex:l,onClick:function(){W(a)}},{children:L("TUIProfile.".concat(a.label))}),i)}))}))},{name:"Birthday",value:(null==k?void 0:k.birthday)?function(e){var t=String(e);if(8===t.length){var a=t.substring(0,4),l=t.substring(4,6),i=t.substring(6,8);return"".concat(a,"/").concat(l,"/").concat(i)}return"".concat(e)}(k.birthday):"",type:"select",children:t(o,{className:"tui-profile-birthday",calendarClassName:"tui-profile-birthday-calendar",isOpen:!0,format:"y-MM-dd",onChange:function(e){j(e)},value:function(e){if(8===(null==e?void 0:e.length)){var t=Number(e.slice(0,4)),a=Number(e.slice(4,6)),l=Number(e.slice(-2));return new Date(t,a-1,l)}return new Date}("".concat(null==k?void 0:k.birthday))})}];c&&(C=C.filter((function(e){return"Birthday"!==e.name})));var U=function(e){S(e)},M=function(e){Y&&Y(e),S("")},O=function(e){var t,a="";switch(null==e?void 0:e.name){case"nick":a="nick";break;case"Signature":a="selfSignature";break;default:return void S("")}var l=((t={})[a]=e.value,t);M(l)},x=function(e){M({gender:e.value})},W=function(e){M({allowType:e.value})},j=function(e){var t,a,l,i;M({birthday:Number((t=e,a=t.getDate()>9?t.getDate():"0".concat(t.getDate()),l=t.getMonth()>8?t.getMonth()+1:"0".concat(t.getMonth()+1),i=t.getFullYear(),"".concat(i).concat(l).concat(a)))})};return a("div",e({className:"".concat(A," tui-profile")},{children:[a("header",e({className:"tui-profile-header"},{children:[t(m,{width:9,height:16,type:v.BACK,onClick:function(){D&&D(!1)}}),t("h1",{children:L("TUIProfile.Personal information")})]})),a("main",e({className:"tui-profile-main"},{children:[t("div",e({className:"tui-profile-avatar"},{children:t(d,{image:k&&p(null==k?void 0:k.avatar),size:94,update:function(e){M({avatar:e})},list:g})})),t(s,{name:"nick",className:"tui-profile-nick",value:null==k?void 0:k.nick,type:"text",toggle:U,isEdit:"nick"===w,confirm:O,close:function(){S("")}}),a("div",e({className:"tui-profile-ID"},{children:[t("h5",{children:"ID:"}),t("span",{children:null==k?void 0:k.userID})]}))]})),t("ul",e({className:"tui-profile-list"},{children:C.map((function(l){var i="".concat(l.name);return a("li",e({className:"tui-profile-list-item"},{children:[t("h4",{children:L("TUIProfile.".concat(l.name))}),t(s,e({className:"tui-profile-div-with-edit",classEditName:"tui-profile-edit",name:l.name,value:l.value,type:l.type,toggle:U,isEdit:w===l.name,confirm:O,close:function(){S("")}},{children:null==l?void 0:l.children}))]}),i)}))}))]}))}var P=l.memo(_);function b(a){var l=e({},a);return t(P,e({},l))}export{b as TUIProfileDefault};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{__assign as t}from"tslib";import{useState as r,useEffect as o}from"react";import{TUIStore as i,StoreName as e,TUIUserService as n}from"@tencentcloud/chat-uikit-engine";function f(){var f=r(),u=f[0],c=f[1];return o((function(){i.watch(e.USER,{userProfile:function(t){c(t)}})}),[]),{myProfile:u,updateMyProfile:function(r){n.updateMyProfile(r);var o=t({},u);c(o)}}}export{f as useMyProfile};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t){var e=t.type,c=void 0===e?"info":e,n=t.text,a=t.time,o=t.className,l=a||3,i=document.body,s=document.createElement("div");s.innerText=n,s.className="toast ".concat(o," ").concat(c),i.appendChild(s);var m=document.getElementsByClassName("toast");s.style.left="calc(50% - ".concat(s.clientWidth/2,"px)"),s.style.zIndex="".concat(10+m.length-1),s.style.top="".concat(s.clientHeight*(m.length-1),"px");var d=setTimeout((function(){i.removeChild(s),clearTimeout(d)}),1e3*l)}export{t as Toast};
|
|
1
|
+
function t(t){var e=t.type,c=void 0===e?"info":e,n=t.text,a=t.time,o=t.className,l=a||3,i=document.body,s=document.createElement("div");n&&(s.innerText=n),s.className="toast ".concat(o," ").concat(c),i.appendChild(s);var m=document.getElementsByClassName("toast");s.style.left="calc(50% - ".concat(s.clientWidth/2,"px)"),s.style.zIndex="".concat(10+m.length-1),s.style.top="".concat(s.clientHeight*(m.length-1),"px");var d=setTimeout((function(){i.removeChild(s),clearTimeout(d)}),1e3*l)}export{t as Toast};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import React, { PropsWithChildren } from 'react';
|
|
2
3
|
import { EmptyStateIndicatorProps } from '../components/EmptyStateIndicator/EmptyStateIndicator.js';
|
|
3
4
|
import { TUIMessageProps } from '../components/TUIMessage/TUIMessage.js';
|
|
@@ -19,10 +20,10 @@ interface ComponentContextValue {
|
|
|
19
20
|
MessageTextPlugins?: React.ComponentType<UnknowPorps>;
|
|
20
21
|
InputQuote?: React.ComponentType<UnknowPorps>;
|
|
21
22
|
}
|
|
22
|
-
declare const ComponentContext: React.Context<ComponentContextValue>;
|
|
23
|
+
declare const ComponentContext: React.Context<ComponentContextValue | undefined>;
|
|
23
24
|
declare function ComponentProvider({ children, value, }: PropsWithChildren<{
|
|
24
25
|
value: ComponentContextValue;
|
|
25
|
-
}>): JSX.Element;
|
|
26
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
26
27
|
declare function useComponentContext(componentName?: string): ComponentContextValue;
|
|
27
28
|
|
|
28
29
|
export { ComponentContext, ComponentContextValue, ComponentProvider, UnknowPorps, useComponentContext };
|
|
@@ -16,7 +16,7 @@ interface TUIChatActionContextValue {
|
|
|
16
16
|
updateUploadPendingMessageList?: (message?: Message) => void;
|
|
17
17
|
setActiveMessageID?: (messageID: string) => void;
|
|
18
18
|
}
|
|
19
|
-
declare const TUIChatActionContext: React.Context<TUIChatActionContextValue>;
|
|
19
|
+
declare const TUIChatActionContext: React.Context<TUIChatActionContextValue | undefined>;
|
|
20
20
|
declare function TUIChatActionProvider({ children, value, }: PropsWithChildren<{
|
|
21
21
|
value: TUIChatActionContextValue;
|
|
22
22
|
}>): React.ReactElement;
|