@tencentcloud/chat-uikit-react 2.2.5 → 2.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +16 -12
- package/.lintstagedrc.json +1 -1
- package/CHANGELOG.md +18 -0
- package/dist/cjs/assets/fonts/iconfont.ttf +0 -0
- package/dist/cjs/assets/fonts/iconfont.woff +0 -0
- package/dist/cjs/assets/fonts/iconfont.woff2 +0 -0
- package/dist/cjs/components/Avatar/Avatar.d.ts +4 -4
- package/dist/cjs/components/Checkbox/index.d.ts +2 -2
- package/dist/cjs/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
- package/dist/cjs/components/ConversationCreate/ConversationCreate.js +1 -1
- package/dist/cjs/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
- package/dist/cjs/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
- package/dist/cjs/components/ConversationPreview/ConversationListContainer.d.ts +2 -2
- package/dist/cjs/components/ConversationPreview/ConversationPreview.d.ts +8 -8
- package/dist/cjs/components/ConversationPreview/ConversationPreview.js +1 -1
- package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.d.ts +2 -2
- package/dist/cjs/components/ConversationPreview/ConversationPreviewContent.js +1 -1
- package/dist/cjs/components/ConversationPreview/utils.js +1 -1
- package/dist/cjs/components/ConversationSearch/ConversationSearchResult.d.ts +3 -3
- package/dist/cjs/components/ConversationSearch/ConversationSearchResult.js +1 -1
- package/dist/cjs/components/Icon/Icon.d.ts +3 -3
- package/dist/cjs/components/Icon/config.js +1 -1
- package/dist/cjs/components/Icon/images/video-call.svg.js +1 -0
- package/dist/cjs/components/Icon/images/voice-call.svg.js +1 -0
- package/dist/cjs/components/Icon/type.d.ts +3 -1
- package/dist/cjs/components/Icon/type.js +1 -1
- package/dist/cjs/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +4 -4
- package/dist/cjs/components/Input/Input.d.ts +4 -4
- package/dist/cjs/components/Model/index.d.ts +2 -2
- package/dist/cjs/components/Plugins/index.d.ts +4 -4
- package/dist/cjs/components/Popup/index.d.ts +2 -2
- package/dist/cjs/components/Switch/Switch.d.ts +2 -2
- package/dist/cjs/components/TUIChat/TUIChat.d.ts +15 -14
- package/dist/cjs/components/TUIChat/TUIChat.js +1 -1
- package/dist/cjs/components/TUIChat/TUIChatState.js +1 -1
- package/dist/cjs/components/TUIChat/index.js +1 -0
- package/dist/cjs/components/TUIChat/server.js +1 -0
- package/dist/cjs/components/TUIChat/utils.js +1 -0
- package/dist/cjs/components/TUIChatHeader/TUIChatHeader.d.ts +6 -5
- package/dist/cjs/components/TUIChatHeader/TUIChatHeader.js +1 -1
- package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.d.ts +6 -5
- package/dist/cjs/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContact.d.ts +3 -3
- package/dist/cjs/components/TUIContact/TUIContact.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/TUIContactInfo.d.ts +3 -3
- package/dist/cjs/components/TUIContact/TUIContactInfo/TUIContactInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/basicInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/blockInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/friendApplication.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/groupInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactInfo/hooks/useContactInfo.js +1 -1
- package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.d.ts +3 -3
- package/dist/cjs/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
- package/dist/cjs/components/TUIContact/hooks/useTUIContact.js +1 -1
- package/dist/cjs/components/TUIContactSearch/TUIContactSearch.js +1 -1
- package/dist/cjs/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
- package/dist/cjs/components/TUIConversation/TUIConversation.d.ts +2 -2
- package/dist/cjs/components/TUIConversationList/TUIConversationList.d.ts +6 -6
- package/dist/cjs/components/TUIConversationList/TUIConversationList.js +1 -1
- package/dist/cjs/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
- package/dist/cjs/components/TUIManage/TUIManage.d.ts +2 -2
- package/dist/cjs/components/TUIManage/TUIManage.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageAudio.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageAvatar.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageBubble.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageContext.d.ts +2 -2
- package/dist/cjs/components/TUIMessage/MessageContext.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageCustom.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageName.js +1 -1
- package/dist/cjs/components/TUIMessage/MessagePlugins.d.ts +4 -4
- package/dist/cjs/components/TUIMessage/MessagePlugins.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageProgress.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageRevoke.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageStatus.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageSystem.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageText.js +1 -1
- package/dist/cjs/components/TUIMessage/MessageTip.js +1 -1
- package/dist/cjs/components/TUIMessage/TUIMessage.d.ts +19 -19
- package/dist/cjs/components/TUIMessage/TUIMessage.js +1 -1
- package/dist/cjs/components/TUIMessage/TUIMessageDefault.js +1 -1
- package/dist/cjs/components/TUIMessage/hooks/useMessageHandler.js +1 -1
- package/dist/cjs/components/TUIMessage/hooks/useMessageReply.js +1 -1
- package/dist/cjs/components/TUIMessage/utils/index.js +1 -1
- package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.d.ts +2 -2
- package/dist/cjs/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
- package/dist/cjs/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIForward.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIMessageInput.d.ts +7 -7
- package/dist/cjs/components/TUIMessageInput/TUIMessageInput.js +1 -1
- package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.d.ts +2 -2
- package/dist/cjs/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
- package/dist/cjs/components/TUIMessageInput/hooks/useUploadPicker.js +1 -1
- package/dist/cjs/components/TUIMessageList/TUIMessageList.d.ts +2 -2
- package/dist/cjs/components/TUIMessageList/TUIMessageList.js +1 -1
- package/dist/cjs/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
- package/dist/cjs/components/TUIProfile/TUIProfile.d.ts +3 -3
- package/dist/cjs/components/TUIProfile/TUIProfile.js +1 -1
- package/dist/cjs/components/TUIProfile/TUIProfileDefault.d.ts +2 -2
- package/dist/cjs/components/TUIProfile/TUIProfileDefault.js +1 -1
- package/dist/cjs/components/Toast/index.d.ts +2 -2
- package/dist/cjs/components/{untils.js → utils.js} +1 -1
- package/dist/cjs/context/ComponentContext.d.ts +12 -12
- package/dist/cjs/context/LanguageContext.js +1 -0
- package/dist/cjs/context/TUIChatActionContext.d.ts +5 -4
- package/dist/cjs/context/TUIChatStateContext.d.ts +5 -5
- package/dist/cjs/context/TUIContactContext.d.ts +4 -4
- package/dist/cjs/context/TUIConversationContext.js +1 -1
- package/dist/cjs/context/TUIMessageContext.d.ts +17 -17
- package/dist/cjs/context/TUIMessageInputContext.d.ts +4 -4
- package/dist/cjs/context/ThemeContext.js +1 -0
- package/dist/cjs/context/UIKitContext.d.ts +25 -0
- package/dist/cjs/context/UIKitContext.js +1 -0
- package/dist/cjs/context/UIManagerContext.d.ts +46 -0
- package/dist/cjs/context/UIManagerContext.js +1 -0
- package/dist/cjs/hooks/useConversation.d.ts +2 -2
- package/dist/cjs/index.css +1 -2
- package/dist/cjs/index.d.css +1345 -1547
- package/dist/cjs/index.d.ts +2 -4
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/locales/en-US/index.js +1 -1
- package/dist/cjs/locales/index.js +1 -1
- package/dist/cjs/locales/zh-CN/index.js +1 -1
- package/dist/cjs/locales/zh-TW/TUIChat.js +1 -0
- package/dist/cjs/locales/zh-TW/TUIContact.js +1 -0
- package/dist/cjs/locales/zh-TW/TUIConversation.js +1 -0
- package/dist/cjs/locales/zh-TW/TUIProfile.js +1 -0
- package/dist/cjs/locales/zh-TW/index.js +1 -0
- package/dist/esm/assets/fonts/iconfont.ttf +0 -0
- package/dist/esm/assets/fonts/iconfont.woff +0 -0
- package/dist/esm/assets/fonts/iconfont.woff2 +0 -0
- package/dist/esm/components/Avatar/Avatar.d.ts +4 -4
- package/dist/esm/components/Checkbox/index.d.ts +2 -2
- package/dist/esm/components/ConversationCreate/ConversationCreatGroupDetail.js +1 -1
- package/dist/esm/components/ConversationCreate/ConversationCreate.js +1 -1
- package/dist/esm/components/ConversationCreate/ConversationCreateUserSelectList.js +1 -1
- package/dist/esm/components/ConversationCreate/hooks/useConversationCreate.js +1 -1
- package/dist/esm/components/ConversationPreview/ConversationListContainer.d.ts +2 -2
- package/dist/esm/components/ConversationPreview/ConversationPreview.d.ts +8 -8
- package/dist/esm/components/ConversationPreview/ConversationPreview.js +1 -1
- package/dist/esm/components/ConversationPreview/ConversationPreviewContent.d.ts +2 -2
- package/dist/esm/components/ConversationPreview/ConversationPreviewContent.js +1 -1
- package/dist/esm/components/ConversationPreview/utils.js +1 -1
- package/dist/esm/components/ConversationSearch/ConversationSearchResult.d.ts +3 -3
- package/dist/esm/components/ConversationSearch/ConversationSearchResult.js +1 -1
- package/dist/esm/components/Icon/Icon.d.ts +3 -3
- package/dist/esm/components/Icon/config.js +1 -1
- package/dist/esm/components/Icon/images/video-call.svg.js +1 -0
- package/dist/esm/components/Icon/images/voice-call.svg.js +1 -0
- package/dist/esm/components/Icon/type.d.ts +3 -1
- package/dist/esm/components/Icon/type.js +1 -1
- package/dist/esm/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +4 -4
- package/dist/esm/components/Input/Input.d.ts +4 -4
- package/dist/esm/components/Model/index.d.ts +2 -2
- package/dist/esm/components/Plugins/index.d.ts +4 -4
- package/dist/esm/components/Popup/index.d.ts +2 -2
- package/dist/esm/components/Switch/Switch.d.ts +2 -2
- package/dist/esm/components/TUIChat/TUIChat.d.ts +15 -14
- package/dist/esm/components/TUIChat/TUIChat.js +1 -1
- package/dist/esm/components/TUIChat/TUIChatState.js +1 -1
- package/dist/esm/components/TUIChat/index.js +1 -0
- package/dist/esm/components/TUIChat/server.js +1 -0
- package/dist/esm/components/TUIChat/utils.js +1 -0
- package/dist/esm/components/TUIChatHeader/TUIChatHeader.d.ts +6 -5
- package/dist/esm/components/TUIChatHeader/TUIChatHeader.js +1 -1
- package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.d.ts +6 -5
- package/dist/esm/components/TUIChatHeader/TUIChatHeaderDefault.js +1 -1
- package/dist/esm/components/TUIContact/TUIContact.d.ts +3 -3
- package/dist/esm/components/TUIContact/TUIContact.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/TUIContactInfo.d.ts +3 -3
- package/dist/esm/components/TUIContact/TUIContactInfo/TUIContactInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/basicInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/blockInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/friendApplication.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/friendInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/groupInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactInfo/hooks/useContactInfo.js +1 -1
- package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.d.ts +3 -3
- package/dist/esm/components/TUIContact/TUIContactList/TUIContactList.js +1 -1
- package/dist/esm/components/TUIContact/hooks/useTUIContact.js +1 -1
- package/dist/esm/components/TUIContactSearch/TUIContactSearch.js +1 -1
- package/dist/esm/components/TUIContactSearch/hooks/useContactSearch.js +1 -1
- package/dist/esm/components/TUIConversation/TUIConversation.d.ts +2 -2
- package/dist/esm/components/TUIConversationList/TUIConversationList.d.ts +6 -6
- package/dist/esm/components/TUIConversationList/TUIConversationList.js +1 -1
- package/dist/esm/components/TUIConversationList/hooks/useConversationUpdate.js +1 -1
- package/dist/esm/components/TUIManage/TUIManage.d.ts +2 -2
- package/dist/esm/components/TUIManage/TUIManage.js +1 -1
- package/dist/esm/components/TUIMessage/MessageAudio.js +1 -1
- package/dist/esm/components/TUIMessage/MessageAvatar.js +1 -1
- package/dist/esm/components/TUIMessage/MessageBubble.js +1 -1
- package/dist/esm/components/TUIMessage/MessageContext.d.ts +2 -2
- package/dist/esm/components/TUIMessage/MessageContext.js +1 -1
- package/dist/esm/components/TUIMessage/MessageCustom.js +1 -1
- package/dist/esm/components/TUIMessage/MessageName.js +1 -1
- package/dist/esm/components/TUIMessage/MessagePlugins.d.ts +4 -4
- package/dist/esm/components/TUIMessage/MessagePlugins.js +1 -1
- package/dist/esm/components/TUIMessage/MessageProgress.js +1 -1
- package/dist/esm/components/TUIMessage/MessageRevoke.js +1 -1
- package/dist/esm/components/TUIMessage/MessageStatus.js +1 -1
- package/dist/esm/components/TUIMessage/MessageSystem.js +1 -1
- package/dist/esm/components/TUIMessage/MessageText.js +1 -1
- package/dist/esm/components/TUIMessage/MessageTip.js +1 -1
- package/dist/esm/components/TUIMessage/TUIMessage.d.ts +19 -19
- package/dist/esm/components/TUIMessage/TUIMessage.js +1 -1
- package/dist/esm/components/TUIMessage/TUIMessageDefault.js +1 -1
- package/dist/esm/components/TUIMessage/hooks/useMessageHandler.js +1 -1
- package/dist/esm/components/TUIMessage/hooks/useMessageReply.js +1 -1
- package/dist/esm/components/TUIMessage/utils/index.js +1 -1
- package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.d.ts +2 -2
- package/dist/esm/components/TUIMessageInput/InputPluginsDefalut.js +1 -1
- package/dist/esm/components/TUIMessageInput/InputQuoteDefalut.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIForward.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIMessageInput.d.ts +7 -7
- package/dist/esm/components/TUIMessageInput/TUIMessageInput.js +1 -1
- package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.d.ts +2 -2
- package/dist/esm/components/TUIMessageInput/TUIMessageInputDefault.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useHandleForwardMessage.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useHandleQuoteMessage.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useMessageInputText.js +1 -1
- package/dist/esm/components/TUIMessageInput/hooks/useUploadPicker.js +1 -1
- package/dist/esm/components/TUIMessageList/TUIMessageList.d.ts +2 -2
- package/dist/esm/components/TUIMessageList/TUIMessageList.js +1 -1
- package/dist/esm/components/TUIMessageList/hooks/useMessageListElement.js +1 -1
- package/dist/esm/components/TUIProfile/TUIProfile.d.ts +3 -3
- package/dist/esm/components/TUIProfile/TUIProfile.js +1 -1
- package/dist/esm/components/TUIProfile/TUIProfileDefault.d.ts +2 -2
- package/dist/esm/components/TUIProfile/TUIProfileDefault.js +1 -1
- package/dist/esm/components/Toast/index.d.ts +2 -2
- package/dist/esm/components/utils.js +1 -0
- package/dist/esm/context/ComponentContext.d.ts +12 -12
- package/dist/esm/context/LanguageContext.js +1 -0
- package/dist/esm/context/TUIChatActionContext.d.ts +5 -4
- package/dist/esm/context/TUIChatStateContext.d.ts +5 -5
- package/dist/esm/context/TUIContactContext.d.ts +4 -4
- package/dist/esm/context/TUIConversationContext.js +1 -1
- package/dist/esm/context/TUIMessageContext.d.ts +17 -17
- package/dist/esm/context/TUIMessageInputContext.d.ts +4 -4
- package/dist/esm/context/ThemeContext.js +1 -0
- package/dist/esm/context/UIKitContext.d.ts +25 -0
- package/dist/esm/context/UIKitContext.js +1 -0
- package/dist/esm/context/UIManagerContext.d.ts +46 -0
- package/dist/esm/context/UIManagerContext.js +1 -0
- package/dist/esm/hooks/useConversation.d.ts +2 -2
- package/dist/esm/index.css +1 -2
- package/dist/esm/index.d.css +1345 -1547
- package/dist/esm/index.d.ts +2 -4
- package/dist/esm/index.js +1 -1
- package/dist/esm/locales/en-US/index.js +1 -1
- package/dist/esm/locales/index.js +1 -1
- package/dist/esm/locales/zh-CN/index.js +1 -1
- package/dist/esm/locales/zh-TW/TUIChat.js +1 -0
- package/dist/esm/locales/zh-TW/TUIContact.js +1 -0
- package/dist/esm/locales/zh-TW/TUIConversation.js +1 -0
- package/dist/esm/locales/zh-TW/TUIProfile.js +1 -0
- package/dist/esm/locales/zh-TW/index.js +1 -0
- package/package.json +5 -3
- package/rollup.config.js +1 -1
- package/src/assets/fonts/iconfont.ttf +0 -0
- package/src/assets/fonts/iconfont.woff +0 -0
- package/src/assets/fonts/iconfont.woff2 +0 -0
- package/src/components/Avatar/styles/index.scss +11 -4
- package/src/components/Checkbox/styles/color.scss +17 -6
- package/src/components/ConversationCreate/ConversationCreatGroupDetail.tsx +4 -4
- package/src/components/ConversationCreate/ConversationCreate.tsx +2 -2
- package/src/components/ConversationCreate/ConversationCreateUserSelectList.tsx +3 -2
- package/src/components/ConversationCreate/hooks/useConversationCreate.tsx +5 -5
- package/src/components/ConversationCreate/styles/ConversationCreatGroupDetail.scss +7 -16
- package/src/components/ConversationCreate/styles/conversationCreateSelectView.scss +13 -8
- package/src/components/ConversationCreate/styles/conversationGroupTypeInfo.scss +20 -21
- package/src/components/ConversationCreate/styles/index.scss +30 -17
- package/src/components/ConversationPreview/ConversationPreview.tsx +21 -21
- package/src/components/ConversationPreview/ConversationPreviewContent.tsx +4 -2
- package/src/components/ConversationPreview/styles/index.scss +20 -20
- package/src/components/ConversationPreview/utils.tsx +3 -2
- package/src/components/DivWithEdit/styles/index.scss +30 -10
- package/src/components/Icon/config.ts +14 -4
- package/src/components/Icon/images/video-call.svg +3 -0
- package/src/components/Icon/images/voice-call.svg +3 -0
- package/src/components/Icon/type.ts +2 -0
- package/src/components/Input/styles/index.scss +22 -6
- package/src/components/Plugins/styles/color.scss +3 -11
- package/src/components/Profile/styles/index.scss +12 -3
- package/src/components/TUIChat/TUIChat.tsx +40 -35
- package/src/components/TUIChat/TUIChatState.tsx +41 -41
- package/src/components/TUIChat/index.ts +3 -0
- package/src/components/TUIChat/server.ts +44 -0
- package/src/components/TUIChat/styles/layout.scss +7 -2
- package/src/components/TUIChat/utils.ts +72 -0
- package/src/components/TUIChatHeader/TUIChatHeader.tsx +10 -7
- package/src/components/TUIChatHeader/TUIChatHeaderDefault.tsx +74 -31
- package/src/components/TUIChatHeader/styles/layout.scss +16 -9
- package/src/components/TUIContact/TUIContact.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/TUIContactInfo.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/basicInfo.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/blockInfo.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/friendApplication.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/friendInfo.tsx +4 -3
- package/src/components/TUIContact/TUIContactInfo/groupInfo.tsx +3 -3
- package/src/components/TUIContact/TUIContactInfo/hooks/useContactInfo.tsx +2 -2
- package/src/components/TUIContact/TUIContactInfo/index.scss +44 -21
- package/src/components/TUIContact/TUIContactList/TUIContactList.tsx +80 -76
- package/src/components/TUIContact/TUIContactList/index.scss +40 -20
- package/src/components/TUIContact/hooks/useTUIContact.tsx +5 -5
- package/src/components/TUIContact/index.scss +30 -11
- package/src/components/TUIContactSearch/TUIContactSearch.tsx +2 -2
- package/src/components/TUIContactSearch/hooks/useContactSearch.tsx +2 -2
- package/src/components/TUIContactSearch/index.scss +12 -3
- package/src/components/TUIConversationList/TUIConversationList.tsx +3 -4
- package/src/components/TUIConversationList/hooks/useConversationUpdate.tsx +2 -2
- package/src/components/TUIConversationList/index.scss +3 -4
- package/src/components/TUIManage/TUIManage.tsx +3 -3
- package/src/components/TUIManage/styles/index.scss +20 -14
- package/src/components/TUIMessage/MessageAvatar.tsx +7 -7
- package/src/components/TUIMessage/MessageBubble.tsx +22 -21
- package/src/components/TUIMessage/MessageCustom.tsx +26 -5
- package/src/components/TUIMessage/MessageStatus.tsx +7 -7
- package/src/components/TUIMessage/MessageText.tsx +16 -15
- package/src/components/TUIMessage/hooks/useMessageHandler.ts +8 -8
- package/src/components/TUIMessage/hooks/useMessageReply.ts +8 -7
- package/src/components/TUIMessage/styles/color.scss +6 -5
- package/src/components/TUIMessage/styles/layout.scss +111 -42
- package/src/components/TUIMessage/utils/index.ts +23 -12
- package/src/components/TUIMessageInput/InputPluginsDefalut.tsx +12 -12
- package/src/components/TUIMessageInput/TUIMessageInput.tsx +1 -1
- package/src/components/TUIMessageInput/hooks/useHandleForwardMessage.tsx +7 -6
- package/src/components/TUIMessageInput/hooks/useMessageInputText.tsx +14 -14
- package/src/components/TUIMessageInput/hooks/useUploadPicker.tsx +4 -4
- package/src/components/TUIMessageInput/styles/color.scss +15 -11
- package/src/components/TUIMessageInput/styles/layout.scss +33 -17
- package/src/components/TUIMessageList/hooks/useMessageListElement.tsx +15 -11
- package/src/components/TUIMessageList/styles/layout.scss +16 -9
- package/src/components/TUIProfile/TUIProfile.tsx +3 -3
- package/src/components/TUIProfile/TUIProfileDefault.tsx +14 -13
- package/src/components/TUIProfile/styles/color.scss +6 -5
- package/src/components/TUIProfile/styles/layout.scss +16 -14
- package/src/components/index.ts +0 -1
- package/src/components/{untils.ts → utils.ts} +5 -4
- package/src/context/LanguageContext.tsx +60 -0
- package/src/context/TUIChatActionContext.tsx +14 -13
- package/src/context/ThemeContext.tsx +68 -0
- package/src/context/UIKitContext.tsx +76 -0
- package/src/context/UIManagerContext.tsx +163 -0
- package/src/context/index.ts +3 -2
- package/src/locales/en-US/index.ts +0 -3
- package/src/locales/index.ts +6 -2
- package/src/locales/zh-CN/index.ts +0 -2
- package/src/locales/zh-TW/TUIChat.ts +27 -0
- package/src/locales/zh-TW/TUIContact.ts +29 -0
- package/src/locales/zh-TW/TUIConversation.ts +32 -0
- package/src/locales/zh-TW/TUIProfile.ts +15 -0
- package/src/locales/zh-TW/index.ts +11 -0
- package/src/styles/colors/_color-dark.scss +31 -21
- package/src/styles/colors/_color-light.scss +31 -21
- package/src/styles/colors/_color-theme.scss +33 -22
- package/src/styles/normalize.scss +6 -0
- package/dist/cjs/components/Icon/images/chats-selected.svg.js +0 -1
- package/dist/cjs/components/Icon/images/chats.svg.js +0 -1
- package/dist/cjs/components/Icon/images/contacts-selected.svg.js +0 -1
- package/dist/cjs/components/Icon/images/contacts.svg.js +0 -1
- package/dist/cjs/components/Icon/images/down-arrow.png.js +0 -1
- package/dist/cjs/components/Icon/images/right-arrow.svg.js +0 -1
- package/dist/cjs/components/TUIChat/unitls.js +0 -1
- package/dist/cjs/components/TUIKit/TUIKit.d.ts +0 -12
- package/dist/cjs/components/TUIKit/TUIKit.js +0 -1
- package/dist/cjs/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +0 -21
- package/dist/cjs/components/TUIKit/hooks/useCreateTUIKitContext.js +0 -1
- package/dist/cjs/components/TUIKit/hooks/useTUIKit.d.ts +0 -43
- package/dist/cjs/components/TUIKit/hooks/useTUIKit.js +0 -1
- package/dist/cjs/context/TUIKitContext.d.ts +0 -25
- package/dist/cjs/context/TUIKitContext.js +0 -1
- package/dist/esm/components/Icon/images/chats-selected.svg.js +0 -1
- package/dist/esm/components/Icon/images/chats.svg.js +0 -1
- package/dist/esm/components/Icon/images/contacts-selected.svg.js +0 -1
- package/dist/esm/components/Icon/images/contacts.svg.js +0 -1
- package/dist/esm/components/Icon/images/down-arrow.png.js +0 -1
- package/dist/esm/components/Icon/images/right-arrow.svg.js +0 -1
- package/dist/esm/components/TUIChat/unitls.js +0 -1
- package/dist/esm/components/TUIKit/TUIKit.d.ts +0 -12
- package/dist/esm/components/TUIKit/TUIKit.js +0 -1
- package/dist/esm/components/TUIKit/hooks/useCreateTUIKitContext.d.ts +0 -21
- package/dist/esm/components/TUIKit/hooks/useCreateTUIKitContext.js +0 -1
- package/dist/esm/components/TUIKit/hooks/useTUIKit.d.ts +0 -43
- package/dist/esm/components/TUIKit/hooks/useTUIKit.js +0 -1
- package/dist/esm/components/untils.js +0 -1
- package/dist/esm/context/TUIKitContext.d.ts +0 -25
- package/dist/esm/context/TUIKitContext.js +0 -1
- package/scripts/publish-github.js +0 -60
- package/scripts/publish-intl-demo.js +0 -14
- package/scripts/publish-intl-experience-demo.js +0 -14
- package/src/components/TUIChat/unitls.ts +0 -39
- package/src/components/TUIKit/TUIKit.tsx +0 -229
- package/src/components/TUIKit/hooks/useCreateTUIKitContext.tsx +0 -48
- package/src/components/TUIKit/hooks/useTUIKit.tsx +0 -99
- package/src/components/TUIKit/index.ts +0 -3
- package/src/components/TUIKit/styles/h5.scss +0 -34
- package/src/components/TUIKit/styles/index.scss +0 -132
- package/src/context/TUIKitContext.tsx +0 -44
- package/src/locales/en-US/TUIGlobal.ts +0 -6
- package/src/locales/ja-JP/TUIGlobal.ts +0 -6
- package/src/locales/ko-KR/TUIGlobal.ts +0 -6
- package/src/locales/zh-CN/TUIGlobal.ts +0 -6
|
@@ -5,27 +5,28 @@ import {
|
|
|
5
5
|
} from '@tencentcloud/chat-uikit-engine';
|
|
6
6
|
import { MESSAGE_OPERATE } from '../../../constants';
|
|
7
7
|
import {
|
|
8
|
-
useTUIChatStateContext,
|
|
8
|
+
useTUIChatStateContext, useUIKit,
|
|
9
9
|
} from '../../../context';
|
|
10
10
|
|
|
11
|
-
export function useHandleForwardMessage(msg?:Message) {
|
|
11
|
+
export function useHandleForwardMessage(msg?: Message) {
|
|
12
12
|
const {
|
|
13
13
|
operateData,
|
|
14
14
|
} = useTUIChatStateContext('TUIMessageInputDefault');
|
|
15
15
|
|
|
16
16
|
const [conversationList, setConversationList] = useState([]);
|
|
17
|
-
const { chat } =
|
|
17
|
+
const { chat } = useUIKit('TUIChat');
|
|
18
18
|
|
|
19
19
|
const message = msg || (operateData && operateData[MESSAGE_OPERATE.FORWARD]);
|
|
20
20
|
|
|
21
|
-
const sendForwardMessage = (list:
|
|
22
|
-
list.map((item:Conversation) => {
|
|
23
|
-
message &&
|
|
21
|
+
const sendForwardMessage = (list: Conversation[]) => {
|
|
22
|
+
list.map((item: Conversation) => {
|
|
23
|
+
message && TUIChatService.sendForwardMessage([item], [message]);
|
|
24
24
|
return item;
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
useEffect(() => {
|
|
29
|
+
if (!chat) return;
|
|
29
30
|
(async () => {
|
|
30
31
|
const res = await chat.getConversationList();
|
|
31
32
|
setConversationList(res?.data?.conversationList.filter(
|
|
@@ -9,9 +9,9 @@ import {
|
|
|
9
9
|
import { CONSTANT_DISPATCH_TYPE, MESSAGE_OPERATE, MESSAGE_TYPE_NAME } from '../../../constants';
|
|
10
10
|
import {
|
|
11
11
|
useTUIChatActionContext,
|
|
12
|
-
|
|
12
|
+
useUIKit,
|
|
13
13
|
} from '../../../context';
|
|
14
|
-
import { enableSampleTaskStatus } from '../../
|
|
14
|
+
import { enableSampleTaskStatus } from '../../utils';
|
|
15
15
|
import { formatEmojiString } from '../../TUIMessage/utils/emojiMap';
|
|
16
16
|
import { useHandleQuoteMessage } from './useHandleQuoteMessage';
|
|
17
17
|
import type { IbaseStateProps, ICursorPos } from './useMessageInputState';
|
|
@@ -19,12 +19,12 @@ import { filesData } from './useUploadPicker';
|
|
|
19
19
|
import { de } from 'date-fns/locale';
|
|
20
20
|
|
|
21
21
|
interface useMessageInputTextProps extends IbaseStateProps {
|
|
22
|
-
focus?: boolean
|
|
23
|
-
textareaRef?: MutableRefObject<HTMLTextAreaElement | undefined
|
|
24
|
-
sendUploadMessage?: (file: filesData, type: MESSAGE_TYPE_NAME) => void
|
|
22
|
+
focus?: boolean;
|
|
23
|
+
textareaRef?: MutableRefObject<HTMLTextAreaElement | undefined>;
|
|
24
|
+
sendUploadMessage?: (file: filesData, type: MESSAGE_TYPE_NAME) => void;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export const useMessageInputText = (props:useMessageInputTextProps) => {
|
|
27
|
+
export const useMessageInputText = (props: useMessageInputTextProps) => {
|
|
28
28
|
const {
|
|
29
29
|
state,
|
|
30
30
|
dispatch,
|
|
@@ -33,7 +33,7 @@ export const useMessageInputText = (props:useMessageInputTextProps) => {
|
|
|
33
33
|
sendUploadMessage,
|
|
34
34
|
} = props;
|
|
35
35
|
|
|
36
|
-
const { chat } =
|
|
36
|
+
const { chat } = useUIKit('useMessageInputText');
|
|
37
37
|
const { operateMessage, setFirstSendMessage } = useTUIChatActionContext('TUIMessageInput');
|
|
38
38
|
|
|
39
39
|
const { cloudCustomData } = useHandleQuoteMessage();
|
|
@@ -48,7 +48,7 @@ export const useMessageInputText = (props:useMessageInputTextProps) => {
|
|
|
48
48
|
}
|
|
49
49
|
dispatch({
|
|
50
50
|
type: CONSTANT_DISPATCH_TYPE.SET_TEXT,
|
|
51
|
-
getNewText: (text:string) => event.target.value,
|
|
51
|
+
getNewText: (text: string) => event.target.value,
|
|
52
52
|
});
|
|
53
53
|
},
|
|
54
54
|
[chat],
|
|
@@ -61,7 +61,7 @@ export const useMessageInputText = (props:useMessageInputTextProps) => {
|
|
|
61
61
|
if (!state.text) {
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
-
const options:any = {
|
|
64
|
+
const options: any = {
|
|
65
65
|
payload: {
|
|
66
66
|
text: formatEmojiString(state.text),
|
|
67
67
|
},
|
|
@@ -75,7 +75,7 @@ export const useMessageInputText = (props:useMessageInputTextProps) => {
|
|
|
75
75
|
});
|
|
76
76
|
enableSampleTaskStatus('sendMessage');
|
|
77
77
|
dispatch({
|
|
78
|
-
getNewText: (text:string) => '',
|
|
78
|
+
getNewText: (text: string) => '',
|
|
79
79
|
type: CONSTANT_DISPATCH_TYPE.SET_TEXT,
|
|
80
80
|
});
|
|
81
81
|
operateMessage && operateMessage({
|
|
@@ -86,7 +86,7 @@ export const useMessageInputText = (props:useMessageInputTextProps) => {
|
|
|
86
86
|
};
|
|
87
87
|
|
|
88
88
|
const handleKeyDown = useCallback(
|
|
89
|
-
(event?:React.KeyboardEvent<EventTarget>) => {
|
|
89
|
+
(event?: React.KeyboardEvent<EventTarget>) => {
|
|
90
90
|
if (!event?.ctrlKey && event?.code && enterCodeList.indexOf(event?.code) > -1 && event.keyCode === 13) {
|
|
91
91
|
event?.preventDefault();
|
|
92
92
|
handleSubmit(event);
|
|
@@ -94,7 +94,7 @@ export const useMessageInputText = (props:useMessageInputTextProps) => {
|
|
|
94
94
|
if (event?.ctrlKey && enterCodeList.indexOf(event?.code) > -1 && event.keyCode === 13) {
|
|
95
95
|
dispatch({
|
|
96
96
|
type: CONSTANT_DISPATCH_TYPE.SET_TEXT,
|
|
97
|
-
getNewText: (text:string) => `${text}\n`,
|
|
97
|
+
getNewText: (text: string) => `${text}\n`,
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
},
|
|
@@ -115,7 +115,7 @@ export const useMessageInputText = (props:useMessageInputTextProps) => {
|
|
|
115
115
|
item.getAsString((str: string) => {
|
|
116
116
|
dispatch({
|
|
117
117
|
type: CONSTANT_DISPATCH_TYPE.SET_TEXT,
|
|
118
|
-
getNewText: (text:string) => `${text}${str}`,
|
|
118
|
+
getNewText: (text: string) => `${text}${str}`,
|
|
119
119
|
});
|
|
120
120
|
});
|
|
121
121
|
return true;
|
|
@@ -138,7 +138,7 @@ export const useMessageInputText = (props:useMessageInputTextProps) => {
|
|
|
138
138
|
(textToInsert: string) => {
|
|
139
139
|
dispatch({
|
|
140
140
|
type: CONSTANT_DISPATCH_TYPE.SET_TEXT,
|
|
141
|
-
getNewText: (text:string) => `${text.slice(0, state?.cursorPos?.start || 0)}${textToInsert}${text.slice(state?.cursorPos?.start || 0)}`,
|
|
141
|
+
getNewText: (text: string) => `${text.slice(0, state?.cursorPos?.start || 0)}${textToInsert}${text.slice(state?.cursorPos?.start || 0)}`,
|
|
142
142
|
});
|
|
143
143
|
dispatch({
|
|
144
144
|
type: CONSTANT_DISPATCH_TYPE.SET_CURSOR_POS,
|
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
TUIChatService,
|
|
7
7
|
} from '@tencentcloud/chat-uikit-engine';
|
|
8
8
|
import { MESSAGE_TYPE_NAME } from '../../../constants';
|
|
9
|
-
import { enableSampleTaskStatus } from '../../
|
|
9
|
+
import { enableSampleTaskStatus } from '../../utils';
|
|
10
10
|
import { useTUIChatActionContext } from '../../../context';
|
|
11
11
|
import type { IbaseStateProps } from './useMessageInputState';
|
|
12
12
|
|
|
13
13
|
export interface filesData {
|
|
14
|
-
file: HTMLInputElement | File
|
|
14
|
+
file: HTMLInputElement | File;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export function useUploadPicker<T extends IbaseStateProps>(props:PropsWithChildren<T>) {
|
|
17
|
+
export function useUploadPicker<T extends IbaseStateProps>(props: PropsWithChildren<T>) {
|
|
18
18
|
const {
|
|
19
19
|
updateUploadPendingMessageList,
|
|
20
20
|
} = useTUIChatActionContext('useUploadPicker');
|
|
@@ -25,7 +25,7 @@ export function useUploadPicker<T extends IbaseStateProps>(props:PropsWithChildr
|
|
|
25
25
|
[MESSAGE_TYPE_NAME.FILE]: TUIChatService.sendFileMessage,
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
const sendUploadMessage = useCallback((file: filesData, type:MESSAGE_TYPE_NAME) => {
|
|
28
|
+
const sendUploadMessage = useCallback((file: filesData, type: MESSAGE_TYPE_NAME) => {
|
|
29
29
|
creatUploadMessage[type]({
|
|
30
30
|
payload: file,
|
|
31
31
|
});
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
.tui-message-input {
|
|
4
4
|
@include theme() {
|
|
5
|
-
background-color: get(bg-
|
|
5
|
+
background-color: get(bg-color-operate);
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.tui-kit-input-box--focus {
|
|
9
9
|
@include theme() {
|
|
10
|
-
outline: 1px solid get(
|
|
10
|
+
outline: 1px solid get(text-color-link);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.input-box {
|
|
15
15
|
@include theme() {
|
|
16
|
-
background-color: get(bg-
|
|
17
|
-
border: 1px solid get(
|
|
16
|
+
background-color: get(bg-color-operate);
|
|
17
|
+
border: 1px solid get(stroke-color-primary);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -23,14 +23,18 @@
|
|
|
23
23
|
&-box {
|
|
24
24
|
border-radius: 16px;
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
background-color:
|
|
28
|
-
box-shadow:
|
|
26
|
+
@include theme() {
|
|
27
|
+
background-color: get(dropdown-color-default);
|
|
28
|
+
box-shadow: 0 0 10px 0 get(shadow-color);
|
|
29
29
|
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
30
32
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
.input-icon {
|
|
34
|
+
width: 20px;
|
|
35
|
+
height: 20px;
|
|
36
|
+
|
|
37
|
+
@include theme() {
|
|
38
|
+
color: get(text-color-primary);
|
|
35
39
|
}
|
|
36
40
|
}
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
background: none;
|
|
54
54
|
|
|
55
55
|
@include theme() {
|
|
56
|
-
color: get(text-primary);
|
|
56
|
+
color: get(text-color-primary);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
&:focus,
|
|
@@ -155,8 +155,15 @@ ul li {
|
|
|
155
155
|
padding: 10px 16px;
|
|
156
156
|
min-width: 180px;
|
|
157
157
|
|
|
158
|
+
@include theme() {
|
|
159
|
+
color: get(text-color-primary);
|
|
160
|
+
}
|
|
161
|
+
|
|
158
162
|
&:hover {
|
|
159
|
-
|
|
163
|
+
@include theme() {
|
|
164
|
+
color: get(text-color-hover);
|
|
165
|
+
background-color: get(dropdown-color-hover);
|
|
166
|
+
}
|
|
160
167
|
}
|
|
161
168
|
|
|
162
169
|
input {
|
|
@@ -172,10 +179,13 @@ ul li {
|
|
|
172
179
|
|
|
173
180
|
.input-quote {
|
|
174
181
|
padding: 7px 16px;
|
|
175
|
-
background: #f9f9f9;
|
|
176
182
|
display: flex;
|
|
177
183
|
align-items: center;
|
|
178
184
|
|
|
185
|
+
@include theme() {
|
|
186
|
+
background: get(bg-color-bubble-reciprocal);
|
|
187
|
+
}
|
|
188
|
+
|
|
179
189
|
&-content {
|
|
180
190
|
flex: 1;
|
|
181
191
|
background: #fff;
|
|
@@ -185,7 +195,6 @@ ul li {
|
|
|
185
195
|
flex-direction: column;
|
|
186
196
|
font-weight: 500;
|
|
187
197
|
font-size: 14px;
|
|
188
|
-
font-family: PingFangSC-Medium;
|
|
189
198
|
line-height: 17px;
|
|
190
199
|
color: #000;
|
|
191
200
|
|
|
@@ -212,7 +221,6 @@ ul li {
|
|
|
212
221
|
|
|
213
222
|
// TUIForward
|
|
214
223
|
.tui-forward {
|
|
215
|
-
background: #fff;
|
|
216
224
|
border-radius: 16px;
|
|
217
225
|
display: flex;
|
|
218
226
|
flex-direction: column;
|
|
@@ -220,19 +228,25 @@ ul li {
|
|
|
220
228
|
width: 300px;
|
|
221
229
|
max-height: 90%;
|
|
222
230
|
|
|
231
|
+
@include theme() {
|
|
232
|
+
background-color: get(bg-color-operate);
|
|
233
|
+
}
|
|
234
|
+
|
|
223
235
|
&-header {
|
|
224
236
|
display: flex;
|
|
225
237
|
align-items: center;
|
|
226
238
|
padding: 24px 20px;
|
|
239
|
+
|
|
240
|
+
@include theme() {
|
|
241
|
+
color: get(text-color-primary);
|
|
242
|
+
}
|
|
227
243
|
}
|
|
228
244
|
|
|
229
245
|
&-title {
|
|
230
246
|
padding: 0 16px;
|
|
231
|
-
font-family: PingFangSC-Medium;
|
|
232
247
|
font-style: normal;
|
|
233
248
|
font-weight: 700;
|
|
234
249
|
font-size: 14px;
|
|
235
|
-
line-height: 17px;
|
|
236
250
|
}
|
|
237
251
|
|
|
238
252
|
&-main {
|
|
@@ -241,13 +255,13 @@ ul li {
|
|
|
241
255
|
overflow-y: auto;
|
|
242
256
|
|
|
243
257
|
.no-result {
|
|
244
|
-
font-family: PingFangSC-Medium;
|
|
245
258
|
font-size: 14px;
|
|
246
|
-
font-style: normal;
|
|
247
|
-
line-height: 20px;
|
|
248
259
|
padding: 10px;
|
|
249
260
|
text-align: center;
|
|
250
|
-
|
|
261
|
+
|
|
262
|
+
@include theme() {
|
|
263
|
+
color: get(text-color-secondary);
|
|
264
|
+
}
|
|
251
265
|
}
|
|
252
266
|
}
|
|
253
267
|
|
|
@@ -259,7 +273,6 @@ ul li {
|
|
|
259
273
|
padding: 13px 0;
|
|
260
274
|
|
|
261
275
|
&-title {
|
|
262
|
-
font-family: PingFangSC-Medium;
|
|
263
276
|
font-style: normal;
|
|
264
277
|
font-weight: 600;
|
|
265
278
|
font-size: 14px;
|
|
@@ -268,7 +281,6 @@ ul li {
|
|
|
268
281
|
|
|
269
282
|
&-item {
|
|
270
283
|
padding: 6px 0;
|
|
271
|
-
font-family: PingFangSC-Medium;
|
|
272
284
|
font-style: normal;
|
|
273
285
|
font-weight: 400;
|
|
274
286
|
font-size: 14px;
|
|
@@ -282,11 +294,9 @@ ul li {
|
|
|
282
294
|
display: flex;
|
|
283
295
|
align-items: center;
|
|
284
296
|
flex-shrink: 0;
|
|
285
|
-
width: 100%;
|
|
286
297
|
|
|
287
298
|
&-nick {
|
|
288
299
|
padding: 0 13px;
|
|
289
|
-
font-family: PingFangSC-Medium;
|
|
290
300
|
font-style: normal;
|
|
291
301
|
font-weight: 400;
|
|
292
302
|
font-size: 14px;
|
|
@@ -303,18 +313,20 @@ ul li {
|
|
|
303
313
|
}
|
|
304
314
|
|
|
305
315
|
&-footer {
|
|
306
|
-
background: rgba(249, 249, 249, 94%);
|
|
307
316
|
padding: 13px 10px;
|
|
308
317
|
display: flex;
|
|
309
318
|
justify-content: space-between;
|
|
310
319
|
align-items: center;
|
|
311
320
|
|
|
321
|
+
@include theme() {
|
|
322
|
+
background-color: get(bg-color-operate);
|
|
323
|
+
}
|
|
324
|
+
|
|
312
325
|
.button {
|
|
313
326
|
cursor: pointer;
|
|
314
327
|
background: #0365f9;
|
|
315
328
|
border-radius: 31px;
|
|
316
329
|
padding: 10px 21px;
|
|
317
|
-
font-family: PingFangSC-Medium;
|
|
318
330
|
font-style: normal;
|
|
319
331
|
font-weight: 400;
|
|
320
332
|
font-size: 14px;
|
|
@@ -331,6 +343,10 @@ ul li {
|
|
|
331
343
|
display: -webkit-box;
|
|
332
344
|
-webkit-line-clamp: 3;
|
|
333
345
|
-webkit-box-orient: vertical;
|
|
346
|
+
|
|
347
|
+
@include theme() {
|
|
348
|
+
color: get(text-color-primary);
|
|
349
|
+
}
|
|
334
350
|
}
|
|
335
351
|
}
|
|
336
352
|
}
|
|
@@ -2,17 +2,17 @@ import React, {
|
|
|
2
2
|
PropsWithChildren, useMemo,
|
|
3
3
|
} from 'react';
|
|
4
4
|
import { Message } from '@tencentcloud/chat';
|
|
5
|
-
import { UnknowPorps,
|
|
5
|
+
import { UnknowPorps, useUIKit } from '../../../context';
|
|
6
6
|
import { TUIMessageProps } from '../../TUIMessage/TUIMessage';
|
|
7
|
-
import { getTimeStamp } from '../../
|
|
7
|
+
import { getTimeStamp } from '../../utils';
|
|
8
8
|
|
|
9
9
|
interface MessageListElementProps {
|
|
10
|
-
enrichedMessageList:
|
|
11
|
-
TUIMessage?: React.ComponentType<TUIMessageProps | UnknowPorps
|
|
12
|
-
intervalsTimer?: number
|
|
10
|
+
enrichedMessageList: Message[];
|
|
11
|
+
TUIMessage?: React.ComponentType<TUIMessageProps | UnknowPorps>;
|
|
12
|
+
intervalsTimer?: number;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
function useMessageListElement
|
|
15
|
+
function useMessageListElement<T extends MessageListElementProps>(
|
|
16
16
|
props: PropsWithChildren<T>,
|
|
17
17
|
) {
|
|
18
18
|
const {
|
|
@@ -20,19 +20,23 @@ function useMessageListElement <T extends MessageListElementProps>(
|
|
|
20
20
|
TUIMessage,
|
|
21
21
|
intervalsTimer,
|
|
22
22
|
} = props;
|
|
23
|
-
const { language } =
|
|
23
|
+
const { language } = useUIKit('TUIConversation');
|
|
24
24
|
|
|
25
|
-
return useMemo(() => enrichedMessageList?.map((item: Message, index:number) => {
|
|
25
|
+
return useMemo(() => enrichedMessageList?.map((item: Message, index: number) => {
|
|
26
26
|
const key = `${item.ID}-${index}`;
|
|
27
27
|
const preMessageTImer = index > 0 ? enrichedMessageList[index - 1]?.time : -1;
|
|
28
28
|
const currrentTimer = item?.time || 0;
|
|
29
29
|
const isShowIntervalsTimer = intervalsTimer && preMessageTImer !== -1
|
|
30
|
-
? (currrentTimer - preMessageTImer) >= intervalsTimer
|
|
30
|
+
? (currrentTimer - preMessageTImer) >= intervalsTimer
|
|
31
|
+
: false;
|
|
31
32
|
return (
|
|
32
33
|
<li className="message-list-item" key={key}>
|
|
33
34
|
{
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
isShowIntervalsTimer && (
|
|
36
|
+
<div className="message-list-time" key={`${currrentTimer + index}`}>
|
|
37
|
+
{currrentTimer ? getTimeStamp(currrentTimer * 1000, language) : 0}
|
|
38
|
+
</div>
|
|
39
|
+
)
|
|
36
40
|
}
|
|
37
41
|
{/* // eslint-disable-next-line
|
|
38
42
|
// @ts-ignore */}
|
|
@@ -1,31 +1,39 @@
|
|
|
1
1
|
@use "../../../styles/colors/color-theme" as *;
|
|
2
2
|
|
|
3
|
-
ul,
|
|
3
|
+
ul,
|
|
4
|
+
li,
|
|
5
|
+
div,
|
|
6
|
+
p,
|
|
7
|
+
label,
|
|
8
|
+
span {
|
|
4
9
|
margin: 0;
|
|
5
10
|
padding: 0;
|
|
6
11
|
}
|
|
12
|
+
|
|
7
13
|
ul li {
|
|
8
14
|
list-style: none;
|
|
9
15
|
}
|
|
10
|
-
|
|
16
|
+
|
|
17
|
+
.message-list {
|
|
11
18
|
flex: 1;
|
|
12
19
|
height: 100%;
|
|
13
|
-
overflow
|
|
14
|
-
overflow-y: auto;
|
|
20
|
+
overflow: hidden auto;
|
|
15
21
|
position: relative;
|
|
16
22
|
padding: 0 20px;
|
|
17
23
|
|
|
18
24
|
@include theme() {
|
|
19
|
-
background-color: get(bg-
|
|
25
|
+
background-color: get(bg-color-operate);
|
|
20
26
|
}
|
|
21
27
|
|
|
22
28
|
&.hide {
|
|
23
29
|
opacity: 0;
|
|
24
30
|
}
|
|
31
|
+
|
|
25
32
|
&-item {
|
|
26
33
|
display: grid;
|
|
27
34
|
padding: 5px 0;
|
|
28
35
|
}
|
|
36
|
+
|
|
29
37
|
.no-more {
|
|
30
38
|
text-align: center;
|
|
31
39
|
font-family: PingFangSC-Medium;
|
|
@@ -35,12 +43,11 @@ ul li {
|
|
|
35
43
|
line-height: 17px;
|
|
36
44
|
|
|
37
45
|
@include theme() {
|
|
38
|
-
color: get(text-secondary);
|
|
46
|
+
color: get(text-color-secondary);
|
|
39
47
|
}
|
|
40
|
-
|
|
41
48
|
}
|
|
49
|
+
|
|
42
50
|
&-time {
|
|
43
|
-
font-family: PingFangSC-Medium;
|
|
44
51
|
font-size: 12px;
|
|
45
52
|
font-weight: 400;
|
|
46
53
|
line-height: 14px;
|
|
@@ -48,7 +55,7 @@ ul li {
|
|
|
48
55
|
text-align: center;
|
|
49
56
|
|
|
50
57
|
@include theme() {
|
|
51
|
-
color: get(text-secondary);
|
|
58
|
+
color: get(text-color-secondary);
|
|
52
59
|
}
|
|
53
60
|
}
|
|
54
61
|
}
|
|
@@ -4,7 +4,7 @@ import { Profile } from '../Profile';
|
|
|
4
4
|
import './styles/index.scss';
|
|
5
5
|
import { useMyProfile } from './hooks';
|
|
6
6
|
import { TUIProfileDefault } from './TUIProfileDefault';
|
|
7
|
-
import {
|
|
7
|
+
import { useUIManager } from '../../context';
|
|
8
8
|
|
|
9
9
|
interface TUIProfileProps {
|
|
10
10
|
className?: string,
|
|
@@ -21,13 +21,13 @@ function UnMemoizedTUIProfile<T extends TUIProfileProps>(
|
|
|
21
21
|
|
|
22
22
|
const { myProfile, updateMyProfile } = useMyProfile();
|
|
23
23
|
|
|
24
|
-
const { setTUIProfileShow, TUIProfileShow } =
|
|
24
|
+
const { setTUIProfileShow, TUIProfileShow } = useUIManager('TUIProfile');
|
|
25
25
|
|
|
26
26
|
const TUIProfileUIComponent = PropTUIProfile || TUIProfileDefault;
|
|
27
27
|
|
|
28
28
|
return (
|
|
29
29
|
<>
|
|
30
|
-
{/* //eslint-disable-next-line
|
|
30
|
+
{/* //eslint-disable-next-line
|
|
31
31
|
@ts-ignore */}
|
|
32
32
|
<Profile
|
|
33
33
|
profile={myProfile}
|
|
@@ -2,14 +2,14 @@ import React, { PropsWithChildren, useEffect, useState } from 'react';
|
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import DatePicker from 'react-date-picker';
|
|
4
4
|
import TencentCloudChat, { Profile } from '@tencentcloud/chat';
|
|
5
|
-
import { UpdateMyProfileParams } from
|
|
5
|
+
import { UpdateMyProfileParams } from '@tencentcloud/chat-uikit-engine';
|
|
6
6
|
import { isH5 } from '../../utils/env';
|
|
7
|
-
import {
|
|
7
|
+
import { useUIManager } from '../../context';
|
|
8
8
|
|
|
9
9
|
import { Avatar } from '../Avatar';
|
|
10
10
|
import { DivWithEdit } from '../DivWithEdit';
|
|
11
11
|
import { Icon, IconTypes } from '../Icon';
|
|
12
|
-
import { handleDisplayAvatar } from '../
|
|
12
|
+
import { handleDisplayAvatar } from '../utils';
|
|
13
13
|
|
|
14
14
|
const gender: any = {
|
|
15
15
|
[TencentCloudChat.TYPES.GENDER_UNKNOWN]: 'unknow',
|
|
@@ -58,9 +58,9 @@ const allowTypeList = [
|
|
|
58
58
|
];
|
|
59
59
|
|
|
60
60
|
export interface TUIProfileDefaultProps {
|
|
61
|
-
userInfo?: Profile
|
|
62
|
-
update?: (option: UpdateMyProfileParams) => void
|
|
63
|
-
className?: string
|
|
61
|
+
userInfo?: Profile;
|
|
62
|
+
update?: (option: UpdateMyProfileParams) => void;
|
|
63
|
+
className?: string;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
function TUIProfileDefaultWithContext<T extends TUIProfileDefaultProps>(
|
|
@@ -73,7 +73,7 @@ function TUIProfileDefaultWithContext<T extends TUIProfileDefaultProps>(
|
|
|
73
73
|
} = props;
|
|
74
74
|
|
|
75
75
|
const { t } = useTranslation();
|
|
76
|
-
const { setTUIProfileShow } =
|
|
76
|
+
const { setTUIProfileShow } = useUIManager('TUIProfileDefault');
|
|
77
77
|
|
|
78
78
|
const [isEditName, setIsEditName] = useState('');
|
|
79
79
|
|
|
@@ -117,13 +117,15 @@ function TUIProfileDefaultWithContext<T extends TUIProfileDefaultProps>(
|
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
119
|
name: 'Gender',
|
|
120
|
-
value: t(
|
|
120
|
+
value: t(userInfo?.gender && gender[userInfo?.gender]?.replace(
|
|
121
121
|
gender[userInfo?.gender][0],
|
|
122
122
|
gender[userInfo?.gender][0]?.toLocaleUpperCase(),
|
|
123
|
-
)
|
|
123
|
+
)
|
|
124
|
+
? `TUIProfile.${gender[userInfo?.gender]?.replace(
|
|
124
125
|
gender[userInfo?.gender][0],
|
|
125
126
|
gender[userInfo?.gender][0]?.toLocaleUpperCase(),
|
|
126
|
-
)}`
|
|
127
|
+
)}`
|
|
128
|
+
: ''),
|
|
127
129
|
type: 'select',
|
|
128
130
|
children: (
|
|
129
131
|
<ul className="select-list">
|
|
@@ -193,7 +195,7 @@ function TUIProfileDefaultWithContext<T extends TUIProfileDefaultProps>(
|
|
|
193
195
|
if (isH5) {
|
|
194
196
|
editListMap = editListMap.filter((item: any) => item.name !== 'Birthday');
|
|
195
197
|
}
|
|
196
|
-
const handleSetEditName = (name:string) => {
|
|
198
|
+
const handleSetEditName = (name: string) => {
|
|
197
199
|
setIsEditName(name);
|
|
198
200
|
};
|
|
199
201
|
|
|
@@ -312,8 +314,7 @@ function TUIProfileDefaultWithContext<T extends TUIProfileDefaultProps>(
|
|
|
312
314
|
const MemoizedTUIProfileDefault = React.memo(TUIProfileDefaultWithContext) as
|
|
313
315
|
typeof TUIProfileDefaultWithContext;
|
|
314
316
|
|
|
315
|
-
export function TUIProfileDefault(props: TUIProfileDefaultProps)
|
|
316
|
-
: React.ReactElement {
|
|
317
|
+
export function TUIProfileDefault(props: TUIProfileDefaultProps): React.ReactElement {
|
|
317
318
|
const options = { ...props };
|
|
318
319
|
return <MemoizedTUIProfileDefault {...options} />;
|
|
319
320
|
}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
@use "../../../styles/colors/color-theme" as *;
|
|
2
|
+
|
|
1
3
|
.tui-profile {
|
|
2
4
|
display: flex;
|
|
3
5
|
flex-direction: column;
|
|
4
6
|
align-items: center;
|
|
5
7
|
|
|
8
|
+
@include theme() {
|
|
9
|
+
color: get(text-color-primary);
|
|
10
|
+
}
|
|
11
|
+
|
|
6
12
|
&-header {
|
|
7
13
|
box-sizing: border-box;
|
|
8
14
|
width: 100%;
|
|
@@ -38,7 +44,6 @@
|
|
|
38
44
|
&-nick {
|
|
39
45
|
font-weight: 700;
|
|
40
46
|
font-size: 24px;
|
|
41
|
-
font-family: PingFangSC-Medium;
|
|
42
47
|
line-height: 29px;
|
|
43
48
|
text-align: center;
|
|
44
49
|
|
|
@@ -48,15 +53,14 @@
|
|
|
48
53
|
}
|
|
49
54
|
|
|
50
55
|
&-ID {
|
|
51
|
-
|
|
52
|
-
margin: 0;
|
|
56
|
+
margin: 6px 0;
|
|
53
57
|
display: flex;
|
|
54
58
|
align-items: center;
|
|
55
|
-
font-weight: 400;
|
|
56
59
|
font-size: 12px;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
|
|
61
|
+
@include theme() {
|
|
62
|
+
color: get(text-color-secondary);
|
|
63
|
+
}
|
|
60
64
|
|
|
61
65
|
h5 {
|
|
62
66
|
margin: 0;
|
|
@@ -76,20 +80,18 @@
|
|
|
76
80
|
cursor: pointer;
|
|
77
81
|
|
|
78
82
|
h4 {
|
|
79
|
-
padding-bottom: 3px;
|
|
80
|
-
font-weight: 400;
|
|
81
83
|
font-size: 16px;
|
|
82
|
-
font-family: PingFangSC-Medium;
|
|
83
|
-
line-height: 22px;
|
|
84
84
|
margin: 10px 0;
|
|
85
|
-
color: rgba(0, 0, 0, 60%);
|
|
86
85
|
}
|
|
87
86
|
}
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
&-div-with-edit {
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
height: auto !important;
|
|
91
|
+
|
|
92
|
+
@include theme() {
|
|
93
|
+
border-bottom: 1px solid get(stroke-color-primary);
|
|
94
|
+
}
|
|
93
95
|
}
|
|
94
96
|
|
|
95
97
|
&-edit {
|
package/src/components/index.ts
CHANGED