@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,99 +0,0 @@
|
|
|
1
|
-
import React, { useState, useCallback, useEffect } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
TUIStore,
|
|
4
|
-
StoreName,
|
|
5
|
-
IGroupModel
|
|
6
|
-
} from '@tencentcloud/chat-uikit-engine';
|
|
7
|
-
import { useTranslation } from 'react-i18next';
|
|
8
|
-
import {
|
|
9
|
-
ChatSDK,
|
|
10
|
-
Conversation,
|
|
11
|
-
Profile,
|
|
12
|
-
Friend,
|
|
13
|
-
FriendApplication,
|
|
14
|
-
} from '@tencentcloud/chat';
|
|
15
|
-
|
|
16
|
-
interface blockData {
|
|
17
|
-
type: 'block',
|
|
18
|
-
data: Profile
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
interface friendData {
|
|
22
|
-
type: 'friend',
|
|
23
|
-
data: Friend
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
interface friendApplicationData {
|
|
27
|
-
type: 'friendApplication',
|
|
28
|
-
data: FriendApplication
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
interface addFriendData {
|
|
32
|
-
type: 'addFriend',
|
|
33
|
-
data: Profile
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
interface GroupData {
|
|
37
|
-
type: 'group',
|
|
38
|
-
data: IGroupModel
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export type UseContactParams = blockData | friendData |
|
|
42
|
-
friendApplicationData | addFriendData| GroupData | undefined;
|
|
43
|
-
|
|
44
|
-
export interface UseChatParams{
|
|
45
|
-
chat: ChatSDK,
|
|
46
|
-
activeConversation?: Conversation,
|
|
47
|
-
language?: string,
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export const useTUIKit = ({
|
|
51
|
-
chat, activeConversation: paramsActiveConversation,
|
|
52
|
-
language,
|
|
53
|
-
}:UseChatParams) => {
|
|
54
|
-
const { i18n } = useTranslation();
|
|
55
|
-
const [conversation, setConversation] = useState<Conversation | undefined>(paramsActiveConversation);
|
|
56
|
-
const [myProfile, setMyProfile] = useState<Profile>();
|
|
57
|
-
const [TUIManageShow, setTUIManageShow] = useState<boolean>(false);
|
|
58
|
-
const [TUIProfileShow, setTUIProfileShow] = useState<boolean>(false);
|
|
59
|
-
const [contactData, setContactData] = useState<UseContactParams>();
|
|
60
|
-
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
i18n.changeLanguage(language);
|
|
63
|
-
TUIStore.watch(StoreName.USER, {
|
|
64
|
-
userProfile: (userProfileData: any) => {
|
|
65
|
-
setMyProfile(userProfileData);
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
}, [language]);
|
|
69
|
-
const setActiveConversation = useCallback(
|
|
70
|
-
(activeConversation?: Conversation) => {
|
|
71
|
-
if (activeConversation) {
|
|
72
|
-
chat?.setMessageRead({ conversationID: activeConversation.conversationID });
|
|
73
|
-
}
|
|
74
|
-
if (conversation && (activeConversation?.conversationID !== conversation.conversationID)) {
|
|
75
|
-
setTUIManageShow(false);
|
|
76
|
-
}
|
|
77
|
-
setConversation(activeConversation);
|
|
78
|
-
},
|
|
79
|
-
[chat],
|
|
80
|
-
);
|
|
81
|
-
const setActiveContact = (actionContactData?: UseContactParams) => {
|
|
82
|
-
setContactData(actionContactData);
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
useEffect(() => {
|
|
86
|
-
paramsActiveConversation && setConversation(paramsActiveConversation);
|
|
87
|
-
}, [paramsActiveConversation]);
|
|
88
|
-
return {
|
|
89
|
-
conversation,
|
|
90
|
-
contactData,
|
|
91
|
-
setActiveConversation,
|
|
92
|
-
myProfile,
|
|
93
|
-
TUIManageShow,
|
|
94
|
-
setTUIManageShow,
|
|
95
|
-
TUIProfileShow,
|
|
96
|
-
setTUIProfileShow,
|
|
97
|
-
setActiveContact,
|
|
98
|
-
};
|
|
99
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
.App {
|
|
2
|
-
height: 100%;
|
|
3
|
-
}
|
|
4
|
-
#root {
|
|
5
|
-
width: 100%;
|
|
6
|
-
height: 100%;
|
|
7
|
-
margin: 0;
|
|
8
|
-
}
|
|
9
|
-
.sample-chat-h5 {
|
|
10
|
-
position:relative;
|
|
11
|
-
width: 100%;
|
|
12
|
-
height: 100%;
|
|
13
|
-
overflow: hidden;
|
|
14
|
-
&-container {
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
width: 100%;
|
|
18
|
-
height: 100%;
|
|
19
|
-
.sample-profile {
|
|
20
|
-
position: absolute;
|
|
21
|
-
top: 0;
|
|
22
|
-
z-index: 1;
|
|
23
|
-
width:100%;
|
|
24
|
-
max-width: 100%;
|
|
25
|
-
min-width: 100%;
|
|
26
|
-
}
|
|
27
|
-
.tui-kit-input-box.tui-kit-input-box--focus {
|
|
28
|
-
outline: none;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
.tui-message-input .tui-kit-input-box--focus {
|
|
32
|
-
outline: none;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
@use "../../../styles/colors/color-theme" as *;
|
|
2
|
-
|
|
3
|
-
.tui-kit {
|
|
4
|
-
position: relative;
|
|
5
|
-
display: flex;
|
|
6
|
-
width: 100%;
|
|
7
|
-
height: 100%;
|
|
8
|
-
text-align: initial;
|
|
9
|
-
|
|
10
|
-
@include theme() {
|
|
11
|
-
background-color: get(bg-primary);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.sample-chat {
|
|
16
|
-
position: relative;
|
|
17
|
-
margin: 0 auto;
|
|
18
|
-
width: calc(100% - 20rem);
|
|
19
|
-
min-width: 850px;
|
|
20
|
-
height: 86%;
|
|
21
|
-
box-sizing: border-box;
|
|
22
|
-
border-radius: 12px;
|
|
23
|
-
overflow: hidden;
|
|
24
|
-
|
|
25
|
-
&-profile {
|
|
26
|
-
position: absolute;
|
|
27
|
-
top: 0;
|
|
28
|
-
z-index: 1;
|
|
29
|
-
width: 100%;
|
|
30
|
-
height: 100%;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&-left-container {
|
|
34
|
-
max-width: 360px;
|
|
35
|
-
min-width: 360px;
|
|
36
|
-
display: flex;
|
|
37
|
-
flex-direction: column;
|
|
38
|
-
position: relative;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&-tab {
|
|
42
|
-
display: flex;
|
|
43
|
-
align-items: center;
|
|
44
|
-
justify-content: space-around;
|
|
45
|
-
margin: 12px;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&-tab-container {
|
|
49
|
-
display: flex;
|
|
50
|
-
flex-direction: column;
|
|
51
|
-
align-items: center;
|
|
52
|
-
justify-content: center;
|
|
53
|
-
cursor: pointer;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
&-tab-text {
|
|
57
|
-
font-size: 15px;
|
|
58
|
-
line-height: 25px;
|
|
59
|
-
text-align: center;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&-tab-active {
|
|
63
|
-
color: #147aff;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.tuikit-container {
|
|
68
|
-
display: flex;
|
|
69
|
-
height: 100%;
|
|
70
|
-
position: relative;
|
|
71
|
-
text-align: initial;
|
|
72
|
-
box-shadow: 0 11px 20px 0 rgba(0, 0, 0, 30%);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.tui-chat-default {
|
|
76
|
-
width: 100%;
|
|
77
|
-
height: 100%;
|
|
78
|
-
background-size: cover;
|
|
79
|
-
background-position-x: -17px;
|
|
80
|
-
background-position-y: 173px;
|
|
81
|
-
padding: 100px 40px 0;
|
|
82
|
-
|
|
83
|
-
header {
|
|
84
|
-
display: flex;
|
|
85
|
-
align-items: center;
|
|
86
|
-
font-size: 1.75rem;
|
|
87
|
-
font-family: PingFangSC-Medium;
|
|
88
|
-
font-weight: 500;
|
|
89
|
-
color: #000;
|
|
90
|
-
letter-spacing: 0;
|
|
91
|
-
|
|
92
|
-
img {
|
|
93
|
-
width: 32px;
|
|
94
|
-
margin: 0 10px;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.content {
|
|
99
|
-
max-width: 393px;
|
|
100
|
-
font-size: 16px;
|
|
101
|
-
line-height: 24px;
|
|
102
|
-
font-family: PingFangSC-Regular;
|
|
103
|
-
font-weight: 400;
|
|
104
|
-
color: #666;
|
|
105
|
-
letter-spacing: 0;
|
|
106
|
-
padding: 36px 0 20px;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.link {
|
|
110
|
-
font-size: 14px;
|
|
111
|
-
line-height: 20px;
|
|
112
|
-
font-family: PingFangSC-Regular;
|
|
113
|
-
font-weight: 400;
|
|
114
|
-
color: #666;
|
|
115
|
-
letter-spacing: 0;
|
|
116
|
-
|
|
117
|
-
a {
|
|
118
|
-
font-family: PingFangSC-Regular;
|
|
119
|
-
font-weight: 400;
|
|
120
|
-
color: #006eff;
|
|
121
|
-
letter-spacing: 0;
|
|
122
|
-
text-decoration: none;
|
|
123
|
-
padding: 0 5px;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
body {
|
|
129
|
-
#webpack-dev-server-client-overlay {
|
|
130
|
-
display: none !important;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren, useContext, useLayoutEffect } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
ChatSDK,
|
|
4
|
-
Conversation,
|
|
5
|
-
Profile,
|
|
6
|
-
} from '@tencentcloud/chat';
|
|
7
|
-
import { UseContactParams } from '../components/TUIKit/hooks/useTUIKit';
|
|
8
|
-
|
|
9
|
-
export interface TUIKitContextValue {
|
|
10
|
-
chat: ChatSDK,
|
|
11
|
-
language: string,
|
|
12
|
-
conversation?: Conversation,
|
|
13
|
-
contactData?: UseContactParams,
|
|
14
|
-
setActiveConversation: (conversation?: Conversation) => void,
|
|
15
|
-
customClasses?: unknown,
|
|
16
|
-
myProfile?: Profile,
|
|
17
|
-
TUIManageShow?: boolean,
|
|
18
|
-
setTUIManageShow?: React.Dispatch<React.SetStateAction<boolean>>,
|
|
19
|
-
TUIProfileShow?: boolean,
|
|
20
|
-
setActiveContact: (UseContactParams?: UseContactParams) => void,
|
|
21
|
-
setTUIProfileShow?: React.Dispatch<React.SetStateAction<boolean>>,
|
|
22
|
-
}
|
|
23
|
-
export const TUIKitContext = React.createContext<TUIKitContextValue | undefined>(undefined);
|
|
24
|
-
export function TUIKitProvider({ children, value }:PropsWithChildren<{
|
|
25
|
-
value: TUIKitContextValue
|
|
26
|
-
}>):React.ReactElement {
|
|
27
|
-
|
|
28
|
-
useLayoutEffect(() => {
|
|
29
|
-
document.documentElement.dataset.chatTheme = 'light';
|
|
30
|
-
}, []);
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<TUIKitContext.Provider value={(value as unknown) as TUIKitContextValue}>
|
|
34
|
-
{children}
|
|
35
|
-
</TUIKitContext.Provider>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
export const useTUIKitContext = (componentName?:string):TUIKitContextValue => {
|
|
39
|
-
const contextValue = useContext(TUIKitContext);
|
|
40
|
-
if (!contextValue && componentName) {
|
|
41
|
-
return {} as TUIKitContextValue;
|
|
42
|
-
}
|
|
43
|
-
return (contextValue as unknown) as TUIKitContextValue;
|
|
44
|
-
};
|