@blocklet/ui-react 2.9.90 → 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.
Files changed (209) hide show
  1. package/build.config.ts +1 -6
  2. package/lib/@types/index.d.ts +1 -0
  3. package/lib/@types/index.js +0 -1
  4. package/lib/BlockletStudio/index.js +50 -50
  5. package/lib/ComponentInstaller/index.js +122 -202
  6. package/lib/ComponentInstaller/installer-item.js +116 -138
  7. package/lib/ComponentInstaller/locales.js +5 -10
  8. package/lib/ComponentInstaller/use-component-installed.js +37 -41
  9. package/lib/ComponentManager/components/add-component.js +58 -67
  10. package/lib/ComponentManager/components/check-component.js +2 -9
  11. package/lib/ComponentManager/components/publish-component.js +50 -59
  12. package/lib/ComponentManager/components/resource-dialog.js +42 -39
  13. package/lib/ComponentManager/index.js +3 -27
  14. package/lib/ComponentManager/libs/locales.js +2 -8
  15. package/lib/Dashboard/index.js +74 -99
  16. package/lib/Footer/brand.js +21 -43
  17. package/lib/Footer/copyright.js +15 -24
  18. package/lib/Footer/index.js +47 -71
  19. package/lib/Footer/internal-footer.js +72 -100
  20. package/lib/Footer/layout/plain.js +26 -45
  21. package/lib/Footer/layout/row.js +12 -29
  22. package/lib/Footer/layout/standard.js +34 -64
  23. package/lib/Footer/links.js +74 -104
  24. package/lib/Footer/social-media.js +35 -42
  25. package/lib/Header/index.js +69 -117
  26. package/lib/Icon/index.js +18 -53
  27. package/{es/UserCenter/components/notification.d.ts → lib/UserCenter/components/config-profile.d.ts} +1 -1
  28. package/lib/UserCenter/components/config-profile.js +67 -0
  29. package/lib/UserCenter/components/notification.js +203 -186
  30. package/lib/UserCenter/components/passport.js +70 -79
  31. package/lib/UserCenter/components/privacy.js +86 -88
  32. package/lib/UserCenter/components/settings.js +74 -84
  33. package/lib/UserCenter/components/storage/connect-to.js +56 -75
  34. package/lib/UserCenter/components/storage/connected.js +16 -37
  35. package/lib/UserCenter/components/storage/delete.js +42 -51
  36. package/lib/UserCenter/components/storage/disconnect.js +15 -29
  37. package/lib/UserCenter/components/storage/index.js +20 -54
  38. package/lib/UserCenter/components/storage/item.js +94 -122
  39. package/lib/UserCenter/components/storage/preview-nft.js +77 -85
  40. package/lib/UserCenter/components/third-party-login/index.js +49 -61
  41. package/lib/UserCenter/components/third-party-login/third-party-item.js +159 -176
  42. package/lib/UserCenter/components/user-center.js +276 -287
  43. package/lib/UserCenter/components/user-info/index.js +3 -27
  44. package/lib/UserCenter/components/user-info/user-basic-info.js +134 -129
  45. package/lib/UserCenter/components/user-info/user-info-item.js +43 -37
  46. package/lib/UserCenter/components/user-info/user-info.js +41 -74
  47. package/lib/UserCenter/components/webhook-item.js +184 -177
  48. package/lib/UserCenter/index.js +1 -13
  49. package/lib/UserCenter/libs/api.js +4 -16
  50. package/lib/UserCenter/libs/locales.d.ts +10 -0
  51. package/lib/UserCenter/libs/locales.js +12 -8
  52. package/lib/UserCenter/libs/utils.js +7 -17
  53. package/lib/UserSessions/components/user-session-info.js +88 -85
  54. package/lib/UserSessions/components/user-sessions.js +177 -213
  55. package/lib/UserSessions/index.js +1 -13
  56. package/lib/UserSessions/libs/locales.js +2 -8
  57. package/lib/UserSessions/libs/utils.js +4 -11
  58. package/lib/blocklets.js +59 -63
  59. package/lib/common/header-addons.js +44 -60
  60. package/lib/common/link-blocker.js +9 -18
  61. package/lib/common/overridable-theme-provider.js +10 -23
  62. package/lib/common/wallet-hidden-topbar.js +7 -14
  63. package/lib/contexts/config-user-space.js +38 -46
  64. package/lib/hooks/use-mobile.js +5 -13
  65. package/lib/index.js +10 -100
  66. package/lib/libs/client.js +2 -8
  67. package/lib/libs/spaces.js +6 -13
  68. package/lib/types.js +39 -41
  69. package/lib/utils.js +25 -44
  70. package/package.json +8 -38
  71. package/src/@types/index.ts +1 -0
  72. package/src/Footer/brand.jsx +6 -1
  73. package/src/UserCenter/components/config-profile.tsx +70 -0
  74. package/src/UserCenter/components/notification.tsx +63 -47
  75. package/src/UserCenter/components/settings.tsx +6 -0
  76. package/src/UserCenter/libs/locales.ts +10 -0
  77. package/es/@types/index.d.ts +0 -101
  78. package/es/@types/index.js +0 -0
  79. package/es/@types/shims.d.ts +0 -16
  80. package/es/BlockletStudio/index.d.ts +0 -28
  81. package/es/BlockletStudio/index.js +0 -114
  82. package/es/ComponentInstaller/index.d.ts +0 -37
  83. package/es/ComponentInstaller/index.js +0 -200
  84. package/es/ComponentInstaller/installer-item.d.ts +0 -21
  85. package/es/ComponentInstaller/installer-item.js +0 -139
  86. package/es/ComponentInstaller/locales.d.ts +0 -28
  87. package/es/ComponentInstaller/locales.js +0 -22
  88. package/es/ComponentInstaller/use-component-installed.d.ts +0 -12
  89. package/es/ComponentInstaller/use-component-installed.js +0 -88
  90. package/es/ComponentManager/components/add-component.d.ts +0 -16
  91. package/es/ComponentManager/components/add-component.js +0 -114
  92. package/es/ComponentManager/components/check-component.d.ts +0 -2
  93. package/es/ComponentManager/components/check-component.js +0 -2
  94. package/es/ComponentManager/components/publish-component.d.ts +0 -10
  95. package/es/ComponentManager/components/publish-component.js +0 -76
  96. package/es/ComponentManager/components/resource-dialog.d.ts +0 -14
  97. package/es/ComponentManager/components/resource-dialog.js +0 -74
  98. package/es/ComponentManager/index.d.ts +0 -3
  99. package/es/ComponentManager/index.js +0 -3
  100. package/es/ComponentManager/libs/locales.d.ts +0 -14
  101. package/es/ComponentManager/libs/locales.js +0 -14
  102. package/es/Dashboard/index.d.ts +0 -40
  103. package/es/Dashboard/index.js +0 -118
  104. package/es/Footer/brand.d.ts +0 -22
  105. package/es/Footer/brand.js +0 -73
  106. package/es/Footer/copyright.d.ts +0 -18
  107. package/es/Footer/copyright.js +0 -25
  108. package/es/Footer/index.d.ts +0 -6
  109. package/es/Footer/index.js +0 -82
  110. package/es/Footer/internal-footer.d.ts +0 -29
  111. package/es/Footer/internal-footer.js +0 -117
  112. package/es/Footer/layout/plain.d.ts +0 -15
  113. package/es/Footer/layout/plain.js +0 -39
  114. package/es/Footer/layout/row.d.ts +0 -18
  115. package/es/Footer/layout/row.js +0 -41
  116. package/es/Footer/layout/standard.d.ts +0 -15
  117. package/es/Footer/layout/standard.js +0 -53
  118. package/es/Footer/links.d.ts +0 -22
  119. package/es/Footer/links.js +0 -207
  120. package/es/Footer/social-media.d.ts +0 -14
  121. package/es/Footer/social-media.js +0 -60
  122. package/es/Header/index.d.ts +0 -10
  123. package/es/Header/index.js +0 -155
  124. package/es/Icon/index.d.ts +0 -23
  125. package/es/Icon/index.js +0 -55
  126. package/es/UserCenter/assets/banner.png +0 -0
  127. package/es/UserCenter/components/notification.js +0 -248
  128. package/es/UserCenter/components/passport.d.ts +0 -6
  129. package/es/UserCenter/components/passport.js +0 -88
  130. package/es/UserCenter/components/privacy.d.ts +0 -11
  131. package/es/UserCenter/components/privacy.js +0 -99
  132. package/es/UserCenter/components/settings.d.ts +0 -9
  133. package/es/UserCenter/components/settings.js +0 -89
  134. package/es/UserCenter/components/storage/connect-to.d.ts +0 -7
  135. package/es/UserCenter/components/storage/connect-to.js +0 -108
  136. package/es/UserCenter/components/storage/connected.d.ts +0 -7
  137. package/es/UserCenter/components/storage/connected.js +0 -24
  138. package/es/UserCenter/components/storage/delete.d.ts +0 -7
  139. package/es/UserCenter/components/storage/delete.js +0 -62
  140. package/es/UserCenter/components/storage/disconnect.d.ts +0 -3
  141. package/es/UserCenter/components/storage/disconnect.js +0 -23
  142. package/es/UserCenter/components/storage/icons/empty-spaces-nft.svg +0 -58
  143. package/es/UserCenter/components/storage/icons/long-arrow.svg +0 -5
  144. package/es/UserCenter/components/storage/icons/space-connected.svg +0 -3
  145. package/es/UserCenter/components/storage/icons/space-disconnect.svg +0 -3
  146. package/es/UserCenter/components/storage/index.d.ts +0 -3
  147. package/es/UserCenter/components/storage/index.js +0 -27
  148. package/es/UserCenter/components/storage/item.d.ts +0 -9
  149. package/es/UserCenter/components/storage/item.js +0 -158
  150. package/es/UserCenter/components/storage/preview-nft.d.ts +0 -6
  151. package/es/UserCenter/components/storage/preview-nft.js +0 -80
  152. package/es/UserCenter/components/third-party-login/index.d.ts +0 -5
  153. package/es/UserCenter/components/third-party-login/index.js +0 -110
  154. package/es/UserCenter/components/third-party-login/third-party-item.d.ts +0 -13
  155. package/es/UserCenter/components/third-party-login/third-party-item.js +0 -224
  156. package/es/UserCenter/components/user-center.d.ts +0 -15
  157. package/es/UserCenter/components/user-center.js +0 -414
  158. package/es/UserCenter/components/user-info/index.d.ts +0 -3
  159. package/es/UserCenter/components/user-info/index.js +0 -3
  160. package/es/UserCenter/components/user-info/user-basic-info.d.ts +0 -11
  161. package/es/UserCenter/components/user-info/user-basic-info.js +0 -151
  162. package/es/UserCenter/components/user-info/user-info-item.d.ts +0 -11
  163. package/es/UserCenter/components/user-info/user-info-item.js +0 -47
  164. package/es/UserCenter/components/user-info/user-info.d.ts +0 -6
  165. package/es/UserCenter/components/user-info/user-info.js +0 -66
  166. package/es/UserCenter/components/webhook-item.d.ts +0 -3
  167. package/es/UserCenter/components/webhook-item.js +0 -243
  168. package/es/UserCenter/index.d.ts +0 -1
  169. package/es/UserCenter/index.js +0 -1
  170. package/es/UserCenter/libs/api.d.ts +0 -3
  171. package/es/UserCenter/libs/api.js +0 -4
  172. package/es/UserCenter/libs/locales.d.ts +0 -162
  173. package/es/UserCenter/libs/locales.js +0 -162
  174. package/es/UserCenter/libs/utils.d.ts +0 -4
  175. package/es/UserCenter/libs/utils.js +0 -14
  176. package/es/UserSessions/components/user-session-info.d.ts +0 -6
  177. package/es/UserSessions/components/user-session-info.js +0 -92
  178. package/es/UserSessions/components/user-sessions.d.ts +0 -9
  179. package/es/UserSessions/components/user-sessions.js +0 -265
  180. package/es/UserSessions/index.d.ts +0 -1
  181. package/es/UserSessions/index.js +0 -1
  182. package/es/UserSessions/libs/locales.d.ts +0 -58
  183. package/es/UserSessions/libs/locales.js +0 -58
  184. package/es/UserSessions/libs/utils.d.ts +0 -2
  185. package/es/UserSessions/libs/utils.js +0 -73
  186. package/es/blocklets.d.ts +0 -16
  187. package/es/blocklets.js +0 -178
  188. package/es/common/header-addons.d.ts +0 -21
  189. package/es/common/header-addons.js +0 -83
  190. package/es/common/link-blocker.d.ts +0 -7
  191. package/es/common/link-blocker.js +0 -18
  192. package/es/common/overridable-theme-provider.d.ts +0 -18
  193. package/es/common/overridable-theme-provider.js +0 -15
  194. package/es/common/wallet-hidden-topbar.d.ts +0 -1
  195. package/es/common/wallet-hidden-topbar.js +0 -14
  196. package/es/contexts/config-user-space.d.ts +0 -26
  197. package/es/contexts/config-user-space.js +0 -53
  198. package/es/hooks/use-mobile.d.ts +0 -4
  199. package/es/hooks/use-mobile.js +0 -5
  200. package/es/index.d.ts +0 -10
  201. package/es/index.js +0 -10
  202. package/es/libs/client.d.ts +0 -2
  203. package/es/libs/client.js +0 -2
  204. package/es/libs/spaces.d.ts +0 -2
  205. package/es/libs/spaces.js +0 -13
  206. package/es/types.d.ts +0 -2
  207. package/es/types.js +0 -43
  208. package/es/utils.d.ts +0 -8
  209. package/es/utils.js +0 -78
