@blocklet/ui-react 3.0.8 → 3.0.10
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/lib/BlockletStudio/index.js +70 -71
- package/lib/ComponentInstaller/index.js +85 -88
- package/lib/ComponentInstaller/installer-item.js +47 -53
- package/lib/ComponentInstaller/use-component-installed.js +32 -38
- package/lib/ComponentManager/components/add-component.js +47 -50
- package/lib/ComponentManager/components/publish-component.js +30 -31
- package/lib/ComponentManager/components/resource-dialog.js +28 -30
- package/lib/Dashboard/index.js +59 -61
- package/lib/Footer/index.js +51 -52
- package/lib/Footer/internal-footer.js +43 -47
- package/lib/Footer/layout/standard.js +11 -12
- package/lib/Footer/links.js +25 -28
- package/lib/Footer/social-media.js +17 -17
- package/lib/Header/index.js +81 -83
- package/lib/Notifications/Snackbar.js +76 -77
- package/lib/Notifications/hooks/use-title.js +34 -34
- package/lib/Notifications/utils.js +56 -60
- package/lib/UserCenter/components/config-inviter.js +17 -18
- package/lib/UserCenter/components/danger-zone.js +49 -52
- package/lib/UserCenter/components/nft.js +44 -45
- package/lib/UserCenter/components/notification.js +92 -99
- package/lib/UserCenter/components/passport.js +22 -22
- package/lib/UserCenter/components/privacy.js +6 -6
- package/lib/UserCenter/components/settings.js +40 -43
- package/lib/UserCenter/components/status-dialog/date-picker.js +7 -8
- package/lib/UserCenter/components/status-dialog/index.js +112 -114
- package/lib/UserCenter/components/status-selector/duration-menu.js +35 -36
- package/lib/UserCenter/components/status-selector/index.js +13 -13
- package/lib/UserCenter/components/storage/action.js +21 -22
- package/lib/UserCenter/components/storage/delete.js +24 -24
- package/lib/UserCenter/components/third-party-login/index.js +53 -53
- package/lib/UserCenter/components/third-party-login/third-party-item.js +87 -89
- package/lib/UserCenter/components/user-center.js +198 -207
- package/lib/UserCenter/components/user-info/metadata.js +343 -353
- package/lib/UserCenter/components/user-info/switch-role.js +17 -20
- package/lib/UserCenter/components/user-info/user-basic-info.js +79 -82
- package/lib/UserCenter/components/user-info/user-info.js +40 -40
- package/lib/UserCenter/components/user-info/user-status.js +97 -99
- package/lib/UserCenter/components/user-info/utils.js +34 -35
- package/lib/UserSessions/components/user-session-info.js +25 -28
- package/lib/UserSessions/components/user-sessions.js +169 -181
- package/lib/blocklets.js +62 -72
- package/lib/common/domain-warning.js +31 -31
- package/lib/common/header-addons.js +49 -53
- package/lib/common/notification-addon.js +29 -32
- package/lib/common/ws.js +17 -18
- package/lib/contexts/config-user-space.js +16 -19
- package/lib/utils.js +44 -48
- package/package.json +9 -9
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Alert as
|
|
3
|
-
import { useMemoizedFn as c, useReactive as
|
|
4
|
-
import { Icon as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import { jsx as o, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { Alert as z, Box as w, CircularProgress as R, Typography as A, Stack as T } from "@mui/material";
|
|
3
|
+
import { useMemoizedFn as c, useReactive as j, useRequest as F, useCreation as v } from "ahooks";
|
|
4
|
+
import { Icon as B } from "@iconify/react";
|
|
5
|
+
import E from "@iconify-icons/material-symbols/add-rounded";
|
|
6
|
+
import G from "@arcblock/ux/lib/Switch";
|
|
7
|
+
import L from "@arcblock/ux/lib/Button";
|
|
8
8
|
import f from "@arcblock/ux/lib/Toast";
|
|
9
|
-
import { getWalletDid as
|
|
10
|
-
import { translate as
|
|
11
|
-
import { useLocaleContext as
|
|
12
|
-
import
|
|
13
|
-
import { translations as
|
|
14
|
-
import
|
|
15
|
-
import { formatAxiosError as
|
|
16
|
-
import { client as
|
|
17
|
-
function
|
|
18
|
-
title:
|
|
19
|
-
description:
|
|
9
|
+
import { getWalletDid as C } from "@arcblock/ux/lib/SessionUser/libs/utils";
|
|
10
|
+
import { translate as M } from "@arcblock/ux/lib/Locale/util";
|
|
11
|
+
import { useLocaleContext as P } from "@arcblock/ux/lib/Locale/context";
|
|
12
|
+
import U from "@arcblock/ux/lib/DID";
|
|
13
|
+
import { translations as _ } from "../libs/locales.js";
|
|
14
|
+
import b from "./webhook-item.js";
|
|
15
|
+
import { formatAxiosError as S } from "../libs/utils.js";
|
|
16
|
+
import { client as g } from "../../libs/client.js";
|
|
17
|
+
function y({
|
|
18
|
+
title: i = void 0,
|
|
19
|
+
description: n = void 0,
|
|
20
20
|
value: m,
|
|
21
|
-
onChange:
|
|
22
|
-
isMobile:
|
|
21
|
+
onChange: a,
|
|
22
|
+
isMobile: s
|
|
23
23
|
}) {
|
|
24
|
-
const
|
|
24
|
+
const r = c((l) => {
|
|
25
25
|
l.stopPropagation();
|
|
26
26
|
});
|
|
27
27
|
return /* @__PURE__ */ h(
|
|
@@ -33,23 +33,23 @@ function g({
|
|
|
33
33
|
gap: 1
|
|
34
34
|
},
|
|
35
35
|
children: [
|
|
36
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ o(G, { checked: m, size: "small", onChange: a }),
|
|
37
37
|
/* @__PURE__ */ h(
|
|
38
|
-
|
|
38
|
+
A,
|
|
39
39
|
{
|
|
40
|
-
onClick:
|
|
40
|
+
onClick: r,
|
|
41
41
|
sx: {
|
|
42
42
|
color: "text.primary",
|
|
43
43
|
fontSize: 14,
|
|
44
44
|
display: "flex",
|
|
45
|
-
flexWrap:
|
|
45
|
+
flexWrap: s ? "wrap" : "nowrap",
|
|
46
46
|
columnGap: 1,
|
|
47
47
|
flex: 1,
|
|
48
|
-
whiteSpace:
|
|
48
|
+
whiteSpace: s ? "normal" : "nowrap"
|
|
49
49
|
},
|
|
50
50
|
children: [
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
i,
|
|
52
|
+
n
|
|
53
53
|
]
|
|
54
54
|
}
|
|
55
55
|
)
|
|
@@ -57,60 +57,53 @@ function g({
|
|
|
57
57
|
}
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
|
|
62
|
-
const { locale: m } = _(), i = c((e, o = {}) => U(q, e, m, "en", o)), n = B({
|
|
60
|
+
function ie({ user: i, isMobile: n }) {
|
|
61
|
+
const { locale: m } = P(), a = c((e, t = {}) => M(_, e, m, "en", t)), s = j({
|
|
63
62
|
showAdd: !1
|
|
64
|
-
}),
|
|
65
|
-
async () => await
|
|
63
|
+
}), r = F(
|
|
64
|
+
async () => await g.user.getUserNotificationConfig(),
|
|
66
65
|
{
|
|
67
|
-
refreshDeps: [
|
|
66
|
+
refreshDeps: [i],
|
|
68
67
|
loadingDelay: 300
|
|
69
68
|
}
|
|
70
|
-
), l =
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
...((e = t == null ? void 0 : t.data) == null ? void 0 : e.notifications) || {}
|
|
78
|
-
};
|
|
79
|
-
}, [(v = t == null ? void 0 : t.data) == null ? void 0 : v.notifications]), p = C(() => {
|
|
80
|
-
var e;
|
|
81
|
-
return ((e = t == null ? void 0 : t.data) == null ? void 0 : e.webhooks) || [];
|
|
82
|
-
}, [(b = t == null ? void 0 : t.data) == null ? void 0 : b.webhooks]), u = c(async (e) => {
|
|
69
|
+
), l = v(() => ({
|
|
70
|
+
wallet: !0,
|
|
71
|
+
email: !0,
|
|
72
|
+
phone: !1,
|
|
73
|
+
push: !0,
|
|
74
|
+
...r?.data?.notifications || {}
|
|
75
|
+
}), [r?.data?.notifications]), p = v(() => r?.data?.webhooks || [], [r?.data?.webhooks]), u = c(async (e) => {
|
|
83
76
|
try {
|
|
84
|
-
await
|
|
85
|
-
} catch (
|
|
86
|
-
f.error(
|
|
77
|
+
await g.user.saveUserNotificationConfig(e), f.success(a("saveSuccess")), r.run();
|
|
78
|
+
} catch (t) {
|
|
79
|
+
f.error(S(t));
|
|
87
80
|
}
|
|
88
|
-
}), x = c(async (e,
|
|
81
|
+
}), x = c(async (e, t) => {
|
|
89
82
|
await u({
|
|
90
83
|
notifications: {
|
|
91
|
-
[e]:
|
|
84
|
+
[e]: t
|
|
92
85
|
}
|
|
93
86
|
});
|
|
94
87
|
}), k = async (e) => {
|
|
95
88
|
try {
|
|
96
|
-
await
|
|
97
|
-
} catch (
|
|
98
|
-
f.error(
|
|
89
|
+
await g.user.testNotificationWebhook(e), f.success(a("webhookTested"));
|
|
90
|
+
} catch (t) {
|
|
91
|
+
f.error(S(t));
|
|
99
92
|
}
|
|
100
|
-
},
|
|
93
|
+
}, D = c(async (e) => {
|
|
101
94
|
await u({
|
|
102
|
-
webhooks: p.filter((
|
|
95
|
+
webhooks: p.filter((t, d) => d !== e)
|
|
103
96
|
});
|
|
104
|
-
}),
|
|
97
|
+
}), I = c(async (e, t) => {
|
|
105
98
|
await u({
|
|
106
|
-
webhooks: p.map((d,
|
|
99
|
+
webhooks: p.map((d, N) => N === e ? t : d)
|
|
107
100
|
});
|
|
108
|
-
}),
|
|
101
|
+
}), W = c(async (e) => {
|
|
109
102
|
await u({
|
|
110
103
|
webhooks: [...p, e]
|
|
111
|
-
}),
|
|
104
|
+
}), s.showAdd = !1;
|
|
112
105
|
});
|
|
113
|
-
return
|
|
106
|
+
return r.error ? /* @__PURE__ */ o(z, { severity: "error", children: r.error.message }) : r.loading || !r.data ? /* @__PURE__ */ o(
|
|
114
107
|
w,
|
|
115
108
|
{
|
|
116
109
|
sx: {
|
|
@@ -119,7 +112,7 @@ function ne({ user: a, isMobile: s }) {
|
|
|
119
112
|
alignItems: "center",
|
|
120
113
|
height: "100px"
|
|
121
114
|
},
|
|
122
|
-
children: /* @__PURE__ */
|
|
115
|
+
children: /* @__PURE__ */ o(R, {})
|
|
123
116
|
}
|
|
124
117
|
) : /* @__PURE__ */ h(w, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
125
118
|
/* @__PURE__ */ h(
|
|
@@ -158,54 +151,54 @@ function ne({ user: a, isMobile: s }) {
|
|
|
158
151
|
}
|
|
159
152
|
},
|
|
160
153
|
children: [
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
-
|
|
154
|
+
/* @__PURE__ */ o(
|
|
155
|
+
y,
|
|
163
156
|
{
|
|
164
157
|
value: l.wallet,
|
|
165
|
-
isMobile:
|
|
166
|
-
title:
|
|
158
|
+
isMobile: n,
|
|
159
|
+
title: a("walletNotification"),
|
|
167
160
|
onChange: (e) => x("wallet", e.target.checked),
|
|
168
|
-
description:
|
|
169
|
-
|
|
161
|
+
description: C(i) && /* @__PURE__ */ o(
|
|
162
|
+
U,
|
|
170
163
|
{
|
|
171
|
-
did:
|
|
164
|
+
did: C(i),
|
|
172
165
|
showQrcode: !1,
|
|
173
|
-
showAvatar: !
|
|
166
|
+
showAvatar: !n,
|
|
174
167
|
copyable: !0,
|
|
175
168
|
compact: !0,
|
|
176
169
|
responsive: !0,
|
|
177
170
|
locale: m,
|
|
178
|
-
startChars:
|
|
171
|
+
startChars: n ? 2 : 6
|
|
179
172
|
}
|
|
180
173
|
)
|
|
181
174
|
}
|
|
182
175
|
),
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
|
|
176
|
+
/* @__PURE__ */ o(
|
|
177
|
+
y,
|
|
185
178
|
{
|
|
186
179
|
value: l.email,
|
|
187
|
-
isMobile:
|
|
180
|
+
isMobile: n,
|
|
188
181
|
onChange: (e) => x("email", e.target.checked),
|
|
189
|
-
title:
|
|
190
|
-
description:
|
|
191
|
-
|
|
182
|
+
title: a("emailNotification"),
|
|
183
|
+
description: i?.email && /* @__PURE__ */ o(
|
|
184
|
+
A,
|
|
192
185
|
{
|
|
193
186
|
component: "span",
|
|
194
187
|
sx: {
|
|
195
188
|
color: "text.secondary",
|
|
196
189
|
fontSize: 13
|
|
197
190
|
},
|
|
198
|
-
children:
|
|
191
|
+
children: i?.email
|
|
199
192
|
}
|
|
200
193
|
)
|
|
201
194
|
}
|
|
202
195
|
),
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
-
|
|
196
|
+
/* @__PURE__ */ o(
|
|
197
|
+
y,
|
|
205
198
|
{
|
|
206
|
-
isMobile:
|
|
199
|
+
isMobile: n,
|
|
207
200
|
value: l.push,
|
|
208
|
-
title:
|
|
201
|
+
title: a("pushNotification"),
|
|
209
202
|
onChange: (e) => x("push", e.target.checked)
|
|
210
203
|
}
|
|
211
204
|
)
|
|
@@ -213,7 +206,7 @@ function ne({ user: a, isMobile: s }) {
|
|
|
213
206
|
}
|
|
214
207
|
),
|
|
215
208
|
/* @__PURE__ */ h(
|
|
216
|
-
|
|
209
|
+
T,
|
|
217
210
|
{
|
|
218
211
|
spacing: 1.5,
|
|
219
212
|
useFlexGap: !0,
|
|
@@ -222,32 +215,32 @@ function ne({ user: a, isMobile: s }) {
|
|
|
222
215
|
alignItems: "start"
|
|
223
216
|
},
|
|
224
217
|
children: [
|
|
225
|
-
p.map((e,
|
|
226
|
-
|
|
218
|
+
p.map((e, t) => /* @__PURE__ */ o(
|
|
219
|
+
b,
|
|
227
220
|
{
|
|
228
221
|
onTest: k,
|
|
229
|
-
onDelete: () =>
|
|
230
|
-
onSave: (...d) =>
|
|
222
|
+
onDelete: () => D(t),
|
|
223
|
+
onSave: (...d) => I(t, ...d),
|
|
231
224
|
type: e.type,
|
|
232
225
|
url: e.url,
|
|
233
226
|
edit: !1
|
|
234
227
|
},
|
|
235
|
-
`${
|
|
228
|
+
`${t}_${e.url}`
|
|
236
229
|
)),
|
|
237
|
-
|
|
238
|
-
|
|
230
|
+
s.showAdd && /* @__PURE__ */ o(
|
|
231
|
+
b,
|
|
239
232
|
{
|
|
240
233
|
onTest: k,
|
|
241
234
|
onCancel: () => {
|
|
242
|
-
|
|
235
|
+
s.showAdd = !1;
|
|
243
236
|
},
|
|
244
|
-
onSave: (...e) =>
|
|
237
|
+
onSave: (...e) => W(...e),
|
|
245
238
|
edit: !0
|
|
246
239
|
},
|
|
247
240
|
"add"
|
|
248
241
|
),
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
-
|
|
242
|
+
/* @__PURE__ */ o(
|
|
243
|
+
L,
|
|
251
244
|
{
|
|
252
245
|
variant: "outlined",
|
|
253
246
|
size: "small",
|
|
@@ -260,11 +253,11 @@ function ne({ user: a, isMobile: s }) {
|
|
|
260
253
|
py: 0.5,
|
|
261
254
|
borderRadius: 1
|
|
262
255
|
},
|
|
263
|
-
startIcon: /* @__PURE__ */
|
|
256
|
+
startIcon: /* @__PURE__ */ o(B, { icon: E }),
|
|
264
257
|
onClick: () => {
|
|
265
|
-
|
|
258
|
+
s.showAdd = !0;
|
|
266
259
|
},
|
|
267
|
-
children:
|
|
260
|
+
children: a("addWebhook")
|
|
268
261
|
}
|
|
269
262
|
)
|
|
270
263
|
]
|
|
@@ -273,5 +266,5 @@ function ne({ user: a, isMobile: s }) {
|
|
|
273
266
|
] });
|
|
274
267
|
}
|
|
275
268
|
export {
|
|
276
|
-
|
|
269
|
+
ie as default
|
|
277
270
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Box as
|
|
3
|
-
import
|
|
4
|
-
import { useTheme as
|
|
5
|
-
import
|
|
6
|
-
import { PASSPORT_STATUS as
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { Box as m } from "@mui/material";
|
|
3
|
+
import x from "@arcblock/ux/lib/Empty";
|
|
4
|
+
import { useTheme as y } from "@arcblock/ux/lib/Theme";
|
|
5
|
+
import g from "@arcblock/ux/lib/Passport";
|
|
6
|
+
import { PASSPORT_STATUS as h } from "@arcblock/ux/lib/Util/constant";
|
|
7
7
|
import { useMemoizedFn as C, useCreation as l } from "ahooks";
|
|
8
8
|
import f from "lodash/uniqBy";
|
|
9
9
|
import { translate as P } from "@arcblock/ux/lib/Locale/util";
|
|
@@ -11,23 +11,23 @@ import { useLocaleContext as k } from "@arcblock/ux/lib/Locale/context";
|
|
|
11
11
|
import { translations as v } from "../libs/locales.js";
|
|
12
12
|
import { createPassportSvg as S } from "../libs/utils.js";
|
|
13
13
|
function D({ user: o, ...a }) {
|
|
14
|
-
const { locale: c } = k(),
|
|
15
|
-
const
|
|
16
|
-
...
|
|
17
|
-
revoked:
|
|
14
|
+
const { locale: c } = k(), n = C((r, t = {}) => P(v, r, c, "en", t)), d = y(), e = l(() => {
|
|
15
|
+
const r = (o?.passports || []).map((t) => ({
|
|
16
|
+
...t,
|
|
17
|
+
revoked: t.status === h.REVOKED
|
|
18
18
|
}));
|
|
19
|
-
return
|
|
20
|
-
|
|
19
|
+
return r.sort((t, u) => t.revoked === u.revoked ? 0 : t.revoked ? 1 : -1), f(
|
|
20
|
+
r.filter((t) => !t.display),
|
|
21
21
|
"role"
|
|
22
22
|
).concat(
|
|
23
23
|
f(
|
|
24
|
-
|
|
24
|
+
r.filter((t) => t.display),
|
|
25
25
|
"display.content"
|
|
26
26
|
)
|
|
27
27
|
);
|
|
28
|
-
}, [o
|
|
29
|
-
return e.length === 0 ? /* @__PURE__ */
|
|
30
|
-
|
|
28
|
+
}, [o?.passports]), p = l(() => e?.find((r) => r.name === o.role), [e, o?.role]), i = d.palette.primary.main;
|
|
29
|
+
return e.length === 0 ? /* @__PURE__ */ s(m, { children: /* @__PURE__ */ s(x, { children: n("noPassport") }) }) : /* @__PURE__ */ s(
|
|
30
|
+
m,
|
|
31
31
|
{
|
|
32
32
|
...a,
|
|
33
33
|
sx: {
|
|
@@ -42,14 +42,14 @@ function D({ user: o, ...a }) {
|
|
|
42
42
|
gap: 2.5,
|
|
43
43
|
...a.sx
|
|
44
44
|
},
|
|
45
|
-
children: e.map((
|
|
46
|
-
|
|
45
|
+
children: e.map((r) => /* @__PURE__ */ s(
|
|
46
|
+
g,
|
|
47
47
|
{
|
|
48
|
-
passport:
|
|
48
|
+
passport: r,
|
|
49
49
|
user: o,
|
|
50
50
|
color: window.blocklet.passportColor,
|
|
51
51
|
createPassportSvg: S,
|
|
52
|
-
title: p && p.role ===
|
|
52
|
+
title: p && p.role === r.role ? n("currentPassport") : "",
|
|
53
53
|
sx: {
|
|
54
54
|
flexDirection: "column",
|
|
55
55
|
alignItems: "center",
|
|
@@ -62,14 +62,14 @@ function D({ user: o, ...a }) {
|
|
|
62
62
|
display: "flex",
|
|
63
63
|
justifyContent: "center",
|
|
64
64
|
backgroundColor: "grey.50",
|
|
65
|
-
boxShadow: p && p.role ===
|
|
65
|
+
boxShadow: p && p.role === r.role ? `0px 2px 4px 0px ${i}, 0px 1px 2px -1px ${i}, 0px 0px 0px 1px ${i} !important` : "unset"
|
|
66
66
|
},
|
|
67
67
|
".passport-item__body": {
|
|
68
68
|
marginLeft: "0 !important"
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
|
-
|
|
72
|
+
r.id
|
|
73
73
|
))
|
|
74
74
|
}
|
|
75
75
|
);
|
|
@@ -2,10 +2,10 @@ import { jsx as a } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box as f, Typography as x } from "@mui/material";
|
|
3
3
|
import d from "@arcblock/ux/lib/Switch";
|
|
4
4
|
import { useState as w } from "react";
|
|
5
|
-
import { useMemoizedFn as
|
|
5
|
+
import { useMemoizedFn as l } from "ahooks";
|
|
6
6
|
import { translate as y } from "@arcblock/ux/lib/Locale/util";
|
|
7
7
|
import { useLocaleContext as v } from "@arcblock/ux/lib/Locale/context";
|
|
8
|
-
import
|
|
8
|
+
import c from "@arcblock/ux/lib/Toast";
|
|
9
9
|
import { translations as S } from "../libs/locales.js";
|
|
10
10
|
import { client as g } from "../../libs/client.js";
|
|
11
11
|
import { formatAxiosError as b } from "../libs/utils.js";
|
|
@@ -13,7 +13,7 @@ function A({
|
|
|
13
13
|
configList: n,
|
|
14
14
|
onSave: m
|
|
15
15
|
}) {
|
|
16
|
-
const [i, u] = w(n), { locale: p } = v(), s =
|
|
16
|
+
const [i, u] = w(n), { locale: p } = v(), s = l((r, t = {}) => y(S, r, p, "en", t)), h = l(async (r, t) => {
|
|
17
17
|
try {
|
|
18
18
|
const e = await g.user.saveUserPrivacyConfig({
|
|
19
19
|
[r]: !t
|
|
@@ -21,11 +21,11 @@ function A({
|
|
|
21
21
|
u(
|
|
22
22
|
i.map((o) => ({
|
|
23
23
|
...o,
|
|
24
|
-
value:
|
|
24
|
+
value: e?.[o.key] ?? o.value
|
|
25
25
|
}))
|
|
26
|
-
),
|
|
26
|
+
), c.success(s("saveSuccess")), m("privacy");
|
|
27
27
|
} catch (e) {
|
|
28
|
-
|
|
28
|
+
c.error(b(e));
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
return /* @__PURE__ */ a(
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useEffect as
|
|
3
|
-
import { Box as
|
|
4
|
-
import { useMemoizedFn as
|
|
5
|
-
import { translate as
|
|
6
|
-
import { useLocaleContext as
|
|
1
|
+
import { jsx as o, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as h } from "react";
|
|
3
|
+
import { Box as i, Typography as v } from "@mui/material";
|
|
4
|
+
import { useMemoizedFn as x, useCreation as f } from "ahooks";
|
|
5
|
+
import { translate as b } from "@arcblock/ux/lib/Locale/util";
|
|
6
|
+
import { useLocaleContext as y } from "@arcblock/ux/lib/Locale/context";
|
|
7
7
|
import { mergeSx as C } from "@arcblock/ux/lib/Util/style";
|
|
8
8
|
import S from "@arcblock/react-hooks/lib/useBrowser";
|
|
9
9
|
import { translations as w } from "../libs/locales.js";
|
|
@@ -15,71 +15,68 @@ import M from "./config-profile.js";
|
|
|
15
15
|
import U from "./danger-zone.js";
|
|
16
16
|
import { client as W } from "../../libs/client.js";
|
|
17
17
|
function O({
|
|
18
|
-
user:
|
|
19
|
-
settings:
|
|
20
|
-
onSave:
|
|
21
|
-
isMobile:
|
|
22
|
-
...
|
|
18
|
+
user: n,
|
|
19
|
+
settings: s,
|
|
20
|
+
onSave: a,
|
|
21
|
+
isMobile: l,
|
|
22
|
+
...m
|
|
23
23
|
}) {
|
|
24
|
-
const { locale: p } =
|
|
24
|
+
const { locale: p } = y(), d = S().arcSphere, t = x((e, r = {}) => b(w, e, p, "en", r)), c = f(() => (s?.userCenterTabs || []).map((r) => ({
|
|
25
25
|
key: r.value,
|
|
26
26
|
name: r.label,
|
|
27
27
|
value: r.protected,
|
|
28
28
|
isPrivate: r.isPrivate
|
|
29
|
-
})), [
|
|
29
|
+
})), [s?.userCenterTabs]), u = f(() => [
|
|
30
30
|
d ? void 0 : {
|
|
31
31
|
label: t("commonSetting.title"),
|
|
32
32
|
value: "common",
|
|
33
|
-
content: /* @__PURE__ */
|
|
33
|
+
content: /* @__PURE__ */ o(M, { user: n, onSave: a })
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
label: t("notificationManagement"),
|
|
37
37
|
value: "notification",
|
|
38
|
-
content: /* @__PURE__ */
|
|
38
|
+
content: /* @__PURE__ */ o(L, { user: n, isMobile: l })
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
label: t("thirdPartyLogin.title"),
|
|
42
42
|
value: "thirdPartyLogin",
|
|
43
|
-
content: /* @__PURE__ */
|
|
43
|
+
content: /* @__PURE__ */ o(B, { user: n })
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
label: t("privacyManagement"),
|
|
47
47
|
value: "privacy",
|
|
48
|
-
content: /* @__PURE__ */
|
|
48
|
+
content: /* @__PURE__ */ o(P, { configList: c, onSave: a })
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
label: t("sessionManagement"),
|
|
52
52
|
value: "session",
|
|
53
|
-
content: /* @__PURE__ */
|
|
53
|
+
content: /* @__PURE__ */ o(
|
|
54
54
|
T,
|
|
55
55
|
{
|
|
56
|
-
user:
|
|
56
|
+
user: n,
|
|
57
57
|
showUser: !1,
|
|
58
|
-
getUserSessions: (
|
|
58
|
+
getUserSessions: (e) => W.userSession.getMyLoginSessions({}, e)
|
|
59
59
|
}
|
|
60
60
|
)
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
label: t("dangerZone.title"),
|
|
64
64
|
value: "dangerZone",
|
|
65
|
-
content: /* @__PURE__ */
|
|
65
|
+
content: /* @__PURE__ */ o(U, {}),
|
|
66
66
|
sx: {
|
|
67
67
|
borderColor: "error.main"
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
].filter(Boolean), [
|
|
71
|
-
return
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
}, []), /* @__PURE__ */ e(
|
|
78
|
-
l,
|
|
70
|
+
].filter(Boolean), [n, c, l]);
|
|
71
|
+
return h(() => {
|
|
72
|
+
const e = window.location.hash.slice(1);
|
|
73
|
+
e && document.getElementById(e)?.scrollIntoView({ behavior: "smooth" });
|
|
74
|
+
}, []), /* @__PURE__ */ o(
|
|
75
|
+
i,
|
|
79
76
|
{
|
|
80
|
-
...
|
|
77
|
+
...m,
|
|
81
78
|
sx: {
|
|
82
|
-
...
|
|
79
|
+
...m?.sx,
|
|
83
80
|
display: "flex",
|
|
84
81
|
flexDirection: "column",
|
|
85
82
|
gap: 2.5,
|
|
@@ -88,10 +85,10 @@ function O({
|
|
|
88
85
|
},
|
|
89
86
|
maxWidth: "100%"
|
|
90
87
|
},
|
|
91
|
-
children: u.map((
|
|
92
|
-
|
|
88
|
+
children: u.map((e) => e ? /* @__PURE__ */ g(
|
|
89
|
+
i,
|
|
93
90
|
{
|
|
94
|
-
id:
|
|
91
|
+
id: e.value,
|
|
95
92
|
sx: C(
|
|
96
93
|
{
|
|
97
94
|
border: "1px solid",
|
|
@@ -102,31 +99,31 @@ function O({
|
|
|
102
99
|
mb: 5
|
|
103
100
|
}
|
|
104
101
|
},
|
|
105
|
-
|
|
102
|
+
e.sx
|
|
106
103
|
),
|
|
107
104
|
children: [
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
|
|
105
|
+
/* @__PURE__ */ o(
|
|
106
|
+
v,
|
|
110
107
|
{
|
|
111
108
|
sx: {
|
|
112
109
|
color: "text.primary",
|
|
113
110
|
fontWeight: 600
|
|
114
111
|
},
|
|
115
|
-
children:
|
|
112
|
+
children: e.label
|
|
116
113
|
}
|
|
117
114
|
),
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
|
|
115
|
+
/* @__PURE__ */ o(
|
|
116
|
+
i,
|
|
120
117
|
{
|
|
121
118
|
sx: {
|
|
122
119
|
mt: 2.5
|
|
123
120
|
},
|
|
124
|
-
children:
|
|
121
|
+
children: e.content
|
|
125
122
|
}
|
|
126
123
|
)
|
|
127
124
|
]
|
|
128
125
|
},
|
|
129
|
-
|
|
126
|
+
e.value
|
|
130
127
|
) : null)
|
|
131
128
|
}
|
|
132
129
|
);
|
|
@@ -4,7 +4,7 @@ import { FormControl as f, TextField as h, FormHelperText as C } from "@mui/mate
|
|
|
4
4
|
import e from "dayjs";
|
|
5
5
|
import { useCreation as Y } from "ahooks";
|
|
6
6
|
function T({
|
|
7
|
-
value:
|
|
7
|
+
value: t,
|
|
8
8
|
onChange: a,
|
|
9
9
|
error: n = void 0,
|
|
10
10
|
helperText: i = void 0,
|
|
@@ -12,9 +12,9 @@ function T({
|
|
|
12
12
|
timezone: r = void 0
|
|
13
13
|
}) {
|
|
14
14
|
const l = p(null), s = e().format("YYYY-MM-DDTHH:mm"), c = Y(() => {
|
|
15
|
-
let
|
|
16
|
-
return
|
|
17
|
-
}, [
|
|
15
|
+
let o = e();
|
|
16
|
+
return t && (o = r ? e(t).tz(r) : e(t)), o.format("YYYY-MM-DD HH:mm");
|
|
17
|
+
}, [t, r]);
|
|
18
18
|
return /* @__PURE__ */ d(f, { fullWidth: !0, error: n, children: [
|
|
19
19
|
/* @__PURE__ */ u(
|
|
20
20
|
h,
|
|
@@ -22,14 +22,13 @@ function T({
|
|
|
22
22
|
inputRef: l,
|
|
23
23
|
type: "datetime-local",
|
|
24
24
|
value: c,
|
|
25
|
-
onChange: (
|
|
26
|
-
a(new Date(
|
|
25
|
+
onChange: (o) => {
|
|
26
|
+
a(new Date(o.target.value));
|
|
27
27
|
},
|
|
28
28
|
label: m,
|
|
29
29
|
error: n,
|
|
30
30
|
onClick: () => {
|
|
31
|
-
|
|
32
|
-
(t = l.current) == null || t.showPicker();
|
|
31
|
+
l.current?.showPicker();
|
|
33
32
|
},
|
|
34
33
|
sx: {
|
|
35
34
|
"& .MuiInputBase-root": {
|