@tencentcloud/chat-uikit-react 2.2.6 → 2.2.8
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 +16 -0
- package/dist/cjs/_virtual/index.js +1 -0
- package/dist/cjs/assets/fonts/iconfont.ttf +0 -0
- package/dist/cjs/assets/fonts/iconfont.woff +0 -0
- package/dist/cjs/assets/fonts/iconfont.woff2 +0 -0
- package/dist/cjs/components/Avatar/Avatar.d.ts +1 -1
- package/dist/cjs/components/{TUIChat/TUIChat.d.ts → Chat/Chat.d.ts} +11 -10
- package/dist/cjs/components/Chat/Chat.js +1 -0
- package/dist/cjs/components/Chat/ChatState.js +1 -0
- package/dist/cjs/components/Chat/index.js +1 -0
- package/dist/cjs/components/Chat/server.js +1 -0
- package/dist/cjs/components/Chat/utils.js +1 -0
- package/dist/cjs/components/{TUIChatHeader/TUIChatHeader.d.ts → ChatHeader/ChatHeader.d.ts} +4 -3
- package/dist/cjs/components/ChatHeader/ChatHeader.js +1 -0
- package/dist/cjs/components/{TUIChatHeader/TUIChatHeaderDefault.d.ts → ChatHeader/ChatHeaderDefault.d.ts} +4 -3
- package/dist/cjs/components/ChatHeader/ChatHeaderDefault.js +1 -0
- package/dist/cjs/components/ChatSetting/ChatSetting.d.ts +6 -0
- package/dist/cjs/components/ChatSetting/ChatSetting.js +1 -0
- package/dist/cjs/components/Contact/Contact.d.ts +6 -0
- package/dist/cjs/components/Contact/Contact.js +1 -0
- package/dist/cjs/components/Contact/ContactInfo/ContactInfo.d.ts +10 -0
- package/dist/cjs/components/Contact/ContactInfo/ContactInfo.js +1 -0
- package/dist/cjs/components/Contact/ContactInfo/basicInfo.js +1 -0
- package/dist/cjs/components/Contact/ContactInfo/blockInfo.js +1 -0
- package/dist/cjs/components/Contact/ContactInfo/friendApplication.js +1 -0
- package/dist/cjs/components/Contact/ContactInfo/friendInfo.js +1 -0
- package/dist/cjs/components/Contact/ContactInfo/groupInfo.js +1 -0
- package/dist/cjs/components/Contact/ContactInfo/hooks/useContactInfo.js +1 -0
- package/dist/cjs/components/Contact/ContactList/ContactList.d.ts +6 -0
- package/dist/cjs/components/Contact/ContactList/ContactList.js +1 -0
- package/dist/cjs/components/Contact/hooks/useTUIContact.js +1 -0
- package/dist/cjs/components/ContactSearch/ContactSearch.js +1 -0
- package/dist/cjs/components/ContactSearch/hooks/useContactSearch.js +1 -0
- package/dist/cjs/components/ConversationActions/ConversationActions.d.ts +52 -0
- package/dist/cjs/components/ConversationActions/ConversationActions.js +1 -0
- package/dist/cjs/components/ConversationCreate/ConversationCreate.d.ts +21 -0
- package/dist/cjs/components/ConversationCreate/ConversationCreate.js +1 -1
- package/dist/cjs/components/ConversationCreate/ConversationCreateButton.d.ts +13 -0
- package/dist/cjs/components/ConversationCreate/ConversationCreateButton.js +1 -0
- package/dist/cjs/components/ConversationCreate/ConversationCreateGroupDetail.d.ts +16 -0
- package/dist/cjs/components/ConversationCreate/ConversationCreateGroupDetail.js +1 -0
- package/dist/cjs/components/ConversationCreate/ConversationCreateSelectView.d.ts +15 -0
- package/dist/cjs/components/ConversationCreate/ConversationCreateUserSelectList.d.ts +18 -0
- package/dist/cjs/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
- package/dist/cjs/components/ConversationCreate/ConversationGroupTypeInfo.d.ts +24 -0
- package/dist/cjs/components/ConversationCreate/ConversationGroupTypeInfo.js +1 -1
- package/dist/cjs/components/ConversationCreate/hooks/useConversationCreate.d.ts +14 -0
- package/dist/cjs/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
- package/dist/cjs/components/ConversationList/ConversationList.d.ts +57 -0
- package/dist/cjs/components/ConversationList/ConversationList.js +1 -0
- package/dist/cjs/components/ConversationList/ConversationListContent/ConversationListContent.d.ts +23 -0
- package/dist/cjs/components/ConversationList/ConversationListContent/ConversationListContent.js +1 -0
- package/dist/cjs/components/ConversationList/ConversationListHeader/ConversationListHeader.d.ts +15 -0
- package/dist/cjs/components/ConversationList/ConversationListHeader/ConversationListHeader.js +1 -0
- package/dist/cjs/components/ConversationPreview/ConversationPreview.d.ts +39 -27
- package/dist/cjs/components/ConversationPreview/ConversationPreview.js +1 -1
- package/dist/cjs/components/ConversationPreview/utils.js +1 -1
- package/dist/cjs/components/ConversationSearch/ConversationSearch.d.ts +39 -0
- package/dist/cjs/components/ConversationSearch/ConversationSearch.js +1 -0
- package/dist/cjs/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.d.ts +7 -0
- package/dist/cjs/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.js +1 -0
- package/dist/cjs/components/ConversationSearch/ConversationSearchResult/ConversationSearchResult.d.ts +29 -0
- package/dist/cjs/components/ConversationSearch/ConversationSearchResult/ConversationSearchResult.js +1 -0
- package/dist/cjs/components/Icon/Icon.js +1 -1
- package/dist/cjs/components/Icon/config.js +1 -1
- package/dist/cjs/components/Icon/images/mute.svg.js +1 -0
- package/dist/cjs/components/Icon/images/video-call.svg.js +1 -0
- package/dist/cjs/components/Icon/images/voice-call.svg.js +1 -0
- package/dist/cjs/components/Icon/type.d.ts +5 -1
- package/dist/cjs/components/Icon/type.js +1 -1
- package/dist/cjs/components/Input/Input.d.ts +5 -2
- package/dist/cjs/components/Input/Input.js +1 -1
- package/dist/{esm/components/TUIMessage/TUIMessage.d.ts → cjs/components/MessageElement/Message.d.ts} +1 -1
- package/dist/cjs/components/MessageElement/Message.js +1 -0
- package/dist/cjs/components/MessageElement/MessageAudio.js +1 -0
- package/dist/cjs/components/MessageElement/MessageAvatar.js +1 -0
- package/dist/cjs/components/MessageElement/MessageBubble.js +1 -0
- package/dist/cjs/components/MessageElement/MessageContext.js +1 -0
- package/dist/cjs/components/MessageElement/MessageCustom.js +1 -0
- package/dist/cjs/components/MessageElement/MessageDefault.js +1 -0
- package/dist/cjs/components/MessageElement/MessageName.js +1 -0
- package/dist/cjs/components/MessageElement/MessagePlugins.js +1 -0
- package/dist/cjs/components/MessageElement/MessageProgress.js +1 -0
- package/dist/cjs/components/MessageElement/MessageRevoke.js +1 -0
- package/dist/cjs/components/MessageElement/MessageStatus.js +1 -0
- package/dist/cjs/components/MessageElement/MessageSystem.js +1 -0
- package/dist/cjs/components/MessageElement/MessageText.js +1 -0
- package/dist/cjs/components/MessageElement/MessageTip.js +1 -0
- package/dist/cjs/components/MessageElement/hooks/useMessageHandler.js +1 -0
- package/dist/cjs/components/MessageElement/hooks/useMessageReply.js +1 -0
- package/dist/cjs/components/MessageElement/utils/index.js +1 -0
- package/dist/cjs/components/MessageInput/EmojiPicker.js +1 -0
- package/dist/cjs/components/MessageInput/Forward.js +1 -0
- package/dist/cjs/components/MessageInput/InputPluginsDefalut.js +1 -0
- package/dist/cjs/components/MessageInput/InputQuoteDefalut.js +1 -0
- package/dist/cjs/components/{TUIMessageInput/TUIMessageInput.d.ts → MessageInput/MessageInput.d.ts} +4 -4
- package/dist/cjs/components/MessageInput/MessageInput.js +1 -0
- package/dist/cjs/components/MessageInput/MessageInputDefault.js +1 -0
- package/dist/cjs/components/MessageInput/Transmitter.js +1 -0
- package/dist/cjs/components/MessageInput/hooks/useEmojiPicker.js +1 -0
- package/dist/cjs/components/MessageInput/hooks/useHandleForwardMessage.js +1 -0
- package/dist/cjs/components/MessageInput/hooks/useHandleQuoteMessage.js +1 -0
- package/dist/cjs/components/MessageInput/hooks/useMessageInputText.js +1 -0
- package/dist/cjs/components/MessageInput/hooks/useUploadPicker.js +1 -0
- package/dist/cjs/components/{TUIMessageList/TUIMessageList.d.ts → MessageList/MessageList.d.ts} +3 -3
- package/dist/cjs/components/MessageList/MessageList.js +1 -0
- package/dist/cjs/components/MessageList/hooks/useMessageListElement.js +1 -0
- package/dist/cjs/components/PlaceHolder/index.d.ts +34 -0
- package/dist/cjs/components/PlaceHolder/index.js +1 -0
- package/dist/cjs/components/Plugins/index.d.ts +5 -2
- package/dist/cjs/components/Profile/Profile.d.ts +10 -0
- package/dist/cjs/components/Profile/Profile.js +1 -1
- package/dist/cjs/components/Profile/ProfileDefault.js +1 -0
- package/dist/cjs/components/Profile/myProfile/MyProfile.js +1 -0
- package/dist/cjs/components/{untils.js → utils.js} +1 -1
- package/dist/cjs/context/{TUIChatActionContext.d.ts → ChatActionContext.d.ts} +3 -2
- package/dist/{esm/context/TUIChatStateContext.d.ts → cjs/context/ChatStateContext.d.ts} +6 -6
- package/dist/cjs/context/ComponentContext.d.ts +3 -3
- package/dist/cjs/context/{TUIContactContext.d.ts → ContactContext.d.ts} +4 -4
- package/dist/cjs/context/ConversationListContext.d.ts +22 -0
- package/dist/cjs/context/ConversationListContext.js +1 -0
- package/dist/cjs/context/LanguageContext.js +1 -1
- package/dist/{esm/context/TUIMessageContext.d.ts → cjs/context/MessageContext.d.ts} +1 -1
- package/dist/{esm/context/TUIMessageInputContext.d.ts → cjs/context/MessageInputContext.d.ts} +4 -4
- package/dist/cjs/context/ThemeContext.js +1 -1
- package/dist/cjs/context/UIKitContext.d.ts +2 -2
- package/dist/cjs/context/UIKitContext.js +1 -1
- package/dist/cjs/hooks/useConversation.d.ts +4 -23
- package/dist/cjs/hooks/useConversation.js +1 -1
- package/dist/cjs/hooks/useLongPress.d.ts +3 -0
- package/dist/cjs/hooks/useLongPress.js +1 -0
- package/dist/cjs/hooks/useMouseHover.js +1 -0
- package/dist/cjs/index.css +2 -1
- package/dist/cjs/index.d.css +1376 -568
- package/dist/cjs/index.d.ts +41 -29
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/locales/en-US/TUIConversation.js +1 -1
- package/dist/cjs/locales/en-US/index.js +1 -1
- package/dist/cjs/locales/index.js +1 -1
- package/dist/cjs/locales/ja-JP/TUIConversation.js +1 -1
- package/dist/cjs/locales/ja-JP/index.js +1 -1
- package/dist/cjs/locales/ko-KR/TUIConversation.js +1 -1
- package/dist/cjs/locales/ko-KR/index.js +1 -1
- package/dist/cjs/locales/zh-CN/TUIConversation.js +1 -1
- package/dist/cjs/locales/zh-CN/index.js +1 -1
- package/dist/cjs/locales/zh-TW/TUIChat.js +1 -0
- package/dist/cjs/locales/zh-TW/TUIContact.js +1 -0
- package/dist/cjs/locales/zh-TW/TUIConversation.js +1 -0
- package/dist/cjs/locales/zh-TW/TUIProfile.js +1 -0
- package/dist/cjs/locales/zh-TW/index.js +1 -0
- package/dist/esm/_virtual/index.js +1 -0
- package/dist/esm/assets/fonts/iconfont.ttf +0 -0
- package/dist/esm/assets/fonts/iconfont.woff +0 -0
- package/dist/esm/assets/fonts/iconfont.woff2 +0 -0
- package/dist/esm/components/Avatar/Avatar.d.ts +1 -1
- package/dist/esm/components/{TUIChat/TUIChat.d.ts → Chat/Chat.d.ts} +11 -10
- package/dist/esm/components/Chat/Chat.js +1 -0
- package/dist/esm/components/Chat/ChatState.js +1 -0
- package/dist/esm/components/Chat/index.js +1 -0
- package/dist/esm/components/Chat/server.js +1 -0
- package/dist/esm/components/Chat/utils.js +1 -0
- package/dist/esm/components/{TUIChatHeader/TUIChatHeader.d.ts → ChatHeader/ChatHeader.d.ts} +4 -3
- package/dist/esm/components/ChatHeader/ChatHeader.js +1 -0
- package/dist/esm/components/{TUIChatHeader/TUIChatHeaderDefault.d.ts → ChatHeader/ChatHeaderDefault.d.ts} +4 -3
- package/dist/esm/components/ChatHeader/ChatHeaderDefault.js +1 -0
- package/dist/esm/components/ChatSetting/ChatSetting.d.ts +6 -0
- package/dist/esm/components/ChatSetting/ChatSetting.js +1 -0
- package/dist/esm/components/Contact/Contact.d.ts +6 -0
- package/dist/esm/components/Contact/Contact.js +1 -0
- package/dist/esm/components/Contact/ContactInfo/ContactInfo.d.ts +10 -0
- package/dist/esm/components/Contact/ContactInfo/ContactInfo.js +1 -0
- package/dist/esm/components/Contact/ContactInfo/basicInfo.js +1 -0
- package/dist/esm/components/Contact/ContactInfo/blockInfo.js +1 -0
- package/dist/esm/components/Contact/ContactInfo/friendApplication.js +1 -0
- package/dist/esm/components/Contact/ContactInfo/friendInfo.js +1 -0
- package/dist/esm/components/Contact/ContactInfo/groupInfo.js +1 -0
- package/dist/esm/components/Contact/ContactInfo/hooks/useContactInfo.js +1 -0
- package/dist/esm/components/Contact/ContactList/ContactList.d.ts +6 -0
- package/dist/esm/components/Contact/ContactList/ContactList.js +1 -0
- package/dist/esm/components/Contact/hooks/useTUIContact.js +1 -0
- package/dist/esm/components/ContactSearch/ContactSearch.js +1 -0
- package/dist/esm/components/ContactSearch/hooks/useContactSearch.js +1 -0
- package/dist/esm/components/ConversationActions/ConversationActions.d.ts +52 -0
- package/dist/esm/components/ConversationActions/ConversationActions.js +1 -0
- package/dist/esm/components/ConversationCreate/ConversationCreate.d.ts +21 -0
- package/dist/esm/components/ConversationCreate/ConversationCreate.js +1 -1
- package/dist/esm/components/ConversationCreate/ConversationCreateButton.d.ts +13 -0
- package/dist/esm/components/ConversationCreate/ConversationCreateButton.js +1 -0
- package/dist/esm/components/ConversationCreate/ConversationCreateGroupDetail.d.ts +16 -0
- package/dist/esm/components/ConversationCreate/ConversationCreateGroupDetail.js +1 -0
- package/dist/esm/components/ConversationCreate/ConversationCreateSelectView.d.ts +15 -0
- package/dist/esm/components/ConversationCreate/ConversationCreateUserSelectList.d.ts +18 -0
- package/dist/esm/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
- package/dist/esm/components/ConversationCreate/ConversationGroupTypeInfo.d.ts +24 -0
- package/dist/esm/components/ConversationCreate/ConversationGroupTypeInfo.js +1 -1
- package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.d.ts +14 -0
- package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
- package/dist/esm/components/ConversationList/ConversationList.d.ts +57 -0
- package/dist/esm/components/ConversationList/ConversationList.js +1 -0
- package/dist/esm/components/ConversationList/ConversationListContent/ConversationListContent.d.ts +23 -0
- package/dist/esm/components/ConversationList/ConversationListContent/ConversationListContent.js +1 -0
- package/dist/esm/components/ConversationList/ConversationListHeader/ConversationListHeader.d.ts +15 -0
- package/dist/esm/components/ConversationList/ConversationListHeader/ConversationListHeader.js +1 -0
- package/dist/esm/components/ConversationPreview/ConversationPreview.d.ts +39 -27
- package/dist/esm/components/ConversationPreview/ConversationPreview.js +1 -1
- package/dist/esm/components/ConversationPreview/utils.js +1 -1
- package/dist/esm/components/ConversationSearch/ConversationSearch.d.ts +39 -0
- package/dist/esm/components/ConversationSearch/ConversationSearch.js +1 -0
- package/dist/esm/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.d.ts +7 -0
- package/dist/esm/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.js +1 -0
- package/dist/esm/components/ConversationSearch/ConversationSearchResult/ConversationSearchResult.d.ts +29 -0
- package/dist/esm/components/ConversationSearch/ConversationSearchResult/ConversationSearchResult.js +1 -0
- package/dist/esm/components/Icon/Icon.js +1 -1
- package/dist/esm/components/Icon/config.js +1 -1
- package/dist/esm/components/Icon/images/mute.svg.js +1 -0
- package/dist/esm/components/Icon/images/video-call.svg.js +1 -0
- package/dist/esm/components/Icon/images/voice-call.svg.js +1 -0
- package/dist/esm/components/Icon/type.d.ts +5 -1
- package/dist/esm/components/Icon/type.js +1 -1
- package/dist/esm/components/Input/Input.d.ts +5 -2
- package/dist/esm/components/Input/Input.js +1 -1
- package/dist/{cjs/components/TUIMessage/TUIMessage.d.ts → esm/components/MessageElement/Message.d.ts} +1 -1
- package/dist/esm/components/MessageElement/Message.js +1 -0
- package/dist/esm/components/MessageElement/MessageAudio.js +1 -0
- package/dist/esm/components/MessageElement/MessageAvatar.js +1 -0
- package/dist/esm/components/MessageElement/MessageBubble.js +1 -0
- package/dist/esm/components/MessageElement/MessageContext.js +1 -0
- package/dist/esm/components/MessageElement/MessageCustom.js +1 -0
- package/dist/esm/components/MessageElement/MessageDefault.js +1 -0
- package/dist/esm/components/MessageElement/MessageName.js +1 -0
- package/dist/esm/components/MessageElement/MessagePlugins.js +1 -0
- package/dist/esm/components/MessageElement/MessageProgress.js +1 -0
- package/dist/esm/components/MessageElement/MessageRevoke.js +1 -0
- package/dist/esm/components/MessageElement/MessageStatus.js +1 -0
- package/dist/esm/components/MessageElement/MessageSystem.js +1 -0
- package/dist/esm/components/MessageElement/MessageText.js +1 -0
- package/dist/esm/components/MessageElement/MessageTip.js +1 -0
- package/dist/esm/components/MessageElement/hooks/useMessageHandler.js +1 -0
- package/dist/esm/components/MessageElement/hooks/useMessageReply.js +1 -0
- package/dist/esm/components/MessageElement/utils/index.js +1 -0
- package/dist/esm/components/MessageInput/EmojiPicker.js +1 -0
- package/dist/esm/components/MessageInput/Forward.js +1 -0
- package/dist/esm/components/MessageInput/InputPluginsDefalut.js +1 -0
- package/dist/esm/components/MessageInput/InputQuoteDefalut.js +1 -0
- package/dist/esm/components/{TUIMessageInput/TUIMessageInput.d.ts → MessageInput/MessageInput.d.ts} +4 -4
- package/dist/esm/components/MessageInput/MessageInput.js +1 -0
- package/dist/esm/components/MessageInput/MessageInputDefault.js +1 -0
- package/dist/esm/components/MessageInput/Transmitter.js +1 -0
- package/dist/esm/components/MessageInput/hooks/useEmojiPicker.js +1 -0
- package/dist/esm/components/MessageInput/hooks/useHandleForwardMessage.js +1 -0
- package/dist/esm/components/MessageInput/hooks/useHandleQuoteMessage.js +1 -0
- package/dist/esm/components/MessageInput/hooks/useMessageInputText.js +1 -0
- package/dist/esm/components/MessageInput/hooks/useUploadPicker.js +1 -0
- package/dist/esm/components/{TUIMessageList/TUIMessageList.d.ts → MessageList/MessageList.d.ts} +3 -3
- package/dist/esm/components/MessageList/MessageList.js +1 -0
- package/dist/esm/components/MessageList/hooks/useMessageListElement.js +1 -0
- package/dist/esm/components/PlaceHolder/index.d.ts +34 -0
- package/dist/esm/components/PlaceHolder/index.js +1 -0
- package/dist/esm/components/Plugins/index.d.ts +5 -2
- package/dist/esm/components/Profile/Profile.d.ts +10 -0
- package/dist/esm/components/Profile/Profile.js +1 -1
- package/dist/esm/components/Profile/ProfileDefault.js +1 -0
- package/dist/esm/components/Profile/myProfile/MyProfile.js +1 -0
- package/dist/esm/components/utils.js +1 -0
- package/dist/esm/context/{TUIChatActionContext.d.ts → ChatActionContext.d.ts} +3 -2
- package/dist/{cjs/context/TUIChatStateContext.d.ts → esm/context/ChatStateContext.d.ts} +6 -6
- package/dist/esm/context/ComponentContext.d.ts +3 -3
- package/dist/esm/context/{TUIContactContext.d.ts → ContactContext.d.ts} +4 -4
- package/dist/esm/context/ConversationListContext.d.ts +22 -0
- package/dist/esm/context/ConversationListContext.js +1 -0
- package/dist/esm/context/LanguageContext.js +1 -1
- package/dist/{cjs/context/TUIMessageContext.d.ts → esm/context/MessageContext.d.ts} +1 -1
- package/dist/{cjs/context/TUIMessageInputContext.d.ts → esm/context/MessageInputContext.d.ts} +4 -4
- package/dist/esm/context/ThemeContext.js +1 -1
- package/dist/esm/context/UIKitContext.d.ts +2 -2
- package/dist/esm/context/UIKitContext.js +1 -1
- package/dist/esm/hooks/useConversation.d.ts +4 -23
- package/dist/esm/hooks/useConversation.js +1 -1
- package/dist/esm/hooks/useLongPress.d.ts +3 -0
- package/dist/esm/hooks/useLongPress.js +1 -0
- package/dist/esm/hooks/useMouseHover.js +1 -0
- package/dist/esm/index.css +2 -1
- package/dist/esm/index.d.css +1376 -568
- package/dist/esm/index.d.ts +41 -29
- package/dist/esm/index.js +1 -1
- package/dist/esm/locales/en-US/TUIConversation.js +1 -1
- package/dist/esm/locales/en-US/index.js +1 -1
- package/dist/esm/locales/index.js +1 -1
- package/dist/esm/locales/ja-JP/TUIConversation.js +1 -1
- package/dist/esm/locales/ja-JP/index.js +1 -1
- package/dist/esm/locales/ko-KR/TUIConversation.js +1 -1
- package/dist/esm/locales/ko-KR/index.js +1 -1
- package/dist/esm/locales/zh-CN/TUIConversation.js +1 -1
- package/dist/esm/locales/zh-CN/index.js +1 -1
- package/dist/esm/locales/zh-TW/TUIChat.js +1 -0
- package/dist/esm/locales/zh-TW/TUIContact.js +1 -0
- package/dist/esm/locales/zh-TW/TUIConversation.js +1 -0
- package/dist/esm/locales/zh-TW/TUIProfile.js +1 -0
- package/dist/esm/locales/zh-TW/index.js +1 -0
- package/package.json +3 -1
- package/rollup.config.js +1 -1
- package/src/assets/fonts/iconfont.ttf +0 -0
- package/src/assets/fonts/iconfont.woff +0 -0
- package/src/assets/fonts/iconfont.woff2 +0 -0
- package/src/components/Avatar/Avatar.tsx +33 -31
- package/src/components/Avatar/styles/index.scss +11 -4
- package/src/components/{TUIChat/TUIChat.tsx → Chat/Chat.tsx} +50 -46
- package/src/components/{TUIChat/TUIChatState.tsx → Chat/ChatState.tsx} +41 -41
- package/src/components/{TUIChat → Chat}/hooks/useHandleMessage.tsx +1 -1
- package/src/components/{TUIChat → Chat}/hooks/useHandleMessageList.tsx +1 -1
- package/src/components/Chat/index.ts +5 -0
- package/src/components/Chat/server.ts +44 -0
- package/src/components/{TUIChat → Chat}/styles/layout.scss +7 -2
- package/src/components/Chat/utils.ts +72 -0
- package/src/components/{TUIChatHeader/TUIChatHeader.tsx → ChatHeader/ChatHeader.tsx} +14 -11
- package/src/components/{TUIChatHeader/TUIChatHeaderDefault.tsx → ChatHeader/ChatHeaderDefault.tsx} +72 -29
- package/src/components/ChatHeader/index.ts +2 -0
- package/src/components/{TUIChatHeader → ChatHeader}/styles/layout.scss +12 -13
- package/src/components/{TUIManage/TUIManage.tsx → ChatSetting/ChatSetting.tsx} +17 -20
- package/src/components/ChatSetting/index.ts +1 -0
- package/src/components/{TUIManage → ChatSetting}/styles/index.scss +24 -16
- package/src/components/Checkbox/index.tsx +9 -9
- package/src/components/Checkbox/styles/color.scss +17 -6
- package/src/components/{TUIContact/TUIContact.tsx → Contact/Contact.tsx} +35 -35
- package/src/components/{TUIContact/TUIContactInfo/TUIContactInfo.tsx → Contact/ContactInfo/ContactInfo.tsx} +4 -4
- package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/index.scss +44 -21
- package/src/components/{TUIContact/TUIContactList/TUIContactList.tsx → Contact/ContactList/ContactList.tsx} +78 -74
- package/src/components/{TUIContact/TUIContactList → Contact/ContactList}/index.scss +40 -20
- package/src/components/{TUIContact → Contact}/hooks/useTUIContact.tsx +3 -3
- package/src/components/{TUIContact → Contact}/index.scss +30 -11
- package/src/components/Contact/index.ts +3 -0
- package/src/components/{TUIContactSearch/TUIContactSearch.tsx → ContactSearch/ContactSearch.tsx} +8 -7
- package/src/components/{TUIContactSearch → ContactSearch}/index.scss +12 -3
- package/src/components/ConversationActions/ConversationActions.scss +45 -0
- package/src/components/ConversationActions/ConversationActions.tsx +172 -0
- package/src/components/ConversationActions/index.ts +1 -0
- package/src/components/ConversationCreate/ConversationCreate.tsx +104 -49
- package/src/components/ConversationCreate/ConversationCreateButton.tsx +46 -0
- package/src/components/ConversationCreate/ConversationCreateGroupDetail.tsx +179 -0
- package/src/components/ConversationCreate/ConversationCreateSelectView.tsx +7 -7
- package/src/components/ConversationCreate/ConversationCreateUserSelectList.tsx +31 -29
- package/src/components/ConversationCreate/ConversationGroupTypeInfo.tsx +19 -19
- package/src/components/ConversationCreate/hooks/useConversationCreate.tsx +38 -31
- package/src/components/ConversationCreate/index.ts +2 -1
- package/src/components/ConversationCreate/styles/{ConversationCreatGroupDetail.scss → ConversationCreateGroupDetail.scss} +13 -17
- package/src/components/ConversationCreate/styles/conversationCreateButton.scss +5 -0
- package/src/components/ConversationCreate/styles/conversationCreateSelectView.scss +13 -8
- package/src/components/ConversationCreate/styles/conversationGroupTypeInfo.scss +20 -21
- package/src/components/ConversationCreate/styles/index.scss +64 -19
- package/src/components/ConversationList/ConversationList.scss +29 -0
- package/src/components/ConversationList/ConversationList.tsx +155 -0
- package/src/components/ConversationList/ConversationListContent/ConversationListContent.scss +16 -0
- package/src/components/ConversationList/ConversationListContent/ConversationListContent.tsx +63 -0
- package/src/components/ConversationList/ConversationListContent/index.ts +1 -0
- package/src/components/ConversationList/ConversationListHeader/ConversationListHeader.scss +28 -0
- package/src/components/ConversationList/ConversationListHeader/ConversationListHeader.tsx +43 -0
- package/src/components/ConversationList/ConversationListHeader/index.ts +1 -0
- package/src/components/ConversationList/index.ts +3 -0
- package/src/components/ConversationPreview/ConversationPreview.scss +137 -0
- package/src/components/ConversationPreview/ConversationPreview.tsx +245 -63
- package/src/components/ConversationPreview/index.ts +0 -1
- package/src/components/ConversationPreview/utils.tsx +80 -61
- package/src/components/ConversationSearch/ConversationSearch.scss +22 -0
- package/src/components/ConversationSearch/ConversationSearch.tsx +125 -0
- package/src/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.scss +13 -0
- package/src/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.tsx +42 -0
- package/src/components/ConversationSearch/ConversationSearchInput/index.ts +1 -0
- package/src/components/ConversationSearch/ConversationSearchResult/ConversationSearchResult.scss +15 -0
- package/src/components/ConversationSearch/ConversationSearchResult/ConversationSearchResult.tsx +72 -0
- package/src/components/ConversationSearch/ConversationSearchResult/index.ts +1 -0
- package/src/components/ConversationSearch/index.ts +3 -2
- package/src/components/DivWithEdit/styles/index.scss +30 -10
- package/src/components/EmptyStateIndicator/EmptyStateIndicator.tsx +2 -3
- package/src/components/Icon/Icon.tsx +8 -8
- package/src/components/Icon/config.ts +23 -4
- package/src/components/Icon/images/mute.svg +8 -0
- package/src/components/Icon/images/video-call.svg +3 -0
- package/src/components/Icon/images/voice-call.svg +3 -0
- package/src/components/Icon/styles/index.scss +41 -6
- package/src/components/Icon/type.ts +4 -0
- package/src/components/Input/Input.tsx +24 -23
- package/src/components/Input/styles/index.scss +22 -6
- package/src/components/{TUIMessage/TUIMessage.tsx → MessageElement/Message.tsx} +33 -33
- package/src/components/{TUIMessage → MessageElement}/MessageAvatar.tsx +7 -7
- package/src/components/{TUIMessage → MessageElement}/MessageBubble.tsx +22 -21
- package/src/components/{TUIMessage → MessageElement}/MessageCustom.tsx +26 -5
- package/src/components/{TUIMessage/TUIMessageDefault.tsx → MessageElement/MessageDefault.tsx} +24 -24
- package/src/components/{TUIMessage → MessageElement}/MessagePlugins.tsx +18 -18
- package/src/components/{TUIMessage → MessageElement}/MessageStatus.tsx +5 -5
- package/src/components/{TUIMessage → MessageElement}/hooks/useMessageHandler.ts +6 -6
- package/src/components/{TUIMessage → MessageElement}/hooks/useMessageReply.ts +6 -5
- package/src/components/{TUIMessage → MessageElement}/index.ts +1 -1
- package/src/components/{TUIMessage → MessageElement}/styles/color.scss +6 -5
- package/src/components/{TUIMessage → MessageElement}/styles/layout.scss +112 -43
- package/src/components/{TUIMessage → MessageElement}/utils/index.ts +23 -12
- package/src/components/{TUIMessageInput → MessageInput}/EmojiPicker.tsx +2 -2
- package/src/components/{TUIMessageInput/TUIForward.tsx → MessageInput/Forward.tsx} +41 -36
- package/src/components/{TUIMessageInput → MessageInput}/InputPluginsDefalut.tsx +14 -14
- package/src/components/{TUIMessageInput → MessageInput}/InputQuoteDefalut.tsx +1 -1
- package/src/components/{TUIMessageInput/TUIMessageInput.tsx → MessageInput/MessageInput.tsx} +25 -27
- package/src/components/{TUIMessageInput/TUIMessageInputDefault.tsx → MessageInput/MessageInputDefault.tsx} +14 -14
- package/src/components/{TUIMessageInput → MessageInput}/Transmitter.tsx +2 -2
- package/src/components/{TUIMessageInput → MessageInput}/hooks/useEmojiPicker.tsx +1 -1
- package/src/components/{TUIMessageInput → MessageInput}/hooks/useHandleForwardMessage.tsx +5 -4
- package/src/components/{TUIMessageInput → MessageInput}/hooks/useMessageInputState.tsx +1 -1
- package/src/components/{TUIMessageInput → MessageInput}/hooks/useMessageInputText.tsx +14 -14
- package/src/components/{TUIMessageInput → MessageInput}/hooks/useUploadPicker.tsx +4 -4
- package/src/components/MessageInput/index.ts +3 -0
- package/src/components/MessageInput/styles/color.scss +40 -0
- package/src/components/{TUIMessageInput → MessageInput}/styles/layout.scss +33 -17
- package/src/components/{TUIMessageList/TUIMessageList.tsx → MessageList/MessageList.tsx} +5 -5
- package/src/components/{TUIMessageList → MessageList}/hooks/useMessageListElement.tsx +14 -10
- package/src/components/MessageList/index.ts +1 -0
- package/src/components/{TUIMessageList → MessageList}/styles/layout.scss +16 -9
- package/src/components/PlaceHolder/index.tsx +79 -0
- package/src/components/PlaceHolder/styles/index.scss +36 -0
- package/src/components/Plugins/index.tsx +49 -45
- package/src/components/Plugins/styles/color.scss +3 -11
- package/src/components/Profile/Profile.tsx +46 -21
- package/src/components/{TUIProfile/TUIProfileDefault.tsx → Profile/ProfileDefault.tsx} +12 -11
- package/src/components/Profile/index.ts +2 -1
- package/src/components/Profile/myProfile/MyProfile.tsx +25 -0
- package/src/components/Profile/myProfile/index.ts +1 -0
- package/src/components/Profile/myProfile/styles/index.scss +32 -0
- package/src/components/Profile/styles/color.scss +7 -0
- package/src/components/Profile/styles/index.scss +2 -23
- package/src/components/{TUIProfile → Profile}/styles/layout.scss +17 -14
- package/src/components/index.ts +13 -11
- package/src/components/{untils.ts → utils.ts} +5 -4
- package/src/context/{TUIChatActionContext.tsx → ChatActionContext.tsx} +15 -14
- package/src/context/ChatStateContext.tsx +49 -0
- package/src/context/ComponentContext.tsx +13 -13
- package/src/context/{TUIContactContext.tsx → ContactContext.tsx} +10 -11
- package/src/context/ConversationListContext.tsx +113 -0
- package/src/context/LanguageContext.tsx +6 -4
- package/src/context/MessageContext.tsx +55 -0
- package/src/context/MessageInputContext.tsx +54 -0
- package/src/context/ThemeContext.tsx +12 -5
- package/src/context/UIKitContext.tsx +11 -2
- package/src/context/index.ts +6 -5
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useConversation.tsx +26 -74
- package/src/hooks/useLongPress.tsx +117 -0
- package/src/hooks/useMouseHover.tsx +21 -0
- package/src/locales/en-US/TUIConversation.ts +4 -0
- package/src/locales/en-US/index.ts +0 -3
- package/src/locales/index.ts +16 -2
- package/src/locales/ja-JP/TUIConversation.ts +4 -0
- package/src/locales/ja-JP/index.ts +0 -2
- package/src/locales/ko-KR/TUIConversation.ts +4 -0
- package/src/locales/ko-KR/index.ts +0 -2
- package/src/locales/zh-CN/TUIConversation.ts +4 -0
- package/src/locales/zh-CN/index.ts +0 -2
- package/src/locales/zh-TW/TUIChat.ts +27 -0
- package/src/locales/zh-TW/TUIContact.ts +29 -0
- package/src/locales/zh-TW/TUIConversation.ts +36 -0
- package/src/locales/zh-TW/TUIProfile.ts +15 -0
- package/src/locales/zh-TW/index.ts +11 -0
- package/src/styles/colors/_color-dark.scss +31 -21
- package/src/styles/colors/_color-light.scss +31 -21
- package/src/styles/colors/_color-theme.scss +32 -21
- package/src/styles/normalize.scss +6 -0
- package/dist/cjs/components/ConversationCreate/ConversationCreatGroupDetail.js +0 -1
- package/dist/cjs/components/ConversationPreview/ConversationListContainer.d.ts +0 -10
- package/dist/cjs/components/ConversationPreview/ConversationListContainer.js +0 -1
- package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.d.ts +0 -10
- package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.js +0 -1
- package/dist/cjs/components/ConversationSearch/ConversationSearchInput.d.ts +0 -6
- package/dist/cjs/components/ConversationSearch/ConversationSearchInput.js +0 -1
- package/dist/cjs/components/ConversationSearch/ConversationSearchResult.d.ts +0 -12
- package/dist/cjs/components/ConversationSearch/ConversationSearchResult.js +0 -1
- package/dist/cjs/components/Icon/images/down-arrow.png.js +0 -1
- package/dist/cjs/components/Icon/images/right-arrow.svg.js +0 -1
- package/dist/cjs/components/TUIChat/TUIChat.js +0 -1
- package/dist/cjs/components/TUIChat/TUIChatState.js +0 -1
- package/dist/cjs/components/TUIChat/unitls.js +0 -1
- package/dist/cjs/components/TUIChatHeader/TUIChatHeader.js +0 -1
- package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.js +0 -1
- package/dist/cjs/components/TUIContact/TUIContact.d.ts +0 -6
- package/dist/cjs/components/TUIContact/TUIContact.js +0 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/TUIContactInfo.d.ts +0 -10
- package/dist/cjs/components/TUIContact/TUIContactInfo/TUIContactInfo.js +0 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/basicInfo.js +0 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/blockInfo.js +0 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/friendApplication.js +0 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/friendInfo.js +0 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/groupInfo.js +0 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/hooks/useContactInfo.js +0 -1
- package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.d.ts +0 -6
- package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.js +0 -1
- package/dist/cjs/components/TUIContact/hooks/useTUIContact.js +0 -1
- package/dist/cjs/components/TUIContactSearch/TUIContactSearch.js +0 -1
- package/dist/cjs/components/TUIContactSearch/hooks/useContactSearch.js +0 -1
- package/dist/cjs/components/TUIConversation/TUIConversation.d.ts +0 -12
- package/dist/cjs/components/TUIConversation/TUIConversation.js +0 -1
- package/dist/cjs/components/TUIConversationList/TUIConversationList.d.ts +0 -19
- package/dist/cjs/components/TUIConversationList/TUIConversationList.js +0 -1
- package/dist/cjs/components/TUIConversationList/hooks/useConversationList.js +0 -1
- package/dist/cjs/components/TUIConversationList/hooks/useConversationUpdate.js +0 -1
- package/dist/cjs/components/TUIManage/TUIManage.d.ts +0 -6
- package/dist/cjs/components/TUIManage/TUIManage.js +0 -1
- package/dist/cjs/components/TUIMessage/MessageAudio.js +0 -1
- package/dist/cjs/components/TUIMessage/MessageAvatar.js +0 -1
- package/dist/cjs/components/TUIMessage/MessageBubble.js +0 -1
- package/dist/cjs/components/TUIMessage/MessageContext.js +0 -1
- package/dist/cjs/components/TUIMessage/MessageCustom.js +0 -1
- package/dist/cjs/components/TUIMessage/MessageName.js +0 -1
- package/dist/cjs/components/TUIMessage/MessagePlugins.js +0 -1
- package/dist/cjs/components/TUIMessage/MessageProgress.js +0 -1
- package/dist/cjs/components/TUIMessage/MessageRevoke.js +0 -1
- package/dist/cjs/components/TUIMessage/MessageStatus.js +0 -1
- package/dist/cjs/components/TUIMessage/MessageSystem.js +0 -1
- package/dist/cjs/components/TUIMessage/MessageText.js +0 -1
- package/dist/cjs/components/TUIMessage/MessageTip.js +0 -1
- package/dist/cjs/components/TUIMessage/TUIMessage.js +0 -1
- package/dist/cjs/components/TUIMessage/TUIMessageDefault.js +0 -1
- package/dist/cjs/components/TUIMessage/hooks/useMessageHandler.js +0 -1
- package/dist/cjs/components/TUIMessage/hooks/useMessageReply.js +0 -1
- package/dist/cjs/components/TUIMessage/utils/index.js +0 -1
- package/dist/cjs/components/TUIMessageInput/EmojiPicker.js +0 -1
- package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.js +0 -1
- package/dist/cjs/components/TUIMessageInput/InputQuoteDefalut.js +0 -1
- package/dist/cjs/components/TUIMessageInput/TUIForward.js +0 -1
- package/dist/cjs/components/TUIMessageInput/TUIMessageInput.js +0 -1
- package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.js +0 -1
- package/dist/cjs/components/TUIMessageInput/Transmitter.js +0 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useEmojiPicker.js +0 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useHandleForwardMessage.js +0 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +0 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputText.js +0 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useUploadPicker.js +0 -1
- package/dist/cjs/components/TUIMessageList/TUIMessageList.js +0 -1
- package/dist/cjs/components/TUIMessageList/hooks/useMessageListElement.js +0 -1
- package/dist/cjs/components/TUIProfile/TUIProfile.d.ts +0 -10
- package/dist/cjs/components/TUIProfile/TUIProfile.js +0 -1
- package/dist/cjs/components/TUIProfile/TUIProfileDefault.js +0 -1
- package/dist/cjs/context/TUIConversationContext.js +0 -1
- package/dist/cjs/locales/en-US/TUIGlobal.js +0 -1
- package/dist/cjs/locales/ja-JP/TUIGlobal.js +0 -1
- package/dist/cjs/locales/ko-KR/TUIGlobal.js +0 -1
- package/dist/cjs/locales/zh-CN/TUIGlobal.js +0 -1
- package/dist/esm/components/ConversationCreate/ConversationCreatGroupDetail.js +0 -1
- package/dist/esm/components/ConversationPreview/ConversationListContainer.d.ts +0 -10
- package/dist/esm/components/ConversationPreview/ConversationListContainer.js +0 -1
- package/dist/esm/components/ConversationPreview/ConversationPreviewContent.d.ts +0 -10
- package/dist/esm/components/ConversationPreview/ConversationPreviewContent.js +0 -1
- package/dist/esm/components/ConversationSearch/ConversationSearchInput.d.ts +0 -6
- package/dist/esm/components/ConversationSearch/ConversationSearchInput.js +0 -1
- package/dist/esm/components/ConversationSearch/ConversationSearchResult.d.ts +0 -12
- package/dist/esm/components/ConversationSearch/ConversationSearchResult.js +0 -1
- package/dist/esm/components/Icon/images/down-arrow.png.js +0 -1
- package/dist/esm/components/Icon/images/right-arrow.svg.js +0 -1
- package/dist/esm/components/TUIChat/TUIChat.js +0 -1
- package/dist/esm/components/TUIChat/TUIChatState.js +0 -1
- package/dist/esm/components/TUIChat/unitls.js +0 -1
- package/dist/esm/components/TUIChatHeader/TUIChatHeader.js +0 -1
- package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.js +0 -1
- package/dist/esm/components/TUIContact/TUIContact.d.ts +0 -6
- package/dist/esm/components/TUIContact/TUIContact.js +0 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/TUIContactInfo.d.ts +0 -10
- package/dist/esm/components/TUIContact/TUIContactInfo/TUIContactInfo.js +0 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/basicInfo.js +0 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/blockInfo.js +0 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/friendApplication.js +0 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/friendInfo.js +0 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/groupInfo.js +0 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/hooks/useContactInfo.js +0 -1
- package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.d.ts +0 -6
- package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.js +0 -1
- package/dist/esm/components/TUIContact/hooks/useTUIContact.js +0 -1
- package/dist/esm/components/TUIContactSearch/TUIContactSearch.js +0 -1
- package/dist/esm/components/TUIContactSearch/hooks/useContactSearch.js +0 -1
- package/dist/esm/components/TUIConversation/TUIConversation.d.ts +0 -12
- package/dist/esm/components/TUIConversation/TUIConversation.js +0 -1
- package/dist/esm/components/TUIConversationList/TUIConversationList.d.ts +0 -19
- package/dist/esm/components/TUIConversationList/TUIConversationList.js +0 -1
- package/dist/esm/components/TUIConversationList/hooks/useConversationList.js +0 -1
- package/dist/esm/components/TUIConversationList/hooks/useConversationUpdate.js +0 -1
- package/dist/esm/components/TUIManage/TUIManage.d.ts +0 -6
- package/dist/esm/components/TUIManage/TUIManage.js +0 -1
- package/dist/esm/components/TUIMessage/MessageAudio.js +0 -1
- package/dist/esm/components/TUIMessage/MessageAvatar.js +0 -1
- package/dist/esm/components/TUIMessage/MessageBubble.js +0 -1
- package/dist/esm/components/TUIMessage/MessageContext.js +0 -1
- package/dist/esm/components/TUIMessage/MessageCustom.js +0 -1
- package/dist/esm/components/TUIMessage/MessageName.js +0 -1
- package/dist/esm/components/TUIMessage/MessagePlugins.js +0 -1
- package/dist/esm/components/TUIMessage/MessageProgress.js +0 -1
- package/dist/esm/components/TUIMessage/MessageRevoke.js +0 -1
- package/dist/esm/components/TUIMessage/MessageStatus.js +0 -1
- package/dist/esm/components/TUIMessage/MessageSystem.js +0 -1
- package/dist/esm/components/TUIMessage/MessageText.js +0 -1
- package/dist/esm/components/TUIMessage/MessageTip.js +0 -1
- package/dist/esm/components/TUIMessage/TUIMessage.js +0 -1
- package/dist/esm/components/TUIMessage/TUIMessageDefault.js +0 -1
- package/dist/esm/components/TUIMessage/hooks/useMessageHandler.js +0 -1
- package/dist/esm/components/TUIMessage/hooks/useMessageReply.js +0 -1
- package/dist/esm/components/TUIMessage/utils/index.js +0 -1
- package/dist/esm/components/TUIMessageInput/EmojiPicker.js +0 -1
- package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.js +0 -1
- package/dist/esm/components/TUIMessageInput/InputQuoteDefalut.js +0 -1
- package/dist/esm/components/TUIMessageInput/TUIForward.js +0 -1
- package/dist/esm/components/TUIMessageInput/TUIMessageInput.js +0 -1
- package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.js +0 -1
- package/dist/esm/components/TUIMessageInput/Transmitter.js +0 -1
- package/dist/esm/components/TUIMessageInput/hooks/useEmojiPicker.js +0 -1
- package/dist/esm/components/TUIMessageInput/hooks/useHandleForwardMessage.js +0 -1
- package/dist/esm/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +0 -1
- package/dist/esm/components/TUIMessageInput/hooks/useMessageInputText.js +0 -1
- package/dist/esm/components/TUIMessageInput/hooks/useUploadPicker.js +0 -1
- package/dist/esm/components/TUIMessageList/TUIMessageList.js +0 -1
- package/dist/esm/components/TUIMessageList/hooks/useMessageListElement.js +0 -1
- package/dist/esm/components/TUIProfile/TUIProfile.d.ts +0 -10
- package/dist/esm/components/TUIProfile/TUIProfile.js +0 -1
- package/dist/esm/components/TUIProfile/TUIProfileDefault.js +0 -1
- package/dist/esm/components/untils.js +0 -1
- package/dist/esm/context/TUIConversationContext.js +0 -1
- package/dist/esm/locales/en-US/TUIGlobal.js +0 -1
- package/dist/esm/locales/ja-JP/TUIGlobal.js +0 -1
- package/dist/esm/locales/ko-KR/TUIGlobal.js +0 -1
- package/dist/esm/locales/zh-CN/TUIGlobal.js +0 -1
- package/scripts/publish-github.js +0 -60
- package/scripts/publish-intl-demo.js +0 -14
- package/scripts/publish-intl-experience-demo.js +0 -14
- package/src/components/ConversationCreate/ConversationCreatGroupDetail.tsx +0 -170
- package/src/components/ConversationPreview/ConversationListContainer.tsx +0 -20
- package/src/components/ConversationPreview/ConversationPreviewContent.tsx +0 -190
- package/src/components/ConversationPreview/styles/index.scss +0 -171
- package/src/components/ConversationSearch/ConversationSearchInput.tsx +0 -27
- package/src/components/ConversationSearch/ConversationSearchResult.tsx +0 -39
- package/src/components/ConversationSearch/styles/index.scss +0 -20
- package/src/components/TUIChat/index.ts +0 -2
- package/src/components/TUIChat/unitls.ts +0 -39
- package/src/components/TUIChatHeader/index.ts +0 -2
- package/src/components/TUIContact/index.ts +0 -3
- package/src/components/TUIConversation/TUIConversation.tsx +0 -46
- package/src/components/TUIConversation/index.ts +0 -1
- package/src/components/TUIConversationList/TUIConversationList.tsx +0 -178
- package/src/components/TUIConversationList/hooks/useConversationList.tsx +0 -42
- package/src/components/TUIConversationList/hooks/useConversationUpdate.tsx +0 -38
- package/src/components/TUIConversationList/index.scss +0 -59
- package/src/components/TUIConversationList/index.ts +0 -2
- package/src/components/TUIManage/index.ts +0 -1
- package/src/components/TUIMessageInput/index.ts +0 -3
- package/src/components/TUIMessageInput/styles/color.scss +0 -36
- package/src/components/TUIMessageList/index.ts +0 -1
- package/src/components/TUIProfile/TUIProfile.tsx +0 -50
- package/src/components/TUIProfile/index.ts +0 -2
- package/src/components/TUIProfile/styles/color.scss +0 -6
- package/src/components/TUIProfile/styles/index.scss +0 -2
- package/src/context/TUIChatStateContext.tsx +0 -50
- package/src/context/TUIConversationContext.tsx +0 -29
- package/src/context/TUIMessageContext.tsx +0 -56
- package/src/context/TUIMessageInputContext.tsx +0 -55
- package/src/locales/en-US/TUIGlobal.ts +0 -6
- package/src/locales/ja-JP/TUIGlobal.ts +0 -6
- package/src/locales/ko-KR/TUIGlobal.ts +0 -6
- package/src/locales/zh-CN/TUIGlobal.ts +0 -6
- /package/dist/cjs/components/{TUIChat → Chat}/hooks/useCreateTUIChatStateContext.js +0 -0
- /package/dist/cjs/components/{TUIChat → Chat}/hooks/useHandleMessage.d.ts +0 -0
- /package/dist/cjs/components/{TUIChat → Chat}/hooks/useHandleMessage.js +0 -0
- /package/dist/cjs/components/{TUIChat → Chat}/hooks/useHandleMessageList.js +0 -0
- /package/dist/cjs/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/addFriendInfo.js +0 -0
- /package/dist/cjs/components/{TUIMessage → MessageElement}/MessageContext.d.ts +0 -0
- /package/dist/cjs/components/{TUIMessage → MessageElement}/MessageFace.js +0 -0
- /package/dist/cjs/components/{TUIMessage → MessageElement}/MessageFile.js +0 -0
- /package/dist/cjs/components/{TUIMessage → MessageElement}/MessageImage.js +0 -0
- /package/dist/cjs/components/{TUIMessage → MessageElement}/MessageLocation.js +0 -0
- /package/dist/cjs/components/{TUIMessage → MessageElement}/MessageMerger.js +0 -0
- /package/dist/cjs/components/{TUIMessage → MessageElement}/MessagePlugins.d.ts +0 -0
- /package/dist/cjs/components/{TUIMessage → MessageElement}/MessageVideo.js +0 -0
- /package/dist/cjs/components/{TUIMessage → MessageElement}/hooks/useMessageContextHandler.js +0 -0
- /package/dist/cjs/components/{TUIMessage → MessageElement}/hooks/useMessagePluginElement.js +0 -0
- /package/dist/cjs/components/{TUIMessage → MessageElement}/utils/decodeText.js +0 -0
- /package/dist/cjs/components/{TUIMessage → MessageElement}/utils/emojiMap.js +0 -0
- /package/dist/cjs/components/{TUIMessageInput → MessageInput}/InputPluginsDefalut.d.ts +0 -0
- /package/dist/cjs/components/{TUIMessageInput/TUIMessageInputDefault.d.ts → MessageInput/MessageInputDefault.d.ts} +0 -0
- /package/dist/cjs/components/{TUIMessageInput → MessageInput}/hooks/useCreateMessageInputContext.js +0 -0
- /package/dist/cjs/components/{TUIMessageInput → MessageInput}/hooks/useEmojiPicker.d.ts +0 -0
- /package/dist/cjs/components/{TUIMessageInput → MessageInput}/hooks/useMessageInputState.d.ts +0 -0
- /package/dist/cjs/components/{TUIMessageInput → MessageInput}/hooks/useMessageInputState.js +0 -0
- /package/dist/cjs/components/{TUIMessageInput → MessageInput}/hooks/useUploadElement.js +0 -0
- /package/dist/cjs/components/{TUIMessageInput → MessageInput}/hooks/useUploadPicker.d.ts +0 -0
- /package/dist/cjs/components/{TUIProfile/TUIProfileDefault.d.ts → Profile/ProfileDefault.d.ts} +0 -0
- /package/dist/cjs/components/{TUIProfile → Profile}/hooks/useMyProfile.js +0 -0
- /package/dist/cjs/context/{TUIChatActionContext.js → ChatActionContext.js} +0 -0
- /package/dist/cjs/context/{TUIChatStateContext.js → ChatStateContext.js} +0 -0
- /package/dist/cjs/context/{TUIContactContext.js → ContactContext.js} +0 -0
- /package/dist/cjs/context/{TUIMessageContext.js → MessageContext.js} +0 -0
- /package/dist/cjs/context/{TUIMessageInputContext.js → MessageInputContext.js} +0 -0
- /package/dist/esm/components/{TUIChat → Chat}/hooks/useCreateTUIChatStateContext.js +0 -0
- /package/dist/esm/components/{TUIChat → Chat}/hooks/useHandleMessage.d.ts +0 -0
- /package/dist/esm/components/{TUIChat → Chat}/hooks/useHandleMessage.js +0 -0
- /package/dist/esm/components/{TUIChat → Chat}/hooks/useHandleMessageList.js +0 -0
- /package/dist/esm/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/addFriendInfo.js +0 -0
- /package/dist/esm/components/{TUIMessage → MessageElement}/MessageContext.d.ts +0 -0
- /package/dist/esm/components/{TUIMessage → MessageElement}/MessageFace.js +0 -0
- /package/dist/esm/components/{TUIMessage → MessageElement}/MessageFile.js +0 -0
- /package/dist/esm/components/{TUIMessage → MessageElement}/MessageImage.js +0 -0
- /package/dist/esm/components/{TUIMessage → MessageElement}/MessageLocation.js +0 -0
- /package/dist/esm/components/{TUIMessage → MessageElement}/MessageMerger.js +0 -0
- /package/dist/esm/components/{TUIMessage → MessageElement}/MessagePlugins.d.ts +0 -0
- /package/dist/esm/components/{TUIMessage → MessageElement}/MessageVideo.js +0 -0
- /package/dist/esm/components/{TUIMessage → MessageElement}/hooks/useMessageContextHandler.js +0 -0
- /package/dist/esm/components/{TUIMessage → MessageElement}/hooks/useMessagePluginElement.js +0 -0
- /package/dist/esm/components/{TUIMessage → MessageElement}/utils/decodeText.js +0 -0
- /package/dist/esm/components/{TUIMessage → MessageElement}/utils/emojiMap.js +0 -0
- /package/dist/esm/components/{TUIMessageInput → MessageInput}/InputPluginsDefalut.d.ts +0 -0
- /package/dist/esm/components/{TUIMessageInput/TUIMessageInputDefault.d.ts → MessageInput/MessageInputDefault.d.ts} +0 -0
- /package/dist/esm/components/{TUIMessageInput → MessageInput}/hooks/useCreateMessageInputContext.js +0 -0
- /package/dist/esm/components/{TUIMessageInput → MessageInput}/hooks/useEmojiPicker.d.ts +0 -0
- /package/dist/esm/components/{TUIMessageInput → MessageInput}/hooks/useMessageInputState.d.ts +0 -0
- /package/dist/esm/components/{TUIMessageInput → MessageInput}/hooks/useMessageInputState.js +0 -0
- /package/dist/esm/components/{TUIMessageInput → MessageInput}/hooks/useUploadElement.js +0 -0
- /package/dist/esm/components/{TUIMessageInput → MessageInput}/hooks/useUploadPicker.d.ts +0 -0
- /package/dist/esm/components/{TUIProfile/TUIProfileDefault.d.ts → Profile/ProfileDefault.d.ts} +0 -0
- /package/dist/esm/components/{TUIProfile → Profile}/hooks/useMyProfile.js +0 -0
- /package/dist/esm/context/{TUIChatActionContext.js → ChatActionContext.js} +0 -0
- /package/dist/esm/context/{TUIChatStateContext.js → ChatStateContext.js} +0 -0
- /package/dist/esm/context/{TUIContactContext.js → ContactContext.js} +0 -0
- /package/dist/esm/context/{TUIMessageContext.js → MessageContext.js} +0 -0
- /package/dist/esm/context/{TUIMessageInputContext.js → MessageInputContext.js} +0 -0
- /package/src/components/{TUIChat → Chat}/hooks/useCreateTUIChatStateContext.tsx +0 -0
- /package/src/components/{TUIChat → Chat}/hooks/useIsMounted.ts +0 -0
- /package/src/components/{TUIChat → Chat}/styles/index.scss +0 -0
- /package/src/components/{TUIChatHeader → ChatHeader}/styles/color.scss +0 -0
- /package/src/components/{TUIChatHeader → ChatHeader}/styles/index.scss +0 -0
- /package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/addFriendInfo.tsx +0 -0
- /package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/basicInfo.tsx +0 -0
- /package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/blockInfo.tsx +0 -0
- /package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/friendApplication.tsx +0 -0
- /package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/friendInfo.tsx +0 -0
- /package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/groupInfo.tsx +0 -0
- /package/src/components/{TUIContact/TUIContactInfo → Contact/ContactInfo}/hooks/useContactInfo.tsx +0 -0
- /package/src/components/{TUIContactSearch → ContactSearch}/hooks/useContactSearch.tsx +0 -0
- /package/src/components/{TUIMessage → MessageElement}/MessageAudio.tsx +0 -0
- /package/src/components/{TUIMessage → MessageElement}/MessageContext.tsx +0 -0
- /package/src/components/{TUIMessage → MessageElement}/MessageFace.tsx +0 -0
- /package/src/components/{TUIMessage → MessageElement}/MessageFile.tsx +0 -0
- /package/src/components/{TUIMessage → MessageElement}/MessageImage.tsx +0 -0
- /package/src/components/{TUIMessage → MessageElement}/MessageLocation.tsx +0 -0
- /package/src/components/{TUIMessage → MessageElement}/MessageMerger.tsx +0 -0
- /package/src/components/{TUIMessage → MessageElement}/MessageName.tsx +0 -0
- /package/src/components/{TUIMessage → MessageElement}/MessageProgress.tsx +0 -0
- /package/src/components/{TUIMessage → MessageElement}/MessageRevoke.tsx +0 -0
- /package/src/components/{TUIMessage → MessageElement}/MessageSystem.tsx +0 -0
- /package/src/components/{TUIMessage → MessageElement}/MessageText.tsx +0 -0
- /package/src/components/{TUIMessage → MessageElement}/MessageTip.tsx +0 -0
- /package/src/components/{TUIMessage → MessageElement}/MessageVideo.tsx +0 -0
- /package/src/components/{TUIMessage → MessageElement}/hooks/index.ts +0 -0
- /package/src/components/{TUIMessage → MessageElement}/hooks/useMessageContextHandler.ts +0 -0
- /package/src/components/{TUIMessage → MessageElement}/hooks/useMessagePluginElement.tsx +0 -0
- /package/src/components/{TUIMessage → MessageElement}/styles/index.scss +0 -0
- /package/src/components/{TUIMessage → MessageElement}/utils/decodeText.ts +0 -0
- /package/src/components/{TUIMessage → MessageElement}/utils/emojiMap.ts +0 -0
- /package/src/components/{TUIMessageInput → MessageInput}/hooks/index.ts +0 -0
- /package/src/components/{TUIMessageInput → MessageInput}/hooks/useCreateMessageInputContext.ts +0 -0
- /package/src/components/{TUIMessageInput → MessageInput}/hooks/useHandleQuoteMessage.tsx +0 -0
- /package/src/components/{TUIMessageInput → MessageInput}/hooks/usePluginsElement.tsx +0 -0
- /package/src/components/{TUIMessageInput → MessageInput}/hooks/useUploadElement.tsx +0 -0
- /package/src/components/{TUIMessageInput → MessageInput}/styles/index.scss +0 -0
- /package/src/components/{TUIMessageList → MessageList}/styles/color.scss +0 -0
- /package/src/components/{TUIMessageList → MessageList}/styles/index.scss +0 -0
- /package/src/components/{TUIProfile → Profile}/hooks/index.ts +0 -0
- /package/src/components/{TUIProfile → Profile}/hooks/useMyProfile.tsx +0 -0
|
@@ -9,71 +9,72 @@ import TUIChatEngine, {
|
|
|
9
9
|
TUIStore,
|
|
10
10
|
StoreName,
|
|
11
11
|
} from '@tencentcloud/chat-uikit-engine';
|
|
12
|
-
import { JSONStringToParse } from '../
|
|
12
|
+
import { JSONStringToParse } from '../utils';
|
|
13
13
|
import { useUIKit, useUIManager } from '../../context';
|
|
14
|
-
import { TUIChatStateContextProvider } from '../../context/
|
|
15
|
-
import { TUIChatActionProvider } from '../../context/
|
|
14
|
+
import { TUIChatStateContextProvider } from '../../context/ChatStateContext';
|
|
15
|
+
import { TUIChatActionProvider } from '../../context/ChatActionContext';
|
|
16
16
|
import { ComponentProvider, UnknowPorps } from '../../context/ComponentContext';
|
|
17
|
-
import type { TUIChatActionContextValue } from '../../context/
|
|
17
|
+
import type { TUIChatActionContextValue } from '../../context/ChatActionContext';
|
|
18
18
|
import type { ComponentContextValue } from '../../context/ComponentContext';
|
|
19
19
|
import useCreateTUIChatStateContext from './hooks/useCreateTUIChatStateContext';
|
|
20
20
|
|
|
21
|
-
import type { TUIChatHeaderDefaultProps } from '../
|
|
21
|
+
import type { TUIChatHeaderDefaultProps } from '../ChatHeader/ChatHeaderDefault';
|
|
22
22
|
|
|
23
23
|
import {
|
|
24
24
|
TUIMessageProps,
|
|
25
25
|
TUIMessage as TUIMessageDefault,
|
|
26
|
-
} from '../
|
|
27
|
-
import type { MessageContextProps } from '../
|
|
26
|
+
} from '../MessageElement';
|
|
27
|
+
import type { MessageContextProps } from '../MessageElement/MessageContext';
|
|
28
28
|
|
|
29
29
|
import './styles/index.scss';
|
|
30
30
|
import { CONSTANT_DISPATCH_TYPE } from '../../constants';
|
|
31
|
-
import { chatReducer, ChatStateReducer, initialState } from './
|
|
31
|
+
import { chatReducer, ChatStateReducer, initialState } from './ChatState';
|
|
32
32
|
|
|
33
33
|
import { useHandleMessageList } from './hooks/useHandleMessageList';
|
|
34
34
|
import { useHandleMessage } from './hooks/useHandleMessage';
|
|
35
35
|
|
|
36
|
-
import {
|
|
37
|
-
import { MessageListProps,
|
|
38
|
-
import {
|
|
36
|
+
import { ChatHeader as ChatHeaderElement } from '../ChatHeader';
|
|
37
|
+
import { MessageListProps, MessageList } from '../MessageList';
|
|
38
|
+
import { MessageInput as MessageInputElement, TUIMessageInputBasicProps } from '../MessageInput';
|
|
39
39
|
import { EmptyStateIndicator } from '../EmptyStateIndicator';
|
|
40
40
|
|
|
41
41
|
interface TUIChatProps {
|
|
42
|
-
className?: string
|
|
43
|
-
conversation?: Conversation
|
|
44
|
-
EmptyPlaceholder?: React.ReactElement
|
|
45
|
-
TUIMessage?: React.ComponentType<TUIMessageProps | UnknowPorps
|
|
46
|
-
TUIChatHeader?: React.ComponentType<TUIChatHeaderDefaultProps
|
|
47
|
-
MessageContext?: React.ComponentType<MessageContextProps
|
|
48
|
-
TUIMessageInput?: React.ComponentType<UnknowPorps
|
|
49
|
-
InputPlugins?: React.ComponentType<UnknowPorps
|
|
50
|
-
InputQuote?: React.ComponentType<UnknowPorps
|
|
51
|
-
MessagePlugins?: React.ComponentType<UnknowPorps
|
|
52
|
-
MessageCustomPlugins?: React.ComponentType<UnknowPorps
|
|
53
|
-
MessageTextPlugins?: React.ComponentType<UnknowPorps
|
|
42
|
+
className?: string;
|
|
43
|
+
conversation?: Conversation;
|
|
44
|
+
EmptyPlaceholder?: React.ReactElement;
|
|
45
|
+
TUIMessage?: React.ComponentType<TUIMessageProps | UnknowPorps>;
|
|
46
|
+
TUIChatHeader?: React.ComponentType<TUIChatHeaderDefaultProps>;
|
|
47
|
+
MessageContext?: React.ComponentType<MessageContextProps>;
|
|
48
|
+
TUIMessageInput?: React.ComponentType<UnknowPorps>;
|
|
49
|
+
InputPlugins?: React.ComponentType<UnknowPorps>;
|
|
50
|
+
InputQuote?: React.ComponentType<UnknowPorps>;
|
|
51
|
+
MessagePlugins?: React.ComponentType<UnknowPorps>;
|
|
52
|
+
MessageCustomPlugins?: React.ComponentType<UnknowPorps>;
|
|
53
|
+
MessageTextPlugins?: React.ComponentType<UnknowPorps>;
|
|
54
54
|
onMessageRecevied?: (
|
|
55
|
-
updateMessage: (event?:
|
|
55
|
+
updateMessage: (event?: Message[]) => void,
|
|
56
56
|
event: any,
|
|
57
|
-
) => void
|
|
58
|
-
sendMessage?: (message:Message, options?:any) => Promise<Message
|
|
59
|
-
revokeMessage?: (message:Message) => Promise<Message
|
|
60
|
-
selectedConversation?: (conversation:Conversation) => Promise<Conversation
|
|
61
|
-
filterMessage?: (messageList:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
) => void;
|
|
58
|
+
sendMessage?: (message: Message, options?: any) => Promise<Message>;
|
|
59
|
+
revokeMessage?: (message: Message) => Promise<Message>;
|
|
60
|
+
selectedConversation?: (conversation: Conversation) => Promise<Conversation>;
|
|
61
|
+
filterMessage?: (messageList: IMessageModel[]) => IMessageModel[];
|
|
62
|
+
callButtonClicked?: (callMediaType?: number, callType?: any) => void;
|
|
63
|
+
messageConfig?: TUIMessageProps;
|
|
64
|
+
cloudCustomData?: string;
|
|
65
|
+
TUIMessageInputConfig?: TUIMessageInputBasicProps;
|
|
66
|
+
TUIMessageListConfig?: MessageListProps;
|
|
67
|
+
[propName: string]: any;
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
interface TUIChatInnerProps extends TUIChatProps {
|
|
70
|
-
chat?: ChatSDK
|
|
71
|
+
chat?: ChatSDK;
|
|
71
72
|
key?: string;
|
|
72
73
|
}
|
|
73
74
|
|
|
74
|
-
function
|
|
75
|
+
function UnMemoizedChat<T extends TUIChatProps>(
|
|
75
76
|
props: PropsWithChildren<T>,
|
|
76
|
-
):React.ReactElement {
|
|
77
|
+
): React.ReactElement {
|
|
77
78
|
const {
|
|
78
79
|
conversation: propsConversation,
|
|
79
80
|
EmptyPlaceholder = <EmptyStateIndicator listType="chat" />,
|
|
@@ -96,9 +97,9 @@ function UnMemoizedTUIChat <T extends TUIChatProps>(
|
|
|
96
97
|
);
|
|
97
98
|
}
|
|
98
99
|
|
|
99
|
-
function TUIChatInner
|
|
100
|
+
function TUIChatInner<T extends TUIChatInnerProps>(
|
|
100
101
|
props: PropsWithChildren<T>,
|
|
101
|
-
):React.ReactElement {
|
|
102
|
+
): React.ReactElement {
|
|
102
103
|
const {
|
|
103
104
|
chat,
|
|
104
105
|
conversation,
|
|
@@ -122,6 +123,7 @@ function TUIChatInner <T extends TUIChatInnerProps>(
|
|
|
122
123
|
cloudCustomData,
|
|
123
124
|
TUIMessageInputConfig,
|
|
124
125
|
TUIMessageListConfig,
|
|
126
|
+
callButtonClicked,
|
|
125
127
|
} = props;
|
|
126
128
|
|
|
127
129
|
const [state, dispatch] = useReducer<any>(chatReducer, {
|
|
@@ -183,7 +185,7 @@ function TUIChatInner <T extends TUIChatInnerProps>(
|
|
|
183
185
|
}, []);
|
|
184
186
|
|
|
185
187
|
const onMessageListUpdated = (list: IMessageModel[]) => {
|
|
186
|
-
const messageList = list.filter(
|
|
188
|
+
const messageList = list.filter(message => !message.isDeleted);
|
|
187
189
|
// eslint-disable-next-line
|
|
188
190
|
// @ts-ignore
|
|
189
191
|
dispatch({
|
|
@@ -223,7 +225,7 @@ function TUIChatInner <T extends TUIChatInnerProps>(
|
|
|
223
225
|
});
|
|
224
226
|
}
|
|
225
227
|
};
|
|
226
|
-
|
|
228
|
+
// eslint-disable-next-line
|
|
227
229
|
// @ts-ignore
|
|
228
230
|
const chatActionContextValue: TUIChatActionContextValue = useMemo(
|
|
229
231
|
() => ({
|
|
@@ -237,6 +239,7 @@ function TUIChatInner <T extends TUIChatInnerProps>(
|
|
|
237
239
|
setActiveMessageID,
|
|
238
240
|
updateUploadPendingMessageList,
|
|
239
241
|
setFirstSendMessage,
|
|
242
|
+
callButtonClicked,
|
|
240
243
|
}),
|
|
241
244
|
[
|
|
242
245
|
editLocalMessage,
|
|
@@ -249,6 +252,7 @@ function TUIChatInner <T extends TUIChatInnerProps>(
|
|
|
249
252
|
setActiveMessageID,
|
|
250
253
|
updateUploadPendingMessageList,
|
|
251
254
|
setFirstSendMessage,
|
|
255
|
+
callButtonClicked,
|
|
252
256
|
],
|
|
253
257
|
);
|
|
254
258
|
|
|
@@ -269,16 +273,16 @@ function TUIChatInner <T extends TUIChatInnerProps>(
|
|
|
269
273
|
|
|
270
274
|
return (
|
|
271
275
|
<div className={`chat ${className}`}>
|
|
272
|
-
|
|
276
|
+
{/* // eslint-disable-next-line
|
|
273
277
|
// @ts-ignore */}
|
|
274
278
|
<TUIChatStateContextProvider value={chatStateContextValue}>
|
|
275
279
|
<TUIChatActionProvider value={chatActionContextValue}>
|
|
276
280
|
<ComponentProvider value={componentContextValue}>
|
|
277
281
|
{children || (
|
|
278
282
|
<>
|
|
279
|
-
<
|
|
280
|
-
<
|
|
281
|
-
<
|
|
283
|
+
<ChatHeaderElement />
|
|
284
|
+
<MessageList />
|
|
285
|
+
<MessageInputElement />
|
|
282
286
|
</>
|
|
283
287
|
)}
|
|
284
288
|
</ComponentProvider>
|
|
@@ -288,4 +292,4 @@ function TUIChatInner <T extends TUIChatInnerProps>(
|
|
|
288
292
|
);
|
|
289
293
|
}
|
|
290
294
|
|
|
291
|
-
export const
|
|
295
|
+
export const Chat = React.memo(UnMemoizedChat) as typeof UnMemoizedChat;
|
|
@@ -7,61 +7,61 @@ import { OperateMessageParams } from './hooks/useHandleMessage';
|
|
|
7
7
|
import {
|
|
8
8
|
handleEditMessage,
|
|
9
9
|
handleUploadPendingMessage,
|
|
10
|
-
} from './
|
|
10
|
+
} from './utils';
|
|
11
11
|
|
|
12
12
|
export type ChatStateReducerAction =
|
|
13
13
|
| {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
type: CONSTANT_DISPATCH_TYPE.SET_CONVERSATION_PRPFILE;
|
|
15
|
+
value?: Conversation;
|
|
16
|
+
}
|
|
17
17
|
| {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
type: CONSTANT_DISPATCH_TYPE.SET_MESSAGELIST;
|
|
19
|
+
value?: IMessageModel[];
|
|
20
|
+
}
|
|
21
21
|
| {
|
|
22
|
-
type: CONSTANT_DISPATCH_TYPE.SET_EDIT_MESSAGE
|
|
23
|
-
value?: Message
|
|
24
|
-
index?: number
|
|
22
|
+
type: CONSTANT_DISPATCH_TYPE.SET_EDIT_MESSAGE;
|
|
23
|
+
value?: Message;
|
|
24
|
+
index?: number;
|
|
25
25
|
}
|
|
26
26
|
| {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
type: CONSTANT_DISPATCH_TYPE.SET_IS_COMPLETE;
|
|
28
|
+
value?: boolean;
|
|
29
|
+
}
|
|
30
30
|
| {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
type: CONSTANT_DISPATCH_TYPE.RESET;
|
|
32
|
+
}
|
|
33
33
|
| {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
type: CONSTANT_DISPATCH_TYPE.SET_HIGH_LIGHTED_MESSAGE_ID;
|
|
35
|
+
value?: string;
|
|
36
|
+
}
|
|
37
37
|
| {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
type: CONSTANT_DISPATCH_TYPE.OPERATE_MESSAGE;
|
|
39
|
+
value?: OperateMessageParams;
|
|
40
|
+
}
|
|
41
41
|
| {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
type: CONSTANT_DISPATCH_TYPE.SET_NO_MORE;
|
|
43
|
+
value?: boolean;
|
|
44
|
+
}
|
|
45
45
|
| {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
type: CONSTANT_DISPATCH_TYPE.SET_AUDIO_SOURCE;
|
|
47
|
+
value?: HTMLAudioElement | null;
|
|
48
|
+
}
|
|
49
49
|
| {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
type: CONSTANT_DISPATCH_TYPE.SET_VIDEO_SOURCE;
|
|
51
|
+
value?: HTMLVideoElement | null;
|
|
52
|
+
}
|
|
53
53
|
| {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
type: CONSTANT_DISPATCH_TYPE.UPDATE_UPLOAD_PENDING_MESSAGE_LIST;
|
|
55
|
+
value?: Message;
|
|
56
|
+
}
|
|
57
57
|
| {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
type: CONSTANT_DISPATCH_TYPE.SET_FIRST_SEND_MESSAGE;
|
|
59
|
+
value?: Message;
|
|
60
|
+
}
|
|
61
61
|
| {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
type: CONSTANT_DISPATCH_TYPE.SET_ACTIVE_MESSAGE_ID;
|
|
63
|
+
value?: string;
|
|
64
|
+
};
|
|
65
65
|
export type ChatStateReducer = Reducer<TUIChatStateContextValue, ChatStateReducerAction>;
|
|
66
66
|
|
|
67
67
|
export const chatReducer = (
|
|
@@ -78,7 +78,7 @@ export const chatReducer = (
|
|
|
78
78
|
messageList: action.value,
|
|
79
79
|
};
|
|
80
80
|
case CONSTANT_DISPATCH_TYPE.SET_EDIT_MESSAGE:
|
|
81
|
-
return state.messageList &&
|
|
81
|
+
return state.messageList && action.value && {
|
|
82
82
|
...state,
|
|
83
83
|
messageList: [...handleEditMessage(state.messageList, action.value)],
|
|
84
84
|
};
|
|
@@ -110,7 +110,7 @@ export const chatReducer = (
|
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
-
export const initialState:TUIChatStateContextValue = {
|
|
113
|
+
export const initialState: TUIChatStateContextValue = {
|
|
114
114
|
conversation: {} as Conversation,
|
|
115
115
|
messageList: [],
|
|
116
116
|
nextReqMessageID: '',
|
|
@@ -2,7 +2,7 @@ import { Dispatch, useCallback } from 'react';
|
|
|
2
2
|
import { ChatSDK, Conversation, Message } from '@tencentcloud/chat';
|
|
3
3
|
import { CONSTANT_DISPATCH_TYPE } from '../../../constants';
|
|
4
4
|
import type { TUIChatStateContextValue } from '../../../context';
|
|
5
|
-
import type { ChatStateReducerAction } from '../
|
|
5
|
+
import type { ChatStateReducerAction } from '../ChatState';
|
|
6
6
|
|
|
7
7
|
export interface CreateMessageProps {
|
|
8
8
|
chat?: ChatSDK,
|
|
@@ -2,7 +2,7 @@ import { Dispatch, useCallback } from 'react';
|
|
|
2
2
|
import TencentCloudChat, { ChatSDK, Conversation, Message } from '@tencentcloud/chat';
|
|
3
3
|
import { CONSTANT_DISPATCH_TYPE } from '../../../constants';
|
|
4
4
|
import type { TUIChatStateContextValue } from '../../../context';
|
|
5
|
-
import type { ChatStateReducerAction } from '../
|
|
5
|
+
import type { ChatStateReducerAction } from '../ChatState';
|
|
6
6
|
|
|
7
7
|
export interface CreateMessageProps {
|
|
8
8
|
chat?: ChatSDK,
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import TUICore, { TUIConstants } from '@tencentcloud/tui-core';
|
|
2
|
+
import {
|
|
3
|
+
IMessageModel,
|
|
4
|
+
TUIStore,
|
|
5
|
+
StoreName,
|
|
6
|
+
TUIChatService,
|
|
7
|
+
} from '@tencentcloud/chat-uikit-engine';
|
|
8
|
+
|
|
9
|
+
export default class TUIChatServer {
|
|
10
|
+
public currentConversationID = '';
|
|
11
|
+
public currentMessageList: IMessageModel[] = [];
|
|
12
|
+
|
|
13
|
+
constructor() {
|
|
14
|
+
// register service
|
|
15
|
+
TUICore.registerService(TUIConstants.TUIChat.SERVICE.NAME, this);
|
|
16
|
+
// watch current conversationID
|
|
17
|
+
TUIStore.watch(StoreName.CONV, {
|
|
18
|
+
currentConversationID: (id: string) => {
|
|
19
|
+
this.currentConversationID = id;
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public onCall(method: string, params: Record<string, any>, callback: void): any {
|
|
25
|
+
let message;
|
|
26
|
+
switch (method) {
|
|
27
|
+
case TUIConstants.TUIChat.SERVICE.METHOD.UPDATE_MESSAGE_LIST:
|
|
28
|
+
message = params.message;
|
|
29
|
+
// Two screen-up situations
|
|
30
|
+
// 1. If the call message conversationID is currentConversation,
|
|
31
|
+
// You need to use UPDATE_MESSAGE_LIST to update the messageList of TUIStore in the engine to display it on the screen
|
|
32
|
+
// (because you cannot get the messages you sent at this time)
|
|
33
|
+
// 2. If the call message conversationID is not currentConversation,
|
|
34
|
+
// The next time you switch to the conversation where the call message is located, getMessageList can get all the call messages you sent
|
|
35
|
+
// No need to process here
|
|
36
|
+
if (message?.conversationID === this.currentConversationID) {
|
|
37
|
+
TUIChatService.updateMessageList([message], 'push');
|
|
38
|
+
}
|
|
39
|
+
break;
|
|
40
|
+
default:
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use "../../../styles/colors/color-theme" as *;
|
|
2
|
+
|
|
1
3
|
.chat {
|
|
2
4
|
flex: 1;
|
|
3
5
|
width: 100%;
|
|
@@ -6,5 +8,8 @@
|
|
|
6
8
|
display: flex;
|
|
7
9
|
flex-direction: column;
|
|
8
10
|
position: relative;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
|
|
12
|
+
@include theme() {
|
|
13
|
+
background-color: get(bg-color-operate);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import TencentCloudChat, { Message, Conversation } from '@tencentcloud/chat';
|
|
2
|
+
import TUICore, { TUIConstants } from '@tencentcloud/tui-core';
|
|
3
|
+
import TUIChatEngine from '@tencentcloud/chat-uikit-engine';
|
|
4
|
+
import { useTUIChatActionContext } from '../../context';
|
|
5
|
+
import constant from '../../constants';
|
|
6
|
+
import { JSONStringToParse } from '../utils';
|
|
7
|
+
|
|
8
|
+
export const handleMessage = (messageList: Message[]): Message[] => {
|
|
9
|
+
let customPayloadData: any = null;
|
|
10
|
+
return messageList.filter((item) => {
|
|
11
|
+
if (item.type === TencentCloudChat.TYPES.MSG_CUSTOM) {
|
|
12
|
+
customPayloadData = JSONStringToParse(item?.payload?.data);
|
|
13
|
+
}
|
|
14
|
+
if (customPayloadData && customPayloadData?.businessID === constant.TYPE_TYPING) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
return true;
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const handleEditMessage = (
|
|
22
|
+
messageList: Message[],
|
|
23
|
+
message: Message,
|
|
24
|
+
) => {
|
|
25
|
+
const list = [...messageList];
|
|
26
|
+
const index = list.findIndex(item => item?.ID === message?.ID);
|
|
27
|
+
list[index] = message;
|
|
28
|
+
return list;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const handleUploadPendingMessage = (
|
|
32
|
+
messageList: Message[],
|
|
33
|
+
message: Message,
|
|
34
|
+
) => {
|
|
35
|
+
const list = [...messageList];
|
|
36
|
+
if (!list.some((item: Message) => item.ID === message?.ID)) {
|
|
37
|
+
list.push(message);
|
|
38
|
+
}
|
|
39
|
+
const index = list.findIndex(item => item?.ID === message?.ID);
|
|
40
|
+
list[index] = message;
|
|
41
|
+
return list;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
interface IStartCallParams {
|
|
45
|
+
callType: any;
|
|
46
|
+
callMediaType: number;
|
|
47
|
+
userIDList: string[];
|
|
48
|
+
callButtonClicked?: (callMediaType?: number, callType?: any) => void;
|
|
49
|
+
}
|
|
50
|
+
export const startCall = (params: IStartCallParams) => {
|
|
51
|
+
const { callType, callMediaType, userIDList, callButtonClicked } = params;
|
|
52
|
+
if (callType === TUIChatEngine.TYPES.CONV_C2C) {
|
|
53
|
+
callButtonClicked && callButtonClicked(callMediaType, callType);
|
|
54
|
+
TUICore.callService({
|
|
55
|
+
serviceName: TUIConstants.TUICalling.SERVICE.NAME,
|
|
56
|
+
method: TUIConstants.TUICalling.SERVICE.METHOD.START_CALL,
|
|
57
|
+
params: {
|
|
58
|
+
userIDList,
|
|
59
|
+
type: callMediaType,
|
|
60
|
+
callParams: {
|
|
61
|
+
// doc: https://cloud.tencent.com/document/product/269/105713
|
|
62
|
+
offlinePushInfo: {
|
|
63
|
+
title: 'call',
|
|
64
|
+
description: 'you have a call',
|
|
65
|
+
androidSound: 'private_ring',
|
|
66
|
+
iOSSound: '01.caf',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
};
|
|
@@ -1,36 +1,38 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { Conversation } from '@tencentcloud/chat';
|
|
3
|
-
import { useTUIChatStateContext } from '../../context/
|
|
4
|
-
import type { TUIChatHeaderDefaultProps } from './
|
|
5
|
-
import {
|
|
3
|
+
import { useTUIChatStateContext } from '../../context/ChatStateContext';
|
|
4
|
+
import type { TUIChatHeaderDefaultProps } from './ChatHeaderDefault';
|
|
5
|
+
import { ChatHeaderDefault } from './ChatHeaderDefault';
|
|
6
6
|
|
|
7
7
|
import './styles/index.scss';
|
|
8
8
|
import { useComponentContext } from '../../context';
|
|
9
9
|
|
|
10
10
|
interface TUIChatHeaderProps {
|
|
11
|
-
title?: string
|
|
12
|
-
TUIChatHeader?: React.ComponentType<TUIChatHeaderDefaultProps
|
|
13
|
-
conversation?: Conversation
|
|
14
|
-
avatar?: React.ReactElement | string
|
|
15
|
-
headerOpateIcon?: React.ReactElement | string
|
|
11
|
+
title?: string;
|
|
12
|
+
TUIChatHeader?: React.ComponentType<TUIChatHeaderDefaultProps>;
|
|
13
|
+
conversation?: Conversation;
|
|
14
|
+
avatar?: React.ReactElement | string;
|
|
15
|
+
headerOpateIcon?: React.ReactElement | string;
|
|
16
|
+
enableCall?: boolean;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
function UnMemoizedTUIChatHeader<T extends TUIChatHeaderProps>(
|
|
19
20
|
props: PropsWithChildren<T>,
|
|
20
|
-
):React.ReactElement {
|
|
21
|
+
): React.ReactElement {
|
|
21
22
|
const {
|
|
22
23
|
title,
|
|
23
24
|
conversation: propsConversation,
|
|
24
25
|
TUIChatHeader: propTUIChatHeader,
|
|
25
26
|
avatar,
|
|
26
27
|
headerOpateIcon,
|
|
28
|
+
enableCall,
|
|
27
29
|
} = props;
|
|
28
30
|
|
|
29
31
|
const { conversation: contextConversation } = useTUIChatStateContext('TUIChatHeader');
|
|
30
32
|
const { TUIChatHeader: ContextTUIChatHeader } = useComponentContext('TUIChatHeader');
|
|
31
33
|
|
|
32
34
|
const TUIChatHeaderUIComponent = propTUIChatHeader
|
|
33
|
-
|
|
35
|
+
|| ContextTUIChatHeader || ChatHeaderDefault;
|
|
34
36
|
const conversation = propsConversation || contextConversation;
|
|
35
37
|
|
|
36
38
|
return (
|
|
@@ -39,9 +41,10 @@ function UnMemoizedTUIChatHeader<T extends TUIChatHeaderProps>(
|
|
|
39
41
|
conversation={conversation}
|
|
40
42
|
avatar={avatar}
|
|
41
43
|
opateIcon={headerOpateIcon}
|
|
44
|
+
enableCall={enableCall}
|
|
42
45
|
/>
|
|
43
46
|
);
|
|
44
47
|
}
|
|
45
48
|
|
|
46
|
-
export const
|
|
49
|
+
export const ChatHeader = React.memo(UnMemoizedTUIChatHeader) as
|
|
47
50
|
typeof UnMemoizedTUIChatHeader;
|