@abtnode/ux 1.8.1 → 1.8.4
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/invitation/invitation-receive.js +1 -1
- package/lib/locales/en.js +43 -5
- package/lib/locales/index.js +4 -2
- package/lib/locales/zh.js +45 -6
- package/lib/schema-form/color-input.js +3 -8
- package/lib/schema-form/index.js +19 -9
- package/lib/who-can-access/config.js +52 -0
- package/package.json +9 -8
|
@@ -112,7 +112,7 @@ InvitationReceive.defaultProps = {
|
|
|
112
112
|
onReceive: null
|
|
113
113
|
};
|
|
114
114
|
|
|
115
|
-
const Root = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n text-align: center;\n .invite-receive__logo-wrapper {\n display: inline-flex;\n align-items: center;\n color: #9397a1;\n font-size: 14px;\n }\n .invite-receive__logo {\n height: 16px;\n margin-left: 8px;\n }\n .invite-receive__button {\n width: 100%;\n margin: 16px 0;\n }\n .invite-receive__until {\n text-align: center;\n font-size: 14px;\n }\n .invite-receive__description {\n color: #999;\n text-align: left;\n list-style: decimal;\n padding: 0;\n padding-left: 1.2em;\n margin: 40px 0;\n }\n .invite-receive__description-item {\n list-style: decimal;\n }\n .invite-receive__link {\n color: ", ";\n }\n"])), _ref2 => {
|
|
115
|
+
const Root = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n text-align: center;\n .invite-receive__logo-wrapper {\n display: inline-flex;\n align-items: center;\n color: #9397a1;\n font-size: 14px;\n }\n .invite-receive__logo {\n height: 16px;\n margin-left: 8px;\n }\n .invite-receive__button {\n width: 100%;\n margin: 16px 0;\n white-space: nowrap;\n }\n .invite-receive__until {\n text-align: center;\n font-size: 14px;\n }\n .invite-receive__description {\n color: #999;\n text-align: left;\n list-style: decimal;\n padding: 0;\n padding-left: 1.2em;\n margin: 40px 0;\n }\n .invite-receive__description-item {\n list-style: decimal;\n }\n .invite-receive__link {\n color: ", ";\n }\n"])), _ref2 => {
|
|
116
116
|
let {
|
|
117
117
|
theme
|
|
118
118
|
} = _ref2;
|
package/lib/locales/en.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
const flat = require('flat');
|
|
5
|
-
|
|
6
|
-
module.exports = flat({
|
|
3
|
+
module.exports = {
|
|
7
4
|
issuePassport: {
|
|
8
5
|
title: 'Receive Passport',
|
|
9
6
|
description: 'Use DID Wallet to receive the passport issued by {name}',
|
|
@@ -50,5 +47,46 @@ module.exports = flat({
|
|
|
50
47
|
confirm: 'Confirm on your DID Wallet',
|
|
51
48
|
success: 'You are successfully connected'
|
|
52
49
|
}
|
|
50
|
+
},
|
|
51
|
+
blocklet: {
|
|
52
|
+
config: {
|
|
53
|
+
name: 'Blocklet Name',
|
|
54
|
+
description: 'Blocklet Nescription',
|
|
55
|
+
sk: 'Secret key for the blocklet wallet',
|
|
56
|
+
clusterSize: 'Instance count when run this blocklet in cluster mode',
|
|
57
|
+
deletable: {
|
|
58
|
+
name: 'Delete Protection',
|
|
59
|
+
enable: 'This blocklet can NOT currently be deleted',
|
|
60
|
+
disable: 'This blocklet can currently be deleted'
|
|
61
|
+
},
|
|
62
|
+
walletType: {
|
|
63
|
+
name: 'Wallet Type',
|
|
64
|
+
description: 'Blocklet instance wallet type, will change the derived DID'
|
|
65
|
+
},
|
|
66
|
+
passportColor: 'Passport Color',
|
|
67
|
+
appUrl: 'Blocklet URL',
|
|
68
|
+
access: {
|
|
69
|
+
title: 'Who Can Access',
|
|
70
|
+
description: 'Who can access the blocklet',
|
|
71
|
+
useDefault: 'Use default',
|
|
72
|
+
defaultDescription: "Use the application's default configuration",
|
|
73
|
+
whoCanAccess: {
|
|
74
|
+
all: {
|
|
75
|
+
title: 'Accessible to all',
|
|
76
|
+
description: 'Open to the world anyone can access without passport'
|
|
77
|
+
},
|
|
78
|
+
owner: {
|
|
79
|
+
title: 'Only me can access',
|
|
80
|
+
description: 'You must provide owner passport to access this application'
|
|
81
|
+
},
|
|
82
|
+
invited: {
|
|
83
|
+
title: 'Only invited people can access',
|
|
84
|
+
description: 'You can invite members later in the admin page'
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
publicToStore: 'Public On Store',
|
|
88
|
+
publicInstanceTip: 'The access address of this blocklet will be displayed in the Store (along with your DID for accepting donations)'
|
|
89
|
+
}
|
|
90
|
+
}
|
|
53
91
|
}
|
|
54
|
-
}
|
|
92
|
+
};
|
package/lib/locales/index.js
CHANGED
package/lib/locales/zh.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
const flat = require('flat');
|
|
5
|
-
|
|
6
|
-
module.exports = flat({
|
|
3
|
+
module.exports = {
|
|
7
4
|
issuePassport: {
|
|
8
5
|
title: '领取通行证',
|
|
9
6
|
description: '使用 DID 钱包领取 {name} 颁发的通行证',
|
|
@@ -37,7 +34,7 @@ module.exports = flat({
|
|
|
37
34
|
emptyPermission: '没有权限',
|
|
38
35
|
open: '打开',
|
|
39
36
|
description: {
|
|
40
|
-
step1: '
|
|
37
|
+
step1: '下载并设置好您的 {wallet}',
|
|
41
38
|
step2: '点击上面的按钮领取通行证',
|
|
42
39
|
step3: '使用通行证登录 {dapp}'
|
|
43
40
|
}
|
|
@@ -49,5 +46,47 @@ module.exports = flat({
|
|
|
49
46
|
confirm: '在您的 DID 钱包上确认',
|
|
50
47
|
success: '连接成功'
|
|
51
48
|
}
|
|
49
|
+
},
|
|
50
|
+
blocklet: {
|
|
51
|
+
config: {
|
|
52
|
+
name: '应用名称',
|
|
53
|
+
description: '应用描述',
|
|
54
|
+
sk: '应用账户私钥',
|
|
55
|
+
clusterSize: '以 Cluster 模式启动时的实例数量',
|
|
56
|
+
deletable: {
|
|
57
|
+
name: '删除保护',
|
|
58
|
+
enable: '此 Blocklet 当前不可被删除',
|
|
59
|
+
disable: '此 Blocklet 当前可以被删除'
|
|
60
|
+
},
|
|
61
|
+
walletType: {
|
|
62
|
+
name: '钱包类型',
|
|
63
|
+
description: '应用钱包类型,会影响派生出来的 DID'
|
|
64
|
+
},
|
|
65
|
+
passportColor: '通行证颜色',
|
|
66
|
+
appUrl: '应用访问地址',
|
|
67
|
+
access: {
|
|
68
|
+
title: '谁可以访问',
|
|
69
|
+
description: '谁可以访问应用',
|
|
70
|
+
useDefault: '使用该应用默认配置',
|
|
71
|
+
invitedTip: '稍后您可以在管理页面中邀请和管理成员',
|
|
72
|
+
defaultDescription: '使用应用的默认配置',
|
|
73
|
+
whoCanAccess: {
|
|
74
|
+
all: {
|
|
75
|
+
title: '所有人可访问',
|
|
76
|
+
description: '向所有人开放,无需通行证即可访问应用'
|
|
77
|
+
},
|
|
78
|
+
owner: {
|
|
79
|
+
title: '只有我自己可访问',
|
|
80
|
+
description: '必须提供所有者通行证才能访问应用'
|
|
81
|
+
},
|
|
82
|
+
invited: {
|
|
83
|
+
title: '只有被邀请的人可以访问',
|
|
84
|
+
description: '稍后您可以在管理页面中邀请成员'
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
publicToStore: '在 Store 公开',
|
|
88
|
+
publicInstanceTip: '此应用的访问地址将展示在 Store 中(同时也会展示你的 DID,用于接受捐赠)'
|
|
89
|
+
}
|
|
90
|
+
}
|
|
52
91
|
}
|
|
53
|
-
}
|
|
92
|
+
};
|
|
@@ -13,8 +13,6 @@ var _Popover = _interopRequireDefault(require("@mui/material/Popover"));
|
|
|
13
13
|
|
|
14
14
|
var _reactColor = require("react-color");
|
|
15
15
|
|
|
16
|
-
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
17
|
-
|
|
18
16
|
var _commonPropTypes = _interopRequireDefault(require("./common-prop-types"));
|
|
19
17
|
|
|
20
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -27,9 +25,6 @@ function ColorInput(_ref) {
|
|
|
27
25
|
value,
|
|
28
26
|
onChange
|
|
29
27
|
} = _ref;
|
|
30
|
-
const {
|
|
31
|
-
t
|
|
32
|
-
} = (0, _context.useLocaleContext)();
|
|
33
28
|
const [open, setOpen] = (0, _react.useState)(false);
|
|
34
29
|
const colorElm = (0, _react.useRef)();
|
|
35
30
|
const colorValue = (0, _react.useRef)(value); // auto open color picker when editing, should wait the useRef to be ready
|
|
@@ -81,11 +76,11 @@ function ColorInput(_ref) {
|
|
|
81
76
|
alignItems: "center",
|
|
82
77
|
height: "40px",
|
|
83
78
|
onKeyDown: handleEnterKeyDown,
|
|
84
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
79
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
85
80
|
display: "flex",
|
|
86
81
|
alignItems: "center",
|
|
87
82
|
onClick: () => setOpen(true),
|
|
88
|
-
children:
|
|
83
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
89
84
|
ref: colorElm,
|
|
90
85
|
style: {
|
|
91
86
|
flexShrink: 0,
|
|
@@ -98,7 +93,7 @@ function ColorInput(_ref) {
|
|
|
98
93
|
border: '1px solid #eee',
|
|
99
94
|
cursor: value === 'auto' ? 'default' : 'pointer'
|
|
100
95
|
}
|
|
101
|
-
})
|
|
96
|
+
})
|
|
102
97
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Popover.default, {
|
|
103
98
|
open: open,
|
|
104
99
|
anchorEl: colorElm.current,
|
package/lib/schema-form/index.js
CHANGED
|
@@ -79,7 +79,8 @@ function SchemaForm(_ref2) {
|
|
|
79
79
|
value,
|
|
80
80
|
defaultValue,
|
|
81
81
|
onChange,
|
|
82
|
-
style
|
|
82
|
+
style,
|
|
83
|
+
disabled
|
|
83
84
|
} = _ref2;
|
|
84
85
|
const isControlled = Object.prototype.toString.call(value) === '[object Object]';
|
|
85
86
|
const [editingItem, setEditingItem] = (0, _react.useState)(null);
|
|
@@ -88,7 +89,8 @@ function SchemaForm(_ref2) {
|
|
|
88
89
|
|
|
89
90
|
function onFormItemChange(item, changeValue, action) {
|
|
90
91
|
const {
|
|
91
|
-
key
|
|
92
|
+
key,
|
|
93
|
+
secure
|
|
92
94
|
} = item;
|
|
93
95
|
const oldValue = formValues[key];
|
|
94
96
|
const isChanged = oldValue !== changeValue;
|
|
@@ -107,7 +109,13 @@ function SchemaForm(_ref2) {
|
|
|
107
109
|
allValues: newValues,
|
|
108
110
|
action,
|
|
109
111
|
currentItem: item
|
|
110
|
-
});
|
|
112
|
+
}); // hide secure text after confirm
|
|
113
|
+
|
|
114
|
+
if (action === 'confirm' && secure) {
|
|
115
|
+
setFormValues(_objectSpread(_objectSpread({}, formValues), {}, {
|
|
116
|
+
[key]: '__encrypted__'
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
111
119
|
}
|
|
112
120
|
|
|
113
121
|
function onItemEditingStatusChange(item) {
|
|
@@ -198,7 +206,7 @@ function SchemaForm(_ref2) {
|
|
|
198
206
|
onFormItemChange(x, currentValue, 'confirm');
|
|
199
207
|
onItemEditingStatusChange(null);
|
|
200
208
|
},
|
|
201
|
-
disabled: loading,
|
|
209
|
+
disabled: disabled || loading,
|
|
202
210
|
size: "large",
|
|
203
211
|
children: loading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_CircularProgress.default, {
|
|
204
212
|
size: 24
|
|
@@ -209,7 +217,7 @@ function SchemaForm(_ref2) {
|
|
|
209
217
|
onFormItemChange(x, editingItemInitialValue.current, 'cancel');
|
|
210
218
|
onItemEditingStatusChange(null);
|
|
211
219
|
},
|
|
212
|
-
disabled: loading,
|
|
220
|
+
disabled: disabled || loading,
|
|
213
221
|
size: "large",
|
|
214
222
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Close.default, {})
|
|
215
223
|
})]
|
|
@@ -219,7 +227,7 @@ function SchemaForm(_ref2) {
|
|
|
219
227
|
onFormItemChange(x, formValues[key], 'edit');
|
|
220
228
|
onItemEditingStatusChange(x);
|
|
221
229
|
},
|
|
222
|
-
disabled: editingItem,
|
|
230
|
+
disabled: disabled || editingItem,
|
|
223
231
|
size: "large",
|
|
224
232
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_EditIcon.default, {})
|
|
225
233
|
})
|
|
@@ -236,12 +244,14 @@ SchemaForm.propTypes = {
|
|
|
236
244
|
onChange: _propTypes.default.func.isRequired,
|
|
237
245
|
value: _propTypes.default.object,
|
|
238
246
|
defaultValue: _propTypes.default.object,
|
|
239
|
-
style: _propTypes.default.object
|
|
247
|
+
style: _propTypes.default.object,
|
|
248
|
+
disabled: _propTypes.default.bool
|
|
240
249
|
};
|
|
241
250
|
SchemaForm.defaultProps = {
|
|
242
251
|
loading: false,
|
|
243
252
|
value: undefined,
|
|
244
253
|
defaultValue: {},
|
|
245
|
-
style: {}
|
|
254
|
+
style: {},
|
|
255
|
+
disabled: false
|
|
246
256
|
};
|
|
247
|
-
const FormWrapper = (0, _styled.default)(_Box.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 80%;\n flex-grow: 1;\n overflow-y: auto;\n ", " {\n width: 100%;\n flex-shrink: 0;\n padding: 0 24px;\n transform: translate(0, 0);\n max-height: 60vh
|
|
257
|
+
const FormWrapper = (0, _styled.default)(_Box.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 80%;\n flex-grow: 1;\n overflow-y: auto;\n ", " {\n width: 100%;\n flex-shrink: 0;\n padding: 0 24px;\n transform: translate(0, 0);\n /* max-height: 60vh; */\n }\n\n .form-item {\n width: 100%;\n margin-bottom: 24px;\n position: relative;\n ", " {\n flex-wrap: wrap;\n justify-content: space-between;\n width: 100%;\n flex-shrink: 0;\n }\n }\n\n .form-item-body {\n display: flex;\n align-items: center;\n width: 100%;\n margin-top: 4px;\n }\n\n .form-item-label {\n line-height: 1.2;\n font-size: 14px;\n color: #888;\n font-weight: bold;\n\n ", " {\n text-align: left;\n width: auto;\n flex-grow: 1;\n }\n }\n\n .form-item-input {\n flex-grow: 1;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n\n &.slot {\n height: 40px;\n line-height: 40px;\n background: #f8f8f8;\n font-size: 16px;\n }\n }\n\n .form-item-action {\n // width: 100px;\n text-align: left;\n margin-left: 12px;\n flex-shrink: 0;\n ", " {\n width: auto;\n margin-left: 0px;\n }\n .MuiIconButton-root {\n padding: 8px;\n svg {\n fill: #888;\n }\n &.Mui-disabled {\n opacity: 0.4;\n }\n }\n }\n"])), props => props.theme.breakpoints.down('md'), props => props.theme.breakpoints.down('md'), props => props.theme.breakpoints.down('md'), props => props.theme.breakpoints.down('md'));
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _Lock = _interopRequireDefault(require("@mui/icons-material/Lock"));
|
|
9
|
+
|
|
10
|
+
var _ContactMail = _interopRequireDefault(require("@mui/icons-material/ContactMail"));
|
|
11
|
+
|
|
12
|
+
var _Group = _interopRequireDefault(require("@mui/icons-material/Group"));
|
|
13
|
+
|
|
14
|
+
var _constant = require("@abtnode/constant");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
var _default = [{
|
|
19
|
+
value: _constant.WHO_CAN_ACCESS.OWNER,
|
|
20
|
+
icon: _Lock.default,
|
|
21
|
+
title: {
|
|
22
|
+
zh: '只有我自己可访问',
|
|
23
|
+
en: 'Only me can access'
|
|
24
|
+
},
|
|
25
|
+
description: {
|
|
26
|
+
zh: '必须提供所有者通行证才能访问应用',
|
|
27
|
+
en: 'You must provide owner passport to access this application'
|
|
28
|
+
}
|
|
29
|
+
}, {
|
|
30
|
+
value: _constant.WHO_CAN_ACCESS.INVITED,
|
|
31
|
+
icon: _ContactMail.default,
|
|
32
|
+
title: {
|
|
33
|
+
zh: '只有被邀请的人可以访问',
|
|
34
|
+
en: 'Only invited people can access'
|
|
35
|
+
},
|
|
36
|
+
description: {
|
|
37
|
+
zh: '稍后您可以在管理页面中邀请成员',
|
|
38
|
+
en: 'You can invite members later in the admin page'
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
value: _constant.WHO_CAN_ACCESS.ALL,
|
|
42
|
+
icon: _Group.default,
|
|
43
|
+
title: {
|
|
44
|
+
zh: '所有人可访问',
|
|
45
|
+
en: 'Accessible to all'
|
|
46
|
+
},
|
|
47
|
+
description: {
|
|
48
|
+
zh: '向所有人开放,无需通行证即可访问应用',
|
|
49
|
+
en: 'Open to the world anyone can access without passport'
|
|
50
|
+
}
|
|
51
|
+
}];
|
|
52
|
+
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.8.
|
|
6
|
+
"version": "1.8.4",
|
|
7
7
|
"description": "UX components shared across abtnode packages",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@abtnode/auth": "1.8.
|
|
25
|
-
"@abtnode/constant": "1.8.
|
|
26
|
-
"@arcblock/did-connect": "^2.1.
|
|
27
|
-
"@arcblock/icons": "^2.1.
|
|
28
|
-
"@arcblock/ux": "^2.1.
|
|
29
|
-
"@blocklet/meta": "1.8.
|
|
24
|
+
"@abtnode/auth": "1.8.4",
|
|
25
|
+
"@abtnode/constant": "1.8.4",
|
|
26
|
+
"@arcblock/did-connect": "^2.1.68",
|
|
27
|
+
"@arcblock/icons": "^2.1.68",
|
|
28
|
+
"@arcblock/ux": "^2.1.68",
|
|
29
|
+
"@blocklet/meta": "1.8.4",
|
|
30
30
|
"@emotion/react": "^11.9.0",
|
|
31
31
|
"@emotion/styled": "^11.8.1",
|
|
32
32
|
"@mui/icons-material": "^5.6.2",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"@mui/styles": "^5.6.2",
|
|
35
35
|
"ahooks": "^3.4.0",
|
|
36
36
|
"dayjs": "^1.11.2",
|
|
37
|
+
"flat": "^5.0.0",
|
|
37
38
|
"notistack": "2.0.5",
|
|
38
39
|
"prop-types": "^15.7.2",
|
|
39
40
|
"react": "^18.1.0",
|
|
@@ -51,5 +52,5 @@
|
|
|
51
52
|
"babel-plugin-inline-react-svg": "^1.1.1",
|
|
52
53
|
"babel-plugin-styled-components": "^1.10.7"
|
|
53
54
|
},
|
|
54
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "c42fb1bb84c5eef0f753fd5397d8007c7a6eee19"
|
|
55
56
|
}
|