@cccsaurora/clue-ui 1.3.0-dev.404 → 1.3.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-CHOSKfvu.js +4403 -0
- package/AnnotationDetails-Bqq6Ymmg.js +160 -0
- package/AnnotationPreview-CqXmC-j8.js +140 -0
- package/ClueEnrichContext-DL6aGe1k.js +432 -0
- package/FlexOne-BXWFOd1T.js +6 -0
- package/_MapCache-DRK-s2eK.js +179 -0
- package/_Set-DrS_bbSV.js +6 -0
- package/_Uint8Array-D9R2N9Lp.js +98 -0
- package/_arrayIncludes-Dcl_29E6.js +25 -0
- package/_arrayPush-DBJIuK2V.js +8 -0
- package/_baseAssignValue-Bx1cxHj5.js +12 -0
- package/_baseClone-DRhywkxm.js +211 -0
- package/_baseExtremum-DodEaEyF.js +16 -0
- package/_baseFlatten-CD9NgrYE.js +72 -0
- package/_baseGet-bVwDaGrA.js +80 -0
- package/_baseGetTag-CxDaTem-.js +25 -0
- package/_baseIsEqual-C-FKsm1J.js +150 -0
- package/_baseIteratee-D0FhC5bC.js +95 -0
- package/_baseRest-D_eW2E0d.js +8 -0
- package/_baseSlice-M5RKzt1A.js +10 -0
- package/_baseSum-wEbgNeUs.js +10 -0
- package/_baseUniq-D3N8igOm.js +41 -0
- package/_cacheHas-Wgl-hw34.js +22 -0
- package/_commonjsHelpers-C6fGbg64.js +6 -0
- package/_createAggregator-BVj8IAuF.js +53 -0
- package/_defineProperty-BZU4WKA3.js +11 -0
- package/_getPrototype-BGBCg-aX.js +5 -0
- package/_getTag-B7R9qBo7.js +73 -0
- package/_isIterateeCall-Dm0VTAYy.js +13 -0
- package/_setToArray-Ck4YZu0Z.js +9 -0
- package/cloneDeep-fV59zwUf.js +8 -0
- package/components/AnnotationBody.js +35 -49
- package/components/AnnotationDetailPopover.js +30 -36
- package/components/AnnotationDetails.js +7 -7
- package/components/AnnotationEntry.js +35 -35
- package/components/AnnotationPreview.js +5 -5
- package/components/ClassificationChip.js +23 -44
- package/components/CountBadge.js +26 -31
- package/components/EnrichedCard.js +97 -110
- package/components/EnrichedChip.js +105 -130
- package/components/EnrichedTypography.js +107 -133
- 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 +59 -75
- package/components/actions/ResultModal.js +4 -4
- package/components/actions/form/schemaAdapter.js +23 -39
- package/components/actions/formats/FileResult.js +59 -86
- package/components/actions/formats/index.js +25 -29
- package/components/display/graph/ExpandMoreButton.js +10 -10
- package/components/display/graph/elements/NodeCard.js +91 -111
- package/components/display/graph/elements/NodeTag.js +13 -15
- package/components/display/graph/index.js +202 -261
- package/components/display/graph/visualizations/Leaf.js +70 -89
- 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 +306 -408
- package/components/display/icons/Iconified.js +12 -27
- package/components/display/json/index.js +4 -4
- package/components/display/markdown/index.js +5770 -8678
- package/components/enrichment/EnrichPopover.js +46 -54
- package/components/fetchers/Fetcher.js +123 -166
- package/components/fetchers/FetcherResultView.js +27 -31
- package/components/fetchers/PreviewModal.js +16 -17
- package/components/fetchers/StatusChip.js +17 -21
- 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 +32 -45
- package/countBy-B3rNuG4T.js +8 -0
- package/data/event.js +4 -6
- package/database/globals.js +2 -2
- package/database/index.js +3 -3
- package/database/replication.js +4 -4
- package/get-Bil3mzRD.js +8 -0
- package/groupBy-CrJC7sGa.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 +23 -35
- package/hooks/ClueEnrichContext.js +11 -11
- package/hooks/ClueFetcherContext.js +56 -83
- package/hooks/ClueGroupContext.js +14 -17
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +11 -13
- package/hooks/ClueUIPluginContext.js +35 -49
- package/hooks/selectors.js +7 -7
- package/hooks/useActionResult.js +3 -3
- package/hooks/useAnnotations.js +32 -48
- package/hooks/useClue.js +4 -6
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +4 -6
- package/hooks/useClueTypeConfig.js +24 -49
- package/hooks/useClueUIPlugins.js +7 -8
- package/hooks/useComparator.js +435 -722
- package/hooks/useErrors.js +18 -22
- package/hooks/useFetcherResult.js +24 -33
- package/hooks/useMyHighlights.js +36 -66
- package/hooks/useMyLocalStorage.js +37 -66
- package/iconify-Ptb5dTKy.js +1270 -0
- package/icons/Action.js +49 -66
- package/icons/Assessment.js +69 -85
- package/icons/Context.js +63 -77
- package/icons/Opinion.js +60 -76
- package/icons/iconMap.js +2 -2
- package/identity-ByMq8VxU.js +6 -0
- package/index-BH-gBhtO.js +2282 -0
- package/index-BM9Sve5T.js +571 -0
- package/index-Cj4d5cGz.js +357 -0
- package/index-Dh2PP9h8.js +11747 -0
- package/index-DoFpWPHo.js +975 -0
- package/index-DzVIklWY.js +6464 -0
- package/isArguments-BWcXOE6a.js +24 -0
- package/isArray-WzO_os3q.js +4 -0
- package/isEmpty-DKxrY-_M.js +22 -0
- package/isNil-CjWwlQS3.js +6 -0
- package/isObject-B53jY8Qg.js +7 -0
- package/isObjectLike-CYbdrIBr.js +6 -0
- package/isSymbol-DE1Kcy2M.js +9 -0
- package/last-7CdUxN0r.js +7 -0
- package/main.js +62 -62
- package/maxBy-BOWDkL_D.js +8 -0
- package/package.json +1 -1
- package/plugins/ClueUIPlugin.js +96 -163
- package/plugins/file/index.js +15 -15
- package/plugins/graph/index.js +26 -29
- package/plugins/image/index.js +24 -28
- package/plugins/json/index.js +21 -21
- package/plugins/markdown/index.js +18 -18
- package/plugins/registry.js +6 -6
- package/plugins/store.js +4 -4
- package/plugins/test/index.js +17 -17
- package/plugins/utils.js +12 -13
- package/replication-WkKbPdwG.js +8453 -0
- package/sessionStorage-DFMae61b.js +90 -0
- package/sortBy-BHe812lF.js +74 -0
- package/store-DClHBq7r.js +1169 -0
- package/sumBy-B7f_bP_k.js +8 -0
- package/text/Frequency.js +23 -42
- package/toFinite-CBrE65MP.js +14 -0
- package/toNumber-CxmWey0f.js +31 -0
- package/uniq-B4UZ671_.js +7 -0
- package/utils/chain.js +65 -92
- package/utils/classificationParser.js +256 -519
- package/utils/constants.js +11 -37
- 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 +7 -7
- package/utils/time.js +427 -447
- package/utils/utils.js +10 -10
- package/utils/window.js +10 -21
- package/utils-SpTOhPYl.js +147 -0
- package/ActionForm-CqKcnDWC.js +0 -6099
- package/AnnotationDetails-BlPd3T8k.js +0 -176
- package/AnnotationPreview-Bl447SKT.js +0 -188
- package/ClueEnrichContext-B3YrTCaJ.js +0 -567
- package/FlexOne-BSYAhhtG.js +0 -9
- package/_MapCache-kuEY_iOH.js +0 -220
- package/_Set-BrSMTlHn.js +0 -6
- package/_Uint8Array-OPpgYQj7.js +0 -123
- package/_arrayIncludes-BNqL-9ZP.js +0 -31
- package/_arrayPush-CBkQqaE_.js +0 -10
- package/_baseAssignValue-CNUVPOBW.js +0 -16
- package/_baseClone-9FaRd1R2.js +0 -287
- package/_baseExtremum-wOGT4Dgw.js +0 -18
- package/_baseFlatten-Co6QHDlG.js +0 -92
- package/_baseGet-Cmp6FztG.js +0 -109
- package/_baseGetTag-Hj-0NTYF.js +0 -44
- package/_baseIsEqual-1CpU47TZ.js +0 -211
- package/_baseIteratee-BN7Vbe5g.js +0 -126
- package/_baseRest-BZ_hQ9PC.js +0 -8
- package/_baseSlice-GAv_YFTT.js +0 -20
- package/_baseSum-D0WC1dN0.js +0 -13
- package/_baseUniq-BnvS3JHL.js +0 -63
- package/_cacheHas-_aF2y2Xv.js +0 -25
- package/_commonjsHelpers-CUmg6egw.js +0 -6
- package/_createAggregator-BUZrP_is.js +0 -63
- package/_defineProperty-DolZLKmv.js +0 -12
- package/_getPrototype-Bb4gm-5m.js +0 -5
- package/_getTag-CML_cXiN.js +0 -105
- package/_isIterateeCall-B1IFEqVv.js +0 -17
- package/_setToArray-CqyqC8ib.js +0 -10
- package/cloneDeep-l3UkXG5M.js +0 -8
- package/countBy-Bqcp3VCs.js +0 -14
- package/get-CdMThM8x.js +0 -8
- package/groupBy-BVV07EGQ.js +0 -14
- package/iconify-DJxl6dC-.js +0 -1789
- package/identity-CPGTqrE4.js +0 -6
- package/index-CAvu7vwt.js +0 -1172
- package/index-CVUD9o3t.js +0 -15768
- package/index-DUEubgWN.js +0 -464
- package/index-Dj1N4IQP.js +0 -9314
- package/index-DpJxD74E.js +0 -3272
- package/index-_gpzM2Px.js +0 -702
- package/isArguments-CuYlEuhP.js +0 -27
- package/isArray-RJPfgWqI.js +0 -4
- package/isEmpty-BE656RUK.js +0 -30
- package/isNil-CIubwp4T.js +0 -6
- package/isObject-FTY-5JQX.js +0 -7
- package/isObjectLike-CeENW9FN.js +0 -6
- package/isSymbol-D_H4HPZQ.js +0 -9
- package/last-CUCl67Im.js +0 -7
- package/maxBy-BjjQmX5t.js +0 -8
- package/replication--gLEZw8a.js +0 -11777
- package/sessionStorage-B68y-wnE.js +0 -140
- package/sortBy-B8JVsLQY.js +0 -95
- package/store-B9sjQbcS.js +0 -2163
- package/sumBy-D-HCzM2i.js +0 -8
- package/toFinite-meZTg4Su.js +0 -16
- package/toNumber-B5JaA1vX.js +0 -39
- package/uniq-CahZPAwp.js +0 -7
- package/utils-CEySTPtg.js +0 -224
|
@@ -1,87 +1,79 @@
|
|
|
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 { e as
|
|
4
|
-
import { useState, useRef, useCallback, useEffect } from "react";
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
const { t } =
|
|
8
|
-
|
|
9
|
-
|
|
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);
|
|
1
|
+
import { jsxs as y, Fragment as C, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme as k, Tooltip as S, IconButton as E, CircularProgress as d, Button as z, Popover as I, Paper as j, Stack as c, Box as P, Typography as B, Divider as O } from "@mui/material";
|
|
3
|
+
import { e as T, f as p, c as w } from "../../ActionForm-CHOSKfvu.js";
|
|
4
|
+
import { useState as m, useRef as M, useCallback as D, useEffect as F } from "react";
|
|
5
|
+
import g from "../display/icons/Iconified.js";
|
|
6
|
+
const H = ({ show: t = !1, size: b = "small", selector: n }) => {
|
|
7
|
+
const { t: s } = T((i) => i.i18next), h = k(), a = p((i) => i.availableSources), u = p((i) => i.enrich), [x, o] = m(t), [r, f] = m(!1), l = M(null), v = D(
|
|
8
|
+
async (i) => {
|
|
9
|
+
f(!0);
|
|
17
10
|
try {
|
|
18
|
-
await
|
|
19
|
-
classification:
|
|
11
|
+
await u(n.type, n.value, {
|
|
12
|
+
classification: n.classification,
|
|
20
13
|
timeout: 30,
|
|
21
|
-
force:
|
|
22
|
-
noCache:
|
|
23
|
-
sources: [
|
|
24
|
-
append:
|
|
14
|
+
force: !0,
|
|
15
|
+
noCache: !0,
|
|
16
|
+
sources: [i],
|
|
17
|
+
append: !0
|
|
25
18
|
});
|
|
26
19
|
} finally {
|
|
27
|
-
|
|
20
|
+
f(!1);
|
|
28
21
|
}
|
|
29
22
|
},
|
|
30
|
-
[
|
|
23
|
+
[u, n.classification, n.type, n.value]
|
|
31
24
|
);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}, [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
IconButton,
|
|
25
|
+
return F(() => {
|
|
26
|
+
o(t);
|
|
27
|
+
}, [t]), /* @__PURE__ */ y(C, { children: [
|
|
28
|
+
b === "small" ? /* @__PURE__ */ e(S, { ref: l, title: s("enrich"), children: /* @__PURE__ */ e("span", { style: { alignSelf: "center" }, children: /* @__PURE__ */ e(
|
|
29
|
+
E,
|
|
38
30
|
{
|
|
39
|
-
onClick: () =>
|
|
40
|
-
disabled: Object.keys(
|
|
31
|
+
onClick: () => o(!0),
|
|
32
|
+
disabled: Object.keys(a).length < 1 || r,
|
|
41
33
|
color: "info",
|
|
42
|
-
children:
|
|
34
|
+
children: r ? /* @__PURE__ */ e(d, { color: "info", size: "24px" }) : /* @__PURE__ */ e(g, { icon: "ic:baseline-auto-fix-high" })
|
|
43
35
|
}
|
|
44
|
-
) }) }) : /* @__PURE__ */
|
|
45
|
-
|
|
36
|
+
) }) }) : /* @__PURE__ */ e(
|
|
37
|
+
z,
|
|
46
38
|
{
|
|
47
|
-
ref:
|
|
39
|
+
ref: l,
|
|
48
40
|
variant: "outlined",
|
|
49
41
|
color: "info",
|
|
50
|
-
disabled: Object.keys(
|
|
51
|
-
startIcon:
|
|
42
|
+
disabled: Object.keys(a).length < 1 || r,
|
|
43
|
+
startIcon: r ? /* @__PURE__ */ e(d, { color: "info", size: "20px" }) : /* @__PURE__ */ e(g, { icon: "ic:baseline-auto-fix-high" }),
|
|
52
44
|
sx: { alignSelf: "stretch" },
|
|
53
|
-
onClick: () =>
|
|
54
|
-
children:
|
|
45
|
+
onClick: () => o(!0),
|
|
46
|
+
children: s("enrich")
|
|
55
47
|
}
|
|
56
48
|
),
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
|
|
49
|
+
/* @__PURE__ */ e(
|
|
50
|
+
I,
|
|
59
51
|
{
|
|
60
52
|
sx: { zIndex: 2e3 },
|
|
61
|
-
open:
|
|
62
|
-
disablePortal:
|
|
63
|
-
onClose: () =>
|
|
64
|
-
anchorEl:
|
|
53
|
+
open: x,
|
|
54
|
+
disablePortal: !0,
|
|
55
|
+
onClose: () => o(!1),
|
|
56
|
+
anchorEl: l.current,
|
|
65
57
|
anchorOrigin: { horizontal: "left", vertical: "bottom" },
|
|
66
|
-
children: /* @__PURE__ */
|
|
67
|
-
|
|
58
|
+
children: /* @__PURE__ */ e(j, { onClick: () => o(!1), children: /* @__PURE__ */ e(c, { divider: /* @__PURE__ */ e(O, { flexItem: !0, orientation: "horizontal" }), children: a.map((i) => /* @__PURE__ */ e(
|
|
59
|
+
P,
|
|
68
60
|
{
|
|
69
61
|
sx: {
|
|
70
62
|
px: 3,
|
|
71
63
|
py: 1,
|
|
72
64
|
cursor: "pointer",
|
|
73
|
-
transition:
|
|
74
|
-
"&:hover": { backgroundColor:
|
|
65
|
+
transition: h.transitions.create("background-color"),
|
|
66
|
+
"&:hover": { backgroundColor: h.palette.background.default }
|
|
75
67
|
},
|
|
76
|
-
onClick: () =>
|
|
77
|
-
children: /* @__PURE__ */
|
|
68
|
+
onClick: () => v(i),
|
|
69
|
+
children: /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(c, { direction: "row", spacing: 1, alignItems: "center", children: /* @__PURE__ */ e(B, { variant: "body1", children: i.split("-").map(w).join(" ") }) }) })
|
|
78
70
|
},
|
|
79
|
-
|
|
71
|
+
i
|
|
80
72
|
)) }) })
|
|
81
73
|
}
|
|
82
74
|
)
|
|
83
75
|
] });
|
|
84
76
|
};
|
|
85
77
|
export {
|
|
86
|
-
|
|
78
|
+
H as default
|
|
87
79
|
};
|
|
@@ -1,148 +1,106 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { I as
|
|
3
|
-
import { useTheme, Skeleton, Chip, Tooltip, Stack, Typography, LinearProgress, Paper, IconButton } from "@mui/material";
|
|
4
|
-
import { F as
|
|
5
|
-
import
|
|
6
|
-
import { ClueComponentContext } from "../../hooks/ClueComponentContext.js";
|
|
7
|
-
import { g as
|
|
8
|
-
import
|
|
9
|
-
import { a as
|
|
10
|
-
import { FetcherResultView } from "./FetcherResultView.js";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
const
|
|
1
|
+
import { jsx as t, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { I as J } from "../../iconify-Ptb5dTKy.js";
|
|
3
|
+
import { useTheme as K, Skeleton as W, Chip as Q, Tooltip as D, Stack as s, Typography as U, LinearProgress as X, Paper as Y, IconButton as Z } from "@mui/material";
|
|
4
|
+
import { F as E } from "../../FlexOne-BXWFOd1T.js";
|
|
5
|
+
import S from "../display/icons/Iconified.js";
|
|
6
|
+
import { ClueComponentContext as $ } from "../../hooks/ClueComponentContext.js";
|
|
7
|
+
import { g as f } from "../../ActionForm-CHOSKfvu.js";
|
|
8
|
+
import p, { useState as b, useRef as k, useMemo as N, useEffect as O, memo as P } from "react";
|
|
9
|
+
import { a as ee } from "../../index-BM9Sve5T.js";
|
|
10
|
+
import { FetcherResultView as te } from "./FetcherResultView.js";
|
|
11
|
+
import ie from "./PreviewModal.js";
|
|
12
|
+
import ne from "./StatusChip.js";
|
|
13
|
+
const re = p.memo(
|
|
14
14
|
({
|
|
15
|
-
type,
|
|
16
|
-
value,
|
|
17
|
-
classification,
|
|
18
|
-
fetcherId,
|
|
15
|
+
type: h,
|
|
16
|
+
value: x,
|
|
17
|
+
classification: g,
|
|
18
|
+
fetcherId: n,
|
|
19
19
|
slotProps: {
|
|
20
|
-
paper:
|
|
21
|
-
preview:
|
|
22
|
-
stack:
|
|
23
|
-
image:
|
|
24
|
-
chip:
|
|
25
|
-
skeleton:
|
|
20
|
+
paper: o = {},
|
|
21
|
+
preview: q = {},
|
|
22
|
+
stack: a = {},
|
|
23
|
+
image: v = {},
|
|
24
|
+
chip: R = {},
|
|
25
|
+
skeleton: r = {}
|
|
26
26
|
} = {}
|
|
27
27
|
}) => {
|
|
28
|
-
var
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
let cancelled = false;
|
|
43
|
-
const poll = async () => {
|
|
44
|
-
const res = await getFetcherStatus(fetcherId, taskId);
|
|
45
|
-
if (!res) {
|
|
46
|
-
setResult({ outcome: "failure", done: true, error: "Missing result", link: "" });
|
|
47
|
-
} else if (res.outcome === "success" || res.outcome === "failure") {
|
|
48
|
-
setResult({ ...res, done: true });
|
|
49
|
-
} else {
|
|
50
|
-
if (cancelled) return;
|
|
51
|
-
setResult({ ...res });
|
|
52
|
-
timeoutRef.current = setTimeout(poll, 2e3);
|
|
28
|
+
var M, j, B, L;
|
|
29
|
+
const c = K(), w = f((i) => i.fetchers), F = f((i) => i.fetchSelector), A = f((i) => i.getFetcherStatus), G = f((i) => i.fetchCompleted), { t: u } = ee($, (i) => i == null ? void 0 : i.i18next), [e, m] = b(null), [H, _] = b(!0), [I, z] = b(!1), y = k(null), C = N(() => e == null ? void 0 : e.task_id, [e == null ? void 0 : e.task_id]);
|
|
30
|
+
O(() => {
|
|
31
|
+
if ((e == null ? void 0 : e.outcome) !== "pending" || !C) return;
|
|
32
|
+
let i = !1;
|
|
33
|
+
const V = async () => {
|
|
34
|
+
const d = await A(n, C);
|
|
35
|
+
if (!d)
|
|
36
|
+
m({ outcome: "failure", done: !0, error: "Missing result", link: "" });
|
|
37
|
+
else if (d.outcome === "success" || d.outcome === "failure")
|
|
38
|
+
m({ ...d, done: !0 });
|
|
39
|
+
else {
|
|
40
|
+
if (i) return;
|
|
41
|
+
m({ ...d }), y.current = setTimeout(V, 2e3);
|
|
53
42
|
}
|
|
54
43
|
};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
cancelled = true;
|
|
58
|
-
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
44
|
+
return V(), () => {
|
|
45
|
+
i = !0, y.current && clearTimeout(y.current);
|
|
59
46
|
};
|
|
60
|
-
}, [
|
|
61
|
-
useEffect(() => {
|
|
47
|
+
}, [n, A, e == null ? void 0 : e.outcome, C]), O(() => {
|
|
62
48
|
(async () => {
|
|
63
49
|
try {
|
|
64
|
-
|
|
65
|
-
setResult(await fetchSelector(fetcherId, { type, value, classification }));
|
|
50
|
+
_(!0), m(await F(n, { type: h, value: x, classification: g }));
|
|
66
51
|
} catch {
|
|
67
|
-
|
|
52
|
+
m({ outcome: "failure", done: !0, error: u("error.unexpected") });
|
|
68
53
|
} finally {
|
|
69
|
-
|
|
54
|
+
_(!1);
|
|
70
55
|
}
|
|
71
56
|
})();
|
|
72
|
-
}, [
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
if (!fetcherId) {
|
|
81
|
-
console.warn("Missing fetcher Id. Component will not render.");
|
|
82
|
-
return null;
|
|
83
|
-
} else if (!fetcherId.includes(".")) {
|
|
84
|
-
console.warn(
|
|
57
|
+
}, [g, F, n, u, h, x]);
|
|
58
|
+
const T = N(() => (e == null ? void 0 : e.outcome) === "success" && e.format === "image" ? { ...v, onClick: () => z(!0) } : { result: e }, [v, e]);
|
|
59
|
+
if (G)
|
|
60
|
+
if (n)
|
|
61
|
+
if (n.includes(".")) {
|
|
62
|
+
if (!(n in w))
|
|
63
|
+
return console.warn("Fetcher ID does not correspond to a registered fetcher. Component will not render."), null;
|
|
64
|
+
} else return console.warn(
|
|
85
65
|
"Invalid fetcher id. Must be in the format '<plugin_id>.<fetcher_id>'. Component will not render."
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
console.warn("Fetcher ID does not correspond to a registered fetcher. Component will not render.");
|
|
90
|
-
return null;
|
|
91
|
-
}
|
|
92
|
-
} else {
|
|
66
|
+
), null;
|
|
67
|
+
else return console.warn("Missing fetcher Id. Component will not render."), null;
|
|
68
|
+
else
|
|
93
69
|
return null;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
)
|
|
110
|
-
|
|
111
|
-
|
|
70
|
+
return H ? ((M = w[n]) == null ? void 0 : M.format) === "status" ? /* @__PURE__ */ t(
|
|
71
|
+
W,
|
|
72
|
+
{
|
|
73
|
+
variant: "rounded",
|
|
74
|
+
height: "32px",
|
|
75
|
+
width: "150px",
|
|
76
|
+
...r,
|
|
77
|
+
sx: [
|
|
78
|
+
{ borderRadius: "16px" },
|
|
79
|
+
...Array.isArray(r == null ? void 0 : r.sx) ? r == null ? void 0 : r.sx : [r == null ? void 0 : r.sx]
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
) : /* @__PURE__ */ t(W, { variant: "rounded", height: "325px", width: "300px", ...r }) : e ? e.outcome === "failure" && w[n].format === "status" ? /* @__PURE__ */ t(
|
|
83
|
+
Q,
|
|
84
|
+
{
|
|
85
|
+
icon: /* @__PURE__ */ t(D, { title: e.error, children: /* @__PURE__ */ t(J, { icon: "mdi:information-outline", fontSize: "1.25rem" }) }),
|
|
86
|
+
label: u("error"),
|
|
87
|
+
color: "error",
|
|
88
|
+
...R
|
|
112
89
|
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
Chip,
|
|
90
|
+
) : e.outcome === "pending" ? /* @__PURE__ */ l(s, { flex: 1, sx: { pt: 2, alignItems: "center" }, spacing: 1, children: [
|
|
91
|
+
((j = e.data) == null ? void 0 : j.summary) && /* @__PURE__ */ t(U, { variant: "caption", children: e.data.summary }),
|
|
92
|
+
/* @__PURE__ */ t(
|
|
93
|
+
X,
|
|
118
94
|
{
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
...chipProps
|
|
95
|
+
variant: (B = e.data) != null && B.progress ? "determinate" : "indeterminate",
|
|
96
|
+
value: ((L = e.data) == null ? void 0 : L.progress) * 100,
|
|
97
|
+
sx: { maxWidth: 500, width: "100%", borderRadius: c.shape.borderRadius }
|
|
123
98
|
}
|
|
124
|
-
)
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return /* @__PURE__ */ jsxs(Stack, { flex: 1, sx: { pt: 2, alignItems: "center" }, spacing: 1, children: [
|
|
128
|
-
((_b = result.data) == null ? void 0 : _b.summary) && /* @__PURE__ */ jsx(Typography, { variant: "caption", children: result.data.summary }),
|
|
129
|
-
/* @__PURE__ */ jsx(
|
|
130
|
-
LinearProgress,
|
|
131
|
-
{
|
|
132
|
-
variant: ((_c = result.data) == null ? void 0 : _c.progress) ? "determinate" : "indeterminate",
|
|
133
|
-
value: ((_d = result.data) == null ? void 0 : _d.progress) * 100,
|
|
134
|
-
sx: { maxWidth: 500, width: "100%", borderRadius: theme.shape.borderRadius }
|
|
135
|
-
}
|
|
136
|
-
)
|
|
137
|
-
] });
|
|
138
|
-
}
|
|
139
|
-
if (result.format === "status") {
|
|
140
|
-
return /* @__PURE__ */ jsx(StatusChip, { data: result.data, ...chipProps });
|
|
141
|
-
}
|
|
142
|
-
return /* @__PURE__ */ jsx(
|
|
143
|
-
Paper,
|
|
99
|
+
)
|
|
100
|
+
] }) : e.format === "status" ? /* @__PURE__ */ t(ne, { data: e.data, ...R }) : /* @__PURE__ */ t(
|
|
101
|
+
Y,
|
|
144
102
|
{
|
|
145
|
-
...
|
|
103
|
+
...o,
|
|
146
104
|
sx: [
|
|
147
105
|
{
|
|
148
106
|
p: 1,
|
|
@@ -151,16 +109,16 @@ const Fetcher = React__default.memo(
|
|
|
151
109
|
width: "100%",
|
|
152
110
|
minWidth: "300px"
|
|
153
111
|
},
|
|
154
|
-
...Array.isArray(
|
|
112
|
+
...Array.isArray(o == null ? void 0 : o.sx) ? o == null ? void 0 : o.sx : [o == null ? void 0 : o.sx]
|
|
155
113
|
],
|
|
156
|
-
children: /* @__PURE__ */
|
|
157
|
-
|
|
114
|
+
children: /* @__PURE__ */ l(
|
|
115
|
+
s,
|
|
158
116
|
{
|
|
159
117
|
sx: {
|
|
160
118
|
"& > img": {
|
|
161
119
|
borderRadius: "3px",
|
|
162
120
|
cursor: "zoom-in",
|
|
163
|
-
transition:
|
|
121
|
+
transition: c.transitions.create("border-color", { duration: c.transitions.duration.shortest }),
|
|
164
122
|
border: "3px solid transparent",
|
|
165
123
|
"&:hover": {
|
|
166
124
|
borderColor: "primary.main"
|
|
@@ -168,72 +126,71 @@ const Fetcher = React__default.memo(
|
|
|
168
126
|
}
|
|
169
127
|
},
|
|
170
128
|
children: [
|
|
171
|
-
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
-
|
|
129
|
+
e.outcome === "failure" && /* @__PURE__ */ t("code", { style: { color: c.palette.error.main }, children: /* @__PURE__ */ t("pre", { style: { marginTop: 0, marginBottom: 0 }, children: e.error }) }),
|
|
130
|
+
/* @__PURE__ */ t(te, { result: e, fetcherId: n, ...T }),
|
|
131
|
+
/* @__PURE__ */ t(E, {}),
|
|
132
|
+
/* @__PURE__ */ l(
|
|
133
|
+
s,
|
|
176
134
|
{
|
|
177
135
|
direction: "row",
|
|
178
136
|
spacing: 1,
|
|
179
|
-
...
|
|
137
|
+
...a,
|
|
180
138
|
sx: [
|
|
181
139
|
{
|
|
182
|
-
py:
|
|
140
|
+
py: c.spacing(0.5),
|
|
183
141
|
display: "flex",
|
|
184
142
|
alignItems: "center"
|
|
185
143
|
},
|
|
186
|
-
...Array.isArray(
|
|
144
|
+
...Array.isArray(a == null ? void 0 : a.sx) ? a == null ? void 0 : a.sx : [a == null ? void 0 : a.sx]
|
|
187
145
|
],
|
|
188
146
|
children: [
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
|
|
147
|
+
/* @__PURE__ */ t(S, { icon: "ic:baseline-landscape", color: "primary", fontSize: "small" }),
|
|
148
|
+
/* @__PURE__ */ t(
|
|
149
|
+
D,
|
|
192
150
|
{
|
|
193
|
-
title: /* @__PURE__ */
|
|
194
|
-
/* @__PURE__ */
|
|
195
|
-
|
|
151
|
+
title: /* @__PURE__ */ l(s, { spacing: 0.5, children: [
|
|
152
|
+
/* @__PURE__ */ l("span", { children: [
|
|
153
|
+
u("type"),
|
|
196
154
|
": ",
|
|
197
|
-
|
|
155
|
+
h
|
|
198
156
|
] }),
|
|
199
|
-
/* @__PURE__ */
|
|
200
|
-
|
|
157
|
+
/* @__PURE__ */ l("span", { children: [
|
|
158
|
+
u("value"),
|
|
201
159
|
": ",
|
|
202
|
-
|
|
160
|
+
x
|
|
203
161
|
] }),
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
-
|
|
162
|
+
/* @__PURE__ */ l("span", { children: [
|
|
163
|
+
u("classification"),
|
|
206
164
|
": ",
|
|
207
|
-
|
|
165
|
+
g ?? "N/A"
|
|
208
166
|
] })
|
|
209
167
|
] }),
|
|
210
|
-
children: /* @__PURE__ */
|
|
168
|
+
children: /* @__PURE__ */ t(S, { icon: "ic:outline-info", fontSize: "small" })
|
|
211
169
|
}
|
|
212
170
|
),
|
|
213
|
-
/* @__PURE__ */
|
|
214
|
-
|
|
171
|
+
/* @__PURE__ */ t(E, {}),
|
|
172
|
+
e.link && /* @__PURE__ */ t(Z, { size: "small", component: "a", href: e.link, children: /* @__PURE__ */ t(S, { icon: "ic:baseline-open-in-new", fontSize: "small" }) })
|
|
215
173
|
]
|
|
216
174
|
}
|
|
217
175
|
),
|
|
218
|
-
/* @__PURE__ */
|
|
219
|
-
|
|
176
|
+
/* @__PURE__ */ t(
|
|
177
|
+
ie,
|
|
220
178
|
{
|
|
221
|
-
...
|
|
222
|
-
fetcherId,
|
|
223
|
-
slotProps: { fetcherResultView:
|
|
224
|
-
open:
|
|
225
|
-
result,
|
|
226
|
-
onClose: () =>
|
|
179
|
+
...q,
|
|
180
|
+
fetcherId: n,
|
|
181
|
+
slotProps: { fetcherResultView: T },
|
|
182
|
+
open: I,
|
|
183
|
+
result: e,
|
|
184
|
+
onClose: () => z(!1)
|
|
227
185
|
}
|
|
228
186
|
)
|
|
229
187
|
]
|
|
230
188
|
}
|
|
231
189
|
)
|
|
232
190
|
}
|
|
233
|
-
);
|
|
191
|
+
) : null;
|
|
234
192
|
}
|
|
235
|
-
);
|
|
236
|
-
const Fetcher_default = memo(Fetcher);
|
|
193
|
+
), we = P(re);
|
|
237
194
|
export {
|
|
238
|
-
|
|
195
|
+
we as default
|
|
239
196
|
};
|
|
@@ -1,41 +1,37 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Stack } from "@mui/material";
|
|
3
|
-
import { J as
|
|
4
|
-
import
|
|
5
|
-
import { u as
|
|
6
|
-
import { useTranslation } from "react-i18next";
|
|
7
|
-
import
|
|
8
|
-
const
|
|
9
|
-
pluginName,
|
|
10
|
-
result,
|
|
11
|
-
fetcherId,
|
|
12
|
-
...
|
|
1
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { Stack as c } from "@mui/material";
|
|
3
|
+
import { J as m } from "../../index-Cj4d5cGz.js";
|
|
4
|
+
import f from "../display/markdown/index.js";
|
|
5
|
+
import { u as p, c as g } from "../../store-DClHBq7r.js";
|
|
6
|
+
import { useTranslation as h } from "react-i18next";
|
|
7
|
+
import u from "../ErrorBoundary.js";
|
|
8
|
+
const y = ({
|
|
9
|
+
pluginName: l,
|
|
10
|
+
result: o,
|
|
11
|
+
fetcherId: t,
|
|
12
|
+
...d
|
|
13
13
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
const availablePlugin = pluginName ?? clueUIPluginStore.getPlugin(result.format ?? "undefined", "fetcher", void 0, fetcherId);
|
|
17
|
-
if (availablePlugin) {
|
|
14
|
+
const s = p(), { t: e } = h(), n = l ?? g.getPlugin(o.format ?? "undefined", "fetcher", void 0, t);
|
|
15
|
+
if (n)
|
|
18
16
|
try {
|
|
19
|
-
const
|
|
20
|
-
result,
|
|
21
|
-
fetcherId,
|
|
22
|
-
...
|
|
17
|
+
const a = s.executeFunction(`${n}.fetcherResult`, {
|
|
18
|
+
result: o,
|
|
19
|
+
fetcherId: t,
|
|
20
|
+
...d
|
|
23
21
|
});
|
|
24
|
-
if (
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
}
|
|
22
|
+
if (a !== void 0)
|
|
23
|
+
return /* @__PURE__ */ r(u, { children: a });
|
|
27
24
|
} catch {
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ r(u, { children: /* @__PURE__ */ i(c, { sx: { overflowY: "auto" }, children: [
|
|
26
|
+
/* @__PURE__ */ r(f, { md: e("format.render.error", { format: o.format }) }),
|
|
27
|
+
/* @__PURE__ */ r(m, { data: o, collapse: !0, forceCompact: !0 })
|
|
31
28
|
] }) });
|
|
32
29
|
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */ jsx(JSONViewer, { data: result, collapse: true, forceCompact: true })
|
|
30
|
+
return /* @__PURE__ */ i(c, { sx: { overflowY: "auto" }, children: [
|
|
31
|
+
/* @__PURE__ */ r(f, { md: e("format.not.recognized", { format: o.format }) }),
|
|
32
|
+
/* @__PURE__ */ r(m, { data: o, collapse: !0, forceCompact: !0 })
|
|
37
33
|
] });
|
|
38
34
|
};
|
|
39
35
|
export {
|
|
40
|
-
FetcherResultView
|
|
36
|
+
y as FetcherResultView
|
|
41
37
|
};
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Modal, Paper } from "@mui/material";
|
|
3
|
-
import { memo } from "react";
|
|
4
|
-
import { FetcherResultView } from "./FetcherResultView.js";
|
|
5
|
-
const
|
|
6
|
-
const { fetcherResultView, ...
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
-
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { Modal as c, Paper as d } from "@mui/material";
|
|
3
|
+
import { memo as u } from "react";
|
|
4
|
+
import { FetcherResultView as s } from "./FetcherResultView.js";
|
|
5
|
+
const w = ({ result: a, slotProps: e = {}, fetcherId: m, onClose: n, open: f = !1, ...i }) => {
|
|
6
|
+
const { fetcherResultView: t, ...x } = e;
|
|
7
|
+
return /* @__PURE__ */ l(
|
|
8
|
+
c,
|
|
9
9
|
{
|
|
10
|
-
open,
|
|
10
|
+
open: f,
|
|
11
11
|
sx: [
|
|
12
12
|
{ display: "flex", alignItems: "center", justifyContent: "center" },
|
|
13
|
-
...Array.isArray(
|
|
13
|
+
...Array.isArray(i == null ? void 0 : i.sx) ? i == null ? void 0 : i.sx : [i == null ? void 0 : i.sx]
|
|
14
14
|
],
|
|
15
|
-
onClose,
|
|
16
|
-
slotProps:
|
|
17
|
-
...
|
|
18
|
-
children: /* @__PURE__ */
|
|
15
|
+
onClose: n,
|
|
16
|
+
slotProps: x,
|
|
17
|
+
...i,
|
|
18
|
+
children: /* @__PURE__ */ l(d, { sx: { maxHeight: "90%", maxWidth: "90%", p: 2, overflow: "auto" }, children: /* @__PURE__ */ l(s, { ...t ?? {}, result: a, fetcherId: m }) })
|
|
19
19
|
}
|
|
20
20
|
);
|
|
21
|
-
};
|
|
22
|
-
const PreviewModal$1 = memo(PreviewModal);
|
|
21
|
+
}, j = u(w);
|
|
23
22
|
export {
|
|
24
|
-
|
|
23
|
+
j as default
|
|
25
24
|
};
|