@tencentcloud/chat-uikit-react 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/dist/cjs/components/Chat/Chat.js +1 -1
- package/dist/cjs/components/Chat/index.js +1 -1
- package/dist/cjs/components/ChatHeader/ChatHeader.js +1 -1
- package/dist/cjs/components/ChatHeader/ChatHeaderDefault.js +1 -1
- package/dist/cjs/components/ChatSetting/ChatSetting.js +1 -1
- package/dist/cjs/components/Contact/Contact.js +1 -1
- package/dist/cjs/components/Contact/ContactInfo/ContactInfo.js +1 -1
- package/dist/cjs/components/Contact/ContactInfo/addFriendInfo.js +1 -1
- package/dist/cjs/components/Contact/ContactInfo/basicInfo.js +1 -1
- package/dist/cjs/components/Contact/ContactInfo/blockInfo.js +1 -1
- package/dist/cjs/components/Contact/ContactInfo/friendApplication.js +1 -1
- package/dist/cjs/components/Contact/ContactInfo/friendInfo.js +1 -1
- package/dist/cjs/components/Contact/ContactInfo/groupInfo.js +1 -1
- package/dist/cjs/components/Contact/ContactInfo/hooks/useContactInfo.js +1 -1
- package/dist/cjs/components/Contact/ContactList/ContactList.js +1 -1
- package/dist/cjs/components/Contact/hooks/useTUIContact.js +1 -1
- package/dist/cjs/components/ContactSearch/ContactSearch.js +1 -1
- package/dist/cjs/components/ContactSearch/hooks/useContactSearch.js +1 -1
- package/dist/cjs/components/ConversationActions/ConversationActions.js +1 -1
- package/dist/cjs/components/ConversationCreate/ConversationCreate.js +1 -1
- package/dist/cjs/components/ConversationCreate/ConversationCreateGroupDetail.js +1 -1
- package/dist/cjs/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
- package/dist/cjs/components/ConversationCreate/ConversationGroupTypeInfo.js +1 -1
- package/dist/cjs/components/ConversationList/ConversationList.js +1 -1
- package/dist/cjs/components/ConversationPreview/ConversationPreview.js +1 -1
- package/dist/cjs/components/ConversationPreview/utils.js +1 -1
- package/dist/cjs/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.js +1 -1
- package/dist/cjs/components/MessageElement/Message.js +1 -1
- package/dist/cjs/components/MessageElement/MessageAudio.js +1 -1
- package/dist/cjs/components/MessageElement/MessageAvatar.js +1 -1
- package/dist/cjs/components/MessageElement/MessageBubble.js +1 -1
- package/dist/cjs/components/MessageElement/MessageContext.js +1 -1
- package/dist/cjs/components/MessageElement/MessageCustom.js +1 -1
- package/dist/cjs/components/MessageElement/MessageDefault.js +1 -1
- package/dist/cjs/components/MessageElement/MessageName.js +1 -1
- package/dist/cjs/components/MessageElement/MessagePlugins.js +1 -1
- package/dist/cjs/components/MessageElement/MessageProgress.js +1 -1
- package/dist/cjs/components/MessageElement/MessageRevoke.js +1 -1
- package/dist/cjs/components/MessageElement/MessageStatus.js +1 -1
- package/dist/cjs/components/MessageElement/MessageSystem.js +1 -1
- package/dist/cjs/components/MessageElement/MessageText.js +1 -1
- package/dist/cjs/components/MessageElement/MessageTip.js +1 -1
- package/dist/cjs/components/MessageElement/hooks/useMessageHandler.js +1 -1
- package/dist/cjs/components/MessageElement/hooks/useMessageReply.js +1 -1
- package/dist/cjs/components/MessageElement/utils/decodeText.js +1 -1
- package/dist/cjs/components/MessageElement/utils/emojiMap.js +1 -1
- package/dist/cjs/components/MessageElement/utils/index.js +1 -1
- package/dist/cjs/components/MessageInput/EmojiPicker.js +1 -1
- package/dist/cjs/components/MessageInput/Forward.js +1 -1
- package/dist/cjs/components/MessageInput/InputPluginsDefalut.js +1 -1
- package/dist/cjs/components/MessageInput/InputQuoteDefalut.js +1 -1
- package/dist/cjs/components/MessageInput/MessageInput.js +1 -1
- package/dist/cjs/components/MessageInput/MessageInputDefault.js +1 -1
- package/dist/cjs/components/MessageInput/hooks/useEmojiPicker.js +1 -1
- package/dist/cjs/components/MessageInput/hooks/useHandleForwardMessage.js +1 -1
- package/dist/cjs/components/MessageInput/hooks/useHandleQuoteMessage.js +1 -1
- package/dist/cjs/components/MessageInput/hooks/useMessageInputText.js +1 -1
- package/dist/cjs/components/MessageList/MessageList.js +1 -1
- package/dist/cjs/components/MessageList/hooks/useMessageListElement.js +1 -1
- package/dist/cjs/components/Profile/Profile.js +1 -1
- package/dist/cjs/components/Profile/ProfileDefault.js +1 -1
- package/dist/cjs/context/UIKitContext.js +1 -1
- package/dist/cjs/index.css +2 -2
- package/dist/cjs/index.d.css +213 -207
- package/dist/cjs/index.d.ts +0 -3
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/locales/en-US/emoji.js +1 -0
- package/dist/cjs/locales/en-US/index.js +1 -1
- package/dist/cjs/locales/index.js +1 -1
- package/dist/cjs/locales/ja-JP/emoji.js +1 -0
- package/dist/cjs/locales/ja-JP/index.js +1 -1
- package/dist/cjs/locales/ko-KR/emoji.js +1 -0
- package/dist/cjs/locales/ko-KR/index.js +1 -1
- package/dist/cjs/locales/zh-CN/emoji.js +1 -0
- package/dist/cjs/locales/zh-CN/index.js +1 -1
- package/dist/cjs/locales/zh-TW/emoji.js +1 -0
- package/dist/cjs/locales/zh-TW/index.js +1 -1
- package/dist/cjs/node_modules/zustand/esm/react.mjs.js +1 -0
- package/dist/cjs/node_modules/zustand/esm/vanilla.mjs.js +1 -0
- package/dist/cjs/store/UIManagerStore.js +1 -0
- package/dist/esm/components/Chat/Chat.js +1 -1
- package/dist/esm/components/Chat/index.js +1 -1
- package/dist/esm/components/ChatHeader/ChatHeader.js +1 -1
- package/dist/esm/components/ChatHeader/ChatHeaderDefault.js +1 -1
- package/dist/esm/components/ChatSetting/ChatSetting.js +1 -1
- package/dist/esm/components/Contact/Contact.js +1 -1
- package/dist/esm/components/Contact/ContactInfo/ContactInfo.js +1 -1
- package/dist/esm/components/Contact/ContactInfo/addFriendInfo.js +1 -1
- package/dist/esm/components/Contact/ContactInfo/basicInfo.js +1 -1
- package/dist/esm/components/Contact/ContactInfo/blockInfo.js +1 -1
- package/dist/esm/components/Contact/ContactInfo/friendApplication.js +1 -1
- package/dist/esm/components/Contact/ContactInfo/friendInfo.js +1 -1
- package/dist/esm/components/Contact/ContactInfo/groupInfo.js +1 -1
- package/dist/esm/components/Contact/ContactInfo/hooks/useContactInfo.js +1 -1
- package/dist/esm/components/Contact/ContactList/ContactList.js +1 -1
- package/dist/esm/components/Contact/hooks/useTUIContact.js +1 -1
- package/dist/esm/components/ContactSearch/ContactSearch.js +1 -1
- package/dist/esm/components/ContactSearch/hooks/useContactSearch.js +1 -1
- package/dist/esm/components/ConversationActions/ConversationActions.js +1 -1
- package/dist/esm/components/ConversationCreate/ConversationCreate.js +1 -1
- package/dist/esm/components/ConversationCreate/ConversationCreateGroupDetail.js +1 -1
- package/dist/esm/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
- package/dist/esm/components/ConversationCreate/ConversationGroupTypeInfo.js +1 -1
- package/dist/esm/components/ConversationList/ConversationList.js +1 -1
- package/dist/esm/components/ConversationPreview/ConversationPreview.js +1 -1
- package/dist/esm/components/ConversationPreview/utils.js +1 -1
- package/dist/esm/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.js +1 -1
- package/dist/esm/components/MessageElement/Message.js +1 -1
- package/dist/esm/components/MessageElement/MessageAudio.js +1 -1
- package/dist/esm/components/MessageElement/MessageAvatar.js +1 -1
- package/dist/esm/components/MessageElement/MessageBubble.js +1 -1
- package/dist/esm/components/MessageElement/MessageContext.js +1 -1
- package/dist/esm/components/MessageElement/MessageCustom.js +1 -1
- package/dist/esm/components/MessageElement/MessageDefault.js +1 -1
- package/dist/esm/components/MessageElement/MessageName.js +1 -1
- package/dist/esm/components/MessageElement/MessagePlugins.js +1 -1
- package/dist/esm/components/MessageElement/MessageProgress.js +1 -1
- package/dist/esm/components/MessageElement/MessageRevoke.js +1 -1
- package/dist/esm/components/MessageElement/MessageStatus.js +1 -1
- package/dist/esm/components/MessageElement/MessageSystem.js +1 -1
- package/dist/esm/components/MessageElement/MessageText.js +1 -1
- package/dist/esm/components/MessageElement/MessageTip.js +1 -1
- package/dist/esm/components/MessageElement/hooks/useMessageHandler.js +1 -1
- package/dist/esm/components/MessageElement/hooks/useMessageReply.js +1 -1
- package/dist/esm/components/MessageElement/utils/decodeText.js +1 -1
- package/dist/esm/components/MessageElement/utils/emojiMap.js +1 -1
- package/dist/esm/components/MessageElement/utils/index.js +1 -1
- package/dist/esm/components/MessageInput/EmojiPicker.js +1 -1
- package/dist/esm/components/MessageInput/Forward.js +1 -1
- package/dist/esm/components/MessageInput/InputPluginsDefalut.js +1 -1
- package/dist/esm/components/MessageInput/InputQuoteDefalut.js +1 -1
- package/dist/esm/components/MessageInput/MessageInput.js +1 -1
- package/dist/esm/components/MessageInput/MessageInputDefault.js +1 -1
- package/dist/esm/components/MessageInput/hooks/useEmojiPicker.js +1 -1
- package/dist/esm/components/MessageInput/hooks/useHandleForwardMessage.js +1 -1
- package/dist/esm/components/MessageInput/hooks/useHandleQuoteMessage.js +1 -1
- package/dist/esm/components/MessageInput/hooks/useMessageInputText.js +1 -1
- package/dist/esm/components/MessageList/MessageList.js +1 -1
- package/dist/esm/components/MessageList/hooks/useMessageListElement.js +1 -1
- package/dist/esm/components/Profile/Profile.js +1 -1
- package/dist/esm/components/Profile/ProfileDefault.js +1 -1
- package/dist/esm/context/UIKitContext.js +1 -1
- package/dist/esm/index.css +2 -2
- package/dist/esm/index.d.css +213 -207
- package/dist/esm/index.d.ts +0 -3
- package/dist/esm/index.js +1 -1
- package/dist/esm/locales/en-US/emoji.js +1 -0
- package/dist/esm/locales/en-US/index.js +1 -1
- package/dist/esm/locales/index.js +1 -1
- package/dist/esm/locales/ja-JP/emoji.js +1 -0
- package/dist/esm/locales/ja-JP/index.js +1 -1
- package/dist/esm/locales/ko-KR/emoji.js +1 -0
- package/dist/esm/locales/ko-KR/index.js +1 -1
- package/dist/esm/locales/zh-CN/emoji.js +1 -0
- package/dist/esm/locales/zh-CN/index.js +1 -1
- package/dist/esm/locales/zh-TW/emoji.js +1 -0
- package/dist/esm/locales/zh-TW/index.js +1 -1
- package/dist/esm/node_modules/zustand/esm/react.mjs.js +1 -0
- package/dist/esm/node_modules/zustand/esm/vanilla.mjs.js +1 -0
- package/dist/esm/store/UIManagerStore.js +1 -0
- package/package.json +5 -3
- package/src/components/Chat/Chat.tsx +3 -3
- package/src/components/Chat/styles/layout.scss +1 -1
- package/src/components/ChatHeader/ChatHeaderDefault.tsx +4 -3
- package/src/components/ChatHeader/styles/layout.scss +1 -1
- package/src/components/ChatSetting/ChatSetting.tsx +8 -7
- package/src/components/ChatSetting/styles/index.scss +2 -1
- package/src/components/Checkbox/styles/color.scss +1 -1
- package/src/components/Contact/Contact.tsx +4 -4
- package/src/components/Contact/ContactInfo/ContactInfo.tsx +2 -2
- package/src/components/Contact/ContactInfo/addFriendInfo.tsx +38 -36
- package/src/components/Contact/ContactInfo/basicInfo.tsx +10 -10
- package/src/components/Contact/ContactInfo/blockInfo.tsx +4 -4
- package/src/components/Contact/ContactInfo/friendApplication.tsx +4 -4
- package/src/components/Contact/ContactInfo/friendInfo.tsx +7 -7
- package/src/components/Contact/ContactInfo/groupInfo.tsx +23 -23
- package/src/components/Contact/ContactInfo/hooks/useContactInfo.tsx +2 -2
- package/src/components/Contact/ContactInfo/index.scss +1 -1
- package/src/components/Contact/ContactList/ContactList.tsx +5 -4
- package/src/components/Contact/ContactList/index.scss +1 -1
- package/src/components/Contact/hooks/useTUIContact.tsx +2 -2
- package/src/components/Contact/index.scss +1 -1
- package/src/components/ContactSearch/ContactSearch.tsx +5 -4
- package/src/components/ContactSearch/hooks/useContactSearch.tsx +4 -3
- package/src/components/ContactSearch/index.scss +1 -1
- package/src/components/ConversationActions/ConversationActions.scss +1 -1
- package/src/components/ConversationActions/ConversationActions.tsx +2 -2
- package/src/components/ConversationCreate/ConversationCreate.tsx +2 -2
- package/src/components/ConversationCreate/ConversationCreateGroupDetail.tsx +4 -4
- package/src/components/ConversationCreate/ConversationCreateUserSelectList.tsx +4 -4
- package/src/components/ConversationCreate/ConversationGroupTypeInfo.tsx +2 -2
- package/src/components/ConversationCreate/styles/ConversationCreateGroupDetail.scss +1 -1
- package/src/components/ConversationCreate/styles/conversationCreateSelectView.scss +1 -1
- package/src/components/ConversationCreate/styles/conversationGroupTypeInfo.scss +1 -1
- package/src/components/ConversationCreate/styles/index.scss +1 -1
- package/src/components/ConversationList/ConversationList.scss +1 -1
- package/src/components/ConversationList/ConversationListContent/ConversationListContent.scss +1 -1
- package/src/components/ConversationList/ConversationListHeader/ConversationListHeader.scss +1 -1
- package/src/components/ConversationPreview/ConversationPreview.scss +1 -1
- package/src/components/ConversationPreview/ConversationPreview.tsx +3 -3
- package/src/components/ConversationPreview/utils.tsx +2 -2
- package/src/components/ConversationSearch/ConversationSearch.scss +1 -1
- package/src/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.scss +1 -1
- package/src/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.tsx +2 -2
- package/src/components/ConversationSearch/ConversationSearchResult/ConversationSearchResult.scss +1 -1
- package/src/components/DivWithEdit/styles/index.scss +1 -1
- package/src/components/Icon/styles/index.scss +1 -1
- package/src/components/Input/styles/index.scss +2 -2
- package/src/components/MessageElement/MessageCustom.tsx +4 -4
- package/src/components/MessageElement/MessagePlugins.tsx +3 -3
- package/src/components/MessageElement/MessageRevoke.tsx +5 -5
- package/src/components/MessageElement/MessageStatus.tsx +2 -1
- package/src/components/MessageElement/hooks/useMessageHandler.ts +9 -6
- package/src/components/MessageElement/hooks/useMessageReply.ts +3 -2
- package/src/components/MessageElement/styles/color.scss +1 -1
- package/src/components/MessageElement/styles/layout.scss +2 -2
- package/src/components/MessageElement/utils/decodeText.ts +59 -9
- package/src/components/MessageElement/utils/emojiMap.ts +73 -474
- package/src/components/MessageElement/utils/index.ts +1 -5
- package/src/components/MessageInput/EmojiPicker.tsx +10 -8
- package/src/components/MessageInput/Forward.tsx +2 -2
- package/src/components/MessageInput/InputPluginsDefalut.tsx +2 -2
- package/src/components/MessageInput/InputQuoteDefalut.tsx +6 -6
- package/src/components/MessageInput/MessageInput.tsx +0 -1
- package/src/components/MessageInput/MessageInputDefault.tsx +5 -5
- package/src/components/MessageInput/hooks/useEmojiPicker.tsx +11 -16
- package/src/components/MessageInput/hooks/useHandleForwardMessage.tsx +3 -4
- package/src/components/MessageInput/hooks/useMessageInputText.tsx +17 -11
- package/src/components/MessageInput/styles/color.scss +1 -1
- package/src/components/MessageInput/styles/layout.scss +2 -2
- package/src/components/MessageList/MessageList.tsx +2 -2
- package/src/components/MessageList/hooks/useMessageListElement.tsx +3 -2
- package/src/components/MessageList/styles/layout.scss +1 -1
- package/src/components/Plugins/styles/color.scss +1 -1
- package/src/components/Profile/Profile.tsx +2 -2
- package/src/components/Profile/ProfileDefault.tsx +4 -4
- package/src/components/Profile/myProfile/styles/index.scss +1 -1
- package/src/components/Profile/styles/color.scss +1 -1
- package/src/components/Profile/styles/layout.scss +1 -1
- package/src/context/UIKitContext.tsx +2 -8
- package/src/context/UIManagerContext.tsx +5 -5
- package/src/context/index.ts +0 -1
- package/src/locales/en-US/emoji.ts +66 -0
- package/src/locales/en-US/index.ts +2 -0
- package/src/locales/index.ts +4 -22
- package/src/locales/ja-JP/emoji.ts +66 -0
- package/src/locales/ja-JP/index.ts +2 -0
- package/src/locales/ko-KR/emoji.ts +66 -0
- package/src/locales/ko-KR/index.ts +2 -0
- package/src/locales/zh-CN/emoji.ts +66 -0
- package/src/locales/zh-CN/index.ts +2 -0
- package/src/locales/zh-TW/emoji.ts +65 -0
- package/src/locales/zh-TW/index.ts +2 -0
- package/src/store/UIManagerStore.ts +108 -0
- package/src/store/index.ts +5 -0
- package/.babelrc +0 -7
- package/.editorconfig +0 -16
- package/.husky/pre-commit +0 -4
- package/.lintstagedrc.json +0 -6
- package/.stylelintrc.js +0 -40
- package/dist/cjs/context/UIManagerContext.d.ts +0 -46
- package/dist/cjs/context/UIManagerContext.js +0 -1
- package/dist/cjs/locales/index.d.ts +0 -6
- package/dist/esm/context/UIManagerContext.d.ts +0 -46
- package/dist/esm/context/UIManagerContext.js +0 -1
- package/dist/esm/locales/index.d.ts +0 -6
- package/rollup.config.js +0 -81
- package/scripts/publish-npm.js +0 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as o}from"tslib";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as r}from"react";import{ConversationListProvider as i,useConversationList as n}from"../../context/ConversationListContext.js";import{ConversationListHeader as a}from"./ConversationListHeader/ConversationListHeader.js";import{ConversationListContent as s}from"./ConversationListContent/ConversationListContent.js";import"react
|
|
1
|
+
import{__assign as o}from"tslib";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as r}from"react";import{ConversationListProvider as i,useConversationList as n}from"../../context/ConversationListContext.js";import{ConversationListHeader as a}from"./ConversationListHeader/ConversationListHeader.js";import{ConversationListContent as s}from"./ConversationListContent/ConversationListContent.js";import"@tencentcloud/uikit-base-component-react";import"../Icon/config.js";import"../Icon/type.js";import v from"classnames";import{ConversationPreview as c,ConversationPreviewUI as l}from"../ConversationPreview/ConversationPreview.js";import{Avatar as d}from"../Avatar/Avatar.js";import{PlaceHolder as m,PlaceHolderTypes as C}from"../PlaceHolder/index.js";import{ConversationSearch as p}from"../ConversationSearch/ConversationSearch.js";import{ConversationCreate as f}from"../ConversationCreate/ConversationCreate.js";import"../ConversationCreate/ConversationGroupTypeInfo.js";import"../../store/UIManagerStore.js";import"@tencentcloud/chat-uikit-engine";import"@tencentcloud/chat";import{ConversationActions as h}from"../ConversationActions/ConversationActions.js";import{isH5 as u}from"../../utils/env.js";function L(i){var L=i.enableSearch,j=void 0===L||L,A=i.enableCreate,g=void 0===A||A,P=i.enableActions,b=void 0===P||P,y=i.actionsConfig,S=i.Header,N=void 0===S?a:S,I=i.List,E=void 0===I?s:I,k=i.Preview,w=void 0===k?l:k,x=i.ConversationCreate,O=void 0===x?f:x,H=i.ConversationSearch,G=void 0===H?p:H,R=i.ConversationActions,_=void 0===R?h:R,B=i.PlaceholderEmptyList,D=void 0===B?e(m,{type:C.NO_CONVERSATIONS}):B,M=i.PlaceholderLoading,T=void 0===M?e(m,{type:C.LOADING}):M,V=i.PlaceholderLoadError,U=void 0===V?e(m,{type:C.WRONG}):V,W=i.Avatar,q=void 0===W?d:W,z=i.onSelectConversation,F=i.onBeforeCreateConversation,J=i.onConversationCreated,K=i.className,Q=i.style,X=n(),Y=X.conversationList,Z=X.filteredAndSortedConversationList,$=X.isLoading,oo=X.isLoadError,eo=r(!1),to=eo[0],ro=eo[1];return t("div",o({className:v(K,"uikit-chat-list",{"uikit-chat-list--mobile":u}),style:Q},{children:[t(N,{children:[e(G,{visible:j,conversationList:Y,Avatar:q,ResultPreview:c}),e(O,{className:v({"uikit-chat-list__header--creating":to}),visible:g,onChangeCreateModelVisible:function(o){return ro(o)},onBeforeCreateConversation:F,onConversationCreated:J})]}),e(E,o({empty:0===Z.length,loading:$,error:oo,PlaceholderEmptyList:D,PlaceholderLoadError:U,PlaceholderLoading:T},{children:Z.map((function(o){return e(c,{conversation:o,enableActions:b,Preview:w,Avatar:q,ConversationActions:_,onSelectConversation:z,actionsConfig:y},o.conversationID)}))}))]}))}function j(t){return e(i,o({filter:t.filter,sort:t.sort},{children:e(L,o({},t))}))}export{j as ConversationList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as i}from"tslib";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useRef as o,useState as r,useEffect as s}from"react";import a from"classnames";import{
|
|
1
|
+
import{__assign as i}from"tslib";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useRef as o,useState as r,useEffect as s}from"react";import a from"classnames";import{useUIKit as c}from"@tencentcloud/uikit-base-component-react";import{Icon as v}from"../Icon/Icon.js";import{IconTypes as l}from"../Icon/type.js";import{Avatar as u}from"../Avatar/Avatar.js";import{ConversationActions as m}from"../ConversationActions/ConversationActions.js";import{useConversationList as d}from"../../context/ConversationListContext.js";import{useUIManagerStore as h}from"../../store/UIManagerStore.js";import p from"../../hooks/useLongPress.js";import g from"../../hooks/useMouseHover.js";import{generateHighlightTitle as f,getLatestMessagePreview as C}from"./utils.js";import{getTimeStamp as k}from"../utils.js";import{isH5 as _}from"../../utils/env.js";function w(t){var n=t.conversation,o=t.isSelected,r=void 0!==o&&o,s=t.enableActions,p=void 0===s||s,g=t.highlightMatchString,_=t.Preview,w=void 0===_?A:_,M=t.Avatar,j=void 0===M?u:M,N=t.ConversationActions,S=void 0===N?m:N,b=t.Title,L=void 0===b?function(t){var n=t.conversation,o=t.highlightMatchString;return e("div",i({className:"uikit-conversation-preview__title text-ellipsis"},{children:f(n,o).map((function(t,n){return e("span",i({className:a({"uikit-conversation-preview__title--highlight":t.isHighlight,"uikit-conversation-preview__title--normal":!t.isHighlight})},{children:t.text}),n)}))}))}({conversation:n,highlightMatchString:g}):b,y=t.LastMessageTimestamp,T=void 0===y?function(t){var n,o=t.conversation,r=c().language;return e("div",i({className:"uikit-conversation-preview__time"},{children:k(1e3*+((null===(n=o.lastMessage)||void 0===n?void 0:n.lastTime)||0),r)}))}({conversation:n}):y,x=t.LastMessageAbstract,I=void 0===x?function(t){var n=t.conversation,o=h().myProfile;return e("div",i({className:"uikit-conversation-preview__abstract"},{children:C(n,o)}))}({conversation:n}):x,P=t.Unread,U=void 0===P?function(t){var n,o=t.conversation;return n=o.isMuted?e(v,{type:l.MUTE,width:16,height:16}):o.unreadCount>99?"99+":0===o.unreadCount?null:o.unreadCount,e("div",i({className:"uikit-conversation-preview__unread"},{children:n}))}({conversation:n}):P,D=t.onSelectConversation,H=t.actionsConfig,z=t.className,E=t.style,q=t.children;return d().setCurrentConversation,e(w,{conversation:n,isSelected:r,enableActions:p,highlightMatchString:g,Avatar:j,ConversationActions:S,Title:L,LastMessageTimestamp:T,LastMessageAbstract:I,Unread:U,onSelectConversation:D,actionsConfig:H,className:z,style:E,children:q})}function A(c){var v=c.conversation,l=c.isSelected,h=c.enableActions,f=c.Avatar,C=void 0===f?u:f,k=c.ConversationActions,w=void 0===k?m:k,A=c.Title,M=c.LastMessageTimestamp,j=c.LastMessageAbstract,N=c.Unread,S=c.onSelectConversation,b=c.actionsConfig,L=c.className,y=c.style,T=c.children,x=d(),I=x.currentConversation,P=x.setCurrentConversation,U=o(null),D=r(!1),H=D[0],z=D[1],E=g(U),q=p({},{delay:500,shouldPreventDefault:!0}).isLongPressing;s((function(){z(E||q)}),[E,q]);return e("div",i({ref:U,className:a("uikit-conversation-preview",L,{"uikit-conversation-preview--mobile":_,"uikit-conversation-preview--active":l||v.conversationID===(null==I?void 0:I.conversationID),"uikit-conversation-preview--unread":!v.isMuted&&v.unreadCount>0,"uikit-conversation-preview--pin":v.isPinned,"uikit-conversation-preview--mute":v.isMuted}),style:y,onClick:function(){null==S||S(v),P(v)}},{children:T||t(n,{children:[e("div",i({className:"uikit-conversation-preview__avatar"},{children:e(C,{image:v.getAvatar(),size:40})})),t("div",i({className:"uikit-conversation-preview__content"},{children:[A,j]})),t("div",i({className:"uikit-conversation-preview__external"},{children:[N,h&&H?e(w,i({conversation:v},b)):M]}))]})}))}export{w as ConversationPreview,A as ConversationPreviewUI};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as r,jsx as t,Fragment as o}from"react/jsx-runtime";import a from"@tencentcloud/chat-uikit-engine";import
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as r,jsx as t,Fragment as o}from"react/jsx-runtime";import a from"@tencentcloud/chat-uikit-engine";import"react";import"../Icon/config.js";import"../Icon/type.js";import{defaultGroupAvatarWork as i,defaultUserAvatar as n}from"../Avatar/default.js";import{transformTextWithEmojiKeyToName as c}from"../MessageElement/utils/decodeText.js";var s=function(e,r){var t=e.getShowName();if(!r)return[{text:t,isHighlight:!1}];var o=r.toLowerCase();return t.split(new RegExp("(".concat(r,")"),"gi")).map((function(e){return{text:e,isHighlight:e.toLowerCase()===o}}))},l=function(o,i){var n,s=o.lastMessage,l=o.type;if(!s)return"";var u=s.fromAccount,p=s.nick,d=s.nameCard,f=s.isRevoked,m=s.messageForShow;s.type===a.TYPES.MSG_CUSTOM&&(null===(n=s.payload)||void 0===n?void 0:n.description)&&(m=s.payload.description);var C="";switch(l){case a.TYPES.CONV_GROUP:C=(null==s?void 0:s.fromAccount)===(null==i?void 0:i.userID)?"You":"".concat(d||p||u||""),C="".concat(C?"".concat(C,":"):"");break;case a.TYPES.CONV_C2C:C=f?"you ":""}return r("div",e({style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:[t("span",{children:C}),t("span",{children:s.isRevoked?"recalled a message":c(m)})]}))},u=function(e){if(!e)return null;var r={},t=e.type,o=e.groupProfile,i=e.userProfile;switch(t){case a.TYPES.CONV_C2C:r=i;break;case a.TYPES.CONV_GROUP:r=o}return r},p=function(i,n,c){void 0===c&&(c="#147AFF");var s=u(i),l=s.name,p=s.nick,d=s.groupID,f=s.userID,m=i.type,C=i.remark,v="";switch(m){case a.TYPES.CONV_C2C:v=C||p||f||"";break;case a.TYPES.CONV_GROUP:v=l||d||"";break;default:v=""}var h,w,g,O;return n?(w=(h=v).toLocaleLowerCase(),g=n&&w.indexOf(n.toLocaleLowerCase()),O=h.split(new RegExp("(".concat(n,")"),"gi")),""===g?t(o,{}):r("div",{children:[n&&O.map((function(r,o){return r.toLowerCase()===n.toLowerCase()?t("span",e({style:{color:c}},{children:r}),o):t("span",{children:r},o)})),";"]})):v},d=function(e){var r=e.type,t=u(e).avatar,o=t;if(!t)switch(r){case a.TYPES.CONV_C2C:o=n;break;case a.TYPES.CONV_GROUP:default:o=i}return o};export{s as generateHighlightTitle,d as getDisplayImage,p as getDisplayTitle,l as getLatestMessagePreview,u as getMessageProfile};
|
package/dist/esm/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{useUIKit as e}from"@tencentcloud/uikit-base-component-react";import{Icon as r}from"../../Icon/Icon.js";import{IconTypes as n}from"../../Icon/type.js";import{Input as t}from"../../Input/Input.js";import a from"classnames";function c(c){var i=c.className,m=c.placeholder,p=c.clearable,s=c.value,l=c.onChange,u=c.prefix,f=void 0===u?o(r,{type:n.SEARCH,height:16,width:16}):u,h=c.onFocus,v=c.onBlur,I=e().t;return o(t,{className:a("uikit-conversation-search-input",i),placeholder:m||I("TUIConversation.Search"),clearable:p,value:s,onChange:l,onFocus:h,onBlur:v,prefix:f})}export{c as ConversationSearchInput};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import o from"react";import"@tencentcloud/tui-core";import"react-i18next";import
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import o from"react";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as l}from"../../context/ChatStateContext.js";import{TUIMessageContextProvider as s}from"../../context/MessageContext.js";import{useComponentContext as n}from"../../context/ComponentContext.js";import"@tencentcloud/chat-uikit-engine";import{useMessageHandler as i}from"./hooks/useMessageHandler.js";import"@tencentcloud/chat";import"../../constants.js";import"date-fns";import"date-fns/locale";import"../Icon/config.js";import"../Icon/type.js";import{TUIMessageDefault as m}from"./MessageDefault.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,c=o.handleDelete,v=o.CustemElement,f=o.TextElement,p=o.ImageElement,E=o.VideoElement,h=o.AudioElement,x=o.FileElement,M=o.MergerElement,w=o.LocationElement,C=o.FaceElement,j=o.className,P=o.filter,S=o.isShowTime,A=o.isShowRead,N=o.plugin,T=o.prefix,I=o.suffix,D=o.customName,F=o.showAvatar,L=o.showName,R=o.customAvatar,V=o.isShowProgress,k=o.Progress,U=n(),b=U.MessagePlugins,y=U.MessageContext,H=l("TUIMessage").messageConfig,q=u||m,z=d||b||a,B=g||y||r,G=P||(null==H?void 0:H.filter),J=i||(null==H?void 0:H.message);G&&J&&G(J);var K={message:J,handleDelete:c||(null==H?void 0:H.handleDelete),CustemElement:v||(null==H?void 0:H.CustemElement),TextElement:f||(null==H?void 0:H.TextElement),ImageElement:p||(null==H?void 0:H.ImageElement),VideoElement:E||(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:S||(null==H?void 0:H.isShowTime),isShowRead:A||(null==H?void 0:H.isShowRead),plugin:N||(null==H?void 0:H.plugin),prefix:T||(null==H?void 0:H.prefix),suffix:I||(null==H?void 0:H.suffix),customName:D||(null==H?void 0:H.customName),showAvatar:F||(null==H?void 0:H.showAvatar),showName:L||(null==H?void 0:H.showName),customAvatar:R||(null==H?void 0:H.customAvatar),isShowProgress:V||(null==H?void 0:H.isShowProgress),Progress:k||(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 n,jsxs as t}from"react/jsx-runtime";import r,{useState as o,useRef as c,useCallback as i,useEffect as u}from"react";import"@tencentcloud/tui-core";import"react-i18next";import
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as n,jsxs as t}from"react/jsx-runtime";import r,{useState as o,useRef as c,useCallback as i,useEffect as u}from"react";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as a}from"../../context/ChatStateContext.js";import{useTUIChatActionContext as s}from"../../context/ChatActionContext.js";import"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";import{Icon as l}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";function m(r){var m=r.context,p=r.message,v=r.children,f=s().setAudioSource,h=a("MessageAudioWithContext").audioSource,x=o(0),g=x[0],C=x[1],j=c(null),E=o(!1),y=E[0],I=E[1],L=i((function(){h&&h!==(null==j?void 0:j.current)&&(h.pause(),h.currentTime=0,f&&f(null)),(null==j?void 0:j.current)&&(j.current.paused?(j.current.play(),I(!0),f&&f(j.current)):(j.current.pause(),N()))}),[j,h]),k=function(){I(!1)},N=function(){f&&f(null),j.current&&(j.current.currentTime=0),k()};return u((function(){return(null==j?void 0:j.current)&&(j.current.addEventListener("pause",k),j.current.addEventListener("ended",N),j.current.addEventListener("canplay",(function(){var e;C(parseInt("".concat(null===(e=j.current)||void 0===e?void 0:e.duration),10))}))),function(){(null==j?void 0:j.current)&&(j.current.removeEventListener("pause",k),j.current.removeEventListener("ended",N))}}),[j]),t("div",e({className:"message-audio"},{children:[t("div",e({className:"message-audio-content message-audio-".concat(null==p?void 0:p.flow)},{children:[n(l,{className:"".concat(null==p?void 0:p.flow," ").concat(y?"playing":""),type:d.VOICE,width:16,height:16,onClick:L}),n("span",{children:"".concat(g,"s")})]})),n("audio",e({src:null==m?void 0:m.url,ref:j,controls:!0,className:"message-audio-none"},{children:n("track",{kind:"captions"})})),v]}))}var p=r.memo(m);function v(t){return n(p,e({},t))}export{v as MessageAudio};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,Fragment as r}from"react/jsx-runtime";import"tslib";import"react";import"@tencentcloud/tui-core";import"react-i18next";import
|
|
1
|
+
import{jsx as t,Fragment as r}from"react/jsx-runtime";import"tslib";import"react";import"@tencentcloud/tui-core";import"react-i18next";import{messageShowType as o}from"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";import{Avatar as e}from"../Avatar/Avatar.js";import{handleDisplayAvatar as i}from"../utils.js";function a(a){a.className;var m=a.CustomAvatar,n=a.message,s=a.showType;return(s===o.ALL||(null==n?void 0:n.flow)===s)&&s!==o.NONE?m||t(e,{size:32,image:i(null==n?void 0:n.avatar)}):t(r,{})}export{a as MessageAvatar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import s,{useState as n,useEffect as i}from"react";import l from"@tencentcloud/chat";import{MESSAGE_STATUS as a}from"../../constants.js";import"@tencentcloud/tui-core";import"react-i18next";import
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import s,{useState as n,useEffect as i}from"react";import l from"@tencentcloud/chat";import{MESSAGE_STATUS as a}from"../../constants.js";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as c}from"../../context/ChatStateContext.js";import{useTUIChatActionContext as r}from"../../context/ChatActionContext.js";import"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";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(s){var p=s.message,b=s.children,v=s.Context,f=s.Plugins,h=n(!1),I=h[0],x=h[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 o("div",e({className:"meesage-bubble"},{children:[o("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:[o("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&&o("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:I&&t(f,{message:p})}))]})),o("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=s.memo(p);function v(o){return t(b,e({},o))}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
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import o from"react";import r from"@tencentcloud/chat";import{MessageAudio as m}from"./MessageAudio.js";import{MessageCustom as s}from"./MessageCustom.js";import{MessageFace as i}from"./MessageFace.js";import{MessageFile as n}from"./MessageFile.js";import{MessageImage as a}from"./MessageImage.js";import{MessageLocation as E}from"./MessageLocation.js";import{MessageMerger as M}from"./MessageMerger.js";import{MessageText as S}from"./MessageText.js";import{MessageVideo as p}from"./MessageVideo.js";import"@tencentcloud/uikit-base-component-react";import"@tencentcloud/chat-uikit-engine";import"../../constants.js";import"date-fns";import"date-fns/locale";import"../Icon/config.js";import"../Icon/type.js";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIMessageContext as c}from"../../context/MessageContext.js";import"../../store/UIManagerStore.js";import{useMessageContextHandler as T}from"./hooks/useMessageContextHandler.js";import{MessageStatus as g}from"./MessageStatus.js";var l,G=((l={})[r.TYPES.MSG_TEXT]=S,l[r.TYPES.MSG_FACE]=i,l[r.TYPES.MSG_IMAGE]=a,l[r.TYPES.MSG_AUDIO]=m,l[r.TYPES.MSG_VIDEO]=p,l[r.TYPES.MSG_FILE]=n,l[r.TYPES.MSG_CUSTOM]=s,l[r.TYPES.MSG_MERGER]=M,l[r.TYPES.MSG_LOCATION]=E,l);function f(o){var m,s=o.message,i=T({message:s}).context,n=c("MessageCustom"),a=n.CustemElement,E=n.TextElement,M=n.FaceElement,S=n.ImageElement,p=n.AudioElement,l=n.VideoElement,f=n.FileElement,u=n.MergerElement,P=n.LocationElement,Y=((m={})[r.TYPES.MSG_TEXT]=E,m[r.TYPES.MSG_FACE]=M,m[r.TYPES.MSG_IMAGE]=S,m[r.TYPES.MSG_AUDIO]=p,m[r.TYPES.MSG_VIDEO]=l,m[r.TYPES.MSG_FILE]=f,m[r.TYPES.MSG_CUSTOM]=a,m[r.TYPES.MSG_MERGER]=u,m[r.TYPES.MSG_LOCATION]=P,m),_=(null==s?void 0:s.type)&&(Y[s.type]||G[s.type]);return _&&t(_,e({context:i,message:s},{children:t(g,{message:s})}))}var u=o.memo(f);function P(o){return t(u,e({},o))}export{P as MessageContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsx as e,jsxs as r,Fragment as o}from"react/jsx-runtime";import n from"react";import l from"@tencentcloud/chat";import{
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e,jsxs as r,Fragment as o}from"react/jsx-runtime";import n from"react";import l from"@tencentcloud/chat";import{useUIKit as i}from"@tencentcloud/uikit-base-component-react";import{JSONStringToParse as a}from"../utils.js";import{isCallMessage as u}from"./utils/index.js";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatActionContext as c}from"../../context/ChatActionContext.js";import"../../context/MessageContext.js";import{useComponentContext as m}from"../../context/ComponentContext.js";import"@tencentcloud/chat-uikit-engine";import{useUIManagerStore as s}from"../../store/UIManagerStore.js";import{CallMessage as d}from"@tencentcloud/call-uikit-react";import{startCall as p}from"../Chat/utils.js";function v(n){var v=n.context,f=n.message,g=n.children,C=i().t,h=c().callButtonClicked,x=m().MessageCustomPlugins,y=s().conversation;return r("div",t({className:"bubble message-custom bubble-".concat(null==f?void 0:f.flow," ").concat((null==f?void 0:f.conversationType)===l.TYPES.CONV_GROUP?"group":"")},{children:[function(n){if("Hyperlink"===n.data){var l=a(null==n?void 0:n.extension);if(null==l?void 0:l.item)return null==l?void 0:l.item.map((function(r){return e("a",t({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(o,{children:[l.title," ",e("a",t({target:"_blank",href:null==i?void 0:i.value,rel:"noreferrer"},{children:i.key}),null==i?void 0:i.value)]})}}if("group_create"===n.data)return"".concat((null==f?void 0:f.nick)||(null==f?void 0:f.from)," Create a group");var c=a(n.data);if(1===(null==c?void 0:c.chatbotPlugin)&&15===(null==c?void 0:c.src)&&("welcome_msg"===(null==c?void 0:c.subtype)||"clarify_msg"===(null==c?void 0:c.subtype)))return e(x,{data:a(n.data).content});if("C2C"===(null==y?void 0:y.type)&&f&&u(f)){var m=null==y?void 0:y.type,s=null==y?void 0:y.userProfile.userID;return e(d,{callType:m,message:f,onClick:function(t){var e=t.callMediaType;return p({callType:m,callMediaType:e,userIDList:[s],callButtonClicked:h})}})}return"[".concat(C("TUIChat.Custom message"),"]")}(null==v?void 0:v.custom),g]}))}var f=n.memo(v);function g(r){return e(f,t({},r))}export{g as MessageCustom};
|
|
@@ -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 i}from"./MessageBubble.js";import{MessageTip as m}from"./MessageTip.js";import"@tencentcloud/tui-core";import"react-i18next";import
|
|
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 i}from"./MessageBubble.js";import{MessageTip as m}from"./MessageTip.js";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIMessageContext as n,messageShowType as r}from"../../context/MessageContext.js";import{useComponentContext as l}from"../../context/ComponentContext.js";import"@tencentcloud/chat-uikit-engine";import{MessageSystem as c}from"./MessageSystem.js";import{MessageRevoke as u}from"./MessageRevoke.js";import{MessageName as d}from"./MessageName.js";import{MessageAvatar as g}from"./MessageAvatar.js";function p(t){var p=t.message,v=t.MessageContext,f=t.MessagePlugins,M=t.className,P=l(),S=P.MessageContext,T=P.MessagePlugins,x=n("TUIMessage"),N=x.prefix,_=x.suffix,h=x.customName,C=x.showAvatar,G=void 0===C?r.IN:C,I=x.showName,j=void 0===I?r.IN:I,R=x.customAvatar,y=v||S,E=f||T;return o("div",e({className:"message-default\n ".concat((null==p?void 0:p.type)===a.TYPES.MSG_GRP_TIP||(null==p?void 0:p.isRevoked)?"tip":null==p?void 0:p.flow,"\n ").concat(M,"\n ")},{children:[(null==p?void 0:p.type)===a.TYPES.MSG_GRP_TIP&&s(m,{message:p}),(null==p?void 0:p.type)===a.TYPES.MSG_GRP_SYS_NOTICE&&s(c,{message:p}),(null==p?void 0:p.isRevoked)&&s(u,{message:p}),(null==p?void 0:p.type)!==a.TYPES.MSG_GRP_TIP&&(null==p?void 0:p.type)!==a.TYPES.MSG_GRP_SYS_NOTICE&&!(null==p?void 0:p.isRevoked)&&o("div",e({className:"".concat(null==p?void 0:p.flow)},{children:[N,p&&s(g,{message:p,CustomAvatar:R,showType:G}),o("main",e({"data-message-id":null==p?void 0:p.ID,className:"content"},{children:[s(d,{message:p,CustomName:h,showType:j}),s(i,e({message:p,Context:y,Plugins:E},{children:s(y,{message:p})}))]})),_]}),null==p?void 0:p.ID)]}))}var v=t.memo(p);function f(o){return o.message,s(v,e({},o))}export{f as TUIMessageDefault};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsx as e,Fragment as o}from"react/jsx-runtime";import n from"@tencentcloud/chat";import"react";import"@tencentcloud/tui-core";import"react-i18next";import
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e,Fragment as o}from"react/jsx-runtime";import n from"@tencentcloud/chat";import"react";import"@tencentcloud/tui-core";import"react-i18next";import{messageShowType as i}from"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";function r(r){r.className;var l=r.CustomName,m=r.message,c=r.showType;return(c===i.ALL||(null==m?void 0:m.flow)===c)&&(null==m?void 0:m.conversationType)===n.TYPES.CONV_GROUP&&c!==i.NONE?l||e("label",t({htmlFor:"content",className:"text-ellipsis name"},{children:(null==m?void 0:m.nick)||(null==m?void 0:m.from)})):e(o,{})}export{r as MessageName};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as o,jsx as l}from"react/jsx-runtime";import{useState as s,useRef as i}from"react";import{
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as o,jsx as l}from"react/jsx-runtime";import{useState as s,useRef as i}from"react";import{useUIKit as n}from"@tencentcloud/uikit-base-component-react";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"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as c}from"../../context/ChatStateContext.js";import{useTUIMessageContext as u}from"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";import{useMessageHandler as h}from"./hooks/useMessageHandler.js";import{MESSAGE_STATUS as v,MESSAGE_FLOW as p}from"../../constants.js";import"date-fns";import"date-fns/locale";import{useMessagePluginElement as g}from"./hooks/useMessagePluginElement.js";var m;function f(m){var f,M,S,w,y,C,T=m.plugins,x=m.showNumber,E=m.MoreIcon,N=m.config,U=n().t,I=s(""),k=I[0];I[1];var R=s({}),j=R[0],b=R[1],q=i(),O=u("MessagePlugins"),P=O.message,D=O.plugin,F=c("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==N?void 0:N.quote),null===(f=null==D?void 0:D.config)||void 0===f?void 0:f.quote),forward:e(e({isShow:!0},null==N?void 0:N.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==N?void 0:N.copy),null===(S=null==D?void 0:D.config)||void 0===S?void 0:S.copy),delete:e(e({isShow:!0},null==N?void 0:N.delete),null===(w=null==D?void 0:D.config)||void 0===w?void 0:w.delete),revoke:e(e({isShow:!0},null==N?void 0:N.revoke),null===(y=null==D?void 0:D.config)||void 0===y?void 0:y.revoke),resend:e(e({isShow:!0},null==N?void 0:N.resend),null===(C=null==D?void 0:D.config)||void 0===C?void 0:C.resend)},Q=g({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:U("TUIChat.Recall")}),l(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===p.OUT,relateMessageType:H.revoke.relateMessageType}),X=g({children:o("div",e({className:"message-plugin-item"},{children:[l("span",e({className:"del"},{children:U("TUIChat.Delete")})),l(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}),_=g({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:U("TUIChat.Reference")}),l(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=g({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:U("TUIChat.Copy")}),l(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=g({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:U("TUIChat.Resend")}),l(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=g({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:U("TUIChat.Forward")}),l(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=E||(null==D?void 0:D.MoreIcon)||l(a,{className:"icon-more",width:16,height:16,type:d.MORE}),oe=x||(null==D?void 0:D.showNumber)||0;return(null==P?void 0:P.status)!==v.UNSEND&&l(r,{className:"message-plugin",customClass:k,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,l=e.x<e.width||e.left;b({position:"fixed",left:"".concat(l?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 t}from"tslib";import{jsx as e,Fragment as o,jsxs as r}from"react/jsx-runtime";import s,{useState as n,useEffect as i}from"react";import a from"@tencentcloud/chat";import{MESSAGE_STATUS as c}from"../../constants.js";import"@tencentcloud/tui-core";import"react-i18next";import
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e,Fragment as o,jsxs as r}from"react/jsx-runtime";import s,{useState as n,useEffect as i}from"react";import a from"@tencentcloud/chat";import{MESSAGE_STATUS as c}from"../../constants.js";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as l}from"../../context/ChatStateContext.js";import{useTUIMessageContext as m}from"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";function u(s){var u=s.message,p=s.children,d=s.Progress,g=s.isShow,v=void 0!==g&&g,f=n(),h=f[0],x=f[1],S=n(0),P=S[0],M=S[1],E=l("MessageProgressWithContext").uploadPendingMessageList,C=m("MessageProgressWithContext"),I=C.isShowProgress,j=void 0!==I&&I,y=C.Progress,D=d||y,G=v||j;return i((function(){E&&E.length>0&&E.map((function(t){return(null==t?void 0:t.ID)===(null==u?void 0:u.ID)&&(x(t),(null==t?void 0:t.progress)&&M(t.progress)),t}))}),[E]),G?D&&h?e(D,{message:h}):!((null==u?void 0:u.type)!==a.TYPES.MSG_IMAGE&&(null==u?void 0:u.type)!==a.TYPES.MSG_VIDEO&&(null==u?void 0:u.type)!==a.TYPES.MSG_FILE||(null==u?void 0:u.status)!==c.UNSEND)&&r("div",t({className:"progress-box"},{children:[e("span",{className:"progress",style:{width:"".concat(100*P,"%")}}),p]})):e(o,{})}var p=s.memo(u);function d(o){return e(p,t({},o))}export{d 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
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e,jsxs as o}from"react/jsx-runtime";import n,{useCallback as i}from"react";import{useUIKit as r}from"@tencentcloud/uikit-base-component-react";import a from"@tencentcloud/chat";import{MESSAGE_OPERATE as l,MESSAGE_FLOW as c}from"../../constants.js";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatActionContext as m}from"../../context/ChatActionContext.js";import"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";function s(n){var s=n.message,u=r().t,p=m().operateMessage,d=i((function(){var t;p&&s&&p(((t={})[l.REVOKE]=s,t))}),[p]);return o("div",t({className:"bubble message-system message-revoke"},{children:[(null==s?void 0:s.flow)===c.IN&&e("span",{children:(null==s?void 0:s.nick)||(null==s?void 0:s.from)}),(null==s?void 0:s.flow)!==c.IN&&e("span",t({style:{marginRight:"5px"}},{children:u("TUIChat.You")})),e("span",t({style:{marginRight:"5px"}},{children:u("TUIChat.recalled a message")})),(null==s?void 0:s.flow)===c.OUT&&(null==s?void 0:s.type)===a.TYPES.MSG_TEXT&&e("span",t({className:"edit",role:"button",tabIndex:0,onClick:d},{children:u("TUIChat.Re-edit")}))]}))}var u=n.memo(s);function p(o){return e(u,t({},o))}export{p as MessageRevoke};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import i from"react";import{useUIKit as o}from"
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import i from"react";import{useUIKit as o}from"@tencentcloud/uikit-base-component-react";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIMessageContext as r}from"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";import{getTimeStamp as m}from"../utils.js";function n(i){var n=i.message,s=o("TUIChat").language,a=r("MessageStatustWithContext").isShowTime,c=(void 0===a||a)&&e("div",t({className:"time"},{children:(null==n?void 0:n.time)?m(1e3*n.time,s):0}));return e("div",t({className:"message-status"},{children:c}))}var s=i.memo(n);function a(i){return e(s,t({},i))}export{a as MessageStatus};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import o from"react";import"react
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import o from"react";import"@tencentcloud/uikit-base-component-react";import"@tencentcloud/chat-uikit-engine";import"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat";import"../Icon/config.js";import"../Icon/type.js";import"@tencentcloud/tui-core";import"react-i18next";import"../../context/MessageContext.js";import"../../store/UIManagerStore.js";import{useMessageContextHandler as r}from"./hooks/useMessageContextHandler.js";function n(o){var n=o.message,i=r({message:n}).context;return e("div",t({className:"bubble message-system"},{children:e("div",{children:i})}))}var i=o.memo(n);function s(o){return e(i,t({},o))}export{s as MessageSystem};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsx as e,jsxs as n}from"react/jsx-runtime";import o from"react";import c from"@tencentcloud/chat";import"@tencentcloud/tui-core";import"react-i18next";import
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e,jsxs as n}from"react/jsx-runtime";import o from"react";import c from"@tencentcloud/chat";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as i}from"../../context/ChatStateContext.js";import"../../context/MessageContext.js";import{useComponentContext as r}from"../../context/ComponentContext.js";import"@tencentcloud/chat-uikit-engine";function s(o){var s=o.context,a=o.message,l=o.children,m=r().MessageTextPlugins,u=i("MessageText").firstSendMessage;return m&&"in"===(null==a?void 0:a.flow)&&u&&(null==u?void 0:u.time)<=(null==a?void 0:a.time)?e("div",t({className:"bubble message-text bubble-".concat(a.flow," ").concat((null==a?void 0:a.conversationType)===c.TYPES.CONV_GROUP?"group":"")},{children:e(m,{data:a})})):e("div",t({className:"bubble message-text bubble-".concat(null==a?void 0:a.flow," ").concat((null==a?void 0:a.conversationType)===c.TYPES.CONV_GROUP?"group":"")},{children:n("div",t({className:"message-text-content"},{children:[null==s?void 0:s.text.map((function(n,o){var c=a&&(null==a?void 0:a.ID)+o;return"text"===n.name?e("p",t({className:"message-text-content-p"},{children:n.text}),n.src+c):e("img",{className:"text-img",src:n.src,alt:""},n.src+c)})),l]}))}))}var a=o.memo(s);function l(n){return e(a,t({},n))}export{l as MessageText};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import o from"react";import"react
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import o from"react";import"@tencentcloud/uikit-base-component-react";import"@tencentcloud/chat-uikit-engine";import"../../constants.js";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat";import"../Icon/config.js";import"../Icon/type.js";import"@tencentcloud/tui-core";import"react-i18next";import"../../context/MessageContext.js";import"../../store/UIManagerStore.js";import{useMessageContextHandler as r}from"./hooks/useMessageContextHandler.js";function n(o){var n=o.message,i=r({message:n}).context;return e("div",t({className:"bubble message-tip"},{children:i.text}))}var i=o.memo(n);function m(o){return e(i,t({},o))}export{m as MessageTip};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from"tslib";import{useCallback as r}from"react";import{
|
|
1
|
+
import{__awaiter as e,__generator as t}from"tslib";import{useCallback as r}from"react";import{useUIKit as o}from"@tencentcloud/uikit-base-component-react";import{TUIStore as n}from"@tencentcloud/chat-uikit-engine";import{MESSAGE_FLOW as i,MESSAGE_OPERATE as a}from"../../../constants.js";import{enableSampleTaskStatus as s}from"../../utils.js";import"react/jsx-runtime";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatActionContext as u}from"../../../context/ChatActionContext.js";import"../../../context/MessageContext.js";import{useUIManagerStore as c}from"../../../store/UIManagerStore.js";import{Toast as l}from"../../Toast/index.js";import{transformTextWithEmojiKeyToName as d}from"../utils/decodeText.js";var v=function(v){var m=v.message,f=v.handleError,p=u(),g=p.editLocalMessage,h=p.operateMessage;p.revokeMessage;var M=o().t,x=c().chat,y=r((function(r){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return r.preventDefault(),m?(n.getMessageModel(null==m?void 0:m.ID).deleteMessage(),[2]):[2]}))}))}),[m]),D=r((function(r){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return r.preventDefault(),m?(n.getMessageModel(null==m?void 0:m.ID).revokeMessage().then((function(){g&&g(m),s("revokeMessage")})).catch((function(e){if(!f){var t=m.flow===i.OUT?M("TUIChat.The message recall exceeded the time limit (default 2 minutes)"):M("TUIChat.Error revoke Message");throw l({text:t,type:"error"}),new Error(e)}f({functionName:"revokeMessage",error:e})})),[2]):[2]}))}))}),[m]),C=r((function(e){var t;e.preventDefault(),(null==m?void 0:m.ID)&&x&&h&&h(((t={})[a.QUOTE]=m,t))}),[m]),b=r((function(e){e.preventDefault();var t=d(null==m?void 0:m.payload.text);if(navigator.clipboard)navigator.clipboard.writeText(t);else{var r=document.createElement("textarea");document.body.appendChild(r),r.style.position="fixed",r.style.clip="rect(0 0 0 0)",r.style.top="10px",r.value=t,r.select(),document.execCommand("copy",!0),document.body.removeChild(r)}}),[m]),j=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=m)?[4,x.resendMessage(m)]:[3,2];case 1:r=t.sent(),t.label=2;case 2:return e=r,g&&g(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 l({text:o,type:"error"}),new Error(o);return f({functionName:"resendMessage",error:o}),[3,4];case 4:return[2]}}))}))}),[m]),k=r((function(r){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){return r.preventDefault(),(null==m?void 0:m.ID)&&x&&h?(h(((e={})[a.FORWARD]=m,e)),[2]):[2]}))}))}),[m]);return{handleDelMessage:y,handleRevokeMessage:D,handleReplyMessage:C,handleCopyMessage:b,handleResendMessage:j,handleForWardMessage:k}};export{v as useMessageHandler};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useState as e,useLayoutEffect as t}from"react";import s from"@tencentcloud/chat";import
|
|
1
|
+
import{useState as e,useLayoutEffect as t}from"react";import s from"@tencentcloud/chat";import"tslib";import"react/jsx-runtime";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as o}from"../../../context/ChatStateContext.js";import"../../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";import{useUIManagerStore as r}from"../../../store/UIManagerStore.js";import{JSONStringToParse as a}from"../../utils.js";var n,i=((n={})[s.TYPES.MSG_TEXT]=1,n[s.TYPES.MSG_FACE]=8,n[s.TYPES.MSG_IMAGE]=3,n[s.TYPES.MSG_AUDIO]=4,n[s.TYPES.MSG_VIDEO]=5,n[s.TYPES.MSG_FILE]=6,n[s.TYPES.MSG_CUSTOM]=2,n),l=function(n){var l=n.message,m=e(null),u=m[0],c=m[1],p=e(""),S=p[0],g=p[1],d=e(null),M=d[0],v=d[1],E=e(""),T=E[0],f=E[1],I=r().chat,D=o("useMessageReply").messageList;t((function(){l&&G(l)}),[l]);var G=function(e){if(null==e?void 0:e.cloudCustomData){var t=a(null==e?void 0:e.cloudCustomData),o=(null==t?void 0:t.messageReply)||"";if(o){c(o),g(null==o?void 0:o.messageSender),f(null==o?void 0:o.messageID);var r=null==D?void 0:D.filter((function(e){var t=e.ID===(null==o?void 0:o.messageID),r=t&&i[e.type]===o.messageType,a=e.type!==s.TYPES.MSG_TEXT||e.payload.text===o.messageAbstract;return t&&r&&a}));v(r[0]||I.findMessage(null==o?void 0:o.messageID))}}};return{messageReply:u,sender:S,replyMessage:M,messageID:T,message:l}};export{l as useMessageReply};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{emojiUrlMap as t}from"./emojiMap.js";import{i18next as r}from"@tencentcloud/uikit-base-component-react";function n(n){if(!n)return"";var e=/(\[.+?\])/g,a=n;return e.test(n)&&(a=n.replace(e,(function(n){return t[n]?r.t("Emoji.".concat(n)):n}))),a}var e={};function a(t){var n;if(!t)return"";var a=/(\[.+?\])/g,i=t;if(a.test(t)){var o=r.language;if(!e[o]){var u=r.getDataByLanguage(o);(null===(n=null==u?void 0:u.translation)||void 0===n?void 0:n.Emoji)&&(e[o]=Object.fromEntries(Object.entries(u.translation.Emoji).map((function(t){var r=t[0];return[t[1],r]}))))}i=t.replace(a,(function(t){var r;return null!==(r=e[o][t])&&void 0!==r?r:t}))}return i}export{n as transformTextWithEmojiKeyToName,a as transformTextWithEmojiNameToKey};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var i="https://web.sdk.qcloud.com/im/assets/emoji-plugin/",o={"[TUIEmoji_Expect]":"emoji_0@2x.png","[TUIEmoji_Blink]":"emoji_1@2x.png","[TUIEmoji_Guffaw]":"emoji_2@2x.png","[TUIEmoji_KindSmile]":"emoji_3@2x.png","[TUIEmoji_Haha]":"emoji_4@2x.png","[TUIEmoji_Cheerful]":"emoji_5@2x.png","[TUIEmoji_Smile]":"emoji_6@2x.png","[TUIEmoji_Sorrow]":"emoji_7@2x.png","[TUIEmoji_Speechless]":"emoji_8@2x.png","[TUIEmoji_Amazed]":"emoji_9@2x.png","[TUIEmoji_Complacent]":"emoji_10@2x.png","[TUIEmoji_Lustful]":"emoji_11@2x.png","[TUIEmoji_Stareyes]":"emoji_12@2x.png","[TUIEmoji_Giggle]":"emoji_13@2x.png","[TUIEmoji_Daemon]":"emoji_14@2x.png","[TUIEmoji_Rage]":"emoji_15@2x.png","[TUIEmoji_Yawn]":"emoji_16@2x.png","[TUIEmoji_TearsLaugh]":"emoji_17@2x.png","[TUIEmoji_Silly]":"emoji_18@2x.png","[TUIEmoji_Wail]":"emoji_19@2x.png","[TUIEmoji_Kiss]":"emoji_20@2x.png","[TUIEmoji_Trapped]":"emoji_21@2x.png","[TUIEmoji_Fear]":"emoji_22@2x.png","[TUIEmoji_BareTeeth]":"emoji_23@2x.png","[TUIEmoji_FlareUp]":"emoji_24@2x.png","[TUIEmoji_Tact]":"emoji_25@2x.png","[TUIEmoji_Shit]":"emoji_26@2x.png","[TUIEmoji_ShutUp]":"emoji_27@2x.png","[TUIEmoji_Sigh]":"emoji_28@2x.png","[TUIEmoji_Hehe]":"emoji_29@2x.png","[TUIEmoji_Silent]":"emoji_30@2x.png","[TUIEmoji_Skull]":"emoji_31@2x.png","[TUIEmoji_Mask]":"emoji_32@2x.png","[TUIEmoji_Beer]":"emoji_33@2x.png","[TUIEmoji_Cake]":"emoji_34@2x.png","[TUIEmoji_RedPacket]":"emoji_35@2x.png","[TUIEmoji_Bombs]":"emoji_36@2x.png","[TUIEmoji_Ai]":"emoji_37@2x.png","[TUIEmoji_Celebrate]":"emoji_38@2x.png","[TUIEmoji_Bless]":"emoji_39@2x.png","[TUIEmoji_Flower]":"emoji_40@2x.png","[TUIEmoji_Watermelon]":"emoji_41@2x.png","[TUIEmoji_Cow]":"emoji_42@2x.png","[TUIEmoji_Fool]":"emoji_43@2x.png","[TUIEmoji_Surprised]":"emoji_44@2x.png","[TUIEmoji_Askance]":"emoji_45@2x.png","[TUIEmoji_Monster]":"emoji_46@2x.png","[TUIEmoji_Pig]":"emoji_47@2x.png","[TUIEmoji_Coffee]":"emoji_48@2x.png","[TUIEmoji_Ok]":"emoji_49@2x.png","[TUIEmoji_Heart]":"emoji_50@2x.png","[TUIEmoji_Sun]":"emoji_51@2x.png","[TUIEmoji_Moon]":"emoji_52@2x.png","[TUIEmoji_Star]":"emoji_53@2x.png","[TUIEmoji_Rich]":"emoji_54@2x.png","[TUIEmoji_Fortune]":"emoji_55@2x.png","[TUIEmoji_857]":"emoji_56@2x.png","[TUIEmoji_666]":"emoji_57@2x.png","[TUIEmoji_Prohibit]":"emoji_58@2x.png","[TUIEmoji_Convinced]":"emoji_59@2x.png","[TUIEmoji_Knife]":"emoji_60@2x.png","[TUIEmoji_Like]":"emoji_61@2x.png"};export{i as emojiBaseUrl,o as emojiUrlMap};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as a}from"tslib";import t from"@tencentcloud/chat";import{
|
|
1
|
+
import{__assign as a}from"tslib";import t from"@tencentcloud/chat";import{MESSAGE_STATUS as e}from"../../../constants.js";import{JSONStringToParse as c}from"../../utils.js";function o(a){var t=a.split(".");return t[t.length-1]}function n(a){var e,c,n,s,r,i={message:a,text:""},l=a.nick||(null===(e=null==a?void 0:a.payload)||void 0===e?void 0:e.userIDList.join(","));switch((null===(n=null===(c=null==a?void 0:a.payload)||void 0===c?void 0:c.memberList)||void 0===n?void 0:n.length)>0&&(l="",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 l+="".concat((null==a?void 0:a.nick)||(null==a?void 0:a.userID),","),a})),l=l.slice(0,-1)),a.payload.operationType){case t.TYPES.GRP_TIP_MBR_JOIN:i.text="".concat(l," ").concat(o("message.tip.Join in group"));break;case t.TYPES.GRP_TIP_MBR_QUIT:i.text="".concat(o("message.tip.member"),":").concat(l," ").concat(o("message.tip.quit group"));break;case t.TYPES.GRP_TIP_MBR_KICKED_OUT:i.text="".concat(o("message.tip.member"),":").concat(l," ").concat(o("message.tip.by")," ").concat(a.payload.operatorID," ").concat(o("message.tip.kicked out of group"));break;case t.TYPES.GRP_TIP_MBR_SET_ADMIN:i.text="".concat(o("message.tip.member"),":").concat(l," ").concat(o("message.tip.become admin"));break;case t.TYPES.GRP_TIP_MBR_CANCELED_ADMIN:i.text="".concat(o("message.tip.member"),":").concat(l," ").concat(o("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,n="",s=Object.keys(e)[0];switch(s){case"muteAllMembers":n=e[s]?"".concat(o("message.tip.admin")," ").concat(c," ").concat(o("message.tip.enable all staff mute")):"".concat(o("message.tip.admin")," ").concat(c," ").concat(o("message.tip.unmute everyone"));break;case"ownerID":n="".concat(e[s]," ").concat(o("message.tip.become the new owner"));break;case"groupName":n="".concat(c," ").concat(o("message.tip.modify group name")," ").concat(e[s]);break;case"notification":n="".concat(c," ").concat(o("message.tip.post a new announcement"))}return n}(a);break;case t.TYPES.GRP_TIP_MBR_PROFILE_UPDATED:a.payload.memberList.map((function(a){return a.muteTime>0?i.text="".concat(o("message.tip.member"),":").concat(a.userID).concat(o("message.tip.muted")):i.text="".concat(o("message.tip.member"),":").concat(a.userID).concat(o("message.tip.unmuted")),a}));break;default:i.text="[".concat(o("message.tip.reminder message"),"]")}return i}function s(a){return a.getMessageContent()}function r(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 i(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 l(a){return{progress:(null==a?void 0:a.status)===e.UNSEND&&a.progress,url:a.payload.imageInfoArray[1].url,message:a}}function p(a){var t,c;return{progress:(null==a?void 0:a.status)===e.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===(c=null==a?void 0:a.payload)||void 0===c?void 0:c.snapshotUrl,message:a}}function m(a){return{progress:(null==a?void 0:a.status)===e.UNSEND&&a.progress,url:a.payload.url,message:a,second:a.payload.second}}function u(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)===e.UNSEND&&a.progress,url:a.payload.fileUrl,message:a,name:a.payload.fileName,size:t}}function d(t){return a({message:t},t.payload)}function g(a){var t={},e={};try{t=c(a.payload.data)}catch(a){t={}}if(1!==t.businessID)return"";try{e=c(t.data)}catch(a){e={}}switch(t.actionType){case 1:return e.call_end>=0&&!t.groupID?"".concat(o("message.custom.talkTime"),":").concat(f(e.call_end)):t.groupID?"".concat(o("message.custom.groupCallEnd")):e.data&&"switchToAudio"===e.data.cmd?"".concat(o("message.custom.switchToAudioCall")):e.data&&"switchToVideo"===e.data.cmd?"".concat(o("message.custom.switchToVideoCall")):"".concat(o("message.custom.all"));case 2:return"".concat(o("message.custom.cancel"));case 3:return e.data&&"switchToAudio"===e.data.cmd?"".concat(o("message.custom.switchToAudioCall")):e.data&&"switchToVideo"===e.data.cmd?"".concat(o("message.custom.switchToVideoCall")):"".concat(o("message.custom.accepted"));case 4:return"".concat(o("message.custom.rejected"));case 5:return e.data&&"switchToAudio"===e.data.cmd?"".concat(o("message.custom.switchToAudioCall")):e.data&&"switchToVideo"===e.data.cmd?"".concat(o("message.custom.switchToVideoCall")):"".concat(o("message.custom.noResp"));default:return""}}function y(a){return{message:a,custom:g(a)||(null==a?void 0:a.payload)||"[".concat(o("message.custom.custom"),"]")}}function I(a){var t=a.payload.groupProfile.name||a.payload.groupProfile.groupID;switch(a.payload.operationType){case 1:return"".concat(a.payload.operatorID," ").concat(o("message.tip.申请加入群组"),":").concat(t);case 2:return"".concat(o("message.tip.成功加入群组"),":").concat(t);case 3:return"".concat(o("message.tip.申请加入群组"),":").concat(t," ").concat(o("message.tip.被拒绝"));case 4:return"".concat(o("message.tip.你被管理员")).concat(a.payload.operatorID," ").concat(o("message.tip.踢出群组"),":").concat(t);case 5:return"".concat(o("message.tip.群"),":").concat(t," ").concat(o("message.tip.被")," ").concat(a.payload.operatorID," ").concat(o("message.tip.解散"));case 6:return"".concat(a.payload.operatorID," ").concat(o("message.tip.创建群"),":").concat(t);case 7:case 12:return"".concat(a.payload.operatorID," ").concat(o("message.tip.邀请你加群"),":").concat(t);case 8:return"".concat(o("message.tip.你退出群组"),":").concat(t);case 9:return"".concat(o("message.tip.你被")).concat(a.payload.operatorID," ").concat(o("message.tip.设置为群"),":").concat(t," ").concat(o("message.tip.的管理员"));case 10:return"".concat(o("message.tip.你被")).concat(a.payload.operatorID," ").concat(o("message.tip.撤销群"),":").concat(t," ").concat(o("message.tip.的管理员身份"));case 13:return"".concat(a.payload.operatorID," ").concat(o("message.tip.同意加群"),":").concat(t);case 14:return"".concat(a.payload.operatorID," ").concat(o("message.tip.拒接加群"),":").concat(t);case 255:return"".concat(o("message.tip.自定义群系统通知"),": ").concat(a.payload.userDefinedField);default:return""}}function f(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}var v=function(a){var t,e=c(null===(t=null==a?void 0:a.payload)||void 0===t?void 0:t.data);if(1===(null==e?void 0:e.businessID)&&(null==e?void 0:e.data)&&"av_call"===c(e.data).businessID)return!0;return!1};export{g as extractCallingInfoFromMessage,f as formatTime,m as handleAudioMessageShowContext,y as handleCustomMessageShowContext,r as handleFaceMessageShowContext,u as handleFileMessageShowContext,l as handleImageMessageShowContext,i as handleLocationMessageShowContext,d as handleMergerMessageShowContext,s as handleTextMessageShowContext,n as handleTipMessageShowContext,p as handleVideoMessageShowContext,v as isCallMessage,I as translateGroupSystemNotice};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsxs as e,jsx as
|
|
1
|
+
import{__assign as t}from"tslib";import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useState as i}from"react";import{useUIKit as n}from"@tencentcloud/uikit-base-component-react";import{useTUIMessageInputContext as a}from"../../context/MessageInputContext.js";import{Icon as c}from"../Icon/Icon.js";import{IconTypes as r}from"../Icon/type.js";import{Popup as m}from"../Popup/index.js";import{emojiUrlMap as p,emojiBaseUrl as s}from"../MessageElement/utils/emojiMap.js";function l(){var l=i(!1),u=l[0],f=l[1],d=i(0),j=d[0];d[1];var g=i(""),h=g[0],x=g[1],I=n().t,M=function(){f(!u)},b=a("TUIMessageInputDefault"),k=b.onSelectEmoji,v=b.sendFaceMessage,E=function(t){var e={index:j,data:t.target.dataset.data};e.data&&(0===j?k&&k(e):(v&&v(e),M()))};return e("div",t({className:"emoji-picker input-plugin-popup"},{children:[o(c,{width:20,height:20,type:r.EMOJI,onClick:M}),o(m,t({className:"input-plugin-popup-box ".concat(h),show:u,close:M,handleVisible:function(t){x("".concat(!t.top&&"emoji-plugin-top"," ").concat(!t.left&&"emoji-plugin-right"))}},{children:o("ul",t({className:"face-list"},{children:0===j&&Object.keys(p).map((function(e){return o("li",t({role:"menuitem",className:"face-list-item",onClick:E},{children:o("img",{src:s+p[e],alt:I("Emoji.".concat(e)),"data-data":e})}),e)}))}))}))]}))}export{l as EmojiPicker};
|
|
@@ -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 i,useCallback 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 i,useCallback as n,useEffect as a}from"react";import{useUIKit as l}from"@tencentcloud/uikit-base-component-react";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatActionContext as c}from"../../context/ChatActionContext.js";import"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";import{Model as s}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"../../store/UIManagerStore.js";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,b=i([]),k=b[0],x=b[1],F=i([]),D=F[0],M=F[1],A=i(""),L=A[0],R=A[1],S=c().operateMessage,U=w(),y=U.message,T=U.sendForwardMessage,H=U.conversationList,z=void 0===H?[]:H,E=n((function(){var e;S&&S(((e={})[g.FORWARD]=null,e))}),[S]),P=z,O=function(e){e.checked?x(t(t([],k,!0),[e.value],!1)):x(k.filter((function(t){return t!==e.value})))};return a((function(){x([]),M([]),R("")}),[y]),y&&z.length>0&&o(s,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:L,onChange:function(e){var t,o;if(R(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(),i=null===(o=e.target)||void 0===o?void 0:o.value.toLocaleLowerCase();return r.includes(i)}));M(r)}else M([])},prefix:o(d,{type:m.SEARCH,height:16,width:16})})})),r("main",e({className:"tui-forward-main"},{children:[L&&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")}))]})),!L&&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:k.length>0&&(N=k,(null==N?void 0:N.map((function(e){return v(e)}))).toString())})),o("button",e({type:"button",className:"button",onClick:function(){I?I({list:k,message:y}):T(k),E()},disabled:0===k.length},{children:j("TUIChat.Forward")}))]}))]}))}))}export{C as Forward};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as i,__spreadArray as o}from"tslib";import{jsxs as n,jsx as e}from"react/jsx-runtime";import{useRef as l}from"react";import{
|
|
1
|
+
import{__assign as i,__spreadArray as o}from"tslib";import{jsxs as n,jsx as e}from"react/jsx-runtime";import{useRef as l}from"react";import{useUIKit as t}from"@tencentcloud/uikit-base-component-react";import{EmojiPicker as r}from"./EmojiPicker.js";import{Plugins as u}from"../Plugins/index.js";import{useUploadElement as c}from"./hooks/useUploadElement.js";import{MESSAGE_TYPE_NAME as d}from"../../constants.js";import{useTUIMessageInputContext as s}from"../../context/MessageInputContext.js";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as a}from"../../context/ChatStateContext.js";import"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";function p(){var p,m,v,g,f,h,C,I=s("TUIMessageInputDefault"),M=I.sendUploadMessage,k=I.pluginConfig,j=t().t,x=a("TUIMessageInput").TUIMessageInputConfig,P=(null==k?void 0:k.plugins)||(null===(p=null==x?void 0:x.pluginConfig)||void 0===p?void 0:p.plugins)||[],N=(null==k?void 0:k.showNumber)||(null===(m=null==x?void 0:x.pluginConfig)||void 0===m?void 0:m.showNumber)||1,U=(null==k?void 0:k.MoreIcon)||(null===(v=null==x?void 0:x.pluginConfig)||void 0===v?void 0:v.MoreIcon),b=function(i,o,n){return"boolean"==typeof i?i:"boolean"==typeof o?o:n},E=b(null==k?void 0:k.isEmojiPicker,null===(g=null==x?void 0:x.pluginConfig)||void 0===g?void 0:g.isEmojiPicker,!0),T=b(null==k?void 0:k.isImagePicker,null===(f=null==x?void 0:x.pluginConfig)||void 0===f?void 0:f.isImagePicker,!0),y=b(null==k?void 0:k.isVideoPicker,null===(h=null==x?void 0:x.pluginConfig)||void 0===h?void 0:h.isVideoPicker,!0),F=b(null==k?void 0:k.isFilePicker,null===(C=null==x?void 0:x.pluginConfig)||void 0===C?void 0:C.isFilePicker,!0),V=l(),w=T&&c({children:n("div",i({className:"input-plugin-item"},{children:[e("i",i({className:"iconfont input-icon"},{children:""})),e("span",{children:j("TUIChat.Image")})]})),type:"image",accept:"image/*",onChange:function(i){var o;(null===(o=null==V?void 0:V.current)||void 0===o?void 0:o.closeMore)&&V.current.closeMore(),M&&M({file:i},d.IMAGE)}}),D=y&&c({children:n("div",i({className:"input-plugin-item"},{children:[e("i",i({className:"iconfont input-icon"},{children:""})),e("span",{children:j("TUIChat.Video")})]})),type:"video",accept:"video/*",onChange:function(i){var o;(null===(o=null==V?void 0:V.current)||void 0===o?void 0:o.closeMore)&&V.current.closeMore(),M&&M({file:i},d.VIDEO)}}),A=F&&c({children:n("div",i({className:"input-plugin-item"},{children:[e("i",i({className:"iconfont input-icon"},{children:""})),e("span",{children:j("TUIChat.File")})]})),type:"file",accept:"file/*",onChange:function(i){var o;(null===(o=null==V?void 0:V.current)||void 0===o?void 0:o.closeMore)&&V.current.closeMore(),M&&M({file:i},d.FILE)}}),G=o([E&&e(r,{}),w,D,A],P,!0).filter((function(i){return i}));return e(u,{ref:V,plugins:G,showNumber:N,MoreIcon:U})}export{p as InputPluginsDefalut};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useCallback as n}from"react";import"@tencentcloud/tui-core";import"react-i18next";import
|
|
1
|
+
import{__assign as t}from"tslib";import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useCallback as n}from"react";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatActionContext as i}from"../../context/ChatActionContext.js";import"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as s}from"../Icon/type.js";import{MESSAGE_OPERATE as m}from"../../constants.js";import{useHandleQuoteMessage as c}from"./hooks/useHandleQuoteMessage.js";import{transformTextWithEmojiKeyToName as a}from"../MessageElement/utils/decodeText.js";function l(l){var u=l.message,p=i().operateMessage,d=c(u),f=d.cloudCustomData,h=d.message,g=n((function(){var t;p&&p(((t={})[m.QUOTE]=null,t))}),[p]),j=null==f?void 0:f.messageReply;return j&&e("div",t({className:"input-quote"},{children:[e("div",t({className:"input-quote-content"},{children:[o("label",t({htmlFor:"input-quote-content"},{children:(null==h?void 0:h.nick)||(null==h?void 0:h.from)})),o("span",{children:a(null==j?void 0:j.messageAbstract)})]})),o(r,{className:"icon",width:12,height:12,type:s.CLOSE,onClick:g})]}))}export{l as InputQuoteDefalut};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsx as e,jsxs as o}from"react/jsx-runtime";import n from"react";import s from"@tencentcloud/chat";import{TUIMessageInputContextProvider as i}from"../../context/MessageInputContext.js";import{useCreateMessageInputContext as r}from"./hooks/useCreateMessageInputContext.js";import{useMessageInputState as a}from"./hooks/useMessageInputState.js";import"@tencentcloud/chat-uikit-engine";import"../../constants.js";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as m}from"../../context/ChatStateContext.js";import"../../context/MessageContext.js";import{useComponentContext as u}from"../../context/ComponentContext.js";import"date-fns";import"date-fns/locale";import"../Icon/config.js";import"../Icon/type.js";import"./hooks/useHandleQuoteMessage.js";import{EmptyStateIndicator as p}from"../EmptyStateIndicator/EmptyStateIndicator.js";import{InputQuoteDefalut as
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e,jsxs as o}from"react/jsx-runtime";import n from"react";import s from"@tencentcloud/chat";import{TUIMessageInputContextProvider as i}from"../../context/MessageInputContext.js";import{useCreateMessageInputContext as r}from"./hooks/useCreateMessageInputContext.js";import{useMessageInputState as a}from"./hooks/useMessageInputState.js";import"@tencentcloud/chat-uikit-engine";import"@tencentcloud/uikit-base-component-react";import"../../constants.js";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as m}from"../../context/ChatStateContext.js";import"../../context/MessageContext.js";import{useComponentContext as u}from"../../context/ComponentContext.js";import"../../store/UIManagerStore.js";import"date-fns";import"date-fns/locale";import"../Icon/config.js";import"../Icon/type.js";import"./hooks/useHandleQuoteMessage.js";import{EmptyStateIndicator as p}from"../EmptyStateIndicator/EmptyStateIndicator.js";import{InputQuoteDefalut as c}from"./InputQuoteDefalut.js";import{TUIMessageInputDefault as l}from"./MessageInputDefault.js";import{InputPluginsDefalut as f}from"./InputPluginsDefalut.js";import{Forward as d}from"./Forward.js";import{Transmitter as I}from"./Transmitter.js";function g(o){var n=o.children,u=o.disabled,p=o.focus,c=o.pluginConfig,l=o.textareaRef,f=a(o),d=m("TUIMessageInput"),I=d.textareaRef,g=d.conversation,j=(null==g?void 0:g.type)===s.TYPES.CONV_SYSTEM,x=m("TUIMessageInput").TUIMessageInputConfig,M=p||(null==x?void 0:x.focus),v=r(t(t(t({},f),o),{textareaRef:l||(null==x?void 0:x.textareaRef)||I,disabled:u||(null==x?void 0:x.disabled)||j,focus:"boolean"!=typeof M||M,pluginConfig:c}));return e(i,t({value:v},{children:n}))}function j(n){var s=n.TUIMessageInput,i=n.InputPlugins,r=n.InputQuote,a=n.isTransmitter,j=n.className,x=m("TUIMessageInput").TUIMessageInputConfig,M=j||(null==x?void 0:x.className),v=a||(null==x?void 0:x.isTransmitter)||!1,C=u(),h=C.TUIMessageInput,T=C.InputPlugins,S=C.InputQuote,U=s||h||l,b=i||T||f||p,N=r||S||c;return e("div",t({className:"tui-message-input ".concat(M)},{children:o(g,t({},n,{children:[e(d,{}),e(N,{}),o("div",t({className:"tui-message-input-main"},{children:[o("div",t({className:"tui-message-input-box"},{children:[e(b,{}),e(U,{})]})),v&&e(I,{})]}))]}))}))}var x=n.memo(j);export{x as MessageInput};
|
|
@@ -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{
|
|
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{useUIKit as i}from"@tencentcloud/uikit-base-component-react";import{MESSAGE_OPERATE as a}from"../../constants.js";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as u}from"../../context/ChatStateContext.js";import"../../context/MessageContext.js";import{useTUIMessageInputContext as s}from"../../context/MessageInputContext.js";import"@tencentcloud/chat-uikit-engine";import{isPC as c}from"../../utils/env.js";import{transformTextWithEmojiKeyToName as l}from"../MessageElement/utils/decodeText.js";function d(){var d=s("TUIMessageInputDefault"),m=d.text,p=d.disabled,f=d.handleChange,v=d.handleKeyDown,x=d.handlePasete,g=d.textareaRef,h=d.focus,b=d.setText,E=d.setCursorPos,C=i().t,j=u("TUIMessageInputDefault").operateData;o((function(){j&&j[a.REVOKE]&&b&&b(l(j[a.REVOKE].payload.text))}),[j]),o((function(){var t,e;return h&&g&&g.current&&(g.current.autofocus=!0,c&&(null===(t=null==g?void 0:g.current)||void 0===t||t.focus({preventScroll:!0})),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 I=r(!1),D=I[0],M=I[1];return e("div",t({className:"input-box ".concat(p?"disabled":""," ").concat(D?"tui-kit-input-box--focus":"tui-kit-input-box--blur")},{children:[n("div",t({className:"input-visibility-content"},{children:m})),!p&&n("textarea",{placeholder:C("TUIChat.Enter a message"),rows:1,value:m,ref:g,onChange:f,onKeyDown:v,onFocus:function(){M(!0)},onBlur:function(t){!function(t){var e;E&&E({start:null===(e=null==t?void 0:t.target)||void 0===e?void 0:e.selectionStart,end:t.target.selectionEnd}),M(!1)}(t)}})]}))}export{d as TUIMessageInputDefault};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as e}from"react";import{
|
|
1
|
+
import{useCallback as e}from"react";import{useUIKit as t}from"@tencentcloud/uikit-base-component-react";import{TUIChatService as n}from"@tencentcloud/chat-uikit-engine";function a(a){a.textareaRef;var o=a.insertText,c=t().language;return{onSelectEmoji:e((function(e){o&&o(e.data)}),[o,c]),sendFaceMessage:e((function(e){n.sendFaceMessage({payload:e})}),[])}}export{a as useEmojiPicker};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e}from"tslib";import{useState as
|
|
1
|
+
import{__awaiter as t,__generator as e}from"tslib";import{useState as o,useEffect as r}from"react";import n from"@tencentcloud/chat";import{TUIChatService as i}from"@tencentcloud/chat-uikit-engine";import{MESSAGE_OPERATE as a}from"../../../constants.js";import"react/jsx-runtime";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as s}from"../../../context/ChatStateContext.js";import"../../../context/MessageContext.js";import{useUIManagerStore as c}from"../../../store/UIManagerStore.js";function u(u){var m=this,f=s("TUIMessageInputDefault").operateData,p=o([]),d=p[0],l=p[1],v=c().chat,g=u||f&&f[a.FORWARD];return r((function(){v&&t(m,void 0,void 0,(function(){var t,o;return e(this,(function(e){switch(e.label){case 0:return[4,v.getConversationList()];case 1:return t=e.sent(),l(null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.conversationList.filter((function(t){return t.type!==n.TYPES.CONV_SYSTEM}))),[2]}}))}))}),[v]),{message:g,conversationList:d,sendForwardMessage:function(t){t.map((function(t){return g&&i.sendForwardMessage([t],[g]),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 n}from"../../../constants.js";import"tslib";import"react/jsx-runtime";import"@tencentcloud/tui-core";import"react-i18next";import
|
|
1
|
+
import{useState as e,useEffect as t}from"react";import o from"@tencentcloud/chat";import{MESSAGE_OPERATE as n}from"../../../constants.js";import"tslib";import"react/jsx-runtime";import"@tencentcloud/tui-core";import"react-i18next";import{useTUIChatStateContext as a}from"../../../context/ChatStateContext.js";import"../../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";var i,r,S=((i={})[o.TYPES.MSG_TEXT]=1,i[o.TYPES.MSG_CUSTOM]=2,i[o.TYPES.MSG_IMAGE]=3,i[o.TYPES.MSG_AUDIO]=4,i[o.TYPES.MSG_VIDEO]=5,i[o.TYPES.MSG_FILE]=6,i[o.TYPES.MSG_FACE]=8,i),l=((r={})[o.TYPES.MSG_CUSTOM]="[custom]",r[o.TYPES.MSG_IMAGE]="[image]",r[o.TYPES.MSG_AUDIO]="[audio]",r[o.TYPES.MSG_VIDEO]="[video]",r[o.TYPES.MSG_FILE]="[file]",r[o.TYPES.MSG_FACE]="[face]",r);function s(i){var r=a("TUIMessageInputDefault").operateData,s=e({messageReply:null}),u=s[0],m=s[1],E=function(e){var t,n=S[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:l[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:n,version:1}};return t((function(){var e=i||r&&r[n.QUOTE];m({messageReply:e?E(e):null})}),[r,i]),{cloudCustomData:u,handleQuoteMessage:E,message:i||r&&r[n.QUOTE]}}export{s as useHandleQuoteMessage};
|