@tencentcloud/chat-uikit-react 3.0.1 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/debug/GenerateTestUserSig-es.js +26 -0
  3. package/debug/lib-generate-test-usersig-es.min.js +2 -0
  4. package/dist/{ChatSetting-79tDbXT3.js → ChatSetting-LYkP2NWu.js} +9516 -8138
  5. package/dist/components/Chat/Chat.js +1 -1
  6. package/dist/components/ChatHeader/ChatHeader.js +1 -1
  7. package/dist/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.d.ts +3 -3
  8. package/dist/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.js +2 -2
  9. package/dist/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.d.ts +2 -2
  10. package/dist/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.js +37 -37
  11. package/dist/components/IconFont/Icon.js +1 -1
  12. package/dist/components/Modal/Modal.js +1 -1
  13. package/dist/components/PopupNew/Popup.js +1 -1
  14. package/dist/components/Profile/Profile.js +1 -1
  15. package/dist/components/Profile/ProfileDefault.js +1 -1
  16. package/dist/components/Profile/myProfile/MyProfile.js +1 -1
  17. package/dist/constant/avatar.d.ts +2 -1
  18. package/dist/constant/avatar.js +2 -1
  19. package/dist/context/ChatContext.js +1 -1
  20. package/dist/external_modules/{mui-CbGEJVT2.js → mui-BcA3SBHM.js} +1 -1
  21. package/dist/external_modules/{zustand-Dvydplxp.js → zustand-CDmQR4co.js} +7 -7
  22. package/dist/index.js +1510 -1494
  23. package/dist/states/ChatHeaderState.js +20 -22
  24. package/dist/states/UIManagerState.js +1 -1
  25. package/dist/styles/ChatSetting.css +1 -1
  26. package/package.json +3 -3
  27. package/src/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.tsx +4 -4
  28. package/src/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.tsx +5 -5
  29. package/src/constant/avatar.ts +2 -1
  30. package/src/states/ChatHeaderState.ts +5 -6
@@ -1,5 +1,5 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { E as a, m as e } from "../../ChatSetting-79tDbXT3.js";
2
+ import { E as a, m as e } from "../../ChatSetting-LYkP2NWu.js";
3
3
  import "@tencentcloud/uikit-base-component-react";
4
4
  import "@tencentcloud/chat-uikit-engine";
5
5
  import "@tencentcloud/tui-core";
@@ -1,7 +1,7 @@
1
1
  import { jsx as d } from "react/jsx-runtime";
2
2
  import { useEffect as h } from "react";
3
3
  import { TUIUserService as v } from "@tencentcloud/chat-uikit-engine";
4
- import { j as C } from "../../ChatSetting-79tDbXT3.js";
4
+ import { j as C } from "../../ChatSetting-LYkP2NWu.js";
5
5
  import "@tencentcloud/uikit-base-component-react";
6
6
  import "@tencentcloud/tui-core";
7
7
  import "@tencentcloud/chat";
