@blocklet/ui-react 3.4.14 → 3.5.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 (256) hide show
  1. package/lib/common/org-switch/use-org.d.ts +4 -4
  2. package/lib/common/ws.d.ts +22 -1
  3. package/package.json +10 -7
  4. package/.aigne/doc-smith/.local/afs-storage.sqlite3 +0 -0
  5. package/.aigne/doc-smith/config.yaml +0 -78
  6. package/.aigne/doc-smith/history.yaml +0 -14
  7. package/.aigne/doc-smith/media-description.yaml +0 -11
  8. package/.aigne/doc-smith/output/structure-plan.json +0 -255
  9. package/.aigne/doc-smith/translation-cache.yaml +0 -11
  10. package/.aigne/doc-smith/upload-cache.yaml +0 -528
  11. package/build.config.ts +0 -24
  12. package/docs/_sidebar.md +0 -19
  13. package/docs/assets/diagram/component-installer-diagram-0.ja.jpg +0 -0
  14. package/docs/assets/diagram/component-installer-diagram-0.jpg +0 -0
  15. package/docs/assets/diagram/component-installer-diagram-0.zh-TW.jpg +0 -0
  16. package/docs/assets/diagram/component-installer-diagram-0.zh.jpg +0 -0
  17. package/docs/assets/diagram/component-management-diagram-0.ja.jpg +0 -0
  18. package/docs/assets/diagram/component-management-diagram-0.jpg +0 -0
  19. package/docs/assets/diagram/component-management-diagram-0.zh-TW.jpg +0 -0
  20. package/docs/assets/diagram/component-management-diagram-0.zh.jpg +0 -0
  21. package/docs/assets/diagram/core-concepts-diagram-0.ja.jpg +0 -0
  22. package/docs/assets/diagram/core-concepts-diagram-0.jpg +0 -0
  23. package/docs/assets/diagram/core-concepts-diagram-0.zh-TW.jpg +0 -0
  24. package/docs/assets/diagram/core-concepts-diagram-0.zh.jpg +0 -0
  25. package/docs/assets/diagram/dashboard-diagram-0.ja.jpg +0 -0
  26. package/docs/assets/diagram/dashboard-diagram-0.jpg +0 -0
  27. package/docs/assets/diagram/dashboard-diagram-0.zh-TW.jpg +0 -0
  28. package/docs/assets/diagram/dashboard-diagram-0.zh.jpg +0 -0
  29. package/docs/assets/diagram/header-diagram-0.ja.jpg +0 -0
  30. package/docs/assets/diagram/header-diagram-0.jpg +0 -0
  31. package/docs/assets/diagram/header-diagram-0.zh-TW.jpg +0 -0
  32. package/docs/assets/diagram/header-diagram-0.zh.jpg +0 -0
  33. package/docs/assets/diagram/layout-diagram-0.ja.jpg +0 -0
  34. package/docs/assets/diagram/layout-diagram-0.jpg +0 -0
  35. package/docs/assets/diagram/layout-diagram-0.zh-TW.jpg +0 -0
  36. package/docs/assets/diagram/layout-diagram-0.zh.jpg +0 -0
  37. package/docs/assets/diagram/notifications-diagram-0.ja.jpg +0 -0
  38. package/docs/assets/diagram/notifications-diagram-0.jpg +0 -0
  39. package/docs/assets/diagram/notifications-diagram-0.zh-TW.jpg +0 -0
  40. package/docs/assets/diagram/notifications-diagram-0.zh.jpg +0 -0
  41. package/docs/assets/diagram/overview-diagram-0.ja.jpg +0 -0
  42. package/docs/assets/diagram/overview-diagram-0.jpg +0 -0
  43. package/docs/assets/diagram/overview-diagram-0.zh-TW.jpg +0 -0
  44. package/docs/assets/diagram/overview-diagram-0.zh.jpg +0 -0
  45. package/docs/assets/diagram/user-center-diagram-0.ja.jpg +0 -0
  46. package/docs/assets/diagram/user-center-diagram-0.jpg +0 -0
  47. package/docs/assets/diagram/user-center-diagram-0.zh-TW.jpg +0 -0
  48. package/docs/assets/diagram/user-center-diagram-0.zh.jpg +0 -0
  49. package/docs/assets/diagram/user-management-diagram-0.ja.jpg +0 -0
  50. package/docs/assets/diagram/user-management-diagram-0.jpg +0 -0
  51. package/docs/assets/diagram/user-management-diagram-0.zh-TW.jpg +0 -0
  52. package/docs/assets/diagram/user-management-diagram-0.zh.jpg +0 -0
  53. package/docs/assets/diagram/user-sessions-diagram-0.ja.jpg +0 -0
  54. package/docs/assets/diagram/user-sessions-diagram-0.jpg +0 -0
  55. package/docs/assets/diagram/user-sessions-diagram-0.zh-TW.jpg +0 -0
  56. package/docs/assets/diagram/user-sessions-diagram-0.zh.jpg +0 -0
  57. package/docs/components-component-management-blocklet-studio.ja.md +0 -194
  58. package/docs/components-component-management-blocklet-studio.md +0 -194
  59. package/docs/components-component-management-blocklet-studio.zh-TW.md +0 -194
  60. package/docs/components-component-management-blocklet-studio.zh.md +0 -194
  61. package/docs/components-component-management-component-installer.ja.md +0 -182
  62. package/docs/components-component-management-component-installer.md +0 -182
  63. package/docs/components-component-management-component-installer.zh-TW.md +0 -182
  64. package/docs/components-component-management-component-installer.zh.md +0 -182
  65. package/docs/components-component-management.ja.md +0 -30
  66. package/docs/components-component-management.md +0 -30
  67. package/docs/components-component-management.zh-TW.md +0 -30
  68. package/docs/components-component-management.zh.md +0 -30
  69. package/docs/components-layout-dashboard.ja.md +0 -185
  70. package/docs/components-layout-dashboard.md +0 -187
  71. package/docs/components-layout-dashboard.zh-TW.md +0 -185
  72. package/docs/components-layout-dashboard.zh.md +0 -185
  73. package/docs/components-layout-footer.ja.md +0 -165
  74. package/docs/components-layout-footer.md +0 -165
  75. package/docs/components-layout-footer.zh-TW.md +0 -165
  76. package/docs/components-layout-footer.zh.md +0 -165
  77. package/docs/components-layout-header.ja.md +0 -183
  78. package/docs/components-layout-header.md +0 -183
  79. package/docs/components-layout-header.zh-TW.md +0 -183
  80. package/docs/components-layout-header.zh.md +0 -183
  81. package/docs/components-layout.ja.md +0 -31
  82. package/docs/components-layout.md +0 -31
  83. package/docs/components-layout.zh-TW.md +0 -31
  84. package/docs/components-layout.zh.md +0 -31
  85. package/docs/components-notifications.ja.md +0 -125
  86. package/docs/components-notifications.md +0 -125
  87. package/docs/components-notifications.zh-TW.md +0 -125
  88. package/docs/components-notifications.zh.md +0 -125
  89. package/docs/components-user-management-user-center.ja.md +0 -148
  90. package/docs/components-user-management-user-center.md +0 -147
  91. package/docs/components-user-management-user-center.zh-TW.md +0 -148
  92. package/docs/components-user-management-user-center.zh.md +0 -148
  93. package/docs/components-user-management-user-sessions.ja.md +0 -121
  94. package/docs/components-user-management-user-sessions.md +0 -123
  95. package/docs/components-user-management-user-sessions.zh-TW.md +0 -121
  96. package/docs/components-user-management-user-sessions.zh.md +0 -121
  97. package/docs/components-user-management.ja.md +0 -49
  98. package/docs/components-user-management.md +0 -51
  99. package/docs/components-user-management.zh-TW.md +0 -49
  100. package/docs/components-user-management.zh.md +0 -49
  101. package/docs/components-utilities-icon.ja.md +0 -106
  102. package/docs/components-utilities-icon.md +0 -106
  103. package/docs/components-utilities-icon.zh-TW.md +0 -106
  104. package/docs/components-utilities-icon.zh.md +0 -106
  105. package/docs/components-utilities.ja.md +0 -136
  106. package/docs/components-utilities.md +0 -136
  107. package/docs/components-utilities.zh-TW.md +0 -136
  108. package/docs/components-utilities.zh.md +0 -136
  109. package/docs/components.ja.md +0 -27
  110. package/docs/components.md +0 -27
  111. package/docs/components.zh-TW.md +0 -27
  112. package/docs/components.zh.md +0 -27
  113. package/docs/core-concepts.ja.md +0 -134
  114. package/docs/core-concepts.md +0 -135
  115. package/docs/core-concepts.zh-TW.md +0 -134
  116. package/docs/core-concepts.zh.md +0 -134
  117. package/docs/getting-started.ja.md +0 -132
  118. package/docs/getting-started.md +0 -132
  119. package/docs/getting-started.zh-TW.md +0 -132
  120. package/docs/getting-started.zh.md +0 -132
  121. package/docs/hooks-api.ja.md +0 -214
  122. package/docs/hooks-api.md +0 -214
  123. package/docs/hooks-api.zh-TW.md +0 -214
  124. package/docs/hooks-api.zh.md +0 -214
  125. package/docs/how-to-guides.ja.md +0 -413
  126. package/docs/how-to-guides.md +0 -413
  127. package/docs/how-to-guides.zh-TW.md +0 -413
  128. package/docs/how-to-guides.zh.md +0 -413
  129. package/docs/overview.ja.md +0 -51
  130. package/docs/overview.md +0 -51
  131. package/docs/overview.zh-TW.md +0 -51
  132. package/docs/overview.zh.md +0 -51
  133. package/glossary.md +0 -12
  134. package/src/@types/index.ts +0 -230
  135. package/src/@types/shims.d.ts +0 -18
  136. package/src/BlockletStudio/README.md +0 -116
  137. package/src/BlockletStudio/index.tsx +0 -145
  138. package/src/ComponentInstaller/ComponentInstaller.stories.jsx +0 -16
  139. package/src/ComponentInstaller/index.jsx +0 -207
  140. package/src/ComponentInstaller/installer-item.jsx +0 -129
  141. package/src/ComponentInstaller/locales.js +0 -22
  142. package/src/ComponentInstaller/use-component-installed.js +0 -88
  143. package/src/ComponentManager/components/add-component.tsx +0 -136
  144. package/src/ComponentManager/components/check-component.tsx +0 -3
  145. package/src/ComponentManager/components/publish-component.tsx +0 -90
  146. package/src/ComponentManager/components/resource-dialog.tsx +0 -91
  147. package/src/ComponentManager/index.tsx +0 -3
  148. package/src/ComponentManager/libs/locales.ts +0 -15
  149. package/src/Dashboard/Dashboard.stories.jsx +0 -20
  150. package/src/Dashboard/app-shell/app-badge.stories.tsx +0 -64
  151. package/src/Dashboard/app-shell/app-badge.tsx +0 -94
  152. package/src/Dashboard/app-shell/app-header.tsx +0 -104
  153. package/src/Dashboard/app-shell/app-info-context.tsx +0 -182
  154. package/src/Dashboard/app-shell/badges/app-badge-default.tsx +0 -130
  155. package/src/Dashboard/app-shell/badges/app-badge-did.tsx +0 -28
  156. package/src/Dashboard/app-shell/badges/app-badge-state.tsx +0 -40
  157. package/src/Dashboard/app-shell/badges/app-badge-switch.tsx +0 -72
  158. package/src/Dashboard/app-shell/badges/app-badge-version.tsx +0 -60
  159. package/src/Dashboard/app-shell/index.ts +0 -5
  160. package/src/Dashboard/index.jsx +0 -184
  161. package/src/Footer/Footer.stories.jsx +0 -33
  162. package/src/Footer/brand.jsx +0 -81
  163. package/src/Footer/copyright.jsx +0 -22
  164. package/src/Footer/index.jsx +0 -111
  165. package/src/Footer/internal-footer.jsx +0 -139
  166. package/src/Footer/layout/plain.jsx +0 -55
  167. package/src/Footer/layout/row.jsx +0 -43
  168. package/src/Footer/layout/standard.jsx +0 -114
  169. package/src/Footer/links.jsx +0 -321
  170. package/src/Footer/social-media.jsx +0 -55
  171. package/src/Header/Header.stories.jsx +0 -30
  172. package/src/Header/index.tsx +0 -259
  173. package/src/Icon/Icon.stories.jsx +0 -12
  174. package/src/Icon/index.tsx +0 -87
  175. package/src/Notifications/Snackbar.tsx +0 -261
  176. package/src/Notifications/hooks/use-title.tsx +0 -254
  177. package/src/Notifications/hooks/use-width.tsx +0 -16
  178. package/src/Notifications/utils.ts +0 -246
  179. package/src/UserCenter/assets/banner.png +0 -0
  180. package/src/UserCenter/components/config-inviter.tsx +0 -48
  181. package/src/UserCenter/components/config-profile.tsx +0 -99
  182. package/src/UserCenter/components/danger-zone.tsx +0 -82
  183. package/src/UserCenter/components/editable-field.tsx +0 -273
  184. package/src/UserCenter/components/fallback.tsx +0 -57
  185. package/src/UserCenter/components/nft-preview.tsx +0 -84
  186. package/src/UserCenter/components/nft.tsx +0 -279
  187. package/src/UserCenter/components/notification.tsx +0 -319
  188. package/src/UserCenter/components/passport.tsx +0 -107
  189. package/src/UserCenter/components/privacy.tsx +0 -120
  190. package/src/UserCenter/components/settings.tsx +0 -170
  191. package/src/UserCenter/components/status-dialog/date-picker.tsx +0 -77
  192. package/src/UserCenter/components/status-dialog/index.tsx +0 -293
  193. package/src/UserCenter/components/status-selector/duration-menu.tsx +0 -90
  194. package/src/UserCenter/components/status-selector/index.tsx +0 -58
  195. package/src/UserCenter/components/status-selector/menu-item.tsx +0 -56
  196. package/src/UserCenter/components/storage/action.tsx +0 -49
  197. package/src/UserCenter/components/storage/connected.tsx +0 -61
  198. package/src/UserCenter/components/storage/delete.tsx +0 -72
  199. package/src/UserCenter/components/storage/disconnect.tsx +0 -40
  200. package/src/UserCenter/components/storage/icons/empty-spaces-nft.svg +0 -1
  201. package/src/UserCenter/components/storage/icons/long-arrow.svg +0 -5
  202. package/src/UserCenter/components/storage/icons/space-connected.svg +0 -3
  203. package/src/UserCenter/components/storage/icons/space-disconnect.svg +0 -3
  204. package/src/UserCenter/components/storage/index.tsx +0 -41
  205. package/src/UserCenter/components/storage/preview-nft.tsx +0 -72
  206. package/src/UserCenter/components/third-party-login/index.tsx +0 -199
  207. package/src/UserCenter/components/third-party-login/third-party-item.tsx +0 -296
  208. package/src/UserCenter/components/user-center.tsx +0 -787
  209. package/src/UserCenter/components/user-info/address.tsx +0 -143
  210. package/src/UserCenter/components/user-info/index.tsx +0 -4
  211. package/src/UserCenter/components/user-info/link-preview-input.tsx +0 -274
  212. package/src/UserCenter/components/user-info/metadata.tsx +0 -658
  213. package/src/UserCenter/components/user-info/social-actions/chat.tsx +0 -43
  214. package/src/UserCenter/components/user-info/social-actions/follow.tsx +0 -23
  215. package/src/UserCenter/components/user-info/social-actions/index.tsx +0 -17
  216. package/src/UserCenter/components/user-info/switch-role.tsx +0 -42
  217. package/src/UserCenter/components/user-info/timezone-select.tsx +0 -119
  218. package/src/UserCenter/components/user-info/user-basic-info.tsx +0 -292
  219. package/src/UserCenter/components/user-info/user-info-item.tsx +0 -54
  220. package/src/UserCenter/components/user-info/user-info.tsx +0 -91
  221. package/src/UserCenter/components/user-info/user-status.tsx +0 -234
  222. package/src/UserCenter/components/user-info/utils.ts +0 -320
  223. package/src/UserCenter/components/webhook-item.tsx +0 -248
  224. package/src/UserCenter/index.tsx +0 -1
  225. package/src/UserCenter/libs/locales.ts +0 -378
  226. package/src/UserCenter/libs/utils.ts +0 -30
  227. package/src/UserSessions/components/user-session-info.tsx +0 -78
  228. package/src/UserSessions/components/user-sessions.tsx +0 -545
  229. package/src/UserSessions/index.tsx +0 -1
  230. package/src/UserSessions/libs/locales.ts +0 -60
  231. package/src/UserSessions/libs/utils.ts +0 -82
  232. package/src/blocklets.js +0 -195
  233. package/src/common/domain-warning.jsx +0 -178
  234. package/src/common/header-addons.jsx +0 -119
  235. package/src/common/link-blocker.jsx +0 -20
  236. package/src/common/notification-addon.jsx +0 -135
  237. package/src/common/org-switch/avatar-uploader.jsx +0 -271
  238. package/src/common/org-switch/create.jsx +0 -267
  239. package/src/common/org-switch/index.jsx +0 -407
  240. package/src/common/org-switch/locales.js +0 -52
  241. package/src/common/org-switch/use-org.jsx +0 -79
  242. package/src/common/overridable-theme-provider.jsx +0 -17
  243. package/src/common/wallet-hidden-topbar.js +0 -14
  244. package/src/common/wizard-modal.jsx +0 -200
  245. package/src/common/ws.js +0 -68
  246. package/src/contexts/config-user-space.tsx +0 -88
  247. package/src/contexts/user-followers.tsx +0 -54
  248. package/src/hooks/use-follow.tsx +0 -75
  249. package/src/hooks/use-mobile.tsx +0 -6
  250. package/src/index.ts +0 -16
  251. package/src/libs/constant.ts +0 -1
  252. package/src/libs/spaces.tsx +0 -18
  253. package/src/libs/with-hide-when-embed.tsx +0 -24
  254. package/src/types.js +0 -45
  255. package/src/utils.js +0 -161
  256. package/vite.config.mjs +0 -34
