@tencentcloud/chat-uikit-react 2.2.7 → 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 +6 -0
- package/dist/cjs/_virtual/index.js +1 -0
- package/dist/cjs/components/Avatar/Avatar.d.ts +1 -1
- package/dist/cjs/components/{TUIChat/TUIChat.d.ts → Chat/Chat.d.ts} +8 -8
- package/dist/cjs/components/Chat/Chat.js +1 -0
- package/dist/cjs/components/Chat/index.js +1 -0
- package/dist/cjs/components/{TUIChatHeader/TUIChatHeader.d.ts → ChatHeader/ChatHeader.d.ts} +3 -3
- package/dist/cjs/components/ChatHeader/ChatHeader.js +1 -0
- package/dist/cjs/components/{TUIChatHeader/TUIChatHeaderDefault.d.ts → ChatHeader/ChatHeaderDefault.d.ts} +2 -2
- 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/type.d.ts +2 -0
- 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/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/context/{TUIChatActionContext.d.ts → ChatActionContext.d.ts} +1 -1
- package/dist/cjs/context/{TUIChatStateContext.d.ts → 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/{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/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 +885 -407
- 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/index.js +1 -1
- package/dist/cjs/locales/ja-JP/TUIConversation.js +1 -1
- package/dist/cjs/locales/ko-KR/TUIConversation.js +1 -1
- package/dist/cjs/locales/zh-CN/TUIConversation.js +1 -1
- package/dist/cjs/locales/zh-TW/TUIConversation.js +1 -1
- package/dist/esm/_virtual/index.js +1 -0
- package/dist/esm/components/Avatar/Avatar.d.ts +1 -1
- package/dist/esm/components/{TUIChat/TUIChat.d.ts → Chat/Chat.d.ts} +8 -8
- package/dist/esm/components/Chat/Chat.js +1 -0
- package/dist/esm/components/Chat/index.js +1 -0
- package/dist/esm/components/{TUIChatHeader/TUIChatHeader.d.ts → ChatHeader/ChatHeader.d.ts} +3 -3
- package/dist/esm/components/ChatHeader/ChatHeader.js +1 -0
- package/dist/esm/components/{TUIChatHeader/TUIChatHeaderDefault.d.ts → ChatHeader/ChatHeaderDefault.d.ts} +2 -2
- 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/type.d.ts +2 -0
- 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/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/context/{TUIChatActionContext.d.ts → ChatActionContext.d.ts} +1 -1
- package/dist/esm/context/{TUIChatStateContext.d.ts → 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/{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/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 +885 -407
- 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/index.js +1 -1
- package/dist/esm/locales/ja-JP/TUIConversation.js +1 -1
- package/dist/esm/locales/ko-KR/TUIConversation.js +1 -1
- package/dist/esm/locales/zh-CN/TUIConversation.js +1 -1
- package/dist/esm/locales/zh-TW/TUIConversation.js +1 -1
- package/package.json +2 -1
- package/src/components/Avatar/Avatar.tsx +33 -31
- package/src/components/{TUIChat/TUIChat.tsx → Chat/Chat.tsx} +15 -15
- package/src/components/{TUIChat → Chat}/hooks/useHandleMessage.tsx +1 -1
- package/src/components/{TUIChat → Chat}/hooks/useHandleMessageList.tsx +1 -1
- package/src/components/{TUIChat → Chat}/index.ts +1 -1
- package/src/components/{TUIChatHeader/TUIChatHeader.tsx → ChatHeader/ChatHeader.tsx} +5 -5
- package/src/components/{TUIChatHeader/TUIChatHeaderDefault.tsx → ChatHeader/ChatHeaderDefault.tsx} +2 -2
- package/src/components/ChatHeader/index.ts +2 -0
- package/src/components/{TUIChatHeader → ChatHeader}/styles/layout.scss +0 -8
- 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 +4 -2
- package/src/components/Checkbox/index.tsx +9 -9
- 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/TUIContactList/TUIContactList.tsx → Contact/ContactList/ContactList.tsx} +3 -3
- package/src/components/Contact/index.ts +3 -0
- package/src/components/{TUIContactSearch/TUIContactSearch.tsx → ContactSearch/ContactSearch.tsx} +8 -7
- 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 +36 -29
- package/src/components/ConversationCreate/index.ts +2 -1
- package/src/components/ConversationCreate/styles/{ConversationCreatGroupDetail.scss → ConversationCreateGroupDetail.scss} +6 -1
- package/src/components/ConversationCreate/styles/conversationCreateButton.scss +5 -0
- package/src/components/ConversationCreate/styles/index.scss +34 -2
- 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 +78 -60
- 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/EmptyStateIndicator/EmptyStateIndicator.tsx +2 -3
- package/src/components/Icon/Icon.tsx +8 -8
- package/src/components/Icon/config.ts +9 -0
- package/src/components/Icon/images/mute.svg +8 -0
- package/src/components/Icon/styles/index.scss +41 -6
- package/src/components/Icon/type.ts +2 -0
- package/src/components/Input/Input.tsx +24 -23
- package/src/components/{TUIMessage/TUIMessage.tsx → MessageElement/Message.tsx} +33 -33
- package/src/components/{TUIMessage → MessageElement}/MessageCustom.tsx +1 -1
- 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}/index.ts +1 -1
- package/src/components/{TUIMessage → MessageElement}/styles/layout.scss +1 -1
- 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 +2 -2
- 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/useMessageInputState.tsx +1 -1
- package/src/components/{TUIMessageInput → MessageInput}/hooks/useMessageInputText.tsx +2 -2
- package/src/components/MessageInput/index.ts +3 -0
- package/src/components/{TUIMessageInput → MessageInput}/styles/color.scss +1 -1
- package/src/components/{TUIMessageList/TUIMessageList.tsx → MessageList/MessageList.tsx} +5 -5
- package/src/components/{TUIMessageList → MessageList}/hooks/useMessageListElement.tsx +1 -1
- package/src/components/MessageList/index.ts +1 -0
- 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/Profile/Profile.tsx +46 -21
- 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/index.scss +2 -32
- package/src/components/{TUIProfile → Profile}/styles/layout.scss +1 -0
- package/src/components/index.ts +13 -11
- package/src/context/{TUIChatActionContext.tsx → ChatActionContext.tsx} +1 -1
- 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 +1 -0
- package/src/context/MessageContext.tsx +55 -0
- package/src/context/MessageInputContext.tsx +54 -0
- 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/index.ts +10 -0
- package/src/locales/ja-JP/TUIConversation.ts +4 -0
- package/src/locales/ko-KR/TUIConversation.ts +4 -0
- package/src/locales/zh-CN/TUIConversation.ts +4 -0
- package/src/locales/zh-TW/TUIConversation.ts +4 -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/TUIChat/TUIChat.js +0 -1
- package/dist/cjs/components/TUIChat/index.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/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/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/TUIChat/TUIChat.js +0 -1
- package/dist/esm/components/TUIChat/index.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/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/context/TUIConversationContext.js +0 -1
- package/src/components/ConversationCreate/ConversationCreatGroupDetail.tsx +0 -170
- package/src/components/ConversationPreview/ConversationListContainer.tsx +0 -20
- package/src/components/ConversationPreview/ConversationPreviewContent.tsx +0 -191
- 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/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 -58
- 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/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/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/dist/cjs/components/{TUIChat/TUIChatState.js → Chat/ChatState.js} +0 -0
- /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/{TUIChat → Chat}/server.js +0 -0
- /package/dist/cjs/components/{TUIChat → Chat}/utils.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/{TUIMessage → MessageElement}/utils/index.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/TUIChatState.js → Chat/ChatState.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/{TUIChat → Chat}/server.js +0 -0
- /package/dist/esm/components/{TUIChat → Chat}/utils.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/{TUIMessage → MessageElement}/utils/index.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/TUIChatState.tsx → Chat/ChatState.tsx} +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}/server.ts +0 -0
- /package/src/components/{TUIChat → Chat}/styles/index.scss +0 -0
- /package/src/components/{TUIChat → Chat}/styles/layout.scss +0 -0
- /package/src/components/{TUIChat → Chat}/utils.ts +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/{TUIContact/TUIContactInfo → Contact/ContactInfo}/index.scss +0 -0
- /package/src/components/{TUIContact/TUIContactList → Contact/ContactList}/index.scss +0 -0
- /package/src/components/{TUIContact → Contact}/hooks/useTUIContact.tsx +0 -0
- /package/src/components/{TUIContact → Contact}/index.scss +0 -0
- /package/src/components/{TUIContactSearch → ContactSearch}/hooks/useContactSearch.tsx +0 -0
- /package/src/components/{TUIContactSearch → ContactSearch}/index.scss +0 -0
- /package/src/components/{TUIMessage → MessageElement}/MessageAudio.tsx +0 -0
- /package/src/components/{TUIMessage → MessageElement}/MessageAvatar.tsx +0 -0
- /package/src/components/{TUIMessage → MessageElement}/MessageBubble.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}/MessageStatus.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/useMessageHandler.ts +0 -0
- /package/src/components/{TUIMessage → MessageElement}/hooks/useMessagePluginElement.tsx +0 -0
- /package/src/components/{TUIMessage → MessageElement}/hooks/useMessageReply.ts +0 -0
- /package/src/components/{TUIMessage → MessageElement}/styles/color.scss +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/{TUIMessage → MessageElement}/utils/index.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/useHandleForwardMessage.tsx +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}/hooks/useUploadPicker.tsx +0 -0
- /package/src/components/{TUIMessageInput → MessageInput}/styles/index.scss +0 -0
- /package/src/components/{TUIMessageInput → MessageInput}/styles/layout.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/{TUIMessageList → MessageList}/styles/layout.scss +0 -0
- /package/src/components/{TUIProfile/TUIProfileDefault.tsx → Profile/ProfileDefault.tsx} +0 -0
- /package/src/components/{TUIProfile → Profile}/hooks/index.ts +0 -0
- /package/src/components/{TUIProfile → Profile}/hooks/useMyProfile.tsx +0 -0
- /package/src/components/{TUIProfile → Profile}/styles/color.scss +0 -0
|
@@ -4,21 +4,21 @@ import { Icon, IconTypes } from '../Icon';
|
|
|
4
4
|
import './styles/index.scss';
|
|
5
5
|
|
|
6
6
|
interface onChangeParams {
|
|
7
|
-
checked?: boolean
|
|
8
|
-
value?: any
|
|
7
|
+
checked?: boolean;
|
|
8
|
+
value?: any;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
interface SelectProps {
|
|
12
|
-
checked?: boolean
|
|
13
|
-
className?: string
|
|
14
|
-
onChange?: (data?: onChangeParams) => void
|
|
15
|
-
value?: any
|
|
16
|
-
id?: string
|
|
12
|
+
checked?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
onChange?: (data?: onChangeParams) => void;
|
|
15
|
+
value?: any;
|
|
16
|
+
id?: string;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export function Checkbox<
|
|
20
|
-
T extends SelectProps
|
|
21
|
-
>(props:React.PropsWithChildren<T>) {
|
|
20
|
+
T extends SelectProps,
|
|
21
|
+
>(props: React.PropsWithChildren<T>) {
|
|
22
22
|
const {
|
|
23
23
|
checked: propsChecked = false,
|
|
24
24
|
className,
|
|
@@ -3,16 +3,16 @@ import { useTranslation } from 'react-i18next';
|
|
|
3
3
|
import {
|
|
4
4
|
TUIContactContextProvider,
|
|
5
5
|
TUIContactContextValue,
|
|
6
|
-
} from '../../context/
|
|
6
|
+
} from '../../context/ContactContext';
|
|
7
7
|
import { isH5 } from '../../utils/env';
|
|
8
8
|
import { useUIManager } from '../../context';
|
|
9
9
|
import useTUIContact from './hooks/useTUIContact';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { ContactList } from './ContactList/ContactList';
|
|
11
|
+
import { ContactSearch } from '../ContactSearch/ContactSearch';
|
|
12
12
|
import { Icon, IconTypes } from '../Icon';
|
|
13
13
|
import './index.scss';
|
|
14
14
|
|
|
15
|
-
export function
|
|
15
|
+
export function UnMemoizedContact<T>(
|
|
16
16
|
props: PropsWithChildren<T>,
|
|
17
17
|
): React.ReactElement {
|
|
18
18
|
const { children } = props;
|
|
@@ -57,41 +57,41 @@ export function UnMemoizedTUIContact<T>(
|
|
|
57
57
|
<TUIContactContextProvider value={TUIContactValue}>
|
|
58
58
|
{children || (
|
|
59
59
|
<div className={`tui-contacts ${isH5 ? 'tui-contacts-h5' : ''} `}>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
</div>
|
|
66
|
-
<Icon
|
|
67
|
-
onClick={addFriend}
|
|
68
|
-
type={IconTypes.ADDFRIEND}
|
|
69
|
-
width={24}
|
|
70
|
-
height={24}
|
|
71
|
-
/>
|
|
60
|
+
{!isShowAddFriend && (
|
|
61
|
+
<>
|
|
62
|
+
<div className="tui-contacts-header">
|
|
63
|
+
<div className="tui-contact-input">
|
|
64
|
+
<ContactSearch />
|
|
72
65
|
</div>
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
66
|
+
<Icon
|
|
67
|
+
onClick={addFriend}
|
|
68
|
+
type={IconTypes.ADDFRIEND}
|
|
69
|
+
width={24}
|
|
70
|
+
height={24}
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
<ContactList />
|
|
74
|
+
</>
|
|
75
|
+
)}
|
|
76
|
+
{isShowAddFriend && (
|
|
77
|
+
<>
|
|
78
|
+
<div className="tui-contacts-add-header">
|
|
79
|
+
<Icon
|
|
80
|
+
onClick={addFriendBack}
|
|
81
|
+
type={IconTypes.BACK}
|
|
82
|
+
width={9}
|
|
83
|
+
height={16}
|
|
84
|
+
/>
|
|
85
|
+
<div className="tui-contacts-add-header-title">
|
|
86
|
+
{t('TUIContact.Add Friend')}
|
|
88
87
|
</div>
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
</div>
|
|
89
|
+
<ContactSearch />
|
|
90
|
+
</>
|
|
91
|
+
)}
|
|
92
92
|
</div>
|
|
93
93
|
)}
|
|
94
94
|
</TUIContactContextProvider>
|
|
95
95
|
);
|
|
96
96
|
}
|
|
97
|
-
export const
|
|
97
|
+
export const Contact = React.memo(UnMemoizedContact);
|
|
@@ -11,10 +11,10 @@ import { FriendApplicationInfo } from './friendApplication';
|
|
|
11
11
|
import './index.scss';
|
|
12
12
|
|
|
13
13
|
interface TUIContactInfoProps {
|
|
14
|
-
className?: string
|
|
15
|
-
showChats?: () => void
|
|
14
|
+
className?: string;
|
|
15
|
+
showChats?: () => void;
|
|
16
16
|
}
|
|
17
|
-
export function
|
|
17
|
+
export function UnMemoizedContactInfo<T extends TUIContactInfoProps>(
|
|
18
18
|
props: PropsWithChildren<T>,
|
|
19
19
|
): React.ReactElement {
|
|
20
20
|
const { showChats } = props;
|
|
@@ -32,4 +32,4 @@ export function UnMemoizedTUIContactInfo<T extends TUIContactInfoProps>(
|
|
|
32
32
|
</div>
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
|
-
export const
|
|
35
|
+
export const ContactInfo = React.memo(UnMemoizedContactInfo);
|
|
@@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
3
3
|
import TencentCloudChat from '@tencentcloud/chat';
|
|
4
4
|
import { isH5 } from '../../../utils/env';
|
|
5
5
|
import { useUIManager, useTUIContactContext } from '../../../context';
|
|
6
|
-
import useContactInfo from '../
|
|
6
|
+
import useContactInfo from '../ContactInfo/hooks/useContactInfo';
|
|
7
7
|
import useTUIContact from '../hooks/useTUIContact';
|
|
8
8
|
import { Avatar, defaultUserAvatar } from '../../Avatar';
|
|
9
9
|
import rightArrow from '../../Icon/images/right-arrow.svg';
|
|
@@ -18,7 +18,7 @@ interface RenderContactListProps {
|
|
|
18
18
|
setShow: (value: boolean) => void;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
function
|
|
21
|
+
function UnMemoizedContactList<T>(): React.ReactElement {
|
|
22
22
|
const { setActiveContact } = useUIManager();
|
|
23
23
|
const { t } = useTranslation();
|
|
24
24
|
const {
|
|
@@ -172,4 +172,4 @@ function UnMemoizedTUIContactList<T>(): React.ReactElement {
|
|
|
172
172
|
)
|
|
173
173
|
);
|
|
174
174
|
}
|
|
175
|
-
export const
|
|
175
|
+
export const ContactList = React.memo(UnMemoizedContactList);
|
package/src/components/{TUIContactSearch/TUIContactSearch.tsx → ContactSearch/ContactSearch.tsx}
RENAMED
|
@@ -7,7 +7,7 @@ import { Avatar, defaultUserAvatar } from '../Avatar';
|
|
|
7
7
|
import { Input } from '../Input';
|
|
8
8
|
import './index.scss';
|
|
9
9
|
|
|
10
|
-
export function
|
|
10
|
+
export function UnMemoizedContactSearch<T>(): React.ReactElement {
|
|
11
11
|
const { setActiveContact } = useUIManager('TUIContactSearch');
|
|
12
12
|
const { t } = useTranslation();
|
|
13
13
|
const { friendList, setShowContactList } = useTUIContactContext('TUIContactList');
|
|
@@ -47,7 +47,7 @@ export function UnMemoizedTUIContactSearch<T>(): React.ReactElement {
|
|
|
47
47
|
const setContactProfile = async (profile: any) => {
|
|
48
48
|
const isFriend = await checkFriend(profile);
|
|
49
49
|
if (isFriend) {
|
|
50
|
-
const friendProfile = friendList?.find(
|
|
50
|
+
const friendProfile = friendList?.find(item => item.userID === searchedValue);
|
|
51
51
|
friendProfile && setActiveContact({ type: 'friend', data: friendProfile });
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
@@ -72,11 +72,12 @@ export function UnMemoizedTUIContactSearch<T>(): React.ReactElement {
|
|
|
72
72
|
/>
|
|
73
73
|
{isShowSearchResult && searchResult.length === 0
|
|
74
74
|
? (
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
<div className="tui-contact-search-item">
|
|
76
|
+
{t('TUIContact.No Result')}
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
</div>
|
|
79
|
+
)
|
|
80
|
+
: searchResult.map((item, index) => {
|
|
80
81
|
const { userID, avatar, nick } = item;
|
|
81
82
|
return (
|
|
82
83
|
<div
|
|
@@ -96,4 +97,4 @@ export function UnMemoizedTUIContactSearch<T>(): React.ReactElement {
|
|
|
96
97
|
</div>
|
|
97
98
|
);
|
|
98
99
|
}
|
|
99
|
-
export const
|
|
100
|
+
export const ContactSearch = React.memo(UnMemoizedContactSearch);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@use "../../styles/colors/color-theme" as *;
|
|
2
|
+
|
|
3
|
+
.uikit-conversation-actions {
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: flex-end;
|
|
6
|
+
flex: 1 1;
|
|
7
|
+
|
|
8
|
+
.uikit-conversation-actions__container {
|
|
9
|
+
top: 0;
|
|
10
|
+
right: 0;
|
|
11
|
+
box-shadow: 0 0 10px rgba(0, 0, 0, 10%);
|
|
12
|
+
bottom: initial;
|
|
13
|
+
padding: 14px 0;
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
text-align: start;
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
|
|
18
|
+
.uikit-conversation-actions__item {
|
|
19
|
+
font-size: 16px;
|
|
20
|
+
/* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */
|
|
21
|
+
font-family: PingFangSC-Medium;
|
|
22
|
+
line-height: 19px;
|
|
23
|
+
padding: 6px 16px;
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
font-weight: 500;
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
|
|
28
|
+
&:hover {
|
|
29
|
+
@include theme() {
|
|
30
|
+
background-color: get(dropdown-color-active);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.uikit-conversation-actions__item--delete {
|
|
36
|
+
@include theme() {
|
|
37
|
+
color: get(text-color-error);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.uikit-conversation-actions__popup-icon {
|
|
43
|
+
transform: scale(1.5);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
// ConversationActions.tsx
|
|
2
|
+
import React, { useRef, useEffect } from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { IConversationModel } from '@tencentcloud/chat-uikit-engine';
|
|
5
|
+
import cs from 'classnames';
|
|
6
|
+
|
|
7
|
+
import { Plugins } from '../Plugins';
|
|
8
|
+
import { Icon, IconTypes } from '../Icon';
|
|
9
|
+
|
|
10
|
+
import './ConversationActions.scss';
|
|
11
|
+
|
|
12
|
+
interface IConversationActionsConfig {
|
|
13
|
+
/** Determines whether the pin button appears on the conversation actions list view. (Default: True) */
|
|
14
|
+
enablePin?: boolean;
|
|
15
|
+
/** Determines whether the mute button appears on the conversation actions list view. (Default: True) */
|
|
16
|
+
enableMute?: boolean;
|
|
17
|
+
/** Determines whether the delete button appears on the conversation actions list view. (Default: True) */
|
|
18
|
+
enableDelete?: boolean;
|
|
19
|
+
/** Function to override the default behavior when user pin or unpin a conversation. */
|
|
20
|
+
onConversationPin?: (conversation: IConversationModel, e?: React.MouseEvent) => void;
|
|
21
|
+
/** Function to override the default behavior when user mute or unmute a conversation. */
|
|
22
|
+
onConversationMute?: (conversation: IConversationModel, e?: React.MouseEvent) => void;
|
|
23
|
+
/** Function to override the default behavior when user delete a conversation. */
|
|
24
|
+
onConversationDelete?: (conversation: IConversationModel, e?: React.MouseEvent) => void;
|
|
25
|
+
/**
|
|
26
|
+
* An object containing custom conversation actions (key) and object (value).
|
|
27
|
+
* Each value is an object with the following properties:
|
|
28
|
+
* enable: Determines whether the custom action is enabled. (Default: True)
|
|
29
|
+
* label: The label of the custom action.
|
|
30
|
+
* onClick: The function to be called when the custom action is clicked.
|
|
31
|
+
* Note: The key of the custom action must be unique.
|
|
32
|
+
*/
|
|
33
|
+
customConversationActions?: Record<string, IConversationActionItem>;
|
|
34
|
+
/** The icon react element to be displayed in the action popup. */
|
|
35
|
+
PopupIcon?: React.ReactElement;
|
|
36
|
+
/** An array of react elements to be displayed in the action popup. */
|
|
37
|
+
PopupElements?: React.ReactElement[];
|
|
38
|
+
/** The function to be called when the action popup is clicked. */
|
|
39
|
+
onClick?: (e: React.MouseEvent, key?: string, conversation?: IConversationModel) => void;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface IConversationActionsProps extends IConversationActionsConfig {
|
|
43
|
+
/** The conversation model. */
|
|
44
|
+
conversation: IConversationModel;
|
|
45
|
+
/** The class name of the root element. */
|
|
46
|
+
className?: string;
|
|
47
|
+
/** The style of the root element. */
|
|
48
|
+
style?: React.CSSProperties;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface IConversationActionItem {
|
|
52
|
+
/** Determines whether the custom action is enabled. (Default: True) */
|
|
53
|
+
enable?: boolean;
|
|
54
|
+
/** label: The label of the custom action. */
|
|
55
|
+
label: string;
|
|
56
|
+
/** onClick: The function to be called when the custom action is clicked. */
|
|
57
|
+
onClick: (conversation: IConversationModel, e?: React.MouseEvent) => void;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
interface IPluginsRef {
|
|
61
|
+
closeMore?: () => void;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const ConversationActions = (props: IConversationActionsProps) => {
|
|
65
|
+
const {
|
|
66
|
+
conversation,
|
|
67
|
+
PopupIcon,
|
|
68
|
+
enablePin = true,
|
|
69
|
+
enableMute: isMuteEnabled = true,
|
|
70
|
+
enableDelete: isDeleteEnabled = true,
|
|
71
|
+
onConversationPin,
|
|
72
|
+
onConversationMute,
|
|
73
|
+
onConversationDelete,
|
|
74
|
+
customConversationActions,
|
|
75
|
+
PopupElements,
|
|
76
|
+
onClick,
|
|
77
|
+
className,
|
|
78
|
+
style,
|
|
79
|
+
} = props;
|
|
80
|
+
|
|
81
|
+
const { t } = useTranslation();
|
|
82
|
+
const pluginsRef = useRef<IPluginsRef>(null);
|
|
83
|
+
const [conversationActions, setConversationActions] = React.useState<Record<string, IConversationActionItem>>({});
|
|
84
|
+
|
|
85
|
+
const defaultConversationActions: Record<string, IConversationActionItem> = {
|
|
86
|
+
delete: {
|
|
87
|
+
enable: isDeleteEnabled,
|
|
88
|
+
label: t('TUIConversation.Delete'),
|
|
89
|
+
onClick: onConversationDelete || ((_conversation: IConversationModel) => { _conversation.deleteConversation(); }),
|
|
90
|
+
},
|
|
91
|
+
pin: {
|
|
92
|
+
enable: enablePin,
|
|
93
|
+
label: t(conversation.isPinned ? 'TUIConversation.Unpin' : 'TUIConversation.Pin'),
|
|
94
|
+
onClick: onConversationPin || ((_conversation: IConversationModel) => { _conversation.pinConversation(); }),
|
|
95
|
+
},
|
|
96
|
+
mute: {
|
|
97
|
+
enable: isMuteEnabled,
|
|
98
|
+
label: t(conversation.isMuted ? 'TUIConversation.Unmute' : 'TUIConversation.Mute'),
|
|
99
|
+
onClick: onConversationMute || ((_conversation: IConversationModel) => { _conversation.muteConversation(); }),
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
setConversationActions({
|
|
105
|
+
...defaultConversationActions,
|
|
106
|
+
...customConversationActions,
|
|
107
|
+
});
|
|
108
|
+
}, [conversation, customConversationActions]);
|
|
109
|
+
|
|
110
|
+
const onClickMenuItem = (e: React.MouseEvent, key: string) => {
|
|
111
|
+
pluginsRef?.current?.closeMore && pluginsRef.current.closeMore();
|
|
112
|
+
onClick?.(e, key, conversation);
|
|
113
|
+
conversationActions[key]?.onClick(conversation, e);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<div
|
|
118
|
+
className={cs({
|
|
119
|
+
'uikit-conversation-actions': true,
|
|
120
|
+
className,
|
|
121
|
+
})}
|
|
122
|
+
style={style}
|
|
123
|
+
onClick={(e: React.MouseEvent) => {
|
|
124
|
+
e.stopPropagation();
|
|
125
|
+
}}
|
|
126
|
+
>
|
|
127
|
+
<Plugins
|
|
128
|
+
customClass="uikit-conversation-actions__container"
|
|
129
|
+
ref={pluginsRef}
|
|
130
|
+
plugins={(
|
|
131
|
+
PopupElements
|
|
132
|
+
|| (
|
|
133
|
+
Object.keys(conversationActions).map((key: string) => {
|
|
134
|
+
if (conversationActions[key].enable === false) return null;
|
|
135
|
+
return (
|
|
136
|
+
<div
|
|
137
|
+
key={key}
|
|
138
|
+
className={cs(
|
|
139
|
+
'uikit-conversation-actions__item',
|
|
140
|
+
[`uikit-conversation-actions__item--${key}`],
|
|
141
|
+
)}
|
|
142
|
+
onClick={e => onClickMenuItem(e, key)}
|
|
143
|
+
>
|
|
144
|
+
{conversationActions[key].label}
|
|
145
|
+
</div>
|
|
146
|
+
);
|
|
147
|
+
})
|
|
148
|
+
)
|
|
149
|
+
)}
|
|
150
|
+
showNumber={0}
|
|
151
|
+
MoreIcon={(
|
|
152
|
+
PopupIcon
|
|
153
|
+
|| (
|
|
154
|
+
<Icon
|
|
155
|
+
className="uikit-conversation-actions__popup-icon"
|
|
156
|
+
width={16}
|
|
157
|
+
height={16}
|
|
158
|
+
type={IconTypes.MORE}
|
|
159
|
+
/>
|
|
160
|
+
)
|
|
161
|
+
)}
|
|
162
|
+
/>
|
|
163
|
+
</div>
|
|
164
|
+
);
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export {
|
|
168
|
+
ConversationActions,
|
|
169
|
+
IConversationActionsProps,
|
|
170
|
+
IConversationActionItem,
|
|
171
|
+
IConversationActionsConfig,
|
|
172
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ConversationActions';
|
|
@@ -1,31 +1,56 @@
|
|
|
1
|
-
import React, { useMemo, useState } from 'react';
|
|
1
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import '
|
|
4
|
-
import
|
|
3
|
+
import { CreateGroupParams, IConversationModel, TUIConversationService } from '@tencentcloud/chat-uikit-engine';
|
|
4
|
+
import cs from 'classnames';
|
|
5
|
+
|
|
5
6
|
import { Icon, IconTypes } from '../Icon';
|
|
7
|
+
import { ConversationCreateButton } from './ConversationCreateButton';
|
|
6
8
|
import { ConversationCreateUserSelectList } from './ConversationCreateUserSelectList';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
import
|
|
9
|
+
import { ConversationCreateGroupDetail } from './ConversationCreateGroupDetail';
|
|
10
|
+
|
|
11
|
+
import './styles/index.scss';
|
|
10
12
|
|
|
11
|
-
export interface
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
export interface IConversationCreateProps {
|
|
14
|
+
visible?: boolean;
|
|
15
|
+
className?: string;
|
|
16
|
+
style?: React.CSSProperties;
|
|
17
|
+
onBeforeCreateConversation?: (params: string | CreateGroupParams) => string | CreateGroupParams;
|
|
18
|
+
onConversationCreated?: (conversation: IConversationModel) => void;
|
|
19
|
+
onChangeCreateModelVisible: (visible: boolean) => void;
|
|
20
|
+
conversationList?: IConversationModel[];
|
|
15
21
|
}
|
|
16
22
|
export enum PageStateTypes {
|
|
17
|
-
USER_SELECT='Next',
|
|
18
|
-
CREATE_DETAIL='Create',
|
|
19
|
-
GROUP_TYPE='GroupType',
|
|
23
|
+
USER_SELECT = 'Next',
|
|
24
|
+
CREATE_DETAIL = 'Create',
|
|
25
|
+
GROUP_TYPE = 'GroupType',
|
|
20
26
|
}
|
|
21
|
-
export function ConversationCreate<T extends
|
|
22
|
-
const {
|
|
27
|
+
export function ConversationCreate<T extends IConversationCreateProps>(props: T) {
|
|
28
|
+
const {
|
|
29
|
+
visible = true,
|
|
30
|
+
className,
|
|
31
|
+
style,
|
|
32
|
+
onChangeCreateModelVisible,
|
|
33
|
+
conversationList = [],
|
|
34
|
+
onBeforeCreateConversation,
|
|
35
|
+
onConversationCreated,
|
|
36
|
+
} = props;
|
|
23
37
|
const { t } = useTranslation();
|
|
38
|
+
|
|
39
|
+
const [showCreateModel, setShowCreateModel] = useState(false);
|
|
24
40
|
const [isCreateGroup, setIsCreateGroup] = useState(false);
|
|
25
41
|
const [pageState, setPageState] = useState<PageStateTypes>(PageStateTypes.USER_SELECT);
|
|
26
42
|
const [selectList, setSelectList] = useState([]);
|
|
27
|
-
|
|
28
|
-
const
|
|
43
|
+
|
|
44
|
+
const _onConversationCreated = (conversation: IConversationModel) => {
|
|
45
|
+
setShowCreateModel(false);
|
|
46
|
+
resetCreatePageState();
|
|
47
|
+
TUIConversationService.switchConversation(conversation.conversationID);
|
|
48
|
+
onConversationCreated?.(conversation);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
onChangeCreateModelVisible(showCreateModel);
|
|
53
|
+
}, [onChangeCreateModelVisible, showCreateModel]);
|
|
29
54
|
|
|
30
55
|
const back = () => {
|
|
31
56
|
if (isCreateGroup) {
|
|
@@ -43,39 +68,69 @@ export function ConversationCreate<T extends ConversationCreateProps>(props:T) {
|
|
|
43
68
|
default:
|
|
44
69
|
}
|
|
45
70
|
} else {
|
|
46
|
-
|
|
71
|
+
setShowCreateModel(false);
|
|
72
|
+
resetCreatePageState();
|
|
47
73
|
}
|
|
48
74
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
75
|
+
|
|
76
|
+
function resetCreatePageState() {
|
|
77
|
+
setIsCreateGroup(false);
|
|
78
|
+
setPageState(PageStateTypes.USER_SELECT);
|
|
79
|
+
setSelectList([]);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return useMemo(() => {
|
|
83
|
+
if (!visible) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<div
|
|
89
|
+
className={cs(
|
|
90
|
+
'uikit-conversation-create-container',
|
|
91
|
+
className,
|
|
92
|
+
)}
|
|
93
|
+
style={style}
|
|
94
|
+
>
|
|
95
|
+
{!showCreateModel && (
|
|
96
|
+
<ConversationCreateButton
|
|
97
|
+
onClick={() => setShowCreateModel(true)}
|
|
98
|
+
/>
|
|
99
|
+
)}
|
|
100
|
+
{showCreateModel && (
|
|
101
|
+
<div className="tui-conversation-create">
|
|
102
|
+
<div className="tui-conversation-create-header">
|
|
103
|
+
<Icon onClick={back} type={IconTypes.BACK} width={9} height={16} />
|
|
104
|
+
<div className="title">{t(!isCreateGroup ? 'TUIConversation.Start chat' : 'TUIConversation.Add Participants')}</div>
|
|
105
|
+
</div>
|
|
106
|
+
{
|
|
107
|
+
pageState === PageStateTypes.USER_SELECT
|
|
108
|
+
? (
|
|
109
|
+
<ConversationCreateUserSelectList
|
|
110
|
+
isCreateGroup={isCreateGroup}
|
|
111
|
+
setIsCreateGroup={setIsCreateGroup}
|
|
112
|
+
selectList={selectList}
|
|
113
|
+
setSelectList={setSelectList as React.Dispatch<React.SetStateAction<any[]>>}
|
|
114
|
+
conversationList={conversationList}
|
|
115
|
+
onBeforeCreateConversation={onBeforeCreateConversation}
|
|
116
|
+
onConversationCreated={_onConversationCreated}
|
|
117
|
+
setPageState={setPageState}
|
|
118
|
+
/>
|
|
119
|
+
)
|
|
120
|
+
: (
|
|
121
|
+
<ConversationCreateGroupDetail
|
|
122
|
+
pageState={pageState}
|
|
123
|
+
setPageState={setPageState}
|
|
124
|
+
profileList={selectList.map((item: any) => item?.profile)}
|
|
125
|
+
onBeforeCreateConversation={onBeforeCreateConversation}
|
|
126
|
+
onConversationCreated={_onConversationCreated}
|
|
127
|
+
/>
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
</div>
|
|
131
|
+
)}
|
|
54
132
|
</div>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
setIsCreateGroup={setIsCreateGroup}
|
|
59
|
-
className={className}
|
|
60
|
-
selectList={selectList}
|
|
61
|
-
// eslint-disable-next-line
|
|
62
|
-
// @ts-ignore
|
|
63
|
-
setSelectList={setSelectList}
|
|
64
|
-
conversationList={conversationList}
|
|
65
|
-
setConversationCreated={setConversationCreated}
|
|
66
|
-
setPageState={setPageState}
|
|
67
|
-
/>
|
|
68
|
-
) : (
|
|
69
|
-
<ConversationCreatGroupDetail
|
|
70
|
-
pageState={pageState}
|
|
71
|
-
setPageState={setPageState}
|
|
72
|
-
profileList={selectList.map((item: any) => item?.profile)}
|
|
73
|
-
// eslint-disable-next-line
|
|
74
|
-
// @ts-ignore
|
|
75
|
-
createConversation={createConversation}
|
|
76
|
-
setConversationCreated={setConversationCreated}
|
|
77
|
-
/>
|
|
78
|
-
)}
|
|
79
|
-
</>
|
|
80
|
-
), [isCreateGroup, selectList, pageState]);
|
|
133
|
+
|
|
134
|
+
);
|
|
135
|
+
}, [visible, className, showCreateModel, isCreateGroup, pageState, selectList, conversationList, onBeforeCreateConversation]);
|
|
81
136
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// ConversationSearch.tsx
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import cs from 'classnames';
|
|
4
|
+
import { Icon, IconTypes } from '../Icon';
|
|
5
|
+
import './styles/conversationCreateButton.scss';
|
|
6
|
+
|
|
7
|
+
interface IConversationCreateButtonProps {
|
|
8
|
+
visible?: boolean;
|
|
9
|
+
onClick?: (event: React.BaseSyntheticEvent) => void;
|
|
10
|
+
height?: number;
|
|
11
|
+
width?: number;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const ConversationCreateButton = (props: IConversationCreateButtonProps) => {
|
|
16
|
+
const {
|
|
17
|
+
visible = true,
|
|
18
|
+
className,
|
|
19
|
+
onClick,
|
|
20
|
+
height = 24,
|
|
21
|
+
width = 24,
|
|
22
|
+
} = props;
|
|
23
|
+
|
|
24
|
+
if (!visible) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div className={cs(
|
|
30
|
+
'tui-conversation-create-button',
|
|
31
|
+
className)}
|
|
32
|
+
>
|
|
33
|
+
<Icon
|
|
34
|
+
onClick={onClick}
|
|
35
|
+
type={IconTypes.CREATE}
|
|
36
|
+
height={height}
|
|
37
|
+
width={width}
|
|
38
|
+
/>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
ConversationCreateButton,
|
|
45
|
+
IConversationCreateButtonProps,
|
|
46
|
+
};
|