@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
Binary file
Binary file
Binary file
@@ -1,11 +0,0 @@
1
- interface IChatHeaderActionsProps {
2
- /** Whether to enable call features */
3
- chatHeaderActions?: Array<'videoCall' | 'audioCall' | 'chatSetting' | 'search'> | undefined;
4
- /** Additional class names */
5
- className?: string | undefined;
6
- /** Additional style */
7
- style?: React.CSSProperties | undefined;
8
- }
9
- declare const ChatHeaderActions: (props: IChatHeaderActionsProps) => import("react/jsx-runtime").JSX.Element;
10
- export { ChatHeaderActions };
11
- export type { IChatHeaderActionsProps };
@@ -1,79 +0,0 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { useMemo as u, useCallback as k } from "react";
3
- import { CallMediaType as m } from "@tencentcloud/call-uikit-react";
4
- import w from "@tencentcloud/chat-uikit-engine";
5
- import E, { TUIConstants as T } from "@tencentcloud/tui-core";
6
- import { useUIKit as U, IconHorizontalMoreTwo as b, IconSearch as D, IconCall1 as x, IconVideoDefault as y } from "@tencentcloud/uikit-base-component-react";
7
- import { i as z, E as N, p as A, m as M } from "../../../ChatSetting-BtQwjHr0.js";
8
- import "@tencentcloud/chat";
9
- import { c as p } from "../../../external_modules/classnames-HRMVOjAa.js";
10
- import '../../../styles/ChatHeaderActions.css';const C = {
11
- "chat-header-actions": "uikit-chat-header-actions",
12
- "icon-button": "uikit-icon-button"
13
- }, L = (I) => {
14
- const {
15
- chatHeaderActions: l = ["videoCall", "audioCall", "search", "chatSetting"],
16
- className: f,
17
- style: d
18
- } = I, { searchConfig: c } = U(), { toggleChatSetting: h, toggleChatSearch: g } = z(), { activeConversation: o } = N(), i = u(() => !!E.getService(T.TUICalling.SERVICE.NAME), []), s = (o == null ? void 0 : o.type) === w.TYPES.CONV_GROUP, a = k((r) => {
19
- var t;
20
- if (i) {
21
- if (!((t = o == null ? void 0 : o.userProfile) != null && t.userID))
22
- throw new Error("User ID is not available in Call.");
23
- A({
24
- callType: o.type,
25
- callMediaType: r,
26
- userIDList: [o.userProfile.userID]
27
- });
28
- }
29
- }, [o, i]), S = u(() => {
30
- const r = {
31
- videoCall: {
32
- icon: /* @__PURE__ */ e(y, { size: "28px" }),
33
- onClick: () => a(m.VIDEO),
34
- show: i && !s
35
- },
36
- audioCall: {
37
- icon: /* @__PURE__ */ e(x, { size: "28px" }),
38
- onClick: () => a(m.AUDIO),
39
- show: i && !s
40
- },
41
- search: {
42
- icon: /* @__PURE__ */ e(D, { size: "28px" }),
43
- onClick: g,
44
- show: !(c != null && c.hideSearch)
45
- },
46
- chatSetting: {
47
- icon: /* @__PURE__ */ e(b, { size: "28px" }),
48
- onClick: h,
49
- show: !0
50
- }
51
- };
52
- return l.filter((t) => {
53
- var n;
54
- return !!((n = r[t]) != null && n.show);
55
- }).map((t) => {
56
- const n = r[t];
57
- return /* @__PURE__ */ e(
58
- "button",
59
- {
60
- className: p(C["icon-button"]),
61
- onClick: n.onClick,
62
- children: n.icon
63
- },
64
- t
65
- );
66
- });
67
- }, [l, i, a, s, h]);
68
- return /* @__PURE__ */ e(
69
- M,
70
- {
71
- className: p(C["chat-header-actions"], f),
72
- style: d,
73
- children: S
74
- }
75
- );
76
- };
77
- export {
78
- L as ChatHeaderActions
79
- };
@@ -1 +0,0 @@
1
- export * from './ChatHeaderActions';
@@ -1,4 +0,0 @@
1
- import { ChatHeaderActions as r } from "./ChatHeaderActions.js";
2
- export {
3
- r as ChatHeaderActions
4
- };
@@ -1,21 +0,0 @@
1
- import { default as React } from 'react';
2
- interface IBaseIconProps {
3
- name: string;
4
- size?: number | undefined;
5
- className?: string | undefined;
6
- style?: React.CSSProperties | undefined;
7
- }
8
- interface IPureIconProps extends IBaseIconProps {
9
- variant?: 'icon' | undefined;
10
- hotSize?: never;
11
- onClick?: never;
12
- }
13
- interface IButtonIconProps extends IBaseIconProps {
14
- variant: 'button';
15
- hotSize: number;
16
- borderRadius?: number | undefined;
17
- onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void | undefined;
18
- }
19
- type IconProps = IPureIconProps | IButtonIconProps;
20
- declare const Icon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<HTMLButtonElement>>;
21
- export default Icon;
@@ -1,47 +0,0 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import d from "react";
3
- import { c as n } from "../../external_modules/classnames-HRMVOjAa.js";
4
- import { B as h } from "../../external_modules/mui-BcA3SBHM.js";
5
- import '../../styles/Icon2.css';const i = {
6
- "icon-font": "uikit-icon-font",
7
- "icon-button": "uikit-icon-button"
8
- }, y = d.forwardRef((e, s) => {
9
- const {
10
- name: c,
11
- size: t = 20,
12
- variant: l = "icon",
13
- hotSize: m = 0,
14
- onClick: f,
15
- className: a,
16
- style: r
17
- } = e;
18
- if (l === "button") {
19
- const { borderRadius: u } = e;
20
- return /* @__PURE__ */ o(
21
- h,
22
- {
23
- ref: s,
24
- className: n(i["icon-button"], a),
25
- style: {
26
- padding: m,
27
- borderRadius: u,
28
- ...r
29
- },
30
- onClick: f,
31
- children: /* @__PURE__ */ o(
32
- "i",
33
- {
34
- className: n(i["icon-font"]),
35
- style: { fontSize: t, width: t, height: t },
36
- dangerouslySetInnerHTML: { __html: c }
37
- }
38
- )
39
- }
40
- );
41
- }
42
- return /* @__PURE__ */ o("i", { ref: s, className: n(i["icon-font"], a), style: { fontSize: t, width: t, height: t, ...r }, dangerouslySetInnerHTML: { __html: c } });
43
- });
44
- y.displayName = "Icon";
45
- export {
46
- y as default
47
- };
@@ -1,2 +0,0 @@
1
- import { default as Icon } from './Icon';
2
- export default Icon;
@@ -1,4 +0,0 @@
1
- import r from "./Icon.js";
2
- export {
3
- r as default
4
- };
File without changes