@blocklet/ui-react 3.2.13 → 3.2.15
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/Dashboard/index.d.ts +2 -2
- package/lib/Footer/links.d.ts +1 -1
- package/lib/UserCenter/components/user-info/metadata.js +121 -117
- package/lib/UserCenter/components/user-info/user-basic-info.d.ts +1 -1
- package/lib/UserCenter/components/user-info/user-basic-info.js +1 -4
- package/lib/blocklets.d.ts +1 -1
- package/lib/common/header-addons.d.ts +1 -1
- package/package.json +11 -12
- package/src/UserCenter/components/user-info/metadata.tsx +6 -6
- package/src/UserCenter/components/user-info/user-basic-info.tsx +0 -4
package/lib/Dashboard/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ declare function Dashboard({ meta, fallbackUrl, invalidPathFallback, headerAddon
|
|
|
14
14
|
showRole: boolean;
|
|
15
15
|
onLogout: () => void;
|
|
16
16
|
} | undefined;
|
|
17
|
-
links?:
|
|
17
|
+
links?: never[] | undefined;
|
|
18
18
|
showDomainWarningDialog?: boolean | undefined;
|
|
19
19
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
20
20
|
declare namespace Dashboard {
|
|
@@ -22,7 +22,7 @@ declare namespace Dashboard {
|
|
|
22
22
|
export { BlockletMetaProps as meta };
|
|
23
23
|
export let fallbackUrl: PropTypes.Requireable<string>;
|
|
24
24
|
export let invalidPathFallback: PropTypes.Requireable<(...args: any[]) => any>;
|
|
25
|
-
export let headerAddons: PropTypes.Requireable<NonNullable<((...args: any[]) => any)
|
|
25
|
+
export let headerAddons: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
|
|
26
26
|
export { SessionManagerProps as sessionManagerProps };
|
|
27
27
|
export let links: PropTypes.Requireable<NonNullable<any[] | ((...args: any[]) => any) | null | undefined>>;
|
|
28
28
|
export let showDomainWarningDialog: PropTypes.Requireable<boolean>;
|
package/lib/Footer/links.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { default as PropTypes } from 'prop-types';
|
|
|
4
4
|
*/
|
|
5
5
|
declare function Links({ links, flowLayout, columns, ...rest }: {
|
|
6
6
|
[x: string]: any;
|
|
7
|
-
links?:
|
|
7
|
+
links?: never[] | undefined;
|
|
8
8
|
flowLayout?: boolean | undefined;
|
|
9
9
|
columns: any;
|
|
10
10
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,36 +1,40 @@
|
|
|
1
|
-
import { jsxs as y, Fragment as
|
|
2
|
-
import {
|
|
3
|
-
import { Icon as
|
|
4
|
-
import { Backdrop as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import { jsxs as y, Fragment as B, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { memo as te, createElement as re, useState as R, useRef as ie, useEffect as ae, useMemo as D } from "react";
|
|
3
|
+
import { Icon as le } from "@iconify/react";
|
|
4
|
+
import { Backdrop as de, Box as m, useMediaQuery as ce, SwipeableDrawer as pe, Typography as L, Tooltip as se } from "@mui/material";
|
|
5
|
+
import me from "@emotion/styled";
|
|
6
|
+
import N from "@arcblock/ux/lib/Button";
|
|
7
|
+
import F, { detectCountryFromPhone as T, getCountryNameByCountry as ue, validatePhoneNumber as he, getDialCodeByCountry as fe } from "@arcblock/ux/lib/PhoneInput";
|
|
8
8
|
import v from "lodash/cloneDeep";
|
|
9
|
-
import
|
|
10
|
-
import { mergeSx as
|
|
11
|
-
import { LOGIN_PROVIDER as
|
|
12
|
-
import { useReactive as w, useCreation as k, useMemoizedFn as
|
|
13
|
-
import { translate as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { useLocaleContext as
|
|
17
|
-
import { useBrowser as
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import {
|
|
24
|
-
import
|
|
25
|
-
|
|
9
|
+
import ye from "lodash/omit";
|
|
10
|
+
import { mergeSx as xe } from "@arcblock/ux/lib/Util/style";
|
|
11
|
+
import { LOGIN_PROVIDER as M } from "@arcblock/ux/lib/Util/constant";
|
|
12
|
+
import { useReactive as w, useCreation as k, useMemoizedFn as be } from "ahooks";
|
|
13
|
+
import { translate as ge } from "@arcblock/ux/lib/Locale/util";
|
|
14
|
+
import Ce from "validator/lib/isEmail";
|
|
15
|
+
import $ from "validator/lib/isPostalCode";
|
|
16
|
+
import { useLocaleContext as ve } from "@arcblock/ux/lib/Locale/context";
|
|
17
|
+
import { useBrowser as we } from "@arcblock/react-hooks";
|
|
18
|
+
import ke from "@arcblock/ux/lib/UserCard/Content/clock";
|
|
19
|
+
import Ee from "@arcblock/icons/lib/Email";
|
|
20
|
+
import Ie from "@arcblock/icons/lib/Phone";
|
|
21
|
+
import Pe from "@arcblock/icons/lib/Timezone";
|
|
22
|
+
import ze from "@arcblock/icons/lib/Location";
|
|
23
|
+
import { translations as Ve } from "../../libs/locales.js";
|
|
24
|
+
import g, { inputFieldStyle as Be, commonInputStyle as Le } from "../editable-field.js";
|
|
25
|
+
import { LinkPreviewInput as Ne } from "./link-preview-input.js";
|
|
26
|
+
import { defaultButtonStyle as G, primaryButtonStyle as je } from "./utils.js";
|
|
27
|
+
import { TimezoneSelect as Ae } from "./timezone-select.js";
|
|
28
|
+
import Se from "./address.js";
|
|
29
|
+
const E = {
|
|
26
30
|
width: 20,
|
|
27
31
|
height: 20
|
|
28
|
-
},
|
|
32
|
+
}, H = 200, Q = te(function({
|
|
29
33
|
ref: r,
|
|
30
|
-
...
|
|
34
|
+
...I
|
|
31
35
|
}) {
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
|
|
36
|
+
return /* @__PURE__ */ re(
|
|
37
|
+
de,
|
|
34
38
|
{
|
|
35
39
|
ref: r,
|
|
36
40
|
component: "div",
|
|
@@ -39,19 +43,19 @@ const je = I(() => import("@arcblock/icons/lib/Location")), Ae = I(() => import(
|
|
|
39
43
|
backdropFilter: "blur(3px)",
|
|
40
44
|
touchAction: "none"
|
|
41
45
|
},
|
|
42
|
-
...
|
|
46
|
+
...I,
|
|
43
47
|
key: "background"
|
|
44
48
|
}
|
|
45
49
|
);
|
|
46
50
|
});
|
|
47
|
-
|
|
48
|
-
function
|
|
49
|
-
isMyself:
|
|
51
|
+
Q.displayName = "BackdropWrap";
|
|
52
|
+
function mo({
|
|
53
|
+
isMyself: p,
|
|
50
54
|
user: r,
|
|
51
|
-
onSave:
|
|
55
|
+
onSave: I,
|
|
52
56
|
isMobile: x
|
|
53
57
|
}) {
|
|
54
|
-
const [
|
|
58
|
+
const [U, P] = R(!1), [Y, C] = R(!1), _ = ie(null), q = we(), b = ce("(max-width:640px)") || q.mobile.any, c = w({
|
|
55
59
|
email: "",
|
|
56
60
|
phone: ""
|
|
57
61
|
}), u = w({
|
|
@@ -62,10 +66,10 @@ function co({
|
|
|
62
66
|
line2: "",
|
|
63
67
|
postalCode: ""
|
|
64
68
|
});
|
|
65
|
-
|
|
69
|
+
ae(() => {
|
|
66
70
|
b || C(!1);
|
|
67
71
|
}, [b]);
|
|
68
|
-
const
|
|
72
|
+
const j = k(() => r?.phoneVerified ?? !1, [r?.phoneVerified]), A = k(() => r?.emailVerified ?? !1, [r?.emailVerified]), { locale: z } = ve(), d = be((o, n = {}) => ge(Ve, o, z, "en", n)), a = w(
|
|
69
73
|
r?.metadata ? v(r.metadata) : {
|
|
70
74
|
joinedAt: r?.createdAt,
|
|
71
75
|
email: r?.email,
|
|
@@ -83,20 +87,20 @@ function co({
|
|
|
83
87
|
line2: "",
|
|
84
88
|
postalCode: ""
|
|
85
89
|
}
|
|
86
|
-
),
|
|
90
|
+
), J = k(() => !!r?.address, [r?.address?.country]), h = D(() => r?.address?.country ? r.address.country : z === "zh" ? "cn" : "us", [r?.address?.country, z]), V = k(() => {
|
|
87
91
|
const o = a.phone ?? r?.phone ?? {
|
|
88
92
|
country: h,
|
|
89
93
|
phone: ""
|
|
90
94
|
};
|
|
91
95
|
if (o && typeof o == "string")
|
|
92
96
|
return {
|
|
93
|
-
country:
|
|
97
|
+
country: T(o) || h,
|
|
94
98
|
phone: o
|
|
95
99
|
};
|
|
96
100
|
if (o && typeof o == "object") {
|
|
97
101
|
const { country: n = "", phoneNumber: e = "" } = o;
|
|
98
102
|
return {
|
|
99
|
-
country: n ||
|
|
103
|
+
country: n || T(e) || "",
|
|
100
104
|
phone: e || ""
|
|
101
105
|
};
|
|
102
106
|
}
|
|
@@ -104,13 +108,13 @@ function co({
|
|
|
104
108
|
country: h,
|
|
105
109
|
phone: ""
|
|
106
110
|
};
|
|
107
|
-
}, [a.phone, r?.phone, h]),
|
|
111
|
+
}, [a.phone, r?.phone, h]), s = (o, n) => {
|
|
108
112
|
a[n] = o;
|
|
109
|
-
},
|
|
110
|
-
l[o] = n, o === "city" &&
|
|
111
|
-
},
|
|
113
|
+
}, K = (o, n) => {
|
|
114
|
+
l[o] = n, o === "city" && s(n, "location"), o === "postalCode" ? u.postalCode = n && !$(n, "any") ? d("profile.address.invalidPostalCode") : "" : u[o] = "";
|
|
115
|
+
}, S = () => {
|
|
112
116
|
b ? C(!0) : P(!0);
|
|
113
|
-
},
|
|
117
|
+
}, O = () => {
|
|
114
118
|
const o = v(r?.metadata) ?? {};
|
|
115
119
|
o && Object.keys(a).forEach((e) => {
|
|
116
120
|
const i = e;
|
|
@@ -125,10 +129,10 @@ function co({
|
|
|
125
129
|
e[i] = "";
|
|
126
130
|
});
|
|
127
131
|
}), b ? C(!1) : P(!1);
|
|
128
|
-
},
|
|
132
|
+
}, X = D(() => {
|
|
129
133
|
const o = a?.links?.map((n) => n.url) || [""];
|
|
130
134
|
return o.length > 0 ? o : [""];
|
|
131
|
-
}, [a.links]),
|
|
135
|
+
}, [a.links]), Z = (o) => {
|
|
132
136
|
const n = o.map((e) => {
|
|
133
137
|
if (!e)
|
|
134
138
|
return {
|
|
@@ -143,23 +147,23 @@ function co({
|
|
|
143
147
|
favicon: e
|
|
144
148
|
};
|
|
145
149
|
});
|
|
146
|
-
|
|
147
|
-
},
|
|
150
|
+
s(n, "links");
|
|
151
|
+
}, ee = () => {
|
|
148
152
|
if (Object.keys(a).forEach((n) => {
|
|
149
153
|
const e = n, i = a[e];
|
|
150
|
-
if (i && typeof i == "string" && (a[e] = i.trim()), e === "bio" && (a[e] = a[e]?.slice(0,
|
|
151
|
-
const f = i,
|
|
154
|
+
if (i && typeof i == "string" && (a[e] = i.trim()), e === "bio" && (a[e] = a[e]?.slice(0, H)), e === "timezone" && (a[e] = i || ""), e === "phone" && i && typeof i == "object") {
|
|
155
|
+
const f = i, oe = fe(f.country), ne = (f.phoneNumber?.replace(new RegExp(`^\\+${oe}`), "") || "")?.trim().length > 0;
|
|
152
156
|
a[e] = {
|
|
153
157
|
country: f.country,
|
|
154
|
-
...
|
|
158
|
+
...ne ? { phoneNumber: f.phoneNumber } : {}
|
|
155
159
|
};
|
|
156
160
|
}
|
|
157
|
-
}), l.postalCode &&
|
|
161
|
+
}), l.postalCode && !$(l.postalCode, "any") && (u.postalCode = d("profile.address.invalidPostalCode")), [c, u].some((n) => Object.values(n).some((e) => e)))
|
|
158
162
|
return;
|
|
159
|
-
const o =
|
|
160
|
-
o.country || (o.country = h),
|
|
161
|
-
},
|
|
162
|
-
|
|
163
|
+
const o = ye(l, "detailedAddress");
|
|
164
|
+
o.country || (o.country = h), I({ metadata: a, address: o }), P(!1), C(!1);
|
|
165
|
+
}, W = (o, n = "self") => /* @__PURE__ */ y(
|
|
166
|
+
Oe,
|
|
163
167
|
{
|
|
164
168
|
pt: 2,
|
|
165
169
|
display: "flex",
|
|
@@ -172,54 +176,54 @@ function co({
|
|
|
172
176
|
g,
|
|
173
177
|
{
|
|
174
178
|
value: a.bio ?? "",
|
|
175
|
-
onChange: (e) =>
|
|
179
|
+
onChange: (e) => s(e, "bio"),
|
|
176
180
|
editable: o,
|
|
177
181
|
placeholder: "Bio",
|
|
178
182
|
component: "textarea",
|
|
179
183
|
inline: !1,
|
|
180
184
|
rows: 3,
|
|
181
185
|
label: d("profile.bio"),
|
|
182
|
-
maxLength:
|
|
186
|
+
maxLength: H,
|
|
183
187
|
style: {
|
|
184
188
|
...o ? { marginBottom: 8 } : {}
|
|
185
189
|
}
|
|
186
190
|
}
|
|
187
191
|
),
|
|
188
|
-
!o &&
|
|
189
|
-
|
|
192
|
+
!o && p ? /* @__PURE__ */ t(
|
|
193
|
+
N,
|
|
190
194
|
{
|
|
191
195
|
size: x ? "small" : "large",
|
|
192
196
|
variant: "outlined",
|
|
193
197
|
sx: {
|
|
194
|
-
...
|
|
198
|
+
...G,
|
|
195
199
|
mb: x ? "4px" : 2,
|
|
196
200
|
mt: x ? "4px" : 2,
|
|
197
201
|
height: x ? "32px" : "40px"
|
|
198
202
|
},
|
|
199
|
-
onClick:
|
|
203
|
+
onClick: S,
|
|
200
204
|
fullWidth: !0,
|
|
201
205
|
children: d("profile.editProfile")
|
|
202
206
|
}
|
|
203
207
|
) : null,
|
|
204
|
-
o &&
|
|
205
|
-
|
|
208
|
+
o && p && J ? /* @__PURE__ */ t(
|
|
209
|
+
Se,
|
|
206
210
|
{
|
|
207
211
|
address: l,
|
|
208
212
|
errors: u,
|
|
209
|
-
handleChange:
|
|
213
|
+
handleChange: K,
|
|
210
214
|
defaultCountry: h
|
|
211
215
|
}
|
|
212
216
|
) : /* @__PURE__ */ t(
|
|
213
217
|
g,
|
|
214
218
|
{
|
|
215
219
|
value: a.location ?? r?.address?.city ?? "",
|
|
216
|
-
onChange: (e) =>
|
|
220
|
+
onChange: (e) => s(e, "location"),
|
|
217
221
|
editable: o,
|
|
218
222
|
placeholder: "Location",
|
|
219
223
|
label: d("profile.location"),
|
|
220
|
-
tooltip:
|
|
224
|
+
tooltip: p && (l.line1 || l.line2) ? /* @__PURE__ */ t(B, { children: ["line1", "line2"].map((e) => l[e] ? /* @__PURE__ */ y(m, { children: [
|
|
221
225
|
/* @__PURE__ */ t(
|
|
222
|
-
|
|
226
|
+
L,
|
|
223
227
|
{
|
|
224
228
|
variant: "caption",
|
|
225
229
|
component: "p",
|
|
@@ -230,30 +234,30 @@ function co({
|
|
|
230
234
|
children: d(`profile.address.${e}`)
|
|
231
235
|
}
|
|
232
236
|
),
|
|
233
|
-
/* @__PURE__ */ t(
|
|
237
|
+
/* @__PURE__ */ t(L, { variant: "caption", component: "span", children: l[e] })
|
|
234
238
|
] }, e) : null) }) : null,
|
|
235
239
|
renderValue: () => {
|
|
236
|
-
const i = [l?.country ?
|
|
237
|
-
return /* @__PURE__ */ t(
|
|
240
|
+
const i = [l?.country ? ue(l?.country) : "", l.province, l.city || a.location || ""].filter(Boolean).join(" ");
|
|
241
|
+
return /* @__PURE__ */ t(L, { component: "span", children: i });
|
|
238
242
|
},
|
|
239
|
-
icon: /* @__PURE__ */ t(
|
|
243
|
+
icon: /* @__PURE__ */ t(ze, { ...E })
|
|
240
244
|
}
|
|
241
245
|
),
|
|
242
246
|
/* @__PURE__ */ t(
|
|
243
247
|
g,
|
|
244
248
|
{
|
|
245
249
|
value: a.timezone || "",
|
|
246
|
-
onChange: (e) =>
|
|
250
|
+
onChange: (e) => s(e, "timezone"),
|
|
247
251
|
editable: o,
|
|
248
252
|
placeholder: "timezone",
|
|
249
|
-
icon: /* @__PURE__ */ t(
|
|
253
|
+
icon: /* @__PURE__ */ t(Pe, { ...E }),
|
|
250
254
|
label: d("profile.timezone"),
|
|
251
|
-
renderValue: (e) => /* @__PURE__ */ t(
|
|
255
|
+
renderValue: (e) => /* @__PURE__ */ t(ke, { value: e }),
|
|
252
256
|
children: /* @__PURE__ */ t(
|
|
253
|
-
|
|
257
|
+
Ae,
|
|
254
258
|
{
|
|
255
259
|
value: a.timezone ?? "",
|
|
256
|
-
onChange: (e) =>
|
|
260
|
+
onChange: (e) => s(e, "timezone"),
|
|
257
261
|
disabled: !o,
|
|
258
262
|
mode: n
|
|
259
263
|
}
|
|
@@ -265,18 +269,18 @@ function co({
|
|
|
265
269
|
{
|
|
266
270
|
value: a.email ?? r?.email ?? "",
|
|
267
271
|
editable: o,
|
|
268
|
-
hidePreview: !
|
|
269
|
-
disabled: r?.sourceProvider ===
|
|
270
|
-
canEdit: !
|
|
271
|
-
verified:
|
|
272
|
+
hidePreview: !p,
|
|
273
|
+
disabled: r?.sourceProvider === M.EMAIL,
|
|
274
|
+
canEdit: !A,
|
|
275
|
+
verified: A,
|
|
272
276
|
placeholder: "Email",
|
|
273
|
-
icon: /* @__PURE__ */ t(
|
|
274
|
-
label: /* @__PURE__ */ y(
|
|
277
|
+
icon: /* @__PURE__ */ t(Ee, { ...E }),
|
|
278
|
+
label: /* @__PURE__ */ y(B, { children: [
|
|
275
279
|
d("profile.email"),
|
|
276
|
-
r?.sourceProvider ===
|
|
280
|
+
r?.sourceProvider === M.EMAIL ? /* @__PURE__ */ t(se, { title: d("profile.emailSourceProviderNotAllowEdit"), children: /* @__PURE__ */ t(
|
|
277
281
|
m,
|
|
278
282
|
{
|
|
279
|
-
component:
|
|
283
|
+
component: le,
|
|
280
284
|
icon: "mdi:info-outline",
|
|
281
285
|
sx: {
|
|
282
286
|
verticalAlign: "middle",
|
|
@@ -285,9 +289,9 @@ function co({
|
|
|
285
289
|
}
|
|
286
290
|
) }) : null
|
|
287
291
|
] }),
|
|
288
|
-
onChange: (e) =>
|
|
292
|
+
onChange: (e) => s(e, "email"),
|
|
289
293
|
errorMsg: c.email,
|
|
290
|
-
renderValue: (e) =>
|
|
294
|
+
renderValue: (e) => p ? /* @__PURE__ */ t(
|
|
291
295
|
"a",
|
|
292
296
|
{
|
|
293
297
|
href: `mailto:${e}`,
|
|
@@ -300,25 +304,25 @@ function co({
|
|
|
300
304
|
) : null,
|
|
301
305
|
onValueValidate: (e) => {
|
|
302
306
|
let i = "";
|
|
303
|
-
e && !
|
|
307
|
+
e && !Ce(e) && (i = d("profile.emailInvalid")), c.email = i;
|
|
304
308
|
}
|
|
305
309
|
}
|
|
306
310
|
),
|
|
307
311
|
/* @__PURE__ */ t(
|
|
308
312
|
g,
|
|
309
313
|
{
|
|
310
|
-
value:
|
|
314
|
+
value: V.phone,
|
|
311
315
|
editable: o,
|
|
312
|
-
hidePreview: !
|
|
313
|
-
canEdit: !
|
|
314
|
-
verified:
|
|
316
|
+
hidePreview: !p,
|
|
317
|
+
canEdit: !j,
|
|
318
|
+
verified: j,
|
|
315
319
|
placeholder: "Phone",
|
|
316
|
-
icon: /* @__PURE__ */ t(
|
|
317
|
-
onChange: (e) =>
|
|
320
|
+
icon: /* @__PURE__ */ t(Ie, { ...E }),
|
|
321
|
+
onChange: (e) => s(e, "phone"),
|
|
318
322
|
label: d("profile.phone"),
|
|
319
|
-
renderValue: () =>
|
|
323
|
+
renderValue: () => p ? /* @__PURE__ */ t(F, { value: V, preview: !0 }) : null,
|
|
320
324
|
children: /* @__PURE__ */ t(
|
|
321
|
-
|
|
325
|
+
F,
|
|
322
326
|
{
|
|
323
327
|
variant: "outlined",
|
|
324
328
|
className: "editable-field",
|
|
@@ -326,12 +330,12 @@ function co({
|
|
|
326
330
|
sx: { backgroundColor: "transparent" },
|
|
327
331
|
placeholder: "Phone"
|
|
328
332
|
},
|
|
329
|
-
value:
|
|
333
|
+
value: V,
|
|
330
334
|
error: !!c.phone,
|
|
331
335
|
helperText: c.phone,
|
|
332
|
-
sx:
|
|
336
|
+
sx: xe(Be, c.phone ? {} : Le),
|
|
333
337
|
onChange: (e) => {
|
|
334
|
-
|
|
338
|
+
he(e.phone, e.country) ? c.phone = "" : c.phone = d("profile.phoneInvalid"), s(
|
|
335
339
|
{
|
|
336
340
|
country: e.country,
|
|
337
341
|
phoneNumber: e.phone
|
|
@@ -343,8 +347,8 @@ function co({
|
|
|
343
347
|
)
|
|
344
348
|
}
|
|
345
349
|
),
|
|
346
|
-
/* @__PURE__ */ t(
|
|
347
|
-
o &&
|
|
350
|
+
/* @__PURE__ */ t(Ne, { editable: o, links: X, onChange: Z }),
|
|
351
|
+
o && p ? /* @__PURE__ */ y(
|
|
348
352
|
m,
|
|
349
353
|
{
|
|
350
354
|
style: { width: "100%" },
|
|
@@ -356,31 +360,31 @@ function co({
|
|
|
356
360
|
},
|
|
357
361
|
children: [
|
|
358
362
|
/* @__PURE__ */ t(
|
|
359
|
-
|
|
363
|
+
N,
|
|
360
364
|
{
|
|
361
365
|
fullWidth: n === "drawer",
|
|
362
366
|
size: "small",
|
|
363
367
|
variant: "outlined",
|
|
364
|
-
sx: { ...
|
|
365
|
-
onClick:
|
|
368
|
+
sx: { ...G, minWidth: "54px" },
|
|
369
|
+
onClick: O,
|
|
366
370
|
children: d("common.cancel")
|
|
367
371
|
}
|
|
368
372
|
),
|
|
369
373
|
/* @__PURE__ */ t(
|
|
370
|
-
|
|
374
|
+
N,
|
|
371
375
|
{
|
|
372
376
|
fullWidth: n === "drawer",
|
|
373
377
|
size: "small",
|
|
374
378
|
disabled: !!c.email || !!c.phone,
|
|
375
379
|
variant: "outlined",
|
|
376
380
|
sx: {
|
|
377
|
-
...
|
|
381
|
+
...je,
|
|
378
382
|
minWidth: "54px",
|
|
379
383
|
"&.Mui-disabled": {
|
|
380
384
|
backgroundColor: "rgba(0, 0, 0, 0.12)"
|
|
381
385
|
}
|
|
382
386
|
},
|
|
383
|
-
onClick:
|
|
387
|
+
onClick: ee,
|
|
384
388
|
children: d("common.save")
|
|
385
389
|
}
|
|
386
390
|
)
|
|
@@ -390,8 +394,8 @@ function co({
|
|
|
390
394
|
]
|
|
391
395
|
}
|
|
392
396
|
);
|
|
393
|
-
return /* @__PURE__ */ y(
|
|
394
|
-
|
|
397
|
+
return /* @__PURE__ */ y(B, { children: [
|
|
398
|
+
W(U),
|
|
395
399
|
b && /* @__PURE__ */ y(
|
|
396
400
|
pe,
|
|
397
401
|
{
|
|
@@ -399,12 +403,12 @@ function co({
|
|
|
399
403
|
zIndex: 9999
|
|
400
404
|
},
|
|
401
405
|
disableSwipeToOpen: !0,
|
|
402
|
-
onOpen:
|
|
403
|
-
open:
|
|
406
|
+
onOpen: S,
|
|
407
|
+
open: Y,
|
|
404
408
|
anchor: "bottom",
|
|
405
|
-
onClose:
|
|
409
|
+
onClose: O,
|
|
406
410
|
slots: {
|
|
407
|
-
backdrop:
|
|
411
|
+
backdrop: Q
|
|
408
412
|
},
|
|
409
413
|
slotProps: {
|
|
410
414
|
paper: {
|
|
@@ -421,7 +425,7 @@ function co({
|
|
|
421
425
|
/* @__PURE__ */ t(
|
|
422
426
|
m,
|
|
423
427
|
{
|
|
424
|
-
ref:
|
|
428
|
+
ref: _,
|
|
425
429
|
sx: {
|
|
426
430
|
padding: "16px 32px",
|
|
427
431
|
margin: "-8px auto -16px",
|
|
@@ -448,7 +452,7 @@ function co({
|
|
|
448
452
|
maxHeight: "500px",
|
|
449
453
|
overflowY: "auto"
|
|
450
454
|
},
|
|
451
|
-
children:
|
|
455
|
+
children: W(!0, "drawer")
|
|
452
456
|
}
|
|
453
457
|
)
|
|
454
458
|
]
|
|
@@ -456,7 +460,7 @@ function co({
|
|
|
456
460
|
)
|
|
457
461
|
] });
|
|
458
462
|
}
|
|
459
|
-
const
|
|
463
|
+
const Oe = me(m)`
|
|
460
464
|
width: 100%;
|
|
461
465
|
|
|
462
466
|
.MuiOutlinedInput-root {
|
|
@@ -495,5 +499,5 @@ const We = ue(m)`
|
|
|
495
499
|
}
|
|
496
500
|
`;
|
|
497
501
|
export {
|
|
498
|
-
|
|
502
|
+
mo as default
|
|
499
503
|
};
|
|
@@ -11,4 +11,4 @@ export default function UserBasicInfo({ user, isMyself, showFullDid, switchPassp
|
|
|
11
11
|
onlyProfile?: boolean;
|
|
12
12
|
refreshProfile: () => void;
|
|
13
13
|
isShowSocialActions?: boolean;
|
|
14
|
-
} & BoxProps): import("react/jsx-runtime").JSX.Element
|
|
14
|
+
} & BoxProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/blocklets.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export function getLocalizedNavigation({ navigation, locale, defaultLocale, sect
|
|
|
11
11
|
}>;
|
|
12
12
|
locale: string;
|
|
13
13
|
defaultLocale: string;
|
|
14
|
-
section?: "
|
|
14
|
+
section?: "header" | "footer" | undefined;
|
|
15
15
|
}): any[];
|
|
16
16
|
export function formatNavigation(navigation: any): any;
|
|
17
17
|
export function parseNavigation(navigation: any): {
|
|
@@ -11,7 +11,7 @@ declare function HeaderAddons({ formattedBlocklet, addons, showDomainWarningDial
|
|
|
11
11
|
declare namespace HeaderAddons {
|
|
12
12
|
namespace propTypes {
|
|
13
13
|
export let formattedBlocklet: PropTypes.Validator<object>;
|
|
14
|
-
export let addons: PropTypes.Requireable<NonNullable<((...args: any[]) => any)
|
|
14
|
+
export let addons: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
|
|
15
15
|
export { SessionManagerProps as sessionManagerProps };
|
|
16
16
|
export let showDomainWarningDialog: PropTypes.Requireable<boolean>;
|
|
17
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/ui-react",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.15",
|
|
4
4
|
"description": "Some useful front-end web components that can be used in Blocklets.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -33,14 +33,13 @@
|
|
|
33
33
|
"url": "https://github.com/ArcBlock/ux/issues"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@abtnode/constant": "1.17.
|
|
37
|
-
"@abtnode/util": "1.17.
|
|
38
|
-
"@arcblock/bridge": "3.2.
|
|
39
|
-
"@arcblock/icons": "3.2.
|
|
40
|
-
"@arcblock/react-hooks": "3.2.
|
|
41
|
-
"@arcblock/ws": "^1.27.
|
|
42
|
-
"@blocklet/
|
|
43
|
-
"@blocklet/did-space-react": "^1.2.9",
|
|
36
|
+
"@abtnode/constant": "^1.17.5",
|
|
37
|
+
"@abtnode/util": "^1.17.5",
|
|
38
|
+
"@arcblock/bridge": "3.2.15",
|
|
39
|
+
"@arcblock/icons": "3.2.15",
|
|
40
|
+
"@arcblock/react-hooks": "3.2.15",
|
|
41
|
+
"@arcblock/ws": "^1.27.15",
|
|
42
|
+
"@blocklet/did-space-react": "^1.2.10",
|
|
44
43
|
"@iconify-icons/logos": "^1.2.36",
|
|
45
44
|
"@iconify-icons/material-symbols": "^1.2.58",
|
|
46
45
|
"@iconify-icons/tabler": "^1.2.95",
|
|
@@ -71,7 +70,7 @@
|
|
|
71
70
|
"peerDependencies": {
|
|
72
71
|
"@arcblock/did-connect-react": "^3.1.0",
|
|
73
72
|
"@arcblock/ux": "^3.1.0",
|
|
74
|
-
"@blocklet/js-sdk": "^1.
|
|
73
|
+
"@blocklet/js-sdk": "^1.17.4",
|
|
75
74
|
"@emotion/react": "^11.14.0",
|
|
76
75
|
"@emotion/styled": "^11.14.0",
|
|
77
76
|
"@mui/icons-material": "^7.2.0",
|
|
@@ -83,7 +82,7 @@
|
|
|
83
82
|
"access": "public"
|
|
84
83
|
},
|
|
85
84
|
"devDependencies": {
|
|
86
|
-
"@arcblock/did-connect-react": "3.2.
|
|
85
|
+
"@arcblock/did-connect-react": "3.2.15",
|
|
87
86
|
"@types/dompurify": "^3.2.0",
|
|
88
87
|
"@types/ua-parser-js": "^0.7.39",
|
|
89
88
|
"@types/validator": "^13.15.2",
|
|
@@ -91,5 +90,5 @@
|
|
|
91
90
|
"jest": "^29.7.0",
|
|
92
91
|
"unbuild": "^2.0.0"
|
|
93
92
|
},
|
|
94
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "b58ce4d5e4db14f8ece4a980206521ea8c0d6909"
|
|
95
94
|
}
|
|
@@ -16,7 +16,7 @@ import omit from 'lodash/omit';
|
|
|
16
16
|
import { mergeSx } from '@arcblock/ux/lib/Util/style';
|
|
17
17
|
import { LOGIN_PROVIDER } from '@arcblock/ux/lib/Util/constant';
|
|
18
18
|
import { useCreation, useMemoizedFn, useReactive } from 'ahooks';
|
|
19
|
-
import { useMemo, useRef, useState, memo, useEffect
|
|
19
|
+
import { useMemo, useRef, useState, memo, useEffect } from 'react';
|
|
20
20
|
import { translate } from '@arcblock/ux/lib/Locale/util';
|
|
21
21
|
import isEmail from 'validator/lib/isEmail';
|
|
22
22
|
import isPostalCode from 'validator/lib/isPostalCode';
|
|
@@ -24,6 +24,11 @@ import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
|
24
24
|
import { useBrowser } from '@arcblock/react-hooks';
|
|
25
25
|
import Clock from '@arcblock/ux/lib/UserCard/Content/clock';
|
|
26
26
|
|
|
27
|
+
import EmailIcon from '@arcblock/icons/lib/Email';
|
|
28
|
+
import PhoneIcon from '@arcblock/icons/lib/Phone';
|
|
29
|
+
import TimezoneIcon from '@arcblock/icons/lib/Timezone';
|
|
30
|
+
import LocationIcon from '@arcblock/icons/lib/Location';
|
|
31
|
+
|
|
27
32
|
import { translations } from '../../libs/locales';
|
|
28
33
|
import type { User, UserAddress, UserMetadata, UserPhoneProps } from '../../../@types';
|
|
29
34
|
import EditableField, { commonInputStyle, inputFieldStyle } from '../editable-field';
|
|
@@ -32,11 +37,6 @@ import { defaultButtonStyle, primaryButtonStyle } from './utils';
|
|
|
32
37
|
import { TimezoneSelect } from './timezone-select';
|
|
33
38
|
import AddressEditor from './address';
|
|
34
39
|
|
|
35
|
-
const LocationIcon = lazy(() => import('@arcblock/icons/lib/Location'));
|
|
36
|
-
const TimezoneIcon = lazy(() => import('@arcblock/icons/lib/Timezone'));
|
|
37
|
-
const EmailIcon = lazy(() => import('@arcblock/icons/lib/Email'));
|
|
38
|
-
const PhoneIcon = lazy(() => import('@arcblock/icons/lib/Phone'));
|
|
39
|
-
|
|
40
40
|
const iconSize = {
|
|
41
41
|
width: 20,
|
|
42
42
|
height: 20,
|