@abtnode/ux 1.8.0 → 1.8.3
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/card-selector.js +28 -28
- package/lib/invitation/invitation-app.js +26 -15
- package/lib/invitation/invitation-passport.js +69 -57
- package/lib/invitation/invitation-receive.js +39 -35
- package/lib/invitation/invitation-user.js +23 -22
- package/lib/invitation/invitation.js +23 -21
- package/lib/issue-passport.js +54 -47
- package/lib/launch-blocklet/content-layout.js +11 -3
- package/lib/launch-blocklet/page-header.js +11 -7
- package/lib/layout/addon.js +29 -27
- package/lib/locales/en.js +43 -5
- package/lib/locales/index.js +4 -2
- package/lib/locales/zh.js +45 -6
- package/lib/lost-passport.js +135 -110
- package/lib/nav-logo.js +63 -39
- package/lib/schema-form/color-input.js +57 -61
- package/lib/schema-form/index.js +104 -80
- package/lib/schema-form/passport-input.js +25 -24
- package/lib/schema-form/text-input.js +12 -7
- package/lib/toast.js +17 -14
- package/lib/util/index.js +2 -1
- package/lib/who-can-access/config.js +52 -0
- package/lib/wrap-locale.js +12 -8
- package/package.json +9 -8
package/lib/schema-form/index.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = SchemaForm;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
@@ -31,14 +31,12 @@ var _passportInput = _interopRequireDefault(require("./passport-input"));
|
|
|
31
31
|
|
|
32
32
|
var _required = _interopRequireDefault(require("./required"));
|
|
33
33
|
|
|
34
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
35
|
+
|
|
34
36
|
var _templateObject;
|
|
35
37
|
|
|
36
38
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
39
|
|
|
38
|
-
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); }
|
|
39
|
-
|
|
40
|
-
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; }
|
|
41
|
-
|
|
42
40
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
43
41
|
|
|
44
42
|
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; }
|
|
@@ -81,7 +79,8 @@ function SchemaForm(_ref2) {
|
|
|
81
79
|
value,
|
|
82
80
|
defaultValue,
|
|
83
81
|
onChange,
|
|
84
|
-
style
|
|
82
|
+
style,
|
|
83
|
+
disabled
|
|
85
84
|
} = _ref2;
|
|
86
85
|
const isControlled = Object.prototype.toString.call(value) === '[object Object]';
|
|
87
86
|
const [editingItem, setEditingItem] = (0, _react.useState)(null);
|
|
@@ -90,7 +89,8 @@ function SchemaForm(_ref2) {
|
|
|
90
89
|
|
|
91
90
|
function onFormItemChange(item, changeValue, action) {
|
|
92
91
|
const {
|
|
93
|
-
key
|
|
92
|
+
key,
|
|
93
|
+
secure
|
|
94
94
|
} = item;
|
|
95
95
|
const oldValue = formValues[key];
|
|
96
96
|
const isChanged = oldValue !== changeValue;
|
|
@@ -109,7 +109,13 @@ function SchemaForm(_ref2) {
|
|
|
109
109
|
allValues: newValues,
|
|
110
110
|
action,
|
|
111
111
|
currentItem: item
|
|
112
|
-
});
|
|
112
|
+
}); // hide secure text after confirm
|
|
113
|
+
|
|
114
|
+
if (action === 'confirm' && secure) {
|
|
115
|
+
setFormValues(_objectSpread(_objectSpread({}, formValues), {}, {
|
|
116
|
+
[key]: '__encrypted__'
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
113
119
|
}
|
|
114
120
|
|
|
115
121
|
function onItemEditingStatusChange(item) {
|
|
@@ -143,77 +149,93 @@ function SchemaForm(_ref2) {
|
|
|
143
149
|
return currentValue;
|
|
144
150
|
}
|
|
145
151
|
|
|
146
|
-
return /*#__PURE__*/
|
|
152
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(FormWrapper, {
|
|
147
153
|
className: "form",
|
|
148
|
-
style: style
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
const CurrentComponent = getComponent(x, {
|
|
162
|
-
editing
|
|
163
|
-
});
|
|
164
|
-
const renderComponentProps = {
|
|
165
|
-
inputProps: {
|
|
166
|
-
'data-cy': 'schema-form-item-component'
|
|
167
|
-
},
|
|
168
|
-
key,
|
|
169
|
-
description,
|
|
170
|
-
editing,
|
|
171
|
-
value: currentValue,
|
|
172
|
-
onChange: changeValue => onFormItemChange(x, changeValue, 'change'),
|
|
173
|
-
componentProps
|
|
174
|
-
};
|
|
175
|
-
return /*#__PURE__*/_react.default.createElement(_Box.default, {
|
|
176
|
-
className: "form-item",
|
|
177
|
-
key: key
|
|
178
|
-
}, /*#__PURE__*/_react.default.createElement(_Box.default, {
|
|
179
|
-
className: "form-item-label",
|
|
180
|
-
style: {
|
|
181
|
-
color: required && !currentValue ? '#ff0000' : '#333'
|
|
154
|
+
style: style,
|
|
155
|
+
children: schema === null || schema === void 0 ? void 0 : schema.map(x => {
|
|
156
|
+
const {
|
|
157
|
+
key,
|
|
158
|
+
description,
|
|
159
|
+
required,
|
|
160
|
+
hidden = false,
|
|
161
|
+
componentProps = {}
|
|
162
|
+
} = x;
|
|
163
|
+
|
|
164
|
+
if (hidden) {
|
|
165
|
+
return null;
|
|
182
166
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
167
|
+
|
|
168
|
+
const editing = !!(editingItem && key === editingItem.key);
|
|
169
|
+
const currentValue = getValue(x, {
|
|
170
|
+
editing
|
|
171
|
+
}); // get component by componentType
|
|
172
|
+
|
|
173
|
+
const CurrentComponent = getComponent(x, {
|
|
174
|
+
editing
|
|
175
|
+
});
|
|
176
|
+
const renderComponentProps = {
|
|
177
|
+
inputProps: {
|
|
178
|
+
'data-cy': 'schema-form-item-component'
|
|
179
|
+
},
|
|
180
|
+
key,
|
|
181
|
+
description,
|
|
182
|
+
editing,
|
|
183
|
+
value: currentValue,
|
|
184
|
+
onChange: changeValue => onFormItemChange(x, changeValue, 'change'),
|
|
185
|
+
componentProps
|
|
186
|
+
};
|
|
187
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
188
|
+
className: "form-item",
|
|
189
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
190
|
+
className: "form-item-label",
|
|
191
|
+
style: {
|
|
192
|
+
color: required && !currentValue ? '#ff0000' : '#333'
|
|
193
|
+
},
|
|
194
|
+
children: [description, required && /*#__PURE__*/(0, _jsxRuntime.jsx)(_required.default, {})]
|
|
195
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
196
|
+
className: "form-item-body",
|
|
197
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
198
|
+
className: "form-item-input",
|
|
199
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(CurrentComponent, _objectSpread({}, renderComponentProps))
|
|
200
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
201
|
+
className: "form-item-action",
|
|
202
|
+
children: editing ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
203
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
204
|
+
"data-cy": "schema-form-item-confirm",
|
|
205
|
+
onClick: () => {
|
|
206
|
+
onFormItemChange(x, currentValue, 'confirm');
|
|
207
|
+
onItemEditingStatusChange(null);
|
|
208
|
+
},
|
|
209
|
+
disabled: disabled || loading,
|
|
210
|
+
size: "large",
|
|
211
|
+
children: loading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_CircularProgress.default, {
|
|
212
|
+
size: 24
|
|
213
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Done.default, {})
|
|
214
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
215
|
+
"data-cy": "schema-form-item-cancel",
|
|
216
|
+
onClick: () => {
|
|
217
|
+
onFormItemChange(x, editingItemInitialValue.current, 'cancel');
|
|
218
|
+
onItemEditingStatusChange(null);
|
|
219
|
+
},
|
|
220
|
+
disabled: disabled || loading,
|
|
221
|
+
size: "large",
|
|
222
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Close.default, {})
|
|
223
|
+
})]
|
|
224
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
225
|
+
"data-cy": "schema-form-item-edit",
|
|
226
|
+
onClick: () => {
|
|
227
|
+
onFormItemChange(x, formValues[key], 'edit');
|
|
228
|
+
onItemEditingStatusChange(x);
|
|
229
|
+
},
|
|
230
|
+
disabled: disabled || editingItem,
|
|
231
|
+
size: "large",
|
|
232
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_EditIcon.default, {})
|
|
233
|
+
})
|
|
234
|
+
})]
|
|
235
|
+
})]
|
|
236
|
+
}, key);
|
|
237
|
+
})
|
|
238
|
+
});
|
|
217
239
|
}
|
|
218
240
|
|
|
219
241
|
SchemaForm.propTypes = {
|
|
@@ -222,12 +244,14 @@ SchemaForm.propTypes = {
|
|
|
222
244
|
onChange: _propTypes.default.func.isRequired,
|
|
223
245
|
value: _propTypes.default.object,
|
|
224
246
|
defaultValue: _propTypes.default.object,
|
|
225
|
-
style: _propTypes.default.object
|
|
247
|
+
style: _propTypes.default.object,
|
|
248
|
+
disabled: _propTypes.default.bool
|
|
226
249
|
};
|
|
227
250
|
SchemaForm.defaultProps = {
|
|
228
251
|
loading: false,
|
|
229
252
|
value: undefined,
|
|
230
253
|
defaultValue: {},
|
|
231
|
-
style: {}
|
|
254
|
+
style: {},
|
|
255
|
+
disabled: false
|
|
232
256
|
};
|
|
233
|
-
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'));
|
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = PassportInput;
|
|
7
7
|
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
9
|
|
|
12
10
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
@@ -21,6 +19,8 @@ var _colorInput = _interopRequireDefault(require("./color-input"));
|
|
|
21
19
|
|
|
22
20
|
var _commonPropTypes = _interopRequireDefault(require("./common-prop-types"));
|
|
23
21
|
|
|
22
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
+
|
|
24
24
|
const _excluded = ["editing", "value", "onChange", "componentProps"];
|
|
25
25
|
|
|
26
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -48,29 +48,30 @@ function PassportInput(_ref) {
|
|
|
48
48
|
blocklet
|
|
49
49
|
} = componentProps;
|
|
50
50
|
const color = value === 'auto' ? (0, _passportColor.getPassportColorFromDid)(blocklet.appDid) : value;
|
|
51
|
-
return /*#__PURE__*/
|
|
51
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
52
52
|
display: "flex",
|
|
53
|
-
alignItems: "center"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
53
|
+
alignItems: "center",
|
|
54
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
55
|
+
style: {
|
|
56
|
+
width: 96,
|
|
57
|
+
marginRight: 12
|
|
58
|
+
},
|
|
59
|
+
alt: "",
|
|
60
|
+
src: (0, _createPassportSvg.default)({
|
|
61
|
+
title: 'Owner',
|
|
62
|
+
issuer: (0, _util.getDisplayName)(blocklet),
|
|
63
|
+
issuerDid: blocklet.appDid,
|
|
64
|
+
ownerName: 'Your Name',
|
|
65
|
+
isDataUrl: true,
|
|
66
|
+
preferredColor: value || 'auto'
|
|
67
|
+
})
|
|
68
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_colorInput.default, _objectSpread(_objectSpread({}, rest), {}, {
|
|
69
|
+
editing: editing,
|
|
70
|
+
value: editing ? color : value,
|
|
71
|
+
onChange: onChange,
|
|
72
|
+
componentProps: componentProps
|
|
73
|
+
}))]
|
|
74
|
+
});
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
PassportInput.propTypes = _objectSpread(_objectSpread({}, _commonPropTypes.default), {}, {
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = TextInput;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
|
|
10
10
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
11
11
|
|
|
@@ -13,13 +13,17 @@ var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
|
13
13
|
|
|
14
14
|
var _commonPropTypes = _interopRequireDefault(require("./common-prop-types"));
|
|
15
15
|
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
|
|
16
18
|
const _excluded = ["editing", "description", "value", "onChange", "componentProps"];
|
|
17
19
|
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
20
|
-
function
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
21
25
|
|
|
22
|
-
function
|
|
26
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
27
|
|
|
24
28
|
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; }
|
|
25
29
|
|
|
@@ -52,7 +56,7 @@ function TextInput(_ref) {
|
|
|
52
56
|
};
|
|
53
57
|
|
|
54
58
|
if (editing) {
|
|
55
|
-
return /*#__PURE__*/
|
|
59
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, _objectSpread({
|
|
56
60
|
style: {
|
|
57
61
|
flex: 1
|
|
58
62
|
},
|
|
@@ -70,10 +74,11 @@ function TextInput(_ref) {
|
|
|
70
74
|
}, rest));
|
|
71
75
|
}
|
|
72
76
|
|
|
73
|
-
return /*#__PURE__*/
|
|
77
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
74
78
|
px: 1,
|
|
75
|
-
className: "form-item-input slot"
|
|
76
|
-
|
|
79
|
+
className: "form-item-input slot",
|
|
80
|
+
children: value
|
|
81
|
+
});
|
|
77
82
|
}
|
|
78
83
|
|
|
79
84
|
TextInput.propTypes = _commonPropTypes.default;
|
package/lib/toast.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.ToastProvider = ToastProvider;
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
|
|
9
|
-
var _react =
|
|
9
|
+
var _react = require("react");
|
|
10
10
|
|
|
11
11
|
var _notistack = require("notistack");
|
|
12
12
|
|
|
@@ -14,6 +14,8 @@ var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
|
14
14
|
|
|
15
15
|
var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
|
|
16
16
|
|
|
17
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
+
|
|
17
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
20
|
|
|
19
21
|
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; }
|
|
@@ -41,31 +43,32 @@ function ToastProvider(_ref) {
|
|
|
41
43
|
let {
|
|
42
44
|
children
|
|
43
45
|
} = _ref;
|
|
44
|
-
|
|
45
|
-
const notistackRef = /*#__PURE__*/_react.default.createRef();
|
|
46
|
+
const notistackRef = /*#__PURE__*/(0, _react.createRef)();
|
|
46
47
|
|
|
47
48
|
const onClickDismiss = key => () => {
|
|
48
49
|
notistackRef.current.closeSnackbar(key);
|
|
49
50
|
};
|
|
50
51
|
|
|
51
|
-
return /*#__PURE__*/
|
|
52
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_notistack.SnackbarProvider, {
|
|
52
53
|
anchorOrigin: {
|
|
53
54
|
vertical: 'top',
|
|
54
55
|
horizontal: 'right'
|
|
55
56
|
},
|
|
56
|
-
ref: notistackRef
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
ref: notistackRef // eslint-disable-next-line react/no-unstable-nested-components
|
|
58
|
+
,
|
|
59
|
+
action: key => /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
59
60
|
"aria-label": "close",
|
|
60
61
|
color: "inherit",
|
|
61
62
|
onClick: onClickDismiss(key),
|
|
62
|
-
size: "large"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
size: "large",
|
|
64
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Close.default, {
|
|
65
|
+
style: {
|
|
66
|
+
fontSize: 16
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
}, "close"),
|
|
70
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Toast, {}), children]
|
|
71
|
+
});
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
function Toast() {
|
package/lib/util/index.js
CHANGED
|
@@ -17,6 +17,7 @@ var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
|
17
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
18
|
|
|
19
19
|
function sleep(t) {
|
|
20
|
+
// eslint-disable-next-line no-promise-executor-return
|
|
20
21
|
return new Promise(resolve => setTimeout(resolve, t));
|
|
21
22
|
}
|
|
22
23
|
|
|
@@ -50,7 +51,7 @@ exports.validateDomain = validateDomain;
|
|
|
50
51
|
|
|
51
52
|
function getAccessUrl(hostname) {
|
|
52
53
|
let path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
53
|
-
let params = arguments.length > 2 ? arguments[2] : undefined;
|
|
54
|
+
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
54
55
|
|
|
55
56
|
if (!hostname) {
|
|
56
57
|
return '';
|
|
@@ -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/lib/wrap-locale.js
CHANGED
|
@@ -5,19 +5,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = wrapLocale;
|
|
7
7
|
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
11
9
|
|
|
12
10
|
var _locales = require("./locales");
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
|
|
14
|
+
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; }
|
|
15
|
+
|
|
16
|
+
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; }
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
19
|
|
|
18
|
-
/* eslint-disable import/no-extraneous-dependencies */
|
|
19
20
|
function wrapLocale(Component) {
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
return function LocaleWrapper(props) {
|
|
22
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.LocaleProvider, {
|
|
23
|
+
translations: _locales.translations,
|
|
24
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, _objectSpread({}, props))
|
|
25
|
+
});
|
|
26
|
+
};
|
|
23
27
|
}
|
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.3",
|
|
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.3",
|
|
25
|
+
"@abtnode/constant": "1.8.3",
|
|
26
|
+
"@arcblock/did-connect": "^2.1.63",
|
|
27
|
+
"@arcblock/icons": "^2.1.63",
|
|
28
|
+
"@arcblock/ux": "^2.1.63",
|
|
29
|
+
"@blocklet/meta": "1.8.3",
|
|
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": "c734aca7bf1fc03378c3b082d0622b6a540a8bd3"
|
|
55
56
|
}
|