@cccsaurora/clue-ui 0.15.0-dev.31 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +143 -39
- package/ActionForm-DgfJwTzt.js +0 -436
- package/AnnotationPreview-BvNpZOP0.js +0 -188
- package/ClueEnrichContext-DXwLVp0M.js +0 -518
- package/FlexOne-BSYAhhtG.js +0 -9
- package/_Map-kgDsDYxq.js +0 -64
- package/_MapCache-DabaaWfq.js +0 -161
- package/_Uint8Array-BlVVH1tp.js +0 -129
- package/_baseAssignValue-CNbcU6Nb.js +0 -25
- package/_baseClone-D3a8Pa4T.js +0 -284
- package/_baseExtremum-B1o1zHjR.js +0 -33
- package/_baseFlatten-D4huXoEI.js +0 -92
- package/_baseGet-BSK_nnoz.js +0 -109
- package/_baseIsEqual-B5xLoweL.js +0 -238
- package/_baseIteratee-p6Nj07-n.js +0 -126
- package/_baseSlice-GAv_YFTT.js +0 -20
- package/_baseSum-D0WC1dN0.js +0 -13
- package/_baseUniq-CpupKWcL.js +0 -89
- package/_commonjsHelpers-CUmg6egw.js +0 -6
- package/_createAggregator-BpVy5xMi.js +0 -63
- package/_getPrototype-D1LAdQKO.js +0 -5
- package/_getTag-D3ToyefI.js +0 -126
- package/api/lookup/enrich.d.ts +0 -10
- package/api/lookup/index.d.ts +0 -5
- package/api/lookup/types.d.ts +0 -5
- package/api/lookup/types_detection.d.ts +0 -5
- package/cloneDeep-CjP5k9zW.js +0 -8
- package/components/AnnotationBody.d.ts +0 -6
- package/components/AnnotationBody.js +0 -56
- package/components/AnnotationDetailPopover.d.ts +0 -14
- package/components/AnnotationDetailPopover.js +0 -61
- package/components/AnnotationDetails.d.ts +0 -8
- package/components/AnnotationDetails.js +0 -172
- package/components/AnnotationEntry.d.ts +0 -6
- package/components/AnnotationEntry.js +0 -59
- package/components/AnnotationPreview.d.ts +0 -14
- package/components/AnnotationPreview.js +0 -11
- package/components/ClassificationChip.d.ts +0 -11
- package/components/ClassificationChip.js +0 -52
- package/components/CountBadge.d.ts +0 -8
- package/components/CountBadge.js +0 -34
- package/components/EnrichedCard.d.ts +0 -14
- package/components/EnrichedCard.js +0 -162
- package/components/EnrichedChip.d.ts +0 -9
- package/components/EnrichedChip.js +0 -176
- package/components/EnrichedTypography.d.ts +0 -16
- package/components/EnrichedTypography.js +0 -178
- package/components/ErrorBoundary.d.ts +0 -15
- package/components/ErrorBoundary.js +0 -36
- package/components/RetryFailedEnrichments.d.ts +0 -2
- package/components/RetryFailedEnrichments.js +0 -13
- package/components/SourcePicker.d.ts +0 -2
- package/components/SourcePicker.js +0 -98
- package/components/actions/ActionForm.d.ts +0 -6
- package/components/actions/ActionForm.js +0 -16
- package/components/actions/ExecutePopover.d.ts +0 -10
- package/components/actions/ExecutePopover.js +0 -93
- package/components/actions/ResultModal.d.ts +0 -9
- package/components/actions/ResultModal.js +0 -46
- package/components/actions/form/schemaAdapter.d.ts +0 -3
- package/components/actions/form/schemaAdapter.js +0 -47
- package/components/display/graph/ExpandMoreButton.d.ts +0 -7
- package/components/display/graph/ExpandMoreButton.js +0 -18
- package/components/display/graph/elements/NodeCard.d.ts +0 -10
- package/components/display/graph/elements/NodeCard.js +0 -146
- package/components/display/graph/elements/NodeTag.d.ts +0 -9
- package/components/display/graph/elements/NodeTag.js +0 -17
- package/components/display/graph/index.d.ts +0 -9
- package/components/display/graph/index.js +0 -438
- package/components/display/graph/visualizations/Leaf.d.ts +0 -25
- package/components/display/graph/visualizations/Leaf.js +0 -125
- package/components/display/graph/visualizations/cloud/index.d.ts +0 -24
- package/components/display/graph/visualizations/cloud/index.js +0 -141
- package/components/display/graph/visualizations/icons/BaseIcon.d.ts +0 -12
- package/components/display/graph/visualizations/icons/BaseIcon.js +0 -37
- package/components/display/graph/visualizations/icons/BugIcon.d.ts +0 -5
- package/components/display/graph/visualizations/icons/BugIcon.js +0 -18
- package/components/display/graph/visualizations/icons/HostIcon.d.ts +0 -5
- package/components/display/graph/visualizations/icons/HostIcon.js +0 -24
- package/components/display/graph/visualizations/icons/NetworkIcon.d.ts +0 -5
- package/components/display/graph/visualizations/icons/NetworkIcon.js +0 -24
- package/components/display/graph/visualizations/icons/ProcessIcon.d.ts +0 -5
- package/components/display/graph/visualizations/icons/ProcessIcon.js +0 -18
- package/components/display/graph/visualizations/icons/TargetIcon.d.ts +0 -5
- package/components/display/graph/visualizations/icons/TargetIcon.js +0 -19
- package/components/display/graph/visualizations/icons/index.d.ts +0 -2
- package/components/display/graph/visualizations/icons/index.js +0 -16
- package/components/display/graph/visualizations/panels/NodePanel.d.ts +0 -8
- package/components/display/graph/visualizations/panels/NodePanel.js +0 -12
- package/components/display/graph/visualizations/tree/BundleLine.d.ts +0 -29
- package/components/display/graph/visualizations/tree/BundleLine.js +0 -121
- package/components/display/graph/visualizations/tree/Triangle.d.ts +0 -9
- package/components/display/graph/visualizations/tree/Triangle.js +0 -26
- package/components/display/graph/visualizations/tree/index.d.ts +0 -36
- package/components/display/graph/visualizations/tree/index.js +0 -485
- package/components/display/graph/visualizations/tree/types.d.ts +0 -11
- package/components/display/graph/visualizations/tree/types.js +0 -1
- package/components/display/icons/Iconified.d.ts +0 -9
- package/components/display/icons/Iconified.js +0 -29
- package/components/display/json/index.d.ts +0 -14
- package/components/display/json/index.js +0 -12
- package/components/display/markdown/DynamicTabs.d.ts +0 -8
- package/components/display/markdown/DynamicTabs.js +0 -26
- package/components/display/markdown/index.d.ts +0 -9
- package/components/display/markdown/index.js +0 -13389
- package/components/display/markdown/markdownPlugins/tabs.d.ts +0 -3
- package/components/display/markdown/markdownPlugins/tabs.js +0 -4
- package/components/enrichment/EnrichPopover.d.ts +0 -10
- package/components/enrichment/EnrichPopover.js +0 -88
- package/components/fetchers/Fetcher.d.ts +0 -17
- package/components/fetchers/Fetcher.js +0 -188
- package/components/fetchers/PreviewModal.d.ts +0 -8
- package/components/fetchers/PreviewModal.js +0 -22
- package/components/fetchers/StatusChip.d.ts +0 -8
- package/components/fetchers/StatusChip.js +0 -30
- package/components/group/Entry.d.ts +0 -8
- package/components/group/Entry.js +0 -15
- package/components/group/Group.d.ts +0 -12
- package/components/group/Group.js +0 -15
- package/components/group/GroupControl.d.ts +0 -4
- package/components/group/GroupControl.js +0 -103
- package/components/stats/QueryStatus.d.ts +0 -4
- package/components/stats/QueryStatus.js +0 -61
- package/countBy-C69WslUA.js +0 -14
- package/data/event.d.ts +0 -12
- package/data/event.js +0 -8
- package/database/index.d.ts +0 -4
- package/database/index.js +0 -4
- package/database/selector.schema.json.d.ts +0 -119
- package/database/status.schema.json.d.ts +0 -38
- package/database/types.d.ts +0 -64
- package/debounce-bV0h5FC5.js +0 -92
- package/en/translation.json +0 -135
- package/fr/translation.json +0 -135
- package/get-D3C3lEU3.js +0 -8
- package/groupBy-DC2oOuBN.js +0 -14
- package/hooks/ClueActionContext.d.ts +0 -86
- package/hooks/ClueActionContext.js +0 -18
- package/hooks/ClueComponentContext.d.ts +0 -10
- package/hooks/ClueComponentContext.js +0 -40
- package/hooks/ClueConfigProvider.d.ts +0 -12
- package/hooks/ClueConfigProvider.js +0 -23
- package/hooks/ClueDatabaseContext.d.ts +0 -10
- package/hooks/ClueDatabaseContext.js +0 -23
- package/hooks/ClueEnrichContext.d.ts +0 -6
- package/hooks/ClueEnrichContext.js +0 -15
- package/hooks/ClueEnrichContextType.d.ts +0 -113
- package/hooks/ClueEnrichProps.d.ts +0 -81
- package/hooks/ClueFetcherContext.d.ts +0 -35
- package/hooks/ClueFetcherContext.js +0 -88
- package/hooks/ClueGroupContext.d.ts +0 -14
- package/hooks/ClueGroupContext.js +0 -23
- package/hooks/CluePopupContext.d.ts +0 -24
- package/hooks/CluePopupContext.js +0 -12
- package/hooks/ClueProvider.d.ts +0 -9
- package/hooks/ClueProvider.js +0 -14
- package/hooks/selectors.d.ts +0 -10
- package/hooks/selectors.js +0 -24
- package/hooks/useAnnotations.d.ts +0 -24
- package/hooks/useAnnotations.js +0 -69
- package/hooks/useClue.d.ts +0 -4
- package/hooks/useClue.js +0 -8
- package/hooks/useClueActions.d.ts +0 -4
- package/hooks/useClueActions.js +0 -5
- package/hooks/useClueConfig.d.ts +0 -1
- package/hooks/useClueConfig.js +0 -8
- package/hooks/useClueTypeConfig.d.ts +0 -17
- package/hooks/useClueTypeConfig.js +0 -7
- package/hooks/useComparator.d.ts +0 -16
- package/hooks/useComparator.js +0 -1060
- package/hooks/useErrors.d.ts +0 -17
- package/hooks/useErrors.js +0 -35
- package/hooks/useMyHighlights.d.ts +0 -11
- package/hooks/useMyHighlights.js +0 -74
- package/hooks/useMyLocalStorage.d.ts +0 -16
- package/hooks/useMyLocalStorage.js +0 -80
- package/iconify-CXMreGTg.js +0 -1782
- package/icons/Action.d.ts +0 -9
- package/icons/Action.js +0 -90
- package/icons/Assessment.d.ts +0 -11
- package/icons/Assessment.js +0 -123
- package/icons/Context.d.ts +0 -12
- package/icons/Context.js +0 -83
- package/icons/Opinion.d.ts +0 -11
- package/icons/Opinion.js +0 -125
- package/icons/iconMap.d.ts +0 -7
- package/icons/iconMap.js +0 -10
- package/identity-CPGTqrE4.js +0 -6
- package/index-BDVjGvMI.js +0 -696
- package/index-BDrtH5ec.js +0 -465
- package/index-C9lySIVX.js +0 -1172
- package/index-DJYqRcxJ.js +0 -15750
- package/index-Dn2NHyXg.js +0 -17654
- package/index.css +0 -21
- package/isEmpty-BQkZubqU.js +0 -29
- package/isNil-CIubwp4T.js +0 -6
- package/isObject-FTY-5JQX.js +0 -7
- package/isObjectLike-OAgjjZye.js +0 -48
- package/isSymbol-Xd2FsJyp.js +0 -8
- package/isUndefined-CE8h73dH.js +0 -10
- package/last-CUCl67Im.js +0 -7
- package/main.d.ts +0 -42
- package/main.js +0 -70
- package/public/manifest.json +0 -16
- package/public/robots.txt +0 -3
- package/public/svg/dark/clue-h.svg +0 -52
- package/public/svg/dark/clue-icon1-simple.svg +0 -33
- package/public/svg/dark/clue-icon1.svg +0 -44
- package/public/svg/dark/clue-icon2-simple.svg +0 -26
- package/public/svg/dark/clue-icon2.svg +0 -37
- package/public/svg/dark/clue-name.svg +0 -14
- package/public/svg/dark/clue-v.svg +0 -52
- package/public/svg/light/clue-h.svg +0 -60
- package/public/svg/light/clue-icon1-simple.svg +0 -37
- package/public/svg/light/clue-icon1.svg +0 -48
- package/public/svg/light/clue-icon2-simple.svg +0 -30
- package/public/svg/light/clue-icon2.svg +0 -41
- package/public/svg/light/clue-name.svg +0 -14
- package/public/svg/light/clue-v.svg +0 -60
- package/sortBy-B-UKp4GT.js +0 -100
- package/sumBy-MYkDPHZL.js +0 -8
- package/tabs-xGuUGsJd.js +0 -254
- package/text/Frequency.d.ts +0 -9
- package/text/Frequency.js +0 -49
- package/toFinite-CArjry_l.js +0 -16
- package/toNumber-DPxy1FBy.js +0 -39
- package/types/EnrichmentProps.d.ts +0 -73
- package/types/RunningActionData.d.ts +0 -15
- package/types/WithActionData.d.ts +0 -9
- package/types/action.d.ts +0 -25
- package/types/config.d.ts +0 -16
- package/types/fetcher.d.ts +0 -60
- package/types/graph.d.ts +0 -101
- package/types/lookup.d.ts +0 -62
- package/types/network.d.ts +0 -9
- package/useClueTypeConfig-D9ZSxa4F.js +0 -3096
- package/utils/chain.d.ts +0 -14
- package/utils/chain.js +0 -106
- package/utils/classificationParser.d.ts +0 -195
- package/utils/classificationParser.js +0 -553
- package/utils/constants.d.ts +0 -26
- package/utils/constants.js +0 -36
- package/utils/graph.d.ts +0 -13
- package/utils/graph.js +0 -79
- package/utils/hashUtil.d.ts +0 -6
- package/utils/hashUtil.js +0 -11
- package/utils/line.d.ts +0 -28
- package/utils/line.js +0 -136
- package/utils/loggerUtil.d.ts +0 -6
- package/utils/loggerUtil.js +0 -8
- package/utils/sessionStorage.d.ts +0 -9
- package/utils/sessionStorage.js +0 -51
- package/utils/utils.d.ts +0 -13
- package/utils/utils.js +0 -11
- package/utils/window.d.ts +0 -3
- package/utils/window.js +0 -24
- package/utils-CxIhC2xH.js +0 -4182
package/icons/Action.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IconProps } from '@iconify/react';
|
|
2
|
-
import { Selector } from "../types/lookup";
|
|
3
|
-
|
|
4
|
-
declare const _default: import('react').NamedExoticComponent<{
|
|
5
|
-
value: Selector;
|
|
6
|
-
counters?: boolean;
|
|
7
|
-
disableTooltip?: boolean;
|
|
8
|
-
} & Omit<IconProps, "icon">>;
|
|
9
|
-
export default _default;
|
package/icons/Action.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { I as Icon } from "../iconify-CXMreGTg.js";
|
|
3
|
-
import { useTheme, Stack, Divider, Typography } from "@mui/material";
|
|
4
|
-
import CountBadge from "../components/CountBadge.js";
|
|
5
|
-
import { C as CluePopupContext } from "../AnnotationPreview-BvNpZOP0.js";
|
|
6
|
-
import { u as useClueActions } from "../ActionForm-DgfJwTzt.js";
|
|
7
|
-
import { memo, useRef, useMemo, useEffect } from "react";
|
|
8
|
-
import { u as useContextSelector } from "../index-BDVjGvMI.js";
|
|
9
|
-
import { g as groupBy } from "../groupBy-DC2oOuBN.js";
|
|
10
|
-
const ResultDetails = ({ result }) => {
|
|
11
|
-
return /* @__PURE__ */ jsxs(Stack, { p: 1, children: [
|
|
12
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body1", children: result.action.name }),
|
|
13
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: result.summary })
|
|
14
|
-
] });
|
|
15
|
-
};
|
|
16
|
-
const ActionIcon = ({ value, counters = true, disableTooltip = false, ...otherProps }) => {
|
|
17
|
-
const theme = useTheme();
|
|
18
|
-
const showInfo = useContextSelector(CluePopupContext, (state) => state.showInfo);
|
|
19
|
-
const closeInfo = useContextSelector(CluePopupContext, (state) => state.closeInfo);
|
|
20
|
-
const successAnchorRef = useRef();
|
|
21
|
-
const failureAnchorRef = useRef();
|
|
22
|
-
const { getActionResults } = useClueActions();
|
|
23
|
-
const actionResults = useMemo(
|
|
24
|
-
() => getActionResults(value.type, value.value, value.classification),
|
|
25
|
-
[getActionResults, value.classification, value.type, value.value]
|
|
26
|
-
);
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
if (disableTooltip) {
|
|
29
|
-
closeInfo("context", value);
|
|
30
|
-
}
|
|
31
|
-
}, [disableTooltip]);
|
|
32
|
-
const [successes, failures] = useMemo(() => {
|
|
33
|
-
const outcomes = groupBy(actionResults, (result) => result.outcome);
|
|
34
|
-
return [outcomes.success ?? [], outcomes.failure ?? []];
|
|
35
|
-
}, [actionResults]);
|
|
36
|
-
const successContent = useMemo(() => {
|
|
37
|
-
const entries = successes.map((result) => /* @__PURE__ */ jsx(ResultDetails, { result }, result.actionId));
|
|
38
|
-
return /* @__PURE__ */ jsx(Stack, { spacing: 1, divider: /* @__PURE__ */ jsx(Divider, { flexItem: true, orientation: "horizontal" }), children: entries });
|
|
39
|
-
}, [successes]);
|
|
40
|
-
const failureContent = useMemo(() => {
|
|
41
|
-
const entries = failures.map((result) => /* @__PURE__ */ jsx(ResultDetails, { result }, result.summary));
|
|
42
|
-
return /* @__PURE__ */ jsx(Stack, { spacing: 1, divider: /* @__PURE__ */ jsx(Divider, { flexItem: true, orientation: "horizontal" }), children: entries });
|
|
43
|
-
}, [failures]);
|
|
44
|
-
if ((actionResults == null ? void 0 : actionResults.length) < 1) {
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
return /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, children: [
|
|
48
|
-
/* @__PURE__ */ jsx(Divider, { flexItem: true, orientation: "vertical" }),
|
|
49
|
-
successes.length > 0 && /* @__PURE__ */ jsx(
|
|
50
|
-
"span",
|
|
51
|
-
{
|
|
52
|
-
ref: successAnchorRef,
|
|
53
|
-
style: { display: "flex" },
|
|
54
|
-
onMouseOver: disableTooltip ? void 0 : () => showInfo("actionResults", successAnchorRef.current, value, { content: successContent }),
|
|
55
|
-
onMouseLeave: disableTooltip ? void 0 : () => closeInfo("actionResults", value),
|
|
56
|
-
children: /* @__PURE__ */ jsx(CountBadge, { disabled: !counters, count: actionResults.filter((result) => result.outcome === "success").length, children: /* @__PURE__ */ jsx(
|
|
57
|
-
Icon,
|
|
58
|
-
{
|
|
59
|
-
icon: "material-symbols:bookmark-check-rounded",
|
|
60
|
-
color: theme.palette.success.main,
|
|
61
|
-
fontSize: "1.5em",
|
|
62
|
-
...otherProps
|
|
63
|
-
}
|
|
64
|
-
) })
|
|
65
|
-
}
|
|
66
|
-
),
|
|
67
|
-
failures.length > 0 && /* @__PURE__ */ jsx(
|
|
68
|
-
"span",
|
|
69
|
-
{
|
|
70
|
-
ref: failureAnchorRef,
|
|
71
|
-
style: { display: "flex" },
|
|
72
|
-
onMouseOver: disableTooltip ? void 0 : () => showInfo("actionResults", failureAnchorRef.current, value, { content: failureContent }),
|
|
73
|
-
onMouseLeave: disableTooltip ? void 0 : () => closeInfo("actionResults", value),
|
|
74
|
-
children: /* @__PURE__ */ jsx(CountBadge, { disabled: !counters, count: actionResults.filter((result) => result.outcome === "failure").length, children: /* @__PURE__ */ jsx(
|
|
75
|
-
Icon,
|
|
76
|
-
{
|
|
77
|
-
icon: "material-symbols:cancel-presentation-rounded",
|
|
78
|
-
color: theme.palette.error.main,
|
|
79
|
-
fontSize: "1.5em",
|
|
80
|
-
...otherProps
|
|
81
|
-
}
|
|
82
|
-
) })
|
|
83
|
-
}
|
|
84
|
-
)
|
|
85
|
-
] });
|
|
86
|
-
};
|
|
87
|
-
const ActionIcon$1 = memo(ActionIcon);
|
|
88
|
-
export {
|
|
89
|
-
ActionIcon$1 as default
|
|
90
|
-
};
|
package/icons/Assessment.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IconProps } from '@iconify/react';
|
|
2
|
-
import { Annotation, Selector } from "../types/lookup";
|
|
3
|
-
|
|
4
|
-
declare const _default: import('react').NamedExoticComponent<{
|
|
5
|
-
annotations: Annotation[];
|
|
6
|
-
value: Selector;
|
|
7
|
-
counters?: boolean;
|
|
8
|
-
disableTooltip?: boolean;
|
|
9
|
-
ubiquitous?: boolean;
|
|
10
|
-
} & Omit<IconProps, "icon">>;
|
|
11
|
-
export default _default;
|
package/icons/Assessment.js
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { I as Icon } from "../iconify-CXMreGTg.js";
|
|
3
|
-
import { useTheme, Stack, Chip, Divider, Grid, Tooltip } from "@mui/material";
|
|
4
|
-
import CountBadge from "../components/CountBadge.js";
|
|
5
|
-
import { C as CluePopupContext } from "../AnnotationPreview-BvNpZOP0.js";
|
|
6
|
-
import { memo, useRef, useState, useMemo, useEffect } from "react";
|
|
7
|
-
import { u as useContextSelector } from "../index-BDVjGvMI.js";
|
|
8
|
-
import { g as groupBy } from "../groupBy-DC2oOuBN.js";
|
|
9
|
-
import { s as sumBy } from "../sumBy-MYkDPHZL.js";
|
|
10
|
-
import { m as maxBy, s as sortBy } from "../sortBy-B-UKp4GT.js";
|
|
11
|
-
import { l as last } from "../last-CUCl67Im.js";
|
|
12
|
-
const AssessmentIcon = ({ annotations, value, counters = true, disableTooltip = false, ubiquitous = false, ...otherProps }) => {
|
|
13
|
-
const theme = useTheme();
|
|
14
|
-
const showInfo = useContextSelector(CluePopupContext, (state) => state.showInfo);
|
|
15
|
-
const closeInfo = useContextSelector(CluePopupContext, (state) => state.closeInfo);
|
|
16
|
-
const anchorRef = useRef();
|
|
17
|
-
const [showTooltip, setShowTooltip] = useState(false);
|
|
18
|
-
const assessmentAnnotations = useMemo(
|
|
19
|
-
() => annotations.filter((annotation) => (annotation == null ? void 0 : annotation.type) === "assessment" && (annotation == null ? void 0 : annotation.ubiquitous) === ubiquitous),
|
|
20
|
-
[annotations, ubiquitous]
|
|
21
|
-
);
|
|
22
|
-
const sortedAssessments = useMemo(
|
|
23
|
-
() => Object.entries(groupBy(assessmentAnnotations, "value")).map(([_value, _annotations]) => [
|
|
24
|
-
_value,
|
|
25
|
-
sumBy(_annotations, "quantity")
|
|
26
|
-
]),
|
|
27
|
-
[assessmentAnnotations]
|
|
28
|
-
);
|
|
29
|
-
const popularAssessment = useMemo(() => maxBy(sortedAssessments, last), [sortedAssessments]);
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
if (disableTooltip) {
|
|
32
|
-
setShowTooltip(false);
|
|
33
|
-
}
|
|
34
|
-
}, [disableTooltip]);
|
|
35
|
-
if ((assessmentAnnotations == null ? void 0 : assessmentAnnotations.length) < 1) {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
const tooltipProps = {
|
|
39
|
-
tooltip: {
|
|
40
|
-
sx: {
|
|
41
|
-
maxWidth: "500px",
|
|
42
|
-
backgroundColor: theme.palette.background.paper,
|
|
43
|
-
border: `thin solid ${theme.palette.divider}`,
|
|
44
|
-
p: 1,
|
|
45
|
-
boxShadow: theme.shadows[2]
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
const tooltipContent = /* @__PURE__ */ jsxs(Stack, { spacing: 1, onClick: (e) => e.stopPropagation(), children: [
|
|
50
|
-
assessmentAnnotations.length > 1 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
51
|
-
/* @__PURE__ */ jsx(Stack, { direction: "row", children: sortedAssessments.map(([type, count]) => /* @__PURE__ */ jsx(
|
|
52
|
-
Chip,
|
|
53
|
-
{
|
|
54
|
-
size: "small",
|
|
55
|
-
variant: "outlined",
|
|
56
|
-
label: `${type}: ${count}`,
|
|
57
|
-
icon: /* @__PURE__ */ jsx(
|
|
58
|
-
Icon,
|
|
59
|
-
{
|
|
60
|
-
icon: ["trivial", "recon", "attempt", "compromise", "mitigated"].includes(type) ? "healthicons:hazardous" : "fluent-mdl2:ribbon-solid"
|
|
61
|
-
}
|
|
62
|
-
),
|
|
63
|
-
color: ["trivial", "recon", "attempt", "compromise", "mitigated"].includes(type) ? "error" : "success"
|
|
64
|
-
},
|
|
65
|
-
type
|
|
66
|
-
)) }),
|
|
67
|
-
/* @__PURE__ */ jsx(Divider, { orientation: "horizontal", flexItem: true })
|
|
68
|
-
] }),
|
|
69
|
-
/* @__PURE__ */ jsx(
|
|
70
|
-
Grid,
|
|
71
|
-
{
|
|
72
|
-
sx: {
|
|
73
|
-
mt: assessmentAnnotations.length < 2 && `${theme.spacing(-0.5)} !important`,
|
|
74
|
-
ml: `${theme.spacing(-0.5)} !important`
|
|
75
|
-
},
|
|
76
|
-
container: true,
|
|
77
|
-
spacing: 0.5,
|
|
78
|
-
maxWidth: "500px",
|
|
79
|
-
children: sortBy(assessmentAnnotations, "value").map((annotation) => /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
80
|
-
Chip,
|
|
81
|
-
{
|
|
82
|
-
size: "small",
|
|
83
|
-
variant: "outlined",
|
|
84
|
-
label: annotation.analytic + (annotation.quantity > 1 ? ` (x${annotation.quantity})` : ""),
|
|
85
|
-
icon: /* @__PURE__ */ jsx(
|
|
86
|
-
Icon,
|
|
87
|
-
{
|
|
88
|
-
icon: ["trivial", "recon", "attempt", "compromise", "mitigated"].includes(annotation.value) ? "healthicons:hazardous" : "fluent-mdl2:ribbon-solid"
|
|
89
|
-
}
|
|
90
|
-
),
|
|
91
|
-
color: ["trivial", "recon", "attempt", "compromise", "mitigated"].includes(annotation.value) ? "error" : "success"
|
|
92
|
-
}
|
|
93
|
-
) }, annotation.analytic + annotation.value))
|
|
94
|
-
}
|
|
95
|
-
)
|
|
96
|
-
] });
|
|
97
|
-
if (["trivial", "recon", "attempt", "compromise", "mitigated"].includes(popularAssessment[0])) {
|
|
98
|
-
return /* @__PURE__ */ jsx(
|
|
99
|
-
"span",
|
|
100
|
-
{
|
|
101
|
-
ref: anchorRef,
|
|
102
|
-
style: { display: "flex" },
|
|
103
|
-
onMouseOver: disableTooltip ? void 0 : () => showInfo("assessment", anchorRef.current, value, { content: tooltipContent }),
|
|
104
|
-
onMouseLeave: disableTooltip ? void 0 : () => closeInfo("assessment", value),
|
|
105
|
-
children: /* @__PURE__ */ jsx(CountBadge, { disabled: !counters, color: "error", count: popularAssessment[1], children: /* @__PURE__ */ jsx(Icon, { fontSize: "1.5em", ...otherProps, icon: "healthicons:hazardous", color: theme.palette.error.main }) })
|
|
106
|
-
}
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
return /* @__PURE__ */ jsx(
|
|
110
|
-
"span",
|
|
111
|
-
{
|
|
112
|
-
ref: anchorRef,
|
|
113
|
-
style: { display: "flex" },
|
|
114
|
-
onMouseOver: disableTooltip ? void 0 : () => showInfo("assessment", anchorRef.current, value, { content: tooltipContent }),
|
|
115
|
-
onMouseLeave: disableTooltip ? void 0 : () => closeInfo("assessment", value),
|
|
116
|
-
children: /* @__PURE__ */ jsx(Tooltip, { disableInteractive: true, componentsProps: tooltipProps, open: showTooltip, title: tooltipContent, children: /* @__PURE__ */ jsx(CountBadge, { disabled: !counters, count: popularAssessment[1], children: /* @__PURE__ */ jsx(Icon, { fontSize: "1.5em", ...otherProps, icon: "fluent-mdl2:ribbon-solid", color: theme.palette.success.main }) }) })
|
|
117
|
-
}
|
|
118
|
-
);
|
|
119
|
-
};
|
|
120
|
-
const AssessmentIcon$1 = memo(AssessmentIcon);
|
|
121
|
-
export {
|
|
122
|
-
AssessmentIcon$1 as default
|
|
123
|
-
};
|
package/icons/Context.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IconProps } from '@iconify/react';
|
|
2
|
-
import { Annotation, Selector, WithExtra } from "../types/lookup";
|
|
3
|
-
|
|
4
|
-
declare const _default: import('react').NamedExoticComponent<{
|
|
5
|
-
annotations: WithExtra<Annotation>[];
|
|
6
|
-
value: Selector;
|
|
7
|
-
counters?: boolean;
|
|
8
|
-
disableTooltip?: boolean;
|
|
9
|
-
showExtraIcon?: boolean;
|
|
10
|
-
ubiquitous?: boolean;
|
|
11
|
-
} & Omit<IconProps, "icon">>;
|
|
12
|
-
export default _default;
|
package/icons/Context.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { I as Icon } from "../iconify-CXMreGTg.js";
|
|
3
|
-
import { Stack, Divider } from "@mui/material";
|
|
4
|
-
import AnnotationEntry from "../components/AnnotationEntry.js";
|
|
5
|
-
import CountBadge from "../components/CountBadge.js";
|
|
6
|
-
import Iconified from "../components/display/icons/Iconified.js";
|
|
7
|
-
import { C as CluePopupContext } from "../AnnotationPreview-BvNpZOP0.js";
|
|
8
|
-
import { memo, useRef, useMemo, useEffect } from "react";
|
|
9
|
-
import { u as useContextSelector } from "../index-BDVjGvMI.js";
|
|
10
|
-
import { g as groupBy } from "../groupBy-DC2oOuBN.js";
|
|
11
|
-
const ContextIcon = ({
|
|
12
|
-
annotations,
|
|
13
|
-
value,
|
|
14
|
-
counters = true,
|
|
15
|
-
disableTooltip = false,
|
|
16
|
-
showExtraIcon = false,
|
|
17
|
-
ubiquitous = false,
|
|
18
|
-
...otherProps
|
|
19
|
-
}) => {
|
|
20
|
-
const showInfo = useContextSelector(CluePopupContext, (state) => state.showInfo);
|
|
21
|
-
const closeInfo = useContextSelector(CluePopupContext, (state) => state.closeInfo);
|
|
22
|
-
const anchorRef = useRef();
|
|
23
|
-
const contextAnnotations = useMemo(
|
|
24
|
-
() => annotations.filter((annotation) => annotation.type === "context" && annotation.ubiquitous === ubiquitous),
|
|
25
|
-
[annotations, ubiquitous]
|
|
26
|
-
);
|
|
27
|
-
const additionalIcons = useMemo(() => contextAnnotations.filter((annotation) => annotation.icon), [contextAnnotations]);
|
|
28
|
-
useEffect(() => {
|
|
29
|
-
if (disableTooltip) {
|
|
30
|
-
closeInfo("context", value);
|
|
31
|
-
}
|
|
32
|
-
}, [disableTooltip]);
|
|
33
|
-
if ((contextAnnotations == null ? void 0 : contextAnnotations.length) < 1) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
const icons = [];
|
|
37
|
-
if (additionalIcons.length) {
|
|
38
|
-
Object.entries(groupBy(additionalIcons, "icon")).forEach(
|
|
39
|
-
([icon, _annotations]) => icons.push(
|
|
40
|
-
/* @__PURE__ */ jsx(
|
|
41
|
-
"span",
|
|
42
|
-
{
|
|
43
|
-
ref: anchorRef,
|
|
44
|
-
style: { display: "flex" },
|
|
45
|
-
onMouseOver: disableTooltip ? void 0 : () => showInfo("context", anchorRef.current, value, {
|
|
46
|
-
content: /* @__PURE__ */ jsx(
|
|
47
|
-
Stack,
|
|
48
|
-
{
|
|
49
|
-
onClick: (e) => e.stopPropagation(),
|
|
50
|
-
spacing: 1,
|
|
51
|
-
divider: /* @__PURE__ */ jsx(Divider, { flexItem: true, orientation: "horizontal" }),
|
|
52
|
-
children: _annotations.map((annotation) => /* @__PURE__ */ jsx(AnnotationEntry, { annotation }, JSON.stringify(annotation)))
|
|
53
|
-
}
|
|
54
|
-
)
|
|
55
|
-
}),
|
|
56
|
-
onMouseLeave: disableTooltip ? void 0 : () => closeInfo("context", value),
|
|
57
|
-
children: /* @__PURE__ */ jsx(
|
|
58
|
-
Icon,
|
|
59
|
-
{
|
|
60
|
-
icon,
|
|
61
|
-
fontSize: otherProps.fontSize ?? "1.25em",
|
|
62
|
-
style: { filter: "drop-shadow(0px 0px 1px rgb(0 0 0 / 0.4))", ...otherProps.style ?? {} },
|
|
63
|
-
...otherProps
|
|
64
|
-
}
|
|
65
|
-
)
|
|
66
|
-
},
|
|
67
|
-
icon
|
|
68
|
-
)
|
|
69
|
-
)
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
const additionalSize = contextAnnotations.length - additionalIcons.length;
|
|
73
|
-
if (additionalSize > 0 && showExtraIcon) {
|
|
74
|
-
icons.push(
|
|
75
|
-
/* @__PURE__ */ jsx(CountBadge, { disabled: !counters, count: additionalSize, children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-newspaper", style: { zIndex: 2, ...otherProps.style ?? {} } }) }, "extra")
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
return /* @__PURE__ */ jsx(Stack, { direction: "row", spacing: 1, children: icons });
|
|
79
|
-
};
|
|
80
|
-
const ContextIcon$1 = memo(ContextIcon);
|
|
81
|
-
export {
|
|
82
|
-
ContextIcon$1 as default
|
|
83
|
-
};
|
package/icons/Opinion.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IconProps } from '@iconify/react';
|
|
2
|
-
import { Annotation, Selector } from "../types/lookup";
|
|
3
|
-
|
|
4
|
-
declare const _default: import('react').NamedExoticComponent<{
|
|
5
|
-
annotations: Annotation[];
|
|
6
|
-
value: Selector;
|
|
7
|
-
counters?: boolean;
|
|
8
|
-
disableTooltip?: boolean;
|
|
9
|
-
ubiquitous?: boolean;
|
|
10
|
-
} & Omit<IconProps, "icon">>;
|
|
11
|
-
export default _default;
|
package/icons/Opinion.js
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { I as Icon } from "../iconify-CXMreGTg.js";
|
|
3
|
-
import { useTheme, Stack, Chip, Divider, Grid } from "@mui/material";
|
|
4
|
-
import CountBadge from "../components/CountBadge.js";
|
|
5
|
-
import { C as CluePopupContext } from "../AnnotationPreview-BvNpZOP0.js";
|
|
6
|
-
import chain from "../utils/chain.js";
|
|
7
|
-
import { memo, useRef, useMemo, useCallback, useEffect } from "react";
|
|
8
|
-
import { u as useContextSelector } from "../index-BDVjGvMI.js";
|
|
9
|
-
import { g as groupBy } from "../groupBy-DC2oOuBN.js";
|
|
10
|
-
import { s as sumBy } from "../sumBy-MYkDPHZL.js";
|
|
11
|
-
import { s as sortBy } from "../sortBy-B-UKp4GT.js";
|
|
12
|
-
const OpinionIcon = ({ annotations, value, counters = true, disableTooltip = false, ubiquitous = false, ...otherProps }) => {
|
|
13
|
-
const theme = useTheme();
|
|
14
|
-
const showInfo = useContextSelector(CluePopupContext, (state) => state.showInfo);
|
|
15
|
-
const closeInfo = useContextSelector(CluePopupContext, (state) => state.closeInfo);
|
|
16
|
-
const anchorRef = useRef();
|
|
17
|
-
const opinionAnnotations = useMemo(
|
|
18
|
-
() => annotations.filter((annotation) => annotation.type === "opinion" && annotation.ubiquitous === ubiquitous),
|
|
19
|
-
[annotations, ubiquitous]
|
|
20
|
-
);
|
|
21
|
-
const sortedOpinions = useMemo(
|
|
22
|
-
() => chain(
|
|
23
|
-
Object.entries(groupBy(opinionAnnotations, "value")).map(([_value, _annotations]) => [
|
|
24
|
-
_value,
|
|
25
|
-
sumBy(_annotations, "quantity")
|
|
26
|
-
])
|
|
27
|
-
).sortBy(([__, count]) => count).reverse().value(),
|
|
28
|
-
[opinionAnnotations]
|
|
29
|
-
);
|
|
30
|
-
const icon = useCallback(
|
|
31
|
-
(_opinion) => _opinion === "benign" ? "mdi:shield-check" : _opinion === "suspicious" ? "mdi:warning-outline" : _opinion === "obscure" ? "bi:eye-slash-fill" : "mdi:warning-decagram",
|
|
32
|
-
[]
|
|
33
|
-
);
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
if (disableTooltip) {
|
|
36
|
-
closeInfo("opinion", value);
|
|
37
|
-
}
|
|
38
|
-
}, [disableTooltip]);
|
|
39
|
-
const tooltipContent = useMemo(
|
|
40
|
-
() => /* @__PURE__ */ jsxs(Stack, { spacing: 1, onClick: (e) => e.stopPropagation(), children: [
|
|
41
|
-
opinionAnnotations.length > 1 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
42
|
-
/* @__PURE__ */ jsx(Stack, { direction: "row", children: sortedOpinions.map(([type, count]) => /* @__PURE__ */ jsx(
|
|
43
|
-
Chip,
|
|
44
|
-
{
|
|
45
|
-
size: "small",
|
|
46
|
-
variant: "outlined",
|
|
47
|
-
label: `${type}: ${count}`,
|
|
48
|
-
icon: /* @__PURE__ */ jsx(Icon, { icon: icon(type) }),
|
|
49
|
-
sx: { textTransform: "capitalize" },
|
|
50
|
-
color: {
|
|
51
|
-
benign: "success",
|
|
52
|
-
suspicious: "warning",
|
|
53
|
-
obscure: "error",
|
|
54
|
-
malicious: "error"
|
|
55
|
-
}[type]
|
|
56
|
-
},
|
|
57
|
-
type
|
|
58
|
-
)) }),
|
|
59
|
-
/* @__PURE__ */ jsx(Divider, { orientation: "horizontal", flexItem: true })
|
|
60
|
-
] }),
|
|
61
|
-
/* @__PURE__ */ jsx(
|
|
62
|
-
Grid,
|
|
63
|
-
{
|
|
64
|
-
sx: {
|
|
65
|
-
mt: opinionAnnotations.length < 2 && `${theme.spacing(-0.5)} !important`,
|
|
66
|
-
ml: `${theme.spacing(-0.5)} !important`
|
|
67
|
-
},
|
|
68
|
-
container: true,
|
|
69
|
-
spacing: 0.5,
|
|
70
|
-
maxWidth: "500px",
|
|
71
|
-
children: sortBy(opinionAnnotations, "value").map((annotation) => /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
72
|
-
Chip,
|
|
73
|
-
{
|
|
74
|
-
size: "small",
|
|
75
|
-
variant: "outlined",
|
|
76
|
-
label: (annotation.analytic ?? annotation.author) + (annotation.quantity > 1 ? ` (x${annotation.quantity})` : ""),
|
|
77
|
-
icon: /* @__PURE__ */ jsx(Icon, { icon: icon(annotation.value) }),
|
|
78
|
-
color: {
|
|
79
|
-
benign: "success",
|
|
80
|
-
suspicious: "warning",
|
|
81
|
-
obscure: "error",
|
|
82
|
-
malicious: "error"
|
|
83
|
-
}[annotation.value]
|
|
84
|
-
}
|
|
85
|
-
) }, (annotation.analytic ?? annotation.author) + annotation.value))
|
|
86
|
-
}
|
|
87
|
-
)
|
|
88
|
-
] }),
|
|
89
|
-
[icon, opinionAnnotations, sortedOpinions, theme]
|
|
90
|
-
);
|
|
91
|
-
if ((opinionAnnotations == null ? void 0 : opinionAnnotations.length) < 1) {
|
|
92
|
-
return null;
|
|
93
|
-
}
|
|
94
|
-
return /* @__PURE__ */ jsx(
|
|
95
|
-
"span",
|
|
96
|
-
{
|
|
97
|
-
ref: anchorRef,
|
|
98
|
-
style: { display: "flex" },
|
|
99
|
-
onMouseOver: disableTooltip ? void 0 : () => showInfo("assessment", anchorRef.current, value, { content: tooltipContent }),
|
|
100
|
-
onMouseLeave: disableTooltip ? void 0 : () => closeInfo("assessment", value),
|
|
101
|
-
children: /* @__PURE__ */ jsx(CountBadge, { disabled: !counters, count: sortedOpinions[0][1], children: /* @__PURE__ */ jsx(
|
|
102
|
-
Icon,
|
|
103
|
-
{
|
|
104
|
-
fontSize: "1.25em",
|
|
105
|
-
...otherProps,
|
|
106
|
-
icon: icon(sortedOpinions[0][0]),
|
|
107
|
-
color: {
|
|
108
|
-
benign: theme.palette.success.light,
|
|
109
|
-
suspicious: theme.palette.warning.light,
|
|
110
|
-
obscure: theme.palette.error.light,
|
|
111
|
-
malicious: theme.palette.error.light
|
|
112
|
-
}[sortedOpinions[0][0]],
|
|
113
|
-
style: {
|
|
114
|
-
zIndex: 2,
|
|
115
|
-
...otherProps.style ?? {}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
) })
|
|
119
|
-
}
|
|
120
|
-
);
|
|
121
|
-
};
|
|
122
|
-
const OpinionIcon$1 = memo(OpinionIcon);
|
|
123
|
-
export {
|
|
124
|
-
OpinionIcon$1 as default
|
|
125
|
-
};
|
package/icons/iconMap.d.ts
DELETED
package/icons/iconMap.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
const ICON_MAP = {
|
|
2
|
-
context: "material-symbols:contextual-token",
|
|
3
|
-
opinion: "material-symbols:how-to-vote-rounded",
|
|
4
|
-
mitigation: "material-symbols:shield-locked-rounded",
|
|
5
|
-
frequency: "material-symbols:show-chart-rounded",
|
|
6
|
-
assessment: "material-symbols:menu-book"
|
|
7
|
-
};
|
|
8
|
-
export {
|
|
9
|
-
ICON_MAP
|
|
10
|
-
};
|