@cccsaurora/clue-ui 1.2.0-dev.254 → 1.2.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/ActionForm-pWyIi01Z.js +4460 -0
- package/AnnotationDetails-11P7yhyx.js +160 -0
- package/AnnotationPreview-BGqlBBcp.js +140 -0
- package/ClueEnrichContext-DDZf646J.js +418 -0
- package/FlexOne-BXWFOd1T.js +6 -0
- package/_MapCache-BiTi0iqu.js +180 -0
- package/_Uint8Array-TJBs9NS2.js +101 -0
- package/_baseAssignValue-CNMLQZco.js +20 -0
- package/_baseClone-DajKHDCs.js +207 -0
- package/_baseExtremum-DhV10dXG.js +27 -0
- package/_baseFlatten-C8CjmqQ-.js +72 -0
- package/_baseGet-DSZygzyq.js +79 -0
- package/_baseIsEqual-C08cUUpA.js +147 -0
- package/_baseIteratee-DGZdhdqr.js +95 -0
- package/_baseSlice-M5RKzt1A.js +10 -0
- package/_baseSum-wEbgNeUs.js +10 -0
- package/_baseUniq-CGlHphLr.js +79 -0
- package/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/_createAggregator-BvcoTZto.js +53 -0
- package/_getPrototype-Dm06JiGv.js +5 -0
- package/_getTag-Cfxlub3L.js +90 -0
- package/_setToArray-C7yMOeww.js +29 -0
- package/cloneDeep-wjl3XmFj.js +8 -0
- package/components/AnnotationBody.js +35 -49
- package/components/AnnotationDetailPopover.js +30 -36
- package/components/AnnotationDetails.js +7 -7
- package/components/AnnotationEntry.js +35 -35
- package/components/AnnotationPreview.js +5 -5
- package/components/ClassificationChip.js +23 -44
- package/components/CountBadge.js +26 -31
- package/components/EnrichedCard.js +97 -110
- package/components/EnrichedChip.js +105 -130
- package/components/EnrichedTypography.js +107 -133
- package/components/ErrorBoundary.js +24 -28
- package/components/RetryFailedEnrichments.js +9 -10
- package/components/SourcePicker.js +49 -57
- package/components/actions/ActionForm.js +4 -4
- package/components/actions/ExecutePopover.js +59 -75
- package/components/actions/ResultModal.js +4 -4
- package/components/actions/form/schemaAdapter.js +23 -39
- package/components/actions/formats/FileResult.js +59 -86
- package/components/actions/formats/index.js +10 -21
- package/components/display/graph/ExpandMoreButton.js +10 -10
- package/components/display/graph/elements/NodeCard.js +91 -111
- package/components/display/graph/elements/NodeTag.js +13 -15
- package/components/display/graph/index.js +202 -261
- package/components/display/graph/visualizations/Leaf.js +69 -88
- package/components/display/graph/visualizations/cloud/index.js +81 -98
- package/components/display/graph/visualizations/icons/BaseIcon.js +21 -26
- 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 +13 -14
- package/components/display/graph/visualizations/panels/NodePanel.js +8 -10
- package/components/display/graph/visualizations/tree/BundleLine.js +81 -108
- package/components/display/graph/visualizations/tree/Triangle.js +13 -13
- package/components/display/graph/visualizations/tree/index.js +305 -407
- package/components/display/icons/Iconified.js +12 -27
- package/components/display/json/index.js +4 -4
- package/components/display/markdown/index.js +5770 -8678
- package/components/enrichment/EnrichPopover.js +46 -54
- package/components/fetchers/Fetcher.js +117 -155
- package/components/fetchers/PreviewModal.js +17 -20
- package/components/fetchers/StatusChip.js +17 -21
- package/components/group/Entry.js +11 -13
- package/components/group/Group.js +10 -13
- package/components/group/GroupControl.js +65 -76
- package/components/stats/QueryStatus.js +33 -43
- package/countBy-pIyxNZhO.js +8 -0
- package/data/event.js +4 -6
- package/database/index.js +2 -2
- package/debounce-DryYcbJ4.js +56 -0
- package/get-CH7kz5Ix.js +8 -0
- package/groupBy-yNrpdipq.js +8 -0
- package/hooks/ClueActionContext.js +6 -6
- package/hooks/ClueComponentContext.js +23 -29
- package/hooks/ClueConfigProvider.js +12 -14
- package/hooks/ClueDatabaseContext.js +13 -19
- package/hooks/ClueEnrichContext.js +8 -8
- package/hooks/ClueFetcherContext.js +56 -83
- package/hooks/ClueGroupContext.js +14 -17
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +10 -12
- package/hooks/selectors.js +7 -7
- package/hooks/useActionResult.js +2 -2
- package/hooks/useAnnotations.js +31 -47
- package/hooks/useClue.js +4 -6
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +4 -6
- package/hooks/useClueTypeConfig.js +3 -3
- package/hooks/useComparator.js +435 -722
- package/hooks/useErrors.js +18 -22
- package/hooks/useFetcherResult.js +24 -33
- package/hooks/useMyHighlights.js +36 -66
- package/hooks/useMyLocalStorage.js +37 -66
- package/iconify-BBckr5AQ.js +1263 -0
- package/icons/Action.js +49 -66
- package/icons/Assessment.js +68 -84
- package/icons/Context.js +63 -77
- package/icons/Opinion.js +65 -77
- package/icons/iconMap.js +2 -2
- package/identity-ByMq8VxU.js +6 -0
- package/index-BHAe_V9n.js +12768 -0
- package/index-CA5CUNZO.js +975 -0
- package/index-D_ZywK71.js +358 -0
- package/index-Dj5C04IX.js +568 -0
- package/index-p5_wX7q1.js +11729 -0
- package/isNil-CjWwlQS3.js +6 -0
- package/isObject-B53jY8Qg.js +7 -0
- package/isObjectLike-BatpeCIi.js +29 -0
- package/isSymbol-C3_SC0Qp.js +8 -0
- package/last-7CdUxN0r.js +7 -0
- package/main.js +60 -60
- package/package.json +1 -1
- package/sortBy-0BpKRt8p.js +79 -0
- package/sumBy-Do6Ff4Bw.js +8 -0
- package/text/Frequency.js +23 -42
- package/toFinite-BMy6GObD.js +14 -0
- package/toNumber-YVhnnJv4.js +31 -0
- package/useClueTypeConfig-77zd_zdF.js +2292 -0
- package/utils/chain.js +64 -91
- package/utils/classificationParser.js +256 -519
- package/utils/constants.js +10 -35
- package/utils/graph.js +45 -72
- package/utils/hashUtil.js +7 -7
- package/utils/line.js +81 -131
- package/utils/loggerUtil.js +3 -5
- package/utils/sessionStorage.js +27 -41
- package/utils/time.js +423 -423
- package/utils/utils.js +9 -9
- package/utils/window.js +10 -21
- package/utils-D5hPDE7N.js +129 -0
- package/ActionForm-C0aE9HUv.js +0 -5941
- package/AnnotationDetails-CEou0vCc.js +0 -175
- package/AnnotationPreview-CLMVD6Ec.js +0 -188
- package/ClueEnrichContext-BkD9ZwM9.js +0 -541
- package/FlexOne-BSYAhhtG.js +0 -9
- package/_MapCache-WmuDdwuH.js +0 -222
- package/_Uint8Array-DdG4KLKn.js +0 -128
- package/_baseAssignValue-CGTuELqU.js +0 -25
- package/_baseClone-BpWiBnMp.js +0 -283
- package/_baseExtremum-BY663UjY.js +0 -33
- package/_baseFlatten-B69cDsaV.js +0 -92
- package/_baseGet-Bx3A4Qfp.js +0 -108
- package/_baseIsEqual-B4IufFlL.js +0 -208
- package/_baseIteratee-7AQvAy1o.js +0 -126
- package/_baseSlice-GAv_YFTT.js +0 -20
- package/_baseSum-D0WC1dN0.js +0 -13
- package/_baseUniq-B8fK6hI-.js +0 -115
- package/_commonjsHelpers-DWwsNxpa.js +0 -8
- package/_createAggregator-CwGPThny.js +0 -63
- package/_getPrototype-CblfEidB.js +0 -5
- package/_getTag-jwz4XLoZ.js +0 -126
- package/_setToArray-CaPKQhcz.js +0 -33
- package/cloneDeep-DmUylbkM.js +0 -8
- package/countBy-DqlU5OwT.js +0 -14
- package/debounce-bV0h5FC5.js +0 -92
- package/get-DSsNkRQs.js +0 -8
- package/groupBy-ChDRT7uy.js +0 -14
- package/iconify-CXMreGTg.js +0 -1782
- package/identity-CPGTqrE4.js +0 -6
- package/index-AMfoEg_6.js +0 -696
- package/index-B6C2a_Lg.js +0 -1172
- package/index-C12gPw2W.js +0 -17698
- package/index-DCKkHTvx.js +0 -15750
- package/index-UkW8Sur3.js +0 -465
- 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/last-CUCl67Im.js +0 -7
- package/sortBy-C7mGPI_D.js +0 -100
- package/sumBy-CGALjmwQ.js +0 -8
- package/toFinite-Bc55msYj.js +0 -16
- package/toNumber-DPxy1FBy.js +0 -39
- package/useClueTypeConfig-D2tf4-NM.js +0 -3289
- package/utils-71DpzFrA.js +0 -199
|
@@ -1,170 +1,145 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Chip, Tooltip, Box, Stack, CircularProgress } from "@mui/material";
|
|
3
|
-
import
|
|
4
|
-
import { ClueComponentContext } from "../hooks/ClueComponentContext.js";
|
|
5
|
-
import { ClueGroupContext } from "../hooks/ClueGroupContext.js";
|
|
6
|
-
import { C as
|
|
7
|
-
import { b as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { u as
|
|
16
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as O } from "react/jsx-runtime";
|
|
2
|
+
import { Chip as B, Tooltip as G, Box as _, Stack as H, CircularProgress as J } from "@mui/material";
|
|
3
|
+
import K from "./display/icons/Iconified.js";
|
|
4
|
+
import { ClueComponentContext as L } from "../hooks/ClueComponentContext.js";
|
|
5
|
+
import { ClueGroupContext as N } from "../hooks/ClueGroupContext.js";
|
|
6
|
+
import { C as E } from "../AnnotationPreview-BGqlBBcp.js";
|
|
7
|
+
import { b as Q } from "../ActionForm-pWyIi01Z.js";
|
|
8
|
+
import U from "../hooks/useAnnotations.js";
|
|
9
|
+
import V from "../icons/Action.js";
|
|
10
|
+
import v from "../icons/Assessment.js";
|
|
11
|
+
import q from "../icons/Context.js";
|
|
12
|
+
import z from "../icons/Opinion.js";
|
|
13
|
+
import W from "../text/Frequency.js";
|
|
14
|
+
import X, { useRef as Y, useMemo as u, useCallback as Z, useEffect as $, memo as F } from "react";
|
|
15
|
+
import { u as m } from "../index-Dj5C04IX.js";
|
|
16
|
+
const D = X.memo(
|
|
17
17
|
({
|
|
18
|
-
type:
|
|
19
|
-
value,
|
|
20
|
-
classification:
|
|
21
|
-
contextIcon =
|
|
22
|
-
counters =
|
|
23
|
-
hideDetails =
|
|
24
|
-
hideLoading =
|
|
25
|
-
forceDetails =
|
|
26
|
-
setForceDetails = null,
|
|
27
|
-
useDetailsIcon =
|
|
28
|
-
skipEnrichment =
|
|
29
|
-
slotProps = {},
|
|
30
|
-
...
|
|
18
|
+
type: C,
|
|
19
|
+
value: i,
|
|
20
|
+
classification: x,
|
|
21
|
+
contextIcon: b = !1,
|
|
22
|
+
counters: f = !1,
|
|
23
|
+
hideDetails: h = !1,
|
|
24
|
+
hideLoading: A = !1,
|
|
25
|
+
forceDetails: r = !1,
|
|
26
|
+
setForceDetails: c = null,
|
|
27
|
+
useDetailsIcon: s = !1,
|
|
28
|
+
skipEnrichment: R = !1,
|
|
29
|
+
slotProps: a = {},
|
|
30
|
+
...l
|
|
31
31
|
}) => {
|
|
32
|
-
const { t } =
|
|
33
|
-
|
|
34
|
-
|
|
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]
|
|
32
|
+
const { t: j } = m(L, (o) => o.i18next), d = Y(), k = m(N, (o) => o == null ? void 0 : o.type), y = Q((o) => o.defaultClassification), n = u(() => C ?? k, [C, k]), t = u(
|
|
33
|
+
() => x ?? y,
|
|
34
|
+
[x, y]
|
|
40
35
|
);
|
|
41
|
-
if (!
|
|
36
|
+
if (!n)
|
|
42
37
|
throw new Error("Type was not provided as a prop, and component is not used in a group context.");
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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,
|
|
38
|
+
const [p, T] = U(n, i, t, { skipEnrichment: R }), S = m(E, (o) => o.showInfo), M = m(E, (o) => o.closeInfo), w = Z(() => {
|
|
39
|
+
const o = {};
|
|
40
|
+
return c && (o.onClose = () => c(!1)), a != null && a.popover && (o.popoverProps = a.popover), o;
|
|
41
|
+
}, [c, a.popover]), g = u(
|
|
42
|
+
() => !h || s ? (o) => {
|
|
43
|
+
var I;
|
|
44
|
+
S("details", d.current, { type: n, value: i, classification: t }, w()), (I = l.onClick) == null || I.call(l, o), o.stopPropagation(), o.preventDefault();
|
|
45
|
+
} : l.onClick,
|
|
65
46
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
66
|
-
[
|
|
47
|
+
[h, s, l, n, i, t]
|
|
67
48
|
);
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
}, [classification, forceDetails, type, value]);
|
|
79
|
-
return /* @__PURE__ */ jsx(
|
|
80
|
-
Chip,
|
|
49
|
+
return $(() => {
|
|
50
|
+
r ? S("details", d.current, { type: n, value: i, classification: t }, w()) : M("details", {
|
|
51
|
+
type: n,
|
|
52
|
+
value: i,
|
|
53
|
+
classification: t
|
|
54
|
+
});
|
|
55
|
+
}, [t, r, n, i]), /* @__PURE__ */ e(
|
|
56
|
+
B,
|
|
81
57
|
{
|
|
82
|
-
...
|
|
83
|
-
ref:
|
|
84
|
-
variant:
|
|
58
|
+
...l,
|
|
59
|
+
ref: d,
|
|
60
|
+
variant: l.variant || "outlined",
|
|
85
61
|
sx: {
|
|
86
|
-
height:
|
|
62
|
+
height: l.size !== "small" ? "40px" : "unset",
|
|
87
63
|
"& .MuiChip-label": { overflow: "visible" },
|
|
88
|
-
...
|
|
64
|
+
...l.sx ?? {}
|
|
89
65
|
},
|
|
90
|
-
label: /* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
|
|
66
|
+
label: /* @__PURE__ */ O(H, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
67
|
+
/* @__PURE__ */ e(
|
|
68
|
+
v,
|
|
93
69
|
{
|
|
94
|
-
ubiquitous:
|
|
95
|
-
value: { type, value, classification },
|
|
96
|
-
annotations,
|
|
97
|
-
counters,
|
|
98
|
-
disableTooltip:
|
|
70
|
+
ubiquitous: !0,
|
|
71
|
+
value: { type: n, value: i, classification: t },
|
|
72
|
+
annotations: p,
|
|
73
|
+
counters: f,
|
|
74
|
+
disableTooltip: r,
|
|
99
75
|
style: { flexShrink: 0 }
|
|
100
76
|
}
|
|
101
77
|
),
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
|
|
78
|
+
/* @__PURE__ */ e(
|
|
79
|
+
z,
|
|
104
80
|
{
|
|
105
|
-
ubiquitous:
|
|
106
|
-
value: { type, value, classification },
|
|
107
|
-
annotations,
|
|
108
|
-
counters,
|
|
109
|
-
disableTooltip:
|
|
81
|
+
ubiquitous: !0,
|
|
82
|
+
value: { type: n, value: i, classification: t },
|
|
83
|
+
annotations: p,
|
|
84
|
+
counters: f,
|
|
85
|
+
disableTooltip: r,
|
|
110
86
|
style: { flexShrink: 0 }
|
|
111
87
|
}
|
|
112
88
|
),
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
|
|
89
|
+
/* @__PURE__ */ e(
|
|
90
|
+
q,
|
|
115
91
|
{
|
|
116
|
-
ubiquitous:
|
|
117
|
-
value: { type, value, classification },
|
|
118
|
-
annotations,
|
|
119
|
-
counters,
|
|
120
|
-
showExtraIcon:
|
|
121
|
-
disableTooltip:
|
|
92
|
+
ubiquitous: !0,
|
|
93
|
+
value: { type: n, value: i, classification: t },
|
|
94
|
+
annotations: p,
|
|
95
|
+
counters: f,
|
|
96
|
+
showExtraIcon: b,
|
|
97
|
+
disableTooltip: r,
|
|
122
98
|
style: { flexShrink: 0 }
|
|
123
99
|
}
|
|
124
100
|
),
|
|
125
|
-
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
|
|
101
|
+
l.label ?? /* @__PURE__ */ e(W, { fontSize: "inherit", annotations: p, value: i }),
|
|
102
|
+
/* @__PURE__ */ e(
|
|
103
|
+
v,
|
|
128
104
|
{
|
|
129
|
-
value: { type, value, classification },
|
|
130
|
-
annotations,
|
|
131
|
-
counters,
|
|
132
|
-
disableTooltip:
|
|
105
|
+
value: { type: n, value: i, classification: t },
|
|
106
|
+
annotations: p,
|
|
107
|
+
counters: f,
|
|
108
|
+
disableTooltip: r,
|
|
133
109
|
style: { flexShrink: 0 }
|
|
134
110
|
}
|
|
135
111
|
),
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
-
|
|
112
|
+
/* @__PURE__ */ e(
|
|
113
|
+
z,
|
|
138
114
|
{
|
|
139
|
-
value: { type, value, classification },
|
|
140
|
-
annotations,
|
|
141
|
-
counters,
|
|
142
|
-
disableTooltip:
|
|
115
|
+
value: { type: n, value: i, classification: t },
|
|
116
|
+
annotations: p,
|
|
117
|
+
counters: f,
|
|
118
|
+
disableTooltip: r,
|
|
143
119
|
style: { flexShrink: 0 }
|
|
144
120
|
}
|
|
145
121
|
),
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
-
|
|
122
|
+
/* @__PURE__ */ e(
|
|
123
|
+
q,
|
|
148
124
|
{
|
|
149
|
-
value: { type, value, classification },
|
|
150
|
-
annotations,
|
|
151
|
-
counters,
|
|
152
|
-
showExtraIcon:
|
|
153
|
-
disableTooltip:
|
|
125
|
+
value: { type: n, value: i, classification: t },
|
|
126
|
+
annotations: p,
|
|
127
|
+
counters: f,
|
|
128
|
+
showExtraIcon: b,
|
|
129
|
+
disableTooltip: r,
|
|
154
130
|
style: { flexShrink: 0 }
|
|
155
131
|
}
|
|
156
132
|
),
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
|
|
133
|
+
/* @__PURE__ */ e(V, { counters: f, value: { type: n, value: i, classification: t }, disableTooltip: r }),
|
|
134
|
+
T && !A && /* @__PURE__ */ e(J, { color: "primary", size: 16 })
|
|
159
135
|
] }),
|
|
160
|
-
onClick:
|
|
161
|
-
onDelete: !
|
|
162
|
-
deleteIcon:
|
|
136
|
+
onClick: s ? void 0 : g,
|
|
137
|
+
onDelete: !T && s ? g : void 0,
|
|
138
|
+
deleteIcon: s ? /* @__PURE__ */ e(G, { title: j("details.open"), children: /* @__PURE__ */ e(_, { component: "span", sx: { pr: 1 }, children: /* @__PURE__ */ e(K, { icon: "ic:outline-info" }) }) }) : null
|
|
163
139
|
}
|
|
164
140
|
);
|
|
165
141
|
}
|
|
166
|
-
);
|
|
167
|
-
const EnrichedChip_default = memo(EnrichedChip);
|
|
142
|
+
), Co = F(D);
|
|
168
143
|
export {
|
|
169
|
-
|
|
144
|
+
Co as default
|
|
170
145
|
};
|
|
@@ -1,173 +1,147 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useTheme, Stack, CircularProgress, Tooltip, IconButton } from "@mui/material";
|
|
3
|
-
import
|
|
4
|
-
import { ClueComponentContext } from "../hooks/ClueComponentContext.js";
|
|
5
|
-
import { ClueGroupContext } from "../hooks/ClueGroupContext.js";
|
|
6
|
-
import { C as
|
|
7
|
-
import { b as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { memo, useRef, useMemo, useCallback, useEffect } from "react";
|
|
15
|
-
import { u as
|
|
16
|
-
const
|
|
17
|
-
type:
|
|
18
|
-
value,
|
|
19
|
-
classification:
|
|
20
|
-
contextIcon =
|
|
21
|
-
counters =
|
|
22
|
-
hideDetails =
|
|
23
|
-
hideLoading =
|
|
24
|
-
forceDetails =
|
|
25
|
-
setForceDetails = null,
|
|
26
|
-
useDetailsIcon =
|
|
27
|
-
skipEnrichment =
|
|
28
|
-
slotProps = {},
|
|
29
|
-
children,
|
|
30
|
-
...
|
|
1
|
+
import { jsxs as J, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme as K, Stack as L, CircularProgress as Q, Tooltip as U, IconButton as V } from "@mui/material";
|
|
3
|
+
import W from "./display/icons/Iconified.js";
|
|
4
|
+
import { ClueComponentContext as X } from "../hooks/ClueComponentContext.js";
|
|
5
|
+
import { ClueGroupContext as Y } from "../hooks/ClueGroupContext.js";
|
|
6
|
+
import { C as j } from "../AnnotationPreview-BGqlBBcp.js";
|
|
7
|
+
import { b as Z } from "../ActionForm-pWyIi01Z.js";
|
|
8
|
+
import F from "../hooks/useAnnotations.js";
|
|
9
|
+
import _ from "../icons/Action.js";
|
|
10
|
+
import z from "../icons/Assessment.js";
|
|
11
|
+
import N from "../icons/Context.js";
|
|
12
|
+
import O from "../icons/Opinion.js";
|
|
13
|
+
import D from "../text/Frequency.js";
|
|
14
|
+
import { memo as P, useRef as ii, useMemo as x, useCallback as ni, useEffect as oi } from "react";
|
|
15
|
+
import { u as l } from "../index-Dj5C04IX.js";
|
|
16
|
+
const ei = ({
|
|
17
|
+
type: T,
|
|
18
|
+
value: e,
|
|
19
|
+
classification: s,
|
|
20
|
+
contextIcon: h = !1,
|
|
21
|
+
counters: c = !1,
|
|
22
|
+
hideDetails: d = !1,
|
|
23
|
+
hideLoading: R = !1,
|
|
24
|
+
forceDetails: r = !1,
|
|
25
|
+
setForceDetails: C = null,
|
|
26
|
+
useDetailsIcon: u = !1,
|
|
27
|
+
skipEnrichment: $ = !1,
|
|
28
|
+
slotProps: i = {},
|
|
29
|
+
children: G,
|
|
30
|
+
...f
|
|
31
31
|
}) => {
|
|
32
|
-
var
|
|
33
|
-
const { t } =
|
|
34
|
-
|
|
35
|
-
|
|
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]
|
|
32
|
+
var A, q, v, B;
|
|
33
|
+
const { t: M } = l(X, (n) => n.i18next), b = K(), y = ii(), k = l(Y, (n) => n == null ? void 0 : n.type), g = Z((n) => n.defaultClassification), o = x(() => T ?? k, [T, k]), t = x(
|
|
34
|
+
() => s ?? g,
|
|
35
|
+
[s, g]
|
|
42
36
|
);
|
|
43
|
-
if (!
|
|
37
|
+
if (!o)
|
|
44
38
|
throw new Error("Type was not provided as a prop, and component is not used in a group context.");
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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,
|
|
39
|
+
const [m, p] = F(o, e, t, { skipEnrichment: $ }), I = l(j, (n) => n.showInfo), H = l(j, (n) => n.closeInfo), w = ni(() => {
|
|
40
|
+
const n = {};
|
|
41
|
+
return C && (n.onClose = () => C(!1)), i != null && i.popover && (n.popoverProps = i.popover), n;
|
|
42
|
+
}, [C, i.popover]), E = x(
|
|
43
|
+
() => !d || u ? (n) => {
|
|
44
|
+
var S;
|
|
45
|
+
I("details", y.current, { type: o, value: e, classification: t }, w()), (S = f.onClick) == null || S.call(f, n), n.stopPropagation(), n.preventDefault();
|
|
46
|
+
} : f.onClick,
|
|
67
47
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
68
|
-
[
|
|
48
|
+
[d, u, f, o, e, t]
|
|
69
49
|
);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}, [classification, forceDetails, type, value]);
|
|
81
|
-
return /* @__PURE__ */ jsxs(
|
|
82
|
-
Stack,
|
|
50
|
+
return oi(() => {
|
|
51
|
+
r ? I("details", y.current, { type: o, value: e, classification: t }, w()) : H("details", {
|
|
52
|
+
type: o,
|
|
53
|
+
value: e,
|
|
54
|
+
classification: t
|
|
55
|
+
});
|
|
56
|
+
}, [t, r, o, e]), /* @__PURE__ */ J(
|
|
57
|
+
L,
|
|
83
58
|
{
|
|
84
|
-
ref:
|
|
59
|
+
ref: y,
|
|
85
60
|
direction: "row",
|
|
86
61
|
spacing: 1,
|
|
87
62
|
alignItems: "center",
|
|
88
|
-
...
|
|
89
|
-
className: `enriched-typography ${((
|
|
63
|
+
...i == null ? void 0 : i.stack,
|
|
64
|
+
className: `enriched-typography ${((A = i == null ? void 0 : i.stack) == null ? void 0 : A.className) ?? ""}`.trim(),
|
|
90
65
|
sx: [
|
|
91
66
|
{
|
|
92
|
-
cursor: !
|
|
67
|
+
cursor: !p && !d ? "pointer" : "inherit",
|
|
93
68
|
borderBottom: "1px solid transparent",
|
|
94
|
-
transition:
|
|
69
|
+
transition: b.transitions.create(["border-bottom-color"]),
|
|
95
70
|
"&:hover": {
|
|
96
|
-
borderBottomColor: !
|
|
71
|
+
borderBottomColor: !p && (d ? null : b.palette.primary.light)
|
|
97
72
|
}
|
|
98
73
|
},
|
|
99
|
-
...Array.isArray((
|
|
74
|
+
...Array.isArray((q = i == null ? void 0 : i.stack) == null ? void 0 : q.sx) ? (v = i == null ? void 0 : i.stack) == null ? void 0 : v.sx : [(B = i == null ? void 0 : i.stack) == null ? void 0 : B.sx]
|
|
100
75
|
],
|
|
101
|
-
onClick:
|
|
76
|
+
onClick: u ? void 0 : E,
|
|
102
77
|
children: [
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
|
|
78
|
+
/* @__PURE__ */ a(
|
|
79
|
+
z,
|
|
105
80
|
{
|
|
106
|
-
ubiquitous:
|
|
107
|
-
value: { type, value, classification },
|
|
108
|
-
annotations,
|
|
109
|
-
counters,
|
|
110
|
-
disableTooltip:
|
|
81
|
+
ubiquitous: !0,
|
|
82
|
+
value: { type: o, value: e, classification: t },
|
|
83
|
+
annotations: m,
|
|
84
|
+
counters: c,
|
|
85
|
+
disableTooltip: r
|
|
111
86
|
}
|
|
112
87
|
),
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
|
|
88
|
+
/* @__PURE__ */ a(
|
|
89
|
+
O,
|
|
115
90
|
{
|
|
116
|
-
ubiquitous:
|
|
117
|
-
value: { type, value, classification },
|
|
118
|
-
annotations,
|
|
119
|
-
counters,
|
|
120
|
-
disableTooltip:
|
|
91
|
+
ubiquitous: !0,
|
|
92
|
+
value: { type: o, value: e, classification: t },
|
|
93
|
+
annotations: m,
|
|
94
|
+
counters: c,
|
|
95
|
+
disableTooltip: r
|
|
121
96
|
}
|
|
122
97
|
),
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
|
|
98
|
+
/* @__PURE__ */ a(
|
|
99
|
+
N,
|
|
125
100
|
{
|
|
126
|
-
ubiquitous:
|
|
127
|
-
value: { type, value, classification },
|
|
128
|
-
annotations,
|
|
129
|
-
counters,
|
|
130
|
-
showExtraIcon:
|
|
131
|
-
disableTooltip:
|
|
101
|
+
ubiquitous: !0,
|
|
102
|
+
value: { type: o, value: e, classification: t },
|
|
103
|
+
annotations: m,
|
|
104
|
+
counters: c,
|
|
105
|
+
showExtraIcon: h,
|
|
106
|
+
disableTooltip: r
|
|
132
107
|
}
|
|
133
108
|
),
|
|
134
|
-
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
|
|
109
|
+
G ?? /* @__PURE__ */ a(D, { id: `enriched-${o}-value`, ...f, annotations: m, value: e }),
|
|
110
|
+
/* @__PURE__ */ a(
|
|
111
|
+
z,
|
|
137
112
|
{
|
|
138
|
-
value: { type, value, classification },
|
|
139
|
-
annotations,
|
|
140
|
-
counters,
|
|
141
|
-
disableTooltip:
|
|
113
|
+
value: { type: o, value: e, classification: t },
|
|
114
|
+
annotations: m,
|
|
115
|
+
counters: c,
|
|
116
|
+
disableTooltip: r
|
|
142
117
|
}
|
|
143
118
|
),
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
|
|
119
|
+
/* @__PURE__ */ a(
|
|
120
|
+
O,
|
|
146
121
|
{
|
|
147
|
-
value: { type, value, classification },
|
|
148
|
-
annotations,
|
|
149
|
-
counters,
|
|
150
|
-
disableTooltip:
|
|
122
|
+
value: { type: o, value: e, classification: t },
|
|
123
|
+
annotations: m,
|
|
124
|
+
counters: c,
|
|
125
|
+
disableTooltip: r
|
|
151
126
|
}
|
|
152
127
|
),
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
|
|
128
|
+
/* @__PURE__ */ a(
|
|
129
|
+
N,
|
|
155
130
|
{
|
|
156
|
-
value: { type, value, classification },
|
|
157
|
-
annotations,
|
|
158
|
-
counters,
|
|
159
|
-
showExtraIcon:
|
|
160
|
-
disableTooltip:
|
|
131
|
+
value: { type: o, value: e, classification: t },
|
|
132
|
+
annotations: m,
|
|
133
|
+
counters: c,
|
|
134
|
+
showExtraIcon: h,
|
|
135
|
+
disableTooltip: r
|
|
161
136
|
}
|
|
162
137
|
),
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
-
|
|
165
|
-
!
|
|
138
|
+
/* @__PURE__ */ a(_, { counters: c, value: { type: o, value: e, classification: t }, disableTooltip: r }),
|
|
139
|
+
p && !R && /* @__PURE__ */ a(Q, { color: "primary", size: 18 }),
|
|
140
|
+
!p && u && /* @__PURE__ */ a(U, { title: M("details.open"), children: /* @__PURE__ */ a(V, { size: "small", onClick: E, sx: { color: b.palette.action.disabled }, children: /* @__PURE__ */ a(W, { icon: "ic:outline-info" }) }) })
|
|
166
141
|
]
|
|
167
142
|
}
|
|
168
143
|
);
|
|
169
|
-
};
|
|
170
|
-
const EnrichedTypography_default = memo(EnrichedTypography);
|
|
144
|
+
}, si = P(ei);
|
|
171
145
|
export {
|
|
172
|
-
|
|
146
|
+
si as default
|
|
173
147
|
};
|
|
@@ -1,36 +1,32 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Accordion, AccordionSummary, Typography, AccordionDetails } from "@mui/material";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
class
|
|
6
|
-
constructor(
|
|
7
|
-
super(
|
|
8
|
-
this.state = { hasError: false, error: null };
|
|
1
|
+
import { jsx as r, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { Box as n, Accordion as i, AccordionSummary as a, Typography as t, AccordionDetails as s } from "@mui/material";
|
|
3
|
+
import c from "./display/icons/Iconified.js";
|
|
4
|
+
import d from "react";
|
|
5
|
+
class f extends d.Component {
|
|
6
|
+
constructor(e) {
|
|
7
|
+
super(e), this.state = { hasError: !1, error: null };
|
|
9
8
|
}
|
|
10
|
-
static getDerivedStateFromError(
|
|
11
|
-
return { hasError:
|
|
9
|
+
static getDerivedStateFromError(e) {
|
|
10
|
+
return { hasError: !0, error: e };
|
|
12
11
|
}
|
|
13
|
-
componentDidCatch(
|
|
14
|
-
this.setState({ hasError:
|
|
12
|
+
componentDidCatch(e) {
|
|
13
|
+
this.setState({ hasError: !0, error: e });
|
|
15
14
|
}
|
|
16
15
|
render() {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
] }) });
|
|
30
|
-
}
|
|
31
|
-
return this.props.children;
|
|
16
|
+
return this.state.hasError ? /* @__PURE__ */ r(n, { pt: 6, textAlign: "center", fontSize: 20, children: /* @__PURE__ */ o(i, { elevation: 0, children: [
|
|
17
|
+
/* @__PURE__ */ r(
|
|
18
|
+
a,
|
|
19
|
+
{
|
|
20
|
+
expandIcon: /* @__PURE__ */ r(c, { icon: "ic:baseline-expand-more" }),
|
|
21
|
+
"aria-controls": "panel1-content",
|
|
22
|
+
id: "panel1-header",
|
|
23
|
+
children: /* @__PURE__ */ r(t, { align: "center", sx: { width: "100%", fontSize: "1.2rem" }, variant: "h5", children: this.state.error.message })
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ r(s, { children: /* @__PURE__ */ r("code", { children: /* @__PURE__ */ r(t, { variant: "h6", children: this.state.error.stack }) }) })
|
|
27
|
+
] }) }) : this.props.children;
|
|
32
28
|
}
|
|
33
29
|
}
|
|
34
30
|
export {
|
|
35
|
-
|
|
31
|
+
f as default
|
|
36
32
|
};
|