@cccsaurora/clue-ui 1.0.4 → 1.1.0-dev.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ActionForm-ByeOzpc4.js +555 -0
- package/AnnotationDetails-DknbKDyl.js +175 -0
- package/AnnotationPreview-CQwKs8se.js +188 -0
- package/ClueEnrichContext-6NJfXpUB.js +536 -0
- package/FlexOne-BSYAhhtG.js +9 -0
- package/_Map-kgDsDYxq.js +64 -0
- package/_MapCache-DabaaWfq.js +161 -0
- package/_Uint8Array-BlVVH1tp.js +129 -0
- package/_baseAssignValue-CNbcU6Nb.js +25 -0
- package/_baseClone-D3a8Pa4T.js +284 -0
- package/_baseExtremum-B1o1zHjR.js +33 -0
- package/_baseFlatten-D4huXoEI.js +92 -0
- package/_baseGet-BSK_nnoz.js +109 -0
- package/_baseIsEqual-B5xLoweL.js +238 -0
- package/_baseIteratee-p6Nj07-n.js +126 -0
- package/_baseSlice-GAv_YFTT.js +20 -0
- package/_baseSum-D0WC1dN0.js +13 -0
- package/_baseUniq-CpupKWcL.js +89 -0
- package/_commonjsHelpers-DWwsNxpa.js +8 -0
- package/_createAggregator-BpVy5xMi.js +63 -0
- package/_getPrototype-D1LAdQKO.js +5 -0
- package/_getTag-D3ToyefI.js +126 -0
- package/api/lookup/index.d.ts +1 -1
- package/api/lookup/types.d.ts +2 -2
- package/api/lookup/types_detection.d.ts +2 -2
- 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.d.ts +2 -1
- package/components/ClassificationChip.js +44 -23
- package/components/CountBadge.js +31 -26
- package/components/EnrichedCard.js +110 -92
- package/components/EnrichedChip.js +130 -111
- package/components/EnrichedTypography.d.ts +1 -1
- package/components/EnrichedTypography.js +133 -112
- 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 +12 -41
- package/components/actions/form/schemaAdapter.js +40 -20
- package/components/display/graph/ExpandMoreButton.js +10 -10
- package/components/display/graph/elements/NodeCard.js +114 -76
- package/components/display/graph/elements/NodeTag.js +15 -13
- package/components/display/graph/index.js +267 -210
- package/components/display/graph/visualizations/Leaf.js +88 -69
- package/components/display/graph/visualizations/cloud/index.js +98 -81
- package/components/display/graph/visualizations/icons/BaseIcon.js +26 -21
- package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
- package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
- package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
- package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
- package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
- package/components/display/graph/visualizations/icons/index.js +14 -13
- package/components/display/graph/visualizations/panels/NodePanel.js +10 -8
- package/components/display/graph/visualizations/tree/BundleLine.js +108 -81
- package/components/display/graph/visualizations/tree/Triangle.js +13 -13
- package/components/display/graph/visualizations/tree/index.js +407 -305
- package/components/display/icons/Iconified.js +27 -12
- package/components/display/json/index.js +4 -4
- package/components/display/markdown/index.js +8696 -5668
- package/components/enrichment/EnrichPopover.js +55 -47
- package/components/fetchers/Fetcher.js +123 -95
- package/components/fetchers/PreviewModal.js +20 -17
- package/components/fetchers/StatusChip.js +21 -18
- package/components/group/Entry.js +13 -11
- package/components/group/Group.js +13 -10
- package/components/group/GroupControl.js +78 -66
- package/components/stats/QueryStatus.js +44 -31
- 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/en/translation.json +39 -59
- package/fr/translation.json +37 -56
- package/get-D3C3lEU3.js +8 -0
- package/groupBy-DC2oOuBN.js +14 -0
- package/hooks/ClueActionContext.d.ts +26 -0
- package/hooks/ClueActionContext.js +8 -7
- package/hooks/ClueComponentContext.js +29 -23
- package/hooks/ClueConfigProvider.js +14 -12
- package/hooks/ClueDatabaseContext.js +19 -13
- package/hooks/ClueEnrichContext.js +8 -8
- package/hooks/ClueEnrichProps.d.ts +3 -1
- 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.d.ts +4 -5
- package/hooks/selectors.js +21 -11
- package/hooks/useActionResult.d.ts +14 -0
- package/hooks/useActionResult.js +5 -0
- package/hooks/useAnnotations.js +45 -29
- package/hooks/useClue.js +6 -4
- package/hooks/useClueActions.d.ts +1 -1
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.d.ts +2 -1
- package/hooks/useClueConfig.js +6 -6
- 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.d.ts +4 -3
- package/hooks/useMyLocalStorage.js +66 -46
- package/iconify-CXMreGTg.js +1782 -0
- package/icons/Action.js +66 -49
- package/icons/Assessment.js +84 -68
- package/icons/Context.js +78 -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-BbPn6-Mw.js +15750 -0
- package/index-Bi21Wb23.js +465 -0
- package/index-C3lkTD69.js +1172 -0
- package/index-CC12Ux-9.js +17654 -0
- package/isEmpty-BQkZubqU.js +29 -0
- package/isNil-CIubwp4T.js +6 -0
- package/isObject-FTY-5JQX.js +7 -0
- package/isObjectLike-OAgjjZye.js +48 -0
- package/isSymbol-Xd2FsJyp.js +8 -0
- package/last-CUCl67Im.js +7 -0
- package/main.js +62 -62
- package/package.json +3 -3
- package/sortBy-B-UKp4GT.js +100 -0
- package/sumBy-MYkDPHZL.js +8 -0
- package/text/Frequency.js +42 -23
- package/toFinite-Bc55msYj.js +16 -0
- package/toNumber-DPxy1FBy.js +39 -0
- package/types/RunningActionData.d.ts +4 -3
- package/types/action.d.ts +10 -1
- package/useClueTypeConfig-XvGvIw2S.js +3201 -0
- package/utils/chain.js +91 -64
- package/utils/classificationParser.js +519 -256
- package/utils/constants.js +35 -10
- package/utils/graph.js +72 -45
- package/utils/hashUtil.js +7 -7
- package/utils/line.js +131 -81
- package/utils/loggerUtil.d.ts +1 -1
- package/utils/loggerUtil.js +6 -4
- package/utils/sessionStorage.js +41 -29
- package/utils/time.d.ts +3 -0
- package/utils/time.js +536 -0
- package/utils/utils.js +10 -9
- package/utils/window.js +21 -10
- package/utils-7OtvGnmf.js +200 -0
- package/ActionForm-Sw7D-KOE.js +0 -340
- package/AnnotationDetails-BoX61_IF.js +0 -160
- package/AnnotationPreview-dYinoSA9.js +0 -140
- package/ClueEnrichContext-CvCIPOMC.js +0 -412
- 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/components/display/markdown/DynamicTabs.d.ts +0 -8
- package/components/display/markdown/DynamicTabs.js +0 -21
- package/components/display/markdown/markdownPlugins/tabs.d.ts +0 -3
- package/components/display/markdown/markdownPlugins/tabs.js +0 -4
- 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-CnaCBNrd.js +0 -358
- package/index-E7g8cRyW.js +0 -568
- package/index-V7wwd05F.js +0 -975
- package/index-p5_wX7q1.js +0 -11729
- package/index-pQg5VUAZ.js +0 -12734
- 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,168 @@
|
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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-6NJfXpUB.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
|
+
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
|
|
25
27
|
}) => {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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,
|
|
36
50
|
{
|
|
37
51
|
sx: [
|
|
38
52
|
{
|
|
39
53
|
maxWidth: "900px"
|
|
40
54
|
},
|
|
41
|
-
...Array.isArray(
|
|
55
|
+
...Array.isArray(otherProps == null ? void 0 : otherProps.sx) ? otherProps == null ? void 0 : otherProps.sx : [otherProps == null ? void 0 : otherProps.sx]
|
|
42
56
|
],
|
|
43
|
-
...
|
|
57
|
+
...otherProps,
|
|
44
58
|
children: [
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
|
|
59
|
+
/* @__PURE__ */ jsx(
|
|
60
|
+
CardHeader,
|
|
47
61
|
{
|
|
48
|
-
title: /* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
|
|
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,
|
|
52
66
|
{
|
|
53
|
-
value:
|
|
54
|
-
annotations
|
|
55
|
-
counters
|
|
67
|
+
value: enrichRequest,
|
|
68
|
+
annotations,
|
|
69
|
+
counters,
|
|
56
70
|
fontSize: "1em",
|
|
57
|
-
disableTooltip:
|
|
71
|
+
disableTooltip: true
|
|
58
72
|
}
|
|
59
73
|
),
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
|
|
74
|
+
/* @__PURE__ */ jsx(
|
|
75
|
+
OpinionIcon,
|
|
62
76
|
{
|
|
63
|
-
value:
|
|
64
|
-
annotations
|
|
65
|
-
counters
|
|
77
|
+
value: enrichRequest,
|
|
78
|
+
annotations,
|
|
79
|
+
counters,
|
|
66
80
|
fontSize: "1em",
|
|
67
|
-
disableTooltip:
|
|
81
|
+
disableTooltip: true
|
|
68
82
|
}
|
|
69
83
|
),
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
|
|
84
|
+
/* @__PURE__ */ jsx(
|
|
85
|
+
ContextIcon,
|
|
72
86
|
{
|
|
73
|
-
value:
|
|
74
|
-
annotations
|
|
75
|
-
counters
|
|
76
|
-
showExtraIcon:
|
|
87
|
+
value: enrichRequest,
|
|
88
|
+
annotations,
|
|
89
|
+
counters,
|
|
90
|
+
showExtraIcon: contextIcon,
|
|
77
91
|
fontSize: "inherit",
|
|
78
|
-
disableTooltip:
|
|
92
|
+
disableTooltip: true
|
|
79
93
|
}
|
|
80
94
|
),
|
|
81
|
-
|
|
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] })
|
|
82
99
|
] })
|
|
83
100
|
}
|
|
84
101
|
),
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
|
|
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) => (
|
|
89
106
|
// eslint-disable-next-line react/no-array-index-key
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
|
|
107
|
+
/* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
108
|
+
Chip,
|
|
92
109
|
{
|
|
93
110
|
size: "small",
|
|
94
|
-
variant:
|
|
95
|
-
icon:
|
|
96
|
-
label: /* @__PURE__ */
|
|
97
|
-
|
|
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,
|
|
98
115
|
":",
|
|
99
116
|
" ",
|
|
100
|
-
|
|
117
|
+
opt === "all" ? annotations.length : annotations.filter((annotation) => annotation.type === opt).length
|
|
101
118
|
] }),
|
|
102
|
-
onClick: () =>
|
|
119
|
+
onClick: () => setFilter(opt)
|
|
103
120
|
}
|
|
104
|
-
) },
|
|
121
|
+
) }, id)
|
|
105
122
|
)),
|
|
106
|
-
(
|
|
107
|
-
|
|
123
|
+
(errors == null ? void 0 : errors.length) > 0 && /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
124
|
+
Tooltip,
|
|
108
125
|
{
|
|
109
|
-
title: /* @__PURE__ */
|
|
110
|
-
/* @__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, " ") }),
|
|
111
128
|
":",
|
|
112
129
|
" ",
|
|
113
|
-
|
|
114
|
-
] },
|
|
115
|
-
children: /* @__PURE__ */
|
|
116
|
-
|
|
130
|
+
err.message
|
|
131
|
+
] }, err.source)) }),
|
|
132
|
+
children: /* @__PURE__ */ jsx(
|
|
133
|
+
Chip,
|
|
117
134
|
{
|
|
118
135
|
size: "small",
|
|
119
136
|
variant: "outlined",
|
|
120
|
-
icon: /* @__PURE__ */
|
|
121
|
-
|
|
137
|
+
icon: /* @__PURE__ */ jsx(
|
|
138
|
+
Icon,
|
|
122
139
|
{
|
|
123
140
|
icon: "material-symbols:timer-outline",
|
|
124
|
-
color:
|
|
141
|
+
color: theme.palette.error.main,
|
|
125
142
|
style: { filter: "drop-shadow(0px 0px 1px rgb(0 0 0 / 0.4))" }
|
|
126
143
|
}
|
|
127
144
|
),
|
|
128
|
-
label: /* @__PURE__ */
|
|
129
|
-
|
|
145
|
+
label: /* @__PURE__ */ jsxs(Typography, { variant: "caption", textTransform: "capitalize", children: [
|
|
146
|
+
t("annotation.failed"),
|
|
130
147
|
": ",
|
|
131
|
-
|
|
148
|
+
errors.length
|
|
132
149
|
] }),
|
|
133
|
-
onClick:
|
|
150
|
+
onClick: forceEnrich
|
|
134
151
|
}
|
|
135
152
|
)
|
|
136
153
|
}
|
|
137
154
|
) })
|
|
138
155
|
] }),
|
|
139
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ jsx(Grid, { container: true, spacing: 1, alignItems: "stretch", children: annotations.map((annotation, id) => (
|
|
140
157
|
// eslint-disable-next-line react/no-array-index-key
|
|
141
|
-
/* @__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)
|
|
142
159
|
)) })
|
|
143
160
|
] })
|
|
144
161
|
]
|
|
145
162
|
}
|
|
146
163
|
);
|
|
147
|
-
}
|
|
164
|
+
};
|
|
165
|
+
const EnrichedCard$1 = memo(EnrichedCard);
|
|
148
166
|
export {
|
|
149
|
-
|
|
167
|
+
EnrichedCard$1 as default
|
|
150
168
|
};
|