@tencentcloud/chat-uikit-react 2.2.4 → 2.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +2 -2
- package/.eslintrc.js +141 -31
- package/.lintstagedrc.json +1 -1
- package/.stylelintrc.js +17 -18
- package/CHANGELOG.md +19 -2
- package/README.md +8 -8
- package/dist/cjs/assets/fonts/iconfont.ttf +0 -0
- package/dist/cjs/assets/fonts/iconfont.woff +0 -0
- package/dist/cjs/assets/fonts/iconfont.woff2 +0 -0
- package/dist/cjs/components/Avatar/Avatar.d.ts +4 -4
- package/dist/cjs/components/Checkbox/index.d.ts +2 -2
- package/dist/cjs/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
- package/dist/cjs/components/ConversationCreate/ConversationCreate.js +1 -1
- package/dist/cjs/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
- package/dist/cjs/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
- package/dist/cjs/components/ConversationPreview/ConversationListContainer.d.ts +2 -2
- package/dist/cjs/components/ConversationPreview/ConversationPreview.d.ts +8 -8
- package/dist/cjs/components/ConversationPreview/ConversationPreview.js +1 -1
- package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.d.ts +2 -2
- package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.js +1 -1
- package/dist/cjs/components/ConversationPreview/utils.js +1 -1
- package/dist/cjs/components/ConversationSearch/ConversationSearchResult.d.ts +3 -3
- package/dist/cjs/components/ConversationSearch/ConversationSearchResult.js +1 -1
- package/dist/cjs/components/Icon/Icon.d.ts +3 -3
- package/dist/cjs/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +4 -4
- package/dist/cjs/components/Input/Input.d.ts +4 -4
- package/dist/cjs/components/Model/index.d.ts +2 -2
- package/dist/cjs/components/Plugins/index.d.ts +4 -4
- package/dist/cjs/components/Popup/index.d.ts +2 -2
- package/dist/cjs/components/Switch/Switch.d.ts +2 -2
- package/dist/cjs/components/TUIChat/TUIChat.d.ts +12 -12
- package/dist/cjs/components/TUIChat/TUIChat.js +1 -1
- package/dist/cjs/components/TUIChatHeader/TUIChatHeader.d.ts +5 -5
- package/dist/cjs/components/TUIChatHeader/TUIChatHeader.js +1 -1
- package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.d.ts +5 -5
- package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContact.d.ts +3 -3
- package/dist/cjs/components/TUIContact/TUIContact.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/TUIContactInfo.d.ts +3 -3
- package/dist/cjs/components/TUIContact/TUIContactInfo/TUIContactInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/basicInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/blockInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/friendApplication.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/groupInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/hooks/useContactInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.d.ts +3 -3
- package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
- package/dist/cjs/components/TUIContact/hooks/useTUIContact.js +1 -1
- package/dist/cjs/components/TUIContactSearch/TUIContactSearch.js +1 -1
- package/dist/cjs/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
- package/dist/cjs/components/TUIConversation/TUIConversation.d.ts +2 -2
- package/dist/cjs/components/TUIConversationList/TUIConversationList.d.ts +6 -6
- package/dist/cjs/components/TUIConversationList/TUIConversationList.js +1 -1
- package/dist/cjs/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
- package/dist/cjs/components/TUIManage/TUIManage.d.ts +2 -2
- package/dist/cjs/components/TUIManage/TUIManage.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageAudio.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageAvatar.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageBubble.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageContext.d.ts +2 -2
- package/dist/cjs/components/TUIMessage/MessageContext.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageCustom.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageName.js +1 -1
- package/dist/cjs/components/TUIMessage/MessagePlugins.d.ts +4 -4
- package/dist/cjs/components/TUIMessage/MessagePlugins.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageProgress.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageRevoke.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageStatus.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageSystem.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageText.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageTip.js +1 -1
- package/dist/cjs/components/TUIMessage/TUIMessage.d.ts +19 -19
- package/dist/cjs/components/TUIMessage/TUIMessage.js +1 -1
- package/dist/cjs/components/TUIMessage/TUIMessageDefault.js +1 -1
- package/dist/cjs/components/TUIMessage/hooks/useMessageHandler.js +1 -1
- package/dist/cjs/components/TUIMessage/hooks/useMessageReply.js +1 -1
- package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.d.ts +2 -2
- package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
- package/dist/cjs/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIForward.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIMessageInput.d.ts +7 -7
- package/dist/cjs/components/TUIMessageInput/TUIMessageInput.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.d.ts +2 -2
- package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useUploadPicker.js +1 -1
- package/dist/cjs/components/TUIMessageList/TUIMessageList.d.ts +2 -2
- package/dist/cjs/components/TUIMessageList/TUIMessageList.js +1 -1
- package/dist/cjs/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
- package/dist/cjs/components/TUIProfile/TUIProfile.d.ts +3 -3
- package/dist/cjs/components/TUIProfile/TUIProfile.js +1 -1
- package/dist/cjs/components/TUIProfile/TUIProfileDefault.d.ts +2 -2
- package/dist/cjs/components/TUIProfile/TUIProfileDefault.js +1 -1
- package/dist/cjs/components/Toast/index.d.ts +2 -2
- package/dist/cjs/context/ComponentContext.d.ts +12 -12
- package/dist/cjs/context/LanguageContext.js +1 -0
- package/dist/cjs/context/TUIChatActionContext.d.ts +3 -3
- package/dist/cjs/context/TUIChatStateContext.d.ts +5 -5
- package/dist/cjs/context/TUIContactContext.d.ts +4 -4
- package/dist/cjs/context/TUIConversationContext.js +1 -1
- package/dist/cjs/context/TUIMessageContext.d.ts +17 -17
- package/dist/cjs/context/TUIMessageInputContext.d.ts +4 -4
- package/dist/cjs/context/ThemeContext.js +1 -0
- package/dist/cjs/context/UIKitContext.d.ts +25 -0
- package/dist/cjs/context/UIKitContext.js +1 -0
- package/dist/cjs/context/UIManagerContext.d.ts +46 -0
- package/dist/cjs/context/UIManagerContext.js +1 -0
- package/dist/cjs/hooks/useConversation.d.ts +2 -2
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.d.css +984 -1039
- package/dist/cjs/index.d.ts +2 -4
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/locales/en-US/TUIGlobal.js +1 -0
- package/dist/cjs/locales/en-US/index.js +1 -1
- package/dist/cjs/locales/ja-JP/TUIGlobal.js +1 -0
- package/dist/cjs/locales/ja-JP/index.js +1 -1
- package/dist/cjs/locales/ko-KR/TUIGlobal.js +1 -0
- package/dist/cjs/locales/ko-KR/index.js +1 -1
- package/dist/cjs/locales/zh-CN/TUIGlobal.js +1 -0
- package/dist/cjs/locales/zh-CN/index.js +1 -1
- package/dist/esm/assets/fonts/iconfont.ttf +0 -0
- package/dist/esm/assets/fonts/iconfont.woff +0 -0
- package/dist/esm/assets/fonts/iconfont.woff2 +0 -0
- package/dist/esm/components/Avatar/Avatar.d.ts +4 -4
- package/dist/esm/components/Checkbox/index.d.ts +2 -2
- package/dist/esm/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
- package/dist/esm/components/ConversationCreate/ConversationCreate.js +1 -1
- package/dist/esm/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
- package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
- package/dist/esm/components/ConversationPreview/ConversationListContainer.d.ts +2 -2
- package/dist/esm/components/ConversationPreview/ConversationPreview.d.ts +8 -8
- package/dist/esm/components/ConversationPreview/ConversationPreview.js +1 -1
- package/dist/esm/components/ConversationPreview/ConversationPreviewContent.d.ts +2 -2
- package/dist/esm/components/ConversationPreview/ConversationPreviewContent.js +1 -1
- package/dist/esm/components/ConversationPreview/utils.js +1 -1
- package/dist/esm/components/ConversationSearch/ConversationSearchResult.d.ts +3 -3
- package/dist/esm/components/ConversationSearch/ConversationSearchResult.js +1 -1
- package/dist/esm/components/Icon/Icon.d.ts +3 -3
- package/dist/esm/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +4 -4
- package/dist/esm/components/Input/Input.d.ts +4 -4
- package/dist/esm/components/Model/index.d.ts +2 -2
- package/dist/esm/components/Plugins/index.d.ts +4 -4
- package/dist/esm/components/Popup/index.d.ts +2 -2
- package/dist/esm/components/Switch/Switch.d.ts +2 -2
- package/dist/esm/components/TUIChat/TUIChat.d.ts +12 -12
- package/dist/esm/components/TUIChat/TUIChat.js +1 -1
- package/dist/esm/components/TUIChatHeader/TUIChatHeader.d.ts +5 -5
- package/dist/esm/components/TUIChatHeader/TUIChatHeader.js +1 -1
- package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.d.ts +5 -5
- package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
- package/dist/esm/components/TUIContact/TUIContact.d.ts +3 -3
- package/dist/esm/components/TUIContact/TUIContact.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/TUIContactInfo.d.ts +3 -3
- package/dist/esm/components/TUIContact/TUIContactInfo/TUIContactInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/basicInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/blockInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/friendApplication.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/groupInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/hooks/useContactInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.d.ts +3 -3
- package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
- package/dist/esm/components/TUIContact/hooks/useTUIContact.js +1 -1
- package/dist/esm/components/TUIContactSearch/TUIContactSearch.js +1 -1
- package/dist/esm/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
- package/dist/esm/components/TUIConversation/TUIConversation.d.ts +2 -2
- package/dist/esm/components/TUIConversationList/TUIConversationList.d.ts +6 -6
- package/dist/esm/components/TUIConversationList/TUIConversationList.js +1 -1
- package/dist/esm/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
- package/dist/esm/components/TUIManage/TUIManage.d.ts +2 -2
- package/dist/esm/components/TUIManage/TUIManage.js +1 -1
- package/dist/esm/components/TUIMessage/MessageAudio.js +1 -1
- package/dist/esm/components/TUIMessage/MessageAvatar.js +1 -1
- package/dist/esm/components/TUIMessage/MessageBubble.js +1 -1
- package/dist/esm/components/TUIMessage/MessageContext.d.ts +2 -2
- package/dist/esm/components/TUIMessage/MessageContext.js +1 -1
- package/dist/esm/components/TUIMessage/MessageCustom.js +1 -1
- package/dist/esm/components/TUIMessage/MessageName.js +1 -1
- package/dist/esm/components/TUIMessage/MessagePlugins.d.ts +4 -4
- package/dist/esm/components/TUIMessage/MessagePlugins.js +1 -1
- package/dist/esm/components/TUIMessage/MessageProgress.js +1 -1
- package/dist/esm/components/TUIMessage/MessageRevoke.js +1 -1
- package/dist/esm/components/TUIMessage/MessageStatus.js +1 -1
- package/dist/esm/components/TUIMessage/MessageSystem.js +1 -1
- package/dist/esm/components/TUIMessage/MessageText.js +1 -1
- package/dist/esm/components/TUIMessage/MessageTip.js +1 -1
- package/dist/esm/components/TUIMessage/TUIMessage.d.ts +19 -19
- package/dist/esm/components/TUIMessage/TUIMessage.js +1 -1
- package/dist/esm/components/TUIMessage/TUIMessageDefault.js +1 -1
- package/dist/esm/components/TUIMessage/hooks/useMessageHandler.js +1 -1
- package/dist/esm/components/TUIMessage/hooks/useMessageReply.js +1 -1
- package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.d.ts +2 -2
- package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
- package/dist/esm/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIForward.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIMessageInput.d.ts +7 -7
- package/dist/esm/components/TUIMessageInput/TUIMessageInput.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.d.ts +2 -2
- package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useUploadPicker.js +1 -1
- package/dist/esm/components/TUIMessageList/TUIMessageList.d.ts +2 -2
- package/dist/esm/components/TUIMessageList/TUIMessageList.js +1 -1
- package/dist/esm/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
- package/dist/esm/components/TUIProfile/TUIProfile.d.ts +3 -3
- package/dist/esm/components/TUIProfile/TUIProfile.js +1 -1
- package/dist/esm/components/TUIProfile/TUIProfileDefault.d.ts +2 -2
- package/dist/esm/components/TUIProfile/TUIProfileDefault.js +1 -1
- package/dist/esm/components/Toast/index.d.ts +2 -2
- package/dist/esm/context/ComponentContext.d.ts +12 -12
- package/dist/esm/context/LanguageContext.js +1 -0
- package/dist/esm/context/TUIChatActionContext.d.ts +3 -3
- package/dist/esm/context/TUIChatStateContext.d.ts +5 -5
- package/dist/esm/context/TUIContactContext.d.ts +4 -4
- package/dist/esm/context/TUIConversationContext.js +1 -1
- package/dist/esm/context/TUIMessageContext.d.ts +17 -17
- package/dist/esm/context/TUIMessageInputContext.d.ts +4 -4
- package/dist/esm/context/ThemeContext.js +1 -0
- package/dist/esm/context/UIKitContext.d.ts +25 -0
- package/dist/esm/context/UIKitContext.js +1 -0
- package/dist/esm/context/UIManagerContext.d.ts +46 -0
- package/dist/esm/context/UIManagerContext.js +1 -0
- package/dist/esm/hooks/useConversation.d.ts +2 -2
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.d.css +984 -1039
- package/dist/esm/index.d.ts +2 -4
- package/dist/esm/index.js +1 -1
- package/dist/esm/locales/en-US/TUIGlobal.js +1 -0
- package/dist/esm/locales/en-US/index.js +1 -1
- package/dist/esm/locales/ja-JP/TUIGlobal.js +1 -0
- package/dist/esm/locales/ja-JP/index.js +1 -1
- package/dist/esm/locales/ko-KR/TUIGlobal.js +1 -0
- package/dist/esm/locales/ko-KR/index.js +1 -1
- package/dist/esm/locales/zh-CN/TUIGlobal.js +1 -0
- package/dist/esm/locales/zh-CN/index.js +1 -1
- package/package.json +9 -7
- package/rollup.config.js +13 -2
- package/src/assets/fonts/iconfont.ttf +0 -0
- package/src/assets/fonts/iconfont.woff +0 -0
- package/src/assets/fonts/iconfont.woff2 +0 -0
- package/src/components/ConversationCreate/ConversationCreatGroupDetail.tsx +4 -4
- package/src/components/ConversationCreate/ConversationCreate.tsx +2 -2
- package/src/components/ConversationCreate/ConversationCreateUserSelectList.tsx +3 -2
- package/src/components/ConversationCreate/styles/ConversationCreatGroupDetail.scss +16 -7
- package/src/components/ConversationCreate/styles/index.scss +23 -13
- package/src/components/ConversationPreview/ConversationPreview.tsx +21 -21
- package/src/components/ConversationPreview/ConversationPreviewContent.tsx +4 -4
- package/src/components/ConversationPreview/styles/index.scss +44 -14
- package/src/components/ConversationPreview/utils.tsx +36 -28
- package/src/components/Input/styles/index.scss +7 -5
- package/src/components/Model/styles/layout.scss +3 -3
- package/src/components/Plugins/styles/color.scss +17 -3
- package/src/components/Popup/styles/layout.scss +2 -1
- package/src/components/TUIChat/TUIChat.tsx +4 -3
- package/src/components/TUIChatHeader/TUIChatHeaderDefault.tsx +3 -3
- package/src/components/TUIChatHeader/styles/layout.scss +13 -2
- package/src/components/TUIContact/TUIContact.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/TUIContactInfo.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/basicInfo.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/blockInfo.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/friendApplication.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/friendInfo.tsx +4 -3
- package/src/components/TUIContact/TUIContactInfo/groupInfo.tsx +3 -3
- package/src/components/TUIContact/TUIContactInfo/hooks/useContactInfo.tsx +2 -2
- package/src/components/TUIContact/TUIContactList/TUIContactList.tsx +5 -5
- package/src/components/TUIContact/hooks/useTUIContact.tsx +2 -2
- package/src/components/TUIContactSearch/TUIContactSearch.tsx +2 -2
- package/src/components/TUIContactSearch/hooks/useContactSearch.tsx +2 -2
- package/src/components/TUIConversationList/TUIConversationList.tsx +3 -4
- package/src/components/TUIConversationList/hooks/useConversationUpdate.tsx +2 -2
- package/src/components/TUIConversationList/index.scss +25 -7
- package/src/components/TUIManage/TUIManage.tsx +3 -3
- package/src/components/TUIManage/styles/index.scss +16 -6
- package/src/components/TUIMessage/MessageStatus.tsx +2 -2
- package/src/components/TUIMessage/MessageText.tsx +16 -15
- package/src/components/TUIMessage/hooks/useMessageHandler.ts +2 -2
- package/src/components/TUIMessage/hooks/useMessageReply.ts +2 -2
- package/src/components/TUIMessage/styles/color.scss +20 -9
- package/src/components/TUIMessage/styles/layout.scss +44 -11
- package/src/components/TUIMessageInput/TUIMessageInput.tsx +1 -1
- package/src/components/TUIMessageInput/hooks/useHandleForwardMessage.tsx +2 -2
- package/src/components/TUIMessageInput/hooks/useMessageInputText.tsx +2 -2
- package/src/components/TUIMessageInput/styles/color.scss +25 -6
- package/src/components/TUIMessageInput/styles/layout.scss +58 -16
- package/src/components/TUIMessageList/hooks/useMessageListElement.tsx +2 -2
- package/src/components/TUIMessageList/styles/layout.scss +16 -2
- package/src/components/TUIProfile/TUIProfile.tsx +3 -3
- package/src/components/TUIProfile/TUIProfileDefault.tsx +2 -2
- package/src/components/TUIProfile/styles/layout.scss +33 -16
- package/src/components/index.ts +0 -1
- package/src/context/LanguageContext.tsx +59 -0
- package/src/context/ThemeContext.tsx +61 -0
- package/src/context/UIKitContext.tsx +67 -0
- package/src/context/UIManagerContext.tsx +163 -0
- package/src/context/index.ts +3 -2
- package/src/locales/en-US/index.ts +1 -1
- package/src/locales/ja-JP/index.ts +2 -0
- package/src/locales/ko-KR/TUIGlobal.ts +2 -2
- package/src/locales/ko-KR/index.ts +2 -0
- package/src/locales/zh-CN/index.ts +2 -2
- package/src/styles/colors/_color-dark.scss +35 -0
- package/src/styles/colors/_color-light.scss +35 -0
- package/src/styles/colors/_color-theme.scss +54 -0
- package/src/styles/fonts/icon-font.scss +18 -0
- package/src/styles/index.scss +4 -0
- package/src/styles/normalize.scss +355 -0
- package/dist/cjs/components/Icon/images/chats-selected.svg.js +0 -1
- package/dist/cjs/components/Icon/images/chats.svg.js +0 -1
- package/dist/cjs/components/Icon/images/contacts-selected.svg.js +0 -1
- package/dist/cjs/components/Icon/images/contacts.svg.js +0 -1
- package/dist/cjs/components/TUIKit/TUIKit.d.ts +0 -12
- package/dist/cjs/components/TUIKit/TUIKit.js +0 -1
- package/dist/cjs/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +0 -21
- package/dist/cjs/components/TUIKit/hooks/useCreateTUIKitContext.js +0 -1
- package/dist/cjs/components/TUIKit/hooks/useTUIKit.d.ts +0 -43
- package/dist/cjs/components/TUIKit/hooks/useTUIKit.js +0 -1
- package/dist/cjs/context/TUIKitContext.d.ts +0 -25
- package/dist/cjs/context/TUIKitContext.js +0 -1
- package/dist/esm/components/Icon/images/chats-selected.svg.js +0 -1
- package/dist/esm/components/Icon/images/chats.svg.js +0 -1
- package/dist/esm/components/Icon/images/contacts-selected.svg.js +0 -1
- package/dist/esm/components/Icon/images/contacts.svg.js +0 -1
- package/dist/esm/components/TUIKit/TUIKit.d.ts +0 -12
- package/dist/esm/components/TUIKit/TUIKit.js +0 -1
- package/dist/esm/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +0 -21
- package/dist/esm/components/TUIKit/hooks/useCreateTUIKitContext.js +0 -1
- package/dist/esm/components/TUIKit/hooks/useTUIKit.d.ts +0 -43
- package/dist/esm/components/TUIKit/hooks/useTUIKit.js +0 -1
- package/dist/esm/context/TUIKitContext.d.ts +0 -25
- package/dist/esm/context/TUIKitContext.js +0 -1
- package/src/components/TUIKit/TUIKit.tsx +0 -228
- package/src/components/TUIKit/hooks/useCreateTUIKitContext.tsx +0 -48
- package/src/components/TUIKit/hooks/useTUIKit.tsx +0 -99
- package/src/components/TUIKit/index.ts +0 -3
- package/src/components/TUIKit/styles/h5.scss +0 -34
- package/src/components/TUIKit/styles/index.scss +0 -112
- package/src/components/TUIKit/styles/reset.scss +0 -67
- package/src/context/TUIKitContext.tsx +0 -39
|
@@ -1,15 +1,15 @@
|
|
|
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
11
|
}
|
|
12
|
-
declare function UnMemoizedTUIChatHeader<T extends TUIChatHeaderProps>(props: PropsWithChildren<T>):
|
|
12
|
+
declare function UnMemoizedTUIChatHeader<T extends TUIChatHeaderProps>(props: PropsWithChildren<T>): React__default.ReactElement;
|
|
13
13
|
declare const TUIChatHeader: typeof UnMemoizedTUIChatHeader;
|
|
14
14
|
|
|
15
15
|
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,s=o("TUIChatHeader").conversation,x=a().TUIChatHeader;return t(m||x||r,{title:n,conversation:i||s,avatar:c,opateIcon:p})}var i=e.memo(n);export{i as TUIChatHeader};
|
|
@@ -1,17 +1,17 @@
|
|
|
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?: Array<
|
|
9
|
+
pluginComponentList?: Array<React__default.ComponentType>;
|
|
10
10
|
}
|
|
11
11
|
interface TUIChatHeaderBasicProps extends TUIChatHeaderDefaultProps {
|
|
12
12
|
isLive?: boolean;
|
|
13
|
-
opateIcon?:
|
|
13
|
+
opateIcon?: React__default.ReactElement | string;
|
|
14
14
|
}
|
|
15
|
-
declare function TUIChatHeaderDefault(props: TUIChatHeaderBasicProps):
|
|
15
|
+
declare function TUIChatHeaderDefault(props: TUIChatHeaderBasicProps): React__default.ReactElement;
|
|
16
16
|
|
|
17
17
|
export { TUIChatHeaderBasicProps, TUIChatHeaderDefault, TUIChatHeaderDefaultProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as t,jsxs as i}from"react/jsx-runtime";import
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as t,jsxs as i}from"react/jsx-runtime";import r,{useState as o,useEffect as a}from"react";import n from"@tencentcloud/chat";import{TUIConversationService as c}from"@tencentcloud/chat-uikit-engine";import{Avatar as l}from"../Avatar/Avatar.js";import{handleDisplayAvatar as s}from"../untils.js";import{isH5 as m}from"../../utils/env.js";import{Icon as d}from"../Icon/Icon.js";import{IconTypes as h}from"../Icon/type.js";import"@tencentcloud/tui-core";import"react-i18next";import{useUIManager as u}from"../../context/UIManagerContext.js";import"../../context/TUIMessageContext.js";function v(r){var v=r.title,p=void 0===v?"":v,f=r.avatar;r.isOnline;var C=r.conversation,S=r.isLive,N=r.opateIcon,g=u().setActiveContact,E=o(p),I=E[0],P=E[1],T=o(""),y=T[0],O=T[1];a((function(){switch(P(p),f&&O(f),null==C?void 0:C.type){case n.TYPES.CONV_C2C:Y(C.userProfile,null==C?void 0:C.remark);break;case n.TYPES.CONV_GROUP:j(C.groupProfile);break;case n.TYPES.CONV_SYSTEM:P("System Notice");break;default:P("")}}),[C]);var Y=function(e,i){I||P(i||(null==e?void 0:e.nick)||(null==e?void 0:e.userID)),f||O(t(l,{size:32,image:s(e.avatar)}))},j=function(e){I||P((null==e?void 0:e.name)||(null==e?void 0:e.groupID)),f||O(t(l,{size:32,image:s(e.avatar,n.TYPES.CONV_GROUP)}))},k=u().setTUIManageShow;return i("header",e({className:"tui-chat-header ".concat(S?"tui-chat-live-header":"")},{children:[m&&t("div",e({style:{paddingRight:"10px"}},{children:t(d,{onClick:function(){c.switchConversation(""),g()},type:h.BACK,width:9,height:16})})),t("div",e({className:"tui-chat-header-left ".concat((null==C?void 0:C.type)===n.TYPES.CONV_SYSTEM?"system":"")},{children:(null==C?void 0:C.type)!==n.TYPES.CONV_SYSTEM&&y})),t("div",e({className:"header-content"},{children:t("h3",e({className:"title"},{children:I}))})),t("div",e({className:"tui-chat-header-right"},{children:t("div",e({className:"header-handle"},{children:N||t(d,{className:"header-handle-more",onClick:function(){k&&k(!0)},type:h.ELLIPSE,width:18,height:5})}))}))]}),null==C?void 0:C.conversationID)}var p=r.memo(v);function f(i){var r=e({},i);return t(p,e({},r))}export{f 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 o,Fragment as
|
|
1
|
+
import{__assign as t}from"tslib";import{jsxs as i,jsx as o,Fragment as e}from"react/jsx-runtime";import n,{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 p from"../TUIContactInfo/hooks/useContactInfo.js";import u from"../hooks/useTUIContact.js";import{Avatar as d}from"../../Avatar/Avatar.js";import{defaultUserAvatar as f}from"../../Avatar/default.js";import h from"../../Icon/images/right-arrow.svg.js";import v from"../../Icon/images/down-arrow.png.js";function I(){var n=l().setActiveContact,I=a().t,C=m("TUIContactList"),N=C.isShowContactList,g=C.friendList,x=C.blocklistProfile,T=C.friendApplicationList,S=p().acceptFriendApplication,b=u().groupList,w=c(!1),k=w[0],A=w[1],U=c(!1),j=U[0],L=U[1],P=c(!1),_=P[0],y=P[1],E=c(!1),M=E[0],D=E[1],O=function(c){var a=c.type,s=c.isShow,r=c.setShow,l=c.list,m=c.title;return i(e,{children:[i("div",t({className:"tui-contacts-title",role:"button",tabIndex:0,onClick:function(){return r(!s)}},{children:[o("div",t({className:"tui-contacts-list-title"},{children:m})),o("div",t({className:"tui-contacts-list-icon"},{children:o("img",{src:s?v:h,alt:""})}))]})),s&&(null==l?void 0:l.map((function(e){var c=e.profile||e,s=c.userID,r=c.groupID,l=c.avatar,m=c.name,p=c.nick,u=e.remark||p||s||m||r;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(){n({type:a,data:e})}},{children:[o(d,{size:30,image:l||f}),o("div",t({className:"tui-contacts-list-item-container"},{children:o("p",t({className:"tui-contacts-list-item-name"},{children:u}))}))]}),s||r)})))]})};return N&&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 A(!k)}},{children:[o("p",t({className:"tui-contacts-list-title"},{children:I("TUIContact.New Contacts")})),o("div",t({className:"tui-contacts-list-icon"},{children:o("img",{src:k?v:h,alt:""})}))]})),k&&(null==T?void 0:T.map((function(e,c){var a=e.userID,r=e.avatar,l=e.nick,m=e.wording,p=e.type;return i("div",t({role:"button",tabIndex:0,className:"tui-contacts-list-item",onClick:function(t){t.stopPropagation(),n({type:"friendApplication",data:e})}},{children:[o(d,{size:30,image:r||f}),i("div",t({className:"tui-contacts-list-item-card"},{children:[i("div",{children:[o("p",t({className:"tui-contacts-list-item-name text-ellipsis"},{children:l||a})),""!==m&&o("p",t({className:"tui-contacts-list-item-text text-ellipsis"},{children:m}))]}),p===s.TYPES.SNS_APPLICATION_SENT_BY_ME&&o("p",t({className:"tui-contacts-list-btn-text text-ellipsis"},{children:I("TUIContact.waiting for verification")})),p===s.TYPES.SNS_APPLICATION_SENT_TO_ME&&o("div",t({className:"application-btn",role:"button",tabIndex:0,onClick:function(t){!function(t,i){t.stopPropagation(),S(i),n()}(t,a)}},{children:I("TUIContact.Agree")}))]}))]}),a)}))),o(O,{type:"block",title:I("TUIContact.Blocked List"),isShow:_,setShow:y,list:x}),o(O,{type:"group",title:I("TUIContact.Group List"),setShow:D,isShow:M,list:b}),o(O,{type:"friend",title:I("TUIContact.Friends"),setShow:L,isShow:j,list:g})]}))}var C=n.memo(I);export{C as TUIContactList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as n}from"tslib";import{useState as i,useEffect as r}from"react";import o from"@tencentcloud/chat";import{TUIStore as e,StoreName as c}from"@tencentcloud/chat-uikit-engine";import{
|
|
1
|
+
import{__awaiter as t,__generator as n}from"tslib";import{useState as i,useEffect as r}from"react";import o 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([]),f=l[0],d=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];r((function(){e.watch(c.GRP,{groupList:C}),U(),_(),N()}),[s]);var C=function(t){P(t)};r((function(){null==s||s.on(o.EVENT.BLACKLIST_UPDATED,F),null==s||s.on(o.EVENT.FRIEND_LIST_UPDATED,j),null==s||s.on(o.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,r;return n(this,(function(n){switch(n.label){case 0:return[4,s.getFriendList()];case 1:return t=n.sent(),i=t.code,r=t.data,0===i&&d(r),[2]}}))}))},_=function(){return t(u,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,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){d(t.data)};return{friendList:f,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"../untils.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 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import o from"react";import
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import o from"react";import m from"@tencentcloud/chat";import{MessageAudio as s}from"./MessageAudio.js";import{MessageCustom as r}from"./MessageCustom.js";import{MessageFace as i}from"./MessageFace.js";import{MessageFile as n}from"./MessageFile.js";import{MessageImage as E}from"./MessageImage.js";import{MessageLocation as M}from"./MessageLocation.js";import{MessageMerger as S}from"./MessageMerger.js";import{MessageText as a}from"./MessageText.js";import{MessageVideo as p}from"./MessageVideo.js";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import"../../constants.js";import"date-fns";import"date-fns/locale";import"../Icon/config.js";import"../Icon/type.js";import"@tencentcloud/tui-core";import{useTUIMessageContext as T}from"../../context/TUIMessageContext.js";import{useMessageContextHandler as c}from"./hooks/useMessageContextHandler.js";import{MessageStatus as g}from"./MessageStatus.js";var G,f=((G={})[m.TYPES.MSG_TEXT]=a,G[m.TYPES.MSG_FACE]=i,G[m.TYPES.MSG_IMAGE]=E,G[m.TYPES.MSG_AUDIO]=s,G[m.TYPES.MSG_VIDEO]=p,G[m.TYPES.MSG_FILE]=n,G[m.TYPES.MSG_CUSTOM]=r,G[m.TYPES.MSG_MERGER]=S,G[m.TYPES.MSG_LOCATION]=M,G);function l(o){var s,r=o.message,i=c({message:r}).context,n=T("MessageCustom"),E=n.CustemElement,M=n.TextElement,S=n.FaceElement,a=n.ImageElement,p=n.AudioElement,G=n.VideoElement,l=n.FileElement,u=n.MergerElement,P=n.LocationElement,Y=((s={})[m.TYPES.MSG_TEXT]=M,s[m.TYPES.MSG_FACE]=S,s[m.TYPES.MSG_IMAGE]=a,s[m.TYPES.MSG_AUDIO]=p,s[m.TYPES.MSG_VIDEO]=G,s[m.TYPES.MSG_FILE]=l,s[m.TYPES.MSG_CUSTOM]=E,s[m.TYPES.MSG_MERGER]=u,s[m.TYPES.MSG_LOCATION]=P,s),_=(null==r?void 0:r.type)&&(Y[r.type]||f[r.type]);return _&&t(_,e({context:i,message:r},{children:t(g,{message:r})}))}var u=o.memo(l);function P(o){return t(u,e({},o))}export{P as MessageContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e,jsxs as n,Fragment as r}from"react/jsx-runtime";import o from"react";import l from"@tencentcloud/chat";import{useTranslation as i}from"react-i18next";import{JSONStringToParse as u}from"../untils.js";import"@tencentcloud/tui-core";import"@tencentcloud/chat-uikit-engine";import"../../context/TUIMessageContext.js";import{useComponentContext as a}from"../../context/ComponentContext.js";function c(o){var c=o.context,m=o.message,s=o.children,d=i().t,v=a().MessageCustomPlugins;return n("div",t({className:"bubble message-custom bubble-".concat(null==m?void 0:m.flow," ").concat((null==m?void 0:m.conversationType)===l.TYPES.CONV_GROUP?"group":"")},{children:[function(o){if("Hyperlink"===o.data){var l=u(null==o?void 0:o.extension);if(null==l?void 0:l.item)return null==l?void 0:l.item.map((function(n){return e("a",t({target:"_blank",href:n.value,rel:"noreferrer"},{children:n.value}),n.value)}));if(null==l?void 0:l.hyperlinks_text){var i=l.hyperlinks_text;return n(r,{children:[l.title," ",e("a",t({target:"_blank",href:null==i?void 0:i.value,rel:"noreferrer"},{children:i.key}),null==i?void 0:i.value)]})}}if("group_create"===o.data)return"".concat((null==m?void 0:m.nick)||(null==m?void 0:m.from)," Create a group");var a=u(o.data);return 1!==(null==a?void 0:a.chatbotPlugin)||15!==(null==a?void 0:a.src)||"welcome_msg"!==(null==a?void 0:a.subtype)&&"clarify_msg"!==(null==a?void 0:a.subtype)?"[".concat(d("TUIChat.Custom message"),"]"):e(v,{data:u(o.data).content})}(null==c?void 0:c.custom),s]}))}var m=o.memo(c);function s(n){return e(m,t({},n))}export{s as MessageCustom};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e,Fragment as o}from"react/jsx-runtime";import n from"@tencentcloud/chat";import"react";import"@tencentcloud/tui-core";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import{messageShowType as i}from"../../context/TUIMessageContext.js";function r(r){r.className;var l=r.CustomName,m=r.message,c=r.showType;return(c===i.ALL||(null==m?void 0:m.flow)===c)&&(null==m?void 0:m.conversationType)===n.TYPES.CONV_GROUP&&c!==i.NONE?l||e("label",t({htmlFor:"content",className:"text-ellipsis name"},{children:(null==m?void 0:m.nick)||(null==m?void 0:m.from)})):e(o,{})}export{r as MessageName};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import React__default, { PropsWithChildren } from 'react';
|
|
2
|
+
import _tencentcloud_chat from '@tencentcloud/chat';
|
|
3
3
|
import { PluginsProps } from '../Plugins/index.js';
|
|
4
4
|
|
|
5
5
|
declare enum PluginsNameEnum {
|
|
@@ -13,12 +13,12 @@ declare enum PluginsNameEnum {
|
|
|
13
13
|
type MessagePluginConfigProps = {
|
|
14
14
|
[propsName in PluginsNameEnum]?: {
|
|
15
15
|
isShow?: boolean;
|
|
16
|
-
relateMessageType?:
|
|
16
|
+
relateMessageType?: _tencentcloud_chat.TYPES[];
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
interface MessagePluginsProps extends PluginsProps {
|
|
20
20
|
config?: MessagePluginConfigProps;
|
|
21
21
|
}
|
|
22
|
-
declare function MessagePlugins<T extends MessagePluginsProps>(props: PropsWithChildren<T>):
|
|
22
|
+
declare function MessagePlugins<T extends MessagePluginsProps>(props: PropsWithChildren<T>): React__default.ReactElement;
|
|
23
23
|
|
|
24
24
|
export { MessagePluginConfigProps, MessagePlugins, MessagePluginsProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as o,jsx as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as o,jsx as l}from"react/jsx-runtime";import{useState as s,useRef as i}from"react";import{useTranslation as n}from"react-i18next";import t from"@tencentcloud/chat";import{Plugins as r}from"../Plugins/index.js";import{Icon as a}from"../Icon/Icon.js";import{IconTypes as d}from"../Icon/type.js";import"@tencentcloud/tui-core";import"@tencentcloud/chat-uikit-engine";import{useTUIChatStateContext as u}from"../../context/TUIChatStateContext.js";import{useTUIMessageContext as c}from"../../context/TUIMessageContext.js";import{useMessageHandler as h}from"./hooks/useMessageHandler.js";import{MESSAGE_STATUS as v,MESSAGE_FLOW as g}from"../../constants.js";import"date-fns";import"date-fns/locale";import{useMessagePluginElement as p}from"./hooks/useMessagePluginElement.js";var m;function f(m){var f,M,S,w,y,C,T=m.plugins,U=m.showNumber,x=m.MoreIcon,E=m.config,I=n().t,N=s(""),R=N[0];N[1];var k=s({}),j=k[0],b=k[1],q=i(),O=c("MessagePlugins"),P=O.message,D=O.plugin,F=u("MessageBubbleWithContext").messageListRef,L=h({message:P}),W=L.handleDelMessage,Y=L.handleRevokeMessage,A=L.handleReplyMessage,V=L.handleCopyMessage,B=L.handleResendMessage,G=L.handleForWardMessage,H={quote:e(e({isShow:!0},null==E?void 0:E.quote),null===(f=null==D?void 0:D.config)||void 0===f?void 0:f.quote),forward:e(e({isShow:!0},null==E?void 0:E.forward),null===(M=null==D?void 0:D.config)||void 0===M?void 0:M.forward),copy:e(e({isShow:!0,relateMessageType:[t.TYPES.MSG_TEXT]},null==E?void 0:E.copy),null===(S=null==D?void 0:D.config)||void 0===S?void 0:S.copy),delete:e(e({isShow:!0},null==E?void 0:E.delete),null===(w=null==D?void 0:D.config)||void 0===w?void 0:w.delete),revoke:e(e({isShow:!0},null==E?void 0:E.revoke),null===(y=null==D?void 0:D.config)||void 0===y?void 0:y.revoke),resend:e(e({isShow:!0},null==E?void 0:E.resend),null===(C=null==D?void 0:D.config)||void 0===C?void 0:C.resend)},Q=p({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:I("TUIChat.Recall")}),l(a,{width:20,height:20,type:d.REVOCATION})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),Y(e)},message:P,isShow:H.revoke.isShow&&(null==P?void 0:P.status)===v.SUCCESS&&P.flow===g.OUT,relateMessageType:H.revoke.relateMessageType}),X=p({children:o("div",e({className:"message-plugin-item"},{children:[l("span",e({className:"del"},{children:I("TUIChat.Delete")})),l(a,{width:20,height:20,type:d.DEL})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),W(e)},message:P,isShow:H.delete.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.delete.relateMessageType}),_=p({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:I("TUIChat.Reference")}),l(a,{width:20,height:20,type:d.QUOTE})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),A(e)},message:P,isShow:H.quote.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.quote.relateMessageType}),z=p({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:I("TUIChat.Copy")}),l(a,{width:20,height:20,type:d.COPY})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),V(e)},message:P,isShow:H.copy.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.copy.relateMessageType}),J=p({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:I("TUIChat.Resend")}),l(a,{width:20,height:20,type:d.REPLY})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),B()},message:P,isShow:H.resend.isShow&&(null==P?void 0:P.status)!==v.SUCCESS,relateMessageType:H.resend.relateMessageType}),K=p({children:o("div",e({className:"message-plugin-item"},{children:[l("span",{children:I("TUIChat.Forward")}),l(a,{width:20,height:20,type:d.FORWARD})]})),handle:function(e){var o;(null===(o=null==q?void 0:q.current)||void 0===o?void 0:o.closeMore)&&q.current.closeMore(),G(e)},message:P,isShow:H.forward.isShow&&(null==P?void 0:P.status)===v.SUCCESS,relateMessageType:H.forward.relateMessageType}),Z=[Q,_,K,X,J,z],$=(T||(null==D?void 0:D.plugins)||Z).filter((function(e){return e})),ee=x||(null==D?void 0:D.MoreIcon)||l(a,{className:"icon-more",width:16,height:16,type:d.MORE}),oe=U||(null==D?void 0:D.showNumber)||0;return(null==P?void 0:P.status)!==v.UNSEND&&l(r,{className:"message-plugin",customClass:R,style:j,ref:q,plugins:$,showNumber:oe,MoreIcon:ee,root:null==F?void 0:F.current,handleVisible:function(e){if(e.x&&e.y){var o=e.y<e.height||e.top,l=e.x<e.width||e.left;b({position:"fixed",left:"".concat(l?e.x:e.x-e.width,"px"),top:"".concat(o?e.y:e.y-e.height,"px")})}}})}!function(e){e.quote="quote",e.forward="forward",e.copy="copy",e.delete="delete",e.resend="resend",e.revoke="revoke"}(m||(m={}));export{f as MessagePlugins};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e,Fragment as o,jsxs as r}from"react/jsx-runtime";import s,{useState as n,useEffect as i}from"react";import a from"@tencentcloud/chat";import{MESSAGE_STATUS as c}from"../../constants.js";import"@tencentcloud/tui-core";import"react-i18next";import"@tencentcloud/chat-uikit-engine";import{useTUIChatStateContext as l}from"../../context/TUIChatStateContext.js";import{useTUIMessageContext as m}from"../../context/TUIMessageContext.js";function u(s){var u=s.message,p=s.children,d=s.Progress,g=s.isShow,v=void 0!==g&&g,f=n(),h=f[0],x=f[1],S=n(0),P=S[0],M=S[1],E=l("MessageProgressWithContext").uploadPendingMessageList,I=m("MessageProgressWithContext"),C=I.isShowProgress,T=void 0!==C&&C,j=I.Progress,y=d||j,D=v||T;return i((function(){E&&E.length>0&&E.map((function(t){return(null==t?void 0:t.ID)===(null==u?void 0:u.ID)&&(x(t),(null==t?void 0:t.progress)&&M(t.progress)),t}))}),[E]),D?y&&h?e(y,{message:h}):!((null==u?void 0:u.type)!==a.TYPES.MSG_IMAGE&&(null==u?void 0:u.type)!==a.TYPES.MSG_VIDEO&&(null==u?void 0:u.type)!==a.TYPES.MSG_FILE||(null==u?void 0:u.status)!==c.UNSEND)&&r("div",t({className:"progress-box"},{children:[e("span",{className:"progress",style:{width:"".concat(100*P,"%")}}),p]})):e(o,{})}var p=s.memo(u);function d(o){return e(p,t({},o))}export{d as MessageProgress};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsx as e,jsxs as o}from"react/jsx-runtime";import n,{useCallback as r}from"react";import{useTranslation as i}from"react-i18next";import a from"@tencentcloud/chat";import{MESSAGE_OPERATE as l,MESSAGE_FLOW as s}from"../../constants.js";import{useTUIChatActionContext as m}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";function c(n){var c=n.message,
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e,jsxs as o}from"react/jsx-runtime";import n,{useCallback as r}from"react";import{useTranslation as i}from"react-i18next";import a from"@tencentcloud/chat";import{MESSAGE_OPERATE as l,MESSAGE_FLOW as s}from"../../constants.js";import"@tencentcloud/tui-core";import"@tencentcloud/chat-uikit-engine";import{useTUIChatActionContext as m}from"../../context/TUIChatActionContext.js";import"../../context/TUIMessageContext.js";function c(n){var c=n.message,u=i().t,d=m().operateMessage,p=r((function(){var t;d&&c&&d(((t={})[l.REVOKE]=c,t))}),[d]);return o("div",t({className:"bubble message-system message-revoke"},{children:[(null==c?void 0:c.flow)===s.IN&&e("span",{children:(null==c?void 0:c.nick)||(null==c?void 0:c.from)}),(null==c?void 0:c.flow)!==s.IN&&e("span",t({style:{marginRight:"5px"}},{children:u("TUIChat.You")})),e("span",t({style:{marginRight:"5px"}},{children:u("TUIChat.recalled a message")})),(null==c?void 0:c.flow)===s.OUT&&(null==c?void 0:c.type)===a.TYPES.MSG_TEXT&&e("span",t({className:"edit",role:"button",tabIndex:0,onClick:p},{children:u("TUIChat.Re-edit")}))]}))}var u=n.memo(c);function d(o){return e(u,t({},o))}export{d as MessageRevoke};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import i from"react";import{
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import i from"react";import{useUIKit as o}from"../../context/UIKitContext.js";import"@tencentcloud/chat-uikit-engine";import{useTUIMessageContext as r}from"../../context/TUIMessageContext.js";import{getTimeStamp as m}from"../untils.js";function s(i){var s=i.message,n=o().language,a=r("MessageStatustWithContext").isShowTime,c=(void 0===a||a)&&e("div",t({className:"time"},{children:(null==s?void 0:s.time)?m(1e3*s.time,n):0}));return e("div",t({className:"message-status"},{children:c}))}var n=i.memo(s);function a(i){return e(n,t({},i))}export{a as MessageStatus};
|