@cccsaurora/clue-ui 1.2.4-patch.275 → 1.2.5-dev.298
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-D6gYuFRR.js +5970 -0
- package/AnnotationDetails-Zx4pjBiN.js +175 -0
- package/AnnotationPreview-Dmz7taAU.js +188 -0
- package/ClueEnrichContext-CJEJxrgs.js +541 -0
- package/FlexOne-BSYAhhtG.js +9 -0
- package/_MapCache-WmuDdwuH.js +222 -0
- package/_Uint8Array-B7JqpgFX.js +128 -0
- package/_baseAssignValue-CGTuELqU.js +25 -0
- package/_baseClone-CkNrTyhm.js +283 -0
- package/_baseExtremum-kob8QXyt.js +18 -0
- package/_baseFlatten-jIR_sN_-.js +92 -0
- package/_baseGet-Bx3A4Qfp.js +108 -0
- package/_baseIsEqual-C5OTWzTk.js +208 -0
- package/_baseIteratee-avi7MX2o.js +126 -0
- package/_baseSlice-GAv_YFTT.js +20 -0
- package/_baseSum-D0WC1dN0.js +13 -0
- package/_baseUniq-BI9GIHMF.js +115 -0
- package/_commonjsHelpers-DWwsNxpa.js +8 -0
- package/_createAggregator-QD8MzKwe.js +63 -0
- package/_getPrototype-CU0j_POw.js +5 -0
- package/_getTag-Ckxxfr88.js +126 -0
- package/_isIterateeCall-Ds3sw2SF.js +17 -0
- package/_setToArray-CaPKQhcz.js +33 -0
- package/cloneDeep-DJrLSw8W.js +8 -0
- package/components/AnnotationBody.js +49 -35
- package/components/AnnotationDetailPopover.js +36 -30
- package/components/AnnotationDetails.js +7 -7
- package/components/AnnotationEntry.js +35 -35
- package/components/AnnotationPreview.js +5 -5
- package/components/ClassificationChip.js +44 -23
- package/components/CountBadge.js +31 -26
- package/components/EnrichedCard.js +110 -97
- package/components/EnrichedChip.js +130 -105
- package/components/EnrichedTypography.js +133 -107
- 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 +75 -59
- package/components/actions/ResultModal.js +4 -4
- package/components/actions/form/schemaAdapter.js +39 -23
- package/components/actions/formats/FileResult.js +86 -59
- package/components/actions/formats/index.js +21 -10
- package/components/display/graph/ExpandMoreButton.js +10 -10
- package/components/display/graph/elements/NodeCard.js +111 -91
- package/components/display/graph/elements/NodeTag.js +15 -13
- package/components/display/graph/index.js +261 -202
- 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 +408 -306
- package/components/display/icons/Iconified.js +27 -12
- package/components/display/json/index.js +4 -4
- package/components/display/markdown/index.js +8678 -5770
- package/components/enrichment/EnrichPopover.js +54 -46
- package/components/fetchers/Fetcher.js +158 -119
- package/components/fetchers/PreviewModal.js +20 -17
- package/components/fetchers/StatusChip.js +21 -17
- 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 +43 -33
- package/countBy-c6S3dvSW.js +14 -0
- package/data/event.js +6 -4
- package/database/index.js +2 -2
- package/debounce-bV0h5FC5.js +92 -0
- package/get-DSsNkRQs.js +8 -0
- package/groupBy-xqz-n0Vd.js +14 -0
- package/hooks/ClueActionContext.d.ts +10 -2
- 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 +83 -56
- package/hooks/ClueGroupContext.js +17 -14
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +12 -10
- package/hooks/selectors.js +7 -7
- package/hooks/useActionResult.d.ts +1 -0
- package/hooks/useActionResult.js +3 -3
- package/hooks/useAnnotations.js +47 -31
- package/hooks/useClue.js +6 -4
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +6 -4
- package/hooks/useClueTypeConfig.js +3 -3
- package/hooks/useComparator.js +722 -435
- package/hooks/useErrors.js +22 -18
- package/hooks/useFetcherResult.d.ts +1 -0
- package/hooks/useFetcherResult.js +33 -24
- package/hooks/useMyHighlights.js +66 -36
- package/hooks/useMyLocalStorage.js +66 -37
- package/iconify-CXMreGTg.js +1782 -0
- package/icons/Action.js +66 -49
- package/icons/Assessment.js +85 -69
- package/icons/Context.js +77 -63
- package/icons/Opinion.js +76 -60
- package/icons/iconMap.js +2 -2
- package/identity-CPGTqrE4.js +6 -0
- package/index-AMfoEg_6.js +696 -0
- package/index-B6C2a_Lg.js +1172 -0
- package/index-C12gPw2W.js +17698 -0
- package/index-DCKkHTvx.js +15750 -0
- package/index-JcKyZeoY.js +465 -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.js +60 -60
- package/maxBy-IKHzFrCS.js +8 -0
- package/package.json +1 -1
- package/sortBy-DfSj8IoJ.js +96 -0
- package/sumBy-D-hb_NY-.js +8 -0
- package/text/Frequency.js +42 -23
- package/toFinite-Bc55msYj.js +16 -0
- package/toNumber-DPxy1FBy.js +39 -0
- package/types/RunningActionData.d.ts +1 -0
- package/types/WithActionData.d.ts +1 -0
- package/useClueTypeConfig-Z1LFp01b.js +3289 -0
- package/utils/chain.js +92 -65
- package/utils/classificationParser.js +519 -256
- 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 -27
- package/utils/time.js +423 -423
- package/utils/utils.js +9 -9
- package/utils/window.js +21 -10
- package/utils-HmNPuoDB.js +199 -0
- package/ActionForm-CwsfB99X.js +0 -4458
- package/AnnotationDetails-Bw2JdtTL.js +0 -160
- package/AnnotationPreview-BO7rVnOP.js +0 -140
- package/ClueEnrichContext-KqRuuWNS.js +0 -418
- package/FlexOne-BXWFOd1T.js +0 -6
- package/_MapCache-BiTi0iqu.js +0 -180
- package/_Uint8Array-BQNOM9Rr.js +0 -101
- package/_baseAssignValue-CNMLQZco.js +0 -20
- package/_baseClone-BnT-6pyM.js +0 -207
- package/_baseExtremum-Ca2EHgy2.js +0 -16
- package/_baseFlatten-Bfr_Molw.js +0 -72
- package/_baseGet-DSZygzyq.js +0 -79
- package/_baseIsEqual-VgvaAFZG.js +0 -147
- package/_baseIteratee-Dbfsw5z8.js +0 -95
- package/_baseSlice-M5RKzt1A.js +0 -10
- package/_baseSum-wEbgNeUs.js +0 -10
- package/_baseUniq-BJcj69PL.js +0 -79
- package/_commonjsHelpers-DaMA6jEr.js +0 -8
- package/_createAggregator-k3TuAnxT.js +0 -53
- package/_getPrototype-Cr1Mk7BC.js +0 -5
- package/_getTag-CK2Sffaq.js +0 -90
- package/_isIterateeCall-DkJP7Rbx.js +0 -13
- package/_setToArray-C7yMOeww.js +0 -29
- package/cloneDeep-CF8TtLHr.js +0 -8
- package/countBy-CdYegFSu.js +0 -8
- package/debounce-DryYcbJ4.js +0 -56
- package/get-CH7kz5Ix.js +0 -8
- package/groupBy-br8xmD2R.js +0 -8
- package/iconify-BBckr5AQ.js +0 -1263
- package/identity-ByMq8VxU.js +0 -6
- package/index-BHAe_V9n.js +0 -12768
- package/index-BK-zfYhR.js +0 -358
- package/index-CA5CUNZO.js +0 -975
- package/index-Dj5C04IX.js +0 -568
- package/index-p5_wX7q1.js +0 -11729
- 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/last-7CdUxN0r.js +0 -7
- package/maxBy-Bc0dYHcO.js +0 -8
- package/sortBy-DY2JBf9n.js +0 -75
- package/sumBy-DuMASLPd.js +0 -8
- package/toFinite-BMy6GObD.js +0 -14
- package/toNumber-YVhnnJv4.js +0 -31
- package/useClueTypeConfig-Ct9Ygter.js +0 -2292
- package/utils-DmwSUrum.js +0 -129
|
@@ -1,79 +1,87 @@
|
|
|
1
|
-
import { jsxs
|
|
2
|
-
import { useTheme
|
|
3
|
-
import { d as
|
|
4
|
-
import { useState
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
const { t
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme, Tooltip, IconButton, CircularProgress, Button, Popover, Paper, Stack, Box, Typography, Divider } from "@mui/material";
|
|
3
|
+
import { d as useClueComponentSelector, b as useClueEnrichSelector, e as capitalize } from "../../ActionForm-D6gYuFRR.js";
|
|
4
|
+
import { useState, useRef, useCallback, useEffect } from "react";
|
|
5
|
+
import Iconified from "../display/icons/Iconified.js";
|
|
6
|
+
const EnrichPopover = ({ show = false, size = "small", selector }) => {
|
|
7
|
+
const { t } = useClueComponentSelector((ctx) => ctx.i18next);
|
|
8
|
+
const theme = useTheme();
|
|
9
|
+
const availableSources = useClueEnrichSelector((ctx) => ctx.availableSources);
|
|
10
|
+
const _enrich = useClueEnrichSelector((ctx) => ctx.enrich);
|
|
11
|
+
const [showEnrichMenu, setShowEnrichMenu] = useState(show);
|
|
12
|
+
const [loading, setLoading] = useState(false);
|
|
13
|
+
const enrichEl = useRef(null);
|
|
14
|
+
const enrich = useCallback(
|
|
15
|
+
async (_source) => {
|
|
16
|
+
setLoading(true);
|
|
10
17
|
try {
|
|
11
|
-
await
|
|
12
|
-
classification:
|
|
18
|
+
await _enrich(selector.type, selector.value, {
|
|
19
|
+
classification: selector.classification,
|
|
13
20
|
timeout: 30,
|
|
14
|
-
force:
|
|
15
|
-
noCache:
|
|
16
|
-
sources: [
|
|
17
|
-
append:
|
|
21
|
+
force: true,
|
|
22
|
+
noCache: true,
|
|
23
|
+
sources: [_source],
|
|
24
|
+
append: true
|
|
18
25
|
});
|
|
19
26
|
} finally {
|
|
20
|
-
|
|
27
|
+
setLoading(false);
|
|
21
28
|
}
|
|
22
29
|
},
|
|
23
|
-
[
|
|
30
|
+
[_enrich, selector.classification, selector.type, selector.value]
|
|
24
31
|
);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, [
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
setShowEnrichMenu(show);
|
|
34
|
+
}, [show]);
|
|
35
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
36
|
+
size === "small" ? /* @__PURE__ */ jsx(Tooltip, { ref: enrichEl, title: t("enrich"), children: /* @__PURE__ */ jsx("span", { style: { alignSelf: "center" }, children: /* @__PURE__ */ jsx(
|
|
37
|
+
IconButton,
|
|
30
38
|
{
|
|
31
|
-
onClick: () =>
|
|
32
|
-
disabled: Object.keys(
|
|
39
|
+
onClick: () => setShowEnrichMenu(true),
|
|
40
|
+
disabled: Object.keys(availableSources).length < 1 || loading,
|
|
33
41
|
color: "info",
|
|
34
|
-
children:
|
|
42
|
+
children: loading ? /* @__PURE__ */ jsx(CircularProgress, { color: "info", size: "24px" }) : /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-auto-fix-high" })
|
|
35
43
|
}
|
|
36
|
-
) }) }) : /* @__PURE__ */
|
|
37
|
-
|
|
44
|
+
) }) }) : /* @__PURE__ */ jsx(
|
|
45
|
+
Button,
|
|
38
46
|
{
|
|
39
|
-
ref:
|
|
47
|
+
ref: enrichEl,
|
|
40
48
|
variant: "outlined",
|
|
41
49
|
color: "info",
|
|
42
|
-
disabled: Object.keys(
|
|
43
|
-
startIcon:
|
|
50
|
+
disabled: Object.keys(availableSources).length < 1 || loading,
|
|
51
|
+
startIcon: loading ? /* @__PURE__ */ jsx(CircularProgress, { color: "info", size: "20px" }) : /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-auto-fix-high" }),
|
|
44
52
|
sx: { alignSelf: "stretch" },
|
|
45
|
-
onClick: () =>
|
|
46
|
-
children:
|
|
53
|
+
onClick: () => setShowEnrichMenu(true),
|
|
54
|
+
children: t("enrich")
|
|
47
55
|
}
|
|
48
56
|
),
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
|
|
57
|
+
/* @__PURE__ */ jsx(
|
|
58
|
+
Popover,
|
|
51
59
|
{
|
|
52
60
|
sx: { zIndex: 2e3 },
|
|
53
|
-
open:
|
|
54
|
-
disablePortal:
|
|
55
|
-
onClose: () =>
|
|
56
|
-
anchorEl:
|
|
61
|
+
open: showEnrichMenu,
|
|
62
|
+
disablePortal: true,
|
|
63
|
+
onClose: () => setShowEnrichMenu(false),
|
|
64
|
+
anchorEl: enrichEl.current,
|
|
57
65
|
anchorOrigin: { horizontal: "left", vertical: "bottom" },
|
|
58
|
-
children: /* @__PURE__ */
|
|
59
|
-
|
|
66
|
+
children: /* @__PURE__ */ jsx(Paper, { onClick: () => setShowEnrichMenu(false), children: /* @__PURE__ */ jsx(Stack, { divider: /* @__PURE__ */ jsx(Divider, { flexItem: true, orientation: "horizontal" }), children: availableSources.map((_source) => /* @__PURE__ */ jsx(
|
|
67
|
+
Box,
|
|
60
68
|
{
|
|
61
69
|
sx: {
|
|
62
70
|
px: 3,
|
|
63
71
|
py: 1,
|
|
64
72
|
cursor: "pointer",
|
|
65
|
-
transition:
|
|
66
|
-
"&:hover": { backgroundColor:
|
|
73
|
+
transition: theme.transitions.create("background-color"),
|
|
74
|
+
"&:hover": { backgroundColor: theme.palette.background.default }
|
|
67
75
|
},
|
|
68
|
-
onClick: () =>
|
|
69
|
-
children: /* @__PURE__ */
|
|
76
|
+
onClick: () => enrich(_source),
|
|
77
|
+
children: /* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(Stack, { direction: "row", spacing: 1, alignItems: "center", children: /* @__PURE__ */ jsx(Typography, { variant: "body1", children: _source.split("-").map(capitalize).join(" ") }) }) })
|
|
70
78
|
},
|
|
71
|
-
|
|
79
|
+
_source
|
|
72
80
|
)) }) })
|
|
73
81
|
}
|
|
74
82
|
)
|
|
75
83
|
] });
|
|
76
84
|
};
|
|
77
85
|
export {
|
|
78
|
-
|
|
86
|
+
EnrichPopover as default
|
|
79
87
|
};
|
|
@@ -1,106 +1,144 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { I as
|
|
3
|
-
import { useTheme
|
|
4
|
-
import { F as
|
|
5
|
-
import
|
|
6
|
-
import { J as
|
|
7
|
-
import { ClueComponentContext
|
|
8
|
-
import { c as
|
|
9
|
-
import
|
|
10
|
-
import { u as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
const
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { I as Icon } from "../../iconify-CXMreGTg.js";
|
|
3
|
+
import { useTheme, Skeleton, Chip, Tooltip, Stack, Typography, LinearProgress, Paper, Box, IconButton } from "@mui/material";
|
|
4
|
+
import { F as FlexOne } from "../../FlexOne-BSYAhhtG.js";
|
|
5
|
+
import Iconified from "../display/icons/Iconified.js";
|
|
6
|
+
import { J as JSONViewer } from "../../index-JcKyZeoY.js";
|
|
7
|
+
import { ClueComponentContext } from "../../hooks/ClueComponentContext.js";
|
|
8
|
+
import { c as useClueFetcherSelector } from "../../ActionForm-D6gYuFRR.js";
|
|
9
|
+
import React__default, { useState, useRef, useMemo, useEffect, memo } from "react";
|
|
10
|
+
import { u as useContextSelector } from "../../index-AMfoEg_6.js";
|
|
11
|
+
import Graph from "../display/graph/index.js";
|
|
12
|
+
import Markdown from "../display/markdown/index.js";
|
|
13
|
+
import PreviewModal from "./PreviewModal.js";
|
|
14
|
+
import StatusChip from "./StatusChip.js";
|
|
15
|
+
const Fetcher = React__default.memo(
|
|
16
16
|
({
|
|
17
|
-
type
|
|
18
|
-
value
|
|
19
|
-
classification
|
|
20
|
-
fetcherId
|
|
17
|
+
type,
|
|
18
|
+
value,
|
|
19
|
+
classification,
|
|
20
|
+
fetcherId,
|
|
21
21
|
slotProps: {
|
|
22
|
-
paper:
|
|
23
|
-
preview:
|
|
24
|
-
stack:
|
|
25
|
-
image:
|
|
26
|
-
chip:
|
|
27
|
-
skeleton:
|
|
22
|
+
paper: paperProps = {},
|
|
23
|
+
preview: previewProps = {},
|
|
24
|
+
stack: stackProps = {},
|
|
25
|
+
image: imageProps = {},
|
|
26
|
+
chip: chipProps = {},
|
|
27
|
+
skeleton: skeletonProps = {}
|
|
28
28
|
} = {}
|
|
29
29
|
}) => {
|
|
30
|
-
var
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
var _a, _b, _c, _d;
|
|
31
|
+
const theme = useTheme();
|
|
32
|
+
const fetchers = useClueFetcherSelector((ctx) => ctx.fetchers);
|
|
33
|
+
const fetchSelector = useClueFetcherSelector((ctx) => ctx.fetchSelector);
|
|
34
|
+
const getFetcherStatus = useClueFetcherSelector((ctx) => ctx.getFetcherStatus);
|
|
35
|
+
const fetchCompleted = useClueFetcherSelector((ctx) => ctx.fetchCompleted);
|
|
36
|
+
const { t } = useContextSelector(ClueComponentContext, (ctx) => ctx == null ? void 0 : ctx.i18next);
|
|
37
|
+
const [result, setResult] = useState(null);
|
|
38
|
+
const [loading, setLoading] = useState(true);
|
|
39
|
+
const [showPreview, setShowPreview] = useState(false);
|
|
40
|
+
const timeoutRef = useRef(null);
|
|
41
|
+
const taskId = useMemo(() => result == null ? void 0 : result.task_id, [result == null ? void 0 : result.task_id]);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if ((result == null ? void 0 : result.outcome) !== "pending" || !taskId) return;
|
|
44
|
+
let cancelled = false;
|
|
45
|
+
const poll = async () => {
|
|
46
|
+
const res = await getFetcherStatus(fetcherId, taskId);
|
|
47
|
+
if (!res) {
|
|
48
|
+
setResult({ outcome: "failure", done: true, error: "Missing result", link: "" });
|
|
49
|
+
} else if (res.outcome === "success" || res.outcome === "failure") {
|
|
50
|
+
setResult({ ...res, done: true });
|
|
51
|
+
} else {
|
|
52
|
+
if (cancelled) return;
|
|
53
|
+
setResult({ ...res });
|
|
54
|
+
timeoutRef.current = setTimeout(poll, 2e3);
|
|
44
55
|
}
|
|
45
56
|
};
|
|
46
|
-
|
|
47
|
-
|
|
57
|
+
poll();
|
|
58
|
+
return () => {
|
|
59
|
+
cancelled = true;
|
|
60
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
48
61
|
};
|
|
49
|
-
}, [
|
|
62
|
+
}, [fetcherId, getFetcherStatus, result == null ? void 0 : result.outcome, taskId]);
|
|
63
|
+
useEffect(() => {
|
|
50
64
|
(async () => {
|
|
51
65
|
try {
|
|
52
|
-
|
|
66
|
+
setLoading(true);
|
|
67
|
+
setResult(await fetchSelector(fetcherId, { type, value, classification }));
|
|
53
68
|
} catch {
|
|
54
|
-
|
|
69
|
+
setResult({ outcome: "failure", done: true, error: t("error.unexpected") });
|
|
55
70
|
} finally {
|
|
56
|
-
|
|
71
|
+
setLoading(false);
|
|
57
72
|
}
|
|
58
73
|
})();
|
|
59
|
-
}, [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
74
|
+
}, [classification, fetchSelector, fetcherId, t, type, value]);
|
|
75
|
+
if (fetchCompleted) {
|
|
76
|
+
if (!fetcherId) {
|
|
77
|
+
console.warn("Missing fetcher Id. Component will not render.");
|
|
78
|
+
return null;
|
|
79
|
+
} else if (!fetcherId.includes(".")) {
|
|
80
|
+
console.warn(
|
|
65
81
|
"Invalid fetcher id. Must be in the format '<plugin_id>.<fetcher_id>'. Component will not render."
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
I,
|
|
72
|
-
{
|
|
73
|
-
variant: "rounded",
|
|
74
|
-
height: "32px",
|
|
75
|
-
width: "150px",
|
|
76
|
-
...i,
|
|
77
|
-
sx: [
|
|
78
|
-
{ borderRadius: "16px" },
|
|
79
|
-
...Array.isArray(i == null ? void 0 : i.sx) ? i == null ? void 0 : i.sx : [i == null ? void 0 : i.sx]
|
|
80
|
-
]
|
|
82
|
+
);
|
|
83
|
+
return null;
|
|
84
|
+
} else if (!(fetcherId in fetchers)) {
|
|
85
|
+
console.warn("Fetcher ID does not correspond to a registered fetcher. Component will not render.");
|
|
86
|
+
return null;
|
|
81
87
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
} else {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
if (loading) {
|
|
92
|
+
if (((_a = fetchers[fetcherId]) == null ? void 0 : _a.format) === "status") {
|
|
93
|
+
return /* @__PURE__ */ jsx(
|
|
94
|
+
Skeleton,
|
|
95
|
+
{
|
|
96
|
+
variant: "rounded",
|
|
97
|
+
height: "32px",
|
|
98
|
+
width: "150px",
|
|
99
|
+
...skeletonProps,
|
|
100
|
+
sx: [
|
|
101
|
+
{ borderRadius: "16px" },
|
|
102
|
+
...Array.isArray(skeletonProps == null ? void 0 : skeletonProps.sx) ? skeletonProps == null ? void 0 : skeletonProps.sx : [skeletonProps == null ? void 0 : skeletonProps.sx]
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
} else {
|
|
107
|
+
return /* @__PURE__ */ jsx(Skeleton, { variant: "rounded", height: "325px", width: "300px", ...skeletonProps });
|
|
89
108
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
109
|
+
}
|
|
110
|
+
if (!result) return null;
|
|
111
|
+
if (result.outcome === "failure" && fetchers[fetcherId].format === "status") {
|
|
112
|
+
return /* @__PURE__ */ jsx(
|
|
113
|
+
Chip,
|
|
94
114
|
{
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
115
|
+
icon: /* @__PURE__ */ jsx(Tooltip, { title: result.error, children: /* @__PURE__ */ jsx(Icon, { icon: "mdi:information-outline", fontSize: "1.25rem" }) }),
|
|
116
|
+
label: t("error"),
|
|
117
|
+
color: "error",
|
|
118
|
+
...chipProps
|
|
98
119
|
}
|
|
99
|
-
)
|
|
100
|
-
|
|
101
|
-
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
if (result.outcome === "pending") {
|
|
123
|
+
return /* @__PURE__ */ jsxs(Stack, { flex: 1, sx: { pt: 2, alignItems: "center" }, spacing: 1, children: [
|
|
124
|
+
((_b = result.data) == null ? void 0 : _b.summary) && /* @__PURE__ */ jsx(Typography, { variant: "caption", children: result.data.summary }),
|
|
125
|
+
/* @__PURE__ */ jsx(
|
|
126
|
+
LinearProgress,
|
|
127
|
+
{
|
|
128
|
+
variant: ((_c = result.data) == null ? void 0 : _c.progress) ? "determinate" : "indeterminate",
|
|
129
|
+
value: ((_d = result.data) == null ? void 0 : _d.progress) * 100,
|
|
130
|
+
sx: { maxWidth: 500, width: "100%", borderRadius: theme.shape.borderRadius }
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
] });
|
|
134
|
+
}
|
|
135
|
+
if (result.format === "status") {
|
|
136
|
+
return /* @__PURE__ */ jsx(StatusChip, { data: result.data, ...chipProps });
|
|
137
|
+
}
|
|
138
|
+
return /* @__PURE__ */ jsx(
|
|
139
|
+
Paper,
|
|
102
140
|
{
|
|
103
|
-
...
|
|
141
|
+
...paperProps,
|
|
104
142
|
sx: [
|
|
105
143
|
{
|
|
106
144
|
p: 1,
|
|
@@ -109,16 +147,16 @@ const ae = p.memo(
|
|
|
109
147
|
width: "100%",
|
|
110
148
|
minWidth: "300px"
|
|
111
149
|
},
|
|
112
|
-
...Array.isArray(
|
|
150
|
+
...Array.isArray(paperProps == null ? void 0 : paperProps.sx) ? paperProps == null ? void 0 : paperProps.sx : [paperProps == null ? void 0 : paperProps.sx]
|
|
113
151
|
],
|
|
114
|
-
children: /* @__PURE__ */
|
|
115
|
-
|
|
152
|
+
children: /* @__PURE__ */ jsxs(
|
|
153
|
+
Stack,
|
|
116
154
|
{
|
|
117
155
|
sx: {
|
|
118
156
|
"& > img": {
|
|
119
157
|
borderRadius: "3px",
|
|
120
158
|
cursor: "zoom-in",
|
|
121
|
-
transition:
|
|
159
|
+
transition: theme.transitions.create("border-color", { duration: theme.transitions.duration.shortest }),
|
|
122
160
|
border: "3px solid transparent",
|
|
123
161
|
"&:hover": {
|
|
124
162
|
borderColor: "primary.main"
|
|
@@ -126,64 +164,65 @@ const ae = p.memo(
|
|
|
126
164
|
}
|
|
127
165
|
},
|
|
128
166
|
children: [
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
|
|
167
|
+
result.outcome === "failure" && /* @__PURE__ */ jsx("code", { style: { color: theme.palette.error.main }, children: /* @__PURE__ */ jsx("pre", { style: { marginTop: 0, marginBottom: 0 }, children: result.error }) }),
|
|
168
|
+
result.format === "markdown" && /* @__PURE__ */ jsx(Markdown, { md: result.data }),
|
|
169
|
+
result.format === "image" && /* @__PURE__ */ jsx("img", { src: result.data.image, alt: result.data.alt, ...imageProps, onClick: () => setShowPreview(true) }),
|
|
170
|
+
result.format === "json" && /* @__PURE__ */ jsx(Box, { sx: { ".react-json-view": { backgroundColor: "transparent !important" } }, children: /* @__PURE__ */ jsx(JSONViewer, { data: result.data }) }),
|
|
171
|
+
result.format === "graph" && /* @__PURE__ */ jsx(Graph, { graph: result.data, sx: { minHeight: "600px" } }),
|
|
172
|
+
/* @__PURE__ */ jsx(FlexOne, {}),
|
|
173
|
+
/* @__PURE__ */ jsxs(
|
|
174
|
+
Stack,
|
|
137
175
|
{
|
|
138
176
|
direction: "row",
|
|
139
177
|
spacing: 1,
|
|
140
|
-
...
|
|
178
|
+
...stackProps,
|
|
141
179
|
sx: [
|
|
142
180
|
{
|
|
143
|
-
py:
|
|
181
|
+
py: theme.spacing(0.5),
|
|
144
182
|
display: "flex",
|
|
145
183
|
alignItems: "center"
|
|
146
184
|
},
|
|
147
|
-
...Array.isArray(
|
|
185
|
+
...Array.isArray(stackProps == null ? void 0 : stackProps.sx) ? stackProps == null ? void 0 : stackProps.sx : [stackProps == null ? void 0 : stackProps.sx]
|
|
148
186
|
],
|
|
149
187
|
children: [
|
|
150
|
-
/* @__PURE__ */
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
|
|
188
|
+
/* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-landscape", color: "primary", fontSize: "small" }),
|
|
189
|
+
/* @__PURE__ */ jsx(
|
|
190
|
+
Tooltip,
|
|
153
191
|
{
|
|
154
|
-
title: /* @__PURE__ */
|
|
155
|
-
/* @__PURE__ */
|
|
156
|
-
|
|
192
|
+
title: /* @__PURE__ */ jsxs(Stack, { spacing: 0.5, children: [
|
|
193
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
194
|
+
t("type"),
|
|
157
195
|
": ",
|
|
158
|
-
|
|
196
|
+
type
|
|
159
197
|
] }),
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
|
|
198
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
199
|
+
t("value"),
|
|
162
200
|
": ",
|
|
163
|
-
|
|
201
|
+
value
|
|
164
202
|
] }),
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
|
|
203
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
204
|
+
t("classification"),
|
|
167
205
|
": ",
|
|
168
|
-
|
|
206
|
+
classification ?? "N/A"
|
|
169
207
|
] })
|
|
170
208
|
] }),
|
|
171
|
-
children: /* @__PURE__ */
|
|
209
|
+
children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:outline-info", fontSize: "small" })
|
|
172
210
|
}
|
|
173
211
|
),
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
-
|
|
212
|
+
/* @__PURE__ */ jsx(FlexOne, {}),
|
|
213
|
+
result.link && /* @__PURE__ */ jsx(IconButton, { size: "small", component: "a", href: result.link, children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-open-in-new", fontSize: "small" }) })
|
|
176
214
|
]
|
|
177
215
|
}
|
|
178
216
|
),
|
|
179
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ jsx(PreviewModal, { ...previewProps, open: showPreview, result, onClose: () => setShowPreview(false) })
|
|
180
218
|
]
|
|
181
219
|
}
|
|
182
220
|
)
|
|
183
221
|
}
|
|
184
|
-
)
|
|
222
|
+
);
|
|
185
223
|
}
|
|
186
|
-
)
|
|
224
|
+
);
|
|
225
|
+
const Fetcher_default = memo(Fetcher);
|
|
187
226
|
export {
|
|
188
|
-
|
|
227
|
+
Fetcher_default as default
|
|
189
228
|
};
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { Modal
|
|
3
|
-
import { memo
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Modal, Paper } from "@mui/material";
|
|
3
|
+
import { memo } from "react";
|
|
4
|
+
const PreviewModal = ({ result, onClose, open = false, ...otherProps }) => {
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
Modal,
|
|
7
|
+
{
|
|
8
|
+
open,
|
|
9
|
+
sx: [
|
|
10
|
+
{ display: "flex", alignItems: "center", justifyContent: "center" },
|
|
11
|
+
...Array.isArray(otherProps == null ? void 0 : otherProps.sx) ? otherProps == null ? void 0 : otherProps.sx : [otherProps == null ? void 0 : otherProps.sx]
|
|
12
|
+
],
|
|
13
|
+
onClose,
|
|
14
|
+
...otherProps,
|
|
15
|
+
children: /* @__PURE__ */ jsx(Paper, { sx: { maxHeight: "90%", maxWidth: "90%", p: 2, overflow: "auto" }, children: (result == null ? void 0 : result.format) === "image" && /* @__PURE__ */ jsx("img", { src: result.data.image, alt: result.data.alt, style: { maxWidth: "100%" } }) })
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
const PreviewModal$1 = memo(PreviewModal);
|
|
17
20
|
export {
|
|
18
|
-
|
|
21
|
+
PreviewModal$1 as default
|
|
19
22
|
};
|
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { I as
|
|
3
|
-
import { useTheme
|
|
4
|
-
import { ClueComponentContext
|
|
5
|
-
import { u as
|
|
6
|
-
const
|
|
7
|
-
var
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { I as Icon } from "../../iconify-CXMreGTg.js";
|
|
3
|
+
import { useTheme, Chip } from "@mui/material";
|
|
4
|
+
import { ClueComponentContext } from "../../hooks/ClueComponentContext.js";
|
|
5
|
+
import { u as useContextSelector } from "../../index-AMfoEg_6.js";
|
|
6
|
+
const StatusChip = ({ data, ...chipProps }) => {
|
|
7
|
+
var _a;
|
|
8
|
+
const theme = useTheme();
|
|
9
|
+
const { i18n, t } = useContextSelector(ClueComponentContext, (ctx) => ctx.i18next);
|
|
10
|
+
if (data == null ? void 0 : data.empty) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
Chip,
|
|
11
15
|
{
|
|
12
|
-
icon:
|
|
13
|
-
deleteIcon: /* @__PURE__ */
|
|
14
|
-
...
|
|
15
|
-
label: ((
|
|
16
|
+
icon: data.icon && /* @__PURE__ */ jsx(Icon, { icon: data.icon, fontSize: "1.25rem" }),
|
|
17
|
+
deleteIcon: /* @__PURE__ */ jsx("a", { href: data.link, rel: "noreferrer", target: "_blank", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsx(Icon, { icon: "mdi:open-in-new", color: theme.palette.text.primary, fontSize: "1.25rem" }) }),
|
|
18
|
+
...chipProps,
|
|
19
|
+
label: ((_a = data.labels.find((label) => label.language === i18n.language) ?? data.labels[0]) == null ? void 0 : _a.label) ?? t("unknown"),
|
|
16
20
|
sx: [
|
|
17
|
-
...Array.isArray(
|
|
18
|
-
|
|
21
|
+
...Array.isArray(chipProps == null ? void 0 : chipProps.sx) ? chipProps == null ? void 0 : chipProps.sx : [chipProps == null ? void 0 : chipProps.sx],
|
|
22
|
+
data.color && { backgroundColor: data.color }
|
|
19
23
|
]
|
|
20
24
|
}
|
|
21
25
|
);
|
|
22
26
|
};
|
|
23
27
|
export {
|
|
24
|
-
|
|
28
|
+
StatusChip as default
|
|
25
29
|
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { ClueGroupContext
|
|
2
|
-
import { i as
|
|
3
|
-
import { memo
|
|
4
|
-
import { u as
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}, [
|
|
10
|
-
|
|
1
|
+
import { ClueGroupContext } from "../../hooks/ClueGroupContext.js";
|
|
2
|
+
import { i as isEqual } from "../../utils-HmNPuoDB.js";
|
|
3
|
+
import { memo, useEffect } from "react";
|
|
4
|
+
import { u as useContextSelector } from "../../index-AMfoEg_6.js";
|
|
5
|
+
const Entry = ({ children, entry, selected = false }) => {
|
|
6
|
+
const setValues = useContextSelector(ClueGroupContext, (ctx) => ctx == null ? void 0 : ctx.setValues);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
setValues == null ? void 0 : setValues((_values) => [..._values.filter((value) => !isEqual(value, entry)), ...selected ? [entry] : []]);
|
|
9
|
+
}, [entry, selected, setValues]);
|
|
10
|
+
return children;
|
|
11
|
+
};
|
|
12
|
+
const Entry_default = memo(Entry);
|
|
11
13
|
export {
|
|
12
|
-
|
|
14
|
+
Entry_default as default
|
|
13
15
|
};
|