@cccsaurora/clue-ui 1.4.1 → 1.4.2-dev.453
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-CbLz66Rk.js +6099 -0
- package/AnnotationDetails-CdNvyJl7.js +176 -0
- package/AnnotationPreview-C6a3qRFG.js +188 -0
- package/ClueEnrichContext-0eVIgvZp.js +594 -0
- package/FlexOne-BSYAhhtG.js +9 -0
- package/_MapCache-kuEY_iOH.js +220 -0
- package/_Set-BrSMTlHn.js +6 -0
- package/_Uint8Array-OPpgYQj7.js +123 -0
- package/_arrayIncludes-BNqL-9ZP.js +31 -0
- package/_arrayPush-CBkQqaE_.js +10 -0
- package/_baseAssignValue-CNUVPOBW.js +16 -0
- package/_baseClone-9FaRd1R2.js +287 -0
- package/_baseExtremum-wOGT4Dgw.js +18 -0
- package/_baseFlatten-Co6QHDlG.js +92 -0
- package/_baseGet-Cmp6FztG.js +109 -0
- package/_baseGetTag-Hj-0NTYF.js +44 -0
- package/_baseIsEqual-1CpU47TZ.js +211 -0
- package/_baseIteratee-BN7Vbe5g.js +126 -0
- package/_baseRest-BZ_hQ9PC.js +8 -0
- package/_baseSlice-GAv_YFTT.js +20 -0
- package/_baseSum-D0WC1dN0.js +13 -0
- package/_baseUniq-BnvS3JHL.js +63 -0
- package/_cacheHas-_aF2y2Xv.js +25 -0
- package/_commonjsHelpers-CUmg6egw.js +6 -0
- package/_createAggregator-BUZrP_is.js +63 -0
- package/_defineProperty-DolZLKmv.js +12 -0
- package/_getPrototype-Bb4gm-5m.js +5 -0
- package/_getTag-CML_cXiN.js +105 -0
- package/_isIterateeCall-B1IFEqVv.js +17 -0
- package/_setToArray-CqyqC8ib.js +10 -0
- package/cloneDeep-l3UkXG5M.js +8 -0
- package/components/AnnotationBody.js +49 -35
- package/components/AnnotationDetailPopover.js +39 -30
- package/components/AnnotationDetails.js +7 -7
- package/components/AnnotationEntry.js +35 -35
- package/components/AnnotationPreview.js +5 -5
- package/components/ClassificationChip.js +46 -24
- 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 +29 -25
- 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 +89 -70
- 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 +166 -123
- package/components/fetchers/FetcherResultView.js +31 -27
- package/components/fetchers/PreviewModal.js +17 -16
- 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 +45 -32
- package/countBy-Bqcp3VCs.js +14 -0
- package/data/event.js +6 -4
- package/database/globals.js +2 -2
- package/database/index.js +3 -3
- package/database/replication.js +4 -4
- package/get-CdMThM8x.js +8 -0
- package/groupBy-BVV07EGQ.js +14 -0
- package/hooks/ClueActionContext.js +6 -6
- package/hooks/ClueComponentContext.js +29 -23
- package/hooks/ClueConfigProvider.js +14 -12
- package/hooks/ClueDatabaseContext.d.ts +4 -0
- package/hooks/ClueDatabaseContext.js +36 -23
- package/hooks/ClueEnrichContext.js +11 -11
- package/hooks/ClueFetcherContext.js +83 -56
- package/hooks/ClueGroupContext.js +17 -14
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +13 -11
- package/hooks/ClueUIPluginContext.js +50 -36
- package/hooks/selectors.js +7 -7
- package/hooks/useActionResult.js +3 -3
- package/hooks/useAnnotations.js +48 -32
- package/hooks/useClue.js +6 -4
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +6 -4
- package/hooks/useClueTypeConfig.js +49 -24
- package/hooks/useClueUIPlugins.js +8 -7
- package/hooks/useComparator.js +722 -435
- package/hooks/useErrors.js +22 -18
- package/hooks/useFetcherResult.js +33 -24
- package/hooks/useMyHighlights.js +66 -36
- package/hooks/useMyLocalStorage.js +66 -37
- package/iconify-DJxl6dC-.js +1789 -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-CDrC9oSE.js +1172 -0
- package/index-CVUD9o3t.js +15768 -0
- package/index-DUEubgWN.js +464 -0
- package/index-DpJxD74E.js +3272 -0
- package/index-IKI1G5v-.js +9314 -0
- package/index-_gpzM2Px.js +702 -0
- package/isArguments-CuYlEuhP.js +27 -0
- package/isArray-RJPfgWqI.js +4 -0
- package/isEmpty-BE656RUK.js +30 -0
- package/isNil-CIubwp4T.js +6 -0
- package/isObject-FTY-5JQX.js +7 -0
- package/isObjectLike-CeENW9FN.js +6 -0
- package/isSymbol-D_H4HPZQ.js +9 -0
- package/last-CUCl67Im.js +7 -0
- package/main.js +62 -62
- package/maxBy-BjjQmX5t.js +8 -0
- package/package.json +22 -22
- package/plugins/ClueUIPlugin.js +163 -96
- package/plugins/file/index.js +15 -15
- package/plugins/graph/index.js +29 -26
- package/plugins/image/index.js +28 -24
- 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 +13 -12
- package/replication-kdsH0l7f.js +11779 -0
- package/sessionStorage-B68y-wnE.js +140 -0
- package/sortBy-B8JVsLQY.js +95 -0
- package/store-DHP48fQB.js +2165 -0
- package/sumBy-D-HCzM2i.js +8 -0
- package/text/Frequency.js +42 -23
- package/toFinite-meZTg4Su.js +16 -0
- package/toNumber-B5JaA1vX.js +39 -0
- package/uniq-CahZPAwp.js +7 -0
- package/utils/chain.js +92 -65
- package/utils/classificationParser.js +519 -256
- package/utils/constants.js +37 -11
- 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 +7 -7
- package/utils/time.js +447 -427
- package/utils/utils.js +10 -10
- package/utils/window.js +21 -10
- package/utils-CEySTPtg.js +224 -0
- package/ActionForm-DjyNwVzM.js +0 -4403
- package/AnnotationDetails-BvPv3_pR.js +0 -160
- package/AnnotationPreview-C0JN_lr0.js +0 -140
- package/ClueEnrichContext-CNbh-qiy.js +0 -452
- package/FlexOne-BXWFOd1T.js +0 -6
- package/_MapCache-DRK-s2eK.js +0 -179
- package/_Set-DrS_bbSV.js +0 -6
- package/_Uint8Array-D9R2N9Lp.js +0 -98
- package/_arrayIncludes-Dcl_29E6.js +0 -25
- package/_arrayPush-DBJIuK2V.js +0 -8
- package/_baseAssignValue-Bx1cxHj5.js +0 -12
- package/_baseClone-DRhywkxm.js +0 -211
- package/_baseExtremum-DodEaEyF.js +0 -16
- package/_baseFlatten-CD9NgrYE.js +0 -72
- package/_baseGet-bVwDaGrA.js +0 -80
- package/_baseGetTag-CxDaTem-.js +0 -25
- package/_baseIsEqual-C-FKsm1J.js +0 -150
- package/_baseIteratee-D0FhC5bC.js +0 -95
- package/_baseRest-D_eW2E0d.js +0 -8
- package/_baseSlice-M5RKzt1A.js +0 -10
- package/_baseSum-wEbgNeUs.js +0 -10
- package/_baseUniq-D3N8igOm.js +0 -41
- package/_cacheHas-Wgl-hw34.js +0 -22
- package/_commonjsHelpers-C6fGbg64.js +0 -6
- package/_createAggregator-BVj8IAuF.js +0 -53
- package/_defineProperty-BZU4WKA3.js +0 -11
- package/_getPrototype-BGBCg-aX.js +0 -5
- package/_getTag-B7R9qBo7.js +0 -73
- package/_isIterateeCall-Dm0VTAYy.js +0 -13
- package/_setToArray-Ck4YZu0Z.js +0 -9
- package/cloneDeep-fV59zwUf.js +0 -8
- package/countBy-B3rNuG4T.js +0 -8
- package/get-Bil3mzRD.js +0 -8
- package/groupBy-CrJC7sGa.js +0 -8
- package/iconify-Ptb5dTKy.js +0 -1270
- package/identity-ByMq8VxU.js +0 -6
- package/index-BH-gBhtO.js +0 -2282
- package/index-BM9Sve5T.js +0 -571
- package/index-Cj4d5cGz.js +0 -357
- package/index-D3Dwn-8x.js +0 -6464
- package/index-Dh2PP9h8.js +0 -11747
- package/index-DoFpWPHo.js +0 -975
- package/isArguments-BWcXOE6a.js +0 -24
- package/isArray-WzO_os3q.js +0 -4
- package/isEmpty-DKxrY-_M.js +0 -22
- package/isNil-CjWwlQS3.js +0 -6
- package/isObject-B53jY8Qg.js +0 -7
- package/isObjectLike-CYbdrIBr.js +0 -6
- package/isSymbol-DE1Kcy2M.js +0 -9
- package/last-7CdUxN0r.js +0 -7
- package/maxBy-BOWDkL_D.js +0 -8
- package/replication-WkKbPdwG.js +0 -8453
- package/sessionStorage-DFMae61b.js +0 -90
- package/sortBy-BHe812lF.js +0 -74
- package/store-D4aFUWxi.js +0 -1169
- package/sumBy-B7f_bP_k.js +0 -8
- package/toFinite-CBrE65MP.js +0 -14
- package/toNumber-CxmWey0f.js +0 -31
- package/uniq-B4UZ671_.js +0 -7
- package/utils-SpTOhPYl.js +0 -147
|
@@ -1,85 +1,112 @@
|
|
|
1
|
-
import { jsxs
|
|
2
|
-
import { Stack
|
|
3
|
-
import
|
|
4
|
-
import { ClueComponentContext
|
|
5
|
-
import { useState
|
|
6
|
-
import { a as
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Stack, Typography, Divider, Table, TableBody, TableRow, TableCell, Button } from "@mui/material";
|
|
3
|
+
import Iconified from "../../display/icons/Iconified.js";
|
|
4
|
+
import { ClueComponentContext } from "../../../hooks/ClueComponentContext.js";
|
|
5
|
+
import { useState, useMemo, useEffect } from "react";
|
|
6
|
+
import { a as useContextSelector } from "../../../index-_gpzM2Px.js";
|
|
7
|
+
const decodeBase64ToBytes = (base64Data) => {
|
|
8
|
+
const byteCharacters = atob(base64Data);
|
|
9
|
+
const byteArray = new Uint8Array(new ArrayBuffer(byteCharacters.length));
|
|
10
|
+
for (let i = 0; i < byteCharacters.length; i++) {
|
|
11
|
+
byteArray[i] = byteCharacters.charCodeAt(i);
|
|
12
|
+
}
|
|
13
|
+
return byteArray;
|
|
14
|
+
};
|
|
15
|
+
const formatBytes = (bytes) => {
|
|
16
|
+
if (bytes === 0) {
|
|
14
17
|
return "0 B";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
}
|
|
19
|
+
const units = ["B", "KB", "MB", "GB"];
|
|
20
|
+
const unitIndex = Math.min(Math.floor(Math.log(bytes) / Math.log(1024)), units.length - 1);
|
|
21
|
+
const value = bytes / 1024 ** unitIndex;
|
|
22
|
+
return `${value.toFixed(unitIndex === 0 ? 0 : 2)} ${units[unitIndex]}`;
|
|
23
|
+
};
|
|
24
|
+
const saveFileFromServer = (output) => {
|
|
25
|
+
const byteArray = decodeBase64ToBytes(output.data);
|
|
26
|
+
const blob = new Blob([byteArray], { type: output.mime_type || "application/octet-stream" });
|
|
27
|
+
const url = URL.createObjectURL(blob);
|
|
28
|
+
const link = document.createElement("a");
|
|
29
|
+
link.href = url;
|
|
30
|
+
link.download = output.file_name || "result.txt";
|
|
31
|
+
document.body.appendChild(link);
|
|
32
|
+
link.click();
|
|
33
|
+
document.body.removeChild(link);
|
|
34
|
+
URL.revokeObjectURL(url);
|
|
35
|
+
};
|
|
36
|
+
const FileResult = ({ result }) => {
|
|
37
|
+
var _a, _b, _c, _d, _e;
|
|
38
|
+
const { t } = useContextSelector(ClueComponentContext, (ctx) => ctx == null ? void 0 : ctx.i18next);
|
|
39
|
+
const [sha256Hash, setSha256Hash] = useState("");
|
|
40
|
+
const actionName = ((_a = result.action) == null ? void 0 : _a.name) ?? t("actions.result.file.unknown");
|
|
41
|
+
const outputBytes = useMemo(() => {
|
|
42
|
+
var _a2;
|
|
43
|
+
if (!((_a2 = result.output) == null ? void 0 : _a2.data)) {
|
|
25
44
|
return null;
|
|
45
|
+
}
|
|
26
46
|
try {
|
|
27
|
-
return
|
|
47
|
+
return decodeBase64ToBytes(result.output.data);
|
|
28
48
|
} catch {
|
|
29
49
|
return null;
|
|
30
50
|
}
|
|
31
|
-
}, [(
|
|
32
|
-
|
|
33
|
-
let
|
|
34
|
-
const
|
|
35
|
-
if (!
|
|
36
|
-
|
|
51
|
+
}, [(_b = result.output) == null ? void 0 : _b.data]);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
let cancelled = false;
|
|
54
|
+
const generateHash = async () => {
|
|
55
|
+
if (!outputBytes || typeof crypto === "undefined" || !crypto.subtle) {
|
|
56
|
+
setSha256Hash("N/A");
|
|
37
57
|
return;
|
|
38
58
|
}
|
|
39
|
-
const
|
|
40
|
-
|
|
59
|
+
const digest = await crypto.subtle.digest("SHA-256", outputBytes);
|
|
60
|
+
const digestArray = Array.from(new Uint8Array(digest));
|
|
61
|
+
const digestHex = digestArray.map((value) => value.toString(16).padStart(2, "0")).join("");
|
|
62
|
+
if (!cancelled) {
|
|
63
|
+
setSha256Hash(digestHex);
|
|
64
|
+
}
|
|
41
65
|
};
|
|
42
|
-
|
|
43
|
-
|
|
66
|
+
setSha256Hash("");
|
|
67
|
+
generateHash();
|
|
68
|
+
return () => {
|
|
69
|
+
cancelled = true;
|
|
44
70
|
};
|
|
45
|
-
}, [
|
|
46
|
-
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
/* @__PURE__ */
|
|
71
|
+
}, [outputBytes]);
|
|
72
|
+
return /* @__PURE__ */ jsxs(Stack, { sx: { overflowY: "auto" }, spacing: 3, children: [
|
|
73
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h5", children: t("actions.result.file.title", { actionName }) }),
|
|
74
|
+
/* @__PURE__ */ jsx(Typography, { children: t("actions.result.file.description", { actionName }) }),
|
|
75
|
+
/* @__PURE__ */ jsx(Divider, { flexItem: true }),
|
|
76
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h6", children: t("actions.result.file.stats.title") }),
|
|
77
|
+
outputBytes && /* @__PURE__ */ jsx(Table, { sx: { maxWidth: 900 }, children: /* @__PURE__ */ jsxs(TableBody, { children: [
|
|
78
|
+
/* @__PURE__ */ jsxs(TableRow, { children: [
|
|
79
|
+
/* @__PURE__ */ jsx(TableCell, { sx: { width: "35%" }, children: t("actions.result.file.stats.label.decoded_size") }),
|
|
80
|
+
/* @__PURE__ */ jsx(TableCell, { children: formatBytes(outputBytes.length) || "n/a" })
|
|
54
81
|
] }),
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ jsxs(TableRow, { children: [
|
|
83
|
+
/* @__PURE__ */ jsx(TableCell, { sx: { width: "35%" }, children: t("actions.result.file.stats.label.decoded_bytes") }),
|
|
84
|
+
/* @__PURE__ */ jsx(TableCell, { children: outputBytes.length || "n/a" })
|
|
58
85
|
] }),
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ jsxs(TableRow, { children: [
|
|
87
|
+
/* @__PURE__ */ jsx(TableCell, { sx: { width: "35%" }, children: t("actions.result.file.stats.label.base64_length") }),
|
|
88
|
+
/* @__PURE__ */ jsx(TableCell, { children: ((_c = result.output) == null ? void 0 : _c.data.length) ?? "n/a" })
|
|
62
89
|
] }),
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ jsxs(TableRow, { children: [
|
|
91
|
+
/* @__PURE__ */ jsx(TableCell, { sx: { width: "35%" }, children: t("actions.result.file.stats.label.sha256") }),
|
|
92
|
+
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx("code", { children: sha256Hash || t("actions.result.file.stats.calculating") }) })
|
|
66
93
|
] })
|
|
67
94
|
] }) }),
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
|
|
95
|
+
/* @__PURE__ */ jsx(
|
|
96
|
+
Button,
|
|
70
97
|
{
|
|
71
|
-
startIcon: /* @__PURE__ */
|
|
98
|
+
startIcon: /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-download" }),
|
|
72
99
|
variant: "outlined",
|
|
73
100
|
sx: { alignSelf: "center" },
|
|
74
|
-
disabled: !((
|
|
75
|
-
onClick: () =>
|
|
101
|
+
disabled: !((_d = result.output) == null ? void 0 : _d.data),
|
|
102
|
+
onClick: () => result.output && saveFileFromServer(result.output),
|
|
76
103
|
name: "download",
|
|
77
104
|
role: "button",
|
|
78
|
-
children:
|
|
105
|
+
children: t("download", { file: ((_e = result.output) == null ? void 0 : _e.file_name) ?? "result.txt" })
|
|
79
106
|
}
|
|
80
107
|
)
|
|
81
108
|
] });
|
|
82
109
|
};
|
|
83
110
|
export {
|
|
84
|
-
|
|
111
|
+
FileResult as default
|
|
85
112
|
};
|
|
@@ -1,35 +1,39 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { Stack
|
|
3
|
-
import { J as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { u as
|
|
7
|
-
import { useTranslation
|
|
8
|
-
const
|
|
9
|
-
pluginName
|
|
10
|
-
result
|
|
11
|
-
...
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Stack } from "@mui/material";
|
|
3
|
+
import { J as JSONViewer } from "../../../index-DUEubgWN.js";
|
|
4
|
+
import Markdown from "../../display/markdown/index.js";
|
|
5
|
+
import ErrorBoundary from "../../ErrorBoundary.js";
|
|
6
|
+
import { u as usePluginStore, c as clueUIPluginStore } from "../../../store-DHP48fQB.js";
|
|
7
|
+
import { useTranslation } from "react-i18next";
|
|
8
|
+
const Result = ({
|
|
9
|
+
pluginName,
|
|
10
|
+
result,
|
|
11
|
+
...additionalProps
|
|
12
12
|
}) => {
|
|
13
|
-
const
|
|
14
|
-
|
|
13
|
+
const pluginStore = usePluginStore();
|
|
14
|
+
const { t } = useTranslation();
|
|
15
|
+
const plugin = pluginName ?? clueUIPluginStore.getPlugin(result.format ?? "undefined", "action", result.actionId);
|
|
16
|
+
if (plugin) {
|
|
15
17
|
try {
|
|
16
|
-
const
|
|
17
|
-
result
|
|
18
|
-
...
|
|
18
|
+
const component = pluginStore.executeFunction(`${plugin}.actionResult`, {
|
|
19
|
+
result,
|
|
20
|
+
...additionalProps
|
|
19
21
|
});
|
|
20
|
-
if (
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
+
if (component !== void 0) {
|
|
23
|
+
return /* @__PURE__ */ jsx(ErrorBoundary, { children: component });
|
|
24
|
+
}
|
|
22
25
|
} catch {
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxs(Stack, { sx: { overflowY: "auto" }, children: [
|
|
27
|
+
/* @__PURE__ */ jsx(Markdown, { md: t("format.render.error", { format: result.format }) }),
|
|
28
|
+
/* @__PURE__ */ jsx(JSONViewer, { data: result, collapse: true, forceCompact: true })
|
|
26
29
|
] }) });
|
|
27
30
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
+
}
|
|
32
|
+
return /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxs(Stack, { sx: { overflowY: "auto" }, children: [
|
|
33
|
+
/* @__PURE__ */ jsx(Markdown, { md: t("format.not.recognized", { format: result.format }) }),
|
|
34
|
+
/* @__PURE__ */ jsx(JSONViewer, { data: result, collapse: true, forceCompact: true })
|
|
31
35
|
] }) });
|
|
32
36
|
};
|
|
33
37
|
export {
|
|
34
|
-
|
|
38
|
+
Result as default
|
|
35
39
|
};
|
|
@@ -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,91 +1,111 @@
|
|
|
1
|
-
import { jsxs
|
|
2
|
-
import { Stack
|
|
3
|
-
import { b 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 } from "../../../../index-
|
|
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 { b as isPlainObject, a as flatten$1 } from "../../../../utils-CEySTPtg.js";
|
|
4
|
+
import { cssImportant } from "../../../../utils/graph.js";
|
|
5
|
+
import { b as baseGet, c as castPath, t as toKey, a as arrayMap } from "../../../../_baseGet-Cmp6FztG.js";
|
|
6
|
+
import { c as copyObject, g as getAllKeysIn, b as baseClone } from "../../../../_baseClone-9FaRd1R2.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-Co6QHDlG.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-DUEubgWN.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
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
26
|
+
var objectProto = Object.prototype;
|
|
27
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
28
|
+
function baseUnset(object, path) {
|
|
29
|
+
path = castPath(path, object);
|
|
30
|
+
var index = -1, length = path.length;
|
|
31
|
+
if (!length) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
var isRootPrimitive = object == null || typeof object !== "object" && typeof object !== "function";
|
|
35
|
+
while (++index < length) {
|
|
36
|
+
var key = path[index];
|
|
37
|
+
if (typeof key !== "string") {
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
if (key === "__proto__" && !hasOwnProperty.call(object, "__proto__")) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
if (key === "constructor" && index + 1 < length && typeof path[index + 1] === "string" && path[index + 1] === "prototype") {
|
|
44
|
+
if (isRootPrimitive && index === 0) {
|
|
45
|
+
continue;
|
|
41
46
|
}
|
|
47
|
+
return false;
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
|
-
var
|
|
45
|
-
return
|
|
50
|
+
var obj = parent(object, path);
|
|
51
|
+
return obj == null || delete obj[toKey(last(path))];
|
|
46
52
|
}
|
|
47
|
-
function
|
|
48
|
-
return
|
|
53
|
+
function customOmitClone(value) {
|
|
54
|
+
return isPlainObject(value) ? void 0 : value;
|
|
49
55
|
}
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
|
|
57
|
+
var omit = flatRest(function(object, paths) {
|
|
58
|
+
var result = {};
|
|
59
|
+
if (object == null) {
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
62
|
+
var isDeep = false;
|
|
63
|
+
paths = arrayMap(paths, function(path) {
|
|
64
|
+
path = castPath(path, object);
|
|
65
|
+
isDeep || (isDeep = path.length > 1);
|
|
66
|
+
return path;
|
|
67
|
+
});
|
|
68
|
+
copyObject(object, getAllKeysIn(object), result);
|
|
69
|
+
if (isDeep) {
|
|
70
|
+
result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
|
|
71
|
+
}
|
|
72
|
+
var length = paths.length;
|
|
73
|
+
while (length--) {
|
|
74
|
+
baseUnset(result, paths[length]);
|
|
75
|
+
}
|
|
76
|
+
return result;
|
|
61
77
|
});
|
|
62
|
-
const
|
|
63
|
-
var
|
|
64
|
-
const [
|
|
65
|
-
|
|
78
|
+
const NodeCard = ({ node, sx = {} }) => {
|
|
79
|
+
var _a;
|
|
80
|
+
const [expanded, setExpanded] = useState(false);
|
|
81
|
+
const [nodeExtraData, setNodeExtraData] = useState();
|
|
82
|
+
const handleExpandClick = () => {
|
|
83
|
+
setExpanded(!expanded);
|
|
66
84
|
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}, [
|
|
70
|
-
const
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
setNodeExtraData(omit(node, ["id", "edges"]));
|
|
87
|
+
}, [node]);
|
|
88
|
+
const renderEdgeList = useCallback((edgeIds) => {
|
|
89
|
+
return /* @__PURE__ */ jsxs(Stack, { alignSelf: "stretch", children: [
|
|
90
|
+
/* @__PURE__ */ jsx(Typography, { textAlign: "left", variant: "body2", color: "text.secondary", children: "Edges" }),
|
|
91
|
+
/* @__PURE__ */ jsx(Stack, { spacing: 0.25, children: edgeIds.map((edgeId) => /* @__PURE__ */ jsx(NodeTag, { nodeId: edgeId }, edgeId)) })
|
|
92
|
+
] });
|
|
93
|
+
}, []);
|
|
94
|
+
return /* @__PURE__ */ jsx(
|
|
95
|
+
Card,
|
|
76
96
|
{
|
|
77
97
|
variant: "outlined",
|
|
78
98
|
sx: {
|
|
79
99
|
position: "relative",
|
|
80
100
|
overflow: "auto",
|
|
81
|
-
zIndex:
|
|
101
|
+
zIndex: expanded ? 100 : "initial",
|
|
82
102
|
"& *": {
|
|
83
103
|
opacity: 1
|
|
84
104
|
},
|
|
85
|
-
...
|
|
105
|
+
...sx
|
|
86
106
|
},
|
|
87
|
-
children: /* @__PURE__ */
|
|
88
|
-
|
|
107
|
+
children: /* @__PURE__ */ jsx(CardContent, { sx: { p: 1 }, children: /* @__PURE__ */ jsxs(
|
|
108
|
+
Stack,
|
|
89
109
|
{
|
|
90
110
|
spacing: 1,
|
|
91
111
|
sx: {
|
|
@@ -96,44 +116,44 @@ const xe = ({ node: e, sx: t = {} }) => {
|
|
|
96
116
|
}
|
|
97
117
|
},
|
|
98
118
|
children: [
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
|
|
119
|
+
/* @__PURE__ */ jsx(NodeTag, { nodeId: node.id, label: node.id, type: "header", children: /* @__PURE__ */ jsx(
|
|
120
|
+
ExpandMoreButton,
|
|
101
121
|
{
|
|
102
|
-
expand:
|
|
103
|
-
onClick:
|
|
104
|
-
"aria-expanded":
|
|
122
|
+
expand: expanded,
|
|
123
|
+
onClick: handleExpandClick,
|
|
124
|
+
"aria-expanded": expanded,
|
|
105
125
|
"aria-label": "show more",
|
|
106
126
|
size: "small",
|
|
107
|
-
children: /* @__PURE__ */
|
|
127
|
+
children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-expand-more", fontSize: "medium" })
|
|
108
128
|
}
|
|
109
129
|
) }),
|
|
110
|
-
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
-
/* @__PURE__ */
|
|
130
|
+
node.markdown && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
131
|
+
/* @__PURE__ */ jsx(Divider, { flexItem: true }),
|
|
132
|
+
/* @__PURE__ */ jsx(Markdown, { md: node.markdown, components: flatten$1(node) })
|
|
113
133
|
] }),
|
|
114
|
-
!!((
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
|
|
134
|
+
!!((_a = node == null ? void 0 : node.edges) == null ? void 0 : _a.length) && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
135
|
+
/* @__PURE__ */ jsx(Divider, { flexItem: true }),
|
|
136
|
+
renderEdgeList(node == null ? void 0 : node.edges)
|
|
117
137
|
] }),
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
|
|
138
|
+
/* @__PURE__ */ jsx(Collapse, { in: expanded, timeout: "auto", children: /* @__PURE__ */ jsxs(
|
|
139
|
+
Stack,
|
|
120
140
|
{
|
|
121
141
|
justifyContent: "start",
|
|
122
142
|
alignItems: "start",
|
|
123
143
|
spacing: 1,
|
|
124
|
-
sx: (
|
|
144
|
+
sx: (theme) => ({
|
|
125
145
|
"& > ul": {
|
|
126
146
|
width: "100%",
|
|
127
147
|
textAlign: "left",
|
|
128
|
-
p:
|
|
129
|
-
mx:
|
|
130
|
-
backgroundColor:
|
|
148
|
+
p: cssImportant(theme.spacing(1)),
|
|
149
|
+
mx: cssImportant("0"),
|
|
150
|
+
backgroundColor: cssImportant(theme.palette.background.paper)
|
|
131
151
|
}
|
|
132
152
|
}),
|
|
133
153
|
children: [
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ jsx(Divider, { flexItem: true }),
|
|
155
|
+
/* @__PURE__ */ jsx(Typography, { textAlign: "left", variant: "body1", children: "Metadata:" }),
|
|
156
|
+
/* @__PURE__ */ jsx(JSONViewer, { data: nodeExtraData })
|
|
137
157
|
]
|
|
138
158
|
}
|
|
139
159
|
) })
|
|
@@ -144,5 +164,5 @@ const xe = ({ node: e, sx: t = {} }) => {
|
|
|
144
164
|
);
|
|
145
165
|
};
|
|
146
166
|
export {
|
|
147
|
-
|
|
167
|
+
NodeCard as default
|
|
148
168
|
};
|
|
@@ -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
|
};
|