@blocklet/ui-react 2.9.13 → 2.9.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/build.config.ts +29 -0
- package/es/@types/index.d.ts +63 -0
- package/es/@types/index.js +0 -0
- package/es/@types/shims.d.ts +12 -0
- package/es/Dashboard/index.d.ts +41 -0
- package/es/Dashboard/index.js +63 -97
- package/es/Footer/brand.d.ts +22 -0
- package/es/Footer/brand.js +20 -37
- package/es/Footer/copyright.d.ts +18 -0
- package/es/Footer/copyright.js +14 -16
- package/es/Footer/index.d.ts +6 -0
- package/es/Footer/index.js +30 -56
- package/es/Footer/internal-footer.d.ts +29 -0
- package/es/Footer/internal-footer.js +67 -94
- package/es/Footer/layout/plain.d.ts +15 -0
- package/es/Footer/layout/plain.js +19 -37
- package/es/Footer/layout/row.d.ts +18 -0
- package/es/Footer/layout/row.js +9 -19
- package/es/Footer/layout/standard.d.ts +15 -0
- package/es/Footer/layout/standard.js +29 -57
- package/es/Footer/links.d.ts +22 -0
- package/es/Footer/links.js +72 -104
- package/es/Footer/social-media.d.ts +14 -0
- package/es/Footer/social-media.js +35 -35
- package/es/Header/index.d.ts +9 -0
- package/es/Header/index.js +55 -100
- package/es/Icon/index.d.ts +23 -0
- package/es/Icon/index.js +23 -58
- package/es/UserCenter/assets/banner.png +0 -0
- package/es/UserCenter/components/notification.d.ts +5 -0
- package/es/UserCenter/components/notification.js +276 -0
- package/es/UserCenter/components/passport.d.ts +6 -0
- package/es/UserCenter/components/passport.js +69 -0
- package/es/UserCenter/components/privacy.d.ts +11 -0
- package/es/UserCenter/components/privacy.js +99 -0
- package/es/UserCenter/components/settings.d.ts +10 -0
- package/es/UserCenter/components/settings.js +68 -0
- package/es/UserCenter/components/user-basic-info.d.ts +8 -0
- package/es/UserCenter/components/user-basic-info.js +66 -0
- package/es/UserCenter/components/user-center.d.ts +9 -0
- package/es/UserCenter/components/user-center.js +397 -0
- package/es/UserCenter/components/user-info-item.d.ts +10 -0
- package/es/UserCenter/components/user-info-item.js +54 -0
- package/es/UserCenter/components/user-info.d.ts +6 -0
- package/es/UserCenter/components/user-info.js +68 -0
- package/es/UserCenter/components/webhook-item.d.ts +3 -0
- package/es/UserCenter/components/webhook-item.js +243 -0
- package/es/UserCenter/index.d.ts +1 -0
- package/es/UserCenter/index.js +1 -0
- package/es/UserCenter/libs/client.d.ts +2 -0
- package/es/UserCenter/libs/client.js +2 -0
- package/es/UserCenter/libs/locales.d.ts +72 -0
- package/es/UserCenter/libs/locales.js +72 -0
- package/es/UserCenter/libs/utils.d.ts +4 -0
- package/es/UserCenter/libs/utils.js +14 -0
- package/es/blocklets.d.ts +16 -0
- package/es/blocklets.js +56 -45
- package/es/common/header-addons.d.ts +22 -0
- package/es/common/header-addons.js +41 -59
- package/es/common/link-blocker.d.ts +7 -0
- package/es/common/link-blocker.js +10 -17
- package/es/common/overridable-theme-provider.d.ts +18 -0
- package/es/common/overridable-theme-provider.js +6 -16
- package/es/common/wallet-hidden-topbar.d.ts +1 -0
- package/es/common/wallet-hidden-topbar.js +12 -10
- package/es/index.d.ts +5 -0
- package/es/index.js +5 -0
- package/es/types.d.ts +2 -0
- package/es/types.js +17 -11
- package/es/utils.d.ts +8 -0
- package/es/utils.js +21 -26
- package/lib/@types/index.d.ts +63 -0
- package/lib/@types/index.js +1 -0
- package/lib/@types/shims.d.ts +12 -0
- package/lib/Dashboard/index.d.ts +41 -0
- package/lib/Dashboard/index.js +44 -71
- package/lib/Footer/brand.d.ts +22 -0
- package/lib/Footer/brand.js +65 -30
- package/lib/Footer/copyright.d.ts +18 -0
- package/lib/Footer/copyright.js +18 -23
- package/lib/Footer/index.d.ts +6 -0
- package/lib/Footer/index.js +33 -42
- package/lib/Footer/internal-footer.d.ts +29 -0
- package/lib/Footer/internal-footer.js +43 -59
- package/lib/Footer/layout/plain.d.ts +15 -0
- package/lib/Footer/layout/plain.js +25 -30
- package/lib/Footer/layout/row.d.ts +18 -0
- package/lib/Footer/layout/row.js +34 -23
- package/lib/Footer/layout/standard.d.ts +15 -0
- package/lib/Footer/layout/standard.js +35 -41
- package/lib/Footer/links.d.ts +22 -0
- package/lib/Footer/links.js +163 -60
- package/lib/Footer/social-media.d.ts +14 -0
- package/lib/Footer/social-media.js +31 -25
- package/lib/Header/index.d.ts +9 -0
- package/lib/Header/index.js +83 -76
- package/lib/Icon/index.d.ts +23 -0
- package/lib/Icon/index.js +37 -51
- package/lib/UserCenter/assets/banner.png +0 -0
- package/lib/UserCenter/components/notification.d.ts +5 -0
- package/lib/UserCenter/components/notification.js +261 -0
- package/lib/UserCenter/components/passport.d.ts +6 -0
- package/lib/UserCenter/components/passport.js +86 -0
- package/lib/UserCenter/components/privacy.d.ts +11 -0
- package/lib/UserCenter/components/privacy.js +101 -0
- package/lib/UserCenter/components/settings.d.ts +10 -0
- package/lib/UserCenter/components/settings.js +81 -0
- package/lib/UserCenter/components/user-basic-info.d.ts +8 -0
- package/lib/UserCenter/components/user-basic-info.js +67 -0
- package/lib/UserCenter/components/user-center.d.ts +9 -0
- package/lib/UserCenter/components/user-center.js +376 -0
- package/lib/UserCenter/components/user-info-item.d.ts +10 -0
- package/lib/UserCenter/components/user-info-item.js +46 -0
- package/lib/UserCenter/components/user-info.d.ts +6 -0
- package/lib/UserCenter/components/user-info.js +94 -0
- package/lib/UserCenter/components/webhook-item.d.ts +3 -0
- package/lib/UserCenter/components/webhook-item.js +236 -0
- package/lib/UserCenter/index.d.ts +1 -0
- package/lib/UserCenter/index.js +13 -0
- package/lib/UserCenter/libs/client.d.ts +2 -0
- package/lib/UserCenter/libs/client.js +8 -0
- package/lib/UserCenter/libs/locales.d.ts +72 -0
- package/lib/UserCenter/libs/locales.js +78 -0
- package/lib/UserCenter/libs/utils.d.ts +4 -0
- package/lib/UserCenter/libs/utils.js +25 -0
- package/lib/blocklets.d.ts +16 -0
- package/lib/blocklets.js +28 -36
- package/lib/common/header-addons.d.ts +22 -0
- package/lib/common/header-addons.js +24 -36
- package/lib/common/link-blocker.d.ts +7 -0
- package/lib/common/link-blocker.js +10 -18
- package/lib/common/overridable-theme-provider.d.ts +18 -0
- package/lib/common/overridable-theme-provider.js +9 -14
- package/lib/common/wallet-hidden-topbar.d.ts +1 -0
- package/lib/common/wallet-hidden-topbar.js +1 -3
- package/lib/index.d.ts +5 -0
- package/lib/index.js +52 -0
- package/lib/types.d.ts +2 -0
- package/lib/types.js +3 -5
- package/lib/utils.d.ts +8 -0
- package/lib/utils.js +16 -23
- package/package.json +17 -11
- package/src/@types/index.ts +70 -0
- package/src/@types/shims.d.ts +12 -0
- package/src/UserCenter/assets/banner.png +0 -0
- package/src/UserCenter/components/notification.tsx +275 -0
- package/src/UserCenter/components/passport.tsx +83 -0
- package/src/UserCenter/components/privacy.tsx +107 -0
- package/src/UserCenter/components/settings.tsx +78 -0
- package/src/UserCenter/components/user-basic-info.tsx +70 -0
- package/src/UserCenter/components/user-center.tsx +410 -0
- package/src/UserCenter/components/user-info-item.tsx +50 -0
- package/src/UserCenter/components/user-info.tsx +85 -0
- package/src/UserCenter/components/webhook-item.tsx +243 -0
- package/src/UserCenter/index.tsx +1 -0
- package/src/UserCenter/libs/client.ts +3 -0
- package/src/UserCenter/libs/locales.ts +72 -0
- package/src/UserCenter/libs/utils.ts +21 -0
- package/src/blocklets.js +2 -0
- package/src/index.ts +9 -0
- /package/src/common/{link-blocker.js → link-blocker.jsx} +0 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
module.exports = UserInfo;
|
|
7
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
+
var _material = require("@mui/material");
|
|
9
|
+
var _react = require("@iconify/react");
|
|
10
|
+
var _ahooks = require("ahooks");
|
|
11
|
+
var _mailOutlineRounded = _interopRequireDefault(require("@iconify-icons/material-symbols/mail-outline-rounded"));
|
|
12
|
+
var _scheduleOutlineRounded = _interopRequireDefault(require("@iconify-icons/material-symbols/schedule-outline-rounded"));
|
|
13
|
+
var _moreTimeRounded = _interopRequireDefault(require("@iconify-icons/material-symbols/more-time-rounded"));
|
|
14
|
+
var _captivePortalRounded = _interopRequireDefault(require("@iconify-icons/material-symbols/captive-portal-rounded"));
|
|
15
|
+
var _util = require("@arcblock/ux/lib/Locale/util");
|
|
16
|
+
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
17
|
+
var _RelativeTime = _interopRequireDefault(require("@arcblock/ux/lib/RelativeTime"));
|
|
18
|
+
var _userInfoItem = _interopRequireDefault(require("./user-info-item"));
|
|
19
|
+
var _locales = require("../libs/locales");
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
function UserInfo({
|
|
22
|
+
user,
|
|
23
|
+
...rest
|
|
24
|
+
}) {
|
|
25
|
+
const {
|
|
26
|
+
locale
|
|
27
|
+
} = (0, _context.useLocaleContext)();
|
|
28
|
+
const t = (0, _ahooks.useMemoizedFn)((key, data = {}) => {
|
|
29
|
+
return (0, _util.translate)(_locales.translations, key, locale, "en", data);
|
|
30
|
+
});
|
|
31
|
+
const readableProvider = (0, _ahooks.useCreation)(() => {
|
|
32
|
+
const nameMap = {
|
|
33
|
+
wallet: "DID Wallet",
|
|
34
|
+
auth0: "Auth0"
|
|
35
|
+
};
|
|
36
|
+
return nameMap[user.sourceProvider] || t("unknown");
|
|
37
|
+
}, [user?.sourceProvider]);
|
|
38
|
+
const userInfoListData = [];
|
|
39
|
+
userInfoListData.push({
|
|
40
|
+
icon: /* @__PURE__ */(0, _jsxRuntime.jsx)(_react.Icon, {
|
|
41
|
+
fontSize: 16,
|
|
42
|
+
icon: _mailOutlineRounded.default
|
|
43
|
+
}),
|
|
44
|
+
title: t("email"),
|
|
45
|
+
content: user?.email || t("emptyField")
|
|
46
|
+
});
|
|
47
|
+
userInfoListData.push({
|
|
48
|
+
icon: /* @__PURE__ */(0, _jsxRuntime.jsx)(_react.Icon, {
|
|
49
|
+
fontSize: 16,
|
|
50
|
+
icon: _scheduleOutlineRounded.default
|
|
51
|
+
}),
|
|
52
|
+
title: t("lastLogin"),
|
|
53
|
+
content: /* @__PURE__ */(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
54
|
+
children: user?.lastLoginAt || user?.lastLoginIp ? /* @__PURE__ */(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
55
|
+
children: [user?.lastLoginAt ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_RelativeTime.default, {
|
|
56
|
+
locale,
|
|
57
|
+
value: user?.lastLoginAt
|
|
58
|
+
}) : null, user?.lastLoginAt && user?.lastLoginIp ? /* @__PURE__ */(0, _jsxRuntime.jsx)("br", {}) : null, user?.lastLoginIp]
|
|
59
|
+
}) : t("unknown")
|
|
60
|
+
})
|
|
61
|
+
});
|
|
62
|
+
userInfoListData.push({
|
|
63
|
+
icon: /* @__PURE__ */(0, _jsxRuntime.jsx)(_react.Icon, {
|
|
64
|
+
fontSize: 16,
|
|
65
|
+
icon: _moreTimeRounded.default
|
|
66
|
+
}),
|
|
67
|
+
title: t("createdAt"),
|
|
68
|
+
content: user?.createdAt ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_RelativeTime.default, {
|
|
69
|
+
locale,
|
|
70
|
+
value: user?.createdAt
|
|
71
|
+
}) : t("unknown")
|
|
72
|
+
});
|
|
73
|
+
userInfoListData.push({
|
|
74
|
+
icon: /* @__PURE__ */(0, _jsxRuntime.jsx)(_react.Icon, {
|
|
75
|
+
fontSize: 16,
|
|
76
|
+
icon: _captivePortalRounded.default
|
|
77
|
+
}),
|
|
78
|
+
title: t("registerFrom"),
|
|
79
|
+
content: readableProvider
|
|
80
|
+
});
|
|
81
|
+
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Paper, {
|
|
82
|
+
variant: "outlined",
|
|
83
|
+
...rest,
|
|
84
|
+
sx: {
|
|
85
|
+
display: "flex",
|
|
86
|
+
flexDirection: "column",
|
|
87
|
+
gap: 3,
|
|
88
|
+
...rest?.sx
|
|
89
|
+
},
|
|
90
|
+
children: userInfoListData.map(item => /* @__PURE__ */(0, _jsxRuntime.jsx)(_userInfoItem.default, {
|
|
91
|
+
data: item
|
|
92
|
+
}, item.title))
|
|
93
|
+
});
|
|
94
|
+
}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
module.exports = WebhookItem;
|
|
7
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
+
var _material = require("@mui/material");
|
|
9
|
+
var _ahooks = require("ahooks");
|
|
10
|
+
var _noop = _interopRequireDefault(require("lodash/noop"));
|
|
11
|
+
var _isUrl = _interopRequireDefault(require("is-url"));
|
|
12
|
+
var _Colors = require("@arcblock/ux/lib/Colors");
|
|
13
|
+
var _react = require("@iconify/react");
|
|
14
|
+
var _closeRounded = _interopRequireDefault(require("@iconify-icons/material-symbols/close-rounded"));
|
|
15
|
+
var _check = _interopRequireDefault(require("@iconify-icons/material-symbols/check"));
|
|
16
|
+
var _sendRounded = _interopRequireDefault(require("@iconify-icons/material-symbols/send-rounded"));
|
|
17
|
+
var _editSquareOutlineRounded = _interopRequireDefault(require("@iconify-icons/material-symbols/edit-square-outline-rounded"));
|
|
18
|
+
var _deleteOutlineRounded = _interopRequireDefault(require("@iconify-icons/material-symbols/delete-outline-rounded"));
|
|
19
|
+
var _util = require("@arcblock/ux/lib/Locale/util");
|
|
20
|
+
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
21
|
+
var _locales = require("../libs/locales");
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
function WebhookItem({
|
|
24
|
+
onTest = _noop.default,
|
|
25
|
+
onDelete = _noop.default,
|
|
26
|
+
onSave = _noop.default,
|
|
27
|
+
onCancel = _noop.default,
|
|
28
|
+
type = "slack",
|
|
29
|
+
url = "",
|
|
30
|
+
edit = false
|
|
31
|
+
}) {
|
|
32
|
+
const {
|
|
33
|
+
locale
|
|
34
|
+
} = (0, _context.useLocaleContext)();
|
|
35
|
+
const t = (0, _ahooks.useMemoizedFn)((key, data = {}) => {
|
|
36
|
+
return (0, _util.translate)(_locales.translations, key, locale, "en", data);
|
|
37
|
+
});
|
|
38
|
+
const currentState = (0, _ahooks.useReactive)({
|
|
39
|
+
type: type || "slack",
|
|
40
|
+
url: url || "",
|
|
41
|
+
edit: edit ?? false,
|
|
42
|
+
error: "",
|
|
43
|
+
loading: false
|
|
44
|
+
});
|
|
45
|
+
const checkUrl = (0, _ahooks.useMemoizedFn)(() => {
|
|
46
|
+
if (!currentState.url) {
|
|
47
|
+
currentState.error = t("common.required");
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
if (!(0, _isUrl.default)(currentState.url)) {
|
|
51
|
+
currentState.error = t("common.invalid");
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
currentState.error = "";
|
|
55
|
+
return true;
|
|
56
|
+
});
|
|
57
|
+
const handleClose = (0, _ahooks.useMemoizedFn)(() => {
|
|
58
|
+
currentState.edit = false;
|
|
59
|
+
currentState.url = url || "";
|
|
60
|
+
currentState.type = type || "slack";
|
|
61
|
+
currentState.error = "";
|
|
62
|
+
currentState.loading = false;
|
|
63
|
+
onCancel();
|
|
64
|
+
});
|
|
65
|
+
const _onTest = (0, _ahooks.useMemoizedFn)(async data => {
|
|
66
|
+
currentState.loading = true;
|
|
67
|
+
await onTest(data);
|
|
68
|
+
currentState.loading = false;
|
|
69
|
+
});
|
|
70
|
+
const onSubmit = (0, _ahooks.useMemoizedFn)(fn => {
|
|
71
|
+
return () => {
|
|
72
|
+
if (checkUrl()) {
|
|
73
|
+
fn({
|
|
74
|
+
type: currentState.type,
|
|
75
|
+
url: currentState.url
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
const inputAdornment = (0, _ahooks.useCreation)(() => {
|
|
81
|
+
if (currentState.error) {
|
|
82
|
+
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
83
|
+
component: "span",
|
|
84
|
+
color: "error",
|
|
85
|
+
children: currentState.error
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
if (currentState.edit) {
|
|
89
|
+
if (currentState.loading) {
|
|
90
|
+
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.CircularProgress, {
|
|
91
|
+
size: 16
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
95
|
+
size: "small",
|
|
96
|
+
onClick: onSubmit(_onTest),
|
|
97
|
+
sx: {
|
|
98
|
+
mr: -1
|
|
99
|
+
},
|
|
100
|
+
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_react.Icon, {
|
|
101
|
+
icon: _sendRounded.default
|
|
102
|
+
})
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return null;
|
|
106
|
+
}, [currentState.error, currentState.edit, currentState.loading]);
|
|
107
|
+
return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
108
|
+
sx: {
|
|
109
|
+
display: "flex",
|
|
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, {
|
|
142
|
+
sx: {
|
|
143
|
+
display: "flex",
|
|
144
|
+
alignItems: "center",
|
|
145
|
+
gap: 0.5,
|
|
146
|
+
width: "100%"
|
|
147
|
+
},
|
|
148
|
+
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.TextField, {
|
|
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();
|
|
166
|
+
},
|
|
167
|
+
error: !!currentState.error,
|
|
168
|
+
InputProps: {
|
|
169
|
+
endAdornment: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.InputAdornment, {
|
|
170
|
+
position: "end",
|
|
171
|
+
children: inputAdornment
|
|
172
|
+
})
|
|
173
|
+
}
|
|
174
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
|
|
175
|
+
sx: {
|
|
176
|
+
display: "flex",
|
|
177
|
+
gap: 0.5
|
|
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
|
+
},
|
|
209
|
+
sx: {
|
|
210
|
+
borderRadius: 2,
|
|
211
|
+
border: `1px solid ${_Colors.temp.strokeBorderBase}`
|
|
212
|
+
},
|
|
213
|
+
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_react.Icon, {
|
|
214
|
+
icon: _editSquareOutlineRounded.default
|
|
215
|
+
})
|
|
216
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
217
|
+
color: "error",
|
|
218
|
+
onClick: () => {
|
|
219
|
+
onDelete({
|
|
220
|
+
type: currentState.type,
|
|
221
|
+
url: currentState.url
|
|
222
|
+
});
|
|
223
|
+
},
|
|
224
|
+
sx: {
|
|
225
|
+
borderRadius: 2,
|
|
226
|
+
border: `1px solid ${_Colors.temp.strokeBorderBase}`
|
|
227
|
+
},
|
|
228
|
+
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_react.Icon, {
|
|
229
|
+
icon: _deleteOutlineRounded.default
|
|
230
|
+
})
|
|
231
|
+
})]
|
|
232
|
+
})
|
|
233
|
+
})]
|
|
234
|
+
})]
|
|
235
|
+
});
|
|
236
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UserCenter } from './components/user-center';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
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 }; }
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export declare const translations: {
|
|
2
|
+
zh: {
|
|
3
|
+
settings: string;
|
|
4
|
+
noPassport: string;
|
|
5
|
+
passport: string;
|
|
6
|
+
notification: string;
|
|
7
|
+
email: string;
|
|
8
|
+
lastLogin: string;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
registerFrom: string;
|
|
11
|
+
unknown: string;
|
|
12
|
+
walletNotification: string;
|
|
13
|
+
emailNotification: string;
|
|
14
|
+
phoneNotification: string;
|
|
15
|
+
addWebhook: string;
|
|
16
|
+
saveSuccess: string;
|
|
17
|
+
saveFailed: string;
|
|
18
|
+
webhookTested: string;
|
|
19
|
+
done: string;
|
|
20
|
+
emptyField: string;
|
|
21
|
+
emptyContent: string;
|
|
22
|
+
underProtected: string;
|
|
23
|
+
noUserFound: string;
|
|
24
|
+
notificationManagement: string;
|
|
25
|
+
privacyManagement: string;
|
|
26
|
+
webhook: {
|
|
27
|
+
url: string;
|
|
28
|
+
slack: string;
|
|
29
|
+
};
|
|
30
|
+
common: {
|
|
31
|
+
required: string;
|
|
32
|
+
invalid: string;
|
|
33
|
+
};
|
|
34
|
+
toPublic: string;
|
|
35
|
+
currentPassport: string;
|
|
36
|
+
};
|
|
37
|
+
en: {
|
|
38
|
+
settings: string;
|
|
39
|
+
noPassport: string;
|
|
40
|
+
passport: string;
|
|
41
|
+
notification: string;
|
|
42
|
+
email: string;
|
|
43
|
+
lastLogin: string;
|
|
44
|
+
createdAt: string;
|
|
45
|
+
registerFrom: string;
|
|
46
|
+
unknown: string;
|
|
47
|
+
walletNotification: string;
|
|
48
|
+
emailNotification: string;
|
|
49
|
+
phoneNotification: string;
|
|
50
|
+
addWebhook: string;
|
|
51
|
+
saveSuccess: string;
|
|
52
|
+
saveFailed: string;
|
|
53
|
+
webhookTested: string;
|
|
54
|
+
done: string;
|
|
55
|
+
emptyField: string;
|
|
56
|
+
notificationManagement: string;
|
|
57
|
+
privacyManagement: string;
|
|
58
|
+
emptyContent: string;
|
|
59
|
+
underProtected: string;
|
|
60
|
+
noUserFound: string;
|
|
61
|
+
webhook: {
|
|
62
|
+
url: string;
|
|
63
|
+
slack: string;
|
|
64
|
+
};
|
|
65
|
+
common: {
|
|
66
|
+
required: string;
|
|
67
|
+
invalid: string;
|
|
68
|
+
};
|
|
69
|
+
toPublic: string;
|
|
70
|
+
currentPassport: string;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.translations = void 0;
|
|
7
|
+
const translations = exports.translations = {
|
|
8
|
+
zh: {
|
|
9
|
+
settings: "\u8BBE\u7F6E",
|
|
10
|
+
noPassport: "\u6682\u65E0\u901A\u884C\u8BC1",
|
|
11
|
+
passport: "\u901A\u884C\u8BC1",
|
|
12
|
+
notification: "\u901A\u77E5",
|
|
13
|
+
email: "\u90AE\u7BB1\u5730\u5740",
|
|
14
|
+
lastLogin: "\u4E0A\u6B21\u767B\u5F55",
|
|
15
|
+
createdAt: "\u521B\u5EFA\u65F6\u95F4",
|
|
16
|
+
registerFrom: "\u6CE8\u518C\u6765\u6E90",
|
|
17
|
+
unknown: "\u672A\u77E5",
|
|
18
|
+
walletNotification: "\u94B1\u5305\u901A\u77E5",
|
|
19
|
+
emailNotification: "\u90AE\u4EF6\u901A\u77E5",
|
|
20
|
+
phoneNotification: "\u77ED\u4FE1\u901A\u77E5",
|
|
21
|
+
addWebhook: "\u65B0\u589E\u5916\u90E8\u901A\u77E5",
|
|
22
|
+
saveSuccess: "\u4FDD\u5B58\u6210\u529F",
|
|
23
|
+
saveFailed: "\u4FDD\u5B58\u5931\u8D25",
|
|
24
|
+
webhookTested: "\u6D4B\u8BD5\u6D88\u606F\u5DF2\u7ECF\u53D1\u9001",
|
|
25
|
+
done: "\u5B8C\u6210",
|
|
26
|
+
emptyField: "\u672A\u586B\u5199",
|
|
27
|
+
emptyContent: "\u6682\u65E0\u5185\u5BB9",
|
|
28
|
+
underProtected: "\u7528\u6237\u5DF2\u8BBE\u7F6E\u9690\u79C1\u4FDD\u62A4",
|
|
29
|
+
noUserFound: "\u672A\u627E\u5230\u6307\u5B9A\u7684\u7528\u6237",
|
|
30
|
+
notificationManagement: "\u901A\u77E5\u7BA1\u7406",
|
|
31
|
+
privacyManagement: "\u9690\u79C1\u7BA1\u7406",
|
|
32
|
+
webhook: {
|
|
33
|
+
url: "\u81EA\u5B9A\u4E49URL",
|
|
34
|
+
slack: "Slack"
|
|
35
|
+
},
|
|
36
|
+
common: {
|
|
37
|
+
required: "\u5FC5\u586B\u7684",
|
|
38
|
+
invalid: "\u65E0\u6548"
|
|
39
|
+
},
|
|
40
|
+
toPublic: "\u516C\u5F00 \u201C{name}\u201D \u9875\u9762",
|
|
41
|
+
currentPassport: "\u5F53\u524D\u4F7F\u7528\u7684\u901A\u884C\u8BC1"
|
|
42
|
+
},
|
|
43
|
+
en: {
|
|
44
|
+
settings: "Settings",
|
|
45
|
+
noPassport: "No passport founded",
|
|
46
|
+
passport: "Passport",
|
|
47
|
+
notification: "Notification",
|
|
48
|
+
email: "Email",
|
|
49
|
+
lastLogin: "Last Login & IP",
|
|
50
|
+
createdAt: "Created At",
|
|
51
|
+
registerFrom: "Register From",
|
|
52
|
+
unknown: "Unknown",
|
|
53
|
+
walletNotification: "DID Wallet notification",
|
|
54
|
+
emailNotification: "Email notification",
|
|
55
|
+
phoneNotification: "SMS notification",
|
|
56
|
+
addWebhook: "Add external notification",
|
|
57
|
+
saveSuccess: "Save succeed",
|
|
58
|
+
saveFailed: "Save failed",
|
|
59
|
+
webhookTested: "Test message sent",
|
|
60
|
+
done: "Done",
|
|
61
|
+
emptyField: "Empty field",
|
|
62
|
+
notificationManagement: "Notification",
|
|
63
|
+
privacyManagement: "Privacy",
|
|
64
|
+
emptyContent: "Empty",
|
|
65
|
+
underProtected: "This page has protected privacy",
|
|
66
|
+
noUserFound: "No user found",
|
|
67
|
+
webhook: {
|
|
68
|
+
url: "Custom url",
|
|
69
|
+
slack: "Slack"
|
|
70
|
+
},
|
|
71
|
+
common: {
|
|
72
|
+
required: "Required",
|
|
73
|
+
invalid: "Invalid"
|
|
74
|
+
},
|
|
75
|
+
toPublic: 'Public "{name}" page',
|
|
76
|
+
currentPassport: "Passport currently in use"
|
|
77
|
+
}
|
|
78
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.formatAxiosError = exports.createPassportSvg = void 0;
|
|
7
|
+
var _urlJoin = _interopRequireDefault(require("url-join"));
|
|
8
|
+
var _constant = require("@abtnode/constant");
|
|
9
|
+
var _passport = require("@arcblock/ux/lib/Util/passport");
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
const formatAxiosError = err => {
|
|
12
|
+
const {
|
|
13
|
+
response
|
|
14
|
+
} = err;
|
|
15
|
+
if (response) {
|
|
16
|
+
return `Request failed: ${response.status} ${response.statusText}: ${JSON.stringify(response.data)}`;
|
|
17
|
+
}
|
|
18
|
+
return err.message;
|
|
19
|
+
};
|
|
20
|
+
exports.formatAxiosError = formatAxiosError;
|
|
21
|
+
const createPassportSvg = props => (0, _passport.createPassportSvg)({
|
|
22
|
+
...props,
|
|
23
|
+
issuerAvatarUrl: (0, _urlJoin.default)(window.location.origin, _constant.WELLKNOWN_SERVICE_PATH_PREFIX, "/blocklet/logo")
|
|
24
|
+
});
|
|
25
|
+
exports.createPassportSvg = createPassportSvg;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const publicPath: any;
|
|
2
|
+
export function formatTheme(theme: any): any;
|
|
3
|
+
export function getLocalizedNavigation(navigation: any, locale?: string): any;
|
|
4
|
+
export function formatNavigation(navigation: any): any;
|
|
5
|
+
export function parseNavigation(navigation: any): {
|
|
6
|
+
header: never[];
|
|
7
|
+
footer: never[];
|
|
8
|
+
social: never[];
|
|
9
|
+
bottom: never[];
|
|
10
|
+
dashboard: never[];
|
|
11
|
+
sessionManager: never[];
|
|
12
|
+
userCenter: never[];
|
|
13
|
+
} | null;
|
|
14
|
+
export function formatBlockletInfo(blockletInfo: any): any;
|
|
15
|
+
export function filterValidNavItems(navigation?: any[]): any;
|
|
16
|
+
export function filterNavByRole(nav: object[], userRole: string): any;
|