@@ -1,4 +1,4 @@
1
- interface IChatHeaderActionsProps {
1
+ interface ChatHeaderActionsProps {
2
2
  /** Whether to enable call features */
3
3
  chatHeaderActions?: Array<'videoCall' | 'audioCall' | 'chatSetting' | 'search'> | undefined;
4
4
  /** Additional class names */
@@ -6,6 +6,6 @@ interface IChatHeaderActionsProps {
6
6
  /** Additional style */
7
7
  style?: React.CSSProperties | undefined;
8
8
  }
9
- declare const ChatHeaderActions: (props: IChatHeaderActionsProps) => import("react/jsx-runtime").JSX.Element;
9
+ declare const ChatHeaderActions: (props: ChatHeaderActionsProps) => import("react/jsx-runtime").JSX.Element;
10
10
  export { ChatHeaderActions };
11
- export type { IChatHeaderActionsProps };
11
+ export type { ChatHeaderActionsProps };
@@ -4,9 +4,9 @@ import { CallMediaType as m } from "@tencentcloud/call-uikit-react";
4
4
  import w from "@tencentcloud/chat-uikit-engine";
5
5
  import E, { TUIConstants as T } from "@tencentcloud/tui-core";
6
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-79tDbXT3.js";
8
- import "@tencentcloud/chat";
9
7
  import { c as p } from "../../../external_modules/classnames-HRMVOjAa.js";
8
+ import { i as z, E as N, p as A, m as M } from "../../../ChatSetting-LYkP2NWu.js";
9
+ import "@tencentcloud/chat";
10
10
  import '../../../styles/ChatHeaderActions.css';const C = {
11
11
  "chat-header-actions": "uikit-chat-header-actions",
12
12
  "icon-button": "uikit-icon-button"
@@ -2,7 +2,7 @@ import { default as React } from 'react';
2
2
  import { IUserStatus } from '../../../types/user';
3
3
  import { IConversationModel } from '@tencentcloud/chat-uikit-engine';
4
4
  import { AvatarProps } from 'tuikit-atomicx-react';
5
- interface IChatHeaderUIProps {
5
+ interface ChatHeaderUIProps {
6
6
  /** Custom title, if not provided, will use conversation info */
7
7
  title: string;
8
8
  /** Whether it's a group conversation */
@@ -30,5 +30,5 @@ interface IChatHeaderUIProps {
30
30
  /** Search click callback */
31
31
  onSearchClick?: (() => void) | undefined;
32
32
  }
33
- declare const ChatHeaderUI: (props: IChatHeaderUIProps) => import("react/jsx-runtime").JSX.Element;
33
+ declare const ChatHeaderUI: (props: ChatHeaderUIProps) => import("react/jsx-runtime").JSX.Element;
34
34
  export default ChatHeaderUI;
@@ -1,11 +1,11 @@
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-79tDbXT3.js";
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";
4
5
  import "@tencentcloud/chat-uikit-engine";
5
6
  import "@tencentcloud/tui-core";
6
7
  import "react";
7
8
  import "@tencentcloud/chat";
8
- import { c as n } from "../../../external_modules/classnames-HRMVOjAa.js";
9
9
  import { ChatHeaderActions as x } from "../ChatHeaderActions/ChatHeaderActions.js";
10
10
  import '../../../styles/ChatHeaderUI.css';const e = {
11
11
  "chat-header": "uikit-chat-header",
@@ -17,59 +17,59 @@ import '../../../styles/ChatHeaderUI.css';const e = {
17
17
  "chat-header__typing-indicator": "uikit-chat-header__typing-indicator",
18
18
  "chat-header__live": "uikit-chat-header__live",
19
19
  "icon-button": "uikit-icon-button"
20
- }, m = {
20
+ }, p = {
21
21
  Online: "Online",
22
22
  Offline: "Offline"
23
- }, L = (f) => {
23
+ }, K = (u) => {
24
24
  const {
25
- title: u,
26
- avatar: h,
27
- isPeerTyping: p = !1,
28
- system: k = !1,
29
- userStatus: c,
30
- enableUserStatus: C = !0,
25
+ title: n,
26
+ avatar: o,
27
+ isPeerTyping: k = !1,
28
+ system: C = !1,
29
+ userStatus: i,
30
+ enableUserStatus: l = !0,
31
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)
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
38
  return /* @__PURE__ */ t(
39
39
  a,
40
40
  {
41
- className: n(e["chat-header"], l),
42
- style: _,
41
+ className: s(e["chat-header"], d),
42
+ style: m,
43
43
  children: "System Notice"
44
44
  }
45
45
  );
46
- function d() {
47
- b(""), v(!1), y(!1);
46
+ function f() {
47
+ O(""), v(!1), y(!1);
48
48
  }
49
49
  return /* @__PURE__ */ t(
50
50
  a,
51
51
  {
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,
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
58
  {
59
- onClick: d,
59
+ onClick: f,
60
60
  size: "28px"
61
61
  }
62
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: [
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: [
68
68
  " ",
69
- r("TUIChat.Typing")
69
+ h("TUIChat.Typing")
70
70
  ] })
71
71
  ] }),
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}`) }))
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}`) }))
73
73
  ] })
74
74
  ] }),
75
75
  /* @__PURE__ */ t(
@@ -83,5 +83,5 @@ import '../../../styles/ChatHeaderUI.css';const e = {
83
83
  );
84
84
  };
