@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.
- package/CHANGELOG.md +17 -1
- package/README.md +8 -8
- package/dist/{ChatSetting-C7QlwAiq.js → ChatSetting-BtQwjHr0.js} +4996 -4920
- package/dist/components/Chat/Chat.js +10 -9
- package/dist/components/ChatHeader/ChatHeader.js +12 -11
- package/dist/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.js +10 -9
- package/dist/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.js +10 -9
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/IconFont/Icon.js +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Model/index.js +1 -1
- package/dist/components/Plugins/index.js +1 -1
- package/dist/components/Popup/index.js +1 -1
- package/dist/components/PopupNew/Popup.js +1 -1
- package/dist/components/Profile/Profile.d.ts +1 -1
- package/dist/components/Profile/Profile.js +16 -16
- package/dist/components/Profile/ProfileDefault.js +39 -39
- package/dist/components/Profile/myProfile/MyProfile.js +10 -9
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.js +25 -33
- package/dist/constant/avatar.d.ts +2 -1
- package/dist/constant/avatar.js +2 -1
- package/dist/context/ChatContext.js +6 -5
- package/dist/external_modules/{mui-CbGEJVT2.js → mui-BcA3SBHM.js} +1 -1
- package/dist/external_modules/{zustand-Dvydplxp.js → zustand-CDmQR4co.js} +7 -7
- package/dist/hooks/index.js +0 -1
- package/dist/index.js +2950 -1530
- package/dist/locales/en-US/TUIContact.d.ts +44 -0
- package/dist/locales/en-US/TUIContact.js +46 -1
- package/dist/locales/en-US/index.d.ts +44 -0
- package/dist/locales/ja-JP/TUIContact.d.ts +44 -0
- package/dist/locales/ja-JP/TUIContact.js +46 -1
- package/dist/locales/ja-JP/index.d.ts +44 -0
- package/dist/locales/ko-KR/TUIContact.d.ts +44 -0
- package/dist/locales/ko-KR/TUIContact.js +46 -1
- package/dist/locales/ko-KR/index.d.ts +44 -0
- package/dist/locales/zh-CN/TUIContact.d.ts +44 -0
- package/dist/locales/zh-CN/TUIContact.js +46 -1
- package/dist/locales/zh-CN/index.d.ts +44 -0
- package/dist/locales/zh-TW/TUIContact.d.ts +44 -0
- package/dist/locales/zh-TW/TUIContact.js +46 -1
- package/dist/locales/zh-TW/index.d.ts +44 -0
- package/dist/states/ChatHeaderState.js +23 -22
- package/dist/states/UIManagerState.js +1 -1
- package/dist/styles/ChatSetting.css +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/styles/index2.css +1 -1
- package/dist/styles/index3.css +1 -1
- package/dist/styles/index4.css +1 -1
- package/dist/styles/index5.css +1 -1
- package/package.json +3 -3
- package/src/components/Profile/Profile.tsx +20 -17
- package/src/components/Profile/ProfileDefault.tsx +4 -6
- package/src/components/index.ts +0 -1
- package/src/constant/avatar.ts +2 -1
- package/src/hooks/index.ts +0 -2
- package/src/locales/en-US/TUIContact.ts +45 -0
- package/src/locales/ja-JP/TUIContact.ts +45 -0
- package/src/locales/ko-KR/TUIContact.ts +45 -0
- package/src/locales/zh-CN/TUIContact.ts +45 -0
- package/src/locales/zh-TW/TUIContact.ts +46 -0
- package/src/states/ChatHeaderState.ts +2 -2
- package/dist/components/Contact/Contact.d.ts +0 -3
- package/dist/components/Contact/Contact.js +0 -81
- package/dist/components/Contact/ContactInfo/ContactInfo.d.ts +0 -8
- package/dist/components/Contact/ContactInfo/ContactInfo.js +0 -27
- package/dist/components/Contact/ContactInfo/addFriendInfo.d.ts +0 -8
- package/dist/components/Contact/ContactInfo/addFriendInfo.js +0 -61
- package/dist/components/Contact/ContactInfo/basicInfo.d.ts +0 -8
- package/dist/components/Contact/ContactInfo/basicInfo.js +0 -48
- package/dist/components/Contact/ContactInfo/blockInfo.d.ts +0 -8
- package/dist/components/Contact/ContactInfo/blockInfo.js +0 -33
- package/dist/components/Contact/ContactInfo/friendApplication.d.ts +0 -8
- package/dist/components/Contact/ContactInfo/friendApplication.js +0 -47
- package/dist/components/Contact/ContactInfo/friendInfo.d.ts +0 -9
- package/dist/components/Contact/ContactInfo/friendInfo.js +0 -83
- package/dist/components/Contact/ContactInfo/groupInfo.d.ts +0 -9
- package/dist/components/Contact/ContactInfo/groupInfo.js +0 -45
- package/dist/components/Contact/ContactInfo/hooks/useContactInfo.d.ts +0 -11
- package/dist/components/Contact/ContactInfo/hooks/useContactInfo.js +0 -84
- package/dist/components/Contact/ContactList/ContactList.d.ts +0 -4
- package/dist/components/Contact/ContactList/ContactList.js +0 -152
- package/dist/components/Contact/hooks/useTUIContact.d.ts +0 -12
- package/dist/components/Contact/hooks/useTUIContact.js +0 -58
- package/dist/components/Contact/index.d.ts +0 -3
- package/dist/components/Contact/index.js +0 -10
- package/dist/components/ContactSearch/ContactSearch.d.ts +0 -3
- package/dist/components/ContactSearch/ContactSearch.js +0 -85
- package/dist/components/ContactSearch/hooks/useContactSearch.d.ts +0 -6
- package/dist/components/ContactSearch/hooks/useContactSearch.js +0 -28
- package/dist/styles/ContactInfo.css +0 -1
- package/dist/styles/ContactList.css +0 -1
- package/dist/styles/ContactSearch.css +0 -1
- package/dist/styles/index6.css +0 -1
- package/src/components/Contact/Contact.tsx +0 -97
- package/src/components/Contact/ContactInfo/ContactInfo.tsx +0 -36
- package/src/components/Contact/ContactInfo/addFriendInfo.tsx +0 -88
- package/src/components/Contact/ContactInfo/basicInfo.tsx +0 -52
- package/src/components/Contact/ContactInfo/blockInfo.tsx +0 -45
- package/src/components/Contact/ContactInfo/friendApplication.tsx +0 -68
- package/src/components/Contact/ContactInfo/friendInfo.tsx +0 -101
- package/src/components/Contact/ContactInfo/groupInfo.tsx +0 -62
- package/src/components/Contact/ContactInfo/hooks/useContactInfo.tsx +0 -101
- package/src/components/Contact/ContactInfo/index.scss +0 -136
- package/src/components/Contact/ContactList/ContactList.tsx +0 -174
- package/src/components/Contact/ContactList/index.scss +0 -111
- package/src/components/Contact/hooks/useTUIContact.tsx +0 -88
- package/src/components/Contact/index.scss +0 -91
- package/src/components/Contact/index.ts +0 -3
- package/src/components/ContactSearch/ContactSearch.tsx +0 -102
- package/src/components/ContactSearch/hooks/useContactSearch.tsx +0 -31
- package/src/components/ContactSearch/index.scss +0 -33
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { E as a, m as e } from "../../ChatSetting-
|
|
2
|
+
import { E as a, m as e } from "../../ChatSetting-BtQwjHr0.js";
|
|
3
3
|
import "@tencentcloud/uikit-base-component-react";
|
|
4
4
|
import "@tencentcloud/chat-uikit-engine";
|
|
5
5
|
import "@tencentcloud/tui-core";
|
|
6
6
|
import "react";
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
import "@tencentcloud/chat";
|
|
8
|
+
import { c as p } from "../../external_modules/classnames-HRMVOjAa.js";
|
|
9
|
+
import { ChatProvider as l } from "../../context/ChatContext.js";
|
|
10
|
+
import '../../styles/Chat.css';const n = "uikit-chat", h = {
|
|
11
|
+
chat: n
|
|
12
|
+
}, k = (o) => {
|
|
12
13
|
const {
|
|
13
14
|
PlaceholderEmpty: c = null,
|
|
14
15
|
className: m,
|
|
15
16
|
style: s,
|
|
16
17
|
children: i
|
|
17
18
|
} = o, { activeConversation: t } = a();
|
|
18
|
-
return t != null && t.conversationID ? /* @__PURE__ */ r(
|
|
19
|
+
return t != null && t.conversationID ? /* @__PURE__ */ r(l, { children: /* @__PURE__ */ r(
|
|
19
20
|
e,
|
|
20
21
|
{
|
|
21
|
-
className:
|
|
22
|
+
className: p(h.chat, m),
|
|
22
23
|
style: s,
|
|
23
24
|
children: i
|
|
24
25
|
}
|
|
25
26
|
) }) : c;
|
|
26
27
|
};
|
|
27
28
|
export {
|
|
28
|
-
|
|
29
|
+
k as Chat
|
|
29
30
|
};
|
|
@@ -1,23 +1,24 @@
|
|
|
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-
|
|
4
|
+
import { j as C } from "../../ChatSetting-BtQwjHr0.js";
|
|
5
5
|
import "@tencentcloud/uikit-base-component-react";
|
|
6
6
|
import "@tencentcloud/tui-core";
|
|
7
|
+
import "@tencentcloud/chat";
|
|
7
8
|
import "../../states/UIManagerState.js";
|
|
8
9
|
import { useChatHeaderState as U } from "../../states/ChatHeaderState.js";
|
|
9
10
|
import x from "./ChatHeaderUI/ChatHeaderUI.js";
|
|
10
|
-
const
|
|
11
|
+
const E = (e) => {
|
|
11
12
|
const {
|
|
12
13
|
title: r,
|
|
13
14
|
avatar: a,
|
|
14
15
|
enableUserStatus: t = !1,
|
|
15
|
-
chatHeaderActions:
|
|
16
|
-
Avatar:
|
|
16
|
+
chatHeaderActions: o,
|
|
17
|
+
Avatar: s,
|
|
17
18
|
className: i,
|
|
18
|
-
style:
|
|
19
|
+
style: m
|
|
19
20
|
} = e, {
|
|
20
|
-
system:
|
|
21
|
+
system: c,
|
|
21
22
|
conversation: n,
|
|
22
23
|
isGroup: p,
|
|
23
24
|
title: l,
|
|
@@ -35,16 +36,16 @@ const w = (e) => {
|
|
|
35
36
|
userStatus: u,
|
|
36
37
|
conversation: n,
|
|
37
38
|
isPeerTyping: S,
|
|
38
|
-
system:
|
|
39
|
+
system: c,
|
|
39
40
|
enableUserStatus: t,
|
|
40
|
-
chatHeaderActions:
|
|
41
|
-
Avatar:
|
|
42
|
-
style:
|
|
41
|
+
chatHeaderActions: o,
|
|
42
|
+
Avatar: s,
|
|
43
|
+
style: m,
|
|
43
44
|
className: i,
|
|
44
45
|
onSearchClick: e.onSearchClick
|
|
45
46
|
}
|
|
46
47
|
);
|
|
47
48
|
};
|
|
48
49
|
export {
|
|
49
|
-
|
|
50
|
+
E as ChatHeader
|
|
50
51
|
};
|
|
@@ -4,29 +4,30 @@ 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 {
|
|
7
|
+
import { i as z, E as N, p as A, m as M } from "../../../ChatSetting-BtQwjHr0.js";
|
|
8
|
+
import "@tencentcloud/chat";
|
|
8
9
|
import { c as p } from "../../../external_modules/classnames-HRMVOjAa.js";
|
|
9
10
|
import '../../../styles/ChatHeaderActions.css';const C = {
|
|
10
11
|
"chat-header-actions": "uikit-chat-header-actions",
|
|
11
12
|
"icon-button": "uikit-icon-button"
|
|
12
|
-
},
|
|
13
|
+
}, L = (I) => {
|
|
13
14
|
const {
|
|
14
15
|
chatHeaderActions: l = ["videoCall", "audioCall", "search", "chatSetting"],
|
|
15
16
|
className: f,
|
|
16
17
|
style: d
|
|
17
|
-
} = I, { searchConfig:
|
|
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) => {
|
|
18
19
|
var t;
|
|
19
20
|
if (i) {
|
|
20
21
|
if (!((t = o == null ? void 0 : o.userProfile) != null && t.userID))
|
|
21
22
|
throw new Error("User ID is not available in Call.");
|
|
22
23
|
A({
|
|
23
24
|
callType: o.type,
|
|
24
|
-
callMediaType:
|
|
25
|
+
callMediaType: r,
|
|
25
26
|
userIDList: [o.userProfile.userID]
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
29
|
}, [o, i]), S = u(() => {
|
|
29
|
-
const
|
|
30
|
+
const r = {
|
|
30
31
|
videoCall: {
|
|
31
32
|
icon: /* @__PURE__ */ e(y, { size: "28px" }),
|
|
32
33
|
onClick: () => a(m.VIDEO),
|
|
@@ -40,7 +41,7 @@ import '../../../styles/ChatHeaderActions.css';const C = {
|
|
|
40
41
|
search: {
|
|
41
42
|
icon: /* @__PURE__ */ e(D, { size: "28px" }),
|
|
42
43
|
onClick: g,
|
|
43
|
-
show: !(
|
|
44
|
+
show: !(c != null && c.hideSearch)
|
|
44
45
|
},
|
|
45
46
|
chatSetting: {
|
|
46
47
|
icon: /* @__PURE__ */ e(b, { size: "28px" }),
|
|
@@ -50,9 +51,9 @@ import '../../../styles/ChatHeaderActions.css';const C = {
|
|
|
50
51
|
};
|
|
51
52
|
return l.filter((t) => {
|
|
52
53
|
var n;
|
|
53
|
-
return !!((n =
|
|
54
|
+
return !!((n = r[t]) != null && n.show);
|
|
54
55
|
}).map((t) => {
|
|
55
|
-
const n =
|
|
56
|
+
const n = r[t];
|
|
56
57
|
return /* @__PURE__ */ e(
|
|
57
58
|
"button",
|
|
58
59
|
{
|
|
@@ -74,5 +75,5 @@ import '../../../styles/ChatHeaderActions.css';const C = {
|
|
|
74
75
|
);
|
|
75
76
|
};
|
|
76
77
|
export {
|
|
77
|
-
|
|
78
|
+
L as ChatHeaderActions
|
|
78
79
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as t, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import { useUIKit as O, IconChevronLeft as U } from "@tencentcloud/uikit-base-component-react";
|
|
3
|
-
import {
|
|
3
|
+
import { i as g, E as I, m as a, V as T } from "../../../ChatSetting-BtQwjHr0.js";
|
|
4
4
|
import "@tencentcloud/chat-uikit-engine";
|
|
5
5
|
import "@tencentcloud/tui-core";
|
|
6
6
|
import "react";
|
|
7
|
-
import
|
|
7
|
+
import "@tencentcloud/chat";
|
|
8
|
+
import { c as n } from "../../../external_modules/classnames-HRMVOjAa.js";
|
|
8
9
|
import { ChatHeaderActions as x } from "../ChatHeaderActions/ChatHeaderActions.js";
|
|
9
10
|
import '../../../styles/ChatHeaderUI.css';const e = {
|
|
10
11
|
"chat-header": "uikit-chat-header",
|
|
@@ -19,10 +20,10 @@ import '../../../styles/ChatHeaderUI.css';const e = {
|
|
|
19
20
|
}, m = {
|
|
20
21
|
Online: "Online",
|
|
21
22
|
Offline: "Offline"
|
|
22
|
-
},
|
|
23
|
+
}, L = (f) => {
|
|
23
24
|
const {
|
|
24
25
|
title: u,
|
|
25
|
-
avatar:
|
|
26
|
+
avatar: h,
|
|
26
27
|
isPeerTyping: p = !1,
|
|
27
28
|
system: k = !1,
|
|
28
29
|
userStatus: c,
|
|
@@ -37,7 +38,7 @@ import '../../../styles/ChatHeaderUI.css';const e = {
|
|
|
37
38
|
return /* @__PURE__ */ t(
|
|
38
39
|
a,
|
|
39
40
|
{
|
|
40
|
-
className:
|
|
41
|
+
className: n(e["chat-header"], l),
|
|
41
42
|
style: _,
|
|
42
43
|
children: "System Notice"
|
|
43
44
|
}
|
|
@@ -48,18 +49,18 @@ import '../../../styles/ChatHeaderUI.css';const e = {
|
|
|
48
49
|
return /* @__PURE__ */ t(
|
|
49
50
|
a,
|
|
50
51
|
{
|
|
51
|
-
className:
|
|
52
|
+
className: n(e["chat-header"], l),
|
|
52
53
|
style: _,
|
|
53
54
|
children: /* @__PURE__ */ i(a, { className: e["chat-header__container"], children: [
|
|
54
55
|
/* @__PURE__ */ i(a, { className: e["chat-header__left"], children: [
|
|
55
|
-
/* @__PURE__ */ t("button", { className:
|
|
56
|
+
/* @__PURE__ */ t("button", { className: n(e["icon-button"], e["chat-header__back-icon"]), onClick: d, children: /* @__PURE__ */ t(
|
|
56
57
|
U,
|
|
57
58
|
{
|
|
58
59
|
onClick: d,
|
|
59
60
|
size: "28px"
|
|
60
61
|
}
|
|
61
62
|
) }),
|
|
62
|
-
s ? /* @__PURE__ */ t(s, { src:
|
|
63
|
+
s ? /* @__PURE__ */ t(s, { src: h || "" }) : /* @__PURE__ */ t(T, { src: h || "" }),
|
|
63
64
|
/* @__PURE__ */ i(a, { className: e["chat-header__info"], children: [
|
|
64
65
|
/* @__PURE__ */ i(a, { className: e["chat-header__title"], children: [
|
|
65
66
|
u,
|
|
@@ -82,5 +83,5 @@ import '../../../styles/ChatHeaderUI.css';const e = {
|
|
|
82
83
|
);
|
|
83
84
|
};
|
|
84
85
|
export {
|
|
85
|
-
|
|
86
|
+
L as default
|
|
86
87
|
};
|
|
@@ -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/
|
|
5
|
+
import '../../styles/index.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 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-
|
|
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-
|
|
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,
|
|
@@ -4,7 +4,7 @@ import { Icon as B } from "../Icon/Icon.js";
|
|
|
4
4
|
import { IconTypes as D } from "../Icon/type.js";
|
|
5
5
|
import { Popup as H } from "../Popup/index.js";
|
|
6
6
|
import { usePluginsElement as L } from "./hooks/usePluginsElement.js";
|
|
7
|
-
import '../../styles/
|
|
7
|
+
import '../../styles/index3.css';function M(g, f) {
|
|
8
8
|
const {
|
|
9
9
|
plugins: N = [],
|
|
10
10
|
showNumber: x,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as f, Fragment as P } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as I, useState as x, useLayoutEffect as h } from "react";
|
|
3
|
-
import '../../styles/
|
|
3
|
+
import '../../styles/index4.css';function N(g) {
|
|
4
4
|
const {
|
|
5
5
|
show: o,
|
|
6
6
|
close: c,
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { jsx as o, Fragment as n } from "react/jsx-runtime";
|
|
2
2
|
import p from "react";
|
|
3
3
|
import { MyProfile as P } from "./myProfile/MyProfile.js";
|
|
4
|
-
import { useMyProfile as
|
|
5
|
-
import { TUIProfileDefault as
|
|
6
|
-
import {
|
|
7
|
-
import "@tencentcloud/chat-uikit-engine";
|
|
8
|
-
import "../../ChatSetting-C7QlwAiq.js";
|
|
4
|
+
import { useMyProfile as s } from "./hooks/useMyProfile.js";
|
|
5
|
+
import { TUIProfileDefault as a } from "./ProfileDefault.js";
|
|
6
|
+
import { i as c } from "../../ChatSetting-BtQwjHr0.js";
|
|
9
7
|
import "@tencentcloud/uikit-base-component-react";
|
|
8
|
+
import "@tencentcloud/chat-uikit-engine";
|
|
10
9
|
import "@tencentcloud/tui-core";
|
|
11
|
-
import
|
|
10
|
+
import "@tencentcloud/chat";
|
|
11
|
+
import '../../styles/Profile.css';function u(i) {
|
|
12
12
|
const {
|
|
13
|
-
className:
|
|
14
|
-
TUIProfile:
|
|
15
|
-
} = i, { myProfile: r, updateMyProfile:
|
|
16
|
-
return /* @__PURE__ */ o(n, { children:
|
|
17
|
-
|
|
13
|
+
className: t,
|
|
14
|
+
TUIProfile: f
|
|
15
|
+
} = i, { myProfile: r, updateMyProfile: m } = s(), { setProfileOpen: l, isProfileOpen: e } = c();
|
|
16
|
+
return /* @__PURE__ */ o(n, { children: e ? /* @__PURE__ */ o(
|
|
17
|
+
f || a,
|
|
18
18
|
{
|
|
19
|
-
className:
|
|
19
|
+
className: t,
|
|
20
20
|
userInfo: r,
|
|
21
|
-
update:
|
|
21
|
+
update: m
|
|
22
22
|
}
|
|
23
23
|
) : /* @__PURE__ */ o(
|
|
24
24
|
P,
|
|
25
25
|
{
|
|
26
26
|
profile: r,
|
|
27
27
|
handleAvatar: () => {
|
|
28
|
-
|
|
28
|
+
l(!e);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
) });
|
|
32
32
|
}
|
|
33
|
-
const
|
|
33
|
+
const g = p.memo(u);
|
|
34
34
|
export {
|
|
35
|
-
|
|
35
|
+
g as Profile
|
|
36
36
|
};
|
|
@@ -2,16 +2,16 @@ 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 {
|
|
5
|
+
import { i as G, V as B } from "../../ChatSetting-BtQwjHr0.js";
|
|
6
6
|
import "@tencentcloud/tui-core";
|
|
7
|
-
import
|
|
8
|
-
import { DivWithEdit as
|
|
7
|
+
import "@tencentcloud/chat";
|
|
8
|
+
import { DivWithEdit as L } from "../DivWithEdit/DivWithEdit.js";
|
|
9
9
|
import { DatePicker as z } from "./DatePicker/DatePicker.js";
|
|
10
10
|
const c = {
|
|
11
11
|
[a.TYPES.GENDER_UNKNOWN]: "Unknown",
|
|
12
12
|
[a.TYPES.GENDER_MALE]: "male",
|
|
13
13
|
[a.TYPES.GENDER_FEMALE]: "female"
|
|
14
|
-
},
|
|
14
|
+
}, h = {
|
|
15
15
|
[a.TYPES.ALLOW_TYPE_ALLOW_ANY]: "allowAny",
|
|
16
16
|
[a.TYPES.ALLOW_TYPE_NEED_CONFIRM]: "needConfirm",
|
|
17
17
|
[a.TYPES.ALLOW_TYPE_DENY_ANY]: "denyAny"
|
|
@@ -42,43 +42,43 @@ const c = {
|
|
|
42
42
|
value: a.TYPES.ALLOW_TYPE_DENY_ANY
|
|
43
43
|
}
|
|
44
44
|
];
|
|
45
|
-
function K(
|
|
46
|
-
var
|
|
45
|
+
function K(p) {
|
|
46
|
+
var P, _, D, Y, b, A;
|
|
47
47
|
const {
|
|
48
48
|
userInfo: e,
|
|
49
|
-
className:
|
|
49
|
+
className: S,
|
|
50
50
|
update: y
|
|
51
|
-
} =
|
|
51
|
+
} = p, { t: r } = R(), { setProfileOpen: f } = G(), [T, o] = x(""), $ = (t) => {
|
|
52
52
|
const l = String(t);
|
|
53
53
|
if (l.length === 8) {
|
|
54
54
|
const n = l.substring(0, 4), d = l.substring(4, 6), O = l.substring(6, 8);
|
|
55
55
|
return `${n}/${d}/${O}`;
|
|
56
56
|
}
|
|
57
57
|
return `${t}`;
|
|
58
|
-
},
|
|
58
|
+
}, v = (t) => {
|
|
59
59
|
if ((t == null ? void 0 : t.length) === 8) {
|
|
60
60
|
const l = Number(t.slice(0, 4)), n = Number(t.slice(4, 6)), d = Number(t.slice(-2));
|
|
61
61
|
return new Date(l, n - 1, d);
|
|
62
62
|
}
|
|
63
63
|
return /* @__PURE__ */ new Date();
|
|
64
|
-
},
|
|
64
|
+
}, k = (t) => {
|
|
65
65
|
const l = t.getDate() > 9 ? t.getDate() : `0${t.getDate()}`, n = t.getMonth() > 8 ? t.getMonth() + 1 : `0${t.getMonth() + 1}`;
|
|
66
66
|
return `${t.getFullYear()}${n}${l}`;
|
|
67
|
-
},
|
|
67
|
+
}, u = (t) => {
|
|
68
68
|
o(t);
|
|
69
69
|
}, m = (t) => {
|
|
70
70
|
y && y(t), o("");
|
|
71
|
-
},
|
|
71
|
+
}, U = (t) => {
|
|
72
72
|
m({ gender: t.value });
|
|
73
73
|
}, w = (t) => {
|
|
74
74
|
m({ allowType: t.value });
|
|
75
75
|
};
|
|
76
|
-
function
|
|
76
|
+
function C(t) {
|
|
77
77
|
m({
|
|
78
|
-
birthday: Number(
|
|
78
|
+
birthday: Number(k(t))
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
|
-
const
|
|
81
|
+
const g = (t) => {
|
|
82
82
|
let l = "";
|
|
83
83
|
switch (t == null ? void 0 : t.name) {
|
|
84
84
|
case "nick":
|
|
@@ -95,7 +95,7 @@ function K(h) {
|
|
|
95
95
|
[l]: t.value
|
|
96
96
|
};
|
|
97
97
|
m(n);
|
|
98
|
-
},
|
|
98
|
+
}, M = [
|
|
99
99
|
{
|
|
100
100
|
name: "Signature",
|
|
101
101
|
value: e == null ? void 0 : e.selfSignature,
|
|
@@ -106,10 +106,10 @@ function K(h) {
|
|
|
106
106
|
name: "Gender",
|
|
107
107
|
value: r(e != null && e.gender && ((_ = c[e == null ? void 0 : e.gender]) != null && _.replace(
|
|
108
108
|
c[e == null ? void 0 : e.gender][0],
|
|
109
|
-
(
|
|
109
|
+
(P = c[e == null ? void 0 : e.gender][0]) == null ? void 0 : P.toLocaleUpperCase()
|
|
110
110
|
)) ? `TUIProfile.${(Y = c[e == null ? void 0 : e.gender]) == null ? void 0 : Y.replace(
|
|
111
111
|
c[e == null ? void 0 : e.gender][0],
|
|
112
|
-
(
|
|
112
|
+
(D = c[e == null ? void 0 : e.gender][0]) == null ? void 0 : D.toLocaleUpperCase()
|
|
113
113
|
)}` : ""),
|
|
114
114
|
type: "select",
|
|
115
115
|
children: /* @__PURE__ */ i("ul", { className: "select-list", children: E == null ? void 0 : E.map((t, l) => {
|
|
@@ -121,7 +121,7 @@ function K(h) {
|
|
|
121
121
|
role: "menuitem",
|
|
122
122
|
tabIndex: l,
|
|
123
123
|
onClick: () => {
|
|
124
|
-
|
|
124
|
+
U(t);
|
|
125
125
|
},
|
|
126
126
|
children: r(`TUIProfile.${t.label}`)
|
|
127
127
|
},
|
|
@@ -131,9 +131,9 @@ function K(h) {
|
|
|
131
131
|
},
|
|
132
132
|
{
|
|
133
133
|
name: "AllowType",
|
|
134
|
-
value: r(`TUIProfile.${(
|
|
135
|
-
e &&
|
|
136
|
-
e && ((b =
|
|
134
|
+
value: r(`TUIProfile.${(A = h[(e == null ? void 0 : e.allowType) || ""]) == null ? void 0 : A.replace(
|
|
135
|
+
e && h[e == null ? void 0 : e.allowType][0],
|
|
136
|
+
e && ((b = h[e == null ? void 0 : e.allowType][0]) == null ? void 0 : b.toLocaleUpperCase())
|
|
137
137
|
)}`),
|
|
138
138
|
type: "select",
|
|
139
139
|
children: /* @__PURE__ */ i("ul", { className: "select-list", children: N == null ? void 0 : N.map((t, l) => {
|
|
@@ -155,7 +155,7 @@ function K(h) {
|
|
|
155
155
|
},
|
|
156
156
|
{
|
|
157
157
|
name: "Birthday",
|
|
158
|
-
value: e != null && e.birthday ?
|
|
158
|
+
value: e != null && e.birthday ? $(e.birthday) : "",
|
|
159
159
|
type: "select",
|
|
160
160
|
children: /* @__PURE__ */ i(
|
|
161
161
|
z,
|
|
@@ -163,19 +163,19 @@ function K(h) {
|
|
|
163
163
|
className: "tui-profile-birthday",
|
|
164
164
|
isOpen: !0,
|
|
165
165
|
format: "y-MM-dd",
|
|
166
|
-
onChange:
|
|
167
|
-
value:
|
|
166
|
+
onChange: C,
|
|
167
|
+
value: v(`${e == null ? void 0 : e.birthday}`)
|
|
168
168
|
}
|
|
169
169
|
)
|
|
170
170
|
}
|
|
171
171
|
];
|
|
172
|
-
return /* @__PURE__ */ s("div", { className: `${
|
|
172
|
+
return /* @__PURE__ */ s("div", { className: `${S} tui-profile`, children: [
|
|
173
173
|
/* @__PURE__ */ s(
|
|
174
174
|
"header",
|
|
175
175
|
{
|
|
176
176
|
className: "tui-profile-header",
|
|
177
177
|
onClick: () => {
|
|
178
|
-
|
|
178
|
+
f(!1);
|
|
179
179
|
},
|
|
180
180
|
children: [
|
|
181
181
|
/* @__PURE__ */ i(F, { size: "24px" }),
|
|
@@ -185,22 +185,22 @@ function K(h) {
|
|
|
185
185
|
),
|
|
186
186
|
/* @__PURE__ */ s("main", { className: "tui-profile-main", children: [
|
|
187
187
|
/* @__PURE__ */ i("div", { className: "tui-profile-avatar", children: /* @__PURE__ */ i(
|
|
188
|
-
|
|
188
|
+
B,
|
|
189
189
|
{
|
|
190
190
|
src: (e == null ? void 0 : e.avatar) || "",
|
|
191
191
|
size: "xl"
|
|
192
192
|
}
|
|
193
193
|
) }),
|
|
194
194
|
/* @__PURE__ */ i(
|
|
195
|
-
|
|
195
|
+
L,
|
|
196
196
|
{
|
|
197
197
|
name: "nick",
|
|
198
198
|
className: "tui-profile-nick",
|
|
199
199
|
value: e == null ? void 0 : e.nick,
|
|
200
200
|
type: "text",
|
|
201
|
-
toggle:
|
|
202
|
-
isEdit:
|
|
203
|
-
confirm:
|
|
201
|
+
toggle: u,
|
|
202
|
+
isEdit: T === "nick",
|
|
203
|
+
confirm: g,
|
|
204
204
|
close: () => {
|
|
205
205
|
o("");
|
|
206
206
|
}
|
|
@@ -211,21 +211,21 @@ function K(h) {
|
|
|
211
211
|
/* @__PURE__ */ i("span", { children: e == null ? void 0 : e.userID })
|
|
212
212
|
] })
|
|
213
213
|
] }),
|
|
214
|
-
/* @__PURE__ */ i("ul", { className: "tui-profile-list", children:
|
|
214
|
+
/* @__PURE__ */ i("ul", { className: "tui-profile-list", children: M.map((t) => {
|
|
215
215
|
const l = `${t.name}`;
|
|
216
216
|
return /* @__PURE__ */ s("li", { className: "tui-profile-list-item", children: [
|
|
217
217
|
/* @__PURE__ */ i("h4", { children: r(`TUIProfile.${t.name}`) }),
|
|
218
218
|
/* @__PURE__ */ i(
|
|
219
|
-
|
|
219
|
+
L,
|
|
220
220
|
{
|
|
221
221
|
className: "tui-profile-div-with-edit",
|
|
222
222
|
classEditName: "tui-profile-edit",
|
|
223
223
|
name: t.name,
|
|
224
224
|
value: t.value,
|
|
225
225
|
type: t.type,
|
|
226
|
-
toggle:
|
|
227
|
-
isEdit:
|
|
228
|
-
confirm:
|
|
226
|
+
toggle: u,
|
|
227
|
+
isEdit: T === t.name,
|
|
228
|
+
confirm: g,
|
|
229
229
|
close: () => {
|
|
230
230
|
o("");
|
|
231
231
|
},
|
|
@@ -237,8 +237,8 @@ function K(h) {
|
|
|
237
237
|
] });
|
|
238
238
|
}
|
|
239
239
|
const j = W.memo(K);
|
|
240
|
-
function te(
|
|
241
|
-
const e = { ...
|
|
240
|
+
function te(p) {
|
|
241
|
+
const e = { ...p };
|
|
242
242
|
return /* @__PURE__ */ i(j, { ...e });
|
|
243
243
|
}
|
|
244
244
|
export {
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { defaultUserAvatar as
|
|
3
|
-
import {
|
|
4
|
-
import { IconHorizontalMoreTwo as
|
|
2
|
+
import { defaultUserAvatar as s } from "../../../constant/avatar.js";
|
|
3
|
+
import { V as t } from "../../../ChatSetting-BtQwjHr0.js";
|
|
4
|
+
import { IconHorizontalMoreTwo as c } from "@tencentcloud/uikit-base-component-react";
|
|
5
5
|
import "@tencentcloud/chat-uikit-engine";
|
|
6
6
|
import "@tencentcloud/tui-core";
|
|
7
7
|
import "react";
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import "@tencentcloud/chat";
|
|
9
|
+
import '../../../styles/MyProfile.css';function N(a) {
|
|
10
|
+
const { profile: r, className: m = "", handleAvatar: i } = a;
|
|
11
|
+
return ((r == null ? void 0 : r.nick) || (r == null ? void 0 : r.userID)) && /* @__PURE__ */ e("div", { className: `profile ${m}`, children: [
|
|
11
12
|
/* @__PURE__ */ e("div", { className: "profile-content", onClick: i, children: [
|
|
12
|
-
/* @__PURE__ */ o(
|
|
13
|
+
/* @__PURE__ */ o(t, { src: r.avatar || s }),
|
|
13
14
|
/* @__PURE__ */ o("div", { className: "profile-name", children: r.nick || r.userID })
|
|
14
15
|
] }),
|
|
15
|
-
/* @__PURE__ */ o("div", { className: "profile-more", onClick: i, children: /* @__PURE__ */ o(
|
|
16
|
+
/* @__PURE__ */ o("div", { className: "profile-more", onClick: i, children: /* @__PURE__ */ o(c, { size: "24px" }) })
|
|
16
17
|
] });
|
|
17
18
|
}
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
+
N as MyProfile
|
|
20
21
|
};
|