@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.
Files changed (113) hide show
  1. package/.eslintrc.cjs +5 -4
  2. package/CHANGELOG.md +9 -0
  3. package/dist/components/Chat/Chat.d.ts +1 -1
  4. package/dist/components/Chat/Chat.js +18 -23
  5. package/dist/components/ChatHeader/AudioCallPicker/AudioCallPicker.d.ts +30 -0
  6. package/dist/components/ChatHeader/AudioCallPicker/AudioCallPicker.js +135 -0
  7. package/dist/components/ChatHeader/AudioCallPicker/index.d.ts +1 -0
  8. package/dist/components/ChatHeader/AudioCallPicker/index.js +4 -0
  9. package/dist/components/ChatHeader/ChatHeader.d.ts +6 -0
  10. package/dist/components/ChatHeader/ChatHeader.js +43 -41
  11. package/dist/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.d.ts +12 -7
  12. package/dist/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.js +47 -65
  13. package/dist/components/ChatHeader/VideoCallPicker/VideoCallPicker.d.ts +30 -0
  14. package/dist/components/ChatHeader/VideoCallPicker/VideoCallPicker.js +135 -0
  15. package/dist/components/ChatHeader/VideoCallPicker/index.d.ts +1 -0
  16. package/dist/components/ChatHeader/VideoCallPicker/index.js +4 -0
  17. package/dist/components/ChatHeader/index.d.ts +2 -1
  18. package/dist/components/ChatHeader/index.js +4 -2
  19. package/dist/components/Checkbox/index.js +1 -1
  20. package/dist/components/Modal/Modal.js +1 -1
  21. package/dist/components/Model/index.js +1 -1
  22. package/dist/components/Plugins/index.js +1 -1
  23. package/dist/components/Popup/index.js +1 -1
  24. package/dist/components/PopupNew/Popup.js +1 -1
  25. package/dist/components/Profile/Profile.js +20 -22
  26. package/dist/components/Profile/ProfileDefault.d.ts +3 -2
  27. package/dist/components/Profile/ProfileDefault.js +55 -56
  28. package/dist/components/Profile/hooks/useMyProfile.d.ts +2 -3
  29. package/dist/components/Profile/hooks/useMyProfile.js +1 -1
  30. package/dist/components/Profile/myProfile/MyProfile.d.ts +1 -1
  31. package/dist/components/Profile/myProfile/MyProfile.js +12 -16
  32. package/dist/components/index.js +27 -25
  33. package/dist/context/ChatContext.d.ts +1 -1
  34. package/dist/context/ChatContext.js +11 -16
  35. package/dist/context/ContactContext.d.ts +1 -1
  36. package/dist/external_modules/mui-BhvHeL5-.js +2253 -0
  37. package/dist/hooks/index.d.ts +2 -2
  38. package/dist/hooks/index.js +2 -2
  39. package/dist/{states/ChatHeaderState.d.ts → hooks/useChatHeader.d.ts} +6 -6
  40. package/dist/hooks/useChatHeader.js +41 -0
  41. package/dist/index-UBuvRM8r-DTXQB6zV.js +34000 -0
  42. package/dist/index.d.ts +3 -1
  43. package/dist/index.js +93 -4133
  44. package/dist/server/mainServer.js +2 -2
  45. package/dist/states/UIManagerState.d.ts +5 -5
  46. package/dist/states/UIManagerState.js +2 -2
  47. package/dist/states/index.d.ts +0 -1
  48. package/dist/states/index.js +2 -4
  49. package/dist/styles/AudioCallPicker.css +1 -0
  50. package/dist/styles/ChatHeaderUI.css +1 -1
  51. package/dist/styles/VideoCallPicker.css +1 -0
  52. package/dist/styles/index-UBuvRM8r.css +1 -0
  53. package/dist/styles/index.css +1 -1
  54. package/dist/styles/index2.css +1 -1
  55. package/dist/styles/index3.css +1 -1
  56. package/dist/styles/index4.css +1 -1
  57. package/dist/styles/index5.css +1 -1
  58. package/dist/types/message.d.ts +1 -1
  59. package/dist/types/user.d.ts +4 -4
  60. package/package.json +12 -20
  61. package/src/components/ChatHeader/AudioCallPicker/AudioCallPicker.module.scss +57 -0
  62. package/src/components/ChatHeader/AudioCallPicker/AudioCallPicker.tsx +234 -0
  63. package/src/components/ChatHeader/AudioCallPicker/index.ts +1 -0
  64. package/src/components/ChatHeader/ChatHeader.tsx +15 -3
  65. package/src/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.tsx +29 -36
  66. package/src/components/ChatHeader/VideoCallPicker/VideoCallPicker.module.scss +57 -0
  67. package/src/components/ChatHeader/VideoCallPicker/VideoCallPicker.tsx +233 -0
  68. package/src/components/ChatHeader/VideoCallPicker/index.ts +1 -0
  69. package/src/components/ChatHeader/index.ts +2 -1
  70. package/src/components/Profile/Profile.tsx +7 -6
  71. package/src/components/Profile/ProfileDefault.tsx +8 -8
  72. package/src/components/Profile/hooks/useMyProfile.tsx +2 -3
  73. package/src/components/Profile/myProfile/MyProfile.tsx +1 -1
  74. package/src/context/ChatContext.tsx +1 -1
  75. package/src/context/ContactContext.tsx +1 -1
  76. package/src/hooks/index.ts +2 -2
  77. package/src/{states/ChatHeaderState.ts → hooks/useChatHeader.ts} +15 -17
  78. package/src/index.ts +3 -5
  79. package/src/server/mainServer.ts +2 -2
  80. package/src/states/UIManagerState.ts +9 -9
  81. package/src/states/index.ts +0 -2
  82. package/src/styles/index.scss +0 -1
  83. package/src/types/message.ts +1 -1
  84. package/src/types/user.ts +4 -4
  85. package/vite.config.ts +4 -25
  86. package/dist/ChatSetting-LYkP2NWu.js +0 -29890
  87. package/dist/assets/fonts/iconfont.ttf +0 -0
  88. package/dist/assets/fonts/iconfont.woff +0 -0
  89. package/dist/assets/fonts/iconfont.woff2 +0 -0
  90. package/dist/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.d.ts +0 -11
  91. package/dist/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.js +0 -79
  92. package/dist/components/ChatHeader/ChatHeaderActions/index.d.ts +0 -1
  93. package/dist/components/ChatHeader/ChatHeaderActions/index.js +0 -4
  94. package/dist/components/IconFont/Icon.d.ts +0 -21
  95. package/dist/components/IconFont/Icon.js +0 -47
  96. package/dist/components/IconFont/index.d.ts +0 -2
  97. package/dist/components/IconFont/index.js +0 -4
  98. package/dist/external_modules/lodash-vwDjcXxQ.js +0 -0
  99. package/dist/external_modules/mui-BcA3SBHM.js +0 -2473
  100. package/dist/states/ChatHeaderState.js +0 -46
  101. package/dist/styles/ChatHeaderActions.css +0 -1
  102. package/dist/styles/ChatSetting.css +0 -1
  103. package/dist/styles/Icon2.css +0 -1
  104. package/src/assets/fonts/iconfont.ttf +0 -0
  105. package/src/assets/fonts/iconfont.woff +0 -0
  106. package/src/assets/fonts/iconfont.woff2 +0 -0
  107. package/src/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.module.scss +0 -44
  108. package/src/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.tsx +0 -105
  109. package/src/components/ChatHeader/ChatHeaderActions/index.ts +0 -1
  110. package/src/components/IconFont/Icon.module.scss +0 -42
  111. package/src/components/IconFont/Icon.tsx +0 -68
  112. package/src/components/IconFont/index.ts +0 -3
  113. 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
