@abtnode/ux 1.15.17 → 1.16.0-beta-b16cb035
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/actions.js +111 -0
- package/lib/blocklet/access/config-access.js +303 -0
- package/lib/blocklet/access/index.js +221 -0
- package/lib/blocklet/actions.js +438 -0
- package/lib/blocklet/add-cert.js +191 -0
- package/lib/blocklet/agreement-app.js +30 -0
- package/lib/blocklet/agreement.js +72 -0
- package/lib/blocklet/app-avatar.js +74 -0
- package/lib/blocklet/audit-logs.js +197 -0
- package/lib/blocklet/blocklet-source.js +56 -0
- package/lib/blocklet/bundle-avatar.js +80 -0
- package/lib/blocklet/component/add.js +1063 -0
- package/lib/blocklet/component/configuration.js +124 -0
- package/lib/blocklet/component/delete.js +117 -0
- package/lib/blocklet/component/environment.js +289 -0
- package/lib/blocklet/component/expiration.js +53 -0
- package/lib/blocklet/component/index.js +804 -0
- package/lib/blocklet/component/line.js +28 -0
- package/lib/blocklet/component/navigation/locale-tabs.js +218 -0
- package/lib/blocklet/component/navigation/navigation-actions.js +120 -0
- package/lib/blocklet/component/navigation/navigation-dialog.js +620 -0
- package/lib/blocklet/component/navigation/navigation-preview.js +102 -0
- package/lib/blocklet/component/navigation/simple-select.js +131 -0
- package/lib/blocklet/component/select-store.js +153 -0
- package/lib/blocklet/component/setting.js +151 -0
- package/lib/blocklet/component/sortable-tree.js +138 -0
- package/lib/blocklet/component/space-gateway-selector.js +174 -0
- package/lib/blocklet/component/store-blocklet-list.js +205 -0
- package/lib/blocklet/config-navigation.js +344 -0
- package/lib/blocklet/configuration.js +574 -0
- package/lib/blocklet/disk-info.js +91 -0
- package/lib/blocklet/icons.js +26 -0
- package/lib/blocklet/install-from-url.js +347 -0
- package/lib/blocklet/log.js +62 -0
- package/lib/blocklet/migration.js +153 -0
- package/lib/blocklet/mode.js +35 -0
- package/lib/blocklet/monitor.js +186 -0
- package/lib/blocklet/overview.js +236 -0
- package/lib/blocklet/preferences/app-sk.js +131 -0
- package/lib/blocklet/preferences/index.js +238 -0
- package/lib/blocklet/preferences/wallet-type.js +107 -0
- package/lib/blocklet/purchase/common.js +103 -0
- package/lib/blocklet/purchase/component-purchase.js +253 -0
- package/lib/blocklet/purchase/index.js +13 -0
- package/lib/blocklet/router/action/add-domain-alias.js +173 -0
- package/lib/blocklet/router/action/add-rule.js +204 -0
- package/lib/blocklet/router/action/config-routing-rule.js +129 -0
- package/lib/blocklet/router/action/delete-domain-alias.js +107 -0
- package/lib/blocklet/router/action/delete-rule.js +114 -0
- package/lib/blocklet/router/action/update-rule.js +203 -0
- package/lib/blocklet/router/domain-actions.js +71 -0
- package/lib/blocklet/router/domain-status.js +96 -0
- package/lib/blocklet/router/rule-actions.js +77 -0
- package/lib/blocklet/router/rule-list.js +181 -0
- package/lib/blocklet/router/util.js +146 -0
- package/lib/blocklet/runtime-info.js +87 -0
- package/lib/blocklet/status.js +105 -0
- package/lib/blocklet/storage.js +322 -0
- package/lib/blocklet/types.js +25 -0
- package/lib/blocklet/util.js +213 -0
- package/lib/blocklet/version.js +156 -0
- package/lib/card-selector.js +109 -0
- package/lib/certificate.js +110 -0
- package/lib/click-to-copy.js +38 -0
- package/lib/confirm.js +149 -0
- package/lib/contexts/audit-log.js +141 -0
- package/lib/contexts/blocklet.js +19 -0
- package/lib/contexts/deleting-blocklets.js +78 -0
- package/lib/contexts/node.js +30 -0
- package/lib/contexts/session.js +20 -0
- package/lib/contexts/team.js +19 -0
- package/lib/delete-confirm.js +127 -0
- package/lib/did-address.js +77 -0
- package/lib/dot.js +18 -0
- package/lib/form/form-text-input.js +266 -0
- package/lib/form/form-wrapper.js +13 -0
- package/lib/form/required.js +13 -0
- package/lib/hooks/blocklet.js +231 -0
- package/lib/hooks/mobile-width.js +19 -0
- package/lib/hooks/url-evaluation.js +168 -0
- package/lib/hooks/use-app-logo.js +25 -0
- package/lib/hooks/use-bundle-logo.js +36 -0
- package/lib/hooks/use-navigation.js +355 -0
- package/lib/hooks/use-passport-id.js +21 -0
- package/lib/hooks/use-subscription.js +28 -0
- package/lib/icons/long-arrow.svg +5 -0
- package/lib/index.js +0 -3
- package/lib/invitation/invitation-app.js +51 -0
- package/lib/invitation/invitation-login.js +47 -0
- package/lib/invitation/invitation-passport.js +130 -0
- package/lib/invitation/invitation-receive.js +108 -0
- package/lib/invitation/invitation-success.js +82 -0
- package/lib/invitation/invitation-user.js +79 -0
- package/lib/invitation/invitation.js +80 -0
- package/lib/issue-passport.js +84 -84
- package/lib/launch-blocklet/content-layout.js +33 -0
- package/lib/launch-blocklet/page-header.js +38 -0
- package/lib/layout/addon.js +100 -0
- package/lib/layout/feedback.js +55 -0
- package/lib/locales/en.js +1221 -10
- package/lib/locales/index.js +3 -4
- package/lib/locales/zh.js +1232 -15
- package/lib/logs/clock.js +19 -0
- package/lib/logs/download.js +139 -0
- package/lib/logs/log-terminal.js +183 -0
- package/lib/lost-passport.js +191 -195
- package/lib/monitor/card.js +73 -0
- package/lib/monitor/cpu.js +109 -0
- package/lib/monitor/disk.js +122 -0
- package/lib/monitor/memory.js +144 -0
- package/lib/nav-logo.js +120 -0
- package/lib/passport-tag.js +43 -0
- package/lib/permission.js +70 -0
- package/lib/relative-time.js +61 -0
- package/lib/schema-form/color-input.js +105 -0
- package/lib/schema-form/common-prop-types.js +21 -0
- package/lib/schema-form/index.js +229 -0
- package/lib/schema-form/passport-input.js +66 -0
- package/lib/schema-form/text-input.js +72 -0
- package/lib/store/add.js +185 -0
- package/lib/store/delete.js +102 -0
- package/lib/store/item.js +84 -0
- package/lib/table-icons.js +42 -0
- package/lib/table.js +13 -0
- package/lib/tag.js +37 -0
- package/lib/team/members/actions.js +99 -0
- package/lib/team/members/index.js +503 -0
- package/lib/team/members/invitations.js +196 -0
- package/lib/team/members/invite-member.js +212 -0
- package/lib/team/members/issue-passport.js +155 -0
- package/lib/team/members/member.js +300 -0
- package/lib/team/members/passport-issuances.js +154 -0
- package/lib/team/members/passports.js +336 -0
- package/lib/team/members/toggle-user-approval.js +128 -0
- package/lib/team/members/transfer-node.js +262 -0
- package/lib/team/members/util.js +20 -0
- package/lib/team/passports/color.js +132 -0
- package/lib/team/passports/detail.js +271 -0
- package/lib/team/passports/index.js +233 -0
- package/lib/team/passports/mutate-role.js +204 -0
- package/lib/team/passports/trusted-issuer.js +297 -0
- package/lib/team/passports/trusted-issuers.js +240 -0
- package/lib/team/search-input.js +38 -0
- package/lib/team/styles/dialog.js +13 -0
- package/lib/team/styles/list-header.js +13 -0
- package/lib/toast.js +86 -0
- package/lib/util/api.js +21 -0
- package/lib/util/constants.js +10 -0
- package/lib/util/index.js +703 -0
- package/lib/util/locales.js +28 -0
- package/lib/util/mode.js +11 -0
- package/lib/who-can-access/config.js +46 -0
- package/lib/wrap-locale.js +12 -13
- package/package.json +69 -17
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _material = require("@mui/material");
|
|
9
|
+
var _lab = require("@mui/lab");
|
|
10
|
+
var _react2 = require("@iconify/react");
|
|
11
|
+
var _notistack = require("notistack");
|
|
12
|
+
var _ahooks = require("ahooks");
|
|
13
|
+
var _Dialog = require("@arcblock/ux/lib/Dialog");
|
|
14
|
+
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
15
|
+
var _Session = require("@arcblock/did-connect/lib/Session");
|
|
16
|
+
var _sortableTree = _interopRequireDefault(require("./component/sortable-tree"));
|
|
17
|
+
var _navigationDialog = _interopRequireDefault(require("./component/navigation/navigation-dialog"));
|
|
18
|
+
var _navigationActions = _interopRequireDefault(require("./component/navigation/navigation-actions"));
|
|
19
|
+
var _useNavigation = _interopRequireDefault(require("../hooks/use-navigation"));
|
|
20
|
+
var _blocklet = require("../contexts/blocklet");
|
|
21
|
+
var _navigationPreview = _interopRequireDefault(require("./component/navigation/navigation-preview"));
|
|
22
|
+
var _team = require("../contexts/team");
|
|
23
|
+
var _util = require("../util");
|
|
24
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
|
+
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; }
|
|
27
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
28
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
29
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
30
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
31
|
+
const mockSession = {
|
|
32
|
+
login: () => {},
|
|
33
|
+
logout: () => {},
|
|
34
|
+
switch: () => {},
|
|
35
|
+
switchDid: () => {},
|
|
36
|
+
switchProfile: () => {},
|
|
37
|
+
switchPassport: () => {}
|
|
38
|
+
};
|
|
39
|
+
const navigationTypeMap = {
|
|
40
|
+
header: 'Header',
|
|
41
|
+
footer: 'Footer',
|
|
42
|
+
bottom: 'Footer Link',
|
|
43
|
+
social: 'Footer Social',
|
|
44
|
+
dashboard: 'Dashboard',
|
|
45
|
+
sessionManager: 'SessionManager'
|
|
46
|
+
};
|
|
47
|
+
function ConfigNavigation() {
|
|
48
|
+
const {
|
|
49
|
+
t
|
|
50
|
+
} = (0, _context.useLocaleContext)();
|
|
51
|
+
const {
|
|
52
|
+
blocklet
|
|
53
|
+
} = (0, _blocklet.useBlockletContext)();
|
|
54
|
+
const refNavigationDialog = (0, _react.useRef)(null);
|
|
55
|
+
const {
|
|
56
|
+
roles
|
|
57
|
+
} = (0, _team.useTeamContext)();
|
|
58
|
+
const {
|
|
59
|
+
enqueueSnackbar
|
|
60
|
+
} = (0, _notistack.useSnackbar)();
|
|
61
|
+
const pageState = (0, _ahooks.useReactive)({
|
|
62
|
+
saveLoading: false,
|
|
63
|
+
resetLoading: false,
|
|
64
|
+
showResetConfirm: false,
|
|
65
|
+
mockRole: 'owner'
|
|
66
|
+
});
|
|
67
|
+
const {
|
|
68
|
+
state: navigationState,
|
|
69
|
+
navigation,
|
|
70
|
+
getNavigation,
|
|
71
|
+
saveNavigationList,
|
|
72
|
+
resetNavigation,
|
|
73
|
+
updateActiveSection,
|
|
74
|
+
updateNavigationTree,
|
|
75
|
+
updateNavigationItem,
|
|
76
|
+
delNavigationItem,
|
|
77
|
+
addNavigationItem
|
|
78
|
+
} = (0, _useNavigation.default)();
|
|
79
|
+
const handleAddNavigation = (0, _react.useCallback)(params => {
|
|
80
|
+
refNavigationDialog.current.add({
|
|
81
|
+
parent: params
|
|
82
|
+
}, (close, data) => {
|
|
83
|
+
addNavigationItem(data);
|
|
84
|
+
close();
|
|
85
|
+
});
|
|
86
|
+
}, [addNavigationItem]);
|
|
87
|
+
const handleEditNavigation = (0, _react.useCallback)(function (type) {
|
|
88
|
+
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
89
|
+
switch (type) {
|
|
90
|
+
case 'edit':
|
|
91
|
+
refNavigationDialog.current.edit(params, (close, data) => {
|
|
92
|
+
updateNavigationItem(data);
|
|
93
|
+
close();
|
|
94
|
+
});
|
|
95
|
+
break;
|
|
96
|
+
case 'toggle':
|
|
97
|
+
updateNavigationItem({
|
|
98
|
+
id: params.id,
|
|
99
|
+
visible: !params.visible
|
|
100
|
+
});
|
|
101
|
+
break;
|
|
102
|
+
case 'del':
|
|
103
|
+
delNavigationItem(params.id);
|
|
104
|
+
break;
|
|
105
|
+
default:
|
|
106
|
+
}
|
|
107
|
+
}, [delNavigationItem, updateNavigationItem]);
|
|
108
|
+
const handleSaveNavigation = (0, _react.useCallback)(async () => {
|
|
109
|
+
try {
|
|
110
|
+
pageState.saveLoading = true;
|
|
111
|
+
await saveNavigationList(navigationState.rawNavigation);
|
|
112
|
+
enqueueSnackbar('保存成功', {
|
|
113
|
+
variant: 'success'
|
|
114
|
+
});
|
|
115
|
+
} catch (e) {
|
|
116
|
+
enqueueSnackbar( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
117
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
118
|
+
variant: "subtitle2",
|
|
119
|
+
children: t('navigation.actionFailed')
|
|
120
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
121
|
+
variant: "body1",
|
|
122
|
+
children: (0, _util.formatError)(e) || e.error
|
|
123
|
+
})]
|
|
124
|
+
}), {
|
|
125
|
+
variant: 'error'
|
|
126
|
+
});
|
|
127
|
+
} finally {
|
|
128
|
+
pageState.saveLoading = false;
|
|
129
|
+
}
|
|
130
|
+
}, [enqueueSnackbar, navigationState.rawNavigation, pageState, saveNavigationList, t]);
|
|
131
|
+
const handleResetNavigation = (0, _react.useCallback)(async () => {
|
|
132
|
+
try {
|
|
133
|
+
pageState.resetLoading = true;
|
|
134
|
+
await resetNavigation();
|
|
135
|
+
enqueueSnackbar('重置成功', {
|
|
136
|
+
variant: 'success'
|
|
137
|
+
});
|
|
138
|
+
} catch (e) {
|
|
139
|
+
enqueueSnackbar( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
140
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
141
|
+
variant: "subtitle2",
|
|
142
|
+
children: t('navigation.actionFailed')
|
|
143
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
144
|
+
variant: "body1",
|
|
145
|
+
children: (0, _util.formatError)(e) || e.error
|
|
146
|
+
})]
|
|
147
|
+
}), {
|
|
148
|
+
variant: 'error'
|
|
149
|
+
});
|
|
150
|
+
} finally {
|
|
151
|
+
pageState.resetLoading = false;
|
|
152
|
+
}
|
|
153
|
+
}, [enqueueSnackbar, pageState, resetNavigation, t]);
|
|
154
|
+
const sessionCtxValue = (0, _react.useMemo)(() => {
|
|
155
|
+
return {
|
|
156
|
+
session: _objectSpread(_objectSpread({}, mockSession), {}, {
|
|
157
|
+
user: {
|
|
158
|
+
did: blocklet.appDid,
|
|
159
|
+
fullName: 'Preview User',
|
|
160
|
+
role: pageState.mockRole
|
|
161
|
+
}
|
|
162
|
+
})
|
|
163
|
+
};
|
|
164
|
+
}, [blocklet.appDid, pageState.mockRole]);
|
|
165
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
166
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ButtonGroup, {
|
|
167
|
+
variant: "outlined",
|
|
168
|
+
children: Object.keys(navigationTypeMap).map(key => {
|
|
169
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Button, {
|
|
170
|
+
variant: navigationState.activeSection === key ? 'contained' : undefined,
|
|
171
|
+
onClick: () => updateActiveSection(key),
|
|
172
|
+
children: [navigationTypeMap[key], " (".concat(getNavigation(key).length, ")")]
|
|
173
|
+
}, key);
|
|
174
|
+
})
|
|
175
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Toolbar, {
|
|
176
|
+
variant: "dense",
|
|
177
|
+
sx: {
|
|
178
|
+
paddingLeft: '0px !important',
|
|
179
|
+
paddingRight: '0px !important',
|
|
180
|
+
mt: 2
|
|
181
|
+
},
|
|
182
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
183
|
+
variant: "h6",
|
|
184
|
+
component: "div",
|
|
185
|
+
sx: {
|
|
186
|
+
flexGrow: 1
|
|
187
|
+
},
|
|
188
|
+
children: "Config"
|
|
189
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ButtonGroup, {
|
|
190
|
+
variant: "outlined",
|
|
191
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lab.LoadingButton, {
|
|
192
|
+
size: "small",
|
|
193
|
+
variant: "outlined",
|
|
194
|
+
color: "error",
|
|
195
|
+
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Icon, {
|
|
196
|
+
icon: "system-uicons:reset"
|
|
197
|
+
}),
|
|
198
|
+
sx: {
|
|
199
|
+
mr: 2
|
|
200
|
+
},
|
|
201
|
+
loading: pageState.resetLoading,
|
|
202
|
+
loadingPosition: "start",
|
|
203
|
+
onClick: () => {
|
|
204
|
+
pageState.showResetConfirm = true;
|
|
205
|
+
},
|
|
206
|
+
children: "\u91CD\u7F6E"
|
|
207
|
+
})
|
|
208
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.ButtonGroup, {
|
|
209
|
+
variant: "outlined",
|
|
210
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
211
|
+
size: "small",
|
|
212
|
+
variant: "outlined",
|
|
213
|
+
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Icon, {
|
|
214
|
+
icon: "mdi:plus"
|
|
215
|
+
}),
|
|
216
|
+
onClick: () => handleAddNavigation(),
|
|
217
|
+
children: "\u65B0\u5EFA"
|
|
218
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_lab.LoadingButton, {
|
|
219
|
+
size: "small",
|
|
220
|
+
variant: "contained",
|
|
221
|
+
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Icon, {
|
|
222
|
+
icon: "mdi:content-save"
|
|
223
|
+
}),
|
|
224
|
+
loading: pageState.saveLoading,
|
|
225
|
+
loadingPosition: "start",
|
|
226
|
+
onClick: handleSaveNavigation,
|
|
227
|
+
children: "\u4FDD\u5B58"
|
|
228
|
+
})]
|
|
229
|
+
})]
|
|
230
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Paper, {
|
|
231
|
+
variant: "outlined",
|
|
232
|
+
sx: {
|
|
233
|
+
display: 'flex',
|
|
234
|
+
height: 280,
|
|
235
|
+
overflow: 'hidden'
|
|
236
|
+
},
|
|
237
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Paper, {
|
|
238
|
+
elevation: 0,
|
|
239
|
+
sx: {
|
|
240
|
+
flex: 1,
|
|
241
|
+
overflow: 'auto'
|
|
242
|
+
},
|
|
243
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sortableTree.default, {
|
|
244
|
+
treeData: getNavigation(navigationState.activeSection),
|
|
245
|
+
setTreeData: updateNavigationTree,
|
|
246
|
+
renderActions: _ref => {
|
|
247
|
+
let {
|
|
248
|
+
data,
|
|
249
|
+
className
|
|
250
|
+
} = _ref;
|
|
251
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_navigationActions.default, {
|
|
252
|
+
data: data,
|
|
253
|
+
className: className,
|
|
254
|
+
section: navigationState.activeSection,
|
|
255
|
+
add: function add() {
|
|
256
|
+
return handleAddNavigation(...arguments);
|
|
257
|
+
},
|
|
258
|
+
del: function del() {
|
|
259
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
260
|
+
args[_key] = arguments[_key];
|
|
261
|
+
}
|
|
262
|
+
return handleEditNavigation('del', ...args);
|
|
263
|
+
},
|
|
264
|
+
edit: function edit() {
|
|
265
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
266
|
+
args[_key2] = arguments[_key2];
|
|
267
|
+
}
|
|
268
|
+
return handleEditNavigation('edit', ...args);
|
|
269
|
+
},
|
|
270
|
+
toggle: function toggle() {
|
|
271
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
272
|
+
args[_key3] = arguments[_key3];
|
|
273
|
+
}
|
|
274
|
+
return handleEditNavigation('toggle', ...args);
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
})
|
|
279
|
+
})
|
|
280
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Toolbar, {
|
|
281
|
+
variant: "dense",
|
|
282
|
+
sx: {
|
|
283
|
+
paddingLeft: '0px !important',
|
|
284
|
+
paddingRight: '0px !important',
|
|
285
|
+
mt: 3
|
|
286
|
+
},
|
|
287
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
288
|
+
variant: "h6",
|
|
289
|
+
component: "div",
|
|
290
|
+
sx: {
|
|
291
|
+
flexGrow: 1
|
|
292
|
+
},
|
|
293
|
+
children: "Preview"
|
|
294
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.FormControl, {
|
|
295
|
+
sx: {
|
|
296
|
+
m: 1,
|
|
297
|
+
minWidth: 120
|
|
298
|
+
},
|
|
299
|
+
size: "small",
|
|
300
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.InputLabel, {
|
|
301
|
+
children: "Role"
|
|
302
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Select, {
|
|
303
|
+
value: pageState.mockRole,
|
|
304
|
+
label: "Role",
|
|
305
|
+
onChange: e => {
|
|
306
|
+
pageState.mockRole = e.target.value;
|
|
307
|
+
},
|
|
308
|
+
children: roles.map(item => /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.MenuItem, {
|
|
309
|
+
value: item.name,
|
|
310
|
+
children: item.title
|
|
311
|
+
}, item.name))
|
|
312
|
+
})]
|
|
313
|
+
})]
|
|
314
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Paper, {
|
|
315
|
+
variant: "outlined",
|
|
316
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Session.SessionContext.Provider, {
|
|
317
|
+
value: sessionCtxValue,
|
|
318
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_navigationPreview.default, {
|
|
319
|
+
navigation: navigation
|
|
320
|
+
})
|
|
321
|
+
})
|
|
322
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_navigationDialog.default, {
|
|
323
|
+
ref: refNavigationDialog,
|
|
324
|
+
section: navigationState.activeSection,
|
|
325
|
+
components: navigationState.components,
|
|
326
|
+
rawNavigations: navigationState.rawNavigation
|
|
327
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.Confirm, {
|
|
328
|
+
open: pageState.showResetConfirm,
|
|
329
|
+
title: "\u662F\u5426\u6E05\u7A7A\u6240\u6709\u81EA\u5B9A\u4E49\u5BFC\u822A",
|
|
330
|
+
onConfirm: async () => {
|
|
331
|
+
await handleResetNavigation();
|
|
332
|
+
pageState.showResetConfirm = false;
|
|
333
|
+
},
|
|
334
|
+
onCancel: () => {
|
|
335
|
+
pageState.showResetConfirm = false;
|
|
336
|
+
},
|
|
337
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
338
|
+
children: "\u6E05\u7A7A\u540E\uFF0C\u5BFC\u822A\u4F1A\u6062\u590D\u5230 Blocklet \u539F\u6709\u9ED8\u8BA4\u7684\u914D\u7F6E"
|
|
339
|
+
})
|
|
340
|
+
})]
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
var _default = ConfigNavigation;
|
|
344
|
+
exports.default = _default;
|