@abtnode/ux 1.16.18-beta-7aa6be5a → 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/component/add-component-core.js +1317 -0
- package/es/blocklet/component/add.js +14 -1246
- package/es/blocklet/component/select-store.js +21 -7
- package/es/blocklet/component/store-blocklet-list.js +20 -6
- 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-project.js +6 -2
- package/es/blocklet/publish/create-release.js +5 -4
- package/es/blocklet/publish/index.js +26 -2
- package/es/blocklet/publish/project-list.js +6 -2
- package/es/hooks/use-navigation.js +1 -1
- package/es/hooks/use-passport-id.js +9 -6
- package/es/locales/en.js +26 -5
- package/es/locales/zh.js +22 -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/component/add-component-core.js +1131 -0
- package/lib/blocklet/component/add.js +18 -1058
- package/lib/blocklet/component/select-store.js +25 -7
- package/lib/blocklet/component/store-blocklet-list.js +22 -8
- 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-project.js +5 -1
- package/lib/blocklet/publish/create-release.js +5 -4
- package/lib/blocklet/publish/index.js +27 -1
- package/lib/blocklet/publish/project-list.js +5 -1
- package/lib/hooks/use-navigation.js +1 -1
- package/lib/hooks/use-passport-id.js +9 -7
- package/lib/locales/en.js +26 -5
- package/lib/locales/zh.js +22 -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 +20 -20
package/lib/locales/en.js
CHANGED
|
@@ -83,6 +83,7 @@ module.exports = {
|
|
|
83
83
|
instances: 'Number of instances'
|
|
84
84
|
},
|
|
85
85
|
common: {
|
|
86
|
+
invalid: 'Invalid',
|
|
86
87
|
about: 'About',
|
|
87
88
|
access: 'Access',
|
|
88
89
|
accessKey: 'Access Keys',
|
|
@@ -102,6 +103,7 @@ module.exports = {
|
|
|
102
103
|
back: 'Back',
|
|
103
104
|
basic: 'Basic',
|
|
104
105
|
basicInfo: 'Basic Information',
|
|
106
|
+
profile: 'Profile',
|
|
105
107
|
bind: 'Bind',
|
|
106
108
|
blocklet: 'Blocklet',
|
|
107
109
|
blocklets: 'Blocklets',
|
|
@@ -155,6 +157,7 @@ module.exports = {
|
|
|
155
157
|
downloading: 'Downloading',
|
|
156
158
|
edit: 'Edit',
|
|
157
159
|
email: 'Email',
|
|
160
|
+
phone: 'Phone',
|
|
158
161
|
empty: 'Empty',
|
|
159
162
|
emptyData: 'No results found',
|
|
160
163
|
enable: 'Enable',
|
|
@@ -396,9 +399,9 @@ module.exports = {
|
|
|
396
399
|
securityError: 'SecurityError: Can not open the admin url from accessing a cross-origin frame'
|
|
397
400
|
},
|
|
398
401
|
config: {
|
|
399
|
-
name: '
|
|
400
|
-
description: '
|
|
401
|
-
sk: 'Secret key for the
|
|
402
|
+
name: 'App Name',
|
|
403
|
+
description: 'App Description',
|
|
404
|
+
sk: 'Secret key for the app wallet',
|
|
402
405
|
logoSquare: 'App Logo',
|
|
403
406
|
logoRect: 'Rect logo',
|
|
404
407
|
logoRectDesc: 'Usually displayed at the top of the page, default to app logo',
|
|
@@ -419,7 +422,7 @@ module.exports = {
|
|
|
419
422
|
languages: 'Supported Languages',
|
|
420
423
|
selectLanguagesTip: 'Adjust the order by removing and re-adding',
|
|
421
424
|
passportColor: 'Passport Color',
|
|
422
|
-
appUrl: '
|
|
425
|
+
appUrl: 'App URL',
|
|
423
426
|
access: {
|
|
424
427
|
title: 'Who Can Access',
|
|
425
428
|
description: 'Who can access the blocklet',
|
|
@@ -570,6 +573,7 @@ module.exports = {
|
|
|
570
573
|
fromUrl: 'Add Component From Url'
|
|
571
574
|
},
|
|
572
575
|
addNext: 'Add {name}',
|
|
576
|
+
upgradeNext: 'Upgrade {name}',
|
|
573
577
|
setting: 'Settings'
|
|
574
578
|
},
|
|
575
579
|
router: {
|
|
@@ -1108,7 +1112,24 @@ module.exports = {
|
|
|
1108
1112
|
passportEmpty: 'Passport should not be empty'
|
|
1109
1113
|
},
|
|
1110
1114
|
connectedAccounts: 'Connected Accounts',
|
|
1111
|
-
|
|
1115
|
+
connections: 'Connections',
|
|
1116
|
+
federated: 'Federated',
|
|
1117
|
+
switch: {
|
|
1118
|
+
did: 'Switch DID',
|
|
1119
|
+
profile: 'Switch Profile',
|
|
1120
|
+
passport: 'Switch Passport'
|
|
1121
|
+
},
|
|
1122
|
+
settings: {
|
|
1123
|
+
notification: 'Notifications',
|
|
1124
|
+
email: 'Send email to me when some events happen',
|
|
1125
|
+
wallet: 'Send notification to my wallet when some events happen',
|
|
1126
|
+
phone: 'Send text message to me when some events happen',
|
|
1127
|
+
webhook: 'Webhooks',
|
|
1128
|
+
add: 'Add new webhook',
|
|
1129
|
+
url: 'Custom URL',
|
|
1130
|
+
slack: 'Slack Webhook',
|
|
1131
|
+
tested: 'Test message sent'
|
|
1132
|
+
}
|
|
1112
1133
|
},
|
|
1113
1134
|
transferNode: {
|
|
1114
1135
|
name: 'Transfer Ownership',
|
package/lib/locales/zh.js
CHANGED
|
@@ -86,6 +86,7 @@ module.exports = {
|
|
|
86
86
|
instances: '实例数'
|
|
87
87
|
},
|
|
88
88
|
common: {
|
|
89
|
+
invalid: '无效',
|
|
89
90
|
about: '关于',
|
|
90
91
|
access: '访问',
|
|
91
92
|
accessKey: '访问秘钥',
|
|
@@ -105,6 +106,7 @@ module.exports = {
|
|
|
105
106
|
back: '返回',
|
|
106
107
|
basic: '基础',
|
|
107
108
|
basicInfo: '基础信息',
|
|
109
|
+
profile: '信息',
|
|
108
110
|
bind: '绑定',
|
|
109
111
|
blocklet: '基石程序',
|
|
110
112
|
blocklets: '基石程序',
|
|
@@ -159,6 +161,7 @@ module.exports = {
|
|
|
159
161
|
downloading: '下载中',
|
|
160
162
|
edit: '编辑',
|
|
161
163
|
email: '邮箱',
|
|
164
|
+
phone: '电话',
|
|
162
165
|
empty: '暂无',
|
|
163
166
|
emptyData: '未找到结果',
|
|
164
167
|
enable: '启用',
|
|
@@ -577,6 +580,7 @@ module.exports = {
|
|
|
577
580
|
fromUrl: '通过 URL 选择组件'
|
|
578
581
|
},
|
|
579
582
|
addNext: '添加 {name}',
|
|
583
|
+
upgradeNext: '升级 {name}',
|
|
580
584
|
setting: '参数设置'
|
|
581
585
|
},
|
|
582
586
|
router: {
|
|
@@ -1111,7 +1115,24 @@ module.exports = {
|
|
|
1111
1115
|
passportEmpty: '通行证不能为空'
|
|
1112
1116
|
},
|
|
1113
1117
|
connectedAccounts: '已连接账号',
|
|
1114
|
-
|
|
1118
|
+
connections: '账号绑定',
|
|
1119
|
+
federated: '统一登录',
|
|
1120
|
+
switch: {
|
|
1121
|
+
did: '添加账户',
|
|
1122
|
+
profile: '更新身份',
|
|
1123
|
+
passport: '切换通行证'
|
|
1124
|
+
},
|
|
1125
|
+
settings: {
|
|
1126
|
+
notification: '通知设置',
|
|
1127
|
+
email: '当有动态时给我发送邮件',
|
|
1128
|
+
wallet: '当有动态时给我发送钱包通知',
|
|
1129
|
+
phone: '当有动态时给我发送短信',
|
|
1130
|
+
webhook: '外部钩子',
|
|
1131
|
+
add: '添加新钩子',
|
|
1132
|
+
url: '自定义 URL',
|
|
1133
|
+
slack: 'Slack 通知',
|
|
1134
|
+
tested: '测试消息已经发送'
|
|
1135
|
+
}
|
|
1115
1136
|
},
|
|
1116
1137
|
transferNode: {
|
|
1117
1138
|
name: '转移所有者',
|
package/lib/logs/log-terminal.js
CHANGED
|
@@ -52,7 +52,8 @@ function LogTerminalGroup(_ref) {
|
|
|
52
52
|
error: 'Error',
|
|
53
53
|
access: 'Access',
|
|
54
54
|
stdout: 'stdout',
|
|
55
|
-
stderr: 'stderr'
|
|
55
|
+
stderr: 'stderr',
|
|
56
|
+
pm2: 'PM2'
|
|
56
57
|
};
|
|
57
58
|
const isMobile = (0, _useMediaQuery.default)(theme => theme.breakpoints.down('md'));
|
|
58
59
|
const [currentType, setCurrentType] = (0, _react.useState)(types[defaultTypeIndex || 0]);
|
package/lib/schema-form/index.js
CHANGED
|
@@ -18,6 +18,7 @@ var _textInput = _interopRequireDefault(require("./text-input"));
|
|
|
18
18
|
var _passportInput = _interopRequireDefault(require("./passport-input"));
|
|
19
19
|
var _required = _interopRequireDefault(require("../form/required"));
|
|
20
20
|
var _formWrapper = _interopRequireDefault(require("../form/form-wrapper"));
|
|
21
|
+
var _logoUploader = _interopRequireDefault(require("../blocklet/logo-uploader"));
|
|
21
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
23
|
var _templateObject;
|
|
23
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -48,7 +49,8 @@ function getComponent(item, _ref) {
|
|
|
48
49
|
const componentMap = {
|
|
49
50
|
input: _textInput.default,
|
|
50
51
|
color: _colorInput.default,
|
|
51
|
-
passport: _passportInput.default
|
|
52
|
+
passport: _passportInput.default,
|
|
53
|
+
uploader: props => /*#__PURE__*/(0, _jsxRuntime.jsx)(_logoUploader.default, _objectSpread({}, props.componentProps))
|
|
52
54
|
};
|
|
53
55
|
return componentMap[componentType === null || componentType === void 0 ? void 0 : componentType.toLowerCase()];
|
|
54
56
|
}
|
|
@@ -132,6 +134,7 @@ function SchemaForm(_ref2) {
|
|
|
132
134
|
key,
|
|
133
135
|
description,
|
|
134
136
|
required,
|
|
137
|
+
solo = false,
|
|
135
138
|
hidden = false,
|
|
136
139
|
componentProps = {}
|
|
137
140
|
} = x;
|
|
@@ -162,7 +165,7 @@ function SchemaForm(_ref2) {
|
|
|
162
165
|
};
|
|
163
166
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
164
167
|
className: "form-item",
|
|
165
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
168
|
+
children: [!solo && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
166
169
|
className: "form-item-label",
|
|
167
170
|
style: {
|
|
168
171
|
color: required && !currentValue ? '#ff0000' : '#333'
|
|
@@ -172,8 +175,11 @@ function SchemaForm(_ref2) {
|
|
|
172
175
|
className: "form-item-body",
|
|
173
176
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
174
177
|
className: "form-item-input",
|
|
178
|
+
sx: {
|
|
179
|
+
textAlign: solo ? 'center' : 'left'
|
|
180
|
+
},
|
|
175
181
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(CurrentComponent, _objectSpread({}, renderComponentProps))
|
|
176
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
182
|
+
}), !solo && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
177
183
|
className: "form-item-action",
|
|
178
184
|
children: editing ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
179
185
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = UserConnections;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _InfoRow = _interopRequireDefault(require("@arcblock/ux/lib/InfoRow"));
|
|
10
|
+
var _didAddress = _interopRequireDefault(require("../../did-address"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function UserConnections(_ref) {
|
|
14
|
+
let {
|
|
15
|
+
user
|
|
16
|
+
} = _ref;
|
|
17
|
+
const connectedAccounts = user.connectedAccounts || [];
|
|
18
|
+
return connectedAccounts.map(account => {
|
|
19
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InfoRow.default, {
|
|
20
|
+
style: {
|
|
21
|
+
alignItems: 'flex-start'
|
|
22
|
+
},
|
|
23
|
+
valueComponent: "div",
|
|
24
|
+
nameWidth: 120,
|
|
25
|
+
name: account.provider,
|
|
26
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_didAddress.default, {
|
|
27
|
+
did: account.did
|
|
28
|
+
})
|
|
29
|
+
}, account.did);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
UserConnections.propTypes = {
|
|
33
|
+
user: _propTypes.default.object.isRequired
|
|
34
|
+
};
|
|
35
|
+
UserConnections.defaultProps = {};
|
|
@@ -31,6 +31,7 @@ var _passportIssuances = _interopRequireDefault(require("./passport-issuances"))
|
|
|
31
31
|
var _passports = _interopRequireDefault(require("./passports"));
|
|
32
32
|
var _toggleUserApproval = _interopRequireDefault(require("./toggle-user-approval"));
|
|
33
33
|
var _util2 = require("./util");
|
|
34
|
+
var _connections = _interopRequireDefault(require("./connections"));
|
|
34
35
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
35
36
|
var _templateObject, _templateObject2, _templateObject3;
|
|
36
37
|
const _excluded = ["name"];
|
|
@@ -63,40 +64,14 @@ function LinkUser(_ref) {
|
|
|
63
64
|
LinkUser.propTypes = {
|
|
64
65
|
name: _propTypes.default.string.isRequired
|
|
65
66
|
};
|
|
66
|
-
function TabOAuth(_ref2) {
|
|
67
|
-
let {
|
|
68
|
-
user
|
|
69
|
-
} = _ref2;
|
|
70
|
-
const connectedAccounts = user.connectedAccounts || [];
|
|
71
|
-
return connectedAccounts.map(account => {
|
|
72
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InfoRow.default, {
|
|
73
|
-
style: {
|
|
74
|
-
alignItems: 'flex-start'
|
|
75
|
-
},
|
|
76
|
-
valueComponent: "div",
|
|
77
|
-
nameWidth: 120,
|
|
78
|
-
name: account.provider,
|
|
79
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_didAddress.default, {
|
|
80
|
-
did: account.did
|
|
81
|
-
})
|
|
82
|
-
}, account.did);
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
TabOAuth.propTypes = {
|
|
86
|
-
user: _propTypes.default.object.isRequired,
|
|
87
|
-
onChangeUser: _propTypes.default.func
|
|
88
|
-
};
|
|
89
|
-
TabOAuth.defaultProps = {
|
|
90
|
-
onChangeUser: () => {}
|
|
91
|
-
};
|
|
92
67
|
const defaultTab = 'info';
|
|
93
|
-
function Member(
|
|
68
|
+
function Member(_ref2) {
|
|
94
69
|
let {
|
|
95
70
|
userDid,
|
|
96
71
|
onCancel,
|
|
97
72
|
initTab,
|
|
98
73
|
createPassportSvg
|
|
99
|
-
} =
|
|
74
|
+
} = _ref2;
|
|
100
75
|
const {
|
|
101
76
|
api,
|
|
102
77
|
ws: {
|
|
@@ -251,7 +226,7 @@ function Member(_ref3) {
|
|
|
251
226
|
oauth: {
|
|
252
227
|
label: t('team.member.connectedAccounts'),
|
|
253
228
|
value: 'oauth',
|
|
254
|
-
component: () => /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
229
|
+
component: () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_connections.default, {
|
|
255
230
|
user: pageState.user,
|
|
256
231
|
onChangeUser: handleChangeUser
|
|
257
232
|
})
|
|
@@ -288,11 +263,11 @@ function Member(_ref3) {
|
|
|
288
263
|
})
|
|
289
264
|
}
|
|
290
265
|
};
|
|
291
|
-
const tabs = Object.values(tabConfigs).map(
|
|
266
|
+
const tabs = Object.values(tabConfigs).map(_ref3 => {
|
|
292
267
|
let {
|
|
293
268
|
label,
|
|
294
269
|
value
|
|
295
|
-
} =
|
|
270
|
+
} = _ref3;
|
|
296
271
|
return {
|
|
297
272
|
label,
|
|
298
273
|
value
|
|
@@ -331,10 +306,10 @@ function Member(_ref3) {
|
|
|
331
306
|
role: inService ? _util.BlockletAdminRoles : [],
|
|
332
307
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_toggleUserApproval.default, {
|
|
333
308
|
user: pageState.user,
|
|
334
|
-
children:
|
|
309
|
+
children: _ref4 => {
|
|
335
310
|
let {
|
|
336
311
|
open
|
|
337
|
-
} =
|
|
312
|
+
} = _ref4;
|
|
338
313
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(BlockButton, {
|
|
339
314
|
onClick: open,
|
|
340
315
|
children: [pageState.user.approved ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ForbidLoginIcon.default, {
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = PassportItem;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
10
|
+
var _upperFirst = _interopRequireDefault(require("lodash/upperFirst"));
|
|
11
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
12
|
+
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
13
|
+
var _RevokeIcon = _interopRequireDefault(require("@arcblock/icons/lib/RevokeIcon"));
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
var _templateObject;
|
|
16
|
+
const _excluded = ["passport", "user", "color", "width", "icon", "children", "createPassportSvg"];
|
|
17
|
+
/* eslint-disable prettier/prettier */
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
20
|
+
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; }
|
|
21
|
+
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; }
|
|
22
|
+
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; }
|
|
23
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
24
|
+
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); }
|
|
25
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
26
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
27
|
+
function PassportItem(_ref) {
|
|
28
|
+
let {
|
|
29
|
+
passport,
|
|
30
|
+
user,
|
|
31
|
+
color,
|
|
32
|
+
width,
|
|
33
|
+
icon,
|
|
34
|
+
children,
|
|
35
|
+
createPassportSvg
|
|
36
|
+
} = _ref,
|
|
37
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
38
|
+
const {
|
|
39
|
+
t
|
|
40
|
+
} = (0, _context.useLocaleContext)();
|
|
41
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Root, _objectSpread(_objectSpread({
|
|
42
|
+
display: "flex",
|
|
43
|
+
alignItems: "center"
|
|
44
|
+
}, rest), {}, {
|
|
45
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
46
|
+
// eslint-disable-next-line react/no-danger
|
|
47
|
+
dangerouslySetInnerHTML: {
|
|
48
|
+
__html: createPassportSvg({
|
|
49
|
+
title: passport.title || passport.name,
|
|
50
|
+
issuer: passport.issuer && passport.issuer.name,
|
|
51
|
+
issuerDid: passport.issuer && passport.issuer.id,
|
|
52
|
+
ownerName: user.fullName,
|
|
53
|
+
ownerDid: user.did,
|
|
54
|
+
ownerAvatarUrl: user.avatar,
|
|
55
|
+
revoked: passport.revoked,
|
|
56
|
+
preferredColor: color,
|
|
57
|
+
width
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
61
|
+
className: "body",
|
|
62
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
63
|
+
className: "title",
|
|
64
|
+
display: "flex",
|
|
65
|
+
alignItems: "center",
|
|
66
|
+
children: [(0, _upperFirst.default)(passport.title), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
67
|
+
className: "status-icons",
|
|
68
|
+
children: [icon, passport.revoked && /*#__PURE__*/(0, _jsxRuntime.jsx)(_RevokeIcon.default, {})]
|
|
69
|
+
})]
|
|
70
|
+
}), passport.expirationDate && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
71
|
+
className: "title",
|
|
72
|
+
display: "flex",
|
|
73
|
+
alignItems: "center",
|
|
74
|
+
children: t('team.passport.validUntil', {
|
|
75
|
+
date: passport.expirationDate
|
|
76
|
+
})
|
|
77
|
+
}), children]
|
|
78
|
+
})]
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
PassportItem.propTypes = {
|
|
82
|
+
passport: _propTypes.default.any.isRequired,
|
|
83
|
+
user: _propTypes.default.any.isRequired,
|
|
84
|
+
color: _propTypes.default.string.isRequired,
|
|
85
|
+
createPassportSvg: _propTypes.default.func.isRequired,
|
|
86
|
+
icon: _propTypes.default.any,
|
|
87
|
+
children: _propTypes.default.any,
|
|
88
|
+
width: _propTypes.default.number
|
|
89
|
+
};
|
|
90
|
+
PassportItem.defaultProps = {
|
|
91
|
+
icon: null,
|
|
92
|
+
children: null,
|
|
93
|
+
width: 150
|
|
94
|
+
};
|
|
95
|
+
const Root = (0, _styled.default)(_Box.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .body {\n padding: 0;\n margin-left: 24px;\n margin-top: 0;\n }\n .title {\n font-weight: 400;\n font-size: 16px;\n line-height: 19px;\n color: #222222;\n }\n .tip {\n display: flex;\n align-items: center;\n font-size: 14px;\n margin-top: 6px;\n color: #bbb;\n }\n .status-icons {\n svg {\n fill: #bfbfbf;\n height: 1.2em;\n margin-left: 0.4em;\n }\n }\n"])));
|
|
@@ -4,11 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = Passports;
|
|
7
|
-
var _react = require("react");
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
10
10
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
11
|
-
var _upperFirst = _interopRequireDefault(require("lodash/upperFirst"));
|
|
12
11
|
var _Toast = _interopRequireDefault(require("@arcblock/ux/lib/Toast"));
|
|
13
12
|
var _Add = _interopRequireDefault(require("@mui/icons-material/Add"));
|
|
14
13
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
@@ -31,9 +30,12 @@ var _permission = _interopRequireDefault(require("../../permission"));
|
|
|
31
30
|
var _searchInput = _interopRequireDefault(require("../search-input"));
|
|
32
31
|
var _listHeader = _interopRequireDefault(require("../styles/list-header"));
|
|
33
32
|
var _issuePassport = _interopRequireDefault(require("./issue-passport"));
|
|
33
|
+
var _passportItem = _interopRequireDefault(require("./passport-item"));
|
|
34
34
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
35
35
|
var _templateObject;
|
|
36
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
38
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
39
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
38
40
|
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; }
|
|
39
41
|
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; }
|
|
@@ -224,60 +226,30 @@ function Passports(_ref2) {
|
|
|
224
226
|
justifyContent: "space-between",
|
|
225
227
|
alignItems: "center",
|
|
226
228
|
mt: 3,
|
|
227
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
229
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_passportItem.default, {
|
|
230
|
+
passport: x,
|
|
231
|
+
user: user,
|
|
232
|
+
color: passportColor,
|
|
233
|
+
createPassportSvg: createPassportSvg,
|
|
234
|
+
icon: !!appIdList.length && !appIdList.includes(x.issuer.id) ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExternalIssuerIcon.default, {}) : null,
|
|
235
|
+
children: !!appIdList.length && !appIdList.includes(x.issuer.id) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
236
|
+
className: "tip",
|
|
237
|
+
children: [x.issuer.id !== teamIssuerDid && !trustedPassports.some(y => y.issuerDid === x.issuer.id) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
238
|
+
title: t('team.passport.notTrustedIssuerTip'),
|
|
239
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
240
|
+
component: _ErrorOutline.default,
|
|
241
|
+
style: {
|
|
242
|
+
fontSize: '1.3em'
|
|
243
|
+
},
|
|
244
|
+
color: "error.main",
|
|
245
|
+
mr: 0.5
|
|
243
246
|
})
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
248
|
-
className: "title",
|
|
249
|
-
display: "flex",
|
|
250
|
-
alignItems: "center",
|
|
251
|
-
children: [(0, _upperFirst.default)(x.title), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
252
|
-
className: "status-icons",
|
|
253
|
-
children: [!!appIdList.length && !appIdList.includes(x.issuer.id) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExternalIssuerIcon.default, {}), x.revoked && /*#__PURE__*/(0, _jsxRuntime.jsx)(_RevokeIcon.default, {})]
|
|
254
|
-
})]
|
|
255
|
-
}), x.expirationDate && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
256
|
-
className: "title",
|
|
257
|
-
display: "flex",
|
|
258
|
-
alignItems: "center",
|
|
259
|
-
children: t('team.passport.validUntil', {
|
|
260
|
-
date: x.expirationDate
|
|
247
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
248
|
+
children: t('team.passport.issueBy', {
|
|
249
|
+
name: x.issuer.name
|
|
261
250
|
})
|
|
262
|
-
}), !!appIdList.length && !appIdList.includes(x.issuer.id) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
263
|
-
className: "tip",
|
|
264
|
-
children: [x.issuer.id !== teamIssuerDid && !trustedPassports.some(y => y.issuerDid === x.issuer.id) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
265
|
-
title: t('team.passport.notTrustedIssuerTip'),
|
|
266
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
267
|
-
component: _ErrorOutline.default,
|
|
268
|
-
style: {
|
|
269
|
-
fontSize: '1.3em'
|
|
270
|
-
},
|
|
271
|
-
color: "error.main",
|
|
272
|
-
mr: 0.5
|
|
273
|
-
})
|
|
274
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
275
|
-
children: t('team.passport.issueBy', {
|
|
276
|
-
name: x.issuer.name
|
|
277
|
-
})
|
|
278
|
-
})]
|
|
279
251
|
})]
|
|
280
|
-
})
|
|
252
|
+
})
|
|
281
253
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
282
254
|
children: revokeInfo(can, x).revokable ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Button.default, {
|
|
283
255
|
variant: "outlined",
|
|
@@ -338,4 +310,4 @@ Passports.propTypes = {
|
|
|
338
310
|
Passports.defaultProps = {
|
|
339
311
|
onCreate: () => {}
|
|
340
312
|
};
|
|
341
|
-
const Div = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .passport-item {\n .
|
|
313
|
+
const Div = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .passport-item {\n .MuiButton-outlinedSecondary {\n color: #f16e6e;\n fill: #f16e6e;\n background: #fcf3f3;\n border: 0;\n &:hover {\n border: 0;\n }\n }\n }\n"])));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/ux",
|
|
3
|
-
"version": "1.16.18-beta-
|
|
3
|
+
"version": "1.16.18-beta-bb4ebacc",
|
|
4
4
|
"description": "UX components shared across abtnode packages",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -27,24 +27,24 @@
|
|
|
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.18-beta-
|
|
31
|
-
"@abtnode/constant": "1.16.18-beta-
|
|
32
|
-
"@abtnode/util": "1.16.18-beta-
|
|
30
|
+
"@abtnode/auth": "1.16.18-beta-bb4ebacc",
|
|
31
|
+
"@abtnode/constant": "1.16.18-beta-bb4ebacc",
|
|
32
|
+
"@abtnode/util": "1.16.18-beta-bb4ebacc",
|
|
33
33
|
"@ahooksjs/use-url-state": "^3.5.1",
|
|
34
|
-
"@arcblock/did": "^1.18.
|
|
35
|
-
"@arcblock/did-connect": "^2.8.
|
|
34
|
+
"@arcblock/did": "^1.18.95",
|
|
35
|
+
"@arcblock/did-connect": "^2.8.11",
|
|
36
36
|
"@arcblock/did-motif": "^1.1.13",
|
|
37
|
-
"@arcblock/icons": "^2.8.
|
|
38
|
-
"@arcblock/nft-display": "2.8.
|
|
39
|
-
"@arcblock/react-hooks": "^2.8.
|
|
40
|
-
"@arcblock/terminal": "^2.8.
|
|
41
|
-
"@arcblock/ux": "^2.8.
|
|
42
|
-
"@blocklet/constant": "1.16.18-beta-
|
|
43
|
-
"@blocklet/launcher-layout": "2.2.
|
|
44
|
-
"@blocklet/list": "^0.12.
|
|
45
|
-
"@blocklet/meta": "1.16.18-beta-
|
|
46
|
-
"@blocklet/ui-react": "^2.8.
|
|
47
|
-
"@blocklet/uploader": "^0.0.
|
|
37
|
+
"@arcblock/icons": "^2.8.11",
|
|
38
|
+
"@arcblock/nft-display": "2.8.11",
|
|
39
|
+
"@arcblock/react-hooks": "^2.8.11",
|
|
40
|
+
"@arcblock/terminal": "^2.8.11",
|
|
41
|
+
"@arcblock/ux": "^2.8.11",
|
|
42
|
+
"@blocklet/constant": "1.16.18-beta-bb4ebacc",
|
|
43
|
+
"@blocklet/launcher-layout": "2.2.28",
|
|
44
|
+
"@blocklet/list": "^0.12.51",
|
|
45
|
+
"@blocklet/meta": "1.16.18-beta-bb4ebacc",
|
|
46
|
+
"@blocklet/ui-react": "^2.8.11",
|
|
47
|
+
"@blocklet/uploader": "^0.0.35",
|
|
48
48
|
"@emotion/react": "^11.10.4",
|
|
49
49
|
"@emotion/styled": "^11.10.4",
|
|
50
50
|
"@iconify/react": "^4.0.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@mui/material": "^5.14.10",
|
|
55
55
|
"@mui/styles": "^5.14.10",
|
|
56
56
|
"@mui/x-date-pickers": "^6.14.0",
|
|
57
|
-
"@ocap/client": "1.18.
|
|
57
|
+
"@ocap/client": "1.18.95",
|
|
58
58
|
"@uiw/react-markdown-preview": "4.0.6",
|
|
59
59
|
"ahooks": "^3.7.1",
|
|
60
60
|
"axios": "^0.27.2",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"react-dnd": "11.1.3",
|
|
80
80
|
"react-dnd-html5-backend": "11.1.3",
|
|
81
81
|
"react-error-boundary": "^3.1.4",
|
|
82
|
-
"react-hook-form": "^7.
|
|
82
|
+
"react-hook-form": "^7.48.2",
|
|
83
83
|
"react-iframe": "^1.8.5",
|
|
84
84
|
"react-placeholder": "^4.1.0",
|
|
85
85
|
"react-router-dom": "^6.4.2",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"babel-plugin-inline-react-svg": "^1.1.2",
|
|
101
101
|
"glob": "^10.3.3"
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "aca7ff8eb508ecf586108b99a9e07ceab2a62430",
|
|
104
104
|
"exports": {
|
|
105
105
|
".": {
|
|
106
106
|
"import": "./es/index.js",
|