@tencentcloud/chat-uikit-react 2.2.5 → 2.2.7
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 +18 -0
- package/dist/cjs/assets/fonts/iconfont.ttf +0 -0
- package/dist/cjs/assets/fonts/iconfont.woff +0 -0
- package/dist/cjs/assets/fonts/iconfont.woff2 +0 -0
- package/dist/cjs/components/Avatar/Avatar.d.ts +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/Icon/config.js +1 -1
- package/dist/cjs/components/Icon/images/video-call.svg.js +1 -0
- package/dist/cjs/components/Icon/images/voice-call.svg.js +1 -0
- package/dist/cjs/components/Icon/type.d.ts +3 -1
- package/dist/cjs/components/Icon/type.js +1 -1
- 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 +15 -14
- package/dist/cjs/components/TUIChat/TUIChat.js +1 -1
- package/dist/cjs/components/TUIChat/TUIChatState.js +1 -1
- package/dist/cjs/components/TUIChat/index.js +1 -0
- package/dist/cjs/components/TUIChat/server.js +1 -0
- package/dist/cjs/components/TUIChat/utils.js +1 -0
- package/dist/cjs/components/TUIChatHeader/TUIChatHeader.d.ts +6 -5
- package/dist/cjs/components/TUIChatHeader/TUIChatHeader.js +1 -1
- package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.d.ts +6 -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/TUIMessage/utils/index.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/components/{untils.js → utils.js} +1 -1
- package/dist/cjs/context/ComponentContext.d.ts +12 -12
- package/dist/cjs/context/LanguageContext.js +1 -0
- package/dist/cjs/context/TUIChatActionContext.d.ts +5 -4
- 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 +1345 -1547
- package/dist/cjs/index.d.ts +2 -4
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/locales/en-US/index.js +1 -1
- package/dist/cjs/locales/index.js +1 -1
- package/dist/cjs/locales/zh-CN/index.js +1 -1
- package/dist/cjs/locales/zh-TW/TUIChat.js +1 -0
- package/dist/cjs/locales/zh-TW/TUIContact.js +1 -0
- package/dist/cjs/locales/zh-TW/TUIConversation.js +1 -0
- package/dist/cjs/locales/zh-TW/TUIProfile.js +1 -0
- package/dist/cjs/locales/zh-TW/index.js +1 -0
- package/dist/esm/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/Icon/config.js +1 -1
- package/dist/esm/components/Icon/images/video-call.svg.js +1 -0
- package/dist/esm/components/Icon/images/voice-call.svg.js +1 -0
- package/dist/esm/components/Icon/type.d.ts +3 -1
- package/dist/esm/components/Icon/type.js +1 -1
- 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 +15 -14
- package/dist/esm/components/TUIChat/TUIChat.js +1 -1
- package/dist/esm/components/TUIChat/TUIChatState.js +1 -1
- package/dist/esm/components/TUIChat/index.js +1 -0
- package/dist/esm/components/TUIChat/server.js +1 -0
- package/dist/esm/components/TUIChat/utils.js +1 -0
- package/dist/esm/components/TUIChatHeader/TUIChatHeader.d.ts +6 -5
- package/dist/esm/components/TUIChatHeader/TUIChatHeader.js +1 -1
- package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.d.ts +6 -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/TUIMessage/utils/index.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/components/utils.js +1 -0
- package/dist/esm/context/ComponentContext.d.ts +12 -12
- package/dist/esm/context/LanguageContext.js +1 -0
- package/dist/esm/context/TUIChatActionContext.d.ts +5 -4
- 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 +1345 -1547
- package/dist/esm/index.d.ts +2 -4
- package/dist/esm/index.js +1 -1
- package/dist/esm/locales/en-US/index.js +1 -1
- package/dist/esm/locales/index.js +1 -1
- package/dist/esm/locales/zh-CN/index.js +1 -1
- package/dist/esm/locales/zh-TW/TUIChat.js +1 -0
- package/dist/esm/locales/zh-TW/TUIContact.js +1 -0
- package/dist/esm/locales/zh-TW/TUIConversation.js +1 -0
- package/dist/esm/locales/zh-TW/TUIProfile.js +1 -0
- package/dist/esm/locales/zh-TW/index.js +1 -0
- package/package.json +5 -3
- package/rollup.config.js +1 -1
- package/src/assets/fonts/iconfont.ttf +0 -0
- package/src/assets/fonts/iconfont.woff +0 -0
- package/src/assets/fonts/iconfont.woff2 +0 -0
- package/src/components/Avatar/styles/index.scss +11 -4
- package/src/components/Checkbox/styles/color.scss +17 -6
- 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/hooks/useConversationCreate.tsx +5 -5
- package/src/components/ConversationCreate/styles/ConversationCreatGroupDetail.scss +7 -16
- package/src/components/ConversationCreate/styles/conversationCreateSelectView.scss +13 -8
- package/src/components/ConversationCreate/styles/conversationGroupTypeInfo.scss +20 -21
- package/src/components/ConversationCreate/styles/index.scss +30 -17
- package/src/components/ConversationPreview/ConversationPreview.tsx +21 -21
- package/src/components/ConversationPreview/ConversationPreviewContent.tsx +4 -2
- package/src/components/ConversationPreview/styles/index.scss +20 -20
- package/src/components/ConversationPreview/utils.tsx +3 -2
- package/src/components/DivWithEdit/styles/index.scss +30 -10
- package/src/components/Icon/config.ts +14 -4
- package/src/components/Icon/images/video-call.svg +3 -0
- package/src/components/Icon/images/voice-call.svg +3 -0
- package/src/components/Icon/type.ts +2 -0
- package/src/components/Input/styles/index.scss +22 -6
- package/src/components/Plugins/styles/color.scss +3 -11
- package/src/components/Profile/styles/index.scss +12 -3
- package/src/components/TUIChat/TUIChat.tsx +40 -35
- package/src/components/TUIChat/TUIChatState.tsx +41 -41
- package/src/components/TUIChat/index.ts +3 -0
- package/src/components/TUIChat/server.ts +44 -0
- package/src/components/TUIChat/styles/layout.scss +7 -2
- package/src/components/TUIChat/utils.ts +72 -0
- package/src/components/TUIChatHeader/TUIChatHeader.tsx +10 -7
- package/src/components/TUIChatHeader/TUIChatHeaderDefault.tsx +74 -31
- package/src/components/TUIChatHeader/styles/layout.scss +16 -9
- 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/TUIContactInfo/index.scss +44 -21
- package/src/components/TUIContact/TUIContactList/TUIContactList.tsx +80 -76
- package/src/components/TUIContact/TUIContactList/index.scss +40 -20
- package/src/components/TUIContact/hooks/useTUIContact.tsx +5 -5
- package/src/components/TUIContact/index.scss +30 -11
- package/src/components/TUIContactSearch/TUIContactSearch.tsx +2 -2
- package/src/components/TUIContactSearch/hooks/useContactSearch.tsx +2 -2
- package/src/components/TUIContactSearch/index.scss +12 -3
- package/src/components/TUIConversationList/TUIConversationList.tsx +3 -4
- package/src/components/TUIConversationList/hooks/useConversationUpdate.tsx +2 -2
- package/src/components/TUIConversationList/index.scss +3 -4
- package/src/components/TUIManage/TUIManage.tsx +3 -3
- package/src/components/TUIManage/styles/index.scss +20 -14
- package/src/components/TUIMessage/MessageAvatar.tsx +7 -7
- package/src/components/TUIMessage/MessageBubble.tsx +22 -21
- package/src/components/TUIMessage/MessageCustom.tsx +26 -5
- package/src/components/TUIMessage/MessageStatus.tsx +7 -7
- package/src/components/TUIMessage/MessageText.tsx +16 -15
- package/src/components/TUIMessage/hooks/useMessageHandler.ts +8 -8
- package/src/components/TUIMessage/hooks/useMessageReply.ts +8 -7
- package/src/components/TUIMessage/styles/color.scss +6 -5
- package/src/components/TUIMessage/styles/layout.scss +111 -42
- package/src/components/TUIMessage/utils/index.ts +23 -12
- package/src/components/TUIMessageInput/InputPluginsDefalut.tsx +12 -12
- package/src/components/TUIMessageInput/TUIMessageInput.tsx +1 -1
- package/src/components/TUIMessageInput/hooks/useHandleForwardMessage.tsx +7 -6
- package/src/components/TUIMessageInput/hooks/useMessageInputText.tsx +14 -14
- package/src/components/TUIMessageInput/hooks/useUploadPicker.tsx +4 -4
- package/src/components/TUIMessageInput/styles/color.scss +15 -11
- package/src/components/TUIMessageInput/styles/layout.scss +33 -17
- package/src/components/TUIMessageList/hooks/useMessageListElement.tsx +15 -11
- package/src/components/TUIMessageList/styles/layout.scss +16 -9
- package/src/components/TUIProfile/TUIProfile.tsx +3 -3
- package/src/components/TUIProfile/TUIProfileDefault.tsx +14 -13
- package/src/components/TUIProfile/styles/color.scss +6 -5
- package/src/components/TUIProfile/styles/layout.scss +16 -14
- package/src/components/index.ts +0 -1
- package/src/components/{untils.ts → utils.ts} +5 -4
- package/src/context/LanguageContext.tsx +60 -0
- package/src/context/TUIChatActionContext.tsx +14 -13
- package/src/context/ThemeContext.tsx +68 -0
- package/src/context/UIKitContext.tsx +76 -0
- package/src/context/UIManagerContext.tsx +163 -0
- package/src/context/index.ts +3 -2
- package/src/locales/en-US/index.ts +0 -3
- package/src/locales/index.ts +6 -2
- package/src/locales/zh-CN/index.ts +0 -2
- package/src/locales/zh-TW/TUIChat.ts +27 -0
- package/src/locales/zh-TW/TUIContact.ts +29 -0
- package/src/locales/zh-TW/TUIConversation.ts +32 -0
- package/src/locales/zh-TW/TUIProfile.ts +15 -0
- package/src/locales/zh-TW/index.ts +11 -0
- package/src/styles/colors/_color-dark.scss +31 -21
- package/src/styles/colors/_color-light.scss +31 -21
- package/src/styles/colors/_color-theme.scss +33 -22
- package/src/styles/normalize.scss +6 -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/Icon/images/down-arrow.png.js +0 -1
- package/dist/cjs/components/Icon/images/right-arrow.svg.js +0 -1
- package/dist/cjs/components/TUIChat/unitls.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/Icon/images/down-arrow.png.js +0 -1
- package/dist/esm/components/Icon/images/right-arrow.svg.js +0 -1
- package/dist/esm/components/TUIChat/unitls.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/components/untils.js +0 -1
- package/dist/esm/context/TUIKitContext.d.ts +0 -25
- package/dist/esm/context/TUIKitContext.js +0 -1
- package/scripts/publish-github.js +0 -60
- package/scripts/publish-intl-demo.js +0 -14
- package/scripts/publish-intl-experience-demo.js +0 -14
- package/src/components/TUIChat/unitls.ts +0 -39
- 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/src/locales/en-US/TUIGlobal.ts +0 -6
- package/src/locales/ja-JP/TUIGlobal.ts +0 -6
- package/src/locales/ko-KR/TUIGlobal.ts +0 -6
- package/src/locales/zh-CN/TUIGlobal.ts +0 -6
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const { execSync } = require('child_process');
|
|
4
|
-
|
|
5
|
-
// Change directory to tuikit/examples/sample-chat
|
|
6
|
-
process.chdir(path.join('examples', 'sample-chat'));
|
|
7
|
-
|
|
8
|
-
// Remove .env file
|
|
9
|
-
fs.unlinkSync('.env');
|
|
10
|
-
|
|
11
|
-
// Remove package.json
|
|
12
|
-
fs.unlinkSync('package.json');
|
|
13
|
-
|
|
14
|
-
// Rename package-github.json to package.json
|
|
15
|
-
fs.renameSync('package-github.json', 'package.json');
|
|
16
|
-
|
|
17
|
-
// Change directory to src
|
|
18
|
-
process.chdir('src');
|
|
19
|
-
|
|
20
|
-
// Remove demo directory
|
|
21
|
-
fs.rmdirSync('demo', { recursive: true });
|
|
22
|
-
|
|
23
|
-
// Rename 'components' directory to 'demo'
|
|
24
|
-
fs.renameSync('components', 'demo');
|
|
25
|
-
|
|
26
|
-
// Remove social-demo to demo
|
|
27
|
-
fs.rmdirSync('social-demo', { recursive: true });
|
|
28
|
-
|
|
29
|
-
// Change directory to live-demo
|
|
30
|
-
process.chdir('live-demo');
|
|
31
|
-
|
|
32
|
-
// Remove live-demo.tsx file
|
|
33
|
-
fs.unlinkSync('live-demo.tsx');
|
|
34
|
-
|
|
35
|
-
// Change directory back to src
|
|
36
|
-
process.chdir('../');
|
|
37
|
-
|
|
38
|
-
// Copy live-demo directory to ../../live-chat/src
|
|
39
|
-
execSync('cp -r live-demo ../../live-chat/src');
|
|
40
|
-
|
|
41
|
-
// Remove live-demo directory
|
|
42
|
-
fs.rmdirSync('live-demo', { recursive: true });
|
|
43
|
-
|
|
44
|
-
// Remove bot-demo directory
|
|
45
|
-
fs.rmdirSync('bot-demo', { recursive: true });
|
|
46
|
-
|
|
47
|
-
// Change directory to debug
|
|
48
|
-
process.chdir('debug');
|
|
49
|
-
|
|
50
|
-
// Replace 20000737 with 0 in GenerateTestUserSig.js
|
|
51
|
-
fs.writeFileSync('GenerateTestUserSig.js', fs.readFileSync('GenerateTestUserSig.js', 'utf8').replace(/20000737/g, '0'));
|
|
52
|
-
|
|
53
|
-
// Change directory back to src
|
|
54
|
-
process.chdir('../');
|
|
55
|
-
|
|
56
|
-
// Change directory to ../../live-chat/src/debug
|
|
57
|
-
process.chdir(path.join('../', '../', 'live-chat', 'src', 'debug'));
|
|
58
|
-
|
|
59
|
-
// Replace 20000737 with 0 in GenerateTestUserSig.js
|
|
60
|
-
fs.writeFileSync('GenerateTestUserSig.js', fs.readFileSync('GenerateTestUserSig.js', 'utf8').replace(/20000737/g, '0'));
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const { execSync } = require('child_process');
|
|
4
|
-
|
|
5
|
-
// Change directory to tuikit/examples/sample-chat
|
|
6
|
-
process.chdir(path.join('examples', 'sample-chat'));
|
|
7
|
-
|
|
8
|
-
// Change directory to src
|
|
9
|
-
process.chdir('src');
|
|
10
|
-
process.chdir('social-demo');
|
|
11
|
-
// Remove file
|
|
12
|
-
fs.unlinkSync('index.tsx');
|
|
13
|
-
// Rename index-intl.tsx to index
|
|
14
|
-
fs.renameSync('index-intl.tsx', 'index.tsx');
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const { execSync } = require('child_process');
|
|
4
|
-
|
|
5
|
-
// Change directory to tuikit/examples/sample-chat
|
|
6
|
-
process.chdir(path.join('examples', 'sample-chat'));
|
|
7
|
-
|
|
8
|
-
// Change directory to src
|
|
9
|
-
process.chdir('src');
|
|
10
|
-
process.chdir('demo');
|
|
11
|
-
// Remove file
|
|
12
|
-
fs.unlinkSync('SampleChat.tsx');
|
|
13
|
-
// Rename index-intl.tsx to index
|
|
14
|
-
fs.renameSync('SampleChat-experience.tsx', 'SampleChat.tsx');
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import TencentCloudChat, { Message } from '@tencentcloud/chat';
|
|
2
|
-
import constant from '../../constants';
|
|
3
|
-
import { JSONStringToParse } from '../untils';
|
|
4
|
-
|
|
5
|
-
export const handleMessage = (messageList:Array<Message>):Array<Message> => {
|
|
6
|
-
let customPayloadData: any = null;
|
|
7
|
-
return messageList.filter((item) => {
|
|
8
|
-
if (item.type === TencentCloudChat.TYPES.MSG_CUSTOM) {
|
|
9
|
-
customPayloadData = JSONStringToParse(item?.payload?.data);
|
|
10
|
-
}
|
|
11
|
-
if (customPayloadData && customPayloadData?.businessID === constant.TYPE_TYPING) {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
return true;
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const handleEditMessage = (
|
|
19
|
-
messageList: Array<Message>,
|
|
20
|
-
message: Message,
|
|
21
|
-
) => {
|
|
22
|
-
const list = [...messageList];
|
|
23
|
-
const index = list.findIndex((item) => item?.ID === message?.ID);
|
|
24
|
-
list[index] = message;
|
|
25
|
-
return list;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const handleUploadPendingMessage = (
|
|
29
|
-
messageList: Array<Message>,
|
|
30
|
-
message: Message,
|
|
31
|
-
) => {
|
|
32
|
-
const list = [...messageList];
|
|
33
|
-
if (!list.some((item:Message) => item.ID === message?.ID)) {
|
|
34
|
-
list.push(message);
|
|
35
|
-
}
|
|
36
|
-
const index = list.findIndex((item) => item?.ID === message?.ID);
|
|
37
|
-
list[index] = message;
|
|
38
|
-
return list;
|
|
39
|
-
};
|
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren, useState, useEffect } from 'react';
|
|
2
|
-
import { ChatSDK, Conversation } from '@tencentcloud/chat';
|
|
3
|
-
import { TUIStore, StoreName, IConversationModel, TUIConversationService } from '@tencentcloud/chat-uikit-engine';
|
|
4
|
-
import { TUILogin } from '@tencentcloud/tui-core';
|
|
5
|
-
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import { isH5, isPC } from '../../utils/env';
|
|
7
|
-
import { useTUIKit, UseContactParams } from './hooks/useTUIKit';
|
|
8
|
-
import { useCreateTUIKitContext } from './hooks/useCreateTUIKitContext';
|
|
9
|
-
import { TUIKitProvider } from '../../context/TUIKitContext';
|
|
10
|
-
import { TUIConversation } from '../TUIConversation';
|
|
11
|
-
import { TUIChat } from '../TUIChat';
|
|
12
|
-
import { TUIManage } from '../TUIManage';
|
|
13
|
-
import { TUIProfile } from '../TUIProfile';
|
|
14
|
-
import { TUIContact } from '../TUIContact';
|
|
15
|
-
import { TUIContactInfo } from '../TUIContact/TUIContactInfo/TUIContactInfo';
|
|
16
|
-
import { TUIKIT_TABBAR } from '../../constants';
|
|
17
|
-
import '../../locales/index';
|
|
18
|
-
import chats from '../Icon/images/chats.svg';
|
|
19
|
-
import chatsSelected from '../Icon/images/chats-selected.svg';
|
|
20
|
-
import contacts from '../Icon/images/contacts.svg';
|
|
21
|
-
import contactsSelected from '../Icon/images/contacts-selected.svg';
|
|
22
|
-
import './styles/index.scss';
|
|
23
|
-
import './styles/h5.scss';
|
|
24
|
-
import '../../styles/index.scss';
|
|
25
|
-
|
|
26
|
-
export interface ChatProps {
|
|
27
|
-
chat?: any,
|
|
28
|
-
language?: string,
|
|
29
|
-
customClasses?: unknown,
|
|
30
|
-
activeConversation?: Conversation,
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
interface RenderPCProps {
|
|
34
|
-
moduleValue: string,
|
|
35
|
-
tabbarRender: any,
|
|
36
|
-
setModuleValue: (value: string) => void
|
|
37
|
-
}
|
|
38
|
-
interface RenderH5Props {
|
|
39
|
-
moduleValue: string,
|
|
40
|
-
currentConversationID: string,
|
|
41
|
-
tabbarRender: any,
|
|
42
|
-
contactData: UseContactParams,
|
|
43
|
-
setModuleValue: (value: string) => void
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const tabbarList = [
|
|
47
|
-
{
|
|
48
|
-
id: 1,
|
|
49
|
-
name: TUIKIT_TABBAR.CHATS,
|
|
50
|
-
icon: chats,
|
|
51
|
-
selectedIcon: chatsSelected,
|
|
52
|
-
value: TUIKIT_TABBAR.CHATS,
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
id: 2,
|
|
56
|
-
name: TUIKIT_TABBAR.CONTACTS,
|
|
57
|
-
icon: contacts,
|
|
58
|
-
selectedIcon: contactsSelected,
|
|
59
|
-
value: TUIKIT_TABBAR.CONTACTS,
|
|
60
|
-
},
|
|
61
|
-
];
|
|
62
|
-
const TUIMessageInputConfig = {
|
|
63
|
-
className: 'sample-h5-input',
|
|
64
|
-
isTransmitter: true,
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
function RenderForPC({ moduleValue, tabbarRender, setModuleValue } : RenderPCProps) {
|
|
68
|
-
return (
|
|
69
|
-
<>
|
|
70
|
-
<div className="sample-chat-left-container">
|
|
71
|
-
<TUIProfile className="sample-chat-profile" />
|
|
72
|
-
{tabbarRender}
|
|
73
|
-
{moduleValue === TUIKIT_TABBAR.CHATS && <TUIConversation />}
|
|
74
|
-
{moduleValue === TUIKIT_TABBAR.CONTACTS && <TUIContact />}
|
|
75
|
-
</div>
|
|
76
|
-
{moduleValue === TUIKIT_TABBAR.CHATS && (
|
|
77
|
-
<>
|
|
78
|
-
<TUIChat />
|
|
79
|
-
<TUIManage />
|
|
80
|
-
</>
|
|
81
|
-
)}
|
|
82
|
-
{moduleValue === TUIKIT_TABBAR.CONTACTS && (
|
|
83
|
-
<TUIContact>
|
|
84
|
-
<TUIContactInfo
|
|
85
|
-
showChats={() => {
|
|
86
|
-
setModuleValue(TUIKIT_TABBAR.CHATS);
|
|
87
|
-
}}
|
|
88
|
-
/>
|
|
89
|
-
</TUIContact>
|
|
90
|
-
)}
|
|
91
|
-
</>
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function RenderForH5({
|
|
96
|
-
moduleValue, contactData, tabbarRender, currentConversationID, setModuleValue,
|
|
97
|
-
}: RenderH5Props) {
|
|
98
|
-
return (
|
|
99
|
-
<div className='sample-chat-h5'>
|
|
100
|
-
{!currentConversationID && !contactData && (
|
|
101
|
-
<div className="sample-chat-h5-container">
|
|
102
|
-
<TUIProfile className="sample-profile" />
|
|
103
|
-
{tabbarRender}
|
|
104
|
-
{moduleValue === TUIKIT_TABBAR.CHATS && <TUIConversation />}
|
|
105
|
-
{moduleValue === TUIKIT_TABBAR.CONTACTS && <TUIContact />}
|
|
106
|
-
</div>
|
|
107
|
-
)}
|
|
108
|
-
{moduleValue === TUIKIT_TABBAR.CHATS && currentConversationID && (
|
|
109
|
-
<>
|
|
110
|
-
<TUIChat TUIMessageInputConfig={TUIMessageInputConfig} />
|
|
111
|
-
<TUIManage />
|
|
112
|
-
</>
|
|
113
|
-
)}
|
|
114
|
-
{ moduleValue === TUIKIT_TABBAR.CONTACTS && contactData && (
|
|
115
|
-
<TUIContact>
|
|
116
|
-
<TUIContactInfo
|
|
117
|
-
showChats={() => {
|
|
118
|
-
setModuleValue(TUIKIT_TABBAR.CHATS);
|
|
119
|
-
}}
|
|
120
|
-
/>
|
|
121
|
-
</TUIContact>
|
|
122
|
-
)}
|
|
123
|
-
</div>
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
export function TUIKit<
|
|
127
|
-
T extends ChatProps
|
|
128
|
-
>(
|
|
129
|
-
props:PropsWithChildren<T>,
|
|
130
|
-
):React.ReactElement {
|
|
131
|
-
const [moduleValue, setModuleValue] = useState('chats');
|
|
132
|
-
const { t } = useTranslation();
|
|
133
|
-
const {
|
|
134
|
-
children,
|
|
135
|
-
chat = TUILogin.getContext().chat,
|
|
136
|
-
customClasses,
|
|
137
|
-
activeConversation,
|
|
138
|
-
language = 'en-US',
|
|
139
|
-
} = props;
|
|
140
|
-
|
|
141
|
-
(window as any).tencent_cloud_im_csig_react_uikit_23F_xa = true;
|
|
142
|
-
const {
|
|
143
|
-
conversation,
|
|
144
|
-
contactData,
|
|
145
|
-
setActiveConversation,
|
|
146
|
-
myProfile,
|
|
147
|
-
TUIManageShow,
|
|
148
|
-
setTUIManageShow,
|
|
149
|
-
TUIProfileShow,
|
|
150
|
-
setTUIProfileShow,
|
|
151
|
-
setActiveContact,
|
|
152
|
-
} = useTUIKit({ chat, activeConversation, language });
|
|
153
|
-
const chatContextValue = useCreateTUIKitContext({
|
|
154
|
-
chat,
|
|
155
|
-
language,
|
|
156
|
-
conversation,
|
|
157
|
-
contactData,
|
|
158
|
-
setActiveConversation,
|
|
159
|
-
customClasses,
|
|
160
|
-
myProfile,
|
|
161
|
-
TUIManageShow,
|
|
162
|
-
setTUIManageShow,
|
|
163
|
-
TUIProfileShow,
|
|
164
|
-
setTUIProfileShow,
|
|
165
|
-
setActiveContact,
|
|
166
|
-
});
|
|
167
|
-
useEffect(() => {
|
|
168
|
-
TUIStore.watch(StoreName.CONV, {
|
|
169
|
-
currentConversation: onCurrentConversation,
|
|
170
|
-
});
|
|
171
|
-
return () => {
|
|
172
|
-
TUIStore.unwatch(StoreName.CONV, {
|
|
173
|
-
currentConversation: onCurrentConversation,
|
|
174
|
-
});
|
|
175
|
-
};
|
|
176
|
-
}, []);
|
|
177
|
-
|
|
178
|
-
const switchTabbar = (value: string) => {
|
|
179
|
-
setModuleValue(value);
|
|
180
|
-
TUIConversationService.switchConversation('');
|
|
181
|
-
};
|
|
182
|
-
const onCurrentConversation = (conversationModel: IConversationModel) => {
|
|
183
|
-
setActiveConversation(conversationModel?.getConversation());
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
const tabbarRender = (
|
|
187
|
-
<div className="sample-chat-tab">
|
|
188
|
-
{tabbarList.map((item: any) => (
|
|
189
|
-
<div
|
|
190
|
-
className="sample-chat-tab-container"
|
|
191
|
-
key={item.id}
|
|
192
|
-
role="presentation"
|
|
193
|
-
onClick={() => {
|
|
194
|
-
switchTabbar(item.value);
|
|
195
|
-
}}
|
|
196
|
-
>
|
|
197
|
-
<img src={moduleValue === item.value ? item.selectedIcon : item.icon} alt="" />
|
|
198
|
-
<p className={`sample-chat-tab-text ${moduleValue === item.value ? 'sample-chat-tab-active' : ''}`}>
|
|
199
|
-
{t(item.name)}
|
|
200
|
-
</p>
|
|
201
|
-
</div>
|
|
202
|
-
))}
|
|
203
|
-
</div>
|
|
204
|
-
);
|
|
205
|
-
|
|
206
|
-
return (
|
|
207
|
-
<TUIKitProvider value={chatContextValue}>
|
|
208
|
-
<div className="tui-kit">
|
|
209
|
-
{children ||
|
|
210
|
-
(isPC && (
|
|
211
|
-
<RenderForPC
|
|
212
|
-
moduleValue={moduleValue}
|
|
213
|
-
tabbarRender={tabbarRender}
|
|
214
|
-
setModuleValue={setModuleValue}
|
|
215
|
-
/>
|
|
216
|
-
)) ||
|
|
217
|
-
(isH5 && (
|
|
218
|
-
<RenderForH5
|
|
219
|
-
contactData={contactData}
|
|
220
|
-
moduleValue={moduleValue}
|
|
221
|
-
tabbarRender={tabbarRender}
|
|
222
|
-
currentConversationID={conversation?.conversationID || ''}
|
|
223
|
-
setModuleValue={setModuleValue}
|
|
224
|
-
/>
|
|
225
|
-
))}
|
|
226
|
-
</div>
|
|
227
|
-
</TUIKitProvider>
|
|
228
|
-
);
|
|
229
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
2
|
-
import { TUIKitContextValue } from '../../../context/TUIKitContext';
|
|
3
|
-
|
|
4
|
-
export const useCreateTUIKitContext = (value:TUIKitContextValue) => {
|
|
5
|
-
const {
|
|
6
|
-
chat,
|
|
7
|
-
language,
|
|
8
|
-
conversation,
|
|
9
|
-
contactData,
|
|
10
|
-
customClasses,
|
|
11
|
-
setActiveConversation,
|
|
12
|
-
myProfile,
|
|
13
|
-
TUIManageShow,
|
|
14
|
-
setTUIManageShow,
|
|
15
|
-
TUIProfileShow,
|
|
16
|
-
setTUIProfileShow,
|
|
17
|
-
setActiveContact,
|
|
18
|
-
} = value;
|
|
19
|
-
|
|
20
|
-
const TUIKitContext = useMemo(
|
|
21
|
-
() => ({
|
|
22
|
-
chat,
|
|
23
|
-
language,
|
|
24
|
-
conversation,
|
|
25
|
-
contactData,
|
|
26
|
-
customClasses,
|
|
27
|
-
setActiveConversation,
|
|
28
|
-
myProfile,
|
|
29
|
-
TUIManageShow,
|
|
30
|
-
setTUIManageShow,
|
|
31
|
-
TUIProfileShow,
|
|
32
|
-
setTUIProfileShow,
|
|
33
|
-
setActiveContact,
|
|
34
|
-
}),
|
|
35
|
-
[
|
|
36
|
-
language,
|
|
37
|
-
conversation,
|
|
38
|
-
contactData,
|
|
39
|
-
customClasses,
|
|
40
|
-
chat,
|
|
41
|
-
TUIManageShow,
|
|
42
|
-
TUIProfileShow,
|
|
43
|
-
setTUIProfileShow,
|
|
44
|
-
myProfile,
|
|
45
|
-
],
|
|
46
|
-
);
|
|
47
|
-
return TUIKitContext;
|
|
48
|
-
};
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import React, { useState, useCallback, useEffect } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
TUIStore,
|
|
4
|
-
StoreName,
|
|
5
|
-
IGroupModel
|
|
6
|
-
} from '@tencentcloud/chat-uikit-engine';
|
|
7
|
-
import { useTranslation } from 'react-i18next';
|
|
8
|
-
import {
|
|
9
|
-
ChatSDK,
|
|
10
|
-
Conversation,
|
|
11
|
-
Profile,
|
|
12
|
-
Friend,
|
|
13
|
-
FriendApplication,
|
|
14
|
-
} from '@tencentcloud/chat';
|
|
15
|
-
|
|
16
|
-
interface blockData {
|
|
17
|
-
type: 'block',
|
|
18
|
-
data: Profile
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
interface friendData {
|
|
22
|
-
type: 'friend',
|
|
23
|
-
data: Friend
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
interface friendApplicationData {
|
|
27
|
-
type: 'friendApplication',
|
|
28
|
-
data: FriendApplication
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
interface addFriendData {
|
|
32
|
-
type: 'addFriend',
|
|
33
|
-
data: Profile
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
interface GroupData {
|
|
37
|
-
type: 'group',
|
|
38
|
-
data: IGroupModel
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export type UseContactParams = blockData | friendData |
|
|
42
|
-
friendApplicationData | addFriendData| GroupData | undefined;
|
|
43
|
-
|
|
44
|
-
export interface UseChatParams{
|
|
45
|
-
chat: ChatSDK,
|
|
46
|
-
activeConversation?: Conversation,
|
|
47
|
-
language?: string,
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export const useTUIKit = ({
|
|
51
|
-
chat, activeConversation: paramsActiveConversation,
|
|
52
|
-
language,
|
|
53
|
-
}:UseChatParams) => {
|
|
54
|
-
const { i18n } = useTranslation();
|
|
55
|
-
const [conversation, setConversation] = useState<Conversation | undefined>(paramsActiveConversation);
|
|
56
|
-
const [myProfile, setMyProfile] = useState<Profile>();
|
|
57
|
-
const [TUIManageShow, setTUIManageShow] = useState<boolean>(false);
|
|
58
|
-
const [TUIProfileShow, setTUIProfileShow] = useState<boolean>(false);
|
|
59
|
-
const [contactData, setContactData] = useState<UseContactParams>();
|
|
60
|
-
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
i18n.changeLanguage(language);
|
|
63
|
-
TUIStore.watch(StoreName.USER, {
|
|
64
|
-
userProfile: (userProfileData: any) => {
|
|
65
|
-
setMyProfile(userProfileData);
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
}, [language]);
|
|
69
|
-
const setActiveConversation = useCallback(
|
|
70
|
-
(activeConversation?: Conversation) => {
|
|
71
|
-
if (activeConversation) {
|
|
72
|
-
chat?.setMessageRead({ conversationID: activeConversation.conversationID });
|
|
73
|
-
}
|
|
74
|
-
if (conversation && (activeConversation?.conversationID !== conversation.conversationID)) {
|
|
75
|
-
setTUIManageShow(false);
|
|
76
|
-
}
|
|
77
|
-
setConversation(activeConversation);
|
|
78
|
-
},
|
|
79
|
-
[chat],
|
|
80
|
-
);
|
|
81
|
-
const setActiveContact = (actionContactData?: UseContactParams) => {
|
|
82
|
-
setContactData(actionContactData);
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
useEffect(() => {
|
|
86
|
-
paramsActiveConversation && setConversation(paramsActiveConversation);
|
|
87
|
-
}, [paramsActiveConversation]);
|
|
88
|
-
return {
|
|
89
|
-
conversation,
|
|
90
|
-
contactData,
|
|
91
|
-
setActiveConversation,
|
|
92
|
-
myProfile,
|
|
93
|
-
TUIManageShow,
|
|
94
|
-
setTUIManageShow,
|
|
95
|
-
TUIProfileShow,
|
|
96
|
-
setTUIProfileShow,
|
|
97
|
-
setActiveContact,
|
|
98
|
-
};
|
|
99
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
.App {
|
|
2
|
-
height: 100%;
|
|
3
|
-
}
|
|
4
|
-
#root {
|
|
5
|
-
width: 100%;
|
|
6
|
-
height: 100%;
|
|
7
|
-
margin: 0;
|
|
8
|
-
}
|
|
9
|
-
.sample-chat-h5 {
|
|
10
|
-
position:relative;
|
|
11
|
-
width: 100%;
|
|
12
|
-
height: 100%;
|
|
13
|
-
overflow: hidden;
|
|
14
|
-
&-container {
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
width: 100%;
|
|
18
|
-
height: 100%;
|
|
19
|
-
.sample-profile {
|
|
20
|
-
position: absolute;
|
|
21
|
-
top: 0;
|
|
22
|
-
z-index: 1;
|
|
23
|
-
width:100%;
|
|
24
|
-
max-width: 100%;
|
|
25
|
-
min-width: 100%;
|
|
26
|
-
}
|
|
27
|
-
.tui-kit-input-box.tui-kit-input-box--focus {
|
|
28
|
-
outline: none;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
.tui-message-input .tui-kit-input-box--focus {
|
|
32
|
-
outline: none;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
@use "../../../styles/colors/color-theme" as *;
|
|
2
|
-
|
|
3
|
-
.tui-kit {
|
|
4
|
-
position: relative;
|
|
5
|
-
display: flex;
|
|
6
|
-
width: 100%;
|
|
7
|
-
height: 100%;
|
|
8
|
-
text-align: initial;
|
|
9
|
-
|
|
10
|
-
@include theme() {
|
|
11
|
-
background-color: get(bg-primary);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.sample-chat {
|
|
16
|
-
position: relative;
|
|
17
|
-
margin: 0 auto;
|
|
18
|
-
width: calc(100% - 20rem);
|
|
19
|
-
min-width: 850px;
|
|
20
|
-
height: 86%;
|
|
21
|
-
box-sizing: border-box;
|
|
22
|
-
border-radius: 12px;
|
|
23
|
-
overflow: hidden;
|
|
24
|
-
|
|
25
|
-
&-profile {
|
|
26
|
-
position: absolute;
|
|
27
|
-
top: 0;
|
|
28
|
-
z-index: 1;
|
|
29
|
-
width: 100%;
|
|
30
|
-
height: 100%;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&-left-container {
|
|
34
|
-
max-width: 360px;
|
|
35
|
-
min-width: 360px;
|
|
36
|
-
display: flex;
|
|
37
|
-
flex-direction: column;
|
|
38
|
-
position: relative;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&-tab {
|
|
42
|
-
display: flex;
|
|
43
|
-
align-items: center;
|
|
44
|
-
justify-content: space-around;
|
|
45
|
-
margin: 12px;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&-tab-container {
|
|
49
|
-
display: flex;
|
|
50
|
-
flex-direction: column;
|
|
51
|
-
align-items: center;
|
|
52
|
-
justify-content: center;
|
|
53
|
-
cursor: pointer;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
&-tab-text {
|
|
57
|
-
font-size: 15px;
|
|
58
|
-
line-height: 25px;
|
|
59
|
-
text-align: center;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&-tab-active {
|
|
63
|
-
color: #147aff;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.tuikit-container {
|
|
68
|
-
display: flex;
|
|
69
|
-
height: 100%;
|
|
70
|
-
position: relative;
|
|
71
|
-
text-align: initial;
|
|
72
|
-
box-shadow: 0 11px 20px 0 rgba(0, 0, 0, 30%);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.tui-chat-default {
|
|
76
|
-
width: 100%;
|
|
77
|
-
height: 100%;
|
|
78
|
-
background-size: cover;
|
|
79
|
-
background-position-x: -17px;
|
|
80
|
-
background-position-y: 173px;
|
|
81
|
-
padding: 100px 40px 0;
|
|
82
|
-
|
|
83
|
-
header {
|
|
84
|
-
display: flex;
|
|
85
|
-
align-items: center;
|
|
86
|
-
font-size: 1.75rem;
|
|
87
|
-
font-family: PingFangSC-Medium;
|
|
88
|
-
font-weight: 500;
|
|
89
|
-
color: #000;
|
|
90
|
-
letter-spacing: 0;
|
|
91
|
-
|
|
92
|
-
img {
|
|
93
|
-
width: 32px;
|
|
94
|
-
margin: 0 10px;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.content {
|
|
99
|
-
max-width: 393px;
|
|
100
|
-
font-size: 16px;
|
|
101
|
-
line-height: 24px;
|
|
102
|
-
font-family: PingFangSC-Regular;
|
|
103
|
-
font-weight: 400;
|
|
104
|
-
color: #666;
|
|
105
|
-
letter-spacing: 0;
|
|
106
|
-
padding: 36px 0 20px;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.link {
|
|
110
|
-
font-size: 14px;
|
|
111
|
-
line-height: 20px;
|
|
112
|
-
font-family: PingFangSC-Regular;
|
|
113
|
-
font-weight: 400;
|
|
114
|
-
color: #666;
|
|
115
|
-
letter-spacing: 0;
|
|
116
|
-
|
|
117
|
-
a {
|
|
118
|
-
font-family: PingFangSC-Regular;
|
|
119
|
-
font-weight: 400;
|
|
120
|
-
color: #006eff;
|
|
121
|
-
letter-spacing: 0;
|
|
122
|
-
text-decoration: none;
|
|
123
|
-
padding: 0 5px;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
body {
|
|
129
|
-
#webpack-dev-server-client-overlay {
|
|
130
|
-
display: none !important;
|
|
131
|
-
}
|
|
132
|
-
}
|