@tencentcloud/chat-uikit-react 3.0.2 → 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 (115) hide show
  1. package/.eslintrc.cjs +5 -4
  2. package/CHANGELOG.md +9 -0
  3. package/debug/GenerateTestUserSig-es.js +26 -0
  4. package/debug/lib-generate-test-usersig-es.min.js +2 -0
  5. package/dist/components/Chat/Chat.d.ts +1 -1
  6. package/dist/components/Chat/Chat.js +18 -23
  7. package/dist/components/ChatHeader/AudioCallPicker/AudioCallPicker.d.ts +30 -0
  8. package/dist/components/ChatHeader/AudioCallPicker/AudioCallPicker.js +135 -0
  9. package/dist/components/ChatHeader/AudioCallPicker/index.d.ts +1 -0
  10. package/dist/components/ChatHeader/AudioCallPicker/index.js +4 -0
  11. package/dist/components/ChatHeader/ChatHeader.d.ts +6 -0
  12. package/dist/components/ChatHeader/ChatHeader.js +43 -41
  13. package/dist/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.d.ts +14 -9
  14. package/dist/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.js +47 -65
  15. package/dist/components/ChatHeader/VideoCallPicker/VideoCallPicker.d.ts +30 -0
  16. package/dist/components/ChatHeader/VideoCallPicker/VideoCallPicker.js +135 -0
  17. package/dist/components/ChatHeader/VideoCallPicker/index.d.ts +1 -0
  18. package/dist/components/ChatHeader/VideoCallPicker/index.js +4 -0
  19. package/dist/components/ChatHeader/index.d.ts +2 -1
  20. package/dist/components/ChatHeader/index.js +4 -2
  21. package/dist/components/Checkbox/index.js +1 -1
  22. package/dist/components/Modal/Modal.js +1 -1
  23. package/dist/components/Model/index.js +1 -1
  24. package/dist/components/Plugins/index.js +1 -1
  25. package/dist/components/Popup/index.js +1 -1
  26. package/dist/components/PopupNew/Popup.js +1 -1
  27. package/dist/components/Profile/Profile.js +20 -22
  28. package/dist/components/Profile/ProfileDefault.d.ts +3 -2
  29. package/dist/components/Profile/ProfileDefault.js +55 -56
  30. package/dist/components/Profile/hooks/useMyProfile.d.ts +2 -3
  31. package/dist/components/Profile/hooks/useMyProfile.js +1 -1
  32. package/dist/components/Profile/myProfile/MyProfile.d.ts +1 -1
  33. package/dist/components/Profile/myProfile/MyProfile.js +12 -16
  34. package/dist/components/index.js +27 -25
  35. package/dist/context/ChatContext.d.ts +1 -1
  36. package/dist/context/ChatContext.js +11 -16
  37. package/dist/context/ContactContext.d.ts +1 -1
  38. package/dist/external_modules/mui-BhvHeL5-.js +2253 -0
  39. package/dist/hooks/index.d.ts +2 -2
  40. package/dist/hooks/index.js +2 -2
  41. package/dist/{states/ChatHeaderState.d.ts → hooks/useChatHeader.d.ts} +6 -6
  42. package/dist/hooks/useChatHeader.js +41 -0
  43. package/dist/index-UBuvRM8r-DTXQB6zV.js +34000 -0
  44. package/dist/index.d.ts +3 -1
  45. package/dist/index.js +93 -4129
  46. package/dist/server/mainServer.js +2 -2
  47. package/dist/states/UIManagerState.d.ts +5 -5
  48. package/dist/states/UIManagerState.js +2 -2
  49. package/dist/states/index.d.ts +0 -1
  50. package/dist/states/index.js +2 -4
  51. package/dist/styles/AudioCallPicker.css +1 -0
  52. package/dist/styles/ChatHeaderUI.css +1 -1
  53. package/dist/styles/VideoCallPicker.css +1 -0
  54. package/dist/styles/index-UBuvRM8r.css +1 -0
  55. package/dist/styles/index.css +1 -1
  56. package/dist/styles/index2.css +1 -1
  57. package/dist/styles/index3.css +1 -1
  58. package/dist/styles/index4.css +1 -1
  59. package/dist/styles/index5.css +1 -1
  60. package/dist/types/message.d.ts +1 -1
  61. package/dist/types/user.d.ts +4 -4
  62. package/package.json +12 -20
  63. package/src/components/ChatHeader/AudioCallPicker/AudioCallPicker.module.scss +57 -0
  64. package/src/components/ChatHeader/AudioCallPicker/AudioCallPicker.tsx +234 -0
  65. package/src/components/ChatHeader/AudioCallPicker/index.ts +1 -0
  66. package/src/components/ChatHeader/ChatHeader.tsx +15 -3
  67. package/src/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.tsx +33 -40
  68. package/src/components/ChatHeader/VideoCallPicker/VideoCallPicker.module.scss +57 -0
  69. package/src/components/ChatHeader/VideoCallPicker/VideoCallPicker.tsx +233 -0
  70. package/src/components/ChatHeader/VideoCallPicker/index.ts +1 -0
  71. package/src/components/ChatHeader/index.ts +2 -1
  72. package/src/components/Profile/Profile.tsx +7 -6
  73. package/src/components/Profile/ProfileDefault.tsx +8 -8
  74. package/src/components/Profile/hooks/useMyProfile.tsx +2 -3
  75. package/src/components/Profile/myProfile/MyProfile.tsx +1 -1
  76. package/src/context/ChatContext.tsx +1 -1
  77. package/src/context/ContactContext.tsx +1 -1
  78. package/src/hooks/index.ts +2 -2
  79. package/src/{states/ChatHeaderState.ts → hooks/useChatHeader.ts} +19 -22
  80. package/src/index.ts +3 -5
  81. package/src/server/mainServer.ts +2 -2
  82. package/src/states/UIManagerState.ts +9 -9
  83. package/src/states/index.ts +0 -2
  84. package/src/styles/index.scss +0 -1
  85. package/src/types/message.ts +1 -1
  86. package/src/types/user.ts +4 -4
  87. package/vite.config.ts +4 -25
  88. package/dist/ChatSetting-BtQwjHr0.js +0 -28525
  89. package/dist/assets/fonts/iconfont.ttf +0 -0
  90. package/dist/assets/fonts/iconfont.woff +0 -0
  91. package/dist/assets/fonts/iconfont.woff2 +0 -0
  92. package/dist/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.d.ts +0 -11
  93. package/dist/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.js +0 -79
  94. package/dist/components/ChatHeader/ChatHeaderActions/index.d.ts +0 -1
  95. package/dist/components/ChatHeader/ChatHeaderActions/index.js +0 -4
  96. package/dist/components/IconFont/Icon.d.ts +0 -21
  97. package/dist/components/IconFont/Icon.js +0 -47
  98. package/dist/components/IconFont/index.d.ts +0 -2
  99. package/dist/components/IconFont/index.js +0 -4
  100. package/dist/external_modules/lodash-vwDjcXxQ.js +0 -0
  101. package/dist/external_modules/mui-BcA3SBHM.js +0 -2473
  102. package/dist/states/ChatHeaderState.js +0 -48
  103. package/dist/styles/ChatHeaderActions.css +0 -1
  104. package/dist/styles/ChatSetting.css +0 -1
  105. package/dist/styles/Icon2.css +0 -1
  106. package/src/assets/fonts/iconfont.ttf +0 -0
  107. package/src/assets/fonts/iconfont.woff +0 -0
  108. package/src/assets/fonts/iconfont.woff2 +0 -0
  109. package/src/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.module.scss +0 -44
  110. package/src/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.tsx +0 -105
  111. package/src/components/ChatHeader/ChatHeaderActions/index.ts +0 -1
  112. package/src/components/IconFont/Icon.module.scss +0 -42
  113. package/src/components/IconFont/Icon.tsx +0 -68
  114. package/src/components/IconFont/index.ts +0 -3
  115. package/src/styles/fonts/icon-font.scss +0 -18
