@tencentcloud/chat-uikit-react 2.2.5 → 2.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +16 -12
- package/.lintstagedrc.json +1 -1
- package/CHANGELOG.md +8 -0
- package/dist/cjs/components/Avatar/Avatar.d.ts +4 -4
- package/dist/cjs/components/Checkbox/index.d.ts +2 -2
- package/dist/cjs/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
- package/dist/cjs/components/ConversationCreate/ConversationCreate.js +1 -1
- package/dist/cjs/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
- package/dist/cjs/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
- package/dist/cjs/components/ConversationPreview/ConversationListContainer.d.ts +2 -2
- package/dist/cjs/components/ConversationPreview/ConversationPreview.d.ts +8 -8
- package/dist/cjs/components/ConversationPreview/ConversationPreview.js +1 -1
- package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.d.ts +2 -2
- package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.js +1 -1
- package/dist/cjs/components/ConversationSearch/ConversationSearchResult.d.ts +3 -3
- package/dist/cjs/components/ConversationSearch/ConversationSearchResult.js +1 -1
- package/dist/cjs/components/Icon/Icon.d.ts +3 -3
- package/dist/cjs/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +4 -4
- package/dist/cjs/components/Input/Input.d.ts +4 -4
- package/dist/cjs/components/Model/index.d.ts +2 -2
- package/dist/cjs/components/Plugins/index.d.ts +4 -4
- package/dist/cjs/components/Popup/index.d.ts +2 -2
- package/dist/cjs/components/Switch/Switch.d.ts +2 -2
- package/dist/cjs/components/TUIChat/TUIChat.d.ts +12 -12
- package/dist/cjs/components/TUIChat/TUIChat.js +1 -1
- package/dist/cjs/components/TUIChatHeader/TUIChatHeader.d.ts +5 -5
- package/dist/cjs/components/TUIChatHeader/TUIChatHeader.js +1 -1
- package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.d.ts +5 -5
- package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContact.d.ts +3 -3
- package/dist/cjs/components/TUIContact/TUIContact.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/TUIContactInfo.d.ts +3 -3
- package/dist/cjs/components/TUIContact/TUIContactInfo/TUIContactInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/basicInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/blockInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/friendApplication.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/groupInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/hooks/useContactInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.d.ts +3 -3
- package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
- package/dist/cjs/components/TUIContact/hooks/useTUIContact.js +1 -1
- package/dist/cjs/components/TUIContactSearch/TUIContactSearch.js +1 -1
- package/dist/cjs/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
- package/dist/cjs/components/TUIConversation/TUIConversation.d.ts +2 -2
- package/dist/cjs/components/TUIConversationList/TUIConversationList.d.ts +6 -6
- package/dist/cjs/components/TUIConversationList/TUIConversationList.js +1 -1
- package/dist/cjs/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
- package/dist/cjs/components/TUIManage/TUIManage.d.ts +2 -2
- package/dist/cjs/components/TUIManage/TUIManage.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageAudio.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageAvatar.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageBubble.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageContext.d.ts +2 -2
- package/dist/cjs/components/TUIMessage/MessageContext.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageCustom.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageName.js +1 -1
- package/dist/cjs/components/TUIMessage/MessagePlugins.d.ts +4 -4
- package/dist/cjs/components/TUIMessage/MessagePlugins.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageProgress.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageRevoke.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageStatus.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageSystem.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageText.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageTip.js +1 -1
- package/dist/cjs/components/TUIMessage/TUIMessage.d.ts +19 -19
- package/dist/cjs/components/TUIMessage/TUIMessage.js +1 -1
- package/dist/cjs/components/TUIMessage/TUIMessageDefault.js +1 -1
- package/dist/cjs/components/TUIMessage/hooks/useMessageHandler.js +1 -1
- package/dist/cjs/components/TUIMessage/hooks/useMessageReply.js +1 -1
- package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.d.ts +2 -2
- package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
- package/dist/cjs/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIForward.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIMessageInput.d.ts +7 -7
- package/dist/cjs/components/TUIMessageInput/TUIMessageInput.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.d.ts +2 -2
- package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useUploadPicker.js +1 -1
- package/dist/cjs/components/TUIMessageList/TUIMessageList.d.ts +2 -2
- package/dist/cjs/components/TUIMessageList/TUIMessageList.js +1 -1
- package/dist/cjs/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
- package/dist/cjs/components/TUIProfile/TUIProfile.d.ts +3 -3
- package/dist/cjs/components/TUIProfile/TUIProfile.js +1 -1
- package/dist/cjs/components/TUIProfile/TUIProfileDefault.d.ts +2 -2
- package/dist/cjs/components/TUIProfile/TUIProfileDefault.js +1 -1
- package/dist/cjs/components/Toast/index.d.ts +2 -2
- package/dist/cjs/context/ComponentContext.d.ts +12 -12
- package/dist/cjs/context/LanguageContext.js +1 -0
- package/dist/cjs/context/TUIChatActionContext.d.ts +3 -3
- package/dist/cjs/context/TUIChatStateContext.d.ts +5 -5
- package/dist/cjs/context/TUIContactContext.d.ts +4 -4
- package/dist/cjs/context/TUIConversationContext.js +1 -1
- package/dist/cjs/context/TUIMessageContext.d.ts +17 -17
- package/dist/cjs/context/TUIMessageInputContext.d.ts +4 -4
- package/dist/cjs/context/ThemeContext.js +1 -0
- package/dist/cjs/context/UIKitContext.d.ts +25 -0
- package/dist/cjs/context/UIKitContext.js +1 -0
- package/dist/cjs/context/UIManagerContext.d.ts +46 -0
- package/dist/cjs/context/UIManagerContext.js +1 -0
- package/dist/cjs/hooks/useConversation.d.ts +2 -2
- package/dist/cjs/index.css +1 -2
- package/dist/cjs/index.d.css +908 -1440
- package/dist/cjs/index.d.ts +2 -4
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/locales/en-US/TUIGlobal.js +1 -0
- package/dist/cjs/locales/en-US/index.js +1 -1
- package/dist/cjs/locales/ja-JP/TUIGlobal.js +1 -0
- package/dist/cjs/locales/ja-JP/index.js +1 -1
- package/dist/cjs/locales/ko-KR/TUIGlobal.js +1 -0
- package/dist/cjs/locales/ko-KR/index.js +1 -1
- package/dist/cjs/locales/zh-CN/TUIGlobal.js +1 -0
- package/dist/cjs/locales/zh-CN/index.js +1 -1
- package/dist/esm/components/Avatar/Avatar.d.ts +4 -4
- package/dist/esm/components/Checkbox/index.d.ts +2 -2
- package/dist/esm/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
- package/dist/esm/components/ConversationCreate/ConversationCreate.js +1 -1
- package/dist/esm/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
- package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
- package/dist/esm/components/ConversationPreview/ConversationListContainer.d.ts +2 -2
- package/dist/esm/components/ConversationPreview/ConversationPreview.d.ts +8 -8
- package/dist/esm/components/ConversationPreview/ConversationPreview.js +1 -1
- package/dist/esm/components/ConversationPreview/ConversationPreviewContent.d.ts +2 -2
- package/dist/esm/components/ConversationPreview/ConversationPreviewContent.js +1 -1
- package/dist/esm/components/ConversationSearch/ConversationSearchResult.d.ts +3 -3
- package/dist/esm/components/ConversationSearch/ConversationSearchResult.js +1 -1
- package/dist/esm/components/Icon/Icon.d.ts +3 -3
- package/dist/esm/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +4 -4
- package/dist/esm/components/Input/Input.d.ts +4 -4
- package/dist/esm/components/Model/index.d.ts +2 -2
- package/dist/esm/components/Plugins/index.d.ts +4 -4
- package/dist/esm/components/Popup/index.d.ts +2 -2
- package/dist/esm/components/Switch/Switch.d.ts +2 -2
- package/dist/esm/components/TUIChat/TUIChat.d.ts +12 -12
- package/dist/esm/components/TUIChat/TUIChat.js +1 -1
- package/dist/esm/components/TUIChatHeader/TUIChatHeader.d.ts +5 -5
- package/dist/esm/components/TUIChatHeader/TUIChatHeader.js +1 -1
- package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.d.ts +5 -5
- package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
- package/dist/esm/components/TUIContact/TUIContact.d.ts +3 -3
- package/dist/esm/components/TUIContact/TUIContact.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/TUIContactInfo.d.ts +3 -3
- package/dist/esm/components/TUIContact/TUIContactInfo/TUIContactInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/basicInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/blockInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/friendApplication.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/groupInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/hooks/useContactInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.d.ts +3 -3
- package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
- package/dist/esm/components/TUIContact/hooks/useTUIContact.js +1 -1
- package/dist/esm/components/TUIContactSearch/TUIContactSearch.js +1 -1
- package/dist/esm/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
- package/dist/esm/components/TUIConversation/TUIConversation.d.ts +2 -2
- package/dist/esm/components/TUIConversationList/TUIConversationList.d.ts +6 -6
- package/dist/esm/components/TUIConversationList/TUIConversationList.js +1 -1
- package/dist/esm/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
- package/dist/esm/components/TUIManage/TUIManage.d.ts +2 -2
- package/dist/esm/components/TUIManage/TUIManage.js +1 -1
- package/dist/esm/components/TUIMessage/MessageAudio.js +1 -1
- package/dist/esm/components/TUIMessage/MessageAvatar.js +1 -1
- package/dist/esm/components/TUIMessage/MessageBubble.js +1 -1
- package/dist/esm/components/TUIMessage/MessageContext.d.ts +2 -2
- package/dist/esm/components/TUIMessage/MessageContext.js +1 -1
- package/dist/esm/components/TUIMessage/MessageCustom.js +1 -1
- package/dist/esm/components/TUIMessage/MessageName.js +1 -1
- package/dist/esm/components/TUIMessage/MessagePlugins.d.ts +4 -4
- package/dist/esm/components/TUIMessage/MessagePlugins.js +1 -1
- package/dist/esm/components/TUIMessage/MessageProgress.js +1 -1
- package/dist/esm/components/TUIMessage/MessageRevoke.js +1 -1
- package/dist/esm/components/TUIMessage/MessageStatus.js +1 -1
- package/dist/esm/components/TUIMessage/MessageSystem.js +1 -1
- package/dist/esm/components/TUIMessage/MessageText.js +1 -1
- package/dist/esm/components/TUIMessage/MessageTip.js +1 -1
- package/dist/esm/components/TUIMessage/TUIMessage.d.ts +19 -19
- package/dist/esm/components/TUIMessage/TUIMessage.js +1 -1
- package/dist/esm/components/TUIMessage/TUIMessageDefault.js +1 -1
- package/dist/esm/components/TUIMessage/hooks/useMessageHandler.js +1 -1
- package/dist/esm/components/TUIMessage/hooks/useMessageReply.js +1 -1
- package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.d.ts +2 -2
- package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
- package/dist/esm/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIForward.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIMessageInput.d.ts +7 -7
- package/dist/esm/components/TUIMessageInput/TUIMessageInput.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.d.ts +2 -2
- package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useUploadPicker.js +1 -1
- package/dist/esm/components/TUIMessageList/TUIMessageList.d.ts +2 -2
- package/dist/esm/components/TUIMessageList/TUIMessageList.js +1 -1
- package/dist/esm/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
- package/dist/esm/components/TUIProfile/TUIProfile.d.ts +3 -3
- package/dist/esm/components/TUIProfile/TUIProfile.js +1 -1
- package/dist/esm/components/TUIProfile/TUIProfileDefault.d.ts +2 -2
- package/dist/esm/components/TUIProfile/TUIProfileDefault.js +1 -1
- package/dist/esm/components/Toast/index.d.ts +2 -2
- package/dist/esm/context/ComponentContext.d.ts +12 -12
- package/dist/esm/context/LanguageContext.js +1 -0
- package/dist/esm/context/TUIChatActionContext.d.ts +3 -3
- package/dist/esm/context/TUIChatStateContext.d.ts +5 -5
- package/dist/esm/context/TUIContactContext.d.ts +4 -4
- package/dist/esm/context/TUIConversationContext.js +1 -1
- package/dist/esm/context/TUIMessageContext.d.ts +17 -17
- package/dist/esm/context/TUIMessageInputContext.d.ts +4 -4
- package/dist/esm/context/ThemeContext.js +1 -0
- package/dist/esm/context/UIKitContext.d.ts +25 -0
- package/dist/esm/context/UIKitContext.js +1 -0
- package/dist/esm/context/UIManagerContext.d.ts +46 -0
- package/dist/esm/context/UIManagerContext.js +1 -0
- package/dist/esm/hooks/useConversation.d.ts +2 -2
- package/dist/esm/index.css +1 -2
- package/dist/esm/index.d.css +908 -1440
- package/dist/esm/index.d.ts +2 -4
- package/dist/esm/index.js +1 -1
- package/dist/esm/locales/en-US/TUIGlobal.js +1 -0
- package/dist/esm/locales/en-US/index.js +1 -1
- package/dist/esm/locales/ja-JP/TUIGlobal.js +1 -0
- package/dist/esm/locales/ja-JP/index.js +1 -1
- package/dist/esm/locales/ko-KR/TUIGlobal.js +1 -0
- package/dist/esm/locales/ko-KR/index.js +1 -1
- package/dist/esm/locales/zh-CN/TUIGlobal.js +1 -0
- package/dist/esm/locales/zh-CN/index.js +1 -1
- package/package.json +4 -3
- package/src/components/ConversationCreate/ConversationCreatGroupDetail.tsx +4 -4
- package/src/components/ConversationCreate/ConversationCreate.tsx +2 -2
- package/src/components/ConversationCreate/ConversationCreateUserSelectList.tsx +3 -2
- package/src/components/ConversationPreview/ConversationPreview.tsx +21 -21
- package/src/components/ConversationPreview/ConversationPreviewContent.tsx +3 -2
- package/src/components/Plugins/styles/color.scss +2 -2
- package/src/components/TUIChat/TUIChat.tsx +4 -3
- package/src/components/TUIChatHeader/TUIChatHeaderDefault.tsx +3 -3
- package/src/components/TUIContact/TUIContact.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/TUIContactInfo.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/basicInfo.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/blockInfo.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/friendApplication.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/friendInfo.tsx +4 -3
- package/src/components/TUIContact/TUIContactInfo/groupInfo.tsx +3 -3
- package/src/components/TUIContact/TUIContactInfo/hooks/useContactInfo.tsx +2 -2
- package/src/components/TUIContact/TUIContactList/TUIContactList.tsx +5 -5
- package/src/components/TUIContact/hooks/useTUIContact.tsx +2 -2
- package/src/components/TUIContactSearch/TUIContactSearch.tsx +2 -2
- package/src/components/TUIContactSearch/hooks/useContactSearch.tsx +2 -2
- package/src/components/TUIConversationList/TUIConversationList.tsx +3 -4
- package/src/components/TUIConversationList/hooks/useConversationUpdate.tsx +2 -2
- package/src/components/TUIManage/TUIManage.tsx +3 -3
- package/src/components/TUIMessage/MessageStatus.tsx +2 -2
- package/src/components/TUIMessage/MessageText.tsx +16 -15
- package/src/components/TUIMessage/hooks/useMessageHandler.ts +2 -2
- package/src/components/TUIMessage/hooks/useMessageReply.ts +2 -2
- package/src/components/TUIMessageInput/TUIMessageInput.tsx +1 -1
- package/src/components/TUIMessageInput/hooks/useHandleForwardMessage.tsx +2 -2
- package/src/components/TUIMessageInput/hooks/useMessageInputText.tsx +2 -2
- package/src/components/TUIMessageInput/styles/color.scss +2 -2
- package/src/components/TUIMessageList/hooks/useMessageListElement.tsx +2 -2
- package/src/components/TUIProfile/TUIProfile.tsx +3 -3
- package/src/components/TUIProfile/TUIProfileDefault.tsx +2 -2
- package/src/components/index.ts +0 -1
- package/src/context/LanguageContext.tsx +59 -0
- package/src/context/ThemeContext.tsx +61 -0
- package/src/context/UIKitContext.tsx +67 -0
- package/src/context/UIManagerContext.tsx +163 -0
- package/src/context/index.ts +3 -2
- package/src/locales/en-US/index.ts +1 -1
- package/src/locales/ja-JP/index.ts +2 -0
- package/src/locales/ko-KR/TUIGlobal.ts +2 -2
- package/src/locales/ko-KR/index.ts +2 -0
- package/src/locales/zh-CN/index.ts +2 -2
- package/src/styles/colors/_color-theme.scss +1 -1
- package/dist/cjs/components/Icon/images/chats-selected.svg.js +0 -1
- package/dist/cjs/components/Icon/images/chats.svg.js +0 -1
- package/dist/cjs/components/Icon/images/contacts-selected.svg.js +0 -1
- package/dist/cjs/components/Icon/images/contacts.svg.js +0 -1
- package/dist/cjs/components/TUIKit/TUIKit.d.ts +0 -12
- package/dist/cjs/components/TUIKit/TUIKit.js +0 -1
- package/dist/cjs/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +0 -21
- package/dist/cjs/components/TUIKit/hooks/useCreateTUIKitContext.js +0 -1
- package/dist/cjs/components/TUIKit/hooks/useTUIKit.d.ts +0 -43
- package/dist/cjs/components/TUIKit/hooks/useTUIKit.js +0 -1
- package/dist/cjs/context/TUIKitContext.d.ts +0 -25
- package/dist/cjs/context/TUIKitContext.js +0 -1
- package/dist/esm/components/Icon/images/chats-selected.svg.js +0 -1
- package/dist/esm/components/Icon/images/chats.svg.js +0 -1
- package/dist/esm/components/Icon/images/contacts-selected.svg.js +0 -1
- package/dist/esm/components/Icon/images/contacts.svg.js +0 -1
- package/dist/esm/components/TUIKit/TUIKit.d.ts +0 -12
- package/dist/esm/components/TUIKit/TUIKit.js +0 -1
- package/dist/esm/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +0 -21
- package/dist/esm/components/TUIKit/hooks/useCreateTUIKitContext.js +0 -1
- package/dist/esm/components/TUIKit/hooks/useTUIKit.d.ts +0 -43
- package/dist/esm/components/TUIKit/hooks/useTUIKit.js +0 -1
- package/dist/esm/context/TUIKitContext.d.ts +0 -25
- package/dist/esm/context/TUIKitContext.js +0 -1
- package/src/components/TUIKit/TUIKit.tsx +0 -229
- package/src/components/TUIKit/hooks/useCreateTUIKitContext.tsx +0 -48
- package/src/components/TUIKit/hooks/useTUIKit.tsx +0 -99
- package/src/components/TUIKit/index.ts +0 -3
- package/src/components/TUIKit/styles/h5.scss +0 -34
- package/src/components/TUIKit/styles/index.scss +0 -132
- package/src/context/TUIKitContext.tsx +0 -44
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
export { ChatProps, TUIKit } from './components/TUIKit/TUIKit.js';
|
|
2
|
-
export { UseChatParams, UseContactParams, useTUIKit } from './components/TUIKit/hooks/useTUIKit.js';
|
|
3
|
-
export { useCreateTUIKitContext } from './components/TUIKit/hooks/useCreateTUIKitContext.js';
|
|
4
1
|
export { TUIConversation, UnMemoizedTUIConversation } from './components/TUIConversation/TUIConversation.js';
|
|
5
2
|
export { TUIConversationList, UnMemoTUIConversationList } from './components/TUIConversationList/TUIConversationList.js';
|
|
6
3
|
export { TUIChat } from './components/TUIChat/TUIChat.js';
|
|
7
|
-
export {
|
|
4
|
+
export { UIKitProvider, useUIKit } from './context/UIKitContext.js';
|
|
5
|
+
export { UIManagerContextType, UIManagerProvider, useUIManager } from './context/UIManagerContext.js';
|
|
8
6
|
export { TUIChatStateContext, TUIChatStateContextProvider, TUIChatStateContextValue, useTUIChatStateContext } from './context/TUIChatStateContext.js';
|
|
9
7
|
export { TUIChatActionContext, TUIChatActionContextValue, TUIChatActionProvider, useTUIChatActionContext } from './context/TUIChatActionContext.js';
|
|
10
8
|
export { TUIMessageContext, TUIMessageContextProvider, TUIMessageContextValue, messageShowType, useTUIMessageContext } from './context/TUIMessageContext.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"./server.js";export{
|
|
1
|
+
import o from"./server.js";export{TUIConversation,UnMemoizedTUIConversation}from"./components/TUIConversation/TUIConversation.js";export{TUIConversationList,UnMemoTUIConversationList}from"./components/TUIConversationList/TUIConversationList.js";import"react";import"@tencentcloud/chat";import"@tencentcloud/chat-uikit-engine";export{TUIChat}from"./components/TUIChat/TUIChat.js";import"tslib";export{ConversationPreview}from"./components/ConversationPreview/ConversationPreview.js";export{ConversationPreviewContent,unMemoConversationPreviewContent}from"./components/ConversationPreview/ConversationPreviewContent.js";export{TUIChatHeader}from"./components/TUIChatHeader/TUIChatHeader.js";export{TUIChatHeaderDefault}from"./components/TUIChatHeader/TUIChatHeaderDefault.js";export{TUIMessageList}from"./components/TUIMessageList/TUIMessageList.js";export{TUIMessage}from"./components/TUIMessage/TUIMessage.js";export{MessagePlugins}from"./components/TUIMessage/MessagePlugins.js";export{MessageContext}from"./components/TUIMessage/MessageContext.js";export{TUIMessageInput}from"./components/TUIMessageInput/TUIMessageInput.js";export{TUIMessageInputDefault}from"./components/TUIMessageInput/TUIMessageInputDefault.js";export{InputPluginsDefalut}from"./components/TUIMessageInput/InputPluginsDefalut.js";export{TUIProfile}from"./components/TUIProfile/TUIProfile.js";export{TUIProfileDefault}from"./components/TUIProfile/TUIProfileDefault.js";export{Avatar}from"./components/Avatar/Avatar.js";export{defaultGroupAvatarAVChatRoom,defaultGroupAvatarMeeting,defaultGroupAvatarPublic,defaultGroupAvatarWork,defaultUserAvatar}from"./components/Avatar/default.js";export{ConversationSearchInput}from"./components/ConversationSearch/ConversationSearchInput.js";export{ConversationSearchResult}from"./components/ConversationSearch/ConversationSearchResult.js";export{TUIManage}from"./components/TUIManage/TUIManage.js";export{Popup}from"./components/Popup/index.js";export{Checkbox}from"./components/Checkbox/index.js";export{DivWithEdit}from"./components/DivWithEdit/DivWithEdit.js";export{Icon,changeTypeToIconClassName}from"./components/Icon/Icon.js";export{IconTypes}from"./components/Icon/type.js";export{EmptyStateIndicator}from"./components/EmptyStateIndicator/EmptyStateIndicator.js";export{Input}from"./components/Input/Input.js";export{Model}from"./components/Model/index.js";export{Plugins}from"./components/Plugins/index.js";export{Switch}from"./components/Switch/Switch.js";export{Toast}from"./components/Toast/index.js";export{TUIContactList}from"./components/TUIContact/TUIContactList/TUIContactList.js";export{TUIContactInfo,UnMemoizedTUIContactInfo}from"./components/TUIContact/TUIContactInfo/TUIContactInfo.js";export{TUIContact,UnMemoizedTUIContact}from"./components/TUIContact/TUIContact.js";export{UIKitProvider,useUIKit}from"./context/UIKitContext.js";export{UIManagerProvider,useUIManager}from"./context/UIManagerContext.js";export{TUIChatStateContext,TUIChatStateContextProvider,useTUIChatStateContext}from"./context/TUIChatStateContext.js";export{TUIChatActionContext,TUIChatActionProvider,useTUIChatActionContext}from"./context/TUIChatActionContext.js";export{TUIMessageContext,TUIMessageContextProvider,messageShowType,useTUIMessageContext}from"./context/TUIMessageContext.js";export{ComponentContext,ComponentProvider,useComponentContext}from"./context/ComponentContext.js";export{TUIMessageInputContext,TUIMessageInputContextProvider,useTUIMessageInputContext}from"./context/TUIMessageInputContext.js";export{TUIContactContext,TUIContactContextProvider,useTUIContactContext}from"./context/TUIContactContext.js";export{useConversation}from"./hooks/useConversation.js";export{useProfile}from"./hooks/useProfile.js";export{t}from"./locales/index.js";export{isH5,isPC,setPlatform}from"./utils/env.js";export{default as i18next}from"i18next";new o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a={chats:"Messages",contacts:"Contacts"};export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"./
|
|
1
|
+
import o from"./TUIGlobal.js";import r from"./TUIChat.js";import t from"./TUIConversation.js";import m from"./TUIContact.js";import I from"./TUIProfile.js";var T={TUIGlobal:o,TUIChat:r,TUIConversation:t,TUIContact:m,TUIProfile:I};export{T as message};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a={chats:"メッセージ",contacts:"連絡先"};export{a as TUIGlobal,a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"./TUIChat.js";import
|
|
1
|
+
import{TUIGlobal as o}from"./TUIGlobal.js";import r from"./TUIChat.js";import t from"./TUIConversation.js";import m from"./TUIContact.js";import I from"./TUIProfile.js";var T={TUIGlobal:o,TUIChat:r,TUIConversation:t,TUIContact:m,TUIProfile:I};export{T as message};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a={chats:"채팅",contacts:"연락처"};export{a as TUIGlobal,a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"./TUIChat.js";import
|
|
1
|
+
import{TUIGlobal as o}from"./TUIGlobal.js";import r from"./TUIChat.js";import t from"./TUIConversation.js";import m from"./TUIContact.js";import I from"./TUIProfile.js";var T={TUIGlobal:o,TUIChat:r,TUIConversation:t,TUIContact:m,TUIProfile:I};export{T as message};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a={chats:"消息",contacts:"通讯录"};export{a as TUIGlobal,a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"./TUIChat.js";import t from"./TUIConversation.js";import
|
|
1
|
+
import{TUIGlobal as o}from"./TUIGlobal.js";import r from"./TUIChat.js";import t from"./TUIConversation.js";import m from"./TUIContact.js";import I from"./TUIProfile.js";var T={TUIGlobal:o,TUIChat:r,TUIConversation:t,TUIContact:m,TUIProfile:I};export{T as message};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tencentcloud/chat-uikit-react",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.6",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"uikit"
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
18
|
-
"build": "rimraf
|
|
19
|
-
"start": "
|
|
18
|
+
"build": "rimraf dist && rollup -c",
|
|
19
|
+
"start": "rimraf dist && rollup -c -w",
|
|
20
20
|
"clean": "rimraf -g ./dist node_modules examples/*/node_modules",
|
|
21
21
|
"prepare": "husky install"
|
|
22
22
|
},
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"@typescript-eslint/eslint-plugin": "^5.36.2",
|
|
43
43
|
"@typescript-eslint/parser": "^5.36.2",
|
|
44
44
|
"autoprefixer": "^10.4.11",
|
|
45
|
+
"cross-env": "^7.0.3",
|
|
45
46
|
"eslint": "^8.57.0",
|
|
46
47
|
"eslint-config-react-app": "^7.0.1",
|
|
47
48
|
"eslint-import-resolver-typescript": "^3.5.1",
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from '../Avatar';
|
|
15
15
|
import { PageStateTypes } from './ConversationCreate';
|
|
16
16
|
import { ConversationGroupTypeInfo, GroupType, typeInfoList } from './ConversationGroupTypeInfo';
|
|
17
|
-
import {
|
|
17
|
+
import { useUIManager } from '../../context';
|
|
18
18
|
import { CreateGroupConversationParams } from '../../hooks';
|
|
19
19
|
|
|
20
20
|
export interface ConversationCreatGroupDetailProps {
|
|
@@ -30,7 +30,7 @@ export function ConversationCreatGroupDetail(props: ConversationCreatGroupDetail
|
|
|
30
30
|
profileList, pageState, setPageState, createConversation, setConversationCreated,
|
|
31
31
|
} = props;
|
|
32
32
|
const { t } = useTranslation();
|
|
33
|
-
const { setActiveConversation, myProfile } =
|
|
33
|
+
const { setActiveConversation, myProfile } = useUIManager();
|
|
34
34
|
const temp = [...profileList];
|
|
35
35
|
myProfile && temp.unshift(myProfile);
|
|
36
36
|
const name = temp.map((item) => item.nick || item.userID).toString();
|
|
@@ -84,9 +84,9 @@ export function ConversationCreatGroupDetail(props: ConversationCreatGroupDetail
|
|
|
84
84
|
name: groupName,
|
|
85
85
|
// eslint-disable-next-line
|
|
86
86
|
// @ts-ignore
|
|
87
|
-
type: GroupType[groupType],
|
|
87
|
+
type: GroupType[groupType],
|
|
88
88
|
groupID,
|
|
89
|
-
avatar,
|
|
89
|
+
avatar,
|
|
90
90
|
memberList,
|
|
91
91
|
});
|
|
92
92
|
setActiveConversation(conversation);
|
|
@@ -5,7 +5,7 @@ import { Conversation } from '@tencentcloud/chat';
|
|
|
5
5
|
import { Icon, IconTypes } from '../Icon';
|
|
6
6
|
import { ConversationCreateUserSelectList } from './ConversationCreateUserSelectList';
|
|
7
7
|
import { ConversationCreatGroupDetail } from './ConversationCreatGroupDetail';
|
|
8
|
-
import {
|
|
8
|
+
import { useUIKit } from '../../context';
|
|
9
9
|
import { useConversation } from '../../hooks';
|
|
10
10
|
|
|
11
11
|
export interface ConversationCreateProps {
|
|
@@ -24,7 +24,7 @@ export function ConversationCreate<T extends ConversationCreateProps>(props:T) {
|
|
|
24
24
|
const [isCreateGroup, setIsCreateGroup] = useState(false);
|
|
25
25
|
const [pageState, setPageState] = useState<PageStateTypes>(PageStateTypes.USER_SELECT);
|
|
26
26
|
const [selectList, setSelectList] = useState([]);
|
|
27
|
-
const { chat } =
|
|
27
|
+
const { chat } = useUIKit();
|
|
28
28
|
const { createConversation } = useConversation(chat);
|
|
29
29
|
|
|
30
30
|
const back = () => {
|
|
@@ -9,7 +9,7 @@ import { Icon, IconTypes } from '../Icon';
|
|
|
9
9
|
import { ConversationCreateSelectView, ConversationCreateSelectViewProps } from './ConversationCreateSelectView';
|
|
10
10
|
import { Avatar, defaultUserAvatar } from '../Avatar';
|
|
11
11
|
import { useConversationCreate } from './hooks/useConversationCreate';
|
|
12
|
-
import {
|
|
12
|
+
import { useUIKit, useUIManager } from '../../context';
|
|
13
13
|
import { PageStateTypes } from './ConversationCreate';
|
|
14
14
|
import { useConversation } from '../../hooks';
|
|
15
15
|
import { Toast } from '../Toast';
|
|
@@ -35,7 +35,8 @@ export function ConversationCreateUserSelectList(props: ConversationCreateUserSe
|
|
|
35
35
|
} = props;
|
|
36
36
|
const { t } = useTranslation();
|
|
37
37
|
const [searchValue, setSearchValue] = useState('');
|
|
38
|
-
const { chat
|
|
38
|
+
const { chat } = useUIKit();
|
|
39
|
+
const { setActiveConversation } = useUIManager();
|
|
39
40
|
const [friendList, setFriendList] = useState<any>({});
|
|
40
41
|
const {
|
|
41
42
|
getFriendListSortSearchResult,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { Conversation } from '@tencentcloud/chat';
|
|
3
|
-
import {
|
|
2
|
+
import type { Conversation } from '@tencentcloud/chat';
|
|
3
|
+
import { useUIKit, useUIManager } from '../../context';
|
|
4
4
|
import { ConversationPreviewContent } from './ConversationPreviewContent';
|
|
5
5
|
import { AvatarProps } from '../Avatar';
|
|
6
6
|
|
|
@@ -8,34 +8,34 @@ import {
|
|
|
8
8
|
getDisplayImage, getDisplayMessage, getDisplayTitle, getDisplayTime,
|
|
9
9
|
} from './utils';
|
|
10
10
|
|
|
11
|
-
export interface ConversationPreviewUIComponentProps extends ConversationPreviewProps{
|
|
11
|
+
export interface ConversationPreviewUIComponentProps extends ConversationPreviewProps {
|
|
12
12
|
/** If the component's Conversation is the active (selected) Conversation */
|
|
13
|
-
active?: boolean
|
|
13
|
+
active?: boolean;
|
|
14
14
|
/** Image of Conversation to display */
|
|
15
|
-
displayImage?: string
|
|
15
|
+
displayImage?: string;
|
|
16
16
|
/** Title of Conversation to display */
|
|
17
|
-
displayTitle?: string | React.ReactElement
|
|
17
|
+
displayTitle?: string | React.ReactElement;
|
|
18
18
|
/** Message of Conversation to display */
|
|
19
|
-
displayMessage?: string | React.ReactElement
|
|
19
|
+
displayMessage?: string | React.ReactElement;
|
|
20
20
|
/** Time of Conversation to display */
|
|
21
|
-
displayTime?: string
|
|
21
|
+
displayTime?: string;
|
|
22
22
|
/** Number of unread Messages */
|
|
23
|
-
unread?: number
|
|
23
|
+
unread?: number;
|
|
24
24
|
}
|
|
25
25
|
export interface ConversationPreviewProps {
|
|
26
|
-
conversation: Conversation
|
|
27
|
-
activeConversation?: Conversation
|
|
28
|
-
Preview?: React.ComponentType<ConversationPreviewUIComponentProps
|
|
29
|
-
Avatar?: React.ComponentType<AvatarProps
|
|
30
|
-
setActiveConversation?:
|
|
31
|
-
searchValue?: string
|
|
32
|
-
conversationUpdateCount?: number
|
|
33
|
-
activeConversationID?: string
|
|
34
|
-
setActiveConversationID?: (conversationID: string) => void
|
|
26
|
+
conversation: Conversation;
|
|
27
|
+
activeConversation?: Conversation;
|
|
28
|
+
Preview?: React.ComponentType<ConversationPreviewUIComponentProps>;
|
|
29
|
+
Avatar?: React.ComponentType<AvatarProps>;
|
|
30
|
+
setActiveConversation?: (conversation: Conversation | undefined) => void;
|
|
31
|
+
searchValue?: string;
|
|
32
|
+
conversationUpdateCount?: number;
|
|
33
|
+
activeConversationID?: string;
|
|
34
|
+
setActiveConversationID?: (conversationID: string) => void;
|
|
35
35
|
}
|
|
36
36
|
export function ConversationPreview<T extends ConversationPreviewProps>(
|
|
37
37
|
props: T,
|
|
38
|
-
)
|
|
38
|
+
) {
|
|
39
39
|
const {
|
|
40
40
|
activeConversation,
|
|
41
41
|
conversation,
|
|
@@ -43,11 +43,11 @@ export function ConversationPreview<T extends ConversationPreviewProps>(
|
|
|
43
43
|
searchValue,
|
|
44
44
|
conversationUpdateCount,
|
|
45
45
|
} = props;
|
|
46
|
-
const { language } =
|
|
46
|
+
const { language } = useUIKit();
|
|
47
47
|
const {
|
|
48
48
|
setActiveConversation,
|
|
49
49
|
myProfile,
|
|
50
|
-
} =
|
|
50
|
+
} = useUIManager('ConversationPreview');
|
|
51
51
|
const [displayImage, setDisplayImage] = useState(getDisplayImage(conversation));
|
|
52
52
|
const [displayTitle, setDisplayTitle] = useState(getDisplayTitle(conversation, searchValue));
|
|
53
53
|
const [displayMessage, setDisplayMessage] = useState(myProfile && getDisplayMessage(conversation, myProfile, language));
|
|
@@ -10,7 +10,7 @@ import './styles/index.scss';
|
|
|
10
10
|
import { Icon, IconTypes } from '../Icon';
|
|
11
11
|
import { Plugins } from '../Plugins';
|
|
12
12
|
import { useConversation } from '../../hooks';
|
|
13
|
-
import {
|
|
13
|
+
import { useUIKit, useUIManager } from '../../context';
|
|
14
14
|
|
|
15
15
|
export interface IPluginsRef {
|
|
16
16
|
closeMore?: () => void,
|
|
@@ -34,7 +34,8 @@ export function unMemoConversationPreviewContent<T extends ConversationPreviewUI
|
|
|
34
34
|
|
|
35
35
|
const { t } = useTranslation();
|
|
36
36
|
const conversationPreviewButton = useRef<HTMLButtonElement | null>(null);
|
|
37
|
-
const { chat
|
|
37
|
+
const { chat } = useUIKit();
|
|
38
|
+
const { conversation: activeConversation } = useUIManager('ConversationPreviewContent');
|
|
38
39
|
const { pinConversation, deleteConversation } = useConversation(chat);
|
|
39
40
|
const activeClass = active ? 'conversation-preview-content--active' : '';
|
|
40
41
|
const unreadClass = unread && unread >= 1 ? 'conversation-preview-content--unread' : '';
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
color: get(text-primary);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
[data-
|
|
11
|
+
[data-uikit-theme="light"] & {
|
|
12
12
|
background-color: var(--chat-theme-light-bg-primary);
|
|
13
13
|
box-shadow: var(--chat-theme-light-box-shadow-1);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
[data-
|
|
16
|
+
[data-uikit-theme="dark"] & {
|
|
17
17
|
background-color: var(--chat-theme-dark-bg-3);
|
|
18
18
|
box-shadow: var(--chat-theme-dark-box-shadow-1);
|
|
19
19
|
}
|
|
@@ -10,7 +10,7 @@ import TUIChatEngine, {
|
|
|
10
10
|
StoreName,
|
|
11
11
|
} from '@tencentcloud/chat-uikit-engine';
|
|
12
12
|
import { JSONStringToParse } from '../untils';
|
|
13
|
-
import {
|
|
13
|
+
import { useUIKit, useUIManager } from '../../context';
|
|
14
14
|
import { TUIChatStateContextProvider } from '../../context/TUIChatStateContext';
|
|
15
15
|
import { TUIChatActionProvider } from '../../context/TUIChatActionContext';
|
|
16
16
|
import { ComponentProvider, UnknowPorps } from '../../context/ComponentContext';
|
|
@@ -79,7 +79,8 @@ function UnMemoizedTUIChat <T extends TUIChatProps>(
|
|
|
79
79
|
EmptyPlaceholder = <EmptyStateIndicator listType="chat" />,
|
|
80
80
|
} = props;
|
|
81
81
|
|
|
82
|
-
const {
|
|
82
|
+
const { chat } = useUIKit();
|
|
83
|
+
const { conversation: contextConversation } = useUIManager('TUIChat');
|
|
83
84
|
|
|
84
85
|
const conversation = propsConversation || contextConversation;
|
|
85
86
|
|
|
@@ -162,7 +163,7 @@ function TUIChatInner <T extends TUIChatInnerProps>(
|
|
|
162
163
|
setHighlightedMessageId,
|
|
163
164
|
setActiveMessageID,
|
|
164
165
|
} = useHandleMessage({
|
|
165
|
-
// eslint-disable-next-line
|
|
166
|
+
// eslint-disable-next-line
|
|
166
167
|
// @ts-ignore
|
|
167
168
|
state,
|
|
168
169
|
dispatch,
|
|
@@ -6,7 +6,7 @@ import { handleDisplayAvatar } from '../untils';
|
|
|
6
6
|
import { isH5 } from '../../utils/env';
|
|
7
7
|
import './styles/index.scss';
|
|
8
8
|
import { Icon, IconTypes } from '../Icon';
|
|
9
|
-
import {
|
|
9
|
+
import { useUIManager } from '../../context';
|
|
10
10
|
|
|
11
11
|
export interface TUIChatHeaderDefaultProps {
|
|
12
12
|
title?: string,
|
|
@@ -32,7 +32,7 @@ function TUIChatHeaderDefaultWithContext <T extends TUIChatHeaderBasicProps>(
|
|
|
32
32
|
isLive,
|
|
33
33
|
opateIcon,
|
|
34
34
|
} = props;
|
|
35
|
-
const { setActiveContact } =
|
|
35
|
+
const { setActiveContact } = useUIManager('TUIContact');
|
|
36
36
|
const [title, setTitle] = useState(propTitle);
|
|
37
37
|
const [avatar, setAvatar] = useState<React.ReactElement | string>('');
|
|
38
38
|
|
|
@@ -82,7 +82,7 @@ function TUIChatHeaderDefaultWithContext <T extends TUIChatHeaderBasicProps>(
|
|
|
82
82
|
TUIConversationService.switchConversation('');
|
|
83
83
|
setActiveContact();
|
|
84
84
|
};
|
|
85
|
-
const { setTUIManageShow } =
|
|
85
|
+
const { setTUIManageShow } = useUIManager();
|
|
86
86
|
const openTUIManage = () => {
|
|
87
87
|
setTUIManageShow && setTUIManageShow(true);
|
|
88
88
|
};
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
TUIContactContextValue,
|
|
6
6
|
} from '../../context/TUIContactContext';
|
|
7
7
|
import { isH5 } from '../../utils/env';
|
|
8
|
-
import {
|
|
8
|
+
import { useUIManager } from '../../context';
|
|
9
9
|
import useTUIContact from './hooks/useTUIContact';
|
|
10
10
|
import { TUIContactList } from './TUIContactList/TUIContactList';
|
|
11
11
|
import { TUIContactSearch } from '../TUIContactSearch/TUIContactSearch';
|
|
@@ -17,7 +17,7 @@ export function UnMemoizedTUIContact<T>(
|
|
|
17
17
|
): React.ReactElement {
|
|
18
18
|
const { children } = props;
|
|
19
19
|
const { t } = useTranslation();
|
|
20
|
-
const { setActiveContact } =
|
|
20
|
+
const { setActiveContact } = useUIManager('TUIContact');
|
|
21
21
|
const [isShowAddFriend, setShowAddFriend] = useState(false);
|
|
22
22
|
const addFriend = () => {
|
|
23
23
|
setActiveContact();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, {
|
|
2
2
|
PropsWithChildren,
|
|
3
3
|
} from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { useUIManager } from '../../../context';
|
|
5
5
|
import { isH5 } from '../../../utils/env';
|
|
6
6
|
import { FriendInfo } from './friendInfo';
|
|
7
7
|
import { BlockInfo } from './blockInfo';
|
|
@@ -18,7 +18,7 @@ export function UnMemoizedTUIContactInfo<T extends TUIContactInfoProps>(
|
|
|
18
18
|
props: PropsWithChildren<T>,
|
|
19
19
|
): React.ReactElement {
|
|
20
20
|
const { showChats } = props;
|
|
21
|
-
const { contactData } =
|
|
21
|
+
const { contactData } = useUIManager('TUIContact');
|
|
22
22
|
if (!contactData?.type) {
|
|
23
23
|
return (<> </>);
|
|
24
24
|
}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { Profile } from '@tencentcloud/chat';
|
|
4
4
|
import { TUIConversationService } from '@tencentcloud/chat-uikit-engine';
|
|
5
|
-
import {
|
|
5
|
+
import { useUIManager } from '../../../context';
|
|
6
6
|
import { Icon, IconTypes } from '../../Icon';
|
|
7
7
|
import { isH5 } from '../../../utils/env';
|
|
8
8
|
|
|
@@ -19,7 +19,7 @@ export function UnMemoizedBasicInfo<T extends Props>(
|
|
|
19
19
|
const {
|
|
20
20
|
userID, nick, selfSignature, avatar,
|
|
21
21
|
} = profile;
|
|
22
|
-
const { setActiveContact } =
|
|
22
|
+
const { setActiveContact } = useUIManager('TUIContact');
|
|
23
23
|
const back = () => {
|
|
24
24
|
TUIConversationService.switchConversation('');
|
|
25
25
|
setActiveContact();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { Profile } from '@tencentcloud/chat';
|
|
4
|
-
import {
|
|
4
|
+
import { useUIManager } from '../../../context';
|
|
5
5
|
import { BasicInfo } from './basicInfo';
|
|
6
6
|
import { Switch } from '../../Switch';
|
|
7
7
|
import useContactInfo from './hooks/useContactInfo';
|
|
@@ -13,7 +13,7 @@ export function UnMemoizedBlockInfo<T extends Props>(
|
|
|
13
13
|
props: T,
|
|
14
14
|
): React.ReactElement {
|
|
15
15
|
const { profile } = props;
|
|
16
|
-
const { contactData, setActiveContact } =
|
|
16
|
+
const { contactData, setActiveContact } = useUIManager('TUIContact');
|
|
17
17
|
const { t } = useTranslation();
|
|
18
18
|
const [isAddToBlocklist, setIsAddToBlocklist] = useState(false);
|
|
19
19
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import TencentCloudChat, { FriendApplication } from '@tencentcloud/chat';
|
|
4
|
-
import {
|
|
4
|
+
import { useUIManager } from '../../../context';
|
|
5
5
|
import { Avatar, defaultUserAvatar } from '../../Avatar';
|
|
6
6
|
import useContactInfo from './hooks/useContactInfo';
|
|
7
7
|
|
|
@@ -11,7 +11,7 @@ interface Props {
|
|
|
11
11
|
export function UnMemoizedFriendApplication<T extends Props>(
|
|
12
12
|
props: T,
|
|
13
13
|
): React.ReactElement {
|
|
14
|
-
const { setActiveContact } =
|
|
14
|
+
const { setActiveContact } = useUIManager('TUIContact');
|
|
15
15
|
const { t } = useTranslation();
|
|
16
16
|
const { application } = props;
|
|
17
17
|
const {
|
|
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
|
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { Friend } from '@tencentcloud/chat';
|
|
4
4
|
import { TUIConversationService, IConversationModel } from '@tencentcloud/chat-uikit-engine';
|
|
5
|
-
import {
|
|
5
|
+
import { useUIKit, useUIManager } from '../../../context';
|
|
6
6
|
import { BasicInfo } from './basicInfo';
|
|
7
7
|
import { Switch } from '../../Switch';
|
|
8
8
|
import useContactInfo from './hooks/useContactInfo';
|
|
@@ -16,9 +16,10 @@ interface Props {
|
|
|
16
16
|
export function UnMemoizedFriendInfo<T extends Props>(
|
|
17
17
|
props: T,
|
|
18
18
|
): React.ReactElement {
|
|
19
|
+
const { chat } = useUIKit();
|
|
19
20
|
const {
|
|
20
|
-
|
|
21
|
-
} =
|
|
21
|
+
contactData, setActiveContact, setActiveConversation,
|
|
22
|
+
} = useUIManager('TUIContact');
|
|
22
23
|
const { t } = useTranslation();
|
|
23
24
|
const { friend, showChats } = props;
|
|
24
25
|
const { userID, profile, remark } = friend;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { TUIConversationService, IGroupModel, IConversationModel } from '@tencentcloud/chat-uikit-engine';
|
|
4
|
-
import {
|
|
4
|
+
import { useUIManager } from '../../../context';
|
|
5
5
|
import { Icon, IconTypes } from '../../Icon';
|
|
6
6
|
import { isH5 } from '../../../utils/env';
|
|
7
7
|
import '../index.scss';
|
|
@@ -16,8 +16,8 @@ export function UnMemoizedGroupInfo<T extends Props>(
|
|
|
16
16
|
props: T,
|
|
17
17
|
): React.ReactElement {
|
|
18
18
|
const { group, showChats } = props;
|
|
19
|
-
|
|
20
|
-
const { setActiveContact, setActiveConversation } =
|
|
19
|
+
|
|
20
|
+
const { setActiveContact, setActiveConversation } = useUIManager('TUIContact');
|
|
21
21
|
const { t } = useTranslation();
|
|
22
22
|
const { groupID, name, avatar } = group;
|
|
23
23
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import TencentCloudChat from '@tencentcloud/chat';
|
|
3
3
|
import { Toast } from '../../../Toast';
|
|
4
|
-
import {
|
|
4
|
+
import { useUIKit } from '../../../../context';
|
|
5
5
|
|
|
6
6
|
function useContactInfo() {
|
|
7
|
-
const { chat } =
|
|
7
|
+
const { chat } = useUIKit('useContactInfo');
|
|
8
8
|
|
|
9
9
|
const removeFromBlocklist = useCallback((userID: string) => {
|
|
10
10
|
chat.removeFromBlacklist({
|
|
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import TencentCloudChat from '@tencentcloud/chat';
|
|
4
4
|
import { isH5 } from '../../../utils/env';
|
|
5
|
-
import {
|
|
5
|
+
import { useUIManager, useTUIContactContext } from '../../../context';
|
|
6
6
|
import useContactInfo from '../TUIContactInfo/hooks/useContactInfo';
|
|
7
7
|
import useTUIContact from '../hooks/useTUIContact';
|
|
8
8
|
import { Avatar, defaultUserAvatar } from '../../Avatar';
|
|
@@ -19,7 +19,7 @@ interface RenderContactListProps {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
function UnMemoizedTUIContactList<T>(): React.ReactElement {
|
|
22
|
-
const { setActiveContact } =
|
|
22
|
+
const { setActiveContact } = useUIManager();
|
|
23
23
|
const { t } = useTranslation();
|
|
24
24
|
const {
|
|
25
25
|
isShowContactList, friendList, blocklistProfile, friendApplicationList,
|
|
@@ -143,21 +143,21 @@ const RenderContactList = ({ type, isShow, setShow, list, title } : RenderContac
|
|
|
143
143
|
</div>
|
|
144
144
|
);
|
|
145
145
|
})}
|
|
146
|
-
<RenderContactList
|
|
146
|
+
<RenderContactList
|
|
147
147
|
type={'block'}
|
|
148
148
|
title={t('TUIContact.Blocked List')}
|
|
149
149
|
isShow={isShowBlocklist}
|
|
150
150
|
setShow={setShowBlocklist}
|
|
151
151
|
list={blocklistProfile}
|
|
152
152
|
/>
|
|
153
|
-
<RenderContactList
|
|
153
|
+
<RenderContactList
|
|
154
154
|
type={'group'}
|
|
155
155
|
title={t('TUIContact.Group List')}
|
|
156
156
|
setShow={setShowGrouplist}
|
|
157
157
|
isShow={isShowGrouplist}
|
|
158
158
|
list={groupList}
|
|
159
159
|
/>
|
|
160
|
-
<RenderContactList
|
|
160
|
+
<RenderContactList
|
|
161
161
|
type={'friend'}
|
|
162
162
|
title={t('TUIContact.Friends')}
|
|
163
163
|
setShow={setShowFriends}
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
StoreName,
|
|
6
6
|
IGroupModel,
|
|
7
7
|
} from '@tencentcloud/chat-uikit-engine';
|
|
8
|
-
import {
|
|
8
|
+
import { useUIKit } from '../../../context';
|
|
9
9
|
|
|
10
10
|
function useTUIContact() {
|
|
11
|
-
const { chat } =
|
|
11
|
+
const { chat } = useUIKit();
|
|
12
12
|
const [friendList, setFriendList] = useState([]);
|
|
13
13
|
const [blockList, setBlockList] = useState([]);
|
|
14
14
|
const [friendApplicationList, setFriendApplicationList] = useState([]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import {
|
|
3
|
+
import { useUIManager, useTUIContactContext } from '../../context';
|
|
4
4
|
import useContactSearch from './hooks/useContactSearch';
|
|
5
5
|
import { Icon, IconTypes } from '../Icon';
|
|
6
6
|
import { Avatar, defaultUserAvatar } from '../Avatar';
|
|
@@ -8,7 +8,7 @@ import { Input } from '../Input';
|
|
|
8
8
|
import './index.scss';
|
|
9
9
|
|
|
10
10
|
export function UnMemoizedTUIContactSearch<T>(): React.ReactElement {
|
|
11
|
-
const {
|
|
11
|
+
const { setActiveContact } = useUIManager('TUIContactSearch');
|
|
12
12
|
const { t } = useTranslation();
|
|
13
13
|
const { friendList, setShowContactList } = useTUIContactContext('TUIContactList');
|
|
14
14
|
const [isShowSearchResult, setShowSearchResult] = useState(false);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import TencentCloudChat from '@tencentcloud/chat';
|
|
2
|
-
import {
|
|
2
|
+
import { useUIKit, useTUIContactContext } from '../../../context';
|
|
3
3
|
|
|
4
4
|
function useContactSearch() {
|
|
5
5
|
const { blockList } = useTUIContactContext('TUIContactList');
|
|
6
|
-
const { chat } =
|
|
6
|
+
const { chat } = useUIKit('TUIContactSearch');
|
|
7
7
|
|
|
8
8
|
const checkFriend = (info: any): Promise<any> => chat.checkFriend({
|
|
9
9
|
userIDList: [info?.userID],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useRef, useState } from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { Conversation } from '@tencentcloud/chat';
|
|
4
|
-
import {
|
|
4
|
+
import { useUIKit, useUIManager } from '../../context';
|
|
5
5
|
import { isH5 } from '../../utils/env';
|
|
6
6
|
import useConversationList from './hooks/useConversationList';
|
|
7
7
|
import './index.scss';
|
|
@@ -43,13 +43,13 @@ export function UnMemoTUIConversationList<T extends Props>(props: T):React.React
|
|
|
43
43
|
},
|
|
44
44
|
} = props;
|
|
45
45
|
const { t } = useTranslation();
|
|
46
|
+
const { chat } = useUIKit('TUIConversationList');
|
|
46
47
|
const {
|
|
47
|
-
chat,
|
|
48
48
|
customClasses,
|
|
49
49
|
conversation,
|
|
50
50
|
setActiveConversation,
|
|
51
51
|
setTUIProfileShow,
|
|
52
|
-
} =
|
|
52
|
+
} = useUIManager('TUIConversationList');
|
|
53
53
|
const { filterConversation: contextFilterConversation } = useTUIConversationContext('TUIConversationList');
|
|
54
54
|
const filterConversation = propsFilterConversation || contextFilterConversation;
|
|
55
55
|
const [conversationUpdateCount, setConversationUpdateCount] = useState(0);
|
|
@@ -64,7 +64,6 @@ export function UnMemoTUIConversationList<T extends Props>(props: T):React.React
|
|
|
64
64
|
if (!conversationList.length) {
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
|
-
setActiveConversation(conversation);
|
|
68
67
|
};
|
|
69
68
|
const { conversationList, setConversationList } = useConversationList(
|
|
70
69
|
chat,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
2
|
import TencentCloudChat, { Conversation } from '@tencentcloud/chat';
|
|
3
|
-
import {
|
|
3
|
+
import { useUIKit } from '../../../context';
|
|
4
4
|
|
|
5
5
|
export const useConversationUpdate = (
|
|
6
6
|
setConversationList?: React.Dispatch<React.SetStateAction<Array<Conversation>>>,
|
|
@@ -11,7 +11,7 @@ export const useConversationUpdate = (
|
|
|
11
11
|
forceUpdate?: () => void,
|
|
12
12
|
filterConversation?:(conversationList: Array<Conversation>) => Array<Conversation>,
|
|
13
13
|
) => {
|
|
14
|
-
const { chat } =
|
|
14
|
+
const { chat } = useUIKit('useConversationUpdate');
|
|
15
15
|
useEffect(() => {
|
|
16
16
|
const onConversationListUpdated = (event:any) => {
|
|
17
17
|
if (setConversationList) {
|