@@ -1,248 +0,0 @@
1
- // import PropTypes from 'prop-types';
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 { Icon } from '@iconify/react';
16
- import CloseRoundedIcon from '@iconify-icons/material-symbols/close-rounded';
17
- import CheckIcon from '@iconify-icons/material-symbols/check';
18
- import SendRoundedIcon from '@iconify-icons/material-symbols/send-rounded';
19
- import EditSquareOutlineRoundedIcon from '@iconify-icons/material-symbols/edit-square-outline-rounded';
20
- import DeleteOutlineRoundedIcon from '@iconify-icons/material-symbols/delete-outline-rounded';
21
- import { translate } from '@arcblock/ux/lib/Locale/util';
22
- import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
23
-
24
- import { translations } from '../libs/locales';
25
- import { WebhookItemData, WebhookItemProps, WebhookType } from '../../@types';
26
-
27
- export default function WebhookItem({
28
- onTest = noop,
29
- onDelete = noop,
30
- onSave = noop,
31
- onCancel = noop,
32
- type = 'slack',
33
- url = '',
34
- edit = false,
35
- }: WebhookItemProps) {
36
- const { locale } = useLocaleContext();
37
- const t = useMemoizedFn((key, data = {}) => {
38
- return translate(translations, key, locale, 'en', data);
39
- });
40
- const currentState = useReactive<
41
- WebhookItemData & {
42
- edit: boolean;
43
- error: string;
44
- loading: boolean;
45
- }
46
- >({
47
- type: type || 'slack',
48
- url: url || '',
49
- edit: edit ?? false,
50
- error: '',
51
- loading: false,
52
- });
53
-
54
- const checkUrl = useMemoizedFn(() => {
55
- if (!currentState.url) {
56
- currentState.error = t('common.required');
57
- return false;
58
- }
59
- if (!isUrl(currentState.url)) {
60
- currentState.error = t('common.invalid');
61
- return false;
62
- }
63
- currentState.error = '';
64
- return true;
65
- });
66
-
67
- const handleClose = useMemoizedFn(() => {
68
- currentState.edit = false;
69
- currentState.url = url || '';
70
- currentState.type = type || 'slack';
71
- currentState.error = '';
72
- currentState.loading = false;
73
- onCancel();
74
- });
75
-
76
- // eslint-disable-next-line @typescript-eslint/naming-convention
77
- const _onTest = useMemoizedFn(async (data) => {
78
- currentState.loading = true;
79
- await onTest(data);
80
- currentState.loading = false;
81
- });
82
-
83
- const onSubmit = useMemoizedFn((fn: (params: WebhookItemData) => void) => {
84
- return () => {
85
- if (checkUrl()) {
86
- fn({
87
- type: currentState.type,
88
- url: currentState.url,
89
- });
90
- }
91
- };
92
- });
93
-
94
- const inputAdornment = useCreation(() => {
95
- if (currentState.error) {
96
- return (
97
- <Typography component="span" color="error">
98
- {currentState.error}
99
- </Typography>
100
- );
101
- }
102
-
103
- if (currentState.edit) {
104
- if (currentState.loading) {
105
- return <CircularProgress size={16} />;
106
- }
107
-
108
- return (
109
- <IconButton
110
- size="small"
111
- onClick={onSubmit(_onTest)}
112
- sx={{
113
- mr: -1,
114
- }}>
115
- <Icon icon={SendRoundedIcon} />
116
- </IconButton>
117
- );
118
- }
119
- return null;
120
- }, [currentState.error, currentState.edit, currentState.loading]);
121
-
122
- return (
123
- <Box
124
- sx={{
125
- display: 'flex',
126
- gap: 1.5,
127
- width: '100%',
128
- alignItems: {
129
- xs: 'flex-start',
130
- md: 'center',
131
- },
132
- flexDirection: {
133
- xs: 'column',
134
- md: 'row',
135
- },
136
- }}>
137
- <Select
138
- sx={{
139
- borderRadius: 1,
140
- '&.Mui-disabled': {
141
- backgroundColor: 'grey.50',
142
- },
143
- }}
144
- disabled={!currentState.edit || currentState.loading}
145
- size="small"
146
- value={currentState.type}
147
- onChange={(e) => {
148
- currentState.type = e.target.value as WebhookType;
149
- }}>
150
- <MenuItem value="api">{t('webhook.url')}</MenuItem>
151
- <MenuItem value="slack">{t('webhook.slack')}</MenuItem>
152
- </Select>
153
- <Box
154
- sx={{
155
- display: 'flex',
156
- alignItems: 'center',
157
- gap: 0.5,
158
- width: '100%',
159
- }}>
160
- <TextField
161
- sx={{
162
- flex: 1,
163
- '.MuiInputBase-root': {
164
- borderRadius: 1,
165
- '&.Mui-disabled': {
166
- backgroundColor: 'grey.50',
167
- },
168
- },
169
- }}
170
- disabled={!currentState.edit || currentState.loading}
171
- fullWidth
172
- size="small"
173
- required
174
- value={currentState.url}
175
- onChange={(e) => {
176
- currentState.url = e.target.value;
177
- checkUrl();
178
- }}
179
- error={!!currentState.error}
180
- slotProps={{
181
- input: {
182
- endAdornment: <InputAdornment position="end">{inputAdornment}</InputAdornment>,
183
- },
184
- }}
185
- />
186
-
187
- <Box sx={{ display: 'flex', gap: 0.5 }}>
188
- {currentState.edit ? (
189
- <>
190
- <IconButton
191
- color="success"
192
- onClick={onSubmit((...args) => {
193
- onSave(...args);
194
- currentState.edit = false;
195
- })}
196
- sx={{
197
- borderRadius: 1,
198
- border: '1px solid',
199
- borderColor: 'grey.200',
200
- }}>
201
- <Icon icon={CheckIcon} />
202
- </IconButton>
203
- <IconButton
204
- color="error"
205
- onClick={handleClose}
206
- sx={{
207
- borderRadius: 1,
208
- border: '1px solid',
209
- borderColor: 'grey.200',
210
- }}>
211
- <Icon icon={CloseRoundedIcon} />
212
- </IconButton>
213
- </>
214
- ) : (
215
- <>
216
- <IconButton
217
- onClick={() => {
218
- currentState.edit = true;
219
- }}
220
- sx={{
221
- borderRadius: 1,
222
- border: '1px solid',
223
- borderColor: 'grey.200',
224
- }}>
225
- <Icon icon={EditSquareOutlineRoundedIcon} />
226
- </IconButton>
227
- <IconButton
228
- color="error"
229
- onClick={() => {
230
- onDelete({
231
- type: currentState.type,
232
- url: currentState.url,
233
- });
234
- }}
235
- sx={{
236
- borderRadius: 1,
237
- border: '1px solid',
238
- borderColor: 'grey.200',
239
- }}>
240
- <Icon icon={DeleteOutlineRoundedIcon} />
241
- </IconButton>
242
- </>
243
- )}
244
- </Box>
245
- </Box>
246
- </Box>
247
- );
248
- }
@@ -1 +0,0 @@
1
- export { default as UserCenter } from './components/user-center';
@@ -1,378 +0,0 @@
1
- export const translations = {
2
- zh: {
3
- settings: '设置',
4
- noPassport: '暂无通行证',
5
- passport: '通行证',
6
- notification: '通知',
7
- email: '邮箱地址',
8
- phone: '电话号码',
9
- lastLogin: '上次登录',
10
- lastLoginAt: '上次登录时间',
11
- lastLoginIp: '上次登录地址',
12
- createdAt: '加入时间',
13
- registerFrom: '注册来源',
14
- invitedBy: '邀请人',
15
- unknown: '未知',
16
- walletNotification: '钱包通知',
17
- emailNotification: '邮件通知',
18
- phoneNotification: '短信通知',
19
- pushNotification: '推送消息(由 Push Kit 提供)',
20
- addWebhook: '新增外部通知',
21
- saveSuccess: '保存成功',
22
- saveFailed: '保存失败',
23
- webhookTested: '测试消息已经发送',
24
- done: '完成',
25
- emptyField: '未填写',
26
- emptyContent: '暂无内容',
27
- underProtected: '用户已设置隐私保护',
28
- followersOnly: '用户已设置仅粉丝可见,关注用户后可查看',
29
- noUserFound: '未找到指定的用户',
30
- notificationManagement: '通知管理',
31
- privacyManagement: '隐私管理',
32
- storageManagement: 'DID Spaces',
33
- userFollowers: '关注 & 粉丝',
34
- webhook: {
35
- url: '自定义URL',
36
- slack: 'Slack',
37
- },
38
- common: {
39
- confirm: '确认',
40
- cancel: '取消',
41
- required: '必填的',
42
- invalid: '无效',
43
- setting: '设置',
44
- save: '保存',
45
- profile: '信息',
46
- nft: 'NFTs',
47
- noNFT: '暂无 NFT',
48
- },
49
- toPublic: '公开 “{name}” 页面',
50
- currentPassport: '当前使用的通行证',
51
- refreshProfile: {
52
- title: '刷新个人信息',
53
- successfully: '刷新个人信息成功',
54
- },
55
- switchProfile: '切换',
56
- userInfo: '个人信息',
57
- myInfo: '我的信息',
58
- hisInfo: 'TA 的信息',
59
- loginNow: '立即登录',
60
- viewAfterLogin: '登录后才可以查看',
61
- sessionManagement: '会话管理',
62
- storage: {
63
- spaces: {
64
- tips: '提示',
65
- label: '请输入 DID Spaces 服务地址',
66
- connectedWithName: '你已成功连接至 {name}',
67
- gateway: {
68
- delete: {
69
- failed: '删除 DID Spaces 失败',
70
- },
71
- },
72
- provideNFT: {
73
- title: '请为 {appName} 出示 DID Spaces NFT',
74
- scan: '使用你的 DID Wallet 为应用 {appName} 出示 DID Spaces NFT',
75
- success: '连接成功',
76
- },
77
- connect: {
78
- useWallet: '使用 DID Wallet 连接',
79
- useWalletReconnect: '使用 DID Wallet 重新连接',
80
- providerForStorage: '请连接您的 DID Spaces',
81
- },
82
- connected: {
83
- title: '已连接的 DID Spaces',
84
- tag: '已连接',
85
- },
86
- },
87
- },
88
- thirdPartyLogin: {
89
- title: '已连接的账户',
90
- connect: '绑定',
91
- disconnect: '解绑',
92
- mainProviderCantRemove: '主账号不允许解绑',
93
- confirmUnbind: '确定要解绑 {name} 吗?',
94
- confirmUnbindDescription:
95
- '解绑后您将无法使用 {name} 登录至该账户。如果解绑后,您仍使用 {name} 登录,会自动创建一个新账户',
96
- disconnectPasskey: '确定要移除 Passkey 吗?',
97
- disconnectPasskeyDescription:
98
- '移除后您将无法使用此 Passkey 登录。如果移除后,您仍使用此 Passkey 登录,会自动创建一个新账户',
99
- },
100
- commonSetting: {
101
- title: '通用设置',
102
- locale: '偏好语言',
103
- },
104
- dangerZone: {
105
- title: '危险操作',
106
- deleteAccount: '删除账户',
107
- deleteAccountDescription: '删除账户后,您将无法使用该账户登录,您的数据将从平台中完全删除,不可恢复。',
108
- delete: '删除',
109
- },
110
- userStatus: {
111
- Online: '在线',
112
- Meeting: '开会中',
113
- Community: '通勤中',
114
- Holiday: '休假',
115
- OffSick: '病假',
116
- WorkingRemotely: '远程工作',
117
- duration: {
118
- NoClear: '不要清除',
119
- ThirtyMinutes: '30分钟',
120
- OneHour: '1小时',
121
- FourHours: '4小时',
122
- Today: '今天',
123
- ThisWeek: '本周',
124
- Custom: '自定义时间',
125
- },
126
- },
127
- profile: {
128
- addLink: '添加连接',
129
- location: '位置',
130
- timezone: '时区',
131
- bio: '个人简介',
132
- setStatus: '设置状态',
133
- localTime: '当地时间:',
134
- email: '邮箱地址',
135
- emailInvalid: '邮箱格式不正确',
136
- emailSourceProviderNotAllowEdit: '使用邮箱注册的用户不允许修改邮箱',
137
- phone: '电话号码',
138
- phoneInvalid: '电话号码格式不正确',
139
- editProfile: '编辑资料',
140
- removeStatusAfter: '在...之后移除状态',
141
- justForYou: '仅对您可见',
142
- cleanStatus: '清除状态',
143
- quickSettings: '快捷设置',
144
- selectEndTime: '选择结束时间',
145
- pleaseSelectTime: '请选择时间',
146
- invalidURL: '无效的 URL',
147
- duplicateURL: 'URL 已存在',
148
- socialMedia: '社交链接',
149
- timezonePhase: {
150
- dawn: '凌晨',
151
- morning: '上午',
152
- afternoon: '下午',
153
- night: '晚上',
154
- },
155
- address: {
156
- title: '地址',
157
- country: '国家/地区',
158
- province: '州/省',
159
- city: '城市/镇',
160
- line1: '地址',
161
- line2: '地址2',
162
- detailedAddress: '详细地址',
163
- postalCode: '邮政编码',
164
- invalidPostalCode: '邮政编码格式不正确',
165
- },
166
- maxLinkCount: '最多可添加 {count} 个社交链接',
167
- chat: '聊天',
168
- follow: '关注',
169
- unfollow: '取消关注',
170
- follow_success: '关注成功',
171
- unfollow_success: '取消关注成功',
172
- },
173
- destroyMyself: {
174
- title: '删除账户',
175
- scan: '删除账户后,您将无法使用该账户登录,您的数据将从平台中完全删除,不可恢复。',
176
- confirm: '确认删除',
177
- cancel: '取消',
178
- success: '删除账户成功',
179
- abort: '取消删除账户',
180
- error: '删除账户失败',
181
- },
182
- notImplemented: '操作未实现',
183
- userCenter: {
184
- title: '用户中心',
185
- },
186
- userNotFound: '用户不存在',
187
- userNotFoundDescription: '该账户已被管理员停用或移除。',
188
- },
189
- en: {
190
- settings: 'Settings',
191
- noPassport: 'No passport yet',
192
- passport: 'Passports',
193
- notification: 'Notification',
194
- email: 'Email',
195
- phone: 'Phone',
196
- lastLogin: 'Last Login & IP',
197
- lastLoginAt: 'Last Login',
198
- lastLoginIp: 'Last IP',
199
- createdAt: 'Member Since',
200
- registerFrom: 'Register From',
201
- invitedBy: 'Invited By',
202
- unknown: 'Unknown',
203
- walletNotification: 'DID Wallet notification',
204
- emailNotification: 'Email notification',
205
- phoneNotification: 'SMS notification',
206
- pushNotification: 'Push notification (powered by Push Kit)',
207
- addWebhook: 'Add external notification',
208
- saveSuccess: 'Save succeed',
209
- saveFailed: 'Save failed',
210
- webhookTested: 'Test message sent',
211
- done: 'Done',
212
- emptyField: 'None',
213
- notificationManagement: 'Notifications',
214
- privacyManagement: 'Privacy',
215
- storageManagement: 'DID Spaces',
216
- userFollowers: 'Following & Followers',
217
- emptyContent: 'Empty',
218
- underProtected: 'This page has protected privacy',
219
- followersOnly: 'This page is only visible to followers, follow the user to view',
220
- noUserFound: 'No user found',
221
- webhook: {
222
- url: 'Custom url',
223
- slack: 'Slack',
224
- },
225
- common: {
226
- confirm: 'Confirm',
227
- cancel: 'Cancel',
228
- required: 'Required',
229
- invalid: 'Invalid',
230
- setting: 'Settings',
231
- save: 'Save',
232
- profile: 'Profile',
233
- nft: 'NFTs',
234
- noNFT: 'No NFT',
235
- },
236
- toPublic: 'Public "{name}" page',
237
- currentPassport: 'Passport currently in use',
238
- refreshProfile: {
239
- title: 'Refresh profile',
240
- successfully: 'Refresh profile successfully',
241
- },
242
- switchProfile: 'Switch',
243
- userInfo: 'User Info',
244
- myInfo: 'My Info',
245
- hisInfo: 'His/Her Info',
246
- loginNow: 'Login',
247
- viewAfterLogin: 'View after login',
248
- sessionManagement: 'Session Management',
249
- storage: {
250
- spaces: {
251
- tips: 'Tips',
252
- label: 'Enter DID Spaces Gateway',
253
- connectedWithName: 'You have successfully connected to {name}',
254
- gateway: {
255
- delete: {
256
- failed: 'Delete gateway failed',
257
- },
258
- },
259
- provideNFT: {
260
- title: 'Please show the DID Spaces NFT for {appName}',
261
- scan: 'Use your DID Wallet to allow the app {appName} show DID space NFT',
262
- success: 'Connected successfully',
263
- },
264
- connect: {
265
- useWallet: 'Connect with DID Wallet',
266
- useWalletReconnect: 'Reconnect with DID Wallet',
267
- providerForStorage: 'Please connect your DID Spaces',
268
- },
269
- connected: {
270
- title: 'Connected DID Spaces',
271
- tag: 'Connected',
272
- },
273
- },
274
- },
275
- thirdPartyLogin: {
276
- title: 'Connected Accounts',
277
- connect: 'Connect',
278
- disconnect: 'Disconnect',
279
- mainProviderCantRemove: 'Main account not allowed to remove',
280
- confirmUnbind: 'Are you sure to unbind {name}?',
281
- confirmUnbindDescription:
282
- '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!',
283
- disconnectPasskey: 'Are you sure to remove {name}?',
284
- disconnectPasskeyDescription:
285
- 'You will not be able to log in with this passkey upon removing. If you are still logged in with this passkey after removing, a new account will be created automatically!',
286
- },
287
- commonSetting: {
288
- title: 'Common Settings',
289
- locale: 'Preferred language',
290
- },
291
- dangerZone: {
292
- title: 'Danger Zone',
293
- deleteAccount: 'Delete Account',
294
- deleteAccountDescription:
295
- 'Delete account will make you unable to login with this account, your data will be completely deleted from the platform and cannot be recovered.',
296
- delete: 'Delete',
297
- },
298
- userStatus: {
299
- Online: 'Online',
300
- Meeting: 'In a Meeting',
301
- Community: 'Commuting',
302
- Holiday: 'On Holiday',
303
- OffSick: 'Off Sick',
304
- WorkingRemotely: 'Working Remotely',
305
- duration: {
306
- NoClear: "Don't clear",
307
- ThirtyMinutes: '30 minutes',
308
- OneHour: '1 hour',
309
- FourHours: '4 hours',
310
- Today: 'Today',
311
- ThisWeek: 'This Week',
312
- Custom: 'Custom',
313
- },
314
- },
315
- profile: {
316
- addLink: 'Add link',
317
- location: 'Location',
318
- timezone: 'Timezone',
319
- bio: 'Bio',
320
- setStatus: 'Set a Status',
321
- localTime: 'Local Time: ',
322
- email: 'Email',
323
- emailInvalid: 'Email is invalid',
324
- emailSourceProviderNotAllowEdit: 'Email registered users are not allowed to edit email',
325
- phone: 'Phone',
326
- phoneInvalid: 'Phone number is invalid',
327
- editProfile: 'Edit Profile',
328
- removeStatusAfter: 'Remove status after...',
329
- justForYou: 'Visible to you only',
330
- maxInputLength: 'Max input length is',
331
- selectEndTime: 'Select end time',
332
- pleaseSelectTime: 'Please select time',
333
- cleanStatus: 'Clean status',
334
- quickSettings: 'Quick Settings',
335
- invalidURL: 'Invalid URL',
336
- duplicateURL: 'URL already exists',
337
- socialMedia: 'Social Media',
338
- timezonePhase: {
339
- dawn: 'AM',
340
- morning: 'AM',
341
- afternoon: 'PM',
342
- night: 'PM',
343
- },
344
- address: {
345
- title: 'Address',
346
- country: 'Country/Region',
347
- province: 'State/Province',
348
- city: 'City/Town',
349
- line1: 'Address',
350
- line2: 'Address 2',
351
- detailedAddress: 'Detailed Address',
352
- postalCode: 'Postal Code',
353
- invalidPostalCode: 'Postal code is invalid',
354
- },
355
- maxLinkCount: 'Up to {count} social links can be added',
356
- chat: 'Chat',
357
- follow: 'Follow',
358
- unfollow: 'Unfollow',
359
- follow_success: 'Follow successfully',
360
- unfollow_success: 'Unfollow successfully',
361
- },
362
- destroyMyself: {
363
- title: 'Delete Account',
364
- scan: 'Delete account will make you unable to login with this account, your data will be completely deleted from the platform and cannot be recovered.',
365
- confirm: 'Confirm delete',
366
- cancel: 'Cancel',
367
- success: 'Delete account successfully',
368
- abort: 'Delete account aborted',
369
- error: 'Delete account failed',
370
- },
371
- notImplemented: 'This action is not implemented',
372
- userCenter: {
373
- title: 'User Center',
374
- },
375
- userNotFound: 'User not found',
376
- userNotFoundDescription: 'The account has been deactivated or removed by the administrator.',
377
- },
378
- };
@@ -1,30 +0,0 @@
1
- import type { AxiosError } from 'axios';
2
- import { joinURL } from 'ufo';
3
- import { createPassportSvg as _createPassportSvg, createKycSvg as _createKycSvg } from '@arcblock/ux/lib/Util/passport';
4
- import { BLOCKLET_SERVICE_PATH_PREFIX } from '@arcblock/ux/lib/Util/constant';
5
- import { CreatePassportProps } from '../../@types';
6
-
7
- export const formatAxiosError = (err: AxiosError) => {
8
- const { response } = err;
9
-
10
- if (response) {
11
- return `Request failed: ${response.status} ${response.statusText}: ${JSON.stringify(response.data)}`;
12
- }
13
-
14
- return err.message;
15
- };
16
-
17
- export const createPassportSvg = (props: CreatePassportProps) => {
18
- if (props.scope === 'kyc') {
19
- return _createKycSvg({
20
- ...props,
21
- issuerAvatarUrl: joinURL(window.location.origin, BLOCKLET_SERVICE_PATH_PREFIX, '/blocklet/logo'),
22
- type: props.role,
23
- });
24
- }
25
-
26
- return _createPassportSvg({
27
- ...props,
28
- issuerAvatarUrl: joinURL(window.location.origin, BLOCKLET_SERVICE_PATH_PREFIX, '/blocklet/logo'),
29
- });
30
- };