@tencentcloud/chat-uikit-react 2.2.4 → 2.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +2 -2
- package/.eslintrc.js +141 -31
- package/.lintstagedrc.json +1 -1
- package/.stylelintrc.js +17 -18
- package/CHANGELOG.md +19 -2
- package/README.md +8 -8
- package/dist/cjs/assets/fonts/iconfont.ttf +0 -0
- package/dist/cjs/assets/fonts/iconfont.woff +0 -0
- package/dist/cjs/assets/fonts/iconfont.woff2 +0 -0
- package/dist/cjs/components/Avatar/Avatar.d.ts +4 -4
- package/dist/cjs/components/Checkbox/index.d.ts +2 -2
- package/dist/cjs/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
- package/dist/cjs/components/ConversationCreate/ConversationCreate.js +1 -1
- package/dist/cjs/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
- package/dist/cjs/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
- package/dist/cjs/components/ConversationPreview/ConversationListContainer.d.ts +2 -2
- package/dist/cjs/components/ConversationPreview/ConversationPreview.d.ts +8 -8
- package/dist/cjs/components/ConversationPreview/ConversationPreview.js +1 -1
- package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.d.ts +2 -2
- package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.js +1 -1
- package/dist/cjs/components/ConversationPreview/utils.js +1 -1
- package/dist/cjs/components/ConversationSearch/ConversationSearchResult.d.ts +3 -3
- package/dist/cjs/components/ConversationSearch/ConversationSearchResult.js +1 -1
- package/dist/cjs/components/Icon/Icon.d.ts +3 -3
- package/dist/cjs/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +4 -4
- package/dist/cjs/components/Input/Input.d.ts +4 -4
- package/dist/cjs/components/Model/index.d.ts +2 -2
- package/dist/cjs/components/Plugins/index.d.ts +4 -4
- package/dist/cjs/components/Popup/index.d.ts +2 -2
- package/dist/cjs/components/Switch/Switch.d.ts +2 -2
- package/dist/cjs/components/TUIChat/TUIChat.d.ts +12 -12
- package/dist/cjs/components/TUIChat/TUIChat.js +1 -1
- package/dist/cjs/components/TUIChatHeader/TUIChatHeader.d.ts +5 -5
- package/dist/cjs/components/TUIChatHeader/TUIChatHeader.js +1 -1
- package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.d.ts +5 -5
- package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContact.d.ts +3 -3
- package/dist/cjs/components/TUIContact/TUIContact.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/TUIContactInfo.d.ts +3 -3
- package/dist/cjs/components/TUIContact/TUIContactInfo/TUIContactInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/basicInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/blockInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/friendApplication.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/groupInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/hooks/useContactInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.d.ts +3 -3
- package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
- package/dist/cjs/components/TUIContact/hooks/useTUIContact.js +1 -1
- package/dist/cjs/components/TUIContactSearch/TUIContactSearch.js +1 -1
- package/dist/cjs/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
- package/dist/cjs/components/TUIConversation/TUIConversation.d.ts +2 -2
- package/dist/cjs/components/TUIConversationList/TUIConversationList.d.ts +6 -6
- package/dist/cjs/components/TUIConversationList/TUIConversationList.js +1 -1
- package/dist/cjs/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
- package/dist/cjs/components/TUIManage/TUIManage.d.ts +2 -2
- package/dist/cjs/components/TUIManage/TUIManage.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageAudio.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageAvatar.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageBubble.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageContext.d.ts +2 -2
- package/dist/cjs/components/TUIMessage/MessageContext.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageCustom.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageName.js +1 -1
- package/dist/cjs/components/TUIMessage/MessagePlugins.d.ts +4 -4
- package/dist/cjs/components/TUIMessage/MessagePlugins.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageProgress.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageRevoke.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageStatus.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageSystem.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageText.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageTip.js +1 -1
- package/dist/cjs/components/TUIMessage/TUIMessage.d.ts +19 -19
- package/dist/cjs/components/TUIMessage/TUIMessage.js +1 -1
- package/dist/cjs/components/TUIMessage/TUIMessageDefault.js +1 -1
- package/dist/cjs/components/TUIMessage/hooks/useMessageHandler.js +1 -1
- package/dist/cjs/components/TUIMessage/hooks/useMessageReply.js +1 -1
- package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.d.ts +2 -2
- package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
- package/dist/cjs/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIForward.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIMessageInput.d.ts +7 -7
- package/dist/cjs/components/TUIMessageInput/TUIMessageInput.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.d.ts +2 -2
- package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useUploadPicker.js +1 -1
- package/dist/cjs/components/TUIMessageList/TUIMessageList.d.ts +2 -2
- package/dist/cjs/components/TUIMessageList/TUIMessageList.js +1 -1
- package/dist/cjs/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
- package/dist/cjs/components/TUIProfile/TUIProfile.d.ts +3 -3
- package/dist/cjs/components/TUIProfile/TUIProfile.js +1 -1
- package/dist/cjs/components/TUIProfile/TUIProfileDefault.d.ts +2 -2
- package/dist/cjs/components/TUIProfile/TUIProfileDefault.js +1 -1
- package/dist/cjs/components/Toast/index.d.ts +2 -2
- package/dist/cjs/context/ComponentContext.d.ts +12 -12
- package/dist/cjs/context/LanguageContext.js +1 -0
- package/dist/cjs/context/TUIChatActionContext.d.ts +3 -3
- package/dist/cjs/context/TUIChatStateContext.d.ts +5 -5
- package/dist/cjs/context/TUIContactContext.d.ts +4 -4
- package/dist/cjs/context/TUIConversationContext.js +1 -1
- package/dist/cjs/context/TUIMessageContext.d.ts +17 -17
- package/dist/cjs/context/TUIMessageInputContext.d.ts +4 -4
- package/dist/cjs/context/ThemeContext.js +1 -0
- package/dist/cjs/context/UIKitContext.d.ts +25 -0
- package/dist/cjs/context/UIKitContext.js +1 -0
- package/dist/cjs/context/UIManagerContext.d.ts +46 -0
- package/dist/cjs/context/UIManagerContext.js +1 -0
- package/dist/cjs/hooks/useConversation.d.ts +2 -2
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.d.css +984 -1039
- package/dist/cjs/index.d.ts +2 -4
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/locales/en-US/TUIGlobal.js +1 -0
- package/dist/cjs/locales/en-US/index.js +1 -1
- package/dist/cjs/locales/ja-JP/TUIGlobal.js +1 -0
- package/dist/cjs/locales/ja-JP/index.js +1 -1
- package/dist/cjs/locales/ko-KR/TUIGlobal.js +1 -0
- package/dist/cjs/locales/ko-KR/index.js +1 -1
- package/dist/cjs/locales/zh-CN/TUIGlobal.js +1 -0
- package/dist/cjs/locales/zh-CN/index.js +1 -1
- package/dist/esm/assets/fonts/iconfont.ttf +0 -0
- package/dist/esm/assets/fonts/iconfont.woff +0 -0
- package/dist/esm/assets/fonts/iconfont.woff2 +0 -0
- package/dist/esm/components/Avatar/Avatar.d.ts +4 -4
- package/dist/esm/components/Checkbox/index.d.ts +2 -2
- package/dist/esm/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
- package/dist/esm/components/ConversationCreate/ConversationCreate.js +1 -1
- package/dist/esm/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
- package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
- package/dist/esm/components/ConversationPreview/ConversationListContainer.d.ts +2 -2
- package/dist/esm/components/ConversationPreview/ConversationPreview.d.ts +8 -8
- package/dist/esm/components/ConversationPreview/ConversationPreview.js +1 -1
- package/dist/esm/components/ConversationPreview/ConversationPreviewContent.d.ts +2 -2
- package/dist/esm/components/ConversationPreview/ConversationPreviewContent.js +1 -1
- package/dist/esm/components/ConversationPreview/utils.js +1 -1
- package/dist/esm/components/ConversationSearch/ConversationSearchResult.d.ts +3 -3
- package/dist/esm/components/ConversationSearch/ConversationSearchResult.js +1 -1
- package/dist/esm/components/Icon/Icon.d.ts +3 -3
- package/dist/esm/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +4 -4
- package/dist/esm/components/Input/Input.d.ts +4 -4
- package/dist/esm/components/Model/index.d.ts +2 -2
- package/dist/esm/components/Plugins/index.d.ts +4 -4
- package/dist/esm/components/Popup/index.d.ts +2 -2
- package/dist/esm/components/Switch/Switch.d.ts +2 -2
- package/dist/esm/components/TUIChat/TUIChat.d.ts +12 -12
- package/dist/esm/components/TUIChat/TUIChat.js +1 -1
- package/dist/esm/components/TUIChatHeader/TUIChatHeader.d.ts +5 -5
- package/dist/esm/components/TUIChatHeader/TUIChatHeader.js +1 -1
- package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.d.ts +5 -5
- package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
- package/dist/esm/components/TUIContact/TUIContact.d.ts +3 -3
- package/dist/esm/components/TUIContact/TUIContact.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/TUIContactInfo.d.ts +3 -3
- package/dist/esm/components/TUIContact/TUIContactInfo/TUIContactInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/basicInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/blockInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/friendApplication.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/groupInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/hooks/useContactInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.d.ts +3 -3
- package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
- package/dist/esm/components/TUIContact/hooks/useTUIContact.js +1 -1
- package/dist/esm/components/TUIContactSearch/TUIContactSearch.js +1 -1
- package/dist/esm/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
- package/dist/esm/components/TUIConversation/TUIConversation.d.ts +2 -2
- package/dist/esm/components/TUIConversationList/TUIConversationList.d.ts +6 -6
- package/dist/esm/components/TUIConversationList/TUIConversationList.js +1 -1
- package/dist/esm/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
- package/dist/esm/components/TUIManage/TUIManage.d.ts +2 -2
- package/dist/esm/components/TUIManage/TUIManage.js +1 -1
- package/dist/esm/components/TUIMessage/MessageAudio.js +1 -1
- package/dist/esm/components/TUIMessage/MessageAvatar.js +1 -1
- package/dist/esm/components/TUIMessage/MessageBubble.js +1 -1
- package/dist/esm/components/TUIMessage/MessageContext.d.ts +2 -2
- package/dist/esm/components/TUIMessage/MessageContext.js +1 -1
- package/dist/esm/components/TUIMessage/MessageCustom.js +1 -1
- package/dist/esm/components/TUIMessage/MessageName.js +1 -1
- package/dist/esm/components/TUIMessage/MessagePlugins.d.ts +4 -4
- package/dist/esm/components/TUIMessage/MessagePlugins.js +1 -1
- package/dist/esm/components/TUIMessage/MessageProgress.js +1 -1
- package/dist/esm/components/TUIMessage/MessageRevoke.js +1 -1
- package/dist/esm/components/TUIMessage/MessageStatus.js +1 -1
- package/dist/esm/components/TUIMessage/MessageSystem.js +1 -1
- package/dist/esm/components/TUIMessage/MessageText.js +1 -1
- package/dist/esm/components/TUIMessage/MessageTip.js +1 -1
- package/dist/esm/components/TUIMessage/TUIMessage.d.ts +19 -19
- package/dist/esm/components/TUIMessage/TUIMessage.js +1 -1
- package/dist/esm/components/TUIMessage/TUIMessageDefault.js +1 -1
- package/dist/esm/components/TUIMessage/hooks/useMessageHandler.js +1 -1
- package/dist/esm/components/TUIMessage/hooks/useMessageReply.js +1 -1
- package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.d.ts +2 -2
- package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
- package/dist/esm/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIForward.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIMessageInput.d.ts +7 -7
- package/dist/esm/components/TUIMessageInput/TUIMessageInput.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.d.ts +2 -2
- package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useUploadPicker.js +1 -1
- package/dist/esm/components/TUIMessageList/TUIMessageList.d.ts +2 -2
- package/dist/esm/components/TUIMessageList/TUIMessageList.js +1 -1
- package/dist/esm/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
- package/dist/esm/components/TUIProfile/TUIProfile.d.ts +3 -3
- package/dist/esm/components/TUIProfile/TUIProfile.js +1 -1
- package/dist/esm/components/TUIProfile/TUIProfileDefault.d.ts +2 -2
- package/dist/esm/components/TUIProfile/TUIProfileDefault.js +1 -1
- package/dist/esm/components/Toast/index.d.ts +2 -2
- package/dist/esm/context/ComponentContext.d.ts +12 -12
- package/dist/esm/context/LanguageContext.js +1 -0
- package/dist/esm/context/TUIChatActionContext.d.ts +3 -3
- package/dist/esm/context/TUIChatStateContext.d.ts +5 -5
- package/dist/esm/context/TUIContactContext.d.ts +4 -4
- package/dist/esm/context/TUIConversationContext.js +1 -1
- package/dist/esm/context/TUIMessageContext.d.ts +17 -17
- package/dist/esm/context/TUIMessageInputContext.d.ts +4 -4
- package/dist/esm/context/ThemeContext.js +1 -0
- package/dist/esm/context/UIKitContext.d.ts +25 -0
- package/dist/esm/context/UIKitContext.js +1 -0
- package/dist/esm/context/UIManagerContext.d.ts +46 -0
- package/dist/esm/context/UIManagerContext.js +1 -0
- package/dist/esm/hooks/useConversation.d.ts +2 -2
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.d.css +984 -1039
- package/dist/esm/index.d.ts +2 -4
- package/dist/esm/index.js +1 -1
- package/dist/esm/locales/en-US/TUIGlobal.js +1 -0
- package/dist/esm/locales/en-US/index.js +1 -1
- package/dist/esm/locales/ja-JP/TUIGlobal.js +1 -0
- package/dist/esm/locales/ja-JP/index.js +1 -1
- package/dist/esm/locales/ko-KR/TUIGlobal.js +1 -0
- package/dist/esm/locales/ko-KR/index.js +1 -1
- package/dist/esm/locales/zh-CN/TUIGlobal.js +1 -0
- package/dist/esm/locales/zh-CN/index.js +1 -1
- package/package.json +9 -7
- package/rollup.config.js +13 -2
- package/src/assets/fonts/iconfont.ttf +0 -0
- package/src/assets/fonts/iconfont.woff +0 -0
- package/src/assets/fonts/iconfont.woff2 +0 -0
- package/src/components/ConversationCreate/ConversationCreatGroupDetail.tsx +4 -4
- package/src/components/ConversationCreate/ConversationCreate.tsx +2 -2
- package/src/components/ConversationCreate/ConversationCreateUserSelectList.tsx +3 -2
- package/src/components/ConversationCreate/styles/ConversationCreatGroupDetail.scss +16 -7
- package/src/components/ConversationCreate/styles/index.scss +23 -13
- package/src/components/ConversationPreview/ConversationPreview.tsx +21 -21
- package/src/components/ConversationPreview/ConversationPreviewContent.tsx +4 -4
- package/src/components/ConversationPreview/styles/index.scss +44 -14
- package/src/components/ConversationPreview/utils.tsx +36 -28
- package/src/components/Input/styles/index.scss +7 -5
- package/src/components/Model/styles/layout.scss +3 -3
- package/src/components/Plugins/styles/color.scss +17 -3
- package/src/components/Popup/styles/layout.scss +2 -1
- package/src/components/TUIChat/TUIChat.tsx +4 -3
- package/src/components/TUIChatHeader/TUIChatHeaderDefault.tsx +3 -3
- package/src/components/TUIChatHeader/styles/layout.scss +13 -2
- package/src/components/TUIContact/TUIContact.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/TUIContactInfo.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/basicInfo.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/blockInfo.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/friendApplication.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/friendInfo.tsx +4 -3
- package/src/components/TUIContact/TUIContactInfo/groupInfo.tsx +3 -3
- package/src/components/TUIContact/TUIContactInfo/hooks/useContactInfo.tsx +2 -2
- package/src/components/TUIContact/TUIContactList/TUIContactList.tsx +5 -5
- package/src/components/TUIContact/hooks/useTUIContact.tsx +2 -2
- package/src/components/TUIContactSearch/TUIContactSearch.tsx +2 -2
- package/src/components/TUIContactSearch/hooks/useContactSearch.tsx +2 -2
- package/src/components/TUIConversationList/TUIConversationList.tsx +3 -4
- package/src/components/TUIConversationList/hooks/useConversationUpdate.tsx +2 -2
- package/src/components/TUIConversationList/index.scss +25 -7
- package/src/components/TUIManage/TUIManage.tsx +3 -3
- package/src/components/TUIManage/styles/index.scss +16 -6
- package/src/components/TUIMessage/MessageStatus.tsx +2 -2
- package/src/components/TUIMessage/MessageText.tsx +16 -15
- package/src/components/TUIMessage/hooks/useMessageHandler.ts +2 -2
- package/src/components/TUIMessage/hooks/useMessageReply.ts +2 -2
- package/src/components/TUIMessage/styles/color.scss +20 -9
- package/src/components/TUIMessage/styles/layout.scss +44 -11
- package/src/components/TUIMessageInput/TUIMessageInput.tsx +1 -1
- package/src/components/TUIMessageInput/hooks/useHandleForwardMessage.tsx +2 -2
- package/src/components/TUIMessageInput/hooks/useMessageInputText.tsx +2 -2
- package/src/components/TUIMessageInput/styles/color.scss +25 -6
- package/src/components/TUIMessageInput/styles/layout.scss +58 -16
- package/src/components/TUIMessageList/hooks/useMessageListElement.tsx +2 -2
- package/src/components/TUIMessageList/styles/layout.scss +16 -2
- package/src/components/TUIProfile/TUIProfile.tsx +3 -3
- package/src/components/TUIProfile/TUIProfileDefault.tsx +2 -2
- package/src/components/TUIProfile/styles/layout.scss +33 -16
- package/src/components/index.ts +0 -1
- package/src/context/LanguageContext.tsx +59 -0
- package/src/context/ThemeContext.tsx +61 -0
- package/src/context/UIKitContext.tsx +67 -0
- package/src/context/UIManagerContext.tsx +163 -0
- package/src/context/index.ts +3 -2
- package/src/locales/en-US/index.ts +1 -1
- package/src/locales/ja-JP/index.ts +2 -0
- package/src/locales/ko-KR/TUIGlobal.ts +2 -2
- package/src/locales/ko-KR/index.ts +2 -0
- package/src/locales/zh-CN/index.ts +2 -2
- package/src/styles/colors/_color-dark.scss +35 -0
- package/src/styles/colors/_color-light.scss +35 -0
- package/src/styles/colors/_color-theme.scss +54 -0
- package/src/styles/fonts/icon-font.scss +18 -0
- package/src/styles/index.scss +4 -0
- package/src/styles/normalize.scss +355 -0
- package/dist/cjs/components/Icon/images/chats-selected.svg.js +0 -1
- package/dist/cjs/components/Icon/images/chats.svg.js +0 -1
- package/dist/cjs/components/Icon/images/contacts-selected.svg.js +0 -1
- package/dist/cjs/components/Icon/images/contacts.svg.js +0 -1
- package/dist/cjs/components/TUIKit/TUIKit.d.ts +0 -12
- package/dist/cjs/components/TUIKit/TUIKit.js +0 -1
- package/dist/cjs/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +0 -21
- package/dist/cjs/components/TUIKit/hooks/useCreateTUIKitContext.js +0 -1
- package/dist/cjs/components/TUIKit/hooks/useTUIKit.d.ts +0 -43
- package/dist/cjs/components/TUIKit/hooks/useTUIKit.js +0 -1
- package/dist/cjs/context/TUIKitContext.d.ts +0 -25
- package/dist/cjs/context/TUIKitContext.js +0 -1
- package/dist/esm/components/Icon/images/chats-selected.svg.js +0 -1
- package/dist/esm/components/Icon/images/chats.svg.js +0 -1
- package/dist/esm/components/Icon/images/contacts-selected.svg.js +0 -1
- package/dist/esm/components/Icon/images/contacts.svg.js +0 -1
- package/dist/esm/components/TUIKit/TUIKit.d.ts +0 -12
- package/dist/esm/components/TUIKit/TUIKit.js +0 -1
- package/dist/esm/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +0 -21
- package/dist/esm/components/TUIKit/hooks/useCreateTUIKitContext.js +0 -1
- package/dist/esm/components/TUIKit/hooks/useTUIKit.d.ts +0 -43
- package/dist/esm/components/TUIKit/hooks/useTUIKit.js +0 -1
- package/dist/esm/context/TUIKitContext.d.ts +0 -25
- package/dist/esm/context/TUIKitContext.js +0 -1
- package/src/components/TUIKit/TUIKit.tsx +0 -228
- package/src/components/TUIKit/hooks/useCreateTUIKitContext.tsx +0 -48
- package/src/components/TUIKit/hooks/useTUIKit.tsx +0 -99
- package/src/components/TUIKit/index.ts +0 -3
- package/src/components/TUIKit/styles/h5.scss +0 -34
- package/src/components/TUIKit/styles/index.scss +0 -112
- package/src/components/TUIKit/styles/reset.scss +0 -67
- package/src/context/TUIKitContext.tsx +0 -39
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { PropsWithChildren, useContext, createContext } from 'react';
|
|
2
|
+
import type {
|
|
3
|
+
ChatSDK,
|
|
4
|
+
Conversation,
|
|
5
|
+
} from '@tencentcloud/chat';
|
|
6
|
+
import { TUILogin } from '@tencentcloud/tui-core';
|
|
7
|
+
import { ThemeProvider, useTheme } from './ThemeContext';
|
|
8
|
+
import { LanguageProvider, useLanguage } from './LanguageContext';
|
|
9
|
+
import { UIManagerProvider } from './UIManagerContext';
|
|
10
|
+
|
|
11
|
+
interface UIKitContextType {
|
|
12
|
+
chat: ChatSDK;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface UIKitProviderProps {
|
|
16
|
+
chat?: ChatSDK;
|
|
17
|
+
language?: string;
|
|
18
|
+
theme?: string;
|
|
19
|
+
colors?: Record<string, string>;
|
|
20
|
+
customClasses?: string;
|
|
21
|
+
activeConversation?: Conversation;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const UIKitContext = createContext<UIKitContextType | null>(null);
|
|
25
|
+
|
|
26
|
+
function UIKitProvider(props: PropsWithChildren<UIKitProviderProps>) {
|
|
27
|
+
const {
|
|
28
|
+
chat = TUILogin.getContext().chat,
|
|
29
|
+
language,
|
|
30
|
+
theme,
|
|
31
|
+
colors,
|
|
32
|
+
customClasses,
|
|
33
|
+
activeConversation,
|
|
34
|
+
children,
|
|
35
|
+
} = props;
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<LanguageProvider language={language}>
|
|
39
|
+
<ThemeProvider theme={theme} colors={colors}>
|
|
40
|
+
<UIKitContext.Provider value={{ chat }}>
|
|
41
|
+
<UIManagerProvider activeConversation={activeConversation} customClasses={customClasses}>
|
|
42
|
+
{children}
|
|
43
|
+
</UIManagerProvider>
|
|
44
|
+
</UIKitContext.Provider>
|
|
45
|
+
</ThemeProvider>
|
|
46
|
+
</LanguageProvider>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const useUIKit = (componentName?: string) => {
|
|
51
|
+
const languageContext = useLanguage();
|
|
52
|
+
const themeContext = useTheme();
|
|
53
|
+
const uikitContext = useContext(UIKitContext);
|
|
54
|
+
if (!uikitContext) {
|
|
55
|
+
throw new Error('useUIKit must be used within a UIKitProvider');
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
...themeContext,
|
|
59
|
+
...languageContext,
|
|
60
|
+
...uikitContext,
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
UIKitProvider,
|
|
66
|
+
useUIKit,
|
|
67
|
+
};
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
useState,
|
|
3
|
+
useContext,
|
|
4
|
+
useCallback,
|
|
5
|
+
PropsWithChildren,
|
|
6
|
+
useEffect,
|
|
7
|
+
} from 'react';
|
|
8
|
+
import type {
|
|
9
|
+
Conversation,
|
|
10
|
+
Profile,
|
|
11
|
+
Friend,
|
|
12
|
+
FriendApplication,
|
|
13
|
+
} from '@tencentcloud/chat';
|
|
14
|
+
import {
|
|
15
|
+
TUIStore,
|
|
16
|
+
StoreName,
|
|
17
|
+
type IConversationModel,
|
|
18
|
+
} from '@tencentcloud/chat-uikit-engine';
|
|
19
|
+
import type { IGroupModel } from '@tencentcloud/chat-uikit-engine';
|
|
20
|
+
import { useUIKit } from './UIKitContext';
|
|
21
|
+
|
|
22
|
+
type blockData = {
|
|
23
|
+
type: 'block';
|
|
24
|
+
data: Profile;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
type friendData = {
|
|
28
|
+
type: 'friend';
|
|
29
|
+
data: Friend;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
type friendApplicationData = {
|
|
33
|
+
type: 'friendApplication';
|
|
34
|
+
data: FriendApplication;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
type addFriendData = {
|
|
38
|
+
type: 'addFriend';
|
|
39
|
+
data: Profile;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
type GroupData = {
|
|
43
|
+
type: 'group';
|
|
44
|
+
data: IGroupModel;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
type UseContactParams =
|
|
48
|
+
| blockData
|
|
49
|
+
| friendData
|
|
50
|
+
| friendApplicationData
|
|
51
|
+
| addFriendData
|
|
52
|
+
| GroupData
|
|
53
|
+
| undefined;
|
|
54
|
+
|
|
55
|
+
type UIManagerContextType = {
|
|
56
|
+
conversation?: Conversation;
|
|
57
|
+
contactData?: UseContactParams;
|
|
58
|
+
customClasses?: unknown;
|
|
59
|
+
myProfile?: Profile;
|
|
60
|
+
TUIManageShow?: boolean;
|
|
61
|
+
TUIProfileShow?: boolean;
|
|
62
|
+
setTUIManageShow: React.Dispatch<React.SetStateAction<boolean>>;
|
|
63
|
+
setTUIProfileShow: React.Dispatch<React.SetStateAction<boolean>>;
|
|
64
|
+
setActiveConversation: (conversation?: Conversation) => void;
|
|
65
|
+
setActiveContact: (useContactParams?: UseContactParams) => void;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
type UIManagerProviderProps = {
|
|
69
|
+
customClasses: string;
|
|
70
|
+
activeConversation: Conversation;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const UIManagerContext = React.createContext<UIManagerContextType | null>(null);
|
|
74
|
+
|
|
75
|
+
function UIManagerProvider(props: PropsWithChildren<Partial<UIManagerProviderProps>>) {
|
|
76
|
+
const {
|
|
77
|
+
customClasses,
|
|
78
|
+
activeConversation,
|
|
79
|
+
children,
|
|
80
|
+
} = props;
|
|
81
|
+
|
|
82
|
+
const { chat } = useUIKit();
|
|
83
|
+
|
|
84
|
+
const [conversation, setConversation] = useState<Conversation | undefined>(activeConversation);
|
|
85
|
+
const [contactData, setContactData] = useState<UseContactParams>();
|
|
86
|
+
const [myProfile, setMyProfile] = useState<Profile>();
|
|
87
|
+
const [TUIManageShow, setTUIManageShow] = useState<boolean>(false);
|
|
88
|
+
const [TUIProfileShow, setTUIProfileShow] = useState<boolean>(false);
|
|
89
|
+
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
TUIStore.watch(StoreName.USER, {
|
|
92
|
+
userProfile: onMyProfileUpdated,
|
|
93
|
+
});
|
|
94
|
+
TUIStore.watch(StoreName.CONV, {
|
|
95
|
+
currentConversation: onCurrentConversationUpdated,
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
return () => {
|
|
99
|
+
TUIStore.unwatch(StoreName.USER, {
|
|
100
|
+
userProfile: onMyProfileUpdated,
|
|
101
|
+
});
|
|
102
|
+
TUIStore.unwatch(StoreName.CONV, {
|
|
103
|
+
currentConversation: onCurrentConversationUpdated,
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
}, []);
|
|
107
|
+
|
|
108
|
+
const setActiveConversation = useCallback((_activeConversation?: Conversation) => {
|
|
109
|
+
if (_activeConversation) {
|
|
110
|
+
chat?.setMessageRead({ conversationID: _activeConversation.conversationID });
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (_activeConversation?.conversationID !== conversation?.conversationID) {
|
|
114
|
+
setTUIManageShow(false);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
setConversation(_activeConversation);
|
|
118
|
+
}, []);
|
|
119
|
+
|
|
120
|
+
function onMyProfileUpdated(userProfileData: unknown) {
|
|
121
|
+
setMyProfile(userProfileData as Profile);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function onCurrentConversationUpdated(conversationModel: IConversationModel) {
|
|
125
|
+
setActiveConversation(conversationModel?.getConversation());
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function setActiveContact(actionContactData?: UseContactParams) {
|
|
129
|
+
setContactData(actionContactData);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const value = {
|
|
133
|
+
conversation,
|
|
134
|
+
contactData,
|
|
135
|
+
setActiveConversation,
|
|
136
|
+
myProfile,
|
|
137
|
+
TUIManageShow,
|
|
138
|
+
setTUIManageShow,
|
|
139
|
+
TUIProfileShow,
|
|
140
|
+
setTUIProfileShow,
|
|
141
|
+
setActiveContact,
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
return (
|
|
145
|
+
<UIManagerContext.Provider value={value}>
|
|
146
|
+
{children}
|
|
147
|
+
</UIManagerContext.Provider>
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const useUIManager = (componentName?: string) => {
|
|
152
|
+
const context = useContext(UIManagerContext);
|
|
153
|
+
if (!context) {
|
|
154
|
+
throw new Error('useUIManager must be used within a UIManagerProvider');
|
|
155
|
+
}
|
|
156
|
+
return context;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export {
|
|
160
|
+
UIManagerProvider,
|
|
161
|
+
useUIManager,
|
|
162
|
+
UIManagerContextType,
|
|
163
|
+
};
|
package/src/context/index.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './UIKitContext';
|
|
2
|
+
export * from './UIManagerContext';
|
|
2
3
|
export * from './TUIChatStateContext';
|
|
3
4
|
export * from './TUIChatActionContext';
|
|
4
5
|
export * from './TUIMessageContext';
|
|
5
6
|
export * from './ComponentContext';
|
|
6
7
|
export * from './TUIMessageInputContext';
|
|
7
|
-
export * from './TUIContactContext';
|
|
8
|
+
export * from './TUIContactContext';
|
|
@@ -1,8 +1,8 @@
|
|
|
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
|
-
import TUIGlobal from './TUIProfile';
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
export const message = {
|
|
@@ -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,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,
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
$dark-colors: (
|
|
2
|
+
// bg
|
|
3
|
+
--chat-theme-dark-bg-5: #76777e,
|
|
4
|
+
--chat-theme-dark-bg-4: #5d5e67,
|
|
5
|
+
--chat-theme-dark-bg-3: #454650,
|
|
6
|
+
--chat-theme-dark-bg-2: #2e303a,
|
|
7
|
+
--chat-theme-dark-bg-1: #191b26,
|
|
8
|
+
--chat-theme-dark-bg-primary: #191b26,
|
|
9
|
+
--chat-theme-dark-bg-secondary: #2e303a,
|
|
10
|
+
--chat-theme-dark-bg-active: #4e4e4e,
|
|
11
|
+
// text
|
|
12
|
+
--chat-theme-dark-text-5: #000,
|
|
13
|
+
--chat-theme-dark-text-4: #666,
|
|
14
|
+
--chat-theme-dark-text-3: #7a7a7a,
|
|
15
|
+
--chat-theme-dark-text-2: #7a7a7a,
|
|
16
|
+
--chat-theme-dark-text-1: #7a7a7a,
|
|
17
|
+
--chat-theme-dark-text-primary: #fff,
|
|
18
|
+
--chat-theme-dark-text-secondary: #8b8b8b,
|
|
19
|
+
// status
|
|
20
|
+
--chat-theme-dark-status-info: #147aff,
|
|
21
|
+
--chat-theme-dark-status-success: #34c759,
|
|
22
|
+
--chat-theme-dark-status-danger: #ff3742,
|
|
23
|
+
// border
|
|
24
|
+
--chat-theme-dark-border-5: #4e4e4e,
|
|
25
|
+
// box-shadow
|
|
26
|
+
--chat-theme-dark-box-shadow-1: (rgba(203, 203, 203, 0.755) 0 3px 8px),
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
:root {
|
|
30
|
+
@each $name, $color in $dark-colors {
|
|
31
|
+
#{$name}: $color;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
color-scheme: light dark;
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
$light-colors: (
|
|
2
|
+
// bg
|
|
3
|
+
--chat-theme-light-bg-5: #999,
|
|
4
|
+
--chat-theme-light-bg-4: #b3b3b3,
|
|
5
|
+
--chat-theme-light-bg-3: #e5e7eb,
|
|
6
|
+
--chat-theme-light-bg-2: #f0f0f0,
|
|
7
|
+
--chat-theme-light-bg-1: #fff,
|
|
8
|
+
--chat-theme-light-bg-primary: #fff,
|
|
9
|
+
--chat-theme-light-bg-secondary: #f0f0f0,
|
|
10
|
+
--chat-theme-light-bg-active: #e6f1ff,
|
|
11
|
+
// text
|
|
12
|
+
--chat-theme-light-text-5: #000,
|
|
13
|
+
--chat-theme-light-text-4: #666,
|
|
14
|
+
--chat-theme-light-text-3: #7a7a7a,
|
|
15
|
+
--chat-theme-light-text-2: #7a7a7a,
|
|
16
|
+
--chat-theme-light-text-1: #7a7a7a,
|
|
17
|
+
--chat-theme-light-text-primary: #000,
|
|
18
|
+
--chat-theme-light-text-secondary: #7a7a7a,
|
|
19
|
+
// status
|
|
20
|
+
--chat-theme-light-status-info: #147aff,
|
|
21
|
+
--chat-theme-light-status-success: #34c759,
|
|
22
|
+
--chat-theme-light-status-danger: #ff3742,
|
|
23
|
+
// border
|
|
24
|
+
--chat-theme-light-border-5: #e0e0e0,
|
|
25
|
+
// box-shadow
|
|
26
|
+
--chat-theme-light-box-shadow-1: (rgba(0, 0, 0, 0.24) 0 3px 8px),
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
:root {
|
|
30
|
+
@each $name, $color in $light-colors {
|
|
31
|
+
#{$name}: $color;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
color-scheme: light dark;
|
|
35
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "sass:list";
|
|
3
|
+
|
|
4
|
+
$prefix: "--chat-theme";
|
|
5
|
+
|
|
6
|
+
$themes: (
|
|
7
|
+
"light",
|
|
8
|
+
"dark",
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
$colors: (
|
|
12
|
+
"bg-5",
|
|
13
|
+
"bg-4",
|
|
14
|
+
"bg-3",
|
|
15
|
+
"bg-2",
|
|
16
|
+
"bg-1",
|
|
17
|
+
"bg-primary",
|
|
18
|
+
"bg-secondary",
|
|
19
|
+
"bg-active",
|
|
20
|
+
"text-5",
|
|
21
|
+
"text-4",
|
|
22
|
+
"text-3",
|
|
23
|
+
"text-2",
|
|
24
|
+
"text-1",
|
|
25
|
+
"text-primary",
|
|
26
|
+
"text-secondary",
|
|
27
|
+
"status-info",
|
|
28
|
+
"status-success",
|
|
29
|
+
"status-danger",
|
|
30
|
+
"border-5",
|
|
31
|
+
"box-shadow-1",
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
$color-map: ();
|
|
35
|
+
|
|
36
|
+
@mixin theme() {
|
|
37
|
+
@each $theme in $themes {
|
|
38
|
+
|
|
39
|
+
$color-map: () !global;
|
|
40
|
+
|
|
41
|
+
[data-uikit-theme="#{$theme}"] & {
|
|
42
|
+
@each $color in $colors {
|
|
43
|
+
$value: #{$prefix}-#{$theme}-#{$color};
|
|
44
|
+
$color-map: map.merge($color-map, ($color: var($value))) !global;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@content;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@function get($color) {
|
|
53
|
+
@return map.get($color-map, $color);
|
|
54
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: iconfont;
|
|
3
|
+
src:
|
|
4
|
+
url("./assets/fonts/iconfont.woff2?t=1722856322648") format("woff2"),
|
|
5
|
+
url("./assets/fonts/iconfont.woff?t=1722856322648") format("woff"),
|
|
6
|
+
url("./assets/fonts/iconfont.ttf?t=1722856322648") format("truetype");
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.iconfont {
|
|
10
|
+
font-family: iconfont, Arial, sans-serif !important;
|
|
11
|
+
font-size: 20px;
|
|
12
|
+
font-style: normal;
|
|
13
|
+
line-height: 1;
|
|
14
|
+
vertical-align: bottom;
|
|
15
|
+
-webkit-font-smoothing: antialiased;
|
|
16
|
+
-webkit-text-stroke-width: 0.2px;
|
|
17
|
+
-moz-osx-font-smoothing: grayscale;
|
|
18
|
+
}
|