@tencentcloud/chat-uikit-react 1.2.2 → 2.1.2
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 +2 -1
- package/CHANGELOG.md +13 -2
- package/dist/cjs/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
- package/dist/cjs/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
- package/dist/cjs/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
- package/dist/cjs/components/ConversationPreview/ConversationPreview.d.ts +2 -0
- package/dist/cjs/components/ConversationPreview/ConversationPreview.js +1 -1
- package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.js +1 -1
- package/dist/cjs/components/ConversationPreview/utils.js +1 -1
- package/dist/cjs/components/ConversationSearch/ConversationSearchResult.js +1 -1
- package/dist/cjs/components/Icon/config.js +1 -1
- package/dist/cjs/components/Icon/images/chats-selected.svg.js +1 -0
- package/dist/cjs/components/Icon/images/chats.svg.js +1 -0
- package/dist/cjs/components/Icon/images/contacts-selected.svg.js +1 -0
- package/dist/cjs/components/Icon/images/contacts.svg.js +1 -0
- package/dist/cjs/components/Icon/images/files.png.js +1 -0
- package/dist/cjs/components/Icon/images/image.png.js +1 -1
- package/dist/cjs/components/Icon/images/video.png.js +1 -1
- package/dist/cjs/components/TUIChat/TUIChat.d.ts +5 -0
- 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/TUIContact.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/TUIContactInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/basicInfo.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/TUIConversation/TUIConversation.js +1 -1
- package/dist/cjs/components/TUIConversationList/TUIConversationList.d.ts +1 -0
- package/dist/cjs/components/TUIConversationList/TUIConversationList.js +1 -1
- package/dist/cjs/components/TUIKit/TUIKit.js +1 -1
- package/dist/cjs/components/TUIManage/TUIManage.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/MessageImage.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/MessageRevoke.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageSystem.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageText.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageTip.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/hooks/useMessageHandler.js +1 -1
- package/dist/cjs/components/TUIMessage/utils/index.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIForward.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIMessageInput.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/useMessageInputText.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useUploadPicker.js +1 -1
- package/dist/cjs/components/TUIMessageList/TUIMessageList.js +1 -1
- package/dist/cjs/components/TUIProfile/TUIProfileDefault.js +1 -1
- package/dist/cjs/components/untils.js +1 -1
- package/dist/cjs/constants.js +1 -1
- package/dist/cjs/context/ComponentContext.d.ts +2 -0
- package/dist/cjs/context/TUIChatActionContext.d.ts +3 -14
- package/dist/cjs/context/TUIChatStateContext.d.ts +2 -0
- package/dist/cjs/context/TUIConversationContext.js +1 -1
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.d.css +257 -12
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/locales/en/TUIChat.js +1 -1
- package/dist/cjs/locales/en/TUIContact.js +1 -1
- package/dist/cjs/locales/en/TUIProfile.js +1 -1
- package/dist/cjs/locales/index.js +1 -1
- package/dist/cjs/locales/zh_cn/TUIChat.js +1 -1
- package/dist/cjs/locales/zh_cn/TUIContact.js +1 -1
- package/dist/cjs/locales/zh_cn/TUIProfile.js +1 -1
- package/dist/cjs/server.js +1 -0
- package/dist/cjs/utils/env.js +1 -0
- package/dist/esm/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
- package/dist/esm/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
- package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
- package/dist/esm/components/ConversationPreview/ConversationPreview.d.ts +2 -0
- package/dist/esm/components/ConversationPreview/ConversationPreview.js +1 -1
- package/dist/esm/components/ConversationPreview/ConversationPreviewContent.js +1 -1
- package/dist/esm/components/ConversationPreview/utils.js +1 -1
- package/dist/esm/components/ConversationSearch/ConversationSearchResult.js +1 -1
- package/dist/esm/components/Icon/config.js +1 -1
- package/dist/esm/components/Icon/images/chats-selected.svg.js +1 -0
- package/dist/esm/components/Icon/images/chats.svg.js +1 -0
- package/dist/esm/components/Icon/images/contacts-selected.svg.js +1 -0
- package/dist/esm/components/Icon/images/contacts.svg.js +1 -0
- package/dist/esm/components/Icon/images/files.png.js +1 -0
- package/dist/esm/components/Icon/images/image.png.js +1 -1
- package/dist/esm/components/Icon/images/video.png.js +1 -1
- package/dist/esm/components/TUIChat/TUIChat.d.ts +5 -0
- 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/TUIContact.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/TUIContactInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/basicInfo.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/TUIConversation/TUIConversation.js +1 -1
- package/dist/esm/components/TUIConversationList/TUIConversationList.d.ts +1 -0
- package/dist/esm/components/TUIConversationList/TUIConversationList.js +1 -1
- package/dist/esm/components/TUIKit/TUIKit.js +1 -1
- package/dist/esm/components/TUIManage/TUIManage.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/MessageImage.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/MessageRevoke.js +1 -1
- package/dist/esm/components/TUIMessage/MessageSystem.js +1 -1
- package/dist/esm/components/TUIMessage/MessageText.js +1 -1
- package/dist/esm/components/TUIMessage/MessageTip.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/hooks/useMessageHandler.js +1 -1
- package/dist/esm/components/TUIMessage/utils/index.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIForward.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIMessageInput.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/useMessageInputText.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useUploadPicker.js +1 -1
- package/dist/esm/components/TUIMessageList/TUIMessageList.js +1 -1
- package/dist/esm/components/TUIProfile/TUIProfileDefault.js +1 -1
- package/dist/esm/components/untils.js +1 -1
- package/dist/esm/constants.js +1 -1
- package/dist/esm/context/ComponentContext.d.ts +2 -0
- package/dist/esm/context/TUIChatActionContext.d.ts +3 -14
- package/dist/esm/context/TUIChatStateContext.d.ts +2 -0
- package/dist/esm/context/TUIConversationContext.js +1 -1
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.d.css +257 -12
- package/dist/esm/index.js +1 -1
- package/dist/esm/locales/en/TUIChat.js +1 -1
- package/dist/esm/locales/en/TUIContact.js +1 -1
- package/dist/esm/locales/en/TUIProfile.js +1 -1
- package/dist/esm/locales/index.js +1 -1
- package/dist/esm/locales/zh_cn/TUIChat.js +1 -1
- package/dist/esm/locales/zh_cn/TUIContact.js +1 -1
- package/dist/esm/locales/zh_cn/TUIProfile.js +1 -1
- package/dist/esm/server.js +1 -0
- package/dist/esm/utils/env.js +1 -0
- package/package.json +8 -7
- package/rollup.config.js +0 -1
- package/scripts/publish-github.js +60 -0
- package/scripts/publish-intl-demo.js +14 -0
- package/scripts/publish-npm.js +22 -0
- package/src/components/Avatar/styles/index.scss +1 -0
- package/src/components/ConversationCreate/ConversationCreatGroupDetail.tsx +6 -3
- package/src/components/ConversationCreate/ConversationCreateUserSelectList.tsx +5 -1
- package/src/components/ConversationCreate/hooks/useConversationCreate.tsx +7 -2
- package/src/components/ConversationCreate/styles/conversationGroupTypeInfo.scss +1 -0
- package/src/components/ConversationCreate/styles/index.scss +2 -0
- package/src/components/ConversationPreview/ConversationPreview.tsx +2 -0
- package/src/components/ConversationPreview/ConversationPreviewContent.tsx +57 -9
- package/src/components/ConversationPreview/styles/index.scss +4 -2
- package/src/components/ConversationPreview/utils.tsx +5 -1
- package/src/components/DivWithEdit/styles/index.scss +2 -1
- package/src/components/Icon/config.ts +4 -5
- package/src/components/Icon/images/chats-selected.svg +6 -0
- package/src/components/Icon/images/chats.svg +9 -0
- package/src/components/Icon/images/contacts-selected.svg +3 -0
- package/src/components/Icon/images/contacts.svg +6 -0
- package/src/components/Icon/images/files.png +0 -0
- package/src/components/Icon/images/image.png +0 -0
- package/src/components/Icon/images/language.svg +3 -0
- package/src/components/Icon/images/video.png +0 -0
- package/src/components/Model/styles/layout.scss +1 -1
- package/src/components/Profile/styles/index.scss +4 -0
- package/src/components/TUIChat/TUIChat.tsx +74 -120
- package/src/components/TUIChat/TUIChatState.tsx +18 -45
- package/src/components/TUIChat/hooks/useHandleMessage.tsx +8 -0
- package/src/components/TUIChat/hooks/useHandleMessageList.tsx +2 -41
- package/src/components/TUIChat/unitls.ts +0 -29
- package/src/components/TUIChatHeader/TUIChatHeaderDefault.tsx +9 -2
- package/src/components/TUIContact/TUIContact.tsx +2 -1
- package/src/components/TUIContact/TUIContactInfo/TUIContactInfo.tsx +2 -1
- package/src/components/TUIContact/TUIContactInfo/basicInfo.tsx +18 -0
- package/src/components/TUIContact/TUIContactInfo/friendInfo.tsx +4 -1
- package/src/components/TUIContact/TUIContactInfo/index.scss +5 -0
- package/src/components/TUIContact/TUIContactList/TUIContactList.tsx +3 -2
- package/src/components/TUIContact/TUIContactList/index.scss +5 -0
- package/src/components/TUIContact/index.scss +5 -0
- package/src/components/TUIConversation/TUIConversation.tsx +1 -4
- package/src/components/TUIConversationList/TUIConversationList.tsx +91 -65
- package/src/components/TUIConversationList/index.scss +5 -0
- package/src/components/TUIKit/TUIKit.tsx +152 -10
- package/src/components/TUIKit/styles/h5.scss +34 -0
- package/src/components/TUIKit/styles/index.scss +103 -0
- package/src/components/TUIKit/styles/reset.scss +20 -0
- package/src/components/TUIManage/TUIManage.tsx +59 -35
- package/src/components/TUIManage/styles/index.scss +15 -1
- package/src/components/TUIMessage/MessageBubble.tsx +20 -3
- package/src/components/TUIMessage/MessageCustom.tsx +11 -2
- package/src/components/TUIMessage/MessageImage.tsx +2 -1
- package/src/components/TUIMessage/MessageName.tsx +1 -1
- package/src/components/TUIMessage/MessagePlugins.tsx +4 -2
- package/src/components/TUIMessage/MessageRevoke.tsx +2 -2
- package/src/components/TUIMessage/MessageText.tsx +25 -3
- package/src/components/TUIMessage/MessageVideo.tsx +8 -5
- package/src/components/TUIMessage/hooks/useMessageHandler.ts +13 -33
- package/src/components/TUIMessage/styles/color.scss +1 -0
- package/src/components/TUIMessage/styles/layout.scss +33 -6
- package/src/components/TUIMessage/utils/index.ts +1 -1
- package/src/components/TUIMessageInput/TUIMessageInputDefault.tsx +2 -2
- package/src/components/TUIMessageInput/hooks/useEmojiPicker.tsx +2 -6
- package/src/components/TUIMessageInput/hooks/useHandleForwardMessage.tsx +4 -3
- package/src/components/TUIMessageInput/hooks/useMessageInputText.tsx +10 -3
- package/src/components/TUIMessageInput/hooks/useUploadPicker.tsx +10 -14
- package/src/components/TUIMessageInput/styles/color.scss +1 -1
- package/src/components/TUIMessageInput/styles/layout.scss +7 -2
- package/src/components/TUIMessageList/TUIMessageList.tsx +9 -13
- package/src/components/TUIMessageList/index.ts +0 -1
- package/src/components/TUIProfile/TUIProfileDefault.tsx +65 -51
- package/src/components/TUIProfile/styles/layout.scss +6 -0
- package/src/components/untils.ts +9 -0
- package/src/constants.ts +9 -1
- package/src/context/ComponentContext.tsx +2 -0
- package/src/context/TUIChatActionContext.tsx +3 -23
- package/src/context/TUIChatStateContext.tsx +2 -0
- package/src/context/TUIKitContext.tsx +0 -1
- package/src/index.ts +3 -0
- package/src/locales/en/TUIChat.ts +2 -1
- package/src/locales/en/TUIContact.ts +1 -1
- package/src/locales/en/TUIProfile.ts +5 -4
- package/src/locales/index.ts +1 -1
- package/src/locales/zh_cn/TUIChat.ts +1 -0
- package/src/locales/zh_cn/TUIContact.ts +1 -1
- package/src/locales/zh_cn/TUIProfile.ts +1 -0
- package/src/server.ts +44 -0
- package/src/utils/env.ts +5 -0
- package/tsconfig.json +1 -0
- package/dist/cjs/components/Icon/images/create.png.js +0 -1
- package/dist/cjs/components/Icon/images/document.png.js +0 -1
- package/dist/cjs/components/TUIChat/hooks/useCreateMessage.d.ts +0 -59
- package/dist/cjs/components/TUIChat/hooks/useCreateMessage.js +0 -1
- package/dist/cjs/components/TUIChat/hooks/useMessageReceviedListener.js +0 -1
- package/dist/cjs/components/TUIMessageList/hooks/useEnrichedMessageList.js +0 -1
- package/dist/esm/components/Icon/images/create.png.js +0 -1
- package/dist/esm/components/Icon/images/document.png.js +0 -1
- package/dist/esm/components/TUIChat/hooks/useCreateMessage.d.ts +0 -59
- package/dist/esm/components/TUIChat/hooks/useCreateMessage.js +0 -1
- package/dist/esm/components/TUIChat/hooks/useMessageReceviedListener.js +0 -1
- package/dist/esm/components/TUIMessageList/hooks/useEnrichedMessageList.js +0 -1
- package/src/components/TUIChat/hooks/useCreateMessage.tsx +0 -198
- package/src/components/TUIChat/hooks/useMessageReceviedListener.tsx +0 -26
- package/src/components/TUIMessageList/hooks/useEnrichedMessageList.tsx +0 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e}from"tslib";import{useState as r,useEffect as o}from"react";import n from"@tencentcloud/chat";import{strChineseFirstPy as i}from"../static/word.js";import"react/jsx-runtime";import"react-i18next";import"../../../context/TUIMessageContext.js";import"../../Icon/config.js";import"../../Icon/type.js";import"date-fns";import"date-fns/locale";import"../ConversationCreate.js";import"../ConversationGroupTypeInfo.js";import"
|
|
1
|
+
import{__awaiter as t,__generator as e}from"tslib";import{useState as r,useEffect as o}from"react";import n from"@tencentcloud/chat";import{strChineseFirstPy as i}from"../static/word.js";import"react/jsx-runtime";import"../../TUIKit/TUIKit.js";import"react-i18next";import"../../../context/TUIMessageContext.js";import"../../../utils/env.js";import"@tencentcloud/chat-uikit-engine";import"../../Icon/config.js";import"../../Icon/type.js";import"date-fns";import"date-fns/locale";import"../ConversationCreate.js";import"../ConversationGroupTypeInfo.js";import"../../../constants.js";import"../../TUIMessage/hooks/useMessageReply.js";import"../../TUIMessage/MessagePlugins.js";import"../../TUIMessage/MessageContext.js";import"../../TUIMessageInput/hooks/useHandleQuoteMessage.js";import"../../TUIProfile/TUIProfileDefault.js";import"../../Switch/Switch.js";import{useProfile as s}from"../../../hooks/useProfile.js";var c=function(c,u,a){var f=r({}),p=f[0],l=f[1],m=function(t){var e=t.trim(),r=e.charCodeAt(0);return r>40869||r<19968?e.charAt(0):i.charAt(r-19968)},d=function(){return t(void 0,void 0,void 0,(function(){var t,r,o,i;return e(this,(function(e){switch(e.label){case 0:return u.filter((function(t){return t.type===n.TYPES.CONV_C2C})).slice(0,5).map((function(t){return t.userProfile})),[4,c.getFriendList()];case 1:return t=e.sent(),r=t.code,o=t.data,0===r&&(i=v(o.map((function(t){return t.profile}))),l(i),a&&a(i,l)),[2]}}))}))},v=function(t,e){for(var r={"#":[]},o=65;o<=90;o+=1)r[String.fromCharCode(o)]=[];return t.forEach((function(t){var e=t.nick,o=t.userID,n=m(e||o);n>="a"&&n<="z"?r[n.toLocaleUpperCase()].push(t):n<"A"||n>"z"?r["#"].push(t):r[n].push(t)})),Object.keys(r).forEach((function(t){r[t].sort((function(t,e){var r=t.nick,o=t.userID,n=e.nick,i=e.userID;return r||o<n||i||r||o===n||i?1:-1}))})),r},h=s(c).getUserProfile;return o((function(){d()}),[c]),{getFirstLetter:m,queryFriendList:d,getFriendListSortSearchResult:function(r){return t(void 0,void 0,void 0,(function(){var t,o,n,i;return e(this,(function(e){switch(e.label){case 0:return r?[4,h([r])]:[2,p];case 1:return t=e.sent().data,o={},n=!1,Object.keys(p).forEach((function(t){o[t]=p[t].filter((function(t){var e,o,i=t.nick,s=t.userID,c=i.toLocaleLowerCase(),u=r.toLocaleLowerCase(),a=s.toLocaleLowerCase();return o="TencentCloudDemo"===(null===(e=process.env)||void 0===e?void 0:e.REACT_APP_ONLINE)?c?c.includes(u):a.includes(u):a===u,n=n||o,o}))})),"TencentCloudDemo"===(null===(i=process.env)||void 0===i?void 0:i.REACT_APP_ONLINE)?[2,o]:[2,n?o:v(t)]}}))}))},friendListSortResult:p}};export{c as useConversationCreate};
|
|
@@ -25,6 +25,8 @@ interface ConversationPreviewProps {
|
|
|
25
25
|
setActiveConversation?: TUIKitContextValue['setActiveConversation'];
|
|
26
26
|
searchValue?: string;
|
|
27
27
|
conversationUpdateCount?: number;
|
|
28
|
+
activeConversationID?: string;
|
|
29
|
+
setActiveConversationID?: (conversationID: string) => void;
|
|
28
30
|
}
|
|
29
31
|
declare function ConversationPreview<T extends ConversationPreviewProps>(props: T): React.ReactElement;
|
|
30
32
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as o}from"tslib";import{jsx as t}from"react/jsx-runtime";import{useState as e,useEffect as n}from"react";import{useTUIKitContext as i}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{ConversationPreviewContent as r}from"./ConversationPreviewContent.js";import{getDisplayImage as a,getDisplayTitle as s,getDisplayMessage as v,getDisplayTime as m}from"./utils.js";function l(l){var u=l.activeConversation,c=l.conversation,p=l.Preview,C=void 0===p?r:p,d=l.searchValue,f=l.conversationUpdateCount,x=i("TUIConversation").language,I=i("ConversationPreview"),g=I.setActiveConversation,j=I.myProfile,y=e(a(c)),T=y[0],P=y[1],U=e(s(c,d)),w=U[0],A=U[1],D=e(v(c,j
|
|
1
|
+
import{__assign as o}from"tslib";import{jsx as t}from"react/jsx-runtime";import{useState as e,useEffect as n}from"react";import{useTUIKitContext as i}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{ConversationPreviewContent as r}from"./ConversationPreviewContent.js";import{getDisplayImage as a,getDisplayTitle as s,getDisplayMessage as v,getDisplayTime as m}from"./utils.js";function l(l){var u=l.activeConversation,c=l.conversation,p=l.Preview,C=void 0===p?r:p,d=l.searchValue,f=l.conversationUpdateCount,x=i("TUIConversation").language,I=i("ConversationPreview"),g=I.setActiveConversation,j=I.myProfile,y=e(a(c)),T=y[0],P=y[1],U=e(s(c,d)),w=U[0],A=U[1],D=e(v(c,j)),M=D[0],b=D[1],h=e(m(c,x)),K=h[0],V=h[1],k=e(c.unreadCount),q=k[0],z=k[1],B=(null==u?void 0:u.conversationID)===(null==c?void 0:c.conversationID);return C?(n((function(){A(s(c,d)),b(v(c,j)),P(a(c)),V(m(c,x)),z(c.unreadCount)}),[c,d,f,x]),t(C,o({},l,{active:B,displayImage:T,displayTitle:w,displayMessage:M,displayTime:K,unread:q,setActiveConversation:g}))):null}export{l as ConversationPreview};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import t,{useRef as i,useState as r}from"react";import{useTranslation as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import t,{useRef as i,useState as r,useEffect as a}from"react";import{useTranslation as c}from"react-i18next";import{TUIConversationService as s}from"@tencentcloud/chat-uikit-engine";import{isPC as l}from"../../utils/env.js";import{Avatar as m}from"../Avatar/Avatar.js";import{Icon as v}from"../Icon/Icon.js";import{IconTypes as u}from"../Icon/type.js";import{Plugins as d}from"../Plugins/index.js";import{useConversation as p}from"../../hooks/useConversation.js";import{useTUIKitContext as h}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";function f(t){var f,C=t.conversation,I=t.Avatar,N=void 0===I?m:I,T=t.displayImage,x=t.displayTitle,g=t.displayMessage,w=t.displayTime,j=t.unread,b=t.active,y=t.activeConversationID,D=t.setActiveConversationID,P=t.setActiveConversation,k=c().t,M=i(null),U=h("ConversationPreviewContent"),A=U.chat,E=U.conversation,F=p(A),z=F.pinConversation,K=F.deleteConversation,L=b?"conversation-preview-content--active":"",O=j&&j>=1?"conversation-preview-content--unread":"",R=C.isPinned?"conversation-preview-content--pin":"",S=r(!1),q=S[0],B=S[1],G=i(null);a((function(){y!==C.conversationID&&B(!1)}),[y]);var H=function(e){if(!l){var n=C.conversationID;switch(D(n),e){case"touchstart":f=setTimeout(o,500);break;case"touchend":clearTimeout(f),setTimeout((function(){}),200)}}function o(){clearTimeout(f),B(!0)}},J=function(e,n){var o=C.conversationID,t=C.isPinned;switch(e.stopPropagation(),B(!1),G.current.closeMore(),n){case"pin":z({conversationID:o,isPinned:!t});break;case"delete":K(o),C===E&&P(null)}};return n("button",e({type:"button","aria-selected":b,role:"option",className:"conversation-preview-container ".concat(L," ").concat(O," ").concat(R),onClick:function(){s.switchConversation(null==C?void 0:C.conversationID),P&&P(C),(null==M?void 0:M.current)&&M.current.blur()},onMouseEnter:function(){B(!0)},onMouseLeave:function(){B(!1)},onTouchStart:function(){return H("touchstart")},onTouchEnd:function(){return H("touchend")},ref:M},{children:[o("div",e({className:"avatar"},{children:o(N,{image:T,name:x,size:40})})),n("div",e({className:"content"},{children:[o("div",e({className:"title text-ellipsis"},{children:x})),o("div",e({className:"message"},{children:g}))]})),n("div",e({className:"external"},{children:[o("div",j?e({className:"unread"},{children:j<=99?j:"99+"}):{className:"unread"}),o("div",q?e({className:"".concat(q?"more--hover":"more")},{children:o(d,{customClass:"more-handle-box",ref:G,plugins:[o("div",e({role:"presentation",className:"more-handle-item",onClick:function(e){J(e,"pin")}},{children:k(C.isPinned?"TUIConversation.Unpin":"TUIConversation.Pin")})),o("div",e({className:"more-handle-item",style:{color:"#FF584C"},onClick:function(e){J(e,"delete")},role:"presentation"},{children:k("TUIConversation.Delete")}))],showNumber:0,MoreIcon:o(v,{className:"icon-more",width:16,height:16,type:u.MORE})})}):e({className:"time"},{children:w}))]}))]}))}var C=t.memo(f);export{C as ConversationPreviewContent,f as unMemoConversationPreviewContent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as r,jsx as a}from"react/jsx-runtime";import
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as r,jsx as a}from"react/jsx-runtime";import o from"@tencentcloud/chat";import"react";import"../Icon/config.js";import"../Icon/type.js";import{defaultGroupAvatarWork as t,defaultUserAvatar as i}from"../Avatar/default.js";import{formatEmojiString as s}from"../TUIMessage/utils/emojiMap.js";import{getTimeStamp as c}from"../untils.js";var n=function(t,i,s){void 0===s&&(s="#147AFF");var c=u(t),n=c.name,l=c.nick,p=c.groupID,d=c.userID,m=t.type,f=t.remark,v="";switch(m){case o.TYPES.CONV_C2C:v=f||l||d;break;case o.TYPES.CONV_GROUP:v=n||p;break;default:v=""}var C,h;return i?(h=(C=v).toLocaleLowerCase().indexOf(i.toLocaleLowerCase()),r("div",{children:[a("span",{children:C.slice(0,h)}),a("span",e({style:{color:s}},{children:C.slice(h,h+i.length)})),a("span",{children:C.slice(h+i.length)})]})):v},l=function(e){var r=e.type,a=u(e).avatar,s=a;if(!a)switch(r){case o.TYPES.CONV_C2C:s=i;break;case o.TYPES.CONV_GROUP:default:s=t}return s},p=function(t,i,c){var n,l=t.lastMessage,p=t.type,u=l.fromAccount,d=l.nick,m=l.nameCard,f=l.isRevoked,v=l.messageForShow;l.type===o.TYPES.MSG_CUSTOM&&(null===(n=l.payload)||void 0===n?void 0:n.description)&&(v=l.payload.description);var C="";switch(p){case o.TYPES.CONV_GROUP:C=(null==l?void 0:l.fromAccount)===(null==i?void 0:i.userID)?"You":"".concat(m||d||u||""),C="".concat(C?"".concat(C,":"):"");break;case o.TYPES.CONV_C2C:C=f?"you ":""}return r("div",e({style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:[a("span",{children:C}),a("span",{children:l.isRevoked?"recalled a message":s(v,1)})]}))},u=function(e){if(!e)return null;var r={},a=e.type,t=e.groupProfile,i=e.userProfile;switch(a){case o.TYPES.CONV_C2C:r=i;break;case o.TYPES.CONV_GROUP:r=t;case o.TYPES.CONV_SYSTEM:}return r},d=function(e,r){var a=e.lastMessage;return c(1e3*a.lastTime,r)};export{l as getDisplayImage,p as getDisplayMessage,d as getDisplayTime,n as getDisplayTitle,u as getMessageProfile};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import{ConversationPreview as s}from"../ConversationPreview/ConversationPreview.js";import"react";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import"../../utils/env.js";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as i}from"../Icon/type.js";import"@tencentcloud/chat";import"../TUIKit/TUIKit.js";import"../../context/TUIMessageContext.js";import"../ConversationCreate/ConversationCreate.js";import"../ConversationCreate/ConversationGroupTypeInfo.js";import"date-fns";import"date-fns/locale";import"../../constants.js";import"../TUIMessage/hooks/useMessageReply.js";import"../TUIMessage/MessagePlugins.js";import"../TUIMessage/MessageContext.js";import"../TUIMessageInput/hooks/useHandleQuoteMessage.js";import"../TUIProfile/TUIProfileDefault.js";import"../Switch/Switch.js";function n(n){var a=n.result,c=n.searchValue,m=n.Preview;return t("div",{children:0===(null==a?void 0:a.length)?o("div",e({className:"conversation-search-result no-result"},{children:[t(r,{className:"no-result-icon",type:i.CRY,width:42,height:42}),t("span",e({className:"no-result-message"},{children:'No results for "'.concat(c,'"')}))]})):a.map((function(o){return t(s,e({searchValue:c},{conversation:o,Preview:m}),o.conversationID)}))})}export{n as ConversationSearchResult};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import i from"./images/more.png.js";import
|
|
1
|
+
import i from"./images/more.png.js";import s from"./images/clear.png.js";import m from"./images/search.png.js";import r from"./images/back.png.js";import o from"./images/emoji.png.js";import a from"./images/progress.png.js";import e from"./images/file.png.js";import t from"./images/add.png.js";import n from"./images/image.png.js";import c from"./images/video.png.js";import l from"./images/files.png.js";import u from"./images/star.png.js";import g from"./images/copy.png.js";import p from"./images/del.png.js";import N from"./images/forward.png.js";import f from"./images/reply.png.js";import k from"./images/close.png.js";import j from"./images/arrow-right.png.js";import E from"./images/right.png.js";import d from"./images/ellipse.png.js";import R from"./images/cancel.png.js";import O from"./images/arrow-down.png.js";import I from"./images/edit.png.js";import C from"./images/confirm.png.js";import A from"./images/camera.png.js";import v from"./images/quote.png.js";import D from"./images/revocation.png.js";import L from"./images/effort.png.js";import T from"./images/cry.png.js";import w from"./images/send.png.js";import M from"./images/owner.png.js";import U from"./images/living.png.js";import y from"./images/member.png.js";import S from"./images/like.png.js";import h from"./images/unlike.png.js";import F from"./images/liked.png.js";import V from"./images/unliked.png.js";import G from"./images/union.png.js";import K from"./images/ununion.png.js";import W from"./images/vector.png.js";import b from"./images/unvector.png.js";import P from"./images/voice.png.js";import H from"./images/add-friend.svg.js";import{IconTypes as Y}from"./type.js";var q,B=((q={})[Y.MORE]={url:i,className:"tui-kit-icon-more"},q[Y.CREATE]={url:H,className:"tui-kit-icon-create"},q[Y.CLEAR]={url:s,className:"tui-kit-icon-clear"},q[Y.SEARCH]={url:m,className:"tui-kit-icon-search"},q[Y.BACK]={url:r,className:"tui-kit-icon-back"},q[Y.EMOJI]={url:o,className:"tui-kit-icon-emoji"},q[Y.PROGRESS]={url:a,className:"tui-kit-icon-progress"},q[Y.FILE]={url:e,className:"tui-kit-icon-file"},q[Y.ADD]={url:t,className:"tui-kit-icon-add"},q[Y.IMAGE]={url:n,className:"tui-kit-icon-image"},q[Y.VIDEO]={url:c,className:"tui-kit-icon-video"},q[Y.DOCUMENT]={url:l,className:"tui-kit-icon-document"},q[Y.STAR]={url:u,className:"tui-kit-icon-star"},q[Y.COPY]={url:g,className:"tui-kit-icon-copy"},q[Y.DEL]={url:p,className:"tui-kit-icon-del"},q[Y.FORWARD]={url:N,className:"tui-kit-icon-forward"},q[Y.REPLY]={url:f,className:"tui-kit-icon-reply"},q[Y.CLOSE]={url:k,className:"tui-kit-icon-close"},q[Y.ARROW_RIGHT]={url:j,className:"tui-kit-icon-arrow-right"},q[Y.RIGHT]={url:E,className:"tui-kit-icon-right"},q[Y.ELLIPSE]={url:d,className:"tui-kit-icon-ellipse"},q[Y.CANCEL]={url:R,className:"tui-kit-icon-cancel"},q[Y.ARROW_DOWN]={url:O,className:"tui-kit-icon-arrow-down"},q[Y.EDIT]={url:I,className:"tui-kit-icon-edit"},q[Y.CONFIRM]={url:C,className:"tui-kit-icon-confirm"},q[Y.CAMERA]={url:A,className:"tui-kit-icon-camera"},q[Y.QUOTE]={url:v,className:"tui-kit-icon-quote"},q[Y.REVOCATION]={url:D,className:"tui-kit-icon-revocation"},q[Y.EFFORT]={url:L,className:"tui-kit-icon-effort"},q[Y.CRY]={url:T,className:"tui-kit-icon-cry"},q[Y.OWNER]={url:M,className:"tui-kit-icon-owner"},q[Y.SEND]={url:w,className:"tui-kit-icon-send"},q[Y.LIVING]={url:U,className:"tui-kit-icon-living"},q[Y.MEMBER]={url:y,className:"tui-kit-icon-member"},q[Y.LIKE]={url:S,className:"tui-kit-icon-like"},q[Y.UNLIKE]={url:h,className:"tui-kit-icon-unlike"},q[Y.LIKED]={url:F,className:"tui-kit-icon-liked"},q[Y.UNLIKED]={url:V,className:"tui-kit-icon-unliked"},q[Y.UNION]={url:G,className:"tui-kit-icon-union"},q[Y.UNUNION]={url:K,className:"tui-kit-icon-ununion"},q[Y.VECTOR]={url:W,className:"tui-kit-icon-vector"},q[Y.UNVECTOR]={url:b,className:"tui-kit-icon-unvector"},q[Y.VOICE]={url:P,className:"tui-kit-icon-voice"},q[Y.ADDFRIEND]={url:H,className:"tui-kit-icon-add-friend"},q);export{B as ICON_CONFIG};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var l="data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M19.6893%2018.3914C21.131%2016.6584%2021.998%2014.4305%2021.998%2012.0001C21.998%206.47721%2017.5209%202.00006%2011.998%202.00006C6.4752%202.00006%201.99805%206.47721%201.99805%2012.0001C1.99805%2017.5229%206.4752%2022.0001%2011.998%2022.0001C14.1036%2022.0001%2016.0571%2021.3493%2017.6686%2020.238C17.6858%2020.2471%2017.7041%2020.2552%2017.7233%2020.262L19.9382%2021.0464C20.2554%2021.1587%2020.5611%2020.853%2020.4488%2020.5358L19.6893%2018.3914Z%22%20fill%3D%22%23147AFF%22%20style%3D%22fill%3A%23147AFF%3Bfill%3Acolor%28display-p3%200.0784%200.4784%201.0000%29%3Bfill-opacity%3A1%3B%22%2F%3E%3Ccircle%20cx%3D%227.00195%22%20cy%3D%2212%22%20r%3D%221.4%22%20fill%3D%22white%22%20stroke%3D%22%23979797%22%20style%3D%22fill%3Awhite%3Bfill%3Awhite%3Bfill-opacity%3A1%3Bstroke%3A%23979797%3Bstroke%3Acolor%28display-p3%200.5922%200.5922%200.5922%29%3Bstroke-opacity%3A1%3B%22%20stroke-width%3D%220.2%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%221.4%22%20fill%3D%22white%22%20stroke%3D%22%23979797%22%20style%3D%22fill%3Awhite%3Bfill%3Awhite%3Bfill-opacity%3A1%3Bstroke%3A%23979797%3Bstroke%3Acolor%28display-p3%200.5922%200.5922%200.5922%29%3Bstroke-opacity%3A1%3B%22%20stroke-width%3D%220.2%22%2F%3E%3Ccircle%20cx%3D%2216.998%22%20cy%3D%2212%22%20r%3D%221.4%22%20fill%3D%22white%22%20stroke%3D%22%23979797%22%20style%3D%22fill%3Awhite%3Bfill%3Awhite%3Bfill-opacity%3A1%3Bstroke%3A%23979797%3Bstroke%3Acolor%28display-p3%200.5922%200.5922%200.5922%29%3Bstroke-opacity%3A1%3B%22%20stroke-width%3D%220.2%22%2F%3E%3C%2Fsvg%3E";export{l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var l="data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cmask%20id%3D%22path-1-inside-1_91_53001%22%20fill%3D%22white%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M19.6894%2018.3919C21.131%2016.659%2021.998%2014.4311%2021.998%2012.0007C21.998%206.47788%2017.5209%202.00073%2011.998%202.00073C6.4752%202.00073%201.99805%206.47788%201.99805%2012.0007C1.99805%2017.5236%206.4752%2022.0007%2011.998%2022.0007C14.1037%2022.0007%2016.0574%2021.3499%2017.6689%2020.2385C17.6861%2020.2475%2017.7042%2020.2555%2017.7233%2020.2623L19.9382%2021.0467C20.2554%2021.159%2020.5611%2020.8533%2020.4488%2020.5361L19.6894%2018.3919Z%22%2F%3E%3C%2Fmask%3E%3Cpath%20d%3D%22M19.6894%2018.3919L18.9207%2017.7524L18.5569%2018.1897L18.7468%2018.7258L19.6894%2018.3919ZM17.6689%2020.2385L18.1349%2019.3537L17.5993%2019.0716L17.1011%2019.4153L17.6689%2020.2385ZM17.7233%2020.2623L18.0571%2019.3196L18.0571%2019.3196L17.7233%2020.2623ZM19.9382%2021.0467L20.272%2020.104H20.272L19.9382%2021.0467ZM20.4488%2020.5361L19.5062%2020.8699V20.8699L20.4488%2020.5361ZM20.998%2012.0007C20.998%2014.1889%2020.2184%2016.1924%2018.9207%2017.7524L20.4582%2019.0315C22.0437%2017.1256%2022.998%2014.6733%2022.998%2012.0007H20.998ZM11.998%203.00073C16.9686%203.00073%2020.998%207.03017%2020.998%2012.0007H22.998C22.998%205.9256%2018.0732%201.00073%2011.998%201.00073V3.00073ZM2.99805%2012.0007C2.99805%207.03017%207.02748%203.00073%2011.998%203.00073V1.00073C5.92291%201.00073%200.998047%205.9256%200.998047%2012.0007H2.99805ZM11.998%2021.0007C7.02748%2021.0007%202.99805%2016.9713%202.99805%2012.0007H0.998047C0.998047%2018.0759%205.92291%2023.0007%2011.998%2023.0007V21.0007ZM17.1011%2019.4153C15.6512%2020.4153%2013.8945%2021.0007%2011.998%2021.0007V23.0007C14.3129%2023.0007%2016.4635%2022.2846%2018.2366%2021.0617L17.1011%2019.4153ZM18.0571%2019.3196C18.0834%2019.3289%2018.1094%2019.3403%2018.1349%2019.3537L17.2028%2021.1233C17.2627%2021.1548%2017.325%2021.1821%2017.3895%2021.2049L18.0571%2019.3196ZM20.272%2020.104L18.0571%2019.3196L17.3895%2021.2049L19.6044%2021.9893L20.272%2020.104ZM19.5062%2020.8699C19.3376%2020.3941%2019.7962%2019.9355%2020.272%2020.104L19.6044%2021.9893C20.7146%2022.3825%2021.7846%2021.3125%2021.3914%2020.2023L19.5062%2020.8699ZM18.7468%2018.7258L19.5062%2020.8699L21.3914%2020.2023L20.6321%2018.0581L18.7468%2018.7258Z%22%20fill%3D%22%23666666%22%20style%3D%22fill%3A%23666666%3Bfill%3Acolor%28display-p3%200.4000%200.4000%200.4000%29%3Bfill-opacity%3A1%3B%22%20mask%3D%22url%28%23path-1-inside-1_91_53001%29%22%2F%3E%3Ccircle%20cx%3D%227.00195%22%20cy%3D%2212.0007%22%20r%3D%221.4%22%20fill%3D%22%23666666%22%20stroke%3D%22%23979797%22%20style%3D%22fill%3A%23666666%3Bfill%3Acolor%28display-p3%200.4000%200.4000%200.4000%29%3Bfill-opacity%3A1%3Bstroke%3A%23979797%3Bstroke%3Acolor%28display-p3%200.5922%200.5922%200.5922%29%3Bstroke-opacity%3A1%3B%22%20stroke-width%3D%220.2%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212.0007%22%20r%3D%221.4%22%20fill%3D%22%23666666%22%20stroke%3D%22%23979797%22%20style%3D%22fill%3A%23666666%3Bfill%3Acolor%28display-p3%200.4000%200.4000%200.4000%29%3Bfill-opacity%3A1%3Bstroke%3A%23979797%3Bstroke%3Acolor%28display-p3%200.5922%200.5922%200.5922%29%3Bstroke-opacity%3A1%3B%22%20stroke-width%3D%220.2%22%2F%3E%3Ccircle%20cx%3D%2216.998%22%20cy%3D%2212.0007%22%20r%3D%221.4%22%20fill%3D%22%23666666%22%20stroke%3D%22%23979797%22%20style%3D%22fill%3A%23666666%3Bfill%3Acolor%28display-p3%200.4000%200.4000%200.4000%29%3Bfill-opacity%3A1%3Bstroke%3A%23979797%3Bstroke%3Acolor%28display-p3%200.5922%200.5922%200.5922%29%3Bstroke-opacity%3A1%3B%22%20stroke-width%3D%220.2%22%2F%3E%3C%2Fsvg%3E";export{l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var l="data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5.60156%209.00028C5.60156%2012.5349%208.46692%2015.4003%2012.0016%2015.4003C15.5362%2015.4003%2018.4016%2012.5349%2018.4016%209.00028C18.4016%205.46564%2015.5362%202.60028%2012.0016%202.60028C8.46692%202.60028%205.60156%205.46564%205.60156%209.00028ZM5.20078%2016.4003C3.8753%2016.4003%202.80078%2017.4748%202.80078%2018.8003C2.80078%2020.1257%203.87529%2021.2003%205.20078%2021.2003H18.8008C20.1263%2021.2003%2021.2008%2020.1257%2021.2008%2018.8003C21.2008%2017.4748%2020.1263%2016.4003%2018.8008%2016.4003H5.20078Z%22%20fill%3D%22%23147AFF%22%20style%3D%22fill%3A%23147AFF%3Bfill%3Acolor%28display-p3%200.0784%200.4784%201.0000%29%3Bfill-opacity%3A1%3B%22%2F%3E%3C%2Fsvg%3E";export{l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var C="data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cmask%20id%3D%22path-1-inside-1_251_63695%22%20fill%3D%22white%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5.60156%208.99998C5.60156%2012.5346%208.46692%2015.4%2012.0016%2015.4C15.5362%2015.4%2018.4016%2012.5346%2018.4016%208.99998C18.4016%205.46534%2015.5362%202.59998%2012.0016%202.59998C8.46692%202.59998%205.60156%205.46534%205.60156%208.99998ZM5.20078%2016.3999C3.8753%2016.3999%202.80078%2017.4745%202.80078%2018.7999C2.80078%2020.1254%203.87529%2021.1999%205.20078%2021.1999H18.8008C20.1263%2021.1999%2021.2008%2020.1254%2021.2008%2018.7999C21.2008%2017.4745%2020.1263%2016.3999%2018.8008%2016.3999H5.20078Z%22%2F%3E%3C%2Fmask%3E%3Cpath%20d%3D%22M12.0016%2014.4C9.01921%2014.4%206.60156%2011.9823%206.60156%208.99998H4.60156C4.60156%2013.0869%207.91464%2016.4%2012.0016%2016.4V14.4ZM17.4016%208.99998C17.4016%2011.9823%2014.9839%2014.4%2012.0016%2014.4V16.4C16.0885%2016.4%2019.4016%2013.0869%2019.4016%208.99998H17.4016ZM12.0016%203.59998C14.9839%203.59998%2017.4016%206.01762%2017.4016%208.99998H19.4016C19.4016%204.91305%2016.0885%201.59998%2012.0016%201.59998V3.59998ZM6.60156%208.99998C6.60156%206.01762%209.01921%203.59998%2012.0016%203.59998V1.59998C7.91464%201.59998%204.60156%204.91305%204.60156%208.99998H6.60156ZM3.80078%2018.7999C3.80078%2018.0267%204.42758%2017.3999%205.20078%2017.3999V15.3999C3.32301%2015.3999%201.80078%2016.9222%201.80078%2018.7999H3.80078ZM5.20078%2020.1999C4.42758%2020.1999%203.80078%2019.5731%203.80078%2018.7999H1.80078C1.80078%2020.6777%203.32301%2022.1999%205.20078%2022.1999V20.1999ZM18.8008%2020.1999H5.20078V22.1999H18.8008V20.1999ZM20.2008%2018.7999C20.2008%2019.5731%2019.574%2020.1999%2018.8008%2020.1999V22.1999C20.6785%2022.1999%2022.2008%2020.6777%2022.2008%2018.7999H20.2008ZM18.8008%2017.3999C19.574%2017.3999%2020.2008%2018.0267%2020.2008%2018.7999H22.2008C22.2008%2016.9222%2020.6786%2015.3999%2018.8008%2015.3999V17.3999ZM5.20078%2017.3999H18.8008V15.3999H5.20078V17.3999Z%22%20fill%3D%22%23666666%22%20style%3D%22fill%3A%23666666%3Bfill%3Acolor%28display-p3%200.4000%200.4000%200.4000%29%3Bfill-opacity%3A1%3B%22%20mask%3D%22url%28%23path-1-inside-1_251_63695%29%22%2F%3E%3C%2Fsvg%3E";export{C as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var A="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAqCAYAAAD1T9h6AAAAAXNSR0IArs4c6QAAA0BJREFUaEPtWd9LU3EUP+d7N91QFkJolBDoLOdM0GnzwYcV9CAZPVRCCZkP9WRQVPQSNaL/oKJfDxH0kPUQCRbRg4uwNJmC6fLXgsDCDBKWsul2vyfuxpW7MnR332sad0/b937P55zP55z7/XB3ETSfykpvUYwSJ4BDPQAWEXGr9vpK3xFRRoBRkFjnts15nYFAILFSTLbXUQUod9cdSHA6R8TzsgVV4hHZF4Zw51hz00u/389FYC6HkSSgFB+X5ctGJEFkYbDgrckP/a8NwU+OjSx3qMozhmMA1uvWQttIKBCYyySpz+ezff0+10wExznnm7SxKVx8wwCmM8FU9hLAogVg2m6vGQ4G78a18eh0ey6STIeVRSWJw+5p+31TpgkrfL78+MxcCwC1cE72TOP/tp8hm0cGt8eG+zsQkZKj6nR5nhJRcYpATvtEqLdPVMJdDQ0F0R/RNiA8RMRzROEyxgYKC7ae7+np/IlOV+1b9bTJ3eLYk+nYrKYor7fRMRuZ2csRSpBAxyGB+RzIDURFaj6J4fPxUPAKlpbX9KuL4dGButUU9C/2+P1+9vBx11Hi8hkNibMbhoBadJmr9gIn3pz8LWFPGgG7xdqUjZEZ1RlEFgegb8Cgl1FOt8wXbqa8BmfTCCCyeVFGZiCZtBrTCBiV1EjcPwhkY2RGFZrylZgbIH6ac9qZZmTaU0iUkRlFxOM5ZY1Eg/e1JNI6INrIjCBSVlHv5XzxhoqdRsAoIxNJRBmnhelI97IE1rORaUXQjv2GMzKFiElA5EzrwTI7oEc1kTFmB0SqqQfL7IAe1UTGmB0QqaYeLLMDelQTGWN2QKSaerDMDuhRTWTM/9sByEnsDw8NzYhUSzRWaVVVISxaupaeiZ0uzzsisigLkmS5MT7y/oHopCLxdrh3t8pyol3BRMSE8vf6IyJemlxguBCLlOybmnoSFZlUFFZx8RG7zfHpFXHKTRFgYXRWeysoGl9SXSHBULonS7EX62WclLGRZFsjJ/mkWnySgN3amnzJV+aqvsQJD4pSai1wGNKziY+D15Zes24kEmrxyS5o1VLGCWLK61bart7Ya6HmanIoNywAfgabdHVysC+kxvwC0SKlujS63bMAAAAASUVORK5CYII=";export{A as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var A="data:image/png;base64,
|
|
1
|
+
var A="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAqCAYAAAD1T9h6AAAAAXNSR0IArs4c6QAABLlJREFUaEPlmVtsFFUYx893ZpfeaRNjK7ZJLexuu7NFSmeXNgG1Gn0ooQajpdjiBR9MJFxsvRSxbVb0xRiFUKOJLxrBW5aERIhGCbItUMDtFKTt2psiRiNYH7iVXnbn+8xsO9tl09JtdyuzcV5mds+Zc37/7zYz5wALOQoLS7JGyP8sQ1bKGGQRoTG0/XZdA3AfY3SJcXYqEQyfdHWdvqSxgHZRYHNU+JFeIsKU2wUaybwAfMjA4d2ebs9BtX9AgArvU5SmSAbQSx+jIOxURUAgbBTlK83ynEMvY8ZmY2Zit9ftvq4HYLGsLNX394iNMd8WRMoPWB74UKIgVIHJJtWTQk+of6rwC5OkjbL8kU8P4OEMkvS88eqw/HFQhAD7wWSVDhBRzriABZv7vadO6xFeYzKLpSWIY++PewH+AJPV3qZVm4S7Fj6ol7CZzohqOI1evHp0Iox8sKSg2KN1/qWnw6Fn62tsocz/TwGVlZXCT94LNYj+RwAgl4gucG44vEzM/czlcinz7cWoPKDCn+08/wEyLA4H5Yx3FC3N2zTfIqISYLGteFpR/Fums7IgGJr7un/8dD69EJUAk7V4LxErCFQBzj9MT1r05ZXhv9YT4gvjlYH1DPzc8ZRuBZhFqRWRklTAjJTsB2T54A1Jqki+PPRny8TDcLjfK9+vWwFx74G4z4H/ogoREeTb7CsBgHq6PG3qOTQko0pidaD5fA6o8BbR3oBEj6pzCRxq+7zy8ZgKmK8EHYd37EDCtdocBoG/2NvdfkL3AlR4s016jZA9psFygK/7vO1vxTyEYu2BcXh7PSE9ro0NjB/asH7Nm06nE8PnizoHYi0g9KNqIu6/qV5X8cZU8Gq7rgSYbfZXUcHKkLD5tqaqwjkdvK4ELBEdLzNUqibh+Xc1VWuabgWvGwEmcUUdof/JYMxz/v1yW15TJG+yMQshkyhVAmOrgbHf05JYsyzL/0SSHyabvZYUrNb6ChwOL7MtbowEPiYeUFcHrg3LDQrS6qAFAS4KxpStvedaz99KhNnq2IakbJgMG+FIdlZKg9vt9kciPmoBRUVlGddHh94hUorCJwQO1xYwXuf1es5OBWMWpa2IFHzV5sB/yM5KfX028FEJKCgqvcc/6t9NhNlBC3JwM8ZKtFdsAD7GjdDUd85zJFSERbRvVhCfmbyPH83OTN0xW/g5C7DYHA4kfJuQ0iYgCAzCnoEuzz7LUqkAFbabkO7Q2rjAd/V3t3+h/rZYHZsUUjZOJiy05GSmbZ8L/JwEWKzSWmRsOxEJ6gCcwwgJvGGg0xP4iFGP/OUr71ZGR/cQYm4QVOCfM6QRInouBL41JzOtfq7wsxYQnnQAbJAboK6vU+4Jj3NJejj9yo3L7xHhvVPlAAA7lp5sr4926TLiMmoRpVUK0q6QeO9NTUiuPXPm2OB0FaO8vDxh4LfBnUj40E19BDiRkSi9Ei38rDwQKgA4tNyZvrjx5EnX8Ezlzul08n2uQ9u0Wq9WG2NhXqPX5Rqb6d5I2iP2QCABRWmVeq5eV9E20yM+fHKr9b5FfgMl9Xce/zUSsEj73CQg7hd34395Pd43OOJ+i0lNnLje5NMyP663WTUR8bjR/S+/EAdi6i5GNAAAAABJRU5ErkJggg==";export{A as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var A="data:image/png;base64,
|
|
1
|
+
var A="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAqCAYAAAD1T9h6AAAAAXNSR0IArs4c6QAAAqlJREFUaEPtmUFoE0EUhufNNBpRWi9tPAhWm9RmU7S6Dekxolc1gqDgxV48tHoS7E0WwWPwoCcp1KAWC0KlHnI0WJGGsj1Ik9ZUbxWsB8HQ0nQ3mSebZsMaKrRmN9mR5LRkZ2f/771/3j5mgFh+/f0RXwGLNwknQ4SAD5F7rPebdQ1AdUJwjVAy54W2Z4uL6TVTC5gXfaHwxSLHu4j8YLOE7ua9AHSjjUJ8OTP/1hhfBjDE66XS/d1M4JYxHsYeGBBQtk2pNGVGnlL4TIjnsafLm8mmUutuECxFo4f0H4UQIfodzvFkOfJAN7yMXQN/SB7DEl41/jTEtx+Qh1X1qe4G4bUaZPmWJ7+pTlQhGLwGf1CeRsSj2wD7bq9k59JuFG9qCkhDEc61J9tZgFXwBwc/mtVm/5H2c26xzd+CaNhp63v+XcVGOvT0nZ03B39dXgi7OfqmNqvmFkAzMtbKQDOibn1nKwM7ZaA3KMc4IVcYgfcnujtfJJPJLacy5UgGApI8yzl6K/X5GwUez2UXZp2AcATAOmm11WX0A2Es/uVTetVOkIYBVLKhAfKE/7gvYZetHAcASqaRk5jZrtttK8cBjJZEOh0OaRq/h4iS1T5gg60aAmCIVhSFvnw1EyOUjnDOO6prA6hGCU7kltTxf1kbDQMwxQ0MRA+va/mRWlsxgIe5JfXNXiEaDiDLFzp+bf4crQWgDB6tZNRJ1wIYFpqcmrmMQEdrLWRUphvXL40risJdCRA6E5G2CsUxIRex8GX0j7IJVAMgCf+xTnE+ZEK2EoHgYIpXdvUAqHjNXO+p8Hks8mFAkurp7npuV9+zU4Vy5Duw11JYz/gWQD3Rs+PZVgbsiGI9c/xfGRB+c1f87XXRDziEP2IyqoHQh3xmORP6mNWEEPGg+zdk8RZTNE1sngAAAABJRU5ErkJggg==";export{A as default};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { Conversation, Message } from '@tencentcloud/chat';
|
|
3
|
+
import { IMessageModel } from '@tencentcloud/chat-uikit-engine';
|
|
3
4
|
import { UnknowPorps } from '../../context/ComponentContext.js';
|
|
4
5
|
import { TUIChatHeaderDefaultProps } from '../TUIChatHeader/TUIChatHeaderDefault.js';
|
|
5
6
|
import { TUIMessageProps } from '../TUIMessage/TUIMessage.js';
|
|
@@ -18,9 +19,13 @@ interface TUIChatProps {
|
|
|
18
19
|
InputPlugins?: React.ComponentType<UnknowPorps>;
|
|
19
20
|
InputQuote?: React.ComponentType<UnknowPorps>;
|
|
20
21
|
MessagePlugins?: React.ComponentType<UnknowPorps>;
|
|
22
|
+
MessageCustomPlugins?: React.ComponentType<UnknowPorps>;
|
|
23
|
+
MessageTextPlugins?: React.ComponentType<UnknowPorps>;
|
|
21
24
|
onMessageRecevied?: (updateMessage: (event?: Array<Message>) => void, event: any) => void;
|
|
22
25
|
sendMessage?: (message: Message, options?: any) => Promise<Message>;
|
|
23
26
|
revokeMessage?: (message: Message) => Promise<Message>;
|
|
27
|
+
selectedConversation?: (conversation: Conversation) => Promise<Conversation>;
|
|
28
|
+
filterMessage?: (messageList: Array<IMessageModel>) => Array<IMessageModel>;
|
|
24
29
|
messageConfig?: TUIMessageProps;
|
|
25
30
|
cloudCustomData?: string;
|
|
26
31
|
TUIMessageInputConfig?: TUIMessageInputBasicProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as t,__generator as s}from"tslib";import
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as s}from"tslib";import o,{createElement as a,useReducer as n,useRef as i,useEffect as r,useMemo as u}from"react";import{jsx as c,jsxs as g,Fragment as m}from"react/jsx-runtime";import{TUIStore as p,StoreName as d,TUIChatService as l}from"@tencentcloud/chat-uikit-engine";import{JSONStringToParse as M}from"../untils.js";import{useTUIKitContext as I}from"../../context/TUIKitContext.js";import{TUIChatStateContextProvider as f}from"../../context/TUIChatStateContext.js";import{TUIChatActionProvider as h}from"../../context/TUIChatActionContext.js";import{ComponentProvider as v}from"../../context/ComponentContext.js";import T from"./hooks/useCreateTUIChatStateContext.js";import{TUIMessage as C}from"../TUIMessage/TUIMessage.js";import"../TUIMessage/MessagePlugins.js";import"../TUIMessage/MessageContext.js";import{CONSTANT_DISPATCH_TYPE as U}from"../../constants.js";import{chatReducer as j,initialState as S}from"./TUIChatState.js";import{useHandleMessageList as x}from"./hooks/useHandleMessageList.js";import{useHandleMessage as L}from"./hooks/useHandleMessage.js";import{TUIChatHeader as E}from"../TUIChatHeader/TUIChatHeader.js";import"@tencentcloud/chat";import"../Icon/config.js";import"../Icon/type.js";import"../../utils/env.js";import"../../context/TUIMessageContext.js";import{TUIMessageList as P}from"../TUIMessageList/TUIMessageList.js";import{TUIMessageInput as y}from"../TUIMessageInput/TUIMessageInput.js";import"react-i18next";import{EmptyStateIndicator as H}from"../EmptyStateIndicator/EmptyStateIndicator.js";function A(t){var s=t.conversation,o=t.EmptyPlaceholder,n=void 0===o?c(H,{listType:"chat"}):o,i=I("TUIChat"),r=i.conversation,u=i.chat,g=s||r;return(null==g?void 0:g.conversationID)?a(D,e({chat:u},t,{conversation:g,key:g.conversationID})):n}function D(o){var a=this,I=o.chat,H=o.conversation,A=o.className,D=o.children,k=o.TUIMessage,_=o.TUIChatHeader,R=o.TUIMessageInput,N=o.InputPlugins,w=o.MessagePlugins,F=o.MessageContext,G=o.MessageCustomPlugins,O=o.MessageTextPlugins,Q=o.InputQuote;o.onMessageRecevied,o.sendMessage;var V=o.revokeMessage;o.selectedConversation;var b=o.filterMessage,K=o.messageConfig,q=o.cloudCustomData,z=o.TUIMessageInputConfig,B=o.TUIMessageListConfig,J=n(j,e(e({},S),{conversation:H})),W=J[0],X=J[1],Y=i(null),Z=i(),$=T(e({chat:I,conversation:H,messageListRef:Y,textareaRef:Z,messageConfig:K,cloudCustomData:q,TUIMessageInputConfig:z,TUIMessageListConfig:B},W)),ee=x({chat:I,conversation:H,state:W,dispatch:X,filterMessage:b}),te=ee.editLocalMessage,se=ee.updateUploadPendingMessageList,oe=L({state:W,dispatch:X}),ae=oe.operateMessage,ne=oe.setAudioSource,ie=oe.setVideoSource,re=oe.setHighlightedMessageId,ue=oe.setActiveMessageID;r((function(){return p.watch(d.CHAT,{messageList:ce,isCompleted:ge}),function(){p.unwatch(d.CHAT,{messageList:ce,isCompleted:ge})}}),[]);var ce=function(e){var t=e.filter((function(e){return!e.isDeleted}));X({type:U.SET_MESSAGELIST,value:b?b(t):t})},ge=function(e){e&&X({type:U.SET_NO_MORE,value:e})},me=function(){return t(a,void 0,void 0,(function(){return s(this,(function(e){return l.getMessageList(),[2]}))}))},pe=function(e){return t(a,void 0,void 0,(function(){var t;return s(this,(function(s){return"TIMCustomElem"===e.type&&7===(null===(t=M(e.payload.data))||void 0===t?void 0:t.src)||W.firstSendMessage||X({type:U.SET_FIRST_SEND_MESSAGE,value:e}),[2]}))}))},de=u((function(){return{editLocalMessage:te,operateMessage:ae,loadMore:me,revokeMessage:V,setAudioSource:ne,setVideoSource:ie,setHighlightedMessageId:re,setActiveMessageID:ue,updateUploadPendingMessageList:se,setFirstSendMessage:pe}}),[te,ae,me,V,ne,ie,re,ue,se,pe]),le=u((function(){return{TUIMessage:k||C,MessageContext:F,InputPlugins:N,MessagePlugins:w,MessageCustomPlugins:G,MessageTextPlugins:O,TUIChatHeader:_,TUIMessageInput:R,InputQuote:Q}}),[]);return c("div",e({className:"chat ".concat(A)},{children:c(f,e({value:$},{children:c(h,e({value:de},{children:c(v,e({value:le},{children:D||g(m,{children:[c(E,{}),c(P,{}),c(y,{})]})}))}))}))}))}var k=o.memo(A);export{k as TUIChat};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e,__spreadArray as s}from"tslib";import{CONSTANT_DISPATCH_TYPE as a}from"../../constants.js";import{handleUploadPendingMessage as t,
|
|
1
|
+
import{__assign as e,__spreadArray as s}from"tslib";import{CONSTANT_DISPATCH_TYPE as a}from"../../constants.js";import{handleUploadPendingMessage as t,handleEditMessage as r}from"./unitls.js";var E=function(E,S){switch(null==S?void 0:S.type){case a.SET_CONVERSATION_PRPFILE:return e(e({},E),{conversation:S.value});case a.SET_MESSAGELIST:return e(e({},E),{messageList:S.value});case a.SET_EDIT_MESSAGE:return e(e({},E),{messageList:s([],r(E.messageList,S.value),!0)});case a.SET_IS_COMPLETE:return e(e({},E),{isCompleted:S.value});case a.RESET:return e({},u);case a.SET_HIGH_LIGHTED_MESSAGE_ID:return e(e({},E),{highlightedMessageId:S.value});case a.OPERATE_MESSAGE:return e(e({},E),{operateData:e({},S.value)});case a.SET_NO_MORE:return e(e({},E),{noMore:S.value});case a.SET_AUDIO_SOURCE:return e(e({},E),{audioSource:S.value});case a.SET_VIDEO_SOURCE:return e(e({},E),{vidoeSource:S.value});case a.UPDATE_UPLOAD_PENDING_MESSAGE_LIST:return e(e({},E),{uploadPendingMessageList:s([],t(E.uploadPendingMessageList,S.value),!0)});case a.SET_FIRST_SEND_MESSAGE:return e(e({},E),{firstSendMessage:S.value});case a.SET_ACTIVE_MESSAGE_ID:return e(e({},E),{activeMessageID:S.value})}},u={conversation:{},messageList:[],nextReqMessageID:"",isCompleted:!1,init:!1,highlightedMessageId:"",lastMessageID:"",isSameLastMessageID:!1,operateData:{},noMore:!1,audioSource:null,vidoeSource:null,uploadPendingMessageList:[],firstSendMessage:null,activeMessageID:""};export{E as chatReducer,u as initialState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as e}from"react";import{CONSTANT_DISPATCH_TYPE as t}from"../../../constants.js";function o(o){o.state;var
|
|
1
|
+
import{useCallback as e}from"react";import{CONSTANT_DISPATCH_TYPE as t}from"../../../constants.js";function o(o){o.state;var E=o.dispatch;return{operateMessage:e((function(e){E({type:t.OPERATE_MESSAGE,value:e})}),[E]),setAudioSource:e((function(e){E({type:t.SET_AUDIO_SOURCE,value:e})}),[E]),setVideoSource:e((function(e){E({type:t.SET_VIDEO_SOURCE,value:e})}),[E]),setHighlightedMessageId:e((function(e){E({type:t.SET_HIGH_LIGHTED_MESSAGE_ID,value:e})}),[E]),setActiveMessageID:e((function(e){E({type:t.SET_ACTIVE_MESSAGE_ID,value:e})}),[E])}}export{o as useHandleMessage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useCallback as t}from"react";import{CONSTANT_DISPATCH_TYPE as e}from"../../../constants.js";function a(a){a.chat,a.conversation,a.state;var n=a.dispatch;return a.filterMessage,{editLocalMessage:t((function(t){n({type:e.SET_EDIT_MESSAGE,value:t})}),[n]),updateUploadPendingMessageList:t((function(t){n({type:e.UPDATE_UPLOAD_PENDING_MESSAGE_LIST,value:t})}),[n])}}export{a as useHandleMessageList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__spreadArray as n}from"tslib";import
|
|
1
|
+
import{__spreadArray as n}from"tslib";import"@tencentcloud/chat";import"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat-uikit-engine";import"react/jsx-runtime";import"react";import"../Icon/config.js";import"../Icon/type.js";var t=function(t,o){var r=n([],t,!0),i=r.findIndex((function(n){return(null==n?void 0:n.ID)===(null==o?void 0:o.ID)}));return r[i]=o,r},o=function(t,o){var r=n([],t,!0);r.some((function(n){return n.ID===o.ID}))||r.push(o);var i=r.findIndex((function(n){return(null==n?void 0:n.ID)===(null==o?void 0:o.ID)}));return r[i]=o,r};export{t as handleEditMessage,o as handleUploadPendingMessage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as t,jsxs as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as t,jsxs as i}from"react/jsx-runtime";import a,{useState as o,useEffect as r}from"react";import n from"@tencentcloud/chat";import{TUIConversationService as c}from"@tencentcloud/chat-uikit-engine";import{Avatar as l}from"../Avatar/Avatar.js";import{handleDisplayAvatar as s}from"../untils.js";import{isH5 as m}from"../../utils/env.js";import{Icon as d}from"../Icon/Icon.js";import{IconTypes as h}from"../Icon/type.js";import{useTUIKitContext as u}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";function v(a){var v=a.title,p=void 0===v?"":v,f=a.avatar;a.isOnline;var C=a.conversation,S=a.isLive,N=a.opateIcon,T=u("TUIContact").setActiveContact,g=o(p),I=g[0],E=g[1],P=o(""),y=P[0],O=P[1];r((function(){switch(E(p),f&&O(f),null==C?void 0:C.type){case n.TYPES.CONV_C2C:Y(C.userProfile,null==C?void 0:C.remark);break;case n.TYPES.CONV_GROUP:j(C.groupProfile);break;case n.TYPES.CONV_SYSTEM:E("System Notice");break;default:E("")}}),[C]);var Y=function(e,i){I||E(i||(null==e?void 0:e.nick)||(null==e?void 0:e.userID)),f||O(t(l,{size:32,image:s(e.avatar)}))},j=function(e){I||E((null==e?void 0:e.name)||(null==e?void 0:e.groupID)),f||O(t(l,{size:32,image:s(e.avatar,n.TYPES.CONV_GROUP)}))},k=u().setTUIManageShow;return i("header",e({className:"tui-chat-header ".concat(S?"tui-chat-live-header":"")},{children:[m&&t("div",e({style:{paddingRight:"10px"}},{children:t(d,{onClick:function(){c.switchConversation(""),T()},type:h.BACK,width:9,height:16})})),t("div",e({className:"tui-chat-header-left ".concat((null==C?void 0:C.type)===n.TYPES.CONV_SYSTEM?"system":"")},{children:(null==C?void 0:C.type)!==n.TYPES.CONV_SYSTEM&&y})),t("div",e({className:"header-content"},{children:t("h3",e({className:"title"},{children:I}))})),t("div",e({className:"tui-chat-header-right"},{children:t("div",e({className:"header-handle"},{children:N||t(d,{className:"header-handle-more",onClick:function(){k(!0)},type:h.ELLIPSE,width:18,height:5})}))}))]}),null==C?void 0:C.conversationID)}var p=a.memo(v);function f(i){var a=e({},i);return t(p,e({},a))}export{f as TUIChatHeaderDefault};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsx as i,jsxs as o,Fragment as c}from"react/jsx-runtime";import
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as i,jsxs as o,Fragment as c}from"react/jsx-runtime";import n,{useState as e,useMemo as r}from"react";import{useTranslation as s}from"react-i18next";import{TUIContactContextProvider as a}from"../../context/TUIContactContext.js";import{isH5 as m}from"../../utils/env.js";import{useTUIKitContext as d}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import l from"./hooks/useTUIContact.js";import{TUIContactList as h}from"./TUIContactList/TUIContactList.js";import{TUIContactSearch as f}from"../TUIContactSearch/TUIContactSearch.js";import{Icon as p}from"../Icon/Icon.js";import{IconTypes as C}from"../Icon/type.js";function u(n){var u=n.children,I=s().t,L=d("TUIContact").setActiveContact,j=e(!1),v=j[0],T=j[1],U=l(),x=U.friendList,k=U.blockList,w=U.blocklistProfile,A=U.friendApplicationList,N=U.isShowContactList,S=U.setShowContactList,b=r((function(){return{friendList:x,blockList:k,blocklistProfile:w,friendApplicationList:A,isShowContactList:N,setShowContactList:S}}),[x,w,A,N,S]);return i(a,t({value:b},{children:u||o("div",t({className:"tui-contacts ".concat(m?"tui-contacts-h5":""," ")},{children:[!v&&o(c,{children:[o("div",t({className:"tui-contacts-header"},{children:[i("div",t({className:"tui-contact-input"},{children:i(f,{})})),i(p,{onClick:function(){L(),T(!0)},type:C.ADDFRIEND,width:24,height:24})]})),i(h,{})]}),v&&o(c,{children:[o("div",t({className:"tui-contacts-add-header"},{children:[i(p,{onClick:function(){L(),T(!1)},type:C.BACK,width:9,height:16}),i("div",t({className:"tui-contacts-add-header-title"},{children:I("TUIContact.Add Friend")}))]})),i(f,{})]})]}))}))}var I=n.memo(u);export{I as TUIContact,u as UnMemoizedTUIContact};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as o}from"tslib";import{jsx as t,Fragment as i,jsxs as n}from"react/jsx-runtime";import r from"react";import{useTUIKitContext as e}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{FriendInfo as l}from"./friendInfo.js";import{BlockInfo as
|
|
1
|
+
import{__assign as o}from"tslib";import{jsx as t,Fragment as i,jsxs as n}from"react/jsx-runtime";import r from"react";import{useTUIKitContext as e}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{isH5 as a}from"../../../utils/env.js";import{FriendInfo as l}from"./friendInfo.js";import{BlockInfo as d}from"./blockInfo.js";import{AddFriendInfo as p}from"./addFriendInfo.js";import{FriendApplicationInfo as m}from"./friendApplication.js";function c(r){var c=r.showChat,f=e("TUIContact").contactData;return(null==f?void 0:f.type)?n("div",o({className:"tui-contact-info ".concat(a?"tui-contact-info-h5":""," ")},{children:["addFriend"===(null==f?void 0:f.type)&&t(p,{profile:null==f?void 0:f.data}),"friend"===(null==f?void 0:f.type)&&t(l,{openChat:c,friend:null==f?void 0:f.data}),"block"===(null==f?void 0:f.type)&&t(d,{profile:null==f?void 0:f.data}),"friendApplication"===(null==f?void 0:f.type)&&t(m,{application:null==f?void 0:f.data})]})):t(i,{children:" "})}var f=r.memo(c);export{f as TUIContactInfo,c as UnMemoizedTUIContactInfo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as t}from"tslib";import{jsxs as e,jsx as r}from"react/jsx-runtime";import a from"react";import{useTranslation as i}from"react-i18next";import{TUIConversationService as o}from"@tencentcloud/chat-uikit-engine";import{useTUIKitContext as n}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{Icon as c}from"../../Icon/Icon.js";import{IconTypes as m}from"../../Icon/type.js";import{isH5 as s}from"../../../utils/env.js";import{Avatar as d}from"../../Avatar/Avatar.js";import{defaultUserAvatar as l}from"../../Avatar/default.js";function f(a){var f=a.profile,h=i().t,p=f.userID,v=f.nick,u=f.selfSignature,x=f.avatar,I=n("TUIContact").setActiveContact;return e("div",t({className:"tui-contact-info-header"},{children:[s&&r(c,{width:9,height:16,type:m.BACK,onClick:function(){o.switchConversation(""),I()}}),e("div",t({className:"header-container"},{children:[e("div",t({className:"header-container-avatar"},{children:[r(d,{size:60,image:x||l}),r("div",t({className:"header-container-name"},{children:v||p}))]})),r("div",t({className:"header-container-text"},{children:"ID:".concat(p)})),e("div",t({className:"header-container-text"},{children:[h("TUIContact.Signature"),":",u||""]}))]}))]}))}var h=a.memo(f);export{h as BasicInfo,f as UnMemoizedBasicInfo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t,__awaiter as e,__generator as n}from"tslib";import{jsxs as o,Fragment as i,jsx as r}from"react/jsx-runtime";import c,{useState as a,useEffect as s}from"react";import{useTranslation as
|
|
1
|
+
import{__assign as t,__awaiter as e,__generator as n}from"tslib";import{jsxs as o,Fragment as i,jsx as r}from"react/jsx-runtime";import c,{useState as a,useEffect as s}from"react";import{useTranslation as m}from"react-i18next";import{TUIConversationService as l}from"@tencentcloud/chat-uikit-engine";import{useTUIKitContext as u}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{BasicInfo as d}from"./basicInfo.js";import{Switch as f}from"../../Switch/Switch.js";import h from"./hooks/useContactInfo.js";import{DivWithEdit as v}from"../../DivWithEdit/DivWithEdit.js";import{useConversation as p}from"../../../hooks/useConversation.js";function C(c){var C=this,b=u("TUIContact"),k=b.chat,I=b.contactData,x=b.setActiveContact,N=b.setActiveConversation,j=m().t,T=c.friend,U=c.openChat,g=T.userID,w=T.profile,D=T.remark,E=a(""),S=E[0],A=E[1],F=a(""),M=F[0],W=F[1],y=a(!1),B=y[0],K=y[1],q=h(),z=q.addToBlocklist,G=q.deleteFriend,H=p(k).createConversation;s((function(){K(!1),W(D)}),[I,D]);return o(i,{children:[r(d,{profile:w}),o("div",t({className:"tui-contact-info-content"},{children:[o("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:j("TUIContact.remark")})),r(v,{name:"remark",className:"content-item-text",value:M,type:"text",toggle:function(){A("remark")},isEdit:"remark"===S,confirm:function(t){k.updateFriend({userID:g,remark:null==t?void 0:t.value}),W(null==t?void 0:t.value),A("")},close:function(){A("")}})]})),o("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:j("TUIContact.block")})),r(f,{className:"content-item-text",onChange:function(){return e(C,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,z(g)];case 1:return t.sent(),K(!0),x(),[2]}}))}))},checked:B})]})),o("div",t({className:"content-btn-container"},{children:[r("div",t({className:"content-item-btn delete-btn",role:"button",tabIndex:0,onClick:function(){return e(C,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,G(g)];case 1:return t.sent(),x(),[2]}}))}))}},{children:j("TUIContact.Delete friend")})),r("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){return e(C,void 0,void 0,(function(){var t,e;return n(this,(function(n){switch(n.label){case 0:return t="C2C".concat(g),[4,H(t)];case 1:return e=n.sent(),l.switchConversation(t),N(e),U(),[2]}}))}))}},{children:j("TUIContact.Send Message")}))]}))]}))]})}var b=c.memo(C);export{b as FriendInfo,C as UnMemoizedFriendInfo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsxs as i,jsx as n}from"react/jsx-runtime";import c,{useState as a}from"react";import{useTranslation as e}from"react-i18next";import o from"@tencentcloud/chat";import{
|
|
1
|
+
import{__assign as t}from"tslib";import{jsxs as i,jsx as n}from"react/jsx-runtime";import c,{useState as a}from"react";import{useTranslation as e}from"react-i18next";import o from"@tencentcloud/chat";import{isH5 as s}from"../../../utils/env.js";import{useTUIKitContext as r}from"../../../context/TUIKitContext.js";import"../../../context/TUIMessageContext.js";import{useTUIContactContext as l}from"../../../context/TUIContactContext.js";import m from"../TUIContactInfo/hooks/useContactInfo.js";import{Avatar as d}from"../../Avatar/Avatar.js";import{defaultUserAvatar as u}from"../../Avatar/default.js";import p from"../../Icon/images/right-arrow.svg.js";import f from"../../Icon/images/down-arrow.png.js";function v(){var c=r().setActiveContact,v=e().t,N=l("TUIContactList"),h=N.isShowContactList,I=N.friendList,C=N.blocklistProfile,x=N.friendApplicationList,b=m().acceptFriendApplication,g=a(!1),T=g[0],k=g[1],A=a(!1),j=A[0],U=A[1],P=a(!1),S=P[0],_=P[1];return h&&i("div",t({className:"tui-contacts-list ".concat(s?"tui-contacts-list-h5":""," ")},{children:[i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return k(!T)}},{children:[n("p",t({className:"tui-contacts-list-title"},{children:v("TUIContact.New Contacts")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:T?f:p,alt:""})}))]})),T&&x.map((function(a,e){var s=a.userID,r=a.avatar,l=a.nick,m=a.wording,p=a.type;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(t){t.stopPropagation(),c({type:"friendApplication",data:a})}},{children:[n(d,{size:30,image:r||u}),i("div",t({className:"tui-contacts-list-item-card"},{children:[i("div",{children:[n("p",t({className:"tui-contacts-list-item-name text-ellipsis"},{children:l||s})),""!==m&&n("p",t({className:"tui-contacts-list-item-text text-ellipsis"},{children:m}))]}),p===o.TYPES.SNS_APPLICATION_SENT_BY_ME&&n("p",t({className:"tui-contacts-list-btn-text text-ellipsis"},{children:v("TUIContact.waiting for verification")})),p===o.TYPES.SNS_APPLICATION_SENT_TO_ME&&n("div",t({className:"application-btn",role:"button",tabIndex:0,onClick:function(t){!function(t,i){t.stopPropagation(),b(i),c()}(t,s)}},{children:v("TUIContact.Agree")}))]}))]}),s)})),i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return _(!S)}},{children:[n("div",t({className:"tui-contacts-list-title"},{children:v("TUIContact.Blocked List")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:S?f:p,alt:""})}))]})),S&&C.map((function(a,e){var o=a.userID,s=a.avatar,r=a.nick;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(){c({type:"block",data:a})}},{children:[n(d,{size:30,image:s||u}),n("div",t({className:"tui-contacts-list-item-container"},{children:n("p",t({className:"tui-contacts-list-item-name"},{children:r||o}))}))]}),o)})),i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return U(!j)}},{children:[n("div",t({className:"tui-contacts-list-title"},{children:v("TUIContact.Friends")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("img",{src:j?f:p,alt:""})}))]})),j&&I.map((function(a,e){var o=a.profile,s=o.userID,r=o.avatar,l=o.nick;return i("div",t({className:"tui-contacts-list-item",role:"button",tabIndex:0,onClick:function(){c({type:"friend",data:a})}},{children:[n(d,{size:30,image:r||u}),n("div",t({className:"tui-contacts-list-item-container"},{children:n("p",t({className:"tui-contacts-list-item-name"},{children:a.remark||l||s}))}))]}),s)}))]}))}var N=c.memo(v);export{N as TUIContactList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as o}from"react/jsx-runtime";import r,{useMemo as e}from"react";import{TUIConversationProvider as n}from"../../context/TUIConversationContext.js";import{TUIConversationList as i}from"../TUIConversationList/TUIConversationList.js";import"@tencentcloud/chat";function a(r){var a=r.children,s=r.createConversation,m=r.deleteConversation,c=r.filterConversation,v=e((function(){return{createConversation:s,deleteConversation:m,filterConversation:c}}),[s,m,c]);return o(n,t({value:v},{children:a||o(i,{})}))}var s=r.memo(a);export{s as TUIConversation,a as UnMemoizedTUIConversation};
|
|
@@ -4,6 +4,7 @@ import { ConversationPreviewUIComponentProps } from '../ConversationPreview/Conv
|
|
|
4
4
|
import { ConversationListContainerProps } from '../ConversationPreview/ConversationListContainer.js';
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
7
|
+
componentVisibleOptions?: any;
|
|
7
8
|
filters?: object;
|
|
8
9
|
sort?: object;
|
|
9
10
|
options?: object;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as o}from"tslib";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import
|
|
1
|
+
import{__assign as o}from"tslib";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import i,{useState as r,useRef as s}from"react";import{useTranslation as a}from"react-i18next";import{useTUIKitContext as v}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{isH5 as c}from"../../utils/env.js";import l from"./hooks/useConversationList.js";import{ConversationPreview as m}from"../ConversationPreview/ConversationPreview.js";import"@tencentcloud/chat-uikit-engine";import{Icon as C}from"../Icon/Icon.js";import{IconTypes as u}from"../Icon/type.js";import"@tencentcloud/chat";import{useTUIConversationContext as h}from"../../context/TUIConversationContext.js";import{ConversationListContainer as p}from"../ConversationPreview/ConversationListContainer.js";import{ConversationSearchInput as f}from"../ConversationSearch/ConversationSearchInput.js";import{ConversationSearchResult as d}from"../ConversationSearch/ConversationSearchResult.js";import{ConversationCreate as w}from"../ConversationCreate/ConversationCreate.js";import"../ConversationCreate/ConversationGroupTypeInfo.js";import{getDisplayTitle as j}from"../ConversationPreview/utils.js";import{useConversationUpdate as I}from"./hooks/useConversationUpdate.js";function L(i){var L=i.Preview,S=i.Container,g=void 0===S?p:S,x=i.onConversationListUpdated,P=i.filterConversation,T=i.componentVisibleOptions,U=void 0===T?{isProfileShow:!0,isSearchInputShow:!0,isContainerShow:!0}:T;a().t;var N=v("TUIConversationList"),k=N.chat,y=N.customClasses,A=N.conversation,b=N.setActiveConversation;N.setTUIProfileShow;var D=h("TUIConversationList").filterConversation,E=P||D,R=r(0),F=R[0],O=R[1],V=l(k,(function(o,e){o.length&&b(A)}),E),G=V.conversationList,K=V.setConversationList;I(K,x,(function(){return O((function(o){return o+1}))}),E);var M=r(""),q=M[0],z=M[1],B=r(G),H=B[0],J=B[1],Q=r(!1),W=Q[0],X=Q[1],Y=r(""),Z=Y[0],$=Y[1],_=s(null);return e("div",o({className:"tui-conversation ".concat(c?"tui-conversation-h5":""," ").concat(y||""," "),ref:_},{children:W?e(w,{conversationList:G,setConversationCreated:X}):t(n,{children:[U.isSearchInputShow&&t("div",o({className:"tui-conversation-header"},{children:[e(f,{value:q,clearable:!0,onChange:function(o){var e,t;if(z(null===(e=o.target)||void 0===e?void 0:e.value),null===(t=o.target)||void 0===t?void 0:t.value){var n=G.filter((function(e){var t;return j(e).toLocaleLowerCase().includes(null===(t=o.target)||void 0===t?void 0:t.value.toLocaleLowerCase())}));J(n)}else J([])}}),e("div",o({className:"tui-conversation-create-icon"},{children:e(C,{onClick:function(){z(""),X(!0)},type:u.CREATE,height:24,width:24})}))]})),U.isContainerShow&&e(g,o({setConversationList:K},{children:0===G.length?t("div",o({className:"no-result"},{children:[e(C,{className:"no-result-icon",type:u.EFFORT,width:42,height:42}),e("div",o({className:"no-result-message"},{children:"No conversation"}))]})):q?e(d,{Preview:L,searchValue:q,result:H}):G.map((function(t){return e(m,o({},{activeConversation:A,conversation:t,setActiveConversation:b,Preview:L,conversationUpdateCount:F,activeConversationID:Z,setActiveConversationID:$}),t.conversationID)}))}))]})}))}var S=i.memo(L);export{S as TUIConversationList,L as UnMemoTUIConversationList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsx as
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e,jsxs as o,Fragment as a}from"react/jsx-runtime";import{useState as n,useEffect as r}from"react";import{TUIStore as i,StoreName as c}from"@tencentcloud/chat-uikit-engine";import{useTranslation as s}from"react-i18next";import{isPC as l,isH5 as m}from"../../utils/env.js";import{useTUIKit as u}from"./hooks/useTUIKit.js";import{useCreateTUIKitContext as C}from"./hooks/useCreateTUIKitContext.js";import{TUIKitProvider as h}from"../../context/TUIKitContext.js";import{TUIConversation as T}from"../TUIConversation/TUIConversation.js";import{TUIChat as f}from"../TUIChat/TUIChat.js";import{TUIManage as d}from"../TUIManage/TUIManage.js";import{TUIProfile as p}from"../TUIProfile/TUIProfile.js";import"../TUIProfile/TUIProfileDefault.js";import"@tencentcloud/chat";import"../../context/TUIMessageContext.js";import"../Icon/config.js";import"../Icon/type.js";import{TUIContactInfo as I}from"../TUIContact/TUIContactInfo/TUIContactInfo.js";import{TUIContact as v}from"../TUIContact/TUIContact.js";import{TUIKIT_TABBAR as U}from"../../constants.js";import"../../locales/index.js";import g from"../Icon/images/chats.svg.js";import S from"../Icon/images/chats-selected.svg.js";import j from"../Icon/images/contacts.svg.js";import A from"../Icon/images/contacts-selected.svg.js";var N=[{id:1,name:U.CHATS,icon:g,selectedIcon:S,value:U.CHATS},{id:2,name:U.CONTACTS,icon:j,selectedIcon:A,value:U.CONTACTS}],w={className:"sample-h5-input",isTransmitter:!0};function b(n){var r=n.moduleValue,i=n.tabbarRender,c=n.setModuleValue;return o(a,{children:[o("div",t({className:"sample-chat-left-container"},{children:[e(p,{className:"sample-chat-profile"}),i,r===U.CHATS&&e(T,{}),r===U.CONTACTS&&e(v,{})]})),r===U.CHATS&&o(a,{children:[e(f,{}),e(d,{})]}),r===U.CONTACTS&&e(v,{children:e(I,{showChat:function(){c(U.CHATS)}})})]})}function M(n){var r=n.moduleValue,i=n.contactData,c=n.tabbarRender,s=n.currentConversationID,l=n.setModuleValue;return o(a,{children:[!s&&!i&&o("div",t({className:"sample-chat-h5-container"},{children:[e(p,{className:"sample-profile"}),c,r===U.CHATS&&e(T,{}),r===U.CONTACTS&&e(v,{})]})),r===U.CHATS&&s&&o(a,{children:[e(f,{TUIMessageInputConfig:w}),e(d,{})]}),r===U.CONTACTS&&i&&e(v,{children:e(I,{showChat:function(){l(U.CHATS)}})})]})}function x(a){var T=n(""),f=T[0],d=T[1],p=n("chats"),I=p[0],v=p[1],U=s().t,g=a.children,S=a.chat,j=a.customClasses,A=a.activeConversation,w=a.language,x=void 0===w?"en":w;window.tencent_cloud_im_csig_react_uikit_23F_xa=!0;var P=u({chat:S,activeConversation:A,language:x}),V=P.conversation,D=P.contactData,H=P.setActiveConversation,O=P.myProfile,_=P.TUIManageShow,k=P.setTUIManageShow,R=P.TUIProfileShow,y=P.setTUIProfileShow,K=P.setActiveContact,F=C({chat:S,language:x,conversation:V,contactData:D,setActiveConversation:H,customClasses:j,myProfile:O,TUIManageShow:_,setTUIManageShow:k,TUIProfileShow:R,setTUIProfileShow:y,setActiveContact:K});r((function(){return i.watch(c.CONV,{currentConversationID:q}),function(){i.unwatch(c.CONV,{currentConversationID:q})}}),[]);var q=function(t){d(t)},z=e("div",t({className:"sample-chat-tab"},{children:N.map((function(a){return o("div",t({className:"sample-chat-tab-container",role:"presentation",onClick:function(){var t;t=a.value,v(t)}},{children:[e("img",{src:I===a.value?a.selectedIcon:a.icon,alt:""}),e("p",t({className:"sample-chat-tab-text ".concat(I===a.value?"sample-chat-tab-active":"")},{children:U(a.name)}))]}),a.id)}))}));return e(h,t({value:F},{children:e("div",t({className:"tui-kit"},{children:g||l&&e(b,{moduleValue:I,tabbarRender:z,setModuleValue:v})||m&&e(M,{contactData:D,moduleValue:I,tabbarRender:z,currentConversationID:f,setModuleValue:v})}))}))}export{x as TUIKit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as n}from"tslib";import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useState as o,useEffect as
|
|
1
|
+
import{__assign as n}from"tslib";import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useState as o,useEffect as t}from"react";import{useTranslation as a}from"react-i18next";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as s}from"../Icon/type.js";import{Avatar as l}from"../Avatar/Avatar.js";import{defaultGroupAvatarWork as c,defaultUserAvatar as m}from"../Avatar/default.js";import{Switch as d}from"../Switch/Switch.js";import{useTUIKitContext as v}from"../../context/TUIKitContext.js";import"../../context/TUIMessageContext.js";import{isH5 as h,isPC as u}from"../../utils/env.js";import{getMessageProfile as f}from"../ConversationPreview/utils.js";import{useConversationUpdate as p}from"../TUIConversationList/hooks/useConversationUpdate.js";import{useConversation as g}from"../../hooks/useConversation.js";function C(){var C=a().t,I=o(null),N=I[0],j=I[1],x=o(null),U=x[0],k=x[1],T=o(!1),D=T[0],w=T[1],A=o(0),y=A[0],M=A[1],P=v("TUIManage"),S=P.conversation,b=P.setActiveConversation,L=P.chat,K=P.TUIManageShow,z=P.setTUIManageShow;p(null,(function(){M((function(n){return n+1}))}));var B=g(L),E=B.pinConversation,q=B.deleteConversation,F=function(){z(!1)};return t((function(){j(S),k(f(S)),w(!!S&&S.isPinned)}),[S,y]),K&&S&&e("div",n({className:"tui-manage ".concat(h?"tui-h5-manage":"")},{children:[e("div",n({className:"tui-manage-title"},{children:[u&&i(r,{onClick:F,type:s.CANCEL,width:9,height:16}),h&&i(r,{onClick:F,type:s.BACK,width:9,height:16}),i("span",n({style:{marginLeft:"10px"}},{children:C("TUIConversation.Conversation Information")}))]})),e("div",n({className:"tui-manage-container"},{children:[e("div",n({className:"tui-manage-info"},{children:[i("div",n({className:"info-avatar"},{children:i(l,{size:64,image:(null==U?void 0:U.avatar)||((null==U?void 0:U.groupID)?c:m)})})),i("div",n({className:"info-name"},{children:(null==U?void 0:U.nick)||(null==U?void 0:U.name)})),e("div",n({className:"info-id"},{children:["ID:",(null==U?void 0:U.userID)||(null==U?void 0:U.groupID)]}))]})),e("div",n({className:"tui-manage-handle"},{children:[e("div",n({className:"manage-handle-box"},{children:[i("div",n({className:"manage-handle-title"},{children:C("TUIConversation.Pin")})),i(d,{onChange:function(n){w(n.target.checked),E({conversationID:N.conversationID,isPinned:n.target.checked})},checked:D})]})),u&&i("div",n({className:"manage-handle-box",role:"presentation",onClick:function(){q(N.conversationID),b(null)}},{children:i("div",n({className:"manage-handle-title red"},{children:C("TUIConversation.Delete")}))}))]}))]}))]}))}export{C as TUIManage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as
|
|
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 a from"@tencentcloud/chat";import{MESSAGE_STATUS as l}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,f=o.Context,v=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!==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.ID),x(!0)},onMouseLeave:function(){j(p.ID),x(!1)},onClick:function(){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)!==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?"":"loading")},{children:[N&&s("div",e({className:"meesage-bubble-reply-main",role:"menuitem",tabIndex:0,onClick:function(){E(null==y?void 0:y.ID)}},{children:[t("header",e({className:"title"},{children:S})),f&&t(f,{message:y})]})),b,t(g,{message:p})]})),v&&t("div",e({className:"message-plugin"},{children:h&&t(v,{message:p})}))]})),s("div",e({className:"message-bubble-status icon"},{children:[(null==p?void 0:p.status)===l.FAIL&&t("i",{className:"icon-fail"}),(null==p?void 0:p.status)===l.UNSEND&&t(m,{width:10,height:10,type:u.PROGRESS})]}))]}))}var b=o.memo(p);function f(s){return t(b,e({},s))}export{f 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
|
|
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 n}from"./MessageFile.js";import{MessageImage as E}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 l,G=((l={})[s.TYPES.MSG_TEXT]=a,l[s.TYPES.MSG_FACE]=i,l[s.TYPES.MSG_IMAGE]=E,l[s.TYPES.MSG_AUDIO]=m,l[s.TYPES.MSG_VIDEO]=T,l[s.TYPES.MSG_FILE]=n,l[s.TYPES.MSG_CUSTOM]=r,l[s.TYPES.MSG_MERGER]=S,l[s.TYPES.MSG_LOCATION]=M,l);function f(o){var m,r=o.message,i=c({message:r}).context,n=p("MessageCustom"),E=n.CustemElement,M=n.TextElement,S=n.FaceElement,a=n.ImageElement,T=n.AudioElement,l=n.VideoElement,f=n.FileElement,P=n.MergerElement,Y=n.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]=l,m[s.TYPES.MSG_FILE]=f,m[s.TYPES.MSG_CUSTOM]=E,m[s.TYPES.MSG_MERGER]=P,m[s.TYPES.MSG_LOCATION]=Y,m)[null==r?void 0:r.type]||G[null==r?void 0:r.type];return _&&t(_,e({context:i,message:r},{children:t(g,{message:r})}))}var P=o.memo(f);function Y(o){return t(P,e({},o))}export{Y as MessageContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as
|
|
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 +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 t}from"react";import e from"@tencentcloud/chat";import{isH5 as l}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,f=r.children,v=t(!1),g=v[0],p=v[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(l?"img-h5":""," bubble-").concat(s.flow," ").concat((null==s?void 0:s.conversationType)===e.TYPES.CONV_GROUP?"group":""),src:d.url,alt:""})})),f,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 o}from"tslib";import{jsx as t}from"react/jsx-runtime";import e from"@tencentcloud/chat";import"react";import{messageShowType as
|
|
1
|
+
import{__assign as o}from"tslib";import{jsx as t}from"react/jsx-runtime";import e from"@tencentcloud/chat";import"react";import{messageShowType as l}from"../../context/TUIMessageContext.js";function n(n){n.className;var r=n.CustomName,m=n.message,i=n.showType;return(i===l.ALL||(null==m?void 0:m.flow)===i)&&(null==m?void 0:m.conversationType)===e.TYPES.CONV_GROUP&&i!==l.NONE?r||t("label",o({htmlFor:"content",className:"text-ellipsis name"},{children:(null==m?void 0:m.nick)||(null==m?void 0:m.from)})):null}export{n as MessageName};
|