@abtnode/ux 1.16.14-beta-cb53c14b → 1.16.14-beta-963cb583
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/component/add.js +5 -0
- package/es/blocklet/component/selected/index.js +94 -0
- package/es/blocklet/storage/connect-to.js +5 -6
- package/es/card-selector.js +15 -15
- package/es/invitation/invitation-passport.js +7 -5
- package/es/locales/en.js +12 -5
- package/es/locales/zh.js +10 -3
- package/es/lost-passport.js +2 -2
- package/es/schema-form/passport-input.js +12 -11
- package/es/team/passports/color.js +14 -13
- package/es/util/spaces.js +10 -1
- package/lib/blocklet/component/add.js +5 -0
- package/lib/blocklet/component/selected/index.js +47 -0
- package/lib/blocklet/storage/connect-to.js +5 -6
- package/lib/card-selector.js +14 -14
- package/lib/invitation/invitation-passport.js +7 -6
- package/lib/locales/en.js +12 -5
- package/lib/locales/zh.js +10 -3
- package/lib/lost-passport.js +2 -2
- package/lib/schema-form/passport-input.js +12 -11
- package/lib/team/passports/color.js +14 -14
- package/lib/util/spaces.js +13 -1
- package/package.json +22 -18
|
@@ -48,6 +48,11 @@ const requirePurchase = meta => meta.inStore && isFreeBlocklet(meta) === false;
|
|
|
48
48
|
const getDIDSpaceCapability = meta => {
|
|
49
49
|
return meta?.capabilities?.didSpace;
|
|
50
50
|
};
|
|
51
|
+
/**
|
|
52
|
+
* @description
|
|
53
|
+
* @param {import('@abtnode/client').BlockletState} blocklet
|
|
54
|
+
* @return {string}
|
|
55
|
+
*/
|
|
51
56
|
const getDIDSpaceEndpoint = blocklet => {
|
|
52
57
|
return blocklet?.configs?.find(item => item.key === BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)?.value || null;
|
|
53
58
|
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/* eslint-disable react/jsx-one-expression-per-line */
|
|
2
|
+
import { Box } from '@mui/material';
|
|
3
|
+
import CheckIcon from '@mui/icons-material/Check';
|
|
4
|
+
import { bool, node } from 'prop-types';
|
|
5
|
+
import styled from '@emotion/styled';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* @export
|
|
11
|
+
* @param {{
|
|
12
|
+
* children: React.ReactNode,
|
|
13
|
+
* selected?: false | true,
|
|
14
|
+
* }} { children, selected }
|
|
15
|
+
* @return {React.Component}
|
|
16
|
+
*/
|
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
+
export default function Selected({
|
|
20
|
+
children,
|
|
21
|
+
selected
|
|
22
|
+
}) {
|
|
23
|
+
return /*#__PURE__*/_jsxs(BoxContainer, {
|
|
24
|
+
children: [children, /*#__PURE__*/_jsx(Box, {
|
|
25
|
+
className: `selected-container ${selected ? 'selected' : ''}`,
|
|
26
|
+
children: /*#__PURE__*/_jsx(CheckIcon, {
|
|
27
|
+
className: "selected-icon"
|
|
28
|
+
})
|
|
29
|
+
})]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const BoxContainer = styled(Box)`
|
|
33
|
+
position: relative;
|
|
34
|
+
|
|
35
|
+
.selected-container {
|
|
36
|
+
display: flex !important;
|
|
37
|
+
position: absolute;
|
|
38
|
+
right: 0px;
|
|
39
|
+
bottom: 0px;
|
|
40
|
+
-webkit-box-pack: end;
|
|
41
|
+
justify-content: flex-end;
|
|
42
|
+
align-items: flex-end;
|
|
43
|
+
width: 32px;
|
|
44
|
+
height: 32px;
|
|
45
|
+
border-radius: 0px 0px 8px;
|
|
46
|
+
color: rgb(255, 255, 255);
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
transition: all 0.4s ease 0s;
|
|
49
|
+
|
|
50
|
+
&::after {
|
|
51
|
+
position: absolute;
|
|
52
|
+
z-index: 0;
|
|
53
|
+
left: 60px;
|
|
54
|
+
top: 60px;
|
|
55
|
+
display: block;
|
|
56
|
+
width: 0px;
|
|
57
|
+
height: 0px;
|
|
58
|
+
border-width: 16px;
|
|
59
|
+
border-style: solid;
|
|
60
|
+
border-color: transparent #1dc1c7 #1dc1c7 transparent;
|
|
61
|
+
transition: all 0.1s ease 0s;
|
|
62
|
+
content: '';
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.selected-icon {
|
|
66
|
+
visibility: hidden;
|
|
67
|
+
width: 60%;
|
|
68
|
+
height: 60%;
|
|
69
|
+
position: relative;
|
|
70
|
+
z-index: 2;
|
|
71
|
+
margin: 0px 1px 1px 0px;
|
|
72
|
+
font-size: 16px;
|
|
73
|
+
transition: all 0.2s ease 0s;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.selected-container.selected {
|
|
78
|
+
&::after {
|
|
79
|
+
left: 0px;
|
|
80
|
+
top: 0px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.selected-icon {
|
|
84
|
+
visibility: visible;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
`;
|
|
88
|
+
Selected.propTypes = {
|
|
89
|
+
children: node.isRequired,
|
|
90
|
+
selected: bool
|
|
91
|
+
};
|
|
92
|
+
Selected.defaultProps = {
|
|
93
|
+
selected: false
|
|
94
|
+
};
|
|
@@ -4,7 +4,6 @@ import Button from '@arcblock/ux/lib/Button';
|
|
|
4
4
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
5
5
|
import DidConnect from '@arcblock/did-connect/lib/Connect';
|
|
6
6
|
import joinUrl from 'url-join';
|
|
7
|
-
import isUrl from 'is-url';
|
|
8
7
|
import toast from '@arcblock/ux/lib/Toast';
|
|
9
8
|
import { BLOCKLET_CONFIGURABLE_KEY } from '@blocklet/constant';
|
|
10
9
|
import SplitButton from '@arcblock/ux/lib/SplitButton';
|
|
@@ -144,12 +143,12 @@ function ConnectTo({
|
|
|
144
143
|
name,
|
|
145
144
|
did
|
|
146
145
|
}) => {
|
|
147
|
-
let
|
|
148
|
-
if (!
|
|
146
|
+
let normalizeUrl = endpoint?.replace(/\/api\/.+/, '')?.trim()?.replace(/\/$/, '');
|
|
147
|
+
if (!normalizeUrl.startsWith('http')) {
|
|
149
148
|
// eslint-disable-next-line no-param-reassign
|
|
150
|
-
|
|
149
|
+
normalizeUrl = `https://${normalizeUrl}`;
|
|
151
150
|
}
|
|
152
|
-
if (!
|
|
151
|
+
if (!(await isValidSpaceGatewayUrl(normalizeUrl))) {
|
|
153
152
|
toast.error(t('storage.spaces.gateway.add.invalidUrl'));
|
|
154
153
|
return;
|
|
155
154
|
}
|
|
@@ -163,7 +162,7 @@ function ConnectTo({
|
|
|
163
162
|
const spaceGateway = {
|
|
164
163
|
name,
|
|
165
164
|
did,
|
|
166
|
-
url:
|
|
165
|
+
url: normalizeUrl,
|
|
167
166
|
endpoint
|
|
168
167
|
};
|
|
169
168
|
await nodeApi.addBlockletSpaceGateway({
|
package/es/card-selector.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react/no-danger */
|
|
1
2
|
/* eslint-disable jsx-a11y/alt-text */
|
|
2
3
|
import { useState, useEffect, useRef } from 'react';
|
|
3
4
|
import styled from '@emotion/styled';
|
|
@@ -13,7 +14,7 @@ export default function CardSelector({
|
|
|
13
14
|
}) {
|
|
14
15
|
const [selectedId, setSelectedId] = useState(0);
|
|
15
16
|
const [translateX, setTranslateX] = useState(0);
|
|
16
|
-
const
|
|
17
|
+
const outerCon = useRef(null);
|
|
17
18
|
|
|
18
19
|
// 选择卡片
|
|
19
20
|
const selectedItem = i => {
|
|
@@ -23,14 +24,14 @@ export default function CardSelector({
|
|
|
23
24
|
setSelectedId(i);
|
|
24
25
|
|
|
25
26
|
// 外部容器大小
|
|
26
|
-
const outerWidth =
|
|
27
|
+
const outerWidth = outerCon.current.clientWidth;
|
|
27
28
|
setTranslateX(i * (width + cardSpace) - (outerWidth - width) / 2 + cardSpace * 0.5);
|
|
28
29
|
onSelect(i);
|
|
29
30
|
};
|
|
30
31
|
useEffect(() => {
|
|
31
32
|
selectedItem(defaultIndex);
|
|
32
33
|
const func = e => e.preventDefault();
|
|
33
|
-
|
|
34
|
+
outerCon.current.addEventListener('touchmove', func, {
|
|
34
35
|
passive: false
|
|
35
36
|
});
|
|
36
37
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -52,7 +53,7 @@ export default function CardSelector({
|
|
|
52
53
|
}
|
|
53
54
|
};
|
|
54
55
|
return /*#__PURE__*/_jsx(Container, {
|
|
55
|
-
ref:
|
|
56
|
+
ref: outerCon,
|
|
56
57
|
onTouchStart: touchstart,
|
|
57
58
|
onTouchEnd: touchend,
|
|
58
59
|
children: /*#__PURE__*/_jsx("div", {
|
|
@@ -60,23 +61,22 @@ export default function CardSelector({
|
|
|
60
61
|
style: {
|
|
61
62
|
transform: `translate(${-translateX}px, 0)`
|
|
62
63
|
},
|
|
63
|
-
children: list.map((
|
|
64
|
+
children: list.map((x, i) => {
|
|
64
65
|
return /*#__PURE__*/_jsx("div", {
|
|
65
66
|
className: `card-item ${i === selectedId ? 'selected' : ''}`,
|
|
66
67
|
style: {
|
|
67
68
|
width,
|
|
68
69
|
height,
|
|
69
70
|
margin: cardSpace / 2
|
|
70
|
-
}
|
|
71
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
72
|
-
,
|
|
73
|
-
|
|
71
|
+
},
|
|
74
72
|
onClick: () => selectedItem(i),
|
|
75
|
-
children: /*#__PURE__*/_jsx("
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
74
|
+
className: "card-content",
|
|
75
|
+
dangerouslySetInnerHTML: {
|
|
76
|
+
__html: x.src
|
|
77
|
+
}
|
|
78
78
|
})
|
|
79
|
-
},
|
|
79
|
+
}, x.id);
|
|
80
80
|
})
|
|
81
81
|
})
|
|
82
82
|
});
|
|
@@ -98,7 +98,7 @@ const Container = styled.div`
|
|
|
98
98
|
flex-shrink: 0;
|
|
99
99
|
cursor: pointer;
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
.card-content {
|
|
102
102
|
pointer-events: none;
|
|
103
103
|
max-width: 100%;
|
|
104
104
|
max-height: 100%;
|
|
@@ -110,7 +110,7 @@ const Container = styled.div`
|
|
|
110
110
|
}
|
|
111
111
|
&.selected {
|
|
112
112
|
cursor: default;
|
|
113
|
-
|
|
113
|
+
.card-content {
|
|
114
114
|
outline: #526ded solid 5px;
|
|
115
115
|
}
|
|
116
116
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react/no-danger */
|
|
1
2
|
/* eslint-disable jsx-a11y/alt-text */
|
|
2
3
|
import { useCallback, useContext, useMemo, useState } from 'react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
@@ -30,7 +31,6 @@ function InvitationPassport({
|
|
|
30
31
|
// can't get avatar, cause user is not login
|
|
31
32
|
// ownerAvatarUrl: user.avatar,
|
|
32
33
|
ownerDid: invitation.info.appDid,
|
|
33
|
-
isDataUrl: true,
|
|
34
34
|
preferredColor: invitation.info.passportColor || passportColor
|
|
35
35
|
});
|
|
36
36
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -46,10 +46,11 @@ function InvitationPassport({
|
|
|
46
46
|
children: /*#__PURE__*/_jsx("div", {
|
|
47
47
|
className: "invite-passport__card",
|
|
48
48
|
onClick: onViewPermission,
|
|
49
|
-
children: /*#__PURE__*/_jsx("
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
50
|
+
className: "invite-passport__cover",
|
|
51
|
+
dangerouslySetInnerHTML: {
|
|
52
|
+
__html: display
|
|
53
|
+
}
|
|
53
54
|
})
|
|
54
55
|
})
|
|
55
56
|
}), /*#__PURE__*/_jsx(Dialog, {
|
|
@@ -108,6 +109,7 @@ const Root = styled.div`
|
|
|
108
109
|
height: 258px;
|
|
109
110
|
flex-shrink: 0;
|
|
110
111
|
.invite-passport__cover {
|
|
112
|
+
cursor: pointer;
|
|
111
113
|
width: 100%;
|
|
112
114
|
height: 100%;
|
|
113
115
|
}
|
package/es/locales/en.js
CHANGED
|
@@ -310,7 +310,8 @@ module.exports = {
|
|
|
310
310
|
manual: 'Manual',
|
|
311
311
|
progress: 'In progress',
|
|
312
312
|
startTime: 'Start time',
|
|
313
|
-
endTime: 'End time'
|
|
313
|
+
endTime: 'End time',
|
|
314
|
+
selected: 'Selected'
|
|
314
315
|
},
|
|
315
316
|
blocklet: {
|
|
316
317
|
external: 'External',
|
|
@@ -1354,6 +1355,7 @@ module.exports = {
|
|
|
1354
1355
|
tag: 'Connected'
|
|
1355
1356
|
},
|
|
1356
1357
|
connectedWithName: 'You have successfully connected to {name}',
|
|
1358
|
+
addedWithName: 'You have successfully added {name}',
|
|
1357
1359
|
connects: 'Connect',
|
|
1358
1360
|
reconnect: 'Reconnect',
|
|
1359
1361
|
addressCannotEmpty: 'Address cannot be empty',
|
|
@@ -1389,7 +1391,8 @@ module.exports = {
|
|
|
1389
1391
|
title: 'Delete gateway',
|
|
1390
1392
|
succeeded: 'Delete DID Spaces{name} Success',
|
|
1391
1393
|
failed: 'Delete gateway failed',
|
|
1392
|
-
failedForConnected: 'Unable to delete a connected DID Spaces'
|
|
1394
|
+
failedForConnected: 'Unable to delete a connected DID Spaces',
|
|
1395
|
+
failedForSelected: 'Unable to delete a selected DID Spaces'
|
|
1393
1396
|
},
|
|
1394
1397
|
connect: {
|
|
1395
1398
|
title: 'Connect DID Spaces',
|
|
@@ -1419,14 +1422,18 @@ module.exports = {
|
|
|
1419
1422
|
},
|
|
1420
1423
|
notYet: "You don't have a backup in progress yet...",
|
|
1421
1424
|
connect: {
|
|
1422
|
-
now: 'Connect',
|
|
1425
|
+
now: 'Connect now',
|
|
1423
1426
|
title: 'Connect DID Spaces',
|
|
1424
1427
|
provider: 'Provide your DID Spaces to start backups',
|
|
1425
|
-
|
|
1428
|
+
providerForStorage: 'Please connect your DID Spaces',
|
|
1429
|
+
useWallet: 'Connect with DID Wallet',
|
|
1430
|
+
useWalletReconnect: 'Reconnect with DID Wallet',
|
|
1426
1431
|
useSpaceGateway: 'Connect using the DID Spaces gateway',
|
|
1432
|
+
useSpaceGatewayReconnect: 'Reconnect using the DID Spaces gateway',
|
|
1427
1433
|
switchToSpace: 'Switch to Space',
|
|
1428
1434
|
switchToSpaceSucceeded: 'Switched to Space{name}',
|
|
1429
|
-
succeeded: 'You have successfully connected to DID Spaces'
|
|
1435
|
+
succeeded: 'You have successfully connected to DID Spaces',
|
|
1436
|
+
disconnect: 'disconnect'
|
|
1430
1437
|
},
|
|
1431
1438
|
disconnected: {
|
|
1432
1439
|
tag: 'Disconnected',
|
package/es/locales/zh.js
CHANGED
|
@@ -315,7 +315,8 @@ module.exports = {
|
|
|
315
315
|
manual: '手动',
|
|
316
316
|
progress: '进行中',
|
|
317
317
|
startTime: '开始时间',
|
|
318
|
-
endTime: '结束时间'
|
|
318
|
+
endTime: '结束时间',
|
|
319
|
+
selected: '已选中'
|
|
319
320
|
},
|
|
320
321
|
blocklet: {
|
|
321
322
|
external: '外部',
|
|
@@ -1358,6 +1359,7 @@ module.exports = {
|
|
|
1358
1359
|
tag: '已连接'
|
|
1359
1360
|
},
|
|
1360
1361
|
connectedWithName: '你已成功连接至 {name}',
|
|
1362
|
+
addedWithName: '你已成功添加 {name}',
|
|
1361
1363
|
connects: '连接',
|
|
1362
1364
|
reconnect: '重新连接',
|
|
1363
1365
|
addressCannotEmpty: '地址不能为空',
|
|
@@ -1392,7 +1394,8 @@ module.exports = {
|
|
|
1392
1394
|
title: '删除 DID Spaces',
|
|
1393
1395
|
succeeded: '删除 DID Spaces{name} 成功',
|
|
1394
1396
|
failed: '删除 DID Spaces 失败',
|
|
1395
|
-
failedForConnected: '无法删除一个已连接的 DID Spaces'
|
|
1397
|
+
failedForConnected: '无法删除一个已连接的 DID Spaces',
|
|
1398
|
+
failedForSelected: '无法删除一个已选中的 DID Spaces'
|
|
1396
1399
|
},
|
|
1397
1400
|
connect: {
|
|
1398
1401
|
title: '连接到 DID Spaces',
|
|
@@ -1425,11 +1428,15 @@ module.exports = {
|
|
|
1425
1428
|
now: '立即连接',
|
|
1426
1429
|
title: '使用 DID Wallet 连接',
|
|
1427
1430
|
provider: '提供您的 DID Spaces 开始备份',
|
|
1431
|
+
providerForStorage: '请连接您的 DID Spaces',
|
|
1428
1432
|
useWallet: '使用 DID Wallet 连接',
|
|
1433
|
+
useWalletReconnect: '使用 DID Wallet 重新连接',
|
|
1429
1434
|
useSpaceGateway: '使用 DID Spaces 网关连接',
|
|
1435
|
+
useSpaceGatewayReconnect: '使用 DID Spaces 网关重新连接',
|
|
1430
1436
|
switchToSpace: '切换至 Space',
|
|
1431
1437
|
switchToSpaceSucceeded: '已切换至 Space{name}',
|
|
1432
|
-
succeeded: '你已成功连接至 DID Spaces'
|
|
1438
|
+
succeeded: '你已成功连接至 DID Spaces',
|
|
1439
|
+
disconnect: '断开连接'
|
|
1433
1440
|
},
|
|
1434
1441
|
disconnected: {
|
|
1435
1442
|
tag: '连接已断开',
|
package/es/lost-passport.js
CHANGED
|
@@ -207,10 +207,10 @@ function LostPassport({
|
|
|
207
207
|
ownerDid: user.did,
|
|
208
208
|
ownerName: user.fullName,
|
|
209
209
|
ownerAvatarUrl: user.avatar,
|
|
210
|
-
isDataUrl: true,
|
|
211
210
|
preferredColor: passportColor || 'auto'
|
|
212
211
|
}),
|
|
213
|
-
name: x.title
|
|
212
|
+
name: x.title,
|
|
213
|
+
id: x.id
|
|
214
214
|
};
|
|
215
215
|
}),
|
|
216
216
|
onSelect: index => handleChange({
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react/no-danger */
|
|
1
2
|
import PropTypes from 'prop-types';
|
|
2
3
|
import Box from '@mui/material/Box';
|
|
3
4
|
import createPassportSvg from '@abtnode/auth/lib/util/create-passport-svg';
|
|
@@ -21,21 +22,21 @@ export default function PassportInput({
|
|
|
21
22
|
return /*#__PURE__*/_jsxs(Box, {
|
|
22
23
|
display: "flex",
|
|
23
24
|
alignItems: "center",
|
|
24
|
-
children: [/*#__PURE__*/_jsx("
|
|
25
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
25
26
|
style: {
|
|
26
27
|
width: 96,
|
|
27
28
|
marginRight: 12
|
|
28
29
|
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
30
|
+
dangerouslySetInnerHTML: {
|
|
31
|
+
__html: createPassportSvg({
|
|
32
|
+
title: 'Owner',
|
|
33
|
+
issuer: getDisplayName(blocklet),
|
|
34
|
+
issuerDid: blocklet.appDid,
|
|
35
|
+
ownerName: 'Your Name',
|
|
36
|
+
ownerDid: blocklet.appDid,
|
|
37
|
+
preferredColor: value || 'auto'
|
|
38
|
+
})
|
|
39
|
+
}
|
|
39
40
|
}), /*#__PURE__*/_jsx(ColorInput, {
|
|
40
41
|
...rest,
|
|
41
42
|
editing: editing,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react/no-danger */
|
|
1
2
|
import { useState } from 'react';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import Box from '@mui/material/Box';
|
|
@@ -85,21 +86,21 @@ function PassportColor({
|
|
|
85
86
|
children: [/*#__PURE__*/_jsx(ChromePicker, {
|
|
86
87
|
color: color,
|
|
87
88
|
onChange: c => setColor(c.hex)
|
|
88
|
-
}), /*#__PURE__*/_jsx("
|
|
89
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
89
90
|
style: {
|
|
90
|
-
width:
|
|
91
|
-
marginLeft:
|
|
91
|
+
width: 220,
|
|
92
|
+
marginLeft: 24
|
|
92
93
|
},
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
94
|
+
dangerouslySetInnerHTML: {
|
|
95
|
+
__html: createPassportSvg({
|
|
96
|
+
title: 'Owner',
|
|
97
|
+
issuer: getDisplayName(blocklet),
|
|
98
|
+
issuerDid: blocklet.appDid,
|
|
99
|
+
ownerName: 'Your Name',
|
|
100
|
+
ownerDid: blocklet.appDid,
|
|
101
|
+
preferredColor: color
|
|
102
|
+
})
|
|
103
|
+
}
|
|
103
104
|
})]
|
|
104
105
|
})
|
|
105
106
|
});
|
package/es/util/spaces.js
CHANGED
|
@@ -148,4 +148,13 @@ export function getSpaceNftDisplayUrlFromEndpoint(endpoint) {
|
|
|
148
148
|
const strArray = endpoint.replace(/\/$/, '').split('/');
|
|
149
149
|
const spaceDid = strArray.at(-4);
|
|
150
150
|
return joinUrl(prefix, `/api/space/nft/display?spaceDid=${spaceDid}`);
|
|
151
|
-
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @description
|
|
155
|
+
* @param {import('@abtnode/client').BlockletState} blocklet
|
|
156
|
+
* @return {string}
|
|
157
|
+
*/
|
|
158
|
+
export const getDIDSpaceEndpoint = blocklet => {
|
|
159
|
+
return blocklet?.configs?.find(item => item.key === BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)?.value || null;
|
|
160
|
+
};
|
|
@@ -64,6 +64,11 @@ const getDIDSpaceCapability = meta => {
|
|
|
64
64
|
var _meta$capabilities;
|
|
65
65
|
return meta === null || meta === void 0 ? void 0 : (_meta$capabilities = meta.capabilities) === null || _meta$capabilities === void 0 ? void 0 : _meta$capabilities.didSpace;
|
|
66
66
|
};
|
|
67
|
+
/**
|
|
68
|
+
* @description
|
|
69
|
+
* @param {import('@abtnode/client').BlockletState} blocklet
|
|
70
|
+
* @return {string}
|
|
71
|
+
*/
|
|
67
72
|
const getDIDSpaceEndpoint = blocklet => {
|
|
68
73
|
var _blocklet$configs, _blocklet$configs$fin;
|
|
69
74
|
return (blocklet === null || blocklet === void 0 ? void 0 : (_blocklet$configs = blocklet.configs) === null || _blocklet$configs === void 0 ? void 0 : (_blocklet$configs$fin = _blocklet$configs.find(item => item.key === _constant.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)) === null || _blocklet$configs$fin === void 0 ? void 0 : _blocklet$configs$fin.value) || null;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = Selected;
|
|
7
|
+
var _material = require("@mui/material");
|
|
8
|
+
var _Check = _interopRequireDefault(require("@mui/icons-material/Check"));
|
|
9
|
+
var _propTypes = require("prop-types");
|
|
10
|
+
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
var _templateObject;
|
|
13
|
+
/* eslint-disable react/jsx-one-expression-per-line */
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
*
|
|
17
|
+
* @export
|
|
18
|
+
* @param {{
|
|
19
|
+
* children: React.ReactNode,
|
|
20
|
+
* selected?: false | true,
|
|
21
|
+
* }} { children, selected }
|
|
22
|
+
* @return {React.Component}
|
|
23
|
+
*/
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
26
|
+
function Selected(_ref) {
|
|
27
|
+
let {
|
|
28
|
+
children,
|
|
29
|
+
selected
|
|
30
|
+
} = _ref;
|
|
31
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(BoxContainer, {
|
|
32
|
+
children: [children, /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
33
|
+
className: "selected-container ".concat(selected ? 'selected' : ''),
|
|
34
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Check.default, {
|
|
35
|
+
className: "selected-icon"
|
|
36
|
+
})
|
|
37
|
+
})]
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const BoxContainer = (0, _styled.default)(_material.Box)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n\n .selected-container {\n display: flex !important;\n position: absolute;\n right: 0px;\n bottom: 0px;\n -webkit-box-pack: end;\n justify-content: flex-end;\n align-items: flex-end;\n width: 32px;\n height: 32px;\n border-radius: 0px 0px 8px;\n color: rgb(255, 255, 255);\n overflow: hidden;\n transition: all 0.4s ease 0s;\n\n &::after {\n position: absolute;\n z-index: 0;\n left: 60px;\n top: 60px;\n display: block;\n width: 0px;\n height: 0px;\n border-width: 16px;\n border-style: solid;\n border-color: transparent #1dc1c7 #1dc1c7 transparent;\n transition: all 0.1s ease 0s;\n content: '';\n }\n\n .selected-icon {\n visibility: hidden;\n width: 60%;\n height: 60%;\n position: relative;\n z-index: 2;\n margin: 0px 1px 1px 0px;\n font-size: 16px;\n transition: all 0.2s ease 0s;\n }\n }\n\n .selected-container.selected {\n &::after {\n left: 0px;\n top: 0px;\n }\n\n .selected-icon {\n visibility: visible;\n }\n }\n"])));
|
|
41
|
+
Selected.propTypes = {
|
|
42
|
+
children: _propTypes.node.isRequired,
|
|
43
|
+
selected: _propTypes.bool
|
|
44
|
+
};
|
|
45
|
+
Selected.defaultProps = {
|
|
46
|
+
selected: false
|
|
47
|
+
};
|
|
@@ -10,7 +10,6 @@ var _Button = _interopRequireDefault(require("@arcblock/ux/lib/Button"));
|
|
|
10
10
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
11
11
|
var _Connect = _interopRequireDefault(require("@arcblock/did-connect/lib/Connect"));
|
|
12
12
|
var _urlJoin = _interopRequireDefault(require("url-join"));
|
|
13
|
-
var _isUrl = _interopRequireDefault(require("is-url"));
|
|
14
13
|
var _Toast = _interopRequireDefault(require("@arcblock/ux/lib/Toast"));
|
|
15
14
|
var _constant = require("@blocklet/constant");
|
|
16
15
|
var _SplitButton = _interopRequireDefault(require("@arcblock/ux/lib/SplitButton"));
|
|
@@ -155,12 +154,12 @@ function ConnectTo(_ref) {
|
|
|
155
154
|
name,
|
|
156
155
|
did
|
|
157
156
|
} = _ref2;
|
|
158
|
-
let
|
|
159
|
-
if (!
|
|
157
|
+
let normalizeUrl = endpoint === null || endpoint === void 0 ? void 0 : (_endpoint$replace = endpoint.replace(/\/api\/.+/, '')) === null || _endpoint$replace === void 0 ? void 0 : (_endpoint$replace$tri = _endpoint$replace.trim()) === null || _endpoint$replace$tri === void 0 ? void 0 : _endpoint$replace$tri.replace(/\/$/, '');
|
|
158
|
+
if (!normalizeUrl.startsWith('http')) {
|
|
160
159
|
// eslint-disable-next-line no-param-reassign
|
|
161
|
-
|
|
160
|
+
normalizeUrl = "https://".concat(normalizeUrl);
|
|
162
161
|
}
|
|
163
|
-
if (!(0,
|
|
162
|
+
if (!(await (0, _spaces.isValidSpaceGatewayUrl)(normalizeUrl))) {
|
|
164
163
|
_Toast.default.error(t('storage.spaces.gateway.add.invalidUrl'));
|
|
165
164
|
return;
|
|
166
165
|
}
|
|
@@ -174,7 +173,7 @@ function ConnectTo(_ref) {
|
|
|
174
173
|
const spaceGateway = {
|
|
175
174
|
name,
|
|
176
175
|
did,
|
|
177
|
-
url:
|
|
176
|
+
url: normalizeUrl,
|
|
178
177
|
endpoint
|
|
179
178
|
};
|
|
180
179
|
await nodeApi.addBlockletSpaceGateway({
|
package/lib/card-selector.js
CHANGED
|
@@ -9,6 +9,7 @@ var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
var _templateObject;
|
|
12
|
+
/* eslint-disable react/no-danger */
|
|
12
13
|
/* eslint-disable jsx-a11y/alt-text */
|
|
13
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
15
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
@@ -23,7 +24,7 @@ function CardSelector(_ref) {
|
|
|
23
24
|
} = _ref;
|
|
24
25
|
const [selectedId, setSelectedId] = (0, _react.useState)(0);
|
|
25
26
|
const [translateX, setTranslateX] = (0, _react.useState)(0);
|
|
26
|
-
const
|
|
27
|
+
const outerCon = (0, _react.useRef)(null);
|
|
27
28
|
|
|
28
29
|
// 选择卡片
|
|
29
30
|
const selectedItem = i => {
|
|
@@ -33,14 +34,14 @@ function CardSelector(_ref) {
|
|
|
33
34
|
setSelectedId(i);
|
|
34
35
|
|
|
35
36
|
// 外部容器大小
|
|
36
|
-
const outerWidth =
|
|
37
|
+
const outerWidth = outerCon.current.clientWidth;
|
|
37
38
|
setTranslateX(i * (width + cardSpace) - (outerWidth - width) / 2 + cardSpace * 0.5);
|
|
38
39
|
onSelect(i);
|
|
39
40
|
};
|
|
40
41
|
(0, _react.useEffect)(() => {
|
|
41
42
|
selectedItem(defaultIndex);
|
|
42
43
|
const func = e => e.preventDefault();
|
|
43
|
-
|
|
44
|
+
outerCon.current.addEventListener('touchmove', func, {
|
|
44
45
|
passive: false
|
|
45
46
|
});
|
|
46
47
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -62,7 +63,7 @@ function CardSelector(_ref) {
|
|
|
62
63
|
}
|
|
63
64
|
};
|
|
64
65
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Container, {
|
|
65
|
-
ref:
|
|
66
|
+
ref: outerCon,
|
|
66
67
|
onTouchStart: touchstart,
|
|
67
68
|
onTouchEnd: touchend,
|
|
68
69
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -70,28 +71,27 @@ function CardSelector(_ref) {
|
|
|
70
71
|
style: {
|
|
71
72
|
transform: "translate(".concat(-translateX, "px, 0)")
|
|
72
73
|
},
|
|
73
|
-
children: list.map((
|
|
74
|
+
children: list.map((x, i) => {
|
|
74
75
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
75
76
|
className: "card-item ".concat(i === selectedId ? 'selected' : ''),
|
|
76
77
|
style: {
|
|
77
78
|
width,
|
|
78
79
|
height,
|
|
79
80
|
margin: cardSpace / 2
|
|
80
|
-
}
|
|
81
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
82
|
-
,
|
|
83
|
-
|
|
81
|
+
},
|
|
84
82
|
onClick: () => selectedItem(i),
|
|
85
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
84
|
+
className: "card-content",
|
|
85
|
+
dangerouslySetInnerHTML: {
|
|
86
|
+
__html: x.src
|
|
87
|
+
}
|
|
88
88
|
})
|
|
89
|
-
},
|
|
89
|
+
}, x.id);
|
|
90
90
|
})
|
|
91
91
|
})
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
-
const Container = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow: hidden;\n mask-image: linear-gradient(to left, transparent, black 3%, black 97%, transparent);\n overflow: hidden;\n .card-container {\n display: flex;\n white-space: nowrap;\n width: max-content;\n transition: all ease 0.3s;\n }\n .card-item {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n flex-shrink: 0;\n cursor: pointer;\n\n
|
|
94
|
+
const Container = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow: hidden;\n mask-image: linear-gradient(to left, transparent, black 3%, black 97%, transparent);\n overflow: hidden;\n .card-container {\n display: flex;\n white-space: nowrap;\n width: max-content;\n transition: all ease 0.3s;\n }\n .card-item {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n flex-shrink: 0;\n cursor: pointer;\n\n .card-content {\n pointer-events: none;\n max-width: 100%;\n max-height: 100%;\n width: auto;\n height: auto;\n outline: #526ded solid 0;\n transition: all ease 0.2s;\n box-shadow: rgba(0, 0, 0, 0.2) 0 0 10px;\n }\n &.selected {\n cursor: default;\n .card-content {\n outline: #526ded solid 5px;\n }\n }\n }\n"])));
|
|
95
95
|
CardSelector.propTypes = {
|
|
96
96
|
list: _propTypes.default.array,
|
|
97
97
|
width: _propTypes.default.number,
|
|
@@ -12,6 +12,7 @@ var _Dialog = _interopRequireDefault(require("@arcblock/ux/lib/Dialog"));
|
|
|
12
12
|
var _iconsMaterial = require("@mui/icons-material");
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
14
|
var _templateObject;
|
|
15
|
+
/* eslint-disable react/no-danger */
|
|
15
16
|
/* eslint-disable jsx-a11y/alt-text */
|
|
16
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
18
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
@@ -38,7 +39,6 @@ function InvitationPassport(_ref) {
|
|
|
38
39
|
// can't get avatar, cause user is not login
|
|
39
40
|
// ownerAvatarUrl: user.avatar,
|
|
40
41
|
ownerDid: invitation.info.appDid,
|
|
41
|
-
isDataUrl: true,
|
|
42
42
|
preferredColor: invitation.info.passportColor || passportColor
|
|
43
43
|
});
|
|
44
44
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -54,10 +54,11 @@ function InvitationPassport(_ref) {
|
|
|
54
54
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
55
55
|
className: "invite-passport__card",
|
|
56
56
|
onClick: onViewPermission,
|
|
57
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
58
|
+
className: "invite-passport__cover",
|
|
59
|
+
dangerouslySetInnerHTML: {
|
|
60
|
+
__html: display
|
|
61
|
+
}
|
|
61
62
|
})
|
|
62
63
|
})
|
|
63
64
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.default, {
|
|
@@ -106,7 +107,7 @@ InvitationPassport.propTypes = {
|
|
|
106
107
|
InvitationPassport.defaultProps = {
|
|
107
108
|
passportColor: 'auto'
|
|
108
109
|
};
|
|
109
|
-
const Root = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n max-width: 350px;\n margin: 30px auto;\n .invite-passport__card {\n margin: 0 auto;\n width: 228px;\n height: 258px;\n flex-shrink: 0;\n .invite-passport__cover {\n width: 100%;\n height: 100%;\n }\n }\n .invite-passport__content {\n flex: 1;\n display: flex;\n flex-direction: column;\n }\n .invite-passport__title {\n font-weight: 700;\n font-size: 16px;\n }\n .invite-passport__description {\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n height: 3em;\n color: #999;\n font-size: 14px;\n }\n .invite-passport__view-permission {\n cursor: pointer;\n font-size: 14px;\n font-weight: 600;\n line-height: 18px;\n color: ", ";\n }\n"])), _ref2 => {
|
|
110
|
+
const Root = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n max-width: 350px;\n margin: 30px auto;\n .invite-passport__card {\n margin: 0 auto;\n width: 228px;\n height: 258px;\n flex-shrink: 0;\n .invite-passport__cover {\n cursor: pointer;\n width: 100%;\n height: 100%;\n }\n }\n .invite-passport__content {\n flex: 1;\n display: flex;\n flex-direction: column;\n }\n .invite-passport__title {\n font-weight: 700;\n font-size: 16px;\n }\n .invite-passport__description {\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n height: 3em;\n color: #999;\n font-size: 14px;\n }\n .invite-passport__view-permission {\n cursor: pointer;\n font-size: 14px;\n font-weight: 600;\n line-height: 18px;\n color: ", ";\n }\n"])), _ref2 => {
|
|
110
111
|
let {
|
|
111
112
|
theme
|
|
112
113
|
} = _ref2;
|
package/lib/locales/en.js
CHANGED
|
@@ -312,7 +312,8 @@ module.exports = {
|
|
|
312
312
|
manual: 'Manual',
|
|
313
313
|
progress: 'In progress',
|
|
314
314
|
startTime: 'Start time',
|
|
315
|
-
endTime: 'End time'
|
|
315
|
+
endTime: 'End time',
|
|
316
|
+
selected: 'Selected'
|
|
316
317
|
},
|
|
317
318
|
blocklet: {
|
|
318
319
|
external: 'External',
|
|
@@ -1356,6 +1357,7 @@ module.exports = {
|
|
|
1356
1357
|
tag: 'Connected'
|
|
1357
1358
|
},
|
|
1358
1359
|
connectedWithName: 'You have successfully connected to {name}',
|
|
1360
|
+
addedWithName: 'You have successfully added {name}',
|
|
1359
1361
|
connects: 'Connect',
|
|
1360
1362
|
reconnect: 'Reconnect',
|
|
1361
1363
|
addressCannotEmpty: 'Address cannot be empty',
|
|
@@ -1391,7 +1393,8 @@ module.exports = {
|
|
|
1391
1393
|
title: 'Delete gateway',
|
|
1392
1394
|
succeeded: 'Delete DID Spaces{name} Success',
|
|
1393
1395
|
failed: 'Delete gateway failed',
|
|
1394
|
-
failedForConnected: 'Unable to delete a connected DID Spaces'
|
|
1396
|
+
failedForConnected: 'Unable to delete a connected DID Spaces',
|
|
1397
|
+
failedForSelected: 'Unable to delete a selected DID Spaces'
|
|
1395
1398
|
},
|
|
1396
1399
|
connect: {
|
|
1397
1400
|
title: 'Connect DID Spaces',
|
|
@@ -1421,14 +1424,18 @@ module.exports = {
|
|
|
1421
1424
|
},
|
|
1422
1425
|
notYet: "You don't have a backup in progress yet...",
|
|
1423
1426
|
connect: {
|
|
1424
|
-
now: 'Connect',
|
|
1427
|
+
now: 'Connect now',
|
|
1425
1428
|
title: 'Connect DID Spaces',
|
|
1426
1429
|
provider: 'Provide your DID Spaces to start backups',
|
|
1427
|
-
|
|
1430
|
+
providerForStorage: 'Please connect your DID Spaces',
|
|
1431
|
+
useWallet: 'Connect with DID Wallet',
|
|
1432
|
+
useWalletReconnect: 'Reconnect with DID Wallet',
|
|
1428
1433
|
useSpaceGateway: 'Connect using the DID Spaces gateway',
|
|
1434
|
+
useSpaceGatewayReconnect: 'Reconnect using the DID Spaces gateway',
|
|
1429
1435
|
switchToSpace: 'Switch to Space',
|
|
1430
1436
|
switchToSpaceSucceeded: 'Switched to Space{name}',
|
|
1431
|
-
succeeded: 'You have successfully connected to DID Spaces'
|
|
1437
|
+
succeeded: 'You have successfully connected to DID Spaces',
|
|
1438
|
+
disconnect: 'disconnect'
|
|
1432
1439
|
},
|
|
1433
1440
|
disconnected: {
|
|
1434
1441
|
tag: 'Disconnected',
|
package/lib/locales/zh.js
CHANGED
|
@@ -317,7 +317,8 @@ module.exports = {
|
|
|
317
317
|
manual: '手动',
|
|
318
318
|
progress: '进行中',
|
|
319
319
|
startTime: '开始时间',
|
|
320
|
-
endTime: '结束时间'
|
|
320
|
+
endTime: '结束时间',
|
|
321
|
+
selected: '已选中'
|
|
321
322
|
},
|
|
322
323
|
blocklet: {
|
|
323
324
|
external: '外部',
|
|
@@ -1360,6 +1361,7 @@ module.exports = {
|
|
|
1360
1361
|
tag: '已连接'
|
|
1361
1362
|
},
|
|
1362
1363
|
connectedWithName: '你已成功连接至 {name}',
|
|
1364
|
+
addedWithName: '你已成功添加 {name}',
|
|
1363
1365
|
connects: '连接',
|
|
1364
1366
|
reconnect: '重新连接',
|
|
1365
1367
|
addressCannotEmpty: '地址不能为空',
|
|
@@ -1394,7 +1396,8 @@ module.exports = {
|
|
|
1394
1396
|
title: '删除 DID Spaces',
|
|
1395
1397
|
succeeded: '删除 DID Spaces{name} 成功',
|
|
1396
1398
|
failed: '删除 DID Spaces 失败',
|
|
1397
|
-
failedForConnected: '无法删除一个已连接的 DID Spaces'
|
|
1399
|
+
failedForConnected: '无法删除一个已连接的 DID Spaces',
|
|
1400
|
+
failedForSelected: '无法删除一个已选中的 DID Spaces'
|
|
1398
1401
|
},
|
|
1399
1402
|
connect: {
|
|
1400
1403
|
title: '连接到 DID Spaces',
|
|
@@ -1427,11 +1430,15 @@ module.exports = {
|
|
|
1427
1430
|
now: '立即连接',
|
|
1428
1431
|
title: '使用 DID Wallet 连接',
|
|
1429
1432
|
provider: '提供您的 DID Spaces 开始备份',
|
|
1433
|
+
providerForStorage: '请连接您的 DID Spaces',
|
|
1430
1434
|
useWallet: '使用 DID Wallet 连接',
|
|
1435
|
+
useWalletReconnect: '使用 DID Wallet 重新连接',
|
|
1431
1436
|
useSpaceGateway: '使用 DID Spaces 网关连接',
|
|
1437
|
+
useSpaceGatewayReconnect: '使用 DID Spaces 网关重新连接',
|
|
1432
1438
|
switchToSpace: '切换至 Space',
|
|
1433
1439
|
switchToSpaceSucceeded: '已切换至 Space{name}',
|
|
1434
|
-
succeeded: '你已成功连接至 DID Spaces'
|
|
1440
|
+
succeeded: '你已成功连接至 DID Spaces',
|
|
1441
|
+
disconnect: '断开连接'
|
|
1435
1442
|
},
|
|
1436
1443
|
disconnected: {
|
|
1437
1444
|
tag: '连接已断开',
|
package/lib/lost-passport.js
CHANGED
|
@@ -218,10 +218,10 @@ function LostPassport(_ref2) {
|
|
|
218
218
|
ownerDid: user.did,
|
|
219
219
|
ownerName: user.fullName,
|
|
220
220
|
ownerAvatarUrl: user.avatar,
|
|
221
|
-
isDataUrl: true,
|
|
222
221
|
preferredColor: passportColor || 'auto'
|
|
223
222
|
}),
|
|
224
|
-
name: x.title
|
|
223
|
+
name: x.title,
|
|
224
|
+
id: x.id
|
|
225
225
|
};
|
|
226
226
|
}),
|
|
227
227
|
onSelect: index => handleChange({
|
|
@@ -13,6 +13,7 @@ var _colorInput = _interopRequireDefault(require("./color-input"));
|
|
|
13
13
|
var _commonPropTypes = _interopRequireDefault(require("./common-prop-types"));
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
15
|
const _excluded = ["editing", "value", "onChange", "componentProps"];
|
|
16
|
+
/* eslint-disable react/no-danger */
|
|
16
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
18
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
18
19
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -36,21 +37,21 @@ function PassportInput(_ref) {
|
|
|
36
37
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
37
38
|
display: "flex",
|
|
38
39
|
alignItems: "center",
|
|
39
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("
|
|
40
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
40
41
|
style: {
|
|
41
42
|
width: 96,
|
|
42
43
|
marginRight: 12
|
|
43
44
|
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
45
|
+
dangerouslySetInnerHTML: {
|
|
46
|
+
__html: (0, _createPassportSvg.default)({
|
|
47
|
+
title: 'Owner',
|
|
48
|
+
issuer: (0, _util.getDisplayName)(blocklet),
|
|
49
|
+
issuerDid: blocklet.appDid,
|
|
50
|
+
ownerName: 'Your Name',
|
|
51
|
+
ownerDid: blocklet.appDid,
|
|
52
|
+
preferredColor: value || 'auto'
|
|
53
|
+
})
|
|
54
|
+
}
|
|
54
55
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_colorInput.default, _objectSpread(_objectSpread({}, rest), {}, {
|
|
55
56
|
editing: editing,
|
|
56
57
|
value: editing ? color : value,
|
|
@@ -27,7 +27,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
27
27
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
28
28
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
29
29
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
30
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
30
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /* eslint-disable react/no-danger */
|
|
31
31
|
function PassportColor(_ref) {
|
|
32
32
|
let {
|
|
33
33
|
onCancel,
|
|
@@ -96,21 +96,21 @@ function PassportColor(_ref) {
|
|
|
96
96
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactColor.ChromePicker, {
|
|
97
97
|
color: color,
|
|
98
98
|
onChange: c => setColor(c.hex)
|
|
99
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("
|
|
99
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
100
100
|
style: {
|
|
101
|
-
width:
|
|
102
|
-
marginLeft:
|
|
101
|
+
width: 220,
|
|
102
|
+
marginLeft: 24
|
|
103
103
|
},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
104
|
+
dangerouslySetInnerHTML: {
|
|
105
|
+
__html: (0, _createPassportSvg.default)({
|
|
106
|
+
title: 'Owner',
|
|
107
|
+
issuer: (0, _util.getDisplayName)(blocklet),
|
|
108
|
+
issuerDid: blocklet.appDid,
|
|
109
|
+
ownerName: 'Your Name',
|
|
110
|
+
ownerDid: blocklet.appDid,
|
|
111
|
+
preferredColor: color
|
|
112
|
+
})
|
|
113
|
+
}
|
|
114
114
|
})]
|
|
115
115
|
})
|
|
116
116
|
});
|
package/lib/util/spaces.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getBackupFilesUrlFromEndpoint = getBackupFilesUrlFromEndpoint;
|
|
7
7
|
exports.getDIDSpaceDidFromEndpoint = getDIDSpaceDidFromEndpoint;
|
|
8
|
+
exports.getDIDSpaceEndpoint = void 0;
|
|
8
9
|
exports.getDIDSpaceUrlFromEndpoint = getDIDSpaceUrlFromEndpoint;
|
|
9
10
|
exports.getSpaceBackupEndpoint = getSpaceBackupEndpoint;
|
|
10
11
|
exports.getSpaceGatewayFromEndpoint = getSpaceGatewayFromEndpoint;
|
|
@@ -163,4 +164,15 @@ function getSpaceNftDisplayUrlFromEndpoint(endpoint) {
|
|
|
163
164
|
const strArray = endpoint.replace(/\/$/, '').split('/');
|
|
164
165
|
const spaceDid = strArray.at(-4);
|
|
165
166
|
return joinUrl(prefix, "/api/space/nft/display?spaceDid=".concat(spaceDid));
|
|
166
|
-
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* @description
|
|
171
|
+
* @param {import('@abtnode/client').BlockletState} blocklet
|
|
172
|
+
* @return {string}
|
|
173
|
+
*/
|
|
174
|
+
const getDIDSpaceEndpoint = blocklet => {
|
|
175
|
+
var _blocklet$configs, _blocklet$configs$fin;
|
|
176
|
+
return (blocklet === null || blocklet === void 0 ? void 0 : (_blocklet$configs = blocklet.configs) === null || _blocklet$configs === void 0 ? void 0 : (_blocklet$configs$fin = _blocklet$configs.find(item => item.key === _constant.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)) === null || _blocklet$configs$fin === void 0 ? void 0 : _blocklet$configs$fin.value) || null;
|
|
177
|
+
};
|
|
178
|
+
exports.getDIDSpaceEndpoint = getDIDSpaceEndpoint;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/ux",
|
|
3
|
-
"version": "1.16.14-beta-
|
|
3
|
+
"version": "1.16.14-beta-963cb583",
|
|
4
4
|
"description": "UX components shared across abtnode packages",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"build:lib": "babel src --out-dir lib --copy-files",
|
|
20
20
|
"build:es": "babel --config-file ./babel.config.es.js src --out-dir es --copy-files",
|
|
21
21
|
"autoexports": "node tools/auto-exports.js",
|
|
22
|
-
"watch": "
|
|
22
|
+
"watch": "npm run build:es -- -w",
|
|
23
23
|
"coverage": "npm run test -- --coverage",
|
|
24
24
|
"test": "node tools/jest.js"
|
|
25
25
|
},
|
|
@@ -27,23 +27,23 @@
|
|
|
27
27
|
"author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
|
|
28
28
|
"license": "Apache-2.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@abtnode/auth": "1.16.14-beta-
|
|
31
|
-
"@abtnode/constant": "1.16.14-beta-
|
|
32
|
-
"@abtnode/util": "1.16.14-beta-
|
|
30
|
+
"@abtnode/auth": "1.16.14-beta-963cb583",
|
|
31
|
+
"@abtnode/constant": "1.16.14-beta-963cb583",
|
|
32
|
+
"@abtnode/util": "1.16.14-beta-963cb583",
|
|
33
33
|
"@ahooksjs/use-url-state": "^3.5.1",
|
|
34
|
-
"@arcblock/did": "^1.18.
|
|
35
|
-
"@arcblock/did-connect": "^2.7.
|
|
34
|
+
"@arcblock/did": "^1.18.89",
|
|
35
|
+
"@arcblock/did-connect": "^2.7.5",
|
|
36
36
|
"@arcblock/did-motif": "^1.1.13",
|
|
37
|
-
"@arcblock/icons": "^2.7.
|
|
38
|
-
"@arcblock/nft-display": "2.7.
|
|
39
|
-
"@arcblock/react-hooks": "^2.7.
|
|
40
|
-
"@arcblock/terminal": "^2.7.
|
|
41
|
-
"@arcblock/ux": "^2.7.
|
|
42
|
-
"@blocklet/constant": "1.16.14-beta-
|
|
43
|
-
"@blocklet/launcher-layout": "2.1.
|
|
37
|
+
"@arcblock/icons": "^2.7.5",
|
|
38
|
+
"@arcblock/nft-display": "2.7.5",
|
|
39
|
+
"@arcblock/react-hooks": "^2.7.5",
|
|
40
|
+
"@arcblock/terminal": "^2.7.5",
|
|
41
|
+
"@arcblock/ux": "^2.7.5",
|
|
42
|
+
"@blocklet/constant": "1.16.14-beta-963cb583",
|
|
43
|
+
"@blocklet/launcher-layout": "2.1.90",
|
|
44
44
|
"@blocklet/list": "^0.12.25",
|
|
45
|
-
"@blocklet/meta": "1.16.14-beta-
|
|
46
|
-
"@blocklet/ui-react": "^2.7.
|
|
45
|
+
"@blocklet/meta": "1.16.14-beta-963cb583",
|
|
46
|
+
"@blocklet/ui-react": "^2.7.5",
|
|
47
47
|
"@emotion/react": "^11.10.4",
|
|
48
48
|
"@emotion/styled": "^11.10.4",
|
|
49
49
|
"@iconify/react": "^4.0.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@mui/material": "^5.10.8",
|
|
54
54
|
"@mui/styles": "^5.10.8",
|
|
55
55
|
"@mui/x-date-pickers": "^6.9.0",
|
|
56
|
-
"@ocap/client": "1.18.
|
|
56
|
+
"@ocap/client": "1.18.89",
|
|
57
57
|
"@uiw/react-markdown-preview": "4.0.6",
|
|
58
58
|
"ahooks": "^3.7.1",
|
|
59
59
|
"axios": "^0.27.2",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"babel-plugin-inline-react-svg": "^1.1.2",
|
|
99
99
|
"glob": "^10.3.3"
|
|
100
100
|
},
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "82bae80cd584a096719d6985740e13f15b4f46bf",
|
|
102
102
|
"exports": {
|
|
103
103
|
".": {
|
|
104
104
|
"import": "./es/index.js",
|
|
@@ -116,6 +116,10 @@
|
|
|
116
116
|
"import": "./es/blocklet/component/index.js",
|
|
117
117
|
"require": "./lib/blocklet/component/index.js"
|
|
118
118
|
},
|
|
119
|
+
"./lib/blocklet/component/selected": {
|
|
120
|
+
"import": "./es/blocklet/component/selected/index.js",
|
|
121
|
+
"require": "./lib/blocklet/component/selected/index.js"
|
|
122
|
+
},
|
|
119
123
|
"./lib/blocklet/notification": {
|
|
120
124
|
"import": "./es/blocklet/notification/index.js",
|
|
121
125
|
"require": "./lib/blocklet/notification/index.js"
|