@tencentcloud/chat-uikit-react 3.0.3 → 3.4.2
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.cjs +5 -4
- package/CHANGELOG.md +9 -0
- package/dist/components/Chat/Chat.d.ts +1 -1
- package/dist/components/Chat/Chat.js +18 -23
- package/dist/components/ChatHeader/AudioCallPicker/AudioCallPicker.d.ts +30 -0
- package/dist/components/ChatHeader/AudioCallPicker/AudioCallPicker.js +135 -0
- package/dist/components/ChatHeader/AudioCallPicker/index.d.ts +1 -0
- package/dist/components/ChatHeader/AudioCallPicker/index.js +4 -0
- package/dist/components/ChatHeader/ChatHeader.d.ts +6 -0
- package/dist/components/ChatHeader/ChatHeader.js +43 -41
- package/dist/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.d.ts +12 -7
- package/dist/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.js +47 -65
- package/dist/components/ChatHeader/VideoCallPicker/VideoCallPicker.d.ts +30 -0
- package/dist/components/ChatHeader/VideoCallPicker/VideoCallPicker.js +135 -0
- package/dist/components/ChatHeader/VideoCallPicker/index.d.ts +1 -0
- package/dist/components/ChatHeader/VideoCallPicker/index.js +4 -0
- package/dist/components/ChatHeader/index.d.ts +2 -1
- package/dist/components/ChatHeader/index.js +4 -2
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Model/index.js +1 -1
- package/dist/components/Plugins/index.js +1 -1
- package/dist/components/Popup/index.js +1 -1
- package/dist/components/PopupNew/Popup.js +1 -1
- package/dist/components/Profile/Profile.js +20 -22
- package/dist/components/Profile/ProfileDefault.d.ts +3 -2
- package/dist/components/Profile/ProfileDefault.js +55 -56
- package/dist/components/Profile/hooks/useMyProfile.d.ts +2 -3
- package/dist/components/Profile/hooks/useMyProfile.js +1 -1
- package/dist/components/Profile/myProfile/MyProfile.d.ts +1 -1
- package/dist/components/Profile/myProfile/MyProfile.js +12 -16
- package/dist/components/index.js +27 -25
- package/dist/context/ChatContext.d.ts +1 -1
- package/dist/context/ChatContext.js +11 -16
- package/dist/context/ContactContext.d.ts +1 -1
- package/dist/external_modules/mui-BhvHeL5-.js +2253 -0
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +2 -2
- package/dist/{states/ChatHeaderState.d.ts → hooks/useChatHeader.d.ts} +6 -6
- package/dist/hooks/useChatHeader.js +41 -0
- package/dist/index-UBuvRM8r-DTXQB6zV.js +34000 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +93 -4133
- package/dist/server/mainServer.js +2 -2
- package/dist/states/UIManagerState.d.ts +5 -5
- package/dist/states/UIManagerState.js +2 -2
- package/dist/states/index.d.ts +0 -1
- package/dist/states/index.js +2 -4
- package/dist/styles/AudioCallPicker.css +1 -0
- package/dist/styles/ChatHeaderUI.css +1 -1
- package/dist/styles/VideoCallPicker.css +1 -0
- package/dist/styles/index-UBuvRM8r.css +1 -0
- package/dist/styles/index.css +1 -1
- package/dist/styles/index2.css +1 -1
- package/dist/styles/index3.css +1 -1
- package/dist/styles/index4.css +1 -1
- package/dist/styles/index5.css +1 -1
- package/dist/types/message.d.ts +1 -1
- package/dist/types/user.d.ts +4 -4
- package/package.json +12 -20
- package/src/components/ChatHeader/AudioCallPicker/AudioCallPicker.module.scss +57 -0
- package/src/components/ChatHeader/AudioCallPicker/AudioCallPicker.tsx +234 -0
- package/src/components/ChatHeader/AudioCallPicker/index.ts +1 -0
- package/src/components/ChatHeader/ChatHeader.tsx +15 -3
- package/src/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.tsx +29 -36
- package/src/components/ChatHeader/VideoCallPicker/VideoCallPicker.module.scss +57 -0
- package/src/components/ChatHeader/VideoCallPicker/VideoCallPicker.tsx +233 -0
- package/src/components/ChatHeader/VideoCallPicker/index.ts +1 -0
- package/src/components/ChatHeader/index.ts +2 -1
- package/src/components/Profile/Profile.tsx +7 -6
- package/src/components/Profile/ProfileDefault.tsx +8 -8
- package/src/components/Profile/hooks/useMyProfile.tsx +2 -3
- package/src/components/Profile/myProfile/MyProfile.tsx +1 -1
- package/src/context/ChatContext.tsx +1 -1
- package/src/context/ContactContext.tsx +1 -1
- package/src/hooks/index.ts +2 -2
- package/src/{states/ChatHeaderState.ts → hooks/useChatHeader.ts} +15 -17
- package/src/index.ts +3 -5
- package/src/server/mainServer.ts +2 -2
- package/src/states/UIManagerState.ts +9 -9
- package/src/states/index.ts +0 -2
- package/src/styles/index.scss +0 -1
- package/src/types/message.ts +1 -1
- package/src/types/user.ts +4 -4
- package/vite.config.ts +4 -25
- package/dist/ChatSetting-LYkP2NWu.js +0 -29890
- package/dist/assets/fonts/iconfont.ttf +0 -0
- package/dist/assets/fonts/iconfont.woff +0 -0
- package/dist/assets/fonts/iconfont.woff2 +0 -0
- package/dist/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.d.ts +0 -11
- package/dist/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.js +0 -79
- package/dist/components/ChatHeader/ChatHeaderActions/index.d.ts +0 -1
- package/dist/components/ChatHeader/ChatHeaderActions/index.js +0 -4
- package/dist/components/IconFont/Icon.d.ts +0 -21
- package/dist/components/IconFont/Icon.js +0 -47
- package/dist/components/IconFont/index.d.ts +0 -2
- package/dist/components/IconFont/index.js +0 -4
- package/dist/external_modules/lodash-vwDjcXxQ.js +0 -0
- package/dist/external_modules/mui-BcA3SBHM.js +0 -2473
- package/dist/states/ChatHeaderState.js +0 -46
- package/dist/styles/ChatHeaderActions.css +0 -1
- package/dist/styles/ChatSetting.css +0 -1
- package/dist/styles/Icon2.css +0 -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/ChatHeader/ChatHeaderActions/ChatHeaderActions.module.scss +0 -44
- package/src/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.tsx +0 -105
- package/src/components/ChatHeader/ChatHeaderActions/index.ts +0 -1
- package/src/components/IconFont/Icon.module.scss +0 -42
- package/src/components/IconFont/Icon.tsx +0 -68
- package/src/components/IconFont/index.ts +0 -3
- package/src/styles/fonts/icon-font.scss +0 -18
package/.eslintrc.cjs
CHANGED
|
@@ -6,11 +6,12 @@ module.exports = {
|
|
|
6
6
|
],
|
|
7
7
|
parserOptions: {
|
|
8
8
|
project: [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
'./tsconfig.json',
|
|
10
|
+
'./tsconfig.app.json',
|
|
11
|
+
'./tsconfig.node.json',
|
|
12
|
+
'./storybook/tsconfig.eslint.json',
|
|
13
13
|
],
|
|
14
|
+
tsconfigRootDir: __dirname,
|
|
14
15
|
},
|
|
15
16
|
rules: {
|
|
16
17
|
"@typescript-eslint/naming-convention": [
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [3.4.2] (2025-10-14)
|
|
2
|
+
|
|
3
|
+
#### feat
|
|
4
|
+
* feat: Support the fusion use of CallKit
|
|
5
|
+
* feat: Support group audio and video calls, as well as audio and video call message display
|
|
6
|
+
|
|
7
|
+
#### fix
|
|
8
|
+
* fix: Fix the problem that the enableCreate and enableSearch properties of the ConversionList component do not take effect
|
|
9
|
+
|
|
1
10
|
## [3.0.2] (2025-07-30)
|
|
2
11
|
|
|
3
12
|
#### chore
|
|
@@ -6,6 +6,6 @@ interface IChatProps extends IChatContextProps {
|
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
PlaceholderEmpty?: React.ReactNode;
|
|
8
8
|
}
|
|
9
|
-
declare const Chat: (props: IChatProps) => string | number | boolean | import("react/jsx-runtime").JSX.Element |
|
|
9
|
+
declare const Chat: (props: IChatProps) => string | number | boolean | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element | null;
|
|
10
10
|
export { Chat };
|
|
11
11
|
export type { IChatProps };
|
|
@@ -1,30 +1,25 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import "
|
|
4
|
-
import "@tencentcloud/chat-uikit-engine";
|
|
5
|
-
import "@tencentcloud/tui-core";
|
|
6
|
-
import "react";
|
|
7
|
-
import "@tencentcloud/chat";
|
|
8
|
-
import { c as p } from "../../external_modules/classnames-HRMVOjAa.js";
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { a as i, V as n } from "../../index-UBuvRM8r-DTXQB6zV.js";
|
|
3
|
+
import { c as m } from "../../external_modules/classnames-HRMVOjAa.js";
|
|
9
4
|
import { ChatProvider as l } from "../../context/ChatContext.js";
|
|
10
|
-
import '../../styles/Chat.css';const
|
|
11
|
-
chat:
|
|
12
|
-
},
|
|
5
|
+
import '../../styles/Chat.css';const h = "uikit-chat", p = {
|
|
6
|
+
chat: h
|
|
7
|
+
}, y = (r) => {
|
|
13
8
|
const {
|
|
14
|
-
PlaceholderEmpty:
|
|
15
|
-
className:
|
|
16
|
-
style:
|
|
17
|
-
children:
|
|
18
|
-
} =
|
|
19
|
-
return t != null && t.conversationID ? /* @__PURE__ */
|
|
20
|
-
|
|
9
|
+
PlaceholderEmpty: o = null,
|
|
10
|
+
className: a,
|
|
11
|
+
style: c,
|
|
12
|
+
children: e
|
|
13
|
+
} = r, { activeConversation: t } = i();
|
|
14
|
+
return t != null && t.conversationID ? /* @__PURE__ */ s(l, { children: /* @__PURE__ */ s(
|
|
15
|
+
n,
|
|
21
16
|
{
|
|
22
|
-
className: p
|
|
23
|
-
style:
|
|
24
|
-
children:
|
|
17
|
+
className: m(p.chat, a),
|
|
18
|
+
style: c,
|
|
19
|
+
children: e
|
|
25
20
|
}
|
|
26
|
-
) }) :
|
|
21
|
+
) }) : o;
|
|
27
22
|
};
|
|
28
23
|
export {
|
|
29
|
-
|
|
24
|
+
y as Chat
|
|
30
25
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface AudioCallPickerProps {
|
|
3
|
+
/**
|
|
4
|
+
* Label text for the button
|
|
5
|
+
*/
|
|
6
|
+
label?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Icon size in pixels
|
|
9
|
+
*/
|
|
10
|
+
iconSize?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the button is disabled
|
|
13
|
+
*/
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Custom className for the button
|
|
17
|
+
*/
|
|
18
|
+
className?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Custom style for the button
|
|
21
|
+
*/
|
|
22
|
+
style?: React.CSSProperties;
|
|
23
|
+
/**
|
|
24
|
+
* Custom icon slot
|
|
25
|
+
*/
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
}
|
|
28
|
+
declare const AudioCallPicker: (props: AudioCallPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export { AudioCallPicker };
|
|
30
|
+
export type { AudioCallPickerProps };
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { jsx as a, Fragment as V, jsxs as B } from "react/jsx-runtime";
|
|
2
|
+
import { useState as j, useRef as z, useMemo as n, useCallback as r } from "react";
|
|
3
|
+
import { useUIKit as K, IconCallFilled as X, Dialog as Y } from "@tencentcloud/uikit-base-component-react";
|
|
4
|
+
import { c as Z } from "../../../external_modules/classnames-HRMVOjAa.js";
|
|
5
|
+
import { b as $, a as q, y as H, C as y, s as h, V as J, O as Q } from "../../../index-UBuvRM8r-DTXQB6zV.js";
|
|
6
|
+
import '../../../styles/AudioCallPicker.css';const u = {
|
|
7
|
+
"audio-call-picker__button": "uikit-audio-call-picker__button",
|
|
8
|
+
"audio-call-picker__button--disabled": "uikit-audio-call-picker__button--disabled",
|
|
9
|
+
"audio-call-picker__icon": "uikit-audio-call-picker__icon",
|
|
10
|
+
"group-call-dialog": "uikit-group-call-dialog"
|
|
11
|
+
}, G = 1, W = 80, v = 8, ee = 1, se = (D) => {
|
|
12
|
+
const {
|
|
13
|
+
label: S = "",
|
|
14
|
+
iconSize: A = 20,
|
|
15
|
+
disabled: s = !1,
|
|
16
|
+
className: L,
|
|
17
|
+
style: P,
|
|
18
|
+
children: E
|
|
19
|
+
} = D, { t: p } = K(), { loginUserInfo: i } = $(), { activeConversation: e } = q(), { allMembers: t, getGroupMemberList: _, memberCount: g } = H(), [R, b] = j(!1), d = z(null), k = n(() => i == null ? void 0 : i.userId, [i]), U = n(() => (e == null ? void 0 : e.type) === y.C2C, [e]), x = n(() => (t == null ? void 0 : t.map((o) => ({
|
|
20
|
+
key: o.userID,
|
|
21
|
+
label: o.nick || o.userID,
|
|
22
|
+
avatarUrl: o.avatar
|
|
23
|
+
}))) ?? [], [t]), N = n(() => !(!e || s), [e, s]), w = r(() => {
|
|
24
|
+
var l;
|
|
25
|
+
const o = (l = e == null ? void 0 : e.userProfile) == null ? void 0 : l.userID;
|
|
26
|
+
if (!o) {
|
|
27
|
+
console.warn("No peer user ID found for C2C call");
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
h({
|
|
32
|
+
userIDList: [o],
|
|
33
|
+
type: G
|
|
34
|
+
});
|
|
35
|
+
} catch (f) {
|
|
36
|
+
console.error("Failed to start private audio call:", f);
|
|
37
|
+
}
|
|
38
|
+
}, []), C = r(() => {
|
|
39
|
+
if ((e == null ? void 0 : e.type) !== y.GROUP)
|
|
40
|
+
return;
|
|
41
|
+
const o = (t == null ? void 0 : t.length) || 0;
|
|
42
|
+
o < (g || 0) && _({
|
|
43
|
+
count: W,
|
|
44
|
+
offset: o
|
|
45
|
+
});
|
|
46
|
+
}, [e, t, g, _]), O = r(() => {
|
|
47
|
+
C(), b(!0);
|
|
48
|
+
}, [C]), c = r(() => {
|
|
49
|
+
b(!1);
|
|
50
|
+
}, []), I = r(() => {
|
|
51
|
+
var M;
|
|
52
|
+
const o = (M = e == null ? void 0 : e.groupProfile) == null ? void 0 : M.groupID;
|
|
53
|
+
if (!d.current || !o) {
|
|
54
|
+
console.warn("Missing group information for group call");
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const l = d.current.getSelectedItems();
|
|
58
|
+
if (!Array.isArray(l) || l.length === 0) {
|
|
59
|
+
console.warn("No members selected for group call");
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const f = l.map((m) => m.key);
|
|
63
|
+
try {
|
|
64
|
+
h({
|
|
65
|
+
userIDList: f,
|
|
66
|
+
chatGroupID: o,
|
|
67
|
+
type: G
|
|
68
|
+
}), c();
|
|
69
|
+
} catch (m) {
|
|
70
|
+
console.error("Failed to start group audio call:", m);
|
|
71
|
+
}
|
|
72
|
+
}, [c]), F = r(() => {
|
|
73
|
+
if (!N) {
|
|
74
|
+
console.warn("Cannot start audio call");
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
U ? w() : O();
|
|
78
|
+
}, []), T = r(() => {
|
|
79
|
+
I();
|
|
80
|
+
}, [I]);
|
|
81
|
+
return /* @__PURE__ */ a(V, { children: /* @__PURE__ */ B(J, { children: [
|
|
82
|
+
/* @__PURE__ */ a(
|
|
83
|
+
"button",
|
|
84
|
+
{
|
|
85
|
+
type: "button",
|
|
86
|
+
className: Z(
|
|
87
|
+
u["audio-call-picker__button"],
|
|
88
|
+
{
|
|
89
|
+
[u["audio-call-picker__button--disabled"]]: s
|
|
90
|
+
},
|
|
91
|
+
L
|
|
92
|
+
),
|
|
93
|
+
style: P,
|
|
94
|
+
onClick: F,
|
|
95
|
+
disabled: s,
|
|
96
|
+
"aria-label": S || "Audio Call",
|
|
97
|
+
children: E || /* @__PURE__ */ a(
|
|
98
|
+
X,
|
|
99
|
+
{
|
|
100
|
+
className: u["audio-call-picker__icon"],
|
|
101
|
+
size: `${A}px`
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
/* @__PURE__ */ a(
|
|
107
|
+
Y,
|
|
108
|
+
{
|
|
109
|
+
visible: R,
|
|
110
|
+
title: p("MessageInput.select_call_members"),
|
|
111
|
+
cancelText: p("MessageInput.cancel"),
|
|
112
|
+
onCancel: c,
|
|
113
|
+
onClose: c,
|
|
114
|
+
confirmText: p("MessageInput.initiate_call"),
|
|
115
|
+
onConfirm: T,
|
|
116
|
+
className: u["group-call-dialog"],
|
|
117
|
+
children: /* @__PURE__ */ a(
|
|
118
|
+
Q,
|
|
119
|
+
{
|
|
120
|
+
ref: d,
|
|
121
|
+
displayMode: "list",
|
|
122
|
+
dataSource: x,
|
|
123
|
+
lockedItems: k ? [{ key: k }] : [],
|
|
124
|
+
maxCount: v,
|
|
125
|
+
minCount: ee,
|
|
126
|
+
onReachEnd: C
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
)
|
|
131
|
+
] }) });
|
|
132
|
+
};
|
|
133
|
+
export {
|
|
134
|
+
se as AudioCallPicker
|
|
135
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AudioCallPicker } from './AudioCallPicker';
|
|
@@ -7,10 +7,16 @@ interface ChatHeaderProps {
|
|
|
7
7
|
avatar?: string | undefined;
|
|
8
8
|
/** Whether to show user status */
|
|
9
9
|
enableUserStatus?: boolean | undefined;
|
|
10
|
+
/** Whether to show call features */
|
|
11
|
+
enableCall?: boolean | undefined;
|
|
10
12
|
/** Whether to enable chat setting */
|
|
11
13
|
chatHeaderActions?: Array<'videoCall' | 'audioCall' | 'chatSetting' | 'search'> | undefined;
|
|
12
14
|
/** Custom avatar component */
|
|
13
15
|
Avatar?: React.ComponentType<AvatarProps> | undefined;
|
|
16
|
+
/** Custom left slot */
|
|
17
|
+
ChatHeaderLeft?: React.ReactNode | undefined;
|
|
18
|
+
/** Custom right slot */
|
|
19
|
+
ChatHeaderRight?: React.ReactNode | undefined;
|
|
14
20
|
/** Additional class names */
|
|
15
21
|
className?: string | undefined;
|
|
16
22
|
/** Additional style */
|
|
@@ -1,51 +1,53 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useEffect as
|
|
3
|
-
import { TUIUserService as
|
|
4
|
-
import {
|
|
5
|
-
import "
|
|
6
|
-
import "
|
|
7
|
-
|
|
8
|
-
import "../../states/UIManagerState.js";
|
|
9
|
-
import { useChatHeaderState as U } from "../../states/ChatHeaderState.js";
|
|
10
|
-
import x from "./ChatHeaderUI/ChatHeaderUI.js";
|
|
11
|
-
const E = (e) => {
|
|
1
|
+
import { jsx as v } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as H } from "react";
|
|
3
|
+
import { TUIUserService as U } from "@tencentcloud/chat-uikit-engine-lite";
|
|
4
|
+
import { u as x } from "../../index-UBuvRM8r-DTXQB6zV.js";
|
|
5
|
+
import { useChatHeader as y } from "../../hooks/useChatHeader.js";
|
|
6
|
+
import g from "./ChatHeaderUI/ChatHeaderUI.js";
|
|
7
|
+
const w = (t) => {
|
|
12
8
|
const {
|
|
13
|
-
title:
|
|
14
|
-
avatar:
|
|
15
|
-
enableUserStatus:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
title: a,
|
|
10
|
+
avatar: r,
|
|
11
|
+
enableUserStatus: e = !1,
|
|
12
|
+
enableCall: s = !1,
|
|
13
|
+
chatHeaderActions: i,
|
|
14
|
+
Avatar: o,
|
|
15
|
+
className: c,
|
|
16
|
+
style: l,
|
|
17
|
+
ChatHeaderLeft: n,
|
|
18
|
+
ChatHeaderRight: m
|
|
19
|
+
} = t, {
|
|
20
|
+
system: u,
|
|
21
|
+
conversation: f,
|
|
23
22
|
isGroup: p,
|
|
24
|
-
title:
|
|
25
|
-
avatar:
|
|
26
|
-
userStatus:
|
|
27
|
-
} =
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
}, [
|
|
31
|
-
|
|
23
|
+
title: h,
|
|
24
|
+
avatar: d,
|
|
25
|
+
userStatus: C
|
|
26
|
+
} = y(), { isPeerTyping: S } = x();
|
|
27
|
+
return H(() => {
|
|
28
|
+
U.switchUserStatus({ displayOnlineStatus: e });
|
|
29
|
+
}, [e]), /* @__PURE__ */ v(
|
|
30
|
+
g,
|
|
32
31
|
{
|
|
33
32
|
isGroup: p,
|
|
34
|
-
title:
|
|
35
|
-
avatar:
|
|
36
|
-
userStatus:
|
|
37
|
-
conversation:
|
|
33
|
+
title: a || h || "",
|
|
34
|
+
avatar: r || d,
|
|
35
|
+
userStatus: C,
|
|
36
|
+
conversation: f,
|
|
38
37
|
isPeerTyping: S,
|
|
39
|
-
system:
|
|
40
|
-
enableUserStatus:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
system: u,
|
|
39
|
+
enableUserStatus: e,
|
|
40
|
+
enableCall: s,
|
|
41
|
+
chatHeaderActions: i,
|
|
42
|
+
Avatar: o,
|
|
43
|
+
style: l,
|
|
44
|
+
className: c,
|
|
45
|
+
onSearchClick: t.onSearchClick,
|
|
46
|
+
ChatHeaderLeft: n,
|
|
47
|
+
ChatHeaderRight: m
|
|
46
48
|
}
|
|
47
49
|
);
|
|
48
50
|
};
|
|
49
51
|
export {
|
|
50
|
-
|
|
52
|
+
w as ChatHeader
|
|
51
53
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { AvatarProps } from 'tuikit-atomicx-react';
|
|
2
|
+
import { UserStatus } from '../../../types/user';
|
|
3
|
+
import { ConversationModel } from 'tuikit-atomicx-react';
|
|
5
4
|
interface ChatHeaderUIProps {
|
|
6
5
|
/** Custom title, if not provided, will use conversation info */
|
|
7
6
|
title: string;
|
|
@@ -12,17 +11,23 @@ interface ChatHeaderUIProps {
|
|
|
12
11
|
/** Whether the peer is typing */
|
|
13
12
|
isPeerTyping?: boolean;
|
|
14
13
|
/** user status */
|
|
15
|
-
userStatus?:
|
|
14
|
+
userStatus?: UserStatus | undefined;
|
|
16
15
|
/** Whether to show user status */
|
|
17
|
-
enableUserStatus?: boolean;
|
|
16
|
+
enableUserStatus?: boolean | undefined;
|
|
17
|
+
/** Whether to show call features */
|
|
18
|
+
enableCall?: boolean | undefined;
|
|
18
19
|
/** Whether it's a system conversation */
|
|
19
20
|
system?: boolean | undefined;
|
|
20
21
|
/** IM conversation model */
|
|
21
|
-
conversation?:
|
|
22
|
+
conversation?: ConversationModel | undefined;
|
|
22
23
|
/** Whether to show call features */
|
|
23
24
|
chatHeaderActions?: Array<'videoCall' | 'audioCall' | 'chatSetting' | 'search'> | undefined;
|
|
24
25
|
/** Custom avatar component */
|
|
25
|
-
Avatar?: React.ComponentType<
|
|
26
|
+
Avatar?: React.ComponentType<any> | undefined;
|
|
27
|
+
/** Custom left slot */
|
|
28
|
+
ChatHeaderLeft?: React.ReactNode | undefined;
|
|
29
|
+
/** Custom right slot */
|
|
30
|
+
ChatHeaderRight?: React.ReactNode | undefined;
|
|
26
31
|
/** Additional class names */
|
|
27
32
|
className?: string | undefined;
|
|
28
33
|
/** Additional style */
|
|
@@ -1,87 +1,69 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useUIKit as
|
|
3
|
-
import { c as
|
|
4
|
-
import {
|
|
5
|
-
import "
|
|
6
|
-
import "
|
|
7
|
-
import "react";
|
|
8
|
-
import "@tencentcloud/chat";
|
|
9
|
-
import { ChatHeaderActions as x } from "../ChatHeaderActions/ChatHeaderActions.js";
|
|
1
|
+
import { jsx as t, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { useUIKit as C } from "@tencentcloud/uikit-base-component-react";
|
|
3
|
+
import { c as m } from "../../../external_modules/classnames-HRMVOjAa.js";
|
|
4
|
+
import { V as a, A as v } from "../../../index-UBuvRM8r-DTXQB6zV.js";
|
|
5
|
+
import { AudioCallPicker as g } from "../AudioCallPicker/AudioCallPicker.js";
|
|
6
|
+
import { VideoCallPicker as T } from "../VideoCallPicker/VideoCallPicker.js";
|
|
10
7
|
import '../../../styles/ChatHeaderUI.css';const e = {
|
|
11
8
|
"chat-header": "uikit-chat-header",
|
|
12
9
|
"chat-header__container": "uikit-chat-header__container",
|
|
13
10
|
"chat-header__left": "uikit-chat-header__left",
|
|
14
|
-
"chat-header__back-icon": "uikit-chat-header__back-icon",
|
|
15
11
|
"chat-header__info": "uikit-chat-header__info",
|
|
16
12
|
"chat-header__title": "uikit-chat-header__title",
|
|
17
13
|
"chat-header__typing-indicator": "uikit-chat-header__typing-indicator",
|
|
18
|
-
"chat-header__live": "uikit-chat-header__live"
|
|
19
|
-
|
|
20
|
-
}, p = {
|
|
21
|
-
Online: "Online",
|
|
22
|
-
Offline: "Offline"
|
|
23
|
-
}, K = (u) => {
|
|
14
|
+
"chat-header__live": "uikit-chat-header__live"
|
|
15
|
+
}, H = (f) => {
|
|
24
16
|
const {
|
|
25
|
-
title:
|
|
26
|
-
avatar:
|
|
27
|
-
isPeerTyping:
|
|
28
|
-
system:
|
|
17
|
+
title: h,
|
|
18
|
+
avatar: s,
|
|
19
|
+
isPeerTyping: p = !1,
|
|
20
|
+
system: u = !1,
|
|
29
21
|
userStatus: i,
|
|
30
|
-
enableUserStatus:
|
|
31
|
-
|
|
32
|
-
Avatar:
|
|
33
|
-
isGroup:
|
|
34
|
-
className:
|
|
35
|
-
style:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
{
|
|
41
|
-
className: s(e["chat-header"], d),
|
|
42
|
-
style: m,
|
|
43
|
-
children: "System Notice"
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
function f() {
|
|
47
|
-
O(""), v(!1), y(!1);
|
|
48
|
-
}
|
|
49
|
-
return /* @__PURE__ */ t(
|
|
22
|
+
enableUserStatus: n = !0,
|
|
23
|
+
enableCall: N = !1,
|
|
24
|
+
Avatar: d,
|
|
25
|
+
isGroup: c,
|
|
26
|
+
className: _,
|
|
27
|
+
style: o,
|
|
28
|
+
ChatHeaderLeft: y = null,
|
|
29
|
+
ChatHeaderRight: k = null
|
|
30
|
+
} = f, { t: l } = C();
|
|
31
|
+
return u ? /* @__PURE__ */ t(
|
|
50
32
|
a,
|
|
51
33
|
{
|
|
52
|
-
className:
|
|
53
|
-
style:
|
|
54
|
-
children:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
34
|
+
className: m(e["chat-header"], _),
|
|
35
|
+
style: o,
|
|
36
|
+
children: "System Notice"
|
|
37
|
+
}
|
|
38
|
+
) : /* @__PURE__ */ t(
|
|
39
|
+
a,
|
|
40
|
+
{
|
|
41
|
+
className: m(e["chat-header"], _),
|
|
42
|
+
style: o,
|
|
43
|
+
children: /* @__PURE__ */ r(a, { className: e["chat-header__container"], children: [
|
|
44
|
+
/* @__PURE__ */ r(a, { className: e["chat-header__left"], children: [
|
|
45
|
+
y,
|
|
46
|
+
d ? /* @__PURE__ */ t(d, { src: s || "", alt: h }) : /* @__PURE__ */ t(v, { src: s || "", alt: h, isShowOnlineStatus: !c && n, isOnline: (i == null ? void 0 : i.statusType) === 1 }),
|
|
47
|
+
/* @__PURE__ */ r(a, { className: e["chat-header__info"], children: [
|
|
48
|
+
/* @__PURE__ */ r(a, { className: e["chat-header__title"], children: [
|
|
49
|
+
h,
|
|
50
|
+
!c && p && /* @__PURE__ */ r("span", { className: e["chat-header__typing-indicator"], children: [
|
|
68
51
|
" ",
|
|
69
|
-
|
|
52
|
+
l("TUIChat.Typing")
|
|
70
53
|
] })
|
|
71
54
|
] }),
|
|
72
|
-
!
|
|
55
|
+
!c && n && ((i == null ? void 0 : i.statusType) === 1 ? /* @__PURE__ */ t(a, { className: e["chat-header__live"], children: l("TUIChat.Online") }) : /* @__PURE__ */ t(a, { className: e["chat-header__live"], children: l("TUIChat.Offline") }))
|
|
73
56
|
] })
|
|
74
57
|
] }),
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
77
|
-
{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
)
|
|
58
|
+
N && /* @__PURE__ */ r(a, { className: e["chat-header__call"], flexDir: "row", gap: 8, children: [
|
|
59
|
+
/* @__PURE__ */ t(g, {}),
|
|
60
|
+
/* @__PURE__ */ t(T, {})
|
|
61
|
+
] }),
|
|
62
|
+
k
|
|
81
63
|
] })
|
|
82
64
|
}
|
|
83
65
|
);
|
|
84
66
|
};
|
|
85
67
|
export {
|
|
86
|
-
|
|
68
|
+
H as default
|
|
87
69
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface VideoCallPickerProps {
|
|
3
|
+
/**
|
|
4
|
+
* Label text for the button
|
|
5
|
+
*/
|
|
6
|
+
label?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Icon size in pixels
|
|
9
|
+
*/
|
|
10
|
+
iconSize?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the button is disabled
|
|
13
|
+
*/
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Custom className for the button
|
|
17
|
+
*/
|
|
18
|
+
className?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Custom style for the button
|
|
21
|
+
*/
|
|
22
|
+
style?: React.CSSProperties;
|
|
23
|
+
/**
|
|
24
|
+
* Custom icon slot
|
|
25
|
+
*/
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
}
|
|
28
|
+
declare const VideoCallPicker: (props: VideoCallPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export { VideoCallPicker };
|
|
30
|
+
export type { VideoCallPickerProps };
|