@abtnode/ux 1.16.0-beta-8ee536d7 → 1.16.0-beta-62b42401
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/blocklet/actions.js +34 -29
- package/lib/blocklet/component/add.js +58 -1
- package/lib/blocklet/component/delete.js +1 -1
- package/lib/blocklet/component/navigation/locale-tabs.js +18 -12
- package/lib/blocklet/component/navigation/navigation-actions.js +5 -5
- package/lib/blocklet/component/navigation/navigation-dialog.js +19 -13
- package/lib/blocklet/component/navigation/navigation-preview.js +11 -9
- package/lib/blocklet/component/navigation/simple-select.js +25 -16
- package/lib/blocklet/component/sortable-tree.js +5 -4
- package/lib/blocklet/component/space-connector.js +208 -0
- package/lib/blocklet/component/{space-gateway-selector.js → space-selector.js} +20 -10
- package/lib/blocklet/config-navigation.js +35 -26
- package/lib/blocklet/oauth/auth0.js +162 -0
- package/lib/blocklet/oauth/index.js +49 -0
- package/lib/blocklet/preferences/index.js +24 -0
- package/lib/blocklet/storage.js +14 -153
- package/lib/invitation/invitation-receive.js +9 -1
- package/lib/locales/en.js +24 -5
- package/lib/locales/zh.js +23 -4
- package/lib/team/members/index.js +9 -0
- package/lib/team/members/issue-passport.js +6 -2
- package/lib/team/members/passports.js +1 -0
- package/package.json +14 -14
package/lib/blocklet/actions.js
CHANGED
|
@@ -88,13 +88,9 @@ function BlockletActions(_ref) {
|
|
|
88
88
|
let isRemoved = false;
|
|
89
89
|
try {
|
|
90
90
|
var _blocklet$settings;
|
|
91
|
-
const input = {
|
|
92
|
-
did: blocklet.meta.did
|
|
93
|
-
};
|
|
94
91
|
if (action === 'remove') {
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
if (action === 'start' && !inService && !skipSetup && !((_blocklet$settings = blocklet.settings) !== null && _blocklet$settings !== void 0 && _blocklet$settings.initialized)) {
|
|
92
|
+
await fn(params);
|
|
93
|
+
} else if (action === 'start' && !inService && !skipSetup && !((_blocklet$settings = blocklet.settings) !== null && _blocklet$settings !== void 0 && _blocklet$settings.initialized)) {
|
|
98
94
|
// 启动 blocklet 并跳转到 setup 流程界面时携带 serverUrl 查询参数
|
|
99
95
|
const serverUrl = (0, _util3.getServerUrl)(node.info);
|
|
100
96
|
const url = new URL(recommendedUrl);
|
|
@@ -105,10 +101,14 @@ function BlockletActions(_ref) {
|
|
|
105
101
|
blocklet
|
|
106
102
|
});
|
|
107
103
|
return;
|
|
104
|
+
} else {
|
|
105
|
+
const input = {
|
|
106
|
+
did: blocklet.meta.did
|
|
107
|
+
};
|
|
108
|
+
await fn({
|
|
109
|
+
input
|
|
110
|
+
});
|
|
108
111
|
}
|
|
109
|
-
await fn({
|
|
110
|
-
input
|
|
111
|
-
});
|
|
112
112
|
if (action === 'remove') {
|
|
113
113
|
isRemoved = true; // Deleted send request and succeeded
|
|
114
114
|
} else {
|
|
@@ -140,25 +140,12 @@ function BlockletActions(_ref) {
|
|
|
140
140
|
setConfirmSetting(null);
|
|
141
141
|
};
|
|
142
142
|
const name = (0, _util.getDisplayName)(blocklet, true);
|
|
143
|
-
const removeSetting =
|
|
144
|
-
description: () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
145
|
-
component: "div",
|
|
146
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
147
|
-
gutterBottom: true,
|
|
148
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("b", {
|
|
149
|
-
children: t('blocklet.action.forceRemoveDescription')
|
|
150
|
-
})
|
|
151
|
-
})
|
|
152
|
-
}),
|
|
153
|
-
params: {
|
|
154
|
-
removeType: 'complete'
|
|
155
|
-
}
|
|
156
|
-
} : {
|
|
143
|
+
const removeSetting = {
|
|
157
144
|
description: (params, setParams) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Typography.default, {
|
|
158
145
|
component: "div",
|
|
159
146
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
160
147
|
gutterBottom: true,
|
|
161
|
-
children: t('blocklet.action.
|
|
148
|
+
children: t('blocklet.action.removeApplicationDescription')
|
|
162
149
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_RadioGroup.default, {
|
|
163
150
|
name: "removeType",
|
|
164
151
|
value: params.removeType,
|
|
@@ -166,18 +153,18 @@ function BlockletActions(_ref) {
|
|
|
166
153
|
removeType: e.target.value
|
|
167
154
|
})),
|
|
168
155
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_FormControlLabel.default, {
|
|
169
|
-
value: "
|
|
156
|
+
value: "backup",
|
|
170
157
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Radio.default, {}),
|
|
171
|
-
label: t('blocklet.action.
|
|
158
|
+
label: t('blocklet.action.removeApplicationAfterBackup')
|
|
172
159
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormControlLabel.default, {
|
|
173
160
|
value: "complete",
|
|
174
161
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Radio.default, {}),
|
|
175
|
-
label: t('blocklet.action.
|
|
162
|
+
label: t('blocklet.action.removeApplicationComplete')
|
|
176
163
|
})]
|
|
177
164
|
})]
|
|
178
165
|
}),
|
|
179
166
|
params: {
|
|
180
|
-
removeType: '
|
|
167
|
+
removeType: 'backup'
|
|
181
168
|
}
|
|
182
169
|
};
|
|
183
170
|
const confirmSettings = {
|
|
@@ -263,7 +250,25 @@ function BlockletActions(_ref) {
|
|
|
263
250
|
action: 'remove',
|
|
264
251
|
icon: _icons.default.Remove,
|
|
265
252
|
name: t('common.remove'),
|
|
266
|
-
handler: createHandler('remove',
|
|
253
|
+
handler: createHandler('remove', async _ref2 => {
|
|
254
|
+
let {
|
|
255
|
+
removeType
|
|
256
|
+
} = _ref2;
|
|
257
|
+
if (removeType === 'backup') {
|
|
258
|
+
await node.api.backupBlocklet({
|
|
259
|
+
input: {
|
|
260
|
+
appDid: blocklet.appDid,
|
|
261
|
+
to: 'disk'
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
await node.api.deleteBlocklet({
|
|
266
|
+
input: {
|
|
267
|
+
did: blocklet.meta.did,
|
|
268
|
+
keepData: false
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
}, true),
|
|
267
272
|
disabled: inProgress
|
|
268
273
|
} : null;
|
|
269
274
|
const cancelDownloadAction = !inService ? {
|
|
@@ -25,6 +25,7 @@ var _context = require("@arcblock/ux/lib/Locale/context");
|
|
|
25
25
|
var _constant = require("@blocklet/constant");
|
|
26
26
|
var _launcherLayout = _interopRequireDefault(require("@blocklet/launcher-layout"));
|
|
27
27
|
var _step = require("@blocklet/launcher-layout/lib/context/step");
|
|
28
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
28
29
|
var _constant2 = require("@abtnode/constant");
|
|
29
30
|
var _Button = _interopRequireDefault(require("@arcblock/ux/lib/Button"));
|
|
30
31
|
var _Alert = _interopRequireDefault(require("@arcblock/ux/lib/Alert"));
|
|
@@ -43,6 +44,7 @@ var _agreement = _interopRequireDefault(require("../agreement"));
|
|
|
43
44
|
var _installFromUrl = _interopRequireDefault(require("../install-from-url"));
|
|
44
45
|
var _selectStore = _interopRequireDefault(require("./select-store"));
|
|
45
46
|
var _storeBlockletList = _interopRequireDefault(require("./store-blocklet-list"));
|
|
47
|
+
var _spaceConnector = _interopRequireDefault(require("./space-connector"));
|
|
46
48
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
47
49
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
48
50
|
const _excluded = ["name", "validation"],
|
|
@@ -57,6 +59,14 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
57
59
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
58
60
|
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); }
|
|
59
61
|
const requirePurchase = meta => meta.inStore && (0, _util.isFreeBlocklet)(meta) === false;
|
|
62
|
+
const getDIDSpaceCapability = meta => {
|
|
63
|
+
var _meta$capabilities;
|
|
64
|
+
return meta === null || meta === void 0 ? void 0 : (_meta$capabilities = meta.capabilities) === null || _meta$capabilities === void 0 ? void 0 : _meta$capabilities.didSpace;
|
|
65
|
+
};
|
|
66
|
+
const getDIDSpaceEndpoint = blocklet => {
|
|
67
|
+
var _blocklet$configs, _blocklet$configs$fin;
|
|
68
|
+
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;
|
|
69
|
+
};
|
|
60
70
|
const hasRequiredEnvironments = meta => (meta.environments || []).some(x => x.required);
|
|
61
71
|
const hasMissRequiredConfigs = (configsList, sharedValueMap) => {
|
|
62
72
|
return configsList === null || configsList === void 0 ? void 0 : configsList.some(item => {
|
|
@@ -161,6 +171,7 @@ function AddComponent(_ref2) {
|
|
|
161
171
|
hasEnvironmentsStep: false,
|
|
162
172
|
hasRequiredEnvironments: false,
|
|
163
173
|
requirePurchase: false,
|
|
174
|
+
didSpaceCapability: null,
|
|
164
175
|
installResultProps: {},
|
|
165
176
|
purchaseResultProps: {},
|
|
166
177
|
showFromUrlDialog: false
|
|
@@ -556,12 +567,16 @@ function AddComponent(_ref2) {
|
|
|
556
567
|
|
|
557
568
|
// eslint-disable-next-line no-shadow
|
|
558
569
|
const componentRequirePurchase = requirePurchase(component.current.meta);
|
|
570
|
+
const componentDIDSpaceCapability = getDIDSpaceCapability(component.current.meta);
|
|
571
|
+
const didSpaceEndpoint = getDIDSpaceEndpoint(blocklet);
|
|
559
572
|
updateParams(_objectSpread(_objectSpread({
|
|
560
573
|
bundleDid,
|
|
561
574
|
componentDid
|
|
562
575
|
}, doc), {}, {
|
|
563
576
|
hasRequiredEnvironments: hasRequiredEnvironments(component.current.meta),
|
|
564
|
-
requirePurchase: componentRequirePurchase
|
|
577
|
+
requirePurchase: componentRequirePurchase,
|
|
578
|
+
didSpaceCapability: componentDIDSpaceCapability,
|
|
579
|
+
didSpaceEndpoint
|
|
565
580
|
}));
|
|
566
581
|
if (isInit && componentRequirePurchase) {
|
|
567
582
|
onGeneratePurchaseData();
|
|
@@ -885,6 +900,48 @@ function AddComponent(_ref2) {
|
|
|
885
900
|
confirm: t('common.next'),
|
|
886
901
|
onCancel: _onCancel,
|
|
887
902
|
onConfirm: onNext
|
|
903
|
+
}, meta && (params === null || params === void 0 ? void 0 : params.didSpaceCapability) && {
|
|
904
|
+
key: 'didSpace',
|
|
905
|
+
name: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
906
|
+
children: [t('blocklet.component.didSpaceConfig'), " ", params.didSpaceCapability === 'required' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_required.default, {})]
|
|
907
|
+
}),
|
|
908
|
+
disabled: params.didSpaceCapability === 'required' && !params.didSpaceEndpoint,
|
|
909
|
+
body: () => {
|
|
910
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(TypographyWrapper, {
|
|
911
|
+
component: "div",
|
|
912
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(PageHeaderWrapper, {
|
|
913
|
+
title: t('blocklet.component.didSpaceConfig'),
|
|
914
|
+
subTitle: t('blocklet.component.didSpaceConfigTip')
|
|
915
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
916
|
+
sx: {
|
|
917
|
+
mt: '36px',
|
|
918
|
+
'& > div': {
|
|
919
|
+
maxWidth: 'unset !important',
|
|
920
|
+
'& .MuiAutocomplete-root': {
|
|
921
|
+
maxWidth: 'unset !important'
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
},
|
|
925
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_spaceConnector.default, {
|
|
926
|
+
sx: {
|
|
927
|
+
'& .MuiFormHelperText-root': {
|
|
928
|
+
wordBreak: 'break-all'
|
|
929
|
+
}
|
|
930
|
+
},
|
|
931
|
+
helperText: params.didSpaceEndpoint && t('blocklet.component.didSpaceConnected', {
|
|
932
|
+
endpoint: params.didSpaceEndpoint
|
|
933
|
+
}),
|
|
934
|
+
onConnect: () => {
|
|
935
|
+
onNext();
|
|
936
|
+
}
|
|
937
|
+
})
|
|
938
|
+
})]
|
|
939
|
+
});
|
|
940
|
+
},
|
|
941
|
+
cancel: t('common.pre'),
|
|
942
|
+
confirm: t('common.next'),
|
|
943
|
+
onCancel: _onCancel,
|
|
944
|
+
onConfirm: onNext
|
|
888
945
|
}, {
|
|
889
946
|
key: 'install',
|
|
890
947
|
name: t('common.install'),
|
|
@@ -47,7 +47,7 @@ function DeleteComponent(_ref) {
|
|
|
47
47
|
const btn = /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledButton, {
|
|
48
48
|
disabled: componentDisabled,
|
|
49
49
|
onClick: () => setDeleteSetting({
|
|
50
|
-
title: t('
|
|
50
|
+
title: "".concat(t('common.delete'), " ").concat(component.meta.title || component.meta.name),
|
|
51
51
|
// eslint-disable-next-line react/no-unstable-nested-components
|
|
52
52
|
description: (params, setParams) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Typography.default, {
|
|
53
53
|
component: "div",
|
|
@@ -9,7 +9,13 @@ var _ahooks = require("ahooks");
|
|
|
9
9
|
var _lodash = require("lodash");
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
var _react2 = require("@iconify/react");
|
|
12
|
-
var
|
|
12
|
+
var _Tabs = _interopRequireDefault(require("@mui/material/Tabs"));
|
|
13
|
+
var _Tab = _interopRequireDefault(require("@mui/material/Tab"));
|
|
14
|
+
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
15
|
+
var _Popover = _interopRequireDefault(require("@mui/material/Popover"));
|
|
16
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
17
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
18
|
+
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
13
19
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
14
20
|
var _simpleSelect = _interopRequireDefault(require("./simple-select"));
|
|
15
21
|
var _locales = _interopRequireDefault(require("../../../util/locales"));
|
|
@@ -115,21 +121,21 @@ function LocaleTabs(_ref) {
|
|
|
115
121
|
state.inputLocale = value;
|
|
116
122
|
}
|
|
117
123
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
118
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
124
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Tabs.default, {
|
|
119
125
|
sx: sx,
|
|
120
126
|
value: state.currentLocale,
|
|
121
127
|
onChange: (e, value) => {
|
|
122
128
|
state.currentLocale = value;
|
|
123
129
|
},
|
|
124
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
130
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Tab.default, {
|
|
125
131
|
label: "Default (".concat(_locales.default[defaultLocale], ")"),
|
|
126
132
|
value: "en"
|
|
127
|
-
}), state.localeList.map(item => /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
133
|
+
}), state.localeList.map(item => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tab.default, {
|
|
128
134
|
sx: {
|
|
129
135
|
position: 'relative'
|
|
130
136
|
},
|
|
131
137
|
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
132
|
-
children: [_locales.default[item], /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
138
|
+
children: [_locales.default[item], /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
133
139
|
size: "small",
|
|
134
140
|
color: "inherit",
|
|
135
141
|
sx: {
|
|
@@ -147,7 +153,7 @@ function LocaleTabs(_ref) {
|
|
|
147
153
|
})]
|
|
148
154
|
}),
|
|
149
155
|
value: item
|
|
150
|
-
}, item)), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
156
|
+
}, item)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
151
157
|
color: "primary",
|
|
152
158
|
disableFocusRipple: true,
|
|
153
159
|
sx: {
|
|
@@ -160,7 +166,7 @@ function LocaleTabs(_ref) {
|
|
|
160
166
|
icon: "mdi:plus"
|
|
161
167
|
})
|
|
162
168
|
})]
|
|
163
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
169
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Popover.default, {
|
|
164
170
|
open: openChooseLocale,
|
|
165
171
|
anchorEl: addLocaleButtonEl,
|
|
166
172
|
onClose: close,
|
|
@@ -168,15 +174,15 @@ function LocaleTabs(_ref) {
|
|
|
168
174
|
vertical: 'bottom',
|
|
169
175
|
horizontal: 'left'
|
|
170
176
|
},
|
|
171
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
177
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
172
178
|
sx: {
|
|
173
179
|
p: 2,
|
|
174
180
|
width: '270px'
|
|
175
181
|
},
|
|
176
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
182
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
177
183
|
variant: "subtitle2",
|
|
178
184
|
children: t('navigation.form.localePlaceholder')
|
|
179
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
185
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
180
186
|
mt: 1,
|
|
181
187
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_simpleSelect.default, {
|
|
182
188
|
required: true,
|
|
@@ -188,10 +194,10 @@ function LocaleTabs(_ref) {
|
|
|
188
194
|
error: !!state.localeError,
|
|
189
195
|
helperText: state.localeError || ' '
|
|
190
196
|
})
|
|
191
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
197
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
192
198
|
display: "flex",
|
|
193
199
|
justifyContent: "flex-end",
|
|
194
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
200
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
195
201
|
size: "small",
|
|
196
202
|
variant: "contained",
|
|
197
203
|
onClick: handleAddLocale,
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
8
|
var _react = require("@iconify/react");
|
|
9
|
-
var
|
|
9
|
+
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
10
10
|
var _react2 = require("react");
|
|
11
11
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -50,7 +50,7 @@ function NavigationActions(_ref) {
|
|
|
50
50
|
className: className,
|
|
51
51
|
children: [!data.parent && ['header', 'footer', 'dashboard'].includes(section) && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
52
52
|
title: isUninstalled ? t('navigation.action.noAddSub') : t('navigation.action.addSub'),
|
|
53
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
53
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
54
54
|
size: "small",
|
|
55
55
|
color: "success",
|
|
56
56
|
onClick: handleClickAdd,
|
|
@@ -61,7 +61,7 @@ function NavigationActions(_ref) {
|
|
|
61
61
|
})
|
|
62
62
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
63
63
|
title: isUninstalled ? t('navigation.action.noEdit') : t('navigation.action.edit'),
|
|
64
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
64
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
65
65
|
size: "small",
|
|
66
66
|
color: "primary",
|
|
67
67
|
onClick: handleClickEdit,
|
|
@@ -74,7 +74,7 @@ function NavigationActions(_ref) {
|
|
|
74
74
|
title:
|
|
75
75
|
// eslint-disable-next-line no-nested-ternary
|
|
76
76
|
isUninstalled ? t('navigation.action.noEdit') : data.visible ? t('navigation.action.hide') : t('navigation.action.show'),
|
|
77
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
77
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
78
78
|
size: "small",
|
|
79
79
|
color: "warning",
|
|
80
80
|
onClick: handleClickToggle,
|
|
@@ -87,7 +87,7 @@ function NavigationActions(_ref) {
|
|
|
87
87
|
})
|
|
88
88
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
89
89
|
title: isDisabled && !isUninstalled ? t('navigation.action.noDel') : t('navigation.action.del'),
|
|
90
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
90
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
91
91
|
disabled: isDisabled && !isUninstalled,
|
|
92
92
|
size: "small",
|
|
93
93
|
color: "error",
|
|
@@ -8,7 +8,13 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
8
8
|
var _Button = _interopRequireDefault(require("@arcblock/ux/lib/Button"));
|
|
9
9
|
var _Dialog = _interopRequireDefault(require("@arcblock/ux/lib/Dialog"));
|
|
10
10
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
11
|
-
var
|
|
11
|
+
var _Autocomplete = _interopRequireDefault(require("@mui/material/Autocomplete"));
|
|
12
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
13
|
+
var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
14
|
+
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
15
|
+
var _InputAdornment = _interopRequireDefault(require("@mui/material/InputAdornment"));
|
|
16
|
+
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
17
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
12
18
|
var _ahooks = require("ahooks");
|
|
13
19
|
var _omit = _interopRequireDefault(require("lodash/omit"));
|
|
14
20
|
var _pick = _interopRequireDefault(require("lodash/pick"));
|
|
@@ -428,7 +434,7 @@ const NavigationDialog = /*#__PURE__*/(0, _react.forwardRef)(function Navigation
|
|
|
428
434
|
let {
|
|
429
435
|
field
|
|
430
436
|
} = _ref3;
|
|
431
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
437
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, _objectSpread({
|
|
432
438
|
fullWidth: true,
|
|
433
439
|
variant: "outlined",
|
|
434
440
|
margin: "dense",
|
|
@@ -451,16 +457,16 @@ const NavigationDialog = /*#__PURE__*/(0, _react.forwardRef)(function Navigation
|
|
|
451
457
|
let {
|
|
452
458
|
field
|
|
453
459
|
} = _ref4;
|
|
454
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
460
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, _objectSpread(_objectSpread({
|
|
455
461
|
fullWidth: true,
|
|
456
462
|
variant: "outlined",
|
|
457
463
|
margin: "dense",
|
|
458
464
|
placeholder: t('navigation.form.iconPlaceholder'),
|
|
459
465
|
label: t('navigation.form.icon'),
|
|
460
466
|
error: !!(errors !== null && errors !== void 0 && (_errors$icon = errors.icon) !== null && _errors$icon !== void 0 && _errors$icon.message),
|
|
461
|
-
helperText: (errors === null || errors === void 0 ? void 0 : (_errors$icon2 = errors.icon) === null || _errors$icon2 === void 0 ? void 0 : _errors$icon2.message) || /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
467
|
+
helperText: (errors === null || errors === void 0 ? void 0 : (_errors$icon2 = errors.icon) === null || _errors$icon2 === void 0 ? void 0 : _errors$icon2.message) || /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
462
468
|
display: "flex",
|
|
463
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
469
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
464
470
|
component: "a",
|
|
465
471
|
href: "https://icones.js.org",
|
|
466
472
|
target: "_blank",
|
|
@@ -476,9 +482,9 @@ const NavigationDialog = /*#__PURE__*/(0, _react.forwardRef)(function Navigation
|
|
|
476
482
|
})
|
|
477
483
|
}, field), {}, {
|
|
478
484
|
InputProps: {
|
|
479
|
-
endAdornment: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
485
|
+
endAdornment: /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputAdornment.default, {
|
|
480
486
|
position: "end",
|
|
481
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
487
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
482
488
|
sx: {
|
|
483
489
|
cursor: 'default'
|
|
484
490
|
},
|
|
@@ -526,10 +532,10 @@ const NavigationDialog = /*#__PURE__*/(0, _react.forwardRef)(function Navigation
|
|
|
526
532
|
let {
|
|
527
533
|
field
|
|
528
534
|
} = _ref6;
|
|
529
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
535
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormControl.default, {
|
|
530
536
|
fullWidth: true,
|
|
531
537
|
margin: "dense",
|
|
532
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
538
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Autocomplete.default, _objectSpread(_objectSpread({
|
|
533
539
|
disablePortal: true,
|
|
534
540
|
freeSolo: true,
|
|
535
541
|
blurOnSelect: true,
|
|
@@ -540,7 +546,7 @@ const NavigationDialog = /*#__PURE__*/(0, _react.forwardRef)(function Navigation
|
|
|
540
546
|
options: autocompleteOptions,
|
|
541
547
|
renderInput: params => {
|
|
542
548
|
var _errors$link, _errors$link2;
|
|
543
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
549
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, _objectSpread(_objectSpread({}, params), {}, {
|
|
544
550
|
placeholder: t('navigation.form.linkPlaceholder'),
|
|
545
551
|
label: t('navigation.form.link'),
|
|
546
552
|
error: !!(errors !== null && errors !== void 0 && (_errors$link = errors.link) !== null && _errors$link !== void 0 && _errors$link.message),
|
|
@@ -548,7 +554,7 @@ const NavigationDialog = /*#__PURE__*/(0, _react.forwardRef)(function Navigation
|
|
|
548
554
|
// FIXME: 添加了 startAdornment 后,autocomplete 选项无法显示,之后换成 antd 的 autocomplete 可以解决这个问题
|
|
549
555
|
,
|
|
550
556
|
InputProps: {
|
|
551
|
-
startAdornment: linkPrefix ? /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
557
|
+
startAdornment: linkPrefix ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputAdornment.default, {
|
|
552
558
|
position: "start",
|
|
553
559
|
sx: {
|
|
554
560
|
textDecoration: (0, _isAbsoluteUrl.default)(watchLink || '') ? 'line-through' : ''
|
|
@@ -558,10 +564,10 @@ const NavigationDialog = /*#__PURE__*/(0, _react.forwardRef)(function Navigation
|
|
|
558
564
|
}
|
|
559
565
|
}));
|
|
560
566
|
},
|
|
561
|
-
renderOption: (props, option) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
567
|
+
renderOption: (props, option) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, _objectSpread(_objectSpread({
|
|
562
568
|
component: "li"
|
|
563
569
|
}, props), {}, {
|
|
564
|
-
children: [option.label, /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
570
|
+
children: [option.label, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
565
571
|
marginLeft: 1,
|
|
566
572
|
component: "span",
|
|
567
573
|
variant: "body2",
|
|
@@ -9,7 +9,9 @@ var _Header = _interopRequireDefault(require("@blocklet/ui-react/lib/Header"));
|
|
|
9
9
|
var _Footer = _interopRequireDefault(require("@blocklet/ui-react/lib/Footer"));
|
|
10
10
|
var _Dashboard = _interopRequireDefault(require("@blocklet/ui-react/lib/Dashboard"));
|
|
11
11
|
var _linkBlocker = _interopRequireDefault(require("@blocklet/ui-react/lib/common/link-blocker"));
|
|
12
|
-
var
|
|
12
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
13
|
+
var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
|
|
14
|
+
var _Skeleton = _interopRequireDefault(require("@mui/material/Skeleton"));
|
|
13
15
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
14
16
|
var _blocklet = require("../../../contexts/blocklet");
|
|
15
17
|
var _useAppLogo = _interopRequireDefault(require("../../../hooks/use-app-logo"));
|
|
@@ -39,11 +41,11 @@ function NavigationPreview(_ref) {
|
|
|
39
41
|
navigation
|
|
40
42
|
};
|
|
41
43
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_linkBlocker.default, {
|
|
42
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
44
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
43
45
|
className: className,
|
|
44
46
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Header.default, {
|
|
45
47
|
meta: blockletInfo
|
|
46
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
48
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
47
49
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dashboard.default, {
|
|
48
50
|
meta: blockletInfo,
|
|
49
51
|
invalidPathFallback: () => {},
|
|
@@ -52,28 +54,28 @@ function NavigationPreview(_ref) {
|
|
|
52
54
|
display: 'none'
|
|
53
55
|
}
|
|
54
56
|
},
|
|
55
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
57
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
56
58
|
container: true,
|
|
57
59
|
spacing: 2,
|
|
58
60
|
children: new Array(6).fill().map((item, index) => {
|
|
59
61
|
return (
|
|
60
62
|
/*#__PURE__*/
|
|
61
63
|
// eslint-disable-next-line react/no-array-index-key
|
|
62
|
-
(0, _jsxRuntime.jsxs)(
|
|
64
|
+
(0, _jsxRuntime.jsxs)(_Grid.default, {
|
|
63
65
|
item: true,
|
|
64
66
|
xs: 4,
|
|
65
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
67
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Skeleton.default, {
|
|
66
68
|
animation: false,
|
|
67
69
|
variant: "rectangular",
|
|
68
70
|
width: "100%",
|
|
69
71
|
height: 120
|
|
70
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
72
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
71
73
|
sx: {
|
|
72
74
|
pt: 0.5
|
|
73
75
|
},
|
|
74
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
76
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Skeleton.default, {
|
|
75
77
|
animation: false
|
|
76
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
78
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Skeleton.default, {
|
|
77
79
|
width: "60%",
|
|
78
80
|
animation: false
|
|
79
81
|
})]
|
|
@@ -5,7 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
-
var
|
|
8
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
9
|
+
var _Chip = _interopRequireDefault(require("@mui/material/Chip"));
|
|
10
|
+
var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
11
|
+
var _FormHelperText = _interopRequireDefault(require("@mui/material/FormHelperText"));
|
|
12
|
+
var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
|
|
13
|
+
var _ListItemText = _interopRequireDefault(require("@mui/material/ListItemText"));
|
|
14
|
+
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
15
|
+
var _OutlinedInput = _interopRequireDefault(require("@mui/material/OutlinedInput"));
|
|
16
|
+
var _Select = _interopRequireDefault(require("@mui/material/Select"));
|
|
17
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
9
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
19
|
const _excluded = ["fullWidth", "multiple", "required", "label", "placeholer", "options", "helperText", "error", "margin"];
|
|
11
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -31,15 +40,15 @@ function SimpleSelect(_ref) {
|
|
|
31
40
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
32
41
|
const defaultOption = options.find(item => item.value === rest.value);
|
|
33
42
|
const defaultValue = defaultOption === null || defaultOption === void 0 ? void 0 : defaultOption.title;
|
|
34
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
43
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_FormControl.default, {
|
|
35
44
|
margin: margin,
|
|
36
45
|
fullWidth: fullWidth,
|
|
37
46
|
error: error,
|
|
38
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
47
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_InputLabel.default, {
|
|
39
48
|
children: "".concat(label).concat(required ? '*' : '')
|
|
40
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
49
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Select.default, _objectSpread(_objectSpread({
|
|
41
50
|
multiple: multiple,
|
|
42
|
-
input: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
51
|
+
input: /*#__PURE__*/(0, _jsxRuntime.jsx)(_OutlinedInput.default, {
|
|
43
52
|
defaultValue: defaultValue,
|
|
44
53
|
sx: {
|
|
45
54
|
flex: 1
|
|
@@ -52,7 +61,7 @@ function SimpleSelect(_ref) {
|
|
|
52
61
|
}),
|
|
53
62
|
renderValue: selected => {
|
|
54
63
|
if (multiple) {
|
|
55
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
64
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
56
65
|
sx: {
|
|
57
66
|
display: 'flex',
|
|
58
67
|
flexWrap: 'wrap',
|
|
@@ -60,7 +69,7 @@ function SimpleSelect(_ref) {
|
|
|
60
69
|
},
|
|
61
70
|
children: selected.map(value => {
|
|
62
71
|
const option = options.find(item => item.value === value);
|
|
63
|
-
return option && option.title && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
72
|
+
return option && option.title && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Chip.default, {
|
|
64
73
|
size: "small",
|
|
65
74
|
label: option.title
|
|
66
75
|
}, value);
|
|
@@ -68,11 +77,11 @@ function SimpleSelect(_ref) {
|
|
|
68
77
|
});
|
|
69
78
|
}
|
|
70
79
|
const option = options.find(item => item.value === selected);
|
|
71
|
-
return option && option.title && /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
72
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
80
|
+
return option && option.title && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
81
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
73
82
|
component: "span",
|
|
74
83
|
children: option.title
|
|
75
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
84
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
76
85
|
marginLeft: 1,
|
|
77
86
|
component: "span",
|
|
78
87
|
variant: "body2",
|
|
@@ -82,25 +91,25 @@ function SimpleSelect(_ref) {
|
|
|
82
91
|
});
|
|
83
92
|
}
|
|
84
93
|
}, rest), {}, {
|
|
85
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
94
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuItem.default, {
|
|
86
95
|
disabled: true,
|
|
87
96
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("em", {
|
|
88
97
|
children: placeholer
|
|
89
98
|
})
|
|
90
|
-
}), !multiple && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
99
|
+
}), !multiple && /*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuItem.default, {
|
|
91
100
|
value: "",
|
|
92
101
|
children: "None"
|
|
93
|
-
}), options.map(option => option && option.value && /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
102
|
+
}), options.map(option => option && option.value && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_MenuItem.default, {
|
|
94
103
|
value: option.value,
|
|
95
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
104
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ListItemText.default, {
|
|
96
105
|
children: option.title
|
|
97
|
-
}), option.description && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
106
|
+
}), option.description && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
98
107
|
variant: "body2",
|
|
99
108
|
color: "text.secondary",
|
|
100
109
|
children: option.description
|
|
101
110
|
})]
|
|
102
111
|
}, option.value))]
|
|
103
|
-
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
112
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormHelperText.default, {
|
|
104
113
|
children: helperText
|
|
105
114
|
})]
|
|
106
115
|
});
|