- `${__dirname}/tsconfig.json`,
10
- `${__dirname}/tsconfig.app.json`,
11
- `${__dirname}/tsconfig.node.json`,
12
- `${__dirname}/.storybook/tsconfig.eslint.json`,
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 | Iterable<React.ReactNode> | null;
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 r } from "react/jsx-runtime";
2
- import { E as a, m as e } from "../../ChatSetting-LYkP2NWu.js";
3
- import "@tencentcloud/uikit-base-component-react";
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 n = "uikit-chat", h = {
11
- chat: n
12
- }, k = (o) => {
5
+ import '../../styles/Chat.css';const h = "uikit-chat", p = {
6
+ chat: h
7
+ }, y = (r) => {
13
8
  const {
14
- PlaceholderEmpty: c = null,
15
- className: m,
16
- style: s,
17
- children: i
18
- } = o, { activeConversation: t } = a();
19
- return t != null && t.conversationID ? /* @__PURE__ */ r(l, { children: /* @__PURE__ */ r(
20
- e,
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(h.chat, m),
23
- style: s,
24
- children: i
17
+ className: m(p.chat, a),
18
+ style: c,
19
+ children: e
25
20
  }
26
- ) }) : c;
21
+ ) }) : o;
27
22
  };
28
23
  export {
29
- k as Chat
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';
@@ -0,0 +1,4 @@
1
+ import { AudioCallPicker as e } from "./AudioCallPicker.js";
2
+ export {
3
+ e as AudioCallPicker
4
+ };
@@ -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 d } from "react/jsx-runtime";
2
- import { useEffect as h } from "react";
3
- import { TUIUserService as v } from "@tencentcloud/chat-uikit-engine";
4
- import { j as C } from "../../ChatSetting-LYkP2NWu.js";
5
- import "@tencentcloud/uikit-base-component-react";
6
- import "@tencentcloud/tui-core";
7
- import "@tencentcloud/chat";
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: r,
14
- avatar: a,
15
- enableUserStatus: t = !1,
16
- chatHeaderActions: o,
17
- Avatar: s,
18
- className: i,
19
- style: m
20
- } = e, {
21
- system: c,
22
- conversation: n,
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: l,
25
- avatar: f,
26
- userStatus: u
27
- } = U(), { isPeerTyping: S } = C();
28
- return h(() => {
29
- v.switchUserStatus({ displayOnlineStatus: t });
30
- }, [t]), /* @__PURE__ */ d(
31
- x,
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: r || l || "",
35
- avatar: a || f,
36
- userStatus: u,
37
- conversation: n,
33
+ title: a || h || "",
34
+ avatar: r || d,
35
+ userStatus: C,
36
+ conversation: f,
38
37
  isPeerTyping: S,
39
- system: c,
40
- enableUserStatus: t,
41
- chatHeaderActions: o,
42
- Avatar: s,
43
- style: m,
44
- className: i,
45
- onSearchClick: e.onSearchClick
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
- E as ChatHeader
52
+ w as ChatHeader
51
53
  };
