@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
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { CreateGroupParams, IConversationModel } from '@tencentcloud/chat-uikit-engine';
|
|
4
|
+
|
|
5
|
+
interface IConversationCreateProps {
|
|
6
|
+
visible?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
style?: React__default.CSSProperties;
|
|
9
|
+
onBeforeCreateConversation?: (params: string | CreateGroupParams) => string | CreateGroupParams;
|
|
10
|
+
onConversationCreated?: (conversation: IConversationModel) => void;
|
|
11
|
+
onChangeCreateModelVisible: (visible: boolean) => void;
|
|
12
|
+
conversationList?: IConversationModel[];
|
|
13
|
+
}
|
|
14
|
+
declare enum PageStateTypes {
|
|
15
|
+
USER_SELECT = "Next",
|
|
16
|
+
CREATE_DETAIL = "Create",
|
|
17
|
+
GROUP_TYPE = "GroupType"
|
|
18
|
+
}
|
|
19
|
+
declare function ConversationCreate<T extends IConversationCreateProps>(props: T): react_jsx_runtime.JSX.Element | null;
|
|
20
|
+
|
|
21
|
+
export { ConversationCreate, IConversationCreateProps, PageStateTypes };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useState as r,useEffect as n,useMemo as i}from"react";import{useTranslation as a}from"react-i18next";import{TUIConversationService as s}from"@tencentcloud/chat-uikit-engine";import c from"../../node_modules/classnames/index.js";import{Icon as C}from"../Icon/Icon.js";import{IconTypes as l}from"../Icon/type.js";import{ConversationCreateButton as m}from"./ConversationCreateButton.js";import{ConversationCreateUserSelectList as v}from"./ConversationCreateUserSelectList.js";import{ConversationCreateGroupDetail as E}from"./ConversationCreateGroupDetail.js";var u;function f(f){var p=f.visible,d=void 0===p||p,S=f.className,T=f.style,L=f.onChangeCreateModelVisible,h=f.conversationList,_=void 0===h?[]:h,R=f.onBeforeCreateConversation,U=f.onConversationCreated,I=a().t,A=r(!1),j=A[0],P=A[1],g=r(!1),k=g[0],G=g[1],N=r(u.USER_SELECT),b=N[0],x=N[1],y=r([]),B=y[0],D=y[1],w=function(e){P(!1),Y(),s.switchConversation(e.conversationID),null==U||U(e)};n((function(){L(j)}),[L,j]);var O=function(){if(k)switch(b){case u.USER_SELECT:G(!1);break;case u.CREATE_DETAIL:x(u.USER_SELECT),D([]);break;case u.GROUP_TYPE:x(u.CREATE_DETAIL)}else P(!1),Y()};function Y(){G(!1),x(u.USER_SELECT),D([])}return i((function(){return d?t("div",e({className:c("uikit-conversation-create-container",S),style:T},{children:[!j&&o(m,{onClick:function(){return P(!0)}}),j&&t("div",e({className:"tui-conversation-create"},{children:[t("div",e({className:"tui-conversation-create-header"},{children:[o(C,{onClick:O,type:l.BACK,width:9,height:16}),o("div",e({className:"title"},{children:I(k?"TUIConversation.Add Participants":"TUIConversation.Start chat")}))]})),b===u.USER_SELECT?o(v,{isCreateGroup:k,setIsCreateGroup:G,selectList:B,setSelectList:D,conversationList:_,onBeforeCreateConversation:R,onConversationCreated:w,setPageState:x}):o(E,{pageState:b,setPageState:x,profileList:B.map((function(e){return null==e?void 0:e.profile})),onBeforeCreateConversation:R,onConversationCreated:w})]}))]})):null}),[d,S,j,k,b,B,_,R])}!function(e){e.USER_SELECT="Next",e.CREATE_DETAIL="Create",e.GROUP_TYPE="GroupType"}(u||(u={}));export{f as ConversationCreate,u as PageStateTypes};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
interface IConversationCreateButtonProps {
|
|
5
|
+
visible?: boolean;
|
|
6
|
+
onClick?: (event: React__default.BaseSyntheticEvent) => void;
|
|
7
|
+
height?: number;
|
|
8
|
+
width?: number;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const ConversationCreateButton: (props: IConversationCreateButtonProps) => react_jsx_runtime.JSX.Element | null;
|
|
12
|
+
|
|
13
|
+
export { ConversationCreateButton, IConversationCreateButtonProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__assign as o}from"tslib";import{jsx as i}from"react/jsx-runtime";import t from"../../node_modules/classnames/index.js";import{Icon as r}from"../Icon/Icon.js";import{IconTypes as e}from"../Icon/type.js";var n=function(n){var m=n.visible,s=void 0===m||m,c=n.className,a=n.onClick,l=n.height,d=void 0===l?24:l,p=n.width,v=void 0===p?24:p;return s?i("div",o({className:t("tui-conversation-create-button",c)},{children:i(r,{onClick:a,type:e.CREATE,height:d,width:v})})):null};export{n as ConversationCreateButton};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { Profile } from '@tencentcloud/chat';
|
|
4
|
+
import { CreateGroupParams, IConversationModel } from '@tencentcloud/chat-uikit-engine';
|
|
5
|
+
import { PageStateTypes } from './ConversationCreate.js';
|
|
6
|
+
|
|
7
|
+
interface ConversationCreateGroupDetailProps {
|
|
8
|
+
profileList: Profile[];
|
|
9
|
+
pageState: PageStateTypes;
|
|
10
|
+
setPageState: React__default.Dispatch<React__default.SetStateAction<PageStateTypes>>;
|
|
11
|
+
onBeforeCreateConversation?: (params: CreateGroupParams) => void;
|
|
12
|
+
onConversationCreated?: (conversation: IConversationModel) => void;
|
|
13
|
+
}
|
|
14
|
+
declare function ConversationCreateGroupDetail(props: ConversationCreateGroupDetailProps): react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { ConversationCreateGroupDetail, ConversationCreateGroupDetailProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__spreadArray as e,__assign as t,__awaiter as r,__generator as o}from"tslib";import{jsxs as n,Fragment as a,jsx as i}from"react/jsx-runtime";import{useState as c}from"react";import{useTranslation as s}from"react-i18next";import{Input as u}from"../Input/Input.js";import{Icon as p}from"../Icon/Icon.js";import{IconTypes as l}from"../Icon/type.js";import{Toast as m}from"../Toast/index.js";import{Avatar as d}from"../Avatar/Avatar.js";import{defaultUserAvatar as v,defaultGroupAvatarAVChatRoom as f,defaultGroupAvatarMeeting as g,defaultGroupAvatarPublic as h,defaultGroupAvatarWork as C}from"../Avatar/default.js";import{PageStateTypes as x}from"./ConversationCreate.js";import{GroupType as I,ConversationGroupTypeInfo as N,typeInfoList as b}from"./ConversationGroupTypeInfo.js";import"@tencentcloud/tui-core";import{useUIManager as T}from"../../context/UIManagerContext.js";import"../../context/MessageContext.js";import"@tencentcloud/chat-uikit-engine";import{createGroupConversation as y}from"../../hooks/useConversation.js";function j(j){var k=this,U=j.profileList,P=j.pageState,G=j.setPageState,A=j.onBeforeCreateConversation,D=j.onConversationCreated,R=s().t,O=T();O.setActiveConversation;var S=O.myProfile,w=e([],U,!0);S&&w.unshift(S);var L=w.map((function(e){return e.nick||e.userID})).toString(),M=c(L.length>=15?"".concat(L.slice(0,12),"..."):L),W=M[0],_=M[1],E=c(""),Y=E[0],q=E[1],z=c(I.Work),B=z[0],H=z[1],V=function(e,t){var r=e.target.value;switch(t){case"name":_(r);break;case"id":q(r);break;case"type":H(r)}},F=function(){G(x.GROUP_TYPE)};return P!==x.GROUP_TYPE?n(a,{children:[n("div",t({className:"tui-conversation-create-group-detail"},{children:[i("div",t({className:"create-group-box create-group-name"},{children:i(u,{maxLength:15,value:W,onChange:function(e){V(e,"name")},border:"bottom",inputClassName:"input-group-name",clearable:!0,prefix:i("div",t({className:"input-group-title"},{children:R("TUIConversation.Group Name")}))})})),i("div",t({className:"create-group-box create-group-id"},{children:i(u,{border:"bottom",inputClassName:"input-group-text",clearable:!0,value:Y,onChange:function(e){V(e,"id")},prefix:i("div",t({className:"input-group-title"},{children:R("TUIConversation.Group ID")}))})})),i("div",t({className:"create-group-box create-group-type",onClick:F},{children:i(u,{readOnly:!0,border:"bottom",inputClassName:"input-group-text",prefix:i("div",t({className:"input-group-title"},{children:R("TUIConversation.Group Type")})),suffix:i(p,{onClick:F,type:l.ARROW_RIGHT,width:7,height:12}),value:R("TUIConversation.".concat(B)),onChange:function(e){V(e,"type")}})})),i("div",t({className:"create-group-illustrate"},{children:R("TUIConversation.".concat(null==b?void 0:b.find((function(e){return e.type===B})).des))})),n("div",t({className:"create-group-portrait"},{children:[i("div",t({className:"create-group-portrait-title"},{children:R("TUIConversation.Participants")})),i("div",t({className:"create-group-portrait-info-container"},{children:U.map((function(e){var r=e.avatar,o=e.userID,a=e.nick;return n("div",t({className:"create-group-portrait-info"},{children:[i(d,{shape:"square",size:50,image:r||v}),i("div",t({className:"create-group-portrait-info-nick"},{children:a}))]}),o)}))}))]}))]})),i("div",t({className:"tui-conversation-create-next-container"},{children:i("div",t({role:"presentation",className:"tui-conversation-create-next",onClick:function(){return r(k,void 0,void 0,(function(){var e,t,r,n;return o(this,(function(o){return e=U.map((function(e){return{userID:e.userID}})),t=function(e){switch(e){case I.Work:return C;case I.Public:return h;case I.Meeting:return g;case I.AVChatRoom:return f;default:return""}}(B),r={name:W,type:B,groupID:Y,avatar:t,memberList:e},n=(null==A?void 0:A(r))||r,y(n).then((function(e){null==D||D(e)})).catch((function(e){m({text:e.message,type:"error"})})),[2]}))}))}},{children:R("TUIConversation.Create")}))}))]}):i(N,{groupType:B,setGroupType:H,setPageState:G})}export{j as ConversationCreateGroupDetail};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { Profile } from '@tencentcloud/chat';
|
|
4
|
+
|
|
5
|
+
interface ValueProps {
|
|
6
|
+
profile: Profile;
|
|
7
|
+
domList: HTMLInputElement[];
|
|
8
|
+
}
|
|
9
|
+
interface ConversationCreateSelectViewProps {
|
|
10
|
+
selectList: ValueProps[];
|
|
11
|
+
setSelectList: React__default.Dispatch<React__default.SetStateAction<ValueProps[]>>;
|
|
12
|
+
}
|
|
13
|
+
declare function ConversationCreateSelectView(props: ConversationCreateSelectViewProps): react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { ConversationCreateSelectView, ConversationCreateSelectViewProps };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { ConversationCreateSelectViewProps } from './ConversationCreateSelectView.js';
|
|
4
|
+
import { PageStateTypes } from './ConversationCreate.js';
|
|
5
|
+
import { IConversationModel } from '@tencentcloud/chat-uikit-engine';
|
|
6
|
+
|
|
7
|
+
interface ConversationCreateUserSelectListProps extends ConversationCreateSelectViewProps {
|
|
8
|
+
isCreateGroup: boolean;
|
|
9
|
+
setIsCreateGroup: React__default.Dispatch<React__default.SetStateAction<boolean>>;
|
|
10
|
+
className?: string;
|
|
11
|
+
conversationList: IConversationModel[];
|
|
12
|
+
setPageState: React__default.Dispatch<React__default.SetStateAction<PageStateTypes>>;
|
|
13
|
+
onBeforeCreateConversation?: (userID: string) => void;
|
|
14
|
+
onConversationCreated?: (conversation: IConversationModel) => void;
|
|
15
|
+
}
|
|
16
|
+
declare function ConversationCreateUserSelectList(props: ConversationCreateUserSelectListProps): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { ConversationCreateUserSelectList, ConversationCreateUserSelectListProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as t,__generator as r,__spreadArray as n}from"tslib";import{jsxs as
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as r,__spreadArray as n}from"tslib";import{jsxs as i,Fragment as o,jsx as c}from"react/jsx-runtime";import{useState as a,useRef as s}from"react";import{useTranslation as u}from"react-i18next";import{Input as l}from"../Input/Input.js";import{Icon as m}from"../Icon/Icon.js";import{IconTypes as p}from"../Icon/type.js";import{ConversationCreateSelectView as h}from"./ConversationCreateSelectView.js";import{Avatar as f}from"../Avatar/Avatar.js";import{defaultUserAvatar as v}from"../Avatar/default.js";import{useConversationCreate as d}from"./hooks/useConversationCreate.js";import{createC2CConversation as C}from"../../hooks/useConversation.js";import{useUIKit as x}from"../../context/UIKitContext.js";import"@tencentcloud/chat-uikit-engine";import"../../context/MessageContext.js";import{PageStateTypes as g}from"./ConversationCreate.js";import{Toast as I}from"../Toast/index.js";function N(N){var k=this,j=N.isCreateGroup,b=N.selectList,y=N.setSelectList,L=N.className,S=N.conversationList,A=N.setIsCreateGroup,D=N.setPageState,T=N.onBeforeCreateConversation,w=N.onConversationCreated,E=u().t,U=a(""),R=U[0],F=U[1];x().chat;var G=a({}),M=G[0],P=G[1],z=d(S,(function(e){P(e)})).getFriendListSortSearchResult,B=s(new Map);return i(o,{children:[c(l,{className:"tui-conversation-create-search-input",placeholder:E("TUIConversation.Search"),clearable:!0,value:R,onChange:function(e){return t(k,void 0,void 0,(function(){var t,n;return r(this,(function(r){switch(r.label){case 0:return t=e.target.value,F(t),n=P,[4,z(t)];case 1:return n.apply(void 0,[r.sent()]),[2]}}))}))},prefix:c(m,{type:p.SEARCH,height:16,width:16})}),j&&c(h,{selectList:b,setSelectList:y}),!j&&i("div",e({role:"presentation",className:"tui-user",onClick:function(){A(!0),B.current.clear(),y([])}},{children:[c(m,{type:p.ADD}),c("div",e({className:"tui-user-name active"},{children:E("TUIConversation.New group chat")}))]})),c("div",e({className:"tui-conversation-create-select-list-container ".concat(L)},{children:c("div",e({className:"tui-conversation-create-select-list"},{children:c("div",e({className:"tui-group-container"},{children:Object.keys(M).map((function(o){return 0!==M[o].length&&i("div",e({className:"tui-group-box"},{children:[c("div",e({className:"title"},{children:o})),M[o].map((function(a,s){var u=a.userID,l=a.nick,m=a.avatar;return i("label",e({role:"presentation",className:"tui-user tui-user-checkbox-label",htmlFor:"userChecked-".concat(o,"-").concat(u),onClick:function(){!function(e){t(k,void 0,void 0,(function(){var t;return r(this,(function(r){return j||(t=e.userID,null==T||T(t),C(t).then((function(e){null==w||w(e)})).catch((function(e){I({text:e.message,type:"error"})}))),[2]}))}))}(a)}},{children:[c(f,{size:30,image:m||v}),c("div",e({className:"tui-user-name text-ellipsis"},{children:l||"".concat(u)})),j&&c("input",{onChange:function(e){!function(e,t,r){void 0===r&&(r=[]);var i=t.userID,o=e.target.checked;r.forEach((function(e){e.checked=o})),o?b.push({profile:t,domList:r}):b.splice(b.findIndex((function(e){return e.profile.userID===i})),1),y(n([],b,!0))}(e,a,B.current.get(u))},type:"checkbox",ref:function(e){!function(e,t){if(t){B.current.has(e)||B.current.set(e,[]);var r=B.current.get(e);0!==r.length&&r.some((function(e){return e.id===t.id}))||r.push(t)}}(u,e)},id:"userChecked-".concat(o,"-").concat(u),className:"tui-user-checkbox"})]}),u)}))]}),o)}))}))}))})),j&&c("div",e({className:"tui-conversation-create-next-container"},{children:c("div",e({role:"presentation",className:"tui-conversation-create-next",onClick:function(){b&&0===b.length?I({text:E("TUIConversation.Participant cannot be empty"),type:"error"}):D(g.CREATE_DETAIL)}},{children:E("TUIConversation.Next")}))}))]})}export{N as ConversationCreateUserSelectList};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { PageStateTypes } from './ConversationCreate.js';
|
|
4
|
+
|
|
5
|
+
declare enum GroupType {
|
|
6
|
+
Work,
|
|
7
|
+
Public,
|
|
8
|
+
Meeting,
|
|
9
|
+
AVChatRoom,
|
|
10
|
+
Community
|
|
11
|
+
}
|
|
12
|
+
interface ConversationGroupTypeInfoProps {
|
|
13
|
+
groupType: GroupType;
|
|
14
|
+
setGroupType: React__default.Dispatch<React__default.SetStateAction<GroupType>>;
|
|
15
|
+
setPageState: React__default.Dispatch<React__default.SetStateAction<PageStateTypes>>;
|
|
16
|
+
}
|
|
17
|
+
declare const typeInfoList: Array<{
|
|
18
|
+
type: GroupType;
|
|
19
|
+
name: string;
|
|
20
|
+
des: string;
|
|
21
|
+
}>;
|
|
22
|
+
declare function ConversationGroupTypeInfo(props: ConversationGroupTypeInfoProps): react_jsx_runtime.JSX.Element;
|
|
23
|
+
|
|
24
|
+
export { ConversationGroupTypeInfo, ConversationGroupTypeInfoProps, GroupType, typeInfoList };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useTranslation as n}from"react-i18next";import{
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useTranslation as n}from"react-i18next";import{TUIChatEngine as r}from"@tencentcloud/chat-uikit-engine";import{PageStateTypes as i}from"./ConversationCreate.js";import{Icon as a}from"../Icon/Icon.js";import{IconTypes as s}from"../Icon/type.js";var c;!function(e){e[e.Work=r.TYPES.GRP_WORK]="Work",e[e.Public=r.TYPES.GRP_PUBLIC]="Public",e[e.Meeting=r.TYPES.GRP_MEETING]="Meeting",e[e.AVChatRoom=r.TYPES.GRP_AVCHATROOM]="AVChatRoom",e[e.Community=r.TYPES.GRP_COMMUNITY]="Community"}(c||(c={}));var u=[{type:c.Work,name:"Work",des:"Users can join the group only via invitation by existing members. The invitation does not need to be agreed by the invitee or approved by the group owner. See the documentation for details."},{type:c.Public,name:"Public",des:"After a public group is created, the group owner can designate group admins. To join the group, a user needs to search the group ID and send a request, which needs to be approved by the group owner or an admin before the user can join the group. See the documentation for details."},{type:c.Meeting,name:"Meeting",des:"After the group is created, a user can join and quit the group freely and can view the messages sent before joining the group. It is suitable for scenarios that integrate Tencent Real-Time Communication (TRTC), such as audio and video conferences and online education. See the documentation for details."},{type:c.AVChatRoom,name:"AVChatRoom",des:"After a group is created, a user can join and quit the group freely. The group can have an unlimited number of members, but it does not store message history. It can be combined with Live Video Broadcasting (LVB) to support on-screen comment scenarios. See the documentation for details."},{type:c.Community,name:"Community",des:"After creation, you can enter and leave at will, support up to 100,000 people, support historical message storage, and after users search for group ID and initiate a group application, they can join the group without administrator approval. See product documentation for details."}];function p(r){var c=r.groupType,p=r.setGroupType,m=r.setPageState,d=n().t;return t("div",e({className:"tui-conversation-group-type-info"},{children:[u.map((function(n){var r=n.type,u=n.name,h=n.des;return t("div",e({role:"presentation",className:"group-type-info-box ".concat(r===c?"group-type-info-box--active":""," "),onClick:function(){!function(e){p(e),m(i.CREATE_DETAIL)}(r)}},{children:[t("div",e({className:"group-type-info-title"},{children:[r===c&&o(a,{className:"box-active-icon",type:s.RIGHT,width:16,height:16}),d("TUIConversation.".concat(u))]})),o("div",e({className:"group-type-info-description"},{children:d("TUIConversation.".concat(h))}))]}),r)})),o("a",e({className:"group-type-info-document",target:"_blank",href:"https://trtc.io/document/33529?platform=web&product=chat&menulabel=uikit#group-types",rel:"bookmark noreferrer"},{children:d("TUIConversation.Details")}))]}))}export{p as ConversationGroupTypeInfo,c as GroupType,u as typeInfoList};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { IConversationModel } from '@tencentcloud/chat-uikit-engine';
|
|
3
|
+
import { Friend } from '@tencentcloud/chat';
|
|
4
|
+
|
|
5
|
+
declare const useConversationCreate: (conversationList: IConversationModel[], setFriendListResultHandler?: ((newFriendListResult: object, setFriendListResult: React__default.Dispatch<React__default.SetStateAction<{
|
|
6
|
+
string: object[];
|
|
7
|
+
}>>) => void) | undefined) => {
|
|
8
|
+
getFirstLetter: (str: string) => string;
|
|
9
|
+
queryFriendList: (friendList: Friend[]) => Promise<void>;
|
|
10
|
+
getFriendListSortSearchResult: (searchValue: string) => Promise<any>;
|
|
11
|
+
friendListSortResult: any;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { useConversationCreate };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as
|
|
1
|
+
import{__awaiter as r,__generator as t}from"tslib";import{useState as n,useEffect as e}from"react";import{TUIStore as o,StoreName as i,TUIUserService as u}from"@tencentcloud/chat-uikit-engine";import c from"@tencentcloud/chat";import{strChineseFirstPy as s}from"../static/word.js";var a=function(a,f){var l=n(),d=l[0],v=l[1],h=function(r){var t=r.trim(),n=t.charCodeAt(0);return n>40869||n<19968?t.charAt(0):s.charAt(n-19968)},p=function(n){return r(void 0,void 0,void 0,(function(){var r;return t(this,(function(t){return a.filter((function(r){return(null==r?void 0:r.type)===c.TYPES.CONV_C2C})).slice(0,5).map((function(r){return null==r?void 0:r.userProfile})),r=m(null==n?void 0:n.map((function(r){return r.profile}))),v(r),f&&f(r,v),[2]}))}))};function m(r,t){for(var n={"#":[]},e=65;e<=90;e+=1)n[String.fromCharCode(e)]=[];return null==r||r.forEach((function(r){var t=r.nick,e=r.userID,o=h(t||e);o>="a"&&o<="z"?n[o.toLocaleUpperCase()].push(r):o<"A"||o>"z"?n["#"].push(r):n[o].push(r)})),Object.keys(n).forEach((function(r){n[r].sort((function(r,t){var n=r.nick,e=r.userID,o=t.nick,i=t.userID;return n||e<=o||i?1:-1}))})),n}function L(r){p(r)}return e((function(){return o.watch(i.FRIEND,{friendList:L}),function(){o.unwatch(i.FRIEND,{friendList:L})}}),[]),{getFirstLetter:h,queryFriendList:p,getFriendListSortSearchResult:function(n){return r(void 0,void 0,void 0,(function(){var r,e,o,i;return t(this,(function(t){switch(t.label){case 0:return n?[4,u.getUserProfile({userIDList:[n]})]:[2,d];case 1:return r=t.sent().data,e={},o=!1,Object.keys(d).forEach((function(r){e[r]=d[r].filter((function(r){var t,e,i=r.nick,u=r.userID,c=null==i?void 0:i.toLocaleLowerCase(),s=n.toLocaleLowerCase(),a=u.toLocaleLowerCase();return e="TencentCloudDemo"===(null===(t=process.env)||void 0===t?void 0:t.REACT_APP_ONLINE)?c?c.includes(s):a.includes(s):a===s,o=o||e,e}))})),"TencentCloudDemo"===(null===(i=process.env)||void 0===i?void 0:i.REACT_APP_ONLINE)?[2,e]:[2,o?e:m(r)]}}))}))},friendListSortResult:d}};export{a as useConversationCreate};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React__default, { PropsWithChildren } from 'react';
|
|
2
|
+
import { IConversationModel, CreateGroupParams } from '@tencentcloud/chat-uikit-engine';
|
|
3
|
+
import { IConversationListHeaderProps } from './ConversationListHeader/ConversationListHeader.js';
|
|
4
|
+
import { IConversationListContentProps } from './ConversationListContent/ConversationListContent.js';
|
|
5
|
+
import { IConversationPreviewUIProps } from '../ConversationPreview/ConversationPreview.js';
|
|
6
|
+
import { AvatarProps } from '../Avatar/Avatar.js';
|
|
7
|
+
import { IConversationSearchProps } from '../ConversationSearch/ConversationSearch.js';
|
|
8
|
+
import { IConversationCreateProps } from '../ConversationCreate/ConversationCreate.js';
|
|
9
|
+
import { IConversationActionsConfig, IConversationActionsProps } from '../ConversationActions/ConversationActions.js';
|
|
10
|
+
|
|
11
|
+
interface IConversationListProps {
|
|
12
|
+
/** Determines whether the conversation search input appears on the conversation list view. (Default: True) */
|
|
13
|
+
enableSearch?: boolean;
|
|
14
|
+
/** Determines whether the conversation creation button appears on the conversation list view. (Default: True) */
|
|
15
|
+
enableCreate?: boolean;
|
|
16
|
+
/** Determines whether the conversation action button appears on the conversation list view. (Default: True) */
|
|
17
|
+
enableActions?: boolean;
|
|
18
|
+
/** Specifies the prop to customize action on the conversation list item. */
|
|
19
|
+
actionsConfig?: IConversationActionsConfig;
|
|
20
|
+
/** Specifies a react component to customize the header of the conversation list. */
|
|
21
|
+
Header?: React__default.ComponentType<IConversationListHeaderProps>;
|
|
22
|
+
/** Specifies a react component to customize the conversation list component. */
|
|
23
|
+
List?: React__default.ComponentType<IConversationListContentProps>;
|
|
24
|
+
/** Specifies a react component to customize the conversation preview. */
|
|
25
|
+
Preview?: React__default.ComponentType<IConversationPreviewUIProps>;
|
|
26
|
+
/** Specifies a react component to customize the conversation create component. */
|
|
27
|
+
ConversationCreate?: React__default.ComponentType<IConversationCreateProps>;
|
|
28
|
+
/** Specifies a react component to customize the conversation search. */
|
|
29
|
+
ConversationSearch?: React__default.ComponentType<IConversationSearchProps>;
|
|
30
|
+
/** Specifies a react component to customize the conversation actions in conversation preview. */
|
|
31
|
+
ConversationActions?: React__default.ComponentType<IConversationActionsProps>;
|
|
32
|
+
/** Specifies a react component to customize the placeholder when the conversation list is empty. */
|
|
33
|
+
PlaceholderEmptyList?: React__default.ReactNode;
|
|
34
|
+
/** Specifies a react component to customize the placeholder when the conversation list is loading. */
|
|
35
|
+
PlaceholderLoading?: React__default.ReactNode;
|
|
36
|
+
/** Specifies a react component to customize the placeholder when the conversation list loaded error. */
|
|
37
|
+
PlaceholderLoadError?: React__default.ReactNode;
|
|
38
|
+
/** Specifies a react component to customize the avatar in list. */
|
|
39
|
+
Avatar?: React__default.ComponentType<AvatarProps>;
|
|
40
|
+
/** Specifies a function to filter conversations in the conversation list. */
|
|
41
|
+
filter?: (conversationList: IConversationModel[]) => IConversationModel[];
|
|
42
|
+
/** Specifies a function to sort conversations in the conversation list. */
|
|
43
|
+
sort?: (conversationList: IConversationModel[]) => IConversationModel[];
|
|
44
|
+
/** Specifies the prop to receive callback when a user clicks a conversation in the conversation list. */
|
|
45
|
+
onSelectConversation?: (conversation: IConversationModel) => void;
|
|
46
|
+
/** Specifies the prop to execute custom operations before creating a channel. */
|
|
47
|
+
onBeforeCreateConversation?: (params: string | CreateGroupParams) => string | CreateGroupParams;
|
|
48
|
+
/** Specifies the prop to receive callback when a conversation is created. */
|
|
49
|
+
onConversationCreated?: (conversation: IConversationModel) => void;
|
|
50
|
+
/** The custom class name */
|
|
51
|
+
className?: string;
|
|
52
|
+
/** The custom css style */
|
|
53
|
+
style?: React__default.CSSProperties;
|
|
54
|
+
}
|
|
55
|
+
declare function ConversationList<T extends IConversationListProps>(props: PropsWithChildren<T>): React__default.ReactElement;
|
|
56
|
+
|
|
57
|
+
export { ConversationList, IConversationListProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__assign as o}from"tslib";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as r}from"react";import{ConversationListProvider as i,useConversationList as n}from"../../context/ConversationListContext.js";import{ConversationListHeader as a}from"./ConversationListHeader/ConversationListHeader.js";import{ConversationListContent as s}from"./ConversationListContent/ConversationListContent.js";import"react-i18next";import"../Icon/config.js";import"../Icon/type.js";import c from"../../node_modules/classnames/index.js";import{ConversationPreview as v,ConversationPreviewUI as l}from"../ConversationPreview/ConversationPreview.js";import{Avatar as d}from"../Avatar/Avatar.js";import{PlaceHolder as m,PlaceHolderTypes as C}from"../PlaceHolder/index.js";import{ConversationSearch as p}from"../ConversationSearch/ConversationSearch.js";import{ConversationCreate as f}from"../ConversationCreate/ConversationCreate.js";import"../ConversationCreate/ConversationGroupTypeInfo.js";import"@tencentcloud/tui-core";import"@tencentcloud/chat-uikit-engine";import"../../context/MessageContext.js";import"@tencentcloud/chat";import{ConversationActions as h}from"../ConversationActions/ConversationActions.js";import{isH5 as u}from"../../utils/env.js";function L(i){var L=i.enableSearch,j=void 0===L||L,A=i.enableCreate,g=void 0===A||A,P=i.enableActions,y=void 0===P||P,b=i.actionsConfig,x=i.Header,S=void 0===x?a:x,N=i.List,E=void 0===N?s:N,I=i.Preview,w=void 0===I?l:I,O=i.ConversationCreate,k=void 0===O?f:O,H=i.ConversationSearch,_=void 0===H?p:H,G=i.ConversationActions,R=void 0===G?h:G,B=i.PlaceholderEmptyList,D=void 0===B?e(m,{type:C.NO_CONVERSATIONS}):B,M=i.PlaceholderLoading,T=void 0===M?e(m,{type:C.LOADING}):M,V=i.PlaceholderLoadError,W=void 0===V?e(m,{type:C.WRONG}):V,q=i.Avatar,z=void 0===q?d:q,F=i.onSelectConversation,J=i.onBeforeCreateConversation,K=i.onConversationCreated,Q=i.className,U=i.style,X=n(),Y=X.conversationList,Z=X.filteredAndSortedConversationList,$=X.isLoading,oo=X.isLoadError,eo=r(!1),to=eo[0],ro=eo[1];return t("div",o({className:c(Q,"uikit-chat-list",{"uikit-chat-list--mobile":u}),style:U},{children:[t(S,{children:[e(_,{visible:j,conversationList:Y,Avatar:z,ResultPreview:v}),e(k,{className:c({"uikit-chat-list__header--creating":to}),visible:g,onChangeCreateModelVisible:function(o){return ro(o)},onBeforeCreateConversation:J,onConversationCreated:K})]}),e(E,o({empty:0===Z.length,loading:$,error:oo,PlaceholderEmptyList:D,PlaceholderLoadError:W,PlaceholderLoading:T},{children:Z.map((function(o){return e(v,{conversation:o,enableActions:y,Preview:w,Avatar:z,ConversationActions:R,onSelectConversation:F,actionsConfig:b},o.conversationID)}))}))]}))}function j(t){return e(i,o({filter:t.filter,sort:t.sort},{children:e(L,o({},t))}))}export{j as ConversationList};
|
package/dist/esm/components/ConversationList/ConversationListContent/ConversationListContent.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
interface IConversationListContentProps {
|
|
2
|
+
/** Renders a customized component in the conversation list main. */
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/** Indicates whether the chat list is empty */
|
|
5
|
+
empty?: boolean;
|
|
6
|
+
/** Indicates whether the chat list is currently loading */
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
/** Indicates whether there was an error loading the chat list */
|
|
9
|
+
error?: boolean;
|
|
10
|
+
/** A custom component to display when the chat list is empty */
|
|
11
|
+
PlaceholderEmptyList?: React.ReactNode;
|
|
12
|
+
/** A custom component to display while the chat list is loading */
|
|
13
|
+
PlaceholderLoading?: React.ReactNode;
|
|
14
|
+
/** A custom component to display when there is an error loading the chat list */
|
|
15
|
+
PlaceholderLoadError?: React.ReactNode;
|
|
16
|
+
/** The custom class name */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** The custom css style */
|
|
19
|
+
style?: React.CSSProperties;
|
|
20
|
+
}
|
|
21
|
+
declare function ConversationListContent<T extends IConversationListContentProps>(props: T): React.ReactElement;
|
|
22
|
+
|
|
23
|
+
export { ConversationListContent, IConversationListContentProps };
|
package/dist/esm/components/ConversationList/ConversationListContent/ConversationListContent.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as o}from"react/jsx-runtime";import r from"../../../node_modules/classnames/index.js";import{PlaceHolder as i,PlaceHolderTypes as t}from"../../PlaceHolder/index.js";function d(d){var l,a=d.children,s=d.empty,m=void 0!==s&&s,n=d.loading,c=void 0!==n&&n,p=d.error,v=void 0!==p&&p,y=d.PlaceholderEmptyList,N=void 0===y?o(i,{type:t.NO_CONVERSATIONS}):y,h=d.PlaceholderLoading,f=void 0===h?o(i,{type:t.LOADING}):h,u=d.PlaceholderLoadError,O=void 0===u?o(i,{type:t.WRONG}):u,x=d.className,L=d.style;return l=v?O:c?f:m?N:a,o("div",e({className:r("uikit-chat-list__container",x),style:L},{children:l}))}export{d as ConversationListContent};
|
package/dist/esm/components/ConversationList/ConversationListHeader/ConversationListHeader.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface IConversationListHeaderProps {
|
|
2
|
+
/** The main of the conversation list header */
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/** A custom component to display in the left area of header */
|
|
5
|
+
left?: React.ReactNode;
|
|
6
|
+
/** A custom component to display in the right area of header */
|
|
7
|
+
right?: React.ReactNode;
|
|
8
|
+
/** The custom class name */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** The custom css style */
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
}
|
|
13
|
+
declare function ConversationListHeader<T extends IConversationListHeaderProps>(props: T): React.ReactElement;
|
|
14
|
+
|
|
15
|
+
export { ConversationListHeader, IConversationListHeaderProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as i,jsx as t}from"react/jsx-runtime";import r from"../../../node_modules/classnames/index.js";function s(s){var a=s.children,l=s.left,c=s.right,d=s.className,m=s.style;return i("div",e({className:r("uikit-chat-list__header",d),style:m},{children:[t("div",e({className:"uikit-chat-list__header__left"},{children:l})),a,t("div",e({className:"uikit-chat-list__header__right"},{children:c}))]}))}export{s as ConversationListHeader};
|
|
@@ -1,33 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { Conversation } from '@tencentcloud/chat';
|
|
1
|
+
import React__default, { CSSProperties } from 'react';
|
|
2
|
+
import { IConversationModel } from '@tencentcloud/chat-uikit-engine';
|
|
4
3
|
import { AvatarProps } from '../Avatar/Avatar.js';
|
|
4
|
+
import { IConversationActionsProps, IConversationActionsConfig } from '../ConversationActions/ConversationActions.js';
|
|
5
5
|
|
|
6
|
-
interface
|
|
6
|
+
interface IConversationPreviewUIProps {
|
|
7
|
+
/** The conversation to be displayed */
|
|
8
|
+
conversation: IConversationModel;
|
|
7
9
|
/** If the component's Conversation is the active (selected) Conversation */
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
displayMessage?: string | React__default.ReactElement;
|
|
15
|
-
/** Time of Conversation to display */
|
|
16
|
-
displayTime?: string;
|
|
17
|
-
/** Number of unread Messages */
|
|
18
|
-
unread?: number;
|
|
19
|
-
}
|
|
20
|
-
interface ConversationPreviewProps {
|
|
21
|
-
conversation: Conversation;
|
|
22
|
-
activeConversation?: Conversation;
|
|
23
|
-
Preview?: React__default.ComponentType<ConversationPreviewUIComponentProps>;
|
|
10
|
+
isSelected?: boolean;
|
|
11
|
+
/** Whether to show the ConversationActions */
|
|
12
|
+
enableActions?: boolean;
|
|
13
|
+
/** The string to be highlighted in the title */
|
|
14
|
+
highlightMatchString?: string;
|
|
15
|
+
/** The custom Avatar component */
|
|
24
16
|
Avatar?: React__default.ComponentType<AvatarProps>;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
/** The custom Title component */
|
|
18
|
+
Title?: string | JSX.Element;
|
|
19
|
+
/** The custom last message abstract component */
|
|
20
|
+
LastMessageAbstract?: string | JSX.Element;
|
|
21
|
+
/** The custom last message abstract component */
|
|
22
|
+
LastMessageTimestamp?: string | JSX.Element;
|
|
23
|
+
/** The custom Unread component */
|
|
24
|
+
Unread?: string | JSX.Element;
|
|
25
|
+
/** The custom ConversationActions component */
|
|
26
|
+
ConversationActions?: React__default.ComponentType<IConversationActionsProps>;
|
|
27
|
+
/** Callback when the user click a conversation from conversation list */
|
|
28
|
+
onSelectConversation?: (conversation: IConversationModel) => void;
|
|
29
|
+
/** The custom ConversationActions config */
|
|
30
|
+
actionsConfig?: IConversationActionsConfig;
|
|
31
|
+
/** The custom class name */
|
|
32
|
+
className?: string;
|
|
33
|
+
/** The custom class style */
|
|
34
|
+
style?: CSSProperties;
|
|
35
|
+
/** The custom children node to override UI */
|
|
36
|
+
children?: React__default.ReactNode;
|
|
37
|
+
}
|
|
38
|
+
interface IConversationPreviewProps extends IConversationPreviewUIProps {
|
|
39
|
+
/** The custom Preview UI component */
|
|
40
|
+
Preview?: React__default.ComponentType<IConversationPreviewUIProps>;
|
|
30
41
|
}
|
|
31
|
-
declare function ConversationPreview<T extends
|
|
42
|
+
declare function ConversationPreview<T extends IConversationPreviewProps>(props: T): React__default.ReactElement;
|
|
43
|
+
declare function ConversationPreviewUI<T extends IConversationPreviewUIProps>(props: T): React__default.ReactElement;
|
|
32
44
|
|
|
33
|
-
export { ConversationPreview,
|
|
45
|
+
export { ConversationPreview, ConversationPreviewUI, IConversationPreviewProps, IConversationPreviewUIProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as i,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useRef as o,useState as r,useEffect as s}from"react";import a from"../../node_modules/classnames/index.js";import{Icon as c}from"../Icon/Icon.js";import{IconTypes as v}from"../Icon/type.js";import{Avatar as l}from"../Avatar/Avatar.js";import{ConversationActions as u}from"../ConversationActions/ConversationActions.js";import{useConversationList as m}from"../../context/ConversationListContext.js";import{useUIManager as d}from"../../context/UIManagerContext.js";import{useUIKit as h}from"../../context/UIKitContext.js";import"../../context/MessageContext.js";import p from"../../hooks/useLongPress.js";import g from"../../hooks/useMouseHover.js";import{generateHighlightTitle as f,getLatestMessagePreview as C}from"./utils.js";import{getTimeStamp as _}from"../utils.js";import{isH5 as k}from"../../utils/env.js";function M(t){var n=t.conversation,o=t.isSelected,r=void 0!==o&&o,s=t.enableActions,p=void 0===s||s,g=t.highlightMatchString,k=t.Preview,M=void 0===k?w:k,A=t.Avatar,j=void 0===A?l:A,x=t.ConversationActions,N=void 0===x?u:x,S=t.Title,b=void 0===S?function(t){var n=t.conversation,o=t.highlightMatchString;return i("div",e({className:"uikit-conversation-preview__title text-ellipsis"},{children:f(n,o).map((function(t,n){return i("span",e({className:a({"uikit-conversation-preview__title--highlight":t.isHighlight,"uikit-conversation-preview__title--normal":!t.isHighlight})},{children:t.text}),n)}))}))}({conversation:n,highlightMatchString:g}):S,L=t.LastMessageTimestamp,y=void 0===L?function(t){var n,o=t.conversation,r=h().language;return i("div",e({className:"uikit-conversation-preview__time"},{children:_(1e3*+((null===(n=o.lastMessage)||void 0===n?void 0:n.lastTime)||0),r)}))}({conversation:n}):L,T=t.LastMessageAbstract,I=void 0===T?function(t){var n=t.conversation,o=d().myProfile;return i("div",e({className:"uikit-conversation-preview__abstract"},{children:C(n,o)}))}({conversation:n}):T,P=t.Unread,U=void 0===P?function(t){var n,o=t.conversation;return n=o.isMuted?i(c,{type:v.MUTE,width:16,height:16}):o.unreadCount>99?"99+":0===o.unreadCount?null:o.unreadCount,i("div",e({className:"uikit-conversation-preview__unread"},{children:n}))}({conversation:n}):P,D=t.onSelectConversation,H=t.actionsConfig,z=t.className,E=t.style,K=t.children;return m().setCurrentConversation,i(M,{conversation:n,isSelected:r,enableActions:p,highlightMatchString:g,Avatar:j,ConversationActions:N,Title:b,LastMessageTimestamp:y,LastMessageAbstract:I,Unread:U,onSelectConversation:D,actionsConfig:H,className:z,style:E,children:K})}function w(c){var v=c.conversation,d=c.isSelected,h=c.enableActions,f=c.Avatar,C=void 0===f?l:f,_=c.ConversationActions,M=void 0===_?u:_,w=c.Title,A=c.LastMessageTimestamp,j=c.LastMessageAbstract,x=c.Unread,N=c.onSelectConversation,S=c.actionsConfig,b=c.className,L=c.style,y=c.children,T=m(),I=T.currentConversation,P=T.setCurrentConversation,U=o(null),D=r(!1),H=D[0],z=D[1],E=g(U),K=p({},{delay:500,shouldPreventDefault:!0}).isLongPressing;s((function(){z(E||K)}),[E,K]);return i("div",e({ref:U,className:a("uikit-conversation-preview",b,{"uikit-conversation-preview--mobile":k,"uikit-conversation-preview--active":d||v.conversationID===(null==I?void 0:I.conversationID),"uikit-conversation-preview--unread":!v.isMuted&&v.unreadCount>0,"uikit-conversation-preview--pin":v.isPinned,"uikit-conversation-preview--mute":v.isMuted}),style:L,onClick:function(){null==N||N(v),P(v)}},{children:y||t(n,{children:[i("div",e({className:"uikit-conversation-preview__avatar"},{children:i(C,{image:v.getAvatar(),size:40})})),t("div",e({className:"uikit-conversation-preview__content"},{children:[w,j]})),t("div",e({className:"uikit-conversation-preview__external"},{children:[x,h&&H?i(M,e({conversation:v},S)):A]}))]})}))}export{M as ConversationPreview,w as ConversationPreviewUI};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as r,jsx as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as r,jsx as t,Fragment as o}from"react/jsx-runtime";import a from"@tencentcloud/chat-uikit-engine";import{formatEmojiString as i}from"../MessageElement/utils/emojiMap.js";import"react";import"../Icon/config.js";import"../Icon/type.js";import{defaultGroupAvatarWork as n,defaultUserAvatar as c}from"../Avatar/default.js";var s=function(e,r){var t=e.getShowName();if(!r)return[{text:t,isHighlight:!1}];var o=r.toLowerCase();return t.split(new RegExp("(".concat(r,")"),"gi")).map((function(e){return{text:e,isHighlight:e.toLowerCase()===o}}))},l=function(o,n){var c,s=o.lastMessage,l=o.type;if(!s)return"";var u=s.fromAccount,p=s.nick,d=s.nameCard,f=s.isRevoked,m=s.messageForShow;s.type===a.TYPES.MSG_CUSTOM&&(null===(c=s.payload)||void 0===c?void 0:c.description)&&(m=s.payload.description);var C="";switch(l){case a.TYPES.CONV_GROUP:C=(null==s?void 0:s.fromAccount)===(null==n?void 0:n.userID)?"You":"".concat(d||p||u||""),C="".concat(C?"".concat(C,":"):"");break;case a.TYPES.CONV_C2C:C=f?"you ":""}return r("div",e({style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:[t("span",{children:C}),t("span",{children:s.isRevoked?"recalled a message":i(m,1)})]}))},u=function(e){if(!e)return null;var r={},t=e.type,o=e.groupProfile,i=e.userProfile;switch(t){case a.TYPES.CONV_C2C:r=i;break;case a.TYPES.CONV_GROUP:r=o}return r},p=function(i,n,c){void 0===c&&(c="#147AFF");var s=u(i),l=s.name,p=s.nick,d=s.groupID,f=s.userID,m=i.type,C=i.remark,v="";switch(m){case a.TYPES.CONV_C2C:v=C||p||f||"";break;case a.TYPES.CONV_GROUP:v=l||d||"";break;default:v=""}var h,w,g,O;return n?(w=(h=v).toLocaleLowerCase(),g=n&&w.indexOf(n.toLocaleLowerCase()),O=h.split(new RegExp("(".concat(n,")"),"gi")),""===g?t(o,{}):r("div",{children:[n&&O.map((function(r,o){return r.toLowerCase()===n.toLowerCase()?t("span",e({style:{color:c}},{children:r}),o):t("span",{children:r},o)})),";"]})):v},d=function(e){var r=e.type,t=u(e).avatar,o=t;if(!t)switch(r){case a.TYPES.CONV_C2C:o=c;break;case a.TYPES.CONV_GROUP:default:o=n}return o};export{s as generateHighlightTitle,d as getDisplayImage,p as getDisplayTitle,l as getLatestMessagePreview,u as getMessageProfile};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { IConversationModel } from '@tencentcloud/chat-uikit-engine';
|
|
3
|
+
import { IConversationSearchInputProps } from './ConversationSearchInput/ConversationSearchInput.js';
|
|
4
|
+
import { IConversationSearchResultProps } from './ConversationSearchResult/ConversationSearchResult.js';
|
|
5
|
+
import { IConversationPreviewProps } from '../ConversationPreview/ConversationPreview.js';
|
|
6
|
+
import { AvatarProps } from '../Avatar/Avatar.js';
|
|
7
|
+
|
|
8
|
+
interface IConversationSearchProps {
|
|
9
|
+
/** The list of conversations to be searched. */
|
|
10
|
+
conversationList: IConversationModel[];
|
|
11
|
+
/** Specifies a react component to customize the avatar in the search results. */
|
|
12
|
+
Avatar?: React.ComponentType<AvatarProps>;
|
|
13
|
+
/** Specifies a react component to customize the preview of search results. */
|
|
14
|
+
ResultPreview?: React.ComponentType<IConversationPreviewProps>;
|
|
15
|
+
/** Specifies a react component to customize the search input. */
|
|
16
|
+
ConversationSearchInput?: React.ComponentType<IConversationSearchInputProps>;
|
|
17
|
+
/** Specifies a react component to customize the search result. */
|
|
18
|
+
ConversationSearchResult?: React.ComponentType<IConversationSearchResultProps>;
|
|
19
|
+
/** Specifies a function to customize the search algorithm. This function takes the search value and the conversation list as parameters and returns the search results. */
|
|
20
|
+
searchFn?: (searchValue: string, conversationList: IConversationModel[]) => IConversationModel[];
|
|
21
|
+
/** Specifies a function to be called when the search input changes. This function takes the current search value as a parameter. */
|
|
22
|
+
onSearchChange?: (searchValue: string) => void;
|
|
23
|
+
/** Specifies a function to be called when the search input is focused. */
|
|
24
|
+
onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
25
|
+
/** Specifies a function to be called when the search input is blurred. */
|
|
26
|
+
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
27
|
+
/** Specifies a function to be called when a search result is selected. This function takes the selected conversation as a parameter. */
|
|
28
|
+
onSelectResult?: (conversation: IConversationModel) => void;
|
|
29
|
+
/** Specifies whether the search component is visible. */
|
|
30
|
+
visible?: boolean;
|
|
31
|
+
/** Specifies a custom class name for the search component. */
|
|
32
|
+
className?: string;
|
|
33
|
+
/** The custom css style */
|
|
34
|
+
style?: React.CSSProperties;
|
|
35
|
+
}
|
|
36
|
+
declare function defaultSearchFn(searchValue: string, conversationList: IConversationModel[]): IConversationModel[];
|
|
37
|
+
declare function ConversationSearch(props: IConversationSearchProps): react_jsx_runtime.JSX.Element | null;
|
|
38
|
+
|
|
39
|
+
export { ConversationSearch, IConversationSearchProps, defaultSearchFn };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as o,jsx as n}from"react/jsx-runtime";import{useState as t,useEffect as r}from"react";import i from"../../node_modules/classnames/index.js";import{ConversationSearchInput as a}from"./ConversationSearchInput/ConversationSearchInput.js";import{ConversationSearchResult as l}from"./ConversationSearchResult/ConversationSearchResult.js";import{ConversationPreview as s}from"../ConversationPreview/ConversationPreview.js";import{Avatar as u}from"../Avatar/Avatar.js";function v(e,o){return e&&0!==(null==o?void 0:o.length)?o.filter((function(o){return o.getShowName().toLocaleLowerCase().includes(e.toLocaleLowerCase())})):[]}function c(c){var m=c.visible,d=void 0===m||m,f=c.conversationList,h=c.Avatar,p=void 0===h?u:h,C=c.searchFn,S=void 0===C?v:C,g=c.ResultPreview,R=void 0===g?s:g,w=c.ConversationSearchInput,j=void 0===w?a:w,L=c.ConversationSearchResult,b=void 0===L?l:L,A=c.onSearchChange,P=c.onFocus,x=c.onBlur,F=c.onSelectResult,I=c.className,N=c.style,k=t(""),y=k[0],B=k[1],V=t(f),_=V[0],q=V[1],z=t(!1),D=z[0],E=z[1],G=t(!1),H=G[0],J=G[1],K=t(!0),M=K[0],O=K[1];return r((function(){null==A||A(y)}),[y,A]),r((function(){q(S(y,f))}),[f,S,y]),r((function(){E(!M)}),[H,M]),d?o("div",e({className:i("uikit-conversation-search",I,{"uikit-conversation-search--active":D}),style:N},{children:[n(j,{value:y,clearable:!0,onChange:function(e){var o,n,t;B(null===(o=e.target)||void 0===o?void 0:o.value),O(0===(null===(n=e.target)||void 0===n?void 0:n.value.length)),null==A||A(null===(t=e.target)||void 0===t?void 0:t.value)},onFocus:function(e){J(!0),null==P||P(e)},onBlur:function(e){J(!1),null==x||x(e)}}),n(b,{visible:D,Avatar:p,searchResult:_,searchValue:y,ResultPreview:R,onSelectResult:F})]})):null}export{c as ConversationSearch,v as defaultSearchFn};
|
package/dist/esm/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { InputProps } from '../../Input/Input.js';
|
|
3
|
+
|
|
4
|
+
type IConversationSearchInputProps = InputProps;
|
|
5
|
+
declare function ConversationSearchInput(props: IConversationSearchInputProps): react_jsx_runtime.JSX.Element;
|
|
6
|
+
|
|
7
|
+
export { ConversationSearchInput, IConversationSearchInputProps };
|
package/dist/esm/components/ConversationSearch/ConversationSearchInput/ConversationSearchInput.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{useTranslation as e}from"react-i18next";import{Icon as r}from"../../Icon/Icon.js";import{IconTypes as n}from"../../Icon/type.js";import{Input as t}from"../../Input/Input.js";import a from"../../../node_modules/classnames/index.js";function i(i){var c=i.className,s=i.placeholder,m=i.clearable,l=i.value,p=i.onChange,u=i.prefix,f=void 0===u?o(r,{type:n.SEARCH,height:16,width:16}):u,h=i.onFocus,d=i.onBlur,v=e().t;return o(t,{className:a("uikit-conversation-search-input",c),placeholder:s||v("TUIConversation.Search"),clearable:m,value:l,onChange:p,onFocus:h,onBlur:d,prefix:f})}export{i as ConversationSearchInput};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { IConversationModel } from '@tencentcloud/chat-uikit-engine';
|
|
4
|
+
import { IConversationPreviewProps } from '../../ConversationPreview/ConversationPreview.js';
|
|
5
|
+
import { AvatarProps } from '../../Avatar/Avatar.js';
|
|
6
|
+
|
|
7
|
+
interface IConversationSearchResultProps {
|
|
8
|
+
/** Whether to show the search result */
|
|
9
|
+
visible?: boolean;
|
|
10
|
+
/** The search result */
|
|
11
|
+
searchResult?: IConversationModel[];
|
|
12
|
+
/** The search input value */
|
|
13
|
+
searchValue?: string;
|
|
14
|
+
/** The custom ResultPreview component */
|
|
15
|
+
ResultPreview?: React__default.ComponentType<IConversationPreviewProps>;
|
|
16
|
+
/** The custom Avatar component */
|
|
17
|
+
Avatar?: React__default.ComponentType<AvatarProps>;
|
|
18
|
+
/** The custom no result Placeholder component */
|
|
19
|
+
PlaceholderNoResult?: React__default.ReactNode;
|
|
20
|
+
/** Callback when the ResultPreview is clicked */
|
|
21
|
+
onSelectResult?: (conversation: IConversationModel) => void;
|
|
22
|
+
/** The custom class name */
|
|
23
|
+
className?: string;
|
|
24
|
+
/** The custom css style */
|
|
25
|
+
style?: React__default.CSSProperties;
|
|
26
|
+
}
|
|
27
|
+
declare function ConversationSearchResult(props: IConversationSearchResultProps): react_jsx_runtime.JSX.Element | null;
|
|
28
|
+
|
|
29
|
+
export { ConversationSearchResult, IConversationSearchResultProps };
|
package/dist/esm/components/ConversationSearch/ConversationSearchResult/ConversationSearchResult.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as r}from"react/jsx-runtime";import o from"../../../node_modules/classnames/index.js";import{ConversationPreview as t}from"../../ConversationPreview/ConversationPreview.js";import{Avatar as i}from"../../Avatar/Avatar.js";import{PlaceHolder as n,PlaceHolderTypes as s}from"../../PlaceHolder/index.js";function a(a){var l=a.visible,v=void 0!==l&&l,c=a.searchResult,m=a.searchValue,u=a.Avatar,d=void 0===u?i:u,h=a.ResultPreview,p=void 0===h?t:h,f=a.PlaceholderNoResult,S=void 0===f?r(n,{type:s.NO_RESULTS,searchString:m}):f,g=a.onSelectResult,j=a.className,P=a.style;return v?r("div",e({className:o("uikit-conversation-search-result",j),style:P},{children:0===(null==c?void 0:c.length)?S:null==c?void 0:c.map((function(e){return r(p,{conversation:e,Avatar:d,highlightMatchString:m,onSelectConversation:g},e.conversationID)}))})):null}export{a as ConversationSearchResult};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsx as i}from"react/jsx-runtime";import{ICON_CONFIG as n}from"./config.js";var o=function(t){var o=n[t].url||"";return i("img",{className:"icon-image icon-image-".concat(t),src:o,alt:t})},c=function(t){var i;return(null===(i=n[t])||void 0===i?void 0:i.className)||""};function r(n){var r=n.children,e=n.type,a=n.height,s=void 0===a?24:a,m=n.width,l=void 0===m?24:m,p=n.onClick,d=n.className,f=void 0===d?"":d,g={width:"string"==typeof l?l:"".concat(l,"px"),minWidth:"string"==typeof l?l:"".concat(l,"px"),height:"string"==typeof s?s:"".concat(s,"px"),minHeight:"string"==typeof s?s:"".concat(s,"px")};return i("div",t({className:"tui-kit-icon ".concat(e&&c(e)," ").concat(f),role:"button",tabIndex:0,style:g,onClick:p},{children:r||e&&o(e)}))}export{r as Icon,c as changeTypeToIconClassName};
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as i}from"react/jsx-runtime";import{ICON_CONFIG as n}from"./config.js";var o=function(t){var o=n[t].url||"";return o&&i("img",{className:"icon-image icon-image-".concat(t),src:o,alt:t})},c=function(t){var i;return(null===(i=n[t])||void 0===i?void 0:i.className)||""};function r(n){var r=n.children,e=n.type,a=n.height,s=void 0===a?24:a,m=n.width,l=void 0===m?24:m,p=n.onClick,d=n.className,f=void 0===d?"":d,g={width:"string"==typeof l?l:"".concat(l,"px"),minWidth:"string"==typeof l?l:"".concat(l,"px"),height:"string"==typeof s?s:"".concat(s,"px"),minHeight:"string"==typeof s?s:"".concat(s,"px")};return i("div",t({className:"tui-kit-icon ".concat(e&&c(e)," ").concat(f),role:"button",tabIndex:0,style:g,onClick:p},{children:r||e&&o(e)}))}export{r as Icon,c as changeTypeToIconClassName};
|