@abtnode/ux 1.16.29-beta-0070353c → 1.16.29-beta-88bdefe8
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/lib/blocklet/component/add-component/add-component-core.js +4 -15
- package/lib/blocklet/logo-uploader.js +1 -1
- package/lib/blocklet/notification/push-kit.js +17 -3
- package/lib/blocklet/publish/create-release/branding.js +4 -3
- package/lib/blocklet/publish/create-release/connect-store-button.js +99 -23
- package/lib/blocklet/publish/create-release/connect-store-list.js +12 -6
- package/lib/blocklet/publish/create-release/header.js +10 -0
- package/lib/blocklet/publish/create-release/index.js +3 -0
- package/lib/blocklet/publish/create-release/resource-upload.js +2 -2
- package/lib/invitation/invitation-receive.js +46 -25
- package/lib/invitation/invitation.js +4 -4
- package/lib/locales/ar.js +8 -17
- package/lib/locales/de.js +8 -17
- package/lib/locales/en.js +5 -2
- package/lib/locales/es.js +8 -17
- package/lib/locales/fr.js +8 -17
- package/lib/locales/hi.js +8 -17
- package/lib/locales/i18n.db +0 -0
- package/lib/locales/id.js +8 -17
- package/lib/locales/ja.js +8 -17
- package/lib/locales/ko.js +8 -17
- package/lib/locales/pt.js +8 -17
- package/lib/locales/ru.js +8 -17
- package/lib/locales/th.js +8 -17
- package/lib/locales/vi.js +8 -17
- package/lib/locales/zh-tw.js +8 -17
- package/lib/locales/zh.js +10 -25
- package/lib/store/add.js +24 -10
- package/lib/store/connect-actions.js +18 -18
- package/lib/store/item.js +28 -4
- package/lib/team/members/index.js +33 -1
- package/lib/team/members/invite-member.js +98 -66
- package/lib/util/sdk.js +3 -0
- package/package.json +9 -8
|
@@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { useEffect, useRef, useState } from 'react';
|
|
4
4
|
import { useParams } from 'react-router-dom';
|
|
5
5
|
import { isInServerlessMode } from '@abtnode/util/lib/serverless';
|
|
6
|
-
import Alert from '@mui/material/Alert';
|
|
7
6
|
import AnimationWaiter from '@arcblock/ux/lib/AnimationWaiter';
|
|
8
7
|
import Button from '@arcblock/ux/lib/Button';
|
|
9
8
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
@@ -14,6 +13,7 @@ import PageHeader from '@blocklet/launcher-layout/lib/page-header';
|
|
|
14
13
|
import styled from '@emotion/styled';
|
|
15
14
|
import CheckIcon from '@mui/icons-material/Check';
|
|
16
15
|
import AddIcon from '@mui/icons-material/Link';
|
|
16
|
+
import Alert from '@mui/material/Alert';
|
|
17
17
|
import Box from '@mui/material/Box';
|
|
18
18
|
import Spinner from '@mui/material/CircularProgress';
|
|
19
19
|
import TextField from '@mui/material/TextField';
|
|
@@ -23,9 +23,9 @@ import flatten from 'lodash/flatten';
|
|
|
23
23
|
import isEmpty from 'lodash/isEmpty';
|
|
24
24
|
import isNil from 'lodash/isNil';
|
|
25
25
|
import uniqBy from 'lodash/uniqBy';
|
|
26
|
+
import Toast from '@arcblock/ux/lib/Toast';
|
|
26
27
|
import urlPathFriendly from '@blocklet/meta/lib/url-path-friendly';
|
|
27
28
|
import { getDisplayName, getSharedConfigObj, hasStartEngine, isFreeBlocklet } from '@blocklet/meta/lib/util';
|
|
28
|
-
import Toast from '@arcblock/ux/lib/Toast';
|
|
29
29
|
import { useBlockletContext } from '../../../contexts/blocklet';
|
|
30
30
|
import { ConfigSpaceProvider } from '../../../contexts/config-space';
|
|
31
31
|
import { useNodeContext } from '../../../contexts/node';
|
|
@@ -783,19 +783,8 @@ export default function AddComponentCore({
|
|
|
783
783
|
onClickNext: onNext,
|
|
784
784
|
installRelated: installRelated,
|
|
785
785
|
onChangeInstallRelated: setInstallRelated,
|
|
786
|
-
handleDescEle: /*#__PURE__*/
|
|
787
|
-
children:
|
|
788
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
789
|
-
// eslint-disable-next-line
|
|
790
|
-
dangerouslySetInnerHTML: {
|
|
791
|
-
__html: t(`blocklet.component.addComponentTip.${params.requirePurchase ? 'isPurchase' : 'isFree'}`, {
|
|
792
|
-
name: getComponentName()
|
|
793
|
-
})
|
|
794
|
-
}
|
|
795
|
-
})
|
|
796
|
-
}), /*#__PURE__*/_jsx("p", {
|
|
797
|
-
children: t('blocklet.component.addComponentTip.belowInformation')
|
|
798
|
-
})]
|
|
786
|
+
handleDescEle: /*#__PURE__*/_jsx("p", {
|
|
787
|
+
children: t('blocklet.component.addComponentTip.belowInformation')
|
|
799
788
|
})
|
|
800
789
|
})]
|
|
801
790
|
}),
|
|
@@ -57,7 +57,7 @@ export default function LogoUploader({
|
|
|
57
57
|
},
|
|
58
58
|
coreProps: {
|
|
59
59
|
restrictions: {
|
|
60
|
-
|
|
60
|
+
allowedFileExts: ['.webp', '.jpg', '.jpeg', '.png', '.gif', '.svg'],
|
|
61
61
|
maxFileSize: 1024 * 1024 * 10,
|
|
62
62
|
maxNumberOfFiles: 1
|
|
63
63
|
}
|
|
@@ -6,6 +6,7 @@ import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
|
6
6
|
import Toast from '@arcblock/ux/lib/Toast';
|
|
7
7
|
import Button from '@arcblock/ux/lib/Button';
|
|
8
8
|
import isURL from 'validator/lib/isURL';
|
|
9
|
+
import { joinURL, withQuery } from 'ufo';
|
|
9
10
|
import { useNodeContext } from '../../contexts/node';
|
|
10
11
|
import { useBlockletContext } from '../../contexts/blocklet';
|
|
11
12
|
import useConfirm from '../../hooks/confirm';
|
|
@@ -82,15 +83,28 @@ function NotificationPushKit() {
|
|
|
82
83
|
if (formState.isDirty) {
|
|
83
84
|
await onSubmit(data, event, false);
|
|
84
85
|
}
|
|
86
|
+
const appUrl = (blocklet?.configs || []).find(x => x.key === 'BLOCKLET_APP_URL')?.value;
|
|
85
87
|
await api.sendPush({
|
|
86
88
|
input: {
|
|
87
89
|
did,
|
|
88
90
|
receiver: pageState.testReceiver,
|
|
89
91
|
notification: JSON.stringify({
|
|
90
|
-
title: 'Test push-kit notification',
|
|
91
|
-
body: 'This is message from push-kit config test',
|
|
92
92
|
type: 'passthrough',
|
|
93
|
-
passthroughType: 'messageStatus'
|
|
93
|
+
passthroughType: 'messageStatus',
|
|
94
|
+
data: {
|
|
95
|
+
message: {
|
|
96
|
+
title: 'Test push-kit notification',
|
|
97
|
+
body: 'This is message from push-kit config test',
|
|
98
|
+
sender: {
|
|
99
|
+
did: blocklet?.appDid,
|
|
100
|
+
fullName: blocklet?.meta?.title,
|
|
101
|
+
avatar: withQuery(joinURL(appUrl, '/.well-known/service/blocklet/logo'), {
|
|
102
|
+
v: blocklet?.meta?.version,
|
|
103
|
+
t: new Date(blocklet?.updatedAt || 0).getTime()
|
|
104
|
+
})
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
94
108
|
})
|
|
95
109
|
}
|
|
96
110
|
});
|
|
@@ -15,7 +15,7 @@ import { useNodeContext } from '../../../contexts/node';
|
|
|
15
15
|
import useWantToConnectStore from '../hooks/use-want-to-connect-store';
|
|
16
16
|
import EmptySpinner from '../../../empty-spinner';
|
|
17
17
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
-
const
|
|
18
|
+
const allowedFileExts = ['.webp', '.jpg', '.jpeg', '.png', '.gif', '.svg'];
|
|
19
19
|
const maxFileSize = 1024 * 1024 * 10; // 10 MB
|
|
20
20
|
|
|
21
21
|
// eslint-disable-next-line import/no-unresolved
|
|
@@ -169,6 +169,7 @@ function Branding({
|
|
|
169
169
|
children: /*#__PURE__*/_jsx(ConnectStoreButton, {
|
|
170
170
|
blocklet: blocklet,
|
|
171
171
|
store: wantToConnectStore,
|
|
172
|
+
componentDid: componentDid,
|
|
172
173
|
onChangeStore: setWantToConnectStore,
|
|
173
174
|
disabled: !params.blockletTitle || readOnly || loading,
|
|
174
175
|
loading: loading,
|
|
@@ -324,7 +325,7 @@ function Branding({
|
|
|
324
325
|
},
|
|
325
326
|
coreProps: {
|
|
326
327
|
restrictions: {
|
|
327
|
-
|
|
328
|
+
allowedFileExts,
|
|
328
329
|
maxFileSize,
|
|
329
330
|
maxNumberOfFiles: 1
|
|
330
331
|
}
|
|
@@ -350,7 +351,7 @@ function Branding({
|
|
|
350
351
|
},
|
|
351
352
|
coreProps: {
|
|
352
353
|
restrictions: {
|
|
353
|
-
|
|
354
|
+
allowedFileExts,
|
|
354
355
|
maxFileSize,
|
|
355
356
|
maxNumberOfFiles: 5 - screenshotUrls.length
|
|
356
357
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { useState, useRef } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import Button from '@mui/material/Button';
|
|
4
|
-
import ButtonGroup from '@mui/material/ButtonGroup';
|
|
5
|
-
import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
|
|
6
|
-
import ClickAwayListener from '@mui/material/ClickAwayListener';
|
|
7
|
-
import Grow from '@mui/material/Grow';
|
|
8
|
-
import Paper from '@mui/material/Paper';
|
|
9
|
-
import Popper from '@mui/material/Popper';
|
|
10
|
-
import MenuItem from '@mui/material/MenuItem';
|
|
11
|
-
import MenuList from '@mui/material/MenuList';
|
|
12
|
-
import Spinner from '@mui/material/CircularProgress';
|
|
13
1
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
2
|
+
import { BLOCKLET_TENANT_MODES } from '@blocklet/constant';
|
|
3
|
+
import AddIcon from '@mui/icons-material/Add';
|
|
4
|
+
import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
|
|
5
|
+
import { Button, ButtonGroup, CircularProgress, ClickAwayListener, Divider, Grow, IconButton, MenuItem, MenuList, Paper, Popper, Typography } from '@mui/material';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import { Icon } from '@iconify/react';
|
|
8
|
+
import { useRef, useState } from 'react';
|
|
9
|
+
import Toast from '@arcblock/ux/lib/Toast';
|
|
10
|
+
import formatError from '@abtnode/util/lib/format-error';
|
|
11
|
+
import AddStore from '../../../store/add';
|
|
12
|
+
import { useNodeContext } from '../../../contexts/node';
|
|
13
|
+
import ConfirmDialog from '../../../confirm';
|
|
14
14
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
15
|
export default function ConnectStoreButton({
|
|
16
16
|
blocklet,
|
|
@@ -18,19 +18,25 @@ export default function ConnectStoreButton({
|
|
|
18
18
|
onChangeStore,
|
|
19
19
|
onClick,
|
|
20
20
|
disabled,
|
|
21
|
-
loading
|
|
21
|
+
loading,
|
|
22
|
+
componentDid
|
|
22
23
|
}) {
|
|
23
24
|
const {
|
|
24
25
|
t
|
|
25
26
|
} = useLocaleContext();
|
|
26
27
|
const [open, setOpen] = useState(false);
|
|
27
28
|
const anchorRef = useRef(null);
|
|
28
|
-
const
|
|
29
|
+
const [openAddStore, setOpenAddStore] = useState(false);
|
|
30
|
+
const {
|
|
31
|
+
api
|
|
32
|
+
} = useNodeContext();
|
|
33
|
+
const [deleteStore, setDeleteStore] = useState(null);
|
|
34
|
+
const handleSelectStore = nextStore => {
|
|
29
35
|
onChangeStore(nextStore);
|
|
30
36
|
setOpen(false);
|
|
31
37
|
};
|
|
32
38
|
const handleToggle = () => {
|
|
33
|
-
setOpen(
|
|
39
|
+
setOpen(true);
|
|
34
40
|
};
|
|
35
41
|
const handleClose = event => {
|
|
36
42
|
if (anchorRef.current && anchorRef.current.contains(event.target)) {
|
|
@@ -38,7 +44,32 @@ export default function ConnectStoreButton({
|
|
|
38
44
|
}
|
|
39
45
|
setOpen(false);
|
|
40
46
|
};
|
|
41
|
-
const
|
|
47
|
+
const handleOpenAddStore = () => {
|
|
48
|
+
setOpenAddStore(true);
|
|
49
|
+
};
|
|
50
|
+
const handleCloseAddStore = () => {
|
|
51
|
+
setOpenAddStore(false);
|
|
52
|
+
};
|
|
53
|
+
const handleDeleteStore = async () => {
|
|
54
|
+
if (!deleteStore) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
await api.deleteBlockletStore({
|
|
59
|
+
input: {
|
|
60
|
+
teamDid: blocklet.meta.did,
|
|
61
|
+
url: deleteStore.url,
|
|
62
|
+
projectId: ''
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
setDeleteStore(null);
|
|
66
|
+
} catch (err) {
|
|
67
|
+
Toast.error(`Remove Blocklet Store Error: ${formatError(err)}`);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const storeList = blocklet?.settings?.storeList || [];
|
|
71
|
+
const did = blocklet?.meta?.did;
|
|
72
|
+
const manageable = !(componentDid && window.blocklet?.tenantMode === BLOCKLET_TENANT_MODES.MULTIPLE);
|
|
42
73
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
43
74
|
children: [/*#__PURE__*/_jsxs(ButtonGroup, {
|
|
44
75
|
disabled: disabled,
|
|
@@ -48,7 +79,7 @@ export default function ConnectStoreButton({
|
|
|
48
79
|
"aria-label": "Button group with connect store",
|
|
49
80
|
children: [/*#__PURE__*/_jsxs(Button, {
|
|
50
81
|
onClick: onClick,
|
|
51
|
-
children: [loading && /*#__PURE__*/_jsx(
|
|
82
|
+
children: [loading && /*#__PURE__*/_jsx(CircularProgress, {
|
|
52
83
|
size: 14,
|
|
53
84
|
sx: {
|
|
54
85
|
mr: 0.5
|
|
@@ -83,18 +114,60 @@ export default function ConnectStoreButton({
|
|
|
83
114
|
children: /*#__PURE__*/_jsx(Paper, {
|
|
84
115
|
children: /*#__PURE__*/_jsx(ClickAwayListener, {
|
|
85
116
|
onClickAway: handleClose,
|
|
86
|
-
children: /*#__PURE__*/
|
|
117
|
+
children: /*#__PURE__*/_jsxs(MenuList, {
|
|
87
118
|
id: "split-button-menu",
|
|
88
119
|
autoFocusItem: true,
|
|
89
|
-
children:
|
|
120
|
+
children: [storeList.map(option => /*#__PURE__*/_jsxs(MenuItem, {
|
|
90
121
|
selected: option.id === store.id,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
122
|
+
sx: {
|
|
123
|
+
height: 40
|
|
124
|
+
},
|
|
125
|
+
onClick: () => handleSelectStore(option),
|
|
126
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
127
|
+
variant: "inherit",
|
|
128
|
+
children: option.name
|
|
129
|
+
}), manageable && !option.protected && /*#__PURE__*/_jsx(IconButton, {
|
|
130
|
+
sx: {
|
|
131
|
+
ml: 1
|
|
132
|
+
},
|
|
133
|
+
onClick: e => {
|
|
134
|
+
e.preventDefault();
|
|
135
|
+
e.stopPropagation();
|
|
136
|
+
setDeleteStore(option);
|
|
137
|
+
},
|
|
138
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
139
|
+
icon: "ic:outline-delete"
|
|
140
|
+
})
|
|
141
|
+
})]
|
|
142
|
+
}, option.url)), manageable && /*#__PURE__*/_jsx(Divider, {}), manageable && /*#__PURE__*/_jsxs(MenuItem, {
|
|
143
|
+
onClick: handleOpenAddStore,
|
|
144
|
+
children: [/*#__PURE__*/_jsx(AddIcon, {
|
|
145
|
+
font: true
|
|
146
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
147
|
+
variant: "inherit",
|
|
148
|
+
children: t('store.blockletRegistry.addRegistry')
|
|
149
|
+
})]
|
|
150
|
+
})]
|
|
94
151
|
})
|
|
95
152
|
})
|
|
96
153
|
})
|
|
97
154
|
})
|
|
155
|
+
}), openAddStore && /*#__PURE__*/_jsx(AddStore, {
|
|
156
|
+
hiddenChildren: true,
|
|
157
|
+
open: true,
|
|
158
|
+
onClose: handleCloseAddStore,
|
|
159
|
+
teamDid: did,
|
|
160
|
+
storeList: storeList,
|
|
161
|
+
scope: "studio"
|
|
162
|
+
}), deleteStore && /*#__PURE__*/_jsx(ConfirmDialog, {
|
|
163
|
+
displayError: true,
|
|
164
|
+
title: `${t('common.delete')} ${deleteStore.name}`,
|
|
165
|
+
description: t('blocklet.publish.deleteStoreTip', {
|
|
166
|
+
name: deleteStore.name
|
|
167
|
+
}),
|
|
168
|
+
confirm: t('common.confirm'),
|
|
169
|
+
onConfirm: handleDeleteStore,
|
|
170
|
+
onCancel: () => setDeleteStore(null)
|
|
98
171
|
})]
|
|
99
172
|
});
|
|
100
173
|
}
|
|
@@ -104,7 +177,10 @@ ConnectStoreButton.propTypes = {
|
|
|
104
177
|
onChangeStore: PropTypes.func.isRequired,
|
|
105
178
|
onClick: PropTypes.func.isRequired,
|
|
106
179
|
loading: PropTypes.bool.isRequired,
|
|
107
|
-
disabled: PropTypes.bool.isRequired
|
|
180
|
+
disabled: PropTypes.bool.isRequired,
|
|
181
|
+
componentDid: PropTypes.string.isRequired,
|
|
182
|
+
projectType: PropTypes.string.isRequired,
|
|
183
|
+
getData: PropTypes.func.isRequired
|
|
108
184
|
};
|
|
109
185
|
ConnectStoreButton.defaultProps = {
|
|
110
186
|
store: null,
|
|
@@ -19,7 +19,9 @@ function ConnectStoreList({
|
|
|
19
19
|
onDelete,
|
|
20
20
|
projectType,
|
|
21
21
|
componentDid,
|
|
22
|
-
onOpenConnectStore
|
|
22
|
+
onOpenConnectStore,
|
|
23
|
+
behavior,
|
|
24
|
+
onSelectConnectStore
|
|
23
25
|
}) {
|
|
24
26
|
const {
|
|
25
27
|
t
|
|
@@ -35,9 +37,8 @@ function ConnectStoreList({
|
|
|
35
37
|
}, {});
|
|
36
38
|
}, [connectedStores]);
|
|
37
39
|
const did = blocklet?.meta?.did;
|
|
38
|
-
const handleAddStore = () => {};
|
|
39
40
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
40
|
-
children: [!!storeList?.length && /*#__PURE__*/_jsx(Alert, {
|
|
41
|
+
children: [behavior === 'connect' && !!storeList?.length && /*#__PURE__*/_jsx(Alert, {
|
|
41
42
|
severity: "info",
|
|
42
43
|
style: {
|
|
43
44
|
width: '100%'
|
|
@@ -61,6 +62,8 @@ function ConnectStoreList({
|
|
|
61
62
|
"data-cy": "store-switch",
|
|
62
63
|
children: /*#__PURE__*/_jsx(ListItemText, {
|
|
63
64
|
children: /*#__PURE__*/_jsx(StoreItem, {
|
|
65
|
+
behavior: behavior,
|
|
66
|
+
onSelectConnectStore: onSelectConnectStore,
|
|
64
67
|
releaseId: releaseId,
|
|
65
68
|
projectId: projectId,
|
|
66
69
|
releaseType: releaseType,
|
|
@@ -76,7 +79,6 @@ function ConnectStoreList({
|
|
|
76
79
|
})
|
|
77
80
|
}, x.url))
|
|
78
81
|
}), componentDid && window.blocklet?.tenantMode === BLOCKLET_TENANT_MODES.MULTIPLE ? null : /*#__PURE__*/_jsx(AddStore, {
|
|
79
|
-
onAdd: handleAddStore,
|
|
80
82
|
teamDid: did,
|
|
81
83
|
storeList: storeList,
|
|
82
84
|
scope: "studio"
|
|
@@ -94,7 +96,9 @@ ConnectStoreList.propTypes = {
|
|
|
94
96
|
connectedStores: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
95
97
|
projectType: PropTypes.string,
|
|
96
98
|
componentDid: PropTypes.string,
|
|
97
|
-
onOpenConnectStore: PropTypes.func
|
|
99
|
+
onOpenConnectStore: PropTypes.func,
|
|
100
|
+
onSelectConnectStore: PropTypes.func,
|
|
101
|
+
behavior: PropTypes.string
|
|
98
102
|
};
|
|
99
103
|
ConnectStoreList.defaultProps = {
|
|
100
104
|
projectType: '',
|
|
@@ -102,6 +106,8 @@ ConnectStoreList.defaultProps = {
|
|
|
102
106
|
publishedStoreIds: [],
|
|
103
107
|
onPublish: () => {},
|
|
104
108
|
onDelete: () => {},
|
|
105
|
-
onOpenConnectStore: () => {}
|
|
109
|
+
onOpenConnectStore: () => {},
|
|
110
|
+
onSelectConnectStore: () => {},
|
|
111
|
+
behavior: 'connect'
|
|
106
112
|
};
|
|
107
113
|
export default ConnectStoreList;
|
|
@@ -197,6 +197,16 @@ function Header({
|
|
|
197
197
|
componentDid
|
|
198
198
|
}, '*');
|
|
199
199
|
}
|
|
200
|
+
setParamsErrTip({
|
|
201
|
+
blockletResource: '',
|
|
202
|
+
blockletTitle: '',
|
|
203
|
+
blockletDescription: '',
|
|
204
|
+
blockletVersion: '',
|
|
205
|
+
blockletLogo: '',
|
|
206
|
+
projectId: '',
|
|
207
|
+
blockletIntroduction: '',
|
|
208
|
+
note: ''
|
|
209
|
+
});
|
|
200
210
|
if (mode === 'create' || mode === 'new-release') {
|
|
201
211
|
const id = res?.release?.id;
|
|
202
212
|
navigate(`../${projectId}/view/${id}`, {
|
|
@@ -6,7 +6,7 @@ import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
|
6
6
|
import Toast from '@arcblock/ux/lib/Toast/index';
|
|
7
7
|
import EmptySpinner from '../../../empty-spinner';
|
|
8
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
const
|
|
9
|
+
const allowedFileExts = ['.zip', '.gz'];
|
|
10
10
|
const maxFileSize = 1024 * 1024 * 100; // 100 MB
|
|
11
11
|
|
|
12
12
|
// eslint-disable-next-line import/no-unresolved
|
|
@@ -86,7 +86,7 @@ export default function ResourceUpload({
|
|
|
86
86
|
},
|
|
87
87
|
coreProps: {
|
|
88
88
|
restrictions: {
|
|
89
|
-
|
|
89
|
+
allowedFileExts,
|
|
90
90
|
maxFileSize,
|
|
91
91
|
maxNumberOfFiles: 1
|
|
92
92
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { useCallback } from 'react';
|
|
2
1
|
import PropTypes from 'prop-types';
|
|
3
2
|
import styled from '@emotion/styled';
|
|
4
3
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
5
4
|
import DidButton from '@arcblock/did-connect/lib/Button';
|
|
6
5
|
import { AUTH_SERVICE_PREFIX, API_DID_PREFIX } from '@arcblock/did-connect/lib/constant';
|
|
7
6
|
import { joinURL } from 'ufo';
|
|
7
|
+
import { useMemoizedFn, useMount, useReactive } from 'ahooks';
|
|
8
8
|
import { formatDateTime } from '../util';
|
|
9
9
|
import usePassportId from '../hooks/use-passport-id';
|
|
10
10
|
import { useSessionContext } from '../contexts/session';
|
|
11
|
+
import blockletSdk from '../util/sdk';
|
|
11
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
13
|
function InvitationReceive({
|
|
13
14
|
invitation,
|
|
@@ -30,28 +31,47 @@ function InvitationReceive({
|
|
|
30
31
|
if (typeof window !== 'undefined') {
|
|
31
32
|
componentId = window?.blocklet?.componentId;
|
|
32
33
|
}
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
const currentState = useReactive({
|
|
35
|
+
loading: false,
|
|
36
|
+
extraParams: {
|
|
37
|
+
// 生成 passport 信息需要 baseUrl 字段
|
|
38
|
+
baseUrl: window.location.origin,
|
|
39
|
+
componentId,
|
|
40
|
+
sourceAppPid: invitation?.sourceAppPid || null
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
useMount(async () => {
|
|
44
|
+
const passportId = getPassportId();
|
|
45
|
+
if (passportId) {
|
|
46
|
+
currentState.extraParams.passportId = passportId;
|
|
47
|
+
}
|
|
48
|
+
if (action === 'invite') {
|
|
49
|
+
currentState.extraParams.inviteId = invitation.inviteId;
|
|
50
|
+
} else if (action === 'issue-passport') {
|
|
51
|
+
currentState.extraParams.id = invitation.inviteId;
|
|
52
|
+
}
|
|
53
|
+
if (inService && invitation?.receiver?.did) {
|
|
54
|
+
currentState.loading = true;
|
|
55
|
+
try {
|
|
56
|
+
const publicInfo = await blockletSdk.user.getUserPublicInfo({
|
|
57
|
+
did: invitation.receiver.did
|
|
58
|
+
});
|
|
59
|
+
if (publicInfo?.sourceAppPid) {
|
|
60
|
+
currentState.extraParams.sourceAppPid = publicInfo.sourceAppPid;
|
|
61
|
+
}
|
|
62
|
+
} finally {
|
|
63
|
+
currentState.loading = false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
const onClose = useMemoizedFn(() => {
|
|
48
68
|
connectApi.close();
|
|
49
|
-
}
|
|
50
|
-
const onSuccess =
|
|
69
|
+
});
|
|
70
|
+
const onSuccess = useMemoizedFn((...args) => {
|
|
51
71
|
connectApi.close();
|
|
52
72
|
onLogin(...args);
|
|
53
|
-
}
|
|
54
|
-
const onClickReceive =
|
|
73
|
+
});
|
|
74
|
+
const onClickReceive = useMemoizedFn(() => {
|
|
55
75
|
if (typeof onReceive === 'function') {
|
|
56
76
|
onReceive();
|
|
57
77
|
return;
|
|
@@ -62,10 +82,11 @@ function InvitationReceive({
|
|
|
62
82
|
className: 'connect',
|
|
63
83
|
forceConnected: invitation?.receiver?.did || false,
|
|
64
84
|
autoConnect: false,
|
|
85
|
+
disableSwitchApp: true,
|
|
65
86
|
locale,
|
|
66
87
|
extraParams: {
|
|
67
88
|
provider: 'wallet',
|
|
68
|
-
...extraParams
|
|
89
|
+
...currentState.extraParams
|
|
69
90
|
},
|
|
70
91
|
baseUrl: window.location.origin,
|
|
71
92
|
prefix: joinURL(window.location.origin, AUTH_SERVICE_PREFIX, API_DID_PREFIX),
|
|
@@ -86,8 +107,9 @@ function InvitationReceive({
|
|
|
86
107
|
className: 'connect',
|
|
87
108
|
forceConnected: invitation?.receiver?.did || false,
|
|
88
109
|
autoConnect: false,
|
|
110
|
+
disableSwitchApp: true,
|
|
89
111
|
locale,
|
|
90
|
-
extraParams,
|
|
112
|
+
extraParams: currentState.extraParams,
|
|
91
113
|
messages: {
|
|
92
114
|
title: t('receive.dialog.title'),
|
|
93
115
|
scan: t('receive.dialog.scan'),
|
|
@@ -98,11 +120,10 @@ function InvitationReceive({
|
|
|
98
120
|
onClose
|
|
99
121
|
});
|
|
100
122
|
}
|
|
101
|
-
|
|
102
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
103
|
-
}, [connectApi.openPopup]);
|
|
123
|
+
});
|
|
104
124
|
return /*#__PURE__*/_jsxs(Root, {
|
|
105
125
|
children: [/*#__PURE__*/_jsx(DidButton, {
|
|
126
|
+
loading: currentState.loading,
|
|
106
127
|
size: "large",
|
|
107
128
|
variant: "contained",
|
|
108
129
|
className: "invite-receive__button",
|
|
@@ -34,8 +34,8 @@ function Invitation({
|
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
const isSuccess = status === 'success' || state?.data?.status === 'success';
|
|
37
|
-
const
|
|
38
|
-
const
|
|
37
|
+
const SectionHeader = isSuccess ? InvitationSuccess : InvitationUser;
|
|
38
|
+
const SectionFooter = isSuccess ? InvitationLogin : InvitationReceive;
|
|
39
39
|
return /*#__PURE__*/_jsx(Root, {
|
|
40
40
|
className: "page-invite__wrapper",
|
|
41
41
|
children: state?.data ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
@@ -43,14 +43,14 @@ function Invitation({
|
|
|
43
43
|
invitation: state.data
|
|
44
44
|
}), /*#__PURE__*/_jsxs(Box, {
|
|
45
45
|
className: "page-invite__card",
|
|
46
|
-
children: [/*#__PURE__*/_jsx(
|
|
46
|
+
children: [/*#__PURE__*/_jsx(SectionHeader, {
|
|
47
47
|
invitation: state.data
|
|
48
48
|
}), /*#__PURE__*/_jsx(InvitationPassport, {
|
|
49
49
|
invitation: state.data,
|
|
50
50
|
action: action,
|
|
51
51
|
createPassportSvg: createPassportSvg,
|
|
52
52
|
passportColor: passportColor
|
|
53
|
-
}), /*#__PURE__*/_jsx(
|
|
53
|
+
}), /*#__PURE__*/_jsx(SectionFooter, {
|
|
54
54
|
invitation: state.data,
|
|
55
55
|
action: action,
|
|
56
56
|
onLogin: onLoginSuccess,
|
package/lib/locales/ar.js
CHANGED
|
@@ -41,12 +41,7 @@ export default {
|
|
|
41
41
|
login: {
|
|
42
42
|
loginTo: 'الاتصال بـ',
|
|
43
43
|
description: 'فقط صاحب الخادم والأعضاء المعتمدين يمكنهم الوصول إلى لوحة المعلومات',
|
|
44
|
-
dialog: {
|
|
45
|
-
title: 'قم بتوصيل محفظة ديد',
|
|
46
|
-
scan: 'قم بتوصيل محفظة DID الخاصة بك لتوفير جواز السفر',
|
|
47
|
-
confirm: 'أكد على محفظة الهوية الرقمية الخاصة بك',
|
|
48
|
-
success: 'تم اتصالك بنجاح'
|
|
49
|
-
},
|
|
44
|
+
dialog: {},
|
|
50
45
|
switchDid: {
|
|
51
46
|
title: 'تبديل محفظة DID',
|
|
52
47
|
scan: 'مسح رمز الاستجابة السريعة التالي لتبديل الحساب',
|
|
@@ -256,7 +251,6 @@ export default {
|
|
|
256
251
|
preview: 'معاينة',
|
|
257
252
|
protected: 'محمي',
|
|
258
253
|
protocol: 'بروتوكول',
|
|
259
|
-
published: 'نشرت',
|
|
260
254
|
purchase: 'شراء',
|
|
261
255
|
readMore: 'أكثر',
|
|
262
256
|
redirect: 'إعادة توجيه',
|
|
@@ -348,7 +342,6 @@ export default {
|
|
|
348
342
|
selected: 'محدد',
|
|
349
343
|
timeoutError: 'خطأ في المهلة',
|
|
350
344
|
tags: 'وسوم',
|
|
351
|
-
publishToStore: 'نشر في المتجر',
|
|
352
345
|
connectToStore: 'الاتصال بالمتجر',
|
|
353
346
|
uploaded: 'تم التحميل',
|
|
354
347
|
uploadToStore: 'تحميل إلى المتجر',
|
|
@@ -356,7 +349,9 @@ export default {
|
|
|
356
349
|
blockletStudio: 'استوديو',
|
|
357
350
|
visitStore: 'زيارة المتجر',
|
|
358
351
|
reconnect: 'إعادة الاتصال',
|
|
359
|
-
change: 'تغيير'
|
|
352
|
+
change: 'تغيير',
|
|
353
|
+
disconnect: 'توقف',
|
|
354
|
+
sourceApp: 'ينتمي إلى التطبيق'
|
|
360
355
|
},
|
|
361
356
|
blocklet: {
|
|
362
357
|
external: 'خارجي',
|
|
@@ -598,7 +593,6 @@ export default {
|
|
|
598
593
|
downloadComponentError: 'حدث خطأ أثناء تنزيل المكون، يرجى إعادة المحاولة مرة أخرى',
|
|
599
594
|
addComponentTip: {
|
|
600
595
|
introduction: 'مرحبا بكم في معالج إضافة المكون',
|
|
601
|
-
isFree: 'يمكنك استخدام <b>{name}</b> كمكون مجاني;',
|
|
602
596
|
isPurchase: 'يجب التحقق من الـ NFT قبل استخدام <b>{name}</b> كمكون',
|
|
603
597
|
belowInformation: 'أدناه هي المعلومات للمكون:',
|
|
604
598
|
verifyNFT: 'يرجى تحديد طريقة التحقق من NFT',
|
|
@@ -609,7 +603,6 @@ export default {
|
|
|
609
603
|
addNext: 'أضف {name}',
|
|
610
604
|
upgradeNext: 'ترقية {name}',
|
|
611
605
|
setting: 'الإعدادات',
|
|
612
|
-
components: 'تبعيات المكوّن {name}',
|
|
613
606
|
noDependencies: 'لا يوجد لدى {name} أي تبعيات',
|
|
614
607
|
relatedComponents: 'النماذج المرتبطة',
|
|
615
608
|
required: 'مطلوب',
|
|
@@ -727,14 +720,12 @@ export default {
|
|
|
727
720
|
},
|
|
728
721
|
resourceTip: 'حاليًا ، كما هو الحال بوصفه كتلة مورد ، لا يمكن تثبيته مباشرة من المتجر.',
|
|
729
722
|
whyCantSeeInStore: 'لماذا لا أستطيع رؤية هذا البلوكليت في المتجر؟',
|
|
730
|
-
whyCantSeeResourceBlockletInStore: '
|
|
723
|
+
whyCantSeeResourceBlockletInStore: 'تم إخفاء Blockletات الموارد من صفحة قائمة المتجر افتراضيًا',
|
|
731
724
|
tenantScope: 'مستأجر',
|
|
732
725
|
blockletStudio: 'استوديو بلوكليت',
|
|
733
726
|
allComponentsNotRunning: 'لا يعمل بلوكلتس، يرجى تشغيله أولاً',
|
|
734
727
|
resourceEmptyTip: 'لا توجد موارد متاحة',
|
|
735
|
-
information: 'معلومات',
|
|
736
728
|
steps: {
|
|
737
|
-
information: 'صف البيانات الأساسية لحاجزك. سيتم تقديم هذه المعلومات للمستخدمين في المتجر.',
|
|
738
729
|
resources: 'الرجاء تحديد الموارد التي يجب ربطها معالبلوكليت الحالي ، حيث ستتم تثبيت هذه الموارد جنباً إلى جنب مع البلوكليت.',
|
|
739
730
|
blocklets: 'حدد العناصر النمطية لتكون مرتبطة.',
|
|
740
731
|
version: 'تعيين نسخة الإصدار وسجل التغييرات.',
|
|
@@ -744,7 +735,9 @@ export default {
|
|
|
744
735
|
branding: 'العلامة التجارية',
|
|
745
736
|
brandingHelp: 'سيتم عرض مزيد من المعلومات حول البلوكلت في المتجر',
|
|
746
737
|
resourceSelect: 'اختر موردًا من Blocklets',
|
|
747
|
-
resourceUpload: 'تحميل المورد من القرص الخاص بك (الفهرس.html مطلوب في الأرشيف)'
|
|
738
|
+
resourceUpload: 'تحميل المورد من القرص الخاص بك (الفهرس.html مطلوب في الأرشيف)',
|
|
739
|
+
deleteStoreTip: 'هل أنت متأكد أنك تريد إزالة {name} من قائمة متجر الاتصال؟',
|
|
740
|
+
disconnectStoreTip: 'سيتم حذف بلوكليت من المخزن بعد الفصل. هل أنت متأكد من أنك تريد الفصل؟'
|
|
748
741
|
},
|
|
749
742
|
titleValidationError: 'يجب أن يكون طول العنوان على الأقل 3 أحرف',
|
|
750
743
|
descriptionValidationError: 'يجب أن تكون طول الوصف بين 3 و 160 حرفًا'
|
|
@@ -1069,7 +1062,6 @@ export default {
|
|
|
1069
1062
|
}
|
|
1070
1063
|
},
|
|
1071
1064
|
domainAlias: {
|
|
1072
|
-
inputDomain: 'قم بتكوين نطاق يدويًا',
|
|
1073
1065
|
nftDomain: 'تكوين تلقائي مع نطاق DID',
|
|
1074
1066
|
showTipHint: 'كيف يمكنني تكوين اكتشاف اسم النطاق؟',
|
|
1075
1067
|
add: {
|
|
@@ -1519,7 +1511,6 @@ export default {
|
|
|
1519
1511
|
purchaseSpace: 'شراء مساحة',
|
|
1520
1512
|
prepareSpace: 'عد الفضاء'
|
|
1521
1513
|
},
|
|
1522
|
-
installRelatedDependencies: 'قم بتثبيت التبعيات ذات الصلة',
|
|
1523
1514
|
installRelatedComponents: 'تثبيت البلوكليتس ذات الصلة'
|
|
1524
1515
|
},
|
|
1525
1516
|
issuePassport: {
|