@tencentcloud/chat-uikit-react 3.0.0 → 3.0.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 (112) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/README.md +8 -8
  3. package/dist/{ChatSetting-C7QlwAiq.js → ChatSetting-BtQwjHr0.js} +4996 -4920
  4. package/dist/components/Chat/Chat.js +10 -9
  5. package/dist/components/ChatHeader/ChatHeader.js +12 -11
  6. package/dist/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.js +10 -9
  7. package/dist/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.js +10 -9
  8. package/dist/components/Checkbox/index.js +1 -1
  9. package/dist/components/IconFont/Icon.js +1 -1
  10. package/dist/components/Modal/Modal.js +1 -1
  11. package/dist/components/Model/index.js +1 -1
  12. package/dist/components/Plugins/index.js +1 -1
  13. package/dist/components/Popup/index.js +1 -1
  14. package/dist/components/PopupNew/Popup.js +1 -1
  15. package/dist/components/Profile/Profile.d.ts +1 -1
  16. package/dist/components/Profile/Profile.js +16 -16
  17. package/dist/components/Profile/ProfileDefault.js +39 -39
  18. package/dist/components/Profile/myProfile/MyProfile.js +10 -9
  19. package/dist/components/index.d.ts +0 -1
  20. package/dist/components/index.js +25 -33
  21. package/dist/constant/avatar.d.ts +2 -1
  22. package/dist/constant/avatar.js +2 -1
  23. package/dist/context/ChatContext.js +6 -5
  24. package/dist/external_modules/{mui-CbGEJVT2.js → mui-BcA3SBHM.js} +1 -1
  25. package/dist/external_modules/{zustand-Dvydplxp.js → zustand-CDmQR4co.js} +7 -7
  26. package/dist/hooks/index.js +0 -1
  27. package/dist/index.js +2950 -1530
  28. package/dist/locales/en-US/TUIContact.d.ts +44 -0
  29. package/dist/locales/en-US/TUIContact.js +46 -1
  30. package/dist/locales/en-US/index.d.ts +44 -0
  31. package/dist/locales/ja-JP/TUIContact.d.ts +44 -0
  32. package/dist/locales/ja-JP/TUIContact.js +46 -1
  33. package/dist/locales/ja-JP/index.d.ts +44 -0
  34. package/dist/locales/ko-KR/TUIContact.d.ts +44 -0
  35. package/dist/locales/ko-KR/TUIContact.js +46 -1
  36. package/dist/locales/ko-KR/index.d.ts +44 -0
  37. package/dist/locales/zh-CN/TUIContact.d.ts +44 -0
  38. package/dist/locales/zh-CN/TUIContact.js +46 -1
  39. package/dist/locales/zh-CN/index.d.ts +44 -0
  40. package/dist/locales/zh-TW/TUIContact.d.ts +44 -0
  41. package/dist/locales/zh-TW/TUIContact.js +46 -1
  42. package/dist/locales/zh-TW/index.d.ts +44 -0
  43. package/dist/states/ChatHeaderState.js +23 -22
  44. package/dist/states/UIManagerState.js +1 -1
  45. package/dist/styles/ChatSetting.css +1 -1
  46. package/dist/styles/index.css +1 -1
  47. package/dist/styles/index2.css +1 -1
  48. package/dist/styles/index3.css +1 -1
  49. package/dist/styles/index4.css +1 -1
  50. package/dist/styles/index5.css +1 -1
  51. package/package.json +3 -3
  52. package/src/components/Profile/Profile.tsx +20 -17
  53. package/src/components/Profile/ProfileDefault.tsx +4 -6
  54. package/src/components/index.ts +0 -1
  55. package/src/constant/avatar.ts +2 -1
  56. package/src/hooks/index.ts +0 -2
  57. package/src/locales/en-US/TUIContact.ts +45 -0
  58. package/src/locales/ja-JP/TUIContact.ts +45 -0
  59. package/src/locales/ko-KR/TUIContact.ts +45 -0
  60. package/src/locales/zh-CN/TUIContact.ts +45 -0
  61. package/src/locales/zh-TW/TUIContact.ts +46 -0
  62. package/src/states/ChatHeaderState.ts +2 -2
  63. package/dist/components/Contact/Contact.d.ts +0 -3
  64. package/dist/components/Contact/Contact.js +0 -81
  65. package/dist/components/Contact/ContactInfo/ContactInfo.d.ts +0 -8
  66. package/dist/components/Contact/ContactInfo/ContactInfo.js +0 -27
  67. package/dist/components/Contact/ContactInfo/addFriendInfo.d.ts +0 -8
  68. package/dist/components/Contact/ContactInfo/addFriendInfo.js +0 -61
  69. package/dist/components/Contact/ContactInfo/basicInfo.d.ts +0 -8
  70. package/dist/components/Contact/ContactInfo/basicInfo.js +0 -48
  71. package/dist/components/Contact/ContactInfo/blockInfo.d.ts +0 -8
  72. package/dist/components/Contact/ContactInfo/blockInfo.js +0 -33
  73. package/dist/components/Contact/ContactInfo/friendApplication.d.ts +0 -8
  74. package/dist/components/Contact/ContactInfo/friendApplication.js +0 -47
  75. package/dist/components/Contact/ContactInfo/friendInfo.d.ts +0 -9
  76. package/dist/components/Contact/ContactInfo/friendInfo.js +0 -83
  77. package/dist/components/Contact/ContactInfo/groupInfo.d.ts +0 -9
  78. package/dist/components/Contact/ContactInfo/groupInfo.js +0 -45
  79. package/dist/components/Contact/ContactInfo/hooks/useContactInfo.d.ts +0 -11
  80. package/dist/components/Contact/ContactInfo/hooks/useContactInfo.js +0 -84
  81. package/dist/components/Contact/ContactList/ContactList.d.ts +0 -4
  82. package/dist/components/Contact/ContactList/ContactList.js +0 -152
  83. package/dist/components/Contact/hooks/useTUIContact.d.ts +0 -12
  84. package/dist/components/Contact/hooks/useTUIContact.js +0 -58
  85. package/dist/components/Contact/index.d.ts +0 -3
  86. package/dist/components/Contact/index.js +0 -10
  87. package/dist/components/ContactSearch/ContactSearch.d.ts +0 -3
  88. package/dist/components/ContactSearch/ContactSearch.js +0 -85
  89. package/dist/components/ContactSearch/hooks/useContactSearch.d.ts +0 -6
  90. package/dist/components/ContactSearch/hooks/useContactSearch.js +0 -28
  91. package/dist/styles/ContactInfo.css +0 -1
  92. package/dist/styles/ContactList.css +0 -1
  93. package/dist/styles/ContactSearch.css +0 -1
  94. package/dist/styles/index6.css +0 -1
  95. package/src/components/Contact/Contact.tsx +0 -97
  96. package/src/components/Contact/ContactInfo/ContactInfo.tsx +0 -36
  97. package/src/components/Contact/ContactInfo/addFriendInfo.tsx +0 -88
  98. package/src/components/Contact/ContactInfo/basicInfo.tsx +0 -52
  99. package/src/components/Contact/ContactInfo/blockInfo.tsx +0 -45
  100. package/src/components/Contact/ContactInfo/friendApplication.tsx +0 -68
  101. package/src/components/Contact/ContactInfo/friendInfo.tsx +0 -101
  102. package/src/components/Contact/ContactInfo/groupInfo.tsx +0 -62
  103. package/src/components/Contact/ContactInfo/hooks/useContactInfo.tsx +0 -101
  104. package/src/components/Contact/ContactInfo/index.scss +0 -136
  105. package/src/components/Contact/ContactList/ContactList.tsx +0 -174
  106. package/src/components/Contact/ContactList/index.scss +0 -111
  107. package/src/components/Contact/hooks/useTUIContact.tsx +0 -88
  108. package/src/components/Contact/index.scss +0 -91
  109. package/src/components/Contact/index.ts +0 -3
  110. package/src/components/ContactSearch/ContactSearch.tsx +0 -102
  111. package/src/components/ContactSearch/hooks/useContactSearch.tsx +0 -31
  112. package/src/components/ContactSearch/index.scss +0 -33
