@cccsaurora/clue-ui 1.0.0-dev.49 → 1.0.0
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/ActionForm-WIj7BfD5.js +340 -0
- package/AnnotationPreview-DWRDhxUB.js +140 -0
- package/ClueEnrichContext-CbJVBm4w.js +397 -0
- package/FlexOne-BXWFOd1T.js +6 -0
- package/_Map-DXNg_Z-q.js +54 -0
- package/_MapCache-Cu25RRDU.js +129 -0
- package/_Uint8Array-DlJCtTvG.js +102 -0
- package/_baseAssignValue-CUmzp727.js +20 -0
- package/_baseClone-BlMmRXeX.js +208 -0
- package/_baseExtremum-P_0akmCi.js +27 -0
- package/_baseFlatten-CN7vDNEQ.js +72 -0
- package/_baseGet-Dgf6_xCm.js +80 -0
- package/_baseIsEqual-Cpjtfb3Q.js +173 -0
- package/_baseIteratee-CP1bocOX.js +95 -0
- package/_baseSlice-M5RKzt1A.js +10 -0
- package/_baseSum-wEbgNeUs.js +10 -0
- package/_baseUniq-tMFmk80M.js +61 -0
- package/_commonjsHelpers-C6fGbg64.js +6 -0
- package/_createAggregator-B4Cav8ZM.js +53 -0
- package/_getPrototype-CHAFQYL_.js +5 -0
- package/_getTag-BV_UoLYG.js +90 -0
- package/cloneDeep-BPVpFBzJ.js +8 -0
- package/components/AnnotationBody.js +34 -49
- package/components/AnnotationDetailPopover.js +30 -36
- package/components/AnnotationDetails.js +94 -109
- package/components/AnnotationEntry.js +52 -55
- package/components/AnnotationPreview.js +5 -5
- package/components/ClassificationChip.js +23 -44
- package/components/CountBadge.js +26 -31
- package/components/EnrichedCard.js +92 -104
- package/components/EnrichedChip.js +109 -134
- package/components/EnrichedTypography.js +110 -136
- package/components/ErrorBoundary.js +24 -28
- package/components/RetryFailedEnrichments.js +9 -10
- package/components/SourcePicker.js +49 -57
- package/components/actions/ActionForm.js +4 -4
- package/components/actions/ExecutePopover.js +50 -64
- package/components/actions/ResultModal.js +34 -37
- package/components/actions/form/schemaAdapter.js +20 -39
- package/components/display/graph/ExpandMoreButton.js +10 -10
- package/components/display/graph/elements/NodeCard.js +76 -92
- package/components/display/graph/elements/NodeTag.js +13 -15
- package/components/display/graph/index.js +200 -258
- package/components/display/graph/visualizations/Leaf.js +69 -88
- package/components/display/graph/visualizations/cloud/index.js +81 -98
- package/components/display/graph/visualizations/icons/BaseIcon.js +21 -26
- package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
- package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
- package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
- package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
- package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
- package/components/display/graph/visualizations/icons/index.js +13 -14
- package/components/display/graph/visualizations/panels/NodePanel.js +8 -10
- package/components/display/graph/visualizations/tree/BundleLine.js +81 -108
- package/components/display/graph/visualizations/tree/Triangle.js +13 -13
- package/components/display/graph/visualizations/tree/index.js +305 -407
- package/components/display/icons/Iconified.js +12 -27
- package/components/display/json/index.js +4 -4
- package/components/display/markdown/DynamicTabs.js +17 -22
- package/components/display/markdown/index.js +5674 -8531
- package/components/display/markdown/markdownPlugins/tabs.js +1 -1
- package/components/enrichment/EnrichPopover.js +47 -55
- package/components/fetchers/Fetcher.js +95 -123
- package/components/fetchers/PreviewModal.js +17 -20
- package/components/fetchers/StatusChip.js +18 -22
- package/components/group/Entry.js +11 -13
- package/components/group/Group.js +10 -13
- package/components/group/GroupControl.js +65 -76
- package/components/stats/QueryStatus.js +28 -37
- package/countBy-DOutsa_w.js +8 -0
- package/data/event.js +4 -6
- package/database/index.js +2 -2
- package/debounce-DryYcbJ4.js +56 -0
- package/get-Bow1vKwx.js +8 -0
- package/groupBy-BheQYl6f.js +8 -0
- package/hooks/ClueActionContext.js +6 -6
- package/hooks/ClueComponentContext.js +23 -29
- package/hooks/ClueConfigProvider.js +12 -14
- package/hooks/ClueDatabaseContext.js +13 -19
- package/hooks/ClueEnrichContext.js +8 -8
- package/hooks/ClueFetcherContext.js +46 -74
- package/hooks/ClueGroupContext.js +14 -17
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +10 -12
- package/hooks/selectors.js +11 -22
- package/hooks/useAnnotations.js +32 -48
- package/hooks/useClue.js +4 -6
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +5 -5
- package/hooks/useClueTypeConfig.js +3 -3
- package/hooks/useComparator.js +435 -722
- package/hooks/useErrors.js +18 -22
- package/hooks/useMyHighlights.js +36 -66
- package/hooks/useMyLocalStorage.js +43 -63
- package/iconify-BBckr5AQ.js +1263 -0
- package/icons/Action.js +49 -66
- package/icons/Assessment.js +68 -84
- package/icons/Context.js +61 -75
- package/icons/Opinion.js +65 -77
- package/icons/iconMap.js +2 -2
- package/identity-ByMq8VxU.js +6 -0
- package/index-4YFAh_sa.js +358 -0
- package/index-E7g8cRyW.js +568 -0
- package/index-HuYhutsd.js +975 -0
- package/index-WvFmjbxF.js +12734 -0
- package/index-p5_wX7q1.js +11729 -0
- package/isEmpty-g47Qir2A.js +21 -0
- package/isNil-CjWwlQS3.js +6 -0
- package/isObject-B53jY8Qg.js +7 -0
- package/isObjectLike-BatpeCIi.js +29 -0
- package/isSymbol-C3_SC0Qp.js +8 -0
- package/isUndefined-DiNCDKoz.js +10 -0
- package/last-7CdUxN0r.js +7 -0
- package/main.js +68 -68
- package/package.json +1 -1
- package/sortBy-ITdmD17L.js +79 -0
- package/sumBy-DxJUU2E8.js +8 -0
- package/tabs-CgADNA57.js +195 -0
- package/text/Frequency.js +23 -42
- package/toFinite-BMy6GObD.js +14 -0
- package/toNumber-YVhnnJv4.js +31 -0
- package/useClueTypeConfig-BQ33EiyB.js +2273 -0
- package/utils/chain.js +64 -91
- package/utils/classificationParser.js +254 -504
- package/utils/constants.js +10 -35
- package/utils/graph.js +45 -72
- package/utils/hashUtil.js +7 -7
- package/utils/line.js +81 -131
- package/utils/loggerUtil.js +3 -5
- package/utils/sessionStorage.js +29 -41
- package/utils/utils.js +9 -9
- package/utils/window.js +10 -21
- package/utils-C_RX5uMP.js +2704 -0
- package/ActionForm-c5hLIfQ-.js +0 -436
- package/AnnotationPreview-BvNpZOP0.js +0 -188
- package/ClueEnrichContext-m-4vn9rz.js +0 -518
- package/FlexOne-BSYAhhtG.js +0 -9
- package/_Map-kgDsDYxq.js +0 -64
- package/_MapCache-DabaaWfq.js +0 -161
- package/_Uint8Array-BlVVH1tp.js +0 -129
- package/_baseAssignValue-CNbcU6Nb.js +0 -25
- package/_baseClone-D3a8Pa4T.js +0 -284
- package/_baseExtremum-B1o1zHjR.js +0 -33
- package/_baseFlatten-D4huXoEI.js +0 -92
- package/_baseGet-BSK_nnoz.js +0 -109
- package/_baseIsEqual-B5xLoweL.js +0 -238
- package/_baseIteratee-p6Nj07-n.js +0 -126
- package/_baseSlice-GAv_YFTT.js +0 -20
- package/_baseSum-D0WC1dN0.js +0 -13
- package/_baseUniq-CpupKWcL.js +0 -89
- package/_commonjsHelpers-CUmg6egw.js +0 -6
- package/_createAggregator-BpVy5xMi.js +0 -63
- package/_getPrototype-D1LAdQKO.js +0 -5
- package/_getTag-D3ToyefI.js +0 -126
- package/cloneDeep-CjP5k9zW.js +0 -8
- package/countBy-C69WslUA.js +0 -14
- package/debounce-bV0h5FC5.js +0 -92
- package/get-D3C3lEU3.js +0 -8
- package/groupBy-DC2oOuBN.js +0 -14
- package/iconify-CXMreGTg.js +0 -1782
- package/identity-CPGTqrE4.js +0 -6
- package/index-BDVjGvMI.js +0 -696
- package/index-BDrtH5ec.js +0 -465
- package/index-BbPn6-Mw.js +0 -15750
- package/index-C9lySIVX.js +0 -1172
- package/index-Dn2NHyXg.js +0 -17654
- package/isEmpty-BQkZubqU.js +0 -29
- package/isNil-CIubwp4T.js +0 -6
- package/isObject-FTY-5JQX.js +0 -7
- package/isObjectLike-OAgjjZye.js +0 -48
- package/isSymbol-Xd2FsJyp.js +0 -8
- package/isUndefined-CE8h73dH.js +0 -10
- package/last-CUCl67Im.js +0 -7
- package/sortBy-B-UKp4GT.js +0 -100
- package/sumBy-MYkDPHZL.js +0 -8
- package/tabs-xGuUGsJd.js +0 -254
- package/toFinite-Bc55msYj.js +0 -16
- package/toNumber-DPxy1FBy.js +0 -39
- package/useClueTypeConfig-D4zcy8Gr.js +0 -3184
- package/utils-CxIhC2xH.js +0 -4182
|
@@ -1,252 +1,194 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo, useRef, useState, useEffect, useCallback, createElement } from "react";
|
|
3
|
-
import { useTheme, lighten, darken, Stack, Card, Typography, alpha, Autocomplete, TextField, FormControl, InputLabel, Select, MenuItem, IconButton, Collapse } from "@mui/material";
|
|
4
|
-
import { p as
|
|
5
|
-
import { z as
|
|
6
|
-
import
|
|
7
|
-
import { useMyLocalStorageItem } from "../../../hooks/useMyLocalStorage.js";
|
|
8
|
-
import { StorageKey } from "../../../utils/constants.js";
|
|
9
|
-
import { g as
|
|
10
|
-
import { cssImportant } from "../../../utils/graph.js";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
const
|
|
17
|
-
var
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
const [panelLocation] = useMyLocalStorageItem(StorageKey.PANEL_LOCATION, "vertical");
|
|
26
|
-
const [relativeMousePos, setRelativeMousePos] = useState(["0", "0"]);
|
|
27
|
-
const [absoluteMousePos, setAbsoluteMousePos] = useState(["0", "0"]);
|
|
28
|
-
const [showPanel, setShowPanel] = useState(false);
|
|
29
|
-
const nodeIds = useMemo(() => ((graph == null ? void 0 : graph.data) ?? []).flat(2).map((node) => node.id), [graph == null ? void 0 : graph.data]);
|
|
30
|
-
const zoom$1 = useMemo(() => zoom().scaleExtent([0.1, 6]), []);
|
|
31
|
-
const [currentZoom, setCurrentZoom] = useState(identity);
|
|
32
|
-
const [nodeId, setNodeId] = useState("");
|
|
33
|
-
const [selectedNodeIds, setSelectedNodeIds] = useState([]);
|
|
34
|
-
const [viz, setViz] = useState(
|
|
35
|
-
((_b = (_a = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _a.visualization) == null ? void 0 : _b.type) ?? "tree"
|
|
36
|
-
);
|
|
37
|
-
const [hasError, setHasError] = useState(false);
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
setShowPanel(selectedNodeIds.length > 0);
|
|
40
|
-
}, [selectedNodeIds]);
|
|
41
|
-
const labelKeys = useMemo(
|
|
1
|
+
import { jsx as i, jsxs as l, Fragment as ye } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as m, useRef as ee, useState as u, useEffect as z, useCallback as f, createElement as ke } from "react";
|
|
3
|
+
import { useTheme as we, lighten as te, darken as oe, Stack as x, Card as R, Typography as Ce, alpha as ne, Autocomplete as ze, TextField as he, FormControl as Se, InputLabel as Ee, Select as Ie, MenuItem as Ne, IconButton as Oe, Collapse as Me } from "@mui/material";
|
|
4
|
+
import { p as Pe } from "../../../index-4YFAh_sa.js";
|
|
5
|
+
import { z as Fe, i as M, s as p, t as Re, p as ie } from "../../../index-p5_wX7q1.js";
|
|
6
|
+
import Te from "../../../hooks/useComparator.js";
|
|
7
|
+
import { useMyLocalStorageItem as T } from "../../../hooks/useMyLocalStorage.js";
|
|
8
|
+
import { StorageKey as L } from "../../../utils/constants.js";
|
|
9
|
+
import { g as Le } from "../../../get-Bow1vKwx.js";
|
|
10
|
+
import { cssImportant as k } from "../../../utils/graph.js";
|
|
11
|
+
import ae from "../icons/Iconified.js";
|
|
12
|
+
import Ae from "./ExpandMoreButton.js";
|
|
13
|
+
import Be from "./visualizations/cloud/index.js";
|
|
14
|
+
import $e from "./visualizations/panels/NodePanel.js";
|
|
15
|
+
import je from "./visualizations/tree/index.js";
|
|
16
|
+
const et = ({ graph: t, sx: re = {} }) => {
|
|
17
|
+
var X, Z, U, Y, q;
|
|
18
|
+
const o = we(), h = m(() => o.palette.mode === "dark", [o]), { runComparator: A } = Te(), r = ee(), se = ee(), [P] = T(L.SHOW_MOUSE_POS, !1), [w] = T(L.SHOW_COORDINATES, !1), [S] = T(L.PANEL_LOCATION, "vertical"), [le, ce] = u(["0", "0"]), [de, me] = u(["0", "0"]), [E, B] = u(!1), $ = m(() => ((t == null ? void 0 : t.data) ?? []).flat(2).map((e) => e.id), [t == null ? void 0 : t.data]), v = m(() => Fe().scaleExtent([0.1, 6]), []), [s, I] = u(M), [N, ue] = u(""), [C, j] = u([]), [O, H] = u(
|
|
19
|
+
((Z = (X = t == null ? void 0 : t.metadata.display) == null ? void 0 : X.visualization) == null ? void 0 : Z.type) ?? "tree"
|
|
20
|
+
), [pe, F] = u(!1);
|
|
21
|
+
z(() => {
|
|
22
|
+
B(C.length > 0);
|
|
23
|
+
}, [C]);
|
|
24
|
+
const b = m(
|
|
42
25
|
() => {
|
|
43
|
-
var
|
|
44
|
-
return (
|
|
26
|
+
var e, n;
|
|
27
|
+
return (n = (e = t == null ? void 0 : t.metadata.display) == null ? void 0 : e.displayField) == null ? void 0 : n.filter((a) => (a.zoom ?? Number.MAX_SAFE_INTEGER) > s.k);
|
|
45
28
|
},
|
|
46
|
-
[(
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const selectNode = useCallback(() => {
|
|
56
|
-
if (!nodeId) {
|
|
57
|
-
setHasError(true);
|
|
29
|
+
[(U = t == null ? void 0 : t.metadata.display) == null ? void 0 : U.displayField, s.k]
|
|
30
|
+
), fe = f((e) => {
|
|
31
|
+
ue(e);
|
|
32
|
+
}, []), V = f((e) => {
|
|
33
|
+
const n = e === "view" ? e : `node-${e ?? "will\\%never\\$ever\\*exist"}`;
|
|
34
|
+
return p(`#${n}`);
|
|
35
|
+
}, []), _ = f(() => {
|
|
36
|
+
if (!N) {
|
|
37
|
+
F(!0);
|
|
58
38
|
return;
|
|
59
39
|
}
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
62
|
-
|
|
40
|
+
const e = V(N.replace(/[^A-Za-z0-9]*/g, ""));
|
|
41
|
+
if (e.empty()) {
|
|
42
|
+
F(!0);
|
|
63
43
|
return;
|
|
64
44
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
svg.transition().duration(500).call(
|
|
71
|
-
zoom$1.transform,
|
|
72
|
-
identity.translate(clientRect.width / 2, clientRect.height / 2).scale(4).translate(-box.x, -box.y)
|
|
45
|
+
F(!1), j([N]);
|
|
46
|
+
const n = r.current.getBoundingClientRect(), a = p(r.current), d = e.node().getBBox();
|
|
47
|
+
a.transition().duration(500).call(
|
|
48
|
+
v.transform,
|
|
49
|
+
M.translate(n.width / 2, n.height / 2).scale(4).translate(-d.x, -d.y)
|
|
73
50
|
);
|
|
74
|
-
}, [
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (parsedEvent.isCtrl && parsedEvent.isEnter) {
|
|
79
|
-
selectNode();
|
|
80
|
-
}
|
|
51
|
+
}, [V, N, v.transform]), xe = f(
|
|
52
|
+
(e) => {
|
|
53
|
+
const n = Pe(e);
|
|
54
|
+
n.isCtrl && n.isEnter && _();
|
|
81
55
|
},
|
|
82
|
-
[
|
|
83
|
-
)
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
(instant = false) => {
|
|
87
|
-
if (!graph) {
|
|
56
|
+
[_]
|
|
57
|
+
), ve = f((e) => ((t == null ? void 0 : t.data) ?? []).flat().find((n) => n.id === e), [t == null ? void 0 : t.data]), g = f(
|
|
58
|
+
(e = !1) => {
|
|
59
|
+
if (!t)
|
|
88
60
|
return;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (!instant) {
|
|
95
|
-
selection = selection.transition().duration(500);
|
|
96
|
-
}
|
|
97
|
-
selection.call(
|
|
98
|
-
zoom$1.transform,
|
|
99
|
-
identity.translate(clientRect.width / 2, (clientRect.height + 96) / 2).scale(zoomLevel).translate(-box.width / 2, -box.height / 2 - 10)
|
|
61
|
+
const n = p(r.current).select("#view").node().getBBox(), a = r.current.getBoundingClientRect(), d = Math.min(a.width / (n.width + 25), (a.height - 96) / n.height);
|
|
62
|
+
let y = p(r.current);
|
|
63
|
+
e || (y = y.transition().duration(500)), y.call(
|
|
64
|
+
v.transform,
|
|
65
|
+
M.translate(a.width / 2, (a.height + 96) / 2).scale(d).translate(-n.width / 2, -n.height / 2 - 10)
|
|
100
66
|
);
|
|
101
67
|
},
|
|
102
|
-
[
|
|
103
|
-
);
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
pointRef.current = svgRef.current.createSVGPoint();
|
|
110
|
-
select(svgRef.current).call(
|
|
111
|
-
zoom$1.on("zoom", (event) => {
|
|
112
|
-
setCurrentZoom == null ? void 0 : setCurrentZoom(event.transform);
|
|
113
|
-
select(svgRef.current).select("#view").attr("transform", event.transform);
|
|
68
|
+
[v.transform, t]
|
|
69
|
+
), D = f((e) => j(e), []);
|
|
70
|
+
z(() => {
|
|
71
|
+
t && (se.current = r.current.createSVGPoint(), p(r.current).call(
|
|
72
|
+
v.on("zoom", (e) => {
|
|
73
|
+
I == null || I(e.transform), p(r.current).select("#view").attr("transform", e.transform);
|
|
114
74
|
})
|
|
115
|
-
);
|
|
116
|
-
}, [
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}, [viz, graph == null ? void 0 : graph.data]);
|
|
129
|
-
useEffect(() => {
|
|
130
|
-
var _a2, _b2, _c2, _d2;
|
|
131
|
-
if ((_b2 = (_a2 = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _a2.visualization) == null ? void 0 : _b2.type) {
|
|
132
|
-
setViz((_d2 = (_c2 = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _c2.visualization) == null ? void 0 : _d2.type);
|
|
133
|
-
}
|
|
134
|
-
}, [(_e = (_d = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _d.visualization) == null ? void 0 : _e.type]);
|
|
135
|
-
const treeOptions = useMemo(
|
|
75
|
+
));
|
|
76
|
+
}, [I, v, O, t]), z(() => {
|
|
77
|
+
P && p(r.current).on("mousemove", (e) => {
|
|
78
|
+
const n = Re(p(r.current).select("#view").node());
|
|
79
|
+
me(n.invert(ie(e)).map((a) => a.toFixed(0))), ce(ie(e).map((a) => a.toFixed(0)));
|
|
80
|
+
});
|
|
81
|
+
}, [P, t]), z(() => {
|
|
82
|
+
g();
|
|
83
|
+
}, [O, t == null ? void 0 : t.data]), z(() => {
|
|
84
|
+
var e, n, a, d;
|
|
85
|
+
(n = (e = t == null ? void 0 : t.metadata.display) == null ? void 0 : e.visualization) != null && n.type && H((d = (a = t == null ? void 0 : t.metadata.display) == null ? void 0 : a.visualization) == null ? void 0 : d.type);
|
|
86
|
+
}, [(q = (Y = t == null ? void 0 : t.metadata.display) == null ? void 0 : Y.visualization) == null ? void 0 : q.type]);
|
|
87
|
+
const G = m(
|
|
136
88
|
() => ({
|
|
137
|
-
textColor:
|
|
138
|
-
backgroundColor:
|
|
89
|
+
textColor: o.palette.text.primary,
|
|
90
|
+
backgroundColor: o.palette.background.paper,
|
|
139
91
|
nodeColor: {
|
|
140
|
-
border: (
|
|
92
|
+
border: (h ? te : oe)(o.palette.background.paper, 0.3),
|
|
141
93
|
center: "white"
|
|
142
94
|
}
|
|
143
95
|
}),
|
|
144
|
-
[
|
|
145
|
-
)
|
|
146
|
-
const cloudOptions = useMemo(
|
|
96
|
+
[h, o.palette.background.paper, o.palette.text.primary]
|
|
97
|
+
), W = m(
|
|
147
98
|
() => ({
|
|
148
|
-
textColor:
|
|
149
|
-
backgroundColor:
|
|
99
|
+
textColor: o.palette.text.primary,
|
|
100
|
+
backgroundColor: o.palette.background.paper,
|
|
150
101
|
nodeColor: {
|
|
151
|
-
border: (
|
|
102
|
+
border: (h ? te : oe)(o.palette.background.paper, 0.3),
|
|
152
103
|
center: "white"
|
|
153
104
|
}
|
|
154
105
|
}),
|
|
155
|
-
[
|
|
156
|
-
)
|
|
157
|
-
const visualizations = useMemo(
|
|
106
|
+
[h, o.palette.background.paper, o.palette.text.primary]
|
|
107
|
+
), K = m(
|
|
158
108
|
() => ({
|
|
159
|
-
tree: () => /* @__PURE__ */
|
|
160
|
-
|
|
109
|
+
tree: () => /* @__PURE__ */ i(
|
|
110
|
+
je,
|
|
161
111
|
{
|
|
162
|
-
svgRef,
|
|
163
|
-
graph,
|
|
164
|
-
labelKeys,
|
|
165
|
-
onNodeSelectionChanged,
|
|
166
|
-
zoom:
|
|
167
|
-
options:
|
|
112
|
+
svgRef: r,
|
|
113
|
+
graph: t,
|
|
114
|
+
labelKeys: b,
|
|
115
|
+
onNodeSelectionChanged: D,
|
|
116
|
+
zoom: s,
|
|
117
|
+
options: G
|
|
168
118
|
}
|
|
169
119
|
),
|
|
170
|
-
cloud: () => /* @__PURE__ */
|
|
120
|
+
cloud: () => /* @__PURE__ */ i(Be, { svgRef: r, graph: t, options: W })
|
|
171
121
|
}),
|
|
172
|
-
[
|
|
173
|
-
)
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
var _a3;
|
|
184
|
-
return (_a3 = get(node, _key)) == null ? void 0 : _a3.toString();
|
|
185
|
-
}).filter((val) => !!val).map((_value) => ({ id, value: _value.trim() }));
|
|
186
|
-
return value;
|
|
187
|
-
});
|
|
188
|
-
}, [graph == null ? void 0 : graph.data, labelKeys, nodeIds, runComparator]);
|
|
189
|
-
return /* @__PURE__ */ jsxs(
|
|
190
|
-
Stack,
|
|
122
|
+
[W, s, t, b, D, G]
|
|
123
|
+
), be = m(() => $.flatMap((e) => {
|
|
124
|
+
var y, J;
|
|
125
|
+
const n = (((y = t == null ? void 0 : t.data) == null ? void 0 : y.flat()) ?? []).find((c) => c.id === e);
|
|
126
|
+
return n ? (((J = b == null ? void 0 : b.filter((c) => A(c, n)).pop()) == null ? void 0 : J.label) ?? "id").split(",").map((c) => {
|
|
127
|
+
var Q;
|
|
128
|
+
return (Q = Le(n, c)) == null ? void 0 : Q.toString();
|
|
129
|
+
}).filter((c) => !!c).map((c) => ({ id: e, value: c.trim() })) : { id: e, value: e };
|
|
130
|
+
}), [t == null ? void 0 : t.data, b, $, A]);
|
|
131
|
+
return /* @__PURE__ */ l(
|
|
132
|
+
x,
|
|
191
133
|
{
|
|
192
|
-
direction:
|
|
134
|
+
direction: S === "vertical" ? "row" : "column",
|
|
193
135
|
spacing: 1,
|
|
194
136
|
overflow: "hidden",
|
|
195
137
|
height: "100%",
|
|
196
138
|
width: "100%",
|
|
197
|
-
sx,
|
|
139
|
+
sx: re,
|
|
198
140
|
children: [
|
|
199
|
-
/* @__PURE__ */
|
|
200
|
-
|
|
141
|
+
/* @__PURE__ */ i(x, { direction: "column", spacing: 1, sx: { position: "relative", flex: 1 }, children: /* @__PURE__ */ l(
|
|
142
|
+
R,
|
|
201
143
|
{
|
|
202
144
|
variant: "outlined",
|
|
203
145
|
sx: {
|
|
204
146
|
flex: 1,
|
|
205
147
|
position: "relative",
|
|
206
|
-
maxHeight: `calc(100vh - 64px - ${
|
|
148
|
+
maxHeight: `calc(100vh - 64px - ${o.spacing(1)})`,
|
|
207
149
|
"& #viz": {
|
|
208
|
-
maxHeight: `calc(100vh - 64px - ${
|
|
150
|
+
maxHeight: `calc(100vh - 64px - ${o.spacing(1)})`,
|
|
209
151
|
width: "100%",
|
|
210
152
|
height: "100%",
|
|
211
|
-
backgroundColor:
|
|
153
|
+
backgroundColor: o.palette.background.paper
|
|
212
154
|
},
|
|
213
155
|
"& .path": {
|
|
214
|
-
transition:
|
|
215
|
-
duration:
|
|
156
|
+
transition: o.transitions.create(["opacity"], {
|
|
157
|
+
duration: o.transitions.duration.short
|
|
216
158
|
})
|
|
217
159
|
},
|
|
218
160
|
"& .node": {
|
|
219
161
|
cursor: "pointer",
|
|
220
162
|
"& > path, & > text, & > polygon, & circle": {
|
|
221
|
-
transition:
|
|
222
|
-
duration:
|
|
163
|
+
transition: o.transitions.create(["stroke", "fill", "fill-opacity", "stroke-opacity"], {
|
|
164
|
+
duration: o.transitions.duration.short
|
|
223
165
|
})
|
|
224
166
|
},
|
|
225
167
|
"&.hover > .center": {
|
|
226
|
-
stroke:
|
|
168
|
+
stroke: k(o.palette.primary.main)
|
|
227
169
|
},
|
|
228
170
|
"&.hover > .border": {
|
|
229
|
-
stroke:
|
|
171
|
+
stroke: k(o.palette.primary.dark)
|
|
230
172
|
},
|
|
231
173
|
"&.selected > .center": {
|
|
232
|
-
stroke:
|
|
174
|
+
stroke: k(o.palette.success.main)
|
|
233
175
|
},
|
|
234
176
|
"&.selected > .border": {
|
|
235
|
-
stroke:
|
|
177
|
+
stroke: k(o.palette.success.dark)
|
|
236
178
|
},
|
|
237
179
|
"&.selected.hover > .center": {
|
|
238
|
-
stroke:
|
|
180
|
+
stroke: k(o.palette.primary.main)
|
|
239
181
|
},
|
|
240
182
|
"&.selected.hover > .border": {
|
|
241
|
-
stroke:
|
|
183
|
+
stroke: k(o.palette.primary.dark)
|
|
242
184
|
}
|
|
243
185
|
}
|
|
244
186
|
},
|
|
245
187
|
children: [
|
|
246
|
-
|
|
247
|
-
/* @__PURE__ */
|
|
248
|
-
/* @__PURE__ */
|
|
249
|
-
|
|
188
|
+
t ? K[O]() : /* @__PURE__ */ l(ye, { children: [
|
|
189
|
+
/* @__PURE__ */ i("svg", { id: "viz", ref: r, children: /* @__PURE__ */ i("g", { id: "view" }) }),
|
|
190
|
+
/* @__PURE__ */ i(
|
|
191
|
+
Ce,
|
|
250
192
|
{
|
|
251
193
|
variant: "h1",
|
|
252
194
|
color: "text.secondary",
|
|
@@ -261,19 +203,19 @@ const Graph = ({ graph, sx = {} }) => {
|
|
|
261
203
|
}
|
|
262
204
|
)
|
|
263
205
|
] }),
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
-
|
|
206
|
+
/* @__PURE__ */ i(
|
|
207
|
+
x,
|
|
266
208
|
{
|
|
267
209
|
direction: "column",
|
|
268
210
|
spacing: 1,
|
|
269
211
|
sx: {
|
|
270
212
|
position: "absolute",
|
|
271
|
-
top:
|
|
272
|
-
left:
|
|
273
|
-
right:
|
|
213
|
+
top: o.spacing(1),
|
|
214
|
+
left: o.spacing(1),
|
|
215
|
+
right: o.spacing(1)
|
|
274
216
|
},
|
|
275
|
-
children: /* @__PURE__ */
|
|
276
|
-
|
|
217
|
+
children: /* @__PURE__ */ l(
|
|
218
|
+
x,
|
|
277
219
|
{
|
|
278
220
|
direction: "row",
|
|
279
221
|
spacing: 1,
|
|
@@ -281,62 +223,62 @@ const Graph = ({ graph, sx = {} }) => {
|
|
|
281
223
|
"& > div:first-of-type": {
|
|
282
224
|
flex: 1,
|
|
283
225
|
maxWidth: "775px",
|
|
284
|
-
backgroundColor:
|
|
226
|
+
backgroundColor: ne(o.palette.background.paper, 0.8)
|
|
285
227
|
}
|
|
286
228
|
},
|
|
287
229
|
children: [
|
|
288
|
-
/* @__PURE__ */
|
|
289
|
-
|
|
230
|
+
/* @__PURE__ */ i(
|
|
231
|
+
ze,
|
|
290
232
|
{
|
|
291
|
-
disablePortal:
|
|
292
|
-
onChange: (
|
|
293
|
-
onKeyDown:
|
|
294
|
-
options:
|
|
233
|
+
disablePortal: !0,
|
|
234
|
+
onChange: (e, n) => fe(n.id),
|
|
235
|
+
onKeyDown: xe,
|
|
236
|
+
options: be,
|
|
295
237
|
sx: { width: "400px" },
|
|
296
|
-
getOptionLabel: (
|
|
297
|
-
filterOptions: (
|
|
298
|
-
renderOption: (
|
|
299
|
-
renderInput: (
|
|
300
|
-
|
|
238
|
+
getOptionLabel: (e) => e.value,
|
|
239
|
+
filterOptions: (e, n) => e.filter((a) => a.value.toLowerCase().includes(n.inputValue)),
|
|
240
|
+
renderOption: (e, n) => /* @__PURE__ */ ke("li", { ...e, key: n.id + n.value }, n.value),
|
|
241
|
+
renderInput: (e) => /* @__PURE__ */ i(
|
|
242
|
+
he,
|
|
301
243
|
{
|
|
302
|
-
...
|
|
303
|
-
error:
|
|
244
|
+
...e,
|
|
245
|
+
error: pe,
|
|
304
246
|
label: "Enter a node ID, and press [ctrl + enter] to select it. [ctrl + space] will open an autocomplete menu."
|
|
305
247
|
}
|
|
306
248
|
)
|
|
307
249
|
}
|
|
308
250
|
),
|
|
309
|
-
/* @__PURE__ */
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
-
/* @__PURE__ */
|
|
312
|
-
|
|
251
|
+
/* @__PURE__ */ l(Se, { sx: { minWidth: "150px", backgroundColor: ne(o.palette.background.paper, 0.8) }, children: [
|
|
252
|
+
/* @__PURE__ */ i(Ee, { id: "viz-label", children: "Visualization" }),
|
|
253
|
+
/* @__PURE__ */ i(
|
|
254
|
+
Ie,
|
|
313
255
|
{
|
|
314
256
|
label: "Visualization",
|
|
315
257
|
labelId: "viz-label",
|
|
316
|
-
value:
|
|
317
|
-
onChange: (
|
|
258
|
+
value: O,
|
|
259
|
+
onChange: (e) => H(e.target.value),
|
|
318
260
|
sx: { textTransform: "capitalize" },
|
|
319
|
-
children: Object.keys(
|
|
261
|
+
children: Object.keys(K).map((e) => /* @__PURE__ */ i(Ne, { value: e, sx: { textTransform: "capitalize" }, children: e }, e))
|
|
320
262
|
}
|
|
321
263
|
)
|
|
322
264
|
] }),
|
|
323
|
-
/* @__PURE__ */
|
|
324
|
-
|
|
265
|
+
/* @__PURE__ */ i(
|
|
266
|
+
Ae,
|
|
325
267
|
{
|
|
326
|
-
disabled:
|
|
327
|
-
expand:
|
|
328
|
-
onClick: () =>
|
|
329
|
-
"aria-expanded":
|
|
268
|
+
disabled: C.length < 1,
|
|
269
|
+
expand: E,
|
|
270
|
+
onClick: () => B(!E),
|
|
271
|
+
"aria-expanded": E,
|
|
330
272
|
"aria-label": "show more",
|
|
331
273
|
size: "small",
|
|
332
274
|
sx: {
|
|
333
275
|
marginLeft: "auto !important",
|
|
334
276
|
alignSelf: "center"
|
|
335
277
|
},
|
|
336
|
-
children: /* @__PURE__ */
|
|
337
|
-
|
|
278
|
+
children: /* @__PURE__ */ i(
|
|
279
|
+
ae,
|
|
338
280
|
{
|
|
339
|
-
icon:
|
|
281
|
+
icon: S === "vertical" ? "ic:baseline-chevron-left" : "ic:baseline-expand-more",
|
|
340
282
|
fontSize: "medium"
|
|
341
283
|
}
|
|
342
284
|
)
|
|
@@ -347,61 +289,61 @@ const Graph = ({ graph, sx = {} }) => {
|
|
|
347
289
|
)
|
|
348
290
|
}
|
|
349
291
|
),
|
|
350
|
-
/* @__PURE__ */
|
|
351
|
-
|
|
292
|
+
/* @__PURE__ */ i(
|
|
293
|
+
R,
|
|
352
294
|
{
|
|
353
|
-
variant:
|
|
354
|
-
elevation:
|
|
295
|
+
variant: w ? "elevation" : "outlined",
|
|
296
|
+
elevation: w ? 4 : 0,
|
|
355
297
|
sx: {
|
|
356
298
|
position: "absolute",
|
|
357
|
-
bottom:
|
|
358
|
-
right:
|
|
299
|
+
bottom: o.spacing(0.5),
|
|
300
|
+
right: o.spacing(0.5),
|
|
359
301
|
px: 1,
|
|
360
302
|
py: 0.5,
|
|
361
303
|
border: "none !important"
|
|
362
304
|
},
|
|
363
|
-
children: /* @__PURE__ */
|
|
364
|
-
|
|
365
|
-
|
|
305
|
+
children: /* @__PURE__ */ l(x, { direction: "row", spacing: 0.5, alignItems: "center", children: [
|
|
306
|
+
w && /* @__PURE__ */ l("span", { children: [
|
|
307
|
+
s.x.toFixed(0),
|
|
366
308
|
", ",
|
|
367
|
-
|
|
309
|
+
s.y.toFixed(0),
|
|
368
310
|
" (",
|
|
369
|
-
|
|
311
|
+
s.k.toFixed(2),
|
|
370
312
|
"x)"
|
|
371
313
|
] }),
|
|
372
|
-
/* @__PURE__ */
|
|
373
|
-
|
|
314
|
+
/* @__PURE__ */ i(
|
|
315
|
+
Oe,
|
|
374
316
|
{
|
|
375
|
-
size:
|
|
376
|
-
onClick: () =>
|
|
377
|
-
disabled:
|
|
378
|
-
children: /* @__PURE__ */
|
|
317
|
+
size: w ? "small" : "medium",
|
|
318
|
+
onClick: () => g(),
|
|
319
|
+
disabled: s.k === M.k && s.x === 0 && s.y === 0,
|
|
320
|
+
children: /* @__PURE__ */ i(ae, { icon: "ic:baseline-refresh", fontSize: w ? "small" : "medium" })
|
|
379
321
|
}
|
|
380
322
|
)
|
|
381
323
|
] })
|
|
382
324
|
}
|
|
383
325
|
),
|
|
384
|
-
|
|
385
|
-
|
|
326
|
+
P && /* @__PURE__ */ i(
|
|
327
|
+
R,
|
|
386
328
|
{
|
|
387
329
|
variant: "elevation",
|
|
388
330
|
elevation: 4,
|
|
389
331
|
sx: {
|
|
390
332
|
position: "absolute",
|
|
391
|
-
bottom:
|
|
392
|
-
left:
|
|
333
|
+
bottom: o.spacing(0.5),
|
|
334
|
+
left: o.spacing(0.5),
|
|
393
335
|
px: 1,
|
|
394
336
|
py: 0.5
|
|
395
337
|
},
|
|
396
|
-
children: /* @__PURE__ */
|
|
397
|
-
/* @__PURE__ */
|
|
338
|
+
children: /* @__PURE__ */ i("code", { children: /* @__PURE__ */ l(x, { direction: "row", spacing: 1, children: [
|
|
339
|
+
/* @__PURE__ */ l("span", { children: [
|
|
398
340
|
"(abs: ",
|
|
399
|
-
|
|
341
|
+
de.join(", "),
|
|
400
342
|
")"
|
|
401
343
|
] }),
|
|
402
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ l("span", { children: [
|
|
403
345
|
"(rel: ",
|
|
404
|
-
|
|
346
|
+
le.join(", "),
|
|
405
347
|
")"
|
|
406
348
|
] })
|
|
407
349
|
] }) })
|
|
@@ -410,21 +352,21 @@ const Graph = ({ graph, sx = {} }) => {
|
|
|
410
352
|
]
|
|
411
353
|
}
|
|
412
354
|
) }),
|
|
413
|
-
/* @__PURE__ */
|
|
414
|
-
|
|
355
|
+
/* @__PURE__ */ i(
|
|
356
|
+
Me,
|
|
415
357
|
{
|
|
416
|
-
in:
|
|
417
|
-
orientation:
|
|
418
|
-
appear:
|
|
419
|
-
unmountOnExit:
|
|
420
|
-
children: /* @__PURE__ */
|
|
421
|
-
|
|
358
|
+
in: E && C.length > 0,
|
|
359
|
+
orientation: S === "vertical" ? "horizontal" : "vertical",
|
|
360
|
+
appear: !0,
|
|
361
|
+
unmountOnExit: !0,
|
|
362
|
+
children: /* @__PURE__ */ i(
|
|
363
|
+
x,
|
|
422
364
|
{
|
|
423
365
|
direction: "column",
|
|
424
366
|
spacing: 1,
|
|
425
|
-
sx:
|
|
367
|
+
sx: S === "vertical" ? { width: "450px", height: "100%" } : { width: "100%", height: "300px" },
|
|
426
368
|
pb: 1,
|
|
427
|
-
children: /* @__PURE__ */
|
|
369
|
+
children: /* @__PURE__ */ i($e, { selectedNodeIds: C, findNode: ve })
|
|
428
370
|
}
|
|
429
371
|
)
|
|
430
372
|
}
|
|
@@ -434,5 +376,5 @@ const Graph = ({ graph, sx = {} }) => {
|
|
|
434
376
|
);
|
|
435
377
|
};
|
|
436
378
|
export {
|
|
437
|
-
|
|
379
|
+
et as default
|
|
438
380
|
};
|