@blocklet/ui-react 2.9.91 → 2.10.0
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/build.config.ts +1 -6
- package/lib/@types/index.d.ts +1 -0
- package/lib/@types/index.js +0 -1
- package/lib/BlockletStudio/index.js +50 -50
- package/lib/ComponentInstaller/index.js +122 -202
- package/lib/ComponentInstaller/installer-item.js +116 -138
- package/lib/ComponentInstaller/locales.js +5 -10
- package/lib/ComponentInstaller/use-component-installed.js +37 -41
- package/lib/ComponentManager/components/add-component.js +58 -67
- package/lib/ComponentManager/components/check-component.js +2 -9
- package/lib/ComponentManager/components/publish-component.js +50 -59
- package/lib/ComponentManager/components/resource-dialog.js +42 -39
- package/lib/ComponentManager/index.js +3 -27
- package/lib/ComponentManager/libs/locales.js +2 -8
- package/lib/Dashboard/index.js +74 -99
- package/lib/Footer/brand.js +21 -43
- package/lib/Footer/copyright.js +15 -24
- package/lib/Footer/index.js +47 -71
- package/lib/Footer/internal-footer.js +72 -100
- package/lib/Footer/layout/plain.js +26 -45
- package/lib/Footer/layout/row.js +12 -29
- package/lib/Footer/layout/standard.js +34 -64
- package/lib/Footer/links.js +74 -104
- package/lib/Footer/social-media.js +35 -42
- package/lib/Header/index.js +69 -117
- package/lib/Icon/index.js +18 -53
- package/{es/UserCenter/components/notification.d.ts → lib/UserCenter/components/config-profile.d.ts} +1 -1
- package/lib/UserCenter/components/config-profile.js +67 -0
- package/lib/UserCenter/components/notification.js +203 -186
- package/lib/UserCenter/components/passport.js +70 -79
- package/lib/UserCenter/components/privacy.js +86 -88
- package/lib/UserCenter/components/settings.js +74 -84
- package/lib/UserCenter/components/storage/connect-to.js +56 -75
- package/lib/UserCenter/components/storage/connected.js +16 -37
- package/lib/UserCenter/components/storage/delete.js +42 -51
- package/lib/UserCenter/components/storage/disconnect.js +15 -29
- package/lib/UserCenter/components/storage/index.js +20 -54
- package/lib/UserCenter/components/storage/item.js +94 -122
- package/lib/UserCenter/components/storage/preview-nft.js +77 -85
- package/lib/UserCenter/components/third-party-login/index.js +49 -61
- package/lib/UserCenter/components/third-party-login/third-party-item.js +159 -176
- package/lib/UserCenter/components/user-center.js +276 -287
- package/lib/UserCenter/components/user-info/index.js +3 -27
- package/lib/UserCenter/components/user-info/user-basic-info.js +134 -129
- package/lib/UserCenter/components/user-info/user-info-item.js +43 -37
- package/lib/UserCenter/components/user-info/user-info.js +41 -74
- package/lib/UserCenter/components/webhook-item.js +184 -177
- package/lib/UserCenter/index.js +1 -13
- package/lib/UserCenter/libs/api.js +4 -16
- package/lib/UserCenter/libs/locales.d.ts +10 -0
- package/lib/UserCenter/libs/locales.js +12 -8
- package/lib/UserCenter/libs/utils.js +7 -17
- package/lib/UserSessions/components/user-session-info.js +88 -85
- package/lib/UserSessions/components/user-sessions.js +177 -213
- package/lib/UserSessions/index.js +1 -13
- package/lib/UserSessions/libs/locales.js +2 -8
- package/lib/UserSessions/libs/utils.js +4 -11
- package/lib/blocklets.js +59 -63
- package/lib/common/header-addons.js +44 -60
- package/lib/common/link-blocker.js +9 -18
- package/lib/common/overridable-theme-provider.js +10 -23
- package/lib/common/wallet-hidden-topbar.js +7 -14
- package/lib/contexts/config-user-space.js +38 -46
- package/lib/hooks/use-mobile.js +5 -13
- package/lib/index.js +10 -100
- package/lib/libs/client.js +2 -8
- package/lib/libs/spaces.js +6 -13
- package/lib/types.js +39 -41
- package/lib/utils.js +25 -44
- package/package.json +8 -38
- package/src/@types/index.ts +1 -0
- package/src/Footer/brand.jsx +6 -1
- package/src/UserCenter/components/config-profile.tsx +70 -0
- package/src/UserCenter/components/notification.tsx +63 -47
- package/src/UserCenter/components/settings.tsx +6 -0
- package/src/UserCenter/libs/locales.ts +10 -0
- package/es/@types/index.d.ts +0 -101
- package/es/@types/index.js +0 -0
- package/es/@types/shims.d.ts +0 -16
- package/es/BlockletStudio/index.d.ts +0 -28
- package/es/BlockletStudio/index.js +0 -114
- package/es/ComponentInstaller/index.d.ts +0 -37
- package/es/ComponentInstaller/index.js +0 -200
- package/es/ComponentInstaller/installer-item.d.ts +0 -21
- package/es/ComponentInstaller/installer-item.js +0 -139
- package/es/ComponentInstaller/locales.d.ts +0 -28
- package/es/ComponentInstaller/locales.js +0 -22
- package/es/ComponentInstaller/use-component-installed.d.ts +0 -12
- package/es/ComponentInstaller/use-component-installed.js +0 -88
- package/es/ComponentManager/components/add-component.d.ts +0 -16
- package/es/ComponentManager/components/add-component.js +0 -114
- package/es/ComponentManager/components/check-component.d.ts +0 -2
- package/es/ComponentManager/components/check-component.js +0 -2
- package/es/ComponentManager/components/publish-component.d.ts +0 -10
- package/es/ComponentManager/components/publish-component.js +0 -76
- package/es/ComponentManager/components/resource-dialog.d.ts +0 -14
- package/es/ComponentManager/components/resource-dialog.js +0 -74
- package/es/ComponentManager/index.d.ts +0 -3
- package/es/ComponentManager/index.js +0 -3
- package/es/ComponentManager/libs/locales.d.ts +0 -14
- package/es/ComponentManager/libs/locales.js +0 -14
- package/es/Dashboard/index.d.ts +0 -40
- package/es/Dashboard/index.js +0 -118
- package/es/Footer/brand.d.ts +0 -22
- package/es/Footer/brand.js +0 -73
- package/es/Footer/copyright.d.ts +0 -18
- package/es/Footer/copyright.js +0 -25
- package/es/Footer/index.d.ts +0 -6
- package/es/Footer/index.js +0 -82
- package/es/Footer/internal-footer.d.ts +0 -29
- package/es/Footer/internal-footer.js +0 -117
- package/es/Footer/layout/plain.d.ts +0 -15
- package/es/Footer/layout/plain.js +0 -39
- package/es/Footer/layout/row.d.ts +0 -18
- package/es/Footer/layout/row.js +0 -41
- package/es/Footer/layout/standard.d.ts +0 -15
- package/es/Footer/layout/standard.js +0 -53
- package/es/Footer/links.d.ts +0 -22
- package/es/Footer/links.js +0 -207
- package/es/Footer/social-media.d.ts +0 -14
- package/es/Footer/social-media.js +0 -60
- package/es/Header/index.d.ts +0 -10
- package/es/Header/index.js +0 -155
- package/es/Icon/index.d.ts +0 -23
- package/es/Icon/index.js +0 -55
- package/es/UserCenter/assets/banner.png +0 -0
- package/es/UserCenter/components/notification.js +0 -248
- package/es/UserCenter/components/passport.d.ts +0 -6
- package/es/UserCenter/components/passport.js +0 -88
- package/es/UserCenter/components/privacy.d.ts +0 -11
- package/es/UserCenter/components/privacy.js +0 -99
- package/es/UserCenter/components/settings.d.ts +0 -9
- package/es/UserCenter/components/settings.js +0 -89
- package/es/UserCenter/components/storage/connect-to.d.ts +0 -7
- package/es/UserCenter/components/storage/connect-to.js +0 -108
- package/es/UserCenter/components/storage/connected.d.ts +0 -7
- package/es/UserCenter/components/storage/connected.js +0 -24
- package/es/UserCenter/components/storage/delete.d.ts +0 -7
- package/es/UserCenter/components/storage/delete.js +0 -62
- package/es/UserCenter/components/storage/disconnect.d.ts +0 -3
- package/es/UserCenter/components/storage/disconnect.js +0 -23
- package/es/UserCenter/components/storage/icons/empty-spaces-nft.svg +0 -58
- package/es/UserCenter/components/storage/icons/long-arrow.svg +0 -5
- package/es/UserCenter/components/storage/icons/space-connected.svg +0 -3
- package/es/UserCenter/components/storage/icons/space-disconnect.svg +0 -3
- package/es/UserCenter/components/storage/index.d.ts +0 -3
- package/es/UserCenter/components/storage/index.js +0 -27
- package/es/UserCenter/components/storage/item.d.ts +0 -9
- package/es/UserCenter/components/storage/item.js +0 -158
- package/es/UserCenter/components/storage/preview-nft.d.ts +0 -6
- package/es/UserCenter/components/storage/preview-nft.js +0 -80
- package/es/UserCenter/components/third-party-login/index.d.ts +0 -5
- package/es/UserCenter/components/third-party-login/index.js +0 -110
- package/es/UserCenter/components/third-party-login/third-party-item.d.ts +0 -13
- package/es/UserCenter/components/third-party-login/third-party-item.js +0 -224
- package/es/UserCenter/components/user-center.d.ts +0 -15
- package/es/UserCenter/components/user-center.js +0 -414
- package/es/UserCenter/components/user-info/index.d.ts +0 -3
- package/es/UserCenter/components/user-info/index.js +0 -3
- package/es/UserCenter/components/user-info/user-basic-info.d.ts +0 -11
- package/es/UserCenter/components/user-info/user-basic-info.js +0 -151
- package/es/UserCenter/components/user-info/user-info-item.d.ts +0 -11
- package/es/UserCenter/components/user-info/user-info-item.js +0 -47
- package/es/UserCenter/components/user-info/user-info.d.ts +0 -6
- package/es/UserCenter/components/user-info/user-info.js +0 -66
- package/es/UserCenter/components/webhook-item.d.ts +0 -3
- package/es/UserCenter/components/webhook-item.js +0 -243
- package/es/UserCenter/index.d.ts +0 -1
- package/es/UserCenter/index.js +0 -1
- package/es/UserCenter/libs/api.d.ts +0 -3
- package/es/UserCenter/libs/api.js +0 -4
- package/es/UserCenter/libs/locales.d.ts +0 -162
- package/es/UserCenter/libs/locales.js +0 -162
- package/es/UserCenter/libs/utils.d.ts +0 -4
- package/es/UserCenter/libs/utils.js +0 -14
- package/es/UserSessions/components/user-session-info.d.ts +0 -6
- package/es/UserSessions/components/user-session-info.js +0 -92
- package/es/UserSessions/components/user-sessions.d.ts +0 -9
- package/es/UserSessions/components/user-sessions.js +0 -265
- package/es/UserSessions/index.d.ts +0 -1
- package/es/UserSessions/index.js +0 -1
- package/es/UserSessions/libs/locales.d.ts +0 -58
- package/es/UserSessions/libs/locales.js +0 -58
- package/es/UserSessions/libs/utils.d.ts +0 -2
- package/es/UserSessions/libs/utils.js +0 -73
- package/es/blocklets.d.ts +0 -16
- package/es/blocklets.js +0 -178
- package/es/common/header-addons.d.ts +0 -21
- package/es/common/header-addons.js +0 -83
- package/es/common/link-blocker.d.ts +0 -7
- package/es/common/link-blocker.js +0 -18
- package/es/common/overridable-theme-provider.d.ts +0 -18
- package/es/common/overridable-theme-provider.js +0 -15
- package/es/common/wallet-hidden-topbar.d.ts +0 -1
- package/es/common/wallet-hidden-topbar.js +0 -14
- package/es/contexts/config-user-space.d.ts +0 -26
- package/es/contexts/config-user-space.js +0 -53
- package/es/hooks/use-mobile.d.ts +0 -4
- package/es/hooks/use-mobile.js +0 -5
- package/es/index.d.ts +0 -10
- package/es/index.js +0 -10
- package/es/libs/client.d.ts +0 -2
- package/es/libs/client.js +0 -2
- package/es/libs/spaces.d.ts +0 -2
- package/es/libs/spaces.js +0 -13
- package/es/types.d.ts +0 -2
- package/es/types.js +0 -43
- package/es/utils.d.ts +0 -8
- package/es/utils.js +0 -78
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import {
|
|
3
|
+
Box,
|
|
4
|
+
CircularProgress,
|
|
5
|
+
IconButton,
|
|
6
|
+
InputAdornment,
|
|
7
|
+
MenuItem,
|
|
8
|
+
Select,
|
|
9
|
+
TextField,
|
|
10
|
+
Typography
|
|
11
|
+
} from "@mui/material";
|
|
12
|
+
import { useCreation, useMemoizedFn, useReactive } from "ahooks";
|
|
13
|
+
import noop from "lodash/noop";
|
|
14
|
+
import isUrl from "is-url";
|
|
15
|
+
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
16
|
+
import { Icon } from "@iconify/react";
|
|
17
|
+
import CloseRoundedIcon from "@iconify-icons/material-symbols/close-rounded";
|
|
18
|
+
import CheckIcon from "@iconify-icons/material-symbols/check";
|
|
19
|
+
import SendRoundedIcon from "@iconify-icons/material-symbols/send-rounded";
|
|
20
|
+
import EditSquareOutlineRoundedIcon from "@iconify-icons/material-symbols/edit-square-outline-rounded";
|
|
21
|
+
import DeleteOutlineRoundedIcon from "@iconify-icons/material-symbols/delete-outline-rounded";
|
|
22
|
+
import { translate } from "@arcblock/ux/lib/Locale/util";
|
|
23
|
+
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
24
|
+
import { translations } from "../libs/locales.js";
|
|
25
|
+
export default function WebhookItem({
|
|
26
|
+
onTest = noop,
|
|
27
|
+
onDelete = noop,
|
|
28
|
+
onSave = noop,
|
|
29
|
+
onCancel = noop,
|
|
28
30
|
type = "slack",
|
|
29
31
|
url = "",
|
|
30
32
|
edit = false
|
|
31
33
|
}) {
|
|
32
|
-
const {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const t = (0, _ahooks.useMemoizedFn)((key, data = {}) => {
|
|
36
|
-
return (0, _util.translate)(_locales.translations, key, locale, "en", data);
|
|
34
|
+
const { locale } = useLocaleContext();
|
|
35
|
+
const t = useMemoizedFn((key, data = {}) => {
|
|
36
|
+
return translate(translations, key, locale, "en", data);
|
|
37
37
|
});
|
|
38
|
-
const currentState =
|
|
38
|
+
const currentState = useReactive({
|
|
39
39
|
type: type || "slack",
|
|
40
40
|
url: url || "",
|
|
41
41
|
edit: edit ?? false,
|
|
42
42
|
error: "",
|
|
43
43
|
loading: false
|
|
44
44
|
});
|
|
45
|
-
const checkUrl =
|
|
45
|
+
const checkUrl = useMemoizedFn(() => {
|
|
46
46
|
if (!currentState.url) {
|
|
47
47
|
currentState.error = t("common.required");
|
|
48
48
|
return false;
|
|
49
49
|
}
|
|
50
|
-
if (!(
|
|
50
|
+
if (!isUrl(currentState.url)) {
|
|
51
51
|
currentState.error = t("common.invalid");
|
|
52
52
|
return false;
|
|
53
53
|
}
|
|
54
54
|
currentState.error = "";
|
|
55
55
|
return true;
|
|
56
56
|
});
|
|
57
|
-
const handleClose =
|
|
57
|
+
const handleClose = useMemoizedFn(() => {
|
|
58
58
|
currentState.edit = false;
|
|
59
59
|
currentState.url = url || "";
|
|
60
60
|
currentState.type = type || "slack";
|
|
@@ -62,12 +62,12 @@ function WebhookItem({
|
|
|
62
62
|
currentState.loading = false;
|
|
63
63
|
onCancel();
|
|
64
64
|
});
|
|
65
|
-
const _onTest =
|
|
65
|
+
const _onTest = useMemoizedFn(async (data) => {
|
|
66
66
|
currentState.loading = true;
|
|
67
67
|
await onTest(data);
|
|
68
68
|
currentState.loading = false;
|
|
69
69
|
});
|
|
70
|
-
const onSubmit =
|
|
70
|
+
const onSubmit = useMemoizedFn((fn) => {
|
|
71
71
|
return () => {
|
|
72
72
|
if (checkUrl()) {
|
|
73
73
|
fn({
|
|
@@ -77,160 +77,167 @@ function WebhookItem({
|
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
79
|
});
|
|
80
|
-
const inputAdornment =
|
|
80
|
+
const inputAdornment = useCreation(() => {
|
|
81
81
|
if (currentState.error) {
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
-
component: "span",
|
|
84
|
-
color: "error",
|
|
85
|
-
children: currentState.error
|
|
86
|
-
});
|
|
82
|
+
return /* @__PURE__ */ jsx(Typography, { component: "span", color: "error", children: currentState.error });
|
|
87
83
|
}
|
|
88
84
|
if (currentState.edit) {
|
|
89
85
|
if (currentState.loading) {
|
|
90
|
-
return /* @__PURE__ */
|
|
91
|
-
size: 16
|
|
92
|
-
});
|
|
86
|
+
return /* @__PURE__ */ jsx(CircularProgress, { size: 16 });
|
|
93
87
|
}
|
|
94
|
-
return /* @__PURE__ */
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
88
|
+
return /* @__PURE__ */ jsx(
|
|
89
|
+
IconButton,
|
|
90
|
+
{
|
|
91
|
+
size: "small",
|
|
92
|
+
onClick: onSubmit(_onTest),
|
|
93
|
+
sx: {
|
|
94
|
+
mr: -1
|
|
95
|
+
},
|
|
96
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: SendRoundedIcon })
|
|
97
|
+
}
|
|
98
|
+
);
|
|
104
99
|
}
|
|
105
100
|
return null;
|
|
106
101
|
}, [currentState.error, currentState.edit, currentState.loading]);
|
|
107
|
-
return /* @__PURE__ */
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
gap: 1.5,
|
|
111
|
-
width: "100%",
|
|
112
|
-
alignItems: {
|
|
113
|
-
xs: "flex-start",
|
|
114
|
-
md: "center"
|
|
115
|
-
},
|
|
116
|
-
flexDirection: {
|
|
117
|
-
xs: "column",
|
|
118
|
-
md: "row"
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Select, {
|
|
122
|
-
sx: {
|
|
123
|
-
borderRadius: 2,
|
|
124
|
-
"&.Mui-disabled": {
|
|
125
|
-
backgroundColor: _Colors.temp.backgroundsBgField
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
disabled: !currentState.edit || currentState.loading,
|
|
129
|
-
size: "small",
|
|
130
|
-
value: currentState.type,
|
|
131
|
-
onChange: e => {
|
|
132
|
-
currentState.type = e.target.value;
|
|
133
|
-
},
|
|
134
|
-
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.MenuItem, {
|
|
135
|
-
value: "api",
|
|
136
|
-
children: t("webhook.url")
|
|
137
|
-
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.MenuItem, {
|
|
138
|
-
value: "slack",
|
|
139
|
-
children: t("webhook.slack")
|
|
140
|
-
})]
|
|
141
|
-
}), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
102
|
+
return /* @__PURE__ */ jsxs(
|
|
103
|
+
Box,
|
|
104
|
+
{
|
|
142
105
|
sx: {
|
|
143
106
|
display: "flex",
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
sx: {
|
|
150
|
-
flex: 1,
|
|
151
|
-
".MuiInputBase-root": {
|
|
152
|
-
borderRadius: 2,
|
|
153
|
-
"&.Mui-disabled": {
|
|
154
|
-
backgroundColor: _Colors.temp.backgroundsBgField
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
disabled: !currentState.edit || currentState.loading,
|
|
159
|
-
fullWidth: true,
|
|
160
|
-
size: "small",
|
|
161
|
-
required: true,
|
|
162
|
-
value: currentState.url,
|
|
163
|
-
onChange: e => {
|
|
164
|
-
currentState.url = e.target.value;
|
|
165
|
-
checkUrl();
|
|
107
|
+
gap: 1.5,
|
|
108
|
+
width: "100%",
|
|
109
|
+
alignItems: {
|
|
110
|
+
xs: "flex-start",
|
|
111
|
+
md: "center"
|
|
166
112
|
},
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
position: "end",
|
|
171
|
-
children: inputAdornment
|
|
172
|
-
})
|
|
113
|
+
flexDirection: {
|
|
114
|
+
xs: "column",
|
|
115
|
+
md: "row"
|
|
173
116
|
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
children: currentState.edit ? /* @__PURE__ */(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
180
|
-
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
181
|
-
color: "success",
|
|
182
|
-
onClick: onSubmit((...args) => {
|
|
183
|
-
onSave(...args);
|
|
184
|
-
currentState.edit = false;
|
|
185
|
-
}),
|
|
186
|
-
sx: {
|
|
187
|
-
borderRadius: 2,
|
|
188
|
-
border: `1px solid ${_Colors.temp.strokeBorderBase}`
|
|
189
|
-
},
|
|
190
|
-
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_react.Icon, {
|
|
191
|
-
icon: _check.default
|
|
192
|
-
})
|
|
193
|
-
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
194
|
-
color: "error",
|
|
195
|
-
onClick: handleClose,
|
|
196
|
-
sx: {
|
|
197
|
-
borderRadius: 2,
|
|
198
|
-
border: `1px solid ${_Colors.temp.strokeBorderBase}`
|
|
199
|
-
},
|
|
200
|
-
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_react.Icon, {
|
|
201
|
-
icon: _closeRounded.default
|
|
202
|
-
})
|
|
203
|
-
})]
|
|
204
|
-
}) : /* @__PURE__ */(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
205
|
-
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
206
|
-
onClick: () => {
|
|
207
|
-
currentState.edit = true;
|
|
208
|
-
},
|
|
117
|
+
},
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ jsxs(
|
|
120
|
+
Select,
|
|
121
|
+
{
|
|
209
122
|
sx: {
|
|
210
123
|
borderRadius: 2,
|
|
211
|
-
|
|
124
|
+
"&.Mui-disabled": {
|
|
125
|
+
backgroundColor: colors.backgroundsBgField
|
|
126
|
+
}
|
|
212
127
|
},
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
onClick: () => {
|
|
219
|
-
onDelete({
|
|
220
|
-
type: currentState.type,
|
|
221
|
-
url: currentState.url
|
|
222
|
-
});
|
|
128
|
+
disabled: !currentState.edit || currentState.loading,
|
|
129
|
+
size: "small",
|
|
130
|
+
value: currentState.type,
|
|
131
|
+
onChange: (e) => {
|
|
132
|
+
currentState.type = e.target.value;
|
|
223
133
|
},
|
|
134
|
+
children: [
|
|
135
|
+
/* @__PURE__ */ jsx(MenuItem, { value: "api", children: t("webhook.url") }),
|
|
136
|
+
/* @__PURE__ */ jsx(MenuItem, { value: "slack", children: t("webhook.slack") })
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
/* @__PURE__ */ jsxs(
|
|
141
|
+
Box,
|
|
142
|
+
{
|
|
224
143
|
sx: {
|
|
225
|
-
|
|
226
|
-
|
|
144
|
+
display: "flex",
|
|
145
|
+
alignItems: "center",
|
|
146
|
+
gap: 0.5,
|
|
147
|
+
width: "100%"
|
|
227
148
|
},
|
|
228
|
-
children:
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
149
|
+
children: [
|
|
150
|
+
/* @__PURE__ */ jsx(
|
|
151
|
+
TextField,
|
|
152
|
+
{
|
|
153
|
+
sx: {
|
|
154
|
+
flex: 1,
|
|
155
|
+
".MuiInputBase-root": {
|
|
156
|
+
borderRadius: 2,
|
|
157
|
+
"&.Mui-disabled": {
|
|
158
|
+
backgroundColor: colors.backgroundsBgField
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
disabled: !currentState.edit || currentState.loading,
|
|
163
|
+
fullWidth: true,
|
|
164
|
+
size: "small",
|
|
165
|
+
required: true,
|
|
166
|
+
value: currentState.url,
|
|
167
|
+
onChange: (e) => {
|
|
168
|
+
currentState.url = e.target.value;
|
|
169
|
+
checkUrl();
|
|
170
|
+
},
|
|
171
|
+
error: !!currentState.error,
|
|
172
|
+
InputProps: {
|
|
173
|
+
endAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: inputAdornment })
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
),
|
|
177
|
+
/* @__PURE__ */ jsx(Box, { sx: { display: "flex", gap: 0.5 }, children: currentState.edit ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
178
|
+
/* @__PURE__ */ jsx(
|
|
179
|
+
IconButton,
|
|
180
|
+
{
|
|
181
|
+
color: "success",
|
|
182
|
+
onClick: onSubmit((...args) => {
|
|
183
|
+
onSave(...args);
|
|
184
|
+
currentState.edit = false;
|
|
185
|
+
}),
|
|
186
|
+
sx: {
|
|
187
|
+
borderRadius: 2,
|
|
188
|
+
border: `1px solid ${colors.strokeBorderBase}`
|
|
189
|
+
},
|
|
190
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: CheckIcon })
|
|
191
|
+
}
|
|
192
|
+
),
|
|
193
|
+
/* @__PURE__ */ jsx(
|
|
194
|
+
IconButton,
|
|
195
|
+
{
|
|
196
|
+
color: "error",
|
|
197
|
+
onClick: handleClose,
|
|
198
|
+
sx: {
|
|
199
|
+
borderRadius: 2,
|
|
200
|
+
border: `1px solid ${colors.strokeBorderBase}`
|
|
201
|
+
},
|
|
202
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: CloseRoundedIcon })
|
|
203
|
+
}
|
|
204
|
+
)
|
|
205
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
206
|
+
/* @__PURE__ */ jsx(
|
|
207
|
+
IconButton,
|
|
208
|
+
{
|
|
209
|
+
onClick: () => {
|
|
210
|
+
currentState.edit = true;
|
|
211
|
+
},
|
|
212
|
+
sx: {
|
|
213
|
+
borderRadius: 2,
|
|
214
|
+
border: `1px solid ${colors.strokeBorderBase}`
|
|
215
|
+
},
|
|
216
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: EditSquareOutlineRoundedIcon })
|
|
217
|
+
}
|
|
218
|
+
),
|
|
219
|
+
/* @__PURE__ */ jsx(
|
|
220
|
+
IconButton,
|
|
221
|
+
{
|
|
222
|
+
color: "error",
|
|
223
|
+
onClick: () => {
|
|
224
|
+
onDelete({
|
|
225
|
+
type: currentState.type,
|
|
226
|
+
url: currentState.url
|
|
227
|
+
});
|
|
228
|
+
},
|
|
229
|
+
sx: {
|
|
230
|
+
borderRadius: 2,
|
|
231
|
+
border: `1px solid ${colors.strokeBorderBase}`
|
|
232
|
+
},
|
|
233
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: DeleteOutlineRoundedIcon })
|
|
234
|
+
}
|
|
235
|
+
)
|
|
236
|
+
] }) })
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
)
|
|
240
|
+
]
|
|
241
|
+
}
|
|
242
|
+
);
|
|
243
|
+
}
|
package/lib/UserCenter/index.js
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "UserCenter", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _userCenter.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _userCenter = _interopRequireDefault(require("./components/user-center"));
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1
|
+
export { default as UserCenter } from "./components/user-center.js";
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports.api = void 0;
|
|
7
|
-
Object.defineProperty(exports, "axios", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () {
|
|
10
|
-
return _axios.default;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
var _axios = _interopRequireDefault(require("axios"));
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
_axios.default.defaults.timeout = 10 * 1e3;
|
|
16
|
-
const api = exports.api = _axios.default.create();
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
axios.defaults.timeout = 10 * 1e3;
|
|
3
|
+
const api = axios.create();
|
|
4
|
+
export { axios, api };
|
|
@@ -14,6 +14,7 @@ export declare const translations: {
|
|
|
14
14
|
walletNotification: string;
|
|
15
15
|
emailNotification: string;
|
|
16
16
|
phoneNotification: string;
|
|
17
|
+
pushNotification: string;
|
|
17
18
|
addWebhook: string;
|
|
18
19
|
saveSuccess: string;
|
|
19
20
|
saveFailed: string;
|
|
@@ -78,6 +79,10 @@ export declare const translations: {
|
|
|
78
79
|
confirmUnbind: string;
|
|
79
80
|
confirmUnbindDescription: string;
|
|
80
81
|
};
|
|
82
|
+
commonSetting: {
|
|
83
|
+
title: string;
|
|
84
|
+
locale: string;
|
|
85
|
+
};
|
|
81
86
|
};
|
|
82
87
|
en: {
|
|
83
88
|
settings: string;
|
|
@@ -94,6 +99,7 @@ export declare const translations: {
|
|
|
94
99
|
walletNotification: string;
|
|
95
100
|
emailNotification: string;
|
|
96
101
|
phoneNotification: string;
|
|
102
|
+
pushNotification: string;
|
|
97
103
|
addWebhook: string;
|
|
98
104
|
saveSuccess: string;
|
|
99
105
|
saveFailed: string;
|
|
@@ -158,5 +164,9 @@ export declare const translations: {
|
|
|
158
164
|
confirmUnbind: string;
|
|
159
165
|
confirmUnbindDescription: string;
|
|
160
166
|
};
|
|
167
|
+
commonSetting: {
|
|
168
|
+
title: string;
|
|
169
|
+
locale: string;
|
|
170
|
+
};
|
|
161
171
|
};
|
|
162
172
|
};
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.translations = void 0;
|
|
7
|
-
const translations = exports.translations = {
|
|
1
|
+
export const translations = {
|
|
8
2
|
zh: {
|
|
9
3
|
settings: "\u8BBE\u7F6E",
|
|
10
4
|
noPassport: "\u6682\u65E0\u901A\u884C\u8BC1",
|
|
@@ -20,6 +14,7 @@ const translations = exports.translations = {
|
|
|
20
14
|
walletNotification: "\u94B1\u5305\u901A\u77E5",
|
|
21
15
|
emailNotification: "\u90AE\u4EF6\u901A\u77E5",
|
|
22
16
|
phoneNotification: "\u77ED\u4FE1\u901A\u77E5",
|
|
17
|
+
pushNotification: "\u63A8\u9001\u6D88\u606F\uFF08\u7531 Push Kit \u63D0\u4F9B\uFF09",
|
|
23
18
|
addWebhook: "\u65B0\u589E\u5916\u90E8\u901A\u77E5",
|
|
24
19
|
saveSuccess: "\u4FDD\u5B58\u6210\u529F",
|
|
25
20
|
saveFailed: "\u4FDD\u5B58\u5931\u8D25",
|
|
@@ -83,6 +78,10 @@ const translations = exports.translations = {
|
|
|
83
78
|
mainProviderCantRemove: "\u4E3B\u8D26\u53F7\u4E0D\u5141\u8BB8\u89E3\u7ED1",
|
|
84
79
|
confirmUnbind: "\u786E\u5B9A\u8981\u89E3\u7ED1 {name} \u5417?",
|
|
85
80
|
confirmUnbindDescription: "\u89E3\u7ED1\u540E\u60A8\u5C06\u65E0\u6CD5\u4F7F\u7528 {name} \u767B\u5F55\u81F3\u8BE5\u8D26\u6237\u3002\u5982\u679C\u89E3\u7ED1\u540E\uFF0C\u60A8\u4ECD\u4F7F\u7528 {name} \u767B\u5F55\uFF0C\u4F1A\u81EA\u52A8\u521B\u5EFA\u4E00\u4E2A\u65B0\u8D26\u6237"
|
|
81
|
+
},
|
|
82
|
+
commonSetting: {
|
|
83
|
+
title: "\u901A\u7528\u8BBE\u7F6E",
|
|
84
|
+
locale: "\u504F\u597D\u8BED\u8A00"
|
|
86
85
|
}
|
|
87
86
|
},
|
|
88
87
|
en: {
|
|
@@ -100,6 +99,7 @@ const translations = exports.translations = {
|
|
|
100
99
|
walletNotification: "DID Wallet notification",
|
|
101
100
|
emailNotification: "Email notification",
|
|
102
101
|
phoneNotification: "SMS notification",
|
|
102
|
+
pushNotification: "Push notification (powered by Push Kit)",
|
|
103
103
|
addWebhook: "Add external notification",
|
|
104
104
|
saveSuccess: "Save succeed",
|
|
105
105
|
saveFailed: "Save failed",
|
|
@@ -163,6 +163,10 @@ const translations = exports.translations = {
|
|
|
163
163
|
mainProviderCantRemove: "Main account not allowed to remove",
|
|
164
164
|
confirmUnbind: "Are you sure to unbind {name}?",
|
|
165
165
|
confirmUnbindDescription: "You will not be able to log in to this account using {name} after unbundling. If you are still logged in with {name} after unbundling, a new account will be created automatically!"
|
|
166
|
+
},
|
|
167
|
+
commonSetting: {
|
|
168
|
+
title: "Common Settings",
|
|
169
|
+
locale: "Preferred language"
|
|
166
170
|
}
|
|
167
171
|
}
|
|
168
|
-
};
|
|
172
|
+
};
|
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
exports.formatAxiosError = exports.createPassportSvg = void 0;
|
|
7
|
-
var _ufo = require("ufo");
|
|
8
|
-
var _passport = require("@arcblock/ux/lib/Util/passport");
|
|
9
|
-
var _constant = require("@arcblock/ux/lib/Util/constant");
|
|
10
|
-
const formatAxiosError = err => {
|
|
11
|
-
const {
|
|
12
|
-
response
|
|
13
|
-
} = err;
|
|
1
|
+
import { joinURL } from "ufo";
|
|
2
|
+
import { createPassportSvg as _createPassportSvg } from "@arcblock/ux/lib/Util/passport";
|
|
3
|
+
import { AUTH_SERVICE_PREFIX } from "@arcblock/ux/lib/Util/constant";
|
|
4
|
+
export const formatAxiosError = (err) => {
|
|
5
|
+
const { response } = err;
|
|
14
6
|
if (response) {
|
|
15
7
|
return `Request failed: ${response.status} ${response.statusText}: ${JSON.stringify(response.data)}`;
|
|
16
8
|
}
|
|
17
9
|
return err.message;
|
|
18
10
|
};
|
|
19
|
-
|
|
20
|
-
const createPassportSvg = props => (0, _passport.createPassportSvg)({
|
|
11
|
+
export const createPassportSvg = (props) => _createPassportSvg({
|
|
21
12
|
...props,
|
|
22
|
-
issuerAvatarUrl:
|
|
13
|
+
issuerAvatarUrl: joinURL(window.location.origin, AUTH_SERVICE_PREFIX, "/blocklet/logo")
|
|
23
14
|
});
|
|
24
|
-
exports.createPassportSvg = createPassportSvg;
|