@blocklet/ui-react 2.13.12 → 2.13.14
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/ComponentInstaller/index.js +6 -7
- package/lib/ComponentInstaller/installer-item.js +6 -6
- package/lib/Dashboard/index.js +6 -4
- package/lib/Footer/index.js +9 -5
- package/lib/Footer/links.js +1 -1
- package/lib/Footer/social-media.js +3 -12
- package/lib/Header/index.js +7 -6
- package/lib/Notifications/hooks/use-title.js +7 -5
- package/lib/UserCenter/components/config-profile.js +2 -3
- package/lib/UserCenter/components/editable-field.d.ts +2 -0
- package/lib/UserCenter/components/editable-field.js +4 -5
- package/lib/UserCenter/components/nft.js +3 -4
- package/lib/UserCenter/components/notification.js +4 -7
- package/lib/UserCenter/components/passport.js +3 -6
- package/lib/UserCenter/components/settings.js +4 -4
- package/lib/UserCenter/components/status-dialog/index.js +4 -5
- package/lib/UserCenter/components/status-selector/duration-menu.d.ts +1 -3
- package/lib/UserCenter/components/status-selector/duration-menu.js +2 -4
- package/lib/UserCenter/components/status-selector/menu-item.d.ts +1 -3
- package/lib/UserCenter/components/status-selector/menu-item.js +2 -4
- package/lib/UserCenter/components/third-party-login/index.js +3 -1
- package/lib/UserCenter/components/third-party-login/third-party-item.js +21 -17
- package/lib/UserCenter/components/user-center.js +6 -7
- package/lib/UserCenter/components/user-info/address.js +2 -3
- package/lib/UserCenter/components/user-info/link-preview-input.js +8 -8
- package/lib/UserCenter/components/user-info/metadata.js +1 -1
- package/lib/UserCenter/components/user-info/switch-role.js +5 -8
- package/lib/UserCenter/components/user-info/timezone-select.js +13 -8
- package/lib/UserCenter/components/user-info/user-basic-info.js +3 -4
- package/lib/UserCenter/components/user-info/user-info-item.js +2 -3
- package/lib/UserCenter/components/user-info/utils.d.ts +2 -2
- package/lib/UserCenter/components/user-info/utils.js +12 -13
- package/lib/UserCenter/components/webhook-item.js +16 -13
- package/lib/UserSessions/components/user-session-info.js +2 -3
- package/lib/UserSessions/components/user-sessions.js +9 -6
- package/lib/common/header-addons.js +1 -1
- package/lib/hooks/use-blocklet-logo.d.ts +8 -0
- package/lib/hooks/use-blocklet-logo.js +23 -0
- package/package.json +5 -5
- package/src/ComponentInstaller/index.jsx +7 -7
- package/src/ComponentInstaller/installer-item.jsx +6 -6
- package/src/Dashboard/index.jsx +6 -4
- package/src/Footer/index.jsx +9 -5
- package/src/Footer/links.jsx +1 -1
- package/src/Footer/social-media.jsx +3 -9
- package/src/Header/index.tsx +7 -6
- package/src/Notifications/hooks/use-title.tsx +8 -5
- package/src/UserCenter/components/config-profile.tsx +2 -3
- package/src/UserCenter/components/editable-field.tsx +6 -5
- package/src/UserCenter/components/nft.tsx +3 -4
- package/src/UserCenter/components/notification.tsx +4 -7
- package/src/UserCenter/components/passport.tsx +3 -7
- package/src/UserCenter/components/settings.tsx +4 -4
- package/src/UserCenter/components/status-dialog/index.tsx +4 -5
- package/src/UserCenter/components/status-selector/duration-menu.tsx +2 -4
- package/src/UserCenter/components/status-selector/menu-item.tsx +2 -4
- package/src/UserCenter/components/third-party-login/index.tsx +18 -14
- package/src/UserCenter/components/third-party-login/third-party-item.tsx +22 -17
- package/src/UserCenter/components/user-center.tsx +6 -7
- package/src/UserCenter/components/user-info/address.tsx +3 -3
- package/src/UserCenter/components/user-info/link-preview-input.tsx +9 -10
- package/src/UserCenter/components/user-info/metadata.tsx +1 -1
- package/src/UserCenter/components/user-info/switch-role.tsx +6 -9
- package/src/UserCenter/components/user-info/timezone-select.tsx +12 -9
- package/src/UserCenter/components/user-info/user-basic-info.tsx +3 -4
- package/src/UserCenter/components/user-info/user-info-item.tsx +2 -3
- package/src/UserCenter/components/user-info/utils.ts +13 -13
- package/src/UserCenter/components/webhook-item.tsx +16 -13
- package/src/UserSessions/components/user-session-info.tsx +2 -3
- package/src/UserSessions/components/user-sessions.tsx +9 -5
- package/src/common/header-addons.jsx +2 -2
- package/src/hooks/use-blocklet-logo.tsx +32 -0
|
@@ -7,11 +7,13 @@ import { getConnectedAccounts, getSourceProvider } from "@arcblock/ux/lib/Sessio
|
|
|
7
7
|
import { LOGIN_PROVIDER } from "@arcblock/ux/lib/Util/constant";
|
|
8
8
|
import { SessionContext } from "@arcblock/did-connect/lib/Session";
|
|
9
9
|
import { PasskeyActions } from "@arcblock/did-connect/lib/Passkey";
|
|
10
|
+
import { useBrowser } from "@arcblock/react-hooks";
|
|
10
11
|
import ThirdPartyItem from "./third-party-item.js";
|
|
11
12
|
export default function ThirdPartyLogin({ user }) {
|
|
12
13
|
const { session } = useContext(SessionContext);
|
|
13
14
|
const [oauthConfigs, setOauthConfigs] = useState({});
|
|
14
15
|
const { getOAuthConfigs } = session.useOAuth();
|
|
16
|
+
const browser = useBrowser();
|
|
15
17
|
useAsyncEffect(async () => {
|
|
16
18
|
const data = await getOAuthConfigs({
|
|
17
19
|
sourceAppPid: user?.sourceAppPid
|
|
@@ -149,7 +151,7 @@ export default function ThirdPartyLogin({ user }) {
|
|
|
149
151
|
walletAccounts.map((account) => {
|
|
150
152
|
return /* @__PURE__ */ jsx(ThirdPartyItem, { item: account }, account.id);
|
|
151
153
|
}),
|
|
152
|
-
/* @__PURE__ */ jsx(
|
|
154
|
+
browser.wallet || browser.arcSphere ? null : /* @__PURE__ */ jsx(
|
|
153
155
|
PasskeyActions,
|
|
154
156
|
{
|
|
155
157
|
behavior: "only-new",
|
|
@@ -2,7 +2,6 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Icon } from "@iconify/react";
|
|
3
3
|
import { Box, Tooltip, Typography } from "@mui/material";
|
|
4
4
|
import LinkRoundedIcon from "@iconify-icons/material-symbols/link-rounded";
|
|
5
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
6
5
|
import Button from "@arcblock/ux/lib/Button";
|
|
7
6
|
import Avatar from "@arcblock/ux/lib/Avatar";
|
|
8
7
|
import { useCreation, useMemoizedFn, useReactive } from "ahooks";
|
|
@@ -134,9 +133,10 @@ export default function ThirdPartyItem({
|
|
|
134
133
|
Box,
|
|
135
134
|
{
|
|
136
135
|
sx: {
|
|
137
|
-
borderRadius:
|
|
138
|
-
border:
|
|
139
|
-
|
|
136
|
+
borderRadius: 1,
|
|
137
|
+
border: "1px solid",
|
|
138
|
+
borderColor: "divider",
|
|
139
|
+
backgroundColor: "grey.50",
|
|
140
140
|
display: "flex",
|
|
141
141
|
alignItems: "center",
|
|
142
142
|
py: 1,
|
|
@@ -213,7 +213,7 @@ export default function ThirdPartyItem({
|
|
|
213
213
|
{
|
|
214
214
|
component: Icon,
|
|
215
215
|
icon: InfoOutlineRoundedIcon,
|
|
216
|
-
color:
|
|
216
|
+
color: "text.secondary",
|
|
217
217
|
fontSize: 16,
|
|
218
218
|
sx: { cursor: "pointer", flexShrink: 0 }
|
|
219
219
|
}
|
|
@@ -231,18 +231,22 @@ export default function ThirdPartyItem({
|
|
|
231
231
|
{
|
|
232
232
|
variant: "outlined",
|
|
233
233
|
size: "small",
|
|
234
|
-
sx: {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
borderColor: item?._bind ?
|
|
240
|
-
backgroundColor:
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
234
|
+
sx: (theme) => {
|
|
235
|
+
const textRed = theme.palette.error.main;
|
|
236
|
+
const textPrimary = theme.palette.primary.main;
|
|
237
|
+
return {
|
|
238
|
+
color: item?._bind ? textRed : textPrimary,
|
|
239
|
+
borderColor: item?._bind ? textRed : textPrimary,
|
|
240
|
+
backgroundColor: "background.default",
|
|
241
|
+
"&:hover": {
|
|
242
|
+
borderColor: item?._bind ? textRed : textPrimary,
|
|
243
|
+
backgroundColor: "action.hover"
|
|
244
|
+
},
|
|
245
|
+
py: 0.5,
|
|
246
|
+
borderRadius: 1,
|
|
247
|
+
fontWeight: 500,
|
|
248
|
+
whiteSpace: "nowrap"
|
|
249
|
+
};
|
|
246
250
|
},
|
|
247
251
|
fullWidth: true,
|
|
248
252
|
startIcon: currentState.loading ? null : /* @__PURE__ */ jsx(Icon, { icon: LinkRoundedIcon }),
|
|
@@ -8,7 +8,6 @@ import Tabs from "@arcblock/ux/lib/Tabs";
|
|
|
8
8
|
import Empty from "@arcblock/ux/lib/Empty";
|
|
9
9
|
import Button from "@arcblock/ux/lib/Button";
|
|
10
10
|
import Result from "@arcblock/ux/lib/Result";
|
|
11
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
12
11
|
import { useConfirm } from "@arcblock/ux/lib/Dialog";
|
|
13
12
|
import { translate } from "@arcblock/ux/lib/Locale/util";
|
|
14
13
|
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
@@ -139,7 +138,7 @@ export default function UserCenter({
|
|
|
139
138
|
fullScreen: isMobile,
|
|
140
139
|
sx: {
|
|
141
140
|
".MuiDialog-paper": {
|
|
142
|
-
borderRadius:
|
|
141
|
+
borderRadius: 1,
|
|
143
142
|
maxWidth: 1200
|
|
144
143
|
},
|
|
145
144
|
".ux-dialog_title": {
|
|
@@ -274,12 +273,12 @@ export default function UserCenter({
|
|
|
274
273
|
gap: 2.5
|
|
275
274
|
},
|
|
276
275
|
children: [
|
|
277
|
-
isMyself ? /* @__PURE__ */ jsxs(Box, { sx: { border:
|
|
276
|
+
isMyself ? /* @__PURE__ */ jsxs(Box, { sx: { border: "1px solid", borderColor: "divider", borderRadius: 1.5, p: 2 }, children: [
|
|
278
277
|
/* @__PURE__ */ jsx(
|
|
279
278
|
Typography,
|
|
280
279
|
{
|
|
281
280
|
sx: {
|
|
282
|
-
color:
|
|
281
|
+
color: "text.primary",
|
|
283
282
|
fontWeight: 600,
|
|
284
283
|
mb: 2.5
|
|
285
284
|
},
|
|
@@ -330,7 +329,7 @@ export default function UserCenter({
|
|
|
330
329
|
alignItems: "center",
|
|
331
330
|
flex: 1
|
|
332
331
|
},
|
|
333
|
-
children: /* @__PURE__ */ jsx(CircularProgress, {
|
|
332
|
+
children: /* @__PURE__ */ jsx(CircularProgress, {})
|
|
334
333
|
}
|
|
335
334
|
);
|
|
336
335
|
}
|
|
@@ -459,7 +458,7 @@ export default function UserCenter({
|
|
|
459
458
|
display: "block",
|
|
460
459
|
width: "100%",
|
|
461
460
|
height: "1px",
|
|
462
|
-
backgroundColor:
|
|
461
|
+
backgroundColor: "divider"
|
|
463
462
|
}
|
|
464
463
|
}
|
|
465
464
|
}
|
|
@@ -471,7 +470,7 @@ export default function UserCenter({
|
|
|
471
470
|
) : null,
|
|
472
471
|
userCenterTabs.length === 0 && emptyContent
|
|
473
472
|
] }),
|
|
474
|
-
!isMobile && /* @__PURE__ */ jsx(Divider, { orientation: "vertical", sx: {
|
|
473
|
+
!isMobile && /* @__PURE__ */ jsx(Divider, { orientation: "vertical", sx: { ml: 5 } }),
|
|
475
474
|
/* @__PURE__ */ jsx(
|
|
476
475
|
UserBasicInfo,
|
|
477
476
|
{
|
|
@@ -3,7 +3,6 @@ import { Box } from "@mui/material";
|
|
|
3
3
|
import { useMemoizedFn } from "ahooks";
|
|
4
4
|
import { translate } from "@arcblock/ux/lib/Locale/util";
|
|
5
5
|
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
6
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
7
6
|
import CountrySelect from "@arcblock/ux/lib/PhoneInput/country-select";
|
|
8
7
|
import { translations } from "../../libs/locales.js";
|
|
9
8
|
import EditableField from "../editable-field.js";
|
|
@@ -14,11 +13,11 @@ const selectStyle = {
|
|
|
14
13
|
borderRadius: 1,
|
|
15
14
|
"&:hover": {
|
|
16
15
|
"fieldset.MuiOutlinedInput-notchedOutline": {
|
|
17
|
-
borderColor:
|
|
16
|
+
borderColor: "divider"
|
|
18
17
|
}
|
|
19
18
|
},
|
|
20
19
|
"fieldset.MuiOutlinedInput-notchedOutline": {
|
|
21
|
-
borderColor:
|
|
20
|
+
borderColor: "divider",
|
|
22
21
|
borderRadius: 1
|
|
23
22
|
},
|
|
24
23
|
".MuiSelect-select": {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Button, FormControl, IconButton, TextField, Typography } from "@mui/material";
|
|
3
3
|
import styled from "@emotion/styled";
|
|
4
|
-
import RemoveIcon from "@
|
|
4
|
+
import RemoveIcon from "@mui/icons-material/Remove";
|
|
5
5
|
import AddIcon from "@mui/icons-material/Add";
|
|
6
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
7
6
|
import { useEffect, useMemo, useState } from "react";
|
|
8
7
|
import { translate } from "@arcblock/ux/lib/Locale/util";
|
|
9
8
|
import { useMemoizedFn } from "ahooks";
|
|
@@ -69,7 +68,7 @@ function DynamicLinkForm({ links = [], onChange }) {
|
|
|
69
68
|
onChange(updatedLinks);
|
|
70
69
|
};
|
|
71
70
|
return /* @__PURE__ */ jsxs(Box, { width: "100%", children: [
|
|
72
|
-
/* @__PURE__ */ jsx(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", gap: 1, children: /* @__PURE__ */ jsx(Typography, { variant: "subtitle1", gutterBottom: true, sx: { mb: 0, fontSize: "12px", color: "
|
|
71
|
+
/* @__PURE__ */ jsx(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", gap: 1, children: /* @__PURE__ */ jsx(Typography, { variant: "subtitle1", gutterBottom: true, sx: { mb: 0, fontSize: "12px", color: "text.primary" }, children: "Social Media" }) }),
|
|
73
72
|
links.map((link, index) => (
|
|
74
73
|
// eslint-disable-next-line react/no-array-index-key
|
|
75
74
|
/* @__PURE__ */ jsxs(Box, { display: "flex", alignItems: "flex-start", mb: 1, children: [
|
|
@@ -81,7 +80,7 @@ function DynamicLinkForm({ links = [], onChange }) {
|
|
|
81
80
|
errorMsg: errors[index] ? t("profile.invalidURL") : ""
|
|
82
81
|
}
|
|
83
82
|
),
|
|
84
|
-
/* @__PURE__ */ jsx(IconButton, {
|
|
83
|
+
/* @__PURE__ */ jsx(IconButton, { onClick: () => handleRemoveLink(index), children: /* @__PURE__ */ jsx(RemoveIcon, { sx: { color: "text.secondary" } }) })
|
|
85
84
|
] }, index)
|
|
86
85
|
)),
|
|
87
86
|
links.length < 5 && /* @__PURE__ */ jsxs(
|
|
@@ -94,11 +93,12 @@ function DynamicLinkForm({ links = [], onChange }) {
|
|
|
94
93
|
size: "small",
|
|
95
94
|
sx: {
|
|
96
95
|
height: "40px",
|
|
97
|
-
border:
|
|
98
|
-
|
|
96
|
+
border: "1px dashed",
|
|
97
|
+
borderColor: "grey.100",
|
|
98
|
+
color: "text.primary",
|
|
99
99
|
"&:hover": {
|
|
100
|
-
|
|
101
|
-
backgroundColor:
|
|
100
|
+
borderColor: "grey.100",
|
|
101
|
+
backgroundColor: "action.hover"
|
|
102
102
|
},
|
|
103
103
|
"&.Mui-disabled": {
|
|
104
104
|
borderStyle: "dashed"
|
|
@@ -519,7 +519,7 @@ export default function UserMetadataComponent({
|
|
|
519
519
|
PaperProps: {
|
|
520
520
|
sx: {
|
|
521
521
|
boxShadow: "0px -2px 16px 0px rgba(0, 0, 0, 0.08)",
|
|
522
|
-
borderRadius:
|
|
522
|
+
borderRadius: 1.5,
|
|
523
523
|
// 保持跟 DID Wallet 一致
|
|
524
524
|
borderBottomLeftRadius: 0,
|
|
525
525
|
borderBottomRightRadius: 0
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { memo } from "react";
|
|
3
3
|
import { Chip } from "@mui/material";
|
|
4
|
+
import { Icon } from "@iconify/react";
|
|
5
|
+
import SwapHorizRoundedIcon from "@iconify-icons/material-symbols/swap-horiz-rounded";
|
|
4
6
|
import { useCreation } from "ahooks";
|
|
5
|
-
import SwitchIcon from "@arcblock/icons/lib/Switch";
|
|
6
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
7
7
|
function SwitchRole({ user, switchPassport }) {
|
|
8
8
|
const currentRole = useCreation(
|
|
9
9
|
() => (user?.passports || [])?.find((item) => item.name === user.role),
|
|
@@ -19,21 +19,18 @@ function SwitchRole({ user, switchPassport }) {
|
|
|
19
19
|
flexShrink: 0,
|
|
20
20
|
fontWeight: "bold",
|
|
21
21
|
fontSize: "12px",
|
|
22
|
-
color:
|
|
23
|
-
borderColor:
|
|
22
|
+
color: "text.primary",
|
|
23
|
+
borderColor: "grey.100",
|
|
24
24
|
backgroundColor: "transparent",
|
|
25
25
|
textTransform: "capitalize",
|
|
26
26
|
pr: 1,
|
|
27
27
|
pl: 0.5,
|
|
28
|
-
"&:hover": {
|
|
29
|
-
backgroundColor: "rgba(0, 0, 0, 0.04)"
|
|
30
|
-
},
|
|
31
28
|
"&:active": {
|
|
32
29
|
boxShadow: "none"
|
|
33
30
|
}
|
|
34
31
|
},
|
|
35
32
|
clickable: true,
|
|
36
|
-
deleteIcon: /* @__PURE__ */ jsx(
|
|
33
|
+
deleteIcon: /* @__PURE__ */ jsx(Icon, { icon: SwapHorizRoundedIcon, color: "inherit" }),
|
|
37
34
|
onDelete: switchPassport,
|
|
38
35
|
onClick: switchPassport
|
|
39
36
|
}
|
|
@@ -5,8 +5,7 @@ import Select from "@mui/material/Select";
|
|
|
5
5
|
import ListSubheader from "@mui/material/ListSubheader";
|
|
6
6
|
import TextField from "@mui/material/TextField";
|
|
7
7
|
import debounce from "lodash/debounce";
|
|
8
|
-
import
|
|
9
|
-
import ArrowDownwardIcon from "@arcblock/icons/lib/ArrowDown";
|
|
8
|
+
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
|
|
10
9
|
import { getTimezones } from "./utils.js";
|
|
11
10
|
const timezones = getTimezones();
|
|
12
11
|
export function TimezoneSelect({ value, onChange, disabled = false, mode = "self" }) {
|
|
@@ -37,7 +36,13 @@ export function TimezoneSelect({ value, onChange, disabled = false, mode = "self
|
|
|
37
36
|
displayEmpty: true,
|
|
38
37
|
variant: "outlined",
|
|
39
38
|
placeholder: "Timezone",
|
|
40
|
-
IconComponent: (props) => /* @__PURE__ */ jsx(
|
|
39
|
+
IconComponent: (props) => /* @__PURE__ */ jsx(
|
|
40
|
+
KeyboardArrowDownIcon,
|
|
41
|
+
{
|
|
42
|
+
...props,
|
|
43
|
+
sx: { fontSize: 18, color: (theme) => `${theme.palette.text.secondary} !important` }
|
|
44
|
+
}
|
|
45
|
+
),
|
|
41
46
|
MenuProps: {
|
|
42
47
|
PaperProps: {
|
|
43
48
|
style: {
|
|
@@ -52,11 +57,11 @@ export function TimezoneSelect({ value, onChange, disabled = false, mode = "self
|
|
|
52
57
|
width: "100%",
|
|
53
58
|
"&:hover": {
|
|
54
59
|
"fieldset.MuiOutlinedInput-notchedOutline": {
|
|
55
|
-
borderColor:
|
|
60
|
+
borderColor: "divider"
|
|
56
61
|
}
|
|
57
62
|
},
|
|
58
63
|
"fieldset.MuiOutlinedInput-notchedOutline": {
|
|
59
|
-
borderColor:
|
|
64
|
+
borderColor: "divider"
|
|
60
65
|
}
|
|
61
66
|
},
|
|
62
67
|
children: [
|
|
@@ -76,14 +81,14 @@ export function TimezoneSelect({ value, onChange, disabled = false, mode = "self
|
|
|
76
81
|
marginTop: "8px",
|
|
77
82
|
"& .MuiOutlinedInput-root": {
|
|
78
83
|
"& fieldset": {
|
|
79
|
-
borderColor:
|
|
84
|
+
borderColor: "divider",
|
|
80
85
|
borderWidth: "1px"
|
|
81
86
|
},
|
|
82
87
|
"&:hover fieldset": {
|
|
83
|
-
borderColor:
|
|
88
|
+
borderColor: "divider"
|
|
84
89
|
},
|
|
85
90
|
"&.Mui-focused fieldset": {
|
|
86
|
-
borderColor:
|
|
91
|
+
borderColor: "divider"
|
|
87
92
|
}
|
|
88
93
|
}
|
|
89
94
|
}
|
|
@@ -8,7 +8,6 @@ import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
|
8
8
|
import noop from "lodash/noop";
|
|
9
9
|
import { useEffect, useState } from "react";
|
|
10
10
|
import Toast from "@arcblock/ux/lib/Toast";
|
|
11
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
12
11
|
import { parseURL, joinURL } from "ufo";
|
|
13
12
|
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
|
|
14
13
|
import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp";
|
|
@@ -213,7 +212,7 @@ export default function UserBasicInfo({
|
|
|
213
212
|
] }),
|
|
214
213
|
/* @__PURE__ */ jsx(UserMetadataComponent, { isMobile, isMyself, user, onSave }),
|
|
215
214
|
isMyself ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
216
|
-
/* @__PURE__ */ jsx(Divider, { sx: { my: isMobile ? 1 : 3
|
|
215
|
+
/* @__PURE__ */ jsx(Divider, { sx: { my: isMobile ? 1 : 3 } }),
|
|
217
216
|
isMobile && !onlyProfile ? /* @__PURE__ */ jsx(
|
|
218
217
|
Box,
|
|
219
218
|
{
|
|
@@ -228,9 +227,9 @@ export default function UserBasicInfo({
|
|
|
228
227
|
size: "small",
|
|
229
228
|
onClick: toggleExpand,
|
|
230
229
|
sx: {
|
|
231
|
-
backgroundColor:
|
|
230
|
+
backgroundColor: "grey.50",
|
|
232
231
|
"&:hover": {
|
|
233
|
-
backgroundColor:
|
|
232
|
+
backgroundColor: "grey.50",
|
|
234
233
|
opacity: 0.8
|
|
235
234
|
}
|
|
236
235
|
},
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Typography } from "@mui/material";
|
|
3
3
|
import VerifiedIcon from "@mui/icons-material/Verified";
|
|
4
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
5
4
|
export default function UserInfoItem({ data, verified, ...rest }) {
|
|
6
5
|
return /* @__PURE__ */ jsxs(
|
|
7
6
|
Box,
|
|
@@ -20,7 +19,7 @@ export default function UserInfoItem({ data, verified, ...rest }) {
|
|
|
20
19
|
sx: {
|
|
21
20
|
display: "flex",
|
|
22
21
|
alignItems: "center",
|
|
23
|
-
color:
|
|
22
|
+
color: "text.primary",
|
|
24
23
|
fontSize: "14px",
|
|
25
24
|
gap: 1,
|
|
26
25
|
fontWeight: 500
|
|
@@ -36,7 +35,7 @@ export default function UserInfoItem({ data, verified, ...rest }) {
|
|
|
36
35
|
Typography,
|
|
37
36
|
{
|
|
38
37
|
sx: {
|
|
39
|
-
color:
|
|
38
|
+
color: "text.secondary",
|
|
40
39
|
whiteSpace: "pre-wrap",
|
|
41
40
|
fontSize: "14px"
|
|
42
41
|
},
|
|
@@ -33,7 +33,7 @@ export declare const defaultButtonStyle: {
|
|
|
33
33
|
backgroundColor: string;
|
|
34
34
|
};
|
|
35
35
|
py: number;
|
|
36
|
-
borderRadius:
|
|
36
|
+
borderRadius: number;
|
|
37
37
|
};
|
|
38
38
|
export declare const primaryButtonStyle: {
|
|
39
39
|
color: string;
|
|
@@ -44,5 +44,5 @@ export declare const primaryButtonStyle: {
|
|
|
44
44
|
backgroundColor: string;
|
|
45
45
|
};
|
|
46
46
|
py: number;
|
|
47
|
-
borderRadius:
|
|
47
|
+
borderRadius: number;
|
|
48
48
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import moment from "moment-timezone";
|
|
2
2
|
import dayjs from "dayjs";
|
|
3
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
4
3
|
import { DurationEnum } from "../../../@types/index.js";
|
|
5
4
|
const HOUR = 3600;
|
|
6
5
|
const MINUTES_30 = 1800;
|
|
@@ -97,24 +96,24 @@ export const getTimeRemaining = (date) => {
|
|
|
97
96
|
return 0;
|
|
98
97
|
};
|
|
99
98
|
export const defaultButtonStyle = {
|
|
100
|
-
color:
|
|
101
|
-
borderColor:
|
|
102
|
-
backgroundColor:
|
|
99
|
+
color: "text.primary",
|
|
100
|
+
borderColor: "grey.100",
|
|
101
|
+
backgroundColor: "background.default",
|
|
103
102
|
"&:hover": {
|
|
104
|
-
borderColor:
|
|
105
|
-
backgroundColor:
|
|
103
|
+
borderColor: "grey.100",
|
|
104
|
+
backgroundColor: "action.hover"
|
|
106
105
|
},
|
|
107
106
|
py: 0.5,
|
|
108
|
-
borderRadius:
|
|
107
|
+
borderRadius: 1
|
|
109
108
|
};
|
|
110
109
|
export const primaryButtonStyle = {
|
|
111
|
-
color:
|
|
112
|
-
borderColor:
|
|
113
|
-
backgroundColor:
|
|
110
|
+
color: "primary.contrastText",
|
|
111
|
+
borderColor: "primary.main",
|
|
112
|
+
backgroundColor: "primary.main",
|
|
114
113
|
"&:hover": {
|
|
115
|
-
borderColor:
|
|
116
|
-
backgroundColor:
|
|
114
|
+
borderColor: "primary.main",
|
|
115
|
+
backgroundColor: "primary.main"
|
|
117
116
|
},
|
|
118
117
|
py: 0.5,
|
|
119
|
-
borderRadius:
|
|
118
|
+
borderRadius: 1
|
|
120
119
|
};
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
import { useCreation, useMemoizedFn, useReactive } from "ahooks";
|
|
13
13
|
import noop from "lodash/noop";
|
|
14
14
|
import isUrl from "is-url";
|
|
15
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
16
15
|
import { Icon } from "@iconify/react";
|
|
17
16
|
import CloseRoundedIcon from "@iconify-icons/material-symbols/close-rounded";
|
|
18
17
|
import CheckIcon from "@iconify-icons/material-symbols/check";
|
|
@@ -120,9 +119,9 @@ export default function WebhookItem({
|
|
|
120
119
|
Select,
|
|
121
120
|
{
|
|
122
121
|
sx: {
|
|
123
|
-
borderRadius:
|
|
122
|
+
borderRadius: 1,
|
|
124
123
|
"&.Mui-disabled": {
|
|
125
|
-
backgroundColor:
|
|
124
|
+
backgroundColor: "grey.50"
|
|
126
125
|
}
|
|
127
126
|
},
|
|
128
127
|
disabled: !currentState.edit || currentState.loading,
|
|
@@ -153,9 +152,9 @@ export default function WebhookItem({
|
|
|
153
152
|
sx: {
|
|
154
153
|
flex: 1,
|
|
155
154
|
".MuiInputBase-root": {
|
|
156
|
-
borderRadius:
|
|
155
|
+
borderRadius: 1,
|
|
157
156
|
"&.Mui-disabled": {
|
|
158
|
-
backgroundColor:
|
|
157
|
+
backgroundColor: "grey.50"
|
|
159
158
|
}
|
|
160
159
|
}
|
|
161
160
|
},
|
|
@@ -184,8 +183,9 @@ export default function WebhookItem({
|
|
|
184
183
|
currentState.edit = false;
|
|
185
184
|
}),
|
|
186
185
|
sx: {
|
|
187
|
-
borderRadius:
|
|
188
|
-
border:
|
|
186
|
+
borderRadius: 1,
|
|
187
|
+
border: "1px solid",
|
|
188
|
+
borderColor: "grey.200"
|
|
189
189
|
},
|
|
190
190
|
children: /* @__PURE__ */ jsx(Icon, { icon: CheckIcon })
|
|
191
191
|
}
|
|
@@ -196,8 +196,9 @@ export default function WebhookItem({
|
|
|
196
196
|
color: "error",
|
|
197
197
|
onClick: handleClose,
|
|
198
198
|
sx: {
|
|
199
|
-
borderRadius:
|
|
200
|
-
border:
|
|
199
|
+
borderRadius: 1,
|
|
200
|
+
border: "1px solid",
|
|
201
|
+
borderColor: "grey.200"
|
|
201
202
|
},
|
|
202
203
|
children: /* @__PURE__ */ jsx(Icon, { icon: CloseRoundedIcon })
|
|
203
204
|
}
|
|
@@ -210,8 +211,9 @@ export default function WebhookItem({
|
|
|
210
211
|
currentState.edit = true;
|
|
211
212
|
},
|
|
212
213
|
sx: {
|
|
213
|
-
borderRadius:
|
|
214
|
-
border:
|
|
214
|
+
borderRadius: 1,
|
|
215
|
+
border: "1px solid",
|
|
216
|
+
borderColor: "grey.200"
|
|
215
217
|
},
|
|
216
218
|
children: /* @__PURE__ */ jsx(Icon, { icon: EditSquareOutlineRoundedIcon })
|
|
217
219
|
}
|
|
@@ -227,8 +229,9 @@ export default function WebhookItem({
|
|
|
227
229
|
});
|
|
228
230
|
},
|
|
229
231
|
sx: {
|
|
230
|
-
borderRadius:
|
|
231
|
-
border:
|
|
232
|
+
borderRadius: 1,
|
|
233
|
+
border: "1px solid",
|
|
234
|
+
borderColor: "grey.200"
|
|
232
235
|
},
|
|
233
236
|
children: /* @__PURE__ */ jsx(Icon, { icon: DeleteOutlineRoundedIcon })
|
|
234
237
|
}
|
|
@@ -2,7 +2,6 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box, Chip, Tooltip, Typography } from "@mui/material";
|
|
3
3
|
import Avatar from "@arcblock/ux/lib/Avatar";
|
|
4
4
|
import { useCreation } from "ahooks";
|
|
5
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
6
5
|
export default function UserSessionInfo({ user, sessionUser }) {
|
|
7
6
|
const currentRole = useCreation(() => {
|
|
8
7
|
return (user?.passports || [])?.find((item) => item.name === sessionUser.role);
|
|
@@ -59,8 +58,8 @@ export default function UserSessionInfo({ user, sessionUser }) {
|
|
|
59
58
|
flexShrink: 0,
|
|
60
59
|
fontWeight: "bold",
|
|
61
60
|
fontSize: "12px",
|
|
62
|
-
color:
|
|
63
|
-
borderColor:
|
|
61
|
+
color: "text.primary",
|
|
62
|
+
borderColor: "grey.300",
|
|
64
63
|
backgroundColor: "transparent",
|
|
65
64
|
textTransform: "capitalize",
|
|
66
65
|
pr: 0.5,
|
|
@@ -7,7 +7,6 @@ import RelativeTime from "@arcblock/ux/lib/RelativeTime";
|
|
|
7
7
|
import UAParser from "ua-parser-js";
|
|
8
8
|
import { getVisitorId } from "@arcblock/ux/lib/Util";
|
|
9
9
|
import { useConfirm } from "@arcblock/ux/lib/Dialog";
|
|
10
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
11
10
|
import PQueue from "p-queue";
|
|
12
11
|
import {
|
|
13
12
|
Box,
|
|
@@ -312,20 +311,23 @@ export default function UserSessions({
|
|
|
312
311
|
maxWidth: isMobile ? "unset" : isLg ? "calc(100vw - 300px)" : "100%",
|
|
313
312
|
...isMobile && {
|
|
314
313
|
".pc-user-sessions-table > div:nth-child(2)": {
|
|
315
|
-
border:
|
|
316
|
-
|
|
314
|
+
border: "1px solid",
|
|
315
|
+
borderColor: "divider",
|
|
316
|
+
borderRadius: 1
|
|
317
317
|
}
|
|
318
318
|
},
|
|
319
319
|
".MuiTableCell-head": {
|
|
320
320
|
whiteSpace: "nowrap",
|
|
321
|
-
fontWeight: "bold"
|
|
321
|
+
fontWeight: "bold",
|
|
322
|
+
backgroundColor: "background.default"
|
|
322
323
|
},
|
|
323
324
|
".MuiTableRow-root": {
|
|
324
325
|
border: "unset",
|
|
326
|
+
backgroundColor: "background.default",
|
|
325
327
|
"&:nth-child(even)": {
|
|
326
|
-
backgroundColor: "
|
|
328
|
+
backgroundColor: "grey.50",
|
|
327
329
|
"&:hover": {
|
|
328
|
-
backgroundColor:
|
|
330
|
+
backgroundColor: (theme) => `${theme.palette.grey[50]} !important`
|
|
329
331
|
}
|
|
330
332
|
}
|
|
331
333
|
},
|
|
@@ -337,6 +339,7 @@ export default function UserSessions({
|
|
|
337
339
|
".MuiTableCell-root": {
|
|
338
340
|
paddingRight: "8px",
|
|
339
341
|
paddingLeft: "8px",
|
|
342
|
+
color: "text.secondary",
|
|
340
343
|
...isMobile && {
|
|
341
344
|
padding: "8px !important",
|
|
342
345
|
"&:first-child": {
|
|
@@ -35,7 +35,7 @@ export default function HeaderAddons({ formattedBlocklet, addons, showDomainWarn
|
|
|
35
35
|
if (enableLocale && locale && languages.length > 1) {
|
|
36
36
|
addonsArray.push(/* @__PURE__ */ jsx(LocaleSelector, { showText: false }, "locale-selector"));
|
|
37
37
|
}
|
|
38
|
-
if (
|
|
38
|
+
if (window.blocklet?.theme?.prefer === "system") {
|
|
39
39
|
addonsArray.push(/* @__PURE__ */ jsx(ThemeModeToggle, {}, "theme-mode-toggle"));
|
|
40
40
|
}
|
|
41
41
|
if (enableConnect && sessionCtx) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Breakpoint } from '@mui/material';
|
|
2
|
+
import { type ThemeOptions } from '@blocklet/theme';
|
|
3
|
+
export default function useBlockletLogo({ key, meta, theme: themeOverrides, square, }?: {
|
|
4
|
+
key?: number | Breakpoint;
|
|
5
|
+
meta?: any;
|
|
6
|
+
theme?: ThemeOptions;
|
|
7
|
+
square?: boolean;
|
|
8
|
+
}): any;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useTheme } from "@arcblock/ux/lib/Theme";
|
|
2
|
+
import { useCreation } from "ahooks";
|
|
3
|
+
import useMobile from "./use-mobile.js";
|
|
4
|
+
export default function useBlockletLogo({
|
|
5
|
+
key = "sm",
|
|
6
|
+
meta = {},
|
|
7
|
+
theme: themeOverrides = {},
|
|
8
|
+
square
|
|
9
|
+
} = {}) {
|
|
10
|
+
const isMobileDevice = useMobile({ key });
|
|
11
|
+
const theme = useTheme();
|
|
12
|
+
const mode = useCreation(() => {
|
|
13
|
+
return themeOverrides?.palette?.mode || theme.palette.mode;
|
|
14
|
+
}, [theme, themeOverrides]);
|
|
15
|
+
const finalAppLogo = useCreation(() => {
|
|
16
|
+
const { appLogo, appLogoDark, appLogoRect, appLogoRectDark } = Object.assign(window.blocklet ?? {}, meta);
|
|
17
|
+
const isDark = mode === "dark";
|
|
18
|
+
const squareLogo = (isDark ? appLogoDark : appLogo) || appLogo;
|
|
19
|
+
const rectLogo = (isDark ? appLogoRectDark || appLogoDark : appLogoRect) || appLogoRect;
|
|
20
|
+
return isMobileDevice || square ? squareLogo : rectLogo || squareLogo || "";
|
|
21
|
+
}, [mode, meta, isMobileDevice, square]);
|
|
22
|
+
return finalAppLogo;
|
|
23
|
+
}
|