85
85
  export {
86
- L as default
86
+ K as default
87
87
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import d from "react";
3
3
  import { c as n } from "../../external_modules/classnames-HRMVOjAa.js";
4
- import { B as h } from "../../external_modules/mui-CbGEJVT2.js";
4
+ import { B as h } from "../../external_modules/mui-BcA3SBHM.js";
5
5
  import '../../styles/Icon2.css';const i = {
6
6
  "icon-font": "uikit-icon-font",
7
7
  "icon-button": "uikit-icon-button"
@@ -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-CbGEJVT2.js";
4
+ import { M as x } from "../../external_modules/mui-BcA3SBHM.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 f } from "react/jsx-runtime";
2
- import { P as u } from "../../external_modules/mui-CbGEJVT2.js";
2
+ import { P as u } from "../../external_modules/mui-BcA3SBHM.js";
3
3
  function m(t) {
4
4
  const {
5
5
  anchor: o,
@@ -3,7 +3,7 @@ import p from "react";
3
3
  import { MyProfile as P } from "./myProfile/MyProfile.js";
4
4
  import { useMyProfile as s } from "./hooks/useMyProfile.js";
5
5
  import { TUIProfileDefault as a } from "./ProfileDefault.js";
6
- import { i as c } from "../../ChatSetting-79tDbXT3.js";
6
+ import { i as c } from "../../ChatSetting-LYkP2NWu.js";
7
7
  import "@tencentcloud/uikit-base-component-react";
8
8
  import "@tencentcloud/chat-uikit-engine";
9
9
  import "@tencentcloud/tui-core";
@@ -2,7 +2,7 @@ import { jsx as i, jsxs as s } from "react/jsx-runtime";
2
2
  import W, { useState as x } from "react";
3
3
  import a from "@tencentcloud/chat-uikit-engine";
4
4
  import { useUIKit as R, IconChevronLeft as F } from "@tencentcloud/uikit-base-component-react";
5
- import { i as G, V as B } from "../../ChatSetting-79tDbXT3.js";
5
+ import { i as G, V as B } from "../../ChatSetting-LYkP2NWu.js";
6
6
  import "@tencentcloud/tui-core";
7
7
  import "@tencentcloud/chat";
8
8
  import { DivWithEdit as L } from "../DivWithEdit/DivWithEdit.js";
@@ -1,6 +1,6 @@
1
1
  import { jsxs as e, jsx as o } from "react/jsx-runtime";
2
2
  import { defaultUserAvatar as s } from "../../../constant/avatar.js";
3
- import { V as t } from "../../../ChatSetting-79tDbXT3.js";
3
+ import { V as t } from "../../../ChatSetting-LYkP2NWu.js";
4
4
  import { IconHorizontalMoreTwo as c } from "@tencentcloud/uikit-base-component-react";
5
5
  import "@tencentcloud/chat-uikit-engine";
6
6
  import "@tencentcloud/tui-core";
@@ -2,4 +2,5 @@ export declare const defaultGroupAvatarWork = "https://web.sdk.qcloud.com/im/dem
2
2
  export declare const defaultGroupAvatarPublic = "https://web.sdk.qcloud.com/im/demo/TUIkit/react-static/images/group_avatar_public.png";
3
3
  export declare const defaultGroupAvatarMeeting = "https://web.sdk.qcloud.com/im/demo/TUIkit/react-static/images/group_avatar_meeting.png";
4
4
  export declare const defaultGroupAvatarAVChatRoom = "https://web.sdk.qcloud.com/im/demo/TUIkit/react-static/images/group_avatar_AVChatRoom.png";
5
- export declare const defaultUserAvatar = "https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png";
5
+ export declare const defaultUserAvatar = "https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_16.png";
6
+ export declare const DEFAULT_GROUP_COMMON_AVATAR = "https://web.sdk.qcloud.com/im/demo/TUIkit/web/img/constomer.png";
@@ -1,5 +1,6 @@
1
- const t = "https://web.sdk.qcloud.com/im/demo/TUIkit/react-static/images/group_avatar_work.png", a = "https://web.sdk.qcloud.com/im/demo/TUIkit/react-static/images/group_avatar_public.png", o = "https://web.sdk.qcloud.com/im/demo/TUIkit/react-static/images/group_avatar_meeting.png", e = "https://web.sdk.qcloud.com/im/demo/TUIkit/react-static/images/group_avatar_AVChatRoom.png", s = "https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png";
1
+ const t = "https://web.sdk.qcloud.com/im/demo/TUIkit/react-static/images/group_avatar_work.png", a = "https://web.sdk.qcloud.com/im/demo/TUIkit/react-static/images/group_avatar_public.png", o = "https://web.sdk.qcloud.com/im/demo/TUIkit/react-static/images/group_avatar_meeting.png", e = "https://web.sdk.qcloud.com/im/demo/TUIkit/react-static/images/group_avatar_AVChatRoom.png", s = "https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_16.png", c = "https://web.sdk.qcloud.com/im/demo/TUIkit/web/img/constomer.png";
2
2
  export {
3
+ c as DEFAULT_GROUP_COMMON_AVATAR,
3
4
  e as defaultGroupAvatarAVChatRoom,
4
5
  o as defaultGroupAvatarMeeting,
5
6
  a as defaultGroupAvatarPublic,
@@ -2,7 +2,7 @@ import { jsx as n } from "react/jsx-runtime";
2
2
  import { createContext as i, useMemo as s, useContext as u } from "react";
3
3
  import { useUIManagerState as a } from "../states/UIManagerState.js";
4
4
  import "@tencentcloud/chat-uikit-engine";
5
- import "../ChatSetting-79tDbXT3.js";
5
+ import "../ChatSetting-LYkP2NWu.js";
6
6
  import "@tencentcloud/uikit-base-component-react";
7
7
  import "@tencentcloud/tui-core";
8
8
  import "@tencentcloud/chat";
@@ -303,7 +303,7 @@ const qt = function(e) {
303
303
  const F = (((y = s.flip) == null ? void 0 : y.index) || 0) + 1, B = S[F];
304
304
  if (B && (!(d === "alignment" ? R !== z(B) : !1) || // We leave the current main axis only if every placement on that axis
305
305
  // overflows the main axis.
306
- L.every((O) => O.overflows[0] > 0 && z(O.placement) === R)))
306
+ L.every((O) => z(O.placement) === R ? O.overflows[0] > 0 : !0)))
307
307
  return {
308
308
  data: {
309
309
  index: F,
@@ -1,22 +1,22 @@
1
- import u from "react";
1
+ import o from "react";
2
2
  const f = (e) => {
3
3
  let t;
4
- const n = /* @__PURE__ */ new Set(), o = (s, r) => {
4
+ const n = /* @__PURE__ */ new Set(), a = (s, r) => {
5
5
  const c = typeof s == "function" ? s(t) : s;
6
6
  if (!Object.is(c, t)) {
7
7
  const l = t;
8
8
  t = r ?? (typeof c != "object" || c === null) ? c : Object.assign({}, t, c), n.forEach((b) => b(t, l));
9
9
  }
10
- }, a = () => t, i = { setState: o, getState: a, getInitialState: () => S, subscribe: (s) => (n.add(s), () => n.delete(s)) }, S = t = e(o, a, i);
10
+ }, u = () => t, i = { setState: a, getState: u, getInitialState: () => S, subscribe: (s) => (n.add(s), () => n.delete(s)) }, S = t = e(a, u, i);
11
11
  return i;
12
12
  }, j = (e) => f, g = (e) => e;
13
13
  function m(e, t = g) {
14
- const n = u.useSyncExternalStore(
14
+ const n = o.useSyncExternalStore(
15
15
  e.subscribe,
16
- () => t(e.getState()),
17
- () => t(e.getInitialState())
16
+ o.useCallback(() => t(e.getState()), [e, t]),
17
+ o.useCallback(() => t(e.getInitialState()), [e, t])
18
18
  );
19
- return u.useDebugValue(n), n;
19
+ return o.useDebugValue(n), n;
20
20
  }
21
21
  export {
22
22
  j as c,