@canmingir/link 1.2.30 → 1.2.32
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/package.json +1 -1
- package/src/layouts/auth/modern.jsx +49 -84
- package/src/lib/APIDialogAction/APIDialogAction.jsx +4 -5
- package/src/lib/APIParams/APIParams.jsx +2 -2
- package/src/lib/APIPath/APIPath.jsx +2 -2
- package/src/lib/APITree/APITree.jsx +134 -372
- package/src/lib/APITree/Arrow.jsx +10 -9
- package/src/lib/Flow/core/Flow.jsx +26 -13
- package/src/lib/NucDialog/NucDialog.jsx +4 -4
- package/src/lib/ParamTable/ParamTable.jsx +2 -2
- package/src/lib/ResourceMenu/AlertMassage.jsx +2 -2
- package/src/lib/ResourceMenu/DeleteResourceDialog.jsx +9 -6
- package/src/lib/ResourceMenu/ResourceMenu.jsx +5 -8
- package/src/lib/Schema/Schema.jsx +5 -6
- package/src/lib/SchemaEditor/SchemaEditor.jsx +12 -10
- package/src/lib/index.js +1 -0
- package/src/pages/LoginPage.jsx +72 -2
- package/src/widgets/Login/CognitoLogin.jsx +48 -82
- package/src/widgets/Login/DemoLogin.jsx +30 -83
- package/src/widgets/Login/styles.jsx +35 -0
|
@@ -1,411 +1,173 @@
|
|
|
1
|
-
import AddIcon from "@mui/icons-material/Add";
|
|
2
1
|
import ArrowIcon from "./Arrow";
|
|
3
|
-
import
|
|
4
|
-
import DeleteIcon from "@mui/icons-material/Delete";
|
|
5
|
-
import DeleteMethodDialog from "./DeleteMethodDialog";
|
|
6
|
-
import EditIcon from "@mui/icons-material/Edit";
|
|
7
|
-
import Error from "@mui/icons-material/Error";
|
|
8
|
-
import Fade from "@mui/material/Fade";
|
|
9
|
-
import ResourceMenu from "../ResourceMenu";
|
|
2
|
+
import { Error } from "@mui/icons-material";
|
|
10
3
|
import { SimpleTreeView } from "@mui/x-tree-view/SimpleTreeView";
|
|
11
4
|
import { TreeItem } from "@mui/x-tree-view/TreeItem";
|
|
12
|
-
import styles from "./styles";
|
|
13
|
-
import { publish, useEvent } from "@nucleoidai/react-event";
|
|
14
|
-
import { useTheme } from "@mui/material/styles";
|
|
15
5
|
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const [methodDisabled, setMethodDisabled] = useState();
|
|
35
|
-
const [open, setOpen] = useState(false);
|
|
36
|
-
const [resourceMenu, setResourceMenu] = React.useState(false);
|
|
37
|
-
const [anchor, setAnchor] = React.useState();
|
|
38
|
-
const [expanded, setExpanded] = useState([]);
|
|
39
|
-
const [errors] = useEvent("DIAGNOSTICS_COMPLETED", []);
|
|
40
|
-
const theme = useTheme();
|
|
41
|
-
|
|
42
|
-
const [selectedAPI] = useEvent("SELECTED_API_CHANGED", {
|
|
43
|
-
path: "/",
|
|
44
|
-
method: "GET",
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
const [api] = useEvent("API_DATA_CHANGED", []);
|
|
48
|
-
const apiExists = api.length > 0;
|
|
49
|
-
|
|
50
|
-
const expandList = React.useMemo(() => [], []);
|
|
51
|
-
|
|
52
|
-
const handleToggle = (event, ids) => {
|
|
53
|
-
setExpanded(ids);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const handleExpandClick = () => {
|
|
57
|
-
setExpanded([...expandList]);
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
const select = (id, callDispatch = true) => {
|
|
61
|
-
if (map.current[id]) {
|
|
62
|
-
setSelected(id);
|
|
63
|
-
if (callDispatch) {
|
|
64
|
-
publish("SELECTED_API_CHANGED", map.current[id]);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
useEffect(() => {
|
|
70
|
-
const selectedId = Object.keys(map.current).find(
|
|
71
|
-
(key) =>
|
|
72
|
-
map.current[key].path === selectedAPI.path &&
|
|
73
|
-
map.current[key].method === selectedAPI.method
|
|
74
|
-
);
|
|
75
|
-
if (selectedId) {
|
|
76
|
-
select(selectedId, false);
|
|
77
|
-
}
|
|
78
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
79
|
-
}, [selectedAPI]);
|
|
80
|
-
|
|
81
|
-
const handleContextMenu = (event, hash) => {
|
|
82
|
-
event.preventDefault();
|
|
83
|
-
|
|
84
|
-
if (hash) select(hash);
|
|
85
|
-
|
|
86
|
-
setRightClickMethod(hash);
|
|
87
|
-
|
|
88
|
-
setContextMenu(
|
|
89
|
-
!contextMenu
|
|
90
|
-
? {
|
|
91
|
-
mouseX: event.clientX,
|
|
92
|
-
mouseY: event.clientY,
|
|
93
|
-
}
|
|
94
|
-
: null
|
|
95
|
-
);
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
const handleResourceMenu = (event) => {
|
|
99
|
-
event.preventDefault();
|
|
100
|
-
|
|
101
|
-
setResourceMenu(true);
|
|
102
|
-
setAnchor(event);
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
const handleCloseResourceMenu = () => {
|
|
106
|
-
setResourceMenu(false);
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
const handleClose = () => {
|
|
110
|
-
setRightClickMethod(null);
|
|
111
|
-
setContextMenu(null);
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
const editMethod = () => {
|
|
115
|
-
publish("API_DIALOG_OPEN", { type: "method", action: "edit" });
|
|
116
|
-
handleClose();
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
const deleteMethod = () => {
|
|
120
|
-
publish("API_METHOD_DELETE", {});
|
|
121
|
-
setOpen(false);
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
const handleDeleteMethod = () => {
|
|
125
|
-
setOpen(true);
|
|
126
|
-
handleClose();
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
const checkMethodDeletable = () => {
|
|
130
|
-
const countMethodsForPath = (path) => {
|
|
131
|
-
return api.filter((endpoint) => endpoint.path === path).length;
|
|
132
|
-
};
|
|
133
|
-
if (selectedAPI) {
|
|
134
|
-
const apiSelectedPath = selectedAPI.path;
|
|
135
|
-
|
|
136
|
-
return countMethodsForPath(apiSelectedPath) <= 1;
|
|
137
|
-
}
|
|
138
|
-
return false;
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
useEffect(() => {
|
|
142
|
-
if (!selected) {
|
|
143
|
-
select(Object.keys(map.current)[0]);
|
|
144
|
-
}
|
|
145
|
-
setMethodDisabled(checkMethodDeletable());
|
|
146
|
-
handleExpandClick();
|
|
147
|
-
|
|
148
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
149
|
-
}, [selected, api, selectedAPI]);
|
|
6
|
+
import { Box, Tooltip } from "@mui/material";
|
|
7
|
+
import React, { useMemo } from "react";
|
|
8
|
+
|
|
9
|
+
function APITree({
|
|
10
|
+
api = [],
|
|
11
|
+
errors = [],
|
|
12
|
+
theme = {},
|
|
13
|
+
expanded = [],
|
|
14
|
+
selected = null,
|
|
15
|
+
onExpand = () => {},
|
|
16
|
+
onSelect = () => {},
|
|
17
|
+
rightClickMethod = null,
|
|
18
|
+
}) {
|
|
19
|
+
const map = useMemo(() => ({}), []);
|
|
20
|
+
|
|
21
|
+
const treeNodes = useMemo(() => {
|
|
22
|
+
return compile(api, errors, theme, map, rightClickMethod);
|
|
23
|
+
}, [api, errors, theme, map, rightClickMethod]);
|
|
150
24
|
|
|
151
25
|
return (
|
|
152
|
-
<
|
|
153
|
-
{
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
expandIcon: () => <ArrowIcon right />,
|
|
166
|
-
}}
|
|
167
|
-
expandedItems={expanded}
|
|
168
|
-
onExpandedItemsChange={(event, itemIds) => setExpanded(itemIds)}
|
|
169
|
-
selectedItems={selected}
|
|
170
|
-
onSelectedItemsChange={(event, itemId) => select(itemId)}
|
|
171
|
-
sx={{
|
|
172
|
-
marginTop: "10px",
|
|
173
|
-
}}
|
|
174
|
-
>
|
|
175
|
-
{compile(
|
|
176
|
-
api,
|
|
177
|
-
handleContextMenu,
|
|
178
|
-
expandList,
|
|
179
|
-
rightClickMethod,
|
|
180
|
-
errors,
|
|
181
|
-
theme,
|
|
182
|
-
select,
|
|
183
|
-
handleResourceMenu,
|
|
184
|
-
map.current
|
|
185
|
-
)}
|
|
186
|
-
</SimpleTreeView>
|
|
187
|
-
|
|
188
|
-
<Menu
|
|
189
|
-
open={contextMenu !== null}
|
|
190
|
-
onClose={handleClose}
|
|
191
|
-
anchorReference="anchorPosition"
|
|
192
|
-
anchorPosition={
|
|
193
|
-
contextMenu !== null
|
|
194
|
-
? { top: contextMenu.mouseY, left: contextMenu.mouseX }
|
|
195
|
-
: undefined
|
|
196
|
-
}
|
|
197
|
-
slots={{
|
|
198
|
-
transition: Fade
|
|
199
|
-
}}
|
|
200
|
-
>
|
|
201
|
-
<MenuItem
|
|
202
|
-
onClick={() => {
|
|
203
|
-
editMethod();
|
|
204
|
-
}}
|
|
205
|
-
data-cy="edit-method-menu-item"
|
|
206
|
-
>
|
|
207
|
-
<EditIcon />
|
|
208
|
-
<Typography sx={styles.menuItemText}>Edit</Typography>
|
|
209
|
-
</MenuItem>
|
|
210
|
-
<MenuItem
|
|
211
|
-
onClick={handleDeleteMethod}
|
|
212
|
-
disabled={methodDisabled}
|
|
213
|
-
data-cy="delete-method-button"
|
|
214
|
-
>
|
|
215
|
-
<DeleteIcon />
|
|
216
|
-
<Typography sx={styles.menuItemText}>Delete</Typography>
|
|
217
|
-
</MenuItem>
|
|
218
|
-
</Menu>
|
|
219
|
-
<ResourceMenu
|
|
220
|
-
anchor={anchor}
|
|
221
|
-
openMenu={resourceMenu}
|
|
222
|
-
handleClose={handleCloseResourceMenu}
|
|
223
|
-
/>
|
|
224
|
-
</Grid>
|
|
225
|
-
|
|
226
|
-
<CardActions>
|
|
227
|
-
<Fab
|
|
228
|
-
variant="button"
|
|
229
|
-
size={"small"}
|
|
230
|
-
onClick={handleResourceMenu}
|
|
231
|
-
data-cy="resource-menu"
|
|
232
|
-
>
|
|
233
|
-
<AddIcon />
|
|
234
|
-
</Fab>
|
|
235
|
-
</CardActions>
|
|
236
|
-
</>
|
|
237
|
-
) : (
|
|
238
|
-
<BlankTreeMessage item={"API"} />
|
|
239
|
-
)}
|
|
240
|
-
</Card>
|
|
26
|
+
<SimpleTreeView
|
|
27
|
+
slots={{
|
|
28
|
+
collapseIcon: () => <ArrowIcon down />,
|
|
29
|
+
expandIcon: () => <ArrowIcon right />,
|
|
30
|
+
}}
|
|
31
|
+
expandedItems={expanded}
|
|
32
|
+
onExpandedItemsChange={onExpand}
|
|
33
|
+
selectedItems={selected}
|
|
34
|
+
onSelectedItemsChange={onSelect}
|
|
35
|
+
sx={{ marginTop: "10px" }}
|
|
36
|
+
>
|
|
37
|
+
{treeNodes}
|
|
38
|
+
</SimpleTreeView>
|
|
241
39
|
);
|
|
242
40
|
}
|
|
243
41
|
|
|
244
42
|
export const compile = (
|
|
245
43
|
apiData,
|
|
246
|
-
handleContextMenu,
|
|
247
|
-
expandList,
|
|
248
|
-
rightClickMethod,
|
|
249
44
|
errors,
|
|
250
45
|
theme,
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
map
|
|
46
|
+
map,
|
|
47
|
+
rightClickMethod = null
|
|
254
48
|
) => {
|
|
255
|
-
if (apiData.length
|
|
256
|
-
const groupedByPath = apiData.reduce((acc, endpoint) => {
|
|
257
|
-
const parts = endpoint.path.split("/");
|
|
258
|
-
let currentLevel = acc;
|
|
259
|
-
|
|
260
|
-
if (endpoint.path === "/") {
|
|
261
|
-
if (!currentLevel["/"]) {
|
|
262
|
-
currentLevel["/"] = {
|
|
263
|
-
methods: [],
|
|
264
|
-
children: {},
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
currentLevel["/"].methods.push(endpoint);
|
|
268
|
-
} else {
|
|
269
|
-
currentLevel = currentLevel["/"].children;
|
|
270
|
-
|
|
271
|
-
parts.forEach((part, idx, arr) => {
|
|
272
|
-
if (idx !== 0) {
|
|
273
|
-
const currentPart = "/" + part;
|
|
49
|
+
if (!apiData || apiData.length === 0) return null;
|
|
274
50
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
children: {},
|
|
279
|
-
};
|
|
280
|
-
}
|
|
51
|
+
const groupedByPath = apiData.reduce((acc, endpoint) => {
|
|
52
|
+
const parts = endpoint.path.split("/");
|
|
53
|
+
let currentLevel = acc;
|
|
281
54
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
currentLevel = currentLevel[currentPart].children;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
});
|
|
289
|
-
}
|
|
55
|
+
if (!acc["/"]) {
|
|
56
|
+
acc["/"] = { methods: [], children: {} };
|
|
57
|
+
}
|
|
290
58
|
|
|
59
|
+
if (endpoint.path === "/") {
|
|
60
|
+
acc["/"].methods.push(endpoint);
|
|
291
61
|
return acc;
|
|
292
|
-
}
|
|
62
|
+
}
|
|
293
63
|
|
|
294
|
-
|
|
295
|
-
// eslint-disable-next-line
|
|
296
|
-
let resourceHash;
|
|
297
|
-
// eslint-disable-next-line
|
|
64
|
+
currentLevel = acc["/"].children;
|
|
298
65
|
|
|
299
|
-
|
|
300
|
-
|
|
66
|
+
parts.forEach((part, idx) => {
|
|
67
|
+
if (idx === 0) return;
|
|
301
68
|
|
|
302
|
-
|
|
303
|
-
const payload = { path: method.path, method: method.method };
|
|
304
|
-
const hash = (resourceHash = window.btoa(JSON.stringify(payload)));
|
|
305
|
-
map[hash] = payload;
|
|
69
|
+
const currentPart = "/" + part;
|
|
306
70
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
}
|
|
314
|
-
});
|
|
71
|
+
if (!currentLevel[currentPart]) {
|
|
72
|
+
currentLevel[currentPart] = {
|
|
73
|
+
methods: [],
|
|
74
|
+
children: {},
|
|
75
|
+
};
|
|
76
|
+
}
|
|
315
77
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
bgcolor:
|
|
323
|
-
hash === rightClickMethod &&
|
|
324
|
-
(theme.palette.custom?.apiTreeRightClick ||
|
|
325
|
-
theme.palette.action.selected),
|
|
326
|
-
}}
|
|
327
|
-
label={
|
|
328
|
-
<Box
|
|
329
|
-
sx={{
|
|
330
|
-
display: "flex",
|
|
331
|
-
flexDirection: "row",
|
|
332
|
-
alignItems: "center",
|
|
333
|
-
justifyContent: "space-between",
|
|
334
|
-
}}
|
|
335
|
-
data-cy={`method-${method.path}${method.method}`}
|
|
336
|
-
>
|
|
337
|
-
<Box sx={theme.custom?.apiTreeItem}>
|
|
338
|
-
<span
|
|
339
|
-
style={{
|
|
340
|
-
display: "flex",
|
|
341
|
-
flexDirection: "row",
|
|
342
|
-
alignItems: "center",
|
|
343
|
-
justifyContent: "center",
|
|
344
|
-
}}
|
|
345
|
-
>
|
|
346
|
-
{method.method.toUpperCase()}
|
|
347
|
-
</span>
|
|
348
|
-
</Box>
|
|
349
|
-
{error && (
|
|
350
|
-
<Tooltip title={error.messageText} placement={"right"}>
|
|
351
|
-
<Error sx={{ color: "#8f8f91" }} />
|
|
352
|
-
</Tooltip>
|
|
353
|
-
)}
|
|
354
|
-
</Box>
|
|
355
|
-
}
|
|
356
|
-
/>
|
|
357
|
-
);
|
|
358
|
-
});
|
|
78
|
+
if (idx === parts.length - 1) {
|
|
79
|
+
currentLevel[currentPart].methods.push(endpoint);
|
|
80
|
+
} else {
|
|
81
|
+
currentLevel = currentLevel[currentPart].children;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
359
84
|
|
|
360
|
-
|
|
361
|
-
|
|
85
|
+
return acc;
|
|
86
|
+
}, {});
|
|
362
87
|
|
|
363
|
-
|
|
364
|
-
|
|
88
|
+
const renderTree = (data) => {
|
|
89
|
+
return Object.keys(data).map((path) => {
|
|
90
|
+
const { methods, children } = data[path];
|
|
365
91
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
method: firstMethod.method,
|
|
371
|
-
};
|
|
372
|
-
const hash = window.btoa(JSON.stringify(payload));
|
|
373
|
-
select(hash);
|
|
374
|
-
}
|
|
375
|
-
};
|
|
92
|
+
const methodItems = methods.map((method) => {
|
|
93
|
+
const payload = { path: method.path, method: method.method };
|
|
94
|
+
const hash = window.btoa(JSON.stringify(payload));
|
|
95
|
+
map[hash] = payload;
|
|
376
96
|
|
|
377
|
-
const
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
};
|
|
97
|
+
const error = errors.find((item) => {
|
|
98
|
+
const [errPath, errMethod] =
|
|
99
|
+
item?.file?.fileName?.split(".", 2) || [];
|
|
100
|
+
return errPath === method.path && errMethod === method.method;
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const highlightStyle =
|
|
104
|
+
rightClickMethod === hash
|
|
105
|
+
? {
|
|
106
|
+
bgcolor: theme?.palette?.custom?.apiTreeRightClick || "#e0e0e0",
|
|
107
|
+
}
|
|
108
|
+
: {};
|
|
382
109
|
|
|
383
110
|
return (
|
|
384
111
|
<TreeItem
|
|
385
|
-
key={
|
|
386
|
-
itemId={
|
|
112
|
+
key={hash}
|
|
113
|
+
itemId={hash}
|
|
114
|
+
sx={highlightStyle}
|
|
387
115
|
label={
|
|
388
|
-
<
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
116
|
+
<Box
|
|
117
|
+
sx={{
|
|
118
|
+
display: "flex",
|
|
119
|
+
flexDirection: "row",
|
|
120
|
+
alignItems: "center",
|
|
121
|
+
justifyContent: "space-between",
|
|
122
|
+
}}
|
|
123
|
+
data-cy={`method-${method.path}${method.method}`}
|
|
394
124
|
>
|
|
395
|
-
|
|
396
|
-
|
|
125
|
+
<Box>
|
|
126
|
+
<span
|
|
127
|
+
style={{
|
|
128
|
+
display: "flex",
|
|
129
|
+
alignItems: "center",
|
|
130
|
+
justifyContent: "center",
|
|
131
|
+
}}
|
|
132
|
+
>
|
|
133
|
+
{method.method.toUpperCase()}
|
|
134
|
+
</span>
|
|
135
|
+
</Box>
|
|
136
|
+
|
|
137
|
+
{error && (
|
|
138
|
+
<Tooltip title={error.messageText} placement="right">
|
|
139
|
+
<Error sx={{ color: "#8f8f91" }} />
|
|
140
|
+
</Tooltip>
|
|
141
|
+
)}
|
|
142
|
+
</Box>
|
|
397
143
|
}
|
|
398
|
-
|
|
399
|
-
{[...methodItems, ...childItems]}
|
|
400
|
-
</TreeItem>
|
|
144
|
+
/>
|
|
401
145
|
);
|
|
402
146
|
});
|
|
403
|
-
};
|
|
404
147
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
148
|
+
const childItems = children ? renderTree(children) : [];
|
|
149
|
+
|
|
150
|
+
return (
|
|
151
|
+
<TreeItem
|
|
152
|
+
key={path}
|
|
153
|
+
itemId={path}
|
|
154
|
+
label={
|
|
155
|
+
<div
|
|
156
|
+
className="path"
|
|
157
|
+
style={{ cursor: "default" }}
|
|
158
|
+
data-cy={`path-${path}`}
|
|
159
|
+
>
|
|
160
|
+
{path}
|
|
161
|
+
</div>
|
|
162
|
+
}
|
|
163
|
+
>
|
|
164
|
+
{[...methodItems, ...childItems]}
|
|
165
|
+
</TreeItem>
|
|
166
|
+
);
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
return renderTree(groupedByPath);
|
|
409
171
|
};
|
|
410
172
|
|
|
411
173
|
export default APITree;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
|
|
2
|
-
import KeyboardArrowLeftIcon from "@mui/icons-material/KeyboardArrowLeft";
|
|
3
|
-
import KeyboardArrowRightIcon from "@mui/icons-material/KeyboardArrowRight";
|
|
4
|
-
import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp";
|
|
5
1
|
import React from "react";
|
|
6
2
|
|
|
7
|
-
|
|
3
|
+
import {
|
|
4
|
+
KeyboardArrowDown,
|
|
5
|
+
KeyboardArrowLeft,
|
|
6
|
+
KeyboardArrowRight,
|
|
7
|
+
KeyboardArrowUp,
|
|
8
|
+
} from "@mui/icons-material";
|
|
8
9
|
|
|
9
10
|
function Arrow({ up, down, right, left }) {
|
|
10
11
|
return up ? (
|
|
11
|
-
<
|
|
12
|
+
<KeyboardArrowUp />
|
|
12
13
|
) : down ? (
|
|
13
|
-
<
|
|
14
|
+
<KeyboardArrowDown />
|
|
14
15
|
) : right ? (
|
|
15
|
-
<
|
|
16
|
+
<KeyboardArrowRight />
|
|
16
17
|
) : left ? (
|
|
17
|
-
<
|
|
18
|
+
<KeyboardArrowLeft />
|
|
18
19
|
) : null;
|
|
19
20
|
}
|
|
20
21
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import FlowNode from "./FlowNode";
|
|
2
2
|
import { useGraphOperations } from "../hooks/useGraphOperations";
|
|
3
3
|
|
|
4
|
+
import { Box, alpha } from "@mui/material";
|
|
4
5
|
import React, { useMemo, useState } from "react";
|
|
5
6
|
import { assertLinkedGraph, buildTreeFromLinked } from "../utils/flowUtils";
|
|
6
7
|
|
|
@@ -62,19 +63,31 @@ export const Flow = ({
|
|
|
62
63
|
}, [nodesById, roots]);
|
|
63
64
|
|
|
64
65
|
return (
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
66
|
+
<Box
|
|
67
|
+
sx={{
|
|
68
|
+
backgroundImage: (theme) => `
|
|
69
|
+
radial-gradient(
|
|
70
|
+
${alpha(theme.palette.divider, 0.08)} 1px,
|
|
71
|
+
transparent 1px
|
|
72
|
+
)
|
|
73
|
+
`,
|
|
74
|
+
backgroundSize: "16px 16px",
|
|
75
|
+
}}
|
|
76
|
+
>
|
|
77
|
+
<FlowNode
|
|
78
|
+
node={treeData}
|
|
79
|
+
variant={variant}
|
|
80
|
+
style={style}
|
|
81
|
+
plugin={plugin}
|
|
82
|
+
isRoot={true}
|
|
83
|
+
nodesById={allNodesById}
|
|
84
|
+
onPaste={editable ? handlePaste : undefined}
|
|
85
|
+
onCut={editable ? handleCut : undefined}
|
|
86
|
+
onConnect={editable ? handleConnect : undefined}
|
|
87
|
+
floatingNodes={floatingNodes}
|
|
88
|
+
height={height}
|
|
89
|
+
/>
|
|
90
|
+
</Box>
|
|
78
91
|
);
|
|
79
92
|
};
|
|
80
93
|
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { Close } from "@mui/icons-material";
|
|
2
|
-
import Fullscreen from "@mui/icons-material/Fullscreen";
|
|
3
|
-
import FullscreenExit from "@mui/icons-material/FullscreenExit";
|
|
4
1
|
import React from "react";
|
|
5
2
|
|
|
3
|
+
import { Close, Fullscreen, FullscreenExit } from "@mui/icons-material";
|
|
6
4
|
import {
|
|
7
5
|
Dialog,
|
|
8
6
|
DialogActions,
|
|
@@ -12,7 +10,7 @@ import {
|
|
|
12
10
|
} from "@mui/material";
|
|
13
11
|
import { storage, useStorage } from "@nucleoidjs/webstorage";
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
function NucDialog({
|
|
16
14
|
title,
|
|
17
15
|
minWidth = 600,
|
|
18
16
|
children,
|
|
@@ -106,3 +104,5 @@ export default function NucDialog({
|
|
|
106
104
|
</Dialog>
|
|
107
105
|
);
|
|
108
106
|
}
|
|
107
|
+
|
|
108
|
+
export default NucDialog;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataGrid } from "@mui/x-data-grid";
|
|
2
|
-
import
|
|
2
|
+
import { HighlightOff } from "@mui/icons-material";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import TypeMenu from "./TypeMenu";
|
|
5
5
|
import styles from "./styles";
|
|
@@ -100,7 +100,7 @@ const ParamTable = ({ types, params, setParams }) => {
|
|
|
100
100
|
onClick={() => removeParam(id)}
|
|
101
101
|
size="large"
|
|
102
102
|
>
|
|
103
|
-
<
|
|
103
|
+
<HighlightOff />
|
|
104
104
|
</IconButton>
|
|
105
105
|
);
|
|
106
106
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Alert } from "@mui/material";
|
|
2
1
|
import React from "react";
|
|
3
|
-
|
|
2
|
+
|
|
3
|
+
import { Alert, Snackbar } from "@mui/material";
|
|
4
4
|
|
|
5
5
|
export default function AlertMassage({ message }) {
|
|
6
6
|
const [open, setOpen] = React.useState(true);
|