@@ -1,27 +0,0 @@
1
- import { jsx as i, Fragment as p, jsxs as f } from "react/jsx-runtime";
2
- import m from "react";
3
- import { useUIManagerState as d } from "../../../states/UIManagerState.js";
4
- import "@tencentcloud/chat-uikit-engine";
5
- import { s as n } from "../../../ChatSetting-C7QlwAiq.js";
6
- import "@tencentcloud/uikit-base-component-react";
7
- import "@tencentcloud/tui-core";
8
- import { AddFriendInfo as s } from "./addFriendInfo.js";
9
- import { BlockInfo as l } from "./blockInfo.js";
10
- import { FriendApplicationInfo as u } from "./friendApplication.js";
11
- import { FriendInfo as I } from "./friendInfo.js";
12
- import { GroupInfo as y } from "./groupInfo.js";
13
- import '../../../styles/ContactInfo.css';function h(e) {
14
- const { showChats: o } = e, { contactData: r } = d("TUIContact");
15
- return r != null && r.type ? /* @__PURE__ */ f("div", { className: `tui-contact-info ${n ? "tui-contact-info-h5" : ""} `, children: [
16
- (r == null ? void 0 : r.type) === "addFriend" && /* @__PURE__ */ i(s, { profile: r == null ? void 0 : r.data }),
17
- (r == null ? void 0 : r.type) === "friend" && /* @__PURE__ */ i(I, { showChats: o, friend: r == null ? void 0 : r.data }),
18
- (r == null ? void 0 : r.type) === "block" && /* @__PURE__ */ i(l, { profile: r == null ? void 0 : r.data }),
19
- (r == null ? void 0 : r.type) === "group" && /* @__PURE__ */ i(y, { showChats: o, group: r == null ? void 0 : r.data }),
20
- (r == null ? void 0 : r.type) === "friendApplication" && /* @__PURE__ */ i(u, { application: r == null ? void 0 : r.data })
21
- ] }) : /* @__PURE__ */ i(p, { children: " " });
22
- }
23
- const w = m.memo(h);
24
- export {
25
- w as ContactInfo,
26
- h as UnMemoizedContactInfo
27
- };
@@ -1,8 +0,0 @@
1
- import { default as React } from 'react';
2
- import { Profile } from '@tencentcloud/chat';
3
- interface Props {
4
- profile: Profile;
5
- }
6
- export declare function UnMemoizedAddFriendInfo<T extends Props>(props: T): React.ReactElement;
7
- export declare const AddFriendInfo: React.MemoExoticComponent<typeof UnMemoizedAddFriendInfo>;
8
- export {};
@@ -1,61 +0,0 @@
1
- import { jsxs as n, Fragment as k, jsx as t } from "react/jsx-runtime";
2
- import b, { useState as o } from "react";
3
- import { useUIKit as C } from "@tencentcloud/uikit-base-component-react";
4
- import E from "./hooks/useContactInfo.js";
5
- import { BasicInfo as F } from "./basicInfo.js";
6
- import { DivWithEdit as U } from "../../DivWithEdit/DivWithEdit.js";
7
- function S(d) {
8
- const { profile: r } = d, { userID: m } = r, { t: i } = C(), [l, c] = o(""), [s, f] = o(""), [a, h] = o(""), [p, u] = o(!1), {
9
- addFriend: v
10
- } = E(), N = () => {
11
- c("remark");
12
- }, I = async () => {
13
- await v({
14
- userID: m,
15
- remark: s,
16
- wording: a
17
- }), u(!0);
18
- }, g = (e) => {
19
- f(e == null ? void 0 : e.value), c("");
20
- }, x = (e) => {
21
- h(e.target.value);
22
- };
23
- return /* @__PURE__ */ n(k, { children: [
24
- /* @__PURE__ */ t(F, { profile: r }),
25
- p ? /* @__PURE__ */ t("div", { className: "tui-contact-info-content", children: /* @__PURE__ */ n("div", { className: "content-item", children: [
26
- /* @__PURE__ */ t("p", { className: "content-item-label", children: i("TUIContact.verification info") }),
27
- /* @__PURE__ */ t("p", { className: "content-item-text", children: a })
28
- ] }) }) : /* @__PURE__ */ n("div", { className: "tui-contact-info-content", children: [
29
- /* @__PURE__ */ n("div", { className: "content-item-wording", children: [
30
- /* @__PURE__ */ t("p", { className: "content-item-label", children: i("TUIContact.Enter the verification info") }),
31
- /* @__PURE__ */ t("textarea", { className: "content-item-wording-text", value: a, onChange: (e) => {
32
- x(e);
33
- } })
34
- ] }),
35
- /* @__PURE__ */ n("div", { className: "content-item", children: [
36
- /* @__PURE__ */ t("p", { className: "content-item-label", children: i("TUIContact.remark") }),
37
- /* @__PURE__ */ t(
38
- U,
39
- {
40
- name: "remark",
41
- className: "content-item-text",
42
- value: s,
43
- type: "text",
44
- toggle: N,
45
- isEdit: l === "remark",
46
- confirm: g,
47
- close: () => {
48
- c("");
49
- }
50
- }
51
- )
52
- ] }),
53
- /* @__PURE__ */ t("div", { className: "content-btn-container", children: /* @__PURE__ */ t("div", { className: "content-item-btn confirm-btn", role: "button", tabIndex: 0, onClick: I, children: i("TUIContact.Send application") }) })
54
- ] })
55
- ] });
56
- }
57
- const D = b.memo(S);
58
- export {
59
- D as AddFriendInfo,
60
- S as UnMemoizedAddFriendInfo
61
- };
@@ -1,8 +0,0 @@
1
- import { default as React } from 'react';
2
- import { Profile } from '@tencentcloud/chat';
3
- interface Props {
4
- profile: Profile;
5
- }
6
- export declare function UnMemoizedBasicInfo<T extends Props>(props: T): React.ReactElement;
7
- export declare const BasicInfo: React.MemoExoticComponent<typeof UnMemoizedBasicInfo>;
8
- export {};
@@ -1,48 +0,0 @@
1
- import { jsxs as e, jsx as t } from "react/jsx-runtime";
2
- import l from "react";
3
- import { TUIConversationService as f } from "@tencentcloud/chat-uikit-engine";
4
- import { useUIKit as h } from "@tencentcloud/uikit-base-component-react";
5
- import { defaultUserAvatar as p } from "../../../constant/avatar.js";
6
- import { useUIManagerState as v } from "../../../states/UIManagerState.js";
7
- import { s as I, P as u } from "../../../ChatSetting-C7QlwAiq.js";
8
- import "@tencentcloud/tui-core";
9
- import { Icon as C } from "../../Icon/Icon.js";
10
- import { IconTypes as U } from "../../Icon/type.js";
11
- function x(a) {
12
- const { profile: o } = a, { t: i } = h(), {
13
- userID: r,
14
- nick: n,
15
- selfSignature: c,
16
- avatar: s
17
- } = o, { setActiveContact: m } = v("TUIContact"), d = () => {
18
- f.switchConversation(""), m();
19
- };
20
- return /* @__PURE__ */ e("div", { className: "tui-contact-info-header", children: [
21
- I && /* @__PURE__ */ t(
22
- C,
23
- {
24
- width: 9,
25
- height: 16,
26
- type: U.BACK,
27
- onClick: d
28
- }
29
- ),
30
- /* @__PURE__ */ e("div", { className: "header-container", children: [
31
- /* @__PURE__ */ e("div", { className: "header-container-avatar", children: [
32
- /* @__PURE__ */ t(u, { size: "xl", src: s || p }),
33
- /* @__PURE__ */ t("div", { className: "header-container-name", children: n || r })
34
- ] }),
35
- /* @__PURE__ */ t("div", { className: "header-container-text", children: `ID:${r}` }),
36
- /* @__PURE__ */ e("div", { className: "header-container-text", children: [
37
- i("TUIContact.Signature"),
38
- ":",
39
- c || ""
40
- ] })
41
- ] })
42
- ] });
43
- }
44
- const z = l.memo(x);
45
- export {
46
- z as BasicInfo,
47
- x as UnMemoizedBasicInfo
48
- };
@@ -1,8 +0,0 @@
1
- import { default as React } from 'react';
2
- import { Profile } from '@tencentcloud/chat';
3
- interface Props {
4
- profile: Profile;
5
- }
6
- export declare function UnMemoizedBlockInfo<T extends Props>(props: T): React.ReactElement;
7
- export declare const BlockInfo: React.MemoExoticComponent<typeof UnMemoizedBlockInfo>;
8
- export {};
@@ -1,33 +0,0 @@
1
- import { jsxs as c, Fragment as f, jsx as t } from "react/jsx-runtime";
2
- import d, { useState as p, useEffect as u } from "react";
3
- import { useUIKit as I } from "@tencentcloud/uikit-base-component-react";
4
- import { useUIManagerState as k } from "../../../states/UIManagerState.js";
5
- import "@tencentcloud/chat-uikit-engine";
6
- import "../../../ChatSetting-C7QlwAiq.js";
7
- import "@tencentcloud/tui-core";
8
- import { Switch as h } from "../../Switch/Switch.js";
9
- import { BasicInfo as B } from "./basicInfo.js";
10
- import v from "./hooks/useContactInfo.js";
11
- function C(n) {
12
- const { profile: o } = n, { contactData: s, setActiveContact: i } = k("TUIContact"), { t: r } = I(), [a, e] = p(!1), {
13
- removeFromBlocklist: m
14
- } = v();
15
- u(() => {
16
- e(!0);
17
- }, [s]);
18
- const l = async () => {
19
- await m(o.userID), e(!1), i();
20
- };
21
- return /* @__PURE__ */ c(f, { children: [
22
- /* @__PURE__ */ t(B, { profile: o }),
23
- /* @__PURE__ */ t("div", { className: "tui-contact-info-content", children: /* @__PURE__ */ c("div", { className: "content-item", children: [
24
- /* @__PURE__ */ t("p", { className: "content-item-label", children: r("TUIContact.block") }),
25
- /* @__PURE__ */ t(h, { className: "content-item-text", onChange: l, checked: a })
26
- ] }) })
27
- ] });
28
- }
29
- const w = d.memo(C);
30
- export {
31
- w as BlockInfo,
32
- C as UnMemoizedBlockInfo
33
- };
@@ -1,8 +0,0 @@
1
- import { default as React } from 'react';
2
- import { FriendApplication } from '@tencentcloud/chat';
3
- interface Props {
4
- application: FriendApplication;
5
- }
6
- export declare function UnMemoizedFriendApplication<T extends Props>(props: T): React.ReactElement;
7
- export declare const FriendApplicationInfo: React.MemoExoticComponent<typeof UnMemoizedFriendApplication>;
8
- export {};
@@ -1,47 +0,0 @@
1
- import { jsxs as e, Fragment as u, jsx as t } from "react/jsx-runtime";
2
- import v from "react";
3
- import N from "@tencentcloud/chat-uikit-engine";
4
- import { useUIKit as I } from "@tencentcloud/uikit-base-component-react";
5
- import { defaultUserAvatar as A } from "../../../constant/avatar.js";
6
- import { useUIManagerState as b } from "../../../states/UIManagerState.js";
7
- import { P as C } from "../../../ChatSetting-C7QlwAiq.js";
8
- import "@tencentcloud/tui-core";
9
- import T from "./hooks/useContactInfo.js";
10
- function U(a) {
11
- const { setActiveContact: c } = b("TUIContact"), { t: i } = I(), { application: o } = a, {
12
- userID: n,
13
- nick: r,
14
- avatar: s,
15
- type: l,
16
- wording: d
17
- } = o, {
18
- acceptFriendApplication: m,
19
- refuseFriendApplication: p
20
- } = T(), f = () => {
21
- c(), m(n);
22
- }, h = () => {
23
- c(), p(n);
24
- };
25
- return /* @__PURE__ */ e(u, { children: [
26
- /* @__PURE__ */ t("div", { className: "tui-contact-info-header", children: /* @__PURE__ */ e("div", { className: "header-container", children: [
27
- /* @__PURE__ */ e("div", { className: "header-container-avatar", children: [
28
- /* @__PURE__ */ t(C, { size: "xl", src: s || A }),
29
- /* @__PURE__ */ t("div", { className: "header-container-name", children: r || n })
30
- ] }),
31
- /* @__PURE__ */ t("div", { className: "header-container-text", children: `ID:${n}` })
32
- ] }) }),
33
- /* @__PURE__ */ t("div", { className: "tui-contact-info-content", children: /* @__PURE__ */ e("div", { className: "content-item", children: [
34
- /* @__PURE__ */ t("p", { className: "content-item-label", children: i("TUIContact.verification info") }),
35
- /* @__PURE__ */ t("p", { className: "content-item-text", children: d })
36
- ] }) }),
37
- l === N.TYPES.SNS_APPLICATION_SENT_TO_ME && /* @__PURE__ */ t("div", { className: "tui-contact-info-content", children: /* @__PURE__ */ e("div", { className: "content-btn-container", children: [
38
- /* @__PURE__ */ t("div", { className: "content-item-btn delete-btn", role: "button", tabIndex: 0, onClick: h, children: i("TUIContact.Refuse") }),
39
- /* @__PURE__ */ t("div", { className: "content-item-btn confirm-btn", role: "button", tabIndex: 0, onClick: f, children: i("TUIContact.Agree") })
40
- ] }) })
41
- ] });
42
- }
43
- const j = v.memo(U);
44
- export {
45
- j as FriendApplicationInfo,
46
- U as UnMemoizedFriendApplication
47
- };
@@ -1,9 +0,0 @@
1
- import { default as React } from 'react';
2
- import { Friend } from '@tencentcloud/chat';
3
- interface Props {
4
- friend: Friend;
5
- showChats?: (() => void) | undefined;
6
- }
7
- export declare function UnMemoizedFriendInfo<T extends Props>(props: T): React.ReactElement;
8
- export declare const FriendInfo: React.MemoExoticComponent<typeof UnMemoizedFriendInfo>;
9
- export {};
@@ -1,83 +0,0 @@
1
- import { jsxs as n, Fragment as D, jsx as e } from "react/jsx-runtime";
2
- import S, { useState as s, useEffect as R } from "react";
3
- import { useUIKit as w } from "@tencentcloud/uikit-base-component-react";
4
- import { useUIManagerState as f } from "../../../states/UIManagerState.js";
5
- import "@tencentcloud/chat-uikit-engine";
6
- import "../../../ChatSetting-C7QlwAiq.js";
7
- import "@tencentcloud/tui-core";
8
- import { DivWithEdit as y } from "../../DivWithEdit/DivWithEdit.js";
9
- import { Switch as A } from "../../Switch/Switch.js";
10
- import { BasicInfo as M } from "./basicInfo.js";
11
- import j from "./hooks/useContactInfo.js";
12
- import '../../../styles/index.css';/* empty css */
13
- function H(p) {
14
- const { chat: u } = f(), {
15
- contactData: k,
16
- setActiveContact: a,
17
- switchConversation: I
18
- } = f("TUIContact"), { t: o } = w(), { friend: C, showChats: i } = p, { userID: c, profile: h, remark: m } = C, [v, r] = s(""), [b, l] = s(""), [N, d] = s(!1), {
19
- addToBlocklist: T,
20
- deleteFriend: x
21
- } = j();
22
- R(() => {
23
- d(!1), l(m);
24
- }, [k, m]);
25
- const U = () => {
26
- r("remark");
27
- }, g = (t) => {
28
- u.updateFriend({
29
- userID: c,
30
- remark: t == null ? void 0 : t.value
31
- }), l(t == null ? void 0 : t.value), r("");
32
- }, E = async () => {
33
- await T(c), d(!0), a();
34
- }, F = async () => {
35
- await x(c), a();
36
- }, B = () => {
37
- const t = `C2C${c}`;
38
- i == null || i(), I(t);
39
- };
40
- return /* @__PURE__ */ n(D, { children: [
41
- /* @__PURE__ */ e(M, { profile: h }),
42
- /* @__PURE__ */ n("div", { className: "tui-contact-info-content", children: [
43
- /* @__PURE__ */ n("div", { className: "content-item", children: [
44
- /* @__PURE__ */ e("p", { className: "content-item-label", children: o("TUIContact.remark") }),
45
- /* @__PURE__ */ e(
46
- y,
47
- {
48
- name: "remark",
49
- className: "content-item-text",
50
- value: b,
51
- type: "text",
52
- toggle: U,
53
- isEdit: v === "remark",
54
- confirm: g,
55
- close: () => {
56
- r("");
57
- }
58
- }
59
- )
60
- ] }),
61
- /* @__PURE__ */ n("div", { className: "content-item", children: [
62
- /* @__PURE__ */ e("p", { className: "content-item-label", children: o("TUIContact.block") }),
63
- /* @__PURE__ */ e(
64
- A,
65
- {
66
- className: "content-item-text",
67
- onChange: E,
68
- checked: N
69
- }
70
- )
71
- ] }),
72
- /* @__PURE__ */ n("div", { className: "content-btn-container", children: [
73
- /* @__PURE__ */ e("div", { className: "content-item-btn delete-btn", role: "button", tabIndex: 0, onClick: F, children: o("TUIContact.Delete friend") }),
74
- /* @__PURE__ */ e("div", { className: "content-item-btn confirm-btn", role: "button", tabIndex: 0, onClick: B, children: o("TUIContact.Send Message") })
75
- ] })
76
- ] })
77
- ] });
78
- }
79
- const Q = S.memo(H);
80
- export {
81
- Q as FriendInfo,
82
- H as UnMemoizedFriendInfo
83
- };
@@ -1,9 +0,0 @@
1
- import { default as React } from 'react';
2
- import { IGroupModel } from '@tencentcloud/chat-uikit-engine';
3
- interface Props {
4
- group: IGroupModel;
5
- showChats?: (() => void) | undefined;
6
- }
7
- export declare function UnMemoizedGroupInfo<T extends Props>(props: T): React.ReactElement;
8
- export declare const GroupInfo: React.MemoExoticComponent<typeof UnMemoizedGroupInfo>;
9
- export {};
@@ -1,45 +0,0 @@
1
- import { jsxs as o, Fragment as v, jsx as t } from "react/jsx-runtime";
2
- import f from "react";
3
- import { TUIConversationService as u } from "@tencentcloud/chat-uikit-engine";
4
- import { useUIKit as I } from "@tencentcloud/uikit-base-component-react";
5
- import { useUIManagerState as C } from "../../../states/UIManagerState.js";
6
- import { s as N, P as U } from "../../../ChatSetting-C7QlwAiq.js";
7
- import "@tencentcloud/tui-core";
8
- import { defaultUserAvatar as g } from "../../../constant/avatar.js";
9
- import { Icon as b } from "../../Icon/Icon.js";
10
- import { IconTypes as x } from "../../Icon/type.js";
11
- import '../../../styles/index.css';/* empty css */
12
- function w(r) {
13
- const { group: a, showChats: n } = r, { setActiveContact: i, switchConversation: c } = C("TUIContact"), { t: s } = I(), { groupID: e, name: m, avatar: d } = a, l = () => {
14
- u.switchConversation(""), i();
15
- }, h = () => {
16
- const p = `GROUP${e}`;
17
- n && n(), c(p);
18
- };
19
- return /* @__PURE__ */ o(v, { children: [
20
- /* @__PURE__ */ o("div", { className: "tui-contact-info-header", children: [
21
- N && /* @__PURE__ */ t(
22
- b,
23
- {
24
- width: 9,
25
- height: 16,
26
- type: x.BACK,
27
- onClick: l
28
- }
29
- ),
30
- /* @__PURE__ */ o("div", { className: "header-container", children: [
31
- /* @__PURE__ */ o("div", { className: "header-container-avatar", children: [
32
- /* @__PURE__ */ t(U, { size: "xl", src: d || g }),
33
- /* @__PURE__ */ t("div", { className: "header-container-name", children: m || e })
34
- ] }),
35
- /* @__PURE__ */ t("div", { className: "header-container-text", children: `groupID:${e}` })
36
- ] })
37
- ] }),
38
- /* @__PURE__ */ t("div", { className: "tui-contact-info-content", children: /* @__PURE__ */ t("div", { className: "content-btn-container", children: /* @__PURE__ */ t("div", { className: "content-item-btn confirm-btn", role: "button", tabIndex: 0, onClick: h, children: s("TUIContact.Send Message") }) }) })
39
- ] });
40
- }
41
- const P = f.memo(w);
42
- export {
43
- P as GroupInfo,
44
- w as UnMemoizedGroupInfo
45
- };
@@ -1,11 +0,0 @@
1
- declare function useContactInfo(): {
2
- addToBlocklist: (userID: string) => void;
3
- removeFromBlocklist: (userID: string) => void;
4
- isFriend: (info: any) => Promise<boolean>;
5
- isBlock: (userID: string) => Promise<any>;
6
- addFriend: (param: any) => void;
7
- deleteFriend: (userID: string) => void;
8
- acceptFriendApplication: (userID: string) => void;
9
- refuseFriendApplication: (userID: string) => void;
10
- };
11
- export default useContactInfo;
@@ -1,84 +0,0 @@
1
- import { useCallback as i } from "react";
2
- import n from "@tencentcloud/chat-uikit-engine";
3
- import { useUIManagerState as k } from "../../../../states/UIManagerState.js";
4
- import "../../../../ChatSetting-C7QlwAiq.js";
5
- import { Toast as E } from "@tencentcloud/uikit-base-component-react";
6
- import "@tencentcloud/tui-core";
7
- import "react/jsx-runtime";
8
- function h() {
9
- const { chat: t } = k(), d = i((e) => {
10
- t.removeFromBlacklist({
11
- userIDList: [e]
12
- });
13
- }, [t]), l = i((e) => {
14
- t.addFriend({
15
- to: e == null ? void 0 : e.userID,
16
- source: "AddSource_Type_Web",
17
- remark: e == null ? void 0 : e.remark,
18
- wording: e == null ? void 0 : e.wording
19
- }).catch((c) => {
20
- console.warn("delete friend failed:", c), E.error({
21
- message: c
22
- });
23
- });
24
- }, [t]), a = i((e) => {
25
- t.deleteFriend({
26
- userIDList: [e]
27
- });
28
- }, [t]), _ = i((e) => {
29
- t.addToBlacklist({
30
- userIDList: [e]
31
- });
32
- }, [t]), T = i((e) => {
33
- t.acceptFriendApplication({
34
- userID: e,
35
- type: n.TYPES.SNS_APPLICATION_AGREE_AND_ADD
36
- });
37
- }, [t]), u = i((e) => {
38
- t.refuseFriendApplication({
39
- userID: e
40
- });
41
- }, [t]);
42
- return {
43
- addToBlocklist: _,
44
- removeFromBlocklist: d,
45
- isFriend: (e) => new Promise((c, S) => {
46
- t.checkFriend({
47
- userIDList: [e == null ? void 0 : e.userID],
48
- type: n.TYPES.SNS_CHECK_TYPE_BOTH
49
- }).then((s) => {
50
- var o, r;
51
- switch ((r = (o = s == null ? void 0 : s.data) == null ? void 0 : o.successUserIDList[0]) == null ? void 0 : r.relation) {
52
- case n.TYPES.SNS_TYPE_NO_RELATION:
53
- c(!1);
54
- break;
55
- case n.TYPES.SNS_TYPE_A_WITH_B:
56
- c(!1);
57
- break;
58
- case n.TYPES.SNS_TYPE_B_WITH_A:
59
- c(!1);
60
- break;
61
- case n.TYPES.SNS_TYPE_BOTH_WAY:
62
- c(!0);
63
- break;
64
- default:
65
- c(!1);
66
- break;
67
- }
68
- }).catch((s) => {
69
- console.warn("checkFriend error", s), S(s);
70
- });
71
- }),
72
- isBlock: async (e) => {
73
- const { data: c } = await t.getBlacklist();
74
- return c.includes(e);
75
- },
76
- addFriend: l,
77
- deleteFriend: a,
78
- acceptFriendApplication: T,
79
- refuseFriendApplication: u
80
- };
81
- }
82
- export {
83
- h as default
84
- };
@@ -1,4 +0,0 @@
1
- import { default as React } from 'react';
2
- declare function UnMemoizedContactList<T>(): React.ReactElement;
3
- export declare const ContactList: React.MemoExoticComponent<typeof UnMemoizedContactList>;
4
- export {};
@@ -1,152 +0,0 @@
1
- import { jsxs as i, jsx as t, Fragment as M } from "react/jsx-runtime";
2
- import D, { useState as d } from "react";
3
- import N from "@tencentcloud/chat-uikit-engine";
4
- import { useUIKit as G } from "@tencentcloud/uikit-base-component-react";
5
- import { defaultUserAvatar as C } from "../../../constant/avatar.js";
6
- import { useTUIContactContext as O } from "../../../context/ContactContext.js";
7
- import "../../../context/ChatContext.js";
8
- import { useUIManagerState as Y } from "../../../states/UIManagerState.js";
9
- import { P as I, s as j } from "../../../ChatSetting-C7QlwAiq.js";
10
- import "@tencentcloud/tui-core";
11
- import R from "../ContactInfo/hooks/useContactInfo.js";
12
- import z from "../hooks/useTUIContact.js";
13
- import '../../../styles/ContactList.css';function H() {
14
- const { setActiveContact: m } = Y(), { t: o } = G(), {
15
- isShowContactList: S,
16
- friendList: v,
17
- blocklistProfile: w,
18
- friendApplicationList: p
19
- } = O("TUIContactList"), {
20
- acceptFriendApplication: T
21
- } = R(), { groupList: x } = z(), [u, b] = d(!1), [U, k] = d(!1), [g, A] = d(!1), [L, P] = d(!1), _ = (s, n) => {
22
- s.stopPropagation(), T(n), m();
23
- }, h = ({ type: s, isShow: n, setShow: a, list: l, title: f }) => /* @__PURE__ */ i(M, { children: [
24
- /* @__PURE__ */ i(
25
- "div",
26
- {
27
- className: "tui-contacts-title",
28
- role: "button",
29
- tabIndex: 0,
30
- onClick: () => a(!n),
31
- children: [
32
- /* @__PURE__ */ t("div", { className: "tui-contacts-list-title", children: f }),
33
- /* @__PURE__ */ t("div", { className: "tui-contacts-list-icon", children: n ? /* @__PURE__ */ t("i", { className: "iconfont contacts-list-icon", children: "" }) : /* @__PURE__ */ t("i", { className: "iconfont contacts-list-icon", children: "" }) })
34
- ]
35
- }
36
- ),
37
- n && (l == null ? void 0 : l.map((c) => {
38
- const { userID: r, groupID: e, avatar: F, name: E, nick: y } = c.profile || c, B = c.remark || y || r || E || e;
39
- return /* @__PURE__ */ i(
40
- "div",
41
- {
42
- role: "button",
43
- tabIndex: 0,
44
- className: "tui-contacts-list-item",
45
- onClick: () => {
46
- m({ type: s, data: c });
47
- },
48
- children: [
49
- /* @__PURE__ */ t(I, { src: F || C }),
50
- /* @__PURE__ */ t("div", { className: "tui-contacts-list-item-container", children: /* @__PURE__ */ t("p", { className: "tui-contacts-list-item-name", children: B }) })
51
- ]
52
- },
53
- r || e
54
- );
55
- }))
56
- ] });
57
- return S && /* @__PURE__ */ i("div", { className: `tui-contacts-list ${j ? "tui-contacts-list-h5" : ""} `, children: [
58
- /* @__PURE__ */ i(
59
- "div",
60
- {
61
- className: "tui-contacts-title",
62
- role: "button",
63
- tabIndex: 0,
64
- onClick: () => b(!u),
65
- children: [
66
- /* @__PURE__ */ t("p", { className: "tui-contacts-list-title", children: o("TUIContact.New Contacts") }),
67
- /* @__PURE__ */ t("div", { className: "tui-contacts-list-icon", children: u ? /* @__PURE__ */ t("i", { className: "iconfont contacts-list-icon", children: "" }) : /* @__PURE__ */ t("i", { className: "iconfont contacts-list-icon", children: "" }) })
68
- ]
69
- }
70
- ),
71
- u && (p == null ? void 0 : p.map((s, n) => {
72
- const {
73
- userID: a,
74
- avatar: l,
75
- nick: f,
76
- wording: c,
77
- type: r
78
- } = s;
79
- return /* @__PURE__ */ i(
80
- "div",
81
- {
82
- role: "button",
83
- tabIndex: 0,
84
- className: "tui-contacts-list-item",
85
- onClick: (e) => {
86
- e.stopPropagation(), m({
87
- type: "friendApplication",
88
- data: s
89
- });
90
- },
91
- children: [
92
- /* @__PURE__ */ t(I, { src: l || C }),
93
- /* @__PURE__ */ i("div", { className: "tui-contacts-list-item-card", children: [
94
- /* @__PURE__ */ i("div", { children: [
95
- /* @__PURE__ */ t("p", { className: "tui-contacts-list-item-name text-ellipsis", children: f || a }),
96
- c !== "" && /* @__PURE__ */ t("p", { className: "tui-contacts-list-item-text text-ellipsis", children: c })
97
- ] }),
98
- r === N.TYPES.SNS_APPLICATION_SENT_BY_ME && /* @__PURE__ */ t("p", { className: "tui-contacts-list-btn-text text-ellipsis", children: o("TUIContact.waiting for verification") }),
99
- r === N.TYPES.SNS_APPLICATION_SENT_TO_ME && /* @__PURE__ */ t(
100
- "div",
101
- {
102
- className: "application-btn",
103
- role: "button",
104
- tabIndex: 0,
105
- onClick: (e) => {
106
- _(e, a);
107
- },
108
- children: o("TUIContact.Agree")
109
- }
110
- )
111
- ] })
112
- ]
113
- },
114
- a
115
- );
116
- })),
117
- /* @__PURE__ */ t(
118
- h,
119
- {
120
- type: "block",
121
- title: o("TUIContact.Blocked List"),
122
- isShow: g,
123
- setShow: A,
124
- list: w
125
- }
126
- ),
127
- /* @__PURE__ */ t(
128
- h,
129
- {
130
- type: "group",
131
- title: o("TUIContact.Group List"),
132
- setShow: P,
133
- isShow: L,
134
- list: x
135
- }
136
- ),
137
- /* @__PURE__ */ t(
138
- h,
139
- {
140
- type: "friend",
141
- title: o("TUIContact.Friends"),
142
- setShow: k,
143
- isShow: U,
144
- list: v
145
- }
146
- )
147
- ] });
148
- }
149
- const ot = D.memo(H);
150
- export {
151
- ot as ContactList
152
- };