@tencentcloud/chat-uikit-react 2.2.5 → 2.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +16 -12
- package/.lintstagedrc.json +1 -1
- package/CHANGELOG.md +8 -0
- package/dist/cjs/components/Avatar/Avatar.d.ts +4 -4
- package/dist/cjs/components/Checkbox/index.d.ts +2 -2
- package/dist/cjs/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
- package/dist/cjs/components/ConversationCreate/ConversationCreate.js +1 -1
- package/dist/cjs/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
- package/dist/cjs/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
- package/dist/cjs/components/ConversationPreview/ConversationListContainer.d.ts +2 -2
- package/dist/cjs/components/ConversationPreview/ConversationPreview.d.ts +8 -8
- package/dist/cjs/components/ConversationPreview/ConversationPreview.js +1 -1
- package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.d.ts +2 -2
- package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.js +1 -1
- package/dist/cjs/components/ConversationSearch/ConversationSearchResult.d.ts +3 -3
- package/dist/cjs/components/ConversationSearch/ConversationSearchResult.js +1 -1
- package/dist/cjs/components/Icon/Icon.d.ts +3 -3
- package/dist/cjs/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +4 -4
- package/dist/cjs/components/Input/Input.d.ts +4 -4
- package/dist/cjs/components/Model/index.d.ts +2 -2
- package/dist/cjs/components/Plugins/index.d.ts +4 -4
- package/dist/cjs/components/Popup/index.d.ts +2 -2
- package/dist/cjs/components/Switch/Switch.d.ts +2 -2
- package/dist/cjs/components/TUIChat/TUIChat.d.ts +12 -12
- package/dist/cjs/components/TUIChat/TUIChat.js +1 -1
- package/dist/cjs/components/TUIChatHeader/TUIChatHeader.d.ts +5 -5
- package/dist/cjs/components/TUIChatHeader/TUIChatHeader.js +1 -1
- package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.d.ts +5 -5
- package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContact.d.ts +3 -3
- package/dist/cjs/components/TUIContact/TUIContact.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/TUIContactInfo.d.ts +3 -3
- package/dist/cjs/components/TUIContact/TUIContactInfo/TUIContactInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/basicInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/blockInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/friendApplication.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/groupInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/hooks/useContactInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.d.ts +3 -3
- package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
- package/dist/cjs/components/TUIContact/hooks/useTUIContact.js +1 -1
- package/dist/cjs/components/TUIContactSearch/TUIContactSearch.js +1 -1
- package/dist/cjs/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
- package/dist/cjs/components/TUIConversation/TUIConversation.d.ts +2 -2
- package/dist/cjs/components/TUIConversationList/TUIConversationList.d.ts +6 -6
- package/dist/cjs/components/TUIConversationList/TUIConversationList.js +1 -1
- package/dist/cjs/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
- package/dist/cjs/components/TUIManage/TUIManage.d.ts +2 -2
- package/dist/cjs/components/TUIManage/TUIManage.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageAudio.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageAvatar.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageBubble.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageContext.d.ts +2 -2
- package/dist/cjs/components/TUIMessage/MessageContext.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageCustom.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageName.js +1 -1
- package/dist/cjs/components/TUIMessage/MessagePlugins.d.ts +4 -4
- package/dist/cjs/components/TUIMessage/MessagePlugins.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageProgress.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageRevoke.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageStatus.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageSystem.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageText.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageTip.js +1 -1
- package/dist/cjs/components/TUIMessage/TUIMessage.d.ts +19 -19
- package/dist/cjs/components/TUIMessage/TUIMessage.js +1 -1
- package/dist/cjs/components/TUIMessage/TUIMessageDefault.js +1 -1
- package/dist/cjs/components/TUIMessage/hooks/useMessageHandler.js +1 -1
- package/dist/cjs/components/TUIMessage/hooks/useMessageReply.js +1 -1
- package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.d.ts +2 -2
- package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
- package/dist/cjs/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIForward.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIMessageInput.d.ts +7 -7
- package/dist/cjs/components/TUIMessageInput/TUIMessageInput.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.d.ts +2 -2
- package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useUploadPicker.js +1 -1
- package/dist/cjs/components/TUIMessageList/TUIMessageList.d.ts +2 -2
- package/dist/cjs/components/TUIMessageList/TUIMessageList.js +1 -1
- package/dist/cjs/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
- package/dist/cjs/components/TUIProfile/TUIProfile.d.ts +3 -3
- package/dist/cjs/components/TUIProfile/TUIProfile.js +1 -1
- package/dist/cjs/components/TUIProfile/TUIProfileDefault.d.ts +2 -2
- package/dist/cjs/components/TUIProfile/TUIProfileDefault.js +1 -1
- package/dist/cjs/components/Toast/index.d.ts +2 -2
- package/dist/cjs/context/ComponentContext.d.ts +12 -12
- package/dist/cjs/context/LanguageContext.js +1 -0
- package/dist/cjs/context/TUIChatActionContext.d.ts +3 -3
- package/dist/cjs/context/TUIChatStateContext.d.ts +5 -5
- package/dist/cjs/context/TUIContactContext.d.ts +4 -4
- package/dist/cjs/context/TUIConversationContext.js +1 -1
- package/dist/cjs/context/TUIMessageContext.d.ts +17 -17
- package/dist/cjs/context/TUIMessageInputContext.d.ts +4 -4
- package/dist/cjs/context/ThemeContext.js +1 -0
- package/dist/cjs/context/UIKitContext.d.ts +25 -0
- package/dist/cjs/context/UIKitContext.js +1 -0
- package/dist/cjs/context/UIManagerContext.d.ts +46 -0
- package/dist/cjs/context/UIManagerContext.js +1 -0
- package/dist/cjs/hooks/useConversation.d.ts +2 -2
- package/dist/cjs/index.css +1 -2
- package/dist/cjs/index.d.css +908 -1440
- package/dist/cjs/index.d.ts +2 -4
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/locales/en-US/TUIGlobal.js +1 -0
- package/dist/cjs/locales/en-US/index.js +1 -1
- package/dist/cjs/locales/ja-JP/TUIGlobal.js +1 -0
- package/dist/cjs/locales/ja-JP/index.js +1 -1
- package/dist/cjs/locales/ko-KR/TUIGlobal.js +1 -0
- package/dist/cjs/locales/ko-KR/index.js +1 -1
- package/dist/cjs/locales/zh-CN/TUIGlobal.js +1 -0
- package/dist/cjs/locales/zh-CN/index.js +1 -1
- package/dist/esm/components/Avatar/Avatar.d.ts +4 -4
- package/dist/esm/components/Checkbox/index.d.ts +2 -2
- package/dist/esm/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
- package/dist/esm/components/ConversationCreate/ConversationCreate.js +1 -1
- package/dist/esm/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
- package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
- package/dist/esm/components/ConversationPreview/ConversationListContainer.d.ts +2 -2
- package/dist/esm/components/ConversationPreview/ConversationPreview.d.ts +8 -8
- package/dist/esm/components/ConversationPreview/ConversationPreview.js +1 -1
- package/dist/esm/components/ConversationPreview/ConversationPreviewContent.d.ts +2 -2
- package/dist/esm/components/ConversationPreview/ConversationPreviewContent.js +1 -1
- package/dist/esm/components/ConversationSearch/ConversationSearchResult.d.ts +3 -3
- package/dist/esm/components/ConversationSearch/ConversationSearchResult.js +1 -1
- package/dist/esm/components/Icon/Icon.d.ts +3 -3
- package/dist/esm/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +4 -4
- package/dist/esm/components/Input/Input.d.ts +4 -4
- package/dist/esm/components/Model/index.d.ts +2 -2
- package/dist/esm/components/Plugins/index.d.ts +4 -4
- package/dist/esm/components/Popup/index.d.ts +2 -2
- package/dist/esm/components/Switch/Switch.d.ts +2 -2
- package/dist/esm/components/TUIChat/TUIChat.d.ts +12 -12
- package/dist/esm/components/TUIChat/TUIChat.js +1 -1
- package/dist/esm/components/TUIChatHeader/TUIChatHeader.d.ts +5 -5
- package/dist/esm/components/TUIChatHeader/TUIChatHeader.js +1 -1
- package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.d.ts +5 -5
- package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
- package/dist/esm/components/TUIContact/TUIContact.d.ts +3 -3
- package/dist/esm/components/TUIContact/TUIContact.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/TUIContactInfo.d.ts +3 -3
- package/dist/esm/components/TUIContact/TUIContactInfo/TUIContactInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/basicInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/blockInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/friendApplication.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/groupInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/hooks/useContactInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.d.ts +3 -3
- package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
- package/dist/esm/components/TUIContact/hooks/useTUIContact.js +1 -1
- package/dist/esm/components/TUIContactSearch/TUIContactSearch.js +1 -1
- package/dist/esm/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
- package/dist/esm/components/TUIConversation/TUIConversation.d.ts +2 -2
- package/dist/esm/components/TUIConversationList/TUIConversationList.d.ts +6 -6
- package/dist/esm/components/TUIConversationList/TUIConversationList.js +1 -1
- package/dist/esm/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
- package/dist/esm/components/TUIManage/TUIManage.d.ts +2 -2
- package/dist/esm/components/TUIManage/TUIManage.js +1 -1
- package/dist/esm/components/TUIMessage/MessageAudio.js +1 -1
- package/dist/esm/components/TUIMessage/MessageAvatar.js +1 -1
- package/dist/esm/components/TUIMessage/MessageBubble.js +1 -1
- package/dist/esm/components/TUIMessage/MessageContext.d.ts +2 -2
- package/dist/esm/components/TUIMessage/MessageContext.js +1 -1
- package/dist/esm/components/TUIMessage/MessageCustom.js +1 -1
- package/dist/esm/components/TUIMessage/MessageName.js +1 -1
- package/dist/esm/components/TUIMessage/MessagePlugins.d.ts +4 -4
- package/dist/esm/components/TUIMessage/MessagePlugins.js +1 -1
- package/dist/esm/components/TUIMessage/MessageProgress.js +1 -1
- package/dist/esm/components/TUIMessage/MessageRevoke.js +1 -1
- package/dist/esm/components/TUIMessage/MessageStatus.js +1 -1
- package/dist/esm/components/TUIMessage/MessageSystem.js +1 -1
- package/dist/esm/components/TUIMessage/MessageText.js +1 -1
- package/dist/esm/components/TUIMessage/MessageTip.js +1 -1
- package/dist/esm/components/TUIMessage/TUIMessage.d.ts +19 -19
- package/dist/esm/components/TUIMessage/TUIMessage.js +1 -1
- package/dist/esm/components/TUIMessage/TUIMessageDefault.js +1 -1
- package/dist/esm/components/TUIMessage/hooks/useMessageHandler.js +1 -1
- package/dist/esm/components/TUIMessage/hooks/useMessageReply.js +1 -1
- package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.d.ts +2 -2
- package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
- package/dist/esm/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIForward.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIMessageInput.d.ts +7 -7
- package/dist/esm/components/TUIMessageInput/TUIMessageInput.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.d.ts +2 -2
- package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useUploadPicker.js +1 -1
- package/dist/esm/components/TUIMessageList/TUIMessageList.d.ts +2 -2
- package/dist/esm/components/TUIMessageList/TUIMessageList.js +1 -1
- package/dist/esm/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
- package/dist/esm/components/TUIProfile/TUIProfile.d.ts +3 -3
- package/dist/esm/components/TUIProfile/TUIProfile.js +1 -1
- package/dist/esm/components/TUIProfile/TUIProfileDefault.d.ts +2 -2
- package/dist/esm/components/TUIProfile/TUIProfileDefault.js +1 -1
- package/dist/esm/components/Toast/index.d.ts +2 -2
- package/dist/esm/context/ComponentContext.d.ts +12 -12
- package/dist/esm/context/LanguageContext.js +1 -0
- package/dist/esm/context/TUIChatActionContext.d.ts +3 -3
- package/dist/esm/context/TUIChatStateContext.d.ts +5 -5
- package/dist/esm/context/TUIContactContext.d.ts +4 -4
- package/dist/esm/context/TUIConversationContext.js +1 -1
- package/dist/esm/context/TUIMessageContext.d.ts +17 -17
- package/dist/esm/context/TUIMessageInputContext.d.ts +4 -4
- package/dist/esm/context/ThemeContext.js +1 -0
- package/dist/esm/context/UIKitContext.d.ts +25 -0
- package/dist/esm/context/UIKitContext.js +1 -0
- package/dist/esm/context/UIManagerContext.d.ts +46 -0
- package/dist/esm/context/UIManagerContext.js +1 -0
- package/dist/esm/hooks/useConversation.d.ts +2 -2
- package/dist/esm/index.css +1 -2
- package/dist/esm/index.d.css +908 -1440
- package/dist/esm/index.d.ts +2 -4
- package/dist/esm/index.js +1 -1
- package/dist/esm/locales/en-US/TUIGlobal.js +1 -0
- package/dist/esm/locales/en-US/index.js +1 -1
- package/dist/esm/locales/ja-JP/TUIGlobal.js +1 -0
- package/dist/esm/locales/ja-JP/index.js +1 -1
- package/dist/esm/locales/ko-KR/TUIGlobal.js +1 -0
- package/dist/esm/locales/ko-KR/index.js +1 -1
- package/dist/esm/locales/zh-CN/TUIGlobal.js +1 -0
- package/dist/esm/locales/zh-CN/index.js +1 -1
- package/package.json +4 -3
- package/src/components/ConversationCreate/ConversationCreatGroupDetail.tsx +4 -4
- package/src/components/ConversationCreate/ConversationCreate.tsx +2 -2
- package/src/components/ConversationCreate/ConversationCreateUserSelectList.tsx +3 -2
- package/src/components/ConversationPreview/ConversationPreview.tsx +21 -21
- package/src/components/ConversationPreview/ConversationPreviewContent.tsx +3 -2
- package/src/components/Plugins/styles/color.scss +2 -2
- package/src/components/TUIChat/TUIChat.tsx +4 -3
- package/src/components/TUIChatHeader/TUIChatHeaderDefault.tsx +3 -3
- package/src/components/TUIContact/TUIContact.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/TUIContactInfo.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/basicInfo.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/blockInfo.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/friendApplication.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/friendInfo.tsx +4 -3
- package/src/components/TUIContact/TUIContactInfo/groupInfo.tsx +3 -3
- package/src/components/TUIContact/TUIContactInfo/hooks/useContactInfo.tsx +2 -2
- package/src/components/TUIContact/TUIContactList/TUIContactList.tsx +5 -5
- package/src/components/TUIContact/hooks/useTUIContact.tsx +2 -2
- package/src/components/TUIContactSearch/TUIContactSearch.tsx +2 -2
- package/src/components/TUIContactSearch/hooks/useContactSearch.tsx +2 -2
- package/src/components/TUIConversationList/TUIConversationList.tsx +3 -4
- package/src/components/TUIConversationList/hooks/useConversationUpdate.tsx +2 -2
- package/src/components/TUIManage/TUIManage.tsx +3 -3
- package/src/components/TUIMessage/MessageStatus.tsx +2 -2
- package/src/components/TUIMessage/MessageText.tsx +16 -15
- package/src/components/TUIMessage/hooks/useMessageHandler.ts +2 -2
- package/src/components/TUIMessage/hooks/useMessageReply.ts +2 -2
- package/src/components/TUIMessageInput/TUIMessageInput.tsx +1 -1
- package/src/components/TUIMessageInput/hooks/useHandleForwardMessage.tsx +2 -2
- package/src/components/TUIMessageInput/hooks/useMessageInputText.tsx +2 -2
- package/src/components/TUIMessageInput/styles/color.scss +2 -2
- package/src/components/TUIMessageList/hooks/useMessageListElement.tsx +2 -2
- package/src/components/TUIProfile/TUIProfile.tsx +3 -3
- package/src/components/TUIProfile/TUIProfileDefault.tsx +2 -2
- package/src/components/index.ts +0 -1
- package/src/context/LanguageContext.tsx +59 -0
- package/src/context/ThemeContext.tsx +61 -0
- package/src/context/UIKitContext.tsx +67 -0
- package/src/context/UIManagerContext.tsx +163 -0
- package/src/context/index.ts +3 -2
- package/src/locales/en-US/index.ts +1 -1
- package/src/locales/ja-JP/index.ts +2 -0
- package/src/locales/ko-KR/TUIGlobal.ts +2 -2
- package/src/locales/ko-KR/index.ts +2 -0
- package/src/locales/zh-CN/index.ts +2 -2
- package/src/styles/colors/_color-theme.scss +1 -1
- package/dist/cjs/components/Icon/images/chats-selected.svg.js +0 -1
- package/dist/cjs/components/Icon/images/chats.svg.js +0 -1
- package/dist/cjs/components/Icon/images/contacts-selected.svg.js +0 -1
- package/dist/cjs/components/Icon/images/contacts.svg.js +0 -1
- package/dist/cjs/components/TUIKit/TUIKit.d.ts +0 -12
- package/dist/cjs/components/TUIKit/TUIKit.js +0 -1
- package/dist/cjs/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +0 -21
- package/dist/cjs/components/TUIKit/hooks/useCreateTUIKitContext.js +0 -1
- package/dist/cjs/components/TUIKit/hooks/useTUIKit.d.ts +0 -43
- package/dist/cjs/components/TUIKit/hooks/useTUIKit.js +0 -1
- package/dist/cjs/context/TUIKitContext.d.ts +0 -25
- package/dist/cjs/context/TUIKitContext.js +0 -1
- package/dist/esm/components/Icon/images/chats-selected.svg.js +0 -1
- package/dist/esm/components/Icon/images/chats.svg.js +0 -1
- package/dist/esm/components/Icon/images/contacts-selected.svg.js +0 -1
- package/dist/esm/components/Icon/images/contacts.svg.js +0 -1
- package/dist/esm/components/TUIKit/TUIKit.d.ts +0 -12
- package/dist/esm/components/TUIKit/TUIKit.js +0 -1
- package/dist/esm/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +0 -21
- package/dist/esm/components/TUIKit/hooks/useCreateTUIKitContext.js +0 -1
- package/dist/esm/components/TUIKit/hooks/useTUIKit.d.ts +0 -43
- package/dist/esm/components/TUIKit/hooks/useTUIKit.js +0 -1
- package/dist/esm/context/TUIKitContext.d.ts +0 -25
- package/dist/esm/context/TUIKitContext.js +0 -1
- package/src/components/TUIKit/TUIKit.tsx +0 -229
- package/src/components/TUIKit/hooks/useCreateTUIKitContext.tsx +0 -48
- package/src/components/TUIKit/hooks/useTUIKit.tsx +0 -99
- package/src/components/TUIKit/index.ts +0 -3
- package/src/components/TUIKit/styles/h5.scss +0 -34
- package/src/components/TUIKit/styles/index.scss +0 -132
- package/src/context/TUIKitContext.tsx +0 -44
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import TUIGlobal from './TUIGlobal';
|
|
1
2
|
import TUIChat from './TUIChat';
|
|
2
3
|
import TUIConversation from './TUIConversation';
|
|
3
4
|
import TUIContact from './TUIContact';
|
|
4
5
|
import TUIProfile from './TUIProfile';
|
|
5
6
|
|
|
6
7
|
export const message = {
|
|
8
|
+
TUIGlobal,
|
|
7
9
|
TUIChat,
|
|
8
10
|
TUIConversation,
|
|
9
11
|
TUIContact,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import TUIGlobal from './TUIGlobal';
|
|
1
2
|
import TUIChat from './TUIChat';
|
|
2
3
|
import TUIConversation from './TUIConversation';
|
|
3
4
|
import TUIContact from './TUIContact';
|
|
4
5
|
import TUIProfile from './TUIProfile';
|
|
5
6
|
|
|
6
7
|
export const message = {
|
|
7
|
-
|
|
8
|
-
'contacts': '通讯录',
|
|
8
|
+
TUIGlobal,
|
|
9
9
|
TUIChat,
|
|
10
10
|
TUIConversation,
|
|
11
11
|
TUIContact,
|
|
@@ -38,7 +38,7 @@ $color-map: ();
|
|
|
38
38
|
|
|
39
39
|
$color-map: () !global;
|
|
40
40
|
|
|
41
|
-
[data-
|
|
41
|
+
[data-uikit-theme="#{$theme}"] & {
|
|
42
42
|
@each $color in $colors {
|
|
43
43
|
$value: #{$prefix}-#{$theme}-#{$color};
|
|
44
44
|
$color-map: map.merge($color-map, ($color: var($value))) !global;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";module.exports="data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M19.6893%2018.3914C21.131%2016.6584%2021.998%2014.4305%2021.998%2012.0001C21.998%206.47721%2017.5209%202.00006%2011.998%202.00006C6.4752%202.00006%201.99805%206.47721%201.99805%2012.0001C1.99805%2017.5229%206.4752%2022.0001%2011.998%2022.0001C14.1036%2022.0001%2016.0571%2021.3493%2017.6686%2020.238C17.6858%2020.2471%2017.7041%2020.2552%2017.7233%2020.262L19.9382%2021.0464C20.2554%2021.1587%2020.5611%2020.853%2020.4488%2020.5358L19.6893%2018.3914Z%22%20fill%3D%22%23147AFF%22%20style%3D%22fill%3A%23147AFF%3Bfill%3Acolor%28display-p3%200.0784%200.4784%201.0000%29%3Bfill-opacity%3A1%3B%22%2F%3E%3Ccircle%20cx%3D%227.00195%22%20cy%3D%2212%22%20r%3D%221.4%22%20fill%3D%22white%22%20stroke%3D%22%23979797%22%20style%3D%22fill%3Awhite%3Bfill%3Awhite%3Bfill-opacity%3A1%3Bstroke%3A%23979797%3Bstroke%3Acolor%28display-p3%200.5922%200.5922%200.5922%29%3Bstroke-opacity%3A1%3B%22%20stroke-width%3D%220.2%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%221.4%22%20fill%3D%22white%22%20stroke%3D%22%23979797%22%20style%3D%22fill%3Awhite%3Bfill%3Awhite%3Bfill-opacity%3A1%3Bstroke%3A%23979797%3Bstroke%3Acolor%28display-p3%200.5922%200.5922%200.5922%29%3Bstroke-opacity%3A1%3B%22%20stroke-width%3D%220.2%22%2F%3E%3Ccircle%20cx%3D%2216.998%22%20cy%3D%2212%22%20r%3D%221.4%22%20fill%3D%22white%22%20stroke%3D%22%23979797%22%20style%3D%22fill%3Awhite%3Bfill%3Awhite%3Bfill-opacity%3A1%3Bstroke%3A%23979797%3Bstroke%3Acolor%28display-p3%200.5922%200.5922%200.5922%29%3Bstroke-opacity%3A1%3B%22%20stroke-width%3D%220.2%22%2F%3E%3C%2Fsvg%3E";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";module.exports="data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cmask%20id%3D%22path-1-inside-1_91_53001%22%20fill%3D%22white%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M19.6894%2018.3919C21.131%2016.659%2021.998%2014.4311%2021.998%2012.0007C21.998%206.47788%2017.5209%202.00073%2011.998%202.00073C6.4752%202.00073%201.99805%206.47788%201.99805%2012.0007C1.99805%2017.5236%206.4752%2022.0007%2011.998%2022.0007C14.1037%2022.0007%2016.0574%2021.3499%2017.6689%2020.2385C17.6861%2020.2475%2017.7042%2020.2555%2017.7233%2020.2623L19.9382%2021.0467C20.2554%2021.159%2020.5611%2020.8533%2020.4488%2020.5361L19.6894%2018.3919Z%22%2F%3E%3C%2Fmask%3E%3Cpath%20d%3D%22M19.6894%2018.3919L18.9207%2017.7524L18.5569%2018.1897L18.7468%2018.7258L19.6894%2018.3919ZM17.6689%2020.2385L18.1349%2019.3537L17.5993%2019.0716L17.1011%2019.4153L17.6689%2020.2385ZM17.7233%2020.2623L18.0571%2019.3196L18.0571%2019.3196L17.7233%2020.2623ZM19.9382%2021.0467L20.272%2020.104H20.272L19.9382%2021.0467ZM20.4488%2020.5361L19.5062%2020.8699V20.8699L20.4488%2020.5361ZM20.998%2012.0007C20.998%2014.1889%2020.2184%2016.1924%2018.9207%2017.7524L20.4582%2019.0315C22.0437%2017.1256%2022.998%2014.6733%2022.998%2012.0007H20.998ZM11.998%203.00073C16.9686%203.00073%2020.998%207.03017%2020.998%2012.0007H22.998C22.998%205.9256%2018.0732%201.00073%2011.998%201.00073V3.00073ZM2.99805%2012.0007C2.99805%207.03017%207.02748%203.00073%2011.998%203.00073V1.00073C5.92291%201.00073%200.998047%205.9256%200.998047%2012.0007H2.99805ZM11.998%2021.0007C7.02748%2021.0007%202.99805%2016.9713%202.99805%2012.0007H0.998047C0.998047%2018.0759%205.92291%2023.0007%2011.998%2023.0007V21.0007ZM17.1011%2019.4153C15.6512%2020.4153%2013.8945%2021.0007%2011.998%2021.0007V23.0007C14.3129%2023.0007%2016.4635%2022.2846%2018.2366%2021.0617L17.1011%2019.4153ZM18.0571%2019.3196C18.0834%2019.3289%2018.1094%2019.3403%2018.1349%2019.3537L17.2028%2021.1233C17.2627%2021.1548%2017.325%2021.1821%2017.3895%2021.2049L18.0571%2019.3196ZM20.272%2020.104L18.0571%2019.3196L17.3895%2021.2049L19.6044%2021.9893L20.272%2020.104ZM19.5062%2020.8699C19.3376%2020.3941%2019.7962%2019.9355%2020.272%2020.104L19.6044%2021.9893C20.7146%2022.3825%2021.7846%2021.3125%2021.3914%2020.2023L19.5062%2020.8699ZM18.7468%2018.7258L19.5062%2020.8699L21.3914%2020.2023L20.6321%2018.0581L18.7468%2018.7258Z%22%20fill%3D%22%23666666%22%20style%3D%22fill%3A%23666666%3Bfill%3Acolor%28display-p3%200.4000%200.4000%200.4000%29%3Bfill-opacity%3A1%3B%22%20mask%3D%22url%28%23path-1-inside-1_91_53001%29%22%2F%3E%3Ccircle%20cx%3D%227.00195%22%20cy%3D%2212.0007%22%20r%3D%221.4%22%20fill%3D%22%23666666%22%20stroke%3D%22%23979797%22%20style%3D%22fill%3A%23666666%3Bfill%3Acolor%28display-p3%200.4000%200.4000%200.4000%29%3Bfill-opacity%3A1%3Bstroke%3A%23979797%3Bstroke%3Acolor%28display-p3%200.5922%200.5922%200.5922%29%3Bstroke-opacity%3A1%3B%22%20stroke-width%3D%220.2%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212.0007%22%20r%3D%221.4%22%20fill%3D%22%23666666%22%20stroke%3D%22%23979797%22%20style%3D%22fill%3A%23666666%3Bfill%3Acolor%28display-p3%200.4000%200.4000%200.4000%29%3Bfill-opacity%3A1%3Bstroke%3A%23979797%3Bstroke%3Acolor%28display-p3%200.5922%200.5922%200.5922%29%3Bstroke-opacity%3A1%3B%22%20stroke-width%3D%220.2%22%2F%3E%3Ccircle%20cx%3D%2216.998%22%20cy%3D%2212.0007%22%20r%3D%221.4%22%20fill%3D%22%23666666%22%20stroke%3D%22%23979797%22%20style%3D%22fill%3A%23666666%3Bfill%3Acolor%28display-p3%200.4000%200.4000%200.4000%29%3Bfill-opacity%3A1%3Bstroke%3A%23979797%3Bstroke%3Acolor%28display-p3%200.5922%200.5922%200.5922%29%3Bstroke-opacity%3A1%3B%22%20stroke-width%3D%220.2%22%2F%3E%3C%2Fsvg%3E";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";module.exports="data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5.60156%209.00028C5.60156%2012.5349%208.46692%2015.4003%2012.0016%2015.4003C15.5362%2015.4003%2018.4016%2012.5349%2018.4016%209.00028C18.4016%205.46564%2015.5362%202.60028%2012.0016%202.60028C8.46692%202.60028%205.60156%205.46564%205.60156%209.00028ZM5.20078%2016.4003C3.8753%2016.4003%202.80078%2017.4748%202.80078%2018.8003C2.80078%2020.1257%203.87529%2021.2003%205.20078%2021.2003H18.8008C20.1263%2021.2003%2021.2008%2020.1257%2021.2008%2018.8003C21.2008%2017.4748%2020.1263%2016.4003%2018.8008%2016.4003H5.20078Z%22%20fill%3D%22%23147AFF%22%20style%3D%22fill%3A%23147AFF%3Bfill%3Acolor%28display-p3%200.0784%200.4784%201.0000%29%3Bfill-opacity%3A1%3B%22%2F%3E%3C%2Fsvg%3E";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";module.exports="data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cmask%20id%3D%22path-1-inside-1_251_63695%22%20fill%3D%22white%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5.60156%208.99998C5.60156%2012.5346%208.46692%2015.4%2012.0016%2015.4C15.5362%2015.4%2018.4016%2012.5346%2018.4016%208.99998C18.4016%205.46534%2015.5362%202.59998%2012.0016%202.59998C8.46692%202.59998%205.60156%205.46534%205.60156%208.99998ZM5.20078%2016.3999C3.8753%2016.3999%202.80078%2017.4745%202.80078%2018.7999C2.80078%2020.1254%203.87529%2021.1999%205.20078%2021.1999H18.8008C20.1263%2021.1999%2021.2008%2020.1254%2021.2008%2018.7999C21.2008%2017.4745%2020.1263%2016.3999%2018.8008%2016.3999H5.20078Z%22%2F%3E%3C%2Fmask%3E%3Cpath%20d%3D%22M12.0016%2014.4C9.01921%2014.4%206.60156%2011.9823%206.60156%208.99998H4.60156C4.60156%2013.0869%207.91464%2016.4%2012.0016%2016.4V14.4ZM17.4016%208.99998C17.4016%2011.9823%2014.9839%2014.4%2012.0016%2014.4V16.4C16.0885%2016.4%2019.4016%2013.0869%2019.4016%208.99998H17.4016ZM12.0016%203.59998C14.9839%203.59998%2017.4016%206.01762%2017.4016%208.99998H19.4016C19.4016%204.91305%2016.0885%201.59998%2012.0016%201.59998V3.59998ZM6.60156%208.99998C6.60156%206.01762%209.01921%203.59998%2012.0016%203.59998V1.59998C7.91464%201.59998%204.60156%204.91305%204.60156%208.99998H6.60156ZM3.80078%2018.7999C3.80078%2018.0267%204.42758%2017.3999%205.20078%2017.3999V15.3999C3.32301%2015.3999%201.80078%2016.9222%201.80078%2018.7999H3.80078ZM5.20078%2020.1999C4.42758%2020.1999%203.80078%2019.5731%203.80078%2018.7999H1.80078C1.80078%2020.6777%203.32301%2022.1999%205.20078%2022.1999V20.1999ZM18.8008%2020.1999H5.20078V22.1999H18.8008V20.1999ZM20.2008%2018.7999C20.2008%2019.5731%2019.574%2020.1999%2018.8008%2020.1999V22.1999C20.6785%2022.1999%2022.2008%2020.6777%2022.2008%2018.7999H20.2008ZM18.8008%2017.3999C19.574%2017.3999%2020.2008%2018.0267%2020.2008%2018.7999H22.2008C22.2008%2016.9222%2020.6786%2015.3999%2018.8008%2015.3999V17.3999ZM5.20078%2017.3999H18.8008V15.3999H5.20078V17.3999Z%22%20fill%3D%22%23666666%22%20style%3D%22fill%3A%23666666%3Bfill%3Acolor%28display-p3%200.4000%200.4000%200.4000%29%3Bfill-opacity%3A1%3B%22%20mask%3D%22url%28%23path-1-inside-1_251_63695%29%22%2F%3E%3C%2Fsvg%3E";
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { Conversation } from '@tencentcloud/chat';
|
|
3
|
-
|
|
4
|
-
interface ChatProps {
|
|
5
|
-
chat?: any;
|
|
6
|
-
language?: string;
|
|
7
|
-
customClasses?: unknown;
|
|
8
|
-
activeConversation?: Conversation;
|
|
9
|
-
}
|
|
10
|
-
declare function TUIKit<T extends ChatProps>(props: PropsWithChildren<T>): React.ReactElement;
|
|
11
|
-
|
|
12
|
-
export { ChatProps, TUIKit };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),a=require("react"),s=require("@tencentcloud/chat-uikit-engine"),n=require("@tencentcloud/tui-core"),r=require("react-i18next"),i=require("../../utils/env.js"),o=require("./hooks/useTUIKit.js"),c=require("./hooks/useCreateTUIKitContext.js"),T=require("../../context/TUIKitContext.js"),l=require("../TUIConversation/TUIConversation.js"),u=require("../TUIChat/TUIChat.js"),I=require("../TUIManage/TUIManage.js"),C=require("../TUIProfile/TUIProfile.js");require("../TUIProfile/TUIProfileDefault.js"),require("@tencentcloud/chat"),require("../../context/TUIMessageContext.js"),require("../Icon/config.js"),require("../Icon/type.js");var U=require("../TUIContact/TUIContactInfo/TUIContactInfo.js"),v=require("../TUIContact/TUIContact.js"),h=require("../../constants.js");require("../../locales/index.js");var d=require("../Icon/images/chats.svg.js"),j=require("../Icon/images/chats-selected.svg.js"),A=require("../Icon/images/contacts.svg.js"),m=require("../Icon/images/contacts-selected.svg.js"),g=[{id:1,name:h.TUIKIT_TABBAR.CHATS,icon:d,selectedIcon:j,value:h.TUIKIT_TABBAR.CHATS},{id:2,name:h.TUIKIT_TABBAR.CONTACTS,icon:A,selectedIcon:m,value:h.TUIKIT_TABBAR.CONTACTS}],x={className:"sample-h5-input",isTransmitter:!0};function _(a){var s=a.moduleValue,n=a.tabbarRender,r=a.setModuleValue;return t.jsxs(t.Fragment,{children:[t.jsxs("div",e.__assign({className:"sample-chat-left-container"},{children:[t.jsx(C.TUIProfile,{className:"sample-chat-profile"}),n,s===h.TUIKIT_TABBAR.CHATS&&t.jsx(l.TUIConversation,{}),s===h.TUIKIT_TABBAR.CONTACTS&&t.jsx(v.TUIContact,{})]})),s===h.TUIKIT_TABBAR.CHATS&&t.jsxs(t.Fragment,{children:[t.jsx(u.TUIChat,{}),t.jsx(I.TUIManage,{})]}),s===h.TUIKIT_TABBAR.CONTACTS&&t.jsx(v.TUIContact,{children:t.jsx(U.TUIContactInfo,{showChats:function(){r(h.TUIKIT_TABBAR.CHATS)}})})]})}function f(a){var s=a.moduleValue,n=a.contactData,r=a.tabbarRender,i=a.currentConversationID,o=a.setModuleValue;return t.jsxs("div",e.__assign({className:"sample-chat-h5"},{children:[!i&&!n&&t.jsxs("div",e.__assign({className:"sample-chat-h5-container"},{children:[t.jsx(C.TUIProfile,{className:"sample-profile"}),r,s===h.TUIKIT_TABBAR.CHATS&&t.jsx(l.TUIConversation,{}),s===h.TUIKIT_TABBAR.CONTACTS&&t.jsx(v.TUIContact,{})]})),s===h.TUIKIT_TABBAR.CHATS&&i&&t.jsxs(t.Fragment,{children:[t.jsx(u.TUIChat,{TUIMessageInputConfig:x}),t.jsx(I.TUIManage,{})]}),s===h.TUIKIT_TABBAR.CONTACTS&&n&&t.jsx(v.TUIContact,{children:t.jsx(U.TUIContactInfo,{showChats:function(){o(h.TUIKIT_TABBAR.CHATS)}})})]}))}exports.TUIKit=function(l){var u=a.useState("chats"),I=u[0],C=u[1],U=r.useTranslation().t,v=l.children,h=l.chat,d=void 0===h?n.TUILogin.getContext().chat:h,j=l.customClasses,A=l.activeConversation,m=l.language,x=void 0===m?"en-US":m;window.tencent_cloud_im_csig_react_uikit_23F_xa=!0;var S=o.useTUIKit({chat:d,activeConversation:A,language:x}),B=S.conversation,q=S.contactData,p=S.setActiveConversation,K=S.myProfile,N=S.TUIManageShow,R=S.setTUIManageShow,w=S.TUIProfileShow,M=S.setTUIProfileShow,P=S.setActiveContact,b=c.useCreateTUIKitContext({chat:d,language:x,conversation:B,contactData:q,setActiveConversation:p,customClasses:j,myProfile:K,TUIManageShow:N,setTUIManageShow:R,TUIProfileShow:w,setTUIProfileShow:M,setActiveContact:P});a.useEffect((function(){return s.TUIStore.watch(s.StoreName.CONV,{currentConversation:V}),function(){s.TUIStore.unwatch(s.StoreName.CONV,{currentConversation:V})}}),[]);var V=function(e){p(null==e?void 0:e.getConversation())},H=t.jsx("div",e.__assign({className:"sample-chat-tab"},{children:g.map((function(a){return t.jsxs("div",e.__assign({className:"sample-chat-tab-container",role:"presentation",onClick:function(){var e;e=a.value,C(e),s.TUIConversationService.switchConversation("")}},{children:[t.jsx("img",{src:I===a.value?a.selectedIcon:a.icon,alt:""}),t.jsx("p",e.__assign({className:"sample-chat-tab-text ".concat(I===a.value?"sample-chat-tab-active":"")},{children:U(a.name)}))]}),a.id)}))}));return t.jsx(T.TUIKitProvider,e.__assign({value:b},{children:t.jsx("div",e.__assign({className:"tui-kit"},{children:v||i.isPC&&t.jsx(_,{moduleValue:I,tabbarRender:H,setModuleValue:C})||i.isH5&&t.jsx(f,{contactData:q,moduleValue:I,tabbarRender:H,currentConversationID:(null==B?void 0:B.conversationID)||"",setModuleValue:C})}))}))};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { UseContactParams } from './useTUIKit.js';
|
|
2
|
-
import * as _tencentcloud_chat from '@tencentcloud/chat';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { TUIKitContextValue } from '../../../context/TUIKitContext.js';
|
|
5
|
-
|
|
6
|
-
declare const useCreateTUIKitContext: (value: TUIKitContextValue) => {
|
|
7
|
-
chat: _tencentcloud_chat.ChatSDK;
|
|
8
|
-
language: string;
|
|
9
|
-
conversation: _tencentcloud_chat.Conversation | undefined;
|
|
10
|
-
contactData: UseContactParams;
|
|
11
|
-
customClasses: unknown;
|
|
12
|
-
setActiveConversation: (conversation?: _tencentcloud_chat.Conversation | undefined) => void;
|
|
13
|
-
myProfile: _tencentcloud_chat.Profile | undefined;
|
|
14
|
-
TUIManageShow: boolean | undefined;
|
|
15
|
-
setTUIManageShow: React.Dispatch<React.SetStateAction<boolean>> | undefined;
|
|
16
|
-
TUIProfileShow: boolean | undefined;
|
|
17
|
-
setTUIProfileShow: React.Dispatch<React.SetStateAction<boolean>> | undefined;
|
|
18
|
-
setActiveContact: (UseContactParams?: UseContactParams) => void;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export { useCreateTUIKitContext };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");exports.useCreateTUIKitContext=function(t){var o=t.chat,a=t.language,s=t.conversation,n=t.contactData,r=t.customClasses,c=t.setActiveConversation,i=t.myProfile,u=t.TUIManageShow,l=t.setTUIManageShow,v=t.TUIProfileShow,h=t.setTUIProfileShow,f=t.setActiveContact;return e.useMemo((function(){return{chat:o,language:a,conversation:s,contactData:n,customClasses:r,setActiveConversation:c,myProfile:i,TUIManageShow:u,setTUIManageShow:l,TUIProfileShow:v,setTUIProfileShow:h,setActiveContact:f}}),[a,s,n,r,o,u,v,h,i])};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { IGroupModel } from '@tencentcloud/chat-uikit-engine';
|
|
3
|
-
import { ChatSDK, Conversation, Profile, Friend, FriendApplication } from '@tencentcloud/chat';
|
|
4
|
-
|
|
5
|
-
interface blockData {
|
|
6
|
-
type: 'block';
|
|
7
|
-
data: Profile;
|
|
8
|
-
}
|
|
9
|
-
interface friendData {
|
|
10
|
-
type: 'friend';
|
|
11
|
-
data: Friend;
|
|
12
|
-
}
|
|
13
|
-
interface friendApplicationData {
|
|
14
|
-
type: 'friendApplication';
|
|
15
|
-
data: FriendApplication;
|
|
16
|
-
}
|
|
17
|
-
interface addFriendData {
|
|
18
|
-
type: 'addFriend';
|
|
19
|
-
data: Profile;
|
|
20
|
-
}
|
|
21
|
-
interface GroupData {
|
|
22
|
-
type: 'group';
|
|
23
|
-
data: IGroupModel;
|
|
24
|
-
}
|
|
25
|
-
type UseContactParams = blockData | friendData | friendApplicationData | addFriendData | GroupData | undefined;
|
|
26
|
-
interface UseChatParams {
|
|
27
|
-
chat: ChatSDK;
|
|
28
|
-
activeConversation?: Conversation;
|
|
29
|
-
language?: string;
|
|
30
|
-
}
|
|
31
|
-
declare const useTUIKit: ({ chat, activeConversation: paramsActiveConversation, language, }: UseChatParams) => {
|
|
32
|
-
conversation: Conversation | undefined;
|
|
33
|
-
contactData: UseContactParams;
|
|
34
|
-
setActiveConversation: (activeConversation?: Conversation) => void;
|
|
35
|
-
myProfile: Profile | undefined;
|
|
36
|
-
TUIManageShow: boolean;
|
|
37
|
-
setTUIManageShow: React.Dispatch<React.SetStateAction<boolean>>;
|
|
38
|
-
TUIProfileShow: boolean;
|
|
39
|
-
setTUIProfileShow: React.Dispatch<React.SetStateAction<boolean>>;
|
|
40
|
-
setActiveContact: (actionContactData?: UseContactParams) => void;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export { UseChatParams, UseContactParams, useTUIKit };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@tencentcloud/chat-uikit-engine"),n=require("react-i18next");exports.useTUIKit=function(a){var o=a.chat,i=a.activeConversation,r=a.language,s=n.useTranslation().i18n,c=e.useState(i),u=c[0],f=c[1],l=e.useState(),v=l[0],S=l[1],I=e.useState(!1),g=I[0],h=I[1],T=e.useState(!1),U=T[0],d=T[1],w=e.useState(),D=w[0],P=w[1];e.useEffect((function(){s.changeLanguage(r),t.TUIStore.watch(t.StoreName.USER,{userProfile:function(e){S(e)}})}),[r]);var C=e.useCallback((function(e){e&&(null==o||o.setMessageRead({conversationID:e.conversationID})),u&&(null==e?void 0:e.conversationID)!==u.conversationID&&h(!1),f(e)}),[o]);return e.useEffect((function(){i&&f(i)}),[i]),{conversation:u,contactData:D,setActiveConversation:C,myProfile:v,TUIManageShow:g,setTUIManageShow:h,TUIProfileShow:U,setTUIProfileShow:d,setActiveContact:function(e){P(e)}}};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { ChatSDK, Conversation, Profile } from '@tencentcloud/chat';
|
|
3
|
-
import { UseContactParams } from '../components/TUIKit/hooks/useTUIKit.js';
|
|
4
|
-
|
|
5
|
-
interface TUIKitContextValue {
|
|
6
|
-
chat: ChatSDK;
|
|
7
|
-
language: string;
|
|
8
|
-
conversation?: Conversation;
|
|
9
|
-
contactData?: UseContactParams;
|
|
10
|
-
setActiveConversation: (conversation?: Conversation) => void;
|
|
11
|
-
customClasses?: unknown;
|
|
12
|
-
myProfile?: Profile;
|
|
13
|
-
TUIManageShow?: boolean;
|
|
14
|
-
setTUIManageShow?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
15
|
-
TUIProfileShow?: boolean;
|
|
16
|
-
setActiveContact: (UseContactParams?: UseContactParams) => void;
|
|
17
|
-
setTUIProfileShow?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
18
|
-
}
|
|
19
|
-
declare const TUIKitContext: React.Context<TUIKitContextValue | undefined>;
|
|
20
|
-
declare function TUIKitProvider({ children, value }: PropsWithChildren<{
|
|
21
|
-
value: TUIKitContextValue;
|
|
22
|
-
}>): React.ReactElement;
|
|
23
|
-
declare const useTUIKitContext: (componentName?: string) => TUIKitContextValue;
|
|
24
|
-
|
|
25
|
-
export { TUIKitContext, TUIKitContextValue, TUIKitProvider, useTUIKitContext };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=u(r).default.createContext(void 0);exports.TUIKitContext=n,exports.TUIKitProvider=function(u){var i=u.children,o=u.value;return r.useLayoutEffect((function(){document.documentElement.dataset.chatTheme="light"}),[]),t.jsx(n.Provider,e.__assign({value:o},{children:i}))},exports.useTUIKitContext=function(e){var t=r.useContext(n);return!t&&e?{}:t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var l="data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M19.6893%2018.3914C21.131%2016.6584%2021.998%2014.4305%2021.998%2012.0001C21.998%206.47721%2017.5209%202.00006%2011.998%202.00006C6.4752%202.00006%201.99805%206.47721%201.99805%2012.0001C1.99805%2017.5229%206.4752%2022.0001%2011.998%2022.0001C14.1036%2022.0001%2016.0571%2021.3493%2017.6686%2020.238C17.6858%2020.2471%2017.7041%2020.2552%2017.7233%2020.262L19.9382%2021.0464C20.2554%2021.1587%2020.5611%2020.853%2020.4488%2020.5358L19.6893%2018.3914Z%22%20fill%3D%22%23147AFF%22%20style%3D%22fill%3A%23147AFF%3Bfill%3Acolor%28display-p3%200.0784%200.4784%201.0000%29%3Bfill-opacity%3A1%3B%22%2F%3E%3Ccircle%20cx%3D%227.00195%22%20cy%3D%2212%22%20r%3D%221.4%22%20fill%3D%22white%22%20stroke%3D%22%23979797%22%20style%3D%22fill%3Awhite%3Bfill%3Awhite%3Bfill-opacity%3A1%3Bstroke%3A%23979797%3Bstroke%3Acolor%28display-p3%200.5922%200.5922%200.5922%29%3Bstroke-opacity%3A1%3B%22%20stroke-width%3D%220.2%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%221.4%22%20fill%3D%22white%22%20stroke%3D%22%23979797%22%20style%3D%22fill%3Awhite%3Bfill%3Awhite%3Bfill-opacity%3A1%3Bstroke%3A%23979797%3Bstroke%3Acolor%28display-p3%200.5922%200.5922%200.5922%29%3Bstroke-opacity%3A1%3B%22%20stroke-width%3D%220.2%22%2F%3E%3Ccircle%20cx%3D%2216.998%22%20cy%3D%2212%22%20r%3D%221.4%22%20fill%3D%22white%22%20stroke%3D%22%23979797%22%20style%3D%22fill%3Awhite%3Bfill%3Awhite%3Bfill-opacity%3A1%3Bstroke%3A%23979797%3Bstroke%3Acolor%28display-p3%200.5922%200.5922%200.5922%29%3Bstroke-opacity%3A1%3B%22%20stroke-width%3D%220.2%22%2F%3E%3C%2Fsvg%3E";export{l as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var l="data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cmask%20id%3D%22path-1-inside-1_91_53001%22%20fill%3D%22white%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M19.6894%2018.3919C21.131%2016.659%2021.998%2014.4311%2021.998%2012.0007C21.998%206.47788%2017.5209%202.00073%2011.998%202.00073C6.4752%202.00073%201.99805%206.47788%201.99805%2012.0007C1.99805%2017.5236%206.4752%2022.0007%2011.998%2022.0007C14.1037%2022.0007%2016.0574%2021.3499%2017.6689%2020.2385C17.6861%2020.2475%2017.7042%2020.2555%2017.7233%2020.2623L19.9382%2021.0467C20.2554%2021.159%2020.5611%2020.8533%2020.4488%2020.5361L19.6894%2018.3919Z%22%2F%3E%3C%2Fmask%3E%3Cpath%20d%3D%22M19.6894%2018.3919L18.9207%2017.7524L18.5569%2018.1897L18.7468%2018.7258L19.6894%2018.3919ZM17.6689%2020.2385L18.1349%2019.3537L17.5993%2019.0716L17.1011%2019.4153L17.6689%2020.2385ZM17.7233%2020.2623L18.0571%2019.3196L18.0571%2019.3196L17.7233%2020.2623ZM19.9382%2021.0467L20.272%2020.104H20.272L19.9382%2021.0467ZM20.4488%2020.5361L19.5062%2020.8699V20.8699L20.4488%2020.5361ZM20.998%2012.0007C20.998%2014.1889%2020.2184%2016.1924%2018.9207%2017.7524L20.4582%2019.0315C22.0437%2017.1256%2022.998%2014.6733%2022.998%2012.0007H20.998ZM11.998%203.00073C16.9686%203.00073%2020.998%207.03017%2020.998%2012.0007H22.998C22.998%205.9256%2018.0732%201.00073%2011.998%201.00073V3.00073ZM2.99805%2012.0007C2.99805%207.03017%207.02748%203.00073%2011.998%203.00073V1.00073C5.92291%201.00073%200.998047%205.9256%200.998047%2012.0007H2.99805ZM11.998%2021.0007C7.02748%2021.0007%202.99805%2016.9713%202.99805%2012.0007H0.998047C0.998047%2018.0759%205.92291%2023.0007%2011.998%2023.0007V21.0007ZM17.1011%2019.4153C15.6512%2020.4153%2013.8945%2021.0007%2011.998%2021.0007V23.0007C14.3129%2023.0007%2016.4635%2022.2846%2018.2366%2021.0617L17.1011%2019.4153ZM18.0571%2019.3196C18.0834%2019.3289%2018.1094%2019.3403%2018.1349%2019.3537L17.2028%2021.1233C17.2627%2021.1548%2017.325%2021.1821%2017.3895%2021.2049L18.0571%2019.3196ZM20.272%2020.104L18.0571%2019.3196L17.3895%2021.2049L19.6044%2021.9893L20.272%2020.104ZM19.5062%2020.8699C19.3376%2020.3941%2019.7962%2019.9355%2020.272%2020.104L19.6044%2021.9893C20.7146%2022.3825%2021.7846%2021.3125%2021.3914%2020.2023L19.5062%2020.8699ZM18.7468%2018.7258L19.5062%2020.8699L21.3914%2020.2023L20.6321%2018.0581L18.7468%2018.7258Z%22%20fill%3D%22%23666666%22%20style%3D%22fill%3A%23666666%3Bfill%3Acolor%28display-p3%200.4000%200.4000%200.4000%29%3Bfill-opacity%3A1%3B%22%20mask%3D%22url%28%23path-1-inside-1_91_53001%29%22%2F%3E%3Ccircle%20cx%3D%227.00195%22%20cy%3D%2212.0007%22%20r%3D%221.4%22%20fill%3D%22%23666666%22%20stroke%3D%22%23979797%22%20style%3D%22fill%3A%23666666%3Bfill%3Acolor%28display-p3%200.4000%200.4000%200.4000%29%3Bfill-opacity%3A1%3Bstroke%3A%23979797%3Bstroke%3Acolor%28display-p3%200.5922%200.5922%200.5922%29%3Bstroke-opacity%3A1%3B%22%20stroke-width%3D%220.2%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212.0007%22%20r%3D%221.4%22%20fill%3D%22%23666666%22%20stroke%3D%22%23979797%22%20style%3D%22fill%3A%23666666%3Bfill%3Acolor%28display-p3%200.4000%200.4000%200.4000%29%3Bfill-opacity%3A1%3Bstroke%3A%23979797%3Bstroke%3Acolor%28display-p3%200.5922%200.5922%200.5922%29%3Bstroke-opacity%3A1%3B%22%20stroke-width%3D%220.2%22%2F%3E%3Ccircle%20cx%3D%2216.998%22%20cy%3D%2212.0007%22%20r%3D%221.4%22%20fill%3D%22%23666666%22%20stroke%3D%22%23979797%22%20style%3D%22fill%3A%23666666%3Bfill%3Acolor%28display-p3%200.4000%200.4000%200.4000%29%3Bfill-opacity%3A1%3Bstroke%3A%23979797%3Bstroke%3Acolor%28display-p3%200.5922%200.5922%200.5922%29%3Bstroke-opacity%3A1%3B%22%20stroke-width%3D%220.2%22%2F%3E%3C%2Fsvg%3E";export{l as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var l="data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5.60156%209.00028C5.60156%2012.5349%208.46692%2015.4003%2012.0016%2015.4003C15.5362%2015.4003%2018.4016%2012.5349%2018.4016%209.00028C18.4016%205.46564%2015.5362%202.60028%2012.0016%202.60028C8.46692%202.60028%205.60156%205.46564%205.60156%209.00028ZM5.20078%2016.4003C3.8753%2016.4003%202.80078%2017.4748%202.80078%2018.8003C2.80078%2020.1257%203.87529%2021.2003%205.20078%2021.2003H18.8008C20.1263%2021.2003%2021.2008%2020.1257%2021.2008%2018.8003C21.2008%2017.4748%2020.1263%2016.4003%2018.8008%2016.4003H5.20078Z%22%20fill%3D%22%23147AFF%22%20style%3D%22fill%3A%23147AFF%3Bfill%3Acolor%28display-p3%200.0784%200.4784%201.0000%29%3Bfill-opacity%3A1%3B%22%2F%3E%3C%2Fsvg%3E";export{l as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var C="data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cmask%20id%3D%22path-1-inside-1_251_63695%22%20fill%3D%22white%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5.60156%208.99998C5.60156%2012.5346%208.46692%2015.4%2012.0016%2015.4C15.5362%2015.4%2018.4016%2012.5346%2018.4016%208.99998C18.4016%205.46534%2015.5362%202.59998%2012.0016%202.59998C8.46692%202.59998%205.60156%205.46534%205.60156%208.99998ZM5.20078%2016.3999C3.8753%2016.3999%202.80078%2017.4745%202.80078%2018.7999C2.80078%2020.1254%203.87529%2021.1999%205.20078%2021.1999H18.8008C20.1263%2021.1999%2021.2008%2020.1254%2021.2008%2018.7999C21.2008%2017.4745%2020.1263%2016.3999%2018.8008%2016.3999H5.20078Z%22%2F%3E%3C%2Fmask%3E%3Cpath%20d%3D%22M12.0016%2014.4C9.01921%2014.4%206.60156%2011.9823%206.60156%208.99998H4.60156C4.60156%2013.0869%207.91464%2016.4%2012.0016%2016.4V14.4ZM17.4016%208.99998C17.4016%2011.9823%2014.9839%2014.4%2012.0016%2014.4V16.4C16.0885%2016.4%2019.4016%2013.0869%2019.4016%208.99998H17.4016ZM12.0016%203.59998C14.9839%203.59998%2017.4016%206.01762%2017.4016%208.99998H19.4016C19.4016%204.91305%2016.0885%201.59998%2012.0016%201.59998V3.59998ZM6.60156%208.99998C6.60156%206.01762%209.01921%203.59998%2012.0016%203.59998V1.59998C7.91464%201.59998%204.60156%204.91305%204.60156%208.99998H6.60156ZM3.80078%2018.7999C3.80078%2018.0267%204.42758%2017.3999%205.20078%2017.3999V15.3999C3.32301%2015.3999%201.80078%2016.9222%201.80078%2018.7999H3.80078ZM5.20078%2020.1999C4.42758%2020.1999%203.80078%2019.5731%203.80078%2018.7999H1.80078C1.80078%2020.6777%203.32301%2022.1999%205.20078%2022.1999V20.1999ZM18.8008%2020.1999H5.20078V22.1999H18.8008V20.1999ZM20.2008%2018.7999C20.2008%2019.5731%2019.574%2020.1999%2018.8008%2020.1999V22.1999C20.6785%2022.1999%2022.2008%2020.6777%2022.2008%2018.7999H20.2008ZM18.8008%2017.3999C19.574%2017.3999%2020.2008%2018.0267%2020.2008%2018.7999H22.2008C22.2008%2016.9222%2020.6786%2015.3999%2018.8008%2015.3999V17.3999ZM5.20078%2017.3999H18.8008V15.3999H5.20078V17.3999Z%22%20fill%3D%22%23666666%22%20style%3D%22fill%3A%23666666%3Bfill%3Acolor%28display-p3%200.4000%200.4000%200.4000%29%3Bfill-opacity%3A1%3B%22%20mask%3D%22url%28%23path-1-inside-1_251_63695%29%22%2F%3E%3C%2Fsvg%3E";export{C as default};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { Conversation } from '@tencentcloud/chat';
|
|
3
|
-
|
|
4
|
-
interface ChatProps {
|
|
5
|
-
chat?: any;
|
|
6
|
-
language?: string;
|
|
7
|
-
customClasses?: unknown;
|
|
8
|
-
activeConversation?: Conversation;
|
|
9
|
-
}
|
|
10
|
-
declare function TUIKit<T extends ChatProps>(props: PropsWithChildren<T>): React.ReactElement;
|
|
11
|
-
|
|
12
|
-
export { ChatProps, TUIKit };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsx as e,jsxs as o,Fragment as a}from"react/jsx-runtime";import{useState as n,useEffect as r}from"react";import{TUIStore as i,StoreName as c,TUIConversationService as s}from"@tencentcloud/chat-uikit-engine";import{TUILogin as l}from"@tencentcloud/tui-core";import{useTranslation as m}from"react-i18next";import{isPC as u,isH5 as C}from"../../utils/env.js";import{useTUIKit as h}from"./hooks/useTUIKit.js";import{useCreateTUIKitContext as d}from"./hooks/useCreateTUIKitContext.js";import{TUIKitProvider as v}from"../../context/TUIKitContext.js";import{TUIConversation as f}from"../TUIConversation/TUIConversation.js";import{TUIChat as T}from"../TUIChat/TUIChat.js";import{TUIManage as p}from"../TUIManage/TUIManage.js";import{TUIProfile as I}from"../TUIProfile/TUIProfile.js";import"../TUIProfile/TUIProfileDefault.js";import"@tencentcloud/chat";import"../../context/TUIMessageContext.js";import"../Icon/config.js";import"../Icon/type.js";import{TUIContactInfo as g}from"../TUIContact/TUIContactInfo/TUIContactInfo.js";import{TUIContact as U}from"../TUIContact/TUIContact.js";import{TUIKIT_TABBAR as S}from"../../constants.js";import"../../locales/index.js";import j from"../Icon/images/chats.svg.js";import A from"../Icon/images/chats-selected.svg.js";import N from"../Icon/images/contacts.svg.js";import w from"../Icon/images/contacts-selected.svg.js";var b=[{id:1,name:S.CHATS,icon:j,selectedIcon:A,value:S.CHATS},{id:2,name:S.CONTACTS,icon:N,selectedIcon:w,value:S.CONTACTS}],x={className:"sample-h5-input",isTransmitter:!0};function M(n){var r=n.moduleValue,i=n.tabbarRender,c=n.setModuleValue;return o(a,{children:[o("div",t({className:"sample-chat-left-container"},{children:[e(I,{className:"sample-chat-profile"}),i,r===S.CHATS&&e(f,{}),r===S.CONTACTS&&e(U,{})]})),r===S.CHATS&&o(a,{children:[e(T,{}),e(p,{})]}),r===S.CONTACTS&&e(U,{children:e(g,{showChats:function(){c(S.CHATS)}})})]})}function P(n){var r=n.moduleValue,i=n.contactData,c=n.tabbarRender,s=n.currentConversationID,l=n.setModuleValue;return o("div",t({className:"sample-chat-h5"},{children:[!s&&!i&&o("div",t({className:"sample-chat-h5-container"},{children:[e(I,{className:"sample-profile"}),c,r===S.CHATS&&e(f,{}),r===S.CONTACTS&&e(U,{})]})),r===S.CHATS&&s&&o(a,{children:[e(T,{TUIMessageInputConfig:x}),e(p,{})]}),r===S.CONTACTS&&i&&e(U,{children:e(g,{showChats:function(){l(S.CHATS)}})})]}))}function V(a){var f=n("chats"),T=f[0],p=f[1],I=m().t,g=a.children,U=a.chat,S=void 0===U?l.getContext().chat:U,j=a.customClasses,A=a.activeConversation,N=a.language,w=void 0===N?"en-US":N;window.tencent_cloud_im_csig_react_uikit_23F_xa=!0;var x=h({chat:S,activeConversation:A,language:w}),V=x.conversation,D=x.contactData,H=x.setActiveConversation,O=x.myProfile,_=x.TUIManageShow,k=x.setTUIManageShow,R=x.TUIProfileShow,y=x.setTUIProfileShow,K=x.setActiveContact,F=d({chat:S,language:w,conversation:V,contactData:D,setActiveConversation:H,customClasses:j,myProfile:O,TUIManageShow:_,setTUIManageShow:k,TUIProfileShow:R,setTUIProfileShow:y,setActiveContact:K});r((function(){return i.watch(c.CONV,{currentConversation:q}),function(){i.unwatch(c.CONV,{currentConversation:q})}}),[]);var q=function(t){H(null==t?void 0:t.getConversation())},z=e("div",t({className:"sample-chat-tab"},{children:b.map((function(a){return o("div",t({className:"sample-chat-tab-container",role:"presentation",onClick:function(){var t;t=a.value,p(t),s.switchConversation("")}},{children:[e("img",{src:T===a.value?a.selectedIcon:a.icon,alt:""}),e("p",t({className:"sample-chat-tab-text ".concat(T===a.value?"sample-chat-tab-active":"")},{children:I(a.name)}))]}),a.id)}))}));return e(v,t({value:F},{children:e("div",t({className:"tui-kit"},{children:g||u&&e(M,{moduleValue:T,tabbarRender:z,setModuleValue:p})||C&&e(P,{contactData:D,moduleValue:T,tabbarRender:z,currentConversationID:(null==V?void 0:V.conversationID)||"",setModuleValue:p})}))}))}export{V as TUIKit};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { UseContactParams } from './useTUIKit.js';
|
|
2
|
-
import * as _tencentcloud_chat from '@tencentcloud/chat';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { TUIKitContextValue } from '../../../context/TUIKitContext.js';
|
|
5
|
-
|
|
6
|
-
declare const useCreateTUIKitContext: (value: TUIKitContextValue) => {
|
|
7
|
-
chat: _tencentcloud_chat.ChatSDK;
|
|
8
|
-
language: string;
|
|
9
|
-
conversation: _tencentcloud_chat.Conversation | undefined;
|
|
10
|
-
contactData: UseContactParams;
|
|
11
|
-
customClasses: unknown;
|
|
12
|
-
setActiveConversation: (conversation?: _tencentcloud_chat.Conversation | undefined) => void;
|
|
13
|
-
myProfile: _tencentcloud_chat.Profile | undefined;
|
|
14
|
-
TUIManageShow: boolean | undefined;
|
|
15
|
-
setTUIManageShow: React.Dispatch<React.SetStateAction<boolean>> | undefined;
|
|
16
|
-
TUIProfileShow: boolean | undefined;
|
|
17
|
-
setTUIProfileShow: React.Dispatch<React.SetStateAction<boolean>> | undefined;
|
|
18
|
-
setActiveContact: (UseContactParams?: UseContactParams) => void;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export { useCreateTUIKitContext };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useMemo as t}from"react";var e=function(e){var o=e.chat,a=e.language,n=e.conversation,r=e.contactData,s=e.customClasses,c=e.setActiveConversation,i=e.myProfile,h=e.TUIManageShow,l=e.setTUIManageShow,v=e.TUIProfileShow,f=e.setTUIProfileShow,g=e.setActiveContact;return t((function(){return{chat:o,language:a,conversation:n,contactData:r,customClasses:s,setActiveConversation:c,myProfile:i,TUIManageShow:h,setTUIManageShow:l,TUIProfileShow:v,setTUIProfileShow:f,setActiveContact:g}}),[a,n,r,s,o,h,v,f,i])};export{e as useCreateTUIKitContext};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { IGroupModel } from '@tencentcloud/chat-uikit-engine';
|
|
3
|
-
import { ChatSDK, Conversation, Profile, Friend, FriendApplication } from '@tencentcloud/chat';
|
|
4
|
-
|
|
5
|
-
interface blockData {
|
|
6
|
-
type: 'block';
|
|
7
|
-
data: Profile;
|
|
8
|
-
}
|
|
9
|
-
interface friendData {
|
|
10
|
-
type: 'friend';
|
|
11
|
-
data: Friend;
|
|
12
|
-
}
|
|
13
|
-
interface friendApplicationData {
|
|
14
|
-
type: 'friendApplication';
|
|
15
|
-
data: FriendApplication;
|
|
16
|
-
}
|
|
17
|
-
interface addFriendData {
|
|
18
|
-
type: 'addFriend';
|
|
19
|
-
data: Profile;
|
|
20
|
-
}
|
|
21
|
-
interface GroupData {
|
|
22
|
-
type: 'group';
|
|
23
|
-
data: IGroupModel;
|
|
24
|
-
}
|
|
25
|
-
type UseContactParams = blockData | friendData | friendApplicationData | addFriendData | GroupData | undefined;
|
|
26
|
-
interface UseChatParams {
|
|
27
|
-
chat: ChatSDK;
|
|
28
|
-
activeConversation?: Conversation;
|
|
29
|
-
language?: string;
|
|
30
|
-
}
|
|
31
|
-
declare const useTUIKit: ({ chat, activeConversation: paramsActiveConversation, language, }: UseChatParams) => {
|
|
32
|
-
conversation: Conversation | undefined;
|
|
33
|
-
contactData: UseContactParams;
|
|
34
|
-
setActiveConversation: (activeConversation?: Conversation) => void;
|
|
35
|
-
myProfile: Profile | undefined;
|
|
36
|
-
TUIManageShow: boolean;
|
|
37
|
-
setTUIManageShow: React.Dispatch<React.SetStateAction<boolean>>;
|
|
38
|
-
TUIProfileShow: boolean;
|
|
39
|
-
setTUIProfileShow: React.Dispatch<React.SetStateAction<boolean>>;
|
|
40
|
-
setActiveContact: (actionContactData?: UseContactParams) => void;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export { UseChatParams, UseContactParams, useTUIKit };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useState as n,useEffect as t,useCallback as o}from"react";import{TUIStore as e,StoreName as a}from"@tencentcloud/chat-uikit-engine";import{useTranslation as i}from"react-i18next";var r=function(r){var c=r.chat,s=r.activeConversation,u=r.language,v=i().i18n,f=n(s),l=f[0],g=f[1],h=n(),I=h[0],m=h[1],w=n(!1),D=w[0],S=w[1],U=n(!1),p=U[0],P=U[1],T=n(),d=T[0],C=T[1];t((function(){v.changeLanguage(u),e.watch(a.USER,{userProfile:function(n){m(n)}})}),[u]);var M=o((function(n){n&&(null==c||c.setMessageRead({conversationID:n.conversationID})),l&&(null==n?void 0:n.conversationID)!==l.conversationID&&S(!1),g(n)}),[c]);return t((function(){s&&g(s)}),[s]),{conversation:l,contactData:d,setActiveConversation:M,myProfile:I,TUIManageShow:D,setTUIManageShow:S,TUIProfileShow:p,setTUIProfileShow:P,setActiveContact:function(n){C(n)}}};export{r as useTUIKit};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { ChatSDK, Conversation, Profile } from '@tencentcloud/chat';
|
|
3
|
-
import { UseContactParams } from '../components/TUIKit/hooks/useTUIKit.js';
|
|
4
|
-
|
|
5
|
-
interface TUIKitContextValue {
|
|
6
|
-
chat: ChatSDK;
|
|
7
|
-
language: string;
|
|
8
|
-
conversation?: Conversation;
|
|
9
|
-
contactData?: UseContactParams;
|
|
10
|
-
setActiveConversation: (conversation?: Conversation) => void;
|
|
11
|
-
customClasses?: unknown;
|
|
12
|
-
myProfile?: Profile;
|
|
13
|
-
TUIManageShow?: boolean;
|
|
14
|
-
setTUIManageShow?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
15
|
-
TUIProfileShow?: boolean;
|
|
16
|
-
setActiveContact: (UseContactParams?: UseContactParams) => void;
|
|
17
|
-
setTUIProfileShow?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
18
|
-
}
|
|
19
|
-
declare const TUIKitContext: React.Context<TUIKitContextValue | undefined>;
|
|
20
|
-
declare function TUIKitProvider({ children, value }: PropsWithChildren<{
|
|
21
|
-
value: TUIKitContextValue;
|
|
22
|
-
}>): React.ReactElement;
|
|
23
|
-
declare const useTUIKitContext: (componentName?: string) => TUIKitContextValue;
|
|
24
|
-
|
|
25
|
-
export { TUIKitContext, TUIKitContextValue, TUIKitProvider, useTUIKitContext };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__assign as r}from"tslib";import{jsx as t}from"react/jsx-runtime";import e,{useLayoutEffect as n,useContext as o}from"react";var i=e.createContext(void 0);function a(e){var o=e.children,a=e.value;return n((function(){document.documentElement.dataset.chatTheme="light"}),[]),t(i.Provider,r({value:a},{children:o}))}var c=function(r){var t=o(i);return!t&&r?{}:t};export{i as TUIKitContext,a as TUIKitProvider,c as useTUIKitContext};
|
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren, useState, useEffect } from 'react';
|
|
2
|
-
import { ChatSDK, Conversation } from '@tencentcloud/chat';
|
|
3
|
-
import { TUIStore, StoreName, IConversationModel, TUIConversationService } from '@tencentcloud/chat-uikit-engine';
|
|
4
|
-
import { TUILogin } from '@tencentcloud/tui-core';
|
|
5
|
-
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import { isH5, isPC } from '../../utils/env';
|
|
7
|
-
import { useTUIKit, UseContactParams } from './hooks/useTUIKit';
|
|
8
|
-
import { useCreateTUIKitContext } from './hooks/useCreateTUIKitContext';
|
|
9
|
-
import { TUIKitProvider } from '../../context/TUIKitContext';
|
|
10
|
-
import { TUIConversation } from '../TUIConversation';
|
|
11
|
-
import { TUIChat } from '../TUIChat';
|
|
12
|
-
import { TUIManage } from '../TUIManage';
|
|
13
|
-
import { TUIProfile } from '../TUIProfile';
|
|
14
|
-
import { TUIContact } from '../TUIContact';
|
|
15
|
-
import { TUIContactInfo } from '../TUIContact/TUIContactInfo/TUIContactInfo';
|
|
16
|
-
import { TUIKIT_TABBAR } from '../../constants';
|
|
17
|
-
import '../../locales/index';
|
|
18
|
-
import chats from '../Icon/images/chats.svg';
|
|
19
|
-
import chatsSelected from '../Icon/images/chats-selected.svg';
|
|
20
|
-
import contacts from '../Icon/images/contacts.svg';
|
|
21
|
-
import contactsSelected from '../Icon/images/contacts-selected.svg';
|
|
22
|
-
import './styles/index.scss';
|
|
23
|
-
import './styles/h5.scss';
|
|
24
|
-
import '../../styles/index.scss';
|
|
25
|
-
|
|
26
|
-
export interface ChatProps {
|
|
27
|
-
chat?: any,
|
|
28
|
-
language?: string,
|
|
29
|
-
customClasses?: unknown,
|
|
30
|
-
activeConversation?: Conversation,
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
interface RenderPCProps {
|
|
34
|
-
moduleValue: string,
|
|
35
|
-
tabbarRender: any,
|
|
36
|
-
setModuleValue: (value: string) => void
|
|
37
|
-
}
|
|
38
|
-
interface RenderH5Props {
|
|
39
|
-
moduleValue: string,
|
|
40
|
-
currentConversationID: string,
|
|
41
|
-
tabbarRender: any,
|
|
42
|
-
contactData: UseContactParams,
|
|
43
|
-
setModuleValue: (value: string) => void
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const tabbarList = [
|
|
47
|
-
{
|
|
48
|
-
id: 1,
|
|
49
|
-
name: TUIKIT_TABBAR.CHATS,
|
|
50
|
-
icon: chats,
|
|
51
|
-
selectedIcon: chatsSelected,
|
|
52
|
-
value: TUIKIT_TABBAR.CHATS,
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
id: 2,
|
|
56
|
-
name: TUIKIT_TABBAR.CONTACTS,
|
|
57
|
-
icon: contacts,
|
|
58
|
-
selectedIcon: contactsSelected,
|
|
59
|
-
value: TUIKIT_TABBAR.CONTACTS,
|
|
60
|
-
},
|
|
61
|
-
];
|
|
62
|
-
const TUIMessageInputConfig = {
|
|
63
|
-
className: 'sample-h5-input',
|
|
64
|
-
isTransmitter: true,
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
function RenderForPC({ moduleValue, tabbarRender, setModuleValue } : RenderPCProps) {
|
|
68
|
-
return (
|
|
69
|
-
<>
|
|
70
|
-
<div className="sample-chat-left-container">
|
|
71
|
-
<TUIProfile className="sample-chat-profile" />
|
|
72
|
-
{tabbarRender}
|
|
73
|
-
{moduleValue === TUIKIT_TABBAR.CHATS && <TUIConversation />}
|
|
74
|
-
{moduleValue === TUIKIT_TABBAR.CONTACTS && <TUIContact />}
|
|
75
|
-
</div>
|
|
76
|
-
{moduleValue === TUIKIT_TABBAR.CHATS && (
|
|
77
|
-
<>
|
|
78
|
-
<TUIChat />
|
|
79
|
-
<TUIManage />
|
|
80
|
-
</>
|
|
81
|
-
)}
|
|
82
|
-
{moduleValue === TUIKIT_TABBAR.CONTACTS && (
|
|
83
|
-
<TUIContact>
|
|
84
|
-
<TUIContactInfo
|
|
85
|
-
showChats={() => {
|
|
86
|
-
setModuleValue(TUIKIT_TABBAR.CHATS);
|
|
87
|
-
}}
|
|
88
|
-
/>
|
|
89
|
-
</TUIContact>
|
|
90
|
-
)}
|
|
91
|
-
</>
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function RenderForH5({
|
|
96
|
-
moduleValue, contactData, tabbarRender, currentConversationID, setModuleValue,
|
|
97
|
-
}: RenderH5Props) {
|
|
98
|
-
return (
|
|
99
|
-
<div className='sample-chat-h5'>
|
|
100
|
-
{!currentConversationID && !contactData && (
|
|
101
|
-
<div className="sample-chat-h5-container">
|
|
102
|
-
<TUIProfile className="sample-profile" />
|
|
103
|
-
{tabbarRender}
|
|
104
|
-
{moduleValue === TUIKIT_TABBAR.CHATS && <TUIConversation />}
|
|
105
|
-
{moduleValue === TUIKIT_TABBAR.CONTACTS && <TUIContact />}
|
|
106
|
-
</div>
|
|
107
|
-
)}
|
|
108
|
-
{moduleValue === TUIKIT_TABBAR.CHATS && currentConversationID && (
|
|
109
|
-
<>
|
|
110
|
-
<TUIChat TUIMessageInputConfig={TUIMessageInputConfig} />
|
|
111
|
-
<TUIManage />
|
|
112
|
-
</>
|
|
113
|
-
)}
|
|
114
|
-
{ moduleValue === TUIKIT_TABBAR.CONTACTS && contactData && (
|
|
115
|
-
<TUIContact>
|
|
116
|
-
<TUIContactInfo
|
|
117
|
-
showChats={() => {
|
|
118
|
-
setModuleValue(TUIKIT_TABBAR.CHATS);
|
|
119
|
-
}}
|
|
120
|
-
/>
|
|
121
|
-
</TUIContact>
|
|
122
|
-
)}
|
|
123
|
-
</div>
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
export function TUIKit<
|
|
127
|
-
T extends ChatProps
|
|
128
|
-
>(
|
|
129
|
-
props:PropsWithChildren<T>,
|
|
130
|
-
):React.ReactElement {
|
|
131
|
-
const [moduleValue, setModuleValue] = useState('chats');
|
|
132
|
-
const { t } = useTranslation();
|
|
133
|
-
const {
|
|
134
|
-
children,
|
|
135
|
-
chat = TUILogin.getContext().chat,
|
|
136
|
-
customClasses,
|
|
137
|
-
activeConversation,
|
|
138
|
-
language = 'en-US',
|
|
139
|
-
} = props;
|
|
140
|
-
|
|
141
|
-
(window as any).tencent_cloud_im_csig_react_uikit_23F_xa = true;
|
|
142
|
-
const {
|
|
143
|
-
conversation,
|
|
144
|
-
contactData,
|
|
145
|
-
setActiveConversation,
|
|
146
|
-
myProfile,
|
|
147
|
-
TUIManageShow,
|
|
148
|
-
setTUIManageShow,
|
|
149
|
-
TUIProfileShow,
|
|
150
|
-
setTUIProfileShow,
|
|
151
|
-
setActiveContact,
|
|
152
|
-
} = useTUIKit({ chat, activeConversation, language });
|
|
153
|
-
const chatContextValue = useCreateTUIKitContext({
|
|
154
|
-
chat,
|
|
155
|
-
language,
|
|
156
|
-
conversation,
|
|
157
|
-
contactData,
|
|
158
|
-
setActiveConversation,
|
|
159
|
-
customClasses,
|
|
160
|
-
myProfile,
|
|
161
|
-
TUIManageShow,
|
|
162
|
-
setTUIManageShow,
|
|
163
|
-
TUIProfileShow,
|
|
164
|
-
setTUIProfileShow,
|
|
165
|
-
setActiveContact,
|
|
166
|
-
});
|
|
167
|
-
useEffect(() => {
|
|
168
|
-
TUIStore.watch(StoreName.CONV, {
|
|
169
|
-
currentConversation: onCurrentConversation,
|
|
170
|
-
});
|
|
171
|
-
return () => {
|
|
172
|
-
TUIStore.unwatch(StoreName.CONV, {
|
|
173
|
-
currentConversation: onCurrentConversation,
|
|
174
|
-
});
|
|
175
|
-
};
|
|
176
|
-
}, []);
|
|
177
|
-
|
|
178
|
-
const switchTabbar = (value: string) => {
|
|
179
|
-
setModuleValue(value);
|
|
180
|
-
TUIConversationService.switchConversation('');
|
|
181
|
-
};
|
|
182
|
-
const onCurrentConversation = (conversationModel: IConversationModel) => {
|
|
183
|
-
setActiveConversation(conversationModel?.getConversation());
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
const tabbarRender = (
|
|
187
|
-
<div className="sample-chat-tab">
|
|
188
|
-
{tabbarList.map((item: any) => (
|
|
189
|
-
<div
|
|
190
|
-
className="sample-chat-tab-container"
|
|
191
|
-
key={item.id}
|
|
192
|
-
role="presentation"
|
|
193
|
-
onClick={() => {
|
|
194
|
-
switchTabbar(item.value);
|
|
195
|
-
}}
|
|
196
|
-
>
|
|
197
|
-
<img src={moduleValue === item.value ? item.selectedIcon : item.icon} alt="" />
|
|
198
|
-
<p className={`sample-chat-tab-text ${moduleValue === item.value ? 'sample-chat-tab-active' : ''}`}>
|
|
199
|
-
{t(item.name)}
|
|
200
|
-
</p>
|
|
201
|
-
</div>
|
|
202
|
-
))}
|
|
203
|
-
</div>
|
|
204
|
-
);
|
|
205
|
-
|
|
206
|
-
return (
|
|
207
|
-
<TUIKitProvider value={chatContextValue}>
|
|
208
|
-
<div className="tui-kit">
|
|
209
|
-
{children ||
|
|
210
|
-
(isPC && (
|
|
211
|
-
<RenderForPC
|
|
212
|
-
moduleValue={moduleValue}
|
|
213
|
-
tabbarRender={tabbarRender}
|
|
214
|
-
setModuleValue={setModuleValue}
|
|
215
|
-
/>
|
|
216
|
-
)) ||
|
|
217
|
-
(isH5 && (
|
|
218
|
-
<RenderForH5
|
|
219
|
-
contactData={contactData}
|
|
220
|
-
moduleValue={moduleValue}
|
|
221
|
-
tabbarRender={tabbarRender}
|
|
222
|
-
currentConversationID={conversation?.conversationID || ''}
|
|
223
|
-
setModuleValue={setModuleValue}
|
|
224
|
-
/>
|
|
225
|
-
))}
|
|
226
|
-
</div>
|
|
227
|
-
</TUIKitProvider>
|
|
228
|
-
);
|
|
229
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
2
|
-
import { TUIKitContextValue } from '../../../context/TUIKitContext';
|
|
3
|
-
|
|
4
|
-
export const useCreateTUIKitContext = (value:TUIKitContextValue) => {
|
|
5
|
-
const {
|
|
6
|
-
chat,
|
|
7
|
-
language,
|
|
8
|
-
conversation,
|
|
9
|
-
contactData,
|
|
10
|
-
customClasses,
|
|
11
|
-
setActiveConversation,
|
|
12
|
-
myProfile,
|
|
13
|
-
TUIManageShow,
|
|
14
|
-
setTUIManageShow,
|
|
15
|
-
TUIProfileShow,
|
|
16
|
-
setTUIProfileShow,
|
|
17
|
-
setActiveContact,
|
|
18
|
-
} = value;
|
|
19
|
-
|
|
20
|
-
const TUIKitContext = useMemo(
|
|
21
|
-
() => ({
|
|
22
|
-
chat,
|
|
23
|
-
language,
|
|
24
|
-
conversation,
|
|
25
|
-
contactData,
|
|
26
|
-
customClasses,
|
|
27
|
-
setActiveConversation,
|
|
28
|
-
myProfile,
|
|
29
|
-
TUIManageShow,
|
|
30
|
-
setTUIManageShow,
|
|
31
|
-
TUIProfileShow,
|
|
32
|
-
setTUIProfileShow,
|
|
33
|
-
setActiveContact,
|
|
34
|
-
}),
|
|
35
|
-
[
|
|
36
|
-
language,
|
|
37
|
-
conversation,
|
|
38
|
-
contactData,
|
|
39
|
-
customClasses,
|
|
40
|
-
chat,
|
|
41
|
-
TUIManageShow,
|
|
42
|
-
TUIProfileShow,
|
|
43
|
-
setTUIProfileShow,
|
|
44
|
-
myProfile,
|
|
45
|
-
],
|
|
46
|
-
);
|
|
47
|
-
return TUIKitContext;
|
|
48
|
-
};
|