@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,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { PropsWithChildren } from 'react';
|
|
2
2
|
import { Conversation, Message } from '@tencentcloud/chat';
|
|
3
3
|
import { IMessageModel } from '@tencentcloud/chat-uikit-engine';
|
|
4
4
|
import { UnknowPorps } from '../../context/ComponentContext.js';
|
|
@@ -11,28 +11,29 @@ import { TUIMessageInputBasicProps } from '../TUIMessageInput/TUIMessageInput.js
|
|
|
11
11
|
interface TUIChatProps {
|
|
12
12
|
className?: string;
|
|
13
13
|
conversation?: Conversation;
|
|
14
|
-
EmptyPlaceholder?:
|
|
15
|
-
TUIMessage?:
|
|
16
|
-
TUIChatHeader?:
|
|
17
|
-
MessageContext?:
|
|
18
|
-
TUIMessageInput?:
|
|
19
|
-
InputPlugins?:
|
|
20
|
-
InputQuote?:
|
|
21
|
-
MessagePlugins?:
|
|
22
|
-
MessageCustomPlugins?:
|
|
23
|
-
MessageTextPlugins?:
|
|
24
|
-
onMessageRecevied?: (updateMessage: (event?:
|
|
14
|
+
EmptyPlaceholder?: React__default.ReactElement;
|
|
15
|
+
TUIMessage?: React__default.ComponentType<TUIMessageProps | UnknowPorps>;
|
|
16
|
+
TUIChatHeader?: React__default.ComponentType<TUIChatHeaderDefaultProps>;
|
|
17
|
+
MessageContext?: React__default.ComponentType<MessageContextProps>;
|
|
18
|
+
TUIMessageInput?: React__default.ComponentType<UnknowPorps>;
|
|
19
|
+
InputPlugins?: React__default.ComponentType<UnknowPorps>;
|
|
20
|
+
InputQuote?: React__default.ComponentType<UnknowPorps>;
|
|
21
|
+
MessagePlugins?: React__default.ComponentType<UnknowPorps>;
|
|
22
|
+
MessageCustomPlugins?: React__default.ComponentType<UnknowPorps>;
|
|
23
|
+
MessageTextPlugins?: React__default.ComponentType<UnknowPorps>;
|
|
24
|
+
onMessageRecevied?: (updateMessage: (event?: Message[]) => void, event: any) => void;
|
|
25
25
|
sendMessage?: (message: Message, options?: any) => Promise<Message>;
|
|
26
26
|
revokeMessage?: (message: Message) => Promise<Message>;
|
|
27
27
|
selectedConversation?: (conversation: Conversation) => Promise<Conversation>;
|
|
28
|
-
filterMessage?: (messageList:
|
|
28
|
+
filterMessage?: (messageList: IMessageModel[]) => IMessageModel[];
|
|
29
|
+
callButtonClicked?: (callMediaType?: number, callType?: any) => void;
|
|
29
30
|
messageConfig?: TUIMessageProps;
|
|
30
31
|
cloudCustomData?: string;
|
|
31
32
|
TUIMessageInputConfig?: TUIMessageInputBasicProps;
|
|
32
33
|
TUIMessageListConfig?: MessageListProps;
|
|
33
34
|
[propName: string]: any;
|
|
34
35
|
}
|
|
35
|
-
declare function UnMemoizedTUIChat<T extends TUIChatProps>(props: PropsWithChildren<T>):
|
|
36
|
+
declare function UnMemoizedTUIChat<T extends TUIChatProps>(props: PropsWithChildren<T>): React__default.ReactElement;
|
|
36
37
|
declare const TUIChat: typeof UnMemoizedTUIChat;
|
|
37
38
|
|
|
38
39
|
export { TUIChat };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as t,__generator as s}from"tslib";import o,{createElement as
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as s}from"tslib";import o,{createElement as n,useReducer as a,useRef as i,useEffect as r,useMemo as c}from"react";import{jsx as u,jsxs as g,Fragment as m}from"react/jsx-runtime";import{TUIStore as l,StoreName as p,TUIChatService as d}from"@tencentcloud/chat-uikit-engine";import{JSONStringToParse as M}from"../utils.js";import{useUIKit as I}from"../../context/UIKitContext.js";import{useUIManager as f}from"../../context/UIManagerContext.js";import{TUIChatStateContextProvider as v}from"../../context/TUIChatStateContext.js";import{TUIChatActionProvider as h}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{ComponentProvider as C}from"../../context/ComponentContext.js";import T from"./hooks/useCreateTUIChatStateContext.js";import{TUIMessage as U}from"../TUIMessage/TUIMessage.js";import"../TUIMessage/MessagePlugins.js";import"../TUIMessage/MessageContext.js";import{CONSTANT_DISPATCH_TYPE as j}from"../../constants.js";import{chatReducer as x,initialState as S}from"./TUIChatState.js";import{useHandleMessageList as L}from"./hooks/useHandleMessageList.js";import{useHandleMessage as E}from"./hooks/useHandleMessage.js";import{TUIChatHeader as P}from"../TUIChatHeader/TUIChatHeader.js";import"@tencentcloud/tui-core";import"@tencentcloud/chat";import"../Icon/config.js";import"../Icon/type.js";import"../../utils/env.js";import{TUIMessageList as y}from"../TUIMessageList/TUIMessageList.js";import{TUIMessageInput as H}from"../TUIMessageInput/TUIMessageInput.js";import"react-i18next";import{EmptyStateIndicator as k}from"../EmptyStateIndicator/EmptyStateIndicator.js";function A(t){var s=t.conversation,o=t.EmptyPlaceholder,a=void 0===o?u(k,{listType:"chat"}):o,i=I().chat,r=f().conversation,c=s||r;return(null==c?void 0:c.conversationID)?n(D,e({chat:i},t,{conversation:c,key:c.conversationID})):a}function D(o){var n=this,I=o.chat,f=o.conversation,k=o.className,A=o.children,D=o.TUIMessage,_=o.TUIChatHeader,R=o.TUIMessageInput,N=o.InputPlugins,w=o.MessagePlugins,B=o.MessageContext,F=o.MessageCustomPlugins,G=o.MessageTextPlugins,O=o.InputQuote;o.onMessageRecevied,o.sendMessage;var Q=o.revokeMessage;o.selectedConversation;var V=o.filterMessage,b=o.messageConfig,K=o.cloudCustomData,q=o.TUIMessageInputConfig,z=o.TUIMessageListConfig,J=o.callButtonClicked,W=a(x,e(e({},S),{conversation:f})),X=W[0],Y=W[1],Z=i(null),$=i(),ee=X&&T(e({chat:I,conversation:f,messageListRef:Z,textareaRef:$,messageConfig:b,cloudCustomData:K,TUIMessageInputConfig:q,TUIMessageListConfig:z},X)),te=L({chat:I,conversation:f,state:X,dispatch:Y,filterMessage:V}),se=te.editLocalMessage,oe=te.updateUploadPendingMessageList,ne=E({state:X,dispatch:Y}),ae=ne.operateMessage,ie=ne.setAudioSource,re=ne.setVideoSource,ce=ne.setHighlightedMessageId,ue=ne.setActiveMessageID;r((function(){return l.watch(p.CHAT,{messageList:ge,isCompleted:me}),function(){l.unwatch(p.CHAT,{messageList:ge,isCompleted:me})}}),[]);var ge=function(e){var t=e.filter((function(e){return!e.isDeleted}));Y({type:j.SET_MESSAGELIST,value:V?V(t):t})},me=function(e){e&&Y({type:j.SET_NO_MORE,value:e})},le=function(){return t(n,void 0,void 0,(function(){return s(this,(function(e){return d.getMessageList(),[2]}))}))},pe=function(e){return t(n,void 0,void 0,(function(){var t;return s(this,(function(s){return"TIMCustomElem"===e.type&&7===(null===(t=M(e.payload.data))||void 0===t?void 0:t.src)||X.firstSendMessage||Y({type:j.SET_FIRST_SEND_MESSAGE,value:e}),[2]}))}))},de=c((function(){return{editLocalMessage:se,operateMessage:ae,loadMore:le,revokeMessage:Q,setAudioSource:ie,setVideoSource:re,setHighlightedMessageId:ce,setActiveMessageID:ue,updateUploadPendingMessageList:oe,setFirstSendMessage:pe,callButtonClicked:J}}),[se,ae,le,Q,ie,re,ce,ue,oe,pe,J]),Me=c((function(){return{TUIMessage:D||U,MessageContext:B,InputPlugins:N,MessagePlugins:w,MessageCustomPlugins:F,MessageTextPlugins:G,TUIChatHeader:_,TUIMessageInput:R,InputQuote:O}}),[]);return u("div",e({className:"chat ".concat(k)},{children:u(v,e({value:ee},{children:u(h,e({value:de},{children:u(C,e({value:Me},{children:A||g(m,{children:[u(P,{}),u(y,{}),u(H,{})]})}))}))}))}))}var _=o.memo(A);export{_ as TUIChat};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e,__spreadArray as s}from"tslib";import{CONSTANT_DISPATCH_TYPE as a}from"../../constants.js";import{handleUploadPendingMessage as t,handleEditMessage as r}from"./
|
|
1
|
+
import{__assign as e,__spreadArray as s}from"tslib";import{CONSTANT_DISPATCH_TYPE as a}from"../../constants.js";import{handleUploadPendingMessage as t,handleEditMessage as r}from"./utils.js";var u=function(u,i){switch(null==i?void 0:i.type){case a.SET_CONVERSATION_PRPFILE:return e(e({},u),{conversation:i.value});case a.SET_MESSAGELIST:return e(e({},u),{messageList:i.value});case a.SET_EDIT_MESSAGE:return u.messageList&&i.value&&e(e({},u),{messageList:s([],r(u.messageList,i.value),!0)});case a.SET_IS_COMPLETE:return e(e({},u),{isCompleted:i.value});case a.RESET:return e({},E);case a.SET_HIGH_LIGHTED_MESSAGE_ID:return e(e({},u),{highlightedMessageId:i.value});case a.OPERATE_MESSAGE:return e(e({},u),{operateData:e({},i.value)});case a.SET_NO_MORE:return e(e({},u),{noMore:i.value});case a.SET_AUDIO_SOURCE:return e(e({},u),{audioSource:i.value});case a.SET_VIDEO_SOURCE:return e(e({},u),{vidoeSource:i.value});case a.UPDATE_UPLOAD_PENDING_MESSAGE_LIST:return(null==u?void 0:u.uploadPendingMessageList)&&i.value&&e(e({},u),{uploadPendingMessageList:s([],t(u.uploadPendingMessageList,i.value),!0)});case a.SET_FIRST_SEND_MESSAGE:return e(e({},u),{firstSendMessage:i.value});case a.SET_ACTIVE_MESSAGE_ID:return e(e({},u),{activeMessageID:i.value})}},E={conversation:{},messageList:[],nextReqMessageID:"",isCompleted:!1,init:!1,highlightedMessageId:"",lastMessageID:"",isSameLastMessageID:!1,operateData:{},noMore:!1,audioSource:null,vidoeSource:null,uploadPendingMessageList:[],firstSendMessage:null,activeMessageID:""};export{u as chatReducer,E as initialState};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./server.js";import"tslib";import"react";import"react/jsx-runtime";import"@tencentcloud/chat-uikit-engine";import"date-fns";import"date-fns/locale";import"@tencentcloud/chat";import"../Icon/config.js";import"../Icon/type.js";import"@tencentcloud/tui-core";import"react-i18next";import"../../context/TUIMessageContext.js";import"../../constants.js";import"../TUIMessage/hooks/useMessageReply.js";import"../TUIMessage/MessagePlugins.js";import"../TUIMessage/MessageContext.js";import"../../utils/env.js";import"../TUIMessageInput/hooks/useHandleQuoteMessage.js";new t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t,{TUIConstants as e}from"@tencentcloud/tui-core";import{TUIStore as n,StoreName as r,TUIChatService as i}from"@tencentcloud/chat-uikit-engine";var o=function(){function o(){var i=this;this.currentConversationID="",this.currentMessageList=[],t.registerService(e.TUIChat.SERVICE.NAME,this),n.watch(r.CONV,{currentConversationID:function(t){i.currentConversationID=t}})}return o.prototype.onCall=function(t,n,r){var o;if(t===e.TUIChat.SERVICE.METHOD.UPDATE_MESSAGE_LIST)(null==(o=n.message)?void 0:o.conversationID)===this.currentConversationID&&i.updateMessageList([o],"push")},o}();export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__spreadArray as n}from"tslib";import"@tencentcloud/chat";import t,{TUIConstants as i}from"@tencentcloud/tui-core";import o from"@tencentcloud/chat-uikit-engine";import"../../constants.js";import"date-fns";import"date-fns/locale";import"react/jsx-runtime";import"react";import"../Icon/config.js";import"../Icon/type.js";var r=function(t,i){var o=n([],t,!0),r=o.findIndex((function(n){return(null==n?void 0:n.ID)===(null==i?void 0:i.ID)}));return o[r]=i,o},e=function(t,i){var o=n([],t,!0);o.some((function(n){return n.ID===(null==i?void 0:i.ID)}))||o.push(i);var r=o.findIndex((function(n){return(null==n?void 0:n.ID)===(null==i?void 0:i.ID)}));return o[r]=i,o},l=function(n){var r=n.callType,e=n.callMediaType,l=n.userIDList,c=n.callButtonClicked;r===o.TYPES.CONV_C2C&&(c&&c(e,r),t.callService({serviceName:i.TUICalling.SERVICE.NAME,method:i.TUICalling.SERVICE.METHOD.START_CALL,params:{userIDList:l,type:e,callParams:{offlinePushInfo:{title:"call",description:"you have a call",androidSound:"private_ring",iOSSound:"01.caf"}}}}))};export{r as handleEditMessage,e as handleUploadPendingMessage,l as startCall};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { PropsWithChildren } from 'react';
|
|
2
2
|
import { Conversation } from '@tencentcloud/chat';
|
|
3
3
|
import { TUIChatHeaderDefaultProps } from './TUIChatHeaderDefault.js';
|
|
4
4
|
|
|
5
5
|
interface TUIChatHeaderProps {
|
|
6
6
|
title?: string;
|
|
7
|
-
TUIChatHeader?:
|
|
7
|
+
TUIChatHeader?: React__default.ComponentType<TUIChatHeaderDefaultProps>;
|
|
8
8
|
conversation?: Conversation;
|
|
9
|
-
avatar?:
|
|
10
|
-
headerOpateIcon?:
|
|
9
|
+
avatar?: React__default.ReactElement | string;
|
|
10
|
+
headerOpateIcon?: React__default.ReactElement | string;
|
|
11
|
+
enableCall?: boolean;
|
|
11
12
|
}
|
|
12
|
-
declare function UnMemoizedTUIChatHeader<T extends TUIChatHeaderProps>(props: PropsWithChildren<T>):
|
|
13
|
+
declare function UnMemoizedTUIChatHeader<T extends TUIChatHeaderProps>(props: PropsWithChildren<T>): React__default.ReactElement;
|
|
13
14
|
declare const TUIChatHeader: typeof UnMemoizedTUIChatHeader;
|
|
14
15
|
|
|
15
16
|
export { TUIChatHeader };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import e from"react";import{useTUIChatStateContext as o}from"../../context/TUIChatStateContext.js";import{TUIChatHeaderDefault as r}from"./TUIChatHeaderDefault.js";import"tslib";import"../../context/TUIMessageContext.js";import{useComponentContext as a}from"../../context/ComponentContext.js";function n(e){var n=e.title,
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import e from"react";import{useTUIChatStateContext as o}from"../../context/TUIChatStateContext.js";import{TUIChatHeaderDefault as r}from"./TUIChatHeaderDefault.js";import"tslib";import"@tencentcloud/tui-core";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import"../../context/TUIMessageContext.js";import{useComponentContext as a}from"../../context/ComponentContext.js";function n(e){var n=e.title,i=e.conversation,m=e.TUIChatHeader,c=e.avatar,p=e.headerOpateIcon,l=e.enableCall,s=o("TUIChatHeader").conversation,C=a().TUIChatHeader;return t(m||C||r,{title:n,conversation:i||s,avatar:c,opateIcon:p,enableCall:l})}var i=e.memo(n);export{i as TUIChatHeader};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { Conversation } from '@tencentcloud/chat';
|
|
3
3
|
|
|
4
4
|
interface TUIChatHeaderDefaultProps {
|
|
5
5
|
title?: string;
|
|
6
|
-
avatar?:
|
|
6
|
+
avatar?: React__default.ReactElement | string;
|
|
7
7
|
isOnline?: boolean;
|
|
8
8
|
conversation?: Conversation;
|
|
9
|
-
pluginComponentList?:
|
|
9
|
+
pluginComponentList?: React__default.ComponentType[];
|
|
10
|
+
enableCall?: boolean;
|
|
10
11
|
}
|
|
11
12
|
interface TUIChatHeaderBasicProps extends TUIChatHeaderDefaultProps {
|
|
12
13
|
isLive?: boolean;
|
|
13
|
-
opateIcon?:
|
|
14
|
+
opateIcon?: React__default.ReactElement | string;
|
|
14
15
|
}
|
|
15
|
-
declare function TUIChatHeaderDefault(props: TUIChatHeaderBasicProps):
|
|
16
|
+
declare function TUIChatHeaderDefault(props: TUIChatHeaderBasicProps): React__default.ReactElement;
|
|
16
17
|
|
|
17
18
|
export { TUIChatHeaderBasicProps, TUIChatHeaderDefault, TUIChatHeaderDefaultProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e,jsxs as i}from"react/jsx-runtime";import n,{useState as o,useEffect as a}from"react";import r,{TUIConstants as l}from"@tencentcloud/tui-core";import c from"@tencentcloud/chat";import{TUIConversationService as s}from"@tencentcloud/chat-uikit-engine";import{Avatar as d}from"../Avatar/Avatar.js";import{handleDisplayAvatar as m}from"../utils.js";import{isH5 as u}from"../../utils/env.js";import{Icon as v}from"../Icon/Icon.js";import{IconTypes as h}from"../Icon/type.js";import"react-i18next";import{useUIManager as p}from"../../context/UIManagerContext.js";import{useTUIChatActionContext as C}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{startCall as f}from"../TUIChat/utils.js";function I(n){var I=n.title,N=void 0===I?"":I,S=n.avatar;n.isOnline;var E=n.conversation,T=n.isLive,g=n.opateIcon,y=n.enableCall,P=void 0!==y&&y,k=C().callButtonClicked,O=p().setActiveContact,j=o(N),x=j[0],V=j[1],Y=o(""),b=Y[0],A=Y[1],L=o(!1),M=L[0],U=L[1];a((function(){switch(V(N),S&&A(S),null==E?void 0:E.type){case c.TYPES.CONV_C2C:!function(t,i){x||V(i||(null==t?void 0:t.nick)||(null==t?void 0:t.userID));S||A(e(d,{size:32,image:m(t.avatar)}))}(E.userProfile,null==E?void 0:E.remark);var t=!!r.getService(l.TUICalling.SERVICE.NAME);U(t&&P);break;case c.TYPES.CONV_GROUP:!function(t){x||V((null==t?void 0:t.name)||(null==t?void 0:t.groupID));S||A(e(d,{size:32,image:m(t.avatar,c.TYPES.CONV_GROUP)}))}(E.groupProfile);break;case c.TYPES.CONV_SYSTEM:V("System Notice");break;default:V("")}}),[E]);var w=p().setTUIManageShow,_=function(t){var e,i=(null===(e=null==E?void 0:E.userProfile)||void 0===e?void 0:e.userID)||"",n=(null==E?void 0:E.type)||c.TYPES.CONV_C2C;f({callType:n,callMediaType:t,userIDList:[i],callButtonClicked:k})};return i("header",t({className:"tui-chat-header ".concat(T?"tui-chat-live-header":"")},{children:[u&&e("div",t({style:{paddingRight:"10px"}},{children:e(v,{onClick:function(){s.switchConversation(""),O()},type:h.BACK,width:9,height:16})})),e("div",t({className:"tui-chat-header-left ".concat((null==E?void 0:E.type)===c.TYPES.CONV_SYSTEM?"system":"")},{children:(null==E?void 0:E.type)!==c.TYPES.CONV_SYSTEM&&b})),e("div",t({className:"header-content"},{children:e("h3",t({className:"title"},{children:x}))})),M&&i("div",t({className:"call-btn-container"},{children:[e(v,{className:"call-btn",onClick:function(){return _(2)},type:h.VIDEOCALL,width:24}),e(v,{className:"call-btn",onClick:function(){return _(1)},type:h.VOICECALL,width:20})]})),e("div",t({className:"tui-chat-header-right"},{children:e("div",t({className:"header-handle"},{children:g||e(v,{className:"header-handle-more",onClick:function(){w&&w(!0)},type:h.ELLIPSE,width:18,height:5})}))}))]}),null==E?void 0:E.conversationID)}var N=n.memo(I);function S(i){var n=t({},i);return e(N,t({},n))}export{S as TUIChatHeaderDefault};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { PropsWithChildren } from 'react';
|
|
2
2
|
|
|
3
|
-
declare function UnMemoizedTUIContact<T>(props: PropsWithChildren<T>):
|
|
4
|
-
declare const TUIContact:
|
|
3
|
+
declare function UnMemoizedTUIContact<T>(props: PropsWithChildren<T>): React__default.ReactElement;
|
|
4
|
+
declare const TUIContact: React__default.MemoExoticComponent<typeof UnMemoizedTUIContact>;
|
|
5
5
|
|
|
6
6
|
export { TUIContact, UnMemoizedTUIContact };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsx as i,jsxs as o,Fragment as c}from"react/jsx-runtime";import
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as i,jsxs as o,Fragment as c}from"react/jsx-runtime";import e,{useState as n,useMemo as r}from"react";import{useTranslation as s}from"react-i18next";import{TUIContactContextProvider as a}from"../../context/TUIContactContext.js";import{isH5 as m}from"../../utils/env.js";import"@tencentcloud/tui-core";import{useUIManager as d}from"../../context/UIManagerContext.js";import"../../context/TUIMessageContext.js";import l from"./hooks/useTUIContact.js";import{TUIContactList as h}from"./TUIContactList/TUIContactList.js";import{TUIContactSearch as p}from"../TUIContactSearch/TUIContactSearch.js";import{Icon as f}from"../Icon/Icon.js";import{IconTypes as u}from"../Icon/type.js";function C(e){var C=e.children,I=s().t,L=d().setActiveContact,j=n(!1),v=j[0],x=j[1],U=l(),T=U.friendList,k=U.blockList,w=U.blocklistProfile,A=U.friendApplicationList,N=U.isShowContactList,S=U.setShowContactList,b=r((function(){return{friendList:T,blockList:k,blocklistProfile:w,friendApplicationList:A,isShowContactList:N,setShowContactList:S}}),[T,w,A,N,S]);return i(a,t({value:b},{children:C||o("div",t({className:"tui-contacts ".concat(m?"tui-contacts-h5":""," ")},{children:[!v&&o(c,{children:[o("div",t({className:"tui-contacts-header"},{children:[i("div",t({className:"tui-contact-input"},{children:i(p,{})})),i(f,{onClick:function(){L(),x(!0)},type:u.ADDFRIEND,width:24,height:24})]})),i(h,{})]}),v&&o(c,{children:[o("div",t({className:"tui-contacts-add-header"},{children:[i(f,{onClick:function(){L(),x(!1)},type:u.BACK,width:9,height:16}),i("div",t({className:"tui-contacts-add-header-title"},{children:I("TUIContact.Add Friend")}))]})),i(p,{})]})]}))}))}var I=e.memo(C);export{I as TUIContact,C as UnMemoizedTUIContact};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { PropsWithChildren } from 'react';
|
|
2
2
|
|
|
3
3
|
interface TUIContactInfoProps {
|
|
4
4
|
className?: string;
|
|
5
5
|
showChats?: () => void;
|
|
6
6
|
}
|
|
7
|
-
declare function UnMemoizedTUIContactInfo<T extends TUIContactInfoProps>(props: PropsWithChildren<T>):
|
|
8
|
-
declare const TUIContactInfo:
|
|
7
|
+
declare function UnMemoizedTUIContactInfo<T extends TUIContactInfoProps>(props: PropsWithChildren<T>): React__default.ReactElement;
|
|
8
|
+
declare const TUIContactInfo: React__default.MemoExoticComponent<typeof UnMemoizedTUIContactInfo>;
|
|
9
9
|
|
|
10
10
|
export { TUIContactInfo, UnMemoizedTUIContactInfo };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as o}from"tslib";import{jsx as t,Fragment as i,jsxs as
|
|
1
|
+
import{__assign as o}from"tslib";import{jsx as t,Fragment as i,jsxs as r}from"react/jsx-runtime";import n from"react";import"@tencentcloud/tui-core";import"react-i18next";import{useUIManager as e}from"../../../context/UIManagerContext.js";import"../../../context/TUIMessageContext.js";import{isH5 as a}from"../../../utils/env.js";import{FriendInfo as l}from"./friendInfo.js";import{BlockInfo as d}from"./blockInfo.js";import{AddFriendInfo as p}from"./addFriendInfo.js";import{GroupInfo as m}from"./groupInfo.js";import{FriendApplicationInfo as c}from"./friendApplication.js";function f(n){var f=n.showChats,u=e().contactData;return(null==u?void 0:u.type)?r("div",o({className:"tui-contact-info ".concat(a?"tui-contact-info-h5":""," ")},{children:["addFriend"===(null==u?void 0:u.type)&&t(p,{profile:null==u?void 0:u.data}),"friend"===(null==u?void 0:u.type)&&t(l,{showChats:f,friend:null==u?void 0:u.data}),"block"===(null==u?void 0:u.type)&&t(d,{profile:null==u?void 0:u.data}),"group"===(null==u?void 0:u.type)&&t(m,{showChats:f,group:null==u?void 0:u.data}),"friendApplication"===(null==u?void 0:u.type)&&t(c,{application:null==u?void 0:u.data})]})):t(i,{children:" "})}var u=n.memo(f);export{u as TUIContactInfo,f as UnMemoizedTUIContactInfo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsxs as e,jsx as r}from"react/jsx-runtime";import a from"react";import{useTranslation as i}from"react-i18next";import{TUIConversationService as o}from"@tencentcloud/chat-uikit-engine";import{
|
|
1
|
+
import{__assign as t}from"tslib";import{jsxs as e,jsx as r}from"react/jsx-runtime";import a from"react";import{useTranslation as i}from"react-i18next";import{TUIConversationService as o}from"@tencentcloud/chat-uikit-engine";import"@tencentcloud/tui-core";import{useUIManager as n}from"../../../context/UIManagerContext.js";import"../../../context/TUIMessageContext.js";import{Icon as c}from"../../Icon/Icon.js";import{IconTypes as m}from"../../Icon/type.js";import{isH5 as s}from"../../../utils/env.js";import{Avatar as d}from"../../Avatar/Avatar.js";import{defaultUserAvatar as l}from"../../Avatar/default.js";function f(a){var f=a.profile,h=i().t,p=f.userID,v=f.nick,u=f.selfSignature,x=f.avatar,j=n().setActiveContact;return e("div",t({className:"tui-contact-info-header"},{children:[s&&r(c,{width:9,height:16,type:m.BACK,onClick:function(){o.switchConversation(""),j()}}),e("div",t({className:"header-container"},{children:[e("div",t({className:"header-container-avatar"},{children:[r(d,{size:60,image:x||l}),r("div",t({className:"header-container-name"},{children:v||p}))]})),r("div",t({className:"header-container-text"},{children:"ID:".concat(p)})),e("div",t({className:"header-container-text"},{children:[h("TUIContact.Signature"),":",u||""]}))]}))]}))}var h=a.memo(f);export{h as BasicInfo,f as UnMemoizedBasicInfo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t,__awaiter as
|
|
1
|
+
import{__assign as t,__awaiter as e,__generator as o}from"tslib";import{jsxs as n,Fragment as r,jsx as c}from"react/jsx-runtime";import i,{useState as m,useEffect as a}from"react";import{useTranslation as s}from"react-i18next";import"@tencentcloud/tui-core";import{useUIManager as l}from"../../../context/UIManagerContext.js";import"../../../context/TUIMessageContext.js";import{BasicInfo as f}from"./basicInfo.js";import{Switch as u}from"../../Switch/Switch.js";import p from"./hooks/useContactInfo.js";function h(i){var h=this,d=i.profile,v=l(),x=v.contactData,j=v.setActiveContact,C=s().t,I=m(!1),b=I[0],k=I[1],N=p().removeFromBlocklist;a((function(){k(!0)}),[x]);return n(r,{children:[c(f,{profile:d}),c("div",t({className:"tui-contact-info-content"},{children:n("div",t({className:"content-item"},{children:[c("p",t({className:"content-item-label"},{children:C("TUIContact.block")})),c(u,{className:"content-item-text",onChange:function(){return e(h,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,N(d.userID)];case 1:return t.sent(),k(!1),j(),[2]}}))}))},checked:b})]}))}))]})}var d=i.memo(h);export{d as BlockInfo,h as UnMemoizedBlockInfo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsxs as e,Fragment as n,jsx as i}from"react/jsx-runtime";import a from"react";import{useTranslation as c}from"react-i18next";import o from"@tencentcloud/chat";import{
|
|
1
|
+
import{__assign as t}from"tslib";import{jsxs as e,Fragment as n,jsx as i}from"react/jsx-runtime";import a from"react";import{useTranslation as c}from"react-i18next";import o from"@tencentcloud/chat";import"@tencentcloud/tui-core";import{useUIManager as r}from"../../../context/UIManagerContext.js";import"../../../context/TUIMessageContext.js";import{Avatar as m}from"../../Avatar/Avatar.js";import{defaultUserAvatar as s}from"../../Avatar/default.js";import l from"./hooks/useContactInfo.js";function d(a){var d=r().setActiveContact,f=c().t,p=a.application,h=p.userID,v=p.nick,u=p.avatar,N=p.type,I=p.wording,b=l(),x=b.acceptFriendApplication,C=b.refuseFriendApplication;return e(n,{children:[i("div",t({className:"tui-contact-info-header"},{children:e("div",t({className:"header-container"},{children:[e("div",t({className:"header-container-avatar"},{children:[i(m,{size:60,image:u||s}),i("div",t({className:"header-container-name"},{children:v||h}))]})),i("div",t({className:"header-container-text"},{children:"ID:".concat(h)}))]}))})),i("div",t({className:"tui-contact-info-content"},{children:e("div",t({className:"content-item"},{children:[i("p",t({className:"content-item-label"},{children:f("TUIContact.verification info")})),i("p",t({className:"content-item-text"},{children:I}))]}))})),N===o.TYPES.SNS_APPLICATION_SENT_TO_ME&&i("div",t({className:"tui-contact-info-content"},{children:e("div",t({className:"content-btn-container"},{children:[i("div",t({className:"content-item-btn delete-btn",role:"button",tabIndex:0,onClick:function(){d(),C(h)}},{children:f("TUIContact.Refuse")})),i("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){d(),x(h)}},{children:f("TUIContact.Agree")}))]}))}))]})}var f=a.memo(d);export{f as FriendApplicationInfo,d as UnMemoizedFriendApplication};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t,__awaiter as e,__generator as n}from"tslib";import{jsxs as
|
|
1
|
+
import{__assign as t,__awaiter as e,__generator as n}from"tslib";import{jsxs as o,Fragment as i,jsx as r}from"react/jsx-runtime";import c,{useState as a,useEffect as s}from"react";import{useTranslation as m}from"react-i18next";import{TUIConversationService as l}from"@tencentcloud/chat-uikit-engine";import{useUIKit as d}from"../../../context/UIKitContext.js";import{useUIManager as u}from"../../../context/UIManagerContext.js";import"../../../context/TUIMessageContext.js";import{BasicInfo as f}from"./basicInfo.js";import{Switch as h}from"../../Switch/Switch.js";import v from"./hooks/useContactInfo.js";import{DivWithEdit as p}from"../../DivWithEdit/DivWithEdit.js";function C(c){var C=this,b=d().chat,x=u(),k=x.contactData,I=x.setActiveContact,N=x.setActiveConversation,g=m().t,j=c.friend,U=c.showChats,w=j.userID,D=j.profile,T=j.remark,E=a(""),M=E[0],S=E[1],A=a(""),F=A[0],W=A[1],y=a(!1),B=y[0],K=y[1],q=v(),z=q.addToBlocklist,G=q.deleteFriend;s((function(){K(!1),W(T)}),[k,T]);return o(i,{children:[r(f,{profile:D}),o("div",t({className:"tui-contact-info-content"},{children:[o("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:g("TUIContact.remark")})),r(p,{name:"remark",className:"content-item-text",value:F,type:"text",toggle:function(){S("remark")},isEdit:"remark"===M,confirm:function(t){b.updateFriend({userID:w,remark:null==t?void 0:t.value}),W(null==t?void 0:t.value),S("")},close:function(){S("")}})]})),o("div",t({className:"content-item"},{children:[r("p",t({className:"content-item-label"},{children:g("TUIContact.block")})),r(h,{className:"content-item-text",onChange:function(){return e(C,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,z(w)];case 1:return t.sent(),K(!0),I(),[2]}}))}))},checked:B})]})),o("div",t({className:"content-btn-container"},{children:[r("div",t({className:"content-item-btn delete-btn",role:"button",tabIndex:0,onClick:function(){return e(C,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,G(w)];case 1:return t.sent(),I(),[2]}}))}))}},{children:g("TUIContact.Delete friend")})),r("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){var t="C2C".concat(w);U&&U(),l.switchConversation(t).then((function(t){N(t.getConversation())}))}},{children:g("TUIContact.Send Message")}))]}))]}))]})}var b=c.memo(C);export{b as FriendInfo,C as UnMemoizedFriendInfo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsxs as e,Fragment as n,jsx as o}from"react/jsx-runtime";import
|
|
1
|
+
import{__assign as t}from"tslib";import{jsxs as e,Fragment as n,jsx as o}from"react/jsx-runtime";import r from"react";import{useTranslation as i}from"react-i18next";import{TUIConversationService as a}from"@tencentcloud/chat-uikit-engine";import"@tencentcloud/tui-core";import{useUIManager as c}from"../../../context/UIManagerContext.js";import"../../../context/TUIMessageContext.js";import{Icon as s}from"../../Icon/Icon.js";import{IconTypes as m}from"../../Icon/type.js";import{isH5 as d}from"../../../utils/env.js";import{Avatar as l}from"../../Avatar/Avatar.js";import{defaultUserAvatar as h}from"../../Avatar/default.js";function v(r){var v=r.group,f=r.showChats,p=c(),u=p.setActiveContact,C=p.setActiveConversation,g=i().t,x=v.groupID,I=v.name,j=v.avatar;return e(n,{children:[e("div",t({className:"tui-contact-info-header"},{children:[d&&o(s,{width:9,height:16,type:m.BACK,onClick:function(){a.switchConversation(""),u()}}),e("div",t({className:"header-container"},{children:[e("div",t({className:"header-container-avatar"},{children:[o(l,{size:60,image:j||h}),o("div",t({className:"header-container-name"},{children:I||x}))]})),o("div",t({className:"header-container-text"},{children:"groupID:".concat(x)}))]}))]})),o("div",t({className:"tui-contact-info-content"},{children:o("div",t({className:"content-btn-container"},{children:o("div",t({className:"content-item-btn confirm-btn",role:"button",tabIndex:0,onClick:function(){var t="GROUP".concat(x);f&&f(),a.switchConversation(t).then((function(t){C(t.getConversation())}))}},{children:g("TUIContact.Send Message")}))}))}))]})}var f=r.memo(v);export{f as GroupInfo,v as UnMemoizedGroupInfo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from"tslib";import{useCallback as
|
|
1
|
+
import{__awaiter as e,__generator as t}from"tslib";import{useCallback as i}from"react";import n from"@tencentcloud/chat";import{Toast as r}from"../../../Toast/index.js";import{useUIKit as o}from"../../../../context/UIKitContext.js";import"react/jsx-runtime";import"@tencentcloud/chat-uikit-engine";import"../../../../context/TUIMessageContext.js";function c(){var c=this,s=o().chat,u=i((function(e){s.removeFromBlacklist({userIDList:[e]})}),[s]),d=i((function(e){s.addFriend({to:null==e?void 0:e.userID,source:"AddSource_Type_Web",remark:null==e?void 0:e.remark,wording:null==e?void 0:e.wording}).catch((function(e){console.warn("delete friend failed:",e),r({text:e,type:"error"})}))}),[s]),a=i((function(e){s.deleteFriend({userIDList:[e]})}),[s]);return{addToBlocklist:i((function(e){s.addToBlacklist({userIDList:[e]})}),[s]),removeFromBlocklist:u,isFriend:function(e){return new Promise((function(t,i){s.checkFriend({userIDList:[null==e?void 0:e.userID],type:n.TYPES.SNS_CHECK_TYPE_BOTH}).then((function(e){var i,r;switch(null===(r=null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.successUserIDList[0])||void 0===r?void 0:r.relation){case n.TYPES.SNS_TYPE_NO_RELATION:case n.TYPES.SNS_TYPE_A_WITH_B:case n.TYPES.SNS_TYPE_B_WITH_A:t(!1);break;case n.TYPES.SNS_TYPE_BOTH_WAY:t(!0);break;default:t(!1)}})).catch((function(e){console.warn("checkFriend error",e),i(e)}))}))},isBlock:function(i){return e(c,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,s.getBlacklist()];case 1:return[2,e.sent().data.includes(i)]}}))}))},addFriend:d,deleteFriend:a,acceptFriendApplication:i((function(e){s.acceptFriendApplication({userID:e,type:n.TYPES.SNS_APPLICATION_AGREE_AND_ADD})}),[s]),refuseFriendApplication:i((function(e){s.refuseFriendApplication({userID:e})}),[s])}}export{c as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
|
|
3
|
-
declare function UnMemoizedTUIContactList<T>():
|
|
4
|
-
declare const TUIContactList:
|
|
3
|
+
declare function UnMemoizedTUIContactList<T>(): React__default.ReactElement;
|
|
4
|
+
declare const TUIContactList: React__default.MemoExoticComponent<typeof UnMemoizedTUIContactList>;
|
|
5
5
|
|
|
6
6
|
export { TUIContactList };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsxs as i,jsx as
|
|
1
|
+
import{__assign as t}from"tslib";import{jsxs as i,jsx as n,Fragment as o}from"react/jsx-runtime";import e,{useState as c}from"react";import{useTranslation as a}from"react-i18next";import s from"@tencentcloud/chat";import{isH5 as r}from"../../../utils/env.js";import"@tencentcloud/tui-core";import{useUIManager as l}from"../../../context/UIManagerContext.js";import"../../../context/TUIMessageContext.js";import{useTUIContactContext as m}from"../../../context/TUIContactContext.js";import d from"../TUIContactInfo/hooks/useContactInfo.js";import u from"../hooks/useTUIContact.js";import{Avatar as p}from"../../Avatar/Avatar.js";import{defaultUserAvatar as f}from"../../Avatar/default.js";function h(){var e=l().setActiveContact,h=a().t,v=m("TUIContactList"),I=v.isShowContactList,N=v.friendList,C=v.blocklistProfile,x=v.friendApplicationList,T=d().acceptFriendApplication,S=u().groupList,b=c(!1),k=b[0],g=b[1],w=c(!1),A=w[0],U=w[1],j=c(!1),L=j[0],P=j[1],_=c(!1),y=_[0],E=_[1],M=function(c){var a=c.type,s=c.isShow,r=c.setShow,l=c.list,m=c.title;return i(o,{children:[i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return r(!s)}},{children:[n("div",t({className:"tui-contacts-list-title"},{children:m})),n("div",t({className:"tui-contacts-list-icon"},{children:n("i",t({className:"iconfont contacts-list-icon"},s?{children:""}:{children:""}))}))]})),s&&(null==l?void 0:l.map((function(o){var c=o.profile||o,s=c.userID,r=c.groupID,l=c.avatar,m=c.name,d=c.nick,u=o.remark||d||s||m||r;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(){e({type:a,data:o})}},{children:[n(p,{size:30,image:l||f}),n("div",t({className:"tui-contacts-list-item-container"},{children:n("p",t({className:"tui-contacts-list-item-name"},{children:u}))}))]}),s||r)})))]})};return I&&i("div",t({className:"tui-contacts-list ".concat(r?"tui-contacts-list-h5":""," ")},{children:[i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return g(!k)}},{children:[n("p",t({className:"tui-contacts-list-title"},{children:h("TUIContact.New Contacts")})),n("div",t({className:"tui-contacts-list-icon"},{children:n("i",t({className:"iconfont contacts-list-icon"},k?{children:""}:{children:""}))}))]})),k&&(null==x?void 0:x.map((function(o,c){var a=o.userID,r=o.avatar,l=o.nick,m=o.wording,d=o.type;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(t){t.stopPropagation(),e({type:"friendApplication",data:o})}},{children:[n(p,{size:30,image:r||f}),i("div",t({className:"tui-contacts-list-item-card"},{children:[i("div",{children:[n("p",t({className:"tui-contacts-list-item-name text-ellipsis"},{children:l||a})),""!==m&&n("p",t({className:"tui-contacts-list-item-text text-ellipsis"},{children:m}))]}),d===s.TYPES.SNS_APPLICATION_SENT_BY_ME&&n("p",t({className:"tui-contacts-list-btn-text text-ellipsis"},{children:h("TUIContact.waiting for verification")})),d===s.TYPES.SNS_APPLICATION_SENT_TO_ME&&n("div",t({className:"application-btn",role:"button",tabIndex:0,onClick:function(t){!function(t,i){t.stopPropagation(),T(i),e()}(t,a)}},{children:h("TUIContact.Agree")}))]}))]}),a)}))),n(M,{type:"block",title:h("TUIContact.Blocked List"),isShow:L,setShow:P,list:C}),n(M,{type:"group",title:h("TUIContact.Group List"),setShow:E,isShow:y,list:S}),n(M,{type:"friend",title:h("TUIContact.Friends"),setShow:U,isShow:A,list:N})]}))}var v=e.memo(h);export{v as TUIContactList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as n}from"tslib";import{useState as i,useEffect as
|
|
1
|
+
import{__awaiter as t,__generator as n}from"tslib";import{useState as i,useEffect as o}from"react";import r from"@tencentcloud/chat";import{TUIStore as e,StoreName as c}from"@tencentcloud/chat-uikit-engine";import{useUIKit as a}from"../../../context/UIKitContext.js";import"react/jsx-runtime";import"../../../context/TUIMessageContext.js";function u(){var u=this,s=a().chat,l=i([]),d=l[0],f=l[1],v=i([]),p=v[0],L=v[1],h=i([]),m=h[0],E=h[1],T=i([]),A=T[0],I=T[1],g=i(),D=g[0],P=g[1],b=i(!0),w=b[0],x=b[1];o((function(){e.watch(c.GRP,{groupList:C}),U(),_(),N()}),[s]);var C=function(t){P(t)};o((function(){null==s||s.on(r.EVENT.BLACKLIST_UPDATED,F),null==s||s.on(r.EVENT.FRIEND_LIST_UPDATED,j),null==s||s.on(r.EVENT.FRIEND_APPLICATION_LIST_UPDATED,k)}),[s]);var N=function(){return t(u,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,s.getFriendApplicationList()];case 1:return t=n.sent().data,E(null==t?void 0:t.friendApplicationList),[2]}}))}))},U=function(){return t(u,void 0,void 0,(function(){var t,i,o;return n(this,(function(n){switch(n.label){case 0:return[4,null==s?void 0:s.getFriendList()];case 1:return t=n.sent(),i=t.code,o=t.data,0===i&&f(o),[2]}}))}))},_=function(){return t(u,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,null==s?void 0:s.getBlacklist()];case 1:return 0===(t=n.sent().data).length||(L(t),S(t)),[2]}}))}))},S=function(i){return t(u,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,s.getUserProfile({userIDList:i})];case 1:return t=n.sent().data,I(t),[2]}}))}))},k=function(t){var n;E(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.friendApplicationList)},F=function(t){L(t.data),S(t.data)},j=function(t){f(t.data)};return{friendList:d,groupList:D,blocklistProfile:A,friendApplicationList:m,blockList:p,isShowContactList:w,setShowContactList:x}}export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t,__awaiter as e,__generator as r}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import
|
|
1
|
+
import{__assign as t,__awaiter as e,__generator as r}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import i,{useState as a}from"react";import{useTranslation as c}from"react-i18next";import"@tencentcloud/tui-core";import{useUIManager as s}from"../../context/UIManagerContext.js";import"../../context/TUIMessageContext.js";import{useTUIContactContext as u}from"../../context/TUIContactContext.js";import m from"./hooks/useContactSearch.js";import{Icon as l}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";import{Avatar as v}from"../Avatar/Avatar.js";import{defaultUserAvatar as f}from"../Avatar/default.js";import{Input as p}from"../Input/Input.js";function h(){var i=this,h=s().setActiveContact,I=c().t,C=u("TUIContactList"),x=C.friendList,g=C.setShowContactList,j=a(!1),U=j[0],b=j[1],k=m(),y=k.checkFriend,N=k.isBlock,A=k.getUserProfile,D=a(""),T=D[0],w=D[1],F=a([]),L=F[0],S=F[1];return n("div",t({className:"tui-contact-search"},{children:[o(p,{className:"tui-contact-search-input",placeholder:I("TUIContact.Enter a userID"),clearable:!0,value:T,onBlur:function(t){var e;w(null===(e=t.target)||void 0===e?void 0:e.value)},onFocus:function(){h()},onChange:function(t){var e,r;if(""===(null===(e=t.target)||void 0===e?void 0:e.value))return g&&g(!0),b(!1),void S([]);b(!0),w(null===(r=t.target)||void 0===r?void 0:r.value),g&&g(!1)},onKeyDown:function(){return e(i,void 0,void 0,(function(){return r(this,(function(t){return T&&A(T).then((function(t){var e=t.data;S(e)})),[2]}))}))},prefix:o(l,{type:d.SEARCH,height:16,width:16})}),U&&0===L.length?o("div",t({className:"tui-contact-search-item"},{children:I("TUIContact.No Result")})):L.map((function(a,c){var s=a.userID,u=a.avatar,m=a.nick;return n("div",t({className:"tui-contact-search-item",role:"button",tabIndex:0,onClick:function(){var t;t=a,e(i,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return[4,y(t)];case 1:return r.sent()?((e=null==x?void 0:x.find((function(t){return t.userID===T})))&&h({type:"friend",data:e}),[2]):N(t.userID)?(h({type:"block",data:t}),[2]):(h({type:"addFriend",data:t}),[2])}}))}))}},{children:[o(v,{size:30,image:u||f}),o("div",t({className:"search-item-name"},{children:m||s}))]}),s)}))]}))}var I=i.memo(h);export{I as TUIContactSearch,h as UnMemoizedTUIContactSearch};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@tencentcloud/chat";import{
|
|
1
|
+
import t from"@tencentcloud/chat";import{useUIKit as e}from"../../../context/UIKitContext.js";import"tslib";import"react/jsx-runtime";import"react";import"@tencentcloud/chat-uikit-engine";import"../../../context/TUIMessageContext.js";import{useTUIContactContext as n}from"../../../context/TUIContactContext.js";function o(){var o=n("TUIContactList").blockList,i=e().chat;return{checkFriend:function(e){return i.checkFriend({userIDList:[null==e?void 0:e.userID],type:t.TYPES.SNS_CHECK_TYPE_BOTH}).then((function(e){var n,o;return(null===(o=null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.successUserIDList[0])||void 0===o?void 0:o.relation)===t.TYPES.SNS_TYPE_BOTH_WAY}))},isBlock:function(t){return null==o?void 0:o.includes(t)},getUserProfile:function(t){return i.getUserProfile({userIDList:[t]})}}}export{o as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { PropsWithChildren } from 'react';
|
|
2
2
|
import { Conversation } from '@tencentcloud/chat';
|
|
3
3
|
|
|
4
4
|
interface TUIConversationProps {
|
|
@@ -6,7 +6,7 @@ interface TUIConversationProps {
|
|
|
6
6
|
deleteConversation?: (conversationID: string) => Promise<any>;
|
|
7
7
|
filterConversation?: (conversationList: Array<Conversation>) => Array<Conversation>;
|
|
8
8
|
}
|
|
9
|
-
declare function UnMemoizedTUIConversation<T extends TUIConversationProps>(props: PropsWithChildren<T>):
|
|
9
|
+
declare function UnMemoizedTUIConversation<T extends TUIConversationProps>(props: PropsWithChildren<T>): React__default.ReactElement;
|
|
10
10
|
declare const TUIConversation: typeof UnMemoizedTUIConversation;
|
|
11
11
|
|
|
12
12
|
export { TUIConversation, UnMemoizedTUIConversation };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { Conversation } from '@tencentcloud/chat';
|
|
3
3
|
import { ConversationPreviewUIComponentProps } from '../ConversationPreview/ConversationPreview.js';
|
|
4
4
|
import { ConversationListContainerProps } from '../ConversationPreview/ConversationListContainer.js';
|
|
@@ -8,12 +8,12 @@ interface Props {
|
|
|
8
8
|
filters?: object;
|
|
9
9
|
sort?: object;
|
|
10
10
|
options?: object;
|
|
11
|
-
Preview?:
|
|
12
|
-
Container?:
|
|
13
|
-
onConversationListUpdated?: (setConversationList:
|
|
11
|
+
Preview?: React__default.ComponentType<ConversationPreviewUIComponentProps>;
|
|
12
|
+
Container?: React__default.ComponentType<ConversationListContainerProps>;
|
|
13
|
+
onConversationListUpdated?: (setConversationList: React__default.Dispatch<React__default.SetStateAction<Array<Conversation>>>, event: () => void) => void;
|
|
14
14
|
filterConversation?: (conversationList: Array<Conversation>) => Array<Conversation>;
|
|
15
15
|
}
|
|
16
|
-
declare function UnMemoTUIConversationList<T extends Props>(props: T):
|
|
17
|
-
declare const TUIConversationList:
|
|
16
|
+
declare function UnMemoTUIConversationList<T extends Props>(props: T): React__default.ReactElement;
|
|
17
|
+
declare const TUIConversationList: React__default.MemoExoticComponent<typeof UnMemoTUIConversationList>;
|
|
18
18
|
|
|
19
19
|
export { TUIConversationList, UnMemoTUIConversationList };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as o}from"tslib";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import
|
|
1
|
+
import{__assign as o}from"tslib";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import r,{useState as i,useRef as s}from"react";import{useTranslation as a}from"react-i18next";import{useUIKit as v}from"../../context/UIKitContext.js";import{useUIManager as c}from"../../context/UIManagerContext.js";import"../../context/TUIMessageContext.js";import{isH5 as m}from"../../utils/env.js";import l from"./hooks/useConversationList.js";import{ConversationPreview as C}from"../ConversationPreview/ConversationPreview.js";import"@tencentcloud/chat-uikit-engine";import{Icon as u}from"../Icon/Icon.js";import{IconTypes as p}from"../Icon/type.js";import"@tencentcloud/chat";import{useTUIConversationContext as h}from"../../context/TUIConversationContext.js";import{ConversationListContainer as f}from"../ConversationPreview/ConversationListContainer.js";import{ConversationSearchInput as d}from"../ConversationSearch/ConversationSearchInput.js";import{ConversationSearchResult as j}from"../ConversationSearch/ConversationSearchResult.js";import{ConversationCreate as w}from"../ConversationCreate/ConversationCreate.js";import"../ConversationCreate/ConversationGroupTypeInfo.js";import{getDisplayTitle as I}from"../ConversationPreview/utils.js";import{useConversationUpdate as g}from"./hooks/useConversationUpdate.js";function L(r){var L=r.Preview,S=r.Container,x=void 0===S?f:S,P=r.onConversationListUpdated,U=r.filterConversation,N=r.componentVisibleOptions,T=void 0===N?{isProfileShow:!0,isSearchInputShow:!0,isContainerShow:!0}:N;a().t;var k=v().chat,y=c(),A=y.customClasses,b=y.conversation,D=y.setActiveConversation;y.setTUIProfileShow;var E=h("TUIConversationList").filterConversation,R=U||E,F=i(0),M=F[0],O=F[1],V=l(k,(function(o,e){o.length}),R),G=V.conversationList,K=V.setConversationList;g(K,P,(function(){return O((function(o){return o+1}))}),R);var q=i(""),z=q[0],B=q[1],H=i(G),J=H[0],Q=H[1],W=i(!1),X=W[0],Y=W[1],Z=i(""),$=Z[0],_=Z[1],oo=s(null);return e("div",o({className:"tui-conversation ".concat(m?"tui-conversation-h5":""," ").concat(A||""," "),ref:oo},{children:X?e(w,{conversationList:G,setConversationCreated:Y}):t(n,{children:[T.isSearchInputShow&&t("div",o({className:"tui-conversation-header"},{children:[e(d,{value:z,clearable:!0,onChange:function(o){var e,t;if(B(null===(e=o.target)||void 0===e?void 0:e.value),null===(t=o.target)||void 0===t?void 0:t.value){var n=G.filter((function(e){var t;return I(e).toLocaleLowerCase().includes(null===(t=o.target)||void 0===t?void 0:t.value.toLocaleLowerCase())}));Q(n)}else Q([])}}),e("div",o({className:"tui-conversation-create-icon"},{children:e(u,{onClick:function(){B(""),Y(!0)},type:p.CREATE,height:24,width:24})}))]})),T.isContainerShow&&e(x,o({setConversationList:K},{children:0===G.length?t("div",o({className:"no-result"},{children:[e(u,{className:"no-result-icon",type:p.EFFORT,width:42,height:42}),e("div",o({className:"no-result-message"},{children:"No conversation"}))]})):z?e(j,{Preview:L,searchValue:z,result:J}):G.map((function(t){return e(C,o({},{activeConversation:b,conversation:t,setActiveConversation:D,Preview:L,conversationUpdateCount:M,activeConversationID:$,setActiveConversationID:_}),t.conversationID)}))}))]})}))}var S=r.memo(L);export{S as TUIConversationList,L as UnMemoTUIConversationList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as t}from"react";import n from"@tencentcloud/chat";import{
|
|
1
|
+
import{useEffect as t}from"react";import n from"@tencentcloud/chat";import{useUIKit as o}from"../../../context/UIKitContext.js";import"tslib";import"react/jsx-runtime";import"@tencentcloud/chat-uikit-engine";import"../../../context/TUIMessageContext.js";var r=function(r,e,i,c){var u=o().chat;t((function(){var t=function(t){r&&r(c?c(t.data):t.data.filter((function(t){return t.type!==n.TYPES.CONV_SYSTEM}))),i&&i(),e&&"function"==typeof e&&r&&e(r,t)};return null==u||u.on(n.EVENT.CONVERSATION_LIST_UPDATED,t),function(){null==u||u.off(n.EVENT.CONVERSATION_LIST_UPDATED,t)}}),[u,e])};export{r as useConversationUpdate};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
|
|
3
|
-
declare function UnMemoizedTUIManage<T>():
|
|
3
|
+
declare function UnMemoizedTUIManage<T>(): React__default.ReactElement;
|
|
4
4
|
declare const TUIManage: typeof UnMemoizedTUIManage;
|
|
5
5
|
|
|
6
6
|
export { TUIManage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as n}from"tslib";import{jsxs as e,jsx as i}from"react/jsx-runtime";import o,{useState as t,useEffect as a}from"react";import{useTranslation as r}from"react-i18next";import{Icon as s}from"../Icon/Icon.js";import{IconTypes as c}from"../Icon/type.js";import{Avatar as
|
|
1
|
+
import{__assign as n}from"tslib";import{jsxs as e,jsx as i}from"react/jsx-runtime";import o,{useState as t,useEffect as a}from"react";import{useTranslation as r}from"react-i18next";import{Icon as s}from"../Icon/Icon.js";import{IconTypes as c}from"../Icon/type.js";import{Avatar as m}from"../Avatar/Avatar.js";import{defaultGroupAvatarWork as l,defaultUserAvatar as d}from"../Avatar/default.js";import{Switch as v}from"../Switch/Switch.js";import{useUIKit as h}from"../../context/UIKitContext.js";import{useUIManager as u}from"../../context/UIManagerContext.js";import"../../context/TUIMessageContext.js";import{isH5 as f,isPC as p}from"../../utils/env.js";import{getMessageProfile as g}from"../ConversationPreview/utils.js";import{useConversationUpdate as I}from"../TUIConversationList/hooks/useConversationUpdate.js";import{useConversation as C}from"../../hooks/useConversation.js";function j(){var o=r().t,j=t(),N=j[0],x=j[1],D=t(),U=D[0],k=D[1],w=t(!1),T=w[0],A=w[1],y=t(0),M=y[0],P=y[1],S=h().chat,b=u(),L=b.conversation,K=b.setActiveConversation,z=b.TUIManageShow,B=b.setTUIManageShow;I(void 0,(function(){P((function(n){return n+1}))}));var E=C(S),q=E.pinConversation,F=E.deleteConversation,G=function(){B&&B(!1)};return a((function(){x(L),L&&k(g(L)),A(!!L&&L.isPinned)}),[L,M]),z&&L&&e("div",n({className:"tui-manage ".concat(f?"tui-h5-manage":"")},{children:[e("div",n({className:"tui-manage-title"},{children:[p&&i(s,{onClick:G,type:c.CANCEL,width:9,height:16}),f&&i(s,{onClick:G,type:c.BACK,width:9,height:16}),i("span",n({style:{marginLeft:"10px"}},{children:o("TUIConversation.Conversation Information")}))]})),e("div",n({className:"tui-manage-container"},{children:[e("div",n({className:"tui-manage-info"},{children:[i("div",n({className:"info-avatar"},{children:i(m,{size:64,image:(null==U?void 0:U.avatar)||((null==U?void 0:U.groupID)?l:d)})})),i("div",n({className:"info-name"},{children:(null==U?void 0:U.nick)||(null==U?void 0:U.name)})),e("div",n({className:"info-id"},{children:["ID:",(null==U?void 0:U.userID)||(null==U?void 0:U.groupID)]}))]})),e("div",n({className:"tui-manage-handle"},{children:[e("div",n({className:"manage-handle-box"},{children:[i("div",n({className:"manage-handle-title"},{children:o("TUIConversation.Pin")})),i(v,{onChange:function(n){!function(n){A(n.target.checked),(null==N?void 0:N.conversationID)&&q({conversationID:N.conversationID,isPinned:n.target.checked})}(n)},checked:T})]})),p&&i("div",n({className:"manage-handle-box",role:"presentation",onClick:function(){(null==N?void 0:N.conversationID)&&F(N.conversationID),K(void 0)}},{children:i("div",n({className:"manage-handle-title red"},{children:o("TUIConversation.Delete")}))}))]}))]}))]}))}var N=o.memo(j);export{N as TUIManage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as n,jsxs as t}from"react/jsx-runtime";import r,{useState as o,useRef as c,useCallback as i,useEffect as u}from"react";import{useTUIChatStateContext as a}from"../../context/TUIChatStateContext.js";import{useTUIChatActionContext as s}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{Icon as l}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";function m(r){var m=r.context,p=r.message,v=r.children,f=s().setAudioSource,h=a("MessageAudioWithContext").audioSource,x=o(0),g=x[0],C=x[1],I=c(null),j=o(!1),E=j[0],y=j[1],L=i((function(){h&&h!==(null==I?void 0:I.current)&&(h.pause(),h.currentTime=0,f&&f(null)),(null==I?void 0:I.current)&&(I.current.paused?(I.current.play(),y(!0),f&&f(I.current)):(I.current.pause(),
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as n,jsxs as t}from"react/jsx-runtime";import r,{useState as o,useRef as c,useCallback as i,useEffect as u}from"react";import"@tencentcloud/tui-core";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import{useTUIChatStateContext as a}from"../../context/TUIChatStateContext.js";import{useTUIChatActionContext as s}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{Icon as l}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";function m(r){var m=r.context,p=r.message,v=r.children,f=s().setAudioSource,h=a("MessageAudioWithContext").audioSource,x=o(0),g=x[0],C=x[1],I=c(null),j=o(!1),E=j[0],y=j[1],L=i((function(){h&&h!==(null==I?void 0:I.current)&&(h.pause(),h.currentTime=0,f&&f(null)),(null==I?void 0:I.current)&&(I.current.paused?(I.current.play(),y(!0),f&&f(I.current)):(I.current.pause(),k()))}),[I,h]),T=function(){y(!1)},k=function(){f&&f(null),I.current&&(I.current.currentTime=0),T()};return u((function(){return(null==I?void 0:I.current)&&(I.current.addEventListener("pause",T),I.current.addEventListener("ended",k),I.current.addEventListener("canplay",(function(){var e;C(parseInt("".concat(null===(e=I.current)||void 0===e?void 0:e.duration),10))}))),function(){(null==I?void 0:I.current)&&(I.current.removeEventListener("pause",T),I.current.removeEventListener("ended",k))}}),[I]),t("div",e({className:"message-audio"},{children:[t("div",e({className:"message-audio-content message-audio-".concat(null==p?void 0:p.flow)},{children:[n(l,{className:"".concat(null==p?void 0:p.flow," ").concat(E?"playing":""),type:d.VOICE,width:16,height:16,onClick:L}),n("span",{children:"".concat(g,"s")})]})),n("audio",e({src:null==m?void 0:m.url,ref:I,controls:!0,className:"message-audio-none"},{children:n("track",{kind:"captions"})})),v]}))}var p=r.memo(m);function v(t){return n(p,e({},t))}export{v as MessageAudio};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,Fragment as r}from"react/jsx-runtime";import"tslib";import"react";import{messageShowType as o}from"../../context/TUIMessageContext.js";import{Avatar as
|
|
1
|
+
import{jsx as t,Fragment as r}from"react/jsx-runtime";import"tslib";import"react";import"@tencentcloud/tui-core";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import{messageShowType as o}from"../../context/TUIMessageContext.js";import{Avatar as e}from"../Avatar/Avatar.js";import{handleDisplayAvatar as i}from"../utils.js";function a(a){a.className;var m=a.CustomAvatar,n=a.message,s=a.showType;return(s===o.ALL||(null==n?void 0:n.flow)===s)&&s!==o.NONE?m||t(e,{size:32,image:i(null==n?void 0:n.avatar)}):t(r,{})}export{a as MessageAvatar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as t,jsxs as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import s,{useState as n,useEffect as i}from"react";import l from"@tencentcloud/chat";import{MESSAGE_STATUS as a}from"../../constants.js";import"@tencentcloud/tui-core";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import{useTUIChatStateContext as c}from"../../context/TUIChatStateContext.js";import{useTUIChatActionContext as r}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";import{Icon as m}from"../Icon/Icon.js";import{IconTypes as u}from"../Icon/type.js";import{useMessageReply as d}from"./hooks/useMessageReply.js";import{MessageProgress as g}from"./MessageProgress.js";function p(s){var p=s.message,b=s.children,v=s.Context,f=s.Plugins,h=n(!1),I=h[0],x=h[1],M=d({message:p}),N=M.messageReply,y=M.replyMessage,S=M.sender,D=r(),E=D.setHighlightedMessageId,j=D.setActiveMessageID,C=c("MessageBubbleWithContext").activeMessageID;i((function(){C!==(null==p?void 0:p.ID)&&x(!1)}),[C]);return o("div",e({className:"meesage-bubble"},{children:[o("div",e({className:"meesage-bubble-context ".concat(null==p?void 0:p.flow),role:"button",tabIndex:0,onMouseEnter:function(){j&&p&&j(null==p?void 0:p.ID),x(!0)},onMouseLeave:function(){j&&p&&j(p.ID),x(!1)},onClick:function(){j&&p&&j(p.ID)}},{children:[o("div",e({className:"message-context\n ".concat(N?"meesage-bubble-reply meesage-bubble-reply-".concat(null==p?void 0:p.flow):"","\n ").concat((null==p?void 0:p.type)!==l.TYPES.MSG_IMAGE&&(null==p?void 0:p.type)!==l.TYPES.MSG_VIDEO&&(null==p?void 0:p.type)!==l.TYPES.MSG_FILE||(null==p?void 0:p.status)!==a.UNSEND?"":"loading")},{children:[N&&o("div",e({className:"meesage-bubble-reply-main",role:"menuitem",tabIndex:0,onClick:function(){E&&E(null==y?void 0:y.ID)}},{children:[t("header",e({className:"title"},{children:S})),v&&t(v,{message:y})]})),b,t(g,{message:p})]})),f&&t("div",e({className:"message-plugin"},{children:I&&t(f,{message:p})}))]})),o("div",e({className:"message-bubble-status icon"},{children:[(null==p?void 0:p.status)===a.FAIL&&t("i",{className:"icon-fail"}),(null==p?void 0:p.status)===a.UNSEND&&t(m,{width:10,height:10,type:u.PROGRESS})]}))]}))}var b=s.memo(p);function v(o){return t(b,e({},o))}export{v as MessageBubble};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { Message } from '@tencentcloud/chat';
|
|
3
3
|
|
|
4
4
|
interface MessageContextProps {
|
|
5
5
|
message?: Message;
|
|
6
6
|
}
|
|
7
|
-
declare function MessageContext(props: MessageContextProps):
|
|
7
|
+
declare function MessageContext(props: MessageContextProps): React__default.ReactElement;
|
|
8
8
|
|
|
9
9
|
export { MessageContext, MessageContextProps };
|