@cccsaurora/clue-ui 1.0.2 → 1.1.0-dev.10
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-D4ryHO0M.js +436 -0
- package/AnnotationDetails-YAPoqw3R.js +175 -0
- package/AnnotationPreview-DiQDjt9s.js +188 -0
- package/ClueEnrichContext-DIn6g8tw.js +522 -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-CUmg6egw.js +6 -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 -34
- 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 +104 -92
- package/components/EnrichedChip.js +134 -109
- package/components/EnrichedTypography.js +136 -110
- 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 +37 -34
- package/components/actions/form/schemaAdapter.js +39 -20
- package/components/display/graph/ExpandMoreButton.js +10 -10
- package/components/display/graph/elements/NodeCard.js +92 -76
- package/components/display/graph/elements/NodeTag.js +15 -13
- package/components/display/graph/index.js +258 -200
- 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/DynamicTabs.js +22 -17
- package/components/display/markdown/index.js +8527 -5670
- package/components/display/markdown/markdownPlugins/tabs.js +1 -1
- 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 +22 -18
- 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 +37 -28
- 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 +6 -6
- package/hooks/ClueComponentContext.js +29 -23
- package/hooks/ClueConfigProvider.js +14 -12
- package/hooks/ClueDatabaseContext.js +19 -13
- package/hooks/ClueEnrichContext.js +8 -8
- package/hooks/ClueFetcherContext.js +74 -46
- package/hooks/ClueGroupContext.js +17 -14
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +12 -10
- package/hooks/selectors.js +22 -11
- package/hooks/useAnnotations.js +45 -29
- package/hooks/useClue.js +6 -4
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +5 -5
- 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 +63 -43
- package/iconify-CXMreGTg.js +1782 -0
- package/icons/Action.js +66 -49
- package/icons/Assessment.js +84 -68
- package/icons/Context.js +75 -61
- 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-BHPT3qoB.js +1172 -0
- package/index-BMxyILVD.js +465 -0
- package/index-BbPn6-Mw.js +15750 -0
- package/index-Dz1kF2MU.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 +58 -58
- package/package.json +1 -1
- package/sortBy-B-UKp4GT.js +100 -0
- package/sumBy-MYkDPHZL.js +8 -0
- package/tabs-xGuUGsJd.js +254 -0
- package/text/Frequency.js +42 -23
- package/toFinite-Bc55msYj.js +16 -0
- package/toNumber-DPxy1FBy.js +39 -0
- package/useClueTypeConfig-CH-nGq6a.js +3184 -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 -29
- package/utils/utils.js +9 -9
- package/utils/window.js +21 -10
- package/utils-Dr4wbKBZ.js +4182 -0
- package/ActionForm-BtTv0s4P.js +0 -340
- package/AnnotationDetails-D5tBIeEw.js +0 -160
- package/AnnotationPreview-CZr_CcZC.js +0 -140
- package/ClueEnrichContext-DH9lqjwH.js +0 -401
- 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-C6fGbg64.js +0 -6
- 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-BUcHmehh.js +0 -975
- package/index-Bo-v5IAc.js +0 -12754
- package/index-CnaCBNrd.js +0 -358
- package/index-E7g8cRyW.js +0 -568
- package/index-p5_wX7q1.js +0 -11729
- 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/tabs-CgADNA57.js +0 -195
- package/toFinite-BMy6GObD.js +0 -14
- package/toNumber-YVhnnJv4.js +0 -31
- package/useClueTypeConfig-CneP98N_.js +0 -2260
- package/utils-CD0rFIFU.js +0 -2704
|
@@ -1,31 +1,52 @@
|
|
|
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
|
+
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;
|
|
26
|
+
if (THEME_TYPES.includes(definedColor)) {
|
|
27
|
+
return { color: definedColor };
|
|
28
|
+
}
|
|
29
|
+
if (definedColor) {
|
|
30
|
+
return { sx: { color: definedColor } };
|
|
31
|
+
}
|
|
32
|
+
return { color: "default" };
|
|
33
|
+
}, [(_a = config.c12nDef) == null ? void 0 : _a.levels_map, (_b = config.c12nDef) == null ? void 0 : _b.levels_styles_map, parts.lvlIdx]);
|
|
34
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: classification, children: /* @__PURE__ */ jsx(
|
|
35
|
+
Chip,
|
|
16
36
|
{
|
|
17
|
-
variant:
|
|
18
|
-
label:
|
|
19
|
-
...
|
|
20
|
-
...
|
|
37
|
+
variant: otherProps.variant || "outlined",
|
|
38
|
+
label: normalized,
|
|
39
|
+
...chipProps,
|
|
40
|
+
...otherProps,
|
|
21
41
|
sx: [
|
|
22
|
-
...Array.isArray(
|
|
23
|
-
...Array.isArray(
|
|
42
|
+
...Array.isArray(chipProps.sx) ? chipProps.sx : [chipProps.sx],
|
|
43
|
+
...Array.isArray(otherProps.sx) ? otherProps.sx : [otherProps.sx]
|
|
24
44
|
]
|
|
25
45
|
}
|
|
26
46
|
) });
|
|
27
47
|
}
|
|
28
|
-
)
|
|
48
|
+
);
|
|
49
|
+
const ClassificationChip$1 = memo(ClassificationChip);
|
|
29
50
|
export {
|
|
30
|
-
|
|
51
|
+
ClassificationChip$1 as default
|
|
31
52
|
};
|
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,150 +1,162 @@
|
|
|
1
|
-
import { jsxs
|
|
2
|
-
import { I as
|
|
3
|
-
import { useTheme
|
|
4
|
-
import { ClueComponentContext
|
|
5
|
-
import { useClueEnrichSelector
|
|
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 { u as
|
|
16
|
-
import
|
|
17
|
-
const
|
|
18
|
-
type
|
|
19
|
-
value
|
|
20
|
-
classification:
|
|
21
|
-
contextIcon
|
|
22
|
-
counters
|
|
23
|
-
hideLoading
|
|
24
|
-
...
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { I as Icon } from "../iconify-CXMreGTg.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 { useClueEnrichSelector } from "../hooks/selectors.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 "../ClueEnrichContext-DIn6g8tw.js";
|
|
14
|
+
import { memo, useState, useMemo, useCallback } from "react";
|
|
15
|
+
import { u as useContextSelector } from "../index-BDVjGvMI.js";
|
|
16
|
+
import AnnotationEntry from "./AnnotationEntry.js";
|
|
17
|
+
const EnrichedCard = ({
|
|
18
|
+
type,
|
|
19
|
+
value,
|
|
20
|
+
classification: _classification,
|
|
21
|
+
contextIcon = false,
|
|
22
|
+
counters = false,
|
|
23
|
+
hideLoading = false,
|
|
24
|
+
...otherProps
|
|
25
25
|
}) => {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
const theme = useTheme();
|
|
27
|
+
const { t } = useContextSelector(ClueComponentContext, (ctx) => ctx.i18next);
|
|
28
|
+
const defaultClassification = useClueEnrichSelector((ctx) => ctx.defaultClassification);
|
|
29
|
+
const enrich = useClueEnrichSelector((state) => state.enrich);
|
|
30
|
+
const [filter, setFilter] = useState("all");
|
|
31
|
+
const classification = useMemo(
|
|
32
|
+
() => _classification ?? defaultClassification,
|
|
33
|
+
[_classification, defaultClassification]
|
|
34
|
+
);
|
|
35
|
+
const [annotations, loading] = useAnnotations(type, value, classification);
|
|
36
|
+
const errors = useErrors(value);
|
|
37
|
+
const options = useMemo(() => ["all", ...uniq(annotations.map((annotation) => annotation.type))], [annotations]);
|
|
38
|
+
const forceEnrich = useCallback(() => {
|
|
39
|
+
return enrich(type, value, {
|
|
40
|
+
classification,
|
|
41
|
+
timeout: 15,
|
|
42
|
+
force: true
|
|
43
|
+
});
|
|
44
|
+
}, [classification, enrich, type, value]);
|
|
45
|
+
return /* @__PURE__ */ jsxs(
|
|
46
|
+
Card,
|
|
36
47
|
{
|
|
37
48
|
sx: [
|
|
38
49
|
{
|
|
39
50
|
maxWidth: "900px"
|
|
40
51
|
},
|
|
41
|
-
...Array.isArray(
|
|
52
|
+
...Array.isArray(otherProps == null ? void 0 : otherProps.sx) ? otherProps == null ? void 0 : otherProps.sx : [otherProps == null ? void 0 : otherProps.sx]
|
|
42
53
|
],
|
|
43
|
-
...
|
|
54
|
+
...otherProps,
|
|
44
55
|
children: [
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
|
|
56
|
+
/* @__PURE__ */ jsx(
|
|
57
|
+
CardHeader,
|
|
47
58
|
{
|
|
48
|
-
title: /* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
|
|
59
|
+
title: /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
60
|
+
/* @__PURE__ */ jsx(FrequencyText, { annotations, value, variant: "h6" }),
|
|
61
|
+
/* @__PURE__ */ jsx(
|
|
62
|
+
AssessmentIcon,
|
|
52
63
|
{
|
|
53
|
-
value: { type
|
|
54
|
-
annotations
|
|
55
|
-
counters
|
|
64
|
+
value: { type, value, classification },
|
|
65
|
+
annotations,
|
|
66
|
+
counters,
|
|
56
67
|
fontSize: "1em",
|
|
57
|
-
disableTooltip:
|
|
68
|
+
disableTooltip: true
|
|
58
69
|
}
|
|
59
70
|
),
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
|
|
71
|
+
/* @__PURE__ */ jsx(
|
|
72
|
+
OpinionIcon,
|
|
62
73
|
{
|
|
63
|
-
value: { type
|
|
64
|
-
annotations
|
|
65
|
-
counters
|
|
74
|
+
value: { type, value, classification },
|
|
75
|
+
annotations,
|
|
76
|
+
counters,
|
|
66
77
|
fontSize: "1em",
|
|
67
|
-
disableTooltip:
|
|
78
|
+
disableTooltip: true
|
|
68
79
|
}
|
|
69
80
|
),
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
|
|
81
|
+
/* @__PURE__ */ jsx(
|
|
82
|
+
ContextIcon,
|
|
72
83
|
{
|
|
73
|
-
value: { type
|
|
74
|
-
annotations
|
|
75
|
-
counters
|
|
76
|
-
showExtraIcon:
|
|
84
|
+
value: { type, value, classification },
|
|
85
|
+
annotations,
|
|
86
|
+
counters,
|
|
87
|
+
showExtraIcon: contextIcon,
|
|
77
88
|
fontSize: "inherit",
|
|
78
|
-
disableTooltip:
|
|
89
|
+
disableTooltip: true
|
|
79
90
|
}
|
|
80
91
|
),
|
|
81
|
-
|
|
92
|
+
loading && !hideLoading && /* @__PURE__ */ jsx(CircularProgress, { color: "primary", size: 18 })
|
|
82
93
|
] })
|
|
83
94
|
}
|
|
84
95
|
),
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
|
|
96
|
+
/* @__PURE__ */ jsx(Divider, { sx: { mx: 1 } }),
|
|
97
|
+
/* @__PURE__ */ jsxs(CardContent, { sx: { p: 1 }, children: [
|
|
98
|
+
/* @__PURE__ */ jsxs(Grid, { container: true, spacing: 0.5, sx: { mb: 1 }, children: [
|
|
99
|
+
options.map((opt, id) => (
|
|
89
100
|
// eslint-disable-next-line react/no-array-index-key
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
|
|
101
|
+
/* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
102
|
+
Chip,
|
|
92
103
|
{
|
|
93
104
|
size: "small",
|
|
94
|
-
variant:
|
|
95
|
-
icon:
|
|
96
|
-
label: /* @__PURE__ */
|
|
97
|
-
|
|
105
|
+
variant: opt === filter ? "filled" : "outlined",
|
|
106
|
+
icon: ICON_MAP[opt] && /* @__PURE__ */ jsx(Icon, { icon: ICON_MAP[opt] }),
|
|
107
|
+
label: /* @__PURE__ */ jsxs(Typography, { variant: "caption", textTransform: "capitalize", children: [
|
|
108
|
+
opt,
|
|
98
109
|
":",
|
|
99
110
|
" ",
|
|
100
|
-
|
|
111
|
+
opt === "all" ? annotations.length : annotations.filter((annotation) => annotation.type === opt).length
|
|
101
112
|
] }),
|
|
102
|
-
onClick: () =>
|
|
113
|
+
onClick: () => setFilter(opt)
|
|
103
114
|
}
|
|
104
|
-
) },
|
|
115
|
+
) }, id)
|
|
105
116
|
)),
|
|
106
|
-
(
|
|
107
|
-
|
|
117
|
+
(errors == null ? void 0 : errors.length) > 0 && /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
118
|
+
Tooltip,
|
|
108
119
|
{
|
|
109
|
-
title: /* @__PURE__ */
|
|
110
|
-
/* @__PURE__ */
|
|
120
|
+
title: /* @__PURE__ */ jsx("div", { onClick: (e) => e.stopPropagation(), children: errors.map((err) => /* @__PURE__ */ jsxs("div", { children: [
|
|
121
|
+
/* @__PURE__ */ jsx("span", { style: { textTransform: "capitalize" }, children: err.source.replace(/-/g, " ") }),
|
|
111
122
|
":",
|
|
112
123
|
" ",
|
|
113
|
-
|
|
114
|
-
] },
|
|
115
|
-
children: /* @__PURE__ */
|
|
116
|
-
|
|
124
|
+
err.message
|
|
125
|
+
] }, err.source)) }),
|
|
126
|
+
children: /* @__PURE__ */ jsx(
|
|
127
|
+
Chip,
|
|
117
128
|
{
|
|
118
129
|
size: "small",
|
|
119
130
|
variant: "outlined",
|
|
120
|
-
icon: /* @__PURE__ */
|
|
121
|
-
|
|
131
|
+
icon: /* @__PURE__ */ jsx(
|
|
132
|
+
Icon,
|
|
122
133
|
{
|
|
123
134
|
icon: "material-symbols:timer-outline",
|
|
124
|
-
color:
|
|
135
|
+
color: theme.palette.error.main,
|
|
125
136
|
style: { filter: "drop-shadow(0px 0px 1px rgb(0 0 0 / 0.4))" }
|
|
126
137
|
}
|
|
127
138
|
),
|
|
128
|
-
label: /* @__PURE__ */
|
|
129
|
-
|
|
139
|
+
label: /* @__PURE__ */ jsxs(Typography, { variant: "caption", textTransform: "capitalize", children: [
|
|
140
|
+
t("annotation.failed"),
|
|
130
141
|
": ",
|
|
131
|
-
|
|
142
|
+
errors.length
|
|
132
143
|
] }),
|
|
133
|
-
onClick:
|
|
144
|
+
onClick: forceEnrich
|
|
134
145
|
}
|
|
135
146
|
)
|
|
136
147
|
}
|
|
137
148
|
) })
|
|
138
149
|
] }),
|
|
139
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ jsx(Grid, { container: true, spacing: 1, alignItems: "stretch", children: annotations.map((annotation, id) => (
|
|
140
151
|
// eslint-disable-next-line react/no-array-index-key
|
|
141
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__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)
|
|
142
153
|
)) })
|
|
143
154
|
] })
|
|
144
155
|
]
|
|
145
156
|
}
|
|
146
157
|
);
|
|
147
|
-
}
|
|
158
|
+
};
|
|
159
|
+
const EnrichedCard$1 = memo(EnrichedCard);
|
|
148
160
|
export {
|
|
149
|
-
|
|
161
|
+
EnrichedCard$1 as default
|
|
150
162
|
};
|