@@ -1,7 +1,6 @@
1
1
  import { default as React } from 'react';
2
- import { IUserStatus } from '../../../types/user';
3
- import { IConversationModel } from '@tencentcloud/chat-uikit-engine';
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?: IUserStatus | undefined;
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?: IConversationModel | undefined;
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<AvatarProps> | undefined;
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 c } from "react/jsx-runtime";
2
- import { useUIKit as b, IconChevronLeft as T } from "@tencentcloud/uikit-base-component-react";
3
- import { c as s } from "../../../external_modules/classnames-HRMVOjAa.js";
4
- import { i as U, E as g, m as a, V as I } from "../../../ChatSetting-LYkP2NWu.js";
5
- import "@tencentcloud/chat-uikit-engine";
6
- import "@tencentcloud/tui-core";
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
- "icon-button": "uikit-icon-button"
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: n,
26
- avatar: o,
27
- isPeerTyping: k = !1,
28
- system: C = !1,
17
+ title: h,
18
+ avatar: s,
19
+ isPeerTyping: p = !1,
20
+ system: u = !1,
29
21
  userStatus: i,
30
- enableUserStatus: l = !0,
31
- chatHeaderActions: N,
32
- Avatar: _,
33
- isGroup: r,
34
- className: d,
35
- style: m
36
- } = u, { t: h } = b(), { setChatSettingOpen: v, setChatSearchOpen: y } = U(), { setActiveConversation: O } = g();
37
- if (C)
38
- return /* @__PURE__ */ t(
39
- a,
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: s(e["chat-header"], d),
53
- style: m,
54
- children: /* @__PURE__ */ c(a, { className: e["chat-header__container"], children: [
55
- /* @__PURE__ */ c(a, { className: e["chat-header__left"], children: [
56
- /* @__PURE__ */ t("button", { className: s(e["icon-button"], e["chat-header__back-icon"]), onClick: f, children: /* @__PURE__ */ t(
57
- T,
58
- {
59
- onClick: f,
60
- size: "28px"
61
- }
62
- ) }),
63
- _ ? /* @__PURE__ */ t(_, { src: o || "", alt: n }) : /* @__PURE__ */ t(I, { src: o || "", alt: n, isShowOnlineStatus: !r && l, isOnline: (i == null ? void 0 : i.statusType) === 1 }),
64
- /* @__PURE__ */ c(a, { className: e["chat-header__info"], children: [
65
- /* @__PURE__ */ c(a, { className: e["chat-header__title"], children: [
66
- n,
67
- !r && k && /* @__PURE__ */ c("span", { className: e["chat-header__typing-indicator"], children: [
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
- h("TUIChat.Typing")
52
+ l("TUIChat.Typing")
70
53
  ] })
71
54
  ] }),
72
- !r && l && ((i == null ? void 0 : i.statusType) === 1 ? /* @__PURE__ */ t(a, { className: e["chat-header__live"], children: h(`TUIChat.${p.Online}`) }) : /* @__PURE__ */ t(a, { className: e["chat-header__live"], children: h(`TUIChat.${p.Offline}`) }))
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__ */ t(
76
- x,
77
- {
78
- chatHeaderActions: N
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
- K as default
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 };