@@ -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-BtQwjHr0.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,8 +1,7 @@
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';
5
- interface IChatHeaderUIProps {
2
+ import { UserStatus } from '../../../types/user';
3
+ import { ConversationModel } from 'tuikit-atomicx-react';
4
+ interface ChatHeaderUIProps {
6
5
  /** Custom title, if not provided, will use conversation info */
7
6
  title: string;
8
7
  /** Whether it's a group conversation */
@@ -12,17 +11,23 @@ interface IChatHeaderUIProps {
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 */
@@ -30,5 +35,5 @@ interface IChatHeaderUIProps {
30
35
  /** Search click callback */
31
36
  onSearchClick?: (() => void) | undefined;
32
37
  }
33
- declare const ChatHeaderUI: (props: IChatHeaderUIProps) => import("react/jsx-runtime").JSX.Element;
38
+ declare const ChatHeaderUI: (props: ChatHeaderUIProps) => import("react/jsx-runtime").JSX.Element;
34
39
  export default ChatHeaderUI;
@@ -1,87 +1,69 @@
1
- import { jsx as t, jsxs as i } from "react/jsx-runtime";
2
- import { useUIKit as O, IconChevronLeft as U } from "@tencentcloud/uikit-base-component-react";
3
- import { i as g, E as I, m as a, V as T } from "../../../ChatSetting-BtQwjHr0.js";
4
- import "@tencentcloud/chat-uikit-engine";
5
- import "@tencentcloud/tui-core";
6
- import "react";
7
- import "@tencentcloud/chat";
8
- import { c as n } from "../../../external_modules/classnames-HRMVOjAa.js";
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
- }, m = {
21
- Online: "Online",
22
- Offline: "Offline"
23
- }, L = (f) => {
14
+ "chat-header__live": "uikit-chat-header__live"
15
+ }, H = (f) => {
24
16
  const {
25
- title: u,
26
- avatar: h,
17
+ title: h,
18
+ avatar: s,
27
19
  isPeerTyping: p = !1,
28
- system: k = !1,
29
- userStatus: c,
30
- enableUserStatus: C = !0,
31
- chatHeaderActions: N,
32
- Avatar: s,
33
- isGroup: o,
34
- className: l,
35
- style: _
36
- } = f, { t: r } = O(), { setChatSettingOpen: v, setChatSearchOpen: y } = g(), { setActiveConversation: b } = I();
37
- if (k)
38
- return /* @__PURE__ */ t(
39
- a,
40
- {
41
- className: n(e["chat-header"], l),
42
- style: _,
43
- children: "System Notice"
44
- }
45
- );
46
- function d() {
47
- b(""), v(!1), y(!1);
48
- }
49
- return /* @__PURE__ */ t(
20
+ system: u = !1,
21
+ userStatus: i,
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: n(e["chat-header"], l),
53
- style: _,
54
- children: /* @__PURE__ */ i(a, { className: e["chat-header__container"], children: [
55
- /* @__PURE__ */ i(a, { className: e["chat-header__left"], children: [
56
- /* @__PURE__ */ t("button", { className: n(e["icon-button"], e["chat-header__back-icon"]), onClick: d, children: /* @__PURE__ */ t(
57
- U,
58
- {
59
- onClick: d,
60
- size: "28px"
61
- }
62
- ) }),
63
- s ? /* @__PURE__ */ t(s, { src: h || "" }) : /* @__PURE__ */ t(T, { src: h || "" }),
64
- /* @__PURE__ */ i(a, { className: e["chat-header__info"], children: [
65
- /* @__PURE__ */ i(a, { className: e["chat-header__title"], children: [
66
- u,
67
- !o && p && /* @__PURE__ */ i("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
- r("TUIChat.Typing")
52
+ l("TUIChat.Typing")
70
53
  ] })
71
54
  ] }),
72
- !o && C && ((c == null ? void 0 : c.statusType) === 1 ? /* @__PURE__ */ t(a, { className: e["chat-header__live"], children: r(`TUIChat.${m.Online}`) }) : /* @__PURE__ */ t(a, { className: e["chat-header__live"], children: r(`TUIChat.${m.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
- L 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 };
@@ -0,0 +1,135 @@
1
+ import { jsx as s, Fragment as F, jsxs as T } from "react/jsx-runtime";
2
+ import { useState as B, useRef as j, useMemo as n, useCallback as l } from "react";
3
+ import { useUIKit as z, IconVideoFilled as K, Dialog as X } from "@tencentcloud/uikit-base-component-react";
4
+ import { c as Y } from "../../../external_modules/classnames-HRMVOjAa.js";
5
+ import { b as Z, a as $, y as q, C as P, s as S, V as H, O as J } from "../../../index-UBuvRM8r-DTXQB6zV.js";
6
+ import '../../../styles/VideoCallPicker.css';const u = {
7
+ "video-call-picker__button": "uikit-video-call-picker__button",
8
+ "video-call-picker__button--disabled": "uikit-video-call-picker__button--disabled",
9
+ "video-call-picker__icon": "uikit-video-call-picker__icon",
10
+ "group-call-dialog": "uikit-group-call-dialog"
11
+ }, E = 2, Q = 80, W = 8, ee = 1, ae = (L) => {
12
+ const {
13
+ label: R = "",
14
+ iconSize: V = 20,
15
+ disabled: a = !1,
16
+ className: U,
17
+ style: v,
18
+ children: x
19
+ } = L, { t: d } = z(), { loginUserInfo: i } = Z(), { activeConversation: e } = $(), { allMembers: t, getGroupMemberList: _, memberCount: g } = q(), [A, b] = B(!1), p = j(null), k = n(() => i == null ? void 0 : i.userId, [i]), I = n(() => (e == null ? void 0 : e.type) === P.C2C, [e]), N = n(() => (t == null ? void 0 : t.map((o) => ({
20
+ key: o.userID,
21
+ label: o.nick || o.userID,
22
+ avatarUrl: o.avatar
23
+ }))) ?? [], [t]), M = n(() => !(!e || a), [e, a]), y = l(() => {
24
+ var r;
25
+ const o = (r = e == null ? void 0 : e.userProfile) == null ? void 0 : r.userID;
26
+ if (!o) {
27
+ console.warn("No peer user ID found for C2C call");
28
+ return;
29
+ }
30
+ try {
31
+ S({
32
+ userIDList: [o],
33
+ type: E
34
+ });
35
+ } catch (m) {
36
+ console.error("Failed to start private video call:", m);
37
+ }
38
+ }, [e]), f = l(() => {
39
+ if ((e == null ? void 0 : e.type) !== P.GROUP)
40
+ return;
41
+ const o = (t == null ? void 0 : t.length) || 0;
42
+ o < (g || 0) && _({
43
+ count: Q,
44
+ offset: o
45
+ });
46
+ }, [e, t, g, _]), h = l(() => {
47
+ f(), b(!0);
48
+ }, [f]), c = l(() => {
49
+ b(!1);
50
+ }, []), G = l(() => {
51
+ var D;
52
+ const o = (D = e == null ? void 0 : e.groupProfile) == null ? void 0 : D.groupID;
53
+ if (!p.current || !o) {
54
+ console.warn("Missing group information for group call");
55
+ return;
56
+ }
57
+ const r = p.current.getSelectedItems();
58
+ if (!Array.isArray(r) || r.length === 0) {
59
+ console.warn("No members selected for group call");
60
+ return;
61
+ }
62
+ const m = r.map((C) => C.key);
63
+ try {
64
+ S({
65
+ userIDList: m,
66
+ chatGroupID: o,
67
+ type: E
68
+ }), c();
69
+ } catch (C) {
70
+ console.error("Failed to start group video call:", C);
71
+ }
72
+ }, [e, c]), w = l(() => {
73
+ if (!M) {
74
+ console.warn("Cannot start video call");
75
+ return;
76
+ }
77
+ I ? y() : h();
78
+ }, [M, I, y, h]), O = l(() => {
79
+ G();
80
+ }, [G]);
81
+ return /* @__PURE__ */ s(F, { children: /* @__PURE__ */ T(H, { children: [
82
+ /* @__PURE__ */ s(
83
+ "button",
84
+ {
85
+ type: "button",
86
+ className: Y(
87
+ u["video-call-picker__button"],
88
+ {
89
+ [u["video-call-picker__button--disabled"]]: a
90
+ },
91
+ U
92
+ ),
93
+ style: v,
94
+ onClick: w,
95
+ disabled: a,
96
+ "aria-label": R || "Video Call",
97
+ children: x || /* @__PURE__ */ s(
98
+ K,
99
+ {
100
+ className: u["video-call-picker__icon"],
101
+ size: `${V}px`
102
+ }
103
+ )
104
+ }
105
+ ),
106
+ /* @__PURE__ */ s(
107
+ X,
108
+ {
109
+ visible: A,
110
+ title: d("MessageInput.select_call_members"),
111
+ cancelText: d("MessageInput.cancel"),
112
+ onCancel: c,
113
+ onClose: c,
114
+ confirmText: d("MessageInput.initiate_call"),
115
+ onConfirm: O,
116
+ className: u["group-call-dialog"],
117
+ children: /* @__PURE__ */ s(
118
+ J,
119
+ {
120
+ ref: p,
121
+ displayMode: "list",
122
+ dataSource: N,
123
+ lockedItems: k ? [{ key: k }] : [],
124
+ maxCount: W,
125
+ minCount: ee,
126
+ onReachEnd: f
127
+ }
128
+ )
129
+ }
130
+ )
131
+ ] }) });
132
+ };
133
+ export {
134
+ ae as VideoCallPicker
135
+ };
@@ -0,0 +1 @@
1
+ export { VideoCallPicker } from './VideoCallPicker';
@@ -0,0 +1,4 @@
1
+ import { VideoCallPicker as r } from "./VideoCallPicker.js";
2
+ export {
3
+ r as VideoCallPicker
4
+ };
@@ -1,2 +1,3 @@
1
1
  export * from './ChatHeader';
2
- export * from './ChatHeaderActions';
2
+ export * from './AudioCallPicker';
3
+ export * from './VideoCallPicker';
@@ -1,6 +1,8 @@
1
1
  import { ChatHeader as o } from "./ChatHeader.js";
2
- import { ChatHeaderActions as a } from "./ChatHeaderActions/ChatHeaderActions.js";
2
+ import { AudioCallPicker as i } from "./AudioCallPicker/AudioCallPicker.js";
3
+ import { VideoCallPicker as t } from "./VideoCallPicker/VideoCallPicker.js";
3
4
  export {
5
+ i as AudioCallPicker,
4
6
  o as ChatHeader,
5
- a as ChatHeaderActions
7
+ t as VideoCallPicker
6
8
  };
@@ -2,7 +2,7 @@ import { jsxs as m, jsx as c } from "react/jsx-runtime";
2
2
  import { useState as k } from "react";
3
3
  import { Icon as p } from "../Icon/Icon.js";
4
4
  import { IconTypes as l } from "../Icon/type.js";
5
- import '../../styles/index.css';function g(a) {
5
+ import '../../styles/index2.css';function g(a) {
6
6
  const {
7
7
  checked: n = !1,
8
8
  className: s,
@@ -1,7 +1,7 @@
1
1
  import { jsx as a, Fragment as k } from "react/jsx-runtime";
2
2
  import { forwardRef as v, useState as m, useRef as p, useEffect as b } from "react";
3
3
  import { c as u } from "../../external_modules/classnames-HRMVOjAa.js";
4
- import { M as x } from "../../external_modules/mui-BcA3SBHM.js";
4
+ import { M as x } from "../../external_modules/mui-BhvHeL5-.js";
5
5
  import { C as A } from "../../external_modules/react-vendors-3raCpd-g.js";
6
6
  import '../../styles/Modal.css';const E = "uikit-root", N = "uikit-backdrop", R = "uikit-backdropEnterActive", t = {
7
7
  root: E,
@@ -1,5 +1,5 @@
1
1
  import { jsx as c } from "react/jsx-runtime";
2
- import '../../styles/index2.css';function i(e) {
2
+ import '../../styles/index3.css';function i(e) {
3
3
  const {
4
4
  className: n,
5
5
  onClick: o,