@cccsaurora/clue-ui 1.4.0 → 1.4.1-dev.451
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 +47 -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 +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.js +35 -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.d.ts +4 -0
- package/hooks/ClueUIPluginContext.js +50 -35
- 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 +1 -1
- 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.d.ts +1 -1
- 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-DClHBq7r.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,11 +1,11 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import "../iconify-
|
|
2
|
+
import "../iconify-DJxl6dC-.js";
|
|
3
3
|
import "@mui/material";
|
|
4
|
-
import { A
|
|
4
|
+
import { A } from "../AnnotationPreview-C6a3qRFG.js";
|
|
5
5
|
import "../hooks/useAnnotations.js";
|
|
6
|
-
import "../utils-
|
|
6
|
+
import "../utils-CEySTPtg.js";
|
|
7
7
|
import "react";
|
|
8
|
-
import "../index-
|
|
8
|
+
import "../index-_gpzM2Px.js";
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
A as default
|
|
11
11
|
};
|
|
@@ -1,31 +1,55 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { Tooltip
|
|
3
|
-
import
|
|
4
|
-
import { getParts
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Tooltip, Chip } from "@mui/material";
|
|
3
|
+
import useClueConfig from "../hooks/useClueConfig.js";
|
|
4
|
+
import { getParts, normalizedClassification } from "../utils/classificationParser.js";
|
|
5
|
+
import React__default, { useMemo, memo } from "react";
|
|
6
|
+
const THEME_TYPES = ["default", "primary", "secondary", "error", "info", "success", "warning"];
|
|
7
|
+
const ClassificationChip = React__default.memo(
|
|
8
|
+
({ classification, ...otherProps }) => {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
const { config } = useClueConfig();
|
|
11
|
+
const parts = useMemo(() => {
|
|
12
|
+
if (!config.c12nDef) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
return getParts(classification, config.c12nDef, "short", true);
|
|
16
|
+
}, [classification, config.c12nDef]);
|
|
17
|
+
const normalized = useMemo(() => {
|
|
18
|
+
if (!config.c12nDef || !parts) {
|
|
19
|
+
return classification;
|
|
20
|
+
}
|
|
21
|
+
return normalizedClassification(parts, config.c12nDef, "short", true);
|
|
22
|
+
}, [classification, config.c12nDef, parts]);
|
|
23
|
+
const chipProps = useMemo(() => {
|
|
24
|
+
var _a2, _b2, _c;
|
|
25
|
+
if (!parts) {
|
|
26
|
+
return { color: "default" };
|
|
27
|
+
}
|
|
28
|
+
const definedColor = (_c = (_b2 = config.c12nDef) == null ? void 0 : _b2.levels_styles_map[(_a2 = config.c12nDef) == null ? void 0 : _a2.levels_map[parts.lvlIdx]]) == null ? void 0 : _c.color;
|
|
29
|
+
if (THEME_TYPES.includes(definedColor)) {
|
|
30
|
+
return { color: definedColor };
|
|
31
|
+
}
|
|
32
|
+
if (definedColor) {
|
|
33
|
+
return { sx: { color: definedColor } };
|
|
34
|
+
}
|
|
35
|
+
return { color: "default" };
|
|
36
|
+
}, [(_a = config.c12nDef) == null ? void 0 : _a.levels_map, (_b = config.c12nDef) == null ? void 0 : _b.levels_styles_map, parts]);
|
|
37
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: classification, children: /* @__PURE__ */ jsx(
|
|
38
|
+
Chip,
|
|
16
39
|
{
|
|
17
|
-
variant:
|
|
18
|
-
label:
|
|
19
|
-
...
|
|
20
|
-
...
|
|
40
|
+
variant: otherProps.variant || "outlined",
|
|
41
|
+
label: normalized,
|
|
42
|
+
...chipProps,
|
|
43
|
+
...otherProps,
|
|
21
44
|
sx: [
|
|
22
|
-
...Array.isArray(
|
|
23
|
-
...Array.isArray(
|
|
45
|
+
...Array.isArray(chipProps.sx) ? chipProps.sx : [chipProps.sx],
|
|
46
|
+
...Array.isArray(otherProps.sx) ? otherProps.sx : [otherProps.sx]
|
|
24
47
|
]
|
|
25
48
|
}
|
|
26
49
|
) });
|
|
27
50
|
}
|
|
28
|
-
)
|
|
51
|
+
);
|
|
52
|
+
const ClassificationChip$1 = memo(ClassificationChip);
|
|
29
53
|
export {
|
|
30
|
-
|
|
54
|
+
ClassificationChip$1 as default
|
|
31
55
|
};
|
package/components/CountBadge.js
CHANGED
|
@@ -1,29 +1,34 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { Badge
|
|
3
|
-
import { forwardRef
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
ref: o,
|
|
8
|
-
...e,
|
|
9
|
-
badgeContent: t < 100 ? t : "99+",
|
|
10
|
-
color: a,
|
|
11
|
-
sx: (i) => ({
|
|
12
|
-
"& .MuiBadge-badge": {
|
|
13
|
-
backgroundColor: "transparent",
|
|
14
|
-
color: i.palette[a].main,
|
|
15
|
-
fontWeight: "bold",
|
|
16
|
-
right: 0,
|
|
17
|
-
top: 0,
|
|
18
|
-
transform: `translateY(-25%) translateX(${Math.min(Math.ceil(Math.log10(t)), 3) * 10}%)`,
|
|
19
|
-
px: 0,
|
|
20
|
-
fontSize: ".85rem"
|
|
21
|
-
},
|
|
22
|
-
pr: 1.5
|
|
23
|
-
}),
|
|
24
|
-
children: r
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Badge } from "@mui/material";
|
|
3
|
+
import { forwardRef, cloneElement, Children } from "react";
|
|
4
|
+
const CountBadge = forwardRef(({ children, color = "primary", count, disabled, ...props }, ref) => {
|
|
5
|
+
if (disabled) {
|
|
6
|
+
return cloneElement(Children.only(children), { ref, ...props });
|
|
25
7
|
}
|
|
26
|
-
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
Badge,
|
|
10
|
+
{
|
|
11
|
+
ref,
|
|
12
|
+
...props,
|
|
13
|
+
badgeContent: count < 100 ? count : "99+",
|
|
14
|
+
color,
|
|
15
|
+
sx: (theme) => ({
|
|
16
|
+
"& .MuiBadge-badge": {
|
|
17
|
+
backgroundColor: "transparent",
|
|
18
|
+
color: theme.palette[color].main,
|
|
19
|
+
fontWeight: "bold",
|
|
20
|
+
right: 0,
|
|
21
|
+
top: 0,
|
|
22
|
+
transform: `translateY(-25%) translateX(${Math.min(Math.ceil(Math.log10(count)), 3) * 10}%)`,
|
|
23
|
+
px: 0,
|
|
24
|
+
fontSize: ".85rem"
|
|
25
|
+
},
|
|
26
|
+
pr: 1.5
|
|
27
|
+
}),
|
|
28
|
+
children
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
});
|
|
27
32
|
export {
|
|
28
|
-
|
|
33
|
+
CountBadge as default
|
|
29
34
|
};
|
|
@@ -1,155 +1,168 @@
|
|
|
1
|
-
import { jsxs
|
|
2
|
-
import { I as
|
|
3
|
-
import { useTheme
|
|
4
|
-
import { ClueComponentContext
|
|
5
|
-
import { f as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { ICON_MAP
|
|
12
|
-
import
|
|
13
|
-
import { u as
|
|
14
|
-
import { memo
|
|
15
|
-
import { a as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
const
|
|
20
|
-
type
|
|
21
|
-
value
|
|
22
|
-
classification:
|
|
23
|
-
contextIcon
|
|
24
|
-
counters
|
|
25
|
-
hideLoading
|
|
26
|
-
...
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { I as Icon } from "../iconify-DJxl6dC-.js";
|
|
3
|
+
import { useTheme, Card, CardHeader, Stack, CircularProgress, Divider, CardContent, Grid, Chip, Typography, Tooltip, Box } from "@mui/material";
|
|
4
|
+
import { ClueComponentContext } from "../hooks/ClueComponentContext.js";
|
|
5
|
+
import { f as useClueEnrichSelector } from "../ActionForm-CbLz66Rk.js";
|
|
6
|
+
import useAnnotations from "../hooks/useAnnotations.js";
|
|
7
|
+
import useErrors from "../hooks/useErrors.js";
|
|
8
|
+
import AssessmentIcon from "../icons/Assessment.js";
|
|
9
|
+
import ContextIcon from "../icons/Context.js";
|
|
10
|
+
import OpinionIcon from "../icons/Opinion.js";
|
|
11
|
+
import { ICON_MAP } from "../icons/iconMap.js";
|
|
12
|
+
import FrequencyText from "../text/Frequency.js";
|
|
13
|
+
import { u as uniq } from "../uniq-CahZPAwp.js";
|
|
14
|
+
import { memo, useState, useMemo, useCallback } from "react";
|
|
15
|
+
import { a as useContextSelector } from "../index-_gpzM2Px.js";
|
|
16
|
+
import AnnotationEntry from "./AnnotationEntry.js";
|
|
17
|
+
import ExecutePopover from "./actions/ExecutePopover.js";
|
|
18
|
+
import EnrichPopover from "./enrichment/EnrichPopover.js";
|
|
19
|
+
const EnrichedCard = ({
|
|
20
|
+
type,
|
|
21
|
+
value,
|
|
22
|
+
classification: _classification,
|
|
23
|
+
contextIcon = false,
|
|
24
|
+
counters = false,
|
|
25
|
+
hideLoading = false,
|
|
26
|
+
...otherProps
|
|
27
27
|
}) => {
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
const theme = useTheme();
|
|
29
|
+
const { t } = useContextSelector(ClueComponentContext, (ctx) => ctx.i18next);
|
|
30
|
+
const defaultClassification = useClueEnrichSelector((ctx) => ctx.defaultClassification);
|
|
31
|
+
const enrich = useClueEnrichSelector((state) => state.enrich);
|
|
32
|
+
const [filter, setFilter] = useState("all");
|
|
33
|
+
const classification = useMemo(
|
|
34
|
+
() => _classification ?? defaultClassification,
|
|
35
|
+
[_classification, defaultClassification]
|
|
36
|
+
);
|
|
37
|
+
const [annotations, loading] = useAnnotations(type, value, classification);
|
|
38
|
+
const errors = useErrors(value);
|
|
39
|
+
const enrichRequest = { type, value, classification };
|
|
40
|
+
const options = useMemo(() => ["all", ...uniq(annotations.map((annotation) => annotation.type))], [annotations]);
|
|
41
|
+
const forceEnrich = useCallback(() => {
|
|
42
|
+
return enrich(type, value, {
|
|
43
|
+
classification,
|
|
44
|
+
timeout: 15,
|
|
45
|
+
force: true
|
|
46
|
+
});
|
|
47
|
+
}, [classification, enrich, type, value]);
|
|
48
|
+
return /* @__PURE__ */ jsxs(
|
|
49
|
+
Card,
|
|
38
50
|
{
|
|
39
51
|
sx: [
|
|
40
52
|
{
|
|
41
53
|
maxWidth: "900px"
|
|
42
54
|
},
|
|
43
|
-
...Array.isArray(
|
|
55
|
+
...Array.isArray(otherProps == null ? void 0 : otherProps.sx) ? otherProps == null ? void 0 : otherProps.sx : [otherProps == null ? void 0 : otherProps.sx]
|
|
44
56
|
],
|
|
45
|
-
...
|
|
57
|
+
...otherProps,
|
|
46
58
|
children: [
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
|
|
59
|
+
/* @__PURE__ */ jsx(
|
|
60
|
+
CardHeader,
|
|
49
61
|
{
|
|
50
|
-
title: /* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
|
|
62
|
+
title: /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
63
|
+
/* @__PURE__ */ jsx(FrequencyText, { annotations, value, variant: "h6" }),
|
|
64
|
+
/* @__PURE__ */ jsx(
|
|
65
|
+
AssessmentIcon,
|
|
54
66
|
{
|
|
55
|
-
value:
|
|
56
|
-
annotations
|
|
57
|
-
counters
|
|
67
|
+
value: enrichRequest,
|
|
68
|
+
annotations,
|
|
69
|
+
counters,
|
|
58
70
|
fontSize: "1em",
|
|
59
|
-
disableTooltip:
|
|
71
|
+
disableTooltip: true
|
|
60
72
|
}
|
|
61
73
|
),
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
|
|
74
|
+
/* @__PURE__ */ jsx(
|
|
75
|
+
OpinionIcon,
|
|
64
76
|
{
|
|
65
|
-
value:
|
|
66
|
-
annotations
|
|
67
|
-
counters
|
|
77
|
+
value: enrichRequest,
|
|
78
|
+
annotations,
|
|
79
|
+
counters,
|
|
68
80
|
fontSize: "1em",
|
|
69
|
-
disableTooltip:
|
|
81
|
+
disableTooltip: true
|
|
70
82
|
}
|
|
71
83
|
),
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
|
|
84
|
+
/* @__PURE__ */ jsx(
|
|
85
|
+
ContextIcon,
|
|
74
86
|
{
|
|
75
|
-
value:
|
|
76
|
-
annotations
|
|
77
|
-
counters
|
|
78
|
-
showExtraIcon:
|
|
87
|
+
value: enrichRequest,
|
|
88
|
+
annotations,
|
|
89
|
+
counters,
|
|
90
|
+
showExtraIcon: contextIcon,
|
|
79
91
|
fontSize: "inherit",
|
|
80
|
-
disableTooltip:
|
|
92
|
+
disableTooltip: true
|
|
81
93
|
}
|
|
82
94
|
),
|
|
83
|
-
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
/* @__PURE__ */
|
|
95
|
+
loading && !hideLoading && /* @__PURE__ */ jsx(CircularProgress, { color: "primary", size: 18 }),
|
|
96
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
|
|
97
|
+
/* @__PURE__ */ jsx(EnrichPopover, { selector: enrichRequest }),
|
|
98
|
+
/* @__PURE__ */ jsx(ExecutePopover, { selectors: [enrichRequest] })
|
|
87
99
|
] })
|
|
88
100
|
}
|
|
89
101
|
),
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
|
|
102
|
+
/* @__PURE__ */ jsx(Divider, { sx: { mx: 1 } }),
|
|
103
|
+
/* @__PURE__ */ jsxs(CardContent, { sx: { p: 1 }, children: [
|
|
104
|
+
/* @__PURE__ */ jsxs(Grid, { container: true, spacing: 0.5, sx: { mb: 1 }, children: [
|
|
105
|
+
options.map((opt, id) => (
|
|
94
106
|
// eslint-disable-next-line react/no-array-index-key
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
|
|
107
|
+
/* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
108
|
+
Chip,
|
|
97
109
|
{
|
|
98
110
|
size: "small",
|
|
99
|
-
variant:
|
|
100
|
-
icon:
|
|
101
|
-
label: /* @__PURE__ */
|
|
102
|
-
|
|
111
|
+
variant: opt === filter ? "filled" : "outlined",
|
|
112
|
+
icon: ICON_MAP[opt] && /* @__PURE__ */ jsx(Icon, { icon: ICON_MAP[opt] }),
|
|
113
|
+
label: /* @__PURE__ */ jsxs(Typography, { variant: "caption", textTransform: "capitalize", children: [
|
|
114
|
+
opt,
|
|
103
115
|
":",
|
|
104
116
|
" ",
|
|
105
|
-
|
|
117
|
+
opt === "all" ? annotations.length : annotations.filter((annotation) => annotation.type === opt).length
|
|
106
118
|
] }),
|
|
107
|
-
onClick: () =>
|
|
119
|
+
onClick: () => setFilter(opt)
|
|
108
120
|
}
|
|
109
|
-
) },
|
|
121
|
+
) }, id)
|
|
110
122
|
)),
|
|
111
|
-
(
|
|
112
|
-
|
|
123
|
+
(errors == null ? void 0 : errors.length) > 0 && /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
124
|
+
Tooltip,
|
|
113
125
|
{
|
|
114
|
-
title: /* @__PURE__ */
|
|
115
|
-
/* @__PURE__ */
|
|
126
|
+
title: /* @__PURE__ */ jsx("div", { onClick: (e) => e.stopPropagation(), children: errors.map((err) => /* @__PURE__ */ jsxs("div", { children: [
|
|
127
|
+
/* @__PURE__ */ jsx("span", { style: { textTransform: "capitalize" }, children: err.source.replace(/-/g, " ") }),
|
|
116
128
|
":",
|
|
117
129
|
" ",
|
|
118
|
-
|
|
119
|
-
] },
|
|
120
|
-
children: /* @__PURE__ */
|
|
121
|
-
|
|
130
|
+
err.message
|
|
131
|
+
] }, err.source)) }),
|
|
132
|
+
children: /* @__PURE__ */ jsx(
|
|
133
|
+
Chip,
|
|
122
134
|
{
|
|
123
135
|
size: "small",
|
|
124
136
|
variant: "outlined",
|
|
125
|
-
icon: /* @__PURE__ */
|
|
126
|
-
|
|
137
|
+
icon: /* @__PURE__ */ jsx(
|
|
138
|
+
Icon,
|
|
127
139
|
{
|
|
128
140
|
icon: "material-symbols:timer-outline",
|
|
129
|
-
color:
|
|
141
|
+
color: theme.palette.error.main,
|
|
130
142
|
style: { filter: "drop-shadow(0px 0px 1px rgb(0 0 0 / 0.4))" }
|
|
131
143
|
}
|
|
132
144
|
),
|
|
133
|
-
label: /* @__PURE__ */
|
|
134
|
-
|
|
145
|
+
label: /* @__PURE__ */ jsxs(Typography, { variant: "caption", textTransform: "capitalize", children: [
|
|
146
|
+
t("annotation.failed"),
|
|
135
147
|
": ",
|
|
136
|
-
|
|
148
|
+
errors.length
|
|
137
149
|
] }),
|
|
138
|
-
onClick:
|
|
150
|
+
onClick: forceEnrich
|
|
139
151
|
}
|
|
140
152
|
)
|
|
141
153
|
}
|
|
142
154
|
) })
|
|
143
155
|
] }),
|
|
144
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ jsx(Grid, { container: true, spacing: 1, alignItems: "stretch", children: annotations.map((annotation, id) => (
|
|
145
157
|
// eslint-disable-next-line react/no-array-index-key
|
|
146
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 6, minWidth: "300px", children: /* @__PURE__ */ jsx(Box, { sx: { border: `thin solid ${theme.palette.divider}`, p: 1, height: "100%" }, children: /* @__PURE__ */ jsx(AnnotationEntry, { annotation }) }) }, id)
|
|
147
159
|
)) })
|
|
148
160
|
] })
|
|
149
161
|
]
|
|
150
162
|
}
|
|
151
163
|
);
|
|
152
|
-
}
|
|
164
|
+
};
|
|
165
|
+
const EnrichedCard_default = memo(EnrichedCard);
|
|
153
166
|
export {
|
|
154
|
-
|
|
167
|
+
EnrichedCard_default as default
|
|
155
168
|
};
|