@@ -1,60 +1,60 @@
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,
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
- locale
34
- } = (0, _context.useLocaleContext)();
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 = (0, _ahooks.useReactive)({
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 = (0, _ahooks.useMemoizedFn)(() => {
45
+ const checkUrl = useMemoizedFn(() => {
46
46
  if (!currentState.url) {
47
47
  currentState.error = t("common.required");
48
48
  return false;
49
49
  }
50
- if (!(0, _isUrl.default)(currentState.url)) {
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 = (0, _ahooks.useMemoizedFn)(() => {
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 = (0, _ahooks.useMemoizedFn)(async data => {
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 = (0, _ahooks.useMemoizedFn)(fn => {
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 = (0, _ahooks.useCreation)(() => {
80
+ const inputAdornment = useCreation(() => {
81
81
  if (currentState.error) {
82
- return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
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__ */(0, _jsxRuntime.jsx)(_material.CircularProgress, {
91
- size: 16
92
- });
86
+ return /* @__PURE__ */ jsx(CircularProgress, { size: 16 });
93
87
  }
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
- });
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__ */(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, {
102
+ return /* @__PURE__ */ jsxs(
103
+ Box,
104
+ {
142
105
  sx: {
143
106
  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();
107
+ gap: 1.5,
108
+ width: "100%",
109
+ alignItems: {
110
+ xs: "flex-start",
111
+ md: "center"
166
112
  },
167
- error: !!currentState.error,
168
- InputProps: {
169
- endAdornment: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.InputAdornment, {
170
- position: "end",
171
- children: inputAdornment
172
- })
113
+ flexDirection: {
114
+ xs: "column",
115
+ md: "row"
173
116
  }
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
- },
117
+ },
118
+ children: [
119
+ /* @__PURE__ */ jsxs(
120
+ Select,
121
+ {
209
122
  sx: {
210
123
  borderRadius: 2,
211
- border: `1px solid ${_Colors.temp.strokeBorderBase}`
124
+ "&.Mui-disabled": {
125
+ backgroundColor: colors.backgroundsBgField
126
+ }
212
127
  },
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
- });
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
- borderRadius: 2,
226
- border: `1px solid ${_Colors.temp.strokeBorderBase}`
144
+ display: "flex",
145
+ alignItems: "center",
146
+ gap: 0.5,
147
+ width: "100%"
227
148
  },
228
- children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_react.Icon, {
229
- icon: _deleteOutlineRounded.default
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
+ }
@@ -1,13 +1 @@
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 }; }
1
+ export { default as UserCenter } from "./components/user-center.js";
@@ -1,16 +1,4 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
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
- "use strict";
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
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
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
- exports.formatAxiosError = formatAxiosError;
20
- const createPassportSvg = props => (0, _passport.createPassportSvg)({
11
+ export const createPassportSvg = (props) => _createPassportSvg({
21
12
  ...props,
22
- issuerAvatarUrl: (0, _ufo.joinURL)(window.location.origin, _constant.AUTH_SERVICE_PREFIX, "/blocklet/logo")
13
+ issuerAvatarUrl: joinURL(window.location.origin, AUTH_SERVICE_PREFIX, "/blocklet/logo")
23
14
  });
24
- exports.createPassportSvg = createPassportSvg;