@cccsaurora/clue-ui 1.1.3 → 1.2.0-dev.106
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-ByeOzpc4.js +555 -0
- package/AnnotationDetails-DknbKDyl.js +175 -0
- package/AnnotationPreview-CQwKs8se.js +188 -0
- package/ClueEnrichContext-6NJfXpUB.js +536 -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-DWwsNxpa.js +8 -0
- package/_createAggregator-BpVy5xMi.js +63 -0
- package/_getPrototype-D1LAdQKO.js +5 -0
- package/_getTag-D3ToyefI.js +126 -0
- package/cloneDeep-CjP5k9zW.js +8 -0
- package/components/AnnotationBody.js +49 -35
- package/components/AnnotationDetailPopover.js +36 -30
- package/components/AnnotationDetails.js +6 -6
- package/components/AnnotationEntry.js +50 -47
- 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 +64 -50
- package/components/actions/ResultModal.js +5 -5
- package/components/actions/form/schemaAdapter.js +39 -23
- 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 +407 -305
- package/components/display/icons/Iconified.js +27 -12
- package/components/display/json/index.js +4 -4
- package/components/display/markdown/index.js +8658 -5757
- 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 +21 -17
- package/components/group/Entry.js +13 -11
- package/components/group/Group.js +13 -10
- package/components/group/GroupControl.js +77 -66
- package/components/stats/QueryStatus.js +40 -35
- 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.js +7 -7
- 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 +21 -10
- package/hooks/useActionResult.js +2 -2
- package/hooks/useAnnotations.js +44 -32
- 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/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 +84 -68
- package/icons/Context.js +77 -63
- 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-BbPn6-Mw.js +15750 -0
- package/index-Bi21Wb23.js +465 -0
- package/index-C3lkTD69.js +1172 -0
- package/index-CC12Ux-9.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.js +62 -62
- package/package.json +1 -1
- package/sortBy-B-UKp4GT.js +100 -0
- package/sumBy-MYkDPHZL.js +8 -0
- package/text/Frequency.js +42 -23
- package/toFinite-Bc55msYj.js +16 -0
- package/toNumber-DPxy1FBy.js +39 -0
- package/useClueTypeConfig-XvGvIw2S.js +3201 -0
- package/utils/chain.js +91 -64
- 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-7OtvGnmf.js +200 -0
- package/ActionForm-myEAs2UC.js +0 -435
- package/AnnotationDetails-BChWwaXw.js +0 -160
- package/AnnotationPreview-D060vmy2.js +0 -140
- package/ClueEnrichContext-DJNjbXu_.js +0 -418
- 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-DaMA6jEr.js +0 -8
- 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-BXxfAxFt.js +0 -12734
- package/index-C15OYgRY.js +0 -358
- package/index-E7g8cRyW.js +0 -568
- package/index-p5_wX7q1.js +0 -11729
- package/index-vF6IyBhz.js +0 -975
- 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/last-7CdUxN0r.js +0 -7
- package/sortBy-ITdmD17L.js +0 -79
- package/sumBy-DxJUU2E8.js +0 -8
- package/toFinite-BMy6GObD.js +0 -14
- package/toNumber-YVhnnJv4.js +0 -31
- package/useClueTypeConfig-DyeBcXQX.js +0 -2214
- package/utils-BnmI_6N8.js +0 -130
|
@@ -1,80 +1,88 @@
|
|
|
1
|
-
import { jsxs
|
|
2
|
-
import { useTheme
|
|
3
|
-
import { useClueComponentSelector
|
|
4
|
-
import { c as
|
|
5
|
-
import { useState
|
|
6
|
-
import
|
|
7
|
-
const
|
|
8
|
-
const { t
|
|
9
|
-
|
|
10
|
-
|
|
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 { useClueComponentSelector, useClueEnrichSelector } from "../../hooks/selectors.js";
|
|
4
|
+
import { c as capitalize } from "../../ActionForm-ByeOzpc4.js";
|
|
5
|
+
import { useState, useRef, useCallback, useEffect } from "react";
|
|
6
|
+
import Iconified from "../display/icons/Iconified.js";
|
|
7
|
+
const EnrichPopover = ({ show = false, size = "small", selector }) => {
|
|
8
|
+
const { t } = useClueComponentSelector((ctx) => ctx.i18next);
|
|
9
|
+
const theme = useTheme();
|
|
10
|
+
const availableSources = useClueEnrichSelector((ctx) => ctx.availableSources);
|
|
11
|
+
const _enrich = useClueEnrichSelector((ctx) => ctx.enrich);
|
|
12
|
+
const [showEnrichMenu, setShowEnrichMenu] = useState(show);
|
|
13
|
+
const [loading, setLoading] = useState(false);
|
|
14
|
+
const enrichEl = useRef(null);
|
|
15
|
+
const enrich = useCallback(
|
|
16
|
+
async (_source) => {
|
|
17
|
+
setLoading(true);
|
|
11
18
|
try {
|
|
12
|
-
await
|
|
13
|
-
classification:
|
|
19
|
+
await _enrich(selector.type, selector.value, {
|
|
20
|
+
classification: selector.classification,
|
|
14
21
|
timeout: 30,
|
|
15
|
-
force:
|
|
16
|
-
noCache:
|
|
17
|
-
sources: [
|
|
18
|
-
append:
|
|
22
|
+
force: true,
|
|
23
|
+
noCache: true,
|
|
24
|
+
sources: [_source],
|
|
25
|
+
append: true
|
|
19
26
|
});
|
|
20
27
|
} finally {
|
|
21
|
-
|
|
28
|
+
setLoading(false);
|
|
22
29
|
}
|
|
23
30
|
},
|
|
24
|
-
[
|
|
31
|
+
[_enrich, selector.classification, selector.type, selector.value]
|
|
25
32
|
);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}, [
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
setShowEnrichMenu(show);
|
|
35
|
+
}, [show]);
|
|
36
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
37
|
+
size === "small" ? /* @__PURE__ */ jsx(Tooltip, { ref: enrichEl, title: t("enrich"), children: /* @__PURE__ */ jsx("span", { style: { alignSelf: "center" }, children: /* @__PURE__ */ jsx(
|
|
38
|
+
IconButton,
|
|
31
39
|
{
|
|
32
|
-
onClick: () =>
|
|
33
|
-
disabled: Object.keys(
|
|
40
|
+
onClick: () => setShowEnrichMenu(true),
|
|
41
|
+
disabled: Object.keys(availableSources).length < 1 || loading,
|
|
34
42
|
color: "info",
|
|
35
|
-
children:
|
|
43
|
+
children: loading ? /* @__PURE__ */ jsx(CircularProgress, { color: "info", size: "24px" }) : /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-auto-fix-high" })
|
|
36
44
|
}
|
|
37
|
-
) }) }) : /* @__PURE__ */
|
|
38
|
-
|
|
45
|
+
) }) }) : /* @__PURE__ */ jsx(
|
|
46
|
+
Button,
|
|
39
47
|
{
|
|
40
|
-
ref:
|
|
48
|
+
ref: enrichEl,
|
|
41
49
|
variant: "outlined",
|
|
42
50
|
color: "info",
|
|
43
|
-
disabled: Object.keys(
|
|
44
|
-
startIcon:
|
|
51
|
+
disabled: Object.keys(availableSources).length < 1 || loading,
|
|
52
|
+
startIcon: loading ? /* @__PURE__ */ jsx(CircularProgress, { color: "info", size: "20px" }) : /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-auto-fix-high" }),
|
|
45
53
|
sx: { alignSelf: "stretch" },
|
|
46
|
-
onClick: () =>
|
|
47
|
-
children:
|
|
54
|
+
onClick: () => setShowEnrichMenu(true),
|
|
55
|
+
children: t("enrich")
|
|
48
56
|
}
|
|
49
57
|
),
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
|
|
58
|
+
/* @__PURE__ */ jsx(
|
|
59
|
+
Popover,
|
|
52
60
|
{
|
|
53
61
|
sx: { zIndex: 2e3 },
|
|
54
|
-
open:
|
|
55
|
-
disablePortal:
|
|
56
|
-
onClose: () =>
|
|
57
|
-
anchorEl:
|
|
62
|
+
open: showEnrichMenu,
|
|
63
|
+
disablePortal: true,
|
|
64
|
+
onClose: () => setShowEnrichMenu(false),
|
|
65
|
+
anchorEl: enrichEl.current,
|
|
58
66
|
anchorOrigin: { horizontal: "left", vertical: "bottom" },
|
|
59
|
-
children: /* @__PURE__ */
|
|
60
|
-
|
|
67
|
+
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(
|
|
68
|
+
Box,
|
|
61
69
|
{
|
|
62
70
|
sx: {
|
|
63
71
|
px: 3,
|
|
64
72
|
py: 1,
|
|
65
73
|
cursor: "pointer",
|
|
66
|
-
transition:
|
|
67
|
-
"&:hover": { backgroundColor:
|
|
74
|
+
transition: theme.transitions.create("background-color"),
|
|
75
|
+
"&:hover": { backgroundColor: theme.palette.background.default }
|
|
68
76
|
},
|
|
69
|
-
onClick: () =>
|
|
70
|
-
children: /* @__PURE__ */
|
|
77
|
+
onClick: () => enrich(_source),
|
|
78
|
+
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(" ") }) }) })
|
|
71
79
|
},
|
|
72
|
-
|
|
80
|
+
_source
|
|
73
81
|
)) }) })
|
|
74
82
|
}
|
|
75
83
|
)
|
|
76
84
|
] });
|
|
77
85
|
};
|
|
78
86
|
export {
|
|
79
|
-
|
|
87
|
+
EnrichPopover as default
|
|
80
88
|
};
|
|
@@ -1,77 +1,104 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { I } from "../../iconify-
|
|
3
|
-
import { useTheme
|
|
4
|
-
import { F } from "../../FlexOne-
|
|
5
|
-
import
|
|
6
|
-
import { J as
|
|
7
|
-
import { ClueComponentContext
|
|
8
|
-
import { useClueFetcherSelector
|
|
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, Paper, Stack, 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-Bi21Wb23.js";
|
|
7
|
+
import { ClueComponentContext } from "../../hooks/ClueComponentContext.js";
|
|
8
|
+
import { useClueFetcherSelector } from "../../hooks/selectors.js";
|
|
9
|
+
import React__default, { useState, useEffect, memo } from "react";
|
|
10
|
+
import { u as useContextSelector } from "../../index-BDVjGvMI.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
|
-
|
|
30
|
+
var _a;
|
|
31
|
+
const theme = useTheme();
|
|
32
|
+
const fetchers = useClueFetcherSelector((ctx) => ctx.fetchers);
|
|
33
|
+
const fetchSelector = useClueFetcherSelector((ctx) => ctx.fetchSelector);
|
|
34
|
+
const fetchCompleted = useClueFetcherSelector((ctx) => ctx.fetchCompleted);
|
|
35
|
+
const { t } = useContextSelector(ClueComponentContext, (ctx) => ctx == null ? void 0 : ctx.i18next);
|
|
36
|
+
const [result, setResult] = useState(null);
|
|
37
|
+
const [loading, setLoading] = useState(true);
|
|
38
|
+
const [showPreview, setShowPreview] = useState(false);
|
|
39
|
+
useEffect(() => {
|
|
33
40
|
(async () => {
|
|
34
41
|
try {
|
|
35
|
-
|
|
42
|
+
setLoading(true);
|
|
43
|
+
setResult(await fetchSelector(fetcherId, { type, value, classification }));
|
|
36
44
|
} finally {
|
|
37
|
-
|
|
45
|
+
setLoading(false);
|
|
38
46
|
}
|
|
39
47
|
})();
|
|
40
|
-
}, [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
}, [classification, fetchSelector, fetcherId, type, value]);
|
|
49
|
+
if (fetchCompleted) {
|
|
50
|
+
if (!fetcherId) {
|
|
51
|
+
console.warn("Missing fetcher Id. Component will not render.");
|
|
52
|
+
return null;
|
|
53
|
+
} else if (!fetcherId.includes(".")) {
|
|
54
|
+
console.warn(
|
|
46
55
|
"Invalid fetcher id. Must be in the format '<plugin_id>.<fetcher_id>'. Component will not render."
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
A,
|
|
53
|
-
{
|
|
54
|
-
variant: "rounded",
|
|
55
|
-
height: "32px",
|
|
56
|
-
width: "150px",
|
|
57
|
-
...n,
|
|
58
|
-
sx: [
|
|
59
|
-
{ borderRadius: "16px" },
|
|
60
|
-
...Array.isArray(n == null ? void 0 : n.sx) ? n == null ? void 0 : n.sx : [n == null ? void 0 : n.sx]
|
|
61
|
-
]
|
|
56
|
+
);
|
|
57
|
+
return null;
|
|
58
|
+
} else if (!(fetcherId in fetchers)) {
|
|
59
|
+
console.warn("Fetcher ID does not correspond to a registered fetcher. Component will not render.");
|
|
60
|
+
return null;
|
|
62
61
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
} else {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
if (loading) {
|
|
66
|
+
if (((_a = fetchers[fetcherId]) == null ? void 0 : _a.format) === "status") {
|
|
67
|
+
return /* @__PURE__ */ jsx(
|
|
68
|
+
Skeleton,
|
|
69
|
+
{
|
|
70
|
+
variant: "rounded",
|
|
71
|
+
height: "32px",
|
|
72
|
+
width: "150px",
|
|
73
|
+
...skeletonProps,
|
|
74
|
+
sx: [
|
|
75
|
+
{ borderRadius: "16px" },
|
|
76
|
+
...Array.isArray(skeletonProps == null ? void 0 : skeletonProps.sx) ? skeletonProps == null ? void 0 : skeletonProps.sx : [skeletonProps == null ? void 0 : skeletonProps.sx]
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
} else {
|
|
81
|
+
return /* @__PURE__ */ jsx(Skeleton, { variant: "rounded", height: "325px", width: "300px", ...skeletonProps });
|
|
70
82
|
}
|
|
71
|
-
|
|
72
|
-
|
|
83
|
+
}
|
|
84
|
+
if ((result == null ? void 0 : result.outcome) === "failure" && fetchers[fetcherId].format === "status") {
|
|
85
|
+
return /* @__PURE__ */ jsx(
|
|
86
|
+
Chip,
|
|
87
|
+
{
|
|
88
|
+
icon: /* @__PURE__ */ jsx(Tooltip, { title: result.error, children: /* @__PURE__ */ jsx(Icon, { icon: "mdi:information-outline", fontSize: "1.25rem" }) }),
|
|
89
|
+
label: t("error"),
|
|
90
|
+
color: "error",
|
|
91
|
+
...chipProps
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
if ((result == null ? void 0 : result.format) === "status") {
|
|
96
|
+
return /* @__PURE__ */ jsx(StatusChip, { data: result.data, ...chipProps });
|
|
97
|
+
}
|
|
98
|
+
return /* @__PURE__ */ jsx(
|
|
99
|
+
Paper,
|
|
73
100
|
{
|
|
74
|
-
...
|
|
101
|
+
...paperProps,
|
|
75
102
|
sx: [
|
|
76
103
|
{
|
|
77
104
|
p: 1,
|
|
@@ -80,16 +107,16 @@ const X = L.memo(
|
|
|
80
107
|
width: "100%",
|
|
81
108
|
minWidth: "300px"
|
|
82
109
|
},
|
|
83
|
-
...Array.isArray(
|
|
110
|
+
...Array.isArray(paperProps == null ? void 0 : paperProps.sx) ? paperProps == null ? void 0 : paperProps.sx : [paperProps == null ? void 0 : paperProps.sx]
|
|
84
111
|
],
|
|
85
|
-
children: /* @__PURE__ */
|
|
86
|
-
|
|
112
|
+
children: /* @__PURE__ */ jsxs(
|
|
113
|
+
Stack,
|
|
87
114
|
{
|
|
88
115
|
sx: {
|
|
89
116
|
"& > img": {
|
|
90
117
|
borderRadius: "3px",
|
|
91
118
|
cursor: "zoom-in",
|
|
92
|
-
transition:
|
|
119
|
+
transition: theme.transitions.create("border-color", { duration: theme.transitions.duration.shortest }),
|
|
93
120
|
border: "3px solid transparent",
|
|
94
121
|
"&:hover": {
|
|
95
122
|
borderColor: "primary.main"
|
|
@@ -97,64 +124,65 @@ const X = L.memo(
|
|
|
97
124
|
}
|
|
98
125
|
},
|
|
99
126
|
children: [
|
|
100
|
-
(
|
|
101
|
-
(
|
|
102
|
-
(
|
|
103
|
-
(
|
|
104
|
-
(
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
-
|
|
127
|
+
(result == null ? void 0 : result.outcome) === "failure" && /* @__PURE__ */ jsx("code", { style: { color: theme.palette.error.main }, children: /* @__PURE__ */ jsx("pre", { style: { marginTop: 0, marginBottom: 0 }, children: result.error }) }),
|
|
128
|
+
(result == null ? void 0 : result.format) === "markdown" && /* @__PURE__ */ jsx(Markdown, { md: result.data }),
|
|
129
|
+
(result == null ? void 0 : result.format) === "image" && /* @__PURE__ */ jsx("img", { src: result.data.image, alt: result.data.alt, ...imageProps, onClick: () => setShowPreview(true) }),
|
|
130
|
+
(result == null ? void 0 : result.format) === "json" && /* @__PURE__ */ jsx(Box, { sx: { ".react-json-view": { backgroundColor: "transparent !important" } }, children: /* @__PURE__ */ jsx(JSONViewer, { data: result.data }) }),
|
|
131
|
+
(result == null ? void 0 : result.format) === "graph" && /* @__PURE__ */ jsx(Graph, { graph: result.data, sx: { minHeight: "600px" } }),
|
|
132
|
+
/* @__PURE__ */ jsx(FlexOne, {}),
|
|
133
|
+
/* @__PURE__ */ jsxs(
|
|
134
|
+
Stack,
|
|
108
135
|
{
|
|
109
136
|
direction: "row",
|
|
110
137
|
spacing: 1,
|
|
111
|
-
...
|
|
138
|
+
...stackProps,
|
|
112
139
|
sx: [
|
|
113
140
|
{
|
|
114
|
-
py:
|
|
141
|
+
py: theme.spacing(0.5),
|
|
115
142
|
display: "flex",
|
|
116
143
|
alignItems: "center"
|
|
117
144
|
},
|
|
118
|
-
...Array.isArray(
|
|
145
|
+
...Array.isArray(stackProps == null ? void 0 : stackProps.sx) ? stackProps == null ? void 0 : stackProps.sx : [stackProps == null ? void 0 : stackProps.sx]
|
|
119
146
|
],
|
|
120
147
|
children: [
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
|
|
148
|
+
/* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-landscape", color: "primary", fontSize: "small" }),
|
|
149
|
+
/* @__PURE__ */ jsx(
|
|
150
|
+
Tooltip,
|
|
124
151
|
{
|
|
125
|
-
title: /* @__PURE__ */
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
|
|
152
|
+
title: /* @__PURE__ */ jsxs(Stack, { spacing: 0.5, children: [
|
|
153
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
154
|
+
t("type"),
|
|
128
155
|
": ",
|
|
129
|
-
|
|
156
|
+
type
|
|
130
157
|
] }),
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
|
|
158
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
159
|
+
t("value"),
|
|
133
160
|
": ",
|
|
134
|
-
|
|
161
|
+
value
|
|
135
162
|
] }),
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
-
|
|
163
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
164
|
+
t("classification"),
|
|
138
165
|
": ",
|
|
139
|
-
|
|
166
|
+
classification ?? "N/A"
|
|
140
167
|
] })
|
|
141
168
|
] }),
|
|
142
|
-
children: /* @__PURE__ */
|
|
169
|
+
children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:outline-info", fontSize: "small" })
|
|
143
170
|
}
|
|
144
171
|
),
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
(
|
|
172
|
+
/* @__PURE__ */ jsx(FlexOne, {}),
|
|
173
|
+
(result == null ? void 0 : result.link) && /* @__PURE__ */ jsx(IconButton, { size: "small", component: "a", href: result.link, children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-open-in-new", fontSize: "small" }) })
|
|
147
174
|
]
|
|
148
175
|
}
|
|
149
176
|
),
|
|
150
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ jsx(PreviewModal, { ...previewProps, open: showPreview, result, onClose: () => setShowPreview(false) })
|
|
151
178
|
]
|
|
152
179
|
}
|
|
153
180
|
)
|
|
154
181
|
}
|
|
155
182
|
);
|
|
156
183
|
}
|
|
157
|
-
)
|
|
184
|
+
);
|
|
185
|
+
const Fetcher$1 = memo(Fetcher);
|
|
158
186
|
export {
|
|
159
|
-
|
|
187
|
+
Fetcher$1 as default
|
|
160
188
|
};
|
|
@@ -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-BDVjGvMI.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-7OtvGnmf.js";
|
|
3
|
+
import { memo, useEffect } from "react";
|
|
4
|
+
import { u as useContextSelector } from "../../index-BDVjGvMI.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$1 = memo(Entry);
|
|
11
13
|
export {
|
|
12
|
-
|
|
14
|
+
Entry$1 as default
|
|
13
15
|
};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { Stack
|
|
3
|
-
import { ClueGroupProvider
|
|
4
|
-
import { memo
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Stack } from "@mui/material";
|
|
3
|
+
import { ClueGroupProvider } from "../../hooks/ClueGroupContext.js";
|
|
4
|
+
import { memo } from "react";
|
|
5
|
+
import GroupControl from "./GroupControl.js";
|
|
6
|
+
const Group = ({ children, showHeader = true, slotProps, ...groupProps }) => {
|
|
7
|
+
return /* @__PURE__ */ jsx(ClueGroupProvider, { ...groupProps, children: showHeader ? /* @__PURE__ */ jsxs(Stack, { direction: "column", alignSelf: "stretch", ...(slotProps == null ? void 0 : slotProps.stack) ?? {}, children: [
|
|
8
|
+
/* @__PURE__ */ jsx(GroupControl, {}),
|
|
9
|
+
children
|
|
10
|
+
] }) : children });
|
|
11
|
+
};
|
|
12
|
+
const Group$1 = memo(Group);
|
|
10
13
|
export {
|
|
11
|
-
|
|
14
|
+
Group$1 as default
|
|
12
15
|
};
|