@cccsaurora/clue-ui 1.0.1 → 1.1.0-dev.10
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-D4ryHO0M.js +436 -0
- package/AnnotationDetails-YAPoqw3R.js +175 -0
- package/AnnotationPreview-DiQDjt9s.js +188 -0
- package/ClueEnrichContext-DIn6g8tw.js +522 -0
- package/FlexOne-BSYAhhtG.js +9 -0
- package/_Map-kgDsDYxq.js +64 -0
- package/_MapCache-DabaaWfq.js +161 -0
- package/_Uint8Array-BlVVH1tp.js +129 -0
- package/_baseAssignValue-CNbcU6Nb.js +25 -0
- package/_baseClone-D3a8Pa4T.js +284 -0
- package/_baseExtremum-B1o1zHjR.js +33 -0
- package/_baseFlatten-D4huXoEI.js +92 -0
- package/_baseGet-BSK_nnoz.js +109 -0
- package/_baseIsEqual-B5xLoweL.js +238 -0
- package/_baseIteratee-p6Nj07-n.js +126 -0
- package/_baseSlice-GAv_YFTT.js +20 -0
- package/_baseSum-D0WC1dN0.js +13 -0
- package/_baseUniq-CpupKWcL.js +89 -0
- package/_commonjsHelpers-CUmg6egw.js +6 -0
- package/_createAggregator-BpVy5xMi.js +63 -0
- package/_getPrototype-D1LAdQKO.js +5 -0
- package/_getTag-D3ToyefI.js +126 -0
- package/api/lookup/enrich.d.ts +3 -3
- package/cloneDeep-CjP5k9zW.js +8 -0
- package/components/AnnotationBody.js +49 -34
- package/components/AnnotationDetailPopover.js +36 -30
- package/components/AnnotationDetails.js +21 -155
- package/components/AnnotationEntry.js +50 -52
- package/components/AnnotationPreview.js +5 -5
- package/components/ClassificationChip.js +44 -23
- package/components/CountBadge.js +31 -26
- package/components/EnrichedCard.js +104 -92
- package/components/EnrichedChip.js +134 -109
- package/components/EnrichedTypography.js +136 -110
- package/components/ErrorBoundary.js +28 -24
- package/components/RetryFailedEnrichments.js +10 -9
- package/components/SourcePicker.js +57 -49
- package/components/actions/ActionForm.js +4 -4
- package/components/actions/ExecutePopover.js +64 -50
- package/components/actions/ResultModal.js +37 -34
- package/components/actions/form/schemaAdapter.js +39 -20
- package/components/display/graph/ExpandMoreButton.js +10 -10
- package/components/display/graph/elements/NodeCard.js +92 -76
- package/components/display/graph/elements/NodeTag.js +15 -13
- package/components/display/graph/index.js +258 -200
- package/components/display/graph/visualizations/Leaf.js +88 -69
- package/components/display/graph/visualizations/cloud/index.js +98 -81
- package/components/display/graph/visualizations/icons/BaseIcon.js +26 -21
- 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 +14 -13
- package/components/display/graph/visualizations/panels/NodePanel.js +10 -8
- package/components/display/graph/visualizations/tree/BundleLine.js +108 -81
- package/components/display/graph/visualizations/tree/Triangle.js +13 -13
- package/components/display/graph/visualizations/tree/index.js +407 -305
- package/components/display/icons/Iconified.js +27 -12
- package/components/display/json/index.js +4 -4
- package/components/display/markdown/DynamicTabs.js +22 -17
- package/components/display/markdown/index.js +8527 -5670
- package/components/display/markdown/markdownPlugins/tabs.js +1 -1
- package/components/enrichment/EnrichPopover.js +55 -47
- package/components/fetchers/Fetcher.js +123 -95
- package/components/fetchers/PreviewModal.js +20 -17
- package/components/fetchers/StatusChip.js +22 -18
- package/components/group/Entry.js +13 -11
- package/components/group/Group.js +13 -10
- package/components/group/GroupControl.js +76 -65
- package/components/stats/QueryStatus.js +37 -28
- package/countBy-C69WslUA.js +14 -0
- package/data/event.js +6 -4
- package/database/index.js +2 -2
- package/debounce-bV0h5FC5.js +92 -0
- package/get-D3C3lEU3.js +8 -0
- package/groupBy-DC2oOuBN.js +14 -0
- package/hooks/ClueActionContext.d.ts +1 -1
- package/hooks/ClueActionContext.js +6 -6
- package/hooks/ClueComponentContext.js +29 -23
- package/hooks/ClueConfigProvider.js +14 -12
- package/hooks/ClueDatabaseContext.js +19 -13
- package/hooks/ClueEnrichContext.js +8 -8
- package/hooks/ClueFetcherContext.js +74 -46
- package/hooks/ClueGroupContext.js +17 -14
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +12 -10
- package/hooks/selectors.js +22 -11
- package/hooks/useAnnotations.js +45 -33
- package/hooks/useClue.js +6 -4
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +5 -5
- package/hooks/useClueTypeConfig.d.ts +2 -1
- package/hooks/useClueTypeConfig.js +3 -3
- package/hooks/useComparator.js +722 -435
- package/hooks/useErrors.js +22 -18
- package/hooks/useMyHighlights.js +66 -36
- package/hooks/useMyLocalStorage.js +63 -43
- package/iconify-CXMreGTg.js +1782 -0
- package/icons/Action.js +66 -49
- package/icons/Assessment.js +84 -68
- package/icons/Context.js +75 -61
- package/icons/Opinion.js +77 -65
- package/icons/iconMap.js +2 -2
- package/identity-CPGTqrE4.js +6 -0
- package/index-BDVjGvMI.js +696 -0
- package/index-BHPT3qoB.js +1172 -0
- package/index-BMxyILVD.js +465 -0
- package/index-BbPn6-Mw.js +15750 -0
- package/index-Dz1kF2MU.js +17654 -0
- package/isEmpty-BQkZubqU.js +29 -0
- package/isNil-CIubwp4T.js +6 -0
- package/isObject-FTY-5JQX.js +7 -0
- package/isObjectLike-OAgjjZye.js +48 -0
- package/isSymbol-Xd2FsJyp.js +8 -0
- package/last-CUCl67Im.js +7 -0
- package/main.d.ts +0 -1
- package/main.js +58 -68
- package/package.json +1 -1
- package/sortBy-B-UKp4GT.js +100 -0
- package/sumBy-MYkDPHZL.js +8 -0
- package/tabs-xGuUGsJd.js +254 -0
- package/text/Frequency.js +42 -23
- package/toFinite-Bc55msYj.js +16 -0
- package/toNumber-DPxy1FBy.js +39 -0
- package/useClueTypeConfig-CH-nGq6a.js +3184 -0
- package/utils/chain.js +91 -64
- package/utils/classificationParser.d.ts +8 -8
- package/utils/classificationParser.js +517 -267
- package/utils/constants.js +35 -10
- package/utils/graph.js +72 -45
- package/utils/hashUtil.js +7 -7
- package/utils/line.js +131 -81
- package/utils/loggerUtil.js +5 -3
- package/utils/sessionStorage.js +41 -29
- package/utils/utils.js +9 -9
- package/utils/window.js +21 -10
- package/utils-Dr4wbKBZ.js +4182 -0
- package/ActionForm-WIj7BfD5.js +0 -340
- package/AnnotationPreview-DWRDhxUB.js +0 -140
- package/ClueEnrichContext-CbJVBm4w.js +0 -397
- package/FlexOne-BXWFOd1T.js +0 -6
- package/_Map-DXNg_Z-q.js +0 -54
- package/_MapCache-Cu25RRDU.js +0 -129
- package/_Uint8Array-DlJCtTvG.js +0 -102
- package/_baseAssignValue-CUmzp727.js +0 -20
- package/_baseClone-BlMmRXeX.js +0 -208
- package/_baseExtremum-P_0akmCi.js +0 -27
- package/_baseFlatten-CN7vDNEQ.js +0 -72
- package/_baseGet-Dgf6_xCm.js +0 -80
- package/_baseIsEqual-Cpjtfb3Q.js +0 -173
- package/_baseIteratee-CP1bocOX.js +0 -95
- package/_baseSlice-M5RKzt1A.js +0 -10
- package/_baseSum-wEbgNeUs.js +0 -10
- package/_baseUniq-tMFmk80M.js +0 -61
- package/_commonjsHelpers-C6fGbg64.js +0 -6
- package/_createAggregator-B4Cav8ZM.js +0 -53
- package/_getPrototype-CHAFQYL_.js +0 -5
- package/_getTag-BV_UoLYG.js +0 -90
- package/cloneDeep-BPVpFBzJ.js +0 -8
- package/countBy-DOutsa_w.js +0 -8
- package/debounce-DryYcbJ4.js +0 -56
- package/get-Bow1vKwx.js +0 -8
- package/groupBy-BheQYl6f.js +0 -8
- package/iconify-BBckr5AQ.js +0 -1263
- package/identity-ByMq8VxU.js +0 -6
- package/index-4YFAh_sa.js +0 -358
- package/index-E7g8cRyW.js +0 -568
- package/index-HuYhutsd.js +0 -975
- package/index-WvFmjbxF.js +0 -12734
- package/index-p5_wX7q1.js +0 -11729
- package/isEmpty-g47Qir2A.js +0 -21
- package/isNil-CjWwlQS3.js +0 -6
- package/isObject-B53jY8Qg.js +0 -7
- package/isObjectLike-BatpeCIi.js +0 -29
- package/isSymbol-C3_SC0Qp.js +0 -8
- package/isUndefined-DiNCDKoz.js +0 -10
- package/last-7CdUxN0r.js +0 -7
- package/sortBy-ITdmD17L.js +0 -79
- package/sumBy-DxJUU2E8.js +0 -8
- package/tabs-CgADNA57.js +0 -195
- package/toFinite-BMy6GObD.js +0 -14
- package/toNumber-YVhnnJv4.js +0 -31
- package/useClueTypeConfig-BQ33EiyB.js +0 -2273
- package/utils-C_RX5uMP.js +0 -2704
|
@@ -1,79 +1,93 @@
|
|
|
1
|
-
import { jsxs
|
|
2
|
-
import { I as
|
|
3
|
-
import { useTheme
|
|
4
|
-
import
|
|
5
|
-
import { ClueComponentContext
|
|
6
|
-
import { useClueActionsSelector
|
|
7
|
-
import
|
|
8
|
-
import { isAccessible
|
|
9
|
-
import { useState
|
|
10
|
-
import { u as
|
|
11
|
-
import
|
|
12
|
-
const
|
|
13
|
-
const { t
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { I as Icon } from "../../iconify-CXMreGTg.js";
|
|
3
|
+
import { useTheme, Tooltip, IconButton, CircularProgress, Button, Popover, Paper, Stack, Box, Typography, Divider } from "@mui/material";
|
|
4
|
+
import Iconified from "../display/icons/Iconified.js";
|
|
5
|
+
import { ClueComponentContext } from "../../hooks/ClueComponentContext.js";
|
|
6
|
+
import { useClueActionsSelector } from "../../hooks/selectors.js";
|
|
7
|
+
import useClueConfig from "../../hooks/useClueConfig.js";
|
|
8
|
+
import { isAccessible } from "../../utils/classificationParser.js";
|
|
9
|
+
import { useState, useRef, useMemo, useEffect } from "react";
|
|
10
|
+
import { u as useContextSelector } from "../../index-BDVjGvMI.js";
|
|
11
|
+
import ClassificationChip from "../ClassificationChip.js";
|
|
12
|
+
const ExecutePopover = ({ show = false, size = "small", selectors, multiples = false }) => {
|
|
13
|
+
const { t } = useContextSelector(ClueComponentContext, (ctx) => ctx.i18next);
|
|
14
|
+
const theme = useTheme();
|
|
15
|
+
const availableActions = useClueActionsSelector((ctx) => ctx.availableActions);
|
|
16
|
+
const refreshActions = useClueActionsSelector((ctx) => ctx.refreshActions);
|
|
17
|
+
const executeAction = useClueActionsSelector((ctx) => ctx.executeAction);
|
|
18
|
+
const loading = useClueActionsSelector((ctx) => ctx.loading);
|
|
19
|
+
const { config } = useClueConfig();
|
|
20
|
+
const [showExecuteMenu, setShowExecuteMenu] = useState(show);
|
|
21
|
+
const executeEl = useRef(null);
|
|
22
|
+
const actions = useMemo(
|
|
14
23
|
() => Object.fromEntries(
|
|
15
|
-
Object.entries(
|
|
16
|
-
([
|
|
17
|
-
var
|
|
18
|
-
return (!((
|
|
24
|
+
Object.entries(availableActions).filter(
|
|
25
|
+
([__, action]) => {
|
|
26
|
+
var _a;
|
|
27
|
+
return (!((_a = action.supported_types) == null ? void 0 : _a.length) || selectors.every((value) => action.supported_types.includes(value == null ? void 0 : value.type))) && (!multiples || action.accept_multiple || selectors.length === 1) && selectors.every((value) => isAccessible(action.classification, value.classification, config.c12nDef));
|
|
19
28
|
}
|
|
20
29
|
)
|
|
21
30
|
),
|
|
22
|
-
[
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
[availableActions, config.c12nDef, multiples, selectors]
|
|
32
|
+
);
|
|
33
|
+
const actionDisabled = Object.keys(actions).length < 1 || loading || selectors.length < 1;
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
setShowExecuteMenu(show);
|
|
36
|
+
}, [show]);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (showExecuteMenu) {
|
|
39
|
+
refreshActions();
|
|
40
|
+
}
|
|
41
|
+
}, [refreshActions, showExecuteMenu]);
|
|
42
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
43
|
+
size === "small" ? /* @__PURE__ */ jsx(Tooltip, { ref: executeEl, title: t("actions.execute"), children: /* @__PURE__ */ jsx("span", { style: { alignSelf: "center" }, children: /* @__PURE__ */ jsx(IconButton, { onClick: () => setShowExecuteMenu(true), disabled: actionDisabled, color: "success", children: loading ? /* @__PURE__ */ jsx(CircularProgress, { color: "success", size: "24px" }) : /* @__PURE__ */ jsx(Iconified, { icon: "ic:outline-play-arrow" }) }) }) }) : /* @__PURE__ */ jsx(
|
|
44
|
+
Button,
|
|
31
45
|
{
|
|
32
|
-
ref:
|
|
46
|
+
ref: executeEl,
|
|
33
47
|
variant: "outlined",
|
|
34
48
|
color: "success",
|
|
35
|
-
disabled:
|
|
36
|
-
startIcon:
|
|
49
|
+
disabled: actionDisabled,
|
|
50
|
+
startIcon: loading ? /* @__PURE__ */ jsx(CircularProgress, { color: "success", size: "20px" }) : /* @__PURE__ */ jsx(Iconified, { icon: "ic:outline-play-arrow" }),
|
|
37
51
|
sx: { alignSelf: "stretch" },
|
|
38
|
-
onClick: () =>
|
|
39
|
-
children:
|
|
52
|
+
onClick: () => setShowExecuteMenu(true),
|
|
53
|
+
children: t("actions.execute")
|
|
40
54
|
}
|
|
41
55
|
),
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
|
|
56
|
+
/* @__PURE__ */ jsx(
|
|
57
|
+
Popover,
|
|
44
58
|
{
|
|
45
59
|
sx: { zIndex: 2e3 },
|
|
46
|
-
open:
|
|
47
|
-
disablePortal:
|
|
48
|
-
onClose: () =>
|
|
49
|
-
anchorEl:
|
|
60
|
+
open: showExecuteMenu,
|
|
61
|
+
disablePortal: true,
|
|
62
|
+
onClose: () => setShowExecuteMenu(false),
|
|
63
|
+
anchorEl: executeEl.current,
|
|
50
64
|
anchorOrigin: { horizontal: "left", vertical: "bottom" },
|
|
51
|
-
children: /* @__PURE__ */
|
|
52
|
-
|
|
65
|
+
children: /* @__PURE__ */ jsx(Paper, { onClick: () => setShowExecuteMenu(false), children: /* @__PURE__ */ jsx(Stack, { divider: /* @__PURE__ */ jsx(Divider, { flexItem: true, orientation: "horizontal" }), children: Object.entries(actions).map(([actionId, action]) => /* @__PURE__ */ jsx(
|
|
66
|
+
Box,
|
|
53
67
|
{
|
|
54
68
|
sx: {
|
|
55
69
|
px: 3,
|
|
56
70
|
py: 1,
|
|
57
71
|
cursor: "pointer",
|
|
58
|
-
transition:
|
|
59
|
-
"&:hover": { backgroundColor:
|
|
72
|
+
transition: theme.transitions.create("background-color"),
|
|
73
|
+
"&:hover": { backgroundColor: theme.palette.background.default }
|
|
60
74
|
},
|
|
61
|
-
onClick: () =>
|
|
62
|
-
children: /* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */
|
|
75
|
+
onClick: () => executeAction(actionId, selectors),
|
|
76
|
+
children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
77
|
+
/* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
78
|
+
action.action_icon && /* @__PURE__ */ jsx(Icon, { icon: action.action_icon }),
|
|
79
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body1", children: action.name }),
|
|
80
|
+
/* @__PURE__ */ jsx(ClassificationChip, { size: "small", classification: action.classification })
|
|
67
81
|
] }),
|
|
68
|
-
|
|
82
|
+
action.summary && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: action.summary })
|
|
69
83
|
] })
|
|
70
84
|
},
|
|
71
|
-
|
|
85
|
+
actionId
|
|
72
86
|
)) }) })
|
|
73
87
|
}
|
|
74
88
|
)
|
|
75
89
|
] });
|
|
76
90
|
};
|
|
77
91
|
export {
|
|
78
|
-
|
|
92
|
+
ExecutePopover as default
|
|
79
93
|
};
|
|
@@ -1,43 +1,46 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { I as
|
|
3
|
-
import { Modal
|
|
4
|
-
import { J as
|
|
5
|
-
import
|
|
6
|
-
import { ClueComponentContext
|
|
7
|
-
import { memo
|
|
8
|
-
import { u as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
const
|
|
12
|
-
const { t
|
|
13
|
-
if (!
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { I as Icon } from "../../iconify-CXMreGTg.js";
|
|
3
|
+
import { Modal, Paper, Stack, Typography, Divider, Button } from "@mui/material";
|
|
4
|
+
import { J as JSONViewer } from "../../index-BMxyILVD.js";
|
|
5
|
+
import Markdown from "../display/markdown/index.js";
|
|
6
|
+
import { ClueComponentContext } from "../../hooks/ClueComponentContext.js";
|
|
7
|
+
import { memo } from "react";
|
|
8
|
+
import { u as useContextSelector } from "../../index-BDVjGvMI.js";
|
|
9
|
+
import ClassificationChip from "../ClassificationChip.js";
|
|
10
|
+
import ErrorBoundary from "../ErrorBoundary.js";
|
|
11
|
+
const ResultModal = ({ result, onClose, show = false }) => {
|
|
12
|
+
const { t } = useContextSelector(ClueComponentContext, (ctx) => ctx.i18next);
|
|
13
|
+
if (!result) {
|
|
14
14
|
return null;
|
|
15
|
+
}
|
|
15
16
|
try {
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */
|
|
17
|
+
return /* @__PURE__ */ jsx(Modal, { open: show, sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClose, children: /* @__PURE__ */ jsx(Paper, { sx: { maxHeight: "80%", maxWidth: "80%", height: "100%", p: 2, minWidth: "750px" }, children: /* @__PURE__ */ jsxs(Stack, { spacing: 1, height: "100%", children: [
|
|
18
|
+
/* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
19
|
+
result.action.action_icon && /* @__PURE__ */ jsx(Icon, { height: "1.5rem", icon: result.action.action_icon }),
|
|
20
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h5", children: result.action.name }),
|
|
21
|
+
result.action.supported_types && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: result.action.supported_types.map((type) => type.toUpperCase()).join(", ") }),
|
|
22
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
|
|
23
|
+
/* @__PURE__ */ jsx(ClassificationChip, { size: "small", classification: result.action.classification })
|
|
23
24
|
] }),
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body1", children: result.action.summary }),
|
|
26
|
+
/* @__PURE__ */ jsx(Divider, { flexItem: true }),
|
|
27
|
+
/* @__PURE__ */ jsxs(ErrorBoundary, { children: [
|
|
28
|
+
result.format === "markdown" && /* @__PURE__ */ jsx(Markdown, { md: result.output }),
|
|
29
|
+
result.format === "json" && /* @__PURE__ */ jsx(JSONViewer, { data: result.output, collapse: true, forceCompact: true })
|
|
29
30
|
] }),
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
|
|
34
|
-
/* @__PURE__ */
|
|
31
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
|
|
32
|
+
/* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, children: [
|
|
33
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
|
|
34
|
+
result.link && /* @__PURE__ */ jsx(Button, { variant: "outlined", component: "a", target: "_blank", href: result.link, children: t("details.open") }),
|
|
35
|
+
/* @__PURE__ */ jsx(Button, { variant: "outlined", color: "error", onClick: onClose, children: t("close") })
|
|
35
36
|
] })
|
|
36
37
|
] }) }) });
|
|
37
|
-
} catch (
|
|
38
|
-
|
|
38
|
+
} catch (e) {
|
|
39
|
+
console.warn(e);
|
|
40
|
+
return null;
|
|
39
41
|
}
|
|
40
|
-
}
|
|
42
|
+
};
|
|
43
|
+
const ResultModal$1 = memo(ResultModal);
|
|
41
44
|
export {
|
|
42
|
-
|
|
45
|
+
ResultModal$1 as default
|
|
43
46
|
};
|
|
@@ -1,28 +1,47 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { g as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
1
|
+
import { c as cloneDeep } from "../../../cloneDeep-CjP5k9zW.js";
|
|
2
|
+
import { g as get } from "../../../get-D3C3lEU3.js";
|
|
3
|
+
const adaptSchema = (_schema) => {
|
|
4
|
+
const requiredFields = [];
|
|
5
|
+
const schema = cloneDeep(_schema);
|
|
6
|
+
const newSchema = {
|
|
7
|
+
...schema,
|
|
6
8
|
properties: Object.fromEntries(
|
|
7
|
-
Object.entries(
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (typeof t.anyOf[1] == "boolean")
|
|
13
|
-
return [e, t];
|
|
14
|
-
t.anyOf[1].type === "null" && typeof t.anyOf[0] != "boolean" && (t.anyOf[0].enum && (t.enum = t.anyOf[0].enum), t.type = [...Array.isArray(t.anyOf[0].type) ? t.anyOf[0].type : [t.anyOf[0].type], "null"], delete t.anyOf, r.pop());
|
|
9
|
+
Object.entries(schema.properties ?? {}).filter(([name]) => !["raw_data", "selector", "selectors"].includes(name)).map(([name, def]) => {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
requiredFields.push(name);
|
|
12
|
+
if (typeof def === "boolean") {
|
|
13
|
+
return [name, def];
|
|
15
14
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
if (((_a = def.anyOf) == null ? void 0 : _a.length) === 2) {
|
|
16
|
+
if (typeof def.anyOf[1] === "boolean") {
|
|
17
|
+
return [name, def];
|
|
18
|
+
}
|
|
19
|
+
if (def.anyOf[1].type === "null" && typeof def.anyOf[0] !== "boolean") {
|
|
20
|
+
if (def.anyOf[0].enum) {
|
|
21
|
+
def.enum = def.anyOf[0].enum;
|
|
22
|
+
}
|
|
23
|
+
def.type = [...Array.isArray(def.anyOf[0].type) ? def.anyOf[0].type : [def.anyOf[0].type], "null"];
|
|
24
|
+
delete def.anyOf;
|
|
25
|
+
requiredFields.pop();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (((_b = def.allOf) == null ? void 0 : _b.length) > 0) {
|
|
29
|
+
if (typeof def.allOf[0] !== "boolean" && def.allOf[0].$ref) {
|
|
30
|
+
def = {
|
|
31
|
+
...def,
|
|
32
|
+
...get(schema, def.allOf[0].$ref.replace("#/", "").replaceAll("/", ".")),
|
|
33
|
+
title: def.title
|
|
34
|
+
};
|
|
35
|
+
delete def.allOf;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return [name, def];
|
|
21
39
|
})
|
|
22
40
|
)
|
|
23
41
|
};
|
|
24
|
-
|
|
42
|
+
newSchema.required = requiredFields;
|
|
43
|
+
return newSchema;
|
|
25
44
|
};
|
|
26
45
|
export {
|
|
27
|
-
|
|
46
|
+
adaptSchema
|
|
28
47
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { IconButton
|
|
3
|
-
const
|
|
4
|
-
const { expand
|
|
5
|
-
return /* @__PURE__ */
|
|
6
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { IconButton } from "@mui/material";
|
|
3
|
+
const ExpandMoreButton = (props) => {
|
|
4
|
+
const { expand, ...other } = props;
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
IconButton,
|
|
7
7
|
{
|
|
8
|
-
...
|
|
8
|
+
...other,
|
|
9
9
|
sx: {
|
|
10
|
-
transform:
|
|
11
|
-
transition: (
|
|
10
|
+
transform: !expand ? "rotate(0deg)" : "rotate(180deg)",
|
|
11
|
+
transition: (theme) => theme.transitions.create("transform")
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
);
|
|
15
15
|
};
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
ExpandMoreButton as default
|
|
18
18
|
};
|
|
@@ -1,73 +1,89 @@
|
|
|
1
|
-
import { jsxs
|
|
2
|
-
import { Stack
|
|
3
|
-
import { a as
|
|
4
|
-
import { cssImportant
|
|
5
|
-
import { b as
|
|
6
|
-
import { c as
|
|
7
|
-
import { l as
|
|
8
|
-
import { b as
|
|
9
|
-
import { b as
|
|
10
|
-
import { useState
|
|
11
|
-
import
|
|
12
|
-
import { J as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
function
|
|
17
|
-
var
|
|
18
|
-
return
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Stack, Typography, Card, CardContent, Divider, Collapse } from "@mui/material";
|
|
3
|
+
import { a as isPlainObject, f as flatten$1 } from "../../../../utils-Dr4wbKBZ.js";
|
|
4
|
+
import { cssImportant } from "../../../../utils/graph.js";
|
|
5
|
+
import { b as baseGet, c as castPath, t as toKey, a as arrayMap } from "../../../../_baseGet-BSK_nnoz.js";
|
|
6
|
+
import { c as copyObject, g as getAllKeysIn, b as baseClone } from "../../../../_baseClone-D3a8Pa4T.js";
|
|
7
|
+
import { l as last } from "../../../../last-CUCl67Im.js";
|
|
8
|
+
import { b as baseSlice } from "../../../../_baseSlice-GAv_YFTT.js";
|
|
9
|
+
import { b as baseFlatten, s as setToString, o as overRest } from "../../../../_baseFlatten-D4huXoEI.js";
|
|
10
|
+
import { useState, useEffect, useCallback, Fragment as Fragment$1 } from "react";
|
|
11
|
+
import Iconified from "../../icons/Iconified.js";
|
|
12
|
+
import { J as JSONViewer } from "../../../../index-BMxyILVD.js";
|
|
13
|
+
import Markdown from "../../markdown/index.js";
|
|
14
|
+
import ExpandMoreButton from "../ExpandMoreButton.js";
|
|
15
|
+
import NodeTag from "./NodeTag.js";
|
|
16
|
+
function flatten(array) {
|
|
17
|
+
var length = array == null ? 0 : array.length;
|
|
18
|
+
return length ? baseFlatten(array) : [];
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
return
|
|
20
|
+
function flatRest(func) {
|
|
21
|
+
return setToString(overRest(func, void 0, flatten), func + "");
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
return
|
|
23
|
+
function parent(object, path) {
|
|
24
|
+
return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
26
|
+
function baseUnset(object, path) {
|
|
27
|
+
path = castPath(path, object);
|
|
28
|
+
object = parent(object, path);
|
|
29
|
+
return object == null || delete object[toKey(last(path))];
|
|
28
30
|
}
|
|
29
|
-
function
|
|
30
|
-
return
|
|
31
|
+
function customOmitClone(value) {
|
|
32
|
+
return isPlainObject(value) ? void 0 : value;
|
|
31
33
|
}
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
|
|
35
|
+
var omit = flatRest(function(object, paths) {
|
|
36
|
+
var result = {};
|
|
37
|
+
if (object == null) {
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
var isDeep = false;
|
|
41
|
+
paths = arrayMap(paths, function(path) {
|
|
42
|
+
path = castPath(path, object);
|
|
43
|
+
isDeep || (isDeep = path.length > 1);
|
|
44
|
+
return path;
|
|
45
|
+
});
|
|
46
|
+
copyObject(object, getAllKeysIn(object), result);
|
|
47
|
+
if (isDeep) {
|
|
48
|
+
result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
|
|
49
|
+
}
|
|
50
|
+
var length = paths.length;
|
|
51
|
+
while (length--) {
|
|
52
|
+
baseUnset(result, paths[length]);
|
|
53
|
+
}
|
|
54
|
+
return result;
|
|
43
55
|
});
|
|
44
|
-
const
|
|
45
|
-
var
|
|
46
|
-
const [
|
|
47
|
-
|
|
56
|
+
const NodeCard = ({ node, sx = {} }) => {
|
|
57
|
+
var _a;
|
|
58
|
+
const [expanded, setExpanded] = useState(false);
|
|
59
|
+
const [nodeExtraData, setNodeExtraData] = useState();
|
|
60
|
+
const handleExpandClick = () => {
|
|
61
|
+
setExpanded(!expanded);
|
|
48
62
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}, [
|
|
52
|
-
const
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
setNodeExtraData(omit(node, ["id", "edges"]));
|
|
65
|
+
}, [node]);
|
|
66
|
+
const renderEdgeList = useCallback((edgeIds) => {
|
|
67
|
+
return /* @__PURE__ */ jsxs(Stack, { alignSelf: "stretch", children: [
|
|
68
|
+
/* @__PURE__ */ jsx(Typography, { textAlign: "left", variant: "body2", color: "text.secondary", children: "Edges" }),
|
|
69
|
+
/* @__PURE__ */ jsx(Stack, { spacing: 0.25, children: edgeIds.map((edgeId) => /* @__PURE__ */ jsx(NodeTag, { nodeId: edgeId }, edgeId)) })
|
|
70
|
+
] });
|
|
71
|
+
}, []);
|
|
72
|
+
return /* @__PURE__ */ jsx(
|
|
73
|
+
Card,
|
|
58
74
|
{
|
|
59
75
|
variant: "outlined",
|
|
60
76
|
sx: {
|
|
61
77
|
position: "relative",
|
|
62
78
|
overflow: "auto",
|
|
63
|
-
zIndex:
|
|
79
|
+
zIndex: expanded ? 100 : "initial",
|
|
64
80
|
"& *": {
|
|
65
81
|
opacity: 1
|
|
66
82
|
},
|
|
67
|
-
...
|
|
83
|
+
...sx
|
|
68
84
|
},
|
|
69
|
-
children: /* @__PURE__ */
|
|
70
|
-
|
|
85
|
+
children: /* @__PURE__ */ jsx(CardContent, { sx: { p: 1 }, children: /* @__PURE__ */ jsxs(
|
|
86
|
+
Stack,
|
|
71
87
|
{
|
|
72
88
|
spacing: 1,
|
|
73
89
|
sx: {
|
|
@@ -78,44 +94,44 @@ const ue = ({ node: e, sx: t = {} }) => {
|
|
|
78
94
|
}
|
|
79
95
|
},
|
|
80
96
|
children: [
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
|
|
97
|
+
/* @__PURE__ */ jsx(NodeTag, { nodeId: node.id, label: node.id, type: "header", children: /* @__PURE__ */ jsx(
|
|
98
|
+
ExpandMoreButton,
|
|
83
99
|
{
|
|
84
|
-
expand:
|
|
85
|
-
onClick:
|
|
86
|
-
"aria-expanded":
|
|
100
|
+
expand: expanded,
|
|
101
|
+
onClick: handleExpandClick,
|
|
102
|
+
"aria-expanded": expanded,
|
|
87
103
|
"aria-label": "show more",
|
|
88
104
|
size: "small",
|
|
89
|
-
children: /* @__PURE__ */
|
|
105
|
+
children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-expand-more", fontSize: "medium" })
|
|
90
106
|
}
|
|
91
107
|
) }),
|
|
92
|
-
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
/* @__PURE__ */
|
|
108
|
+
node.markdown && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
109
|
+
/* @__PURE__ */ jsx(Divider, { flexItem: true }),
|
|
110
|
+
/* @__PURE__ */ jsx(Markdown, { md: node.markdown, components: flatten$1(node) })
|
|
95
111
|
] }),
|
|
96
|
-
!!((
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
|
|
112
|
+
!!((_a = node == null ? void 0 : node.edges) == null ? void 0 : _a.length) && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
113
|
+
/* @__PURE__ */ jsx(Divider, { flexItem: true }),
|
|
114
|
+
renderEdgeList(node == null ? void 0 : node.edges)
|
|
99
115
|
] }),
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
|
|
116
|
+
/* @__PURE__ */ jsx(Collapse, { in: expanded, timeout: "auto", children: /* @__PURE__ */ jsxs(
|
|
117
|
+
Stack,
|
|
102
118
|
{
|
|
103
119
|
justifyContent: "start",
|
|
104
120
|
alignItems: "start",
|
|
105
121
|
spacing: 1,
|
|
106
|
-
sx: (
|
|
122
|
+
sx: (theme) => ({
|
|
107
123
|
"& > ul": {
|
|
108
124
|
width: "100%",
|
|
109
125
|
textAlign: "left",
|
|
110
|
-
p:
|
|
111
|
-
mx:
|
|
112
|
-
backgroundColor:
|
|
126
|
+
p: cssImportant(theme.spacing(1)),
|
|
127
|
+
mx: cssImportant("0"),
|
|
128
|
+
backgroundColor: cssImportant(theme.palette.background.paper)
|
|
113
129
|
}
|
|
114
130
|
}),
|
|
115
131
|
children: [
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ jsx(Divider, { flexItem: true }),
|
|
133
|
+
/* @__PURE__ */ jsx(Typography, { textAlign: "left", variant: "body1", children: "Metadata:" }),
|
|
134
|
+
/* @__PURE__ */ jsx(JSONViewer, { data: nodeExtraData })
|
|
119
135
|
]
|
|
120
136
|
}
|
|
121
137
|
) })
|
|
@@ -126,5 +142,5 @@ const ue = ({ node: e, sx: t = {} }) => {
|
|
|
126
142
|
);
|
|
127
143
|
};
|
|
128
144
|
export {
|
|
129
|
-
|
|
145
|
+
NodeCard as default
|
|
130
146
|
};
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { jsxs
|
|
2
|
-
import { Stack
|
|
3
|
-
import { F as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Stack, Typography, Tooltip } from "@mui/material";
|
|
3
|
+
import { F as FlexOne } from "../../../../FlexOne-BSYAhhtG.js";
|
|
4
|
+
import Iconified from "../../icons/Iconified.js";
|
|
5
|
+
const NodeTag = ({ nodeId, label = nodeId, type = "content", children }) => {
|
|
6
|
+
return /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", pr: 1, children: [
|
|
7
|
+
type === "header" ? /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", sx: { overflow: "hidden" }, children: [
|
|
8
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body1", sx: { wordWrap: "break-all" }, children: label.replace(" (TRUNCATED)", "") }),
|
|
9
|
+
label.includes("TRUNCATED") && /* @__PURE__ */ jsx(Tooltip, { title: "Field is truncated.", children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-content-cut", fontSize: "small", style: { fontSize: "0.9em" } }) })
|
|
10
|
+
] }) : label,
|
|
11
|
+
/* @__PURE__ */ jsx(FlexOne, {}),
|
|
12
|
+
children
|
|
13
|
+
] });
|
|
14
|
+
};
|
|
13
15
|
export {
|
|
14
|
-
|
|
16
|
+
NodeTag as default
|
|
15
17
|
};
|