@tencentcloud/chat-uikit-react 3.0.3 → 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.
- package/.eslintrc.cjs +5 -4
- package/CHANGELOG.md +9 -0
- package/dist/components/Chat/Chat.d.ts +1 -1
- package/dist/components/Chat/Chat.js +18 -23
- package/dist/components/ChatHeader/AudioCallPicker/AudioCallPicker.d.ts +30 -0
- package/dist/components/ChatHeader/AudioCallPicker/AudioCallPicker.js +135 -0
- package/dist/components/ChatHeader/AudioCallPicker/index.d.ts +1 -0
- package/dist/components/ChatHeader/AudioCallPicker/index.js +4 -0
- package/dist/components/ChatHeader/ChatHeader.d.ts +6 -0
- package/dist/components/ChatHeader/ChatHeader.js +43 -41
- package/dist/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.d.ts +12 -7
- package/dist/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.js +47 -65
- package/dist/components/ChatHeader/VideoCallPicker/VideoCallPicker.d.ts +30 -0
- package/dist/components/ChatHeader/VideoCallPicker/VideoCallPicker.js +135 -0
- package/dist/components/ChatHeader/VideoCallPicker/index.d.ts +1 -0
- package/dist/components/ChatHeader/VideoCallPicker/index.js +4 -0
- package/dist/components/ChatHeader/index.d.ts +2 -1
- package/dist/components/ChatHeader/index.js +4 -2
- package/dist/components/Checkbox/index.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.js +20 -22
- package/dist/components/Profile/ProfileDefault.d.ts +3 -2
- package/dist/components/Profile/ProfileDefault.js +55 -56
- package/dist/components/Profile/hooks/useMyProfile.d.ts +2 -3
- package/dist/components/Profile/hooks/useMyProfile.js +1 -1
- package/dist/components/Profile/myProfile/MyProfile.d.ts +1 -1
- package/dist/components/Profile/myProfile/MyProfile.js +12 -16
- package/dist/components/index.js +27 -25
- package/dist/context/ChatContext.d.ts +1 -1
- package/dist/context/ChatContext.js +11 -16
- package/dist/context/ContactContext.d.ts +1 -1
- package/dist/external_modules/mui-BhvHeL5-.js +2253 -0
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +2 -2
- package/dist/{states/ChatHeaderState.d.ts → hooks/useChatHeader.d.ts} +6 -6
- package/dist/hooks/useChatHeader.js +41 -0
- package/dist/index-UBuvRM8r-DTXQB6zV.js +34000 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +93 -4133
- package/dist/server/mainServer.js +2 -2
- package/dist/states/UIManagerState.d.ts +5 -5
- package/dist/states/UIManagerState.js +2 -2
- package/dist/states/index.d.ts +0 -1
- package/dist/states/index.js +2 -4
- package/dist/styles/AudioCallPicker.css +1 -0
- package/dist/styles/ChatHeaderUI.css +1 -1
- package/dist/styles/VideoCallPicker.css +1 -0
- package/dist/styles/index-UBuvRM8r.css +1 -0
- 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/dist/types/message.d.ts +1 -1
- package/dist/types/user.d.ts +4 -4
- package/package.json +12 -20
- package/src/components/ChatHeader/AudioCallPicker/AudioCallPicker.module.scss +57 -0
- package/src/components/ChatHeader/AudioCallPicker/AudioCallPicker.tsx +234 -0
- package/src/components/ChatHeader/AudioCallPicker/index.ts +1 -0
- package/src/components/ChatHeader/ChatHeader.tsx +15 -3
- package/src/components/ChatHeader/ChatHeaderUI/ChatHeaderUI.tsx +29 -36
- package/src/components/ChatHeader/VideoCallPicker/VideoCallPicker.module.scss +57 -0
- package/src/components/ChatHeader/VideoCallPicker/VideoCallPicker.tsx +233 -0
- package/src/components/ChatHeader/VideoCallPicker/index.ts +1 -0
- package/src/components/ChatHeader/index.ts +2 -1
- package/src/components/Profile/Profile.tsx +7 -6
- package/src/components/Profile/ProfileDefault.tsx +8 -8
- package/src/components/Profile/hooks/useMyProfile.tsx +2 -3
- package/src/components/Profile/myProfile/MyProfile.tsx +1 -1
- package/src/context/ChatContext.tsx +1 -1
- package/src/context/ContactContext.tsx +1 -1
- package/src/hooks/index.ts +2 -2
- package/src/{states/ChatHeaderState.ts → hooks/useChatHeader.ts} +15 -17
- package/src/index.ts +3 -5
- package/src/server/mainServer.ts +2 -2
- package/src/states/UIManagerState.ts +9 -9
- package/src/states/index.ts +0 -2
- package/src/styles/index.scss +0 -1
- package/src/types/message.ts +1 -1
- package/src/types/user.ts +4 -4
- package/vite.config.ts +4 -25
- package/dist/ChatSetting-LYkP2NWu.js +0 -29890
- package/dist/assets/fonts/iconfont.ttf +0 -0
- package/dist/assets/fonts/iconfont.woff +0 -0
- package/dist/assets/fonts/iconfont.woff2 +0 -0
- package/dist/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.d.ts +0 -11
- package/dist/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.js +0 -79
- package/dist/components/ChatHeader/ChatHeaderActions/index.d.ts +0 -1
- package/dist/components/ChatHeader/ChatHeaderActions/index.js +0 -4
- package/dist/components/IconFont/Icon.d.ts +0 -21
- package/dist/components/IconFont/Icon.js +0 -47
- package/dist/components/IconFont/index.d.ts +0 -2
- package/dist/components/IconFont/index.js +0 -4
- package/dist/external_modules/lodash-vwDjcXxQ.js +0 -0
- package/dist/external_modules/mui-BcA3SBHM.js +0 -2473
- package/dist/states/ChatHeaderState.js +0 -46
- package/dist/styles/ChatHeaderActions.css +0 -1
- package/dist/styles/ChatSetting.css +0 -1
- package/dist/styles/Icon2.css +0 -1
- package/src/assets/fonts/iconfont.ttf +0 -0
- package/src/assets/fonts/iconfont.woff +0 -0
- package/src/assets/fonts/iconfont.woff2 +0 -0
- package/src/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.module.scss +0 -44
- package/src/components/ChatHeader/ChatHeaderActions/ChatHeaderActions.tsx +0 -105
- package/src/components/ChatHeader/ChatHeaderActions/index.ts +0 -1
- package/src/components/IconFont/Icon.module.scss +0 -42
- package/src/components/IconFont/Icon.tsx +0 -68
- package/src/components/IconFont/index.ts +0 -3
- package/src/styles/fonts/icon-font.scss +0 -18
|
@@ -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';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ChatHeader as o } from "./ChatHeader.js";
|
|
2
|
-
import {
|
|
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
|
-
|
|
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/
|
|
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-
|
|
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,
|
|
@@ -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/index4.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/index5.css';function N(g) {
|
|
4
4
|
const {
|
|
5
5
|
show: o,
|
|
6
6
|
close: c,
|
|
@@ -1,36 +1,34 @@
|
|
|
1
|
-
import { jsx as o, Fragment as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as o, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import s, { useState as a } from "react";
|
|
3
|
+
import { useMyProfile as p } from "./hooks/useMyProfile.js";
|
|
3
4
|
import { MyProfile as P } from "./myProfile/MyProfile.js";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { i as c } from "../../ChatSetting-LYkP2NWu.js";
|
|
7
|
-
import "@tencentcloud/uikit-base-component-react";
|
|
8
|
-
import "@tencentcloud/chat-uikit-engine";
|
|
9
|
-
import "@tencentcloud/tui-core";
|
|
10
|
-
import "@tencentcloud/chat";
|
|
11
|
-
import '../../styles/Profile.css';function u(i) {
|
|
5
|
+
import { TUIProfileDefault as c } from "./ProfileDefault.js";
|
|
6
|
+
import '../../styles/Profile.css';function u(t) {
|
|
12
7
|
const {
|
|
13
|
-
className:
|
|
14
|
-
TUIProfile:
|
|
15
|
-
} =
|
|
16
|
-
return /* @__PURE__ */ o(
|
|
17
|
-
|
|
8
|
+
className: i,
|
|
9
|
+
TUIProfile: l
|
|
10
|
+
} = t, { myProfile: e, updateMyProfile: n } = p(), [r, f] = a(!1);
|
|
11
|
+
return /* @__PURE__ */ o(m, { children: r ? /* @__PURE__ */ o(
|
|
12
|
+
l || c,
|
|
18
13
|
{
|
|
19
|
-
className:
|
|
20
|
-
userInfo:
|
|
21
|
-
update:
|
|
14
|
+
className: i,
|
|
15
|
+
userInfo: e,
|
|
16
|
+
update: n,
|
|
17
|
+
onClose: () => {
|
|
18
|
+
f(!1);
|
|
19
|
+
}
|
|
22
20
|
}
|
|
23
21
|
) : /* @__PURE__ */ o(
|
|
24
22
|
P,
|
|
25
23
|
{
|
|
26
|
-
profile:
|
|
24
|
+
profile: e,
|
|
27
25
|
handleAvatar: () => {
|
|
28
|
-
|
|
26
|
+
f(!r);
|
|
29
27
|
}
|
|
30
28
|
}
|
|
31
29
|
) });
|
|
32
30
|
}
|
|
33
|
-
const
|
|
31
|
+
const C = s.memo(u);
|
|
34
32
|
export {
|
|
35
|
-
|
|
33
|
+
C as Profile
|
|
36
34
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { Profile } from '@tencentcloud/chat';
|
|
3
|
-
import { UpdateMyProfileParams } from '@tencentcloud/chat-uikit-engine';
|
|
2
|
+
import { Profile } from '@tencentcloud/lite-chat';
|
|
3
|
+
import { UpdateMyProfileParams } from '@tencentcloud/chat-uikit-engine-lite';
|
|
4
4
|
export interface TUIProfileDefaultProps {
|
|
5
5
|
userInfo?: Profile | undefined;
|
|
6
6
|
update?: ((option: UpdateMyProfileParams) => void) | undefined;
|
|
7
|
+
onClose?: () => void;
|
|
7
8
|
className?: string | undefined;
|
|
8
9
|
}
|
|
9
10
|
export declare function TUIProfileDefault(props: TUIProfileDefaultProps): React.ReactElement;
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import { jsx as i, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import W, { useState as x } from "react";
|
|
3
|
-
import a from "@tencentcloud/chat-uikit-engine";
|
|
3
|
+
import a from "@tencentcloud/chat-uikit-engine-lite";
|
|
4
4
|
import { useUIKit as R, IconChevronLeft as F } from "@tencentcloud/uikit-base-component-react";
|
|
5
|
-
import {
|
|
6
|
-
import "
|
|
7
|
-
import "
|
|
8
|
-
import { DivWithEdit as L } from "../DivWithEdit/DivWithEdit.js";
|
|
9
|
-
import { DatePicker as z } from "./DatePicker/DatePicker.js";
|
|
5
|
+
import { A as G } from "../../index-UBuvRM8r-DTXQB6zV.js";
|
|
6
|
+
import { DivWithEdit as S } from "../DivWithEdit/DivWithEdit.js";
|
|
7
|
+
import { DatePicker as B } from "./DatePicker/DatePicker.js";
|
|
10
8
|
const c = {
|
|
11
9
|
[a.TYPES.GENDER_UNKNOWN]: "Unknown",
|
|
12
10
|
[a.TYPES.GENDER_MALE]: "male",
|
|
13
11
|
[a.TYPES.GENDER_FEMALE]: "female"
|
|
14
|
-
},
|
|
12
|
+
}, E = {
|
|
15
13
|
[a.TYPES.ALLOW_TYPE_ALLOW_ANY]: "allowAny",
|
|
16
14
|
[a.TYPES.ALLOW_TYPE_NEED_CONFIRM]: "needConfirm",
|
|
17
15
|
[a.TYPES.ALLOW_TYPE_DENY_ANY]: "denyAny"
|
|
18
|
-
},
|
|
16
|
+
}, N = [
|
|
19
17
|
{
|
|
20
18
|
label: "Unknown",
|
|
21
19
|
value: a.TYPES.GENDER_UNKNOWN
|
|
@@ -28,7 +26,7 @@ const c = {
|
|
|
28
26
|
label: "Female",
|
|
29
27
|
value: a.TYPES.GENDER_FEMALE
|
|
30
28
|
}
|
|
31
|
-
],
|
|
29
|
+
], y = [
|
|
32
30
|
{
|
|
33
31
|
label: "AllowAny",
|
|
34
32
|
value: a.TYPES.ALLOW_TYPE_ALLOW_ANY
|
|
@@ -42,43 +40,44 @@ const c = {
|
|
|
42
40
|
value: a.TYPES.ALLOW_TYPE_DENY_ANY
|
|
43
41
|
}
|
|
44
42
|
];
|
|
45
|
-
function
|
|
46
|
-
var
|
|
43
|
+
function z(h) {
|
|
44
|
+
var _, A, D, Y, b, L;
|
|
47
45
|
const {
|
|
48
46
|
userInfo: e,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
update: T,
|
|
48
|
+
onClose: p,
|
|
49
|
+
className: v
|
|
50
|
+
} = h, { t: r } = R(), [u, o] = x(""), $ = (t) => {
|
|
52
51
|
const l = String(t);
|
|
53
52
|
if (l.length === 8) {
|
|
54
|
-
const n = l.substring(0, 4),
|
|
55
|
-
return `${n}/${
|
|
53
|
+
const n = l.substring(0, 4), m = l.substring(4, 6), O = l.substring(6, 8);
|
|
54
|
+
return `${n}/${m}/${O}`;
|
|
56
55
|
}
|
|
57
56
|
return `${t}`;
|
|
58
|
-
},
|
|
57
|
+
}, f = (t) => {
|
|
59
58
|
if ((t == null ? void 0 : t.length) === 8) {
|
|
60
|
-
const l = Number(t.slice(0, 4)), n = Number(t.slice(4, 6)),
|
|
61
|
-
return new Date(l, n - 1,
|
|
59
|
+
const l = Number(t.slice(0, 4)), n = Number(t.slice(4, 6)), m = Number(t.slice(-2));
|
|
60
|
+
return new Date(l, n - 1, m);
|
|
62
61
|
}
|
|
63
62
|
return /* @__PURE__ */ new Date();
|
|
64
63
|
}, k = (t) => {
|
|
65
64
|
const l = t.getDate() > 9 ? t.getDate() : `0${t.getDate()}`, n = t.getMonth() > 8 ? t.getMonth() + 1 : `0${t.getMonth() + 1}`;
|
|
66
65
|
return `${t.getFullYear()}${n}${l}`;
|
|
67
|
-
},
|
|
66
|
+
}, g = (t) => {
|
|
68
67
|
o(t);
|
|
69
|
-
},
|
|
70
|
-
|
|
68
|
+
}, d = (t) => {
|
|
69
|
+
T && T(t), o("");
|
|
71
70
|
}, U = (t) => {
|
|
72
|
-
|
|
71
|
+
d({ gender: t.value });
|
|
73
72
|
}, w = (t) => {
|
|
74
|
-
|
|
73
|
+
d({ allowType: t.value });
|
|
75
74
|
};
|
|
76
|
-
function
|
|
77
|
-
|
|
75
|
+
function M(t) {
|
|
76
|
+
d({
|
|
78
77
|
birthday: Number(k(t))
|
|
79
78
|
});
|
|
80
79
|
}
|
|
81
|
-
const
|
|
80
|
+
const P = (t) => {
|
|
82
81
|
let l = "";
|
|
83
82
|
switch (t == null ? void 0 : t.name) {
|
|
84
83
|
case "nick":
|
|
@@ -94,8 +93,8 @@ function K(p) {
|
|
|
94
93
|
const n = {
|
|
95
94
|
[l]: t.value
|
|
96
95
|
};
|
|
97
|
-
|
|
98
|
-
},
|
|
96
|
+
d(n);
|
|
97
|
+
}, C = [
|
|
99
98
|
{
|
|
100
99
|
name: "Signature",
|
|
101
100
|
value: e == null ? void 0 : e.selfSignature,
|
|
@@ -104,15 +103,15 @@ function K(p) {
|
|
|
104
103
|
},
|
|
105
104
|
{
|
|
106
105
|
name: "Gender",
|
|
107
|
-
value: r(e != null && e.gender && ((
|
|
106
|
+
value: r(e != null && e.gender && ((A = c[e == null ? void 0 : e.gender]) != null && A.replace(
|
|
108
107
|
c[e == null ? void 0 : e.gender][0],
|
|
109
|
-
(
|
|
108
|
+
(_ = c[e == null ? void 0 : e.gender][0]) == null ? void 0 : _.toLocaleUpperCase()
|
|
110
109
|
)) ? `TUIProfile.${(Y = c[e == null ? void 0 : e.gender]) == null ? void 0 : Y.replace(
|
|
111
110
|
c[e == null ? void 0 : e.gender][0],
|
|
112
111
|
(D = c[e == null ? void 0 : e.gender][0]) == null ? void 0 : D.toLocaleUpperCase()
|
|
113
112
|
)}` : ""),
|
|
114
113
|
type: "select",
|
|
115
|
-
children: /* @__PURE__ */ i("ul", { className: "select-list", children:
|
|
114
|
+
children: /* @__PURE__ */ i("ul", { className: "select-list", children: N == null ? void 0 : N.map((t, l) => {
|
|
116
115
|
const n = `${t.value}${l}`;
|
|
117
116
|
return /* @__PURE__ */ i(
|
|
118
117
|
"li",
|
|
@@ -131,12 +130,12 @@ function K(p) {
|
|
|
131
130
|
},
|
|
132
131
|
{
|
|
133
132
|
name: "AllowType",
|
|
134
|
-
value: r(`TUIProfile.${(
|
|
135
|
-
e &&
|
|
136
|
-
e && ((b =
|
|
133
|
+
value: r(`TUIProfile.${(L = E[(e == null ? void 0 : e.allowType) || ""]) == null ? void 0 : L.replace(
|
|
134
|
+
e && E[e == null ? void 0 : e.allowType][0],
|
|
135
|
+
e && ((b = E[e == null ? void 0 : e.allowType][0]) == null ? void 0 : b.toLocaleUpperCase())
|
|
137
136
|
)}`),
|
|
138
137
|
type: "select",
|
|
139
|
-
children: /* @__PURE__ */ i("ul", { className: "select-list", children:
|
|
138
|
+
children: /* @__PURE__ */ i("ul", { className: "select-list", children: y == null ? void 0 : y.map((t, l) => {
|
|
140
139
|
const n = `${t.value}${l}`;
|
|
141
140
|
return /* @__PURE__ */ i(
|
|
142
141
|
"li",
|
|
@@ -158,24 +157,24 @@ function K(p) {
|
|
|
158
157
|
value: e != null && e.birthday ? $(e.birthday) : "",
|
|
159
158
|
type: "select",
|
|
160
159
|
children: /* @__PURE__ */ i(
|
|
161
|
-
|
|
160
|
+
B,
|
|
162
161
|
{
|
|
163
162
|
className: "tui-profile-birthday",
|
|
164
163
|
isOpen: !0,
|
|
165
164
|
format: "y-MM-dd",
|
|
166
|
-
onChange:
|
|
167
|
-
value:
|
|
165
|
+
onChange: M,
|
|
166
|
+
value: f(`${e == null ? void 0 : e.birthday}`)
|
|
168
167
|
}
|
|
169
168
|
)
|
|
170
169
|
}
|
|
171
170
|
];
|
|
172
|
-
return /* @__PURE__ */ s("div", { className: `${
|
|
171
|
+
return /* @__PURE__ */ s("div", { className: `${v} tui-profile`, children: [
|
|
173
172
|
/* @__PURE__ */ s(
|
|
174
173
|
"header",
|
|
175
174
|
{
|
|
176
175
|
className: "tui-profile-header",
|
|
177
176
|
onClick: () => {
|
|
178
|
-
|
|
177
|
+
p == null || p();
|
|
179
178
|
},
|
|
180
179
|
children: [
|
|
181
180
|
/* @__PURE__ */ i(F, { size: "24px" }),
|
|
@@ -185,22 +184,22 @@ function K(p) {
|
|
|
185
184
|
),
|
|
186
185
|
/* @__PURE__ */ s("main", { className: "tui-profile-main", children: [
|
|
187
186
|
/* @__PURE__ */ i("div", { className: "tui-profile-avatar", children: /* @__PURE__ */ i(
|
|
188
|
-
|
|
187
|
+
G,
|
|
189
188
|
{
|
|
190
189
|
src: (e == null ? void 0 : e.avatar) || "",
|
|
191
190
|
size: "xl"
|
|
192
191
|
}
|
|
193
192
|
) }),
|
|
194
193
|
/* @__PURE__ */ i(
|
|
195
|
-
|
|
194
|
+
S,
|
|
196
195
|
{
|
|
197
196
|
name: "nick",
|
|
198
197
|
className: "tui-profile-nick",
|
|
199
198
|
value: e == null ? void 0 : e.nick,
|
|
200
199
|
type: "text",
|
|
201
|
-
toggle:
|
|
202
|
-
isEdit:
|
|
203
|
-
confirm:
|
|
200
|
+
toggle: g,
|
|
201
|
+
isEdit: u === "nick",
|
|
202
|
+
confirm: P,
|
|
204
203
|
close: () => {
|
|
205
204
|
o("");
|
|
206
205
|
}
|
|
@@ -211,21 +210,21 @@ function K(p) {
|
|
|
211
210
|
/* @__PURE__ */ i("span", { children: e == null ? void 0 : e.userID })
|
|
212
211
|
] })
|
|
213
212
|
] }),
|
|
214
|
-
/* @__PURE__ */ i("ul", { className: "tui-profile-list", children:
|
|
213
|
+
/* @__PURE__ */ i("ul", { className: "tui-profile-list", children: C.map((t) => {
|
|
215
214
|
const l = `${t.name}`;
|
|
216
215
|
return /* @__PURE__ */ s("li", { className: "tui-profile-list-item", children: [
|
|
217
216
|
/* @__PURE__ */ i("h4", { children: r(`TUIProfile.${t.name}`) }),
|
|
218
217
|
/* @__PURE__ */ i(
|
|
219
|
-
|
|
218
|
+
S,
|
|
220
219
|
{
|
|
221
220
|
className: "tui-profile-div-with-edit",
|
|
222
221
|
classEditName: "tui-profile-edit",
|
|
223
222
|
name: t.name,
|
|
224
223
|
value: t.value,
|
|
225
224
|
type: t.type,
|
|
226
|
-
toggle:
|
|
227
|
-
isEdit:
|
|
228
|
-
confirm:
|
|
225
|
+
toggle: g,
|
|
226
|
+
isEdit: u === t.name,
|
|
227
|
+
confirm: P,
|
|
229
228
|
close: () => {
|
|
230
229
|
o("");
|
|
231
230
|
},
|
|
@@ -236,11 +235,11 @@ function K(p) {
|
|
|
236
235
|
}) })
|
|
237
236
|
] });
|
|
238
237
|
}
|
|
239
|
-
const
|
|
240
|
-
function
|
|
241
|
-
const e = { ...
|
|
242
|
-
return /* @__PURE__ */ i(
|
|
238
|
+
const K = W.memo(z);
|
|
239
|
+
function Z(h) {
|
|
240
|
+
const e = { ...h };
|
|
241
|
+
return /* @__PURE__ */ i(K, { ...e });
|
|
243
242
|
}
|
|
244
243
|
export {
|
|
245
|
-
|
|
244
|
+
Z as TUIProfileDefault
|
|
246
245
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { UpdateMyProfileParams } from '@tencentcloud/chat-uikit-engine';
|
|
1
|
+
import { UpdateMyProfileParams } from '@tencentcloud/chat-uikit-engine-lite';
|
|
3
2
|
export interface ProfileParams {
|
|
4
3
|
nick?: string;
|
|
5
4
|
avatar?: string;
|
|
@@ -16,6 +15,6 @@ export interface ProfileParams {
|
|
|
16
15
|
profileCustomField?: Array<any>;
|
|
17
16
|
}
|
|
18
17
|
export declare function useMyProfile(): {
|
|
19
|
-
myProfile:
|
|
18
|
+
myProfile: any;
|
|
20
19
|
updateMyProfile: (options: UpdateMyProfileParams) => void;
|
|
21
20
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState as i, useEffect as s } from "react";
|
|
2
|
-
import { TUIStore as u, StoreName as c, TUIUserService as n } from "@tencentcloud/chat-uikit-engine";
|
|
2
|
+
import { TUIStore as u, StoreName as c, TUIUserService as n } from "@tencentcloud/chat-uikit-engine-lite";
|
|
3
3
|
function P() {
|
|
4
4
|
const [r, o] = i(), t = (e) => {
|
|
5
5
|
n.updateMyProfile(e);
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { defaultUserAvatar as
|
|
3
|
-
import {
|
|
4
|
-
import { IconHorizontalMoreTwo as
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return ((r == null ? void 0 : r.nick) || (r == null ? void 0 : r.userID)) && /* @__PURE__ */ e("div", { className: `profile ${m}`, children: [
|
|
12
|
-
/* @__PURE__ */ e("div", { className: "profile-content", onClick: i, children: [
|
|
13
|
-
/* @__PURE__ */ o(t, { src: r.avatar || s }),
|
|
14
|
-
/* @__PURE__ */ o("div", { className: "profile-name", children: r.nick || r.userID })
|
|
1
|
+
import { jsxs as o, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { defaultUserAvatar as c } from "../../../constant/avatar.js";
|
|
3
|
+
import { A as n } from "../../../index-UBuvRM8r-DTXQB6zV.js";
|
|
4
|
+
import { IconHorizontalMoreTwo as l } from "@tencentcloud/uikit-base-component-react";
|
|
5
|
+
import '../../../styles/MyProfile.css';function v(i) {
|
|
6
|
+
const { profile: r, className: s = "", handleAvatar: e } = i;
|
|
7
|
+
return ((r == null ? void 0 : r.nick) || (r == null ? void 0 : r.userID)) && /* @__PURE__ */ o("div", { className: `profile ${s}`, children: [
|
|
8
|
+
/* @__PURE__ */ o("div", { className: "profile-content", onClick: e, children: [
|
|
9
|
+
/* @__PURE__ */ a(n, { src: r.avatar || c }),
|
|
10
|
+
/* @__PURE__ */ a("div", { className: "profile-name", children: r.nick || r.userID })
|
|
15
11
|
] }),
|
|
16
|
-
/* @__PURE__ */
|
|
12
|
+
/* @__PURE__ */ a("div", { className: "profile-more", onClick: e, children: /* @__PURE__ */ a(l, { size: "24px" }) })
|
|
17
13
|
] });
|
|
18
14
|
}
|
|
19
15
|
export {
|
|
20
|
-
|
|
16
|
+
v as MyProfile
|
|
21
17
|
};
|