@tencentcloud/chat-uikit-react 2.2.4 → 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/.babelrc +2 -2
- package/.eslintrc.js +141 -31
- package/.lintstagedrc.json +1 -1
- package/.stylelintrc.js +17 -18
- package/CHANGELOG.md +19 -2
- package/README.md +8 -8
- package/dist/cjs/assets/fonts/iconfont.ttf +0 -0
- package/dist/cjs/assets/fonts/iconfont.woff +0 -0
- package/dist/cjs/assets/fonts/iconfont.woff2 +0 -0
- package/dist/cjs/components/Avatar/Avatar.d.ts +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/ConversationPreview/utils.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 -1
- package/dist/cjs/index.d.css +984 -1039
- 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/assets/fonts/iconfont.ttf +0 -0
- package/dist/esm/assets/fonts/iconfont.woff +0 -0
- package/dist/esm/assets/fonts/iconfont.woff2 +0 -0
- package/dist/esm/components/Avatar/Avatar.d.ts +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/ConversationPreview/utils.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 -1
- package/dist/esm/index.d.css +984 -1039
- 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 +9 -7
- package/rollup.config.js +13 -2
- package/src/assets/fonts/iconfont.ttf +0 -0
- package/src/assets/fonts/iconfont.woff +0 -0
- package/src/assets/fonts/iconfont.woff2 +0 -0
- package/src/components/ConversationCreate/ConversationCreatGroupDetail.tsx +4 -4
- package/src/components/ConversationCreate/ConversationCreate.tsx +2 -2
- package/src/components/ConversationCreate/ConversationCreateUserSelectList.tsx +3 -2
- package/src/components/ConversationCreate/styles/ConversationCreatGroupDetail.scss +16 -7
- package/src/components/ConversationCreate/styles/index.scss +23 -13
- package/src/components/ConversationPreview/ConversationPreview.tsx +21 -21
- package/src/components/ConversationPreview/ConversationPreviewContent.tsx +4 -4
- package/src/components/ConversationPreview/styles/index.scss +44 -14
- package/src/components/ConversationPreview/utils.tsx +36 -28
- package/src/components/Input/styles/index.scss +7 -5
- package/src/components/Model/styles/layout.scss +3 -3
- package/src/components/Plugins/styles/color.scss +17 -3
- package/src/components/Popup/styles/layout.scss +2 -1
- package/src/components/TUIChat/TUIChat.tsx +4 -3
- package/src/components/TUIChatHeader/TUIChatHeaderDefault.tsx +3 -3
- package/src/components/TUIChatHeader/styles/layout.scss +13 -2
- 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/TUIConversationList/index.scss +25 -7
- package/src/components/TUIManage/TUIManage.tsx +3 -3
- package/src/components/TUIManage/styles/index.scss +16 -6
- 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/TUIMessage/styles/color.scss +20 -9
- package/src/components/TUIMessage/styles/layout.scss +44 -11
- 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 +25 -6
- package/src/components/TUIMessageInput/styles/layout.scss +58 -16
- package/src/components/TUIMessageList/hooks/useMessageListElement.tsx +2 -2
- package/src/components/TUIMessageList/styles/layout.scss +16 -2
- package/src/components/TUIProfile/TUIProfile.tsx +3 -3
- package/src/components/TUIProfile/TUIProfileDefault.tsx +2 -2
- package/src/components/TUIProfile/styles/layout.scss +33 -16
- 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-dark.scss +35 -0
- package/src/styles/colors/_color-light.scss +35 -0
- package/src/styles/colors/_color-theme.scss +54 -0
- package/src/styles/fonts/icon-font.scss +18 -0
- package/src/styles/index.scss +4 -0
- package/src/styles/normalize.scss +355 -0
- 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 -228
- 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 -112
- package/src/components/TUIKit/styles/reset.scss +0 -67
- package/src/context/TUIKitContext.tsx +0 -39
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
@use "../../../styles/colors/color-theme" as *;
|
|
2
|
+
|
|
2
3
|
.conversation-list-container {
|
|
3
4
|
overflow-x: hidden;
|
|
4
5
|
height: 100%;
|
|
@@ -7,7 +8,6 @@ $font-color: #7A7A7A;
|
|
|
7
8
|
.conversation-preview-container {
|
|
8
9
|
display: flex;
|
|
9
10
|
align-items: center;
|
|
10
|
-
background-color: #FFFFFF;
|
|
11
11
|
border: none;
|
|
12
12
|
width: 100%;
|
|
13
13
|
height: 64px;
|
|
@@ -15,6 +15,10 @@ $font-color: #7A7A7A;
|
|
|
15
15
|
line-height: 17px;
|
|
16
16
|
padding: 0 20px;
|
|
17
17
|
|
|
18
|
+
@include theme() {
|
|
19
|
+
background-color: get(bg-primary);
|
|
20
|
+
}
|
|
21
|
+
|
|
18
22
|
.content {
|
|
19
23
|
flex: 1 1 auto;
|
|
20
24
|
text-align: left;
|
|
@@ -29,20 +33,26 @@ $font-color: #7A7A7A;
|
|
|
29
33
|
font-family: PingFangSC-Medium;
|
|
30
34
|
padding: 1px 0;
|
|
31
35
|
width: 100%;
|
|
32
|
-
|
|
36
|
+
|
|
37
|
+
@include theme() {
|
|
38
|
+
color: get(text-primary);
|
|
39
|
+
}
|
|
33
40
|
}
|
|
34
41
|
|
|
35
42
|
.message {
|
|
36
43
|
overflow: hidden;
|
|
37
44
|
text-overflow: ellipsis;
|
|
38
45
|
white-space: nowrap;
|
|
39
|
-
color: $font-color;
|
|
40
46
|
font-family: PingFangSC-Medium;
|
|
41
47
|
font-style: normal;
|
|
42
48
|
font-weight: 400;
|
|
43
49
|
font-size: 12px;
|
|
44
50
|
line-height: 14px;
|
|
45
51
|
padding: 1px 0;
|
|
52
|
+
|
|
53
|
+
@include theme() {
|
|
54
|
+
color: get(text-secondary);
|
|
55
|
+
}
|
|
46
56
|
}
|
|
47
57
|
}
|
|
48
58
|
|
|
@@ -58,13 +68,16 @@ $font-color: #7A7A7A;
|
|
|
58
68
|
}
|
|
59
69
|
|
|
60
70
|
.time {
|
|
61
|
-
color: $font-color;
|
|
62
71
|
font-family: PingFangSC-Medium;
|
|
63
72
|
font-style: normal;
|
|
64
73
|
font-weight: 400;
|
|
65
74
|
font-size: 12px;
|
|
66
75
|
line-height: 14px;
|
|
67
76
|
padding: 1px 0;
|
|
77
|
+
|
|
78
|
+
@include theme() {
|
|
79
|
+
color: get(text-secondary);
|
|
80
|
+
}
|
|
68
81
|
}
|
|
69
82
|
|
|
70
83
|
.more--hover {
|
|
@@ -96,10 +109,16 @@ $font-color: #7A7A7A;
|
|
|
96
109
|
font-weight: 500;
|
|
97
110
|
box-sizing: border-box;
|
|
98
111
|
|
|
112
|
+
&.delete {
|
|
113
|
+
@include theme() {
|
|
114
|
+
color: get(status-danger);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
99
118
|
&:hover {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
119
|
+
@include theme() {
|
|
120
|
+
background-color: get(bg-active);
|
|
121
|
+
}
|
|
103
122
|
}
|
|
104
123
|
}
|
|
105
124
|
}
|
|
@@ -107,18 +126,26 @@ $font-color: #7A7A7A;
|
|
|
107
126
|
}
|
|
108
127
|
|
|
109
128
|
&:hover {
|
|
110
|
-
|
|
129
|
+
@include theme() {
|
|
130
|
+
background-color: get(bg-active);
|
|
131
|
+
}
|
|
111
132
|
}
|
|
112
133
|
|
|
113
134
|
&.conversation-preview-content--pin {
|
|
114
|
-
|
|
135
|
+
@include theme() {
|
|
136
|
+
background-color: get(bg-secondary);
|
|
137
|
+
}
|
|
115
138
|
}
|
|
116
139
|
|
|
117
140
|
&.conversation-preview-content--active {
|
|
118
|
-
|
|
141
|
+
@include theme() {
|
|
142
|
+
background-color: get(bg-active);
|
|
143
|
+
}
|
|
119
144
|
|
|
120
145
|
.title {
|
|
121
|
-
|
|
146
|
+
@include theme() {
|
|
147
|
+
color: get(status-info);
|
|
148
|
+
}
|
|
122
149
|
}
|
|
123
150
|
}
|
|
124
151
|
|
|
@@ -126,16 +153,19 @@ $font-color: #7A7A7A;
|
|
|
126
153
|
.unread {
|
|
127
154
|
width: 16px;
|
|
128
155
|
height: 13px;
|
|
129
|
-
background: #FF3742;
|
|
130
156
|
border-radius: 16px;
|
|
131
157
|
display: flex;
|
|
132
158
|
justify-content: center;
|
|
133
159
|
align-items: center;
|
|
134
160
|
padding: 2px 5px 1px;
|
|
135
|
-
color: #FFFFFF;
|
|
136
161
|
font-size: 11px;
|
|
137
162
|
font-weight: 700;
|
|
138
163
|
margin: 2px 0 2px auto;
|
|
164
|
+
color: #fff;
|
|
165
|
+
|
|
166
|
+
@include theme() {
|
|
167
|
+
background-color: get(status-danger);
|
|
168
|
+
}
|
|
139
169
|
}
|
|
140
170
|
}
|
|
141
171
|
}
|
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
2
|
import TencentCloudChat, { Conversation, Group, Profile } from '@tencentcloud/chat';
|
|
4
3
|
import { defaultGroupAvatarWork, defaultUserAvatar } from '../Avatar';
|
|
5
4
|
import { formatEmojiString } from '../TUIMessage/utils/emojiMap';
|
|
6
5
|
import { getTimeStamp } from '../untils';
|
|
7
6
|
|
|
7
|
+
interface TProfile extends Profile, Group {}
|
|
8
|
+
export const getMessageProfile = (conversation: Conversation): TProfile => {
|
|
9
|
+
// eslint-disable-next-line
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
if (!conversation) return null;
|
|
12
|
+
let result = {};
|
|
13
|
+
const { type, groupProfile, userProfile } = conversation;
|
|
14
|
+
switch (type) {
|
|
15
|
+
case TencentCloudChat.TYPES.CONV_C2C:
|
|
16
|
+
result = userProfile;
|
|
17
|
+
break;
|
|
18
|
+
case TencentCloudChat.TYPES.CONV_GROUP:
|
|
19
|
+
result = groupProfile;
|
|
20
|
+
break;
|
|
21
|
+
case TencentCloudChat.TYPES.CONV_SYSTEM:
|
|
22
|
+
default:
|
|
23
|
+
}
|
|
24
|
+
return result as TProfile;
|
|
25
|
+
};
|
|
26
|
+
|
|
8
27
|
export const getDisplayTitle = (
|
|
9
28
|
conversation: Conversation,
|
|
10
29
|
searchValue?: string,
|
|
@@ -25,15 +44,22 @@ export const getDisplayTitle = (
|
|
|
25
44
|
default:
|
|
26
45
|
title = '';
|
|
27
46
|
}
|
|
28
|
-
const handleTitle = (str:string) => {
|
|
47
|
+
const handleTitle = (str: string) => {
|
|
29
48
|
const tempStr = str.toLocaleLowerCase();
|
|
30
49
|
const pos = searchValue && tempStr.indexOf(searchValue.toLocaleLowerCase());
|
|
31
|
-
|
|
50
|
+
const titleList = str.split(new RegExp(`(${searchValue})`, 'gi'));
|
|
51
|
+
if (pos === '') return <></>;
|
|
32
52
|
return (
|
|
33
53
|
<div>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
54
|
+
{searchValue && titleList.map((textItem: string, index: number) =>
|
|
55
|
+
(textItem.toLowerCase() === searchValue.toLowerCase())
|
|
56
|
+
? (
|
|
57
|
+
<span key={index} style={{ color: highlightColor }}>{textItem}</span>
|
|
58
|
+
) : (
|
|
59
|
+
<span key={index}>{textItem}</span>
|
|
60
|
+
),
|
|
61
|
+
)}
|
|
62
|
+
;
|
|
37
63
|
</div>
|
|
38
64
|
);
|
|
39
65
|
};
|
|
@@ -58,9 +84,9 @@ export const getDisplayImage = (conversation: Conversation) => {
|
|
|
58
84
|
return displayImage;
|
|
59
85
|
};
|
|
60
86
|
export const getDisplayMessage = (
|
|
61
|
-
conversation:Conversation,
|
|
62
|
-
myProfile:Profile,
|
|
63
|
-
language?:string,
|
|
87
|
+
conversation: Conversation,
|
|
88
|
+
myProfile: Profile,
|
|
89
|
+
language?: string,
|
|
64
90
|
) => {
|
|
65
91
|
const { lastMessage, type } = conversation;
|
|
66
92
|
const {
|
|
@@ -93,25 +119,7 @@ export const getDisplayMessage = (
|
|
|
93
119
|
</div>
|
|
94
120
|
);
|
|
95
121
|
};
|
|
96
|
-
|
|
97
|
-
export const getMessageProfile = (conversation: Conversation):TProfile => {
|
|
98
|
-
// eslint-disable-next-line
|
|
99
|
-
// @ts-ignore
|
|
100
|
-
if (!conversation) return null;
|
|
101
|
-
let result = {};
|
|
102
|
-
const { type, groupProfile, userProfile } = conversation;
|
|
103
|
-
switch (type) {
|
|
104
|
-
case TencentCloudChat.TYPES.CONV_C2C:
|
|
105
|
-
result = userProfile;
|
|
106
|
-
break;
|
|
107
|
-
case TencentCloudChat.TYPES.CONV_GROUP:
|
|
108
|
-
result = groupProfile;
|
|
109
|
-
break;
|
|
110
|
-
case TencentCloudChat.TYPES.CONV_SYSTEM:
|
|
111
|
-
default:
|
|
112
|
-
}
|
|
113
|
-
return result as TProfile;
|
|
114
|
-
};
|
|
122
|
+
|
|
115
123
|
export const getDisplayTime = (conversation: Conversation, language: string) => {
|
|
116
124
|
const { lastMessage } = conversation;
|
|
117
125
|
return getTimeStamp(lastMessage.lastTime * 1000, language);
|
|
@@ -3,20 +3,22 @@
|
|
|
3
3
|
display: flex;
|
|
4
4
|
align-items: center;
|
|
5
5
|
border-radius: 10px;
|
|
6
|
-
background:
|
|
6
|
+
background: rgba(249, 249, 249, 94%);
|
|
7
7
|
padding: 0 8px;
|
|
8
8
|
height: 36px;
|
|
9
9
|
box-sizing: border-box;
|
|
10
10
|
|
|
11
11
|
&.tui-kit-input-box--focus {
|
|
12
|
-
outline: 1px solid #
|
|
12
|
+
outline: 1px solid #147aff;
|
|
13
13
|
}
|
|
14
|
+
|
|
14
15
|
&.tui-kit-input-border--bottom {
|
|
15
|
-
border-bottom: 1px solid rgba(0, 0, 0,
|
|
16
|
+
border-bottom: 1px solid rgba(0, 0, 0, 10%);
|
|
16
17
|
background-color: #fff;
|
|
17
18
|
outline: none;
|
|
18
19
|
border-radius: 0;
|
|
19
20
|
}
|
|
21
|
+
|
|
20
22
|
.tui-kit-input {
|
|
21
23
|
margin-left: 6px;
|
|
22
24
|
margin-right: auto;
|
|
@@ -28,6 +30,7 @@
|
|
|
28
30
|
border-radius: 10px;
|
|
29
31
|
border: none;
|
|
30
32
|
box-sizing: border-box;
|
|
33
|
+
font-size: 14px;
|
|
31
34
|
|
|
32
35
|
&:focus {
|
|
33
36
|
border: none;
|
|
@@ -36,9 +39,8 @@
|
|
|
36
39
|
|
|
37
40
|
&::placeholder {
|
|
38
41
|
font-weight: 400;
|
|
39
|
-
color: rgba(67, 60, 63,
|
|
42
|
+
color: rgba(67, 60, 63, 60%);
|
|
40
43
|
padding: 2px 0;
|
|
41
44
|
}
|
|
42
45
|
}
|
|
43
|
-
|
|
44
46
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.model {
|
|
2
|
-
background: rgba(#
|
|
2
|
+
background: rgba(#000, 0.5);
|
|
3
3
|
position: fixed;
|
|
4
|
-
z-index:
|
|
4
|
+
z-index: 5;
|
|
5
5
|
width: 100vw;
|
|
6
6
|
top: 0;
|
|
7
7
|
left: 0;
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
display: flex;
|
|
10
10
|
justify-content: center;
|
|
11
11
|
align-items: center;
|
|
12
|
-
}
|
|
12
|
+
}
|
|
@@ -1,7 +1,21 @@
|
|
|
1
|
+
@use "../../../styles/colors/color-theme" as *;
|
|
2
|
+
|
|
1
3
|
.plugin-popup {
|
|
2
4
|
&-box {
|
|
3
|
-
background: #FFFFFF;
|
|
4
|
-
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
|
|
5
5
|
border-radius: 16px;
|
|
6
|
+
|
|
7
|
+
@include theme() {
|
|
8
|
+
color: get(text-primary);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
[data-uikit-theme="light"] & {
|
|
12
|
+
background-color: var(--chat-theme-light-bg-primary);
|
|
13
|
+
box-shadow: var(--chat-theme-light-box-shadow-1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
[data-uikit-theme="dark"] & {
|
|
17
|
+
background-color: var(--chat-theme-dark-bg-3);
|
|
18
|
+
box-shadow: var(--chat-theme-dark-box-shadow-1);
|
|
19
|
+
}
|
|
6
20
|
}
|
|
7
|
-
}
|
|
21
|
+
}
|
|
@@ -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
|
};
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
@use "../../../styles/colors/color-theme" as *;
|
|
2
|
+
|
|
1
3
|
.tui-chat-header {
|
|
2
4
|
padding: 16px 20px;
|
|
3
5
|
display: flex;
|
|
4
6
|
flex-direction: row;
|
|
5
7
|
justify-content: space-between;
|
|
6
8
|
align-items: center;
|
|
9
|
+
|
|
10
|
+
@include theme() {
|
|
11
|
+
background-color: get(bg-primary);
|
|
12
|
+
}
|
|
13
|
+
|
|
7
14
|
&-left {
|
|
8
15
|
display: flex;
|
|
9
16
|
align-items: center;
|
|
@@ -24,7 +31,11 @@
|
|
|
24
31
|
font-style: normal;
|
|
25
32
|
font-weight: 700;
|
|
26
33
|
font-size: 14px;
|
|
27
|
-
|
|
34
|
+
|
|
35
|
+
@include theme() {
|
|
36
|
+
color: get(text-primary);
|
|
37
|
+
}
|
|
38
|
+
|
|
28
39
|
}
|
|
29
40
|
.system {
|
|
30
41
|
height: 32px;
|
|
@@ -33,4 +44,4 @@
|
|
|
33
44
|
|
|
34
45
|
.tui-chat-live-header {
|
|
35
46
|
|
|
36
|
-
}
|
|
47
|
+
}
|
|
@@ -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],
|