@tencentcloud/chat-uikit-react 3.0.2 → 3.0.3
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/debug/GenerateTestUserSig-es.js +26 -0
- package/debug/lib-generate-test-usersig-es.min.js +2 -0
- package/dist/{ChatSetting-BtQwjHr0.js → ChatSetting-LYkP2NWu.js} +9562 -8197
- package/dist/components/Chat/Chat.js +1 -1
- package/dist/components/ChatHeader/ChatHeader.js +1 -1
- package/dist/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.d.ts +3 -3
- package/dist/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.js +2 -2
- package/dist/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.d.ts +2 -2
- package/dist/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.js +37 -37
- package/dist/components/Profile/Profile.js +1 -1
- package/dist/components/Profile/ProfileDefault.js +1 -1
- package/dist/components/Profile/myProfile/MyProfile.js +1 -1
- package/dist/context/ChatContext.js +1 -1
- package/dist/index.js +611 -607
- package/dist/states/ChatHeaderState.js +18 -20
- package/dist/styles/ChatSetting.css +1 -1
- package/package.json +2 -2
- package/src/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.tsx +4 -4
- package/src/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.tsx +5 -5
- package/src/states/ChatHeaderState.ts +4 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tencentcloud/chat-uikit-react",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@tencentcloud/chat": "^3.5.2",
|
|
44
44
|
"@tencentcloud/chat-uikit-engine": "~2.5.1",
|
|
45
45
|
"@tencentcloud/tui-core": "latest",
|
|
46
|
-
"@tencentcloud/uikit-base-component-react": "0.
|
|
46
|
+
"@tencentcloud/uikit-base-component-react": "0.3.7",
|
|
47
47
|
"tuikit-atomicx-react": "0.1.2",
|
|
48
48
|
"@tencentcloud/universal-api": "^2.4.0",
|
|
49
49
|
"@tiptap/extension-image": "2.0.0-beta.220",
|
|
@@ -3,11 +3,11 @@ import { CallMediaType } from '@tencentcloud/call-uikit-react';
|
|
|
3
3
|
import TUIChatEngine from '@tencentcloud/chat-uikit-engine';
|
|
4
4
|
import TUICore, { TUIConstants } from '@tencentcloud/tui-core';
|
|
5
5
|
import { useUIKit, IconSearch, IconVideoDefault, IconCall1, IconHorizontalMoreTwo } from '@tencentcloud/uikit-base-component-react';
|
|
6
|
-
import { useUIOpenControlState, View, useConversationListState, startCall } from 'tuikit-atomicx-react';
|
|
7
6
|
import cs from 'classnames';
|
|
7
|
+
import { useUIOpenControlState, View, useConversationListState, startCall } from 'tuikit-atomicx-react';
|
|
8
8
|
import classes from './ChatHeaderActions.module.scss';
|
|
9
9
|
|
|
10
|
-
interface
|
|
10
|
+
interface ChatHeaderActionsProps {
|
|
11
11
|
/** Whether to enable call features */
|
|
12
12
|
chatHeaderActions?: Array<'videoCall' | 'audioCall' | 'chatSetting' | 'search'> | undefined;
|
|
13
13
|
/** Additional class names */
|
|
@@ -16,7 +16,7 @@ interface IChatHeaderActionsProps {
|
|
|
16
16
|
style?: React.CSSProperties | undefined;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
const ChatHeaderActions = (props:
|
|
19
|
+
const ChatHeaderActions = (props: ChatHeaderActionsProps) => {
|
|
20
20
|
const {
|
|
21
21
|
chatHeaderActions = ['videoCall', 'audioCall', 'search', 'chatSetting'],
|
|
22
22
|
className,
|
|
@@ -102,4 +102,4 @@ const ChatHeaderActions = (props: IChatHeaderActionsProps) => {
|
|
|
102
102
|
);
|
|
103
103
|
};
|
|
104
104
|
export { ChatHeaderActions };
|
|
105
|
-
export type {
|
|
105
|
+
export type { ChatHeaderActionsProps };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import { useUIKit, IconChevronLeft } from '@tencentcloud/uikit-base-component-react';
|
|
3
|
-
import { useConversationListState, View, Avatar as DefaultAvatar, useUIOpenControlState } from 'tuikit-atomicx-react';
|
|
4
3
|
import cs from 'classnames';
|
|
4
|
+
import { useConversationListState, View, Avatar as DefaultAvatar, useUIOpenControlState } from 'tuikit-atomicx-react';
|
|
5
5
|
import { ChatHeaderActions } from '../ChatHeaderActions';
|
|
6
6
|
import classes from './ChatHeaderUI.module.scss';
|
|
7
7
|
import type { IUserStatus } from '../../../types/user';
|
|
8
8
|
import type { IConversationModel } from '@tencentcloud/chat-uikit-engine';
|
|
9
9
|
import type { AvatarProps } from 'tuikit-atomicx-react';
|
|
10
10
|
|
|
11
|
-
interface
|
|
11
|
+
interface ChatHeaderUIProps {
|
|
12
12
|
/** Custom title, if not provided, will use conversation info */
|
|
13
13
|
title: string;
|
|
14
14
|
/** Whether it's a group conversation */
|
|
@@ -42,7 +42,7 @@ const UserStatus = {
|
|
|
42
42
|
Offline: 'Offline',
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
const ChatHeaderUI = (props:
|
|
45
|
+
const ChatHeaderUI = (props: ChatHeaderUIProps) => {
|
|
46
46
|
const {
|
|
47
47
|
title,
|
|
48
48
|
avatar,
|
|
@@ -95,10 +95,10 @@ const ChatHeaderUI = (props: IChatHeaderUIProps) => {
|
|
|
95
95
|
{
|
|
96
96
|
Avatar
|
|
97
97
|
? (
|
|
98
|
-
<Avatar src={avatar || ''} />
|
|
98
|
+
<Avatar src={avatar || ''} alt={title} />
|
|
99
99
|
)
|
|
100
100
|
: (
|
|
101
|
-
<DefaultAvatar src={avatar || ''} />
|
|
101
|
+
<DefaultAvatar src={avatar || ''} alt={title} isShowOnlineStatus={!isGroup && enableUserStatus} isOnline={userStatus?.statusType === 1} />
|
|
102
102
|
)
|
|
103
103
|
}
|
|
104
104
|
<View className={classes['chat-header__info']}>
|
|
@@ -59,25 +59,24 @@ function useChatHeaderState(): UseChatHeaderStoreReturn {
|
|
|
59
59
|
|
|
60
60
|
const avatar = useMemo<string>(() => {
|
|
61
61
|
if (!activeConversation) {
|
|
62
|
-
return
|
|
62
|
+
return '';
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
if (isSystemConversation) {
|
|
66
|
-
return
|
|
66
|
+
return '';
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
const {
|
|
70
70
|
type,
|
|
71
71
|
userProfile,
|
|
72
|
-
groupProfile,
|
|
73
72
|
} = activeConversation;
|
|
74
73
|
|
|
75
74
|
if (type === TUIChatEngine.TYPES.CONV_C2C) {
|
|
76
|
-
return userProfile?.avatar
|
|
75
|
+
return userProfile?.avatar;
|
|
77
76
|
}
|
|
78
77
|
|
|
79
78
|
if (type === TUIChatEngine.TYPES.CONV_GROUP) {
|
|
80
|
-
return
|
|
79
|
+
return activeConversation.getAvatar();
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
return '';
|