@abtnode/ux 1.16.18-beta-aa01bd8e → 1.16.18-beta-bb4ebacc
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/es/blocklet/actions.js +17 -6
- package/es/blocklet/add-cert.js +1 -0
- package/es/blocklet/configuration.js +28 -118
- package/es/blocklet/logo-uploader.js +131 -0
- package/es/blocklet/oauth/federated-site-list.js +1 -1
- package/es/blocklet/publish/create-release.js +2 -2
- package/es/hooks/use-passport-id.js +9 -6
- package/es/locales/en.js +25 -5
- package/es/locales/zh.js +21 -1
- package/es/logs/log-terminal.js +2 -1
- package/es/schema-form/index.js +11 -3
- package/es/team/members/connections.js +27 -0
- package/es/team/members/member.js +2 -26
- package/es/team/members/passport-item.js +104 -0
- package/es/team/members/passports.js +23 -78
- package/lib/blocklet/actions.js +17 -6
- package/lib/blocklet/add-cert.js +1 -0
- package/lib/blocklet/configuration.js +30 -90
- package/lib/blocklet/logo-uploader.js +112 -0
- package/lib/blocklet/oauth/federated-site-list.js +1 -1
- package/lib/blocklet/publish/create-release.js +2 -2
- package/lib/hooks/use-passport-id.js +9 -7
- package/lib/locales/en.js +25 -5
- package/lib/locales/zh.js +21 -1
- package/lib/logs/log-terminal.js +2 -1
- package/lib/schema-form/index.js +9 -3
- package/lib/team/members/connections.js +35 -0
- package/lib/team/members/member.js +8 -33
- package/lib/team/members/passport-item.js +95 -0
- package/lib/team/members/passports.js +26 -54
- package/package.json +18 -18
package/es/blocklet/actions.js
CHANGED
|
@@ -74,7 +74,6 @@ export default function BlockletActions({
|
|
|
74
74
|
});
|
|
75
75
|
setLoading(true);
|
|
76
76
|
setCurrentAction(action);
|
|
77
|
-
setConfirmSetting(null);
|
|
78
77
|
let isRemoved = false;
|
|
79
78
|
try {
|
|
80
79
|
if (action === 'remove') {
|
|
@@ -130,6 +129,7 @@ export default function BlockletActions({
|
|
|
130
129
|
if (action === 'reload') {
|
|
131
130
|
Toast.success(t('blocklet.reloadSuccess'));
|
|
132
131
|
}
|
|
132
|
+
setConfirmSetting(null);
|
|
133
133
|
onComplete({
|
|
134
134
|
action,
|
|
135
135
|
blocklet
|
|
@@ -141,6 +141,7 @@ export default function BlockletActions({
|
|
|
141
141
|
blocklet,
|
|
142
142
|
error: new Error(errMsg)
|
|
143
143
|
});
|
|
144
|
+
throw new Error(errMsg);
|
|
144
145
|
} finally {
|
|
145
146
|
if (!isRemoved) {
|
|
146
147
|
setLoading(false);
|
|
@@ -256,7 +257,6 @@ export default function BlockletActions({
|
|
|
256
257
|
e.preventDefault();
|
|
257
258
|
// eslint-disable-next-line no-empty
|
|
258
259
|
} catch {}
|
|
259
|
-
setAnchorEl(null);
|
|
260
260
|
if (typeof action.handler === 'function') {
|
|
261
261
|
try {
|
|
262
262
|
setLoading(true);
|
|
@@ -267,7 +267,10 @@ export default function BlockletActions({
|
|
|
267
267
|
console.error(`Blocklet ${action.name} failed: `, err);
|
|
268
268
|
} finally {
|
|
269
269
|
setLoading(false);
|
|
270
|
+
setAnchorEl(null);
|
|
270
271
|
}
|
|
272
|
+
} else {
|
|
273
|
+
setAnchorEl(null);
|
|
271
274
|
}
|
|
272
275
|
};
|
|
273
276
|
const removeAction = !inService && isDeletableBlocklet(blocklet) ? {
|
|
@@ -392,13 +395,18 @@ export default function BlockletActions({
|
|
|
392
395
|
return /*#__PURE__*/_jsxs(MenuItem, {
|
|
393
396
|
dense: true,
|
|
394
397
|
onClick: e => onAction(action, e),
|
|
395
|
-
disabled: action.disabled,
|
|
398
|
+
disabled: loading || action.disabled,
|
|
396
399
|
"data-cy": `${action.action}-blocklet`,
|
|
397
400
|
children: [/*#__PURE__*/_jsx(ListItemIcon, {
|
|
398
401
|
style: {
|
|
399
402
|
minWidth: 24
|
|
400
403
|
},
|
|
401
|
-
children: /*#__PURE__*/_jsx(
|
|
404
|
+
children: currentAction === action.action && loading ? /*#__PURE__*/_jsx(Spinner, {
|
|
405
|
+
size: 16,
|
|
406
|
+
sx: {
|
|
407
|
+
marginRight: 1
|
|
408
|
+
}
|
|
409
|
+
}) : /*#__PURE__*/_jsx(action.icon, {
|
|
402
410
|
fontSize: "small"
|
|
403
411
|
})
|
|
404
412
|
}), /*#__PURE__*/_jsx(ListItemText, {
|
|
@@ -426,8 +434,11 @@ export default function BlockletActions({
|
|
|
426
434
|
"data-cy": `${action.action}-blocklet`,
|
|
427
435
|
onClick: () => onAction(action),
|
|
428
436
|
disabled: Boolean(action.disabled) || loading,
|
|
429
|
-
children: [currentAction === action.action && loading
|
|
430
|
-
size: 16
|
|
437
|
+
children: [currentAction === action.action && loading ? /*#__PURE__*/_jsx(Spinner, {
|
|
438
|
+
size: 16,
|
|
439
|
+
sx: {
|
|
440
|
+
marginRight: 1
|
|
441
|
+
}
|
|
431
442
|
}) : /*#__PURE__*/_jsx(action.icon, {}), /*#__PURE__*/_jsx("span", {
|
|
432
443
|
className: "blocklet-action-text",
|
|
433
444
|
children: action.name
|
package/es/blocklet/add-cert.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import React, { useState, useContext
|
|
1
|
+
import React, { useState, useContext } from 'react';
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import get from 'lodash/get';
|
|
5
5
|
import isEqual from 'lodash/isEqual';
|
|
6
|
-
import classnames from 'classnames';
|
|
7
|
-
import joinUrl from 'url-join';
|
|
8
6
|
import Box from '@mui/material/Box';
|
|
9
7
|
import Switch from '@mui/material/Switch';
|
|
10
8
|
import Divider from '@mui/material/Divider';
|
|
11
9
|
import { LocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
12
10
|
import Button from '@arcblock/ux/lib/Button';
|
|
13
11
|
import LoopIcon from '@mui/icons-material/Loop';
|
|
14
|
-
import Avatar from '@mui/material/Avatar';
|
|
15
12
|
import { EVENTS } from '@abtnode/constant';
|
|
16
13
|
import { BLOCKLET_CONFIGURABLE_KEY, SUPPORTED_LANGUAGES } from '@blocklet/constant';
|
|
17
14
|
import { getWhoCanAccess } from '@blocklet/meta/lib/util';
|
|
@@ -26,18 +23,13 @@ import ClearCache from '../clear-cache';
|
|
|
26
23
|
import AppSk from './preferences/app-sk';
|
|
27
24
|
import TransferOwner from './transfer-owner';
|
|
28
25
|
import useAppLogo from '../hooks/use-app-logo';
|
|
26
|
+
import Uploader from './logo-uploader';
|
|
29
27
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
30
28
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
31
29
|
const languages = Object.keys(SUPPORTED_LANGUAGES).map(x => ({
|
|
32
30
|
code: x,
|
|
33
31
|
name: SUPPORTED_LANGUAGES[x].nativeName
|
|
34
32
|
}));
|
|
35
|
-
|
|
36
|
-
// eslint-disable-next-line import/no-unresolved
|
|
37
|
-
const UploaderComponent = /*#__PURE__*/lazy(() => import('@blocklet/uploader/react').then(res => ({
|
|
38
|
-
default: res.Uploader
|
|
39
|
-
})));
|
|
40
|
-
const uploadPrefix = '/blocklet/logo/upload';
|
|
41
33
|
function BlockletEnvironment({
|
|
42
34
|
blocklet,
|
|
43
35
|
onUpdate,
|
|
@@ -62,7 +54,6 @@ function BlockletEnvironment({
|
|
|
62
54
|
const whoCanAccess = getWhoCanAccess(blocklet);
|
|
63
55
|
const publicToStore = blocklet?.settings?.publicToStore;
|
|
64
56
|
const disabled = loading || !hasPermission;
|
|
65
|
-
const uploaderLogoRef = useRef(null);
|
|
66
57
|
const {
|
|
67
58
|
logoUrl,
|
|
68
59
|
rectLogoUrl,
|
|
@@ -70,20 +61,6 @@ function BlockletEnvironment({
|
|
|
70
61
|
} = useAppLogo({
|
|
71
62
|
blocklet
|
|
72
63
|
});
|
|
73
|
-
const [apiPathProps, setApiPathProps] = useState();
|
|
74
|
-
const uploadLogoPrefix = joinUrl(prefix, uploadPrefix, 'square', blocklet.meta.did);
|
|
75
|
-
const uploadLogoRectPrefix = joinUrl(prefix, uploadPrefix, 'rect', blocklet.meta.did);
|
|
76
|
-
const uploadLogoFaviconPrefix = joinUrl(prefix, uploadPrefix, 'favicon', blocklet.meta.did);
|
|
77
|
-
const openUploader = uploaderPrefix => {
|
|
78
|
-
if (!hasPermission) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
setApiPathProps({
|
|
82
|
-
uploader: uploaderPrefix,
|
|
83
|
-
disableMediaKitPrefix: true
|
|
84
|
-
});
|
|
85
|
-
uploaderLogoRef.current.open();
|
|
86
|
-
};
|
|
87
64
|
const {
|
|
88
65
|
did
|
|
89
66
|
} = blocklet.meta;
|
|
@@ -269,11 +246,6 @@ function BlockletEnvironment({
|
|
|
269
246
|
setLoading(false);
|
|
270
247
|
}
|
|
271
248
|
};
|
|
272
|
-
const uploaderStyle = {
|
|
273
|
-
'&::after': {
|
|
274
|
-
content: `"${t('common.switch')}"`
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
249
|
return /*#__PURE__*/_jsxs(Div, {
|
|
278
250
|
...rest,
|
|
279
251
|
children: [configurableEnvs.map(item => /*#__PURE__*/_jsxs(Box, {
|
|
@@ -306,19 +278,15 @@ function BlockletEnvironment({
|
|
|
306
278
|
width: 'auto'
|
|
307
279
|
},
|
|
308
280
|
children: t('blocklet.config.logoSquare')
|
|
309
|
-
}), /*#__PURE__*/_jsx(
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
variant: "square",
|
|
319
|
-
alt: "Blocklet Logo",
|
|
320
|
-
src: logoUrl
|
|
321
|
-
})
|
|
281
|
+
}), /*#__PURE__*/_jsx(Uploader, {
|
|
282
|
+
did: blocklet.meta.did,
|
|
283
|
+
height: 80,
|
|
284
|
+
width: 80,
|
|
285
|
+
type: "square",
|
|
286
|
+
prefix: prefix,
|
|
287
|
+
url: logoUrl,
|
|
288
|
+
enabled: hasPermission,
|
|
289
|
+
headers: getSessionInHeader
|
|
322
290
|
}), /*#__PURE__*/_jsx(Box, {
|
|
323
291
|
className: "config-label",
|
|
324
292
|
fontSize: 14,
|
|
@@ -328,17 +296,14 @@ function BlockletEnvironment({
|
|
|
328
296
|
mb: 1.5,
|
|
329
297
|
className: "config-desc",
|
|
330
298
|
children: t('blocklet.config.logoRectDesc')
|
|
331
|
-
}), /*#__PURE__*/_jsx(
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
height: '80px'
|
|
340
|
-
}
|
|
341
|
-
})
|
|
299
|
+
}), /*#__PURE__*/_jsx(Uploader, {
|
|
300
|
+
did: blocklet.meta.did,
|
|
301
|
+
height: 80,
|
|
302
|
+
type: "rect",
|
|
303
|
+
prefix: prefix,
|
|
304
|
+
url: rectLogoUrl,
|
|
305
|
+
enabled: hasPermission,
|
|
306
|
+
headers: getSessionInHeader
|
|
342
307
|
}), /*#__PURE__*/_jsx(Box, {
|
|
343
308
|
className: "config-label",
|
|
344
309
|
fontSize: 14,
|
|
@@ -348,41 +313,16 @@ function BlockletEnvironment({
|
|
|
348
313
|
mb: 1.5,
|
|
349
314
|
className: "config-desc",
|
|
350
315
|
children: t('blocklet.config.logoFaviconDesc')
|
|
316
|
+
}), /*#__PURE__*/_jsx(Uploader, {
|
|
317
|
+
did: blocklet.meta.did,
|
|
318
|
+
height: 25,
|
|
319
|
+
width: 25,
|
|
320
|
+
type: "favicon",
|
|
321
|
+
prefix: prefix,
|
|
322
|
+
url: faviconUrl,
|
|
323
|
+
enabled: hasPermission,
|
|
324
|
+
headers: getSessionInHeader
|
|
351
325
|
}), /*#__PURE__*/_jsx(Box, {
|
|
352
|
-
sx: {
|
|
353
|
-
display: 'inline-flex',
|
|
354
|
-
cursor: hasPermission ? 'pointer' : 'default'
|
|
355
|
-
},
|
|
356
|
-
onClick: () => openUploader(uploadLogoFaviconPrefix),
|
|
357
|
-
children: /*#__PURE__*/_jsx(Avatar, {
|
|
358
|
-
variant: "square",
|
|
359
|
-
sx: {
|
|
360
|
-
width: 20,
|
|
361
|
-
height: 20
|
|
362
|
-
},
|
|
363
|
-
alt: "Blocklet Favicon Logo",
|
|
364
|
-
src: faviconUrl
|
|
365
|
-
})
|
|
366
|
-
}), /*#__PURE__*/_jsx(UploaderComponent, {
|
|
367
|
-
id: "\u200Buploader-logo",
|
|
368
|
-
ref: uploaderLogoRef,
|
|
369
|
-
popup: true,
|
|
370
|
-
onUploadFinish: () => {
|
|
371
|
-
uploaderLogoRef.current.close();
|
|
372
|
-
},
|
|
373
|
-
plugins: [],
|
|
374
|
-
apiPathProps: apiPathProps,
|
|
375
|
-
coreProps: {
|
|
376
|
-
restrictions: {
|
|
377
|
-
allowedFileTypes: ['image/*', '.jpg', '.jpeg', '.png', '.gif', '.svg'],
|
|
378
|
-
maxFileSize: 1024 * 1024 * 10,
|
|
379
|
-
maxNumberOfFiles: 1
|
|
380
|
-
}
|
|
381
|
-
},
|
|
382
|
-
tusProps: {
|
|
383
|
-
headers: getSessionInHeader
|
|
384
|
-
}
|
|
385
|
-
}, "uploader-logo"), /*#__PURE__*/_jsx(Box, {
|
|
386
326
|
className: "config-form",
|
|
387
327
|
children: whoCanAccess === 'all' && blocklet.source === 'registry' && /*#__PURE__*/_jsxs(Box, {
|
|
388
328
|
className: "config-item",
|
|
@@ -617,34 +557,4 @@ const Div = styled.div`
|
|
|
617
557
|
.form-item {
|
|
618
558
|
margin-top: 0;
|
|
619
559
|
}
|
|
620
|
-
|
|
621
|
-
.uploader-wrapper {
|
|
622
|
-
display: inline-flex;
|
|
623
|
-
position: relative;
|
|
624
|
-
font-size: 0px;
|
|
625
|
-
&.enabled {
|
|
626
|
-
cursor: pointer;
|
|
627
|
-
}
|
|
628
|
-
&::after {
|
|
629
|
-
display: none;
|
|
630
|
-
}
|
|
631
|
-
&.enabled::after {
|
|
632
|
-
display: block;
|
|
633
|
-
opacity: 0;
|
|
634
|
-
position: absolute;
|
|
635
|
-
bottom: 0;
|
|
636
|
-
background: rgba(0, 0, 0, 0.2);
|
|
637
|
-
left: 0;
|
|
638
|
-
right: 0;
|
|
639
|
-
height: 2.2em;
|
|
640
|
-
color: white;
|
|
641
|
-
text-align: center;
|
|
642
|
-
font-size: 12px;
|
|
643
|
-
line-height: 2em;
|
|
644
|
-
transition: opacity 0.3s ease;
|
|
645
|
-
}
|
|
646
|
-
&:hover::after {
|
|
647
|
-
opacity: 1;
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
560
|
`;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import React, { lazy, useRef } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import joinUrl from 'url-join';
|
|
4
|
+
import styled from '@emotion/styled';
|
|
5
|
+
import noop from 'lodash/noop';
|
|
6
|
+
import Box from '@mui/material/Box';
|
|
7
|
+
import classnames from 'classnames';
|
|
8
|
+
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line import/no-unresolved
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
const Uploader = /*#__PURE__*/lazy(() => import('@blocklet/uploader/react').then(res => ({
|
|
14
|
+
default: res.Uploader
|
|
15
|
+
})));
|
|
16
|
+
const uploadPrefix = '/blocklet/logo/upload';
|
|
17
|
+
export default function LogoUploader({
|
|
18
|
+
url,
|
|
19
|
+
height,
|
|
20
|
+
width,
|
|
21
|
+
enabled,
|
|
22
|
+
type,
|
|
23
|
+
did,
|
|
24
|
+
prefix,
|
|
25
|
+
headers,
|
|
26
|
+
onUploaded
|
|
27
|
+
}) {
|
|
28
|
+
const {
|
|
29
|
+
t
|
|
30
|
+
} = useLocaleContext();
|
|
31
|
+
const uploaderRef = useRef(null);
|
|
32
|
+
const onOpen = () => {
|
|
33
|
+
uploaderRef.current?.open();
|
|
34
|
+
};
|
|
35
|
+
const onFinish = () => {
|
|
36
|
+
onUploaded();
|
|
37
|
+
uploaderRef.current?.close();
|
|
38
|
+
};
|
|
39
|
+
const uploaderStyle = {
|
|
40
|
+
cursor: enabled ? 'pointer' : 'default',
|
|
41
|
+
'&::after': {
|
|
42
|
+
content: `"${t('common.switch')}"`
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
return /*#__PURE__*/_jsxs(Div, {
|
|
46
|
+
id: `uploader-${did}-${type}`,
|
|
47
|
+
children: [/*#__PURE__*/_jsx(Uploader, {
|
|
48
|
+
ref: uploaderRef,
|
|
49
|
+
popup: true,
|
|
50
|
+
onUploadFinish: onFinish,
|
|
51
|
+
plugins: ['ImageEditor'],
|
|
52
|
+
apiPathProps: {
|
|
53
|
+
uploader: joinUrl(prefix, uploadPrefix, type, did),
|
|
54
|
+
disableMediaKitPrefix: true
|
|
55
|
+
},
|
|
56
|
+
coreProps: {
|
|
57
|
+
restrictions: {
|
|
58
|
+
allowedFileTypes: ['image/*', '.jpg', '.jpeg', '.png', '.gif', '.svg'],
|
|
59
|
+
maxFileSize: 1024 * 1024 * 10,
|
|
60
|
+
maxNumberOfFiles: 1
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
tusProps: {
|
|
64
|
+
headers
|
|
65
|
+
}
|
|
66
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
67
|
+
className: classnames('uploader-wrapper', enabled && 'enabled'),
|
|
68
|
+
sx: uploaderStyle,
|
|
69
|
+
onClick: onOpen,
|
|
70
|
+
children: /*#__PURE__*/_jsx("img", {
|
|
71
|
+
alt: "Logo",
|
|
72
|
+
src: url,
|
|
73
|
+
style: {
|
|
74
|
+
height,
|
|
75
|
+
width
|
|
76
|
+
}
|
|
77
|
+
})
|
|
78
|
+
})]
|
|
79
|
+
}, `uploader-${did}-${type}`);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// infer props for Uploader
|
|
83
|
+
LogoUploader.propTypes = {
|
|
84
|
+
url: PropTypes.string.isRequired,
|
|
85
|
+
type: PropTypes.oneOf(['square', 'rect', 'favicon']).isRequired,
|
|
86
|
+
did: PropTypes.string.isRequired,
|
|
87
|
+
prefix: PropTypes.string.isRequired,
|
|
88
|
+
headers: PropTypes.func,
|
|
89
|
+
onUploaded: PropTypes.func,
|
|
90
|
+
height: PropTypes.number,
|
|
91
|
+
width: PropTypes.any,
|
|
92
|
+
enabled: PropTypes.bool
|
|
93
|
+
};
|
|
94
|
+
LogoUploader.defaultProps = {
|
|
95
|
+
height: 80,
|
|
96
|
+
width: 'auto',
|
|
97
|
+
enabled: true,
|
|
98
|
+
headers: () => ({}),
|
|
99
|
+
onUploaded: noop
|
|
100
|
+
};
|
|
101
|
+
const Div = styled.div`
|
|
102
|
+
.uploader-wrapper {
|
|
103
|
+
display: inline-flex;
|
|
104
|
+
position: relative;
|
|
105
|
+
font-size: 0px;
|
|
106
|
+
&.enabled {
|
|
107
|
+
cursor: pointer;
|
|
108
|
+
}
|
|
109
|
+
&::after {
|
|
110
|
+
display: none;
|
|
111
|
+
}
|
|
112
|
+
&.enabled::after {
|
|
113
|
+
display: block;
|
|
114
|
+
opacity: 0;
|
|
115
|
+
position: absolute;
|
|
116
|
+
bottom: 0;
|
|
117
|
+
background: rgba(0, 0, 0, 0.2);
|
|
118
|
+
left: 0;
|
|
119
|
+
right: 0;
|
|
120
|
+
height: 2.2em;
|
|
121
|
+
color: white;
|
|
122
|
+
text-align: center;
|
|
123
|
+
font-size: 12px;
|
|
124
|
+
line-height: 2em;
|
|
125
|
+
transition: opacity 0.3s ease;
|
|
126
|
+
}
|
|
127
|
+
&:hover::after {
|
|
128
|
+
opacity: 1;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
`;
|
|
@@ -206,7 +206,7 @@ function FederatedSiteList({
|
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
208
|
return list;
|
|
209
|
-
}, [federatedConfig.appId, federatedSites, isMaster]);
|
|
209
|
+
}, [federatedConfig.appId, federatedSites, isMaster, t]);
|
|
210
210
|
const tableOptions = useCreation(() => {
|
|
211
211
|
return {
|
|
212
212
|
sort: true,
|
|
@@ -571,7 +571,7 @@ export default function CreateRelease({
|
|
|
571
571
|
});
|
|
572
572
|
uploaderLogoRef.current.close();
|
|
573
573
|
},
|
|
574
|
-
plugins: [],
|
|
574
|
+
plugins: ['ImageEditor'],
|
|
575
575
|
apiPathProps: {
|
|
576
576
|
uploader: uploadLogoPrefix,
|
|
577
577
|
disableMediaKitPrefix: true
|
|
@@ -595,7 +595,7 @@ export default function CreateRelease({
|
|
|
595
595
|
});
|
|
596
596
|
uploaderScreenshotRef.current.close();
|
|
597
597
|
},
|
|
598
|
-
plugins: [],
|
|
598
|
+
plugins: ['ImageEditor'],
|
|
599
599
|
apiPathProps: {
|
|
600
600
|
uploader: uploadScreenshotPrefix,
|
|
601
601
|
disableMediaKitPrefix: true
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import useLocalStorage from 'react-use/lib/useLocalStorage';
|
|
2
1
|
export default function usePassportId() {
|
|
3
|
-
const
|
|
2
|
+
const clearPassportId = () => {
|
|
3
|
+
localStorage.removeItem('passportId');
|
|
4
|
+
};
|
|
5
|
+
const setPassportId = value => {
|
|
6
|
+
localStorage.setItem('passportId', value);
|
|
7
|
+
};
|
|
4
8
|
const getPassportId = () => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return passportId || '';
|
|
9
|
+
const passportId = localStorage.getItem('passportId') || '';
|
|
10
|
+
clearPassportId();
|
|
11
|
+
return passportId;
|
|
9
12
|
};
|
|
10
13
|
return {
|
|
11
14
|
getPassportId,
|
package/es/locales/en.js
CHANGED
|
@@ -81,6 +81,7 @@ module.exports = {
|
|
|
81
81
|
instances: 'Number of instances'
|
|
82
82
|
},
|
|
83
83
|
common: {
|
|
84
|
+
invalid: 'Invalid',
|
|
84
85
|
about: 'About',
|
|
85
86
|
access: 'Access',
|
|
86
87
|
accessKey: 'Access Keys',
|
|
@@ -100,6 +101,7 @@ module.exports = {
|
|
|
100
101
|
back: 'Back',
|
|
101
102
|
basic: 'Basic',
|
|
102
103
|
basicInfo: 'Basic Information',
|
|
104
|
+
profile: 'Profile',
|
|
103
105
|
bind: 'Bind',
|
|
104
106
|
blocklet: 'Blocklet',
|
|
105
107
|
blocklets: 'Blocklets',
|
|
@@ -153,6 +155,7 @@ module.exports = {
|
|
|
153
155
|
downloading: 'Downloading',
|
|
154
156
|
edit: 'Edit',
|
|
155
157
|
email: 'Email',
|
|
158
|
+
phone: 'Phone',
|
|
156
159
|
empty: 'Empty',
|
|
157
160
|
emptyData: 'No results found',
|
|
158
161
|
enable: 'Enable',
|
|
@@ -394,9 +397,9 @@ module.exports = {
|
|
|
394
397
|
securityError: 'SecurityError: Can not open the admin url from accessing a cross-origin frame'
|
|
395
398
|
},
|
|
396
399
|
config: {
|
|
397
|
-
name: '
|
|
398
|
-
description: '
|
|
399
|
-
sk: 'Secret key for the
|
|
400
|
+
name: 'App Name',
|
|
401
|
+
description: 'App Description',
|
|
402
|
+
sk: 'Secret key for the app wallet',
|
|
400
403
|
logoSquare: 'App Logo',
|
|
401
404
|
logoRect: 'Rect logo',
|
|
402
405
|
logoRectDesc: 'Usually displayed at the top of the page, default to app logo',
|
|
@@ -417,7 +420,7 @@ module.exports = {
|
|
|
417
420
|
languages: 'Supported Languages',
|
|
418
421
|
selectLanguagesTip: 'Adjust the order by removing and re-adding',
|
|
419
422
|
passportColor: 'Passport Color',
|
|
420
|
-
appUrl: '
|
|
423
|
+
appUrl: 'App URL',
|
|
421
424
|
access: {
|
|
422
425
|
title: 'Who Can Access',
|
|
423
426
|
description: 'Who can access the blocklet',
|
|
@@ -1107,7 +1110,24 @@ module.exports = {
|
|
|
1107
1110
|
passportEmpty: 'Passport should not be empty'
|
|
1108
1111
|
},
|
|
1109
1112
|
connectedAccounts: 'Connected Accounts',
|
|
1110
|
-
|
|
1113
|
+
connections: 'Connections',
|
|
1114
|
+
federated: 'Federated',
|
|
1115
|
+
switch: {
|
|
1116
|
+
did: 'Switch DID',
|
|
1117
|
+
profile: 'Switch Profile',
|
|
1118
|
+
passport: 'Switch Passport'
|
|
1119
|
+
},
|
|
1120
|
+
settings: {
|
|
1121
|
+
notification: 'Notifications',
|
|
1122
|
+
email: 'Send email to me when some events happen',
|
|
1123
|
+
wallet: 'Send notification to my wallet when some events happen',
|
|
1124
|
+
phone: 'Send text message to me when some events happen',
|
|
1125
|
+
webhook: 'Webhooks',
|
|
1126
|
+
add: 'Add new webhook',
|
|
1127
|
+
url: 'Custom URL',
|
|
1128
|
+
slack: 'Slack Webhook',
|
|
1129
|
+
tested: 'Test message sent'
|
|
1130
|
+
}
|
|
1111
1131
|
},
|
|
1112
1132
|
transferNode: {
|
|
1113
1133
|
name: 'Transfer Ownership',
|
package/es/locales/zh.js
CHANGED
|
@@ -84,6 +84,7 @@ module.exports = {
|
|
|
84
84
|
instances: '实例数'
|
|
85
85
|
},
|
|
86
86
|
common: {
|
|
87
|
+
invalid: '无效',
|
|
87
88
|
about: '关于',
|
|
88
89
|
access: '访问',
|
|
89
90
|
accessKey: '访问秘钥',
|
|
@@ -103,6 +104,7 @@ module.exports = {
|
|
|
103
104
|
back: '返回',
|
|
104
105
|
basic: '基础',
|
|
105
106
|
basicInfo: '基础信息',
|
|
107
|
+
profile: '信息',
|
|
106
108
|
bind: '绑定',
|
|
107
109
|
blocklet: '基石程序',
|
|
108
110
|
blocklets: '基石程序',
|
|
@@ -157,6 +159,7 @@ module.exports = {
|
|
|
157
159
|
downloading: '下载中',
|
|
158
160
|
edit: '编辑',
|
|
159
161
|
email: '邮箱',
|
|
162
|
+
phone: '电话',
|
|
160
163
|
empty: '暂无',
|
|
161
164
|
emptyData: '未找到结果',
|
|
162
165
|
enable: '启用',
|
|
@@ -1110,7 +1113,24 @@ module.exports = {
|
|
|
1110
1113
|
passportEmpty: '通行证不能为空'
|
|
1111
1114
|
},
|
|
1112
1115
|
connectedAccounts: '已连接账号',
|
|
1113
|
-
|
|
1116
|
+
connections: '账号绑定',
|
|
1117
|
+
federated: '统一登录',
|
|
1118
|
+
switch: {
|
|
1119
|
+
did: '添加账户',
|
|
1120
|
+
profile: '更新身份',
|
|
1121
|
+
passport: '切换通行证'
|
|
1122
|
+
},
|
|
1123
|
+
settings: {
|
|
1124
|
+
notification: '通知设置',
|
|
1125
|
+
email: '当有动态时给我发送邮件',
|
|
1126
|
+
wallet: '当有动态时给我发送钱包通知',
|
|
1127
|
+
phone: '当有动态时给我发送短信',
|
|
1128
|
+
webhook: '外部钩子',
|
|
1129
|
+
add: '添加新钩子',
|
|
1130
|
+
url: '自定义 URL',
|
|
1131
|
+
slack: 'Slack 通知',
|
|
1132
|
+
tested: '测试消息已经发送'
|
|
1133
|
+
}
|
|
1114
1134
|
},
|
|
1115
1135
|
transferNode: {
|
|
1116
1136
|
name: '转移所有者',
|
package/es/logs/log-terminal.js
CHANGED
|
@@ -34,7 +34,8 @@ export function LogTerminalGroup({
|
|
|
34
34
|
error: 'Error',
|
|
35
35
|
access: 'Access',
|
|
36
36
|
stdout: 'stdout',
|
|
37
|
-
stderr: 'stderr'
|
|
37
|
+
stderr: 'stderr',
|
|
38
|
+
pm2: 'PM2'
|
|
38
39
|
};
|
|
39
40
|
const isMobile = useMediaQuery(theme => theme.breakpoints.down('md'));
|
|
40
41
|
const [currentType, setCurrentType] = useState(types[defaultTypeIndex || 0]);
|
package/es/schema-form/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import TextInput from './text-input';
|
|
|
12
12
|
import PassportInput from './passport-input';
|
|
13
13
|
import Required from '../form/required';
|
|
14
14
|
import FormWrapper from '../form/form-wrapper';
|
|
15
|
+
import Uploader from '../blocklet/logo-uploader';
|
|
15
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
18
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -35,7 +36,10 @@ function getComponent(item, {
|
|
|
35
36
|
const componentMap = {
|
|
36
37
|
input: TextInput,
|
|
37
38
|
color: ColorInput,
|
|
38
|
-
passport: PassportInput
|
|
39
|
+
passport: PassportInput,
|
|
40
|
+
uploader: props => /*#__PURE__*/_jsx(Uploader, {
|
|
41
|
+
...props.componentProps
|
|
42
|
+
})
|
|
39
43
|
};
|
|
40
44
|
return componentMap[componentType?.toLowerCase()];
|
|
41
45
|
}
|
|
@@ -119,6 +123,7 @@ export default function SchemaForm({
|
|
|
119
123
|
key,
|
|
120
124
|
description,
|
|
121
125
|
required,
|
|
126
|
+
solo = false,
|
|
122
127
|
hidden = false,
|
|
123
128
|
componentProps = {}
|
|
124
129
|
} = x;
|
|
@@ -146,7 +151,7 @@ export default function SchemaForm({
|
|
|
146
151
|
};
|
|
147
152
|
return /*#__PURE__*/_jsxs(Box, {
|
|
148
153
|
className: "form-item",
|
|
149
|
-
children: [/*#__PURE__*/_jsxs(Box, {
|
|
154
|
+
children: [!solo && /*#__PURE__*/_jsxs(Box, {
|
|
150
155
|
className: "form-item-label",
|
|
151
156
|
style: {
|
|
152
157
|
color: required && !currentValue ? '#ff0000' : '#333'
|
|
@@ -156,10 +161,13 @@ export default function SchemaForm({
|
|
|
156
161
|
className: "form-item-body",
|
|
157
162
|
children: [/*#__PURE__*/_jsx(Box, {
|
|
158
163
|
className: "form-item-input",
|
|
164
|
+
sx: {
|
|
165
|
+
textAlign: solo ? 'center' : 'left'
|
|
166
|
+
},
|
|
159
167
|
children: /*#__PURE__*/_jsx(CurrentComponent, {
|
|
160
168
|
...renderComponentProps
|
|
161
169
|
})
|
|
162
|
-
}), /*#__PURE__*/_jsx(Box, {
|
|
170
|
+
}), !solo && /*#__PURE__*/_jsx(Box, {
|
|
163
171
|
className: "form-item-action",
|
|
164
172
|
children: editing ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
165
173
|
children: [/*#__PURE__*/_jsx(IconButton, {
|