@cccsaurora/clue-ui 1.4.2 → 1.5.0-dev.454
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ActionForm-CbLz66Rk.js +6099 -0
- package/AnnotationDetails-CdNvyJl7.js +176 -0
- package/AnnotationPreview-C6a3qRFG.js +188 -0
- package/ClueEnrichContext-0eVIgvZp.js +594 -0
- package/FlexOne-BSYAhhtG.js +9 -0
- package/_MapCache-kuEY_iOH.js +220 -0
- package/_Set-BrSMTlHn.js +6 -0
- package/_Uint8Array-OPpgYQj7.js +123 -0
- package/_arrayIncludes-BNqL-9ZP.js +31 -0
- package/_arrayPush-CBkQqaE_.js +10 -0
- package/_baseAssignValue-CNUVPOBW.js +16 -0
- package/_baseClone-9FaRd1R2.js +287 -0
- package/_baseExtremum-wOGT4Dgw.js +18 -0
- package/_baseFlatten-Co6QHDlG.js +92 -0
- package/_baseGet-Cmp6FztG.js +109 -0
- package/_baseGetTag-Hj-0NTYF.js +44 -0
- package/_baseIsEqual-1CpU47TZ.js +211 -0
- package/_baseIteratee-BN7Vbe5g.js +126 -0
- package/_baseRest-BZ_hQ9PC.js +8 -0
- package/_baseSlice-GAv_YFTT.js +20 -0
- package/_baseSum-D0WC1dN0.js +13 -0
- package/_baseUniq-BnvS3JHL.js +63 -0
- package/_cacheHas-_aF2y2Xv.js +25 -0
- package/_commonjsHelpers-CUmg6egw.js +6 -0
- package/_createAggregator-BUZrP_is.js +63 -0
- package/_defineProperty-DolZLKmv.js +12 -0
- package/_getPrototype-Bb4gm-5m.js +5 -0
- package/_getTag-CML_cXiN.js +105 -0
- package/_isIterateeCall-B1IFEqVv.js +17 -0
- package/_setToArray-CqyqC8ib.js +10 -0
- package/cloneDeep-l3UkXG5M.js +8 -0
- package/components/AnnotationBody.js +49 -35
- package/components/AnnotationDetailPopover.js +39 -30
- package/components/AnnotationDetails.js +7 -7
- package/components/AnnotationEntry.js +35 -35
- package/components/AnnotationPreview.js +5 -5
- package/components/ClassificationChip.js +46 -24
- package/components/CountBadge.js +31 -26
- package/components/EnrichedCard.js +110 -97
- package/components/EnrichedChip.js +130 -105
- package/components/EnrichedTypography.js +133 -107
- package/components/ErrorBoundary.js +28 -24
- package/components/RetryFailedEnrichments.js +10 -9
- package/components/SourcePicker.js +57 -49
- package/components/actions/ActionForm.js +4 -4
- package/components/actions/ExecutePopover.js +75 -59
- package/components/actions/ResultModal.js +4 -4
- package/components/actions/form/schemaAdapter.js +39 -23
- package/components/actions/formats/FileResult.js +86 -59
- package/components/actions/formats/index.js +29 -25
- package/components/display/graph/ExpandMoreButton.js +10 -10
- package/components/display/graph/elements/NodeCard.js +111 -91
- package/components/display/graph/elements/NodeTag.js +15 -13
- package/components/display/graph/index.js +261 -202
- package/components/display/graph/visualizations/Leaf.js +89 -70
- package/components/display/graph/visualizations/cloud/index.js +98 -81
- package/components/display/graph/visualizations/icons/BaseIcon.js +26 -21
- package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
- package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
- package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
- package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
- package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
- package/components/display/graph/visualizations/icons/index.js +14 -13
- package/components/display/graph/visualizations/panels/NodePanel.js +10 -8
- package/components/display/graph/visualizations/tree/BundleLine.js +108 -81
- package/components/display/graph/visualizations/tree/Triangle.js +13 -13
- package/components/display/graph/visualizations/tree/index.js +408 -306
- package/components/display/icons/Iconified.js +27 -12
- package/components/display/json/index.js +4 -4
- package/components/display/markdown/index.js +8678 -5770
- package/components/enrichment/EnrichPopover.js +54 -46
- package/components/fetchers/Fetcher.js +166 -123
- package/components/fetchers/FetcherResultView.js +31 -27
- package/components/fetchers/PreviewModal.js +17 -16
- package/components/fetchers/StatusChip.js +21 -17
- package/components/group/Entry.js +13 -11
- package/components/group/Group.js +13 -10
- package/components/group/GroupControl.js +76 -65
- package/components/stats/QueryStatus.js +45 -32
- package/countBy-Bqcp3VCs.js +14 -0
- package/data/event.js +6 -4
- package/database/globals.js +2 -2
- package/database/index.js +3 -3
- package/database/replication.js +4 -4
- package/get-CdMThM8x.js +8 -0
- package/groupBy-BVV07EGQ.js +14 -0
- package/hooks/ClueActionContext.js +6 -6
- package/hooks/ClueComponentContext.js +29 -23
- package/hooks/ClueConfigProvider.js +14 -12
- package/hooks/ClueDatabaseContext.js +36 -24
- package/hooks/ClueEnrichContext.js +11 -11
- package/hooks/ClueFetcherContext.js +83 -56
- package/hooks/ClueGroupContext.js +17 -14
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +13 -11
- package/hooks/ClueUIPluginContext.js +50 -36
- package/hooks/selectors.js +7 -7
- package/hooks/useActionResult.js +3 -3
- package/hooks/useAnnotations.js +48 -32
- package/hooks/useClue.js +6 -4
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +6 -4
- package/hooks/useClueTypeConfig.js +49 -24
- package/hooks/useClueUIPlugins.js +8 -7
- package/hooks/useComparator.js +722 -435
- package/hooks/useErrors.js +22 -18
- package/hooks/useFetcherResult.js +33 -24
- package/hooks/useMyHighlights.js +66 -36
- package/hooks/useMyLocalStorage.js +66 -37
- package/iconify-DJxl6dC-.js +1789 -0
- package/icons/Action.js +66 -49
- package/icons/Assessment.js +85 -69
- package/icons/Context.js +77 -63
- package/icons/Opinion.js +76 -60
- package/icons/iconMap.js +2 -2
- package/identity-CPGTqrE4.js +6 -0
- package/index-CDrC9oSE.js +1172 -0
- package/index-CVUD9o3t.js +15768 -0
- package/index-DUEubgWN.js +464 -0
- package/index-DpJxD74E.js +3272 -0
- package/index-IKI1G5v-.js +9314 -0
- package/index-_gpzM2Px.js +702 -0
- package/isArguments-CuYlEuhP.js +27 -0
- package/isArray-RJPfgWqI.js +4 -0
- package/isEmpty-BE656RUK.js +30 -0
- package/isNil-CIubwp4T.js +6 -0
- package/isObject-FTY-5JQX.js +7 -0
- package/isObjectLike-CeENW9FN.js +6 -0
- package/isSymbol-D_H4HPZQ.js +9 -0
- package/last-CUCl67Im.js +7 -0
- package/main.js +62 -62
- package/maxBy-BjjQmX5t.js +8 -0
- package/package.json +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.js +4 -4
- package/plugins/test/index.js +17 -17
- package/plugins/utils.js +13 -12
- package/replication-kdsH0l7f.js +11779 -0
- package/sessionStorage-B68y-wnE.js +140 -0
- package/sortBy-B8JVsLQY.js +95 -0
- package/store-DHP48fQB.js +2165 -0
- package/sumBy-D-HCzM2i.js +8 -0
- package/text/Frequency.js +42 -23
- package/toFinite-meZTg4Su.js +16 -0
- package/toNumber-B5JaA1vX.js +39 -0
- package/uniq-CahZPAwp.js +7 -0
- package/utils/chain.js +92 -65
- package/utils/classificationParser.js +519 -256
- package/utils/constants.js +37 -11
- package/utils/graph.js +72 -45
- package/utils/hashUtil.js +7 -7
- package/utils/line.js +131 -81
- package/utils/loggerUtil.js +5 -3
- package/utils/sessionStorage.js +7 -7
- package/utils/time.js +447 -427
- package/utils/utils.js +10 -10
- package/utils/window.js +21 -10
- package/utils-CEySTPtg.js +224 -0
- package/ActionForm-DjyNwVzM.js +0 -4403
- package/AnnotationDetails-BvPv3_pR.js +0 -160
- package/AnnotationPreview-C0JN_lr0.js +0 -140
- package/ClueEnrichContext-CNbh-qiy.js +0 -452
- package/FlexOne-BXWFOd1T.js +0 -6
- package/_MapCache-DRK-s2eK.js +0 -179
- package/_Set-DrS_bbSV.js +0 -6
- package/_Uint8Array-D9R2N9Lp.js +0 -98
- package/_arrayIncludes-Dcl_29E6.js +0 -25
- package/_arrayPush-DBJIuK2V.js +0 -8
- package/_baseAssignValue-Bx1cxHj5.js +0 -12
- package/_baseClone-DRhywkxm.js +0 -211
- package/_baseExtremum-DodEaEyF.js +0 -16
- package/_baseFlatten-CD9NgrYE.js +0 -72
- package/_baseGet-bVwDaGrA.js +0 -80
- package/_baseGetTag-CxDaTem-.js +0 -25
- package/_baseIsEqual-C-FKsm1J.js +0 -150
- package/_baseIteratee-D0FhC5bC.js +0 -95
- package/_baseRest-D_eW2E0d.js +0 -8
- package/_baseSlice-M5RKzt1A.js +0 -10
- package/_baseSum-wEbgNeUs.js +0 -10
- package/_baseUniq-D3N8igOm.js +0 -41
- package/_cacheHas-Wgl-hw34.js +0 -22
- package/_commonjsHelpers-C6fGbg64.js +0 -6
- package/_createAggregator-BVj8IAuF.js +0 -53
- package/_defineProperty-BZU4WKA3.js +0 -11
- package/_getPrototype-BGBCg-aX.js +0 -5
- package/_getTag-B7R9qBo7.js +0 -73
- package/_isIterateeCall-Dm0VTAYy.js +0 -13
- package/_setToArray-Ck4YZu0Z.js +0 -9
- package/cloneDeep-fV59zwUf.js +0 -8
- package/countBy-B3rNuG4T.js +0 -8
- package/get-Bil3mzRD.js +0 -8
- package/groupBy-CrJC7sGa.js +0 -8
- package/iconify-Ptb5dTKy.js +0 -1270
- package/identity-ByMq8VxU.js +0 -6
- package/index-BH-gBhtO.js +0 -2282
- package/index-BM9Sve5T.js +0 -571
- package/index-Cj4d5cGz.js +0 -357
- package/index-D3Dwn-8x.js +0 -6464
- package/index-Dh2PP9h8.js +0 -11747
- package/index-DoFpWPHo.js +0 -975
- package/isArguments-BWcXOE6a.js +0 -24
- package/isArray-WzO_os3q.js +0 -4
- package/isEmpty-DKxrY-_M.js +0 -22
- package/isNil-CjWwlQS3.js +0 -6
- package/isObject-B53jY8Qg.js +0 -7
- package/isObjectLike-CYbdrIBr.js +0 -6
- package/isSymbol-DE1Kcy2M.js +0 -9
- package/last-7CdUxN0r.js +0 -7
- package/maxBy-BOWDkL_D.js +0 -8
- package/replication-WkKbPdwG.js +0 -8453
- package/sessionStorage-DFMae61b.js +0 -90
- package/sortBy-BHe812lF.js +0 -74
- package/store-D4aFUWxi.js +0 -1169
- package/sumBy-B7f_bP_k.js +0 -8
- package/toFinite-CBrE65MP.js +0 -14
- package/toNumber-CxmWey0f.js +0 -31
- package/uniq-B4UZ671_.js +0 -7
- package/utils-SpTOhPYl.js +0 -147
|
@@ -1,145 +1,170 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { Chip
|
|
3
|
-
import
|
|
4
|
-
import { ClueComponentContext
|
|
5
|
-
import { ClueGroupContext
|
|
6
|
-
import { C as
|
|
7
|
-
import { f as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { a as
|
|
16
|
-
const
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Chip, Tooltip, Box, Stack, CircularProgress } from "@mui/material";
|
|
3
|
+
import Iconified from "./display/icons/Iconified.js";
|
|
4
|
+
import { ClueComponentContext } from "../hooks/ClueComponentContext.js";
|
|
5
|
+
import { ClueGroupContext } from "../hooks/ClueGroupContext.js";
|
|
6
|
+
import { C as CluePopupContext } from "../AnnotationPreview-C6a3qRFG.js";
|
|
7
|
+
import { f as useClueEnrichSelector } from "../ActionForm-CbLz66Rk.js";
|
|
8
|
+
import useAnnotations from "../hooks/useAnnotations.js";
|
|
9
|
+
import ActionIcon from "../icons/Action.js";
|
|
10
|
+
import AssessmentIcon from "../icons/Assessment.js";
|
|
11
|
+
import ContextIcon from "../icons/Context.js";
|
|
12
|
+
import OpinionIcon from "../icons/Opinion.js";
|
|
13
|
+
import FrequencyText from "../text/Frequency.js";
|
|
14
|
+
import React__default, { useRef, useMemo, useCallback, useEffect, memo } from "react";
|
|
15
|
+
import { a as useContextSelector } from "../index-_gpzM2Px.js";
|
|
16
|
+
const EnrichedChip = React__default.memo(
|
|
17
17
|
({
|
|
18
|
-
type:
|
|
19
|
-
value
|
|
20
|
-
classification:
|
|
21
|
-
contextIcon
|
|
22
|
-
counters
|
|
23
|
-
hideDetails
|
|
24
|
-
hideLoading
|
|
25
|
-
forceDetails
|
|
26
|
-
setForceDetails
|
|
27
|
-
useDetailsIcon
|
|
28
|
-
skipEnrichment
|
|
29
|
-
slotProps
|
|
30
|
-
...
|
|
18
|
+
type: _type,
|
|
19
|
+
value,
|
|
20
|
+
classification: _classification,
|
|
21
|
+
contextIcon = false,
|
|
22
|
+
counters = false,
|
|
23
|
+
hideDetails = false,
|
|
24
|
+
hideLoading = false,
|
|
25
|
+
forceDetails = false,
|
|
26
|
+
setForceDetails = null,
|
|
27
|
+
useDetailsIcon = false,
|
|
28
|
+
skipEnrichment = false,
|
|
29
|
+
slotProps = {},
|
|
30
|
+
...otherProps
|
|
31
31
|
}) => {
|
|
32
|
-
const { t
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
const { t } = useContextSelector(ClueComponentContext, (ctx) => ctx.i18next);
|
|
33
|
+
const anchorRef = useRef();
|
|
34
|
+
const groupType = useContextSelector(ClueGroupContext, (ctx) => ctx == null ? void 0 : ctx.type);
|
|
35
|
+
const defaultClassification = useClueEnrichSelector((ctx) => ctx.defaultClassification);
|
|
36
|
+
const type = useMemo(() => _type ?? groupType, [_type, groupType]);
|
|
37
|
+
const classification = useMemo(
|
|
38
|
+
() => _classification ?? defaultClassification,
|
|
39
|
+
[_classification, defaultClassification]
|
|
35
40
|
);
|
|
36
|
-
if (!
|
|
41
|
+
if (!type) {
|
|
37
42
|
throw new Error("Type was not provided as a prop, and component is not used in a group context.");
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
}
|
|
44
|
+
const [annotations, loading] = useAnnotations(type, value, classification, { skipEnrichment });
|
|
45
|
+
const showInfo = useContextSelector(CluePopupContext, (ctx) => ctx.showInfo);
|
|
46
|
+
const closeInfo = useContextSelector(CluePopupContext, (ctx) => ctx.closeInfo);
|
|
47
|
+
const buildOptions = useCallback(() => {
|
|
48
|
+
const options = {};
|
|
49
|
+
if (setForceDetails) {
|
|
50
|
+
options.onClose = () => setForceDetails(false);
|
|
51
|
+
}
|
|
52
|
+
if (slotProps == null ? void 0 : slotProps.popover) {
|
|
53
|
+
options.popoverProps = slotProps.popover;
|
|
54
|
+
}
|
|
55
|
+
return options;
|
|
56
|
+
}, [setForceDetails, slotProps.popover]);
|
|
57
|
+
const clicker = useMemo(
|
|
58
|
+
() => !hideDetails || useDetailsIcon ? (e) => {
|
|
59
|
+
var _a;
|
|
60
|
+
showInfo("details", anchorRef.current, { type, value, classification }, buildOptions());
|
|
61
|
+
(_a = otherProps.onClick) == null ? void 0 : _a.call(otherProps, e);
|
|
62
|
+
e.stopPropagation();
|
|
63
|
+
e.preventDefault();
|
|
64
|
+
} : otherProps.onClick,
|
|
46
65
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
47
|
-
[
|
|
66
|
+
[hideDetails, useDetailsIcon, otherProps, type, value, classification]
|
|
48
67
|
);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
type
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
if (forceDetails) {
|
|
70
|
+
showInfo("details", anchorRef.current, { type, value, classification }, buildOptions());
|
|
71
|
+
} else {
|
|
72
|
+
closeInfo("details", {
|
|
73
|
+
type,
|
|
74
|
+
value,
|
|
75
|
+
classification
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}, [classification, forceDetails, type, value]);
|
|
79
|
+
return /* @__PURE__ */ jsx(
|
|
80
|
+
Chip,
|
|
57
81
|
{
|
|
58
|
-
...
|
|
59
|
-
ref:
|
|
60
|
-
variant:
|
|
82
|
+
...otherProps,
|
|
83
|
+
ref: anchorRef,
|
|
84
|
+
variant: otherProps.variant || "outlined",
|
|
61
85
|
sx: {
|
|
62
|
-
height:
|
|
86
|
+
height: otherProps.size === "medium" ? "40px" : "unset",
|
|
63
87
|
"& .MuiChip-label": { overflow: "visible" },
|
|
64
|
-
...
|
|
88
|
+
...otherProps.sx ?? {}
|
|
65
89
|
},
|
|
66
|
-
label: /* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
|
|
90
|
+
label: /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
91
|
+
/* @__PURE__ */ jsx(
|
|
92
|
+
AssessmentIcon,
|
|
69
93
|
{
|
|
70
|
-
ubiquitous:
|
|
71
|
-
value: { type
|
|
72
|
-
annotations
|
|
73
|
-
counters
|
|
74
|
-
disableTooltip:
|
|
94
|
+
ubiquitous: true,
|
|
95
|
+
value: { type, value, classification },
|
|
96
|
+
annotations,
|
|
97
|
+
counters,
|
|
98
|
+
disableTooltip: forceDetails,
|
|
75
99
|
style: { flexShrink: 0 }
|
|
76
100
|
}
|
|
77
101
|
),
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
|
|
102
|
+
/* @__PURE__ */ jsx(
|
|
103
|
+
OpinionIcon,
|
|
80
104
|
{
|
|
81
|
-
ubiquitous:
|
|
82
|
-
value: { type
|
|
83
|
-
annotations
|
|
84
|
-
counters
|
|
85
|
-
disableTooltip:
|
|
105
|
+
ubiquitous: true,
|
|
106
|
+
value: { type, value, classification },
|
|
107
|
+
annotations,
|
|
108
|
+
counters,
|
|
109
|
+
disableTooltip: forceDetails,
|
|
86
110
|
style: { flexShrink: 0 }
|
|
87
111
|
}
|
|
88
112
|
),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
|
|
113
|
+
/* @__PURE__ */ jsx(
|
|
114
|
+
ContextIcon,
|
|
91
115
|
{
|
|
92
|
-
ubiquitous:
|
|
93
|
-
value: { type
|
|
94
|
-
annotations
|
|
95
|
-
counters
|
|
96
|
-
showExtraIcon:
|
|
97
|
-
disableTooltip:
|
|
116
|
+
ubiquitous: true,
|
|
117
|
+
value: { type, value, classification },
|
|
118
|
+
annotations,
|
|
119
|
+
counters,
|
|
120
|
+
showExtraIcon: contextIcon,
|
|
121
|
+
disableTooltip: forceDetails,
|
|
98
122
|
style: { flexShrink: 0 }
|
|
99
123
|
}
|
|
100
124
|
),
|
|
101
|
-
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
|
|
125
|
+
otherProps.label ?? /* @__PURE__ */ jsx(FrequencyText, { fontSize: "inherit", annotations, value }),
|
|
126
|
+
/* @__PURE__ */ jsx(
|
|
127
|
+
AssessmentIcon,
|
|
104
128
|
{
|
|
105
|
-
value: { type
|
|
106
|
-
annotations
|
|
107
|
-
counters
|
|
108
|
-
disableTooltip:
|
|
129
|
+
value: { type, value, classification },
|
|
130
|
+
annotations,
|
|
131
|
+
counters,
|
|
132
|
+
disableTooltip: forceDetails,
|
|
109
133
|
style: { flexShrink: 0 }
|
|
110
134
|
}
|
|
111
135
|
),
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
|
|
136
|
+
/* @__PURE__ */ jsx(
|
|
137
|
+
OpinionIcon,
|
|
114
138
|
{
|
|
115
|
-
value: { type
|
|
116
|
-
annotations
|
|
117
|
-
counters
|
|
118
|
-
disableTooltip:
|
|
139
|
+
value: { type, value, classification },
|
|
140
|
+
annotations,
|
|
141
|
+
counters,
|
|
142
|
+
disableTooltip: forceDetails,
|
|
119
143
|
style: { flexShrink: 0 }
|
|
120
144
|
}
|
|
121
145
|
),
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
|
|
146
|
+
/* @__PURE__ */ jsx(
|
|
147
|
+
ContextIcon,
|
|
124
148
|
{
|
|
125
|
-
value: { type
|
|
126
|
-
annotations
|
|
127
|
-
counters
|
|
128
|
-
showExtraIcon:
|
|
129
|
-
disableTooltip:
|
|
149
|
+
value: { type, value, classification },
|
|
150
|
+
annotations,
|
|
151
|
+
counters,
|
|
152
|
+
showExtraIcon: contextIcon,
|
|
153
|
+
disableTooltip: forceDetails,
|
|
130
154
|
style: { flexShrink: 0 }
|
|
131
155
|
}
|
|
132
156
|
),
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
|
|
157
|
+
/* @__PURE__ */ jsx(ActionIcon, { counters, value: { type, value, classification }, disableTooltip: forceDetails }),
|
|
158
|
+
loading && !hideLoading && /* @__PURE__ */ jsx(CircularProgress, { color: "primary", size: 16 })
|
|
135
159
|
] }),
|
|
136
|
-
onClick:
|
|
137
|
-
onDelete: !
|
|
138
|
-
deleteIcon:
|
|
160
|
+
onClick: !useDetailsIcon ? clicker : void 0,
|
|
161
|
+
onDelete: !loading && useDetailsIcon ? clicker : void 0,
|
|
162
|
+
deleteIcon: useDetailsIcon ? /* @__PURE__ */ jsx(Tooltip, { title: t("details.open"), children: /* @__PURE__ */ jsx(Box, { component: "span", sx: { pr: 1 }, children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:outline-info" }) }) }) : null
|
|
139
163
|
}
|
|
140
164
|
);
|
|
141
165
|
}
|
|
142
|
-
)
|
|
166
|
+
);
|
|
167
|
+
const EnrichedChip_default = memo(EnrichedChip);
|
|
143
168
|
export {
|
|
144
|
-
|
|
169
|
+
EnrichedChip_default as default
|
|
145
170
|
};
|
|
@@ -1,147 +1,173 @@
|
|
|
1
|
-
import { jsxs
|
|
2
|
-
import { useTheme
|
|
3
|
-
import
|
|
4
|
-
import { ClueComponentContext
|
|
5
|
-
import { ClueGroupContext
|
|
6
|
-
import { C as
|
|
7
|
-
import { f as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { memo
|
|
15
|
-
import { a as
|
|
16
|
-
const
|
|
17
|
-
type:
|
|
18
|
-
value
|
|
19
|
-
classification:
|
|
20
|
-
contextIcon
|
|
21
|
-
counters
|
|
22
|
-
hideDetails
|
|
23
|
-
hideLoading
|
|
24
|
-
forceDetails
|
|
25
|
-
setForceDetails
|
|
26
|
-
useDetailsIcon
|
|
27
|
-
skipEnrichment
|
|
28
|
-
slotProps
|
|
29
|
-
children
|
|
30
|
-
...
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme, Stack, CircularProgress, Tooltip, IconButton } from "@mui/material";
|
|
3
|
+
import Iconified from "./display/icons/Iconified.js";
|
|
4
|
+
import { ClueComponentContext } from "../hooks/ClueComponentContext.js";
|
|
5
|
+
import { ClueGroupContext } from "../hooks/ClueGroupContext.js";
|
|
6
|
+
import { C as CluePopupContext } from "../AnnotationPreview-C6a3qRFG.js";
|
|
7
|
+
import { f as useClueEnrichSelector } from "../ActionForm-CbLz66Rk.js";
|
|
8
|
+
import useAnnotations from "../hooks/useAnnotations.js";
|
|
9
|
+
import ActionIcon from "../icons/Action.js";
|
|
10
|
+
import AssessmentIcon from "../icons/Assessment.js";
|
|
11
|
+
import ContextIcon from "../icons/Context.js";
|
|
12
|
+
import OpinionIcon from "../icons/Opinion.js";
|
|
13
|
+
import FrequencyText from "../text/Frequency.js";
|
|
14
|
+
import { memo, useRef, useMemo, useCallback, useEffect } from "react";
|
|
15
|
+
import { a as useContextSelector } from "../index-_gpzM2Px.js";
|
|
16
|
+
const EnrichedTypography = ({
|
|
17
|
+
type: _type,
|
|
18
|
+
value,
|
|
19
|
+
classification: _classification,
|
|
20
|
+
contextIcon = false,
|
|
21
|
+
counters = false,
|
|
22
|
+
hideDetails = false,
|
|
23
|
+
hideLoading = false,
|
|
24
|
+
forceDetails = false,
|
|
25
|
+
setForceDetails = null,
|
|
26
|
+
useDetailsIcon = false,
|
|
27
|
+
skipEnrichment = false,
|
|
28
|
+
slotProps = {},
|
|
29
|
+
children,
|
|
30
|
+
...otherProps
|
|
31
31
|
}) => {
|
|
32
|
-
var
|
|
33
|
-
const { t
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
var _a, _b, _c, _d;
|
|
33
|
+
const { t } = useContextSelector(ClueComponentContext, (ctx) => ctx.i18next);
|
|
34
|
+
const theme = useTheme();
|
|
35
|
+
const anchorRef = useRef();
|
|
36
|
+
const groupType = useContextSelector(ClueGroupContext, (ctx) => ctx == null ? void 0 : ctx.type);
|
|
37
|
+
const defaultClassification = useClueEnrichSelector((ctx) => ctx.defaultClassification);
|
|
38
|
+
const type = useMemo(() => _type ?? groupType, [_type, groupType]);
|
|
39
|
+
const classification = useMemo(
|
|
40
|
+
() => _classification ?? defaultClassification,
|
|
41
|
+
[_classification, defaultClassification]
|
|
36
42
|
);
|
|
37
|
-
if (!
|
|
43
|
+
if (!type) {
|
|
38
44
|
throw new Error("Type was not provided as a prop, and component is not used in a group context.");
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
}
|
|
46
|
+
const [annotations, loading] = useAnnotations(type, value, classification, { skipEnrichment });
|
|
47
|
+
const showInfo = useContextSelector(CluePopupContext, (state) => state.showInfo);
|
|
48
|
+
const closeInfo = useContextSelector(CluePopupContext, (state) => state.closeInfo);
|
|
49
|
+
const buildOptions = useCallback(() => {
|
|
50
|
+
const options = {};
|
|
51
|
+
if (setForceDetails) {
|
|
52
|
+
options.onClose = () => setForceDetails(false);
|
|
53
|
+
}
|
|
54
|
+
if (slotProps == null ? void 0 : slotProps.popover) {
|
|
55
|
+
options.popoverProps = slotProps.popover;
|
|
56
|
+
}
|
|
57
|
+
return options;
|
|
58
|
+
}, [setForceDetails, slotProps.popover]);
|
|
59
|
+
const clicker = useMemo(
|
|
60
|
+
() => !hideDetails || useDetailsIcon ? (e) => {
|
|
61
|
+
var _a2;
|
|
62
|
+
showInfo("details", anchorRef.current, { type, value, classification }, buildOptions());
|
|
63
|
+
(_a2 = otherProps.onClick) == null ? void 0 : _a2.call(otherProps, e);
|
|
64
|
+
e.stopPropagation();
|
|
65
|
+
e.preventDefault();
|
|
66
|
+
} : otherProps.onClick,
|
|
47
67
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
|
-
[
|
|
68
|
+
[hideDetails, useDetailsIcon, otherProps, type, value, classification]
|
|
49
69
|
);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
type
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
if (forceDetails) {
|
|
72
|
+
showInfo("details", anchorRef.current, { type, value, classification }, buildOptions());
|
|
73
|
+
} else {
|
|
74
|
+
closeInfo("details", {
|
|
75
|
+
type,
|
|
76
|
+
value,
|
|
77
|
+
classification
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}, [classification, forceDetails, type, value]);
|
|
81
|
+
return /* @__PURE__ */ jsxs(
|
|
82
|
+
Stack,
|
|
58
83
|
{
|
|
59
|
-
ref:
|
|
84
|
+
ref: anchorRef,
|
|
60
85
|
direction: "row",
|
|
61
86
|
spacing: 1,
|
|
62
87
|
alignItems: "center",
|
|
63
|
-
...
|
|
64
|
-
className: `enriched-typography ${((
|
|
88
|
+
...slotProps == null ? void 0 : slotProps.stack,
|
|
89
|
+
className: `enriched-typography ${((_a = slotProps == null ? void 0 : slotProps.stack) == null ? void 0 : _a.className) ?? ""}`.trim(),
|
|
65
90
|
sx: [
|
|
66
91
|
{
|
|
67
|
-
cursor: !
|
|
92
|
+
cursor: !loading && !hideDetails ? "pointer" : "inherit",
|
|
68
93
|
borderBottom: "1px solid transparent",
|
|
69
|
-
transition:
|
|
94
|
+
transition: theme.transitions.create(["border-bottom-color"]),
|
|
70
95
|
"&:hover": {
|
|
71
|
-
borderBottomColor: !
|
|
96
|
+
borderBottomColor: !loading && (!hideDetails ? theme.palette.primary.light : null)
|
|
72
97
|
}
|
|
73
98
|
},
|
|
74
|
-
...Array.isArray((
|
|
99
|
+
...Array.isArray((_b = slotProps == null ? void 0 : slotProps.stack) == null ? void 0 : _b.sx) ? (_c = slotProps == null ? void 0 : slotProps.stack) == null ? void 0 : _c.sx : [(_d = slotProps == null ? void 0 : slotProps.stack) == null ? void 0 : _d.sx]
|
|
75
100
|
],
|
|
76
|
-
onClick:
|
|
101
|
+
onClick: !useDetailsIcon ? clicker : void 0,
|
|
77
102
|
children: [
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
|
|
103
|
+
/* @__PURE__ */ jsx(
|
|
104
|
+
AssessmentIcon,
|
|
80
105
|
{
|
|
81
|
-
ubiquitous:
|
|
82
|
-
value: { type
|
|
83
|
-
annotations
|
|
84
|
-
counters
|
|
85
|
-
disableTooltip:
|
|
106
|
+
ubiquitous: true,
|
|
107
|
+
value: { type, value, classification },
|
|
108
|
+
annotations,
|
|
109
|
+
counters,
|
|
110
|
+
disableTooltip: forceDetails
|
|
86
111
|
}
|
|
87
112
|
),
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
|
|
113
|
+
/* @__PURE__ */ jsx(
|
|
114
|
+
OpinionIcon,
|
|
90
115
|
{
|
|
91
|
-
ubiquitous:
|
|
92
|
-
value: { type
|
|
93
|
-
annotations
|
|
94
|
-
counters
|
|
95
|
-
disableTooltip:
|
|
116
|
+
ubiquitous: true,
|
|
117
|
+
value: { type, value, classification },
|
|
118
|
+
annotations,
|
|
119
|
+
counters,
|
|
120
|
+
disableTooltip: forceDetails
|
|
96
121
|
}
|
|
97
122
|
),
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
|
|
123
|
+
/* @__PURE__ */ jsx(
|
|
124
|
+
ContextIcon,
|
|
100
125
|
{
|
|
101
|
-
ubiquitous:
|
|
102
|
-
value: { type
|
|
103
|
-
annotations
|
|
104
|
-
counters
|
|
105
|
-
showExtraIcon:
|
|
106
|
-
disableTooltip:
|
|
126
|
+
ubiquitous: true,
|
|
127
|
+
value: { type, value, classification },
|
|
128
|
+
annotations,
|
|
129
|
+
counters,
|
|
130
|
+
showExtraIcon: contextIcon,
|
|
131
|
+
disableTooltip: forceDetails
|
|
107
132
|
}
|
|
108
133
|
),
|
|
109
|
-
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
|
|
134
|
+
children ?? /* @__PURE__ */ jsx(FrequencyText, { id: `enriched-${type}-value`, ...otherProps, annotations, value }),
|
|
135
|
+
/* @__PURE__ */ jsx(
|
|
136
|
+
AssessmentIcon,
|
|
112
137
|
{
|
|
113
|
-
value: { type
|
|
114
|
-
annotations
|
|
115
|
-
counters
|
|
116
|
-
disableTooltip:
|
|
138
|
+
value: { type, value, classification },
|
|
139
|
+
annotations,
|
|
140
|
+
counters,
|
|
141
|
+
disableTooltip: forceDetails
|
|
117
142
|
}
|
|
118
143
|
),
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
|
|
144
|
+
/* @__PURE__ */ jsx(
|
|
145
|
+
OpinionIcon,
|
|
121
146
|
{
|
|
122
|
-
value: { type
|
|
123
|
-
annotations
|
|
124
|
-
counters
|
|
125
|
-
disableTooltip:
|
|
147
|
+
value: { type, value, classification },
|
|
148
|
+
annotations,
|
|
149
|
+
counters,
|
|
150
|
+
disableTooltip: forceDetails
|
|
126
151
|
}
|
|
127
152
|
),
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
|
|
153
|
+
/* @__PURE__ */ jsx(
|
|
154
|
+
ContextIcon,
|
|
130
155
|
{
|
|
131
|
-
value: { type
|
|
132
|
-
annotations
|
|
133
|
-
counters
|
|
134
|
-
showExtraIcon:
|
|
135
|
-
disableTooltip:
|
|
156
|
+
value: { type, value, classification },
|
|
157
|
+
annotations,
|
|
158
|
+
counters,
|
|
159
|
+
showExtraIcon: contextIcon,
|
|
160
|
+
disableTooltip: forceDetails
|
|
136
161
|
}
|
|
137
162
|
),
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
|
|
140
|
-
!
|
|
163
|
+
/* @__PURE__ */ jsx(ActionIcon, { counters, value: { type, value, classification }, disableTooltip: forceDetails }),
|
|
164
|
+
loading && !hideLoading && /* @__PURE__ */ jsx(CircularProgress, { color: "primary", size: 18 }),
|
|
165
|
+
!loading && useDetailsIcon && /* @__PURE__ */ jsx(Tooltip, { title: t("details.open"), children: /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: clicker, sx: { color: theme.palette.action.disabled }, children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:outline-info" }) }) })
|
|
141
166
|
]
|
|
142
167
|
}
|
|
143
168
|
);
|
|
144
|
-
}
|
|
169
|
+
};
|
|
170
|
+
const EnrichedTypography_default = memo(EnrichedTypography);
|
|
145
171
|
export {
|
|
146
|
-
|
|
172
|
+
EnrichedTypography_default as default
|
|
147
173
|
};
|
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { Box
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
class
|
|
6
|
-
constructor(
|
|
7
|
-
super(
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Accordion, AccordionSummary, Typography, AccordionDetails } from "@mui/material";
|
|
3
|
+
import Iconified from "./display/icons/Iconified.js";
|
|
4
|
+
import React__default from "react";
|
|
5
|
+
class ErrorBoundary extends React__default.Component {
|
|
6
|
+
constructor(props) {
|
|
7
|
+
super(props);
|
|
8
|
+
this.state = { hasError: false, error: null };
|
|
8
9
|
}
|
|
9
|
-
static getDerivedStateFromError(
|
|
10
|
-
return { hasError:
|
|
10
|
+
static getDerivedStateFromError(error) {
|
|
11
|
+
return { hasError: true, error };
|
|
11
12
|
}
|
|
12
|
-
componentDidCatch(
|
|
13
|
-
this.setState({ hasError:
|
|
13
|
+
componentDidCatch(error) {
|
|
14
|
+
this.setState({ hasError: true, error });
|
|
14
15
|
}
|
|
15
16
|
render() {
|
|
16
|
-
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
if (this.state.hasError) {
|
|
18
|
+
return /* @__PURE__ */ jsx(Box, { pt: 6, textAlign: "center", fontSize: 20, children: /* @__PURE__ */ jsxs(Accordion, { elevation: 0, children: [
|
|
19
|
+
/* @__PURE__ */ jsx(
|
|
20
|
+
AccordionSummary,
|
|
21
|
+
{
|
|
22
|
+
expandIcon: /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-expand-more" }),
|
|
23
|
+
"aria-controls": "panel1-content",
|
|
24
|
+
id: "panel1-header",
|
|
25
|
+
children: /* @__PURE__ */ jsx(Typography, { align: "center", sx: { width: "100%", fontSize: "1.2rem" }, variant: "h5", children: this.state.error.message })
|
|
26
|
+
}
|
|
27
|
+
),
|
|
28
|
+
/* @__PURE__ */ jsx(AccordionDetails, { children: /* @__PURE__ */ jsx("code", { children: /* @__PURE__ */ jsx(Typography, { variant: "h6", children: this.state.error.stack }) }) })
|
|
29
|
+
] }) });
|
|
30
|
+
}
|
|
31
|
+
return this.props.children;
|
|
28
32
|
}
|
|
29
33
|
}
|
|
30
34
|
export {
|
|
31
|
-
|
|
35
|
+
ErrorBoundary as default
|
|
32
36
|
};
|